dawood HF staff commited on
Commit
74ba51d
1 Parent(s): c7ccc62

Upload folder using huggingface_hub

Browse files
.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
README.md CHANGED
@@ -1,17 +1,406 @@
1
 
2
- ---
3
- tags: [gradio-custom-component,machine learning,reproducibility,visualization,gradio,gradio-template-Audio]
4
- title: gradio_unifiedaudio V0.0.2
5
- colorFrom: green
6
- colorTo: gray
7
- sdk: docker
8
- pinned: false
9
- license: apache-2.0
10
- ---
11
 
 
12
 
13
- # Name: gradio_unifiedaudio
14
 
15
- Description: Python library for easily interacting with trained machine learning models
 
 
16
 
17
- Install with: pip install gradio_unifiedaudio
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ # `gradio_unifiedaudio`
3
+ <a href="https://pypi.org/project/gradio_unifiedaudio/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_unifiedaudio"></a>
 
 
 
 
 
 
 
4
 
5
+ Python library for easily interacting with trained machine learning models
6
 
7
+ ## Installation
8
 
9
+ ```bash
10
+ pip install gradio_unifiedaudio
11
+ ```
12
 
13
+ ## Usage
14
+
15
+ ```python
16
+ import gradio as gr
17
+ from gradio_unifiedaudio import UnifiedAudio
18
+ from pathlib import Path
19
+ import numpy as np
20
+ import time
21
+
22
+ example = UnifiedAudio().example_inputs()
23
+ dir_ = Path(__file__).parent
24
+
25
+ def add_to_stream(audio, instream):
26
+ if instream is None:
27
+ ret = audio
28
+ else:
29
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
30
+ return audio, ret
31
+
32
+ def stop_recording(audio):
33
+ return UnifiedAudio(value=audio, streaming=False)
34
+
35
+ def stop_playing():
36
+ return UnifiedAudio(value=None, streaming=True), None
37
+
38
+ with gr.Blocks() as demo:
39
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
40
+ stream = gr.State()
41
+
42
+ mic.stop_recording(stop_recording, stream, mic)
43
+ # mic.end(lambda: [None, None], None, [mic, stream])
44
+ mic.end(stop_playing, None, [mic, stream])
45
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
46
+
47
+ if __name__ == '__main__':
48
+ demo.launch()
49
+ ```
50
+
51
+ ## `UnifiedAudio`
52
+
53
+ ### Initialization
54
+
55
+ <table>
56
+ <thead>
57
+ <tr>
58
+ <th align="left">name</th>
59
+ <th align="left" style="width: 25%;">type</th>
60
+ <th align="left">default</th>
61
+ <th align="left">description</th>
62
+ </tr>
63
+ </thead>
64
+ <tbody>
65
+ <tr>
66
+ <td align="left"><code>value</code></td>
67
+ <td align="left" style="width: 25%;">
68
+
69
+ ```python
70
+ str
71
+ | pathlib.Path
72
+ | tuple[int, numpy.ndarray]
73
+ | Callable
74
+ | None
75
+ ```
76
+
77
+ </td>
78
+ <td align="left"><code>None</code></td>
79
+ <td align="left">A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that UnifiedAudio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td align="left"><code>image</code></td>
84
+ <td align="left" style="width: 25%;">
85
+
86
+ ```python
87
+ str | None
88
+ ```
89
+
90
+ </td>
91
+ <td align="left"><code>None</code></td>
92
+ <td align="left">A path or URL to an image to display above the audio component. If None, no image will be displayed.</td>
93
+ </tr>
94
+
95
+ <tr>
96
+ <td align="left"><code>sources</code></td>
97
+ <td align="left" style="width: 25%;">
98
+
99
+ ```python
100
+ list["upload" | "microphone"] | None
101
+ ```
102
+
103
+ </td>
104
+ <td align="left"><code>None</code></td>
105
+ <td align="left">A list of sources permitted for audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. The first element in the list will be used as the default source. If None, defaults to ["upload", "microphone"], or ["microphone"] if `streaming` is True.</td>
106
+ </tr>
107
+
108
+ <tr>
109
+ <td align="left"><code>type</code></td>
110
+ <td align="left" style="width: 25%;">
111
+
112
+ ```python
113
+ "numpy" | "filepath"
114
+ ```
115
+
116
+ </td>
117
+ <td align="left"><code>"numpy"</code></td>
118
+ <td align="left">The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio.</td>
119
+ </tr>
120
+
121
+ <tr>
122
+ <td align="left"><code>label</code></td>
123
+ <td align="left" style="width: 25%;">
124
+
125
+ ```python
126
+ str | None
127
+ ```
128
+
129
+ </td>
130
+ <td align="left"><code>None</code></td>
131
+ <td align="left">The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.</td>
132
+ </tr>
133
+
134
+ <tr>
135
+ <td align="left"><code>every</code></td>
136
+ <td align="left" style="width: 25%;">
137
+
138
+ ```python
139
+ float | None
140
+ ```
141
+
142
+ </td>
143
+ <td align="left"><code>None</code></td>
144
+ <td align="left">If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.</td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td align="left"><code>show_label</code></td>
149
+ <td align="left" style="width: 25%;">
150
+
151
+ ```python
152
+ bool | None
153
+ ```
154
+
155
+ </td>
156
+ <td align="left"><code>None</code></td>
157
+ <td align="left">if True, will display label.</td>
158
+ </tr>
159
+
160
+ <tr>
161
+ <td align="left"><code>container</code></td>
162
+ <td align="left" style="width: 25%;">
163
+
164
+ ```python
165
+ bool
166
+ ```
167
+
168
+ </td>
169
+ <td align="left"><code>True</code></td>
170
+ <td align="left">If True, will place the component in a container - providing some extra padding around the border.</td>
171
+ </tr>
172
+
173
+ <tr>
174
+ <td align="left"><code>scale</code></td>
175
+ <td align="left" style="width: 25%;">
176
+
177
+ ```python
178
+ int | None
179
+ ```
180
+
181
+ </td>
182
+ <td align="left"><code>None</code></td>
183
+ <td align="left">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.</td>
184
+ </tr>
185
+
186
+ <tr>
187
+ <td align="left"><code>min_width</code></td>
188
+ <td align="left" style="width: 25%;">
189
+
190
+ ```python
191
+ int
192
+ ```
193
+
194
+ </td>
195
+ <td align="left"><code>160</code></td>
196
+ <td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
197
+ </tr>
198
+
199
+ <tr>
200
+ <td align="left"><code>interactive</code></td>
201
+ <td align="left" style="width: 25%;">
202
+
203
+ ```python
204
+ bool | None
205
+ ```
206
+
207
+ </td>
208
+ <td align="left"><code>None</code></td>
209
+ <td align="left">if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.</td>
210
+ </tr>
211
+
212
+ <tr>
213
+ <td align="left"><code>visible</code></td>
214
+ <td align="left" style="width: 25%;">
215
+
216
+ ```python
217
+ bool
218
+ ```
219
+
220
+ </td>
221
+ <td align="left"><code>True</code></td>
222
+ <td align="left">If False, component will be hidden.</td>
223
+ </tr>
224
+
225
+ <tr>
226
+ <td align="left"><code>streaming</code></td>
227
+ <td align="left" style="width: 25%;">
228
+
229
+ ```python
230
+ bool
231
+ ```
232
+
233
+ </td>
234
+ <td align="left"><code>False</code></td>
235
+ <td align="left">If set to True when used in a `live` interface as an input, will automatically stream webcam feed. When used set as an output, takes audio chunks yield from the backend and combines them into one streaming audio output.</td>
236
+ </tr>
237
+
238
+ <tr>
239
+ <td align="left"><code>elem_id</code></td>
240
+ <td align="left" style="width: 25%;">
241
+
242
+ ```python
243
+ str | None
244
+ ```
245
+
246
+ </td>
247
+ <td align="left"><code>None</code></td>
248
+ <td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
249
+ </tr>
250
+
251
+ <tr>
252
+ <td align="left"><code>elem_classes</code></td>
253
+ <td align="left" style="width: 25%;">
254
+
255
+ ```python
256
+ list[str] | str | None
257
+ ```
258
+
259
+ </td>
260
+ <td align="left"><code>None</code></td>
261
+ <td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
262
+ </tr>
263
+
264
+ <tr>
265
+ <td align="left"><code>render</code></td>
266
+ <td align="left" style="width: 25%;">
267
+
268
+ ```python
269
+ bool
270
+ ```
271
+
272
+ </td>
273
+ <td align="left"><code>True</code></td>
274
+ <td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
275
+ </tr>
276
+
277
+ <tr>
278
+ <td align="left"><code>format</code></td>
279
+ <td align="left" style="width: 25%;">
280
+
281
+ ```python
282
+ "wav" | "mp3"
283
+ ```
284
+
285
+ </td>
286
+ <td align="left"><code>"wav"</code></td>
287
+ <td align="left">The file format to save audio files. Either 'wav' or 'mp3'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output.</td>
288
+ </tr>
289
+
290
+ <tr>
291
+ <td align="left"><code>autoplay</code></td>
292
+ <td align="left" style="width: 25%;">
293
+
294
+ ```python
295
+ bool
296
+ ```
297
+
298
+ </td>
299
+ <td align="left"><code>False</code></td>
300
+ <td align="left">Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet.</td>
301
+ </tr>
302
+
303
+ <tr>
304
+ <td align="left"><code>show_share_button</code></td>
305
+ <td align="left" style="width: 25%;">
306
+
307
+ ```python
308
+ bool | None
309
+ ```
310
+
311
+ </td>
312
+ <td align="left"><code>None</code></td>
313
+ <td align="left">If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.</td>
314
+ </tr>
315
+
316
+ <tr>
317
+ <td align="left"><code>min_length</code></td>
318
+ <td align="left" style="width: 25%;">
319
+
320
+ ```python
321
+ int | None
322
+ ```
323
+
324
+ </td>
325
+ <td align="left"><code>None</code></td>
326
+ <td align="left">The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.</td>
327
+ </tr>
328
+
329
+ <tr>
330
+ <td align="left"><code>max_length</code></td>
331
+ <td align="left" style="width: 25%;">
332
+
333
+ ```python
334
+ int | None
335
+ ```
336
+
337
+ </td>
338
+ <td align="left"><code>None</code></td>
339
+ <td align="left">The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.</td>
340
+ </tr>
341
+
342
+ <tr>
343
+ <td align="left"><code>waveform_options</code></td>
344
+ <td align="left" style="width: 25%;">
345
+
346
+ ```python
347
+ WaveformOptions | None
348
+ ```
349
+
350
+ </td>
351
+ <td align="left"><code>None</code></td>
352
+ <td align="left">A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.</td>
353
+ </tr>
354
+ </tbody></table>
355
+
356
+
357
+ ### Events
358
+
359
+ | name | description |
360
+ |:-----|:------------|
361
+ | `stream` | This listener is triggered when the user streams the UnifiedAudio. |
362
+ | `change` | Triggered when the value of the UnifiedAudio changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |
363
+ | `clear` | This listener is triggered when the user clears the UnifiedAudio using the X button for the component. |
364
+ | `play` | This listener is triggered when the user plays the media in the UnifiedAudio. |
365
+ | `pause` | This listener is triggered when the media in the UnifiedAudio stops for any reason. |
366
+ | `stop` | This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio. |
367
+ | `start_recording` | This listener is triggered when the user starts recording with the UnifiedAudio. |
368
+ | `pause_recording` | This listener is triggered when the user pauses recording with the UnifiedAudio. |
369
+ | `stop_recording` | This listener is triggered when the user stops recording with the UnifiedAudio. |
370
+ | `upload` | This listener is triggered when the user uploads a file into the UnifiedAudio. |
371
+ | `end` | This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio. |
372
+
373
+
374
+
375
+ ### User function
376
+
377
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
378
+
379
+ - When used as an Input, the component only impacts the input signature of the user function.
380
+ - When used as an output, the component only impacts the return signature of the user function.
381
+
382
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
383
+
384
+ - **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.
385
+ - **As input:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
386
+
387
+ ```python
388
+ def predict(
389
+ value: tuple[int, numpy.ndarray] | str | None
390
+ ) -> tuple[int, numpy.ndarray]
391
+ | str
392
+ | pathlib.Path
393
+ | bytes
394
+ | None:
395
+ return value
396
+ ```
397
+
398
+
399
+ ## `WaveformOptions`
400
+ ```python
401
+ class WaveformOptions(TypedDict, total=False):
402
+ waveform_color: str
403
+ waveform_progress_color: str
404
+ show_controls: bool
405
+ skip_length: int
406
+ ```
app.py CHANGED
@@ -1,22 +1,33 @@
1
-
2
  import gradio as gr
3
  from gradio_unifiedaudio import UnifiedAudio
4
- from os.path import abspath, join, pardir
5
  from pathlib import Path
 
 
6
 
7
  example = UnifiedAudio().example_inputs()
8
  dir_ = Path(__file__).parent
9
 
10
- def test_mic(audio):
11
- return UnifiedAudio(value=audio, image="demo/freeman.jpg")
 
 
 
 
 
 
 
12
 
13
- def clear(audio):
14
- return UnifiedAudio(value=None)
15
 
16
  with gr.Blocks() as demo:
17
- mic = UnifiedAudio(sources="microphone")
18
- mic.change(test_mic, mic, mic)
19
- mic.end(clear, mic, mic)
 
 
 
 
20
 
21
  if __name__ == '__main__':
22
- demo.launch()
 
 
1
  import gradio as gr
2
  from gradio_unifiedaudio import UnifiedAudio
 
3
  from pathlib import Path
4
+ import numpy as np
5
+ import time
6
 
7
  example = UnifiedAudio().example_inputs()
8
  dir_ = Path(__file__).parent
9
 
10
+ def add_to_stream(audio, instream):
11
+ if instream is None:
12
+ ret = audio
13
+ else:
14
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
15
+ return audio, ret
16
+
17
+ def stop_recording(audio):
18
+ return UnifiedAudio(value=audio, streaming=False)
19
 
20
+ def stop_playing():
21
+ return UnifiedAudio(value=None, streaming=True), None
22
 
23
  with gr.Blocks() as demo:
24
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
25
+ stream = gr.State()
26
+
27
+ mic.stop_recording(stop_recording, stream, mic)
28
+ # mic.end(lambda: [None, None], None, [mic, stream])
29
+ mic.end(stop_playing, None, [mic, stream])
30
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
31
 
32
  if __name__ == '__main__':
33
+ demo.launch()
space.py CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'UnifiedAudio': {'description': 'Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).', 'members': {'__init__': {'value': {'type': 'str\n | pathlib.Path\n | tuple[int, numpy.ndarray]\n | Callable\n | None', 'default': 'None', 'description': 'A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that UnifiedAudio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'image': {'type': 'str | None', 'default': 'None', 'description': 'A path or URL to an image to display above the audio component. If None, no image will be displayed.'}, 'sources': {'type': 'list["upload" | "microphone"] | None', 'default': 'None', 'description': 'A list of sources permitted for audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. The first element in the list will be used as the default source. If None, defaults to ["upload", "microphone"], or ["microphone"] if `streaming` is True.'}, 'type': {'type': '"numpy" | "filepath"', 'default': '"numpy"', 'description': 'The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': '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.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'streaming': {'type': 'bool', 'default': 'False', 'description': 'If set to True when used in a `live` interface as an input, will automatically stream webcam feed. When used set as an output, takes audio chunks yield from the backend and combines them into one streaming audio output.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'format': {'type': '"wav" | "mp3"', 'default': '"wav"', 'description': 'The file format to save audio files. Either \'wav\' or \'mp3\'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output.'}, 'autoplay': {'type': 'bool', 'default': 'False', 'description': 'Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet.'}, 'show_share_button': {'type': 'bool | None', 'default': 'None', 'description': 'If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.'}, 'min_length': {'type': 'int | None', 'default': 'None', 'description': 'The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.'}, 'waveform_options': {'type': 'WaveformOptions | None', 'default': 'None', 'description': 'A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.'}}, 'postprocess': {'value': {'type': 'tuple[int, numpy.ndarray]\n | str\n | pathlib.Path\n | bytes\n | None', 'description': 'audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.'}}, 'preprocess': {'return': {'type': 'tuple[int, numpy.ndarray] | str | None', 'description': None}, 'value': None}}, 'events': {'stream': {'type': None, 'default': None, 'description': 'This listener is triggered when the user streams the UnifiedAudio.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the UnifiedAudio changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the UnifiedAudio using the X button for the component.'}, 'play': {'type': None, 'default': None, 'description': 'This listener is triggered when the user plays the media in the UnifiedAudio.'}, 'pause': {'type': None, 'default': None, 'description': 'This listener is triggered when the media in the UnifiedAudio stops for any reason.'}, 'stop': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}, 'start_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user starts recording with the UnifiedAudio.'}, 'pause_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user pauses recording with the UnifiedAudio.'}, 'stop_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user stops recording with the UnifiedAudio.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the UnifiedAudio.'}}}, '__meta__': {'additional_interfaces': {'WaveformOptions': {'source': 'class WaveformOptions(TypedDict, total=False):\n waveform_color: str\n waveform_progress_color: str\n show_controls: bool\n skip_length: int'}}, 'user_fn_refs': {'UnifiedAudio': []}}}
7
-
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
10
  with gr.Blocks(
@@ -21,7 +21,7 @@ with gr.Blocks(
21
  # `gradio_unifiedaudio`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.2%20-%20orange">
25
  </div>
26
 
27
  Python library for easily interacting with trained machine learning models
@@ -38,25 +38,39 @@ pip install gradio_unifiedaudio
38
  ## Usage
39
 
40
  ```python
41
-
42
  import gradio as gr
43
  from gradio_unifiedaudio import UnifiedAudio
44
- from os.path import abspath, join, pardir
45
  from pathlib import Path
 
 
46
 
47
  example = UnifiedAudio().example_inputs()
48
  dir_ = Path(__file__).parent
49
 
50
- def test_mic(audio):
51
- return UnifiedAudio(value=audio)
 
 
 
 
 
 
 
 
 
 
52
 
53
  with gr.Blocks() as demo:
54
- mic = UnifiedAudio(sources="microphone")
55
- mic.change(test_mic, mic, mic)
 
 
 
 
 
56
 
57
  if __name__ == '__main__':
58
  demo.launch()
59
-
60
  ```
61
  """, elem_classes=["md-custom"], header_links=True)
62
 
@@ -82,11 +96,12 @@ if __name__ == '__main__':
82
 
83
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
84
 
85
- - When used as an Input, the component only impacts the input signature of the user function.
86
- - When used as an output, the component only impacts the return signature of the user function.
87
 
88
  The code snippet below is accurate in cases where the component is used as both an input and an output.
89
 
 
90
  - **As output:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
91
 
92
  ```python
@@ -133,7 +148,7 @@ class WaveformOptions(TypedDict, total=False):
133
  })
134
  }
135
  })
136
-
137
  Object.entries(refs).forEach(([key, refs]) => {
138
  if (refs.length > 0) {
139
  const el = document.querySelector(`.${key}`);
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'UnifiedAudio': {'description': 'Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).', 'members': {'__init__': {'value': {'type': 'str\n | pathlib.Path\n | tuple[int, numpy.ndarray]\n | Callable\n | None', 'default': 'None', 'description': 'A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that UnifiedAudio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'image': {'type': 'str | None', 'default': 'None', 'description': 'A path or URL to an image to display above the audio component. If None, no image will be displayed.'}, 'sources': {'type': 'list["upload" | "microphone"] | None', 'default': 'None', 'description': 'A list of sources permitted for audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. The first element in the list will be used as the default source. If None, defaults to ["upload", "microphone"], or ["microphone"] if `streaming` is True.'}, 'type': {'type': '"numpy" | "filepath"', 'default': '"numpy"', 'description': 'The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': '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.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'streaming': {'type': 'bool', 'default': 'False', 'description': 'If set to True when used in a `live` interface as an input, will automatically stream webcam feed. When used set as an output, takes audio chunks yield from the backend and combines them into one streaming audio output.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'format': {'type': '"wav" | "mp3"', 'default': '"wav"', 'description': 'The file format to save audio files. Either \'wav\' or \'mp3\'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output.'}, 'autoplay': {'type': 'bool', 'default': 'False', 'description': 'Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet.'}, 'show_share_button': {'type': 'bool | None', 'default': 'None', 'description': 'If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.'}, 'min_length': {'type': 'int | None', 'default': 'None', 'description': 'The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.'}, 'waveform_options': {'type': 'WaveformOptions | None', 'default': 'None', 'description': 'A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.'}}, 'postprocess': {'value': {'type': 'tuple[int, numpy.ndarray]\n | str\n | pathlib.Path\n | bytes\n | None', 'description': 'audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.'}}, 'preprocess': {'return': {'type': 'tuple[int, numpy.ndarray] | str | None', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'stream': {'type': None, 'default': None, 'description': 'This listener is triggered when the user streams the UnifiedAudio.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the UnifiedAudio changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the UnifiedAudio using the X button for the component.'}, 'play': {'type': None, 'default': None, 'description': 'This listener is triggered when the user plays the media in the UnifiedAudio.'}, 'pause': {'type': None, 'default': None, 'description': 'This listener is triggered when the media in the UnifiedAudio stops for any reason.'}, 'stop': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}, 'start_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user starts recording with the UnifiedAudio.'}, 'pause_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user pauses recording with the UnifiedAudio.'}, 'stop_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user stops recording with the UnifiedAudio.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the UnifiedAudio.'}, 'end': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}}}, '__meta__': {'additional_interfaces': {'WaveformOptions': {'source': 'class WaveformOptions(TypedDict, total=False):\n waveform_color: str\n waveform_progress_color: str\n show_controls: bool\n skip_length: int'}}, 'user_fn_refs': {'UnifiedAudio': []}}}
7
+
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
10
  with gr.Blocks(
 
21
  # `gradio_unifiedaudio`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_unifiedaudio/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_unifiedaudio"></a>
25
  </div>
26
 
27
  Python library for easily interacting with trained machine learning models
 
38
  ## Usage
39
 
40
  ```python
 
41
  import gradio as gr
42
  from gradio_unifiedaudio import UnifiedAudio
 
43
  from pathlib import Path
44
+ import numpy as np
45
+ import time
46
 
47
  example = UnifiedAudio().example_inputs()
48
  dir_ = Path(__file__).parent
49
 
50
+ def add_to_stream(audio, instream):
51
+ if instream is None:
52
+ ret = audio
53
+ else:
54
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
55
+ return audio, ret
56
+
57
+ def stop_recording(audio):
58
+ return UnifiedAudio(value=audio, streaming=False)
59
+
60
+ def stop_playing():
61
+ return UnifiedAudio(value=None, streaming=True), None
62
 
63
  with gr.Blocks() as demo:
64
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
65
+ stream = gr.State()
66
+
67
+ mic.stop_recording(stop_recording, stream, mic)
68
+ # mic.end(lambda: [None, None], None, [mic, stream])
69
+ mic.end(stop_playing, None, [mic, stream])
70
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
71
 
72
  if __name__ == '__main__':
73
  demo.launch()
 
74
  ```
75
  """, elem_classes=["md-custom"], header_links=True)
76
 
 
96
 
97
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
98
 
99
+ - When used as an Input, the component only impacts the input signature of the user function.
100
+ - When used as an output, the component only impacts the return signature of the user function.
101
 
102
  The code snippet below is accurate in cases where the component is used as both an input and an output.
103
 
104
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
105
  - **As output:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
106
 
107
  ```python
 
148
  })
149
  }
150
  })
151
+
152
  Object.entries(refs).forEach(([key, refs]) => {
153
  if (refs.length > 0) {
154
  const el = document.querySelector(`.${key}`);
src/README.md CHANGED
@@ -1,37 +1,51 @@
1
 
2
  # `gradio_unifiedaudio`
3
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.2%20-%20orange">
4
 
5
  Python library for easily interacting with trained machine learning models
6
 
7
  ## Installation
8
-
9
- ```bash
10
  pip install gradio_unifiedaudio
11
  ```
12
 
13
  ## Usage
14
 
15
  ```python
16
-
17
  import gradio as gr
18
  from gradio_unifiedaudio import UnifiedAudio
19
- from os.path import abspath, join, pardir
20
  from pathlib import Path
 
 
21
 
22
  example = UnifiedAudio().example_inputs()
23
  dir_ = Path(__file__).parent
24
 
25
- def test_mic(audio):
26
- return UnifiedAudio(value=audio)
 
 
 
 
 
 
 
 
 
 
27
 
28
  with gr.Blocks() as demo:
29
- mic = UnifiedAudio(sources="microphone")
30
- mic.change(test_mic, mic, mic)
 
 
 
 
 
31
 
32
  if __name__ == '__main__':
33
  demo.launch()
34
-
35
  ```
36
 
37
  ## `UnifiedAudio`
@@ -354,6 +368,7 @@ WaveformOptions | None
354
  | `pause_recording` | This listener is triggered when the user pauses recording with the UnifiedAudio. |
355
  | `stop_recording` | This listener is triggered when the user stops recording with the UnifiedAudio. |
356
  | `upload` | This listener is triggered when the user uploads a file into the UnifiedAudio. |
 
357
 
358
 
359
 
@@ -361,11 +376,12 @@ WaveformOptions | None
361
 
362
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
363
 
364
- - When used as an Input, the component only impacts the input signature of the user function.
365
- - When used as an output, the component only impacts the return signature of the user function.
366
 
367
  The code snippet below is accurate in cases where the component is used as both an input and an output.
368
 
 
369
  - **As input:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
370
 
371
  ```python
 
1
 
2
  # `gradio_unifiedaudio`
3
+ <a href="https://pypi.org/project/gradio_unifiedaudio/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_unifiedaudio"></a>
4
 
5
  Python library for easily interacting with trained machine learning models
6
 
7
  ## Installation
8
+
9
+ ```bash
10
  pip install gradio_unifiedaudio
11
  ```
12
 
13
  ## Usage
14
 
15
  ```python
 
16
  import gradio as gr
17
  from gradio_unifiedaudio import UnifiedAudio
 
18
  from pathlib import Path
19
+ import numpy as np
20
+ import time
21
 
22
  example = UnifiedAudio().example_inputs()
23
  dir_ = Path(__file__).parent
24
 
25
+ def add_to_stream(audio, instream):
26
+ if instream is None:
27
+ ret = audio
28
+ else:
29
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
30
+ return audio, ret
31
+
32
+ def stop_recording(audio):
33
+ return UnifiedAudio(value=audio, streaming=False)
34
+
35
+ def stop_playing():
36
+ return UnifiedAudio(value=None, streaming=True), None
37
 
38
  with gr.Blocks() as demo:
39
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
40
+ stream = gr.State()
41
+
42
+ mic.stop_recording(stop_recording, stream, mic)
43
+ # mic.end(lambda: [None, None], None, [mic, stream])
44
+ mic.end(stop_playing, None, [mic, stream])
45
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
46
 
47
  if __name__ == '__main__':
48
  demo.launch()
 
49
  ```
50
 
51
  ## `UnifiedAudio`
 
368
  | `pause_recording` | This listener is triggered when the user pauses recording with the UnifiedAudio. |
369
  | `stop_recording` | This listener is triggered when the user stops recording with the UnifiedAudio. |
370
  | `upload` | This listener is triggered when the user uploads a file into the UnifiedAudio. |
371
+ | `end` | This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio. |
372
 
373
 
374
 
 
376
 
377
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
378
 
379
+ - When used as an Input, the component only impacts the input signature of the user function.
380
+ - When used as an output, the component only impacts the return signature of the user function.
381
 
382
  The code snippet below is accurate in cases where the component is used as both an input and an output.
383
 
384
+ - **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.
385
  - **As input:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
386
 
387
  ```python
src/backend/gradio_unifiedaudio/templates/component/__vite-browser-external-DYxpcVy9.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ const e = {};
2
+ export {
3
+ e as default
4
+ };
src/backend/gradio_unifiedaudio/templates/component/index.js CHANGED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_unifiedaudio/templates/component/module-BPgIyIuo.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const w = (t) => (n) => {
2
+ const e = t(n);
3
+ return n.add(e), e;
4
+ }, N = (t) => (n, e) => (t.set(n, e), e), f = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, g = 536870912, _ = g * 2, O = (t, n) => (e) => {
5
+ const r = n.get(e);
6
+ let s = r === void 0 ? e.size : r < _ ? r + 1 : 0;
7
+ if (!e.has(s))
8
+ return t(e, s);
9
+ if (e.size < g) {
10
+ for (; e.has(s); )
11
+ s = Math.floor(Math.random() * _);
12
+ return t(e, s);
13
+ }
14
+ if (e.size > f)
15
+ throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");
16
+ for (; e.has(s); )
17
+ s = Math.floor(Math.random() * f);
18
+ return t(e, s);
19
+ }, M = /* @__PURE__ */ new WeakMap(), m = N(M), h = O(m, M), I = w(h), R = (t) => typeof t.start == "function", p = /* @__PURE__ */ new WeakMap(), A = (t) => ({
20
+ ...t,
21
+ connect: ({ call: n }) => async () => {
22
+ const { port1: e, port2: r } = new MessageChannel(), s = await n("connect", { port: e }, [e]);
23
+ return p.set(r, s), r;
24
+ },
25
+ disconnect: ({ call: n }) => async (e) => {
26
+ const r = p.get(e);
27
+ if (r === void 0)
28
+ throw new Error("The given port is not connected.");
29
+ await n("disconnect", { portId: r });
30
+ },
31
+ isSupported: ({ call: n }) => () => n("isSupported")
32
+ }), E = /* @__PURE__ */ new WeakMap(), b = (t) => {
33
+ if (E.has(t))
34
+ return E.get(t);
35
+ const n = /* @__PURE__ */ new Map();
36
+ return E.set(t, n), n;
37
+ }, W = (t) => {
38
+ const n = A(t);
39
+ return (e) => {
40
+ const r = b(e);
41
+ e.addEventListener("message", ({ data: o }) => {
42
+ const { id: a } = o;
43
+ if (a !== null && r.has(a)) {
44
+ const { reject: u, resolve: c } = r.get(a);
45
+ r.delete(a), o.error === void 0 ? c(o.result) : u(new Error(o.error.message));
46
+ }
47
+ }), R(e) && e.start();
48
+ const s = (o, a = null, u = []) => new Promise((c, l) => {
49
+ const d = h(r);
50
+ r.set(d, { reject: l, resolve: c }), a === null ? e.postMessage({ id: d, method: o }, u) : e.postMessage({ id: d, method: o, params: a }, u);
51
+ }), T = (o, a, u = []) => {
52
+ e.postMessage({ id: null, method: o, params: a }, u);
53
+ };
54
+ let i = {};
55
+ for (const [o, a] of Object.entries(n))
56
+ i = { ...i, [o]: a({ call: s, notify: T }) };
57
+ return { ...i };
58
+ };
59
+ };
60
+ export {
61
+ I as a,
62
+ W as c,
63
+ h as g
64
+ };
src/backend/gradio_unifiedaudio/templates/component/module-ORH6OG8U.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_unifiedaudio/templates/component/module-kgNHl8Dh.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { c as i } from "./module-BPgIyIuo.js";
2
+ const c = i({
3
+ characterize: ({ call: e }) => () => e("characterize"),
4
+ encode: ({ call: e }) => (r, n) => e("encode", { recordingId: r, timeslice: n }),
5
+ record: ({ call: e }) => async (r, n, o) => {
6
+ await e("record", { recordingId: r, sampleRate: n, typedArrays: o }, o.map(({ buffer: a }) => a));
7
+ }
8
+ }), u = (e) => {
9
+ const r = new Worker(e);
10
+ return c(r);
11
+ }, l = `(()=>{var e={775:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return void 0===t?e:t.reduce((function(e,t){if("capitalize"===t){var o=e.charAt(0).toUpperCase(),s=e.slice(1);return"".concat(o).concat(s)}return"dashify"===t?r(e):"prependIndefiniteArticle"===t?"".concat(n(e)," ").concat(e):e}),e)},s=function(e){var t=e.name+e.modifiers.map((function(e){return"\\\\.".concat(e,"\\\\(\\\\)")})).join("");return new RegExp("\\\\$\\\\{".concat(t,"}"),"g")},a=function(e,r){for(var n=/\\\${([^.}]+)((\\.[^(]+\\(\\))*)}/g,a=[],i=n.exec(e);null!==i;){var u={modifiers:[],name:i[1]};if(void 0!==i[3])for(var c=/\\.[^(]+\\(\\)/g,l=c.exec(i[2]);null!==l;)u.modifiers.push(l[0].slice(1,-2)),l=c.exec(i[2]);a.push(u),i=n.exec(e)}var d=a.reduce((function(e,n){return e.map((function(e){return"string"==typeof e?e.split(s(n)).reduce((function(e,s,a){return 0===a?[s]:n.name in r?[].concat(t(e),[o(r[n.name],n.modifiers),s]):[].concat(t(e),[function(e){return o(e[n.name],n.modifiers)},s])}),[]):[e]})).reduce((function(e,r){return[].concat(t(e),t(r))}),[])}),[e]);return function(e){return d.reduce((function(r,n){return[].concat(t(r),"string"==typeof n?[n]:[n(e)])}),[]).join("")}},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0===e.code?void 0:a(e.code,t),n=void 0===e.message?void 0:a(e.message,t);function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,s=void 0===o&&(t instanceof Error||void 0!==t.code&&"Exception"===t.code.slice(-9))?{cause:t,missingParameters:{}}:{cause:o,missingParameters:t},a=s.cause,i=s.missingParameters,u=void 0===n?new Error:new Error(n(i));return null!==a&&(u.cause=a),void 0!==r&&(u.code=r(i)),void 0!==e.status&&(u.status=e.status),u}return o};e.compile=i}(t,r(106),r(881),r(507))},881:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e)throw new TypeError("expected a string");return e.trim().replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\\W/g,(e=>/[À-ž]/.test(e)?e:"-")).replace(/^-+|-+$/g,"").replace(/-{2,}/g,(e=>t&&t.condense?"-":e)).toLowerCase()}},107:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)},507:e=>{var t=function(e){var t,r,n=/\\w+/.exec(e);if(!n)return"an";var o=(r=n[0]).toLowerCase(),s=["honest","hour","hono"];for(t in s)if(0==o.indexOf(s[t]))return"an";if(1==o.length)return"aedhilmnorsx".indexOf(o)>=0?"an":"a";if(r.match(/(?!FJO|[HLMNS]Y.|RY[EO]|SQU|(F[LR]?|[HL]|MN?|N|RH?|S[CHKLMNPTVW]?|X(YL)?)[AEIOU])[FHLMNRSX][A-Z]/))return"an";var a=[/^e[uw]/,/^onc?e\\b/,/^uni([^nmd]|mo)/,/^u[bcfhjkqrst][aeiou]/];for(t=0;t<a.length;t++)if(o.match(a[t]))return"a";return r.match(/^U[NK][AIEO]/)?"a":r==r.toUpperCase()?"aedhilmnorsx".indexOf(o[0])>=0?"an":"a":"aeiou".indexOf(o[0])>=0||o.match(/^y(b[lor]|cl[ea]|fere|gg|p[ios]|rou|tt)/)?"an":"a"};void 0!==e.exports?e.exports=t:window.indefiniteArticle=t},768:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},907:(e,t,r)=>{var n=r(768);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},642:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},344:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},106:(e,t,r)=>{var n=r(907),o=r(642),s=r(906),a=r(344);e.exports=function(e){return n(e)||o(e)||s(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},906:(e,t,r)=>{var n=r(768);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";var e=r(775);const t=-32603,n=-32602,o=-32601,s=(0,e.compile)({message:'The requested method called "\${method}" is not supported.',status:o}),a=(0,e.compile)({message:'The handler of the method called "\${method}" returned no required result.',status:t}),i=(0,e.compile)({message:'The handler of the method called "\${method}" returned an unexpected result.',status:t}),u=(0,e.compile)({message:'The specified parameter called "portId" with the given value "\${portId}" does not identify a port connected to this worker.',status:n});var c=r(107);const l=new Map,d=(e,t,r)=>({...t,connect:r=>{let{port:n}=r;n.start();const o=e(n,t),s=(0,c.generateUniqueNumber)(l);return l.set(s,(()=>{o(),n.close(),l.delete(s)})),{result:s}},disconnect:e=>{let{portId:t}=e;const r=l.get(t);if(void 0===r)throw u({portId:t.toString()});return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=t=>{let{data:r}=t;return e(null!==r)},n.postMessage(t,[t])}))){const e=r();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),f=function(e,t){const r=d(f,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0),n=((e,t)=>async r=>{let{data:{id:n,method:o,params:u}}=r;const c=t[o];try{if(void 0===c)throw s({method:o});const t=void 0===u?c():c(u);if(void 0===t)throw a({method:o});const r=t instanceof Promise?await t:t;if(null===n){if(void 0!==r.result)throw i({method:o})}else{if(void 0===r.result)throw i({method:o});const{result:t,transferables:s=[]}=r;e.postMessage({id:n,result:t},s)}}catch(t){const{message:r,status:o=-32603}=t;e.postMessage({error:{code:o,message:r},id:n})}})(e,r);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},p=e=>e.reduce(((e,t)=>e+t.length),0),m=(e,t)=>{const r=[];let n=0;e:for(;n<t;){const t=e.length;for(let o=0;o<t;o+=1){const t=e[o];void 0===r[o]&&(r[o]=[]);const s=t.shift();if(void 0===s)break e;r[o].push(s),0===o&&(n+=s.length)}}if(n>t){const o=n-t;r.forEach(((t,r)=>{const n=t.pop(),s=n.length-o;t.push(n.subarray(0,s)),e[r].unshift(n.subarray(s))}))}return r},h=new Map,v=(e=>(t,r,n)=>{const o=e.get(t);if(void 0===o){const o={channelDataArrays:n.map((e=>[e])),isComplete:!0,sampleRate:r};return e.set(t,o),o}return o.channelDataArrays.forEach(((e,t)=>e.push(n[t]))),o})(h),g=((e,t)=>(r,n,o,s)=>{const a=o>>3,i="subsequent"===n?0:44,u=r.length,c=e(r[0]),l=new ArrayBuffer(c*u*a+i),d=new DataView(l);return"subsequent"!==n&&t(d,o,u,"complete"===n?c:Number.POSITIVE_INFINITY,s),r.forEach(((e,t)=>{let r=i+t*a;e.forEach((e=>{const t=e.length;for(let n=0;n<t;n+=1){const t=e[n];d.setInt16(r,t<0?32768*Math.max(-1,t):32767*Math.min(1,t),!0),r+=u*a}}))})),[l]})(p,((e,t,r,n,o)=>{const s=t>>3,a=Math.min(n*r*s,4294967251);e.setUint32(0,1380533830),e.setUint32(4,a+36,!0),e.setUint32(8,1463899717),e.setUint32(12,1718449184),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,r,!0),e.setUint32(24,o,!0),e.setUint32(28,o*r*s,!0),e.setUint16(32,r*s,!0),e.setUint16(34,t,!0),e.setUint32(36,1684108385),e.setUint32(40,a,!0)})),x=new Map;f(self,{characterize:()=>({result:/^audio\\/wav$/}),encode:e=>{let{recordingId:t,timeslice:r}=e;const n=x.get(t);void 0!==n&&(x.delete(t),n.reject(new Error("Another request was made to initiate an encoding.")));const o=h.get(t);if(null!==r){if(void 0===o||p(o.channelDataArrays[0])*(1e3/o.sampleRate)<r)return new Promise(((e,n)=>{x.set(t,{reject:n,resolve:e,timeslice:r})}));const e=m(o.channelDataArrays,Math.ceil(r*(o.sampleRate/1e3))),n=g(e,o.isComplete?"initial":"subsequent",16,o.sampleRate);return o.isComplete=!1,{result:n,transferables:n}}if(void 0!==o){const e=g(o.channelDataArrays,o.isComplete?"complete":"subsequent",16,o.sampleRate);return h.delete(t),{result:e,transferables:e}}return{result:[],transferables:[]}},record:e=>{let{recordingId:t,sampleRate:r,typedArrays:n}=e;const o=v(t,r,n),s=x.get(t);if(void 0!==s&&p(o.channelDataArrays[0])*(1e3/r)>=s.timeslice){const e=m(o.channelDataArrays,Math.ceil(s.timeslice*(r/1e3))),n=g(e,o.isComplete?"initial":"subsequent",16,r);o.isComplete=!1,x.delete(t),s.resolve({result:n,transferables:n})}return{result:null}}})})()})();`, d = new Blob([l], { type: "application/javascript; charset=utf-8" }), s = URL.createObjectURL(d), t = u(s), p = t.characterize, m = t.connect, h = t.disconnect, g = t.encode, v = t.isSupported, x = t.record;
12
+ URL.revokeObjectURL(s);
13
+ export {
14
+ p as characterize,
15
+ m as connect,
16
+ h as disconnect,
17
+ g as encode,
18
+ v as isSupported,
19
+ x as record
20
+ };
src/backend/gradio_unifiedaudio/templates/component/style.css CHANGED
@@ -1 +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-xtz2g8{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}.padded.svelte-xtz2g8{padding:2px;background:var(--background-fill-primary);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-xtz2g8:hover{cursor:pointer;color:var(--color-accent)}.padded.svelte-xtz2g8:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-xtz2g8{padding:0 1px;font-size:10px}div.svelte-xtz2g8{padding:2px;display:flex;align-items:flex-end}.small.svelte-xtz2g8{width:14px;height:14px}.large.svelte-xtz2g8{width:22px;height:22px}.pending.svelte-xtz2g8{animation:svelte-xtz2g8-flash .5s infinite}@keyframes svelte-xtz2g8-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-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-1nba87b{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;box-shadow:var(--shadow-drop);padding:var(--spacing-xl) 0;color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-1nba87b{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl)}.source-selection.svelte-lde7lt{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;align-self:flex-end}.icon.svelte-lde7lt{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-lde7lt{color:var(--color-accent)}.icon.svelte-lde7lt:hover,.icon.svelte-lde7lt:focus{color:var(--color-accent)}.settings-wrapper.svelte-1duohn5.svelte-1duohn5{display:flex;justify-self:self-end}.text-button.svelte-1duohn5.svelte-1duohn5{border:1px solid var(--neutral-400);border-radius:var(--radius-sm);font-weight:300;font-size:var(--size-3);text-align:center;color:var(--neutral-400);height:var(--size-5);font-weight:700;padding:0 5px;margin-left:5px}.text-button.svelte-1duohn5.svelte-1duohn5:hover,.text-button.svelte-1duohn5.svelte-1duohn5:focus{color:var(--color-accent);border-color:var(--color-accent)}.controls.svelte-1duohn5.svelte-1duohn5{display:grid;grid-template-columns:1fr 1fr 1fr;margin-top:5px;overflow:hidden;align-items:center}@media (max-width: 320px){.controls.svelte-1duohn5.svelte-1duohn5{display:flex;flex-wrap:wrap}.controls.svelte-1duohn5 .svelte-1duohn5{margin:var(--spacing-sm)}.controls.svelte-1duohn5 .text-button.svelte-1duohn5{margin-left:0}}.action.svelte-1duohn5.svelte-1duohn5{width:var(--size-5);color:var(--neutral-400);margin-left:var(--spacing-md)}.icon.svelte-1duohn5.svelte-1duohn5:hover,.icon.svelte-1duohn5.svelte-1duohn5:focus{color:var(--color-accent)}.play-pause-wrapper.svelte-1duohn5.svelte-1duohn5{display:flex;justify-self:center}.playback.svelte-1duohn5.svelte-1duohn5{border:1px solid var(--neutral-400);border-radius:var(--radius-sm);width:5.5ch;font-weight:300;font-size:var(--size-3);text-align:center;color:var(--neutral-400);height:var(--size-5);font-weight:700}.playback.svelte-1duohn5.svelte-1duohn5:hover{color:var(--color-accent);border-color:var(--color-accent)}.rewind.svelte-1duohn5.svelte-1duohn5,.skip.svelte-1duohn5.svelte-1duohn5{margin:0 10px;color:var(--neutral-400)}.play-pause-button.svelte-1duohn5.svelte-1duohn5{width:var(--size-8);display:flex;align-items:center;justify-content:center;color:var(--neutral-400);fill:var(--neutral-400)}.component-wrapper.svelte-1iry1ax{padding:var(--size-3)}.timestamps.svelte-1iry1ax{display:flex;justify-content:space-between;align-items:center;width:100%;padding:var(--size-1) 0}#time.svelte-1iry1ax,#duration.svelte-1iry1ax{color:var(--neutral-400)}#trim-duration.svelte-1iry1ax{color:var(--color-accent);margin-right:var(--spacing-sm)}.waveform-container.svelte-1iry1ax{display:flex;align-items:center;justify-content:center;width:var(--size-full)}#waveform.svelte-1iry1ax{width:100%;height:100%;position:relative}audio.svelte-1cxvpx.svelte-1cxvpx{display:none}.image-container.svelte-1cxvpx.svelte-1cxvpx{position:relative;width:350px;height:350px;margin:auto}.image-player.svelte-1cxvpx.svelte-1cxvpx{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;object-fit:cover}.play-icon.svelte-1cxvpx.svelte-1cxvpx,.pause-icon.svelte-1cxvpx.svelte-1cxvpx{position:absolute;top:50%;left:50%;width:75px;height:75px;transform:translate(-50%,-50%)}.pause-icon.svelte-1cxvpx.svelte-1cxvpx{opacity:0;transition:opacity .3s}.image-container.svelte-1cxvpx:hover .pause-icon.svelte-1cxvpx,.circle-container.svelte-1cxvpx:hover .pause-icon.svelte-1cxvpx{opacity:1}.circle-container.svelte-1cxvpx:hover .waveform-bar.svelte-1cxvpx{opacity:.5}.circle-container.svelte-1cxvpx.svelte-1cxvpx{width:350px;height:350px;margin:auto;border-radius:50%;border:3px solid white;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center}.waveform-image.svelte-1cxvpx.svelte-1cxvpx{opacity:.5}.waveform-bar.svelte-1cxvpx.svelte-1cxvpx{background-color:#fff;width:2%;height:20%;margin:0 1%;border-radius:5px;opacity:.5;transform-origin:bottom}.waveform-animation-0.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation0 1s infinite ease-in-out;opacity:1}.waveform-animation-1.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation1 1.5s infinite ease-in-out;opacity:1}.waveform-animation-2.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation2 3s infinite ease-in-out;opacity:1}.waveform-animation-3.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation3 2s infinite ease-in-out;opacity:1}.waveform-animation-4.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation4 2.5s infinite ease-in-out;opacity:1}.waveform-animation-5.svelte-1cxvpx.svelte-1cxvpx{animation:svelte-1cxvpx-waveAnimation5 3.5s infinite ease-in-out;opacity:1}@keyframes svelte-1cxvpx-waveAnimation0{0%,to{height:50%}50%{height:15%}}@keyframes svelte-1cxvpx-waveAnimation1{0%,to{height:45%}50%{height:25%}}@keyframes svelte-1cxvpx-waveAnimation2{0%,to{height:40%}50%{height:60%}}@keyframes svelte-1cxvpx-waveAnimation3{0%,to{height:70%}50%{height:25%}}@keyframes svelte-1cxvpx-waveAnimation4{0%,to{height:25%}50%{height:70%}}@keyframes svelte-1cxvpx-waveAnimation5{0%,to{height:60%}50%{height:15%}}button.svelte-a356bc{cursor:pointer;width:var(--size-full)}.hidden.svelte-a356bc{display:none;height:0;position:absolute}.center.svelte-a356bc{display:flex;justify-content:center}.flex.svelte-a356bc{display:flex;justify-content:center;align-items:center}input.svelte-a356bc{display:none}div.svelte-1wj0ocy{display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.not-absolute.svelte-1wj0ocy{margin:var(--size-1)}.wrapper.svelte-g0zaxm{display:flex;justify-content:center;align-items:center;border-radius:50px}.microphone-icon.svelte-g0zaxm,.stop-icon.svelte-g0zaxm{display:flex;align-items:center;justify-content:center;height:100%}.record-button.svelte-g0zaxm{height:350px;width:350px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:white;border:6px solid rgb(0,140,255)}.stop-button.svelte-g0zaxm{height:350px;width:350px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:white;border:6px solid red}@keyframes svelte-g0zaxm-pulsate{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.pulsate.svelte-g0zaxm{animation:svelte-g0zaxm-pulsate 1s infinite}.record-button.svelte-g0zaxm:disabled{cursor:not-allowed;opacity:.5}@keyframes svelte-g0zaxm-scaling{0%{background-color:var(--primary-600);scale:1}50%{background-color:var(--primary-600);scale:1.2}to{background-color:var(--primary-600);scale:1}}#microphone.svelte-1smaui2{width:100%;display:none}.component-wrapper.svelte-1smaui2{padding:var(--size-3)}.mic-wrap.svelte-1ho79kd{display:block;align-items:center;margin:var(--spacing-xl)}.stop-button-paused.svelte-1ho79kd{display:none;height:var(--size-8);width:var(--size-20);background-color:var(--block-background-fill);border-radius:var(--radius-3xl);align-items:center;border:1px solid var(--neutral-400);margin-right:5px}.stop-button-paused.svelte-1ho79kd:before{content:"";height:var(--size-4);width:var(--size-4);border-radius:var(--radius-full);background:var(--primary-600);margin:0 var(--spacing-xl)}.stop-button.svelte-1ho79kd:before{content:"";height:var(--size-4);width:var(--size-4);border-radius:var(--radius-full);background:var(--primary-600);margin:0 var(--spacing-xl);animation:scaling 1.8s infinite}.stop-button.svelte-1ho79kd{height:var(--size-8);width:var(--size-20);background-color:var(--block-background-fill);border-radius:var(--radius-3xl);align-items:center;border:1px solid var(--primary-600);margin-right:5px;display:flex}.record-button.svelte-1ho79kd:before{content:"";height:var(--size-4);width:var(--size-4);border-radius:var(--radius-full);background:var(--primary-600);margin:0 var(--spacing-xl)}.record-button.svelte-1ho79kd{height:var(--size-8);width:var(--size-24);background-color:var(--block-background-fill);border-radius:var(--radius-3xl);display:flex;align-items:center;border:1px solid var(--neutral-400)}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))}}.gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}
 
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-xtz2g8{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}.padded.svelte-xtz2g8{padding:2px;background:var(--background-fill-primary);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-xtz2g8:hover{cursor:pointer;color:var(--color-accent)}.padded.svelte-xtz2g8:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-xtz2g8{padding:0 1px;font-size:10px}div.svelte-xtz2g8{padding:2px;display:flex;align-items:flex-end}.small.svelte-xtz2g8{width:14px;height:14px}.large.svelte-xtz2g8{width:22px;height:22px}.pending.svelte-xtz2g8{animation:svelte-xtz2g8-flash .5s infinite}@keyframes svelte-xtz2g8-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-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-1nba87b{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;box-shadow:var(--shadow-drop);padding:var(--spacing-xl) 0;color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-1nba87b{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl)}.source-selection.svelte-lde7lt{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;align-self:flex-end}.icon.svelte-lde7lt{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-lde7lt{color:var(--color-accent)}.icon.svelte-lde7lt:hover,.icon.svelte-lde7lt:focus{color:var(--color-accent)}audio.svelte-3kusfn.svelte-3kusfn{display:none}.image-container.svelte-3kusfn.svelte-3kusfn{position:relative;width:350px;height:350px;margin:auto}.image-player.svelte-3kusfn.svelte-3kusfn{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;object-fit:cover}.play-icon.svelte-3kusfn.svelte-3kusfn,.pause-icon.svelte-3kusfn.svelte-3kusfn{color:#fff;pointer-events:none;position:absolute;top:50%;left:50%;width:75px;height:75px;transform:translate(-50%,-50%)}.circle-container.svelte-3kusfn:hover .play-icon.svelte-3kusfn{width:90px;height:90px}.pause-icon.svelte-3kusfn.svelte-3kusfn{opacity:0;transition:opacity .3s}.image-container.svelte-3kusfn:hover .pause-icon.svelte-3kusfn,.circle-container.svelte-3kusfn:hover .pause-icon.svelte-3kusfn{opacity:1}.circle-container.svelte-3kusfn:hover .waveform-bar.svelte-3kusfn{opacity:.5}.circle-container.svelte-3kusfn.svelte-3kusfn{width:350px;height:350px;margin:auto;border-radius:50%;background:var(--button-secondary-background-fill);position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center}.waveform-image.svelte-3kusfn.svelte-3kusfn{opacity:.5}.waveform-bar.svelte-3kusfn.svelte-3kusfn{background:#000;width:2%;height:20%;margin:0 1%;border-radius:5px;opacity:.5;transform-origin:bottom}.waveform-animation-0.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation0 1s infinite ease-in-out;opacity:1}.waveform-animation-1.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation1 1.5s infinite ease-in-out;opacity:1}.waveform-animation-2.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation2 3s infinite ease-in-out;opacity:1}.waveform-animation-3.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation3 2s infinite ease-in-out;opacity:1}.waveform-animation-4.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation4 2.5s infinite ease-in-out;opacity:1}.waveform-animation-5.svelte-3kusfn.svelte-3kusfn{animation:svelte-3kusfn-waveAnimation5 3.5s infinite ease-in-out;opacity:1}@keyframes svelte-3kusfn-waveAnimation0{0%,to{height:50%}50%{height:15%}}@keyframes svelte-3kusfn-waveAnimation1{0%,to{height:45%}50%{height:25%}}@keyframes svelte-3kusfn-waveAnimation2{0%,to{height:40%}50%{height:60%}}@keyframes svelte-3kusfn-waveAnimation3{0%,to{height:70%}50%{height:25%}}@keyframes svelte-3kusfn-waveAnimation4{0%,to{height:25%}50%{height:70%}}@keyframes svelte-3kusfn-waveAnimation5{0%,to{height:60%}50%{height:15%}}.settings-wrapper.svelte-1duohn5.svelte-1duohn5{display:flex;justify-self:self-end}.text-button.svelte-1duohn5.svelte-1duohn5{border:1px solid var(--neutral-400);border-radius:var(--radius-sm);font-weight:300;font-size:var(--size-3);text-align:center;color:var(--neutral-400);height:var(--size-5);font-weight:700;padding:0 5px;margin-left:5px}.text-button.svelte-1duohn5.svelte-1duohn5:hover,.text-button.svelte-1duohn5.svelte-1duohn5:focus{color:var(--color-accent);border-color:var(--color-accent)}.controls.svelte-1duohn5.svelte-1duohn5{display:grid;grid-template-columns:1fr 1fr 1fr;margin-top:5px;overflow:hidden;align-items:center}@media (max-width: 320px){.controls.svelte-1duohn5.svelte-1duohn5{display:flex;flex-wrap:wrap}.controls.svelte-1duohn5 .svelte-1duohn5{margin:var(--spacing-sm)}.controls.svelte-1duohn5 .text-button.svelte-1duohn5{margin-left:0}}.action.svelte-1duohn5.svelte-1duohn5{width:var(--size-5);color:var(--neutral-400);margin-left:var(--spacing-md)}.icon.svelte-1duohn5.svelte-1duohn5:hover,.icon.svelte-1duohn5.svelte-1duohn5:focus{color:var(--color-accent)}.play-pause-wrapper.svelte-1duohn5.svelte-1duohn5{display:flex;justify-self:center}.playback.svelte-1duohn5.svelte-1duohn5{border:1px solid var(--neutral-400);border-radius:var(--radius-sm);width:5.5ch;font-weight:300;font-size:var(--size-3);text-align:center;color:var(--neutral-400);height:var(--size-5);font-weight:700}.playback.svelte-1duohn5.svelte-1duohn5:hover{color:var(--color-accent);border-color:var(--color-accent)}.rewind.svelte-1duohn5.svelte-1duohn5,.skip.svelte-1duohn5.svelte-1duohn5{margin:0 10px;color:var(--neutral-400)}.play-pause-button.svelte-1duohn5.svelte-1duohn5{width:var(--size-8);display:flex;align-items:center;justify-content:center;color:var(--neutral-400);fill:var(--neutral-400)}#microphone.svelte-1smaui2{width:100%;display:none}.component-wrapper.svelte-1smaui2{padding:var(--size-3)}.wrapper.svelte-p78f4z{display:flex;justify-content:center;align-items:center;border-radius:50px}.microphone-icon.svelte-p78f4z,.stop-icon.svelte-p78f4z{display:flex;align-items:center;justify-content:center;height:100%}.record-button.svelte-p78f4z,.stop-button.svelte-p78f4z{height:350px;width:350px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--button-secondary-background-fill)}.record-button.svelte-p78f4z:hover{transform:scale(.95)}@keyframes svelte-p78f4z-pulsate{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.pulsate.svelte-p78f4z{animation:svelte-p78f4z-pulsate 1s infinite}.record-button.svelte-p78f4z:disabled{cursor:not-allowed;opacity:.5}@keyframes svelte-p78f4z-scaling{0%{background-color:var(--button-secondary-background-fill);scale:1}50%{background-color:var(--button-secondary-background-fill);scale:1.2}to{background-color:var(--button-secondary-background-fill);scale:1}}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))}}.component-wrapper.svelte-1iry1ax{padding:var(--size-3)}.timestamps.svelte-1iry1ax{display:flex;justify-content:space-between;align-items:center;width:100%;padding:var(--size-1) 0}#time.svelte-1iry1ax,#duration.svelte-1iry1ax{color:var(--neutral-400)}#trim-duration.svelte-1iry1ax{color:var(--color-accent);margin-right:var(--spacing-sm)}.waveform-container.svelte-1iry1ax{display:flex;align-items:center;justify-content:center;width:var(--size-full)}#waveform.svelte-1iry1ax{width:100%;height:100%;position:relative}.gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}
src/backend/gradio_unifiedaudio/templates/component/wrapper-98f94c21-DwfcsYZ5.js ADDED
@@ -0,0 +1,2447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import S from "./__vite-browser-external-DYxpcVy9.js";
2
+ function z(s) {
3
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
4
+ }
5
+ function gt(s) {
6
+ if (s.__esModule)
7
+ return s;
8
+ var e = s.default;
9
+ if (typeof e == "function") {
10
+ var t = function r() {
11
+ return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
12
+ };
13
+ t.prototype = e.prototype;
14
+ } else
15
+ t = {};
16
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(s).forEach(function(r) {
17
+ var i = Object.getOwnPropertyDescriptor(s, r);
18
+ Object.defineProperty(t, r, i.get ? i : {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return s[r];
22
+ }
23
+ });
24
+ }), t;
25
+ }
26
+ const { Duplex: yt } = S;
27
+ function Oe(s) {
28
+ s.emit("close");
29
+ }
30
+ function vt() {
31
+ !this.destroyed && this._writableState.finished && this.destroy();
32
+ }
33
+ function Qe(s) {
34
+ this.removeListener("error", Qe), this.destroy(), this.listenerCount("error") === 0 && this.emit("error", s);
35
+ }
36
+ function St(s, e) {
37
+ let t = !0;
38
+ const r = new yt({
39
+ ...e,
40
+ autoDestroy: !1,
41
+ emitClose: !1,
42
+ objectMode: !1,
43
+ writableObjectMode: !1
44
+ });
45
+ return s.on("message", function(n, o) {
46
+ const l = !o && r._readableState.objectMode ? n.toString() : n;
47
+ r.push(l) || s.pause();
48
+ }), s.once("error", function(n) {
49
+ r.destroyed || (t = !1, r.destroy(n));
50
+ }), s.once("close", function() {
51
+ r.destroyed || r.push(null);
52
+ }), r._destroy = function(i, n) {
53
+ if (s.readyState === s.CLOSED) {
54
+ n(i), process.nextTick(Oe, r);
55
+ return;
56
+ }
57
+ let o = !1;
58
+ s.once("error", function(f) {
59
+ o = !0, n(f);
60
+ }), s.once("close", function() {
61
+ o || n(i), process.nextTick(Oe, r);
62
+ }), t && s.terminate();
63
+ }, r._final = function(i) {
64
+ if (s.readyState === s.CONNECTING) {
65
+ s.once("open", function() {
66
+ r._final(i);
67
+ });
68
+ return;
69
+ }
70
+ s._socket !== null && (s._socket._writableState.finished ? (i(), r._readableState.endEmitted && r.destroy()) : (s._socket.once("finish", function() {
71
+ i();
72
+ }), s.close()));
73
+ }, r._read = function() {
74
+ s.isPaused && s.resume();
75
+ }, r._write = function(i, n, o) {
76
+ if (s.readyState === s.CONNECTING) {
77
+ s.once("open", function() {
78
+ r._write(i, n, o);
79
+ });
80
+ return;
81
+ }
82
+ s.send(i, o);
83
+ }, r.on("end", vt), r.on("error", Qe), r;
84
+ }
85
+ var Et = St;
86
+ const Vs = /* @__PURE__ */ z(Et);
87
+ var te = { exports: {} }, U = {
88
+ BINARY_TYPES: ["nodebuffer", "arraybuffer", "fragments"],
89
+ EMPTY_BUFFER: Buffer.alloc(0),
90
+ GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
91
+ kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
92
+ kListener: Symbol("kListener"),
93
+ kStatusCode: Symbol("status-code"),
94
+ kWebSocket: Symbol("websocket"),
95
+ NOOP: () => {
96
+ }
97
+ }, bt, xt;
98
+ const { EMPTY_BUFFER: kt } = U, Se = Buffer[Symbol.species];
99
+ function wt(s, e) {
100
+ if (s.length === 0)
101
+ return kt;
102
+ if (s.length === 1)
103
+ return s[0];
104
+ const t = Buffer.allocUnsafe(e);
105
+ let r = 0;
106
+ for (let i = 0; i < s.length; i++) {
107
+ const n = s[i];
108
+ t.set(n, r), r += n.length;
109
+ }
110
+ return r < e ? new Se(t.buffer, t.byteOffset, r) : t;
111
+ }
112
+ function Je(s, e, t, r, i) {
113
+ for (let n = 0; n < i; n++)
114
+ t[r + n] = s[n] ^ e[n & 3];
115
+ }
116
+ function et(s, e) {
117
+ for (let t = 0; t < s.length; t++)
118
+ s[t] ^= e[t & 3];
119
+ }
120
+ function Ot(s) {
121
+ return s.length === s.buffer.byteLength ? s.buffer : s.buffer.slice(s.byteOffset, s.byteOffset + s.length);
122
+ }
123
+ function Ee(s) {
124
+ if (Ee.readOnly = !0, Buffer.isBuffer(s))
125
+ return s;
126
+ let e;
127
+ return s instanceof ArrayBuffer ? e = new Se(s) : ArrayBuffer.isView(s) ? e = new Se(s.buffer, s.byteOffset, s.byteLength) : (e = Buffer.from(s), Ee.readOnly = !1), e;
128
+ }
129
+ te.exports = {
130
+ concat: wt,
131
+ mask: Je,
132
+ toArrayBuffer: Ot,
133
+ toBuffer: Ee,
134
+ unmask: et
135
+ };
136
+ if (!process.env.WS_NO_BUFFER_UTIL)
137
+ try {
138
+ const s = require("bufferutil");
139
+ xt = te.exports.mask = function(e, t, r, i, n) {
140
+ n < 48 ? Je(e, t, r, i, n) : s.mask(e, t, r, i, n);
141
+ }, bt = te.exports.unmask = function(e, t) {
142
+ e.length < 32 ? et(e, t) : s.unmask(e, t);
143
+ };
144
+ } catch {
145
+ }
146
+ var ne = te.exports;
147
+ const Ce = Symbol("kDone"), ue = Symbol("kRun");
148
+ let Ct = class {
149
+ /**
150
+ * Creates a new `Limiter`.
151
+ *
152
+ * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
153
+ * to run concurrently
154
+ */
155
+ constructor(e) {
156
+ this[Ce] = () => {
157
+ this.pending--, this[ue]();
158
+ }, this.concurrency = e || 1 / 0, this.jobs = [], this.pending = 0;
159
+ }
160
+ /**
161
+ * Adds a job to the queue.
162
+ *
163
+ * @param {Function} job The job to run
164
+ * @public
165
+ */
166
+ add(e) {
167
+ this.jobs.push(e), this[ue]();
168
+ }
169
+ /**
170
+ * Removes a job from the queue and runs it if possible.
171
+ *
172
+ * @private
173
+ */
174
+ [ue]() {
175
+ if (this.pending !== this.concurrency && this.jobs.length) {
176
+ const e = this.jobs.shift();
177
+ this.pending++, e(this[Ce]);
178
+ }
179
+ }
180
+ };
181
+ var Tt = Ct;
182
+ const W = S, Te = ne, Lt = Tt, { kStatusCode: tt } = U, Nt = Buffer[Symbol.species], Pt = Buffer.from([0, 0, 255, 255]), se = Symbol("permessage-deflate"), w = Symbol("total-length"), V = Symbol("callback"), C = Symbol("buffers"), J = Symbol("error");
183
+ let K, Rt = class {
184
+ /**
185
+ * Creates a PerMessageDeflate instance.
186
+ *
187
+ * @param {Object} [options] Configuration options
188
+ * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
189
+ * for, or request, a custom client window size
190
+ * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
191
+ * acknowledge disabling of client context takeover
192
+ * @param {Number} [options.concurrencyLimit=10] The number of concurrent
193
+ * calls to zlib
194
+ * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
195
+ * use of a custom server window size
196
+ * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
197
+ * disabling of server context takeover
198
+ * @param {Number} [options.threshold=1024] Size (in bytes) below which
199
+ * messages should not be compressed if context takeover is disabled
200
+ * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
201
+ * deflate
202
+ * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
203
+ * inflate
204
+ * @param {Boolean} [isServer=false] Create the instance in either server or
205
+ * client mode
206
+ * @param {Number} [maxPayload=0] The maximum allowed message length
207
+ */
208
+ constructor(e, t, r) {
209
+ if (this._maxPayload = r | 0, this._options = e || {}, this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024, this._isServer = !!t, this._deflate = null, this._inflate = null, this.params = null, !K) {
210
+ const i = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;
211
+ K = new Lt(i);
212
+ }
213
+ }
214
+ /**
215
+ * @type {String}
216
+ */
217
+ static get extensionName() {
218
+ return "permessage-deflate";
219
+ }
220
+ /**
221
+ * Create an extension negotiation offer.
222
+ *
223
+ * @return {Object} Extension parameters
224
+ * @public
225
+ */
226
+ offer() {
227
+ const e = {};
228
+ return this._options.serverNoContextTakeover && (e.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (e.client_no_context_takeover = !0), this._options.serverMaxWindowBits && (e.server_max_window_bits = this._options.serverMaxWindowBits), this._options.clientMaxWindowBits ? e.client_max_window_bits = this._options.clientMaxWindowBits : this._options.clientMaxWindowBits == null && (e.client_max_window_bits = !0), e;
229
+ }
230
+ /**
231
+ * Accept an extension negotiation offer/response.
232
+ *
233
+ * @param {Array} configurations The extension negotiation offers/reponse
234
+ * @return {Object} Accepted configuration
235
+ * @public
236
+ */
237
+ accept(e) {
238
+ return e = this.normalizeParams(e), this.params = this._isServer ? this.acceptAsServer(e) : this.acceptAsClient(e), this.params;
239
+ }
240
+ /**
241
+ * Releases all resources used by the extension.
242
+ *
243
+ * @public
244
+ */
245
+ cleanup() {
246
+ if (this._inflate && (this._inflate.close(), this._inflate = null), this._deflate) {
247
+ const e = this._deflate[V];
248
+ this._deflate.close(), this._deflate = null, e && e(
249
+ new Error(
250
+ "The deflate stream was closed while data was being processed"
251
+ )
252
+ );
253
+ }
254
+ }
255
+ /**
256
+ * Accept an extension negotiation offer.
257
+ *
258
+ * @param {Array} offers The extension negotiation offers
259
+ * @return {Object} Accepted configuration
260
+ * @private
261
+ */
262
+ acceptAsServer(e) {
263
+ const t = this._options, r = e.find((i) => !(t.serverNoContextTakeover === !1 && i.server_no_context_takeover || i.server_max_window_bits && (t.serverMaxWindowBits === !1 || typeof t.serverMaxWindowBits == "number" && t.serverMaxWindowBits > i.server_max_window_bits) || typeof t.clientMaxWindowBits == "number" && !i.client_max_window_bits));
264
+ if (!r)
265
+ throw new Error("None of the extension offers can be accepted");
266
+ return t.serverNoContextTakeover && (r.server_no_context_takeover = !0), t.clientNoContextTakeover && (r.client_no_context_takeover = !0), typeof t.serverMaxWindowBits == "number" && (r.server_max_window_bits = t.serverMaxWindowBits), typeof t.clientMaxWindowBits == "number" ? r.client_max_window_bits = t.clientMaxWindowBits : (r.client_max_window_bits === !0 || t.clientMaxWindowBits === !1) && delete r.client_max_window_bits, r;
267
+ }
268
+ /**
269
+ * Accept the extension negotiation response.
270
+ *
271
+ * @param {Array} response The extension negotiation response
272
+ * @return {Object} Accepted configuration
273
+ * @private
274
+ */
275
+ acceptAsClient(e) {
276
+ const t = e[0];
277
+ if (this._options.clientNoContextTakeover === !1 && t.client_no_context_takeover)
278
+ throw new Error('Unexpected parameter "client_no_context_takeover"');
279
+ if (!t.client_max_window_bits)
280
+ typeof this._options.clientMaxWindowBits == "number" && (t.client_max_window_bits = this._options.clientMaxWindowBits);
281
+ else if (this._options.clientMaxWindowBits === !1 || typeof this._options.clientMaxWindowBits == "number" && t.client_max_window_bits > this._options.clientMaxWindowBits)
282
+ throw new Error(
283
+ 'Unexpected or invalid parameter "client_max_window_bits"'
284
+ );
285
+ return t;
286
+ }
287
+ /**
288
+ * Normalize parameters.
289
+ *
290
+ * @param {Array} configurations The extension negotiation offers/reponse
291
+ * @return {Array} The offers/response with normalized parameters
292
+ * @private
293
+ */
294
+ normalizeParams(e) {
295
+ return e.forEach((t) => {
296
+ Object.keys(t).forEach((r) => {
297
+ let i = t[r];
298
+ if (i.length > 1)
299
+ throw new Error(`Parameter "${r}" must have only a single value`);
300
+ if (i = i[0], r === "client_max_window_bits") {
301
+ if (i !== !0) {
302
+ const n = +i;
303
+ if (!Number.isInteger(n) || n < 8 || n > 15)
304
+ throw new TypeError(
305
+ `Invalid value for parameter "${r}": ${i}`
306
+ );
307
+ i = n;
308
+ } else if (!this._isServer)
309
+ throw new TypeError(
310
+ `Invalid value for parameter "${r}": ${i}`
311
+ );
312
+ } else if (r === "server_max_window_bits") {
313
+ const n = +i;
314
+ if (!Number.isInteger(n) || n < 8 || n > 15)
315
+ throw new TypeError(
316
+ `Invalid value for parameter "${r}": ${i}`
317
+ );
318
+ i = n;
319
+ } else if (r === "client_no_context_takeover" || r === "server_no_context_takeover") {
320
+ if (i !== !0)
321
+ throw new TypeError(
322
+ `Invalid value for parameter "${r}": ${i}`
323
+ );
324
+ } else
325
+ throw new Error(`Unknown parameter "${r}"`);
326
+ t[r] = i;
327
+ });
328
+ }), e;
329
+ }
330
+ /**
331
+ * Decompress data. Concurrency limited.
332
+ *
333
+ * @param {Buffer} data Compressed data
334
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
335
+ * @param {Function} callback Callback
336
+ * @public
337
+ */
338
+ decompress(e, t, r) {
339
+ K.add((i) => {
340
+ this._decompress(e, t, (n, o) => {
341
+ i(), r(n, o);
342
+ });
343
+ });
344
+ }
345
+ /**
346
+ * Compress data. Concurrency limited.
347
+ *
348
+ * @param {(Buffer|String)} data Data to compress
349
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
350
+ * @param {Function} callback Callback
351
+ * @public
352
+ */
353
+ compress(e, t, r) {
354
+ K.add((i) => {
355
+ this._compress(e, t, (n, o) => {
356
+ i(), r(n, o);
357
+ });
358
+ });
359
+ }
360
+ /**
361
+ * Decompress data.
362
+ *
363
+ * @param {Buffer} data Compressed data
364
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
365
+ * @param {Function} callback Callback
366
+ * @private
367
+ */
368
+ _decompress(e, t, r) {
369
+ const i = this._isServer ? "client" : "server";
370
+ if (!this._inflate) {
371
+ const n = `${i}_max_window_bits`, o = typeof this.params[n] != "number" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];
372
+ this._inflate = W.createInflateRaw({
373
+ ...this._options.zlibInflateOptions,
374
+ windowBits: o
375
+ }), this._inflate[se] = this, this._inflate[w] = 0, this._inflate[C] = [], this._inflate.on("error", Bt), this._inflate.on("data", st);
376
+ }
377
+ this._inflate[V] = r, this._inflate.write(e), t && this._inflate.write(Pt), this._inflate.flush(() => {
378
+ const n = this._inflate[J];
379
+ if (n) {
380
+ this._inflate.close(), this._inflate = null, r(n);
381
+ return;
382
+ }
383
+ const o = Te.concat(
384
+ this._inflate[C],
385
+ this._inflate[w]
386
+ );
387
+ this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[w] = 0, this._inflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._inflate.reset()), r(null, o);
388
+ });
389
+ }
390
+ /**
391
+ * Compress data.
392
+ *
393
+ * @param {(Buffer|String)} data Data to compress
394
+ * @param {Boolean} fin Specifies whether or not this is the last fragment
395
+ * @param {Function} callback Callback
396
+ * @private
397
+ */
398
+ _compress(e, t, r) {
399
+ const i = this._isServer ? "server" : "client";
400
+ if (!this._deflate) {
401
+ const n = `${i}_max_window_bits`, o = typeof this.params[n] != "number" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];
402
+ this._deflate = W.createDeflateRaw({
403
+ ...this._options.zlibDeflateOptions,
404
+ windowBits: o
405
+ }), this._deflate[w] = 0, this._deflate[C] = [], this._deflate.on("data", Ut);
406
+ }
407
+ this._deflate[V] = r, this._deflate.write(e), this._deflate.flush(W.Z_SYNC_FLUSH, () => {
408
+ if (!this._deflate)
409
+ return;
410
+ let n = Te.concat(
411
+ this._deflate[C],
412
+ this._deflate[w]
413
+ );
414
+ t && (n = new Nt(n.buffer, n.byteOffset, n.length - 4)), this._deflate[V] = null, this._deflate[w] = 0, this._deflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._deflate.reset(), r(null, n);
415
+ });
416
+ }
417
+ };
418
+ var oe = Rt;
419
+ function Ut(s) {
420
+ this[C].push(s), this[w] += s.length;
421
+ }
422
+ function st(s) {
423
+ if (this[w] += s.length, this[se]._maxPayload < 1 || this[w] <= this[se]._maxPayload) {
424
+ this[C].push(s);
425
+ return;
426
+ }
427
+ this[J] = new RangeError("Max payload size exceeded"), this[J].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH", this[J][tt] = 1009, this.removeListener("data", st), this.reset();
428
+ }
429
+ function Bt(s) {
430
+ this[se]._inflate = null, s[tt] = 1007, this[V](s);
431
+ }
432
+ var re = { exports: {} };
433
+ const $t = {}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
434
+ __proto__: null,
435
+ default: $t
436
+ }, Symbol.toStringTag, { value: "Module" })), It = /* @__PURE__ */ gt(Mt);
437
+ var Le;
438
+ const { isUtf8: Ne } = S, Dt = [
439
+ 0,
440
+ 0,
441
+ 0,
442
+ 0,
443
+ 0,
444
+ 0,
445
+ 0,
446
+ 0,
447
+ 0,
448
+ 0,
449
+ 0,
450
+ 0,
451
+ 0,
452
+ 0,
453
+ 0,
454
+ 0,
455
+ // 0 - 15
456
+ 0,
457
+ 0,
458
+ 0,
459
+ 0,
460
+ 0,
461
+ 0,
462
+ 0,
463
+ 0,
464
+ 0,
465
+ 0,
466
+ 0,
467
+ 0,
468
+ 0,
469
+ 0,
470
+ 0,
471
+ 0,
472
+ // 16 - 31
473
+ 0,
474
+ 1,
475
+ 0,
476
+ 1,
477
+ 1,
478
+ 1,
479
+ 1,
480
+ 1,
481
+ 0,
482
+ 0,
483
+ 1,
484
+ 1,
485
+ 0,
486
+ 1,
487
+ 1,
488
+ 0,
489
+ // 32 - 47
490
+ 1,
491
+ 1,
492
+ 1,
493
+ 1,
494
+ 1,
495
+ 1,
496
+ 1,
497
+ 1,
498
+ 1,
499
+ 1,
500
+ 0,
501
+ 0,
502
+ 0,
503
+ 0,
504
+ 0,
505
+ 0,
506
+ // 48 - 63
507
+ 0,
508
+ 1,
509
+ 1,
510
+ 1,
511
+ 1,
512
+ 1,
513
+ 1,
514
+ 1,
515
+ 1,
516
+ 1,
517
+ 1,
518
+ 1,
519
+ 1,
520
+ 1,
521
+ 1,
522
+ 1,
523
+ // 64 - 79
524
+ 1,
525
+ 1,
526
+ 1,
527
+ 1,
528
+ 1,
529
+ 1,
530
+ 1,
531
+ 1,
532
+ 1,
533
+ 1,
534
+ 1,
535
+ 0,
536
+ 0,
537
+ 0,
538
+ 1,
539
+ 1,
540
+ // 80 - 95
541
+ 1,
542
+ 1,
543
+ 1,
544
+ 1,
545
+ 1,
546
+ 1,
547
+ 1,
548
+ 1,
549
+ 1,
550
+ 1,
551
+ 1,
552
+ 1,
553
+ 1,
554
+ 1,
555
+ 1,
556
+ 1,
557
+ // 96 - 111
558
+ 1,
559
+ 1,
560
+ 1,
561
+ 1,
562
+ 1,
563
+ 1,
564
+ 1,
565
+ 1,
566
+ 1,
567
+ 1,
568
+ 1,
569
+ 0,
570
+ 1,
571
+ 0,
572
+ 1,
573
+ 0
574
+ // 112 - 127
575
+ ];
576
+ function Wt(s) {
577
+ return s >= 1e3 && s <= 1014 && s !== 1004 && s !== 1005 && s !== 1006 || s >= 3e3 && s <= 4999;
578
+ }
579
+ function be(s) {
580
+ const e = s.length;
581
+ let t = 0;
582
+ for (; t < e; )
583
+ if (!(s[t] & 128))
584
+ t++;
585
+ else if ((s[t] & 224) === 192) {
586
+ if (t + 1 === e || (s[t + 1] & 192) !== 128 || (s[t] & 254) === 192)
587
+ return !1;
588
+ t += 2;
589
+ } else if ((s[t] & 240) === 224) {
590
+ if (t + 2 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || s[t] === 224 && (s[t + 1] & 224) === 128 || // Overlong
591
+ s[t] === 237 && (s[t + 1] & 224) === 160)
592
+ return !1;
593
+ t += 3;
594
+ } else if ((s[t] & 248) === 240) {
595
+ if (t + 3 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || (s[t + 3] & 192) !== 128 || s[t] === 240 && (s[t + 1] & 240) === 128 || // Overlong
596
+ s[t] === 244 && s[t + 1] > 143 || s[t] > 244)
597
+ return !1;
598
+ t += 4;
599
+ } else
600
+ return !1;
601
+ return !0;
602
+ }
603
+ re.exports = {
604
+ isValidStatusCode: Wt,
605
+ isValidUTF8: be,
606
+ tokenChars: Dt
607
+ };
608
+ if (Ne)
609
+ Le = re.exports.isValidUTF8 = function(s) {
610
+ return s.length < 24 ? be(s) : Ne(s);
611
+ };
612
+ else if (!process.env.WS_NO_UTF_8_VALIDATE)
613
+ try {
614
+ const s = It;
615
+ Le = re.exports.isValidUTF8 = function(e) {
616
+ return e.length < 32 ? be(e) : s(e);
617
+ };
618
+ } catch {
619
+ }
620
+ var ae = re.exports;
621
+ const { Writable: At } = S, Pe = oe, {
622
+ BINARY_TYPES: Ft,
623
+ EMPTY_BUFFER: Re,
624
+ kStatusCode: jt,
625
+ kWebSocket: Gt
626
+ } = U, { concat: de, toArrayBuffer: Vt, unmask: Ht } = ne, { isValidStatusCode: zt, isValidUTF8: Ue } = ae, X = Buffer[Symbol.species], A = 0, Be = 1, $e = 2, Me = 3, _e = 4, Yt = 5;
627
+ let qt = class extends At {
628
+ /**
629
+ * Creates a Receiver instance.
630
+ *
631
+ * @param {Object} [options] Options object
632
+ * @param {String} [options.binaryType=nodebuffer] The type for binary data
633
+ * @param {Object} [options.extensions] An object containing the negotiated
634
+ * extensions
635
+ * @param {Boolean} [options.isServer=false] Specifies whether to operate in
636
+ * client or server mode
637
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
638
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
639
+ * not to skip UTF-8 validation for text and close messages
640
+ */
641
+ constructor(e = {}) {
642
+ super(), this._binaryType = e.binaryType || Ft[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[Gt] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = !1, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = !1, this._fin = !1, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._state = A, this._loop = !1;
643
+ }
644
+ /**
645
+ * Implements `Writable.prototype._write()`.
646
+ *
647
+ * @param {Buffer} chunk The chunk of data to write
648
+ * @param {String} encoding The character encoding of `chunk`
649
+ * @param {Function} cb Callback
650
+ * @private
651
+ */
652
+ _write(e, t, r) {
653
+ if (this._opcode === 8 && this._state == A)
654
+ return r();
655
+ this._bufferedBytes += e.length, this._buffers.push(e), this.startLoop(r);
656
+ }
657
+ /**
658
+ * Consumes `n` bytes from the buffered data.
659
+ *
660
+ * @param {Number} n The number of bytes to consume
661
+ * @return {Buffer} The consumed bytes
662
+ * @private
663
+ */
664
+ consume(e) {
665
+ if (this._bufferedBytes -= e, e === this._buffers[0].length)
666
+ return this._buffers.shift();
667
+ if (e < this._buffers[0].length) {
668
+ const r = this._buffers[0];
669
+ return this._buffers[0] = new X(
670
+ r.buffer,
671
+ r.byteOffset + e,
672
+ r.length - e
673
+ ), new X(r.buffer, r.byteOffset, e);
674
+ }
675
+ const t = Buffer.allocUnsafe(e);
676
+ do {
677
+ const r = this._buffers[0], i = t.length - e;
678
+ e >= r.length ? t.set(this._buffers.shift(), i) : (t.set(new Uint8Array(r.buffer, r.byteOffset, e), i), this._buffers[0] = new X(
679
+ r.buffer,
680
+ r.byteOffset + e,
681
+ r.length - e
682
+ )), e -= r.length;
683
+ } while (e > 0);
684
+ return t;
685
+ }
686
+ /**
687
+ * Starts the parsing loop.
688
+ *
689
+ * @param {Function} cb Callback
690
+ * @private
691
+ */
692
+ startLoop(e) {
693
+ let t;
694
+ this._loop = !0;
695
+ do
696
+ switch (this._state) {
697
+ case A:
698
+ t = this.getInfo();
699
+ break;
700
+ case Be:
701
+ t = this.getPayloadLength16();
702
+ break;
703
+ case $e:
704
+ t = this.getPayloadLength64();
705
+ break;
706
+ case Me:
707
+ this.getMask();
708
+ break;
709
+ case _e:
710
+ t = this.getData(e);
711
+ break;
712
+ default:
713
+ this._loop = !1;
714
+ return;
715
+ }
716
+ while (this._loop);
717
+ e(t);
718
+ }
719
+ /**
720
+ * Reads the first two bytes of a frame.
721
+ *
722
+ * @return {(RangeError|undefined)} A possible error
723
+ * @private
724
+ */
725
+ getInfo() {
726
+ if (this._bufferedBytes < 2) {
727
+ this._loop = !1;
728
+ return;
729
+ }
730
+ const e = this.consume(2);
731
+ if (e[0] & 48)
732
+ return this._loop = !1, g(
733
+ RangeError,
734
+ "RSV2 and RSV3 must be clear",
735
+ !0,
736
+ 1002,
737
+ "WS_ERR_UNEXPECTED_RSV_2_3"
738
+ );
739
+ const t = (e[0] & 64) === 64;
740
+ if (t && !this._extensions[Pe.extensionName])
741
+ return this._loop = !1, g(
742
+ RangeError,
743
+ "RSV1 must be clear",
744
+ !0,
745
+ 1002,
746
+ "WS_ERR_UNEXPECTED_RSV_1"
747
+ );
748
+ if (this._fin = (e[0] & 128) === 128, this._opcode = e[0] & 15, this._payloadLength = e[1] & 127, this._opcode === 0) {
749
+ if (t)
750
+ return this._loop = !1, g(
751
+ RangeError,
752
+ "RSV1 must be clear",
753
+ !0,
754
+ 1002,
755
+ "WS_ERR_UNEXPECTED_RSV_1"
756
+ );
757
+ if (!this._fragmented)
758
+ return this._loop = !1, g(
759
+ RangeError,
760
+ "invalid opcode 0",
761
+ !0,
762
+ 1002,
763
+ "WS_ERR_INVALID_OPCODE"
764
+ );
765
+ this._opcode = this._fragmented;
766
+ } else if (this._opcode === 1 || this._opcode === 2) {
767
+ if (this._fragmented)
768
+ return this._loop = !1, g(
769
+ RangeError,
770
+ `invalid opcode ${this._opcode}`,
771
+ !0,
772
+ 1002,
773
+ "WS_ERR_INVALID_OPCODE"
774
+ );
775
+ this._compressed = t;
776
+ } else if (this._opcode > 7 && this._opcode < 11) {
777
+ if (!this._fin)
778
+ return this._loop = !1, g(
779
+ RangeError,
780
+ "FIN must be set",
781
+ !0,
782
+ 1002,
783
+ "WS_ERR_EXPECTED_FIN"
784
+ );
785
+ if (t)
786
+ return this._loop = !1, g(
787
+ RangeError,
788
+ "RSV1 must be clear",
789
+ !0,
790
+ 1002,
791
+ "WS_ERR_UNEXPECTED_RSV_1"
792
+ );
793
+ if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1)
794
+ return this._loop = !1, g(
795
+ RangeError,
796
+ `invalid payload length ${this._payloadLength}`,
797
+ !0,
798
+ 1002,
799
+ "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"
800
+ );
801
+ } else
802
+ return this._loop = !1, g(
803
+ RangeError,
804
+ `invalid opcode ${this._opcode}`,
805
+ !0,
806
+ 1002,
807
+ "WS_ERR_INVALID_OPCODE"
808
+ );
809
+ if (!this._fin && !this._fragmented && (this._fragmented = this._opcode), this._masked = (e[1] & 128) === 128, this._isServer) {
810
+ if (!this._masked)
811
+ return this._loop = !1, g(
812
+ RangeError,
813
+ "MASK must be set",
814
+ !0,
815
+ 1002,
816
+ "WS_ERR_EXPECTED_MASK"
817
+ );
818
+ } else if (this._masked)
819
+ return this._loop = !1, g(
820
+ RangeError,
821
+ "MASK must be clear",
822
+ !0,
823
+ 1002,
824
+ "WS_ERR_UNEXPECTED_MASK"
825
+ );
826
+ if (this._payloadLength === 126)
827
+ this._state = Be;
828
+ else if (this._payloadLength === 127)
829
+ this._state = $e;
830
+ else
831
+ return this.haveLength();
832
+ }
833
+ /**
834
+ * Gets extended payload length (7+16).
835
+ *
836
+ * @return {(RangeError|undefined)} A possible error
837
+ * @private
838
+ */
839
+ getPayloadLength16() {
840
+ if (this._bufferedBytes < 2) {
841
+ this._loop = !1;
842
+ return;
843
+ }
844
+ return this._payloadLength = this.consume(2).readUInt16BE(0), this.haveLength();
845
+ }
846
+ /**
847
+ * Gets extended payload length (7+64).
848
+ *
849
+ * @return {(RangeError|undefined)} A possible error
850
+ * @private
851
+ */
852
+ getPayloadLength64() {
853
+ if (this._bufferedBytes < 8) {
854
+ this._loop = !1;
855
+ return;
856
+ }
857
+ const e = this.consume(8), t = e.readUInt32BE(0);
858
+ return t > Math.pow(2, 21) - 1 ? (this._loop = !1, g(
859
+ RangeError,
860
+ "Unsupported WebSocket frame: payload length > 2^53 - 1",
861
+ !1,
862
+ 1009,
863
+ "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"
864
+ )) : (this._payloadLength = t * Math.pow(2, 32) + e.readUInt32BE(4), this.haveLength());
865
+ }
866
+ /**
867
+ * Payload length has been read.
868
+ *
869
+ * @return {(RangeError|undefined)} A possible error
870
+ * @private
871
+ */
872
+ haveLength() {
873
+ if (this._payloadLength && this._opcode < 8 && (this._totalPayloadLength += this._payloadLength, this._totalPayloadLength > this._maxPayload && this._maxPayload > 0))
874
+ return this._loop = !1, g(
875
+ RangeError,
876
+ "Max payload size exceeded",
877
+ !1,
878
+ 1009,
879
+ "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
880
+ );
881
+ this._masked ? this._state = Me : this._state = _e;
882
+ }
883
+ /**
884
+ * Reads mask bytes.
885
+ *
886
+ * @private
887
+ */
888
+ getMask() {
889
+ if (this._bufferedBytes < 4) {
890
+ this._loop = !1;
891
+ return;
892
+ }
893
+ this._mask = this.consume(4), this._state = _e;
894
+ }
895
+ /**
896
+ * Reads data bytes.
897
+ *
898
+ * @param {Function} cb Callback
899
+ * @return {(Error|RangeError|undefined)} A possible error
900
+ * @private
901
+ */
902
+ getData(e) {
903
+ let t = Re;
904
+ if (this._payloadLength) {
905
+ if (this._bufferedBytes < this._payloadLength) {
906
+ this._loop = !1;
907
+ return;
908
+ }
909
+ t = this.consume(this._payloadLength), this._masked && this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3] && Ht(t, this._mask);
910
+ }
911
+ if (this._opcode > 7)
912
+ return this.controlMessage(t);
913
+ if (this._compressed) {
914
+ this._state = Yt, this.decompress(t, e);
915
+ return;
916
+ }
917
+ return t.length && (this._messageLength = this._totalPayloadLength, this._fragments.push(t)), this.dataMessage();
918
+ }
919
+ /**
920
+ * Decompresses data.
921
+ *
922
+ * @param {Buffer} data Compressed data
923
+ * @param {Function} cb Callback
924
+ * @private
925
+ */
926
+ decompress(e, t) {
927
+ this._extensions[Pe.extensionName].decompress(e, this._fin, (i, n) => {
928
+ if (i)
929
+ return t(i);
930
+ if (n.length) {
931
+ if (this._messageLength += n.length, this._messageLength > this._maxPayload && this._maxPayload > 0)
932
+ return t(
933
+ g(
934
+ RangeError,
935
+ "Max payload size exceeded",
936
+ !1,
937
+ 1009,
938
+ "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
939
+ )
940
+ );
941
+ this._fragments.push(n);
942
+ }
943
+ const o = this.dataMessage();
944
+ if (o)
945
+ return t(o);
946
+ this.startLoop(t);
947
+ });
948
+ }
949
+ /**
950
+ * Handles a data message.
951
+ *
952
+ * @return {(Error|undefined)} A possible error
953
+ * @private
954
+ */
955
+ dataMessage() {
956
+ if (this._fin) {
957
+ const e = this._messageLength, t = this._fragments;
958
+ if (this._totalPayloadLength = 0, this._messageLength = 0, this._fragmented = 0, this._fragments = [], this._opcode === 2) {
959
+ let r;
960
+ this._binaryType === "nodebuffer" ? r = de(t, e) : this._binaryType === "arraybuffer" ? r = Vt(de(t, e)) : r = t, this.emit("message", r, !0);
961
+ } else {
962
+ const r = de(t, e);
963
+ if (!this._skipUTF8Validation && !Ue(r))
964
+ return this._loop = !1, g(
965
+ Error,
966
+ "invalid UTF-8 sequence",
967
+ !0,
968
+ 1007,
969
+ "WS_ERR_INVALID_UTF8"
970
+ );
971
+ this.emit("message", r, !1);
972
+ }
973
+ }
974
+ this._state = A;
975
+ }
976
+ /**
977
+ * Handles a control message.
978
+ *
979
+ * @param {Buffer} data Data to handle
980
+ * @return {(Error|RangeError|undefined)} A possible error
981
+ * @private
982
+ */
983
+ controlMessage(e) {
984
+ if (this._opcode === 8)
985
+ if (this._loop = !1, e.length === 0)
986
+ this.emit("conclude", 1005, Re), this.end();
987
+ else {
988
+ const t = e.readUInt16BE(0);
989
+ if (!zt(t))
990
+ return g(
991
+ RangeError,
992
+ `invalid status code ${t}`,
993
+ !0,
994
+ 1002,
995
+ "WS_ERR_INVALID_CLOSE_CODE"
996
+ );
997
+ const r = new X(
998
+ e.buffer,
999
+ e.byteOffset + 2,
1000
+ e.length - 2
1001
+ );
1002
+ if (!this._skipUTF8Validation && !Ue(r))
1003
+ return g(
1004
+ Error,
1005
+ "invalid UTF-8 sequence",
1006
+ !0,
1007
+ 1007,
1008
+ "WS_ERR_INVALID_UTF8"
1009
+ );
1010
+ this.emit("conclude", t, r), this.end();
1011
+ }
1012
+ else
1013
+ this._opcode === 9 ? this.emit("ping", e) : this.emit("pong", e);
1014
+ this._state = A;
1015
+ }
1016
+ };
1017
+ var rt = qt;
1018
+ function g(s, e, t, r, i) {
1019
+ const n = new s(
1020
+ t ? `Invalid WebSocket frame: ${e}` : e
1021
+ );
1022
+ return Error.captureStackTrace(n, g), n.code = i, n[jt] = r, n;
1023
+ }
1024
+ const qs = /* @__PURE__ */ z(rt), { randomFillSync: Kt } = S, Ie = oe, { EMPTY_BUFFER: Xt } = U, { isValidStatusCode: Zt } = ae, { mask: De, toBuffer: M } = ne, x = Symbol("kByteLength"), Qt = Buffer.alloc(4);
1025
+ let Jt = class P {
1026
+ /**
1027
+ * Creates a Sender instance.
1028
+ *
1029
+ * @param {(net.Socket|tls.Socket)} socket The connection socket
1030
+ * @param {Object} [extensions] An object containing the negotiated extensions
1031
+ * @param {Function} [generateMask] The function used to generate the masking
1032
+ * key
1033
+ */
1034
+ constructor(e, t, r) {
1035
+ this._extensions = t || {}, r && (this._generateMask = r, this._maskBuffer = Buffer.alloc(4)), this._socket = e, this._firstFragment = !0, this._compress = !1, this._bufferedBytes = 0, this._deflating = !1, this._queue = [];
1036
+ }
1037
+ /**
1038
+ * Frames a piece of data according to the HyBi WebSocket protocol.
1039
+ *
1040
+ * @param {(Buffer|String)} data The data to frame
1041
+ * @param {Object} options Options object
1042
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
1043
+ * FIN bit
1044
+ * @param {Function} [options.generateMask] The function used to generate the
1045
+ * masking key
1046
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
1047
+ * `data`
1048
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
1049
+ * key
1050
+ * @param {Number} options.opcode The opcode
1051
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
1052
+ * modified
1053
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
1054
+ * RSV1 bit
1055
+ * @return {(Buffer|String)[]} The framed data
1056
+ * @public
1057
+ */
1058
+ static frame(e, t) {
1059
+ let r, i = !1, n = 2, o = !1;
1060
+ t.mask && (r = t.maskBuffer || Qt, t.generateMask ? t.generateMask(r) : Kt(r, 0, 4), o = (r[0] | r[1] | r[2] | r[3]) === 0, n = 6);
1061
+ let l;
1062
+ typeof e == "string" ? (!t.mask || o) && t[x] !== void 0 ? l = t[x] : (e = Buffer.from(e), l = e.length) : (l = e.length, i = t.mask && t.readOnly && !o);
1063
+ let f = l;
1064
+ l >= 65536 ? (n += 8, f = 127) : l > 125 && (n += 2, f = 126);
1065
+ const a = Buffer.allocUnsafe(i ? l + n : n);
1066
+ return a[0] = t.fin ? t.opcode | 128 : t.opcode, t.rsv1 && (a[0] |= 64), a[1] = f, f === 126 ? a.writeUInt16BE(l, 2) : f === 127 && (a[2] = a[3] = 0, a.writeUIntBE(l, 4, 6)), t.mask ? (a[1] |= 128, a[n - 4] = r[0], a[n - 3] = r[1], a[n - 2] = r[2], a[n - 1] = r[3], o ? [a, e] : i ? (De(e, r, a, n, l), [a]) : (De(e, r, e, 0, l), [a, e])) : [a, e];
1067
+ }
1068
+ /**
1069
+ * Sends a close message to the other peer.
1070
+ *
1071
+ * @param {Number} [code] The status code component of the body
1072
+ * @param {(String|Buffer)} [data] The message component of the body
1073
+ * @param {Boolean} [mask=false] Specifies whether or not to mask the message
1074
+ * @param {Function} [cb] Callback
1075
+ * @public
1076
+ */
1077
+ close(e, t, r, i) {
1078
+ let n;
1079
+ if (e === void 0)
1080
+ n = Xt;
1081
+ else {
1082
+ if (typeof e != "number" || !Zt(e))
1083
+ throw new TypeError("First argument must be a valid error code number");
1084
+ if (t === void 0 || !t.length)
1085
+ n = Buffer.allocUnsafe(2), n.writeUInt16BE(e, 0);
1086
+ else {
1087
+ const l = Buffer.byteLength(t);
1088
+ if (l > 123)
1089
+ throw new RangeError("The message must not be greater than 123 bytes");
1090
+ n = Buffer.allocUnsafe(2 + l), n.writeUInt16BE(e, 0), typeof t == "string" ? n.write(t, 2) : n.set(t, 2);
1091
+ }
1092
+ }
1093
+ const o = {
1094
+ [x]: n.length,
1095
+ fin: !0,
1096
+ generateMask: this._generateMask,
1097
+ mask: r,
1098
+ maskBuffer: this._maskBuffer,
1099
+ opcode: 8,
1100
+ readOnly: !1,
1101
+ rsv1: !1
1102
+ };
1103
+ this._deflating ? this.enqueue([this.dispatch, n, !1, o, i]) : this.sendFrame(P.frame(n, o), i);
1104
+ }
1105
+ /**
1106
+ * Sends a ping message to the other peer.
1107
+ *
1108
+ * @param {*} data The message to send
1109
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
1110
+ * @param {Function} [cb] Callback
1111
+ * @public
1112
+ */
1113
+ ping(e, t, r) {
1114
+ let i, n;
1115
+ if (typeof e == "string" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)
1116
+ throw new RangeError("The data size must not be greater than 125 bytes");
1117
+ const o = {
1118
+ [x]: i,
1119
+ fin: !0,
1120
+ generateMask: this._generateMask,
1121
+ mask: t,
1122
+ maskBuffer: this._maskBuffer,
1123
+ opcode: 9,
1124
+ readOnly: n,
1125
+ rsv1: !1
1126
+ };
1127
+ this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);
1128
+ }
1129
+ /**
1130
+ * Sends a pong message to the other peer.
1131
+ *
1132
+ * @param {*} data The message to send
1133
+ * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
1134
+ * @param {Function} [cb] Callback
1135
+ * @public
1136
+ */
1137
+ pong(e, t, r) {
1138
+ let i, n;
1139
+ if (typeof e == "string" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)
1140
+ throw new RangeError("The data size must not be greater than 125 bytes");
1141
+ const o = {
1142
+ [x]: i,
1143
+ fin: !0,
1144
+ generateMask: this._generateMask,
1145
+ mask: t,
1146
+ maskBuffer: this._maskBuffer,
1147
+ opcode: 10,
1148
+ readOnly: n,
1149
+ rsv1: !1
1150
+ };
1151
+ this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);
1152
+ }
1153
+ /**
1154
+ * Sends a data message to the other peer.
1155
+ *
1156
+ * @param {*} data The message to send
1157
+ * @param {Object} options Options object
1158
+ * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
1159
+ * or text
1160
+ * @param {Boolean} [options.compress=false] Specifies whether or not to
1161
+ * compress `data`
1162
+ * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
1163
+ * last one
1164
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
1165
+ * `data`
1166
+ * @param {Function} [cb] Callback
1167
+ * @public
1168
+ */
1169
+ send(e, t, r) {
1170
+ const i = this._extensions[Ie.extensionName];
1171
+ let n = t.binary ? 2 : 1, o = t.compress, l, f;
1172
+ if (typeof e == "string" ? (l = Buffer.byteLength(e), f = !1) : (e = M(e), l = e.length, f = M.readOnly), this._firstFragment ? (this._firstFragment = !1, o && i && i.params[i._isServer ? "server_no_context_takeover" : "client_no_context_takeover"] && (o = l >= i._threshold), this._compress = o) : (o = !1, n = 0), t.fin && (this._firstFragment = !0), i) {
1173
+ const a = {
1174
+ [x]: l,
1175
+ fin: t.fin,
1176
+ generateMask: this._generateMask,
1177
+ mask: t.mask,
1178
+ maskBuffer: this._maskBuffer,
1179
+ opcode: n,
1180
+ readOnly: f,
1181
+ rsv1: o
1182
+ };
1183
+ this._deflating ? this.enqueue([this.dispatch, e, this._compress, a, r]) : this.dispatch(e, this._compress, a, r);
1184
+ } else
1185
+ this.sendFrame(
1186
+ P.frame(e, {
1187
+ [x]: l,
1188
+ fin: t.fin,
1189
+ generateMask: this._generateMask,
1190
+ mask: t.mask,
1191
+ maskBuffer: this._maskBuffer,
1192
+ opcode: n,
1193
+ readOnly: f,
1194
+ rsv1: !1
1195
+ }),
1196
+ r
1197
+ );
1198
+ }
1199
+ /**
1200
+ * Dispatches a message.
1201
+ *
1202
+ * @param {(Buffer|String)} data The message to send
1203
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
1204
+ * `data`
1205
+ * @param {Object} options Options object
1206
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
1207
+ * FIN bit
1208
+ * @param {Function} [options.generateMask] The function used to generate the
1209
+ * masking key
1210
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
1211
+ * `data`
1212
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
1213
+ * key
1214
+ * @param {Number} options.opcode The opcode
1215
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
1216
+ * modified
1217
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
1218
+ * RSV1 bit
1219
+ * @param {Function} [cb] Callback
1220
+ * @private
1221
+ */
1222
+ dispatch(e, t, r, i) {
1223
+ if (!t) {
1224
+ this.sendFrame(P.frame(e, r), i);
1225
+ return;
1226
+ }
1227
+ const n = this._extensions[Ie.extensionName];
1228
+ this._bufferedBytes += r[x], this._deflating = !0, n.compress(e, r.fin, (o, l) => {
1229
+ if (this._socket.destroyed) {
1230
+ const f = new Error(
1231
+ "The socket was closed while data was being compressed"
1232
+ );
1233
+ typeof i == "function" && i(f);
1234
+ for (let a = 0; a < this._queue.length; a++) {
1235
+ const c = this._queue[a], h = c[c.length - 1];
1236
+ typeof h == "function" && h(f);
1237
+ }
1238
+ return;
1239
+ }
1240
+ this._bufferedBytes -= r[x], this._deflating = !1, r.readOnly = !1, this.sendFrame(P.frame(l, r), i), this.dequeue();
1241
+ });
1242
+ }
1243
+ /**
1244
+ * Executes queued send operations.
1245
+ *
1246
+ * @private
1247
+ */
1248
+ dequeue() {
1249
+ for (; !this._deflating && this._queue.length; ) {
1250
+ const e = this._queue.shift();
1251
+ this._bufferedBytes -= e[3][x], Reflect.apply(e[0], this, e.slice(1));
1252
+ }
1253
+ }
1254
+ /**
1255
+ * Enqueues a send operation.
1256
+ *
1257
+ * @param {Array} params Send operation parameters.
1258
+ * @private
1259
+ */
1260
+ enqueue(e) {
1261
+ this._bufferedBytes += e[3][x], this._queue.push(e);
1262
+ }
1263
+ /**
1264
+ * Sends a frame.
1265
+ *
1266
+ * @param {Buffer[]} list The frame to send
1267
+ * @param {Function} [cb] Callback
1268
+ * @private
1269
+ */
1270
+ sendFrame(e, t) {
1271
+ e.length === 2 ? (this._socket.cork(), this._socket.write(e[0]), this._socket.write(e[1], t), this._socket.uncork()) : this._socket.write(e[0], t);
1272
+ }
1273
+ };
1274
+ var it = Jt;
1275
+ const Ks = /* @__PURE__ */ z(it), { kForOnEventAttribute: F, kListener: pe } = U, We = Symbol("kCode"), Ae = Symbol("kData"), Fe = Symbol("kError"), je = Symbol("kMessage"), Ge = Symbol("kReason"), I = Symbol("kTarget"), Ve = Symbol("kType"), He = Symbol("kWasClean");
1276
+ class B {
1277
+ /**
1278
+ * Create a new `Event`.
1279
+ *
1280
+ * @param {String} type The name of the event
1281
+ * @throws {TypeError} If the `type` argument is not specified
1282
+ */
1283
+ constructor(e) {
1284
+ this[I] = null, this[Ve] = e;
1285
+ }
1286
+ /**
1287
+ * @type {*}
1288
+ */
1289
+ get target() {
1290
+ return this[I];
1291
+ }
1292
+ /**
1293
+ * @type {String}
1294
+ */
1295
+ get type() {
1296
+ return this[Ve];
1297
+ }
1298
+ }
1299
+ Object.defineProperty(B.prototype, "target", { enumerable: !0 });
1300
+ Object.defineProperty(B.prototype, "type", { enumerable: !0 });
1301
+ class Y extends B {
1302
+ /**
1303
+ * Create a new `CloseEvent`.
1304
+ *
1305
+ * @param {String} type The name of the event
1306
+ * @param {Object} [options] A dictionary object that allows for setting
1307
+ * attributes via object members of the same name
1308
+ * @param {Number} [options.code=0] The status code explaining why the
1309
+ * connection was closed
1310
+ * @param {String} [options.reason=''] A human-readable string explaining why
1311
+ * the connection was closed
1312
+ * @param {Boolean} [options.wasClean=false] Indicates whether or not the
1313
+ * connection was cleanly closed
1314
+ */
1315
+ constructor(e, t = {}) {
1316
+ super(e), this[We] = t.code === void 0 ? 0 : t.code, this[Ge] = t.reason === void 0 ? "" : t.reason, this[He] = t.wasClean === void 0 ? !1 : t.wasClean;
1317
+ }
1318
+ /**
1319
+ * @type {Number}
1320
+ */
1321
+ get code() {
1322
+ return this[We];
1323
+ }
1324
+ /**
1325
+ * @type {String}
1326
+ */
1327
+ get reason() {
1328
+ return this[Ge];
1329
+ }
1330
+ /**
1331
+ * @type {Boolean}
1332
+ */
1333
+ get wasClean() {
1334
+ return this[He];
1335
+ }
1336
+ }
1337
+ Object.defineProperty(Y.prototype, "code", { enumerable: !0 });
1338
+ Object.defineProperty(Y.prototype, "reason", { enumerable: !0 });
1339
+ Object.defineProperty(Y.prototype, "wasClean", { enumerable: !0 });
1340
+ class le extends B {
1341
+ /**
1342
+ * Create a new `ErrorEvent`.
1343
+ *
1344
+ * @param {String} type The name of the event
1345
+ * @param {Object} [options] A dictionary object that allows for setting
1346
+ * attributes via object members of the same name
1347
+ * @param {*} [options.error=null] The error that generated this event
1348
+ * @param {String} [options.message=''] The error message
1349
+ */
1350
+ constructor(e, t = {}) {
1351
+ super(e), this[Fe] = t.error === void 0 ? null : t.error, this[je] = t.message === void 0 ? "" : t.message;
1352
+ }
1353
+ /**
1354
+ * @type {*}
1355
+ */
1356
+ get error() {
1357
+ return this[Fe];
1358
+ }
1359
+ /**
1360
+ * @type {String}
1361
+ */
1362
+ get message() {
1363
+ return this[je];
1364
+ }
1365
+ }
1366
+ Object.defineProperty(le.prototype, "error", { enumerable: !0 });
1367
+ Object.defineProperty(le.prototype, "message", { enumerable: !0 });
1368
+ class xe extends B {
1369
+ /**
1370
+ * Create a new `MessageEvent`.
1371
+ *
1372
+ * @param {String} type The name of the event
1373
+ * @param {Object} [options] A dictionary object that allows for setting
1374
+ * attributes via object members of the same name
1375
+ * @param {*} [options.data=null] The message content
1376
+ */
1377
+ constructor(e, t = {}) {
1378
+ super(e), this[Ae] = t.data === void 0 ? null : t.data;
1379
+ }
1380
+ /**
1381
+ * @type {*}
1382
+ */
1383
+ get data() {
1384
+ return this[Ae];
1385
+ }
1386
+ }
1387
+ Object.defineProperty(xe.prototype, "data", { enumerable: !0 });
1388
+ const es = {
1389
+ /**
1390
+ * Register an event listener.
1391
+ *
1392
+ * @param {String} type A string representing the event type to listen for
1393
+ * @param {(Function|Object)} handler The listener to add
1394
+ * @param {Object} [options] An options object specifies characteristics about
1395
+ * the event listener
1396
+ * @param {Boolean} [options.once=false] A `Boolean` indicating that the
1397
+ * listener should be invoked at most once after being added. If `true`,
1398
+ * the listener would be automatically removed when invoked.
1399
+ * @public
1400
+ */
1401
+ addEventListener(s, e, t = {}) {
1402
+ for (const i of this.listeners(s))
1403
+ if (!t[F] && i[pe] === e && !i[F])
1404
+ return;
1405
+ let r;
1406
+ if (s === "message")
1407
+ r = function(n, o) {
1408
+ const l = new xe("message", {
1409
+ data: o ? n : n.toString()
1410
+ });
1411
+ l[I] = this, Z(e, this, l);
1412
+ };
1413
+ else if (s === "close")
1414
+ r = function(n, o) {
1415
+ const l = new Y("close", {
1416
+ code: n,
1417
+ reason: o.toString(),
1418
+ wasClean: this._closeFrameReceived && this._closeFrameSent
1419
+ });
1420
+ l[I] = this, Z(e, this, l);
1421
+ };
1422
+ else if (s === "error")
1423
+ r = function(n) {
1424
+ const o = new le("error", {
1425
+ error: n,
1426
+ message: n.message
1427
+ });
1428
+ o[I] = this, Z(e, this, o);
1429
+ };
1430
+ else if (s === "open")
1431
+ r = function() {
1432
+ const n = new B("open");
1433
+ n[I] = this, Z(e, this, n);
1434
+ };
1435
+ else
1436
+ return;
1437
+ r[F] = !!t[F], r[pe] = e, t.once ? this.once(s, r) : this.on(s, r);
1438
+ },
1439
+ /**
1440
+ * Remove an event listener.
1441
+ *
1442
+ * @param {String} type A string representing the event type to remove
1443
+ * @param {(Function|Object)} handler The listener to remove
1444
+ * @public
1445
+ */
1446
+ removeEventListener(s, e) {
1447
+ for (const t of this.listeners(s))
1448
+ if (t[pe] === e && !t[F]) {
1449
+ this.removeListener(s, t);
1450
+ break;
1451
+ }
1452
+ }
1453
+ };
1454
+ var ts = {
1455
+ CloseEvent: Y,
1456
+ ErrorEvent: le,
1457
+ Event: B,
1458
+ EventTarget: es,
1459
+ MessageEvent: xe
1460
+ };
1461
+ function Z(s, e, t) {
1462
+ typeof s == "object" && s.handleEvent ? s.handleEvent.call(s, t) : s.call(e, t);
1463
+ }
1464
+ const { tokenChars: j } = ae;
1465
+ function k(s, e, t) {
1466
+ s[e] === void 0 ? s[e] = [t] : s[e].push(t);
1467
+ }
1468
+ function ss(s) {
1469
+ const e = /* @__PURE__ */ Object.create(null);
1470
+ let t = /* @__PURE__ */ Object.create(null), r = !1, i = !1, n = !1, o, l, f = -1, a = -1, c = -1, h = 0;
1471
+ for (; h < s.length; h++)
1472
+ if (a = s.charCodeAt(h), o === void 0)
1473
+ if (c === -1 && j[a] === 1)
1474
+ f === -1 && (f = h);
1475
+ else if (h !== 0 && (a === 32 || a === 9))
1476
+ c === -1 && f !== -1 && (c = h);
1477
+ else if (a === 59 || a === 44) {
1478
+ if (f === -1)
1479
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1480
+ c === -1 && (c = h);
1481
+ const v = s.slice(f, c);
1482
+ a === 44 ? (k(e, v, t), t = /* @__PURE__ */ Object.create(null)) : o = v, f = c = -1;
1483
+ } else
1484
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1485
+ else if (l === void 0)
1486
+ if (c === -1 && j[a] === 1)
1487
+ f === -1 && (f = h);
1488
+ else if (a === 32 || a === 9)
1489
+ c === -1 && f !== -1 && (c = h);
1490
+ else if (a === 59 || a === 44) {
1491
+ if (f === -1)
1492
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1493
+ c === -1 && (c = h), k(t, s.slice(f, c), !0), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), f = c = -1;
1494
+ } else if (a === 61 && f !== -1 && c === -1)
1495
+ l = s.slice(f, h), f = c = -1;
1496
+ else
1497
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1498
+ else if (i) {
1499
+ if (j[a] !== 1)
1500
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1501
+ f === -1 ? f = h : r || (r = !0), i = !1;
1502
+ } else if (n)
1503
+ if (j[a] === 1)
1504
+ f === -1 && (f = h);
1505
+ else if (a === 34 && f !== -1)
1506
+ n = !1, c = h;
1507
+ else if (a === 92)
1508
+ i = !0;
1509
+ else
1510
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1511
+ else if (a === 34 && s.charCodeAt(h - 1) === 61)
1512
+ n = !0;
1513
+ else if (c === -1 && j[a] === 1)
1514
+ f === -1 && (f = h);
1515
+ else if (f !== -1 && (a === 32 || a === 9))
1516
+ c === -1 && (c = h);
1517
+ else if (a === 59 || a === 44) {
1518
+ if (f === -1)
1519
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1520
+ c === -1 && (c = h);
1521
+ let v = s.slice(f, c);
1522
+ r && (v = v.replace(/\\/g, ""), r = !1), k(t, l, v), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), l = void 0, f = c = -1;
1523
+ } else
1524
+ throw new SyntaxError(`Unexpected character at index ${h}`);
1525
+ if (f === -1 || n || a === 32 || a === 9)
1526
+ throw new SyntaxError("Unexpected end of input");
1527
+ c === -1 && (c = h);
1528
+ const p = s.slice(f, c);
1529
+ return o === void 0 ? k(e, p, t) : (l === void 0 ? k(t, p, !0) : r ? k(t, l, p.replace(/\\/g, "")) : k(t, l, p), k(e, o, t)), e;
1530
+ }
1531
+ function rs(s) {
1532
+ return Object.keys(s).map((e) => {
1533
+ let t = s[e];
1534
+ return Array.isArray(t) || (t = [t]), t.map((r) => [e].concat(
1535
+ Object.keys(r).map((i) => {
1536
+ let n = r[i];
1537
+ return Array.isArray(n) || (n = [n]), n.map((o) => o === !0 ? i : `${i}=${o}`).join("; ");
1538
+ })
1539
+ ).join("; ")).join(", ");
1540
+ }).join(", ");
1541
+ }
1542
+ var nt = { format: rs, parse: ss };
1543
+ const is = S, ns = S, os = S, ot = S, as = S, { randomBytes: ls, createHash: fs } = S, { URL: me } = S, T = oe, hs = rt, cs = it, {
1544
+ BINARY_TYPES: ze,
1545
+ EMPTY_BUFFER: Q,
1546
+ GUID: us,
1547
+ kForOnEventAttribute: ge,
1548
+ kListener: ds,
1549
+ kStatusCode: _s,
1550
+ kWebSocket: y,
1551
+ NOOP: at
1552
+ } = U, {
1553
+ EventTarget: { addEventListener: ps, removeEventListener: ms }
1554
+ } = ts, { format: gs, parse: ys } = nt, { toBuffer: vs } = ne, Ss = 30 * 1e3, lt = Symbol("kAborted"), ye = [8, 13], O = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], Es = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
1555
+ let m = class d extends is {
1556
+ /**
1557
+ * Create a new `WebSocket`.
1558
+ *
1559
+ * @param {(String|URL)} address The URL to which to connect
1560
+ * @param {(String|String[])} [protocols] The subprotocols
1561
+ * @param {Object} [options] Connection options
1562
+ */
1563
+ constructor(e, t, r) {
1564
+ super(), this._binaryType = ze[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = Q, this._closeTimer = null, this._extensions = {}, this._paused = !1, this._protocol = "", this._readyState = d.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, e !== null ? (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, t === void 0 ? t = [] : Array.isArray(t) || (typeof t == "object" && t !== null ? (r = t, t = []) : t = [t]), ht(this, e, t, r)) : this._isServer = !0;
1565
+ }
1566
+ /**
1567
+ * This deviates from the WHATWG interface since ws doesn't support the
1568
+ * required default "blob" type (instead we define a custom "nodebuffer"
1569
+ * type).
1570
+ *
1571
+ * @type {String}
1572
+ */
1573
+ get binaryType() {
1574
+ return this._binaryType;
1575
+ }
1576
+ set binaryType(e) {
1577
+ ze.includes(e) && (this._binaryType = e, this._receiver && (this._receiver._binaryType = e));
1578
+ }
1579
+ /**
1580
+ * @type {Number}
1581
+ */
1582
+ get bufferedAmount() {
1583
+ return this._socket ? this._socket._writableState.length + this._sender._bufferedBytes : this._bufferedAmount;
1584
+ }
1585
+ /**
1586
+ * @type {String}
1587
+ */
1588
+ get extensions() {
1589
+ return Object.keys(this._extensions).join();
1590
+ }
1591
+ /**
1592
+ * @type {Boolean}
1593
+ */
1594
+ get isPaused() {
1595
+ return this._paused;
1596
+ }
1597
+ /**
1598
+ * @type {Function}
1599
+ */
1600
+ /* istanbul ignore next */
1601
+ get onclose() {
1602
+ return null;
1603
+ }
1604
+ /**
1605
+ * @type {Function}
1606
+ */
1607
+ /* istanbul ignore next */
1608
+ get onerror() {
1609
+ return null;
1610
+ }
1611
+ /**
1612
+ * @type {Function}
1613
+ */
1614
+ /* istanbul ignore next */
1615
+ get onopen() {
1616
+ return null;
1617
+ }
1618
+ /**
1619
+ * @type {Function}
1620
+ */
1621
+ /* istanbul ignore next */
1622
+ get onmessage() {
1623
+ return null;
1624
+ }
1625
+ /**
1626
+ * @type {String}
1627
+ */
1628
+ get protocol() {
1629
+ return this._protocol;
1630
+ }
1631
+ /**
1632
+ * @type {Number}
1633
+ */
1634
+ get readyState() {
1635
+ return this._readyState;
1636
+ }
1637
+ /**
1638
+ * @type {String}
1639
+ */
1640
+ get url() {
1641
+ return this._url;
1642
+ }
1643
+ /**
1644
+ * Set up the socket and the internal resources.
1645
+ *
1646
+ * @param {(net.Socket|tls.Socket)} socket The network socket between the
1647
+ * server and client
1648
+ * @param {Buffer} head The first packet of the upgraded stream
1649
+ * @param {Object} options Options object
1650
+ * @param {Function} [options.generateMask] The function used to generate the
1651
+ * masking key
1652
+ * @param {Number} [options.maxPayload=0] The maximum allowed message size
1653
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
1654
+ * not to skip UTF-8 validation for text and close messages
1655
+ * @private
1656
+ */
1657
+ setSocket(e, t, r) {
1658
+ const i = new hs({
1659
+ binaryType: this.binaryType,
1660
+ extensions: this._extensions,
1661
+ isServer: this._isServer,
1662
+ maxPayload: r.maxPayload,
1663
+ skipUTF8Validation: r.skipUTF8Validation
1664
+ });
1665
+ this._sender = new cs(e, this._extensions, r.generateMask), this._receiver = i, this._socket = e, i[y] = this, e[y] = this, i.on("conclude", ks), i.on("drain", ws), i.on("error", Os), i.on("message", Cs), i.on("ping", Ts), i.on("pong", Ls), e.setTimeout(0), e.setNoDelay(), t.length > 0 && e.unshift(t), e.on("close", ut), e.on("data", fe), e.on("end", dt), e.on("error", _t), this._readyState = d.OPEN, this.emit("open");
1666
+ }
1667
+ /**
1668
+ * Emit the `'close'` event.
1669
+ *
1670
+ * @private
1671
+ */
1672
+ emitClose() {
1673
+ if (!this._socket) {
1674
+ this._readyState = d.CLOSED, this.emit("close", this._closeCode, this._closeMessage);
1675
+ return;
1676
+ }
1677
+ this._extensions[T.extensionName] && this._extensions[T.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = d.CLOSED, this.emit("close", this._closeCode, this._closeMessage);
1678
+ }
1679
+ /**
1680
+ * Start a closing handshake.
1681
+ *
1682
+ * +----------+ +-----------+ +----------+
1683
+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
1684
+ * | +----------+ +-----------+ +----------+ |
1685
+ * +----------+ +-----------+ |
1686
+ * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING
1687
+ * +----------+ +-----------+ |
1688
+ * | | | +---+ |
1689
+ * +------------------------+-->|fin| - - - -
1690
+ * | +---+ | +---+
1691
+ * - - - - -|fin|<---------------------+
1692
+ * +---+
1693
+ *
1694
+ * @param {Number} [code] Status code explaining why the connection is closing
1695
+ * @param {(String|Buffer)} [data] The reason why the connection is
1696
+ * closing
1697
+ * @public
1698
+ */
1699
+ close(e, t) {
1700
+ if (this.readyState !== d.CLOSED) {
1701
+ if (this.readyState === d.CONNECTING) {
1702
+ b(this, this._req, "WebSocket was closed before the connection was established");
1703
+ return;
1704
+ }
1705
+ if (this.readyState === d.CLOSING) {
1706
+ this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end();
1707
+ return;
1708
+ }
1709
+ this._readyState = d.CLOSING, this._sender.close(e, t, !this._isServer, (r) => {
1710
+ r || (this._closeFrameSent = !0, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end());
1711
+ }), this._closeTimer = setTimeout(
1712
+ this._socket.destroy.bind(this._socket),
1713
+ Ss
1714
+ );
1715
+ }
1716
+ }
1717
+ /**
1718
+ * Pause the socket.
1719
+ *
1720
+ * @public
1721
+ */
1722
+ pause() {
1723
+ this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !0, this._socket.pause());
1724
+ }
1725
+ /**
1726
+ * Send a ping.
1727
+ *
1728
+ * @param {*} [data] The data to send
1729
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
1730
+ * @param {Function} [cb] Callback which is executed when the ping is sent
1731
+ * @public
1732
+ */
1733
+ ping(e, t, r) {
1734
+ if (this.readyState === d.CONNECTING)
1735
+ throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
1736
+ if (typeof e == "function" ? (r = e, e = t = void 0) : typeof t == "function" && (r = t, t = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== d.OPEN) {
1737
+ ve(this, e, r);
1738
+ return;
1739
+ }
1740
+ t === void 0 && (t = !this._isServer), this._sender.ping(e || Q, t, r);
1741
+ }
1742
+ /**
1743
+ * Send a pong.
1744
+ *
1745
+ * @param {*} [data] The data to send
1746
+ * @param {Boolean} [mask] Indicates whether or not to mask `data`
1747
+ * @param {Function} [cb] Callback which is executed when the pong is sent
1748
+ * @public
1749
+ */
1750
+ pong(e, t, r) {
1751
+ if (this.readyState === d.CONNECTING)
1752
+ throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
1753
+ if (typeof e == "function" ? (r = e, e = t = void 0) : typeof t == "function" && (r = t, t = void 0), typeof e == "number" && (e = e.toString()), this.readyState !== d.OPEN) {
1754
+ ve(this, e, r);
1755
+ return;
1756
+ }
1757
+ t === void 0 && (t = !this._isServer), this._sender.pong(e || Q, t, r);
1758
+ }
1759
+ /**
1760
+ * Resume the socket.
1761
+ *
1762
+ * @public
1763
+ */
1764
+ resume() {
1765
+ this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !1, this._receiver._writableState.needDrain || this._socket.resume());
1766
+ }
1767
+ /**
1768
+ * Send a data message.
1769
+ *
1770
+ * @param {*} data The message to send
1771
+ * @param {Object} [options] Options object
1772
+ * @param {Boolean} [options.binary] Specifies whether `data` is binary or
1773
+ * text
1774
+ * @param {Boolean} [options.compress] Specifies whether or not to compress
1775
+ * `data`
1776
+ * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
1777
+ * last one
1778
+ * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
1779
+ * @param {Function} [cb] Callback which is executed when data is written out
1780
+ * @public
1781
+ */
1782
+ send(e, t, r) {
1783
+ if (this.readyState === d.CONNECTING)
1784
+ throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
1785
+ if (typeof t == "function" && (r = t, t = {}), typeof e == "number" && (e = e.toString()), this.readyState !== d.OPEN) {
1786
+ ve(this, e, r);
1787
+ return;
1788
+ }
1789
+ const i = {
1790
+ binary: typeof e != "string",
1791
+ mask: !this._isServer,
1792
+ compress: !0,
1793
+ fin: !0,
1794
+ ...t
1795
+ };
1796
+ this._extensions[T.extensionName] || (i.compress = !1), this._sender.send(e || Q, i, r);
1797
+ }
1798
+ /**
1799
+ * Forcibly close the connection.
1800
+ *
1801
+ * @public
1802
+ */
1803
+ terminate() {
1804
+ if (this.readyState !== d.CLOSED) {
1805
+ if (this.readyState === d.CONNECTING) {
1806
+ b(this, this._req, "WebSocket was closed before the connection was established");
1807
+ return;
1808
+ }
1809
+ this._socket && (this._readyState = d.CLOSING, this._socket.destroy());
1810
+ }
1811
+ }
1812
+ };
1813
+ Object.defineProperty(m, "CONNECTING", {
1814
+ enumerable: !0,
1815
+ value: O.indexOf("CONNECTING")
1816
+ });
1817
+ Object.defineProperty(m.prototype, "CONNECTING", {
1818
+ enumerable: !0,
1819
+ value: O.indexOf("CONNECTING")
1820
+ });
1821
+ Object.defineProperty(m, "OPEN", {
1822
+ enumerable: !0,
1823
+ value: O.indexOf("OPEN")
1824
+ });
1825
+ Object.defineProperty(m.prototype, "OPEN", {
1826
+ enumerable: !0,
1827
+ value: O.indexOf("OPEN")
1828
+ });
1829
+ Object.defineProperty(m, "CLOSING", {
1830
+ enumerable: !0,
1831
+ value: O.indexOf("CLOSING")
1832
+ });
1833
+ Object.defineProperty(m.prototype, "CLOSING", {
1834
+ enumerable: !0,
1835
+ value: O.indexOf("CLOSING")
1836
+ });
1837
+ Object.defineProperty(m, "CLOSED", {
1838
+ enumerable: !0,
1839
+ value: O.indexOf("CLOSED")
1840
+ });
1841
+ Object.defineProperty(m.prototype, "CLOSED", {
1842
+ enumerable: !0,
1843
+ value: O.indexOf("CLOSED")
1844
+ });
1845
+ [
1846
+ "binaryType",
1847
+ "bufferedAmount",
1848
+ "extensions",
1849
+ "isPaused",
1850
+ "protocol",
1851
+ "readyState",
1852
+ "url"
1853
+ ].forEach((s) => {
1854
+ Object.defineProperty(m.prototype, s, { enumerable: !0 });
1855
+ });
1856
+ ["open", "error", "close", "message"].forEach((s) => {
1857
+ Object.defineProperty(m.prototype, `on${s}`, {
1858
+ enumerable: !0,
1859
+ get() {
1860
+ for (const e of this.listeners(s))
1861
+ if (e[ge])
1862
+ return e[ds];
1863
+ return null;
1864
+ },
1865
+ set(e) {
1866
+ for (const t of this.listeners(s))
1867
+ if (t[ge]) {
1868
+ this.removeListener(s, t);
1869
+ break;
1870
+ }
1871
+ typeof e == "function" && this.addEventListener(s, e, {
1872
+ [ge]: !0
1873
+ });
1874
+ }
1875
+ });
1876
+ });
1877
+ m.prototype.addEventListener = ps;
1878
+ m.prototype.removeEventListener = ms;
1879
+ var ft = m;
1880
+ function ht(s, e, t, r) {
1881
+ const i = {
1882
+ protocolVersion: ye[1],
1883
+ maxPayload: 104857600,
1884
+ skipUTF8Validation: !1,
1885
+ perMessageDeflate: !0,
1886
+ followRedirects: !1,
1887
+ maxRedirects: 10,
1888
+ ...r,
1889
+ createConnection: void 0,
1890
+ socketPath: void 0,
1891
+ hostname: void 0,
1892
+ protocol: void 0,
1893
+ timeout: void 0,
1894
+ method: "GET",
1895
+ host: void 0,
1896
+ path: void 0,
1897
+ port: void 0
1898
+ };
1899
+ if (!ye.includes(i.protocolVersion))
1900
+ throw new RangeError(
1901
+ `Unsupported protocol version: ${i.protocolVersion} (supported versions: ${ye.join(", ")})`
1902
+ );
1903
+ let n;
1904
+ if (e instanceof me)
1905
+ n = e, s._url = e.href;
1906
+ else {
1907
+ try {
1908
+ n = new me(e);
1909
+ } catch {
1910
+ throw new SyntaxError(`Invalid URL: ${e}`);
1911
+ }
1912
+ s._url = e;
1913
+ }
1914
+ const o = n.protocol === "wss:", l = n.protocol === "ws+unix:";
1915
+ let f;
1916
+ if (n.protocol !== "ws:" && !o && !l ? f = `The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"` : l && !n.pathname ? f = "The URL's pathname is empty" : n.hash && (f = "The URL contains a fragment identifier"), f) {
1917
+ const u = new SyntaxError(f);
1918
+ if (s._redirects === 0)
1919
+ throw u;
1920
+ ee(s, u);
1921
+ return;
1922
+ }
1923
+ const a = o ? 443 : 80, c = ls(16).toString("base64"), h = o ? ns.request : os.request, p = /* @__PURE__ */ new Set();
1924
+ let v;
1925
+ if (i.createConnection = o ? xs : bs, i.defaultPort = i.defaultPort || a, i.port = n.port || a, i.host = n.hostname.startsWith("[") ? n.hostname.slice(1, -1) : n.hostname, i.headers = {
1926
+ ...i.headers,
1927
+ "Sec-WebSocket-Version": i.protocolVersion,
1928
+ "Sec-WebSocket-Key": c,
1929
+ Connection: "Upgrade",
1930
+ Upgrade: "websocket"
1931
+ }, i.path = n.pathname + n.search, i.timeout = i.handshakeTimeout, i.perMessageDeflate && (v = new T(
1932
+ i.perMessageDeflate !== !0 ? i.perMessageDeflate : {},
1933
+ !1,
1934
+ i.maxPayload
1935
+ ), i.headers["Sec-WebSocket-Extensions"] = gs({
1936
+ [T.extensionName]: v.offer()
1937
+ })), t.length) {
1938
+ for (const u of t) {
1939
+ if (typeof u != "string" || !Es.test(u) || p.has(u))
1940
+ throw new SyntaxError(
1941
+ "An invalid or duplicated subprotocol was specified"
1942
+ );
1943
+ p.add(u);
1944
+ }
1945
+ i.headers["Sec-WebSocket-Protocol"] = t.join(",");
1946
+ }
1947
+ if (i.origin && (i.protocolVersion < 13 ? i.headers["Sec-WebSocket-Origin"] = i.origin : i.headers.Origin = i.origin), (n.username || n.password) && (i.auth = `${n.username}:${n.password}`), l) {
1948
+ const u = i.path.split(":");
1949
+ i.socketPath = u[0], i.path = u[1];
1950
+ }
1951
+ let _;
1952
+ if (i.followRedirects) {
1953
+ if (s._redirects === 0) {
1954
+ s._originalIpc = l, s._originalSecure = o, s._originalHostOrSocketPath = l ? i.socketPath : n.host;
1955
+ const u = r && r.headers;
1956
+ if (r = { ...r, headers: {} }, u)
1957
+ for (const [E, $] of Object.entries(u))
1958
+ r.headers[E.toLowerCase()] = $;
1959
+ } else if (s.listenerCount("redirect") === 0) {
1960
+ const u = l ? s._originalIpc ? i.socketPath === s._originalHostOrSocketPath : !1 : s._originalIpc ? !1 : n.host === s._originalHostOrSocketPath;
1961
+ (!u || s._originalSecure && !o) && (delete i.headers.authorization, delete i.headers.cookie, u || delete i.headers.host, i.auth = void 0);
1962
+ }
1963
+ i.auth && !r.headers.authorization && (r.headers.authorization = "Basic " + Buffer.from(i.auth).toString("base64")), _ = s._req = h(i), s._redirects && s.emit("redirect", s.url, _);
1964
+ } else
1965
+ _ = s._req = h(i);
1966
+ i.timeout && _.on("timeout", () => {
1967
+ b(s, _, "Opening handshake has timed out");
1968
+ }), _.on("error", (u) => {
1969
+ _ === null || _[lt] || (_ = s._req = null, ee(s, u));
1970
+ }), _.on("response", (u) => {
1971
+ const E = u.headers.location, $ = u.statusCode;
1972
+ if (E && i.followRedirects && $ >= 300 && $ < 400) {
1973
+ if (++s._redirects > i.maxRedirects) {
1974
+ b(s, _, "Maximum redirects exceeded");
1975
+ return;
1976
+ }
1977
+ _.abort();
1978
+ let q;
1979
+ try {
1980
+ q = new me(E, e);
1981
+ } catch {
1982
+ const L = new SyntaxError(`Invalid URL: ${E}`);
1983
+ ee(s, L);
1984
+ return;
1985
+ }
1986
+ ht(s, q, t, r);
1987
+ } else
1988
+ s.emit("unexpected-response", _, u) || b(
1989
+ s,
1990
+ _,
1991
+ `Unexpected server response: ${u.statusCode}`
1992
+ );
1993
+ }), _.on("upgrade", (u, E, $) => {
1994
+ if (s.emit("upgrade", u), s.readyState !== m.CONNECTING)
1995
+ return;
1996
+ if (_ = s._req = null, u.headers.upgrade.toLowerCase() !== "websocket") {
1997
+ b(s, E, "Invalid Upgrade header");
1998
+ return;
1999
+ }
2000
+ const q = fs("sha1").update(c + us).digest("base64");
2001
+ if (u.headers["sec-websocket-accept"] !== q) {
2002
+ b(s, E, "Invalid Sec-WebSocket-Accept header");
2003
+ return;
2004
+ }
2005
+ const D = u.headers["sec-websocket-protocol"];
2006
+ let L;
2007
+ if (D !== void 0 ? p.size ? p.has(D) || (L = "Server sent an invalid subprotocol") : L = "Server sent a subprotocol but none was requested" : p.size && (L = "Server sent no subprotocol"), L) {
2008
+ b(s, E, L);
2009
+ return;
2010
+ }
2011
+ D && (s._protocol = D);
2012
+ const ke = u.headers["sec-websocket-extensions"];
2013
+ if (ke !== void 0) {
2014
+ if (!v) {
2015
+ b(s, E, "Server sent a Sec-WebSocket-Extensions header but no extension was requested");
2016
+ return;
2017
+ }
2018
+ let he;
2019
+ try {
2020
+ he = ys(ke);
2021
+ } catch {
2022
+ b(s, E, "Invalid Sec-WebSocket-Extensions header");
2023
+ return;
2024
+ }
2025
+ const we = Object.keys(he);
2026
+ if (we.length !== 1 || we[0] !== T.extensionName) {
2027
+ b(s, E, "Server indicated an extension that was not requested");
2028
+ return;
2029
+ }
2030
+ try {
2031
+ v.accept(he[T.extensionName]);
2032
+ } catch {
2033
+ b(s, E, "Invalid Sec-WebSocket-Extensions header");
2034
+ return;
2035
+ }
2036
+ s._extensions[T.extensionName] = v;
2037
+ }
2038
+ s.setSocket(E, $, {
2039
+ generateMask: i.generateMask,
2040
+ maxPayload: i.maxPayload,
2041
+ skipUTF8Validation: i.skipUTF8Validation
2042
+ });
2043
+ }), i.finishRequest ? i.finishRequest(_, s) : _.end();
2044
+ }
2045
+ function ee(s, e) {
2046
+ s._readyState = m.CLOSING, s.emit("error", e), s.emitClose();
2047
+ }
2048
+ function bs(s) {
2049
+ return s.path = s.socketPath, ot.connect(s);
2050
+ }
2051
+ function xs(s) {
2052
+ return s.path = void 0, !s.servername && s.servername !== "" && (s.servername = ot.isIP(s.host) ? "" : s.host), as.connect(s);
2053
+ }
2054
+ function b(s, e, t) {
2055
+ s._readyState = m.CLOSING;
2056
+ const r = new Error(t);
2057
+ Error.captureStackTrace(r, b), e.setHeader ? (e[lt] = !0, e.abort(), e.socket && !e.socket.destroyed && e.socket.destroy(), process.nextTick(ee, s, r)) : (e.destroy(r), e.once("error", s.emit.bind(s, "error")), e.once("close", s.emitClose.bind(s)));
2058
+ }
2059
+ function ve(s, e, t) {
2060
+ if (e) {
2061
+ const r = vs(e).length;
2062
+ s._socket ? s._sender._bufferedBytes += r : s._bufferedAmount += r;
2063
+ }
2064
+ if (t) {
2065
+ const r = new Error(
2066
+ `WebSocket is not open: readyState ${s.readyState} (${O[s.readyState]})`
2067
+ );
2068
+ process.nextTick(t, r);
2069
+ }
2070
+ }
2071
+ function ks(s, e) {
2072
+ const t = this[y];
2073
+ t._closeFrameReceived = !0, t._closeMessage = e, t._closeCode = s, t._socket[y] !== void 0 && (t._socket.removeListener("data", fe), process.nextTick(ct, t._socket), s === 1005 ? t.close() : t.close(s, e));
2074
+ }
2075
+ function ws() {
2076
+ const s = this[y];
2077
+ s.isPaused || s._socket.resume();
2078
+ }
2079
+ function Os(s) {
2080
+ const e = this[y];
2081
+ e._socket[y] !== void 0 && (e._socket.removeListener("data", fe), process.nextTick(ct, e._socket), e.close(s[_s])), e.emit("error", s);
2082
+ }
2083
+ function Ye() {
2084
+ this[y].emitClose();
2085
+ }
2086
+ function Cs(s, e) {
2087
+ this[y].emit("message", s, e);
2088
+ }
2089
+ function Ts(s) {
2090
+ const e = this[y];
2091
+ e.pong(s, !e._isServer, at), e.emit("ping", s);
2092
+ }
2093
+ function Ls(s) {
2094
+ this[y].emit("pong", s);
2095
+ }
2096
+ function ct(s) {
2097
+ s.resume();
2098
+ }
2099
+ function ut() {
2100
+ const s = this[y];
2101
+ this.removeListener("close", ut), this.removeListener("data", fe), this.removeListener("end", dt), s._readyState = m.CLOSING;
2102
+ let e;
2103
+ !this._readableState.endEmitted && !s._closeFrameReceived && !s._receiver._writableState.errorEmitted && (e = s._socket.read()) !== null && s._receiver.write(e), s._receiver.end(), this[y] = void 0, clearTimeout(s._closeTimer), s._receiver._writableState.finished || s._receiver._writableState.errorEmitted ? s.emitClose() : (s._receiver.on("error", Ye), s._receiver.on("finish", Ye));
2104
+ }
2105
+ function fe(s) {
2106
+ this[y]._receiver.write(s) || this.pause();
2107
+ }
2108
+ function dt() {
2109
+ const s = this[y];
2110
+ s._readyState = m.CLOSING, s._receiver.end(), this.end();
2111
+ }
2112
+ function _t() {
2113
+ const s = this[y];
2114
+ this.removeListener("error", _t), this.on("error", at), s && (s._readyState = m.CLOSING, this.destroy());
2115
+ }
2116
+ const Xs = /* @__PURE__ */ z(ft), { tokenChars: Ns } = ae;
2117
+ function Ps(s) {
2118
+ const e = /* @__PURE__ */ new Set();
2119
+ let t = -1, r = -1, i = 0;
2120
+ for (i; i < s.length; i++) {
2121
+ const o = s.charCodeAt(i);
2122
+ if (r === -1 && Ns[o] === 1)
2123
+ t === -1 && (t = i);
2124
+ else if (i !== 0 && (o === 32 || o === 9))
2125
+ r === -1 && t !== -1 && (r = i);
2126
+ else if (o === 44) {
2127
+ if (t === -1)
2128
+ throw new SyntaxError(`Unexpected character at index ${i}`);
2129
+ r === -1 && (r = i);
2130
+ const l = s.slice(t, r);
2131
+ if (e.has(l))
2132
+ throw new SyntaxError(`The "${l}" subprotocol is duplicated`);
2133
+ e.add(l), t = r = -1;
2134
+ } else
2135
+ throw new SyntaxError(`Unexpected character at index ${i}`);
2136
+ }
2137
+ if (t === -1 || r !== -1)
2138
+ throw new SyntaxError("Unexpected end of input");
2139
+ const n = s.slice(t, i);
2140
+ if (e.has(n))
2141
+ throw new SyntaxError(`The "${n}" subprotocol is duplicated`);
2142
+ return e.add(n), e;
2143
+ }
2144
+ var Rs = { parse: Ps };
2145
+ const Us = S, ie = S, { createHash: Bs } = S, qe = nt, N = oe, $s = Rs, Ms = ft, { GUID: Is, kWebSocket: Ds } = U, Ws = /^[+/0-9A-Za-z]{22}==$/, Ke = 0, Xe = 1, pt = 2;
2146
+ class As extends Us {
2147
+ /**
2148
+ * Create a `WebSocketServer` instance.
2149
+ *
2150
+ * @param {Object} options Configuration options
2151
+ * @param {Number} [options.backlog=511] The maximum length of the queue of
2152
+ * pending connections
2153
+ * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
2154
+ * track clients
2155
+ * @param {Function} [options.handleProtocols] A hook to handle protocols
2156
+ * @param {String} [options.host] The hostname where to bind the server
2157
+ * @param {Number} [options.maxPayload=104857600] The maximum allowed message
2158
+ * size
2159
+ * @param {Boolean} [options.noServer=false] Enable no server mode
2160
+ * @param {String} [options.path] Accept only connections matching this path
2161
+ * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
2162
+ * permessage-deflate
2163
+ * @param {Number} [options.port] The port where to bind the server
2164
+ * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
2165
+ * server to use
2166
+ * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
2167
+ * not to skip UTF-8 validation for text and close messages
2168
+ * @param {Function} [options.verifyClient] A hook to reject connections
2169
+ * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
2170
+ * class to use. It must be the `WebSocket` class or class that extends it
2171
+ * @param {Function} [callback] A listener for the `listening` event
2172
+ */
2173
+ constructor(e, t) {
2174
+ if (super(), e = {
2175
+ maxPayload: 100 * 1024 * 1024,
2176
+ skipUTF8Validation: !1,
2177
+ perMessageDeflate: !1,
2178
+ handleProtocols: null,
2179
+ clientTracking: !0,
2180
+ verifyClient: null,
2181
+ noServer: !1,
2182
+ backlog: null,
2183
+ // use default (511 as implemented in net.js)
2184
+ server: null,
2185
+ host: null,
2186
+ path: null,
2187
+ port: null,
2188
+ WebSocket: Ms,
2189
+ ...e
2190
+ }, e.port == null && !e.server && !e.noServer || e.port != null && (e.server || e.noServer) || e.server && e.noServer)
2191
+ throw new TypeError(
2192
+ 'One and only one of the "port", "server", or "noServer" options must be specified'
2193
+ );
2194
+ if (e.port != null ? (this._server = ie.createServer((r, i) => {
2195
+ const n = ie.STATUS_CODES[426];
2196
+ i.writeHead(426, {
2197
+ "Content-Length": n.length,
2198
+ "Content-Type": "text/plain"
2199
+ }), i.end(n);
2200
+ }), this._server.listen(
2201
+ e.port,
2202
+ e.host,
2203
+ e.backlog,
2204
+ t
2205
+ )) : e.server && (this._server = e.server), this._server) {
2206
+ const r = this.emit.bind(this, "connection");
2207
+ this._removeListeners = js(this._server, {
2208
+ listening: this.emit.bind(this, "listening"),
2209
+ error: this.emit.bind(this, "error"),
2210
+ upgrade: (i, n, o) => {
2211
+ this.handleUpgrade(i, n, o, r);
2212
+ }
2213
+ });
2214
+ }
2215
+ e.perMessageDeflate === !0 && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = !1), this.options = e, this._state = Ke;
2216
+ }
2217
+ /**
2218
+ * Returns the bound address, the address family name, and port of the server
2219
+ * as reported by the operating system if listening on an IP socket.
2220
+ * If the server is listening on a pipe or UNIX domain socket, the name is
2221
+ * returned as a string.
2222
+ *
2223
+ * @return {(Object|String|null)} The address of the server
2224
+ * @public
2225
+ */
2226
+ address() {
2227
+ if (this.options.noServer)
2228
+ throw new Error('The server is operating in "noServer" mode');
2229
+ return this._server ? this._server.address() : null;
2230
+ }
2231
+ /**
2232
+ * Stop the server from accepting new connections and emit the `'close'` event
2233
+ * when all existing connections are closed.
2234
+ *
2235
+ * @param {Function} [cb] A one-time listener for the `'close'` event
2236
+ * @public
2237
+ */
2238
+ close(e) {
2239
+ if (this._state === pt) {
2240
+ e && this.once("close", () => {
2241
+ e(new Error("The server is not running"));
2242
+ }), process.nextTick(G, this);
2243
+ return;
2244
+ }
2245
+ if (e && this.once("close", e), this._state !== Xe)
2246
+ if (this._state = Xe, this.options.noServer || this.options.server)
2247
+ this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients ? this.clients.size ? this._shouldEmitClose = !0 : process.nextTick(G, this) : process.nextTick(G, this);
2248
+ else {
2249
+ const t = this._server;
2250
+ this._removeListeners(), this._removeListeners = this._server = null, t.close(() => {
2251
+ G(this);
2252
+ });
2253
+ }
2254
+ }
2255
+ /**
2256
+ * See if a given request should be handled by this server instance.
2257
+ *
2258
+ * @param {http.IncomingMessage} req Request object to inspect
2259
+ * @return {Boolean} `true` if the request is valid, else `false`
2260
+ * @public
2261
+ */
2262
+ shouldHandle(e) {
2263
+ if (this.options.path) {
2264
+ const t = e.url.indexOf("?");
2265
+ if ((t !== -1 ? e.url.slice(0, t) : e.url) !== this.options.path)
2266
+ return !1;
2267
+ }
2268
+ return !0;
2269
+ }
2270
+ /**
2271
+ * Handle a HTTP Upgrade request.
2272
+ *
2273
+ * @param {http.IncomingMessage} req The request object
2274
+ * @param {(net.Socket|tls.Socket)} socket The network socket between the
2275
+ * server and client
2276
+ * @param {Buffer} head The first packet of the upgraded stream
2277
+ * @param {Function} cb Callback
2278
+ * @public
2279
+ */
2280
+ handleUpgrade(e, t, r, i) {
2281
+ t.on("error", Ze);
2282
+ const n = e.headers["sec-websocket-key"], o = +e.headers["sec-websocket-version"];
2283
+ if (e.method !== "GET") {
2284
+ R(this, e, t, 405, "Invalid HTTP method");
2285
+ return;
2286
+ }
2287
+ if (e.headers.upgrade.toLowerCase() !== "websocket") {
2288
+ R(this, e, t, 400, "Invalid Upgrade header");
2289
+ return;
2290
+ }
2291
+ if (!n || !Ws.test(n)) {
2292
+ R(this, e, t, 400, "Missing or invalid Sec-WebSocket-Key header");
2293
+ return;
2294
+ }
2295
+ if (o !== 8 && o !== 13) {
2296
+ R(this, e, t, 400, "Missing or invalid Sec-WebSocket-Version header");
2297
+ return;
2298
+ }
2299
+ if (!this.shouldHandle(e)) {
2300
+ H(t, 400);
2301
+ return;
2302
+ }
2303
+ const l = e.headers["sec-websocket-protocol"];
2304
+ let f = /* @__PURE__ */ new Set();
2305
+ if (l !== void 0)
2306
+ try {
2307
+ f = $s.parse(l);
2308
+ } catch {
2309
+ R(this, e, t, 400, "Invalid Sec-WebSocket-Protocol header");
2310
+ return;
2311
+ }
2312
+ const a = e.headers["sec-websocket-extensions"], c = {};
2313
+ if (this.options.perMessageDeflate && a !== void 0) {
2314
+ const h = new N(
2315
+ this.options.perMessageDeflate,
2316
+ !0,
2317
+ this.options.maxPayload
2318
+ );
2319
+ try {
2320
+ const p = qe.parse(a);
2321
+ p[N.extensionName] && (h.accept(p[N.extensionName]), c[N.extensionName] = h);
2322
+ } catch {
2323
+ R(this, e, t, 400, "Invalid or unacceptable Sec-WebSocket-Extensions header");
2324
+ return;
2325
+ }
2326
+ }
2327
+ if (this.options.verifyClient) {
2328
+ const h = {
2329
+ origin: e.headers[`${o === 8 ? "sec-websocket-origin" : "origin"}`],
2330
+ secure: !!(e.socket.authorized || e.socket.encrypted),
2331
+ req: e
2332
+ };
2333
+ if (this.options.verifyClient.length === 2) {
2334
+ this.options.verifyClient(h, (p, v, _, u) => {
2335
+ if (!p)
2336
+ return H(t, v || 401, _, u);
2337
+ this.completeUpgrade(
2338
+ c,
2339
+ n,
2340
+ f,
2341
+ e,
2342
+ t,
2343
+ r,
2344
+ i
2345
+ );
2346
+ });
2347
+ return;
2348
+ }
2349
+ if (!this.options.verifyClient(h))
2350
+ return H(t, 401);
2351
+ }
2352
+ this.completeUpgrade(c, n, f, e, t, r, i);
2353
+ }
2354
+ /**
2355
+ * Upgrade the connection to WebSocket.
2356
+ *
2357
+ * @param {Object} extensions The accepted extensions
2358
+ * @param {String} key The value of the `Sec-WebSocket-Key` header
2359
+ * @param {Set} protocols The subprotocols
2360
+ * @param {http.IncomingMessage} req The request object
2361
+ * @param {(net.Socket|tls.Socket)} socket The network socket between the
2362
+ * server and client
2363
+ * @param {Buffer} head The first packet of the upgraded stream
2364
+ * @param {Function} cb Callback
2365
+ * @throws {Error} If called more than once with the same socket
2366
+ * @private
2367
+ */
2368
+ completeUpgrade(e, t, r, i, n, o, l) {
2369
+ if (!n.readable || !n.writable)
2370
+ return n.destroy();
2371
+ if (n[Ds])
2372
+ throw new Error(
2373
+ "server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration"
2374
+ );
2375
+ if (this._state > Ke)
2376
+ return H(n, 503);
2377
+ const a = [
2378
+ "HTTP/1.1 101 Switching Protocols",
2379
+ "Upgrade: websocket",
2380
+ "Connection: Upgrade",
2381
+ `Sec-WebSocket-Accept: ${Bs("sha1").update(t + Is).digest("base64")}`
2382
+ ], c = new this.options.WebSocket(null);
2383
+ if (r.size) {
2384
+ const h = this.options.handleProtocols ? this.options.handleProtocols(r, i) : r.values().next().value;
2385
+ h && (a.push(`Sec-WebSocket-Protocol: ${h}`), c._protocol = h);
2386
+ }
2387
+ if (e[N.extensionName]) {
2388
+ const h = e[N.extensionName].params, p = qe.format({
2389
+ [N.extensionName]: [h]
2390
+ });
2391
+ a.push(`Sec-WebSocket-Extensions: ${p}`), c._extensions = e;
2392
+ }
2393
+ this.emit("headers", a, i), n.write(a.concat(`\r
2394
+ `).join(`\r
2395
+ `)), n.removeListener("error", Ze), c.setSocket(n, o, {
2396
+ maxPayload: this.options.maxPayload,
2397
+ skipUTF8Validation: this.options.skipUTF8Validation
2398
+ }), this.clients && (this.clients.add(c), c.on("close", () => {
2399
+ this.clients.delete(c), this._shouldEmitClose && !this.clients.size && process.nextTick(G, this);
2400
+ })), l(c, i);
2401
+ }
2402
+ }
2403
+ var Fs = As;
2404
+ function js(s, e) {
2405
+ for (const t of Object.keys(e))
2406
+ s.on(t, e[t]);
2407
+ return function() {
2408
+ for (const r of Object.keys(e))
2409
+ s.removeListener(r, e[r]);
2410
+ };
2411
+ }
2412
+ function G(s) {
2413
+ s._state = pt, s.emit("close");
2414
+ }
2415
+ function Ze() {
2416
+ this.destroy();
2417
+ }
2418
+ function H(s, e, t, r) {
2419
+ t = t || ie.STATUS_CODES[e], r = {
2420
+ Connection: "close",
2421
+ "Content-Type": "text/html",
2422
+ "Content-Length": Buffer.byteLength(t),
2423
+ ...r
2424
+ }, s.once("finish", s.destroy), s.end(
2425
+ `HTTP/1.1 ${e} ${ie.STATUS_CODES[e]}\r
2426
+ ` + Object.keys(r).map((i) => `${i}: ${r[i]}`).join(`\r
2427
+ `) + `\r
2428
+ \r
2429
+ ` + t
2430
+ );
2431
+ }
2432
+ function R(s, e, t, r, i) {
2433
+ if (s.listenerCount("wsClientError")) {
2434
+ const n = new Error(i);
2435
+ Error.captureStackTrace(n, R), s.emit("wsClientError", n, t, e);
2436
+ } else
2437
+ H(t, r, i);
2438
+ }
2439
+ const Zs = /* @__PURE__ */ z(Fs);
2440
+ export {
2441
+ qs as Receiver,
2442
+ Ks as Sender,
2443
+ Xs as WebSocket,
2444
+ Zs as WebSocketServer,
2445
+ Vs as createWebSocketStream,
2446
+ Xs as default
2447
+ };
src/backend/gradio_unifiedaudio/templates/example/index.js CHANGED
@@ -1,11 +1,11 @@
1
  const {
2
- SvelteComponent: f,
3
- append: u,
4
- attr: d,
5
  detach: g,
6
  element: o,
7
- init: v,
8
- insert: r,
9
  noop: c,
10
  safe_not_equal: y,
11
  set_data: m,
@@ -19,7 +19,7 @@ function w(a) {
19
  e = o("div"), n = b(
20
  /*value*/
21
  a[0]
22
- ), d(e, "class", "svelte-1gecy8w"), i(
23
  e,
24
  "table",
25
  /*type*/
@@ -37,7 +37,7 @@ function w(a) {
37
  );
38
  },
39
  m(t, l) {
40
- r(t, e, l), u(e, n);
41
  },
42
  p(t, [l]) {
43
  l & /*value*/
@@ -73,16 +73,16 @@ function w(a) {
73
  };
74
  }
75
  function h(a, e, n) {
76
- let { value: t } = e, { type: l } = e, { selected: _ = !1 } = e;
77
  return a.$$set = (s) => {
78
- "value" in s && n(0, t = s.value), "type" in s && n(1, l = s.type), "selected" in s && n(2, _ = s.selected);
79
- }, [t, l, _];
80
  }
81
- class E extends f {
82
  constructor(e) {
83
- super(), v(this, e, h, w, y, { value: 0, type: 1, selected: 2 });
84
  }
85
  }
86
  export {
87
- E as default
88
  };
 
1
  const {
2
+ SvelteComponent: u,
3
+ append: d,
4
+ attr: _,
5
  detach: g,
6
  element: o,
7
+ init: r,
8
+ insert: v,
9
  noop: c,
10
  safe_not_equal: y,
11
  set_data: m,
 
19
  e = o("div"), n = b(
20
  /*value*/
21
  a[0]
22
+ ), _(e, "class", "svelte-1gecy8w"), i(
23
  e,
24
  "table",
25
  /*type*/
 
37
  );
38
  },
39
  m(t, l) {
40
+ v(t, e, l), d(e, n);
41
  },
42
  p(t, [l]) {
43
  l & /*value*/
 
73
  };
74
  }
75
  function h(a, e, n) {
76
+ let { value: t } = e, { type: l } = e, { selected: f = !1 } = e;
77
  return a.$$set = (s) => {
78
+ "value" in s && n(0, t = s.value), "type" in s && n(1, l = s.type), "selected" in s && n(2, f = s.selected);
79
+ }, [t, l, f];
80
  }
81
+ class q extends u {
82
  constructor(e) {
83
+ super(), r(this, e, h, w, y, { value: 0, type: 1, selected: 2 });
84
  }
85
  }
86
  export {
87
+ q as default
88
  };
src/demo/app.py CHANGED
@@ -1,22 +1,33 @@
1
-
2
  import gradio as gr
3
  from gradio_unifiedaudio import UnifiedAudio
4
- from os.path import abspath, join, pardir
5
  from pathlib import Path
 
 
6
 
7
  example = UnifiedAudio().example_inputs()
8
  dir_ = Path(__file__).parent
9
 
10
- def test_mic(audio):
11
- return UnifiedAudio(value=audio, image="demo/freeman.jpg")
 
 
 
 
 
 
 
12
 
13
- def clear(audio):
14
- return UnifiedAudio(value=None)
15
 
16
  with gr.Blocks() as demo:
17
- mic = UnifiedAudio(sources="microphone")
18
- mic.change(test_mic, mic, mic)
19
- mic.end(clear, mic, mic)
 
 
 
 
20
 
21
  if __name__ == '__main__':
22
- demo.launch()
 
 
1
  import gradio as gr
2
  from gradio_unifiedaudio import UnifiedAudio
 
3
  from pathlib import Path
4
+ import numpy as np
5
+ import time
6
 
7
  example = UnifiedAudio().example_inputs()
8
  dir_ = Path(__file__).parent
9
 
10
+ def add_to_stream(audio, instream):
11
+ if instream is None:
12
+ ret = audio
13
+ else:
14
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
15
+ return audio, ret
16
+
17
+ def stop_recording(audio):
18
+ return UnifiedAudio(value=audio, streaming=False)
19
 
20
+ def stop_playing():
21
+ return UnifiedAudio(value=None, streaming=True), None
22
 
23
  with gr.Blocks() as demo:
24
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
25
+ stream = gr.State()
26
+
27
+ mic.stop_recording(stop_recording, stream, mic)
28
+ # mic.end(lambda: [None, None], None, [mic, stream])
29
+ mic.end(stop_playing, None, [mic, stream])
30
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
31
 
32
  if __name__ == '__main__':
33
+ demo.launch()
src/demo/space.py CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'UnifiedAudio': {'description': 'Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).', 'members': {'__init__': {'value': {'type': 'str\n | pathlib.Path\n | tuple[int, numpy.ndarray]\n | Callable\n | None', 'default': 'None', 'description': 'A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that UnifiedAudio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'image': {'type': 'str | None', 'default': 'None', 'description': 'A path or URL to an image to display above the audio component. If None, no image will be displayed.'}, 'sources': {'type': 'list["upload" | "microphone"] | None', 'default': 'None', 'description': 'A list of sources permitted for audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. The first element in the list will be used as the default source. If None, defaults to ["upload", "microphone"], or ["microphone"] if `streaming` is True.'}, 'type': {'type': '"numpy" | "filepath"', 'default': '"numpy"', 'description': 'The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': '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.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'streaming': {'type': 'bool', 'default': 'False', 'description': 'If set to True when used in a `live` interface as an input, will automatically stream webcam feed. When used set as an output, takes audio chunks yield from the backend and combines them into one streaming audio output.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'format': {'type': '"wav" | "mp3"', 'default': '"wav"', 'description': 'The file format to save audio files. Either \'wav\' or \'mp3\'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output.'}, 'autoplay': {'type': 'bool', 'default': 'False', 'description': 'Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet.'}, 'show_share_button': {'type': 'bool | None', 'default': 'None', 'description': 'If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.'}, 'min_length': {'type': 'int | None', 'default': 'None', 'description': 'The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.'}, 'waveform_options': {'type': 'WaveformOptions | None', 'default': 'None', 'description': 'A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.'}}, 'postprocess': {'value': {'type': 'tuple[int, numpy.ndarray]\n | str\n | pathlib.Path\n | bytes\n | None', 'description': 'audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.'}}, 'preprocess': {'return': {'type': 'tuple[int, numpy.ndarray] | str | None', 'description': None}, 'value': None}}, 'events': {'stream': {'type': None, 'default': None, 'description': 'This listener is triggered when the user streams the UnifiedAudio.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the UnifiedAudio changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the UnifiedAudio using the X button for the component.'}, 'play': {'type': None, 'default': None, 'description': 'This listener is triggered when the user plays the media in the UnifiedAudio.'}, 'pause': {'type': None, 'default': None, 'description': 'This listener is triggered when the media in the UnifiedAudio stops for any reason.'}, 'stop': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}, 'start_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user starts recording with the UnifiedAudio.'}, 'pause_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user pauses recording with the UnifiedAudio.'}, 'stop_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user stops recording with the UnifiedAudio.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the UnifiedAudio.'}}}, '__meta__': {'additional_interfaces': {'WaveformOptions': {'source': 'class WaveformOptions(TypedDict, total=False):\n waveform_color: str\n waveform_progress_color: str\n show_controls: bool\n skip_length: int'}}, 'user_fn_refs': {'UnifiedAudio': []}}}
7
-
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
10
  with gr.Blocks(
@@ -21,7 +21,7 @@ with gr.Blocks(
21
  # `gradio_unifiedaudio`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.2%20-%20orange">
25
  </div>
26
 
27
  Python library for easily interacting with trained machine learning models
@@ -38,25 +38,39 @@ pip install gradio_unifiedaudio
38
  ## Usage
39
 
40
  ```python
41
-
42
  import gradio as gr
43
  from gradio_unifiedaudio import UnifiedAudio
44
- from os.path import abspath, join, pardir
45
  from pathlib import Path
 
 
46
 
47
  example = UnifiedAudio().example_inputs()
48
  dir_ = Path(__file__).parent
49
 
50
- def test_mic(audio):
51
- return UnifiedAudio(value=audio)
 
 
 
 
 
 
 
 
 
 
52
 
53
  with gr.Blocks() as demo:
54
- mic = UnifiedAudio(sources="microphone")
55
- mic.change(test_mic, mic, mic)
 
 
 
 
 
56
 
57
  if __name__ == '__main__':
58
  demo.launch()
59
-
60
  ```
61
  """, elem_classes=["md-custom"], header_links=True)
62
 
@@ -82,11 +96,12 @@ if __name__ == '__main__':
82
 
83
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
84
 
85
- - When used as an Input, the component only impacts the input signature of the user function.
86
- - When used as an output, the component only impacts the return signature of the user function.
87
 
88
  The code snippet below is accurate in cases where the component is used as both an input and an output.
89
 
 
90
  - **As output:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
91
 
92
  ```python
@@ -133,7 +148,7 @@ class WaveformOptions(TypedDict, total=False):
133
  })
134
  }
135
  })
136
-
137
  Object.entries(refs).forEach(([key, refs]) => {
138
  if (refs.length > 0) {
139
  const el = document.querySelector(`.${key}`);
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'UnifiedAudio': {'description': 'Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).', 'members': {'__init__': {'value': {'type': 'str\n | pathlib.Path\n | tuple[int, numpy.ndarray]\n | Callable\n | None', 'default': 'None', 'description': 'A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that UnifiedAudio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'image': {'type': 'str | None', 'default': 'None', 'description': 'A path or URL to an image to display above the audio component. If None, no image will be displayed.'}, 'sources': {'type': 'list["upload" | "microphone"] | None', 'default': 'None', 'description': 'A list of sources permitted for audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. The first element in the list will be used as the default source. If None, defaults to ["upload", "microphone"], or ["microphone"] if `streaming` is True.'}, 'type': {'type': '"numpy" | "filepath"', 'default': '"numpy"', 'description': 'The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': '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.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'streaming': {'type': 'bool', 'default': 'False', 'description': 'If set to True when used in a `live` interface as an input, will automatically stream webcam feed. When used set as an output, takes audio chunks yield from the backend and combines them into one streaming audio output.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'format': {'type': '"wav" | "mp3"', 'default': '"wav"', 'description': 'The file format to save audio files. Either \'wav\' or \'mp3\'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output.'}, 'autoplay': {'type': 'bool', 'default': 'False', 'description': 'Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet.'}, 'show_share_button': {'type': 'bool | None', 'default': 'None', 'description': 'If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.'}, 'min_length': {'type': 'int | None', 'default': 'None', 'description': 'The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.'}, 'waveform_options': {'type': 'WaveformOptions | None', 'default': 'None', 'description': 'A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.'}}, 'postprocess': {'value': {'type': 'tuple[int, numpy.ndarray]\n | str\n | pathlib.Path\n | bytes\n | None', 'description': 'audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.'}}, 'preprocess': {'return': {'type': 'tuple[int, numpy.ndarray] | str | None', 'description': "The preprocessed input data sent to the user's function in the backend."}, 'value': None}}, 'events': {'stream': {'type': None, 'default': None, 'description': 'This listener is triggered when the user streams the UnifiedAudio.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the UnifiedAudio changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the UnifiedAudio using the X button for the component.'}, 'play': {'type': None, 'default': None, 'description': 'This listener is triggered when the user plays the media in the UnifiedAudio.'}, 'pause': {'type': None, 'default': None, 'description': 'This listener is triggered when the media in the UnifiedAudio stops for any reason.'}, 'stop': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}, 'start_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user starts recording with the UnifiedAudio.'}, 'pause_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user pauses recording with the UnifiedAudio.'}, 'stop_recording': {'type': None, 'default': None, 'description': 'This listener is triggered when the user stops recording with the UnifiedAudio.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the UnifiedAudio.'}, 'end': {'type': None, 'default': None, 'description': 'This listener is triggered when the user reaches the end of the media playing in the UnifiedAudio.'}}}, '__meta__': {'additional_interfaces': {'WaveformOptions': {'source': 'class WaveformOptions(TypedDict, total=False):\n waveform_color: str\n waveform_progress_color: str\n show_controls: bool\n skip_length: int'}}, 'user_fn_refs': {'UnifiedAudio': []}}}
7
+
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
10
  with gr.Blocks(
 
21
  # `gradio_unifiedaudio`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_unifiedaudio/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_unifiedaudio"></a>
25
  </div>
26
 
27
  Python library for easily interacting with trained machine learning models
 
38
  ## Usage
39
 
40
  ```python
 
41
  import gradio as gr
42
  from gradio_unifiedaudio import UnifiedAudio
 
43
  from pathlib import Path
44
+ import numpy as np
45
+ import time
46
 
47
  example = UnifiedAudio().example_inputs()
48
  dir_ = Path(__file__).parent
49
 
50
+ def add_to_stream(audio, instream):
51
+ if instream is None:
52
+ ret = audio
53
+ else:
54
+ ret = (audio[0], np.concatenate((instream[1], audio[1])))
55
+ return audio, ret
56
+
57
+ def stop_recording(audio):
58
+ return UnifiedAudio(value=audio, streaming=False)
59
+
60
+ def stop_playing():
61
+ return UnifiedAudio(value=None, streaming=True), None
62
 
63
  with gr.Blocks() as demo:
64
+ mic = UnifiedAudio(sources=["microphone"], streaming=True)
65
+ stream = gr.State()
66
+
67
+ mic.stop_recording(stop_recording, stream, mic)
68
+ # mic.end(lambda: [None, None], None, [mic, stream])
69
+ mic.end(stop_playing, None, [mic, stream])
70
+ mic.stream(add_to_stream, [mic, stream], [mic, stream])
71
 
72
  if __name__ == '__main__':
73
  demo.launch()
 
74
  ```
75
  """, elem_classes=["md-custom"], header_links=True)
76
 
 
96
 
97
  The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
98
 
99
+ - When used as an Input, the component only impacts the input signature of the user function.
100
+ - When used as an output, the component only impacts the return signature of the user function.
101
 
102
  The code snippet below is accurate in cases where the component is used as both an input and an output.
103
 
104
+ - **As input:** Is passed, the preprocessed input data sent to the user's function in the backend.
105
  - **As output:** Should return, audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None.
106
 
107
  ```python
 
148
  })
149
  }
150
  })
151
+
152
  Object.entries(refs).forEach(([key, refs]) => {
153
  if (refs.length > 0) {
154
  const el = document.querySelector(`.${key}`);
src/frontend/Index.svelte CHANGED
@@ -76,6 +76,7 @@
76
  value = initial_value;
77
  };
78
 
 
79
  $: {
80
  if (JSON.stringify(value) !== JSON.stringify(old_value)) {
81
  old_value = value;
@@ -115,7 +116,12 @@
115
  }
116
  </script>
117
 
118
- {#if !interactive || value !== null}
 
 
 
 
 
119
  <StaticAudio
120
  i18n={gradio.i18n}
121
  {image}
 
76
  value = initial_value;
77
  };
78
 
79
+
80
  $: {
81
  if (JSON.stringify(value) !== JSON.stringify(old_value)) {
82
  old_value = value;
 
116
  }
117
  </script>
118
 
119
+ {#if value !== null && !streaming}
120
+ <StatusTracker
121
+ autoscroll={gradio.autoscroll}
122
+ i18n={gradio.i18n}
123
+ {...loading_status}
124
+ />
125
  <StaticAudio
126
  i18n={gradio.i18n}
127
  {image}
src/frontend/interactive/InteractiveAudio.svelte CHANGED
@@ -26,6 +26,7 @@
26
  export let waveform_settings = {};
27
  export let dragging: boolean;
28
  export let active_source: "microphone" | "upload";
 
29
  export let handle_reset_value: () => void = () => {};
30
 
31
  $: dispatch("drag", dragging);
@@ -91,6 +92,47 @@
91
  recorder.stop();
92
  }
93
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  async function handle_chunk(event: IBlobEvent): Promise<void> {
96
  let buffer = await event.data.arrayBuffer();
@@ -117,6 +159,16 @@
117
  }
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
120
  function clear(): void {
121
  dispatch("change", null);
122
  dispatch("clear");
@@ -129,13 +181,37 @@
129
  dispatch("change", detail);
130
  dispatch("upload", detail);
131
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  </script>
133
 
134
- <AudioRecorder
135
- bind:mode
136
- {i18n}
137
- {dispatch}
138
- {dispatch_blob}
139
- {waveform_settings}
140
- {handle_reset_value}
141
- />
 
 
 
 
 
 
 
 
 
 
26
  export let waveform_settings = {};
27
  export let dragging: boolean;
28
  export let active_source: "microphone" | "upload";
29
+ export let waveform_options: WaveformOptions = {};
30
  export let handle_reset_value: () => void = () => {};
31
 
32
  $: dispatch("drag", dragging);
 
92
  recorder.stop();
93
  }
94
  });
95
+ let isRegistered = false;
96
+
97
+ async function prepare_audio(): Promise<void> {
98
+ let stream: MediaStream | null;
99
+
100
+ try {
101
+ stream = await navigator.mediaDevices.getUserMedia({ audio: true });
102
+ } catch (err) {
103
+ if (!navigator.mediaDevices) {
104
+ dispatch("error", i18n("audio.no_device_support"));
105
+ return;
106
+ }
107
+ if (err instanceof DOMException && err.name == "NotAllowedError") {
108
+ dispatch("error", i18n("audio.allow_recording_access"));
109
+ return;
110
+ }
111
+ throw err;
112
+ }
113
+ if (stream == null) return;
114
+ if (streaming) {
115
+ const [{ MediaRecorder, register }, { connect }] =
116
+ await Promise.all(module_promises);
117
+ try {
118
+ await register(await connect());
119
+ } catch (error) {}
120
+ recorder = new MediaRecorder(stream, { mimeType: "audio/wav" });
121
+ recorder.addEventListener("dataavailable", handle_chunk);
122
+ } else {
123
+ recorder = new MediaRecorder(stream);
124
+ recorder.addEventListener("dataavailable", (event) => {
125
+ audio_chunks.push(event.data);
126
+ });
127
+ recorder.addEventListener("stop", async () => {
128
+ recording = false;
129
+ await dispatch_blob(audio_chunks, "change");
130
+ await dispatch_blob(audio_chunks, "stop_recording");
131
+ audio_chunks = [];
132
+ });
133
+ }
134
+ inited = true;
135
+ }
136
 
137
  async function handle_chunk(event: IBlobEvent): Promise<void> {
138
  let buffer = await event.data.arrayBuffer();
 
159
  }
160
  }
161
 
162
+ async function record(): Promise<void> {
163
+ recording = true;
164
+ dispatch("start_recording");
165
+ if (!inited) await prepare_audio();
166
+ header = undefined;
167
+ if (streaming) {
168
+ recorder.start(STREAM_TIMESLICE);
169
+ }
170
+ }
171
+
172
  function clear(): void {
173
  dispatch("change", null);
174
  dispatch("clear");
 
181
  dispatch("change", detail);
182
  dispatch("upload", detail);
183
  }
184
+
185
+ function stop(): void {
186
+ recording = false;
187
+
188
+ if (streaming) {
189
+ dispatch("stop_recording");
190
+ recorder.stop();
191
+ if (pending) {
192
+ submit_pending_stream_on_pending_end = true;
193
+ }
194
+ dispatch_blob(audio_chunks, "stop_recording");
195
+ dispatch("clear");
196
+ mode = "";
197
+ }
198
+ }
199
  </script>
200
 
201
+ {#if streaming}
202
+ <StreamAudio
203
+ {record}
204
+ {recording}
205
+ {stop}
206
+ {waveform_settings}
207
+ />
208
+ {:else}
209
+ <AudioRecorder
210
+ bind:mode
211
+ {i18n}
212
+ {dispatch}
213
+ {dispatch_blob}
214
+ {waveform_settings}
215
+ {handle_reset_value}
216
+ />
217
+ {/if}
src/frontend/package-lock.json CHANGED
The diff for this file is too large to render. See raw diff
 
src/frontend/package.json CHANGED
@@ -15,12 +15,12 @@
15
  "@gradio/upload": "0.3.3",
16
  "@gradio/utils": "0.2.0",
17
  "@gradio/wasm": "0.2.0",
 
18
  "extendable-media-recorder": "^9.0.0",
19
  "extendable-media-recorder-wav-encoder": "^7.0.76",
20
  "resize-observer-polyfill": "^1.5.1",
21
  "svelte-range-slider-pips": "^2.0.1",
22
- "wavesurfer.js": "^7.4.2",
23
- "@types/wavesurfer.js": "^6.0.10"
24
  },
25
  "main_changeset": true,
26
  "main": "index.ts",
@@ -28,5 +28,8 @@
28
  ".": "./index.ts",
29
  "./example": "./Example.svelte",
30
  "./package.json": "./package.json"
 
 
 
31
  }
32
- }
 
15
  "@gradio/upload": "0.3.3",
16
  "@gradio/utils": "0.2.0",
17
  "@gradio/wasm": "0.2.0",
18
+ "@types/wavesurfer.js": "^6.0.10",
19
  "extendable-media-recorder": "^9.0.0",
20
  "extendable-media-recorder-wav-encoder": "^7.0.76",
21
  "resize-observer-polyfill": "^1.5.1",
22
  "svelte-range-slider-pips": "^2.0.1",
23
+ "wavesurfer.js": "^7.4.2"
 
24
  },
25
  "main_changeset": true,
26
  "main": "index.ts",
 
28
  ".": "./index.ts",
29
  "./example": "./Example.svelte",
30
  "./package.json": "./package.json"
31
+ },
32
+ "devDependencies": {
33
+ "@gradio/preview": "^0.9.0"
34
  }
35
+ }
src/frontend/pnpm-lock.yaml CHANGED
@@ -1,322 +1,634 @@
1
- lockfileVersion: '6.1'
2
 
3
  settings:
4
  autoInstallPeers: true
5
  excludeLinksFromLockfile: false
6
 
7
- dependencies:
8
- '@gradio/atoms':
9
- specifier: 0.2.1
10
- version: 0.2.1(svelte@4.2.8)
11
- '@gradio/button':
12
- specifier: 0.2.3
13
- version: 0.2.3(svelte@4.2.8)
14
- '@gradio/client':
15
- specifier: 0.7.2
16
- version: 0.7.2
17
- '@gradio/icons':
18
- specifier: 0.2.0
19
- version: 0.2.0
20
- '@gradio/statustracker':
21
- specifier: 0.3.1
22
- version: 0.3.1(svelte@4.2.8)
23
- '@gradio/upload':
24
- specifier: 0.3.3
25
- version: 0.3.3(svelte@4.2.8)
26
- '@gradio/utils':
27
- specifier: 0.2.0
28
- version: 0.2.0(svelte@4.2.8)
29
- '@gradio/wasm':
30
- specifier: 0.2.0
31
- version: 0.2.0
32
- '@types/wavesurfer.js':
33
- specifier: ^6.0.10
34
- version: 6.0.10
35
- extendable-media-recorder:
36
- specifier: ^9.0.0
37
- version: 9.0.0
38
- extendable-media-recorder-wav-encoder:
39
- specifier: ^7.0.76
40
- version: 7.0.76
41
- resize-observer-polyfill:
42
- specifier: ^1.5.1
43
- version: 1.5.1
44
- svelte-range-slider-pips:
45
- specifier: ^2.0.1
46
- version: 2.0.1
47
- wavesurfer.js:
48
- specifier: ^7.4.2
49
- version: 7.4.2
 
 
 
50
 
51
  packages:
52
 
53
- /@ampproject/remapping@2.2.1:
54
  resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
55
  engines: {node: '>=6.0.0'}
56
- dependencies:
57
- '@jridgewell/gen-mapping': 0.3.3
58
- '@jridgewell/trace-mapping': 0.3.21
59
- dev: false
60
 
61
- /@babel/runtime@7.23.8:
62
  resolution: {integrity: sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==}
63
  engines: {node: '>=6.9.0'}
64
- dependencies:
65
- regenerator-runtime: 0.14.1
66
- dev: false
67
 
68
- /@esbuild/aix-ppc64@0.19.11:
69
  resolution: {integrity: sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==}
70
  engines: {node: '>=12'}
71
  cpu: [ppc64]
72
  os: [aix]
73
- requiresBuild: true
74
- dev: false
75
- optional: true
76
 
77
- /@esbuild/android-arm64@0.19.11:
78
  resolution: {integrity: sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==}
79
  engines: {node: '>=12'}
80
  cpu: [arm64]
81
  os: [android]
82
- requiresBuild: true
83
- dev: false
84
- optional: true
85
 
86
- /@esbuild/android-arm@0.19.11:
87
  resolution: {integrity: sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==}
88
  engines: {node: '>=12'}
89
  cpu: [arm]
90
  os: [android]
91
- requiresBuild: true
92
- dev: false
93
- optional: true
94
 
95
- /@esbuild/android-x64@0.19.11:
96
  resolution: {integrity: sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==}
97
  engines: {node: '>=12'}
98
  cpu: [x64]
99
  os: [android]
100
- requiresBuild: true
101
- dev: false
102
- optional: true
103
 
104
- /@esbuild/darwin-arm64@0.19.11:
105
  resolution: {integrity: sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==}
106
  engines: {node: '>=12'}
107
  cpu: [arm64]
108
  os: [darwin]
109
- requiresBuild: true
110
- dev: false
111
- optional: true
112
 
113
- /@esbuild/darwin-x64@0.19.11:
114
  resolution: {integrity: sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==}
115
  engines: {node: '>=12'}
116
  cpu: [x64]
117
  os: [darwin]
118
- requiresBuild: true
119
- dev: false
120
- optional: true
121
 
122
- /@esbuild/freebsd-arm64@0.19.11:
123
  resolution: {integrity: sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==}
124
  engines: {node: '>=12'}
125
  cpu: [arm64]
126
  os: [freebsd]
127
- requiresBuild: true
128
- dev: false
129
- optional: true
130
 
131
- /@esbuild/freebsd-x64@0.19.11:
132
  resolution: {integrity: sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==}
133
  engines: {node: '>=12'}
134
  cpu: [x64]
135
  os: [freebsd]
136
- requiresBuild: true
137
- dev: false
138
- optional: true
139
 
140
- /@esbuild/linux-arm64@0.19.11:
141
  resolution: {integrity: sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==}
142
  engines: {node: '>=12'}
143
  cpu: [arm64]
144
  os: [linux]
145
- requiresBuild: true
146
- dev: false
147
- optional: true
148
 
149
- /@esbuild/linux-arm@0.19.11:
150
  resolution: {integrity: sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==}
151
  engines: {node: '>=12'}
152
  cpu: [arm]
153
  os: [linux]
154
- requiresBuild: true
155
- dev: false
156
- optional: true
157
 
158
- /@esbuild/linux-ia32@0.19.11:
159
  resolution: {integrity: sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==}
160
  engines: {node: '>=12'}
161
  cpu: [ia32]
162
  os: [linux]
163
- requiresBuild: true
164
- dev: false
165
- optional: true
166
 
167
- /@esbuild/linux-loong64@0.19.11:
168
  resolution: {integrity: sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==}
169
  engines: {node: '>=12'}
170
  cpu: [loong64]
171
  os: [linux]
172
- requiresBuild: true
173
- dev: false
174
- optional: true
175
 
176
- /@esbuild/linux-mips64el@0.19.11:
177
  resolution: {integrity: sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==}
178
  engines: {node: '>=12'}
179
  cpu: [mips64el]
180
  os: [linux]
181
- requiresBuild: true
182
- dev: false
183
- optional: true
184
 
185
- /@esbuild/linux-ppc64@0.19.11:
186
  resolution: {integrity: sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==}
187
  engines: {node: '>=12'}
188
  cpu: [ppc64]
189
  os: [linux]
190
- requiresBuild: true
191
- dev: false
192
- optional: true
193
 
194
- /@esbuild/linux-riscv64@0.19.11:
195
  resolution: {integrity: sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==}
196
  engines: {node: '>=12'}
197
  cpu: [riscv64]
198
  os: [linux]
199
- requiresBuild: true
200
- dev: false
201
- optional: true
202
 
203
- /@esbuild/linux-s390x@0.19.11:
204
  resolution: {integrity: sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==}
205
  engines: {node: '>=12'}
206
  cpu: [s390x]
207
  os: [linux]
208
- requiresBuild: true
209
- dev: false
210
- optional: true
211
 
212
- /@esbuild/linux-x64@0.19.11:
213
  resolution: {integrity: sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==}
214
  engines: {node: '>=12'}
215
  cpu: [x64]
216
  os: [linux]
217
- requiresBuild: true
218
- dev: false
219
- optional: true
220
 
221
- /@esbuild/netbsd-x64@0.19.11:
222
  resolution: {integrity: sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==}
223
  engines: {node: '>=12'}
224
  cpu: [x64]
225
  os: [netbsd]
226
- requiresBuild: true
227
- dev: false
228
- optional: true
229
 
230
- /@esbuild/openbsd-x64@0.19.11:
231
  resolution: {integrity: sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==}
232
  engines: {node: '>=12'}
233
  cpu: [x64]
234
  os: [openbsd]
235
- requiresBuild: true
236
- dev: false
237
- optional: true
238
 
239
- /@esbuild/sunos-x64@0.19.11:
240
  resolution: {integrity: sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==}
241
  engines: {node: '>=12'}
242
  cpu: [x64]
243
  os: [sunos]
244
- requiresBuild: true
245
- dev: false
246
- optional: true
247
 
248
- /@esbuild/win32-arm64@0.19.11:
249
  resolution: {integrity: sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==}
250
  engines: {node: '>=12'}
251
  cpu: [arm64]
252
  os: [win32]
253
- requiresBuild: true
254
- dev: false
255
- optional: true
256
 
257
- /@esbuild/win32-ia32@0.19.11:
258
  resolution: {integrity: sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==}
259
  engines: {node: '>=12'}
260
  cpu: [ia32]
261
  os: [win32]
262
- requiresBuild: true
263
- dev: false
264
- optional: true
265
 
266
- /@esbuild/win32-x64@0.19.11:
267
  resolution: {integrity: sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==}
268
  engines: {node: '>=12'}
269
  cpu: [x64]
270
  os: [win32]
271
- requiresBuild: true
272
- dev: false
273
- optional: true
274
 
275
- /@formatjs/ecma402-abstract@1.11.4:
276
  resolution: {integrity: sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  dependencies:
278
  '@formatjs/intl-localematcher': 0.2.25
279
  tslib: 2.6.2
280
- dev: false
281
 
282
- /@formatjs/fast-memoize@1.2.1:
283
- resolution: {integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==}
284
  dependencies:
285
  tslib: 2.6.2
286
- dev: false
287
 
288
- /@formatjs/icu-messageformat-parser@2.1.0:
289
- resolution: {integrity: sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==}
290
  dependencies:
291
  '@formatjs/ecma402-abstract': 1.11.4
292
  '@formatjs/icu-skeleton-parser': 1.3.6
293
  tslib: 2.6.2
294
- dev: false
295
 
296
- /@formatjs/icu-skeleton-parser@1.3.6:
297
- resolution: {integrity: sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==}
298
  dependencies:
299
  '@formatjs/ecma402-abstract': 1.11.4
300
  tslib: 2.6.2
301
- dev: false
302
 
303
- /@formatjs/intl-localematcher@0.2.25:
304
- resolution: {integrity: sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==}
305
  dependencies:
306
  tslib: 2.6.2
307
- dev: false
308
 
309
- /@gradio/atoms@0.2.1(svelte@4.2.8):
310
- resolution: {integrity: sha512-di3kKSbjxKGngvTAaqUaA6whOVs5BFlQULlWDPq1m37VRgUD7Oq2MkIE+T+YiNAhByN93pqA0hGrWwAUUuxy5Q==}
311
  dependencies:
312
  '@gradio/icons': 0.2.0
313
  '@gradio/utils': 0.2.0(svelte@4.2.8)
314
  transitivePeerDependencies:
315
  - svelte
316
- dev: false
317
 
318
- /@gradio/button@0.2.3(svelte@4.2.8):
319
- resolution: {integrity: sha512-vbSMcRNrtBKycnAgpCpepKaC4NNAg36I9qbEaz8wKqHqU02oTOaUeyelEitHLWULqLf3+sy6BM+JxxFjtELgXQ==}
320
  dependencies:
321
  '@gradio/client': 0.7.2
322
  '@gradio/upload': 0.3.3(svelte@4.2.8)
@@ -324,29 +636,20 @@ packages:
324
  transitivePeerDependencies:
325
  - svelte
326
  - utf-8-validate
327
- dev: false
328
 
329
- /@gradio/client@0.7.2:
330
- resolution: {integrity: sha512-YkT3c0u38ZYPKvOCmT0xLu3Gau4SwMe1Yo0PNvqTLwHfI4++dp5MJIWH97820MUqgQhYy6V3GmVAliHRmnfPbw==}
331
- engines: {node: '>=18.0.0'}
332
  dependencies:
333
  bufferutil: 4.0.8
334
  semiver: 1.1.0
335
  ws: 8.16.0(bufferutil@4.0.8)
336
  transitivePeerDependencies:
337
  - utf-8-validate
338
- dev: false
339
 
340
- /@gradio/column@0.1.0:
341
- resolution: {integrity: sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw==}
342
- dev: false
343
 
344
- /@gradio/icons@0.2.0:
345
- resolution: {integrity: sha512-rfCSmOF+ALqBOjTWL1ICasyA8JuO0MPwFrtlVMyAWp7R14AN8YChC/gbz5fZ0kNBiGGEYOOfqpKxyvC95jGGlg==}
346
- dev: false
347
 
348
- /@gradio/statustracker@0.3.1(svelte@4.2.8):
349
- resolution: {integrity: sha512-ZpmXZSnbgoFU2J54SrNntwfo2OEuEoRV310Q0zGVTH1VL7loziR7GuYhfIbgS8qFlrWM0MhMoLGDX+k7LAig5w==}
350
  dependencies:
351
  '@gradio/atoms': 0.2.1(svelte@4.2.8)
352
  '@gradio/column': 0.1.0
@@ -354,14 +657,10 @@ packages:
354
  '@gradio/utils': 0.2.0(svelte@4.2.8)
355
  transitivePeerDependencies:
356
  - svelte
357
- dev: false
358
 
359
- /@gradio/theme@0.2.0:
360
- resolution: {integrity: sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ==}
361
- dev: false
362
 
363
- /@gradio/upload@0.3.3(svelte@4.2.8):
364
- resolution: {integrity: sha512-KWRtH9UTe20u1/14KezuZDEwecLZzjDHdSPDUCrk27SrE6ptV8/qLtefOkg9zE+W51iATxDtQAvi0afLQ8XGrw==}
365
  dependencies:
366
  '@gradio/atoms': 0.2.1(svelte@4.2.8)
367
  '@gradio/client': 0.7.2
@@ -370,215 +669,136 @@ packages:
370
  transitivePeerDependencies:
371
  - svelte
372
  - utf-8-validate
373
- dev: false
374
 
375
- /@gradio/utils@0.2.0(svelte@4.2.8):
376
- resolution: {integrity: sha512-YkwzXufi6IxQrlMW+1sFo8Yn6F9NLL69ZoBsbo7QEhms0v5L7pmOTw+dfd7M3dwbRP2lgjrb52i1kAIN3n6aqQ==}
377
  dependencies:
378
  '@gradio/theme': 0.2.0
379
  svelte-i18n: 3.7.4(svelte@4.2.8)
380
  transitivePeerDependencies:
381
  - svelte
382
- dev: false
383
 
384
- /@gradio/wasm@0.2.0:
385
- resolution: {integrity: sha512-lU0Uzn4avbyO4AA1yp7IR2FQcO23YUEU3kn0NA8S9cGIZLzxj1FepPO1TsNXtMymDdKKx72TJW2v4yrv/j3H2A==}
386
  dependencies:
387
  '@types/path-browserify': 1.0.2
388
  path-browserify: 1.0.1
389
- dev: false
390
 
391
- /@jridgewell/gen-mapping@0.3.3:
392
- resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
393
- engines: {node: '>=6.0.0'}
394
  dependencies:
395
  '@jridgewell/set-array': 1.1.2
396
  '@jridgewell/sourcemap-codec': 1.4.15
397
  '@jridgewell/trace-mapping': 0.3.21
398
- dev: false
399
 
400
- /@jridgewell/resolve-uri@3.1.1:
401
- resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
402
- engines: {node: '>=6.0.0'}
403
- dev: false
404
 
405
- /@jridgewell/set-array@1.1.2:
406
- resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==}
407
- engines: {node: '>=6.0.0'}
408
- dev: false
409
 
410
- /@jridgewell/sourcemap-codec@1.4.15:
411
- resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
412
- dev: false
413
 
414
- /@jridgewell/trace-mapping@0.3.21:
415
- resolution: {integrity: sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==}
416
  dependencies:
417
  '@jridgewell/resolve-uri': 3.1.1
418
  '@jridgewell/sourcemap-codec': 1.4.15
419
- dev: false
420
 
421
- /@types/debounce@1.2.4:
422
- resolution: {integrity: sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==}
423
- dev: false
424
 
425
- /@types/estree@1.0.5:
426
- resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
427
- dev: false
428
 
429
- /@types/path-browserify@1.0.2:
430
- resolution: {integrity: sha512-ZkC5IUqqIFPXx3ASTTybTzmQdwHwe2C0u3eL75ldQ6T9E9IWFJodn6hIfbZGab73DfyiHN4Xw15gNxUq2FbvBA==}
431
- dev: false
432
 
433
- /@types/wavesurfer.js@6.0.10:
434
- resolution: {integrity: sha512-LEzDaKM8L/fx8lwh7SQROD8s5MuEtimChhEQ2HwDFJApPmZFALxSwwUMlEj0mT71EstWZuLhijY2uUiNRZtzqg==}
435
  dependencies:
436
  '@types/debounce': 1.2.4
437
- dev: false
438
 
439
- /acorn@8.11.3:
440
- resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
441
- engines: {node: '>=0.4.0'}
442
- hasBin: true
443
- dev: false
444
 
445
- /aria-query@5.3.0:
446
- resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}
447
  dependencies:
448
  dequal: 2.0.3
449
- dev: false
450
 
451
- /automation-events@6.0.13:
452
- resolution: {integrity: sha512-V1D19taPDEB7LUph6FpJv9m2i+UpLR096sAbPKt92sRChCOA6Jt2bcofU/YAwG8F8/qZp3GrrscJ1FzaEHd68w==}
453
- engines: {node: '>=16.1.0'}
454
  dependencies:
455
  '@babel/runtime': 7.23.8
456
  tslib: 2.6.2
457
- dev: false
458
 
459
- /axobject-query@3.2.1:
460
- resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==}
461
  dependencies:
462
  dequal: 2.0.3
463
- dev: false
464
 
465
- /broker-factory@3.0.89:
466
- resolution: {integrity: sha512-A2zkxJjpWjItTGzIETq7MFtBD6UgSA1VvfAeJIXsI+gq1nQ0VozuP80iZRXgdwRfFBCDdlB+8rzMO8Bfnwirug==}
467
  dependencies:
468
  '@babel/runtime': 7.23.8
469
  fast-unique-numbers: 8.0.12
470
  tslib: 2.6.2
471
  worker-factory: 7.0.16
472
- dev: false
473
 
474
- /bufferutil@4.0.8:
475
- resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==}
476
- engines: {node: '>=6.14.2'}
477
- requiresBuild: true
478
  dependencies:
479
  node-gyp-build: 4.8.0
480
- dev: false
481
 
482
- /cli-color@2.0.3:
483
- resolution: {integrity: sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==}
484
- engines: {node: '>=0.10'}
485
  dependencies:
486
  d: 1.0.1
487
  es5-ext: 0.10.62
488
  es6-iterator: 2.0.3
489
  memoizee: 0.4.15
490
  timers-ext: 0.1.7
491
- dev: false
492
 
493
- /code-red@1.0.4:
494
- resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==}
495
  dependencies:
496
  '@jridgewell/sourcemap-codec': 1.4.15
497
  '@types/estree': 1.0.5
498
  acorn: 8.11.3
499
  estree-walker: 3.0.3
500
  periscopic: 3.1.0
501
- dev: false
502
 
503
- /compilerr@11.0.13:
504
- resolution: {integrity: sha512-lqq1b3pFfn1Qims/lgzD5+uwOMzrDsUpiZ5LP2v8Sok7K+OFRt+m23GmkTBQl6ONvFSTB+xL1be8GXYsxt5dJQ==}
505
- engines: {node: '>=16.1.0'}
506
  dependencies:
507
  '@babel/runtime': 7.23.8
508
  dashify: 2.0.0
509
  indefinite-article: 0.0.2
510
  tslib: 2.6.2
511
- dev: false
512
 
513
- /css-tree@2.3.1:
514
- resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
515
- engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
516
  dependencies:
517
  mdn-data: 2.0.30
518
  source-map-js: 1.0.2
519
- dev: false
520
 
521
- /d@1.0.1:
522
- resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==}
523
  dependencies:
524
  es5-ext: 0.10.62
525
  type: 1.2.0
526
- dev: false
527
 
528
- /dashify@2.0.0:
529
- resolution: {integrity: sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A==}
530
- engines: {node: '>=4'}
531
- dev: false
532
 
533
- /deepmerge@4.3.1:
534
- resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
535
- engines: {node: '>=0.10.0'}
536
- dev: false
537
 
538
- /dequal@2.0.3:
539
- resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
540
- engines: {node: '>=6'}
541
- dev: false
542
 
543
- /es5-ext@0.10.62:
544
- resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==}
545
- engines: {node: '>=0.10'}
546
- requiresBuild: true
547
  dependencies:
548
  es6-iterator: 2.0.3
549
  es6-symbol: 3.1.3
550
  next-tick: 1.1.0
551
- dev: false
552
 
553
- /es6-iterator@2.0.3:
554
- resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==}
555
  dependencies:
556
  d: 1.0.1
557
  es5-ext: 0.10.62
558
  es6-symbol: 3.1.3
559
- dev: false
560
 
561
- /es6-symbol@3.1.3:
562
- resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==}
563
  dependencies:
564
  d: 1.0.1
565
  ext: 1.7.0
566
- dev: false
567
 
568
- /es6-weak-map@2.0.3:
569
- resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==}
570
  dependencies:
571
  d: 1.0.1
572
  es5-ext: 0.10.62
573
  es6-iterator: 2.0.3
574
  es6-symbol: 3.1.3
575
- dev: false
576
 
577
- /esbuild@0.19.11:
578
- resolution: {integrity: sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==}
579
- engines: {node: '>=12'}
580
- hasBin: true
581
- requiresBuild: true
582
  optionalDependencies:
583
  '@esbuild/aix-ppc64': 0.19.11
584
  '@esbuild/android-arm': 0.19.11
@@ -603,59 +823,43 @@ packages:
603
  '@esbuild/win32-arm64': 0.19.11
604
  '@esbuild/win32-ia32': 0.19.11
605
  '@esbuild/win32-x64': 0.19.11
606
- dev: false
607
 
608
- /estree-walker@2.0.2:
609
- resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
610
- dev: false
611
 
612
- /estree-walker@3.0.3:
613
- resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
614
  dependencies:
615
  '@types/estree': 1.0.5
616
- dev: false
617
 
618
- /event-emitter@0.3.5:
619
- resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==}
620
  dependencies:
621
  d: 1.0.1
622
  es5-ext: 0.10.62
623
- dev: false
624
 
625
- /ext@1.7.0:
626
- resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==}
627
  dependencies:
628
  type: 2.7.2
629
- dev: false
630
 
631
- /extendable-media-recorder-wav-encoder-broker@7.0.93:
632
- resolution: {integrity: sha512-mZQlQ9Yyt3/x3vO6apu5hR49RdLCtHVEqjmf3PSi5nPtrQSJKI5n3oUp9v4jRNAJbUCxtRmBZHDZ2HvwHfDtbQ==}
633
  dependencies:
634
  '@babel/runtime': 7.23.8
635
  broker-factory: 3.0.89
636
  extendable-media-recorder-wav-encoder-worker: 8.0.90
637
  tslib: 2.6.2
638
- dev: false
639
 
640
- /extendable-media-recorder-wav-encoder-worker@8.0.90:
641
- resolution: {integrity: sha512-13X3svoPjAlOmIWtRSyMC354vZF82GXhQnI2fHwp41k7hQCS1jaQ8WlUMzcyZ2GAKErbuzWAdVuKPLedNpQUDA==}
642
  dependencies:
643
  '@babel/runtime': 7.23.8
644
  tslib: 2.6.2
645
  worker-factory: 7.0.16
646
- dev: false
647
 
648
- /extendable-media-recorder-wav-encoder@7.0.76:
649
- resolution: {integrity: sha512-HLeyR9R0mUPOo7zG3d3GRWltNaSYUjyUZGQ8amRjuQVkZFXszmOIAAUVBq3fou0Z3V1mAEo+mXnCqbEfYtgZXQ==}
650
  dependencies:
651
  '@babel/runtime': 7.23.8
652
  extendable-media-recorder-wav-encoder-broker: 7.0.93
653
  extendable-media-recorder-wav-encoder-worker: 8.0.90
654
  tslib: 2.6.2
655
- dev: false
656
 
657
- /extendable-media-recorder@9.0.0:
658
- resolution: {integrity: sha512-50HNf/4wv2V7H7YBXVfxYLnaXQwMVcna9UHZxFPXmgWdThetWNu+TYKwA+xOPWA+rkr8Tqvtldxc/sPC/s/wXg==}
659
  dependencies:
660
  '@babel/runtime': 7.23.8
661
  media-encoder-host: 8.0.104
@@ -664,98 +868,66 @@ packages:
664
  standardized-audio-context: 25.3.61
665
  subscribable-things: 2.1.28
666
  tslib: 2.6.2
667
- dev: false
668
 
669
- /fast-unique-numbers@8.0.12:
670
- resolution: {integrity: sha512-Z4AJueNDnuC/sLxeQqrHP4zgqcBIeQQLbQ0hEx1a7m6Wf7ERrdAyR7CkGfoEFWm9Qla7dpLt0eWPyiO18gqj0A==}
671
- engines: {node: '>=16.1.0'}
672
  dependencies:
673
  '@babel/runtime': 7.23.8
674
  tslib: 2.6.2
675
- dev: false
676
 
677
- /globalyzer@0.1.0:
678
- resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
679
- dev: false
680
 
681
- /globrex@0.1.2:
682
- resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
683
- dev: false
684
 
685
- /indefinite-article@0.0.2:
686
- resolution: {integrity: sha512-Au/2XzRkvxq2J6w5uvSSbBKPZ5kzINx5F2wb0SF8xpRL8BP9Lav81TnRbfPp6p+SYjYxwaaLn4EUwI3/MmYKSw==}
687
- dev: false
688
 
689
- /intl-messageformat@9.13.0:
690
- resolution: {integrity: sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==}
691
  dependencies:
692
  '@formatjs/ecma402-abstract': 1.11.4
693
  '@formatjs/fast-memoize': 1.2.1
694
  '@formatjs/icu-messageformat-parser': 2.1.0
695
  tslib: 2.6.2
696
- dev: false
697
 
698
- /is-promise@2.2.2:
699
- resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==}
700
- dev: false
701
 
702
- /is-reference@3.0.2:
703
- resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==}
704
  dependencies:
705
  '@types/estree': 1.0.5
706
- dev: false
707
 
708
- /locate-character@3.0.0:
709
- resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
710
- dev: false
711
 
712
- /lru-queue@0.1.0:
713
- resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==}
714
  dependencies:
715
  es5-ext: 0.10.62
716
- dev: false
717
 
718
- /magic-string@0.30.5:
719
- resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==}
720
- engines: {node: '>=12'}
721
  dependencies:
722
  '@jridgewell/sourcemap-codec': 1.4.15
723
- dev: false
724
 
725
- /mdn-data@2.0.30:
726
- resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
727
- dev: false
728
 
729
- /media-encoder-host-broker@7.0.94:
730
- resolution: {integrity: sha512-M3nBVELYCSaVIQWaClYcnAC5ygCSBnfUCbxkcEhPWg+tYgvMlPwDq7unHS6UZI7uecVwyRTN31IL/wa31x0VEg==}
731
  dependencies:
732
  '@babel/runtime': 7.23.8
733
  broker-factory: 3.0.89
734
  fast-unique-numbers: 8.0.12
735
  media-encoder-host-worker: 9.1.16
736
  tslib: 2.6.2
737
- dev: false
738
 
739
- /media-encoder-host-worker@9.1.16:
740
- resolution: {integrity: sha512-L1rD1DXoSLxRhgN52cKwNzzqAIo1y+SXSFKzn+Fj5fFNldOCn4wl4BbuPN6u4HW4yHRzxa6mupTjVaKumiw7uw==}
741
  dependencies:
742
  '@babel/runtime': 7.23.8
743
  extendable-media-recorder-wav-encoder-broker: 7.0.93
744
  tslib: 2.6.2
745
  worker-factory: 7.0.16
746
- dev: false
747
 
748
- /media-encoder-host@8.0.104:
749
- resolution: {integrity: sha512-DXOm4XbwCKWoCtW2B4leb9YAfC/1HxG8ysT5AOFXNPs5E9UuamDCa0zhtRNPNn2Bp3MJCiB1qo8jORhqVubJhQ==}
750
  dependencies:
751
  '@babel/runtime': 7.23.8
752
  media-encoder-host-broker: 7.0.94
753
  media-encoder-host-worker: 9.1.16
754
  tslib: 2.6.2
755
- dev: false
756
 
757
- /memoizee@0.4.15:
758
- resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==}
759
  dependencies:
760
  d: 1.0.1
761
  es5-ext: 0.10.62
@@ -765,51 +937,32 @@ packages:
765
  lru-queue: 0.1.0
766
  next-tick: 1.1.0
767
  timers-ext: 0.1.7
768
- dev: false
769
 
770
- /mri@1.2.0:
771
- resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
772
- engines: {node: '>=4'}
773
- dev: false
774
 
775
- /multi-buffer-data-view@5.0.13:
776
- resolution: {integrity: sha512-1aR8uZp6JOEq1tb1euDmCZFm0ksOe8Kub3ItBrDPBKVhlPaknUcAhanDxrSVrJiJb5c+4vsB1U6Tye8AbL9XkQ==}
777
- engines: {node: '>=16.1.0'}
778
  dependencies:
779
  '@babel/runtime': 7.23.8
780
  tslib: 2.6.2
781
- dev: false
782
 
783
- /next-tick@1.1.0:
784
- resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
785
- dev: false
786
 
787
- /node-gyp-build@4.8.0:
788
- resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==}
789
- hasBin: true
790
- dev: false
791
 
792
- /path-browserify@1.0.1:
793
- resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
794
- dev: false
795
 
796
- /periscopic@3.1.0:
797
- resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==}
798
  dependencies:
799
  '@types/estree': 1.0.5
800
  estree-walker: 3.0.3
801
  is-reference: 3.0.2
802
- dev: false
803
 
804
- /recorder-audio-worklet-processor@5.0.12:
805
- resolution: {integrity: sha512-t8PUAo8au5MaxXaofhCCGGYntYm8dJkM4uGz6IQ3VXv29eoLRPAURKUNRCG/rufdwKm21X6LyxulEsWoL+x/EQ==}
806
  dependencies:
807
  '@babel/runtime': 7.23.8
808
  tslib: 2.6.2
809
- dev: false
810
 
811
- /recorder-audio-worklet@6.0.17:
812
- resolution: {integrity: sha512-SlK6XYwDonSUKUE6OBj+cwZhqzY7Pz3Eiv4dAFfuR5npOHHfj/mvSadmkhk5r6KltZ6aCgXoPNtGYDH6BchXwA==}
813
  dependencies:
814
  '@babel/runtime': 7.23.8
815
  broker-factory: 3.0.89
@@ -819,59 +972,34 @@ packages:
819
  subscribable-things: 2.1.28
820
  tslib: 2.6.2
821
  worker-factory: 7.0.16
822
- dev: false
823
 
824
- /regenerator-runtime@0.14.1:
825
- resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==}
826
- dev: false
827
 
828
- /resize-observer-polyfill@1.5.1:
829
- resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==}
830
- dev: false
831
 
832
- /rxjs-interop@2.0.0:
833
- resolution: {integrity: sha512-ASEq9atUw7lualXB+knvgtvwkCEvGWV2gDD/8qnASzBkzEARZck9JAyxmY8OS6Nc1pCPEgDTKNcx+YqqYfzArw==}
834
- dev: false
835
 
836
- /sade@1.8.1:
837
- resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
838
- engines: {node: '>=6'}
839
  dependencies:
840
  mri: 1.2.0
841
- dev: false
842
 
843
- /semiver@1.1.0:
844
- resolution: {integrity: sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==}
845
- engines: {node: '>=6'}
846
- dev: false
847
 
848
- /source-map-js@1.0.2:
849
- resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
850
- engines: {node: '>=0.10.0'}
851
- dev: false
852
 
853
- /standardized-audio-context@25.3.61:
854
- resolution: {integrity: sha512-ew5s1DOlSfU/oHtdIbRGhtPriGd2D4ttVY0uB63Ura1bQWG+c0YVFtmy2fBPLcKH5qkIbrHHlwJTikgVsJ62dg==}
855
  dependencies:
856
  '@babel/runtime': 7.23.8
857
  automation-events: 6.0.13
858
  tslib: 2.6.2
859
- dev: false
860
 
861
- /subscribable-things@2.1.28:
862
- resolution: {integrity: sha512-uZipZJ2/EyClGZZSDsRMXBpvDvK18QCKBc42b6fT9TYNFSjwy7+GEWWkxeFY+jCpXhgfrd3CnrQ2reinhFn8yw==}
863
  dependencies:
864
  '@babel/runtime': 7.23.8
865
  rxjs-interop: 2.0.0
866
  tslib: 2.6.2
867
- dev: false
868
 
869
- /svelte-i18n@3.7.4(svelte@4.2.8):
870
- resolution: {integrity: sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==}
871
- engines: {node: '>= 16'}
872
- hasBin: true
873
- peerDependencies:
874
- svelte: ^3 || ^4
875
  dependencies:
876
  cli-color: 2.0.3
877
  deepmerge: 4.3.1
@@ -881,15 +1009,10 @@ packages:
881
  sade: 1.8.1
882
  svelte: 4.2.8
883
  tiny-glob: 0.2.9
884
- dev: false
885
 
886
- /svelte-range-slider-pips@2.0.1:
887
- resolution: {integrity: sha512-sCHvcTgi0ZYE4c/mwSsdALRsfuqEmpwTsSUdL+PUrumZ8u2gv1GKwZ3GohcAcTB6gfmqRBkyn6ujRXrOIga1gw==}
888
- dev: false
889
 
890
- /svelte@4.2.8:
891
- resolution: {integrity: sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==}
892
- engines: {node: '>=16'}
893
  dependencies:
894
  '@ampproject/remapping': 2.2.1
895
  '@jridgewell/sourcemap-codec': 1.4.15
@@ -904,58 +1027,32 @@ packages:
904
  locate-character: 3.0.0
905
  magic-string: 0.30.5
906
  periscopic: 3.1.0
907
- dev: false
908
 
909
- /timers-ext@0.1.7:
910
- resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==}
911
  dependencies:
912
  es5-ext: 0.10.62
913
  next-tick: 1.1.0
914
- dev: false
915
 
916
- /tiny-glob@0.2.9:
917
- resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
918
  dependencies:
919
  globalyzer: 0.1.0
920
  globrex: 0.1.2
921
- dev: false
922
 
923
- /tslib@2.6.2:
924
- resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
925
- dev: false
926
 
927
- /type@1.2.0:
928
- resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==}
929
- dev: false
930
 
931
- /type@2.7.2:
932
- resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==}
933
- dev: false
934
 
935
- /wavesurfer.js@7.4.2:
936
- resolution: {integrity: sha512-4pNQ1porOCUBYBmd2F1TqVuBnB2wBPipaw2qI920zYLuPnada0Rd1CURgh8HRuPGKxijj2iyZDFN2UZwsaEuhA==}
937
- dev: false
938
 
939
- /worker-factory@7.0.16:
940
- resolution: {integrity: sha512-AjDMwO9SwgQhKNgDdL88RidnqP5Sjs3+MH5yu/Es/IuQLlxr3Gcz/fQRqBc85sBijYcsjs2FQD07Vy2vySQUgg==}
941
  dependencies:
942
  '@babel/runtime': 7.23.8
943
  compilerr: 11.0.13
944
  fast-unique-numbers: 8.0.12
945
  tslib: 2.6.2
946
- dev: false
947
 
948
- /ws@8.16.0(bufferutil@4.0.8):
949
- resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
950
- engines: {node: '>=10.0.0'}
951
- peerDependencies:
952
- bufferutil: ^4.0.1
953
- utf-8-validate: '>=5.0.2'
954
- peerDependenciesMeta:
955
- bufferutil:
956
- optional: true
957
- utf-8-validate:
958
- optional: true
959
- dependencies:
960
  bufferutil: 4.0.8
961
- dev: false
 
1
+ lockfileVersion: '9.0'
2
 
3
  settings:
4
  autoInstallPeers: true
5
  excludeLinksFromLockfile: false
6
 
7
+ importers:
8
+
9
+ .:
10
+ dependencies:
11
+ '@gradio/atoms':
12
+ specifier: 0.2.1
13
+ version: 0.2.1(svelte@4.2.8)
14
+ '@gradio/button':
15
+ specifier: 0.2.3
16
+ version: 0.2.3(svelte@4.2.8)
17
+ '@gradio/client':
18
+ specifier: 0.7.2
19
+ version: 0.7.2
20
+ '@gradio/icons':
21
+ specifier: 0.2.0
22
+ version: 0.2.0
23
+ '@gradio/statustracker':
24
+ specifier: 0.3.1
25
+ version: 0.3.1(svelte@4.2.8)
26
+ '@gradio/upload':
27
+ specifier: 0.3.3
28
+ version: 0.3.3(svelte@4.2.8)
29
+ '@gradio/utils':
30
+ specifier: 0.2.0
31
+ version: 0.2.0(svelte@4.2.8)
32
+ '@gradio/wasm':
33
+ specifier: 0.2.0
34
+ version: 0.2.0
35
+ '@types/wavesurfer.js':
36
+ specifier: ^6.0.10
37
+ version: 6.0.10
38
+ extendable-media-recorder:
39
+ specifier: ^9.0.0
40
+ version: 9.0.0
41
+ extendable-media-recorder-wav-encoder:
42
+ specifier: ^7.0.76
43
+ version: 7.0.76
44
+ resize-observer-polyfill:
45
+ specifier: ^1.5.1
46
+ version: 1.5.1
47
+ svelte-range-slider-pips:
48
+ specifier: ^2.0.1
49
+ version: 2.0.1
50
+ wavesurfer.js:
51
+ specifier: ^7.4.2
52
+ version: 7.4.2
53
 
54
  packages:
55
 
56
+ '@ampproject/remapping@2.2.1':
57
  resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
58
  engines: {node: '>=6.0.0'}
 
 
 
 
59
 
60
+ '@babel/runtime@7.23.8':
61
  resolution: {integrity: sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==}
62
  engines: {node: '>=6.9.0'}
 
 
 
63
 
64
+ '@esbuild/aix-ppc64@0.19.11':
65
  resolution: {integrity: sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==}
66
  engines: {node: '>=12'}
67
  cpu: [ppc64]
68
  os: [aix]
 
 
 
69
 
70
+ '@esbuild/android-arm64@0.19.11':
71
  resolution: {integrity: sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==}
72
  engines: {node: '>=12'}
73
  cpu: [arm64]
74
  os: [android]
 
 
 
75
 
76
+ '@esbuild/android-arm@0.19.11':
77
  resolution: {integrity: sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==}
78
  engines: {node: '>=12'}
79
  cpu: [arm]
80
  os: [android]
 
 
 
81
 
82
+ '@esbuild/android-x64@0.19.11':
83
  resolution: {integrity: sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==}
84
  engines: {node: '>=12'}
85
  cpu: [x64]
86
  os: [android]
 
 
 
87
 
88
+ '@esbuild/darwin-arm64@0.19.11':
89
  resolution: {integrity: sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==}
90
  engines: {node: '>=12'}
91
  cpu: [arm64]
92
  os: [darwin]
 
 
 
93
 
94
+ '@esbuild/darwin-x64@0.19.11':
95
  resolution: {integrity: sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==}
96
  engines: {node: '>=12'}
97
  cpu: [x64]
98
  os: [darwin]
 
 
 
99
 
100
+ '@esbuild/freebsd-arm64@0.19.11':
101
  resolution: {integrity: sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==}
102
  engines: {node: '>=12'}
103
  cpu: [arm64]
104
  os: [freebsd]
 
 
 
105
 
106
+ '@esbuild/freebsd-x64@0.19.11':
107
  resolution: {integrity: sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==}
108
  engines: {node: '>=12'}
109
  cpu: [x64]
110
  os: [freebsd]
 
 
 
111
 
112
+ '@esbuild/linux-arm64@0.19.11':
113
  resolution: {integrity: sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==}
114
  engines: {node: '>=12'}
115
  cpu: [arm64]
116
  os: [linux]
 
 
 
117
 
118
+ '@esbuild/linux-arm@0.19.11':
119
  resolution: {integrity: sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==}
120
  engines: {node: '>=12'}
121
  cpu: [arm]
122
  os: [linux]
 
 
 
123
 
124
+ '@esbuild/linux-ia32@0.19.11':
125
  resolution: {integrity: sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==}
126
  engines: {node: '>=12'}
127
  cpu: [ia32]
128
  os: [linux]
 
 
 
129
 
130
+ '@esbuild/linux-loong64@0.19.11':
131
  resolution: {integrity: sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==}
132
  engines: {node: '>=12'}
133
  cpu: [loong64]
134
  os: [linux]
 
 
 
135
 
136
+ '@esbuild/linux-mips64el@0.19.11':
137
  resolution: {integrity: sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==}
138
  engines: {node: '>=12'}
139
  cpu: [mips64el]
140
  os: [linux]
 
 
 
141
 
142
+ '@esbuild/linux-ppc64@0.19.11':
143
  resolution: {integrity: sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==}
144
  engines: {node: '>=12'}
145
  cpu: [ppc64]
146
  os: [linux]
 
 
 
147
 
148
+ '@esbuild/linux-riscv64@0.19.11':
149
  resolution: {integrity: sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==}
150
  engines: {node: '>=12'}
151
  cpu: [riscv64]
152
  os: [linux]
 
 
 
153
 
154
+ '@esbuild/linux-s390x@0.19.11':
155
  resolution: {integrity: sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==}
156
  engines: {node: '>=12'}
157
  cpu: [s390x]
158
  os: [linux]
 
 
 
159
 
160
+ '@esbuild/linux-x64@0.19.11':
161
  resolution: {integrity: sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==}
162
  engines: {node: '>=12'}
163
  cpu: [x64]
164
  os: [linux]
 
 
 
165
 
166
+ '@esbuild/netbsd-x64@0.19.11':
167
  resolution: {integrity: sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==}
168
  engines: {node: '>=12'}
169
  cpu: [x64]
170
  os: [netbsd]
 
 
 
171
 
172
+ '@esbuild/openbsd-x64@0.19.11':
173
  resolution: {integrity: sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==}
174
  engines: {node: '>=12'}
175
  cpu: [x64]
176
  os: [openbsd]
 
 
 
177
 
178
+ '@esbuild/sunos-x64@0.19.11':
179
  resolution: {integrity: sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==}
180
  engines: {node: '>=12'}
181
  cpu: [x64]
182
  os: [sunos]
 
 
 
183
 
184
+ '@esbuild/win32-arm64@0.19.11':
185
  resolution: {integrity: sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==}
186
  engines: {node: '>=12'}
187
  cpu: [arm64]
188
  os: [win32]
 
 
 
189
 
190
+ '@esbuild/win32-ia32@0.19.11':
191
  resolution: {integrity: sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==}
192
  engines: {node: '>=12'}
193
  cpu: [ia32]
194
  os: [win32]
 
 
 
195
 
196
+ '@esbuild/win32-x64@0.19.11':
197
  resolution: {integrity: sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==}
198
  engines: {node: '>=12'}
199
  cpu: [x64]
200
  os: [win32]
 
 
 
201
 
202
+ '@formatjs/ecma402-abstract@1.11.4':
203
  resolution: {integrity: sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==}
204
+
205
+ '@formatjs/fast-memoize@1.2.1':
206
+ resolution: {integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==}
207
+
208
+ '@formatjs/icu-messageformat-parser@2.1.0':
209
+ resolution: {integrity: sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==}
210
+
211
+ '@formatjs/icu-skeleton-parser@1.3.6':
212
+ resolution: {integrity: sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==}
213
+
214
+ '@formatjs/intl-localematcher@0.2.25':
215
+ resolution: {integrity: sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==}
216
+
217
+ '@gradio/atoms@0.2.1':
218
+ resolution: {integrity: sha512-di3kKSbjxKGngvTAaqUaA6whOVs5BFlQULlWDPq1m37VRgUD7Oq2MkIE+T+YiNAhByN93pqA0hGrWwAUUuxy5Q==}
219
+
220
+ '@gradio/button@0.2.3':
221
+ resolution: {integrity: sha512-vbSMcRNrtBKycnAgpCpepKaC4NNAg36I9qbEaz8wKqHqU02oTOaUeyelEitHLWULqLf3+sy6BM+JxxFjtELgXQ==}
222
+
223
+ '@gradio/client@0.7.2':
224
+ resolution: {integrity: sha512-YkT3c0u38ZYPKvOCmT0xLu3Gau4SwMe1Yo0PNvqTLwHfI4++dp5MJIWH97820MUqgQhYy6V3GmVAliHRmnfPbw==}
225
+ engines: {node: '>=18.0.0'}
226
+
227
+ '@gradio/column@0.1.0':
228
+ resolution: {integrity: sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw==}
229
+
230
+ '@gradio/icons@0.2.0':
231
+ resolution: {integrity: sha512-rfCSmOF+ALqBOjTWL1ICasyA8JuO0MPwFrtlVMyAWp7R14AN8YChC/gbz5fZ0kNBiGGEYOOfqpKxyvC95jGGlg==}
232
+
233
+ '@gradio/statustracker@0.3.1':
234
+ resolution: {integrity: sha512-ZpmXZSnbgoFU2J54SrNntwfo2OEuEoRV310Q0zGVTH1VL7loziR7GuYhfIbgS8qFlrWM0MhMoLGDX+k7LAig5w==}
235
+
236
+ '@gradio/theme@0.2.0':
237
+ resolution: {integrity: sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ==}
238
+
239
+ '@gradio/upload@0.3.3':
240
+ resolution: {integrity: sha512-KWRtH9UTe20u1/14KezuZDEwecLZzjDHdSPDUCrk27SrE6ptV8/qLtefOkg9zE+W51iATxDtQAvi0afLQ8XGrw==}
241
+
242
+ '@gradio/utils@0.2.0':
243
+ resolution: {integrity: sha512-YkwzXufi6IxQrlMW+1sFo8Yn6F9NLL69ZoBsbo7QEhms0v5L7pmOTw+dfd7M3dwbRP2lgjrb52i1kAIN3n6aqQ==}
244
+
245
+ '@gradio/wasm@0.2.0':
246
+ resolution: {integrity: sha512-lU0Uzn4avbyO4AA1yp7IR2FQcO23YUEU3kn0NA8S9cGIZLzxj1FepPO1TsNXtMymDdKKx72TJW2v4yrv/j3H2A==}
247
+
248
+ '@jridgewell/gen-mapping@0.3.3':
249
+ resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
250
+ engines: {node: '>=6.0.0'}
251
+
252
+ '@jridgewell/resolve-uri@3.1.1':
253
+ resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
254
+ engines: {node: '>=6.0.0'}
255
+
256
+ '@jridgewell/set-array@1.1.2':
257
+ resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==}
258
+ engines: {node: '>=6.0.0'}
259
+
260
+ '@jridgewell/sourcemap-codec@1.4.15':
261
+ resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
262
+
263
+ '@jridgewell/trace-mapping@0.3.21':
264
+ resolution: {integrity: sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==}
265
+
266
+ '@types/debounce@1.2.4':
267
+ resolution: {integrity: sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==}
268
+
269
+ '@types/estree@1.0.5':
270
+ resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
271
+
272
+ '@types/path-browserify@1.0.2':
273
+ resolution: {integrity: sha512-ZkC5IUqqIFPXx3ASTTybTzmQdwHwe2C0u3eL75ldQ6T9E9IWFJodn6hIfbZGab73DfyiHN4Xw15gNxUq2FbvBA==}
274
+
275
+ '@types/wavesurfer.js@6.0.10':
276
+ resolution: {integrity: sha512-LEzDaKM8L/fx8lwh7SQROD8s5MuEtimChhEQ2HwDFJApPmZFALxSwwUMlEj0mT71EstWZuLhijY2uUiNRZtzqg==}
277
+
278
+ acorn@8.11.3:
279
+ resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
280
+ engines: {node: '>=0.4.0'}
281
+ hasBin: true
282
+
283
+ aria-query@5.3.0:
284
+ resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}
285
+
286
+ automation-events@6.0.13:
287
+ resolution: {integrity: sha512-V1D19taPDEB7LUph6FpJv9m2i+UpLR096sAbPKt92sRChCOA6Jt2bcofU/YAwG8F8/qZp3GrrscJ1FzaEHd68w==}
288
+ engines: {node: '>=16.1.0'}
289
+
290
+ axobject-query@3.2.1:
291
+ resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==}
292
+
293
+ broker-factory@3.0.89:
294
+ resolution: {integrity: sha512-A2zkxJjpWjItTGzIETq7MFtBD6UgSA1VvfAeJIXsI+gq1nQ0VozuP80iZRXgdwRfFBCDdlB+8rzMO8Bfnwirug==}
295
+
296
+ bufferutil@4.0.8:
297
+ resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==}
298
+ engines: {node: '>=6.14.2'}
299
+
300
+ cli-color@2.0.3:
301
+ resolution: {integrity: sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==}
302
+ engines: {node: '>=0.10'}
303
+
304
+ code-red@1.0.4:
305
+ resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==}
306
+
307
+ compilerr@11.0.13:
308
+ resolution: {integrity: sha512-lqq1b3pFfn1Qims/lgzD5+uwOMzrDsUpiZ5LP2v8Sok7K+OFRt+m23GmkTBQl6ONvFSTB+xL1be8GXYsxt5dJQ==}
309
+ engines: {node: '>=16.1.0'}
310
+
311
+ css-tree@2.3.1:
312
+ resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
313
+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
314
+
315
+ d@1.0.1:
316
+ resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==}
317
+
318
+ dashify@2.0.0:
319
+ resolution: {integrity: sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A==}
320
+ engines: {node: '>=4'}
321
+
322
+ deepmerge@4.3.1:
323
+ resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
324
+ engines: {node: '>=0.10.0'}
325
+
326
+ dequal@2.0.3:
327
+ resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
328
+ engines: {node: '>=6'}
329
+
330
+ es5-ext@0.10.62:
331
+ resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==}
332
+ engines: {node: '>=0.10'}
333
+
334
+ es6-iterator@2.0.3:
335
+ resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==}
336
+
337
+ es6-symbol@3.1.3:
338
+ resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==}
339
+
340
+ es6-weak-map@2.0.3:
341
+ resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==}
342
+
343
+ esbuild@0.19.11:
344
+ resolution: {integrity: sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==}
345
+ engines: {node: '>=12'}
346
+ hasBin: true
347
+
348
+ estree-walker@2.0.2:
349
+ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
350
+
351
+ estree-walker@3.0.3:
352
+ resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
353
+
354
+ event-emitter@0.3.5:
355
+ resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==}
356
+
357
+ ext@1.7.0:
358
+ resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==}
359
+
360
+ extendable-media-recorder-wav-encoder-broker@7.0.93:
361
+ resolution: {integrity: sha512-mZQlQ9Yyt3/x3vO6apu5hR49RdLCtHVEqjmf3PSi5nPtrQSJKI5n3oUp9v4jRNAJbUCxtRmBZHDZ2HvwHfDtbQ==}
362
+
363
+ extendable-media-recorder-wav-encoder-worker@8.0.90:
364
+ resolution: {integrity: sha512-13X3svoPjAlOmIWtRSyMC354vZF82GXhQnI2fHwp41k7hQCS1jaQ8WlUMzcyZ2GAKErbuzWAdVuKPLedNpQUDA==}
365
+
366
+ extendable-media-recorder-wav-encoder@7.0.76:
367
+ resolution: {integrity: sha512-HLeyR9R0mUPOo7zG3d3GRWltNaSYUjyUZGQ8amRjuQVkZFXszmOIAAUVBq3fou0Z3V1mAEo+mXnCqbEfYtgZXQ==}
368
+
369
+ extendable-media-recorder@9.0.0:
370
+ resolution: {integrity: sha512-50HNf/4wv2V7H7YBXVfxYLnaXQwMVcna9UHZxFPXmgWdThetWNu+TYKwA+xOPWA+rkr8Tqvtldxc/sPC/s/wXg==}
371
+
372
+ fast-unique-numbers@8.0.12:
373
+ resolution: {integrity: sha512-Z4AJueNDnuC/sLxeQqrHP4zgqcBIeQQLbQ0hEx1a7m6Wf7ERrdAyR7CkGfoEFWm9Qla7dpLt0eWPyiO18gqj0A==}
374
+ engines: {node: '>=16.1.0'}
375
+
376
+ globalyzer@0.1.0:
377
+ resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
378
+
379
+ globrex@0.1.2:
380
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
381
+
382
+ indefinite-article@0.0.2:
383
+ resolution: {integrity: sha512-Au/2XzRkvxq2J6w5uvSSbBKPZ5kzINx5F2wb0SF8xpRL8BP9Lav81TnRbfPp6p+SYjYxwaaLn4EUwI3/MmYKSw==}
384
+
385
+ intl-messageformat@9.13.0:
386
+ resolution: {integrity: sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==}
387
+
388
+ is-promise@2.2.2:
389
+ resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==}
390
+
391
+ is-reference@3.0.2:
392
+ resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==}
393
+
394
+ locate-character@3.0.0:
395
+ resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==}
396
+
397
+ lru-queue@0.1.0:
398
+ resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==}
399
+
400
+ magic-string@0.30.5:
401
+ resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==}
402
+ engines: {node: '>=12'}
403
+
404
+ mdn-data@2.0.30:
405
+ resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
406
+
407
+ media-encoder-host-broker@7.0.94:
408
+ resolution: {integrity: sha512-M3nBVELYCSaVIQWaClYcnAC5ygCSBnfUCbxkcEhPWg+tYgvMlPwDq7unHS6UZI7uecVwyRTN31IL/wa31x0VEg==}
409
+
410
+ media-encoder-host-worker@9.1.16:
411
+ resolution: {integrity: sha512-L1rD1DXoSLxRhgN52cKwNzzqAIo1y+SXSFKzn+Fj5fFNldOCn4wl4BbuPN6u4HW4yHRzxa6mupTjVaKumiw7uw==}
412
+
413
+ media-encoder-host@8.0.104:
414
+ resolution: {integrity: sha512-DXOm4XbwCKWoCtW2B4leb9YAfC/1HxG8ysT5AOFXNPs5E9UuamDCa0zhtRNPNn2Bp3MJCiB1qo8jORhqVubJhQ==}
415
+
416
+ memoizee@0.4.15:
417
+ resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==}
418
+
419
+ mri@1.2.0:
420
+ resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
421
+ engines: {node: '>=4'}
422
+
423
+ multi-buffer-data-view@5.0.13:
424
+ resolution: {integrity: sha512-1aR8uZp6JOEq1tb1euDmCZFm0ksOe8Kub3ItBrDPBKVhlPaknUcAhanDxrSVrJiJb5c+4vsB1U6Tye8AbL9XkQ==}
425
+ engines: {node: '>=16.1.0'}
426
+
427
+ next-tick@1.1.0:
428
+ resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
429
+
430
+ node-gyp-build@4.8.0:
431
+ resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==}
432
+ hasBin: true
433
+
434
+ path-browserify@1.0.1:
435
+ resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
436
+
437
+ periscopic@3.1.0:
438
+ resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==}
439
+
440
+ recorder-audio-worklet-processor@5.0.12:
441
+ resolution: {integrity: sha512-t8PUAo8au5MaxXaofhCCGGYntYm8dJkM4uGz6IQ3VXv29eoLRPAURKUNRCG/rufdwKm21X6LyxulEsWoL+x/EQ==}
442
+
443
+ recorder-audio-worklet@6.0.17:
444
+ resolution: {integrity: sha512-SlK6XYwDonSUKUE6OBj+cwZhqzY7Pz3Eiv4dAFfuR5npOHHfj/mvSadmkhk5r6KltZ6aCgXoPNtGYDH6BchXwA==}
445
+
446
+ regenerator-runtime@0.14.1:
447
+ resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==}
448
+
449
+ resize-observer-polyfill@1.5.1:
450
+ resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==}
451
+
452
+ rxjs-interop@2.0.0:
453
+ resolution: {integrity: sha512-ASEq9atUw7lualXB+knvgtvwkCEvGWV2gDD/8qnASzBkzEARZck9JAyxmY8OS6Nc1pCPEgDTKNcx+YqqYfzArw==}
454
+
455
+ sade@1.8.1:
456
+ resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
457
+ engines: {node: '>=6'}
458
+
459
+ semiver@1.1.0:
460
+ resolution: {integrity: sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==}
461
+ engines: {node: '>=6'}
462
+
463
+ source-map-js@1.0.2:
464
+ resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
465
+ engines: {node: '>=0.10.0'}
466
+
467
+ standardized-audio-context@25.3.61:
468
+ resolution: {integrity: sha512-ew5s1DOlSfU/oHtdIbRGhtPriGd2D4ttVY0uB63Ura1bQWG+c0YVFtmy2fBPLcKH5qkIbrHHlwJTikgVsJ62dg==}
469
+
470
+ subscribable-things@2.1.28:
471
+ resolution: {integrity: sha512-uZipZJ2/EyClGZZSDsRMXBpvDvK18QCKBc42b6fT9TYNFSjwy7+GEWWkxeFY+jCpXhgfrd3CnrQ2reinhFn8yw==}
472
+
473
+ svelte-i18n@3.7.4:
474
+ resolution: {integrity: sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==}
475
+ engines: {node: '>= 16'}
476
+ hasBin: true
477
+ peerDependencies:
478
+ svelte: ^3 || ^4
479
+
480
+ svelte-range-slider-pips@2.0.1:
481
+ resolution: {integrity: sha512-sCHvcTgi0ZYE4c/mwSsdALRsfuqEmpwTsSUdL+PUrumZ8u2gv1GKwZ3GohcAcTB6gfmqRBkyn6ujRXrOIga1gw==}
482
+
483
+ svelte@4.2.8:
484
+ resolution: {integrity: sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==}
485
+ engines: {node: '>=16'}
486
+
487
+ timers-ext@0.1.7:
488
+ resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==}
489
+
490
+ tiny-glob@0.2.9:
491
+ resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
492
+
493
+ tslib@2.6.2:
494
+ resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
495
+
496
+ type@1.2.0:
497
+ resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==}
498
+
499
+ type@2.7.2:
500
+ resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==}
501
+
502
+ wavesurfer.js@7.4.2:
503
+ resolution: {integrity: sha512-4pNQ1porOCUBYBmd2F1TqVuBnB2wBPipaw2qI920zYLuPnada0Rd1CURgh8HRuPGKxijj2iyZDFN2UZwsaEuhA==}
504
+
505
+ worker-factory@7.0.16:
506
+ resolution: {integrity: sha512-AjDMwO9SwgQhKNgDdL88RidnqP5Sjs3+MH5yu/Es/IuQLlxr3Gcz/fQRqBc85sBijYcsjs2FQD07Vy2vySQUgg==}
507
+
508
+ ws@8.16.0:
509
+ resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
510
+ engines: {node: '>=10.0.0'}
511
+ peerDependencies:
512
+ bufferutil: ^4.0.1
513
+ utf-8-validate: '>=5.0.2'
514
+ peerDependenciesMeta:
515
+ bufferutil:
516
+ optional: true
517
+ utf-8-validate:
518
+ optional: true
519
+
520
+ snapshots:
521
+
522
+ '@ampproject/remapping@2.2.1':
523
+ dependencies:
524
+ '@jridgewell/gen-mapping': 0.3.3
525
+ '@jridgewell/trace-mapping': 0.3.21
526
+
527
+ '@babel/runtime@7.23.8':
528
+ dependencies:
529
+ regenerator-runtime: 0.14.1
530
+
531
+ '@esbuild/aix-ppc64@0.19.11':
532
+ optional: true
533
+
534
+ '@esbuild/android-arm64@0.19.11':
535
+ optional: true
536
+
537
+ '@esbuild/android-arm@0.19.11':
538
+ optional: true
539
+
540
+ '@esbuild/android-x64@0.19.11':
541
+ optional: true
542
+
543
+ '@esbuild/darwin-arm64@0.19.11':
544
+ optional: true
545
+
546
+ '@esbuild/darwin-x64@0.19.11':
547
+ optional: true
548
+
549
+ '@esbuild/freebsd-arm64@0.19.11':
550
+ optional: true
551
+
552
+ '@esbuild/freebsd-x64@0.19.11':
553
+ optional: true
554
+
555
+ '@esbuild/linux-arm64@0.19.11':
556
+ optional: true
557
+
558
+ '@esbuild/linux-arm@0.19.11':
559
+ optional: true
560
+
561
+ '@esbuild/linux-ia32@0.19.11':
562
+ optional: true
563
+
564
+ '@esbuild/linux-loong64@0.19.11':
565
+ optional: true
566
+
567
+ '@esbuild/linux-mips64el@0.19.11':
568
+ optional: true
569
+
570
+ '@esbuild/linux-ppc64@0.19.11':
571
+ optional: true
572
+
573
+ '@esbuild/linux-riscv64@0.19.11':
574
+ optional: true
575
+
576
+ '@esbuild/linux-s390x@0.19.11':
577
+ optional: true
578
+
579
+ '@esbuild/linux-x64@0.19.11':
580
+ optional: true
581
+
582
+ '@esbuild/netbsd-x64@0.19.11':
583
+ optional: true
584
+
585
+ '@esbuild/openbsd-x64@0.19.11':
586
+ optional: true
587
+
588
+ '@esbuild/sunos-x64@0.19.11':
589
+ optional: true
590
+
591
+ '@esbuild/win32-arm64@0.19.11':
592
+ optional: true
593
+
594
+ '@esbuild/win32-ia32@0.19.11':
595
+ optional: true
596
+
597
+ '@esbuild/win32-x64@0.19.11':
598
+ optional: true
599
+
600
+ '@formatjs/ecma402-abstract@1.11.4':
601
  dependencies:
602
  '@formatjs/intl-localematcher': 0.2.25
603
  tslib: 2.6.2
 
604
 
605
+ '@formatjs/fast-memoize@1.2.1':
 
606
  dependencies:
607
  tslib: 2.6.2
 
608
 
609
+ '@formatjs/icu-messageformat-parser@2.1.0':
 
610
  dependencies:
611
  '@formatjs/ecma402-abstract': 1.11.4
612
  '@formatjs/icu-skeleton-parser': 1.3.6
613
  tslib: 2.6.2
 
614
 
615
+ '@formatjs/icu-skeleton-parser@1.3.6':
 
616
  dependencies:
617
  '@formatjs/ecma402-abstract': 1.11.4
618
  tslib: 2.6.2
 
619
 
620
+ '@formatjs/intl-localematcher@0.2.25':
 
621
  dependencies:
622
  tslib: 2.6.2
 
623
 
624
+ '@gradio/atoms@0.2.1(svelte@4.2.8)':
 
625
  dependencies:
626
  '@gradio/icons': 0.2.0
627
  '@gradio/utils': 0.2.0(svelte@4.2.8)
628
  transitivePeerDependencies:
629
  - svelte
 
630
 
631
+ '@gradio/button@0.2.3(svelte@4.2.8)':
 
632
  dependencies:
633
  '@gradio/client': 0.7.2
634
  '@gradio/upload': 0.3.3(svelte@4.2.8)
 
636
  transitivePeerDependencies:
637
  - svelte
638
  - utf-8-validate
 
639
 
640
+ '@gradio/client@0.7.2':
 
 
641
  dependencies:
642
  bufferutil: 4.0.8
643
  semiver: 1.1.0
644
  ws: 8.16.0(bufferutil@4.0.8)
645
  transitivePeerDependencies:
646
  - utf-8-validate
 
647
 
648
+ '@gradio/column@0.1.0': {}
 
 
649
 
650
+ '@gradio/icons@0.2.0': {}
 
 
651
 
652
+ '@gradio/statustracker@0.3.1(svelte@4.2.8)':
 
653
  dependencies:
654
  '@gradio/atoms': 0.2.1(svelte@4.2.8)
655
  '@gradio/column': 0.1.0
 
657
  '@gradio/utils': 0.2.0(svelte@4.2.8)
658
  transitivePeerDependencies:
659
  - svelte
 
660
 
661
+ '@gradio/theme@0.2.0': {}
 
 
662
 
663
+ '@gradio/upload@0.3.3(svelte@4.2.8)':
 
664
  dependencies:
665
  '@gradio/atoms': 0.2.1(svelte@4.2.8)
666
  '@gradio/client': 0.7.2
 
669
  transitivePeerDependencies:
670
  - svelte
671
  - utf-8-validate
 
672
 
673
+ '@gradio/utils@0.2.0(svelte@4.2.8)':
 
674
  dependencies:
675
  '@gradio/theme': 0.2.0
676
  svelte-i18n: 3.7.4(svelte@4.2.8)
677
  transitivePeerDependencies:
678
  - svelte
 
679
 
680
+ '@gradio/wasm@0.2.0':
 
681
  dependencies:
682
  '@types/path-browserify': 1.0.2
683
  path-browserify: 1.0.1
 
684
 
685
+ '@jridgewell/gen-mapping@0.3.3':
 
 
686
  dependencies:
687
  '@jridgewell/set-array': 1.1.2
688
  '@jridgewell/sourcemap-codec': 1.4.15
689
  '@jridgewell/trace-mapping': 0.3.21
 
690
 
691
+ '@jridgewell/resolve-uri@3.1.1': {}
 
 
 
692
 
693
+ '@jridgewell/set-array@1.1.2': {}
 
 
 
694
 
695
+ '@jridgewell/sourcemap-codec@1.4.15': {}
 
 
696
 
697
+ '@jridgewell/trace-mapping@0.3.21':
 
698
  dependencies:
699
  '@jridgewell/resolve-uri': 3.1.1
700
  '@jridgewell/sourcemap-codec': 1.4.15
 
701
 
702
+ '@types/debounce@1.2.4': {}
 
 
703
 
704
+ '@types/estree@1.0.5': {}
 
 
705
 
706
+ '@types/path-browserify@1.0.2': {}
 
 
707
 
708
+ '@types/wavesurfer.js@6.0.10':
 
709
  dependencies:
710
  '@types/debounce': 1.2.4
 
711
 
712
+ acorn@8.11.3: {}
 
 
 
 
713
 
714
+ aria-query@5.3.0:
 
715
  dependencies:
716
  dequal: 2.0.3
 
717
 
718
+ automation-events@6.0.13:
 
 
719
  dependencies:
720
  '@babel/runtime': 7.23.8
721
  tslib: 2.6.2
 
722
 
723
+ axobject-query@3.2.1:
 
724
  dependencies:
725
  dequal: 2.0.3
 
726
 
727
+ broker-factory@3.0.89:
 
728
  dependencies:
729
  '@babel/runtime': 7.23.8
730
  fast-unique-numbers: 8.0.12
731
  tslib: 2.6.2
732
  worker-factory: 7.0.16
 
733
 
734
+ bufferutil@4.0.8:
 
 
 
735
  dependencies:
736
  node-gyp-build: 4.8.0
 
737
 
738
+ cli-color@2.0.3:
 
 
739
  dependencies:
740
  d: 1.0.1
741
  es5-ext: 0.10.62
742
  es6-iterator: 2.0.3
743
  memoizee: 0.4.15
744
  timers-ext: 0.1.7
 
745
 
746
+ code-red@1.0.4:
 
747
  dependencies:
748
  '@jridgewell/sourcemap-codec': 1.4.15
749
  '@types/estree': 1.0.5
750
  acorn: 8.11.3
751
  estree-walker: 3.0.3
752
  periscopic: 3.1.0
 
753
 
754
+ compilerr@11.0.13:
 
 
755
  dependencies:
756
  '@babel/runtime': 7.23.8
757
  dashify: 2.0.0
758
  indefinite-article: 0.0.2
759
  tslib: 2.6.2
 
760
 
761
+ css-tree@2.3.1:
 
 
762
  dependencies:
763
  mdn-data: 2.0.30
764
  source-map-js: 1.0.2
 
765
 
766
+ d@1.0.1:
 
767
  dependencies:
768
  es5-ext: 0.10.62
769
  type: 1.2.0
 
770
 
771
+ dashify@2.0.0: {}
 
 
 
772
 
773
+ deepmerge@4.3.1: {}
 
 
 
774
 
775
+ dequal@2.0.3: {}
 
 
 
776
 
777
+ es5-ext@0.10.62:
 
 
 
778
  dependencies:
779
  es6-iterator: 2.0.3
780
  es6-symbol: 3.1.3
781
  next-tick: 1.1.0
 
782
 
783
+ es6-iterator@2.0.3:
 
784
  dependencies:
785
  d: 1.0.1
786
  es5-ext: 0.10.62
787
  es6-symbol: 3.1.3
 
788
 
789
+ es6-symbol@3.1.3:
 
790
  dependencies:
791
  d: 1.0.1
792
  ext: 1.7.0
 
793
 
794
+ es6-weak-map@2.0.3:
 
795
  dependencies:
796
  d: 1.0.1
797
  es5-ext: 0.10.62
798
  es6-iterator: 2.0.3
799
  es6-symbol: 3.1.3
 
800
 
801
+ esbuild@0.19.11:
 
 
 
 
802
  optionalDependencies:
803
  '@esbuild/aix-ppc64': 0.19.11
804
  '@esbuild/android-arm': 0.19.11
 
823
  '@esbuild/win32-arm64': 0.19.11
824
  '@esbuild/win32-ia32': 0.19.11
825
  '@esbuild/win32-x64': 0.19.11
 
826
 
827
+ estree-walker@2.0.2: {}
 
 
828
 
829
+ estree-walker@3.0.3:
 
830
  dependencies:
831
  '@types/estree': 1.0.5
 
832
 
833
+ event-emitter@0.3.5:
 
834
  dependencies:
835
  d: 1.0.1
836
  es5-ext: 0.10.62
 
837
 
838
+ ext@1.7.0:
 
839
  dependencies:
840
  type: 2.7.2
 
841
 
842
+ extendable-media-recorder-wav-encoder-broker@7.0.93:
 
843
  dependencies:
844
  '@babel/runtime': 7.23.8
845
  broker-factory: 3.0.89
846
  extendable-media-recorder-wav-encoder-worker: 8.0.90
847
  tslib: 2.6.2
 
848
 
849
+ extendable-media-recorder-wav-encoder-worker@8.0.90:
 
850
  dependencies:
851
  '@babel/runtime': 7.23.8
852
  tslib: 2.6.2
853
  worker-factory: 7.0.16
 
854
 
855
+ extendable-media-recorder-wav-encoder@7.0.76:
 
856
  dependencies:
857
  '@babel/runtime': 7.23.8
858
  extendable-media-recorder-wav-encoder-broker: 7.0.93
859
  extendable-media-recorder-wav-encoder-worker: 8.0.90
860
  tslib: 2.6.2
 
861
 
862
+ extendable-media-recorder@9.0.0:
 
863
  dependencies:
864
  '@babel/runtime': 7.23.8
865
  media-encoder-host: 8.0.104
 
868
  standardized-audio-context: 25.3.61
869
  subscribable-things: 2.1.28
870
  tslib: 2.6.2
 
871
 
872
+ fast-unique-numbers@8.0.12:
 
 
873
  dependencies:
874
  '@babel/runtime': 7.23.8
875
  tslib: 2.6.2
 
876
 
877
+ globalyzer@0.1.0: {}
 
 
878
 
879
+ globrex@0.1.2: {}
 
 
880
 
881
+ indefinite-article@0.0.2: {}
 
 
882
 
883
+ intl-messageformat@9.13.0:
 
884
  dependencies:
885
  '@formatjs/ecma402-abstract': 1.11.4
886
  '@formatjs/fast-memoize': 1.2.1
887
  '@formatjs/icu-messageformat-parser': 2.1.0
888
  tslib: 2.6.2
 
889
 
890
+ is-promise@2.2.2: {}
 
 
891
 
892
+ is-reference@3.0.2:
 
893
  dependencies:
894
  '@types/estree': 1.0.5
 
895
 
896
+ locate-character@3.0.0: {}
 
 
897
 
898
+ lru-queue@0.1.0:
 
899
  dependencies:
900
  es5-ext: 0.10.62
 
901
 
902
+ magic-string@0.30.5:
 
 
903
  dependencies:
904
  '@jridgewell/sourcemap-codec': 1.4.15
 
905
 
906
+ mdn-data@2.0.30: {}
 
 
907
 
908
+ media-encoder-host-broker@7.0.94:
 
909
  dependencies:
910
  '@babel/runtime': 7.23.8
911
  broker-factory: 3.0.89
912
  fast-unique-numbers: 8.0.12
913
  media-encoder-host-worker: 9.1.16
914
  tslib: 2.6.2
 
915
 
916
+ media-encoder-host-worker@9.1.16:
 
917
  dependencies:
918
  '@babel/runtime': 7.23.8
919
  extendable-media-recorder-wav-encoder-broker: 7.0.93
920
  tslib: 2.6.2
921
  worker-factory: 7.0.16
 
922
 
923
+ media-encoder-host@8.0.104:
 
924
  dependencies:
925
  '@babel/runtime': 7.23.8
926
  media-encoder-host-broker: 7.0.94
927
  media-encoder-host-worker: 9.1.16
928
  tslib: 2.6.2
 
929
 
930
+ memoizee@0.4.15:
 
931
  dependencies:
932
  d: 1.0.1
933
  es5-ext: 0.10.62
 
937
  lru-queue: 0.1.0
938
  next-tick: 1.1.0
939
  timers-ext: 0.1.7
 
940
 
941
+ mri@1.2.0: {}
 
 
 
942
 
943
+ multi-buffer-data-view@5.0.13:
 
 
944
  dependencies:
945
  '@babel/runtime': 7.23.8
946
  tslib: 2.6.2
 
947
 
948
+ next-tick@1.1.0: {}
 
 
949
 
950
+ node-gyp-build@4.8.0: {}
 
 
 
951
 
952
+ path-browserify@1.0.1: {}
 
 
953
 
954
+ periscopic@3.1.0:
 
955
  dependencies:
956
  '@types/estree': 1.0.5
957
  estree-walker: 3.0.3
958
  is-reference: 3.0.2
 
959
 
960
+ recorder-audio-worklet-processor@5.0.12:
 
961
  dependencies:
962
  '@babel/runtime': 7.23.8
963
  tslib: 2.6.2
 
964
 
965
+ recorder-audio-worklet@6.0.17:
 
966
  dependencies:
967
  '@babel/runtime': 7.23.8
968
  broker-factory: 3.0.89
 
972
  subscribable-things: 2.1.28
973
  tslib: 2.6.2
974
  worker-factory: 7.0.16
 
975
 
976
+ regenerator-runtime@0.14.1: {}
 
 
977
 
978
+ resize-observer-polyfill@1.5.1: {}
 
 
979
 
980
+ rxjs-interop@2.0.0: {}
 
 
981
 
982
+ sade@1.8.1:
 
 
983
  dependencies:
984
  mri: 1.2.0
 
985
 
986
+ semiver@1.1.0: {}
 
 
 
987
 
988
+ source-map-js@1.0.2: {}
 
 
 
989
 
990
+ standardized-audio-context@25.3.61:
 
991
  dependencies:
992
  '@babel/runtime': 7.23.8
993
  automation-events: 6.0.13
994
  tslib: 2.6.2
 
995
 
996
+ subscribable-things@2.1.28:
 
997
  dependencies:
998
  '@babel/runtime': 7.23.8
999
  rxjs-interop: 2.0.0
1000
  tslib: 2.6.2
 
1001
 
1002
+ svelte-i18n@3.7.4(svelte@4.2.8):
 
 
 
 
 
1003
  dependencies:
1004
  cli-color: 2.0.3
1005
  deepmerge: 4.3.1
 
1009
  sade: 1.8.1
1010
  svelte: 4.2.8
1011
  tiny-glob: 0.2.9
 
1012
 
1013
+ svelte-range-slider-pips@2.0.1: {}
 
 
1014
 
1015
+ svelte@4.2.8:
 
 
1016
  dependencies:
1017
  '@ampproject/remapping': 2.2.1
1018
  '@jridgewell/sourcemap-codec': 1.4.15
 
1027
  locate-character: 3.0.0
1028
  magic-string: 0.30.5
1029
  periscopic: 3.1.0
 
1030
 
1031
+ timers-ext@0.1.7:
 
1032
  dependencies:
1033
  es5-ext: 0.10.62
1034
  next-tick: 1.1.0
 
1035
 
1036
+ tiny-glob@0.2.9:
 
1037
  dependencies:
1038
  globalyzer: 0.1.0
1039
  globrex: 0.1.2
 
1040
 
1041
+ tslib@2.6.2: {}
 
 
1042
 
1043
+ type@1.2.0: {}
 
 
1044
 
1045
+ type@2.7.2: {}
 
 
1046
 
1047
+ wavesurfer.js@7.4.2: {}
 
 
1048
 
1049
+ worker-factory@7.0.16:
 
1050
  dependencies:
1051
  '@babel/runtime': 7.23.8
1052
  compilerr: 11.0.13
1053
  fast-unique-numbers: 8.0.12
1054
  tslib: 2.6.2
 
1055
 
1056
+ ws@8.16.0(bufferutil@4.0.8):
1057
+ optionalDependencies:
 
 
 
 
 
 
 
 
 
 
1058
  bufferutil: 4.0.8
 
src/frontend/shared/WaveformRecordControls.svelte CHANGED
@@ -91,8 +91,7 @@
91
  display: flex;
92
  align-items: center;
93
  justify-content: center;
94
- background: white;
95
- border: 6px solid rgb(0, 140, 255);
96
  }
97
 
98
  .stop-button {
@@ -102,10 +101,12 @@
102
  display: flex;
103
  align-items: center;
104
  justify-content: center;
105
- background: white;
106
- border: 6px solid red;
107
  }
108
 
 
 
 
109
 
110
  @keyframes pulsate {
111
  0% {
@@ -130,15 +131,15 @@
130
 
131
  @keyframes scaling {
132
  0% {
133
- background-color: var(--primary-600);
134
  scale: 1;
135
  }
136
  50% {
137
- background-color: var(--primary-600);
138
  scale: 1.2;
139
  }
140
  100% {
141
- background-color: var(--primary-600);
142
  scale: 1;
143
  }
144
  }
 
91
  display: flex;
92
  align-items: center;
93
  justify-content: center;
94
+ background: var(--button-secondary-background-fill);
 
95
  }
96
 
97
  .stop-button {
 
101
  display: flex;
102
  align-items: center;
103
  justify-content: center;
104
+ background: var(--button-secondary-background-fill);
 
105
  }
106
 
107
+ .record-button:hover {
108
+ transform: scale(0.95);
109
+ }
110
 
111
  @keyframes pulsate {
112
  0% {
 
131
 
132
  @keyframes scaling {
133
  0% {
134
+ background-color: var(--button-secondary-background-fill);
135
  scale: 1;
136
  }
137
  50% {
138
+ background-color: var(--button-secondary-background-fill);
139
  scale: 1.2;
140
  }
141
  100% {
142
+ background-color: var(--button-secondary-background-fill);
143
  scale: 1;
144
  }
145
  }
src/frontend/static/StaticAudio.svelte CHANGED
@@ -55,6 +55,7 @@
55
  function handle_audio_end(): void {
56
  dispatch("end");
57
  }
 
58
  </script>
59
 
60
  {#if value !== null}
@@ -80,17 +81,17 @@
80
 
81
  {#if !isPlaying}
82
  <!-- Play button -->
83
- <svg class="play-icon" viewBox="0 0 24 24" style="pointer-events: none;">
84
- <polygon points="5,3 19,12 5,21" fill="#fff" />
85
  </svg>
86
  {:else}
87
  <!-- Pause button -->
88
- <svg class="pause-icon" viewBox="0 0 24 24" style="pointer-events: none;">
89
- <rect x="6" y="4" width="4" height="16" fill="#fff" />
90
- <rect x="14" y="4" width="4" height="16" fill="#fff" />
91
  </svg>
92
  {/if}
93
- <div class="circle-container waveform-image" style="pointer-events: none;">
94
  {#each Array(15) as _, i (i)}
95
  <div class={`waveform-bar ${isPlaying ? `waveform-animation-${i % 5}` : ''}`} style={`height: ${20 + (i % 5) * 10}%`}></div>
96
  {/each}
@@ -104,13 +105,13 @@
104
  {#if !isPlaying}
105
  <!-- Play button -->
106
  <svg class="play-icon" viewBox="0 0 24 24" style="pointer-events: none;">
107
- <polygon points="5,3 19,12 5,21" fill="#fff" />
108
  </svg>
109
  {:else}
110
  <!-- Pause button -->
111
  <svg class="pause-icon" viewBox="0 0 24 24" style="pointer-events: none;">
112
- <rect x="6" y="4" width="4" height="16" fill="#fff" />
113
- <rect x="14" y="4" width="4" height="16" fill="#fff" />
114
  </svg>
115
  {/if}
116
  </div>
@@ -145,6 +146,8 @@
145
  }
146
 
147
  .play-icon, .pause-icon {
 
 
148
  position: absolute;
149
  top: 50%;
150
  left: 50%;
@@ -153,6 +156,10 @@
153
  transform: translate(-50%, -50%);
154
  }
155
 
 
 
 
 
156
  .pause-icon {
157
  opacity: 0;
158
  transition: opacity 0.3s;
@@ -172,7 +179,7 @@
172
  height: 350px;
173
  margin: auto;
174
  border-radius: 50%;
175
- border: 3px solid white;
176
  position: relative;
177
  overflow: hidden;
178
  display: flex;
@@ -185,15 +192,15 @@
185
  }
186
 
187
  .waveform-bar {
188
- background-color: white;
189
- width: 2%;
190
- height: 20%;
191
- margin: 0 1%;
192
- border-radius: 5px;
193
- opacity: 0.5;
194
- transform-origin: bottom;
195
  }
196
-
197
  .waveform-animation-0 {
198
  animation: waveAnimation0 1s infinite ease-in-out;
199
  opacity: 1;
 
55
  function handle_audio_end(): void {
56
  dispatch("end");
57
  }
58
+
59
  </script>
60
 
61
  {#if value !== null}
 
81
 
82
  {#if !isPlaying}
83
  <!-- Play button -->
84
+ <svg class="play-icon" viewBox="0 0 24 24">
85
+ <polygon points="5,3 19,12 5,21" fill="currentColor" />
86
  </svg>
87
  {:else}
88
  <!-- Pause button -->
89
+ <svg class="pause-icon" viewBox="0 0 24 24">
90
+ <rect x="6" y="4" width="4" height="16" fill="currentColor" />
91
+ <rect x="14" y="4" width="4" height="16" fill="currentColor" />
92
  </svg>
93
  {/if}
94
+ <div class="circle-container waveform-image">
95
  {#each Array(15) as _, i (i)}
96
  <div class={`waveform-bar ${isPlaying ? `waveform-animation-${i % 5}` : ''}`} style={`height: ${20 + (i % 5) * 10}%`}></div>
97
  {/each}
 
105
  {#if !isPlaying}
106
  <!-- Play button -->
107
  <svg class="play-icon" viewBox="0 0 24 24" style="pointer-events: none;">
108
+ <polygon points="5,3 19,12 5,21" fill="currentColor" />
109
  </svg>
110
  {:else}
111
  <!-- Pause button -->
112
  <svg class="pause-icon" viewBox="0 0 24 24" style="pointer-events: none;">
113
+ <rect x="6" y="4" width="4" height="16" fill="currentColor" />
114
+ <rect x="14" y="4" width="4" height="16" fill="currentColor" />
115
  </svg>
116
  {/if}
117
  </div>
 
146
  }
147
 
148
  .play-icon, .pause-icon {
149
+ color: white;
150
+ pointer-events: none;
151
  position: absolute;
152
  top: 50%;
153
  left: 50%;
 
156
  transform: translate(-50%, -50%);
157
  }
158
 
159
+ .circle-container:hover .play-icon {
160
+ width: 90px;
161
+ height: 90px;
162
+ }
163
  .pause-icon {
164
  opacity: 0;
165
  transition: opacity 0.3s;
 
179
  height: 350px;
180
  margin: auto;
181
  border-radius: 50%;
182
+ background: var(--button-secondary-background-fill);
183
  position: relative;
184
  overflow: hidden;
185
  display: flex;
 
192
  }
193
 
194
  .waveform-bar {
195
+ background: black;
196
+ width: 2%;
197
+ height: 20%;
198
+ margin: 0 1%;
199
+ border-radius: 5px;
200
+ opacity: 0.5;
201
+ transform-origin: bottom;
202
  }
203
+
204
  .waveform-animation-0 {
205
  animation: waveAnimation0 1s infinite ease-in-out;
206
  opacity: 1;
src/frontend/streaming/StreamAudio.svelte CHANGED
@@ -8,7 +8,6 @@
8
  export let paused_recording = false;
9
  export let stop: () => void;
10
  export let record: () => void;
11
- export let i18n: I18nFormatter;
12
  export let waveform_settings = {};
13
 
14
  let micWaveform: WaveSurfer;
@@ -31,21 +30,24 @@
31
  };
32
  </script>
33
 
34
- <div class="mic-wrap">
35
  <div id="microphone" style:display={recording ? "block" : "none"} />
36
  {#if recording}
37
  <button
38
- class={paused_recording ? "stop-button-paused" : "stop-button"}
39
  on:click={() => {
40
  waveformRecord.stopMic();
41
  stop();
42
  }}
43
  >
44
- <span class="record-icon">
45
- <span class="pinger" />
46
- <span class="dot" />
47
- </span>
48
- {paused_recording ? i18n("audio.pause") : i18n("audio.stop")}
 
 
 
49
  </button>
50
  {:else}
51
  <button
@@ -55,78 +57,98 @@
55
  record();
56
  }}
57
  >
58
- <span class="record-icon">
59
- <span class="dot" />
60
- </span>
61
- {i18n("audio.record")}
 
 
 
 
62
  </button>
63
  {/if}
64
  </div>
65
 
66
  <style>
67
- .mic-wrap {
68
- display: block;
 
 
69
  align-items: center;
70
- margin: var(--spacing-xl);
71
  }
72
 
73
- .stop-button-paused {
74
- display: none;
75
- height: var(--size-8);
76
- width: var(--size-20);
77
- background-color: var(--block-background-fill);
78
- border-radius: var(--radius-3xl);
79
  align-items: center;
80
- border: 1px solid var(--neutral-400);
81
- margin-right: 5px;
82
  }
83
 
84
- .stop-button-paused::before {
85
- content: "";
86
- height: var(--size-4);
87
- width: var(--size-4);
88
- border-radius: var(--radius-full);
89
- background: var(--primary-600);
90
- margin: 0 var(--spacing-xl);
91
  }
92
 
93
- .stop-button::before {
94
- content: "";
95
- height: var(--size-4);
96
- width: var(--size-4);
97
- border-radius: var(--radius-full);
98
- background: var(--primary-600);
99
- margin: 0 var(--spacing-xl);
100
- animation: scaling 1800ms infinite;
101
  }
102
 
103
  .stop-button {
104
- height: var(--size-8);
105
- width: var(--size-20);
106
- background-color: var(--block-background-fill);
107
- border-radius: var(--radius-3xl);
108
- align-items: center;
109
- border: 1px solid var(--primary-600);
110
- margin-right: 5px;
111
  display: flex;
 
 
 
112
  }
113
 
114
- .record-button::before {
115
- content: "";
116
- height: var(--size-4);
117
- width: var(--size-4);
118
- border-radius: var(--radius-full);
119
- background: var(--primary-600);
120
- margin: 0 var(--spacing-xl);
121
  }
122
 
123
- .record-button {
124
- height: var(--size-8);
125
- width: var(--size-24);
126
- background-color: var(--block-background-fill);
127
- border-radius: var(--radius-3xl);
128
- display: flex;
129
- align-items: center;
130
- border: 1px solid var(--neutral-400);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
  </style>
 
8
  export let paused_recording = false;
9
  export let stop: () => void;
10
  export let record: () => void;
 
11
  export let waveform_settings = {};
12
 
13
  let micWaveform: WaveSurfer;
 
30
  };
31
  </script>
32
 
33
+ <div class="wrapper">
34
  <div id="microphone" style:display={recording ? "block" : "none"} />
35
  {#if recording}
36
  <button
37
+ class="stop-button pulsate"
38
  on:click={() => {
39
  waveformRecord.stopMic();
40
  stop();
41
  }}
42
  >
43
+ <div class="stop-icon">
44
+ <img
45
+ width="200"
46
+ height="200"
47
+ src="https://img.icons8.com/material-rounded/200/stop.png"
48
+ alt="stop"
49
+ />
50
+ </div>
51
  </button>
52
  {:else}
53
  <button
 
57
  record();
58
  }}
59
  >
60
+ <div class="microphone-icon">
61
+ <img
62
+ width="200"
63
+ height="200"
64
+ src="https://img.icons8.com/material-rounded/200/microphone.png"
65
+ alt="microphone"
66
+ />
67
+ </div>
68
  </button>
69
  {/if}
70
  </div>
71
 
72
  <style>
73
+ .wrapper {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
  align-items: center;
78
+ border-radius: 50px;
79
  }
80
 
81
+ .microphone-icon {
82
+ display: flex;
 
 
 
 
83
  align-items: center;
84
+ justify-content: center;
85
+ height: 100%;
86
  }
87
 
88
+ .stop-icon {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ height: 100%;
 
 
93
  }
94
 
95
+ .record-button {
96
+ height: 350px;
97
+ width: 350px;
98
+ border-radius: 50%;
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ background: var(--button-secondary-background-fill);
103
  }
104
 
105
  .stop-button {
106
+ height: 350px;
107
+ width: 350px;
108
+ border-radius: 50%;
 
 
 
 
109
  display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ background: var(--button-secondary-background-fill);
113
  }
114
 
115
+ .record-button:hover {
116
+ transform: scale(0.95);
 
 
 
 
 
117
  }
118
 
119
+ @keyframes pulsate {
120
+ 0% {
121
+ transform: scale(1);
122
+ }
123
+ 50% {
124
+ transform: scale(1.1);
125
+ }
126
+ 100% {
127
+ transform: scale(1);
128
+ }
129
+ }
130
+
131
+ .pulsate {
132
+ animation: pulsate 1s infinite;
133
+ }
134
+
135
+ .record-button:disabled {
136
+ cursor: not-allowed;
137
+ opacity: 0.5;
138
+ }
139
+
140
+ @keyframes scaling {
141
+ 0% {
142
+ background-color: var(--button-secondary-background-fill);
143
+ scale: 1;
144
+ }
145
+ 50% {
146
+ background-color: var(--button-secondary-background-fill);
147
+ scale: 1.2;
148
+ }
149
+ 100% {
150
+ background-color: var(--button-secondary-background-fill);
151
+ scale: 1;
152
+ }
153
  }
154
  </style>
src/response.wav ADDED
Binary file (178 kB). View file