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: of, - assign: af, - create_slot: rf, - detach: ff, - element: cf, - get_all_dirty_from_scope: uf, - get_slot_changes: _f, - get_spread_update: df, - init: hf, - insert: mf, - safe_not_equal: gf, - set_dynamic_element_data: Ns, - set_style: We, + SvelteComponent: df, + assign: hf, + create_slot: mf, + detach: gf, + element: bf, + get_all_dirty_from_scope: wf, + get_slot_changes: pf, + get_spread_update: vf, + init: kf, + insert: yf, + safe_not_equal: Cf, + set_dynamic_element_data: Ps, + set_style: Ye, toggle_class: rt, - transition_in: Ua, - transition_out: Va, - update_slot_base: bf + transition_in: Na, + transition_out: Oa, + update_slot_base: Sf } = window.__gradio__svelte__internal; -function wf(i) { +function zf(i) { let e, t, n; const l = ( /*#slots*/ i[18].default - ), s = rf( + ), s = mf( l, i, /*$$scope*/ @@ -44,13 +44,13 @@ function wf(i) { } ], r = {}; for (let a = 0; a < o.length; a += 1) - r = af(r, o[a]); + r = hf(r, o[a]); return { c() { - e = cf( + e = bf( /*tag*/ i[14] - ), s && s.c(), Ns( + ), s && s.c(), Ps( /*tag*/ i[14] )(e, r), rt( @@ -75,7 +75,7 @@ function wf(i) { i[5] === "contrast" ), rt(e, "hide-container", !/*explicit_call*/ i[8] && !/*container*/ - i[9]), We( + i[9]), Ye( e, "height", /*get_dimension*/ @@ -83,7 +83,7 @@ function wf(i) { /*height*/ i[0] ) - ), We(e, "width", typeof /*width*/ + ), Ye(e, "width", typeof /*width*/ i[1] == "number" ? `calc(min(${/*width*/ i[1]}px, 100%))` : ( /*get_dimension*/ @@ -91,50 +91,50 @@ function wf(i) { /*width*/ i[1] ) - )), We( + )), Ye( e, "border-style", /*variant*/ i[4] - ), We( + ), Ye( e, "overflow", /*allow_overflow*/ i[11] ? "visible" : "hidden" - ), We( + ), Ye( e, "flex-grow", /*scale*/ i[12] - ), We(e, "min-width", `calc(min(${/*min_width*/ - i[13]}px, 100%))`), We(e, "border-width", "var(--block-border-width)"); + ), Ye(e, "min-width", `calc(min(${/*min_width*/ + i[13]}px, 100%))`), Ye(e, "border-width", "var(--block-border-width)"); }, m(a, f) { - mf(a, e, f), s && s.m(e, null), n = !0; + yf(a, e, f), s && s.m(e, null), n = !0; }, p(a, f) { s && s.p && (!n || f & /*$$scope*/ - 131072) && bf( + 131072) && Sf( s, l, a, /*$$scope*/ a[17], - n ? _f( + n ? pf( l, /*$$scope*/ a[17], f, null - ) : uf( + ) : wf( /*$$scope*/ a[17] ), null - ), Ns( + ), Ps( /*tag*/ a[14] - )(e, r = df(o, [ + )(e, r = vf(o, [ (!n || f & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -171,7 +171,7 @@ function wf(i) { ), rt(e, "hide-container", !/*explicit_call*/ a[8] && !/*container*/ a[9]), f & /*height*/ - 1 && We( + 1 && Ye( e, "height", /*get_dimension*/ @@ -180,7 +180,7 @@ function wf(i) { a[0] ) ), f & /*width*/ - 2 && We(e, "width", typeof /*width*/ + 2 && Ye(e, "width", typeof /*width*/ a[1] == "number" ? `calc(min(${/*width*/ a[1]}px, 100%))` : ( /*get_dimension*/ @@ -189,42 +189,42 @@ function wf(i) { a[1] ) )), f & /*variant*/ - 16 && We( + 16 && Ye( e, "border-style", /*variant*/ a[4] ), f & /*allow_overflow*/ - 2048 && We( + 2048 && Ye( e, "overflow", /*allow_overflow*/ a[11] ? "visible" : "hidden" ), f & /*scale*/ - 4096 && We( + 4096 && Ye( e, "flex-grow", /*scale*/ a[12] ), f & /*min_width*/ - 8192 && We(e, "min-width", `calc(min(${/*min_width*/ + 8192 && Ye(e, "min-width", `calc(min(${/*min_width*/ a[13]}px, 100%))`); }, i(a) { - n || (Ua(s, a), n = !0); + n || (Na(s, a), n = !0); }, o(a) { - Va(s, a), n = !1; + Oa(s, a), n = !1; }, d(a) { - a && ff(e), s && s.d(a); + a && gf(e), s && s.d(a); } }; } -function vf(i) { +function Bf(i) { let e, t = ( /*tag*/ - i[14] && wf(i) + i[14] && zf(i) ); return { c() { @@ -238,19 +238,19 @@ function vf(i) { n[14] && t.p(n, l); }, i(n) { - e || (Ua(t, n), e = !0); + e || (Na(t, n), e = !0); }, o(n) { - Va(t, n), e = !1; + Oa(t, n), e = !1; }, d(n) { t && t.d(n); } }; } -function pf(i, e, t) { - let { $$slots: n = {}, $$scope: l } = e, { height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: a = [] } = e, { variant: f = "solid" } = e, { border_mode: c = "base" } = e, { padding: u = !0 } = e, { type: _ = "normal" } = e, { test_id: d = void 0 } = e, { explicit_call: m = !1 } = e, { container: h = !0 } = e, { visible: g = !0 } = e, { allow_overflow: v = !0 } = e, { scale: w = null } = e, { min_width: b = 0 } = e, k = _ === "fieldset" ? "fieldset" : "div"; - const p = (y) => { +function Df(i, e, t) { + let { $$slots: n = {}, $$scope: l } = e, { height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: a = [] } = e, { variant: f = "solid" } = e, { border_mode: c = "base" } = e, { padding: u = !0 } = e, { type: _ = "normal" } = e, { test_id: d = void 0 } = e, { explicit_call: m = !1 } = e, { container: h = !0 } = e, { visible: g = !0 } = e, { allow_overflow: p = !0 } = e, { scale: w = null } = e, { min_width: b = 0 } = e, k = _ === "fieldset" ? "fieldset" : "div"; + const v = (y) => { if (y !== void 0) { if (typeof y == "number") return y + "px"; @@ -259,7 +259,7 @@ function pf(i, e, t) { } }; return i.$$set = (y) => { - "height" in y && t(0, s = y.height), "width" in y && t(1, o = y.width), "elem_id" in y && t(2, r = y.elem_id), "elem_classes" in y && t(3, a = y.elem_classes), "variant" in y && t(4, f = y.variant), "border_mode" in y && t(5, c = y.border_mode), "padding" in y && t(6, u = 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, m = y.explicit_call), "container" in y && t(9, h = y.container), "visible" in y && t(10, g = y.visible), "allow_overflow" in y && t(11, v = y.allow_overflow), "scale" in y && t(12, w = y.scale), "min_width" in y && t(13, b = y.min_width), "$$scope" in y && t(17, l = y.$$scope); + "height" in y && t(0, s = y.height), "width" in y && t(1, o = y.width), "elem_id" in y && t(2, r = y.elem_id), "elem_classes" in y && t(3, a = y.elem_classes), "variant" in y && t(4, f = y.variant), "border_mode" in y && t(5, c = y.border_mode), "padding" in y && t(6, u = 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, m = y.explicit_call), "container" in y && t(9, h = y.container), "visible" in y && t(10, g = y.visible), "allow_overflow" in y && t(11, p = y.allow_overflow), "scale" in y && t(12, w = y.scale), "min_width" in y && t(13, b = y.min_width), "$$scope" in y && t(17, l = y.$$scope); }, [ s, o, @@ -272,19 +272,19 @@ function pf(i, e, t) { m, h, g, - v, + p, w, b, k, - p, + v, _, l, n ]; } -class kf extends of { +class qf extends df { constructor(e) { - super(), hf(this, e, pf, vf, gf, { + super(), kf(this, e, Df, Bf, Cf, { height: 0, width: 1, elem_id: 2, @@ -304,26 +304,26 @@ class kf extends of { } } const { - SvelteComponent: yf, - attr: Cf, - create_slot: Sf, - detach: zf, - element: Bf, - get_all_dirty_from_scope: qf, - get_slot_changes: Df, - init: Lf, - insert: Ef, - safe_not_equal: Mf, - transition_in: Rf, - transition_out: Af, - update_slot_base: Wf + SvelteComponent: Lf, + attr: Mf, + create_slot: Ef, + detach: Rf, + element: Af, + get_all_dirty_from_scope: Wf, + get_slot_changes: Xf, + init: Yf, + insert: If, + safe_not_equal: Hf, + transition_in: Tf, + transition_out: jf, + update_slot_base: Ff } = window.__gradio__svelte__internal; -function Hf(i) { +function Uf(i) { let e, t; const n = ( /*#slots*/ i[1].default - ), l = Sf( + ), l = Ef( n, i, /*$$scope*/ @@ -332,26 +332,26 @@ function Hf(i) { ); return { c() { - e = Bf("div"), l && l.c(), Cf(e, "class", "svelte-1hnfib2"); + e = Af("div"), l && l.c(), Mf(e, "class", "svelte-1hnfib2"); }, m(s, o) { - Ef(s, e, o), l && l.m(e, null), t = !0; + If(s, e, o), l && l.m(e, null), t = !0; }, p(s, [o]) { l && l.p && (!t || o & /*$$scope*/ - 1) && Wf( + 1) && Ff( l, n, s, /*$$scope*/ s[0], - t ? Df( + t ? Xf( n, /*$$scope*/ s[0], o, null - ) : qf( + ) : Wf( /*$$scope*/ s[0] ), @@ -359,65 +359,65 @@ function Hf(i) { ); }, i(s) { - t || (Rf(l, s), t = !0); + t || (Tf(l, s), t = !0); }, o(s) { - Af(l, s), t = !1; + jf(l, s), t = !1; }, d(s) { - s && zf(e), l && l.d(s); + s && Rf(e), l && l.d(s); } }; } -function If(i, e, t) { +function Vf(i, e, t) { let { $$slots: n = {}, $$scope: l } = e; return i.$$set = (s) => { "$$scope" in s && t(0, l = s.$$scope); }, [l, n]; } -class Tf extends yf { +class Nf extends Lf { constructor(e) { - super(), Lf(this, e, If, Hf, Mf, {}); + super(), Yf(this, e, Vf, Uf, Hf, {}); } } const { - SvelteComponent: Xf, - attr: Os, - check_outros: Yf, - create_component: jf, - create_slot: Ff, - destroy_component: Uf, - detach: Yi, - element: Vf, - empty: Nf, - get_all_dirty_from_scope: Of, - get_slot_changes: Pf, - group_outros: Zf, - init: Gf, - insert: ji, - mount_component: Kf, - safe_not_equal: Jf, - set_data: Qf, - space: xf, - text: $f, - toggle_class: kn, - transition_in: ti, - transition_out: Fi, - update_slot_base: ec + SvelteComponent: Of, + attr: Zs, + check_outros: Pf, + create_component: Zf, + create_slot: Gf, + destroy_component: Kf, + detach: Ui, + element: Jf, + empty: Qf, + get_all_dirty_from_scope: xf, + get_slot_changes: $f, + group_outros: ec, + init: tc, + insert: Vi, + mount_component: nc, + safe_not_equal: ic, + set_data: lc, + space: sc, + text: oc, + toggle_class: Sn, + transition_in: ii, + transition_out: Ni, + update_slot_base: ac } = window.__gradio__svelte__internal; -function Ps(i) { +function Gs(i) { let e, t; - return e = new Tf({ + return e = new Nf({ props: { - $$slots: { default: [tc] }, + $$slots: { default: [rc] }, $$scope: { ctx: i } } }), { c() { - jf(e.$$.fragment); + Zf(e.$$.fragment); }, m(n, l) { - Kf(e, n, l), t = !0; + nc(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -425,47 +425,47 @@ function Ps(i) { 10 && (s.$$scope = { dirty: l, ctx: n }), e.$set(s); }, i(n) { - t || (ti(e.$$.fragment, n), t = !0); + t || (ii(e.$$.fragment, n), t = !0); }, o(n) { - Fi(e.$$.fragment, n), t = !1; + Ni(e.$$.fragment, n), t = !1; }, d(n) { - Uf(e, n); + Kf(e, n); } }; } -function tc(i) { +function rc(i) { let e; return { c() { - e = $f( + e = oc( /*info*/ i[1] ); }, m(t, n) { - ji(t, e, n); + Vi(t, e, n); }, p(t, n) { n & /*info*/ - 2 && Qf( + 2 && lc( e, /*info*/ t[1] ); }, d(t) { - t && Yi(e); + t && Ui(e); } }; } -function nc(i) { +function fc(i) { let e, t, n, l; const s = ( /*#slots*/ i[2].default - ), o = Ff( + ), o = Gf( s, i, /*$$scope*/ @@ -474,13 +474,13 @@ function nc(i) { ); let r = ( /*info*/ - i[1] && Ps(i) + i[1] && Gs(i) ); return { c() { - e = Vf("span"), o && o.c(), t = xf(), r && r.c(), n = Nf(), Os(e, "data-testid", "block-info"), Os(e, "class", "svelte-22c38v"), kn(e, "sr-only", !/*show_label*/ - i[0]), kn(e, "hide", !/*show_label*/ - i[0]), kn( + e = Jf("span"), o && o.c(), t = sc(), r && r.c(), n = Qf(), Zs(e, "data-testid", "block-info"), Zs(e, "class", "svelte-22c38v"), Sn(e, "sr-only", !/*show_label*/ + i[0]), Sn(e, "hide", !/*show_label*/ + i[0]), Sn( e, "has-info", /*info*/ @@ -488,100 +488,100 @@ function nc(i) { ); }, m(a, f) { - ji(a, e, f), o && o.m(e, null), ji(a, t, f), r && r.m(a, f), ji(a, n, f), l = !0; + Vi(a, e, f), o && o.m(e, null), Vi(a, t, f), r && r.m(a, f), Vi(a, n, f), l = !0; }, p(a, [f]) { o && o.p && (!l || f & /*$$scope*/ - 8) && ec( + 8) && ac( o, s, a, /*$$scope*/ a[3], - l ? Pf( + l ? $f( s, /*$$scope*/ a[3], f, null - ) : Of( + ) : xf( /*$$scope*/ a[3] ), null ), (!l || f & /*show_label*/ - 1) && kn(e, "sr-only", !/*show_label*/ + 1) && Sn(e, "sr-only", !/*show_label*/ a[0]), (!l || f & /*show_label*/ - 1) && kn(e, "hide", !/*show_label*/ + 1) && Sn(e, "hide", !/*show_label*/ a[0]), (!l || f & /*info*/ - 2) && kn( + 2) && Sn( e, "has-info", /*info*/ a[1] != null ), /*info*/ a[1] ? r ? (r.p(a, f), f & /*info*/ - 2 && ti(r, 1)) : (r = Ps(a), r.c(), ti(r, 1), r.m(n.parentNode, n)) : r && (Zf(), Fi(r, 1, 1, () => { + 2 && ii(r, 1)) : (r = Gs(a), r.c(), ii(r, 1), r.m(n.parentNode, n)) : r && (ec(), Ni(r, 1, 1, () => { r = null; - }), Yf()); + }), Pf()); }, i(a) { - l || (ti(o, a), ti(r), l = !0); + l || (ii(o, a), ii(r), l = !0); }, o(a) { - Fi(o, a), Fi(r), l = !1; + Ni(o, a), Ni(r), l = !1; }, d(a) { - a && (Yi(e), Yi(t), Yi(n)), o && o.d(a), r && r.d(a); + a && (Ui(e), Ui(t), Ui(n)), o && o.d(a), r && r.d(a); } }; } -function ic(i, e, t) { +function cc(i, e, t) { let { $$slots: n = {}, $$scope: l } = e, { show_label: s = !0 } = e, { info: o = void 0 } = e; return i.$$set = (r) => { "show_label" in r && t(0, s = r.show_label), "info" in r && t(1, o = r.info), "$$scope" in r && t(3, l = r.$$scope); }, [s, o, n, l]; } -class Na extends Xf { +class Pa extends Of { constructor(e) { - super(), Gf(this, e, ic, nc, Jf, { show_label: 0, info: 1 }); + super(), tc(this, e, cc, fc, ic, { show_label: 0, info: 1 }); } } const { - SvelteComponent: lc, - append: yl, - attr: vi, - create_component: sc, - destroy_component: oc, - detach: ac, - element: Zs, - init: rc, - insert: fc, - mount_component: cc, - safe_not_equal: uc, - set_data: _c, - space: dc, - text: hc, - toggle_class: Ht, - transition_in: mc, - transition_out: gc + SvelteComponent: uc, + append: Cl, + attr: yi, + create_component: _c, + destroy_component: dc, + detach: hc, + element: Ks, + init: mc, + insert: gc, + mount_component: bc, + safe_not_equal: wc, + set_data: pc, + space: vc, + text: kc, + toggle_class: Tt, + transition_in: yc, + transition_out: Cc } = window.__gradio__svelte__internal; -function bc(i) { +function Sc(i) { let e, t, n, l, s, o; return n = new /*Icon*/ i[1]({}), { c() { - e = Zs("label"), t = Zs("span"), sc(n.$$.fragment), l = dc(), s = hc( + e = Ks("label"), t = Ks("span"), _c(n.$$.fragment), l = vc(), s = kc( /*label*/ i[0] - ), vi(t, "class", "svelte-9gxdi0"), vi(e, "for", ""), vi(e, "data-testid", "block-label"), vi(e, "class", "svelte-9gxdi0"), Ht(e, "hide", !/*show_label*/ - i[2]), Ht(e, "sr-only", !/*show_label*/ - i[2]), Ht( + ), yi(t, "class", "svelte-9gxdi0"), yi(e, "for", ""), yi(e, "data-testid", "block-label"), yi(e, "class", "svelte-9gxdi0"), Tt(e, "hide", !/*show_label*/ + i[2]), Tt(e, "sr-only", !/*show_label*/ + i[2]), Tt( e, "float", /*float*/ i[4] - ), Ht( + ), Tt( e, "hide-label", /*disable*/ @@ -589,26 +589,26 @@ function bc(i) { ); }, m(r, a) { - fc(r, e, a), yl(e, t), cc(n, t, null), yl(e, l), yl(e, s), o = !0; + gc(r, e, a), Cl(e, t), bc(n, t, null), Cl(e, l), Cl(e, s), o = !0; }, p(r, [a]) { (!o || a & /*label*/ - 1) && _c( + 1) && pc( s, /*label*/ r[0] ), (!o || a & /*show_label*/ - 4) && Ht(e, "hide", !/*show_label*/ + 4) && Tt(e, "hide", !/*show_label*/ r[2]), (!o || a & /*show_label*/ - 4) && Ht(e, "sr-only", !/*show_label*/ + 4) && Tt(e, "sr-only", !/*show_label*/ r[2]), (!o || a & /*float*/ - 16) && Ht( + 16) && Tt( e, "float", /*float*/ r[4] ), (!o || a & /*disable*/ - 8) && Ht( + 8) && Tt( e, "hide-label", /*disable*/ @@ -616,25 +616,25 @@ function bc(i) { ); }, i(r) { - o || (mc(n.$$.fragment, r), o = !0); + o || (yc(n.$$.fragment, r), o = !0); }, o(r) { - gc(n.$$.fragment, r), o = !1; + Cc(n.$$.fragment, r), o = !1; }, d(r) { - r && ac(e), oc(n); + r && hc(e), dc(n); } }; } -function wc(i, e, t) { +function zc(i, e, t) { let { label: n = null } = e, { Icon: l } = e, { show_label: s = !0 } = e, { disable: o = !1 } = e, { float: r = !0 } = e; return i.$$set = (a) => { "label" in a && t(0, n = a.label), "Icon" in a && t(1, l = a.Icon), "show_label" in a && t(2, s = a.show_label), "disable" in a && t(3, o = a.disable), "float" in a && t(4, r = a.float); }, [n, l, s, o, r]; } -class vc extends lc { +class Bc extends uc { constructor(e) { - super(), rc(this, e, wc, bc, uc, { + super(), mc(this, e, zc, Sc, wc, { label: 0, Icon: 1, show_label: 2, @@ -644,61 +644,61 @@ class vc extends lc { } } const { - SvelteComponent: pc, - append: us, - attr: pt, - bubble: kc, - create_component: yc, - destroy_component: Cc, - detach: Oa, - element: _s, - init: Sc, - insert: Pa, - listen: zc, - mount_component: Bc, - safe_not_equal: qc, - set_data: Dc, - set_style: yn, - space: Lc, - text: Ec, + SvelteComponent: Dc, + append: _s, + attr: Ct, + bubble: qc, + create_component: Lc, + destroy_component: Mc, + detach: Za, + element: ds, + init: Ec, + insert: Ga, + listen: Rc, + mount_component: Ac, + safe_not_equal: Wc, + set_data: Xc, + set_style: zn, + space: Yc, + text: Ic, toggle_class: ze, - transition_in: Mc, - transition_out: Rc + transition_in: Hc, + transition_out: Tc } = window.__gradio__svelte__internal; -function Gs(i) { +function Js(i) { let e, t; return { c() { - e = _s("span"), t = Ec( + e = ds("span"), t = Ic( /*label*/ i[1] - ), pt(e, "class", "svelte-1lrphxw"); + ), Ct(e, "class", "svelte-1lrphxw"); }, m(n, l) { - Pa(n, e, l), us(e, t); + Ga(n, e, l), _s(e, t); }, p(n, l) { l & /*label*/ - 2 && Dc( + 2 && Xc( t, /*label*/ n[1] ); }, d(n) { - n && Oa(e); + n && Za(e); } }; } -function Ac(i) { +function jc(i) { let e, t, n, l, s, o, r, a = ( /*show_label*/ - i[2] && Gs(i) + i[2] && Js(i) ); return l = new /*Icon*/ i[0]({}), { c() { - e = _s("button"), a && a.c(), t = Lc(), n = _s("div"), yc(l.$$.fragment), pt(n, "class", "svelte-1lrphxw"), ze( + e = ds("button"), a && a.c(), t = Yc(), n = ds("div"), Lc(l.$$.fragment), Ct(n, "class", "svelte-1lrphxw"), ze( n, "small", /*size*/ @@ -714,22 +714,22 @@ function Ac(i) { /*size*/ i[4] === "medium" ), e.disabled = /*disabled*/ - i[7], pt( + i[7], Ct( e, "aria-label", /*label*/ i[1] - ), pt( + ), Ct( e, "aria-haspopup", /*hasPopup*/ i[8] - ), pt( + ), Ct( e, "title", /*label*/ i[1] - ), pt(e, "class", "svelte-1lrphxw"), ze( + ), Ct(e, "class", "svelte-1lrphxw"), ze( e, "pending", /*pending*/ @@ -749,16 +749,16 @@ function Ac(i) { "transparent", /*transparent*/ i[9] - ), yn(e, "color", !/*disabled*/ + ), zn(e, "color", !/*disabled*/ i[7] && /*_color*/ i[12] ? ( /*_color*/ i[12] - ) : "var(--block-label-text-color)"), yn(e, "--bg-color", /*disabled*/ + ) : "var(--block-label-text-color)"), zn(e, "--bg-color", /*disabled*/ i[7] ? "auto" : ( /*background*/ i[10] - )), yn( + )), zn( e, "margin-left", /*offset*/ @@ -766,7 +766,7 @@ function Ac(i) { ); }, m(f, c) { - Pa(f, e, c), a && a.m(e, null), us(e, t), us(e, n), Bc(l, n, null), s = !0, o || (r = zc( + Ga(f, e, c), a && a.m(e, null), _s(e, t), _s(e, n), Ac(l, n, null), s = !0, o || (r = Rc( e, "click", /*click_handler*/ @@ -775,7 +775,7 @@ function Ac(i) { }, p(f, [c]) { /*show_label*/ - f[2] ? a ? a.p(f, c) : (a = Gs(f), a.c(), a.m(e, t)) : a && (a.d(1), a = null), (!s || c & /*size*/ + f[2] ? a ? a.p(f, c) : (a = Js(f), a.c(), a.m(e, t)) : a && (a.d(1), a = null), (!s || c & /*size*/ 16) && ze( n, "small", @@ -796,19 +796,19 @@ function Ac(i) { ), (!s || c & /*disabled*/ 128) && (e.disabled = /*disabled*/ f[7]), (!s || c & /*label*/ - 2) && pt( + 2) && Ct( e, "aria-label", /*label*/ f[1] ), (!s || c & /*hasPopup*/ - 256) && pt( + 256) && Ct( e, "aria-haspopup", /*hasPopup*/ f[8] ), (!s || c & /*label*/ - 2) && pt( + 2) && Ct( e, "title", /*label*/ @@ -838,18 +838,18 @@ function Ac(i) { /*transparent*/ f[9] ), c & /*disabled, _color*/ - 4224 && yn(e, "color", !/*disabled*/ + 4224 && zn(e, "color", !/*disabled*/ f[7] && /*_color*/ f[12] ? ( /*_color*/ f[12] ) : "var(--block-label-text-color)"), c & /*disabled, background*/ - 1152 && yn(e, "--bg-color", /*disabled*/ + 1152 && zn(e, "--bg-color", /*disabled*/ f[7] ? "auto" : ( /*background*/ f[10] )), c & /*offset*/ - 2048 && yn( + 2048 && zn( e, "margin-left", /*offset*/ @@ -857,20 +857,20 @@ function Ac(i) { ); }, i(f) { - s || (Mc(l.$$.fragment, f), s = !0); + s || (Hc(l.$$.fragment, f), s = !0); }, o(f) { - Rc(l.$$.fragment, f), s = !1; + Tc(l.$$.fragment, f), s = !1; }, d(f) { - f && Oa(e), a && a.d(), Cc(l), o = !1, r(); + f && Za(e), a && a.d(), Mc(l), o = !1, r(); } }; } -function Wc(i, e, t) { +function Fc(i, e, t) { let n, { Icon: l } = e, { label: s = "" } = e, { show_label: o = !1 } = e, { pending: r = !1 } = e, { size: a = "small" } = e, { padded: f = !0 } = e, { highlight: c = !1 } = e, { disabled: u = !1 } = e, { hasPopup: _ = !1 } = e, { color: d = "var(--block-label-text-color)" } = e, { transparent: m = !1 } = e, { background: h = "var(--background-fill-primary)" } = e, { offset: g = 0 } = e; - function v(w) { - kc.call(this, i, w); + function p(w) { + qc.call(this, i, w); } return i.$$set = (w) => { "Icon" in w && t(0, l = w.Icon), "label" in w && t(1, s = w.label), "show_label" in w && t(2, o = w.show_label), "pending" in w && t(3, r = w.pending), "size" in w && t(4, a = w.size), "padded" in w && t(5, f = w.padded), "highlight" in w && t(6, c = w.highlight), "disabled" in w && t(7, u = w.disabled), "hasPopup" in w && t(8, _ = w.hasPopup), "color" in w && t(13, d = w.color), "transparent" in w && t(9, m = w.transparent), "background" in w && t(10, h = w.background), "offset" in w && t(11, g = w.offset); @@ -892,12 +892,12 @@ function Wc(i, e, t) { g, n, d, - v + p ]; } -class ol extends pc { +class fl extends Dc { constructor(e) { - super(), Sc(this, e, Wc, Ac, qc, { + super(), Ec(this, e, Fc, jc, Wc, { Icon: 0, label: 1, show_label: 2, @@ -915,29 +915,29 @@ class ol extends pc { } } const { - SvelteComponent: Hc, - append: Ic, - attr: Cl, - binding_callbacks: Tc, - create_slot: Xc, - detach: Yc, - element: Ks, - get_all_dirty_from_scope: jc, - get_slot_changes: Fc, - init: Uc, - insert: Vc, - safe_not_equal: Nc, - toggle_class: It, - transition_in: Oc, - transition_out: Pc, - update_slot_base: Zc + SvelteComponent: Uc, + append: Vc, + attr: Sl, + binding_callbacks: Nc, + create_slot: Oc, + detach: Pc, + element: Qs, + get_all_dirty_from_scope: Zc, + get_slot_changes: Gc, + init: Kc, + insert: Jc, + safe_not_equal: Qc, + toggle_class: jt, + transition_in: xc, + transition_out: $c, + update_slot_base: eu } = window.__gradio__svelte__internal; -function Gc(i) { +function tu(i) { let e, t, n; const l = ( /*#slots*/ i[5].default - ), s = Xc( + ), s = Oc( l, i, /*$$scope*/ @@ -946,22 +946,22 @@ function Gc(i) { ); return { c() { - e = Ks("div"), t = Ks("div"), s && s.c(), Cl(t, "class", "icon svelte-3w3rth"), Cl(e, "class", "empty svelte-3w3rth"), Cl(e, "aria-label", "Empty value"), It( + e = Qs("div"), t = Qs("div"), s && s.c(), Sl(t, "class", "icon svelte-3w3rth"), Sl(e, "class", "empty svelte-3w3rth"), Sl(e, "aria-label", "Empty value"), jt( e, "small", /*size*/ i[0] === "small" - ), It( + ), jt( e, "large", /*size*/ i[0] === "large" - ), It( + ), jt( e, "unpadded_box", /*unpadded_box*/ i[1] - ), It( + ), jt( e, "small_parent", /*parent_height*/ @@ -969,47 +969,47 @@ function Gc(i) { ); }, m(o, r) { - Vc(o, e, r), Ic(e, t), s && s.m(t, null), i[6](e), n = !0; + Jc(o, e, r), Vc(e, t), s && s.m(t, null), i[6](e), n = !0; }, p(o, [r]) { s && s.p && (!n || r & /*$$scope*/ - 16) && Zc( + 16) && eu( s, l, o, /*$$scope*/ o[4], - n ? Fc( + n ? Gc( l, /*$$scope*/ o[4], r, null - ) : jc( + ) : Zc( /*$$scope*/ o[4] ), null ), (!n || r & /*size*/ - 1) && It( + 1) && jt( e, "small", /*size*/ o[0] === "small" ), (!n || r & /*size*/ - 1) && It( + 1) && jt( e, "large", /*size*/ o[0] === "large" ), (!n || r & /*unpadded_box*/ - 2) && It( + 2) && jt( e, "unpadded_box", /*unpadded_box*/ o[1] ), (!n || r & /*parent_height*/ - 8) && It( + 8) && jt( e, "small_parent", /*parent_height*/ @@ -1017,17 +1017,17 @@ function Gc(i) { ); }, i(o) { - n || (Oc(s, o), n = !0); + n || (xc(s, o), n = !0); }, o(o) { - Pc(s, o), n = !1; + $c(s, o), n = !1; }, d(o) { - o && Yc(e), s && s.d(o), i[6](null); + o && Pc(e), s && s.d(o), i[6](null); } }; } -function Kc(i, e, t) { +function nu(i, e, t) { let n, { $$slots: l = {}, $$scope: s } = e, { size: o = "small" } = e, { unpadded_box: r = !1 } = e, a; function f(u) { var _; @@ -1036,7 +1036,7 @@ function Kc(i, e, t) { return d > m + 2; } function c(u) { - Tc[u ? "unshift" : "push"](() => { + Nc[u ? "unshift" : "push"](() => { a = u, t(2, a); }); } @@ -1047,476 +1047,476 @@ function Kc(i, e, t) { 4 && t(3, n = f(a)); }, [o, r, a, n, s, l, c]; } -class Jc extends Hc { +class iu extends Uc { constructor(e) { - super(), Uc(this, e, Kc, Gc, Nc, { size: 0, unpadded_box: 1 }); + super(), Kc(this, e, nu, tu, Qc, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: Qc, - append: Js, + SvelteComponent: lu, + append: xs, attr: Be, - detach: xc, - init: $c, - insert: eu, - noop: Sl, - safe_not_equal: tu, - svg_element: zl + detach: su, + init: ou, + insert: au, + noop: zl, + safe_not_equal: ru, + svg_element: Bl } = window.__gradio__svelte__internal; -function nu(i) { +function fu(i) { let e, t, n; return { c() { - e = zl("svg"), t = zl("path"), n = zl("circle"), Be(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), Be(n, "cx", "12"), Be(n, "cy", "13"), Be(n, "r", "4"), Be(e, "xmlns", "http://www.w3.org/2000/svg"), Be(e, "width", "100%"), Be(e, "height", "100%"), Be(e, "viewBox", "0 0 24 24"), Be(e, "fill", "none"), Be(e, "stroke", "currentColor"), Be(e, "stroke-width", "1.5"), Be(e, "stroke-linecap", "round"), Be(e, "stroke-linejoin", "round"), Be(e, "class", "feather feather-camera"); + e = Bl("svg"), t = Bl("path"), n = Bl("circle"), Be(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), Be(n, "cx", "12"), Be(n, "cy", "13"), Be(n, "r", "4"), Be(e, "xmlns", "http://www.w3.org/2000/svg"), Be(e, "width", "100%"), Be(e, "height", "100%"), Be(e, "viewBox", "0 0 24 24"), Be(e, "fill", "none"), Be(e, "stroke", "currentColor"), Be(e, "stroke-width", "1.5"), Be(e, "stroke-linecap", "round"), Be(e, "stroke-linejoin", "round"), Be(e, "class", "feather feather-camera"); }, m(l, s) { - eu(l, e, s), Js(e, t), Js(e, n); + au(l, e, s), xs(e, t), xs(e, n); }, - p: Sl, - i: Sl, - o: Sl, + p: zl, + i: zl, + o: zl, d(l) { - l && xc(e); - } - }; -} -class iu extends Qc { - constructor(e) { - super(), $c(this, e, null, nu, tu, {}); - } -} -const { - SvelteComponent: lu, - append: su, - attr: $e, - detach: ou, - init: au, - insert: ru, - noop: Bl, - safe_not_equal: fu, - svg_element: Qs -} = window.__gradio__svelte__internal; -function cu(i) { - let e, t; - return { - c() { - e = Qs("svg"), t = Qs("circle"), $e(t, "cx", "12"), $e(t, "cy", "12"), $e(t, "r", "10"), $e(e, "xmlns", "http://www.w3.org/2000/svg"), $e(e, "width", "100%"), $e(e, "height", "100%"), $e(e, "viewBox", "0 0 24 24"), $e(e, "stroke-width", "1.5"), $e(e, "stroke-linecap", "round"), $e(e, "stroke-linejoin", "round"), $e(e, "class", "feather feather-circle"); - }, - m(n, l) { - ru(n, e, l), su(e, t); - }, - p: Bl, - i: Bl, - o: Bl, - d(n) { - n && ou(e); + l && su(e); } }; } -class uu extends lu { +class cu extends lu { constructor(e) { - super(), au(this, e, null, cu, fu, {}); + super(), ou(this, e, null, fu, ru, {}); } } const { - SvelteComponent: _u, - append: ql, - attr: et, + SvelteComponent: uu, + append: _u, + attr: xe, detach: du, init: hu, insert: mu, noop: Dl, safe_not_equal: gu, - set_style: ft, - svg_element: pi + svg_element: $s } = window.__gradio__svelte__internal; function bu(i) { - let e, t, n, l; + let e, t; return { c() { - e = pi("svg"), t = pi("g"), n = pi("path"), l = pi("path"), et(n, "d", "M18,6L6.087,17.913"), ft(n, "fill", "none"), ft(n, "fill-rule", "nonzero"), ft(n, "stroke-width", "2px"), et(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), et(l, "d", "M4.364,4.364L19.636,19.636"), ft(l, "fill", "none"), ft(l, "fill-rule", "nonzero"), ft(l, "stroke-width", "2px"), et(e, "width", "100%"), et(e, "height", "100%"), et(e, "viewBox", "0 0 24 24"), et(e, "version", "1.1"), et(e, "xmlns", "http://www.w3.org/2000/svg"), et(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), et(e, "xml:space", "preserve"), et(e, "stroke", "currentColor"), ft(e, "fill-rule", "evenodd"), ft(e, "clip-rule", "evenodd"), ft(e, "stroke-linecap", "round"), ft(e, "stroke-linejoin", "round"); + e = $s("svg"), t = $s("circle"), xe(t, "cx", "12"), xe(t, "cy", "12"), xe(t, "r", "10"), xe(e, "xmlns", "http://www.w3.org/2000/svg"), xe(e, "width", "100%"), xe(e, "height", "100%"), xe(e, "viewBox", "0 0 24 24"), xe(e, "stroke-width", "1.5"), xe(e, "stroke-linecap", "round"), xe(e, "stroke-linejoin", "round"), xe(e, "class", "feather feather-circle"); }, - m(s, o) { - mu(s, e, o), ql(e, t), ql(t, n), ql(e, l); + m(n, l) { + mu(n, e, l), _u(e, t); }, p: Dl, i: Dl, o: Dl, - d(s) { - s && du(e); + d(n) { + n && du(e); } }; } -class Za extends _u { +class wu extends uu { constructor(e) { super(), hu(this, e, null, bu, gu, {}); } } const { - SvelteComponent: wu, - append: vu, - attr: Kn, - detach: pu, + SvelteComponent: pu, + append: ql, + attr: $e, + detach: vu, init: ku, insert: yu, noop: Ll, safe_not_equal: Cu, - svg_element: xs + set_style: ft, + svg_element: Ci } = window.__gradio__svelte__internal; function Su(i) { - let e, t; + let e, t, n, l; return { c() { - e = xs("svg"), t = xs("path"), Kn(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"), Kn(t, "fill", "currentColor"), Kn(e, "id", "icon"), Kn(e, "xmlns", "http://www.w3.org/2000/svg"), Kn(e, "viewBox", "0 0 32 32"); + e = Ci("svg"), t = Ci("g"), n = Ci("path"), l = Ci("path"), $e(n, "d", "M18,6L6.087,17.913"), ft(n, "fill", "none"), ft(n, "fill-rule", "nonzero"), ft(n, "stroke-width", "2px"), $e(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), $e(l, "d", "M4.364,4.364L19.636,19.636"), ft(l, "fill", "none"), ft(l, "fill-rule", "nonzero"), ft(l, "stroke-width", "2px"), $e(e, "width", "100%"), $e(e, "height", "100%"), $e(e, "viewBox", "0 0 24 24"), $e(e, "version", "1.1"), $e(e, "xmlns", "http://www.w3.org/2000/svg"), $e(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), $e(e, "xml:space", "preserve"), $e(e, "stroke", "currentColor"), ft(e, "fill-rule", "evenodd"), ft(e, "clip-rule", "evenodd"), ft(e, "stroke-linecap", "round"), ft(e, "stroke-linejoin", "round"); }, - m(n, l) { - yu(n, e, l), vu(e, t); + m(s, o) { + yu(s, e, o), ql(e, t), ql(t, n), ql(e, l); }, p: Ll, i: Ll, o: Ll, - d(n) { - n && pu(e); + d(s) { + s && vu(e); } }; } -class zu extends wu { +class Ka extends pu { constructor(e) { super(), ku(this, e, null, Su, Cu, {}); } } const { - SvelteComponent: Bu, - append: qu, - attr: Cn, + SvelteComponent: zu, + append: Bu, + attr: Qn, detach: Du, - init: Lu, - insert: Eu, - noop: El, + init: qu, + insert: Lu, + noop: Ml, safe_not_equal: Mu, - svg_element: $s + svg_element: eo } = window.__gradio__svelte__internal; -function Ru(i) { +function Eu(i) { let e, t; return { c() { - e = $s("svg"), t = $s("path"), Cn(t, "fill", "currentColor"), Cn(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"), Cn(e, "xmlns", "http://www.w3.org/2000/svg"), Cn(e, "width", "100%"), Cn(e, "height", "100%"), Cn(e, "viewBox", "0 0 32 32"); + e = eo("svg"), t = eo("path"), Qn(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"), Qn(t, "fill", "currentColor"), Qn(e, "id", "icon"), Qn(e, "xmlns", "http://www.w3.org/2000/svg"), Qn(e, "viewBox", "0 0 32 32"); }, m(n, l) { - Eu(n, e, l), qu(e, t); + Lu(n, e, l), Bu(e, t); }, - p: El, - i: El, - o: El, + p: Ml, + i: Ml, + o: Ml, d(n) { n && Du(e); } }; } -class Au extends Bu { +class Ru extends zu { constructor(e) { - super(), Lu(this, e, null, Ru, Mu, {}); + super(), qu(this, e, null, Eu, Mu, {}); } } const { - SvelteComponent: Wu, - append: Hu, - attr: Sn, - detach: Iu, - init: Tu, - insert: Xu, - noop: Ml, - safe_not_equal: Yu, - svg_element: eo + SvelteComponent: Au, + append: Wu, + attr: Bn, + detach: Xu, + init: Yu, + insert: Iu, + noop: El, + safe_not_equal: Hu, + svg_element: to } = window.__gradio__svelte__internal; -function ju(i) { +function Tu(i) { let e, t; return { c() { - e = eo("svg"), t = eo("path"), Sn(t, "d", "M5 8l4 4 4-4z"), Sn(e, "class", "dropdown-arrow svelte-145leq6"), Sn(e, "xmlns", "http://www.w3.org/2000/svg"), Sn(e, "width", "100%"), Sn(e, "height", "100%"), Sn(e, "viewBox", "0 0 18 18"); + e = to("svg"), t = to("path"), Bn(t, "fill", "currentColor"), Bn(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"), Bn(e, "xmlns", "http://www.w3.org/2000/svg"), Bn(e, "width", "100%"), Bn(e, "height", "100%"), Bn(e, "viewBox", "0 0 32 32"); }, m(n, l) { - Xu(n, e, l), Hu(e, t); + Iu(n, e, l), Wu(e, t); }, - p: Ml, - i: Ml, - o: Ml, + p: El, + i: El, + o: El, d(n) { - n && Iu(e); + n && Xu(e); } }; } -class Rs extends Wu { +class ju extends Au { constructor(e) { - super(), Tu(this, e, null, ju, Yu, {}); + super(), Yu(this, e, null, Tu, Hu, {}); } } const { SvelteComponent: Fu, - append: Rl, - attr: ue, - detach: Uu, - init: Vu, - insert: Nu, - noop: Al, - safe_not_equal: Ou, - svg_element: ki + append: Uu, + attr: Dn, + detach: Vu, + init: Nu, + insert: Ou, + noop: Rl, + safe_not_equal: Pu, + svg_element: no } = window.__gradio__svelte__internal; -function Pu(i) { - let e, t, n, l; +function Zu(i) { + let e, t; return { c() { - e = ki("svg"), t = ki("rect"), n = ki("circle"), l = ki("polyline"), ue(t, "x", "3"), ue(t, "y", "3"), ue(t, "width", "18"), ue(t, "height", "18"), ue(t, "rx", "2"), ue(t, "ry", "2"), ue(n, "cx", "8.5"), ue(n, "cy", "8.5"), ue(n, "r", "1.5"), ue(l, "points", "21 15 16 10 5 21"), ue(e, "xmlns", "http://www.w3.org/2000/svg"), ue(e, "width", "100%"), ue(e, "height", "100%"), ue(e, "viewBox", "0 0 24 24"), ue(e, "fill", "none"), ue(e, "stroke", "currentColor"), ue(e, "stroke-width", "1.5"), ue(e, "stroke-linecap", "round"), ue(e, "stroke-linejoin", "round"), ue(e, "class", "feather feather-image"); + e = no("svg"), t = no("path"), Dn(t, "d", "M5 8l4 4 4-4z"), Dn(e, "class", "dropdown-arrow svelte-145leq6"), Dn(e, "xmlns", "http://www.w3.org/2000/svg"), Dn(e, "width", "100%"), Dn(e, "height", "100%"), Dn(e, "viewBox", "0 0 18 18"); }, - m(s, o) { - Nu(s, e, o), Rl(e, t), Rl(e, n), Rl(e, l); + m(n, l) { + Ou(n, e, l), Uu(e, t); }, - p: Al, - i: Al, - o: Al, - d(s) { - s && Uu(e); + p: Rl, + i: Rl, + o: Rl, + d(n) { + n && Vu(e); } }; } -let Ga = class extends Fu { +class As extends Fu { constructor(e) { - super(), Vu(this, e, null, Pu, Ou, {}); + super(), Nu(this, e, null, Zu, Pu, {}); } -}; +} const { - SvelteComponent: Zu, - append: Gu, - attr: yi, + SvelteComponent: Gu, + append: Al, + attr: _e, detach: Ku, init: Ju, insert: Qu, noop: Wl, safe_not_equal: xu, - svg_element: to + svg_element: Si } = window.__gradio__svelte__internal; function $u(i) { - let e, t; + let e, t, n, l; return { c() { - e = to("svg"), t = to("path"), yi(t, "fill", "currentColor"), yi(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"), yi(e, "xmlns", "http://www.w3.org/2000/svg"), yi(e, "viewBox", "0 0 24 24"); + e = Si("svg"), t = Si("rect"), n = Si("circle"), l = Si("polyline"), _e(t, "x", "3"), _e(t, "y", "3"), _e(t, "width", "18"), _e(t, "height", "18"), _e(t, "rx", "2"), _e(t, "ry", "2"), _e(n, "cx", "8.5"), _e(n, "cy", "8.5"), _e(n, "r", "1.5"), _e(l, "points", "21 15 16 10 5 21"), _e(e, "xmlns", "http://www.w3.org/2000/svg"), _e(e, "width", "100%"), _e(e, "height", "100%"), _e(e, "viewBox", "0 0 24 24"), _e(e, "fill", "none"), _e(e, "stroke", "currentColor"), _e(e, "stroke-width", "1.5"), _e(e, "stroke-linecap", "round"), _e(e, "stroke-linejoin", "round"), _e(e, "class", "feather feather-image"); }, - m(n, l) { - Qu(n, e, l), Gu(e, t); + m(s, o) { + Qu(s, e, o), Al(e, t), Al(e, n), Al(e, l); }, p: Wl, i: Wl, o: Wl, - d(n) { - n && Ku(e); + d(s) { + s && Ku(e); } }; } -class Ka extends Zu { +let Ja = class extends Gu { constructor(e) { super(), Ju(this, e, null, $u, xu, {}); } -} +}; const { SvelteComponent: e_, - append: Ci, - attr: _e, - detach: t_, - init: n_, - insert: i_, - noop: Hl, - safe_not_equal: l_, - svg_element: Jn + append: t_, + attr: zi, + detach: n_, + init: i_, + insert: l_, + noop: Xl, + safe_not_equal: s_, + svg_element: io } = window.__gradio__svelte__internal; -function s_(i) { - let e, t, n, l, s; +function o_(i) { + let e, t; return { c() { - e = Jn("svg"), t = Jn("path"), n = Jn("path"), l = Jn("line"), s = Jn("line"), _e(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), _e(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), _e(l, "x1", "12"), _e(l, "y1", "19"), _e(l, "x2", "12"), _e(l, "y2", "23"), _e(s, "x1", "8"), _e(s, "y1", "23"), _e(s, "x2", "16"), _e(s, "y2", "23"), _e(e, "xmlns", "http://www.w3.org/2000/svg"), _e(e, "width", "100%"), _e(e, "height", "100%"), _e(e, "viewBox", "0 0 24 24"), _e(e, "fill", "none"), _e(e, "stroke", "currentColor"), _e(e, "stroke-width", "2"), _e(e, "stroke-linecap", "round"), _e(e, "stroke-linejoin", "round"), _e(e, "class", "feather feather-mic"); + e = io("svg"), t = io("path"), zi(t, "fill", "currentColor"), zi(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"), zi(e, "xmlns", "http://www.w3.org/2000/svg"), zi(e, "viewBox", "0 0 24 24"); }, - m(o, r) { - i_(o, e, r), Ci(e, t), Ci(e, n), Ci(e, l), Ci(e, s); + m(n, l) { + l_(n, e, l), t_(e, t); }, - p: Hl, - i: Hl, - o: Hl, - d(o) { - o && t_(e); + p: Xl, + i: Xl, + o: Xl, + d(n) { + n && n_(e); } }; } -class o_ extends e_ { +class Qa extends e_ { constructor(e) { - super(), n_(this, e, null, s_, l_, {}); + super(), i_(this, e, null, o_, s_, {}); } } const { SvelteComponent: a_, - append: no, - attr: Ve, + append: Bi, + attr: de, detach: r_, init: f_, insert: c_, - noop: Il, + noop: Yl, safe_not_equal: u_, - set_style: __, - svg_element: Tl + svg_element: xn +} = window.__gradio__svelte__internal; +function __(i) { + let e, t, n, l, s; + return { + c() { + e = xn("svg"), t = xn("path"), n = xn("path"), l = xn("line"), s = xn("line"), de(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), de(n, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), de(l, "x1", "12"), de(l, "y1", "19"), de(l, "x2", "12"), de(l, "y2", "23"), de(s, "x1", "8"), de(s, "y1", "23"), de(s, "x2", "16"), de(s, "y2", "23"), de(e, "xmlns", "http://www.w3.org/2000/svg"), de(e, "width", "100%"), de(e, "height", "100%"), de(e, "viewBox", "0 0 24 24"), de(e, "fill", "none"), de(e, "stroke", "currentColor"), de(e, "stroke-width", "2"), de(e, "stroke-linecap", "round"), de(e, "stroke-linejoin", "round"), de(e, "class", "feather feather-mic"); + }, + m(o, r) { + c_(o, e, r), Bi(e, t), Bi(e, n), Bi(e, l), Bi(e, s); + }, + p: Yl, + i: Yl, + o: Yl, + d(o) { + o && r_(e); + } + }; +} +class d_ extends a_ { + constructor(e) { + super(), f_(this, e, null, __, u_, {}); + } +} +const { + SvelteComponent: h_, + append: lo, + attr: Ue, + detach: m_, + init: g_, + insert: b_, + noop: Il, + safe_not_equal: w_, + set_style: p_, + svg_element: Hl } = window.__gradio__svelte__internal; -function d_(i) { +function v_(i) { let e, t, n; return { c() { - e = Tl("svg"), t = Tl("polyline"), n = Tl("path"), Ve(t, "points", "1 4 1 10 7 10"), Ve(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Ve(e, "xmlns", "http://www.w3.org/2000/svg"), Ve(e, "width", "100%"), Ve(e, "height", "100%"), Ve(e, "viewBox", "0 0 24 24"), Ve(e, "fill", "none"), Ve(e, "stroke", "currentColor"), Ve(e, "stroke-width", "2"), Ve(e, "stroke-linecap", "round"), Ve(e, "stroke-linejoin", "round"), Ve(e, "class", "feather feather-rotate-ccw"), __(e, "transform", "rotateY(180deg)"); + e = Hl("svg"), t = Hl("polyline"), n = Hl("path"), Ue(t, "points", "1 4 1 10 7 10"), Ue(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Ue(e, "xmlns", "http://www.w3.org/2000/svg"), Ue(e, "width", "100%"), Ue(e, "height", "100%"), Ue(e, "viewBox", "0 0 24 24"), Ue(e, "fill", "none"), Ue(e, "stroke", "currentColor"), Ue(e, "stroke-width", "2"), Ue(e, "stroke-linecap", "round"), Ue(e, "stroke-linejoin", "round"), Ue(e, "class", "feather feather-rotate-ccw"), p_(e, "transform", "rotateY(180deg)"); }, m(l, s) { - c_(l, e, s), no(e, t), no(e, n); + b_(l, e, s), lo(e, t), lo(e, n); }, p: Il, i: Il, o: Il, d(l) { - l && r_(e); + l && m_(e); } }; } -class h_ extends a_ { +class k_ extends h_ { constructor(e) { - super(), f_(this, e, null, d_, u_, {}); + super(), g_(this, e, null, v_, w_, {}); } } const { - SvelteComponent: m_, - append: g_, - attr: qe, - detach: b_, - init: w_, - insert: v_, - noop: Xl, - safe_not_equal: p_, - svg_element: io + SvelteComponent: y_, + append: C_, + attr: De, + detach: S_, + init: z_, + insert: B_, + noop: Tl, + safe_not_equal: D_, + svg_element: so } = window.__gradio__svelte__internal; -function k_(i) { +function q_(i) { let e, t; return { c() { - e = io("svg"), t = io("rect"), qe(t, "x", "3"), qe(t, "y", "3"), qe(t, "width", "18"), qe(t, "height", "18"), qe(t, "rx", "2"), qe(t, "ry", "2"), qe(e, "xmlns", "http://www.w3.org/2000/svg"), qe(e, "width", "100%"), qe(e, "height", "100%"), qe(e, "viewBox", "0 0 24 24"), qe(e, "stroke-width", "1.5"), qe(e, "stroke-linecap", "round"), qe(e, "stroke-linejoin", "round"), qe(e, "class", "feather feather-square"); + e = so("svg"), t = so("rect"), De(t, "x", "3"), De(t, "y", "3"), De(t, "width", "18"), De(t, "height", "18"), De(t, "rx", "2"), De(t, "ry", "2"), De(e, "xmlns", "http://www.w3.org/2000/svg"), De(e, "width", "100%"), De(e, "height", "100%"), De(e, "viewBox", "0 0 24 24"), De(e, "stroke-width", "1.5"), De(e, "stroke-linecap", "round"), De(e, "stroke-linejoin", "round"), De(e, "class", "feather feather-square"); }, m(n, l) { - v_(n, e, l), g_(e, t); + B_(n, e, l), C_(e, t); }, - p: Xl, - i: Xl, - o: Xl, + p: Tl, + i: Tl, + o: Tl, d(n) { - n && b_(e); + n && S_(e); } }; } -class y_ extends m_ { +class L_ extends y_ { constructor(e) { - super(), w_(this, e, null, k_, p_, {}); + super(), z_(this, e, null, q_, D_, {}); } } const { - SvelteComponent: C_, - append: lo, - attr: Ne, - detach: S_, - init: z_, - insert: B_, - noop: Yl, - safe_not_equal: q_, - svg_element: jl + SvelteComponent: M_, + append: oo, + attr: Ve, + detach: E_, + init: R_, + insert: A_, + noop: jl, + safe_not_equal: W_, + svg_element: Fl } = window.__gradio__svelte__internal; -function D_(i) { +function X_(i) { let e, t, n; return { c() { - e = jl("svg"), t = jl("polyline"), n = jl("path"), Ne(t, "points", "1 4 1 10 7 10"), Ne(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Ne(e, "xmlns", "http://www.w3.org/2000/svg"), Ne(e, "width", "100%"), Ne(e, "height", "100%"), Ne(e, "viewBox", "0 0 24 24"), Ne(e, "fill", "none"), Ne(e, "stroke", "currentColor"), Ne(e, "stroke-width", "2"), Ne(e, "stroke-linecap", "round"), Ne(e, "stroke-linejoin", "round"), Ne(e, "class", "feather feather-rotate-ccw"); + e = Fl("svg"), t = Fl("polyline"), n = Fl("path"), Ve(t, "points", "1 4 1 10 7 10"), Ve(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Ve(e, "xmlns", "http://www.w3.org/2000/svg"), Ve(e, "width", "100%"), Ve(e, "height", "100%"), Ve(e, "viewBox", "0 0 24 24"), Ve(e, "fill", "none"), Ve(e, "stroke", "currentColor"), Ve(e, "stroke-width", "2"), Ve(e, "stroke-linecap", "round"), Ve(e, "stroke-linejoin", "round"), Ve(e, "class", "feather feather-rotate-ccw"); }, m(l, s) { - B_(l, e, s), lo(e, t), lo(e, n); + A_(l, e, s), oo(e, t), oo(e, n); }, - p: Yl, - i: Yl, - o: Yl, + p: jl, + i: jl, + o: jl, d(l) { - l && S_(e); + l && E_(e); } }; } -class L_ extends C_ { +class Y_ extends M_ { constructor(e) { - super(), z_(this, e, null, D_, q_, {}); + super(), R_(this, e, null, X_, W_, {}); } } const { - SvelteComponent: E_, - append: Fl, - attr: we, - detach: M_, - init: R_, - insert: A_, - noop: Ul, - safe_not_equal: W_, - svg_element: Si + SvelteComponent: I_, + append: Ul, + attr: ve, + detach: H_, + init: T_, + insert: j_, + noop: Vl, + safe_not_equal: F_, + svg_element: Di } = window.__gradio__svelte__internal; -function H_(i) { +function U_(i) { let e, t, n, l; return { c() { - e = Si("svg"), t = Si("path"), n = Si("polyline"), l = Si("line"), we(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), we(n, "points", "17 8 12 3 7 8"), we(l, "x1", "12"), we(l, "y1", "3"), we(l, "x2", "12"), we(l, "y2", "15"), we(e, "xmlns", "http://www.w3.org/2000/svg"), we(e, "width", "90%"), we(e, "height", "90%"), we(e, "viewBox", "0 0 24 24"), we(e, "fill", "none"), we(e, "stroke", "currentColor"), we(e, "stroke-width", "2"), we(e, "stroke-linecap", "round"), we(e, "stroke-linejoin", "round"), we(e, "class", "feather feather-upload"); + e = Di("svg"), t = Di("path"), n = Di("polyline"), l = Di("line"), ve(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ve(n, "points", "17 8 12 3 7 8"), ve(l, "x1", "12"), ve(l, "y1", "3"), ve(l, "x2", "12"), ve(l, "y2", "15"), ve(e, "xmlns", "http://www.w3.org/2000/svg"), ve(e, "width", "90%"), ve(e, "height", "90%"), ve(e, "viewBox", "0 0 24 24"), ve(e, "fill", "none"), ve(e, "stroke", "currentColor"), ve(e, "stroke-width", "2"), ve(e, "stroke-linecap", "round"), ve(e, "stroke-linejoin", "round"), ve(e, "class", "feather feather-upload"); }, m(s, o) { - A_(s, e, o), Fl(e, t), Fl(e, n), Fl(e, l); + j_(s, e, o), Ul(e, t), Ul(e, n), Ul(e, l); }, - p: Ul, - i: Ul, - o: Ul, + p: Vl, + i: Vl, + o: Vl, d(s) { - s && M_(e); + s && H_(e); } }; } -let Ja = class extends E_ { +let xa = class extends I_ { constructor(e) { - super(), R_(this, e, null, H_, W_, {}); + super(), T_(this, e, null, U_, F_, {}); } }; const { - SvelteComponent: I_, - append: so, - attr: Tt, - detach: T_, - init: X_, - insert: Y_, - noop: Vl, - safe_not_equal: j_, - svg_element: Nl + SvelteComponent: V_, + append: ao, + attr: Ft, + detach: N_, + init: O_, + insert: P_, + noop: Nl, + safe_not_equal: Z_, + svg_element: Ol } = window.__gradio__svelte__internal; -function F_(i) { +function G_(i) { let e, t, n; return { c() { - e = Nl("svg"), t = Nl("path"), n = Nl("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"); + e = Ol("svg"), t = Ol("path"), n = Ol("path"), Ft(t, "fill", "currentColor"), Ft(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"), Ft(n, "fill", "currentColor"), Ft(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"), Ft(e, "xmlns", "http://www.w3.org/2000/svg"), Ft(e, "width", "100%"), Ft(e, "height", "100%"), Ft(e, "viewBox", "0 0 24 24"); }, m(l, s) { - Y_(l, e, s), so(e, t), so(e, n); + P_(l, e, s), ao(e, t), ao(e, n); }, - p: Vl, - i: Vl, - o: Vl, + p: Nl, + i: Nl, + o: Nl, d(l) { - l && T_(e); + l && N_(e); } }; } -let Qa = class extends I_ { +let $a = class extends V_ { constructor(e) { - super(), X_(this, e, null, F_, j_, {}); + super(), O_(this, e, null, G_, Z_, {}); } }; -const U_ = [ +const K_ = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -1527,7 +1527,7 @@ const U_ = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], oo = { +], ro = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -1820,27 +1820,27 @@ const U_ = [ 950: "#4c0519" } }; -U_.reduce( +K_.reduce( (i, { color: e, primary: t, secondary: n }) => ({ ...i, [e]: { - primary: oo[e][t], - secondary: oo[e][n] + primary: ro[e][t], + secondary: ro[e][n] } }), {} ); -class Ui extends Error { +class Oi extends Error { constructor(e) { super(e), this.name = "ShareError"; } } -async function V_(i, e) { +async function J_(i, e) { var a; if (window.__gradio_space__ == null) - throw new Ui("Must be on Spaces to share."); + throw new Oi("Must be on Spaces to share."); let t, n, l; - t = N_(i), n = i.split(";")[0].split(":")[1], l = "file" + n.split("/")[1]; + t = Q_(i), n = i.split(";")[0].split(":")[1], l = "file" + n.split("/")[1]; const s = new File([t], l, { type: n }), o = await fetch("https://huggingface.co/uploads", { method: "POST", body: s, @@ -1852,32 +1852,32 @@ async function V_(i, e) { if (!o.ok) { if ((a = o.headers.get("content-type")) != null && a.includes("application/json")) { const f = await o.json(); - throw new Ui(`Upload failed: ${f.error}`); + throw new Oi(`Upload failed: ${f.error}`); } - throw new Ui("Upload failed."); + throw new Oi("Upload failed."); } return await o.text(); } -function N_(i) { +function Q_(i) { for (var e = i.split(","), t = e[0].match(/:(.*?);/)[1], n = atob(e[1]), l = n.length, s = new Uint8Array(l); l--; ) s[l] = n.charCodeAt(l); return new Blob([s], { type: t }); } const { - SvelteComponent: O_, - create_component: P_, - destroy_component: Z_, - init: G_, - mount_component: K_, - safe_not_equal: J_, - transition_in: Q_, - transition_out: x_ -} = window.__gradio__svelte__internal, { createEventDispatcher: $_ } = window.__gradio__svelte__internal; -function ed(i) { + SvelteComponent: x_, + create_component: $_, + destroy_component: ed, + init: td, + mount_component: nd, + safe_not_equal: id, + transition_in: ld, + transition_out: sd +} = window.__gradio__svelte__internal, { createEventDispatcher: od } = window.__gradio__svelte__internal; +function ad(i) { let e, t; - return e = new ol({ + return e = new fl({ props: { - Icon: zu, + Icon: Ru, label: ( /*i18n*/ i[2]("common.share") @@ -1893,10 +1893,10 @@ function ed(i) { i[5] ), { c() { - P_(e.$$.fragment); + $_(e.$$.fragment); }, m(n, l) { - K_(e, n, l), t = !0; + nd(e, n, l), t = !0; }, p(n, [l]) { const s = {}; @@ -1907,18 +1907,18 @@ function ed(i) { n[3]), e.$set(s); }, i(n) { - t || (Q_(e.$$.fragment, n), t = !0); + t || (ld(e.$$.fragment, n), t = !0); }, o(n) { - x_(e.$$.fragment, n), t = !1; + sd(e.$$.fragment, n), t = !1; }, d(n) { - Z_(e, n); + ed(e, n); } }; } -function td(i, e, t) { - const n = $_(); +function rd(i, e, t) { + const n = od(); let { formatter: l } = e, { value: s } = e, { i18n: o } = e, r = !1; const a = async () => { try { @@ -1927,7 +1927,7 @@ function td(i, e, t) { n("share", { description: f }); } catch (f) { console.error(f); - let c = f instanceof Ui ? f.message : "Share failed."; + let c = f instanceof Oi ? f.message : "Share failed."; n("error", c); } finally { t(3, r = !1); @@ -1937,73 +1937,73 @@ function td(i, e, t) { "formatter" in f && t(0, l = f.formatter), "value" in f && t(1, s = f.value), "i18n" in f && t(2, o = f.i18n); }, [l, s, o, r, n, a]; } -class nd extends O_ { +class fd extends x_ { constructor(e) { - super(), G_(this, e, td, ed, J_, { formatter: 0, value: 1, i18n: 2 }); + super(), td(this, e, rd, ad, id, { formatter: 0, value: 1, i18n: 2 }); } } const { - SvelteComponent: id, - append: sn, - attr: ds, - check_outros: ld, - create_component: xa, - destroy_component: $a, - detach: Vi, - element: hs, - group_outros: sd, - init: od, - insert: Ni, - mount_component: er, - safe_not_equal: ad, - set_data: ms, - space: gs, - text: ni, - toggle_class: ao, - transition_in: Zi, - transition_out: Gi + SvelteComponent: cd, + append: rn, + attr: hs, + check_outros: ud, + create_component: er, + destroy_component: tr, + detach: Pi, + element: ms, + group_outros: _d, + init: dd, + insert: Zi, + mount_component: nr, + safe_not_equal: hd, + set_data: gs, + space: bs, + text: li, + toggle_class: fo, + transition_in: Ji, + transition_out: Qi } = window.__gradio__svelte__internal; -function rd(i) { +function md(i) { let e, t; - return e = new Ja({}), { + return e = new xa({}), { c() { - xa(e.$$.fragment); + er(e.$$.fragment); }, m(n, l) { - er(e, n, l), t = !0; + nr(e, n, l), t = !0; }, i(n) { - t || (Zi(e.$$.fragment, n), t = !0); + t || (Ji(e.$$.fragment, n), t = !0); }, o(n) { - Gi(e.$$.fragment, n), t = !1; + Qi(e.$$.fragment, n), t = !1; }, d(n) { - $a(e, n); + tr(e, n); } }; } -function fd(i) { +function gd(i) { let e, t; - return e = new Ka({}), { + return e = new Qa({}), { c() { - xa(e.$$.fragment); + er(e.$$.fragment); }, m(n, l) { - er(e, n, l), t = !0; + nr(e, n, l), t = !0; }, i(n) { - t || (Zi(e.$$.fragment, n), t = !0); + t || (Ji(e.$$.fragment, n), t = !0); }, o(n) { - Gi(e.$$.fragment, n), t = !1; + Qi(e.$$.fragment, n), t = !1; }, d(n) { - $a(e, n); + tr(e, n); } }; } -function ro(i) { +function co(i) { let e, t, n = ( /*i18n*/ i[1]("common.or") + "" @@ -2014,25 +2014,25 @@ function ro(i) { ), a; return { c() { - e = hs("span"), t = ni("- "), l = ni(n), s = ni(" -"), o = gs(), a = ni(r), ds(e, "class", "or svelte-kzcjhc"); + e = ms("span"), t = li("- "), l = li(n), s = li(" -"), o = bs(), a = li(r), hs(e, "class", "or svelte-kzcjhc"); }, m(f, c) { - Ni(f, e, c), sn(e, t), sn(e, l), sn(e, s), Ni(f, o, c), Ni(f, a, c); + Zi(f, e, c), rn(e, t), rn(e, l), rn(e, s), Zi(f, o, c), Zi(f, a, c); }, p(f, c) { c & /*i18n*/ 2 && n !== (n = /*i18n*/ - f[1]("common.or") + "") && ms(l, n), c & /*message, i18n*/ + f[1]("common.or") + "") && gs(l, n), c & /*message, i18n*/ 6 && r !== (r = /*message*/ (f[2] || /*i18n*/ - f[1]("upload_text.click_to_upload")) + "") && ms(a, r); + f[1]("upload_text.click_to_upload")) + "") && gs(a, r); }, d(f) { - f && (Vi(e), Vi(o), Vi(a)); + f && (Pi(e), Pi(o), Pi(a)); } }; } -function cd(i) { +function bd(i) { let e, t, n, l, s, o = ( /*i18n*/ i[1]( @@ -2044,7 +2044,7 @@ function cd(i) { i[5].file ) + "" ), r, a, f; - const c = [fd, rd], u = []; + const c = [gd, md], u = []; function _(m, h) { return ( /*type*/ @@ -2054,26 +2054,26 @@ function cd(i) { n = _(i), l = u[n] = c[n](i); let d = ( /*mode*/ - i[3] !== "short" && ro(i) + i[3] !== "short" && co(i) ); return { c() { - e = hs("div"), t = hs("span"), l.c(), s = gs(), r = ni(o), a = gs(), d && d.c(), ds(t, "class", "icon-wrap svelte-kzcjhc"), ao( + e = ms("div"), t = ms("span"), l.c(), s = bs(), r = li(o), a = bs(), d && d.c(), hs(t, "class", "icon-wrap svelte-kzcjhc"), fo( t, "hovered", /*hovered*/ i[4] - ), ds(e, "class", "wrap svelte-kzcjhc"); + ), hs(e, "class", "wrap svelte-kzcjhc"); }, m(m, h) { - Ni(m, e, h), sn(e, t), u[n].m(t, null), sn(e, s), sn(e, r), sn(e, a), d && d.m(e, null), f = !0; + Zi(m, e, h), rn(e, t), u[n].m(t, null), rn(e, s), rn(e, r), rn(e, a), d && d.m(e, null), f = !0; }, p(m, [h]) { let g = n; - n = _(m), n !== g && (sd(), Gi(u[g], 1, 1, () => { + n = _(m), n !== g && (_d(), Qi(u[g], 1, 1, () => { u[g] = null; - }), ld(), l = u[n], l || (l = u[n] = c[n](m), l.c()), Zi(l, 1), l.m(t, null)), (!f || h & /*hovered*/ - 16) && ao( + }), ud(), l = u[n], l || (l = u[n] = c[n](m), l.c()), Ji(l, 1), l.m(t, null)), (!f || h & /*hovered*/ + 16) && fo( t, "hovered", /*hovered*/ @@ -2087,21 +2087,21 @@ function cd(i) { m[0] ] || /*defs*/ m[5].file - ) + "") && ms(r, o), /*mode*/ - m[3] !== "short" ? d ? d.p(m, h) : (d = ro(m), d.c(), d.m(e, null)) : d && (d.d(1), d = null); + ) + "") && gs(r, o), /*mode*/ + m[3] !== "short" ? d ? d.p(m, h) : (d = co(m), d.c(), d.m(e, null)) : d && (d.d(1), d = null); }, i(m) { - f || (Zi(l), f = !0); + f || (Ji(l), f = !0); }, o(m) { - Gi(l), f = !1; + Qi(l), f = !1; }, d(m) { - m && Vi(e), u[n].d(), d && d.d(); + m && Pi(e), u[n].d(), d && d.d(); } }; } -function ud(i, e, t) { +function wd(i, e, t) { let { type: n = "file" } = e, { i18n: l } = e, { message: s = void 0 } = e, { mode: o = "full" } = e, { hovered: r = !1 } = e; const a = { image: "upload_text.drop_image", @@ -2116,9 +2116,9 @@ function ud(i, e, t) { "type" in f && t(0, n = f.type), "i18n" in f && t(1, l = f.i18n), "message" in f && t(2, s = f.message), "mode" in f && t(3, o = f.mode), "hovered" in f && t(4, r = f.hovered); }, [n, l, s, o, r, a]; } -class tr extends id { +class ir extends cd { constructor(e) { - super(), od(this, e, ud, cd, ad, { + super(), dd(this, e, wd, bd, hd, { type: 0, i18n: 1, message: 2, @@ -2128,27 +2128,27 @@ class tr extends id { } } const { - SvelteComponent: _d, - append: Ol, + SvelteComponent: pd, + append: Pl, attr: mt, - check_outros: ii, - create_component: al, - destroy_component: rl, - detach: Yn, - element: mi, - empty: dd, - group_outros: li, - init: hd, - insert: jn, - listen: fl, - mount_component: cl, - safe_not_equal: md, - space: Pl, - toggle_class: Pt, - transition_in: he, - transition_out: De + check_outros: si, + create_component: cl, + destroy_component: ul, + detach: Un, + element: bi, + empty: vd, + group_outros: oi, + init: kd, + insert: Vn, + listen: _l, + mount_component: dl, + safe_not_equal: yd, + space: Zl, + toggle_class: Jt, + transition_in: ge, + transition_out: qe } = window.__gradio__svelte__internal; -function fo(i) { +function uo(i) { let e, t = ( /*sources*/ i[1].includes("upload") @@ -2161,53 +2161,53 @@ function fo(i) { ), r, a = ( /*sources*/ i[1].includes("clipboard") - ), f, c = t && co(i), u = l && uo(i), _ = o && _o(i), d = a && ho(i); + ), f, c = t && _o(i), u = l && ho(i), _ = o && mo(i), d = a && go(i); return { c() { - e = mi("span"), c && c.c(), n = Pl(), u && u.c(), s = Pl(), _ && _.c(), r = Pl(), d && d.c(), mt(e, "class", "source-selection svelte-1jp3vgd"), mt(e, "data-testid", "source-select"); + e = bi("span"), c && c.c(), n = Zl(), u && u.c(), s = Zl(), _ && _.c(), r = Zl(), d && d.c(), mt(e, "class", "source-selection svelte-1jp3vgd"), mt(e, "data-testid", "source-select"); }, m(m, h) { - jn(m, e, h), c && c.m(e, null), Ol(e, n), u && u.m(e, null), Ol(e, s), _ && _.m(e, null), Ol(e, r), d && d.m(e, null), f = !0; + Vn(m, e, h), c && c.m(e, null), Pl(e, n), u && u.m(e, null), Pl(e, s), _ && _.m(e, null), Pl(e, r), d && d.m(e, null), f = !0; }, p(m, h) { h & /*sources*/ 2 && (t = /*sources*/ m[1].includes("upload")), t ? c ? (c.p(m, h), h & /*sources*/ - 2 && he(c, 1)) : (c = co(m), c.c(), he(c, 1), c.m(e, n)) : c && (li(), De(c, 1, 1, () => { + 2 && ge(c, 1)) : (c = _o(m), c.c(), ge(c, 1), c.m(e, n)) : c && (oi(), qe(c, 1, 1, () => { c = null; - }), ii()), h & /*sources*/ + }), si()), h & /*sources*/ 2 && (l = /*sources*/ m[1].includes("microphone")), l ? u ? (u.p(m, h), h & /*sources*/ - 2 && he(u, 1)) : (u = uo(m), u.c(), he(u, 1), u.m(e, s)) : u && (li(), De(u, 1, 1, () => { + 2 && ge(u, 1)) : (u = ho(m), u.c(), ge(u, 1), u.m(e, s)) : u && (oi(), qe(u, 1, 1, () => { u = null; - }), ii()), h & /*sources*/ + }), si()), h & /*sources*/ 2 && (o = /*sources*/ m[1].includes("webcam")), o ? _ ? (_.p(m, h), h & /*sources*/ - 2 && he(_, 1)) : (_ = _o(m), _.c(), he(_, 1), _.m(e, r)) : _ && (li(), De(_, 1, 1, () => { + 2 && ge(_, 1)) : (_ = mo(m), _.c(), ge(_, 1), _.m(e, r)) : _ && (oi(), qe(_, 1, 1, () => { _ = null; - }), ii()), h & /*sources*/ + }), si()), h & /*sources*/ 2 && (a = /*sources*/ m[1].includes("clipboard")), a ? d ? (d.p(m, h), h & /*sources*/ - 2 && he(d, 1)) : (d = ho(m), d.c(), he(d, 1), d.m(e, null)) : d && (li(), De(d, 1, 1, () => { + 2 && ge(d, 1)) : (d = go(m), d.c(), ge(d, 1), d.m(e, null)) : d && (oi(), qe(d, 1, 1, () => { d = null; - }), ii()); + }), si()); }, i(m) { - f || (he(c), he(u), he(_), he(d), f = !0); + f || (ge(c), ge(u), ge(_), ge(d), f = !0); }, o(m) { - De(c), De(u), De(_), De(d), f = !1; + qe(c), qe(u), qe(_), qe(d), f = !1; }, d(m) { - m && Yn(e), c && c.d(), u && u.d(), _ && _.d(), d && d.d(); + m && Un(e), c && c.d(), u && u.d(), _ && _.d(), d && d.d(); } }; } -function co(i) { +function _o(i) { let e, t, n, l, s; - return t = new Ja({}), { + return t = new xa({}), { c() { - e = mi("button"), al(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Upload file"), Pt( + e = bi("button"), cl(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Upload file"), Jt( e, "selected", /*active_source*/ @@ -2216,7 +2216,7 @@ function co(i) { ); }, m(o, r) { - jn(o, e, r), cl(t, e, null), n = !0, l || (s = fl( + Vn(o, e, r), dl(t, e, null), n = !0, l || (s = _l( e, "click", /*click_handler*/ @@ -2225,7 +2225,7 @@ function co(i) { }, p(o, r) { (!n || r & /*active_source*/ - 1) && Pt( + 1) && Jt( e, "selected", /*active_source*/ @@ -2234,21 +2234,21 @@ function co(i) { ); }, i(o) { - n || (he(t.$$.fragment, o), n = !0); + n || (ge(t.$$.fragment, o), n = !0); }, o(o) { - De(t.$$.fragment, o), n = !1; + qe(t.$$.fragment, o), n = !1; }, d(o) { - o && Yn(e), rl(t), l = !1, s(); + o && Un(e), ul(t), l = !1, s(); } }; } -function uo(i) { +function ho(i) { let e, t, n, l, s; - return t = new o_({}), { + return t = new d_({}), { c() { - e = mi("button"), al(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Record audio"), Pt( + e = bi("button"), cl(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Record audio"), Jt( e, "selected", /*active_source*/ @@ -2256,7 +2256,7 @@ function uo(i) { ); }, m(o, r) { - jn(o, e, r), cl(t, e, null), n = !0, l || (s = fl( + Vn(o, e, r), dl(t, e, null), n = !0, l || (s = _l( e, "click", /*click_handler_1*/ @@ -2265,7 +2265,7 @@ function uo(i) { }, p(o, r) { (!n || r & /*active_source*/ - 1) && Pt( + 1) && Jt( e, "selected", /*active_source*/ @@ -2273,21 +2273,21 @@ function uo(i) { ); }, i(o) { - n || (he(t.$$.fragment, o), n = !0); + n || (ge(t.$$.fragment, o), n = !0); }, o(o) { - De(t.$$.fragment, o), n = !1; + qe(t.$$.fragment, o), n = !1; }, d(o) { - o && Yn(e), rl(t), l = !1, s(); + o && Un(e), ul(t), l = !1, s(); } }; } -function _o(i) { +function mo(i) { let e, t, n, l, s; - return t = new Qa({}), { + return t = new $a({}), { c() { - e = mi("button"), al(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Capture from camera"), Pt( + e = bi("button"), cl(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Capture from camera"), Jt( e, "selected", /*active_source*/ @@ -2295,7 +2295,7 @@ function _o(i) { ); }, m(o, r) { - jn(o, e, r), cl(t, e, null), n = !0, l || (s = fl( + Vn(o, e, r), dl(t, e, null), n = !0, l || (s = _l( e, "click", /*click_handler_2*/ @@ -2304,7 +2304,7 @@ function _o(i) { }, p(o, r) { (!n || r & /*active_source*/ - 1) && Pt( + 1) && Jt( e, "selected", /*active_source*/ @@ -2312,21 +2312,21 @@ function _o(i) { ); }, i(o) { - n || (he(t.$$.fragment, o), n = !0); + n || (ge(t.$$.fragment, o), n = !0); }, o(o) { - De(t.$$.fragment, o), n = !1; + qe(t.$$.fragment, o), n = !1; }, d(o) { - o && Yn(e), rl(t), l = !1, s(); + o && Un(e), ul(t), l = !1, s(); } }; } -function ho(i) { +function go(i) { let e, t, n, l, s; - return t = new Ka({}), { + return t = new Qa({}), { c() { - e = mi("button"), al(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Paste from clipboard"), Pt( + e = bi("button"), cl(t.$$.fragment), mt(e, "class", "icon svelte-1jp3vgd"), mt(e, "aria-label", "Paste from clipboard"), Jt( e, "selected", /*active_source*/ @@ -2334,7 +2334,7 @@ function ho(i) { ); }, m(o, r) { - jn(o, e, r), cl(t, e, null), n = !0, l || (s = fl( + Vn(o, e, r), dl(t, e, null), n = !0, l || (s = _l( e, "click", /*click_handler_3*/ @@ -2343,7 +2343,7 @@ function ho(i) { }, p(o, r) { (!n || r & /*active_source*/ - 1) && Pt( + 1) && Jt( e, "selected", /*active_source*/ @@ -2351,73 +2351,73 @@ function ho(i) { ); }, i(o) { - n || (he(t.$$.fragment, o), n = !0); + n || (ge(t.$$.fragment, o), n = !0); }, o(o) { - De(t.$$.fragment, o), n = !1; + qe(t.$$.fragment, o), n = !1; }, d(o) { - o && Yn(e), rl(t), l = !1, s(); + o && Un(e), ul(t), l = !1, s(); } }; } -function gd(i) { +function Cd(i) { let e, t, n = ( /*unique_sources*/ - i[2].length > 1 && fo(i) + i[2].length > 1 && uo(i) ); return { c() { - n && n.c(), e = dd(); + n && n.c(), e = vd(); }, m(l, s) { - n && n.m(l, s), jn(l, e, s), t = !0; + n && n.m(l, s), Vn(l, e, s), t = !0; }, p(l, [s]) { /*unique_sources*/ l[2].length > 1 ? n ? (n.p(l, s), s & /*unique_sources*/ - 4 && he(n, 1)) : (n = fo(l), n.c(), he(n, 1), n.m(e.parentNode, e)) : n && (li(), De(n, 1, 1, () => { + 4 && ge(n, 1)) : (n = uo(l), n.c(), ge(n, 1), n.m(e.parentNode, e)) : n && (oi(), qe(n, 1, 1, () => { n = null; - }), ii()); + }), si()); }, i(l) { - t || (he(n), t = !0); + t || (ge(n), t = !0); }, o(l) { - De(n), t = !1; + qe(n), t = !1; }, d(l) { - l && Yn(e), n && n.d(l); + l && Un(e), n && n.d(l); } }; } -function bd(i, e, t) { +function Sd(i, e, t) { let n; - var l = this && this.__awaiter || function(m, h, g, v) { + var l = this && this.__awaiter || function(m, h, g, p) { function w(b) { return b instanceof g ? b : new g(function(k) { k(b); }); } return new (g || (g = Promise))(function(b, k) { - function p(C) { + function v(C) { try { - q(v.next(C)); + S(p.next(C)); } catch (z) { k(z); } } function y(C) { try { - q(v.throw(C)); + S(p.throw(C)); } catch (z) { k(z); } } - function q(C) { - C.done ? b(C.value) : w(C.value).then(p, y); + function S(C) { + C.done ? b(C.value) : w(C.value).then(v, y); } - q((v = v.apply(m, h || [])).next()); + S((p = p.apply(m, h || [])).next()); }); }; let { sources: s } = e, { active_source: o } = e, { handle_clear: r = () => { @@ -2447,9 +2447,9 @@ function bd(i, e, t) { d ]; } -class wd extends _d { +class zd extends pd { constructor(e) { - super(), hd(this, e, bd, gd, md, { + super(), kd(this, e, Sd, Cd, yd, { sources: 1, active_source: 0, handle_clear: 4, @@ -2457,20 +2457,20 @@ class wd extends _d { }); } } -function Mn(i) { +function Wn(i) { let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0; for (; i > 1e3 && t < e.length - 1; ) i /= 1e3, t++; let n = e[t]; return (Number.isInteger(i) ? i : i.toFixed(1)) + n; } -function Oi() { +function Gi() { } -const vd = (i) => i; -function pd(i, e) { +const Bd = (i) => i; +function Dd(i, e) { return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function"; } -function mo(i) { +function bo(i) { const e = typeof i == "string" && i.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); return e ? [parseFloat(e[1]), e[2] || "px"] : [ /** @type {number} */ @@ -2478,30 +2478,30 @@ function mo(i) { "px" ]; } -const nr = typeof window < "u"; -let go = nr ? () => window.performance.now() : () => Date.now(), ir = nr ? (i) => requestAnimationFrame(i) : Oi; -const Xn = /* @__PURE__ */ new Set(); -function lr(i) { - Xn.forEach((e) => { - e.c(i) || (Xn.delete(e), e.f()); - }), Xn.size !== 0 && ir(lr); +const lr = typeof window < "u"; +let wo = lr ? () => window.performance.now() : () => Date.now(), sr = lr ? (i) => requestAnimationFrame(i) : Gi; +const Fn = /* @__PURE__ */ new Set(); +function or(i) { + Fn.forEach((e) => { + e.c(i) || (Fn.delete(e), e.f()); + }), Fn.size !== 0 && sr(or); } -function kd(i) { +function qd(i) { let e; - return Xn.size === 0 && ir(lr), { + return Fn.size === 0 && sr(or), { promise: new Promise((t) => { - Xn.add(e = { c: i, f: t }); + Fn.add(e = { c: i, f: t }); }), abort() { - Xn.delete(e); + Fn.delete(e); } }; } -function yd(i) { +function Ld(i) { const e = i - 1; return e * e * e + 1; } -function Cd(i, { delay: e = 0, duration: t = 400, easing: n = vd } = {}) { +function Md(i, { delay: e = 0, duration: t = 400, easing: n = Bd } = {}) { const l = +getComputedStyle(i).opacity; return { delay: e, @@ -2510,8 +2510,8 @@ function Cd(i, { delay: e = 0, duration: t = 400, easing: n = vd } = {}) { css: (s) => `opacity: ${s * l}` }; } -function bo(i, { delay: e = 0, duration: t = 400, easing: n = yd, x: l = 0, y: s = 0, opacity: o = 0 } = {}) { - const r = getComputedStyle(i), a = +r.opacity, f = r.transform === "none" ? "" : r.transform, c = a * (1 - o), [u, _] = mo(l), [d, m] = mo(s); +function po(i, { delay: e = 0, duration: t = 400, easing: n = Ld, x: l = 0, y: s = 0, opacity: o = 0 } = {}) { + const r = getComputedStyle(i), a = +r.opacity, f = r.transform === "none" ? "" : r.transform, c = a * (1 - o), [u, _] = bo(l), [d, m] = bo(s); return { delay: e, duration: t, @@ -2521,61 +2521,61 @@ function bo(i, { delay: e = 0, duration: t = 400, easing: n = yd, x: l = 0, y: s opacity: ${a - c * g}` }; } -const zn = []; -function Sd(i, e = Oi) { +const qn = []; +function Ed(i, e = Gi) { let t; const n = /* @__PURE__ */ new Set(); function l(r) { - if (pd(i, r) && (i = r, t)) { - const a = !zn.length; + if (Dd(i, r) && (i = r, t)) { + const a = !qn.length; for (const f of n) - f[1](), zn.push(f, i); + f[1](), qn.push(f, i); if (a) { - for (let f = 0; f < zn.length; f += 2) - zn[f][0](zn[f + 1]); - zn.length = 0; + for (let f = 0; f < qn.length; f += 2) + qn[f][0](qn[f + 1]); + qn.length = 0; } } } function s(r) { l(r(i)); } - function o(r, a = Oi) { + function o(r, a = Gi) { const f = [r, a]; - return n.add(f), n.size === 1 && (t = e(l, s) || Oi), r(i), () => { + return n.add(f), n.size === 1 && (t = e(l, s) || Gi), r(i), () => { n.delete(f), n.size === 0 && t && (t(), t = null); }; } return { set: l, update: s, subscribe: o }; } -function wo(i) { +function vo(i) { return Object.prototype.toString.call(i) === "[object Date]"; } -function bs(i, e, t, n) { - if (typeof t == "number" || wo(t)) { +function ws(i, e, t, n) { + if (typeof t == "number" || vo(t)) { const l = n - t, s = (t - e) / (i.dt || 1 / 60), o = i.opts.stiffness * l, r = i.opts.damping * s, a = (o - r) * i.inv_mass, f = (s + a) * i.dt; - return Math.abs(f) < i.opts.precision && Math.abs(l) < i.opts.precision ? n : (i.settled = !1, wo(t) ? new Date(t.getTime() + f) : t + f); + return Math.abs(f) < i.opts.precision && Math.abs(l) < i.opts.precision ? n : (i.settled = !1, vo(t) ? new Date(t.getTime() + f) : t + f); } else { if (Array.isArray(t)) return t.map( - (l, s) => bs(i, e[s], t[s], n[s]) + (l, s) => ws(i, e[s], t[s], n[s]) ); if (typeof t == "object") { const l = {}; for (const s in t) - l[s] = bs(i, e[s], t[s], n[s]); + l[s] = ws(i, e[s], t[s], n[s]); return l; } else throw new Error(`Cannot spring ${typeof t} values`); } } -function vo(i, e = {}) { - const t = Sd(i), { stiffness: n = 0.15, damping: l = 0.8, precision: s = 0.01 } = e; +function ko(i, e = {}) { + const t = Ed(i), { stiffness: n = 0.15, damping: l = 0.8, precision: s = 0.01 } = e; let o, r, a, f = i, c = i, u = 1, _ = 0, d = !1; - function m(g, v = {}) { + function m(g, p = {}) { c = g; const w = a = {}; - return i == null || v.hard || h.stiffness >= 1 && h.damping >= 1 ? (d = !0, o = go(), f = g, t.set(i = c), Promise.resolve()) : (v.soft && (_ = 1 / ((v.soft === !0 ? 0.5 : +v.soft) * 60), u = 0), r || (o = go(), d = !1, r = kd((b) => { + return i == null || p.hard || h.stiffness >= 1 && h.damping >= 1 ? (d = !0, o = wo(), f = g, t.set(i = c), Promise.resolve()) : (p.soft && (_ = 1 / ((p.soft === !0 ? 0.5 : +p.soft) * 60), u = 0), r || (o = wo(), d = !1, r = qd((b) => { if (d) return d = !1, r = null, !1; u = Math.min(u + _, 1); @@ -2584,8 +2584,8 @@ function vo(i, e = {}) { opts: h, settled: !0, dt: (b - o) * 60 / 1e3 - }, p = bs(k, f, i, c); - return o = b, f = i, t.set(i = p), k.settled && (r = null), !k.settled; + }, v = ws(k, f, i, c); + return o = b, f = i, t.set(i = v), k.settled && (r = null), !k.settled; })), new Promise((b) => { r.promise.then(() => { w === a && b(); @@ -2594,7 +2594,7 @@ function vo(i, e = {}) { } const h = { set: m, - update: (g, v) => m(g(c, i), v), + update: (g, p) => m(g(c, i), p), subscribe: t.subscribe, stiffness: n, damping: l, @@ -2603,29 +2603,29 @@ function vo(i, e = {}) { return h; } const { - SvelteComponent: zd, - append: tt, + SvelteComponent: Rd, + append: et, attr: N, - component_subscribe: po, - detach: Bd, - element: qd, - init: Dd, - insert: Ld, - noop: ko, - safe_not_equal: Ed, - set_style: zi, - svg_element: nt, - toggle_class: yo -} = window.__gradio__svelte__internal, { onMount: Md } = window.__gradio__svelte__internal; -function Rd(i) { + component_subscribe: yo, + detach: Ad, + element: Wd, + init: Xd, + insert: Yd, + noop: Co, + safe_not_equal: Id, + set_style: qi, + svg_element: tt, + toggle_class: So +} = window.__gradio__svelte__internal, { onMount: Hd } = window.__gradio__svelte__internal; +function Td(i) { let e, t, n, l, s, o, r, a, f, c, u, _; return { c() { - e = qd("div"), t = nt("svg"), n = nt("g"), l = nt("path"), s = nt("path"), o = nt("path"), r = nt("path"), a = nt("g"), f = nt("path"), c = nt("path"), u = nt("path"), _ = nt("path"), N(l, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), N(l, "fill", "#FF7C00"), N(l, "fill-opacity", "0.4"), N(l, "class", "svelte-43sxxs"), N(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), N(s, "fill", "#FF7C00"), N(s, "class", "svelte-43sxxs"), N(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), N(o, "fill", "#FF7C00"), N(o, "fill-opacity", "0.4"), N(o, "class", "svelte-43sxxs"), N(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), N(r, "fill", "#FF7C00"), N(r, "class", "svelte-43sxxs"), zi(n, "transform", "translate(" + /*$top*/ + e = Wd("div"), t = tt("svg"), n = tt("g"), l = tt("path"), s = tt("path"), o = tt("path"), r = tt("path"), a = tt("g"), f = tt("path"), c = tt("path"), u = tt("path"), _ = tt("path"), N(l, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), N(l, "fill", "#FF7C00"), N(l, "fill-opacity", "0.4"), N(l, "class", "svelte-43sxxs"), N(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), N(s, "fill", "#FF7C00"), N(s, "class", "svelte-43sxxs"), N(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), N(o, "fill", "#FF7C00"), N(o, "fill-opacity", "0.4"), N(o, "class", "svelte-43sxxs"), N(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), N(r, "fill", "#FF7C00"), N(r, "class", "svelte-43sxxs"), qi(n, "transform", "translate(" + /*$top*/ i[1][0] + "px, " + /*$top*/ - i[1][1] + "px)"), N(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), N(f, "fill", "#FF7C00"), N(f, "fill-opacity", "0.4"), N(f, "class", "svelte-43sxxs"), N(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), N(c, "fill", "#FF7C00"), N(c, "class", "svelte-43sxxs"), N(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), N(u, "fill", "#FF7C00"), N(u, "fill-opacity", "0.4"), N(u, "class", "svelte-43sxxs"), N(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), N(_, "fill", "#FF7C00"), N(_, "class", "svelte-43sxxs"), zi(a, "transform", "translate(" + /*$bottom*/ + i[1][1] + "px)"), N(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), N(f, "fill", "#FF7C00"), N(f, "fill-opacity", "0.4"), N(f, "class", "svelte-43sxxs"), N(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), N(c, "fill", "#FF7C00"), N(c, "class", "svelte-43sxxs"), N(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), N(u, "fill", "#FF7C00"), N(u, "fill-opacity", "0.4"), N(u, "class", "svelte-43sxxs"), N(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), N(_, "fill", "#FF7C00"), N(_, "class", "svelte-43sxxs"), qi(a, "transform", "translate(" + /*$bottom*/ i[2][0] + "px, " + /*$bottom*/ - i[2][1] + "px)"), N(t, "viewBox", "-1200 -1200 3000 3000"), N(t, "fill", "none"), N(t, "xmlns", "http://www.w3.org/2000/svg"), N(t, "class", "svelte-43sxxs"), N(e, "class", "svelte-43sxxs"), yo( + i[2][1] + "px)"), N(t, "viewBox", "-1200 -1200 3000 3000"), N(t, "fill", "none"), N(t, "xmlns", "http://www.w3.org/2000/svg"), N(t, "class", "svelte-43sxxs"), N(e, "class", "svelte-43sxxs"), So( e, "margin", /*margin*/ @@ -2633,64 +2633,64 @@ function Rd(i) { ); }, m(d, m) { - Ld(d, e, m), tt(e, t), tt(t, n), tt(n, l), tt(n, s), tt(n, o), tt(n, r), tt(t, a), tt(a, f), tt(a, c), tt(a, u), tt(a, _); + Yd(d, e, m), et(e, t), et(t, n), et(n, l), et(n, s), et(n, o), et(n, r), et(t, a), et(a, f), et(a, c), et(a, u), et(a, _); }, p(d, [m]) { m & /*$top*/ - 2 && zi(n, "transform", "translate(" + /*$top*/ + 2 && qi(n, "transform", "translate(" + /*$top*/ d[1][0] + "px, " + /*$top*/ d[1][1] + "px)"), m & /*$bottom*/ - 4 && zi(a, "transform", "translate(" + /*$bottom*/ + 4 && qi(a, "transform", "translate(" + /*$bottom*/ d[2][0] + "px, " + /*$bottom*/ d[2][1] + "px)"), m & /*margin*/ - 1 && yo( + 1 && So( e, "margin", /*margin*/ d[0] ); }, - i: ko, - o: ko, + i: Co, + o: Co, d(d) { - d && Bd(e); + d && Ad(e); } }; } -function Ad(i, e, t) { +function jd(i, e, t) { let n, l; var s = this && this.__awaiter || function(d, m, h, g) { - function v(w) { + function p(w) { return w instanceof h ? w : new h(function(b) { b(w); }); } return new (h || (h = Promise))(function(w, b) { - function k(q) { + function k(S) { try { - y(g.next(q)); + y(g.next(S)); } catch (C) { b(C); } } - function p(q) { + function v(S) { try { - y(g.throw(q)); + y(g.throw(S)); } catch (C) { b(C); } } - function y(q) { - q.done ? w(q.value) : v(q.value).then(k, p); + function y(S) { + S.done ? w(S.value) : p(S.value).then(k, v); } y((g = g.apply(d, m || [])).next()); }); }; let { margin: o = !0 } = e; - const r = vo([0, 0]); - po(i, r, (d) => t(1, n = d)); - const a = vo([0, 0]); - po(i, a, (d) => t(2, l = d)); + const r = ko([0, 0]); + yo(i, r, (d) => t(1, n = d)); + const a = ko([0, 0]); + yo(i, a, (d) => t(2, l = d)); let f; function c() { return s(this, void 0, void 0, function* () { @@ -2707,62 +2707,62 @@ function Ad(i, e, t) { yield Promise.all([r.set([125, 0]), a.set([-125, 0])]), u(); }); } - return Md(() => (_(), () => f = !0)), i.$$set = (d) => { + return Hd(() => (_(), () => f = !0)), i.$$set = (d) => { "margin" in d && t(0, o = d.margin); }, [o, n, l, r, a]; } -class Wd extends zd { +class Fd extends Rd { constructor(e) { - super(), Dd(this, e, Ad, Rd, Ed, { margin: 0 }); + super(), Xd(this, e, jd, Td, Id, { margin: 0 }); } } const { - SvelteComponent: Hd, - append: on, - attr: ot, - binding_callbacks: Co, - check_outros: ws, - create_component: sr, - create_slot: or, - destroy_component: ar, - destroy_each: rr, - detach: Y, + SvelteComponent: Ud, + append: fn, + attr: st, + binding_callbacks: zo, + check_outros: ps, + create_component: ar, + create_slot: rr, + destroy_component: fr, + destroy_each: cr, + detach: T, element: dt, - empty: Fn, - ensure_array_like: Ki, - get_all_dirty_from_scope: fr, - get_slot_changes: cr, + empty: Nn, + ensure_array_like: xi, + get_all_dirty_from_scope: ur, + get_slot_changes: _r, group_outros: vs, - init: Id, + init: Vd, insert: j, - mount_component: ur, - noop: ps, - safe_not_equal: Td, - set_data: Ge, - set_style: Nt, - space: Ze, - text: oe, - toggle_class: Pe, - transition_in: st, + mount_component: dr, + noop: ks, + safe_not_equal: Nd, + set_data: Ze, + set_style: Gt, + space: Pe, + text: ce, + toggle_class: Oe, + transition_in: lt, transition_out: ht, - update_slot_base: _r -} = window.__gradio__svelte__internal, { tick: Xd } = window.__gradio__svelte__internal, { onDestroy: Yd } = window.__gradio__svelte__internal, { createEventDispatcher: jd } = window.__gradio__svelte__internal, Fd = (i) => ({}), So = (i) => ({}), Ud = (i) => ({}), zo = (i) => ({}); -function Bo(i, e, t) { + update_slot_base: hr +} = window.__gradio__svelte__internal, { tick: Od } = window.__gradio__svelte__internal, { onDestroy: Pd } = window.__gradio__svelte__internal, { createEventDispatcher: Zd } = window.__gradio__svelte__internal, Gd = (i) => ({}), Bo = (i) => ({}), Kd = (i) => ({}), Do = (i) => ({}); +function qo(i, e, t) { const n = i.slice(); return n[41] = e[t], n[43] = t, n; } -function qo(i, e, t) { +function Lo(i, e, t) { const n = i.slice(); return n[41] = e[t], n; } -function Vd(i) { +function Jd(i) { let e, t, n, l, s = ( /*i18n*/ i[1]("common.error") + "" ), o, r, a; - t = new ol({ + t = new fl({ props: { - Icon: Za, + Icon: Ka, label: ( /*i18n*/ i[1]("common.clear") @@ -2777,19 +2777,19 @@ function Vd(i) { const f = ( /*#slots*/ i[30].error - ), c = or( + ), c = rr( f, i, /*$$scope*/ i[29], - So + Bo ); return { c() { - e = dt("div"), sr(t.$$.fragment), n = Ze(), l = dt("span"), o = oe(s), r = Ze(), c && c.c(), ot(e, "class", "clear-status svelte-16nch4a"), ot(l, "class", "error svelte-16nch4a"); + e = dt("div"), ar(t.$$.fragment), n = Pe(), l = dt("span"), o = ce(s), r = Pe(), c && c.c(), st(e, "class", "clear-status svelte-16nch4a"), st(l, "class", "error svelte-16nch4a"); }, m(u, _) { - j(u, e, _), ur(t, e, null), j(u, n, _), j(u, l, _), on(l, o), j(u, r, _), c && c.m(u, _), a = !0; + j(u, e, _), dr(t, e, null), j(u, n, _), j(u, l, _), fn(l, o), j(u, r, _), c && c.m(u, _), a = !0; }, p(u, _) { const d = {}; @@ -2797,66 +2797,66 @@ function Vd(i) { 2 && (d.label = /*i18n*/ u[1]("common.clear")), t.$set(d), (!a || _[0] & /*i18n*/ 2) && s !== (s = /*i18n*/ - u[1]("common.error") + "") && Ge(o, s), c && c.p && (!a || _[0] & /*$$scope*/ - 536870912) && _r( + u[1]("common.error") + "") && Ze(o, s), c && c.p && (!a || _[0] & /*$$scope*/ + 536870912) && hr( c, f, u, /*$$scope*/ u[29], - a ? cr( + a ? _r( f, /*$$scope*/ u[29], _, - Fd - ) : fr( + Gd + ) : ur( /*$$scope*/ u[29] ), - So + Bo ); }, i(u) { - a || (st(t.$$.fragment, u), st(c, u), a = !0); + a || (lt(t.$$.fragment, u), lt(c, u), a = !0); }, o(u) { ht(t.$$.fragment, u), ht(c, u), a = !1; }, d(u) { - u && (Y(e), Y(n), Y(l), Y(r)), ar(t), c && c.d(u); + u && (T(e), T(n), T(l), T(r)), fr(t), c && c.d(u); } }; } -function Nd(i) { +function Qd(i) { let e, t, n, l, s, o, r, a, f, c = ( /*variant*/ i[8] === "default" && /*show_eta_bar*/ i[18] && /*show_progress*/ - i[6] === "full" && Do(i) + i[6] === "full" && Mo(i) ); function u(b, k) { if ( /*progress*/ b[7] - ) return Zd; + ) return e1; if ( /*queue_position*/ b[2] !== null && /*queue_size*/ b[3] !== void 0 && /*queue_position*/ b[2] >= 0 - ) return Pd; + ) return $d; if ( /*queue_position*/ b[2] === 0 - ) return Od; + ) return xd; } let _ = u(i), d = _ && _(i), m = ( /*timer*/ - i[5] && Mo(i) + i[5] && Ao(i) ); - const h = [Qd, Jd], g = []; - function v(b, k) { + const h = [l1, i1], g = []; + function p(b, k) { return ( /*last_progress_level*/ b[15] != null ? 0 : ( @@ -2865,17 +2865,17 @@ function Nd(i) { ) ); } - ~(s = v(i)) && (o = g[s] = h[s](i)); + ~(s = p(i)) && (o = g[s] = h[s](i)); let w = !/*timer*/ - i[5] && Xo(i); + i[5] && jo(i); return { c() { - c && c.c(), e = Ze(), t = dt("div"), d && d.c(), n = Ze(), m && m.c(), l = Ze(), o && o.c(), r = Ze(), w && w.c(), a = Fn(), ot(t, "class", "progress-text svelte-16nch4a"), Pe( + c && c.c(), e = Pe(), t = dt("div"), d && d.c(), n = Pe(), m && m.c(), l = Pe(), o && o.c(), r = Pe(), w && w.c(), a = Nn(), st(t, "class", "progress-text svelte-16nch4a"), Oe( t, "meta-text-center", /*variant*/ i[8] === "center" - ), Pe( + ), Oe( t, "meta-text", /*variant*/ @@ -2883,52 +2883,52 @@ function Nd(i) { ); }, m(b, k) { - c && c.m(b, k), j(b, e, k), j(b, t, k), d && d.m(t, null), on(t, n), m && m.m(t, null), j(b, l, k), ~s && g[s].m(b, k), j(b, r, k), w && w.m(b, k), j(b, a, k), f = !0; + c && c.m(b, k), j(b, e, k), j(b, t, k), d && d.m(t, null), fn(t, n), m && m.m(t, null), j(b, l, k), ~s && g[s].m(b, k), j(b, r, k), w && w.m(b, k), j(b, a, k), f = !0; }, p(b, k) { /*variant*/ b[8] === "default" && /*show_eta_bar*/ b[18] && /*show_progress*/ - b[6] === "full" ? c ? c.p(b, k) : (c = Do(b), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), _ === (_ = u(b)) && d ? d.p(b, k) : (d && d.d(1), d = _ && _(b), d && (d.c(), d.m(t, n))), /*timer*/ - b[5] ? m ? m.p(b, k) : (m = Mo(b), m.c(), m.m(t, null)) : m && (m.d(1), m = null), (!f || k[0] & /*variant*/ - 256) && Pe( + b[6] === "full" ? c ? c.p(b, k) : (c = Mo(b), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), _ === (_ = u(b)) && d ? d.p(b, k) : (d && d.d(1), d = _ && _(b), d && (d.c(), d.m(t, n))), /*timer*/ + b[5] ? m ? m.p(b, k) : (m = Ao(b), m.c(), m.m(t, null)) : m && (m.d(1), m = null), (!f || k[0] & /*variant*/ + 256) && Oe( t, "meta-text-center", /*variant*/ b[8] === "center" ), (!f || k[0] & /*variant*/ - 256) && Pe( + 256) && Oe( t, "meta-text", /*variant*/ b[8] === "default" ); - let p = s; - s = v(b), s === p ? ~s && g[s].p(b, k) : (o && (vs(), ht(g[p], 1, 1, () => { - g[p] = null; - }), ws()), ~s ? (o = g[s], o ? o.p(b, k) : (o = g[s] = h[s](b), o.c()), st(o, 1), o.m(r.parentNode, r)) : o = null), /*timer*/ + let v = s; + s = p(b), s === v ? ~s && g[s].p(b, k) : (o && (vs(), ht(g[v], 1, 1, () => { + g[v] = null; + }), ps()), ~s ? (o = g[s], o ? o.p(b, k) : (o = g[s] = h[s](b), o.c()), lt(o, 1), o.m(r.parentNode, r)) : o = null), /*timer*/ b[5] ? w && (vs(), ht(w, 1, 1, () => { w = null; - }), ws()) : w ? (w.p(b, k), k[0] & /*timer*/ - 32 && st(w, 1)) : (w = Xo(b), w.c(), st(w, 1), w.m(a.parentNode, a)); + }), ps()) : w ? (w.p(b, k), k[0] & /*timer*/ + 32 && lt(w, 1)) : (w = jo(b), w.c(), lt(w, 1), w.m(a.parentNode, a)); }, i(b) { - f || (st(o), st(w), f = !0); + f || (lt(o), lt(w), f = !0); }, o(b) { ht(o), ht(w), f = !1; }, d(b) { - b && (Y(e), Y(t), Y(l), Y(r), Y(a)), c && c.d(b), d && d.d(), m && m.d(), ~s && g[s].d(b), w && w.d(b); + b && (T(e), T(t), T(l), T(r), T(a)), c && c.d(b), d && d.d(), m && m.d(), ~s && g[s].d(b), w && w.d(b); } }; } -function Do(i) { +function Mo(i) { let e, t = `translateX(${/*eta_level*/ (i[17] || 0) * 100 - 100}%)`; return { c() { - e = dt("div"), ot(e, "class", "eta-bar svelte-16nch4a"), Nt(e, "transform", t); + e = dt("div"), st(e, "class", "eta-bar svelte-16nch4a"), Gt(e, "transform", t); }, m(n, l) { j(n, e, l); @@ -2936,39 +2936,39 @@ function Do(i) { p(n, l) { l[0] & /*eta_level*/ 131072 && t !== (t = `translateX(${/*eta_level*/ - (n[17] || 0) * 100 - 100}%)`) && Nt(e, "transform", t); + (n[17] || 0) * 100 - 100}%)`) && Gt(e, "transform", t); }, d(n) { - n && Y(e); + n && T(e); } }; } -function Od(i) { +function xd(i) { let e; return { c() { - e = oe("processing |"); + e = ce("processing |"); }, m(t, n) { j(t, e, n); }, - p: ps, + p: ks, d(t) { - t && Y(e); + t && T(e); } }; } -function Pd(i) { +function $d(i) { let e, t = ( /*queue_position*/ i[2] + 1 + "" ), n, l, s, o; return { c() { - e = oe("queue: "), n = oe(t), l = oe("/"), s = oe( + e = ce("queue: "), n = ce(t), l = ce("/"), s = ce( /*queue_size*/ i[3] - ), o = oe(" |"); + ), o = ce(" |"); }, m(r, a) { j(r, e, a), j(r, n, a), j(r, l, a), j(r, s, a), j(r, o, a); @@ -2976,30 +2976,30 @@ function Pd(i) { p(r, a) { a[0] & /*queue_position*/ 4 && t !== (t = /*queue_position*/ - r[2] + 1 + "") && Ge(n, t), a[0] & /*queue_size*/ - 8 && Ge( + r[2] + 1 + "") && Ze(n, t), a[0] & /*queue_size*/ + 8 && Ze( s, /*queue_size*/ r[3] ); }, d(r) { - r && (Y(e), Y(n), Y(l), Y(s), Y(o)); + r && (T(e), T(n), T(l), T(s), T(o)); } }; } -function Zd(i) { - let e, t = Ki( +function e1(i) { + let e, t = xi( /*progress*/ i[7] ), n = []; for (let l = 0; l < t.length; l += 1) - n[l] = Eo(qo(i, t, l)); + n[l] = Ro(Lo(i, t, l)); return { c() { for (let l = 0; l < n.length; l += 1) n[l].c(); - e = Fn(); + e = Nn(); }, m(l, s) { for (let o = 0; o < n.length; o += 1) @@ -3009,14 +3009,14 @@ function Zd(i) { p(l, s) { if (s[0] & /*progress*/ 128) { - t = Ki( + t = xi( /*progress*/ l[7] ); let o; for (o = 0; o < t.length; o += 1) { - const r = qo(l, t, o); - n[o] ? n[o].p(r, s) : (n[o] = Eo(r), n[o].c(), n[o].m(e.parentNode, e)); + const r = Lo(l, t, o); + n[o] ? n[o].p(r, s) : (n[o] = Ro(r), n[o].c(), n[o].m(e.parentNode, e)); } for (; o < n.length; o += 1) n[o].d(1); @@ -3024,11 +3024,11 @@ function Zd(i) { } }, d(l) { - l && Y(e), rr(n, l); + l && T(e), cr(n, l); } }; } -function Lo(i) { +function Eo(i) { let e, t = ( /*p*/ i[41].unit + "" @@ -3036,13 +3036,13 @@ function Lo(i) { function r(c, u) { return ( /*p*/ - c[41].length != null ? Kd : Gd + c[41].length != null ? n1 : t1 ); } let a = r(i), f = a(i); return { c() { - f.c(), e = Ze(), n = oe(t), l = oe(" | "), o = oe(s); + f.c(), e = Pe(), n = ce(t), l = ce(" | "), o = ce(s); }, m(c, u) { f.m(c, u), j(c, e, u), j(c, n, u), j(c, l, u), j(c, o, u); @@ -3050,90 +3050,90 @@ function Lo(i) { p(c, u) { a === (a = r(c)) && f ? f.p(c, u) : (f.d(1), f = a(c), f && (f.c(), f.m(e.parentNode, e))), u[0] & /*progress*/ 128 && t !== (t = /*p*/ - c[41].unit + "") && Ge(n, t); + c[41].unit + "") && Ze(n, t); }, d(c) { - c && (Y(e), Y(n), Y(l), Y(o)), f.d(c); + c && (T(e), T(n), T(l), T(o)), f.d(c); } }; } -function Gd(i) { - let e = Mn( +function t1(i) { + let e = Wn( /*p*/ i[41].index || 0 ) + "", t; return { c() { - t = oe(e); + t = ce(e); }, m(n, l) { j(n, t, l); }, p(n, l) { l[0] & /*progress*/ - 128 && e !== (e = Mn( + 128 && e !== (e = Wn( /*p*/ n[41].index || 0 - ) + "") && Ge(t, e); + ) + "") && Ze(t, e); }, d(n) { - n && Y(t); + n && T(t); } }; } -function Kd(i) { - let e = Mn( +function n1(i) { + let e = Wn( /*p*/ i[41].index || 0 - ) + "", t, n, l = Mn( + ) + "", t, n, l = Wn( /*p*/ i[41].length ) + "", s; return { c() { - t = oe(e), n = oe("/"), s = oe(l); + t = ce(e), n = ce("/"), s = ce(l); }, m(o, r) { j(o, t, r), j(o, n, r), j(o, s, r); }, p(o, r) { r[0] & /*progress*/ - 128 && e !== (e = Mn( + 128 && e !== (e = Wn( /*p*/ o[41].index || 0 - ) + "") && Ge(t, e), r[0] & /*progress*/ - 128 && l !== (l = Mn( + ) + "") && Ze(t, e), r[0] & /*progress*/ + 128 && l !== (l = Wn( /*p*/ o[41].length - ) + "") && Ge(s, l); + ) + "") && Ze(s, l); }, d(o) { - o && (Y(t), Y(n), Y(s)); + o && (T(t), T(n), T(s)); } }; } -function Eo(i) { +function Ro(i) { let e, t = ( /*p*/ - i[41].index != null && Lo(i) + i[41].index != null && Eo(i) ); return { c() { - t && t.c(), e = Fn(); + t && t.c(), e = Nn(); }, m(n, l) { t && t.m(n, l), j(n, e, l); }, p(n, l) { /*p*/ - n[41].index != null ? t ? t.p(n, l) : (t = Lo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[41].index != null ? t ? t.p(n, l) : (t = Eo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(n) { - n && Y(e), t && t.d(n); + n && T(e), t && t.d(n); } }; } -function Mo(i) { +function Ao(i) { let e, t = ( /*eta*/ i[0] ? `/${/*formatted_eta*/ @@ -3141,43 +3141,43 @@ function Mo(i) { ), n, l; return { c() { - e = oe( + e = ce( /*formatted_timer*/ i[20] - ), n = oe(t), l = oe("s"); + ), n = ce(t), l = ce("s"); }, m(s, o) { j(s, e, o), j(s, n, o), j(s, l, o); }, p(s, o) { o[0] & /*formatted_timer*/ - 1048576 && Ge( + 1048576 && Ze( e, /*formatted_timer*/ s[20] ), o[0] & /*eta, formatted_eta*/ 524289 && t !== (t = /*eta*/ s[0] ? `/${/*formatted_eta*/ - s[19]}` : "") && Ge(n, t); + s[19]}` : "") && Ze(n, t); }, d(s) { - s && (Y(e), Y(n), Y(l)); + s && (T(e), T(n), T(l)); } }; } -function Jd(i) { +function i1(i) { let e, t; - return e = new Wd({ + return e = new Fd({ props: { margin: ( /*variant*/ i[8] === "default" ) } }), { c() { - sr(e.$$.fragment); + ar(e.$$.fragment); }, m(n, l) { - ur(e, n, l), t = !0; + dr(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -3186,54 +3186,54 @@ function Jd(i) { n[8] === "default"), e.$set(s); }, i(n) { - t || (st(e.$$.fragment, n), t = !0); + t || (lt(e.$$.fragment, n), t = !0); }, o(n) { ht(e.$$.fragment, n), t = !1; }, d(n) { - ar(e, n); + fr(e, n); } }; } -function Qd(i) { +function l1(i) { let e, t, n, l, s, o = `${/*last_progress_level*/ i[15] * 100}%`, r = ( /*progress*/ - i[7] != null && Ro(i) + i[7] != null && Wo(i) ); return { c() { - e = dt("div"), t = dt("div"), r && r.c(), n = Ze(), l = dt("div"), s = dt("div"), ot(t, "class", "progress-level-inner svelte-16nch4a"), ot(s, "class", "progress-bar svelte-16nch4a"), Nt(s, "width", o), ot(l, "class", "progress-bar-wrap svelte-16nch4a"), ot(e, "class", "progress-level svelte-16nch4a"); + e = dt("div"), t = dt("div"), r && r.c(), n = Pe(), l = dt("div"), s = dt("div"), st(t, "class", "progress-level-inner svelte-16nch4a"), st(s, "class", "progress-bar svelte-16nch4a"), Gt(s, "width", o), st(l, "class", "progress-bar-wrap svelte-16nch4a"), st(e, "class", "progress-level svelte-16nch4a"); }, m(a, f) { - j(a, e, f), on(e, t), r && r.m(t, null), on(e, n), on(e, l), on(l, s), i[31](s); + j(a, e, f), fn(e, t), r && r.m(t, null), fn(e, n), fn(e, l), fn(l, s), i[31](s); }, p(a, f) { /*progress*/ - a[7] != null ? r ? r.p(a, f) : (r = Ro(a), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/ + a[7] != null ? r ? r.p(a, f) : (r = Wo(a), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/ 32768 && o !== (o = `${/*last_progress_level*/ - a[15] * 100}%`) && Nt(s, "width", o); + a[15] * 100}%`) && Gt(s, "width", o); }, - i: ps, - o: ps, + i: ks, + o: ks, d(a) { - a && Y(e), r && r.d(), i[31](null); + a && T(e), r && r.d(), i[31](null); } }; } -function Ro(i) { - let e, t = Ki( +function Wo(i) { + let e, t = xi( /*progress*/ i[7] ), n = []; for (let l = 0; l < t.length; l += 1) - n[l] = To(Bo(i, t, l)); + n[l] = To(qo(i, t, l)); return { c() { for (let l = 0; l < n.length; l += 1) n[l].c(); - e = Fn(); + e = Nn(); }, m(l, s) { for (let o = 0; o < n.length; o += 1) @@ -3243,13 +3243,13 @@ function Ro(i) { p(l, s) { if (s[0] & /*progress_level, progress*/ 16512) { - t = Ki( + t = xi( /*progress*/ l[7] ); let o; for (o = 0; o < t.length; o += 1) { - const r = Bo(l, t, o); + const r = qo(l, t, o); n[o] ? n[o].p(r, s) : (n[o] = To(r), n[o].c(), n[o].m(e.parentNode, e)); } for (; o < n.length; o += 1) @@ -3258,17 +3258,17 @@ function Ro(i) { } }, d(l) { - l && Y(e), rr(n, l); + l && T(e), cr(n, l); } }; } -function Ao(i) { +function Xo(i) { let e, t, n, l, s = ( /*i*/ - i[43] !== 0 && xd() + i[43] !== 0 && s1() ), o = ( /*p*/ - i[41].desc != null && Wo(i) + i[41].desc != null && Yo(i) ), r = ( /*p*/ i[41].desc != null && /*progress_level*/ @@ -3276,56 +3276,56 @@ function Ao(i) { i[14][ /*i*/ i[43] - ] != null && Ho() + ] != null && Io() ), a = ( /*progress_level*/ - i[14] != null && Io(i) + i[14] != null && Ho(i) ); return { c() { - s && s.c(), e = Ze(), o && o.c(), t = Ze(), r && r.c(), n = Ze(), a && a.c(), l = Fn(); + s && s.c(), e = Pe(), o && o.c(), t = Pe(), r && r.c(), n = Pe(), a && a.c(), l = Nn(); }, m(f, c) { s && s.m(f, c), j(f, e, c), o && o.m(f, c), j(f, t, c), r && r.m(f, c), j(f, n, c), a && a.m(f, c), j(f, l, c); }, p(f, c) { /*p*/ - f[41].desc != null ? o ? o.p(f, c) : (o = Wo(f), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/ + f[41].desc != null ? o ? o.p(f, c) : (o = Yo(f), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/ f[41].desc != null && /*progress_level*/ f[14] && /*progress_level*/ f[14][ /*i*/ f[43] - ] != null ? r || (r = Ho(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/ - f[14] != null ? a ? a.p(f, c) : (a = Io(f), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null); + ] != null ? r || (r = Io(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/ + f[14] != null ? a ? a.p(f, c) : (a = Ho(f), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null); }, d(f) { - f && (Y(e), Y(t), Y(n), Y(l)), s && s.d(f), o && o.d(f), r && r.d(f), a && a.d(f); + f && (T(e), T(t), T(n), T(l)), s && s.d(f), o && o.d(f), r && r.d(f), a && a.d(f); } }; } -function xd(i) { +function s1(i) { let e; return { c() { - e = oe(" /"); + e = ce(" /"); }, m(t, n) { j(t, e, n); }, d(t) { - t && Y(e); + t && T(e); } }; } -function Wo(i) { +function Yo(i) { let e = ( /*p*/ i[41].desc + "" ), t; return { c() { - t = oe(e); + t = ce(e); }, m(n, l) { j(n, t, l); @@ -3333,28 +3333,28 @@ function Wo(i) { p(n, l) { l[0] & /*progress*/ 128 && e !== (e = /*p*/ - n[41].desc + "") && Ge(t, e); + n[41].desc + "") && Ze(t, e); }, d(n) { - n && Y(t); + n && T(t); } }; } -function Ho(i) { +function Io(i) { let e; return { c() { - e = oe("-"); + e = ce("-"); }, m(t, n) { j(t, e, n); }, d(t) { - t && Y(e); + t && T(e); } }; } -function Io(i) { +function Ho(i) { let e = (100 * /*progress_level*/ (i[14][ /*i*/ @@ -3362,7 +3362,7 @@ function Io(i) { ] || 0)).toFixed(1) + "", t, n; return { c() { - t = oe(e), n = oe("%"); + t = ce(e), n = ce("%"); }, m(l, s) { j(l, t, s), j(l, n, s); @@ -3373,10 +3373,10 @@ function Io(i) { (l[14][ /*i*/ l[43] - ] || 0)).toFixed(1) + "") && Ge(t, e); + ] || 0)).toFixed(1) + "") && Ze(t, e); }, d(l) { - l && (Y(t), Y(n)); + l && (T(t), T(n)); } }; } @@ -3388,11 +3388,11 @@ function To(i) { i[14][ /*i*/ i[43] - ] != null) && Ao(i) + ] != null) && Xo(i) ); return { c() { - t && t.c(), e = Fn(); + t && t.c(), e = Nn(); }, m(n, l) { t && t.m(n, l), j(n, e, l); @@ -3404,75 +3404,75 @@ function To(i) { n[14][ /*i*/ n[43] - ] != null ? t ? t.p(n, l) : (t = Ao(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + ] != null ? t ? t.p(n, l) : (t = Xo(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(n) { - n && Y(e), t && t.d(n); + n && T(e), t && t.d(n); } }; } -function Xo(i) { +function jo(i) { let e, t, n, l; const s = ( /*#slots*/ i[30]["additional-loading-text"] - ), o = or( + ), o = rr( s, i, /*$$scope*/ i[29], - zo + Do ); return { c() { - e = dt("p"), t = oe( + e = dt("p"), t = ce( /*loading_text*/ i[9] - ), n = Ze(), o && o.c(), ot(e, "class", "loading svelte-16nch4a"); + ), n = Pe(), o && o.c(), st(e, "class", "loading svelte-16nch4a"); }, m(r, a) { - j(r, e, a), on(e, t), j(r, n, a), o && o.m(r, a), l = !0; + j(r, e, a), fn(e, t), j(r, n, a), o && o.m(r, a), l = !0; }, p(r, a) { (!l || a[0] & /*loading_text*/ - 512) && Ge( + 512) && Ze( t, /*loading_text*/ r[9] ), o && o.p && (!l || a[0] & /*$$scope*/ - 536870912) && _r( + 536870912) && hr( o, s, r, /*$$scope*/ r[29], - l ? cr( + l ? _r( s, /*$$scope*/ r[29], a, - Ud - ) : fr( + Kd + ) : ur( /*$$scope*/ r[29] ), - zo + Do ); }, i(r) { - l || (st(o, r), l = !0); + l || (lt(o, r), l = !0); }, o(r) { ht(o, r), l = !1; }, d(r) { - r && (Y(e), Y(n)), o && o.d(r); + r && (T(e), T(n)), o && o.d(r); } }; } -function $d(i) { +function o1(i) { let e, t, n, l, s; - const o = [Nd, Vd], r = []; + const o = [Qd, Jd], r = []; function a(f, c) { return ( /*status*/ @@ -3484,12 +3484,12 @@ function $d(i) { } return ~(t = a(i)) && (n = r[t] = o[t](i)), { c() { - e = dt("div"), n && n.c(), ot(e, "class", l = "wrap " + /*variant*/ + e = dt("div"), n && n.c(), st(e, "class", l = "wrap " + /*variant*/ i[8] + " " + /*show_progress*/ - i[6] + " svelte-16nch4a"), Pe(e, "hide", !/*status*/ + i[6] + " svelte-16nch4a"), Oe(e, "hide", !/*status*/ i[4] || /*status*/ i[4] === "complete" || /*show_progress*/ - i[6] === "hidden"), Pe( + i[6] === "hidden"), Oe( e, "translucent", /*variant*/ @@ -3498,22 +3498,22 @@ function $d(i) { i[4] === "error") || /*translucent*/ i[11] || /*show_progress*/ i[6] === "minimal" - ), Pe( + ), Oe( e, "generating", /*status*/ i[4] === "generating" - ), Pe( + ), Oe( e, "border", /*border*/ i[12] - ), Nt( + ), Gt( e, "position", /*absolute*/ i[10] ? "absolute" : "static" - ), Nt( + ), Gt( e, "padding", /*absolute*/ @@ -3527,15 +3527,15 @@ function $d(i) { let u = t; t = a(f), t === u ? ~t && r[t].p(f, c) : (n && (vs(), ht(r[u], 1, 1, () => { r[u] = null; - }), ws()), ~t ? (n = r[t], n ? n.p(f, c) : (n = r[t] = o[t](f), n.c()), st(n, 1), n.m(e, null)) : n = null), (!s || c[0] & /*variant, show_progress*/ + }), ps()), ~t ? (n = r[t], n ? n.p(f, c) : (n = r[t] = o[t](f), n.c()), lt(n, 1), n.m(e, null)) : n = null), (!s || c[0] & /*variant, show_progress*/ 320 && l !== (l = "wrap " + /*variant*/ f[8] + " " + /*show_progress*/ - f[6] + " svelte-16nch4a")) && ot(e, "class", l), (!s || c[0] & /*variant, show_progress, status, show_progress*/ - 336) && Pe(e, "hide", !/*status*/ + f[6] + " svelte-16nch4a")) && st(e, "class", l), (!s || c[0] & /*variant, show_progress, status, show_progress*/ + 336) && Oe(e, "hide", !/*status*/ f[4] || /*status*/ f[4] === "complete" || /*show_progress*/ f[6] === "hidden"), (!s || c[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ - 2384) && Pe( + 2384) && Oe( e, "translucent", /*variant*/ @@ -3545,25 +3545,25 @@ function $d(i) { f[11] || /*show_progress*/ f[6] === "minimal" ), (!s || c[0] & /*variant, show_progress, status*/ - 336) && Pe( + 336) && Oe( e, "generating", /*status*/ f[4] === "generating" ), (!s || c[0] & /*variant, show_progress, border*/ - 4416) && Pe( + 4416) && Oe( e, "border", /*border*/ f[12] ), c[0] & /*absolute*/ - 1024 && Nt( + 1024 && Gt( e, "position", /*absolute*/ f[10] ? "absolute" : "static" ), c[0] & /*absolute*/ - 1024 && Nt( + 1024 && Gt( e, "padding", /*absolute*/ @@ -3571,17 +3571,17 @@ function $d(i) { ); }, i(f) { - s || (st(n), s = !0); + s || (lt(n), s = !0); }, o(f) { ht(n), s = !1; }, d(f) { - f && Y(e), ~t && r[t].d(), i[33](null); + f && T(e), ~t && r[t].d(), i[33](null); } }; } -var e1 = function(i, e, t, n) { +var a1 = function(i, e, t, n) { function l(s) { return s instanceof t ? s : new t(function(o) { o(s); @@ -3608,73 +3608,73 @@ var e1 = function(i, e, t, n) { f((n = n.apply(i, e || [])).next()); }); }; -let Bi = [], Zl = !1; -function t1(i) { - return e1(this, arguments, void 0, function* (e, t = !0) { +let Li = [], Gl = !1; +function r1(i) { + return a1(this, arguments, void 0, function* (e, t = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) { - if (Bi.push(e), !Zl) Zl = !0; + if (Li.push(e), !Gl) Gl = !0; else return; - yield Xd(), requestAnimationFrame(() => { + yield Od(), requestAnimationFrame(() => { let n = [0, 0]; - for (let l = 0; l < Bi.length; l++) { - const o = Bi[l].getBoundingClientRect(); + for (let l = 0; l < Li.length; l++) { + const o = Li[l].getBoundingClientRect(); (l === 0 || o.top + window.scrollY <= n[0]) && (n[0] = o.top + window.scrollY, n[1] = l); } - window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Zl = !1, Bi = []; + window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Gl = !1, Li = []; }); } }); } -function n1(i, e, t) { +function f1(i, e, t) { let n, { $$slots: l = {}, $$scope: s } = e; this && this.__awaiter; - const o = jd(); - let { i18n: r } = e, { eta: a = null } = e, { queue_position: f } = e, { queue_size: c } = e, { status: u } = e, { scroll_to_output: _ = !1 } = e, { timer: d = !0 } = e, { show_progress: m = "full" } = e, { message: h = null } = e, { progress: g = null } = e, { variant: v = "default" } = e, { loading_text: w = "Loading..." } = e, { absolute: b = !0 } = e, { translucent: k = !1 } = e, { border: p = !1 } = e, { autoscroll: y } = e, q, C = !1, z = 0, S = 0, W = null, A = null, F = 0, K = null, ne, U = null, Q = !0; - const M = () => { - t(0, a = t(27, W = t(19, Z = null))), t(25, z = performance.now()), t(26, S = 0), C = !0, V(); + const o = Zd(); + let { i18n: r } = e, { eta: a = null } = e, { queue_position: f } = e, { queue_size: c } = e, { status: u } = e, { scroll_to_output: _ = !1 } = e, { timer: d = !0 } = e, { show_progress: m = "full" } = e, { message: h = null } = e, { progress: g = null } = e, { variant: p = "default" } = e, { loading_text: w = "Loading..." } = e, { absolute: b = !0 } = e, { translucent: k = !1 } = e, { border: v = !1 } = e, { autoscroll: y } = e, S, C = !1, z = 0, D = 0, q = null, W = null, F = 0, J = null, ie, P = null, $ = !0; + const R = () => { + t(0, a = t(27, q = t(19, Q = null))), t(25, z = performance.now()), t(26, D = 0), C = !0, V(); }; function V() { requestAnimationFrame(() => { - t(26, S = (performance.now() - z) / 1e3), C && V(); + t(26, D = (performance.now() - z) / 1e3), C && V(); }); } - function R() { - t(26, S = 0), t(0, a = t(27, W = t(19, Z = null))), C && (C = !1); + function A() { + t(26, D = 0), t(0, a = t(27, q = t(19, Q = null))), C && (C = !1); } - Yd(() => { - C && R(); + Pd(() => { + C && A(); }); - let Z = null; - function x(H) { - Co[H ? "unshift" : "push"](() => { - U = H, t(16, U), t(7, g), t(14, K), t(15, ne); + let Q = null; + function ae(X) { + zo[X ? "unshift" : "push"](() => { + P = X, t(16, P), t(7, g), t(14, J), t(15, ie); }); } - const J = () => { + const Z = () => { o("clear_status"); }; - function O(H) { - Co[H ? "unshift" : "push"](() => { - q = H, t(13, q); + function G(X) { + zo[X ? "unshift" : "push"](() => { + S = X, t(13, S); }); } - return i.$$set = (H) => { - "i18n" in H && t(1, r = H.i18n), "eta" in H && t(0, a = H.eta), "queue_position" in H && t(2, f = H.queue_position), "queue_size" in H && t(3, c = H.queue_size), "status" in H && t(4, u = H.status), "scroll_to_output" in H && t(22, _ = H.scroll_to_output), "timer" in H && t(5, d = H.timer), "show_progress" in H && t(6, m = H.show_progress), "message" in H && t(23, h = H.message), "progress" in H && t(7, g = H.progress), "variant" in H && t(8, v = H.variant), "loading_text" in H && t(9, w = H.loading_text), "absolute" in H && t(10, b = H.absolute), "translucent" in H && t(11, k = H.translucent), "border" in H && t(12, p = H.border), "autoscroll" in H && t(24, y = H.autoscroll), "$$scope" in H && t(29, s = H.$$scope); + return i.$$set = (X) => { + "i18n" in X && t(1, r = X.i18n), "eta" in X && t(0, a = X.eta), "queue_position" in X && t(2, f = X.queue_position), "queue_size" in X && t(3, c = X.queue_size), "status" in X && t(4, u = X.status), "scroll_to_output" in X && t(22, _ = X.scroll_to_output), "timer" in X && t(5, d = X.timer), "show_progress" in X && t(6, m = X.show_progress), "message" in X && t(23, h = X.message), "progress" in X && t(7, g = X.progress), "variant" in X && t(8, p = X.variant), "loading_text" in X && t(9, w = X.loading_text), "absolute" in X && t(10, b = X.absolute), "translucent" in X && t(11, k = X.translucent), "border" in X && t(12, v = X.border), "autoscroll" in X && t(24, y = X.autoscroll), "$$scope" in X && t(29, s = X.$$scope); }, i.$$.update = () => { i.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 436207617 && (a === null && t(0, a = W), a != null && W !== a && (t(28, A = (performance.now() - z) / 1e3 + a), t(19, Z = A.toFixed(1)), t(27, W = a))), i.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 335544320 && t(17, F = A === null || A <= 0 || !S ? null : Math.min(S / A, 1)), i.$$.dirty[0] & /*progress*/ - 128 && g != null && t(18, Q = !1), i.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (g != null ? t(14, K = g.map((H) => { - if (H.index != null && H.length != null) - return H.index / H.length; - if (H.progress != null) - return H.progress; - })) : t(14, K = null), K ? (t(15, ne = K[K.length - 1]), U && (ne === 0 ? t(16, U.style.transition = "0", U) : t(16, U.style.transition = "150ms", U))) : t(15, ne = void 0)), i.$$.dirty[0] & /*status*/ - 16 && (u === "pending" ? M() : R()), i.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && q && _ && (u === "pending" || u === "complete") && t1(q, y), i.$$.dirty[0] & /*status, message*/ + 436207617 && (a === null && t(0, a = q), a != null && q !== a && (t(28, W = (performance.now() - z) / 1e3 + a), t(19, Q = W.toFixed(1)), t(27, q = a))), i.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 335544320 && t(17, F = W === null || W <= 0 || !D ? null : Math.min(D / W, 1)), i.$$.dirty[0] & /*progress*/ + 128 && g != null && t(18, $ = !1), i.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (g != null ? t(14, J = g.map((X) => { + if (X.index != null && X.length != null) + return X.index / X.length; + if (X.progress != null) + return X.progress; + })) : t(14, J = null), J ? (t(15, ie = J[J.length - 1]), P && (ie === 0 ? t(16, P.style.transition = "0", P) : t(16, P.style.transition = "150ms", P))) : t(15, ie = void 0)), i.$$.dirty[0] & /*status*/ + 16 && (u === "pending" ? R() : A()), i.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && S && _ && (u === "pending" || u === "complete") && r1(S, y), i.$$.dirty[0] & /*status, message*/ 8388624, i.$$.dirty[0] & /*timer_diff*/ - 67108864 && t(20, n = S.toFixed(1)); + 67108864 && t(20, n = D.toFixed(1)); }, [ a, r, @@ -3684,42 +3684,42 @@ function n1(i, e, t) { d, m, g, - v, + p, w, b, k, - p, - q, - K, - ne, - U, + v, + S, + J, + ie, + P, F, + $, Q, - Z, n, o, _, h, y, z, - S, + D, + q, W, - A, s, l, - x, - J, - O + ae, + Z, + G ]; } -class i1 extends Hd { +class c1 extends Ud { constructor(e) { - super(), Id( + super(), Vd( this, e, - n1, - $d, - Td, + f1, + o1, + Nd, { i18n: 1, eta: 0, @@ -3743,30 +3743,30 @@ class i1 extends Hd { ); } } -const { setContext: C2, getContext: l1 } = window.__gradio__svelte__internal, s1 = "WORKER_PROXY_CONTEXT_KEY"; -function dr() { - return l1(s1); +const { setContext: L2, getContext: u1 } = window.__gradio__svelte__internal, _1 = "WORKER_PROXY_CONTEXT_KEY"; +function mr() { + return u1(_1); } -function o1(i) { +function d1(i) { return i.host === window.location.host || i.host === "localhost:7860" || i.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 i.host === "lite.local"; } -function hr(i, e) { +function gr(i, e) { const t = e.toLowerCase(); for (const [n, l] of Object.entries(i)) if (n.toLowerCase() === t) return l; } -function mr(i) { +function br(i) { if (i == null) return !1; const e = new URL(i, window.location.href); - return !(!o1(e) || e.protocol !== "http:" && e.protocol !== "https:"); + return !(!d1(e) || e.protocol !== "http:" && e.protocol !== "https:"); } -async function a1(i) { - if (i == null || !mr(i)) +async function h1(i) { + if (i == null || !br(i)) return i; - const e = dr(); + const e = mr(); if (e == null) return i; const n = new URL(i, window.location.href).pathname; @@ -3779,41 +3779,41 @@ async function a1(i) { if (l.status !== 200) throw new Error(`Failed to get file ${n} from the Wasm worker.`); const s = new Blob([l.body], { - type: hr(l.headers, "content-type") + type: gr(l.headers, "content-type") }); return URL.createObjectURL(s); }); } const { - SvelteComponent: r1, - assign: Ji, - check_outros: gr, - compute_rest_props: Yo, - create_slot: As, - detach: ul, - element: br, - empty: wr, - exclude_internal_props: f1, - get_all_dirty_from_scope: Ws, - get_slot_changes: Hs, - get_spread_update: vr, - group_outros: pr, - init: c1, - insert: _l, - listen: kr, - prevent_default: u1, - safe_not_equal: _1, - set_attributes: Qi, - transition_in: _n, - transition_out: dn, + SvelteComponent: m1, + assign: $i, + check_outros: wr, + compute_rest_props: Fo, + create_slot: Ws, + detach: hl, + element: pr, + empty: vr, + exclude_internal_props: g1, + get_all_dirty_from_scope: Xs, + get_slot_changes: Ys, + get_spread_update: kr, + group_outros: yr, + init: b1, + insert: ml, + listen: Cr, + prevent_default: w1, + safe_not_equal: p1, + set_attributes: el, + transition_in: mn, + transition_out: gn, update_slot_base: Is -} = window.__gradio__svelte__internal, { createEventDispatcher: d1 } = window.__gradio__svelte__internal; -function h1(i) { +} = window.__gradio__svelte__internal, { createEventDispatcher: v1 } = window.__gradio__svelte__internal; +function k1(i) { let e, t, n, l, s; const o = ( /*#slots*/ i[8].default - ), r = As( + ), r = Ws( o, i, /*$$scope*/ @@ -3837,13 +3837,13 @@ function h1(i) { i[6] ], f = {}; for (let c = 0; c < a.length; c += 1) - f = Ji(f, a[c]); + f = $i(f, a[c]); return { c() { - e = br("a"), r && r.c(), Qi(e, f); + e = pr("a"), r && r.c(), el(e, f); }, m(c, u) { - _l(c, e, u), r && r.m(e, null), n = !0, l || (s = kr( + ml(c, e, u), r && r.m(e, null), n = !0, l || (s = Cr( e, "click", /*dispatch*/ @@ -3858,18 +3858,18 @@ function h1(i) { c, /*$$scope*/ c[7], - n ? Hs( + n ? Ys( o, /*$$scope*/ c[7], u, null - ) : Ws( + ) : Xs( /*$$scope*/ c[7] ), null - ), Qi(e, f = vr(a, [ + ), el(e, f = kr(a, [ (!n || u & /*href*/ 1) && { href: ( /*href*/ @@ -3888,19 +3888,19 @@ function h1(i) { ])); }, i(c) { - n || (_n(r, c), n = !0); + n || (mn(r, c), n = !0); }, o(c) { - dn(r, c), n = !1; + gn(r, c), n = !1; }, d(c) { - c && ul(e), r && r.d(c), l = !1, s(); + c && hl(e), r && r.d(c), l = !1, s(); } }; } -function m1(i) { +function y1(i) { let e, t, n, l; - const s = [b1, g1], o = []; + const s = [S1, C1], o = []; function r(a, f) { return ( /*is_downloading*/ @@ -3909,34 +3909,34 @@ function m1(i) { } return e = r(i), t = o[e] = s[e](i), { c() { - t.c(), n = wr(); + t.c(), n = vr(); }, m(a, f) { - o[e].m(a, f), _l(a, n, f), l = !0; + o[e].m(a, f), ml(a, n, f), l = !0; }, p(a, f) { let c = e; - e = r(a), e === c ? o[e].p(a, f) : (pr(), dn(o[c], 1, 1, () => { + e = r(a), e === c ? o[e].p(a, f) : (yr(), gn(o[c], 1, 1, () => { o[c] = null; - }), gr(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), _n(t, 1), t.m(n.parentNode, n)); + }), wr(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), mn(t, 1), t.m(n.parentNode, n)); }, i(a) { - l || (_n(t), l = !0); + l || (mn(t), l = !0); }, o(a) { - dn(t), l = !1; + gn(t), l = !1; }, d(a) { - a && ul(n), o[e].d(a); + a && hl(n), o[e].d(a); } }; } -function g1(i) { +function C1(i) { let e, t, n, l; const s = ( /*#slots*/ i[8].default - ), o = As( + ), o = Ws( s, i, /*$$scope*/ @@ -3952,13 +3952,13 @@ function g1(i) { ) } ], a = {}; for (let f = 0; f < r.length; f += 1) - a = Ji(a, r[f]); + a = $i(a, r[f]); return { c() { - e = br("a"), o && o.c(), Qi(e, a); + e = pr("a"), o && o.c(), el(e, a); }, m(f, c) { - _l(f, e, c), o && o.m(e, null), t = !0, n || (l = kr(e, "click", u1( + ml(f, e, c), o && o.m(e, null), t = !0, n || (l = Cr(e, "click", w1( /*wasm_click_handler*/ i[5] )), n = !0); @@ -3971,18 +3971,18 @@ function g1(i) { f, /*$$scope*/ f[7], - t ? Hs( + t ? Ys( s, /*$$scope*/ f[7], c, null - ) : Ws( + ) : Xs( /*$$scope*/ f[7] ), null - ), Qi(e, a = vr(r, [ + ), el(e, a = kr(r, [ c & /*$$restProps*/ 64 && /*$$restProps*/ f[6], @@ -3994,22 +3994,22 @@ function g1(i) { ])); }, i(f) { - t || (_n(o, f), t = !0); + t || (mn(o, f), t = !0); }, o(f) { - dn(o, f), t = !1; + gn(o, f), t = !1; }, d(f) { - f && ul(e), o && o.d(f), n = !1, l(); + f && hl(e), o && o.d(f), n = !1, l(); } }; } -function b1(i) { +function S1(i) { let e; const t = ( /*#slots*/ i[8].default - ), n = As( + ), n = Ws( t, i, /*$$scope*/ @@ -4031,13 +4031,13 @@ function b1(i) { l, /*$$scope*/ l[7], - e ? Hs( + e ? Ys( t, /*$$scope*/ l[7], s, null - ) : Ws( + ) : Xs( /*$$scope*/ l[7] ), @@ -4045,85 +4045,85 @@ function b1(i) { ); }, i(l) { - e || (_n(n, l), e = !0); + e || (mn(n, l), e = !0); }, o(l) { - dn(n, l), e = !1; + gn(n, l), e = !1; }, d(l) { n && n.d(l); } }; } -function w1(i) { +function z1(i) { let e, t, n, l, s; - const o = [m1, h1], r = []; + const o = [y1, k1], r = []; function a(f, c) { return c & /*href*/ 1 && (e = null), e == null && (e = !!/*worker_proxy*/ - (f[4] && mr( + (f[4] && br( /*href*/ f[0] ))), e ? 0 : 1; } return t = a(i, -1), n = r[t] = o[t](i), { c() { - n.c(), l = wr(); + n.c(), l = vr(); }, m(f, c) { - r[t].m(f, c), _l(f, l, c), s = !0; + r[t].m(f, c), ml(f, l, c), s = !0; }, p(f, [c]) { let u = t; - t = a(f, c), t === u ? r[t].p(f, c) : (pr(), dn(r[u], 1, 1, () => { + t = a(f, c), t === u ? r[t].p(f, c) : (yr(), gn(r[u], 1, 1, () => { r[u] = null; - }), gr(), n = r[t], n ? n.p(f, c) : (n = r[t] = o[t](f), n.c()), _n(n, 1), n.m(l.parentNode, l)); + }), wr(), n = r[t], n ? n.p(f, c) : (n = r[t] = o[t](f), n.c()), mn(n, 1), n.m(l.parentNode, l)); }, i(f) { - s || (_n(n), s = !0); + s || (mn(n), s = !0); }, o(f) { - dn(n), s = !1; + gn(n), s = !1; }, d(f) { - f && ul(l), r[t].d(f); + f && hl(l), r[t].d(f); } }; } -function v1(i, e, t) { +function B1(i, e, t) { const n = ["href", "download"]; - let l = Yo(e, n), { $$slots: s = {}, $$scope: o } = e; - var r = this && this.__awaiter || function(m, h, g, v) { + let l = Fo(e, n), { $$slots: s = {}, $$scope: o } = e; + var r = this && this.__awaiter || function(m, h, g, p) { function w(b) { return b instanceof g ? b : new g(function(k) { k(b); }); } return new (g || (g = Promise))(function(b, k) { - function p(C) { + function v(C) { try { - q(v.next(C)); + S(p.next(C)); } catch (z) { k(z); } } function y(C) { try { - q(v.throw(C)); + S(p.throw(C)); } catch (z) { k(z); } } - function q(C) { - C.done ? b(C.value) : w(C.value).then(p, y); + function S(C) { + C.done ? b(C.value) : w(C.value).then(v, y); } - q((v = v.apply(m, h || [])).next()); + S((p = p.apply(m, h || [])).next()); }); }; let { href: a = void 0 } = e, { download: f } = e; - const c = d1(); + const c = v1(); let u = !1; - const _ = dr(); + const _ = mr(); function d() { return r(this, void 0, void 0, function* () { if (u) @@ -4141,12 +4141,12 @@ function v1(i, e, t) { }).then((g) => { if (g.status !== 200) throw new Error(`Failed to get file ${h} from the Wasm worker.`); - const v = new Blob( + const p = new Blob( [g.body], { - type: hr(g.headers, "content-type") + type: gr(g.headers, "content-type") } - ), w = URL.createObjectURL(v), b = document.createElement("a"); + ), w = URL.createObjectURL(p), b = document.createElement("a"); b.href = w, b.download = f, b.click(), URL.revokeObjectURL(w); }).finally(() => { t(2, u = !1); @@ -4154,7 +4154,7 @@ function v1(i, e, t) { }); } return i.$$set = (m) => { - e = Ji(Ji({}, e), f1(m)), t(6, l = Yo(e, n)), "href" in m && t(0, a = m.href), "download" in m && t(1, f = m.download), "$$scope" in m && t(7, o = m.$$scope); + e = $i($i({}, e), g1(m)), t(6, l = Fo(e, n)), "href" in m && t(0, a = m.href), "download" in m && t(1, f = m.download), "$$scope" in m && t(7, o = m.$$scope); }, [ a, f, @@ -4167,23 +4167,23 @@ function v1(i, e, t) { s ]; } -class p1 extends r1 { +class D1 extends m1 { constructor(e) { - super(), c1(this, e, v1, w1, _1, { href: 0, download: 1 }); + super(), b1(this, e, B1, z1, p1, { href: 0, download: 1 }); } } -var k1 = Object.defineProperty, y1 = (i, e, t) => e in i ? k1(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, bt = (i, e, t) => (y1(i, typeof e != "symbol" ? e + "" : e, t), t), yr = (i, e, t) => { +var q1 = Object.defineProperty, L1 = (i, e, t) => e in i ? q1(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, vt = (i, e, t) => (L1(i, typeof e != "symbol" ? e + "" : e, t), t), Sr = (i, e, t) => { if (!e.has(i)) throw TypeError("Cannot " + t); -}, Qn = (i, e, t) => (yr(i, e, "read from private field"), t ? t.call(i) : e.get(i)), C1 = (i, e, t) => { +}, $n = (i, e, t) => (Sr(i, e, "read from private field"), t ? t.call(i) : e.get(i)), M1 = (i, e, t) => { if (e.has(i)) throw TypeError("Cannot add the same private member more than once"); e instanceof WeakSet ? e.add(i) : e.set(i, t); -}, S1 = (i, e, t, n) => (yr(i, e, "write to private field"), e.set(i, t), t), Vt; +}, E1 = (i, e, t, n) => (Sr(i, e, "write to private field"), e.set(i, t), t), Zt; new Intl.Collator(0, { numeric: 1 }).compare; -async function Cr(i, e) { +async function zr(i, e) { return i.map( - (t) => new z1({ + (t) => new R1({ path: t.name, orig_name: t.name, blob: t, @@ -4193,7 +4193,7 @@ async function Cr(i, e) { }) ); } -class z1 { +class R1 { constructor({ path: e, url: t, @@ -4204,16 +4204,16 @@ class z1 { mime_type: r, alt_text: a }) { - bt(this, "path"), bt(this, "url"), bt(this, "orig_name"), bt(this, "size"), bt(this, "blob"), bt(this, "is_stream"), bt(this, "mime_type"), bt(this, "alt_text"), bt(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = l, this.blob = t ? void 0 : s, this.is_stream = o, this.mime_type = r, this.alt_text = a; + vt(this, "path"), vt(this, "url"), vt(this, "orig_name"), vt(this, "size"), vt(this, "blob"), vt(this, "is_stream"), vt(this, "mime_type"), vt(this, "alt_text"), vt(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = t, this.orig_name = n, this.size = l, this.blob = t ? void 0 : s, this.is_stream = o, this.mime_type = r, this.alt_text = a; } } typeof process < "u" && process.versions && process.versions.node; -class S2 extends TransformStream { +class M2 extends TransformStream { /** Constructs a new instance. */ constructor(e = { allowCR: !1 }) { super({ transform: (t, n) => { - for (t = Qn(this, Vt) + t; ; ) { + for (t = $n(this, Zt) + t; ; ) { const l = t.indexOf(` `), s = e.allowCR ? t.indexOf("\r") : -1; if (s !== -1 && s !== t.length - 1 && (l === -1 || l - 1 > s)) { @@ -4225,36 +4225,36 @@ class S2 extends TransformStream { const o = t[l - 1] === "\r" ? l - 1 : l; n.enqueue(t.slice(0, o)), t = t.slice(l + 1); } - S1(this, Vt, t); + E1(this, Zt, t); }, flush: (t) => { - if (Qn(this, Vt) === "") + if ($n(this, Zt) === "") return; - const n = e.allowCR && Qn(this, Vt).endsWith("\r") ? Qn(this, Vt).slice(0, -1) : Qn(this, Vt); + const n = e.allowCR && $n(this, Zt).endsWith("\r") ? $n(this, Zt).slice(0, -1) : $n(this, Zt); t.enqueue(n); } - }), C1(this, Vt, ""); + }), M1(this, Zt, ""); } } -Vt = /* @__PURE__ */ new WeakMap(); +Zt = /* @__PURE__ */ new WeakMap(); const { - SvelteComponent: B1, + SvelteComponent: A1, append: Ee, - attr: nn, - detach: Sr, - element: ln, - init: q1, - insert: zr, - noop: jo, - safe_not_equal: D1, - set_data: xi, - set_style: Gl, - space: ks, - text: Rn, - toggle_class: Fo -} = window.__gradio__svelte__internal, { onMount: L1, createEventDispatcher: E1, onDestroy: M1 } = window.__gradio__svelte__internal; -function Uo(i) { - let e, t, n, l, s = si( + attr: on, + detach: Br, + element: an, + init: W1, + insert: Dr, + noop: Uo, + safe_not_equal: X1, + set_data: tl, + set_style: Kl, + space: ys, + text: Xn, + toggle_class: Vo +} = window.__gradio__svelte__internal, { onMount: Y1, createEventDispatcher: I1, onDestroy: H1 } = window.__gradio__svelte__internal; +function No(i) { + let e, t, n, l, s = ai( /*file_to_display*/ i[2] ) + "", o, r, a, f, c = ( @@ -4263,33 +4263,33 @@ function Uo(i) { ), u; return { c() { - e = ln("div"), t = ln("span"), n = ln("div"), l = ln("progress"), o = Rn(s), a = ks(), f = ln("span"), u = Rn(c), Gl(l, "visibility", "hidden"), Gl(l, "height", "0"), Gl(l, "width", "0"), l.value = r = si( + e = an("div"), t = an("span"), n = an("div"), l = an("progress"), o = Xn(s), a = ys(), f = an("span"), u = Xn(c), Kl(l, "visibility", "hidden"), Kl(l, "height", "0"), Kl(l, "width", "0"), l.value = r = ai( /*file_to_display*/ i[2] - ), nn(l, "max", "100"), nn(l, "class", "svelte-cr2edf"), nn(n, "class", "progress-bar svelte-cr2edf"), nn(f, "class", "file-name svelte-cr2edf"), nn(e, "class", "file svelte-cr2edf"); + ), on(l, "max", "100"), on(l, "class", "svelte-cr2edf"), on(n, "class", "progress-bar svelte-cr2edf"), on(f, "class", "file-name svelte-cr2edf"), on(e, "class", "file svelte-cr2edf"); }, m(_, d) { - zr(_, e, d), Ee(e, t), Ee(t, n), Ee(n, l), Ee(l, o), Ee(e, a), Ee(e, f), Ee(f, u); + Dr(_, e, d), Ee(e, t), Ee(t, n), Ee(n, l), Ee(l, o), Ee(e, a), Ee(e, f), Ee(f, u); }, p(_, d) { d & /*file_to_display*/ - 4 && s !== (s = si( + 4 && s !== (s = ai( /*file_to_display*/ _[2] - ) + "") && xi(o, s), d & /*file_to_display*/ - 4 && r !== (r = si( + ) + "") && tl(o, s), d & /*file_to_display*/ + 4 && r !== (r = ai( /*file_to_display*/ _[2] )) && (l.value = r), d & /*file_to_display*/ 4 && c !== (c = /*file_to_display*/ - _[2].orig_name + "") && xi(u, c); + _[2].orig_name + "") && tl(u, c); }, d(_) { - _ && Sr(e); + _ && Br(e); } }; } -function R1(i) { +function T1(i) { let e, t, n, l = ( /*files_with_progress*/ i[0].length + "" @@ -4298,11 +4298,11 @@ function R1(i) { i[0].length > 1 ? "files" : "file" ), a, f, c, u = ( /*file_to_display*/ - i[2] && Uo(i) + i[2] && No(i) ); return { c() { - e = ln("div"), t = ln("span"), n = Rn("Uploading "), s = Rn(l), o = ks(), a = Rn(r), f = Rn("..."), c = ks(), u && u.c(), nn(t, "class", "uploading svelte-cr2edf"), nn(e, "class", "wrap svelte-cr2edf"), Fo( + e = an("div"), t = an("span"), n = Xn("Uploading "), s = Xn(l), o = ys(), a = Xn(r), f = Xn("..."), c = ys(), u && u.c(), on(t, "class", "uploading svelte-cr2edf"), on(e, "class", "wrap svelte-cr2edf"), Vo( e, "progress", /*progress*/ @@ -4310,72 +4310,72 @@ function R1(i) { ); }, m(_, d) { - zr(_, e, d), Ee(e, t), Ee(t, n), Ee(t, s), Ee(t, o), Ee(t, a), Ee(t, f), Ee(e, c), u && u.m(e, null); + Dr(_, e, d), Ee(e, t), Ee(t, n), Ee(t, s), Ee(t, o), Ee(t, a), Ee(t, f), Ee(e, c), u && u.m(e, null); }, p(_, [d]) { d & /*files_with_progress*/ 1 && l !== (l = /*files_with_progress*/ - _[0].length + "") && xi(s, l), d & /*files_with_progress*/ + _[0].length + "") && tl(s, l), d & /*files_with_progress*/ 1 && r !== (r = /*files_with_progress*/ - _[0].length > 1 ? "files" : "file") && xi(a, r), /*file_to_display*/ - _[2] ? u ? u.p(_, d) : (u = Uo(_), u.c(), u.m(e, null)) : u && (u.d(1), u = null), d & /*progress*/ - 2 && Fo( + _[0].length > 1 ? "files" : "file") && tl(a, r), /*file_to_display*/ + _[2] ? u ? u.p(_, d) : (u = No(_), u.c(), u.m(e, null)) : u && (u.d(1), u = null), d & /*progress*/ + 2 && Vo( e, "progress", /*progress*/ _[1] ); }, - i: jo, - o: jo, + i: Uo, + o: Uo, d(_) { - _ && Sr(e), u && u.d(); + _ && Br(e), u && u.d(); } }; } -function si(i) { +function ai(i) { return i.progress * 100 / (i.size || 0) || 0; } -function A1(i) { +function j1(i) { let e = 0; return i.forEach((t) => { - e += si(t); + e += ai(t); }), document.documentElement.style.setProperty("--upload-progress-width", (e / i.length).toFixed(2) + "%"), e / i.length; } -function W1(i, e, t) { - var n = this && this.__awaiter || function(h, g, v, w) { +function F1(i, e, t) { + var n = this && this.__awaiter || function(h, g, p, w) { function b(k) { - return k instanceof v ? k : new v(function(p) { - p(k); + return k instanceof p ? k : new p(function(v) { + v(k); }); } - return new (v || (v = Promise))(function(k, p) { + return new (p || (p = Promise))(function(k, v) { function y(z) { try { C(w.next(z)); - } catch (S) { - p(S); + } catch (D) { + v(D); } } - function q(z) { + function S(z) { try { C(w.throw(z)); - } catch (S) { - p(S); + } catch (D) { + v(D); } } function C(z) { - z.done ? k(z.value) : b(z.value).then(y, q); + z.done ? k(z.value) : b(z.value).then(y, S); } C((w = w.apply(h, g || [])).next()); }); }; let { upload_id: l } = e, { root: s } = e, { files: o } = e, { stream_handler: r } = e, a, f = !1, c, u, _ = o.map((h) => Object.assign(Object.assign({}, h), { progress: 0 })); - const d = E1(); + const d = I1(); function m(h, g) { - t(0, _ = _.map((v) => (v.orig_name === h && (v.progress += g), v))); + t(0, _ = _.map((p) => (p.orig_name === h && (p.progress += g), p))); } - return L1(() => n(void 0, void 0, void 0, function* () { + return Y1(() => n(void 0, void 0, void 0, function* () { if (a = yield r(new URL(`${s}/upload_progress?upload_id=${l}`)), a == null) throw new Error("Event source is not defined"); a.onmessage = function(h) { @@ -4384,13 +4384,13 @@ function W1(i, e, t) { f || t(1, f = !0), g.msg === "done" ? (a == null || a.close(), d("done")) : (t(7, c = g), m(g.orig_name, g.chunk_size)); }); }; - })), M1(() => { + })), H1(() => { (a != null || a != null) && a.close(); }), i.$$set = (h) => { "upload_id" in h && t(3, l = h.upload_id), "root" in h && t(4, s = h.root), "files" in h && t(5, o = h.files), "stream_handler" in h && t(6, r = h.stream_handler); }, i.$$.update = () => { i.$$.dirty & /*files_with_progress*/ - 1 && A1(_), i.$$.dirty & /*current_file_upload, files_with_progress*/ + 1 && j1(_), i.$$.dirty & /*current_file_upload, files_with_progress*/ 129 && t(2, u = c || _[0]); }, [ _, @@ -4403,9 +4403,9 @@ function W1(i, e, t) { c ]; } -class H1 extends B1 { +class U1 extends A1 { constructor(e) { - super(), q1(this, e, W1, R1, D1, { + super(), W1(this, e, F1, T1, X1, { upload_id: 3, root: 4, files: 5, @@ -4414,42 +4414,42 @@ class H1 extends B1 { } } const { - SvelteComponent: I1, - append: Vo, - attr: ve, - binding_callbacks: T1, - bubble: Gt, - check_outros: Br, - create_component: X1, - create_slot: qr, - destroy_component: Y1, - detach: dl, - element: ys, - empty: Dr, - get_all_dirty_from_scope: Lr, - get_slot_changes: Er, - group_outros: Mr, - init: j1, - insert: hl, - listen: He, - mount_component: F1, - prevent_default: Kt, - run_all: U1, - safe_not_equal: V1, - set_style: Rr, - space: N1, - stop_propagation: Jt, - toggle_class: ge, - transition_in: Ot, - transition_out: hn, - update_slot_base: Ar -} = window.__gradio__svelte__internal, { createEventDispatcher: O1, tick: P1 } = window.__gradio__svelte__internal; -function Z1(i) { + SvelteComponent: V1, + append: Oo, + attr: ke, + binding_callbacks: N1, + bubble: Qt, + check_outros: qr, + create_component: O1, + create_slot: Lr, + destroy_component: P1, + detach: gl, + element: Cs, + empty: Mr, + get_all_dirty_from_scope: Er, + get_slot_changes: Rr, + group_outros: Ar, + init: Z1, + insert: bl, + listen: Ie, + mount_component: G1, + prevent_default: xt, + run_all: K1, + safe_not_equal: J1, + set_style: Wr, + space: Q1, + stop_propagation: $t, + toggle_class: we, + transition_in: Kt, + transition_out: bn, + update_slot_base: Xr +} = window.__gradio__svelte__internal, { createEventDispatcher: x1, tick: $1 } = window.__gradio__svelte__internal; +function eh(i) { let e, t, n, l, s, o, r, a, f, c, u; const _ = ( /*#slots*/ i[26].default - ), d = qr( + ), d = Lr( _, i, /*$$scope*/ @@ -4458,93 +4458,93 @@ function Z1(i) { ); return { c() { - e = ys("button"), d && d.c(), t = N1(), n = ys("input"), ve(n, "aria-label", "file upload"), ve(n, "data-testid", "file-upload"), ve(n, "type", "file"), ve(n, "accept", l = /*accept_file_types*/ + e = Cs("button"), d && d.c(), t = Q1(), n = Cs("input"), ke(n, "aria-label", "file upload"), ke(n, "data-testid", "file-upload"), ke(n, "type", "file"), ke(n, "accept", l = /*accept_file_types*/ i[16] || void 0), n.multiple = s = /*file_count*/ - i[6] === "multiple" || void 0, ve(n, "webkitdirectory", o = /*file_count*/ - i[6] === "directory" || void 0), ve(n, "mozdirectory", r = /*file_count*/ - i[6] === "directory" || void 0), ve(n, "class", "svelte-1s26xmt"), ve(e, "tabindex", a = /*hidden*/ - i[9] ? -1 : 0), ve(e, "class", "svelte-1s26xmt"), ge( + i[6] === "multiple" || void 0, ke(n, "webkitdirectory", o = /*file_count*/ + i[6] === "directory" || void 0), ke(n, "mozdirectory", r = /*file_count*/ + i[6] === "directory" || void 0), ke(n, "class", "svelte-1s26xmt"), ke(e, "tabindex", a = /*hidden*/ + i[9] ? -1 : 0), ke(e, "class", "svelte-1s26xmt"), we( e, "hidden", /*hidden*/ i[9] - ), ge( + ), we( e, "center", /*center*/ i[4] - ), ge( + ), we( e, "boundedheight", /*boundedheight*/ i[3] - ), ge( + ), we( e, "flex", /*flex*/ i[5] - ), ge( + ), we( e, "disable_click", /*disable_click*/ i[7] - ), Rr(e, "height", "100%"); + ), Wr(e, "height", "100%"); }, m(m, h) { - hl(m, e, h), d && d.m(e, null), Vo(e, t), Vo(e, n), i[34](n), f = !0, c || (u = [ - He( + bl(m, e, h), d && d.m(e, null), Oo(e, t), Oo(e, n), i[34](n), f = !0, c || (u = [ + Ie( n, "change", /*load_files_from_upload*/ i[18] ), - He(e, "drag", Jt(Kt( + Ie(e, "drag", $t(xt( /*drag_handler*/ i[27] ))), - He(e, "dragstart", Jt(Kt( + Ie(e, "dragstart", $t(xt( /*dragstart_handler*/ i[28] ))), - He(e, "dragend", Jt(Kt( + Ie(e, "dragend", $t(xt( /*dragend_handler*/ i[29] ))), - He(e, "dragover", Jt(Kt( + Ie(e, "dragover", $t(xt( /*dragover_handler*/ i[30] ))), - He(e, "dragenter", Jt(Kt( + Ie(e, "dragenter", $t(xt( /*dragenter_handler*/ i[31] ))), - He(e, "dragleave", Jt(Kt( + Ie(e, "dragleave", $t(xt( /*dragleave_handler*/ i[32] ))), - He(e, "drop", Jt(Kt( + Ie(e, "drop", $t(xt( /*drop_handler*/ i[33] ))), - He( + Ie( e, "click", /*open_file_upload*/ i[13] ), - He( + Ie( e, "drop", /*loadFilesFromDrop*/ i[19] ), - He( + Ie( e, "dragenter", /*updateDragging*/ i[17] ), - He( + Ie( e, "dragleave", /*updateDragging*/ @@ -4554,59 +4554,59 @@ function Z1(i) { }, p(m, h) { d && d.p && (!f || h[0] & /*$$scope*/ - 33554432) && Ar( + 33554432) && Xr( d, _, m, /*$$scope*/ m[25], - f ? Er( + f ? Rr( _, /*$$scope*/ m[25], h, null - ) : Lr( + ) : Er( /*$$scope*/ m[25] ), null ), (!f || h[0] & /*accept_file_types*/ 65536 && l !== (l = /*accept_file_types*/ - m[16] || void 0)) && ve(n, "accept", l), (!f || h[0] & /*file_count*/ + m[16] || void 0)) && ke(n, "accept", l), (!f || h[0] & /*file_count*/ 64 && s !== (s = /*file_count*/ m[6] === "multiple" || void 0)) && (n.multiple = s), (!f || h[0] & /*file_count*/ 64 && o !== (o = /*file_count*/ - m[6] === "directory" || void 0)) && ve(n, "webkitdirectory", o), (!f || h[0] & /*file_count*/ + m[6] === "directory" || void 0)) && ke(n, "webkitdirectory", o), (!f || h[0] & /*file_count*/ 64 && r !== (r = /*file_count*/ - m[6] === "directory" || void 0)) && ve(n, "mozdirectory", r), (!f || h[0] & /*hidden*/ + m[6] === "directory" || void 0)) && ke(n, "mozdirectory", r), (!f || h[0] & /*hidden*/ 512 && a !== (a = /*hidden*/ - m[9] ? -1 : 0)) && ve(e, "tabindex", a), (!f || h[0] & /*hidden*/ - 512) && ge( + m[9] ? -1 : 0)) && ke(e, "tabindex", a), (!f || h[0] & /*hidden*/ + 512) && we( e, "hidden", /*hidden*/ m[9] ), (!f || h[0] & /*center*/ - 16) && ge( + 16) && we( e, "center", /*center*/ m[4] ), (!f || h[0] & /*boundedheight*/ - 8) && ge( + 8) && we( e, "boundedheight", /*boundedheight*/ m[3] ), (!f || h[0] & /*flex*/ - 32) && ge( + 32) && we( e, "flex", /*flex*/ m[5] ), (!f || h[0] & /*disable_click*/ - 128) && ge( + 128) && we( e, "disable_click", /*disable_click*/ @@ -4614,50 +4614,50 @@ function Z1(i) { ); }, i(m) { - f || (Ot(d, m), f = !0); + f || (Kt(d, m), f = !0); }, o(m) { - hn(d, m), f = !1; + bn(d, m), f = !1; }, d(m) { - m && dl(e), d && d.d(m), i[34](null), c = !1, U1(u); + m && gl(e), d && d.d(m), i[34](null), c = !1, K1(u); } }; } -function G1(i) { +function th(i) { let e, t, n = !/*hidden*/ - i[9] && No(i); + i[9] && Po(i); return { c() { - n && n.c(), e = Dr(); + n && n.c(), e = Mr(); }, m(l, s) { - n && n.m(l, s), hl(l, e, s), t = !0; + n && n.m(l, s), bl(l, e, s), t = !0; }, p(l, s) { /*hidden*/ - l[9] ? n && (Mr(), hn(n, 1, 1, () => { + l[9] ? n && (Ar(), bn(n, 1, 1, () => { n = null; - }), Br()) : n ? (n.p(l, s), s[0] & /*hidden*/ - 512 && Ot(n, 1)) : (n = No(l), n.c(), Ot(n, 1), n.m(e.parentNode, e)); + }), qr()) : n ? (n.p(l, s), s[0] & /*hidden*/ + 512 && Kt(n, 1)) : (n = Po(l), n.c(), Kt(n, 1), n.m(e.parentNode, e)); }, i(l) { - t || (Ot(n), t = !0); + t || (Kt(n), t = !0); }, o(l) { - hn(n), t = !1; + bn(n), t = !1; }, d(l) { - l && dl(e), n && n.d(l); + l && gl(e), n && n.d(l); } }; } -function K1(i) { +function nh(i) { let e, t, n, l, s; const o = ( /*#slots*/ i[26].default - ), r = qr( + ), r = Lr( o, i, /*$$scope*/ @@ -4666,31 +4666,31 @@ function K1(i) { ); return { c() { - e = ys("button"), r && r.c(), ve(e, "tabindex", t = /*hidden*/ - i[9] ? -1 : 0), ve(e, "class", "svelte-1s26xmt"), ge( + e = Cs("button"), r && r.c(), ke(e, "tabindex", t = /*hidden*/ + i[9] ? -1 : 0), ke(e, "class", "svelte-1s26xmt"), we( e, "hidden", /*hidden*/ i[9] - ), ge( + ), we( e, "center", /*center*/ i[4] - ), ge( + ), we( e, "boundedheight", /*boundedheight*/ i[3] - ), ge( + ), we( e, "flex", /*flex*/ i[5] - ), Rr(e, "height", "100%"); + ), Wr(e, "height", "100%"); }, m(a, f) { - hl(a, e, f), r && r.m(e, null), n = !0, l || (s = He( + bl(a, e, f), r && r.m(e, null), n = !0, l || (s = Ie( e, "click", /*paste_clipboard*/ @@ -4699,45 +4699,45 @@ function K1(i) { }, p(a, f) { r && r.p && (!n || f[0] & /*$$scope*/ - 33554432) && Ar( + 33554432) && Xr( r, o, a, /*$$scope*/ a[25], - n ? Er( + n ? Rr( o, /*$$scope*/ a[25], f, null - ) : Lr( + ) : Er( /*$$scope*/ a[25] ), null ), (!n || f[0] & /*hidden*/ 512 && t !== (t = /*hidden*/ - a[9] ? -1 : 0)) && ve(e, "tabindex", t), (!n || f[0] & /*hidden*/ - 512) && ge( + a[9] ? -1 : 0)) && ke(e, "tabindex", t), (!n || f[0] & /*hidden*/ + 512) && we( e, "hidden", /*hidden*/ a[9] ), (!n || f[0] & /*center*/ - 16) && ge( + 16) && we( e, "center", /*center*/ a[4] ), (!n || f[0] & /*boundedheight*/ - 8) && ge( + 8) && we( e, "boundedheight", /*boundedheight*/ a[3] ), (!n || f[0] & /*flex*/ - 32) && ge( + 32) && we( e, "flex", /*flex*/ @@ -4745,19 +4745,19 @@ function K1(i) { ); }, i(a) { - n || (Ot(r, a), n = !0); + n || (Kt(r, a), n = !0); }, o(a) { - hn(r, a), n = !1; + bn(r, a), n = !1; }, d(a) { - a && dl(e), r && r.d(a), l = !1, s(); + a && gl(e), r && r.d(a), l = !1, s(); } }; } -function No(i) { +function Po(i) { let e, t; - return e = new H1({ + return e = new U1({ props: { root: ( /*root*/ @@ -4778,10 +4778,10 @@ function No(i) { } }), { c() { - X1(e.$$.fragment); + O1(e.$$.fragment); }, m(n, l) { - F1(e, n, l), t = !0; + G1(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -4796,19 +4796,19 @@ function No(i) { n[11]), e.$set(s); }, i(n) { - t || (Ot(e.$$.fragment, n), t = !0); + t || (Kt(e.$$.fragment, n), t = !0); }, o(n) { - hn(e.$$.fragment, n), t = !1; + bn(e.$$.fragment, n), t = !1; }, d(n) { - Y1(e, n); + P1(e, n); } }; } -function J1(i) { +function ih(i) { let e, t, n, l; - const s = [K1, G1, Z1], o = []; + const s = [nh, th, eh], o = []; function r(a, f) { return ( /*filetype*/ @@ -4821,29 +4821,29 @@ function J1(i) { } return e = r(i), t = o[e] = s[e](i), { c() { - t.c(), n = Dr(); + t.c(), n = Mr(); }, m(a, f) { - o[e].m(a, f), hl(a, n, f), l = !0; + o[e].m(a, f), bl(a, n, f), l = !0; }, p(a, f) { let c = e; - e = r(a), e === c ? o[e].p(a, f) : (Mr(), hn(o[c], 1, 1, () => { + e = r(a), e === c ? o[e].p(a, f) : (Ar(), bn(o[c], 1, 1, () => { o[c] = null; - }), Br(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), Ot(t, 1), t.m(n.parentNode, n)); + }), qr(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), Kt(t, 1), t.m(n.parentNode, n)); }, i(a) { - l || (Ot(t), l = !0); + l || (Kt(t), l = !0); }, o(a) { - hn(t), l = !1; + bn(t), l = !1; }, d(a) { - a && dl(n), o[e].d(a); + a && gl(n), o[e].d(a); } }; } -function Q1(i, e, t) { +function lh(i, e, t) { if (!i || i === "*" || i === "file/*" || Array.isArray(i) && i.some((l) => l === "*" || l === "file/*")) return !0; let n; @@ -4858,137 +4858,137 @@ function Q1(i, e, t) { return l.endsWith("/*") && t.startsWith(s + "/"); }); } -function x1(i, e, t) { +function sh(i, e, t) { let { $$slots: n = {}, $$scope: l } = e; - var s = this && this.__awaiter || function(E, X, $, ie) { - function L(Ke) { - return Ke instanceof $ ? Ke : new $(function(Ue) { - Ue(Ke); + var s = this && this.__awaiter || function(E, H, ee, re) { + function M(Ge) { + return Ge instanceof ee ? Ge : new ee(function(ot) { + ot(Ge); }); } - return new ($ || ($ = Promise))(function(Ke, Ue) { - function Je(xe) { + return new (ee || (ee = Promise))(function(Ge, ot) { + function Ke(Xe) { try { - Qe(ie.next(xe)); - } catch (Zt) { - Ue(Zt); + Je(re.next(Xe)); + } catch (gt) { + ot(gt); } } - function Ce(xe) { + function We(Xe) { try { - Qe(ie.throw(xe)); - } catch (Zt) { - Ue(Zt); + Je(re.throw(Xe)); + } catch (gt) { + ot(gt); } } - function Qe(xe) { - xe.done ? Ke(xe.value) : L(xe.value).then(Je, Ce); + function Je(Xe) { + Xe.done ? Ge(Xe.value) : M(Xe.value).then(Ke, We); } - Qe((ie = ie.apply(E, X || [])).next()); + Je((re = re.apply(E, H || [])).next()); }); }; - let { filetype: o = null } = e, { dragging: r = !1 } = e, { boundedheight: a = !0 } = e, { center: f = !0 } = e, { flex: c = !0 } = e, { file_count: u = "single" } = e, { disable_click: _ = !1 } = e, { root: d } = e, { hidden: m = !1 } = e, { format: h = "file" } = e, { uploading: g = !1 } = e, { hidden_upload: v = null } = e, { show_progress: w = !0 } = e, { max_file_size: b = null } = e, { upload: k } = e, { stream_handler: p } = e, y, q, C; - const z = O1(), S = ["image", "video", "audio", "text", "file"], W = (E) => E.startsWith(".") || E.endsWith("/*") ? E : S.includes(E) ? E + "/*" : "." + E; - function A() { + let { filetype: o = null } = e, { dragging: r = !1 } = e, { boundedheight: a = !0 } = e, { center: f = !0 } = e, { flex: c = !0 } = e, { file_count: u = "single" } = e, { disable_click: _ = !1 } = e, { root: d } = e, { hidden: m = !1 } = e, { format: h = "file" } = e, { uploading: g = !1 } = e, { hidden_upload: p = null } = e, { show_progress: w = !0 } = e, { max_file_size: b = null } = e, { upload: k } = e, { stream_handler: v } = e, y, S, C; + const z = x1(), D = ["image", "video", "audio", "text", "file"], q = (E) => E.startsWith(".") || E.endsWith("/*") ? E : D.includes(E) ? E + "/*" : "." + E; + function W() { t(20, r = !r); } function F() { navigator.clipboard.read().then((E) => s(this, void 0, void 0, function* () { - for (let X = 0; X < E.length; X++) { - const $ = E[X].types.find((ie) => ie.startsWith("image/")); - if ($) { - E[X].getType($).then((ie) => s(this, void 0, void 0, function* () { - const L = new File([ie], `clipboard.${$.replace("image/", "")}`); - yield U([L]); + for (let H = 0; H < E.length; H++) { + const ee = E[H].types.find((re) => re.startsWith("image/")); + if (ee) { + E[H].getType(ee).then((re) => s(this, void 0, void 0, function* () { + const M = new File([re], `clipboard.${ee.replace("image/", "")}`); + yield P([M]); })); break; } } })); } - function K() { - _ || v && (t(2, v.value = "", v), v.click()); + function J() { + _ || p && (t(2, p.value = "", p), p.click()); } - function ne(E) { + function ie(E) { return s(this, void 0, void 0, function* () { - yield P1(), t(14, y = Math.random().toString(36).substring(2, 15)), t(1, g = !0); + yield $1(), t(14, y = Math.random().toString(36).substring(2, 15)), t(1, g = !0); try { - const X = yield k(E, d, y, b ?? 1 / 0); - return z("load", u === "single" ? X == null ? void 0 : X[0] : X), t(1, g = !1), X || []; - } catch (X) { - return z("error", X.message), t(1, g = !1), []; + const H = yield k(E, d, y, b ?? 1 / 0); + return z("load", u === "single" ? H == null ? void 0 : H[0] : H), t(1, g = !1), H || []; + } catch (H) { + return z("error", H.message), t(1, g = !1), []; } }); } - function U(E) { + function P(E) { return s(this, void 0, void 0, function* () { if (!E.length) return; - let X = E.map(($) => new File([$], $ instanceof File ? $.name : "file", { type: $.type })); - return t(15, q = yield Cr(X)), yield ne(q); + let H = E.map((ee) => new File([ee], ee instanceof File ? ee.name : "file", { type: ee.type })); + return t(15, S = yield zr(H)), yield ie(S); }); } - function Q(E) { + function $(E) { return s(this, void 0, void 0, function* () { - const X = E.target; - if (X.files) + const H = E.target; + if (H.files) if (h != "blob") - yield U(Array.from(X.files)); + yield P(Array.from(H.files)); else { if (u === "single") { - z("load", X.files[0]); + z("load", H.files[0]); return; } - z("load", X.files); + z("load", H.files); } }); } - function M(E) { + function R(E) { return s(this, void 0, void 0, function* () { - var X; - if (t(20, r = !1), !(!((X = E.dataTransfer) === null || X === void 0) && X.files)) return; - const $ = Array.from(E.dataTransfer.files).filter((ie) => { - const L = "." + ie.name.split(".").pop(); - return L && Q1(C, L, ie.type) || (L && Array.isArray(o) ? o.includes(L) : L === o) ? !0 : (z("error", `Invalid file type only ${o} allowed.`), !1); + var H; + if (t(20, r = !1), !(!((H = E.dataTransfer) === null || H === void 0) && H.files)) return; + const ee = Array.from(E.dataTransfer.files).filter((re) => { + const M = "." + re.name.split(".").pop(); + return M && lh(C, M, re.type) || (M && Array.isArray(o) ? o.includes(M) : M === o) ? !0 : (z("error", `Invalid file type only ${o} allowed.`), !1); }); - yield U($); + yield P(ee); }); } function V(E) { - Gt.call(this, i, E); + Qt.call(this, i, E); } - function R(E) { - Gt.call(this, i, E); + function A(E) { + Qt.call(this, i, E); } - function Z(E) { - Gt.call(this, i, E); + function Q(E) { + Qt.call(this, i, E); } - function x(E) { - Gt.call(this, i, E); + function ae(E) { + Qt.call(this, i, E); } - function J(E) { - Gt.call(this, i, E); + function Z(E) { + Qt.call(this, i, E); } - function O(E) { - Gt.call(this, i, E); + function G(E) { + Qt.call(this, i, E); } - function H(E) { - Gt.call(this, i, E); + function X(E) { + Qt.call(this, i, E); } - function Fe(E) { - T1[E ? "unshift" : "push"](() => { - v = E, t(2, v); + function ne(E) { + N1[E ? "unshift" : "push"](() => { + p = E, t(2, p); }); } return i.$$set = (E) => { - "filetype" in E && t(0, o = E.filetype), "dragging" in E && t(20, r = E.dragging), "boundedheight" in E && t(3, a = E.boundedheight), "center" in E && t(4, f = E.center), "flex" in E && t(5, c = E.flex), "file_count" in E && t(6, u = E.file_count), "disable_click" in E && t(7, _ = E.disable_click), "root" in E && t(8, d = E.root), "hidden" in E && t(9, m = E.hidden), "format" in E && t(21, h = E.format), "uploading" in E && t(1, g = E.uploading), "hidden_upload" in E && t(2, v = E.hidden_upload), "show_progress" in E && t(10, w = E.show_progress), "max_file_size" in E && t(22, b = E.max_file_size), "upload" in E && t(23, k = E.upload), "stream_handler" in E && t(11, p = E.stream_handler), "$$scope" in E && t(25, l = E.$$scope); + "filetype" in E && t(0, o = E.filetype), "dragging" in E && t(20, r = E.dragging), "boundedheight" in E && t(3, a = E.boundedheight), "center" in E && t(4, f = E.center), "flex" in E && t(5, c = E.flex), "file_count" in E && t(6, u = E.file_count), "disable_click" in E && t(7, _ = E.disable_click), "root" in E && t(8, d = E.root), "hidden" in E && t(9, m = E.hidden), "format" in E && t(21, h = E.format), "uploading" in E && t(1, g = E.uploading), "hidden_upload" in E && t(2, p = E.hidden_upload), "show_progress" in E && t(10, w = E.show_progress), "max_file_size" in E && t(22, b = E.max_file_size), "upload" in E && t(23, k = E.upload), "stream_handler" in E && t(11, v = E.stream_handler), "$$scope" in E && t(25, l = E.$$scope); }, i.$$.update = () => { i.$$.dirty[0] & /*filetype*/ - 1 && (o == null ? t(16, C = null) : typeof o == "string" ? t(16, C = W(o)) : (t(0, o = o.map(W)), t(16, C = o.join(", ")))); + 1 && (o == null ? t(16, C = null) : typeof o == "string" ? t(16, C = q(o)) : (t(0, o = o.map(q)), t(16, C = o.join(", ")))); }, [ o, g, - v, + p, a, f, c, @@ -4997,40 +4997,40 @@ function x1(i, e, t) { d, m, w, - p, + v, F, - K, + J, y, - q, + S, C, - A, - Q, - M, + W, + $, + R, r, h, b, k, - U, + P, l, n, V, - R, + A, + Q, + ae, Z, - x, - J, - O, - H, - Fe + G, + X, + ne ]; } -class $1 extends I1 { +class oh extends V1 { constructor(e) { - super(), j1( + super(), Z1( this, e, - x1, + sh, + ih, J1, - V1, { filetype: 0, dragging: 20, @@ -5067,67 +5067,67 @@ class $1 extends I1 { } } const { - SvelteComponent: eh, - append: qi, - attr: Kl, - create_component: th, - destroy_component: nh, - detach: ih, - element: Jl, - init: lh, - insert: sh, - listen: oh, - mount_component: ah, - noop: rh, - safe_not_equal: fh, - set_style: ch, - space: uh, - text: _h, - transition_in: dh, - transition_out: hh -} = window.__gradio__svelte__internal, { createEventDispatcher: mh } = window.__gradio__svelte__internal; -function gh(i) { + SvelteComponent: ah, + append: Mi, + attr: Jl, + create_component: rh, + destroy_component: fh, + detach: ch, + element: Ql, + init: uh, + insert: _h, + listen: dh, + mount_component: hh, + noop: mh, + safe_not_equal: gh, + set_style: bh, + space: wh, + text: ph, + transition_in: vh, + transition_out: kh +} = window.__gradio__svelte__internal, { createEventDispatcher: yh } = window.__gradio__svelte__internal; +function Ch(i) { let e, t, n, l, s, o = "Click to Access Webcam", r, a, f, c; - return l = new Qa({}), { + return l = new $a({}), { c() { - e = Jl("button"), t = Jl("div"), n = Jl("span"), th(l.$$.fragment), s = uh(), r = _h(o), Kl(n, "class", "icon-wrap svelte-fjcd9c"), Kl(t, "class", "wrap svelte-fjcd9c"), Kl(e, "class", "svelte-fjcd9c"), ch(e, "height", "100%"); + e = Ql("button"), t = Ql("div"), n = Ql("span"), rh(l.$$.fragment), s = wh(), r = ph(o), Jl(n, "class", "icon-wrap svelte-fjcd9c"), Jl(t, "class", "wrap svelte-fjcd9c"), Jl(e, "class", "svelte-fjcd9c"), bh(e, "height", "100%"); }, m(u, _) { - sh(u, e, _), qi(e, t), qi(t, n), ah(l, n, null), qi(t, s), qi(t, r), a = !0, f || (c = oh( + _h(u, e, _), Mi(e, t), Mi(t, n), hh(l, n, null), Mi(t, s), Mi(t, r), a = !0, f || (c = dh( e, "click", /*click_handler*/ i[1] ), f = !0); }, - p: rh, + p: mh, i(u) { - a || (dh(l.$$.fragment, u), a = !0); + a || (vh(l.$$.fragment, u), a = !0); }, o(u) { - hh(l.$$.fragment, u), a = !1; + kh(l.$$.fragment, u), a = !1; }, d(u) { - u && ih(e), nh(l), f = !1, c(); + u && ch(e), fh(l), f = !1, c(); } }; } -function bh(i) { - const e = mh(); +function Sh(i) { + const e = yh(); return [e, () => e("click")]; } -class wh extends eh { +class zh extends ah { constructor(e) { - super(), lh(this, e, bh, gh, fh, {}); + super(), uh(this, e, Sh, Ch, gh, {}); } } -function vh() { +function Bh() { return navigator.mediaDevices.enumerateDevices(); } -function ph(i, e) { +function Dh(i, e) { e.srcObject = i, e.muted = !0, e.play(); } -async function Oo(i, e, t) { +async function Zo(i, e, t) { const n = { width: { ideal: 1920 }, height: { ideal: 1440 } @@ -5135,159 +5135,159 @@ async function Oo(i, e, t) { video: t ? { deviceId: { exact: t }, ...n } : n, audio: i }; - return navigator.mediaDevices.getUserMedia(l).then((s) => (ph(s, e), s)); + return navigator.mediaDevices.getUserMedia(l).then((s) => (Dh(s, e), s)); } -function kh(i) { +function qh(i) { return i.filter( (t) => t.kind === "videoinput" ); } const { - SvelteComponent: yh, - action_destroyer: Ch, - add_render_callback: Sh, - append: Dt, - attr: de, - binding_callbacks: zh, - check_outros: ri, - create_component: Un, - create_in_transition: Bh, - destroy_component: Vn, - destroy_each: qh, - detach: Me, - element: je, - empty: Ts, - ensure_array_like: Po, - group_outros: fi, - init: Dh, - insert: Re, - listen: $i, - mount_component: Nn, - noop: Xs, - run_all: Lh, - safe_not_equal: Eh, - set_data: Wr, - set_input_value: Cs, - space: di, - stop_propagation: Mh, - text: Hr, - toggle_class: Di, - transition_in: be, - transition_out: ke -} = window.__gradio__svelte__internal, { createEventDispatcher: Rh, onMount: Ah } = window.__gradio__svelte__internal; -function Zo(i, e, t) { + SvelteComponent: Lh, + action_destroyer: Mh, + add_render_callback: Eh, + append: Et, + attr: he, + binding_callbacks: Rh, + check_outros: ci, + create_component: On, + create_in_transition: Ah, + destroy_component: Pn, + destroy_each: Wh, + detach: Re, + element: Fe, + empty: Hs, + ensure_array_like: Go, + group_outros: ui, + init: Xh, + insert: Ae, + listen: nl, + mount_component: Zn, + noop: Ts, + run_all: Yh, + safe_not_equal: Ih, + set_data: Yr, + set_input_value: Ss, + space: mi, + stop_propagation: Hh, + text: Ir, + toggle_class: Ei, + transition_in: pe, + transition_out: Ce +} = window.__gradio__svelte__internal, { createEventDispatcher: Th, onMount: jh } = window.__gradio__svelte__internal; +function Ko(i, e, t) { const n = i.slice(); return n[32] = e[t], n; } -function Wh(i) { +function Fh(i) { let e, t, n, l, s, o, r, a, f, c, u; - const _ = [Th, Ih], d = []; - function m(v, w) { + const _ = [Nh, Vh], d = []; + function m(p, w) { return ( /*mode*/ - v[1] === "video" || /*streaming*/ - v[0] ? 0 : 1 + p[1] === "video" || /*streaming*/ + p[0] ? 0 : 1 ); } n = m(i), l = d[n] = _[n](i); let h = !/*recording*/ - i[8] && Go(i), g = ( + i[8] && Jo(i), g = ( /*options_open*/ i[10] && /*selected_device*/ - i[7] && Ko(i) + i[7] && Qo(i) ); return { c() { - e = je("div"), t = je("button"), l.c(), o = di(), h && h.c(), r = di(), g && g.c(), a = Ts(), de(t, "aria-label", s = /*mode*/ - i[1] === "image" ? "capture photo" : "start recording"), de(t, "class", "svelte-8hqvb6"), de(e, "class", "button-wrap svelte-8hqvb6"); + e = Fe("div"), t = Fe("button"), l.c(), o = mi(), h && h.c(), r = mi(), g && g.c(), a = Hs(), he(t, "aria-label", s = /*mode*/ + i[1] === "image" ? "capture photo" : "start recording"), he(t, "class", "svelte-8hqvb6"), he(e, "class", "button-wrap svelte-8hqvb6"); }, - m(v, w) { - Re(v, e, w), Dt(e, t), d[n].m(t, null), Dt(e, o), h && h.m(e, null), Re(v, r, w), g && g.m(v, w), Re(v, a, w), f = !0, c || (u = $i( + m(p, w) { + Ae(p, e, w), Et(e, t), d[n].m(t, null), Et(e, o), h && h.m(e, null), Ae(p, r, w), g && g.m(p, w), Ae(p, a, w), f = !0, c || (u = nl( t, "click", /*record_video_or_photo*/ i[13] ), c = !0); }, - p(v, w) { + p(p, w) { let b = n; - n = m(v), n === b ? d[n].p(v, w) : (fi(), ke(d[b], 1, 1, () => { + n = m(p), n === b ? d[n].p(p, w) : (ui(), Ce(d[b], 1, 1, () => { d[b] = null; - }), ri(), l = d[n], l ? l.p(v, w) : (l = d[n] = _[n](v), l.c()), be(l, 1), l.m(t, null)), (!f || w[0] & /*mode*/ + }), ci(), l = d[n], l ? l.p(p, w) : (l = d[n] = _[n](p), l.c()), pe(l, 1), l.m(t, null)), (!f || w[0] & /*mode*/ 2 && s !== (s = /*mode*/ - v[1] === "image" ? "capture photo" : "start recording")) && de(t, "aria-label", s), /*recording*/ - v[8] ? h && (fi(), ke(h, 1, 1, () => { + p[1] === "image" ? "capture photo" : "start recording")) && he(t, "aria-label", s), /*recording*/ + p[8] ? h && (ui(), Ce(h, 1, 1, () => { h = null; - }), ri()) : h ? (h.p(v, w), w[0] & /*recording*/ - 256 && be(h, 1)) : (h = Go(v), h.c(), be(h, 1), h.m(e, null)), /*options_open*/ - v[10] && /*selected_device*/ - v[7] ? g ? (g.p(v, w), w[0] & /*options_open, selected_device*/ - 1152 && be(g, 1)) : (g = Ko(v), g.c(), be(g, 1), g.m(a.parentNode, a)) : g && (fi(), ke(g, 1, 1, () => { + }), ci()) : h ? (h.p(p, w), w[0] & /*recording*/ + 256 && pe(h, 1)) : (h = Jo(p), h.c(), pe(h, 1), h.m(e, null)), /*options_open*/ + p[10] && /*selected_device*/ + p[7] ? g ? (g.p(p, w), w[0] & /*options_open, selected_device*/ + 1152 && pe(g, 1)) : (g = Qo(p), g.c(), pe(g, 1), g.m(a.parentNode, a)) : g && (ui(), Ce(g, 1, 1, () => { g = null; - }), ri()); + }), ci()); }, - i(v) { - f || (be(l), be(h), be(g), f = !0); + i(p) { + f || (pe(l), pe(h), pe(g), f = !0); }, - o(v) { - ke(l), ke(h), ke(g), f = !1; + o(p) { + Ce(l), Ce(h), Ce(g), f = !1; }, - d(v) { - v && (Me(e), Me(r), Me(a)), d[n].d(), h && h.d(), g && g.d(v), c = !1, u(); + d(p) { + p && (Re(e), Re(r), Re(a)), d[n].d(), h && h.d(), g && g.d(p), c = !1, u(); } }; } -function Hh(i) { +function Uh(i) { let e, t, n, l; - return t = new wh({}), t.$on( + return t = new zh({}), t.$on( "click", /*click_handler*/ i[20] ), { c() { - e = je("div"), Un(t.$$.fragment), de(e, "title", "grant webcam access"); + e = Fe("div"), On(t.$$.fragment), he(e, "title", "grant webcam access"); }, m(s, o) { - Re(s, e, o), Nn(t, e, null), l = !0; + Ae(s, e, o), Zn(t, e, null), l = !0; }, - p: Xs, + p: Ts, i(s) { - l || (be(t.$$.fragment, s), s && (n || Sh(() => { - n = Bh(e, Cd, { delay: 100, duration: 200 }), n.start(); + l || (pe(t.$$.fragment, s), s && (n || Eh(() => { + n = Ah(e, Md, { delay: 100, duration: 200 }), n.start(); })), l = !0); }, o(s) { - ke(t.$$.fragment, s), l = !1; + Ce(t.$$.fragment, s), l = !1; }, d(s) { - s && Me(e), Vn(t); + s && Re(e), Pn(t); } }; } -function Ih(i) { +function Vh(i) { let e, t, n; - return t = new iu({}), { + return t = new cu({}), { c() { - e = je("div"), Un(t.$$.fragment), de(e, "class", "icon svelte-8hqvb6"), de(e, "title", "capture photo"); + e = Fe("div"), On(t.$$.fragment), he(e, "class", "icon svelte-8hqvb6"), he(e, "title", "capture photo"); }, m(l, s) { - Re(l, e, s), Nn(t, e, null), n = !0; + Ae(l, e, s), Zn(t, e, null), n = !0; }, - p: Xs, + p: Ts, i(l) { - n || (be(t.$$.fragment, l), n = !0); + n || (pe(t.$$.fragment, l), n = !0); }, o(l) { - ke(t.$$.fragment, l), n = !1; + Ce(t.$$.fragment, l), n = !1; }, d(l) { - l && Me(e), Vn(t); + l && Re(e), Pn(t); } }; } -function Th(i) { +function Nh(i) { let e, t, n, l; - const s = [Yh, Xh], o = []; + const s = [Ph, Oh], o = []; function r(a, f) { return ( /*recording*/ @@ -5296,121 +5296,121 @@ function Th(i) { } return e = r(i), t = o[e] = s[e](i), { c() { - t.c(), n = Ts(); + t.c(), n = Hs(); }, m(a, f) { - o[e].m(a, f), Re(a, n, f), l = !0; + o[e].m(a, f), Ae(a, n, f), l = !0; }, p(a, f) { let c = e; - e = r(a), e !== c && (fi(), ke(o[c], 1, 1, () => { + e = r(a), e !== c && (ui(), Ce(o[c], 1, 1, () => { o[c] = null; - }), ri(), t = o[e], t || (t = o[e] = s[e](a), t.c()), be(t, 1), t.m(n.parentNode, n)); + }), ci(), t = o[e], t || (t = o[e] = s[e](a), t.c()), pe(t, 1), t.m(n.parentNode, n)); }, i(a) { - l || (be(t), l = !0); + l || (pe(t), l = !0); }, o(a) { - ke(t), l = !1; + Ce(t), l = !1; }, d(a) { - a && Me(n), o[e].d(a); + a && Re(n), o[e].d(a); } }; } -function Xh(i) { +function Oh(i) { let e, t, n; - return t = new uu({}), { + return t = new wu({}), { c() { - e = je("div"), Un(t.$$.fragment), de(e, "class", "icon red svelte-8hqvb6"), de(e, "title", "start recording"); + e = Fe("div"), On(t.$$.fragment), he(e, "class", "icon red svelte-8hqvb6"), he(e, "title", "start recording"); }, m(l, s) { - Re(l, e, s), Nn(t, e, null), n = !0; + Ae(l, e, s), Zn(t, e, null), n = !0; }, i(l) { - n || (be(t.$$.fragment, l), n = !0); + n || (pe(t.$$.fragment, l), n = !0); }, o(l) { - ke(t.$$.fragment, l), n = !1; + Ce(t.$$.fragment, l), n = !1; }, d(l) { - l && Me(e), Vn(t); + l && Re(e), Pn(t); } }; } -function Yh(i) { +function Ph(i) { let e, t, n; - return t = new y_({}), { + return t = new L_({}), { c() { - e = je("div"), Un(t.$$.fragment), de(e, "class", "icon red svelte-8hqvb6"), de(e, "title", "stop recording"); + e = Fe("div"), On(t.$$.fragment), he(e, "class", "icon red svelte-8hqvb6"), he(e, "title", "stop recording"); }, m(l, s) { - Re(l, e, s), Nn(t, e, null), n = !0; + Ae(l, e, s), Zn(t, e, null), n = !0; }, i(l) { - n || (be(t.$$.fragment, l), n = !0); + n || (pe(t.$$.fragment, l), n = !0); }, o(l) { - ke(t.$$.fragment, l), n = !1; + Ce(t.$$.fragment, l), n = !1; }, d(l) { - l && Me(e), Vn(t); + l && Re(e), Pn(t); } }; } -function Go(i) { +function Jo(i) { let e, t, n, l, s; - return t = new Rs({}), { + return t = new As({}), { c() { - e = je("button"), Un(t.$$.fragment), de(e, "class", "icon svelte-8hqvb6"), de(e, "aria-label", "select input source"); + e = Fe("button"), On(t.$$.fragment), he(e, "class", "icon svelte-8hqvb6"), he(e, "aria-label", "select input source"); }, m(o, r) { - Re(o, e, r), Nn(t, e, null), n = !0, l || (s = $i( + Ae(o, e, r), Zn(t, e, null), n = !0, l || (s = nl( e, "click", /*click_handler_1*/ i[21] ), l = !0); }, - p: Xs, + p: Ts, i(o) { - n || (be(t.$$.fragment, o), n = !0); + n || (pe(t.$$.fragment, o), n = !0); }, o(o) { - ke(t.$$.fragment, o), n = !1; + Ce(t.$$.fragment, o), n = !1; }, d(o) { - o && Me(e), Vn(t), l = !1, s(); + o && Re(e), Pn(t), l = !1, s(); } }; } -function Ko(i) { +function Qo(i) { let e, t, n, l, s, o, r; - n = new Rs({}); + n = new As({}); function a(u, _) { return ( /*available_video_devices*/ - u[6].length === 0 ? Fh : jh + u[6].length === 0 ? Gh : Zh ); } let f = a(i), c = f(i); return { c() { - e = je("select"), t = je("button"), Un(n.$$.fragment), l = di(), c.c(), de(t, "class", "inset-icon svelte-8hqvb6"), de(e, "class", "select-wrap svelte-8hqvb6"), de(e, "aria-label", "select source"); + e = Fe("select"), t = Fe("button"), On(n.$$.fragment), l = mi(), c.c(), he(t, "class", "inset-icon svelte-8hqvb6"), he(e, "class", "select-wrap svelte-8hqvb6"), he(e, "aria-label", "select source"); }, m(u, _) { - Re(u, e, _), Dt(e, t), Nn(n, t, null), Dt(t, l), c.m(e, null), s = !0, o || (r = [ - $i(t, "click", Mh( + Ae(u, e, _), Et(e, t), Zn(n, t, null), Et(t, l), c.m(e, null), s = !0, o || (r = [ + nl(t, "click", Hh( /*click_handler_2*/ i[22] )), - Ch(Ys.call( + Mh(js.call( null, e, /*handle_click_outside*/ i[14] )), - $i( + nl( e, "change", /*handle_device_change*/ @@ -5422,45 +5422,45 @@ function Ko(i) { f === (f = a(u)) && c ? c.p(u, _) : (c.d(1), c = f(u), c && (c.c(), c.m(e, null))); }, i(u) { - s || (be(n.$$.fragment, u), s = !0); + s || (pe(n.$$.fragment, u), s = !0); }, o(u) { - ke(n.$$.fragment, u), s = !1; + Ce(n.$$.fragment, u), s = !1; }, d(u) { - u && Me(e), Vn(n), c.d(), o = !1, Lh(r); + u && Re(e), Pn(n), c.d(), o = !1, Yh(r); } }; } -function jh(i) { - let e, t = Po( +function Zh(i) { + let e, t = Go( /*available_video_devices*/ i[6] ), n = []; for (let l = 0; l < t.length; l += 1) - n[l] = Jo(Zo(i, t, l)); + n[l] = xo(Ko(i, t, l)); return { c() { for (let l = 0; l < n.length; l += 1) n[l].c(); - e = Ts(); + e = Hs(); }, m(l, s) { for (let o = 0; o < n.length; o += 1) n[o] && n[o].m(l, s); - Re(l, e, s); + Ae(l, e, s); }, p(l, s) { if (s[0] & /*available_video_devices, selected_device*/ 192) { - t = Po( + t = Go( /*available_video_devices*/ l[6] ); let o; for (o = 0; o < t.length; o += 1) { - const r = Zo(l, t, o); - n[o] ? n[o].p(r, s) : (n[o] = Jo(r), n[o].c(), n[o].m(e.parentNode, e)); + const r = Ko(l, t, o); + n[o] ? n[o].p(r, s) : (n[o] = xo(r), n[o].c(), n[o].m(e.parentNode, e)); } for (; o < n.length; o += 1) n[o].d(1); @@ -5468,65 +5468,65 @@ function jh(i) { } }, d(l) { - l && Me(e), qh(n, l); + l && Re(e), Wh(n, l); } }; } -function Fh(i) { +function Gh(i) { let e, t = ( /*i18n*/ i[3]("common.no_devices") + "" ), n; return { c() { - e = je("option"), n = Hr(t), e.__value = "", Cs(e, e.__value), de(e, "class", "svelte-8hqvb6"); + e = Fe("option"), n = Ir(t), e.__value = "", Ss(e, e.__value), he(e, "class", "svelte-8hqvb6"); }, m(l, s) { - Re(l, e, s), Dt(e, n); + Ae(l, e, s), Et(e, n); }, p(l, s) { s[0] & /*i18n*/ 8 && t !== (t = /*i18n*/ - l[3]("common.no_devices") + "") && Wr(n, t); + l[3]("common.no_devices") + "") && Yr(n, t); }, d(l) { - l && Me(e); + l && Re(e); } }; } -function Jo(i) { +function xo(i) { let e, t = ( /*device*/ i[32].label + "" ), n, l, s, o; return { c() { - e = je("option"), n = Hr(t), l = di(), e.__value = s = /*device*/ - i[32].deviceId, Cs(e, e.__value), e.selected = o = /*selected_device*/ + e = Fe("option"), n = Ir(t), l = mi(), e.__value = s = /*device*/ + i[32].deviceId, Ss(e, e.__value), e.selected = o = /*selected_device*/ i[7].deviceId === /*device*/ - i[32].deviceId, de(e, "class", "svelte-8hqvb6"); + i[32].deviceId, he(e, "class", "svelte-8hqvb6"); }, m(r, a) { - Re(r, e, a), Dt(e, n), Dt(e, l); + Ae(r, e, a), Et(e, n), Et(e, l); }, p(r, a) { a[0] & /*available_video_devices*/ 64 && t !== (t = /*device*/ - r[32].label + "") && Wr(n, t), a[0] & /*available_video_devices*/ + r[32].label + "") && Yr(n, t), a[0] & /*available_video_devices*/ 64 && s !== (s = /*device*/ - r[32].deviceId) && (e.__value = s, Cs(e, e.__value)), a[0] & /*selected_device, available_video_devices*/ + r[32].deviceId) && (e.__value = s, Ss(e, e.__value)), a[0] & /*selected_device, available_video_devices*/ 192 && o !== (o = /*selected_device*/ r[7].deviceId === /*device*/ r[32].deviceId) && (e.selected = o); }, d(r) { - r && Me(e); + r && Re(e); } }; } -function Uh(i) { +function Kh(i) { let e, t, n, l, s, o; - const r = [Hh, Wh], a = []; + const r = [Uh, Fh], a = []; function f(c, u) { return ( /*webcam_accessed*/ @@ -5535,44 +5535,44 @@ function Uh(i) { } return l = f(i), s = a[l] = r[l](i), { c() { - e = je("div"), t = je("video"), n = di(), s.c(), de(t, "class", "svelte-8hqvb6"), Di( + e = Fe("div"), t = Fe("video"), n = mi(), s.c(), he(t, "class", "svelte-8hqvb6"), Ei( t, "flip", /*mirror_webcam*/ i[2] - ), Di(t, "hide", !/*webcam_accessed*/ - i[9]), de(e, "class", "wrap svelte-8hqvb6"); + ), Ei(t, "hide", !/*webcam_accessed*/ + i[9]), he(e, "class", "wrap svelte-8hqvb6"); }, m(c, u) { - Re(c, e, u), Dt(e, t), i[19](t), Dt(e, n), a[l].m(e, null), o = !0; + Ae(c, e, u), Et(e, t), i[19](t), Et(e, n), a[l].m(e, null), o = !0; }, p(c, u) { (!o || u[0] & /*mirror_webcam*/ - 4) && Di( + 4) && Ei( t, "flip", /*mirror_webcam*/ c[2] ), (!o || u[0] & /*webcam_accessed*/ - 512) && Di(t, "hide", !/*webcam_accessed*/ + 512) && Ei(t, "hide", !/*webcam_accessed*/ c[9]); let _ = l; - l = f(c), l === _ ? a[l].p(c, u) : (fi(), ke(a[_], 1, 1, () => { + l = f(c), l === _ ? a[l].p(c, u) : (ui(), Ce(a[_], 1, 1, () => { a[_] = null; - }), ri(), s = a[l], s ? s.p(c, u) : (s = a[l] = r[l](c), s.c()), be(s, 1), s.m(e, null)); + }), ci(), s = a[l], s ? s.p(c, u) : (s = a[l] = r[l](c), s.c()), pe(s, 1), s.m(e, null)); }, i(c) { - o || (be(s), o = !0); + o || (pe(s), o = !0); }, o(c) { - ke(s), o = !1; + Ce(s), o = !1; }, d(c) { - c && Me(e), i[19](null), a[l].d(); + c && Re(e), i[19](null), a[l].d(); } }; } -function Ys(i, e) { +function js(i, e) { const t = (n) => { i && !i.contains(n.target) && !n.defaultPrevented && e(n); }; @@ -5582,67 +5582,67 @@ function Ys(i, e) { } }; } -function Vh(i, e, t) { - var n = this && this.__awaiter || function(M, V, R, Z) { - function x(J) { - return J instanceof R ? J : new R(function(O) { - O(J); +function Jh(i, e, t) { + var n = this && this.__awaiter || function(R, V, A, Q) { + function ae(Z) { + return Z instanceof A ? Z : new A(function(G) { + G(Z); }); } - return new (R || (R = Promise))(function(J, O) { - function H(X) { + return new (A || (A = Promise))(function(Z, G) { + function X(H) { try { - E(Z.next(X)); - } catch ($) { - O($); + E(Q.next(H)); + } catch (ee) { + G(ee); } } - function Fe(X) { + function ne(H) { try { - E(Z.throw(X)); - } catch ($) { - O($); + E(Q.throw(H)); + } catch (ee) { + G(ee); } } - function E(X) { - X.done ? J(X.value) : x(X.value).then(H, Fe); + function E(H) { + H.done ? Z(H.value) : ae(H.value).then(X, ne); } - E((Z = Z.apply(M, V || [])).next()); + E((Q = Q.apply(R, V || [])).next()); }); }; let l, s = [], o = null, r, { streaming: a = !1 } = e, { pending: f = !1 } = e, { root: c = "" } = e, { mode: u = "image" } = e, { mirror_webcam: _ } = e, { include_audio: d } = e, { i18n: m } = e, { upload: h } = e; - const g = Rh(); - Ah(() => r = document.createElement("canvas")); - const v = (M) => n(void 0, void 0, void 0, function* () { - const R = M.target.value; - yield Oo(d, l, R).then((Z) => n(void 0, void 0, void 0, function* () { - y = Z, t(7, o = s.find((x) => x.deviceId === R) || null), t(10, A = !1); + const g = Th(); + jh(() => r = document.createElement("canvas")); + const p = (R) => n(void 0, void 0, void 0, function* () { + const A = R.target.value; + yield Zo(d, l, A).then((Q) => n(void 0, void 0, void 0, function* () { + y = Q, t(7, o = s.find((ae) => ae.deviceId === A) || null), t(10, W = !1); })); }); function w() { return n(this, void 0, void 0, function* () { try { - Oo(d, l).then((M) => n(this, void 0, void 0, function* () { - t(9, S = !0), t(6, s = yield vh()), y = M; - })).then(() => kh(s)).then((M) => { - t(6, s = M); - const V = y.getTracks().map((R) => { - var Z; - return (Z = R.getSettings()) === null || Z === void 0 ? void 0 : Z.deviceId; + Zo(d, l).then((R) => n(this, void 0, void 0, function* () { + t(9, D = !0), t(6, s = yield Bh()), y = R; + })).then(() => qh(s)).then((R) => { + t(6, s = R); + const V = y.getTracks().map((A) => { + var Q; + return (Q = A.getSettings()) === null || Q === void 0 ? void 0 : Q.deviceId; })[0]; - t(7, o = V && M.find((R) => R.deviceId === V) || s[0]); + t(7, o = V && R.find((A) => A.deviceId === V) || s[0]); }), (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) && g("error", m("image.no_webcam_support")); - } catch (M) { - if (M instanceof DOMException && M.name == "NotAllowedError") + } catch (R) { + if (R instanceof DOMException && R.name == "NotAllowedError") g("error", m("image.allow_webcam_access")); else - throw M; + throw R; } }); } function b() { - var M = r.getContext("2d"); - (!a || a && k) && l.videoWidth && l.videoHeight && (r.width = l.videoWidth, r.height = l.videoHeight, M.drawImage(l, 0, 0, l.videoWidth, l.videoHeight), _ && (M.scale(-1, 1), M.drawImage(l, -l.videoWidth, 0)), r.toBlob( + var R = r.getContext("2d"); + (!a || a && k) && l.videoWidth && l.videoHeight && (r.width = l.videoWidth, r.height = l.videoHeight, R.drawImage(l, 0, 0, l.videoWidth, l.videoHeight), _ && (R.scale(-1, 1), R.drawImage(l, -l.videoWidth, 0)), r.toBlob( (V) => { g(a ? "stream" : "capture", V); }, @@ -5650,43 +5650,43 @@ function Vh(i, e, t) { 0.8 )); } - let k = !1, p = [], y, q, C; + let k = !1, v = [], y, S, C; function z() { if (k) { C.stop(); - let M = new Blob(p, { type: q }), V = new FileReader(); - V.onload = function(R) { + let R = new Blob(v, { type: S }), V = new FileReader(); + V.onload = function(A) { return n(this, void 0, void 0, function* () { - var Z; - if (R.target) { - let x = new File([M], "sample." + q.substring(6)); - const J = yield Cr([x]); - let O = ((Z = yield h(J, c)) === null || Z === void 0 ? void 0 : Z.filter(Boolean))[0]; - g("capture", O), g("stop_recording"); + var Q; + if (A.target) { + let ae = new File([R], "sample." + S.substring(6)); + const Z = yield zr([ae]); + let G = ((Q = yield h(Z, c)) === null || Q === void 0 ? void 0 : Q.filter(Boolean))[0]; + g("capture", G), g("stop_recording"); } }); - }, V.readAsDataURL(M); + }, V.readAsDataURL(R); } else { - g("start_recording"), p = []; - let M = ["video/webm", "video/mp4"]; - for (let V of M) + g("start_recording"), v = []; + let R = ["video/webm", "video/mp4"]; + for (let V of R) if (MediaRecorder.isTypeSupported(V)) { - q = V; + S = V; break; } - if (q === null) { + if (S === null) { console.error("No supported MediaRecorder mimeType"); return; } - C = new MediaRecorder(y, { mimeType: q }), C.addEventListener("dataavailable", function(V) { - p.push(V.data); + C = new MediaRecorder(y, { mimeType: S }), C.addEventListener("dataavailable", function(V) { + v.push(V.data); }), C.start(200); } t(8, k = !k); } - let S = !1; - function W() { - u === "image" && a && t(8, k = !k), u === "image" ? b() : z(), !k && y && (y.getTracks().forEach((M) => M.stop()), t(5, l.srcObject = null, l), t(9, S = !1)); + let D = !1; + function q() { + u === "image" && a && t(8, k = !k), u === "image" ? b() : z(), !k && y && (y.getTracks().forEach((R) => R.stop()), t(5, l.srcObject = null, l), t(9, D = !1)); } a && u === "image" && window.setInterval( () => { @@ -5694,52 +5694,52 @@ function Vh(i, e, t) { }, 500 ); - let A = !1; - function F(M) { - M.preventDefault(), M.stopPropagation(), t(10, A = !1); + let W = !1; + function F(R) { + R.preventDefault(), R.stopPropagation(), t(10, W = !1); } - function K(M) { - zh[M ? "unshift" : "push"](() => { - l = M, t(5, l); + function J(R) { + Rh[R ? "unshift" : "push"](() => { + l = R, t(5, l); }); } - const ne = async () => w(), U = () => t(10, A = !0), Q = () => t(10, A = !1); - return i.$$set = (M) => { - "streaming" in M && t(0, a = M.streaming), "pending" in M && t(15, f = M.pending), "root" in M && t(16, c = M.root), "mode" in M && t(1, u = M.mode), "mirror_webcam" in M && t(2, _ = M.mirror_webcam), "include_audio" in M && t(17, d = M.include_audio), "i18n" in M && t(3, m = M.i18n), "upload" in M && t(18, h = M.upload); + const ie = async () => w(), P = () => t(10, W = !0), $ = () => t(10, W = !1); + return i.$$set = (R) => { + "streaming" in R && t(0, a = R.streaming), "pending" in R && t(15, f = R.pending), "root" in R && t(16, c = R.root), "mode" in R && t(1, u = R.mode), "mirror_webcam" in R && t(2, _ = R.mirror_webcam), "include_audio" in R && t(17, d = R.include_audio), "i18n" in R && t(3, m = R.i18n), "upload" in R && t(18, h = R.upload); }, [ a, u, _, m, - Ys, + js, l, s, o, k, - S, - A, - v, - w, + D, W, + p, + w, + q, F, f, c, d, h, - K, - ne, - U, - Q + J, + ie, + P, + $ ]; } -class Nh extends yh { +class Qh extends Lh { constructor(e) { - super(), Dh( + super(), Xh( this, e, - Vh, - Uh, - Eh, + Jh, + Kh, + Ih, { streaming: 0, pending: 15, @@ -5756,199 +5756,165 @@ class Nh extends yh { ); } get click_outside() { - return Ys; + return js; } } const { - SvelteComponent: Oh, - append: Xt, + SvelteComponent: xh, + append: Ut, attr: I, - detach: Ph, - init: Zh, - insert: Gh, - noop: Ql, - safe_not_equal: Kh, - set_style: Yt, - svg_element: wt + detach: $h, + init: e0, + insert: t0, + noop: xl, + safe_not_equal: n0, + set_style: Vt, + svg_element: kt } = window.__gradio__svelte__internal; -function Jh(i) { +function i0(i) { let e, t, n, l, s, o, r, a, f; return { c() { - e = wt("svg"), t = wt("rect"), n = wt("rect"), l = wt("rect"), s = wt("rect"), o = wt("line"), r = wt("line"), a = wt("line"), f = wt("line"), I(t, "x", "2"), I(t, "y", "2"), I(t, "width", "5"), I(t, "height", "5"), I(t, "rx", "1"), I(t, "ry", "1"), I(t, "stroke-width", "2"), I(t, "fill", "none"), I(n, "x", "17"), I(n, "y", "2"), I(n, "width", "5"), I(n, "height", "5"), I(n, "rx", "1"), I(n, "ry", "1"), I(n, "stroke-width", "2"), I(n, "fill", "none"), I(l, "x", "2"), I(l, "y", "17"), I(l, "width", "5"), I(l, "height", "5"), I(l, "rx", "1"), I(l, "ry", "1"), I(l, "stroke-width", "2"), I(l, "fill", "none"), I(s, "x", "17"), I(s, "y", "17"), I(s, "width", "5"), I(s, "height", "5"), I(s, "rx", "1"), I(s, "ry", "1"), I(s, "stroke-width", "2"), I(s, "fill", "none"), I(o, "x1", "7.5"), I(o, "y1", "4.5"), I(o, "x2", "16"), I(o, "y2", "4.5"), Yt(o, "stroke-width", "2px"), I(r, "x1", "7.5"), I(r, "y1", "19.5"), I(r, "x2", "16"), I(r, "y2", "19.5"), Yt(r, "stroke-width", "2px"), I(a, "x1", "4.5"), I(a, "y1", "8"), I(a, "x2", "4.5"), I(a, "y2", "16"), Yt(a, "stroke-width", "2px"), I(f, "x1", "19.5"), I(f, "y1", "8"), I(f, "x2", "19.5"), I(f, "y2", "16"), Yt(f, "stroke-width", "2px"), I(e, "width", "100%"), I(e, "height", "100%"), I(e, "viewBox", "0 0 24 24"), I(e, "version", "1.1"), I(e, "xmlns", "http://www.w3.org/2000/svg"), I(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), I(e, "xml:space", "preserve"), I(e, "stroke", "currentColor"), Yt(e, "fill-rule", "evenodd"), Yt(e, "clip-rule", "evenodd"), Yt(e, "stroke-linecap", "round"), Yt(e, "stroke-linejoin", "round"); + e = kt("svg"), t = kt("rect"), n = kt("rect"), l = kt("rect"), s = kt("rect"), o = kt("line"), r = kt("line"), a = kt("line"), f = kt("line"), I(t, "x", "2"), I(t, "y", "2"), I(t, "width", "5"), I(t, "height", "5"), I(t, "rx", "1"), I(t, "ry", "1"), I(t, "stroke-width", "2"), I(t, "fill", "none"), I(n, "x", "17"), I(n, "y", "2"), I(n, "width", "5"), I(n, "height", "5"), I(n, "rx", "1"), I(n, "ry", "1"), I(n, "stroke-width", "2"), I(n, "fill", "none"), I(l, "x", "2"), I(l, "y", "17"), I(l, "width", "5"), I(l, "height", "5"), I(l, "rx", "1"), I(l, "ry", "1"), I(l, "stroke-width", "2"), I(l, "fill", "none"), I(s, "x", "17"), I(s, "y", "17"), I(s, "width", "5"), I(s, "height", "5"), I(s, "rx", "1"), I(s, "ry", "1"), I(s, "stroke-width", "2"), I(s, "fill", "none"), I(o, "x1", "7.5"), I(o, "y1", "4.5"), I(o, "x2", "16"), I(o, "y2", "4.5"), Vt(o, "stroke-width", "2px"), I(r, "x1", "7.5"), I(r, "y1", "19.5"), I(r, "x2", "16"), I(r, "y2", "19.5"), Vt(r, "stroke-width", "2px"), I(a, "x1", "4.5"), I(a, "y1", "8"), I(a, "x2", "4.5"), I(a, "y2", "16"), Vt(a, "stroke-width", "2px"), I(f, "x1", "19.5"), I(f, "y1", "8"), I(f, "x2", "19.5"), I(f, "y2", "16"), Vt(f, "stroke-width", "2px"), I(e, "width", "100%"), I(e, "height", "100%"), I(e, "viewBox", "0 0 24 24"), I(e, "version", "1.1"), I(e, "xmlns", "http://www.w3.org/2000/svg"), I(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), I(e, "xml:space", "preserve"), I(e, "stroke", "currentColor"), Vt(e, "fill-rule", "evenodd"), Vt(e, "clip-rule", "evenodd"), Vt(e, "stroke-linecap", "round"), Vt(e, "stroke-linejoin", "round"); }, m(c, u) { - Gh(c, e, u), Xt(e, t), Xt(e, n), Xt(e, l), Xt(e, s), Xt(e, o), Xt(e, r), Xt(e, a), Xt(e, f); - }, - p: Ql, - i: Ql, - o: Ql, - d(c) { - c && Ph(e); - } - }; -} -class Qh extends Oh { - constructor(e) { - super(), Zh(this, e, null, Jh, Kh, {}); - } -} -const { - SvelteComponent: xh, - append: $h, - attr: it, - detach: e0, - init: t0, - insert: n0, - noop: xl, - safe_not_equal: i0, - set_style: Li, - svg_element: Qo -} = window.__gradio__svelte__internal; -function l0(i) { - let e, t; - return { - c() { - e = Qo("svg"), t = Qo("path"), it(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"), it(t, "fill", "none"), it(t, "stroke-width", "2"), it(e, "width", "100%"), it(e, "height", "100%"), it(e, "viewBox", "0 0 24 24"), it(e, "version", "1.1"), it(e, "xmlns", "http://www.w3.org/2000/svg"), it(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), it(e, "xml:space", "preserve"), it(e, "stroke", "currentColor"), Li(e, "fill-rule", "evenodd"), Li(e, "clip-rule", "evenodd"), Li(e, "stroke-linecap", "round"), Li(e, "stroke-linejoin", "round"); - }, - m(n, l) { - n0(n, e, l), $h(e, t); + t0(c, e, u), Ut(e, t), Ut(e, n), Ut(e, l), Ut(e, s), Ut(e, o), Ut(e, r), Ut(e, a), Ut(e, f); }, p: xl, i: xl, o: xl, - d(n) { - n && e0(e); + d(c) { + c && $h(e); } }; } -class s0 extends xh { +class l0 extends xh { constructor(e) { - super(), t0(this, e, null, l0, i0, {}); + super(), e0(this, e, null, i0, n0, {}); } } const { - SvelteComponent: o0, - append: a0, - attr: lt, - detach: r0, - init: f0, - insert: c0, + SvelteComponent: s0, + append: o0, + attr: nt, + detach: a0, + init: r0, + insert: f0, noop: $l, - safe_not_equal: u0, - set_style: Ei, - svg_element: xo + safe_not_equal: c0, + set_style: Ri, + svg_element: $o } = window.__gradio__svelte__internal; -function _0(i) { +function u0(i) { let e, t; return { c() { - e = xo("svg"), t = xo("path"), lt(t, "d", "M10 12L14 16M14 12L10 16M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6"), lt(t, "fill", "none"), lt(t, "stroke-width", "2"), lt(e, "width", "100%"), lt(e, "height", "100%"), lt(e, "viewBox", "0 0 24 24"), lt(e, "version", "1.1"), lt(e, "xmlns", "http://www.w3.org/2000/svg"), lt(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), lt(e, "xml:space", "preserve"), lt(e, "stroke", "currentColor"), Ei(e, "fill-rule", "evenodd"), Ei(e, "clip-rule", "evenodd"), Ei(e, "stroke-linecap", "round"), Ei(e, "stroke-linejoin", "round"); + e = $o("svg"), t = $o("path"), nt(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"), nt(t, "fill", "none"), nt(t, "stroke-width", "2"), nt(e, "width", "100%"), nt(e, "height", "100%"), nt(e, "viewBox", "0 0 24 24"), nt(e, "version", "1.1"), nt(e, "xmlns", "http://www.w3.org/2000/svg"), nt(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), nt(e, "xml:space", "preserve"), nt(e, "stroke", "currentColor"), Ri(e, "fill-rule", "evenodd"), Ri(e, "clip-rule", "evenodd"), Ri(e, "stroke-linecap", "round"), Ri(e, "stroke-linejoin", "round"); }, m(n, l) { - c0(n, e, l), a0(e, t); + f0(n, e, l), o0(e, t); }, p: $l, i: $l, o: $l, d(n) { - n && r0(e); + n && a0(e); } }; } -class d0 extends o0 { +class _0 extends s0 { constructor(e) { - super(), f0(this, e, null, _0, u0, {}); + super(), r0(this, e, null, u0, c0, {}); } } const { - SvelteComponent: h0, - append: $o, - attr: vt, + SvelteComponent: d0, + append: h0, + attr: it, detach: m0, init: g0, insert: b0, noop: es, safe_not_equal: w0, - set_style: Mi, - svg_element: ts + set_style: Ai, + svg_element: ea } = window.__gradio__svelte__internal; -function v0(i) { - let e, t, n; +function p0(i) { + let e, t; return { c() { - e = ts("svg"), t = ts("path"), n = ts("path"), vt(t, "d", "M12,2.5L2.5,12c-.7.7-.7,1.8,0,2.4l7.1,7.1c.7.7,1.8.7,2.4,0l9.5-9.5c.3-.3.5-.8.5-1.2V3.7c0-1-.8-1.7-1.7-1.7h-7.1c-.5,0-.9.2-1.2.5ZM7.3,14.1l4.7-4.7M9.9,16.7l2.2-2.2"), vt(n, "d", "M18.5,6.3c0,.5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9Z"), vt(e, "width", "100%"), vt(e, "height", "100%"), vt(e, "viewBox", "0 0 24 24"), vt(e, "xmlns", "http://www.w3.org/2000/svg"), vt(e, "fill", "none"), vt(e, "stroke", "currentColor"), vt(e, "stroke-width", "2"), Mi(e, "fill-rule", "evenodd"), Mi(e, "clip-rule", "evenodd"), Mi(e, "stroke-linecap", "round"), Mi(e, "stroke-linejoin", "round"); + e = ea("svg"), t = ea("path"), it(t, "d", "M10 12L14 16M14 12L10 16M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6"), it(t, "fill", "none"), it(t, "stroke-width", "2"), it(e, "width", "100%"), it(e, "height", "100%"), it(e, "viewBox", "0 0 24 24"), it(e, "version", "1.1"), it(e, "xmlns", "http://www.w3.org/2000/svg"), it(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), it(e, "xml:space", "preserve"), it(e, "stroke", "currentColor"), Ai(e, "fill-rule", "evenodd"), Ai(e, "clip-rule", "evenodd"), Ai(e, "stroke-linecap", "round"), Ai(e, "stroke-linejoin", "round"); }, - m(l, s) { - b0(l, e, s), $o(e, t), $o(e, n); + m(n, l) { + b0(n, e, l), h0(e, t); }, p: es, i: es, o: es, - d(l) { - l && m0(e); + d(n) { + n && m0(e); } }; } -class p0 extends h0 { +class v0 extends d0 { constructor(e) { - super(), g0(this, e, null, v0, w0, {}); + super(), g0(this, e, null, p0, w0, {}); } } const { SvelteComponent: k0, - append: y0, - attr: jt, - detach: C0, - init: S0, - insert: z0, - noop: ns, - safe_not_equal: B0, - set_style: Ri, - svg_element: ea + append: ta, + attr: yt, + detach: y0, + init: C0, + insert: S0, + noop: ts, + safe_not_equal: z0, + set_style: Wi, + svg_element: ns } = window.__gradio__svelte__internal; -function q0(i) { - let e, t; +function B0(i) { + let e, t, n; return { c() { - e = ea("svg"), t = ea("path"), jt(t, "d", "M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C15.9474 10 16.5286 10 17 10.0288M7 10.0288C6.41168 10.0647 5.99429 10.1455 5.63803 10.327C5.07354 10.6146 4.6146 11.0735 4.32698 11.638C4 12.2798 4 13.1198 4 14.8V16.2C4 17.8802 4 18.7202 4.32698 19.362C4.6146 19.9265 5.07354 20.3854 5.63803 20.673C6.27976 21 7.11984 21 8.8 21H15.2C16.8802 21 17.7202 21 18.362 20.673C18.9265 20.3854 19.3854 19.9265 19.673 19.362C20 18.7202 20 17.8802 20 16.2V14.8C20 13.1198 20 12.2798 19.673 11.638C19.3854 11.0735 18.9265 10.6146 18.362 10.327C18.0057 10.1455 17.5883 10.0647 17 10.0288M7 10.0288V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V10.0288"), jt(e, "width", "100%"), jt(e, "height", "100%"), jt(e, "viewBox", "0 0 24 24"), jt(e, "fill", "none"), jt(e, "stroke", "currentColor"), jt(e, "stroke-width", "2"), Ri(e, "fill-rule", "evenodd"), Ri(e, "clip-rule", "evenodd"), Ri(e, "stroke-linecap", "round"), Ri(e, "stroke-linejoin", "round"), jt(e, "xmlns", "http://www.w3.org/2000/svg"); + e = ns("svg"), t = ns("path"), n = ns("path"), yt(t, "d", "M12,2.5L2.5,12c-.7.7-.7,1.8,0,2.4l7.1,7.1c.7.7,1.8.7,2.4,0l9.5-9.5c.3-.3.5-.8.5-1.2V3.7c0-1-.8-1.7-1.7-1.7h-7.1c-.5,0-.9.2-1.2.5ZM7.3,14.1l4.7-4.7M9.9,16.7l2.2-2.2"), yt(n, "d", "M18.5,6.3c0,.5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9Z"), yt(e, "width", "100%"), yt(e, "height", "100%"), yt(e, "viewBox", "0 0 24 24"), yt(e, "xmlns", "http://www.w3.org/2000/svg"), yt(e, "fill", "none"), yt(e, "stroke", "currentColor"), yt(e, "stroke-width", "2"), Wi(e, "fill-rule", "evenodd"), Wi(e, "clip-rule", "evenodd"), Wi(e, "stroke-linecap", "round"), Wi(e, "stroke-linejoin", "round"); }, - m(n, l) { - z0(n, e, l), y0(e, t); + m(l, s) { + S0(l, e, s), ta(e, t), ta(e, n); }, - p: ns, - i: ns, - o: ns, - d(n) { - n && C0(e); + p: ts, + i: ts, + o: ts, + d(l) { + l && y0(e); } }; } class D0 extends k0 { constructor(e) { - super(), S0(this, e, null, q0, B0, {}); + super(), C0(this, e, null, B0, z0, {}); } } const { - SvelteComponent: L0, - append: E0, - attr: Ft, + SvelteComponent: q0, + append: L0, + attr: Nt, detach: M0, - init: R0, - insert: A0, + init: E0, + insert: R0, noop: is, - safe_not_equal: W0, - set_style: Ai, - svg_element: ta + safe_not_equal: A0, + set_style: Xi, + svg_element: na } = window.__gradio__svelte__internal; -function H0(i) { +function W0(i) { let e, t; return { c() { - e = ta("svg"), t = ta("path"), Ft(t, "d", "M16.584 6C15.8124 4.2341 14.0503 3 12 3C9.23858 3 7 5.23858 7 8V10.0288M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C16.8802 10 17.7202 10 18.362 10.327C18.9265 10.6146 19.3854 11.0735 19.673 11.638C20 12.2798 20 13.1198 20 14.8V16.2C20 17.8802 20 18.7202 19.673 19.362C19.3854 19.9265 18.9265 20.3854 18.362 20.673C17.7202 21 16.8802 21 15.2 21H8.8C7.11984 21 6.27976 21 5.63803 20.673C5.07354 20.3854 4.6146 19.9265 4.32698 19.362C4 18.7202 4 17.8802 4 16.2V14.8C4 13.1198 4 12.2798 4.32698 11.638C4.6146 11.0735 5.07354 10.6146 5.63803 10.327C5.99429 10.1455 6.41168 10.0647 7 10.0288Z"), Ft(e, "width", "100%"), Ft(e, "height", "100%"), Ft(e, "viewBox", "0 0 24 24"), Ft(e, "fill", "none"), Ft(e, "stroke", "currentColor"), Ft(e, "stroke-width", "2"), Ai(e, "fill-rule", "evenodd"), Ai(e, "clip-rule", "evenodd"), Ai(e, "stroke-linecap", "round"), Ai(e, "stroke-linejoin", "round"), Ft(e, "xmlns", "http://www.w3.org/2000/svg"); + e = na("svg"), t = na("path"), Nt(t, "d", "M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C15.9474 10 16.5286 10 17 10.0288M7 10.0288C6.41168 10.0647 5.99429 10.1455 5.63803 10.327C5.07354 10.6146 4.6146 11.0735 4.32698 11.638C4 12.2798 4 13.1198 4 14.8V16.2C4 17.8802 4 18.7202 4.32698 19.362C4.6146 19.9265 5.07354 20.3854 5.63803 20.673C6.27976 21 7.11984 21 8.8 21H15.2C16.8802 21 17.7202 21 18.362 20.673C18.9265 20.3854 19.3854 19.9265 19.673 19.362C20 18.7202 20 17.8802 20 16.2V14.8C20 13.1198 20 12.2798 19.673 11.638C19.3854 11.0735 18.9265 10.6146 18.362 10.327C18.0057 10.1455 17.5883 10.0647 17 10.0288M7 10.0288V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V10.0288"), Nt(e, "width", "100%"), Nt(e, "height", "100%"), Nt(e, "viewBox", "0 0 24 24"), Nt(e, "fill", "none"), Nt(e, "stroke", "currentColor"), Nt(e, "stroke-width", "2"), Xi(e, "fill-rule", "evenodd"), Xi(e, "clip-rule", "evenodd"), Xi(e, "stroke-linecap", "round"), Xi(e, "stroke-linejoin", "round"), Nt(e, "xmlns", "http://www.w3.org/2000/svg"); }, m(n, l) { - A0(n, e, l), E0(e, t); + R0(n, e, l), L0(e, t); }, p: is, i: is, @@ -5958,38 +5924,72 @@ function H0(i) { } }; } -class I0 extends L0 { +class X0 extends q0 { + constructor(e) { + super(), E0(this, e, null, W0, A0, {}); + } +} +const { + SvelteComponent: Y0, + append: I0, + attr: Ot, + detach: H0, + init: T0, + insert: j0, + noop: ls, + safe_not_equal: F0, + set_style: Yi, + svg_element: ia +} = window.__gradio__svelte__internal; +function U0(i) { + let e, t; + return { + c() { + e = ia("svg"), t = ia("path"), Ot(t, "d", "M16.584 6C15.8124 4.2341 14.0503 3 12 3C9.23858 3 7 5.23858 7 8V10.0288M7 10.0288C7.47142 10 8.05259 10 8.8 10H15.2C16.8802 10 17.7202 10 18.362 10.327C18.9265 10.6146 19.3854 11.0735 19.673 11.638C20 12.2798 20 13.1198 20 14.8V16.2C20 17.8802 20 18.7202 19.673 19.362C19.3854 19.9265 18.9265 20.3854 18.362 20.673C17.7202 21 16.8802 21 15.2 21H8.8C7.11984 21 6.27976 21 5.63803 20.673C5.07354 20.3854 4.6146 19.9265 4.32698 19.362C4 18.7202 4 17.8802 4 16.2V14.8C4 13.1198 4 12.2798 4.32698 11.638C4.6146 11.0735 5.07354 10.6146 5.63803 10.327C5.99429 10.1455 6.41168 10.0647 7 10.0288Z"), Ot(e, "width", "100%"), Ot(e, "height", "100%"), Ot(e, "viewBox", "0 0 24 24"), Ot(e, "fill", "none"), Ot(e, "stroke", "currentColor"), Ot(e, "stroke-width", "2"), Yi(e, "fill-rule", "evenodd"), Yi(e, "clip-rule", "evenodd"), Yi(e, "stroke-linecap", "round"), Yi(e, "stroke-linejoin", "round"), Ot(e, "xmlns", "http://www.w3.org/2000/svg"); + }, + m(n, l) { + j0(n, e, l), I0(e, t); + }, + p: ls, + i: ls, + o: ls, + d(n) { + n && H0(e); + } + }; +} +class V0 extends Y0 { constructor(e) { - super(), R0(this, e, null, H0, W0, {}); + super(), T0(this, e, null, U0, F0, {}); } } const { - SvelteComponent: T0, - append: na, - attr: ls, - bubble: ia, - create_component: X0, - destroy_component: Y0, - detach: Ir, - element: la, - init: j0, + SvelteComponent: N0, + append: la, + attr: ss, + bubble: sa, + create_component: O0, + destroy_component: P0, + detach: Hr, + element: oa, + init: Z0, insert: Tr, - listen: ss, - mount_component: F0, - run_all: U0, - safe_not_equal: V0, - set_data: N0, - set_input_value: sa, - space: O0, - text: P0, - transition_in: Z0, - transition_out: G0 -} = window.__gradio__svelte__internal, { createEventDispatcher: K0, afterUpdate: J0 } = window.__gradio__svelte__internal; -function Q0(i) { + listen: os, + mount_component: G0, + run_all: K0, + safe_not_equal: J0, + set_data: Q0, + set_input_value: aa, + space: x0, + text: $0, + transition_in: em, + transition_out: tm +} = window.__gradio__svelte__internal, { createEventDispatcher: nm, afterUpdate: im } = window.__gradio__svelte__internal; +function lm(i) { let e; return { c() { - e = P0( + e = $0( /*label*/ i[1] ); @@ -5999,20 +5999,20 @@ function Q0(i) { }, p(t, n) { n & /*label*/ - 2 && N0( + 2 && Q0( e, /*label*/ t[1] ); }, d(t) { - t && Ir(e); + t && Hr(e); } }; } -function x0(i) { +function sm(i) { let e, t, n, l, s, o, r; - return t = new Na({ + return t = new Pa({ props: { show_label: ( /*show_label*/ @@ -6022,33 +6022,33 @@ function x0(i) { /*info*/ i[2] ), - $$slots: { default: [Q0] }, + $$slots: { default: [lm] }, $$scope: { ctx: i } } }), { c() { - e = la("label"), X0(t.$$.fragment), n = O0(), l = la("input"), ls(l, "type", "color"), l.disabled = /*disabled*/ - i[3], ls(l, "class", "svelte-16l8u73"), ls(e, "class", "block"); + e = oa("label"), O0(t.$$.fragment), n = x0(), l = oa("input"), ss(l, "type", "color"), l.disabled = /*disabled*/ + i[3], ss(l, "class", "svelte-16l8u73"), ss(e, "class", "block"); }, m(a, f) { - Tr(a, e, f), F0(t, e, null), na(e, n), na(e, l), sa( + Tr(a, e, f), G0(t, e, null), la(e, n), la(e, l), aa( l, /*value*/ i[0] ), s = !0, o || (r = [ - ss( + os( l, "input", /*input_input_handler*/ i[8] ), - ss( + os( l, "focus", /*focus_handler*/ i[6] ), - ss( + os( l, "blur", /*blur_handler*/ @@ -6066,37 +6066,37 @@ function x0(i) { 2050 && (c.$$scope = { dirty: f, ctx: a }), t.$set(c), (!s || f & /*disabled*/ 8) && (l.disabled = /*disabled*/ a[3]), f & /*value*/ - 1 && sa( + 1 && aa( l, /*value*/ a[0] ); }, i(a) { - s || (Z0(t.$$.fragment, a), s = !0); + s || (em(t.$$.fragment, a), s = !0); }, o(a) { - G0(t.$$.fragment, a), s = !1; + tm(t.$$.fragment, a), s = !1; }, d(a) { - a && Ir(e), Y0(t), o = !1, U0(r); + a && Hr(e), P0(t), o = !1, K0(r); } }; } -function $0(i, e, t) { +function om(i, e, t) { let { value: n = "#000000" } = e, { value_is_output: l = !1 } = e, { label: s } = e, { info: o = void 0 } = e, { disabled: r = !1 } = e, { show_label: a = !0 } = e; - const f = K0(); + const f = nm(); function c() { f("change", n), l || f("input"); } - J0(() => { + im(() => { t(5, l = !1); }); function u(m) { - ia.call(this, i, m); + sa.call(this, i, m); } function _(m) { - ia.call(this, i, m); + sa.call(this, i, m); } function d() { n = this.value, t(0, n); @@ -6118,9 +6118,9 @@ function $0(i, e, t) { d ]; } -class em extends T0 { +class am extends N0 { constructor(e) { - super(), j0(this, e, $0, x0, V0, { + super(), Z0(this, e, om, sm, J0, { value: 0, value_is_output: 5, label: 1, @@ -6131,39 +6131,39 @@ class em extends T0 { } } const { - SvelteComponent: tm, - append: Xr, - attr: se, - bubble: nm, - check_outros: im, - create_slot: Yr, - detach: gi, - element: ml, - empty: lm, - get_all_dirty_from_scope: jr, - get_slot_changes: Fr, - group_outros: sm, - init: om, - insert: bi, - listen: am, - safe_not_equal: rm, + SvelteComponent: rm, + append: jr, + attr: fe, + bubble: fm, + check_outros: cm, + create_slot: Fr, + detach: wi, + element: wl, + empty: um, + get_all_dirty_from_scope: Ur, + get_slot_changes: Vr, + group_outros: _m, + init: dm, + insert: pi, + listen: hm, + safe_not_equal: mm, set_style: Le, - space: Ur, - src_url_equal: el, - toggle_class: An, - transition_in: tl, - transition_out: nl, - update_slot_base: Vr + space: Nr, + src_url_equal: il, + toggle_class: Yn, + transition_in: ll, + transition_out: sl, + update_slot_base: Or } = window.__gradio__svelte__internal; -function fm(i) { +function gm(i) { let e, t, n, l, s, o, r = ( /*icon*/ - i[7] && oa(i) + i[7] && ra(i) ); const a = ( /*#slots*/ i[12].default - ), f = Yr( + ), f = Fr( a, i, /*$$scope*/ @@ -6172,16 +6172,16 @@ function fm(i) { ); return { c() { - e = ml("button"), r && r.c(), t = Ur(), f && f.c(), se(e, "class", n = /*size*/ + e = wl("button"), r && r.c(), t = Nr(), f && f.c(), fe(e, "class", n = /*size*/ i[4] + " " + /*variant*/ i[3] + " " + /*elem_classes*/ - i[1].join(" ") + " svelte-8huxfn"), se( + i[1].join(" ") + " svelte-8huxfn"), fe( e, "id", /*elem_id*/ i[0] ), e.disabled = /*disabled*/ - i[8], An(e, "hidden", !/*visible*/ + i[8], Yn(e, "hidden", !/*visible*/ i[2]), Le( e, "flex-grow", @@ -6197,7 +6197,7 @@ function fm(i) { i[10]}px, 100%))` : null); }, m(c, u) { - bi(c, e, u), r && r.m(e, null), Xr(e, t), f && f.m(e, null), l = !0, s || (o = am( + pi(c, e, u), r && r.m(e, null), jr(e, t), f && f.m(e, null), l = !0, s || (o = hm( e, "click", /*click_handler*/ @@ -6206,20 +6206,20 @@ function fm(i) { }, p(c, u) { /*icon*/ - c[7] ? r ? r.p(c, u) : (r = oa(c), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!l || u & /*$$scope*/ - 2048) && Vr( + c[7] ? r ? r.p(c, u) : (r = ra(c), r.c(), r.m(e, t)) : r && (r.d(1), r = null), f && f.p && (!l || u & /*$$scope*/ + 2048) && Or( f, a, c, /*$$scope*/ c[11], - l ? Fr( + l ? Vr( a, /*$$scope*/ c[11], u, null - ) : jr( + ) : Ur( /*$$scope*/ c[11] ), @@ -6228,8 +6228,8 @@ function fm(i) { 26 && n !== (n = /*size*/ c[4] + " " + /*variant*/ c[3] + " " + /*elem_classes*/ - c[1].join(" ") + " svelte-8huxfn")) && se(e, "class", n), (!l || u & /*elem_id*/ - 1) && se( + c[1].join(" ") + " svelte-8huxfn")) && fe(e, "class", n), (!l || u & /*elem_id*/ + 1) && fe( e, "id", /*elem_id*/ @@ -6237,7 +6237,7 @@ function fm(i) { ), (!l || u & /*disabled*/ 256) && (e.disabled = /*disabled*/ c[8]), (!l || u & /*size, variant, elem_classes, visible*/ - 30) && An(e, "hidden", !/*visible*/ + 30) && Yn(e, "hidden", !/*visible*/ c[2]), u & /*scale*/ 512 && Le( e, @@ -6256,25 +6256,25 @@ function fm(i) { c[10]}px, 100%))` : null); }, i(c) { - l || (tl(f, c), l = !0); + l || (ll(f, c), l = !0); }, o(c) { - nl(f, c), l = !1; + sl(f, c), l = !1; }, d(c) { - c && gi(e), r && r.d(), f && f.d(c), s = !1, o(); + c && wi(e), r && r.d(), f && f.d(c), s = !1, o(); } }; } -function cm(i) { +function bm(i) { let e, t, n, l, s = ( /*icon*/ - i[7] && aa(i) + i[7] && fa(i) ); const o = ( /*#slots*/ i[12].default - ), r = Yr( + ), r = Fr( o, i, /*$$scope*/ @@ -6283,26 +6283,26 @@ function cm(i) { ); return { c() { - e = ml("a"), s && s.c(), t = Ur(), r && r.c(), se( + e = wl("a"), s && s.c(), t = Nr(), r && r.c(), fe( e, "href", /*link*/ i[6] - ), se(e, "rel", "noopener noreferrer"), se( + ), fe(e, "rel", "noopener noreferrer"), fe( e, "aria-disabled", /*disabled*/ i[8] - ), se(e, "class", n = /*size*/ + ), fe(e, "class", n = /*size*/ i[4] + " " + /*variant*/ i[3] + " " + /*elem_classes*/ - i[1].join(" ") + " svelte-8huxfn"), se( + i[1].join(" ") + " svelte-8huxfn"), fe( e, "id", /*elem_id*/ i[0] - ), An(e, "hidden", !/*visible*/ - i[2]), An( + ), Yn(e, "hidden", !/*visible*/ + i[2]), Yn( e, "disabled", /*disabled*/ @@ -6327,36 +6327,36 @@ function cm(i) { i[10]}px, 100%))` : null); }, m(a, f) { - bi(a, e, f), s && s.m(e, null), Xr(e, t), r && r.m(e, null), l = !0; + pi(a, e, f), s && s.m(e, null), jr(e, t), r && r.m(e, null), l = !0; }, p(a, f) { /*icon*/ - a[7] ? s ? s.p(a, f) : (s = aa(a), s.c(), s.m(e, t)) : s && (s.d(1), s = null), r && r.p && (!l || f & /*$$scope*/ - 2048) && Vr( + a[7] ? s ? s.p(a, f) : (s = fa(a), s.c(), s.m(e, t)) : s && (s.d(1), s = null), r && r.p && (!l || f & /*$$scope*/ + 2048) && Or( r, o, a, /*$$scope*/ a[11], - l ? Fr( + l ? Vr( o, /*$$scope*/ a[11], f, null - ) : jr( + ) : Ur( /*$$scope*/ a[11] ), null ), (!l || f & /*link*/ - 64) && se( + 64) && fe( e, "href", /*link*/ a[6] ), (!l || f & /*disabled*/ - 256) && se( + 256) && fe( e, "aria-disabled", /*disabled*/ @@ -6365,16 +6365,16 @@ function cm(i) { 26 && n !== (n = /*size*/ a[4] + " " + /*variant*/ a[3] + " " + /*elem_classes*/ - a[1].join(" ") + " svelte-8huxfn")) && se(e, "class", n), (!l || f & /*elem_id*/ - 1) && se( + a[1].join(" ") + " svelte-8huxfn")) && fe(e, "class", n), (!l || f & /*elem_id*/ + 1) && fe( e, "id", /*elem_id*/ a[0] ), (!l || f & /*size, variant, elem_classes, visible*/ - 30) && An(e, "hidden", !/*visible*/ + 30) && Yn(e, "hidden", !/*visible*/ a[2]), (!l || f & /*size, variant, elem_classes, disabled*/ - 282) && An( + 282) && Yn( e, "disabled", /*disabled*/ @@ -6403,65 +6403,65 @@ function cm(i) { a[10]}px, 100%))` : null); }, i(a) { - l || (tl(r, a), l = !0); + l || (ll(r, a), l = !0); }, o(a) { - nl(r, a), l = !1; + sl(r, a), l = !1; }, d(a) { - a && gi(e), s && s.d(), r && r.d(a); + a && wi(e), s && s.d(), r && r.d(a); } }; } -function oa(i) { +function ra(i) { let e, t, n; return { c() { - e = ml("img"), se(e, "class", "button-icon svelte-8huxfn"), el(e.src, t = /*icon*/ - i[7].url) || se(e, "src", t), se(e, "alt", n = `${/*value*/ + e = wl("img"), fe(e, "class", "button-icon svelte-8huxfn"), il(e.src, t = /*icon*/ + i[7].url) || fe(e, "src", t), fe(e, "alt", n = `${/*value*/ i[5]} icon`); }, m(l, s) { - bi(l, e, s); + pi(l, e, s); }, p(l, s) { s & /*icon*/ - 128 && !el(e.src, t = /*icon*/ - l[7].url) && se(e, "src", t), s & /*value*/ + 128 && !il(e.src, t = /*icon*/ + l[7].url) && fe(e, "src", t), s & /*value*/ 32 && n !== (n = `${/*value*/ - l[5]} icon`) && se(e, "alt", n); + l[5]} icon`) && fe(e, "alt", n); }, d(l) { - l && gi(e); + l && wi(e); } }; } -function aa(i) { +function fa(i) { let e, t, n; return { c() { - e = ml("img"), se(e, "class", "button-icon svelte-8huxfn"), el(e.src, t = /*icon*/ - i[7].url) || se(e, "src", t), se(e, "alt", n = `${/*value*/ + e = wl("img"), fe(e, "class", "button-icon svelte-8huxfn"), il(e.src, t = /*icon*/ + i[7].url) || fe(e, "src", t), fe(e, "alt", n = `${/*value*/ i[5]} icon`); }, m(l, s) { - bi(l, e, s); + pi(l, e, s); }, p(l, s) { s & /*icon*/ - 128 && !el(e.src, t = /*icon*/ - l[7].url) && se(e, "src", t), s & /*value*/ + 128 && !il(e.src, t = /*icon*/ + l[7].url) && fe(e, "src", t), s & /*value*/ 32 && n !== (n = `${/*value*/ - l[5]} icon`) && se(e, "alt", n); + l[5]} icon`) && fe(e, "alt", n); }, d(l) { - l && gi(e); + l && wi(e); } }; } -function um(i) { +function wm(i) { let e, t, n, l; - const s = [cm, fm], o = []; + const s = [bm, gm], o = []; function r(a, f) { return ( /*link*/ @@ -6471,35 +6471,35 @@ function um(i) { } return e = r(i), t = o[e] = s[e](i), { c() { - t.c(), n = lm(); + t.c(), n = um(); }, m(a, f) { - o[e].m(a, f), bi(a, n, f), l = !0; + o[e].m(a, f), pi(a, n, f), l = !0; }, p(a, [f]) { let c = e; - e = r(a), e === c ? o[e].p(a, f) : (sm(), nl(o[c], 1, 1, () => { + e = r(a), e === c ? o[e].p(a, f) : (_m(), sl(o[c], 1, 1, () => { o[c] = null; - }), im(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), tl(t, 1), t.m(n.parentNode, n)); + }), cm(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), ll(t, 1), t.m(n.parentNode, n)); }, i(a) { - l || (tl(t), l = !0); + l || (ll(t), l = !0); }, o(a) { - nl(t), l = !1; + sl(t), l = !1; }, d(a) { - a && gi(n), o[e].d(a); + a && wi(n), o[e].d(a); } }; } -function _m(i, e, t) { +function pm(i, e, t) { let { $$slots: n = {}, $$scope: l } = e, { elem_id: s = "" } = e, { elem_classes: o = [] } = e, { visible: r = !0 } = e, { variant: a = "secondary" } = e, { size: f = "lg" } = e, { value: c = null } = e, { link: u = null } = e, { icon: _ = null } = e, { disabled: d = !1 } = e, { scale: m = null } = e, { min_width: h = void 0 } = e; - function g(v) { - nm.call(this, i, v); + function g(p) { + fm.call(this, i, p); } - return i.$$set = (v) => { - "elem_id" in v && t(0, s = v.elem_id), "elem_classes" in v && t(1, o = v.elem_classes), "visible" in v && t(2, r = v.visible), "variant" in v && t(3, a = v.variant), "size" in v && t(4, f = v.size), "value" in v && t(5, c = v.value), "link" in v && t(6, u = v.link), "icon" in v && t(7, _ = v.icon), "disabled" in v && t(8, d = v.disabled), "scale" in v && t(9, m = v.scale), "min_width" in v && t(10, h = v.min_width), "$$scope" in v && t(11, l = v.$$scope); + return i.$$set = (p) => { + "elem_id" in p && t(0, s = p.elem_id), "elem_classes" in p && t(1, o = p.elem_classes), "visible" in p && t(2, r = p.visible), "variant" in p && t(3, a = p.variant), "size" in p && t(4, f = p.size), "value" in p && t(5, c = p.value), "link" in p && t(6, u = p.link), "icon" in p && t(7, _ = p.icon), "disabled" in p && t(8, d = p.disabled), "scale" in p && t(9, m = p.scale), "min_width" in p && t(10, h = p.min_width), "$$scope" in p && t(11, l = p.$$scope); }, [ s, o, @@ -6517,9 +6517,9 @@ function _m(i, e, t) { g ]; } -class Ss extends tm { +class zs extends rm { constructor(e) { - super(), om(this, e, _m, um, rm, { + super(), dm(this, e, pm, wm, mm, { elem_id: 0, elem_classes: 1, visible: 2, @@ -6535,56 +6535,56 @@ class Ss extends tm { } } const { - SvelteComponent: dm, - add_render_callback: Nr, - append: Wi, + SvelteComponent: vm, + add_render_callback: Pr, + append: Ii, attr: Te, - binding_callbacks: ra, - check_outros: hm, - create_bidirectional_transition: fa, - destroy_each: mm, - detach: ci, - element: il, - empty: gm, - ensure_array_like: ca, - group_outros: bm, - init: wm, - insert: ui, - listen: zs, - prevent_default: vm, - run_all: pm, - safe_not_equal: km, - set_data: ym, - set_style: Bn, - space: Bs, - text: Cm, + binding_callbacks: ca, + check_outros: km, + create_bidirectional_transition: ua, + destroy_each: ym, + detach: _i, + element: ol, + empty: Cm, + ensure_array_like: _a, + group_outros: Sm, + init: zm, + insert: di, + listen: Bs, + prevent_default: Bm, + run_all: Dm, + safe_not_equal: qm, + set_data: Lm, + set_style: Ln, + space: Ds, + text: Mm, toggle_class: ct, - transition_in: os, - transition_out: ua -} = window.__gradio__svelte__internal, { createEventDispatcher: Sm } = window.__gradio__svelte__internal; -function _a(i, e, t) { + transition_in: as, + transition_out: da +} = window.__gradio__svelte__internal, { createEventDispatcher: Em } = window.__gradio__svelte__internal; +function ha(i, e, t) { const n = i.slice(); return n[26] = e[t], n; } -function da(i) { - let e, t, n, l, s, o = ca( +function ma(i) { + let e, t, n, l, s, o = _a( /*filtered_indices*/ i[1] ), r = []; for (let a = 0; a < o.length; a += 1) - r[a] = ha(_a(i, o, a)); + r[a] = ga(ha(i, o, a)); return { c() { - e = il("ul"); + e = ol("ul"); for (let a = 0; a < r.length; a += 1) r[a].c(); - Te(e, "class", "options svelte-yuohum"), Te(e, "role", "listbox"), Bn( + Te(e, "class", "options svelte-yuohum"), Te(e, "role", "listbox"), Ln( e, "bottom", /*bottom*/ i[9] - ), Bn(e, "max-height", `calc(${/*max_height*/ - i[10]}px - var(--window-padding))`), Bn( + ), Ln(e, "max-height", `calc(${/*max_height*/ + i[10]}px - var(--window-padding))`), Ln( e, "width", /*input_width*/ @@ -6592,10 +6592,10 @@ function da(i) { ); }, m(a, f) { - ui(a, e, f); + di(a, e, f); for (let c = 0; c < r.length; c += 1) r[c] && r[c].m(e, null); - i[22](e), n = !0, l || (s = zs(e, "mousedown", vm( + i[22](e), n = !0, l || (s = Bs(e, "mousedown", Bm( /*mousedown_handler*/ i[21] )), l = !0); @@ -6603,29 +6603,29 @@ function da(i) { p(a, f) { if (f & /*filtered_indices, choices, selected_indices, active_index*/ 51) { - o = ca( + o = _a( /*filtered_indices*/ a[1] ); let c; for (c = 0; c < o.length; c += 1) { - const u = _a(a, o, c); - r[c] ? r[c].p(u, f) : (r[c] = ha(u), r[c].c(), r[c].m(e, null)); + const u = ha(a, o, c); + r[c] ? r[c].p(u, f) : (r[c] = ga(u), r[c].c(), r[c].m(e, null)); } for (; c < r.length; c += 1) r[c].d(1); r.length = o.length; } f & /*bottom*/ - 512 && Bn( + 512 && Ln( e, "bottom", /*bottom*/ a[9] ), f & /*max_height*/ - 1024 && Bn(e, "max-height", `calc(${/*max_height*/ + 1024 && Ln(e, "max-height", `calc(${/*max_height*/ a[10]}px - var(--window-padding))`), f & /*input_width*/ - 256 && Bn( + 256 && Ln( e, "width", /*input_width*/ @@ -6633,19 +6633,19 @@ function da(i) { ); }, i(a) { - n || (a && Nr(() => { - n && (t || (t = fa(e, bo, { duration: 200, y: 5 }, !0)), t.run(1)); + n || (a && Pr(() => { + n && (t || (t = ua(e, po, { duration: 200, y: 5 }, !0)), t.run(1)); }), n = !0); }, o(a) { - a && (t || (t = fa(e, bo, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1; + a && (t || (t = ua(e, po, { duration: 200, y: 5 }, !1)), t.run(0)), n = !1; }, d(a) { - a && ci(e), mm(r, a), i[22](null), a && t && t.end(), l = !1, s(); + a && _i(e), ym(r, a), i[22](null), a && t && t.end(), l = !1, s(); } }; } -function ha(i) { +function ga(i) { let e, t, n, l = ( /*choices*/ i[0][ @@ -6655,7 +6655,7 @@ function ha(i) { ), s, o, r, a, f; return { c() { - e = il("li"), t = il("span"), t.textContent = "✓", n = Bs(), s = Cm(l), o = Bs(), Te(t, "class", "inner-item svelte-yuohum"), ct(t, "hide", !/*selected_indices*/ + e = ol("li"), t = ol("span"), t.textContent = "✓", n = Ds(), s = Mm(l), o = Ds(), Te(t, "class", "inner-item svelte-yuohum"), ct(t, "hide", !/*selected_indices*/ i[4].includes( /*index*/ i[26] @@ -6697,7 +6697,7 @@ function ha(i) { ); }, m(c, u) { - ui(c, e, u), Wi(e, t), Wi(e, n), Wi(e, s), Wi(e, o); + di(c, e, u), Ii(e, t), Ii(e, n), Ii(e, s), Ii(e, o); }, p(c, u) { u & /*selected_indices, filtered_indices*/ @@ -6710,7 +6710,7 @@ function ha(i) { c[0][ /*index*/ c[26] - ][0] + "") && ym(s, l), u & /*filtered_indices*/ + ][0] + "") && Lm(s, l), u & /*filtered_indices*/ 2 && r !== (r = /*index*/ c[26]) && Te(e, "data-index", r), u & /*choices, filtered_indices*/ 3 && a !== (a = /*choices*/ @@ -6755,34 +6755,34 @@ function ha(i) { ); }, d(c) { - c && ci(e); + c && _i(e); } }; } -function zm(i) { +function Rm(i) { let e, t, n, l, s; - Nr( + Pr( /*onwindowresize*/ i[19] ); let o = ( /*show_options*/ i[2] && !/*disabled*/ - i[3] && da(i) + i[3] && ma(i) ); return { c() { - e = il("div"), t = Bs(), o && o.c(), n = gm(), Te(e, "class", "reference"); + e = ol("div"), t = Ds(), o && o.c(), n = Cm(), Te(e, "class", "reference"); }, m(r, a) { - ui(r, e, a), i[20](e), ui(r, t, a), o && o.m(r, a), ui(r, n, a), l || (s = [ - zs( + di(r, e, a), i[20](e), di(r, t, a), o && o.m(r, a), di(r, n, a), l || (s = [ + Bs( window, "scroll", /*scroll_listener*/ i[12] ), - zs( + Bs( window, "resize", /*onwindowresize*/ @@ -6794,71 +6794,71 @@ function zm(i) { /*show_options*/ r[2] && !/*disabled*/ r[3] ? o ? (o.p(r, a), a & /*show_options, disabled*/ - 12 && os(o, 1)) : (o = da(r), o.c(), os(o, 1), o.m(n.parentNode, n)) : o && (bm(), ua(o, 1, 1, () => { + 12 && as(o, 1)) : (o = ma(r), o.c(), as(o, 1), o.m(n.parentNode, n)) : o && (Sm(), da(o, 1, 1, () => { o = null; - }), hm()); + }), km()); }, i(r) { - os(o); + as(o); }, o(r) { - ua(o); + da(o); }, d(r) { - r && (ci(e), ci(t), ci(n)), i[20](null), o && o.d(r), l = !1, pm(s); + r && (_i(e), _i(t), _i(n)), i[20](null), o && o.d(r), l = !1, Dm(s); } }; } -function Bm(i, e, t) { +function Am(i, e, t) { var n, l; - let { choices: s } = e, { filtered_indices: o } = e, { show_options: r = !1 } = e, { disabled: a = !1 } = e, { selected_indices: f = [] } = e, { active_index: c = null } = e, u, _, d, m, h, g, v, w, b; + let { choices: s } = e, { filtered_indices: o } = e, { show_options: r = !1 } = e, { disabled: a = !1 } = e, { selected_indices: f = [] } = e, { active_index: c = null } = e, u, _, d, m, h, g, p, w, b; function k() { - const { top: A, bottom: F } = h.getBoundingClientRect(); - t(16, u = A), t(17, _ = b - F); + const { top: W, bottom: F } = h.getBoundingClientRect(); + t(16, u = W), t(17, _ = b - F); } - let p = null; + let v = null; function y() { - r && (p !== null && clearTimeout(p), p = setTimeout( + r && (v !== null && clearTimeout(v), v = setTimeout( () => { - k(), p = null; + k(), v = null; }, 10 )); } - const q = Sm(); + const S = Em(); function C() { t(11, b = window.innerHeight); } - function z(A) { - ra[A ? "unshift" : "push"](() => { - h = A, t(6, h); + function z(W) { + ca[W ? "unshift" : "push"](() => { + h = W, t(6, h); }); } - const S = (A) => q("change", A); - function W(A) { - ra[A ? "unshift" : "push"](() => { - g = A, t(7, g); + const D = (W) => S("change", W); + function q(W) { + ca[W ? "unshift" : "push"](() => { + g = W, t(7, g); }); } - return i.$$set = (A) => { - "choices" in A && t(0, s = A.choices), "filtered_indices" in A && t(1, o = A.filtered_indices), "show_options" in A && t(2, r = A.show_options), "disabled" in A && t(3, a = A.disabled), "selected_indices" in A && t(4, f = A.selected_indices), "active_index" in A && t(5, c = A.active_index); + return i.$$set = (W) => { + "choices" in W && t(0, s = W.choices), "filtered_indices" in W && t(1, o = W.filtered_indices), "show_options" in W && t(2, r = W.show_options), "disabled" in W && t(3, a = W.disabled), "selected_indices" in W && t(4, f = W.selected_indices), "active_index" in W && t(5, c = W.active_index); }, i.$$.update = () => { if (i.$$.dirty & /*show_options, refElement, listElement, selected_indices, _a, _b, distance_from_bottom, distance_from_top, input_height*/ 508116) { if (r && h) { if (g && f.length > 0) { let F = g.querySelectorAll("li"); - for (const K of Array.from(F)) - if (K.getAttribute("data-index") === f[0].toString()) { - t(14, n = g == null ? void 0 : g.scrollTo) === null || n === void 0 || n.call(g, 0, K.offsetTop); + for (const J of Array.from(F)) + if (J.getAttribute("data-index") === f[0].toString()) { + t(14, n = g == null ? void 0 : g.scrollTo) === null || n === void 0 || n.call(g, 0, J.offsetTop); break; } } k(); - const A = t(15, l = h.parentElement) === null || l === void 0 ? void 0 : l.getBoundingClientRect(); - t(18, d = (A == null ? void 0 : A.height) || 0), t(8, m = (A == null ? void 0 : A.width) || 0); + const W = t(15, l = h.parentElement) === null || l === void 0 ? void 0 : l.getBoundingClientRect(); + t(18, d = (W == null ? void 0 : W.height) || 0), t(8, m = (W == null ? void 0 : W.width) || 0); } - _ > u ? (t(10, w = _), t(9, v = null)) : (t(9, v = `${_ + d}px`), t(10, w = u - d)); + _ > u ? (t(10, w = _), t(9, p = null)) : (t(9, p = `${_ + d}px`), t(10, w = u - d)); } }, [ s, @@ -6870,11 +6870,11 @@ function Bm(i, e, t) { h, g, m, - v, + p, w, b, y, - q, + S, n, l, u, @@ -6882,13 +6882,13 @@ function Bm(i, e, t) { d, C, z, - S, - W + D, + q ]; } -class qm extends dm { +class Wm extends vm { constructor(e) { - super(), wm(this, e, Bm, zm, km, { + super(), zm(this, e, Am, Rm, qm, { choices: 0, filtered_indices: 1, show_options: 2, @@ -6898,16 +6898,16 @@ class qm extends dm { }); } } -function Dm(i, e) { +function Xm(i, e) { return (i % e + e) % e; } -function ma(i, e) { +function ba(i, e) { return i.reduce((t, n, l) => ((!e || n[0].toLowerCase().includes(e.toLowerCase())) && t.push(l), t), []); } -function Lm(i, e, t) { +function Ym(i, e, t) { i("change", e), t || i("input"); } -function Em(i, e, t) { +function Im(i, e, t) { if (i.key === "Escape") return [!1, e]; if ((i.key === "ArrowDown" || i.key === "ArrowUp") && t.length >= 0) @@ -6915,83 +6915,83 @@ function Em(i, e, t) { e = i.key === "ArrowDown" ? t[0] : t[t.length - 1]; else { const n = t.indexOf(e), l = i.key === "ArrowUp" ? -1 : 1; - e = t[Dm(n + l, t.length)]; + e = t[Xm(n + l, t.length)]; } return [!0, e]; } const { - SvelteComponent: Mm, - append: Qt, - attr: Ie, - binding_callbacks: Rm, - check_outros: Am, + SvelteComponent: Hm, + append: en, + attr: He, + binding_callbacks: Tm, + check_outros: jm, create_component: qs, - destroy_component: Ds, - detach: js, - element: Ln, - group_outros: Wm, - init: Hm, - insert: Fs, - listen: xn, - mount_component: Ls, - run_all: Im, - safe_not_equal: Tm, - set_data: Xm, - set_input_value: ga, - space: as, - text: Ym, - toggle_class: qn, - transition_in: En, - transition_out: oi -} = window.__gradio__svelte__internal, { onMount: jm } = window.__gradio__svelte__internal, { createEventDispatcher: Fm, afterUpdate: Um } = window.__gradio__svelte__internal; -function Vm(i) { + destroy_component: Ls, + detach: Fs, + element: Rn, + group_outros: Fm, + init: Um, + insert: Us, + listen: ei, + mount_component: Ms, + run_all: Vm, + safe_not_equal: Nm, + set_data: Om, + set_input_value: wa, + space: rs, + text: Pm, + toggle_class: Mn, + transition_in: An, + transition_out: ri +} = window.__gradio__svelte__internal, { onMount: Zm } = window.__gradio__svelte__internal, { createEventDispatcher: Gm, afterUpdate: Km } = window.__gradio__svelte__internal; +function Jm(i) { let e; return { c() { - e = Ym( + e = Pm( /*label*/ i[0] ); }, m(t, n) { - Fs(t, e, n); + Us(t, e, n); }, p(t, n) { n[0] & /*label*/ - 1 && Xm( + 1 && Om( e, /*label*/ t[0] ); }, d(t) { - t && js(e); + t && Fs(e); } }; } -function ba(i) { +function pa(i) { let e, t, n; - return t = new Rs({}), { + return t = new As({}), { c() { - e = Ln("div"), qs(t.$$.fragment), Ie(e, "class", "icon-wrap svelte-1m1zvyj"); + e = Rn("div"), qs(t.$$.fragment), He(e, "class", "icon-wrap svelte-1m1zvyj"); }, m(l, s) { - Fs(l, e, s), Ls(t, e, null), n = !0; + Us(l, e, s), Ms(t, e, null), n = !0; }, i(l) { - n || (En(t.$$.fragment, l), n = !0); + n || (An(t.$$.fragment, l), n = !0); }, o(l) { - oi(t.$$.fragment, l), n = !1; + ri(t.$$.fragment, l), n = !1; }, d(l) { - l && js(e), Ds(t); + l && Fs(e), Ls(t); } }; } -function Nm(i) { +function Qm(i) { let e, t, n, l, s, o, r, a, f, c, u, _, d, m; - t = new Na({ + t = new Pa({ props: { show_label: ( /*show_label*/ @@ -7001,13 +7001,13 @@ function Nm(i) { /*info*/ i[1] ), - $$slots: { default: [Vm] }, + $$slots: { default: [Jm] }, $$scope: { ctx: i } } }); let h = !/*disabled*/ - i[3] && ba(); - return u = new qm({ + i[3] && pa(); + return u = new Wm({ props: { show_options: ( /*show_options*/ @@ -7043,66 +7043,66 @@ function Nm(i) { i[16] ), { c() { - e = Ln("div"), qs(t.$$.fragment), n = as(), l = Ln("div"), s = Ln("div"), o = Ln("div"), r = Ln("input"), f = as(), h && h.c(), c = as(), qs(u.$$.fragment), Ie(r, "role", "listbox"), Ie(r, "aria-controls", "dropdown-options"), Ie( + e = Rn("div"), qs(t.$$.fragment), n = rs(), l = Rn("div"), s = Rn("div"), o = Rn("div"), r = Rn("input"), f = rs(), h && h.c(), c = rs(), qs(u.$$.fragment), He(r, "role", "listbox"), He(r, "aria-controls", "dropdown-options"), He( r, "aria-expanded", /*show_options*/ i[12] - ), Ie( + ), He( r, "aria-label", /*label*/ i[0] - ), Ie(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/ - i[3], Ie(r, "autocomplete", "off"), r.readOnly = a = !/*filterable*/ - i[7], qn(r, "subdued", !/*choices_names*/ + ), He(r, "class", "border-none svelte-1m1zvyj"), r.disabled = /*disabled*/ + i[3], He(r, "autocomplete", "off"), r.readOnly = a = !/*filterable*/ + i[7], Mn(r, "subdued", !/*choices_names*/ i[13].includes( /*input_text*/ i[9] ) && !/*allow_custom_value*/ - i[6]), Ie(o, "class", "secondary-wrap svelte-1m1zvyj"), Ie(s, "class", "wrap-inner svelte-1m1zvyj"), qn( + i[6]), He(o, "class", "secondary-wrap svelte-1m1zvyj"), He(s, "class", "wrap-inner svelte-1m1zvyj"), Mn( s, "show_options", /*show_options*/ i[12] - ), Ie(l, "class", "wrap svelte-1m1zvyj"), Ie(e, "class", "svelte-1m1zvyj"), qn( + ), He(l, "class", "wrap svelte-1m1zvyj"), He(e, "class", "svelte-1m1zvyj"), Mn( e, "container", /*container*/ i[5] ); }, - m(g, v) { - Fs(g, e, v), Ls(t, e, null), Qt(e, n), Qt(e, l), Qt(l, s), Qt(s, o), Qt(o, r), ga( + m(g, p) { + Us(g, e, p), Ms(t, e, null), en(e, n), en(e, l), en(l, s), en(s, o), en(o, r), wa( r, /*input_text*/ i[9] - ), i[29](r), Qt(o, f), h && h.m(o, null), Qt(l, c), Ls(u, l, null), _ = !0, d || (m = [ - xn( + ), i[29](r), en(o, f), h && h.m(o, null), en(l, c), Ms(u, l, null), _ = !0, d || (m = [ + ei( r, "input", /*input_input_handler*/ i[28] ), - xn( + ei( r, "keydown", /*handle_key_down*/ i[19] ), - xn( + ei( r, "keyup", /*keyup_handler*/ i[30] ), - xn( + ei( r, "blur", /*handle_blur*/ i[18] ), - xn( + ei( r, "focus", /*handle_focus*/ @@ -7110,71 +7110,71 @@ function Nm(i) { ) ], d = !0); }, - p(g, v) { + p(g, p) { const w = {}; - v[0] & /*show_label*/ + p[0] & /*show_label*/ 16 && (w.show_label = /*show_label*/ - g[4]), v[0] & /*info*/ + g[4]), p[0] & /*info*/ 2 && (w.info = /*info*/ - g[1]), v[0] & /*label*/ - 1 | v[1] & /*$$scope*/ - 4 && (w.$$scope = { dirty: v, ctx: g }), t.$set(w), (!_ || v[0] & /*show_options*/ - 4096) && Ie( + g[1]), p[0] & /*label*/ + 1 | p[1] & /*$$scope*/ + 4 && (w.$$scope = { dirty: p, ctx: g }), t.$set(w), (!_ || p[0] & /*show_options*/ + 4096) && He( r, "aria-expanded", /*show_options*/ g[12] - ), (!_ || v[0] & /*label*/ - 1) && Ie( + ), (!_ || p[0] & /*label*/ + 1) && He( r, "aria-label", /*label*/ g[0] - ), (!_ || v[0] & /*disabled*/ + ), (!_ || p[0] & /*disabled*/ 8) && (r.disabled = /*disabled*/ - g[3]), (!_ || v[0] & /*filterable*/ + g[3]), (!_ || p[0] & /*filterable*/ 128 && a !== (a = !/*filterable*/ - g[7])) && (r.readOnly = a), v[0] & /*input_text*/ + g[7])) && (r.readOnly = a), p[0] & /*input_text*/ 512 && r.value !== /*input_text*/ - g[9] && ga( + g[9] && wa( r, /*input_text*/ g[9] - ), (!_ || v[0] & /*choices_names, input_text, allow_custom_value*/ - 8768) && qn(r, "subdued", !/*choices_names*/ + ), (!_ || p[0] & /*choices_names, input_text, allow_custom_value*/ + 8768) && Mn(r, "subdued", !/*choices_names*/ g[13].includes( /*input_text*/ g[9] ) && !/*allow_custom_value*/ g[6]), /*disabled*/ - g[3] ? h && (Wm(), oi(h, 1, 1, () => { + g[3] ? h && (Fm(), ri(h, 1, 1, () => { h = null; - }), Am()) : h ? v[0] & /*disabled*/ - 8 && En(h, 1) : (h = ba(), h.c(), En(h, 1), h.m(o, null)), (!_ || v[0] & /*show_options*/ - 4096) && qn( + }), jm()) : h ? p[0] & /*disabled*/ + 8 && An(h, 1) : (h = pa(), h.c(), An(h, 1), h.m(o, null)), (!_ || p[0] & /*show_options*/ + 4096) && Mn( s, "show_options", /*show_options*/ g[12] ); const b = {}; - v[0] & /*show_options*/ + p[0] & /*show_options*/ 4096 && (b.show_options = /*show_options*/ - g[12]), v[0] & /*choices*/ + g[12]), p[0] & /*choices*/ 4 && (b.choices = /*choices*/ - g[2]), v[0] & /*filtered_indices*/ + g[2]), p[0] & /*filtered_indices*/ 1024 && (b.filtered_indices = /*filtered_indices*/ - g[10]), v[0] & /*disabled*/ + g[10]), p[0] & /*disabled*/ 8 && (b.disabled = /*disabled*/ - g[3]), v[0] & /*selected_index*/ + g[3]), p[0] & /*selected_index*/ 2048 && (b.selected_indices = /*selected_index*/ g[11] === null ? [] : [ /*selected_index*/ g[11] - ]), v[0] & /*active_index*/ + ]), p[0] & /*active_index*/ 16384 && (b.active_index = /*active_index*/ - g[14]), u.$set(b), (!_ || v[0] & /*container*/ - 32) && qn( + g[14]), u.$set(b), (!_ || p[0] & /*container*/ + 32) && Mn( e, "container", /*container*/ @@ -7182,69 +7182,69 @@ function Nm(i) { ); }, i(g) { - _ || (En(t.$$.fragment, g), En(h), En(u.$$.fragment, g), _ = !0); + _ || (An(t.$$.fragment, g), An(h), An(u.$$.fragment, g), _ = !0); }, o(g) { - oi(t.$$.fragment, g), oi(h), oi(u.$$.fragment, g), _ = !1; + ri(t.$$.fragment, g), ri(h), ri(u.$$.fragment, g), _ = !1; }, d(g) { - g && js(e), Ds(t), i[29](null), h && h.d(), Ds(u), d = !1, Im(m); + g && Fs(e), Ls(t), i[29](null), h && h.d(), Ls(u), d = !1, Vm(m); } }; } -function Om(i, e, t) { - let { label: n } = e, { info: l = void 0 } = e, { value: s = [] } = e, o = [], { value_is_output: r = !1 } = e, { choices: a } = e, f, { disabled: c = !1 } = e, { show_label: u } = e, { container: _ = !0 } = e, { allow_custom_value: d = !1 } = e, { filterable: m = !0 } = e, h, g = !1, v, w, b = "", k = "", p = !1, y = [], q = null, C = null, z; - const S = Fm(); - s ? (z = a.map((R) => R[1]).indexOf(s), C = z, C === -1 ? (o = s, C = null) : ([b, o] = a[C], k = b), A()) : a.length > 0 && (z = 0, C = 0, [b, s] = a[C], o = s, k = b); - function W() { - t(13, v = a.map((R) => R[0])), t(24, w = a.map((R) => R[1])); +function xm(i, e, t) { + let { label: n } = e, { info: l = void 0 } = e, { value: s = [] } = e, o = [], { value_is_output: r = !1 } = e, { choices: a } = e, f, { disabled: c = !1 } = e, { show_label: u } = e, { container: _ = !0 } = e, { allow_custom_value: d = !1 } = e, { filterable: m = !0 } = e, h, g = !1, p, w, b = "", k = "", v = !1, y = [], S = null, C = null, z; + const D = Gm(); + s ? (z = a.map((A) => A[1]).indexOf(s), C = z, C === -1 ? (o = s, C = null) : ([b, o] = a[C], k = b), W()) : a.length > 0 && (z = 0, C = 0, [b, s] = a[C], o = s, k = b); + function q() { + t(13, p = a.map((A) => A[0])), t(24, w = a.map((A) => A[1])); } - function A() { - W(), s === void 0 || Array.isArray(s) && s.length === 0 ? (t(9, b = ""), t(11, C = null)) : w.includes(s) ? (t(9, b = v[w.indexOf(s)]), t(11, C = w.indexOf(s))) : d ? (t(9, b = s), t(11, C = null)) : (t(9, b = ""), t(11, C = null)), t(27, z = C); + function W() { + q(), s === void 0 || Array.isArray(s) && s.length === 0 ? (t(9, b = ""), t(11, C = null)) : w.includes(s) ? (t(9, b = p[w.indexOf(s)]), t(11, C = w.indexOf(s))) : d ? (t(9, b = s), t(11, C = null)) : (t(9, b = ""), t(11, C = null)), t(27, z = C); } - function F(R) { - if (t(11, C = parseInt(R.detail.target.dataset.index)), isNaN(C)) { + function F(A) { + if (t(11, C = parseInt(A.detail.target.dataset.index)), isNaN(C)) { t(11, C = null); return; } - t(12, g = !1), t(14, q = null), h.blur(); + t(12, g = !1), t(14, S = null), h.blur(); } - function K(R) { - t(10, y = a.map((Z, x) => x)), t(12, g = !0), S("focus"); + function J(A) { + t(10, y = a.map((Q, ae) => ae)), t(12, g = !0), D("focus"); } - function ne() { - d ? t(20, s = b) : t(9, b = v[w.indexOf(s)]), t(12, g = !1), t(14, q = null), S("blur"); + function ie() { + d ? t(20, s = b) : t(9, b = p[w.indexOf(s)]), t(12, g = !1), t(14, S = null), D("blur"); } - function U(R) { - t(12, [g, q] = Em(R, q, y), g, (t(14, q), t(2, a), t(23, f), t(6, d), t(9, b), t(10, y), t(8, h), t(25, k), t(11, C), t(27, z), t(26, p), t(24, w))), R.key === "Enter" && (q !== null ? (t(11, C = q), t(12, g = !1), h.blur(), t(14, q = null)) : v.includes(b) ? (t(11, C = v.indexOf(b)), t(12, g = !1), t(14, q = null), h.blur()) : d && (t(20, s = b), t(11, C = null), t(12, g = !1), t(14, q = null), h.blur()), S("enter", s)); + function P(A) { + t(12, [g, S] = Im(A, S, y), g, (t(14, S), t(2, a), t(23, f), t(6, d), t(9, b), t(10, y), t(8, h), t(25, k), t(11, C), t(27, z), t(26, v), t(24, w))), A.key === "Enter" && (S !== null ? (t(11, C = S), t(12, g = !1), h.blur(), t(14, S = null)) : p.includes(b) ? (t(11, C = p.indexOf(b)), t(12, g = !1), t(14, S = null), h.blur()) : d && (t(20, s = b), t(11, C = null), t(12, g = !1), t(14, S = null), h.blur()), D("enter", s)); } - Um(() => { - t(21, r = !1), t(26, p = !0); - }), jm(() => { + Km(() => { + t(21, r = !1), t(26, v = !0); + }), Zm(() => { h.focus(); }); - function Q() { - b = this.value, t(9, b), t(11, C), t(27, z), t(26, p), t(2, a), t(24, w); + function $() { + b = this.value, t(9, b), t(11, C), t(27, z), t(26, v), t(2, a), t(24, w); } - function M(R) { - Rm[R ? "unshift" : "push"](() => { - h = R, t(8, h); + function R(A) { + Tm[A ? "unshift" : "push"](() => { + h = A, t(8, h); }); } - const V = (R) => S("key_up", { key: R.key, input_value: b }); - return i.$$set = (R) => { - "label" in R && t(0, n = R.label), "info" in R && t(1, l = R.info), "value" in R && t(20, s = R.value), "value_is_output" in R && t(21, r = R.value_is_output), "choices" in R && t(2, a = R.choices), "disabled" in R && t(3, c = R.disabled), "show_label" in R && t(4, u = R.show_label), "container" in R && t(5, _ = R.container), "allow_custom_value" in R && t(6, d = R.allow_custom_value), "filterable" in R && t(7, m = R.filterable); + const V = (A) => D("key_up", { key: A.key, input_value: b }); + return i.$$set = (A) => { + "label" in A && t(0, n = A.label), "info" in A && t(1, l = A.info), "value" in A && t(20, s = A.value), "value_is_output" in A && t(21, r = A.value_is_output), "choices" in A && t(2, a = A.choices), "disabled" in A && t(3, c = A.disabled), "show_label" in A && t(4, u = A.show_label), "container" in A && t(5, _ = A.container), "allow_custom_value" in A && t(6, d = A.allow_custom_value), "filterable" in A && t(7, m = A.filterable); }, i.$$.update = () => { i.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/ - 218105860 && C !== z && C !== null && p && (t(9, [b, s] = a[C], b, (t(20, s), t(11, C), t(27, z), t(26, p), t(2, a), t(24, w))), t(27, z = C), S("select", { + 218105860 && C !== z && C !== null && v && (t(9, [b, s] = a[C], b, (t(20, s), t(11, C), t(27, z), t(26, v), t(2, a), t(24, w))), t(27, z = C), D("select", { index: C, value: w[C], selected: !0 })), i.$$.dirty[0] & /*value, old_value, value_is_output*/ - 7340032 && s != o && (A(), Lm(S, s, r), t(22, o = s)), i.$$.dirty[0] & /*choices*/ - 4 && W(), i.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ - 8390468 && a !== f && (d || A(), t(23, f = a), t(10, y = ma(a, b)), !d && y.length > 0 && t(14, q = y[0]), h == document.activeElement && t(12, g = !0)), i.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ - 33556036 && b !== k && (t(10, y = ma(a, b)), t(25, k = b), !d && y.length > 0 && t(14, q = y[0])); + 7340032 && s != o && (W(), Ym(D, s, r), t(22, o = s)), i.$$.dirty[0] & /*choices*/ + 4 && q(), i.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ + 8390468 && a !== f && (d || W(), t(23, f = a), t(10, y = ba(a, b)), !d && y.length > 0 && t(14, S = y[0]), h == document.activeElement && t(12, g = !0)), i.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ + 33556036 && b !== k && (t(10, y = ba(a, b)), t(25, k = b), !d && y.length > 0 && t(14, S = y[0])); }, [ n, l, @@ -7259,34 +7259,34 @@ function Om(i, e, t) { y, C, g, - v, - q, + p, S, + D, F, - K, - ne, - U, + J, + ie, + P, s, r, o, f, w, k, - p, + v, z, - Q, - M, + $, + R, V ]; } -class Pm extends Mm { +class $m extends Hm { constructor(e) { - super(), Hm( + super(), Um( this, e, - Om, + xm, + Qm, Nm, - Tm, { label: 0, info: 1, @@ -7305,30 +7305,30 @@ class Pm extends Mm { } } const { - SvelteComponent: Zm, - append: Oe, - attr: Wn, + SvelteComponent: eg, + append: Ne, + attr: In, check_outros: Es, - create_component: an, - destroy_component: rn, - detach: On, + create_component: cn, + destroy_component: un, + detach: Gn, element: _t, - group_outros: Ms, - init: Gm, - insert: Pn, - listen: Km, - mount_component: fn, - safe_not_equal: Jm, + group_outros: Rs, + init: tg, + insert: Kn, + listen: ng, + mount_component: _n, + safe_not_equal: ig, set_style: Hn, - space: $n, - text: Us, - toggle_class: wa, - transition_in: ye, - transition_out: Xe -} = window.__gradio__svelte__internal, { createEventDispatcher: Qm } = window.__gradio__svelte__internal, { onMount: xm, onDestroy: $m } = window.__gradio__svelte__internal; -function va(i) { + space: ti, + text: Vs, + toggle_class: va, + transition_in: Se, + transition_out: je +} = window.__gradio__svelte__internal, { createEventDispatcher: lg } = window.__gradio__svelte__internal, { onMount: sg, onDestroy: og } = window.__gradio__svelte__internal; +function ka(i) { let e, t, n, l, s, o, r; - const a = [tg, eg], f = []; + const a = [rg, ag], f = []; function c(u, _) { return ( /*labelDetailLock*/ @@ -7337,7 +7337,7 @@ function va(i) { } return n = c(i), l = f[n] = a[n](i), { c() { - e = _t("div"), t = _t("button"), l.c(), Wn(t, "class", "icon svelte-d9x7u0"), Wn(t, "aria-label", "Lock label detail"), wa( + e = _t("div"), t = _t("button"), l.c(), In(t, "class", "icon svelte-d9x7u0"), In(t, "aria-label", "Lock label detail"), va( t, "selected", /*labelDetailLock*/ @@ -7345,7 +7345,7 @@ function va(i) { ), Hn(e, "margin-right", "8px"); }, m(u, _) { - Pn(u, e, _), Oe(e, t), f[n].m(t, null), s = !0, o || (r = Km( + Kn(u, e, _), Ne(e, t), f[n].m(t, null), s = !0, o || (r = ng( t, "click", /*onLockClick*/ @@ -7354,10 +7354,10 @@ function va(i) { }, p(u, _) { let d = n; - n = c(u), n !== d && (Ms(), Xe(f[d], 1, 1, () => { + n = c(u), n !== d && (Rs(), je(f[d], 1, 1, () => { f[d] = null; - }), Es(), l = f[n], l || (l = f[n] = a[n](u), l.c()), ye(l, 1), l.m(t, null)), (!s || _ & /*labelDetailLock*/ - 4) && wa( + }), Es(), l = f[n], l || (l = f[n] = a[n](u), l.c()), Se(l, 1), l.m(t, null)), (!s || _ & /*labelDetailLock*/ + 4) && va( t, "selected", /*labelDetailLock*/ @@ -7365,76 +7365,76 @@ function va(i) { ); }, i(u) { - s || (ye(l), s = !0); + s || (Se(l), s = !0); }, o(u) { - Xe(l), s = !1; + je(l), s = !1; }, d(u) { - u && On(e), f[n].d(), o = !1, r(); + u && Gn(e), f[n].d(), o = !1, r(); } }; } -function eg(i) { +function ag(i) { let e, t; - return e = new I0({}), { + return e = new V0({}), { c() { - an(e.$$.fragment); + cn(e.$$.fragment); }, m(n, l) { - fn(e, n, l), t = !0; + _n(e, n, l), t = !0; }, i(n) { - t || (ye(e.$$.fragment, n), t = !0); + t || (Se(e.$$.fragment, n), t = !0); }, o(n) { - Xe(e.$$.fragment, n), t = !1; + je(e.$$.fragment, n), t = !1; }, d(n) { - rn(e, n); + un(e, n); } }; } -function tg(i) { +function rg(i) { let e, t; - return e = new D0({}), { + return e = new X0({}), { c() { - an(e.$$.fragment); + cn(e.$$.fragment); }, m(n, l) { - fn(e, n, l), t = !0; + _n(e, n, l), t = !0; }, i(n) { - t || (ye(e.$$.fragment, n), t = !0); + t || (Se(e.$$.fragment, n), t = !0); }, o(n) { - Xe(e.$$.fragment, n), t = !1; + je(e.$$.fragment, n), t = !1; }, d(n) { - rn(e, n); + un(e, n); } }; } -function ng(i) { +function fg(i) { let e; return { c() { - e = Us("Cancel"); + e = Vs("Cancel"); }, m(t, n) { - Pn(t, e, n); + Kn(t, e, n); }, d(t) { - t && On(e); + t && Gn(e); } }; } -function pa(i) { +function ya(i) { let e, t, n; - return t = new Ss({ + return t = new zs({ props: { variant: "stop", - $$slots: { default: [ig] }, + $$slots: { default: [cg] }, $$scope: { ctx: i } } }), t.$on( @@ -7443,10 +7443,10 @@ function pa(i) { i[14] ), { c() { - e = _t("div"), an(t.$$.fragment), Hn(e, "margin-right", "8px"); + e = _t("div"), cn(t.$$.fragment), Hn(e, "margin-right", "8px"); }, m(l, s) { - Pn(l, e, s), fn(t, e, null), n = !0; + Kn(l, e, s), _n(t, e, null), n = !0; }, p(l, s) { const o = {}; @@ -7454,48 +7454,48 @@ function pa(i) { 262144 && (o.$$scope = { dirty: s, ctx: l }), t.$set(o); }, i(l) { - n || (ye(t.$$.fragment, l), n = !0); + n || (Se(t.$$.fragment, l), n = !0); }, o(l) { - Xe(t.$$.fragment, l), n = !1; + je(t.$$.fragment, l), n = !1; }, d(l) { - l && On(e), rn(t); + l && Gn(e), un(t); } }; } -function ig(i) { +function cg(i) { let e; return { c() { - e = Us("Remove"); + e = Vs("Remove"); }, m(t, n) { - Pn(t, e, n); + Kn(t, e, n); }, d(t) { - t && On(e); + t && Gn(e); } }; } -function lg(i) { +function ug(i) { let e; return { c() { - e = Us("OK"); + e = Vs("OK"); }, m(t, n) { - Pn(t, e, n); + Kn(t, e, n); }, d(t) { - t && On(e); + t && Gn(e); } }; } -function sg(i) { - let e, t, n, l, s, o, r, a, f, c, u, _, d, m, h, g, v, w = !/*showRemove*/ - i[4] && va(i); - o = new Pm({ +function _g(i) { + let e, t, n, l, s, o, r, a, f, c, u, _, d, m, h, g, p, w = !/*showRemove*/ + i[4] && ka(i); + o = new $m({ props: { value: ( /*currentLabel*/ @@ -7517,7 +7517,7 @@ function sg(i) { "enter", /*onDropDownEnter*/ i[8] - ), f = new em({ + ), f = new am({ props: { value: ( /*currentColor*/ @@ -7530,9 +7530,9 @@ function sg(i) { "change", /*onColorChange*/ i[7] - ), _ = new Ss({ + ), _ = new zs({ props: { - $$slots: { default: [ng] }, + $$slots: { default: [fg] }, $$scope: { ctx: i } } }), _.$on( @@ -7542,12 +7542,12 @@ function sg(i) { ); let b = ( /*showRemove*/ - i[4] && pa(i) + i[4] && ya(i) ); - return g = new Ss({ + return g = new zs({ props: { variant: "primary", - $$slots: { default: [lg] }, + $$slots: { default: [ug] }, $$scope: { ctx: i } } }), g.$on( @@ -7556,91 +7556,91 @@ function sg(i) { i[15] ), { c() { - e = _t("div"), t = _t("div"), n = _t("span"), w && w.c(), l = $n(), s = _t("div"), an(o.$$.fragment), r = $n(), a = _t("div"), an(f.$$.fragment), c = $n(), u = _t("div"), an(_.$$.fragment), d = $n(), b && b.c(), m = $n(), h = _t("div"), an(g.$$.fragment), Hn(s, "margin-right", "10px"), Hn(a, "margin-right", "40px"), Hn(a, "margin-bottom", "8px"), Hn(u, "margin-right", "8px"), Wn(n, "class", "model-content svelte-d9x7u0"), Wn(t, "class", "modal-container svelte-d9x7u0"), Wn(e, "class", "modal svelte-d9x7u0"), Wn(e, "id", "model-box-edit"); + e = _t("div"), t = _t("div"), n = _t("span"), w && w.c(), l = ti(), s = _t("div"), cn(o.$$.fragment), r = ti(), a = _t("div"), cn(f.$$.fragment), c = ti(), u = _t("div"), cn(_.$$.fragment), d = ti(), b && b.c(), m = ti(), h = _t("div"), cn(g.$$.fragment), Hn(s, "margin-right", "10px"), Hn(a, "margin-right", "40px"), Hn(a, "margin-bottom", "8px"), Hn(u, "margin-right", "8px"), In(n, "class", "model-content svelte-d9x7u0"), In(t, "class", "modal-container svelte-d9x7u0"), In(e, "class", "modal svelte-d9x7u0"), In(e, "id", "model-box-edit"); }, - m(k, p) { - Pn(k, e, p), Oe(e, t), Oe(t, n), w && w.m(n, null), Oe(n, l), Oe(n, s), fn(o, s, null), Oe(n, r), Oe(n, a), fn(f, a, null), Oe(n, c), Oe(n, u), fn(_, u, null), Oe(n, d), b && b.m(n, null), Oe(n, m), Oe(n, h), fn(g, h, null), v = !0; + m(k, v) { + Kn(k, e, v), Ne(e, t), Ne(t, n), w && w.m(n, null), Ne(n, l), Ne(n, s), _n(o, s, null), Ne(n, r), Ne(n, a), _n(f, a, null), Ne(n, c), Ne(n, u), _n(_, u, null), Ne(n, d), b && b.m(n, null), Ne(n, m), Ne(n, h), _n(g, h, null), p = !0; }, - p(k, [p]) { + p(k, [v]) { /*showRemove*/ - k[4] ? w && (Ms(), Xe(w, 1, 1, () => { + k[4] ? w && (Rs(), je(w, 1, 1, () => { w = null; - }), Es()) : w ? (w.p(k, p), p & /*showRemove*/ - 16 && ye(w, 1)) : (w = va(k), w.c(), ye(w, 1), w.m(n, l)); + }), Es()) : w ? (w.p(k, v), v & /*showRemove*/ + 16 && Se(w, 1)) : (w = ka(k), w.c(), Se(w, 1), w.m(n, l)); const y = {}; - p & /*currentLabel*/ + v & /*currentLabel*/ 1 && (y.value = /*currentLabel*/ - k[0]), p & /*choices*/ + k[0]), v & /*choices*/ 8 && (y.choices = /*choices*/ k[3]), o.$set(y); - const q = {}; - p & /*currentColor*/ - 2 && (q.value = /*currentColor*/ - k[1]), f.$set(q); + const S = {}; + v & /*currentColor*/ + 2 && (S.value = /*currentColor*/ + k[1]), f.$set(S); const C = {}; - p & /*$$scope*/ - 262144 && (C.$$scope = { dirty: p, ctx: k }), _.$set(C), /*showRemove*/ - k[4] ? b ? (b.p(k, p), p & /*showRemove*/ - 16 && ye(b, 1)) : (b = pa(k), b.c(), ye(b, 1), b.m(n, m)) : b && (Ms(), Xe(b, 1, 1, () => { + v & /*$$scope*/ + 262144 && (C.$$scope = { dirty: v, ctx: k }), _.$set(C), /*showRemove*/ + k[4] ? b ? (b.p(k, v), v & /*showRemove*/ + 16 && Se(b, 1)) : (b = ya(k), b.c(), Se(b, 1), b.m(n, m)) : b && (Rs(), je(b, 1, 1, () => { b = null; }), Es()); const z = {}; - p & /*$$scope*/ - 262144 && (z.$$scope = { dirty: p, ctx: k }), g.$set(z); + v & /*$$scope*/ + 262144 && (z.$$scope = { dirty: v, ctx: k }), g.$set(z); }, i(k) { - v || (ye(w), ye(o.$$.fragment, k), ye(f.$$.fragment, k), ye(_.$$.fragment, k), ye(b), ye(g.$$.fragment, k), v = !0); + p || (Se(w), Se(o.$$.fragment, k), Se(f.$$.fragment, k), Se(_.$$.fragment, k), Se(b), Se(g.$$.fragment, k), p = !0); }, o(k) { - Xe(w), Xe(o.$$.fragment, k), Xe(f.$$.fragment, k), Xe(_.$$.fragment, k), Xe(b), Xe(g.$$.fragment, k), v = !1; + je(w), je(o.$$.fragment, k), je(f.$$.fragment, k), je(_.$$.fragment, k), je(b), je(g.$$.fragment, k), p = !1; }, d(k) { - k && On(e), w && w.d(), rn(o), rn(f), rn(_), b && b.d(), rn(g); + k && Gn(e), w && w.d(), un(o), un(f), un(_), b && b.d(), un(g); } }; } -function og(i, e, t) { +function dg(i, e, t) { let { label: n = "" } = e, { currentLabel: l = "" } = e, { choices: s = [] } = e, { choicesColors: o = [] } = e, { color: r = "" } = e, { currentColor: a = "" } = e, { showRemove: f = !0 } = e, { labelDetailLock: c = !1 } = e; - const u = Qm(); - function _(p) { + const u = lg(); + function _(v) { u("change", { label: l, color: a, lock: c, - ret: p + ret: v // -1: remove, 0: cancel, 1: change }); } - function d(p) { - const { detail: y } = p; - let q = y; - Number.isInteger(q) ? (Array.isArray(o) && q < o.length && t(1, a = o[q]), Array.isArray(s) && q < s.length && t(0, l = s[q][0])) : t(0, l = q); + function d(v) { + const { detail: y } = v; + let S = y; + Number.isInteger(S) ? (Array.isArray(o) && S < o.length && t(1, a = o[S]), Array.isArray(s) && S < s.length && t(0, l = s[S][0])) : t(0, l = S); } - function m(p) { - const { detail: y } = p; + function m(v) { + const { detail: y } = v; t(1, a = y); } - function h(p) { - d(p), _(1); + function h(v) { + d(v), _(1); } - function g(p) { + function g(v) { t(2, c = !c); } - function v(p) { - switch (p.key) { + function p(v) { + switch (v.key) { case "Enter": _(1); break; } } - xm(() => { - document.addEventListener("keydown", v), t(0, l = n), t(1, a = r); - }), $m(() => { - document.removeEventListener("keydown", v); + sg(() => { + document.addEventListener("keydown", p), t(0, l = n), t(1, a = r); + }), og(() => { + document.removeEventListener("keydown", p); }); const w = () => _(0), b = () => _(-1), k = () => _(1); - return i.$$set = (p) => { - "label" in p && t(10, n = p.label), "currentLabel" in p && t(0, l = p.currentLabel), "choices" in p && t(3, s = p.choices), "choicesColors" in p && t(11, o = p.choicesColors), "color" in p && t(12, r = p.color), "currentColor" in p && t(1, a = p.currentColor), "showRemove" in p && t(4, f = p.showRemove), "labelDetailLock" in p && t(2, c = p.labelDetailLock); + return i.$$set = (v) => { + "label" in v && t(10, n = v.label), "currentLabel" in v && t(0, l = v.currentLabel), "choices" in v && t(3, s = v.choices), "choicesColors" in v && t(11, o = v.choicesColors), "color" in v && t(12, r = v.color), "currentColor" in v && t(1, a = v.currentColor), "showRemove" in v && t(4, f = v.showRemove), "labelDetailLock" in v && t(2, c = v.labelDetailLock); }, [ l, a, @@ -7660,9 +7660,9 @@ function og(i, e, t) { k ]; } -class Vs extends Zm { +class Ns extends eg { constructor(e) { - super(), Gm(this, e, og, sg, Jm, { + super(), tg(this, e, dg, _g, ig, { label: 10, currentLabel: 0, choices: 3, @@ -7674,8 +7674,8 @@ class Vs extends Zm { }); } } -const me = (i, e, t) => Math.min(Math.max(i, e), t); -function rs(i, e) { +const be = (i, e, t) => Math.min(Math.max(i, e), t); +function fs(i, e) { if (i.startsWith("rgba")) return i.replace(/[\d.]+$/, e.toString()); const t = i.match(/\d+/g); @@ -7684,61 +7684,61 @@ function rs(i, e) { const [n, l, s] = t; return `rgba(${n}, ${l}, ${s}, ${e})`; } -class fs { - constructor(e, t, n, l, s, o, r, a, f, c, u, _, d = "rgb(255, 255, 255)", m = 0.5, h = 25, g = 8, v = 2, w = 4, b = 1) { +class cs { + constructor(e, t, n, l, s, o, r, a, f, c, u, _, d, m = "rgb(255, 255, 255)", h = 0.5, g = 25, p = 8, w = 2, b = 4, k = 1) { this.stopDrag = () => { this.isDragging = !1, document.removeEventListener("pointermove", this.handleDrag), document.removeEventListener("pointerup", this.stopDrag); - }, this.handleDrag = (k) => { - if (this.isDragging) { - let p = (k.clientX - this.offsetMouseX) / this.canvasWindow.scale - this._xmin, y = (k.clientY - this.offsetMouseY) / this.canvasWindow.scale - this._ymin; - const q = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, C = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; - p = me(p, -this._xmin, q - this._xmax), y = me(y, -this._ymin, C - this._ymax), this._xmin += p, this._ymin += y, this._xmax += p, this._ymax += y, this.applyUserScale(), this.renderCallBack(); + }, this.handleDrag = (v) => { + if (this.isDragging && this.pointersCache.size === 1) { + let y = (v.clientX - this.offsetMouseX) / this.canvasWindow.scale - this._xmin, S = (v.clientY - this.offsetMouseY) / this.canvasWindow.scale - this._ymin; + const C = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, z = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; + y = be(y, -this._xmin, C - this._xmax), S = be(S, -this._ymin, z - this._ymax), this._xmin += y, this._ymin += S, this._xmax += y, this._ymax += S, this.applyUserScale(), this.renderCallBack(); } - }, this.handleCreating = (k) => { - if (this.isCreating) { - let [p, y] = this.toBoxCoordinates(k.clientX, k.clientY); - p = (p - this.offsetMouseX) / this.canvasWindow.scale, y = (y - this.offsetMouseY) / this.canvasWindow.scale, p > this._xmax ? (this.creatingAnchorX == "xmax" && (this._xmin = this._xmax), this._xmax = p, this.creatingAnchorX = "xmin") : p > this._xmin && p < this._xmax && this.creatingAnchorX == "xmin" ? this._xmax = p : p > this._xmin && p < this._xmax && this.creatingAnchorX == "xmax" ? this._xmin = p : p < this._xmin && (this.creatingAnchorX == "xmin" && (this._xmax = this._xmin), this._xmin = p, this.creatingAnchorX = "xmax"), y > this._ymax ? (this.creatingAnchorY == "ymax" && (this._ymin = this._ymax), this._ymax = y, this.creatingAnchorY = "ymin") : y > this._ymin && y < this._ymax && this.creatingAnchorY == "ymin" ? this._ymax = y : y > this._ymin && y < this._ymax && this.creatingAnchorY == "ymax" ? this._ymin = y : y < this._ymin && (this.creatingAnchorY == "ymin" && (this._ymax = this._ymin), this._ymin = y, this.creatingAnchorY = "ymax"), this.applyUserScale(), this.renderCallBack(); + }, this.handleCreating = (v) => { + if (this.isCreating && this.pointersCache.size === 1) { + let [y, S] = this.toBoxCoordinates(v.clientX, v.clientY); + y = (y - this.offsetMouseX) / this.canvasWindow.scale, S = (S - this.offsetMouseY) / this.canvasWindow.scale, y > this._xmax ? (this.creatingAnchorX == "xmax" && (this._xmin = this._xmax), this._xmax = y, this.creatingAnchorX = "xmin") : y > this._xmin && y < this._xmax && this.creatingAnchorX == "xmin" ? this._xmax = y : y > this._xmin && y < this._xmax && this.creatingAnchorX == "xmax" ? this._xmin = y : y < this._xmin && (this.creatingAnchorX == "xmin" && (this._xmax = this._xmin), this._xmin = y, this.creatingAnchorX = "xmax"), S > this._ymax ? (this.creatingAnchorY == "ymax" && (this._ymin = this._ymax), this._ymax = S, this.creatingAnchorY = "ymin") : S > this._ymin && S < this._ymax && this.creatingAnchorY == "ymin" ? this._ymax = S : S > this._ymin && S < this._ymax && this.creatingAnchorY == "ymax" ? this._ymin = S : S < this._ymin && (this.creatingAnchorY == "ymin" && (this._ymax = this._ymin), this._ymin = S, this.creatingAnchorY = "ymax"), this.applyUserScale(), this.renderCallBack(); } - }, this.stopCreating = (k) => { + }, this.stopCreating = (v) => { if (this.isCreating = !1, document.removeEventListener("pointermove", this.handleCreating), document.removeEventListener("pointerup", this.stopCreating), this.getArea() > 0) { - const p = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, y = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; - this._xmin = me(this._xmin, 0, p - this.minSize), this._ymin = me(this._ymin, 0, y - this.minSize), this._xmax = me(this._xmax, this.minSize, p), this._ymax = me(this._ymax, this.minSize, y), this.minSize > 0 && (this.getWidth() / this.canvasWindow.scale < this.minSize && (this.creatingAnchorX == "xmin" ? this._xmax = this._xmin + this.minSize : this._xmin = this._xmax - this.minSize), this.getHeight() / this.canvasWindow.scale < this.minSize && (this.creatingAnchorY == "ymin" ? this._ymax = this._ymin + this.minSize : this._ymin = this._ymax - this.minSize), this._xmax > p ? (this._xmin -= this._xmax - p, this._xmax = p) : this._xmin < 0 && (this._xmax -= this._xmin, this._xmin = 0), this._ymax > y ? (this._ymin -= this._ymax - y, this._ymax = y) : this._ymin < 0 && (this._ymax -= this._ymin, this._ymin = 0)), this.applyUserScale(), this.renderCallBack(); + const y = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, S = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; + this._xmin = be(this._xmin, 0, y - this.minSize), this._ymin = be(this._ymin, 0, S - this.minSize), this._xmax = be(this._xmax, this.minSize, y), this._ymax = be(this._ymax, this.minSize, S), this.minSize > 0 && (this.getWidth() / this.canvasWindow.scale < this.minSize && (this.creatingAnchorX == "xmin" ? this._xmax = this._xmin + this.minSize : this._xmin = this._xmax - this.minSize), this.getHeight() / this.canvasWindow.scale < this.minSize && (this.creatingAnchorY == "ymin" ? this._ymax = this._ymin + this.minSize : this._ymin = this._ymax - this.minSize), this._xmax > y ? (this._xmin -= this._xmax - y, this._xmax = y) : this._xmin < 0 && (this._xmax -= this._xmin, this._xmin = 0), this._ymax > S ? (this._ymin -= this._ymax - S, this._ymax = S) : this._ymin < 0 && (this._ymax -= this._ymin, this._ymin = 0)), this.applyUserScale(), this.renderCallBack(); } this.onFinishCreation(); - }, this.handleResize = (k) => { - if (this.isResizing) { - const p = k.clientX, y = k.clientY, q = (p - this.offsetMouseX - this.resizeHandles[this.resizingHandleIndex].xmin) / this.canvasWindow.scale, C = (y - this.offsetMouseY - this.resizeHandles[this.resizingHandleIndex].ymin) / this.canvasWindow.scale, z = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, S = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; + }, this.handleResize = (v) => { + if (this.isResizing && this.pointersCache.size === 1) { + const y = v.clientX, S = v.clientY, C = (y - this.offsetMouseX - this.resizeHandles[this.resizingHandleIndex].xmin) / this.canvasWindow.scale, z = (S - this.offsetMouseY - this.resizeHandles[this.resizingHandleIndex].ymin) / this.canvasWindow.scale, D = (this.canvasXmax - this.canvasXmin) / this.canvasWindow.scale, q = (this.canvasYmax - this.canvasYmin) / this.canvasWindow.scale; switch (this.resizingHandleIndex) { case 0: - this._xmin += q, this._ymin += C, this._xmin = me(this._xmin, 0, this._xmax - this.minSize), this._ymin = me(this._ymin, 0, this._ymax - this.minSize); + this._xmin += C, this._ymin += z, this._xmin = be(this._xmin, 0, this._xmax - this.minSize), this._ymin = be(this._ymin, 0, this._ymax - this.minSize); break; case 1: - this._xmax += q, this._ymin += C, this._xmax = me(this._xmax, this._xmin + this.minSize, z), this._ymin = me(this._ymin, 0, this._ymax - this.minSize); + this._xmax += C, this._ymin += z, this._xmax = be(this._xmax, this._xmin + this.minSize, D), this._ymin = be(this._ymin, 0, this._ymax - this.minSize); break; case 2: - this._xmax += q, this._ymax += C, this._xmax = me(this._xmax, this._xmin + this.minSize, z), this._ymax = me(this._ymax, this._ymin + this.minSize, S); + this._xmax += C, this._ymax += z, this._xmax = be(this._xmax, this._xmin + this.minSize, D), this._ymax = be(this._ymax, this._ymin + this.minSize, q); break; case 3: - this._xmin += q, this._ymax += C, this._xmin = me(this._xmin, 0, this._xmax - this.minSize), this._ymax = me(this._ymax, this._ymin + this.minSize, S); + this._xmin += C, this._ymax += z, this._xmin = be(this._xmin, 0, this._xmax - this.minSize), this._ymax = be(this._ymax, this._ymin + this.minSize, q); break; case 4: - this._ymin += C, this._ymin = me(this._ymin, 0, this._ymax - this.minSize); + this._ymin += z, this._ymin = be(this._ymin, 0, this._ymax - this.minSize); break; case 5: - this._xmax += q, this._xmax = me(this._xmax, this._xmin + this.minSize, z); + this._xmax += C, this._xmax = be(this._xmax, this._xmin + this.minSize, D); break; case 6: - this._ymax += C, this._ymax = me(this._ymax, this._ymin + this.minSize, S); + this._ymax += z, this._ymax = be(this._ymax, this._ymin + this.minSize, q); break; case 7: - this._xmin += q, this._xmin = me(this._xmin, 0, this._xmax - this.minSize); + this._xmin += C, this._xmin = be(this._xmin, 0, this._xmax - this.minSize); break; } this.applyUserScale(), this.renderCallBack(); } }, this.stopResize = () => { this.isResizing = !1, document.removeEventListener("pointermove", this.handleResize), document.removeEventListener("pointerup", this.stopResize); - }, this.renderCallBack = e, this.onFinishCreation = t, this.canvasWindow = n, this.canvasXmin = l, this.canvasYmin = s, this.canvasXmax = o, this.canvasYmax = r, this.scaleFactor = b, this.label = a, this.isDragging = !1, this.isCreating = !1, this._xmin = f, this._ymin = c, this._xmax = u, this._ymax = _, this.xmin = this._xmin * this.canvasWindow.scale, this.ymin = this._ymin * this.canvasWindow.scale, this.xmax = this._xmax * this.canvasWindow.scale, this.ymax = this._ymax * this.canvasWindow.scale, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = g, this.thickness = v, this.selectedThickness = w, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = h, this.color = d, this.alpha = m, this.creatingAnchorX = "xmin", this.creatingAnchorY = "ymin"; + }, this.renderCallBack = e, this.onFinishCreation = t, this.canvasWindow = n, this.pointersCache = l, this.canvasXmin = s, this.canvasYmin = o, this.canvasXmax = r, this.canvasYmax = a, this.scaleFactor = k, this.label = f, this.isDragging = !1, this.isCreating = !1, this._xmin = c, this._ymin = u, this._xmax = _, this._ymax = d, this.xmin = this._xmin * this.canvasWindow.scale, this.ymin = this._ymin * this.canvasWindow.scale, this.xmax = this._xmax * this.canvasWindow.scale, this.ymax = this._ymax * this.canvasWindow.scale, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = p, this.thickness = w, this.selectedThickness = b, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = g, this.color = m, this.alpha = h, this.creatingAnchorX = "xmin", this.creatingAnchorY = "ymin"; } toJSON() { return { @@ -7850,13 +7850,13 @@ class fs { } render(e) { let t, n; - if (this.updateOffset(), e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = rs(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = rs(this.color, 1), e.stroke(), e.closePath(), this.label !== null && this.label.trim() !== "") { + if (this.updateOffset(), e.beginPath(), [t, n] = this.toCanvasCoordinates(this.xmin, this.ymin), e.rect(t, n, this.getWidth(), this.getHeight()), e.fillStyle = fs(this.color, this.alpha), e.fill(), this.isSelected ? e.lineWidth = this.selectedThickness : e.lineWidth = this.thickness, e.strokeStyle = fs(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 l = e.measureText(this.label).width + 10, s = 20; let o = this.xmin, r = this.ymin - s; e.fillStyle = "white", [o, r] = this.toCanvasCoordinates(o, r), e.fillRect(o, r, l, s), e.lineWidth = 1, e.strokeStyle = "black", e.strokeRect(o, r, l, s), e.fillStyle = "black", e.fillText(this.label, o + 5, r + 15); } - e.fillStyle = rs(this.color, 1); + e.fillStyle = fs(this.color, 1); for (const l of this.resizeHandles) [t, n] = this.toCanvasCoordinates(l.xmin, l.ymin), e.fillRect( t, @@ -7899,7 +7899,7 @@ class fs { this.applyUserScale(); } } -const xt = [ +const tn = [ "rgb(255, 168, 77)", "rgb(92, 172, 238)", "rgb(255, 99, 71)", @@ -7914,19 +7914,23 @@ const xt = [ "rgb(255, 193, 7)", "rgb(255, 250, 138)" ], Hi = (i, e, t) => Math.min(Math.max(i, e), t); -class ag { - constructor(e) { +class hg { + constructor(e, t) { this.stopDrag = () => { - this.isDragging = !1, document.removeEventListener("pointermove", this.handleDrag), document.removeEventListener("pointerup", this.stopDrag); - }, this.handleDrag = (t) => { - if (this.isDragging) { - let n = t.clientX - this.startDragX - this.offsetX, l = t.clientY - this.startDragY - this.offsetY; - this.imageWidth * this.scale > this.canvasWidth ? n = Hi(n, this.canvasWidth - this.offsetX - this.imageWidth * this.scale, -this.offsetX) : n = Hi(n, -this.offsetX, this.canvasWidth - this.offsetX - this.imageWidth * this.scale), this.imageHeight * this.scale > this.canvasHeight ? l = Hi(l, this.canvasHeight - this.offsetY - this.imageHeight * this.scale, -this.offsetY) : l = Hi(l, -this.offsetY, this.canvasHeight - this.offsetY - this.imageHeight * this.scale), this.offsetX += n, this.offsetY += l, this.renderCallBack(); + this.pointersCache.size === 0 ? (this.isDragging = !1, document.removeEventListener("pointermove", this.handleDrag), document.removeEventListener("pointerup", this.stopDrag)) : this.pointersCache.size === 1 && (this.isDragging = !0, this.startDragX = this.pointersCache.values().next().value.clientX, this.startDragY = this.pointersCache.values().next().value.clientY); + }, this.handleDrag = (n) => { + if (this.isDragging && this.pointersCache.size === 1) { + if (this.scale == 1) { + this.offsetX = (this.canvasWidth - this.imageWidth) / 2, this.offsetY = 0, this.renderCallBack(); + return; + } + let l = n.clientX - this.startDragX, s = n.clientY - this.startDragY; + this.imageWidth * this.scale > this.canvasWidth ? l = Hi(l, this.canvasWidth - this.offsetX - this.imageWidth * this.scale, -this.offsetX) : l = Hi(l, -this.offsetX, this.canvasWidth - this.offsetX - this.imageWidth * this.scale), this.imageHeight * this.scale > this.canvasHeight ? s = Hi(s, this.canvasHeight - this.offsetY - this.imageHeight * this.scale, -this.offsetY) : s = Hi(s, -this.offsetY, this.canvasHeight - this.offsetY - this.imageHeight * this.scale), this.offsetX += l, this.offsetY += s, this.startDragX = n.clientX, this.startDragY = n.clientY, this.renderCallBack(); } - }, this.renderCallBack = e, this.scale = 1, this.offsetX = 0, this.offsetY = 0, this.canvasWidth = 0, this.canvasHeight = 0, this.imageWidth = 0, this.imageHeight = 0, this.imageRotatedWidth = 0, this.imageRotatedHeight = 0, this.isDragging = !1, this.startDragX = 0, this.startDragY = 0, this.orientation = 0; + }, this.renderCallBack = e, this.pointersCache = t, this.scale = 1, this.offsetX = 0, this.offsetY = 0, this.canvasWidth = 0, this.canvasHeight = 0, this.imageWidth = 0, this.imageHeight = 0, this.imageRotatedWidth = 0, this.imageRotatedHeight = 0, this.isDragging = !1, this.startDragX = 0, this.startDragY = 0, this.orientation = 0; } startDrag(e) { - this.isDragging = !0, this.startDragX = e.clientX - this.offsetX, this.startDragY = e.clientY - this.offsetY, document.addEventListener("pointermove", this.handleDrag), document.addEventListener("pointerup", this.stopDrag); + this.isDragging = !0, this.startDragX = e.clientX, this.startDragY = e.clientY, document.addEventListener("pointermove", this.handleDrag), document.addEventListener("pointerup", this.stopDrag); } setRotatedImage(e) { e !== null && (this.orientation == 0 || this.orientation == 2 ? (this.imageRotatedWidth = e.width, this.imageRotatedHeight = e.height) : (this.imageRotatedWidth = e.height, this.imageRotatedHeight = e.width)); @@ -7936,177 +7940,176 @@ class ag { } } const { - SvelteComponent: rg, + SvelteComponent: mg, append: ut, - attr: pe, - binding_callbacks: fg, - bubble: cs, - check_outros: In, - create_component: zt, - destroy_component: Bt, - detach: kt, - element: Ct, - empty: cg, - group_outros: Tn, - init: ug, - insert: yt, - is_function: _g, - listen: Ye, - mount_component: qt, - noop: Or, - run_all: Pr, - safe_not_equal: dg, - set_style: Ii, - space: St, - toggle_class: Ti, + attr: ye, + binding_callbacks: gg, + bubble: us, + check_outros: Tn, + create_component: qt, + destroy_component: Lt, + detach: St, + element: Bt, + empty: bg, + group_outros: jn, + init: wg, + insert: zt, + listen: Me, + mount_component: Mt, + noop: Zr, + run_all: Gr, + safe_not_equal: pg, + set_style: Ti, + space: Dt, + toggle_class: ji, transition_in: te, - transition_out: re -} = window.__gradio__svelte__internal, { onMount: hg, onDestroy: mg, createEventDispatcher: gg } = window.__gradio__svelte__internal; -function ka(i) { - let e, t, n, l, s, o, r, a, f, c, u, _, d, m, h, g, v; - n = new Qh({}), o = new s0({}); + transition_out: ue +} = window.__gradio__svelte__internal, { onMount: vg, onDestroy: kg, createEventDispatcher: yg } = window.__gradio__svelte__internal; +function Ca(i) { + let e, t, n, l, s, o, r, a, f, c, u, _, d, m, h, g, p; + n = new l0({}), o = new _0({}); let w = ( /*showRemoveButton*/ - i[1] && ya(i) + i[1] && Sa(i) ), b = !/*disableEditBoxes*/ i[5] && /*labelDetailLock*/ - i[16] && Ca(i); - return u = new L_({}), m = new h_({}), { + i[15] && za(i); + return u = new Y_({}), m = new k_({}), { c() { - e = Ct("span"), t = Ct("button"), zt(n.$$.fragment), l = St(), s = Ct("button"), zt(o.$$.fragment), r = St(), w && w.c(), a = St(), b && b.c(), f = St(), c = Ct("button"), zt(u.$$.fragment), _ = St(), d = Ct("button"), zt(m.$$.fragment), pe(t, "class", "icon svelte-1m8vz1h"), pe(t, "aria-label", "Create box"), Ti( + e = Bt("span"), t = Bt("button"), qt(n.$$.fragment), l = Dt(), s = Bt("button"), qt(o.$$.fragment), r = Dt(), w && w.c(), a = Dt(), b && b.c(), f = Dt(), c = Bt("button"), qt(u.$$.fragment), _ = Dt(), d = Bt("button"), qt(m.$$.fragment), ye(t, "class", "icon svelte-1m8vz1h"), ye(t, "aria-label", "Create box"), ji( t, "selected", /*mode*/ - i[12] === /*Mode*/ - i[9].creation - ), pe(s, "class", "icon svelte-1m8vz1h"), pe(s, "aria-label", "Edit boxes"), Ti( + i[11] === /*Mode*/ + i[8].creation + ), ye(s, "class", "icon svelte-1m8vz1h"), ye(s, "aria-label", "Edit boxes"), ji( s, "selected", /*mode*/ - i[12] === /*Mode*/ - i[9].drag - ), pe(c, "class", "icon svelte-1m8vz1h"), pe(c, "aria-label", "Rotate counterclockwise"), pe(d, "class", "icon svelte-1m8vz1h"), pe(d, "aria-label", "Rotate clockwise"), pe(e, "class", "canvas-control svelte-1m8vz1h"); + i[11] === /*Mode*/ + i[8].drag + ), ye(c, "class", "icon svelte-1m8vz1h"), ye(c, "aria-label", "Rotate counterclockwise"), ye(d, "class", "icon svelte-1m8vz1h"), ye(d, "aria-label", "Rotate clockwise"), ye(e, "class", "canvas-control svelte-1m8vz1h"); }, - m(k, p) { - yt(k, e, p), ut(e, t), qt(n, t, null), ut(e, l), ut(e, s), qt(o, s, null), ut(e, r), w && w.m(e, null), ut(e, a), b && b.m(e, null), ut(e, f), ut(e, c), qt(u, c, null), ut(e, _), ut(e, d), qt(m, d, null), h = !0, g || (v = [ - Ye( + m(k, v) { + zt(k, e, v), ut(e, t), Mt(n, t, null), ut(e, l), ut(e, s), Mt(o, s, null), ut(e, r), w && w.m(e, null), ut(e, a), b && b.m(e, null), ut(e, f), ut(e, c), Mt(u, c, null), ut(e, _), ut(e, d), Mt(m, d, null), h = !0, g || (p = [ + Me( t, "click", /*click_handler*/ - i[40] + i[41] ), - Ye( + Me( s, "click", /*click_handler_1*/ - i[41] + i[42] ), - Ye( + Me( c, "click", /*click_handler_4*/ - i[44] + i[45] ), - Ye( + Me( d, "click", /*click_handler_5*/ - i[45] + i[46] ) ], g = !0); }, - p(k, p) { - (!h || p[0] & /*mode, Mode*/ - 4608) && Ti( + p(k, v) { + (!h || v[0] & /*mode, Mode*/ + 2304) && ji( t, "selected", /*mode*/ - k[12] === /*Mode*/ - k[9].creation - ), (!h || p[0] & /*mode, Mode*/ - 4608) && Ti( + k[11] === /*Mode*/ + k[8].creation + ), (!h || v[0] & /*mode, Mode*/ + 2304) && ji( s, "selected", /*mode*/ - k[12] === /*Mode*/ - k[9].drag + k[11] === /*Mode*/ + k[8].drag ), /*showRemoveButton*/ - k[1] ? w ? (w.p(k, p), p[0] & /*showRemoveButton*/ - 2 && te(w, 1)) : (w = ya(k), w.c(), te(w, 1), w.m(e, a)) : w && (Tn(), re(w, 1, 1, () => { + k[1] ? w ? (w.p(k, v), v[0] & /*showRemoveButton*/ + 2 && te(w, 1)) : (w = Sa(k), w.c(), te(w, 1), w.m(e, a)) : w && (jn(), ue(w, 1, 1, () => { w = null; - }), In()), !/*disableEditBoxes*/ + }), Tn()), !/*disableEditBoxes*/ k[5] && /*labelDetailLock*/ - k[16] ? b ? (b.p(k, p), p[0] & /*disableEditBoxes, labelDetailLock*/ - 65568 && te(b, 1)) : (b = Ca(k), b.c(), te(b, 1), b.m(e, f)) : b && (Tn(), re(b, 1, 1, () => { + k[15] ? b ? (b.p(k, v), v[0] & /*disableEditBoxes, labelDetailLock*/ + 32800 && te(b, 1)) : (b = za(k), b.c(), te(b, 1), b.m(e, f)) : b && (jn(), ue(b, 1, 1, () => { b = null; - }), In()); + }), Tn()); }, i(k) { h || (te(n.$$.fragment, k), te(o.$$.fragment, k), te(w), te(b), te(u.$$.fragment, k), te(m.$$.fragment, k), h = !0); }, o(k) { - re(n.$$.fragment, k), re(o.$$.fragment, k), re(w), re(b), re(u.$$.fragment, k), re(m.$$.fragment, k), h = !1; + ue(n.$$.fragment, k), ue(o.$$.fragment, k), ue(w), ue(b), ue(u.$$.fragment, k), ue(m.$$.fragment, k), h = !1; }, d(k) { - k && kt(e), Bt(n), Bt(o), w && w.d(), b && b.d(), Bt(u), Bt(m), g = !1, Pr(v); + k && St(e), Lt(n), Lt(o), w && w.d(), b && b.d(), Lt(u), Lt(m), g = !1, Gr(p); } }; } -function ya(i) { +function Sa(i) { let e, t, n, l, s; - return t = new d0({}), { + return t = new v0({}), { c() { - e = Ct("button"), zt(t.$$.fragment), pe(e, "class", "icon svelte-1m8vz1h"), pe(e, "aria-label", "Remove boxes"); + e = Bt("button"), qt(t.$$.fragment), ye(e, "class", "icon svelte-1m8vz1h"), ye(e, "aria-label", "Remove boxes"); }, m(o, r) { - yt(o, e, r), qt(t, e, null), n = !0, l || (s = Ye( + zt(o, e, r), Mt(t, e, null), n = !0, l || (s = Me( e, "click", /*click_handler_2*/ - i[42] + i[43] ), l = !0); }, - p: Or, + p: Zr, i(o) { n || (te(t.$$.fragment, o), n = !0); }, o(o) { - re(t.$$.fragment, o), n = !1; + ue(t.$$.fragment, o), n = !1; }, d(o) { - o && kt(e), Bt(t), l = !1, s(); + o && St(e), Lt(t), l = !1, s(); } }; } -function Ca(i) { +function za(i) { let e, t, n, l, s; - return t = new p0({}), { + return t = new D0({}), { c() { - e = Ct("button"), zt(t.$$.fragment), pe(e, "class", "icon svelte-1m8vz1h"), pe(e, "aria-label", "Edit label"); + e = Bt("button"), qt(t.$$.fragment), ye(e, "class", "icon svelte-1m8vz1h"), ye(e, "aria-label", "Edit label"); }, m(o, r) { - yt(o, e, r), qt(t, e, null), n = !0, l || (s = Ye( + zt(o, e, r), Mt(t, e, null), n = !0, l || (s = Me( e, "click", /*click_handler_3*/ - i[43] + i[44] ), l = !0); }, - p: Or, + p: Zr, i(o) { n || (te(t.$$.fragment, o), n = !0); }, o(o) { - re(t.$$.fragment, o), n = !1; + ue(t.$$.fragment, o), n = !1; }, d(o) { - o && kt(e), Bt(t), l = !1, s(); + o && St(e), Lt(t), l = !1, s(); } }; } -function Sa(i) { +function Ba(i) { let e, t; - return e = new Vs({ + return e = new Ns({ props: { choices: ( /*choices*/ @@ -8118,25 +8121,25 @@ function Sa(i) { ), label: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ i[0].boxes.length ? ( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].label ) : "" ), color: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ - i[0].boxes.length ? mn( + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ + i[0].boxes.length ? wn( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].color ) : "" ) @@ -8148,13 +8151,13 @@ function Sa(i) { ), e.$on( "enter{onModalEditChange}", /*enter_onModalEditChange_handler*/ - i[46] + i[47] ), { c() { - zt(e.$$.fragment); + qt(e.$$.fragment); }, m(n, l) { - qt(e, n, l), t = !0; + Mt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -8163,24 +8166,24 @@ function Sa(i) { n[3]), l[0] & /*choicesColors*/ 16 && (s.choicesColors = /*choicesColors*/ n[4]), l[0] & /*selectedBox, value*/ - 2049 && (s.label = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ + 1025 && (s.label = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? ( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].label ) : ""), l[0] & /*selectedBox, value*/ - 2049 && (s.color = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ - n[0].boxes.length ? mn( + 1025 && (s.color = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ + n[0].boxes.length ? wn( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].color ) : ""), e.$set(s); }, @@ -8188,16 +8191,16 @@ function Sa(i) { t || (te(e.$$.fragment, n), t = !0); }, o(n) { - re(e.$$.fragment, n), t = !1; + ue(e.$$.fragment, n), t = !1; }, d(n) { - Bt(e, n); + Lt(e, n); } }; } -function za(i) { +function Da(i) { let e, t; - return e = new Vs({ + return e = new Ns({ props: { choices: ( /*choices*/ @@ -8210,31 +8213,31 @@ function za(i) { ), label: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ i[0].boxes.length ? ( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].label ) : "" ), color: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ - i[0].boxes.length ? mn( + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ + i[0].boxes.length ? wn( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].color ) : "" ), labelDetailLock: ( /*labelDetailLock*/ - i[16] + i[15] ) } }), e.$on( @@ -8244,13 +8247,13 @@ function za(i) { ), e.$on( "enter{onModalNewChange}", /*enter_onModalNewChange_handler*/ - i[47] + i[48] ), { c() { - zt(e.$$.fragment); + qt(e.$$.fragment); }, m(n, l) { - qt(e, n, l), t = !0; + Mt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -8259,43 +8262,43 @@ function za(i) { n[3]), l[0] & /*choicesColors*/ 16 && (s.choicesColors = /*choicesColors*/ n[4]), l[0] & /*selectedBox, value*/ - 2049 && (s.label = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ + 1025 && (s.label = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? ( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].label ) : ""), l[0] & /*selectedBox, value*/ - 2049 && (s.color = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ - n[0].boxes.length ? mn( + 1025 && (s.color = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ + n[0].boxes.length ? wn( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].color ) : ""), l[0] & /*labelDetailLock*/ - 65536 && (s.labelDetailLock = /*labelDetailLock*/ - n[16]), e.$set(s); + 32768 && (s.labelDetailLock = /*labelDetailLock*/ + n[15]), e.$set(s); }, i(n) { t || (te(e.$$.fragment, n), t = !0); }, o(n) { - re(e.$$.fragment, n), t = !1; + ue(e.$$.fragment, n), t = !1; }, d(n) { - Bt(e, n); + Lt(e, n); } }; } -function Ba(i) { +function qa(i) { let e, t; - return e = new Vs({ + return e = new Ns({ props: { choices: ( /*choices*/ @@ -8308,31 +8311,31 @@ function Ba(i) { ), label: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ i[0].boxes.length ? ( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].label ) : "" ), color: ( /*selectedBox*/ - i[11] >= 0 && /*selectedBox*/ - i[11] < /*value*/ - i[0].boxes.length ? mn( + i[10] >= 0 && /*selectedBox*/ + i[10] < /*value*/ + i[0].boxes.length ? wn( /*value*/ i[0].boxes[ /*selectedBox*/ - i[11] + i[10] ].color ) : "" ), labelDetailLock: ( /*labelDetailLock*/ - i[16] + i[15] ) } }), e.$on( @@ -8342,13 +8345,13 @@ function Ba(i) { ), e.$on( "enter{onDefaultLabelEditChange}", /*enter_onDefaultLabelEditChange_handler*/ - i[48] + i[49] ), { c() { - zt(e.$$.fragment); + qt(e.$$.fragment); }, m(n, l) { - qt(e, n, l), t = !0; + Mt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -8357,114 +8360,113 @@ function Ba(i) { n[3]), l[0] & /*choicesColors*/ 16 && (s.choicesColors = /*choicesColors*/ n[4]), l[0] & /*selectedBox, value*/ - 2049 && (s.label = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ + 1025 && (s.label = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ n[0].boxes.length ? ( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].label ) : ""), l[0] & /*selectedBox, value*/ - 2049 && (s.color = /*selectedBox*/ - n[11] >= 0 && /*selectedBox*/ - n[11] < /*value*/ - n[0].boxes.length ? mn( + 1025 && (s.color = /*selectedBox*/ + n[10] >= 0 && /*selectedBox*/ + n[10] < /*value*/ + n[0].boxes.length ? wn( /*value*/ n[0].boxes[ /*selectedBox*/ - n[11] + n[10] ].color ) : ""), l[0] & /*labelDetailLock*/ - 65536 && (s.labelDetailLock = /*labelDetailLock*/ - n[16]), e.$set(s); + 32768 && (s.labelDetailLock = /*labelDetailLock*/ + n[15]), e.$set(s); }, i(n) { t || (te(e.$$.fragment, n), t = !0); }, o(n) { - re(e.$$.fragment, n), t = !1; + ue(e.$$.fragment, n), t = !1; }, d(n) { - Bt(e, n); + Lt(e, n); } }; } -function bg(i) { +function Cg(i) { let e, t, n, l, s, o, r, a, f, c, u = ( /*interactive*/ - i[2] && ka(i) + i[2] && Ca(i) ), _ = ( /*editModalVisible*/ - i[13] && Sa(i) + i[12] && Ba(i) ), d = ( /*newModalVisible*/ - i[14] && za(i) + i[13] && Da(i) ), m = ( /*editDefaultLabelVisible*/ - i[15] && Ba(i) + i[14] && qa(i) ); return { c() { - e = Ct("div"), t = Ct("canvas"), n = St(), u && u.c(), l = St(), _ && _.c(), s = St(), d && d.c(), o = St(), m && m.c(), r = cg(), Ii( + e = Bt("div"), t = Bt("canvas"), n = Dt(), u && u.c(), l = Dt(), _ && _.c(), s = Dt(), d && d.c(), o = Dt(), m && m.c(), r = bg(), Ti( t, "height", /*height*/ i[6] - ), Ii( + ), Ti( t, "width", /*width*/ i[7] - ), pe(t, "class", "canvas-annotator svelte-1m8vz1h"), pe(e, "class", "canvas-container svelte-1m8vz1h"), pe(e, "tabindex", "-1"); + ), ye(t, "class", "canvas-annotator svelte-1m8vz1h"), ye(e, "class", "canvas-container svelte-1m8vz1h"), ye(e, "tabindex", "-1"); }, m(h, g) { - yt(h, e, g), ut(e, t), i[39](t), yt(h, n, g), u && u.m(h, g), yt(h, l, g), _ && _.m(h, g), yt(h, s, g), d && d.m(h, g), yt(h, o, g), m && m.m(h, g), yt(h, r, g), a = !0, f || (c = [ - Ye( + zt(h, e, g), ut(e, t), i[40](t), zt(h, n, g), u && u.m(h, g), zt(h, l, g), _ && _.m(h, g), zt(h, s, g), d && d.m(h, g), zt(h, o, g), m && m.m(h, g), zt(h, r, g), a = !0, f || (c = [ + Me( t, "pointerdown", /*handlePointerDown*/ - i[17] + i[16] ), - Ye( + Me( t, "pointerup", /*handlePointerUp*/ + i[17] + ), + Me( + t, + "pointermove", + /*handlePointerMove*/ + i[19] + ), + Me( + t, + "pointercancel", + /*handlePointerCancel*/ i[18] ), - Ye(t, "pointermove", function() { - _g( - /*handlesCursor*/ - i[8] ? ( - /*handlePointerMove*/ - i[19] - ) : null - ) && /*handlesCursor*/ - (i[8] ? ( - /*handlePointerMove*/ - i[19] - ) : null).apply(this, arguments); - }), - Ye( + Me( t, "dblclick", /*handleDoubleClick*/ i[23] ), - Ye( + Me( t, "wheel", /*handleMouseWheel*/ i[20] ), - Ye( + Me( e, "focusin", /*handleCanvasFocus*/ i[29] ), - Ye( + Me( e, "focusout", /*handleCanvasBlur*/ @@ -8473,81 +8475,81 @@ function bg(i) { ], f = !0); }, p(h, g) { - i = h, (!a || g[0] & /*height*/ - 64) && Ii( + (!a || g[0] & /*height*/ + 64) && Ti( t, "height", /*height*/ - i[6] + h[6] ), (!a || g[0] & /*width*/ - 128) && Ii( + 128) && Ti( t, "width", /*width*/ - i[7] + h[7] ), /*interactive*/ - i[2] ? u ? (u.p(i, g), g[0] & /*interactive*/ - 4 && te(u, 1)) : (u = ka(i), u.c(), te(u, 1), u.m(l.parentNode, l)) : u && (Tn(), re(u, 1, 1, () => { + h[2] ? u ? (u.p(h, g), g[0] & /*interactive*/ + 4 && te(u, 1)) : (u = Ca(h), u.c(), te(u, 1), u.m(l.parentNode, l)) : u && (jn(), ue(u, 1, 1, () => { u = null; - }), In()), /*editModalVisible*/ - i[13] ? _ ? (_.p(i, g), g[0] & /*editModalVisible*/ - 8192 && te(_, 1)) : (_ = Sa(i), _.c(), te(_, 1), _.m(s.parentNode, s)) : _ && (Tn(), re(_, 1, 1, () => { + }), Tn()), /*editModalVisible*/ + h[12] ? _ ? (_.p(h, g), g[0] & /*editModalVisible*/ + 4096 && te(_, 1)) : (_ = Ba(h), _.c(), te(_, 1), _.m(s.parentNode, s)) : _ && (jn(), ue(_, 1, 1, () => { _ = null; - }), In()), /*newModalVisible*/ - i[14] ? d ? (d.p(i, g), g[0] & /*newModalVisible*/ - 16384 && te(d, 1)) : (d = za(i), d.c(), te(d, 1), d.m(o.parentNode, o)) : d && (Tn(), re(d, 1, 1, () => { + }), Tn()), /*newModalVisible*/ + h[13] ? d ? (d.p(h, g), g[0] & /*newModalVisible*/ + 8192 && te(d, 1)) : (d = Da(h), d.c(), te(d, 1), d.m(o.parentNode, o)) : d && (jn(), ue(d, 1, 1, () => { d = null; - }), In()), /*editDefaultLabelVisible*/ - i[15] ? m ? (m.p(i, g), g[0] & /*editDefaultLabelVisible*/ - 32768 && te(m, 1)) : (m = Ba(i), m.c(), te(m, 1), m.m(r.parentNode, r)) : m && (Tn(), re(m, 1, 1, () => { + }), Tn()), /*editDefaultLabelVisible*/ + h[14] ? m ? (m.p(h, g), g[0] & /*editDefaultLabelVisible*/ + 16384 && te(m, 1)) : (m = qa(h), m.c(), te(m, 1), m.m(r.parentNode, r)) : m && (jn(), ue(m, 1, 1, () => { m = null; - }), In()); + }), Tn()); }, i(h) { a || (te(u), te(_), te(d), te(m), a = !0); }, o(h) { - re(u), re(_), re(d), re(m), a = !1; + ue(u), ue(_), ue(d), ue(m), a = !1; }, d(h) { - h && (kt(e), kt(n), kt(l), kt(s), kt(o), kt(r)), i[39](null), u && u.d(h), _ && _.d(h), d && d.d(h), m && m.d(h), f = !1, Pr(c); + h && (St(e), St(n), St(l), St(s), St(o), St(r)), i[40](null), u && u.d(h), _ && _.d(h), d && d.d(h), m && m.d(h), f = !1, Gr(c); } }; } -function Xi(i) { +function Fi(i) { var e = parseInt(i.slice(1, 3), 16), t = parseInt(i.slice(3, 5), 16), n = parseInt(i.slice(5, 7), 16); return "rgb(" + e + ", " + t + ", " + n + ")"; } -function mn(i) { +function wn(i) { const e = i.match(/(\d+(\.\d+)?)/g), t = parseInt(e[0]), n = parseInt(e[1]), l = parseInt(e[2]); return "#" + (1 << 24 | t << 16 | n << 8 | l).toString(16).slice(1); } -function wg(i, e, t) { +function Sg(i, e, t) { var n; (function(B) { B[B.creation = 0] = "creation", B[B.drag = 1] = "drag"; })(n || (n = {})); - let { imageUrl: l = null } = e, { interactive: s } = e, { boxAlpha: o = 0.5 } = e, { boxMinSize: r = 10 } = e, { handleSize: a } = e, { boxThickness: f } = e, { boxSelectedThickness: c } = e, { value: u } = e, { choices: _ = [] } = e, { choicesColors: d = [] } = e, { disableEditBoxes: m = !1 } = e, { height: h = "100%" } = e, { width: g = "100%" } = e, { singleBox: v = !1 } = e, { showRemoveButton: w = null } = e, { handlesCursor: b = !0 } = e, { useDefaultLabel: k = !1 } = e; + let { imageUrl: l = null } = e, { interactive: s } = e, { boxAlpha: o = 0.5 } = e, { boxMinSize: r = 10 } = e, { handleSize: a } = e, { boxThickness: f } = e, { boxSelectedThickness: c } = e, { value: u } = e, { choices: _ = [] } = e, { choicesColors: d = [] } = e, { disableEditBoxes: m = !1 } = e, { height: h = "100%" } = e, { width: g = "100%" } = e, { singleBox: p = !1 } = e, { showRemoveButton: w = null } = e, { handlesCursor: b = !0 } = e, { useDefaultLabel: k = !1 } = e; w === null && (w = m); - let p, y, q = null, C = -1, z = n.drag, S = new ag(O); + let v, y, S = null, C = -1, z = n.drag, D = /* @__PURE__ */ new Map(), q = new hg(ne, D); u !== null && u.boxes.length == 0 && (z = n.creation); - let W = 0, A = 0, F = 0, K = 0, ne = 1, U = 0, Q = 0, M = !1, V = !1, R = !1, Z = k, x = { label: "", color: "" }; - const J = gg(); - function O() { + let W = 0, F = 0, J = 0, ie = 0, P = 1, $ = 0, R = 0, V = !1, A = !1, Q = !1, ae = k, Z = { label: "", color: "" }, G = { x: 0, y: 0, distance: 0 }; + const X = yg(); + function ne() { if (y) { - if (y.clearRect(0, 0, p.width, p.height), y.save(), y.translate(S.offsetX, S.offsetY), y.scale(S.scale, S.scale), q !== null) { + if (y.clearRect(0, 0, v.width, v.height), y.save(), y.translate(q.offsetX, q.offsetY), y.scale(q.scale, q.scale), S !== null) { switch (u.orientation) { case 0: - y.drawImage(q, 0, 0, U, Q); + y.drawImage(S, 0, 0, $, R); break; case 1: - y.translate(U, 0), y.rotate(Math.PI / 2), y.drawImage(q, 0, 0, Q, U); + y.translate($, 0), y.rotate(Math.PI / 2), y.drawImage(S, 0, 0, R, $); break; case 2: - y.translate(U, Q), y.rotate(Math.PI), y.drawImage(q, 0, 0, U, Q); + y.translate($, R), y.rotate(Math.PI), y.drawImage(S, 0, 0, $, R); break; case 3: - y.translate(0, Q), y.rotate(-Math.PI / 2), y.drawImage(q, 0, 0, Q, U); + y.translate(0, R), y.rotate(-Math.PI / 2), y.drawImage(S, 0, 0, R, $); break; } y.restore(); @@ -8556,195 +8558,223 @@ function wg(i, e, t) { B.render(y); } } - function H(B) { - t(11, C = B), u.boxes.forEach((T) => { - T.setSelected(!1); - }), B >= 0 && B < u.boxes.length && u.boxes[B].setSelected(!0), O(); - } - function Fe(B) { - s && (B.target instanceof Element && B.target.hasPointerCapture(B.pointerId) && B.target.releasePointerCapture(B.pointerId), z === n.creation ? Ke(B) : z === n.drag && E(B)); - } function E(B) { - const T = p.getBoundingClientRect(), ee = B.clientX - T.left, ae = B.clientY - T.top; - let fe = !1; - for (const [ce, Se] of u.boxes.entries()) { - const wi = Se.indexOfPointInsideHandle(ee, ae); - if (wi >= 0) { - fe = !0, H(ce), Se.startResize(wi, B); + t(10, C = B), u.boxes.forEach((Y) => { + Y.setSelected(!1); + }), B >= 0 && B < u.boxes.length && u.boxes[B].setSelected(!0), ne(); + } + const H = (B, Y) => Math.sqrt(Math.pow(B.clientX - Y.clientX, 2) + Math.pow(B.clientY - Y.clientY, 2)); + function ee(B) { + if (s) { + if (v.setPointerCapture(B.pointerId), D.set(B.pointerId, B), D.size == 1) + z === n.creation ? Je(B) : z === n.drag && re(B); + else if (D.size == 2) { + q.isDragging = !1, u.boxes.forEach((Qe) => { + Qe.isCreating = !1, Qe.isDragging = !1, Qe.isResizing = !1; + }); + const Y = Array.from(D.values()), U = Y[0], x = Y[1], le = H(U, x), se = (U.clientX + x.clientX) / 2, me = (U.clientY + x.clientY) / 2; + G.distance = le, G.x = se, G.y = me; + } + } + } + function re(B) { + const Y = v.getBoundingClientRect(), U = B.clientX - Y.left, x = B.clientY - Y.top; + let le = !1; + for (const [se, me] of u.boxes.entries()) { + const Qe = me.indexOfPointInsideHandle(U, x); + if (Qe >= 0) { + le = !0, E(se), me.startResize(Qe, B); return; } } - for (const [ce, Se] of u.boxes.entries()) - if (Se.isPointInsideBox(ee, ae)) { - fe = !0, H(ce), Se.startDrag(B); + for (const [se, me] of u.boxes.entries()) + if (me.isPointInsideBox(U, x)) { + le = !0, E(se), me.startDrag(B); return; } - v || H(-1), fe || S.startDrag(B); + p || E(-1), le || q.startDrag(B); } - function X(B) { - J("change"); + function M(B) { + s && (D.delete(B.pointerId), v.releasePointerCapture(B.pointerId), X("change")); } - function $(B) { - if (u === null || z !== n.drag) - return; - const T = p.getBoundingClientRect(), ee = B.clientX - T.left, ae = B.clientY - T.top; - for (const [fe, ce] of u.boxes.entries()) { - const Se = ce.indexOfPointInsideHandle(ee, ae); - if (Se >= 0) { - t(10, p.style.cursor = ce.resizeHandles[Se].cursor, p); - return; + function Ge(B) { + s && (D.delete(B.pointerId), v.releasePointerCapture(B.pointerId), X("change")); + } + function ot(B) { + if (s) + if (B.pointerType === "mouse") { + if (!b || u === null || z !== n.drag) + return; + const Y = v.getBoundingClientRect(), U = B.clientX - Y.left, x = B.clientY - Y.top; + for (const [le, se] of u.boxes.entries()) { + const me = se.indexOfPointInsideHandle(U, x); + if (me >= 0) { + t(9, v.style.cursor = se.resizeHandles[me].cursor, v); + return; + } + } + t(9, v.style.cursor = "default", v); + } else { + if (!D.has(B.pointerId)) + return; + if (D.set(B.pointerId, B), D.size === 2) { + const Y = Array.from(D.values()), U = Y[0], x = Y[1], le = H(U, x), se = (U.clientX + x.clientX) / 2, me = (U.clientY + x.clientY) / 2, Qe = parseFloat((q.scale * (le / G.distance)).toFixed(2)), ki = Qe < 1 ? 1 : Qe, Os = ki / q.scale; + q.offsetX = G.x - (G.x - q.offsetX) * Os, q.offsetY = G.y - (G.y - q.offsetY) * Os; + const uf = se - G.x, _f = me - G.y; + q.offsetX += uf, q.offsetY += _f, q.scale = ki, G.x = se, G.y = me, G.distance = le, ne(); + } } - } - t(10, p.style.cursor = "default", p); } - function ie(B) { + function Ke(B) { if (s) switch (B.key) { case "Delete": - D(); + Ht(); break; } } - function L(B) { + function We(B) { + if (!s) + return; B.preventDefault(); - const T = 1 / (1 + B.deltaY / 1e3 * 0.5), ee = parseFloat((S.scale * T).toFixed(2)), ae = ee < 1 ? 1 : ee, fe = p.getBoundingClientRect(), ce = B.clientX - fe.left, Se = B.clientY - fe.top, wi = (ce - S.offsetX) / S.scale, sf = (Se - S.offsetY) / S.scale; - S.offsetX = ce - wi * ae, S.offsetY = Se - sf * ae, S.scale = ae, O(); + const Y = 1 / (1 + B.deltaY / 1e3 * 0.5), U = parseFloat((q.scale * Y).toFixed(2)), x = U < 1 ? 1 : U, le = v.getBoundingClientRect(), se = B.clientX - le.left, me = B.clientY - le.top, Qe = (se - q.offsetX) / q.scale, ki = (me - q.offsetY) / q.scale; + q.offsetX = se - Qe * x, q.offsetY = me - ki * x, q.scale = x, ne(); } - function Ke(B) { - const T = p.getBoundingClientRect(), ee = (B.clientX - T.left - S.offsetX) / ne / S.scale, ae = (B.clientY - T.top - S.offsetY) / ne / S.scale; - let fe; - d.length > 0 ? fe = Xi(d[0]) : v ? u.boxes.length > 0 ? fe = u.boxes[0].color : fe = xt[0] : fe = xt[u.boxes.length % xt.length]; - let ce = new fs(O, Ce, S, W, A, F, K, "", ee, ae, ee, ae, fe, o, r, a, f, c); - ce.startCreating(B, T.left, T.top), v ? t(0, u.boxes = [ce], u) : t(0, u.boxes = [ce, ...u.boxes], u), H(0), O(), J("change"); + function Je(B) { + const Y = v.getBoundingClientRect(), U = (B.clientX - Y.left - q.offsetX) / P / q.scale, x = (B.clientY - Y.top - q.offsetY) / P / q.scale; + let le; + d.length > 0 ? le = Fi(d[0]) : p ? u.boxes.length > 0 ? le = u.boxes[0].color : le = tn[0] : le = tn[u.boxes.length % tn.length]; + let se = new cs(ne, vi, q, D, W, F, J, ie, "", U, x, U, x, le, o, r, a, f, c); + se.startCreating(B, Y.left, Y.top), p ? t(0, u.boxes = [se], u) : t(0, u.boxes = [se, ...u.boxes], u), E(0), ne(), X("change"); } - function Ue() { - t(12, z = n.creation), t(10, p.style.cursor = "crosshair", p); + function Xe() { + t(11, z = n.creation), t(9, v.style.cursor = "crosshair", v); } - function Je() { - t(12, z = n.drag), t(10, p.style.cursor = "default", p); + function gt() { + t(11, z = n.drag), t(9, v.style.cursor = "default", v); } - function Ce() { - C >= 0 && C < u.boxes.length && (u.boxes[C].getArea() < 1 ? D() : (m || (Z ? wl() : t(14, V = !0)), v && Je())); + function vi() { + C >= 0 && C < u.boxes.length && (u.boxes[C].getArea() < 1 ? Ht() : (m || (ae ? yn() : t(13, A = !0)), p && gt())); } - function Qe() { - C >= 0 && C < u.boxes.length && !m && t(13, M = !0); + function pl() { + C >= 0 && C < u.boxes.length && !m && t(12, V = !0); } - function xe(B) { - s && Qe(); + function vl(B) { + s && pl(); } - function Zt(B) { - t(13, M = !1); - const { detail: T } = B; - let ee = T.label, ae = T.color, fe = T.ret; + function L(B) { + t(12, V = !1); + const { detail: Y } = B; + let U = Y.label, x = Y.color, le = Y.ret; if (C >= 0 && C < u.boxes.length) { - let ce = u.boxes[C]; - fe == 1 ? (ce.label = ee, ce.color = Xi(ae), O(), J("change")) : fe == -1 && D(); + let se = u.boxes[C]; + le == 1 ? (se.label = U, se.color = Fi(x), ne(), X("change")) : le == -1 && Ht(); } } - function gl(B) { - t(14, V = !1); - const { detail: T } = B; - let ee = T.label, ae = T.color, fe = T.ret, ce = T.lock; + function It(B) { + t(13, A = !1); + const { detail: Y } = B; + let U = Y.label, x = Y.color, le = Y.ret, se = Y.lock; if (C >= 0 && C < u.boxes.length) { - let Se = u.boxes[C]; - fe == 1 ? (t(16, Z = ce), x.label = ee, x.color = ae, Se.label = ee, Se.color = Xi(ae), O(), J("change")) : D(); + let me = u.boxes[C]; + le == 1 ? (t(15, ae = se), Z.label = U, Z.color = x, me.label = U, me.color = Fi(x), ne(), X("change")) : Ht(); } } - function bl(B) { - t(15, R = !1); - const { detail: T } = B; - let ee = T.label, ae = T.color, fe = T.ret, ce = T.lock; - fe == 1 && (t(16, Z = ce), x.label = ee, x.color = ae); + function bt(B) { + t(14, Q = !1); + const { detail: Y } = B; + let U = Y.label, x = Y.color, le = Y.ret, se = Y.lock; + le == 1 && (t(15, ae = se), Z.label = U, Z.color = x); } - function wl() { + function yn() { if (C >= 0 && C < u.boxes.length) { let B = u.boxes[C]; - B.label = x.label, x.color !== "" && (B.color = Xi(x.color)), O(), J("change"); + B.label = Z.label, Z.color !== "" && (B.color = Fi(Z.color)), ne(), X("change"); } } - function D() { - C >= 0 && C < u.boxes.length && (u.boxes.splice(C, 1), H(-1), v && Ue(), J("change")); + function Ht() { + C >= 0 && C < u.boxes.length && (u.boxes.splice(C, 1), E(-1), p && Xe(), X("change")); } - function at(B) { - t(0, u.orientation = ((u.orientation + B) % 4 + 4) % 4, u), S.orientation = u.orientation, Ae(); - for (const T of u.boxes) - T.onRotate(B); - O(); + function wt(B) { + t(0, u.orientation = ((u.orientation + B) % 4 + 4) % 4, u), q.orientation = u.orientation, at(); + for (const Y of u.boxes) + Y.onRotate(B); + ne(); } - function Ae() { - if (p) { - if (ne = 1, t(10, p.width = p.clientWidth, p), S.setRotatedImage(q), q !== null) { - if (S.imageRotatedWidth > p.width) - ne = p.width / S.imageRotatedWidth, U = Math.round(S.imageRotatedWidth * ne), Q = Math.round(S.imageRotatedHeight * ne), W = 0, A = 0, F = U, K = Q, t(10, p.height = Q, p); + function at() { + if (v) { + if (P = 1, t(9, v.width = v.clientWidth, v), q.setRotatedImage(S), S !== null) { + if (q.imageRotatedWidth > v.width) + P = v.width / q.imageRotatedWidth, $ = Math.round(q.imageRotatedWidth * P), R = Math.round(q.imageRotatedHeight * P), W = 0, F = 0, J = $, ie = R, t(9, v.height = R, v); else { - U = S.imageRotatedWidth, Q = S.imageRotatedHeight; - var B = (p.width - U) / 2; - W = B, A = 0, F = B + U, K = Q, t(10, p.height = Q, p); + $ = q.imageRotatedWidth, R = q.imageRotatedHeight; + var B = (v.width - $) / 2; + W = B, F = 0, J = B + $, ie = R, t(9, v.height = R, v); } - S.imageWidth = U, S.imageHeight = Q; + q.imageWidth = $, q.imageHeight = R; } else - W = 0, A = 0, F = p.width, K = p.height, t(10, p.height = p.clientHeight, p); - if (S.resize(p.width, p.height, W, A), F > 0 && K > 0) - for (const T of u.boxes) - T.canvasXmin = W, T.canvasYmin = A, T.canvasXmax = F, T.canvasYmax = K, T.setScaleFactor(ne); - O(), J("change"); + W = 0, F = 0, J = v.width, ie = v.height, t(9, v.height = v.clientHeight, v); + if (q.resize(v.width, v.height, W, F), J > 0 && ie > 0) + for (const Y of u.boxes) + Y.canvasXmin = W, Y.canvasYmin = F, Y.canvasXmax = J, Y.canvasYmax = ie, Y.setScaleFactor(P); + ne(), X("change"); } } - const vn = new ResizeObserver(Ae); - function vl() { + const kl = new ResizeObserver(at); + function yl() { for (let B = 0; B < u.boxes.length; B++) { - let T = u.boxes[B]; - if (!(T instanceof fs)) { - let ee = "", ae = ""; - T.hasOwnProperty("color") ? (ee = T.color, Array.isArray(ee) && ee.length === 3 && (ee = `rgb(${ee[0]}, ${ee[1]}, ${ee[2]})`)) : ee = xt[B % xt.length], T.hasOwnProperty("label") && (ae = T.label), T = new fs(O, Ce, S, W, A, F, K, ae, T.xmin, T.ymin, T.xmax, T.ymax, ee, o, r, a, f, c), t(0, u.boxes[B] = T, u); + let Y = u.boxes[B]; + if (!(Y instanceof cs)) { + let U = "", x = ""; + Y.hasOwnProperty("color") ? (U = Y.color, Array.isArray(U) && U.length === 3 && (U = `rgb(${U[0]}, ${U[1]}, ${U[2]})`)) : U = tn[B % tn.length], Y.hasOwnProperty("label") && (x = Y.label), Y = new cs(ne, vi, q, D, W, F, J, ie, x, Y.xmin, Y.ymin, Y.xmax, Y.ymax, U, o, r, a, f, c), t(0, u.boxes[B] = Y, u); } } } - function Wt() { - l !== null && (q === null || q.src != l) && (q = new Image(), q.src = l, q.onload = function() { - Ae(), O(); + function Cn() { + l !== null && (S === null || S.src != l) && (S = new Image(), S.src = l, S.onload = function() { + at(), ne(); }); } - hg(() => { + vg(() => { if (Array.isArray(_) && _.length > 0) { if (!Array.isArray(d) || d.length == 0) for (let B = 0; B < _.length; B++) { - let T = xt[B % xt.length]; - d.push(mn(T)); + let Y = tn[B % tn.length]; + d.push(wn(Y)); } - x.label = _[0][0], x.color = d[0]; + Z.label = _[0][0], Z.color = d[0]; } - y = p.getContext("2d"), vn.observe(p), C < 0 && u !== null && u.boxes.length > 0 && H(0), Wt(), Ae(), O(); + y = v.getContext("2d"), kl.observe(v), C < 0 && u !== null && u.boxes.length > 0 && E(0), Cn(), at(), ne(); }); - function pn() { - document.addEventListener("keydown", ie); + function pt() { + document.addEventListener("keydown", Ke); } - function pl() { - document.removeEventListener("keydown", ie); + function Jn() { + document.removeEventListener("keydown", Ke); } - mg(() => { - document.removeEventListener("keydown", ie); + kg(() => { + document.removeEventListener("keydown", Ke); }); - function kl(B) { - fg[B ? "unshift" : "push"](() => { - p = B, t(10, p); + function ef(B) { + gg[B ? "unshift" : "push"](() => { + v = B, t(9, v); }); } - const Zn = () => Ue(), gt = () => Je(), Gn = () => D(), xr = () => t(15, R = !0), $r = () => at(-1), ef = () => at(1); - function tf(B) { - cs.call(this, i, B); + const tf = () => Xe(), nf = () => gt(), lf = () => Ht(), sf = () => t(14, Q = !0), of = () => wt(-1), af = () => wt(1); + function rf(B) { + us.call(this, i, B); } - function nf(B) { - cs.call(this, i, B); + function ff(B) { + us.call(this, i, B); } - function lf(B) { - cs.call(this, i, B); + function cf(B) { + us.call(this, i, B); } return i.$$set = (B) => { - "imageUrl" in B && t(31, l = B.imageUrl), "interactive" in B && t(2, s = B.interactive), "boxAlpha" in B && t(32, o = B.boxAlpha), "boxMinSize" in B && t(33, r = B.boxMinSize), "handleSize" in B && t(34, a = B.handleSize), "boxThickness" in B && t(35, f = B.boxThickness), "boxSelectedThickness" in B && t(36, c = B.boxSelectedThickness), "value" in B && t(0, u = B.value), "choices" in B && t(3, _ = B.choices), "choicesColors" in B && t(4, d = B.choicesColors), "disableEditBoxes" in B && t(5, m = B.disableEditBoxes), "height" in B && t(6, h = B.height), "width" in B && t(7, g = B.width), "singleBox" in B && t(37, v = B.singleBox), "showRemoveButton" in B && t(1, w = B.showRemoveButton), "handlesCursor" in B && t(8, b = B.handlesCursor), "useDefaultLabel" in B && t(38, k = B.useDefaultLabel); + "imageUrl" in B && t(31, l = B.imageUrl), "interactive" in B && t(2, s = B.interactive), "boxAlpha" in B && t(32, o = B.boxAlpha), "boxMinSize" in B && t(33, r = B.boxMinSize), "handleSize" in B && t(34, a = B.handleSize), "boxThickness" in B && t(35, f = B.boxThickness), "boxSelectedThickness" in B && t(36, c = B.boxSelectedThickness), "value" in B && t(0, u = B.value), "choices" in B && t(3, _ = B.choices), "choicesColors" in B && t(4, d = B.choicesColors), "disableEditBoxes" in B && t(5, m = B.disableEditBoxes), "height" in B && t(6, h = B.height), "width" in B && t(7, g = B.width), "singleBox" in B && t(37, p = B.singleBox), "showRemoveButton" in B && t(1, w = B.showRemoveButton), "handlesCursor" in B && t(38, b = B.handlesCursor), "useDefaultLabel" in B && t(39, k = B.useDefaultLabel); }, i.$$.update = () => { i.$$.dirty[0] & /*value*/ - 1 && (Wt(), vl(), Ae(), O()); + 1 && (q.orientation = u.orientation, Cn(), yl(), at(), ne()); }, [ u, w, @@ -8754,57 +8784,58 @@ function wg(i, e, t) { m, h, g, - b, n, - p, + v, C, z, - M, V, - R, - Z, - Fe, - X, - $, + A, + Q, + ae, + ee, + M, + Ge, + ot, + We, + Xe, + gt, + vl, L, - Ue, - Je, - xe, - Zt, - gl, - bl, - D, - at, - pn, - pl, + It, + bt, + Ht, + wt, + pt, + Jn, l, o, r, a, f, c, - v, + p, + b, k, - kl, - Zn, - gt, - Gn, - xr, - $r, ef, tf, nf, - lf + lf, + sf, + of, + af, + rf, + ff, + cf ]; } -class vg extends rg { +class zg extends mg { constructor(e) { - super(), ug( + super(), wg( this, e, - wg, - bg, - dg, + Sg, + Cg, + pg, { imageUrl: 31, interactive: 2, @@ -8821,8 +8852,8 @@ class vg extends rg { width: 7, singleBox: 37, showRemoveButton: 1, - handlesCursor: 8, - useDefaultLabel: 38 + handlesCursor: 38, + useDefaultLabel: 39 }, null, [-1, -1, -1] @@ -8830,19 +8861,19 @@ class vg extends rg { } } const { - SvelteComponent: pg, - add_flush_callback: kg, - bind: yg, - binding_callbacks: Cg, - create_component: Sg, - destroy_component: zg, - init: Bg, - mount_component: qg, - safe_not_equal: Dg, - transition_in: Lg, - transition_out: Eg -} = window.__gradio__svelte__internal, { createEventDispatcher: Mg } = window.__gradio__svelte__internal; -function Rg(i) { + SvelteComponent: Bg, + add_flush_callback: Dg, + bind: qg, + binding_callbacks: Lg, + create_component: Mg, + destroy_component: Eg, + init: Rg, + mount_component: Ag, + safe_not_equal: Wg, + transition_in: Xg, + transition_out: Yg +} = window.__gradio__svelte__internal, { createEventDispatcher: Ig } = window.__gradio__svelte__internal; +function Hg(i) { let e, t, n; function l(o) { i[20](o); @@ -8916,16 +8947,16 @@ function Rg(i) { return ( /*value*/ i[0] !== void 0 && (s.value = /*value*/ - i[0]), e = new vg({ props: s }), Cg.push(() => yg(e, "value", l)), e.$on( + i[0]), e = new zg({ props: s }), Lg.push(() => qg(e, "value", l)), e.$on( "change", /*change_handler*/ i[21] ), { c() { - Sg(e.$$.fragment); + Mg(e.$$.fragment); }, m(o, r) { - qg(e, o, r), n = !0; + Ag(e, o, r), n = !0; }, p(o, [r]) { const a = {}; @@ -8963,36 +8994,36 @@ function Rg(i) { 65536 && (a.imageUrl = /*resolved_src*/ o[16]), !t && r & /*value*/ 1 && (t = !0, a.value = /*value*/ - o[0], kg(() => t = !1)), e.$set(a); + o[0], Dg(() => t = !1)), e.$set(a); }, i(o) { - n || (Lg(e.$$.fragment, o), n = !0); + n || (Xg(e.$$.fragment, o), n = !0); }, o(o) { - Eg(e.$$.fragment, o), n = !1; + Yg(e.$$.fragment, o), n = !1; }, d(o) { - zg(e, o); + Eg(e, o); } } ); } -function Ag(i, e, t) { - let { src: n = void 0 } = e, { interactive: l } = e, { boxesAlpha: s } = e, { labelList: o } = e, { labelColors: r } = e, { boxMinSize: a } = e, { handleSize: f } = e, { boxThickness: c } = e, { height: u } = e, { width: _ } = e, { boxSelectedThickness: d } = e, { value: m } = e, { disableEditBoxes: h } = e, { singleBox: g } = e, { showRemoveButton: v } = e, { handlesCursor: w } = e, { useDefaultLabel: b } = e, k, p; - const y = Mg(); - function q(z) { +function Tg(i, e, t) { + let { src: n = void 0 } = e, { interactive: l } = e, { boxesAlpha: s } = e, { labelList: o } = e, { labelColors: r } = e, { boxMinSize: a } = e, { handleSize: f } = e, { boxThickness: c } = e, { height: u } = e, { width: _ } = e, { boxSelectedThickness: d } = e, { value: m } = e, { disableEditBoxes: h } = e, { singleBox: g } = e, { showRemoveButton: p } = e, { handlesCursor: w } = e, { useDefaultLabel: b } = e, k, v; + const y = Ig(); + function S(z) { m = z, t(0, m); } const C = () => y("change"); return i.$$set = (z) => { - "src" in z && t(18, n = z.src), "interactive" in z && t(1, l = z.interactive), "boxesAlpha" in z && t(2, s = z.boxesAlpha), "labelList" in z && t(3, o = z.labelList), "labelColors" in z && t(4, r = z.labelColors), "boxMinSize" in z && t(5, a = z.boxMinSize), "handleSize" in z && t(6, f = z.handleSize), "boxThickness" in z && t(7, c = z.boxThickness), "height" in z && t(8, u = z.height), "width" in z && t(9, _ = z.width), "boxSelectedThickness" in z && t(10, d = z.boxSelectedThickness), "value" in z && t(0, m = z.value), "disableEditBoxes" in z && t(11, h = z.disableEditBoxes), "singleBox" in z && t(12, g = z.singleBox), "showRemoveButton" in z && t(13, v = z.showRemoveButton), "handlesCursor" in z && t(14, w = z.handlesCursor), "useDefaultLabel" in z && t(15, b = z.useDefaultLabel); + "src" in z && t(18, n = z.src), "interactive" in z && t(1, l = z.interactive), "boxesAlpha" in z && t(2, s = z.boxesAlpha), "labelList" in z && t(3, o = z.labelList), "labelColors" in z && t(4, r = z.labelColors), "boxMinSize" in z && t(5, a = z.boxMinSize), "handleSize" in z && t(6, f = z.handleSize), "boxThickness" in z && t(7, c = z.boxThickness), "height" in z && t(8, u = z.height), "width" in z && t(9, _ = z.width), "boxSelectedThickness" in z && t(10, d = z.boxSelectedThickness), "value" in z && t(0, m = z.value), "disableEditBoxes" in z && t(11, h = z.disableEditBoxes), "singleBox" in z && t(12, g = z.singleBox), "showRemoveButton" in z && t(13, p = z.showRemoveButton), "handlesCursor" in z && t(14, w = z.handlesCursor), "useDefaultLabel" in z && t(15, b = z.useDefaultLabel); }, i.$$.update = () => { if (i.$$.dirty & /*src, latest_src*/ 786432) { - t(16, k = n), t(19, p = n); + t(16, k = n), t(19, v = n); const z = n; - a1(z).then((S) => { - p === z && t(16, k = S); + h1(z).then((D) => { + v === z && t(16, k = D); }); } }, [ @@ -9009,20 +9040,20 @@ function Ag(i, e, t) { d, h, g, - v, + p, w, b, k, y, n, - p, - q, + v, + S, C ]; } -class Wg extends pg { +class jg extends Bg { constructor(e) { - super(), Bg(this, e, Ag, Rg, Dg, { + super(), Rg(this, e, Tg, Hg, Wg, { src: 18, interactive: 1, boxesAlpha: 2, @@ -9043,43 +9074,43 @@ class Wg extends pg { }); } } -class qa { +class La { constructor() { this.boxes = [], this.orientation = 0; } } const { - SvelteComponent: Hg, - add_flush_callback: ll, - append: Dn, - attr: ai, - bind: sl, - binding_callbacks: hi, - bubble: ei, - check_outros: en, - create_component: Lt, - create_slot: Ig, - destroy_component: Et, - detach: cn, - element: _i, - empty: Tg, - get_all_dirty_from_scope: Xg, - get_slot_changes: Yg, - group_outros: tn, - init: jg, - insert: un, - mount_component: Mt, - noop: Fg, - safe_not_equal: Ug, - space: $t, - toggle_class: Da, - transition_in: G, - transition_out: le, - update_slot_base: Vg -} = window.__gradio__svelte__internal, { createEventDispatcher: Ng, tick: Og } = window.__gradio__svelte__internal; -function La(i) { + SvelteComponent: Fg, + add_flush_callback: al, + append: En, + attr: fi, + bind: rl, + binding_callbacks: gi, + bubble: ni, + check_outros: ln, + create_component: Rt, + create_slot: Ug, + destroy_component: At, + detach: dn, + element: hi, + empty: Vg, + get_all_dirty_from_scope: Ng, + get_slot_changes: Og, + group_outros: sn, + init: Pg, + insert: hn, + mount_component: Wt, + noop: Zg, + safe_not_equal: Gg, + space: nn, + toggle_class: Ma, + transition_in: K, + transition_out: oe, + update_slot_base: Kg +} = window.__gradio__svelte__internal, { createEventDispatcher: Jg, tick: Qg } = window.__gradio__svelte__internal; +function Ea(i) { let e, t; - return e = new p1({ + return e = new D1({ props: { href: ( /*value*/ @@ -9089,15 +9120,15 @@ function La(i) { /*value*/ i[1].image.orig_name || "image" ), - $$slots: { default: [Pg] }, + $$slots: { default: [xg] }, $$scope: { ctx: i } } }), { c() { - Lt(e.$$.fragment); + Rt(e.$$.fragment); }, m(n, l) { - Mt(e, n, l), t = !0; + Wt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -9110,21 +9141,21 @@ function La(i) { 4194304 && (s.$$scope = { dirty: l, ctx: n }), e.$set(s); }, i(n) { - t || (G(e.$$.fragment, n), t = !0); + t || (K(e.$$.fragment, n), t = !0); }, o(n) { - le(e.$$.fragment, n), t = !1; + oe(e.$$.fragment, n), t = !1; }, d(n) { - Et(e, n); + At(e, n); } }; } -function Pg(i) { +function xg(i) { let e, t; - return e = new ol({ + return e = new fl({ props: { - Icon: Au, + Icon: ju, label: ( /*i18n*/ i[8]("common.download") @@ -9132,10 +9163,10 @@ function Pg(i) { } }), { c() { - Lt(e.$$.fragment); + Rt(e.$$.fragment); }, m(n, l) { - Mt(e, n, l), t = !0; + Wt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -9144,19 +9175,19 @@ function Pg(i) { n[8]("common.download")), e.$set(s); }, i(n) { - t || (G(e.$$.fragment, n), t = !0); + t || (K(e.$$.fragment, n), t = !0); }, o(n) { - le(e.$$.fragment, n), t = !1; + oe(e.$$.fragment, n), t = !1; }, d(n) { - Et(e, n); + At(e, n); } }; } -function Ea(i) { +function Ra(i) { let e, t; - return e = new nd({ + return e = new fd({ props: { i18n: ( /*i18n*/ @@ -9181,10 +9212,10 @@ function Ea(i) { i[40] ), { c() { - Lt(e.$$.fragment); + Rt(e.$$.fragment); }, m(n, l) { - Mt(e, n, l), t = !0; + Wt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -9195,49 +9226,49 @@ function Ea(i) { n[1]), e.$set(s); }, i(n) { - t || (G(e.$$.fragment, n), t = !0); + t || (K(e.$$.fragment, n), t = !0); }, o(n) { - le(e.$$.fragment, n), t = !1; + oe(e.$$.fragment, n), t = !1; }, d(n) { - Et(e, n); + At(e, n); } }; } -function Ma(i) { +function Aa(i) { let e, t, n; - return t = new ol({ - props: { Icon: Za, label: "Remove Image" } + return t = new fl({ + props: { Icon: Ka, label: "Remove Image" } }), t.$on( "click", /*clear*/ i[36] ), { c() { - e = _i("div"), Lt(t.$$.fragment); + e = hi("div"), Rt(t.$$.fragment); }, m(l, s) { - un(l, e, s), Mt(t, e, null), n = !0; + hn(l, e, s), Wt(t, e, null), n = !0; }, - p: Fg, + p: Zg, i(l) { - n || (G(t.$$.fragment, l), n = !0); + n || (K(t.$$.fragment, l), n = !0); }, o(l) { - le(t.$$.fragment, l), n = !1; + oe(t.$$.fragment, l), n = !1; }, d(l) { - l && cn(e), Et(t); + l && dn(e), At(t); } }; } -function Ra(i) { +function Wa(i) { let e; const t = ( /*#slots*/ i[37].default - ), n = Ig( + ), n = Ug( t, i, /*$$scope*/ @@ -9253,19 +9284,19 @@ function Ra(i) { }, p(l, s) { n && n.p && (!e || s[1] & /*$$scope*/ - 4194304) && Vg( + 4194304) && Kg( n, t, l, /*$$scope*/ l[53], - e ? Yg( + e ? Og( t, /*$$scope*/ l[53], s, null - ) : Xg( + ) : Ng( /*$$scope*/ l[53] ), @@ -9273,49 +9304,49 @@ function Ra(i) { ); }, i(l) { - e || (G(n, l), e = !0); + e || (K(n, l), e = !0); }, o(l) { - le(n, l), e = !1; + oe(n, l), e = !1; }, d(l) { n && n.d(l); } }; } -function Zg(i) { +function $g(i) { let e, t, n = ( /*value*/ - i[1] === null && Ra(i) + i[1] === null && Wa(i) ); return { c() { - n && n.c(), e = Tg(); + n && n.c(), e = Vg(); }, m(l, s) { - n && n.m(l, s), un(l, e, s), t = !0; + n && n.m(l, s), hn(l, e, s), t = !0; }, p(l, s) { /*value*/ l[1] === null ? n ? (n.p(l, s), s[0] & /*value*/ - 2 && G(n, 1)) : (n = Ra(l), n.c(), G(n, 1), n.m(e.parentNode, e)) : n && (tn(), le(n, 1, 1, () => { + 2 && K(n, 1)) : (n = Wa(l), n.c(), K(n, 1), n.m(e.parentNode, e)) : n && (sn(), oe(n, 1, 1, () => { n = null; - }), en()); + }), ln()); }, i(l) { - t || (G(n), t = !0); + t || (K(n), t = !0); }, o(l) { - le(n), t = !1; + oe(n), t = !1; }, d(l) { - l && cn(e), n && n.d(l); + l && dn(e), n && n.d(l); } }; } -function Aa(i) { +function Xa(i) { let e, t; - return e = new Nh({ + return e = new Qh({ props: { root: ( /*root*/ @@ -9354,10 +9385,10 @@ function Aa(i) { i[49] ), { c() { - Lt(e.$$.fragment); + Rt(e.$$.fragment); }, m(n, l) { - Mt(e, n, l), t = !0; + Wt(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -9370,17 +9401,17 @@ function Aa(i) { n[31]), e.$set(s); }, i(n) { - t || (G(e.$$.fragment, n), t = !0); + t || (K(e.$$.fragment, n), t = !0); }, o(n) { - le(e.$$.fragment, n), t = !1; + oe(e.$$.fragment, n), t = !1; }, d(n) { - Et(e, n); + At(e, n); } }; } -function Wa(i) { +function Ya(i) { let e, t, n, l; function s(r) { i[50](r); @@ -9454,13 +9485,13 @@ function Wa(i) { return ( /*value*/ i[1] !== void 0 && (o.value = /*value*/ - i[1]), t = new Wg({ props: o }), hi.push(() => sl(t, "value", s)), t.$on( + i[1]), t = new jg({ props: o }), gi.push(() => rl(t, "value", s)), t.$on( "change", /*change_handler*/ i[51] ), { c() { - e = _i("div"), Lt(t.$$.fragment), ai(e, "class", "image-frame svelte-1gjdske"), Da( + e = hi("div"), Rt(t.$$.fragment), fi(e, "class", "image-frame svelte-1gjdske"), Ma( e, "selectable", /*selectable*/ @@ -9468,7 +9499,7 @@ function Wa(i) { ); }, m(r, a) { - un(r, e, a), Mt(t, e, null), l = !0; + hn(r, e, a), Wt(t, e, null), l = !0; }, p(r, a) { const f = {}; @@ -9506,8 +9537,8 @@ function Wa(i) { 2 && (f.src = /*value*/ r[1].image.url), !n && a[0] & /*value*/ 2 && (n = !0, f.value = /*value*/ - r[1], ll(() => n = !1)), t.$set(f), (!l || a[0] & /*selectable*/ - 32) && Da( + r[1], al(() => n = !1)), t.$set(f), (!l || a[0] & /*selectable*/ + 32) && Ma( e, "selectable", /*selectable*/ @@ -9515,18 +9546,18 @@ function Wa(i) { ); }, i(r) { - l || (G(t.$$.fragment, r), l = !0); + l || (K(t.$$.fragment, r), l = !0); }, o(r) { - le(t.$$.fragment, r), l = !1; + oe(t.$$.fragment, r), l = !1; }, d(r) { - r && cn(e), Et(t); + r && dn(e), At(t); } } ); } -function Ha(i) { +function Ia(i) { let e, t, n; function l(o) { i[52](o); @@ -9548,12 +9579,12 @@ function Ha(i) { return ( /*active_source*/ i[0] !== void 0 && (s.active_source = /*active_source*/ - i[0]), e = new wd({ props: s }), hi.push(() => sl(e, "active_source", l)), { + i[0]), e = new zd({ props: s }), gi.push(() => rl(e, "active_source", l)), { c() { - Lt(e.$$.fragment); + Rt(e.$$.fragment); }, m(o, r) { - Mt(e, o, r), n = !0; + Wt(e, o, r), n = !0; }, p(o, r) { const a = {}; @@ -9561,21 +9592,21 @@ function Ha(i) { 16 && (a.sources = /*sources*/ o[4]), !t && r[0] & /*active_source*/ 1 && (t = !0, a.active_source = /*active_source*/ - o[0], ll(() => t = !1)), e.$set(a); + o[0], al(() => t = !1)), e.$set(a); }, i(o) { - n || (G(e.$$.fragment, o), n = !0); + n || (K(e.$$.fragment, o), n = !0); }, o(o) { - le(e.$$.fragment, o), n = !1; + oe(e.$$.fragment, o), n = !1; }, d(o) { - Et(e, o); + At(e, o); } } ); } -function Gg(i) { +function e2(i) { let e, t, n, l, s, o, r, a, f, c, u, _, d, m, h = ( /*sources*/ (i[4].length > 1 || /*sources*/ @@ -9583,38 +9614,38 @@ function Gg(i) { i[1] === null && /*interactive*/ i[7] ), g; - e = new vc({ + e = new Bc({ props: { show_label: ( /*show_label*/ i[3] ), - Icon: Ga, + Icon: Ja, label: ( /*label*/ i[2] || "Image Annotator" ) } }); - let v = ( + let p = ( /*showDownloadButton*/ i[10] && /*value*/ - i[1] !== null && La(i) + i[1] !== null && Ea(i) ), w = ( /*showShareButton*/ i[9] && /*value*/ - i[1] !== null && Ea(i) + i[1] !== null && Ra(i) ), b = ( /*showClearButton*/ i[11] && /*value*/ i[1] !== null && /*interactive*/ - i[7] && Ma(i) + i[7] && Aa(i) ); - function k(S) { - i[42](S); + function k(D) { + i[42](D); } - function p(S) { - i[43](S); + function v(D) { + i[43](D); } let y = { hidden: ( @@ -9644,14 +9675,14 @@ function Gg(i) { /*stream_handler*/ i[27] ), - $$slots: { default: [Zg] }, + $$slots: { default: [$g] }, $$scope: { ctx: i } }; /*uploading*/ i[29] !== void 0 && (y.uploading = /*uploading*/ i[29]), /*dragging*/ i[30] !== void 0 && (y.dragging = /*dragging*/ - i[30]), f = new $1({ props: y }), i[41](f), hi.push(() => sl(f, "uploading", k)), hi.push(() => sl(f, "dragging", p)), f.$on( + i[30]), f = new oh({ props: y }), i[41](f), gi.push(() => rl(f, "uploading", k)), gi.push(() => rl(f, "dragging", v)), f.$on( "load", /*handle_upload*/ i[32] @@ -9660,194 +9691,194 @@ function Gg(i) { /*error_handler_1*/ i[44] ); - let q = ( + let S = ( /*value*/ i[1] === null && /*active_source*/ - i[0] === "webcam" && Aa(i) + i[0] === "webcam" && Xa(i) ), C = ( /*value*/ - i[1] !== null && Wa(i) - ), z = h && Ha(i); + i[1] !== null && Ya(i) + ), z = h && Ia(i); return { c() { - Lt(e.$$.fragment), t = $t(), n = _i("div"), v && v.c(), l = $t(), w && w.c(), s = $t(), b && b.c(), o = $t(), r = _i("div"), a = _i("div"), Lt(f.$$.fragment), _ = $t(), q && q.c(), d = $t(), C && C.c(), m = $t(), z && z.c(), ai(n, "class", "icon-buttons svelte-1gjdske"), ai(a, "class", "upload-container svelte-1gjdske"), ai(r, "data-testid", "image"), ai(r, "class", "image-container svelte-1gjdske"); - }, - m(S, W) { - Mt(e, S, W), un(S, t, W), un(S, n, W), v && v.m(n, null), Dn(n, l), w && w.m(n, null), Dn(n, s), b && b.m(n, null), un(S, o, W), un(S, r, W), Dn(r, a), Mt(f, a, null), Dn(a, _), q && q.m(a, null), Dn(a, d), C && C.m(a, null), Dn(r, m), z && z.m(r, null), g = !0; - }, - p(S, W) { - const A = {}; - W[0] & /*show_label*/ - 8 && (A.show_label = /*show_label*/ - S[3]), W[0] & /*label*/ - 4 && (A.label = /*label*/ - S[2] || "Image Annotator"), e.$set(A), /*showDownloadButton*/ - S[10] && /*value*/ - S[1] !== null ? v ? (v.p(S, W), W[0] & /*showDownloadButton, value*/ - 1026 && G(v, 1)) : (v = La(S), v.c(), G(v, 1), v.m(n, l)) : v && (tn(), le(v, 1, 1, () => { - v = null; - }), en()), /*showShareButton*/ - S[9] && /*value*/ - S[1] !== null ? w ? (w.p(S, W), W[0] & /*showShareButton, value*/ - 514 && G(w, 1)) : (w = Ea(S), w.c(), G(w, 1), w.m(n, s)) : w && (tn(), le(w, 1, 1, () => { + Rt(e.$$.fragment), t = nn(), n = hi("div"), p && p.c(), l = nn(), w && w.c(), s = nn(), b && b.c(), o = nn(), r = hi("div"), a = hi("div"), Rt(f.$$.fragment), _ = nn(), S && S.c(), d = nn(), C && C.c(), m = nn(), z && z.c(), fi(n, "class", "icon-buttons svelte-1gjdske"), fi(a, "class", "upload-container svelte-1gjdske"), fi(r, "data-testid", "image"), fi(r, "class", "image-container svelte-1gjdske"); + }, + m(D, q) { + Wt(e, D, q), hn(D, t, q), hn(D, n, q), p && p.m(n, null), En(n, l), w && w.m(n, null), En(n, s), b && b.m(n, null), hn(D, o, q), hn(D, r, q), En(r, a), Wt(f, a, null), En(a, _), S && S.m(a, null), En(a, d), C && C.m(a, null), En(r, m), z && z.m(r, null), g = !0; + }, + p(D, q) { + const W = {}; + q[0] & /*show_label*/ + 8 && (W.show_label = /*show_label*/ + D[3]), q[0] & /*label*/ + 4 && (W.label = /*label*/ + D[2] || "Image Annotator"), e.$set(W), /*showDownloadButton*/ + D[10] && /*value*/ + D[1] !== null ? p ? (p.p(D, q), q[0] & /*showDownloadButton, value*/ + 1026 && K(p, 1)) : (p = Ea(D), p.c(), K(p, 1), p.m(n, l)) : p && (sn(), oe(p, 1, 1, () => { + p = null; + }), ln()), /*showShareButton*/ + D[9] && /*value*/ + D[1] !== null ? w ? (w.p(D, q), q[0] & /*showShareButton, value*/ + 514 && K(w, 1)) : (w = Ra(D), w.c(), K(w, 1), w.m(n, s)) : w && (sn(), oe(w, 1, 1, () => { w = null; - }), en()), /*showClearButton*/ - S[11] && /*value*/ - S[1] !== null && /*interactive*/ - S[7] ? b ? (b.p(S, W), W[0] & /*showClearButton, value, interactive*/ - 2178 && G(b, 1)) : (b = Ma(S), b.c(), G(b, 1), b.m(n, null)) : b && (tn(), le(b, 1, 1, () => { + }), ln()), /*showClearButton*/ + D[11] && /*value*/ + D[1] !== null && /*interactive*/ + D[7] ? b ? (b.p(D, q), q[0] & /*showClearButton, value, interactive*/ + 2178 && K(b, 1)) : (b = Aa(D), b.c(), K(b, 1), b.m(n, null)) : b && (sn(), oe(b, 1, 1, () => { b = null; - }), en()); + }), ln()); const F = {}; - W[0] & /*value, active_source*/ + q[0] & /*value, active_source*/ 3 && (F.hidden = /*value*/ - S[1] !== null || /*active_source*/ - S[0] === "webcam"), W[0] & /*active_source*/ + D[1] !== null || /*active_source*/ + D[0] === "webcam"), q[0] & /*active_source*/ 1 && (F.filetype = /*active_source*/ - S[0] === "clipboard" ? "clipboard" : "image/*"), W[0] & /*root*/ + D[0] === "clipboard" ? "clipboard" : "image/*"), q[0] & /*root*/ 64 && (F.root = /*root*/ - S[6]), W[0] & /*max_file_size*/ + D[6]), q[0] & /*max_file_size*/ 33554432 && (F.max_file_size = /*max_file_size*/ - S[25]), W[0] & /*sources*/ + D[25]), q[0] & /*sources*/ 16 && (F.disable_click = !/*sources*/ - S[4].includes("upload")), W[0] & /*cli_upload*/ + D[4].includes("upload")), q[0] & /*cli_upload*/ 67108864 && (F.upload = /*cli_upload*/ - S[26]), W[0] & /*stream_handler*/ + D[26]), q[0] & /*stream_handler*/ 134217728 && (F.stream_handler = /*stream_handler*/ - S[27]), W[0] & /*value*/ - 2 | W[1] & /*$$scope*/ - 4194304 && (F.$$scope = { dirty: W, ctx: S }), !c && W[0] & /*uploading*/ + D[27]), q[0] & /*value*/ + 2 | q[1] & /*$$scope*/ + 4194304 && (F.$$scope = { dirty: q, ctx: D }), !c && q[0] & /*uploading*/ 536870912 && (c = !0, F.uploading = /*uploading*/ - S[29], ll(() => c = !1)), !u && W[0] & /*dragging*/ + D[29], al(() => c = !1)), !u && q[0] & /*dragging*/ 1073741824 && (u = !0, F.dragging = /*dragging*/ - S[30], ll(() => u = !1)), f.$set(F), /*value*/ - S[1] === null && /*active_source*/ - S[0] === "webcam" ? q ? (q.p(S, W), W[0] & /*value, active_source*/ - 3 && G(q, 1)) : (q = Aa(S), q.c(), G(q, 1), q.m(a, d)) : q && (tn(), le(q, 1, 1, () => { - q = null; - }), en()), /*value*/ - S[1] !== null ? C ? (C.p(S, W), W[0] & /*value*/ - 2 && G(C, 1)) : (C = Wa(S), C.c(), G(C, 1), C.m(a, null)) : C && (tn(), le(C, 1, 1, () => { + D[30], al(() => u = !1)), f.$set(F), /*value*/ + D[1] === null && /*active_source*/ + D[0] === "webcam" ? S ? (S.p(D, q), q[0] & /*value, active_source*/ + 3 && K(S, 1)) : (S = Xa(D), S.c(), K(S, 1), S.m(a, d)) : S && (sn(), oe(S, 1, 1, () => { + S = null; + }), ln()), /*value*/ + D[1] !== null ? C ? (C.p(D, q), q[0] & /*value*/ + 2 && K(C, 1)) : (C = Ya(D), C.c(), K(C, 1), C.m(a, null)) : C && (sn(), oe(C, 1, 1, () => { C = null; - }), en()), W[0] & /*sources, value, interactive*/ + }), ln()), q[0] & /*sources, value, interactive*/ 146 && (h = /*sources*/ - (S[4].length > 1 || /*sources*/ - S[4].includes("clipboard")) && /*value*/ - S[1] === null && /*interactive*/ - S[7]), h ? z ? (z.p(S, W), W[0] & /*sources, value, interactive*/ - 146 && G(z, 1)) : (z = Ha(S), z.c(), G(z, 1), z.m(r, null)) : z && (tn(), le(z, 1, 1, () => { + (D[4].length > 1 || /*sources*/ + D[4].includes("clipboard")) && /*value*/ + D[1] === null && /*interactive*/ + D[7]), h ? z ? (z.p(D, q), q[0] & /*sources, value, interactive*/ + 146 && K(z, 1)) : (z = Ia(D), z.c(), K(z, 1), z.m(r, null)) : z && (sn(), oe(z, 1, 1, () => { z = null; - }), en()); + }), ln()); }, - i(S) { - g || (G(e.$$.fragment, S), G(v), G(w), G(b), G(f.$$.fragment, S), G(q), G(C), G(z), g = !0); + i(D) { + g || (K(e.$$.fragment, D), K(p), K(w), K(b), K(f.$$.fragment, D), K(S), K(C), K(z), g = !0); }, - o(S) { - le(e.$$.fragment, S), le(v), le(w), le(b), le(f.$$.fragment, S), le(q), le(C), le(z), g = !1; + o(D) { + oe(e.$$.fragment, D), oe(p), oe(w), oe(b), oe(f.$$.fragment, D), oe(S), oe(C), oe(z), g = !1; }, - d(S) { - S && (cn(t), cn(n), cn(o), cn(r)), Et(e, S), v && v.d(), w && w.d(), b && b.d(), i[41](null), Et(f), q && q.d(), C && C.d(), z && z.d(); + d(D) { + D && (dn(t), dn(n), dn(o), dn(r)), At(e, D), p && p.d(), w && w.d(), b && b.d(), i[41](null), At(f), S && S.d(), C && C.d(), z && z.d(); } }; } -function Kg(i, e, t) { +function t2(i, e, t) { let { $$slots: n = {}, $$scope: l } = e; - var s = this && this.__awaiter || function(D, at, Ae, vn) { - function vl(Wt) { - return Wt instanceof Ae ? Wt : new Ae(function(pn) { - pn(Wt); + var s = this && this.__awaiter || function(L, It, bt, yn) { + function Ht(wt) { + return wt instanceof bt ? wt : new bt(function(at) { + at(wt); }); } - return new (Ae || (Ae = Promise))(function(Wt, pn) { - function pl(gt) { + return new (bt || (bt = Promise))(function(wt, at) { + function kl(pt) { try { - Zn(vn.next(gt)); - } catch (Gn) { - pn(Gn); + Cn(yn.next(pt)); + } catch (Jn) { + at(Jn); } } - function kl(gt) { + function yl(pt) { try { - Zn(vn.throw(gt)); - } catch (Gn) { - pn(Gn); + Cn(yn.throw(pt)); + } catch (Jn) { + at(Jn); } } - function Zn(gt) { - gt.done ? Wt(gt.value) : vl(gt.value).then(pl, kl); + function Cn(pt) { + pt.done ? wt(pt.value) : Ht(pt.value).then(kl, yl); } - Zn((vn = vn.apply(D, at || [])).next()); + Cn((yn = yn.apply(L, It || [])).next()); }); }; - let { value: o } = e, { label: r = void 0 } = e, { show_label: a } = e, { sources: f = ["upload", "webcam", "clipboard"] } = e, { selectable: c = !1 } = e, { root: u } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: m } = e, { showDownloadButton: h } = e, { showClearButton: g } = e, { boxesAlpha: v } = e, { labelList: w } = e, { labelColors: b } = e, { boxMinSize: k } = e, { handleSize: p } = e, { height: y } = e, { width: q } = e, { boxThickness: C } = e, { disableEditBoxes: z } = e, { singleBox: S } = e, { showRemoveButton: W } = e, { handlesCursor: A } = e, { boxSelectedThickness: F } = e, { max_file_size: K = null } = e, { cli_upload: ne } = e, { stream_handler: U } = e, { useDefaultLabel: Q } = e, M, V = !1, { active_source: R = null } = e; - function Z({ detail: D }) { - t(1, o = new qa()), t(1, o.image = D, o), J("upload"); + let { value: o } = e, { label: r = void 0 } = e, { show_label: a } = e, { sources: f = ["upload", "webcam", "clipboard"] } = e, { selectable: c = !1 } = e, { root: u } = e, { interactive: _ } = e, { i18n: d } = e, { showShareButton: m } = e, { showDownloadButton: h } = e, { showClearButton: g } = e, { boxesAlpha: p } = e, { labelList: w } = e, { labelColors: b } = e, { boxMinSize: k } = e, { handleSize: v } = e, { height: y } = e, { width: S } = e, { boxThickness: C } = e, { disableEditBoxes: z } = e, { singleBox: D } = e, { showRemoveButton: q } = e, { handlesCursor: W } = e, { boxSelectedThickness: F } = e, { max_file_size: J = null } = e, { cli_upload: ie } = e, { stream_handler: P } = e, { useDefaultLabel: $ } = e, R, V = !1, { active_source: A = null } = e; + function Q({ detail: L }) { + t(1, o = new La()), t(1, o.image = L, o), Z("upload"); } - function x(D) { + function ae(L) { return s(this, void 0, void 0, function* () { - const at = yield M.load_files([new File([D], "webcam.png")]), Ae = (at == null ? void 0 : at[0]) || null; - Ae ? (t(1, o = new qa()), t(1, o.image = Ae, o)) : t(1, o = null), yield Og(), J("change"); + const It = yield R.load_files([new File([L], "webcam.png")]), bt = (It == null ? void 0 : It[0]) || null; + bt ? (t(1, o = new La()), t(1, o.image = bt, o)) : t(1, o = null), yield Qg(), Z("change"); }); } - const J = Ng(); - let O = !1; - function H(D) { + const Z = Jg(); + let G = !1; + function X(L) { return s(this, void 0, void 0, function* () { - switch (D) { + switch (L) { case "clipboard": - M.paste_clipboard(); + R.paste_clipboard(); break; } }); } - function Fe() { - t(1, o = null), J("clear"), J("change"); + function ne() { + t(1, o = null), Z("clear"), Z("change"); } - const E = async (D) => D === null ? "" : ``; - function X(D) { - ei.call(this, i, D); + const E = async (L) => L === null ? "" : ``; + function H(L) { + ni.call(this, i, L); } - function $(D) { - ei.call(this, i, D); + function ee(L) { + ni.call(this, i, L); } - function ie(D) { - hi[D ? "unshift" : "push"](() => { - M = D, t(31, M); + function re(L) { + gi[L ? "unshift" : "push"](() => { + R = L, t(31, R); }); } - function L(D) { - V = D, t(29, V); + function M(L) { + V = L, t(29, V); } - function Ke(D) { - O = D, t(30, O); + function Ge(L) { + G = L, t(30, G); } - function Ue(D) { - ei.call(this, i, D); + function ot(L) { + ni.call(this, i, L); } - const Je = (D) => x(D.detail), Ce = (D) => x(D.detail); - function Qe(D) { - ei.call(this, i, D); + const Ke = (L) => ae(L.detail), We = (L) => ae(L.detail); + function Je(L) { + ni.call(this, i, L); } - function xe(D) { - ei.call(this, i, D); + function Xe(L) { + ni.call(this, i, L); } - const Zt = (D) => x(D.detail); - function gl(D) { - o = D, t(1, o); + const gt = (L) => ae(L.detail); + function vi(L) { + o = L, t(1, o); } - const bl = () => J("change"); - function wl(D) { - R = D, t(0, R), t(4, f); + const pl = () => Z("change"); + function vl(L) { + A = L, t(0, A), t(4, f); } - return i.$$set = (D) => { - "value" in D && t(1, o = D.value), "label" in D && t(2, r = D.label), "show_label" in D && t(3, a = D.show_label), "sources" in D && t(4, f = D.sources), "selectable" in D && t(5, c = D.selectable), "root" in D && t(6, u = D.root), "interactive" in D && t(7, _ = D.interactive), "i18n" in D && t(8, d = D.i18n), "showShareButton" in D && t(9, m = D.showShareButton), "showDownloadButton" in D && t(10, h = D.showDownloadButton), "showClearButton" in D && t(11, g = D.showClearButton), "boxesAlpha" in D && t(12, v = D.boxesAlpha), "labelList" in D && t(13, w = D.labelList), "labelColors" in D && t(14, b = D.labelColors), "boxMinSize" in D && t(15, k = D.boxMinSize), "handleSize" in D && t(16, p = D.handleSize), "height" in D && t(17, y = D.height), "width" in D && t(18, q = D.width), "boxThickness" in D && t(19, C = D.boxThickness), "disableEditBoxes" in D && t(20, z = D.disableEditBoxes), "singleBox" in D && t(21, S = D.singleBox), "showRemoveButton" in D && t(22, W = D.showRemoveButton), "handlesCursor" in D && t(23, A = D.handlesCursor), "boxSelectedThickness" in D && t(24, F = D.boxSelectedThickness), "max_file_size" in D && t(25, K = D.max_file_size), "cli_upload" in D && t(26, ne = D.cli_upload), "stream_handler" in D && t(27, U = D.stream_handler), "useDefaultLabel" in D && t(28, Q = D.useDefaultLabel), "active_source" in D && t(0, R = D.active_source), "$$scope" in D && t(53, l = D.$$scope); + return i.$$set = (L) => { + "value" in L && t(1, o = L.value), "label" in L && t(2, r = L.label), "show_label" in L && t(3, a = L.show_label), "sources" in L && t(4, f = L.sources), "selectable" in L && t(5, c = L.selectable), "root" in L && t(6, u = L.root), "interactive" in L && t(7, _ = L.interactive), "i18n" in L && t(8, d = L.i18n), "showShareButton" in L && t(9, m = L.showShareButton), "showDownloadButton" in L && t(10, h = L.showDownloadButton), "showClearButton" in L && t(11, g = L.showClearButton), "boxesAlpha" in L && t(12, p = L.boxesAlpha), "labelList" in L && t(13, w = L.labelList), "labelColors" in L && t(14, b = L.labelColors), "boxMinSize" in L && t(15, k = L.boxMinSize), "handleSize" in L && t(16, v = L.handleSize), "height" in L && t(17, y = L.height), "width" in L && t(18, S = L.width), "boxThickness" in L && t(19, C = L.boxThickness), "disableEditBoxes" in L && t(20, z = L.disableEditBoxes), "singleBox" in L && t(21, D = L.singleBox), "showRemoveButton" in L && t(22, q = L.showRemoveButton), "handlesCursor" in L && t(23, W = L.handlesCursor), "boxSelectedThickness" in L && t(24, F = L.boxSelectedThickness), "max_file_size" in L && t(25, J = L.max_file_size), "cli_upload" in L && t(26, ie = L.cli_upload), "stream_handler" in L && t(27, P = L.stream_handler), "useDefaultLabel" in L && t(28, $ = L.useDefaultLabel), "active_source" in L && t(0, A = L.active_source), "$$scope" in L && t(53, l = L.$$scope); }, i.$$.update = () => { i.$$.dirty[0] & /*uploading*/ - 536870912 && V && Fe(), i.$$.dirty[0] & /*dragging*/ - 1073741824 && J("drag", O), i.$$.dirty[0] & /*active_source, sources*/ - 17 && !R && f && t(0, R = f[0]); + 536870912 && V && ne(), i.$$.dirty[0] & /*dragging*/ + 1073741824 && Z("drag", G), i.$$.dirty[0] & /*active_source, sources*/ + 17 && !A && f && t(0, A = f[0]); }, [ - R, + A, o, r, a, @@ -9859,58 +9890,58 @@ function Kg(i, e, t) { m, h, g, - v, + p, w, b, k, - p, + v, y, - q, + S, C, z, - S, + D, + q, W, - A, F, - K, - ne, - U, - Q, + J, + ie, + P, + $, V, - O, - M, + G, + R, + Q, + ae, Z, - x, - J, - H, - Fe, + X, + ne, n, E, - X, - $, - ie, - L, + H, + ee, + re, + M, + Ge, + ot, Ke, - Ue, + We, Je, - Ce, - Qe, - xe, - Zt, - gl, - bl, - wl, + Xe, + gt, + vi, + pl, + vl, l ]; } -class Jg extends Hg { +class n2 extends Fg { constructor(e) { - super(), jg( + super(), Pg( this, e, - Kg, + t2, + e2, Gg, - Ug, { value: 1, label: 2, @@ -9948,60 +9979,60 @@ class Jg extends Hg { } } const { - SvelteComponent: Qg, - attr: Pi, - detach: Zr, - element: Gr, - init: xg, - insert: Kr, - noop: Ia, - safe_not_equal: $g, + SvelteComponent: i2, + attr: Ki, + detach: Kr, + element: Jr, + init: l2, + insert: Qr, + noop: Ha, + safe_not_equal: s2, src_url_equal: Ta, - toggle_class: Ut + toggle_class: Pt } = window.__gradio__svelte__internal; -function Xa(i) { +function ja(i) { let e, t; return { c() { - e = Gr("img"), Ta(e.src, t = /*value*/ - i[0].url) || Pi(e, "src", t), Pi(e, "alt", ""); + e = Jr("img"), Ta(e.src, t = /*value*/ + i[0].url) || Ki(e, "src", t), Ki(e, "alt", ""); }, m(n, l) { - Kr(n, e, l); + Qr(n, e, l); }, p(n, l) { l & /*value*/ 1 && !Ta(e.src, t = /*value*/ - n[0].url) && Pi(e, "src", t); + n[0].url) && Ki(e, "src", t); }, d(n) { - n && Zr(e); + n && Kr(e); } }; } -function e2(i) { +function o2(i) { let e, t = ( /*value*/ - i[0] && Xa(i) + i[0] && ja(i) ); return { c() { - e = Gr("div"), t && t.c(), Pi(e, "class", "container svelte-1sgcyba"), Ut( + e = Jr("div"), t && t.c(), Ki(e, "class", "container svelte-1sgcyba"), Pt( e, "table", /*type*/ i[1] === "table" - ), Ut( + ), Pt( e, "gallery", /*type*/ i[1] === "gallery" - ), Ut( + ), Pt( e, "selected", /*selected*/ i[2] - ), Ut( + ), Pt( e, "border", /*value*/ @@ -10009,92 +10040,92 @@ function e2(i) { ); }, m(n, l) { - Kr(n, e, l), t && t.m(e, null); + Qr(n, e, l), t && t.m(e, null); }, p(n, [l]) { /*value*/ - n[0] ? t ? t.p(n, l) : (t = Xa(n), t.c(), t.m(e, null)) : t && (t.d(1), t = null), l & /*type*/ - 2 && Ut( + n[0] ? t ? t.p(n, l) : (t = ja(n), t.c(), t.m(e, null)) : t && (t.d(1), t = null), l & /*type*/ + 2 && Pt( e, "table", /*type*/ n[1] === "table" ), l & /*type*/ - 2 && Ut( + 2 && Pt( e, "gallery", /*type*/ n[1] === "gallery" ), l & /*selected*/ - 4 && Ut( + 4 && Pt( e, "selected", /*selected*/ n[2] ), l & /*value*/ - 1 && Ut( + 1 && Pt( e, "border", /*value*/ n[0] ); }, - i: Ia, - o: Ia, + i: Ha, + o: Ha, d(n) { - n && Zr(e), t && t.d(); + n && Kr(e), t && t.d(); } }; } -function t2(i, e, t) { +function a2(i, e, t) { let { value: n } = e, { type: l } = e, { selected: s = !1 } = e; return i.$$set = (o) => { "value" in o && t(0, n = o.value), "type" in o && t(1, l = o.type), "selected" in o && t(2, s = o.selected); }, [n, l, s]; } -class z2 extends Qg { +class E2 extends i2 { constructor(e) { - super(), xg(this, e, t2, e2, $g, { value: 0, type: 1, selected: 2 }); + super(), l2(this, e, a2, o2, s2, { value: 0, type: 1, selected: 2 }); } } const { - SvelteComponent: n2, - add_flush_callback: Ya, - assign: i2, - bind: ja, - binding_callbacks: Fa, - check_outros: l2, - create_component: gn, - destroy_component: bn, - detach: Jr, - empty: s2, - flush: P, - get_spread_object: o2, - get_spread_update: a2, - group_outros: r2, - init: f2, - insert: Qr, - mount_component: wn, - safe_not_equal: c2, - space: u2, - transition_in: Rt, - transition_out: At + SvelteComponent: r2, + add_flush_callback: Fa, + assign: f2, + bind: Ua, + binding_callbacks: Va, + check_outros: c2, + create_component: pn, + destroy_component: vn, + detach: xr, + empty: u2, + flush: O, + get_spread_object: _2, + get_spread_update: d2, + group_outros: h2, + init: m2, + insert: $r, + mount_component: kn, + safe_not_equal: g2, + space: b2, + transition_in: Xt, + transition_out: Yt } = window.__gradio__svelte__internal; -function _2(i) { +function w2(i) { let e, t; - return e = new Jc({ + return e = new iu({ props: { unpadded_box: !0, size: "large", - $$slots: { default: [m2] }, + $$slots: { default: [k2] }, $$scope: { ctx: i } } }), { c() { - gn(e.$$.fragment); + pn(e.$$.fragment); }, m(n, l) { - wn(e, n, l), t = !0; + kn(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -10102,19 +10133,19 @@ function _2(i) { 8192 && (s.$$scope = { dirty: l, ctx: n }), e.$set(s); }, i(n) { - t || (Rt(e.$$.fragment, n), t = !0); + t || (Xt(e.$$.fragment, n), t = !0); }, o(n) { - At(e.$$.fragment, n), t = !1; + Yt(e.$$.fragment, n), t = !1; }, d(n) { - bn(e, n); + vn(e, n); } }; } -function d2(i) { +function p2(i) { let e, t; - return e = new tr({ + return e = new ir({ props: { i18n: ( /*gradio*/ @@ -10125,10 +10156,10 @@ function d2(i) { } }), { c() { - gn(e.$$.fragment); + pn(e.$$.fragment); }, m(n, l) { - wn(e, n, l), t = !0; + kn(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -10137,19 +10168,19 @@ function d2(i) { n[31].i18n), e.$set(s); }, i(n) { - t || (Rt(e.$$.fragment, n), t = !0); + t || (Xt(e.$$.fragment, n), t = !0); }, o(n) { - At(e.$$.fragment, n), t = !1; + Yt(e.$$.fragment, n), t = !1; }, d(n) { - bn(e, n); + vn(e, n); } }; } -function h2(i) { +function v2(i) { let e, t; - return e = new tr({ + return e = new ir({ props: { i18n: ( /*gradio*/ @@ -10159,10 +10190,10 @@ function h2(i) { } }), { c() { - gn(e.$$.fragment); + pn(e.$$.fragment); }, m(n, l) { - wn(e, n, l), t = !0; + kn(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -10171,39 +10202,39 @@ function h2(i) { n[31].i18n), e.$set(s); }, i(n) { - t || (Rt(e.$$.fragment, n), t = !0); + t || (Xt(e.$$.fragment, n), t = !0); }, o(n) { - At(e.$$.fragment, n), t = !1; + Yt(e.$$.fragment, n), t = !1; }, d(n) { - bn(e, n); + vn(e, n); } }; } -function m2(i) { +function k2(i) { let e, t; - return e = new Ga({}), { + return e = new Ja({}), { c() { - gn(e.$$.fragment); + pn(e.$$.fragment); }, m(n, l) { - wn(e, n, l), t = !0; + kn(e, n, l), t = !0; }, i(n) { - t || (Rt(e.$$.fragment, n), t = !0); + t || (Xt(e.$$.fragment, n), t = !0); }, o(n) { - At(e.$$.fragment, n), t = !1; + Yt(e.$$.fragment, n), t = !1; }, d(n) { - bn(e, n); + vn(e, n); } }; } -function g2(i) { +function y2(i) { let e, t, n, l; - const s = [h2, d2, _2], o = []; + const s = [v2, p2, w2], o = []; function r(a, f) { return ( /*active_source*/ @@ -10215,29 +10246,29 @@ function g2(i) { } return e = r(i), t = o[e] = s[e](i), { c() { - t.c(), n = s2(); + t.c(), n = u2(); }, m(a, f) { - o[e].m(a, f), Qr(a, n, f), l = !0; + o[e].m(a, f), $r(a, n, f), l = !0; }, p(a, f) { let c = e; - e = r(a), e === c ? o[e].p(a, f) : (r2(), At(o[c], 1, 1, () => { + e = r(a), e === c ? o[e].p(a, f) : (h2(), Yt(o[c], 1, 1, () => { o[c] = null; - }), l2(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), Rt(t, 1), t.m(n.parentNode, n)); + }), c2(), t = o[e], t ? t.p(a, f) : (t = o[e] = s[e](a), t.c()), Xt(t, 1), t.m(n.parentNode, n)); }, i(a) { - l || (Rt(t), l = !0); + l || (Xt(t), l = !0); }, o(a) { - At(t), l = !1; + Yt(t), l = !1; }, d(a) { - a && Jr(n), o[e].d(a); + a && xr(n), o[e].d(a); } }; } -function b2(i) { +function C2(i) { let e, t, n, l, s, o; const r = [ { @@ -10255,8 +10286,8 @@ function b2(i) { ]; let a = {}; for (let _ = 0; _ < r.length; _ += 1) - a = i2(a, r[_]); - e = new i1({ props: a }); + a = f2(a, r[_]); + e = new c1({ props: a }); function f(_) { i[34](_); } @@ -10372,7 +10403,7 @@ function b2(i) { /*use_default_label*/ i[30] ), - $$slots: { default: [g2] }, + $$slots: { default: [y2] }, $$scope: { ctx: i } }; return ( @@ -10380,7 +10411,7 @@ function b2(i) { i[33] !== void 0 && (u.active_source = /*active_source*/ i[33]), /*value*/ i[0] !== void 0 && (u.value = /*value*/ - i[0]), n = new Jg({ props: u }), Fa.push(() => ja(n, "active_source", f)), Fa.push(() => ja(n, "value", c)), n.$on( + i[0]), n = new n2({ props: u }), Va.push(() => Ua(n, "active_source", f)), Va.push(() => Ua(n, "value", c)), n.$on( "change", /*change_handler*/ i[36] @@ -10414,15 +10445,15 @@ function b2(i) { i[43] ), { c() { - gn(e.$$.fragment), t = u2(), gn(n.$$.fragment); + pn(e.$$.fragment), t = b2(), pn(n.$$.fragment); }, m(_, d) { - wn(e, _, d), Qr(_, t, d), wn(n, _, d), o = !0; + kn(e, _, d), $r(_, t, d), kn(n, _, d), o = !0; }, p(_, d) { const m = d[0] & /*loading_status*/ 2 | d[1] & /*gradio*/ - 1 ? a2(r, [ + 1 ? d2(r, [ d[1] & /*gradio*/ 1 && { autoscroll: ( @@ -10436,7 +10467,7 @@ function b2(i) { _[31].i18n ) }, d[0] & /*loading_status*/ - 2 && o2( + 2 && _2( /*loading_status*/ _[1] ) @@ -10500,25 +10531,25 @@ function b2(i) { _[30]), d[1] & /*$$scope, gradio, active_source*/ 8197 && (h.$$scope = { dirty: d, ctx: _ }), !l && d[1] & /*active_source*/ 4 && (l = !0, h.active_source = /*active_source*/ - _[33], Ya(() => l = !1)), !s && d[0] & /*value*/ + _[33], Fa(() => l = !1)), !s && d[0] & /*value*/ 1 && (s = !0, h.value = /*value*/ - _[0], Ya(() => s = !1)), n.$set(h); + _[0], Fa(() => s = !1)), n.$set(h); }, i(_) { - o || (Rt(e.$$.fragment, _), Rt(n.$$.fragment, _), o = !0); + o || (Xt(e.$$.fragment, _), Xt(n.$$.fragment, _), o = !0); }, o(_) { - At(e.$$.fragment, _), At(n.$$.fragment, _), o = !1; + Yt(e.$$.fragment, _), Yt(n.$$.fragment, _), o = !1; }, d(_) { - _ && Jr(t), bn(e, _), bn(n, _); + _ && xr(t), vn(e, _), vn(n, _); } } ); } -function w2(i) { +function S2(i) { let e, t; - return e = new kf({ + return e = new qf({ props: { visible: ( /*visible*/ @@ -10555,15 +10586,15 @@ function w2(i) { /*min_width*/ i[13] ), - $$slots: { default: [b2] }, + $$slots: { default: [C2] }, $$scope: { ctx: i } } }), { c() { - gn(e.$$.fragment); + pn(e.$$.fragment); }, m(n, l) { - wn(e, n, l), t = !0; + kn(e, n, l), t = !0; }, p(n, l) { const s = {}; @@ -10588,31 +10619,31 @@ function w2(i) { 8199 && (s.$$scope = { dirty: l, ctx: n }), e.$set(s); }, i(n) { - t || (Rt(e.$$.fragment, n), t = !0); + t || (Xt(e.$$.fragment, n), t = !0); }, o(n) { - At(e.$$.fragment, n), t = !1; + Yt(e.$$.fragment, n), t = !1; }, d(n) { - bn(e, n); + vn(e, n); } }; } -function v2(i, e, t) { - let { elem_id: n = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { value: o = null } = e, { label: r } = e, { show_label: a } = e, { root: f } = e, { height: c } = e, { width: u } = e, { _selectable: _ = !1 } = e, { container: d = !0 } = e, { scale: m = null } = e, { min_width: h = void 0 } = e, { loading_status: g } = e, { sources: v = ["upload", "webcam", "clipboard"] } = e, { show_download_button: w } = e, { show_share_button: b } = e, { show_clear_button: k } = e, { interactive: p } = e, { boxes_alpha: y } = e, { label_list: q } = e, { label_colors: C } = e, { box_min_size: z } = e, { handle_size: S } = e, { box_thickness: W } = e, { box_selected_thickness: A } = e, { disable_edit_boxes: F } = e, { single_box: K } = e, { show_remove_button: ne } = e, { handles_cursor: U } = e, { use_default_label: Q } = e, { gradio: M } = e, V, R = null; - function Z(L) { - R = L, t(33, R); +function z2(i, e, t) { + let { elem_id: n = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { value: o = null } = e, { label: r } = e, { show_label: a } = e, { root: f } = e, { height: c } = e, { width: u } = e, { _selectable: _ = !1 } = e, { container: d = !0 } = e, { scale: m = null } = e, { min_width: h = void 0 } = e, { loading_status: g } = e, { sources: p = ["upload", "webcam", "clipboard"] } = e, { show_download_button: w } = e, { show_share_button: b } = e, { show_clear_button: k } = e, { interactive: v } = e, { boxes_alpha: y } = e, { label_list: S } = e, { label_colors: C } = e, { box_min_size: z } = e, { handle_size: D } = e, { box_thickness: q } = e, { box_selected_thickness: W } = e, { disable_edit_boxes: F } = e, { single_box: J } = e, { show_remove_button: ie } = e, { handles_cursor: P } = e, { use_default_label: $ } = e, { gradio: R } = e, V, A = null; + function Q(M) { + A = M, t(33, A); } - function x(L) { - o = L, t(0, o); + function ae(M) { + o = M, t(0, o); } - const J = () => M.dispatch("change"), O = () => M.dispatch("edit"), H = () => { - M.dispatch("clear"); - }, Fe = ({ detail: L }) => t(32, V = L), E = () => M.dispatch("upload"), X = ({ detail: L }) => M.dispatch("select", L), $ = ({ detail: L }) => M.dispatch("share", L), ie = ({ detail: L }) => { - t(1, g = g || {}), t(1, g.status = "error", g), M.dispatch("error", L); + const Z = () => R.dispatch("change"), G = () => R.dispatch("edit"), X = () => { + R.dispatch("clear"); + }, ne = ({ detail: M }) => t(32, V = M), E = () => R.dispatch("upload"), H = ({ detail: M }) => R.dispatch("select", M), ee = ({ detail: M }) => R.dispatch("share", M), re = ({ detail: M }) => { + t(1, g = g || {}), t(1, g.status = "error", g), R.dispatch("error", M); }; - return i.$$set = (L) => { - "elem_id" in L && t(2, n = L.elem_id), "elem_classes" in L && t(3, l = L.elem_classes), "visible" in L && t(4, s = L.visible), "value" in L && t(0, o = L.value), "label" in L && t(5, r = L.label), "show_label" in L && t(6, a = L.show_label), "root" in L && t(7, f = L.root), "height" in L && t(8, c = L.height), "width" in L && t(9, u = L.width), "_selectable" in L && t(10, _ = L._selectable), "container" in L && t(11, d = L.container), "scale" in L && t(12, m = L.scale), "min_width" in L && t(13, h = L.min_width), "loading_status" in L && t(1, g = L.loading_status), "sources" in L && t(14, v = L.sources), "show_download_button" in L && t(15, w = L.show_download_button), "show_share_button" in L && t(16, b = L.show_share_button), "show_clear_button" in L && t(17, k = L.show_clear_button), "interactive" in L && t(18, p = L.interactive), "boxes_alpha" in L && t(19, y = L.boxes_alpha), "label_list" in L && t(20, q = L.label_list), "label_colors" in L && t(21, C = L.label_colors), "box_min_size" in L && t(22, z = L.box_min_size), "handle_size" in L && t(23, S = L.handle_size), "box_thickness" in L && t(24, W = L.box_thickness), "box_selected_thickness" in L && t(25, A = L.box_selected_thickness), "disable_edit_boxes" in L && t(26, F = L.disable_edit_boxes), "single_box" in L && t(27, K = L.single_box), "show_remove_button" in L && t(28, ne = L.show_remove_button), "handles_cursor" in L && t(29, U = L.handles_cursor), "use_default_label" in L && t(30, Q = L.use_default_label), "gradio" in L && t(31, M = L.gradio); + return i.$$set = (M) => { + "elem_id" in M && t(2, n = M.elem_id), "elem_classes" in M && t(3, l = M.elem_classes), "visible" in M && t(4, s = M.visible), "value" in M && t(0, o = M.value), "label" in M && t(5, r = M.label), "show_label" in M && t(6, a = M.show_label), "root" in M && t(7, f = M.root), "height" in M && t(8, c = M.height), "width" in M && t(9, u = M.width), "_selectable" in M && t(10, _ = M._selectable), "container" in M && t(11, d = M.container), "scale" in M && t(12, m = M.scale), "min_width" in M && t(13, h = M.min_width), "loading_status" in M && t(1, g = M.loading_status), "sources" in M && t(14, p = M.sources), "show_download_button" in M && t(15, w = M.show_download_button), "show_share_button" in M && t(16, b = M.show_share_button), "show_clear_button" in M && t(17, k = M.show_clear_button), "interactive" in M && t(18, v = M.interactive), "boxes_alpha" in M && t(19, y = M.boxes_alpha), "label_list" in M && t(20, S = M.label_list), "label_colors" in M && t(21, C = M.label_colors), "box_min_size" in M && t(22, z = M.box_min_size), "handle_size" in M && t(23, D = M.handle_size), "box_thickness" in M && t(24, q = M.box_thickness), "box_selected_thickness" in M && t(25, W = M.box_selected_thickness), "disable_edit_boxes" in M && t(26, F = M.disable_edit_boxes), "single_box" in M && t(27, J = M.single_box), "show_remove_button" in M && t(28, ie = M.show_remove_button), "handles_cursor" in M && t(29, P = M.handles_cursor), "use_default_label" in M && t(30, $ = M.use_default_label), "gradio" in M && t(31, R = M.gradio); }, [ o, g, @@ -10628,46 +10659,46 @@ function v2(i, e, t) { d, m, h, - v, + p, w, b, k, - p, + v, y, - q, + S, C, z, - S, + D, + q, W, - A, F, - K, - ne, - U, - Q, - M, - V, + J, + ie, + P, + $, R, + V, + A, + Q, + ae, Z, - x, - J, - O, - H, - Fe, - E, + G, X, - $, - ie + ne, + E, + H, + ee, + re ]; } -class B2 extends n2 { +class R2 extends r2 { constructor(e) { - super(), f2( + super(), m2( this, e, - v2, - w2, - c2, + z2, + S2, + g2, { elem_id: 2, elem_classes: 3, @@ -10710,196 +10741,196 @@ class B2 extends n2 { return this.$$.ctx[2]; } set elem_id(e) { - this.$$set({ elem_id: e }), P(); + this.$$set({ elem_id: e }), O(); } get elem_classes() { return this.$$.ctx[3]; } set elem_classes(e) { - this.$$set({ elem_classes: e }), P(); + this.$$set({ elem_classes: e }), O(); } get visible() { return this.$$.ctx[4]; } set visible(e) { - this.$$set({ visible: e }), P(); + this.$$set({ visible: e }), O(); } get value() { return this.$$.ctx[0]; } set value(e) { - this.$$set({ value: e }), P(); + this.$$set({ value: e }), O(); } get label() { return this.$$.ctx[5]; } set label(e) { - this.$$set({ label: e }), P(); + this.$$set({ label: e }), O(); } get show_label() { return this.$$.ctx[6]; } set show_label(e) { - this.$$set({ show_label: e }), P(); + this.$$set({ show_label: e }), O(); } get root() { return this.$$.ctx[7]; } set root(e) { - this.$$set({ root: e }), P(); + this.$$set({ root: e }), O(); } get height() { return this.$$.ctx[8]; } set height(e) { - this.$$set({ height: e }), P(); + this.$$set({ height: e }), O(); } get width() { return this.$$.ctx[9]; } set width(e) { - this.$$set({ width: e }), P(); + this.$$set({ width: e }), O(); } get _selectable() { return this.$$.ctx[10]; } set _selectable(e) { - this.$$set({ _selectable: e }), P(); + this.$$set({ _selectable: e }), O(); } get container() { return this.$$.ctx[11]; } set container(e) { - this.$$set({ container: e }), P(); + this.$$set({ container: e }), O(); } get scale() { return this.$$.ctx[12]; } set scale(e) { - this.$$set({ scale: e }), P(); + this.$$set({ scale: e }), O(); } get min_width() { return this.$$.ctx[13]; } set min_width(e) { - this.$$set({ min_width: e }), P(); + this.$$set({ min_width: e }), O(); } get loading_status() { return this.$$.ctx[1]; } set loading_status(e) { - this.$$set({ loading_status: e }), P(); + this.$$set({ loading_status: e }), O(); } get sources() { return this.$$.ctx[14]; } set sources(e) { - this.$$set({ sources: e }), P(); + this.$$set({ sources: e }), O(); } get show_download_button() { return this.$$.ctx[15]; } set show_download_button(e) { - this.$$set({ show_download_button: e }), P(); + this.$$set({ show_download_button: e }), O(); } get show_share_button() { return this.$$.ctx[16]; } set show_share_button(e) { - this.$$set({ show_share_button: e }), P(); + this.$$set({ show_share_button: e }), O(); } get show_clear_button() { return this.$$.ctx[17]; } set show_clear_button(e) { - this.$$set({ show_clear_button: e }), P(); + this.$$set({ show_clear_button: e }), O(); } get interactive() { return this.$$.ctx[18]; } set interactive(e) { - this.$$set({ interactive: e }), P(); + this.$$set({ interactive: e }), O(); } get boxes_alpha() { return this.$$.ctx[19]; } set boxes_alpha(e) { - this.$$set({ boxes_alpha: e }), P(); + this.$$set({ boxes_alpha: e }), O(); } get label_list() { return this.$$.ctx[20]; } set label_list(e) { - this.$$set({ label_list: e }), P(); + this.$$set({ label_list: e }), O(); } get label_colors() { return this.$$.ctx[21]; } set label_colors(e) { - this.$$set({ label_colors: e }), P(); + this.$$set({ label_colors: e }), O(); } get box_min_size() { return this.$$.ctx[22]; } set box_min_size(e) { - this.$$set({ box_min_size: e }), P(); + this.$$set({ box_min_size: e }), O(); } get handle_size() { return this.$$.ctx[23]; } set handle_size(e) { - this.$$set({ handle_size: e }), P(); + this.$$set({ handle_size: e }), O(); } get box_thickness() { return this.$$.ctx[24]; } set box_thickness(e) { - this.$$set({ box_thickness: e }), P(); + this.$$set({ box_thickness: e }), O(); } get box_selected_thickness() { return this.$$.ctx[25]; } set box_selected_thickness(e) { - this.$$set({ box_selected_thickness: e }), P(); + this.$$set({ box_selected_thickness: e }), O(); } get disable_edit_boxes() { return this.$$.ctx[26]; } set disable_edit_boxes(e) { - this.$$set({ disable_edit_boxes: e }), P(); + this.$$set({ disable_edit_boxes: e }), O(); } get single_box() { return this.$$.ctx[27]; } set single_box(e) { - this.$$set({ single_box: e }), P(); + this.$$set({ single_box: e }), O(); } get show_remove_button() { return this.$$.ctx[28]; } set show_remove_button(e) { - this.$$set({ show_remove_button: e }), P(); + this.$$set({ show_remove_button: e }), O(); } get handles_cursor() { return this.$$.ctx[29]; } set handles_cursor(e) { - this.$$set({ handles_cursor: e }), P(); + this.$$set({ handles_cursor: e }), O(); } get use_default_label() { return this.$$.ctx[30]; } set use_default_label(e) { - this.$$set({ use_default_label: e }), P(); + this.$$set({ use_default_label: e }), O(); } get gradio() { return this.$$.ctx[31]; } set gradio(e) { - this.$$set({ gradio: e }), P(); + this.$$set({ gradio: e }), O(); } } export { - z2 as BaseExample, - B2 as default + E2 as BaseExample, + R2 as default };