diff --git "a/src/backend/gradio_highlightedtextbox/templates/component/index.js" "b/src/backend/gradio_highlightedtextbox/templates/component/index.js" --- "a/src/backend/gradio_highlightedtextbox/templates/component/index.js" +++ "b/src/backend/gradio_highlightedtextbox/templates/component/index.js" @@ -1,609 +1,450 @@ const { - SvelteComponent: ll, - assign: nl, + SvelteComponent: nl, + append: se, + attr: U, create_slot: il, - detach: ol, - element: sl, + destroy_each: sl, + detach: oe, + element: ce, + empty: ol, + ensure_array_like: et, get_all_dirty_from_scope: fl, - get_slot_changes: rl, - get_spread_update: al, + get_slot_changes: al, init: _l, - insert: ul, - safe_not_equal: cl, - set_dynamic_element_data: et, - set_style: z, - toggle_class: te, - transition_in: Ot, - transition_out: It, + insert: fe, + safe_not_equal: rl, + set_data: Ue, + space: Fe, + text: Xe, + toggle_class: V, + transition_in: ul, + transition_out: cl, update_slot_base: dl } = window.__gradio__svelte__internal; -function ml(n) { - let e, t, l; - const i = ( - /*#slots*/ - n[18].default - ), o = il( - i, - n, - /*$$scope*/ - n[17], - null - ); - let s = [ - { "data-testid": ( - /*test_id*/ - n[7] - ) }, - { id: ( - /*elem_id*/ - n[2] - ) }, - { - class: t = "block " + /*elem_classes*/ - n[3].join(" ") + " svelte-1t38q2d" - } - ], r = {}; - for (let f = 0; f < s.length; f += 1) - r = nl(r, s[f]); +function tt(l, e, t) { + const n = l.slice(); + return n[8] = e[t][0], n[9] = e[t][1], n[11] = t, n; +} +function lt(l) { + let e, t, n, i, s, o, r = et(Object.entries( + /*_color_map*/ + l[4] + )), _ = []; + for (let f = 0; f < r.length; f += 1) + _[f] = nt(tt(l, r, f)); return { c() { - e = sl( - /*tag*/ - n[14] - ), o && o.c(), et( - /*tag*/ - n[14] - )(e, r), te( - e, - "hidden", - /*visible*/ - n[10] === !1 - ), te( - e, - "padded", - /*padding*/ - n[6] - ), te( - e, - "border_focus", - /*border_mode*/ - n[5] === "focus" - ), te(e, "hide-container", !/*explicit_call*/ - n[8] && !/*container*/ - n[9]), z( - e, - "height", - /*get_dimension*/ - n[15]( - /*height*/ - n[0] - ) - ), z(e, "width", typeof /*width*/ - n[1] == "number" ? `calc(min(${/*width*/ - n[1]}px, 100%))` : ( - /*get_dimension*/ - n[15]( - /*width*/ - n[1] - ) - )), z( - e, - "border-style", - /*variant*/ - n[4] - ), z( - e, - "overflow", - /*allow_overflow*/ - n[11] ? "visible" : "hidden" - ), z( + e = ce("span"), e.textContent = "·", t = Fe(), n = ce("div"), i = ce("span"), s = Xe( + /*legend_label*/ + l[3] + ), o = Fe(); + for (let f = 0; f < _.length; f += 1) + _[f].c(); + U(e, "class", "legend-separator svelte-deja93"), V(e, "hide", !/*show_legend*/ + l[1]), V( e, - "flex-grow", - /*scale*/ - n[12] - ), z(e, "min-width", `calc(min(${/*min_width*/ - n[13]}px, 100%))`), z(e, "border-width", "var(--block-border-width)"); + "has-info", + /*info*/ + l[5] != null + ), U(i, "class", "svelte-deja93"), V(i, "hide", !/*show_legend_label*/ + l[2]), V( + i, + "has-info", + /*info*/ + l[5] != null + ), U(n, "class", "category-legend svelte-deja93"), U(n, "data-testid", "highlighted-text:category-legend"), V(n, "hide", !/*show_legend*/ + l[1]); }, m(f, a) { - ul(f, e, a), o && o.m(e, null), l = !0; + fe(f, e, a), fe(f, t, a), fe(f, n, a), se(n, i), se(i, s), se(n, o); + for (let u = 0; u < _.length; u += 1) + _[u] && _[u].m(n, null); }, p(f, a) { - o && o.p && (!l || a & /*$$scope*/ - 131072) && dl( - o, - i, - f, - /*$$scope*/ - f[17], - l ? rl( - i, - /*$$scope*/ - f[17], - a, - null - ) : fl( - /*$$scope*/ - f[17] - ), - null - ), et( - /*tag*/ - f[14] - )(e, r = al(s, [ - (!l || a & /*test_id*/ - 128) && { "data-testid": ( - /*test_id*/ - f[7] - ) }, - (!l || a & /*elem_id*/ - 4) && { id: ( - /*elem_id*/ - f[2] - ) }, - (!l || a & /*elem_classes*/ - 8 && t !== (t = "block " + /*elem_classes*/ - f[3].join(" ") + " svelte-1t38q2d")) && { class: t } - ])), te( - e, - "hidden", - /*visible*/ - f[10] === !1 - ), te( - e, - "padded", - /*padding*/ - f[6] - ), te( - e, - "border_focus", - /*border_mode*/ - f[5] === "focus" - ), te(e, "hide-container", !/*explicit_call*/ - f[8] && !/*container*/ - f[9]), a & /*height*/ - 1 && z( - e, - "height", - /*get_dimension*/ - f[15]( - /*height*/ - f[0] - ) - ), a & /*width*/ - 2 && z(e, "width", typeof /*width*/ - f[1] == "number" ? `calc(min(${/*width*/ - f[1]}px, 100%))` : ( - /*get_dimension*/ - f[15]( - /*width*/ - f[1] - ) - )), a & /*variant*/ - 16 && z( - e, - "border-style", - /*variant*/ - f[4] - ), a & /*allow_overflow*/ - 2048 && z( - e, - "overflow", - /*allow_overflow*/ - f[11] ? "visible" : "hidden" - ), a & /*scale*/ - 4096 && z( + if (a & /*show_legend*/ + 2 && V(e, "hide", !/*show_legend*/ + f[1]), a & /*info*/ + 32 && V( e, - "flex-grow", - /*scale*/ - f[12] - ), a & /*min_width*/ - 8192 && z(e, "min-width", `calc(min(${/*min_width*/ - f[13]}px, 100%))`); - }, - i(f) { - l || (Ot(o, f), l = !0); - }, - o(f) { - It(o, f), l = !1; + "has-info", + /*info*/ + f[5] != null + ), a & /*legend_label*/ + 8 && Ue( + s, + /*legend_label*/ + f[3] + ), a & /*show_legend_label*/ + 4 && V(i, "hide", !/*show_legend_label*/ + f[2]), a & /*info*/ + 32 && V( + i, + "has-info", + /*info*/ + f[5] != null + ), a & /*Object, _color_map*/ + 16) { + r = et(Object.entries( + /*_color_map*/ + f[4] + )); + let u; + for (u = 0; u < r.length; u += 1) { + const c = tt(f, r, u); + _[u] ? _[u].p(c, a) : (_[u] = nt(c), _[u].c(), _[u].m(n, null)); + } + for (; u < _.length; u += 1) + _[u].d(1); + _.length = r.length; + } + a & /*show_legend*/ + 2 && V(n, "hide", !/*show_legend*/ + f[1]); }, d(f) { - f && ol(e), o && o.d(f); + f && (oe(e), oe(t), oe(n)), sl(_, f); } }; } -function bl(n) { +function nt(l) { let e, t = ( - /*tag*/ - n[14] && ml(n) - ); - return { - c() { - t && t.c(); - }, - m(l, i) { - t && t.m(l, i), e = !0; - }, - p(l, [i]) { - /*tag*/ - l[14] && t.p(l, i); - }, - i(l) { - e || (Ot(t, l), e = !0); - }, - o(l) { - It(t, l), e = !1; - }, - d(l) { - t && t.d(l); - } - }; -} -function gl(n, e, t) { - let { $$slots: l = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: s = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: f = [] } = e, { variant: a = "solid" } = e, { border_mode: _ = "base" } = e, { padding: u = !0 } = e, { type: c = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: p = !1 } = e, { container: T = !0 } = e, { visible: S = !0 } = e, { allow_overflow: L = !0 } = e, { scale: C = null } = e, { min_width: d = 0 } = e, y = c === "fieldset" ? "fieldset" : "div"; - const M = (b) => { - if (b !== void 0) { - if (typeof b == "number") - return b + "px"; - if (typeof b == "string") - return b; - } - }; - return n.$$set = (b) => { - "height" in b && t(0, o = b.height), "width" in b && t(1, s = b.width), "elem_id" in b && t(2, r = b.elem_id), "elem_classes" in b && t(3, f = b.elem_classes), "variant" in b && t(4, a = b.variant), "border_mode" in b && t(5, _ = b.border_mode), "padding" in b && t(6, u = b.padding), "type" in b && t(16, c = b.type), "test_id" in b && t(7, m = b.test_id), "explicit_call" in b && t(8, p = b.explicit_call), "container" in b && t(9, T = b.container), "visible" in b && t(10, S = b.visible), "allow_overflow" in b && t(11, L = b.allow_overflow), "scale" in b && t(12, C = b.scale), "min_width" in b && t(13, d = b.min_width), "$$scope" in b && t(17, i = b.$$scope); - }, [ - o, - s, - r, - f, - a, - _, - u, - m, - p, - T, - S, - L, - C, - d, - y, - M, - c, - i, - l - ]; -} -class hl extends ll { - constructor(e) { - super(), _l(this, e, gl, bl, cl, { - height: 0, - width: 1, - elem_id: 2, - elem_classes: 3, - variant: 4, - border_mode: 5, - padding: 6, - type: 16, - test_id: 7, - explicit_call: 8, - container: 9, - visible: 10, - allow_overflow: 11, - scale: 12, - min_width: 13 - }); - } -} -const { - SvelteComponent: wl, - attr: pl, - create_slot: kl, - detach: vl, - element: yl, - get_all_dirty_from_scope: Cl, - get_slot_changes: ql, - init: Sl, - insert: Ll, - safe_not_equal: Tl, - transition_in: Fl, - transition_out: Ml, - update_slot_base: Nl -} = window.__gradio__svelte__internal; -function Hl(n) { - let e, t; - const l = ( - /*#slots*/ - n[1].default - ), i = kl( - l, - n, - /*$$scope*/ - n[0], - null - ); + /*category*/ + l[8] + "" + ), n, i, s; return { c() { - e = yl("div"), i && i.c(), pl(e, "class", "svelte-1hnfib2"); + e = ce("div"), n = Xe(t), i = Fe(), U(e, "class", "category-label svelte-deja93"), U(e, "style", s = "background-color:" + /*color*/ + l[9].secondary); }, - m(o, s) { - Ll(o, e, s), i && i.m(e, null), t = !0; + m(o, r) { + fe(o, e, r), se(e, n), se(e, i); }, - p(o, [s]) { - i && i.p && (!t || s & /*$$scope*/ - 1) && Nl( - i, - l, - o, - /*$$scope*/ - o[0], - t ? ql( - l, - /*$$scope*/ - o[0], - s, - null - ) : Cl( - /*$$scope*/ - o[0] - ), - null - ); - }, - i(o) { - t || (Fl(i, o), t = !0); - }, - o(o) { - Ml(i, o), t = !1; + p(o, r) { + r & /*_color_map*/ + 16 && t !== (t = /*category*/ + o[8] + "") && Ue(n, t), r & /*_color_map*/ + 16 && s !== (s = "background-color:" + /*color*/ + o[9].secondary) && U(e, "style", s); }, d(o) { - o && vl(e), i && i.d(o); + o && oe(e); } }; } -function jl(n, e, t) { - let { $$slots: l = {}, $$scope: i } = e; - return n.$$set = (o) => { - "$$scope" in o && t(0, i = o.$$scope); - }, [i, l]; -} -class Vl extends wl { - constructor(e) { - super(), Sl(this, e, jl, Hl, Tl, {}); - } -} -const { - SvelteComponent: Al, - attr: tt, - check_outros: zl, - create_component: El, - create_slot: Pl, - destroy_component: Zl, - detach: je, - element: Bl, - empty: Rl, - get_all_dirty_from_scope: Dl, - get_slot_changes: Ol, - group_outros: Il, - init: Ul, - insert: Ve, - mount_component: Wl, - safe_not_equal: Xl, - set_data: Yl, - space: Gl, - text: Jl, - toggle_class: ge, - transition_in: Se, - transition_out: Ae, - update_slot_base: Kl -} = window.__gradio__svelte__internal; -function lt(n) { +function it(l) { let e, t; - return e = new Vl({ - props: { - $$slots: { default: [Ql] }, - $$scope: { ctx: n } - } - }), { - c() { - El(e.$$.fragment); - }, - m(l, i) { - Wl(e, l, i), t = !0; - }, - p(l, i) { - const o = {}; - i & /*$$scope, info*/ - 10 && (o.$$scope = { dirty: i, ctx: l }), e.$set(o); - }, - i(l) { - t || (Se(e.$$.fragment, l), t = !0); - }, - o(l) { - Ae(e.$$.fragment, l), t = !1; - }, - d(l) { - Zl(e, l); - } - }; -} -function Ql(n) { - let e; return { c() { - e = Jl( + e = ce("div"), t = Xe( /*info*/ - n[1] - ); + l[5] + ), U(e, "class", "title-with-highlights-info svelte-deja93"); }, - m(t, l) { - Ve(t, e, l); + m(n, i) { + fe(n, e, i), se(e, t); }, - p(t, l) { - l & /*info*/ - 2 && Yl( - e, + p(n, i) { + i & /*info*/ + 32 && Ue( + t, /*info*/ - t[1] + n[5] ); }, - d(t) { - t && je(e); + d(n) { + n && oe(e); } }; } -function xl(n) { - let e, t, l, i; - const o = ( +function ml(l) { + let e, t, n, i = Object.keys( + /*_color_map*/ + l[4] + ).length !== 0, s, o, r; + const _ = ( /*#slots*/ - n[2].default - ), s = Pl( - o, - n, + l[7].default + ), f = il( + _, + l, /*$$scope*/ - n[3], + l[6], null ); - let r = ( + let a = i && lt(l), u = ( /*info*/ - n[1] && lt(n) + l[5] && it(l) ); return { c() { - e = Bl("span"), s && s.c(), t = Gl(), r && r.c(), l = Rl(), tt(e, "data-testid", "block-info"), tt(e, "class", "svelte-22c38v"), ge(e, "sr-only", !/*show_label*/ - n[0]), ge(e, "hide", !/*show_label*/ - n[0]), ge( - e, + e = ce("div"), t = ce("span"), f && f.c(), n = Fe(), a && a.c(), s = Fe(), u && u.c(), o = ol(), U(t, "data-testid", "block-info"), U(t, "class", "svelte-deja93"), V(t, "sr-only", !/*show_label*/ + l[0]), V(t, "hide", !/*show_label*/ + l[0]), V( + t, "has-info", /*info*/ - n[1] != null - ); + l[5] != null + ), U(e, "class", "title-container svelte-deja93"); }, - m(f, a) { - Ve(f, e, a), s && s.m(e, null), Ve(f, t, a), r && r.m(f, a), Ve(f, l, a), i = !0; + m(c, m) { + fe(c, e, m), se(e, t), f && f.m(t, null), se(e, n), a && a.m(e, null), fe(c, s, m), u && u.m(c, m), fe(c, o, m), r = !0; }, - p(f, [a]) { - s && s.p && (!i || a & /*$$scope*/ - 8) && Kl( - s, - o, + p(c, [m]) { + f && f.p && (!r || m & /*$$scope*/ + 64) && dl( f, + _, + c, /*$$scope*/ - f[3], - i ? Ol( - o, + c[6], + r ? al( + _, /*$$scope*/ - f[3], - a, + c[6], + m, null - ) : Dl( + ) : fl( /*$$scope*/ - f[3] + c[6] ), null - ), (!i || a & /*show_label*/ - 1) && ge(e, "sr-only", !/*show_label*/ - f[0]), (!i || a & /*show_label*/ - 1) && ge(e, "hide", !/*show_label*/ - f[0]), (!i || a & /*info*/ - 2) && ge( - e, + ), (!r || m & /*show_label*/ + 1) && V(t, "sr-only", !/*show_label*/ + c[0]), (!r || m & /*show_label*/ + 1) && V(t, "hide", !/*show_label*/ + c[0]), (!r || m & /*info*/ + 32) && V( + t, "has-info", /*info*/ - f[1] != null - ), /*info*/ - f[1] ? r ? (r.p(f, a), a & /*info*/ - 2 && Se(r, 1)) : (r = lt(f), r.c(), Se(r, 1), r.m(l.parentNode, l)) : r && (Il(), Ae(r, 1, 1, () => { - r = null; - }), zl()); + c[5] != null + ), m & /*_color_map*/ + 16 && (i = Object.keys( + /*_color_map*/ + c[4] + ).length !== 0), i ? a ? a.p(c, m) : (a = lt(c), a.c(), a.m(e, null)) : a && (a.d(1), a = null), /*info*/ + c[5] ? u ? u.p(c, m) : (u = it(c), u.c(), u.m(o.parentNode, o)) : u && (u.d(1), u = null); }, - i(f) { - i || (Se(s, f), Se(r), i = !0); + i(c) { + r || (ul(f, c), r = !0); }, - o(f) { - Ae(s, f), Ae(r), i = !1; + o(c) { + cl(f, c), r = !1; }, - d(f) { - f && (je(e), je(t), je(l)), s && s.d(f), r && r.d(f); + d(c) { + c && (oe(e), oe(s), oe(o)), f && f.d(c), a && a.d(), u && u.d(c); } }; } -function $l(n, e, t) { - let { $$slots: l = {}, $$scope: i } = e, { show_label: o = !0 } = e, { info: s = void 0 } = e; - return n.$$set = (r) => { - "show_label" in r && t(0, o = r.show_label), "info" in r && t(1, s = r.info), "$$scope" in r && t(3, i = r.$$scope); - }, [o, s, l, i]; +function hl(l, e, t) { + let { $$slots: n = {}, $$scope: i } = e, { show_label: s = !0 } = e, { show_legend: o = !0 } = e, { show_legend_label: r = !0 } = e, { legend_label: _ = "Highlights:" } = e, { _color_map: f = {} } = e, { info: a = void 0 } = e; + return l.$$set = (u) => { + "show_label" in u && t(0, s = u.show_label), "show_legend" in u && t(1, o = u.show_legend), "show_legend_label" in u && t(2, r = u.show_legend_label), "legend_label" in u && t(3, _ = u.legend_label), "_color_map" in u && t(4, f = u._color_map), "info" in u && t(5, a = u.info), "$$scope" in u && t(6, i = u.$$scope); + }, [ + s, + o, + r, + _, + f, + a, + i, + n + ]; } -class en extends Al { +class gl extends nl { constructor(e) { - super(), Ul(this, e, $l, xl, Xl, { show_label: 0, info: 1 }); + super(), _l(this, e, hl, ml, rl, { + show_label: 0, + show_legend: 1, + show_legend_label: 2, + legend_label: 3, + _color_map: 4, + info: 5 + }); } } const { - SvelteComponent: tn, - append: ln, - attr: le, - detach: nn, - init: on, - insert: sn, - noop: Be, - safe_not_equal: fn, - svg_element: nt + SvelteComponent: bl, + append: wl, + attr: te, + detach: kl, + init: vl, + insert: pl, + noop: Ze, + safe_not_equal: yl, + svg_element: st } = window.__gradio__svelte__internal; -function rn(n) { +function Cl(l) { let e, t; return { c() { - e = nt("svg"), t = nt("polyline"), le(t, "points", "20 6 9 17 4 12"), le(e, "xmlns", "http://www.w3.org/2000/svg"), le(e, "viewBox", "2 0 20 20"), le(e, "fill", "none"), le(e, "stroke", "currentColor"), le(e, "stroke-width", "3"), le(e, "stroke-linecap", "round"), le(e, "stroke-linejoin", "round"); + e = st("svg"), t = st("polyline"), te(t, "points", "20 6 9 17 4 12"), te(e, "xmlns", "http://www.w3.org/2000/svg"), te(e, "viewBox", "2 0 20 20"), te(e, "fill", "none"), te(e, "stroke", "currentColor"), te(e, "stroke-width", "3"), te(e, "stroke-linecap", "round"), te(e, "stroke-linejoin", "round"); }, - m(l, i) { - sn(l, e, i), ln(e, t); + m(n, i) { + pl(n, e, i), wl(e, t); }, - p: Be, - i: Be, - o: Be, - d(l) { - l && nn(e); + p: Ze, + i: Ze, + o: Ze, + d(n) { + n && kl(e); } }; } -class an extends tn { +class ql extends bl { constructor(e) { - super(), on(this, e, null, rn, fn, {}); + super(), vl(this, e, null, Cl, yl, {}); } } const { - SvelteComponent: _n, - append: it, - attr: ae, - detach: un, - init: cn, - insert: dn, - noop: Re, - safe_not_equal: mn, - svg_element: De + SvelteComponent: Tl, + append: ot, + attr: re, + detach: Ll, + init: Sl, + insert: jl, + noop: Oe, + safe_not_equal: Fl, + svg_element: Re } = window.__gradio__svelte__internal; -function bn(n) { - let e, t, l; +function Hl(l) { + let e, t, n; return { c() { - e = De("svg"), t = De("path"), l = De("path"), ae(t, "fill", "currentColor"), ae(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), ae(l, "fill", "currentColor"), ae(l, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), ae(e, "xmlns", "http://www.w3.org/2000/svg"), ae(e, "viewBox", "0 0 33 33"), ae(e, "color", "currentColor"); + e = Re("svg"), t = Re("path"), n = Re("path"), re(t, "fill", "currentColor"), re(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), re(n, "fill", "currentColor"), re(n, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), re(e, "xmlns", "http://www.w3.org/2000/svg"), re(e, "viewBox", "0 0 33 33"), re(e, "color", "currentColor"); }, - m(i, o) { - dn(i, e, o), it(e, t), it(e, l); + m(i, s) { + jl(i, e, s), ot(e, t), ot(e, n); }, - p: Re, - i: Re, - o: Re, + p: Oe, + i: Oe, + o: Oe, d(i) { - i && un(e); + i && Ll(e); } }; } -class gn extends _n { +class Ml extends Tl { constructor(e) { - super(), cn(this, e, null, bn, mn, {}); + super(), Sl(this, e, null, Hl, Fl, {}); } } -const ot = [ +function ze() { +} +const Nl = (l) => l; +function Vl(l, e) { + return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function"; +} +const Dt = typeof window < "u"; +let ft = Dt ? () => window.performance.now() : () => Date.now(), It = Dt ? (l) => requestAnimationFrame(l) : ze; +const qe = /* @__PURE__ */ new Set(); +function Wt(l) { + qe.forEach((e) => { + e.c(l) || (qe.delete(e), e.f()); + }), qe.size !== 0 && It(Wt); +} +function Al(l) { + let e; + return qe.size === 0 && It(Wt), { + promise: new Promise((t) => { + qe.add(e = { c: l, f: t }); + }), + abort() { + qe.delete(e); + } + }; +} +function zl(l, { delay: e = 0, duration: t = 400, easing: n = Nl } = {}) { + const i = +getComputedStyle(l).opacity; + return { + delay: e, + duration: t, + easing: n, + css: (s) => `opacity: ${s * i}` + }; +} +const ve = []; +function Bl(l, e = ze) { + let t; + const n = /* @__PURE__ */ new Set(); + function i(r) { + if (Vl(l, r) && (l = r, t)) { + const _ = !ve.length; + for (const f of n) + f[1](), ve.push(f, l); + if (_) { + for (let f = 0; f < ve.length; f += 2) + ve[f][0](ve[f + 1]); + ve.length = 0; + } + } + } + function s(r) { + i(r(l)); + } + function o(r, _ = ze) { + const f = [r, _]; + return n.add(f), n.size === 1 && (t = e(i, s) || ze), r(l), () => { + n.delete(f), n.size === 0 && t && (t(), t = null); + }; + } + return { set: i, update: s, subscribe: o }; +} +function at(l) { + return Object.prototype.toString.call(l) === "[object Date]"; +} +function Ie(l, e, t, n) { + if (typeof t == "number" || at(t)) { + const i = n - t, s = (t - e) / (l.dt || 1 / 60), o = l.opts.stiffness * i, r = l.opts.damping * s, _ = (o - r) * l.inv_mass, f = (s + _) * l.dt; + return Math.abs(f) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, at(t) ? new Date(t.getTime() + f) : t + f); + } else { + if (Array.isArray(t)) + return t.map( + (i, s) => Ie(l, e[s], t[s], n[s]) + ); + if (typeof t == "object") { + const i = {}; + for (const s in t) + i[s] = Ie(l, e[s], t[s], n[s]); + return i; + } else + throw new Error(`Cannot spring ${typeof t} values`); + } +} +function _t(l, e = {}) { + const t = Bl(l), { stiffness: n = 0.15, damping: i = 0.8, precision: s = 0.01 } = e; + let o, r, _, f = l, a = l, u = 1, c = 0, m = !1; + function y(T, L = {}) { + a = T; + const C = _ = {}; + return l == null || L.hard || S.stiffness >= 1 && S.damping >= 1 ? (m = !0, o = ft(), f = T, t.set(l = a), Promise.resolve()) : (L.soft && (c = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), u = 0), r || (o = ft(), m = !1, r = Al((d) => { + if (m) + return m = !1, r = null, !1; + u = Math.min(u + c, 1); + const p = { + inv_mass: u, + opts: S, + settled: !0, + dt: (d - o) * 60 / 1e3 + }, F = Ie(p, f, l, a); + return o = d, f = l, t.set(l = F), p.settled && (r = null), !p.settled; + })), new Promise((d) => { + r.promise.then(() => { + C === _ && d(); + }); + })); + } + const S = { + set: y, + update: (T, L) => y(T(a, l), L), + subscribe: t.subscribe, + stiffness: n, + damping: i, + precision: s + }; + return S; +} +const rt = [ "red", "green", "blue", @@ -614,7 +455,7 @@ const ot = [ "cyan", "lime", "pink" -], hn = [ +], El = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -625,7 +466,7 @@ const ot = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], st = { +], ut = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -917,828 +758,932 @@ const ot = [ 900: "#881337", 950: "#4c0519" } -}, ft = hn.reduce( - (n, { color: e, primary: t, secondary: l }) => ({ - ...n, +}, ct = El.reduce( + (l, { color: e, primary: t, secondary: n }) => ({ + ...l, [e]: { - primary: st[e][t], - secondary: st[e][l] + primary: ut[e][t], + secondary: ut[e][n] } }), {} -), wn = (n) => ot[n % ot.length]; -function ze() { -} -const pn = (n) => n; -function kn(n, e) { - return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function"; -} -const Ut = typeof window < "u"; -let rt = Ut ? () => window.performance.now() : () => Date.now(), Wt = Ut ? (n) => requestAnimationFrame(n) : ze; -const ke = /* @__PURE__ */ new Set(); -function Xt(n) { - ke.forEach((e) => { - e.c(n) || (ke.delete(e), e.f()); - }), ke.size !== 0 && Wt(Xt); -} -function vn(n) { - let e; - return ke.size === 0 && Wt(Xt), { - promise: new Promise((t) => { - ke.add(e = { c: n, f: t }); - }), - abort() { - ke.delete(e); - } - }; -} -function yn(n, { delay: e = 0, duration: t = 400, easing: l = pn } = {}) { - const i = +getComputedStyle(n).opacity; - return { - delay: e, - duration: t, - easing: l, - css: (o) => `opacity: ${o * i}` - }; -} -const he = []; -function Cn(n, e = ze) { - let t; - const l = /* @__PURE__ */ new Set(); - function i(r) { - if (kn(n, r) && (n = r, t)) { - const f = !he.length; - for (const a of l) - a[1](), he.push(a, n); - if (f) { - for (let a = 0; a < he.length; a += 2) - he[a][0](he[a + 1]); - he.length = 0; - } - } - } - function o(r) { - i(r(n)); - } - function s(r, f = ze) { - const a = [r, f]; - return l.add(a), l.size === 1 && (t = e(i, o) || ze), r(n), () => { - l.delete(a), l.size === 0 && t && (t(), t = null); - }; - } - return { set: i, update: o, subscribe: s }; -} -function at(n) { - return Object.prototype.toString.call(n) === "[object Date]"; -} -function Ie(n, e, t, l) { - if (typeof t == "number" || at(t)) { - const i = l - t, o = (t - e) / (n.dt || 1 / 60), s = n.opts.stiffness * i, r = n.opts.damping * o, f = (s - r) * n.inv_mass, a = (o + f) * n.dt; - return Math.abs(a) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, at(t) ? new Date(t.getTime() + a) : t + a); - } else { - if (Array.isArray(t)) - return t.map( - (i, o) => Ie(n, e[o], t[o], l[o]) - ); - if (typeof t == "object") { - const i = {}; - for (const o in t) - i[o] = Ie(n, e[o], t[o], l[o]); - return i; - } else - throw new Error(`Cannot spring ${typeof t} values`); - } -} -function _t(n, e = {}) { - const t = Cn(n), { stiffness: l = 0.15, damping: i = 0.8, precision: o = 0.01 } = e; - let s, r, f, a = n, _ = n, u = 1, c = 0, m = !1; - function p(S, L = {}) { - _ = S; - const C = f = {}; - return n == null || L.hard || T.stiffness >= 1 && T.damping >= 1 ? (m = !0, s = rt(), a = S, t.set(n = _), Promise.resolve()) : (L.soft && (c = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), u = 0), r || (s = rt(), m = !1, r = vn((d) => { - if (m) - return m = !1, r = null, !1; - u = Math.min(u + c, 1); - const y = { - inv_mass: u, - opts: T, - settled: !0, - dt: (d - s) * 60 / 1e3 - }, M = Ie(y, a, n, _); - return s = d, a = n, t.set(n = M), y.settled && (r = null), !y.settled; - })), new Promise((d) => { - r.promise.then(() => { - C === f && d(); - }); - })); - } - const T = { - set: p, - update: (S, L) => p(S(_, n), L), - subscribe: t.subscribe, - stiffness: l, - damping: i, - precision: o - }; - return T; -} -function ut(n, e, t) { +), Pl = (l) => rt[l % rt.length]; +function dt(l, e, t) { if (!t) { - var l = document.createElement("canvas"); - t = l.getContext("2d"); - } - t.fillStyle = n, t.fillRect(0, 0, 1, 1); - const [i, o, s] = t.getImageData(0, 0, 1, 1).data; - return t.clearRect(0, 0, 1, 1), `rgba(${i}, ${o}, ${s}, ${255 / e})`; -} -function qn(n, e, t) { - var l = {}; - for (const i in n) { - const o = n[i].trim(); - o in ft ? l[i] = ft[o] : l[i] = { - primary: e ? ut(n[i], 1, t) : n[i], - secondary: e ? ut(n[i], 0.5, t) : n[i] + var n = document.createElement("canvas"); + t = n.getContext("2d"); + } + t.fillStyle = l, t.fillRect(0, 0, 1, 1); + const [i, s, o] = t.getImageData(0, 0, 1, 1).data; + return t.clearRect(0, 0, 1, 1), `rgba(${i}, ${s}, ${o}, ${255 / e})`; +} +function Zl(l, e, t) { + var n = {}; + for (const i in l) { + const s = l[i].trim(); + s in ct ? n[i] = ct[s] : n[i] = { + primary: e ? dt(l[i], 1, t) : l[i], + secondary: e ? dt(l[i], 0.5, t) : l[i] }; } - return l; + return n; } -function Sn(n, e) { - let t = [], l = null, i = null; - for (const [o, s] of n) - e === "empty" && s === null || e === "equal" && i === s ? l = l ? l + o : o : (l !== null && t.push([l, i]), l = o, i = s); - return l !== null && t.push([l, i]), t; +function Ol(l, e) { + let t = [], n = null, i = null; + for (const [s, o] of l) + e === "empty" && o === null || e === "equal" && i === o ? n = n ? n + s : s : (n !== null && t.push([n, i]), n = s, i = o); + return n !== null && t.push([n, i]), t; } -function Ln(n) { +function Rl(l) { const e = window.getSelection(); if (e.rangeCount > 0) { - const t = document.createRange(); - return t.setStart(n, 0), e.anchorNode !== null && t.setEnd(e.anchorNode, e.anchorOffset), t.toString().length; - } - return -1; -} -function Tn(n, e) { - var t = document.createTreeWalker(n, NodeFilter.SHOW_TEXT), l = t.nextNode(); - if (!l || !l.textContent) - return null; - for (var i = l.textContent.length; i < e; ) - if (l = t.nextNode(), l && l.textContent) - i += l.textContent.length; - else - return null; - var o = l.textContent.length - (i - e); - return { node: l, offset: o }; -} -const { - SvelteComponent: Fn, - add_render_callback: We, - append: ue, - attr: H, - binding_callbacks: ct, - bubble: qe, - check_outros: Yt, - create_component: Xe, - create_in_transition: Mn, - destroy_component: Ye, - destroy_each: Nn, - detach: J, - element: oe, - empty: Hn, - ensure_array_like: dt, - group_outros: Gt, - init: jn, - insert: K, - listen: X, - mount_component: Ge, - noop: Jt, - run_all: Vn, - safe_not_equal: An, - set_data: Je, - space: Le, - text: Ke, - toggle_class: mt, - transition_in: ne, - transition_out: ce -} = window.__gradio__svelte__internal, { beforeUpdate: zn, afterUpdate: En, createEventDispatcher: Pn } = window.__gradio__svelte__internal; -function bt(n, e, t) { - const l = n.slice(); - return l[39] = e[t][0], l[40] = e[t][1], l[42] = t, l; -} -function gt(n) { - let e, t, l = ( - /*show_legend_label*/ - n[5] && ht(n) - ), i = dt(Object.entries( - /*_color_map*/ - n[12] - )), o = []; - for (let s = 0; s < i.length; s += 1) - o[s] = wt(bt(n, i, s)); - return { - c() { - e = oe("div"), l && l.c(), t = Le(); - for (let s = 0; s < o.length; s += 1) - o[s].c(); - H(e, "class", "category-legend svelte-1u11ied"), H(e, "data-testid", "highlighted-text:category-legend"); - }, - m(s, r) { - K(s, e, r), l && l.m(e, null), ue(e, t); - for (let f = 0; f < o.length; f += 1) - o[f] && o[f].m(e, null); - }, - p(s, r) { - if (/*show_legend_label*/ - s[5] ? l ? l.p(s, r) : (l = ht(s), l.c(), l.m(e, t)) : l && (l.d(1), l = null), r[0] & /*_color_map*/ - 4096) { - i = dt(Object.entries( - /*_color_map*/ - s[12] - )); - let f; - for (f = 0; f < i.length; f += 1) { - const a = bt(s, i, f); - o[f] ? o[f].p(a, r) : (o[f] = wt(a), o[f].c(), o[f].m(e, null)); - } - for (; f < o.length; f += 1) - o[f].d(1); - o.length = i.length; - } - }, - d(s) { - s && J(e), l && l.d(), Nn(o, s); - } - }; -} -function ht(n) { - let e, t; - return { - c() { - e = oe("div"), t = Ke( - /*legend_label*/ - n[1] - ), H(e, "class", "legend-description svelte-1u11ied"); - }, - m(l, i) { - K(l, e, i), ue(e, t); - }, - p(l, i) { - i[0] & /*legend_label*/ - 2 && Je( - t, - /*legend_label*/ - l[1] - ); - }, - d(l) { - l && J(e); - } - }; -} -function wt(n) { - let e, t = ( - /*category*/ - n[39] + "" - ), l, i, o; - return { - c() { - e = oe("div"), l = Ke(t), i = Le(), H(e, "class", "category-label svelte-1u11ied"), H(e, "style", o = "background-color:" + /*color*/ - n[40].secondary); - }, - m(s, r) { - K(s, e, r), ue(e, l), ue(e, i); - }, - p(s, r) { - r[0] & /*_color_map*/ - 4096 && t !== (t = /*category*/ - s[39] + "") && Je(l, t), r[0] & /*_color_map*/ - 4096 && o !== (o = "background-color:" + /*color*/ - s[40].secondary) && H(e, "style", o); - }, - d(s) { - s && J(e); - } - }; + const t = document.createRange(); + return t.setStart(l, 0), e.anchorNode !== null && t.setEnd(e.anchorNode, e.anchorOffset), t.toString().length; + } + return -1; +} +function Dl(l, e) { + var t = document.createTreeWalker(l, NodeFilter.SHOW_TEXT), n = t.nextNode(); + if (!n || !n.textContent) + return null; + for (var i = n.textContent.length; i < e; ) + if (n = t.nextNode(), n && n.textContent) + i += n.textContent.length; + else + return null; + var s = n.textContent.length - (i - e); + return { node: n, offset: s }; } -function Zn(n) { +const { + SvelteComponent: Il, + add_render_callback: Ye, + append: mt, + attr: B, + binding_callbacks: ht, + bubble: pe, + check_outros: Ut, + create_component: Ge, + create_in_transition: Wl, + destroy_component: Je, + detach: me, + element: He, + empty: Ul, + group_outros: Xt, + init: Xl, + insert: he, + listen: G, + mount_component: Ke, + noop: Yt, + run_all: Yl, + safe_not_equal: Gl, + set_data: Jl, + space: gt, + text: Kl, + toggle_class: bt, + transition_in: ne, + transition_out: de +} = window.__gradio__svelte__internal, { beforeUpdate: Ql, afterUpdate: xl, createEventDispatcher: $l } = window.__gradio__svelte__internal; +function en(l) { let e; return { c() { - e = Ke( + e = Kl( /*label*/ - n[0] + l[0] ); }, - m(t, l) { - K(t, e, l); + m(t, n) { + he(t, e, n); }, - p(t, l) { - l[0] & /*label*/ - 1 && Je( + p(t, n) { + n[0] & /*label*/ + 1 && Jl( e, /*label*/ t[0] ); }, d(t) { - t && J(e); + t && me(e); } }; } -function pt(n) { - let e, t, l, i; - const o = [Rn, Bn], s = []; - function r(f, a) { +function wt(l) { + let e, t, n, i; + const s = [ln, tn], o = []; + function r(_, f) { return ( /*copied*/ - f[13] ? 0 : 1 + _[13] ? 0 : 1 ); } - return e = r(n), t = s[e] = o[e](n), { + return e = r(l), t = o[e] = s[e](l), { c() { - t.c(), l = Hn(); + t.c(), n = Ul(); }, - m(f, a) { - s[e].m(f, a), K(f, l, a), i = !0; + m(_, f) { + o[e].m(_, f), he(_, n, f), i = !0; }, - p(f, a) { - let _ = e; - e = r(f), e === _ ? s[e].p(f, a) : (Gt(), ce(s[_], 1, 1, () => { - s[_] = null; - }), Yt(), t = s[e], t ? t.p(f, a) : (t = s[e] = o[e](f), t.c()), ne(t, 1), t.m(l.parentNode, l)); + p(_, f) { + let a = e; + e = r(_), e === a ? o[e].p(_, f) : (Xt(), de(o[a], 1, 1, () => { + o[a] = null; + }), Ut(), t = o[e], t ? t.p(_, f) : (t = o[e] = s[e](_), t.c()), ne(t, 1), t.m(n.parentNode, n)); }, - i(f) { + i(_) { i || (ne(t), i = !0); }, - o(f) { - ce(t), i = !1; + o(_) { + de(t), i = !1; }, - d(f) { - f && J(l), s[e].d(f); + d(_) { + _ && me(n), o[e].d(_); } }; } -function Bn(n) { - let e, t, l, i, o; - return t = new gn({}), { +function tn(l) { + let e, t, n, i, s; + return t = new Ml({}), { c() { - e = oe("button"), Xe(t.$$.fragment), H(e, "aria-label", "Copy"), H(e, "aria-roledescription", "Copy text"), H(e, "class", "svelte-1u11ied"); + e = He("button"), Ge(t.$$.fragment), B(e, "aria-label", "Copy"), B(e, "aria-roledescription", "Copy text"), B(e, "class", "svelte-14ssfqr"); }, - m(s, r) { - K(s, e, r), Ge(t, e, null), l = !0, i || (o = X( + m(o, r) { + he(o, e, r), Ke(t, e, null), n = !0, i || (s = G( e, "click", /*handle_copy*/ - n[15] + l[14] ), i = !0); }, - p: Jt, - i(s) { - l || (ne(t.$$.fragment, s), l = !0); + p: Yt, + i(o) { + n || (ne(t.$$.fragment, o), n = !0); }, - o(s) { - ce(t.$$.fragment, s), l = !1; + o(o) { + de(t.$$.fragment, o), n = !1; }, - d(s) { - s && J(e), Ye(t), i = !1, o(); + d(o) { + o && me(e), Je(t), i = !1, s(); } }; } -function Rn(n) { - let e, t, l, i; - return t = new an({}), { +function ln(l) { + let e, t, n, i; + return t = new ql({}), { c() { - e = oe("button"), Xe(t.$$.fragment), H(e, "aria-label", "Copied"), H(e, "aria-roledescription", "Text copied"), H(e, "class", "svelte-1u11ied"); + e = He("button"), Ge(t.$$.fragment), B(e, "aria-label", "Copied"), B(e, "aria-roledescription", "Text copied"), B(e, "class", "svelte-14ssfqr"); }, - m(o, s) { - K(o, e, s), Ge(t, e, null), i = !0; + m(s, o) { + he(s, e, o), Ke(t, e, null), i = !0; }, - p: Jt, - i(o) { - i || (ne(t.$$.fragment, o), o && (l || We(() => { - l = Mn(e, yn, { duration: 300 }), l.start(); + p: Yt, + i(s) { + i || (ne(t.$$.fragment, s), s && (n || Ye(() => { + n = Wl(e, zl, { duration: 300 }), n.start(); })), i = !0); }, - o(o) { - ce(t.$$.fragment, o), i = !1; + o(s) { + de(t.$$.fragment, s), i = !1; }, - d(o) { - o && J(e), Ye(t); + d(s) { + s && me(e), Je(t); } }; } -function Dn(n) { - let e, t, l; +function nn(l) { + let e, t, n; return { c() { - e = oe("div"), H(e, "class", "textfield svelte-1u11ied"), H(e, "data-testid", "highlighted-textbox"), H(e, "contenteditable", "true"), /*el_text*/ - (n[11] === void 0 || /*marked_el_text*/ - n[9] === void 0) && We(() => ( + e = He("div"), B(e, "class", "textfield svelte-14ssfqr"), B(e, "data-testid", "highlighted-textbox"), B(e, "contenteditable", "true"), /*el_text*/ + (l[11] === void 0 || /*marked_el_text*/ + l[9] === void 0) && Ye(() => ( /*div_input_handler_1*/ - n[28].call(e) + l[28].call(e) )); }, - m(i, o) { - K(i, e, o), n[27](e), /*el_text*/ - n[11] !== void 0 && (e.textContent = /*el_text*/ - n[11]), /*marked_el_text*/ - n[9] !== void 0 && (e.innerHTML = /*marked_el_text*/ - n[9]), t || (l = [ - X( + m(i, s) { + he(i, e, s), l[27](e), /*el_text*/ + l[11] !== void 0 && (e.textContent = /*el_text*/ + l[11]), /*marked_el_text*/ + l[9] !== void 0 && (e.innerHTML = /*marked_el_text*/ + l[9]), t || (n = [ + G( e, "input", /*div_input_handler_1*/ - n[28] + l[28] ), - X( + G( e, "blur", - /*handle_blur*/ - n[14] + /*blur_handler*/ + l[19] ), - X( + G( e, "keypress", /*keypress_handler*/ - n[20] + l[20] ), - X( + G( e, "select", /*select_handler*/ - n[21] + l[21] ), - X( + G( e, "scroll", /*scroll_handler*/ - n[22] + l[22] ), - X( + G( e, "input", /*input_handler*/ - n[23] + l[23] ), - X( + G( e, "focus", /*focus_handler*/ - n[24] + l[24] ), - X( + G( e, "change", /*checkAndRemoveHighlight*/ - n[16] + l[15] ) ], t = !0); }, - p(i, o) { - o[0] & /*el_text*/ + p(i, s) { + s[0] & /*el_text*/ 2048 && /*el_text*/ i[11] !== e.textContent && (e.textContent = /*el_text*/ - i[11]), o[0] & /*marked_el_text*/ + i[11]), s[0] & /*marked_el_text*/ 512 && /*marked_el_text*/ i[9] !== e.innerHTML && (e.innerHTML = /*marked_el_text*/ i[9]); }, d(i) { - i && J(e), n[27](null), t = !1, Vn(l); + i && me(e), l[27](null), t = !1, Yl(n); } }; } -function On(n) { - let e, t, l; +function sn(l) { + let e, t, n; return { c() { - e = oe("div"), H(e, "class", "textfield svelte-1u11ied"), H(e, "data-testid", "highlighted-textbox"), H(e, "contenteditable", "false"), /*el_text*/ - (n[11] === void 0 || /*marked_el_text*/ - n[9] === void 0) && We(() => ( + e = He("div"), B(e, "class", "textfield svelte-14ssfqr"), B(e, "data-testid", "highlighted-textbox"), B(e, "contenteditable", "false"), /*el_text*/ + (l[11] === void 0 || /*marked_el_text*/ + l[9] === void 0) && Ye(() => ( /*div_input_handler*/ - n[26].call(e) + l[26].call(e) )); }, - m(i, o) { - K(i, e, o), n[25](e), /*el_text*/ - n[11] !== void 0 && (e.textContent = /*el_text*/ - n[11]), /*marked_el_text*/ - n[9] !== void 0 && (e.innerHTML = /*marked_el_text*/ - n[9]), t || (l = X( + m(i, s) { + he(i, e, s), l[25](e), /*el_text*/ + l[11] !== void 0 && (e.textContent = /*el_text*/ + l[11]), /*marked_el_text*/ + l[9] !== void 0 && (e.innerHTML = /*marked_el_text*/ + l[9]), t || (n = G( + e, + "input", + /*div_input_handler*/ + l[26] + ), t = !0); + }, + p(i, s) { + s[0] & /*el_text*/ + 2048 && /*el_text*/ + i[11] !== e.textContent && (e.textContent = /*el_text*/ + i[11]), s[0] & /*marked_el_text*/ + 512 && /*marked_el_text*/ + i[9] !== e.innerHTML && (e.innerHTML = /*marked_el_text*/ + i[9]); + }, + d(i) { + i && me(e), l[25](null), t = !1, n(); + } + }; +} +function on(l) { + let e, t, n, i, s; + t = new gl({ + props: { + show_label: ( + /*show_label*/ + l[3] + ), + info: ( + /*info*/ + l[2] + ), + show_legend: ( + /*show_legend*/ + l[4] + ), + show_legend_label: ( + /*show_legend_label*/ + l[5] + ), + legend_label: ( + /*legend_label*/ + l[1] + ), + _color_map: ( + /*_color_map*/ + l[12] + ), + $$slots: { default: [en] }, + $$scope: { ctx: l } + } + }); + let o = ( + /*show_copy_button*/ + l[7] && wt(l) + ); + function r(a, u) { + return ( + /*disabled*/ + a[8] ? sn : nn + ); + } + let _ = r(l), f = _(l); + return { + c() { + e = He("label"), Ge(t.$$.fragment), n = gt(), o && o.c(), i = gt(), f.c(), B(e, "class", "svelte-14ssfqr"), bt( + e, + "container", + /*container*/ + l[6] + ); + }, + m(a, u) { + he(a, e, u), Ke(t, e, null), mt(e, n), o && o.m(e, null), mt(e, i), f.m(e, null), s = !0; + }, + p(a, u) { + const c = {}; + u[0] & /*show_label*/ + 8 && (c.show_label = /*show_label*/ + a[3]), u[0] & /*info*/ + 4 && (c.info = /*info*/ + a[2]), u[0] & /*show_legend*/ + 16 && (c.show_legend = /*show_legend*/ + a[4]), u[0] & /*show_legend_label*/ + 32 && (c.show_legend_label = /*show_legend_label*/ + a[5]), u[0] & /*legend_label*/ + 2 && (c.legend_label = /*legend_label*/ + a[1]), u[0] & /*_color_map*/ + 4096 && (c._color_map = /*_color_map*/ + a[12]), u[0] & /*label*/ + 1 | u[1] & /*$$scope*/ + 512 && (c.$$scope = { dirty: u, ctx: a }), t.$set(c), /*show_copy_button*/ + a[7] ? o ? (o.p(a, u), u[0] & /*show_copy_button*/ + 128 && ne(o, 1)) : (o = wt(a), o.c(), ne(o, 1), o.m(e, i)) : o && (Xt(), de(o, 1, 1, () => { + o = null; + }), Ut()), _ === (_ = r(a)) && f ? f.p(a, u) : (f.d(1), f = _(a), f && (f.c(), f.m(e, null))), (!s || u[0] & /*container*/ + 64) && bt( + e, + "container", + /*container*/ + a[6] + ); + }, + i(a) { + s || (ne(t.$$.fragment, a), ne(o), s = !0); + }, + o(a) { + de(t.$$.fragment, a), de(o), s = !1; + }, + d(a) { + a && me(e), Je(t), o && o.d(), f.d(); + } + }; +} +function fn(l) { + let e, t = l[0], n = 1; + for (; n < l.length; ) { + const i = l[n], s = l[n + 1]; + if (n += 2, (i === "optionalAccess" || i === "optionalCall") && t == null) + return; + i === "access" || i === "optionalAccess" ? (e = t, t = s(t)) : (i === "call" || i === "optionalCall") && (t = s((...o) => t.call(e, ...o)), e = void 0); + } + return t; +} +function an(l, e, t) { + const n = typeof document < "u"; + let { value: i = [] } = e, { value_is_output: s = !1 } = e, { label: o } = e, { legend_label: r } = e, { info: _ = void 0 } = e, { show_label: f = !0 } = e, { show_legend: a = !1 } = e, { show_legend_label: u = !1 } = e, { container: c = !0 } = e, { color_map: m = {} } = e, { show_copy_button: y = !1 } = e, { disabled: S } = e, T, L = "", C = "", d, p = !m || Object.keys(m).length === 0 ? {} : m, F = {}, g = !1, R; + function Q() { + for (let h in p) + i.map(([N, M]) => M).includes(h) || delete p[h]; + if (i.length > 0) { + for (let [h, N] of i) + if (N !== null && !(N in p)) { + let M = Pl(Object.keys(p).length); + p[N] = M; + } + } + t(12, F = Zl(p, n, d)); + } + function E(h) { + console.log(i), console.log(F), i.length > 0 && h && (t(11, L = i.map(([N, M]) => N).join(" ")), t(9, C = i.map(([N, M]) => M !== null ? `${N}` : N).join(" ") + " ")); + } + const P = $l(); + Ql(() => { + T && T.offsetHeight + T.scrollTop > T.scrollHeight - 100; + }); + function X() { + P("change", C), s || P("input"), A(); + } + xl(() => { + Q(), E(s), t(17, s = !1); + }); + function ge() { + let h = [], N = "", M = null, ee = !1, ke = ""; + for (let ae = 0; ae < C.length; ae++) { + let _e = C[ae]; + _e === "<" ? (ee = !0, N && h.push([N, M]), N = "", M = null) : _e === ">" ? (ee = !1, ke.startsWith("mark") && (M = fn([ + ke, + "access", + (Y) => Y.match, + "call", + (Y) => Y(/class="hl ([^"]+)"/), + "optionalAccess", + (Y) => Y[1] + ]) || null), ke = "") : ee ? ke += _e : N += _e; + } + N && h.push([N, M]), t(16, i = h); + } + async function D() { + "clipboard" in navigator && (await navigator.clipboard.writeText(L), x()); + } + function x() { + t(13, g = !0), R && clearTimeout(R), R = setTimeout( + () => { + t(13, g = !1); + }, + 1e3 + ); + } + function A() { + const h = window.getSelection(), N = h.anchorOffset; + if (h.rangeCount > 0) { + var M = h.getRangeAt(0).commonAncestorContainer.parentElement; + if (M && M.tagName.toLowerCase() === "mark") { + const tl = M.textContent; + var ee = M.parentElement, ke = document.createTextNode(tl); + ee.replaceChild(ke, M), t(9, C = ee.innerHTML); + var ae = document.createRange(), _e = window.getSelection(); + const ll = N + Rl(ee); + var Y = Dl(ee, ll); + ae.setStart(Y.node, Y.offset), ae.setEnd(Y.node, Y.offset), _e.removeAllRanges(), _e.addRange(ae); + } + } + ge(), P("change", C); + } + function be(h) { + pe.call(this, l, h); + } + function b(h) { + pe.call(this, l, h); + } + function Me(h) { + pe.call(this, l, h); + } + function Ne(h) { + pe.call(this, l, h); + } + function we(h) { + pe.call(this, l, h); + } + function Ee(h) { + pe.call(this, l, h); + } + function Pe(h) { + ht[h ? "unshift" : "push"](() => { + T = h, t(10, T); + }); + } + function w() { + L = this.textContent, C = this.innerHTML, t(11, L), t(9, C); + } + function $t(h) { + ht[h ? "unshift" : "push"](() => { + T = h, t(10, T); + }); + } + function el() { + L = this.textContent, C = this.innerHTML, t(11, L), t(9, C); + } + return l.$$set = (h) => { + "value" in h && t(16, i = h.value), "value_is_output" in h && t(17, s = h.value_is_output), "label" in h && t(0, o = h.label), "legend_label" in h && t(1, r = h.legend_label), "info" in h && t(2, _ = h.info), "show_label" in h && t(3, f = h.show_label), "show_legend" in h && t(4, a = h.show_legend), "show_legend_label" in h && t(5, u = h.show_legend_label), "container" in h && t(6, c = h.container), "color_map" in h && t(18, m = h.color_map), "show_copy_button" in h && t(7, y = h.show_copy_button), "disabled" in h && t(8, S = h.disabled); + }, l.$$.update = () => { + l.$$.dirty[0] & /*marked_el_text*/ + 512 && X(); + }, Q(), E(!0), [ + o, + r, + _, + f, + a, + u, + c, + y, + S, + C, + T, + L, + F, + g, + D, + A, + i, + s, + m, + be, + b, + Me, + Ne, + we, + Ee, + Pe, + w, + $t, + el + ]; +} +class _n extends Il { + constructor(e) { + super(), Xl( + this, + e, + an, + on, + Gl, + { + value: 16, + value_is_output: 17, + label: 0, + legend_label: 1, + info: 2, + show_label: 3, + show_legend: 4, + show_legend_label: 5, + container: 6, + color_map: 18, + show_copy_button: 7, + disabled: 8 + }, + null, + [-1, -1] + ); + } +} +const { + SvelteComponent: rn, + assign: un, + create_slot: cn, + detach: dn, + element: mn, + get_all_dirty_from_scope: hn, + get_slot_changes: gn, + get_spread_update: bn, + init: wn, + insert: kn, + safe_not_equal: vn, + set_dynamic_element_data: kt, + set_style: z, + toggle_class: le, + transition_in: Gt, + transition_out: Jt, + update_slot_base: pn +} = window.__gradio__svelte__internal; +function yn(l) { + let e, t, n; + const i = ( + /*#slots*/ + l[18].default + ), s = cn( + i, + l, + /*$$scope*/ + l[17], + null + ); + let o = [ + { "data-testid": ( + /*test_id*/ + l[7] + ) }, + { id: ( + /*elem_id*/ + l[2] + ) }, + { + class: t = "block " + /*elem_classes*/ + l[3].join(" ") + " svelte-1t38q2d" + } + ], r = {}; + for (let _ = 0; _ < o.length; _ += 1) + r = un(r, o[_]); + return { + c() { + e = mn( + /*tag*/ + l[14] + ), s && s.c(), kt( + /*tag*/ + l[14] + )(e, r), le( + e, + "hidden", + /*visible*/ + l[10] === !1 + ), le( + e, + "padded", + /*padding*/ + l[6] + ), le( + e, + "border_focus", + /*border_mode*/ + l[5] === "focus" + ), le(e, "hide-container", !/*explicit_call*/ + l[8] && !/*container*/ + l[9]), z( + e, + "height", + /*get_dimension*/ + l[15]( + /*height*/ + l[0] + ) + ), z(e, "width", typeof /*width*/ + l[1] == "number" ? `calc(min(${/*width*/ + l[1]}px, 100%))` : ( + /*get_dimension*/ + l[15]( + /*width*/ + l[1] + ) + )), z( + e, + "border-style", + /*variant*/ + l[4] + ), z( + e, + "overflow", + /*allow_overflow*/ + l[11] ? "visible" : "hidden" + ), z( + e, + "flex-grow", + /*scale*/ + l[12] + ), z(e, "min-width", `calc(min(${/*min_width*/ + l[13]}px, 100%))`), z(e, "border-width", "var(--block-border-width)"); + }, + m(_, f) { + kn(_, e, f), s && s.m(e, null), n = !0; + }, + p(_, f) { + s && s.p && (!n || f & /*$$scope*/ + 131072) && pn( + s, + i, + _, + /*$$scope*/ + _[17], + n ? gn( + i, + /*$$scope*/ + _[17], + f, + null + ) : hn( + /*$$scope*/ + _[17] + ), + null + ), kt( + /*tag*/ + _[14] + )(e, r = bn(o, [ + (!n || f & /*test_id*/ + 128) && { "data-testid": ( + /*test_id*/ + _[7] + ) }, + (!n || f & /*elem_id*/ + 4) && { id: ( + /*elem_id*/ + _[2] + ) }, + (!n || f & /*elem_classes*/ + 8 && t !== (t = "block " + /*elem_classes*/ + _[3].join(" ") + " svelte-1t38q2d")) && { class: t } + ])), le( + e, + "hidden", + /*visible*/ + _[10] === !1 + ), le( + e, + "padded", + /*padding*/ + _[6] + ), le( + e, + "border_focus", + /*border_mode*/ + _[5] === "focus" + ), le(e, "hide-container", !/*explicit_call*/ + _[8] && !/*container*/ + _[9]), f & /*height*/ + 1 && z( + e, + "height", + /*get_dimension*/ + _[15]( + /*height*/ + _[0] + ) + ), f & /*width*/ + 2 && z(e, "width", typeof /*width*/ + _[1] == "number" ? `calc(min(${/*width*/ + _[1]}px, 100%))` : ( + /*get_dimension*/ + _[15]( + /*width*/ + _[1] + ) + )), f & /*variant*/ + 16 && z( e, - "input", - /*div_input_handler*/ - n[26] - ), t = !0); + "border-style", + /*variant*/ + _[4] + ), f & /*allow_overflow*/ + 2048 && z( + e, + "overflow", + /*allow_overflow*/ + _[11] ? "visible" : "hidden" + ), f & /*scale*/ + 4096 && z( + e, + "flex-grow", + /*scale*/ + _[12] + ), f & /*min_width*/ + 8192 && z(e, "min-width", `calc(min(${/*min_width*/ + _[13]}px, 100%))`); }, - p(i, o) { - o[0] & /*el_text*/ - 2048 && /*el_text*/ - i[11] !== e.textContent && (e.textContent = /*el_text*/ - i[11]), o[0] & /*marked_el_text*/ - 512 && /*marked_el_text*/ - i[9] !== e.innerHTML && (e.innerHTML = /*marked_el_text*/ - i[9]); + i(_) { + n || (Gt(s, _), n = !0); }, - d(i) { - i && J(e), n[25](null), t = !1, l(); + o(_) { + Jt(s, _), n = !1; + }, + d(_) { + _ && dn(e), s && s.d(_); } }; } -function In(n) { - let e, t, l, i, o, s, r = ( - /*show_legend*/ - n[4] && gt(n) - ); - l = new en({ - props: { - show_label: ( - /*show_label*/ - n[3] - ), - info: ( - /*info*/ - n[2] - ), - $$slots: { default: [Zn] }, - $$scope: { ctx: n } - } - }); - let f = ( - /*show_copy_button*/ - n[7] && pt(n) +function Cn(l) { + let e, t = ( + /*tag*/ + l[14] && yn(l) ); - function a(c, m) { - return ( - /*disabled*/ - c[8] ? On : Dn - ); - } - let _ = a(n), u = _(n); return { c() { - e = oe("label"), r && r.c(), t = Le(), Xe(l.$$.fragment), i = Le(), f && f.c(), o = Le(), u.c(), H(e, "class", "svelte-1u11ied"), mt( - e, - "container", - /*container*/ - n[6] - ); + t && t.c(); }, - m(c, m) { - K(c, e, m), r && r.m(e, null), ue(e, t), Ge(l, e, null), ue(e, i), f && f.m(e, null), ue(e, o), u.m(e, null), s = !0; + m(n, i) { + t && t.m(n, i), e = !0; }, - p(c, m) { - /*show_legend*/ - c[4] ? r ? r.p(c, m) : (r = gt(c), r.c(), r.m(e, t)) : r && (r.d(1), r = null); - const p = {}; - m[0] & /*show_label*/ - 8 && (p.show_label = /*show_label*/ - c[3]), m[0] & /*info*/ - 4 && (p.info = /*info*/ - c[2]), m[0] & /*label*/ - 1 | m[1] & /*$$scope*/ - 4096 && (p.$$scope = { dirty: m, ctx: c }), l.$set(p), /*show_copy_button*/ - c[7] ? f ? (f.p(c, m), m[0] & /*show_copy_button*/ - 128 && ne(f, 1)) : (f = pt(c), f.c(), ne(f, 1), f.m(e, o)) : f && (Gt(), ce(f, 1, 1, () => { - f = null; - }), Yt()), _ === (_ = a(c)) && u ? u.p(c, m) : (u.d(1), u = _(c), u && (u.c(), u.m(e, null))), (!s || m[0] & /*container*/ - 64) && mt( - e, - "container", - /*container*/ - c[6] - ); + p(n, [i]) { + /*tag*/ + n[14] && t.p(n, i); }, - i(c) { - s || (ne(l.$$.fragment, c), ne(f), s = !0); + i(n) { + e || (Gt(t, n), e = !0); }, - o(c) { - ce(l.$$.fragment, c), ce(f), s = !1; + o(n) { + Jt(t, n), e = !1; }, - d(c) { - c && J(e), r && r.d(), Ye(l), f && f.d(), u.d(); + d(n) { + t && t.d(n); } }; } -function Un(n) { - let e, t = n[0], l = 1; - for (; l < n.length; ) { - const i = n[l], o = n[l + 1]; - if (l += 2, (i === "optionalAccess" || i === "optionalCall") && t == null) - return; - i === "access" || i === "optionalAccess" ? (e = t, t = o(t)) : (i === "call" || i === "optionalCall") && (t = o((...s) => t.call(e, ...s)), e = void 0); - } - return t; -} -function Wn(n, e, t) { - const l = typeof document < "u"; - let { value: i = [] } = e, { value_is_output: o = !1 } = e, { label: s } = e, { legend_label: r } = e, { info: f = void 0 } = e, { show_label: a = !0 } = e, { show_legend: _ = !1 } = e, { show_legend_label: u = !1 } = e, { container: c = !0 } = e, { color_map: m = {} } = e, { show_copy_button: p = !1 } = e, { disabled: T } = e, S, L = "", C = "", d, y = {}, M = {}, b = !1, B; - function Q() { - if (!m || Object.keys(m).length === 0 ? y = {} : y = m, i.length > 0) { - for (let [g, j] of i) - if (j !== null && !(j in y)) { - let V = wn(Object.keys(y).length); - y[j] = V; - } - } - t(12, M = qn(y, l, d)); - } - function E(g) { - i.length > 0 && g && (t(11, L = i.map(([j, V]) => j).join(" ")), t(9, C = i.map(([j, V]) => V !== null ? `${j}` : j).join(" ") + " ")); - } - const R = Pn(); - zn(() => { - S && S.offsetHeight + S.scrollTop > S.scrollHeight - 100; - }); - function U() { - R("change", C), o || R("input"), A(); - } - En(() => { - Q(), E(o), t(18, o = !1); - }); - function se() { - let g = [], j = "", V = null, ee = !1, be = ""; - for (let fe = 0; fe < C.length; fe++) { - let re = C[fe]; - re === "<" ? (ee = !0, j && g.push([j, V]), j = "", V = null) : re === ">" ? (ee = !1, be.startsWith("mark") && (V = Un([ - be, - "access", - (W) => W.match, - "call", - (W) => W(/class="hl ([^"]+)"/), - "optionalAccess", - (W) => W[1] - ]) || null), be = "") : ee ? be += re : j += re; - } - j && g.push([j, V]), t(17, i = g); - } - async function D() { - "clipboard" in navigator && (await navigator.clipboard.writeText(L), x()); - } - function x() { - t(13, b = !0), B && clearTimeout(B), B = setTimeout( - () => { - t(13, b = !1); - }, - 1e3 - ); - } - function A() { - const g = window.getSelection(), j = g.anchorOffset; - if (g.rangeCount > 0) { - var V = g.getRangeAt(0).commonAncestorContainer.parentElement; - if (V && V.tagName.toLowerCase() === "mark") { - const el = V.textContent; - var ee = V.parentElement, be = document.createTextNode(el); - ee.replaceChild(be, V), t(9, C = ee.innerHTML); - var fe = document.createRange(), re = window.getSelection(); - const tl = j + Ln(ee); - var W = Tn(ee, tl); - fe.setStart(W.node, W.offset), fe.setEnd(W.node, W.offset), re.removeAllRanges(), re.addRange(fe), se(); - } +function qn(l, e, t) { + let { $$slots: n = {}, $$scope: i } = e, { height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: _ = [] } = e, { variant: f = "solid" } = e, { border_mode: a = "base" } = e, { padding: u = !0 } = e, { type: c = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: y = !1 } = e, { container: S = !0 } = e, { visible: T = !0 } = e, { allow_overflow: L = !0 } = e, { scale: C = null } = e, { min_width: d = 0 } = e, p = c === "fieldset" ? "fieldset" : "div"; + const F = (g) => { + if (g !== void 0) { + if (typeof g == "number") + return g + "px"; + if (typeof g == "string") + return g; } - } - function de(g) { - qe.call(this, n, g); - } - function h(g) { - qe.call(this, n, g); - } - function Fe(g) { - qe.call(this, n, g); - } - function Me(g) { - qe.call(this, n, g); - } - function me(g) { - qe.call(this, n, g); - } - function Pe(g) { - ct[g ? "unshift" : "push"](() => { - S = g, t(10, S); - }); - } - function Ze() { - L = this.textContent, C = this.innerHTML, t(11, L), t(9, C); - } - function w(g) { - ct[g ? "unshift" : "push"](() => { - S = g, t(10, S); - }); - } - function $t() { - L = this.textContent, C = this.innerHTML, t(11, L), t(9, C); - } - return n.$$set = (g) => { - "value" in g && t(17, i = g.value), "value_is_output" in g && t(18, o = g.value_is_output), "label" in g && t(0, s = g.label), "legend_label" in g && t(1, r = g.legend_label), "info" in g && t(2, f = g.info), "show_label" in g && t(3, a = g.show_label), "show_legend" in g && t(4, _ = g.show_legend), "show_legend_label" in g && t(5, u = g.show_legend_label), "container" in g && t(6, c = g.container), "color_map" in g && t(19, m = g.color_map), "show_copy_button" in g && t(7, p = g.show_copy_button), "disabled" in g && t(8, T = g.disabled); - }, n.$$.update = () => { - n.$$.dirty[0] & /*marked_el_text*/ - 512 && U(); - }, Q(), E(!0), [ + }; + return l.$$set = (g) => { + "height" in g && t(0, s = g.height), "width" in g && t(1, o = g.width), "elem_id" in g && t(2, r = g.elem_id), "elem_classes" in g && t(3, _ = g.elem_classes), "variant" in g && t(4, f = g.variant), "border_mode" in g && t(5, a = g.border_mode), "padding" in g && t(6, u = g.padding), "type" in g && t(16, c = g.type), "test_id" in g && t(7, m = g.test_id), "explicit_call" in g && t(8, y = g.explicit_call), "container" in g && t(9, S = g.container), "visible" in g && t(10, T = g.visible), "allow_overflow" in g && t(11, L = g.allow_overflow), "scale" in g && t(12, C = g.scale), "min_width" in g && t(13, d = g.min_width), "$$scope" in g && t(17, i = g.$$scope); + }, [ s, + o, r, + _, f, a, - _, u, - c, - p, - T, - C, + m, + y, S, + T, L, - M, - b, - se, - D, - A, + C, + d, + p, + F, + c, i, - o, - m, - de, - h, - Fe, - Me, - me, - Pe, - Ze, - w, - $t + n ]; } -class Xn extends Fn { +class Tn extends rn { constructor(e) { - super(), jn( - this, - e, - Wn, - In, - An, - { - value: 17, - value_is_output: 18, - label: 0, - legend_label: 1, - info: 2, - show_label: 3, - show_legend: 4, - show_legend_label: 5, - container: 6, - color_map: 19, - show_copy_button: 7, - disabled: 8 - }, - null, - [-1, -1] - ); + super(), wn(this, e, qn, Cn, vn, { + height: 0, + width: 1, + elem_id: 2, + elem_classes: 3, + variant: 4, + border_mode: 5, + padding: 6, + type: 16, + test_id: 7, + explicit_call: 8, + container: 9, + visible: 10, + allow_overflow: 11, + scale: 12, + min_width: 13 + }); } } -function we(n) { +function ye(l) { let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0; - for (; n > 1e3 && t < e.length - 1; ) - n /= 1e3, t++; - let l = e[t]; - return (Number.isInteger(n) ? n : n.toFixed(1)) + l; + for (; l > 1e3 && t < e.length - 1; ) + l /= 1e3, t++; + let n = e[t]; + return (Number.isInteger(l) ? l : l.toFixed(1)) + n; } const { - SvelteComponent: Yn, - append: O, + SvelteComponent: Ln, + append: I, attr: q, - component_subscribe: kt, - detach: Gn, - element: Jn, - init: Kn, - insert: Qn, - noop: vt, - safe_not_equal: xn, - set_style: Ne, - svg_element: I, + component_subscribe: vt, + detach: Sn, + element: jn, + init: Fn, + insert: Hn, + noop: pt, + safe_not_equal: Mn, + set_style: Ve, + svg_element: W, toggle_class: yt -} = window.__gradio__svelte__internal, { onMount: $n } = window.__gradio__svelte__internal; -function ei(n) { - let e, t, l, i, o, s, r, f, a, _, u, c; +} = window.__gradio__svelte__internal, { onMount: Nn } = window.__gradio__svelte__internal; +function Vn(l) { + let e, t, n, i, s, o, r, _, f, a, u, c; return { c() { - e = Jn("div"), t = I("svg"), l = I("g"), i = I("path"), o = I("path"), s = I("path"), r = I("path"), f = I("g"), a = I("path"), _ = I("path"), u = I("path"), c = I("path"), q(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), q(i, "fill", "#FF7C00"), q(i, "fill-opacity", "0.4"), q(i, "class", "svelte-43sxxs"), q(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), q(o, "fill", "#FF7C00"), q(o, "class", "svelte-43sxxs"), q(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), q(s, "fill", "#FF7C00"), q(s, "fill-opacity", "0.4"), q(s, "class", "svelte-43sxxs"), q(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), q(r, "fill", "#FF7C00"), q(r, "class", "svelte-43sxxs"), Ne(l, "transform", "translate(" + /*$top*/ - n[1][0] + "px, " + /*$top*/ - n[1][1] + "px)"), q(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), q(a, "fill", "#FF7C00"), q(a, "fill-opacity", "0.4"), q(a, "class", "svelte-43sxxs"), q(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), q(_, "fill", "#FF7C00"), q(_, "class", "svelte-43sxxs"), q(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), q(u, "fill", "#FF7C00"), q(u, "fill-opacity", "0.4"), q(u, "class", "svelte-43sxxs"), q(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), q(c, "fill", "#FF7C00"), q(c, "class", "svelte-43sxxs"), Ne(f, "transform", "translate(" + /*$bottom*/ - n[2][0] + "px, " + /*$bottom*/ - n[2][1] + "px)"), q(t, "viewBox", "-1200 -1200 3000 3000"), q(t, "fill", "none"), q(t, "xmlns", "http://www.w3.org/2000/svg"), q(t, "class", "svelte-43sxxs"), q(e, "class", "svelte-43sxxs"), yt( + e = jn("div"), t = W("svg"), n = W("g"), i = W("path"), s = W("path"), o = W("path"), r = W("path"), _ = W("g"), f = W("path"), a = W("path"), u = W("path"), c = W("path"), q(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), q(i, "fill", "#FF7C00"), q(i, "fill-opacity", "0.4"), q(i, "class", "svelte-43sxxs"), q(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), q(s, "fill", "#FF7C00"), q(s, "class", "svelte-43sxxs"), q(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), q(o, "fill", "#FF7C00"), q(o, "fill-opacity", "0.4"), q(o, "class", "svelte-43sxxs"), q(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), q(r, "fill", "#FF7C00"), q(r, "class", "svelte-43sxxs"), Ve(n, "transform", "translate(" + /*$top*/ + l[1][0] + "px, " + /*$top*/ + l[1][1] + "px)"), q(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), q(f, "fill", "#FF7C00"), q(f, "fill-opacity", "0.4"), q(f, "class", "svelte-43sxxs"), q(a, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), q(a, "fill", "#FF7C00"), q(a, "class", "svelte-43sxxs"), q(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), q(u, "fill", "#FF7C00"), q(u, "fill-opacity", "0.4"), q(u, "class", "svelte-43sxxs"), q(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), q(c, "fill", "#FF7C00"), q(c, "class", "svelte-43sxxs"), Ve(_, "transform", "translate(" + /*$bottom*/ + l[2][0] + "px, " + /*$bottom*/ + l[2][1] + "px)"), q(t, "viewBox", "-1200 -1200 3000 3000"), q(t, "fill", "none"), q(t, "xmlns", "http://www.w3.org/2000/svg"), q(t, "class", "svelte-43sxxs"), q(e, "class", "svelte-43sxxs"), yt( e, "margin", /*margin*/ - n[0] + l[0] ); }, - m(m, p) { - Qn(m, e, p), O(e, t), O(t, l), O(l, i), O(l, o), O(l, s), O(l, r), O(t, f), O(f, a), O(f, _), O(f, u), O(f, c); + m(m, y) { + Hn(m, e, y), I(e, t), I(t, n), I(n, i), I(n, s), I(n, o), I(n, r), I(t, _), I(_, f), I(_, a), I(_, u), I(_, c); }, - p(m, [p]) { - p & /*$top*/ - 2 && Ne(l, "transform", "translate(" + /*$top*/ + p(m, [y]) { + y & /*$top*/ + 2 && Ve(n, "transform", "translate(" + /*$top*/ m[1][0] + "px, " + /*$top*/ - m[1][1] + "px)"), p & /*$bottom*/ - 4 && Ne(f, "transform", "translate(" + /*$bottom*/ + m[1][1] + "px)"), y & /*$bottom*/ + 4 && Ve(_, "transform", "translate(" + /*$bottom*/ m[2][0] + "px, " + /*$bottom*/ - m[2][1] + "px)"), p & /*margin*/ + m[2][1] + "px)"), y & /*margin*/ 1 && yt( e, "margin", @@ -1746,165 +1691,165 @@ function ei(n) { m[0] ); }, - i: vt, - o: vt, + i: pt, + o: pt, d(m) { - m && Gn(e); + m && Sn(e); } }; } -function ti(n, e, t) { - let l, i, { margin: o = !0 } = e; - const s = _t([0, 0]); - kt(n, s, (c) => t(1, l = c)); +function An(l, e, t) { + let n, i, { margin: s = !0 } = e; + const o = _t([0, 0]); + vt(l, o, (c) => t(1, n = c)); const r = _t([0, 0]); - kt(n, r, (c) => t(2, i = c)); - let f; - async function a() { - await Promise.all([s.set([125, 140]), r.set([-125, -140])]), await Promise.all([s.set([-125, 140]), r.set([125, -140])]), await Promise.all([s.set([-125, 0]), r.set([125, -0])]), await Promise.all([s.set([125, 0]), r.set([-125, 0])]); + vt(l, r, (c) => t(2, i = c)); + let _; + async function f() { + await Promise.all([o.set([125, 140]), r.set([-125, -140])]), await Promise.all([o.set([-125, 140]), r.set([125, -140])]), await Promise.all([o.set([-125, 0]), r.set([125, -0])]), await Promise.all([o.set([125, 0]), r.set([-125, 0])]); } - async function _() { - await a(), f || _(); + async function a() { + await f(), _ || a(); } async function u() { - await Promise.all([s.set([125, 0]), r.set([-125, 0])]), _(); + await Promise.all([o.set([125, 0]), r.set([-125, 0])]), a(); } - return $n(() => (u(), () => f = !0)), n.$$set = (c) => { - "margin" in c && t(0, o = c.margin); - }, [o, l, i, s, r]; + return Nn(() => (u(), () => _ = !0)), l.$$set = (c) => { + "margin" in c && t(0, s = c.margin); + }, [s, n, i, o, r]; } -class li extends Yn { +class zn extends Ln { constructor(e) { - super(), Kn(this, e, ti, ei, xn, { margin: 0 }); + super(), Fn(this, e, An, Vn, Mn, { margin: 0 }); } } const { - SvelteComponent: ni, - append: _e, - attr: Y, + SvelteComponent: Bn, + append: ue, + attr: J, binding_callbacks: Ct, check_outros: Kt, - create_component: ii, - create_slot: oi, - destroy_component: si, + create_component: En, + create_slot: Pn, + destroy_component: Zn, destroy_each: Qt, detach: k, element: $, - empty: Ce, - ensure_array_like: Ee, - get_all_dirty_from_scope: fi, - get_slot_changes: ri, + empty: Se, + ensure_array_like: Be, + get_all_dirty_from_scope: On, + get_slot_changes: Rn, group_outros: xt, - init: ai, + init: Dn, insert: v, - mount_component: _i, - noop: Ue, - safe_not_equal: ui, - set_data: Z, + mount_component: In, + noop: We, + safe_not_equal: Wn, + set_data: O, set_style: ie, - space: G, - text: F, - toggle_class: P, - transition_in: ve, - transition_out: ye, - update_slot_base: ci -} = window.__gradio__svelte__internal, { tick: di } = window.__gradio__svelte__internal, { onDestroy: mi } = window.__gradio__svelte__internal, bi = (n) => ({}), qt = (n) => ({}); -function St(n, e, t) { - const l = n.slice(); - return l[38] = e[t], l[40] = t, l; -} -function Lt(n, e, t) { - const l = n.slice(); - return l[38] = e[t], l; -} -function gi(n) { + space: K, + text: j, + toggle_class: Z, + transition_in: Te, + transition_out: Le, + update_slot_base: Un +} = window.__gradio__svelte__internal, { tick: Xn } = window.__gradio__svelte__internal, { onDestroy: Yn } = window.__gradio__svelte__internal, Gn = (l) => ({}), qt = (l) => ({}); +function Tt(l, e, t) { + const n = l.slice(); + return n[38] = e[t], n[40] = t, n; +} +function Lt(l, e, t) { + const n = l.slice(); + return n[38] = e[t], n; +} +function Jn(l) { let e, t = ( /*i18n*/ - n[1]("common.error") + "" - ), l, i, o; - const s = ( + l[1]("common.error") + "" + ), n, i, s; + const o = ( /*#slots*/ - n[29].error - ), r = oi( - s, - n, + l[29].error + ), r = Pn( + o, + l, /*$$scope*/ - n[28], + l[28], qt ); return { c() { - e = $("span"), l = F(t), i = G(), r && r.c(), Y(e, "class", "error svelte-1txqlrd"); + e = $("span"), n = j(t), i = K(), r && r.c(), J(e, "class", "error svelte-1txqlrd"); }, - m(f, a) { - v(f, e, a), _e(e, l), v(f, i, a), r && r.m(f, a), o = !0; + m(_, f) { + v(_, e, f), ue(e, n), v(_, i, f), r && r.m(_, f), s = !0; }, - p(f, a) { - (!o || a[0] & /*i18n*/ + p(_, f) { + (!s || f[0] & /*i18n*/ 2) && t !== (t = /*i18n*/ - f[1]("common.error") + "") && Z(l, t), r && r.p && (!o || a[0] & /*$$scope*/ - 268435456) && ci( + _[1]("common.error") + "") && O(n, t), r && r.p && (!s || f[0] & /*$$scope*/ + 268435456) && Un( r, - s, - f, + o, + _, /*$$scope*/ - f[28], - o ? ri( - s, + _[28], + s ? Rn( + o, /*$$scope*/ - f[28], - a, - bi - ) : fi( + _[28], + f, + Gn + ) : On( /*$$scope*/ - f[28] + _[28] ), qt ); }, - i(f) { - o || (ve(r, f), o = !0); + i(_) { + s || (Te(r, _), s = !0); }, - o(f) { - ye(r, f), o = !1; + o(_) { + Le(r, _), s = !1; }, - d(f) { - f && (k(e), k(i)), r && r.d(f); + d(_) { + _ && (k(e), k(i)), r && r.d(_); } }; } -function hi(n) { - let e, t, l, i, o, s, r, f, a, _ = ( +function Kn(l) { + let e, t, n, i, s, o, r, _, f, a = ( /*variant*/ - n[8] === "default" && /*show_eta_bar*/ - n[18] && /*show_progress*/ - n[6] === "full" && Tt(n) + l[8] === "default" && /*show_eta_bar*/ + l[18] && /*show_progress*/ + l[6] === "full" && St(l) ); - function u(d, y) { + function u(d, p) { if ( /*progress*/ d[7] ) - return ki; + return $n; if ( /*queue_position*/ d[2] !== null && /*queue_size*/ d[3] !== void 0 && /*queue_position*/ d[2] >= 0 ) - return pi; + return xn; if ( /*queue_position*/ d[2] === 0 ) - return wi; + return Qn; } - let c = u(n), m = c && c(n), p = ( + let c = u(l), m = c && c(l), y = ( /*timer*/ - n[5] && Nt(n) + l[5] && Ht(l) ); - const T = [qi, Ci], S = []; - function L(d, y) { + const S = [ni, li], T = []; + function L(d, p) { return ( /*last_progress_level*/ d[15] != null ? 0 : ( @@ -1913,789 +1858,789 @@ function hi(n) { ) ); } - ~(o = L(n)) && (s = S[o] = T[o](n)); + ~(s = L(l)) && (o = T[s] = S[s](l)); let C = !/*timer*/ - n[5] && Pt(n); + l[5] && Et(l); return { c() { - _ && _.c(), e = G(), t = $("div"), m && m.c(), l = G(), p && p.c(), i = G(), s && s.c(), r = G(), C && C.c(), f = Ce(), Y(t, "class", "progress-text svelte-1txqlrd"), P( + a && a.c(), e = K(), t = $("div"), m && m.c(), n = K(), y && y.c(), i = K(), o && o.c(), r = K(), C && C.c(), _ = Se(), J(t, "class", "progress-text svelte-1txqlrd"), Z( t, "meta-text-center", /*variant*/ - n[8] === "center" - ), P( + l[8] === "center" + ), Z( t, "meta-text", /*variant*/ - n[8] === "default" + l[8] === "default" ); }, - m(d, y) { - _ && _.m(d, y), v(d, e, y), v(d, t, y), m && m.m(t, null), _e(t, l), p && p.m(t, null), v(d, i, y), ~o && S[o].m(d, y), v(d, r, y), C && C.m(d, y), v(d, f, y), a = !0; + m(d, p) { + a && a.m(d, p), v(d, e, p), v(d, t, p), m && m.m(t, null), ue(t, n), y && y.m(t, null), v(d, i, p), ~s && T[s].m(d, p), v(d, r, p), C && C.m(d, p), v(d, _, p), f = !0; }, - p(d, y) { + p(d, p) { /*variant*/ d[8] === "default" && /*show_eta_bar*/ d[18] && /*show_progress*/ - d[6] === "full" ? _ ? _.p(d, y) : (_ = Tt(d), _.c(), _.m(e.parentNode, e)) : _ && (_.d(1), _ = null), c === (c = u(d)) && m ? m.p(d, y) : (m && m.d(1), m = c && c(d), m && (m.c(), m.m(t, l))), /*timer*/ - d[5] ? p ? p.p(d, y) : (p = Nt(d), p.c(), p.m(t, null)) : p && (p.d(1), p = null), (!a || y[0] & /*variant*/ - 256) && P( + d[6] === "full" ? a ? a.p(d, p) : (a = St(d), a.c(), a.m(e.parentNode, e)) : a && (a.d(1), a = null), c === (c = u(d)) && m ? m.p(d, p) : (m && m.d(1), m = c && c(d), m && (m.c(), m.m(t, n))), /*timer*/ + d[5] ? y ? y.p(d, p) : (y = Ht(d), y.c(), y.m(t, null)) : y && (y.d(1), y = null), (!f || p[0] & /*variant*/ + 256) && Z( t, "meta-text-center", /*variant*/ d[8] === "center" - ), (!a || y[0] & /*variant*/ - 256) && P( + ), (!f || p[0] & /*variant*/ + 256) && Z( t, "meta-text", /*variant*/ d[8] === "default" ); - let M = o; - o = L(d), o === M ? ~o && S[o].p(d, y) : (s && (xt(), ye(S[M], 1, 1, () => { - S[M] = null; - }), Kt()), ~o ? (s = S[o], s ? s.p(d, y) : (s = S[o] = T[o](d), s.c()), ve(s, 1), s.m(r.parentNode, r)) : s = null), /*timer*/ - d[5] ? C && (C.d(1), C = null) : C ? C.p(d, y) : (C = Pt(d), C.c(), C.m(f.parentNode, f)); + let F = s; + s = L(d), s === F ? ~s && T[s].p(d, p) : (o && (xt(), Le(T[F], 1, 1, () => { + T[F] = null; + }), Kt()), ~s ? (o = T[s], o ? o.p(d, p) : (o = T[s] = S[s](d), o.c()), Te(o, 1), o.m(r.parentNode, r)) : o = null), /*timer*/ + d[5] ? C && (C.d(1), C = null) : C ? C.p(d, p) : (C = Et(d), C.c(), C.m(_.parentNode, _)); }, i(d) { - a || (ve(s), a = !0); + f || (Te(o), f = !0); }, o(d) { - ye(s), a = !1; + Le(o), f = !1; }, d(d) { - d && (k(e), k(t), k(i), k(r), k(f)), _ && _.d(d), m && m.d(), p && p.d(), ~o && S[o].d(d), C && C.d(d); + d && (k(e), k(t), k(i), k(r), k(_)), a && a.d(d), m && m.d(), y && y.d(), ~s && T[s].d(d), C && C.d(d); } }; } -function Tt(n) { +function St(l) { let e, t = `translateX(${/*eta_level*/ - (n[17] || 0) * 100 - 100}%)`; + (l[17] || 0) * 100 - 100}%)`; return { c() { - e = $("div"), Y(e, "class", "eta-bar svelte-1txqlrd"), ie(e, "transform", t); + e = $("div"), J(e, "class", "eta-bar svelte-1txqlrd"), ie(e, "transform", t); }, - m(l, i) { - v(l, e, i); + m(n, i) { + v(n, e, i); }, - p(l, i) { + p(n, i) { i[0] & /*eta_level*/ 131072 && t !== (t = `translateX(${/*eta_level*/ - (l[17] || 0) * 100 - 100}%)`) && ie(e, "transform", t); + (n[17] || 0) * 100 - 100}%)`) && ie(e, "transform", t); }, - d(l) { - l && k(e); + d(n) { + n && k(e); } }; } -function wi(n) { +function Qn(l) { let e; return { c() { - e = F("processing |"); + e = j("processing |"); }, - m(t, l) { - v(t, e, l); + m(t, n) { + v(t, e, n); }, - p: Ue, + p: We, d(t) { t && k(e); } }; } -function pi(n) { +function xn(l) { let e, t = ( /*queue_position*/ - n[2] + 1 + "" - ), l, i, o, s; + l[2] + 1 + "" + ), n, i, s, o; return { c() { - e = F("queue: "), l = F(t), i = F("/"), o = F( + e = j("queue: "), n = j(t), i = j("/"), s = j( /*queue_size*/ - n[3] - ), s = F(" |"); + l[3] + ), o = j(" |"); }, - m(r, f) { - v(r, e, f), v(r, l, f), v(r, i, f), v(r, o, f), v(r, s, f); + m(r, _) { + v(r, e, _), v(r, n, _), v(r, i, _), v(r, s, _), v(r, o, _); }, - p(r, f) { - f[0] & /*queue_position*/ + p(r, _) { + _[0] & /*queue_position*/ 4 && t !== (t = /*queue_position*/ - r[2] + 1 + "") && Z(l, t), f[0] & /*queue_size*/ - 8 && Z( - o, + r[2] + 1 + "") && O(n, t), _[0] & /*queue_size*/ + 8 && O( + s, /*queue_size*/ r[3] ); }, d(r) { - r && (k(e), k(l), k(i), k(o), k(s)); + r && (k(e), k(n), k(i), k(s), k(o)); } }; } -function ki(n) { - let e, t = Ee( +function $n(l) { + let e, t = Be( /*progress*/ - n[7] - ), l = []; + l[7] + ), n = []; for (let i = 0; i < t.length; i += 1) - l[i] = Mt(Lt(n, t, i)); + n[i] = Ft(Lt(l, t, i)); return { c() { - for (let i = 0; i < l.length; i += 1) - l[i].c(); - e = Ce(); + for (let i = 0; i < n.length; i += 1) + n[i].c(); + e = Se(); }, - m(i, o) { - for (let s = 0; s < l.length; s += 1) - l[s] && l[s].m(i, o); - v(i, e, o); + m(i, s) { + for (let o = 0; o < n.length; o += 1) + n[o] && n[o].m(i, s); + v(i, e, s); }, - p(i, o) { - if (o[0] & /*progress*/ + p(i, s) { + if (s[0] & /*progress*/ 128) { - t = Ee( + t = Be( /*progress*/ i[7] ); - let s; - for (s = 0; s < t.length; s += 1) { - const r = Lt(i, t, s); - l[s] ? l[s].p(r, o) : (l[s] = Mt(r), l[s].c(), l[s].m(e.parentNode, e)); + let o; + for (o = 0; o < t.length; o += 1) { + const r = Lt(i, t, o); + n[o] ? n[o].p(r, s) : (n[o] = Ft(r), n[o].c(), n[o].m(e.parentNode, e)); } - for (; s < l.length; s += 1) - l[s].d(1); - l.length = t.length; + for (; o < n.length; o += 1) + n[o].d(1); + n.length = t.length; } }, d(i) { - i && k(e), Qt(l, i); + i && k(e), Qt(n, i); } }; } -function Ft(n) { +function jt(l) { let e, t = ( /*p*/ - n[38].unit + "" - ), l, i, o = " ", s; - function r(_, u) { + l[38].unit + "" + ), n, i, s = " ", o; + function r(a, u) { return ( /*p*/ - _[38].length != null ? yi : vi + a[38].length != null ? ti : ei ); } - let f = r(n), a = f(n); + let _ = r(l), f = _(l); return { c() { - a.c(), e = G(), l = F(t), i = F(" | "), s = F(o); + f.c(), e = K(), n = j(t), i = j(" | "), o = j(s); }, - m(_, u) { - a.m(_, u), v(_, e, u), v(_, l, u), v(_, i, u), v(_, s, u); + m(a, u) { + f.m(a, u), v(a, e, u), v(a, n, u), v(a, i, u), v(a, o, u); }, - p(_, u) { - f === (f = r(_)) && a ? a.p(_, u) : (a.d(1), a = f(_), a && (a.c(), a.m(e.parentNode, e))), u[0] & /*progress*/ + p(a, u) { + _ === (_ = r(a)) && f ? f.p(a, u) : (f.d(1), f = _(a), f && (f.c(), f.m(e.parentNode, e))), u[0] & /*progress*/ 128 && t !== (t = /*p*/ - _[38].unit + "") && Z(l, t); + a[38].unit + "") && O(n, t); }, - d(_) { - _ && (k(e), k(l), k(i), k(s)), a.d(_); + d(a) { + a && (k(e), k(n), k(i), k(o)), f.d(a); } }; } -function vi(n) { - let e = we( +function ei(l) { + let e = ye( /*p*/ - n[38].index || 0 + l[38].index || 0 ) + "", t; return { c() { - t = F(e); + t = j(e); }, - m(l, i) { - v(l, t, i); + m(n, i) { + v(n, t, i); }, - p(l, i) { + p(n, i) { i[0] & /*progress*/ - 128 && e !== (e = we( + 128 && e !== (e = ye( /*p*/ - l[38].index || 0 - ) + "") && Z(t, e); + n[38].index || 0 + ) + "") && O(t, e); }, - d(l) { - l && k(t); + d(n) { + n && k(t); } }; } -function yi(n) { - let e = we( +function ti(l) { + let e = ye( /*p*/ - n[38].index || 0 - ) + "", t, l, i = we( + l[38].index || 0 + ) + "", t, n, i = ye( /*p*/ - n[38].length - ) + "", o; + l[38].length + ) + "", s; return { c() { - t = F(e), l = F("/"), o = F(i); + t = j(e), n = j("/"), s = j(i); }, - m(s, r) { - v(s, t, r), v(s, l, r), v(s, o, r); + m(o, r) { + v(o, t, r), v(o, n, r), v(o, s, r); }, - p(s, r) { + p(o, r) { r[0] & /*progress*/ - 128 && e !== (e = we( + 128 && e !== (e = ye( /*p*/ - s[38].index || 0 - ) + "") && Z(t, e), r[0] & /*progress*/ - 128 && i !== (i = we( + o[38].index || 0 + ) + "") && O(t, e), r[0] & /*progress*/ + 128 && i !== (i = ye( /*p*/ - s[38].length - ) + "") && Z(o, i); + o[38].length + ) + "") && O(s, i); }, - d(s) { - s && (k(t), k(l), k(o)); + d(o) { + o && (k(t), k(n), k(s)); } }; } -function Mt(n) { +function Ft(l) { let e, t = ( /*p*/ - n[38].index != null && Ft(n) + l[38].index != null && jt(l) ); return { c() { - t && t.c(), e = Ce(); + t && t.c(), e = Se(); }, - m(l, i) { - t && t.m(l, i), v(l, e, i); + m(n, i) { + t && t.m(n, i), v(n, e, i); }, - p(l, i) { + p(n, i) { /*p*/ - l[38].index != null ? t ? t.p(l, i) : (t = Ft(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[38].index != null ? t ? t.p(n, i) : (t = jt(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, - d(l) { - l && k(e), t && t.d(l); + d(n) { + n && k(e), t && t.d(n); } }; } -function Nt(n) { +function Ht(l) { let e, t = ( /*eta*/ - n[0] ? `/${/*formatted_eta*/ - n[19]}` : "" - ), l, i; + l[0] ? `/${/*formatted_eta*/ + l[19]}` : "" + ), n, i; return { c() { - e = F( + e = j( /*formatted_timer*/ - n[20] - ), l = F(t), i = F("s"); + l[20] + ), n = j(t), i = j("s"); }, - m(o, s) { - v(o, e, s), v(o, l, s), v(o, i, s); + m(s, o) { + v(s, e, o), v(s, n, o), v(s, i, o); }, - p(o, s) { - s[0] & /*formatted_timer*/ - 1048576 && Z( + p(s, o) { + o[0] & /*formatted_timer*/ + 1048576 && O( e, /*formatted_timer*/ - o[20] - ), s[0] & /*eta, formatted_eta*/ + s[20] + ), o[0] & /*eta, formatted_eta*/ 524289 && t !== (t = /*eta*/ - o[0] ? `/${/*formatted_eta*/ - o[19]}` : "") && Z(l, t); + s[0] ? `/${/*formatted_eta*/ + s[19]}` : "") && O(n, t); }, - d(o) { - o && (k(e), k(l), k(i)); + d(s) { + s && (k(e), k(n), k(i)); } }; } -function Ci(n) { +function li(l) { let e, t; - return e = new li({ + return e = new zn({ props: { margin: ( /*variant*/ - n[8] === "default" + l[8] === "default" ) } }), { c() { - ii(e.$$.fragment); + En(e.$$.fragment); }, - m(l, i) { - _i(e, l, i), t = !0; + m(n, i) { + In(e, n, i), t = !0; }, - p(l, i) { - const o = {}; + p(n, i) { + const s = {}; i[0] & /*variant*/ - 256 && (o.margin = /*variant*/ - l[8] === "default"), e.$set(o); + 256 && (s.margin = /*variant*/ + n[8] === "default"), e.$set(s); }, - i(l) { - t || (ve(e.$$.fragment, l), t = !0); + i(n) { + t || (Te(e.$$.fragment, n), t = !0); }, - o(l) { - ye(e.$$.fragment, l), t = !1; + o(n) { + Le(e.$$.fragment, n), t = !1; }, - d(l) { - si(e, l); + d(n) { + Zn(e, n); } }; } -function qi(n) { - let e, t, l, i, o, s = `${/*last_progress_level*/ - n[15] * 100}%`, r = ( +function ni(l) { + let e, t, n, i, s, o = `${/*last_progress_level*/ + l[15] * 100}%`, r = ( /*progress*/ - n[7] != null && Ht(n) + l[7] != null && Mt(l) ); return { c() { - e = $("div"), t = $("div"), r && r.c(), l = G(), i = $("div"), o = $("div"), Y(t, "class", "progress-level-inner svelte-1txqlrd"), Y(o, "class", "progress-bar svelte-1txqlrd"), ie(o, "width", s), Y(i, "class", "progress-bar-wrap svelte-1txqlrd"), Y(e, "class", "progress-level svelte-1txqlrd"); + e = $("div"), t = $("div"), r && r.c(), n = K(), i = $("div"), s = $("div"), J(t, "class", "progress-level-inner svelte-1txqlrd"), J(s, "class", "progress-bar svelte-1txqlrd"), ie(s, "width", o), J(i, "class", "progress-bar-wrap svelte-1txqlrd"), J(e, "class", "progress-level svelte-1txqlrd"); }, - m(f, a) { - v(f, e, a), _e(e, t), r && r.m(t, null), _e(e, l), _e(e, i), _e(i, o), n[30](o); + m(_, f) { + v(_, e, f), ue(e, t), r && r.m(t, null), ue(e, n), ue(e, i), ue(i, s), l[30](s); }, - p(f, a) { + p(_, f) { /*progress*/ - f[7] != null ? r ? r.p(f, a) : (r = Ht(f), r.c(), r.m(t, null)) : r && (r.d(1), r = null), a[0] & /*last_progress_level*/ - 32768 && s !== (s = `${/*last_progress_level*/ - f[15] * 100}%`) && ie(o, "width", s); + _[7] != null ? r ? r.p(_, f) : (r = Mt(_), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f[0] & /*last_progress_level*/ + 32768 && o !== (o = `${/*last_progress_level*/ + _[15] * 100}%`) && ie(s, "width", o); }, - i: Ue, - o: Ue, - d(f) { - f && k(e), r && r.d(), n[30](null); + i: We, + o: We, + d(_) { + _ && k(e), r && r.d(), l[30](null); } }; } -function Ht(n) { - let e, t = Ee( +function Mt(l) { + let e, t = Be( /*progress*/ - n[7] - ), l = []; + l[7] + ), n = []; for (let i = 0; i < t.length; i += 1) - l[i] = Et(St(n, t, i)); + n[i] = Bt(Tt(l, t, i)); return { c() { - for (let i = 0; i < l.length; i += 1) - l[i].c(); - e = Ce(); + for (let i = 0; i < n.length; i += 1) + n[i].c(); + e = Se(); }, - m(i, o) { - for (let s = 0; s < l.length; s += 1) - l[s] && l[s].m(i, o); - v(i, e, o); + m(i, s) { + for (let o = 0; o < n.length; o += 1) + n[o] && n[o].m(i, s); + v(i, e, s); }, - p(i, o) { - if (o[0] & /*progress_level, progress*/ + p(i, s) { + if (s[0] & /*progress_level, progress*/ 16512) { - t = Ee( + t = Be( /*progress*/ i[7] ); - let s; - for (s = 0; s < t.length; s += 1) { - const r = St(i, t, s); - l[s] ? l[s].p(r, o) : (l[s] = Et(r), l[s].c(), l[s].m(e.parentNode, e)); + let o; + for (o = 0; o < t.length; o += 1) { + const r = Tt(i, t, o); + n[o] ? n[o].p(r, s) : (n[o] = Bt(r), n[o].c(), n[o].m(e.parentNode, e)); } - for (; s < l.length; s += 1) - l[s].d(1); - l.length = t.length; + for (; o < n.length; o += 1) + n[o].d(1); + n.length = t.length; } }, d(i) { - i && k(e), Qt(l, i); + i && k(e), Qt(n, i); } }; } -function jt(n) { - let e, t, l, i, o = ( +function Nt(l) { + let e, t, n, i, s = ( /*i*/ - n[40] !== 0 && Si() - ), s = ( + l[40] !== 0 && ii() + ), o = ( /*p*/ - n[38].desc != null && Vt(n) + l[38].desc != null && Vt(l) ), r = ( /*p*/ - n[38].desc != null && /*progress_level*/ - n[14] && /*progress_level*/ - n[14][ + l[38].desc != null && /*progress_level*/ + l[14] && /*progress_level*/ + l[14][ /*i*/ - n[40] + l[40] ] != null && At() - ), f = ( + ), _ = ( /*progress_level*/ - n[14] != null && zt(n) + l[14] != null && zt(l) ); return { c() { - o && o.c(), e = G(), s && s.c(), t = G(), r && r.c(), l = G(), f && f.c(), i = Ce(); + s && s.c(), e = K(), o && o.c(), t = K(), r && r.c(), n = K(), _ && _.c(), i = Se(); }, - m(a, _) { - o && o.m(a, _), v(a, e, _), s && s.m(a, _), v(a, t, _), r && r.m(a, _), v(a, l, _), f && f.m(a, _), v(a, i, _); + m(f, a) { + s && s.m(f, a), v(f, e, a), o && o.m(f, a), v(f, t, a), r && r.m(f, a), v(f, n, a), _ && _.m(f, a), v(f, i, a); }, - p(a, _) { + p(f, a) { /*p*/ - a[38].desc != null ? s ? s.p(a, _) : (s = Vt(a), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/ - a[38].desc != null && /*progress_level*/ - a[14] && /*progress_level*/ - a[14][ + f[38].desc != null ? o ? o.p(f, a) : (o = Vt(f), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/ + f[38].desc != null && /*progress_level*/ + f[14] && /*progress_level*/ + f[14][ /*i*/ - a[40] - ] != null ? r || (r = At(), r.c(), r.m(l.parentNode, l)) : r && (r.d(1), r = null), /*progress_level*/ - a[14] != null ? f ? f.p(a, _) : (f = zt(a), f.c(), f.m(i.parentNode, i)) : f && (f.d(1), f = null); + f[40] + ] != null ? r || (r = At(), r.c(), r.m(n.parentNode, n)) : r && (r.d(1), r = null), /*progress_level*/ + f[14] != null ? _ ? _.p(f, a) : (_ = zt(f), _.c(), _.m(i.parentNode, i)) : _ && (_.d(1), _ = null); }, - d(a) { - a && (k(e), k(t), k(l), k(i)), o && o.d(a), s && s.d(a), r && r.d(a), f && f.d(a); + d(f) { + f && (k(e), k(t), k(n), k(i)), s && s.d(f), o && o.d(f), r && r.d(f), _ && _.d(f); } }; } -function Si(n) { +function ii(l) { let e; return { c() { - e = F(" /"); + e = j(" /"); }, - m(t, l) { - v(t, e, l); + m(t, n) { + v(t, e, n); }, d(t) { t && k(e); } }; } -function Vt(n) { +function Vt(l) { let e = ( /*p*/ - n[38].desc + "" + l[38].desc + "" ), t; return { c() { - t = F(e); + t = j(e); }, - m(l, i) { - v(l, t, i); + m(n, i) { + v(n, t, i); }, - p(l, i) { + p(n, i) { i[0] & /*progress*/ 128 && e !== (e = /*p*/ - l[38].desc + "") && Z(t, e); + n[38].desc + "") && O(t, e); }, - d(l) { - l && k(t); + d(n) { + n && k(t); } }; } -function At(n) { +function At(l) { let e; return { c() { - e = F("-"); + e = j("-"); }, - m(t, l) { - v(t, e, l); + m(t, n) { + v(t, e, n); }, d(t) { t && k(e); } }; } -function zt(n) { +function zt(l) { let e = (100 * /*progress_level*/ - (n[14][ + (l[14][ /*i*/ - n[40] - ] || 0)).toFixed(1) + "", t, l; + l[40] + ] || 0)).toFixed(1) + "", t, n; return { c() { - t = F(e), l = F("%"); + t = j(e), n = j("%"); }, - m(i, o) { - v(i, t, o), v(i, l, o); + m(i, s) { + v(i, t, s), v(i, n, s); }, - p(i, o) { - o[0] & /*progress_level*/ + p(i, s) { + s[0] & /*progress_level*/ 16384 && e !== (e = (100 * /*progress_level*/ (i[14][ /*i*/ i[40] - ] || 0)).toFixed(1) + "") && Z(t, e); + ] || 0)).toFixed(1) + "") && O(t, e); }, d(i) { - i && (k(t), k(l)); + i && (k(t), k(n)); } }; } -function Et(n) { +function Bt(l) { let e, t = ( /*p*/ - (n[38].desc != null || /*progress_level*/ - n[14] && /*progress_level*/ - n[14][ + (l[38].desc != null || /*progress_level*/ + l[14] && /*progress_level*/ + l[14][ /*i*/ - n[40] - ] != null) && jt(n) + l[40] + ] != null) && Nt(l) ); return { c() { - t && t.c(), e = Ce(); + t && t.c(), e = Se(); }, - m(l, i) { - t && t.m(l, i), v(l, e, i); + m(n, i) { + t && t.m(n, i), v(n, e, i); }, - p(l, i) { + p(n, i) { /*p*/ - l[38].desc != null || /*progress_level*/ - l[14] && /*progress_level*/ - l[14][ + n[38].desc != null || /*progress_level*/ + n[14] && /*progress_level*/ + n[14][ /*i*/ - l[40] - ] != null ? t ? t.p(l, i) : (t = jt(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[40] + ] != null ? t ? t.p(n, i) : (t = Nt(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, - d(l) { - l && k(e), t && t.d(l); + d(n) { + n && k(e), t && t.d(n); } }; } -function Pt(n) { +function Et(l) { let e, t; return { c() { - e = $("p"), t = F( + e = $("p"), t = j( /*loading_text*/ - n[9] - ), Y(e, "class", "loading svelte-1txqlrd"); + l[9] + ), J(e, "class", "loading svelte-1txqlrd"); }, - m(l, i) { - v(l, e, i), _e(e, t); + m(n, i) { + v(n, e, i), ue(e, t); }, - p(l, i) { + p(n, i) { i[0] & /*loading_text*/ - 512 && Z( + 512 && O( t, /*loading_text*/ - l[9] + n[9] ); }, - d(l) { - l && k(e); + d(n) { + n && k(e); } }; } -function Li(n) { - let e, t, l, i, o; - const s = [hi, gi], r = []; - function f(a, _) { +function si(l) { + let e, t, n, i, s; + const o = [Kn, Jn], r = []; + function _(f, a) { return ( /*status*/ - a[4] === "pending" ? 0 : ( + f[4] === "pending" ? 0 : ( /*status*/ - a[4] === "error" ? 1 : -1 + f[4] === "error" ? 1 : -1 ) ); } - return ~(t = f(n)) && (l = r[t] = s[t](n)), { + return ~(t = _(l)) && (n = r[t] = o[t](l)), { c() { - e = $("div"), l && l.c(), Y(e, "class", i = "wrap " + /*variant*/ - n[8] + " " + /*show_progress*/ - n[6] + " svelte-1txqlrd"), P(e, "hide", !/*status*/ - n[4] || /*status*/ - n[4] === "complete" || /*show_progress*/ - n[6] === "hidden"), P( + e = $("div"), n && n.c(), J(e, "class", i = "wrap " + /*variant*/ + l[8] + " " + /*show_progress*/ + l[6] + " svelte-1txqlrd"), Z(e, "hide", !/*status*/ + l[4] || /*status*/ + l[4] === "complete" || /*show_progress*/ + l[6] === "hidden"), Z( e, "translucent", /*variant*/ - n[8] === "center" && /*status*/ - (n[4] === "pending" || /*status*/ - n[4] === "error") || /*translucent*/ - n[11] || /*show_progress*/ - n[6] === "minimal" - ), P( + l[8] === "center" && /*status*/ + (l[4] === "pending" || /*status*/ + l[4] === "error") || /*translucent*/ + l[11] || /*show_progress*/ + l[6] === "minimal" + ), Z( e, "generating", /*status*/ - n[4] === "generating" - ), P( + l[4] === "generating" + ), Z( e, "border", /*border*/ - n[12] + l[12] ), ie( e, "position", /*absolute*/ - n[10] ? "absolute" : "static" + l[10] ? "absolute" : "static" ), ie( e, "padding", /*absolute*/ - n[10] ? "0" : "var(--size-8) 0" + l[10] ? "0" : "var(--size-8) 0" ); }, - m(a, _) { - v(a, e, _), ~t && r[t].m(e, null), n[31](e), o = !0; + m(f, a) { + v(f, e, a), ~t && r[t].m(e, null), l[31](e), s = !0; }, - p(a, _) { + p(f, a) { let u = t; - t = f(a), t === u ? ~t && r[t].p(a, _) : (l && (xt(), ye(r[u], 1, 1, () => { + t = _(f), t === u ? ~t && r[t].p(f, a) : (n && (xt(), Le(r[u], 1, 1, () => { r[u] = null; - }), Kt()), ~t ? (l = r[t], l ? l.p(a, _) : (l = r[t] = s[t](a), l.c()), ve(l, 1), l.m(e, null)) : l = null), (!o || _[0] & /*variant, show_progress*/ + }), Kt()), ~t ? (n = r[t], n ? n.p(f, a) : (n = r[t] = o[t](f), n.c()), Te(n, 1), n.m(e, null)) : n = null), (!s || a[0] & /*variant, show_progress*/ 320 && i !== (i = "wrap " + /*variant*/ - a[8] + " " + /*show_progress*/ - a[6] + " svelte-1txqlrd")) && Y(e, "class", i), (!o || _[0] & /*variant, show_progress, status, show_progress*/ - 336) && P(e, "hide", !/*status*/ - a[4] || /*status*/ - a[4] === "complete" || /*show_progress*/ - a[6] === "hidden"), (!o || _[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ - 2384) && P( + f[8] + " " + /*show_progress*/ + f[6] + " svelte-1txqlrd")) && J(e, "class", i), (!s || a[0] & /*variant, show_progress, status, show_progress*/ + 336) && Z(e, "hide", !/*status*/ + f[4] || /*status*/ + f[4] === "complete" || /*show_progress*/ + f[6] === "hidden"), (!s || a[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ + 2384) && Z( e, "translucent", /*variant*/ - a[8] === "center" && /*status*/ - (a[4] === "pending" || /*status*/ - a[4] === "error") || /*translucent*/ - a[11] || /*show_progress*/ - a[6] === "minimal" - ), (!o || _[0] & /*variant, show_progress, status*/ - 336) && P( + f[8] === "center" && /*status*/ + (f[4] === "pending" || /*status*/ + f[4] === "error") || /*translucent*/ + f[11] || /*show_progress*/ + f[6] === "minimal" + ), (!s || a[0] & /*variant, show_progress, status*/ + 336) && Z( e, "generating", /*status*/ - a[4] === "generating" - ), (!o || _[0] & /*variant, show_progress, border*/ - 4416) && P( + f[4] === "generating" + ), (!s || a[0] & /*variant, show_progress, border*/ + 4416) && Z( e, "border", /*border*/ - a[12] - ), _[0] & /*absolute*/ + f[12] + ), a[0] & /*absolute*/ 1024 && ie( e, "position", /*absolute*/ - a[10] ? "absolute" : "static" - ), _[0] & /*absolute*/ + f[10] ? "absolute" : "static" + ), a[0] & /*absolute*/ 1024 && ie( e, "padding", /*absolute*/ - a[10] ? "0" : "var(--size-8) 0" + f[10] ? "0" : "var(--size-8) 0" ); }, - i(a) { - o || (ve(l), o = !0); + i(f) { + s || (Te(n), s = !0); }, - o(a) { - ye(l), o = !1; + o(f) { + Le(n), s = !1; }, - d(a) { - a && k(e), ~t && r[t].d(), n[31](null); + d(f) { + f && k(e), ~t && r[t].d(), l[31](null); } }; } -let He = [], Oe = !1; -async function Ti(n, e = !0) { +let Ae = [], De = !1; +async function oi(l, e = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) { - if (He.push(n), !Oe) - Oe = !0; + if (Ae.push(l), !De) + De = !0; else return; - await di(), requestAnimationFrame(() => { + await Xn(), requestAnimationFrame(() => { let t = [0, 0]; - for (let l = 0; l < He.length; l++) { - const o = He[l].getBoundingClientRect(); - (l === 0 || o.top + window.scrollY <= t[0]) && (t[0] = o.top + window.scrollY, t[1] = l); + for (let n = 0; n < Ae.length; n++) { + const s = Ae[n].getBoundingClientRect(); + (n === 0 || s.top + window.scrollY <= t[0]) && (t[0] = s.top + window.scrollY, t[1] = n); } - window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), Oe = !1, He = []; + window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), De = !1, Ae = []; }); } } -function Fi(n, e, t) { - let l, { $$slots: i = {}, $$scope: o } = e, { i18n: s } = e, { eta: r = null } = e, { queue_position: f } = e, { queue_size: a } = e, { status: _ } = e, { scroll_to_output: u = !1 } = e, { timer: c = !0 } = e, { show_progress: m = "full" } = e, { message: p = null } = e, { progress: T = null } = e, { variant: S = "default" } = e, { loading_text: L = "Loading..." } = e, { absolute: C = !0 } = e, { translucent: d = !1 } = e, { border: y = !1 } = e, { autoscroll: M } = e, b, B = !1, Q = 0, E = 0, R = null, U = null, se = 0, D = null, x, A = null, de = !0; - const h = () => { - t(0, r = t(26, R = t(19, me = null))), t(24, Q = performance.now()), t(25, E = 0), B = !0, Fe(); +function fi(l, e, t) { + let n, { $$slots: i = {}, $$scope: s } = e, { i18n: o } = e, { eta: r = null } = e, { queue_position: _ } = e, { queue_size: f } = e, { status: a } = e, { scroll_to_output: u = !1 } = e, { timer: c = !0 } = e, { show_progress: m = "full" } = e, { message: y = null } = e, { progress: S = null } = e, { variant: T = "default" } = e, { loading_text: L = "Loading..." } = e, { absolute: C = !0 } = e, { translucent: d = !1 } = e, { border: p = !1 } = e, { autoscroll: F } = e, g, R = !1, Q = 0, E = 0, P = null, X = null, ge = 0, D = null, x, A = null, be = !0; + const b = () => { + t(0, r = t(26, P = t(19, we = null))), t(24, Q = performance.now()), t(25, E = 0), R = !0, Me(); }; - function Fe() { + function Me() { requestAnimationFrame(() => { - t(25, E = (performance.now() - Q) / 1e3), B && Fe(); + t(25, E = (performance.now() - Q) / 1e3), R && Me(); }); } - function Me() { - t(25, E = 0), t(0, r = t(26, R = t(19, me = null))), B && (B = !1); + function Ne() { + t(25, E = 0), t(0, r = t(26, P = t(19, we = null))), R && (R = !1); } - mi(() => { - B && Me(); + Yn(() => { + R && Ne(); }); - let me = null; - function Pe(w) { + let we = null; + function Ee(w) { Ct[w ? "unshift" : "push"](() => { - A = w, t(16, A), t(7, T), t(14, D), t(15, x); + A = w, t(16, A), t(7, S), t(14, D), t(15, x); }); } - function Ze(w) { + function Pe(w) { Ct[w ? "unshift" : "push"](() => { - b = w, t(13, b); + g = w, t(13, g); }); } - return n.$$set = (w) => { - "i18n" in w && t(1, s = w.i18n), "eta" in w && t(0, r = w.eta), "queue_position" in w && t(2, f = w.queue_position), "queue_size" in w && t(3, a = w.queue_size), "status" in w && t(4, _ = w.status), "scroll_to_output" in w && t(21, u = w.scroll_to_output), "timer" in w && t(5, c = w.timer), "show_progress" in w && t(6, m = w.show_progress), "message" in w && t(22, p = w.message), "progress" in w && t(7, T = w.progress), "variant" in w && t(8, S = w.variant), "loading_text" in w && t(9, L = w.loading_text), "absolute" in w && t(10, C = w.absolute), "translucent" in w && t(11, d = w.translucent), "border" in w && t(12, y = w.border), "autoscroll" in w && t(23, M = w.autoscroll), "$$scope" in w && t(28, o = w.$$scope); - }, n.$$.update = () => { - n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 218103809 && (r === null && t(0, r = R), r != null && R !== r && (t(27, U = (performance.now() - Q) / 1e3 + r), t(19, me = U.toFixed(1)), t(26, R = r))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 167772160 && t(17, se = U === null || U <= 0 || !E ? null : Math.min(E / U, 1)), n.$$.dirty[0] & /*progress*/ - 128 && T != null && t(18, de = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (T != null ? t(14, D = T.map((w) => { + return l.$$set = (w) => { + "i18n" in w && t(1, o = w.i18n), "eta" in w && t(0, r = w.eta), "queue_position" in w && t(2, _ = w.queue_position), "queue_size" in w && t(3, f = w.queue_size), "status" in w && t(4, a = w.status), "scroll_to_output" in w && t(21, u = w.scroll_to_output), "timer" in w && t(5, c = w.timer), "show_progress" in w && t(6, m = w.show_progress), "message" in w && t(22, y = w.message), "progress" in w && t(7, S = w.progress), "variant" in w && t(8, T = w.variant), "loading_text" in w && t(9, L = w.loading_text), "absolute" in w && t(10, C = w.absolute), "translucent" in w && t(11, d = w.translucent), "border" in w && t(12, p = w.border), "autoscroll" in w && t(23, F = w.autoscroll), "$$scope" in w && t(28, s = w.$$scope); + }, l.$$.update = () => { + l.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ + 218103809 && (r === null && t(0, r = P), r != null && P !== r && (t(27, X = (performance.now() - Q) / 1e3 + r), t(19, we = X.toFixed(1)), t(26, P = r))), l.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 167772160 && t(17, ge = X === null || X <= 0 || !E ? null : Math.min(E / X, 1)), l.$$.dirty[0] & /*progress*/ + 128 && S != null && t(18, be = !1), l.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (S != null ? t(14, D = S.map((w) => { if (w.index != null && w.length != null) return w.index / w.length; if (w.progress != null) return w.progress; - })) : t(14, D = null), D ? (t(15, x = D[D.length - 1]), A && (x === 0 ? t(16, A.style.transition = "0", A) : t(16, A.style.transition = "150ms", A))) : t(15, x = void 0)), n.$$.dirty[0] & /*status*/ - 16 && (_ === "pending" ? h() : Me()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 10493968 && b && u && (_ === "pending" || _ === "complete") && Ti(b, M), n.$$.dirty[0] & /*status, message*/ - 4194320, n.$$.dirty[0] & /*timer_diff*/ - 33554432 && t(20, l = E.toFixed(1)); + })) : t(14, D = null), D ? (t(15, x = D[D.length - 1]), A && (x === 0 ? t(16, A.style.transition = "0", A) : t(16, A.style.transition = "150ms", A))) : t(15, x = void 0)), l.$$.dirty[0] & /*status*/ + 16 && (a === "pending" ? b() : Ne()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 10493968 && g && u && (a === "pending" || a === "complete") && oi(g, F), l.$$.dirty[0] & /*status, message*/ + 4194320, l.$$.dirty[0] & /*timer_diff*/ + 33554432 && t(20, n = E.toFixed(1)); }, [ r, - s, + o, + _, f, a, - _, c, m, - T, S, + T, L, C, d, - y, - b, + p, + g, D, x, A, - se, - de, - me, - l, + ge, + be, + we, + n, u, - p, - M, + y, + F, Q, E, - R, - U, - o, + P, + X, + s, i, - Pe, - Ze + Ee, + Pe ]; } -class Mi extends ni { +class ai extends Bn { constructor(e) { - super(), ai( + super(), Dn( this, e, - Fi, - Li, - ui, + fi, + si, + Wn, { i18n: 1, eta: 0, @@ -2720,334 +2665,334 @@ class Mi extends ni { } } const { - SvelteComponent: Ni, - add_flush_callback: Zt, - assign: Hi, - bind: Bt, - binding_callbacks: Rt, - check_outros: ji, + SvelteComponent: _i, + add_flush_callback: Pt, + assign: ri, + bind: Zt, + binding_callbacks: Ot, + check_outros: ui, create_component: Qe, destroy_component: xe, - detach: Vi, - flush: N, - get_spread_object: Ai, - get_spread_update: zi, - group_outros: Ei, - init: Pi, - insert: Zi, + detach: ci, + flush: H, + get_spread_object: di, + get_spread_update: mi, + group_outros: hi, + init: gi, + insert: bi, mount_component: $e, - safe_not_equal: Bi, - space: Ri, - transition_in: pe, - transition_out: Te + safe_not_equal: wi, + space: ki, + transition_in: Ce, + transition_out: je } = window.__gradio__svelte__internal; -function Dt(n) { +function Rt(l) { let e, t; - const l = [ + const n = [ { autoscroll: ( /*gradio*/ - n[3].autoscroll + l[3].autoscroll ) }, { i18n: ( /*gradio*/ - n[3].i18n + l[3].i18n ) }, /*loading_status*/ - n[17] + l[17] ]; let i = {}; - for (let o = 0; o < l.length; o += 1) - i = Hi(i, l[o]); - return e = new Mi({ props: i }), { + for (let s = 0; s < n.length; s += 1) + i = ri(i, n[s]); + return e = new ai({ props: i }), { c() { Qe(e.$$.fragment); }, - m(o, s) { - $e(e, o, s), t = !0; + m(s, o) { + $e(e, s, o), t = !0; }, - p(o, s) { - const r = s & /*gradio, loading_status*/ - 131080 ? zi(l, [ - s & /*gradio*/ + p(s, o) { + const r = o & /*gradio, loading_status*/ + 131080 ? mi(n, [ + o & /*gradio*/ 8 && { autoscroll: ( /*gradio*/ - o[3].autoscroll + s[3].autoscroll ) }, - s & /*gradio*/ + o & /*gradio*/ 8 && { i18n: ( /*gradio*/ - o[3].i18n + s[3].i18n ) }, - s & /*loading_status*/ - 131072 && Ai( + o & /*loading_status*/ + 131072 && di( /*loading_status*/ - o[17] + s[17] ) ]) : {}; e.$set(r); }, - i(o) { - t || (pe(e.$$.fragment, o), t = !0); + i(s) { + t || (Ce(e.$$.fragment, s), t = !0); }, - o(o) { - Te(e.$$.fragment, o), t = !1; + o(s) { + je(e.$$.fragment, s), t = !1; }, - d(o) { - xe(e, o); + d(s) { + xe(e, s); } }; } -function Di(n) { - let e, t, l, i, o, s = ( +function vi(l) { + let e, t, n, i, s, o = ( /*loading_status*/ - n[17] && Dt(n) + l[17] && Rt(l) ); - function r(_) { - n[22](_); + function r(a) { + l[22](a); } - function f(_) { - n[23](_); + function _(a) { + l[23](a); } - let a = { + let f = { label: ( /*label*/ - n[4] + l[4] ), info: ( /*info*/ - n[6] + l[6] ), show_label: ( /*show_label*/ - n[10] + l[10] ), show_legend: ( /*show_legend*/ - n[11] + l[11] ), show_legend_label: ( /*show_legend_label*/ - n[12] + l[12] ), legend_label: ( /*legend_label*/ - n[5] + l[5] ), color_map: ( /*color_map*/ - n[1] + l[1] ), show_copy_button: ( /*show_copy_button*/ - n[16] + l[16] ), container: ( /*container*/ - n[13] + l[13] ), disabled: !/*interactive*/ - n[18] + l[18] }; return ( /*value*/ - n[0] !== void 0 && (a.value = /*value*/ - n[0]), /*value_is_output*/ - n[2] !== void 0 && (a.value_is_output = /*value_is_output*/ - n[2]), t = new Xn({ props: a }), Rt.push(() => Bt(t, "value", r)), Rt.push(() => Bt(t, "value_is_output", f)), t.$on( + l[0] !== void 0 && (f.value = /*value*/ + l[0]), /*value_is_output*/ + l[2] !== void 0 && (f.value_is_output = /*value_is_output*/ + l[2]), t = new _n({ props: f }), Ot.push(() => Zt(t, "value", r)), Ot.push(() => Zt(t, "value_is_output", _)), t.$on( "change", /*change_handler*/ - n[24] + l[24] ), t.$on( "input", /*input_handler*/ - n[25] + l[25] ), t.$on( "submit", /*submit_handler*/ - n[26] + l[26] ), t.$on( "blur", /*blur_handler*/ - n[27] + l[27] ), t.$on( "select", /*select_handler*/ - n[28] + l[28] ), t.$on( "focus", /*focus_handler*/ - n[29] + l[29] ), { c() { - s && s.c(), e = Ri(), Qe(t.$$.fragment); + o && o.c(), e = ki(), Qe(t.$$.fragment); }, - m(_, u) { - s && s.m(_, u), Zi(_, e, u), $e(t, _, u), o = !0; + m(a, u) { + o && o.m(a, u), bi(a, e, u), $e(t, a, u), s = !0; }, - p(_, u) { + p(a, u) { /*loading_status*/ - _[17] ? s ? (s.p(_, u), u & /*loading_status*/ - 131072 && pe(s, 1)) : (s = Dt(_), s.c(), pe(s, 1), s.m(e.parentNode, e)) : s && (Ei(), Te(s, 1, 1, () => { - s = null; - }), ji()); + a[17] ? o ? (o.p(a, u), u & /*loading_status*/ + 131072 && Ce(o, 1)) : (o = Rt(a), o.c(), Ce(o, 1), o.m(e.parentNode, e)) : o && (hi(), je(o, 1, 1, () => { + o = null; + }), ui()); const c = {}; u & /*label*/ 16 && (c.label = /*label*/ - _[4]), u & /*info*/ + a[4]), u & /*info*/ 64 && (c.info = /*info*/ - _[6]), u & /*show_label*/ + a[6]), u & /*show_label*/ 1024 && (c.show_label = /*show_label*/ - _[10]), u & /*show_legend*/ + a[10]), u & /*show_legend*/ 2048 && (c.show_legend = /*show_legend*/ - _[11]), u & /*show_legend_label*/ + a[11]), u & /*show_legend_label*/ 4096 && (c.show_legend_label = /*show_legend_label*/ - _[12]), u & /*legend_label*/ + a[12]), u & /*legend_label*/ 32 && (c.legend_label = /*legend_label*/ - _[5]), u & /*color_map*/ + a[5]), u & /*color_map*/ 2 && (c.color_map = /*color_map*/ - _[1]), u & /*show_copy_button*/ + a[1]), u & /*show_copy_button*/ 65536 && (c.show_copy_button = /*show_copy_button*/ - _[16]), u & /*container*/ + a[16]), u & /*container*/ 8192 && (c.container = /*container*/ - _[13]), u & /*interactive*/ + a[13]), u & /*interactive*/ 262144 && (c.disabled = !/*interactive*/ - _[18]), !l && u & /*value*/ - 1 && (l = !0, c.value = /*value*/ - _[0], Zt(() => l = !1)), !i && u & /*value_is_output*/ + a[18]), !n && u & /*value*/ + 1 && (n = !0, c.value = /*value*/ + a[0], Pt(() => n = !1)), !i && u & /*value_is_output*/ 4 && (i = !0, c.value_is_output = /*value_is_output*/ - _[2], Zt(() => i = !1)), t.$set(c); + a[2], Pt(() => i = !1)), t.$set(c); }, - i(_) { - o || (pe(s), pe(t.$$.fragment, _), o = !0); + i(a) { + s || (Ce(o), Ce(t.$$.fragment, a), s = !0); }, - o(_) { - Te(s), Te(t.$$.fragment, _), o = !1; + o(a) { + je(o), je(t.$$.fragment, a), s = !1; }, - d(_) { - _ && Vi(e), s && s.d(_), xe(t, _); + d(a) { + a && ci(e), o && o.d(a), xe(t, a); } } ); } -function Oi(n) { +function pi(l) { let e, t; - return e = new hl({ + return e = new Tn({ props: { visible: ( /*visible*/ - n[9] + l[9] ), elem_id: ( /*elem_id*/ - n[7] + l[7] ), elem_classes: ( /*elem_classes*/ - n[8] + l[8] ), scale: ( /*scale*/ - n[14] + l[14] ), min_width: ( /*min_width*/ - n[15] + l[15] ), allow_overflow: !1, padding: ( /*container*/ - n[13] + l[13] ), - $$slots: { default: [Di] }, - $$scope: { ctx: n } + $$slots: { default: [vi] }, + $$scope: { ctx: l } } }), { c() { Qe(e.$$.fragment); }, - m(l, i) { - $e(e, l, i), t = !0; + m(n, i) { + $e(e, n, i), t = !0; }, - p(l, [i]) { - const o = {}; + p(n, [i]) { + const s = {}; i & /*visible*/ - 512 && (o.visible = /*visible*/ - l[9]), i & /*elem_id*/ - 128 && (o.elem_id = /*elem_id*/ - l[7]), i & /*elem_classes*/ - 256 && (o.elem_classes = /*elem_classes*/ - l[8]), i & /*scale*/ - 16384 && (o.scale = /*scale*/ - l[14]), i & /*min_width*/ - 32768 && (o.min_width = /*min_width*/ - l[15]), i & /*container*/ - 8192 && (o.padding = /*container*/ - l[13]), i & /*$$scope, label, info, show_label, show_legend, show_legend_label, legend_label, color_map, show_copy_button, container, interactive, value, value_is_output, gradio, loading_status*/ - 1074216063 && (o.$$scope = { dirty: i, ctx: l }), e.$set(o); - }, - i(l) { - t || (pe(e.$$.fragment, l), t = !0); - }, - o(l) { - Te(e.$$.fragment, l), t = !1; - }, - d(l) { - xe(e, l); + 512 && (s.visible = /*visible*/ + n[9]), i & /*elem_id*/ + 128 && (s.elem_id = /*elem_id*/ + n[7]), i & /*elem_classes*/ + 256 && (s.elem_classes = /*elem_classes*/ + n[8]), i & /*scale*/ + 16384 && (s.scale = /*scale*/ + n[14]), i & /*min_width*/ + 32768 && (s.min_width = /*min_width*/ + n[15]), i & /*container*/ + 8192 && (s.padding = /*container*/ + n[13]), i & /*$$scope, label, info, show_label, show_legend, show_legend_label, legend_label, color_map, show_copy_button, container, interactive, value, value_is_output, gradio, loading_status*/ + 1074216063 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s); + }, + i(n) { + t || (Ce(e.$$.fragment, n), t = !0); + }, + o(n) { + je(e.$$.fragment, n), t = !1; + }, + d(n) { + xe(e, n); } }; } -function Ii(n, e, t) { - let { gradio: l } = e, { label: i = "Highlighted Textbox" } = e, { legend_label: o = "Highlights:" } = e, { info: s = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: f = [] } = e, { visible: a = !0 } = e, { value: _ } = e, { show_label: u } = e, { show_legend: c } = e, { show_legend_label: m } = e, { color_map: p = {} } = e, { container: T = !0 } = e, { scale: S = null } = e, { min_width: L = void 0 } = e, { show_copy_button: C = !1 } = e, { loading_status: d = void 0 } = e, { value_is_output: y = !1 } = e, { combine_adjacent: M = !1 } = e, { interactive: b = !0 } = e; - const B = !1, Q = !0; - function E(h) { - _ = h, t(0, _), t(19, M); - } - function R(h) { - y = h, t(2, y); - } - const U = () => l.dispatch("change"), se = () => l.dispatch("input"), D = () => l.dispatch("submit"), x = () => l.dispatch("blur"), A = (h) => l.dispatch("select", h.detail), de = () => l.dispatch("focus"); - return n.$$set = (h) => { - "gradio" in h && t(3, l = h.gradio), "label" in h && t(4, i = h.label), "legend_label" in h && t(5, o = h.legend_label), "info" in h && t(6, s = h.info), "elem_id" in h && t(7, r = h.elem_id), "elem_classes" in h && t(8, f = h.elem_classes), "visible" in h && t(9, a = h.visible), "value" in h && t(0, _ = h.value), "show_label" in h && t(10, u = h.show_label), "show_legend" in h && t(11, c = h.show_legend), "show_legend_label" in h && t(12, m = h.show_legend_label), "color_map" in h && t(1, p = h.color_map), "container" in h && t(13, T = h.container), "scale" in h && t(14, S = h.scale), "min_width" in h && t(15, L = h.min_width), "show_copy_button" in h && t(16, C = h.show_copy_button), "loading_status" in h && t(17, d = h.loading_status), "value_is_output" in h && t(2, y = h.value_is_output), "combine_adjacent" in h && t(19, M = h.combine_adjacent), "interactive" in h && t(18, b = h.interactive); - }, n.$$.update = () => { - n.$$.dirty & /*color_map*/ - 2 && !p && Object.keys(p).length && t(1, p), n.$$.dirty & /*value, combine_adjacent*/ - 524289 && _ && M && t(0, _ = Sn(_, "equal")); +function yi(l, e, t) { + let { gradio: n } = e, { label: i = "Highlighted Textbox" } = e, { legend_label: s = "Highlights:" } = e, { info: o = void 0 } = e, { elem_id: r = "" } = e, { elem_classes: _ = [] } = e, { visible: f = !0 } = e, { value: a } = e, { show_label: u } = e, { show_legend: c } = e, { show_legend_label: m } = e, { color_map: y = {} } = e, { container: S = !0 } = e, { scale: T = null } = e, { min_width: L = void 0 } = e, { show_copy_button: C = !1 } = e, { loading_status: d = void 0 } = e, { value_is_output: p = !1 } = e, { combine_adjacent: F = !1 } = e, { interactive: g = !0 } = e; + const R = !1, Q = !0; + function E(b) { + a = b, t(0, a), t(19, F); + } + function P(b) { + p = b, t(2, p); + } + const X = () => n.dispatch("change"), ge = () => n.dispatch("input"), D = () => n.dispatch("submit"), x = () => n.dispatch("blur"), A = (b) => n.dispatch("select", b.detail), be = () => n.dispatch("focus"); + return l.$$set = (b) => { + "gradio" in b && t(3, n = b.gradio), "label" in b && t(4, i = b.label), "legend_label" in b && t(5, s = b.legend_label), "info" in b && t(6, o = b.info), "elem_id" in b && t(7, r = b.elem_id), "elem_classes" in b && t(8, _ = b.elem_classes), "visible" in b && t(9, f = b.visible), "value" in b && t(0, a = b.value), "show_label" in b && t(10, u = b.show_label), "show_legend" in b && t(11, c = b.show_legend), "show_legend_label" in b && t(12, m = b.show_legend_label), "color_map" in b && t(1, y = b.color_map), "container" in b && t(13, S = b.container), "scale" in b && t(14, T = b.scale), "min_width" in b && t(15, L = b.min_width), "show_copy_button" in b && t(16, C = b.show_copy_button), "loading_status" in b && t(17, d = b.loading_status), "value_is_output" in b && t(2, p = b.value_is_output), "combine_adjacent" in b && t(19, F = b.combine_adjacent), "interactive" in b && t(18, g = b.interactive); + }, l.$$.update = () => { + l.$$.dirty & /*color_map*/ + 2 && !y && Object.keys(y).length && t(1, y), l.$$.dirty & /*value, combine_adjacent*/ + 524289 && a && F && t(0, a = Ol(a, "equal")); }, [ - _, - p, + a, y, - l, + p, + n, i, - o, s, + o, r, + _, f, - a, u, c, m, - T, S, + T, L, C, d, - b, - M, - B, + g, + F, + R, Q, E, - R, - U, - se, + P, + X, + ge, D, x, A, - de + be ]; } -class Ui extends Ni { +class Ci extends _i { constructor(e) { - super(), Pi(this, e, Ii, Oi, Bi, { + super(), gi(this, e, yi, pi, wi, { gradio: 3, label: 4, legend_label: 5, @@ -3076,121 +3021,121 @@ class Ui extends Ni { return this.$$.ctx[3]; } set gradio(e) { - this.$$set({ gradio: e }), N(); + this.$$set({ gradio: e }), H(); } get label() { return this.$$.ctx[4]; } set label(e) { - this.$$set({ label: e }), N(); + this.$$set({ label: e }), H(); } get legend_label() { return this.$$.ctx[5]; } set legend_label(e) { - this.$$set({ legend_label: e }), N(); + this.$$set({ legend_label: e }), H(); } get info() { return this.$$.ctx[6]; } set info(e) { - this.$$set({ info: e }), N(); + this.$$set({ info: e }), H(); } get elem_id() { return this.$$.ctx[7]; } set elem_id(e) { - this.$$set({ elem_id: e }), N(); + this.$$set({ elem_id: e }), H(); } get elem_classes() { return this.$$.ctx[8]; } set elem_classes(e) { - this.$$set({ elem_classes: e }), N(); + this.$$set({ elem_classes: e }), H(); } get visible() { return this.$$.ctx[9]; } set visible(e) { - this.$$set({ visible: e }), N(); + this.$$set({ visible: e }), H(); } get value() { return this.$$.ctx[0]; } set value(e) { - this.$$set({ value: e }), N(); + this.$$set({ value: e }), H(); } get show_label() { return this.$$.ctx[10]; } set show_label(e) { - this.$$set({ show_label: e }), N(); + this.$$set({ show_label: e }), H(); } get show_legend() { return this.$$.ctx[11]; } set show_legend(e) { - this.$$set({ show_legend: e }), N(); + this.$$set({ show_legend: e }), H(); } get show_legend_label() { return this.$$.ctx[12]; } set show_legend_label(e) { - this.$$set({ show_legend_label: e }), N(); + this.$$set({ show_legend_label: e }), H(); } get color_map() { return this.$$.ctx[1]; } set color_map(e) { - this.$$set({ color_map: e }), N(); + this.$$set({ color_map: e }), H(); } get container() { return this.$$.ctx[13]; } set container(e) { - this.$$set({ container: e }), N(); + this.$$set({ container: e }), H(); } get scale() { return this.$$.ctx[14]; } set scale(e) { - this.$$set({ scale: e }), N(); + this.$$set({ scale: e }), H(); } get min_width() { return this.$$.ctx[15]; } set min_width(e) { - this.$$set({ min_width: e }), N(); + this.$$set({ min_width: e }), H(); } get show_copy_button() { return this.$$.ctx[16]; } set show_copy_button(e) { - this.$$set({ show_copy_button: e }), N(); + this.$$set({ show_copy_button: e }), H(); } get loading_status() { return this.$$.ctx[17]; } set loading_status(e) { - this.$$set({ loading_status: e }), N(); + this.$$set({ loading_status: e }), H(); } get value_is_output() { return this.$$.ctx[2]; } set value_is_output(e) { - this.$$set({ value_is_output: e }), N(); + this.$$set({ value_is_output: e }), H(); } get combine_adjacent() { return this.$$.ctx[19]; } set combine_adjacent(e) { - this.$$set({ combine_adjacent: e }), N(); + this.$$set({ combine_adjacent: e }), H(); } get interactive() { return this.$$.ctx[18]; } set interactive(e) { - this.$$set({ interactive: e }), N(); + this.$$set({ interactive: e }), H(); } get autofocus() { return this.$$.ctx[20]; @@ -3200,5 +3145,5 @@ class Ui extends Ni { } } export { - Ui as default + Ci as default };