Spaces:
Runtime error
Runtime error
init commit
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- .gitignore +56 -0
- app.py +134 -0
- gradio-modified/templates/frontend/assets/BlockLabel.37da86a3.js +2 -0
- gradio-modified/templates/frontend/assets/CarouselItem.svelte_svelte_type_style_lang.cc0aed40.js +2 -0
- gradio-modified/templates/frontend/assets/CarouselItem.svelte_svelte_type_style_lang.e110d966.css +1 -0
- gradio-modified/templates/frontend/assets/Column.06c172ac.js +2 -0
- gradio-modified/templates/frontend/assets/File.60a988f4.js +2 -0
- gradio-modified/templates/frontend/assets/Image.4a41f1aa.js +2 -0
- gradio-modified/templates/frontend/assets/Image.95fa511c.js +2 -0
- gradio-modified/templates/frontend/assets/Model3D.b44fd6f2.js +2 -0
- gradio-modified/templates/frontend/assets/ModifyUpload.2cfe71e4.js +2 -0
- gradio-modified/templates/frontend/assets/Tabs.6b500f1a.js +2 -0
- gradio-modified/templates/frontend/assets/Tabs.6b500f1a.js.map +1 -0
- gradio-modified/templates/frontend/assets/Upload.5d0148e8.js +2 -0
- gradio-modified/templates/frontend/assets/Webcam.8816836e.js +11 -0
- gradio-modified/templates/frontend/assets/_commonjsHelpers.88e99c8f.js +2 -0
- gradio-modified/templates/frontend/assets/color.509e5f03.js +2 -0
- gradio-modified/templates/frontend/assets/csv.27f5436c.js +2 -0
- gradio-modified/templates/frontend/assets/dsv.7fe76a93.js +6 -0
- gradio-modified/templates/frontend/assets/index.020a69e0.js +2 -0
- gradio-modified/templates/frontend/assets/index.03f37f65.js +0 -0
- gradio-modified/templates/frontend/assets/index.04164205.js +2 -0
- gradio-modified/templates/frontend/assets/index.044a1523.js +4 -0
- gradio-modified/templates/frontend/assets/index.10851bbc.css +1 -0
- gradio-modified/templates/frontend/assets/index.164edf37.js +4 -0
- gradio-modified/templates/frontend/assets/index.1a9e15aa.css +0 -0
- gradio-modified/templates/frontend/assets/index.1d32cfe5.js +2 -0
- gradio-modified/templates/frontend/assets/index.1eb90786.js +2 -0
- gradio-modified/templates/frontend/assets/index.2035cf67.js +2 -0
- gradio-modified/templates/frontend/assets/index.3517cbba.css +1 -0
- gradio-modified/templates/frontend/assets/index.396f4a72.js +0 -0
- gradio-modified/templates/frontend/assets/index.39f99b3e.js +2 -0
- gradio-modified/templates/frontend/assets/index.459183ec.js +2 -0
- gradio-modified/templates/frontend/assets/index.4762eb88.js +2 -0
- gradio-modified/templates/frontend/assets/index.4f1294f6.js +2 -0
- gradio-modified/templates/frontend/assets/index.50b5507a.js +2 -0
- gradio-modified/templates/frontend/assets/index.52ad5956.js +2 -0
- gradio-modified/templates/frontend/assets/index.52c17744.js +2 -0
- gradio-modified/templates/frontend/assets/index.536d0e14.js +2 -0
- gradio-modified/templates/frontend/assets/index.5cfaf6ac.js +2 -0
- gradio-modified/templates/frontend/assets/index.5d3ef6e5.js +2 -0
- gradio-modified/templates/frontend/assets/index.64cd2c53.css +1 -0
- gradio-modified/templates/frontend/assets/index.64f1ca39.js +5 -0
- gradio-modified/templates/frontend/assets/index.67e8cf09.js +2 -0
- gradio-modified/templates/frontend/assets/index.6b09b320.js +2 -0
- gradio-modified/templates/frontend/assets/index.712d6db6.css +1 -0
- gradio-modified/templates/frontend/assets/index.72f44ebf.css +1 -0
- gradio-modified/templates/frontend/assets/index.75c2aff1.js +2 -0
- gradio-modified/templates/frontend/assets/index.7a93f874.css +1 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*js.map filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Python build
|
2 |
+
.eggs/
|
3 |
+
gradio.egg-info
|
4 |
+
dist/
|
5 |
+
*.pyc
|
6 |
+
__pycache__/
|
7 |
+
*.py[cod]
|
8 |
+
*$py.class
|
9 |
+
build/
|
10 |
+
|
11 |
+
# JS build
|
12 |
+
gradio/templates/cdn
|
13 |
+
gradio/templates/frontend
|
14 |
+
|
15 |
+
# Secrets
|
16 |
+
.env
|
17 |
+
|
18 |
+
# Gradio run artifacts
|
19 |
+
*.db
|
20 |
+
*.sqlite3
|
21 |
+
gradio/launches.json
|
22 |
+
flagged/
|
23 |
+
gradio_cached_examples/
|
24 |
+
|
25 |
+
# Tests
|
26 |
+
.coverage
|
27 |
+
coverage.xml
|
28 |
+
test.txt
|
29 |
+
**/snapshots/**/*.png
|
30 |
+
|
31 |
+
# Demos
|
32 |
+
demo/tmp.zip
|
33 |
+
demo/files/*.avi
|
34 |
+
demo/files/*.mp4
|
35 |
+
demo/all_demos/demos/*
|
36 |
+
demo/all_demos/requirements.txt
|
37 |
+
demo/*/config.json
|
38 |
+
|
39 |
+
# Etc
|
40 |
+
.idea/*
|
41 |
+
.DS_Store
|
42 |
+
*.bak
|
43 |
+
workspace.code-workspace
|
44 |
+
*.h5
|
45 |
+
|
46 |
+
# log files
|
47 |
+
.pnpm-debug.log
|
48 |
+
|
49 |
+
# Local virtualenv for devs
|
50 |
+
.venv*
|
51 |
+
|
52 |
+
# FRP
|
53 |
+
gradio/frpc_*
|
54 |
+
|
55 |
+
flagged/*
|
56 |
+
*.js.map
|
app.py
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
from typing import Dict
|
3 |
+
sys.path.insert(0, 'gradio-modified')
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
import numpy as np
|
7 |
+
|
8 |
+
from PIL import Image
|
9 |
+
|
10 |
+
import torch
|
11 |
+
|
12 |
+
if torch.cuda.is_available():
|
13 |
+
t = torch.cuda.get_device_properties(0).total_memory
|
14 |
+
r = torch.cuda.memory_reserved(0)
|
15 |
+
a = torch.cuda.memory_allocated(0)
|
16 |
+
f = t-a # free inside reserved
|
17 |
+
if f < 2**32:
|
18 |
+
device = 'cpu'
|
19 |
+
else:
|
20 |
+
device = 'cuda'
|
21 |
+
else:
|
22 |
+
device = 'cpu'
|
23 |
+
|
24 |
+
print('Use device:', device)
|
25 |
+
|
26 |
+
|
27 |
+
net = torch.jit.load(f'weights/pkp-v1.{device}.jit.pt')
|
28 |
+
|
29 |
+
|
30 |
+
def resize_original(img: Image.Image):
|
31 |
+
if img is None:
|
32 |
+
return img
|
33 |
+
if isinstance(img, dict):
|
34 |
+
img = img["image"]
|
35 |
+
|
36 |
+
guide_img = img.convert('L')
|
37 |
+
w, h = guide_img.size
|
38 |
+
scale = 256 / min(guide_img.size)
|
39 |
+
guide_img = guide_img.resize([int(round(s*scale)) for s in guide_img.size], Image.Resampling.LANCZOS)
|
40 |
+
|
41 |
+
guide = np.asarray(guide_img)
|
42 |
+
h, w = guide.shape[-2:]
|
43 |
+
rows = int(np.ceil(h/64))*64
|
44 |
+
cols = int(np.ceil(w/64))*64
|
45 |
+
ph_1 = (rows-h) // 2
|
46 |
+
ph_2 = rows-h - (rows-h) // 2
|
47 |
+
pw_1 = (cols-w) // 2
|
48 |
+
pw_2 = cols-w - (cols-w) // 2
|
49 |
+
guide = np.pad(guide, ((ph_1, ph_2), (pw_1, pw_2)), mode='constant', constant_values=255)
|
50 |
+
guide_img = Image.fromarray(guide)
|
51 |
+
|
52 |
+
return gr.Image.update(value=guide_img.convert('RGBA')), guide_img.convert('RGBA')
|
53 |
+
|
54 |
+
|
55 |
+
def colorize(img: Dict[str, Image.Image], guide_img: Image.Image, seed: int, hint_mode: str):
|
56 |
+
if not isinstance(img, dict):
|
57 |
+
return gr.update(visible=True)
|
58 |
+
|
59 |
+
if hint_mode == "Roughly Hint":
|
60 |
+
hint_mode_int = 0
|
61 |
+
elif hint_mode == "Precisely Hint":
|
62 |
+
hint_mode_int = 1
|
63 |
+
|
64 |
+
guide_img = guide_img.convert('L')
|
65 |
+
hint_img = img["mask"].convert('RGBA') # I modified gradio to enable it upload colorful mask
|
66 |
+
|
67 |
+
guide = torch.from_numpy(np.asarray(guide_img))[None,None].float().to(device) / 255.0 * 2 - 1
|
68 |
+
hint = torch.from_numpy(np.asarray(hint_img)).permute(2,0,1)[None].float().to(device) / 255.0 * 2 - 1
|
69 |
+
hint_alpha = (hint[:,-1:] > 0.99).float()
|
70 |
+
hint = hint[:,:3] * hint_alpha - 2 * (1 - hint_alpha)
|
71 |
+
|
72 |
+
np.random.seed(int(seed))
|
73 |
+
b, c, h, w = hint.shape
|
74 |
+
h //= 8
|
75 |
+
w //= 8
|
76 |
+
noises = [torch.from_numpy(np.random.randn(b, c, h, w)).float().to(device) for _ in range(16+1)]
|
77 |
+
|
78 |
+
with torch.inference_mode():
|
79 |
+
sample = net(noises, guide, hint, hint_mode_int)
|
80 |
+
out = sample[0].cpu().numpy().transpose([1,2,0])
|
81 |
+
out = np.uint8(((out + 1) / 2 * 255).clip(0,255))
|
82 |
+
|
83 |
+
return Image.fromarray(out).convert('RGB')
|
84 |
+
|
85 |
+
|
86 |
+
with gr.Blocks() as demo:
|
87 |
+
gr.Markdown('''<center><h1>Anime Colorization With Hint</h1></center>
|
88 |
+
<h2>Colorize your anime sketches with hint points.</h2>
|
89 |
+
This is a modified version of
|
90 |
+
<a href="https://github.com/HighCWu/pixel-guide-diffusion-for-anime-colorization">
|
91 |
+
HighCWu/pixel-guide-diffusion-for-anime-colorization
|
92 |
+
</a> with hint points inputs.<br />
|
93 |
+
''')
|
94 |
+
with gr.Row():
|
95 |
+
with gr.Column():
|
96 |
+
inp = gr.Image(
|
97 |
+
source="upload",
|
98 |
+
tool="sketch", # tool="color-sketch", # color-sketch upload image mixed with the original
|
99 |
+
type="pil",
|
100 |
+
label="Sketch",
|
101 |
+
interactive=True,
|
102 |
+
elem_id="sketch-canvas"
|
103 |
+
)
|
104 |
+
inp_store = gr.Image(
|
105 |
+
type="pil",
|
106 |
+
interactive=False
|
107 |
+
)
|
108 |
+
inp_store.visible = False
|
109 |
+
with gr.Column():
|
110 |
+
seed = gr.Slider(1, 2**32, step=1, label="Seed", interactive=True, randomize=True)
|
111 |
+
hint_mode = gr.Radio(["Roughly Hint", "Precisely Hint"], value="Roughly Hint", label="Hint Mode")
|
112 |
+
btn = gr.Button("Run")
|
113 |
+
with gr.Column():
|
114 |
+
output = gr.Image(type="pil", label="Output", interactive=False)
|
115 |
+
gr.Markdown('''
|
116 |
+
PS: Worse than the no hint version I thought. Probably because my model is underfitting in the super-resolution part<br />
|
117 |
+
I modified a little gradio codes for uploading the colorful hint points.
|
118 |
+
''')
|
119 |
+
gr.Markdown(
|
120 |
+
'<center><img src="https://visitor-badge.glitch.me/badge?page_id=highcwu.anime-colorization-with-hint" alt="visitor badge"/></center>'
|
121 |
+
)
|
122 |
+
inp.upload(
|
123 |
+
resize_original,
|
124 |
+
inp,
|
125 |
+
[inp, inp_store],
|
126 |
+
)
|
127 |
+
btn.click(
|
128 |
+
colorize,
|
129 |
+
[inp, inp_store, seed, hint_mode],
|
130 |
+
output
|
131 |
+
)
|
132 |
+
|
133 |
+
if __name__ == "__main__":
|
134 |
+
demo.launch()
|
gradio-modified/templates/frontend/assets/BlockLabel.37da86a3.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as g,i as m,s as _,e as u,c as h,a as y,t as w,b as f,d as c,f as x,g as d,m as p,h as k,j as I,k as v,n as z,o as B,Z as S}from"./index.396f4a72.js";function j(a){let t,n,s,b,o,r,l;return s=new a[1]({}),{c(){t=u("div"),n=u("span"),h(s.$$.fragment),b=y(),o=w(a[0]),f(n,"class","mr-2 h-[12px] w-[12px] opacity-80"),f(t,"class",r="absolute left-0 top-0 py-1 px-2 rounded-br-lg shadow-sm text-xs text-gray-500 flex items-center pointer-events-none bg-white z-20 border-b border-r border-gray-100 dark:bg-gray-900 "+a[3]),c(t,"h-0",!a[2]),c(t,"sr-only",!a[2])},m(e,i){x(e,t,i),d(t,n),p(s,n,null),d(t,b),d(t,o),l=!0},p(e,[i]){(!l||i&1)&&k(o,e[0]),(!l||i&8&&r!==(r="absolute left-0 top-0 py-1 px-2 rounded-br-lg shadow-sm text-xs text-gray-500 flex items-center pointer-events-none bg-white z-20 border-b border-r border-gray-100 dark:bg-gray-900 "+e[3]))&&f(t,"class",r),i&12&&c(t,"h-0",!e[2]),i&12&&c(t,"sr-only",!e[2])},i(e){l||(I(s.$$.fragment,e),l=!0)},o(e){v(s.$$.fragment,e),l=!1},d(e){e&&z(t),B(s)}}}function q(a,t,n){let s,{label:b=null}=t,{Icon:o}=t,{show_label:r=!0}=t,{disable:l=!1}=t;return a.$$set=e=>{"label"in e&&n(0,b=e.label),"Icon"in e&&n(1,o=e.Icon),"show_label"in e&&n(2,r=e.show_label),"disable"in e&&n(4,l=e.disable)},a.$$.update=()=>{a.$$.dirty&16&&n(3,{classes:s}=S({label_container:!l},["label_container"]),s)},[b,o,r,s,l]}class L extends g{constructor(t){super(),m(this,t,q,j,_,{label:0,Icon:1,show_label:2,disable:4})}}export{L as B};
|
2 |
+
//# sourceMappingURL=BlockLabel.37da86a3.js.map
|
gradio-modified/templates/frontend/assets/CarouselItem.svelte_svelte_type_style_lang.cc0aed40.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as B,i as E,s as H,p as I,e as w,a as j,t as M,b as g,d as k,f as T,g as c,l as S,u as D,q as F,r as O,h as q,j as Q,k as R,n as U,A as z,F as G,Q as y,$ as J,a0 as K,a1 as A}from"./index.396f4a72.js";function N(l){let t,o,e,u,L,f,m=l[2]+1+"",v,p,_=l[3].length+"",d,b,i,r,x,n;const C=l[9].default,a=I(C,l,l[8],null);return{c(){t=w("div"),a&&a.c(),o=j(),e=w("div"),u=w("button"),u.innerHTML='<svg class="caret text-xs fill-current" width=".7em" height=".7em" viewBox="0 0 9.1457395 15.999842"><path d="M 0.32506616,7.2360106 7.1796187,0.33129769 c 0.4360247,-0.439451 1.1455702,-0.442056 1.5845974,-0.0058 0.4390612,0.435849 0.441666,1.14535901 0.00582,1.58438501 l -6.064985,6.1096644 6.10968,6.0646309 c 0.4390618,0.436026 0.4416664,1.145465 0.00582,1.584526 -0.4358485,0.439239 -1.1453586,0.441843 -1.5845975,0.0058 L 0.33088256,8.8203249 C 0.11135166,8.6022941 0.00105996,8.3161928 7.554975e-6,8.0295489 -0.00104244,7.7427633 0.10735446,7.4556467 0.32524356,7.2361162"></path></svg>',L=j(),f=w("div"),v=M(m),p=M(" / "),d=M(_),b=j(),i=w("button"),i.innerHTML='<svg class="caret text-xs fill-current scale-x-[-1]" width=".7em" height=".7em" viewBox="0 0 9.1457395 15.999842"><path d="M 0.32506616,7.2360106 7.1796187,0.33129769 c 0.4360247,-0.439451 1.1455702,-0.442056 1.5845974,-0.0058 0.4390612,0.435849 0.441666,1.14535901 0.00582,1.58438501 l -6.064985,6.1096644 6.10968,6.0646309 c 0.4390618,0.436026 0.4416664,1.145465 0.00582,1.584526 -0.4358485,0.439239 -1.1453586,0.441843 -1.5845975,0.0058 L 0.33088256,8.8203249 C 0.11135166,8.6022941 0.00105996,8.3161928 7.554975e-6,8.0295489 -0.00104244,7.7427633 0.10735446,7.4556467 0.32524356,7.2361162"></path></svg>',g(u,"class","flex items-center justify-center h-6 w-6 hover:text-orange-500"),g(f,"class","carousel_index text-center font-semibold"),g(i,"class","flex items-center justify-center h-6 w-6 hover:text-orange-500"),g(e,"class","carousel-control flex gap-4 justify-center items-center pt-2 text-sm"),g(t,"class","output-carousel flex flex-col relative"),g(t,"id",l[0]),k(t,"!hidden",!l[1])},m(s,h){T(s,t,h),a&&a.m(t,null),c(t,o),c(t,e),c(e,u),c(e,L),c(e,f),c(f,v),c(f,p),c(f,d),c(e,b),c(e,i),r=!0,x||(n=[S(u,"click",l[7]),S(i,"click",l[6])],x=!0)},p(s,[h]){a&&a.p&&(!r||h&256)&&D(a,C,s,s[8],r?O(C,s[8],h,null):F(s[8]),null),(!r||h&4)&&m!==(m=s[2]+1+"")&&q(v,m),(!r||h&8)&&_!==(_=s[3].length+"")&&q(d,_),(!r||h&1)&&g(t,"id",s[0]),h&2&&k(t,"!hidden",!s[1])},i(s){r||(Q(a,s),r=!0)},o(s){R(a,s),r=!1},d(s){s&&U(t),a&&a.d(s),x=!1,z(n)}}}const P={};function V(l,t,o){let e,u,{$$slots:L={},$$scope:f}=t,{elem_id:m=""}=t,{visible:v=!0}=t;const p=G(),_=A([]);y(l,_,n=>o(3,e=n));const d=A();y(l,d,n=>o(11,u=n));let b=-1;J(P,{register:()=>(e.push(++b),_.set(e),b),unregister:n=>{const C=e.findIndex(a=>a===n);e.slice(C,1),_.set(e)},current:d});let i=0;const r=()=>{o(2,i=(i+1)%e.length),p("change")},x=()=>{o(2,i=(i-1+e.length)%e.length),p("change")};return l.$$set=n=>{"elem_id"in n&&o(0,m=n.elem_id),"visible"in n&&o(1,v=n.visible),"$$scope"in n&&o(8,f=n.$$scope)},l.$$.update=()=>{l.$$.dirty&12&&K(d,u=e[i]||0,u)},[m,v,i,e,_,d,r,x,f,L]}class X extends B{constructor(t){super(),E(this,t,V,N,H,{elem_id:0,visible:1})}}export{X as C,P as a};
|
2 |
+
//# sourceMappingURL=CarouselItem.svelte_svelte_type_style_lang.cc0aed40.js.map
|
gradio-modified/templates/frontend/assets/CarouselItem.svelte_svelte_type_style_lang.e110d966.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.carousel-item.svelte-89gglt>img{height:100%;max-height:24rem;width:100%;object-fit:contain;object-position:center}
|
gradio-modified/templates/frontend/assets/Column.06c172ac.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as g,i as v,s as h,p as w,e as b,b as o,v as r,d as _,f as C,u as q,q as S,r as j,j as k,k as y,n as z}from"./index.396f4a72.js";function A(i){let e,t,m,f;const u=i[7].default,a=w(u,i,i[6],null);return{c(){e=b("div"),a&&a.c(),o(e,"id",i[2]),o(e,"class",t="overflow-hidden flex flex-col relative col "+r(i[5])),o(e,"style",m=`min-width: min(${i[1]}px, 100%); flex-grow: ${i[0]}`),_(e,"gap-4",i[5].gap!==!1),_(e,"gr-compact",i[4]==="compact"),_(e,"gr-panel",i[4]==="panel"),_(e,"!hidden",!i[3])},m(l,s){C(l,e,s),a&&a.m(e,null),f=!0},p(l,[s]){a&&a.p&&(!f||s&64)&&q(a,u,l,l[6],f?j(u,l[6],s,null):S(l[6]),null),(!f||s&4)&&o(e,"id",l[2]),(!f||s&32&&t!==(t="overflow-hidden flex flex-col relative col "+r(l[5])))&&o(e,"class",t),(!f||s&3&&m!==(m=`min-width: min(${l[1]}px, 100%); flex-grow: ${l[0]}`))&&o(e,"style",m),s&32&&_(e,"gap-4",l[5].gap!==!1),s&48&&_(e,"gr-compact",l[4]==="compact"),s&48&&_(e,"gr-panel",l[4]==="panel"),s&40&&_(e,"!hidden",!l[3])},i(l){f||(k(a,l),f=!0)},o(l){y(a,l),f=!1},d(l){l&&z(e),a&&a.d(l)}}}function B(i,e,t){let{$$slots:m={},$$scope:f}=e,{scale:u=1}=e,{min_width:a=0}=e,{elem_id:l=""}=e,{visible:s=!0}=e,{variant:d="default"}=e,{style:c={}}=e;return i.$$set=n=>{"scale"in n&&t(0,u=n.scale),"min_width"in n&&t(1,a=n.min_width),"elem_id"in n&&t(2,l=n.elem_id),"visible"in n&&t(3,s=n.visible),"variant"in n&&t(4,d=n.variant),"style"in n&&t(5,c=n.style),"$$scope"in n&&t(6,f=n.$$scope)},[u,a,l,s,d,c,f,m]}class D extends g{constructor(e){super(),v(this,e,B,A,h,{scale:0,min_width:1,elem_id:2,visible:3,variant:4,style:5})}}var F=D;export{F as C};
|
2 |
+
//# sourceMappingURL=Column.06c172ac.js.map
|
gradio-modified/templates/frontend/assets/File.60a988f4.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as h,i as c,s as f,w as o,b as t,f as d,g as i,x as r,n as u}from"./index.396f4a72.js";function g(l){let e,s,n;return{c(){e=o("svg"),s=o("path"),n=o("polyline"),t(s,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),t(n,"points","13 2 13 9 20 9"),t(e,"xmlns","http://www.w3.org/2000/svg"),t(e,"width","100%"),t(e,"height","100%"),t(e,"viewBox","0 0 24 24"),t(e,"fill","none"),t(e,"stroke","currentColor"),t(e,"stroke-width","1.5"),t(e,"stroke-linecap","round"),t(e,"stroke-linejoin","round"),t(e,"class","feather feather-file")},m(a,p){d(a,e,p),i(e,s),i(e,n)},p:r,i:r,o:r,d(a){a&&u(e)}}}class m extends h{constructor(e){super(),c(this,e,null,g,f,{})}}export{m as F};
|
2 |
+
//# sourceMappingURL=File.60a988f4.js.map
|
gradio-modified/templates/frontend/assets/Image.4a41f1aa.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as h,i as g,s as d,w as n,b as e,f,g as a,x as l,n as m}from"./index.396f4a72.js";function u(c){let t,r,s,o;return{c(){t=n("svg"),r=n("rect"),s=n("circle"),o=n("polyline"),e(r,"x","3"),e(r,"y","3"),e(r,"width","18"),e(r,"height","18"),e(r,"rx","2"),e(r,"ry","2"),e(s,"cx","8.5"),e(s,"cy","8.5"),e(s,"r","1.5"),e(o,"points","21 15 16 10 5 21"),e(t,"xmlns","http://www.w3.org/2000/svg"),e(t,"width","100%"),e(t,"height","100%"),e(t,"viewBox","0 0 24 24"),e(t,"fill","none"),e(t,"stroke","currentColor"),e(t,"stroke-width","1.5"),e(t,"stroke-linecap","round"),e(t,"stroke-linejoin","round"),e(t,"class","feather feather-image")},m(i,p){f(i,t,p),a(t,r),a(t,s),a(t,o)},p:l,i:l,o:l,d(i){i&&m(t)}}}class x extends h{constructor(t){super(),g(this,t,null,u,d,{})}}export{x as I};
|
2 |
+
//# sourceMappingURL=Image.4a41f1aa.js.map
|
gradio-modified/templates/frontend/assets/Image.95fa511c.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as c,i as u,s as f,e as o,b as n,M as l,f as _,x as m,n as g}from"./index.396f4a72.js";function d(i){let e,s;return{c(){e=o("img"),n(e,"class","gr-sample-image object-contain h-20 w-20"),l(e.src,s=i[1]+i[0])||n(e,"src",s)},m(a,t){_(a,e,t)},p(a,[t]){t&3&&!l(e.src,s=a[1]+a[0])&&n(e,"src",s)},i:m,o:m,d(a){a&&g(e)}}}function v(i,e,s){let{value:a}=e,{samples_dir:t}=e;return i.$$set=r=>{"value"in r&&s(0,a=r.value),"samples_dir"in r&&s(1,t=r.samples_dir)},[a,t]}class p extends c{constructor(e){super(),u(this,e,v,d,f,{value:0,samples_dir:1})}}var b=p;export{b as E};
|
2 |
+
//# sourceMappingURL=Image.95fa511c.js.map
|
gradio-modified/templates/frontend/assets/Model3D.b44fd6f2.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as l,i as r,s as o,e as u,t as c,b as d,f,g as m,h as p,x as i,n as v}from"./index.396f4a72.js";function x(n){let e,s;return{c(){e=u("div"),s=c(n[0]),d(e,"class","gr-sample-3d")},m(t,a){f(t,e,a),m(e,s)},p(t,[a]){a&1&&p(s,t[0])},i,o:i,d(t){t&&v(e)}}}function _(n,e,s){let{value:t}=e;return n.$$set=a=>{"value"in a&&s(0,t=a.value)},[t]}class g extends l{constructor(e){super(),r(this,e,_,x,o,{value:0})}}var D=g;export{D as E};
|
2 |
+
//# sourceMappingURL=Model3D.b44fd6f2.js.map
|
gradio-modified/templates/frontend/assets/ModifyUpload.2cfe71e4.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as b,i as w,s as k,e as x,c as y,b as s,f as _,g as m,m as I,l as z,j as d,k as h,n as v,o as C,K as M,w as g,Y as u,x as f,a as E,d as p,D as L,E as B,F as D}from"./index.396f4a72.js";function S(o){let e,l,t,r,n,a;return t=new o[0]({}),{c(){e=x("button"),l=x("div"),y(t.$$.fragment),s(l,"class","m-t-1 w-[60%] h-[60%] opacity-80 dark:text-white"),s(e,"class","text-gray-500 bg-white/90 h-5 w-5 flex items-center justify-center rounded shadow-sm hover:shadow-xl hover:ring-1 ring-inset ring-gray-200 z-10 dark:bg-gray-900 dark:ring-gray-600"),s(e,"aria-label",o[1])},m(i,c){_(i,e,c),m(e,l),I(t,l,null),r=!0,n||(a=z(e,"click",o[2]),n=!0)},p(i,[c]){(!r||c&2)&&s(e,"aria-label",i[1])},i(i){r||(d(t.$$.fragment,i),r=!0)},o(i){h(t.$$.fragment,i),r=!1},d(i){i&&v(e),C(t),n=!1,a()}}}function q(o,e,l){let{Icon:t}=e,{label:r=""}=e;function n(a){M.call(this,o,a)}return o.$$set=a=>{"Icon"in a&&l(0,t=a.Icon),"label"in a&&l(1,r=a.label)},[t,r,n]}class j extends b{constructor(e){super(),w(this,e,q,S,k,{Icon:0,label:1})}}function F(o){let e,l,t,r;return{c(){e=g("svg"),l=g("g"),t=g("path"),r=g("path"),s(t,"d","M18,6L6.087,17.913"),u(t,"fill","none"),u(t,"fill-rule","nonzero"),u(t,"stroke-width","2px"),s(l,"transform","matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"),s(r,"d","M4.364,4.364L19.636,19.636"),u(r,"fill","none"),u(r,"fill-rule","nonzero"),u(r,"stroke-width","2px"),s(e,"width","100%"),s(e,"height","100%"),s(e,"viewBox","0 0 24 24"),s(e,"version","1.1"),s(e,"xmlns","http://www.w3.org/2000/svg"),s(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),s(e,"xml:space","preserve"),s(e,"stroke","currentColor"),u(e,"fill-rule","evenodd"),u(e,"clip-rule","evenodd"),u(e,"stroke-linecap","round"),u(e,"stroke-linejoin","round")},m(n,a){_(n,e,a),m(e,l),m(l,t),m(e,r)},p:f,i:f,o:f,d(n){n&&v(e)}}}class K extends b{constructor(e){super(),w(this,e,null,F,k,{})}}function P(o){let e,l;return{c(){e=g("svg"),l=g("path"),s(l,"d","M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"),s(e,"xmlns","http://www.w3.org/2000/svg"),s(e,"width","100%"),s(e,"height","100%"),s(e,"viewBox","0 0 24 24"),s(e,"fill","none"),s(e,"stroke","currentColor"),s(e,"stroke-width","1.5"),s(e,"stroke-linecap","round"),s(e,"stroke-linejoin","round"),s(e,"class","feather feather-edit-2")},m(t,r){_(t,e,r),m(e,l)},p:f,i:f,o:f,d(t){t&&v(e)}}}class U extends b{constructor(e){super(),w(this,e,null,P,k,{})}}function $(o){let e,l;return e=new j({props:{Icon:U,label:"Edit"}}),e.$on("click",o[3]),{c(){y(e.$$.fragment)},m(t,r){I(e,t,r),l=!0},p:f,i(t){l||(d(e.$$.fragment,t),l=!0)},o(t){h(e.$$.fragment,t),l=!1},d(t){C(e,t)}}}function Y(o){let e,l,t,r,n=o[0]&&$(o);return t=new j({props:{Icon:K,label:"Clear"}}),t.$on("click",o[4]),{c(){e=x("div"),n&&n.c(),l=E(),y(t.$$.fragment),s(e,"class","modify-upload z-10 top-2 right-2 justify-end flex gap-1"),p(e,"absolute",o[1]),p(e,"m-1",!o[1])},m(a,i){_(a,e,i),n&&n.m(e,null),m(e,l),I(t,e,null),r=!0},p(a,[i]){a[0]?n?(n.p(a,i),i&1&&d(n,1)):(n=$(a),n.c(),d(n,1),n.m(e,l)):n&&(L(),h(n,1,1,()=>{n=null}),B()),i&2&&p(e,"absolute",a[1]),i&2&&p(e,"m-1",!a[1])},i(a){r||(d(n),d(t.$$.fragment,a),r=!0)},o(a){h(n),h(t.$$.fragment,a),r=!1},d(a){a&&v(e),n&&n.d(),C(t)}}}function A(o,e,l){let{editable:t=!1}=e,{absolute:r=!0}=e;const n=D(),a=()=>n("edit"),i=c=>{n("clear"),c.stopPropagation()};return o.$$set=c=>{"editable"in c&&l(0,t=c.editable),"absolute"in c&&l(1,r=c.absolute)},[t,r,n,a,i]}class H extends b{constructor(e){super(),w(this,e,A,Y,k,{editable:0,absolute:1})}}export{K as C,j as I,H as M};
|
2 |
+
//# sourceMappingURL=ModifyUpload.2cfe71e4.js.map
|
gradio-modified/templates/frontend/assets/Tabs.6b500f1a.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as A,i as D,s as E,B as q,f as h,n as g,p as F,e as v,a as w,b as m,d as S,g as p,ab as I,u as M,q as N,r as Q,j as z,k as G,Q as H,F as J,$ as K,aq as L,a1 as O,a0 as P,t as C,l as R,h as j}from"./index.396f4a72.js";function T(i,e,s){const t=i.slice();return t[11]=e[s],t}function U(i){let e,s=i[11].name+"",t,f,o,a;function n(){return i[9](i[11])}return{c(){e=v("button"),t=C(s),f=w(),m(e,"class","px-4 pb-2 pt-1.5 border-transparent text-gray-400 hover:text-gray-700 -mb-[2px] border-2 border-b-0")},m(d,u){h(d,e,u),p(e,t),p(e,f),o||(a=R(e,"click",n),o=!0)},p(d,u){i=d,u&4&&s!==(s=i[11].name+"")&&j(t,s)},d(d){d&&g(e),o=!1,a()}}}function V(i){let e,s=i[11].name+"",t,f;return{c(){e=v("button"),t=C(s),f=w(),m(e,"class","bg-white px-4 pb-2 pt-1.5 rounded-t-lg border-gray-200 -mb-[2px] border-2 border-b-0")},m(o,a){h(o,e,a),p(e,t),p(e,f)},p(o,a){a&4&&s!==(s=o[11].name+"")&&j(t,s)},d(o){o&&g(e)}}}function B(i,e){let s,t;function f(n,d){return n[11].id===n[3]?V:U}let o=f(e),a=o(e);return{key:i,first:null,c(){s=q(),a.c(),t=q(),this.first=s},m(n,d){h(n,s,d),a.m(n,d),h(n,t,d)},p(n,d){e=n,o===(o=f(e))&&a?a.p(e,d):(a.d(1),a=o(e),a&&(a.c(),a.m(t.parentNode,t)))},d(n){n&&g(s),a.d(n),n&&g(t)}}}function W(i){let e,s,t=[],f=new Map,o,a,n=i[2];const d=l=>l[11].id;for(let l=0;l<n.length;l+=1){let c=T(i,n,l),b=d(c);f.set(b,t[l]=B(b,c))}const u=i[8].default,_=F(u,i,i[7],null);return{c(){e=v("div"),s=v("div");for(let l=0;l<t.length;l+=1)t[l].c();o=w(),_&&_.c(),m(s,"class","flex border-b-2 flex-wrap dark:border-gray-700"),m(e,"class","tabs flex flex-col my-4"),m(e,"id",i[1]),S(e,"hidden",!i[0])},m(l,c){h(l,e,c),p(e,s);for(let b=0;b<t.length;b+=1)t[b].m(s,null);p(e,o),_&&_.m(e,null),a=!0},p(l,[c]){c&44&&(n=l[2],t=I(t,c,d,1,l,n,f,s,L,B,null,T)),_&&_.p&&(!a||c&128)&&M(_,u,l,l[7],a?Q(u,l[7],c,null):N(l[7]),null),(!a||c&2)&&m(e,"id",l[1]),c&1&&S(e,"hidden",!l[0])},i(l){a||(z(_,l),a=!0)},o(l){G(_,l),a=!1},d(l){l&&g(e);for(let c=0;c<t.length;c+=1)t[c].d();_&&_.d(l)}}}const X={};function Y(i,e,s){let t,{$$slots:f={},$$scope:o}=e,{visible:a=!0}=e,{elem_id:n}=e,{selected:d}=e,u=[];const _=O(!1);H(i,_,r=>s(3,t=r));const l=J();K(X,{register_tab:r=>{u.push({name:r.name,id:r.id}),_.update(k=>k??r.id),s(2,u)},unregister_tab:r=>{const k=u.findIndex(y=>y.id===r.id);u.splice(k,1),_.update(y=>y===r.id?u[k]?.id||u[u.length-1]?.id:y)},selected_tab:_});function c(r){P(_,t=r,t),l("change")}const b=r=>c(r.id);return i.$$set=r=>{"visible"in r&&s(0,a=r.visible),"elem_id"in r&&s(1,n=r.elem_id),"selected"in r&&s(6,d=r.selected),"$$scope"in r&&s(7,o=r.$$scope)},i.$$.update=()=>{i.$$.dirty&64&&d!==null&&c(d)},[a,n,u,t,_,c,d,o,f,b]}class x extends A{constructor(e){super(),D(this,e,Y,W,E,{visible:0,elem_id:1,selected:6})}}export{x as T,X as a};
|
2 |
+
//# sourceMappingURL=Tabs.6b500f1a.js.map
|
gradio-modified/templates/frontend/assets/Tabs.6b500f1a.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"Tabs.6b500f1a.js","sources":["../../../../ui/packages/tabs/src/Tabs.svelte"],"sourcesContent":["<script context=\"module\">\r\n\texport const TABS = {};\r\n</script>\r\n\r\n<script lang=\"ts\">\r\n\timport { setContext, createEventDispatcher } from \"svelte\";\r\n\timport { writable } from \"svelte/store\";\r\n\r\n\tinterface Tab {\r\n\t\tname: string;\r\n\t\tid: object;\r\n\t}\r\n\r\n\texport let visible: boolean = true;\r\n\texport let elem_id: string;\r\n\texport let selected: number | string | object;\r\n\r\n\tlet tabs: Array<Tab> = [];\r\n\r\n\tconst selected_tab = writable<false | object | number | string>(false);\r\n\tconst dispatch = createEventDispatcher<{ change: undefined }>();\r\n\r\n\tsetContext(TABS, {\r\n\t\tregister_tab: (tab: Tab) => {\r\n\t\t\ttabs.push({ name: tab.name, id: tab.id });\r\n\t\t\tselected_tab.update((current) => current ?? tab.id);\r\n\t\t\ttabs = tabs;\r\n\t\t},\r\n\t\tunregister_tab: (tab: Tab) => {\r\n\t\t\tconst i = tabs.findIndex((t) => t.id === tab.id);\r\n\t\t\ttabs.splice(i, 1);\r\n\t\t\tselected_tab.update((current) =>\r\n\t\t\t\tcurrent === tab.id ? tabs[i]?.id || tabs[tabs.length - 1]?.id : current\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tselected_tab\r\n\t});\r\n\r\n\tfunction change_tab(id: object | string | number) {\r\n\t\t$selected_tab = id;\r\n\t\tdispatch(\"change\");\r\n\t}\r\n\r\n\t$: selected !== null && change_tab(selected);\r\n</script>\r\n\r\n<div class=\"tabs flex flex-col my-4\" class:hidden={!visible} id={elem_id}>\r\n\t<div class=\"flex border-b-2 flex-wrap dark:border-gray-700\">\r\n\t\t{#each tabs as t (t.id)}\r\n\t\t\t{#if t.id === $selected_tab}\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"bg-white px-4 pb-2 pt-1.5 rounded-t-lg border-gray-200 -mb-[2px] border-2 border-b-0\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{t.name}\r\n\t\t\t\t</button>\r\n\t\t\t{:else}\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"px-4 pb-2 pt-1.5 border-transparent text-gray-400 hover:text-gray-700 -mb-[2px] border-2 border-b-0\"\r\n\t\t\t\t\ton:click={() => change_tab(t.id)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{t.name}\r\n\t\t\t\t</button>\r\n\t\t\t{/if}\r\n\t\t{/each}\r\n\t</div>\r\n\t<slot />\r\n</div>\r\n"],"names":[],"mappings":"gTA6DM,MAAE,iNAJJ,0EAIE,MAAE,gEAPF,MAAE,8JAHJ,2CAGE,MAAE,+EAJA,OAAE,KAAO,uRADR,gBAAW,MAAE,mBAAlB,mSAF6D,oBAAb,cAApD,SACC,gGACQ,6HAFwD,yBAAb,mHA9CtC,0DAYF,UAAmB,OACnB,cACA,cAEP,UAEE,GAAe,EAA2C,EAAK,0BAC/D,GAAW,IAEjB,EAAW,GACV,aAAe,IACd,EAAK,MAAO,KAAM,EAAI,KAAM,GAAI,EAAI,KACpC,EAAa,OAAQ,GAAY,GAAW,EAAI,EAAE,UAGnD,eAAiB,SACV,GAAI,EAAK,UAAW,GAAM,EAAE,KAAO,EAAI,EAAE,EAC/C,EAAK,OAAO,EAAG,CAAC,EAChB,EAAa,OAAQ,GACpB,IAAY,EAAI,GAAK,EAAK,IAAI,IAAM,EAAK,EAAK,OAAS,IAAI,GAAK,CAAO,GAIzE,4BAGmB,OACnB,EAAgB,KAChB,EAAS,QAAQ,aAkBE,EAAW,EAAE,EAAE,wLAfhC,IAAa,MAAQ,EAAW,CAAQ"}
|
gradio-modified/templates/frontend/assets/Upload.5d0148e8.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as J,i as M,s as N,p as P,e as D,a as Q,b as o,d as p,f as V,g as R,l as s,W as h,z as b,u as X,q as Y,r as Z,j as x,k as $,n as ee,A as le,F as te,K as y,I as ne}from"./index.396f4a72.js";function ie(t){let l,i,a,g,m,c,f,d,k,F;const _=t[14].default,r=P(_,t,t[13],null);return{c(){l=D("div"),r&&r.c(),i=Q(),a=D("input"),o(a,"class","hidden-upload hidden"),o(a,"type","file"),o(a,"accept",t[0]),a.multiple=g=t[4]==="multiple"||void 0,o(a,"webkitdirectory",m=t[4]==="directory"||void 0),o(a,"mozdirectory",c=t[4]==="directory"||void 0),o(l,"class",f="w-full cursor-pointer h-full items-center justify-center text-gray-400 md:text-xl "+(t[1]?"min-h-[10rem] md:min-h-[15rem] max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem]":"")),p(l,"text-center",t[2]),p(l,"flex",t[3])},m(n,u){V(n,l,u),r&&r.m(l,null),R(l,i),R(l,a),t[22](a),d=!0,k||(F=[s(a,"change",t[8]),s(l,"drag",h(b(t[15]))),s(l,"dragstart",h(b(t[16]))),s(l,"dragend",h(b(t[17]))),s(l,"dragover",h(b(t[18]))),s(l,"dragenter",h(b(t[19]))),s(l,"dragleave",h(b(t[20]))),s(l,"drop",h(b(t[21]))),s(l,"click",t[7]),s(l,"drop",t[9]),s(l,"dragenter",t[6]),s(l,"dragleave",t[6])],k=!0)},p(n,[u]){r&&r.p&&(!d||u&8192)&&X(r,_,n,n[13],d?Z(_,n[13],u,null):Y(n[13]),null),(!d||u&1)&&o(a,"accept",n[0]),(!d||u&16&&g!==(g=n[4]==="multiple"||void 0))&&(a.multiple=g),(!d||u&16&&m!==(m=n[4]==="directory"||void 0))&&o(a,"webkitdirectory",m),(!d||u&16&&c!==(c=n[4]==="directory"||void 0))&&o(a,"mozdirectory",c),(!d||u&2&&f!==(f="w-full cursor-pointer h-full items-center justify-center text-gray-400 md:text-xl "+(n[1]?"min-h-[10rem] md:min-h-[15rem] max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem]":"")))&&o(l,"class",f),u&6&&p(l,"text-center",n[2]),u&10&&p(l,"flex",n[3])},i(n){d||(x(r,n),d=!0)},o(n){$(r,n),d=!1},d(n){n&&ee(l),r&&r.d(n),t[22](null),k=!1,le(F)}}}function ae(t,l,i){let{$$slots:a={},$$scope:g}=l,{filetype:m=void 0}=l,{include_file_metadata:c=!0}=l,{dragging:f=!1}=l,{boundedheight:d=!0}=l,{center:k=!0}=l,{flex:F=!0}=l,{file_count:_="single"}=l,{disable_click:r=!1}=l,n;const u=te(),A=()=>{i(10,f=!f)},q=()=>{r||(i(5,n.value="",n),n.click())},j=e=>{let w=Array.from(e);if(!(!e.length||!window.FileReader)){_==="single"&&(w=[e[0]]);var z=[];w.forEach((U,G)=>{let v=new FileReader;v.readAsDataURL(U),v.onloadend=function(){z[G]=c?{name:U.name,size:U.size,data:this.result}:this.result,z.filter(H=>H!==void 0).length===e.length&&u("load",_=="single"?z[0]:z)}})}},E=e=>{const w=e.target;!w.files||j(w.files)},S=e=>{i(10,f=!1),e.dataTransfer?.files&&j(e.dataTransfer.files)};function T(e){y.call(this,t,e)}function C(e){y.call(this,t,e)}function I(e){y.call(this,t,e)}function K(e){y.call(this,t,e)}function L(e){y.call(this,t,e)}function O(e){y.call(this,t,e)}function W(e){y.call(this,t,e)}function B(e){ne[e?"unshift":"push"](()=>{n=e,i(5,n)})}return t.$$set=e=>{"filetype"in e&&i(0,m=e.filetype),"include_file_metadata"in e&&i(11,c=e.include_file_metadata),"dragging"in e&&i(10,f=e.dragging),"boundedheight"in e&&i(1,d=e.boundedheight),"center"in e&&i(2,k=e.center),"flex"in e&&i(3,F=e.flex),"file_count"in e&&i(4,_=e.file_count),"disable_click"in e&&i(12,r=e.disable_click),"$$scope"in e&&i(13,g=e.$$scope)},[m,d,k,F,_,n,A,q,E,S,f,c,r,g,a,T,C,I,K,L,O,W,B]}class de extends J{constructor(l){super(),M(this,l,ae,ie,N,{filetype:0,include_file_metadata:11,dragging:10,boundedheight:1,center:2,flex:3,file_count:4,disable_click:12})}}export{de as U};
|
2 |
+
//# sourceMappingURL=Upload.5d0148e8.js.map
|
gradio-modified/templates/frontend/assets/Webcam.8816836e.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{S as bt,i as wt,s as yt,w as H,b as p,f as U,g as Z,x as I,n as j,e as ct,l as je,y as Ve,D as jt,k as G,E as Vt,j as W,a as Ge,d as re,F as qe,ad as Fe,c as Gt,m as qt,o as Ft,B as Ke,I as Qe}from"./index.396f4a72.js";function Ze(a){let t,e,i;return{c(){t=H("svg"),e=H("path"),i=H("circle"),p(e,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),p(i,"cx","12"),p(i,"cy","13"),p(i,"r","4"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","none"),p(t,"stroke","currentColor"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-camera")},m(n,r){U(n,t,r),Z(t,e),Z(t,i)},p:I,i:I,o:I,d(n){n&&j(t)}}}class Je extends bt{constructor(t){super(),wt(this,t,null,Ze,yt,{})}}function $e(a){let t,e;return{c(){t=H("svg"),e=H("circle"),p(e,"cx","12"),p(e,"cy","12"),p(e,"r","10"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","red"),p(t,"stroke","red"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-circle")},m(i,n){U(i,t,n),Z(t,e)},p:I,i:I,o:I,d(i){i&&j(t)}}}class ti extends bt{constructor(t){super(),wt(this,t,null,$e,yt,{})}}function ei(a){let t,e;return{c(){t=H("svg"),e=H("rect"),p(e,"x","3"),p(e,"y","3"),p(e,"width","18"),p(e,"height","18"),p(e,"rx","2"),p(e,"ry","2"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","red"),p(t,"stroke","red"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-square")},m(i,n){U(i,t,n),Z(t,e)},p:I,i:I,o:I,d(i){i&&j(t)}}}class ii extends bt{constructor(t){super(),wt(this,t,null,ei,yt,{})}}function ai(a){let t,e,i;return{c(){t=H("svg"),e=H("polyline"),i=H("path"),p(e,"points","1 4 1 10 7 10"),p(i,"d","M3.51 15a9 9 0 1 0 2.13-9.36L1 10"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","none"),p(t,"stroke","currentColor"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-rotate-ccw")},m(n,r){U(n,t,r),Z(t,e),Z(t,i)},p:I,i:I,o:I,d(n){n&&j(t)}}}class ga extends bt{constructor(t){super(),wt(this,t,null,ai,yt,{})}}/*!
|
2 |
+
* Cropper.js v1.5.12
|
3 |
+
* https://fengyuanchen.github.io/cropperjs
|
4 |
+
*
|
5 |
+
* Copyright 2015-present Chen Fengyuan
|
6 |
+
* Released under the MIT license
|
7 |
+
*
|
8 |
+
* Date: 2021-06-12T08:00:17.411Z
|
9 |
+
*/function ne(a,t){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),e.push.apply(e,i)}return e}function Ee(a){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(e),!0).forEach(function(i){oi(a,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):ne(Object(e)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(e,i))})}return a}function Dt(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dt=function(t){return typeof t}:Dt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(a)}function ri(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(a,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function ni(a,t,e){return t&&oe(a.prototype,t),e&&oe(a,e),a}function oi(a,t,e){return t in a?Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[t]=e,a}function De(a){return si(a)||hi(a)||ci(a)||li()}function si(a){if(Array.isArray(a))return It(a)}function hi(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function ci(a,t){if(!!a){if(typeof a=="string")return It(a,t);var e=Object.prototype.toString.call(a).slice(8,-1);if(e==="Object"&&a.constructor&&(e=a.constructor.name),e==="Map"||e==="Set")return Array.from(a);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return It(a,t)}}function It(a,t){(t==null||t>a.length)&&(t=a.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=a[e];return i}function li(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
10 |
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ct=typeof window<"u"&&typeof window.document<"u",X=Ct?window:{},Kt=Ct&&X.document.documentElement?"ontouchstart"in X.document.documentElement:!1,Qt=Ct?"PointerEvent"in X:!1,E="cropper",Zt="all",Me="crop",Oe="move",Te="zoom",et="e",it="w",rt="s",F="n",ft="ne",ut="nw",dt="se",pt="sw",Lt="".concat(E,"-crop"),se="".concat(E,"-disabled"),S="".concat(E,"-hidden"),he="".concat(E,"-hide"),fi="".concat(E,"-invisible"),Mt="".concat(E,"-modal"),Bt="".concat(E,"-move"),mt="".concat(E,"Action"),_t="".concat(E,"Preview"),Jt="crop",Ce="move",Re="none",zt="crop",Pt="cropend",Ht="cropmove",Wt="cropstart",ce="dblclick",ui=Kt?"touchstart":"mousedown",di=Kt?"touchmove":"mousemove",pi=Kt?"touchend touchcancel":"mouseup",le=Qt?"pointerdown":ui,fe=Qt?"pointermove":di,ue=Qt?"pointerup pointercancel":pi,de="ready",pe="resize",ve="wheel",Yt="zoom",me="image/jpeg",vi=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,mi=/^data:/,gi=/^data:image\/jpeg;base64,/,bi=/^img|canvas$/i,Ae=200,Ne=100,ge={viewMode:0,dragMode:Jt,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Ae,minContainerHeight:Ne,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},wi='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',yi=Number.isNaN||X.isNaN;function b(a){return typeof a=="number"&&!yi(a)}var be=function(t){return t>0&&t<1/0};function kt(a){return typeof a>"u"}function at(a){return Dt(a)==="object"&&a!==null}var xi=Object.prototype.hasOwnProperty;function nt(a){if(!at(a))return!1;try{var t=a.constructor,e=t.prototype;return t&&e&&xi.call(e,"isPrototypeOf")}catch{return!1}}function k(a){return typeof a=="function"}var _i=Array.prototype.slice;function ke(a){return Array.from?Array.from(a):_i.call(a)}function C(a,t){return a&&k(t)&&(Array.isArray(a)||b(a.length)?ke(a).forEach(function(e,i){t.call(a,e,i,a)}):at(a)&&Object.keys(a).forEach(function(e){t.call(a,a[e],e,a)})),a}var D=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return at(t)&&i.length>0&&i.forEach(function(r){at(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},Ei=/\.\d*(?:0|9){12}\d*$/;function st(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ei.test(a)?Math.round(a*t)/t:a}var Di=/^width|height|left|top|marginLeft|marginTop$/;function K(a,t){var e=a.style;C(t,function(i,n){Di.test(n)&&b(i)&&(i="".concat(i,"px")),e[n]=i})}function Mi(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function A(a,t){if(!!t){if(b(a.length)){C(a,function(i){A(i,t)});return}if(a.classList){a.classList.add(t);return}var e=a.className.trim();e?e.indexOf(t)<0&&(a.className="".concat(e," ").concat(t)):a.className=t}}function Y(a,t){if(!!t){if(b(a.length)){C(a,function(e){Y(e,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function ot(a,t,e){if(!!t){if(b(a.length)){C(a,function(i){ot(i,t,e)});return}e?A(a,t):Y(a,t)}}var Oi=/([a-z\d])([A-Z])/g;function $t(a){return a.replace(Oi,"$1-$2").toLowerCase()}function Xt(a,t){return at(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat($t(t)))}function gt(a,t,e){at(e)?a[t]=e:a.dataset?a.dataset[t]=e:a.setAttribute("data-".concat($t(t)),e)}function Ti(a,t){if(at(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat($t(t)))}var Se=/\s\s*/,Ie=function(){var a=!1;if(Ct){var t=!1,e=function(){},i=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});X.addEventListener("test",e,i),X.removeEventListener("test",e,i)}return a}();function z(a,t,e){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(Se).forEach(function(r){if(!Ie){var o=a.listeners;o&&o[r]&&o[r][e]&&(n=o[r][e],delete o[r][e],Object.keys(o[r]).length===0&&delete o[r],Object.keys(o).length===0&&delete a.listeners)}a.removeEventListener(r,n,i)})}function B(a,t,e){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(Se).forEach(function(r){if(i.once&&!Ie){var o=a.listeners,s=o===void 0?{}:o;n=function(){delete s[r][e],a.removeEventListener(r,n,i);for(var f=arguments.length,h=new Array(f),c=0;c<f;c++)h[c]=arguments[c];e.apply(a,h)},s[r]||(s[r]={}),s[r][e]&&a.removeEventListener(r,s[r][e],i),s[r][e]=n,a.listeners=s}a.addEventListener(r,n,i)})}function ht(a,t,e){var i;return k(Event)&&k(CustomEvent)?i=new CustomEvent(t,{detail:e,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,e)),a.dispatchEvent(i)}function Le(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var St=X.location,Ci=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function we(a){var t=a.match(Ci);return t!==null&&(t[1]!==St.protocol||t[2]!==St.hostname||t[3]!==St.port)}function ye(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function vt(a){var t=a.rotate,e=a.scaleX,i=a.scaleY,n=a.translateX,r=a.translateY,o=[];b(n)&&n!==0&&o.push("translateX(".concat(n,"px)")),b(r)&&r!==0&&o.push("translateY(".concat(r,"px)")),b(t)&&t!==0&&o.push("rotate(".concat(t,"deg)")),b(e)&&e!==1&&o.push("scaleX(".concat(e,")")),b(i)&&i!==1&&o.push("scaleY(".concat(i,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Ri(a){var t=Ee({},a),e=0;return C(a,function(i,n){delete t[n],C(t,function(r){var o=Math.abs(i.startX-r.startX),s=Math.abs(i.startY-r.startY),l=Math.abs(i.endX-r.endX),f=Math.abs(i.endY-r.endY),h=Math.sqrt(o*o+s*s),c=Math.sqrt(l*l+f*f),u=(c-h)/h;Math.abs(u)>Math.abs(e)&&(e=u)})}),e}function Et(a,t){var e=a.pageX,i=a.pageY,n={endX:e,endY:i};return t?n:Ee({startX:e,startY:i},n)}function Ai(a){var t=0,e=0,i=0;return C(a,function(n){var r=n.startX,o=n.startY;t+=r,e+=o,i+=1}),t/=i,e/=i,{pageX:t,pageY:e}}function Q(a){var t=a.aspectRatio,e=a.height,i=a.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=be(i),o=be(e);if(r&&o){var s=e*t;n==="contain"&&s>i||n==="cover"&&s<i?e=i/t:i=e*t}else r?e=i/t:o&&(i=e*t);return{width:i,height:e}}function Ni(a){var t=a.width,e=a.height,i=a.degree;if(i=Math.abs(i)%180,i===90)return{width:e,height:t};var n=i%90*Math.PI/180,r=Math.sin(n),o=Math.cos(n),s=t*o+e*r,l=t*r+e*o;return i>90?{width:l,height:s}:{width:s,height:l}}function ki(a,t,e,i){var n=t.aspectRatio,r=t.naturalWidth,o=t.naturalHeight,s=t.rotate,l=s===void 0?0:s,f=t.scaleX,h=f===void 0?1:f,c=t.scaleY,u=c===void 0?1:c,v=e.aspectRatio,m=e.naturalWidth,x=e.naturalHeight,g=i.fillColor,_=g===void 0?"transparent":g,T=i.imageSmoothingEnabled,O=T===void 0?!0:T,w=i.imageSmoothingQuality,M=w===void 0?"low":w,d=i.maxWidth,y=d===void 0?1/0:d,R=i.maxHeight,L=R===void 0?1/0:R,V=i.minWidth,J=V===void 0?0:V,$=i.minHeight,q=$===void 0?0:$,P=document.createElement("canvas"),N=P.getContext("2d"),tt=Q({aspectRatio:v,width:y,height:L}),xt=Q({aspectRatio:v,width:J,height:q},"cover"),At=Math.min(tt.width,Math.max(xt.width,m)),Nt=Math.min(tt.height,Math.max(xt.height,x)),te=Q({aspectRatio:n,width:y,height:L}),ee=Q({aspectRatio:n,width:J,height:q},"cover"),ie=Math.min(te.width,Math.max(ee.width,r)),ae=Math.min(te.height,Math.max(ee.height,o)),Xe=[-ie/2,-ae/2,ie,ae];return P.width=st(At),P.height=st(Nt),N.fillStyle=_,N.fillRect(0,0,At,Nt),N.save(),N.translate(At/2,Nt/2),N.rotate(l*Math.PI/180),N.scale(h,u),N.imageSmoothingEnabled=O,N.imageSmoothingQuality=M,N.drawImage.apply(N,[a].concat(De(Xe.map(function(Ue){return Math.floor(st(Ue))})))),N.restore(),P}var Be=String.fromCharCode;function Si(a,t,e){var i="";e+=t;for(var n=t;n<e;n+=1)i+=Be(a.getUint8(n));return i}var Ii=/^data:.*,/;function Li(a){var t=a.replace(Ii,""),e=atob(t),i=new ArrayBuffer(e.length),n=new Uint8Array(i);return C(n,function(r,o){n[o]=e.charCodeAt(o)}),i}function Bi(a,t){for(var e=[],i=8192,n=new Uint8Array(a);n.length>0;)e.push(Be.apply(null,ke(n.subarray(0,i)))),n=n.subarray(i);return"data:".concat(t,";base64,").concat(btoa(e.join("")))}function zi(a){var t=new DataView(a),e;try{var i,n,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1<o;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){n=s;break}s+=1}if(n){var l=n+4,f=n+10;if(Si(t,l,4)==="Exif"){var h=t.getUint16(f);if(i=h===18761,(i||h===19789)&&t.getUint16(f+2,i)===42){var c=t.getUint32(f+4,i);c>=8&&(r=f+c)}}}if(r){var u=t.getUint16(r,i),v,m;for(m=0;m<u;m+=1)if(v=r+m*12+2,t.getUint16(v,i)===274){v+=8,e=t.getUint16(v,i),t.setUint16(v,1,i);break}}}catch{e=1}return e}function Pi(a){var t=0,e=1,i=1;switch(a){case 2:e=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,e=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:e,scaleY:i}}var Hi={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,n=this.cropper,r=Number(e.minContainerWidth),o=Number(e.minContainerHeight);A(n,S),Y(t,S);var s={width:Math.max(i.offsetWidth,r>=0?r:Ae),height:Math.max(i.offsetHeight,o>=0?o:Ne)};this.containerData=s,K(n,{width:s.width,height:s.height}),A(t,S),Y(n,S)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,n=Math.abs(e.rotate)%180===90,r=n?e.naturalHeight:e.naturalWidth,o=n?e.naturalWidth:e.naturalHeight,s=r/o,l=t.width,f=t.height;t.height*s>t.width?i===3?l=t.height*s:f=t.width/s:i===3?f=t.width/s:l=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:o,width:l,height:f};this.canvasData=h,this.limited=i===1||i===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=D({},h)},limitCanvas:function(t,e){var i=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=i.viewMode,l=r.aspectRatio,f=this.cropped&&o;if(t){var h=Number(i.minCanvasWidth)||0,c=Number(i.minCanvasHeight)||0;s>1?(h=Math.max(h,n.width),c=Math.max(c,n.height),s===3&&(c*l>h?h=c*l:c=h/l)):s>0&&(h?h=Math.max(h,f?o.width:0):c?c=Math.max(c,f?o.height:0):f&&(h=o.width,c=o.height,c*l>h?h=c*l:c=h/l));var u=Q({aspectRatio:l,width:h,height:c});h=u.width,c=u.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(s>(f?0:1)){var v=n.width-r.width,m=n.height-r.height;r.minLeft=Math.min(0,v),r.minTop=Math.min(0,m),r.maxLeft=Math.max(0,v),r.maxTop=Math.max(0,m),f&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,s===2&&(r.width>=n.width&&(r.minLeft=Math.min(0,v),r.maxLeft=Math.max(0,v)),r.height>=n.height&&(r.minTop=Math.min(0,m),r.maxTop=Math.max(0,m))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=n.width,r.maxTop=n.height},renderCanvas:function(t,e){var i=this.canvasData,n=this.imageData;if(e){var r=Ni({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=r.width,s=r.height,l=i.width*(o/i.naturalWidth),f=i.height*(s/i.naturalHeight);i.left-=(l-i.width)/2,i.top-=(f-i.height)/2,i.width=l,i.height=f,i.aspectRatio=o/s,i.naturalWidth=o,i.naturalHeight=s,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,K(this.canvas,D({width:i.width,height:i.height},vt({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,n=i.naturalWidth*(e.width/e.naturalWidth),r=i.naturalHeight*(e.height/e.naturalHeight);D(i,{width:n,height:r,left:(e.width-n)/2,top:(e.height-r)/2}),K(this.image,D({width:i.width,height:i.height},vt(D({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,r={width:e.width,height:e.height};i&&(e.height*i>e.width?r.height=r.width/i:r.width=r.height*i),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*n),r.height=Math.max(r.minHeight,r.height*n),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=D({},r)},limitCropBox:function(t,e){var i=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=this.limited,l=i.aspectRatio;if(t){var f=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,c=s?Math.min(n.width,r.width,r.width+r.left,n.width-r.left):n.width,u=s?Math.min(n.height,r.height,r.height+r.top,n.height-r.top):n.height;f=Math.min(f,n.width),h=Math.min(h,n.height),l&&(f&&h?h*l>f?h=f/l:f=h*l:f?h=f/l:h&&(f=h*l),u*l>c?u=c/l:c=u*l),o.minWidth=Math.min(f,c),o.minHeight=Math.min(h,u),o.maxWidth=c,o.maxHeight=u}e&&(s?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(n.width,r.left+r.width)-o.width,o.maxTop=Math.min(n.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&>(this.face,mt,i.width>=e.width&&i.height>=e.height?Oe:Zt),K(this.cropBox,D({width:i.width,height:i.height},vt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ht(this.element,zt,this.getData())}},Wi={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,n=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",o=document.createElement("img");if(e&&(o.crossOrigin=e),o.src=n,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,!!i){var s=i;typeof i=="string"?s=t.ownerDocument.querySelectorAll(i):i.querySelector&&(s=[i]),this.previews=s,C(s,function(l){var f=document.createElement("img");gt(l,_t,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),e&&(f.crossOrigin=e),f.src=n,f.alt=r,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(f)})}},resetPreview:function(){C(this.previews,function(t){var e=Xt(t,_t);K(t,{width:e.width,height:e.height}),t.innerHTML=e.html,Ti(t,_t)})},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,n=i.width,r=i.height,o=t.width,s=t.height,l=i.left-e.left-t.left,f=i.top-e.top-t.top;!this.cropped||this.disabled||(K(this.viewBoxImage,D({width:o,height:s},vt(D({translateX:-l,translateY:-f},t)))),C(this.previews,function(h){var c=Xt(h,_t),u=c.width,v=c.height,m=u,x=v,g=1;n&&(g=u/n,x=r*g),r&&x>v&&(g=v/r,m=n*g,x=v),K(h,{width:m,height:x}),K(h.getElementsByTagName("img")[0],D({width:o*g,height:s*g},vt(D({translateX:-l*g,translateY:-f*g},t))))}))}},Yi={bind:function(){var t=this.element,e=this.options,i=this.cropper;k(e.cropstart)&&B(t,Wt,e.cropstart),k(e.cropmove)&&B(t,Ht,e.cropmove),k(e.cropend)&&B(t,Pt,e.cropend),k(e.crop)&&B(t,zt,e.crop),k(e.zoom)&&B(t,Yt,e.zoom),B(i,le,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&B(i,ve,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&B(i,ce,this.onDblclick=this.dblclick.bind(this)),B(t.ownerDocument,fe,this.onCropMove=this.cropMove.bind(this)),B(t.ownerDocument,ue,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&B(window,pe,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;k(e.cropstart)&&z(t,Wt,e.cropstart),k(e.cropmove)&&z(t,Ht,e.cropmove),k(e.cropend)&&z(t,Pt,e.cropend),k(e.crop)&&z(t,zt,e.crop),k(e.zoom)&&z(t,Yt,e.zoom),z(i,le,this.onCropStart),e.zoomable&&e.zoomOnWheel&&z(i,ve,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&z(i,ce,this.onDblclick),z(t.ownerDocument,fe,this.onCropMove),z(t.ownerDocument,ue,this.onCropEnd),e.responsive&&z(window,pe,this.onResize)}},Xi={resize:function(){if(!this.disabled){var t=this.options,e=this.container,i=this.containerData,n=e.offsetWidth/i.width,r=e.offsetHeight/i.height,o=Math.abs(n-1)>Math.abs(r-1)?n:r;if(o!==1){var s,l;t.restore&&(s=this.getCanvasData(),l=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(C(s,function(f,h){s[h]=f*o})),this.setCropBoxData(C(l,function(f,h){l[h]=f*o})))}}},dblclick:function(){this.disabled||this.options.dragMode===Re||this.setDragMode(Mi(this.dragBox,Lt)?Ce:Jt)},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(b(e)&&e!==1||b(i)&&i!==0||t.ctrlKey))){var n=this.options,r=this.pointers,o;t.changedTouches?C(t.changedTouches,function(s){r[s.identifier]=Et(s)}):r[t.pointerId||0]=Et(t),Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?o=Te:o=Xt(t.target,mt),!!vi.test(o)&&ht(this.element,Wt,{originalEvent:t,action:o})!==!1&&(t.preventDefault(),this.action=o,this.cropping=!1,o===Me&&(this.cropping=!0,A(this.dragBox,Mt)))}},cropMove:function(t){var e=this.action;if(!(this.disabled||!e)){var i=this.pointers;t.preventDefault(),ht(this.element,Ht,{originalEvent:t,action:e})!==!1&&(t.changedTouches?C(t.changedTouches,function(n){D(i[n.identifier]||{},Et(n,!0))}):D(i[t.pointerId||0]||{},Et(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?C(t.changedTouches,function(n){delete i[n.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ot(this.dragBox,Mt,this.cropped&&this.options.modal)),ht(this.element,Pt,{originalEvent:t,action:e}))}}},Ui={change:function(t){var e=this.options,i=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,l=e.aspectRatio,f=r.left,h=r.top,c=r.width,u=r.height,v=f+c,m=h+u,x=0,g=0,_=n.width,T=n.height,O=!0,w;!l&&t.shiftKey&&(l=c&&u?c/u:1),this.limited&&(x=r.minLeft,g=r.minTop,_=x+Math.min(n.width,i.width,i.left+i.width),T=g+Math.min(n.height,i.height,i.top+i.height));var M=o[Object.keys(o)[0]],d={x:M.endX-M.startX,y:M.endY-M.startY},y=function(L){switch(L){case et:v+d.x>_&&(d.x=_-v);break;case it:f+d.x<x&&(d.x=x-f);break;case F:h+d.y<g&&(d.y=g-h);break;case rt:m+d.y>T&&(d.y=T-m);break}};switch(s){case Zt:f+=d.x,h+=d.y;break;case et:if(d.x>=0&&(v>=_||l&&(h<=g||m>=T))){O=!1;break}y(et),c+=d.x,c<0&&(s=it,c=-c,f-=c),l&&(u=c/l,h+=(r.height-u)/2);break;case F:if(d.y<=0&&(h<=g||l&&(f<=x||v>=_))){O=!1;break}y(F),u-=d.y,h+=d.y,u<0&&(s=rt,u=-u,h-=u),l&&(c=u*l,f+=(r.width-c)/2);break;case it:if(d.x<=0&&(f<=x||l&&(h<=g||m>=T))){O=!1;break}y(it),c-=d.x,f+=d.x,c<0&&(s=et,c=-c,f-=c),l&&(u=c/l,h+=(r.height-u)/2);break;case rt:if(d.y>=0&&(m>=T||l&&(f<=x||v>=_))){O=!1;break}y(rt),u+=d.y,u<0&&(s=F,u=-u,h-=u),l&&(c=u*l,f+=(r.width-c)/2);break;case ft:if(l){if(d.y<=0&&(h<=g||v>=_)){O=!1;break}y(F),u-=d.y,h+=d.y,c=u*l}else y(F),y(et),d.x>=0?v<_?c+=d.x:d.y<=0&&h<=g&&(O=!1):c+=d.x,d.y<=0?h>g&&(u-=d.y,h+=d.y):(u-=d.y,h+=d.y);c<0&&u<0?(s=pt,u=-u,c=-c,h-=u,f-=c):c<0?(s=ut,c=-c,f-=c):u<0&&(s=dt,u=-u,h-=u);break;case ut:if(l){if(d.y<=0&&(h<=g||f<=x)){O=!1;break}y(F),u-=d.y,h+=d.y,c=u*l,f+=r.width-c}else y(F),y(it),d.x<=0?f>x?(c-=d.x,f+=d.x):d.y<=0&&h<=g&&(O=!1):(c-=d.x,f+=d.x),d.y<=0?h>g&&(u-=d.y,h+=d.y):(u-=d.y,h+=d.y);c<0&&u<0?(s=dt,u=-u,c=-c,h-=u,f-=c):c<0?(s=ft,c=-c,f-=c):u<0&&(s=pt,u=-u,h-=u);break;case pt:if(l){if(d.x<=0&&(f<=x||m>=T)){O=!1;break}y(it),c-=d.x,f+=d.x,u=c/l}else y(rt),y(it),d.x<=0?f>x?(c-=d.x,f+=d.x):d.y>=0&&m>=T&&(O=!1):(c-=d.x,f+=d.x),d.y>=0?m<T&&(u+=d.y):u+=d.y;c<0&&u<0?(s=ft,u=-u,c=-c,h-=u,f-=c):c<0?(s=dt,c=-c,f-=c):u<0&&(s=ut,u=-u,h-=u);break;case dt:if(l){if(d.x>=0&&(v>=_||m>=T)){O=!1;break}y(et),c+=d.x,u=c/l}else y(rt),y(et),d.x>=0?v<_?c+=d.x:d.y>=0&&m>=T&&(O=!1):c+=d.x,d.y>=0?m<T&&(u+=d.y):u+=d.y;c<0&&u<0?(s=ut,u=-u,c=-c,h-=u,f-=c):c<0?(s=pt,c=-c,f-=c):u<0&&(s=ft,u=-u,h-=u);break;case Oe:this.move(d.x,d.y),O=!1;break;case Te:this.zoom(Ri(o),t),O=!1;break;case Me:if(!d.x||!d.y){O=!1;break}w=Le(this.cropper),f=M.startX-w.left,h=M.startY-w.top,c=r.minWidth,u=r.minHeight,d.x>0?s=d.y>0?dt:ft:d.x<0&&(f-=c,s=d.y>0?pt:ut),d.y<0&&(h-=u),this.cropped||(Y(this.cropBox,S),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}O&&(r.width=c,r.height=u,r.left=f,r.top=h,this.action=s,this.renderCropBox()),C(o,function(R){R.startX=R.endX,R.startY=R.endY})}},ji={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&A(this.dragBox,Mt),Y(this.cropBox,S),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=D({},this.initialImageData),this.canvasData=D({},this.initialCanvasData),this.cropBoxData=D({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(D(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Y(this.dragBox,Mt),A(this.cropBox,S)),this},replace:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,C(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Y(this.cropper,se)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,A(this.cropper,se)),this},destroy:function(){var t=this.element;return t[E]?(t[E]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,n=i.left,r=i.top;return this.moveTo(kt(t)?t:n+Number(t),kt(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(b(t)&&(i.left=t,n=!0),b(e)&&(i.top=e,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var n=this.options,r=this.canvasData,o=r.width,s=r.height,l=r.naturalWidth,f=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var h=l*t,c=f*t;if(ht(this.element,Yt,{ratio:t,oldRatio:o/l,originalEvent:i})===!1)return this;if(i){var u=this.pointers,v=Le(this.cropper),m=u&&Object.keys(u).length?Ai(u):{pageX:i.pageX,pageY:i.pageY};r.left-=(h-o)*((m.pageX-v.left-r.left)/o),r.top-=(c-s)*((m.pageY-v.top-r.top)/s)}else nt(e)&&b(e.x)&&b(e.y)?(r.left-=(h-o)*((e.x-r.left)/o),r.top-=(c-s)*((e.y-r.top)/s)):(r.left-=(h-o)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),b(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,b(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(b(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(b(t)&&(i.scaleX=t,n=!0),b(e)&&(i.scaleY=e,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.options,i=this.imageData,n=this.canvasData,r=this.cropBoxData,o;if(this.ready&&this.cropped){o={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var s=i.width/i.naturalWidth;if(C(o,function(h,c){o[c]=h/s}),t){var l=Math.round(o.y+o.height),f=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=f-o.x,o.height=l-o.y}}else o={x:0,y:0,width:0,height:0};return e.rotatable&&(o.rotate=i.rotate||0),e.scalable&&(o.scaleX=i.scaleX||1,o.scaleY=i.scaleY||1),o},setData:function(t){var e=this.options,i=this.imageData,n=this.canvasData,r={};if(this.ready&&!this.disabled&&nt(t)){var o=!1;e.rotatable&&b(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(b(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),b(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=i.width/i.naturalWidth;b(t.x)&&(r.left=t.x*s+n.left),b(t.y)&&(r.top=t.y*s+n.top),b(t.width)&&(r.width=t.width*s),b(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?D({},this.containerData):{}},getImageData:function(){return this.sized?D({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&C(["left","top","width","height","naturalWidth","naturalHeight"],function(i){e[i]=t[i]}),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&nt(t)&&(b(t.left)&&(e.left=t.left),b(t.top)&&(e.top=t.top),b(t.width)?(e.width=t.width,e.height=t.width/i):b(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,e;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(t){var e=this.cropBoxData,i=this.options.aspectRatio,n,r;return this.ready&&this.cropped&&!this.disabled&&nt(t)&&(b(t.left)&&(e.left=t.left),b(t.top)&&(e.top=t.top),b(t.width)&&t.width!==e.width&&(n=!0,e.width=t.width),b(t.height)&&t.height!==e.height&&(r=!0,e.height=t.height),i&&(n?e.height=e.width/i:r&&(e.width=e.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,i=ki(this.image,this.imageData,e,t);if(!this.cropped)return i;var n=this.getData(),r=n.x,o=n.y,s=n.width,l=n.height,f=i.width/Math.floor(e.naturalWidth);f!==1&&(r*=f,o*=f,s*=f,l*=f);var h=s/l,c=Q({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),u=Q({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),v=Q({aspectRatio:h,width:t.width||(f!==1?i.width:s),height:t.height||(f!==1?i.height:l)}),m=v.width,x=v.height;m=Math.min(c.width,Math.max(u.width,m)),x=Math.min(c.height,Math.max(u.height,x));var g=document.createElement("canvas"),_=g.getContext("2d");g.width=st(m),g.height=st(x),_.fillStyle=t.fillColor||"transparent",_.fillRect(0,0,m,x);var T=t.imageSmoothingEnabled,O=T===void 0?!0:T,w=t.imageSmoothingQuality;_.imageSmoothingEnabled=O,w&&(_.imageSmoothingQuality=w);var M=i.width,d=i.height,y=r,R=o,L,V,J,$,q,P;y<=-s||y>M?(y=0,L=0,J=0,q=0):y<=0?(J=-y,y=0,L=Math.min(M,s+y),q=L):y<=M&&(J=0,L=Math.min(s,M-y),q=L),L<=0||R<=-l||R>d?(R=0,V=0,$=0,P=0):R<=0?($=-R,R=0,V=Math.min(d,l+R),P=V):R<=d&&($=0,V=Math.min(l,d-R),P=V);var N=[y,R,L,V];if(q>0&&P>0){var tt=m/s;N.push(J*tt,$*tt,q*tt,P*tt)}return _.drawImage.apply(_,[i].concat(De(N.map(function(xt){return Math.floor(st(xt))})))),g},setAspectRatio:function(t){var e=this.options;return!this.disabled&&!kt(t)&&(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var r=t===Jt,o=e.movable&&t===Ce;t=r||o?t:Re,e.dragMode=t,gt(i,mt,t),ot(i,Lt,r),ot(i,Bt,o),e.cropBoxMovable||(gt(n,mt,t),ot(n,Lt,r),ot(n,Bt,o))}return this}},Vi=X.Cropper,Gi=function(){function a(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ri(this,a),!t||!bi.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=D({},ge,nt(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return ni(a,[{key:"init",value:function(){var e=this.element,i=e.tagName.toLowerCase(),n;if(!e[E]){if(e[E]=this,i==="img"){if(this.isImg=!0,n=e.getAttribute("src")||"",this.originalUrl=n,!n)return;n=e.src}else i==="canvas"&&window.HTMLCanvasElement&&(n=e.toDataURL());this.load(n)}}},{key:"load",value:function(e){var i=this;if(!!e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(mi.test(e)){gi.test(e)?this.read(Li(e)):this.clone();return}var o=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=s,o.onerror=s,o.ontimeout=s,o.onprogress=function(){o.getResponseHeader("content-type")!==me&&o.abort()},o.onload=function(){i.read(o.response)},o.onloadend=function(){i.reloading=!1,i.xhr=null},r.checkCrossOrigin&&we(e)&&n.crossOrigin&&(e=ye(e)),o.open("GET",e,!0),o.responseType="arraybuffer",o.withCredentials=n.crossOrigin==="use-credentials",o.send()}}},{key:"read",value:function(e){var i=this.options,n=this.imageData,r=zi(e),o=0,s=1,l=1;if(r>1){this.url=Bi(e,me);var f=Pi(r);o=f.rotate,s=f.scaleX,l=f.scaleY}i.rotatable&&(n.rotate=o),i.scalable&&(n.scaleX=s,n.scaleY=l),this.clone()}},{key:"clone",value:function(){var e=this.element,i=this.url,n=e.crossOrigin,r=i;this.options.checkCrossOrigin&&we(i)&&(n||(n="anonymous"),r=ye(i)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||i,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),A(o,he),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var n=X.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(X.navigator.userAgent),r=function(f,h){D(e.imageData,{naturalWidth:f,naturalHeight:h,aspectRatio:f/h}),e.initialImageData=D({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(i.naturalWidth&&!n){r(i.naturalWidth,i.naturalHeight);return}var o=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||s.removeChild(o)},o.src=i.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(o))}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var e=this.element,i=this.options,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML=wi;var s=o.querySelector(".".concat(E,"-container")),l=s.querySelector(".".concat(E,"-canvas")),f=s.querySelector(".".concat(E,"-drag-box")),h=s.querySelector(".".concat(E,"-crop-box")),c=h.querySelector(".".concat(E,"-face"));this.container=r,this.cropper=s,this.canvas=l,this.dragBox=f,this.cropBox=h,this.viewBox=s.querySelector(".".concat(E,"-view-box")),this.face=c,l.appendChild(n),A(e,S),r.insertBefore(s,e.nextSibling),this.isImg||Y(n,he),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,A(h,S),i.guides||A(h.getElementsByClassName("".concat(E,"-dashed")),S),i.center||A(h.getElementsByClassName("".concat(E,"-center")),S),i.background&&A(s,"".concat(E,"-bg")),i.highlight||A(c,fi),i.cropBoxMovable&&(A(c,Bt),gt(c,mt,Zt)),i.cropBoxResizable||(A(h.getElementsByClassName("".concat(E,"-line")),S),A(h.getElementsByClassName("".concat(E,"-point")),S)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),k(i.ready)&&B(e,de,i.ready,{once:!0}),ht(e,de)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Y(this.element,S))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Vi,a}},{key:"setDefaults",value:function(e){D(ge,nt(e)&&e)}}]),a}();D(Gi.prototype,Hi,Wi,Yi,Xi,Ui,ji);var ze=function(){if(typeof Map<"u")return Map;function a(t,e){var i=-1;return t.some(function(n,r){return n[0]===e?(i=r,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var i=a(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},t.prototype.set=function(e,i){var n=a(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},t.prototype.delete=function(e){var i=this.__entries__,n=a(i,e);~n&&i.splice(n,1)},t.prototype.has=function(e){return!!~a(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,i){i===void 0&&(i=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(i,o[1],o[0])}},t}()}(),Ut=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),qi=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),Fi=2;function Ki(a,t){var e=!1,i=!1,n=0;function r(){e&&(e=!1,a()),i&&s()}function o(){qi(r)}function s(){var l=Date.now();if(e){if(l-n<Fi)return;i=!0}else e=!0,i=!1,setTimeout(o,t);n=l}return s}var Qi=20,Zi=["top","right","bottom","left","width","height","size","weight"],Ji=typeof MutationObserver<"u",$i=function(){function a(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Ki(this.refresh.bind(this),Qi)}return a.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},a.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},a.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},a.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},a.prototype.connect_=function(){!Ut||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ji?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},a.prototype.disconnect_=function(){!Ut||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},a.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=e===void 0?"":e,n=Zi.some(function(r){return!!~i.indexOf(r)});n&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),Pe=function(a,t){for(var e=0,i=Object.keys(t);e<i.length;e++){var n=i[e];Object.defineProperty(a,n,{value:t[n],enumerable:!1,writable:!1,configurable:!0})}return a},lt=function(a){var t=a&&a.ownerDocument&&a.ownerDocument.defaultView;return t||Ot},He=Rt(0,0,0,0);function Tt(a){return parseFloat(a)||0}function xe(a){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(i,n){var r=a["border-"+n+"-width"];return i+Tt(r)},0)}function ta(a){for(var t=["top","right","bottom","left"],e={},i=0,n=t;i<n.length;i++){var r=n[i],o=a["padding-"+r];e[r]=Tt(o)}return e}function ea(a){var t=a.getBBox();return Rt(0,0,t.width,t.height)}function ia(a){var t=a.clientWidth,e=a.clientHeight;if(!t&&!e)return He;var i=lt(a).getComputedStyle(a),n=ta(i),r=n.left+n.right,o=n.top+n.bottom,s=Tt(i.width),l=Tt(i.height);if(i.boxSizing==="border-box"&&(Math.round(s+r)!==t&&(s-=xe(i,"left","right")+r),Math.round(l+o)!==e&&(l-=xe(i,"top","bottom")+o)),!ra(a)){var f=Math.round(s+r)-t,h=Math.round(l+o)-e;Math.abs(f)!==1&&(s-=f),Math.abs(h)!==1&&(l-=h)}return Rt(n.left,n.top,s,l)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(a){return a instanceof lt(a).SVGGraphicsElement}:function(a){return a instanceof lt(a).SVGElement&&typeof a.getBBox=="function"}}();function ra(a){return a===lt(a).document.documentElement}function na(a){return Ut?aa(a)?ea(a):ia(a):He}function oa(a){var t=a.x,e=a.y,i=a.width,n=a.height,r=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(r.prototype);return Pe(o,{x:t,y:e,width:i,height:n,top:e,right:t+i,bottom:n+e,left:t}),o}function Rt(a,t,e,i){return{x:a,y:t,width:e,height:i}}var sa=function(){function a(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Rt(0,0,0,0),this.target=t}return a.prototype.isActive=function(){var t=na(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},a}(),ha=function(){function a(t,e){var i=oa(e);Pe(this,{target:t,contentRect:i})}return a}(),ca=function(){function a(t,e,i){if(this.activeObservations_=[],this.observations_=new ze,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return a.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof lt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new sa(t)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof lt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},a.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(i){return new ha(i.target,i.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),We=typeof WeakMap<"u"?new WeakMap:new ze,Ye=function(){function a(t){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=$i.getInstance(),i=new ca(t,e,this);We.set(this,i)}return a}();["observe","unobserve","disconnect"].forEach(function(a){Ye.prototype[a]=function(){var t;return(t=We.get(this))[a].apply(t,arguments)}});var ba=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:Ye}();function _e(a){let t,e,i,n,r,o;const s=[fa,la],l=[];function f(h,c){return h[1]==="video"?0:1}return e=f(a),i=l[e]=s[e](a),{c(){t=ct("button"),i.c(),p(t,"class","rounded-xl w-10 h-10 flex justify-center items-center absolute inset-x-0 bottom-2 md:bottom-4 xl:bottom-8 m-auto drop-shadow-lg bg-black/90")},m(h,c){U(h,t,c),l[e].m(t,null),n=!0,r||(o=je(t,"click",function(){Ve(a[1]==="image"?a[5]:a[6])&&(a[1]==="image"?a[5]:a[6]).apply(this,arguments)}),r=!0)},p(h,c){a=h;let u=e;e=f(a),e===u?l[e].p(a,c):(jt(),G(l[u],1,1,()=>{l[u]=null}),Vt(),i=l[e],i?i.p(a,c):(i=l[e]=s[e](a),i.c()),W(i,1),i.m(t,null))},i(h){n||(W(i),n=!0)},o(h){G(i),n=!1},d(h){h&&j(t),l[e].d(),r=!1,o()}}}function la(a){let t,e,i;return e=new Je({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","w-2/4 h-2/4 text-white opacity-80")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},p:I,i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function fa(a){let t,e,i,n;const r=[da,ua],o=[];function s(l,f){return l[4]?0:1}return t=s(a),e=o[t]=r[t](a),{c(){e.c(),i=Ke()},m(l,f){o[t].m(l,f),U(l,i,f),n=!0},p(l,f){let h=t;t=s(l),t!==h&&(jt(),G(o[h],1,1,()=>{o[h]=null}),Vt(),e=o[t],e||(e=o[t]=r[t](l),e.c()),W(e,1),e.m(i.parentNode,i))},i(l){n||(W(e),n=!0)},o(l){G(e),n=!1},d(l){o[t].d(l),l&&j(i)}}}function ua(a){let t,e,i;return e=new ti({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","w-2/4 h-2/4 dark:text-white opacity-80")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function da(a){let t,e,i;return e=new ii({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","w-2/4 h-2/4 dark:text-white opacity-80")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function pa(a){let t,e,i,n,r=!a[0]&&_e(a);return{c(){t=ct("div"),e=ct("video"),i=Ge(),r&&r.c(),p(e,"class","h-full w-full "),re(e,"scale-x-[-1]",a[2]),p(t,"class","h-full min-h-[15rem] w-full relative")},m(o,s){U(o,t,s),Z(t,e),a[9](e),Z(t,i),r&&r.m(t,null),n=!0},p(o,[s]){s&4&&re(e,"scale-x-[-1]",o[2]),o[0]?r&&(jt(),G(r,1,1,()=>{r=null}),Vt()):r?(r.p(o,s),s&1&&W(r,1)):(r=_e(o),r.c(),W(r,1),r.m(t,null))},i(o){n||(W(r),n=!0)},o(o){G(r),n=!1},d(o){o&&j(t),a[9](null),r&&r.d()}}}function va(a,t,e){let i,n,{streaming:r=!1}=t,{pending:o=!1}=t,{mode:s="image"}=t,{mirror_webcam:l}=t,{include_audio:f}=t;const h=qe();Fe(()=>n=document.createElement("canvas"));async function c(){try{x=await navigator.mediaDevices.getUserMedia({video:!0,audio:f}),e(3,i.srcObject=x,i),e(3,i.muted=!0,i),i.play()}catch(w){if(w instanceof DOMException&&w.name=="NotAllowedError")return h("error","Please allow access to the webcam for recording."),null;throw w}}function u(){var w=n.getContext("2d");if(i.videoWidth&&i.videoHeight){n.width=i.videoWidth,n.height=i.videoHeight,w.drawImage(i,0,0,i.videoWidth,i.videoHeight);var M=n.toDataURL("image/png");h(r?"stream":"capture",M)}}let v=!1,m=[],x,g,_;function T(){if(v){_.stop();let w=new Blob(m,{type:g}),M=new FileReader;M.onload=function(d){d.target&&h("capture",{data:d.target.result,name:"sample."+g.substring(6),is_example:!1})},M.readAsDataURL(w)}else{m=[];let w=["video/webm","video/mp4"];for(let M of w)if(MediaRecorder.isTypeSupported(M)){g=M;break}if(g===null){console.error("No supported MediaRecorder mimeType");return}_=new MediaRecorder(x,{mimeType:g}),_.addEventListener("dataavailable",function(M){m.push(M.data)}),_.start(200)}e(4,v=!v)}c(),r&&s==="image"&&window.setInterval(()=>{i&&!o&&u()},500);function O(w){Qe[w?"unshift":"push"](()=>{i=w,e(3,i)})}return a.$$set=w=>{"streaming"in w&&e(0,r=w.streaming),"pending"in w&&e(7,o=w.pending),"mode"in w&&e(1,s=w.mode),"mirror_webcam"in w&&e(2,l=w.mirror_webcam),"include_audio"in w&&e(8,f=w.include_audio)},[r,s,l,i,v,u,T,o,f,O]}class wa extends bt{constructor(t){super(),wt(this,t,va,pa,yt,{streaming:0,pending:7,mode:1,mirror_webcam:2,include_audio:8})}}export{Gi as C,ga as U,wa as W,ba as i};
|
11 |
+
//# sourceMappingURL=Webcam.8816836e.js.map
|
gradio-modified/templates/frontend/assets/_commonjsHelpers.88e99c8f.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{r as a,o as c,n as g};
|
2 |
+
//# sourceMappingURL=_commonjsHelpers.88e99c8f.js.map
|
gradio-modified/templates/frontend/assets/color.509e5f03.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{aj as o}from"./index.396f4a72.js";const t=r=>o[r%o.length];export{t as g};
|
2 |
+
//# sourceMappingURL=color.509e5f03.js.map
|
gradio-modified/templates/frontend/assets/csv.27f5436c.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{d as a}from"./dsv.7fe76a93.js";var s=a(","),v=s.parse,o=s.parseRows;export{v as a,o as c};
|
2 |
+
//# sourceMappingURL=csv.27f5436c.js.map
|
gradio-modified/templates/frontend/assets/dsv.7fe76a93.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var D={},A={},E=34,m=10,R=13;function I(r){return new Function("d","return {"+r.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function B(r,t){var e=I(r);return function(a,c){return t(e(a),c,r)}}function F(r){var t=Object.create(null),e=[];return r.forEach(function(a){for(var c in a)c in t||e.push(t[c]=c)}),e}function f(r,t){var e=r+"",a=e.length;return a<t?new Array(t-a+1).join(0)+e:e}function L(r){return r<0?"-"+f(-r,6):r>9999?"+"+f(r,6):f(r,4)}function S(r){var t=r.getUTCHours(),e=r.getUTCMinutes(),a=r.getUTCSeconds(),c=r.getUTCMilliseconds();return isNaN(r)?"Invalid Date":L(r.getUTCFullYear())+"-"+f(r.getUTCMonth()+1,2)+"-"+f(r.getUTCDate(),2)+(c?"T"+f(t,2)+":"+f(e,2)+":"+f(a,2)+"."+f(c,3)+"Z":a?"T"+f(t,2)+":"+f(e,2)+":"+f(a,2)+"Z":e||t?"T"+f(t,2)+":"+f(e,2)+"Z":"")}function Z(r){var t=new RegExp('["'+r+`
|
2 |
+
\r]`),e=r.charCodeAt(0);function a(n,o){var s,i,u=c(n,function(h,l){if(s)return s(h,l-1);i=h,s=o?B(h,o):I(h)});return u.columns=i||[],u}function c(n,o){var s=[],i=n.length,u=0,h=0,l,v=i<=0,C=!1;n.charCodeAt(i-1)===m&&--i,n.charCodeAt(i-1)===R&&--i;function w(){if(v)return A;if(C)return C=!1,D;var j,d=u,p;if(n.charCodeAt(d)===E){for(;u++<i&&n.charCodeAt(u)!==E||n.charCodeAt(++u)===E;);return(j=u)>=i?v=!0:(p=n.charCodeAt(u++))===m?C=!0:p===R&&(C=!0,n.charCodeAt(u)===m&&++u),n.slice(d+1,j-1).replace(/""/g,'"')}for(;u<i;){if((p=n.charCodeAt(j=u++))===m)C=!0;else if(p===R)C=!0,n.charCodeAt(u)===m&&++u;else if(p!==e)continue;return n.slice(d,j)}return v=!0,n.slice(d,i)}for(;(l=w())!==A;){for(var T=[];l!==D&&l!==A;)T.push(l),l=w();o&&(T=o(T,h++))==null||s.push(T)}return s}function U(n,o){return n.map(function(s){return o.map(function(i){return g(s[i])}).join(r)})}function O(n,o){return o==null&&(o=F(n)),[o.map(g).join(r)].concat(U(n,o)).join(`
|
3 |
+
`)}function M(n,o){return o==null&&(o=F(n)),U(n,o).join(`
|
4 |
+
`)}function b(n){return n.map(N).join(`
|
5 |
+
`)}function N(n){return n.map(g).join(r)}function g(n){return n==null?"":n instanceof Date?S(n):t.test(n+="")?'"'+n.replace(/"/g,'""')+'"':n}return{parse:a,parseRows:c,format:O,formatBody:M,formatRows:b,formatRow:N,formatValue:g}}export{Z as d};
|
6 |
+
//# sourceMappingURL=dsv.7fe76a93.js.map
|
gradio-modified/templates/frontend/assets/index.020a69e0.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{ar as r}from"./index.396f4a72.js";const e=["static","dynamic"],o=t=>({type:"string",description:"text string",example_data:t.value||"hello world"});export{r as Component,o as document,e as modes};
|
2 |
+
//# sourceMappingURL=index.020a69e0.js.map
|
gradio-modified/templates/frontend/assets/index.03f37f65.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
gradio-modified/templates/frontend/assets/index.04164205.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as L,i as M,s as w,e as S,b as c,d as _,f as g,x as H,n as d,F as j,P as C,c as h,m as b,j as v,k,o as T,R as q,T as B,a as D,U as E,V as F,K}from"./index.396f4a72.js";function P(n){let e;return{c(){e=S("div"),c(e,"class","output-html"),c(e,"id",n[0]),_(e,"min-h-[6rem]",n[3]),_(e,"!hidden",!n[2])},m(s,i){g(s,e,i),e.innerHTML=n[1]},p(s,[i]){i&2&&(e.innerHTML=s[1]),i&1&&c(e,"id",s[0]),i&8&&_(e,"min-h-[6rem]",s[3]),i&4&&_(e,"!hidden",!s[2])},i:H,o:H,d(s){s&&d(e)}}}function R(n,e,s){let{elem_id:i=""}=e,{value:a}=e,{visible:l=!0}=e,{min_height:f=!1}=e;const r=j();return n.$$set=t=>{"elem_id"in t&&s(0,i=t.elem_id),"value"in t&&s(1,a=t.value),"visible"in t&&s(2,l=t.visible),"min_height"in t&&s(3,f=t.min_height)},n.$$.update=()=>{n.$$.dirty&2&&r("change")},[i,a,l,f]}class U extends L{constructor(e){super(),M(this,e,R,P,w,{elem_id:0,value:1,visible:2,min_height:3})}}function V(n){let e,s,i,a,l;const f=[n[3],{variant:"center"}];let r={};for(let t=0;t<f.length;t+=1)r=q(r,f[t]);return e=new B({props:r}),a=new U({props:{min_height:n[3]&&n[3]?.status!=="complete",value:n[2],elem_id:n[0],visible:n[1]}}),a.$on("change",n[5]),{c(){h(e.$$.fragment),s=D(),i=S("div"),h(a.$$.fragment),c(i,"class","transition"),_(i,"opacity-20",n[3]?.status==="pending")},m(t,m){b(e,t,m),g(t,s,m),g(t,i,m),b(a,i,null),l=!0},p(t,m){const u=m&8?E(f,[F(t[3]),f[1]]):{};e.$set(u);const o={};m&8&&(o.min_height=t[3]&&t[3]?.status!=="complete"),m&4&&(o.value=t[2]),m&1&&(o.elem_id=t[0]),m&2&&(o.visible=t[1]),a.$set(o),m&8&&_(i,"opacity-20",t[3]?.status==="pending")},i(t){l||(v(e.$$.fragment,t),v(a.$$.fragment,t),l=!0)},o(t){k(e.$$.fragment,t),k(a.$$.fragment,t),l=!1},d(t){T(e,t),t&&d(s),t&&d(i),T(a)}}}function z(n){let e,s;return e=new C({props:{visible:n[1],elem_id:n[0],disable:!0,$$slots:{default:[V]},$$scope:{ctx:n}}}),{c(){h(e.$$.fragment)},m(i,a){b(e,i,a),s=!0},p(i,[a]){const l={};a&2&&(l.visible=i[1]),a&1&&(l.elem_id=i[0]),a&143&&(l.$$scope={dirty:a,ctx:i}),e.$set(l)},i(i){s||(v(e.$$.fragment,i),s=!0)},o(i){k(e.$$.fragment,i),s=!1},d(i){T(e,i)}}}function A(n,e,s){let{label:i}=e,{elem_id:a=""}=e,{visible:l=!0}=e,{value:f=""}=e,{loading_status:r}=e;const t=j();function m(u){K.call(this,n,u)}return n.$$set=u=>{"label"in u&&s(4,i=u.label),"elem_id"in u&&s(0,a=u.elem_id),"visible"in u&&s(1,l=u.visible),"value"in u&&s(2,f=u.value),"loading_status"in u&&s(3,r=u.loading_status)},n.$$.update=()=>{n.$$.dirty&16&&t("change")},[a,l,f,r,i,m]}class G extends L{constructor(e){super(),M(this,e,A,z,w,{label:4,elem_id:0,visible:1,value:2,loading_status:3})}}var J=G;const N=["static"],O=n=>({type:"string",description:"HTML output"});export{J as Component,O as document,N as modes};
|
2 |
+
//# sourceMappingURL=index.04164205.js.map
|
gradio-modified/templates/frontend/assets/index.044a1523.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{S as Y,i as Z,s as q,w as L,b as c,f as m,g as k,x as M,n as g,B as ne,a6 as P,e as v,Y as B,t as V,a as T,h as D,C as F,l as z,A as ie,d as A,P as ae,c as O,m as R,j as y,k as H,o as S,F as fe,R as ce,T as ue,U as _e,V as de,D as U,E as G}from"./index.396f4a72.js";import{g as me}from"./color.509e5f03.js";import{B as ge}from"./BlockLabel.37da86a3.js";function he(s){let e,n,l;return{c(){e=L("svg"),n=L("path"),l=L("path"),c(n,"fill","currentColor"),c(n,"d","M12 15H5a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5V5a1 1 0 0 0-1-1H3V2h6a3 3 0 0 1 3 3zM5 9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h5V9zm15 14v2a1 1 0 0 0 1 1h5v-4h-5a1 1 0 0 0-1 1z"),c(l,"fill","currentColor"),c(l,"d","M2 30h28V2Zm26-2h-7a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5v-2a1 1 0 0 0-1-1h-6v-2h6a3 3 0 0 1 3 3Z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),c(e,"aria-hidden","true"),c(e,"role","img"),c(e,"class","iconify iconify--carbon"),c(e,"width","100%"),c(e,"height","100%"),c(e,"preserveAspectRatio","xMidYMid meet"),c(e,"viewBox","0 0 32 32")},m(o,r){m(o,e,r),k(e,n),k(e,l)},p:M,i:M,o:M,d(o){o&&g(e)}}}class oe extends Y{constructor(e){super(),Z(this,e,null,he,q,{})}}function J(s,e,n){const l=s.slice();return l[15]=e[n][0],l[22]=e[n][1],l}function K(s,e,n){const l=s.slice();return l[15]=e[n][0],l[16]=e[n][1],l}function Q(s,e,n){const l=s.slice();return l[16]=e[n][0],l[19]=e[n][1],l[21]=n,l}function be(s){let e,n,l=s[1]&&W(),o=s[0],r=[];for(let t=0;t<o.length;t+=1)r[t]=X(J(s,o,t));return{c(){l&&l.c(),e=T(),n=v("div");for(let t=0;t<r.length;t+=1)r[t].c();c(n,"class","textfield p-2 bg-white dark:bg-gray-800 rounded box-border max-w-full break-word leading-7"),c(n,"data-testid","highlighted-text:textfield")},m(t,i){l&&l.m(t,i),m(t,e,i),m(t,n,i);for(let a=0;a<r.length;a+=1)r[a].m(n,null)},p(t,i){if(t[1]?l||(l=W(),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),i&1){o=t[0];let a;for(a=0;a<o.length;a+=1){const d=J(t,o,a);r[a]?r[a].p(d,i):(r[a]=X(d),r[a].c(),r[a].m(n,null))}for(;a<r.length;a+=1)r[a].d(1);r.length=o.length}},d(t){l&&l.d(t),t&&g(e),t&&g(n),F(r,t)}}}function pe(s){let e,n,l=s[1]&&x(s),o=s[0],r=[];for(let t=0;t<o.length;t+=1)r[t]=le(K(s,o,t));return{c(){l&&l.c(),e=T(),n=v("div");for(let t=0;t<r.length;t+=1)r[t].c();c(n,"class","textfield bg-white dark:bg-transparent rounded-sm text-sm box-border max-w-full break-word leading-7 mt-7"),c(n,"data-testid","highlighted-text:textfield")},m(t,i){l&&l.m(t,i),m(t,e,i),m(t,n,i);for(let a=0;a<r.length;a+=1)r[a].m(n,null)},p(t,i){if(t[1]?l?l.p(t,i):(l=x(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),i&15){o=t[0];let a;for(a=0;a<o.length;a+=1){const d=K(t,o,a);r[a]?r[a].p(d,i):(r[a]=le(d),r[a].c(),r[a].m(n,null))}for(;a<r.length;a+=1)r[a].d(1);r.length=o.length}},d(t){l&&l.d(t),t&&g(e),t&&g(n),F(r,t)}}}function W(s){let e;return{c(){e=v("div"),e.innerHTML=`<span>-1</span>
|
2 |
+
<span>0</span>
|
3 |
+
<span>+1</span>`,c(e,"class","color_legend flex px-2 py-1 justify-between rounded mb-3 font-semibold mt-7"),c(e,"data-testid","highlighted-text:color-legend"),B(e,"background","-webkit-linear-gradient(to right,#8d83d6,(255,255,255,0),#eb4d4b)"),B(e,"background","linear-gradient(to right,#8d83d6,rgba(255,255,255,0),#eb4d4b)")},m(n,l){m(n,e,l)},d(n){n&&g(e)}}}function X(s){let e,n,l=s[15]+"",o,r,t;return{c(){e=v("span"),n=v("span"),o=V(l),r=T(),c(n,"class","text dark:text-white"),c(e,"class","textspan p-1 mr-0.5 bg-opacity-20 dark:bg-opacity-80 rounded-sm"),c(e,"style",t="background-color: rgba("+(s[22]<0?"141, 131, 214,"+-s[22]:"235, 77, 75,"+s[22])+")")},m(i,a){m(i,e,a),k(e,n),k(n,o),k(e,r)},p(i,a){a&1&&l!==(l=i[15]+"")&&D(o,l),a&1&&t!==(t="background-color: rgba("+(i[22]<0?"141, 131, 214,"+-i[22]:"235, 77, 75,"+i[22])+")")&&c(e,"style",t)},d(i){i&&g(e)}}}function x(s){let e,n=Object.entries(s[2]),l=[];for(let o=0;o<n.length;o+=1)l[o]=$(Q(s,n,o));return{c(){e=v("div");for(let o=0;o<l.length;o+=1)l[o].c();c(e,"class","category-legend flex flex-wrap gap-1 mb-2 text-black mt-7"),c(e,"data-testid","highlighted-text:category-legend")},m(o,r){m(o,e,r);for(let t=0;t<l.length;t+=1)l[t].m(e,null)},p(o,r){if(r&100){n=Object.entries(o[2]);let t;for(t=0;t<n.length;t+=1){const i=Q(o,n,t);l[t]?l[t].p(i,r):(l[t]=$(i),l[t].c(),l[t].m(e,null))}for(;t<l.length;t+=1)l[t].d(1);l.length=n.length}},d(o){o&&g(e),F(l,o)}}}function $(s){let e,n=s[16]+"",l,o,r,t,i;function a(){return s[8](s[16])}function d(){return s[9](s[16])}return{c(){e=v("div"),l=V(n),o=T(),c(e,"class","category-label px-2 rounded-sm font-semibold cursor-pointer"),c(e,"style",r="background-color:"+s[19].secondary)},m(u,p){m(u,e,p),k(e,l),k(e,o),t||(i=[z(e,"mouseover",a),z(e,"focus",d),z(e,"mouseout",s[10]),z(e,"blur",s[11])],t=!0)},p(u,p){s=u,p&4&&n!==(n=s[16]+"")&&D(l,n),p&4&&r!==(r="background-color:"+s[19].secondary)&&c(e,"style",r)},d(u){u&&g(e),t=!1,ie(i)}}}function ee(s){let e,n,l=s[16]+"",o,r;return{c(){e=V("\xA0"),n=v("span"),o=V(l),r=T(),c(n,"class","label mr-[-4px] font-bold uppercase text-xs inline-category text-white rounded-sm px-[0.325rem] mt-[0.05rem] py-[0.05rem] transition-colors svelte-o4yfdm"),B(n,"background-color",s[16]===null||s[3]&&s[3]!==s[16]?"":s[2][s[16]].primary,!1)},m(t,i){m(t,e,i),m(t,n,i),k(n,o),m(t,r,i)},p(t,i){i&1&&l!==(l=t[16]+"")&&D(o,l),i&13&&B(n,"background-color",t[16]===null||t[3]&&t[3]!==t[16]?"":t[2][t[16]].primary,!1)},d(t){t&&g(e),t&&g(n),t&&g(r)}}}function le(s){let e,n,l=s[15]+"",o,r,t=!s[1]&&s[16]!==null&&ee(s);return{c(){e=v("span"),n=v("span"),o=V(l),r=T(),t&&t.c(),c(n,"class","text "),c(e,"class","textspan rounded-sm px-1 transition-colors text-black pb-[0.225rem] pt-[0.15rem] svelte-o4yfdm"),A(e,"dark:text-white",s[16]===null||s[3]&&s[3]!==s[16]),A(e,"hl",s[16]!==null),B(e,"background-color",s[16]===null||s[3]&&s[3]!==s[16]?"":s[2][s[16]].secondary,!1)},m(i,a){m(i,e,a),k(e,n),k(n,o),k(e,r),t&&t.m(e,null)},p(i,a){a&1&&l!==(l=i[15]+"")&&D(o,l),!i[1]&&i[16]!==null?t?t.p(i,a):(t=ee(i),t.c(),t.m(e,null)):t&&(t.d(1),t=null),a&9&&A(e,"dark:text-white",i[16]===null||i[3]&&i[3]!==i[16]),a&1&&A(e,"hl",i[16]!==null),a&13&&B(e,"background-color",i[16]===null||i[3]&&i[3]!==i[16]?"":i[2][i[16]].secondary,!1)},d(i){i&&g(e),t&&t.d()}}}function ke(s){let e;function n(r,t){return r[4]==="categories"?pe:be}let l=n(s),o=l(s);return{c(){o.c(),e=ne()},m(r,t){o.m(r,t),m(r,e,t)},p(r,[t]){l===(l=n(r))&&o?o.p(r,t):(o.d(1),o=l(r),o&&(o.c(),o.m(e.parentNode,e)))},i:M,o:M,d(r){o.d(r),r&&g(e)}}}function ve(s,e,n){const l=typeof document<"u";let{value:o=[]}=e,{show_legend:r=!1}=e,{color_map:t={}}=e,i,a={},d="";function u(h,w){if(!i){var j=document.createElement("canvas");i=j.getContext("2d")}i.fillStyle=h,i.fillRect(0,0,1,1);const[I,re,se]=i.getImageData(0,0,1,1).data;return i.clearRect(0,0,1,1),`rgba(${I}, ${re}, ${se}, ${255/w})`}let p;function _(h){n(3,d=h)}function C(){n(3,d="")}const f=h=>_(h),b=h=>_(h),E=()=>C(),N=()=>C();return s.$$set=h=>{"value"in h&&n(0,o=h.value),"show_legend"in h&&n(1,r=h.show_legend),"color_map"in h&&n(7,t=h.color_map)},s.$$.update=()=>{if(s.$$.dirty&129){let h=function(){for(const w in t){const j=t[w].trim();j in P?n(2,a[w]=P[j],a):n(2,a[w]={primary:l?u(t[w],1):t[w],secondary:l?u(t[w],.5):t[w]},a)}};if(t||n(7,t={}),o.length>0){for(let[w,j]of o)if(j!==null)if(typeof j=="string"){if(n(4,p="categories"),!(j in t)){let I=me(Object.keys(t).length);n(7,t[j]=I,t)}}else n(4,p="scores")}h()}},[o,r,a,d,p,_,C,t,f,b,E,N]}class we extends Y{constructor(e){super(),Z(this,e,ve,ke,q,{value:0,show_legend:1,color_map:7})}}function te(s){let e,n;return e=new ge({props:{Icon:oe,label:s[5],disable:typeof s[0].container=="boolean"&&!s[0].container}}),{c(){O(e.$$.fragment)},m(l,o){R(e,l,o),n=!0},p(l,o){const r={};o&32&&(r.label=l[5]),o&1&&(r.disable=typeof l[0].container=="boolean"&&!l[0].container),e.$set(r)},i(l){n||(y(e.$$.fragment,l),n=!0)},o(l){H(e.$$.fragment,l),n=!1},d(l){S(e,l)}}}function ye(s){let e,n,l,o;return l=new oe({}),{c(){e=v("div"),n=v("div"),O(l.$$.fragment),c(n,"class","h-5 dark:text-white opacity-50"),c(e,"class","h-full min-h-[6rem] flex justify-center items-center")},m(r,t){m(r,e,t),k(e,n),R(l,n,null),o=!0},p:M,i(r){o||(y(l.$$.fragment,r),o=!0)},o(r){H(l.$$.fragment,r),o=!1},d(r){r&&g(e),S(l)}}}function je(s){let e,n;return e=new we({props:{value:s[3],show_legend:s[4],color_map:s[0].color_map}}),{c(){O(e.$$.fragment)},m(l,o){R(e,l,o),n=!0},p(l,o){const r={};o&8&&(r.value=l[3]),o&16&&(r.show_legend=l[4]),o&1&&(r.color_map=l[0].color_map),e.$set(r)},i(l){n||(y(e.$$.fragment,l),n=!0)},o(l){H(e.$$.fragment,l),n=!1},d(l){S(e,l)}}}function He(s){let e,n,l,o,r,t,i;const a=[s[6]];let d={};for(let f=0;f<a.length;f+=1)d=ce(d,a[f]);e=new ue({props:d});let u=s[5]&&te(s);const p=[je,ye],_=[];function C(f,b){return f[3]?0:1}return o=C(s),r=_[o]=p[o](s),{c(){O(e.$$.fragment),n=T(),u&&u.c(),l=T(),r.c(),t=ne()},m(f,b){R(e,f,b),m(f,n,b),u&&u.m(f,b),m(f,l,b),_[o].m(f,b),m(f,t,b),i=!0},p(f,b){const E=b&64?_e(a,[de(f[6])]):{};e.$set(E),f[5]?u?(u.p(f,b),b&32&&y(u,1)):(u=te(f),u.c(),y(u,1),u.m(l.parentNode,l)):u&&(U(),H(u,1,1,()=>{u=null}),G());let N=o;o=C(f),o===N?_[o].p(f,b):(U(),H(_[N],1,1,()=>{_[N]=null}),G(),r=_[o],r?r.p(f,b):(r=_[o]=p[o](f),r.c()),y(r,1),r.m(t.parentNode,t))},i(f){i||(y(e.$$.fragment,f),y(u),y(r),i=!0)},o(f){H(e.$$.fragment,f),H(u),H(r),i=!1},d(f){S(e,f),f&&g(n),u&&u.d(f),f&&g(l),_[o].d(f),f&&g(t)}}}function Te(s){let e,n;return e=new ae({props:{test_id:"highlighted-text",visible:s[2],elem_id:s[1],disable:typeof s[0].container=="boolean"&&!s[0].container,$$slots:{default:[He]},$$scope:{ctx:s}}}),{c(){O(e.$$.fragment)},m(l,o){R(e,l,o),n=!0},p(l,[o]){const r={};o&4&&(r.visible=l[2]),o&2&&(r.elem_id=l[1]),o&1&&(r.disable=typeof l[0].container=="boolean"&&!l[0].container),o&633&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){n||(y(e.$$.fragment,l),n=!0)},o(l){H(e.$$.fragment,l),n=!1},d(l){S(e,l)}}}function Ce(s,e,n){let{elem_id:l=""}=e,{visible:o=!0}=e,{value:r}=e,{show_legend:t}=e,{color_map:i={}}=e,{label:a}=e,{style:d={}}=e,{loading_status:u}=e;const p=fe();return s.$$set=_=>{"elem_id"in _&&n(1,l=_.elem_id),"visible"in _&&n(2,o=_.visible),"value"in _&&n(3,r=_.value),"show_legend"in _&&n(4,t=_.show_legend),"color_map"in _&&n(7,i=_.color_map),"label"in _&&n(5,a=_.label),"style"in _&&n(0,d=_.style),"loading_status"in _&&n(6,u=_.loading_status)},s.$$.update=()=>{s.$$.dirty&129&&!d.color_map&&Object.keys(i).length&&n(0,d.color_map=i,d),s.$$.dirty&8&&p("change")},[d,l,o,r,t,a,u,i]}class Me extends Y{constructor(e){super(),Z(this,e,Ce,Te,q,{elem_id:1,visible:2,value:3,show_legend:4,color_map:7,label:5,style:0,loading_status:6})}}var Oe=Me;const Re=["static"],Se=s=>({type:"Array<[string, string | number]>",description:"list of text spans and corresponding label / value"});export{Oe as Component,Se as document,Re as modes};
|
4 |
+
//# sourceMappingURL=index.044a1523.js.map
|
gradio-modified/templates/frontend/assets/index.10851bbc.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.gallery-item.svelte-1g9btlg.svelte-1g9btlg{position:relative;aspect-ratio:1 / 1;height:100%;width:100%;overflow:hidden;border-radius:.25rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));object-fit:fill;--tw-shadow:0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgb(229 231 235 / var(--tw-ring-opacity)) }.gallery-item.svelte-1g9btlg.svelte-1g9btlg:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgb(255 176 102 / var(--tw-ring-opacity));--tw-brightness:brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.gallery-item.svelte-1g9btlg.svelte-1g9btlg:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246 / var(--tw-ring-opacity)) }.dark.svelte-1g9btlg .gallery-item.svelte-1g9btlg{--tw-bg-opacity:1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}
|
gradio-modified/templates/frontend/assets/index.164edf37.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{S as fe,i as ce,s as de,e as E,b as y,d as D,f as C,a8 as ye,l as F,n as H,A as ge,a as j,x as X,K as Ae,I as P,t as _e,h as he,a3 as rt,B as at,g as T,O as x,c as Z,m as G,L as $,j as V,k as Y,o as Q,F as qe,aa as N,w as ve,D as ie,ab as se,ac as ue,E as oe,R as it,T as st,U as ut,V as ot}from"./index.396f4a72.js";import{U as ft}from"./Upload.5d0148e8.js";import{d as ct}from"./dsv.7fe76a93.js";var De=Object.prototype.hasOwnProperty;function ee(n,e){var t,l;if(n===e)return!0;if(n&&e&&(t=n.constructor)===e.constructor){if(t===Date)return n.getTime()===e.getTime();if(t===RegExp)return n.toString()===e.toString();if(t===Array){if((l=n.length)===e.length)for(;l--&&ee(n[l],e[l]););return l===-1}if(!t||typeof n=="object"){l=0;for(t in n)if(De.call(n,t)&&++l&&!De.call(e,t)||!(t in e)||!ee(n[t],e[t]))return!1;return Object.keys(e).length===l}}return n!==n&&e!==e}function Le(n){let e,t,l;return{c(){e=E("input"),y(e,"class","absolute outline-none inset-2 bg-transparent border-0 translate-x-px flex-1 "),y(e,"tabindex","-1"),D(e,"translate-x-px",!n[3]),D(e,"font-bold",n[3])},m(a,i){C(a,e,i),ye(e,n[0]),n[8](e),t||(l=[F(e,"input",n[7]),F(e,"keydown",n[6]),F(e,"blur",ht)],t=!0)},p(a,i){i&1&&e.value!==a[0]&&ye(e,a[0]),i&8&&D(e,"translate-x-px",!a[3]),i&8&&D(e,"font-bold",a[3])},d(a){a&&H(e),n[8](null),t=!1,ge(l)}}}function dt(n){let e;return{c(){e=_e(n[0])},m(t,l){C(t,e,l)},p(t,l){l&1&&he(e,t[0])},d(t){t&&H(e)}}}function gt(n){let e,t;return{c(){e=new rt(!1),t=at(),e.a=t},m(l,a){e.m(n[0],l,a),C(l,t,a)},p(l,a){a&1&&e.p(l[0])},d(l){l&&H(t),l&&e.d()}}}function _t(n){let e,t,l,a,i=n[2]&&Le(n);function _(s,g){return s[4]==="markdown"||s[4]==="html"?gt:dt}let h=_(n),o=h(n);return{c(){i&&i.c(),e=j(),t=E("span"),o.c(),y(t,"tabindex","-1"),y(t,"role","button"),y(t,"class","p-2 outline-none border-0 flex-1"),D(t,"opacity-0",n[2]),D(t,"pointer-events-none",n[2])},m(s,g){i&&i.m(s,g),C(s,e,g),C(s,t,g),o.m(t,null),l||(a=F(t,"dblclick",n[5]),l=!0)},p(s,[g]){s[2]?i?i.p(s,g):(i=Le(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),h===(h=_(s))&&o?o.p(s,g):(o.d(1),o=h(s),o&&(o.c(),o.m(t,null))),g&4&&D(t,"opacity-0",s[2]),g&4&&D(t,"pointer-events-none",s[2])},i:X,o:X,d(s){i&&i.d(s),s&&H(e),s&&H(t),o.d(),l=!1,a()}}}const ht=({currentTarget:n})=>n.setAttribute("tabindex","-1");function bt(n,e,t){let{edit:l}=e,{value:a=""}=e,{el:i}=e,{header:_=!1}=e,{datatype:h="str"}=e;function o(c){Ae.call(this,n,c)}function s(c){Ae.call(this,n,c)}function g(){a=this.value,t(0,a)}function w(c){P[c?"unshift":"push"](()=>{i=c,t(1,i)})}return n.$$set=c=>{"edit"in c&&t(2,l=c.edit),"value"in c&&t(0,a=c.value),"el"in c&&t(1,i=c.el),"header"in c&&t(3,_=c.header),"datatype"in c&&t(4,h=c.datatype)},[a,i,l,_,h,o,s,g,w]}class ze extends fe{constructor(e){super(),ce(this,e,bt,_t,de,{edit:2,value:0,el:1,header:3,datatype:4})}}function Me(n,e,t){const l=n.slice();return l[52]=e[t],l[54]=t,l}function Te(n,e,t){const l=n.slice();return l[55]=e[t].value,l[56]=e[t].id,l[57]=e,l[58]=t,l}function Ee(n,e,t){const l=n.slice();return l[55]=e[t].value,l[56]=e[t].id,l[59]=e,l[54]=t,l}function Be(n){let e,t;return{c(){e=E("p"),t=_e(n[1]),y(e,"class","text-gray-600 text-[0.855rem] mb-2 block dark:text-gray-200 relative z-40")},m(l,a){C(l,e,a),T(e,t)},p(l,a){a[0]&2&&he(t,l[1])},d(l){l&&H(e)}}}function Re(n){let e,t;return{c(){e=E("caption"),t=_e(n[1]),y(e,"class","sr-only")},m(l,a){C(l,e,a),T(e,t)},p(l,a){a[0]&2&&he(t,l[1])},d(l){l&&H(e)}}}function Ce(n,e){let t,l,a,i,_,h,o,s,g,w,c,b=e[56],f,v,O;function u(S){e[30](S,e[56])}function p(){return e[31](e[56])}let M={value:e[55],edit:e[13]===e[56],header:!0};e[10][e[56]].input!==void 0&&(M.el=e[10][e[56]].input),a=new ze({props:M}),P.push(()=>x(a,"el",u)),a.$on("keydown",e[21]),a.$on("dblclick",p);function m(){return e[32](e[54])}const R=()=>e[33](t,b),z=()=>e[33](null,b);return{key:n,first:null,c(){t=E("th"),l=E("div"),Z(a.$$.fragment),_=j(),h=E("div"),o=ve("svg"),s=ve("path"),w=j(),y(s,"d","M4.49999 0L8.3971 6.75H0.602875L4.49999 0Z"),y(o,"width","1em"),y(o,"height","1em"),y(o,"class","fill-current text-[10px]"),y(o,"viewBox","0 0 9 7"),y(o,"fill","none"),y(o,"xmlns","http://www.w3.org/2000/svg"),y(h,"class",g="flex flex-none items-center justify-center p-2 cursor-pointer leading-snug transform transition-all "+(e[12]!==e[54]?"text-gray-200 hover:text-gray-500":"text-orange-500")+" "+(e[12]===e[54]&&e[11]==="des"?"-scale-y-[1]":"")),D(h,"text-gray-200",e[12]!==e[54]),y(l,"class","min-h-[2.3rem] flex outline-none"),y(t,"class","p-0 relative focus-within:ring-1 ring-orange-500 ring-inset outline-none"),y(t,"aria-sort",c=e[15](e[55],e[12],e[11])),D(t,"bg-orange-50",e[13]===e[56]),D(t,"dark:bg-transparent",e[13]===e[56]),D(t,"rounded-tl-lg",e[54]===0),D(t,"rounded-tr-lg",e[54]===e[8].length-1),this.first=t},m(S,B){C(S,t,B),T(t,l),G(a,l,null),T(l,_),T(l,h),T(h,o),T(o,s),T(t,w),R(),f=!0,v||(O=F(h,"click",m),v=!0)},p(S,B){e=S;const I={};B[0]&256&&(I.value=e[55]),B[0]&8448&&(I.edit=e[13]===e[56]),!i&&B[0]&1280&&(i=!0,I.el=e[10][e[56]].input,$(()=>i=!1)),a.$set(I),(!f||B[0]&6400&&g!==(g="flex flex-none items-center justify-center p-2 cursor-pointer leading-snug transform transition-all "+(e[12]!==e[54]?"text-gray-200 hover:text-gray-500":"text-orange-500")+" "+(e[12]===e[54]&&e[11]==="des"?"-scale-y-[1]":"")))&&y(h,"class",g),B[0]&6400&&D(h,"text-gray-200",e[12]!==e[54]),(!f||B[0]&6400&&c!==(c=e[15](e[55],e[12],e[11])))&&y(t,"aria-sort",c),b!==e[56]&&(z(),b=e[56],R()),B[0]&8448&&D(t,"bg-orange-50",e[13]===e[56]),B[0]&8448&&D(t,"dark:bg-transparent",e[13]===e[56]),B[0]&256&&D(t,"rounded-tl-lg",e[54]===0),B[0]&256&&D(t,"rounded-tr-lg",e[54]===e[8].length-1)},i(S){f||(V(a.$$.fragment,S),f=!0)},o(S){Y(a.$$.fragment,S),f=!1},d(S){S&&H(t),Q(a),z(),v=!1,O()}}}function He(n,e){let t,l,a,i,_,h=e[56],o,s,g;function w(m){e[34](m,e[55],e[57],e[58])}function c(m){e[35](m,e[56])}let b={edit:e[6]===e[56],datatype:Array.isArray(e[0])?e[0][e[58]]:e[0]};e[55]!==void 0&&(b.value=e[55]),e[10][e[56]].input!==void 0&&(b.el=e[10][e[56]].input),a=new ze({props:b}),P.push(()=>x(a,"value",w)),P.push(()=>x(a,"el",c));const f=()=>e[36](t,h),v=()=>e[36](null,h);function O(){return e[37](e[56])}function u(){return e[38](e[56])}function p(){return e[39](e[56])}function M(...m){return e[40](e[54],e[58],e[56],...m)}return{key:n,first:null,c(){t=E("td"),l=E("div"),Z(a.$$.fragment),y(l,"class","min-h-[2.3rem] h-full outline-none flex items-center"),D(l,"border-transparent",e[7]!==e[56]),y(t,"tabindex","0"),y(t,"class","outline-none focus-within:ring-1 ring-orange-500 ring-inset focus-within:bg-orange-50 dark:focus-within:bg-gray-800 group-last:first:rounded-bl-lg group-last:last:rounded-br-lg relative"),this.first=t},m(m,R){C(m,t,R),T(t,l),G(a,l,null),f(),o=!0,s||(g=[F(t,"touchstart",O,{passive:!0}),F(t,"click",u),F(t,"dblclick",p),F(t,"keydown",M)],s=!0)},p(m,R){e=m;const z={};R[0]&576&&(z.edit=e[6]===e[56]),R[0]&513&&(z.datatype=Array.isArray(e[0])?e[0][e[58]]:e[0]),!i&&R[0]&512&&(i=!0,z.value=e[55],$(()=>i=!1)),!_&&R[0]&1536&&(_=!0,z.el=e[10][e[56]].input,$(()=>_=!1)),a.$set(z),R[0]&640&&D(l,"border-transparent",e[7]!==e[56]),h!==e[56]&&(v(),h=e[56],f())},i(m){o||(V(a.$$.fragment,m),o=!0)},o(m){Y(a.$$.fragment,m),o=!1},d(m){m&&H(t),Q(a),v(),s=!1,ge(g)}}}function Oe(n,e){let t,l=[],a=new Map,i,_,h=e[52];const o=s=>s[56];for(let s=0;s<h.length;s+=1){let g=Te(e,h,s),w=o(g);a.set(w,l[s]=He(w,g))}return{key:n,first:null,c(){t=E("tr");for(let s=0;s<l.length;s+=1)l[s].c();i=j(),y(t,"class","group border-b dark:border-gray-700 last:border-none divide-x dark:divide-gray-700 space-x-4 odd:bg-gray-50 dark:odd:bg-gray-900 group focus:bg-gradient-to-b focus:from-blue-100 dark:focus:from-blue-900 focus:to-blue-50 dark:focus:to-gray-900 focus:odd:bg-white"),this.first=t},m(s,g){C(s,t,g);for(let w=0;w<l.length;w+=1)l[w].m(t,null);T(t,i),_=!0},p(s,g){e=s,g[0]&460481&&(h=e[52],ie(),l=se(l,g,o,1,e,h,a,t,ue,He,i,Te),oe())},i(s){if(!_){for(let g=0;g<h.length;g+=1)V(l[g]);_=!0}},o(s){for(let g=0;g<l.length;g+=1)Y(l[g]);_=!1},d(s){s&&H(t);for(let g=0;g<l.length;g+=1)l[g].d()}}}function mt(n){let e,t,l,a,i=[],_=new Map,h,o,s=[],g=new Map,w,c=n[1]&&n[1].length!==0&&Re(n),b=n[8];const f=u=>u[56];for(let u=0;u<b.length;u+=1){let p=Ee(n,b,u),M=f(p);_.set(M,i[u]=Ce(M,p))}let v=n[9];const O=u=>u[52];for(let u=0;u<v.length;u+=1){let p=Me(n,v,u),M=O(p);g.set(M,s[u]=Oe(M,p))}return{c(){e=E("table"),c&&c.c(),t=j(),l=E("thead"),a=E("tr");for(let u=0;u<i.length;u+=1)i[u].c();h=j(),o=E("tbody");for(let u=0;u<s.length;u+=1)s[u].c();y(a,"class","border-b dark:border-gray-700 divide-x dark:divide-gray-700 text-left"),y(l,"class","sticky top-0 left-0 right-0 bg-white shadow-sm z-10"),y(o,"class","overflow-y-scroll"),y(e,"class","table-auto font-mono w-full text-gray-900 text-sm transition-opacity overflow-hidden"),D(e,"opacity-40",n[14])},m(u,p){C(u,e,p),c&&c.m(e,null),T(e,t),T(e,l),T(l,a);for(let M=0;M<i.length;M+=1)i[M].m(a,null);T(e,h),T(e,o);for(let M=0;M<s.length;M+=1)s[M].m(o,null);w=!0},p(u,p){u[1]&&u[1].length!==0?c?c.p(u,p):(c=Re(u),c.c(),c.m(e,t)):c&&(c.d(1),c=null),p[0]&3718400&&(b=u[8],ie(),i=se(i,p,f,1,u,b,_,a,ue,Ce,null,Ee),oe()),p[0]&460481&&(v=u[9],ie(),s=se(s,p,O,1,u,v,g,o,ue,Oe,null,Me),oe()),p[0]&16384&&D(e,"opacity-40",u[14])},i(u){if(!w){for(let p=0;p<b.length;p+=1)V(i[p]);for(let p=0;p<v.length;p+=1)V(s[p]);w=!0}},o(u){for(let p=0;p<i.length;p+=1)Y(i[p]);for(let p=0;p<s.length;p+=1)Y(s[p]);w=!1},d(u){u&&H(e),c&&c.d();for(let p=0;p<i.length;p+=1)i[p].d();for(let p=0;p<s.length;p+=1)s[p].d()}}}function Se(n){let e,t,l=n[3][1]==="dynamic"&&Fe(n),a=n[2][1]==="dynamic"&&Ue(n);return{c(){e=E("div"),l&&l.c(),t=j(),a&&a.c(),y(e,"class","flex justify-end space-x-1 pt-2 text-gray-800")},m(i,_){C(i,e,_),l&&l.m(e,null),T(e,t),a&&a.m(e,null)},p(i,_){i[3][1]==="dynamic"?l?l.p(i,_):(l=Fe(i),l.c(),l.m(e,t)):l&&(l.d(1),l=null),i[2][1]==="dynamic"?a?a.p(i,_):(a=Ue(i),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(i){i&&H(e),l&&l.d(),a&&a.d()}}}function Fe(n){let e,t,l;return{c(){e=E("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1 group-hover:text-orange-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z"></path></svg>New row',y(e,"class","!flex-none gr-button group")},m(a,i){C(a,e,i),t||(l=F(e,"click",n[43]),t=!0)},p:X,d(a){a&&H(e),t=!1,l()}}}function Ue(n){let e,t,l;return{c(){e=E("button"),e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="mr-1 group-hover:text-orange-500" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="m18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z"></path></svg>
|
2 |
+
New column`,y(e,"class","!flex-none gr-button group")},m(a,i){C(a,e,i),t||(l=F(e,"click",n[23]),t=!0)},p:X,d(a){a&&H(e),t=!1,l()}}}function pt(n){let e,t,l,a,i,_,h,o,s,g=n[1]&&n[1].length!==0&&Be(n);function w(f){n[41](f)}let c={flex:!1,center:!1,boundedheight:!1,disable_click:!0,$$slots:{default:[mt]},$$scope:{ctx:n}};n[14]!==void 0&&(c.dragging=n[14]),a=new ft({props:c}),P.push(()=>x(a,"dragging",w)),a.$on("load",n[42]);let b=n[4]&&Se(n);return{c(){e=E("div"),g&&g.c(),t=j(),l=E("div"),Z(a.$$.fragment),_=j(),b&&b.c(),y(l,"class","scroll-hide overflow-hidden rounded-lg relative border transition-colors overflow-x-scroll"),D(l,"border-green-400",n[14]),D(l,"whitespace-nowrap",!n[5]),D(e,"mt-6",n[1]&&n[1].length!==0)},m(f,v){C(f,e,v),g&&g.m(e,null),T(e,t),T(e,l),G(a,l,null),T(e,_),b&&b.m(e,null),h=!0,o||(s=[F(window,"click",n[24]),F(window,"touchstart",n[24])],o=!0)},p(f,v){f[1]&&f[1].length!==0?g?g.p(f,v):(g=Be(f),g.c(),g.m(e,t)):g&&(g.d(1),g=null);const O={};v[0]&32707|v[1]&536870912&&(O.$$scope={dirty:v,ctx:f}),!i&&v[0]&16384&&(i=!0,O.dragging=f[14],$(()=>i=!1)),a.$set(O),v[0]&16384&&D(l,"border-green-400",f[14]),v[0]&32&&D(l,"whitespace-nowrap",!f[5]),f[4]?b?b.p(f,v):(b=Se(f),b.c(),b.m(e,null)):b&&(b.d(1),b=null),v[0]&2&&D(e,"mt-6",f[1]&&f[1].length!==0)},i(f){h||(V(a.$$.fragment,f),h=!0)},o(f){Y(a.$$.fragment,f),h=!1},d(f){f&&H(e),g&&g.d(),Q(a),b&&b.d(),o=!1,ge(s)}}}function kt(n,e){return e.filter(t);function t(l){var a=-1;return n.split(`
|
3 |
+
`).every(i);function i(_){if(!_)return!0;var h=_.split(l).length;return a<0&&(a=h),a===h&&h>1}}}function wt(n){const e=atob(n.split(",")[1]),t=n.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(e.length),a=new Uint8Array(l);for(let i=0;i<e.length;i++)a[i]=e.charCodeAt(i);return new Blob([l],{type:t})}function yt(n,e,t){let{datatype:l}=e,{label:a=null}=e,{headers:i=[]}=e,{values:_=[[]]}=e,{col_count:h}=e,{row_count:o}=e,{editable:s=!0}=e,{wrap:g=!1}=e;const w=qe();let c=!1,b=!1,f={};function v(r){let d=r||[];if(h[1]==="fixed"&&d.length<h[0]){const k=Array(h[0]-d.length).fill("").map((A,L)=>`${L+d.length}`);d=d.concat(k)}return!d||d.length===0?Array(h[0]).fill(0).map((k,A)=>{const L=`h-${A}`;return t(10,f[L]={cell:null,input:null},f),{id:L,value:JSON.stringify(A+1)}}):d.map((k,A)=>{const L=`h-${A}`;return t(10,f[L]={cell:null,input:null},f),{id:L,value:k??""}})}function O(r){const d=r.length>0?r.length:o[0];return Array(o[1]==="fixed"||d<o[0]?o[0]:d).fill(0).map((k,A)=>Array(h[1]==="fixed"?h[0]:r[0].length).fill(0).map((L,q)=>{const K=`${A}-${q}`;return t(10,f[K]={input:null,cell:null},f),{value:r?.[A]?.[q]??"",id:K}}))}let u=v(i),p;async function M(){typeof c=="string"?(await N(),f[c]?.input?.focus()):typeof b=="string"&&(await N(),f[b]?.input?.focus())}let m=[[]],R;function z(r,d,k){if(!d)return"none";if(i[d]===r){if(k==="asc")return"ascending";if(k==="des")return"descending"}}function S(r){return m.reduce((d,k,A)=>{const L=k.reduce((q,K,re)=>r===K.id?re:q,-1);return L===-1?d:[A,L]},[-1,-1])}async function B(r,d){if(!s||c===r)return;if(d){const[A,L]=S(r);t(9,m[A][L].value="",m)}t(6,c=r),await N();const{input:k}=f[r];k?.focus()}async function I(r,d,k,A){let L;switch(r.key){case"ArrowRight":if(c)break;r.preventDefault(),L=m[d][k+1],t(7,b=L?L.id:b);break;case"ArrowLeft":if(c)break;r.preventDefault(),L=m[d][k-1],t(7,b=L?L.id:b);break;case"ArrowDown":if(c)break;r.preventDefault(),L=m[d+1],t(7,b=L?L[k].id:b);break;case"ArrowUp":if(c)break;r.preventDefault(),L=m[d-1],t(7,b=L?L[k].id:b);break;case"Escape":if(!s)break;r.preventDefault(),t(7,b=c),t(6,c=!1);break;case"Enter":if(!s)break;if(r.preventDefault(),r.shiftKey){le(d),await N();const[nt]=S(A);t(7,b=m[nt+1][k].id)}else c===A?t(6,c=!1):B(A);break;case"Backspace":if(!s)break;c||(r.preventDefault(),t(9,m[d][k].value="",m));break;case"Delete":if(!s)break;c||(r.preventDefault(),t(9,m[d][k].value="",m));break;case"Tab":let q=r.shiftKey?-1:1,K=m[d][k+q],re=m?.[d+q]?.[q>0?0:u.length-1],ae=K||re;ae&&(r.preventDefault(),t(7,b=ae?ae.id:b)),t(6,c=!1);break;default:(!c||c&&c!==A)&&r.key.length===1&&B(A,!0);break}}async function be(r){c!==r&&b!==r&&(t(6,c=!1),t(7,b=r))}async function me(r,d){if(d==="edit"&&typeof r=="string"&&(await N(),f[r].input?.focus()),d==="edit"&&typeof r=="boolean"&&typeof b=="string"){let k=f[b]?.cell;await N(),k?.focus()}if(d==="select"&&typeof r=="string"){const{cell:k}=f[r];await N(),k?.focus()}}let J,W;function Ne(r,d){d==="asc"?t(9,m=m.sort((k,A)=>k[r].value<A[r].value?-1:1)):d==="des"&&t(9,m=m.sort((k,A)=>k[r].value>A[r].value?-1:1))}function pe(r){typeof W!="number"||W!==r?(t(11,J="asc"),t(12,W=r)):J==="asc"?t(11,J="des"):J==="des"&&t(11,J="asc"),Ne(r,J)}let U;function ke(){if(typeof b=="string"){const r=f[b].input?.value;if(u.find(d=>d.id===b)){let d=u.find(k=>k.id===b);r&&(d.value=r)}else r&&u.push({id:b,value:r})}}async function te(r,d){!s||h[1]!=="dynamic"||c===r||(t(13,U=r),await N(),f[r].input?.focus(),d&&f[r].input?.select())}function je(r){if(!!s)switch(r.key){case"Escape":case"Enter":case"Tab":r.preventDefault(),t(7,b=U),t(13,U=!1),ke();break}}function le(r){o[1]==="dynamic"&&(m.splice(r?r+1:m.length,0,Array(m[0].length).fill(0).map((d,k)=>{const A=`${m.length}-${k}`;return t(10,f[A]={cell:null,input:null},f),{id:A,value:""}})),t(9,m),t(27,_),t(29,R),t(26,i))}async function Ke(){if(h[1]!=="dynamic")return;for(let d=0;d<m.length;d++){const k=`${d}-${m[d].length}`;t(10,f[k]={cell:null,input:null},f),m[d].push({id:k,value:""})}const r=`h-${u.length}`;t(10,f[r]={cell:null,input:null},f),u.push({id:r,value:`Header ${u.length+1}`}),t(9,m),t(27,_),t(29,R),t(26,i),t(8,u),t(26,i),t(28,p),t(27,_),await N(),te(r,!0)}function Ve(r){typeof c=="string"&&f[c]&&f[c].cell!==r.target&&!f[c].cell?.contains(r?.target)&&t(6,c=!1),typeof U=="string"&&f[U]&&f[U].cell!==r.target&&!f[U].cell?.contains(r.target)&&(t(7,b=U),t(13,U=!1),ke(),t(13,U=!1))}function we(r){const d=new FileReader;function k(A){if(!A?.target?.result||typeof A.target.result!="string")return;const[L]=kt(A.target.result,[","," "]),[q,...K]=ct(L).parseRows(A.target.result);t(8,u=v(h[1]==="fixed"?q.slice(0,h[0]):q)),t(27,_=K),d.removeEventListener("loadend",k)}d.addEventListener("loadend",k),d.readAsText(r)}let ne=!1;function Ye(r,d){n.$$.not_equal(f[d].input,r)&&(f[d].input=r,t(10,f))}const Ie=r=>te(r),Je=r=>pe(r);function Pe(r,d){P[r?"unshift":"push"](()=>{f[d].cell=r,t(10,f)})}function Ze(r,d,k,A){k[A].value=r,t(9,m),t(27,_),t(29,R),t(26,i)}function Ge(r,d){n.$$.not_equal(f[d].input,r)&&(f[d].input=r,t(10,f))}function Qe(r,d){P[r?"unshift":"push"](()=>{f[d].cell=r,t(10,f)})}const We=r=>B(r),Xe=r=>be(r),xe=r=>B(r),$e=(r,d,k,A)=>I(A,r,d,k);function et(r){ne=r,t(14,ne)}const tt=r=>we(wt(r.detail.data)),lt=()=>le();return n.$$set=r=>{"datatype"in r&&t(0,l=r.datatype),"label"in r&&t(1,a=r.label),"headers"in r&&t(26,i=r.headers),"values"in r&&t(27,_=r.values),"col_count"in r&&t(2,h=r.col_count),"row_count"in r&&t(3,o=r.row_count),"editable"in r&&t(4,s=r.editable),"wrap"in r&&t(5,g=r.wrap)},n.$$.update=()=>{n.$$.dirty[0]&201326592&&(_&&!Array.isArray(_)?(t(26,i=_.headers),t(27,_=_.data.length===0?[Array(i.length).fill("")]:_.data)):_===null?t(27,_=[Array(i.length).fill("")]):(t(27,_),t(26,i))),n.$$.dirty[0]&335544320&&(ee(i,p)||(t(8,u=v(i)),t(28,p=i),M())),n.$$.dirty[0]&671088640&&(ee(_,R)||(t(9,m=O(_)),t(29,R=_),M())),n.$$.dirty[0]&768&&u&&w("change",{data:m.map(r=>r.map(({value:d})=>d)),headers:u.map(r=>r.value)}),n.$$.dirty[0]&64&&me(c,"edit"),n.$$.dirty[0]&128&&me(b,"select")},[l,a,h,o,s,g,c,b,u,m,f,J,W,U,ne,z,B,I,be,pe,te,je,le,Ke,Ve,we,i,_,p,R,Ye,Ie,Je,Pe,Ze,Ge,Qe,We,Xe,xe,$e,et,tt,lt]}class At extends fe{constructor(e){super(),ce(this,e,yt,pt,de,{datatype:0,label:1,headers:26,values:27,col_count:2,row_count:3,editable:4,wrap:5},null,[-1,-1])}}function vt(n){let e,t,l,a,i;const _=[n[10]];let h={};for(let o=0;o<_.length;o+=1)h=it(h,_[o]);return t=new st({props:h}),a=new At({props:{label:n[7],row_count:n[6],col_count:n[5],values:n[0],headers:n[1],editable:n[4]==="dynamic",wrap:n[8],datatype:n[9]}}),a.$on("change",n[12]),{c(){e=E("div"),Z(t.$$.fragment),l=j(),Z(a.$$.fragment),y(e,"id",n[2]),y(e,"class","relative overflow-hidden"),D(e,"!hidden",!n[3])},m(o,s){C(o,e,s),G(t,e,null),T(e,l),G(a,e,null),i=!0},p(o,[s]){const g=s&1024?ut(_,[ot(o[10])]):{};t.$set(g);const w={};s&128&&(w.label=o[7]),s&64&&(w.row_count=o[6]),s&32&&(w.col_count=o[5]),s&1&&(w.values=o[0]),s&2&&(w.headers=o[1]),s&16&&(w.editable=o[4]==="dynamic"),s&256&&(w.wrap=o[8]),s&512&&(w.datatype=o[9]),a.$set(w),(!i||s&4)&&y(e,"id",o[2]),s&8&&D(e,"!hidden",!o[3])},i(o){i||(V(t.$$.fragment,o),V(a.$$.fragment,o),i=!0)},o(o){Y(t.$$.fragment,o),Y(a.$$.fragment,o),i=!1},d(o){o&&H(e),Q(t),Q(a)}}}function Dt(n,e,t){let{headers:l=[]}=e,{elem_id:a=""}=e,{visible:i=!0}=e,{value:_={data:[["","",""]],headers:["1","2","3"]}}=e,{mode:h}=e,{col_count:o}=e,{row_count:s}=e,{label:g=null}=e,{wrap:w}=e,{datatype:c}=e;const b=qe();let{loading_status:f}=e;async function v(u){t(0,_=u),await N(),b("change",u)}const O=({detail:u})=>v(u);return n.$$set=u=>{"headers"in u&&t(1,l=u.headers),"elem_id"in u&&t(2,a=u.elem_id),"visible"in u&&t(3,i=u.visible),"value"in u&&t(0,_=u.value),"mode"in u&&t(4,h=u.mode),"col_count"in u&&t(5,o=u.col_count),"row_count"in u&&t(6,s=u.row_count),"label"in u&&t(7,g=u.label),"wrap"in u&&t(8,w=u.wrap),"datatype"in u&&t(9,c=u.datatype),"loading_status"in u&&t(10,f=u.loading_status)},[_,l,a,i,h,o,s,g,w,c,f,v,O]}class Lt extends fe{constructor(e){super(),ce(this,e,Dt,vt,de,{headers:1,elem_id:2,visible:3,value:0,mode:4,col_count:5,row_count:6,label:7,wrap:8,datatype:9,loading_status:10})}}var Bt=Lt;const Rt=["static","dynamic"],Ct=n=>({type:" { data: Array<Array<string | number>>; headers: Array<string> }",description:"hex color code",example_data:n.value??"#000000"});export{Bt as Component,Ct as document,Rt as modes};
|
4 |
+
//# sourceMappingURL=index.164edf37.js.map
|
gradio-modified/templates/frontend/assets/index.1a9e15aa.css
ADDED
The diff for this file is too large to render.
See raw diff
|
|
gradio-modified/templates/frontend/assets/index.1d32cfe5.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{ah as s}from"./index.396f4a72.js";const o=["static"];export{s as Component,o as modes};
|
2 |
+
//# sourceMappingURL=index.1d32cfe5.js.map
|
gradio-modified/templates/frontend/assets/index.1eb90786.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as B,i as M,s as L,w as T,b as _,f as g,g as p,x as v,n as b,e as k,a as w,a3 as V,C as z,F as A,a4 as D,a5 as E,I,a6 as j,P as q,c as y,m as C,j as h,k as d,o as H,R as F,T as K,U as N,V as O,D as P,E as Y,K as Z}from"./index.396f4a72.js";import{B as G}from"./BlockLabel.37da86a3.js";function J(n){let e,s,t;return{c(){e=T("svg"),s=T("path"),t=T("path"),_(s,"fill","currentColor"),_(s,"d","M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"),_(t,"fill","currentColor"),_(t,"d","M8 10h16v2H8zm0 6h10v2H8z"),_(e,"xmlns","http://www.w3.org/2000/svg"),_(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),_(e,"aria-hidden","true"),_(e,"role","img"),_(e,"class","iconify iconify--carbon"),_(e,"width","100%"),_(e,"height","100%"),_(e,"preserveAspectRatio","xMidYMid meet"),_(e,"viewBox","0 0 32 32")},m(a,l){g(a,e,l),p(e,s),p(e,t)},p:v,i:v,o:v,d(a){a&&b(e)}}}class Q extends B{constructor(e){super(),M(this,e,null,J,L,{})}}function R(n,e,s){const t=n.slice();return t[9]=e[s],t}function S(n){let e,s=n[9][0]+"",t,a,l,f,r=n[9][1]+"",c,o;return{c(){e=k("div"),a=w(),l=k("div"),f=new V(!1),c=w(),_(e,"data-testid","user"),_(e,"class","px-3 py-2 rounded-[22px] rounded-br-none text-white text-sm chat-message svelte-1kgfmmo"),_(e,"style",t="background-color:"+n[2][0]),f.a=c,_(l,"data-testid","bot"),_(l,"class","px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white text-sm chat-message svelte-1kgfmmo"),_(l,"style",o="background-color:"+n[2][1])},m(u,m){g(u,e,m),e.innerHTML=s,g(u,a,m),g(u,l,m),f.m(r,l),p(l,c)},p(u,m){m&1&&s!==(s=u[9][0]+"")&&(e.innerHTML=s),m&4&&t!==(t="background-color:"+u[2][0])&&_(e,"style",t),m&1&&r!==(r=u[9][1]+"")&&f.p(r),m&4&&o!==(o="background-color:"+u[2][1])&&_(l,"style",o)},d(u){u&&b(e),u&&b(a),u&&b(l)}}}function W(n){let e,s,t=n[0],a=[];for(let l=0;l<t.length;l+=1)a[l]=S(R(n,t,l));return{c(){e=k("div"),s=k("div");for(let l=0;l<a.length;l+=1)a[l].c();_(s,"class","flex flex-col items-end space-y-4 p-3"),_(e,"class","overflow-y-auto h-[40vh]")},m(l,f){g(l,e,f),p(e,s);for(let r=0;r<a.length;r+=1)a[r].m(s,null);n[4](e)},p(l,[f]){if(f&5){t=l[0];let r;for(r=0;r<t.length;r+=1){const c=R(l,t,r);a[r]?a[r].p(c,f):(a[r]=S(c),a[r].c(),a[r].m(s,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=t.length}},i:v,o:v,d(l){l&&b(e),z(a,l),n[4](null)}}}function X(n,e,s){let t,{value:a}=e,{style:l={}}=e,f,r;const c=A();D(()=>{r=f&&f.offsetHeight+f.scrollTop>f.scrollHeight-20}),E(()=>{r&&f.scrollTo(0,f.scrollHeight)});function o(i){return i in j?j[i].primary:i}function u(){return l.color_map?[o(l.color_map[0]),o(l.color_map[1])]:["#fb923c","#9ca3af"]}function m(i){I[i?"unshift":"push"](()=>{f=i,s(1,f)})}return n.$$set=i=>{"value"in i&&s(0,a=i.value),"style"in i&&s(3,l=i.style)},n.$$.update=()=>{n.$$.dirty&1&&a&&c("change")},s(2,t=u()),[a,f,t,l,m]}class x extends B{constructor(e){super(),M(this,e,X,W,L,{value:0,style:3})}}function U(n){let e,s;return e=new G({props:{show_label:n[5],Icon:Q,label:n[4]||"Chatbot",disable:typeof n[0].container=="boolean"&&!n[0].container}}),{c(){y(e.$$.fragment)},m(t,a){C(e,t,a),s=!0},p(t,a){const l={};a&32&&(l.show_label=t[5]),a&16&&(l.label=t[4]||"Chatbot"),a&1&&(l.disable=typeof t[0].container=="boolean"&&!t[0].container),e.$set(l)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){d(e.$$.fragment,t),s=!1},d(t){H(e,t)}}}function $(n){let e,s,t,a,l;const f=[n[6]];let r={};for(let o=0;o<f.length;o+=1)r=F(r,f[o]);e=new K({props:r});let c=n[5]&&U(n);return a=new x({props:{style:n[0],value:n[3]}}),a.$on("change",n[8]),{c(){y(e.$$.fragment),s=w(),c&&c.c(),t=w(),y(a.$$.fragment)},m(o,u){C(e,o,u),g(o,s,u),c&&c.m(o,u),g(o,t,u),C(a,o,u),l=!0},p(o,u){const m=u&64?N(f,[O(o[6])]):{};e.$set(m),o[5]?c?(c.p(o,u),u&32&&h(c,1)):(c=U(o),c.c(),h(c,1),c.m(t.parentNode,t)):c&&(P(),d(c,1,1,()=>{c=null}),Y());const i={};u&1&&(i.style=o[0]),u&8&&(i.value=o[3]),a.$set(i)},i(o){l||(h(e.$$.fragment,o),h(c),h(a.$$.fragment,o),l=!0)},o(o){d(e.$$.fragment,o),d(c),d(a.$$.fragment,o),l=!1},d(o){H(e,o),o&&b(s),c&&c.d(o),o&&b(t),H(a,o)}}}function ee(n){let e,s;return e=new q({props:{padding:!1,elem_id:n[1],visible:n[2],$$slots:{default:[$]},$$scope:{ctx:n}}}),{c(){y(e.$$.fragment)},m(t,a){C(e,t,a),s=!0},p(t,[a]){const l={};a&2&&(l.elem_id=t[1]),a&4&&(l.visible=t[2]),a&633&&(l.$$scope={dirty:a,ctx:t}),e.$set(l)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){d(e.$$.fragment,t),s=!1},d(t){H(e,t)}}}function te(n,e,s){let{elem_id:t=""}=e,{visible:a=!0}=e,{value:l=[]}=e,{style:f={}}=e,{label:r}=e,{show_label:c=!0}=e,{color_map:o={}}=e,{loading_status:u}=e;function m(i){Z.call(this,n,i)}return n.$$set=i=>{"elem_id"in i&&s(1,t=i.elem_id),"visible"in i&&s(2,a=i.visible),"value"in i&&s(3,l=i.value),"style"in i&&s(0,f=i.style),"label"in i&&s(4,r=i.label),"show_label"in i&&s(5,c=i.show_label),"color_map"in i&&s(7,o=i.color_map),"loading_status"in i&&s(6,u=i.loading_status)},n.$$.update=()=>{n.$$.dirty&129&&!f.color_map&&Object.keys(o).length&&s(0,f.color_map=o,f)},[f,t,a,l,r,c,u,o,m]}class le extends B{constructor(e){super(),M(this,e,te,ee,L,{elem_id:1,visible:2,value:3,style:0,label:4,show_label:5,color_map:7,loading_status:6})}}var ne=le;const oe=["static"],ie=n=>({type:"Array<[string, string]>",description:"Represents list of message pairs of chat message.",example_data:n.value??[["Hi","Hello"],["1 + 1","2"]]});export{ne as Component,ie as document,oe as modes};
|
2 |
+
//# sourceMappingURL=index.1eb90786.js.map
|
gradio-modified/templates/frontend/assets/index.2035cf67.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as q,i as D,s as E,a7 as I,e as S,c as h,a as F,b as y,f as C,m,g as T,a8 as j,l as K,j as g,k,n as P,o as v,F as L,t as O,h as R,a9 as d,P as U,R as V,T as z,I as A,O as G,U as H,V as J,L as M,K as B}from"./index.396f4a72.js";function N(s){let e;return{c(){e=O(s[1])},m(l,t){C(l,e,t)},p(l,t){t&2&&R(e,l[1])},d(l){l&&P(e)}}}function Q(s){let e,l,t,n,u,c,_;return l=new I({props:{show_label:s[3],$$slots:{default:[N]},$$scope:{ctx:s}}}),{c(){e=S("label"),h(l.$$.fragment),t=F(),n=S("input"),y(n,"type","color"),y(n,"class","gr-box-unrounded"),n.disabled=s[2],y(e,"class","block")},m(r,f){C(r,e,f),m(l,e,null),T(e,t),T(e,n),j(n,s[0]),u=!0,c||(_=K(n,"input",s[5]),c=!0)},p(r,[f]){const a={};f&8&&(a.show_label=r[3]),f&258&&(a.$$scope={dirty:f,ctx:r}),l.$set(a),(!u||f&4)&&(n.disabled=r[2]),f&1&&j(n,r[0])},i(r){u||(g(l.$$.fragment,r),u=!0)},o(r){k(l.$$.fragment,r),u=!1},d(r){r&&P(e),v(l),c=!1,_()}}}function W(s,e,l){let{value:t="#000000"}=e,{style:n={}}=e,{label:u}=e,{disabled:c=!1}=e,{show_label:_=!0}=e;const r=L();function f(i){r("change",i)}function a(){t=this.value,l(0,t)}return s.$$set=i=>{"value"in i&&l(0,t=i.value),"style"in i&&l(4,n=i.style),"label"in i&&l(1,u=i.label),"disabled"in i&&l(2,c=i.disabled),"show_label"in i&&l(3,_=i.show_label)},s.$$.update=()=>{s.$$.dirty&1,s.$$.dirty&1&&f(t)},[t,u,c,_,n,a]}class X extends q{constructor(e){super(),D(this,e,W,Q,E,{value:0,style:4,label:1,disabled:2,show_label:3})}}function Y(s){let e,l,t,n,u;const c=[s[6]];let _={};for(let a=0;a<c.length;a+=1)_=V(_,c[a]);e=new z({props:_});function r(a){s[8](a)}let f={style:s[5],label:s[1],show_label:s[4],disabled:s[7]==="static"};return s[0]!==void 0&&(f.value=s[0]),t=new X({props:f}),A.push(()=>G(t,"value",r)),t.$on("change",s[9]),t.$on("submit",s[10]),{c(){h(e.$$.fragment),l=F(),h(t.$$.fragment)},m(a,i){m(e,a,i),C(a,l,i),m(t,a,i),u=!0},p(a,i){const w=i&64?H(c,[J(a[6])]):{};e.$set(w);const b={};i&32&&(b.style=a[5]),i&2&&(b.label=a[1]),i&16&&(b.show_label=a[4]),i&128&&(b.disabled=a[7]==="static"),!n&&i&1&&(n=!0,b.value=a[0],M(()=>n=!1)),t.$set(b)},i(a){u||(g(e.$$.fragment,a),g(t.$$.fragment,a),u=!0)},o(a){k(e.$$.fragment,a),k(t.$$.fragment,a),u=!1},d(a){v(e,a),a&&P(l),v(t,a)}}}function Z(s){let e,l;return e=new U({props:{visible:s[3],elem_id:s[2],disable:typeof s[5].container=="boolean"&&!s[5].container,$$slots:{default:[Y]},$$scope:{ctx:s}}}),{c(){h(e.$$.fragment)},m(t,n){m(e,t,n),l=!0},p(t,[n]){const u={};n&8&&(u.visible=t[3]),n&4&&(u.elem_id=t[2]),n&32&&(u.disable=typeof t[5].container=="boolean"&&!t[5].container),n&2291&&(u.$$scope={dirty:n,ctx:t}),e.$set(u)},i(t){l||(g(e.$$.fragment,t),l=!0)},o(t){k(e.$$.fragment,t),l=!1},d(t){v(e,t)}}}function p(s,e,l){let{label:t="ColorPicker"}=e,{elem_id:n=""}=e,{visible:u=!0}=e,{value:c}=e,{show_label:_}=e,{style:r={}}=e,{loading_status:f}=e,{mode:a}=e;function i(o){c=o,l(0,c)}function w(o){B.call(this,s,o)}function b(o){B.call(this,s,o)}return s.$$set=o=>{"label"in o&&l(1,t=o.label),"elem_id"in o&&l(2,n=o.elem_id),"visible"in o&&l(3,u=o.visible),"value"in o&&l(0,c=o.value),"show_label"in o&&l(4,_=o.show_label),"style"in o&&l(5,r=o.style),"loading_status"in o&&l(6,f=o.loading_status),"mode"in o&&l(7,a=o.mode)},[c,t,n,u,_,r,f,a,i,w,b]}class x extends q{constructor(e){super(),D(this,e,p,Z,E,{label:1,elem_id:2,visible:3,value:0,show_label:4,style:5,loading_status:6,mode:7})}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),d()}get elem_id(){return this.$$.ctx[2]}set elem_id(e){this.$$set({elem_id:e}),d()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),d()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),d()}get show_label(){return this.$$.ctx[4]}set show_label(e){this.$$set({show_label:e}),d()}get style(){return this.$$.ctx[5]}set style(e){this.$$set({style:e}),d()}get loading_status(){return this.$$.ctx[6]}set loading_status(e){this.$$set({loading_status:e}),d()}get mode(){return this.$$.ctx[7]}set mode(e){this.$$set({mode:e}),d()}}var ee=x;const te=["static","dynamic"],le=s=>({type:"string",description:"hex color code",example_data:s.value??"#000000"});export{ee as Component,le as document,te as modes};
|
2 |
+
//# sourceMappingURL=index.2035cf67.js.map
|
gradio-modified/templates/frontend/assets/index.3517cbba.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
span.svelte-1cgkd5k{text-shadow:0 0 8px rgba(0,0,0,.5)}progress.svelte-1cgkd5k::-webkit-progress-bar{border-radius:2px;background-color:#fff3;overflow:hidden}progress.svelte-1cgkd5k::-webkit-progress-value{background-color:#ffffffe6}.mirror.svelte-1cgkd5k{transform:scaleX(-1)}.wrap.svelte-1cgkd5k{width:calc(100% - .75rem)}
|
gradio-modified/templates/frontend/assets/index.396f4a72.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
gradio-modified/templates/frontend/assets/index.39f99b3e.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as b,i as d,s as g,p as q,e as w,b as c,d as m,f as v,l as C,u as S,q as j,r as K,j as h,k as y,n as k,Z as Q,K as z,c as R,m as X,o as Z,Q as A,X as D,t as E,h as F}from"./index.396f4a72.js";function G(n){let e,l,t,s,f;const r=n[7].default,a=q(r,n,n[6],null);return{c(){e=w("button"),a&&a.c(),c(e,"class",l="gr-button gr-button-"+n[3]+" gr-button-"+n[2]+" "+n[4]),c(e,"id",n[0]),m(e,"!hidden",!n[1])},m(i,_){v(i,e,_),a&&a.m(e,null),t=!0,s||(f=C(e,"click",n[8]),s=!0)},p(i,[_]){a&&a.p&&(!t||_&64)&&S(a,r,i,i[6],t?K(r,i[6],_,null):j(i[6]),null),(!t||_&28&&l!==(l="gr-button gr-button-"+i[3]+" gr-button-"+i[2]+" "+i[4]))&&c(e,"class",l),(!t||_&1)&&c(e,"id",i[0]),_&30&&m(e,"!hidden",!i[1])},i(i){t||(h(a,i),t=!0)},o(i){y(a,i),t=!1},d(i){i&&k(e),a&&a.d(i),s=!1,f()}}}function H(n,e,l){let t,{$$slots:s={},$$scope:f}=e,{style:r={}}=e,{elem_id:a=""}=e,{visible:i=!0}=e,{variant:_="secondary"}=e,{size:u="lg"}=e;function B(o){z.call(this,n,o)}return n.$$set=o=>{"style"in o&&l(5,r=o.style),"elem_id"in o&&l(0,a=o.elem_id),"visible"in o&&l(1,i=o.visible),"variant"in o&&l(2,_=o.variant),"size"in o&&l(3,u=o.size),"$$scope"in o&&l(6,f=o.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l(4,{classes:t}=Q(r,["full_width"]),t)},[a,i,_,u,t,r,f,s,B]}class I extends b{constructor(e){super(),d(this,e,H,G,g,{style:5,elem_id:0,visible:1,variant:2,size:3})}}function J(n){let e=n[5](n[3])+"",l;return{c(){l=E(e)},m(t,s){v(t,l,s)},p(t,s){s&40&&e!==(e=t[5](t[3])+"")&&F(l,e)},d(t){t&&k(l)}}}function L(n){let e,l;return e=new I({props:{variant:n[4],elem_id:n[1],style:n[0],visible:n[2],$$slots:{default:[J]},$$scope:{ctx:n}}}),e.$on("click",n[6]),{c(){R(e.$$.fragment)},m(t,s){X(e,t,s),l=!0},p(t,[s]){const f={};s&16&&(f.variant=t[4]),s&2&&(f.elem_id=t[1]),s&1&&(f.style=t[0]),s&4&&(f.visible=t[2]),s&168&&(f.$$scope={dirty:s,ctx:t}),e.$set(f)},i(t){l||(h(e.$$.fragment,t),l=!0)},o(t){y(e.$$.fragment,t),l=!1},d(t){Z(e,t)}}}function M(n,e,l){let t;A(n,D,u=>l(5,t=u));let{style:s={}}=e,{elem_id:f=""}=e,{visible:r=!0}=e,{value:a}=e,{variant:i="primary"}=e;function _(u){z.call(this,n,u)}return n.$$set=u=>{"style"in u&&l(0,s=u.style),"elem_id"in u&&l(1,f=u.elem_id),"visible"in u&&l(2,r=u.visible),"value"in u&&l(3,a=u.value),"variant"in u&&l(4,i=u.variant)},[s,f,r,a,i,t,_]}class N extends b{constructor(e){super(),d(this,e,M,L,g,{style:0,elem_id:1,visible:2,value:3,variant:4})}}var P=N;const T=["static"],U=n=>({type:"string",description:"button label",example_data:n.value||"Run"});export{P as Component,U as document,T as modes};
|
2 |
+
//# sourceMappingURL=index.39f99b3e.js.map
|
gradio-modified/templates/frontend/assets/index.459183ec.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as N,i as q,s as A,a7 as D,e as m,t as j,a as y,b as f,f as v,g as _,h as C,n as k,c as B,m as I,j as S,k as R,o as M,C as E,w as T,d as z,M as O,a5 as fe,I as V,B as re,U as ue,V as ge,D as oe,E as ce,R as he}from"./index.396f4a72.js";const w=i=>{var e=null;return i<0?e=[52,152,219]:e=[231,76,60],de(_e(Math.abs(i),[255,255,255],e))},_e=(i,e,t)=>{i>1&&(i=1),i=Math.sqrt(i);var n=[0,0,0],c;for(c=0;c<3;c++)n[c]=Math.round(e[c]*(1-i)+t[c]*i);return n},de=i=>"rgb("+i[0]+", "+i[1]+", "+i[2]+")",H=(i,e,t,n,c)=>{var a=n/c,o=e/t,l=0,r=0,u=i?a>o:a<o;return u?(l=e,r=l/a):(r=t,l=r*a),{width:l,height:r,x:(e-l)/2,y:(t-r)/2}};function J(i,e,t){const n=i.slice();return n[2]=e[t],n}function be(i){let e;return{c(){e=j(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&C(e,t[1])},d(t){t&&k(e)}}}function K(i){let e,t=i[2][0]+"",n,c,a;return{c(){e=m("div"),n=j(t),c=y(),f(e,"class","flex-1"),f(e,"style",a="background-color: "+w(i[2][1]))},m(o,l){v(o,e,l),_(e,n),_(e,c)},p(o,l){l&1&&t!==(t=o[2][0]+"")&&C(n,t),l&1&&a!==(a="background-color: "+w(o[2][1]))&&f(e,"style",a)},d(o){o&&k(e)}}}function me(i){let e,t,n,c,a;t=new D({props:{$$slots:{default:[be]},$$scope:{ctx:i}}});let o=i[0],l=[];for(let r=0;r<o.length;r+=1)l[r]=K(J(i,o,r));return{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("div");for(let r=0;r<l.length;r+=1)l[r].c();f(c,"class","interpret_range flex"),f(e,"class","input-number")},m(r,u){v(r,e,u),I(t,e,null),_(e,n),_(e,c);for(let s=0;s<l.length;s+=1)l[s].m(c,null);a=!0},p(r,[u]){const s={};if(u&34&&(s.$$scope={dirty:u,ctx:r}),t.$set(s),u&1){o=r[0];let g;for(g=0;g<o.length;g+=1){const h=J(r,o,g);l[g]?l[g].p(h,u):(l[g]=K(h),l[g].c(),l[g].m(c,null))}for(;g<l.length;g+=1)l[g].d(1);l.length=o.length}},i(r){a||(S(t.$$.fragment,r),a=!0)},o(r){R(t.$$.fragment,r),a=!1},d(r){r&&k(e),M(t),E(l,r)}}}function ve(i,e,t){let{interpretation:n}=e,{label:c=""}=e;return i.$$set=a=>{"interpretation"in a&&t(0,n=a.interpretation),"label"in a&&t(1,c=a.label)},[n,c]}class ke extends N{constructor(e){super(),q(this,e,ve,me,A,{interpretation:0,label:1})}}function L(i,e,t){const n=i.slice();return n[3]=e[t],n[5]=t,n}function pe(i){let e;return{c(){e=j(i[2])},m(t,n){v(t,e,n)},p(t,n){n&4&&C(e,t[2])},d(t){t&&k(e)}}}function P(i){let e,t=i[3]+"",n,c,a;return{c(){e=m("li"),n=j(t),c=y(),f(e,"class","dropdown-item first:rounded-t transition last:rounded-b py-2 px-3 block whitespace-nowrap cursor-pointer"),f(e,"style",a="background-color: "+w(i[0][i[5]]))},m(o,l){v(o,e,l),_(e,n),_(e,c)},p(o,l){l&2&&t!==(t=o[3]+"")&&C(n,t),l&1&&a!==(a="background-color: "+w(o[0][o[5]]))&&f(e,"style",a)},d(o){o&&k(e)}}}function we(i){let e,t,n,c,a;t=new D({props:{$$slots:{default:[pe]},$$scope:{ctx:i}}});let o=i[1],l=[];for(let r=0;r<o.length;r+=1)l[r]=P(L(i,o,r));return{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("ul");for(let r=0;r<l.length;r+=1)l[r].c();f(c,"class","dropdown-menu"),f(e,"class","input-dropdown")},m(r,u){v(r,e,u),I(t,e,null),_(e,n),_(e,c);for(let s=0;s<l.length;s+=1)l[s].m(c,null);a=!0},p(r,[u]){const s={};if(u&68&&(s.$$scope={dirty:u,ctx:r}),t.$set(s),u&3){o=r[1];let g;for(g=0;g<o.length;g+=1){const h=L(r,o,g);l[g]?l[g].p(h,u):(l[g]=P(h),l[g].c(),l[g].m(c,null))}for(;g<l.length;g+=1)l[g].d(1);l.length=o.length}},i(r){a||(S(t.$$.fragment,r),a=!0)},o(r){R(t.$$.fragment,r),a=!1},d(r){r&&k(e),M(t),E(l,r)}}}function ye(i,e,t){let{interpretation:n}=e,{choices:c}=e,{label:a=""}=e;return i.$$set=o=>{"interpretation"in o&&t(0,n=o.interpretation),"choices"in o&&t(1,c=o.choices),"label"in o&&t(2,a=o.label)},[n,c,a]}class xe extends N{constructor(e){super(),q(this,e,ye,we,A,{interpretation:0,choices:1,label:2})}}function je(i){let e;return{c(){e=j(i[0])},m(t,n){v(t,e,n)},p(t,n){n&1&&C(e,t[0])},d(t){t&&k(e)}}}function Ce(i){let e,t,n,c,a,o,l,r,u,s,g,h,d;return t=new D({props:{$$slots:{default:[je]},$$scope:{ctx:i}}}),{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("button"),a=m("div"),l=y(),r=m("div"),u=T("svg"),s=T("line"),g=T("line"),f(a,"class","checkbox w-4 h-4 bg-white flex items-center justify-center border border-gray-400 box-border"),f(a,"style",o="background-color: "+w(i[2][0])),f(s,"x1","-7.5"),f(s,"y1","0"),f(s,"x2","-2.5"),f(s,"y2","5"),f(s,"stroke","black"),f(s,"stroke-width","4"),f(s,"stroke-linecap","round"),f(g,"x1","-2.5"),f(g,"y1","5"),f(g,"x2","7.5"),f(g,"y2","-7.5"),f(g,"stroke","black"),f(g,"stroke-width","4"),f(g,"stroke-linecap","round"),f(u,"class","check h-3 w-4 svelte-r8ethh"),f(u,"viewBox","-10 -10 20 20"),f(r,"class","checkbox w-4 h-4 bg-white flex items-center justify-center border border-gray-400 box-border"),f(r,"style",h="background-color: "+w(i[2][1])),f(c,"class","checkbox-item py-2 px-3 rounded cursor-pointer flex gap-1 svelte-r8ethh"),z(c,"selected",i[1]),f(e,"class","input-checkbox inline-block svelte-r8ethh")},m(b,p){v(b,e,p),I(t,e,null),_(e,n),_(e,c),_(c,a),_(c,l),_(c,r),_(r,u),_(u,s),_(u,g),d=!0},p(b,[p]){const x={};p&9&&(x.$$scope={dirty:p,ctx:b}),t.$set(x),(!d||p&4&&o!==(o="background-color: "+w(b[2][0])))&&f(a,"style",o),(!d||p&4&&h!==(h="background-color: "+w(b[2][1])))&&f(r,"style",h),p&2&&z(c,"selected",b[1])},i(b){d||(S(t.$$.fragment,b),d=!0)},o(b){R(t.$$.fragment,b),d=!1},d(b){b&&k(e),M(t)}}}function Se(i,e,t){let{label:n=""}=e,{original:c}=e,{interpretation:a}=e;return i.$$set=o=>{"label"in o&&t(0,n=o.label),"original"in o&&t(1,c=o.original),"interpretation"in o&&t(2,a=o.interpretation)},[n,c,a]}class Re extends N{constructor(e){super(),q(this,e,Se,Ce,A,{label:0,original:1,interpretation:2})}}function Q(i,e,t){const n=i.slice();return n[4]=e[t],n[6]=t,n}function Be(i){let e;return{c(){e=j(i[3])},m(t,n){v(t,e,n)},p(t,n){n&8&&C(e,t[3])},d(t){t&&k(e)}}}function W(i){let e,t,n,c,a,o,l,r,u,s,g=i[4]+"",h,d;return{c(){e=m("button"),t=m("div"),c=y(),a=m("div"),o=T("svg"),l=T("line"),r=T("line"),s=y(),h=j(g),d=y(),f(t,"class","checkbox w-4 h-4 bg-white flex items-center justify-center border border-gray-400 box-border svelte-h5sk3f"),f(t,"style",n="background-color: "+w(i[1][i[6]][0])),f(l,"x1","-7.5"),f(l,"y1","0"),f(l,"x2","-2.5"),f(l,"y2","5"),f(l,"stroke","black"),f(l,"stroke-width","4"),f(l,"stroke-linecap","round"),f(r,"x1","-2.5"),f(r,"y1","5"),f(r,"x2","7.5"),f(r,"y2","-7.5"),f(r,"stroke","black"),f(r,"stroke-width","4"),f(r,"stroke-linecap","round"),f(o,"class","check h-3 w-4 svelte-h5sk3f"),f(o,"viewBox","-10 -10 20 20"),f(a,"class","checkbox w-4 h-4 bg-white flex items-center justify-center border border-gray-400 box-border svelte-h5sk3f"),f(a,"style",u="background-color: "+w(i[1][i[6]][1])),f(e,"class","checkbox-item py-2 px-3 font-semibold rounded cursor-pointer flex items-center gap-1 svelte-h5sk3f"),z(e,"selected",i[0].includes(i[4]))},m(b,p){v(b,e,p),_(e,t),_(e,c),_(e,a),_(a,o),_(o,l),_(o,r),_(e,s),_(e,h),_(e,d)},p(b,p){p&2&&n!==(n="background-color: "+w(b[1][b[6]][0]))&&f(t,"style",n),p&2&&u!==(u="background-color: "+w(b[1][b[6]][1]))&&f(a,"style",u),p&4&&g!==(g=b[4]+"")&&C(h,g),p&5&&z(e,"selected",b[0].includes(b[4]))},d(b){b&&k(e)}}}function Ie(i){let e,t,n,c;t=new D({props:{$$slots:{default:[Be]},$$scope:{ctx:i}}});let a=i[2],o=[];for(let l=0;l<a.length;l+=1)o[l]=W(Q(i,a,l));return{c(){e=m("div"),B(t.$$.fragment),n=y();for(let l=0;l<o.length;l+=1)o[l].c();f(e,"class","input-checkbox-group flex flex-wrap gap-2 svelte-h5sk3f")},m(l,r){v(l,e,r),I(t,e,null),_(e,n);for(let u=0;u<o.length;u+=1)o[u].m(e,null);c=!0},p(l,[r]){const u={};if(r&136&&(u.$$scope={dirty:r,ctx:l}),t.$set(u),r&7){a=l[2];let s;for(s=0;s<a.length;s+=1){const g=Q(l,a,s);o[s]?o[s].p(g,r):(o[s]=W(g),o[s].c(),o[s].m(e,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=a.length}},i(l){c||(S(t.$$.fragment,l),c=!0)},o(l){R(t.$$.fragment,l),c=!1},d(l){l&&k(e),M(t),E(o,l)}}}function Me(i,e,t){let{original:n}=e,{interpretation:c}=e,{choices:a}=e,{label:o=""}=e;return i.$$set=l=>{"original"in l&&t(0,n=l.original),"interpretation"in l&&t(1,c=l.interpretation),"choices"in l&&t(2,a=l.choices),"label"in l&&t(3,o=l.label)},[n,c,a,o]}class Ne extends N{constructor(e){super(),q(this,e,Me,Ie,A,{original:0,interpretation:1,choices:2,label:3})}}function X(i,e,t){const n=i.slice();return n[6]=e[t],n}function qe(i){let e;return{c(){e=j(i[5])},m(t,n){v(t,e,n)},p(t,n){n&32&&C(e,t[5])},d(t){t&&k(e)}}}function Y(i){let e,t;return{c(){e=m("div"),f(e,"class","flex-1 h-4"),f(e,"style",t="background-color: "+w(i[6]))},m(n,c){v(n,e,c)},p(n,c){c&2&&t!==(t="background-color: "+w(n[6]))&&f(e,"style",t)},d(n){n&&k(e)}}}function Ae(i){let e,t,n,c,a,o,l,r,u,s;t=new D({props:{$$slots:{default:[qe]},$$scope:{ctx:i}}});let g=i[1],h=[];for(let d=0;d<g.length;d+=1)h[d]=Y(X(i,g,d));return{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("input"),a=y(),o=m("div");for(let d=0;d<h.length;d+=1)h[d].c();l=y(),r=m("div"),u=j(i[0]),f(c,"type","range"),f(c,"class","range w-full appearance-none transition rounded h-4 bg-blue-400 svelte-3aijhr"),c.disabled=!0,f(c,"min",i[2]),f(c,"max",i[3]),f(c,"step",i[4]),f(o,"class","interpret_range flex"),f(r,"class","original inline-block mx-auto mt-1 px-2 py-0.5 rounded"),f(e,"class","input-slider text-center svelte-3aijhr")},m(d,b){v(d,e,b),I(t,e,null),_(e,n),_(e,c),_(e,a),_(e,o);for(let p=0;p<h.length;p+=1)h[p].m(o,null);_(e,l),_(e,r),_(r,u),s=!0},p(d,[b]){const p={};if(b&544&&(p.$$scope={dirty:b,ctx:d}),t.$set(p),(!s||b&4)&&f(c,"min",d[2]),(!s||b&8)&&f(c,"max",d[3]),(!s||b&16)&&f(c,"step",d[4]),b&2){g=d[1];let x;for(x=0;x<g.length;x+=1){const G=X(d,g,x);h[x]?h[x].p(G,b):(h[x]=Y(G),h[x].c(),h[x].m(o,null))}for(;x<h.length;x+=1)h[x].d(1);h.length=g.length}(!s||b&1)&&C(u,d[0])},i(d){s||(S(t.$$.fragment,d),s=!0)},o(d){R(t.$$.fragment,d),s=!1},d(d){d&&k(e),M(t),E(h,d)}}}function De(i,e,t){let{original:n}=e,{interpretation:c}=e,{minimum:a}=e,{maximum:o}=e,{step:l}=e,{label:r=""}=e;return i.$$set=u=>{"original"in u&&t(0,n=u.original),"interpretation"in u&&t(1,c=u.interpretation),"minimum"in u&&t(2,a=u.minimum),"maximum"in u&&t(3,o=u.maximum),"step"in u&&t(4,l=u.step),"label"in u&&t(5,r=u.label)},[n,c,a,o,l,r]}class Ee extends N{constructor(e){super(),q(this,e,De,Ae,A,{original:0,interpretation:1,minimum:2,maximum:3,step:4,label:5})}}function Z(i,e,t){const n=i.slice();return n[4]=e[t],n[6]=t,n}function Te(i){let e;return{c(){e=j(i[3])},m(t,n){v(t,e,n)},p(t,n){n&8&&C(e,t[3])},d(t){t&&k(e)}}}function $(i){let e,t,n,c,a=i[4]+"",o,l;return{c(){e=m("button"),t=m("div"),c=y(),o=j(a),l=y(),f(t,"class","radio-circle w-4 h-4 rounded-full box-border svelte-145r163"),f(t,"style",n="background-color: "+w(i[1][i[6]])),f(e,"class","radio-item py-2 px-3 font-semibold rounded cursor-pointer flex items-center gap-2 svelte-145r163"),z(e,"selected",i[0]===i[4])},m(r,u){v(r,e,u),_(e,t),_(e,c),_(e,o),_(e,l)},p(r,u){u&2&&n!==(n="background-color: "+w(r[1][r[6]]))&&f(t,"style",n),u&4&&a!==(a=r[4]+"")&&C(o,a),u&5&&z(e,"selected",r[0]===r[4])},d(r){r&&k(e)}}}function ze(i){let e,t,n,c;t=new D({props:{$$slots:{default:[Te]},$$scope:{ctx:i}}});let a=i[2],o=[];for(let l=0;l<a.length;l+=1)o[l]=$(Z(i,a,l));return{c(){e=m("div"),B(t.$$.fragment),n=y();for(let l=0;l<o.length;l+=1)o[l].c();f(e,"class","input-radio flex flex-wrap gap-2 svelte-145r163")},m(l,r){v(l,e,r),I(t,e,null),_(e,n);for(let u=0;u<o.length;u+=1)o[u].m(e,null);c=!0},p(l,[r]){const u={};if(r&136&&(u.$$scope={dirty:r,ctx:l}),t.$set(u),r&7){a=l[2];let s;for(s=0;s<a.length;s+=1){const g=Z(l,a,s);o[s]?o[s].p(g,r):(o[s]=$(g),o[s].c(),o[s].m(e,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=a.length}},i(l){c||(S(t.$$.fragment,l),c=!0)},o(l){R(t.$$.fragment,l),c=!1},d(l){l&&k(e),M(t),E(o,l)}}}function Ge(i,e,t){let{original:n}=e,{interpretation:c}=e,{choices:a}=e,{label:o=""}=e;return i.$$set=l=>{"original"in l&&t(0,n=l.original),"interpretation"in l&&t(1,c=l.interpretation),"choices"in l&&t(2,a=l.choices),"label"in l&&t(3,o=l.label)},[n,c,a,o]}class Ue extends N{constructor(e){super(),q(this,e,Ge,ze,A,{original:0,interpretation:1,choices:2,label:3})}}function Fe(i){let e;return{c(){e=j(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&C(e,t[1])},d(t){t&&k(e)}}}function Oe(i){let e,t,n,c,a,o,l,r,u,s;return t=new D({props:{$$slots:{default:[Fe]},$$scope:{ctx:i}}}),{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("div"),a=m("div"),o=m("canvas"),l=y(),r=m("img"),f(a,"class","interpretation w-full h-full absolute top-0 left-0 flex justify-center items-center opacity-90 hover:opacity-20 transition"),f(r,"class","w-full h-full object-contain"),O(r.src,u=i[0])||f(r,"src",u),f(c,"class","image-preview w-full h-60 flex justify-center items-center bg-gray-200 dark:bg-gray-600 relative"),f(e,"class","input-image")},m(g,h){v(g,e,h),I(t,e,null),_(e,n),_(e,c),_(c,a),_(a,o),i[6](o),_(c,l),_(c,r),i[7](r),s=!0},p(g,[h]){const d={};h&514&&(d.$$scope={dirty:h,ctx:g}),t.$set(d),(!s||h&1&&!O(r.src,u=g[0]))&&f(r,"src",u)},i(g){s||(S(t.$$.fragment,g),s=!0)},o(g){R(t.$$.fragment,g),s=!1},d(g){g&&k(e),M(t),i[6](null),i[7](null)}}}function Ve(i,e,t){let{original:n}=e,{interpretation:c}=e,{shape:a}=e,{label:o=""}=e,l,r;const u=(h,d,b,p)=>{var x=b/h[0].length,G=p/h.length,U=0;h.forEach(function(ae){var F=0;ae.forEach(function(se){d.fillStyle=w(se),d.fillRect(F*x,U*G,x,G),F++}),U++})};fe(()=>{let h=H(!0,r.width,r.height,r.naturalWidth,r.naturalHeight);a&&(h=H(!0,h.width,h.height,a[0],a[1]));let d=h.width,b=h.height;l.setAttribute("height",`${b}`),l.setAttribute("width",`${d}`),u(c,l.getContext("2d"),d,b)});function s(h){V[h?"unshift":"push"](()=>{l=h,t(2,l)})}function g(h){V[h?"unshift":"push"](()=>{r=h,t(3,r)})}return i.$$set=h=>{"original"in h&&t(0,n=h.original),"interpretation"in h&&t(4,c=h.interpretation),"shape"in h&&t(5,a=h.shape),"label"in h&&t(1,o=h.label)},[n,o,l,r,c,a,s,g]}class He extends N{constructor(e){super(),q(this,e,Ve,Oe,A,{original:0,interpretation:4,shape:5,label:1})}}function ee(i,e,t){const n=i.slice();return n[2]=e[t],n}function Je(i){let e;return{c(){e=j(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&C(e,t[1])},d(t){t&&k(e)}}}function te(i){let e,t;return{c(){e=m("div"),f(e,"class","flex-1 h-4"),f(e,"style",t="background-color: "+w(i[2]))},m(n,c){v(n,e,c)},p(n,c){c&1&&t!==(t="background-color: "+w(n[2]))&&f(e,"style",t)},d(n){n&&k(e)}}}function Ke(i){let e,t,n,c,a;t=new D({props:{$$slots:{default:[Je]},$$scope:{ctx:i}}});let o=i[0],l=[];for(let r=0;r<o.length;r+=1)l[r]=te(ee(i,o,r));return{c(){e=m("div"),B(t.$$.fragment),n=y(),c=m("div");for(let r=0;r<l.length;r+=1)l[r].c();f(c,"class","interpret_range flex"),f(e,"class","input-audio")},m(r,u){v(r,e,u),I(t,e,null),_(e,n),_(e,c);for(let s=0;s<l.length;s+=1)l[s].m(c,null);a=!0},p(r,[u]){const s={};if(u&34&&(s.$$scope={dirty:u,ctx:r}),t.$set(s),u&1){o=r[0];let g;for(g=0;g<o.length;g+=1){const h=ee(r,o,g);l[g]?l[g].p(h,u):(l[g]=te(h),l[g].c(),l[g].m(c,null))}for(;g<l.length;g+=1)l[g].d(1);l.length=o.length}},i(r){a||(S(t.$$.fragment,r),a=!0)},o(r){R(t.$$.fragment,r),a=!1},d(r){r&&k(e),M(t),E(l,r)}}}function Le(i,e,t){let{interpretation:n}=e,{label:c=""}=e;return i.$$set=a=>{"interpretation"in a&&t(0,n=a.interpretation),"label"in a&&t(1,c=a.label)},[n,c]}class Pe extends N{constructor(e){super(),q(this,e,Le,Ke,A,{interpretation:0,label:1})}}function le(i,e,t){const n=i.slice();return n[2]=e[t][0],n[3]=e[t][1],n}function Qe(i){let e;return{c(){e=j(i[0])},m(t,n){v(t,e,n)},p(t,n){n&1&&C(e,t[0])},d(t){t&&k(e)}}}function ne(i){let e,t=i[2]+"",n,c,a;return{c(){e=m("span"),n=j(t),c=y(),f(e,"class","textspan p-1 bg-opacity-20 dark:bg-opacity-80"),f(e,"style",a="background-color: "+w(i[3]))},m(o,l){v(o,e,l),_(e,n),_(e,c)},p(o,l){l&2&&t!==(t=o[2]+"")&&C(n,t),l&2&&a!==(a="background-color: "+w(o[3]))&&f(e,"style",a)},d(o){o&&k(e)}}}function We(i){let e,t,n,c;t=new D({props:{$$slots:{default:[Qe]},$$scope:{ctx:i}}});let a=i[1],o=[];for(let l=0;l<a.length;l+=1)o[l]=ne(le(i,a,l));return{c(){e=m("div"),B(t.$$.fragment),n=y();for(let l=0;l<o.length;l+=1)o[l].c();f(e,"class","input-text w-full rounded box-border p-2 break-word")},m(l,r){v(l,e,r),I(t,e,null),_(e,n);for(let u=0;u<o.length;u+=1)o[u].m(e,null);c=!0},p(l,[r]){const u={};if(r&65&&(u.$$scope={dirty:r,ctx:l}),t.$set(u),r&2){a=l[1];let s;for(s=0;s<a.length;s+=1){const g=le(l,a,s);o[s]?o[s].p(g,r):(o[s]=ne(g),o[s].c(),o[s].m(e,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=a.length}},i(l){c||(S(t.$$.fragment,l),c=!0)},o(l){R(t.$$.fragment,l),c=!1},d(l){l&&k(e),M(t),E(o,l)}}}function Xe(i,e,t){let{label:n=""}=e,{interpretation:c}=e;return i.$$set=a=>{"label"in a&&t(0,n=a.label),"interpretation"in a&&t(1,c=a.interpretation)},[n,c]}class Ye extends N{constructor(e){super(),q(this,e,Xe,We,A,{label:0,interpretation:1})}}const Ze={audio:Pe,dropdown:xe,checkbox:Re,checkboxgroup:Ne,number:ke,slider:Ee,radio:Ue,image:He,textbox:Ye};function ie(i){let e,t,n;const c=[i[0],{original:i[1].original},{interpretation:i[1].interpretation}];var a=i[2];function o(l){let r={};for(let u=0;u<c.length;u+=1)r=he(r,c[u]);return{props:r}}return a&&(e=new a(o())),{c(){e&&B(e.$$.fragment),t=re()},m(l,r){e&&I(e,l,r),v(l,t,r),n=!0},p(l,r){const u=r&3?ue(c,[r&1&&ge(l[0]),r&2&&{original:l[1].original},r&2&&{interpretation:l[1].interpretation}]):{};if(a!==(a=l[2])){if(e){oe();const s=e;R(s.$$.fragment,1,0,()=>{M(s,1)}),ce()}a?(e=new a(o()),B(e.$$.fragment),S(e.$$.fragment,1),I(e,t.parentNode,t)):e=null}else a&&e.$set(u)},i(l){n||(e&&S(e.$$.fragment,l),n=!0)},o(l){e&&R(e.$$.fragment,l),n=!1},d(l){l&&k(t),e&&M(e,l)}}}function $e(i){let e,t,n=i[1]&&ie(i);return{c(){n&&n.c(),e=re()},m(c,a){n&&n.m(c,a),v(c,e,a),t=!0},p(c,[a]){c[1]?n?(n.p(c,a),a&2&&S(n,1)):(n=ie(c),n.c(),S(n,1),n.m(e.parentNode,e)):n&&(oe(),R(n,1,1,()=>{n=null}),ce())},i(c){t||(S(n),t=!0)},o(c){R(n),t=!1},d(c){n&&n.d(c),c&&k(e)}}}function et(i,e,t){let n,{component:c}=e,{component_props:a}=e,{value:o}=e;return i.$$set=l=>{"component"in l&&t(3,c=l.component),"component_props"in l&&t(0,a=l.component_props),"value"in l&&t(1,o=l.value)},i.$$.update=()=>{i.$$.dirty&8&&t(2,n=Ze[c])},[a,o,n,c]}class tt extends N{constructor(e){super(),q(this,e,et,$e,A,{component:3,component_props:0,value:1})}}var nt=tt;const it=["dynamic"];export{nt as Component,it as modes};
|
2 |
+
//# sourceMappingURL=index.459183ec.js.map
|
gradio-modified/templates/frontend/assets/index.4762eb88.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as j,i as q,s as y,e as g,a as B,t as F,b as d,d as S,f as D,g as m,l as I,h as K,x as T,n as E,F as L,P as O,c as h,m as k,j as v,k as C,o as w,R as P,T as R,I as U,O as V,U as z,V as A,L as G,K as H}from"./index.396f4a72.js";function J(s){let e,t,a,i,c,r,f;return{c(){e=g("label"),t=g("input"),a=B(),i=g("span"),c=F(s[2]),t.disabled=s[1],t.checked=s[0],d(t,"type","checkbox"),d(t,"name","test"),d(t,"class","gr-check-radio gr-checkbox"),d(i,"class","ml-2"),d(e,"class","flex items-center text-gray-700 text-sm space-x-2 rounded-lg cursor-pointer dark:bg-transparent "),S(e,"!cursor-not-allowed",s[1])},m(u,l){D(u,e,l),m(e,t),m(e,a),m(e,i),m(i,c),r||(f=I(t,"change",s[4]),r=!0)},p(u,[l]){l&2&&(t.disabled=u[1]),l&1&&(t.checked=u[0]),l&4&&K(c,u[2]),l&2&&S(e,"!cursor-not-allowed",u[1])},i:T,o:T,d(u){u&&E(e),r=!1,f()}}}function M(s,e,t){let{value:a}=e,{disabled:i=!1}=e,{label:c}=e;const r=L();function f(l){t(0,a=l.currentTarget.checked),r("change",a)}const u=l=>f(l);return s.$$set=l=>{"value"in l&&t(0,a=l.value),"disabled"in l&&t(1,i=l.disabled),"label"in l&&t(2,c=l.label)},[a,i,c,f,u]}class N extends j{constructor(e){super(),q(this,e,M,J,y,{value:0,disabled:1,label:2})}}function Q(s){let e,t,a,i,c;const r=[s[6]];let f={};for(let n=0;n<r.length;n+=1)f=P(f,r[n]);e=new R({props:f});function u(n){s[7](n)}let l={label:s[3],disabled:s[4]==="static"};return s[0]!==void 0&&(l.value=s[0]),a=new N({props:l}),U.push(()=>V(a,"value",u)),a.$on("change",s[8]),{c(){h(e.$$.fragment),t=B(),h(a.$$.fragment)},m(n,b){k(e,n,b),D(n,t,b),k(a,n,b),c=!0},p(n,b){const o=b&64?z(r,[A(n[6])]):{};e.$set(o);const _={};b&8&&(_.label=n[3]),b&16&&(_.disabled=n[4]==="static"),!i&&b&1&&(i=!0,_.value=n[0],G(()=>i=!1)),a.$set(_)},i(n){c||(v(e.$$.fragment,n),v(a.$$.fragment,n),c=!0)},o(n){C(e.$$.fragment,n),C(a.$$.fragment,n),c=!1},d(n){w(e,n),n&&E(t),w(a,n)}}}function W(s){let e,t;return e=new O({props:{visible:s[2],elem_id:s[1],disable:typeof s[5].container=="boolean"&&!s[5].container,$$slots:{default:[Q]},$$scope:{ctx:s}}}),{c(){h(e.$$.fragment)},m(a,i){k(e,a,i),t=!0},p(a,[i]){const c={};i&4&&(c.visible=a[2]),i&2&&(c.elem_id=a[1]),i&32&&(c.disable=typeof a[5].container=="boolean"&&!a[5].container),i&601&&(c.$$scope={dirty:i,ctx:a}),e.$set(c)},i(a){t||(v(e.$$.fragment,a),t=!0)},o(a){C(e.$$.fragment,a),t=!1},d(a){w(e,a)}}}function X(s,e,t){let{elem_id:a=""}=e,{visible:i=!0}=e,{value:c=!1}=e,{label:r="Checkbox"}=e,{mode:f}=e,{style:u={}}=e,{loading_status:l}=e;function n(o){c=o,t(0,c)}function b(o){H.call(this,s,o)}return s.$$set=o=>{"elem_id"in o&&t(1,a=o.elem_id),"visible"in o&&t(2,i=o.visible),"value"in o&&t(0,c=o.value),"label"in o&&t(3,r=o.label),"mode"in o&&t(4,f=o.mode),"style"in o&&t(5,u=o.style),"loading_status"in o&&t(6,l=o.loading_status)},[c,a,i,r,f,u,l,n,b]}class Y extends j{constructor(e){super(),q(this,e,X,W,y,{elem_id:1,visible:2,value:0,label:3,mode:4,style:5,loading_status:6})}}var p=Y;const x=["static","dynamic"],$=s=>({type:"boolean",description:"checked status",example_data:s.value??!0});export{p as Component,$ as document,x as modes};
|
2 |
+
//# sourceMappingURL=index.4762eb88.js.map
|
gradio-modified/templates/frontend/assets/index.4f1294f6.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as f,i as r,s as d,p as m,e as c,b as _,d as u,f as v,u as g,q as b,r as h,j as p,k as G,n as q}from"./index.396f4a72.js";function C(n){let s,l;const o=n[3].default,t=m(o,n,n[2],null);return{c(){s=c("div"),t&&t.c(),_(s,"id",n[0]),_(s,"class","svelte-10ogue4"),u(s,"hidden",!n[1])},m(e,i){v(e,s,i),t&&t.m(s,null),l=!0},p(e,[i]){t&&t.p&&(!l||i&4)&&g(t,o,e,e[2],l?h(o,e[2],i,null):b(e[2]),null),(!l||i&1)&&_(s,"id",e[0]),i&2&&u(s,"hidden",!e[1])},i(e){l||(p(t,e),l=!0)},o(e){G(t,e),l=!1},d(e){e&&q(s),t&&t.d(e)}}}function S(n,s,l){let{$$slots:o={},$$scope:t}=s,{elem_id:e=""}=s,{visible:i=!0}=s;return n.$$set=a=>{"elem_id"in a&&l(0,e=a.elem_id),"visible"in a&&l(1,i=a.visible),"$$scope"in a&&l(2,t=a.$$scope)},[e,i,t,o]}class j extends f{constructor(s){super(),r(this,s,S,C,d,{elem_id:0,visible:1})}}var w=j;const y=["static"];export{w as Component,y as modes};
|
2 |
+
//# sourceMappingURL=index.4f1294f6.js.map
|
gradio-modified/templates/frontend/assets/index.50b5507a.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as pe,i as ke,s as ve,ae as te,P as we,c as M,m as N,l as T,j as y,k as B,o as S,Z as ye,R as je,T as ze,a as D,B as Ae,f as C,U as Be,V as Ce,D as E,E as H,n as G,aa as Ge,I as F,e as w,b as h,M as L,Y as J,d as A,g as j,t as ne,h as ie,C as oe,A as De,ai as Ie,x as U}from"./index.396f4a72.js";import{B as Re}from"./BlockLabel.37da86a3.js";import{M as Le}from"./ModifyUpload.2cfe71e4.js";import{n as K}from"./utils.27234e1d.js";import{I as Y}from"./Image.4a41f1aa.js";function O(t,e,l){const i=t.slice();return i[30]=e[l][0],i[31]=e[l][1],i[33]=l,i}function Q(t,e,l){const i=t.slice();return i[30]=e[l],i[34]=e,i[33]=l,i}function W(t){let e,l;return e=new Re({props:{show_label:t[1],Icon:Y,label:t[2]||"Gallery",disable:typeof t[6].container=="boolean"&&!t[6].container}}),{c(){M(e.$$.fragment)},m(i,o){N(e,i,o),l=!0},p(i,o){const n={};o[0]&2&&(n.show_label=i[1]),o[0]&4&&(n.label=i[2]||"Gallery"),o[0]&64&&(n.disable=typeof i[6].container=="boolean"&&!i[6].container),e.$set(n)},i(i){l||(y(e.$$.fragment,i),l=!0)},o(i){B(e.$$.fragment,i),l=!1},d(i){S(e,i)}}}function Me(t){let e,l,i,o,n,r,a=t[7]!==null&&X(t);const p=[Te,Se],m=[];function g(f,c){return f[10].length===0?0:1}return i=g(t),o=m[i]=p[i](t),{c(){a&&a.c(),e=D(),l=w("div"),o.c(),h(l,"class","overflow-y-auto h-full p-2"),te(()=>t[27].call(l)),A(l,"min-h-[350px]",t[6].height!=="auto"),A(l,"max-h-[55vh]",t[6].height!=="auto"),A(l,"xl:min-h-[450px]",t[6].height!=="auto")},m(f,c){a&&a.m(f,c),C(f,e,c),C(f,l,c),m[i].m(l,null),n=Ie(l,t[27].bind(l)),r=!0},p(f,c){f[7]!==null?a?(a.p(f,c),c[0]&128&&y(a,1)):(a=X(f),a.c(),y(a,1),a.m(e.parentNode,e)):a&&(E(),B(a,1,1,()=>{a=null}),H());let z=i;i=g(f),i===z?m[i].p(f,c):(E(),B(m[z],1,1,()=>{m[z]=null}),H(),o=m[i],o?o.p(f,c):(o=m[i]=p[i](f),o.c()),y(o,1),o.m(l,null)),c[0]&64&&A(l,"min-h-[350px]",f[6].height!=="auto"),c[0]&64&&A(l,"max-h-[55vh]",f[6].height!=="auto"),c[0]&64&&A(l,"xl:min-h-[450px]",f[6].height!=="auto")},i(f){r||(y(a),y(o),r=!0)},o(f){B(a),B(o),r=!1},d(f){a&&a.d(f),f&&G(e),f&&G(l),m[i].d(),n()}}}function Ne(t){let e,l,i,o;return i=new Y({}),{c(){e=w("div"),l=w("div"),M(i.$$.fragment),h(l,"class","h-5 dark:text-white opacity-50"),h(e,"class","h-full min-h-[15rem] flex justify-center items-center")},m(n,r){C(n,e,r),j(e,l),N(i,l,null),o=!0},p:U,i(n){o||(y(i.$$.fragment,n),o=!0)},o(n){B(i.$$.fragment,n),o=!1},d(n){n&&G(e),S(i)}}}function X(t){let e,l,i,o,n,r,a,p,m,g,f,c,z;l=new Le({}),l.$on("clear",t[21]);let s=t[10][t[7]][1]&&$(t),b=t[10],k=[];for(let u=0;u<b.length;u+=1)k[u]=x(Q(t,b,u));return{c(){e=w("div"),M(l.$$.fragment),i=D(),o=w("img"),p=D(),s&&s.c(),m=D(),g=w("div");for(let u=0;u<k.length;u+=1)k[u].c();h(o,"class","w-full object-contain h-[calc(100%-50px)"),L(o.src,n=t[10][t[7]][0].data)||h(o,"src",n),h(o,"alt",r=t[10][t[7]][1]||""),h(o,"title",a=t[10][t[7]][1]||null),J(o,"height","calc(100% - "+(t[10][t[7]][1]?"80px":"60px")+")"),h(g,"class","absolute h-[60px] overflow-x-scroll scroll-hide w-full bottom-0 flex gap-1.5 items-center py-2 text-sm px-3 justify-center"),h(e,"class","absolute group inset-0 z-10 flex flex-col bg-white/90 dark:bg-gray-900 backdrop-blur h-full"),A(e,"min-h-[350px]",t[6].height!=="auto"),A(e,"max-h-[55vh]",t[6].height!=="auto"),A(e,"xl:min-h-[450px]",t[6].height!=="auto")},m(u,d){C(u,e,d),N(l,e,null),j(e,i),j(e,o),j(e,p),s&&s.m(e,null),j(e,m),j(e,g);for(let v=0;v<k.length;v+=1)k[v].m(g,null);t[25](g),f=!0,c||(z=[T(o,"click",t[22]),T(e,"keydown",t[16])],c=!0)},p(u,d){if((!f||d[0]&1152&&!L(o.src,n=u[10][u[7]][0].data))&&h(o,"src",n),(!f||d[0]&1152&&r!==(r=u[10][u[7]][1]||""))&&h(o,"alt",r),(!f||d[0]&1152&&a!==(a=u[10][u[7]][1]||null))&&h(o,"title",a),(!f||d[0]&1152)&&J(o,"height","calc(100% - "+(u[10][u[7]][1]?"80px":"60px")+")"),u[10][u[7]][1]?s?s.p(u,d):(s=$(u),s.c(),s.m(e,m)):s&&(s.d(1),s=null),d[0]&3200){b=u[10];let v;for(v=0;v<b.length;v+=1){const I=Q(u,b,v);k[v]?k[v].p(I,d):(k[v]=x(I),k[v].c(),k[v].m(g,null))}for(;v<k.length;v+=1)k[v].d(1);k.length=b.length}d[0]&64&&A(e,"min-h-[350px]",u[6].height!=="auto"),d[0]&64&&A(e,"max-h-[55vh]",u[6].height!=="auto"),d[0]&64&&A(e,"xl:min-h-[450px]",u[6].height!=="auto")},i(u){f||(y(l.$$.fragment,u),f=!0)},o(u){B(l.$$.fragment,u),f=!1},d(u){u&&G(e),S(l),s&&s.d(),oe(k,u),t[25](null),c=!1,De(z)}}}function $(t){let e,l,i=t[10][t[7]][1]+"",o;return{c(){e=w("div"),l=w("div"),o=ne(i),h(l,"class","dark:text-gray-200 font-semibold px-3 py-1 max-w-full truncate"),h(e,"class","bottom-[50px] absolute z-[5] flex justify-center w-full")},m(n,r){C(n,e,r),j(e,l),j(l,o)},p(n,r){r[0]&1152&&i!==(i=n[10][n[7]][1]+"")&&ie(o,i)},d(n){n&&G(e)}}}function x(t){let e,l,i,o,n,r,a,p=t[33],m,g;const f=()=>t[23](e,p),c=()=>t[23](null,p);function z(){return t[24](t[33])}return{c(){e=w("button"),l=w("img"),r=D(),h(l,"class","h-full w-full overflow-hidden object-contain"),L(l.src,i=t[30][0].data)||h(l,"src",i),h(l,"title",o=t[30][1]||null),h(l,"alt",n=t[30][1]||null),h(e,"class",a="gallery-item !flex-none !h-9 !w-9 transition-all duration-75 "+(t[7]===t[33]?"!ring-2 !ring-orange-500 hover:!ring-orange-500":"scale-90 transform")+" svelte-1g9btlg")},m(s,b){C(s,e,b),j(e,l),j(e,r),f(),m||(g=T(e,"click",z),m=!0)},p(s,b){t=s,b[0]&1024&&!L(l.src,i=t[30][0].data)&&h(l,"src",i),b[0]&1024&&o!==(o=t[30][1]||null)&&h(l,"title",o),b[0]&1024&&n!==(n=t[30][1]||null)&&h(l,"alt",n),b[0]&128&&a!==(a="gallery-item !flex-none !h-9 !w-9 transition-all duration-75 "+(t[7]===t[33]?"!ring-2 !ring-orange-500 hover:!ring-orange-500":"scale-90 transform")+" svelte-1g9btlg")&&h(e,"class",a),p!==t[33]&&(c(),p=t[33],f())},d(s){s&&G(e),c(),m=!1,g()}}}function Se(t){let e,l,i=t[10],o=[];for(let n=0;n<i.length;n+=1)o[n]=le(O(t,i,n));return{c(){e=w("div");for(let n=0;n<o.length;n+=1)o[n].c();h(e,"class",l="grid gap-2 "+t[13]+" svelte-1g9btlg"),A(e,"pt-6",t[1])},m(n,r){C(n,e,r);for(let a=0;a<o.length;a+=1)o[a].m(e,null)},p(n,r){if(r[0]&17536){i=n[10];let a;for(a=0;a<i.length;a+=1){const p=O(n,i,a);o[a]?o[a].p(p,r):(o[a]=le(p),o[a].c(),o[a].m(e,null))}for(;a<o.length;a+=1)o[a].d(1);o.length=i.length}r[0]&8192&&l!==(l="grid gap-2 "+n[13]+" svelte-1g9btlg")&&h(e,"class",l),r[0]&8194&&A(e,"pt-6",n[1])},i:U,o:U,d(n){n&&G(e),oe(o,n)}}}function Te(t){let e,l,i,o;return i=new Y({}),{c(){e=w("div"),l=w("div"),M(i.$$.fragment),h(l,"class","h-5 dark:text-white opacity-50"),h(e,"class","h-full min-h-[15rem] flex justify-center items-center")},m(n,r){C(n,e,r),j(e,l),N(i,l,null),o=!0},p:U,i(n){o||(y(i.$$.fragment,n),o=!0)},o(n){B(i.$$.fragment,n),o=!1},d(n){n&&G(e),S(i)}}}function ee(t){let e,l,i=t[31]+"",o;return{c(){e=w("div"),l=w("div"),o=ne(i),h(l,"class","bg-gray-50 dark:bg-gray-700 dark:text-gray-200 text-xs border-t border-l dark:border-gray-600 font-semibold px-3 py-1 rounded-tl-lg group-hover:opacity-50 max-w-full truncate"),h(e,"class","bottom-0 absolute z-[5] flex justify-end w-full")},m(n,r){C(n,e,r),j(e,l),j(l,o)},p(n,r){r[0]&1024&&i!==(i=n[31]+"")&&ie(o,i)},d(n){n&&G(e)}}}function le(t){let e,l,i,o,n,r,a,p,m=t[31]&&ee(t);function g(){return t[26](t[33])}return{c(){e=w("button"),l=w("img"),n=D(),m&&m.c(),r=D(),h(l,"alt",i=t[31]||""),h(l,"class","h-full w-full overflow-hidden object-contain"),L(l.src,o=typeof t[30]=="string"?t[30]:t[30].data)||h(l,"src",o),h(e,"class","gallery-item group svelte-1g9btlg")},m(f,c){C(f,e,c),j(e,l),j(e,n),m&&m.m(e,null),j(e,r),a||(p=T(e,"click",g),a=!0)},p(f,c){t=f,c[0]&1024&&i!==(i=t[31]||"")&&h(l,"alt",i),c[0]&1024&&!L(l.src,o=typeof t[30]=="string"?t[30]:t[30].data)&&h(l,"src",o),t[31]?m?m.p(t,c):(m=ee(t),m.c(),m.m(e,r)):m&&(m.d(1),m=null)},d(f){f&&G(e),m&&m.d(),a=!1,p()}}}function qe(t){let e,l,i,o,n,r,a;const p=[t[0]];let m={};for(let s=0;s<p.length;s+=1)m=je(m,p[s]);e=new ze({props:m});let g=t[1]&&W(t);const f=[Ne,Me],c=[];function z(s,b){return s[5]===null||s[10]===null?0:1}return o=z(t),n=c[o]=f[o](t),{c(){M(e.$$.fragment),l=D(),g&&g.c(),i=D(),n.c(),r=Ae()},m(s,b){N(e,s,b),C(s,l,b),g&&g.m(s,b),C(s,i,b),c[o].m(s,b),C(s,r,b),a=!0},p(s,b){const k=b[0]&1?Be(p,[Ce(s[0])]):{};e.$set(k),s[1]?g?(g.p(s,b),b[0]&2&&y(g,1)):(g=W(s),g.c(),y(g,1),g.m(i.parentNode,i)):g&&(E(),B(g,1,1,()=>{g=null}),H());let u=o;o=z(s),o===u?c[o].p(s,b):(E(),B(c[u],1,1,()=>{c[u]=null}),H(),n=c[o],n?n.p(s,b):(n=c[o]=f[o](s),n.c()),y(n,1),n.m(r.parentNode,r))},i(s){a||(y(e.$$.fragment,s),y(g),y(n),a=!0)},o(s){B(e.$$.fragment,s),B(g),B(n),a=!1},d(s){S(e,s),s&&G(l),g&&g.d(s),s&&G(i),c[o].d(s),s&&G(r)}}}function Ee(t){let e,l,i,o;return te(t[20]),e=new we({props:{visible:t[4],variant:"solid",color:"grey",padding:!1,elem_id:t[3],disable:typeof t[6].container=="boolean"&&!t[6].container,$$slots:{default:[qe]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,r){N(e,n,r),l=!0,i||(o=T(window,"resize",t[20]),i=!0)},p(n,r){const a={};r[0]&16&&(a.visible=n[4]),r[0]&8&&(a.elem_id=n[3]),r[0]&64&&(a.disable=typeof n[6].container=="boolean"&&!n[6].container),r[0]&64999|r[1]&16&&(a.$$scope={dirty:r,ctx:n}),e.$set(a)},i(n){l||(y(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){S(e,n),i=!1,o()}}}function He(t,e,l){let i,o,n,r,a,{loading_status:p}=e,{show_label:m}=e,{label:g}=e,{root:f}=e,{root_url:c}=e,{elem_id:z=""}=e,{visible:s=!0}=e,{value:b=null}=e,{style:k={}}=e,u=null,d=null;function v(_){switch(_.code){case"Escape":_.preventDefault(),l(7,d=null);break;case"ArrowLeft":_.preventDefault(),l(7,d=o);break;case"ArrowRight":_.preventDefault(),l(7,d=n);break}}let I=[],R;async function ae(_){if(typeof _!="number")return;await Ge(),I[_].focus();const{left:P,width:he}=R.getBoundingClientRect(),{left:be,width:de}=I[_].getBoundingClientRect(),Z=be-P+de/2-he/2+R.scrollLeft;R.scrollTo({left:Z<0?0:Z,behavior:"smooth"})}let q=0,V=0;function se(){l(9,V=window.innerHeight)}const re=()=>l(7,d=null),fe=()=>l(7,d=n);function ue(_,P){F[_?"unshift":"push"](()=>{I[P]=_,l(11,I)})}const _e=_=>l(7,d=_);function ce(_){F[_?"unshift":"push"](()=>{R=_,l(12,R)})}const me=_=>l(7,d=r?_:d);function ge(){q=this.clientHeight,l(8,q)}return t.$$set=_=>{"loading_status"in _&&l(0,p=_.loading_status),"show_label"in _&&l(1,m=_.show_label),"label"in _&&l(2,g=_.label),"root"in _&&l(17,f=_.root),"root_url"in _&&l(18,c=_.root_url),"elem_id"in _&&l(3,z=_.elem_id),"visible"in _&&l(4,s=_.visible),"value"in _&&l(5,b=_.value),"style"in _&&l(6,k=_.style)},t.$$.update=()=>{t.$$.dirty[0]&393248&&l(10,i=b===null?null:b.map(_=>Array.isArray(_)?[K(_[0],c??f),_[1]]:[K(_,c??f),null])),t.$$.dirty[0]&524320&&u!==b&&(l(7,d=null),l(19,u=b)),t.$$.dirty[0]&1152&&(o=((d??0)+(i?.length??0)-1)%(i?.length??0)),t.$$.dirty[0]&1152&&l(15,n=((d??0)+1)%(i?.length??0)),t.$$.dirty[0]&128&&ae(d),t.$$.dirty[0]&768&&l(14,r=V>=q),t.$$.dirty[0]&64&&l(13,{classes:a}=ye(k,["grid"]),a)},[p,m,g,z,s,b,k,d,q,V,i,I,R,a,r,n,v,f,c,u,se,re,fe,ue,_e,ce,me,ge]}class Ue extends pe{constructor(e){super(),ke(this,e,He,Ee,ve,{loading_status:0,show_label:1,label:2,root:17,root_url:18,elem_id:3,visible:4,value:5,style:6},null,[-1,-1])}}var Ke=Ue;const Oe=["static"],Qe=t=>({type:"Array<{ name: string } | [{ name: string }, string]>",description:"list of objects with filename and optional caption"});export{Ke as Component,Qe as document,Oe as modes};
|
2 |
+
//# sourceMappingURL=index.50b5507a.js.map
|
gradio-modified/templates/frontend/assets/index.52ad5956.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as D,i as E,s as q,a7 as K,e as j,c as d,a as A,b as w,f as S,m as h,g as B,a8 as C,l as N,am as F,j as g,k,n as T,o as v,A as L,F as O,t as P,h as R,aa as U,P as V,R as z,T as G,I as H,O as J,U as M,V as Q,L as W,K as y}from"./index.396f4a72.js";function X(a){let e;return{c(){e=P(a[2])},m(t,l){S(t,e,l)},p(t,l){l&4&&R(e,t[2])},d(t){t&&T(e)}}}function Y(a){let e,t,l,s,u,_,o;return t=new K({props:{show_label:a[3],$$slots:{default:[X]},$$scope:{ctx:a}}}),{c(){e=j("label"),d(t.$$.fragment),l=A(),s=j("input"),w(s,"type","number"),w(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=a[1],w(e,"class","block")},m(b,r){S(b,e,r),h(t,e,null),B(e,l),B(e,s),C(s,a[0]),u=!0,_||(o=[N(s,"input",a[6]),N(s,"keypress",a[4]),N(s,"blur",a[5])],_=!0)},p(b,[r]){const n={};r&8&&(n.show_label=b[3]),r&516&&(n.$$scope={dirty:r,ctx:b}),t.$set(n),(!u||r&2)&&(s.disabled=b[1]),r&1&&F(s.value)!==b[0]&&C(s,b[0])},i(b){u||(g(t.$$.fragment,b),u=!0)},o(b){k(t.$$.fragment,b),u=!1},d(b){b&&T(e),v(t),_=!1,L(o)}}}function Z(a,e,t){let{value:l=0}=e,{disabled:s=!1}=e,{label:u}=e,{show_label:_}=e;const o=O();function b(f){!isNaN(f)&&f!==null&&o("change",f)}async function r(f){await U(),f.key==="Enter"&&(f.preventDefault(),o("submit"))}function n(f){o("blur")}function c(){l=F(this.value),t(0,l)}return a.$$set=f=>{"value"in f&&t(0,l=f.value),"disabled"in f&&t(1,s=f.disabled),"label"in f&&t(2,u=f.label),"show_label"in f&&t(3,_=f.show_label)},a.$$.update=()=>{a.$$.dirty&1&&b(l)},[l,s,u,_,r,n,c]}class p extends D{constructor(e){super(),E(this,e,Z,Y,q,{value:0,disabled:1,label:2,show_label:3})}}function x(a){let e,t,l,s,u;const _=[a[6]];let o={};for(let n=0;n<_.length;n+=1)o=z(o,_[n]);e=new G({props:o});function b(n){a[8](n)}let r={label:a[1],show_label:a[5],disabled:a[7]==="static"};return a[0]!==void 0&&(r.value=a[0]),l=new p({props:r}),H.push(()=>J(l,"value",b)),l.$on("change",a[9]),l.$on("submit",a[10]),l.$on("blur",a[11]),{c(){d(e.$$.fragment),t=A(),d(l.$$.fragment)},m(n,c){h(e,n,c),S(n,t,c),h(l,n,c),u=!0},p(n,c){const f=c&64?M(_,[Q(n[6])]):{};e.$set(f);const m={};c&2&&(m.label=n[1]),c&32&&(m.show_label=n[5]),c&128&&(m.disabled=n[7]==="static"),!s&&c&1&&(s=!0,m.value=n[0],W(()=>s=!1)),l.$set(m)},i(n){u||(g(e.$$.fragment,n),g(l.$$.fragment,n),u=!0)},o(n){k(e.$$.fragment,n),k(l.$$.fragment,n),u=!1},d(n){v(e,n),n&&T(t),v(l,n)}}}function $(a){let e,t;return e=new V({props:{visible:a[3],elem_id:a[2],disable:typeof a[4].container=="boolean"&&!a[4].container,$$slots:{default:[x]},$$scope:{ctx:a}}}),{c(){d(e.$$.fragment)},m(l,s){h(e,l,s),t=!0},p(l,[s]){const u={};s&8&&(u.visible=l[3]),s&4&&(u.elem_id=l[2]),s&16&&(u.disable=typeof l[4].container=="boolean"&&!l[4].container),s&4323&&(u.$$scope={dirty:s,ctx:l}),e.$set(u)},i(l){t||(g(e.$$.fragment,l),t=!0)},o(l){k(e.$$.fragment,l),t=!1},d(l){v(e,l)}}}function ee(a,e,t){let{label:l="Number"}=e,{elem_id:s=""}=e,{visible:u=!0}=e,{style:_={}}=e,{value:o=0}=e,{show_label:b}=e,{loading_status:r}=e,{mode:n}=e;function c(i){o=i,t(0,o)}function f(i){y.call(this,a,i)}function m(i){y.call(this,a,i)}function I(i){y.call(this,a,i)}return a.$$set=i=>{"label"in i&&t(1,l=i.label),"elem_id"in i&&t(2,s=i.elem_id),"visible"in i&&t(3,u=i.visible),"style"in i&&t(4,_=i.style),"value"in i&&t(0,o=i.value),"show_label"in i&&t(5,b=i.show_label),"loading_status"in i&&t(6,r=i.loading_status),"mode"in i&&t(7,n=i.mode)},[o,l,s,u,_,b,r,n,c,f,m,I]}class le extends D{constructor(e){super(),E(this,e,ee,$,q,{label:1,elem_id:2,visible:3,style:4,value:0,show_label:5,loading_status:6,mode:7})}}var te=le;const ne=["static","dynamic"],se=a=>({type:"number",description:"numeric value",example_data:a.value??1});export{te as Component,se as document,ne as modes};
|
2 |
+
//# sourceMappingURL=index.52ad5956.js.map
|
gradio-modified/templates/frontend/assets/index.52c17744.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as q,i as E,s as F,a7 as O,e as C,t as I,f as k,g as S,h as K,n as D,c as h,a as L,b as P,ae as R,m,af as T,l as U,j as g,k as w,o as v,C as V,F as z,ag as A,P as G,R as H,T as J,I as M,O as N,U as Q,V as W,L as X,K as Y}from"./index.396f4a72.js";function j(a,l,t){const n=a.slice();return n[7]=l[t],n}function Z(a){let l;return{c(){l=I(a[1])},m(t,n){k(t,l,n)},p(t,n){n&2&&K(l,t[1])},d(t){t&&D(l)}}}function B(a){let l,t=a[7]+"",n,s;return{c(){l=C("option"),n=I(t),l.__value=s=a[7],l.value=l.__value},m(i,_){k(i,l,_),S(l,n)},p(i,_){_&4&&t!==(t=i[7]+"")&&K(n,t),_&4&&s!==(s=i[7])&&(l.__value=s,l.value=l.__value)},d(i){i&&D(l)}}}function y(a){let l,t,n,s,i,_,d;t=new O({props:{show_label:a[4],$$slots:{default:[Z]},$$scope:{ctx:a}}});let r=a[2],u=[];for(let e=0;e<r.length;e+=1)u[e]=B(j(a,r,e));return{c(){l=C("label"),h(t.$$.fragment),n=L(),s=C("select");for(let e=0;e<u.length;e+=1)u[e].c();P(s,"class","gr-box gr-input w-full disabled:cursor-not-allowed"),s.disabled=a[3],a[0]===void 0&&R(()=>a[5].call(s))},m(e,c){k(e,l,c),m(t,l,null),S(l,n),S(l,s);for(let b=0;b<u.length;b+=1)u[b].m(s,null);T(s,a[0]),i=!0,_||(d=U(s,"change",a[5]),_=!0)},p(e,[c]){const b={};if(c&16&&(b.show_label=e[4]),c&1026&&(b.$$scope={dirty:c,ctx:e}),t.$set(b),c&4){r=e[2];let f;for(f=0;f<r.length;f+=1){const o=j(e,r,f);u[f]?u[f].p(o,c):(u[f]=B(o),u[f].c(),u[f].m(s,null))}for(;f<u.length;f+=1)u[f].d(1);u.length=r.length}(!i||c&8)&&(s.disabled=e[3]),c&5&&T(s,e[0])},i(e){i||(g(t.$$.fragment,e),i=!0)},o(e){w(t.$$.fragment,e),i=!1},d(e){e&&D(l),v(t),V(u,e),_=!1,d()}}}function p(a,l,t){let{label:n}=l,{value:s=void 0}=l,{choices:i}=l,{disabled:_=!1}=l,{show_label:d}=l;const r=z();function u(){s=A(this),t(0,s),t(2,i)}return a.$$set=e=>{"label"in e&&t(1,n=e.label),"value"in e&&t(0,s=e.value),"choices"in e&&t(2,i=e.choices),"disabled"in e&&t(3,_=e.disabled),"show_label"in e&&t(4,d=e.show_label)},a.$$.update=()=>{a.$$.dirty&1&&r("change",s)},[s,n,i,_,d,u]}class x extends q{constructor(l){super(),E(this,l,p,y,F,{label:1,value:0,choices:2,disabled:3,show_label:4})}}function $(a){let l,t,n,s,i;const _=[a[7]];let d={};for(let e=0;e<_.length;e+=1)d=H(d,_[e]);l=new J({props:d});function r(e){a[9](e)}let u={choices:a[4],label:a[1],show_label:a[5],disabled:a[8]==="static"};return a[0]!==void 0&&(u.value=a[0]),n=new x({props:u}),M.push(()=>N(n,"value",r)),n.$on("change",a[10]),{c(){h(l.$$.fragment),t=L(),h(n.$$.fragment)},m(e,c){m(l,e,c),k(e,t,c),m(n,e,c),i=!0},p(e,c){const b=c&128?Q(_,[W(e[7])]):{};l.$set(b);const f={};c&16&&(f.choices=e[4]),c&2&&(f.label=e[1]),c&32&&(f.show_label=e[5]),c&256&&(f.disabled=e[8]==="static"),!s&&c&1&&(s=!0,f.value=e[0],X(()=>s=!1)),n.$set(f)},i(e){i||(g(l.$$.fragment,e),g(n.$$.fragment,e),i=!0)},o(e){w(l.$$.fragment,e),w(n.$$.fragment,e),i=!1},d(e){v(l,e),e&&D(t),v(n,e)}}}function ee(a){let l,t;return l=new G({props:{visible:a[3],elem_id:a[2],disable:typeof a[6].container=="boolean"&&!a[6].container,$$slots:{default:[$]},$$scope:{ctx:a}}}),{c(){h(l.$$.fragment)},m(n,s){m(l,n,s),t=!0},p(n,[s]){const i={};s&8&&(i.visible=n[3]),s&4&&(i.elem_id=n[2]),s&64&&(i.disable=typeof n[6].container=="boolean"&&!n[6].container),s&2483&&(i.$$scope={dirty:s,ctx:n}),l.$set(i)},i(n){t||(g(l.$$.fragment,n),t=!0)},o(n){w(l.$$.fragment,n),t=!1},d(n){v(l,n)}}}function le(a,l,t){let{label:n="Dropdown"}=l,{elem_id:s=""}=l,{visible:i=!0}=l,{value:_=""}=l,{choices:d}=l,{show_label:r}=l,{style:u={}}=l,{loading_status:e}=l,{mode:c}=l;function b(o){_=o,t(0,_)}function f(o){Y.call(this,a,o)}return a.$$set=o=>{"label"in o&&t(1,n=o.label),"elem_id"in o&&t(2,s=o.elem_id),"visible"in o&&t(3,i=o.visible),"value"in o&&t(0,_=o.value),"choices"in o&&t(4,d=o.choices),"show_label"in o&&t(5,r=o.show_label),"style"in o&&t(6,u=o.style),"loading_status"in o&&t(7,e=o.loading_status),"mode"in o&&t(8,c=o.mode)},[_,n,s,i,d,r,u,e,c,b,f]}class te extends q{constructor(l){super(),E(this,l,le,ee,F,{label:1,elem_id:2,visible:3,value:0,choices:4,show_label:5,style:6,loading_status:7,mode:8})}}var ne=te;const se=["static","dynamic"],ie=a=>({type:"string",description:"selected choice",example_data:a.choices.length?a.choices[0]:""});export{ne as Component,ie as document,se as modes};
|
2 |
+
//# sourceMappingURL=index.52c17744.js.map
|
gradio-modified/templates/frontend/assets/index.536d0e14.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{T as s}from"./index.396f4a72.js";const o=["static"];export{s as Component,o as modes};
|
2 |
+
//# sourceMappingURL=index.536d0e14.js.map
|
gradio-modified/templates/frontend/assets/index.5cfaf6ac.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as Z,i as A,s as D,w as R,b as d,f as v,g as b,x as H,n as h,B as z,e as g,a as j,t as N,Y as S,h as E,C as K,d as C,P as O,c as L,m as M,j as k,k as p,o as B,F as Q,R as W,T as X,U as x,V as $,D as T,E as Y}from"./index.396f4a72.js";import{B as ee}from"./BlockLabel.37da86a3.js";function le(a){let e,n;return{c(){e=R("svg"),n=R("path"),d(n,"fill","currentColor"),d(n,"d","M4 2H2v26a2 2 0 0 0 2 2h26v-2H4v-3h22v-8H4v-4h14V5H4Zm20 17v4H4v-4ZM16 7v4H4V7Z"),d(e,"xmlns","http://www.w3.org/2000/svg"),d(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),d(e,"aria-hidden","true"),d(e,"role","img"),d(e,"class","iconify iconify--carbon"),d(e,"width","100%"),d(e,"height","100%"),d(e,"preserveAspectRatio","xMidYMid meet"),d(e,"viewBox","0 0 32 32")},m(l,t){v(l,e,t),b(e,n)},p:H,i:H,o:H,d(l){l&&h(e)}}}class G extends Z{constructor(e){super(),A(this,e,null,le,D,{})}}function q(a,e,n){const l=a.slice();return l[3]=e[n],l}function F(a){let e,n=a[0].confidences,l=[];for(let t=0;t<n.length;t+=1)l[t]=P(q(a,n,t));return{c(){for(let t=0;t<l.length;t+=1)l[t].c();e=z()},m(t,o){for(let i=0;i<l.length;i+=1)l[i].m(t,o);v(t,e,o)},p(t,o){if(o&1){n=t[0].confidences;let i;for(i=0;i<n.length;i+=1){const s=q(t,n,i);l[i]?l[i].p(s,o):(l[i]=P(s),l[i].c(),l[i].m(e.parentNode,e))}for(;i<l.length;i+=1)l[i].d(1);l.length=n.length}},d(t){K(l,t),t&&h(e)}}}function I(a){let e,n,l,t=Math.round(a[3].confidence*100)+"",o,i;return{c(){e=g("div"),n=j(),l=g("div"),o=N(t),i=N("%"),d(e,"class","flex-1 border border-dashed border-gray-100 px-4"),d(l,"class","text-right ml-auto")},m(s,c){v(s,e,c),v(s,n,c),v(s,l,c),b(l,o),b(l,i)},p(s,c){c&1&&t!==(t=Math.round(s[3].confidence*100)+"")&&E(o,t)},d(s){s&&h(e),s&&h(n),s&&h(l)}}}function P(a){let e,n,l,t,o,i,s=a[3].label+"",c,w,u,_=a[0].confidences&&I(a);return{c(){e=g("div"),n=g("div"),l=g("div"),t=j(),o=g("div"),i=g("div"),c=N(s),w=j(),_&&_.c(),u=j(),d(l,"class","h-1 mb-1 rounded bg-gradient-to-r group-hover:from-orange-500 from-orange-400 to-orange-200 dark:from-orange-400 dark:to-orange-600"),S(l,"width",a[3].confidence*100+"%"),d(i,"class","leading-snug"),d(o,"class","flex items-baseline space-x-2 group-hover:text-orange-500"),d(n,"class","flex-1"),d(e,"class","flex items-start justify-between font-mono text-sm leading-none group mb-2 last:mb-0 dark:text-slate-300")},m(f,y){v(f,e,y),b(e,n),b(n,l),b(n,t),b(n,o),b(o,i),b(i,c),b(o,w),_&&_.m(o,null),b(e,u)},p(f,y){y&1&&S(l,"width",f[3].confidence*100+"%"),y&1&&s!==(s=f[3].label+"")&&E(c,s),f[0].confidences?_?_.p(f,y):(_=I(f),_.c(),_.m(o,null)):_&&(_.d(1),_=null)},d(f){f&&h(e),_&&_.d()}}}function te(a){let e,n,l=a[0].label+"",t,o,i=typeof a[0]=="object"&&a[0].confidences&&F(a);return{c(){e=g("div"),n=g("div"),t=N(l),o=j(),i&&i.c(),d(n,"class","output-class font-bold text-2xl py-6 px-4 flex-grow flex items-center justify-center dark:text-slate-200"),C(n,"sr-only",!a[1]),C(n,"no-confidence",!("confidences"in a[0])),S(n,"background-color",a[2]||"transparent",!1),d(e,"class","output-label")},m(s,c){v(s,e,c),b(e,n),b(n,t),b(e,o),i&&i.m(e,null)},p(s,[c]){c&1&&l!==(l=s[0].label+"")&&E(t,l),c&2&&C(n,"sr-only",!s[1]),c&1&&C(n,"no-confidence",!("confidences"in s[0])),c&4&&S(n,"background-color",s[2]||"transparent",!1),typeof s[0]=="object"&&s[0].confidences?i?i.p(s,c):(i=F(s),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},i:H,o:H,d(s){s&&h(e),i&&i.d()}}}function ne(a,e,n){let{value:l}=e,{show_label:t}=e,{color:o}=e;return a.$$set=i=>{"value"in i&&n(0,l=i.value),"show_label"in i&&n(1,t=i.show_label),"color"in i&&n(2,o=i.color)},[l,t,o]}class oe extends Z{constructor(e){super(),A(this,e,ne,te,D,{value:0,show_label:1,color:2})}}function U(a){let e,n;return e=new ee({props:{Icon:G,label:a[4],disable:typeof a[5].container=="boolean"&&!a[5].container}}),{c(){L(e.$$.fragment)},m(l,t){M(e,l,t),n=!0},p(l,t){const o={};t&16&&(o.label=l[4]),t&32&&(o.disable=typeof l[5].container=="boolean"&&!l[5].container),e.$set(o)},i(l){n||(k(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){B(e,l)}}}function ie(a){let e,n,l,t;return l=new G({}),{c(){e=g("div"),n=g("div"),L(l.$$.fragment),d(n,"class","h-5 dark:text-white opacity-50"),d(e,"class","h-full min-h-[6rem] flex justify-center items-center")},m(o,i){v(o,e,i),b(e,n),M(l,n,null),t=!0},p:H,i(o){t||(k(l.$$.fragment,o),t=!0)},o(o){p(l.$$.fragment,o),t=!1},d(o){o&&h(e),B(l)}}}function ae(a){let e,n;return e=new oe({props:{value:a[3],show_label:a[7],color:a[2]}}),{c(){L(e.$$.fragment)},m(l,t){M(e,l,t),n=!0},p(l,t){const o={};t&8&&(o.value=l[3]),t&128&&(o.show_label=l[7]),t&4&&(o.color=l[2]),e.$set(o)},i(l){n||(k(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){B(e,l)}}}function se(a){let e,n,l,t,o,i,s;const c=[a[6]];let w={};for(let r=0;r<c.length;r+=1)w=W(w,c[r]);e=new X({props:w});let u=a[7]&&U(a);const _=[ae,ie],f=[];function y(r,m){return typeof r[3]=="object"&&r[3]!==void 0&&r[3]!==null?0:1}return t=y(a),o=f[t]=_[t](a),{c(){L(e.$$.fragment),n=j(),u&&u.c(),l=j(),o.c(),i=z()},m(r,m){M(e,r,m),v(r,n,m),u&&u.m(r,m),v(r,l,m),f[t].m(r,m),v(r,i,m),s=!0},p(r,m){const J=m&64?x(c,[$(r[6])]):{};e.$set(J),r[7]?u?(u.p(r,m),m&128&&k(u,1)):(u=U(r),u.c(),k(u,1),u.m(l.parentNode,l)):u&&(T(),p(u,1,1,()=>{u=null}),Y());let V=t;t=y(r),t===V?f[t].p(r,m):(T(),p(f[V],1,1,()=>{f[V]=null}),Y(),o=f[t],o?o.p(r,m):(o=f[t]=_[t](r),o.c()),k(o,1),o.m(i.parentNode,i))},i(r){s||(k(e.$$.fragment,r),k(u),k(o),s=!0)},o(r){p(e.$$.fragment,r),p(u),p(o),s=!1},d(r){B(e,r),r&&h(n),u&&u.d(r),r&&h(l),f[t].d(r),r&&h(i)}}}function fe(a){let e,n;return e=new O({props:{test_id:"label",visible:a[1],elem_id:a[0],disable:typeof a[5].container=="boolean"&&!a[5].container,$$slots:{default:[se]},$$scope:{ctx:a}}}),{c(){L(e.$$.fragment)},m(l,t){M(e,l,t),n=!0},p(l,[t]){const o={};t&2&&(o.visible=l[1]),t&1&&(o.elem_id=l[0]),t&32&&(o.disable=typeof l[5].container=="boolean"&&!l[5].container),t&764&&(o.$$scope={dirty:t,ctx:l}),e.$set(o)},i(l){n||(k(e.$$.fragment,l),n=!0)},o(l){p(e.$$.fragment,l),n=!1},d(l){B(e,l)}}}function re(a,e,n){let{elem_id:l=""}=e,{visible:t=!0}=e,{color:o=void 0}=e,{value:i}=e,{label:s="Label"}=e,{style:c={}}=e,{loading_status:w}=e,{show_label:u}=e;const _=Q();return a.$$set=f=>{"elem_id"in f&&n(0,l=f.elem_id),"visible"in f&&n(1,t=f.visible),"color"in f&&n(2,o=f.color),"value"in f&&n(3,i=f.value),"label"in f&&n(4,s=f.label),"style"in f&&n(5,c=f.style),"loading_status"in f&&n(6,w=f.loading_status),"show_label"in f&&n(7,u=f.show_label)},a.$$.update=()=>{a.$$.dirty&8&&_("change")},[l,t,o,i,s,c,w,u]}class ce extends Z{constructor(e){super(),A(this,e,re,fe,D,{elem_id:0,visible:1,color:2,value:3,label:4,style:5,loading_status:6,show_label:7})}}var _e=ce;const be=["static"],me=a=>({type:"{ label: string; confidences?: Array<{ label: string; confidence: number }>",description:"output label and optional set of confidences per label"});export{_e as Component,me as document,be as modes};
|
2 |
+
//# sourceMappingURL=index.5cfaf6ac.js.map
|
gradio-modified/templates/frontend/assets/index.5d3ef6e5.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as L,i as q,s as G,c as N,a as B,B as S,m as C,f as k,D as O,k as D,E as Q,j as U,o as I,n as h,e as A,b,g as m,x as K,t as y,h as E,C as W,F as ne,aa as fe,I as Y,O as Z,L as x,P as oe,Q as ae,X as _e,R as se,T as re,U as ue,V as ce,K as T}from"./index.396f4a72.js";import{B as $}from"./BlockLabel.37da86a3.js";import{F as R}from"./File.60a988f4.js";import{U as ee}from"./Upload.5d0148e8.js";import{M as de}from"./ModifyUpload.2cfe71e4.js";import{n as be}from"./utils.27234e1d.js";const me=o=>{let e=["B","KB","MB","GB","PB"],i=0;for(;o>1024;)o/=1024,i++;let l=e[i];return o.toFixed(1)+" "+l},j=o=>{var e;return e=o.orig_name||o.name,e.length>30?`${e.substr(0,30)}...`:e},M=o=>o.data,P=o=>{var e=0;if(Array.isArray(o))for(var i of o)i.size!==void 0&&(e+=i.size);else e=o.size||0;return me(e)};function V(o,e,i){const l=o.slice();return l[3]=e[i],l}function ge(o){let e,i,l,t;return l=new R({}),{c(){e=A("div"),i=A("div"),N(l.$$.fragment),b(i,"class","h-5 dark:text-white opacity-50"),b(e,"class","h-full min-h-[15rem] flex justify-center items-center")},m(a,f){k(a,e,f),m(e,i),C(l,i,null),t=!0},p:K,i(a){t||(U(l.$$.fragment,a),t=!0)},o(a){D(l.$$.fragment,a),t=!1},d(a){a&&h(e),I(l)}}}function we(o){let e,i;function l(f,s){return s&1&&(i=null),i==null&&(i=!!Array.isArray(f[0])),i?ke:ve}let t=l(o,-1),a=t(o);return{c(){e=A("div"),a.c(),b(e,"class","file-preview overflow-y-scroll w-full max-h-60 flex flex-col justify-between mt-7 mb-7 dark:text-slate-200")},m(f,s){k(f,e,s),a.m(e,null)},p(f,s){t===(t=l(f,s))&&a?a.p(f,s):(a.d(1),a=t(f),a&&(a.c(),a.m(e,null)))},i:K,o:K,d(f){f&&h(e),a.d()}}}function ve(o){let e,i,l=j(o[0])+"",t,a,f,s=P(o[0])+"",r,u,n,_,c,d,z;return{c(){e=A("div"),i=A("div"),t=y(l),a=B(),f=A("div"),r=y(s),u=B(),n=A("div"),_=A("a"),c=y("Download"),b(i,"class","file-name w-5/12 p-2"),b(f,"class","file-size w-3/12 p-2"),b(_,"href",d=M(o[0])),b(_,"target",window.__is_colab__?"_blank":null),b(_,"download",z=window.__is_colab__?null:j(o[0])),b(_,"class","text-indigo-600 hover:underline dark:text-indigo-300"),b(n,"class","file-size w-3/12 p-2 hover:underline"),b(e,"class","flex flex-row")},m(g,p){k(g,e,p),m(e,i),m(i,t),m(e,a),m(e,f),m(f,r),m(e,u),m(e,n),m(n,_),m(_,c)},p(g,p){p&1&&l!==(l=j(g[0])+"")&&E(t,l),p&1&&s!==(s=P(g[0])+"")&&E(r,s),p&1&&d!==(d=M(g[0]))&&b(_,"href",d),p&1&&z!==(z=window.__is_colab__?null:j(g[0]))&&b(_,"download",z)},d(g){g&&h(e)}}}function ke(o){let e,i=o[0],l=[];for(let t=0;t<i.length;t+=1)l[t]=X(V(o,i,t));return{c(){for(let t=0;t<l.length;t+=1)l[t].c();e=S()},m(t,a){for(let f=0;f<l.length;f+=1)l[f].m(t,a);k(t,e,a)},p(t,a){if(a&1){i=t[0];let f;for(f=0;f<i.length;f+=1){const s=V(t,i,f);l[f]?l[f].p(s,a):(l[f]=X(s),l[f].c(),l[f].m(e.parentNode,e))}for(;f<l.length;f+=1)l[f].d(1);l.length=i.length}},d(t){W(l,t),t&&h(e)}}}function X(o){let e,i,l=j(o[3])+"",t,a,f,s=P(o[3])+"",r,u,n,_,c,d,z,g,p;return{c(){e=A("div"),i=A("div"),t=y(l),a=B(),f=A("div"),r=y(s),u=B(),n=A("div"),_=A("a"),c=y("Download"),p=B(),b(i,"class","file-name p-2"),b(f,"class","file-size p-2"),b(_,"href",d=M(o[3])),b(_,"target",z=window.__is_colab__?"_blank":null),b(_,"download",g=window.__is_colab__?null:j(o[3])),b(_,"class","text-indigo-600 hover:underline dark:text-indigo-300"),b(n,"class","file-size w-3/12 p-2 hover:underline"),b(e,"class","flex flex-row w-full justify-between")},m(F,w){k(F,e,w),m(e,i),m(i,t),m(e,a),m(e,f),m(f,r),m(e,u),m(e,n),m(n,_),m(_,c),m(e,p)},p(F,w){w&1&&l!==(l=j(F[3])+"")&&E(t,l),w&1&&s!==(s=P(F[3])+"")&&E(r,s),w&1&&d!==(d=M(F[3]))&&b(_,"href",d),w&1&&g!==(g=window.__is_colab__?null:j(F[3]))&&b(_,"download",g)},d(F){F&&h(e)}}}function he(o){let e,i,l,t,a,f;e=new $({props:{show_label:o[2],Icon:R,label:o[1]||"File"}});const s=[we,ge],r=[];function u(n,_){return n[0]?0:1}return l=u(o),t=r[l]=s[l](o),{c(){N(e.$$.fragment),i=B(),t.c(),a=S()},m(n,_){C(e,n,_),k(n,i,_),r[l].m(n,_),k(n,a,_),f=!0},p(n,[_]){const c={};_&4&&(c.show_label=n[2]),_&2&&(c.label=n[1]||"File"),e.$set(c);let d=l;l=u(n),l===d?r[l].p(n,_):(O(),D(r[d],1,1,()=>{r[d]=null}),Q(),t=r[l],t?t.p(n,_):(t=r[l]=s[l](n),t.c()),U(t,1),t.m(a.parentNode,a))},i(n){f||(U(e.$$.fragment,n),U(t),f=!0)},o(n){D(e.$$.fragment,n),D(t),f=!1},d(n){I(e,n),n&&h(i),r[l].d(n),n&&h(a)}}}function pe(o,e,i){let{value:l}=e,{label:t}=e,{show_label:a}=e;return o.$$set=f=>{"value"in f&&i(0,l=f.value),"label"in f&&i(1,t=f.label),"show_label"in f&&i(2,a=f.show_label)},[l,t,a]}class Ae extends L{constructor(e){super(),q(this,e,pe,he,G,{value:0,label:1,show_label:2})}}function H(o,e,i){const l=o.slice();return l[15]=e[i],l}function ze(o){let e,i,l,t,a;i=new de({props:{absolute:!0}}),i.$on("clear",o[10]);function f(u,n){return n&1&&(t=null),t==null&&(t=!!Array.isArray(u[0])),t?je:Be}let s=f(o,-1),r=s(o);return{c(){e=A("div"),N(i.$$.fragment),l=B(),r.c(),b(e,"class","file-preview overflow-y-scroll w-full max-h-60 flex flex-col justify-between mt-7 mb-7 dark:text-slate-200")},m(u,n){k(u,e,n),C(i,e,null),m(e,l),r.m(e,null),a=!0},p(u,n){s===(s=f(u,n))&&r?r.p(u,n):(r.d(1),r=s(u),r&&(r.c(),r.m(e,null)))},i(u){a||(U(i.$$.fragment,u),a=!0)},o(u){D(i.$$.fragment,u),a=!1},d(u){u&&h(e),I(i),r.d()}}}function ye(o){let e,i,l;function t(f){o[13](f)}let a={filetype:o[8],file_count:o[6],$$slots:{default:[De]},$$scope:{ctx:o}};return o[7]!==void 0&&(a.dragging=o[7]),e=new ee({props:a}),Y.push(()=>Z(e,"dragging",t)),e.$on("load",o[9]),{c(){N(e.$$.fragment)},m(f,s){C(e,f,s),l=!0},p(f,s){const r={};s&256&&(r.filetype=f[8]),s&64&&(r.file_count=f[6]),s&262158&&(r.$$scope={dirty:s,ctx:f}),!i&&s&128&&(i=!0,r.dragging=f[7],x(()=>i=!1)),e.$set(r)},i(f){l||(U(e.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),l=!1},d(f){I(e,f)}}}function Fe(o){let e,i,l;function t(f){o[12](f)}let a={filetype:o[8],$$slots:{default:[Ue]},$$scope:{ctx:o}};return o[7]!==void 0&&(a.dragging=o[7]),e=new ee({props:a}),Y.push(()=>Z(e,"dragging",t)),e.$on("load",o[9]),{c(){N(e.$$.fragment)},m(f,s){C(e,f,s),l=!0},p(f,s){const r={};s&256&&(r.filetype=f[8]),s&262158&&(r.$$scope={dirty:s,ctx:f}),!i&&s&128&&(i=!0,r.dragging=f[7],x(()=>i=!1)),e.$set(r)},i(f){l||(U(e.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),l=!1},d(f){I(e,f)}}}function Be(o){let e,i,l=j(o[0])+"",t,a,f,s=P(o[0])+"",r,u,n,_,c,d,z;return{c(){e=A("div"),i=A("div"),t=y(l),a=B(),f=A("div"),r=y(s),u=B(),n=A("div"),_=A("a"),c=y("Download"),b(i,"class","file-name p-2"),b(f,"class","file-size p-2"),b(_,"href",d=M(o[0])),b(_,"download",z=j(o[0])),b(_,"class","text-indigo-600 hover:underline dark:text-indigo-300"),b(n,"class","file-size p-2 hover:underline"),b(e,"class","flex flex-row")},m(g,p){k(g,e,p),m(e,i),m(i,t),m(e,a),m(e,f),m(f,r),m(e,u),m(e,n),m(n,_),m(_,c)},p(g,p){p&1&&l!==(l=j(g[0])+"")&&E(t,l),p&1&&s!==(s=P(g[0])+"")&&E(r,s),p&1&&d!==(d=M(g[0]))&&b(_,"href",d),p&1&&z!==(z=j(g[0]))&&b(_,"download",z)},d(g){g&&h(e)}}}function je(o){let e,i=o[0],l=[];for(let t=0;t<i.length;t+=1)l[t]=J(H(o,i,t));return{c(){for(let t=0;t<l.length;t+=1)l[t].c();e=S()},m(t,a){for(let f=0;f<l.length;f+=1)l[f].m(t,a);k(t,e,a)},p(t,a){if(a&1){i=t[0];let f;for(f=0;f<i.length;f+=1){const s=H(t,i,f);l[f]?l[f].p(s,a):(l[f]=J(s),l[f].c(),l[f].m(e.parentNode,e))}for(;f<l.length;f+=1)l[f].d(1);l.length=i.length}},d(t){W(l,t),t&&h(e)}}}function J(o){let e,i,l=j(o[15])+"",t,a,f,s=P(o[15])+"",r,u,n,_,c,d,z,g;return{c(){e=A("div"),i=A("div"),t=y(l),a=B(),f=A("div"),r=y(s),u=B(),n=A("div"),_=A("a"),c=y("Download"),g=B(),b(i,"class","file-name w-5/12 p-2"),b(f,"class","file-size w-3/12 p-2"),b(_,"href",d=M(o[15])),b(_,"download",z=j(o[15])),b(_,"class","text-indigo-600 hover:underline dark:text-indigo-300"),b(n,"class","file-size w-3/12 p-2 hover:underline"),b(e,"class","flex flex-row w-full justify-between")},m(p,F){k(p,e,F),m(e,i),m(i,t),m(e,a),m(e,f),m(f,r),m(e,u),m(e,n),m(n,_),m(_,c),m(e,g)},p(p,F){F&1&&l!==(l=j(p[15])+"")&&E(t,l),F&1&&s!==(s=P(p[15])+"")&&E(r,s),F&1&&d!==(d=M(p[15]))&&b(_,"href",d),F&1&&z!==(z=j(p[15]))&&b(_,"download",z)},d(p){p&&h(e)}}}function De(o){let e,i,l,t,a,f,s,r,u;return{c(){e=y(o[1]),i=B(),l=A("br"),t=y("- "),a=y(o[2]),f=y(" -"),s=A("br"),r=B(),u=y(o[3])},m(n,_){k(n,e,_),k(n,i,_),k(n,l,_),k(n,t,_),k(n,a,_),k(n,f,_),k(n,s,_),k(n,r,_),k(n,u,_)},p(n,_){_&2&&E(e,n[1]),_&4&&E(a,n[2]),_&8&&E(u,n[3])},d(n){n&&h(e),n&&h(i),n&&h(l),n&&h(t),n&&h(a),n&&h(f),n&&h(s),n&&h(r),n&&h(u)}}}function Ue(o){let e,i,l,t,a,f,s,r,u;return{c(){e=y(o[1]),i=B(),l=A("br"),t=y("- "),a=y(o[2]),f=y(" -"),s=A("br"),r=B(),u=y(o[3])},m(n,_){k(n,e,_),k(n,i,_),k(n,l,_),k(n,t,_),k(n,a,_),k(n,f,_),k(n,s,_),k(n,r,_),k(n,u,_)},p(n,_){_&2&&E(e,n[1]),_&4&&E(a,n[2]),_&8&&E(u,n[3])},d(n){n&&h(e),n&&h(i),n&&h(l),n&&h(t),n&&h(a),n&&h(f),n&&h(s),n&&h(r),n&&h(u)}}}function Ee(o){let e,i,l,t,a,f;e=new $({props:{show_label:o[5],Icon:R,label:o[4]||"File"}});const s=[Fe,ye,ze],r=[];function u(n,_){return n[0]===null&&n[6]==="single"?0:n[0]===null?1:2}return l=u(o),t=r[l]=s[l](o),{c(){N(e.$$.fragment),i=B(),t.c(),a=S()},m(n,_){C(e,n,_),k(n,i,_),r[l].m(n,_),k(n,a,_),f=!0},p(n,[_]){const c={};_&32&&(c.show_label=n[5]),_&16&&(c.label=n[4]||"File"),e.$set(c);let d=l;l=u(n),l===d?r[l].p(n,_):(O(),D(r[d],1,1,()=>{r[d]=null}),Q(),t=r[l],t?t.p(n,_):(t=r[l]=s[l](n),t.c()),U(t,1),t.m(a.parentNode,a))},i(n){f||(U(e.$$.fragment,n),U(t),f=!0)},o(n){D(e.$$.fragment,n),D(t),f=!1},d(n){I(e,n),n&&h(i),r[l].d(n),n&&h(a)}}}function Ne(o,e,i){let{value:l}=e,{drop_text:t="Drop a file"}=e,{or_text:a="or"}=e,{upload_text:f="click to upload"}=e,{label:s=""}=e,{show_label:r}=e,{file_count:u}=e,{file_types:n=["file"]}=e;async function _({detail:w}){i(0,l=w),await fe(),d("change",l),d("upload",w)}function c({detail:w}){i(0,l=null),d("change",l),d("clear")}const d=ne();let z="";try{n.forEach(w=>i(8,z+=w+"/*, "))}catch(w){if(w instanceof TypeError)d("error","Please set file_types to a list.");else throw w}let g=!1;function p(w){g=w,i(7,g)}function F(w){g=w,i(7,g)}return o.$$set=w=>{"value"in w&&i(0,l=w.value),"drop_text"in w&&i(1,t=w.drop_text),"or_text"in w&&i(2,a=w.or_text),"upload_text"in w&&i(3,f=w.upload_text),"label"in w&&i(4,s=w.label),"show_label"in w&&i(5,r=w.show_label),"file_count"in w&&i(6,u=w.file_count),"file_types"in w&&i(11,n=w.file_types)},o.$$.update=()=>{o.$$.dirty&128&&d("drag",g)},[l,t,a,f,s,r,u,g,z,_,c,n,p,F]}class Ce extends L{constructor(e){super(),q(this,e,Ne,Ee,G,{value:0,drop_text:1,or_text:2,upload_text:3,label:4,show_label:5,file_count:6,file_types:11})}}function Ie(o){let e,i;return e=new Ae({props:{value:o[9],label:o[4],show_label:o[5]}}),{c(){N(e.$$.fragment)},m(l,t){C(e,l,t),i=!0},p(l,t){const a={};t&512&&(a.value=l[9]),t&16&&(a.label=l[4]),t&32&&(a.show_label=l[5]),e.$set(a)},i(l){i||(U(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){I(e,l)}}}function Me(o){let e,i;return e=new Ce({props:{label:o[4],show_label:o[5],value:o[9],file_count:o[6],file_types:o[7],drop_text:o[11]("interface.drop_file"),or_text:o[11]("or"),upload_text:o[11]("interface.click_to_upload")}}),e.$on("change",o[14]),e.$on("drag",o[15]),e.$on("change",o[16]),e.$on("clear",o[17]),e.$on("upload",o[18]),{c(){N(e.$$.fragment)},m(l,t){C(e,l,t),i=!0},p(l,t){const a={};t&16&&(a.label=l[4]),t&32&&(a.show_label=l[5]),t&512&&(a.value=l[9]),t&64&&(a.file_count=l[6]),t&128&&(a.file_types=l[7]),t&2048&&(a.drop_text=l[11]("interface.drop_file")),t&2048&&(a.or_text=l[11]("or")),t&2048&&(a.upload_text=l[11]("interface.click_to_upload")),e.$set(a)},i(l){i||(U(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){I(e,l)}}}function Pe(o){let e,i,l,t,a,f;const s=[o[8]];let r={};for(let c=0;c<s.length;c+=1)r=se(r,s[c]);e=new re({props:r});const u=[Me,Ie],n=[];function _(c,d){return c[3]==="dynamic"?0:1}return l=_(o),t=n[l]=u[l](o),{c(){N(e.$$.fragment),i=B(),t.c(),a=S()},m(c,d){C(e,c,d),k(c,i,d),n[l].m(c,d),k(c,a,d),f=!0},p(c,d){const z=d&256?ue(s,[ce(c[8])]):{};e.$set(z);let g=l;l=_(c),l===g?n[l].p(c,d):(O(),D(n[g],1,1,()=>{n[g]=null}),Q(),t=n[l],t?t.p(c,d):(t=n[l]=u[l](c),t.c()),U(t,1),t.m(a.parentNode,a))},i(c){f||(U(e.$$.fragment,c),U(t),f=!0)},o(c){D(e.$$.fragment,c),D(t),f=!1},d(c){I(e,c),c&&h(i),n[l].d(c),c&&h(a)}}}function Se(o){let e,i;return e=new oe({props:{visible:o[2],variant:o[3]==="dynamic"&&o[0]===null?"dashed":"solid",color:o[10]?"green":"grey",padding:!1,elem_id:o[1],$$slots:{default:[Pe]},$$scope:{ctx:o}}}),{c(){N(e.$$.fragment)},m(l,t){C(e,l,t),i=!0},p(l,[t]){const a={};t&4&&(a.visible=l[2]),t&9&&(a.variant=l[3]==="dynamic"&&l[0]===null?"dashed":"solid"),t&1024&&(a.color=l[10]?"green":"grey"),t&2&&(a.elem_id=l[1]),t&528377&&(a.$$scope={dirty:t,ctx:l}),e.$set(a)},i(l){i||(U(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){I(e,l)}}}function Te(o,e,i){let l;ae(o,_e,v=>i(11,l=v));let{elem_id:t=""}=e,{visible:a=!0}=e,{value:f=null}=e,{mode:s}=e,{root:r}=e,{label:u}=e,{show_label:n}=e,{file_count:_}=e,{file_types:c=["file"]}=e,{root_url:d}=e,{loading_status:z}=e,g,p=!1;const F=({detail:v})=>i(0,f=v),w=({detail:v})=>i(10,p=v);function le(v){T.call(this,o,v)}function te(v){T.call(this,o,v)}function ie(v){T.call(this,o,v)}return o.$$set=v=>{"elem_id"in v&&i(1,t=v.elem_id),"visible"in v&&i(2,a=v.visible),"value"in v&&i(0,f=v.value),"mode"in v&&i(3,s=v.mode),"root"in v&&i(12,r=v.root),"label"in v&&i(4,u=v.label),"show_label"in v&&i(5,n=v.show_label),"file_count"in v&&i(6,_=v.file_count),"file_types"in v&&i(7,c=v.file_types),"root_url"in v&&i(13,d=v.root_url),"loading_status"in v&&i(8,z=v.loading_status)},o.$$.update=()=>{o.$$.dirty&12289&&i(9,g=be(f,d??r))},[f,t,a,s,u,n,_,c,z,g,p,l,r,d,F,w,le,te,ie]}class Ke extends L{constructor(e){super(),q(this,e,Te,Se,G,{elem_id:1,visible:2,value:0,mode:3,root:12,label:4,show_label:5,file_count:6,file_types:7,root_url:13,loading_status:8})}}var Ve=Ke;const Xe=["static","dynamic"],He=o=>({type:"{ name: string; data: string }",description:"file name and base64 data as an object",example_data:{name:"zip.zip",data:"data:@file/octet-stream;base64,UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA=="}});export{Ve as Component,He as document,Xe as modes};
|
2 |
+
//# sourceMappingURL=index.5d3ef6e5.js.map
|
gradio-modified/templates/frontend/assets/index.64cd2c53.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}.input-number{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-number:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark .input-number{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-dropdown .dark .selector{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-dropdown .selector{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-dropdown .selector:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-dropdown .dark .selector{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-dropdown .dropdown-menu{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-dropdown .dark .dropdown-item{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-dropdown .dropdown-item{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.input-dropdown .dropdown-item:hover{font-weight:600}.input-dropdown .dark .dropdown-item{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.selected.svelte-r8ethh .check.svelte-r8ethh{opacity:1}.input-checkbox.svelte-r8ethh .dark .checkbox-item.svelte-r8ethh{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-checkbox.svelte-r8ethh .checkbox-item.svelte-r8ethh{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-checkbox.svelte-r8ethh .checkbox-item.svelte-r8ethh:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-checkbox.svelte-r8ethh .dark .checkbox-item.svelte-r8ethh{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-checkbox.svelte-r8ethh .checkbox-item.selected.svelte-r8ethh{--tw-bg-opacity:1;background-color:rgb(245 158 11 / var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-checkbox.svelte-r8ethh .dark .checkbox-item.selected.svelte-r8ethh{--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.selected.svelte-h5sk3f .check.svelte-h5sk3f{opacity:1}.input-checkbox-group.svelte-h5sk3f .dark .checkbox-item.svelte-h5sk3f{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-checkbox-group.svelte-h5sk3f .checkbox-item.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-checkbox-group.svelte-h5sk3f .checkbox-item.svelte-h5sk3f:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-checkbox-group.svelte-h5sk3f .dark .checkbox-item.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-checkbox-group.svelte-h5sk3f .checkbox.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-checkbox-group.svelte-h5sk3f .dark .checkbox.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.input-checkbox-group.svelte-h5sk3f .checkbox-item.selected.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(245 158 11 / var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-checkbox-group.svelte-h5sk3f .dark .checkbox-item.selected.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.input-checkbox-group.svelte-h5sk3f .selected .checkbox.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.input-checkbox-group.svelte-h5sk3f .dark .selected .checkbox.svelte-h5sk3f{--tw-bg-opacity:1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.range.svelte-3aijhr.svelte-3aijhr::-webkit-slider-thumb{-webkit-appearance:none;height:1.25rem;width:1.25rem;cursor:pointer;appearance:none;border-radius:.25rem}.range.svelte-3aijhr.svelte-3aijhr::-moz-range-thumb{height:1.25rem;width:1.25rem;cursor:pointer;appearance:none;border-radius:.25rem}.input-slider.svelte-3aijhr .dark .range.svelte-3aijhr{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-slider.svelte-3aijhr .range.svelte-3aijhr{height:.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-slider.svelte-3aijhr .range.svelte-3aijhr:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-slider.svelte-3aijhr .dark .range.svelte-3aijhr{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-slider.svelte-3aijhr .range.svelte-3aijhr::-webkit-slider-thumb{background-image:linear-gradient(to bottom,var(--tw-gradient-stops));--tw-gradient-from:#fbbf24;--tw-gradient-to:rgb(251 191 36 / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:#f59e0b;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-slider.svelte-3aijhr .dark .range.svelte-3aijhr::-webkit-slider-thumb{--tw-gradient-from:#ef4444;--tw-gradient-to:rgb(239 68 68 / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:#dc2626}.input-slider.svelte-3aijhr .range.svelte-3aijhr::-moz-range-thumb{background-image:linear-gradient(to bottom,var(--tw-gradient-stops));--tw-gradient-from:#fbbf24;--tw-gradient-to:rgb(251 191 36 / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:#f59e0b;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-radio.svelte-145r163 .dark .radio-item.svelte-145r163{background-color:#0b0f19;--tw-bg-opacity:1;background-color:rgb(11 15 25 / var(--tw-bg-opacity))}.input-radio.svelte-145r163 .radio-item.svelte-145r163{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.input-radio.svelte-145r163 .radio-item.svelte-145r163:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-radio.svelte-145r163 .dark .radio-item.svelte-145r163{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.input-radio.svelte-145r163 .radio-circle.svelte-145r163{box-sizing:border-box;height:1rem;width:1rem;border-radius:9999px}.input-radio.svelte-145r163 .radio-item.selected.svelte-145r163{--tw-bg-opacity:1;background-color:rgb(245 158 11 / var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity));--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.input-radio.svelte-145r163 .dark .radio-item.selected.svelte-145r163{--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}
|
gradio-modified/templates/frontend/assets/index.64f1ca39.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{S as me,i as ce,s as be,w as Pe,b as c,f as y,g as E,x as j,n as S,e as P,d as A,l as R,y as de,z as Ve,t as C,h as N,A as re,B as ue,a as z,C as ul,c as q,m as G,j as F,k as T,o as Z,D as ge,E as he,F as He,G as Ml,H as Fl,I as Me,J as Il,_ as Ue,K as X,L as ol,M as Re,N as Tl,O as _l,P as Bl,Q as Dl,X as Ll,R as Ul,T as Cl,U as Nl,V as Ol}from"./index.396f4a72.js";import{U as Kl}from"./Upload.5d0148e8.js";import{M as jl}from"./ModifyUpload.2cfe71e4.js";import{B as dl}from"./BlockLabel.37da86a3.js";import{n as zl}from"./utils.27234e1d.js";function Ql(l){let e,i,n,a;return{c(){e=Pe("svg"),i=Pe("path"),n=Pe("circle"),a=Pe("circle"),c(i,"d","M9 18V5l12-2v13"),c(n,"cx","6"),c(n,"cy","18"),c(n,"r","3"),c(a,"cx","18"),c(a,"cy","16"),c(a,"r","3"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"width","100%"),c(e,"height","100%"),c(e,"viewBox","0 0 24 24"),c(e,"fill","none"),c(e,"stroke","currentColor"),c(e,"stroke-width","1.5"),c(e,"stroke-linecap","round"),c(e,"stroke-linejoin","round"),c(e,"class","feather feather-music")},m(f,t){y(f,e,t),E(e,i),E(e,n),E(e,a)},p:j,i:j,o:j,d(f){f&&S(e)}}}class Be extends me{constructor(e){super(),ce(this,e,null,Ql,be,{})}}function Ce(l,e,i){const n=l.slice();return n[27]=e[i],n[29]=i,n}function Ne(l){let e,i,n,a,f=(l[6]==="label"||l[7]==="label")&&Oe(l);return{c(){e=P("span"),f&&f.c(),c(e,"class","pip first"),c(e,"style",i=l[14]+": 0%;"),A(e,"selected",l[17](l[0])),A(e,"in-range",l[16](l[0]))},m(t,u){y(t,e,u),f&&f.m(e,null),n||(a=[R(e,"click",function(){de(l[20](l[0]))&&l[20](l[0]).apply(this,arguments)}),R(e,"touchend",Ve(function(){de(l[20](l[0]))&&l[20](l[0]).apply(this,arguments)}))],n=!0)},p(t,u){l=t,l[6]==="label"||l[7]==="label"?f?f.p(l,u):(f=Oe(l),f.c(),f.m(e,null)):f&&(f.d(1),f=null),u&16384&&i!==(i=l[14]+": 0%;")&&c(e,"style",i),u&131073&&A(e,"selected",l[17](l[0])),u&65537&&A(e,"in-range",l[16](l[0]))},d(t){t&&S(e),f&&f.d(),n=!1,re(a)}}}function Oe(l){let e,i=l[12](l[0],0,0)+"",n,a=l[10]&&Ke(l),f=l[11]&&je(l);return{c(){e=P("span"),a&&a.c(),n=C(i),f&&f.c(),c(e,"class","pipVal")},m(t,u){y(t,e,u),a&&a.m(e,null),E(e,n),f&&f.m(e,null)},p(t,u){t[10]?a?a.p(t,u):(a=Ke(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u&4097&&i!==(i=t[12](t[0],0,0)+"")&&N(n,i),t[11]?f?f.p(t,u):(f=je(t),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(t){t&&S(e),a&&a.d(),f&&f.d()}}}function Ke(l){let e,i;return{c(){e=P("span"),i=C(l[10]),c(e,"class","pipVal-prefix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&1024&&N(i,n[10])},d(n){n&&S(e)}}}function je(l){let e,i;return{c(){e=P("span"),i=C(l[11]),c(e,"class","pipVal-suffix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&2048&&N(i,n[11])},d(n){n&&S(e)}}}function ze(l){let e,i=Array(l[19]+1),n=[];for(let a=0;a<i.length;a+=1)n[a]=Ge(Ce(l,i,a));return{c(){for(let a=0;a<n.length;a+=1)n[a].c();e=ue()},m(a,f){for(let t=0;t<n.length;t+=1)n[t].m(a,f);y(a,e,f)},p(a,f){if(f&2088515){i=Array(a[19]+1);let t;for(t=0;t<i.length;t+=1){const u=Ce(a,i,t);n[t]?n[t].p(u,f):(n[t]=Ge(u),n[t].c(),n[t].m(e.parentNode,e))}for(;t<n.length;t+=1)n[t].d(1);n.length=i.length}},d(a){ul(n,a),a&&S(e)}}}function Qe(l){let e,i,n,a,f,t=(l[6]==="label"||l[9]==="label")&&Ye(l);return{c(){e=P("span"),t&&t.c(),i=z(),c(e,"class","pip"),c(e,"style",n=l[14]+": "+l[15](l[18](l[29]))+"%;"),A(e,"selected",l[17](l[18](l[29]))),A(e,"in-range",l[16](l[18](l[29])))},m(u,_){y(u,e,_),t&&t.m(e,null),E(e,i),a||(f=[R(e,"click",function(){de(l[20](l[18](l[29])))&&l[20](l[18](l[29])).apply(this,arguments)}),R(e,"touchend",Ve(function(){de(l[20](l[18](l[29])))&&l[20](l[18](l[29])).apply(this,arguments)}))],a=!0)},p(u,_){l=u,l[6]==="label"||l[9]==="label"?t?t.p(l,_):(t=Ye(l),t.c(),t.m(e,i)):t&&(t.d(1),t=null),_&311296&&n!==(n=l[14]+": "+l[15](l[18](l[29]))+"%;")&&c(e,"style",n),_&393216&&A(e,"selected",l[17](l[18](l[29]))),_&327680&&A(e,"in-range",l[16](l[18](l[29])))},d(u){u&&S(e),t&&t.d(),a=!1,re(f)}}}function Ye(l){let e,i=l[12](l[18](l[29]),l[29],l[15](l[18](l[29])))+"",n,a=l[10]&&Xe(l),f=l[11]&&qe(l);return{c(){e=P("span"),a&&a.c(),n=C(i),f&&f.c(),c(e,"class","pipVal")},m(t,u){y(t,e,u),a&&a.m(e,null),E(e,n),f&&f.m(e,null)},p(t,u){t[10]?a?a.p(t,u):(a=Xe(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u&299008&&i!==(i=t[12](t[18](t[29]),t[29],t[15](t[18](t[29])))+"")&&N(n,i),t[11]?f?f.p(t,u):(f=qe(t),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(t){t&&S(e),a&&a.d(),f&&f.d()}}}function Xe(l){let e,i;return{c(){e=P("span"),i=C(l[10]),c(e,"class","pipVal-prefix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&1024&&N(i,n[10])},d(n){n&&S(e)}}}function qe(l){let e,i;return{c(){e=P("span"),i=C(l[11]),c(e,"class","pipVal-suffix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&2048&&N(i,n[11])},d(n){n&&S(e)}}}function Ge(l){let e=l[18](l[29])!==l[0]&&l[18](l[29])!==l[1],i,n=e&&Qe(l);return{c(){n&&n.c(),i=ue()},m(a,f){n&&n.m(a,f),y(a,i,f)},p(a,f){f&262147&&(e=a[18](a[29])!==a[0]&&a[18](a[29])!==a[1]),e?n?n.p(a,f):(n=Qe(a),n.c(),n.m(i.parentNode,i)):n&&(n.d(1),n=null)},d(a){n&&n.d(a),a&&S(i)}}}function Ze(l){let e,i,n,a,f=(l[6]==="label"||l[8]==="label")&&Je(l);return{c(){e=P("span"),f&&f.c(),c(e,"class","pip last"),c(e,"style",i=l[14]+": 100%;"),A(e,"selected",l[17](l[1])),A(e,"in-range",l[16](l[1]))},m(t,u){y(t,e,u),f&&f.m(e,null),n||(a=[R(e,"click",function(){de(l[20](l[1]))&&l[20](l[1]).apply(this,arguments)}),R(e,"touchend",Ve(function(){de(l[20](l[1]))&&l[20](l[1]).apply(this,arguments)}))],n=!0)},p(t,u){l=t,l[6]==="label"||l[8]==="label"?f?f.p(l,u):(f=Je(l),f.c(),f.m(e,null)):f&&(f.d(1),f=null),u&16384&&i!==(i=l[14]+": 100%;")&&c(e,"style",i),u&131074&&A(e,"selected",l[17](l[1])),u&65538&&A(e,"in-range",l[16](l[1]))},d(t){t&&S(e),f&&f.d(),n=!1,re(a)}}}function Je(l){let e,i=l[12](l[1],l[19],100)+"",n,a=l[10]&&We(l),f=l[11]&&xe(l);return{c(){e=P("span"),a&&a.c(),n=C(i),f&&f.c(),c(e,"class","pipVal")},m(t,u){y(t,e,u),a&&a.m(e,null),E(e,n),f&&f.m(e,null)},p(t,u){t[10]?a?a.p(t,u):(a=We(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u&528386&&i!==(i=t[12](t[1],t[19],100)+"")&&N(n,i),t[11]?f?f.p(t,u):(f=xe(t),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(t){t&&S(e),a&&a.d(),f&&f.d()}}}function We(l){let e,i;return{c(){e=P("span"),i=C(l[10]),c(e,"class","pipVal-prefix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&1024&&N(i,n[10])},d(n){n&&S(e)}}}function xe(l){let e,i;return{c(){e=P("span"),i=C(l[11]),c(e,"class","pipVal-suffix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a&2048&&N(i,n[11])},d(n){n&&S(e)}}}function Yl(l){let e,i,n,a=(l[6]&&l[7]!==!1||l[7])&&Ne(l),f=(l[6]&&l[9]!==!1||l[9])&&ze(l),t=(l[6]&&l[8]!==!1||l[8])&&Ze(l);return{c(){e=P("div"),a&&a.c(),i=z(),f&&f.c(),n=z(),t&&t.c(),c(e,"class","rangePips"),A(e,"disabled",l[5]),A(e,"hoverable",l[4]),A(e,"vertical",l[2]),A(e,"reversed",l[3]),A(e,"focus",l[13])},m(u,_){y(u,e,_),a&&a.m(e,null),E(e,i),f&&f.m(e,null),E(e,n),t&&t.m(e,null)},p(u,[_]){u[6]&&u[7]!==!1||u[7]?a?a.p(u,_):(a=Ne(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),u[6]&&u[9]!==!1||u[9]?f?f.p(u,_):(f=ze(u),f.c(),f.m(e,n)):f&&(f.d(1),f=null),u[6]&&u[8]!==!1||u[8]?t?t.p(u,_):(t=Ze(u),t.c(),t.m(e,null)):t&&(t.d(1),t=null),_&32&&A(e,"disabled",u[5]),_&16&&A(e,"hoverable",u[4]),_&4&&A(e,"vertical",u[2]),_&8&&A(e,"reversed",u[3]),_&8192&&A(e,"focus",u[13])},i:j,o:j,d(u){u&&S(e),a&&a.d(),f&&f.d(),t&&t.d()}}}function Xl(l,e,i){let n,a,f,t,u,{range:_=!1}=e,{min:g=0}=e,{max:o=100}=e,{step:s=1}=e,{values:m=[(o+g)/2]}=e,{vertical:k=!1}=e,{reversed:p=!1}=e,{hoverable:h=!0}=e,{disabled:V=!1}=e,{pipstep:w=void 0}=e,{all:I=!0}=e,{first:Q=void 0}=e,{last:D=void 0}=e,{rest:O=void 0}=e,{prefix:B=""}=e,{suffix:J=""}=e,{formatter:$=(d,se)=>d}=e,{focus:U=void 0}=e,{orientationStart:Y=void 0}=e,{percentOf:ee=void 0}=e,{moveHandle:W=void 0}=e;function ae(d){W(void 0,d)}return l.$$set=d=>{"range"in d&&i(21,_=d.range),"min"in d&&i(0,g=d.min),"max"in d&&i(1,o=d.max),"step"in d&&i(22,s=d.step),"values"in d&&i(23,m=d.values),"vertical"in d&&i(2,k=d.vertical),"reversed"in d&&i(3,p=d.reversed),"hoverable"in d&&i(4,h=d.hoverable),"disabled"in d&&i(5,V=d.disabled),"pipstep"in d&&i(24,w=d.pipstep),"all"in d&&i(6,I=d.all),"first"in d&&i(7,Q=d.first),"last"in d&&i(8,D=d.last),"rest"in d&&i(9,O=d.rest),"prefix"in d&&i(10,B=d.prefix),"suffix"in d&&i(11,J=d.suffix),"formatter"in d&&i(12,$=d.formatter),"focus"in d&&i(13,U=d.focus),"orientationStart"in d&&i(14,Y=d.orientationStart),"percentOf"in d&&i(15,ee=d.percentOf),"moveHandle"in d&&i(25,W=d.moveHandle)},l.$$.update=()=>{l.$$.dirty&20971527&&i(26,n=w||((o-g)/s>=(k?50:100)?(o-g)/(k?10:20):1)),l.$$.dirty&71303171&&i(19,a=parseInt((o-g)/(s*n),10)),l.$$.dirty&71303169&&i(18,f=function(d){return g+d*s*n}),l.$$.dirty&8388608&&i(17,t=function(d){return m.some(se=>se===d)}),l.$$.dirty&10485760&&i(16,u=function(d){if(_==="min")return m[0]>d;if(_==="max")return m[0]<d;if(_)return m[0]<d&&m[1]>d})},[g,o,k,p,h,V,I,Q,D,O,B,J,$,U,Y,ee,u,t,f,a,ae,_,s,m,w,W,n]}class ql extends me{constructor(e){super(),ce(this,e,Xl,Yl,be,{range:21,min:0,max:1,step:22,values:23,vertical:2,reversed:3,hoverable:4,disabled:5,pipstep:24,all:6,first:7,last:8,rest:9,prefix:10,suffix:11,formatter:12,focus:13,orientationStart:14,percentOf:15,moveHandle:25})}}function $e(l,e,i){const n=l.slice();return n[63]=e[i],n[65]=i,n}function el(l){let e,i=l[21](l[63],l[65],l[23](l[63]))+"",n,a=l[18]&&ll(l),f=l[19]&&nl(l);return{c(){e=P("span"),a&&a.c(),n=C(i),f&&f.c(),c(e,"class","rangeFloat")},m(t,u){y(t,e,u),a&&a.m(e,null),E(e,n),f&&f.m(e,null)},p(t,u){t[18]?a?a.p(t,u):(a=ll(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u[0]&10485761&&i!==(i=t[21](t[63],t[65],t[23](t[63]))+"")&&N(n,i),t[19]?f?f.p(t,u):(f=nl(t),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(t){t&&S(e),a&&a.d(),f&&f.d()}}}function ll(l){let e,i;return{c(){e=P("span"),i=C(l[18]),c(e,"class","rangeFloat-prefix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a[0]&262144&&N(i,n[18])},d(n){n&&S(e)}}}function nl(l){let e,i;return{c(){e=P("span"),i=C(l[19]),c(e,"class","rangeFloat-suffix")},m(n,a){y(n,e,a),E(e,i)},p(n,a){a[0]&524288&&N(i,n[19])},d(n){n&&S(e)}}}function il(l){let e,i,n,a,f,t,u,_,g,o,s,m,k,p=l[7]&&el(l);return{c(){e=P("span"),i=P("span"),n=z(),p&&p.c(),c(i,"class","rangeNub"),c(e,"role","slider"),c(e,"class","rangeHandle"),c(e,"data-handle",a=l[65]),c(e,"style",f=l[28]+": "+l[29][l[65]]+"%; z-index: "+(l[26]===l[65]?3:2)+";"),c(e,"aria-valuemin",t=l[2]===!0&&l[65]===1?l[0][0]:l[3]),c(e,"aria-valuemax",u=l[2]===!0&&l[65]===0?l[0][1]:l[4]),c(e,"aria-valuenow",_=l[63]),c(e,"aria-valuetext",g=""+(l[18]+l[21](l[63],l[65],l[23](l[63]))+l[19])),c(e,"aria-orientation",o=l[6]?"vertical":"horizontal"),c(e,"aria-disabled",l[10]),c(e,"disabled",l[10]),c(e,"tabindex",s=l[10]?-1:0),A(e,"active",l[24]&&l[26]===l[65]),A(e,"press",l[25]&&l[26]===l[65])},m(h,V){y(h,e,V),E(e,i),E(e,n),p&&p.m(e,null),m||(k=[R(e,"blur",l[33]),R(e,"focus",l[34]),R(e,"keydown",l[35])],m=!0)},p(h,V){h[7]?p?p.p(h,V):(p=el(h),p.c(),p.m(e,null)):p&&(p.d(1),p=null),V[0]&872415232&&f!==(f=h[28]+": "+h[29][h[65]]+"%; z-index: "+(h[26]===h[65]?3:2)+";")&&c(e,"style",f),V[0]&13&&t!==(t=h[2]===!0&&h[65]===1?h[0][0]:h[3])&&c(e,"aria-valuemin",t),V[0]&21&&u!==(u=h[2]===!0&&h[65]===0?h[0][1]:h[4])&&c(e,"aria-valuemax",u),V[0]&1&&_!==(_=h[63])&&c(e,"aria-valuenow",_),V[0]&11272193&&g!==(g=""+(h[18]+h[21](h[63],h[65],h[23](h[63]))+h[19]))&&c(e,"aria-valuetext",g),V[0]&64&&o!==(o=h[6]?"vertical":"horizontal")&&c(e,"aria-orientation",o),V[0]&1024&&c(e,"aria-disabled",h[10]),V[0]&1024&&c(e,"disabled",h[10]),V[0]&1024&&s!==(s=h[10]?-1:0)&&c(e,"tabindex",s),V[0]&83886080&&A(e,"active",h[24]&&h[26]===h[65]),V[0]&100663296&&A(e,"press",h[25]&&h[26]===h[65])},d(h){h&&S(e),p&&p.d(),m=!1,re(k)}}}function al(l){let e,i;return{c(){e=P("span"),c(e,"class","rangeBar"),c(e,"style",i=l[28]+": "+l[31](l[29])+"%; "+l[27]+": "+l[32](l[29])+"%;")},m(n,a){y(n,e,a)},p(n,a){a[0]&939524096&&i!==(i=n[28]+": "+n[31](n[29])+"%; "+n[27]+": "+n[32](n[29])+"%;")&&c(e,"style",i)},d(n){n&&S(e)}}}function fl(l){let e,i;return e=new ql({props:{values:l[0],min:l[3],max:l[4],step:l[5],range:l[2],vertical:l[6],reversed:l[8],orientationStart:l[28],hoverable:l[9],disabled:l[10],all:l[13],first:l[14],last:l[15],rest:l[16],pipstep:l[12],prefix:l[18],suffix:l[19],formatter:l[20],focus:l[24],percentOf:l[23],moveHandle:l[30]}}),{c(){q(e.$$.fragment)},m(n,a){G(e,n,a),i=!0},p(n,a){const f={};a[0]&1&&(f.values=n[0]),a[0]&8&&(f.min=n[3]),a[0]&16&&(f.max=n[4]),a[0]&32&&(f.step=n[5]),a[0]&4&&(f.range=n[2]),a[0]&64&&(f.vertical=n[6]),a[0]&256&&(f.reversed=n[8]),a[0]&268435456&&(f.orientationStart=n[28]),a[0]&512&&(f.hoverable=n[9]),a[0]&1024&&(f.disabled=n[10]),a[0]&8192&&(f.all=n[13]),a[0]&16384&&(f.first=n[14]),a[0]&32768&&(f.last=n[15]),a[0]&65536&&(f.rest=n[16]),a[0]&4096&&(f.pipstep=n[12]),a[0]&262144&&(f.prefix=n[18]),a[0]&524288&&(f.suffix=n[19]),a[0]&1048576&&(f.formatter=n[20]),a[0]&16777216&&(f.focus=n[24]),a[0]&8388608&&(f.percentOf=n[23]),e.$set(f)},i(n){i||(F(e.$$.fragment,n),i=!0)},o(n){T(e.$$.fragment,n),i=!1},d(n){Z(e,n)}}}function Gl(l){let e,i,n,a,f,t,u=l[0],_=[];for(let s=0;s<u.length;s+=1)_[s]=il($e(l,u,s));let g=l[2]&&al(l),o=l[11]&&fl(l);return{c(){e=P("div");for(let s=0;s<_.length;s+=1)_[s].c();i=z(),g&&g.c(),n=z(),o&&o.c(),c(e,"id",l[17]),c(e,"class","rangeSlider"),A(e,"range",l[2]),A(e,"disabled",l[10]),A(e,"hoverable",l[9]),A(e,"vertical",l[6]),A(e,"reversed",l[8]),A(e,"focus",l[24]),A(e,"min",l[2]==="min"),A(e,"max",l[2]==="max"),A(e,"pips",l[11]),A(e,"pip-labels",l[13]==="label"||l[14]==="label"||l[15]==="label"||l[16]==="label")},m(s,m){y(s,e,m);for(let k=0;k<_.length;k+=1)_[k].m(e,null);E(e,i),g&&g.m(e,null),E(e,n),o&&o.m(e,null),l[49](e),a=!0,f||(t=[R(window,"mousedown",l[38]),R(window,"touchstart",l[38]),R(window,"mousemove",l[39]),R(window,"touchmove",l[39]),R(window,"mouseup",l[40]),R(window,"touchend",l[41]),R(window,"keydown",l[42]),R(e,"mousedown",l[36]),R(e,"mouseup",l[37]),R(e,"touchstart",Ve(l[36])),R(e,"touchend",Ve(l[37]))],f=!0)},p(s,m){if(m[0]&934020317|m[1]&28){u=s[0];let k;for(k=0;k<u.length;k+=1){const p=$e(s,u,k);_[k]?_[k].p(p,m):(_[k]=il(p),_[k].c(),_[k].m(e,i))}for(;k<_.length;k+=1)_[k].d(1);_.length=u.length}s[2]?g?g.p(s,m):(g=al(s),g.c(),g.m(e,n)):g&&(g.d(1),g=null),s[11]?o?(o.p(s,m),m[0]&2048&&F(o,1)):(o=fl(s),o.c(),F(o,1),o.m(e,null)):o&&(ge(),T(o,1,1,()=>{o=null}),he()),(!a||m[0]&131072)&&c(e,"id",s[17]),m[0]&4&&A(e,"range",s[2]),m[0]&1024&&A(e,"disabled",s[10]),m[0]&512&&A(e,"hoverable",s[9]),m[0]&64&&A(e,"vertical",s[6]),m[0]&256&&A(e,"reversed",s[8]),m[0]&16777216&&A(e,"focus",s[24]),m[0]&4&&A(e,"min",s[2]==="min"),m[0]&4&&A(e,"max",s[2]==="max"),m[0]&2048&&A(e,"pips",s[11]),m[0]&122880&&A(e,"pip-labels",s[13]==="label"||s[14]==="label"||s[15]==="label"||s[16]==="label")},i(s){a||(F(o),a=!0)},o(s){T(o),a=!1},d(s){s&&S(e),ul(_,s),g&&g.d(),o&&o.d(),l[49](null),f=!1,re(t)}}}function tl(l){if(!l)return-1;for(var e=0;l=l.previousElementSibling;)e++;return e}function Te(l){return l.type.includes("touch")?l.touches[0]:l}function Zl(l,e,i){let n,a,f,t,u,_,g=j,o=()=>(g(),g=Fl(ne,r=>i(29,_=r)),ne);l.$$.on_destroy.push(()=>g());let{slider:s}=e,{range:m=!1}=e,{pushy:k=!1}=e,{min:p=0}=e,{max:h=100}=e,{step:V=1}=e,{values:w=[(h+p)/2]}=e,{vertical:I=!1}=e,{float:Q=!1}=e,{reversed:D=!1}=e,{hoverable:O=!0}=e,{disabled:B=!1}=e,{pips:J=!1}=e,{pipstep:$=void 0}=e,{all:U=void 0}=e,{first:Y=void 0}=e,{last:ee=void 0}=e,{rest:W=void 0}=e,{id:ae=void 0}=e,{prefix:d=""}=e,{suffix:se=""}=e,{formatter:ke=(r,v,M)=>r}=e,{handleFormatter:Ee=ke}=e,{precision:x=2}=e,{springValues:pe={stiffness:.15,damping:.4}}=e;const we=He();let ve=0,le=!1,fe=!1,te=!1,Ae=!1,b=w.length-1,L,K,ne;function Fe(r){const v=s.querySelectorAll(".handle"),M=Array.prototype.includes.call(v,r),H=Array.prototype.some.call(v,ie=>ie.contains(r));return M||H}function Ie(r){return m==="min"||m==="max"?r.slice(0,1):m?r.slice(0,2):r}function oe(){return s.getBoundingClientRect()}function ye(r){const v=oe();let M=0,H=0,ie=0;I?(M=r.clientY-v.top,H=M/v.height*100,H=D?H:100-H):(M=r.clientX-v.left,H=M/v.width*100,H=D?100-H:H),ie=(h-p)/100*H+p;let Le;return m===!0&&w[0]===w[1]?ie>w[1]?1:0:(Le=w.indexOf([...w].sort((Rl,Hl)=>Math.abs(ie-Rl)-Math.abs(ie-Hl))[0]),Le)}function Se(r){const v=oe();let M=0,H=0,ie=0;I?(M=r.clientY-v.top,H=M/v.height*100,H=D?H:100-H):(M=r.clientX-v.left,H=M/v.width*100,H=D?100-H:H),ie=(h-p)/100*H+p,_e(b,ie)}function _e(r,v){return v=f(v),typeof r>"u"&&(r=b),m&&(r===0&&v>w[1]?k?i(0,w[1]=v,w):v=w[1]:r===1&&v<w[0]&&(k?i(0,w[0]=v,w):v=w[0])),w[r]!==v&&i(0,w[r]=v,w),K!==v&&(El(),K=v),v}function ml(r){return m==="min"?0:r[0]}function cl(r){return m==="max"?0:m==="min"?100-r[0]:100-r[1]}function bl(r){Ae&&(i(24,le=!1),fe=!1,i(25,te=!1))}function gl(r){B||(i(26,b=tl(r.target)),i(24,le=!0))}function hl(r){if(!B){const v=tl(r.target);let M=r.ctrlKey||r.metaKey||r.shiftKey?V*10:V,H=!1;switch(r.key){case"PageDown":M*=10;case"ArrowRight":case"ArrowUp":_e(v,w[v]+M),H=!0;break;case"PageUp":M*=10;case"ArrowLeft":case"ArrowDown":_e(v,w[v]-M),H=!0;break;case"Home":_e(v,p),H=!0;break;case"End":_e(v,h),H=!0;break}H&&(r.preventDefault(),r.stopPropagation())}}function kl(r){if(!B){const v=r.target,M=Te(r);i(24,le=!0),fe=!0,i(25,te=!0),i(26,b=ye(M)),L=K=f(w[b]),Vl(),r.type==="touchstart"&&!v.matches(".pipVal")&&Se(M)}}function pl(r){r.type==="touchend"&&De(),i(25,te=!1)}function wl(r){Ae=!1,le&&r.target!==s&&!s.contains(r.target)&&i(24,le=!1)}function vl(r){B||fe&&Se(Te(r))}function Al(r){if(!B){const v=r.target;fe&&((v===s||s.contains(v))&&(i(24,le=!0),!Fe(v)&&!v.matches(".pipVal")&&Se(Te(r))),De())}fe=!1,i(25,te=!1)}function yl(r){fe=!1,i(25,te=!1)}function Sl(r){B||(r.target===s||s.contains(r.target))&&(Ae=!0)}function Vl(){!B&&we("start",{activeHandle:b,value:L,values:w.map(r=>f(r))})}function De(){!B&&we("stop",{activeHandle:b,startValue:L,value:w[b],values:w.map(r=>f(r))})}function El(){!B&&we("change",{activeHandle:b,startValue:L,previousValue:typeof K>"u"?L:K,value:w[b],values:w.map(r=>f(r))})}function Pl(r){Me[r?"unshift":"push"](()=>{s=r,i(1,s)})}return l.$$set=r=>{"slider"in r&&i(1,s=r.slider),"range"in r&&i(2,m=r.range),"pushy"in r&&i(43,k=r.pushy),"min"in r&&i(3,p=r.min),"max"in r&&i(4,h=r.max),"step"in r&&i(5,V=r.step),"values"in r&&i(0,w=r.values),"vertical"in r&&i(6,I=r.vertical),"float"in r&&i(7,Q=r.float),"reversed"in r&&i(8,D=r.reversed),"hoverable"in r&&i(9,O=r.hoverable),"disabled"in r&&i(10,B=r.disabled),"pips"in r&&i(11,J=r.pips),"pipstep"in r&&i(12,$=r.pipstep),"all"in r&&i(13,U=r.all),"first"in r&&i(14,Y=r.first),"last"in r&&i(15,ee=r.last),"rest"in r&&i(16,W=r.rest),"id"in r&&i(17,ae=r.id),"prefix"in r&&i(18,d=r.prefix),"suffix"in r&&i(19,se=r.suffix),"formatter"in r&&i(20,ke=r.formatter),"handleFormatter"in r&&i(21,Ee=r.handleFormatter),"precision"in r&&i(44,x=r.precision),"springValues"in r&&i(45,pe=r.springValues)},l.$$.update=()=>{l.$$.dirty[0]&24&&i(48,a=function(r){return r<=p?p:r>=h?h:r}),l.$$.dirty[0]&56|l.$$.dirty[1]&139264&&i(47,f=function(r){if(r<=p)return p;if(r>=h)return h;let v=(r-p)%V,M=r-v;return Math.abs(v)*2>=V&&(M+=v>0?V:-V),M=a(M),parseFloat(M.toFixed(x))}),l.$$.dirty[0]&24|l.$$.dirty[1]&8192&&i(23,n=function(r){let v=(r-p)/(h-p)*100;return isNaN(v)||v<=0?0:v>=100?100:parseFloat(v.toFixed(x))}),l.$$.dirty[0]&12582937|l.$$.dirty[1]&114688&&(Array.isArray(w)||(i(0,w=[(h+p)/2]),console.error("'values' prop should be an Array (https://github.com/simeydotme/svelte-range-slider-pips#slider-props)")),i(0,w=Ie(w.map(r=>f(r)))),ve!==w.length?o(i(22,ne=Ml(w.map(r=>n(r)),pe))):ne.set(w.map(r=>n(r))),i(46,ve=w.length)),l.$$.dirty[0]&320&&i(28,t=I?D?"top":"bottom":D?"right":"left"),l.$$.dirty[0]&320&&i(27,u=I?D?"bottom":"top":D?"left":"right")},[w,s,m,p,h,V,I,Q,D,O,B,J,$,U,Y,ee,W,ae,d,se,ke,Ee,ne,n,le,te,b,u,t,_,_e,ml,cl,bl,gl,hl,kl,pl,wl,vl,Al,yl,Sl,k,x,pe,ve,f,a,Pl]}class Jl extends me{constructor(e){super(),ce(this,e,Zl,Gl,be,{slider:1,range:2,pushy:43,min:3,max:4,step:5,values:0,vertical:6,float:7,reversed:8,hoverable:9,disabled:10,pips:11,pipstep:12,all:13,first:14,last:15,rest:16,id:17,prefix:18,suffix:19,formatter:20,handleFormatter:21,precision:44,springValues:45},null,[-1,-1,-1])}}function Wl(l){let e,i,n,a,f,t,u,_,g;e=new jl({props:{editable:!0,absolute:!1}}),e.$on("clear",l[15]),e.$on("edit",l[28]);let o=l[10]==="edit"&&l[11]?.duration&&sl(l);return{c(){q(e.$$.fragment),i=z(),n=P("audio"),f=z(),o&&o.c(),t=ue(),c(n,"class","w-full h-14 p-2"),n.controls=!0,c(n,"preload","metadata"),Re(n.src,a=l[1].data)||c(n,"src",a)},m(s,m){G(e,s,m),y(s,i,m),y(s,n,m),l[29](n),y(s,f,m),o&&o.m(s,m),y(s,t,m),u=!0,_||(g=[Tl(l[16].call(null,n)),R(n,"play",l[24]),R(n,"pause",l[25]),R(n,"ended",l[26])],_=!0)},p(s,m){(!u||m[0]&2&&!Re(n.src,a=s[1].data))&&c(n,"src",a),s[10]==="edit"&&s[11]?.duration?o?(o.p(s,m),m[0]&3072&&F(o,1)):(o=sl(s),o.c(),F(o,1),o.m(t.parentNode,t)):o&&(ge(),T(o,1,1,()=>{o=null}),he())},i(s){u||(F(e.$$.fragment,s),F(o),u=!0)},o(s){T(e.$$.fragment,s),T(o),u=!1},d(s){Z(e,s),s&&S(i),s&&S(n),l[29](null),s&&S(f),o&&o.d(s),s&&S(t),_=!1,re(g)}}}function xl(l){let e,i,n,a;const f=[en,$l],t=[];function u(_,g){return _[4]==="microphone"?0:_[4]==="upload"?1:-1}return~(e=u(l))&&(i=t[e]=f[e](l)),{c(){i&&i.c(),n=ue()},m(_,g){~e&&t[e].m(_,g),y(_,n,g),a=!0},p(_,g){let o=e;e=u(_),e===o?~e&&t[e].p(_,g):(i&&(ge(),T(t[o],1,1,()=>{t[o]=null}),he()),~e?(i=t[e],i?i.p(_,g):(i=t[e]=f[e](_),i.c()),F(i,1),i.m(n.parentNode,n)):i=null)},i(_){a||(F(i),a=!0)},o(_){T(i),a=!1},d(_){~e&&t[e].d(_),_&&S(n)}}}function sl(l){let e,i,n;function a(t){l[30](t)}let f={range:!0,min:0,max:100,step:1};return l[12]!==void 0&&(f.values=l[12]),e=new Jl({props:f}),Me.push(()=>_l(e,"values",a)),e.$on("change",l[17]),{c(){q(e.$$.fragment)},m(t,u){G(e,t,u),n=!0},p(t,u){const _={};!i&&u[0]&4096&&(i=!0,_.values=t[12],ol(()=>i=!1)),e.$set(_)},i(t){n||(F(e.$$.fragment,t),n=!0)},o(t){T(e.$$.fragment,t),n=!1},d(t){Z(e,t)}}}function $l(l){let e,i,n;function a(t){l[27](t)}let f={filetype:"audio/*",$$slots:{default:[ln]},$$scope:{ctx:l}};return l[0]!==void 0&&(f.dragging=l[0]),e=new Kl({props:f}),Me.push(()=>_l(e,"dragging",a)),e.$on("load",l[18]),{c(){q(e.$$.fragment)},m(t,u){G(e,t,u),n=!0},p(t,u){const _={};u[0]&448|u[1]&512&&(_.$$scope={dirty:u,ctx:t}),!i&&u[0]&1&&(i=!0,_.dragging=t[0],ol(()=>i=!1)),e.$set(_)},i(t){n||(F(e.$$.fragment,t),n=!0)},o(t){T(e.$$.fragment,t),n=!1},d(t){Z(e,t)}}}function en(l){let e;function i(f,t){return f[9]?an:nn}let n=i(l),a=n(l);return{c(){e=P("div"),a.c(),c(e,"class","mt-6 p-2")},m(f,t){y(f,e,t),a.m(e,null)},p(f,t){n===(n=i(f))&&a?a.p(f,t):(a.d(1),a=n(f),a&&(a.c(),a.m(e,null)))},i:j,o:j,d(f){f&&S(e),a.d()}}}function ln(l){let e,i,n,a,f,t,u,_,g;return{c(){e=P("div"),i=C(l[6]),n=z(),a=P("span"),f=C("- "),t=C(l[7]),u=C(" -"),_=z(),g=C(l[8]),c(a,"class","text-gray-300"),c(e,"class","flex flex-col")},m(o,s){y(o,e,s),E(e,i),E(e,n),E(e,a),E(a,f),E(a,t),E(a,u),E(e,_),E(e,g)},p(o,s){s[0]&64&&N(i,o[6]),s[0]&128&&N(t,o[7]),s[0]&256&&N(g,o[8])},d(o){o&&S(e)}}}function nn(l){let e,i,n;return{c(){e=P("button"),e.innerHTML=`<span class="flex h-1.5 w-1.5 relative mr-2"><span class="relative inline-flex rounded-full h-1.5 w-1.5 bg-red-500"></span></span>
|
2 |
+
<div class="whitespace-nowrap">Record from microphone</div>`,c(e,"class","gr-button text-gray-800")},m(a,f){y(a,e,f),i||(n=R(e,"click",l[13]),i=!0)},p:j,d(a){a&&S(e),i=!1,n()}}}function an(l){let e,i,n;return{c(){e=P("button"),e.innerHTML=`<span class="flex h-1.5 w-1.5 relative mr-2 "><span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span>
|
3 |
+
<span class="relative inline-flex rounded-full h-1.5 w-1.5 bg-red-500"></span></span>
|
4 |
+
<div class="whitespace-nowrap text-red-500">Stop recording</div>`,c(e,"class","gr-button !bg-red-500/10")},m(a,f){y(a,e,f),i||(n=R(e,"click",l[14]),i=!0)},p:j,d(a){a&&S(e),i=!1,n()}}}function fn(l){let e,i,n,a,f,t;e=new dl({props:{show_label:l[3],Icon:Be,label:l[2]||"Audio"}});const u=[xl,Wl],_=[];function g(o,s){return o[1]===null||o[5]?0:1}return n=g(l),a=_[n]=u[n](l),{c(){q(e.$$.fragment),i=z(),a.c(),f=ue()},m(o,s){G(e,o,s),y(o,i,s),_[n].m(o,s),y(o,f,s),t=!0},p(o,s){const m={};s[0]&8&&(m.show_label=o[3]),s[0]&4&&(m.label=o[2]||"Audio"),e.$set(m);let k=n;n=g(o),n===k?_[n].p(o,s):(ge(),T(_[k],1,1,()=>{_[k]=null}),he(),a=_[n],a?a.p(o,s):(a=_[n]=u[n](o),a.c()),F(a,1),a.m(f.parentNode,f))},i(o){t||(F(e.$$.fragment,o),F(a),t=!0)},o(o){T(e.$$.fragment,o),T(a),t=!1},d(o){Z(e,o),o&&S(i),_[n].d(o),o&&S(f)}}}const tn=500,rl=44;function sn(l){return new Promise((e,i)=>{let n=new FileReader;n.onerror=i,n.onload=()=>e(n.result),n.readAsDataURL(l)})}function rn(l,e,i){let{value:n=null}=e,{label:a}=e,{show_label:f}=e,{name:t}=e,{source:u}=e,{pending:_=!1}=e,{streaming:g=!1}=e,{drop_text:o="Drop an audio file"}=e,{or_text:s="or"}=e,{upload_text:m="click to upload"}=e,k=!1,p,h="",V,w=[],I=!1,Q,D=!1,O=[0,100],B=[],J;function $(){J=[Ue(()=>import("./module.2849491a.js"),["assets/module.2849491a.js","assets/module.e2741a44.js"]),Ue(()=>import("./module.d8037460.js"),["assets/module.d8037460.js","assets/module.e2741a44.js"])]}g&&$();const U=He(),Y=async(b,L)=>{let K=new Blob(b,{type:"audio/wav"});i(1,n={data:await sn(K),name:t}),U(L,n)};async function ee(){let b;try{b=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(L){if(L instanceof DOMException&&L.name=="NotAllowedError"){U("error","Please allow access to the microphone for recording.");return}else throw L}if(b!=null){if(g){const[{MediaRecorder:L,register:K},{connect:ne}]=await Promise.all(J);await K(await ne()),p=new L(b,{mimeType:"audio/wav"});async function Fe(Ie){let oe=await Ie.data.arrayBuffer(),ye=new Uint8Array(oe);if(V||(i(21,V=new Uint8Array(oe.slice(0,rl))),ye=new Uint8Array(oe.slice(rl))),_)w.push(ye);else{let Se=[V].concat(w,[ye]);Y(Se,"stream"),i(22,w=[])}}p.addEventListener("dataavailable",Fe)}else p=new MediaRecorder(b),p.addEventListener("dataavailable",L=>{B.push(L.data)}),p.addEventListener("stop",async()=>{i(9,k=!1),await Y(B,"change"),B=[]});D=!0}}async function W(){i(9,k=!0),D||await ee(),i(21,V=void 0),g?p.start(tn):p.start()}Il(()=>{p&&p.state!=="inactive"&&p.stop()});const ae=async()=>{p.stop(),g&&(i(9,k=!1),_&&i(23,I=!0))};function d(){U("change"),U("clear"),i(10,h=""),i(1,n=null)}function se(b){function L(){const K=O[0]/100*b.duration,ne=O[1]/100*b.duration;b.currentTime<K&&(b.currentTime=K),b.currentTime>ne&&(b.currentTime=K,b.pause())}return b.addEventListener("timeupdate",L),{destroy:()=>b.removeEventListener("timeupdate",L)}}function ke({detail:{values:b}}){!n||(U("change",{data:n.data,name:t,crop_min:b[0],crop_max:b[1]}),U("edit"))}function Ee({detail:b}){i(1,n=b),U("change",{data:b.data,name:b.name}),U("upload",b)}let{dragging:x=!1}=e;function pe(b){X.call(this,l,b)}function we(b){X.call(this,l,b)}function ve(b){X.call(this,l,b)}function le(b){x=b,i(0,x)}const fe=()=>i(10,h="edit");function te(b){Me[b?"unshift":"push"](()=>{Q=b,i(11,Q)})}function Ae(b){O=b,i(12,O)}return l.$$set=b=>{"value"in b&&i(1,n=b.value),"label"in b&&i(2,a=b.label),"show_label"in b&&i(3,f=b.show_label),"name"in b&&i(19,t=b.name),"source"in b&&i(4,u=b.source),"pending"in b&&i(20,_=b.pending),"streaming"in b&&i(5,g=b.streaming),"drop_text"in b&&i(6,o=b.drop_text),"or_text"in b&&i(7,s=b.or_text),"upload_text"in b&&i(8,m=b.upload_text),"dragging"in b&&i(0,x=b.dragging)},l.$$.update=()=>{if(l.$$.dirty[0]&15728640&&I&&_===!1&&(i(23,I=!1),V&&w)){let b=[V].concat(w);i(22,w=[]),Y(b,"stream")}l.$$.dirty[0]&1&&U("drag",x)},[x,n,a,f,u,g,o,s,m,k,h,Q,O,W,ae,d,se,ke,Ee,t,_,V,w,I,pe,we,ve,le,fe,te,Ae]}class un extends me{constructor(e){super(),ce(this,e,rn,fn,be,{value:1,label:2,show_label:3,name:19,source:4,pending:20,streaming:5,drop_text:6,or_text:7,upload_text:8,dragging:0},null,[-1,-1])}}function on(l){let e,i,n,a;return{c(){e=P("audio"),c(e,"class","w-full h-14 p-2 mt-7"),e.controls=!0,c(e,"preload","metadata"),Re(e.src,i=l[0].data)||c(e,"src",i)},m(f,t){y(f,e,t),n||(a=[R(e,"play",l[4]),R(e,"pause",l[5]),R(e,"ended",l[6])],n=!0)},p(f,t){t&1&&!Re(e.src,i=f[0].data)&&c(e,"src",i)},i:j,o:j,d(f){f&&S(e),n=!1,re(a)}}}function _n(l){let e,i,n,a;return n=new Be({}),{c(){e=P("div"),i=P("div"),q(n.$$.fragment),c(i,"class","h-5 dark:text-white opacity-50"),c(e,"class","h-full min-h-[8rem] flex justify-center items-center")},m(f,t){y(f,e,t),E(e,i),G(n,i,null),a=!0},p:j,i(f){a||(F(n.$$.fragment,f),a=!0)},o(f){T(n.$$.fragment,f),a=!1},d(f){f&&S(e),Z(n)}}}function dn(l){let e,i,n,a,f,t;e=new dl({props:{show_label:l[2],Icon:Be,label:l[1]||"Audio"}});const u=[_n,on],_=[];function g(o,s){return o[0]===null?0:1}return n=g(l),a=_[n]=u[n](l),{c(){q(e.$$.fragment),i=z(),a.c(),f=ue()},m(o,s){G(e,o,s),y(o,i,s),_[n].m(o,s),y(o,f,s),t=!0},p(o,[s]){const m={};s&4&&(m.show_label=o[2]),s&2&&(m.label=o[1]||"Audio"),e.$set(m);let k=n;n=g(o),n===k?_[n].p(o,s):(ge(),T(_[k],1,1,()=>{_[k]=null}),he(),a=_[n],a?a.p(o,s):(a=_[n]=u[n](o),a.c()),F(a,1),a.m(f.parentNode,f))},i(o){t||(F(e.$$.fragment,o),F(a),t=!0)},o(o){T(e.$$.fragment,o),T(a),t=!1},d(o){Z(e,o),o&&S(i),_[n].d(o),o&&S(f)}}}function mn(l,e,i){let{value:n=null}=e,{label:a}=e,{name:f}=e,{show_label:t}=e;const u=He();function _(s){X.call(this,l,s)}function g(s){X.call(this,l,s)}function o(s){X.call(this,l,s)}return l.$$set=s=>{"value"in s&&i(0,n=s.value),"label"in s&&i(1,a=s.label),"name"in s&&i(3,f=s.name),"show_label"in s&&i(2,t=s.show_label)},l.$$.update=()=>{l.$$.dirty&9&&n&&u("change",{name:f,data:n?.data})},[n,a,t,f,_,g,o]}class cn extends me{constructor(e){super(),ce(this,e,mn,dn,be,{value:0,label:1,name:3,show_label:2})}}function bn(l){let e,i;return e=new cn({props:{show_label:l[8],value:l[11],name:l[11]?.name||"audio_file",label:l[7]}}),{c(){q(e.$$.fragment)},m(n,a){G(e,n,a),i=!0},p(n,a){const f={};a&256&&(f.show_label=n[8]),a&2048&&(f.value=n[11]),a&2048&&(f.name=n[11]?.name||"audio_file"),a&128&&(f.label=n[7]),e.$set(f)},i(n){i||(F(e.$$.fragment,n),i=!0)},o(n){T(e.$$.fragment,n),i=!1},d(n){Z(e,n)}}}function gn(l){let e,i;return e=new un({props:{label:l[7],show_label:l[8],value:l[11],name:l[5],source:l[6],pending:l[9],streaming:l[10],drop_text:l[13]("interface.drop_audio"),or_text:l[13]("or"),upload_text:l[13]("interface.click_to_upload")}}),e.$on("change",l[18]),e.$on("stream",l[19]),e.$on("drag",l[20]),e.$on("edit",l[21]),e.$on("play",l[22]),e.$on("pause",l[23]),e.$on("ended",l[24]),e.$on("upload",l[25]),e.$on("error",l[26]),{c(){q(e.$$.fragment)},m(n,a){G(e,n,a),i=!0},p(n,a){const f={};a&128&&(f.label=n[7]),a&256&&(f.show_label=n[8]),a&2048&&(f.value=n[11]),a&32&&(f.name=n[5]),a&64&&(f.source=n[6]),a&512&&(f.pending=n[9]),a&1024&&(f.streaming=n[10]),a&8192&&(f.drop_text=n[13]("interface.drop_audio")),a&8192&&(f.or_text=n[13]("or")),a&8192&&(f.upload_text=n[13]("interface.click_to_upload")),e.$set(f)},i(n){i||(F(e.$$.fragment,n),i=!0)},o(n){T(e.$$.fragment,n),i=!1},d(n){Z(e,n)}}}function hn(l){let e,i,n,a,f,t;const u=[l[1]];let _={};for(let m=0;m<u.length;m+=1)_=Ul(_,u[m]);e=new Cl({props:_});const g=[gn,bn],o=[];function s(m,k){return m[4]==="dynamic"?0:1}return n=s(l),a=o[n]=g[n](l),{c(){q(e.$$.fragment),i=z(),a.c(),f=ue()},m(m,k){G(e,m,k),y(m,i,k),o[n].m(m,k),y(m,f,k),t=!0},p(m,k){const p=k&2?Nl(u,[Ol(m[1])]):{};e.$set(p);let h=n;n=s(m),n===h?o[n].p(m,k):(ge(),T(o[h],1,1,()=>{o[h]=null}),he(),a=o[n],a?a.p(m,k):(a=o[n]=g[n](m),a.c()),F(a,1),a.m(f.parentNode,f))},i(m){t||(F(e.$$.fragment,m),F(a),t=!0)},o(m){T(e.$$.fragment,m),T(a),t=!1},d(m){Z(e,m),m&&S(i),o[n].d(m),m&&S(f)}}}function kn(l){let e,i;return e=new Bl({props:{variant:l[4]==="dynamic"&&l[0]===null&&l[6]==="upload"?"dashed":"solid",color:l[12]?"green":"grey",padding:!1,elem_id:l[2],visible:l[3],$$slots:{default:[hn]},$$scope:{ctx:l}}}),{c(){q(e.$$.fragment)},m(n,a){G(e,n,a),i=!0},p(n,[a]){const f={};a&81&&(f.variant=n[4]==="dynamic"&&n[0]===null&&n[6]==="upload"?"dashed":"solid"),a&4096&&(f.color=n[12]?"green":"grey"),a&4&&(f.elem_id=n[2]),a&8&&(f.visible=n[3]),a&134234099&&(f.$$scope={dirty:a,ctx:n}),e.$set(f)},i(n){i||(F(e.$$.fragment,n),i=!0)},o(n){T(e.$$.fragment,n),i=!1},d(n){Z(e,n)}}}function pn(l,e,i){let n;Dl(l,Ll,d=>i(13,n=d));let{style:a={}}=e;const f=He();let{elem_id:t=""}=e,{visible:u=!0}=e,{mode:_}=e,{value:g=null}=e,{name:o}=e,{source:s}=e,{label:m}=e,{root:k}=e,{show_label:p}=e,{pending:h}=e,{streaming:V}=e,{root_url:w}=e,{loading_status:I}=e,Q,D;const O=({detail:d})=>{i(0,g=d),f("change",g)},B=({detail:d})=>{i(0,g=d),f("stream",g)},J=({detail:d})=>i(12,D=d);function $(d){X.call(this,l,d)}function U(d){X.call(this,l,d)}function Y(d){X.call(this,l,d)}function ee(d){X.call(this,l,d)}function W(d){X.call(this,l,d)}const ae=({detail:d})=>{i(1,I=I||{}),i(1,I.status="error",I),i(1,I.message=d,I)};return l.$$set=d=>{"style"in d&&i(15,a=d.style),"elem_id"in d&&i(2,t=d.elem_id),"visible"in d&&i(3,u=d.visible),"mode"in d&&i(4,_=d.mode),"value"in d&&i(0,g=d.value),"name"in d&&i(5,o=d.name),"source"in d&&i(6,s=d.source),"label"in d&&i(7,m=d.label),"root"in d&&i(16,k=d.root),"show_label"in d&&i(8,p=d.show_label),"pending"in d&&i(9,h=d.pending),"streaming"in d&&i(10,V=d.streaming),"root_url"in d&&i(17,w=d.root_url),"loading_status"in d&&i(1,I=d.loading_status)},l.$$.update=()=>{l.$$.dirty&196609&&i(11,Q=zl(g,w??k))},[g,I,t,u,_,o,s,m,p,h,V,Q,D,n,f,a,k,w,O,B,J,$,U,Y,ee,W,ae]}class wn extends me{constructor(e){super(),ce(this,e,pn,kn,be,{style:15,elem_id:2,visible:3,mode:4,value:0,name:5,source:6,label:7,root:16,show_label:8,pending:9,streaming:10,root_url:17,loading_status:1})}}var En=wn;const Pn=["static","dynamic"],Rn=()=>({type:"{ name: string; data: string }",description:"audio data as base64 string",example_data:{name:"audio.wav",data:"data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA="}});export{En as Component,Rn as document,Pn as modes};
|
5 |
+
//# sourceMappingURL=index.64f1ca39.js.map
|
gradio-modified/templates/frontend/assets/index.67e8cf09.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as E,i as F,s as I,a7 as K,e as h,c as T,a as A,b as g,f as w,g as v,m as B,a8 as S,l as j,am as D,j as C,k as M,n as k,o as R,A as L,F as O,t as P,h as U,P as V,R as z,T as G,I as H,O as J,U as N,V as Q,L as W,K as X}from"./index.396f4a72.js";function Y(e){let l;return{c(){l=P(e[5])},m(a,n){w(a,l,n)},p(a,n){n&32&&U(l,a[5])},d(a){a&&k(l)}}}function Z(e){let l,a,n,_,b,m,r,f,o,t,d;return _=new K({props:{show_label:e[6],$$slots:{default:[Y]},$$scope:{ctx:e}}}),{c(){l=h("div"),a=h("div"),n=h("label"),T(_.$$.fragment),b=A(),m=h("input"),r=A(),f=h("input"),g(n,"for",e[7]),g(m,"type","number"),g(m,"class","gr-box gr-input gr-text-input text-center h-6"),g(m,"min",e[1]),g(m,"max",e[2]),g(m,"step",e[3]),m.disabled=e[4],g(a,"class","flex justify-between"),g(l,"class","w-full flex flex-col "),g(f,"type","range"),g(f,"id",e[7]),g(f,"name","cowbell"),g(f,"class","w-full disabled:cursor-not-allowed"),g(f,"min",e[1]),g(f,"max",e[2]),g(f,"step",e[3]),f.disabled=e[4]},m(s,u){w(s,l,u),v(l,a),v(a,n),B(_,n,null),v(a,b),v(a,m),S(m,e[0]),w(s,r,u),w(s,f,u),S(f,e[0]),o=!0,t||(d=[j(m,"input",e[10]),j(m,"blur",e[8]),j(f,"change",e[11]),j(f,"input",e[11])],t=!0)},p(s,[u]){const c={};u&64&&(c.show_label=s[6]),u&8224&&(c.$$scope={dirty:u,ctx:s}),_.$set(c),(!o||u&2)&&g(m,"min",s[1]),(!o||u&4)&&g(m,"max",s[2]),(!o||u&8)&&g(m,"step",s[3]),(!o||u&16)&&(m.disabled=s[4]),u&1&&D(m.value)!==s[0]&&S(m,s[0]),(!o||u&2)&&g(f,"min",s[1]),(!o||u&4)&&g(f,"max",s[2]),(!o||u&8)&&g(f,"step",s[3]),(!o||u&16)&&(f.disabled=s[4]),u&1&&S(f,s[0])},i(s){o||(C(_.$$.fragment,s),o=!0)},o(s){M(_.$$.fragment,s),o=!1},d(s){s&&k(l),R(_),s&&k(r),s&&k(f),t=!1,L(d)}}}let y=0;function p(e,l,a){let{value:n=0}=l,{style:_={}}=l,{minimum:b=0}=l,{maximum:m=100}=l,{step:r=1}=l,{disabled:f=!1}=l,{label:o}=l,{show_label:t}=l;const d=`range_id_${y++}`,s=O(),u=()=>a(0,n=Math.min(Math.max(n,b),m));function c(){n=D(this.value),a(0,n)}function q(){n=D(this.value),a(0,n)}return e.$$set=i=>{"value"in i&&a(0,n=i.value),"style"in i&&a(9,_=i.style),"minimum"in i&&a(1,b=i.minimum),"maximum"in i&&a(2,m=i.maximum),"step"in i&&a(3,r=i.step),"disabled"in i&&a(4,f=i.disabled),"label"in i&&a(5,o=i.label),"show_label"in i&&a(6,t=i.show_label)},e.$$.update=()=>{e.$$.dirty&1&&s("change",n)},[n,b,m,r,f,o,t,d,u,_,c,q]}class x extends E{constructor(l){super(),F(this,l,p,Z,I,{value:0,style:9,minimum:1,maximum:2,step:3,disabled:4,label:5,show_label:6})}}function $(e){let l,a,n,_,b;const m=[e[10]];let r={};for(let t=0;t<m.length;t+=1)r=z(r,m[t]);l=new G({props:r});function f(t){e[11](t)}let o={label:e[3],show_label:e[9],minimum:e[5],maximum:e[6],step:e[7],style:e[4],disabled:e[8]==="static"};return e[0]!==void 0&&(o.value=e[0]),n=new x({props:o}),H.push(()=>J(n,"value",f)),n.$on("change",e[12]),{c(){T(l.$$.fragment),a=A(),T(n.$$.fragment)},m(t,d){B(l,t,d),w(t,a,d),B(n,t,d),b=!0},p(t,d){const s=d&1024?N(m,[Q(t[10])]):{};l.$set(s);const u={};d&8&&(u.label=t[3]),d&512&&(u.show_label=t[9]),d&32&&(u.minimum=t[5]),d&64&&(u.maximum=t[6]),d&128&&(u.step=t[7]),d&16&&(u.style=t[4]),d&256&&(u.disabled=t[8]==="static"),!_&&d&1&&(_=!0,u.value=t[0],W(()=>_=!1)),n.$set(u)},i(t){b||(C(l.$$.fragment,t),C(n.$$.fragment,t),b=!0)},o(t){M(l.$$.fragment,t),M(n.$$.fragment,t),b=!1},d(t){R(l,t),t&&k(a),R(n,t)}}}function ee(e){let l,a;return l=new V({props:{visible:e[2],elem_id:e[1],disable:typeof e[4].container=="boolean"&&!e[4].container,$$slots:{default:[$]},$$scope:{ctx:e}}}),{c(){T(l.$$.fragment)},m(n,_){B(l,n,_),a=!0},p(n,[_]){const b={};_&4&&(b.visible=n[2]),_&2&&(b.elem_id=n[1]),_&16&&(b.disable=typeof n[4].container=="boolean"&&!n[4].container),_&10233&&(b.$$scope={dirty:_,ctx:n}),l.$set(b)},i(n){a||(C(l.$$.fragment,n),a=!0)},o(n){M(l.$$.fragment,n),a=!1},d(n){R(l,n)}}}function le(e,l,a){let{elem_id:n=""}=l,{visible:_=!0}=l,{value:b=0}=l,{label:m="Slider"}=l,{style:r={}}=l,{minimum:f}=l,{maximum:o}=l,{step:t}=l,{mode:d}=l,{show_label:s}=l,{loading_status:u}=l;function c(i){b=i,a(0,b)}function q(i){X.call(this,e,i)}return e.$$set=i=>{"elem_id"in i&&a(1,n=i.elem_id),"visible"in i&&a(2,_=i.visible),"value"in i&&a(0,b=i.value),"label"in i&&a(3,m=i.label),"style"in i&&a(4,r=i.style),"minimum"in i&&a(5,f=i.minimum),"maximum"in i&&a(6,o=i.maximum),"step"in i&&a(7,t=i.step),"mode"in i&&a(8,d=i.mode),"show_label"in i&&a(9,s=i.show_label),"loading_status"in i&&a(10,u=i.loading_status)},[b,n,_,m,r,f,o,t,d,s,u,c,q]}class ae extends E{constructor(l){super(),F(this,l,le,ee,I,{elem_id:1,visible:2,value:0,label:3,style:4,minimum:5,maximum:6,step:7,mode:8,show_label:9,loading_status:10})}}var ie=ae;const te=["static","dynamic"],se=e=>({type:"number",description:"selected value",example_data:e.value??e.minimum});export{ie as Component,se as document,te as modes};
|
2 |
+
//# sourceMappingURL=index.67e8cf09.js.map
|
gradio-modified/templates/frontend/assets/index.6b09b320.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as f,i as _,s as c,P as m,c as d,m as b,j as r,k as u,o as p,p as g,u as v,q as $,r as k}from"./index.396f4a72.js";function h(o){let s;const l=o[2].default,e=g(l,o,o[3],null);return{c(){e&&e.c()},m(t,n){e&&e.m(t,n),s=!0},p(t,n){e&&e.p&&(!s||n&8)&&v(e,l,t,t[3],s?k(l,t[3],n,null):$(t[3]),null)},i(t){s||(r(e,t),s=!0)},o(t){u(e,t),s=!1},d(t){e&&e.d(t)}}}function B(o){let s,l;return s=new m({props:{elem_id:o[0],visible:o[1],explicit_call:!0,$$slots:{default:[h]},$$scope:{ctx:o}}}),{c(){d(s.$$.fragment)},m(e,t){b(s,e,t),l=!0},p(e,[t]){const n={};t&1&&(n.elem_id=e[0]),t&2&&(n.visible=e[1]),t&8&&(n.$$scope={dirty:t,ctx:e}),s.$set(n)},i(e){l||(r(s.$$.fragment,e),l=!0)},o(e){u(s.$$.fragment,e),l=!1},d(e){p(s,e)}}}function q(o,s,l){let{$$slots:e={},$$scope:t}=s,{elem_id:n}=s,{visible:a=!0}=s;return o.$$set=i=>{"elem_id"in i&&l(0,n=i.elem_id),"visible"in i&&l(1,a=i.visible),"$$scope"in i&&l(3,t=i.$$scope)},[n,a,e,t]}class C extends f{constructor(s){super(),_(this,s,q,B,c,{elem_id:0,visible:1})}}var j=C;const w=["static"];export{j as Component,w as modes};
|
2 |
+
//# sourceMappingURL=index.6b09b320.js.map
|
gradio-modified/templates/frontend/assets/index.712d6db6.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.rangeSlider{--pip:var(--range-pip, lightslategray);--pip-text:var(--range-pip-text, var(--pip));--pip-active:var(--range-pip-active, darkslategrey);--pip-active-text:var(--range-pip-active-text, var(--pip-active));--pip-hover:var(--range-pip-hover, darkslategrey);--pip-hover-text:var(--range-pip-hover-text, var(--pip-hover));--pip-in-range:var(--range-pip-in-range, var(--pip-active));--pip-in-range-text:var(--range-pip-in-range-text, var(--pip-active-text))}.rangePips{position:absolute;height:1em;left:0;right:0;bottom:-1em}.rangePips.vertical{height:auto;width:1em;inset:0 auto 0 100%}.rangePips .pip{height:.4em;position:absolute;top:.25em;width:1px;white-space:nowrap}.rangePips.vertical .pip{height:1px;width:.4em;left:.25em;top:auto;bottom:auto}.rangePips .pipVal{position:absolute;top:.4em;transform:translate(-50%,25%)}.rangePips.vertical .pipVal{position:absolute;top:0;left:.4em;transform:translate(25%,-50%)}.rangePips .pip{transition:all .15s ease}.rangePips .pipVal{transition:all .15s ease,font-weight 0s linear}.rangePips .pip{color:#789;color:var(--pip-text);background-color:#789;background-color:var(--pip)}.rangePips .pip.selected{color:#2f4f4f;color:var(--pip-active-text);background-color:#2f4f4f;background-color:var(--pip-active)}.rangePips.hoverable:not(.disabled) .pip:hover{color:#2f4f4f;color:var(--pip-hover-text);background-color:#2f4f4f;background-color:var(--pip-hover)}.rangePips .pip.in-range{color:#2f4f4f;color:var(--pip-in-range-text);background-color:#2f4f4f;background-color:var(--pip-in-range)}.rangePips .pip.selected{height:.75em}.rangePips.vertical .pip.selected{height:1px;width:.75em}.rangePips .pip.selected .pipVal{font-weight:700;top:.75em}.rangePips.vertical .pip.selected .pipVal{top:0;left:.75em}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover{transition:none}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover .pipVal{transition:none;font-weight:700}.rangeSlider{--slider:var(--range-slider, #d7dada);--handle-inactive:var(--range-handle-inactive, #99a2a2);--handle:var(--range-handle, #838de7);--handle-focus:var(--range-handle-focus, #4a40d4);--handle-border:var(--range-handle-border, var(--handle));--range-inactive:var(--range-range-inactive, var(--handle-inactive));--range:var(--range-range, var(--handle-focus));--float-inactive:var(--range-float-inactive, var(--handle-inactive));--float:var(--range-float, var(--handle-focus));--float-text:var(--range-float-text, white);position:relative;border-radius:100px;height:.5em;margin:1em;transition:opacity .2s ease;user-select:none}.rangeSlider *{user-select:none}.rangeSlider.pips{margin-bottom:1.8em}.rangeSlider.pip-labels{margin-bottom:2.8em}.rangeSlider.vertical{display:inline-block;border-radius:100px;width:.5em;min-height:200px}.rangeSlider.vertical.pips{margin-right:1.8em;margin-bottom:1em}.rangeSlider.vertical.pip-labels{margin-right:2.8em;margin-bottom:1em}.rangeSlider .rangeHandle{position:absolute;display:block;height:1.4em;width:1.4em;top:.25em;bottom:auto;transform:translateY(-50%) translate(-50%);z-index:2}.rangeSlider.reversed .rangeHandle{transform:translateY(-50%) translate(50%)}.rangeSlider.vertical .rangeHandle{left:.25em;top:auto;transform:translateY(50%) translate(-50%)}.rangeSlider.vertical.reversed .rangeHandle{transform:translateY(-50%) translate(-50%)}.rangeSlider .rangeNub,.rangeSlider .rangeHandle:before{position:absolute;left:0;top:0;display:block;border-radius:10em;height:100%;width:100%;transition:box-shadow .2s ease}.rangeSlider .rangeHandle:before{content:"";inset:1px;height:auto;width:auto;box-shadow:0 0 0 0 var(--handle-border);opacity:0}.rangeSlider.hoverable:not(.disabled) .rangeHandle:hover:before{box-shadow:0 0 0 8px var(--handle-border);opacity:.2}.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:before,.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:hover:before{box-shadow:0 0 0 12px var(--handle-border);opacity:.4}.rangeSlider.range:not(.min):not(.max) .rangeNub{border-radius:10em 10em 10em 1.6em}.rangeSlider.range .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(135deg)}.rangeSlider .rangeFloat{display:block;position:absolute;left:50%;top:-.5em;transform:translate(-50%,-100%);text-align:center;opacity:0;pointer-events:none;white-space:nowrap;transition:all .2s ease;font-size:.9em;padding:.2em .4em;border-radius:.2em}.rangeSlider .rangeHandle.active .rangeFloat,.rangeSlider.hoverable .rangeHandle:hover .rangeFloat{opacity:1;top:-.2em;transform:translate(-50%,-100%)}.rangeSlider .rangeBar{position:absolute;display:block;transition:background .2s ease;border-radius:1em;height:.5em;top:0;user-select:none;z-index:1}.rangeSlider.vertical .rangeBar{width:.5em;height:auto}.rangeSlider{background-color:#d7dada;background-color:var(--slider)}.rangeSlider .rangeBar{background-color:#99a2a2;background-color:var(--range-inactive)}.rangeSlider.focus .rangeBar{background-color:#838de7;background-color:var(--range)}.rangeSlider .rangeNub{background-color:#99a2a2;background-color:var(--handle-inactive)}.rangeSlider.focus .rangeNub{background-color:#838de7;background-color:var(--handle)}.rangeSlider .rangeHandle.active .rangeNub{background-color:#4a40d4;background-color:var(--handle-focus)}.rangeSlider .rangeFloat{color:#fff;color:var(--float-text);background-color:#99a2a2;background-color:var(--float-inactive)}.rangeSlider.focus .rangeFloat{background-color:#4a40d4;background-color:var(--float)}.rangeSlider.disabled{opacity:.5}.rangeSlider.disabled .rangeNub{background-color:#d7dada;background-color:var(--slider)}
|
gradio-modified/templates/frontend/assets/index.72f44ebf.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.chat-message.svelte-1kgfmmo img{border-radius:13px;max-width:30vw}
|
gradio-modified/templates/frontend/assets/index.75c2aff1.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
import{S as q,i as A,s as D,a7 as I,e as w,a as T,t as E,b as d,d as j,f as g,g as k,l as K,h as F,n as m,c as v,m as C,j as y,k as G,o as S,C as L,F as P,Z as R,P as U,R as V,T as Z,I as z,O as H,U as J,V as M,L as N,K as Q}from"./index.396f4a72.js";function B(l,e,t){const s=l.slice();return s[10]=e[t],s}function W(l){let e;return{c(){e=E(l[3])},m(t,s){g(t,e,s)},p(t,s){s&8&&F(e,t[3])},d(t){t&&m(e)}}}function O(l){let e,t,s,c,o,u=l[10]+"",n,f,b,a;function r(){return l[8](l[10])}return{c(){e=w("label"),t=w("input"),c=T(),o=w("span"),n=E(u),t.disabled=l[2],t.checked=s=l[0].includes(l[10]),d(t,"type","checkbox"),d(t,"name","test"),d(t,"class","gr-check-radio gr-checkbox"),d(o,"class","ml-2"),d(e,"class",f="gr-input-label flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner "+l[5]),j(e,"!cursor-not-allowed",l[2])},m(h,i){g(h,e,i),k(e,t),k(e,c),k(e,o),k(o,n),b||(a=K(t,"change",r),b=!0)},p(h,i){l=h,i&4&&(t.disabled=l[2]),i&3&&s!==(s=l[0].includes(l[10]))&&(t.checked=s),i&2&&u!==(u=l[10]+"")&&F(n,u),i&32&&f!==(f="gr-input-label flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner "+l[5])&&d(e,"class",f),i&36&&j(e,"!cursor-not-allowed",l[2])},d(h){h&&m(e),b=!1,a()}}}function X(l){let e,t,s,c;e=new I({props:{show_label:l[4],$$slots:{default:[W]},$$scope:{ctx:l}}});let o=l[1],u=[];for(let n=0;n<o.length;n+=1)u[n]=O(B(l,o,n));return{c(){v(e.$$.fragment),t=T(),s=w("div");for(let n=0;n<u.length;n+=1)u[n].c();d(s,"class","flex flex-wrap gap-2"),d(s,"data-testid","checkbox-group")},m(n,f){C(e,n,f),g(n,t,f),g(n,s,f);for(let b=0;b<u.length;b+=1)u[b].m(s,null);c=!0},p(n,[f]){const b={};if(f&16&&(b.show_label=n[4]),f&8200&&(b.$$scope={dirty:f,ctx:n}),e.$set(b),f&103){o=n[1];let a;for(a=0;a<o.length;a+=1){const r=B(n,o,a);u[a]?u[a].p(r,f):(u[a]=O(r),u[a].c(),u[a].m(s,null))}for(;a<u.length;a+=1)u[a].d(1);u.length=o.length}},i(n){c||(y(e.$$.fragment,n),c=!0)},o(n){G(e.$$.fragment,n),c=!1},d(n){S(e,n),n&&m(t),n&&m(s),L(u,n)}}}function Y(l,e,t){let s,{value:c=[]}=e,{style:o={}}=e,{choices:u}=e,{disabled:n=!1}=e,{label:f}=e,{show_label:b}=e;const a=P(),r=i=>{c.includes(i)?c.splice(c.indexOf(i),1):c.push(i),a("change",c),t(0,c)},h=i=>r(i);return l.$$set=i=>{"value"in i&&t(0,c=i.value),"style"in i&&t(7,o=i.style),"choices"in i&&t(1,u=i.choices),"disabled"in i&&t(2,n=i.disabled),"label"in i&&t(3,f=i.label),"show_label"in i&&t(4,b=i.show_label)},l.$$.update=()=>{l.$$.dirty&128&&t(5,{item_container:s}=R(o,["item_container"]),s)},[c,u,n,f,b,s,r,o,h]}class p extends q{constructor(e){super(),A(this,e,Y,X,D,{value:0,style:7,choices:1,disabled:2,label:3,show_label:4})}}function x(l){let e,t,s,c,o;const u=[l[8]];let n={};for(let a=0;a<u.length;a+=1)n=V(n,u[a]);e=new Z({props:n});function f(a){l[9](a)}let b={choices:l[3],label:l[6],style:l[4],show_label:l[7],disabled:l[5]==="static"};return l[0]!==void 0&&(b.value=l[0]),s=new p({props:b}),z.push(()=>H(s,"value",f)),s.$on("change",l[10]),{c(){v(e.$$.fragment),t=T(),v(s.$$.fragment)},m(a,r){C(e,a,r),g(a,t,r),C(s,a,r),o=!0},p(a,r){const h=r&256?J(u,[M(a[8])]):{};e.$set(h);const i={};r&8&&(i.choices=a[3]),r&64&&(i.label=a[6]),r&16&&(i.style=a[4]),r&128&&(i.show_label=a[7]),r&32&&(i.disabled=a[5]==="static"),!c&&r&1&&(c=!0,i.value=a[0],N(()=>c=!1)),s.$set(i)},i(a){o||(y(e.$$.fragment,a),y(s.$$.fragment,a),o=!0)},o(a){G(e.$$.fragment,a),G(s.$$.fragment,a),o=!1},d(a){S(e,a),a&&m(t),S(s,a)}}}function $(l){let e,t;return e=new U({props:{visible:l[2],elem_id:l[1],type:"fieldset",disable:typeof l[4].container=="boolean"&&!l[4].container,$$slots:{default:[x]},$$scope:{ctx:l}}}),{c(){v(e.$$.fragment)},m(s,c){C(e,s,c),t=!0},p(s,[c]){const o={};c&4&&(o.visible=s[2]),c&2&&(o.elem_id=s[1]),c&16&&(o.disable=typeof s[4].container=="boolean"&&!s[4].container),c&2553&&(o.$$scope={dirty:c,ctx:s}),e.$set(o)},i(s){t||(y(e.$$.fragment,s),t=!0)},o(s){G(e.$$.fragment,s),t=!1},d(s){S(e,s)}}}function ee(l,e,t){let{elem_id:s=""}=e,{visible:c=!0}=e,{value:o=[]}=e,{choices:u}=e,{style:n={}}=e,{mode:f}=e,{label:b="Checkbox Group"}=e,{show_label:a}=e,{loading_status:r}=e;function h(_){o=_,t(0,o)}function i(_){Q.call(this,l,_)}return l.$$set=_=>{"elem_id"in _&&t(1,s=_.elem_id),"visible"in _&&t(2,c=_.visible),"value"in _&&t(0,o=_.value),"choices"in _&&t(3,u=_.choices),"style"in _&&t(4,n=_.style),"mode"in _&&t(5,f=_.mode),"label"in _&&t(6,b=_.label),"show_label"in _&&t(7,a=_.show_label),"loading_status"in _&&t(8,r=_.loading_status)},[o,s,c,u,n,f,b,a,r,h,i]}class le extends q{constructor(e){super(),A(this,e,ee,$,D,{elem_id:1,visible:2,value:0,choices:3,style:4,mode:5,label:6,show_label:7,loading_status:8})}}var se=le;const ae=["static","dynamic"],ne=l=>({type:"Array<string>",description:"list of selected choices",example_data:l.choices.length?[l.choices[0]]:[]});export{se as Component,ne as document,ae as modes};
|
2 |
+
//# sourceMappingURL=index.75c2aff1.js.map
|
gradio-modified/templates/frontend/assets/index.7a93f874.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.hl.svelte-o4yfdm+.hl.svelte-o4yfdm{margin-left:.25rem}.textspan.svelte-o4yfdm:last-child>.label.svelte-o4yfdm{margin-right:0}
|