Upload folder using huggingface_hub
Browse files- README.md +3 -3
- __pycache__/__init__.cpython-310.pyc +0 -0
- __pycache__/app.cpython-310.pyc +0 -0
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +1 -6
- space.py +1 -6
- src/Dockerfile +12 -0
- src/README.md +1 -6
- src/backend/gradio_image_annotation/image_annotator.py +12 -9
- src/backend/gradio_image_annotation/image_annotator.pyi +12 -9
- src/backend/gradio_image_annotation/templates/component/index.js +0 -0
- src/backend/gradio_image_annotation/templates/example/index.js +413 -416
- src/demo/app.py +1 -6
- src/demo/space.py +1 -6
- src/frontend/shared/Box.ts +4 -2
- src/frontend/shared/Canvas.svelte +6 -10
- src/pyproject.toml +2 -2
README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,gradio-template-Image,bounding box,annotator,annotate,boxes]
|
4 |
-
title: gradio_image_annotation V0.0.
|
5 |
-
colorFrom:
|
6 |
-
colorTo:
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,gradio-template-Image,bounding box,annotator,annotate,boxes]
|
4 |
+
title: gradio_image_annotation V0.0.6
|
5 |
+
colorFrom: blue
|
6 |
+
colorTo: red
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (155 Bytes). View file
|
|
__pycache__/app.cpython-310.pyc
ADDED
Binary file (1.99 kB). View file
|
|
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -27,12 +27,7 @@ def crop(annotations):
|
|
27 |
|
28 |
|
29 |
def get_boxes_json(annotations):
|
30 |
-
return [
|
31 |
-
{k: box[k]
|
32 |
-
for k in box if k in ("xmin", "ymin", "xmax", "ymax", "label")}
|
33 |
-
for box in annotations["boxes"]
|
34 |
-
]
|
35 |
-
|
36 |
|
37 |
with gr.Blocks() as demo:
|
38 |
with gr.Tab("Object annotation"):
|
|
|
27 |
|
28 |
|
29 |
def get_boxes_json(annotations):
|
30 |
+
return annotations["boxes"]
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
with gr.Blocks() as demo:
|
33 |
with gr.Tab("Object annotation"):
|
space.py
CHANGED
@@ -67,12 +67,7 @@ def crop(annotations):
|
|
67 |
|
68 |
|
69 |
def get_boxes_json(annotations):
|
70 |
-
return [
|
71 |
-
{k: box[k]
|
72 |
-
for k in box if k in ("xmin", "ymin", "xmax", "ymax", "label")}
|
73 |
-
for box in annotations["boxes"]
|
74 |
-
]
|
75 |
-
|
76 |
|
77 |
with gr.Blocks() as demo:
|
78 |
with gr.Tab("Object annotation"):
|
|
|
67 |
|
68 |
|
69 |
def get_boxes_json(annotations):
|
70 |
+
return annotations["boxes"]
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
with gr.Blocks() as demo:
|
73 |
with gr.Tab("Object annotation"):
|
src/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# FROM nikolaik/python-nodejs:python3.10-nodejs20-alpine
|
2 |
+
FROM node:20.5.0
|
3 |
+
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
|
7 |
+
RUN apt-get update && \
|
8 |
+
apt-get install -y python3-pip
|
9 |
+
|
10 |
+
RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED
|
11 |
+
|
12 |
+
RUN python3 -m pip install --no-cache-dir gradio==4.27 numpy
|
src/README.md
CHANGED
@@ -42,12 +42,7 @@ def crop(annotations):
|
|
42 |
|
43 |
|
44 |
def get_boxes_json(annotations):
|
45 |
-
return [
|
46 |
-
{k: box[k]
|
47 |
-
for k in box if k in ("xmin", "ymin", "xmax", "ymax", "label")}
|
48 |
-
for box in annotations["boxes"]
|
49 |
-
]
|
50 |
-
|
51 |
|
52 |
with gr.Blocks() as demo:
|
53 |
with gr.Tab("Object annotation"):
|
|
|
42 |
|
43 |
|
44 |
def get_boxes_json(annotations):
|
45 |
+
return annotations["boxes"]
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
with gr.Blocks() as demo:
|
48 |
with gr.Tab("Object annotation"):
|
src/backend/gradio_image_annotation/image_annotator.py
CHANGED
@@ -205,19 +205,22 @@ class image_annotator(Component):
|
|
205 |
)
|
206 |
|
207 |
def preprocess_boxes(self, boxes: List[dict] | None) -> list:
|
208 |
-
|
209 |
-
return []
|
210 |
for box in boxes:
|
|
|
|
|
|
|
211 |
if "color" in box:
|
212 |
match = re.match(r'rgb\((\d+), (\d+), (\d+)\)', box["color"])
|
213 |
if match:
|
214 |
-
|
215 |
-
scale_factor = box
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
221 |
|
222 |
def preprocess(self, payload: AnnotatedImageData | None) -> dict | None:
|
223 |
"""
|
|
|
205 |
)
|
206 |
|
207 |
def preprocess_boxes(self, boxes: List[dict] | None) -> list:
|
208 |
+
parsed_boxes = []
|
|
|
209 |
for box in boxes:
|
210 |
+
new_box = {}
|
211 |
+
new_box["label"] = box.get("label", "")
|
212 |
+
new_box["color"] = (0,0,0)
|
213 |
if "color" in box:
|
214 |
match = re.match(r'rgb\((\d+), (\d+), (\d+)\)', box["color"])
|
215 |
if match:
|
216 |
+
new_box["color"] = tuple(int(match.group(i)) for i in range(1, 4))
|
217 |
+
scale_factor = box.get("scaleFactor", 1)
|
218 |
+
new_box["xmin"] = round(box["xmin"] / scale_factor)
|
219 |
+
new_box["ymin"] = round(box["ymin"] / scale_factor)
|
220 |
+
new_box["xmax"] = round(box["xmax"] / scale_factor)
|
221 |
+
new_box["ymax"] = round(box["ymax"] / scale_factor)
|
222 |
+
parsed_boxes.append(new_box)
|
223 |
+
return parsed_boxes
|
224 |
|
225 |
def preprocess(self, payload: AnnotatedImageData | None) -> dict | None:
|
226 |
"""
|
src/backend/gradio_image_annotation/image_annotator.pyi
CHANGED
@@ -196,19 +196,22 @@ class image_annotator(Component):
|
|
196 |
)
|
197 |
|
198 |
def preprocess_boxes(self, boxes: List[dict] | None) -> list:
|
199 |
-
|
200 |
-
return []
|
201 |
for box in boxes:
|
|
|
|
|
|
|
202 |
if "color" in box:
|
203 |
match = re.match(r'rgb\((\d+), (\d+), (\d+)\)', box["color"])
|
204 |
if match:
|
205 |
-
|
206 |
-
scale_factor = box
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
212 |
|
213 |
def preprocess(self, payload: AnnotatedImageData | None) -> dict | None:
|
214 |
"""
|
|
|
196 |
)
|
197 |
|
198 |
def preprocess_boxes(self, boxes: List[dict] | None) -> list:
|
199 |
+
parsed_boxes = []
|
|
|
200 |
for box in boxes:
|
201 |
+
new_box = {}
|
202 |
+
new_box["label"] = box.get("label", "")
|
203 |
+
new_box["color"] = (0,0,0)
|
204 |
if "color" in box:
|
205 |
match = re.match(r'rgb\((\d+), (\d+), (\d+)\)', box["color"])
|
206 |
if match:
|
207 |
+
new_box["color"] = tuple(int(match.group(i)) for i in range(1, 4))
|
208 |
+
scale_factor = box.get("scaleFactor", 1)
|
209 |
+
new_box["xmin"] = round(box["xmin"] / scale_factor)
|
210 |
+
new_box["ymin"] = round(box["ymin"] / scale_factor)
|
211 |
+
new_box["xmax"] = round(box["xmax"] / scale_factor)
|
212 |
+
new_box["ymax"] = round(box["ymax"] / scale_factor)
|
213 |
+
parsed_boxes.append(new_box)
|
214 |
+
return parsed_boxes
|
215 |
|
216 |
def preprocess(self, payload: AnnotatedImageData | None) -> dict | None:
|
217 |
"""
|
src/backend/gradio_image_annotation/templates/component/index.js
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
src/backend/gradio_image_annotation/templates/example/index.js
CHANGED
@@ -41,7 +41,7 @@ async function fr(e) {
|
|
41 |
}
|
42 |
const {
|
43 |
SvelteComponent: hr,
|
44 |
-
append:
|
45 |
attr: X,
|
46 |
detach: cr,
|
47 |
init: mr,
|
@@ -58,7 +58,7 @@ function br(e) {
|
|
58 |
t = Je("svg"), n = Je("g"), i = Je("path"), r = Je("path"), X(i, "d", "M18,6L6.087,17.913"), Z(i, "fill", "none"), Z(i, "fill-rule", "nonzero"), Z(i, "stroke-width", "2px"), X(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), X(r, "d", "M4.364,4.364L19.636,19.636"), Z(r, "fill", "none"), Z(r, "fill-rule", "nonzero"), Z(r, "stroke-width", "2px"), X(t, "width", "100%"), X(t, "height", "100%"), X(t, "viewBox", "0 0 24 24"), X(t, "version", "1.1"), X(t, "xmlns", "http://www.w3.org/2000/svg"), X(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), X(t, "xml:space", "preserve"), X(t, "stroke", "currentColor"), Z(t, "fill-rule", "evenodd"), Z(t, "clip-rule", "evenodd"), Z(t, "stroke-linecap", "round"), Z(t, "stroke-linejoin", "round");
|
59 |
},
|
60 |
m(s, u) {
|
61 |
-
_r(s, t, u),
|
62 |
},
|
63 |
p: Pt,
|
64 |
i: Pt,
|
@@ -76,7 +76,7 @@ class gr extends hr {
|
|
76 |
const {
|
77 |
SvelteComponent: pr,
|
78 |
append: vr,
|
79 |
-
attr:
|
80 |
detach: yr,
|
81 |
init: Er,
|
82 |
insert: wr,
|
@@ -88,7 +88,7 @@ function Sr(e) {
|
|
88 |
let t, n;
|
89 |
return {
|
90 |
c() {
|
91 |
-
t = En("svg"), n = En("path"),
|
92 |
},
|
93 |
m(i, r) {
|
94 |
wr(i, t, r), vr(t, n);
|
@@ -110,8 +110,8 @@ const {
|
|
110 |
SvelteComponent: Ar,
|
111 |
append: Br,
|
112 |
attr: V,
|
113 |
-
detach:
|
114 |
-
init:
|
115 |
insert: Pr,
|
116 |
noop: Nt,
|
117 |
safe_not_equal: Ir,
|
@@ -130,32 +130,32 @@ function Nr(e) {
|
|
130 |
i: Nt,
|
131 |
o: Nt,
|
132 |
d(i) {
|
133 |
-
i &&
|
134 |
}
|
135 |
};
|
136 |
}
|
137 |
class Or extends Ar {
|
138 |
constructor(t) {
|
139 |
-
super(),
|
140 |
}
|
141 |
}
|
142 |
const {
|
143 |
SvelteComponent: Lr,
|
144 |
append: xn,
|
145 |
-
attr:
|
146 |
detach: Mr,
|
147 |
init: Rr,
|
148 |
insert: kr,
|
149 |
noop: Ot,
|
150 |
safe_not_equal: Dr,
|
151 |
-
set_style:
|
152 |
svg_element: Lt
|
153 |
} = window.__gradio__svelte__internal;
|
154 |
function Ur(e) {
|
155 |
let t, n, i;
|
156 |
return {
|
157 |
c() {
|
158 |
-
t = Lt("svg"), n = Lt("line"), i = Lt("line"),
|
159 |
},
|
160 |
m(r, s) {
|
161 |
kr(r, t, s), xn(t, n), xn(t, i);
|
@@ -270,7 +270,7 @@ const {
|
|
270 |
set_data: bs,
|
271 |
space: gs,
|
272 |
text: ps,
|
273 |
-
toggle_class:
|
274 |
transition_in: Le,
|
275 |
transition_out: ft,
|
276 |
update_slot_base: vs
|
@@ -348,9 +348,9 @@ function Es(e) {
|
|
348 |
);
|
349 |
return {
|
350 |
c() {
|
351 |
-
t = ls("span"), u && u.c(), n = gs(), o && o.c(), i = us(), Sn(t, "data-testid", "block-info"), Sn(t, "class", "svelte-22c38v"),
|
352 |
-
e[0]),
|
353 |
-
e[0]),
|
354 |
t,
|
355 |
"has-info",
|
356 |
/*info*/
|
@@ -380,11 +380,11 @@ function Es(e) {
|
|
380 |
),
|
381 |
null
|
382 |
), (!r || f & /*show_label*/
|
383 |
-
1) &&
|
384 |
a[0]), (!r || f & /*show_label*/
|
385 |
-
1) &&
|
386 |
a[0]), (!r || f & /*info*/
|
387 |
-
2) &&
|
388 |
t,
|
389 |
"has-info",
|
390 |
/*info*/
|
@@ -735,16 +735,16 @@ const {
|
|
735 |
SvelteComponent: Ss,
|
736 |
append: Bn,
|
737 |
attr: Mt,
|
738 |
-
bubble:
|
739 |
create_component: Hs,
|
740 |
destroy_component: As,
|
741 |
detach: ci,
|
742 |
-
element:
|
743 |
init: Bs,
|
744 |
insert: mi,
|
745 |
listen: Rt,
|
746 |
-
mount_component:
|
747 |
-
run_all:
|
748 |
safe_not_equal: Ps,
|
749 |
set_data: Is,
|
750 |
set_input_value: Pn,
|
@@ -795,11 +795,11 @@ function Us(e) {
|
|
795 |
}
|
796 |
}), {
|
797 |
c() {
|
798 |
-
t =
|
799 |
e[3], Mt(r, "class", "svelte-16l8u73"), Mt(t, "class", "block");
|
800 |
},
|
801 |
m(a, f) {
|
802 |
-
mi(a, t, f),
|
803 |
r,
|
804 |
/*value*/
|
805 |
e[0]
|
@@ -847,7 +847,7 @@ function Us(e) {
|
|
847 |
Ms(n.$$.fragment, a), s = !1;
|
848 |
},
|
849 |
d(a) {
|
850 |
-
a && ci(t), As(n), u = !1,
|
851 |
}
|
852 |
};
|
853 |
}
|
@@ -861,10 +861,10 @@ function Gs(e, t, n) {
|
|
861 |
n(5, r = !1);
|
862 |
});
|
863 |
function h(b) {
|
864 |
-
|
865 |
}
|
866 |
-
function
|
867 |
-
|
868 |
}
|
869 |
function _() {
|
870 |
i = this.value, n(0, i);
|
@@ -882,7 +882,7 @@ function Gs(e, t, n) {
|
|
882 |
a,
|
883 |
r,
|
884 |
h,
|
885 |
-
|
886 |
_
|
887 |
];
|
888 |
}
|
@@ -898,7 +898,7 @@ class Fs extends Ss {
|
|
898 |
});
|
899 |
}
|
900 |
}
|
901 |
-
function
|
902 |
}
|
903 |
function zs(e) {
|
904 |
return e();
|
@@ -916,7 +916,7 @@ function qs(e, ...t) {
|
|
916 |
if (e == null) {
|
917 |
for (const i of t)
|
918 |
i(void 0);
|
919 |
-
return
|
920 |
}
|
921 |
const n = e.subscribe(...t);
|
922 |
return n.unsubscribe ? () => n.unsubscribe() : n;
|
@@ -934,49 +934,49 @@ function Ws(e) {
|
|
934 |
return t * t * t + 1;
|
935 |
}
|
936 |
function Nn(e, { delay: t = 0, duration: n = 400, easing: i = Ws, x: r = 0, y: s = 0, opacity: u = 0 } = {}) {
|
937 |
-
const o = getComputedStyle(e), a = +o.opacity, f = o.transform === "none" ? "" : o.transform, l = a * (1 - u), [h,
|
938 |
return {
|
939 |
delay: t,
|
940 |
duration: n,
|
941 |
easing: i,
|
942 |
css: (g, d) => `
|
943 |
-
transform: ${f} translate(${(1 - g) * h}${
|
944 |
opacity: ${a - l * d}`
|
945 |
};
|
946 |
}
|
947 |
-
const
|
948 |
function Ys(e, t) {
|
949 |
return {
|
950 |
subscribe: yt(e, t).subscribe
|
951 |
};
|
952 |
}
|
953 |
-
function yt(e, t =
|
954 |
let n;
|
955 |
const i = /* @__PURE__ */ new Set();
|
956 |
function r(o) {
|
957 |
if (Vs(e, o) && (e = o, n)) {
|
958 |
-
const a = !
|
959 |
for (const f of i)
|
960 |
-
f[1](),
|
961 |
if (a) {
|
962 |
-
for (let f = 0; f <
|
963 |
-
|
964 |
-
|
965 |
}
|
966 |
}
|
967 |
}
|
968 |
function s(o) {
|
969 |
r(o(e));
|
970 |
}
|
971 |
-
function u(o, a =
|
972 |
const f = [o, a];
|
973 |
-
return i.add(f), i.size === 1 && (n = t(r, s) ||
|
974 |
i.delete(f), i.size === 0 && n && (n(), n = null);
|
975 |
};
|
976 |
}
|
977 |
return { set: r, update: s, subscribe: u };
|
978 |
}
|
979 |
-
function
|
980 |
const i = !Array.isArray(e), r = i ? [e] : e;
|
981 |
if (!r.every(Boolean))
|
982 |
throw new Error("derived() expects stores as input, got a falsy value");
|
@@ -984,25 +984,25 @@ function Ce(e, t, n) {
|
|
984 |
return Ys(n, (u, o) => {
|
985 |
let a = !1;
|
986 |
const f = [];
|
987 |
-
let l = 0, h =
|
988 |
-
const
|
989 |
if (l)
|
990 |
return;
|
991 |
h();
|
992 |
const b = t(i ? f[0] : f, u, o);
|
993 |
-
s ? u(b) : h = Xs(b) ? b :
|
994 |
}, _ = r.map(
|
995 |
(b, g) => qs(
|
996 |
b,
|
997 |
(d) => {
|
998 |
-
f[g] = d, l &= ~(1 << g), a &&
|
999 |
},
|
1000 |
() => {
|
1001 |
l |= 1 << g;
|
1002 |
}
|
1003 |
)
|
1004 |
);
|
1005 |
-
return a = !0,
|
1006 |
js(_), h(), a = !1;
|
1007 |
};
|
1008 |
});
|
@@ -1028,7 +1028,7 @@ const {
|
|
1028 |
set_style: F,
|
1029 |
space: pi,
|
1030 |
src_url_equal: _t,
|
1031 |
-
toggle_class:
|
1032 |
transition_in: dt,
|
1033 |
transition_out: bt,
|
1034 |
update_slot_base: vi
|
@@ -1059,7 +1059,7 @@ function io(e) {
|
|
1059 |
/*elem_id*/
|
1060 |
e[0]
|
1061 |
), t.disabled = /*disabled*/
|
1062 |
-
e[8],
|
1063 |
e[2]), F(
|
1064 |
t,
|
1065 |
"flex-grow",
|
@@ -1115,7 +1115,7 @@ function io(e) {
|
|
1115 |
), (!r || h & /*disabled*/
|
1116 |
256) && (t.disabled = /*disabled*/
|
1117 |
l[8]), (!r || h & /*size, variant, elem_classes, visible*/
|
1118 |
-
30) &&
|
1119 |
l[2]), h & /*scale*/
|
1120 |
512 && F(
|
1121 |
t,
|
@@ -1179,8 +1179,8 @@ function ro(e) {
|
|
1179 |
"id",
|
1180 |
/*elem_id*/
|
1181 |
e[0]
|
1182 |
-
),
|
1183 |
-
e[2]),
|
1184 |
t,
|
1185 |
"disabled",
|
1186 |
/*disabled*/
|
@@ -1250,9 +1250,9 @@ function ro(e) {
|
|
1250 |
/*elem_id*/
|
1251 |
a[0]
|
1252 |
), (!r || f & /*size, variant, elem_classes, visible*/
|
1253 |
-
30) &&
|
1254 |
a[2]), (!r || f & /*size, variant, elem_classes, disabled*/
|
1255 |
-
282) &&
|
1256 |
t,
|
1257 |
"disabled",
|
1258 |
/*disabled*/
|
@@ -1372,12 +1372,12 @@ function so(e) {
|
|
1372 |
};
|
1373 |
}
|
1374 |
function oo(e, t, n) {
|
1375 |
-
let { $$slots: i = {}, $$scope: r } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: o = !0 } = t, { variant: a = "secondary" } = t, { size: f = "lg" } = t, { value: l = null } = t, { link: h = null } = t, { icon:
|
1376 |
-
function d(
|
1377 |
-
Qs.call(this, e,
|
1378 |
}
|
1379 |
-
return e.$$set = (
|
1380 |
-
"elem_id" in
|
1381 |
}, [
|
1382 |
s,
|
1383 |
u,
|
@@ -1386,7 +1386,7 @@ function oo(e, t, n) {
|
|
1386 |
f,
|
1387 |
l,
|
1388 |
h,
|
1389 |
-
|
1390 |
_,
|
1391 |
b,
|
1392 |
g,
|
@@ -1433,7 +1433,7 @@ function _o(e) {
|
|
1433 |
return Array.isArray(e) ? [] : {};
|
1434 |
}
|
1435 |
function ze(e, t) {
|
1436 |
-
return t.clone !== !1 && t.isMergeableObject(e) ?
|
1437 |
}
|
1438 |
function bo(e, t, n) {
|
1439 |
return e.concat(t).map(function(i) {
|
@@ -1442,9 +1442,9 @@ function bo(e, t, n) {
|
|
1442 |
}
|
1443 |
function go(e, t) {
|
1444 |
if (!t.customMerge)
|
1445 |
-
return
|
1446 |
var n = t.customMerge(e);
|
1447 |
-
return typeof n == "function" ? n :
|
1448 |
}
|
1449 |
function po(e) {
|
1450 |
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
|
@@ -1472,19 +1472,19 @@ function yo(e, t, n) {
|
|
1472 |
vo(e, r) || (yi(e, r) && n.isMergeableObject(t[r]) ? i[r] = go(r, n)(e[r], t[r], n) : i[r] = ze(t[r], n));
|
1473 |
}), i;
|
1474 |
}
|
1475 |
-
function
|
1476 |
n = n || {}, n.arrayMerge = n.arrayMerge || bo, n.isMergeableObject = n.isMergeableObject || lo, n.cloneUnlessOtherwiseSpecified = ze;
|
1477 |
var i = Array.isArray(t), r = Array.isArray(e), s = i === r;
|
1478 |
return s ? i ? n.arrayMerge(e, t, n) : yo(e, t, n) : ze(t, n);
|
1479 |
}
|
1480 |
-
|
1481 |
if (!Array.isArray(t))
|
1482 |
throw new Error("first argument should be an array");
|
1483 |
return t.reduce(function(i, r) {
|
1484 |
-
return
|
1485 |
}, {});
|
1486 |
};
|
1487 |
-
var Eo =
|
1488 |
const xo = /* @__PURE__ */ ao(wo);
|
1489 |
var Qt = function(e, t) {
|
1490 |
return Qt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
@@ -1503,15 +1503,15 @@ function wt(e, t) {
|
|
1503 |
}
|
1504 |
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
1505 |
}
|
1506 |
-
var
|
1507 |
-
return
|
1508 |
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
1509 |
n = arguments[i];
|
1510 |
for (var s in n)
|
1511 |
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
1512 |
}
|
1513 |
return t;
|
1514 |
-
},
|
1515 |
};
|
1516 |
function kt(e, t, n) {
|
1517 |
if (n || arguments.length === 2)
|
@@ -1527,10 +1527,10 @@ var I;
|
|
1527 |
(function(e) {
|
1528 |
e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
|
1529 |
})(I || (I = {}));
|
1530 |
-
var
|
1531 |
(function(e) {
|
1532 |
e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
|
1533 |
-
})(
|
1534 |
function kn(e) {
|
1535 |
return e.type === I.literal;
|
1536 |
}
|
@@ -1559,12 +1559,12 @@ function Ai(e) {
|
|
1559 |
return e.type === I.tag;
|
1560 |
}
|
1561 |
function Bi(e) {
|
1562 |
-
return !!(e && typeof e == "object" && e.type ===
|
1563 |
}
|
1564 |
function Jt(e) {
|
1565 |
-
return !!(e && typeof e == "object" && e.type ===
|
1566 |
}
|
1567 |
-
var
|
1568 |
function Bo(e) {
|
1569 |
var t = {};
|
1570 |
return e.replace(Ao, function(n) {
|
@@ -1656,12 +1656,12 @@ function Bo(e) {
|
|
1656 |
return "";
|
1657 |
}), t;
|
1658 |
}
|
1659 |
-
var
|
1660 |
-
function
|
1661 |
if (e.length === 0)
|
1662 |
throw new Error("Number skeleton cannot be empty");
|
1663 |
-
for (var t = e.split(
|
1664 |
-
return
|
1665 |
}), n = [], i = 0, r = t; i < r.length; i++) {
|
1666 |
var s = r[i], u = s.split("/");
|
1667 |
if (u.length === 0)
|
@@ -1678,10 +1678,10 @@ function To(e) {
|
|
1678 |
function Po(e) {
|
1679 |
return e.replace(/^(.*?)-/, "");
|
1680 |
}
|
1681 |
-
var Dn = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,
|
1682 |
function Un(e) {
|
1683 |
var t = {};
|
1684 |
-
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(
|
1685 |
return typeof r != "string" ? (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length) : r === "+" ? t.minimumSignificantDigits = i.length : i[0] === "#" ? t.maximumSignificantDigits = i.length : (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length + (typeof r == "string" ? r.length : 0)), "";
|
1686 |
}), t;
|
1687 |
}
|
@@ -1778,13 +1778,13 @@ function Oo(e) {
|
|
1778 |
t.notation = "compact", t.compactDisplay = "long";
|
1779 |
continue;
|
1780 |
case "scientific":
|
1781 |
-
t =
|
1782 |
-
return
|
1783 |
}, {}));
|
1784 |
continue;
|
1785 |
case "engineering":
|
1786 |
-
t =
|
1787 |
-
return
|
1788 |
}, {}));
|
1789 |
continue;
|
1790 |
case "notation-simple":
|
@@ -1808,11 +1808,11 @@ function Oo(e) {
|
|
1808 |
case "integer-width":
|
1809 |
if (r.options.length > 1)
|
1810 |
throw new RangeError("integer-width stems only accept a single optional option");
|
1811 |
-
r.options[0].replace(Io, function(a, f, l, h,
|
1812 |
if (f)
|
1813 |
t.minimumIntegerDigits = l.length;
|
1814 |
else {
|
1815 |
-
if (h &&
|
1816 |
throw new Error("We currently do not support maximum integer digits");
|
1817 |
if (_)
|
1818 |
throw new Error("We currently do not support exact integer digits");
|
@@ -1828,21 +1828,21 @@ function Oo(e) {
|
|
1828 |
if (Dn.test(r.stem)) {
|
1829 |
if (r.options.length > 1)
|
1830 |
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
1831 |
-
r.stem.replace(Dn, function(a, f, l, h,
|
1832 |
-
return l === "*" ? t.minimumFractionDigits = f.length : h && h[0] === "#" ? t.maximumFractionDigits = h.length :
|
1833 |
});
|
1834 |
var s = r.options[0];
|
1835 |
-
s === "w" ? t =
|
1836 |
continue;
|
1837 |
}
|
1838 |
-
if (
|
1839 |
-
t =
|
1840 |
continue;
|
1841 |
}
|
1842 |
var u = Ii(r.stem);
|
1843 |
-
u && (t =
|
1844 |
var o = No(r.stem);
|
1845 |
-
o && (t =
|
1846 |
}
|
1847 |
return t;
|
1848 |
}
|
@@ -3221,7 +3221,7 @@ function Mo(e) {
|
|
3221 |
var r = Ke[i || ""] || Ke[n || ""] || Ke["".concat(n, "-001")] || Ke["001"];
|
3222 |
return r[0];
|
3223 |
}
|
3224 |
-
var Dt, Ro = new RegExp("^".concat(
|
3225 |
function H(e, t) {
|
3226 |
return { start: e, end: t };
|
3227 |
}
|
@@ -3523,11 +3523,11 @@ var Zo = (
|
|
3523 |
var l = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible();
|
3524 |
if (h.err)
|
3525 |
return h;
|
3526 |
-
var
|
3527 |
-
if (
|
3528 |
return this.error(S.EXPECT_ARGUMENT_STYLE, H(this.clonePosition(), this.clonePosition()));
|
3529 |
var _ = H(l, this.clonePosition());
|
3530 |
-
f = { style:
|
3531 |
}
|
3532 |
var b = this.tryParseArgumentClose(r);
|
3533 |
if (b.err)
|
@@ -3544,16 +3544,16 @@ var Zo = (
|
|
3544 |
} else {
|
3545 |
if (d.length === 0)
|
3546 |
return this.error(S.EXPECT_DATE_TIME_SKELETON, g);
|
3547 |
-
var
|
3548 |
-
this.locale && (
|
3549 |
-
var
|
3550 |
-
type:
|
3551 |
-
pattern:
|
3552 |
location: f.styleLocation,
|
3553 |
-
parsedOptions: this.shouldParseSkeletons ? Bo(
|
3554 |
}, y = o === "date" ? I.date : I.time;
|
3555 |
return {
|
3556 |
-
val: { type: y, value: i, location: g, style:
|
3557 |
err: null
|
3558 |
};
|
3559 |
}
|
@@ -3573,31 +3573,31 @@ var Zo = (
|
|
3573 |
case "select": {
|
3574 |
var p = this.clonePosition();
|
3575 |
if (this.bumpSpace(), !this.bumpIf(","))
|
3576 |
-
return this.error(S.EXPECT_SELECT_ARGUMENT_OPTIONS, H(p,
|
3577 |
this.bumpSpace();
|
3578 |
-
var
|
3579 |
-
if (o !== "select" &&
|
3580 |
if (!this.bumpIf(":"))
|
3581 |
return this.error(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, H(this.clonePosition(), this.clonePosition()));
|
3582 |
this.bumpSpace();
|
3583 |
var h = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, S.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
3584 |
if (h.err)
|
3585 |
return h;
|
3586 |
-
this.bumpSpace(),
|
3587 |
}
|
3588 |
-
var O = this.tryParsePluralOrSelectOptions(t, o, n,
|
3589 |
if (O.err)
|
3590 |
return O;
|
3591 |
var b = this.tryParseArgumentClose(r);
|
3592 |
if (b.err)
|
3593 |
return b;
|
3594 |
-
var
|
3595 |
return o === "select" ? {
|
3596 |
val: {
|
3597 |
type: I.select,
|
3598 |
value: i,
|
3599 |
options: zn(O.val),
|
3600 |
-
location:
|
3601 |
},
|
3602 |
err: null
|
3603 |
} : {
|
@@ -3607,7 +3607,7 @@ var Zo = (
|
|
3607 |
options: zn(O.val),
|
3608 |
offset: C,
|
3609 |
pluralType: o === "plural" ? "cardinal" : "ordinal",
|
3610 |
-
location:
|
3611 |
},
|
3612 |
err: null
|
3613 |
};
|
@@ -3655,13 +3655,13 @@ var Zo = (
|
|
3655 |
}, e.prototype.parseNumberSkeletonFromString = function(t, n) {
|
3656 |
var i = [];
|
3657 |
try {
|
3658 |
-
i =
|
3659 |
} catch {
|
3660 |
return this.error(S.INVALID_NUMBER_SKELETON, n);
|
3661 |
}
|
3662 |
return {
|
3663 |
val: {
|
3664 |
-
type:
|
3665 |
tokens: i,
|
3666 |
location: n,
|
3667 |
parsedOptions: this.shouldParseSkeletons ? Oo(i) : {}
|
@@ -3673,9 +3673,9 @@ var Zo = (
|
|
3673 |
if (f.length === 0) {
|
3674 |
var h = this.clonePosition();
|
3675 |
if (n !== "select" && this.bumpIf("=")) {
|
3676 |
-
var
|
3677 |
-
if (
|
3678 |
-
return
|
3679 |
l = H(h, this.clonePosition()), f = this.message.slice(h.offset, this.offset());
|
3680 |
} else
|
3681 |
break;
|
@@ -3803,7 +3803,7 @@ function nn(e) {
|
|
3803 |
});
|
3804 |
}
|
3805 |
function $o(e, t) {
|
3806 |
-
t === void 0 && (t = {}), t =
|
3807 |
var n = new Zo(e, t).parse();
|
3808 |
if (n.err) {
|
3809 |
var i = SyntaxError(S[n.err.kind]);
|
@@ -3861,10 +3861,10 @@ var sa = {
|
|
3861 |
}, Gt = {
|
3862 |
variadic: na,
|
3863 |
monadic: ia
|
3864 |
-
},
|
3865 |
(function(e) {
|
3866 |
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
3867 |
-
})(
|
3868 |
var xt = (
|
3869 |
/** @class */
|
3870 |
function(e) {
|
@@ -3882,7 +3882,7 @@ var xt = (
|
|
3882 |
function(e) {
|
3883 |
wt(t, e);
|
3884 |
function t(n, i, r, s) {
|
3885 |
-
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'),
|
3886 |
}
|
3887 |
return t;
|
3888 |
}(xt)
|
@@ -3891,7 +3891,7 @@ var xt = (
|
|
3891 |
function(e) {
|
3892 |
wt(t, e);
|
3893 |
function t(n, i, r) {
|
3894 |
-
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i),
|
3895 |
}
|
3896 |
return t;
|
3897 |
}(xt)
|
@@ -3900,18 +3900,18 @@ var xt = (
|
|
3900 |
function(e) {
|
3901 |
wt(t, e);
|
3902 |
function t(n, i) {
|
3903 |
-
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(i, '"'),
|
3904 |
}
|
3905 |
return t;
|
3906 |
}(xt)
|
3907 |
-
),
|
3908 |
(function(e) {
|
3909 |
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
3910 |
-
})(
|
3911 |
function la(e) {
|
3912 |
return e.length < 2 ? e : e.reduce(function(t, n) {
|
3913 |
var i = t[t.length - 1];
|
3914 |
-
return !i || i.type !==
|
3915 |
}, []);
|
3916 |
}
|
3917 |
function ua(e) {
|
@@ -3921,7 +3921,7 @@ function ht(e, t, n, i, r, s, u) {
|
|
3921 |
if (e.length === 1 && kn(e[0]))
|
3922 |
return [
|
3923 |
{
|
3924 |
-
type:
|
3925 |
value: e[0].value
|
3926 |
}
|
3927 |
];
|
@@ -3929,14 +3929,14 @@ function ht(e, t, n, i, r, s, u) {
|
|
3929 |
var l = f[a];
|
3930 |
if (kn(l)) {
|
3931 |
o.push({
|
3932 |
-
type:
|
3933 |
value: l.value
|
3934 |
});
|
3935 |
continue;
|
3936 |
}
|
3937 |
if (Ho(l)) {
|
3938 |
typeof s == "number" && o.push({
|
3939 |
-
type:
|
3940 |
value: n.getNumberFormat(t).format(s)
|
3941 |
});
|
3942 |
continue;
|
@@ -3944,35 +3944,35 @@ function ht(e, t, n, i, r, s, u) {
|
|
3944 |
var h = l.value;
|
3945 |
if (!(r && h in r))
|
3946 |
throw new aa(h, u);
|
3947 |
-
var
|
3948 |
if (So(l)) {
|
3949 |
-
(!
|
3950 |
-
type: typeof
|
3951 |
-
value:
|
3952 |
});
|
3953 |
continue;
|
3954 |
}
|
3955 |
if (wi(l)) {
|
3956 |
var _ = typeof l.style == "string" ? i.date[l.style] : Jt(l.style) ? l.style.parsedOptions : void 0;
|
3957 |
o.push({
|
3958 |
-
type:
|
3959 |
-
value: n.getDateTimeFormat(t, _).format(
|
3960 |
});
|
3961 |
continue;
|
3962 |
}
|
3963 |
if (xi(l)) {
|
3964 |
var _ = typeof l.style == "string" ? i.time[l.style] : Jt(l.style) ? l.style.parsedOptions : i.time.medium;
|
3965 |
o.push({
|
3966 |
-
type:
|
3967 |
-
value: n.getDateTimeFormat(t, _).format(
|
3968 |
});
|
3969 |
continue;
|
3970 |
}
|
3971 |
if (Ei(l)) {
|
3972 |
var _ = typeof l.style == "string" ? i.number[l.style] : Bi(l.style) ? l.style.parsedOptions : void 0;
|
3973 |
-
_ && _.scale && (
|
3974 |
-
type:
|
3975 |
-
value: n.getNumberFormat(t, _).format(
|
3976 |
});
|
3977 |
continue;
|
3978 |
}
|
@@ -3980,50 +3980,50 @@ function ht(e, t, n, i, r, s, u) {
|
|
3980 |
var b = l.children, g = l.value, d = r[g];
|
3981 |
if (!ua(d))
|
3982 |
throw new oa(g, "function", u);
|
3983 |
-
var
|
3984 |
return C.value;
|
3985 |
}));
|
3986 |
Array.isArray(y) || (y = [y]), o.push.apply(o, y.map(function(C) {
|
3987 |
return {
|
3988 |
-
type: typeof C == "string" ?
|
3989 |
value: C
|
3990 |
};
|
3991 |
}));
|
3992 |
}
|
3993 |
if (Si(l)) {
|
3994 |
-
var p = l.options[
|
3995 |
if (!p)
|
3996 |
-
throw new Xn(l.value,
|
3997 |
o.push.apply(o, ht(p.value, t, n, i, r));
|
3998 |
continue;
|
3999 |
}
|
4000 |
if (Hi(l)) {
|
4001 |
-
var p = l.options["=".concat(
|
4002 |
if (!p) {
|
4003 |
if (!Intl.PluralRules)
|
4004 |
throw new xt(`Intl.PluralRules is not available in this environment.
|
4005 |
Try polyfilling it using "@formatjs/intl-pluralrules"
|
4006 |
-
`,
|
4007 |
-
var
|
4008 |
-
p = l.options[
|
4009 |
}
|
4010 |
if (!p)
|
4011 |
-
throw new Xn(l.value,
|
4012 |
-
o.push.apply(o, ht(p.value, t, n, i, r,
|
4013 |
continue;
|
4014 |
}
|
4015 |
}
|
4016 |
return la(o);
|
4017 |
}
|
4018 |
function fa(e, t) {
|
4019 |
-
return t ?
|
4020 |
-
return n[i] =
|
4021 |
}, {})) : e;
|
4022 |
}
|
4023 |
function ha(e, t) {
|
4024 |
return t ? Object.keys(e).reduce(function(n, i) {
|
4025 |
return n[i] = fa(e[i], t[i]), n;
|
4026 |
-
},
|
4027 |
}
|
4028 |
function Ft(e) {
|
4029 |
return {
|
@@ -4085,7 +4085,7 @@ var ma = (
|
|
4085 |
if (o.length === 1)
|
4086 |
return o[0].value;
|
4087 |
var a = o.reduce(function(f, l) {
|
4088 |
-
return !f.length || l.type !==
|
4089 |
}, []);
|
4090 |
return a.length <= 1 ? a[0] || "" : a;
|
4091 |
}, this.formatToParts = function(u) {
|
@@ -4200,11 +4200,11 @@ function _a(e, t) {
|
|
4200 |
i = void 0;
|
4201 |
return i;
|
4202 |
}
|
4203 |
-
const
|
4204 |
if (t == null)
|
4205 |
return;
|
4206 |
-
if (t in
|
4207 |
-
return
|
4208 |
const n = St(t);
|
4209 |
for (let i = 0; i < n.length; i++) {
|
4210 |
const r = n[i], s = ga(r, e);
|
@@ -4237,9 +4237,9 @@ function pa(e) {
|
|
4237 |
}
|
4238 |
}
|
4239 |
function va(e, ...t) {
|
4240 |
-
delete
|
4241 |
}
|
4242 |
-
|
4243 |
[We],
|
4244 |
([e]) => Object.keys(e)
|
4245 |
);
|
@@ -4322,28 +4322,28 @@ const xa = {
|
|
4322 |
handleMissingMessage: void 0,
|
4323 |
ignoreTag: !0
|
4324 |
}, Ha = Sa;
|
4325 |
-
function
|
4326 |
return Ha;
|
4327 |
}
|
4328 |
const zt = yt(!1);
|
4329 |
-
var Aa = Object.defineProperty, Ba = Object.defineProperties,
|
4330 |
for (var n in t || (t = {}))
|
4331 |
-
|
4332 |
if (Vn)
|
4333 |
for (var n of Vn(t))
|
4334 |
Pa.call(t, n) && qn(e, n, t[n]);
|
4335 |
return e;
|
4336 |
-
}, Na = (e, t) => Ba(e,
|
4337 |
let sn;
|
4338 |
const gt = yt(null);
|
4339 |
function Wn(e) {
|
4340 |
return e.split("-").map((t, n, i) => i.slice(0, n + 1).join("-")).reverse();
|
4341 |
}
|
4342 |
-
function St(e, t =
|
4343 |
const n = Wn(e);
|
4344 |
return t ? [.../* @__PURE__ */ new Set([...n, ...Wn(t)])] : n;
|
4345 |
}
|
4346 |
-
function
|
4347 |
return sn ?? void 0;
|
4348 |
}
|
4349 |
gt.subscribe((e) => {
|
@@ -4351,9 +4351,9 @@ gt.subscribe((e) => {
|
|
4351 |
});
|
4352 |
const Oa = (e) => {
|
4353 |
if (e && pa(e) && rn(e)) {
|
4354 |
-
const { loadingDelay: t } =
|
4355 |
let n;
|
4356 |
-
return typeof window < "u" &&
|
4357 |
() => zt.set(!0),
|
4358 |
t
|
4359 |
) : zt.set(!0), Gi(e).then(() => {
|
@@ -4389,7 +4389,7 @@ var La = Object.defineProperty, pt = Object.getOwnPropertySymbols, Fi = Object.p
|
|
4389 |
return n;
|
4390 |
};
|
4391 |
const je = (e, t) => {
|
4392 |
-
const { formats: n } =
|
4393 |
if (e in n && t in n[e])
|
4394 |
return n[e][t];
|
4395 |
throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`);
|
@@ -4418,29 +4418,29 @@ const je = (e, t) => {
|
|
4418 |
}
|
4419 |
), Da = (e = {}) => {
|
4420 |
var t = e, {
|
4421 |
-
locale: n =
|
4422 |
} = t, i = Te(t, [
|
4423 |
"locale"
|
4424 |
]);
|
4425 |
return Ma(dn({ locale: n }, i));
|
4426 |
}, Ua = (e = {}) => {
|
4427 |
var t = e, {
|
4428 |
-
locale: n =
|
4429 |
} = t, i = Te(t, [
|
4430 |
"locale"
|
4431 |
]);
|
4432 |
return Ra(dn({ locale: n }, i));
|
4433 |
}, Ga = (e = {}) => {
|
4434 |
var t = e, {
|
4435 |
-
locale: n =
|
4436 |
} = t, i = Te(t, [
|
4437 |
"locale"
|
4438 |
]);
|
4439 |
return ka(dn({ locale: n }, i));
|
4440 |
}, Fa = Ht(
|
4441 |
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
4442 |
-
(e, t =
|
4443 |
-
ignoreTag:
|
4444 |
})
|
4445 |
), za = (e, t = {}) => {
|
4446 |
var n, i, r, s;
|
@@ -4448,7 +4448,7 @@ const je = (e, t) => {
|
|
4448 |
typeof e == "object" && (u = e, e = u.id);
|
4449 |
const {
|
4450 |
values: o,
|
4451 |
-
locale: a =
|
4452 |
default: f
|
4453 |
} = u;
|
4454 |
if (a == null)
|
@@ -4457,7 +4457,7 @@ const je = (e, t) => {
|
|
4457 |
);
|
4458 |
let l = ki(e, a);
|
4459 |
if (!l)
|
4460 |
-
l = (s = (r = (i = (n =
|
4461 |
else if (typeof l != "string")
|
4462 |
return console.warn(
|
4463 |
`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof l}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`
|
@@ -4467,19 +4467,19 @@ const je = (e, t) => {
|
|
4467 |
let h = l;
|
4468 |
try {
|
4469 |
h = Fa(l, a).format(o);
|
4470 |
-
} catch (
|
4471 |
-
|
4472 |
`[svelte-i18n] Message "${e}" has syntax error:`,
|
4473 |
-
|
4474 |
);
|
4475 |
}
|
4476 |
return h;
|
4477 |
-
}, ja = (e, t) => Ga(t).format(e), Xa = (e, t) => Ua(t).format(e), Va = (e, t) => Da(t).format(e), qa = (e, t =
|
4478 |
-
|
4479 |
-
|
4480 |
-
|
4481 |
-
|
4482 |
-
|
4483 |
const {
|
4484 |
SvelteComponent: Wa,
|
4485 |
add_render_callback: ji,
|
@@ -4501,7 +4501,7 @@ const {
|
|
4501 |
run_all: el,
|
4502 |
safe_not_equal: tl,
|
4503 |
set_data: nl,
|
4504 |
-
set_style:
|
4505 |
space: an,
|
4506 |
text: il,
|
4507 |
toggle_class: Q,
|
@@ -4524,13 +4524,13 @@ function ei(e) {
|
|
4524 |
t = vt("ul");
|
4525 |
for (let a = 0; a < o.length; a += 1)
|
4526 |
o[a].c();
|
4527 |
-
j(t, "class", "options svelte-yuohum"), j(t, "role", "listbox"),
|
4528 |
t,
|
4529 |
"bottom",
|
4530 |
/*bottom*/
|
4531 |
e[9]
|
4532 |
-
),
|
4533 |
-
e[10]}px - var(--window-padding))`),
|
4534 |
t,
|
4535 |
"width",
|
4536 |
/*input_width*/
|
@@ -4563,15 +4563,15 @@ function ei(e) {
|
|
4563 |
o.length = u.length;
|
4564 |
}
|
4565 |
f & /*bottom*/
|
4566 |
-
512 &&
|
4567 |
t,
|
4568 |
"bottom",
|
4569 |
/*bottom*/
|
4570 |
a[9]
|
4571 |
), f & /*max_height*/
|
4572 |
-
1024 &&
|
4573 |
a[10]}px - var(--window-padding))`), f & /*input_width*/
|
4574 |
-
256 &&
|
4575 |
t,
|
4576 |
"width",
|
4577 |
/*input_width*/
|
@@ -4766,13 +4766,13 @@ function et(e) {
|
|
4766 |
return n;
|
4767 |
}
|
4768 |
function ol(e, t, n) {
|
4769 |
-
let { choices: i } = t, { filtered_indices: r } = t, { show_options: s = !1 } = t, { disabled: u = !1 } = t, { selected_indices: o = [] } = t, { active_index: a = null } = t, f, l, h,
|
4770 |
function y() {
|
4771 |
-
const { top: x, bottom:
|
4772 |
-
n(14, f = x), n(15, l =
|
4773 |
}
|
4774 |
let p = null;
|
4775 |
-
function
|
4776 |
s && (p !== null && clearTimeout(p), p = setTimeout(
|
4777 |
() => {
|
4778 |
y(), p = null;
|
@@ -4782,15 +4782,15 @@ function ol(e, t, n) {
|
|
4782 |
}
|
4783 |
const C = rl();
|
4784 |
function O() {
|
4785 |
-
n(11,
|
4786 |
}
|
4787 |
-
function
|
4788 |
Zn[x ? "unshift" : "push"](() => {
|
4789 |
_ = x, n(6, _);
|
4790 |
});
|
4791 |
}
|
4792 |
const E = (x) => C("change", x);
|
4793 |
-
function
|
4794 |
Zn[x ? "unshift" : "push"](() => {
|
4795 |
b = x, n(7, b);
|
4796 |
});
|
@@ -4802,8 +4802,8 @@ function ol(e, t, n) {
|
|
4802 |
114900) {
|
4803 |
if (s && _) {
|
4804 |
if (b && o.length > 0) {
|
4805 |
-
let
|
4806 |
-
for (const W of Array.from(
|
4807 |
if (W.getAttribute("data-index") === o[0].toString()) {
|
4808 |
et([
|
4809 |
b,
|
@@ -4819,13 +4819,13 @@ function ol(e, t, n) {
|
|
4819 |
const x = et([
|
4820 |
_,
|
4821 |
"access",
|
4822 |
-
(
|
4823 |
"optionalAccess",
|
4824 |
-
(
|
4825 |
"call",
|
4826 |
-
(
|
4827 |
]);
|
4828 |
-
n(16, h = et([x, "optionalAccess", (
|
4829 |
}
|
4830 |
l > f ? (n(10, d = l), n(9, g = null)) : (n(9, g = `${l + h}px`), n(10, d = f - h));
|
4831 |
}
|
@@ -4838,19 +4838,19 @@ function ol(e, t, n) {
|
|
4838 |
a,
|
4839 |
_,
|
4840 |
b,
|
4841 |
-
|
4842 |
g,
|
4843 |
d,
|
4844 |
-
|
4845 |
-
|
4846 |
C,
|
4847 |
f,
|
4848 |
l,
|
4849 |
h,
|
4850 |
O,
|
4851 |
-
|
4852 |
E,
|
4853 |
-
|
4854 |
];
|
4855 |
}
|
4856 |
class al extends Wa {
|
@@ -4888,14 +4888,14 @@ function fl(e, t, n) {
|
|
4888 |
}
|
4889 |
const {
|
4890 |
SvelteComponent: hl,
|
4891 |
-
append:
|
4892 |
attr: z,
|
4893 |
binding_callbacks: cl,
|
4894 |
check_outros: ml,
|
4895 |
create_component: ln,
|
4896 |
destroy_component: un,
|
4897 |
detach: bn,
|
4898 |
-
element:
|
4899 |
group_outros: _l,
|
4900 |
init: dl,
|
4901 |
insert: gn,
|
@@ -4907,8 +4907,8 @@ const {
|
|
4907 |
set_input_value: ii,
|
4908 |
space: Xt,
|
4909 |
text: vl,
|
4910 |
-
toggle_class:
|
4911 |
-
transition_in:
|
4912 |
transition_out: Me
|
4913 |
} = window.__gradio__svelte__internal, { onMount: yl } = window.__gradio__svelte__internal, { createEventDispatcher: El, afterUpdate: wl } = window.__gradio__svelte__internal;
|
4914 |
function xl(e) {
|
@@ -4940,13 +4940,13 @@ function ri(e) {
|
|
4940 |
let t, n, i;
|
4941 |
return n = new Hr({}), {
|
4942 |
c() {
|
4943 |
-
t =
|
4944 |
},
|
4945 |
m(r, s) {
|
4946 |
gn(r, t, s), fn(n, t, null), i = !0;
|
4947 |
},
|
4948 |
i(r) {
|
4949 |
-
i || (
|
4950 |
},
|
4951 |
o(r) {
|
4952 |
Me(n.$$.fragment, r), i = !1;
|
@@ -4957,7 +4957,7 @@ function ri(e) {
|
|
4957 |
};
|
4958 |
}
|
4959 |
function Sl(e) {
|
4960 |
-
let t, n, i, r, s, u, o, a, f, l, h,
|
4961 |
n = new hi({
|
4962 |
props: {
|
4963 |
show_label: (
|
@@ -5010,7 +5010,7 @@ function Sl(e) {
|
|
5010 |
e[16]
|
5011 |
), {
|
5012 |
c() {
|
5013 |
-
t =
|
5014 |
o,
|
5015 |
"aria-expanded",
|
5016 |
/*show_options*/
|
@@ -5022,29 +5022,29 @@ function Sl(e) {
|
|
5022 |
e[0]
|
5023 |
), z(o, "class", "border-none svelte-1m1zvyj"), o.disabled = /*disabled*/
|
5024 |
e[3], z(o, "autocomplete", "off"), o.readOnly = a = !/*filterable*/
|
5025 |
-
e[7],
|
5026 |
e[13].includes(
|
5027 |
/*input_text*/
|
5028 |
e[9]
|
5029 |
) && !/*allow_custom_value*/
|
5030 |
-
e[6]), z(u, "class", "secondary-wrap svelte-1m1zvyj"), z(s, "class", "wrap-inner svelte-1m1zvyj"),
|
5031 |
s,
|
5032 |
"show_options",
|
5033 |
/*show_options*/
|
5034 |
e[12]
|
5035 |
-
), z(r, "class", "wrap svelte-1m1zvyj"), z(t, "class", "svelte-1m1zvyj"),
|
5036 |
t,
|
5037 |
"container",
|
5038 |
/*container*/
|
5039 |
e[5]
|
5040 |
);
|
5041 |
},
|
5042 |
-
m(d,
|
5043 |
-
gn(d, t,
|
5044 |
o,
|
5045 |
/*input_text*/
|
5046 |
e[9]
|
5047 |
-
), e[29](o),
|
5048 |
Oe(
|
5049 |
o,
|
5050 |
"input",
|
@@ -5077,38 +5077,38 @@ function Sl(e) {
|
|
5077 |
)
|
5078 |
], _ = !0);
|
5079 |
},
|
5080 |
-
p(d,
|
5081 |
const y = {};
|
5082 |
-
|
5083 |
16 && (y.show_label = /*show_label*/
|
5084 |
-
d[4]),
|
5085 |
2 && (y.info = /*info*/
|
5086 |
-
d[1]),
|
5087 |
-
1 |
|
5088 |
-
4 && (y.$$scope = { dirty:
|
5089 |
4096) && z(
|
5090 |
o,
|
5091 |
"aria-expanded",
|
5092 |
/*show_options*/
|
5093 |
d[12]
|
5094 |
-
), (!
|
5095 |
1) && z(
|
5096 |
o,
|
5097 |
"aria-label",
|
5098 |
/*label*/
|
5099 |
d[0]
|
5100 |
-
), (!
|
5101 |
8) && (o.disabled = /*disabled*/
|
5102 |
-
d[3]), (!
|
5103 |
128 && a !== (a = !/*filterable*/
|
5104 |
-
d[7])) && (o.readOnly = a),
|
5105 |
512 && o.value !== /*input_text*/
|
5106 |
d[9] && ii(
|
5107 |
o,
|
5108 |
/*input_text*/
|
5109 |
d[9]
|
5110 |
-
), (!
|
5111 |
-
8768) &&
|
5112 |
d[13].includes(
|
5113 |
/*input_text*/
|
5114 |
d[9]
|
@@ -5116,32 +5116,32 @@ function Sl(e) {
|
|
5116 |
d[6]), /*disabled*/
|
5117 |
d[3] ? g && (_l(), Me(g, 1, 1, () => {
|
5118 |
g = null;
|
5119 |
-
}), ml()) : g ?
|
5120 |
-
8 &&
|
5121 |
-
4096) &&
|
5122 |
s,
|
5123 |
"show_options",
|
5124 |
/*show_options*/
|
5125 |
d[12]
|
5126 |
);
|
5127 |
const p = {};
|
5128 |
-
|
5129 |
4096 && (p.show_options = /*show_options*/
|
5130 |
-
d[12]),
|
5131 |
4 && (p.choices = /*choices*/
|
5132 |
-
d[2]),
|
5133 |
1024 && (p.filtered_indices = /*filtered_indices*/
|
5134 |
-
d[10]),
|
5135 |
8 && (p.disabled = /*disabled*/
|
5136 |
-
d[3]),
|
5137 |
2048 && (p.selected_indices = /*selected_index*/
|
5138 |
d[11] === null ? [] : [
|
5139 |
/*selected_index*/
|
5140 |
d[11]
|
5141 |
-
]),
|
5142 |
16384 && (p.active_index = /*active_index*/
|
5143 |
-
d[14]), h.$set(p), (!
|
5144 |
-
32) &&
|
5145 |
t,
|
5146 |
"container",
|
5147 |
/*container*/
|
@@ -5149,10 +5149,10 @@ function Sl(e) {
|
|
5149 |
);
|
5150 |
},
|
5151 |
i(d) {
|
5152 |
-
|
5153 |
},
|
5154 |
o(d) {
|
5155 |
-
Me(n.$$.fragment, d), Me(g), Me(h.$$.fragment, d),
|
5156 |
},
|
5157 |
d(d) {
|
5158 |
d && bn(t), un(n), e[29](null), g && g.d(), un(h), _ = !1, bl(b);
|
@@ -5160,65 +5160,65 @@ function Sl(e) {
|
|
5160 |
};
|
5161 |
}
|
5162 |
function Hl(e, t, n) {
|
5163 |
-
let { label: i } = t, { info: r = void 0 } = t, { value: s = [] } = t, u = [], { value_is_output: o = !1 } = t, { choices: a } = t, f, { disabled: l = !1 } = t, { show_label: h } = t, { container:
|
5164 |
const x = El();
|
5165 |
-
s ? (
|
5166 |
-
function
|
5167 |
-
n(13,
|
5168 |
}
|
5169 |
function W() {
|
5170 |
-
|
5171 |
}
|
5172 |
function ee(w) {
|
5173 |
if (n(11, E = parseInt(w.detail.target.dataset.index)), isNaN(E)) {
|
5174 |
n(11, E = null);
|
5175 |
return;
|
5176 |
}
|
5177 |
-
n(12, d = !1), n(14,
|
5178 |
}
|
5179 |
function At(w) {
|
5180 |
n(10, O = a.map((yn, Ze) => Ze)), n(12, d = !0), x("focus");
|
5181 |
}
|
5182 |
-
function
|
5183 |
-
_ ? n(20, s = p) : n(9, p =
|
5184 |
}
|
5185 |
function Bt(w) {
|
5186 |
-
n(12, [d,
|
5187 |
}
|
5188 |
wl(() => {
|
5189 |
n(21, o = !1), n(26, C = !0);
|
5190 |
}), yl(() => {
|
5191 |
g.focus();
|
5192 |
});
|
5193 |
-
function
|
5194 |
-
p = this.value, n(9, p), n(11, E), n(27,
|
5195 |
}
|
5196 |
-
function
|
5197 |
cl[w ? "unshift" : "push"](() => {
|
5198 |
g = w, n(8, g);
|
5199 |
});
|
5200 |
}
|
5201 |
-
const
|
5202 |
return e.$$set = (w) => {
|
5203 |
-
"label" in w && n(0, i = w.label), "info" in w && n(1, r = w.info), "value" in w && n(20, s = w.value), "value_is_output" in w && n(21, o = w.value_is_output), "choices" in w && n(2, a = w.choices), "disabled" in w && n(3, l = w.disabled), "show_label" in w && n(4, h = w.show_label), "container" in w && n(5,
|
5204 |
}, e.$$.update = () => {
|
5205 |
e.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/
|
5206 |
-
218105860 && E !==
|
5207 |
index: E,
|
5208 |
value: y[E],
|
5209 |
selected: !0
|
5210 |
})), e.$$.dirty[0] & /*value, old_value, value_is_output*/
|
5211 |
7340032 && s != u && (W(), ul(x, s, o), n(22, u = s)), e.$$.dirty[0] & /*choices*/
|
5212 |
-
4 &&
|
5213 |
-
8390468 && a !== f && (_ || W(), n(23, f = a), n(10, O = ni(a, p)), !_ && O.length > 0 && n(14,
|
5214 |
-
33556036 && p !==
|
5215 |
}, [
|
5216 |
i,
|
5217 |
r,
|
5218 |
a,
|
5219 |
l,
|
5220 |
h,
|
5221 |
-
|
5222 |
_,
|
5223 |
b,
|
5224 |
g,
|
@@ -5226,24 +5226,24 @@ function Hl(e, t, n) {
|
|
5226 |
O,
|
5227 |
E,
|
5228 |
d,
|
5229 |
-
|
5230 |
-
|
5231 |
x,
|
5232 |
ee,
|
5233 |
At,
|
5234 |
-
|
5235 |
Bt,
|
5236 |
s,
|
5237 |
o,
|
5238 |
u,
|
5239 |
f,
|
5240 |
y,
|
5241 |
-
|
5242 |
C,
|
5243 |
-
|
5244 |
-
|
5245 |
-
|
5246 |
-
|
5247 |
];
|
5248 |
}
|
5249 |
class Al extends hl {
|
@@ -5278,11 +5278,11 @@ const {
|
|
5278 |
create_component: nt,
|
5279 |
destroy_component: it,
|
5280 |
detach: pn,
|
5281 |
-
element:
|
5282 |
-
init:
|
5283 |
insert: vn,
|
5284 |
mount_component: rt,
|
5285 |
-
safe_not_equal:
|
5286 |
set_style: st,
|
5287 |
space: Vt,
|
5288 |
text: Xi,
|
@@ -5318,7 +5318,7 @@ function Ll(e) {
|
|
5318 |
};
|
5319 |
}
|
5320 |
function Ml(e) {
|
5321 |
-
let t, n, i, r, s, u, o, a, f, l, h,
|
5322 |
return s = new Al({
|
5323 |
props: {
|
5324 |
value: (
|
@@ -5375,28 +5375,28 @@ function Ml(e) {
|
|
5375 |
e[11]
|
5376 |
), {
|
5377 |
c() {
|
5378 |
-
t =
|
5379 |
},
|
5380 |
-
m(d,
|
5381 |
-
vn(d, t,
|
5382 |
},
|
5383 |
-
p(d, [
|
5384 |
const y = {};
|
5385 |
-
|
5386 |
1 && (y.value = /*currentLabel*/
|
5387 |
-
d[0]),
|
5388 |
4 && (y.choices = /*choices*/
|
5389 |
d[2]), s.$set(y);
|
5390 |
const p = {};
|
5391 |
-
|
5392 |
2 && (p.value = /*currentColor*/
|
5393 |
d[1]), a.$set(p);
|
5394 |
-
const
|
5395 |
-
|
5396 |
-
16384 && (
|
5397 |
const C = {};
|
5398 |
-
|
5399 |
-
16384 && (C.$$scope = { dirty:
|
5400 |
},
|
5401 |
i(d) {
|
5402 |
g || (ot(s.$$.fragment, d), ot(a.$$.fragment, d), ot(h.$$.fragment, d), ot(b.$$.fragment, d), g = !0);
|
@@ -5412,27 +5412,27 @@ function Ml(e) {
|
|
5412 |
function Rl(e, t, n) {
|
5413 |
let { label: i = "" } = t, { currentLabel: r = "" } = t, { choices: s = [] } = t, { choicesColors: u = [] } = t, { color: o = "" } = t, { currentColor: a = "" } = t;
|
5414 |
const f = Pl();
|
5415 |
-
function l(
|
5416 |
f("change", {
|
5417 |
label: r,
|
5418 |
color: a,
|
5419 |
-
ok:
|
5420 |
});
|
5421 |
}
|
5422 |
-
function h(
|
5423 |
-
const { detail: y } =
|
5424 |
let p = y;
|
5425 |
Number.isInteger(p) ? (Array.isArray(u) && p < u.length && n(1, a = u[p]), Array.isArray(s) && p < s.length && n(0, r = s[p][0])) : n(0, r = p);
|
5426 |
}
|
5427 |
-
function m
|
5428 |
-
const { detail: y } =
|
5429 |
n(1, a = y);
|
5430 |
}
|
5431 |
-
function _(
|
5432 |
-
h(
|
5433 |
}
|
5434 |
-
function b(
|
5435 |
-
switch (
|
5436 |
case "Enter":
|
5437 |
l(!0);
|
5438 |
break;
|
@@ -5444,15 +5444,15 @@ function Rl(e, t, n) {
|
|
5444 |
document.removeEventListener("keydown", b);
|
5445 |
});
|
5446 |
const g = () => l(!1), d = () => l(!0);
|
5447 |
-
return e.$$set = (
|
5448 |
-
"label" in
|
5449 |
}, [
|
5450 |
r,
|
5451 |
a,
|
5452 |
s,
|
5453 |
l,
|
5454 |
h,
|
5455 |
-
|
5456 |
_,
|
5457 |
i,
|
5458 |
u,
|
@@ -5463,7 +5463,7 @@ function Rl(e, t, n) {
|
|
5463 |
}
|
5464 |
class Vi extends Bl {
|
5465 |
constructor(t) {
|
5466 |
-
super(),
|
5467 |
label: 7,
|
5468 |
currentLabel: 0,
|
5469 |
choices: 2,
|
@@ -5484,27 +5484,27 @@ function qt(e, t) {
|
|
5484 |
return `rgba(${i}, ${r}, ${s}, ${t})`;
|
5485 |
}
|
5486 |
class Wt {
|
5487 |
-
constructor(t, n, i, r, s, u, o, a, f, l, h = "rgb(255, 255, 255)",
|
5488 |
this.stopDrag = () => {
|
5489 |
this.isDragging = !1, document.removeEventListener("mousemove", this.handleDrag), document.removeEventListener("mouseup", this.stopDrag);
|
5490 |
}, this.handleDrag = (g) => {
|
5491 |
if (this.isDragging) {
|
5492 |
-
let d = g.clientX - this.offsetMouseX - this.xmin,
|
5493 |
const y = this.canvasXmax - this.canvasXmin, p = this.canvasYmax - this.canvasYmin;
|
5494 |
-
d = J(d, -this.xmin, y - this.xmax),
|
5495 |
}
|
5496 |
}, this.handleResize = (g) => {
|
5497 |
if (this.isResizing) {
|
5498 |
-
const d = g.clientX,
|
5499 |
switch (this.resizingHandleIndex) {
|
5500 |
case 0:
|
5501 |
this.xmin += y, this.ymin += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymin = J(this.ymin, 0, this.ymax - this.minSize);
|
5502 |
break;
|
5503 |
case 1:
|
5504 |
-
this.xmax += y, this.ymin += p, this.xmax = J(this.xmax, this.xmin + this.minSize,
|
5505 |
break;
|
5506 |
case 2:
|
5507 |
-
this.xmax += y, this.ymax += p, this.xmax = J(this.xmax, this.xmin + this.minSize,
|
5508 |
break;
|
5509 |
case 3:
|
5510 |
this.xmin += y, this.ymax += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymax = J(this.ymax, this.ymin + this.minSize, C);
|
@@ -5514,7 +5514,7 @@ class Wt {
|
|
5514 |
}
|
5515 |
}, this.stopResize = () => {
|
5516 |
this.isResizing = !1, document.removeEventListener("mousemove", this.handleResize), document.removeEventListener("mouseup", this.stopResize);
|
5517 |
-
}, this.renderCallBack = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = r, this.canvasYmax = s, this.scaleFactor = b, this.label = u, this.isDragging = !1,
|
5518 |
}
|
5519 |
toJSON() {
|
5520 |
return {
|
@@ -5628,20 +5628,20 @@ const K = [
|
|
5628 |
];
|
5629 |
const {
|
5630 |
SvelteComponent: kl,
|
5631 |
-
append:
|
5632 |
-
attr:
|
5633 |
binding_callbacks: Dl,
|
5634 |
bubble: si,
|
5635 |
check_outros: Yt,
|
5636 |
create_component: De,
|
5637 |
destroy_component: Ue,
|
5638 |
-
detach:
|
5639 |
-
element:
|
5640 |
empty: Ul,
|
5641 |
group_outros: Zt,
|
5642 |
init: Gl,
|
5643 |
-
insert:
|
5644 |
-
listen:
|
5645 |
mount_component: Ge,
|
5646 |
noop: Fl,
|
5647 |
run_all: qi,
|
@@ -5651,26 +5651,26 @@ const {
|
|
5651 |
transition_out: q
|
5652 |
} = window.__gradio__svelte__internal, { onMount: jl, onDestroy: Xl, createEventDispatcher: Vl } = window.__gradio__svelte__internal;
|
5653 |
function oi(e) {
|
5654 |
-
let t, n, i, r, s, u, o, a, f, l, h,
|
5655 |
return i = new Gr({}), u = new Or({}), f = new gr({}), {
|
5656 |
c() {
|
5657 |
-
t =
|
5658 |
},
|
5659 |
m(_, b) {
|
5660 |
-
|
5661 |
-
|
5662 |
n,
|
5663 |
"click",
|
5664 |
/*click_handler*/
|
5665 |
e[22]
|
5666 |
),
|
5667 |
-
|
5668 |
s,
|
5669 |
"click",
|
5670 |
/*click_handler_1*/
|
5671 |
e[23]
|
5672 |
),
|
5673 |
-
|
5674 |
a,
|
5675 |
"click",
|
5676 |
/*click_handler_2*/
|
@@ -5686,7 +5686,7 @@ function oi(e) {
|
|
5686 |
q(i.$$.fragment, _), q(u.$$.fragment, _), q(f.$$.fragment, _), l = !1;
|
5687 |
},
|
5688 |
d(_) {
|
5689 |
-
_ &&
|
5690 |
}
|
5691 |
};
|
5692 |
}
|
@@ -5857,41 +5857,41 @@ function ql(e) {
|
|
5857 |
), h = (
|
5858 |
/*editModalVisible*/
|
5859 |
e[6] && ai(e)
|
5860 |
-
),
|
5861 |
/*newModalVisible*/
|
5862 |
e[7] && li(e)
|
5863 |
);
|
5864 |
return {
|
5865 |
c() {
|
5866 |
-
t =
|
5867 |
},
|
5868 |
m(_, b) {
|
5869 |
-
|
5870 |
-
|
5871 |
n,
|
5872 |
"mousedown",
|
5873 |
/*handleMouseDown*/
|
5874 |
e[8]
|
5875 |
),
|
5876 |
-
|
5877 |
n,
|
5878 |
"mouseup",
|
5879 |
/*handleMouseUp*/
|
5880 |
e[9]
|
5881 |
),
|
5882 |
-
|
5883 |
n,
|
5884 |
"dblclick",
|
5885 |
/*handleDoubleClick*/
|
5886 |
e[13]
|
5887 |
),
|
5888 |
-
|
5889 |
t,
|
5890 |
"focusin",
|
5891 |
/*handleCanvasFocus*/
|
5892 |
e[16]
|
5893 |
),
|
5894 |
-
|
5895 |
t,
|
5896 |
"focusout",
|
5897 |
/*handleCanvasBlur*/
|
@@ -5909,19 +5909,19 @@ function ql(e) {
|
|
5909 |
64 && G(h, 1)) : (h = ai(_), h.c(), G(h, 1), h.m(s.parentNode, s)) : h && (Zt(), q(h, 1, 1, () => {
|
5910 |
h = null;
|
5911 |
}), Yt()), /*newModalVisible*/
|
5912 |
-
_[7] ?
|
5913 |
-
128 && G(
|
5914 |
-
|
5915 |
}), Yt());
|
5916 |
},
|
5917 |
i(_) {
|
5918 |
-
o || (G(l), G(h), G(
|
5919 |
},
|
5920 |
o(_) {
|
5921 |
-
q(l), q(h), q(
|
5922 |
},
|
5923 |
d(_) {
|
5924 |
-
_ && (
|
5925 |
}
|
5926 |
};
|
5927 |
}
|
@@ -5934,46 +5934,46 @@ function Xe(e) {
|
|
5934 |
return "#" + (1 << 24 | n << 16 | i << 8 | r).toString(16).slice(1);
|
5935 |
}
|
5936 |
function Wl(e, t, n) {
|
5937 |
-
let { imageUrl: i = null } = t, { interactive: r } = t, { boxAlpha: s = 0.5 } = t, { boxMinSize: u = 25 } = t, { value: o } = t, { choices: a = [] } = t, { choicesColors: f = [] } = t, l, h,
|
5938 |
-
const
|
5939 |
function E() {
|
5940 |
if (h) {
|
5941 |
-
h.clearRect(0, 0, l.width, l.height),
|
5942 |
for (const v of o.boxes.slice().reverse())
|
5943 |
v.render(h);
|
5944 |
}
|
5945 |
}
|
5946 |
-
function
|
5947 |
-
n(5, _ = v), o.boxes.forEach((
|
5948 |
-
|
5949 |
}), v >= 0 && v < o.boxes.length && o.boxes[v].setSelected(!0), E();
|
5950 |
}
|
5951 |
function x(v) {
|
5952 |
if (!r)
|
5953 |
return;
|
5954 |
-
const
|
5955 |
-
for (const [
|
5956 |
-
const Qe = Y.indexOfPointInsideHandle(R,
|
5957 |
if (Qe >= 0) {
|
5958 |
-
|
5959 |
return;
|
5960 |
}
|
5961 |
}
|
5962 |
-
for (const [
|
5963 |
-
if (Y.isPointInsideBox(R,
|
5964 |
-
|
5965 |
return;
|
5966 |
}
|
5967 |
-
|
5968 |
}
|
5969 |
-
function
|
5970 |
-
|
5971 |
}
|
5972 |
function W(v) {
|
5973 |
if (r)
|
5974 |
switch (v.key) {
|
5975 |
case "Delete":
|
5976 |
-
|
5977 |
break;
|
5978 |
}
|
5979 |
}
|
@@ -5982,75 +5982,72 @@ function Wl(e, t, n) {
|
|
5982 |
}
|
5983 |
function At(v) {
|
5984 |
n(7, O = !1);
|
5985 |
-
const { detail:
|
5986 |
-
let R =
|
5987 |
-
if (
|
5988 |
-
|
5989 |
-
let Y =
|
5990 |
-
n(0, o.boxes = [ir, ...o.boxes], o), E(),
|
5991 |
}
|
5992 |
}
|
5993 |
-
function
|
5994 |
_ >= 0 && _ < o.boxes.length && n(6, C = !0);
|
5995 |
}
|
5996 |
function Bt(v) {
|
5997 |
-
r &&
|
5998 |
}
|
5999 |
-
function
|
6000 |
n(6, C = !1);
|
6001 |
-
const { detail:
|
6002 |
-
let R =
|
6003 |
-
if (
|
6004 |
let Y = o.boxes[_];
|
6005 |
-
Y.label = R, Y.color = ui(
|
6006 |
}
|
6007 |
}
|
6008 |
-
function
|
6009 |
-
_ >= 0 && _ < o.boxes.length && (o.boxes.splice(_, 1),
|
6010 |
}
|
6011 |
-
function
|
6012 |
if (l) {
|
6013 |
-
if (y = 1, n(4, l.width = l.clientWidth, l),
|
6014 |
-
if (
|
6015 |
-
y = l.width /
|
6016 |
else {
|
6017 |
-
p =
|
6018 |
var v = (l.width - p) / 2;
|
6019 |
-
b = v, g = 0, d = v + p,
|
6020 |
}
|
6021 |
else
|
6022 |
-
b = 0, g = 0, d = l.width,
|
6023 |
-
if (d > 0 &&
|
6024 |
-
for (const
|
6025 |
-
|
6026 |
-
E(),
|
6027 |
}
|
6028 |
}
|
6029 |
-
const w = new ResizeObserver(
|
6030 |
function yn() {
|
6031 |
-
let v =
|
6032 |
-
|
6033 |
-
|
6034 |
-
|
6035 |
-
|
6036 |
-
R.hasOwnProperty("color") ? (L = R.color, Array.isArray(L) && L.length === 3 && (L = `rgb(${L[0]}, ${L[1]}, ${L[2]})`)) : L = K[v.length % K.length], R.hasOwnProperty("label") && (te = R.label), R = new Wt(E, b, g, d, c, te, R.xmin, R.ymin, R.xmax, R.ymax, L, s, u, y);
|
6037 |
}
|
6038 |
-
v.push(R);
|
6039 |
}
|
6040 |
-
n(0, o.boxes = v, o);
|
6041 |
}
|
6042 |
function Ze() {
|
6043 |
-
i !== null && (
|
6044 |
-
|
6045 |
});
|
6046 |
}
|
6047 |
jl(() => {
|
6048 |
if (Array.isArray(a) && a.length > 0 && (!Array.isArray(f) || f.length == 0))
|
6049 |
for (let v = 0; v < a.length; v++) {
|
6050 |
-
let
|
6051 |
-
f.push(Xe(
|
6052 |
}
|
6053 |
-
h = l.getContext("2d"), w.observe(l), Ze(),
|
6054 |
});
|
6055 |
function Wi() {
|
6056 |
document.addEventListener("keydown", W);
|
@@ -6066,7 +6063,7 @@ function Wl(e, t, n) {
|
|
6066 |
l = v, n(4, l);
|
6067 |
});
|
6068 |
}
|
6069 |
-
const Qi = () => ee(), Ji = () =>
|
6070 |
function $i(v) {
|
6071 |
si.call(this, e, v);
|
6072 |
}
|
@@ -6077,7 +6074,7 @@ function Wl(e, t, n) {
|
|
6077 |
"imageUrl" in v && n(18, i = v.imageUrl), "interactive" in v && n(1, r = v.interactive), "boxAlpha" in v && n(19, s = v.boxAlpha), "boxMinSize" in v && n(20, u = v.boxMinSize), "value" in v && n(0, o = v.value), "choices" in v && n(2, a = v.choices), "choicesColors" in v && n(3, f = v.choicesColors);
|
6078 |
}, e.$$.update = () => {
|
6079 |
e.$$.dirty[0] & /*value*/
|
6080 |
-
1 && (Ze(), yn(),
|
6081 |
}, [
|
6082 |
o,
|
6083 |
r,
|
@@ -6088,13 +6085,13 @@ function Wl(e, t, n) {
|
|
6088 |
C,
|
6089 |
O,
|
6090 |
x,
|
6091 |
-
|
6092 |
ee,
|
6093 |
At,
|
6094 |
-
|
6095 |
Bt,
|
6096 |
-
|
6097 |
-
|
6098 |
Wi,
|
6099 |
Yi,
|
6100 |
i,
|
@@ -6220,11 +6217,11 @@ function au(e) {
|
|
6220 |
}
|
6221 |
function lu(e, t, n) {
|
6222 |
let { src: i = void 0 } = t, { interactive: r } = t, { boxesAlpha: s } = t, { labelList: u } = t, { labelColors: o } = t, { boxMinSize: a } = t, { value: f } = t, l, h;
|
6223 |
-
const
|
6224 |
function _(g) {
|
6225 |
f = g, n(0, f);
|
6226 |
}
|
6227 |
-
const b = () =>
|
6228 |
return e.$$set = (g) => {
|
6229 |
"src" in g && n(8, i = g.src), "interactive" in g && n(1, r = g.interactive), "boxesAlpha" in g && n(2, s = g.boxesAlpha), "labelList" in g && n(3, u = g.labelList), "labelColors" in g && n(4, o = g.labelColors), "boxMinSize" in g && n(5, a = g.boxMinSize), "value" in g && n(0, f = g.value);
|
6230 |
}, e.$$.update = () => {
|
@@ -6244,7 +6241,7 @@ function lu(e, t, n) {
|
|
6244 |
o,
|
6245 |
a,
|
6246 |
l,
|
6247 |
-
|
6248 |
i,
|
6249 |
h,
|
6250 |
_,
|
@@ -6277,7 +6274,7 @@ const {
|
|
6277 |
insert: vu,
|
6278 |
mount_component: yu,
|
6279 |
safe_not_equal: Eu,
|
6280 |
-
toggle_class:
|
6281 |
transition_in: mt,
|
6282 |
transition_out: hn
|
6283 |
} = window.__gradio__svelte__internal;
|
@@ -6324,22 +6321,22 @@ function wu(e) {
|
|
6324 |
);
|
6325 |
return {
|
6326 |
c() {
|
6327 |
-
t = bu("div"), i && i.c(), hu(t, "class", "container svelte-1sgcyba"),
|
6328 |
t,
|
6329 |
"table",
|
6330 |
/*type*/
|
6331 |
e[2] === "table"
|
6332 |
-
),
|
6333 |
t,
|
6334 |
"gallery",
|
6335 |
/*type*/
|
6336 |
e[2] === "gallery"
|
6337 |
-
),
|
6338 |
t,
|
6339 |
"selected",
|
6340 |
/*selected*/
|
6341 |
e[3]
|
6342 |
-
),
|
6343 |
t,
|
6344 |
"border",
|
6345 |
/*value*/
|
@@ -6355,25 +6352,25 @@ function wu(e) {
|
|
6355 |
1 && mt(i, 1)) : (i = fi(r), i.c(), mt(i, 1), i.m(t, null)) : i && (gu(), hn(i, 1, 1, () => {
|
6356 |
i = null;
|
6357 |
}), cu()), (!n || s & /*type*/
|
6358 |
-
4) &&
|
6359 |
t,
|
6360 |
"table",
|
6361 |
/*type*/
|
6362 |
r[2] === "table"
|
6363 |
), (!n || s & /*type*/
|
6364 |
-
4) &&
|
6365 |
t,
|
6366 |
"gallery",
|
6367 |
/*type*/
|
6368 |
r[2] === "gallery"
|
6369 |
), (!n || s & /*selected*/
|
6370 |
-
8) &&
|
6371 |
t,
|
6372 |
"selected",
|
6373 |
/*selected*/
|
6374 |
r[3]
|
6375 |
), (!n || s & /*value*/
|
6376 |
-
1) &&
|
6377 |
t,
|
6378 |
"border",
|
6379 |
/*value*/
|
|
|
41 |
}
|
42 |
const {
|
43 |
SvelteComponent: hr,
|
44 |
+
append: Ct,
|
45 |
attr: X,
|
46 |
detach: cr,
|
47 |
init: mr,
|
|
|
58 |
t = Je("svg"), n = Je("g"), i = Je("path"), r = Je("path"), X(i, "d", "M18,6L6.087,17.913"), Z(i, "fill", "none"), Z(i, "fill-rule", "nonzero"), Z(i, "stroke-width", "2px"), X(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), X(r, "d", "M4.364,4.364L19.636,19.636"), Z(r, "fill", "none"), Z(r, "fill-rule", "nonzero"), Z(r, "stroke-width", "2px"), X(t, "width", "100%"), X(t, "height", "100%"), X(t, "viewBox", "0 0 24 24"), X(t, "version", "1.1"), X(t, "xmlns", "http://www.w3.org/2000/svg"), X(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), X(t, "xml:space", "preserve"), X(t, "stroke", "currentColor"), Z(t, "fill-rule", "evenodd"), Z(t, "clip-rule", "evenodd"), Z(t, "stroke-linecap", "round"), Z(t, "stroke-linejoin", "round");
|
59 |
},
|
60 |
m(s, u) {
|
61 |
+
_r(s, t, u), Ct(t, n), Ct(n, i), Ct(t, r);
|
62 |
},
|
63 |
p: Pt,
|
64 |
i: Pt,
|
|
|
76 |
const {
|
77 |
SvelteComponent: pr,
|
78 |
append: vr,
|
79 |
+
attr: fe,
|
80 |
detach: yr,
|
81 |
init: Er,
|
82 |
insert: wr,
|
|
|
88 |
let t, n;
|
89 |
return {
|
90 |
c() {
|
91 |
+
t = En("svg"), n = En("path"), fe(n, "d", "M5 8l4 4 4-4z"), fe(t, "class", "dropdown-arrow svelte-145leq6"), fe(t, "xmlns", "http://www.w3.org/2000/svg"), fe(t, "width", "100%"), fe(t, "height", "100%"), fe(t, "viewBox", "0 0 18 18");
|
92 |
},
|
93 |
m(i, r) {
|
94 |
wr(i, t, r), vr(t, n);
|
|
|
110 |
SvelteComponent: Ar,
|
111 |
append: Br,
|
112 |
attr: V,
|
113 |
+
detach: Tr,
|
114 |
+
init: Cr,
|
115 |
insert: Pr,
|
116 |
noop: Nt,
|
117 |
safe_not_equal: Ir,
|
|
|
130 |
i: Nt,
|
131 |
o: Nt,
|
132 |
d(i) {
|
133 |
+
i && Tr(t);
|
134 |
}
|
135 |
};
|
136 |
}
|
137 |
class Or extends Ar {
|
138 |
constructor(t) {
|
139 |
+
super(), Cr(this, t, null, Nr, Ir, {});
|
140 |
}
|
141 |
}
|
142 |
const {
|
143 |
SvelteComponent: Lr,
|
144 |
append: xn,
|
145 |
+
attr: k,
|
146 |
detach: Mr,
|
147 |
init: Rr,
|
148 |
insert: kr,
|
149 |
noop: Ot,
|
150 |
safe_not_equal: Dr,
|
151 |
+
set_style: te,
|
152 |
svg_element: Lt
|
153 |
} = window.__gradio__svelte__internal;
|
154 |
function Ur(e) {
|
155 |
let t, n, i;
|
156 |
return {
|
157 |
c() {
|
158 |
+
t = Lt("svg"), n = Lt("line"), i = Lt("line"), k(n, "x1", "4"), k(n, "y1", "12"), k(n, "x2", "20"), k(n, "y2", "12"), te(n, "fill", "none"), te(n, "stroke-width", "2px"), k(i, "x1", "12"), k(i, "y1", "4"), k(i, "x2", "12"), k(i, "y2", "20"), te(i, "fill", "none"), te(i, "stroke-width", "2px"), k(t, "width", "100%"), k(t, "height", "100%"), k(t, "viewBox", "0 0 24 24"), k(t, "version", "1.1"), k(t, "xmlns", "http://www.w3.org/2000/svg"), k(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), k(t, "xml:space", "preserve"), k(t, "stroke", "currentColor"), te(t, "fill-rule", "evenodd"), te(t, "clip-rule", "evenodd"), te(t, "stroke-linecap", "round"), te(t, "stroke-linejoin", "round");
|
159 |
},
|
160 |
m(r, s) {
|
161 |
kr(r, t, s), xn(t, n), xn(t, i);
|
|
|
270 |
set_data: bs,
|
271 |
space: gs,
|
272 |
text: ps,
|
273 |
+
toggle_class: he,
|
274 |
transition_in: Le,
|
275 |
transition_out: ft,
|
276 |
update_slot_base: vs
|
|
|
348 |
);
|
349 |
return {
|
350 |
c() {
|
351 |
+
t = ls("span"), u && u.c(), n = gs(), o && o.c(), i = us(), Sn(t, "data-testid", "block-info"), Sn(t, "class", "svelte-22c38v"), he(t, "sr-only", !/*show_label*/
|
352 |
+
e[0]), he(t, "hide", !/*show_label*/
|
353 |
+
e[0]), he(
|
354 |
t,
|
355 |
"has-info",
|
356 |
/*info*/
|
|
|
380 |
),
|
381 |
null
|
382 |
), (!r || f & /*show_label*/
|
383 |
+
1) && he(t, "sr-only", !/*show_label*/
|
384 |
a[0]), (!r || f & /*show_label*/
|
385 |
+
1) && he(t, "hide", !/*show_label*/
|
386 |
a[0]), (!r || f & /*info*/
|
387 |
+
2) && he(
|
388 |
t,
|
389 |
"has-info",
|
390 |
/*info*/
|
|
|
735 |
SvelteComponent: Ss,
|
736 |
append: Bn,
|
737 |
attr: Mt,
|
738 |
+
bubble: Tn,
|
739 |
create_component: Hs,
|
740 |
destroy_component: As,
|
741 |
detach: ci,
|
742 |
+
element: Cn,
|
743 |
init: Bs,
|
744 |
insert: mi,
|
745 |
listen: Rt,
|
746 |
+
mount_component: Ts,
|
747 |
+
run_all: Cs,
|
748 |
safe_not_equal: Ps,
|
749 |
set_data: Is,
|
750 |
set_input_value: Pn,
|
|
|
795 |
}
|
796 |
}), {
|
797 |
c() {
|
798 |
+
t = Cn("label"), Hs(n.$$.fragment), i = Ns(), r = Cn("input"), Mt(r, "type", "color"), r.disabled = /*disabled*/
|
799 |
e[3], Mt(r, "class", "svelte-16l8u73"), Mt(t, "class", "block");
|
800 |
},
|
801 |
m(a, f) {
|
802 |
+
mi(a, t, f), Ts(n, t, null), Bn(t, i), Bn(t, r), Pn(
|
803 |
r,
|
804 |
/*value*/
|
805 |
e[0]
|
|
|
847 |
Ms(n.$$.fragment, a), s = !1;
|
848 |
},
|
849 |
d(a) {
|
850 |
+
a && ci(t), As(n), u = !1, Cs(o);
|
851 |
}
|
852 |
};
|
853 |
}
|
|
|
861 |
n(5, r = !1);
|
862 |
});
|
863 |
function h(b) {
|
864 |
+
Tn.call(this, e, b);
|
865 |
}
|
866 |
+
function c(b) {
|
867 |
+
Tn.call(this, e, b);
|
868 |
}
|
869 |
function _() {
|
870 |
i = this.value, n(0, i);
|
|
|
882 |
a,
|
883 |
r,
|
884 |
h,
|
885 |
+
c,
|
886 |
_
|
887 |
];
|
888 |
}
|
|
|
898 |
});
|
899 |
}
|
900 |
}
|
901 |
+
function we() {
|
902 |
}
|
903 |
function zs(e) {
|
904 |
return e();
|
|
|
916 |
if (e == null) {
|
917 |
for (const i of t)
|
918 |
i(void 0);
|
919 |
+
return we;
|
920 |
}
|
921 |
const n = e.subscribe(...t);
|
922 |
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
|
934 |
return t * t * t + 1;
|
935 |
}
|
936 |
function Nn(e, { delay: t = 0, duration: n = 400, easing: i = Ws, x: r = 0, y: s = 0, opacity: u = 0 } = {}) {
|
937 |
+
const o = getComputedStyle(e), a = +o.opacity, f = o.transform === "none" ? "" : o.transform, l = a * (1 - u), [h, c] = In(r), [_, b] = In(s);
|
938 |
return {
|
939 |
delay: t,
|
940 |
duration: n,
|
941 |
easing: i,
|
942 |
css: (g, d) => `
|
943 |
+
transform: ${f} translate(${(1 - g) * h}${c}, ${(1 - g) * _}${b});
|
944 |
opacity: ${a - l * d}`
|
945 |
};
|
946 |
}
|
947 |
+
const ce = [];
|
948 |
function Ys(e, t) {
|
949 |
return {
|
950 |
subscribe: yt(e, t).subscribe
|
951 |
};
|
952 |
}
|
953 |
+
function yt(e, t = we) {
|
954 |
let n;
|
955 |
const i = /* @__PURE__ */ new Set();
|
956 |
function r(o) {
|
957 |
if (Vs(e, o) && (e = o, n)) {
|
958 |
+
const a = !ce.length;
|
959 |
for (const f of i)
|
960 |
+
f[1](), ce.push(f, e);
|
961 |
if (a) {
|
962 |
+
for (let f = 0; f < ce.length; f += 2)
|
963 |
+
ce[f][0](ce[f + 1]);
|
964 |
+
ce.length = 0;
|
965 |
}
|
966 |
}
|
967 |
}
|
968 |
function s(o) {
|
969 |
r(o(e));
|
970 |
}
|
971 |
+
function u(o, a = we) {
|
972 |
const f = [o, a];
|
973 |
+
return i.add(f), i.size === 1 && (n = t(r, s) || we), o(e), () => {
|
974 |
i.delete(f), i.size === 0 && n && (n(), n = null);
|
975 |
};
|
976 |
}
|
977 |
return { set: r, update: s, subscribe: u };
|
978 |
}
|
979 |
+
function Be(e, t, n) {
|
980 |
const i = !Array.isArray(e), r = i ? [e] : e;
|
981 |
if (!r.every(Boolean))
|
982 |
throw new Error("derived() expects stores as input, got a falsy value");
|
|
|
984 |
return Ys(n, (u, o) => {
|
985 |
let a = !1;
|
986 |
const f = [];
|
987 |
+
let l = 0, h = we;
|
988 |
+
const c = () => {
|
989 |
if (l)
|
990 |
return;
|
991 |
h();
|
992 |
const b = t(i ? f[0] : f, u, o);
|
993 |
+
s ? u(b) : h = Xs(b) ? b : we;
|
994 |
}, _ = r.map(
|
995 |
(b, g) => qs(
|
996 |
b,
|
997 |
(d) => {
|
998 |
+
f[g] = d, l &= ~(1 << g), a && c();
|
999 |
},
|
1000 |
() => {
|
1001 |
l |= 1 << g;
|
1002 |
}
|
1003 |
)
|
1004 |
);
|
1005 |
+
return a = !0, c(), function() {
|
1006 |
js(_), h(), a = !1;
|
1007 |
};
|
1008 |
});
|
|
|
1028 |
set_style: F,
|
1029 |
space: pi,
|
1030 |
src_url_equal: _t,
|
1031 |
+
toggle_class: ye,
|
1032 |
transition_in: dt,
|
1033 |
transition_out: bt,
|
1034 |
update_slot_base: vi
|
|
|
1059 |
/*elem_id*/
|
1060 |
e[0]
|
1061 |
), t.disabled = /*disabled*/
|
1062 |
+
e[8], ye(t, "hidden", !/*visible*/
|
1063 |
e[2]), F(
|
1064 |
t,
|
1065 |
"flex-grow",
|
|
|
1115 |
), (!r || h & /*disabled*/
|
1116 |
256) && (t.disabled = /*disabled*/
|
1117 |
l[8]), (!r || h & /*size, variant, elem_classes, visible*/
|
1118 |
+
30) && ye(t, "hidden", !/*visible*/
|
1119 |
l[2]), h & /*scale*/
|
1120 |
512 && F(
|
1121 |
t,
|
|
|
1179 |
"id",
|
1180 |
/*elem_id*/
|
1181 |
e[0]
|
1182 |
+
), ye(t, "hidden", !/*visible*/
|
1183 |
+
e[2]), ye(
|
1184 |
t,
|
1185 |
"disabled",
|
1186 |
/*disabled*/
|
|
|
1250 |
/*elem_id*/
|
1251 |
a[0]
|
1252 |
), (!r || f & /*size, variant, elem_classes, visible*/
|
1253 |
+
30) && ye(t, "hidden", !/*visible*/
|
1254 |
a[2]), (!r || f & /*size, variant, elem_classes, disabled*/
|
1255 |
+
282) && ye(
|
1256 |
t,
|
1257 |
"disabled",
|
1258 |
/*disabled*/
|
|
|
1372 |
};
|
1373 |
}
|
1374 |
function oo(e, t, n) {
|
1375 |
+
let { $$slots: i = {}, $$scope: r } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: o = !0 } = t, { variant: a = "secondary" } = t, { size: f = "lg" } = t, { value: l = null } = t, { link: h = null } = t, { icon: c = null } = t, { disabled: _ = !1 } = t, { scale: b = null } = t, { min_width: g = void 0 } = t;
|
1376 |
+
function d(m) {
|
1377 |
+
Qs.call(this, e, m);
|
1378 |
}
|
1379 |
+
return e.$$set = (m) => {
|
1380 |
+
"elem_id" in m && n(0, s = m.elem_id), "elem_classes" in m && n(1, u = m.elem_classes), "visible" in m && n(2, o = m.visible), "variant" in m && n(3, a = m.variant), "size" in m && n(4, f = m.size), "value" in m && n(5, l = m.value), "link" in m && n(6, h = m.link), "icon" in m && n(7, c = m.icon), "disabled" in m && n(8, _ = m.disabled), "scale" in m && n(9, b = m.scale), "min_width" in m && n(10, g = m.min_width), "$$scope" in m && n(11, r = m.$$scope);
|
1381 |
}, [
|
1382 |
s,
|
1383 |
u,
|
|
|
1386 |
f,
|
1387 |
l,
|
1388 |
h,
|
1389 |
+
c,
|
1390 |
_,
|
1391 |
b,
|
1392 |
g,
|
|
|
1433 |
return Array.isArray(e) ? [] : {};
|
1434 |
}
|
1435 |
function ze(e, t) {
|
1436 |
+
return t.clone !== !1 && t.isMergeableObject(e) ? xe(_o(e), e, t) : e;
|
1437 |
}
|
1438 |
function bo(e, t, n) {
|
1439 |
return e.concat(t).map(function(i) {
|
|
|
1442 |
}
|
1443 |
function go(e, t) {
|
1444 |
if (!t.customMerge)
|
1445 |
+
return xe;
|
1446 |
var n = t.customMerge(e);
|
1447 |
+
return typeof n == "function" ? n : xe;
|
1448 |
}
|
1449 |
function po(e) {
|
1450 |
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
|
|
|
1472 |
vo(e, r) || (yi(e, r) && n.isMergeableObject(t[r]) ? i[r] = go(r, n)(e[r], t[r], n) : i[r] = ze(t[r], n));
|
1473 |
}), i;
|
1474 |
}
|
1475 |
+
function xe(e, t, n) {
|
1476 |
n = n || {}, n.arrayMerge = n.arrayMerge || bo, n.isMergeableObject = n.isMergeableObject || lo, n.cloneUnlessOtherwiseSpecified = ze;
|
1477 |
var i = Array.isArray(t), r = Array.isArray(e), s = i === r;
|
1478 |
return s ? i ? n.arrayMerge(e, t, n) : yo(e, t, n) : ze(t, n);
|
1479 |
}
|
1480 |
+
xe.all = function(t, n) {
|
1481 |
if (!Array.isArray(t))
|
1482 |
throw new Error("first argument should be an array");
|
1483 |
return t.reduce(function(i, r) {
|
1484 |
+
return xe(i, r, n);
|
1485 |
}, {});
|
1486 |
};
|
1487 |
+
var Eo = xe, wo = Eo;
|
1488 |
const xo = /* @__PURE__ */ ao(wo);
|
1489 |
var Qt = function(e, t) {
|
1490 |
return Qt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
|
|
1503 |
}
|
1504 |
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
1505 |
}
|
1506 |
+
var B = function() {
|
1507 |
+
return B = Object.assign || function(t) {
|
1508 |
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
1509 |
n = arguments[i];
|
1510 |
for (var s in n)
|
1511 |
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
1512 |
}
|
1513 |
return t;
|
1514 |
+
}, B.apply(this, arguments);
|
1515 |
};
|
1516 |
function kt(e, t, n) {
|
1517 |
if (n || arguments.length === 2)
|
|
|
1527 |
(function(e) {
|
1528 |
e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
|
1529 |
})(I || (I = {}));
|
1530 |
+
var Se;
|
1531 |
(function(e) {
|
1532 |
e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
|
1533 |
+
})(Se || (Se = {}));
|
1534 |
function kn(e) {
|
1535 |
return e.type === I.literal;
|
1536 |
}
|
|
|
1559 |
return e.type === I.tag;
|
1560 |
}
|
1561 |
function Bi(e) {
|
1562 |
+
return !!(e && typeof e == "object" && e.type === Se.number);
|
1563 |
}
|
1564 |
function Jt(e) {
|
1565 |
+
return !!(e && typeof e == "object" && e.type === Se.dateTime);
|
1566 |
}
|
1567 |
+
var Ti = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Ao = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
1568 |
function Bo(e) {
|
1569 |
var t = {};
|
1570 |
return e.replace(Ao, function(n) {
|
|
|
1656 |
return "";
|
1657 |
}), t;
|
1658 |
}
|
1659 |
+
var To = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
1660 |
+
function Co(e) {
|
1661 |
if (e.length === 0)
|
1662 |
throw new Error("Number skeleton cannot be empty");
|
1663 |
+
for (var t = e.split(To).filter(function(c) {
|
1664 |
+
return c.length > 0;
|
1665 |
}), n = [], i = 0, r = t; i < r.length; i++) {
|
1666 |
var s = r[i], u = s.split("/");
|
1667 |
if (u.length === 0)
|
|
|
1678 |
function Po(e) {
|
1679 |
return e.replace(/^(.*?)-/, "");
|
1680 |
}
|
1681 |
+
var Dn = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ci = /^(@+)?(\+|#+)?[rs]?$/g, Io = /(\*)(0+)|(#+)(0+)|(0+)/g, Pi = /^(0+)$/;
|
1682 |
function Un(e) {
|
1683 |
var t = {};
|
1684 |
+
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ci, function(n, i, r) {
|
1685 |
return typeof r != "string" ? (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length) : r === "+" ? t.minimumSignificantDigits = i.length : i[0] === "#" ? t.maximumSignificantDigits = i.length : (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length + (typeof r == "string" ? r.length : 0)), "";
|
1686 |
}), t;
|
1687 |
}
|
|
|
1778 |
t.notation = "compact", t.compactDisplay = "long";
|
1779 |
continue;
|
1780 |
case "scientific":
|
1781 |
+
t = B(B(B({}, t), { notation: "scientific" }), r.options.reduce(function(a, f) {
|
1782 |
+
return B(B({}, a), Gn(f));
|
1783 |
}, {}));
|
1784 |
continue;
|
1785 |
case "engineering":
|
1786 |
+
t = B(B(B({}, t), { notation: "engineering" }), r.options.reduce(function(a, f) {
|
1787 |
+
return B(B({}, a), Gn(f));
|
1788 |
}, {}));
|
1789 |
continue;
|
1790 |
case "notation-simple":
|
|
|
1808 |
case "integer-width":
|
1809 |
if (r.options.length > 1)
|
1810 |
throw new RangeError("integer-width stems only accept a single optional option");
|
1811 |
+
r.options[0].replace(Io, function(a, f, l, h, c, _) {
|
1812 |
if (f)
|
1813 |
t.minimumIntegerDigits = l.length;
|
1814 |
else {
|
1815 |
+
if (h && c)
|
1816 |
throw new Error("We currently do not support maximum integer digits");
|
1817 |
if (_)
|
1818 |
throw new Error("We currently do not support exact integer digits");
|
|
|
1828 |
if (Dn.test(r.stem)) {
|
1829 |
if (r.options.length > 1)
|
1830 |
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
1831 |
+
r.stem.replace(Dn, function(a, f, l, h, c, _) {
|
1832 |
+
return l === "*" ? t.minimumFractionDigits = f.length : h && h[0] === "#" ? t.maximumFractionDigits = h.length : c && _ ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + _.length) : (t.minimumFractionDigits = f.length, t.maximumFractionDigits = f.length), "";
|
1833 |
});
|
1834 |
var s = r.options[0];
|
1835 |
+
s === "w" ? t = B(B({}, t), { trailingZeroDisplay: "stripIfInteger" }) : s && (t = B(B({}, t), Un(s)));
|
1836 |
continue;
|
1837 |
}
|
1838 |
+
if (Ci.test(r.stem)) {
|
1839 |
+
t = B(B({}, t), Un(r.stem));
|
1840 |
continue;
|
1841 |
}
|
1842 |
var u = Ii(r.stem);
|
1843 |
+
u && (t = B(B({}, t), u));
|
1844 |
var o = No(r.stem);
|
1845 |
+
o && (t = B(B({}, t), o));
|
1846 |
}
|
1847 |
return t;
|
1848 |
}
|
|
|
3221 |
var r = Ke[i || ""] || Ke[n || ""] || Ke["".concat(n, "-001")] || Ke["001"];
|
3222 |
return r[0];
|
3223 |
}
|
3224 |
+
var Dt, Ro = new RegExp("^".concat(Ti.source, "*")), ko = new RegExp("".concat(Ti.source, "*$"));
|
3225 |
function H(e, t) {
|
3226 |
return { start: e, end: t };
|
3227 |
}
|
|
|
3523 |
var l = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible();
|
3524 |
if (h.err)
|
3525 |
return h;
|
3526 |
+
var c = Yo(h.val);
|
3527 |
+
if (c.length === 0)
|
3528 |
return this.error(S.EXPECT_ARGUMENT_STYLE, H(this.clonePosition(), this.clonePosition()));
|
3529 |
var _ = H(l, this.clonePosition());
|
3530 |
+
f = { style: c, styleLocation: _ };
|
3531 |
}
|
3532 |
var b = this.tryParseArgumentClose(r);
|
3533 |
if (b.err)
|
|
|
3544 |
} else {
|
3545 |
if (d.length === 0)
|
3546 |
return this.error(S.EXPECT_DATE_TIME_SKELETON, g);
|
3547 |
+
var m = d;
|
3548 |
+
this.locale && (m = Lo(d, this.locale));
|
3549 |
+
var c = {
|
3550 |
+
type: Se.dateTime,
|
3551 |
+
pattern: m,
|
3552 |
location: f.styleLocation,
|
3553 |
+
parsedOptions: this.shouldParseSkeletons ? Bo(m) : {}
|
3554 |
}, y = o === "date" ? I.date : I.time;
|
3555 |
return {
|
3556 |
+
val: { type: y, value: i, location: g, style: c },
|
3557 |
err: null
|
3558 |
};
|
3559 |
}
|
|
|
3573 |
case "select": {
|
3574 |
var p = this.clonePosition();
|
3575 |
if (this.bumpSpace(), !this.bumpIf(","))
|
3576 |
+
return this.error(S.EXPECT_SELECT_ARGUMENT_OPTIONS, H(p, B({}, p)));
|
3577 |
this.bumpSpace();
|
3578 |
+
var T = this.parseIdentifierIfPossible(), C = 0;
|
3579 |
+
if (o !== "select" && T.value === "offset") {
|
3580 |
if (!this.bumpIf(":"))
|
3581 |
return this.error(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, H(this.clonePosition(), this.clonePosition()));
|
3582 |
this.bumpSpace();
|
3583 |
var h = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, S.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
3584 |
if (h.err)
|
3585 |
return h;
|
3586 |
+
this.bumpSpace(), T = this.parseIdentifierIfPossible(), C = h.val;
|
3587 |
}
|
3588 |
+
var O = this.tryParsePluralOrSelectOptions(t, o, n, T);
|
3589 |
if (O.err)
|
3590 |
return O;
|
3591 |
var b = this.tryParseArgumentClose(r);
|
3592 |
if (b.err)
|
3593 |
return b;
|
3594 |
+
var P = H(r, this.clonePosition());
|
3595 |
return o === "select" ? {
|
3596 |
val: {
|
3597 |
type: I.select,
|
3598 |
value: i,
|
3599 |
options: zn(O.val),
|
3600 |
+
location: P
|
3601 |
},
|
3602 |
err: null
|
3603 |
} : {
|
|
|
3607 |
options: zn(O.val),
|
3608 |
offset: C,
|
3609 |
pluralType: o === "plural" ? "cardinal" : "ordinal",
|
3610 |
+
location: P
|
3611 |
},
|
3612 |
err: null
|
3613 |
};
|
|
|
3655 |
}, e.prototype.parseNumberSkeletonFromString = function(t, n) {
|
3656 |
var i = [];
|
3657 |
try {
|
3658 |
+
i = Co(t);
|
3659 |
} catch {
|
3660 |
return this.error(S.INVALID_NUMBER_SKELETON, n);
|
3661 |
}
|
3662 |
return {
|
3663 |
val: {
|
3664 |
+
type: Se.number,
|
3665 |
tokens: i,
|
3666 |
location: n,
|
3667 |
parsedOptions: this.shouldParseSkeletons ? Oo(i) : {}
|
|
|
3673 |
if (f.length === 0) {
|
3674 |
var h = this.clonePosition();
|
3675 |
if (n !== "select" && this.bumpIf("=")) {
|
3676 |
+
var c = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_SELECTOR, S.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
3677 |
+
if (c.err)
|
3678 |
+
return c;
|
3679 |
l = H(h, this.clonePosition()), f = this.message.slice(h.offset, this.offset());
|
3680 |
} else
|
3681 |
break;
|
|
|
3803 |
});
|
3804 |
}
|
3805 |
function $o(e, t) {
|
3806 |
+
t === void 0 && (t = {}), t = B({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
|
3807 |
var n = new Zo(e, t).parse();
|
3808 |
if (n.err) {
|
3809 |
var i = SyntaxError(S[n.err.kind]);
|
|
|
3861 |
}, Gt = {
|
3862 |
variadic: na,
|
3863 |
monadic: ia
|
3864 |
+
}, He;
|
3865 |
(function(e) {
|
3866 |
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
3867 |
+
})(He || (He = {}));
|
3868 |
var xt = (
|
3869 |
/** @class */
|
3870 |
function(e) {
|
|
|
3882 |
function(e) {
|
3883 |
wt(t, e);
|
3884 |
function t(n, i, r, s) {
|
3885 |
+
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), He.INVALID_VALUE, s) || this;
|
3886 |
}
|
3887 |
return t;
|
3888 |
}(xt)
|
|
|
3891 |
function(e) {
|
3892 |
wt(t, e);
|
3893 |
function t(n, i, r) {
|
3894 |
+
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), He.INVALID_VALUE, r) || this;
|
3895 |
}
|
3896 |
return t;
|
3897 |
}(xt)
|
|
|
3900 |
function(e) {
|
3901 |
wt(t, e);
|
3902 |
function t(n, i) {
|
3903 |
+
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(i, '"'), He.MISSING_VALUE, i) || this;
|
3904 |
}
|
3905 |
return t;
|
3906 |
}(xt)
|
3907 |
+
), D;
|
3908 |
(function(e) {
|
3909 |
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
3910 |
+
})(D || (D = {}));
|
3911 |
function la(e) {
|
3912 |
return e.length < 2 ? e : e.reduce(function(t, n) {
|
3913 |
var i = t[t.length - 1];
|
3914 |
+
return !i || i.type !== D.literal || n.type !== D.literal ? t.push(n) : i.value += n.value, t;
|
3915 |
}, []);
|
3916 |
}
|
3917 |
function ua(e) {
|
|
|
3921 |
if (e.length === 1 && kn(e[0]))
|
3922 |
return [
|
3923 |
{
|
3924 |
+
type: D.literal,
|
3925 |
value: e[0].value
|
3926 |
}
|
3927 |
];
|
|
|
3929 |
var l = f[a];
|
3930 |
if (kn(l)) {
|
3931 |
o.push({
|
3932 |
+
type: D.literal,
|
3933 |
value: l.value
|
3934 |
});
|
3935 |
continue;
|
3936 |
}
|
3937 |
if (Ho(l)) {
|
3938 |
typeof s == "number" && o.push({
|
3939 |
+
type: D.literal,
|
3940 |
value: n.getNumberFormat(t).format(s)
|
3941 |
});
|
3942 |
continue;
|
|
|
3944 |
var h = l.value;
|
3945 |
if (!(r && h in r))
|
3946 |
throw new aa(h, u);
|
3947 |
+
var c = r[h];
|
3948 |
if (So(l)) {
|
3949 |
+
(!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), o.push({
|
3950 |
+
type: typeof c == "string" ? D.literal : D.object,
|
3951 |
+
value: c
|
3952 |
});
|
3953 |
continue;
|
3954 |
}
|
3955 |
if (wi(l)) {
|
3956 |
var _ = typeof l.style == "string" ? i.date[l.style] : Jt(l.style) ? l.style.parsedOptions : void 0;
|
3957 |
o.push({
|
3958 |
+
type: D.literal,
|
3959 |
+
value: n.getDateTimeFormat(t, _).format(c)
|
3960 |
});
|
3961 |
continue;
|
3962 |
}
|
3963 |
if (xi(l)) {
|
3964 |
var _ = typeof l.style == "string" ? i.time[l.style] : Jt(l.style) ? l.style.parsedOptions : i.time.medium;
|
3965 |
o.push({
|
3966 |
+
type: D.literal,
|
3967 |
+
value: n.getDateTimeFormat(t, _).format(c)
|
3968 |
});
|
3969 |
continue;
|
3970 |
}
|
3971 |
if (Ei(l)) {
|
3972 |
var _ = typeof l.style == "string" ? i.number[l.style] : Bi(l.style) ? l.style.parsedOptions : void 0;
|
3973 |
+
_ && _.scale && (c = c * (_.scale || 1)), o.push({
|
3974 |
+
type: D.literal,
|
3975 |
+
value: n.getNumberFormat(t, _).format(c)
|
3976 |
});
|
3977 |
continue;
|
3978 |
}
|
|
|
3980 |
var b = l.children, g = l.value, d = r[g];
|
3981 |
if (!ua(d))
|
3982 |
throw new oa(g, "function", u);
|
3983 |
+
var m = ht(b, t, n, i, r, s), y = d(m.map(function(C) {
|
3984 |
return C.value;
|
3985 |
}));
|
3986 |
Array.isArray(y) || (y = [y]), o.push.apply(o, y.map(function(C) {
|
3987 |
return {
|
3988 |
+
type: typeof C == "string" ? D.literal : D.object,
|
3989 |
value: C
|
3990 |
};
|
3991 |
}));
|
3992 |
}
|
3993 |
if (Si(l)) {
|
3994 |
+
var p = l.options[c] || l.options.other;
|
3995 |
if (!p)
|
3996 |
+
throw new Xn(l.value, c, Object.keys(l.options), u);
|
3997 |
o.push.apply(o, ht(p.value, t, n, i, r));
|
3998 |
continue;
|
3999 |
}
|
4000 |
if (Hi(l)) {
|
4001 |
+
var p = l.options["=".concat(c)];
|
4002 |
if (!p) {
|
4003 |
if (!Intl.PluralRules)
|
4004 |
throw new xt(`Intl.PluralRules is not available in this environment.
|
4005 |
Try polyfilling it using "@formatjs/intl-pluralrules"
|
4006 |
+
`, He.MISSING_INTL_API, u);
|
4007 |
+
var T = n.getPluralRules(t, { type: l.pluralType }).select(c - (l.offset || 0));
|
4008 |
+
p = l.options[T] || l.options.other;
|
4009 |
}
|
4010 |
if (!p)
|
4011 |
+
throw new Xn(l.value, c, Object.keys(l.options), u);
|
4012 |
+
o.push.apply(o, ht(p.value, t, n, i, r, c - (l.offset || 0)));
|
4013 |
continue;
|
4014 |
}
|
4015 |
}
|
4016 |
return la(o);
|
4017 |
}
|
4018 |
function fa(e, t) {
|
4019 |
+
return t ? B(B(B({}, e || {}), t || {}), Object.keys(e).reduce(function(n, i) {
|
4020 |
+
return n[i] = B(B({}, e[i]), t[i] || {}), n;
|
4021 |
}, {})) : e;
|
4022 |
}
|
4023 |
function ha(e, t) {
|
4024 |
return t ? Object.keys(e).reduce(function(n, i) {
|
4025 |
return n[i] = fa(e[i], t[i]), n;
|
4026 |
+
}, B({}, e)) : e;
|
4027 |
}
|
4028 |
function Ft(e) {
|
4029 |
return {
|
|
|
4085 |
if (o.length === 1)
|
4086 |
return o[0].value;
|
4087 |
var a = o.reduce(function(f, l) {
|
4088 |
+
return !f.length || l.type !== D.literal || typeof f[f.length - 1] != "string" ? f.push(l.value) : f[f.length - 1] += l.value, f;
|
4089 |
}, []);
|
4090 |
return a.length <= 1 ? a[0] || "" : a;
|
4091 |
}, this.formatToParts = function(u) {
|
|
|
4200 |
i = void 0;
|
4201 |
return i;
|
4202 |
}
|
4203 |
+
const re = {}, da = (e, t, n) => n && (t in re || (re[t] = {}), e in re[t] || (re[t][e] = n), n), ki = (e, t) => {
|
4204 |
if (t == null)
|
4205 |
return;
|
4206 |
+
if (t in re && e in re[t])
|
4207 |
+
return re[t][e];
|
4208 |
const n = St(t);
|
4209 |
for (let i = 0; i < n.length; i++) {
|
4210 |
const r = n[i], s = ga(r, e);
|
|
|
4237 |
}
|
4238 |
}
|
4239 |
function va(e, ...t) {
|
4240 |
+
delete re[e], We.update((n) => (n[e] = xo.all([n[e] || {}, ...t]), n));
|
4241 |
}
|
4242 |
+
Be(
|
4243 |
[We],
|
4244 |
([e]) => Object.keys(e)
|
4245 |
);
|
|
|
4322 |
handleMissingMessage: void 0,
|
4323 |
ignoreTag: !0
|
4324 |
}, Ha = Sa;
|
4325 |
+
function Ae() {
|
4326 |
return Ha;
|
4327 |
}
|
4328 |
const zt = yt(!1);
|
4329 |
+
var Aa = Object.defineProperty, Ba = Object.defineProperties, Ta = Object.getOwnPropertyDescriptors, Vn = Object.getOwnPropertySymbols, Ca = Object.prototype.hasOwnProperty, Pa = Object.prototype.propertyIsEnumerable, qn = (e, t, n) => t in e ? Aa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ia = (e, t) => {
|
4330 |
for (var n in t || (t = {}))
|
4331 |
+
Ca.call(t, n) && qn(e, n, t[n]);
|
4332 |
if (Vn)
|
4333 |
for (var n of Vn(t))
|
4334 |
Pa.call(t, n) && qn(e, n, t[n]);
|
4335 |
return e;
|
4336 |
+
}, Na = (e, t) => Ba(e, Ta(t));
|
4337 |
let sn;
|
4338 |
const gt = yt(null);
|
4339 |
function Wn(e) {
|
4340 |
return e.split("-").map((t, n, i) => i.slice(0, n + 1).join("-")).reverse();
|
4341 |
}
|
4342 |
+
function St(e, t = Ae().fallbackLocale) {
|
4343 |
const n = Wn(e);
|
4344 |
return t ? [.../* @__PURE__ */ new Set([...n, ...Wn(t)])] : n;
|
4345 |
}
|
4346 |
+
function le() {
|
4347 |
return sn ?? void 0;
|
4348 |
}
|
4349 |
gt.subscribe((e) => {
|
|
|
4351 |
});
|
4352 |
const Oa = (e) => {
|
4353 |
if (e && pa(e) && rn(e)) {
|
4354 |
+
const { loadingDelay: t } = Ae();
|
4355 |
let n;
|
4356 |
+
return typeof window < "u" && le() != null && t ? n = window.setTimeout(
|
4357 |
() => zt.set(!0),
|
4358 |
t
|
4359 |
) : zt.set(!0), Gi(e).then(() => {
|
|
|
4389 |
return n;
|
4390 |
};
|
4391 |
const je = (e, t) => {
|
4392 |
+
const { formats: n } = Ae();
|
4393 |
if (e in n && t in n[e])
|
4394 |
return n[e][t];
|
4395 |
throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`);
|
|
|
4418 |
}
|
4419 |
), Da = (e = {}) => {
|
4420 |
var t = e, {
|
4421 |
+
locale: n = le()
|
4422 |
} = t, i = Te(t, [
|
4423 |
"locale"
|
4424 |
]);
|
4425 |
return Ma(dn({ locale: n }, i));
|
4426 |
}, Ua = (e = {}) => {
|
4427 |
var t = e, {
|
4428 |
+
locale: n = le()
|
4429 |
} = t, i = Te(t, [
|
4430 |
"locale"
|
4431 |
]);
|
4432 |
return Ra(dn({ locale: n }, i));
|
4433 |
}, Ga = (e = {}) => {
|
4434 |
var t = e, {
|
4435 |
+
locale: n = le()
|
4436 |
} = t, i = Te(t, [
|
4437 |
"locale"
|
4438 |
]);
|
4439 |
return ka(dn({ locale: n }, i));
|
4440 |
}, Fa = Ht(
|
4441 |
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
4442 |
+
(e, t = le()) => new ma(e, t, Ae().formats, {
|
4443 |
+
ignoreTag: Ae().ignoreTag
|
4444 |
})
|
4445 |
), za = (e, t = {}) => {
|
4446 |
var n, i, r, s;
|
|
|
4448 |
typeof e == "object" && (u = e, e = u.id);
|
4449 |
const {
|
4450 |
values: o,
|
4451 |
+
locale: a = le(),
|
4452 |
default: f
|
4453 |
} = u;
|
4454 |
if (a == null)
|
|
|
4457 |
);
|
4458 |
let l = ki(e, a);
|
4459 |
if (!l)
|
4460 |
+
l = (s = (r = (i = (n = Ae()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: a, id: e, defaultValue: f })) != null ? r : f) != null ? s : e;
|
4461 |
else if (typeof l != "string")
|
4462 |
return console.warn(
|
4463 |
`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof l}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`
|
|
|
4467 |
let h = l;
|
4468 |
try {
|
4469 |
h = Fa(l, a).format(o);
|
4470 |
+
} catch (c) {
|
4471 |
+
c instanceof Error && console.warn(
|
4472 |
`[svelte-i18n] Message "${e}" has syntax error:`,
|
4473 |
+
c.message
|
4474 |
);
|
4475 |
}
|
4476 |
return h;
|
4477 |
+
}, ja = (e, t) => Ga(t).format(e), Xa = (e, t) => Ua(t).format(e), Va = (e, t) => Da(t).format(e), qa = (e, t = le()) => ki(e, t);
|
4478 |
+
Be([Ye, We], () => za);
|
4479 |
+
Be([Ye], () => ja);
|
4480 |
+
Be([Ye], () => Xa);
|
4481 |
+
Be([Ye], () => Va);
|
4482 |
+
Be([Ye, We], () => qa);
|
4483 |
const {
|
4484 |
SvelteComponent: Wa,
|
4485 |
add_render_callback: ji,
|
|
|
4501 |
run_all: el,
|
4502 |
safe_not_equal: tl,
|
4503 |
set_data: nl,
|
4504 |
+
set_style: me,
|
4505 |
space: an,
|
4506 |
text: il,
|
4507 |
toggle_class: Q,
|
|
|
4524 |
t = vt("ul");
|
4525 |
for (let a = 0; a < o.length; a += 1)
|
4526 |
o[a].c();
|
4527 |
+
j(t, "class", "options svelte-yuohum"), j(t, "role", "listbox"), me(
|
4528 |
t,
|
4529 |
"bottom",
|
4530 |
/*bottom*/
|
4531 |
e[9]
|
4532 |
+
), me(t, "max-height", `calc(${/*max_height*/
|
4533 |
+
e[10]}px - var(--window-padding))`), me(
|
4534 |
t,
|
4535 |
"width",
|
4536 |
/*input_width*/
|
|
|
4563 |
o.length = u.length;
|
4564 |
}
|
4565 |
f & /*bottom*/
|
4566 |
+
512 && me(
|
4567 |
t,
|
4568 |
"bottom",
|
4569 |
/*bottom*/
|
4570 |
a[9]
|
4571 |
), f & /*max_height*/
|
4572 |
+
1024 && me(t, "max-height", `calc(${/*max_height*/
|
4573 |
a[10]}px - var(--window-padding))`), f & /*input_width*/
|
4574 |
+
256 && me(
|
4575 |
t,
|
4576 |
"width",
|
4577 |
/*input_width*/
|
|
|
4766 |
return n;
|
4767 |
}
|
4768 |
function ol(e, t, n) {
|
4769 |
+
let { choices: i } = t, { filtered_indices: r } = t, { show_options: s = !1 } = t, { disabled: u = !1 } = t, { selected_indices: o = [] } = t, { active_index: a = null } = t, f, l, h, c, _, b, g, d, m;
|
4770 |
function y() {
|
4771 |
+
const { top: x, bottom: L } = _.getBoundingClientRect();
|
4772 |
+
n(14, f = x), n(15, l = m - L);
|
4773 |
}
|
4774 |
let p = null;
|
4775 |
+
function T() {
|
4776 |
s && (p !== null && clearTimeout(p), p = setTimeout(
|
4777 |
() => {
|
4778 |
y(), p = null;
|
|
|
4782 |
}
|
4783 |
const C = rl();
|
4784 |
function O() {
|
4785 |
+
n(11, m = window.innerHeight);
|
4786 |
}
|
4787 |
+
function P(x) {
|
4788 |
Zn[x ? "unshift" : "push"](() => {
|
4789 |
_ = x, n(6, _);
|
4790 |
});
|
4791 |
}
|
4792 |
const E = (x) => C("change", x);
|
4793 |
+
function M(x) {
|
4794 |
Zn[x ? "unshift" : "push"](() => {
|
4795 |
b = x, n(7, b);
|
4796 |
});
|
|
|
4802 |
114900) {
|
4803 |
if (s && _) {
|
4804 |
if (b && o.length > 0) {
|
4805 |
+
let L = b.querySelectorAll("li");
|
4806 |
+
for (const W of Array.from(L))
|
4807 |
if (W.getAttribute("data-index") === o[0].toString()) {
|
4808 |
et([
|
4809 |
b,
|
|
|
4819 |
const x = et([
|
4820 |
_,
|
4821 |
"access",
|
4822 |
+
(L) => L.parentElement,
|
4823 |
"optionalAccess",
|
4824 |
+
(L) => L.getBoundingClientRect,
|
4825 |
"call",
|
4826 |
+
(L) => L()
|
4827 |
]);
|
4828 |
+
n(16, h = et([x, "optionalAccess", (L) => L.height]) || 0), n(8, c = et([x, "optionalAccess", (L) => L.width]) || 0);
|
4829 |
}
|
4830 |
l > f ? (n(10, d = l), n(9, g = null)) : (n(9, g = `${l + h}px`), n(10, d = f - h));
|
4831 |
}
|
|
|
4838 |
a,
|
4839 |
_,
|
4840 |
b,
|
4841 |
+
c,
|
4842 |
g,
|
4843 |
d,
|
4844 |
+
m,
|
4845 |
+
T,
|
4846 |
C,
|
4847 |
f,
|
4848 |
l,
|
4849 |
h,
|
4850 |
O,
|
4851 |
+
P,
|
4852 |
E,
|
4853 |
+
M
|
4854 |
];
|
4855 |
}
|
4856 |
class al extends Wa {
|
|
|
4888 |
}
|
4889 |
const {
|
4890 |
SvelteComponent: hl,
|
4891 |
+
append: se,
|
4892 |
attr: z,
|
4893 |
binding_callbacks: cl,
|
4894 |
check_outros: ml,
|
4895 |
create_component: ln,
|
4896 |
destroy_component: un,
|
4897 |
detach: bn,
|
4898 |
+
element: de,
|
4899 |
group_outros: _l,
|
4900 |
init: dl,
|
4901 |
insert: gn,
|
|
|
4907 |
set_input_value: ii,
|
4908 |
space: Xt,
|
4909 |
text: vl,
|
4910 |
+
toggle_class: _e,
|
4911 |
+
transition_in: be,
|
4912 |
transition_out: Me
|
4913 |
} = window.__gradio__svelte__internal, { onMount: yl } = window.__gradio__svelte__internal, { createEventDispatcher: El, afterUpdate: wl } = window.__gradio__svelte__internal;
|
4914 |
function xl(e) {
|
|
|
4940 |
let t, n, i;
|
4941 |
return n = new Hr({}), {
|
4942 |
c() {
|
4943 |
+
t = de("div"), ln(n.$$.fragment), z(t, "class", "icon-wrap svelte-1m1zvyj");
|
4944 |
},
|
4945 |
m(r, s) {
|
4946 |
gn(r, t, s), fn(n, t, null), i = !0;
|
4947 |
},
|
4948 |
i(r) {
|
4949 |
+
i || (be(n.$$.fragment, r), i = !0);
|
4950 |
},
|
4951 |
o(r) {
|
4952 |
Me(n.$$.fragment, r), i = !1;
|
|
|
4957 |
};
|
4958 |
}
|
4959 |
function Sl(e) {
|
4960 |
+
let t, n, i, r, s, u, o, a, f, l, h, c, _, b;
|
4961 |
n = new hi({
|
4962 |
props: {
|
4963 |
show_label: (
|
|
|
5010 |
e[16]
|
5011 |
), {
|
5012 |
c() {
|
5013 |
+
t = de("div"), ln(n.$$.fragment), i = Xt(), r = de("div"), s = de("div"), u = de("div"), o = de("input"), f = Xt(), g && g.c(), l = Xt(), ln(h.$$.fragment), z(o, "role", "listbox"), z(o, "aria-controls", "dropdown-options"), z(
|
5014 |
o,
|
5015 |
"aria-expanded",
|
5016 |
/*show_options*/
|
|
|
5022 |
e[0]
|
5023 |
), z(o, "class", "border-none svelte-1m1zvyj"), o.disabled = /*disabled*/
|
5024 |
e[3], z(o, "autocomplete", "off"), o.readOnly = a = !/*filterable*/
|
5025 |
+
e[7], _e(o, "subdued", !/*choices_names*/
|
5026 |
e[13].includes(
|
5027 |
/*input_text*/
|
5028 |
e[9]
|
5029 |
) && !/*allow_custom_value*/
|
5030 |
+
e[6]), z(u, "class", "secondary-wrap svelte-1m1zvyj"), z(s, "class", "wrap-inner svelte-1m1zvyj"), _e(
|
5031 |
s,
|
5032 |
"show_options",
|
5033 |
/*show_options*/
|
5034 |
e[12]
|
5035 |
+
), z(r, "class", "wrap svelte-1m1zvyj"), z(t, "class", "svelte-1m1zvyj"), _e(
|
5036 |
t,
|
5037 |
"container",
|
5038 |
/*container*/
|
5039 |
e[5]
|
5040 |
);
|
5041 |
},
|
5042 |
+
m(d, m) {
|
5043 |
+
gn(d, t, m), fn(n, t, null), se(t, i), se(t, r), se(r, s), se(s, u), se(u, o), ii(
|
5044 |
o,
|
5045 |
/*input_text*/
|
5046 |
e[9]
|
5047 |
+
), e[29](o), se(u, f), g && g.m(u, null), se(r, l), fn(h, r, null), c = !0, _ || (b = [
|
5048 |
Oe(
|
5049 |
o,
|
5050 |
"input",
|
|
|
5077 |
)
|
5078 |
], _ = !0);
|
5079 |
},
|
5080 |
+
p(d, m) {
|
5081 |
const y = {};
|
5082 |
+
m[0] & /*show_label*/
|
5083 |
16 && (y.show_label = /*show_label*/
|
5084 |
+
d[4]), m[0] & /*info*/
|
5085 |
2 && (y.info = /*info*/
|
5086 |
+
d[1]), m[0] & /*label*/
|
5087 |
+
1 | m[1] & /*$$scope*/
|
5088 |
+
4 && (y.$$scope = { dirty: m, ctx: d }), n.$set(y), (!c || m[0] & /*show_options*/
|
5089 |
4096) && z(
|
5090 |
o,
|
5091 |
"aria-expanded",
|
5092 |
/*show_options*/
|
5093 |
d[12]
|
5094 |
+
), (!c || m[0] & /*label*/
|
5095 |
1) && z(
|
5096 |
o,
|
5097 |
"aria-label",
|
5098 |
/*label*/
|
5099 |
d[0]
|
5100 |
+
), (!c || m[0] & /*disabled*/
|
5101 |
8) && (o.disabled = /*disabled*/
|
5102 |
+
d[3]), (!c || m[0] & /*filterable*/
|
5103 |
128 && a !== (a = !/*filterable*/
|
5104 |
+
d[7])) && (o.readOnly = a), m[0] & /*input_text*/
|
5105 |
512 && o.value !== /*input_text*/
|
5106 |
d[9] && ii(
|
5107 |
o,
|
5108 |
/*input_text*/
|
5109 |
d[9]
|
5110 |
+
), (!c || m[0] & /*choices_names, input_text, allow_custom_value*/
|
5111 |
+
8768) && _e(o, "subdued", !/*choices_names*/
|
5112 |
d[13].includes(
|
5113 |
/*input_text*/
|
5114 |
d[9]
|
|
|
5116 |
d[6]), /*disabled*/
|
5117 |
d[3] ? g && (_l(), Me(g, 1, 1, () => {
|
5118 |
g = null;
|
5119 |
+
}), ml()) : g ? m[0] & /*disabled*/
|
5120 |
+
8 && be(g, 1) : (g = ri(), g.c(), be(g, 1), g.m(u, null)), (!c || m[0] & /*show_options*/
|
5121 |
+
4096) && _e(
|
5122 |
s,
|
5123 |
"show_options",
|
5124 |
/*show_options*/
|
5125 |
d[12]
|
5126 |
);
|
5127 |
const p = {};
|
5128 |
+
m[0] & /*show_options*/
|
5129 |
4096 && (p.show_options = /*show_options*/
|
5130 |
+
d[12]), m[0] & /*choices*/
|
5131 |
4 && (p.choices = /*choices*/
|
5132 |
+
d[2]), m[0] & /*filtered_indices*/
|
5133 |
1024 && (p.filtered_indices = /*filtered_indices*/
|
5134 |
+
d[10]), m[0] & /*disabled*/
|
5135 |
8 && (p.disabled = /*disabled*/
|
5136 |
+
d[3]), m[0] & /*selected_index*/
|
5137 |
2048 && (p.selected_indices = /*selected_index*/
|
5138 |
d[11] === null ? [] : [
|
5139 |
/*selected_index*/
|
5140 |
d[11]
|
5141 |
+
]), m[0] & /*active_index*/
|
5142 |
16384 && (p.active_index = /*active_index*/
|
5143 |
+
d[14]), h.$set(p), (!c || m[0] & /*container*/
|
5144 |
+
32) && _e(
|
5145 |
t,
|
5146 |
"container",
|
5147 |
/*container*/
|
|
|
5149 |
);
|
5150 |
},
|
5151 |
i(d) {
|
5152 |
+
c || (be(n.$$.fragment, d), be(g), be(h.$$.fragment, d), c = !0);
|
5153 |
},
|
5154 |
o(d) {
|
5155 |
+
Me(n.$$.fragment, d), Me(g), Me(h.$$.fragment, d), c = !1;
|
5156 |
},
|
5157 |
d(d) {
|
5158 |
d && bn(t), un(n), e[29](null), g && g.d(), un(h), _ = !1, bl(b);
|
|
|
5160 |
};
|
5161 |
}
|
5162 |
function Hl(e, t, n) {
|
5163 |
+
let { label: i } = t, { info: r = void 0 } = t, { value: s = [] } = t, u = [], { value_is_output: o = !1 } = t, { choices: a } = t, f, { disabled: l = !1 } = t, { show_label: h } = t, { container: c = !0 } = t, { allow_custom_value: _ = !1 } = t, { filterable: b = !0 } = t, g, d = !1, m, y, p = "", T = "", C = !1, O = [], P = null, E = null, M;
|
5164 |
const x = El();
|
5165 |
+
s ? (M = a.map((w) => w[1]).indexOf(s), E = M, E === -1 ? (u = s, E = null) : ([p, u] = a[E], T = p), W()) : a.length > 0 && (M = 0, E = 0, [p, s] = a[E], u = s, T = p);
|
5166 |
+
function L() {
|
5167 |
+
n(13, m = a.map((w) => w[0])), n(24, y = a.map((w) => w[1]));
|
5168 |
}
|
5169 |
function W() {
|
5170 |
+
L(), s === void 0 || Array.isArray(s) && s.length === 0 ? (n(9, p = ""), n(11, E = null)) : y.includes(s) ? (n(9, p = m[y.indexOf(s)]), n(11, E = y.indexOf(s))) : _ ? (n(9, p = s), n(11, E = null)) : (n(9, p = ""), n(11, E = null)), n(27, M = E);
|
5171 |
}
|
5172 |
function ee(w) {
|
5173 |
if (n(11, E = parseInt(w.detail.target.dataset.index)), isNaN(E)) {
|
5174 |
n(11, E = null);
|
5175 |
return;
|
5176 |
}
|
5177 |
+
n(12, d = !1), n(14, P = null), g.blur();
|
5178 |
}
|
5179 |
function At(w) {
|
5180 |
n(10, O = a.map((yn, Ze) => Ze)), n(12, d = !0), x("focus");
|
5181 |
}
|
5182 |
+
function Ce() {
|
5183 |
+
_ ? n(20, s = p) : n(9, p = m[y.indexOf(s)]), n(12, d = !1), n(14, P = null), x("blur");
|
5184 |
}
|
5185 |
function Bt(w) {
|
5186 |
+
n(12, [d, P] = fl(w, P, O), d, (n(14, P), n(2, a), n(23, f), n(6, _), n(9, p), n(10, O), n(8, g), n(25, T), n(11, E), n(27, M), n(26, C), n(24, y))), w.key === "Enter" && (P !== null ? (n(11, E = P), n(12, d = !1), g.blur(), n(14, P = null)) : m.includes(p) ? (n(11, E = m.indexOf(p)), n(12, d = !1), n(14, P = null), g.blur()) : _ && (n(20, s = p), n(11, E = null), n(12, d = !1), n(14, P = null), g.blur()), x("enter", s));
|
5187 |
}
|
5188 |
wl(() => {
|
5189 |
n(21, o = !1), n(26, C = !0);
|
5190 |
}), yl(() => {
|
5191 |
g.focus();
|
5192 |
});
|
5193 |
+
function Tt() {
|
5194 |
+
p = this.value, n(9, p), n(11, E), n(27, M), n(26, C), n(2, a), n(24, y);
|
5195 |
}
|
5196 |
+
function Pe(w) {
|
5197 |
cl[w ? "unshift" : "push"](() => {
|
5198 |
g = w, n(8, g);
|
5199 |
});
|
5200 |
}
|
5201 |
+
const ue = (w) => x("key_up", { key: w.key, input_value: p });
|
5202 |
return e.$$set = (w) => {
|
5203 |
+
"label" in w && n(0, i = w.label), "info" in w && n(1, r = w.info), "value" in w && n(20, s = w.value), "value_is_output" in w && n(21, o = w.value_is_output), "choices" in w && n(2, a = w.choices), "disabled" in w && n(3, l = w.disabled), "show_label" in w && n(4, h = w.show_label), "container" in w && n(5, c = w.container), "allow_custom_value" in w && n(6, _ = w.allow_custom_value), "filterable" in w && n(7, b = w.filterable);
|
5204 |
}, e.$$.update = () => {
|
5205 |
e.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/
|
5206 |
+
218105860 && E !== M && E !== null && C && (n(9, [p, s] = a[E], p, (n(20, s), n(11, E), n(27, M), n(26, C), n(2, a), n(24, y))), n(27, M = E), x("select", {
|
5207 |
index: E,
|
5208 |
value: y[E],
|
5209 |
selected: !0
|
5210 |
})), e.$$.dirty[0] & /*value, old_value, value_is_output*/
|
5211 |
7340032 && s != u && (W(), ul(x, s, o), n(22, u = s)), e.$$.dirty[0] & /*choices*/
|
5212 |
+
4 && L(), e.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/
|
5213 |
+
8390468 && a !== f && (_ || W(), n(23, f = a), n(10, O = ni(a, p)), !_ && O.length > 0 && n(14, P = O[0]), g == document.activeElement && n(12, d = !0)), e.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/
|
5214 |
+
33556036 && p !== T && (n(10, O = ni(a, p)), n(25, T = p), !_ && O.length > 0 && n(14, P = O[0]));
|
5215 |
}, [
|
5216 |
i,
|
5217 |
r,
|
5218 |
a,
|
5219 |
l,
|
5220 |
h,
|
5221 |
+
c,
|
5222 |
_,
|
5223 |
b,
|
5224 |
g,
|
|
|
5226 |
O,
|
5227 |
E,
|
5228 |
d,
|
5229 |
+
m,
|
5230 |
+
P,
|
5231 |
x,
|
5232 |
ee,
|
5233 |
At,
|
5234 |
+
Ce,
|
5235 |
Bt,
|
5236 |
s,
|
5237 |
o,
|
5238 |
u,
|
5239 |
f,
|
5240 |
y,
|
5241 |
+
T,
|
5242 |
C,
|
5243 |
+
M,
|
5244 |
+
Tt,
|
5245 |
+
Pe,
|
5246 |
+
ue
|
5247 |
];
|
5248 |
}
|
5249 |
class Al extends hl {
|
|
|
5278 |
create_component: nt,
|
5279 |
destroy_component: it,
|
5280 |
detach: pn,
|
5281 |
+
element: oe,
|
5282 |
+
init: Tl,
|
5283 |
insert: vn,
|
5284 |
mount_component: rt,
|
5285 |
+
safe_not_equal: Cl,
|
5286 |
set_style: st,
|
5287 |
space: Vt,
|
5288 |
text: Xi,
|
|
|
5318 |
};
|
5319 |
}
|
5320 |
function Ml(e) {
|
5321 |
+
let t, n, i, r, s, u, o, a, f, l, h, c, _, b, g;
|
5322 |
return s = new Al({
|
5323 |
props: {
|
5324 |
value: (
|
|
|
5375 |
e[11]
|
5376 |
), {
|
5377 |
c() {
|
5378 |
+
t = oe("div"), n = oe("div"), i = oe("span"), r = oe("div"), nt(s.$$.fragment), u = Vt(), o = oe("div"), nt(a.$$.fragment), f = Vt(), l = oe("div"), nt(h.$$.fragment), c = Vt(), _ = oe("div"), nt(b.$$.fragment), st(r, "margin-right", "10px"), st(o, "margin-right", "40px"), st(o, "margin-bottom", "8px"), st(l, "margin-right", "8px"), tt(i, "class", "model-content svelte-hkn2q1"), tt(n, "class", "modal-container svelte-hkn2q1"), tt(t, "class", "modal svelte-hkn2q1"), tt(t, "id", "model-box-edit");
|
5379 |
},
|
5380 |
+
m(d, m) {
|
5381 |
+
vn(d, t, m), $(t, n), $(n, i), $(i, r), rt(s, r, null), $(i, u), $(i, o), rt(a, o, null), $(i, f), $(i, l), rt(h, l, null), $(i, c), $(i, _), rt(b, _, null), g = !0;
|
5382 |
},
|
5383 |
+
p(d, [m]) {
|
5384 |
const y = {};
|
5385 |
+
m & /*currentLabel*/
|
5386 |
1 && (y.value = /*currentLabel*/
|
5387 |
+
d[0]), m & /*choices*/
|
5388 |
4 && (y.choices = /*choices*/
|
5389 |
d[2]), s.$set(y);
|
5390 |
const p = {};
|
5391 |
+
m & /*currentColor*/
|
5392 |
2 && (p.value = /*currentColor*/
|
5393 |
d[1]), a.$set(p);
|
5394 |
+
const T = {};
|
5395 |
+
m & /*$$scope*/
|
5396 |
+
16384 && (T.$$scope = { dirty: m, ctx: d }), h.$set(T);
|
5397 |
const C = {};
|
5398 |
+
m & /*$$scope*/
|
5399 |
+
16384 && (C.$$scope = { dirty: m, ctx: d }), b.$set(C);
|
5400 |
},
|
5401 |
i(d) {
|
5402 |
g || (ot(s.$$.fragment, d), ot(a.$$.fragment, d), ot(h.$$.fragment, d), ot(b.$$.fragment, d), g = !0);
|
|
|
5412 |
function Rl(e, t, n) {
|
5413 |
let { label: i = "" } = t, { currentLabel: r = "" } = t, { choices: s = [] } = t, { choicesColors: u = [] } = t, { color: o = "" } = t, { currentColor: a = "" } = t;
|
5414 |
const f = Pl();
|
5415 |
+
function l(m) {
|
5416 |
f("change", {
|
5417 |
label: r,
|
5418 |
color: a,
|
5419 |
+
ok: m
|
5420 |
});
|
5421 |
}
|
5422 |
+
function h(m) {
|
5423 |
+
const { detail: y } = m;
|
5424 |
let p = y;
|
5425 |
Number.isInteger(p) ? (Array.isArray(u) && p < u.length && n(1, a = u[p]), Array.isArray(s) && p < s.length && n(0, r = s[p][0])) : n(0, r = p);
|
5426 |
}
|
5427 |
+
function c(m) {
|
5428 |
+
const { detail: y } = m;
|
5429 |
n(1, a = y);
|
5430 |
}
|
5431 |
+
function _(m) {
|
5432 |
+
h(m), l(!0);
|
5433 |
}
|
5434 |
+
function b(m) {
|
5435 |
+
switch (m.key) {
|
5436 |
case "Enter":
|
5437 |
l(!0);
|
5438 |
break;
|
|
|
5444 |
document.removeEventListener("keydown", b);
|
5445 |
});
|
5446 |
const g = () => l(!1), d = () => l(!0);
|
5447 |
+
return e.$$set = (m) => {
|
5448 |
+
"label" in m && n(7, i = m.label), "currentLabel" in m && n(0, r = m.currentLabel), "choices" in m && n(2, s = m.choices), "choicesColors" in m && n(8, u = m.choicesColors), "color" in m && n(9, o = m.color), "currentColor" in m && n(1, a = m.currentColor);
|
5449 |
}, [
|
5450 |
r,
|
5451 |
a,
|
5452 |
s,
|
5453 |
l,
|
5454 |
h,
|
5455 |
+
c,
|
5456 |
_,
|
5457 |
i,
|
5458 |
u,
|
|
|
5463 |
}
|
5464 |
class Vi extends Bl {
|
5465 |
constructor(t) {
|
5466 |
+
super(), Tl(this, t, Rl, Ml, Cl, {
|
5467 |
label: 7,
|
5468 |
currentLabel: 0,
|
5469 |
choices: 2,
|
|
|
5484 |
return `rgba(${i}, ${r}, ${s}, ${t})`;
|
5485 |
}
|
5486 |
class Wt {
|
5487 |
+
constructor(t, n, i, r, s, u, o, a, f, l, h = "rgb(255, 255, 255)", c = 0.5, _ = 25, b = 1) {
|
5488 |
this.stopDrag = () => {
|
5489 |
this.isDragging = !1, document.removeEventListener("mousemove", this.handleDrag), document.removeEventListener("mouseup", this.stopDrag);
|
5490 |
}, this.handleDrag = (g) => {
|
5491 |
if (this.isDragging) {
|
5492 |
+
let d = g.clientX - this.offsetMouseX - this.xmin, m = g.clientY - this.offsetMouseY - this.ymin;
|
5493 |
const y = this.canvasXmax - this.canvasXmin, p = this.canvasYmax - this.canvasYmin;
|
5494 |
+
d = J(d, -this.xmin, y - this.xmax), m = J(m, -this.ymin, p - this.ymax), this.xmin += d, this.ymin += m, this.xmax += d, this.ymax += m, this.updateHandles(), this.renderCallBack();
|
5495 |
}
|
5496 |
}, this.handleResize = (g) => {
|
5497 |
if (this.isResizing) {
|
5498 |
+
const d = g.clientX, m = g.clientY, y = d - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, p = m - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, T = this.canvasXmax - this.canvasXmin, C = this.canvasYmax - this.canvasYmin;
|
5499 |
switch (this.resizingHandleIndex) {
|
5500 |
case 0:
|
5501 |
this.xmin += y, this.ymin += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymin = J(this.ymin, 0, this.ymax - this.minSize);
|
5502 |
break;
|
5503 |
case 1:
|
5504 |
+
this.xmax += y, this.ymin += p, this.xmax = J(this.xmax, this.xmin + this.minSize, T), this.ymin = J(this.ymin, 0, this.ymax - this.minSize);
|
5505 |
break;
|
5506 |
case 2:
|
5507 |
+
this.xmax += y, this.ymax += p, this.xmax = J(this.xmax, this.xmin + this.minSize, T), this.ymax = J(this.ymax, this.ymin + this.minSize, C);
|
5508 |
break;
|
5509 |
case 3:
|
5510 |
this.xmin += y, this.ymax += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymax = J(this.ymax, this.ymin + this.minSize, C);
|
|
|
5514 |
}
|
5515 |
}, this.stopResize = () => {
|
5516 |
this.isResizing = !1, document.removeEventListener("mousemove", this.handleResize), document.removeEventListener("mouseup", this.stopResize);
|
5517 |
+
}, this.renderCallBack = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = r, this.canvasYmax = s, this.scaleFactor = b, this.label = u, this.isDragging = !1, this.xmin = o, this.ymin = a, this.xmax = f, this.ymax = l, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = 8, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = _, this.color = h, this.alpha = c;
|
5518 |
}
|
5519 |
toJSON() {
|
5520 |
return {
|
|
|
5628 |
];
|
5629 |
const {
|
5630 |
SvelteComponent: kl,
|
5631 |
+
append: ge,
|
5632 |
+
attr: ae,
|
5633 |
binding_callbacks: Dl,
|
5634 |
bubble: si,
|
5635 |
check_outros: Yt,
|
5636 |
create_component: De,
|
5637 |
destroy_component: Ue,
|
5638 |
+
detach: pe,
|
5639 |
+
element: Ee,
|
5640 |
empty: Ul,
|
5641 |
group_outros: Zt,
|
5642 |
init: Gl,
|
5643 |
+
insert: ve,
|
5644 |
+
listen: ie,
|
5645 |
mount_component: Ge,
|
5646 |
noop: Fl,
|
5647 |
run_all: qi,
|
|
|
5651 |
transition_out: q
|
5652 |
} = window.__gradio__svelte__internal, { onMount: jl, onDestroy: Xl, createEventDispatcher: Vl } = window.__gradio__svelte__internal;
|
5653 |
function oi(e) {
|
5654 |
+
let t, n, i, r, s, u, o, a, f, l, h, c;
|
5655 |
return i = new Gr({}), u = new Or({}), f = new gr({}), {
|
5656 |
c() {
|
5657 |
+
t = Ee("span"), n = Ee("button"), De(i.$$.fragment), r = Fe(), s = Ee("button"), De(u.$$.fragment), o = Fe(), a = Ee("button"), De(f.$$.fragment), ae(n, "class", "icon svelte-182gnnj"), ae(s, "class", "icon svelte-182gnnj"), ae(a, "class", "icon svelte-182gnnj"), ae(t, "class", "canvas-control svelte-182gnnj");
|
5658 |
},
|
5659 |
m(_, b) {
|
5660 |
+
ve(_, t, b), ge(t, n), Ge(i, n, null), ge(t, r), ge(t, s), Ge(u, s, null), ge(t, o), ge(t, a), Ge(f, a, null), l = !0, h || (c = [
|
5661 |
+
ie(
|
5662 |
n,
|
5663 |
"click",
|
5664 |
/*click_handler*/
|
5665 |
e[22]
|
5666 |
),
|
5667 |
+
ie(
|
5668 |
s,
|
5669 |
"click",
|
5670 |
/*click_handler_1*/
|
5671 |
e[23]
|
5672 |
),
|
5673 |
+
ie(
|
5674 |
a,
|
5675 |
"click",
|
5676 |
/*click_handler_2*/
|
|
|
5686 |
q(i.$$.fragment, _), q(u.$$.fragment, _), q(f.$$.fragment, _), l = !1;
|
5687 |
},
|
5688 |
d(_) {
|
5689 |
+
_ && pe(t), Ue(i), Ue(u), Ue(f), h = !1, qi(c);
|
5690 |
}
|
5691 |
};
|
5692 |
}
|
|
|
5857 |
), h = (
|
5858 |
/*editModalVisible*/
|
5859 |
e[6] && ai(e)
|
5860 |
+
), c = (
|
5861 |
/*newModalVisible*/
|
5862 |
e[7] && li(e)
|
5863 |
);
|
5864 |
return {
|
5865 |
c() {
|
5866 |
+
t = Ee("div"), n = Ee("canvas"), i = Fe(), l && l.c(), r = Fe(), h && h.c(), s = Fe(), c && c.c(), u = Ul(), ae(n, "class", "canvas-annotator svelte-182gnnj"), ae(t, "class", "canvas-container svelte-182gnnj"), ae(t, "tabindex", "-1");
|
5867 |
},
|
5868 |
m(_, b) {
|
5869 |
+
ve(_, t, b), ge(t, n), e[21](n), ve(_, i, b), l && l.m(_, b), ve(_, r, b), h && h.m(_, b), ve(_, s, b), c && c.m(_, b), ve(_, u, b), o = !0, a || (f = [
|
5870 |
+
ie(
|
5871 |
n,
|
5872 |
"mousedown",
|
5873 |
/*handleMouseDown*/
|
5874 |
e[8]
|
5875 |
),
|
5876 |
+
ie(
|
5877 |
n,
|
5878 |
"mouseup",
|
5879 |
/*handleMouseUp*/
|
5880 |
e[9]
|
5881 |
),
|
5882 |
+
ie(
|
5883 |
n,
|
5884 |
"dblclick",
|
5885 |
/*handleDoubleClick*/
|
5886 |
e[13]
|
5887 |
),
|
5888 |
+
ie(
|
5889 |
t,
|
5890 |
"focusin",
|
5891 |
/*handleCanvasFocus*/
|
5892 |
e[16]
|
5893 |
),
|
5894 |
+
ie(
|
5895 |
t,
|
5896 |
"focusout",
|
5897 |
/*handleCanvasBlur*/
|
|
|
5909 |
64 && G(h, 1)) : (h = ai(_), h.c(), G(h, 1), h.m(s.parentNode, s)) : h && (Zt(), q(h, 1, 1, () => {
|
5910 |
h = null;
|
5911 |
}), Yt()), /*newModalVisible*/
|
5912 |
+
_[7] ? c ? (c.p(_, b), b[0] & /*newModalVisible*/
|
5913 |
+
128 && G(c, 1)) : (c = li(_), c.c(), G(c, 1), c.m(u.parentNode, u)) : c && (Zt(), q(c, 1, 1, () => {
|
5914 |
+
c = null;
|
5915 |
}), Yt());
|
5916 |
},
|
5917 |
i(_) {
|
5918 |
+
o || (G(l), G(h), G(c), o = !0);
|
5919 |
},
|
5920 |
o(_) {
|
5921 |
+
q(l), q(h), q(c), o = !1;
|
5922 |
},
|
5923 |
d(_) {
|
5924 |
+
_ && (pe(t), pe(i), pe(r), pe(s), pe(u)), e[21](null), l && l.d(_), h && h.d(_), c && c.d(_), a = !1, qi(f);
|
5925 |
}
|
5926 |
};
|
5927 |
}
|
|
|
5934 |
return "#" + (1 << 24 | n << 16 | i << 8 | r).toString(16).slice(1);
|
5935 |
}
|
5936 |
function Wl(e, t, n) {
|
5937 |
+
let { imageUrl: i = null } = t, { interactive: r } = t, { boxAlpha: s = 0.5 } = t, { boxMinSize: u = 25 } = t, { value: o } = t, { choices: a = [] } = t, { choicesColors: f = [] } = t, l, h, c = null, _ = -1, b = 0, g = 0, d = 0, m = 0, y = 1, p = 0, T = 0, C = !1, O = !1;
|
5938 |
+
const P = Vl();
|
5939 |
function E() {
|
5940 |
if (h) {
|
5941 |
+
h.clearRect(0, 0, l.width, l.height), c !== null && h.drawImage(c, b, g, p, T);
|
5942 |
for (const v of o.boxes.slice().reverse())
|
5943 |
v.render(h);
|
5944 |
}
|
5945 |
}
|
5946 |
+
function M(v) {
|
5947 |
+
n(5, _ = v), o.boxes.forEach((A) => {
|
5948 |
+
A.setSelected(!1);
|
5949 |
}), v >= 0 && v < o.boxes.length && o.boxes[v].setSelected(!0), E();
|
5950 |
}
|
5951 |
function x(v) {
|
5952 |
if (!r)
|
5953 |
return;
|
5954 |
+
const A = l.getBoundingClientRect(), R = v.clientX - A.left, U = v.clientY - A.top;
|
5955 |
+
for (const [Ie, Y] of o.boxes.entries()) {
|
5956 |
+
const Qe = Y.indexOfPointInsideHandle(R, U);
|
5957 |
if (Qe >= 0) {
|
5958 |
+
M(Ie), Y.startResize(Qe, v);
|
5959 |
return;
|
5960 |
}
|
5961 |
}
|
5962 |
+
for (const [Ie, Y] of o.boxes.entries())
|
5963 |
+
if (Y.isPointInsideBox(R, U)) {
|
5964 |
+
M(Ie), Y.startDrag(v);
|
5965 |
return;
|
5966 |
}
|
5967 |
+
M(-1);
|
5968 |
}
|
5969 |
+
function L(v) {
|
5970 |
+
P("change");
|
5971 |
}
|
5972 |
function W(v) {
|
5973 |
if (r)
|
5974 |
switch (v.key) {
|
5975 |
case "Delete":
|
5976 |
+
Pe();
|
5977 |
break;
|
5978 |
}
|
5979 |
}
|
|
|
5982 |
}
|
5983 |
function At(v) {
|
5984 |
n(7, O = !1);
|
5985 |
+
const { detail: A } = v;
|
5986 |
+
let R = A.label, U = A.color;
|
5987 |
+
if (A.ok) {
|
5988 |
+
U === null || U === "" ? U = K[o.boxes.length % K.length] : U = ui(U);
|
5989 |
+
let Y = p / 3 / y, Qe = p / 3 * 2 / y, tr = T / 3 / y, nr = T / 3 * 2 / y, ir = new Wt(E, b, g, d, m, R, Math.round(Y), Math.round(tr), Math.round(Qe), Math.round(nr), U, s, u);
|
5990 |
+
n(0, o.boxes = [ir, ...o.boxes], o), E(), P("change");
|
5991 |
}
|
5992 |
}
|
5993 |
+
function Ce() {
|
5994 |
_ >= 0 && _ < o.boxes.length && n(6, C = !0);
|
5995 |
}
|
5996 |
function Bt(v) {
|
5997 |
+
r && Ce();
|
5998 |
}
|
5999 |
+
function Tt(v) {
|
6000 |
n(6, C = !1);
|
6001 |
+
const { detail: A } = v;
|
6002 |
+
let R = A.label, U = A.color;
|
6003 |
+
if (A.ok && _ >= 0 && _ < o.boxes.length) {
|
6004 |
let Y = o.boxes[_];
|
6005 |
+
Y.label = R, Y.color = ui(U), E(), P("change");
|
6006 |
}
|
6007 |
}
|
6008 |
+
function Pe() {
|
6009 |
+
_ >= 0 && _ < o.boxes.length && (o.boxes.splice(_, 1), M(-1), P("change"));
|
6010 |
}
|
6011 |
+
function ue() {
|
6012 |
if (l) {
|
6013 |
+
if (y = 1, n(4, l.width = l.clientWidth, l), c !== null)
|
6014 |
+
if (c.width > l.width)
|
6015 |
+
y = l.width / c.width, p = c.width * y, T = c.height * y, b = 0, g = 0, d = p, m = T, n(4, l.height = T, l);
|
6016 |
else {
|
6017 |
+
p = c.width, T = c.height;
|
6018 |
var v = (l.width - p) / 2;
|
6019 |
+
b = v, g = 0, d = v + p, m = c.height, n(4, l.height = T, l);
|
6020 |
}
|
6021 |
else
|
6022 |
+
b = 0, g = 0, d = l.width, m = l.height, n(4, l.height = l.clientHeight, l);
|
6023 |
+
if (d > 0 && m > 0)
|
6024 |
+
for (const A of o.boxes)
|
6025 |
+
A.canvasXmin = b, A.canvasYmin = g, A.canvasXmax = d, A.canvasYmax = m, A.setScaleFactor(y);
|
6026 |
+
E(), P("change");
|
6027 |
}
|
6028 |
}
|
6029 |
+
const w = new ResizeObserver(ue);
|
6030 |
function yn() {
|
6031 |
+
for (let v = 0; v < o.boxes.length; v++) {
|
6032 |
+
let A = o.boxes[v];
|
6033 |
+
if (!(A instanceof Wt)) {
|
6034 |
+
let R = "", U = "";
|
6035 |
+
A.hasOwnProperty("color") ? (R = A.color, Array.isArray(R) && R.length === 3 && (R = `rgb(${R[0]}, ${R[1]}, ${R[2]})`)) : R = K[v % K.length], A.hasOwnProperty("label") && (U = A.label), A = new Wt(E, b, g, d, m, U, A.xmin, A.ymin, A.xmax, A.ymax, R, s, u), n(0, o.boxes[v] = A, o);
|
|
|
6036 |
}
|
|
|
6037 |
}
|
|
|
6038 |
}
|
6039 |
function Ze() {
|
6040 |
+
i !== null && (c === null || c.src != i) && (c = new Image(), c.src = i, c.onload = function() {
|
6041 |
+
ue(), E();
|
6042 |
});
|
6043 |
}
|
6044 |
jl(() => {
|
6045 |
if (Array.isArray(a) && a.length > 0 && (!Array.isArray(f) || f.length == 0))
|
6046 |
for (let v = 0; v < a.length; v++) {
|
6047 |
+
let A = K[v % K.length];
|
6048 |
+
f.push(Xe(A));
|
6049 |
}
|
6050 |
+
h = l.getContext("2d"), w.observe(l), Ze(), ue(), E();
|
6051 |
});
|
6052 |
function Wi() {
|
6053 |
document.addEventListener("keydown", W);
|
|
|
6063 |
l = v, n(4, l);
|
6064 |
});
|
6065 |
}
|
6066 |
+
const Qi = () => ee(), Ji = () => Ce(), Ki = () => Pe();
|
6067 |
function $i(v) {
|
6068 |
si.call(this, e, v);
|
6069 |
}
|
|
|
6074 |
"imageUrl" in v && n(18, i = v.imageUrl), "interactive" in v && n(1, r = v.interactive), "boxAlpha" in v && n(19, s = v.boxAlpha), "boxMinSize" in v && n(20, u = v.boxMinSize), "value" in v && n(0, o = v.value), "choices" in v && n(2, a = v.choices), "choicesColors" in v && n(3, f = v.choicesColors);
|
6075 |
}, e.$$.update = () => {
|
6076 |
e.$$.dirty[0] & /*value*/
|
6077 |
+
1 && (Ze(), yn(), ue(), E());
|
6078 |
}, [
|
6079 |
o,
|
6080 |
r,
|
|
|
6085 |
C,
|
6086 |
O,
|
6087 |
x,
|
6088 |
+
L,
|
6089 |
ee,
|
6090 |
At,
|
6091 |
+
Ce,
|
6092 |
Bt,
|
6093 |
+
Tt,
|
6094 |
+
Pe,
|
6095 |
Wi,
|
6096 |
Yi,
|
6097 |
i,
|
|
|
6217 |
}
|
6218 |
function lu(e, t, n) {
|
6219 |
let { src: i = void 0 } = t, { interactive: r } = t, { boxesAlpha: s } = t, { labelList: u } = t, { labelColors: o } = t, { boxMinSize: a } = t, { value: f } = t, l, h;
|
6220 |
+
const c = ou();
|
6221 |
function _(g) {
|
6222 |
f = g, n(0, f);
|
6223 |
}
|
6224 |
+
const b = () => c("change");
|
6225 |
return e.$$set = (g) => {
|
6226 |
"src" in g && n(8, i = g.src), "interactive" in g && n(1, r = g.interactive), "boxesAlpha" in g && n(2, s = g.boxesAlpha), "labelList" in g && n(3, u = g.labelList), "labelColors" in g && n(4, o = g.labelColors), "boxMinSize" in g && n(5, a = g.boxMinSize), "value" in g && n(0, f = g.value);
|
6227 |
}, e.$$.update = () => {
|
|
|
6241 |
o,
|
6242 |
a,
|
6243 |
l,
|
6244 |
+
c,
|
6245 |
i,
|
6246 |
h,
|
6247 |
_,
|
|
|
6274 |
insert: vu,
|
6275 |
mount_component: yu,
|
6276 |
safe_not_equal: Eu,
|
6277 |
+
toggle_class: ne,
|
6278 |
transition_in: mt,
|
6279 |
transition_out: hn
|
6280 |
} = window.__gradio__svelte__internal;
|
|
|
6321 |
);
|
6322 |
return {
|
6323 |
c() {
|
6324 |
+
t = bu("div"), i && i.c(), hu(t, "class", "container svelte-1sgcyba"), ne(
|
6325 |
t,
|
6326 |
"table",
|
6327 |
/*type*/
|
6328 |
e[2] === "table"
|
6329 |
+
), ne(
|
6330 |
t,
|
6331 |
"gallery",
|
6332 |
/*type*/
|
6333 |
e[2] === "gallery"
|
6334 |
+
), ne(
|
6335 |
t,
|
6336 |
"selected",
|
6337 |
/*selected*/
|
6338 |
e[3]
|
6339 |
+
), ne(
|
6340 |
t,
|
6341 |
"border",
|
6342 |
/*value*/
|
|
|
6352 |
1 && mt(i, 1)) : (i = fi(r), i.c(), mt(i, 1), i.m(t, null)) : i && (gu(), hn(i, 1, 1, () => {
|
6353 |
i = null;
|
6354 |
}), cu()), (!n || s & /*type*/
|
6355 |
+
4) && ne(
|
6356 |
t,
|
6357 |
"table",
|
6358 |
/*type*/
|
6359 |
r[2] === "table"
|
6360 |
), (!n || s & /*type*/
|
6361 |
+
4) && ne(
|
6362 |
t,
|
6363 |
"gallery",
|
6364 |
/*type*/
|
6365 |
r[2] === "gallery"
|
6366 |
), (!n || s & /*selected*/
|
6367 |
+
8) && ne(
|
6368 |
t,
|
6369 |
"selected",
|
6370 |
/*selected*/
|
6371 |
r[3]
|
6372 |
), (!n || s & /*value*/
|
6373 |
+
1) && ne(
|
6374 |
t,
|
6375 |
"border",
|
6376 |
/*value*/
|
src/demo/app.py
CHANGED
@@ -27,12 +27,7 @@ def crop(annotations):
|
|
27 |
|
28 |
|
29 |
def get_boxes_json(annotations):
|
30 |
-
return [
|
31 |
-
{k: box[k]
|
32 |
-
for k in box if k in ("xmin", "ymin", "xmax", "ymax", "label")}
|
33 |
-
for box in annotations["boxes"]
|
34 |
-
]
|
35 |
-
|
36 |
|
37 |
with gr.Blocks() as demo:
|
38 |
with gr.Tab("Object annotation"):
|
|
|
27 |
|
28 |
|
29 |
def get_boxes_json(annotations):
|
30 |
+
return annotations["boxes"]
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
with gr.Blocks() as demo:
|
33 |
with gr.Tab("Object annotation"):
|
src/demo/space.py
CHANGED
@@ -67,12 +67,7 @@ def crop(annotations):
|
|
67 |
|
68 |
|
69 |
def get_boxes_json(annotations):
|
70 |
-
return [
|
71 |
-
{k: box[k]
|
72 |
-
for k in box if k in ("xmin", "ymin", "xmax", "ymax", "label")}
|
73 |
-
for box in annotations["boxes"]
|
74 |
-
]
|
75 |
-
|
76 |
|
77 |
with gr.Blocks() as demo:
|
78 |
with gr.Tab("Object annotation"):
|
|
|
67 |
|
68 |
|
69 |
def get_boxes_json(annotations):
|
70 |
+
return annotations["boxes"]
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
with gr.Blocks() as demo:
|
73 |
with gr.Tab("Object annotation"):
|
src/frontend/shared/Box.ts
CHANGED
@@ -67,8 +67,10 @@ export default class Box {
|
|
67 |
this.scaleFactor = scaleFactor;
|
68 |
this.label = label;
|
69 |
this.isDragging = false;
|
70 |
-
|
71 |
-
|
|
|
|
|
72 |
this.isResizing = false;
|
73 |
this.isSelected = false;
|
74 |
this.offsetMouseX = 0;
|
|
|
67 |
this.scaleFactor = scaleFactor;
|
68 |
this.label = label;
|
69 |
this.isDragging = false;
|
70 |
+
this.xmin = xmin;
|
71 |
+
this.ymin = ymin;
|
72 |
+
this.xmax = xmax;
|
73 |
+
this.ymax = ymax;
|
74 |
this.isResizing = false;
|
75 |
this.isSelected = false;
|
76 |
this.offsetMouseX = 0;
|
src/frontend/shared/Canvas.svelte
CHANGED
@@ -135,10 +135,10 @@
|
|
135 |
} else {
|
136 |
color = colorHexToRGB(color);
|
137 |
}
|
138 |
-
let xmin =
|
139 |
-
let xmax =
|
140 |
-
let ymin =
|
141 |
-
let ymax =
|
142 |
let box = new Box(
|
143 |
draw,
|
144 |
canvasXmin,
|
@@ -153,7 +153,6 @@
|
|
153 |
color,
|
154 |
boxAlpha,
|
155 |
boxMinSize,
|
156 |
-
scaleFactor
|
157 |
);
|
158 |
value.boxes = [box, ...value.boxes];
|
159 |
draw();
|
@@ -245,7 +244,6 @@
|
|
245 |
const observer = new ResizeObserver(resize);
|
246 |
|
247 |
function parseInputBoxes() {
|
248 |
-
let newBoxes = [];
|
249 |
for (let i = 0; i < value.boxes.length; i++) {
|
250 |
let box = value.boxes[i];
|
251 |
if (!(box instanceof Box)) {
|
@@ -257,7 +255,7 @@
|
|
257 |
color = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
|
258 |
}
|
259 |
} else {
|
260 |
-
color = Colors[
|
261 |
}
|
262 |
if (box.hasOwnProperty("label")) {
|
263 |
label = box["label"];
|
@@ -276,12 +274,10 @@
|
|
276 |
color,
|
277 |
boxAlpha,
|
278 |
boxMinSize,
|
279 |
-
scaleFactor
|
280 |
);
|
|
|
281 |
}
|
282 |
-
newBoxes.push(box);
|
283 |
}
|
284 |
-
value.boxes = newBoxes;
|
285 |
}
|
286 |
|
287 |
$: {
|
|
|
135 |
} else {
|
136 |
color = colorHexToRGB(color);
|
137 |
}
|
138 |
+
let xmin = (imageWidth / 3) / scaleFactor;
|
139 |
+
let xmax = ((imageWidth / 3)*2) / scaleFactor;
|
140 |
+
let ymin = (imageHeight / 3) / scaleFactor;
|
141 |
+
let ymax = ((imageHeight / 3)*2) / scaleFactor;
|
142 |
let box = new Box(
|
143 |
draw,
|
144 |
canvasXmin,
|
|
|
153 |
color,
|
154 |
boxAlpha,
|
155 |
boxMinSize,
|
|
|
156 |
);
|
157 |
value.boxes = [box, ...value.boxes];
|
158 |
draw();
|
|
|
244 |
const observer = new ResizeObserver(resize);
|
245 |
|
246 |
function parseInputBoxes() {
|
|
|
247 |
for (let i = 0; i < value.boxes.length; i++) {
|
248 |
let box = value.boxes[i];
|
249 |
if (!(box instanceof Box)) {
|
|
|
255 |
color = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
|
256 |
}
|
257 |
} else {
|
258 |
+
color = Colors[i % Colors.length];
|
259 |
}
|
260 |
if (box.hasOwnProperty("label")) {
|
261 |
label = box["label"];
|
|
|
274 |
color,
|
275 |
boxAlpha,
|
276 |
boxMinSize,
|
|
|
277 |
);
|
278 |
+
value.boxes[i] = box;
|
279 |
}
|
|
|
280 |
}
|
|
|
281 |
}
|
282 |
|
283 |
$: {
|
src/pyproject.toml
CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_image_annotation"
|
11 |
-
version = "0.0.
|
12 |
description = "A Gradio component that can be used to annotate images with bounding boxes."
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
@@ -40,7 +40,7 @@ Issues = "https://github.com/edgarGracia/gradio_image_annotator/issues"
|
|
40 |
dev = ["build", "twine"]
|
41 |
|
42 |
[tool.hatch.build]
|
43 |
-
artifacts = ["/backend/gradio_image_annotation/templates", "*.pyi", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates"]
|
44 |
|
45 |
[tool.hatch.build.targets.wheel]
|
46 |
packages = ["/backend/gradio_image_annotation"]
|
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_image_annotation"
|
11 |
+
version = "0.0.6"
|
12 |
description = "A Gradio component that can be used to annotate images with bounding boxes."
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
|
|
40 |
dev = ["build", "twine"]
|
41 |
|
42 |
[tool.hatch.build]
|
43 |
+
artifacts = ["/backend/gradio_image_annotation/templates", "*.pyi", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates", "backend/gradio_image_annotation/templates"]
|
44 |
|
45 |
[tool.hatch.build.targets.wheel]
|
46 |
packages = ["/backend/gradio_image_annotation"]
|