diff --git "a/src/backend/gradio_image_annotation/templates/component/index.js" "b/src/backend/gradio_image_annotation/templates/component/index.js"
--- "a/src/backend/gradio_image_annotation/templates/component/index.js"
+++ "b/src/backend/gradio_image_annotation/templates/component/index.js"
@@ -1,28 +1,28 @@
const {
- SvelteComponent: na,
- assign: la,
- create_slot: ia,
- detach: oa,
- element: sa,
- get_all_dirty_from_scope: aa,
- get_slot_changes: ra,
- get_spread_update: fa,
- init: ua,
- insert: ca,
- safe_not_equal: _a,
- set_dynamic_element_data: ki,
- set_style: ge,
+ SvelteComponent: ra,
+ assign: fa,
+ create_slot: ua,
+ detach: ca,
+ element: _a,
+ get_all_dirty_from_scope: da,
+ get_slot_changes: ha,
+ get_spread_update: ma,
+ init: ba,
+ insert: ga,
+ safe_not_equal: wa,
+ set_dynamic_element_data: Bi,
+ set_style: pe,
toggle_class: He,
- transition_in: xo,
- transition_out: $o,
- update_slot_base: da
+ transition_in: lo,
+ transition_out: io,
+ update_slot_base: pa
} = window.__gradio__svelte__internal;
-function ha(l) {
+function ka(l) {
let e, t, n;
const i = (
/*#slots*/
l[18].default
- ), o = ia(
+ ), s = ua(
i,
l,
/*$$scope*/
@@ -43,14 +43,14 @@ function ha(l) {
l[3].join(" ") + " svelte-nl1om8"
}
], r = {};
- for (let s = 0; s < a.length; s += 1)
- r = la(r, a[s]);
+ for (let o = 0; o < a.length; o += 1)
+ r = fa(r, a[o]);
return {
c() {
- e = sa(
+ e = _a(
/*tag*/
l[14]
- ), o && o.c(), ki(
+ ), s && s.c(), Bi(
/*tag*/
l[14]
)(e, r), He(
@@ -75,7 +75,7 @@ function ha(l) {
l[5] === "contrast"
), He(e, "hide-container", !/*explicit_call*/
l[8] && !/*container*/
- l[9]), ge(
+ l[9]), pe(
e,
"height",
/*get_dimension*/
@@ -83,7 +83,7 @@ function ha(l) {
/*height*/
l[0]
)
- ), ge(e, "width", typeof /*width*/
+ ), pe(e, "width", typeof /*width*/
l[1] == "number" ? `calc(min(${/*width*/
l[1]}px, 100%))` : (
/*get_dimension*/
@@ -91,140 +91,140 @@ function ha(l) {
/*width*/
l[1]
)
- )), ge(
+ )), pe(
e,
"border-style",
/*variant*/
l[4]
- ), ge(
+ ), pe(
e,
"overflow",
/*allow_overflow*/
l[11] ? "visible" : "hidden"
- ), ge(
+ ), pe(
e,
"flex-grow",
/*scale*/
l[12]
- ), ge(e, "min-width", `calc(min(${/*min_width*/
- l[13]}px, 100%))`), ge(e, "border-width", "var(--block-border-width)");
+ ), pe(e, "min-width", `calc(min(${/*min_width*/
+ l[13]}px, 100%))`), pe(e, "border-width", "var(--block-border-width)");
},
- m(s, f) {
- ca(s, e, f), o && o.m(e, null), n = !0;
+ m(o, f) {
+ ga(o, e, f), s && s.m(e, null), n = !0;
},
- p(s, f) {
- o && o.p && (!n || f & /*$$scope*/
- 131072) && da(
- o,
- i,
+ p(o, f) {
+ s && s.p && (!n || f & /*$$scope*/
+ 131072) && pa(
s,
+ i,
+ o,
/*$$scope*/
- s[17],
- n ? ra(
+ o[17],
+ n ? ha(
i,
/*$$scope*/
- s[17],
+ o[17],
f,
null
- ) : aa(
+ ) : da(
/*$$scope*/
- s[17]
+ o[17]
),
null
- ), ki(
+ ), Bi(
/*tag*/
- s[14]
- )(e, r = fa(a, [
+ o[14]
+ )(e, r = ma(a, [
(!n || f & /*test_id*/
128) && { "data-testid": (
/*test_id*/
- s[7]
+ o[7]
) },
(!n || f & /*elem_id*/
4) && { id: (
/*elem_id*/
- s[2]
+ o[2]
) },
(!n || f & /*elem_classes*/
8 && t !== (t = "block " + /*elem_classes*/
- s[3].join(" ") + " svelte-nl1om8")) && { class: t }
+ o[3].join(" ") + " svelte-nl1om8")) && { class: t }
])), He(
e,
"hidden",
/*visible*/
- s[10] === !1
+ o[10] === !1
), He(
e,
"padded",
/*padding*/
- s[6]
+ o[6]
), He(
e,
"border_focus",
/*border_mode*/
- s[5] === "focus"
+ o[5] === "focus"
), He(
e,
"border_contrast",
/*border_mode*/
- s[5] === "contrast"
+ o[5] === "contrast"
), He(e, "hide-container", !/*explicit_call*/
- s[8] && !/*container*/
- s[9]), f & /*height*/
- 1 && ge(
+ o[8] && !/*container*/
+ o[9]), f & /*height*/
+ 1 && pe(
e,
"height",
/*get_dimension*/
- s[15](
+ o[15](
/*height*/
- s[0]
+ o[0]
)
), f & /*width*/
- 2 && ge(e, "width", typeof /*width*/
- s[1] == "number" ? `calc(min(${/*width*/
- s[1]}px, 100%))` : (
+ 2 && pe(e, "width", typeof /*width*/
+ o[1] == "number" ? `calc(min(${/*width*/
+ o[1]}px, 100%))` : (
/*get_dimension*/
- s[15](
+ o[15](
/*width*/
- s[1]
+ o[1]
)
)), f & /*variant*/
- 16 && ge(
+ 16 && pe(
e,
"border-style",
/*variant*/
- s[4]
+ o[4]
), f & /*allow_overflow*/
- 2048 && ge(
+ 2048 && pe(
e,
"overflow",
/*allow_overflow*/
- s[11] ? "visible" : "hidden"
+ o[11] ? "visible" : "hidden"
), f & /*scale*/
- 4096 && ge(
+ 4096 && pe(
e,
"flex-grow",
/*scale*/
- s[12]
+ o[12]
), f & /*min_width*/
- 8192 && ge(e, "min-width", `calc(min(${/*min_width*/
- s[13]}px, 100%))`);
+ 8192 && pe(e, "min-width", `calc(min(${/*min_width*/
+ o[13]}px, 100%))`);
},
- i(s) {
- n || (xo(o, s), n = !0);
+ i(o) {
+ n || (lo(s, o), n = !0);
},
- o(s) {
- $o(o, s), n = !1;
+ o(o) {
+ io(s, o), n = !1;
},
- d(s) {
- s && oa(e), o && o.d(s);
+ d(o) {
+ o && ca(e), s && s.d(o);
}
};
}
-function ma(l) {
+function va(l) {
let e, t = (
/*tag*/
- l[14] && ha(l)
+ l[14] && ka(l)
);
return {
c() {
@@ -238,19 +238,19 @@ function ma(l) {
n[14] && t.p(n, i);
},
i(n) {
- e || (xo(t, n), e = !0);
+ e || (lo(t, n), e = !0);
},
o(n) {
- $o(t, n), e = !1;
+ io(t, n), e = !1;
},
d(n) {
t && t.d(n);
}
};
}
-function ba(l, e, t) {
- let { $$slots: n = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: a = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: s = [] } = e, { variant: f = "solid" } = e, { border_mode: u = "base" } = e, { padding: c = !0 } = e, { type: _ = "normal" } = e, { test_id: d = void 0 } = e, { explicit_call: h = !1 } = e, { container: b = !0 } = e, { visible: m = !0 } = e, { allow_overflow: w = !0 } = e, { scale: k = null } = e, { min_width: g = 0 } = e, S = _ === "fieldset" ? "fieldset" : "div";
- const M = (y) => {
+function ya(l, e, t) {
+ let { $$slots: n = {}, $$scope: i } = e, { height: s = void 0 } = e, { width: a = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: o = [] } = e, { variant: f = "solid" } = e, { border_mode: u = "base" } = e, { padding: c = !0 } = e, { type: d = "normal" } = e, { test_id: _ = void 0 } = e, { explicit_call: b = !1 } = e, { container: h = !0 } = e, { visible: w = !0 } = e, { allow_overflow: g = !0 } = e, { scale: p = null } = e, { min_width: m = 0 } = e, C = d === "fieldset" ? "fieldset" : "div";
+ const z = (y) => {
if (y !== void 0) {
if (typeof y == "number")
return y + "px";
@@ -259,32 +259,32 @@ function ba(l, e, t) {
}
};
return l.$$set = (y) => {
- "height" in y && t(0, o = y.height), "width" in y && t(1, a = y.width), "elem_id" in y && t(2, r = y.elem_id), "elem_classes" in y && t(3, s = y.elem_classes), "variant" in y && t(4, f = y.variant), "border_mode" in y && t(5, u = y.border_mode), "padding" in y && t(6, c = y.padding), "type" in y && t(16, _ = y.type), "test_id" in y && t(7, d = y.test_id), "explicit_call" in y && t(8, h = y.explicit_call), "container" in y && t(9, b = y.container), "visible" in y && t(10, m = y.visible), "allow_overflow" in y && t(11, w = y.allow_overflow), "scale" in y && t(12, k = y.scale), "min_width" in y && t(13, g = y.min_width), "$$scope" in y && t(17, i = y.$$scope);
+ "height" in y && t(0, s = y.height), "width" in y && t(1, a = y.width), "elem_id" in y && t(2, r = y.elem_id), "elem_classes" in y && t(3, o = y.elem_classes), "variant" in y && t(4, f = y.variant), "border_mode" in y && t(5, u = y.border_mode), "padding" in y && t(6, c = y.padding), "type" in y && t(16, d = y.type), "test_id" in y && t(7, _ = y.test_id), "explicit_call" in y && t(8, b = y.explicit_call), "container" in y && t(9, h = y.container), "visible" in y && t(10, w = y.visible), "allow_overflow" in y && t(11, g = y.allow_overflow), "scale" in y && t(12, p = y.scale), "min_width" in y && t(13, m = y.min_width), "$$scope" in y && t(17, i = y.$$scope);
}, [
- o,
+ s,
a,
r,
- s,
+ o,
f,
u,
c,
- d,
- h,
+ _,
b,
- m,
+ h,
w,
- k,
g,
- S,
- M,
- _,
+ p,
+ m,
+ C,
+ z,
+ d,
i,
n
];
}
-class ga extends na {
+class Ca extends ra {
constructor(e) {
- super(), ua(this, e, ba, ma, _a, {
+ super(), ba(this, e, ya, va, wa, {
height: 0,
width: 1,
elem_id: 2,
@@ -304,26 +304,26 @@ class ga extends na {
}
}
const {
- SvelteComponent: wa,
- attr: pa,
- create_slot: ka,
- detach: va,
- element: ya,
- get_all_dirty_from_scope: Ca,
- get_slot_changes: Sa,
- init: za,
- insert: qa,
- safe_not_equal: Ea,
- transition_in: Ma,
- transition_out: Ba,
- update_slot_base: Aa
+ SvelteComponent: Sa,
+ attr: za,
+ create_slot: qa,
+ detach: Ea,
+ element: Aa,
+ get_all_dirty_from_scope: Ba,
+ get_slot_changes: Ma,
+ init: La,
+ insert: Da,
+ safe_not_equal: Ta,
+ transition_in: Ra,
+ transition_out: ja,
+ update_slot_base: Ia
} = window.__gradio__svelte__internal;
-function La(l) {
+function Fa(l) {
let e, t;
const n = (
/*#slots*/
l[1].default
- ), i = ka(
+ ), i = qa(
n,
l,
/*$$scope*/
@@ -332,141 +332,141 @@ function La(l) {
);
return {
c() {
- e = ya("div"), i && i.c(), pa(e, "class", "svelte-1hnfib2");
+ e = Aa("div"), i && i.c(), za(e, "class", "svelte-1hnfib2");
},
- m(o, a) {
- qa(o, e, a), i && i.m(e, null), t = !0;
+ m(s, a) {
+ Da(s, e, a), i && i.m(e, null), t = !0;
},
- p(o, [a]) {
+ p(s, [a]) {
i && i.p && (!t || a & /*$$scope*/
- 1) && Aa(
+ 1) && Ia(
i,
n,
- o,
+ s,
/*$$scope*/
- o[0],
- t ? Sa(
+ s[0],
+ t ? Ma(
n,
/*$$scope*/
- o[0],
+ s[0],
a,
null
- ) : Ca(
+ ) : Ba(
/*$$scope*/
- o[0]
+ s[0]
),
null
);
},
- i(o) {
- t || (Ma(i, o), t = !0);
+ i(s) {
+ t || (Ra(i, s), t = !0);
},
- o(o) {
- Ba(i, o), t = !1;
+ o(s) {
+ ja(i, s), t = !1;
},
- d(o) {
- o && va(e), i && i.d(o);
+ d(s) {
+ s && Ea(e), i && i.d(s);
}
};
}
-function Da(l, e, t) {
+function Ha(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
- return l.$$set = (o) => {
- "$$scope" in o && t(0, i = o.$$scope);
+ return l.$$set = (s) => {
+ "$$scope" in s && t(0, i = s.$$scope);
}, [i, n];
}
-class Ta extends wa {
+class Xa extends Sa {
constructor(e) {
- super(), za(this, e, Da, La, Ea, {});
+ super(), La(this, e, Ha, Fa, Ta, {});
}
}
const {
- SvelteComponent: ja,
- attr: vi,
- check_outros: Ia,
- create_component: Ra,
- create_slot: Fa,
- destroy_component: Ha,
- detach: Un,
- element: Ua,
- empty: Na,
- get_all_dirty_from_scope: Oa,
- get_slot_changes: Xa,
- group_outros: Ya,
- init: Wa,
- insert: Nn,
- mount_component: Va,
- safe_not_equal: Pa,
- set_data: Za,
- space: Ka,
- text: Ga,
- toggle_class: Lt,
- transition_in: nn,
- transition_out: On,
- update_slot_base: Ja
+ SvelteComponent: Ya,
+ attr: Mi,
+ check_outros: Ua,
+ create_component: Na,
+ create_slot: Va,
+ destroy_component: Oa,
+ detach: Vn,
+ element: Wa,
+ empty: Pa,
+ get_all_dirty_from_scope: Za,
+ get_slot_changes: Ka,
+ group_outros: Ga,
+ init: Ja,
+ insert: On,
+ mount_component: Qa,
+ safe_not_equal: xa,
+ set_data: $a,
+ space: er,
+ text: tr,
+ toggle_class: Rt,
+ transition_in: rn,
+ transition_out: Wn,
+ update_slot_base: nr
} = window.__gradio__svelte__internal;
-function yi(l) {
+function Li(l) {
let e, t;
- return e = new Ta({
+ return e = new Xa({
props: {
- $$slots: { default: [Qa] },
+ $$slots: { default: [lr] },
$$scope: { ctx: l }
}
}), {
c() {
- Ra(e.$$.fragment);
+ Na(e.$$.fragment);
},
m(n, i) {
- Va(e, n, i), t = !0;
+ Qa(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i & /*$$scope, info*/
- 10 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 10 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
},
i(n) {
- t || (nn(e.$$.fragment, n), t = !0);
+ t || (rn(e.$$.fragment, n), t = !0);
},
o(n) {
- On(e.$$.fragment, n), t = !1;
+ Wn(e.$$.fragment, n), t = !1;
},
d(n) {
- Ha(e, n);
+ Oa(e, n);
}
};
}
-function Qa(l) {
+function lr(l) {
let e;
return {
c() {
- e = Ga(
+ e = tr(
/*info*/
l[1]
);
},
m(t, n) {
- Nn(t, e, n);
+ On(t, e, n);
},
p(t, n) {
n & /*info*/
- 2 && Za(
+ 2 && $a(
e,
/*info*/
t[1]
);
},
d(t) {
- t && Un(e);
+ t && Vn(e);
}
};
}
-function xa(l) {
+function ir(l) {
let e, t, n, i;
- const o = (
+ const s = (
/*#slots*/
l[2].default
- ), a = Fa(
- o,
+ ), a = Va(
+ s,
l,
/*$$scope*/
l[3],
@@ -474,141 +474,141 @@ function xa(l) {
);
let r = (
/*info*/
- l[1] && yi(l)
+ l[1] && Li(l)
);
return {
c() {
- e = Ua("span"), a && a.c(), t = Ka(), r && r.c(), n = Na(), vi(e, "data-testid", "block-info"), vi(e, "class", "svelte-22c38v"), Lt(e, "sr-only", !/*show_label*/
- l[0]), Lt(e, "hide", !/*show_label*/
- l[0]), Lt(
+ e = Wa("span"), a && a.c(), t = er(), r && r.c(), n = Pa(), Mi(e, "data-testid", "block-info"), Mi(e, "class", "svelte-22c38v"), Rt(e, "sr-only", !/*show_label*/
+ l[0]), Rt(e, "hide", !/*show_label*/
+ l[0]), Rt(
e,
"has-info",
/*info*/
l[1] != null
);
},
- m(s, f) {
- Nn(s, e, f), a && a.m(e, null), Nn(s, t, f), r && r.m(s, f), Nn(s, n, f), i = !0;
+ m(o, f) {
+ On(o, e, f), a && a.m(e, null), On(o, t, f), r && r.m(o, f), On(o, n, f), i = !0;
},
- p(s, [f]) {
+ p(o, [f]) {
a && a.p && (!i || f & /*$$scope*/
- 8) && Ja(
+ 8) && nr(
a,
- o,
s,
+ o,
/*$$scope*/
- s[3],
- i ? Xa(
- o,
+ o[3],
+ i ? Ka(
+ s,
/*$$scope*/
- s[3],
+ o[3],
f,
null
- ) : Oa(
+ ) : Za(
/*$$scope*/
- s[3]
+ o[3]
),
null
), (!i || f & /*show_label*/
- 1) && Lt(e, "sr-only", !/*show_label*/
- s[0]), (!i || f & /*show_label*/
- 1) && Lt(e, "hide", !/*show_label*/
- s[0]), (!i || f & /*info*/
- 2) && Lt(
+ 1) && Rt(e, "sr-only", !/*show_label*/
+ o[0]), (!i || f & /*show_label*/
+ 1) && Rt(e, "hide", !/*show_label*/
+ o[0]), (!i || f & /*info*/
+ 2) && Rt(
e,
"has-info",
/*info*/
- s[1] != null
+ o[1] != null
), /*info*/
- s[1] ? r ? (r.p(s, f), f & /*info*/
- 2 && nn(r, 1)) : (r = yi(s), r.c(), nn(r, 1), r.m(n.parentNode, n)) : r && (Ya(), On(r, 1, 1, () => {
+ o[1] ? r ? (r.p(o, f), f & /*info*/
+ 2 && rn(r, 1)) : (r = Li(o), r.c(), rn(r, 1), r.m(n.parentNode, n)) : r && (Ga(), Wn(r, 1, 1, () => {
r = null;
- }), Ia());
+ }), Ua());
},
- i(s) {
- i || (nn(a, s), nn(r), i = !0);
+ i(o) {
+ i || (rn(a, o), rn(r), i = !0);
},
- o(s) {
- On(a, s), On(r), i = !1;
+ o(o) {
+ Wn(a, o), Wn(r), i = !1;
},
- d(s) {
- s && (Un(e), Un(t), Un(n)), a && a.d(s), r && r.d(s);
+ d(o) {
+ o && (Vn(e), Vn(t), Vn(n)), a && a.d(o), r && r.d(o);
}
};
}
-function $a(l, e, t) {
- let { $$slots: n = {}, $$scope: i } = e, { show_label: o = !0 } = e, { info: a = void 0 } = e;
+function sr(l, e, t) {
+ let { $$slots: n = {}, $$scope: i } = e, { show_label: s = !0 } = e, { info: a = void 0 } = e;
return l.$$set = (r) => {
- "show_label" in r && t(0, o = r.show_label), "info" in r && t(1, a = r.info), "$$scope" in r && t(3, i = r.$$scope);
- }, [o, a, n, i];
+ "show_label" in r && t(0, s = r.show_label), "info" in r && t(1, a = r.info), "$$scope" in r && t(3, i = r.$$scope);
+ }, [s, a, n, i];
}
-class es extends ja {
+class so extends Ya {
constructor(e) {
- super(), Wa(this, e, $a, xa, Pa, { show_label: 0, info: 1 });
+ super(), Ja(this, e, sr, ir, xa, { show_label: 0, info: 1 });
}
}
const {
- SvelteComponent: er,
- append: gl,
- attr: Cn,
- create_component: tr,
- destroy_component: nr,
- detach: lr,
- element: Ci,
- init: ir,
- insert: or,
- mount_component: sr,
- safe_not_equal: ar,
- set_data: rr,
- space: fr,
- text: ur,
- toggle_class: xe,
- transition_in: cr,
- transition_out: _r
+ SvelteComponent: or,
+ append: zl,
+ attr: Mn,
+ create_component: ar,
+ destroy_component: rr,
+ detach: fr,
+ element: Di,
+ init: ur,
+ insert: cr,
+ mount_component: _r,
+ safe_not_equal: dr,
+ set_data: hr,
+ space: mr,
+ text: br,
+ toggle_class: $e,
+ transition_in: gr,
+ transition_out: wr
} = window.__gradio__svelte__internal;
-function dr(l) {
- let e, t, n, i, o, a;
+function pr(l) {
+ let e, t, n, i, s, a;
return n = new /*Icon*/
l[1]({}), {
c() {
- e = Ci("label"), t = Ci("span"), tr(n.$$.fragment), i = fr(), o = ur(
+ e = Di("label"), t = Di("span"), ar(n.$$.fragment), i = mr(), s = br(
/*label*/
l[0]
- ), Cn(t, "class", "svelte-9gxdi0"), Cn(e, "for", ""), Cn(e, "data-testid", "block-label"), Cn(e, "class", "svelte-9gxdi0"), xe(e, "hide", !/*show_label*/
- l[2]), xe(e, "sr-only", !/*show_label*/
- l[2]), xe(
+ ), Mn(t, "class", "svelte-9gxdi0"), Mn(e, "for", ""), Mn(e, "data-testid", "block-label"), Mn(e, "class", "svelte-9gxdi0"), $e(e, "hide", !/*show_label*/
+ l[2]), $e(e, "sr-only", !/*show_label*/
+ l[2]), $e(
e,
"float",
/*float*/
l[4]
- ), xe(
+ ), $e(
e,
"hide-label",
/*disable*/
l[3]
);
},
- m(r, s) {
- or(r, e, s), gl(e, t), sr(n, t, null), gl(e, i), gl(e, o), a = !0;
+ m(r, o) {
+ cr(r, e, o), zl(e, t), _r(n, t, null), zl(e, i), zl(e, s), a = !0;
},
- p(r, [s]) {
- (!a || s & /*label*/
- 1) && rr(
- o,
+ p(r, [o]) {
+ (!a || o & /*label*/
+ 1) && hr(
+ s,
/*label*/
r[0]
- ), (!a || s & /*show_label*/
- 4) && xe(e, "hide", !/*show_label*/
- r[2]), (!a || s & /*show_label*/
- 4) && xe(e, "sr-only", !/*show_label*/
- r[2]), (!a || s & /*float*/
- 16) && xe(
+ ), (!a || o & /*show_label*/
+ 4) && $e(e, "hide", !/*show_label*/
+ r[2]), (!a || o & /*show_label*/
+ 4) && $e(e, "sr-only", !/*show_label*/
+ r[2]), (!a || o & /*float*/
+ 16) && $e(
e,
"float",
/*float*/
r[4]
- ), (!a || s & /*disable*/
- 8) && xe(
+ ), (!a || o & /*disable*/
+ 8) && $e(
e,
"hide-label",
/*disable*/
@@ -616,25 +616,25 @@ function dr(l) {
);
},
i(r) {
- a || (cr(n.$$.fragment, r), a = !0);
+ a || (gr(n.$$.fragment, r), a = !0);
},
o(r) {
- _r(n.$$.fragment, r), a = !1;
+ wr(n.$$.fragment, r), a = !1;
},
d(r) {
- r && lr(e), nr(n);
+ r && fr(e), rr(n);
}
};
}
-function hr(l, e, t) {
- let { label: n = null } = e, { Icon: i } = e, { show_label: o = !0 } = e, { disable: a = !1 } = e, { float: r = !0 } = e;
- return l.$$set = (s) => {
- "label" in s && t(0, n = s.label), "Icon" in s && t(1, i = s.Icon), "show_label" in s && t(2, o = s.show_label), "disable" in s && t(3, a = s.disable), "float" in s && t(4, r = s.float);
- }, [n, i, o, a, r];
+function kr(l, e, t) {
+ let { label: n = null } = e, { Icon: i } = e, { show_label: s = !0 } = e, { disable: a = !1 } = e, { float: r = !0 } = e;
+ return l.$$set = (o) => {
+ "label" in o && t(0, n = o.label), "Icon" in o && t(1, i = o.Icon), "show_label" in o && t(2, s = o.show_label), "disable" in o && t(3, a = o.disable), "float" in o && t(4, r = o.float);
+ }, [n, i, s, a, r];
}
-class mr extends er {
+class vr extends or {
constructor(e) {
- super(), ir(this, e, hr, dr, ar, {
+ super(), ur(this, e, kr, pr, dr, {
label: 0,
Icon: 1,
show_label: 2,
@@ -644,121 +644,121 @@ class mr extends er {
}
}
const {
- SvelteComponent: br,
- append: Zl,
- attr: Ke,
- bubble: gr,
- create_component: wr,
- destroy_component: pr,
- detach: ts,
- element: Kl,
- init: kr,
- insert: ns,
- listen: vr,
- mount_component: yr,
- safe_not_equal: Cr,
- set_data: Sr,
- set_style: Dt,
- space: zr,
- text: qr,
- toggle_class: re,
- transition_in: Er,
- transition_out: Mr
+ SvelteComponent: yr,
+ append: ni,
+ attr: Je,
+ bubble: Cr,
+ create_component: Sr,
+ destroy_component: zr,
+ detach: oo,
+ element: li,
+ init: qr,
+ insert: ao,
+ listen: Er,
+ mount_component: Ar,
+ safe_not_equal: Br,
+ set_data: Mr,
+ set_style: jt,
+ space: Lr,
+ text: Dr,
+ toggle_class: _e,
+ transition_in: Tr,
+ transition_out: Rr
} = window.__gradio__svelte__internal;
-function Si(l) {
+function Ti(l) {
let e, t;
return {
c() {
- e = Kl("span"), t = qr(
+ e = li("span"), t = Dr(
/*label*/
l[1]
- ), Ke(e, "class", "svelte-1lrphxw");
+ ), Je(e, "class", "svelte-1lrphxw");
},
m(n, i) {
- ns(n, e, i), Zl(e, t);
+ ao(n, e, i), ni(e, t);
},
p(n, i) {
i & /*label*/
- 2 && Sr(
+ 2 && Mr(
t,
/*label*/
n[1]
);
},
d(n) {
- n && ts(e);
+ n && oo(e);
}
};
}
-function Br(l) {
- let e, t, n, i, o, a, r, s = (
+function jr(l) {
+ let e, t, n, i, s, a, r, o = (
/*show_label*/
- l[2] && Si(l)
+ l[2] && Ti(l)
);
return i = new /*Icon*/
l[0]({}), {
c() {
- e = Kl("button"), s && s.c(), t = zr(), n = Kl("div"), wr(i.$$.fragment), Ke(n, "class", "svelte-1lrphxw"), re(
+ e = li("button"), o && o.c(), t = Lr(), n = li("div"), Sr(i.$$.fragment), Je(n, "class", "svelte-1lrphxw"), _e(
n,
"small",
/*size*/
l[4] === "small"
- ), re(
+ ), _e(
n,
"large",
/*size*/
l[4] === "large"
- ), re(
+ ), _e(
n,
"medium",
/*size*/
l[4] === "medium"
), e.disabled = /*disabled*/
- l[7], Ke(
+ l[7], Je(
e,
"aria-label",
/*label*/
l[1]
- ), Ke(
+ ), Je(
e,
"aria-haspopup",
/*hasPopup*/
l[8]
- ), Ke(
+ ), Je(
e,
"title",
/*label*/
l[1]
- ), Ke(e, "class", "svelte-1lrphxw"), re(
+ ), Je(e, "class", "svelte-1lrphxw"), _e(
e,
"pending",
/*pending*/
l[3]
- ), re(
+ ), _e(
e,
"padded",
/*padded*/
l[5]
- ), re(
+ ), _e(
e,
"highlight",
/*highlight*/
l[6]
- ), re(
+ ), _e(
e,
"transparent",
/*transparent*/
l[9]
- ), Dt(e, "color", !/*disabled*/
+ ), jt(e, "color", !/*disabled*/
l[7] && /*_color*/
l[12] ? (
/*_color*/
l[12]
- ) : "var(--block-label-text-color)"), Dt(e, "--bg-color", /*disabled*/
+ ) : "var(--block-label-text-color)"), jt(e, "--bg-color", /*disabled*/
l[7] ? "auto" : (
/*background*/
l[10]
- )), Dt(
+ )), jt(
e,
"margin-left",
/*offset*/
@@ -766,7 +766,7 @@ function Br(l) {
);
},
m(f, u) {
- ns(f, e, u), s && s.m(e, null), Zl(e, t), Zl(e, n), yr(i, n, null), o = !0, a || (r = vr(
+ ao(f, e, u), o && o.m(e, null), ni(e, t), ni(e, n), Ar(i, n, null), s = !0, a || (r = Er(
e,
"click",
/*click_handler*/
@@ -775,81 +775,81 @@ function Br(l) {
},
p(f, [u]) {
/*show_label*/
- f[2] ? s ? s.p(f, u) : (s = Si(f), s.c(), s.m(e, t)) : s && (s.d(1), s = null), (!o || u & /*size*/
- 16) && re(
+ f[2] ? o ? o.p(f, u) : (o = Ti(f), o.c(), o.m(e, t)) : o && (o.d(1), o = null), (!s || u & /*size*/
+ 16) && _e(
n,
"small",
/*size*/
f[4] === "small"
- ), (!o || u & /*size*/
- 16) && re(
+ ), (!s || u & /*size*/
+ 16) && _e(
n,
"large",
/*size*/
f[4] === "large"
- ), (!o || u & /*size*/
- 16) && re(
+ ), (!s || u & /*size*/
+ 16) && _e(
n,
"medium",
/*size*/
f[4] === "medium"
- ), (!o || u & /*disabled*/
+ ), (!s || u & /*disabled*/
128) && (e.disabled = /*disabled*/
- f[7]), (!o || u & /*label*/
- 2) && Ke(
+ f[7]), (!s || u & /*label*/
+ 2) && Je(
e,
"aria-label",
/*label*/
f[1]
- ), (!o || u & /*hasPopup*/
- 256) && Ke(
+ ), (!s || u & /*hasPopup*/
+ 256) && Je(
e,
"aria-haspopup",
/*hasPopup*/
f[8]
- ), (!o || u & /*label*/
- 2) && Ke(
+ ), (!s || u & /*label*/
+ 2) && Je(
e,
"title",
/*label*/
f[1]
- ), (!o || u & /*pending*/
- 8) && re(
+ ), (!s || u & /*pending*/
+ 8) && _e(
e,
"pending",
/*pending*/
f[3]
- ), (!o || u & /*padded*/
- 32) && re(
+ ), (!s || u & /*padded*/
+ 32) && _e(
e,
"padded",
/*padded*/
f[5]
- ), (!o || u & /*highlight*/
- 64) && re(
+ ), (!s || u & /*highlight*/
+ 64) && _e(
e,
"highlight",
/*highlight*/
f[6]
- ), (!o || u & /*transparent*/
- 512) && re(
+ ), (!s || u & /*transparent*/
+ 512) && _e(
e,
"transparent",
/*transparent*/
f[9]
), u & /*disabled, _color*/
- 4224 && Dt(e, "color", !/*disabled*/
+ 4224 && jt(e, "color", !/*disabled*/
f[7] && /*_color*/
f[12] ? (
/*_color*/
f[12]
) : "var(--block-label-text-color)"), u & /*disabled, background*/
- 1152 && Dt(e, "--bg-color", /*disabled*/
+ 1152 && jt(e, "--bg-color", /*disabled*/
f[7] ? "auto" : (
/*background*/
f[10]
)), u & /*offset*/
- 2048 && Dt(
+ 2048 && jt(
e,
"margin-left",
/*offset*/
@@ -857,47 +857,47 @@ function Br(l) {
);
},
i(f) {
- o || (Er(i.$$.fragment, f), o = !0);
+ s || (Tr(i.$$.fragment, f), s = !0);
},
o(f) {
- Mr(i.$$.fragment, f), o = !1;
+ Rr(i.$$.fragment, f), s = !1;
},
d(f) {
- f && ts(e), s && s.d(), pr(i), a = !1, r();
+ f && oo(e), o && o.d(), zr(i), a = !1, r();
}
};
}
-function Ar(l, e, t) {
- let n, { Icon: i } = e, { label: o = "" } = e, { show_label: a = !1 } = e, { pending: r = !1 } = e, { size: s = "small" } = e, { padded: f = !0 } = e, { highlight: u = !1 } = e, { disabled: c = !1 } = e, { hasPopup: _ = !1 } = e, { color: d = "var(--block-label-text-color)" } = e, { transparent: h = !1 } = e, { background: b = "var(--background-fill-primary)" } = e, { offset: m = 0 } = e;
- function w(k) {
- gr.call(this, l, k);
+function Ir(l, e, t) {
+ let n, { Icon: i } = e, { label: s = "" } = e, { show_label: a = !1 } = e, { pending: r = !1 } = e, { size: o = "small" } = e, { padded: f = !0 } = e, { highlight: u = !1 } = e, { disabled: c = !1 } = e, { hasPopup: d = !1 } = e, { color: _ = "var(--block-label-text-color)" } = e, { transparent: b = !1 } = e, { background: h = "var(--background-fill-primary)" } = e, { offset: w = 0 } = e;
+ function g(p) {
+ Cr.call(this, l, p);
}
- return l.$$set = (k) => {
- "Icon" in k && t(0, i = k.Icon), "label" in k && t(1, o = k.label), "show_label" in k && t(2, a = k.show_label), "pending" in k && t(3, r = k.pending), "size" in k && t(4, s = k.size), "padded" in k && t(5, f = k.padded), "highlight" in k && t(6, u = k.highlight), "disabled" in k && t(7, c = k.disabled), "hasPopup" in k && t(8, _ = k.hasPopup), "color" in k && t(13, d = k.color), "transparent" in k && t(9, h = k.transparent), "background" in k && t(10, b = k.background), "offset" in k && t(11, m = k.offset);
+ return l.$$set = (p) => {
+ "Icon" in p && t(0, i = p.Icon), "label" in p && t(1, s = p.label), "show_label" in p && t(2, a = p.show_label), "pending" in p && t(3, r = p.pending), "size" in p && t(4, o = p.size), "padded" in p && t(5, f = p.padded), "highlight" in p && t(6, u = p.highlight), "disabled" in p && t(7, c = p.disabled), "hasPopup" in p && t(8, d = p.hasPopup), "color" in p && t(13, _ = p.color), "transparent" in p && t(9, b = p.transparent), "background" in p && t(10, h = p.background), "offset" in p && t(11, w = p.offset);
}, l.$$.update = () => {
l.$$.dirty & /*highlight, color*/
- 8256 && t(12, n = u ? "var(--color-accent)" : d);
+ 8256 && t(12, n = u ? "var(--color-accent)" : _);
}, [
i,
- o,
+ s,
a,
r,
- s,
+ o,
f,
u,
c,
- _,
- h,
+ d,
b,
- m,
+ h,
+ w,
n,
- d,
- w
+ _,
+ g
];
}
-class al extends br {
+class hl extends yr {
constructor(e) {
- super(), kr(this, e, Ar, Br, Cr, {
+ super(), qr(this, e, Ir, jr, Br, {
Icon: 0,
label: 1,
show_label: 2,
@@ -915,29 +915,29 @@ class al extends br {
}
}
const {
- SvelteComponent: Lr,
- append: Dr,
- attr: wl,
- binding_callbacks: Tr,
- create_slot: jr,
- detach: Ir,
- element: zi,
- get_all_dirty_from_scope: Rr,
- get_slot_changes: Fr,
- init: Hr,
- insert: Ur,
- safe_not_equal: Nr,
- toggle_class: $e,
- transition_in: Or,
- transition_out: Xr,
- update_slot_base: Yr
+ SvelteComponent: Fr,
+ append: Hr,
+ attr: ql,
+ binding_callbacks: Xr,
+ create_slot: Yr,
+ detach: Ur,
+ element: Ri,
+ get_all_dirty_from_scope: Nr,
+ get_slot_changes: Vr,
+ init: Or,
+ insert: Wr,
+ safe_not_equal: Pr,
+ toggle_class: et,
+ transition_in: Zr,
+ transition_out: Kr,
+ update_slot_base: Gr
} = window.__gradio__svelte__internal;
-function Wr(l) {
+function Jr(l) {
let e, t, n;
const i = (
/*#slots*/
l[5].default
- ), o = jr(
+ ), s = Yr(
i,
l,
/*$$scope*/
@@ -946,22 +946,22 @@ function Wr(l) {
);
return {
c() {
- e = zi("div"), t = zi("div"), o && o.c(), wl(t, "class", "icon svelte-3w3rth"), wl(e, "class", "empty svelte-3w3rth"), wl(e, "aria-label", "Empty value"), $e(
+ e = Ri("div"), t = Ri("div"), s && s.c(), ql(t, "class", "icon svelte-3w3rth"), ql(e, "class", "empty svelte-3w3rth"), ql(e, "aria-label", "Empty value"), et(
e,
"small",
/*size*/
l[0] === "small"
- ), $e(
+ ), et(
e,
"large",
/*size*/
l[0] === "large"
- ), $e(
+ ), et(
e,
"unpadded_box",
/*unpadded_box*/
l[1]
- ), $e(
+ ), et(
e,
"small_parent",
/*parent_height*/
@@ -969,47 +969,47 @@ function Wr(l) {
);
},
m(a, r) {
- Ur(a, e, r), Dr(e, t), o && o.m(t, null), l[6](e), n = !0;
+ Wr(a, e, r), Hr(e, t), s && s.m(t, null), l[6](e), n = !0;
},
p(a, [r]) {
- o && o.p && (!n || r & /*$$scope*/
- 16) && Yr(
- o,
+ s && s.p && (!n || r & /*$$scope*/
+ 16) && Gr(
+ s,
i,
a,
/*$$scope*/
a[4],
- n ? Fr(
+ n ? Vr(
i,
/*$$scope*/
a[4],
r,
null
- ) : Rr(
+ ) : Nr(
/*$$scope*/
a[4]
),
null
), (!n || r & /*size*/
- 1) && $e(
+ 1) && et(
e,
"small",
/*size*/
a[0] === "small"
), (!n || r & /*size*/
- 1) && $e(
+ 1) && et(
e,
"large",
/*size*/
a[0] === "large"
), (!n || r & /*unpadded_box*/
- 2) && $e(
+ 2) && et(
e,
"unpadded_box",
/*unpadded_box*/
a[1]
), (!n || r & /*parent_height*/
- 8) && $e(
+ 8) && et(
e,
"small_parent",
/*parent_height*/
@@ -1017,373 +1017,340 @@ function Wr(l) {
);
},
i(a) {
- n || (Or(o, a), n = !0);
+ n || (Zr(s, a), n = !0);
},
o(a) {
- Xr(o, a), n = !1;
+ Kr(s, a), n = !1;
},
d(a) {
- a && Ir(e), o && o.d(a), l[6](null);
+ a && Ur(e), s && s.d(a), l[6](null);
}
};
}
-function Vr(l, e, t) {
- let n, { $$slots: i = {}, $$scope: o } = e, { size: a = "small" } = e, { unpadded_box: r = !1 } = e, s;
+function Qr(l, e, t) {
+ let n, { $$slots: i = {}, $$scope: s } = e, { size: a = "small" } = e, { unpadded_box: r = !1 } = e, o;
function f(c) {
- var _;
+ var d;
if (!c) return !1;
- const { height: d } = c.getBoundingClientRect(), { height: h } = ((_ = c.parentElement) === null || _ === void 0 ? void 0 : _.getBoundingClientRect()) || { height: d };
- return d > h + 2;
+ const { height: _ } = c.getBoundingClientRect(), { height: b } = ((d = c.parentElement) === null || d === void 0 ? void 0 : d.getBoundingClientRect()) || { height: _ };
+ return _ > b + 2;
}
function u(c) {
- Tr[c ? "unshift" : "push"](() => {
- s = c, t(2, s);
+ Xr[c ? "unshift" : "push"](() => {
+ o = c, t(2, o);
});
}
return l.$$set = (c) => {
- "size" in c && t(0, a = c.size), "unpadded_box" in c && t(1, r = c.unpadded_box), "$$scope" in c && t(4, o = c.$$scope);
+ "size" in c && t(0, a = c.size), "unpadded_box" in c && t(1, r = c.unpadded_box), "$$scope" in c && t(4, s = c.$$scope);
}, l.$$.update = () => {
l.$$.dirty & /*el*/
- 4 && t(3, n = f(s));
- }, [a, r, s, n, o, i, u];
-}
-class Pr extends Lr {
- constructor(e) {
- super(), Hr(this, e, Vr, Wr, Nr, { size: 0, unpadded_box: 1 });
- }
-}
-const {
- SvelteComponent: Zr,
- append: pl,
- attr: De,
- detach: Kr,
- init: Gr,
- insert: Jr,
- noop: kl,
- safe_not_equal: Qr,
- set_style: Ue,
- svg_element: Sn
-} = window.__gradio__svelte__internal;
-function xr(l) {
- let e, t, n, i;
- return {
- c() {
- e = Sn("svg"), t = Sn("g"), n = Sn("path"), i = Sn("path"), De(n, "d", "M18,6L6.087,17.913"), Ue(n, "fill", "none"), Ue(n, "fill-rule", "nonzero"), Ue(n, "stroke-width", "2px"), De(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), De(i, "d", "M4.364,4.364L19.636,19.636"), Ue(i, "fill", "none"), Ue(i, "fill-rule", "nonzero"), Ue(i, "stroke-width", "2px"), De(e, "width", "100%"), De(e, "height", "100%"), De(e, "viewBox", "0 0 24 24"), De(e, "version", "1.1"), De(e, "xmlns", "http://www.w3.org/2000/svg"), De(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), De(e, "xml:space", "preserve"), De(e, "stroke", "currentColor"), Ue(e, "fill-rule", "evenodd"), Ue(e, "clip-rule", "evenodd"), Ue(e, "stroke-linecap", "round"), Ue(e, "stroke-linejoin", "round");
- },
- m(o, a) {
- Jr(o, e, a), pl(e, t), pl(t, n), pl(e, i);
- },
- p: kl,
- i: kl,
- o: kl,
- d(o) {
- o && Kr(e);
- }
- };
+ 4 && t(3, n = f(o));
+ }, [a, r, o, n, s, i, u];
}
-class ci extends Zr {
+class xr extends Fr {
constructor(e) {
- super(), Gr(this, e, null, xr, Qr, {});
+ super(), Or(this, e, Qr, Jr, Pr, { size: 0, unpadded_box: 1 });
}
}
const {
SvelteComponent: $r,
- append: ef,
- attr: Qt,
- detach: tf,
- init: nf,
- insert: lf,
- noop: vl,
- safe_not_equal: of,
- svg_element: qi
+ append: El,
+ attr: Le,
+ detach: ef,
+ init: tf,
+ insert: nf,
+ noop: Al,
+ safe_not_equal: lf,
+ set_style: Xe,
+ svg_element: Ln
} = window.__gradio__svelte__internal;
function sf(l) {
- let e, t;
+ let e, t, n, i;
return {
c() {
- e = qi("svg"), t = qi("path"), Qt(t, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), Qt(t, "fill", "currentColor"), Qt(e, "id", "icon"), Qt(e, "xmlns", "http://www.w3.org/2000/svg"), Qt(e, "viewBox", "0 0 32 32");
+ e = Ln("svg"), t = Ln("g"), n = Ln("path"), i = Ln("path"), Le(n, "d", "M18,6L6.087,17.913"), Xe(n, "fill", "none"), Xe(n, "fill-rule", "nonzero"), Xe(n, "stroke-width", "2px"), Le(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Le(i, "d", "M4.364,4.364L19.636,19.636"), Xe(i, "fill", "none"), Xe(i, "fill-rule", "nonzero"), Xe(i, "stroke-width", "2px"), Le(e, "width", "100%"), Le(e, "height", "100%"), Le(e, "viewBox", "0 0 24 24"), Le(e, "version", "1.1"), Le(e, "xmlns", "http://www.w3.org/2000/svg"), Le(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Le(e, "xml:space", "preserve"), Le(e, "stroke", "currentColor"), Xe(e, "fill-rule", "evenodd"), Xe(e, "clip-rule", "evenodd"), Xe(e, "stroke-linecap", "round"), Xe(e, "stroke-linejoin", "round");
},
- m(n, i) {
- lf(n, e, i), ef(e, t);
+ m(s, a) {
+ nf(s, e, a), El(e, t), El(t, n), El(e, i);
},
- p: vl,
- i: vl,
- o: vl,
- d(n) {
- n && tf(e);
+ p: Al,
+ i: Al,
+ o: Al,
+ d(s) {
+ s && ef(e);
}
};
}
-class af extends $r {
+class ro extends $r {
constructor(e) {
- super(), nf(this, e, null, sf, of, {});
+ super(), tf(this, e, null, sf, lf, {});
}
}
const {
- SvelteComponent: rf,
- append: ff,
- attr: Tt,
- detach: uf,
- init: cf,
- insert: _f,
- noop: yl,
- safe_not_equal: df,
- svg_element: Ei
+ SvelteComponent: of,
+ append: af,
+ attr: nn,
+ detach: rf,
+ init: ff,
+ insert: uf,
+ noop: Bl,
+ safe_not_equal: cf,
+ svg_element: ji
} = window.__gradio__svelte__internal;
-function hf(l) {
+function _f(l) {
let e, t;
return {
c() {
- e = Ei("svg"), t = Ei("path"), Tt(t, "fill", "currentColor"), Tt(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Tt(e, "xmlns", "http://www.w3.org/2000/svg"), Tt(e, "width", "100%"), Tt(e, "height", "100%"), Tt(e, "viewBox", "0 0 32 32");
+ e = ji("svg"), t = ji("path"), nn(t, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), nn(t, "fill", "currentColor"), nn(e, "id", "icon"), nn(e, "xmlns", "http://www.w3.org/2000/svg"), nn(e, "viewBox", "0 0 32 32");
},
m(n, i) {
- _f(n, e, i), ff(e, t);
+ uf(n, e, i), af(e, t);
},
- p: yl,
- i: yl,
- o: yl,
+ p: Bl,
+ i: Bl,
+ o: Bl,
d(n) {
- n && uf(e);
+ n && rf(e);
}
};
}
-class mf extends rf {
+class df extends of {
constructor(e) {
- super(), cf(this, e, null, hf, df, {});
+ super(), ff(this, e, null, _f, cf, {});
}
}
const {
- SvelteComponent: bf,
- append: gf,
- attr: jt,
- detach: wf,
- init: pf,
- insert: kf,
- noop: Cl,
- safe_not_equal: vf,
- svg_element: Mi
+ SvelteComponent: hf,
+ append: mf,
+ attr: It,
+ detach: bf,
+ init: gf,
+ insert: wf,
+ noop: Ml,
+ safe_not_equal: pf,
+ svg_element: Ii
} = window.__gradio__svelte__internal;
-function yf(l) {
+function kf(l) {
let e, t;
return {
c() {
- e = Mi("svg"), t = Mi("path"), jt(t, "d", "M5 8l4 4 4-4z"), jt(e, "class", "dropdown-arrow svelte-145leq6"), jt(e, "xmlns", "http://www.w3.org/2000/svg"), jt(e, "width", "100%"), jt(e, "height", "100%"), jt(e, "viewBox", "0 0 18 18");
+ e = Ii("svg"), t = Ii("path"), It(t, "fill", "currentColor"), It(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), It(e, "xmlns", "http://www.w3.org/2000/svg"), It(e, "width", "100%"), It(e, "height", "100%"), It(e, "viewBox", "0 0 32 32");
},
m(n, i) {
- kf(n, e, i), gf(e, t);
+ wf(n, e, i), mf(e, t);
},
- p: Cl,
- i: Cl,
- o: Cl,
+ p: Ml,
+ i: Ml,
+ o: Ml,
d(n) {
- n && wf(e);
+ n && bf(e);
}
};
}
-class Cf extends bf {
+class vf extends hf {
constructor(e) {
- super(), pf(this, e, null, yf, vf, {});
+ super(), gf(this, e, null, kf, pf, {});
}
}
const {
- SvelteComponent: Sf,
- append: zf,
- attr: Te,
- detach: qf,
- init: Ef,
- insert: Mf,
- noop: Sl,
- safe_not_equal: Bf,
- svg_element: Bi
+ SvelteComponent: yf,
+ append: Cf,
+ attr: Ft,
+ detach: Sf,
+ init: zf,
+ insert: qf,
+ noop: Ll,
+ safe_not_equal: Ef,
+ svg_element: Fi
} = window.__gradio__svelte__internal;
function Af(l) {
let e, t;
return {
c() {
- e = Bi("svg"), t = Bi("path"), Te(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), Te(e, "xmlns", "http://www.w3.org/2000/svg"), Te(e, "width", "100%"), Te(e, "height", "100%"), Te(e, "viewBox", "0 0 24 24"), Te(e, "fill", "none"), Te(e, "stroke", "currentColor"), Te(e, "stroke-width", "1.5"), Te(e, "stroke-linecap", "round"), Te(e, "stroke-linejoin", "round"), Te(e, "class", "feather feather-edit-2");
+ e = Fi("svg"), t = Fi("path"), Ft(t, "d", "M5 8l4 4 4-4z"), Ft(e, "class", "dropdown-arrow svelte-145leq6"), Ft(e, "xmlns", "http://www.w3.org/2000/svg"), Ft(e, "width", "100%"), Ft(e, "height", "100%"), Ft(e, "viewBox", "0 0 18 18");
},
m(n, i) {
- Mf(n, e, i), zf(e, t);
+ qf(n, e, i), Cf(e, t);
},
- p: Sl,
- i: Sl,
- o: Sl,
+ p: Ll,
+ i: Ll,
+ o: Ll,
d(n) {
- n && qf(e);
+ n && Sf(e);
}
};
}
-class Lf extends Sf {
+class Bf extends yf {
constructor(e) {
- super(), Ef(this, e, null, Af, Bf, {});
+ super(), zf(this, e, null, Af, Ef, {});
}
}
const {
- SvelteComponent: Df,
- append: zl,
- attr: Q,
- detach: Tf,
- init: jf,
- insert: If,
- noop: ql,
+ SvelteComponent: Mf,
+ append: Dl,
+ attr: x,
+ detach: Lf,
+ init: Df,
+ insert: Tf,
+ noop: Tl,
safe_not_equal: Rf,
- svg_element: zn
+ svg_element: Dn
} = window.__gradio__svelte__internal;
-function Ff(l) {
+function jf(l) {
let e, t, n, i;
return {
c() {
- e = zn("svg"), t = zn("rect"), n = zn("circle"), i = zn("polyline"), Q(t, "x", "3"), Q(t, "y", "3"), Q(t, "width", "18"), Q(t, "height", "18"), Q(t, "rx", "2"), Q(t, "ry", "2"), Q(n, "cx", "8.5"), Q(n, "cy", "8.5"), Q(n, "r", "1.5"), Q(i, "points", "21 15 16 10 5 21"), Q(e, "xmlns", "http://www.w3.org/2000/svg"), Q(e, "width", "100%"), Q(e, "height", "100%"), Q(e, "viewBox", "0 0 24 24"), Q(e, "fill", "none"), Q(e, "stroke", "currentColor"), Q(e, "stroke-width", "1.5"), Q(e, "stroke-linecap", "round"), Q(e, "stroke-linejoin", "round"), Q(e, "class", "feather feather-image");
+ e = Dn("svg"), t = Dn("rect"), n = Dn("circle"), i = Dn("polyline"), x(t, "x", "3"), x(t, "y", "3"), x(t, "width", "18"), x(t, "height", "18"), x(t, "rx", "2"), x(t, "ry", "2"), x(n, "cx", "8.5"), x(n, "cy", "8.5"), x(n, "r", "1.5"), x(i, "points", "21 15 16 10 5 21"), x(e, "xmlns", "http://www.w3.org/2000/svg"), x(e, "width", "100%"), x(e, "height", "100%"), x(e, "viewBox", "0 0 24 24"), x(e, "fill", "none"), x(e, "stroke", "currentColor"), x(e, "stroke-width", "1.5"), x(e, "stroke-linecap", "round"), x(e, "stroke-linejoin", "round"), x(e, "class", "feather feather-image");
},
- m(o, a) {
- If(o, e, a), zl(e, t), zl(e, n), zl(e, i);
+ m(s, a) {
+ Tf(s, e, a), Dl(e, t), Dl(e, n), Dl(e, i);
},
- p: ql,
- i: ql,
- o: ql,
- d(o) {
- o && Tf(e);
+ p: Tl,
+ i: Tl,
+ o: Tl,
+ d(s) {
+ s && Lf(e);
}
};
}
-let ls = class extends Df {
+let fo = class extends Mf {
constructor(e) {
- super(), jf(this, e, null, Ff, Rf, {});
+ super(), Df(this, e, null, jf, Rf, {});
}
};
const {
- SvelteComponent: Hf,
- append: Uf,
- attr: qn,
- detach: Nf,
- init: Of,
- insert: Xf,
- noop: El,
- safe_not_equal: Yf,
- svg_element: Ai
+ SvelteComponent: If,
+ append: Ff,
+ attr: Tn,
+ detach: Hf,
+ init: Xf,
+ insert: Yf,
+ noop: Rl,
+ safe_not_equal: Uf,
+ svg_element: Hi
} = window.__gradio__svelte__internal;
-function Wf(l) {
+function Nf(l) {
let e, t;
return {
c() {
- e = Ai("svg"), t = Ai("path"), qn(t, "fill", "currentColor"), qn(t, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), qn(e, "xmlns", "http://www.w3.org/2000/svg"), qn(e, "viewBox", "0 0 24 24");
+ e = Hi("svg"), t = Hi("path"), Tn(t, "fill", "currentColor"), Tn(t, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), Tn(e, "xmlns", "http://www.w3.org/2000/svg"), Tn(e, "viewBox", "0 0 24 24");
},
m(n, i) {
- Xf(n, e, i), Uf(e, t);
+ Yf(n, e, i), Ff(e, t);
},
- p: El,
- i: El,
- o: El,
+ p: Rl,
+ i: Rl,
+ o: Rl,
d(n) {
- n && Nf(e);
+ n && Hf(e);
}
};
}
-class is extends Hf {
+class uo extends If {
constructor(e) {
- super(), Of(this, e, null, Wf, Yf, {});
+ super(), Xf(this, e, null, Nf, Uf, {});
}
}
const {
SvelteComponent: Vf,
- append: En,
- attr: x,
- detach: Pf,
- init: Zf,
- insert: Kf,
- noop: Ml,
- safe_not_equal: Gf,
- svg_element: xt
+ append: Rn,
+ attr: $,
+ detach: Of,
+ init: Wf,
+ insert: Pf,
+ noop: jl,
+ safe_not_equal: Zf,
+ svg_element: ln
} = window.__gradio__svelte__internal;
-function Jf(l) {
- let e, t, n, i, o;
+function Kf(l) {
+ let e, t, n, i, s;
return {
c() {
- e = xt("svg"), t = xt("path"), n = xt("path"), i = xt("line"), o = xt("line"), x(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), x(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), x(i, "x1", "12"), x(i, "y1", "19"), x(i, "x2", "12"), x(i, "y2", "23"), x(o, "x1", "8"), x(o, "y1", "23"), x(o, "x2", "16"), x(o, "y2", "23"), x(e, "xmlns", "http://www.w3.org/2000/svg"), x(e, "width", "100%"), x(e, "height", "100%"), x(e, "viewBox", "0 0 24 24"), x(e, "fill", "none"), x(e, "stroke", "currentColor"), x(e, "stroke-width", "2"), x(e, "stroke-linecap", "round"), x(e, "stroke-linejoin", "round"), x(e, "class", "feather feather-mic");
+ e = ln("svg"), t = ln("path"), n = ln("path"), i = ln("line"), s = ln("line"), $(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), $(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), $(i, "x1", "12"), $(i, "y1", "19"), $(i, "x2", "12"), $(i, "y2", "23"), $(s, "x1", "8"), $(s, "y1", "23"), $(s, "x2", "16"), $(s, "y2", "23"), $(e, "xmlns", "http://www.w3.org/2000/svg"), $(e, "width", "100%"), $(e, "height", "100%"), $(e, "viewBox", "0 0 24 24"), $(e, "fill", "none"), $(e, "stroke", "currentColor"), $(e, "stroke-width", "2"), $(e, "stroke-linecap", "round"), $(e, "stroke-linejoin", "round"), $(e, "class", "feather feather-mic");
},
m(a, r) {
- Kf(a, e, r), En(e, t), En(e, n), En(e, i), En(e, o);
+ Pf(a, e, r), Rn(e, t), Rn(e, n), Rn(e, i), Rn(e, s);
},
- p: Ml,
- i: Ml,
- o: Ml,
+ p: jl,
+ i: jl,
+ o: jl,
d(a) {
- a && Pf(e);
+ a && Of(e);
}
};
}
-class Qf extends Vf {
+class Gf extends Vf {
constructor(e) {
- super(), Zf(this, e, null, Jf, Gf, {});
+ super(), Wf(this, e, null, Kf, Zf, {});
}
}
const {
- SvelteComponent: xf,
- append: Bl,
+ SvelteComponent: Jf,
+ append: Il,
attr: ie,
- detach: $f,
- init: eu,
- insert: tu,
- noop: Al,
- safe_not_equal: nu,
- svg_element: Mn
+ detach: Qf,
+ init: xf,
+ insert: $f,
+ noop: Fl,
+ safe_not_equal: eu,
+ svg_element: jn
} = window.__gradio__svelte__internal;
-function lu(l) {
+function tu(l) {
let e, t, n, i;
return {
c() {
- e = Mn("svg"), t = Mn("path"), n = Mn("polyline"), i = Mn("line"), ie(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ie(n, "points", "17 8 12 3 7 8"), ie(i, "x1", "12"), ie(i, "y1", "3"), ie(i, "x2", "12"), ie(i, "y2", "15"), ie(e, "xmlns", "http://www.w3.org/2000/svg"), ie(e, "width", "90%"), ie(e, "height", "90%"), ie(e, "viewBox", "0 0 24 24"), ie(e, "fill", "none"), ie(e, "stroke", "currentColor"), ie(e, "stroke-width", "2"), ie(e, "stroke-linecap", "round"), ie(e, "stroke-linejoin", "round"), ie(e, "class", "feather feather-upload");
+ e = jn("svg"), t = jn("path"), n = jn("polyline"), i = jn("line"), ie(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ie(n, "points", "17 8 12 3 7 8"), ie(i, "x1", "12"), ie(i, "y1", "3"), ie(i, "x2", "12"), ie(i, "y2", "15"), ie(e, "xmlns", "http://www.w3.org/2000/svg"), ie(e, "width", "90%"), ie(e, "height", "90%"), ie(e, "viewBox", "0 0 24 24"), ie(e, "fill", "none"), ie(e, "stroke", "currentColor"), ie(e, "stroke-width", "2"), ie(e, "stroke-linecap", "round"), ie(e, "stroke-linejoin", "round"), ie(e, "class", "feather feather-upload");
},
- m(o, a) {
- tu(o, e, a), Bl(e, t), Bl(e, n), Bl(e, i);
+ m(s, a) {
+ $f(s, e, a), Il(e, t), Il(e, n), Il(e, i);
},
- p: Al,
- i: Al,
- o: Al,
- d(o) {
- o && $f(e);
+ p: Fl,
+ i: Fl,
+ o: Fl,
+ d(s) {
+ s && Qf(e);
}
};
}
-let os = class extends xf {
+let co = class extends Jf {
constructor(e) {
- super(), eu(this, e, null, lu, nu, {});
+ super(), xf(this, e, null, tu, eu, {});
}
};
const {
- SvelteComponent: iu,
- append: Li,
- attr: et,
- detach: ou,
- init: su,
- insert: au,
- noop: Ll,
- safe_not_equal: ru,
- svg_element: Dl
+ SvelteComponent: nu,
+ append: Xi,
+ attr: tt,
+ detach: lu,
+ init: iu,
+ insert: su,
+ noop: Hl,
+ safe_not_equal: ou,
+ svg_element: Xl
} = window.__gradio__svelte__internal;
-function fu(l) {
+function au(l) {
let e, t, n;
return {
c() {
- e = Dl("svg"), t = Dl("path"), n = Dl("path"), et(t, "fill", "currentColor"), et(t, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), et(n, "fill", "currentColor"), et(n, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), et(e, "xmlns", "http://www.w3.org/2000/svg"), et(e, "width", "100%"), et(e, "height", "100%"), et(e, "viewBox", "0 0 24 24");
+ e = Xl("svg"), t = Xl("path"), n = Xl("path"), tt(t, "fill", "currentColor"), tt(t, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), tt(n, "fill", "currentColor"), tt(n, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), tt(e, "xmlns", "http://www.w3.org/2000/svg"), tt(e, "width", "100%"), tt(e, "height", "100%"), tt(e, "viewBox", "0 0 24 24");
},
- m(i, o) {
- au(i, e, o), Li(e, t), Li(e, n);
+ m(i, s) {
+ su(i, e, s), Xi(e, t), Xi(e, n);
},
- p: Ll,
- i: Ll,
- o: Ll,
+ p: Hl,
+ i: Hl,
+ o: Hl,
d(i) {
- i && ou(e);
+ i && lu(e);
}
};
}
-class uu extends iu {
+class ru extends nu {
constructor(e) {
- super(), su(this, e, null, fu, ru, {});
+ super(), iu(this, e, null, au, ou, {});
}
}
-const cu = [
+const fu = [
{ color: "red", primary: 600, secondary: 100 },
{ color: "green", primary: 600, secondary: 100 },
{ color: "blue", primary: 600, secondary: 100 },
@@ -1394,7 +1361,7 @@ const cu = [
{ color: "cyan", primary: 600, secondary: 100 },
{ color: "lime", primary: 500, secondary: 100 },
{ color: "pink", primary: 600, secondary: 100 }
-], Di = {
+], Yi = {
inherit: "inherit",
current: "currentColor",
transparent: "transparent",
@@ -1687,64 +1654,64 @@ const cu = [
950: "#4c0519"
}
};
-cu.reduce(
+fu.reduce(
(l, { color: e, primary: t, secondary: n }) => ({
...l,
[e]: {
- primary: Di[e][t],
- secondary: Di[e][n]
+ primary: Yi[e][t],
+ secondary: Yi[e][n]
}
}),
{}
);
-class Xn extends Error {
+class Pn extends Error {
constructor(e) {
super(e), this.name = "ShareError";
}
}
-async function _u(l, e) {
- var s;
+async function uu(l, e) {
+ var o;
if (window.__gradio_space__ == null)
- throw new Xn("Must be on Spaces to share.");
+ throw new Pn("Must be on Spaces to share.");
let t, n, i;
- t = du(l), n = l.split(";")[0].split(":")[1], i = "file" + n.split("/")[1];
- const o = new File([t], i, { type: n }), a = await fetch("https://huggingface.co/uploads", {
+ t = cu(l), n = l.split(";")[0].split(":")[1], i = "file" + n.split("/")[1];
+ const s = new File([t], i, { type: n }), a = await fetch("https://huggingface.co/uploads", {
method: "POST",
- body: o,
+ body: s,
headers: {
- "Content-Type": o.type,
+ "Content-Type": s.type,
"X-Requested-With": "XMLHttpRequest"
}
});
if (!a.ok) {
- if ((s = a.headers.get("content-type")) != null && s.includes("application/json")) {
+ if ((o = a.headers.get("content-type")) != null && o.includes("application/json")) {
const f = await a.json();
- throw new Xn(`Upload failed: ${f.error}`);
+ throw new Pn(`Upload failed: ${f.error}`);
}
- throw new Xn("Upload failed.");
+ throw new Pn("Upload failed.");
}
return await a.text();
}
-function du(l) {
- for (var e = l.split(","), t = e[0].match(/:(.*?);/)[1], n = atob(e[1]), i = n.length, o = new Uint8Array(i); i--; )
- o[i] = n.charCodeAt(i);
- return new Blob([o], { type: t });
+function cu(l) {
+ for (var e = l.split(","), t = e[0].match(/:(.*?);/)[1], n = atob(e[1]), i = n.length, s = new Uint8Array(i); i--; )
+ s[i] = n.charCodeAt(i);
+ return new Blob([s], { type: t });
}
const {
- SvelteComponent: hu,
- create_component: mu,
- destroy_component: bu,
- init: gu,
- mount_component: wu,
- safe_not_equal: pu,
- transition_in: ku,
- transition_out: vu
-} = window.__gradio__svelte__internal, { createEventDispatcher: yu } = window.__gradio__svelte__internal;
-function Cu(l) {
+ SvelteComponent: _u,
+ create_component: du,
+ destroy_component: hu,
+ init: mu,
+ mount_component: bu,
+ safe_not_equal: gu,
+ transition_in: wu,
+ transition_out: pu
+} = window.__gradio__svelte__internal, { createEventDispatcher: ku } = window.__gradio__svelte__internal;
+function vu(l) {
let e, t;
- return e = new al({
+ return e = new hl({
props: {
- Icon: af,
+ Icon: df,
label: (
/*i18n*/
l[2]("common.share")
@@ -1760,147 +1727,147 @@ function Cu(l) {
l[5]
), {
c() {
- mu(e.$$.fragment);
+ du(e.$$.fragment);
},
m(n, i) {
- wu(e, n, i), t = !0;
+ bu(e, n, i), t = !0;
},
p(n, [i]) {
- const o = {};
+ const s = {};
i & /*i18n*/
- 4 && (o.label = /*i18n*/
+ 4 && (s.label = /*i18n*/
n[2]("common.share")), i & /*pending*/
- 8 && (o.pending = /*pending*/
- n[3]), e.$set(o);
+ 8 && (s.pending = /*pending*/
+ n[3]), e.$set(s);
},
i(n) {
- t || (ku(e.$$.fragment, n), t = !0);
+ t || (wu(e.$$.fragment, n), t = !0);
},
o(n) {
- vu(e.$$.fragment, n), t = !1;
+ pu(e.$$.fragment, n), t = !1;
},
d(n) {
- bu(e, n);
+ hu(e, n);
}
};
}
-function Su(l, e, t) {
- const n = yu();
- let { formatter: i } = e, { value: o } = e, { i18n: a } = e, r = !1;
- const s = async () => {
+function yu(l, e, t) {
+ const n = ku();
+ let { formatter: i } = e, { value: s } = e, { i18n: a } = e, r = !1;
+ const o = async () => {
try {
t(3, r = !0);
- const f = await i(o);
+ const f = await i(s);
n("share", { description: f });
} catch (f) {
console.error(f);
- let u = f instanceof Xn ? f.message : "Share failed.";
+ let u = f instanceof Pn ? f.message : "Share failed.";
n("error", u);
} finally {
t(3, r = !1);
}
};
return l.$$set = (f) => {
- "formatter" in f && t(0, i = f.formatter), "value" in f && t(1, o = f.value), "i18n" in f && t(2, a = f.i18n);
- }, [i, o, a, r, n, s];
+ "formatter" in f && t(0, i = f.formatter), "value" in f && t(1, s = f.value), "i18n" in f && t(2, a = f.i18n);
+ }, [i, s, a, r, n, o];
}
-class zu extends hu {
+class Cu extends _u {
constructor(e) {
- super(), gu(this, e, Su, Cu, pu, { formatter: 0, value: 1, i18n: 2 });
+ super(), mu(this, e, yu, vu, gu, { formatter: 0, value: 1, i18n: 2 });
}
}
const {
- SvelteComponent: qu,
- append: kt,
- attr: Gl,
- check_outros: Eu,
- create_component: ss,
- destroy_component: as,
- detach: Yn,
- element: Jl,
- group_outros: Mu,
- init: Bu,
- insert: Wn,
- mount_component: rs,
+ SvelteComponent: Su,
+ append: St,
+ attr: ii,
+ check_outros: zu,
+ create_component: _o,
+ destroy_component: ho,
+ detach: Zn,
+ element: si,
+ group_outros: qu,
+ init: Eu,
+ insert: Kn,
+ mount_component: mo,
safe_not_equal: Au,
- set_data: Ql,
- space: xl,
- text: ln,
- toggle_class: Ti,
- transition_in: Gn,
- transition_out: Jn
+ set_data: oi,
+ space: ai,
+ text: fn,
+ toggle_class: Ui,
+ transition_in: $n,
+ transition_out: el
} = window.__gradio__svelte__internal;
-function Lu(l) {
+function Bu(l) {
let e, t;
- return e = new os({}), {
+ return e = new co({}), {
c() {
- ss(e.$$.fragment);
+ _o(e.$$.fragment);
},
m(n, i) {
- rs(e, n, i), t = !0;
+ mo(e, n, i), t = !0;
},
i(n) {
- t || (Gn(e.$$.fragment, n), t = !0);
+ t || ($n(e.$$.fragment, n), t = !0);
},
o(n) {
- Jn(e.$$.fragment, n), t = !1;
+ el(e.$$.fragment, n), t = !1;
},
d(n) {
- as(e, n);
+ ho(e, n);
}
};
}
-function Du(l) {
+function Mu(l) {
let e, t;
- return e = new is({}), {
+ return e = new uo({}), {
c() {
- ss(e.$$.fragment);
+ _o(e.$$.fragment);
},
m(n, i) {
- rs(e, n, i), t = !0;
+ mo(e, n, i), t = !0;
},
i(n) {
- t || (Gn(e.$$.fragment, n), t = !0);
+ t || ($n(e.$$.fragment, n), t = !0);
},
o(n) {
- Jn(e.$$.fragment, n), t = !1;
+ el(e.$$.fragment, n), t = !1;
},
d(n) {
- as(e, n);
+ ho(e, n);
}
};
}
-function ji(l) {
+function Ni(l) {
let e, t, n = (
/*i18n*/
l[1]("common.or") + ""
- ), i, o, a, r = (
+ ), i, s, a, r = (
/*message*/
(l[2] || /*i18n*/
l[1]("upload_text.click_to_upload")) + ""
- ), s;
+ ), o;
return {
c() {
- e = Jl("span"), t = ln("- "), i = ln(n), o = ln(" -"), a = xl(), s = ln(r), Gl(e, "class", "or svelte-kzcjhc");
+ e = si("span"), t = fn("- "), i = fn(n), s = fn(" -"), a = ai(), o = fn(r), ii(e, "class", "or svelte-kzcjhc");
},
m(f, u) {
- Wn(f, e, u), kt(e, t), kt(e, i), kt(e, o), Wn(f, a, u), Wn(f, s, u);
+ Kn(f, e, u), St(e, t), St(e, i), St(e, s), Kn(f, a, u), Kn(f, o, u);
},
p(f, u) {
u & /*i18n*/
2 && n !== (n = /*i18n*/
- f[1]("common.or") + "") && Ql(i, n), u & /*message, i18n*/
+ f[1]("common.or") + "") && oi(i, n), u & /*message, i18n*/
6 && r !== (r = /*message*/
(f[2] || /*i18n*/
- f[1]("upload_text.click_to_upload")) + "") && Ql(s, r);
+ f[1]("upload_text.click_to_upload")) + "") && oi(o, r);
},
d(f) {
- f && (Yn(e), Yn(a), Yn(s));
+ f && (Zn(e), Zn(a), Zn(o));
}
};
}
-function Tu(l) {
- let e, t, n, i, o, a = (
+function Lu(l) {
+ let e, t, n, i, s, a = (
/*i18n*/
l[1](
/*defs*/
@@ -1910,67 +1877,67 @@ function Tu(l) {
] || /*defs*/
l[5].file
) + ""
- ), r, s, f;
- const u = [Du, Lu], c = [];
- function _(h, b) {
+ ), r, o, f;
+ const u = [Mu, Bu], c = [];
+ function d(b, h) {
return (
/*type*/
- h[0] === "clipboard" ? 0 : 1
+ b[0] === "clipboard" ? 0 : 1
);
}
- n = _(l), i = c[n] = u[n](l);
- let d = (
+ n = d(l), i = c[n] = u[n](l);
+ let _ = (
/*mode*/
- l[3] !== "short" && ji(l)
+ l[3] !== "short" && Ni(l)
);
return {
c() {
- e = Jl("div"), t = Jl("span"), i.c(), o = xl(), r = ln(a), s = xl(), d && d.c(), Gl(t, "class", "icon-wrap svelte-kzcjhc"), Ti(
+ e = si("div"), t = si("span"), i.c(), s = ai(), r = fn(a), o = ai(), _ && _.c(), ii(t, "class", "icon-wrap svelte-kzcjhc"), Ui(
t,
"hovered",
/*hovered*/
l[4]
- ), Gl(e, "class", "wrap svelte-kzcjhc");
+ ), ii(e, "class", "wrap svelte-kzcjhc");
},
- m(h, b) {
- Wn(h, e, b), kt(e, t), c[n].m(t, null), kt(e, o), kt(e, r), kt(e, s), d && d.m(e, null), f = !0;
+ m(b, h) {
+ Kn(b, e, h), St(e, t), c[n].m(t, null), St(e, s), St(e, r), St(e, o), _ && _.m(e, null), f = !0;
},
- p(h, [b]) {
- let m = n;
- n = _(h), n !== m && (Mu(), Jn(c[m], 1, 1, () => {
- c[m] = null;
- }), Eu(), i = c[n], i || (i = c[n] = u[n](h), i.c()), Gn(i, 1), i.m(t, null)), (!f || b & /*hovered*/
- 16) && Ti(
+ p(b, [h]) {
+ let w = n;
+ n = d(b), n !== w && (qu(), el(c[w], 1, 1, () => {
+ c[w] = null;
+ }), zu(), i = c[n], i || (i = c[n] = u[n](b), i.c()), $n(i, 1), i.m(t, null)), (!f || h & /*hovered*/
+ 16) && Ui(
t,
"hovered",
/*hovered*/
- h[4]
- ), (!f || b & /*i18n, type*/
+ b[4]
+ ), (!f || h & /*i18n, type*/
3) && a !== (a = /*i18n*/
- h[1](
+ b[1](
/*defs*/
- h[5][
+ b[5][
/*type*/
- h[0]
+ b[0]
] || /*defs*/
- h[5].file
- ) + "") && Ql(r, a), /*mode*/
- h[3] !== "short" ? d ? d.p(h, b) : (d = ji(h), d.c(), d.m(e, null)) : d && (d.d(1), d = null);
+ b[5].file
+ ) + "") && oi(r, a), /*mode*/
+ b[3] !== "short" ? _ ? _.p(b, h) : (_ = Ni(b), _.c(), _.m(e, null)) : _ && (_.d(1), _ = null);
},
- i(h) {
- f || (Gn(i), f = !0);
+ i(b) {
+ f || ($n(i), f = !0);
},
- o(h) {
- Jn(i), f = !1;
+ o(b) {
+ el(i), f = !1;
},
- d(h) {
- h && Yn(e), c[n].d(), d && d.d();
+ d(b) {
+ b && Zn(e), c[n].d(), _ && _.d();
}
};
}
-function ju(l, e, t) {
- let { type: n = "file" } = e, { i18n: i } = e, { message: o = void 0 } = e, { mode: a = "full" } = e, { hovered: r = !1 } = e;
- const s = {
+function Du(l, e, t) {
+ let { type: n = "file" } = e, { i18n: i } = e, { message: s = void 0 } = e, { mode: a = "full" } = e, { hovered: r = !1 } = e;
+ const o = {
image: "upload_text.drop_image",
video: "upload_text.drop_video",
audio: "upload_text.drop_audio",
@@ -1980,12 +1947,12 @@ function ju(l, e, t) {
clipboard: "upload_text.paste_clipboard"
};
return l.$$set = (f) => {
- "type" in f && t(0, n = f.type), "i18n" in f && t(1, i = f.i18n), "message" in f && t(2, o = f.message), "mode" in f && t(3, a = f.mode), "hovered" in f && t(4, r = f.hovered);
- }, [n, i, o, a, r, s];
+ "type" in f && t(0, n = f.type), "i18n" in f && t(1, i = f.i18n), "message" in f && t(2, s = f.message), "mode" in f && t(3, a = f.mode), "hovered" in f && t(4, r = f.hovered);
+ }, [n, i, s, a, r, o];
}
-class fs extends qu {
+class bo extends Su {
constructor(e) {
- super(), Bu(this, e, ju, Tu, Au, {
+ super(), Eu(this, e, Du, Lu, Au, {
type: 0,
i18n: 1,
message: 2,
@@ -1995,86 +1962,86 @@ class fs extends qu {
}
}
const {
- SvelteComponent: Iu,
- append: Tl,
+ SvelteComponent: Tu,
+ append: Yl,
attr: We,
- check_outros: on,
- create_component: rl,
- destroy_component: fl,
- detach: Kt,
- element: kn,
+ check_outros: un,
+ create_component: ml,
+ destroy_component: bl,
+ detach: $t,
+ element: zn,
empty: Ru,
- group_outros: sn,
- init: Fu,
- insert: Gt,
- listen: ul,
- mount_component: cl,
- safe_not_equal: Hu,
- space: jl,
- toggle_class: at,
- transition_in: $,
- transition_out: ue
+ group_outros: cn,
+ init: ju,
+ insert: en,
+ listen: gl,
+ mount_component: wl,
+ safe_not_equal: Iu,
+ space: Ul,
+ toggle_class: ct,
+ transition_in: ee,
+ transition_out: de
} = window.__gradio__svelte__internal;
-function Ii(l) {
+function Vi(l) {
let e, t = (
/*sources*/
l[1].includes("upload")
), n, i = (
/*sources*/
l[1].includes("microphone")
- ), o, a = (
+ ), s, a = (
/*sources*/
l[1].includes("webcam")
- ), r, s = (
+ ), r, o = (
/*sources*/
l[1].includes("clipboard")
- ), f, u = t && Ri(l), c = i && Fi(l), _ = a && Hi(l), d = s && Ui(l);
+ ), f, u = t && Oi(l), c = i && Wi(l), d = a && Pi(l), _ = o && Zi(l);
return {
c() {
- e = kn("span"), u && u.c(), n = jl(), c && c.c(), o = jl(), _ && _.c(), r = jl(), d && d.c(), We(e, "class", "source-selection svelte-1jp3vgd"), We(e, "data-testid", "source-select");
+ e = zn("span"), u && u.c(), n = Ul(), c && c.c(), s = Ul(), d && d.c(), r = Ul(), _ && _.c(), We(e, "class", "source-selection svelte-1jp3vgd"), We(e, "data-testid", "source-select");
},
- m(h, b) {
- Gt(h, e, b), u && u.m(e, null), Tl(e, n), c && c.m(e, null), Tl(e, o), _ && _.m(e, null), Tl(e, r), d && d.m(e, null), f = !0;
+ m(b, h) {
+ en(b, e, h), u && u.m(e, null), Yl(e, n), c && c.m(e, null), Yl(e, s), d && d.m(e, null), Yl(e, r), _ && _.m(e, null), f = !0;
},
- p(h, b) {
- b & /*sources*/
+ p(b, h) {
+ h & /*sources*/
2 && (t = /*sources*/
- h[1].includes("upload")), t ? u ? (u.p(h, b), b & /*sources*/
- 2 && $(u, 1)) : (u = Ri(h), u.c(), $(u, 1), u.m(e, n)) : u && (sn(), ue(u, 1, 1, () => {
+ b[1].includes("upload")), t ? u ? (u.p(b, h), h & /*sources*/
+ 2 && ee(u, 1)) : (u = Oi(b), u.c(), ee(u, 1), u.m(e, n)) : u && (cn(), de(u, 1, 1, () => {
u = null;
- }), on()), b & /*sources*/
+ }), un()), h & /*sources*/
2 && (i = /*sources*/
- h[1].includes("microphone")), i ? c ? (c.p(h, b), b & /*sources*/
- 2 && $(c, 1)) : (c = Fi(h), c.c(), $(c, 1), c.m(e, o)) : c && (sn(), ue(c, 1, 1, () => {
+ b[1].includes("microphone")), i ? c ? (c.p(b, h), h & /*sources*/
+ 2 && ee(c, 1)) : (c = Wi(b), c.c(), ee(c, 1), c.m(e, s)) : c && (cn(), de(c, 1, 1, () => {
c = null;
- }), on()), b & /*sources*/
+ }), un()), h & /*sources*/
2 && (a = /*sources*/
- h[1].includes("webcam")), a ? _ ? (_.p(h, b), b & /*sources*/
- 2 && $(_, 1)) : (_ = Hi(h), _.c(), $(_, 1), _.m(e, r)) : _ && (sn(), ue(_, 1, 1, () => {
- _ = null;
- }), on()), b & /*sources*/
- 2 && (s = /*sources*/
- h[1].includes("clipboard")), s ? d ? (d.p(h, b), b & /*sources*/
- 2 && $(d, 1)) : (d = Ui(h), d.c(), $(d, 1), d.m(e, null)) : d && (sn(), ue(d, 1, 1, () => {
+ b[1].includes("webcam")), a ? d ? (d.p(b, h), h & /*sources*/
+ 2 && ee(d, 1)) : (d = Pi(b), d.c(), ee(d, 1), d.m(e, r)) : d && (cn(), de(d, 1, 1, () => {
d = null;
- }), on());
+ }), un()), h & /*sources*/
+ 2 && (o = /*sources*/
+ b[1].includes("clipboard")), o ? _ ? (_.p(b, h), h & /*sources*/
+ 2 && ee(_, 1)) : (_ = Zi(b), _.c(), ee(_, 1), _.m(e, null)) : _ && (cn(), de(_, 1, 1, () => {
+ _ = null;
+ }), un());
},
- i(h) {
- f || ($(u), $(c), $(_), $(d), f = !0);
+ i(b) {
+ f || (ee(u), ee(c), ee(d), ee(_), f = !0);
},
- o(h) {
- ue(u), ue(c), ue(_), ue(d), f = !1;
+ o(b) {
+ de(u), de(c), de(d), de(_), f = !1;
},
- d(h) {
- h && Kt(e), u && u.d(), c && c.d(), _ && _.d(), d && d.d();
+ d(b) {
+ b && $t(e), u && u.d(), c && c.d(), d && d.d(), _ && _.d();
}
};
}
-function Ri(l) {
- let e, t, n, i, o;
- return t = new os({}), {
+function Oi(l) {
+ let e, t, n, i, s;
+ return t = new co({}), {
c() {
- e = kn("button"), rl(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Upload file"), at(
+ e = zn("button"), ml(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Upload file"), ct(
e,
"selected",
/*active_source*/
@@ -2083,7 +2050,7 @@ function Ri(l) {
);
},
m(a, r) {
- Gt(a, e, r), cl(t, e, null), n = !0, i || (o = ul(
+ en(a, e, r), wl(t, e, null), n = !0, i || (s = gl(
e,
"click",
/*click_handler*/
@@ -2092,7 +2059,7 @@ function Ri(l) {
},
p(a, r) {
(!n || r & /*active_source*/
- 1) && at(
+ 1) && ct(
e,
"selected",
/*active_source*/
@@ -2101,21 +2068,21 @@ function Ri(l) {
);
},
i(a) {
- n || ($(t.$$.fragment, a), n = !0);
+ n || (ee(t.$$.fragment, a), n = !0);
},
o(a) {
- ue(t.$$.fragment, a), n = !1;
+ de(t.$$.fragment, a), n = !1;
},
d(a) {
- a && Kt(e), fl(t), i = !1, o();
+ a && $t(e), bl(t), i = !1, s();
}
};
}
-function Fi(l) {
- let e, t, n, i, o;
- return t = new Qf({}), {
+function Wi(l) {
+ let e, t, n, i, s;
+ return t = new Gf({}), {
c() {
- e = kn("button"), rl(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Record audio"), at(
+ e = zn("button"), ml(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Record audio"), ct(
e,
"selected",
/*active_source*/
@@ -2123,7 +2090,7 @@ function Fi(l) {
);
},
m(a, r) {
- Gt(a, e, r), cl(t, e, null), n = !0, i || (o = ul(
+ en(a, e, r), wl(t, e, null), n = !0, i || (s = gl(
e,
"click",
/*click_handler_1*/
@@ -2132,7 +2099,7 @@ function Fi(l) {
},
p(a, r) {
(!n || r & /*active_source*/
- 1) && at(
+ 1) && ct(
e,
"selected",
/*active_source*/
@@ -2140,21 +2107,21 @@ function Fi(l) {
);
},
i(a) {
- n || ($(t.$$.fragment, a), n = !0);
+ n || (ee(t.$$.fragment, a), n = !0);
},
o(a) {
- ue(t.$$.fragment, a), n = !1;
+ de(t.$$.fragment, a), n = !1;
},
d(a) {
- a && Kt(e), fl(t), i = !1, o();
+ a && $t(e), bl(t), i = !1, s();
}
};
}
-function Hi(l) {
- let e, t, n, i, o;
- return t = new uu({}), {
+function Pi(l) {
+ let e, t, n, i, s;
+ return t = new ru({}), {
c() {
- e = kn("button"), rl(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Capture from camera"), at(
+ e = zn("button"), ml(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Capture from camera"), ct(
e,
"selected",
/*active_source*/
@@ -2162,7 +2129,7 @@ function Hi(l) {
);
},
m(a, r) {
- Gt(a, e, r), cl(t, e, null), n = !0, i || (o = ul(
+ en(a, e, r), wl(t, e, null), n = !0, i || (s = gl(
e,
"click",
/*click_handler_2*/
@@ -2171,7 +2138,7 @@ function Hi(l) {
},
p(a, r) {
(!n || r & /*active_source*/
- 1) && at(
+ 1) && ct(
e,
"selected",
/*active_source*/
@@ -2179,21 +2146,21 @@ function Hi(l) {
);
},
i(a) {
- n || ($(t.$$.fragment, a), n = !0);
+ n || (ee(t.$$.fragment, a), n = !0);
},
o(a) {
- ue(t.$$.fragment, a), n = !1;
+ de(t.$$.fragment, a), n = !1;
},
d(a) {
- a && Kt(e), fl(t), i = !1, o();
+ a && $t(e), bl(t), i = !1, s();
}
};
}
-function Ui(l) {
- let e, t, n, i, o;
- return t = new is({}), {
+function Zi(l) {
+ let e, t, n, i, s;
+ return t = new uo({}), {
c() {
- e = kn("button"), rl(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Paste from clipboard"), at(
+ e = zn("button"), ml(t.$$.fragment), We(e, "class", "icon svelte-1jp3vgd"), We(e, "aria-label", "Paste from clipboard"), ct(
e,
"selected",
/*active_source*/
@@ -2201,7 +2168,7 @@ function Ui(l) {
);
},
m(a, r) {
- Gt(a, e, r), cl(t, e, null), n = !0, i || (o = ul(
+ en(a, e, r), wl(t, e, null), n = !0, i || (s = gl(
e,
"click",
/*click_handler_3*/
@@ -2210,7 +2177,7 @@ function Ui(l) {
},
p(a, r) {
(!n || r & /*active_source*/
- 1) && at(
+ 1) && ct(
e,
"selected",
/*active_source*/
@@ -2218,105 +2185,105 @@ function Ui(l) {
);
},
i(a) {
- n || ($(t.$$.fragment, a), n = !0);
+ n || (ee(t.$$.fragment, a), n = !0);
},
o(a) {
- ue(t.$$.fragment, a), n = !1;
+ de(t.$$.fragment, a), n = !1;
},
d(a) {
- a && Kt(e), fl(t), i = !1, o();
+ a && $t(e), bl(t), i = !1, s();
}
};
}
-function Uu(l) {
+function Fu(l) {
let e, t, n = (
/*unique_sources*/
- l[2].length > 1 && Ii(l)
+ l[2].length > 1 && Vi(l)
);
return {
c() {
n && n.c(), e = Ru();
},
- m(i, o) {
- n && n.m(i, o), Gt(i, e, o), t = !0;
+ m(i, s) {
+ n && n.m(i, s), en(i, e, s), t = !0;
},
- p(i, [o]) {
+ p(i, [s]) {
/*unique_sources*/
- i[2].length > 1 ? n ? (n.p(i, o), o & /*unique_sources*/
- 4 && $(n, 1)) : (n = Ii(i), n.c(), $(n, 1), n.m(e.parentNode, e)) : n && (sn(), ue(n, 1, 1, () => {
+ i[2].length > 1 ? n ? (n.p(i, s), s & /*unique_sources*/
+ 4 && ee(n, 1)) : (n = Vi(i), n.c(), ee(n, 1), n.m(e.parentNode, e)) : n && (cn(), de(n, 1, 1, () => {
n = null;
- }), on());
+ }), un());
},
i(i) {
- t || ($(n), t = !0);
+ t || (ee(n), t = !0);
},
o(i) {
- ue(n), t = !1;
+ de(n), t = !1;
},
d(i) {
- i && Kt(e), n && n.d(i);
+ i && $t(e), n && n.d(i);
}
};
}
-function Nu(l, e, t) {
+function Hu(l, e, t) {
let n;
- var i = this && this.__awaiter || function(h, b, m, w) {
- function k(g) {
- return g instanceof m ? g : new m(function(S) {
- S(g);
+ var i = this && this.__awaiter || function(b, h, w, g) {
+ function p(m) {
+ return m instanceof w ? m : new w(function(C) {
+ C(m);
});
}
- return new (m || (m = Promise))(function(g, S) {
- function M(v) {
+ return new (w || (w = Promise))(function(m, C) {
+ function z(v) {
try {
- z(w.next(v));
- } catch (q) {
- S(q);
+ q(g.next(v));
+ } catch (E) {
+ C(E);
}
}
function y(v) {
try {
- z(w.throw(v));
- } catch (q) {
- S(q);
+ q(g.throw(v));
+ } catch (E) {
+ C(E);
}
}
- function z(v) {
- v.done ? g(v.value) : k(v.value).then(M, y);
+ function q(v) {
+ v.done ? m(v.value) : p(v.value).then(z, y);
}
- z((w = w.apply(h, b || [])).next());
+ q((g = g.apply(b, h || [])).next());
});
};
- let { sources: o } = e, { active_source: a } = e, { handle_clear: r = () => {
- } } = e, { handle_select: s = () => {
+ let { sources: s } = e, { active_source: a } = e, { handle_clear: r = () => {
+ } } = e, { handle_select: o = () => {
} } = e;
- function f(h) {
+ function f(b) {
return i(this, void 0, void 0, function* () {
- r(), t(0, a = h), s(h);
+ r(), t(0, a = b), o(b);
});
}
- const u = () => f("upload"), c = () => f("microphone"), _ = () => f("webcam"), d = () => f("clipboard");
- return l.$$set = (h) => {
- "sources" in h && t(1, o = h.sources), "active_source" in h && t(0, a = h.active_source), "handle_clear" in h && t(4, r = h.handle_clear), "handle_select" in h && t(5, s = h.handle_select);
+ const u = () => f("upload"), c = () => f("microphone"), d = () => f("webcam"), _ = () => f("clipboard");
+ return l.$$set = (b) => {
+ "sources" in b && t(1, s = b.sources), "active_source" in b && t(0, a = b.active_source), "handle_clear" in b && t(4, r = b.handle_clear), "handle_select" in b && t(5, o = b.handle_select);
}, l.$$.update = () => {
l.$$.dirty & /*sources*/
- 2 && t(2, n = [...new Set(o)]);
+ 2 && t(2, n = [...new Set(s)]);
}, [
a,
- o,
+ s,
n,
f,
r,
- s,
+ o,
u,
c,
- _,
- d
+ d,
+ _
];
}
-class Ou extends Iu {
+class Xu extends Tu {
constructor(e) {
- super(), Fu(this, e, Nu, Uu, Hu, {
+ super(), ju(this, e, Hu, Fu, Iu, {
sources: 1,
active_source: 0,
handle_clear: 4,
@@ -2324,19 +2291,19 @@ class Ou extends Iu {
});
}
}
-function Yt(l) {
+function Gt(l) {
let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
for (; l > 1e3 && t < e.length - 1; )
l /= 1e3, t++;
let n = e[t];
return (Number.isInteger(l) ? l : l.toFixed(1)) + n;
}
-function Vn() {
+function Gn() {
}
-function Xu(l, e) {
+function Yu(l, e) {
return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function";
}
-function Ni(l) {
+function Ki(l) {
const e = typeof l == "string" && l.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);
return e ? [parseFloat(e[1]), e[2] || "px"] : [
/** @type {number} */
@@ -2344,282 +2311,282 @@ function Ni(l) {
"px"
];
}
-const us = typeof window < "u";
-let Oi = us ? () => window.performance.now() : () => Date.now(), cs = us ? (l) => requestAnimationFrame(l) : Vn;
-const Pt = /* @__PURE__ */ new Set();
-function _s(l) {
- Pt.forEach((e) => {
- e.c(l) || (Pt.delete(e), e.f());
- }), Pt.size !== 0 && cs(_s);
+const go = typeof window < "u";
+let Gi = go ? () => window.performance.now() : () => Date.now(), wo = go ? (l) => requestAnimationFrame(l) : Gn;
+const xt = /* @__PURE__ */ new Set();
+function po(l) {
+ xt.forEach((e) => {
+ e.c(l) || (xt.delete(e), e.f());
+ }), xt.size !== 0 && wo(po);
}
-function Yu(l) {
+function Uu(l) {
let e;
- return Pt.size === 0 && cs(_s), {
+ return xt.size === 0 && wo(po), {
promise: new Promise((t) => {
- Pt.add(e = { c: l, f: t });
+ xt.add(e = { c: l, f: t });
}),
abort() {
- Pt.delete(e);
+ xt.delete(e);
}
};
}
-function Wu(l) {
+function Nu(l) {
const e = l - 1;
return e * e * e + 1;
}
-function Xi(l, { delay: e = 0, duration: t = 400, easing: n = Wu, x: i = 0, y: o = 0, opacity: a = 0 } = {}) {
- const r = getComputedStyle(l), s = +r.opacity, f = r.transform === "none" ? "" : r.transform, u = s * (1 - a), [c, _] = Ni(i), [d, h] = Ni(o);
+function Ji(l, { delay: e = 0, duration: t = 400, easing: n = Nu, x: i = 0, y: s = 0, opacity: a = 0 } = {}) {
+ const r = getComputedStyle(l), o = +r.opacity, f = r.transform === "none" ? "" : r.transform, u = o * (1 - a), [c, d] = Ki(i), [_, b] = Ki(s);
return {
delay: e,
duration: t,
easing: n,
- css: (b, m) => `
- transform: ${f} translate(${(1 - b) * c}${_}, ${(1 - b) * d}${h});
- opacity: ${s - u * m}`
+ css: (h, w) => `
+ transform: ${f} translate(${(1 - h) * c}${d}, ${(1 - h) * _}${b});
+ opacity: ${o - u * w}`
};
}
-const It = [];
-function Vu(l, e = Vn) {
+const Ht = [];
+function Vu(l, e = Gn) {
let t;
const n = /* @__PURE__ */ new Set();
function i(r) {
- if (Xu(l, r) && (l = r, t)) {
- const s = !It.length;
+ if (Yu(l, r) && (l = r, t)) {
+ const o = !Ht.length;
for (const f of n)
- f[1](), It.push(f, l);
- if (s) {
- for (let f = 0; f < It.length; f += 2)
- It[f][0](It[f + 1]);
- It.length = 0;
+ f[1](), Ht.push(f, l);
+ if (o) {
+ for (let f = 0; f < Ht.length; f += 2)
+ Ht[f][0](Ht[f + 1]);
+ Ht.length = 0;
}
}
}
- function o(r) {
+ function s(r) {
i(r(l));
}
- function a(r, s = Vn) {
- const f = [r, s];
- return n.add(f), n.size === 1 && (t = e(i, o) || Vn), r(l), () => {
+ function a(r, o = Gn) {
+ const f = [r, o];
+ return n.add(f), n.size === 1 && (t = e(i, s) || Gn), r(l), () => {
n.delete(f), n.size === 0 && t && (t(), t = null);
};
}
- return { set: i, update: o, subscribe: a };
+ return { set: i, update: s, subscribe: a };
}
-function Yi(l) {
+function Qi(l) {
return Object.prototype.toString.call(l) === "[object Date]";
}
-function $l(l, e, t, n) {
- if (typeof t == "number" || Yi(t)) {
- const i = n - t, o = (t - e) / (l.dt || 1 / 60), a = l.opts.stiffness * i, r = l.opts.damping * o, s = (a - r) * l.inv_mass, f = (o + s) * l.dt;
- return Math.abs(f) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, Yi(t) ? new Date(t.getTime() + f) : t + f);
+function ri(l, e, t, n) {
+ if (typeof t == "number" || Qi(t)) {
+ const i = n - t, s = (t - e) / (l.dt || 1 / 60), a = l.opts.stiffness * i, r = l.opts.damping * s, o = (a - r) * l.inv_mass, f = (s + o) * l.dt;
+ return Math.abs(f) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, Qi(t) ? new Date(t.getTime() + f) : t + f);
} else {
if (Array.isArray(t))
return t.map(
- (i, o) => $l(l, e[o], t[o], n[o])
+ (i, s) => ri(l, e[s], t[s], n[s])
);
if (typeof t == "object") {
const i = {};
- for (const o in t)
- i[o] = $l(l, e[o], t[o], n[o]);
+ for (const s in t)
+ i[s] = ri(l, e[s], t[s], n[s]);
return i;
} else
throw new Error(`Cannot spring ${typeof t} values`);
}
}
-function Wi(l, e = {}) {
- const t = Vu(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e;
- let a, r, s, f = l, u = l, c = 1, _ = 0, d = !1;
- function h(m, w = {}) {
- u = m;
- const k = s = {};
- return l == null || w.hard || b.stiffness >= 1 && b.damping >= 1 ? (d = !0, a = Oi(), f = m, t.set(l = u), Promise.resolve()) : (w.soft && (_ = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), c = 0), r || (a = Oi(), d = !1, r = Yu((g) => {
- if (d)
- return d = !1, r = null, !1;
- c = Math.min(c + _, 1);
- const S = {
+function xi(l, e = {}) {
+ const t = Vu(l), { stiffness: n = 0.15, damping: i = 0.8, precision: s = 0.01 } = e;
+ let a, r, o, f = l, u = l, c = 1, d = 0, _ = !1;
+ function b(w, g = {}) {
+ u = w;
+ const p = o = {};
+ return l == null || g.hard || h.stiffness >= 1 && h.damping >= 1 ? (_ = !0, a = Gi(), f = w, t.set(l = u), Promise.resolve()) : (g.soft && (d = 1 / ((g.soft === !0 ? 0.5 : +g.soft) * 60), c = 0), r || (a = Gi(), _ = !1, r = Uu((m) => {
+ if (_)
+ return _ = !1, r = null, !1;
+ c = Math.min(c + d, 1);
+ const C = {
inv_mass: c,
- opts: b,
+ opts: h,
settled: !0,
- dt: (g - a) * 60 / 1e3
- }, M = $l(S, f, l, u);
- return a = g, f = l, t.set(l = M), S.settled && (r = null), !S.settled;
- })), new Promise((g) => {
+ dt: (m - a) * 60 / 1e3
+ }, z = ri(C, f, l, u);
+ return a = m, f = l, t.set(l = z), C.settled && (r = null), !C.settled;
+ })), new Promise((m) => {
r.promise.then(() => {
- k === s && g();
+ p === o && m();
});
}));
}
- const b = {
- set: h,
- update: (m, w) => h(m(u, l), w),
+ const h = {
+ set: b,
+ update: (w, g) => b(w(u, l), g),
subscribe: t.subscribe,
stiffness: n,
damping: i,
- precision: o
+ precision: s
};
- return b;
+ return h;
}
const {
- SvelteComponent: Pu,
- append: je,
- attr: U,
- component_subscribe: Vi,
- detach: Zu,
- element: Ku,
- init: Gu,
- insert: Ju,
- noop: Pi,
- safe_not_equal: Qu,
- set_style: Bn,
- svg_element: Ie,
- toggle_class: Zi
-} = window.__gradio__svelte__internal, { onMount: xu } = window.__gradio__svelte__internal;
-function $u(l) {
- let e, t, n, i, o, a, r, s, f, u, c, _;
+ SvelteComponent: Ou,
+ append: De,
+ attr: Y,
+ component_subscribe: $i,
+ detach: Wu,
+ element: Pu,
+ init: Zu,
+ insert: Ku,
+ noop: es,
+ safe_not_equal: Gu,
+ set_style: In,
+ svg_element: Te,
+ toggle_class: ts
+} = window.__gradio__svelte__internal, { onMount: Ju } = window.__gradio__svelte__internal;
+function Qu(l) {
+ let e, t, n, i, s, a, r, o, f, u, c, d;
return {
c() {
- e = Ku("div"), t = Ie("svg"), n = Ie("g"), i = Ie("path"), o = Ie("path"), a = Ie("path"), r = Ie("path"), s = Ie("g"), f = Ie("path"), u = Ie("path"), c = Ie("path"), _ = Ie("path"), U(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), U(i, "fill", "#FF7C00"), U(i, "fill-opacity", "0.4"), U(i, "class", "svelte-43sxxs"), U(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), U(o, "fill", "#FF7C00"), U(o, "class", "svelte-43sxxs"), U(a, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), U(a, "fill", "#FF7C00"), U(a, "fill-opacity", "0.4"), U(a, "class", "svelte-43sxxs"), U(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), U(r, "fill", "#FF7C00"), U(r, "class", "svelte-43sxxs"), Bn(n, "transform", "translate(" + /*$top*/
+ e = Pu("div"), t = Te("svg"), n = Te("g"), i = Te("path"), s = Te("path"), a = Te("path"), r = Te("path"), o = Te("g"), f = Te("path"), u = Te("path"), c = Te("path"), d = Te("path"), Y(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), Y(i, "fill", "#FF7C00"), Y(i, "fill-opacity", "0.4"), Y(i, "class", "svelte-43sxxs"), Y(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), Y(s, "fill", "#FF7C00"), Y(s, "class", "svelte-43sxxs"), Y(a, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), Y(a, "fill", "#FF7C00"), Y(a, "fill-opacity", "0.4"), Y(a, "class", "svelte-43sxxs"), Y(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), Y(r, "fill", "#FF7C00"), Y(r, "class", "svelte-43sxxs"), In(n, "transform", "translate(" + /*$top*/
l[1][0] + "px, " + /*$top*/
- l[1][1] + "px)"), U(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), U(f, "fill", "#FF7C00"), U(f, "fill-opacity", "0.4"), U(f, "class", "svelte-43sxxs"), U(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), U(u, "fill", "#FF7C00"), U(u, "class", "svelte-43sxxs"), U(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), U(c, "fill", "#FF7C00"), U(c, "fill-opacity", "0.4"), U(c, "class", "svelte-43sxxs"), U(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), U(_, "fill", "#FF7C00"), U(_, "class", "svelte-43sxxs"), Bn(s, "transform", "translate(" + /*$bottom*/
+ l[1][1] + "px)"), Y(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), Y(f, "fill", "#FF7C00"), Y(f, "fill-opacity", "0.4"), Y(f, "class", "svelte-43sxxs"), Y(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), Y(u, "fill", "#FF7C00"), Y(u, "class", "svelte-43sxxs"), Y(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), Y(c, "fill", "#FF7C00"), Y(c, "fill-opacity", "0.4"), Y(c, "class", "svelte-43sxxs"), Y(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), Y(d, "fill", "#FF7C00"), Y(d, "class", "svelte-43sxxs"), In(o, "transform", "translate(" + /*$bottom*/
l[2][0] + "px, " + /*$bottom*/
- l[2][1] + "px)"), U(t, "viewBox", "-1200 -1200 3000 3000"), U(t, "fill", "none"), U(t, "xmlns", "http://www.w3.org/2000/svg"), U(t, "class", "svelte-43sxxs"), U(e, "class", "svelte-43sxxs"), Zi(
+ l[2][1] + "px)"), Y(t, "viewBox", "-1200 -1200 3000 3000"), Y(t, "fill", "none"), Y(t, "xmlns", "http://www.w3.org/2000/svg"), Y(t, "class", "svelte-43sxxs"), Y(e, "class", "svelte-43sxxs"), ts(
e,
"margin",
/*margin*/
l[0]
);
},
- m(d, h) {
- Ju(d, e, h), je(e, t), je(t, n), je(n, i), je(n, o), je(n, a), je(n, r), je(t, s), je(s, f), je(s, u), je(s, c), je(s, _);
+ m(_, b) {
+ Ku(_, e, b), De(e, t), De(t, n), De(n, i), De(n, s), De(n, a), De(n, r), De(t, o), De(o, f), De(o, u), De(o, c), De(o, d);
},
- p(d, [h]) {
- h & /*$top*/
- 2 && Bn(n, "transform", "translate(" + /*$top*/
- d[1][0] + "px, " + /*$top*/
- d[1][1] + "px)"), h & /*$bottom*/
- 4 && Bn(s, "transform", "translate(" + /*$bottom*/
- d[2][0] + "px, " + /*$bottom*/
- d[2][1] + "px)"), h & /*margin*/
- 1 && Zi(
+ p(_, [b]) {
+ b & /*$top*/
+ 2 && In(n, "transform", "translate(" + /*$top*/
+ _[1][0] + "px, " + /*$top*/
+ _[1][1] + "px)"), b & /*$bottom*/
+ 4 && In(o, "transform", "translate(" + /*$bottom*/
+ _[2][0] + "px, " + /*$bottom*/
+ _[2][1] + "px)"), b & /*margin*/
+ 1 && ts(
e,
"margin",
/*margin*/
- d[0]
+ _[0]
);
},
- i: Pi,
- o: Pi,
- d(d) {
- d && Zu(e);
+ i: es,
+ o: es,
+ d(_) {
+ _ && Wu(e);
}
};
}
-function ec(l, e, t) {
+function xu(l, e, t) {
let n, i;
- var o = this && this.__awaiter || function(d, h, b, m) {
- function w(k) {
- return k instanceof b ? k : new b(function(g) {
- g(k);
+ var s = this && this.__awaiter || function(_, b, h, w) {
+ function g(p) {
+ return p instanceof h ? p : new h(function(m) {
+ m(p);
});
}
- return new (b || (b = Promise))(function(k, g) {
- function S(z) {
+ return new (h || (h = Promise))(function(p, m) {
+ function C(q) {
try {
- y(m.next(z));
+ y(w.next(q));
} catch (v) {
- g(v);
+ m(v);
}
}
- function M(z) {
+ function z(q) {
try {
- y(m.throw(z));
+ y(w.throw(q));
} catch (v) {
- g(v);
+ m(v);
}
}
- function y(z) {
- z.done ? k(z.value) : w(z.value).then(S, M);
+ function y(q) {
+ q.done ? p(q.value) : g(q.value).then(C, z);
}
- y((m = m.apply(d, h || [])).next());
+ y((w = w.apply(_, b || [])).next());
});
};
let { margin: a = !0 } = e;
- const r = Wi([0, 0]);
- Vi(l, r, (d) => t(1, n = d));
- const s = Wi([0, 0]);
- Vi(l, s, (d) => t(2, i = d));
+ const r = xi([0, 0]);
+ $i(l, r, (_) => t(1, n = _));
+ const o = xi([0, 0]);
+ $i(l, o, (_) => t(2, i = _));
let f;
function u() {
- return o(this, void 0, void 0, function* () {
- yield Promise.all([r.set([125, 140]), s.set([-125, -140])]), yield Promise.all([r.set([-125, 140]), s.set([125, -140])]), yield Promise.all([r.set([-125, 0]), s.set([125, -0])]), yield Promise.all([r.set([125, 0]), s.set([-125, 0])]);
+ return s(this, void 0, void 0, function* () {
+ yield Promise.all([r.set([125, 140]), o.set([-125, -140])]), yield Promise.all([r.set([-125, 140]), o.set([125, -140])]), yield Promise.all([r.set([-125, 0]), o.set([125, -0])]), yield Promise.all([r.set([125, 0]), o.set([-125, 0])]);
});
}
function c() {
- return o(this, void 0, void 0, function* () {
+ return s(this, void 0, void 0, function* () {
yield u(), f || c();
});
}
- function _() {
- return o(this, void 0, void 0, function* () {
- yield Promise.all([r.set([125, 0]), s.set([-125, 0])]), c();
+ function d() {
+ return s(this, void 0, void 0, function* () {
+ yield Promise.all([r.set([125, 0]), o.set([-125, 0])]), c();
});
}
- return xu(() => (_(), () => f = !0)), l.$$set = (d) => {
- "margin" in d && t(0, a = d.margin);
- }, [a, n, i, r, s];
+ return Ju(() => (d(), () => f = !0)), l.$$set = (_) => {
+ "margin" in _ && t(0, a = _.margin);
+ }, [a, n, i, r, o];
}
-class tc extends Pu {
+class $u extends Ou {
constructor(e) {
- super(), Gu(this, e, ec, $u, Qu, { margin: 0 });
+ super(), Zu(this, e, xu, Qu, Gu, { margin: 0 });
}
}
const {
- SvelteComponent: nc,
- append: vt,
- attr: Fe,
- binding_callbacks: Ki,
- check_outros: ei,
- create_component: ds,
- create_slot: hs,
- destroy_component: ms,
- destroy_each: bs,
- detach: T,
- element: Xe,
- empty: Jt,
- ensure_array_like: Qn,
- get_all_dirty_from_scope: gs,
- get_slot_changes: ws,
- group_outros: ti,
- init: lc,
+ SvelteComponent: ec,
+ append: zt,
+ attr: Ie,
+ binding_callbacks: ns,
+ check_outros: fi,
+ create_component: ko,
+ create_slot: vo,
+ destroy_component: yo,
+ destroy_each: Co,
+ detach: R,
+ element: Ve,
+ empty: tn,
+ ensure_array_like: tl,
+ get_all_dirty_from_scope: So,
+ get_slot_changes: zo,
+ group_outros: ui,
+ init: tc,
insert: j,
- mount_component: ps,
- noop: ni,
- safe_not_equal: ic,
- set_data: Be,
- set_style: ot,
- space: Me,
- text: P,
- toggle_class: Ee,
- transition_in: Re,
- transition_out: Ye,
- update_slot_base: ks
-} = window.__gradio__svelte__internal, { tick: oc } = window.__gradio__svelte__internal, { onDestroy: sc } = window.__gradio__svelte__internal, { createEventDispatcher: ac } = window.__gradio__svelte__internal, rc = (l) => ({}), Gi = (l) => ({}), fc = (l) => ({}), Ji = (l) => ({});
-function Qi(l, e, t) {
+ mount_component: qo,
+ noop: ci,
+ safe_not_equal: nc,
+ set_data: Me,
+ set_style: ft,
+ space: Be,
+ text: K,
+ toggle_class: Ae,
+ transition_in: je,
+ transition_out: Oe,
+ update_slot_base: Eo
+} = window.__gradio__svelte__internal, { tick: lc } = window.__gradio__svelte__internal, { onDestroy: ic } = window.__gradio__svelte__internal, { createEventDispatcher: sc } = window.__gradio__svelte__internal, oc = (l) => ({}), ls = (l) => ({}), ac = (l) => ({}), is = (l) => ({});
+function ss(l, e, t) {
const n = l.slice();
return n[41] = e[t], n[43] = t, n;
}
-function xi(l, e, t) {
+function os(l, e, t) {
const n = l.slice();
return n[41] = e[t], n;
}
-function uc(l) {
- let e, t, n, i, o = (
+function rc(l) {
+ let e, t, n, i, s = (
/*i18n*/
l[1]("common.error") + ""
- ), a, r, s;
- t = new al({
+ ), a, r, o;
+ t = new hl({
props: {
- Icon: ci,
+ Icon: ro,
label: (
/*i18n*/
l[1]("common.clear")
@@ -2634,158 +2601,158 @@ function uc(l) {
const f = (
/*#slots*/
l[30].error
- ), u = hs(
+ ), u = vo(
f,
l,
/*$$scope*/
l[29],
- Gi
+ ls
);
return {
c() {
- e = Xe("div"), ds(t.$$.fragment), n = Me(), i = Xe("span"), a = P(o), r = Me(), u && u.c(), Fe(e, "class", "clear-status svelte-16nch4a"), Fe(i, "class", "error svelte-16nch4a");
- },
- m(c, _) {
- j(c, e, _), ps(t, e, null), j(c, n, _), j(c, i, _), vt(i, a), j(c, r, _), u && u.m(c, _), s = !0;
- },
- p(c, _) {
- const d = {};
- _[0] & /*i18n*/
- 2 && (d.label = /*i18n*/
- c[1]("common.clear")), t.$set(d), (!s || _[0] & /*i18n*/
- 2) && o !== (o = /*i18n*/
- c[1]("common.error") + "") && Be(a, o), u && u.p && (!s || _[0] & /*$$scope*/
- 536870912) && ks(
+ e = Ve("div"), ko(t.$$.fragment), n = Be(), i = Ve("span"), a = K(s), r = Be(), u && u.c(), Ie(e, "class", "clear-status svelte-16nch4a"), Ie(i, "class", "error svelte-16nch4a");
+ },
+ m(c, d) {
+ j(c, e, d), qo(t, e, null), j(c, n, d), j(c, i, d), zt(i, a), j(c, r, d), u && u.m(c, d), o = !0;
+ },
+ p(c, d) {
+ const _ = {};
+ d[0] & /*i18n*/
+ 2 && (_.label = /*i18n*/
+ c[1]("common.clear")), t.$set(_), (!o || d[0] & /*i18n*/
+ 2) && s !== (s = /*i18n*/
+ c[1]("common.error") + "") && Me(a, s), u && u.p && (!o || d[0] & /*$$scope*/
+ 536870912) && Eo(
u,
f,
c,
/*$$scope*/
c[29],
- s ? ws(
+ o ? zo(
f,
/*$$scope*/
c[29],
- _,
- rc
- ) : gs(
+ d,
+ oc
+ ) : So(
/*$$scope*/
c[29]
),
- Gi
+ ls
);
},
i(c) {
- s || (Re(t.$$.fragment, c), Re(u, c), s = !0);
+ o || (je(t.$$.fragment, c), je(u, c), o = !0);
},
o(c) {
- Ye(t.$$.fragment, c), Ye(u, c), s = !1;
+ Oe(t.$$.fragment, c), Oe(u, c), o = !1;
},
d(c) {
- c && (T(e), T(n), T(i), T(r)), ms(t), u && u.d(c);
+ c && (R(e), R(n), R(i), R(r)), yo(t), u && u.d(c);
}
};
}
-function cc(l) {
- let e, t, n, i, o, a, r, s, f, u = (
+function fc(l) {
+ let e, t, n, i, s, a, r, o, f, u = (
/*variant*/
l[8] === "default" && /*show_eta_bar*/
l[18] && /*show_progress*/
- l[6] === "full" && $i(l)
+ l[6] === "full" && as(l)
);
- function c(g, S) {
+ function c(m, C) {
if (
/*progress*/
- g[7]
- ) return hc;
+ m[7]
+ ) return _c;
if (
/*queue_position*/
- g[2] !== null && /*queue_size*/
- g[3] !== void 0 && /*queue_position*/
- g[2] >= 0
- ) return dc;
+ m[2] !== null && /*queue_size*/
+ m[3] !== void 0 && /*queue_position*/
+ m[2] >= 0
+ ) return cc;
if (
/*queue_position*/
- g[2] === 0
- ) return _c;
+ m[2] === 0
+ ) return uc;
}
- let _ = c(l), d = _ && _(l), h = (
+ let d = c(l), _ = d && d(l), b = (
/*timer*/
- l[5] && no(l)
+ l[5] && us(l)
);
- const b = [wc, gc], m = [];
- function w(g, S) {
+ const h = [bc, mc], w = [];
+ function g(m, C) {
return (
/*last_progress_level*/
- g[15] != null ? 0 : (
+ m[15] != null ? 0 : (
/*show_progress*/
- g[6] === "full" ? 1 : -1
+ m[6] === "full" ? 1 : -1
)
);
}
- ~(o = w(l)) && (a = m[o] = b[o](l));
- let k = !/*timer*/
- l[5] && fo(l);
+ ~(s = g(l)) && (a = w[s] = h[s](l));
+ let p = !/*timer*/
+ l[5] && gs(l);
return {
c() {
- u && u.c(), e = Me(), t = Xe("div"), d && d.c(), n = Me(), h && h.c(), i = Me(), a && a.c(), r = Me(), k && k.c(), s = Jt(), Fe(t, "class", "progress-text svelte-16nch4a"), Ee(
+ u && u.c(), e = Be(), t = Ve("div"), _ && _.c(), n = Be(), b && b.c(), i = Be(), a && a.c(), r = Be(), p && p.c(), o = tn(), Ie(t, "class", "progress-text svelte-16nch4a"), Ae(
t,
"meta-text-center",
/*variant*/
l[8] === "center"
- ), Ee(
+ ), Ae(
t,
"meta-text",
/*variant*/
l[8] === "default"
);
},
- m(g, S) {
- u && u.m(g, S), j(g, e, S), j(g, t, S), d && d.m(t, null), vt(t, n), h && h.m(t, null), j(g, i, S), ~o && m[o].m(g, S), j(g, r, S), k && k.m(g, S), j(g, s, S), f = !0;
+ m(m, C) {
+ u && u.m(m, C), j(m, e, C), j(m, t, C), _ && _.m(t, null), zt(t, n), b && b.m(t, null), j(m, i, C), ~s && w[s].m(m, C), j(m, r, C), p && p.m(m, C), j(m, o, C), f = !0;
},
- p(g, S) {
+ p(m, C) {
/*variant*/
- g[8] === "default" && /*show_eta_bar*/
- g[18] && /*show_progress*/
- g[6] === "full" ? u ? u.p(g, S) : (u = $i(g), u.c(), u.m(e.parentNode, e)) : u && (u.d(1), u = null), _ === (_ = c(g)) && d ? d.p(g, S) : (d && d.d(1), d = _ && _(g), d && (d.c(), d.m(t, n))), /*timer*/
- g[5] ? h ? h.p(g, S) : (h = no(g), h.c(), h.m(t, null)) : h && (h.d(1), h = null), (!f || S[0] & /*variant*/
- 256) && Ee(
+ m[8] === "default" && /*show_eta_bar*/
+ m[18] && /*show_progress*/
+ m[6] === "full" ? u ? u.p(m, C) : (u = as(m), u.c(), u.m(e.parentNode, e)) : u && (u.d(1), u = null), d === (d = c(m)) && _ ? _.p(m, C) : (_ && _.d(1), _ = d && d(m), _ && (_.c(), _.m(t, n))), /*timer*/
+ m[5] ? b ? b.p(m, C) : (b = us(m), b.c(), b.m(t, null)) : b && (b.d(1), b = null), (!f || C[0] & /*variant*/
+ 256) && Ae(
t,
"meta-text-center",
/*variant*/
- g[8] === "center"
- ), (!f || S[0] & /*variant*/
- 256) && Ee(
+ m[8] === "center"
+ ), (!f || C[0] & /*variant*/
+ 256) && Ae(
t,
"meta-text",
/*variant*/
- g[8] === "default"
+ m[8] === "default"
);
- let M = o;
- o = w(g), o === M ? ~o && m[o].p(g, S) : (a && (ti(), Ye(m[M], 1, 1, () => {
- m[M] = null;
- }), ei()), ~o ? (a = m[o], a ? a.p(g, S) : (a = m[o] = b[o](g), a.c()), Re(a, 1), a.m(r.parentNode, r)) : a = null), /*timer*/
- g[5] ? k && (ti(), Ye(k, 1, 1, () => {
- k = null;
- }), ei()) : k ? (k.p(g, S), S[0] & /*timer*/
- 32 && Re(k, 1)) : (k = fo(g), k.c(), Re(k, 1), k.m(s.parentNode, s));
+ let z = s;
+ s = g(m), s === z ? ~s && w[s].p(m, C) : (a && (ui(), Oe(w[z], 1, 1, () => {
+ w[z] = null;
+ }), fi()), ~s ? (a = w[s], a ? a.p(m, C) : (a = w[s] = h[s](m), a.c()), je(a, 1), a.m(r.parentNode, r)) : a = null), /*timer*/
+ m[5] ? p && (ui(), Oe(p, 1, 1, () => {
+ p = null;
+ }), fi()) : p ? (p.p(m, C), C[0] & /*timer*/
+ 32 && je(p, 1)) : (p = gs(m), p.c(), je(p, 1), p.m(o.parentNode, o));
},
- i(g) {
- f || (Re(a), Re(k), f = !0);
+ i(m) {
+ f || (je(a), je(p), f = !0);
},
- o(g) {
- Ye(a), Ye(k), f = !1;
+ o(m) {
+ Oe(a), Oe(p), f = !1;
},
- d(g) {
- g && (T(e), T(t), T(i), T(r), T(s)), u && u.d(g), d && d.d(), h && h.d(), ~o && m[o].d(g), k && k.d(g);
+ d(m) {
+ m && (R(e), R(t), R(i), R(r), R(o)), u && u.d(m), _ && _.d(), b && b.d(), ~s && w[s].d(m), p && p.d(m);
}
};
}
-function $i(l) {
+function as(l) {
let e, t = `translateX(${/*eta_level*/
(l[17] || 0) * 100 - 100}%)`;
return {
c() {
- e = Xe("div"), Fe(e, "class", "eta-bar svelte-16nch4a"), ot(e, "transform", t);
+ e = Ve("div"), Ie(e, "class", "eta-bar svelte-16nch4a"), ft(e, "transform", t);
},
m(n, i) {
j(n, e, i);
@@ -2793,87 +2760,87 @@ function $i(l) {
p(n, i) {
i[0] & /*eta_level*/
131072 && t !== (t = `translateX(${/*eta_level*/
- (n[17] || 0) * 100 - 100}%)`) && ot(e, "transform", t);
+ (n[17] || 0) * 100 - 100}%)`) && ft(e, "transform", t);
},
d(n) {
- n && T(e);
+ n && R(e);
}
};
}
-function _c(l) {
+function uc(l) {
let e;
return {
c() {
- e = P("processing |");
+ e = K("processing |");
},
m(t, n) {
j(t, e, n);
},
- p: ni,
+ p: ci,
d(t) {
- t && T(e);
+ t && R(e);
}
};
}
-function dc(l) {
+function cc(l) {
let e, t = (
/*queue_position*/
l[2] + 1 + ""
- ), n, i, o, a;
+ ), n, i, s, a;
return {
c() {
- e = P("queue: "), n = P(t), i = P("/"), o = P(
+ e = K("queue: "), n = K(t), i = K("/"), s = K(
/*queue_size*/
l[3]
- ), a = P(" |");
+ ), a = K(" |");
},
- m(r, s) {
- j(r, e, s), j(r, n, s), j(r, i, s), j(r, o, s), j(r, a, s);
+ m(r, o) {
+ j(r, e, o), j(r, n, o), j(r, i, o), j(r, s, o), j(r, a, o);
},
- p(r, s) {
- s[0] & /*queue_position*/
+ p(r, o) {
+ o[0] & /*queue_position*/
4 && t !== (t = /*queue_position*/
- r[2] + 1 + "") && Be(n, t), s[0] & /*queue_size*/
- 8 && Be(
- o,
+ r[2] + 1 + "") && Me(n, t), o[0] & /*queue_size*/
+ 8 && Me(
+ s,
/*queue_size*/
r[3]
);
},
d(r) {
- r && (T(e), T(n), T(i), T(o), T(a));
+ r && (R(e), R(n), R(i), R(s), R(a));
}
};
}
-function hc(l) {
- let e, t = Qn(
+function _c(l) {
+ let e, t = tl(
/*progress*/
l[7]
), n = [];
for (let i = 0; i < t.length; i += 1)
- n[i] = to(xi(l, t, i));
+ n[i] = fs(os(l, t, i));
return {
c() {
for (let i = 0; i < n.length; i += 1)
n[i].c();
- e = Jt();
+ e = tn();
},
- m(i, o) {
+ m(i, s) {
for (let a = 0; a < n.length; a += 1)
- n[a] && n[a].m(i, o);
- j(i, e, o);
+ n[a] && n[a].m(i, s);
+ j(i, e, s);
},
- p(i, o) {
- if (o[0] & /*progress*/
+ p(i, s) {
+ if (s[0] & /*progress*/
128) {
- t = Qn(
+ t = tl(
/*progress*/
i[7]
);
let a;
for (a = 0; a < t.length; a += 1) {
- const r = xi(i, t, a);
- n[a] ? n[a].p(r, o) : (n[a] = to(r), n[a].c(), n[a].m(e.parentNode, e));
+ const r = os(i, t, a);
+ n[a] ? n[a].p(r, s) : (n[a] = fs(r), n[a].c(), n[a].m(e.parentNode, e));
}
for (; a < n.length; a += 1)
n[a].d(1);
@@ -2881,116 +2848,116 @@ function hc(l) {
}
},
d(i) {
- i && T(e), bs(n, i);
+ i && R(e), Co(n, i);
}
};
}
-function eo(l) {
+function rs(l) {
let e, t = (
/*p*/
l[41].unit + ""
- ), n, i, o = " ", a;
+ ), n, i, s = " ", a;
function r(u, c) {
return (
/*p*/
- u[41].length != null ? bc : mc
+ u[41].length != null ? hc : dc
);
}
- let s = r(l), f = s(l);
+ let o = r(l), f = o(l);
return {
c() {
- f.c(), e = Me(), n = P(t), i = P(" | "), a = P(o);
+ f.c(), e = Be(), n = K(t), i = K(" | "), a = K(s);
},
m(u, c) {
f.m(u, c), j(u, e, c), j(u, n, c), j(u, i, c), j(u, a, c);
},
p(u, c) {
- s === (s = r(u)) && f ? f.p(u, c) : (f.d(1), f = s(u), f && (f.c(), f.m(e.parentNode, e))), c[0] & /*progress*/
+ o === (o = r(u)) && f ? f.p(u, c) : (f.d(1), f = o(u), f && (f.c(), f.m(e.parentNode, e))), c[0] & /*progress*/
128 && t !== (t = /*p*/
- u[41].unit + "") && Be(n, t);
+ u[41].unit + "") && Me(n, t);
},
d(u) {
- u && (T(e), T(n), T(i), T(a)), f.d(u);
+ u && (R(e), R(n), R(i), R(a)), f.d(u);
}
};
}
-function mc(l) {
- let e = Yt(
+function dc(l) {
+ let e = Gt(
/*p*/
l[41].index || 0
) + "", t;
return {
c() {
- t = P(e);
+ t = K(e);
},
m(n, i) {
j(n, t, i);
},
p(n, i) {
i[0] & /*progress*/
- 128 && e !== (e = Yt(
+ 128 && e !== (e = Gt(
/*p*/
n[41].index || 0
- ) + "") && Be(t, e);
+ ) + "") && Me(t, e);
},
d(n) {
- n && T(t);
+ n && R(t);
}
};
}
-function bc(l) {
- let e = Yt(
+function hc(l) {
+ let e = Gt(
/*p*/
l[41].index || 0
- ) + "", t, n, i = Yt(
+ ) + "", t, n, i = Gt(
/*p*/
l[41].length
- ) + "", o;
+ ) + "", s;
return {
c() {
- t = P(e), n = P("/"), o = P(i);
+ t = K(e), n = K("/"), s = K(i);
},
m(a, r) {
- j(a, t, r), j(a, n, r), j(a, o, r);
+ j(a, t, r), j(a, n, r), j(a, s, r);
},
p(a, r) {
r[0] & /*progress*/
- 128 && e !== (e = Yt(
+ 128 && e !== (e = Gt(
/*p*/
a[41].index || 0
- ) + "") && Be(t, e), r[0] & /*progress*/
- 128 && i !== (i = Yt(
+ ) + "") && Me(t, e), r[0] & /*progress*/
+ 128 && i !== (i = Gt(
/*p*/
a[41].length
- ) + "") && Be(o, i);
+ ) + "") && Me(s, i);
},
d(a) {
- a && (T(t), T(n), T(o));
+ a && (R(t), R(n), R(s));
}
};
}
-function to(l) {
+function fs(l) {
let e, t = (
/*p*/
- l[41].index != null && eo(l)
+ l[41].index != null && rs(l)
);
return {
c() {
- t && t.c(), e = Jt();
+ t && t.c(), e = tn();
},
m(n, i) {
t && t.m(n, i), j(n, e, i);
},
p(n, i) {
/*p*/
- n[41].index != null ? t ? t.p(n, i) : (t = eo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
+ n[41].index != null ? t ? t.p(n, i) : (t = rs(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
},
d(n) {
- n && T(e), t && t.d(n);
+ n && R(e), t && t.d(n);
}
};
}
-function no(l) {
+function us(l) {
let e, t = (
/*eta*/
l[0] ? `/${/*formatted_eta*/
@@ -2998,116 +2965,116 @@ function no(l) {
), n, i;
return {
c() {
- e = P(
+ e = K(
/*formatted_timer*/
l[20]
- ), n = P(t), i = P("s");
+ ), n = K(t), i = K("s");
},
- m(o, a) {
- j(o, e, a), j(o, n, a), j(o, i, a);
+ m(s, a) {
+ j(s, e, a), j(s, n, a), j(s, i, a);
},
- p(o, a) {
+ p(s, a) {
a[0] & /*formatted_timer*/
- 1048576 && Be(
+ 1048576 && Me(
e,
/*formatted_timer*/
- o[20]
+ s[20]
), a[0] & /*eta, formatted_eta*/
524289 && t !== (t = /*eta*/
- o[0] ? `/${/*formatted_eta*/
- o[19]}` : "") && Be(n, t);
+ s[0] ? `/${/*formatted_eta*/
+ s[19]}` : "") && Me(n, t);
},
- d(o) {
- o && (T(e), T(n), T(i));
+ d(s) {
+ s && (R(e), R(n), R(i));
}
};
}
-function gc(l) {
+function mc(l) {
let e, t;
- return e = new tc({
+ return e = new $u({
props: { margin: (
/*variant*/
l[8] === "default"
) }
}), {
c() {
- ds(e.$$.fragment);
+ ko(e.$$.fragment);
},
m(n, i) {
- ps(e, n, i), t = !0;
+ qo(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*variant*/
- 256 && (o.margin = /*variant*/
- n[8] === "default"), e.$set(o);
+ 256 && (s.margin = /*variant*/
+ n[8] === "default"), e.$set(s);
},
i(n) {
- t || (Re(e.$$.fragment, n), t = !0);
+ t || (je(e.$$.fragment, n), t = !0);
},
o(n) {
- Ye(e.$$.fragment, n), t = !1;
+ Oe(e.$$.fragment, n), t = !1;
},
d(n) {
- ms(e, n);
+ yo(e, n);
}
};
}
-function wc(l) {
- let e, t, n, i, o, a = `${/*last_progress_level*/
+function bc(l) {
+ let e, t, n, i, s, a = `${/*last_progress_level*/
l[15] * 100}%`, r = (
/*progress*/
- l[7] != null && lo(l)
+ l[7] != null && cs(l)
);
return {
c() {
- e = Xe("div"), t = Xe("div"), r && r.c(), n = Me(), i = Xe("div"), o = Xe("div"), Fe(t, "class", "progress-level-inner svelte-16nch4a"), Fe(o, "class", "progress-bar svelte-16nch4a"), ot(o, "width", a), Fe(i, "class", "progress-bar-wrap svelte-16nch4a"), Fe(e, "class", "progress-level svelte-16nch4a");
+ e = Ve("div"), t = Ve("div"), r && r.c(), n = Be(), i = Ve("div"), s = Ve("div"), Ie(t, "class", "progress-level-inner svelte-16nch4a"), Ie(s, "class", "progress-bar svelte-16nch4a"), ft(s, "width", a), Ie(i, "class", "progress-bar-wrap svelte-16nch4a"), Ie(e, "class", "progress-level svelte-16nch4a");
},
- m(s, f) {
- j(s, e, f), vt(e, t), r && r.m(t, null), vt(e, n), vt(e, i), vt(i, o), l[31](o);
+ m(o, f) {
+ j(o, e, f), zt(e, t), r && r.m(t, null), zt(e, n), zt(e, i), zt(i, s), l[31](s);
},
- p(s, f) {
+ p(o, f) {
/*progress*/
- s[7] != null ? r ? r.p(s, f) : (r = lo(s), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/
+ o[7] != null ? r ? r.p(o, f) : (r = cs(o), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/
32768 && a !== (a = `${/*last_progress_level*/
- s[15] * 100}%`) && ot(o, "width", a);
+ o[15] * 100}%`) && ft(s, "width", a);
},
- i: ni,
- o: ni,
- d(s) {
- s && T(e), r && r.d(), l[31](null);
+ i: ci,
+ o: ci,
+ d(o) {
+ o && R(e), r && r.d(), l[31](null);
}
};
}
-function lo(l) {
- let e, t = Qn(
+function cs(l) {
+ let e, t = tl(
/*progress*/
l[7]
), n = [];
for (let i = 0; i < t.length; i += 1)
- n[i] = ro(Qi(l, t, i));
+ n[i] = bs(ss(l, t, i));
return {
c() {
for (let i = 0; i < n.length; i += 1)
n[i].c();
- e = Jt();
+ e = tn();
},
- m(i, o) {
+ m(i, s) {
for (let a = 0; a < n.length; a += 1)
- n[a] && n[a].m(i, o);
- j(i, e, o);
+ n[a] && n[a].m(i, s);
+ j(i, e, s);
},
- p(i, o) {
- if (o[0] & /*progress_level, progress*/
+ p(i, s) {
+ if (s[0] & /*progress_level, progress*/
16512) {
- t = Qn(
+ t = tl(
/*progress*/
i[7]
);
let a;
for (a = 0; a < t.length; a += 1) {
- const r = Qi(i, t, a);
- n[a] ? n[a].p(r, o) : (n[a] = ro(r), n[a].c(), n[a].m(e.parentNode, e));
+ const r = ss(i, t, a);
+ n[a] ? n[a].p(r, s) : (n[a] = bs(r), n[a].c(), n[a].m(e.parentNode, e));
}
for (; a < n.length; a += 1)
n[a].d(1);
@@ -3115,17 +3082,17 @@ function lo(l) {
}
},
d(i) {
- i && T(e), bs(n, i);
+ i && R(e), Co(n, i);
}
};
}
-function io(l) {
- let e, t, n, i, o = (
+function _s(l) {
+ let e, t, n, i, s = (
/*i*/
- l[43] !== 0 && pc()
+ l[43] !== 0 && gc()
), a = (
/*p*/
- l[41].desc != null && oo(l)
+ l[41].desc != null && ds(l)
), r = (
/*p*/
l[41].desc != null && /*progress_level*/
@@ -3133,56 +3100,56 @@ function io(l) {
l[14][
/*i*/
l[43]
- ] != null && so()
- ), s = (
+ ] != null && hs()
+ ), o = (
/*progress_level*/
- l[14] != null && ao(l)
+ l[14] != null && ms(l)
);
return {
c() {
- o && o.c(), e = Me(), a && a.c(), t = Me(), r && r.c(), n = Me(), s && s.c(), i = Jt();
+ s && s.c(), e = Be(), a && a.c(), t = Be(), r && r.c(), n = Be(), o && o.c(), i = tn();
},
m(f, u) {
- o && o.m(f, u), j(f, e, u), a && a.m(f, u), j(f, t, u), r && r.m(f, u), j(f, n, u), s && s.m(f, u), j(f, i, u);
+ s && s.m(f, u), j(f, e, u), a && a.m(f, u), j(f, t, u), r && r.m(f, u), j(f, n, u), o && o.m(f, u), j(f, i, u);
},
p(f, u) {
/*p*/
- f[41].desc != null ? a ? a.p(f, u) : (a = oo(f), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null), /*p*/
+ f[41].desc != null ? a ? a.p(f, u) : (a = ds(f), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null), /*p*/
f[41].desc != null && /*progress_level*/
f[14] && /*progress_level*/
f[14][
/*i*/
f[43]
- ] != null ? r || (r = so(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/
- f[14] != null ? s ? s.p(f, u) : (s = ao(f), s.c(), s.m(i.parentNode, i)) : s && (s.d(1), s = null);
+ ] != null ? r || (r = hs(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/
+ f[14] != null ? o ? o.p(f, u) : (o = ms(f), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
},
d(f) {
- f && (T(e), T(t), T(n), T(i)), o && o.d(f), a && a.d(f), r && r.d(f), s && s.d(f);
+ f && (R(e), R(t), R(n), R(i)), s && s.d(f), a && a.d(f), r && r.d(f), o && o.d(f);
}
};
}
-function pc(l) {
+function gc(l) {
let e;
return {
c() {
- e = P("Â /");
+ e = K("Â /");
},
m(t, n) {
j(t, e, n);
},
d(t) {
- t && T(e);
+ t && R(e);
}
};
}
-function oo(l) {
+function ds(l) {
let e = (
/*p*/
l[41].desc + ""
), t;
return {
c() {
- t = P(e);
+ t = K(e);
},
m(n, i) {
j(n, t, i);
@@ -3190,28 +3157,28 @@ function oo(l) {
p(n, i) {
i[0] & /*progress*/
128 && e !== (e = /*p*/
- n[41].desc + "") && Be(t, e);
+ n[41].desc + "") && Me(t, e);
},
d(n) {
- n && T(t);
+ n && R(t);
}
};
}
-function so(l) {
+function hs(l) {
let e;
return {
c() {
- e = P("-");
+ e = K("-");
},
m(t, n) {
j(t, e, n);
},
d(t) {
- t && T(e);
+ t && R(e);
}
};
}
-function ao(l) {
+function ms(l) {
let e = (100 * /*progress_level*/
(l[14][
/*i*/
@@ -3219,25 +3186,25 @@ function ao(l) {
] || 0)).toFixed(1) + "", t, n;
return {
c() {
- t = P(e), n = P("%");
+ t = K(e), n = K("%");
},
- m(i, o) {
- j(i, t, o), j(i, n, o);
+ m(i, s) {
+ j(i, t, s), j(i, n, s);
},
- p(i, o) {
- o[0] & /*progress_level*/
+ p(i, s) {
+ s[0] & /*progress_level*/
16384 && e !== (e = (100 * /*progress_level*/
(i[14][
/*i*/
i[43]
- ] || 0)).toFixed(1) + "") && Be(t, e);
+ ] || 0)).toFixed(1) + "") && Me(t, e);
},
d(i) {
- i && (T(t), T(n));
+ i && (R(t), R(n));
}
};
}
-function ro(l) {
+function bs(l) {
let e, t = (
/*p*/
(l[41].desc != null || /*progress_level*/
@@ -3245,11 +3212,11 @@ function ro(l) {
l[14][
/*i*/
l[43]
- ] != null) && io(l)
+ ] != null) && _s(l)
);
return {
c() {
- t && t.c(), e = Jt();
+ t && t.c(), e = tn();
},
m(n, i) {
t && t.m(n, i), j(n, e, i);
@@ -3261,76 +3228,76 @@ function ro(l) {
n[14][
/*i*/
n[43]
- ] != null ? t ? t.p(n, i) : (t = io(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
+ ] != null ? t ? t.p(n, i) : (t = _s(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
},
d(n) {
- n && T(e), t && t.d(n);
+ n && R(e), t && t.d(n);
}
};
}
-function fo(l) {
+function gs(l) {
let e, t, n, i;
- const o = (
+ const s = (
/*#slots*/
l[30]["additional-loading-text"]
- ), a = hs(
- o,
+ ), a = vo(
+ s,
l,
/*$$scope*/
l[29],
- Ji
+ is
);
return {
c() {
- e = Xe("p"), t = P(
+ e = Ve("p"), t = K(
/*loading_text*/
l[9]
- ), n = Me(), a && a.c(), Fe(e, "class", "loading svelte-16nch4a");
+ ), n = Be(), a && a.c(), Ie(e, "class", "loading svelte-16nch4a");
},
- m(r, s) {
- j(r, e, s), vt(e, t), j(r, n, s), a && a.m(r, s), i = !0;
+ m(r, o) {
+ j(r, e, o), zt(e, t), j(r, n, o), a && a.m(r, o), i = !0;
},
- p(r, s) {
- (!i || s[0] & /*loading_text*/
- 512) && Be(
+ p(r, o) {
+ (!i || o[0] & /*loading_text*/
+ 512) && Me(
t,
/*loading_text*/
r[9]
- ), a && a.p && (!i || s[0] & /*$$scope*/
- 536870912) && ks(
+ ), a && a.p && (!i || o[0] & /*$$scope*/
+ 536870912) && Eo(
a,
- o,
+ s,
r,
/*$$scope*/
r[29],
- i ? ws(
- o,
+ i ? zo(
+ s,
/*$$scope*/
r[29],
- s,
- fc
- ) : gs(
+ o,
+ ac
+ ) : So(
/*$$scope*/
r[29]
),
- Ji
+ is
);
},
i(r) {
- i || (Re(a, r), i = !0);
+ i || (je(a, r), i = !0);
},
o(r) {
- Ye(a, r), i = !1;
+ Oe(a, r), i = !1;
},
d(r) {
- r && (T(e), T(n)), a && a.d(r);
+ r && (R(e), R(n)), a && a.d(r);
}
};
}
-function kc(l) {
- let e, t, n, i, o;
- const a = [cc, uc], r = [];
- function s(f, u) {
+function wc(l) {
+ let e, t, n, i, s;
+ const a = [fc, rc], r = [];
+ function o(f, u) {
return (
/*status*/
f[4] === "pending" ? 0 : (
@@ -3339,14 +3306,14 @@ function kc(l) {
)
);
}
- return ~(t = s(l)) && (n = r[t] = a[t](l)), {
+ return ~(t = o(l)) && (n = r[t] = a[t](l)), {
c() {
- e = Xe("div"), n && n.c(), Fe(e, "class", i = "wrap " + /*variant*/
+ e = Ve("div"), n && n.c(), Ie(e, "class", i = "wrap " + /*variant*/
l[8] + " " + /*show_progress*/
- l[6] + " svelte-16nch4a"), Ee(e, "hide", !/*status*/
+ l[6] + " svelte-16nch4a"), Ae(e, "hide", !/*status*/
l[4] || /*status*/
l[4] === "complete" || /*show_progress*/
- l[6] === "hidden"), Ee(
+ l[6] === "hidden"), Ae(
e,
"translucent",
/*variant*/
@@ -3355,22 +3322,22 @@ function kc(l) {
l[4] === "error") || /*translucent*/
l[11] || /*show_progress*/
l[6] === "minimal"
- ), Ee(
+ ), Ae(
e,
"generating",
/*status*/
l[4] === "generating"
- ), Ee(
+ ), Ae(
e,
"border",
/*border*/
l[12]
- ), ot(
+ ), ft(
e,
"position",
/*absolute*/
l[10] ? "absolute" : "static"
- ), ot(
+ ), ft(
e,
"padding",
/*absolute*/
@@ -3378,21 +3345,21 @@ function kc(l) {
);
},
m(f, u) {
- j(f, e, u), ~t && r[t].m(e, null), l[33](e), o = !0;
+ j(f, e, u), ~t && r[t].m(e, null), l[33](e), s = !0;
},
p(f, u) {
let c = t;
- t = s(f), t === c ? ~t && r[t].p(f, u) : (n && (ti(), Ye(r[c], 1, 1, () => {
+ t = o(f), t === c ? ~t && r[t].p(f, u) : (n && (ui(), Oe(r[c], 1, 1, () => {
r[c] = null;
- }), ei()), ~t ? (n = r[t], n ? n.p(f, u) : (n = r[t] = a[t](f), n.c()), Re(n, 1), n.m(e, null)) : n = null), (!o || u[0] & /*variant, show_progress*/
+ }), fi()), ~t ? (n = r[t], n ? n.p(f, u) : (n = r[t] = a[t](f), n.c()), je(n, 1), n.m(e, null)) : n = null), (!s || u[0] & /*variant, show_progress*/
320 && i !== (i = "wrap " + /*variant*/
f[8] + " " + /*show_progress*/
- f[6] + " svelte-16nch4a")) && Fe(e, "class", i), (!o || u[0] & /*variant, show_progress, status, show_progress*/
- 336) && Ee(e, "hide", !/*status*/
+ f[6] + " svelte-16nch4a")) && Ie(e, "class", i), (!s || u[0] & /*variant, show_progress, status, show_progress*/
+ 336) && Ae(e, "hide", !/*status*/
f[4] || /*status*/
f[4] === "complete" || /*show_progress*/
- f[6] === "hidden"), (!o || u[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
- 2384) && Ee(
+ f[6] === "hidden"), (!s || u[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
+ 2384) && Ae(
e,
"translucent",
/*variant*/
@@ -3401,26 +3368,26 @@ function kc(l) {
f[4] === "error") || /*translucent*/
f[11] || /*show_progress*/
f[6] === "minimal"
- ), (!o || u[0] & /*variant, show_progress, status*/
- 336) && Ee(
+ ), (!s || u[0] & /*variant, show_progress, status*/
+ 336) && Ae(
e,
"generating",
/*status*/
f[4] === "generating"
- ), (!o || u[0] & /*variant, show_progress, border*/
- 4416) && Ee(
+ ), (!s || u[0] & /*variant, show_progress, border*/
+ 4416) && Ae(
e,
"border",
/*border*/
f[12]
), u[0] & /*absolute*/
- 1024 && ot(
+ 1024 && ft(
e,
"position",
/*absolute*/
f[10] ? "absolute" : "static"
), u[0] & /*absolute*/
- 1024 && ot(
+ 1024 && ft(
e,
"padding",
/*absolute*/
@@ -3428,23 +3395,23 @@ function kc(l) {
);
},
i(f) {
- o || (Re(n), o = !0);
+ s || (je(n), s = !0);
},
o(f) {
- Ye(n), o = !1;
+ Oe(n), s = !1;
},
d(f) {
- f && T(e), ~t && r[t].d(), l[33](null);
+ f && R(e), ~t && r[t].d(), l[33](null);
}
};
}
-var vc = function(l, e, t, n) {
- function i(o) {
- return o instanceof t ? o : new t(function(a) {
- a(o);
+var pc = function(l, e, t, n) {
+ function i(s) {
+ return s instanceof t ? s : new t(function(a) {
+ a(s);
});
}
- return new (t || (t = Promise))(function(o, a) {
+ return new (t || (t = Promise))(function(s, a) {
function r(u) {
try {
f(n.next(u));
@@ -3452,7 +3419,7 @@ var vc = function(l, e, t, n) {
a(c);
}
}
- function s(u) {
+ function o(u) {
try {
f(n.throw(u));
} catch (c) {
@@ -3460,123 +3427,123 @@ var vc = function(l, e, t, n) {
}
}
function f(u) {
- u.done ? o(u.value) : i(u.value).then(r, s);
+ u.done ? s(u.value) : i(u.value).then(r, o);
}
f((n = n.apply(l, e || [])).next());
});
};
-let An = [], Il = !1;
-function yc(l) {
- return vc(this, arguments, void 0, function* (e, t = !0) {
+let Fn = [], Nl = !1;
+function kc(l) {
+ return pc(this, arguments, void 0, function* (e, t = !0) {
if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
- if (An.push(e), !Il) Il = !0;
+ if (Fn.push(e), !Nl) Nl = !0;
else return;
- yield oc(), requestAnimationFrame(() => {
+ yield lc(), requestAnimationFrame(() => {
let n = [0, 0];
- for (let i = 0; i < An.length; i++) {
- const a = An[i].getBoundingClientRect();
+ for (let i = 0; i < Fn.length; i++) {
+ const a = Fn[i].getBoundingClientRect();
(i === 0 || a.top + window.scrollY <= n[0]) && (n[0] = a.top + window.scrollY, n[1] = i);
}
- window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Il = !1, An = [];
+ window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Nl = !1, Fn = [];
});
}
});
}
-function Cc(l, e, t) {
- let n, { $$slots: i = {}, $$scope: o } = e;
+function vc(l, e, t) {
+ let n, { $$slots: i = {}, $$scope: s } = e;
this && this.__awaiter;
- const a = ac();
- let { i18n: r } = e, { eta: s = null } = e, { queue_position: f } = e, { queue_size: u } = e, { status: c } = e, { scroll_to_output: _ = !1 } = e, { timer: d = !0 } = e, { show_progress: h = "full" } = e, { message: b = null } = e, { progress: m = null } = e, { variant: w = "default" } = e, { loading_text: k = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: S = !1 } = e, { border: M = !1 } = e, { autoscroll: y } = e, z, v = !1, q = 0, R = 0, I = null, B = null, W = 0, H = null, le, X = null, ee = !0;
+ const a = sc();
+ let { i18n: r } = e, { eta: o = null } = e, { queue_position: f } = e, { queue_size: u } = e, { status: c } = e, { scroll_to_output: d = !1 } = e, { timer: _ = !0 } = e, { show_progress: b = "full" } = e, { message: h = null } = e, { progress: w = null } = e, { variant: g = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: m = !0 } = e, { translucent: C = !1 } = e, { border: z = !1 } = e, { autoscroll: y } = e, q, v = !1, E = 0, F = 0, X = null, L = null, V = 0, I = null, Q, W = null, le = !0;
const ae = () => {
- t(0, s = t(27, I = t(19, de = null))), t(25, q = performance.now()), t(26, R = 0), v = !0, ye();
+ t(0, o = t(27, X = t(19, fe = null))), t(25, E = performance.now()), t(26, F = 0), v = !0, re();
};
- function ye() {
+ function re() {
requestAnimationFrame(() => {
- t(26, R = (performance.now() - q) / 1e3), v && ye();
+ t(26, F = (performance.now() - E) / 1e3), v && re();
});
}
- function L() {
- t(26, R = 0), t(0, s = t(27, I = t(19, de = null))), v && (v = !1);
+ function D() {
+ t(26, F = 0), t(0, o = t(27, X = t(19, fe = null))), v && (v = !1);
}
- sc(() => {
- v && L();
+ ic(() => {
+ v && D();
});
- let de = null;
- function Ae(A) {
- Ki[A ? "unshift" : "push"](() => {
- X = A, t(16, X), t(7, m), t(14, H), t(15, le);
+ let fe = null;
+ function Se(B) {
+ ns[B ? "unshift" : "push"](() => {
+ W = B, t(16, W), t(7, w), t(14, I), t(15, Q);
});
}
- const Le = () => {
+ const Fe = () => {
a("clear_status");
};
- function Ce(A) {
- Ki[A ? "unshift" : "push"](() => {
- z = A, t(13, z);
+ function Pe(B) {
+ ns[B ? "unshift" : "push"](() => {
+ q = B, t(13, q);
});
}
- return l.$$set = (A) => {
- "i18n" in A && t(1, r = A.i18n), "eta" in A && t(0, s = A.eta), "queue_position" in A && t(2, f = A.queue_position), "queue_size" in A && t(3, u = A.queue_size), "status" in A && t(4, c = A.status), "scroll_to_output" in A && t(22, _ = A.scroll_to_output), "timer" in A && t(5, d = A.timer), "show_progress" in A && t(6, h = A.show_progress), "message" in A && t(23, b = A.message), "progress" in A && t(7, m = A.progress), "variant" in A && t(8, w = A.variant), "loading_text" in A && t(9, k = A.loading_text), "absolute" in A && t(10, g = A.absolute), "translucent" in A && t(11, S = A.translucent), "border" in A && t(12, M = A.border), "autoscroll" in A && t(24, y = A.autoscroll), "$$scope" in A && t(29, o = A.$$scope);
+ return l.$$set = (B) => {
+ "i18n" in B && t(1, r = B.i18n), "eta" in B && t(0, o = B.eta), "queue_position" in B && t(2, f = B.queue_position), "queue_size" in B && t(3, u = B.queue_size), "status" in B && t(4, c = B.status), "scroll_to_output" in B && t(22, d = B.scroll_to_output), "timer" in B && t(5, _ = B.timer), "show_progress" in B && t(6, b = B.show_progress), "message" in B && t(23, h = B.message), "progress" in B && t(7, w = B.progress), "variant" in B && t(8, g = B.variant), "loading_text" in B && t(9, p = B.loading_text), "absolute" in B && t(10, m = B.absolute), "translucent" in B && t(11, C = B.translucent), "border" in B && t(12, z = B.border), "autoscroll" in B && t(24, y = B.autoscroll), "$$scope" in B && t(29, s = B.$$scope);
}, l.$$.update = () => {
l.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
- 436207617 && (s === null && t(0, s = I), s != null && I !== s && (t(28, B = (performance.now() - q) / 1e3 + s), t(19, de = B.toFixed(1)), t(27, I = s))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/
- 335544320 && t(17, W = B === null || B <= 0 || !R ? null : Math.min(R / B, 1)), l.$$.dirty[0] & /*progress*/
- 128 && m != null && t(18, ee = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
- 114816 && (m != null ? t(14, H = m.map((A) => {
- if (A.index != null && A.length != null)
- return A.index / A.length;
- if (A.progress != null)
- return A.progress;
- })) : t(14, H = null), H ? (t(15, le = H[H.length - 1]), X && (le === 0 ? t(16, X.style.transition = "0", X) : t(16, X.style.transition = "150ms", X))) : t(15, le = void 0)), l.$$.dirty[0] & /*status*/
- 16 && (c === "pending" ? ae() : L()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
- 20979728 && z && _ && (c === "pending" || c === "complete") && yc(z, y), l.$$.dirty[0] & /*status, message*/
+ 436207617 && (o === null && t(0, o = X), o != null && X !== o && (t(28, L = (performance.now() - E) / 1e3 + o), t(19, fe = L.toFixed(1)), t(27, X = o))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/
+ 335544320 && t(17, V = L === null || L <= 0 || !F ? null : Math.min(F / L, 1)), l.$$.dirty[0] & /*progress*/
+ 128 && w != null && t(18, le = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
+ 114816 && (w != null ? t(14, I = w.map((B) => {
+ if (B.index != null && B.length != null)
+ return B.index / B.length;
+ if (B.progress != null)
+ return B.progress;
+ })) : t(14, I = null), I ? (t(15, Q = I[I.length - 1]), W && (Q === 0 ? t(16, W.style.transition = "0", W) : t(16, W.style.transition = "150ms", W))) : t(15, Q = void 0)), l.$$.dirty[0] & /*status*/
+ 16 && (c === "pending" ? ae() : D()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
+ 20979728 && q && d && (c === "pending" || c === "complete") && kc(q, y), l.$$.dirty[0] & /*status, message*/
8388624, l.$$.dirty[0] & /*timer_diff*/
- 67108864 && t(20, n = R.toFixed(1));
+ 67108864 && t(20, n = F.toFixed(1));
}, [
- s,
+ o,
r,
f,
u,
c,
- d,
- h,
- m,
+ _,
+ b,
w,
- k,
g,
- S,
- M,
+ p,
+ m,
+ C,
z,
- H,
- le,
- X,
+ q,
+ I,
+ Q,
W,
- ee,
- de,
+ V,
+ le,
+ fe,
n,
a,
- _,
- b,
+ d,
+ h,
y,
- q,
- R,
- I,
- B,
- o,
+ E,
+ F,
+ X,
+ L,
+ s,
i,
- Ae,
- Le,
- Ce
+ Se,
+ Fe,
+ Pe
];
}
-class Sc extends nc {
+class yc extends ec {
constructor(e) {
- super(), lc(
+ super(), tc(
this,
e,
- Cc,
- kc,
- ic,
+ vc,
+ wc,
+ nc,
{
i18n: 1,
eta: 0,
@@ -3600,30 +3567,30 @@ class Sc extends nc {
);
}
}
-const { setContext: g1, getContext: zc } = window.__gradio__svelte__internal, qc = "WORKER_PROXY_CONTEXT_KEY";
-function vs() {
- return zc(qc);
+const { setContext: z0, getContext: Cc } = window.__gradio__svelte__internal, Sc = "WORKER_PROXY_CONTEXT_KEY";
+function Ao() {
+ return Cc(Sc);
}
-function Ec(l) {
+function zc(l) {
return l.host === window.location.host || l.host === "localhost:7860" || l.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
l.host === "lite.local";
}
-function ys(l, e) {
+function Bo(l, e) {
const t = e.toLowerCase();
for (const [n, i] of Object.entries(l))
if (n.toLowerCase() === t)
return i;
}
-function Cs(l) {
+function Mo(l) {
if (l == null)
return !1;
const e = new URL(l, window.location.href);
- return !(!Ec(e) || e.protocol !== "http:" && e.protocol !== "https:");
+ return !(!zc(e) || e.protocol !== "http:" && e.protocol !== "https:");
}
-async function Mc(l) {
- if (l == null || !Cs(l))
+async function qc(l) {
+ if (l == null || !Mo(l))
return l;
- const e = vs();
+ const e = Ao();
if (e == null)
return l;
const n = new URL(l, window.location.href).pathname;
@@ -3635,49 +3602,49 @@ async function Mc(l) {
}).then((i) => {
if (i.status !== 200)
throw new Error(`Failed to get file ${n} from the Wasm worker.`);
- const o = new Blob([i.body], {
- type: ys(i.headers, "content-type")
+ const s = new Blob([i.body], {
+ type: Bo(i.headers, "content-type")
});
- return URL.createObjectURL(o);
+ return URL.createObjectURL(s);
});
}
const {
- SvelteComponent: Bc,
- assign: xn,
- check_outros: Ss,
- compute_rest_props: uo,
- create_slot: _i,
- detach: _l,
- element: zs,
- empty: qs,
+ SvelteComponent: Ec,
+ assign: nl,
+ check_outros: Lo,
+ compute_rest_props: ws,
+ create_slot: vi,
+ detach: pl,
+ element: Do,
+ empty: To,
exclude_internal_props: Ac,
- get_all_dirty_from_scope: di,
- get_slot_changes: hi,
- get_spread_update: Es,
- group_outros: Ms,
- init: Lc,
- insert: dl,
- listen: Bs,
- prevent_default: Dc,
- safe_not_equal: Tc,
- set_attributes: $n,
- transition_in: zt,
- transition_out: qt,
- update_slot_base: mi
-} = window.__gradio__svelte__internal, { createEventDispatcher: jc } = window.__gradio__svelte__internal;
-function Ic(l) {
- let e, t, n, i, o;
+ get_all_dirty_from_scope: yi,
+ get_slot_changes: Ci,
+ get_spread_update: Ro,
+ group_outros: jo,
+ init: Bc,
+ insert: kl,
+ listen: Io,
+ prevent_default: Mc,
+ safe_not_equal: Lc,
+ set_attributes: ll,
+ transition_in: At,
+ transition_out: Bt,
+ update_slot_base: Si
+} = window.__gradio__svelte__internal, { createEventDispatcher: Dc } = window.__gradio__svelte__internal;
+function Tc(l) {
+ let e, t, n, i, s;
const a = (
/*#slots*/
l[8].default
- ), r = _i(
+ ), r = vi(
a,
l,
/*$$scope*/
l[7],
null
);
- let s = [
+ let o = [
{ href: (
/*href*/
l[0]
@@ -3693,14 +3660,14 @@ function Ic(l) {
/*$$restProps*/
l[6]
], f = {};
- for (let u = 0; u < s.length; u += 1)
- f = xn(f, s[u]);
+ for (let u = 0; u < o.length; u += 1)
+ f = nl(f, o[u]);
return {
c() {
- e = zs("a"), r && r.c(), $n(e, f);
+ e = Do("a"), r && r.c(), ll(e, f);
},
m(u, c) {
- dl(u, e, c), r && r.m(e, null), n = !0, i || (o = Bs(
+ kl(u, e, c), r && r.m(e, null), n = !0, i || (s = Io(
e,
"click",
/*dispatch*/
@@ -3709,24 +3676,24 @@ function Ic(l) {
},
p(u, c) {
r && r.p && (!n || c & /*$$scope*/
- 128) && mi(
+ 128) && Si(
r,
a,
u,
/*$$scope*/
u[7],
- n ? hi(
+ n ? Ci(
a,
/*$$scope*/
u[7],
c,
null
- ) : di(
+ ) : yi(
/*$$scope*/
u[7]
),
null
- ), $n(e, f = Es(s, [
+ ), ll(e, f = Ro(o, [
(!n || c & /*href*/
1) && { href: (
/*href*/
@@ -3745,56 +3712,56 @@ function Ic(l) {
]));
},
i(u) {
- n || (zt(r, u), n = !0);
+ n || (At(r, u), n = !0);
},
o(u) {
- qt(r, u), n = !1;
+ Bt(r, u), n = !1;
},
d(u) {
- u && _l(e), r && r.d(u), i = !1, o();
+ u && pl(e), r && r.d(u), i = !1, s();
}
};
}
function Rc(l) {
let e, t, n, i;
- const o = [Hc, Fc], a = [];
- function r(s, f) {
+ const s = [Ic, jc], a = [];
+ function r(o, f) {
return (
/*is_downloading*/
- s[2] ? 0 : 1
+ o[2] ? 0 : 1
);
}
- return e = r(l), t = a[e] = o[e](l), {
+ return e = r(l), t = a[e] = s[e](l), {
c() {
- t.c(), n = qs();
+ t.c(), n = To();
},
- m(s, f) {
- a[e].m(s, f), dl(s, n, f), i = !0;
+ m(o, f) {
+ a[e].m(o, f), kl(o, n, f), i = !0;
},
- p(s, f) {
+ p(o, f) {
let u = e;
- e = r(s), e === u ? a[e].p(s, f) : (Ms(), qt(a[u], 1, 1, () => {
+ e = r(o), e === u ? a[e].p(o, f) : (jo(), Bt(a[u], 1, 1, () => {
a[u] = null;
- }), Ss(), t = a[e], t ? t.p(s, f) : (t = a[e] = o[e](s), t.c()), zt(t, 1), t.m(n.parentNode, n));
+ }), Lo(), t = a[e], t ? t.p(o, f) : (t = a[e] = s[e](o), t.c()), At(t, 1), t.m(n.parentNode, n));
},
- i(s) {
- i || (zt(t), i = !0);
+ i(o) {
+ i || (At(t), i = !0);
},
- o(s) {
- qt(t), i = !1;
+ o(o) {
+ Bt(t), i = !1;
},
- d(s) {
- s && _l(n), a[e].d(s);
+ d(o) {
+ o && pl(n), a[e].d(o);
}
};
}
-function Fc(l) {
+function jc(l) {
let e, t, n, i;
- const o = (
+ const s = (
/*#slots*/
l[8].default
- ), a = _i(
- o,
+ ), a = vi(
+ s,
l,
/*$$scope*/
l[7],
@@ -3807,39 +3774,39 @@ function Fc(l) {
/*href*/
l[0]
) }
- ], s = {};
+ ], o = {};
for (let f = 0; f < r.length; f += 1)
- s = xn(s, r[f]);
+ o = nl(o, r[f]);
return {
c() {
- e = zs("a"), a && a.c(), $n(e, s);
+ e = Do("a"), a && a.c(), ll(e, o);
},
m(f, u) {
- dl(f, e, u), a && a.m(e, null), t = !0, n || (i = Bs(e, "click", Dc(
+ kl(f, e, u), a && a.m(e, null), t = !0, n || (i = Io(e, "click", Mc(
/*wasm_click_handler*/
l[5]
)), n = !0);
},
p(f, u) {
a && a.p && (!t || u & /*$$scope*/
- 128) && mi(
+ 128) && Si(
a,
- o,
+ s,
f,
/*$$scope*/
f[7],
- t ? hi(
- o,
+ t ? Ci(
+ s,
/*$$scope*/
f[7],
u,
null
- ) : di(
+ ) : yi(
/*$$scope*/
f[7]
),
null
- ), $n(e, s = Es(r, [
+ ), ll(e, o = Ro(r, [
u & /*$$restProps*/
64 && /*$$restProps*/
f[6],
@@ -3851,22 +3818,22 @@ function Fc(l) {
]));
},
i(f) {
- t || (zt(a, f), t = !0);
+ t || (At(a, f), t = !0);
},
o(f) {
- qt(a, f), t = !1;
+ Bt(a, f), t = !1;
},
d(f) {
- f && _l(e), a && a.d(f), n = !1, i();
+ f && pl(e), a && a.d(f), n = !1, i();
}
};
}
-function Hc(l) {
+function Ic(l) {
let e;
const t = (
/*#slots*/
l[8].default
- ), n = _i(
+ ), n = vi(
t,
l,
/*$$scope*/
@@ -3877,24 +3844,24 @@ function Hc(l) {
c() {
n && n.c();
},
- m(i, o) {
- n && n.m(i, o), e = !0;
+ m(i, s) {
+ n && n.m(i, s), e = !0;
},
- p(i, o) {
- n && n.p && (!e || o & /*$$scope*/
- 128) && mi(
+ p(i, s) {
+ n && n.p && (!e || s & /*$$scope*/
+ 128) && Si(
n,
t,
i,
/*$$scope*/
i[7],
- e ? hi(
+ e ? Ci(
t,
/*$$scope*/
i[7],
- o,
+ s,
null
- ) : di(
+ ) : yi(
/*$$scope*/
i[7]
),
@@ -3902,145 +3869,145 @@ function Hc(l) {
);
},
i(i) {
- e || (zt(n, i), e = !0);
+ e || (At(n, i), e = !0);
},
o(i) {
- qt(n, i), e = !1;
+ Bt(n, i), e = !1;
},
d(i) {
n && n.d(i);
}
};
}
-function Uc(l) {
- let e, t, n, i, o;
- const a = [Rc, Ic], r = [];
- function s(f, u) {
+function Fc(l) {
+ let e, t, n, i, s;
+ const a = [Rc, Tc], r = [];
+ function o(f, u) {
return u & /*href*/
1 && (e = null), e == null && (e = !!/*worker_proxy*/
- (f[4] && Cs(
+ (f[4] && Mo(
/*href*/
f[0]
))), e ? 0 : 1;
}
- return t = s(l, -1), n = r[t] = a[t](l), {
+ return t = o(l, -1), n = r[t] = a[t](l), {
c() {
- n.c(), i = qs();
+ n.c(), i = To();
},
m(f, u) {
- r[t].m(f, u), dl(f, i, u), o = !0;
+ r[t].m(f, u), kl(f, i, u), s = !0;
},
p(f, [u]) {
let c = t;
- t = s(f, u), t === c ? r[t].p(f, u) : (Ms(), qt(r[c], 1, 1, () => {
+ t = o(f, u), t === c ? r[t].p(f, u) : (jo(), Bt(r[c], 1, 1, () => {
r[c] = null;
- }), Ss(), n = r[t], n ? n.p(f, u) : (n = r[t] = a[t](f), n.c()), zt(n, 1), n.m(i.parentNode, i));
+ }), Lo(), n = r[t], n ? n.p(f, u) : (n = r[t] = a[t](f), n.c()), At(n, 1), n.m(i.parentNode, i));
},
i(f) {
- o || (zt(n), o = !0);
+ s || (At(n), s = !0);
},
o(f) {
- qt(n), o = !1;
+ Bt(n), s = !1;
},
d(f) {
- f && _l(i), r[t].d(f);
+ f && pl(i), r[t].d(f);
}
};
}
-function Nc(l, e, t) {
+function Hc(l, e, t) {
const n = ["href", "download"];
- let i = uo(e, n), { $$slots: o = {}, $$scope: a } = e;
- var r = this && this.__awaiter || function(h, b, m, w) {
- function k(g) {
- return g instanceof m ? g : new m(function(S) {
- S(g);
+ let i = ws(e, n), { $$slots: s = {}, $$scope: a } = e;
+ var r = this && this.__awaiter || function(b, h, w, g) {
+ function p(m) {
+ return m instanceof w ? m : new w(function(C) {
+ C(m);
});
}
- return new (m || (m = Promise))(function(g, S) {
- function M(v) {
+ return new (w || (w = Promise))(function(m, C) {
+ function z(v) {
try {
- z(w.next(v));
- } catch (q) {
- S(q);
+ q(g.next(v));
+ } catch (E) {
+ C(E);
}
}
function y(v) {
try {
- z(w.throw(v));
- } catch (q) {
- S(q);
+ q(g.throw(v));
+ } catch (E) {
+ C(E);
}
}
- function z(v) {
- v.done ? g(v.value) : k(v.value).then(M, y);
+ function q(v) {
+ v.done ? m(v.value) : p(v.value).then(z, y);
}
- z((w = w.apply(h, b || [])).next());
+ q((g = g.apply(b, h || [])).next());
});
};
- let { href: s = void 0 } = e, { download: f } = e;
- const u = jc();
+ let { href: o = void 0 } = e, { download: f } = e;
+ const u = Dc();
let c = !1;
- const _ = vs();
- function d() {
+ const d = Ao();
+ function _() {
return r(this, void 0, void 0, function* () {
if (c)
return;
- if (u("click"), s == null)
+ if (u("click"), o == null)
throw new Error("href is not defined.");
- if (_ == null)
+ if (d == null)
throw new Error("Wasm worker proxy is not available.");
- const b = new URL(s, window.location.href).pathname;
- t(2, c = !0), _.httpRequest({
+ const h = new URL(o, window.location.href).pathname;
+ t(2, c = !0), d.httpRequest({
method: "GET",
- path: b,
+ path: h,
headers: {},
query_string: ""
- }).then((m) => {
- if (m.status !== 200)
- throw new Error(`Failed to get file ${b} from the Wasm worker.`);
- const w = new Blob(
- [m.body],
+ }).then((w) => {
+ if (w.status !== 200)
+ throw new Error(`Failed to get file ${h} from the Wasm worker.`);
+ const g = new Blob(
+ [w.body],
{
- type: ys(m.headers, "content-type")
+ type: Bo(w.headers, "content-type")
}
- ), k = URL.createObjectURL(w), g = document.createElement("a");
- g.href = k, g.download = f, g.click(), URL.revokeObjectURL(k);
+ ), p = URL.createObjectURL(g), m = document.createElement("a");
+ m.href = p, m.download = f, m.click(), URL.revokeObjectURL(p);
}).finally(() => {
t(2, c = !1);
});
});
}
- return l.$$set = (h) => {
- e = xn(xn({}, e), Ac(h)), t(6, i = uo(e, n)), "href" in h && t(0, s = h.href), "download" in h && t(1, f = h.download), "$$scope" in h && t(7, a = h.$$scope);
+ return l.$$set = (b) => {
+ e = nl(nl({}, e), Ac(b)), t(6, i = ws(e, n)), "href" in b && t(0, o = b.href), "download" in b && t(1, f = b.download), "$$scope" in b && t(7, a = b.$$scope);
}, [
- s,
+ o,
f,
c,
u,
- _,
d,
+ _,
i,
a,
- o
+ s
];
}
-class Oc extends Bc {
+class Xc extends Ec {
constructor(e) {
- super(), Lc(this, e, Nc, Uc, Tc, { href: 0, download: 1 });
+ super(), Bc(this, e, Hc, Fc, Lc, { href: 0, download: 1 });
}
}
-var Xc = Object.defineProperty, Yc = (l, e, t) => e in l ? Xc(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, Pe = (l, e, t) => (Yc(l, typeof e != "symbol" ? e + "" : e, t), t), As = (l, e, t) => {
+var Yc = Object.defineProperty, Uc = (l, e, t) => e in l ? Yc(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, Ke = (l, e, t) => (Uc(l, typeof e != "symbol" ? e + "" : e, t), t), Fo = (l, e, t) => {
if (!e.has(l))
throw TypeError("Cannot " + t);
-}, $t = (l, e, t) => (As(l, e, "read from private field"), t ? t.call(l) : e.get(l)), Wc = (l, e, t) => {
+}, sn = (l, e, t) => (Fo(l, e, "read from private field"), t ? t.call(l) : e.get(l)), Nc = (l, e, t) => {
if (e.has(l))
throw TypeError("Cannot add the same private member more than once");
e instanceof WeakSet ? e.add(l) : e.set(l, t);
-}, Vc = (l, e, t, n) => (As(l, e, "write to private field"), e.set(l, t), t), lt;
+}, Vc = (l, e, t, n) => (Fo(l, e, "write to private field"), e.set(l, t), t), st;
new Intl.Collator(0, { numeric: 1 }).compare;
-async function Pc(l, e) {
+async function Oc(l, e) {
return l.map(
- (t) => new Zc({
+ (t) => new Wc({
path: t.name,
orig_name: t.name,
blob: t,
@@ -4050,31 +4017,31 @@ async function Pc(l, e) {
})
);
}
-class Zc {
+class Wc {
constructor({
path: e,
url: t,
orig_name: n,
size: i,
- blob: o,
+ blob: s,
is_stream: a,
mime_type: r,
- alt_text: s
+ alt_text: o
}) {
- Pe(this, "path"), Pe(this, "url"), Pe(this, "orig_name"), Pe(this, "size"), Pe(this, "blob"), Pe(this, "is_stream"), Pe(this, "mime_type"), Pe(this, "alt_text"), Pe(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = i, this.blob = t ? void 0 : o, this.is_stream = a, this.mime_type = r, this.alt_text = s;
+ Ke(this, "path"), Ke(this, "url"), Ke(this, "orig_name"), Ke(this, "size"), Ke(this, "blob"), Ke(this, "is_stream"), Ke(this, "mime_type"), Ke(this, "alt_text"), Ke(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = i, this.blob = t ? void 0 : s, this.is_stream = a, this.mime_type = r, this.alt_text = o;
}
}
typeof process < "u" && process.versions && process.versions.node;
-class w1 extends TransformStream {
+class q0 extends TransformStream {
/** Constructs a new instance. */
constructor(e = { allowCR: !1 }) {
super({
transform: (t, n) => {
- for (t = $t(this, lt) + t; ; ) {
+ for (t = sn(this, st) + t; ; ) {
const i = t.indexOf(`
-`), o = e.allowCR ? t.indexOf("\r") : -1;
- if (o !== -1 && o !== t.length - 1 && (i === -1 || i - 1 > o)) {
- n.enqueue(t.slice(0, o)), t = t.slice(o + 1);
+`), s = e.allowCR ? t.indexOf("\r") : -1;
+ if (s !== -1 && s !== t.length - 1 && (i === -1 || i - 1 > s)) {
+ n.enqueue(t.slice(0, s)), t = t.slice(s + 1);
continue;
}
if (i === -1)
@@ -4082,187 +4049,187 @@ class w1 extends TransformStream {
const a = t[i - 1] === "\r" ? i - 1 : i;
n.enqueue(t.slice(0, a)), t = t.slice(i + 1);
}
- Vc(this, lt, t);
+ Vc(this, st, t);
},
flush: (t) => {
- if ($t(this, lt) === "")
+ if (sn(this, st) === "")
return;
- const n = e.allowCR && $t(this, lt).endsWith("\r") ? $t(this, lt).slice(0, -1) : $t(this, lt);
+ const n = e.allowCR && sn(this, st).endsWith("\r") ? sn(this, st).slice(0, -1) : sn(this, st);
t.enqueue(n);
}
- }), Wc(this, lt, "");
+ }), Nc(this, st, "");
}
}
-lt = /* @__PURE__ */ new WeakMap();
+st = /* @__PURE__ */ new WeakMap();
const {
- SvelteComponent: Kc,
- append: _e,
- attr: bt,
- detach: Ls,
- element: gt,
- init: Gc,
- insert: Ds,
- noop: co,
- safe_not_equal: Jc,
- set_data: el,
- set_style: Rl,
- space: li,
- text: Wt,
- toggle_class: _o
-} = window.__gradio__svelte__internal, { onMount: Qc, createEventDispatcher: xc, onDestroy: $c } = window.__gradio__svelte__internal;
-function ho(l) {
- let e, t, n, i, o = an(
+ SvelteComponent: Pc,
+ append: me,
+ attr: vt,
+ detach: Ho,
+ element: yt,
+ init: Zc,
+ insert: Xo,
+ noop: ps,
+ safe_not_equal: Kc,
+ set_data: il,
+ set_style: Vl,
+ space: _i,
+ text: Jt,
+ toggle_class: ks
+} = window.__gradio__svelte__internal, { onMount: Gc, createEventDispatcher: Jc, onDestroy: Qc } = window.__gradio__svelte__internal;
+function vs(l) {
+ let e, t, n, i, s = _n(
/*file_to_display*/
l[2]
- ) + "", a, r, s, f, u = (
+ ) + "", a, r, o, f, u = (
/*file_to_display*/
l[2].orig_name + ""
), c;
return {
c() {
- e = gt("div"), t = gt("span"), n = gt("div"), i = gt("progress"), a = Wt(o), s = li(), f = gt("span"), c = Wt(u), Rl(i, "visibility", "hidden"), Rl(i, "height", "0"), Rl(i, "width", "0"), i.value = r = an(
+ e = yt("div"), t = yt("span"), n = yt("div"), i = yt("progress"), a = Jt(s), o = _i(), f = yt("span"), c = Jt(u), Vl(i, "visibility", "hidden"), Vl(i, "height", "0"), Vl(i, "width", "0"), i.value = r = _n(
/*file_to_display*/
l[2]
- ), bt(i, "max", "100"), bt(i, "class", "svelte-cr2edf"), bt(n, "class", "progress-bar svelte-cr2edf"), bt(f, "class", "file-name svelte-cr2edf"), bt(e, "class", "file svelte-cr2edf");
+ ), vt(i, "max", "100"), vt(i, "class", "svelte-cr2edf"), vt(n, "class", "progress-bar svelte-cr2edf"), vt(f, "class", "file-name svelte-cr2edf"), vt(e, "class", "file svelte-cr2edf");
},
- m(_, d) {
- Ds(_, e, d), _e(e, t), _e(t, n), _e(n, i), _e(i, a), _e(e, s), _e(e, f), _e(f, c);
+ m(d, _) {
+ Xo(d, e, _), me(e, t), me(t, n), me(n, i), me(i, a), me(e, o), me(e, f), me(f, c);
},
- p(_, d) {
- d & /*file_to_display*/
- 4 && o !== (o = an(
+ p(d, _) {
+ _ & /*file_to_display*/
+ 4 && s !== (s = _n(
/*file_to_display*/
- _[2]
- ) + "") && el(a, o), d & /*file_to_display*/
- 4 && r !== (r = an(
+ d[2]
+ ) + "") && il(a, s), _ & /*file_to_display*/
+ 4 && r !== (r = _n(
/*file_to_display*/
- _[2]
- )) && (i.value = r), d & /*file_to_display*/
+ d[2]
+ )) && (i.value = r), _ & /*file_to_display*/
4 && u !== (u = /*file_to_display*/
- _[2].orig_name + "") && el(c, u);
+ d[2].orig_name + "") && il(c, u);
},
- d(_) {
- _ && Ls(e);
+ d(d) {
+ d && Ho(e);
}
};
}
-function e_(l) {
+function xc(l) {
let e, t, n, i = (
/*files_with_progress*/
l[0].length + ""
- ), o, a, r = (
+ ), s, a, r = (
/*files_with_progress*/
l[0].length > 1 ? "files" : "file"
- ), s, f, u, c = (
+ ), o, f, u, c = (
/*file_to_display*/
- l[2] && ho(l)
+ l[2] && vs(l)
);
return {
c() {
- e = gt("div"), t = gt("span"), n = Wt("Uploading "), o = Wt(i), a = li(), s = Wt(r), f = Wt("..."), u = li(), c && c.c(), bt(t, "class", "uploading svelte-cr2edf"), bt(e, "class", "wrap svelte-cr2edf"), _o(
+ e = yt("div"), t = yt("span"), n = Jt("Uploading "), s = Jt(i), a = _i(), o = Jt(r), f = Jt("..."), u = _i(), c && c.c(), vt(t, "class", "uploading svelte-cr2edf"), vt(e, "class", "wrap svelte-cr2edf"), ks(
e,
"progress",
/*progress*/
l[1]
);
},
- m(_, d) {
- Ds(_, e, d), _e(e, t), _e(t, n), _e(t, o), _e(t, a), _e(t, s), _e(t, f), _e(e, u), c && c.m(e, null);
+ m(d, _) {
+ Xo(d, e, _), me(e, t), me(t, n), me(t, s), me(t, a), me(t, o), me(t, f), me(e, u), c && c.m(e, null);
},
- p(_, [d]) {
- d & /*files_with_progress*/
+ p(d, [_]) {
+ _ & /*files_with_progress*/
1 && i !== (i = /*files_with_progress*/
- _[0].length + "") && el(o, i), d & /*files_with_progress*/
+ d[0].length + "") && il(s, i), _ & /*files_with_progress*/
1 && r !== (r = /*files_with_progress*/
- _[0].length > 1 ? "files" : "file") && el(s, r), /*file_to_display*/
- _[2] ? c ? c.p(_, d) : (c = ho(_), c.c(), c.m(e, null)) : c && (c.d(1), c = null), d & /*progress*/
- 2 && _o(
+ d[0].length > 1 ? "files" : "file") && il(o, r), /*file_to_display*/
+ d[2] ? c ? c.p(d, _) : (c = vs(d), c.c(), c.m(e, null)) : c && (c.d(1), c = null), _ & /*progress*/
+ 2 && ks(
e,
"progress",
/*progress*/
- _[1]
+ d[1]
);
},
- i: co,
- o: co,
- d(_) {
- _ && Ls(e), c && c.d();
+ i: ps,
+ o: ps,
+ d(d) {
+ d && Ho(e), c && c.d();
}
};
}
-function an(l) {
+function _n(l) {
return l.progress * 100 / (l.size || 0) || 0;
}
-function t_(l) {
+function $c(l) {
let e = 0;
return l.forEach((t) => {
- e += an(t);
+ e += _n(t);
}), document.documentElement.style.setProperty("--upload-progress-width", (e / l.length).toFixed(2) + "%"), e / l.length;
}
-function n_(l, e, t) {
- var n = this && this.__awaiter || function(b, m, w, k) {
- function g(S) {
- return S instanceof w ? S : new w(function(M) {
- M(S);
+function e_(l, e, t) {
+ var n = this && this.__awaiter || function(h, w, g, p) {
+ function m(C) {
+ return C instanceof g ? C : new g(function(z) {
+ z(C);
});
}
- return new (w || (w = Promise))(function(S, M) {
- function y(q) {
+ return new (g || (g = Promise))(function(C, z) {
+ function y(E) {
try {
- v(k.next(q));
- } catch (R) {
- M(R);
+ v(p.next(E));
+ } catch (F) {
+ z(F);
}
}
- function z(q) {
+ function q(E) {
try {
- v(k.throw(q));
- } catch (R) {
- M(R);
+ v(p.throw(E));
+ } catch (F) {
+ z(F);
}
}
- function v(q) {
- q.done ? S(q.value) : g(q.value).then(y, z);
+ function v(E) {
+ E.done ? C(E.value) : m(E.value).then(y, q);
}
- v((k = k.apply(b, m || [])).next());
+ v((p = p.apply(h, w || [])).next());
});
};
- let { upload_id: i } = e, { root: o } = e, { files: a } = e, { stream_handler: r } = e, s, f = !1, u, c, _ = a.map((b) => Object.assign(Object.assign({}, b), { progress: 0 }));
- const d = xc();
- function h(b, m) {
- t(0, _ = _.map((w) => (w.orig_name === b && (w.progress += m), w)));
+ let { upload_id: i } = e, { root: s } = e, { files: a } = e, { stream_handler: r } = e, o, f = !1, u, c, d = a.map((h) => Object.assign(Object.assign({}, h), { progress: 0 }));
+ const _ = Jc();
+ function b(h, w) {
+ t(0, d = d.map((g) => (g.orig_name === h && (g.progress += w), g)));
}
- return Qc(() => n(void 0, void 0, void 0, function* () {
- if (s = yield r(new URL(`${o}/upload_progress?upload_id=${i}`)), s == null)
+ return Gc(() => n(void 0, void 0, void 0, function* () {
+ if (o = yield r(new URL(`${s}/upload_progress?upload_id=${i}`)), o == null)
throw new Error("Event source is not defined");
- s.onmessage = function(b) {
+ o.onmessage = function(h) {
return n(this, void 0, void 0, function* () {
- const m = JSON.parse(b.data);
- f || t(1, f = !0), m.msg === "done" ? (s == null || s.close(), d("done")) : (t(7, u = m), h(m.orig_name, m.chunk_size));
+ const w = JSON.parse(h.data);
+ f || t(1, f = !0), w.msg === "done" ? (o == null || o.close(), _("done")) : (t(7, u = w), b(w.orig_name, w.chunk_size));
});
};
- })), $c(() => {
- (s != null || s != null) && s.close();
- }), l.$$set = (b) => {
- "upload_id" in b && t(3, i = b.upload_id), "root" in b && t(4, o = b.root), "files" in b && t(5, a = b.files), "stream_handler" in b && t(6, r = b.stream_handler);
+ })), Qc(() => {
+ (o != null || o != null) && o.close();
+ }), l.$$set = (h) => {
+ "upload_id" in h && t(3, i = h.upload_id), "root" in h && t(4, s = h.root), "files" in h && t(5, a = h.files), "stream_handler" in h && t(6, r = h.stream_handler);
}, l.$$.update = () => {
l.$$.dirty & /*files_with_progress*/
- 1 && t_(_), l.$$.dirty & /*current_file_upload, files_with_progress*/
- 129 && t(2, c = u || _[0]);
+ 1 && $c(d), l.$$.dirty & /*current_file_upload, files_with_progress*/
+ 129 && t(2, c = u || d[0]);
}, [
- _,
+ d,
f,
c,
i,
- o,
+ s,
a,
r,
u
];
}
-class l_ extends Kc {
+class t_ extends Pc {
constructor(e) {
- super(), Gc(this, e, n_, e_, Jc, {
+ super(), Zc(this, e, e_, xc, Kc, {
upload_id: 3,
root: 4,
files: 5,
@@ -4271,43 +4238,43 @@ class l_ extends Kc {
}
}
const {
- SvelteComponent: i_,
- append: mo,
+ SvelteComponent: n_,
+ append: ys,
attr: se,
- binding_callbacks: o_,
- bubble: ct,
- check_outros: Ts,
- create_component: s_,
- create_slot: js,
- destroy_component: a_,
- detach: hl,
- element: ii,
- empty: Is,
- get_all_dirty_from_scope: Rs,
- get_slot_changes: Fs,
- group_outros: Hs,
- init: r_,
- insert: ml,
- listen: we,
- mount_component: f_,
- prevent_default: _t,
- run_all: u_,
- safe_not_equal: c_,
- set_style: Us,
- space: __,
- stop_propagation: dt,
- toggle_class: te,
- transition_in: st,
- transition_out: Et,
- update_slot_base: Ns
-} = window.__gradio__svelte__internal, { createEventDispatcher: d_, tick: h_ } = window.__gradio__svelte__internal;
-function m_(l) {
- let e, t, n, i, o, a, r, s, f, u, c;
- const _ = (
+ binding_callbacks: l_,
+ bubble: bt,
+ check_outros: Yo,
+ create_component: i_,
+ create_slot: Uo,
+ destroy_component: s_,
+ detach: vl,
+ element: di,
+ empty: No,
+ get_all_dirty_from_scope: Vo,
+ get_slot_changes: Oo,
+ group_outros: Wo,
+ init: o_,
+ insert: yl,
+ listen: ke,
+ mount_component: a_,
+ prevent_default: gt,
+ run_all: r_,
+ safe_not_equal: f_,
+ set_style: Po,
+ space: u_,
+ stop_propagation: wt,
+ toggle_class: ne,
+ transition_in: ut,
+ transition_out: Mt,
+ update_slot_base: Zo
+} = window.__gradio__svelte__internal, { createEventDispatcher: c_, tick: __ } = window.__gradio__svelte__internal;
+function d_(l) {
+ let e, t, n, i, s, a, r, o, f, u, c;
+ const d = (
/*#slots*/
l[26].default
- ), d = js(
- _,
+ ), _ = Uo(
+ d,
l,
/*$$scope*/
l[25],
@@ -4315,93 +4282,93 @@ function m_(l) {
);
return {
c() {
- e = ii("button"), d && d.c(), t = __(), n = ii("input"), se(n, "aria-label", "file upload"), se(n, "data-testid", "file-upload"), se(n, "type", "file"), se(n, "accept", i = /*accept_file_types*/
- l[16] || void 0), n.multiple = o = /*file_count*/
+ e = di("button"), _ && _.c(), t = u_(), n = di("input"), se(n, "aria-label", "file upload"), se(n, "data-testid", "file-upload"), se(n, "type", "file"), se(n, "accept", i = /*accept_file_types*/
+ l[16] || void 0), n.multiple = s = /*file_count*/
l[6] === "multiple" || void 0, se(n, "webkitdirectory", a = /*file_count*/
l[6] === "directory" || void 0), se(n, "mozdirectory", r = /*file_count*/
- l[6] === "directory" || void 0), se(n, "class", "svelte-1s26xmt"), se(e, "tabindex", s = /*hidden*/
- l[9] ? -1 : 0), se(e, "class", "svelte-1s26xmt"), te(
+ l[6] === "directory" || void 0), se(n, "class", "svelte-1s26xmt"), se(e, "tabindex", o = /*hidden*/
+ l[9] ? -1 : 0), se(e, "class", "svelte-1s26xmt"), ne(
e,
"hidden",
/*hidden*/
l[9]
- ), te(
+ ), ne(
e,
"center",
/*center*/
l[4]
- ), te(
+ ), ne(
e,
"boundedheight",
/*boundedheight*/
l[3]
- ), te(
+ ), ne(
e,
"flex",
/*flex*/
l[5]
- ), te(
+ ), ne(
e,
"disable_click",
/*disable_click*/
l[7]
- ), Us(e, "height", "100%");
+ ), Po(e, "height", "100%");
},
- m(h, b) {
- ml(h, e, b), d && d.m(e, null), mo(e, t), mo(e, n), l[34](n), f = !0, u || (c = [
- we(
+ m(b, h) {
+ yl(b, e, h), _ && _.m(e, null), ys(e, t), ys(e, n), l[34](n), f = !0, u || (c = [
+ ke(
n,
"change",
/*load_files_from_upload*/
l[18]
),
- we(e, "drag", dt(_t(
+ ke(e, "drag", wt(gt(
/*drag_handler*/
l[27]
))),
- we(e, "dragstart", dt(_t(
+ ke(e, "dragstart", wt(gt(
/*dragstart_handler*/
l[28]
))),
- we(e, "dragend", dt(_t(
+ ke(e, "dragend", wt(gt(
/*dragend_handler*/
l[29]
))),
- we(e, "dragover", dt(_t(
+ ke(e, "dragover", wt(gt(
/*dragover_handler*/
l[30]
))),
- we(e, "dragenter", dt(_t(
+ ke(e, "dragenter", wt(gt(
/*dragenter_handler*/
l[31]
))),
- we(e, "dragleave", dt(_t(
+ ke(e, "dragleave", wt(gt(
/*dragleave_handler*/
l[32]
))),
- we(e, "drop", dt(_t(
+ ke(e, "drop", wt(gt(
/*drop_handler*/
l[33]
))),
- we(
+ ke(
e,
"click",
/*open_file_upload*/
l[13]
),
- we(
+ ke(
e,
"drop",
/*loadFilesFromDrop*/
l[19]
),
- we(
+ ke(
e,
"dragenter",
/*updateDragging*/
l[17]
),
- we(
+ ke(
e,
"dragleave",
/*updateDragging*/
@@ -4409,112 +4376,112 @@ function m_(l) {
)
], u = !0);
},
- p(h, b) {
- d && d.p && (!f || b[0] & /*$$scope*/
- 33554432) && Ns(
- d,
+ p(b, h) {
+ _ && _.p && (!f || h[0] & /*$$scope*/
+ 33554432) && Zo(
_,
- h,
+ d,
+ b,
/*$$scope*/
- h[25],
- f ? Fs(
- _,
+ b[25],
+ f ? Oo(
+ d,
/*$$scope*/
- h[25],
- b,
+ b[25],
+ h,
null
- ) : Rs(
+ ) : Vo(
/*$$scope*/
- h[25]
+ b[25]
),
null
- ), (!f || b[0] & /*accept_file_types*/
+ ), (!f || h[0] & /*accept_file_types*/
65536 && i !== (i = /*accept_file_types*/
- h[16] || void 0)) && se(n, "accept", i), (!f || b[0] & /*file_count*/
- 64 && o !== (o = /*file_count*/
- h[6] === "multiple" || void 0)) && (n.multiple = o), (!f || b[0] & /*file_count*/
+ b[16] || void 0)) && se(n, "accept", i), (!f || h[0] & /*file_count*/
+ 64 && s !== (s = /*file_count*/
+ b[6] === "multiple" || void 0)) && (n.multiple = s), (!f || h[0] & /*file_count*/
64 && a !== (a = /*file_count*/
- h[6] === "directory" || void 0)) && se(n, "webkitdirectory", a), (!f || b[0] & /*file_count*/
+ b[6] === "directory" || void 0)) && se(n, "webkitdirectory", a), (!f || h[0] & /*file_count*/
64 && r !== (r = /*file_count*/
- h[6] === "directory" || void 0)) && se(n, "mozdirectory", r), (!f || b[0] & /*hidden*/
- 512 && s !== (s = /*hidden*/
- h[9] ? -1 : 0)) && se(e, "tabindex", s), (!f || b[0] & /*hidden*/
- 512) && te(
+ b[6] === "directory" || void 0)) && se(n, "mozdirectory", r), (!f || h[0] & /*hidden*/
+ 512 && o !== (o = /*hidden*/
+ b[9] ? -1 : 0)) && se(e, "tabindex", o), (!f || h[0] & /*hidden*/
+ 512) && ne(
e,
"hidden",
/*hidden*/
- h[9]
- ), (!f || b[0] & /*center*/
- 16) && te(
+ b[9]
+ ), (!f || h[0] & /*center*/
+ 16) && ne(
e,
"center",
/*center*/
- h[4]
- ), (!f || b[0] & /*boundedheight*/
- 8) && te(
+ b[4]
+ ), (!f || h[0] & /*boundedheight*/
+ 8) && ne(
e,
"boundedheight",
/*boundedheight*/
- h[3]
- ), (!f || b[0] & /*flex*/
- 32) && te(
+ b[3]
+ ), (!f || h[0] & /*flex*/
+ 32) && ne(
e,
"flex",
/*flex*/
- h[5]
- ), (!f || b[0] & /*disable_click*/
- 128) && te(
+ b[5]
+ ), (!f || h[0] & /*disable_click*/
+ 128) && ne(
e,
"disable_click",
/*disable_click*/
- h[7]
+ b[7]
);
},
- i(h) {
- f || (st(d, h), f = !0);
+ i(b) {
+ f || (ut(_, b), f = !0);
},
- o(h) {
- Et(d, h), f = !1;
+ o(b) {
+ Mt(_, b), f = !1;
},
- d(h) {
- h && hl(e), d && d.d(h), l[34](null), u = !1, u_(c);
+ d(b) {
+ b && vl(e), _ && _.d(b), l[34](null), u = !1, r_(c);
}
};
}
-function b_(l) {
+function h_(l) {
let e, t, n = !/*hidden*/
- l[9] && bo(l);
+ l[9] && Cs(l);
return {
c() {
- n && n.c(), e = Is();
+ n && n.c(), e = No();
},
- m(i, o) {
- n && n.m(i, o), ml(i, e, o), t = !0;
+ m(i, s) {
+ n && n.m(i, s), yl(i, e, s), t = !0;
},
- p(i, o) {
+ p(i, s) {
/*hidden*/
- i[9] ? n && (Hs(), Et(n, 1, 1, () => {
+ i[9] ? n && (Wo(), Mt(n, 1, 1, () => {
n = null;
- }), Ts()) : n ? (n.p(i, o), o[0] & /*hidden*/
- 512 && st(n, 1)) : (n = bo(i), n.c(), st(n, 1), n.m(e.parentNode, e));
+ }), Yo()) : n ? (n.p(i, s), s[0] & /*hidden*/
+ 512 && ut(n, 1)) : (n = Cs(i), n.c(), ut(n, 1), n.m(e.parentNode, e));
},
i(i) {
- t || (st(n), t = !0);
+ t || (ut(n), t = !0);
},
o(i) {
- Et(n), t = !1;
+ Mt(n), t = !1;
},
d(i) {
- i && hl(e), n && n.d(i);
+ i && vl(e), n && n.d(i);
}
};
}
-function g_(l) {
- let e, t, n, i, o;
+function m_(l) {
+ let e, t, n, i, s;
const a = (
/*#slots*/
l[26].default
- ), r = js(
+ ), r = Uo(
a,
l,
/*$$scope*/
@@ -4523,98 +4490,98 @@ function g_(l) {
);
return {
c() {
- e = ii("button"), r && r.c(), se(e, "tabindex", t = /*hidden*/
- l[9] ? -1 : 0), se(e, "class", "svelte-1s26xmt"), te(
+ e = di("button"), r && r.c(), se(e, "tabindex", t = /*hidden*/
+ l[9] ? -1 : 0), se(e, "class", "svelte-1s26xmt"), ne(
e,
"hidden",
/*hidden*/
l[9]
- ), te(
+ ), ne(
e,
"center",
/*center*/
l[4]
- ), te(
+ ), ne(
e,
"boundedheight",
/*boundedheight*/
l[3]
- ), te(
+ ), ne(
e,
"flex",
/*flex*/
l[5]
- ), Us(e, "height", "100%");
+ ), Po(e, "height", "100%");
},
- m(s, f) {
- ml(s, e, f), r && r.m(e, null), n = !0, i || (o = we(
+ m(o, f) {
+ yl(o, e, f), r && r.m(e, null), n = !0, i || (s = ke(
e,
"click",
/*paste_clipboard*/
l[12]
), i = !0);
},
- p(s, f) {
+ p(o, f) {
r && r.p && (!n || f[0] & /*$$scope*/
- 33554432) && Ns(
+ 33554432) && Zo(
r,
a,
- s,
+ o,
/*$$scope*/
- s[25],
- n ? Fs(
+ o[25],
+ n ? Oo(
a,
/*$$scope*/
- s[25],
+ o[25],
f,
null
- ) : Rs(
+ ) : Vo(
/*$$scope*/
- s[25]
+ o[25]
),
null
), (!n || f[0] & /*hidden*/
512 && t !== (t = /*hidden*/
- s[9] ? -1 : 0)) && se(e, "tabindex", t), (!n || f[0] & /*hidden*/
- 512) && te(
+ o[9] ? -1 : 0)) && se(e, "tabindex", t), (!n || f[0] & /*hidden*/
+ 512) && ne(
e,
"hidden",
/*hidden*/
- s[9]
+ o[9]
), (!n || f[0] & /*center*/
- 16) && te(
+ 16) && ne(
e,
"center",
/*center*/
- s[4]
+ o[4]
), (!n || f[0] & /*boundedheight*/
- 8) && te(
+ 8) && ne(
e,
"boundedheight",
/*boundedheight*/
- s[3]
+ o[3]
), (!n || f[0] & /*flex*/
- 32) && te(
+ 32) && ne(
e,
"flex",
/*flex*/
- s[5]
+ o[5]
);
},
- i(s) {
- n || (st(r, s), n = !0);
+ i(o) {
+ n || (ut(r, o), n = !0);
},
- o(s) {
- Et(r, s), n = !1;
+ o(o) {
+ Mt(r, o), n = !1;
},
- d(s) {
- s && hl(e), r && r.d(s), i = !1, o();
+ d(o) {
+ o && vl(e), r && r.d(o), i = !1, s();
}
};
}
-function bo(l) {
+function Cs(l) {
let e, t;
- return e = new l_({
+ return e = new t_({
props: {
root: (
/*root*/
@@ -4635,72 +4602,72 @@ function bo(l) {
}
}), {
c() {
- s_(e.$$.fragment);
+ i_(e.$$.fragment);
},
m(n, i) {
- f_(e, n, i), t = !0;
+ a_(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*root*/
- 256 && (o.root = /*root*/
+ 256 && (s.root = /*root*/
n[8]), i[0] & /*upload_id*/
- 16384 && (o.upload_id = /*upload_id*/
+ 16384 && (s.upload_id = /*upload_id*/
n[14]), i[0] & /*file_data*/
- 32768 && (o.files = /*file_data*/
+ 32768 && (s.files = /*file_data*/
n[15]), i[0] & /*stream_handler*/
- 2048 && (o.stream_handler = /*stream_handler*/
- n[11]), e.$set(o);
+ 2048 && (s.stream_handler = /*stream_handler*/
+ n[11]), e.$set(s);
},
i(n) {
- t || (st(e.$$.fragment, n), t = !0);
+ t || (ut(e.$$.fragment, n), t = !0);
},
o(n) {
- Et(e.$$.fragment, n), t = !1;
+ Mt(e.$$.fragment, n), t = !1;
},
d(n) {
- a_(e, n);
+ s_(e, n);
}
};
}
-function w_(l) {
+function b_(l) {
let e, t, n, i;
- const o = [g_, b_, m_], a = [];
- function r(s, f) {
+ const s = [m_, h_, d_], a = [];
+ function r(o, f) {
return (
/*filetype*/
- s[0] === "clipboard" ? 0 : (
+ o[0] === "clipboard" ? 0 : (
/*uploading*/
- s[1] && /*show_progress*/
- s[10] ? 1 : 2
+ o[1] && /*show_progress*/
+ o[10] ? 1 : 2
)
);
}
- return e = r(l), t = a[e] = o[e](l), {
+ return e = r(l), t = a[e] = s[e](l), {
c() {
- t.c(), n = Is();
+ t.c(), n = No();
},
- m(s, f) {
- a[e].m(s, f), ml(s, n, f), i = !0;
+ m(o, f) {
+ a[e].m(o, f), yl(o, n, f), i = !0;
},
- p(s, f) {
+ p(o, f) {
let u = e;
- e = r(s), e === u ? a[e].p(s, f) : (Hs(), Et(a[u], 1, 1, () => {
+ e = r(o), e === u ? a[e].p(o, f) : (Wo(), Mt(a[u], 1, 1, () => {
a[u] = null;
- }), Ts(), t = a[e], t ? t.p(s, f) : (t = a[e] = o[e](s), t.c()), st(t, 1), t.m(n.parentNode, n));
+ }), Yo(), t = a[e], t ? t.p(o, f) : (t = a[e] = s[e](o), t.c()), ut(t, 1), t.m(n.parentNode, n));
},
- i(s) {
- i || (st(t), i = !0);
+ i(o) {
+ i || (ut(t), i = !0);
},
- o(s) {
- Et(t), i = !1;
+ o(o) {
+ Mt(t), i = !1;
},
- d(s) {
- s && hl(n), a[e].d(s);
+ d(o) {
+ o && vl(n), a[e].d(o);
}
};
}
-function p_(l, e, t) {
+function g_(l, e, t) {
if (!l || l === "*" || l === "file/*" || Array.isArray(l) && l.some((i) => i === "*" || i === "file/*"))
return !0;
let n;
@@ -4711,183 +4678,183 @@ function p_(l, e, t) {
else
return !1;
return n.includes(e) || n.some((i) => {
- const [o] = i.split("/").map((a) => a.trim());
- return i.endsWith("/*") && t.startsWith(o + "/");
+ const [s] = i.split("/").map((a) => a.trim());
+ return i.endsWith("/*") && t.startsWith(s + "/");
});
}
-function k_(l, e, t) {
+function w_(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
- var o = this && this.__awaiter || function(p, F, Z, K) {
- function C(Se) {
- return Se instanceof Z ? Se : new Z(function(he) {
- he(Se);
+ var s = this && this.__awaiter || function(k, H, O, G) {
+ function S(be) {
+ return be instanceof O ? be : new O(function(ge) {
+ ge(be);
});
}
- return new (Z || (Z = Promise))(function(Se, he) {
- function ze(D) {
+ return new (O || (O = Promise))(function(be, ge) {
+ function ze(ue) {
try {
- E(K.next(D));
- } catch (Y) {
- he(Y);
+ oe(G.next(ue));
+ } catch (mt) {
+ ge(mt);
}
}
- function me(D) {
+ function we(ue) {
try {
- E(K.throw(D));
- } catch (Y) {
- he(Y);
+ oe(G.throw(ue));
+ } catch (mt) {
+ ge(mt);
}
}
- function E(D) {
- D.done ? Se(D.value) : C(D.value).then(ze, me);
+ function oe(ue) {
+ ue.done ? be(ue.value) : S(ue.value).then(ze, we);
}
- E((K = K.apply(p, F || [])).next());
+ oe((G = G.apply(k, H || [])).next());
});
};
- let { filetype: a = null } = e, { dragging: r = !1 } = e, { boundedheight: s = !0 } = e, { center: f = !0 } = e, { flex: u = !0 } = e, { file_count: c = "single" } = e, { disable_click: _ = !1 } = e, { root: d } = e, { hidden: h = !1 } = e, { format: b = "file" } = e, { uploading: m = !1 } = e, { hidden_upload: w = null } = e, { show_progress: k = !0 } = e, { max_file_size: g = null } = e, { upload: S } = e, { stream_handler: M } = e, y, z, v;
- const q = d_(), R = ["image", "video", "audio", "text", "file"], I = (p) => p.startsWith(".") || p.endsWith("/*") ? p : R.includes(p) ? p + "/*" : "." + p;
- function B() {
+ let { filetype: a = null } = e, { dragging: r = !1 } = e, { boundedheight: o = !0 } = e, { center: f = !0 } = e, { flex: u = !0 } = e, { file_count: c = "single" } = e, { disable_click: d = !1 } = e, { root: _ } = e, { hidden: b = !1 } = e, { format: h = "file" } = e, { uploading: w = !1 } = e, { hidden_upload: g = null } = e, { show_progress: p = !0 } = e, { max_file_size: m = null } = e, { upload: C } = e, { stream_handler: z } = e, y, q, v;
+ const E = c_(), F = ["image", "video", "audio", "text", "file"], X = (k) => k.startsWith(".") || k.endsWith("/*") ? k : F.includes(k) ? k + "/*" : "." + k;
+ function L() {
t(20, r = !r);
}
- function W() {
- navigator.clipboard.read().then((p) => o(this, void 0, void 0, function* () {
- for (let F = 0; F < p.length; F++) {
- const Z = p[F].types.find((K) => K.startsWith("image/"));
- if (Z) {
- p[F].getType(Z).then((K) => o(this, void 0, void 0, function* () {
- const C = new File([K], `clipboard.${Z.replace("image/", "")}`);
- yield X([C]);
+ function V() {
+ navigator.clipboard.read().then((k) => s(this, void 0, void 0, function* () {
+ for (let H = 0; H < k.length; H++) {
+ const O = k[H].types.find((G) => G.startsWith("image/"));
+ if (O) {
+ k[H].getType(O).then((G) => s(this, void 0, void 0, function* () {
+ const S = new File([G], `clipboard.${O.replace("image/", "")}`);
+ yield W([S]);
}));
break;
}
}
}));
}
- function H() {
- _ || w && (t(2, w.value = "", w), w.click());
+ function I() {
+ d || g && (t(2, g.value = "", g), g.click());
}
- function le(p) {
- return o(this, void 0, void 0, function* () {
- yield h_(), t(14, y = Math.random().toString(36).substring(2, 15)), t(1, m = !0);
+ function Q(k) {
+ return s(this, void 0, void 0, function* () {
+ yield __(), t(14, y = Math.random().toString(36).substring(2, 15)), t(1, w = !0);
try {
- const F = yield S(p, d, y, g ?? 1 / 0);
- return q("load", c === "single" ? F == null ? void 0 : F[0] : F), t(1, m = !1), F || [];
- } catch (F) {
- return q("error", F.message), t(1, m = !1), [];
+ const H = yield C(k, _, y, m ?? 1 / 0);
+ return E("load", c === "single" ? H == null ? void 0 : H[0] : H), t(1, w = !1), H || [];
+ } catch (H) {
+ return E("error", H.message), t(1, w = !1), [];
}
});
}
- function X(p) {
- return o(this, void 0, void 0, function* () {
- if (!p.length)
+ function W(k) {
+ return s(this, void 0, void 0, function* () {
+ if (!k.length)
return;
- let F = p.map((Z) => new File([Z], Z instanceof File ? Z.name : "file", { type: Z.type }));
- return t(15, z = yield Pc(F)), yield le(z);
+ let H = k.map((O) => new File([O], O instanceof File ? O.name : "file", { type: O.type }));
+ return t(15, q = yield Oc(H)), yield Q(q);
});
}
- function ee(p) {
- return o(this, void 0, void 0, function* () {
- const F = p.target;
- if (F.files)
- if (b != "blob")
- yield X(Array.from(F.files));
+ function le(k) {
+ return s(this, void 0, void 0, function* () {
+ const H = k.target;
+ if (H.files)
+ if (h != "blob")
+ yield W(Array.from(H.files));
else {
if (c === "single") {
- q("load", F.files[0]);
+ E("load", H.files[0]);
return;
}
- q("load", F.files);
+ E("load", H.files);
}
});
}
- function ae(p) {
- return o(this, void 0, void 0, function* () {
- var F;
- if (t(20, r = !1), !(!((F = p.dataTransfer) === null || F === void 0) && F.files)) return;
- const Z = Array.from(p.dataTransfer.files).filter((K) => {
- const C = "." + K.name.split(".").pop();
- return C && p_(v, C, K.type) || (C && Array.isArray(a) ? a.includes(C) : C === a) ? !0 : (q("error", `Invalid file type only ${a} allowed.`), !1);
+ function ae(k) {
+ return s(this, void 0, void 0, function* () {
+ var H;
+ if (t(20, r = !1), !(!((H = k.dataTransfer) === null || H === void 0) && H.files)) return;
+ const O = Array.from(k.dataTransfer.files).filter((G) => {
+ const S = "." + G.name.split(".").pop();
+ return S && g_(v, S, G.type) || (S && Array.isArray(a) ? a.includes(S) : S === a) ? !0 : (E("error", `Invalid file type only ${a} allowed.`), !1);
});
- yield X(Z);
+ yield W(O);
});
}
- function ye(p) {
- ct.call(this, l, p);
+ function re(k) {
+ bt.call(this, l, k);
}
- function L(p) {
- ct.call(this, l, p);
+ function D(k) {
+ bt.call(this, l, k);
}
- function de(p) {
- ct.call(this, l, p);
+ function fe(k) {
+ bt.call(this, l, k);
}
- function Ae(p) {
- ct.call(this, l, p);
+ function Se(k) {
+ bt.call(this, l, k);
}
- function Le(p) {
- ct.call(this, l, p);
+ function Fe(k) {
+ bt.call(this, l, k);
}
- function Ce(p) {
- ct.call(this, l, p);
+ function Pe(k) {
+ bt.call(this, l, k);
}
- function A(p) {
- ct.call(this, l, p);
+ function B(k) {
+ bt.call(this, l, k);
}
- function Ve(p) {
- o_[p ? "unshift" : "push"](() => {
- w = p, t(2, w);
+ function Ze(k) {
+ l_[k ? "unshift" : "push"](() => {
+ g = k, t(2, g);
});
}
- return l.$$set = (p) => {
- "filetype" in p && t(0, a = p.filetype), "dragging" in p && t(20, r = p.dragging), "boundedheight" in p && t(3, s = p.boundedheight), "center" in p && t(4, f = p.center), "flex" in p && t(5, u = p.flex), "file_count" in p && t(6, c = p.file_count), "disable_click" in p && t(7, _ = p.disable_click), "root" in p && t(8, d = p.root), "hidden" in p && t(9, h = p.hidden), "format" in p && t(21, b = p.format), "uploading" in p && t(1, m = p.uploading), "hidden_upload" in p && t(2, w = p.hidden_upload), "show_progress" in p && t(10, k = p.show_progress), "max_file_size" in p && t(22, g = p.max_file_size), "upload" in p && t(23, S = p.upload), "stream_handler" in p && t(11, M = p.stream_handler), "$$scope" in p && t(25, i = p.$$scope);
+ return l.$$set = (k) => {
+ "filetype" in k && t(0, a = k.filetype), "dragging" in k && t(20, r = k.dragging), "boundedheight" in k && t(3, o = k.boundedheight), "center" in k && t(4, f = k.center), "flex" in k && t(5, u = k.flex), "file_count" in k && t(6, c = k.file_count), "disable_click" in k && t(7, d = k.disable_click), "root" in k && t(8, _ = k.root), "hidden" in k && t(9, b = k.hidden), "format" in k && t(21, h = k.format), "uploading" in k && t(1, w = k.uploading), "hidden_upload" in k && t(2, g = k.hidden_upload), "show_progress" in k && t(10, p = k.show_progress), "max_file_size" in k && t(22, m = k.max_file_size), "upload" in k && t(23, C = k.upload), "stream_handler" in k && t(11, z = k.stream_handler), "$$scope" in k && t(25, i = k.$$scope);
}, l.$$.update = () => {
l.$$.dirty[0] & /*filetype*/
- 1 && (a == null ? t(16, v = null) : typeof a == "string" ? t(16, v = I(a)) : (t(0, a = a.map(I)), t(16, v = a.join(", "))));
+ 1 && (a == null ? t(16, v = null) : typeof a == "string" ? t(16, v = X(a)) : (t(0, a = a.map(X)), t(16, v = a.join(", "))));
}, [
a,
- m,
w,
- s,
+ g,
+ o,
f,
u,
c,
- _,
d,
- h,
- k,
- M,
- W,
- H,
- y,
+ _,
+ b,
+ p,
z,
+ V,
+ I,
+ y,
+ q,
v,
- B,
- ee,
+ L,
+ le,
ae,
r,
- b,
- g,
- S,
- X,
+ h,
+ m,
+ C,
+ W,
i,
n,
- ye,
- L,
- de,
- Ae,
- Le,
- Ce,
- A,
- Ve
+ re,
+ D,
+ fe,
+ Se,
+ Fe,
+ Pe,
+ B,
+ Ze
];
}
-class v_ extends i_ {
+class p_ extends n_ {
constructor(e) {
- super(), r_(
+ super(), o_(
this,
e,
- k_,
w_,
- c_,
+ b_,
+ f_,
{
filetype: 0,
dragging: 20,
@@ -4924,89 +4891,123 @@ class v_ extends i_ {
}
}
const {
- SvelteComponent: y_,
- append: go,
- attr: oe,
- detach: C_,
- init: S_,
- insert: z_,
- noop: Fl,
- safe_not_equal: q_,
- set_style: tt,
- svg_element: Hl
+ SvelteComponent: k_,
+ append: nt,
+ attr: M,
+ detach: v_,
+ init: y_,
+ insert: C_,
+ noop: Ol,
+ safe_not_equal: S_,
+ set_style: lt,
+ svg_element: Ge
} = window.__gradio__svelte__internal;
-function E_(l) {
- let e, t, n;
+function z_(l) {
+ let e, t, n, i, s, a, r, o, f;
return {
c() {
- e = Hl("svg"), t = Hl("line"), n = Hl("line"), oe(t, "x1", "4"), oe(t, "y1", "12"), oe(t, "x2", "20"), oe(t, "y2", "12"), tt(t, "fill", "none"), tt(t, "stroke-width", "2px"), oe(n, "x1", "12"), oe(n, "y1", "4"), oe(n, "x2", "12"), oe(n, "y2", "20"), tt(n, "fill", "none"), tt(n, "stroke-width", "2px"), oe(e, "width", "100%"), oe(e, "height", "100%"), oe(e, "viewBox", "0 0 24 24"), oe(e, "version", "1.1"), oe(e, "xmlns", "http://www.w3.org/2000/svg"), oe(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), oe(e, "xml:space", "preserve"), oe(e, "stroke", "currentColor"), tt(e, "fill-rule", "evenodd"), tt(e, "clip-rule", "evenodd"), tt(e, "stroke-linecap", "round"), tt(e, "stroke-linejoin", "round");
+ e = Ge("svg"), t = Ge("rect"), n = Ge("rect"), i = Ge("rect"), s = Ge("rect"), a = Ge("line"), r = Ge("line"), o = Ge("line"), f = Ge("line"), M(t, "x", "2"), M(t, "y", "2"), M(t, "width", "5"), M(t, "height", "5"), M(t, "rx", "1"), M(t, "ry", "1"), M(t, "stroke-width", "2"), M(t, "fill", "none"), M(n, "x", "17"), M(n, "y", "2"), M(n, "width", "5"), M(n, "height", "5"), M(n, "rx", "1"), M(n, "ry", "1"), M(n, "stroke-width", "2"), M(n, "fill", "none"), M(i, "x", "2"), M(i, "y", "17"), M(i, "width", "5"), M(i, "height", "5"), M(i, "rx", "1"), M(i, "ry", "1"), M(i, "stroke-width", "2"), M(i, "fill", "none"), M(s, "x", "17"), M(s, "y", "17"), M(s, "width", "5"), M(s, "height", "5"), M(s, "rx", "1"), M(s, "ry", "1"), M(s, "stroke-width", "2"), M(s, "fill", "none"), M(a, "x1", "7.5"), M(a, "y1", "4.5"), M(a, "x2", "16"), M(a, "y2", "4.5"), lt(a, "stroke-width", "2px"), M(r, "x1", "7.5"), M(r, "y1", "19.5"), M(r, "x2", "16"), M(r, "y2", "19.5"), lt(r, "stroke-width", "2px"), M(o, "x1", "4.5"), M(o, "y1", "8"), M(o, "x2", "4.5"), M(o, "y2", "16"), lt(o, "stroke-width", "2px"), M(f, "x1", "19.5"), M(f, "y1", "8"), M(f, "x2", "19.5"), M(f, "y2", "16"), lt(f, "stroke-width", "2px"), M(e, "width", "100%"), M(e, "height", "100%"), M(e, "viewBox", "0 0 24 24"), M(e, "version", "1.1"), M(e, "xmlns", "http://www.w3.org/2000/svg"), M(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), M(e, "xml:space", "preserve"), M(e, "stroke", "currentColor"), lt(e, "fill-rule", "evenodd"), lt(e, "clip-rule", "evenodd"), lt(e, "stroke-linecap", "round"), lt(e, "stroke-linejoin", "round");
},
- m(i, o) {
- z_(i, e, o), go(e, t), go(e, n);
+ m(u, c) {
+ C_(u, e, c), nt(e, t), nt(e, n), nt(e, i), nt(e, s), nt(e, a), nt(e, r), nt(e, o), nt(e, f);
},
- p: Fl,
- i: Fl,
- o: Fl,
- d(i) {
- i && C_(e);
+ p: Ol,
+ i: Ol,
+ o: Ol,
+ d(u) {
+ u && v_(e);
+ }
+ };
+}
+class q_ extends k_ {
+ constructor(e) {
+ super(), y_(this, e, null, z_, S_, {});
+ }
+}
+const {
+ SvelteComponent: E_,
+ append: A_,
+ attr: Re,
+ detach: B_,
+ init: M_,
+ insert: L_,
+ noop: Wl,
+ safe_not_equal: D_,
+ set_style: Hn,
+ svg_element: Ss
+} = window.__gradio__svelte__internal;
+function T_(l) {
+ let e, t;
+ return {
+ c() {
+ e = Ss("svg"), t = Ss("path"), Re(t, "d", "M 14.4 2.85 V 11.1 V 3.95 C 14.4 3.0387 15.1388 2.3 16.05 2.3 C 16.9612 2.3 17.7 3.0387 17.7 3.95 V 11.1 V 7.25 C 17.7 6.3387 18.4388 5.6 19.35 5.6 C 20.2612 5.6 21 6.3387 21 7.25 V 16.6 C 21 20.2451 18.0451 23.2 14.4 23.2 H 13.16 C 11.4831 23.2 9.8692 22.5618 8.6459 21.4149 L 3.1915 16.3014 C 2.403 15.5622 2.3829 14.3171 3.1472 13.5528 C 3.8943 12.8057 5.1057 12.8057 5.8528 13.5528 L 7.8 15.5 V 6.15 C 7.8 5.2387 8.5387 4.5 9.45 4.5 C 10.3612 4.5 11.1 5.2387 11.1 6.15 V 11.1 V 2.85 C 11.1 1.9387 11.8388 1.2 12.75 1.2 C 13.6612 1.2 14.4 1.9387 14.4 2.85 Z"), Re(t, "fill", "none"), Re(t, "stroke-width", "2"), Re(e, "width", "100%"), Re(e, "height", "100%"), Re(e, "viewBox", "0 0 24 24"), Re(e, "version", "1.1"), Re(e, "xmlns", "http://www.w3.org/2000/svg"), Re(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Re(e, "xml:space", "preserve"), Re(e, "stroke", "currentColor"), Hn(e, "fill-rule", "evenodd"), Hn(e, "clip-rule", "evenodd"), Hn(e, "stroke-linecap", "round"), Hn(e, "stroke-linejoin", "round");
+ },
+ m(n, i) {
+ L_(n, e, i), A_(e, t);
+ },
+ p: Wl,
+ i: Wl,
+ o: Wl,
+ d(n) {
+ n && B_(e);
}
};
}
-class M_ extends y_ {
+class R_ extends E_ {
constructor(e) {
- super(), S_(this, e, null, E_, q_, {});
+ super(), M_(this, e, null, T_, D_, {});
}
}
const {
- SvelteComponent: B_,
- append: wo,
- attr: Ul,
- bubble: po,
- create_component: A_,
- destroy_component: L_,
- detach: Os,
- element: ko,
- init: D_,
- insert: Xs,
- listen: Nl,
- mount_component: T_,
- run_all: j_,
- safe_not_equal: I_,
- set_data: R_,
- set_input_value: vo,
- space: F_,
- text: H_,
- transition_in: U_,
- transition_out: N_
-} = window.__gradio__svelte__internal, { createEventDispatcher: O_, afterUpdate: X_ } = window.__gradio__svelte__internal;
-function Y_(l) {
+ SvelteComponent: j_,
+ append: zs,
+ attr: Pl,
+ bubble: qs,
+ create_component: I_,
+ destroy_component: F_,
+ detach: Ko,
+ element: Es,
+ init: H_,
+ insert: Go,
+ listen: Zl,
+ mount_component: X_,
+ run_all: Y_,
+ safe_not_equal: U_,
+ set_data: N_,
+ set_input_value: As,
+ space: V_,
+ text: O_,
+ transition_in: W_,
+ transition_out: P_
+} = window.__gradio__svelte__internal, { createEventDispatcher: Z_, afterUpdate: K_ } = window.__gradio__svelte__internal;
+function G_(l) {
let e;
return {
c() {
- e = H_(
+ e = O_(
/*label*/
l[1]
);
},
m(t, n) {
- Xs(t, e, n);
+ Go(t, e, n);
},
p(t, n) {
n & /*label*/
- 2 && R_(
+ 2 && N_(
e,
/*label*/
t[1]
);
},
d(t) {
- t && Os(e);
+ t && Ko(e);
}
};
}
-function W_(l) {
- let e, t, n, i, o, a, r;
- return t = new es({
+function J_(l) {
+ let e, t, n, i, s, a, r;
+ return t = new so({
props: {
show_label: (
/*show_label*/
@@ -5016,33 +5017,33 @@ function W_(l) {
/*info*/
l[2]
),
- $$slots: { default: [Y_] },
+ $$slots: { default: [G_] },
$$scope: { ctx: l }
}
}), {
c() {
- e = ko("label"), A_(t.$$.fragment), n = F_(), i = ko("input"), Ul(i, "type", "color"), i.disabled = /*disabled*/
- l[3], Ul(i, "class", "svelte-16l8u73"), Ul(e, "class", "block");
+ e = Es("label"), I_(t.$$.fragment), n = V_(), i = Es("input"), Pl(i, "type", "color"), i.disabled = /*disabled*/
+ l[3], Pl(i, "class", "svelte-16l8u73"), Pl(e, "class", "block");
},
- m(s, f) {
- Xs(s, e, f), T_(t, e, null), wo(e, n), wo(e, i), vo(
+ m(o, f) {
+ Go(o, e, f), X_(t, e, null), zs(e, n), zs(e, i), As(
i,
/*value*/
l[0]
- ), o = !0, a || (r = [
- Nl(
+ ), s = !0, a || (r = [
+ Zl(
i,
"input",
/*input_input_handler*/
l[8]
),
- Nl(
+ Zl(
i,
"focus",
/*focus_handler*/
l[6]
),
- Nl(
+ Zl(
i,
"blur",
/*blur_handler*/
@@ -5050,71 +5051,71 @@ function W_(l) {
)
], a = !0);
},
- p(s, [f]) {
+ p(o, [f]) {
const u = {};
f & /*show_label*/
16 && (u.show_label = /*show_label*/
- s[4]), f & /*info*/
+ o[4]), f & /*info*/
4 && (u.info = /*info*/
- s[2]), f & /*$$scope, label*/
- 2050 && (u.$$scope = { dirty: f, ctx: s }), t.$set(u), (!o || f & /*disabled*/
+ o[2]), f & /*$$scope, label*/
+ 2050 && (u.$$scope = { dirty: f, ctx: o }), t.$set(u), (!s || f & /*disabled*/
8) && (i.disabled = /*disabled*/
- s[3]), f & /*value*/
- 1 && vo(
+ o[3]), f & /*value*/
+ 1 && As(
i,
/*value*/
- s[0]
+ o[0]
);
},
- i(s) {
- o || (U_(t.$$.fragment, s), o = !0);
+ i(o) {
+ s || (W_(t.$$.fragment, o), s = !0);
},
- o(s) {
- N_(t.$$.fragment, s), o = !1;
+ o(o) {
+ P_(t.$$.fragment, o), s = !1;
},
- d(s) {
- s && Os(e), L_(t), a = !1, j_(r);
+ d(o) {
+ o && Ko(e), F_(t), a = !1, Y_(r);
}
};
}
-function V_(l, e, t) {
- let { value: n = "#000000" } = e, { value_is_output: i = !1 } = e, { label: o } = e, { info: a = void 0 } = e, { disabled: r = !1 } = e, { show_label: s = !0 } = e;
- const f = O_();
+function Q_(l, e, t) {
+ let { value: n = "#000000" } = e, { value_is_output: i = !1 } = e, { label: s } = e, { info: a = void 0 } = e, { disabled: r = !1 } = e, { show_label: o = !0 } = e;
+ const f = Z_();
function u() {
f("change", n), i || f("input");
}
- X_(() => {
+ K_(() => {
t(5, i = !1);
});
- function c(h) {
- po.call(this, l, h);
+ function c(b) {
+ qs.call(this, l, b);
}
- function _(h) {
- po.call(this, l, h);
+ function d(b) {
+ qs.call(this, l, b);
}
- function d() {
+ function _() {
n = this.value, t(0, n);
}
- return l.$$set = (h) => {
- "value" in h && t(0, n = h.value), "value_is_output" in h && t(5, i = h.value_is_output), "label" in h && t(1, o = h.label), "info" in h && t(2, a = h.info), "disabled" in h && t(3, r = h.disabled), "show_label" in h && t(4, s = h.show_label);
+ return l.$$set = (b) => {
+ "value" in b && t(0, n = b.value), "value_is_output" in b && t(5, i = b.value_is_output), "label" in b && t(1, s = b.label), "info" in b && t(2, a = b.info), "disabled" in b && t(3, r = b.disabled), "show_label" in b && t(4, o = b.show_label);
}, l.$$.update = () => {
l.$$.dirty & /*value*/
1 && u();
}, [
n,
- o,
+ s,
a,
r,
- s,
+ o,
i,
c,
- _,
- d
+ d,
+ _
];
}
-class P_ extends B_ {
+class x_ extends j_ {
constructor(e) {
- super(), D_(this, e, V_, W_, I_, {
+ super(), H_(this, e, Q_, J_, U_, {
value: 0,
value_is_output: 5,
label: 1,
@@ -5125,40 +5126,40 @@ class P_ extends B_ {
}
}
const {
- SvelteComponent: Z_,
- append: Ys,
- attr: V,
- bubble: K_,
- check_outros: G_,
- create_slot: Ws,
- detach: vn,
- element: bl,
- empty: J_,
- get_all_dirty_from_scope: Vs,
- get_slot_changes: Ps,
- group_outros: Q_,
- init: x_,
- insert: yn,
- listen: $_,
- safe_not_equal: ed,
- set_style: ce,
- space: Zs,
- src_url_equal: tl,
- toggle_class: Vt,
- transition_in: nl,
- transition_out: ll,
- update_slot_base: Ks
+ SvelteComponent: $_,
+ append: Jo,
+ attr: Z,
+ bubble: ed,
+ check_outros: td,
+ create_slot: Qo,
+ detach: qn,
+ element: Cl,
+ empty: nd,
+ get_all_dirty_from_scope: xo,
+ get_slot_changes: $o,
+ group_outros: ld,
+ init: id,
+ insert: En,
+ listen: sd,
+ safe_not_equal: od,
+ set_style: he,
+ space: ea,
+ src_url_equal: sl,
+ toggle_class: Qt,
+ transition_in: ol,
+ transition_out: al,
+ update_slot_base: ta
} = window.__gradio__svelte__internal;
-function td(l) {
- let e, t, n, i, o, a, r = (
+function ad(l) {
+ let e, t, n, i, s, a, r = (
/*icon*/
- l[7] && yo(l)
+ l[7] && Bs(l)
);
- const s = (
+ const o = (
/*#slots*/
l[12].default
- ), f = Ws(
- s,
+ ), f = Qo(
+ o,
l,
/*$$scope*/
l[11],
@@ -5166,54 +5167,54 @@ function td(l) {
);
return {
c() {
- e = bl("button"), r && r.c(), t = Zs(), f && f.c(), V(e, "class", n = /*size*/
+ e = Cl("button"), r && r.c(), t = ea(), f && f.c(), Z(e, "class", n = /*size*/
l[4] + " " + /*variant*/
l[3] + " " + /*elem_classes*/
- l[1].join(" ") + " svelte-8huxfn"), V(
+ l[1].join(" ") + " svelte-8huxfn"), Z(
e,
"id",
/*elem_id*/
l[0]
), e.disabled = /*disabled*/
- l[8], Vt(e, "hidden", !/*visible*/
- l[2]), ce(
+ l[8], Qt(e, "hidden", !/*visible*/
+ l[2]), he(
e,
"flex-grow",
/*scale*/
l[9]
- ), ce(
+ ), he(
e,
"width",
/*scale*/
l[9] === 0 ? "fit-content" : null
- ), ce(e, "min-width", typeof /*min_width*/
+ ), he(e, "min-width", typeof /*min_width*/
l[10] == "number" ? `calc(min(${/*min_width*/
l[10]}px, 100%))` : null);
},
m(u, c) {
- yn(u, e, c), r && r.m(e, null), Ys(e, t), f && f.m(e, null), i = !0, o || (a = $_(
+ En(u, e, c), r && r.m(e, null), Jo(e, t), f && f.m(e, null), i = !0, s || (a = sd(
e,
"click",
/*click_handler*/
l[13]
- ), o = !0);
+ ), s = !0);
},
p(u, c) {
/*icon*/
- u[7] ? r ? r.p(u, c) : (r = yo(u), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!i || c & /*$$scope*/
- 2048) && Ks(
+ u[7] ? r ? r.p(u, c) : (r = Bs(u), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!i || c & /*$$scope*/
+ 2048) && ta(
f,
- s,
+ o,
u,
/*$$scope*/
u[11],
- i ? Ps(
- s,
+ i ? $o(
+ o,
/*$$scope*/
u[11],
c,
null
- ) : Vs(
+ ) : xo(
/*$$scope*/
u[11]
),
@@ -5222,8 +5223,8 @@ function td(l) {
26 && n !== (n = /*size*/
u[4] + " " + /*variant*/
u[3] + " " + /*elem_classes*/
- u[1].join(" ") + " svelte-8huxfn")) && V(e, "class", n), (!i || c & /*elem_id*/
- 1) && V(
+ u[1].join(" ") + " svelte-8huxfn")) && Z(e, "class", n), (!i || c & /*elem_id*/
+ 1) && Z(
e,
"id",
/*elem_id*/
@@ -5231,44 +5232,44 @@ function td(l) {
), (!i || c & /*disabled*/
256) && (e.disabled = /*disabled*/
u[8]), (!i || c & /*size, variant, elem_classes, visible*/
- 30) && Vt(e, "hidden", !/*visible*/
+ 30) && Qt(e, "hidden", !/*visible*/
u[2]), c & /*scale*/
- 512 && ce(
+ 512 && he(
e,
"flex-grow",
/*scale*/
u[9]
), c & /*scale*/
- 512 && ce(
+ 512 && he(
e,
"width",
/*scale*/
u[9] === 0 ? "fit-content" : null
), c & /*min_width*/
- 1024 && ce(e, "min-width", typeof /*min_width*/
+ 1024 && he(e, "min-width", typeof /*min_width*/
u[10] == "number" ? `calc(min(${/*min_width*/
u[10]}px, 100%))` : null);
},
i(u) {
- i || (nl(f, u), i = !0);
+ i || (ol(f, u), i = !0);
},
o(u) {
- ll(f, u), i = !1;
+ al(f, u), i = !1;
},
d(u) {
- u && vn(e), r && r.d(), f && f.d(u), o = !1, a();
+ u && qn(e), r && r.d(), f && f.d(u), s = !1, a();
}
};
}
-function nd(l) {
- let e, t, n, i, o = (
+function rd(l) {
+ let e, t, n, i, s = (
/*icon*/
- l[7] && Co(l)
+ l[7] && Ms(l)
);
const a = (
/*#slots*/
l[12].default
- ), r = Ws(
+ ), r = Qo(
a,
l,
/*$$scope*/
@@ -5277,243 +5278,243 @@ function nd(l) {
);
return {
c() {
- e = bl("a"), o && o.c(), t = Zs(), r && r.c(), V(
+ e = Cl("a"), s && s.c(), t = ea(), r && r.c(), Z(
e,
"href",
/*link*/
l[6]
- ), V(e, "rel", "noopener noreferrer"), V(
+ ), Z(e, "rel", "noopener noreferrer"), Z(
e,
"aria-disabled",
/*disabled*/
l[8]
- ), V(e, "class", n = /*size*/
+ ), Z(e, "class", n = /*size*/
l[4] + " " + /*variant*/
l[3] + " " + /*elem_classes*/
- l[1].join(" ") + " svelte-8huxfn"), V(
+ l[1].join(" ") + " svelte-8huxfn"), Z(
e,
"id",
/*elem_id*/
l[0]
- ), Vt(e, "hidden", !/*visible*/
- l[2]), Vt(
+ ), Qt(e, "hidden", !/*visible*/
+ l[2]), Qt(
e,
"disabled",
/*disabled*/
l[8]
- ), ce(
+ ), he(
e,
"flex-grow",
/*scale*/
l[9]
- ), ce(
+ ), he(
e,
"pointer-events",
/*disabled*/
l[8] ? "none" : null
- ), ce(
+ ), he(
e,
"width",
/*scale*/
l[9] === 0 ? "fit-content" : null
- ), ce(e, "min-width", typeof /*min_width*/
+ ), he(e, "min-width", typeof /*min_width*/
l[10] == "number" ? `calc(min(${/*min_width*/
l[10]}px, 100%))` : null);
},
- m(s, f) {
- yn(s, e, f), o && o.m(e, null), Ys(e, t), r && r.m(e, null), i = !0;
+ m(o, f) {
+ En(o, e, f), s && s.m(e, null), Jo(e, t), r && r.m(e, null), i = !0;
},
- p(s, f) {
+ p(o, f) {
/*icon*/
- s[7] ? o ? o.p(s, f) : (o = Co(s), o.c(), o.m(e, t)) : o && (o.d(1), o = null), r && r.p && (!i || f & /*$$scope*/
- 2048) && Ks(
+ o[7] ? s ? s.p(o, f) : (s = Ms(o), s.c(), s.m(e, t)) : s && (s.d(1), s = null), r && r.p && (!i || f & /*$$scope*/
+ 2048) && ta(
r,
a,
- s,
+ o,
/*$$scope*/
- s[11],
- i ? Ps(
+ o[11],
+ i ? $o(
a,
/*$$scope*/
- s[11],
+ o[11],
f,
null
- ) : Vs(
+ ) : xo(
/*$$scope*/
- s[11]
+ o[11]
),
null
), (!i || f & /*link*/
- 64) && V(
+ 64) && Z(
e,
"href",
/*link*/
- s[6]
+ o[6]
), (!i || f & /*disabled*/
- 256) && V(
+ 256) && Z(
e,
"aria-disabled",
/*disabled*/
- s[8]
+ o[8]
), (!i || f & /*size, variant, elem_classes*/
26 && n !== (n = /*size*/
- s[4] + " " + /*variant*/
- s[3] + " " + /*elem_classes*/
- s[1].join(" ") + " svelte-8huxfn")) && V(e, "class", n), (!i || f & /*elem_id*/
- 1) && V(
+ o[4] + " " + /*variant*/
+ o[3] + " " + /*elem_classes*/
+ o[1].join(" ") + " svelte-8huxfn")) && Z(e, "class", n), (!i || f & /*elem_id*/
+ 1) && Z(
e,
"id",
/*elem_id*/
- s[0]
+ o[0]
), (!i || f & /*size, variant, elem_classes, visible*/
- 30) && Vt(e, "hidden", !/*visible*/
- s[2]), (!i || f & /*size, variant, elem_classes, disabled*/
- 282) && Vt(
+ 30) && Qt(e, "hidden", !/*visible*/
+ o[2]), (!i || f & /*size, variant, elem_classes, disabled*/
+ 282) && Qt(
e,
"disabled",
/*disabled*/
- s[8]
+ o[8]
), f & /*scale*/
- 512 && ce(
+ 512 && he(
e,
"flex-grow",
/*scale*/
- s[9]
+ o[9]
), f & /*disabled*/
- 256 && ce(
+ 256 && he(
e,
"pointer-events",
/*disabled*/
- s[8] ? "none" : null
+ o[8] ? "none" : null
), f & /*scale*/
- 512 && ce(
+ 512 && he(
e,
"width",
/*scale*/
- s[9] === 0 ? "fit-content" : null
+ o[9] === 0 ? "fit-content" : null
), f & /*min_width*/
- 1024 && ce(e, "min-width", typeof /*min_width*/
- s[10] == "number" ? `calc(min(${/*min_width*/
- s[10]}px, 100%))` : null);
+ 1024 && he(e, "min-width", typeof /*min_width*/
+ o[10] == "number" ? `calc(min(${/*min_width*/
+ o[10]}px, 100%))` : null);
},
- i(s) {
- i || (nl(r, s), i = !0);
+ i(o) {
+ i || (ol(r, o), i = !0);
},
- o(s) {
- ll(r, s), i = !1;
+ o(o) {
+ al(r, o), i = !1;
},
- d(s) {
- s && vn(e), o && o.d(), r && r.d(s);
+ d(o) {
+ o && qn(e), s && s.d(), r && r.d(o);
}
};
}
-function yo(l) {
+function Bs(l) {
let e, t, n;
return {
c() {
- e = bl("img"), V(e, "class", "button-icon svelte-8huxfn"), tl(e.src, t = /*icon*/
- l[7].url) || V(e, "src", t), V(e, "alt", n = `${/*value*/
+ e = Cl("img"), Z(e, "class", "button-icon svelte-8huxfn"), sl(e.src, t = /*icon*/
+ l[7].url) || Z(e, "src", t), Z(e, "alt", n = `${/*value*/
l[5]} icon`);
},
- m(i, o) {
- yn(i, e, o);
+ m(i, s) {
+ En(i, e, s);
},
- p(i, o) {
- o & /*icon*/
- 128 && !tl(e.src, t = /*icon*/
- i[7].url) && V(e, "src", t), o & /*value*/
+ p(i, s) {
+ s & /*icon*/
+ 128 && !sl(e.src, t = /*icon*/
+ i[7].url) && Z(e, "src", t), s & /*value*/
32 && n !== (n = `${/*value*/
- i[5]} icon`) && V(e, "alt", n);
+ i[5]} icon`) && Z(e, "alt", n);
},
d(i) {
- i && vn(e);
+ i && qn(e);
}
};
}
-function Co(l) {
+function Ms(l) {
let e, t, n;
return {
c() {
- e = bl("img"), V(e, "class", "button-icon svelte-8huxfn"), tl(e.src, t = /*icon*/
- l[7].url) || V(e, "src", t), V(e, "alt", n = `${/*value*/
+ e = Cl("img"), Z(e, "class", "button-icon svelte-8huxfn"), sl(e.src, t = /*icon*/
+ l[7].url) || Z(e, "src", t), Z(e, "alt", n = `${/*value*/
l[5]} icon`);
},
- m(i, o) {
- yn(i, e, o);
+ m(i, s) {
+ En(i, e, s);
},
- p(i, o) {
- o & /*icon*/
- 128 && !tl(e.src, t = /*icon*/
- i[7].url) && V(e, "src", t), o & /*value*/
+ p(i, s) {
+ s & /*icon*/
+ 128 && !sl(e.src, t = /*icon*/
+ i[7].url) && Z(e, "src", t), s & /*value*/
32 && n !== (n = `${/*value*/
- i[5]} icon`) && V(e, "alt", n);
+ i[5]} icon`) && Z(e, "alt", n);
},
d(i) {
- i && vn(e);
+ i && qn(e);
}
};
}
-function ld(l) {
+function fd(l) {
let e, t, n, i;
- const o = [nd, td], a = [];
- function r(s, f) {
+ const s = [rd, ad], a = [];
+ function r(o, f) {
return (
/*link*/
- s[6] && /*link*/
- s[6].length > 0 ? 0 : 1
+ o[6] && /*link*/
+ o[6].length > 0 ? 0 : 1
);
}
- return e = r(l), t = a[e] = o[e](l), {
+ return e = r(l), t = a[e] = s[e](l), {
c() {
- t.c(), n = J_();
+ t.c(), n = nd();
},
- m(s, f) {
- a[e].m(s, f), yn(s, n, f), i = !0;
+ m(o, f) {
+ a[e].m(o, f), En(o, n, f), i = !0;
},
- p(s, [f]) {
+ p(o, [f]) {
let u = e;
- e = r(s), e === u ? a[e].p(s, f) : (Q_(), ll(a[u], 1, 1, () => {
+ e = r(o), e === u ? a[e].p(o, f) : (ld(), al(a[u], 1, 1, () => {
a[u] = null;
- }), G_(), t = a[e], t ? t.p(s, f) : (t = a[e] = o[e](s), t.c()), nl(t, 1), t.m(n.parentNode, n));
+ }), td(), t = a[e], t ? t.p(o, f) : (t = a[e] = s[e](o), t.c()), ol(t, 1), t.m(n.parentNode, n));
},
- i(s) {
- i || (nl(t), i = !0);
+ i(o) {
+ i || (ol(t), i = !0);
},
- o(s) {
- ll(t), i = !1;
+ o(o) {
+ al(t), i = !1;
},
- d(s) {
- s && vn(n), a[e].d(s);
+ d(o) {
+ o && qn(n), a[e].d(o);
}
};
}
-function id(l, e, t) {
- let { $$slots: n = {}, $$scope: i } = e, { elem_id: o = "" } = e, { elem_classes: a = [] } = e, { visible: r = !0 } = e, { variant: s = "secondary" } = e, { size: f = "lg" } = e, { value: u = null } = e, { link: c = null } = e, { icon: _ = null } = e, { disabled: d = !1 } = e, { scale: h = null } = e, { min_width: b = void 0 } = e;
- function m(w) {
- K_.call(this, l, w);
+function ud(l, e, t) {
+ let { $$slots: n = {}, $$scope: i } = e, { elem_id: s = "" } = e, { elem_classes: a = [] } = e, { visible: r = !0 } = e, { variant: o = "secondary" } = e, { size: f = "lg" } = e, { value: u = null } = e, { link: c = null } = e, { icon: d = null } = e, { disabled: _ = !1 } = e, { scale: b = null } = e, { min_width: h = void 0 } = e;
+ function w(g) {
+ ed.call(this, l, g);
}
- return l.$$set = (w) => {
- "elem_id" in w && t(0, o = w.elem_id), "elem_classes" in w && t(1, a = w.elem_classes), "visible" in w && t(2, r = w.visible), "variant" in w && t(3, s = w.variant), "size" in w && t(4, f = w.size), "value" in w && t(5, u = w.value), "link" in w && t(6, c = w.link), "icon" in w && t(7, _ = w.icon), "disabled" in w && t(8, d = w.disabled), "scale" in w && t(9, h = w.scale), "min_width" in w && t(10, b = w.min_width), "$$scope" in w && t(11, i = w.$$scope);
+ return l.$$set = (g) => {
+ "elem_id" in g && t(0, s = g.elem_id), "elem_classes" in g && t(1, a = g.elem_classes), "visible" in g && t(2, r = g.visible), "variant" in g && t(3, o = g.variant), "size" in g && t(4, f = g.size), "value" in g && t(5, u = g.value), "link" in g && t(6, c = g.link), "icon" in g && t(7, d = g.icon), "disabled" in g && t(8, _ = g.disabled), "scale" in g && t(9, b = g.scale), "min_width" in g && t(10, h = g.min_width), "$$scope" in g && t(11, i = g.$$scope);
}, [
- o,
+ s,
a,
r,
- s,
+ o,
f,
u,
c,
- _,
d,
- h,
+ _,
b,
+ h,
i,
n,
- m
+ w
];
}
-class So extends Z_ {
+class hi extends $_ {
constructor(e) {
- super(), x_(this, e, id, ld, ed, {
+ super(), id(this, e, ud, fd, od, {
elem_id: 0,
elem_classes: 1,
visible: 2,
@@ -5529,140 +5530,140 @@ class So extends Z_ {
}
}
const {
- SvelteComponent: od,
- add_render_callback: Gs,
- append: Ln,
- attr: ke,
- binding_callbacks: zo,
- check_outros: sd,
- create_bidirectional_transition: qo,
- destroy_each: ad,
- detach: cn,
- element: il,
- empty: rd,
- ensure_array_like: Eo,
- group_outros: fd,
- init: ud,
- insert: _n,
- listen: oi,
- prevent_default: cd,
- run_all: _d,
- safe_not_equal: dd,
- set_data: hd,
- set_style: Rt,
- space: si,
- text: md,
- toggle_class: Ne,
- transition_in: Ol,
- transition_out: Mo
-} = window.__gradio__svelte__internal, { createEventDispatcher: bd } = window.__gradio__svelte__internal;
-function Bo(l, e, t) {
+ SvelteComponent: cd,
+ add_render_callback: na,
+ append: Xn,
+ attr: ye,
+ binding_callbacks: Ls,
+ check_outros: _d,
+ create_bidirectional_transition: Ds,
+ destroy_each: dd,
+ detach: pn,
+ element: rl,
+ empty: hd,
+ ensure_array_like: Ts,
+ group_outros: md,
+ init: bd,
+ insert: kn,
+ listen: mi,
+ prevent_default: gd,
+ run_all: wd,
+ safe_not_equal: pd,
+ set_data: kd,
+ set_style: Xt,
+ space: bi,
+ text: vd,
+ toggle_class: Ye,
+ transition_in: Kl,
+ transition_out: Rs
+} = window.__gradio__svelte__internal, { createEventDispatcher: yd } = window.__gradio__svelte__internal;
+function js(l, e, t) {
const n = l.slice();
return n[26] = e[t], n;
}
-function Ao(l) {
- let e, t, n, i, o, a = Eo(
+function Is(l) {
+ let e, t, n, i, s, a = Ts(
/*filtered_indices*/
l[1]
), r = [];
- for (let s = 0; s < a.length; s += 1)
- r[s] = Lo(Bo(l, a, s));
+ for (let o = 0; o < a.length; o += 1)
+ r[o] = Fs(js(l, a, o));
return {
c() {
- e = il("ul");
- for (let s = 0; s < r.length; s += 1)
- r[s].c();
- ke(e, "class", "options svelte-yuohum"), ke(e, "role", "listbox"), Rt(
+ e = rl("ul");
+ for (let o = 0; o < r.length; o += 1)
+ r[o].c();
+ ye(e, "class", "options svelte-yuohum"), ye(e, "role", "listbox"), Xt(
e,
"bottom",
/*bottom*/
l[9]
- ), Rt(e, "max-height", `calc(${/*max_height*/
- l[10]}px - var(--window-padding))`), Rt(
+ ), Xt(e, "max-height", `calc(${/*max_height*/
+ l[10]}px - var(--window-padding))`), Xt(
e,
"width",
/*input_width*/
l[8] + "px"
);
},
- m(s, f) {
- _n(s, e, f);
+ m(o, f) {
+ kn(o, e, f);
for (let u = 0; u < r.length; u += 1)
r[u] && r[u].m(e, null);
- l[22](e), n = !0, i || (o = oi(e, "mousedown", cd(
+ l[22](e), n = !0, i || (s = mi(e, "mousedown", gd(
/*mousedown_handler*/
l[21]
)), i = !0);
},
- p(s, f) {
+ p(o, f) {
if (f & /*filtered_indices, choices, selected_indices, active_index*/
51) {
- a = Eo(
+ a = Ts(
/*filtered_indices*/
- s[1]
+ o[1]
);
let u;
for (u = 0; u < a.length; u += 1) {
- const c = Bo(s, a, u);
- r[u] ? r[u].p(c, f) : (r[u] = Lo(c), r[u].c(), r[u].m(e, null));
+ const c = js(o, a, u);
+ r[u] ? r[u].p(c, f) : (r[u] = Fs(c), r[u].c(), r[u].m(e, null));
}
for (; u < r.length; u += 1)
r[u].d(1);
r.length = a.length;
}
f & /*bottom*/
- 512 && Rt(
+ 512 && Xt(
e,
"bottom",
/*bottom*/
- s[9]
+ o[9]
), f & /*max_height*/
- 1024 && Rt(e, "max-height", `calc(${/*max_height*/
- s[10]}px - var(--window-padding))`), f & /*input_width*/
- 256 && Rt(
+ 1024 && Xt(e, "max-height", `calc(${/*max_height*/
+ o[10]}px - var(--window-padding))`), f & /*input_width*/
+ 256 && Xt(
e,
"width",
/*input_width*/
- s[8] + "px"
+ o[8] + "px"
);
},
- i(s) {
- n || (s && Gs(() => {
- n && (t || (t = qo(e, Xi, { duration: 200, y: 5 }, !0)), t.run(1));
+ i(o) {
+ n || (o && na(() => {
+ n && (t || (t = Ds(e, Ji, { duration: 200, y: 5 }, !0)), t.run(1));
}), n = !0);
},
- o(s) {
- s && (t || (t = qo(e, Xi, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1;
+ o(o) {
+ o && (t || (t = Ds(e, Ji, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1;
},
- d(s) {
- s && cn(e), ad(r, s), l[22](null), s && t && t.end(), i = !1, o();
+ d(o) {
+ o && pn(e), dd(r, o), l[22](null), o && t && t.end(), i = !1, s();
}
};
}
-function Lo(l) {
+function Fs(l) {
let e, t, n, i = (
/*choices*/
l[0][
/*index*/
l[26]
][0] + ""
- ), o, a, r, s, f;
+ ), s, a, r, o, f;
return {
c() {
- e = il("li"), t = il("span"), t.textContent = "✓", n = si(), o = md(i), a = si(), ke(t, "class", "inner-item svelte-yuohum"), Ne(t, "hide", !/*selected_indices*/
+ e = rl("li"), t = rl("span"), t.textContent = "✓", n = bi(), s = vd(i), a = bi(), ye(t, "class", "inner-item svelte-yuohum"), Ye(t, "hide", !/*selected_indices*/
l[4].includes(
/*index*/
l[26]
- )), ke(e, "class", "item svelte-yuohum"), ke(e, "data-index", r = /*index*/
- l[26]), ke(e, "aria-label", s = /*choices*/
+ )), ye(e, "class", "item svelte-yuohum"), ye(e, "data-index", r = /*index*/
+ l[26]), ye(e, "aria-label", o = /*choices*/
l[0][
/*index*/
l[26]
- ][0]), ke(e, "data-testid", "dropdown-option"), ke(e, "role", "option"), ke(e, "aria-selected", f = /*selected_indices*/
+ ][0]), ye(e, "data-testid", "dropdown-option"), ye(e, "role", "option"), ye(e, "aria-selected", f = /*selected_indices*/
l[4].includes(
/*index*/
l[26]
- )), Ne(
+ )), Ye(
e,
"selected",
/*selected_indices*/
@@ -5670,19 +5671,19 @@ function Lo(l) {
/*index*/
l[26]
)
- ), Ne(
+ ), Ye(
e,
"active",
/*index*/
l[26] === /*active_index*/
l[5]
- ), Ne(
+ ), Ye(
e,
"bg-gray-100",
/*index*/
l[26] === /*active_index*/
l[5]
- ), Ne(
+ ), Ye(
e,
"dark:bg-gray-600",
/*index*/
@@ -5691,11 +5692,11 @@ function Lo(l) {
);
},
m(u, c) {
- _n(u, e, c), Ln(e, t), Ln(e, n), Ln(e, o), Ln(e, a);
+ kn(u, e, c), Xn(e, t), Xn(e, n), Xn(e, s), Xn(e, a);
},
p(u, c) {
c & /*selected_indices, filtered_indices*/
- 18 && Ne(t, "hide", !/*selected_indices*/
+ 18 && Ye(t, "hide", !/*selected_indices*/
u[4].includes(
/*index*/
u[26]
@@ -5704,20 +5705,20 @@ function Lo(l) {
u[0][
/*index*/
u[26]
- ][0] + "") && hd(o, i), c & /*filtered_indices*/
+ ][0] + "") && kd(s, i), c & /*filtered_indices*/
2 && r !== (r = /*index*/
- u[26]) && ke(e, "data-index", r), c & /*choices, filtered_indices*/
- 3 && s !== (s = /*choices*/
+ u[26]) && ye(e, "data-index", r), c & /*choices, filtered_indices*/
+ 3 && o !== (o = /*choices*/
u[0][
/*index*/
u[26]
- ][0]) && ke(e, "aria-label", s), c & /*selected_indices, filtered_indices*/
+ ][0]) && ye(e, "aria-label", o), c & /*selected_indices, filtered_indices*/
18 && f !== (f = /*selected_indices*/
u[4].includes(
/*index*/
u[26]
- )) && ke(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/
- 18 && Ne(
+ )) && ye(e, "aria-selected", f), c & /*selected_indices, filtered_indices*/
+ 18 && Ye(
e,
"selected",
/*selected_indices*/
@@ -5726,21 +5727,21 @@ function Lo(l) {
u[26]
)
), c & /*filtered_indices, active_index*/
- 34 && Ne(
+ 34 && Ye(
e,
"active",
/*index*/
u[26] === /*active_index*/
u[5]
), c & /*filtered_indices, active_index*/
- 34 && Ne(
+ 34 && Ye(
e,
"bg-gray-100",
/*index*/
u[26] === /*active_index*/
u[5]
), c & /*filtered_indices, active_index*/
- 34 && Ne(
+ 34 && Ye(
e,
"dark:bg-gray-600",
/*index*/
@@ -5749,34 +5750,34 @@ function Lo(l) {
);
},
d(u) {
- u && cn(e);
+ u && pn(e);
}
};
}
-function gd(l) {
- let e, t, n, i, o;
- Gs(
+function Cd(l) {
+ let e, t, n, i, s;
+ na(
/*onwindowresize*/
l[19]
);
let a = (
/*show_options*/
l[2] && !/*disabled*/
- l[3] && Ao(l)
+ l[3] && Is(l)
);
return {
c() {
- e = il("div"), t = si(), a && a.c(), n = rd(), ke(e, "class", "reference");
+ e = rl("div"), t = bi(), a && a.c(), n = hd(), ye(e, "class", "reference");
},
- m(r, s) {
- _n(r, e, s), l[20](e), _n(r, t, s), a && a.m(r, s), _n(r, n, s), i || (o = [
- oi(
+ m(r, o) {
+ kn(r, e, o), l[20](e), kn(r, t, o), a && a.m(r, o), kn(r, n, o), i || (s = [
+ mi(
window,
"scroll",
/*scroll_listener*/
l[12]
),
- oi(
+ mi(
window,
"resize",
/*onwindowresize*/
@@ -5784,105 +5785,105 @@ function gd(l) {
)
], i = !0);
},
- p(r, [s]) {
+ p(r, [o]) {
/*show_options*/
r[2] && !/*disabled*/
- r[3] ? a ? (a.p(r, s), s & /*show_options, disabled*/
- 12 && Ol(a, 1)) : (a = Ao(r), a.c(), Ol(a, 1), a.m(n.parentNode, n)) : a && (fd(), Mo(a, 1, 1, () => {
+ r[3] ? a ? (a.p(r, o), o & /*show_options, disabled*/
+ 12 && Kl(a, 1)) : (a = Is(r), a.c(), Kl(a, 1), a.m(n.parentNode, n)) : a && (md(), Rs(a, 1, 1, () => {
a = null;
- }), sd());
+ }), _d());
},
i(r) {
- Ol(a);
+ Kl(a);
},
o(r) {
- Mo(a);
+ Rs(a);
},
d(r) {
- r && (cn(e), cn(t), cn(n)), l[20](null), a && a.d(r), i = !1, _d(o);
+ r && (pn(e), pn(t), pn(n)), l[20](null), a && a.d(r), i = !1, wd(s);
}
};
}
-function wd(l, e, t) {
+function Sd(l, e, t) {
var n, i;
- let { choices: o } = e, { filtered_indices: a } = e, { show_options: r = !1 } = e, { disabled: s = !1 } = e, { selected_indices: f = [] } = e, { active_index: u = null } = e, c, _, d, h, b, m, w, k, g;
- function S() {
- const { top: B, bottom: W } = b.getBoundingClientRect();
- t(16, c = B), t(17, _ = g - W);
+ let { choices: s } = e, { filtered_indices: a } = e, { show_options: r = !1 } = e, { disabled: o = !1 } = e, { selected_indices: f = [] } = e, { active_index: u = null } = e, c, d, _, b, h, w, g, p, m;
+ function C() {
+ const { top: L, bottom: V } = h.getBoundingClientRect();
+ t(16, c = L), t(17, d = m - V);
}
- let M = null;
+ let z = null;
function y() {
- r && (M !== null && clearTimeout(M), M = setTimeout(
+ r && (z !== null && clearTimeout(z), z = setTimeout(
() => {
- S(), M = null;
+ C(), z = null;
},
10
));
}
- const z = bd();
+ const q = yd();
function v() {
- t(11, g = window.innerHeight);
+ t(11, m = window.innerHeight);
}
- function q(B) {
- zo[B ? "unshift" : "push"](() => {
- b = B, t(6, b);
+ function E(L) {
+ Ls[L ? "unshift" : "push"](() => {
+ h = L, t(6, h);
});
}
- const R = (B) => z("change", B);
- function I(B) {
- zo[B ? "unshift" : "push"](() => {
- m = B, t(7, m);
+ const F = (L) => q("change", L);
+ function X(L) {
+ Ls[L ? "unshift" : "push"](() => {
+ w = L, t(7, w);
});
}
- return l.$$set = (B) => {
- "choices" in B && t(0, o = B.choices), "filtered_indices" in B && t(1, a = B.filtered_indices), "show_options" in B && t(2, r = B.show_options), "disabled" in B && t(3, s = B.disabled), "selected_indices" in B && t(4, f = B.selected_indices), "active_index" in B && t(5, u = B.active_index);
+ return l.$$set = (L) => {
+ "choices" in L && t(0, s = L.choices), "filtered_indices" in L && t(1, a = L.filtered_indices), "show_options" in L && t(2, r = L.show_options), "disabled" in L && t(3, o = L.disabled), "selected_indices" in L && t(4, f = L.selected_indices), "active_index" in L && t(5, u = L.active_index);
}, l.$$.update = () => {
if (l.$$.dirty & /*show_options, refElement, listElement, selected_indices, _a, _b, distance_from_bottom, distance_from_top, input_height*/
508116) {
- if (r && b) {
- if (m && f.length > 0) {
- let W = m.querySelectorAll("li");
- for (const H of Array.from(W))
- if (H.getAttribute("data-index") === f[0].toString()) {
- t(14, n = m == null ? void 0 : m.scrollTo) === null || n === void 0 || n.call(m, 0, H.offsetTop);
+ if (r && h) {
+ if (w && f.length > 0) {
+ let V = w.querySelectorAll("li");
+ for (const I of Array.from(V))
+ if (I.getAttribute("data-index") === f[0].toString()) {
+ t(14, n = w == null ? void 0 : w.scrollTo) === null || n === void 0 || n.call(w, 0, I.offsetTop);
break;
}
}
- S();
- const B = t(15, i = b.parentElement) === null || i === void 0 ? void 0 : i.getBoundingClientRect();
- t(18, d = (B == null ? void 0 : B.height) || 0), t(8, h = (B == null ? void 0 : B.width) || 0);
+ C();
+ const L = t(15, i = h.parentElement) === null || i === void 0 ? void 0 : i.getBoundingClientRect();
+ t(18, _ = (L == null ? void 0 : L.height) || 0), t(8, b = (L == null ? void 0 : L.width) || 0);
}
- _ > c ? (t(10, k = _), t(9, w = null)) : (t(9, w = `${_ + d}px`), t(10, k = c - d));
+ d > c ? (t(10, p = d), t(9, g = null)) : (t(9, g = `${d + _}px`), t(10, p = c - _));
}
}, [
- o,
+ s,
a,
r,
- s,
+ o,
f,
u,
- b,
- m,
h,
w,
- k,
+ b,
g,
+ p,
+ m,
y,
- z,
+ q,
n,
i,
c,
- _,
d,
+ _,
v,
- q,
- R,
- I
+ E,
+ F,
+ X
];
}
-class pd extends od {
+class zd extends cd {
constructor(e) {
- super(), ud(this, e, wd, gd, dd, {
+ super(), bd(this, e, Sd, Cd, pd, {
choices: 0,
filtered_indices: 1,
show_options: 2,
@@ -5892,16 +5893,16 @@ class pd extends od {
});
}
}
-function kd(l, e) {
+function qd(l, e) {
return (l % e + e) % e;
}
-function Do(l, e) {
+function Hs(l, e) {
return l.reduce((t, n, i) => ((!e || n[0].toLowerCase().includes(e.toLowerCase())) && t.push(i), t), []);
}
-function vd(l, e, t) {
+function Ed(l, e, t) {
l("change", e), t || l("input");
}
-function yd(l, e, t) {
+function Ad(l, e, t) {
if (l.key === "Escape")
return [!1, e];
if ((l.key === "ArrowDown" || l.key === "ArrowUp") && t.length >= 0)
@@ -5909,83 +5910,83 @@ function yd(l, e, t) {
e = l.key === "ArrowDown" ? t[0] : t[t.length - 1];
else {
const n = t.indexOf(e), i = l.key === "ArrowUp" ? -1 : 1;
- e = t[kd(n + i, t.length)];
+ e = t[qd(n + i, t.length)];
}
return [!0, e];
}
const {
- SvelteComponent: Cd,
- append: ht,
- attr: pe,
- binding_callbacks: Sd,
- check_outros: zd,
- create_component: ai,
- destroy_component: ri,
- detach: bi,
- element: Ut,
- group_outros: qd,
- init: Ed,
- insert: gi,
- listen: en,
- mount_component: fi,
- run_all: Md,
- safe_not_equal: Bd,
- set_data: Ad,
- set_input_value: To,
- space: Xl,
- text: Ld,
- toggle_class: Ft,
- transition_in: Nt,
- transition_out: rn
-} = window.__gradio__svelte__internal, { onMount: Dd } = window.__gradio__svelte__internal, { createEventDispatcher: Td, afterUpdate: jd } = window.__gradio__svelte__internal;
-function Id(l) {
+ SvelteComponent: Bd,
+ append: pt,
+ attr: ve,
+ binding_callbacks: Md,
+ check_outros: Ld,
+ create_component: gi,
+ destroy_component: wi,
+ detach: zi,
+ element: Vt,
+ group_outros: Dd,
+ init: Td,
+ insert: qi,
+ listen: on,
+ mount_component: pi,
+ run_all: Rd,
+ safe_not_equal: jd,
+ set_data: Id,
+ set_input_value: Xs,
+ space: Gl,
+ text: Fd,
+ toggle_class: Yt,
+ transition_in: Ot,
+ transition_out: dn
+} = window.__gradio__svelte__internal, { onMount: Hd } = window.__gradio__svelte__internal, { createEventDispatcher: Xd, afterUpdate: Yd } = window.__gradio__svelte__internal;
+function Ud(l) {
let e;
return {
c() {
- e = Ld(
+ e = Fd(
/*label*/
l[0]
);
},
m(t, n) {
- gi(t, e, n);
+ qi(t, e, n);
},
p(t, n) {
n[0] & /*label*/
- 1 && Ad(
+ 1 && Id(
e,
/*label*/
t[0]
);
},
d(t) {
- t && bi(e);
+ t && zi(e);
}
};
}
-function jo(l) {
+function Ys(l) {
let e, t, n;
- return t = new Cf({}), {
+ return t = new Bf({}), {
c() {
- e = Ut("div"), ai(t.$$.fragment), pe(e, "class", "icon-wrap svelte-1m1zvyj");
+ e = Vt("div"), gi(t.$$.fragment), ve(e, "class", "icon-wrap svelte-1m1zvyj");
},
- m(i, o) {
- gi(i, e, o), fi(t, e, null), n = !0;
+ m(i, s) {
+ qi(i, e, s), pi(t, e, null), n = !0;
},
i(i) {
- n || (Nt(t.$$.fragment, i), n = !0);
+ n || (Ot(t.$$.fragment, i), n = !0);
},
o(i) {
- rn(t.$$.fragment, i), n = !1;
+ dn(t.$$.fragment, i), n = !1;
},
d(i) {
- i && bi(e), ri(t);
+ i && zi(e), wi(t);
}
};
}
-function Rd(l) {
- let e, t, n, i, o, a, r, s, f, u, c, _, d, h;
- t = new es({
+function Nd(l) {
+ let e, t, n, i, s, a, r, o, f, u, c, d, _, b;
+ t = new so({
props: {
show_label: (
/*show_label*/
@@ -5995,13 +5996,13 @@ function Rd(l) {
/*info*/
l[1]
),
- $$slots: { default: [Id] },
+ $$slots: { default: [Ud] },
$$scope: { ctx: l }
}
});
- let b = !/*disabled*/
- l[3] && jo();
- return c = new pd({
+ let h = !/*disabled*/
+ l[3] && Ys();
+ return c = new zd({
props: {
show_options: (
/*show_options*/
@@ -6037,250 +6038,250 @@ function Rd(l) {
l[16]
), {
c() {
- e = Ut("div"), ai(t.$$.fragment), n = Xl(), i = Ut("div"), o = Ut("div"), a = Ut("div"), r = Ut("input"), f = Xl(), b && b.c(), u = Xl(), ai(c.$$.fragment), pe(r, "role", "listbox"), pe(r, "aria-controls", "dropdown-options"), pe(
+ e = Vt("div"), gi(t.$$.fragment), n = Gl(), i = Vt("div"), s = Vt("div"), a = Vt("div"), r = Vt("input"), f = Gl(), h && h.c(), u = Gl(), gi(c.$$.fragment), ve(r, "role", "listbox"), ve(r, "aria-controls", "dropdown-options"), ve(
r,
"aria-expanded",
/*show_options*/
l[12]
- ), pe(
+ ), ve(
r,
"aria-label",
/*label*/
l[0]
- ), pe(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/
- l[3], pe(r, "autocomplete", "off"), r.readOnly = s = !/*filterable*/
- l[7], Ft(r, "subdued", !/*choices_names*/
+ ), ve(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/
+ l[3], ve(r, "autocomplete", "off"), r.readOnly = o = !/*filterable*/
+ l[7], Yt(r, "subdued", !/*choices_names*/
l[13].includes(
/*input_text*/
l[9]
) && !/*allow_custom_value*/
- l[6]), pe(a, "class", "secondary-wrap svelte-1m1zvyj"), pe(o, "class", "wrap-inner svelte-1m1zvyj"), Ft(
- o,
+ l[6]), ve(a, "class", "secondary-wrap svelte-1m1zvyj"), ve(s, "class", "wrap-inner svelte-1m1zvyj"), Yt(
+ s,
"show_options",
/*show_options*/
l[12]
- ), pe(i, "class", "wrap svelte-1m1zvyj"), pe(e, "class", "svelte-1m1zvyj"), Ft(
+ ), ve(i, "class", "wrap svelte-1m1zvyj"), ve(e, "class", "svelte-1m1zvyj"), Yt(
e,
"container",
/*container*/
l[5]
);
},
- m(m, w) {
- gi(m, e, w), fi(t, e, null), ht(e, n), ht(e, i), ht(i, o), ht(o, a), ht(a, r), To(
+ m(w, g) {
+ qi(w, e, g), pi(t, e, null), pt(e, n), pt(e, i), pt(i, s), pt(s, a), pt(a, r), Xs(
r,
/*input_text*/
l[9]
- ), l[29](r), ht(a, f), b && b.m(a, null), ht(i, u), fi(c, i, null), _ = !0, d || (h = [
- en(
+ ), l[29](r), pt(a, f), h && h.m(a, null), pt(i, u), pi(c, i, null), d = !0, _ || (b = [
+ on(
r,
"input",
/*input_input_handler*/
l[28]
),
- en(
+ on(
r,
"keydown",
/*handle_key_down*/
l[19]
),
- en(
+ on(
r,
"keyup",
/*keyup_handler*/
l[30]
),
- en(
+ on(
r,
"blur",
/*handle_blur*/
l[18]
),
- en(
+ on(
r,
"focus",
/*handle_focus*/
l[17]
)
- ], d = !0);
- },
- p(m, w) {
- const k = {};
- w[0] & /*show_label*/
- 16 && (k.show_label = /*show_label*/
- m[4]), w[0] & /*info*/
- 2 && (k.info = /*info*/
- m[1]), w[0] & /*label*/
- 1 | w[1] & /*$$scope*/
- 4 && (k.$$scope = { dirty: w, ctx: m }), t.$set(k), (!_ || w[0] & /*show_options*/
- 4096) && pe(
+ ], _ = !0);
+ },
+ p(w, g) {
+ const p = {};
+ g[0] & /*show_label*/
+ 16 && (p.show_label = /*show_label*/
+ w[4]), g[0] & /*info*/
+ 2 && (p.info = /*info*/
+ w[1]), g[0] & /*label*/
+ 1 | g[1] & /*$$scope*/
+ 4 && (p.$$scope = { dirty: g, ctx: w }), t.$set(p), (!d || g[0] & /*show_options*/
+ 4096) && ve(
r,
"aria-expanded",
/*show_options*/
- m[12]
- ), (!_ || w[0] & /*label*/
- 1) && pe(
+ w[12]
+ ), (!d || g[0] & /*label*/
+ 1) && ve(
r,
"aria-label",
/*label*/
- m[0]
- ), (!_ || w[0] & /*disabled*/
+ w[0]
+ ), (!d || g[0] & /*disabled*/
8) && (r.disabled = /*disabled*/
- m[3]), (!_ || w[0] & /*filterable*/
- 128 && s !== (s = !/*filterable*/
- m[7])) && (r.readOnly = s), w[0] & /*input_text*/
+ w[3]), (!d || g[0] & /*filterable*/
+ 128 && o !== (o = !/*filterable*/
+ w[7])) && (r.readOnly = o), g[0] & /*input_text*/
512 && r.value !== /*input_text*/
- m[9] && To(
+ w[9] && Xs(
r,
/*input_text*/
- m[9]
- ), (!_ || w[0] & /*choices_names, input_text, allow_custom_value*/
- 8768) && Ft(r, "subdued", !/*choices_names*/
- m[13].includes(
+ w[9]
+ ), (!d || g[0] & /*choices_names, input_text, allow_custom_value*/
+ 8768) && Yt(r, "subdued", !/*choices_names*/
+ w[13].includes(
/*input_text*/
- m[9]
+ w[9]
) && !/*allow_custom_value*/
- m[6]), /*disabled*/
- m[3] ? b && (qd(), rn(b, 1, 1, () => {
- b = null;
- }), zd()) : b ? w[0] & /*disabled*/
- 8 && Nt(b, 1) : (b = jo(), b.c(), Nt(b, 1), b.m(a, null)), (!_ || w[0] & /*show_options*/
- 4096) && Ft(
- o,
+ w[6]), /*disabled*/
+ w[3] ? h && (Dd(), dn(h, 1, 1, () => {
+ h = null;
+ }), Ld()) : h ? g[0] & /*disabled*/
+ 8 && Ot(h, 1) : (h = Ys(), h.c(), Ot(h, 1), h.m(a, null)), (!d || g[0] & /*show_options*/
+ 4096) && Yt(
+ s,
"show_options",
/*show_options*/
- m[12]
+ w[12]
);
- const g = {};
- w[0] & /*show_options*/
- 4096 && (g.show_options = /*show_options*/
- m[12]), w[0] & /*choices*/
- 4 && (g.choices = /*choices*/
- m[2]), w[0] & /*filtered_indices*/
- 1024 && (g.filtered_indices = /*filtered_indices*/
- m[10]), w[0] & /*disabled*/
- 8 && (g.disabled = /*disabled*/
- m[3]), w[0] & /*selected_index*/
- 2048 && (g.selected_indices = /*selected_index*/
- m[11] === null ? [] : [
+ const m = {};
+ g[0] & /*show_options*/
+ 4096 && (m.show_options = /*show_options*/
+ w[12]), g[0] & /*choices*/
+ 4 && (m.choices = /*choices*/
+ w[2]), g[0] & /*filtered_indices*/
+ 1024 && (m.filtered_indices = /*filtered_indices*/
+ w[10]), g[0] & /*disabled*/
+ 8 && (m.disabled = /*disabled*/
+ w[3]), g[0] & /*selected_index*/
+ 2048 && (m.selected_indices = /*selected_index*/
+ w[11] === null ? [] : [
/*selected_index*/
- m[11]
- ]), w[0] & /*active_index*/
- 16384 && (g.active_index = /*active_index*/
- m[14]), c.$set(g), (!_ || w[0] & /*container*/
- 32) && Ft(
+ w[11]
+ ]), g[0] & /*active_index*/
+ 16384 && (m.active_index = /*active_index*/
+ w[14]), c.$set(m), (!d || g[0] & /*container*/
+ 32) && Yt(
e,
"container",
/*container*/
- m[5]
+ w[5]
);
},
- i(m) {
- _ || (Nt(t.$$.fragment, m), Nt(b), Nt(c.$$.fragment, m), _ = !0);
+ i(w) {
+ d || (Ot(t.$$.fragment, w), Ot(h), Ot(c.$$.fragment, w), d = !0);
},
- o(m) {
- rn(t.$$.fragment, m), rn(b), rn(c.$$.fragment, m), _ = !1;
+ o(w) {
+ dn(t.$$.fragment, w), dn(h), dn(c.$$.fragment, w), d = !1;
},
- d(m) {
- m && bi(e), ri(t), l[29](null), b && b.d(), ri(c), d = !1, Md(h);
+ d(w) {
+ w && zi(e), wi(t), l[29](null), h && h.d(), wi(c), _ = !1, Rd(b);
}
};
}
-function Fd(l, e, t) {
- let { label: n } = e, { info: i = void 0 } = e, { value: o = [] } = e, a = [], { value_is_output: r = !1 } = e, { choices: s } = e, f, { disabled: u = !1 } = e, { show_label: c } = e, { container: _ = !0 } = e, { allow_custom_value: d = !1 } = e, { filterable: h = !0 } = e, b, m = !1, w, k, g = "", S = "", M = !1, y = [], z = null, v = null, q;
- const R = Td();
- o ? (q = s.map((L) => L[1]).indexOf(o), v = q, v === -1 ? (a = o, v = null) : ([g, a] = s[v], S = g), B()) : s.length > 0 && (q = 0, v = 0, [g, o] = s[v], a = o, S = g);
- function I() {
- t(13, w = s.map((L) => L[0])), t(24, k = s.map((L) => L[1]));
+function Vd(l, e, t) {
+ let { label: n } = e, { info: i = void 0 } = e, { value: s = [] } = e, a = [], { value_is_output: r = !1 } = e, { choices: o } = e, f, { disabled: u = !1 } = e, { show_label: c } = e, { container: d = !0 } = e, { allow_custom_value: _ = !1 } = e, { filterable: b = !0 } = e, h, w = !1, g, p, m = "", C = "", z = !1, y = [], q = null, v = null, E;
+ const F = Xd();
+ s ? (E = o.map((D) => D[1]).indexOf(s), v = E, v === -1 ? (a = s, v = null) : ([m, a] = o[v], C = m), L()) : o.length > 0 && (E = 0, v = 0, [m, s] = o[v], a = s, C = m);
+ function X() {
+ t(13, g = o.map((D) => D[0])), t(24, p = o.map((D) => D[1]));
}
- function B() {
- I(), o === void 0 || Array.isArray(o) && o.length === 0 ? (t(9, g = ""), t(11, v = null)) : k.includes(o) ? (t(9, g = w[k.indexOf(o)]), t(11, v = k.indexOf(o))) : d ? (t(9, g = o), t(11, v = null)) : (t(9, g = ""), t(11, v = null)), t(27, q = v);
+ function L() {
+ X(), s === void 0 || Array.isArray(s) && s.length === 0 ? (t(9, m = ""), t(11, v = null)) : p.includes(s) ? (t(9, m = g[p.indexOf(s)]), t(11, v = p.indexOf(s))) : _ ? (t(9, m = s), t(11, v = null)) : (t(9, m = ""), t(11, v = null)), t(27, E = v);
}
- function W(L) {
- if (t(11, v = parseInt(L.detail.target.dataset.index)), isNaN(v)) {
+ function V(D) {
+ if (t(11, v = parseInt(D.detail.target.dataset.index)), isNaN(v)) {
t(11, v = null);
return;
}
- t(12, m = !1), t(14, z = null), b.blur();
+ t(12, w = !1), t(14, q = null), h.blur();
}
- function H(L) {
- t(10, y = s.map((de, Ae) => Ae)), t(12, m = !0), R("focus");
+ function I(D) {
+ t(10, y = o.map((fe, Se) => Se)), t(12, w = !0), F("focus");
}
- function le() {
- d ? t(20, o = g) : t(9, g = w[k.indexOf(o)]), t(12, m = !1), t(14, z = null), R("blur");
+ function Q() {
+ _ ? t(20, s = m) : t(9, m = g[p.indexOf(s)]), t(12, w = !1), t(14, q = null), F("blur");
}
- function X(L) {
- t(12, [m, z] = yd(L, z, y), m, (t(14, z), t(2, s), t(23, f), t(6, d), t(9, g), t(10, y), t(8, b), t(25, S), t(11, v), t(27, q), t(26, M), t(24, k))), L.key === "Enter" && (z !== null ? (t(11, v = z), t(12, m = !1), b.blur(), t(14, z = null)) : w.includes(g) ? (t(11, v = w.indexOf(g)), t(12, m = !1), t(14, z = null), b.blur()) : d && (t(20, o = g), t(11, v = null), t(12, m = !1), t(14, z = null), b.blur()), R("enter", o));
+ function W(D) {
+ t(12, [w, q] = Ad(D, q, y), w, (t(14, q), t(2, o), t(23, f), t(6, _), t(9, m), t(10, y), t(8, h), t(25, C), t(11, v), t(27, E), t(26, z), t(24, p))), D.key === "Enter" && (q !== null ? (t(11, v = q), t(12, w = !1), h.blur(), t(14, q = null)) : g.includes(m) ? (t(11, v = g.indexOf(m)), t(12, w = !1), t(14, q = null), h.blur()) : _ && (t(20, s = m), t(11, v = null), t(12, w = !1), t(14, q = null), h.blur()), F("enter", s));
}
- jd(() => {
- t(21, r = !1), t(26, M = !0);
- }), Dd(() => {
- b.focus();
+ Yd(() => {
+ t(21, r = !1), t(26, z = !0);
+ }), Hd(() => {
+ h.focus();
});
- function ee() {
- g = this.value, t(9, g), t(11, v), t(27, q), t(26, M), t(2, s), t(24, k);
+ function le() {
+ m = this.value, t(9, m), t(11, v), t(27, E), t(26, z), t(2, o), t(24, p);
}
- function ae(L) {
- Sd[L ? "unshift" : "push"](() => {
- b = L, t(8, b);
+ function ae(D) {
+ Md[D ? "unshift" : "push"](() => {
+ h = D, t(8, h);
});
}
- const ye = (L) => R("key_up", { key: L.key, input_value: g });
- return l.$$set = (L) => {
- "label" in L && t(0, n = L.label), "info" in L && t(1, i = L.info), "value" in L && t(20, o = L.value), "value_is_output" in L && t(21, r = L.value_is_output), "choices" in L && t(2, s = L.choices), "disabled" in L && t(3, u = L.disabled), "show_label" in L && t(4, c = L.show_label), "container" in L && t(5, _ = L.container), "allow_custom_value" in L && t(6, d = L.allow_custom_value), "filterable" in L && t(7, h = L.filterable);
+ const re = (D) => F("key_up", { key: D.key, input_value: m });
+ return l.$$set = (D) => {
+ "label" in D && t(0, n = D.label), "info" in D && t(1, i = D.info), "value" in D && t(20, s = D.value), "value_is_output" in D && t(21, r = D.value_is_output), "choices" in D && t(2, o = D.choices), "disabled" in D && t(3, u = D.disabled), "show_label" in D && t(4, c = D.show_label), "container" in D && t(5, d = D.container), "allow_custom_value" in D && t(6, _ = D.allow_custom_value), "filterable" in D && t(7, b = D.filterable);
}, l.$$.update = () => {
l.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/
- 218105860 && v !== q && v !== null && M && (t(9, [g, o] = s[v], g, (t(20, o), t(11, v), t(27, q), t(26, M), t(2, s), t(24, k))), t(27, q = v), R("select", {
+ 218105860 && v !== E && v !== null && z && (t(9, [m, s] = o[v], m, (t(20, s), t(11, v), t(27, E), t(26, z), t(2, o), t(24, p))), t(27, E = v), F("select", {
index: v,
- value: k[v],
+ value: p[v],
selected: !0
})), l.$$.dirty[0] & /*value, old_value, value_is_output*/
- 7340032 && o != a && (B(), vd(R, o, r), t(22, a = o)), l.$$.dirty[0] & /*choices*/
- 4 && I(), l.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/
- 8390468 && s !== f && (d || B(), t(23, f = s), t(10, y = Do(s, g)), !d && y.length > 0 && t(14, z = y[0]), b == document.activeElement && t(12, m = !0)), l.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/
- 33556036 && g !== S && (t(10, y = Do(s, g)), t(25, S = g), !d && y.length > 0 && t(14, z = y[0]));
+ 7340032 && s != a && (L(), Ed(F, s, r), t(22, a = s)), l.$$.dirty[0] & /*choices*/
+ 4 && X(), l.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/
+ 8390468 && o !== f && (_ || L(), t(23, f = o), t(10, y = Hs(o, m)), !_ && y.length > 0 && t(14, q = y[0]), h == document.activeElement && t(12, w = !0)), l.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/
+ 33556036 && m !== C && (t(10, y = Hs(o, m)), t(25, C = m), !_ && y.length > 0 && t(14, q = y[0]));
}, [
n,
i,
- s,
+ o,
u,
c,
- _,
d,
- h,
+ _,
b,
- g,
+ h,
+ m,
y,
v,
- m,
w,
- z,
- R,
+ g,
+ q,
+ F,
+ V,
+ I,
+ Q,
W,
- H,
- le,
- X,
- o,
+ s,
r,
a,
f,
- k,
- S,
- M,
- q,
- ee,
+ p,
+ C,
+ z,
+ E,
+ le,
ae,
- ye
+ re
];
}
-class Hd extends Cd {
+class Od extends Bd {
constructor(e) {
- super(), Ed(
+ super(), Td(
this,
e,
- Fd,
- Rd,
- Bd,
+ Vd,
+ Nd,
+ jd,
{
label: 0,
info: 1,
@@ -6299,54 +6300,105 @@ class Hd extends Cd {
}
}
const {
- SvelteComponent: Ud,
- append: Ze,
- attr: Dn,
- create_component: Tn,
- destroy_component: jn,
- detach: wi,
- element: mt,
- init: Nd,
- insert: pi,
- mount_component: In,
- safe_not_equal: Od,
- set_style: Rn,
- space: Yl,
- text: Js,
- transition_in: Fn,
- transition_out: Hn
-} = window.__gradio__svelte__internal, { createEventDispatcher: Xd } = window.__gradio__svelte__internal, { onMount: Yd, onDestroy: Wd } = window.__gradio__svelte__internal;
-function Vd(l) {
+ SvelteComponent: Wd,
+ append: Ue,
+ attr: Yn,
+ check_outros: Pd,
+ create_component: hn,
+ destroy_component: mn,
+ detach: An,
+ element: ot,
+ group_outros: Zd,
+ init: Kd,
+ insert: Bn,
+ mount_component: bn,
+ safe_not_equal: Gd,
+ set_style: gn,
+ space: Un,
+ text: Ei,
+ transition_in: at,
+ transition_out: kt
+} = window.__gradio__svelte__internal, { createEventDispatcher: Jd } = window.__gradio__svelte__internal, { onMount: Qd, onDestroy: xd } = window.__gradio__svelte__internal;
+function $d(l) {
+ let e;
+ return {
+ c() {
+ e = Ei("Cancel");
+ },
+ m(t, n) {
+ Bn(t, e, n);
+ },
+ d(t) {
+ t && An(e);
+ }
+ };
+}
+function Us(l) {
+ let e, t, n;
+ return t = new hi({
+ props: {
+ variant: "stop",
+ $$slots: { default: [e1] },
+ $$scope: { ctx: l }
+ }
+ }), t.$on(
+ "click",
+ /*click_handler_1*/
+ l[12]
+ ), {
+ c() {
+ e = ot("div"), hn(t.$$.fragment), gn(e, "margin-right", "8px");
+ },
+ m(i, s) {
+ Bn(i, e, s), bn(t, e, null), n = !0;
+ },
+ p(i, s) {
+ const a = {};
+ s & /*$$scope*/
+ 65536 && (a.$$scope = { dirty: s, ctx: i }), t.$set(a);
+ },
+ i(i) {
+ n || (at(t.$$.fragment, i), n = !0);
+ },
+ o(i) {
+ kt(t.$$.fragment, i), n = !1;
+ },
+ d(i) {
+ i && An(e), mn(t);
+ }
+ };
+}
+function e1(l) {
let e;
return {
c() {
- e = Js("Cancel");
+ e = Ei("Remove");
},
m(t, n) {
- pi(t, e, n);
+ Bn(t, e, n);
},
d(t) {
- t && wi(e);
+ t && An(e);
}
};
}
-function Pd(l) {
+function t1(l) {
let e;
return {
c() {
- e = Js("OK");
+ e = Ei("OK");
},
m(t, n) {
- pi(t, e, n);
+ Bn(t, e, n);
},
d(t) {
- t && wi(e);
+ t && An(e);
}
};
}
-function Zd(l) {
- let e, t, n, i, o, a, r, s, f, u, c, _, d, h, b;
- return o = new Hd({
+function n1(l) {
+ let e, t, n, i, s, a, r, o, f, u, c, d, _, b, h, w;
+ s = new Od({
props: {
value: (
/*currentLabel*/
@@ -6360,15 +6412,15 @@ function Zd(l) {
show_label: !1,
allow_custom_value: !0
}
- }), o.$on(
+ }), s.$on(
"change",
/*onDropDownChange*/
- l[4]
- ), o.$on(
+ l[5]
+ ), s.$on(
"enter",
/*onDropDownEnter*/
- l[6]
- ), s = new P_({
+ l[7]
+ ), o = new x_({
props: {
value: (
/*currentColor*/
@@ -6377,183 +6429,207 @@ function Zd(l) {
label: "Color",
show_label: !1
}
- }), s.$on(
+ }), o.$on(
"change",
/*onColorChange*/
- l[5]
- ), c = new So({
+ l[6]
+ ), c = new hi({
props: {
- $$slots: { default: [Vd] },
+ $$slots: { default: [$d] },
$$scope: { ctx: l }
}
}), c.$on(
"click",
/*click_handler*/
- l[10]
- ), h = new So({
+ l[11]
+ );
+ let g = (
+ /*showRemove*/
+ l[3] && Us(l)
+ );
+ return h = new hi({
props: {
variant: "primary",
- $$slots: { default: [Pd] },
+ $$slots: { default: [t1] },
$$scope: { ctx: l }
}
}), h.$on(
"click",
- /*click_handler_1*/
- l[11]
+ /*click_handler_2*/
+ l[13]
), {
c() {
- e = mt("div"), t = mt("div"), n = mt("span"), i = mt("div"), Tn(o.$$.fragment), a = Yl(), r = mt("div"), Tn(s.$$.fragment), f = Yl(), u = mt("div"), Tn(c.$$.fragment), _ = Yl(), d = mt("div"), Tn(h.$$.fragment), Rn(i, "margin-right", "10px"), Rn(r, "margin-right", "40px"), Rn(r, "margin-bottom", "8px"), Rn(u, "margin-right", "8px"), Dn(n, "class", "model-content svelte-hkn2q1"), Dn(t, "class", "modal-container svelte-hkn2q1"), Dn(e, "class", "modal svelte-hkn2q1"), Dn(e, "id", "model-box-edit");
- },
- m(m, w) {
- pi(m, e, w), Ze(e, t), Ze(t, n), Ze(n, i), In(o, i, null), Ze(n, a), Ze(n, r), In(s, r, null), Ze(n, f), Ze(n, u), In(c, u, null), Ze(n, _), Ze(n, d), In(h, d, null), b = !0;
- },
- p(m, [w]) {
- const k = {};
- w & /*currentLabel*/
- 1 && (k.value = /*currentLabel*/
- m[0]), w & /*choices*/
- 4 && (k.choices = /*choices*/
- m[2]), o.$set(k);
- const g = {};
- w & /*currentColor*/
- 2 && (g.value = /*currentColor*/
- m[1]), s.$set(g);
- const S = {};
- w & /*$$scope*/
- 16384 && (S.$$scope = { dirty: w, ctx: m }), c.$set(S);
- const M = {};
- w & /*$$scope*/
- 16384 && (M.$$scope = { dirty: w, ctx: m }), h.$set(M);
- },
- i(m) {
- b || (Fn(o.$$.fragment, m), Fn(s.$$.fragment, m), Fn(c.$$.fragment, m), Fn(h.$$.fragment, m), b = !0);
- },
- o(m) {
- Hn(o.$$.fragment, m), Hn(s.$$.fragment, m), Hn(c.$$.fragment, m), Hn(h.$$.fragment, m), b = !1;
- },
- d(m) {
- m && wi(e), jn(o), jn(s), jn(c), jn(h);
+ e = ot("div"), t = ot("div"), n = ot("span"), i = ot("div"), hn(s.$$.fragment), a = Un(), r = ot("div"), hn(o.$$.fragment), f = Un(), u = ot("div"), hn(c.$$.fragment), d = Un(), g && g.c(), _ = Un(), b = ot("div"), hn(h.$$.fragment), gn(i, "margin-right", "10px"), gn(r, "margin-right", "40px"), gn(r, "margin-bottom", "8px"), gn(u, "margin-right", "8px"), Yn(n, "class", "model-content svelte-hkn2q1"), Yn(t, "class", "modal-container svelte-hkn2q1"), Yn(e, "class", "modal svelte-hkn2q1"), Yn(e, "id", "model-box-edit");
+ },
+ m(p, m) {
+ Bn(p, e, m), Ue(e, t), Ue(t, n), Ue(n, i), bn(s, i, null), Ue(n, a), Ue(n, r), bn(o, r, null), Ue(n, f), Ue(n, u), bn(c, u, null), Ue(n, d), g && g.m(n, null), Ue(n, _), Ue(n, b), bn(h, b, null), w = !0;
+ },
+ p(p, [m]) {
+ const C = {};
+ m & /*currentLabel*/
+ 1 && (C.value = /*currentLabel*/
+ p[0]), m & /*choices*/
+ 4 && (C.choices = /*choices*/
+ p[2]), s.$set(C);
+ const z = {};
+ m & /*currentColor*/
+ 2 && (z.value = /*currentColor*/
+ p[1]), o.$set(z);
+ const y = {};
+ m & /*$$scope*/
+ 65536 && (y.$$scope = { dirty: m, ctx: p }), c.$set(y), /*showRemove*/
+ p[3] ? g ? (g.p(p, m), m & /*showRemove*/
+ 8 && at(g, 1)) : (g = Us(p), g.c(), at(g, 1), g.m(n, _)) : g && (Zd(), kt(g, 1, 1, () => {
+ g = null;
+ }), Pd());
+ const q = {};
+ m & /*$$scope*/
+ 65536 && (q.$$scope = { dirty: m, ctx: p }), h.$set(q);
+ },
+ i(p) {
+ w || (at(s.$$.fragment, p), at(o.$$.fragment, p), at(c.$$.fragment, p), at(g), at(h.$$.fragment, p), w = !0);
+ },
+ o(p) {
+ kt(s.$$.fragment, p), kt(o.$$.fragment, p), kt(c.$$.fragment, p), kt(g), kt(h.$$.fragment, p), w = !1;
+ },
+ d(p) {
+ p && An(e), mn(s), mn(o), mn(c), g && g.d(), mn(h);
}
};
}
-function Kd(l, e, t) {
- let { label: n = "" } = e, { currentLabel: i = "" } = e, { choices: o = [] } = e, { choicesColors: a = [] } = e, { color: r = "" } = e, { currentColor: s = "" } = e;
- const f = Xd();
- function u(w) {
- f("change", {
+function l1(l, e, t) {
+ let { label: n = "" } = e, { currentLabel: i = "" } = e, { choices: s = [] } = e, { choicesColors: a = [] } = e, { color: r = "" } = e, { currentColor: o = "" } = e, { showRemove: f = !0 } = e;
+ const u = Jd();
+ function c(m) {
+ u("change", {
label: i,
- color: s,
- ok: w
+ color: o,
+ ret: m
+ // -1: remove, 0: cancel, 1: change
});
}
- function c(w) {
- const { detail: k } = w;
- let g = k;
- Number.isInteger(g) ? (Array.isArray(a) && g < a.length && t(1, s = a[g]), Array.isArray(o) && g < o.length && t(0, i = o[g][0])) : t(0, i = g);
+ function d(m) {
+ const { detail: C } = m;
+ let z = C;
+ Number.isInteger(z) ? (Array.isArray(a) && z < a.length && t(1, o = a[z]), Array.isArray(s) && z < s.length && t(0, i = s[z][0])) : t(0, i = z);
}
- function _(w) {
- const { detail: k } = w;
- t(1, s = k);
+ function _(m) {
+ const { detail: C } = m;
+ t(1, o = C);
}
- function d(w) {
- c(w), u(!0);
+ function b(m) {
+ d(m), c(1);
}
- function h(w) {
- switch (w.key) {
+ function h(m) {
+ switch (m.key) {
case "Enter":
- u(!0);
+ c(1);
break;
}
}
- Yd(() => {
- document.addEventListener("keydown", h), t(0, i = n), t(1, s = r);
- }), Wd(() => {
+ Qd(() => {
+ document.addEventListener("keydown", h), t(0, i = n), t(1, o = r);
+ }), xd(() => {
document.removeEventListener("keydown", h);
});
- const b = () => u(!1), m = () => u(!0);
- return l.$$set = (w) => {
- "label" in w && t(7, n = w.label), "currentLabel" in w && t(0, i = w.currentLabel), "choices" in w && t(2, o = w.choices), "choicesColors" in w && t(8, a = w.choicesColors), "color" in w && t(9, r = w.color), "currentColor" in w && t(1, s = w.currentColor);
+ const w = () => c(0), g = () => c(-1), p = () => c(1);
+ return l.$$set = (m) => {
+ "label" in m && t(8, n = m.label), "currentLabel" in m && t(0, i = m.currentLabel), "choices" in m && t(2, s = m.choices), "choicesColors" in m && t(9, a = m.choicesColors), "color" in m && t(10, r = m.color), "currentColor" in m && t(1, o = m.currentColor), "showRemove" in m && t(3, f = m.showRemove);
}, [
i,
- s,
o,
- u,
+ s,
+ f,
c,
- _,
d,
+ _,
+ b,
n,
a,
r,
- b,
- m
+ w,
+ g,
+ p
];
}
-class Qs extends Ud {
+class la extends Wd {
constructor(e) {
- super(), Nd(this, e, Kd, Zd, Od, {
- label: 7,
+ super(), Kd(this, e, l1, n1, Gd, {
+ label: 8,
currentLabel: 0,
choices: 2,
- choicesColors: 8,
- color: 9,
- currentColor: 1
+ choicesColors: 9,
+ color: 10,
+ currentColor: 1,
+ showRemove: 3
});
}
}
-const fe = (l, e, t) => Math.min(Math.max(l, e), t);
-function Wl(l, e) {
+const te = (l, e, t) => Math.min(Math.max(l, e), t);
+function Jl(l, e) {
if (l.startsWith("rgba"))
return l.replace(/[\d.]+$/, e.toString());
const t = l.match(/\d+/g);
if (!t || t.length !== 3)
return `rgba(50, 50, 50, ${e})`;
- const [n, i, o] = t;
- return `rgba(${n}, ${i}, ${o}, ${e})`;
+ const [n, i, s] = t;
+ return `rgba(${n}, ${i}, ${s}, ${e})`;
}
-class Vl {
- constructor(e, t, n, i, o, a, r, s, f, u, c = "rgb(255, 255, 255)", _ = 0.5, d = 25, h = 8, b = 2, m = 4, w = 1) {
+class Ql {
+ constructor(e, t, n, i, s, a, r, o, f, u, c, d = "rgb(255, 255, 255)", _ = 0.5, b = 25, h = 8, w = 2, g = 4, p = 1) {
this.stopDrag = () => {
this.isDragging = !1, document.removeEventListener("mousemove", this.handleDrag), document.removeEventListener("mouseup", this.stopDrag);
- }, this.handleDrag = (k) => {
+ }, this.handleDrag = (m) => {
if (this.isDragging) {
- let g = k.clientX - this.offsetMouseX - this.xmin, S = k.clientY - this.offsetMouseY - this.ymin;
- const M = this.canvasXmax - this.canvasXmin, y = this.canvasYmax - this.canvasYmin;
- g = fe(g, -this.xmin, M - this.xmax), S = fe(S, -this.ymin, y - this.ymax), this.xmin += g, this.ymin += S, this.xmax += g, this.ymax += S, this.updateHandles(), this.renderCallBack();
+ let C = m.clientX - this.offsetMouseX - this.xmin, z = m.clientY - this.offsetMouseY - this.ymin;
+ const y = this.canvasXmax - this.canvasXmin, q = this.canvasYmax - this.canvasYmin;
+ C = te(C, -this.xmin, y - this.xmax), z = te(z, -this.ymin, q - this.ymax), this.xmin += C, this.ymin += z, this.xmax += C, this.ymax += z, this.updateHandles(), this.renderCallBack();
+ }
+ }, this.handleCreating = (m) => {
+ if (this.isCreating) {
+ let [C, z] = this.toBoxCoordinates(m.clientX, m.clientY);
+ C -= this.offsetMouseX, z -= this.offsetMouseY, C > this.xmax ? (this.creatingAnchorX == "xmax" && (this.xmin = this.xmax), this.xmax = C, this.creatingAnchorX = "xmin") : C > this.xmin && C < this.xmax && this.creatingAnchorX == "xmin" ? this.xmax = C : C > this.xmin && C < this.xmax && this.creatingAnchorX == "xmax" ? this.xmin = C : C < this.xmin && (this.creatingAnchorX == "xmin" && (this.xmax = this.xmin), this.xmin = C, this.creatingAnchorX = "xmax"), z > this.ymax ? (this.creatingAnchorY == "ymax" && (this.ymin = this.ymax), this.ymax = z, this.creatingAnchorY = "ymin") : z > this.ymin && z < this.ymax && this.creatingAnchorY == "ymin" ? this.ymax = z : z > this.ymin && z < this.ymax && this.creatingAnchorY == "ymax" ? this.ymin = z : z < this.ymin && (this.creatingAnchorY == "ymin" && (this.ymax = this.ymin), this.ymin = z, this.creatingAnchorY = "ymax"), this.updateHandles(), this.renderCallBack();
+ }
+ }, this.stopCreating = (m) => {
+ if (this.isCreating = !1, document.removeEventListener("mousemove", this.handleCreating), document.removeEventListener("mouseup", this.stopCreating), this.getArea() > 0) {
+ const C = this.canvasXmax - this.canvasXmin, z = this.canvasYmax - this.canvasYmin;
+ this.xmin = te(this.xmin, 0, C - this.minSize), this.ymin = te(this.ymin, 0, z - this.minSize), this.xmax = te(this.xmax, this.minSize, C), this.ymax = te(this.ymax, this.minSize, z), this.minSize > 0 && (this.getWidth() < this.minSize && (this.creatingAnchorX == "xmin" ? this.xmax = this.xmin + this.minSize : this.xmin = this.xmax - this.minSize), this.getHeight() < this.minSize && (this.creatingAnchorY == "ymin" ? this.ymax = this.ymin + this.minSize : this.ymin = this.ymax - this.minSize), this.xmax > C ? (this.xmin -= this.xmax - C, this.xmax = C) : this.xmin < 0 && (this.xmax -= this.xmin, this.xmin = 0), this.ymax > z ? (this.ymin -= this.ymax - z, this.ymax = z) : this.ymin < 0 && (this.ymax -= this.ymin, this.ymin = 0)), this.updateHandles(), this.renderCallBack();
}
- }, this.handleResize = (k) => {
+ this.onFinishCreation();
+ }, this.handleResize = (m) => {
if (this.isResizing) {
- const g = k.clientX, S = k.clientY, M = g - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, y = S - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, z = this.canvasXmax - this.canvasXmin, v = this.canvasYmax - this.canvasYmin;
+ const C = m.clientX, z = m.clientY, y = C - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, q = z - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, v = this.canvasXmax - this.canvasXmin, E = this.canvasYmax - this.canvasYmin;
switch (this.resizingHandleIndex) {
case 0:
- this.xmin += M, this.ymin += y, this.xmin = fe(this.xmin, 0, this.xmax - this.minSize), this.ymin = fe(this.ymin, 0, this.ymax - this.minSize);
+ this.xmin += y, this.ymin += q, this.xmin = te(this.xmin, 0, this.xmax - this.minSize), this.ymin = te(this.ymin, 0, this.ymax - this.minSize);
break;
case 1:
- this.xmax += M, this.ymin += y, this.xmax = fe(this.xmax, this.xmin + this.minSize, z), this.ymin = fe(this.ymin, 0, this.ymax - this.minSize);
+ this.xmax += y, this.ymin += q, this.xmax = te(this.xmax, this.xmin + this.minSize, v), this.ymin = te(this.ymin, 0, this.ymax - this.minSize);
break;
case 2:
- this.xmax += M, this.ymax += y, this.xmax = fe(this.xmax, this.xmin + this.minSize, z), this.ymax = fe(this.ymax, this.ymin + this.minSize, v);
+ this.xmax += y, this.ymax += q, this.xmax = te(this.xmax, this.xmin + this.minSize, v), this.ymax = te(this.ymax, this.ymin + this.minSize, E);
break;
case 3:
- this.xmin += M, this.ymax += y, this.xmin = fe(this.xmin, 0, this.xmax - this.minSize), this.ymax = fe(this.ymax, this.ymin + this.minSize, v);
+ this.xmin += y, this.ymax += q, this.xmin = te(this.xmin, 0, this.xmax - this.minSize), this.ymax = te(this.ymax, this.ymin + this.minSize, E);
break;
case 4:
- this.ymin += y, this.ymin = fe(this.ymin, 0, this.ymax - this.minSize);
+ this.ymin += q, this.ymin = te(this.ymin, 0, this.ymax - this.minSize);
break;
case 5:
- this.xmax += M, this.xmax = fe(this.xmax, this.xmin + this.minSize, z);
+ this.xmax += y, this.xmax = te(this.xmax, this.xmin + this.minSize, v);
break;
case 6:
- this.ymax += y, this.ymax = fe(this.ymax, this.ymin + this.minSize, v);
+ this.ymax += q, this.ymax = te(this.ymax, this.ymin + this.minSize, E);
break;
case 7:
- this.xmin += M, this.xmin = fe(this.xmin, 0, this.xmax - this.minSize);
+ this.xmin += y, this.xmin = te(this.xmin, 0, this.xmax - this.minSize);
break;
}
this.updateHandles(), this.renderCallBack();
}
}, this.stopResize = () => {
this.isResizing = !1, document.removeEventListener("mousemove", this.handleResize), document.removeEventListener("mouseup", this.stopResize);
- }, this.renderCallBack = e, this.canvasXmin = t, this.canvasYmin = n, this.canvasXmax = i, this.canvasYmax = o, this.scaleFactor = w, this.label = a, this.isDragging = !1, this.xmin = r, this.ymin = s, this.xmax = f, this.ymax = u, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = h, this.thickness = b, this.selectedThickness = m, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = d, this.color = c, this.alpha = _;
+ }, this.renderCallBack = e, this.onFinishCreation = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = s, this.canvasYmax = a, this.scaleFactor = p, this.label = r, this.isDragging = !1, this.isCreating = !1, this.xmin = o, this.ymin = f, this.xmax = u, this.ymax = c, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = h, this.thickness = w, this.selectedThickness = g, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = b, this.color = d, this.alpha = _, this.creatingAnchorX = "xmin", this.creatingAnchorY = "ymin";
}
toJSON() {
return {
@@ -6640,6 +6716,9 @@ class Vl {
getHeight() {
return this.ymax - this.ymin;
}
+ getArea() {
+ return this.getWidth() * this.getHeight();
+ }
toCanvasCoordinates(e, t) {
return e = e + this.canvasXmin, t = t + this.canvasYmin, [e, t];
}
@@ -6648,13 +6727,13 @@ class Vl {
}
render(e) {
let t, n;
- if (e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = Wl(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = Wl(this.color, 1), e.stroke(), e.closePath(), this.label !== null && this.label.trim() !== "") {
+ if (e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = Jl(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = Jl(this.color, 1), e.stroke(), e.closePath(), this.label !== null && this.label.trim() !== "") {
this.isSelected ? e.font = "bold 14px Arial" : e.font = "12px Arial";
- const i = e.measureText(this.label).width + 10, o = 20;
- let a = this.xmin, r = this.ymin - o;
- e.fillStyle = "white", [a, r] = this.toCanvasCoordinates(a, r), e.fillRect(a, r, i, o), e.lineWidth = 1, e.strokeStyle = "black", e.strokeRect(a, r, i, o), e.fillStyle = "black", e.fillText(this.label, a + 5, r + 15);
+ const i = e.measureText(this.label).width + 10, s = 20;
+ let a = this.xmin, r = this.ymin - s;
+ e.fillStyle = "white", [a, r] = this.toCanvasCoordinates(a, r), e.fillRect(a, r, i, s), e.lineWidth = 1, e.strokeStyle = "black", e.strokeRect(a, r, i, s), e.fillStyle = "black", e.fillText(this.label, a + 5, r + 15);
}
- e.fillStyle = Wl(this.color, 1);
+ e.fillStyle = Jl(this.color, 1);
for (const i of this.resizeHandles)
[t, n] = this.toCanvasCoordinates(i.xmin, i.ymin), e.fillRect(
t,
@@ -6678,11 +6757,14 @@ class Vl {
}
return -1;
}
+ startCreating(e, t, n) {
+ this.isCreating = !0, this.offsetMouseX = t, this.offsetMouseY = n, document.addEventListener("mousemove", this.handleCreating), document.addEventListener("mouseup", this.stopCreating);
+ }
startResize(e, t) {
this.resizingHandleIndex = e, this.isResizing = !0, this.offsetMouseX = t.clientX - this.resizeHandles[e].xmin, this.offsetMouseY = t.clientY - this.resizeHandles[e].ymin, document.addEventListener("mousemove", this.handleResize), document.addEventListener("mouseup", this.stopResize);
}
}
-const Oe = [
+const Ut = [
"rgb(255, 168, 77)",
"rgb(92, 172, 238)",
"rgb(255, 99, 71)",
@@ -6697,101 +6779,94 @@ const Oe = [
"rgb(255, 193, 7)",
"rgb(255, 250, 138)"
], {
- SvelteComponent: Gd,
- append: fn,
- attr: St,
- binding_callbacks: Jd,
- bubble: Io,
- check_outros: Pn,
- create_component: mn,
- destroy_component: bn,
- detach: wt,
- element: Zt,
- empty: Qd,
- group_outros: Zn,
- init: xd,
- insert: pt,
- listen: it,
- mount_component: gn,
- noop: $d,
- run_all: xs,
- safe_not_equal: e0,
- space: dn,
- transition_in: ne,
- transition_out: ve
-} = window.__gradio__svelte__internal, { onMount: t0, onDestroy: n0, createEventDispatcher: l0 } = window.__gradio__svelte__internal;
-function Ro(l) {
- let e, t, n, i, o, a, r, s, f, u;
- n = new M_({});
- let c = !/*disableEditBoxes*/
- l[4] && Fo(l);
- return r = new ci({}), {
+ SvelteComponent: i1,
+ append: Jn,
+ attr: rt,
+ binding_callbacks: s1,
+ bubble: Ns,
+ check_outros: xl,
+ create_component: fl,
+ destroy_component: ul,
+ detach: Wt,
+ element: vn,
+ empty: o1,
+ group_outros: $l,
+ init: a1,
+ insert: Pt,
+ listen: Ct,
+ mount_component: cl,
+ run_all: ia,
+ safe_not_equal: r1,
+ space: Qn,
+ toggle_class: Nn,
+ transition_in: Ce,
+ transition_out: Ne
+} = window.__gradio__svelte__internal, { onMount: f1, onDestroy: u1, createEventDispatcher: c1 } = window.__gradio__svelte__internal;
+function Vs(l) {
+ let e, t, n, i, s, a, r, o, f;
+ return n = new q_({}), a = new R_({}), {
c() {
- e = Zt("span"), t = Zt("button"), mn(n.$$.fragment), i = dn(), c && c.c(), o = dn(), a = Zt("button"), mn(r.$$.fragment), St(t, "class", "icon svelte-182gnnj"), St(a, "class", "icon svelte-182gnnj"), St(e, "class", "canvas-control svelte-182gnnj");
+ e = vn("span"), t = vn("button"), fl(n.$$.fragment), i = Qn(), s = vn("button"), fl(a.$$.fragment), rt(t, "class", "icon svelte-10jprmi"), rt(t, "aria-label", "Create box"), Nn(
+ t,
+ "selected",
+ /*mode*/
+ l[7] === /*Mode*/
+ l[4].creation
+ ), rt(s, "class", "icon svelte-10jprmi"), rt(s, "aria-label", "Edit boxes"), Nn(
+ s,
+ "selected",
+ /*mode*/
+ l[7] === /*Mode*/
+ l[4].drag
+ ), rt(e, "class", "canvas-control svelte-10jprmi");
},
- m(_, d) {
- pt(_, e, d), fn(e, t), gn(n, t, null), fn(e, i), c && c.m(e, null), fn(e, o), fn(e, a), gn(r, a, null), s = !0, f || (u = [
- it(
+ m(u, c) {
+ Pt(u, e, c), Jn(e, t), cl(n, t, null), Jn(e, i), Jn(e, s), cl(a, s, null), r = !0, o || (f = [
+ Ct(
t,
"click",
/*click_handler*/
- l[26]
+ l[27]
),
- it(
- a,
+ Ct(
+ s,
"click",
- /*click_handler_2*/
+ /*click_handler_1*/
l[28]
)
- ], f = !0);
- },
- p(_, d) {
- /*disableEditBoxes*/
- _[4] ? c && (Zn(), ve(c, 1, 1, () => {
- c = null;
- }), Pn()) : c ? (c.p(_, d), d[0] & /*disableEditBoxes*/
- 16 && ne(c, 1)) : (c = Fo(_), c.c(), ne(c, 1), c.m(e, o));
- },
- i(_) {
- s || (ne(n.$$.fragment, _), ne(c), ne(r.$$.fragment, _), s = !0);
- },
- o(_) {
- ve(n.$$.fragment, _), ve(c), ve(r.$$.fragment, _), s = !1;
- },
- d(_) {
- _ && wt(e), bn(n), c && c.d(), bn(r), f = !1, xs(u);
- }
- };
-}
-function Fo(l) {
- let e, t, n, i, o;
- return t = new Lf({}), {
- c() {
- e = Zt("button"), mn(t.$$.fragment), St(e, "class", "icon svelte-182gnnj");
+ ], o = !0);
},
- m(a, r) {
- pt(a, e, r), gn(t, e, null), n = !0, i || (o = it(
- e,
- "click",
- /*click_handler_1*/
- l[27]
- ), i = !0);
+ p(u, c) {
+ (!r || c[0] & /*mode, Mode*/
+ 144) && Nn(
+ t,
+ "selected",
+ /*mode*/
+ u[7] === /*Mode*/
+ u[4].creation
+ ), (!r || c[0] & /*mode, Mode*/
+ 144) && Nn(
+ s,
+ "selected",
+ /*mode*/
+ u[7] === /*Mode*/
+ u[4].drag
+ );
},
- p: $d,
- i(a) {
- n || (ne(t.$$.fragment, a), n = !0);
+ i(u) {
+ r || (Ce(n.$$.fragment, u), Ce(a.$$.fragment, u), r = !0);
},
- o(a) {
- ve(t.$$.fragment, a), n = !1;
+ o(u) {
+ Ne(n.$$.fragment, u), Ne(a.$$.fragment, u), r = !1;
},
- d(a) {
- a && wt(e), bn(t), i = !1, o();
+ d(u) {
+ u && Wt(e), ul(n), ul(a), o = !1, ia(f);
}
};
}
-function Ho(l) {
+function Os(l) {
let e, t;
- return e = new Qs({
+ return e = new la({
props: {
choices: (
/*choices*/
@@ -6817,7 +6892,7 @@ function Ho(l) {
/*selectedBox*/
l[6] >= 0 && /*selectedBox*/
l[6] < /*value*/
- l[0].boxes.length ? wn(
+ l[0].boxes.length ? Cn(
/*value*/
l[0].boxes[
/*selectedBox*/
@@ -6836,19 +6911,19 @@ function Ho(l) {
l[29]
), {
c() {
- mn(e.$$.fragment);
+ fl(e.$$.fragment);
},
m(n, i) {
- gn(e, n, i), t = !0;
+ cl(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*choices*/
- 4 && (o.choices = /*choices*/
+ 4 && (s.choices = /*choices*/
n[2]), i[0] & /*choicesColors*/
- 8 && (o.choicesColors = /*choicesColors*/
+ 8 && (s.choicesColors = /*choicesColors*/
n[3]), i[0] & /*selectedBox, value*/
- 65 && (o.label = /*selectedBox*/
+ 65 && (s.label = /*selectedBox*/
n[6] >= 0 && /*selectedBox*/
n[6] < /*value*/
n[0].boxes.length ? (
@@ -6858,364 +6933,406 @@ function Ho(l) {
n[6]
].label
) : ""), i[0] & /*selectedBox, value*/
- 65 && (o.color = /*selectedBox*/
+ 65 && (s.color = /*selectedBox*/
n[6] >= 0 && /*selectedBox*/
n[6] < /*value*/
- n[0].boxes.length ? wn(
+ n[0].boxes.length ? Cn(
/*value*/
n[0].boxes[
/*selectedBox*/
n[6]
].color
- ) : ""), e.$set(o);
+ ) : ""), e.$set(s);
},
i(n) {
- t || (ne(e.$$.fragment, n), t = !0);
+ t || (Ce(e.$$.fragment, n), t = !0);
},
o(n) {
- ve(e.$$.fragment, n), t = !1;
+ Ne(e.$$.fragment, n), t = !1;
},
d(n) {
- bn(e, n);
+ ul(e, n);
}
};
}
-function Uo(l) {
+function Ws(l) {
let e, t;
- return e = new Qs({
+ return e = new la({
props: {
choices: (
/*choices*/
l[2]
),
+ showRemove: !1,
choicesColors: (
/*choicesColors*/
l[3]
),
- color: Array.isArray(
- /*choicesColors*/
- l[3]
- ) && /*choicesColors*/
- l[3].length > 0 ? (
- /*choicesColors*/
- l[3][0]
- ) : wn(Oe[
- /*value*/
- l[0].boxes.length % Oe.length
- ])
+ label: (
+ /*selectedBox*/
+ l[6] >= 0 && /*selectedBox*/
+ l[6] < /*value*/
+ l[0].boxes.length ? (
+ /*value*/
+ l[0].boxes[
+ /*selectedBox*/
+ l[6]
+ ].label
+ ) : ""
+ ),
+ color: (
+ /*selectedBox*/
+ l[6] >= 0 && /*selectedBox*/
+ l[6] < /*value*/
+ l[0].boxes.length ? Cn(
+ /*value*/
+ l[0].boxes[
+ /*selectedBox*/
+ l[6]
+ ].color
+ ) : ""
+ )
}
}), e.$on(
"change",
/*onModalNewChange*/
- l[12]
+ l[16]
), e.$on(
"enter{onModalNewChange}",
/*enter_onModalNewChange_handler*/
l[30]
), {
c() {
- mn(e.$$.fragment);
+ fl(e.$$.fragment);
},
m(n, i) {
- gn(e, n, i), t = !0;
+ cl(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*choices*/
- 4 && (o.choices = /*choices*/
+ 4 && (s.choices = /*choices*/
n[2]), i[0] & /*choicesColors*/
- 8 && (o.choicesColors = /*choicesColors*/
- n[3]), i[0] & /*choicesColors, value*/
- 9 && (o.color = Array.isArray(
- /*choicesColors*/
- n[3]
- ) && /*choicesColors*/
- n[3].length > 0 ? (
- /*choicesColors*/
- n[3][0]
- ) : wn(Oe[
+ 8 && (s.choicesColors = /*choicesColors*/
+ n[3]), i[0] & /*selectedBox, value*/
+ 65 && (s.label = /*selectedBox*/
+ n[6] >= 0 && /*selectedBox*/
+ n[6] < /*value*/
+ n[0].boxes.length ? (
/*value*/
- n[0].boxes.length % Oe.length
- ])), e.$set(o);
+ n[0].boxes[
+ /*selectedBox*/
+ n[6]
+ ].label
+ ) : ""), i[0] & /*selectedBox, value*/
+ 65 && (s.color = /*selectedBox*/
+ n[6] >= 0 && /*selectedBox*/
+ n[6] < /*value*/
+ n[0].boxes.length ? Cn(
+ /*value*/
+ n[0].boxes[
+ /*selectedBox*/
+ n[6]
+ ].color
+ ) : ""), e.$set(s);
},
i(n) {
- t || (ne(e.$$.fragment, n), t = !0);
+ t || (Ce(e.$$.fragment, n), t = !0);
},
o(n) {
- ve(e.$$.fragment, n), t = !1;
+ Ne(e.$$.fragment, n), t = !1;
},
d(n) {
- bn(e, n);
+ ul(e, n);
}
};
}
-function i0(l) {
- let e, t, n, i, o, a, r, s, f, u = (
+function _1(l) {
+ let e, t, n, i, s, a, r, o, f, u = (
/*interactive*/
- l[1] && Ro(l)
+ l[1] && Vs(l)
), c = (
/*editModalVisible*/
- l[7] && Ho(l)
- ), _ = (
+ l[8] && Os(l)
+ ), d = (
/*newModalVisible*/
- l[8] && Uo(l)
+ l[9] && Ws(l)
);
return {
c() {
- e = Zt("div"), t = Zt("canvas"), n = dn(), u && u.c(), i = dn(), c && c.c(), o = dn(), _ && _.c(), a = Qd(), St(t, "class", "canvas-annotator svelte-182gnnj"), St(e, "class", "canvas-container svelte-182gnnj"), St(e, "tabindex", "-1");
+ e = vn("div"), t = vn("canvas"), n = Qn(), u && u.c(), i = Qn(), c && c.c(), s = Qn(), d && d.c(), a = o1(), rt(t, "class", "canvas-annotator svelte-10jprmi"), rt(e, "class", "canvas-container svelte-10jprmi"), rt(e, "tabindex", "-1");
},
- m(d, h) {
- pt(d, e, h), fn(e, t), l[25](t), pt(d, n, h), u && u.m(d, h), pt(d, i, h), c && c.m(d, h), pt(d, o, h), _ && _.m(d, h), pt(d, a, h), r = !0, s || (f = [
- it(
+ m(_, b) {
+ Pt(_, e, b), Jn(e, t), l[26](t), Pt(_, n, b), u && u.m(_, b), Pt(_, i, b), c && c.m(_, b), Pt(_, s, b), d && d.m(_, b), Pt(_, a, b), r = !0, o || (f = [
+ Ct(
t,
"mousedown",
/*handleMouseDown*/
- l[9]
+ l[10]
),
- it(
+ Ct(
t,
"mouseup",
/*handleMouseUp*/
- l[10]
+ l[11]
),
- it(
+ Ct(
t,
"dblclick",
/*handleDoubleClick*/
l[14]
),
- it(
+ Ct(
e,
"focusin",
/*handleCanvasFocus*/
l[17]
),
- it(
+ Ct(
e,
"focusout",
/*handleCanvasBlur*/
l[18]
)
- ], s = !0);
+ ], o = !0);
},
- p(d, h) {
+ p(_, b) {
/*interactive*/
- d[1] ? u ? (u.p(d, h), h[0] & /*interactive*/
- 2 && ne(u, 1)) : (u = Ro(d), u.c(), ne(u, 1), u.m(i.parentNode, i)) : u && (Zn(), ve(u, 1, 1, () => {
+ _[1] ? u ? (u.p(_, b), b[0] & /*interactive*/
+ 2 && Ce(u, 1)) : (u = Vs(_), u.c(), Ce(u, 1), u.m(i.parentNode, i)) : u && ($l(), Ne(u, 1, 1, () => {
u = null;
- }), Pn()), /*editModalVisible*/
- d[7] ? c ? (c.p(d, h), h[0] & /*editModalVisible*/
- 128 && ne(c, 1)) : (c = Ho(d), c.c(), ne(c, 1), c.m(o.parentNode, o)) : c && (Zn(), ve(c, 1, 1, () => {
+ }), xl()), /*editModalVisible*/
+ _[8] ? c ? (c.p(_, b), b[0] & /*editModalVisible*/
+ 256 && Ce(c, 1)) : (c = Os(_), c.c(), Ce(c, 1), c.m(s.parentNode, s)) : c && ($l(), Ne(c, 1, 1, () => {
c = null;
- }), Pn()), /*newModalVisible*/
- d[8] ? _ ? (_.p(d, h), h[0] & /*newModalVisible*/
- 256 && ne(_, 1)) : (_ = Uo(d), _.c(), ne(_, 1), _.m(a.parentNode, a)) : _ && (Zn(), ve(_, 1, 1, () => {
- _ = null;
- }), Pn());
+ }), xl()), /*newModalVisible*/
+ _[9] ? d ? (d.p(_, b), b[0] & /*newModalVisible*/
+ 512 && Ce(d, 1)) : (d = Ws(_), d.c(), Ce(d, 1), d.m(a.parentNode, a)) : d && ($l(), Ne(d, 1, 1, () => {
+ d = null;
+ }), xl());
},
- i(d) {
- r || (ne(u), ne(c), ne(_), r = !0);
+ i(_) {
+ r || (Ce(u), Ce(c), Ce(d), r = !0);
},
- o(d) {
- ve(u), ve(c), ve(_), r = !1;
+ o(_) {
+ Ne(u), Ne(c), Ne(d), r = !1;
},
- d(d) {
- d && (wt(e), wt(n), wt(i), wt(o), wt(a)), l[25](null), u && u.d(d), c && c.d(d), _ && _.d(d), s = !1, xs(f);
+ d(_) {
+ _ && (Wt(e), Wt(n), Wt(i), Wt(s), Wt(a)), l[26](null), u && u.d(_), c && c.d(_), d && d.d(_), o = !1, ia(f);
}
};
}
-function No(l) {
+function ei(l) {
var e = parseInt(l.slice(1, 3), 16), t = parseInt(l.slice(3, 5), 16), n = parseInt(l.slice(5, 7), 16);
return "rgb(" + e + ", " + t + ", " + n + ")";
}
-function wn(l) {
+function Cn(l) {
const e = l.match(/(\d+(\.\d+)?)/g), t = parseInt(e[0]), n = parseInt(e[1]), i = parseInt(e[2]);
return "#" + (1 << 24 | t << 16 | n << 8 | i).toString(16).slice(1);
}
-function o0(l, e, t) {
- let { imageUrl: n = null } = e, { interactive: i } = e, { boxAlpha: o = 0.5 } = e, { boxMinSize: a = 25 } = e, { handleSize: r } = e, { boxThickness: s } = e, { boxSelectedThickness: f } = e, { value: u } = e, { choices: c = [] } = e, { choicesColors: _ = [] } = e, { disableEditBoxes: d = !1 } = e, h, b, m = null, w = -1, k = 0, g = 0, S = 0, M = 0, y = 1, z = 0, v = 0, q = !1, R = !1;
- const I = l0();
- function B() {
- if (b) {
- b.clearRect(0, 0, h.width, h.height), m !== null && b.drawImage(m, k, g, z, v);
- for (const E of u.boxes.slice().reverse())
- E.render(b);
- }
- }
- function W(E) {
- t(6, w = E), u.boxes.forEach((D) => {
- D.setSelected(!1);
- }), E >= 0 && E < u.boxes.length && u.boxes[E].setSelected(!0), B();
- }
- function H(E) {
- if (!i)
- return;
- const D = h.getBoundingClientRect(), Y = E.clientX - D.left, be = E.clientY - D.top;
- for (const [qe, J] of u.boxes.entries()) {
- const Qe = J.indexOfPointInsideHandle(Y, be);
- if (Qe >= 0) {
- W(qe), J.startResize(Qe, E);
+function d1(l, e, t) {
+ var n;
+ (function(A) {
+ A[A.creation = 0] = "creation", A[A.drag = 1] = "drag";
+ })(n || (n = {}));
+ let { imageUrl: i = null } = e, { interactive: s } = e, { boxAlpha: a = 0.5 } = e, { boxMinSize: r = 25 } = e, { handleSize: o } = e, { boxThickness: f } = e, { boxSelectedThickness: u } = e, { value: c } = e, { choices: d = [] } = e, { choicesColors: _ = [] } = e, { disableEditBoxes: b = !1 } = e, h, w, g = null, p = -1, m = n.drag;
+ c !== null && c.boxes.length == 0 && (m = n.creation);
+ let C = 0, z = 0, y = 0, q = 0, v = 1, E = 0, F = 0, X = !1, L = !1;
+ const V = c1();
+ function I() {
+ if (w) {
+ w.clearRect(0, 0, h.width, h.height), g !== null && w.drawImage(g, C, z, E, F);
+ for (const A of c.boxes.slice().reverse())
+ A.render(w);
+ }
+ }
+ function Q(A) {
+ t(6, p = A), c.boxes.forEach((T) => {
+ T.setSelected(!1);
+ }), A >= 0 && A < c.boxes.length && c.boxes[A].setSelected(!0), I();
+ }
+ function W(A) {
+ s && (m === n.creation ? D(A) : m === n.drag && le(A));
+ }
+ function le(A) {
+ const T = h.getBoundingClientRect(), P = A.clientX - T.left, qe = A.clientY - T.top;
+ for (const [Ee, ce] of c.boxes.entries()) {
+ const Ai = ce.indexOfPointInsideHandle(P, qe);
+ if (Ai >= 0) {
+ Q(Ee), ce.startResize(Ai, A);
return;
}
}
- for (const [qe, J] of u.boxes.entries())
- if (J.isPointInsideBox(Y, be)) {
- W(qe), J.startDrag(E);
+ for (const [Ee, ce] of c.boxes.entries())
+ if (ce.isPointInsideBox(P, qe)) {
+ Q(Ee), ce.startDrag(A);
return;
}
- W(-1);
+ Q(-1);
}
- function le(E) {
- I("change");
+ function ae(A) {
+ V("change");
}
- function X(E) {
- if (i)
- switch (E.key) {
+ function re(A) {
+ if (s)
+ switch (A.key) {
case "Delete":
- Le();
+ H();
break;
}
}
- function ee() {
- d ? ae() : t(8, R = !0);
+ function D(A) {
+ const T = h.getBoundingClientRect(), P = (A.clientX - T.left - C) / v, qe = (A.clientY - T.top - z) / v;
+ let Ee;
+ _.length > 0 ? Ee = ei(_[0]) : Ee = Ut[c.boxes.length % Ut.length];
+ let ce = new Ql(I, Fe, C, z, y, q, "", P, qe, P, qe, Ee, a, r, o, f, u);
+ ce.startCreating(A, T.left, T.top), t(0, c.boxes = [ce, ...c.boxes], c), Q(0), I(), V("change");
}
- function ae(E = null, D = null, Y = null, be = null, qe = null, J = null) {
- D === null || D === "" ? D = Oe[u.boxes.length % Oe.length] : D = No(D), E === null && (E = ""), Y === null && (Y = z / 3 / y), qe === null && (qe = z / 3 * 2 / y), be === null && (be = v / 3 / y), J === null && (J = v / 3 * 2 / y);
- let Qe = new Vl(B, k, g, S, M, E, Math.round(Y), Math.round(be), Math.round(qe), Math.round(J), D, o, a, r, s, f);
- t(0, u.boxes = [Qe, ...u.boxes], u), B(), I("change");
+ function fe() {
+ t(7, m = n.creation), t(5, h.style.cursor = "crosshair", h);
}
- function ye(E) {
- t(8, R = !1);
- const { detail: D } = E;
- D.ok && ae(D.label, D.color);
+ function Se() {
+ t(7, m = n.drag), t(5, h.style.cursor = "default", h);
}
- function L() {
- w >= 0 && w < u.boxes.length && !d && t(7, q = !0);
+ function Fe() {
+ p >= 0 && p < c.boxes.length && (c.boxes[p].getArea() < 1 ? H() : b || t(9, L = !0));
+ }
+ function Pe() {
+ p >= 0 && p < c.boxes.length && !b && t(8, X = !0);
+ }
+ function B(A) {
+ s && Pe();
}
- function de(E) {
- i && L();
+ function Ze(A) {
+ t(8, X = !1);
+ const { detail: T } = A;
+ let P = T.label, qe = T.color, Ee = T.ret;
+ if (p >= 0 && p < c.boxes.length) {
+ let ce = c.boxes[p];
+ Ee == 1 ? (ce.label = P, ce.color = ei(qe), I(), V("change")) : Ee == -1 && H();
+ }
}
- function Ae(E) {
- t(7, q = !1);
- const { detail: D } = E;
- let Y = D.label, be = D.color;
- if (D.ok && w >= 0 && w < u.boxes.length) {
- let J = u.boxes[w];
- J.label = Y, J.color = No(be), B(), I("change");
+ function k(A) {
+ t(9, L = !1);
+ const { detail: T } = A;
+ let P = T.label, qe = T.color, Ee = T.ret;
+ if (p >= 0 && p < c.boxes.length) {
+ let ce = c.boxes[p];
+ Ee == 1 ? (ce.label = P, ce.color = ei(qe), I(), V("change")) : H();
}
}
- function Le() {
- w >= 0 && w < u.boxes.length && (u.boxes.splice(w, 1), W(-1), I("change"));
+ function H() {
+ p >= 0 && p < c.boxes.length && (c.boxes.splice(p, 1), Q(-1), V("change"));
}
- function Ce() {
+ function O() {
if (h) {
- if (y = 1, t(5, h.width = h.clientWidth, h), m !== null)
- if (m.width > h.width)
- y = h.width / m.width, z = m.width * y, v = m.height * y, k = 0, g = 0, S = z, M = v, t(5, h.height = v, h);
+ if (v = 1, t(5, h.width = h.clientWidth, h), g !== null)
+ if (g.width > h.width)
+ v = h.width / g.width, E = g.width * v, F = g.height * v, C = 0, z = 0, y = E, q = F, t(5, h.height = F, h);
else {
- z = m.width, v = m.height;
- var E = (h.width - z) / 2;
- k = E, g = 0, S = E + z, M = m.height, t(5, h.height = v, h);
+ E = g.width, F = g.height;
+ var A = (h.width - E) / 2;
+ C = A, z = 0, y = A + E, q = g.height, t(5, h.height = F, h);
}
else
- k = 0, g = 0, S = h.width, M = h.height, t(5, h.height = h.clientHeight, h);
- if (S > 0 && M > 0)
- for (const D of u.boxes)
- D.canvasXmin = k, D.canvasYmin = g, D.canvasXmax = S, D.canvasYmax = M, D.setScaleFactor(y);
- B(), I("change");
- }
- }
- const A = new ResizeObserver(Ce);
- function Ve() {
- for (let E = 0; E < u.boxes.length; E++) {
- let D = u.boxes[E];
- if (!(D instanceof Vl)) {
- let Y = "", be = "";
- D.hasOwnProperty("color") ? (Y = D.color, Array.isArray(Y) && Y.length === 3 && (Y = `rgb(${Y[0]}, ${Y[1]}, ${Y[2]})`)) : Y = Oe[E % Oe.length], D.hasOwnProperty("label") && (be = D.label), D = new Vl(B, k, g, S, M, be, D.xmin, D.ymin, D.xmax, D.ymax, Y, o, a, r, s, f), t(0, u.boxes[E] = D, u);
+ C = 0, z = 0, y = h.width, q = h.height, t(5, h.height = h.clientHeight, h);
+ if (y > 0 && q > 0)
+ for (const T of c.boxes)
+ T.canvasXmin = C, T.canvasYmin = z, T.canvasXmax = y, T.canvasYmax = q, T.setScaleFactor(v);
+ I(), V("change");
+ }
+ }
+ const G = new ResizeObserver(O);
+ function S() {
+ for (let A = 0; A < c.boxes.length; A++) {
+ let T = c.boxes[A];
+ if (!(T instanceof Ql)) {
+ let P = "", qe = "";
+ T.hasOwnProperty("color") ? (P = T.color, Array.isArray(P) && P.length === 3 && (P = `rgb(${P[0]}, ${P[1]}, ${P[2]})`)) : P = Ut[A % Ut.length], T.hasOwnProperty("label") && (qe = T.label), T = new Ql(I, Fe, C, z, y, q, qe, T.xmin, T.ymin, T.xmax, T.ymax, P, a, r, o, f, u), t(0, c.boxes[A] = T, c);
}
}
}
- function p() {
- n !== null && (m === null || m.src != n) && (m = new Image(), m.src = n, m.onload = function() {
- Ce(), B();
+ function be() {
+ i !== null && (g === null || g.src != i) && (g = new Image(), g.src = i, g.onload = function() {
+ O(), I();
});
}
- t0(() => {
- if (Array.isArray(c) && c.length > 0 && (!Array.isArray(_) || _.length == 0))
- for (let E = 0; E < c.length; E++) {
- let D = Oe[E % Oe.length];
- _.push(wn(D));
+ f1(() => {
+ if (Array.isArray(d) && d.length > 0 && (!Array.isArray(_) || _.length == 0))
+ for (let A = 0; A < d.length; A++) {
+ let T = Ut[A % Ut.length];
+ _.push(Cn(T));
}
- b = h.getContext("2d"), A.observe(h), p(), Ce(), B();
+ w = h.getContext("2d"), G.observe(h), be(), O(), I();
});
- function F() {
- document.addEventListener("keydown", X);
+ function ge() {
+ document.addEventListener("keydown", re);
}
- function Z() {
- document.removeEventListener("keydown", X);
+ function ze() {
+ document.removeEventListener("keydown", re);
}
- n0(() => {
- document.removeEventListener("keydown", X);
+ u1(() => {
+ document.removeEventListener("keydown", re);
});
- function K(E) {
- Jd[E ? "unshift" : "push"](() => {
- h = E, t(5, h);
+ function we(A) {
+ s1[A ? "unshift" : "push"](() => {
+ h = A, t(5, h);
});
}
- const C = () => ee(), Se = () => L(), he = () => Le();
- function ze(E) {
- Io.call(this, l, E);
+ const oe = () => fe(), ue = () => Se();
+ function mt(A) {
+ Ns.call(this, l, A);
}
- function me(E) {
- Io.call(this, l, E);
+ function Sl(A) {
+ Ns.call(this, l, A);
}
- return l.$$set = (E) => {
- "imageUrl" in E && t(19, n = E.imageUrl), "interactive" in E && t(1, i = E.interactive), "boxAlpha" in E && t(20, o = E.boxAlpha), "boxMinSize" in E && t(21, a = E.boxMinSize), "handleSize" in E && t(22, r = E.handleSize), "boxThickness" in E && t(23, s = E.boxThickness), "boxSelectedThickness" in E && t(24, f = E.boxSelectedThickness), "value" in E && t(0, u = E.value), "choices" in E && t(2, c = E.choices), "choicesColors" in E && t(3, _ = E.choicesColors), "disableEditBoxes" in E && t(4, d = E.disableEditBoxes);
+ return l.$$set = (A) => {
+ "imageUrl" in A && t(19, i = A.imageUrl), "interactive" in A && t(1, s = A.interactive), "boxAlpha" in A && t(20, a = A.boxAlpha), "boxMinSize" in A && t(21, r = A.boxMinSize), "handleSize" in A && t(22, o = A.handleSize), "boxThickness" in A && t(23, f = A.boxThickness), "boxSelectedThickness" in A && t(24, u = A.boxSelectedThickness), "value" in A && t(0, c = A.value), "choices" in A && t(2, d = A.choices), "choicesColors" in A && t(3, _ = A.choicesColors), "disableEditBoxes" in A && t(25, b = A.disableEditBoxes);
}, l.$$.update = () => {
l.$$.dirty[0] & /*value*/
- 1 && (p(), Ve(), Ce(), B());
+ 1 && (be(), S(), O(), I());
}, [
- u,
- i,
c,
- _,
+ s,
d,
+ _,
+ n,
h,
- w,
- q,
- R,
- H,
- le,
- ee,
- ye,
+ p,
+ m,
+ X,
L,
- de,
- Ae,
- Le,
- F,
- Z,
- n,
- o,
+ W,
+ ae,
+ fe,
+ Se,
+ B,
+ Ze,
+ k,
+ ge,
+ ze,
+ i,
a,
r,
- s,
+ o,
f,
- K,
- C,
- Se,
- he,
- ze,
- me
+ u,
+ b,
+ we,
+ oe,
+ ue,
+ mt,
+ Sl
];
}
-class s0 extends Gd {
+class h1 extends i1 {
constructor(e) {
- super(), xd(
+ super(), a1(
this,
e,
- o0,
- i0,
- e0,
+ d1,
+ _1,
+ r1,
{
imageUrl: 19,
interactive: 1,
@@ -7227,7 +7344,7 @@ class s0 extends Gd {
value: 0,
choices: 2,
choicesColors: 3,
- disableEditBoxes: 4
+ disableEditBoxes: 25
},
null,
[-1, -1]
@@ -7235,24 +7352,24 @@ class s0 extends Gd {
}
}
const {
- SvelteComponent: a0,
- add_flush_callback: r0,
- bind: f0,
- binding_callbacks: u0,
- create_component: c0,
- destroy_component: _0,
- init: d0,
- mount_component: h0,
- safe_not_equal: m0,
- transition_in: b0,
- transition_out: g0
-} = window.__gradio__svelte__internal, { createEventDispatcher: w0 } = window.__gradio__svelte__internal;
-function p0(l) {
+ SvelteComponent: m1,
+ add_flush_callback: b1,
+ bind: g1,
+ binding_callbacks: w1,
+ create_component: p1,
+ destroy_component: k1,
+ init: v1,
+ mount_component: y1,
+ safe_not_equal: C1,
+ transition_in: S1,
+ transition_out: z1
+} = window.__gradio__svelte__internal, { createEventDispatcher: q1 } = window.__gradio__svelte__internal;
+function E1(l) {
let e, t, n;
function i(a) {
l[14](a);
}
- let o = {
+ let s = {
interactive: (
/*interactive*/
l[1]
@@ -7296,96 +7413,96 @@ function p0(l) {
};
return (
/*value*/
- l[0] !== void 0 && (o.value = /*value*/
- l[0]), e = new s0({ props: o }), u0.push(() => f0(e, "value", i)), e.$on(
+ l[0] !== void 0 && (s.value = /*value*/
+ l[0]), e = new h1({ props: s }), w1.push(() => g1(e, "value", i)), e.$on(
"change",
/*change_handler*/
l[15]
), {
c() {
- c0(e.$$.fragment);
+ p1(e.$$.fragment);
},
m(a, r) {
- h0(e, a, r), n = !0;
+ y1(e, a, r), n = !0;
},
p(a, [r]) {
- const s = {};
+ const o = {};
r & /*interactive*/
- 2 && (s.interactive = /*interactive*/
+ 2 && (o.interactive = /*interactive*/
a[1]), r & /*boxesAlpha*/
- 4 && (s.boxAlpha = /*boxesAlpha*/
+ 4 && (o.boxAlpha = /*boxesAlpha*/
a[2]), r & /*labelList*/
- 8 && (s.choices = /*labelList*/
+ 8 && (o.choices = /*labelList*/
a[3]), r & /*labelColors*/
- 16 && (s.choicesColors = /*labelColors*/
+ 16 && (o.choicesColors = /*labelColors*/
a[4]), r & /*boxMinSize*/
- 32 && (s.boxMinSize = /*boxMinSize*/
+ 32 && (o.boxMinSize = /*boxMinSize*/
a[5]), r & /*handleSize*/
- 64 && (s.handleSize = /*handleSize*/
+ 64 && (o.handleSize = /*handleSize*/
a[6]), r & /*boxThickness*/
- 128 && (s.boxThickness = /*boxThickness*/
+ 128 && (o.boxThickness = /*boxThickness*/
a[7]), r & /*boxSelectedThickness*/
- 256 && (s.boxSelectedThickness = /*boxSelectedThickness*/
+ 256 && (o.boxSelectedThickness = /*boxSelectedThickness*/
a[8]), r & /*disableEditBoxes*/
- 512 && (s.disableEditBoxes = /*disableEditBoxes*/
+ 512 && (o.disableEditBoxes = /*disableEditBoxes*/
a[9]), r & /*resolved_src*/
- 1024 && (s.imageUrl = /*resolved_src*/
+ 1024 && (o.imageUrl = /*resolved_src*/
a[10]), !t && r & /*value*/
- 1 && (t = !0, s.value = /*value*/
- a[0], r0(() => t = !1)), e.$set(s);
+ 1 && (t = !0, o.value = /*value*/
+ a[0], b1(() => t = !1)), e.$set(o);
},
i(a) {
- n || (b0(e.$$.fragment, a), n = !0);
+ n || (S1(e.$$.fragment, a), n = !0);
},
o(a) {
- g0(e.$$.fragment, a), n = !1;
+ z1(e.$$.fragment, a), n = !1;
},
d(a) {
- _0(e, a);
+ k1(e, a);
}
}
);
}
-function k0(l, e, t) {
- let { src: n = void 0 } = e, { interactive: i } = e, { boxesAlpha: o } = e, { labelList: a } = e, { labelColors: r } = e, { boxMinSize: s } = e, { handleSize: f } = e, { boxThickness: u } = e, { boxSelectedThickness: c } = e, { value: _ } = e, { disableEditBoxes: d } = e, h, b;
- const m = w0();
- function w(g) {
- _ = g, t(0, _);
+function A1(l, e, t) {
+ let { src: n = void 0 } = e, { interactive: i } = e, { boxesAlpha: s } = e, { labelList: a } = e, { labelColors: r } = e, { boxMinSize: o } = e, { handleSize: f } = e, { boxThickness: u } = e, { boxSelectedThickness: c } = e, { value: d } = e, { disableEditBoxes: _ } = e, b, h;
+ const w = q1();
+ function g(m) {
+ d = m, t(0, d);
}
- const k = () => m("change");
- return l.$$set = (g) => {
- "src" in g && t(12, n = g.src), "interactive" in g && t(1, i = g.interactive), "boxesAlpha" in g && t(2, o = g.boxesAlpha), "labelList" in g && t(3, a = g.labelList), "labelColors" in g && t(4, r = g.labelColors), "boxMinSize" in g && t(5, s = g.boxMinSize), "handleSize" in g && t(6, f = g.handleSize), "boxThickness" in g && t(7, u = g.boxThickness), "boxSelectedThickness" in g && t(8, c = g.boxSelectedThickness), "value" in g && t(0, _ = g.value), "disableEditBoxes" in g && t(9, d = g.disableEditBoxes);
+ const p = () => w("change");
+ return l.$$set = (m) => {
+ "src" in m && t(12, n = m.src), "interactive" in m && t(1, i = m.interactive), "boxesAlpha" in m && t(2, s = m.boxesAlpha), "labelList" in m && t(3, a = m.labelList), "labelColors" in m && t(4, r = m.labelColors), "boxMinSize" in m && t(5, o = m.boxMinSize), "handleSize" in m && t(6, f = m.handleSize), "boxThickness" in m && t(7, u = m.boxThickness), "boxSelectedThickness" in m && t(8, c = m.boxSelectedThickness), "value" in m && t(0, d = m.value), "disableEditBoxes" in m && t(9, _ = m.disableEditBoxes);
}, l.$$.update = () => {
if (l.$$.dirty & /*src, latest_src*/
12288) {
- t(10, h = n), t(13, b = n);
- const g = n;
- Mc(g).then((S) => {
- b === g && t(10, h = S);
+ t(10, b = n), t(13, h = n);
+ const m = n;
+ qc(m).then((C) => {
+ h === m && t(10, b = C);
});
}
}, [
- _,
+ d,
i,
- o,
+ s,
a,
r,
- s,
+ o,
f,
u,
c,
- d,
- h,
- m,
- n,
+ _,
b,
w,
- k
+ n,
+ h,
+ g,
+ p
];
}
-class $s extends a0 {
+class sa extends m1 {
constructor(e) {
- super(), d0(this, e, k0, p0, m0, {
+ super(), v1(this, e, A1, E1, C1, {
src: 12,
interactive: 1,
boxesAlpha: 2,
@@ -7400,43 +7517,43 @@ class $s extends a0 {
});
}
}
-class v0 {
+class B1 {
constructor() {
this.boxes = [];
}
}
const {
- SvelteComponent: y0,
- add_flush_callback: ol,
- append: tn,
- attr: un,
- bind: sl,
- binding_callbacks: pn,
- bubble: Pl,
- check_outros: Ot,
- create_component: rt,
- create_slot: C0,
- destroy_component: ft,
- detach: yt,
- element: hn,
- empty: S0,
- get_all_dirty_from_scope: z0,
- get_slot_changes: q0,
- group_outros: Xt,
- init: E0,
- insert: Ct,
- mount_component: ut,
- noop: M0,
- safe_not_equal: B0,
- space: Ht,
- toggle_class: Oo,
- transition_in: O,
- transition_out: G,
- update_slot_base: A0
-} = window.__gradio__svelte__internal, { createEventDispatcher: L0 } = window.__gradio__svelte__internal;
-function Xo(l) {
+ SvelteComponent: M1,
+ add_flush_callback: _l,
+ append: an,
+ attr: wn,
+ bind: dl,
+ binding_callbacks: Sn,
+ bubble: ti,
+ check_outros: Zt,
+ create_component: _t,
+ create_slot: L1,
+ destroy_component: dt,
+ detach: qt,
+ element: yn,
+ empty: D1,
+ get_all_dirty_from_scope: T1,
+ get_slot_changes: R1,
+ group_outros: Kt,
+ init: j1,
+ insert: Et,
+ mount_component: ht,
+ noop: I1,
+ safe_not_equal: F1,
+ space: Nt,
+ toggle_class: Ps,
+ transition_in: N,
+ transition_out: J,
+ update_slot_base: H1
+} = window.__gradio__svelte__internal, { createEventDispatcher: X1 } = window.__gradio__svelte__internal;
+function Zs(l) {
let e, t;
- return e = new Oc({
+ return e = new Xc({
props: {
href: (
/*value*/
@@ -7446,42 +7563,42 @@ function Xo(l) {
/*value*/
l[1].image.orig_name || "image"
),
- $$slots: { default: [D0] },
+ $$slots: { default: [Y1] },
$$scope: { ctx: l }
}
}), {
c() {
- rt(e.$$.fragment);
+ _t(e.$$.fragment);
},
m(n, i) {
- ut(e, n, i), t = !0;
+ ht(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*value*/
- 2 && (o.href = /*value*/
+ 2 && (s.href = /*value*/
n[1].image.url), i[0] & /*value*/
- 2 && (o.download = /*value*/
+ 2 && (s.download = /*value*/
n[1].image.orig_name || "image"), i[0] & /*i18n*/
256 | i[1] & /*$$scope*/
- 2048 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 2048 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
},
i(n) {
- t || (O(e.$$.fragment, n), t = !0);
+ t || (N(e.$$.fragment, n), t = !0);
},
o(n) {
- G(e.$$.fragment, n), t = !1;
+ J(e.$$.fragment, n), t = !1;
},
d(n) {
- ft(e, n);
+ dt(e, n);
}
};
}
-function D0(l) {
+function Y1(l) {
let e, t;
- return e = new al({
+ return e = new hl({
props: {
- Icon: mf,
+ Icon: vf,
label: (
/*i18n*/
l[8]("common.download")
@@ -7489,31 +7606,31 @@ function D0(l) {
}
}), {
c() {
- rt(e.$$.fragment);
+ _t(e.$$.fragment);
},
m(n, i) {
- ut(e, n, i), t = !0;
+ ht(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*i18n*/
- 256 && (o.label = /*i18n*/
- n[8]("common.download")), e.$set(o);
+ 256 && (s.label = /*i18n*/
+ n[8]("common.download")), e.$set(s);
},
i(n) {
- t || (O(e.$$.fragment, n), t = !0);
+ t || (N(e.$$.fragment, n), t = !0);
},
o(n) {
- G(e.$$.fragment, n), t = !1;
+ J(e.$$.fragment, n), t = !1;
},
d(n) {
- ft(e, n);
+ dt(e, n);
}
};
}
-function Yo(l) {
+function Ks(l) {
let e, t;
- return e = new zu({
+ return e = new Cu({
props: {
i18n: (
/*i18n*/
@@ -7538,63 +7655,63 @@ function Yo(l) {
l[34]
), {
c() {
- rt(e.$$.fragment);
+ _t(e.$$.fragment);
},
m(n, i) {
- ut(e, n, i), t = !0;
+ ht(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*i18n*/
- 256 && (o.i18n = /*i18n*/
+ 256 && (s.i18n = /*i18n*/
n[8]), i[0] & /*value*/
- 2 && (o.value = /*value*/
- n[1]), e.$set(o);
+ 2 && (s.value = /*value*/
+ n[1]), e.$set(s);
},
i(n) {
- t || (O(e.$$.fragment, n), t = !0);
+ t || (N(e.$$.fragment, n), t = !0);
},
o(n) {
- G(e.$$.fragment, n), t = !1;
+ J(e.$$.fragment, n), t = !1;
},
d(n) {
- ft(e, n);
+ dt(e, n);
}
};
}
-function Wo(l) {
+function Gs(l) {
let e, t, n;
- return t = new al({
- props: { Icon: ci, label: "Remove Image" }
+ return t = new hl({
+ props: { Icon: ro, label: "Remove Image" }
}), t.$on(
"click",
/*clear*/
l[30]
), {
c() {
- e = hn("div"), rt(t.$$.fragment);
+ e = yn("div"), _t(t.$$.fragment);
},
- m(i, o) {
- Ct(i, e, o), ut(t, e, null), n = !0;
+ m(i, s) {
+ Et(i, e, s), ht(t, e, null), n = !0;
},
- p: M0,
+ p: I1,
i(i) {
- n || (O(t.$$.fragment, i), n = !0);
+ n || (N(t.$$.fragment, i), n = !0);
},
o(i) {
- G(t.$$.fragment, i), n = !1;
+ J(t.$$.fragment, i), n = !1;
},
d(i) {
- i && yt(e), ft(t);
+ i && qt(e), dt(t);
}
};
}
-function Vo(l) {
+function Js(l) {
let e;
const t = (
/*#slots*/
l[31].default
- ), n = C0(
+ ), n = L1(
t,
l,
/*$$scope*/
@@ -7605,24 +7722,24 @@ function Vo(l) {
c() {
n && n.c();
},
- m(i, o) {
- n && n.m(i, o), e = !0;
+ m(i, s) {
+ n && n.m(i, s), e = !0;
},
- p(i, o) {
- n && n.p && (!e || o[1] & /*$$scope*/
- 2048) && A0(
+ p(i, s) {
+ n && n.p && (!e || s[1] & /*$$scope*/
+ 2048) && H1(
n,
t,
i,
/*$$scope*/
i[42],
- e ? q0(
+ e ? R1(
t,
/*$$scope*/
i[42],
- o,
+ s,
null
- ) : z0(
+ ) : T1(
/*$$scope*/
i[42]
),
@@ -7630,49 +7747,49 @@ function Vo(l) {
);
},
i(i) {
- e || (O(n, i), e = !0);
+ e || (N(n, i), e = !0);
},
o(i) {
- G(n, i), e = !1;
+ J(n, i), e = !1;
},
d(i) {
n && n.d(i);
}
};
}
-function T0(l) {
+function U1(l) {
let e, t, n = (
/*value*/
- l[1] === null && Vo(l)
+ l[1] === null && Js(l)
);
return {
c() {
- n && n.c(), e = S0();
+ n && n.c(), e = D1();
},
- m(i, o) {
- n && n.m(i, o), Ct(i, e, o), t = !0;
+ m(i, s) {
+ n && n.m(i, s), Et(i, e, s), t = !0;
},
- p(i, o) {
+ p(i, s) {
/*value*/
- i[1] === null ? n ? (n.p(i, o), o[0] & /*value*/
- 2 && O(n, 1)) : (n = Vo(i), n.c(), O(n, 1), n.m(e.parentNode, e)) : n && (Xt(), G(n, 1, 1, () => {
+ i[1] === null ? n ? (n.p(i, s), s[0] & /*value*/
+ 2 && N(n, 1)) : (n = Js(i), n.c(), N(n, 1), n.m(e.parentNode, e)) : n && (Kt(), J(n, 1, 1, () => {
n = null;
- }), Ot());
+ }), Zt());
},
i(i) {
- t || (O(n), t = !0);
+ t || (N(n), t = !0);
},
o(i) {
- G(n), t = !1;
+ J(n), t = !1;
},
d(i) {
- i && yt(e), n && n.d(i);
+ i && qt(e), n && n.d(i);
}
};
}
-function Po(l) {
+function Qs(l) {
let e, t, n, i;
- function o(r) {
+ function s(r) {
l[39](r);
}
let a = {
@@ -7720,48 +7837,48 @@ function Po(l) {
return (
/*value*/
l[1] !== void 0 && (a.value = /*value*/
- l[1]), t = new $s({ props: a }), pn.push(() => sl(t, "value", o)), t.$on(
+ l[1]), t = new sa({ props: a }), Sn.push(() => dl(t, "value", s)), t.$on(
"change",
/*change_handler*/
l[40]
), {
c() {
- e = hn("div"), rt(t.$$.fragment), un(e, "class", "image-frame svelte-1gjdske"), Oo(
+ e = yn("div"), _t(t.$$.fragment), wn(e, "class", "image-frame svelte-1gjdske"), Ps(
e,
"selectable",
/*selectable*/
l[5]
);
},
- m(r, s) {
- Ct(r, e, s), ut(t, e, null), i = !0;
+ m(r, o) {
+ Et(r, e, o), ht(t, e, null), i = !0;
},
- p(r, s) {
+ p(r, o) {
const f = {};
- s[0] & /*boxesAlpha*/
+ o[0] & /*boxesAlpha*/
4096 && (f.boxesAlpha = /*boxesAlpha*/
- r[12]), s[0] & /*labelList*/
+ r[12]), o[0] & /*labelList*/
8192 && (f.labelList = /*labelList*/
- r[13]), s[0] & /*labelColors*/
+ r[13]), o[0] & /*labelColors*/
16384 && (f.labelColors = /*labelColors*/
- r[14]), s[0] & /*boxMinSize*/
+ r[14]), o[0] & /*boxMinSize*/
32768 && (f.boxMinSize = /*boxMinSize*/
- r[15]), s[0] & /*interactive*/
+ r[15]), o[0] & /*interactive*/
128 && (f.interactive = /*interactive*/
- r[7]), s[0] & /*handleSize*/
+ r[7]), o[0] & /*handleSize*/
65536 && (f.handleSize = /*handleSize*/
- r[16]), s[0] & /*boxThickness*/
+ r[16]), o[0] & /*boxThickness*/
131072 && (f.boxThickness = /*boxThickness*/
- r[17]), s[0] & /*disableEditBoxes*/
+ r[17]), o[0] & /*disableEditBoxes*/
262144 && (f.disableEditBoxes = /*disableEditBoxes*/
- r[18]), s[0] & /*boxSelectedThickness*/
+ r[18]), o[0] & /*boxSelectedThickness*/
524288 && (f.boxSelectedThickness = /*boxSelectedThickness*/
- r[19]), s[0] & /*value*/
+ r[19]), o[0] & /*value*/
2 && (f.src = /*value*/
- r[1].image.url), !n && s[0] & /*value*/
+ r[1].image.url), !n && o[0] & /*value*/
2 && (n = !0, f.value = /*value*/
- r[1], ol(() => n = !1)), t.$set(f), (!i || s[0] & /*selectable*/
- 32) && Oo(
+ r[1], _l(() => n = !1)), t.$set(f), (!i || o[0] & /*selectable*/
+ 32) && Ps(
e,
"selectable",
/*selectable*/
@@ -7769,23 +7886,23 @@ function Po(l) {
);
},
i(r) {
- i || (O(t.$$.fragment, r), i = !0);
+ i || (N(t.$$.fragment, r), i = !0);
},
o(r) {
- G(t.$$.fragment, r), i = !1;
+ J(t.$$.fragment, r), i = !1;
},
d(r) {
- r && yt(e), ft(t);
+ r && qt(e), dt(t);
}
}
);
}
-function Zo(l) {
+function xs(l) {
let e, t, n;
function i(a) {
l[41](a);
}
- let o = {
+ let s = {
sources: (
/*sources*/
l[4]
@@ -7801,76 +7918,76 @@ function Zo(l) {
};
return (
/*active_source*/
- l[0] !== void 0 && (o.active_source = /*active_source*/
- l[0]), e = new Ou({ props: o }), pn.push(() => sl(e, "active_source", i)), {
+ l[0] !== void 0 && (s.active_source = /*active_source*/
+ l[0]), e = new Xu({ props: s }), Sn.push(() => dl(e, "active_source", i)), {
c() {
- rt(e.$$.fragment);
+ _t(e.$$.fragment);
},
m(a, r) {
- ut(e, a, r), n = !0;
+ ht(e, a, r), n = !0;
},
p(a, r) {
- const s = {};
+ const o = {};
r[0] & /*sources*/
- 16 && (s.sources = /*sources*/
+ 16 && (o.sources = /*sources*/
a[4]), !t && r[0] & /*active_source*/
- 1 && (t = !0, s.active_source = /*active_source*/
- a[0], ol(() => t = !1)), e.$set(s);
+ 1 && (t = !0, o.active_source = /*active_source*/
+ a[0], _l(() => t = !1)), e.$set(o);
},
i(a) {
- n || (O(e.$$.fragment, a), n = !0);
+ n || (N(e.$$.fragment, a), n = !0);
},
o(a) {
- G(e.$$.fragment, a), n = !1;
+ J(e.$$.fragment, a), n = !1;
},
d(a) {
- ft(e, a);
+ dt(e, a);
}
}
);
}
-function j0(l) {
- let e, t, n, i, o, a, r, s, f, u, c, _, d, h = (
+function N1(l) {
+ let e, t, n, i, s, a, r, o, f, u, c, d, _, b = (
/*sources*/
(l[4].length > 1 || /*sources*/
l[4].includes("clipboard")) && /*value*/
l[1] === null && /*interactive*/
l[7]
- ), b;
- e = new mr({
+ ), h;
+ e = new vr({
props: {
show_label: (
/*show_label*/
l[3]
),
- Icon: ls,
+ Icon: fo,
label: (
/*label*/
l[2] || "Image Annotator"
)
}
});
- let m = (
+ let w = (
/*showDownloadButton*/
l[10] && /*value*/
- l[1] !== null && Xo(l)
- ), w = (
+ l[1] !== null && Zs(l)
+ ), g = (
/*showShareButton*/
l[9] && /*value*/
- l[1] !== null && Yo(l)
- ), k = (
+ l[1] !== null && Ks(l)
+ ), p = (
/*showClearButton*/
l[11] && /*value*/
l[1] !== null && /*interactive*/
- l[7] && Wo(l)
+ l[7] && Gs(l)
);
- function g(v) {
+ function m(v) {
l[36](v);
}
- function S(v) {
+ function C(v) {
l[37](v);
}
- let M = {
+ let z = {
hidden: (
/*value*/
l[1] !== null
@@ -7897,14 +8014,14 @@ function j0(l) {
/*stream_handler*/
l[22]
),
- $$slots: { default: [T0] },
+ $$slots: { default: [U1] },
$$scope: { ctx: l }
};
/*uploading*/
- l[23] !== void 0 && (M.uploading = /*uploading*/
+ l[23] !== void 0 && (z.uploading = /*uploading*/
l[23]), /*dragging*/
- l[24] !== void 0 && (M.dragging = /*dragging*/
- l[24]), f = new v_({ props: M }), l[35](f), pn.push(() => sl(f, "uploading", g)), pn.push(() => sl(f, "dragging", S)), f.$on(
+ l[24] !== void 0 && (z.dragging = /*dragging*/
+ l[24]), f = new p_({ props: z }), l[35](f), Sn.push(() => dl(f, "uploading", m)), Sn.push(() => dl(f, "dragging", C)), f.$on(
"load",
/*handle_upload*/
l[26]
@@ -7915,223 +8032,223 @@ function j0(l) {
);
let y = (
/*value*/
- l[1] !== null && Po(l)
- ), z = h && Zo(l);
+ l[1] !== null && Qs(l)
+ ), q = b && xs(l);
return {
c() {
- rt(e.$$.fragment), t = Ht(), n = hn("div"), m && m.c(), i = Ht(), w && w.c(), o = Ht(), k && k.c(), a = Ht(), r = hn("div"), s = hn("div"), rt(f.$$.fragment), _ = Ht(), y && y.c(), d = Ht(), z && z.c(), un(n, "class", "icon-buttons svelte-1gjdske"), un(s, "class", "upload-container svelte-1gjdske"), un(r, "data-testid", "image"), un(r, "class", "image-container svelte-1gjdske");
- },
- m(v, q) {
- ut(e, v, q), Ct(v, t, q), Ct(v, n, q), m && m.m(n, null), tn(n, i), w && w.m(n, null), tn(n, o), k && k.m(n, null), Ct(v, a, q), Ct(v, r, q), tn(r, s), ut(f, s, null), tn(s, _), y && y.m(s, null), tn(r, d), z && z.m(r, null), b = !0;
- },
- p(v, q) {
- const R = {};
- q[0] & /*show_label*/
- 8 && (R.show_label = /*show_label*/
- v[3]), q[0] & /*label*/
- 4 && (R.label = /*label*/
- v[2] || "Image Annotator"), e.$set(R), /*showDownloadButton*/
+ _t(e.$$.fragment), t = Nt(), n = yn("div"), w && w.c(), i = Nt(), g && g.c(), s = Nt(), p && p.c(), a = Nt(), r = yn("div"), o = yn("div"), _t(f.$$.fragment), d = Nt(), y && y.c(), _ = Nt(), q && q.c(), wn(n, "class", "icon-buttons svelte-1gjdske"), wn(o, "class", "upload-container svelte-1gjdske"), wn(r, "data-testid", "image"), wn(r, "class", "image-container svelte-1gjdske");
+ },
+ m(v, E) {
+ ht(e, v, E), Et(v, t, E), Et(v, n, E), w && w.m(n, null), an(n, i), g && g.m(n, null), an(n, s), p && p.m(n, null), Et(v, a, E), Et(v, r, E), an(r, o), ht(f, o, null), an(o, d), y && y.m(o, null), an(r, _), q && q.m(r, null), h = !0;
+ },
+ p(v, E) {
+ const F = {};
+ E[0] & /*show_label*/
+ 8 && (F.show_label = /*show_label*/
+ v[3]), E[0] & /*label*/
+ 4 && (F.label = /*label*/
+ v[2] || "Image Annotator"), e.$set(F), /*showDownloadButton*/
v[10] && /*value*/
- v[1] !== null ? m ? (m.p(v, q), q[0] & /*showDownloadButton, value*/
- 1026 && O(m, 1)) : (m = Xo(v), m.c(), O(m, 1), m.m(n, i)) : m && (Xt(), G(m, 1, 1, () => {
- m = null;
- }), Ot()), /*showShareButton*/
- v[9] && /*value*/
- v[1] !== null ? w ? (w.p(v, q), q[0] & /*showShareButton, value*/
- 514 && O(w, 1)) : (w = Yo(v), w.c(), O(w, 1), w.m(n, o)) : w && (Xt(), G(w, 1, 1, () => {
+ v[1] !== null ? w ? (w.p(v, E), E[0] & /*showDownloadButton, value*/
+ 1026 && N(w, 1)) : (w = Zs(v), w.c(), N(w, 1), w.m(n, i)) : w && (Kt(), J(w, 1, 1, () => {
w = null;
- }), Ot()), /*showClearButton*/
+ }), Zt()), /*showShareButton*/
+ v[9] && /*value*/
+ v[1] !== null ? g ? (g.p(v, E), E[0] & /*showShareButton, value*/
+ 514 && N(g, 1)) : (g = Ks(v), g.c(), N(g, 1), g.m(n, s)) : g && (Kt(), J(g, 1, 1, () => {
+ g = null;
+ }), Zt()), /*showClearButton*/
v[11] && /*value*/
v[1] !== null && /*interactive*/
- v[7] ? k ? (k.p(v, q), q[0] & /*showClearButton, value, interactive*/
- 2178 && O(k, 1)) : (k = Wo(v), k.c(), O(k, 1), k.m(n, null)) : k && (Xt(), G(k, 1, 1, () => {
- k = null;
- }), Ot());
- const I = {};
- q[0] & /*value*/
- 2 && (I.hidden = /*value*/
- v[1] !== null), q[0] & /*active_source*/
- 1 && (I.filetype = /*active_source*/
- v[0] === "clipboard" ? "clipboard" : "image/*"), q[0] & /*root*/
- 64 && (I.root = /*root*/
- v[6]), q[0] & /*max_file_size*/
- 1048576 && (I.max_file_size = /*max_file_size*/
- v[20]), q[0] & /*sources*/
- 16 && (I.disable_click = !/*sources*/
- v[4].includes("upload")), q[0] & /*cli_upload*/
- 2097152 && (I.upload = /*cli_upload*/
- v[21]), q[0] & /*stream_handler*/
- 4194304 && (I.stream_handler = /*stream_handler*/
- v[22]), q[0] & /*value*/
- 2 | q[1] & /*$$scope*/
- 2048 && (I.$$scope = { dirty: q, ctx: v }), !u && q[0] & /*uploading*/
- 8388608 && (u = !0, I.uploading = /*uploading*/
- v[23], ol(() => u = !1)), !c && q[0] & /*dragging*/
- 16777216 && (c = !0, I.dragging = /*dragging*/
- v[24], ol(() => c = !1)), f.$set(I), /*value*/
- v[1] !== null ? y ? (y.p(v, q), q[0] & /*value*/
- 2 && O(y, 1)) : (y = Po(v), y.c(), O(y, 1), y.m(s, null)) : y && (Xt(), G(y, 1, 1, () => {
+ v[7] ? p ? (p.p(v, E), E[0] & /*showClearButton, value, interactive*/
+ 2178 && N(p, 1)) : (p = Gs(v), p.c(), N(p, 1), p.m(n, null)) : p && (Kt(), J(p, 1, 1, () => {
+ p = null;
+ }), Zt());
+ const X = {};
+ E[0] & /*value*/
+ 2 && (X.hidden = /*value*/
+ v[1] !== null), E[0] & /*active_source*/
+ 1 && (X.filetype = /*active_source*/
+ v[0] === "clipboard" ? "clipboard" : "image/*"), E[0] & /*root*/
+ 64 && (X.root = /*root*/
+ v[6]), E[0] & /*max_file_size*/
+ 1048576 && (X.max_file_size = /*max_file_size*/
+ v[20]), E[0] & /*sources*/
+ 16 && (X.disable_click = !/*sources*/
+ v[4].includes("upload")), E[0] & /*cli_upload*/
+ 2097152 && (X.upload = /*cli_upload*/
+ v[21]), E[0] & /*stream_handler*/
+ 4194304 && (X.stream_handler = /*stream_handler*/
+ v[22]), E[0] & /*value*/
+ 2 | E[1] & /*$$scope*/
+ 2048 && (X.$$scope = { dirty: E, ctx: v }), !u && E[0] & /*uploading*/
+ 8388608 && (u = !0, X.uploading = /*uploading*/
+ v[23], _l(() => u = !1)), !c && E[0] & /*dragging*/
+ 16777216 && (c = !0, X.dragging = /*dragging*/
+ v[24], _l(() => c = !1)), f.$set(X), /*value*/
+ v[1] !== null ? y ? (y.p(v, E), E[0] & /*value*/
+ 2 && N(y, 1)) : (y = Qs(v), y.c(), N(y, 1), y.m(o, null)) : y && (Kt(), J(y, 1, 1, () => {
y = null;
- }), Ot()), q[0] & /*sources, value, interactive*/
- 146 && (h = /*sources*/
+ }), Zt()), E[0] & /*sources, value, interactive*/
+ 146 && (b = /*sources*/
(v[4].length > 1 || /*sources*/
v[4].includes("clipboard")) && /*value*/
v[1] === null && /*interactive*/
- v[7]), h ? z ? (z.p(v, q), q[0] & /*sources, value, interactive*/
- 146 && O(z, 1)) : (z = Zo(v), z.c(), O(z, 1), z.m(r, null)) : z && (Xt(), G(z, 1, 1, () => {
- z = null;
- }), Ot());
+ v[7]), b ? q ? (q.p(v, E), E[0] & /*sources, value, interactive*/
+ 146 && N(q, 1)) : (q = xs(v), q.c(), N(q, 1), q.m(r, null)) : q && (Kt(), J(q, 1, 1, () => {
+ q = null;
+ }), Zt());
},
i(v) {
- b || (O(e.$$.fragment, v), O(m), O(w), O(k), O(f.$$.fragment, v), O(y), O(z), b = !0);
+ h || (N(e.$$.fragment, v), N(w), N(g), N(p), N(f.$$.fragment, v), N(y), N(q), h = !0);
},
o(v) {
- G(e.$$.fragment, v), G(m), G(w), G(k), G(f.$$.fragment, v), G(y), G(z), b = !1;
+ J(e.$$.fragment, v), J(w), J(g), J(p), J(f.$$.fragment, v), J(y), J(q), h = !1;
},
d(v) {
- v && (yt(t), yt(n), yt(a), yt(r)), ft(e, v), m && m.d(), w && w.d(), k && k.d(), l[35](null), ft(f), y && y.d(), z && z.d();
+ v && (qt(t), qt(n), qt(a), qt(r)), dt(e, v), w && w.d(), g && g.d(), p && p.d(), l[35](null), dt(f), y && y.d(), q && q.d();
}
};
}
-function I0(l, e, t) {
+function V1(l, e, t) {
let { $$slots: n = {}, $$scope: i } = e;
- var o = this && this.__awaiter || function(C, Se, he, ze) {
- function me(E) {
- return E instanceof he ? E : new he(function(D) {
- D(E);
+ var s = this && this.__awaiter || function(S, be, ge, ze) {
+ function we(oe) {
+ return oe instanceof ge ? oe : new ge(function(ue) {
+ ue(oe);
});
}
- return new (he || (he = Promise))(function(E, D) {
- function Y(J) {
+ return new (ge || (ge = Promise))(function(oe, ue) {
+ function mt(T) {
try {
- qe(ze.next(J));
- } catch (Qe) {
- D(Qe);
+ A(ze.next(T));
+ } catch (P) {
+ ue(P);
}
}
- function be(J) {
+ function Sl(T) {
try {
- qe(ze.throw(J));
- } catch (Qe) {
- D(Qe);
+ A(ze.throw(T));
+ } catch (P) {
+ ue(P);
}
}
- function qe(J) {
- J.done ? E(J.value) : me(J.value).then(Y, be);
+ function A(T) {
+ T.done ? oe(T.value) : we(T.value).then(mt, Sl);
}
- qe((ze = ze.apply(C, Se || [])).next());
+ A((ze = ze.apply(S, be || [])).next());
});
};
- let { value: a } = e, { label: r = void 0 } = e, { show_label: s } = e, { sources: f = ["upload", "clipboard"] } = e, { selectable: u = !1 } = e, { root: c } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: h } = e, { showDownloadButton: b } = e, { showClearButton: m } = e, { boxesAlpha: w } = e, { labelList: k } = e, { labelColors: g } = e, { boxMinSize: S } = e, { handleSize: M } = e, { boxThickness: y } = e, { disableEditBoxes: z } = e, { boxSelectedThickness: v } = e, { max_file_size: q = null } = e, { cli_upload: R } = e, { stream_handler: I } = e, B, W = !1, { active_source: H = null } = e;
- function le({ detail: C }) {
- t(1, a = new v0()), t(1, a.image = C, a), ee("upload");
+ let { value: a } = e, { label: r = void 0 } = e, { show_label: o } = e, { sources: f = ["upload", "clipboard"] } = e, { selectable: u = !1 } = e, { root: c } = e, { interactive: d } = e, { i18n: _ } = e, { showShareButton: b } = e, { showDownloadButton: h } = e, { showClearButton: w } = e, { boxesAlpha: g } = e, { labelList: p } = e, { labelColors: m } = e, { boxMinSize: C } = e, { handleSize: z } = e, { boxThickness: y } = e, { disableEditBoxes: q } = e, { boxSelectedThickness: v } = e, { max_file_size: E = null } = e, { cli_upload: F } = e, { stream_handler: X } = e, L, V = !1, { active_source: I = null } = e;
+ function Q({ detail: S }) {
+ t(1, a = new B1()), t(1, a.image = S, a), le("upload");
}
- function X() {
- L(), ee("clear"), ee("change");
+ function W() {
+ D(), le("clear"), le("change");
}
- const ee = L0();
+ const le = X1();
let ae = !1;
- function ye(C) {
- return o(this, void 0, void 0, function* () {
- switch (C) {
+ function re(S) {
+ return s(this, void 0, void 0, function* () {
+ switch (S) {
case "clipboard":
- B.paste_clipboard();
+ L.paste_clipboard();
break;
}
});
}
- function L() {
+ function D() {
t(1, a = null);
}
- const de = async (C) => C === null ? "" : ``;
- function Ae(C) {
- Pl.call(this, l, C);
+ const fe = async (S) => S === null ? "" : ``;
+ function Se(S) {
+ ti.call(this, l, S);
}
- function Le(C) {
- Pl.call(this, l, C);
+ function Fe(S) {
+ ti.call(this, l, S);
}
- function Ce(C) {
- pn[C ? "unshift" : "push"](() => {
- B = C, t(25, B);
+ function Pe(S) {
+ Sn[S ? "unshift" : "push"](() => {
+ L = S, t(25, L);
});
}
- function A(C) {
- W = C, t(23, W);
+ function B(S) {
+ V = S, t(23, V);
}
- function Ve(C) {
- ae = C, t(24, ae);
+ function Ze(S) {
+ ae = S, t(24, ae);
}
- function p(C) {
- Pl.call(this, l, C);
+ function k(S) {
+ ti.call(this, l, S);
}
- function F(C) {
- a = C, t(1, a);
+ function H(S) {
+ a = S, t(1, a);
}
- const Z = () => ee("change");
- function K(C) {
- H = C, t(0, H), t(4, f);
+ const O = () => le("change");
+ function G(S) {
+ I = S, t(0, I), t(4, f);
}
- return l.$$set = (C) => {
- "value" in C && t(1, a = C.value), "label" in C && t(2, r = C.label), "show_label" in C && t(3, s = C.show_label), "sources" in C && t(4, f = C.sources), "selectable" in C && t(5, u = C.selectable), "root" in C && t(6, c = C.root), "interactive" in C && t(7, _ = C.interactive), "i18n" in C && t(8, d = C.i18n), "showShareButton" in C && t(9, h = C.showShareButton), "showDownloadButton" in C && t(10, b = C.showDownloadButton), "showClearButton" in C && t(11, m = C.showClearButton), "boxesAlpha" in C && t(12, w = C.boxesAlpha), "labelList" in C && t(13, k = C.labelList), "labelColors" in C && t(14, g = C.labelColors), "boxMinSize" in C && t(15, S = C.boxMinSize), "handleSize" in C && t(16, M = C.handleSize), "boxThickness" in C && t(17, y = C.boxThickness), "disableEditBoxes" in C && t(18, z = C.disableEditBoxes), "boxSelectedThickness" in C && t(19, v = C.boxSelectedThickness), "max_file_size" in C && t(20, q = C.max_file_size), "cli_upload" in C && t(21, R = C.cli_upload), "stream_handler" in C && t(22, I = C.stream_handler), "active_source" in C && t(0, H = C.active_source), "$$scope" in C && t(42, i = C.$$scope);
+ return l.$$set = (S) => {
+ "value" in S && t(1, a = S.value), "label" in S && t(2, r = S.label), "show_label" in S && t(3, o = S.show_label), "sources" in S && t(4, f = S.sources), "selectable" in S && t(5, u = S.selectable), "root" in S && t(6, c = S.root), "interactive" in S && t(7, d = S.interactive), "i18n" in S && t(8, _ = S.i18n), "showShareButton" in S && t(9, b = S.showShareButton), "showDownloadButton" in S && t(10, h = S.showDownloadButton), "showClearButton" in S && t(11, w = S.showClearButton), "boxesAlpha" in S && t(12, g = S.boxesAlpha), "labelList" in S && t(13, p = S.labelList), "labelColors" in S && t(14, m = S.labelColors), "boxMinSize" in S && t(15, C = S.boxMinSize), "handleSize" in S && t(16, z = S.handleSize), "boxThickness" in S && t(17, y = S.boxThickness), "disableEditBoxes" in S && t(18, q = S.disableEditBoxes), "boxSelectedThickness" in S && t(19, v = S.boxSelectedThickness), "max_file_size" in S && t(20, E = S.max_file_size), "cli_upload" in S && t(21, F = S.cli_upload), "stream_handler" in S && t(22, X = S.stream_handler), "active_source" in S && t(0, I = S.active_source), "$$scope" in S && t(42, i = S.$$scope);
}, l.$$.update = () => {
l.$$.dirty[0] & /*uploading*/
- 8388608 && W && L(), l.$$.dirty[0] & /*dragging*/
- 16777216 && ee("drag", ae), l.$$.dirty[0] & /*active_source, sources*/
- 17 && !H && f && t(0, H = f[0]);
+ 8388608 && V && D(), l.$$.dirty[0] & /*dragging*/
+ 16777216 && le("drag", ae), l.$$.dirty[0] & /*active_source, sources*/
+ 17 && !I && f && t(0, I = f[0]);
}, [
- H,
+ I,
a,
r,
- s,
+ o,
f,
u,
c,
- _,
d,
- h,
+ _,
b,
- m,
+ h,
w,
- k,
g,
- S,
- M,
- y,
+ p,
+ m,
+ C,
z,
- v,
+ y,
q,
- R,
- I,
- W,
- ae,
- B,
- le,
+ v,
+ E,
+ F,
X,
- ee,
- ye,
+ V,
+ ae,
L,
+ Q,
+ W,
+ le,
+ re,
+ D,
n,
- de,
- Ae,
- Le,
- Ce,
- A,
- Ve,
- p,
- F,
- Z,
- K,
+ fe,
+ Se,
+ Fe,
+ Pe,
+ B,
+ Ze,
+ k,
+ H,
+ O,
+ G,
i
];
}
-class R0 extends y0 {
+class O1 extends M1 {
constructor(e) {
- super(), E0(
+ super(), j1(
this,
e,
- I0,
- j0,
- B0,
+ V1,
+ N1,
+ F1,
{
value: 1,
label: 2,
@@ -8163,25 +8280,25 @@ class R0 extends y0 {
}
}
const {
- SvelteComponent: F0,
- attr: H0,
- check_outros: U0,
- create_component: N0,
- destroy_component: O0,
- detach: X0,
- element: Y0,
- group_outros: W0,
- init: V0,
- insert: P0,
- mount_component: Z0,
- safe_not_equal: K0,
- toggle_class: nt,
- transition_in: Kn,
- transition_out: ui
+ SvelteComponent: W1,
+ attr: P1,
+ check_outros: Z1,
+ create_component: K1,
+ destroy_component: G1,
+ detach: J1,
+ element: Q1,
+ group_outros: x1,
+ init: $1,
+ insert: e0,
+ mount_component: t0,
+ safe_not_equal: n0,
+ toggle_class: it,
+ transition_in: xn,
+ transition_out: ki
} = window.__gradio__svelte__internal;
-function Ko(l) {
+function $s(l) {
let e, t;
- return e = new $s({
+ return e = new sa({
props: {
src: (
/*samples_dir*/
@@ -8192,86 +8309,86 @@ function Ko(l) {
}
}), {
c() {
- N0(e.$$.fragment);
+ K1(e.$$.fragment);
},
m(n, i) {
- Z0(e, n, i), t = !0;
+ t0(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i & /*samples_dir, value*/
- 3 && (o.src = /*samples_dir*/
+ 3 && (s.src = /*samples_dir*/
n[1] + /*value*/
- n[0].path), e.$set(o);
+ n[0].path), e.$set(s);
},
i(n) {
- t || (Kn(e.$$.fragment, n), t = !0);
+ t || (xn(e.$$.fragment, n), t = !0);
},
o(n) {
- ui(e.$$.fragment, n), t = !1;
+ ki(e.$$.fragment, n), t = !1;
},
d(n) {
- O0(e, n);
+ G1(e, n);
}
};
}
-function G0(l) {
+function l0(l) {
let e, t, n = (
/*value*/
- l[0] && Ko(l)
+ l[0] && $s(l)
);
return {
c() {
- e = Y0("div"), n && n.c(), H0(e, "class", "container svelte-1sgcyba"), nt(
+ e = Q1("div"), n && n.c(), P1(e, "class", "container svelte-1sgcyba"), it(
e,
"table",
/*type*/
l[2] === "table"
- ), nt(
+ ), it(
e,
"gallery",
/*type*/
l[2] === "gallery"
- ), nt(
+ ), it(
e,
"selected",
/*selected*/
l[3]
- ), nt(
+ ), it(
e,
"border",
/*value*/
l[0]
);
},
- m(i, o) {
- P0(i, e, o), n && n.m(e, null), t = !0;
+ m(i, s) {
+ e0(i, e, s), n && n.m(e, null), t = !0;
},
- p(i, [o]) {
+ p(i, [s]) {
/*value*/
- i[0] ? n ? (n.p(i, o), o & /*value*/
- 1 && Kn(n, 1)) : (n = Ko(i), n.c(), Kn(n, 1), n.m(e, null)) : n && (W0(), ui(n, 1, 1, () => {
+ i[0] ? n ? (n.p(i, s), s & /*value*/
+ 1 && xn(n, 1)) : (n = $s(i), n.c(), xn(n, 1), n.m(e, null)) : n && (x1(), ki(n, 1, 1, () => {
n = null;
- }), U0()), (!t || o & /*type*/
- 4) && nt(
+ }), Z1()), (!t || s & /*type*/
+ 4) && it(
e,
"table",
/*type*/
i[2] === "table"
- ), (!t || o & /*type*/
- 4) && nt(
+ ), (!t || s & /*type*/
+ 4) && it(
e,
"gallery",
/*type*/
i[2] === "gallery"
- ), (!t || o & /*selected*/
- 8) && nt(
+ ), (!t || s & /*selected*/
+ 8) && it(
e,
"selected",
/*selected*/
i[3]
- ), (!t || o & /*value*/
- 1) && nt(
+ ), (!t || s & /*value*/
+ 1) && it(
e,
"border",
/*value*/
@@ -8279,25 +8396,25 @@ function G0(l) {
);
},
i(i) {
- t || (Kn(n), t = !0);
+ t || (xn(n), t = !0);
},
o(i) {
- ui(n), t = !1;
+ ki(n), t = !1;
},
d(i) {
- i && X0(e), n && n.d();
+ i && J1(e), n && n.d();
}
};
}
-function J0(l, e, t) {
- let { value: n } = e, { samples_dir: i } = e, { type: o } = e, { selected: a = !1 } = e;
+function i0(l, e, t) {
+ let { value: n } = e, { samples_dir: i } = e, { type: s } = e, { selected: a = !1 } = e;
return l.$$set = (r) => {
- "value" in r && t(0, n = r.value), "samples_dir" in r && t(1, i = r.samples_dir), "type" in r && t(2, o = r.type), "selected" in r && t(3, a = r.selected);
- }, [n, i, o, a];
+ "value" in r && t(0, n = r.value), "samples_dir" in r && t(1, i = r.samples_dir), "type" in r && t(2, s = r.type), "selected" in r && t(3, a = r.selected);
+ }, [n, i, s, a];
}
-class p1 extends F0 {
+class E0 extends W1 {
constructor(e) {
- super(), V0(this, e, J0, G0, K0, {
+ super(), $1(this, e, i0, l0, n0, {
value: 0,
samples_dir: 1,
type: 2,
@@ -8306,63 +8423,63 @@ class p1 extends F0 {
}
}
const {
- SvelteComponent: Q0,
- add_flush_callback: Go,
- assign: x0,
- bind: Jo,
- binding_callbacks: Qo,
- check_outros: $0,
- create_component: Mt,
- destroy_component: Bt,
- detach: ea,
- empty: e1,
- flush: N,
- get_spread_object: t1,
- get_spread_update: n1,
- group_outros: l1,
- init: i1,
- insert: ta,
- mount_component: At,
- safe_not_equal: o1,
- space: s1,
- transition_in: Ge,
- transition_out: Je
+ SvelteComponent: s0,
+ add_flush_callback: eo,
+ assign: o0,
+ bind: to,
+ binding_callbacks: no,
+ check_outros: a0,
+ create_component: Lt,
+ destroy_component: Dt,
+ detach: oa,
+ empty: r0,
+ flush: U,
+ get_spread_object: f0,
+ get_spread_update: u0,
+ group_outros: c0,
+ init: _0,
+ insert: aa,
+ mount_component: Tt,
+ safe_not_equal: d0,
+ space: h0,
+ transition_in: Qe,
+ transition_out: xe
} = window.__gradio__svelte__internal;
-function a1(l) {
+function m0(l) {
let e, t;
- return e = new Pr({
+ return e = new xr({
props: {
unpadded_box: !0,
size: "large",
- $$slots: { default: [u1] },
+ $$slots: { default: [w0] },
$$scope: { ctx: l }
}
}), {
c() {
- Mt(e.$$.fragment);
+ Lt(e.$$.fragment);
},
m(n, i) {
- At(e, n, i), t = !0;
+ Tt(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[1] & /*$$scope*/
- 512 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 512 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
},
i(n) {
- t || (Ge(e.$$.fragment, n), t = !0);
+ t || (Qe(e.$$.fragment, n), t = !0);
},
o(n) {
- Je(e.$$.fragment, n), t = !1;
+ xe(e.$$.fragment, n), t = !1;
},
d(n) {
- Bt(e, n);
+ Dt(e, n);
}
};
}
-function r1(l) {
+function b0(l) {
let e, t;
- return e = new fs({
+ return e = new bo({
props: {
i18n: (
/*gradio*/
@@ -8373,31 +8490,31 @@ function r1(l) {
}
}), {
c() {
- Mt(e.$$.fragment);
+ Lt(e.$$.fragment);
},
m(n, i) {
- At(e, n, i), t = !0;
+ Tt(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*gradio*/
- 134217728 && (o.i18n = /*gradio*/
- n[27].i18n), e.$set(o);
+ 134217728 && (s.i18n = /*gradio*/
+ n[27].i18n), e.$set(s);
},
i(n) {
- t || (Ge(e.$$.fragment, n), t = !0);
+ t || (Qe(e.$$.fragment, n), t = !0);
},
o(n) {
- Je(e.$$.fragment, n), t = !1;
+ xe(e.$$.fragment, n), t = !1;
},
d(n) {
- Bt(e, n);
+ Dt(e, n);
}
};
}
-function f1(l) {
+function g0(l) {
let e, t;
- return e = new fs({
+ return e = new bo({
props: {
i18n: (
/*gradio*/
@@ -8407,86 +8524,86 @@ function f1(l) {
}
}), {
c() {
- Mt(e.$$.fragment);
+ Lt(e.$$.fragment);
},
m(n, i) {
- At(e, n, i), t = !0;
+ Tt(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*gradio*/
- 134217728 && (o.i18n = /*gradio*/
- n[27].i18n), e.$set(o);
+ 134217728 && (s.i18n = /*gradio*/
+ n[27].i18n), e.$set(s);
},
i(n) {
- t || (Ge(e.$$.fragment, n), t = !0);
+ t || (Qe(e.$$.fragment, n), t = !0);
},
o(n) {
- Je(e.$$.fragment, n), t = !1;
+ xe(e.$$.fragment, n), t = !1;
},
d(n) {
- Bt(e, n);
+ Dt(e, n);
}
};
}
-function u1(l) {
+function w0(l) {
let e, t;
- return e = new ls({}), {
+ return e = new fo({}), {
c() {
- Mt(e.$$.fragment);
+ Lt(e.$$.fragment);
},
m(n, i) {
- At(e, n, i), t = !0;
+ Tt(e, n, i), t = !0;
},
i(n) {
- t || (Ge(e.$$.fragment, n), t = !0);
+ t || (Qe(e.$$.fragment, n), t = !0);
},
o(n) {
- Je(e.$$.fragment, n), t = !1;
+ xe(e.$$.fragment, n), t = !1;
},
d(n) {
- Bt(e, n);
+ Dt(e, n);
}
};
}
-function c1(l) {
+function p0(l) {
let e, t, n, i;
- const o = [f1, r1, a1], a = [];
- function r(s, f) {
+ const s = [g0, b0, m0], a = [];
+ function r(o, f) {
return (
/*active_source*/
- s[29] === "upload" ? 0 : (
+ o[29] === "upload" ? 0 : (
/*active_source*/
- s[29] === "clipboard" ? 1 : 2
+ o[29] === "clipboard" ? 1 : 2
)
);
}
- return e = r(l), t = a[e] = o[e](l), {
+ return e = r(l), t = a[e] = s[e](l), {
c() {
- t.c(), n = e1();
+ t.c(), n = r0();
},
- m(s, f) {
- a[e].m(s, f), ta(s, n, f), i = !0;
+ m(o, f) {
+ a[e].m(o, f), aa(o, n, f), i = !0;
},
- p(s, f) {
+ p(o, f) {
let u = e;
- e = r(s), e === u ? a[e].p(s, f) : (l1(), Je(a[u], 1, 1, () => {
+ e = r(o), e === u ? a[e].p(o, f) : (c0(), xe(a[u], 1, 1, () => {
a[u] = null;
- }), $0(), t = a[e], t ? t.p(s, f) : (t = a[e] = o[e](s), t.c()), Ge(t, 1), t.m(n.parentNode, n));
+ }), a0(), t = a[e], t ? t.p(o, f) : (t = a[e] = s[e](o), t.c()), Qe(t, 1), t.m(n.parentNode, n));
},
- i(s) {
- i || (Ge(t), i = !0);
+ i(o) {
+ i || (Qe(t), i = !0);
},
- o(s) {
- Je(t), i = !1;
+ o(o) {
+ xe(t), i = !1;
},
- d(s) {
- s && ea(n), a[e].d(s);
+ d(o) {
+ o && oa(n), a[e].d(o);
}
};
}
-function _1(l) {
- let e, t, n, i, o, a;
+function k0(l) {
+ let e, t, n, i, s, a;
const r = [
{
autoscroll: (
@@ -8501,15 +8618,15 @@ function _1(l) {
/*loading_status*/
l[1]
];
- let s = {};
- for (let _ = 0; _ < r.length; _ += 1)
- s = x0(s, r[_]);
- e = new Sc({ props: s });
- function f(_) {
- l[30](_);
+ let o = {};
+ for (let d = 0; d < r.length; d += 1)
+ o = o0(o, r[d]);
+ e = new yc({ props: o });
+ function f(d) {
+ l[30](d);
}
- function u(_) {
- l[31](_);
+ function u(d) {
+ l[31](d);
}
let c = {
selectable: (
@@ -8596,7 +8713,7 @@ function _1(l) {
/*disable_edit_boxes*/
l[26]
),
- $$slots: { default: [c1] },
+ $$slots: { default: [p0] },
$$scope: { ctx: l }
};
return (
@@ -8604,7 +8721,7 @@ function _1(l) {
l[29] !== void 0 && (c.active_source = /*active_source*/
l[29]), /*value*/
l[0] !== void 0 && (c.value = /*value*/
- l[0]), n = new R0({ props: c }), Qo.push(() => Jo(n, "active_source", f)), Qo.push(() => Jo(n, "value", u)), n.$on(
+ l[0]), n = new O1({ props: c }), no.push(() => to(n, "active_source", f)), no.push(() => to(n, "value", u)), n.$on(
"change",
/*change_handler*/
l[32]
@@ -8638,99 +8755,99 @@ function _1(l) {
l[39]
), {
c() {
- Mt(e.$$.fragment), t = s1(), Mt(n.$$.fragment);
+ Lt(e.$$.fragment), t = h0(), Lt(n.$$.fragment);
},
- m(_, d) {
- At(e, _, d), ta(_, t, d), At(n, _, d), a = !0;
+ m(d, _) {
+ Tt(e, d, _), aa(d, t, _), Tt(n, d, _), a = !0;
},
- p(_, d) {
- const h = d[0] & /*gradio, loading_status*/
- 134217730 ? n1(r, [
- d[0] & /*gradio*/
+ p(d, _) {
+ const b = _[0] & /*gradio, loading_status*/
+ 134217730 ? u0(r, [
+ _[0] & /*gradio*/
134217728 && {
autoscroll: (
/*gradio*/
- _[27].autoscroll
+ d[27].autoscroll
)
},
- d[0] & /*gradio*/
+ _[0] & /*gradio*/
134217728 && { i18n: (
/*gradio*/
- _[27].i18n
+ d[27].i18n
) },
- d[0] & /*loading_status*/
- 2 && t1(
+ _[0] & /*loading_status*/
+ 2 && f0(
/*loading_status*/
- _[1]
+ d[1]
)
]) : {};
- e.$set(h);
- const b = {};
- d[0] & /*_selectable*/
- 1024 && (b.selectable = /*_selectable*/
- _[10]), d[0] & /*root*/
- 128 && (b.root = /*root*/
- _[7]), d[0] & /*sources*/
- 16384 && (b.sources = /*sources*/
- _[14]), d[0] & /*interactive*/
- 262144 && (b.interactive = /*interactive*/
- _[18]), d[0] & /*show_download_button*/
- 32768 && (b.showDownloadButton = /*show_download_button*/
- _[15]), d[0] & /*show_share_button*/
- 65536 && (b.showShareButton = /*show_share_button*/
- _[16]), d[0] & /*show_clear_button*/
- 131072 && (b.showClearButton = /*show_clear_button*/
- _[17]), d[0] & /*gradio*/
- 134217728 && (b.i18n = /*gradio*/
- _[27].i18n), d[0] & /*boxes_alpha*/
- 524288 && (b.boxesAlpha = /*boxes_alpha*/
- _[19]), d[0] & /*label_list*/
- 1048576 && (b.labelList = /*label_list*/
- _[20]), d[0] & /*label_colors*/
- 2097152 && (b.labelColors = /*label_colors*/
- _[21]), d[0] & /*box_min_size*/
- 4194304 && (b.boxMinSize = /*box_min_size*/
- _[22]), d[0] & /*label*/
- 32 && (b.label = /*label*/
- _[5]), d[0] & /*show_label*/
- 64 && (b.show_label = /*show_label*/
- _[6]), d[0] & /*gradio*/
- 134217728 && (b.max_file_size = /*gradio*/
- _[27].max_file_size), d[0] & /*gradio*/
- 134217728 && (b.cli_upload = /*gradio*/
- _[27].client.upload), d[0] & /*gradio*/
- 134217728 && (b.stream_handler = /*gradio*/
- _[27].client.stream), d[0] & /*handle_size*/
- 8388608 && (b.handleSize = /*handle_size*/
- _[23]), d[0] & /*box_thickness*/
- 16777216 && (b.boxThickness = /*box_thickness*/
- _[24]), d[0] & /*box_selected_thickness*/
- 33554432 && (b.boxSelectedThickness = /*box_selected_thickness*/
- _[25]), d[0] & /*disable_edit_boxes*/
- 67108864 && (b.disableEditBoxes = /*disable_edit_boxes*/
- _[26]), d[0] & /*gradio, active_source*/
- 671088640 | d[1] & /*$$scope*/
- 512 && (b.$$scope = { dirty: d, ctx: _ }), !i && d[0] & /*active_source*/
- 536870912 && (i = !0, b.active_source = /*active_source*/
- _[29], Go(() => i = !1)), !o && d[0] & /*value*/
- 1 && (o = !0, b.value = /*value*/
- _[0], Go(() => o = !1)), n.$set(b);
+ e.$set(b);
+ const h = {};
+ _[0] & /*_selectable*/
+ 1024 && (h.selectable = /*_selectable*/
+ d[10]), _[0] & /*root*/
+ 128 && (h.root = /*root*/
+ d[7]), _[0] & /*sources*/
+ 16384 && (h.sources = /*sources*/
+ d[14]), _[0] & /*interactive*/
+ 262144 && (h.interactive = /*interactive*/
+ d[18]), _[0] & /*show_download_button*/
+ 32768 && (h.showDownloadButton = /*show_download_button*/
+ d[15]), _[0] & /*show_share_button*/
+ 65536 && (h.showShareButton = /*show_share_button*/
+ d[16]), _[0] & /*show_clear_button*/
+ 131072 && (h.showClearButton = /*show_clear_button*/
+ d[17]), _[0] & /*gradio*/
+ 134217728 && (h.i18n = /*gradio*/
+ d[27].i18n), _[0] & /*boxes_alpha*/
+ 524288 && (h.boxesAlpha = /*boxes_alpha*/
+ d[19]), _[0] & /*label_list*/
+ 1048576 && (h.labelList = /*label_list*/
+ d[20]), _[0] & /*label_colors*/
+ 2097152 && (h.labelColors = /*label_colors*/
+ d[21]), _[0] & /*box_min_size*/
+ 4194304 && (h.boxMinSize = /*box_min_size*/
+ d[22]), _[0] & /*label*/
+ 32 && (h.label = /*label*/
+ d[5]), _[0] & /*show_label*/
+ 64 && (h.show_label = /*show_label*/
+ d[6]), _[0] & /*gradio*/
+ 134217728 && (h.max_file_size = /*gradio*/
+ d[27].max_file_size), _[0] & /*gradio*/
+ 134217728 && (h.cli_upload = /*gradio*/
+ d[27].client.upload), _[0] & /*gradio*/
+ 134217728 && (h.stream_handler = /*gradio*/
+ d[27].client.stream), _[0] & /*handle_size*/
+ 8388608 && (h.handleSize = /*handle_size*/
+ d[23]), _[0] & /*box_thickness*/
+ 16777216 && (h.boxThickness = /*box_thickness*/
+ d[24]), _[0] & /*box_selected_thickness*/
+ 33554432 && (h.boxSelectedThickness = /*box_selected_thickness*/
+ d[25]), _[0] & /*disable_edit_boxes*/
+ 67108864 && (h.disableEditBoxes = /*disable_edit_boxes*/
+ d[26]), _[0] & /*gradio, active_source*/
+ 671088640 | _[1] & /*$$scope*/
+ 512 && (h.$$scope = { dirty: _, ctx: d }), !i && _[0] & /*active_source*/
+ 536870912 && (i = !0, h.active_source = /*active_source*/
+ d[29], eo(() => i = !1)), !s && _[0] & /*value*/
+ 1 && (s = !0, h.value = /*value*/
+ d[0], eo(() => s = !1)), n.$set(h);
},
- i(_) {
- a || (Ge(e.$$.fragment, _), Ge(n.$$.fragment, _), a = !0);
+ i(d) {
+ a || (Qe(e.$$.fragment, d), Qe(n.$$.fragment, d), a = !0);
},
- o(_) {
- Je(e.$$.fragment, _), Je(n.$$.fragment, _), a = !1;
+ o(d) {
+ xe(e.$$.fragment, d), xe(n.$$.fragment, d), a = !1;
},
- d(_) {
- _ && ea(t), Bt(e, _), Bt(n, _);
+ d(d) {
+ d && oa(t), Dt(e, d), Dt(n, d);
}
}
);
}
-function d1(l) {
+function v0(l) {
let e, t;
- return e = new ga({
+ return e = new Ca({
props: {
visible: (
/*visible*/
@@ -8771,117 +8888,117 @@ function d1(l) {
/*min_width*/
l[13]
),
- $$slots: { default: [_1] },
+ $$slots: { default: [k0] },
$$scope: { ctx: l }
}
}), {
c() {
- Mt(e.$$.fragment);
+ Lt(e.$$.fragment);
},
m(n, i) {
- At(e, n, i), t = !0;
+ Tt(e, n, i), t = !0;
},
p(n, i) {
- const o = {};
+ const s = {};
i[0] & /*visible*/
- 16 && (o.visible = /*visible*/
+ 16 && (s.visible = /*visible*/
n[4]), i[0] & /*dragging*/
- 268435456 && (o.border_mode = /*dragging*/
+ 268435456 && (s.border_mode = /*dragging*/
n[28] ? "focus" : "base"), i[0] & /*elem_id*/
- 4 && (o.elem_id = /*elem_id*/
+ 4 && (s.elem_id = /*elem_id*/
n[2]), i[0] & /*elem_classes*/
- 8 && (o.elem_classes = /*elem_classes*/
+ 8 && (s.elem_classes = /*elem_classes*/
n[3]), i[0] & /*height*/
- 256 && (o.height = /*height*/
+ 256 && (s.height = /*height*/
n[8] || void 0), i[0] & /*width*/
- 512 && (o.width = /*width*/
+ 512 && (s.width = /*width*/
n[9]), i[0] & /*container*/
- 2048 && (o.container = /*container*/
+ 2048 && (s.container = /*container*/
n[11]), i[0] & /*scale*/
- 4096 && (o.scale = /*scale*/
+ 4096 && (s.scale = /*scale*/
n[12]), i[0] & /*min_width*/
- 8192 && (o.min_width = /*min_width*/
+ 8192 && (s.min_width = /*min_width*/
n[13]), i[0] & /*_selectable, root, sources, interactive, show_download_button, show_share_button, show_clear_button, gradio, boxes_alpha, label_list, label_colors, box_min_size, label, show_label, handle_size, box_thickness, box_selected_thickness, disable_edit_boxes, active_source, value, dragging, loading_status*/
1073726691 | i[1] & /*$$scope*/
- 512 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
+ 512 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
},
i(n) {
- t || (Ge(e.$$.fragment, n), t = !0);
+ t || (Qe(e.$$.fragment, n), t = !0);
},
o(n) {
- Je(e.$$.fragment, n), t = !1;
+ xe(e.$$.fragment, n), t = !1;
},
d(n) {
- Bt(e, n);
+ Dt(e, n);
}
};
}
-function h1(l, e, t) {
- let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: o = !0 } = e, { value: a = null } = e, { label: r } = e, { show_label: s } = e, { root: f } = e, { height: u } = e, { width: c } = e, { _selectable: _ = !1 } = e, { container: d = !0 } = e, { scale: h = null } = e, { min_width: b = void 0 } = e, { loading_status: m } = e, { sources: w = ["upload", "clipboard"] } = e, { show_download_button: k } = e, { show_share_button: g } = e, { show_clear_button: S } = e, { interactive: M } = e, { boxes_alpha: y } = e, { label_list: z } = e, { label_colors: v } = e, { box_min_size: q } = e, { handle_size: R } = e, { box_thickness: I } = e, { box_selected_thickness: B } = e, { disable_edit_boxes: W } = e, { gradio: H } = e, le, X = null;
- function ee(p) {
- X = p, t(29, X);
+function y0(l, e, t) {
+ let { elem_id: n = "" } = e, { elem_classes: i = [] } = e, { visible: s = !0 } = e, { value: a = null } = e, { label: r } = e, { show_label: o } = e, { root: f } = e, { height: u } = e, { width: c } = e, { _selectable: d = !1 } = e, { container: _ = !0 } = e, { scale: b = null } = e, { min_width: h = void 0 } = e, { loading_status: w } = e, { sources: g = ["upload", "clipboard"] } = e, { show_download_button: p } = e, { show_share_button: m } = e, { show_clear_button: C } = e, { interactive: z } = e, { boxes_alpha: y } = e, { label_list: q } = e, { label_colors: v } = e, { box_min_size: E } = e, { handle_size: F } = e, { box_thickness: X } = e, { box_selected_thickness: L } = e, { disable_edit_boxes: V } = e, { gradio: I } = e, Q, W = null;
+ function le(k) {
+ W = k, t(29, W);
}
- function ae(p) {
- a = p, t(0, a);
+ function ae(k) {
+ a = k, t(0, a);
}
- const ye = () => H.dispatch("change"), L = () => H.dispatch("edit"), de = () => {
- H.dispatch("clear");
- }, Ae = ({ detail: p }) => t(28, le = p), Le = () => H.dispatch("upload"), Ce = ({ detail: p }) => H.dispatch("select", p), A = ({ detail: p }) => H.dispatch("share", p), Ve = ({ detail: p }) => {
- t(1, m = m || {}), t(1, m.status = "error", m), H.dispatch("error", p);
+ const re = () => I.dispatch("change"), D = () => I.dispatch("edit"), fe = () => {
+ I.dispatch("clear");
+ }, Se = ({ detail: k }) => t(28, Q = k), Fe = () => I.dispatch("upload"), Pe = ({ detail: k }) => I.dispatch("select", k), B = ({ detail: k }) => I.dispatch("share", k), Ze = ({ detail: k }) => {
+ t(1, w = w || {}), t(1, w.status = "error", w), I.dispatch("error", k);
};
- return l.$$set = (p) => {
- "elem_id" in p && t(2, n = p.elem_id), "elem_classes" in p && t(3, i = p.elem_classes), "visible" in p && t(4, o = p.visible), "value" in p && t(0, a = p.value), "label" in p && t(5, r = p.label), "show_label" in p && t(6, s = p.show_label), "root" in p && t(7, f = p.root), "height" in p && t(8, u = p.height), "width" in p && t(9, c = p.width), "_selectable" in p && t(10, _ = p._selectable), "container" in p && t(11, d = p.container), "scale" in p && t(12, h = p.scale), "min_width" in p && t(13, b = p.min_width), "loading_status" in p && t(1, m = p.loading_status), "sources" in p && t(14, w = p.sources), "show_download_button" in p && t(15, k = p.show_download_button), "show_share_button" in p && t(16, g = p.show_share_button), "show_clear_button" in p && t(17, S = p.show_clear_button), "interactive" in p && t(18, M = p.interactive), "boxes_alpha" in p && t(19, y = p.boxes_alpha), "label_list" in p && t(20, z = p.label_list), "label_colors" in p && t(21, v = p.label_colors), "box_min_size" in p && t(22, q = p.box_min_size), "handle_size" in p && t(23, R = p.handle_size), "box_thickness" in p && t(24, I = p.box_thickness), "box_selected_thickness" in p && t(25, B = p.box_selected_thickness), "disable_edit_boxes" in p && t(26, W = p.disable_edit_boxes), "gradio" in p && t(27, H = p.gradio);
+ return l.$$set = (k) => {
+ "elem_id" in k && t(2, n = k.elem_id), "elem_classes" in k && t(3, i = k.elem_classes), "visible" in k && t(4, s = k.visible), "value" in k && t(0, a = k.value), "label" in k && t(5, r = k.label), "show_label" in k && t(6, o = k.show_label), "root" in k && t(7, f = k.root), "height" in k && t(8, u = k.height), "width" in k && t(9, c = k.width), "_selectable" in k && t(10, d = k._selectable), "container" in k && t(11, _ = k.container), "scale" in k && t(12, b = k.scale), "min_width" in k && t(13, h = k.min_width), "loading_status" in k && t(1, w = k.loading_status), "sources" in k && t(14, g = k.sources), "show_download_button" in k && t(15, p = k.show_download_button), "show_share_button" in k && t(16, m = k.show_share_button), "show_clear_button" in k && t(17, C = k.show_clear_button), "interactive" in k && t(18, z = k.interactive), "boxes_alpha" in k && t(19, y = k.boxes_alpha), "label_list" in k && t(20, q = k.label_list), "label_colors" in k && t(21, v = k.label_colors), "box_min_size" in k && t(22, E = k.box_min_size), "handle_size" in k && t(23, F = k.handle_size), "box_thickness" in k && t(24, X = k.box_thickness), "box_selected_thickness" in k && t(25, L = k.box_selected_thickness), "disable_edit_boxes" in k && t(26, V = k.disable_edit_boxes), "gradio" in k && t(27, I = k.gradio);
}, [
a,
- m,
+ w,
n,
i,
- o,
- r,
s,
+ r,
+ o,
f,
u,
c,
- _,
d,
- h,
+ _,
b,
- w,
- k,
+ h,
g,
- S,
- M,
- y,
+ p,
+ m,
+ C,
z,
- v,
+ y,
q,
- R,
+ v,
+ E,
+ F,
+ X,
+ L,
+ V,
I,
- B,
+ Q,
W,
- H,
le,
- X,
- ee,
ae,
- ye,
- L,
- de,
- Ae,
- Le,
- Ce,
- A,
- Ve
+ re,
+ D,
+ fe,
+ Se,
+ Fe,
+ Pe,
+ B,
+ Ze
];
}
-class k1 extends Q0 {
+class A0 extends s0 {
constructor(e) {
- super(), i1(
+ super(), _0(
this,
e,
- h1,
- d1,
- o1,
+ y0,
+ v0,
+ d0,
{
elem_id: 2,
elem_classes: 3,
@@ -8920,172 +9037,172 @@ class k1 extends Q0 {
return this.$$.ctx[2];
}
set elem_id(e) {
- this.$$set({ elem_id: e }), N();
+ this.$$set({ elem_id: e }), U();
}
get elem_classes() {
return this.$$.ctx[3];
}
set elem_classes(e) {
- this.$$set({ elem_classes: e }), N();
+ this.$$set({ elem_classes: e }), U();
}
get visible() {
return this.$$.ctx[4];
}
set visible(e) {
- this.$$set({ visible: e }), N();
+ this.$$set({ visible: e }), U();
}
get value() {
return this.$$.ctx[0];
}
set value(e) {
- this.$$set({ value: e }), N();
+ this.$$set({ value: e }), U();
}
get label() {
return this.$$.ctx[5];
}
set label(e) {
- this.$$set({ label: e }), N();
+ this.$$set({ label: e }), U();
}
get show_label() {
return this.$$.ctx[6];
}
set show_label(e) {
- this.$$set({ show_label: e }), N();
+ this.$$set({ show_label: e }), U();
}
get root() {
return this.$$.ctx[7];
}
set root(e) {
- this.$$set({ root: e }), N();
+ this.$$set({ root: e }), U();
}
get height() {
return this.$$.ctx[8];
}
set height(e) {
- this.$$set({ height: e }), N();
+ this.$$set({ height: e }), U();
}
get width() {
return this.$$.ctx[9];
}
set width(e) {
- this.$$set({ width: e }), N();
+ this.$$set({ width: e }), U();
}
get _selectable() {
return this.$$.ctx[10];
}
set _selectable(e) {
- this.$$set({ _selectable: e }), N();
+ this.$$set({ _selectable: e }), U();
}
get container() {
return this.$$.ctx[11];
}
set container(e) {
- this.$$set({ container: e }), N();
+ this.$$set({ container: e }), U();
}
get scale() {
return this.$$.ctx[12];
}
set scale(e) {
- this.$$set({ scale: e }), N();
+ this.$$set({ scale: e }), U();
}
get min_width() {
return this.$$.ctx[13];
}
set min_width(e) {
- this.$$set({ min_width: e }), N();
+ this.$$set({ min_width: e }), U();
}
get loading_status() {
return this.$$.ctx[1];
}
set loading_status(e) {
- this.$$set({ loading_status: e }), N();
+ this.$$set({ loading_status: e }), U();
}
get sources() {
return this.$$.ctx[14];
}
set sources(e) {
- this.$$set({ sources: e }), N();
+ this.$$set({ sources: e }), U();
}
get show_download_button() {
return this.$$.ctx[15];
}
set show_download_button(e) {
- this.$$set({ show_download_button: e }), N();
+ this.$$set({ show_download_button: e }), U();
}
get show_share_button() {
return this.$$.ctx[16];
}
set show_share_button(e) {
- this.$$set({ show_share_button: e }), N();
+ this.$$set({ show_share_button: e }), U();
}
get show_clear_button() {
return this.$$.ctx[17];
}
set show_clear_button(e) {
- this.$$set({ show_clear_button: e }), N();
+ this.$$set({ show_clear_button: e }), U();
}
get interactive() {
return this.$$.ctx[18];
}
set interactive(e) {
- this.$$set({ interactive: e }), N();
+ this.$$set({ interactive: e }), U();
}
get boxes_alpha() {
return this.$$.ctx[19];
}
set boxes_alpha(e) {
- this.$$set({ boxes_alpha: e }), N();
+ this.$$set({ boxes_alpha: e }), U();
}
get label_list() {
return this.$$.ctx[20];
}
set label_list(e) {
- this.$$set({ label_list: e }), N();
+ this.$$set({ label_list: e }), U();
}
get label_colors() {
return this.$$.ctx[21];
}
set label_colors(e) {
- this.$$set({ label_colors: e }), N();
+ this.$$set({ label_colors: e }), U();
}
get box_min_size() {
return this.$$.ctx[22];
}
set box_min_size(e) {
- this.$$set({ box_min_size: e }), N();
+ this.$$set({ box_min_size: e }), U();
}
get handle_size() {
return this.$$.ctx[23];
}
set handle_size(e) {
- this.$$set({ handle_size: e }), N();
+ this.$$set({ handle_size: e }), U();
}
get box_thickness() {
return this.$$.ctx[24];
}
set box_thickness(e) {
- this.$$set({ box_thickness: e }), N();
+ this.$$set({ box_thickness: e }), U();
}
get box_selected_thickness() {
return this.$$.ctx[25];
}
set box_selected_thickness(e) {
- this.$$set({ box_selected_thickness: e }), N();
+ this.$$set({ box_selected_thickness: e }), U();
}
get disable_edit_boxes() {
return this.$$.ctx[26];
}
set disable_edit_boxes(e) {
- this.$$set({ disable_edit_boxes: e }), N();
+ this.$$set({ disable_edit_boxes: e }), U();
}
get gradio() {
return this.$$.ctx[27];
}
set gradio(e) {
- this.$$set({ gradio: e }), N();
+ this.$$set({ gradio: e }), U();
}
}
export {
- p1 as BaseExample,
- k1 as default
+ E0 as BaseExample,
+ A0 as default
};