diff --git "a/src/backend/gradio_hubquicksearch/templates/component/index.js" "b/src/backend/gradio_hubquicksearch/templates/component/index.js" new file mode 100644--- /dev/null +++ "b/src/backend/gradio_hubquicksearch/templates/component/index.js" @@ -0,0 +1,4423 @@ +const { + SvelteComponentDev: Bo, + add_location: Po, + assign: Ro, + create_slot: Co, + detach_dev: No, + dispatch_dev: Gt, + element: Ao, + get_all_dirty_from_scope: jo, + get_slot_changes: qo, + get_spread_update: Lo, + init: Fo, + insert_dev: To, + safe_not_equal: zo, + set_dynamic_element_data: xt, + set_style: M, + toggle_class: ee, + transition_in: Un, + transition_out: Mn, + update_slot_base: Io, + validate_dynamic_element: Do, + validate_slots: Uo, + validate_void_dynamic_element: Mo +} = window.__gradio__svelte__internal, Qo = "frontend/node_modules/@gradio/atoms/src/Block.svelte"; +function Qn(n) { + let e, t, l; + const s = ( + /*#slots*/ + n[18].default + ), o = Co( + s, + n, + /*$$scope*/ + n[17], + null + ); + let r = [ + { "data-testid": ( + /*test_id*/ + n[7] + ) }, + { id: ( + /*elem_id*/ + n[2] + ) }, + { + class: t = "block " + /*elem_classes*/ + n[3].join(" ") + " s-gHri1EnE1tNu" + } + ], i = {}; + for (let u = 0; u < r.length; u += 1) + i = Ro(i, r[u]); + const a = { + c: function() { + e = Ao( + /*tag*/ + n[14] + ), o && o.c(), xt( + /*tag*/ + n[14] + )(e, i), ee( + e, + "hidden", + /*visible*/ + n[10] === !1 + ), ee( + e, + "padded", + /*padding*/ + n[6] + ), ee( + e, + "border_focus", + /*border_mode*/ + n[5] === "focus" + ), ee( + e, + "border_contrast", + /*border_mode*/ + n[5] === "contrast" + ), ee(e, "hide-container", !/*explicit_call*/ + n[8] && !/*container*/ + n[9]), M( + e, + "height", + /*get_dimension*/ + n[15]( + /*height*/ + n[0] + ) + ), M(e, "width", typeof /*width*/ + n[1] == "number" ? `calc(min(${/*width*/ + n[1]}px, 100%))` : ( + /*get_dimension*/ + n[15]( + /*width*/ + n[1] + ) + )), M( + e, + "border-style", + /*variant*/ + n[4] + ), M( + e, + "overflow", + /*allow_overflow*/ + n[11] ? "visible" : "hidden" + ), M( + e, + "flex-grow", + /*scale*/ + n[12] + ), M(e, "min-width", `calc(min(${/*min_width*/ + n[13]}px, 100%))`), M(e, "border-width", "var(--block-border-width)"), Po(e, Qo, 33, 0, 822); + }, + m: function(c, f) { + To(c, e, f), o && o.m(e, null), l = !0; + }, + p: function(c, f) { + o && o.p && (!l || f & /*$$scope*/ + 131072) && Io( + o, + s, + c, + /*$$scope*/ + c[17], + l ? qo( + s, + /*$$scope*/ + c[17], + f, + null + ) : jo( + /*$$scope*/ + c[17] + ), + null + ), xt( + /*tag*/ + c[14] + )(e, i = Lo(r, [ + (!l || f & /*test_id*/ + 128) && { "data-testid": ( + /*test_id*/ + c[7] + ) }, + (!l || f & /*elem_id*/ + 4) && { id: ( + /*elem_id*/ + c[2] + ) }, + (!l || f & /*elem_classes*/ + 8 && t !== (t = "block " + /*elem_classes*/ + c[3].join(" ") + " s-gHri1EnE1tNu")) && { class: t } + ])), ee( + e, + "hidden", + /*visible*/ + c[10] === !1 + ), ee( + e, + "padded", + /*padding*/ + c[6] + ), ee( + e, + "border_focus", + /*border_mode*/ + c[5] === "focus" + ), ee( + e, + "border_contrast", + /*border_mode*/ + c[5] === "contrast" + ), ee(e, "hide-container", !/*explicit_call*/ + c[8] && !/*container*/ + c[9]), f & /*height*/ + 1 && M( + e, + "height", + /*get_dimension*/ + c[15]( + /*height*/ + c[0] + ) + ), f & /*width*/ + 2 && M(e, "width", typeof /*width*/ + c[1] == "number" ? `calc(min(${/*width*/ + c[1]}px, 100%))` : ( + /*get_dimension*/ + c[15]( + /*width*/ + c[1] + ) + )), f & /*variant*/ + 16 && M( + e, + "border-style", + /*variant*/ + c[4] + ), f & /*allow_overflow*/ + 2048 && M( + e, + "overflow", + /*allow_overflow*/ + c[11] ? "visible" : "hidden" + ), f & /*scale*/ + 4096 && M( + e, + "flex-grow", + /*scale*/ + c[12] + ), f & /*min_width*/ + 8192 && M(e, "min-width", `calc(min(${/*min_width*/ + c[13]}px, 100%))`); + }, + i: function(c) { + l || (Un(o, c), l = !0); + }, + o: function(c) { + Mn(o, c), l = !1; + }, + d: function(c) { + c && No(e), o && o.d(c); + } + }; + return Gt("SvelteRegisterBlock", { + block: a, + id: Qn.name, + type: "child_dynamic_element", + source: '(34:0) ', + ctx: n + }), a; +} +function at(n) { + let e; + Do( + /*tag*/ + n[14] + ), Mo( + /*tag*/ + n[14] + ); + let t = ( + /*tag*/ + n[14] && Qn(n) + ); + const l = { + c: function() { + t && t.c(); + }, + l: function(o) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(o, r) { + t && t.m(o, r), e = !0; + }, + p: function(o, [r]) { + /*tag*/ + o[14] && t.p(o, r); + }, + i: function(o) { + e || (Un(t, o), e = !0); + }, + o: function(o) { + Mn(t, o), e = !1; + }, + d: function(o) { + t && t.d(o); + } + }; + return Gt("SvelteRegisterBlock", { + block: l, + id: at.name, + type: "component", + source: "", + ctx: n + }), l; +} +function Oo(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + Uo("Block", l, ["default"]); + let { height: o = void 0 } = e, { width: r = void 0 } = e, { elem_id: i = "" } = e, { elem_classes: a = [] } = e, { variant: u = "solid" } = e, { border_mode: c = "base" } = e, { padding: f = !0 } = e, { type: d = "normal" } = e, { test_id: g = void 0 } = e, { explicit_call: v = !1 } = e, { container: p = !0 } = e, { visible: b = !0 } = e, { allow_overflow: y = !0 } = e, { scale: k = null } = e, { min_width: N = 0 } = e, R = d === "fieldset" ? "fieldset" : "div"; + const w = (h) => { + if (h !== void 0) { + if (typeof h == "number") + return h + "px"; + if (typeof h == "string") + return h; + } + }, S = [ + "height", + "width", + "elem_id", + "elem_classes", + "variant", + "border_mode", + "padding", + "type", + "test_id", + "explicit_call", + "container", + "visible", + "allow_overflow", + "scale", + "min_width" + ]; + return Object.keys(e).forEach((h) => { + !~S.indexOf(h) && h.slice(0, 2) !== "$$" && h !== "slot" && console.warn(` was created with unknown prop '${h}'`); + }), n.$$set = (h) => { + "height" in h && t(0, o = h.height), "width" in h && t(1, r = h.width), "elem_id" in h && t(2, i = h.elem_id), "elem_classes" in h && t(3, a = h.elem_classes), "variant" in h && t(4, u = h.variant), "border_mode" in h && t(5, c = h.border_mode), "padding" in h && t(6, f = h.padding), "type" in h && t(16, d = h.type), "test_id" in h && t(7, g = h.test_id), "explicit_call" in h && t(8, v = h.explicit_call), "container" in h && t(9, p = h.container), "visible" in h && t(10, b = h.visible), "allow_overflow" in h && t(11, y = h.allow_overflow), "scale" in h && t(12, k = h.scale), "min_width" in h && t(13, N = h.min_width), "$$scope" in h && t(17, s = h.$$scope); + }, n.$capture_state = () => ({ + height: o, + width: r, + elem_id: i, + elem_classes: a, + variant: u, + border_mode: c, + padding: f, + type: d, + test_id: g, + explicit_call: v, + container: p, + visible: b, + allow_overflow: y, + scale: k, + min_width: N, + tag: R, + get_dimension: w + }), n.$inject_state = (h) => { + "height" in h && t(0, o = h.height), "width" in h && t(1, r = h.width), "elem_id" in h && t(2, i = h.elem_id), "elem_classes" in h && t(3, a = h.elem_classes), "variant" in h && t(4, u = h.variant), "border_mode" in h && t(5, c = h.border_mode), "padding" in h && t(6, f = h.padding), "type" in h && t(16, d = h.type), "test_id" in h && t(7, g = h.test_id), "explicit_call" in h && t(8, v = h.explicit_call), "container" in h && t(9, p = h.container), "visible" in h && t(10, b = h.visible), "allow_overflow" in h && t(11, y = h.allow_overflow), "scale" in h && t(12, k = h.scale), "min_width" in h && t(13, N = h.min_width), "tag" in h && t(14, R = h.tag); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [ + o, + r, + i, + a, + u, + c, + f, + g, + v, + p, + b, + y, + k, + N, + R, + w, + d, + s, + l + ]; +} +class On extends Bo { + constructor(e) { + super(e), Fo(this, e, Oo, at, zo, { + 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 + }), Gt("SvelteRegisterComponent", { + component: this, + tagName: "Block", + options: e, + id: at.name + }); + } + get height() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set height(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get width() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set width(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get elem_id() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set elem_id(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get elem_classes() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set elem_classes(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get variant() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set variant(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get border_mode() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set border_mode(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get padding() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set padding(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get type() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set type(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get test_id() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set test_id(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get explicit_call() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set explicit_call(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get container() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set container(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get visible() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set visible(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get allow_overflow() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set allow_overflow(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get scale() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set scale(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get min_width() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set min_width(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const { + SvelteComponentDev: Vo, + add_location: Go, + attr_dev: Jo, + create_slot: Wo, + detach_dev: Xo, + dispatch_dev: Vn, + element: Zo, + get_all_dirty_from_scope: Ko, + get_slot_changes: Ho, + init: Yo, + insert_dev: xo, + safe_not_equal: $o, + transition_in: es, + transition_out: ts, + update_slot_base: ns, + validate_slots: os +} = window.__gradio__svelte__internal, ss = "frontend/node_modules/@gradio/atoms/src/Info.svelte"; +function ut(n) { + let e, t; + const l = ( + /*#slots*/ + n[1].default + ), s = Wo( + l, + n, + /*$$scope*/ + n[0], + null + ), o = { + c: function() { + e = Zo("div"), s && s.c(), Jo(e, "class", "s-rHFnjjZU_ewn"), Go(e, ss, 0, 0, 0); + }, + l: function(i) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(i, a) { + xo(i, e, a), s && s.m(e, null), t = !0; + }, + p: function(i, [a]) { + s && s.p && (!t || a & /*$$scope*/ + 1) && ns( + s, + l, + i, + /*$$scope*/ + i[0], + t ? Ho( + l, + /*$$scope*/ + i[0], + a, + null + ) : Ko( + /*$$scope*/ + i[0] + ), + null + ); + }, + i: function(i) { + t || (es(s, i), t = !0); + }, + o: function(i) { + ts(s, i), t = !1; + }, + d: function(i) { + i && Xo(e), s && s.d(i); + } + }; + return Vn("SvelteRegisterBlock", { + block: o, + id: ut.name, + type: "component", + source: "", + ctx: n + }), o; +} +function is(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + os("Info", l, ["default"]); + const o = []; + return Object.keys(e).forEach((r) => { + !~o.indexOf(r) && r.slice(0, 2) !== "$$" && r !== "slot" && console.warn(` was created with unknown prop '${r}'`); + }), n.$$set = (r) => { + "$$scope" in r && t(0, s = r.$$scope); + }, [s, l]; +} +class Gn extends Vo { + constructor(e) { + super(e), Yo(this, e, is, ut, $o, {}), Vn("SvelteRegisterComponent", { + component: this, + tagName: "Info", + options: e, + id: ut.name + }); + } +} +const { + SvelteComponentDev: ls, + add_location: rs, + attr_dev: $t, + check_outros: cs, + create_component: as, + create_slot: us, + destroy_component: fs, + detach_dev: xe, + dispatch_dev: it, + element: ds, + empty: _s, + get_all_dirty_from_scope: ms, + get_slot_changes: hs, + group_outros: gs, + init: ws, + insert_dev: $e, + mount_component: ps, + safe_not_equal: bs, + set_data_dev: vs, + space: ys, + text: ks, + toggle_class: qe, + transition_in: Qe, + transition_out: et, + update_slot_base: Ss, + validate_slots: Es +} = window.__gradio__svelte__internal, Bs = "frontend/node_modules/@gradio/atoms/src/BlockTitle.svelte"; +function ft(n) { + let e, t; + e = new Gn({ + props: { + $$slots: { default: [Jn] }, + $$scope: { ctx: n } + }, + $$inline: !0 + }); + const l = { + c: function() { + as(e.$$.fragment); + }, + m: function(o, r) { + ps(e, o, r), t = !0; + }, + p: function(o, r) { + const i = {}; + r & /*$$scope, info*/ + 10 && (i.$$scope = { dirty: r, ctx: o }), e.$set(i); + }, + i: function(o) { + t || (Qe(e.$$.fragment, o), t = !0); + }, + o: function(o) { + et(e.$$.fragment, o), t = !1; + }, + d: function(o) { + fs(e, o); + } + }; + return it("SvelteRegisterBlock", { + block: l, + id: ft.name, + type: "if", + source: "(15:0) {#if info}", + ctx: n + }), l; +} +function Jn(n) { + let e; + const t = { + c: function() { + e = ks( + /*info*/ + n[1] + ); + }, + m: function(s, o) { + $e(s, e, o); + }, + p: function(s, o) { + o & /*info*/ + 2 && vs( + e, + /*info*/ + s[1] + ); + }, + d: function(s) { + s && xe(e); + } + }; + return it("SvelteRegisterBlock", { + block: t, + id: Jn.name, + type: "slot", + source: "(16:1) ", + ctx: n + }), t; +} +function dt(n) { + let e, t, l, s; + const o = ( + /*#slots*/ + n[2].default + ), r = us( + o, + n, + /*$$scope*/ + n[3], + null + ); + let i = ( + /*info*/ + n[1] && ft(n) + ); + const a = { + c: function() { + e = ds("span"), r && r.c(), t = ys(), i && i.c(), l = _s(), $t(e, "data-testid", "block-info"), $t(e, "class", "s-vxmmg1Wn3NRx"), qe(e, "sr-only", !/*show_label*/ + n[0]), qe(e, "hide", !/*show_label*/ + n[0]), qe( + e, + "has-info", + /*info*/ + n[1] != null + ), rs(e, Bs, 6, 0, 141); + }, + l: function(c) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(c, f) { + $e(c, e, f), r && r.m(e, null), $e(c, t, f), i && i.m(c, f), $e(c, l, f), s = !0; + }, + p: function(c, [f]) { + r && r.p && (!s || f & /*$$scope*/ + 8) && Ss( + r, + o, + c, + /*$$scope*/ + c[3], + s ? hs( + o, + /*$$scope*/ + c[3], + f, + null + ) : ms( + /*$$scope*/ + c[3] + ), + null + ), (!s || f & /*show_label*/ + 1) && qe(e, "sr-only", !/*show_label*/ + c[0]), (!s || f & /*show_label*/ + 1) && qe(e, "hide", !/*show_label*/ + c[0]), (!s || f & /*info*/ + 2) && qe( + e, + "has-info", + /*info*/ + c[1] != null + ), /*info*/ + c[1] ? i ? (i.p(c, f), f & /*info*/ + 2 && Qe(i, 1)) : (i = ft(c), i.c(), Qe(i, 1), i.m(l.parentNode, l)) : i && (gs(), et(i, 1, 1, () => { + i = null; + }), cs()); + }, + i: function(c) { + s || (Qe(r, c), Qe(i), s = !0); + }, + o: function(c) { + et(r, c), et(i), s = !1; + }, + d: function(c) { + c && (xe(e), xe(t), xe(l)), r && r.d(c), i && i.d(c); + } + }; + return it("SvelteRegisterBlock", { + block: a, + id: dt.name, + type: "component", + source: "", + ctx: n + }), a; +} +function Ps(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + Es("BlockTitle", l, ["default"]); + let { show_label: o = !0 } = e, { info: r = void 0 } = e; + const i = ["show_label", "info"]; + return Object.keys(e).forEach((a) => { + !~i.indexOf(a) && a.slice(0, 2) !== "$$" && a !== "slot" && console.warn(` was created with unknown prop '${a}'`); + }), n.$$set = (a) => { + "show_label" in a && t(0, o = a.show_label), "info" in a && t(1, r = a.info), "$$scope" in a && t(3, s = a.$$scope); + }, n.$capture_state = () => ({ Info: Gn, show_label: o, info: r }), n.$inject_state = (a) => { + "show_label" in a && t(0, o = a.show_label), "info" in a && t(1, r = a.info); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [o, r, l, s]; +} +class Wn extends ls { + constructor(e) { + super(e), ws(this, e, Ps, dt, bs, { show_label: 0, info: 1 }), it("SvelteRegisterComponent", { + component: this, + tagName: "BlockTitle", + options: e, + id: dt.name + }); + } + get show_label() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set show_label(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get info() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set info(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const Rs = [ + { color: "red", primary: 600, secondary: 100 }, + { color: "green", primary: 600, secondary: 100 }, + { color: "blue", primary: 600, secondary: 100 }, + { color: "yellow", primary: 500, secondary: 100 }, + { color: "purple", primary: 600, secondary: 100 }, + { color: "teal", primary: 600, secondary: 100 }, + { color: "orange", primary: 600, secondary: 100 }, + { color: "cyan", primary: 600, secondary: 100 }, + { color: "lime", primary: 500, secondary: 100 }, + { color: "pink", primary: 600, secondary: 100 } +], en = { + inherit: "inherit", + current: "currentColor", + transparent: "transparent", + black: "#000", + white: "#fff", + slate: { + 50: "#f8fafc", + 100: "#f1f5f9", + 200: "#e2e8f0", + 300: "#cbd5e1", + 400: "#94a3b8", + 500: "#64748b", + 600: "#475569", + 700: "#334155", + 800: "#1e293b", + 900: "#0f172a", + 950: "#020617" + }, + gray: { + 50: "#f9fafb", + 100: "#f3f4f6", + 200: "#e5e7eb", + 300: "#d1d5db", + 400: "#9ca3af", + 500: "#6b7280", + 600: "#4b5563", + 700: "#374151", + 800: "#1f2937", + 900: "#111827", + 950: "#030712" + }, + zinc: { + 50: "#fafafa", + 100: "#f4f4f5", + 200: "#e4e4e7", + 300: "#d4d4d8", + 400: "#a1a1aa", + 500: "#71717a", + 600: "#52525b", + 700: "#3f3f46", + 800: "#27272a", + 900: "#18181b", + 950: "#09090b" + }, + neutral: { + 50: "#fafafa", + 100: "#f5f5f5", + 200: "#e5e5e5", + 300: "#d4d4d4", + 400: "#a3a3a3", + 500: "#737373", + 600: "#525252", + 700: "#404040", + 800: "#262626", + 900: "#171717", + 950: "#0a0a0a" + }, + stone: { + 50: "#fafaf9", + 100: "#f5f5f4", + 200: "#e7e5e4", + 300: "#d6d3d1", + 400: "#a8a29e", + 500: "#78716c", + 600: "#57534e", + 700: "#44403c", + 800: "#292524", + 900: "#1c1917", + 950: "#0c0a09" + }, + red: { + 50: "#fef2f2", + 100: "#fee2e2", + 200: "#fecaca", + 300: "#fca5a5", + 400: "#f87171", + 500: "#ef4444", + 600: "#dc2626", + 700: "#b91c1c", + 800: "#991b1b", + 900: "#7f1d1d", + 950: "#450a0a" + }, + orange: { + 50: "#fff7ed", + 100: "#ffedd5", + 200: "#fed7aa", + 300: "#fdba74", + 400: "#fb923c", + 500: "#f97316", + 600: "#ea580c", + 700: "#c2410c", + 800: "#9a3412", + 900: "#7c2d12", + 950: "#431407" + }, + amber: { + 50: "#fffbeb", + 100: "#fef3c7", + 200: "#fde68a", + 300: "#fcd34d", + 400: "#fbbf24", + 500: "#f59e0b", + 600: "#d97706", + 700: "#b45309", + 800: "#92400e", + 900: "#78350f", + 950: "#451a03" + }, + yellow: { + 50: "#fefce8", + 100: "#fef9c3", + 200: "#fef08a", + 300: "#fde047", + 400: "#facc15", + 500: "#eab308", + 600: "#ca8a04", + 700: "#a16207", + 800: "#854d0e", + 900: "#713f12", + 950: "#422006" + }, + lime: { + 50: "#f7fee7", + 100: "#ecfccb", + 200: "#d9f99d", + 300: "#bef264", + 400: "#a3e635", + 500: "#84cc16", + 600: "#65a30d", + 700: "#4d7c0f", + 800: "#3f6212", + 900: "#365314", + 950: "#1a2e05" + }, + green: { + 50: "#f0fdf4", + 100: "#dcfce7", + 200: "#bbf7d0", + 300: "#86efac", + 400: "#4ade80", + 500: "#22c55e", + 600: "#16a34a", + 700: "#15803d", + 800: "#166534", + 900: "#14532d", + 950: "#052e16" + }, + emerald: { + 50: "#ecfdf5", + 100: "#d1fae5", + 200: "#a7f3d0", + 300: "#6ee7b7", + 400: "#34d399", + 500: "#10b981", + 600: "#059669", + 700: "#047857", + 800: "#065f46", + 900: "#064e3b", + 950: "#022c22" + }, + teal: { + 50: "#f0fdfa", + 100: "#ccfbf1", + 200: "#99f6e4", + 300: "#5eead4", + 400: "#2dd4bf", + 500: "#14b8a6", + 600: "#0d9488", + 700: "#0f766e", + 800: "#115e59", + 900: "#134e4a", + 950: "#042f2e" + }, + cyan: { + 50: "#ecfeff", + 100: "#cffafe", + 200: "#a5f3fc", + 300: "#67e8f9", + 400: "#22d3ee", + 500: "#06b6d4", + 600: "#0891b2", + 700: "#0e7490", + 800: "#155e75", + 900: "#164e63", + 950: "#083344" + }, + sky: { + 50: "#f0f9ff", + 100: "#e0f2fe", + 200: "#bae6fd", + 300: "#7dd3fc", + 400: "#38bdf8", + 500: "#0ea5e9", + 600: "#0284c7", + 700: "#0369a1", + 800: "#075985", + 900: "#0c4a6e", + 950: "#082f49" + }, + blue: { + 50: "#eff6ff", + 100: "#dbeafe", + 200: "#bfdbfe", + 300: "#93c5fd", + 400: "#60a5fa", + 500: "#3b82f6", + 600: "#2563eb", + 700: "#1d4ed8", + 800: "#1e40af", + 900: "#1e3a8a", + 950: "#172554" + }, + indigo: { + 50: "#eef2ff", + 100: "#e0e7ff", + 200: "#c7d2fe", + 300: "#a5b4fc", + 400: "#818cf8", + 500: "#6366f1", + 600: "#4f46e5", + 700: "#4338ca", + 800: "#3730a3", + 900: "#312e81", + 950: "#1e1b4b" + }, + violet: { + 50: "#f5f3ff", + 100: "#ede9fe", + 200: "#ddd6fe", + 300: "#c4b5fd", + 400: "#a78bfa", + 500: "#8b5cf6", + 600: "#7c3aed", + 700: "#6d28d9", + 800: "#5b21b6", + 900: "#4c1d95", + 950: "#2e1065" + }, + purple: { + 50: "#faf5ff", + 100: "#f3e8ff", + 200: "#e9d5ff", + 300: "#d8b4fe", + 400: "#c084fc", + 500: "#a855f7", + 600: "#9333ea", + 700: "#7e22ce", + 800: "#6b21a8", + 900: "#581c87", + 950: "#3b0764" + }, + fuchsia: { + 50: "#fdf4ff", + 100: "#fae8ff", + 200: "#f5d0fe", + 300: "#f0abfc", + 400: "#e879f9", + 500: "#d946ef", + 600: "#c026d3", + 700: "#a21caf", + 800: "#86198f", + 900: "#701a75", + 950: "#4a044e" + }, + pink: { + 50: "#fdf2f8", + 100: "#fce7f3", + 200: "#fbcfe8", + 300: "#f9a8d4", + 400: "#f472b6", + 500: "#ec4899", + 600: "#db2777", + 700: "#be185d", + 800: "#9d174d", + 900: "#831843", + 950: "#500724" + }, + rose: { + 50: "#fff1f2", + 100: "#ffe4e6", + 200: "#fecdd3", + 300: "#fda4af", + 400: "#fb7185", + 500: "#f43f5e", + 600: "#e11d48", + 700: "#be123c", + 800: "#9f1239", + 900: "#881337", + 950: "#4c0519" + } +}; +Rs.reduce( + (n, { color: e, primary: t, secondary: l }) => ({ + ...n, + [e]: { + primary: en[e][t], + secondary: en[e][l] + } + }), + {} +); +function be(n) { + 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; +} +function tt() { +} +function Cs(n, e) { + return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function"; +} +const Xn = typeof window < "u"; +let tn = Xn ? () => window.performance.now() : () => Date.now(), Zn = Xn ? (n) => requestAnimationFrame(n) : tt; +const Te = /* @__PURE__ */ new Set(); +function Kn(n) { + Te.forEach((e) => { + e.c(n) || (Te.delete(e), e.f()); + }), Te.size !== 0 && Zn(Kn); +} +function Ns(n) { + let e; + return Te.size === 0 && Zn(Kn), { + promise: new Promise((t) => { + Te.add(e = { c: n, f: t }); + }), + abort() { + Te.delete(e); + } + }; +} +const Le = []; +function As(n, e = tt) { + let t; + const l = /* @__PURE__ */ new Set(); + function s(i) { + if (Cs(n, i) && (n = i, t)) { + const a = !Le.length; + for (const u of l) + u[1](), Le.push(u, n); + if (a) { + for (let u = 0; u < Le.length; u += 2) + Le[u][0](Le[u + 1]); + Le.length = 0; + } + } + } + function o(i) { + s(i(n)); + } + function r(i, a = tt) { + const u = [i, a]; + return l.add(u), l.size === 1 && (t = e(s, o) || tt), i(n), () => { + l.delete(u), l.size === 0 && t && (t(), t = null); + }; + } + return { set: s, update: o, subscribe: r }; +} +function nn(n) { + return Object.prototype.toString.call(n) === "[object Date]"; +} +function _t(n, e, t, l) { + if (typeof t == "number" || nn(t)) { + const s = l - t, o = (t - e) / (n.dt || 1 / 60), r = n.opts.stiffness * s, i = n.opts.damping * o, a = (r - i) * n.inv_mass, u = (o + a) * n.dt; + return Math.abs(u) < n.opts.precision && Math.abs(s) < n.opts.precision ? l : (n.settled = !1, nn(t) ? new Date(t.getTime() + u) : t + u); + } else { + if (Array.isArray(t)) + return t.map( + (s, o) => _t(n, e[o], t[o], l[o]) + ); + if (typeof t == "object") { + const s = {}; + for (const o in t) + s[o] = _t(n, e[o], t[o], l[o]); + return s; + } else + throw new Error(`Cannot spring ${typeof t} values`); + } +} +function lt(n, e = {}) { + const t = As(n), { stiffness: l = 0.15, damping: s = 0.8, precision: o = 0.01 } = e; + let r, i, a, u = n, c = n, f = 1, d = 0, g = !1; + function v(b, y = {}) { + c = b; + const k = a = {}; + return n == null || y.hard || p.stiffness >= 1 && p.damping >= 1 ? (g = !0, r = tn(), u = b, t.set(n = c), Promise.resolve()) : (y.soft && (d = 1 / ((y.soft === !0 ? 0.5 : +y.soft) * 60), f = 0), i || (r = tn(), g = !1, i = Ns((N) => { + if (g) + return g = !1, i = null, !1; + f = Math.min(f + d, 1); + const R = { + inv_mass: f, + opts: p, + settled: !0, + dt: (N - r) * 60 / 1e3 + }, w = _t(R, u, n, c); + return r = N, u = n, t.set(n = w), R.settled && (i = null), !R.settled; + })), new Promise((N) => { + i.promise.then(() => { + k === a && N(); + }); + })); + } + const p = { + set: v, + update: (b, y) => v(b(c, n), y), + subscribe: t.subscribe, + stiffness: l, + damping: s, + precision: o + }; + return p; +} +const { + SvelteComponentDev: js, + add_location: J, + append_dev: K, + attr_dev: A, + component_subscribe: on, + detach_dev: qs, + dispatch_dev: Hn, + element: Ls, + init: Fs, + insert_dev: Ts, + noop: sn, + safe_not_equal: zs, + set_style: Ke, + svg_element: H, + toggle_class: ln, + validate_slots: Is, + validate_store: rn +} = window.__gradio__svelte__internal, { onMount: cn } = window.__gradio__svelte__internal, W = "frontend/node_modules/@gradio/statustracker/static/Loader.svelte"; +function mt(n) { + let e, t, l, s, o, r, i, a, u, c, f, d; + const g = { + c: function() { + e = Ls("div"), t = H("svg"), l = H("g"), s = H("path"), o = H("path"), r = H("path"), i = H("path"), a = H("g"), u = H("path"), c = H("path"), f = H("path"), d = H("path"), A(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), A(s, "fill", "#FF7C00"), A(s, "fill-opacity", "0.4"), A(s, "class", "s-kL3wNG5vn6RW"), J(s, W, 42, 3, 947), A(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), A(o, "fill", "#FF7C00"), A(o, "class", "s-kL3wNG5vn6RW"), J(o, W, 47, 3, 1080), A(r, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), A(r, "fill", "#FF7C00"), A(r, "fill-opacity", "0.4"), A(r, "class", "s-kL3wNG5vn6RW"), J(r, W, 51, 3, 1185), A(i, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), A(i, "fill", "#FF7C00"), A(i, "class", "s-kL3wNG5vn6RW"), J(i, W, 56, 3, 1317), Ke(l, "transform", "translate(" + /*$top*/ + n[1][0] + "px, " + /*$top*/ + n[1][1] + "px)"), J(l, W, 41, 2, 884), A(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), A(u, "fill", "#FF7C00"), A(u, "fill-opacity", "0.4"), A(u, "class", "s-kL3wNG5vn6RW"), J(u, W, 62, 3, 1502), A(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), A(c, "fill", "#FF7C00"), A(c, "class", "s-kL3wNG5vn6RW"), J(c, W, 67, 3, 1629), A(f, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), A(f, "fill", "#FF7C00"), A(f, "fill-opacity", "0.4"), A(f, "class", "s-kL3wNG5vn6RW"), J(f, W, 71, 3, 1735), A(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), A(d, "fill", "#FF7C00"), A(d, "class", "s-kL3wNG5vn6RW"), J(d, W, 76, 3, 1864), Ke(a, "transform", "translate(" + /*$bottom*/ + n[2][0] + "px, " + /*$bottom*/ + n[2][1] + "px)"), J(a, W, 61, 2, 1433), A(t, "viewBox", "-1200 -1200 3000 3000"), A(t, "fill", "none"), A(t, "xmlns", "http://www.w3.org/2000/svg"), A(t, "class", "s-kL3wNG5vn6RW"), J(t, W, 36, 1, 789), A(e, "class", "s-kL3wNG5vn6RW"), ln( + e, + "margin", + /*margin*/ + n[0] + ), J(e, W, 35, 0, 769); + }, + l: function(p) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(p, b) { + Ts(p, e, b), K(e, t), K(t, l), K(l, s), K(l, o), K(l, r), K(l, i), K(t, a), K(a, u), K(a, c), K(a, f), K(a, d); + }, + p: function(p, [b]) { + b & /*$top*/ + 2 && Ke(l, "transform", "translate(" + /*$top*/ + p[1][0] + "px, " + /*$top*/ + p[1][1] + "px)"), b & /*$bottom*/ + 4 && Ke(a, "transform", "translate(" + /*$bottom*/ + p[2][0] + "px, " + /*$bottom*/ + p[2][1] + "px)"), b & /*margin*/ + 1 && ln( + e, + "margin", + /*margin*/ + p[0] + ); + }, + i: sn, + o: sn, + d: function(p) { + p && qs(e); + } + }; + return Hn("SvelteRegisterBlock", { + block: g, + id: mt.name, + type: "component", + source: "", + ctx: n + }), g; +} +function Ds(n, e, t) { + let l, s, { $$slots: o = {}, $$scope: r } = e; + Is("Loader", o, []); + let { margin: i = !0 } = e; + const a = lt([0, 0]); + rn(a, "top"), on(n, a, (p) => t(1, l = p)); + const u = lt([0, 0]); + rn(u, "bottom"), on(n, u, (p) => t(2, s = p)); + let c; + async function f() { + await Promise.all([a.set([125, 140]), u.set([-125, -140])]), await Promise.all([a.set([-125, 140]), u.set([125, -140])]), await Promise.all([a.set([-125, 0]), u.set([125, -0])]), await Promise.all([a.set([125, 0]), u.set([-125, 0])]); + } + async function d() { + await f(), c || d(); + } + async function g() { + await Promise.all([a.set([125, 0]), u.set([-125, 0])]), d(); + } + cn(() => (g(), () => c = !0)); + const v = ["margin"]; + return Object.keys(e).forEach((p) => { + !~v.indexOf(p) && p.slice(0, 2) !== "$$" && p !== "slot" && console.warn(` was created with unknown prop '${p}'`); + }), n.$$set = (p) => { + "margin" in p && t(0, i = p.margin); + }, n.$capture_state = () => ({ + onMount: cn, + spring: lt, + margin: i, + top: a, + bottom: u, + dismounted: c, + animate: f, + run: d, + loading: g, + $top: l, + $bottom: s + }), n.$inject_state = (p) => { + "margin" in p && t(0, i = p.margin), "dismounted" in p && (c = p.dismounted); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [i, l, s, a, u]; +} +class Yn extends js { + constructor(e) { + super(e), Fs(this, e, Ds, mt, zs, { margin: 0 }), Hn("SvelteRegisterComponent", { + component: this, + tagName: "Loader", + options: e, + id: mt.name + }); + } + get margin() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set margin(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const { + SvelteComponentDev: Us, + add_location: le, + append_dev: ve, + attr_dev: te, + binding_callbacks: an, + check_outros: xn, + create_component: Ms, + create_slot: Qs, + destroy_component: Os, + destroy_each: $n, + detach_dev: B, + dispatch_dev: T, + element: re, + empty: Ue, + ensure_array_like_dev: st, + get_all_dirty_from_scope: Vs, + get_slot_changes: Gs, + group_outros: eo, + init: Js, + insert_dev: P, + mount_component: Ws, + noop: ht, + safe_not_equal: Xs, + set_data_dev: Z, + set_style: me, + space: ne, + text: F, + toggle_class: X, + transition_in: ze, + transition_out: Ie, + update_slot_base: Zs, + validate_slots: Ks +} = window.__gradio__svelte__internal, { tick: to } = window.__gradio__svelte__internal, { onDestroy: un } = window.__gradio__svelte__internal, ce = "frontend/node_modules/@gradio/statustracker/static/index.svelte", Hs = (n) => ({}), fn = (n) => ({}); +function dn(n, e, t) { + const l = n.slice(); + return l[39] = e[t], l[41] = t, l; +} +function _n(n, e, t) { + const l = n.slice(); + return l[39] = e[t], l; +} +function no(n) { + let e, t = ( + /*i18n*/ + n[1]("common.error") + "" + ), l, s, o; + const r = ( + /*#slots*/ + n[29].error + ), i = Qs( + r, + n, + /*$$scope*/ + n[28], + fn + ), a = { + c: function() { + e = re("span"), l = F(t), s = ne(), i && i.c(), te(e, "class", "error s-vXtJ1y9FKh0U"), le(e, ce, 273, 2, 6080); + }, + m: function(c, f) { + P(c, e, f), ve(e, l), P(c, s, f), i && i.m(c, f), o = !0; + }, + p: function(c, f) { + (!o || f[0] & /*i18n*/ + 2) && t !== (t = /*i18n*/ + c[1]("common.error") + "") && Z(l, t), i && i.p && (!o || f[0] & /*$$scope*/ + 268435456) && Zs( + i, + r, + c, + /*$$scope*/ + c[28], + o ? Gs( + r, + /*$$scope*/ + c[28], + f, + Hs + ) : Vs( + /*$$scope*/ + c[28] + ), + fn + ); + }, + i: function(c) { + o || (ze(i, c), o = !0); + }, + o: function(c) { + Ie(i, c), o = !1; + }, + d: function(c) { + c && (B(e), B(s)), i && i.d(c); + } + }; + return T("SvelteRegisterBlock", { + block: a, + id: no.name, + type: "if", + source: "(273:30) ", + ctx: n + }), a; +} +function oo(n) { + let e, t, l, s, o, r, i, a, u, c = ( + /*variant*/ + n[8] === "default" && /*show_eta_bar*/ + n[18] && /*show_progress*/ + n[6] === "full" && gt(n) + ); + function f(R, w) { + if ( + /*progress*/ + R[7] + ) + return lo; + if ( + /*queue_position*/ + R[2] !== null && /*queue_size*/ + R[3] !== void 0 && /*queue_position*/ + R[2] >= 0 + ) + return io; + if ( + /*queue_position*/ + R[2] === 0 + ) + return so; + } + let d = f(n), g = d && d(n), v = ( + /*timer*/ + n[5] && bt(n) + ); + const p = [uo, ao], b = []; + function y(R, w) { + return ( + /*last_progress_level*/ + R[15] != null ? 0 : ( + /*show_progress*/ + R[6] === "full" ? 1 : -1 + ) + ); + } + ~(o = y(n)) && (r = b[o] = p[o](n)); + let k = !/*timer*/ + n[5] && Pt(n); + const N = { + c: function() { + c && c.c(), e = ne(), t = re("div"), g && g.c(), l = ne(), v && v.c(), s = ne(), r && r.c(), i = ne(), k && k.c(), a = Ue(), te(t, "class", "progress-text s-vXtJ1y9FKh0U"), X( + t, + "meta-text-center", + /*variant*/ + n[8] === "center" + ), X( + t, + "meta-text", + /*variant*/ + n[8] === "default" + ), le(t, ce, 207, 2, 4421); + }, + m: function(w, S) { + c && c.m(w, S), P(w, e, S), P(w, t, S), g && g.m(t, null), ve(t, l), v && v.m(t, null), P(w, s, S), ~o && b[o].m(w, S), P(w, i, S), k && k.m(w, S), P(w, a, S), u = !0; + }, + p: function(w, S) { + /*variant*/ + w[8] === "default" && /*show_eta_bar*/ + w[18] && /*show_progress*/ + w[6] === "full" ? c ? c.p(w, S) : (c = gt(w), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), d === (d = f(w)) && g ? g.p(w, S) : (g && g.d(1), g = d && d(w), g && (g.c(), g.m(t, l))), /*timer*/ + w[5] ? v ? v.p(w, S) : (v = bt(w), v.c(), v.m(t, null)) : v && (v.d(1), v = null), (!u || S[0] & /*variant*/ + 256) && X( + t, + "meta-text-center", + /*variant*/ + w[8] === "center" + ), (!u || S[0] & /*variant*/ + 256) && X( + t, + "meta-text", + /*variant*/ + w[8] === "default" + ); + let h = o; + o = y(w), o === h ? ~o && b[o].p(w, S) : (r && (eo(), Ie(b[h], 1, 1, () => { + b[h] = null; + }), xn()), ~o ? (r = b[o], r ? r.p(w, S) : (r = b[o] = p[o](w), r.c()), ze(r, 1), r.m(i.parentNode, i)) : r = null), /*timer*/ + w[5] ? k && (k.d(1), k = null) : k ? k.p(w, S) : (k = Pt(w), k.c(), k.m(a.parentNode, a)); + }, + i: function(w) { + u || (ze(r), u = !0); + }, + o: function(w) { + Ie(r), u = !1; + }, + d: function(w) { + w && (B(e), B(t), B(s), B(i), B(a)), c && c.d(w), g && g.d(), v && v.d(), ~o && b[o].d(w), k && k.d(w); + } + }; + return T("SvelteRegisterBlock", { + block: N, + id: oo.name, + type: "if", + source: '(201:1) {#if status === \\"pending\\"}', + ctx: n + }), N; +} +function gt(n) { + let e, t = `translateX(${/*eta_level*/ + (n[17] || 0) * 100 - 100}%)`; + const l = { + c: function() { + e = re("div"), te(e, "class", "eta-bar s-vXtJ1y9FKh0U"), me(e, "transform", t), le(e, ce, 202, 3, 4314); + }, + m: function(o, r) { + P(o, e, r); + }, + p: function(o, r) { + r[0] & /*eta_level*/ + 131072 && t !== (t = `translateX(${/*eta_level*/ + (o[17] || 0) * 100 - 100}%)`) && me(e, "transform", t); + }, + d: function(o) { + o && B(e); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: gt.name, + type: "if", + source: '(202:2) {#if variant === \\"default\\" && show_eta_bar && show_progress === \\"full\\"}', + ctx: n + }), l; +} +function so(n) { + let e; + const t = { + c: function() { + e = F("processing |"); + }, + m: function(s, o) { + P(s, e, o); + }, + p: ht, + d: function(s) { + s && B(e); + } + }; + return T("SvelteRegisterBlock", { + block: t, + id: so.name, + type: "if", + source: "(226:34) ", + ctx: n + }), t; +} +function io(n) { + let e, t = ( + /*queue_position*/ + n[2] + 1 + "" + ), l, s, o, r; + const i = { + c: function() { + e = F("queue: "), l = F(t), s = F("/"), o = F( + /*queue_size*/ + n[3] + ), r = F(" |"); + }, + m: function(u, c) { + P(u, e, c), P(u, l, c), P(u, s, c), P(u, o, c), P(u, r, c); + }, + p: function(u, c) { + c[0] & /*queue_position*/ + 4 && t !== (t = /*queue_position*/ + u[2] + 1 + "") && Z(l, t), c[0] & /*queue_size*/ + 8 && Z( + o, + /*queue_size*/ + u[3] + ); + }, + d: function(u) { + u && (B(e), B(l), B(s), B(o), B(r)); + } + }; + return T("SvelteRegisterBlock", { + block: i, + id: io.name, + type: "if", + source: "(224:88) ", + ctx: n + }), i; +} +function lo(n) { + let e, t = st( + /*progress*/ + n[7] + ), l = []; + for (let o = 0; o < t.length; o += 1) + l[o] = pt(_n(n, t, o)); + const s = { + c: function() { + for (let r = 0; r < l.length; r += 1) + l[r].c(); + e = Ue(); + }, + m: function(r, i) { + for (let a = 0; a < l.length; a += 1) + l[a] && l[a].m(r, i); + P(r, e, i); + }, + p: function(r, i) { + if (i[0] & /*progress*/ + 128) { + t = st( + /*progress*/ + r[7] + ); + let a; + for (a = 0; a < t.length; a += 1) { + const u = _n(r, t, a); + l[a] ? l[a].p(u, i) : (l[a] = pt(u), l[a].c(), l[a].m(e.parentNode, e)); + } + for (; a < l.length; a += 1) + l[a].d(1); + l.length = t.length; + } + }, + d: function(r) { + r && B(e), $n(l, r); + } + }; + return T("SvelteRegisterBlock", { + block: s, + id: lo.name, + type: "if", + source: "(213:3) {#if progress}", + ctx: n + }), s; +} +function wt(n) { + let e, t = ( + /*p*/ + n[39].unit + "" + ), l, s, o = " ", r; + function i(f, d) { + return ( + /*p*/ + f[39].length != null ? co : ro + ); + } + let a = i(n), u = a(n); + const c = { + c: function() { + u.c(), e = ne(), l = F(t), s = F(" | "), r = F(o); + }, + m: function(d, g) { + u.m(d, g), P(d, e, g), P(d, l, g), P(d, s, g), P(d, r, g); + }, + p: function(d, g) { + a === (a = i(d)) && u ? u.p(d, g) : (u.d(1), u = a(d), u && (u.c(), u.m(e.parentNode, e))), g[0] & /*progress*/ + 128 && t !== (t = /*p*/ + d[39].unit + "") && Z(l, t); + }, + d: function(d) { + d && (B(e), B(l), B(s), B(r)), u.d(d); + } + }; + return T("SvelteRegisterBlock", { + block: c, + id: wt.name, + type: "if", + source: "(215:5) {#if p.index != null}", + ctx: n + }), c; +} +function ro(n) { + let e = be( + /*p*/ + n[39].index || 0 + ) + "", t; + const l = { + c: function() { + t = F(e); + }, + m: function(o, r) { + P(o, t, r); + }, + p: function(o, r) { + r[0] & /*progress*/ + 128 && e !== (e = be( + /*p*/ + o[39].index || 0 + ) + "") && Z(t, e); + }, + d: function(o) { + o && B(t); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: ro.name, + type: "else", + source: "(218:6) {:else}", + ctx: n + }), l; +} +function co(n) { + let e = be( + /*p*/ + n[39].index || 0 + ) + "", t, l, s = be( + /*p*/ + n[39].length + ) + "", o; + const r = { + c: function() { + t = F(e), l = F("/"), o = F(s); + }, + m: function(a, u) { + P(a, t, u), P(a, l, u), P(a, o, u); + }, + p: function(a, u) { + u[0] & /*progress*/ + 128 && e !== (e = be( + /*p*/ + a[39].index || 0 + ) + "") && Z(t, e), u[0] & /*progress*/ + 128 && s !== (s = be( + /*p*/ + a[39].length + ) + "") && Z(o, s); + }, + d: function(a) { + a && (B(t), B(l), B(o)); + } + }; + return T("SvelteRegisterBlock", { + block: r, + id: co.name, + type: "if", + source: "(216:6) {#if p.length != null}", + ctx: n + }), r; +} +function pt(n) { + let e, t = ( + /*p*/ + n[39].index != null && wt(n) + ); + const l = { + c: function() { + t && t.c(), e = Ue(); + }, + m: function(o, r) { + t && t.m(o, r), P(o, e, r); + }, + p: function(o, r) { + /*p*/ + o[39].index != null ? t ? t.p(o, r) : (t = wt(o), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + }, + d: function(o) { + o && B(e), t && t.d(o); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: pt.name, + type: "each", + source: "(214:4) {#each progress as p}", + ctx: n + }), l; +} +function bt(n) { + let e, t = ( + /*eta*/ + n[0] ? `/${/*formatted_eta*/ + n[19]}` : "" + ), l, s; + const o = { + c: function() { + e = F( + /*formatted_timer*/ + n[20] + ), l = F(t), s = F("s"); + }, + m: function(i, a) { + P(i, e, a), P(i, l, a), P(i, s, a); + }, + p: function(i, a) { + a[0] & /*formatted_timer*/ + 1048576 && Z( + e, + /*formatted_timer*/ + i[20] + ), a[0] & /*eta, formatted_eta*/ + 524289 && t !== (t = /*eta*/ + i[0] ? `/${/*formatted_eta*/ + i[19]}` : "") && Z(l, t); + }, + d: function(i) { + i && (B(e), B(l), B(s)); + } + }; + return T("SvelteRegisterBlock", { + block: o, + id: bt.name, + type: "if", + source: "(230:3) {#if timer}", + ctx: n + }), o; +} +function ao(n) { + let e, t; + e = new Yn({ + props: { margin: ( + /*variant*/ + n[8] === "default" + ) }, + $$inline: !0 + }); + const l = { + c: function() { + Ms(e.$$.fragment); + }, + m: function(o, r) { + Ws(e, o, r), t = !0; + }, + p: function(o, r) { + const i = {}; + r[0] & /*variant*/ + 256 && (i.margin = /*variant*/ + o[8] === "default"), e.$set(i); + }, + i: function(o) { + t || (ze(e.$$.fragment, o), t = !0); + }, + o: function(o) { + Ie(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Os(e, o); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: ao.name, + type: "if", + source: "(266:37) ", + ctx: n + }), l; +} +function uo(n) { + let e, t, l, s, o, r = `${/*last_progress_level*/ + n[15] * 100}%`, i = ( + /*progress*/ + n[7] != null && vt(n) + ); + const a = { + c: function() { + e = re("div"), t = re("div"), i && i.c(), l = ne(), s = re("div"), o = re("div"), te(t, "class", "progress-level-inner s-vXtJ1y9FKh0U"), le(t, ce, 236, 4, 5166), te(o, "class", "progress-bar s-vXtJ1y9FKh0U"), me(o, "width", r), le(o, ce, 258, 5, 5750), te(s, "class", "progress-bar-wrap s-vXtJ1y9FKh0U"), le(s, ce, 257, 4, 5713), te(e, "class", "progress-level s-vXtJ1y9FKh0U"), le(e, ce, 235, 3, 5133); + }, + m: function(c, f) { + P(c, e, f), ve(e, t), i && i.m(t, null), ve(e, l), ve(e, s), ve(s, o), n[30](o); + }, + p: function(c, f) { + /*progress*/ + c[7] != null ? i ? i.p(c, f) : (i = vt(c), i.c(), i.m(t, null)) : i && (i.d(1), i = null), f[0] & /*last_progress_level*/ + 32768 && r !== (r = `${/*last_progress_level*/ + c[15] * 100}%`) && me(o, "width", r); + }, + i: ht, + o: ht, + d: function(c) { + c && B(e), i && i.d(), n[30](null); + } + }; + return T("SvelteRegisterBlock", { + block: a, + id: uo.name, + type: "if", + source: "(235:2) {#if last_progress_level != null}", + ctx: n + }), a; +} +function vt(n) { + let e, t = st( + /*progress*/ + n[7] + ), l = []; + for (let o = 0; o < t.length; o += 1) + l[o] = Bt(dn(n, t, o)); + const s = { + c: function() { + for (let r = 0; r < l.length; r += 1) + l[r].c(); + e = Ue(); + }, + m: function(r, i) { + for (let a = 0; a < l.length; a += 1) + l[a] && l[a].m(r, i); + P(r, e, i); + }, + p: function(r, i) { + if (i[0] & /*progress_level, progress*/ + 16512) { + t = st( + /*progress*/ + r[7] + ); + let a; + for (a = 0; a < t.length; a += 1) { + const u = dn(r, t, a); + l[a] ? l[a].p(u, i) : (l[a] = Bt(u), l[a].c(), l[a].m(e.parentNode, e)); + } + for (; a < l.length; a += 1) + l[a].d(1); + l.length = t.length; + } + }, + d: function(r) { + r && B(e), $n(l, r); + } + }; + return T("SvelteRegisterBlock", { + block: s, + id: vt.name, + type: "if", + source: "(238:5) {#if progress != null}", + ctx: n + }), s; +} +function yt(n) { + let e, t, l, s, o = ( + /*i*/ + n[41] !== 0 && fo(n) + ), r = ( + /*p*/ + n[39].desc != null && kt(n) + ), i = ( + /*p*/ + n[39].desc != null && /*progress_level*/ + n[14] && /*progress_level*/ + n[14][ + /*i*/ + n[41] + ] != null && St(n) + ), a = ( + /*progress_level*/ + n[14] != null && Et(n) + ); + const u = { + c: function() { + o && o.c(), e = ne(), r && r.c(), t = ne(), i && i.c(), l = ne(), a && a.c(), s = Ue(); + }, + m: function(f, d) { + o && o.m(f, d), P(f, e, d), r && r.m(f, d), P(f, t, d), i && i.m(f, d), P(f, l, d), a && a.m(f, d), P(f, s, d); + }, + p: function(f, d) { + /*p*/ + f[39].desc != null ? r ? r.p(f, d) : (r = kt(f), r.c(), r.m(t.parentNode, t)) : r && (r.d(1), r = null), /*p*/ + f[39].desc != null && /*progress_level*/ + f[14] && /*progress_level*/ + f[14][ + /*i*/ + f[41] + ] != null ? i || (i = St(f), i.c(), i.m(l.parentNode, l)) : i && (i.d(1), i = null), /*progress_level*/ + f[14] != null ? a ? a.p(f, d) : (a = Et(f), a.c(), a.m(s.parentNode, s)) : a && (a.d(1), a = null); + }, + d: function(f) { + f && (B(e), B(t), B(l), B(s)), o && o.d(f), r && r.d(f), i && i.d(f), a && a.d(f); + } + }; + return T("SvelteRegisterBlock", { + block: u, + id: yt.name, + type: "if", + source: "(240:7) {#if p.desc != null || (progress_level && progress_level[i] != null)}", + ctx: n + }), u; +} +function fo(n) { + let e; + const t = { + c: function() { + e = F(" /"); + }, + m: function(s, o) { + P(s, e, o); + }, + d: function(s) { + s && B(e); + } + }; + return T("SvelteRegisterBlock", { + block: t, + id: fo.name, + type: "if", + source: "(241:8) {#if i !== 0}", + ctx: n + }), t; +} +function kt(n) { + let e = ( + /*p*/ + n[39].desc + "" + ), t; + const l = { + c: function() { + t = F(e); + }, + m: function(o, r) { + P(o, t, r); + }, + p: function(o, r) { + r[0] & /*progress*/ + 128 && e !== (e = /*p*/ + o[39].desc + "") && Z(t, e); + }, + d: function(o) { + o && B(t); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: kt.name, + type: "if", + source: "(244:8) {#if p.desc != null}", + ctx: n + }), l; +} +function St(n) { + let e; + const t = { + c: function() { + e = F("-"); + }, + m: function(s, o) { + P(s, e, o); + }, + d: function(s) { + s && B(e); + } + }; + return T("SvelteRegisterBlock", { + block: t, + id: St.name, + type: "if", + source: "(247:8) {#if p.desc != null && progress_level && progress_level[i] != null}", + ctx: n + }), t; +} +function Et(n) { + let e = (100 * /*progress_level*/ + (n[14][ + /*i*/ + n[41] + ] || 0)).toFixed(1) + "", t, l; + const s = { + c: function() { + t = F(e), l = F("%"); + }, + m: function(r, i) { + P(r, t, i), P(r, l, i); + }, + p: function(r, i) { + i[0] & /*progress_level*/ + 16384 && e !== (e = (100 * /*progress_level*/ + (r[14][ + /*i*/ + r[41] + ] || 0)).toFixed(1) + "") && Z(t, e); + }, + d: function(r) { + r && (B(t), B(l)); + } + }; + return T("SvelteRegisterBlock", { + block: s, + id: Et.name, + type: "if", + source: "(250:8) {#if progress_level != null}", + ctx: n + }), s; +} +function Bt(n) { + let e, t = ( + /*p*/ + (n[39].desc != null || /*progress_level*/ + n[14] && /*progress_level*/ + n[14][ + /*i*/ + n[41] + ] != null) && yt(n) + ); + const l = { + c: function() { + t && t.c(), e = Ue(); + }, + m: function(o, r) { + t && t.m(o, r), P(o, e, r); + }, + p: function(o, r) { + /*p*/ + o[39].desc != null || /*progress_level*/ + o[14] && /*progress_level*/ + o[14][ + /*i*/ + o[41] + ] != null ? t ? t.p(o, r) : (t = yt(o), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + }, + d: function(o) { + o && B(e), t && t.d(o); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: Bt.name, + type: "each", + source: "(239:6) {#each progress as p, i}", + ctx: n + }), l; +} +function Pt(n) { + let e, t; + const l = { + c: function() { + e = re("p"), t = F( + /*loading_text*/ + n[9] + ), te(e, "class", "loading s-vXtJ1y9FKh0U"), le(e, ce, 270, 3, 6001); + }, + m: function(o, r) { + P(o, e, r), ve(e, t); + }, + p: function(o, r) { + r[0] & /*loading_text*/ + 512 && Z( + t, + /*loading_text*/ + o[9] + ); + }, + d: function(o) { + o && B(e); + } + }; + return T("SvelteRegisterBlock", { + block: l, + id: Pt.name, + type: "if", + source: "(270:2) {#if !timer}", + ctx: n + }), l; +} +function Rt(n) { + let e, t, l, s, o; + const r = [oo, no], i = []; + function a(c, f) { + return ( + /*status*/ + c[4] === "pending" ? 0 : ( + /*status*/ + c[4] === "error" ? 1 : -1 + ) + ); + } + ~(t = a(n)) && (l = i[t] = r[t](n)); + const u = { + c: function() { + e = re("div"), l && l.c(), te(e, "class", s = "wrap " + /*variant*/ + n[8] + " " + /*show_progress*/ + n[6] + " s-vXtJ1y9FKh0U"), X(e, "hide", !/*status*/ + n[4] || /*status*/ + n[4] === "complete" || /*show_progress*/ + n[6] === "hidden"), X( + e, + "translucent", + /*variant*/ + n[8] === "center" && /*status*/ + (n[4] === "pending" || /*status*/ + n[4] === "error") || /*translucent*/ + n[11] || /*show_progress*/ + n[6] === "minimal" + ), X( + e, + "generating", + /*status*/ + n[4] === "generating" + ), X( + e, + "border", + /*border*/ + n[12] + ), me( + e, + "position", + /*absolute*/ + n[10] ? "absolute" : "static" + ), me( + e, + "padding", + /*absolute*/ + n[10] ? "0" : "var(--size-8) 0" + ), le(e, ce, 187, 0, 3764); + }, + l: function(f) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(f, d) { + P(f, e, d), ~t && i[t].m(e, null), n[31](e), o = !0; + }, + p: function(f, d) { + let g = t; + t = a(f), t === g ? ~t && i[t].p(f, d) : (l && (eo(), Ie(i[g], 1, 1, () => { + i[g] = null; + }), xn()), ~t ? (l = i[t], l ? l.p(f, d) : (l = i[t] = r[t](f), l.c()), ze(l, 1), l.m(e, null)) : l = null), (!o || d[0] & /*variant, show_progress*/ + 320 && s !== (s = "wrap " + /*variant*/ + f[8] + " " + /*show_progress*/ + f[6] + " s-vXtJ1y9FKh0U")) && te(e, "class", s), (!o || d[0] & /*variant, show_progress, status, show_progress*/ + 336) && X(e, "hide", !/*status*/ + f[4] || /*status*/ + f[4] === "complete" || /*show_progress*/ + f[6] === "hidden"), (!o || d[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ + 2384) && X( + e, + "translucent", + /*variant*/ + f[8] === "center" && /*status*/ + (f[4] === "pending" || /*status*/ + f[4] === "error") || /*translucent*/ + f[11] || /*show_progress*/ + f[6] === "minimal" + ), (!o || d[0] & /*variant, show_progress, status*/ + 336) && X( + e, + "generating", + /*status*/ + f[4] === "generating" + ), (!o || d[0] & /*variant, show_progress, border*/ + 4416) && X( + e, + "border", + /*border*/ + f[12] + ), d[0] & /*absolute*/ + 1024 && me( + e, + "position", + /*absolute*/ + f[10] ? "absolute" : "static" + ), d[0] & /*absolute*/ + 1024 && me( + e, + "padding", + /*absolute*/ + f[10] ? "0" : "var(--size-8) 0" + ); + }, + i: function(f) { + o || (ze(l), o = !0); + }, + o: function(f) { + Ie(l), o = !1; + }, + d: function(f) { + f && B(e), ~t && i[t].d(), n[31](null); + } + }; + return T("SvelteRegisterBlock", { + block: u, + id: Rt.name, + type: "component", + source: "", + ctx: n + }), u; +} +let Oe = [], nt = !1; +async function mn(n, e = !0) { + if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) { + if (Oe.push(n), !nt) + nt = !0; + else + return; + await to(), requestAnimationFrame(() => { + let t = [0, 0]; + for (let l = 0; l < Oe.length; l++) { + const o = Oe[l].getBoundingClientRect(); + (l === 0 || o.top + window.scrollY <= t[0]) && (t[0] = o.top + window.scrollY, t[1] = l); + } + window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), nt = !1, Oe = []; + }); + } +} +function Ys(n, e, t) { + let l, { $$slots: s = {}, $$scope: o } = e; + Ks("Static", s, ["error"]); + let { i18n: r } = e, { eta: i = null } = e, { queue_position: a } = e, { queue_size: u } = e, { status: c } = e, { scroll_to_output: f = !1 } = e, { timer: d = !0 } = e, { show_progress: g = "full" } = e, { message: v = null } = e, { progress: p = null } = e, { variant: b = "default" } = e, { loading_text: y = "Loading..." } = e, { absolute: k = !0 } = e, { translucent: N = !1 } = e, { border: R = !1 } = e, { autoscroll: w } = e, S, h = !1, L = 0, E = 0, j = null, z = null, he = !1, ge = 0, V = null, $, D = null, we = !0; + const Ne = () => { + t(0, i = t(26, j = t(19, de = null))), t(24, L = performance.now()), t(25, E = 0), h = !0, Ae(); + }; + function Ae() { + requestAnimationFrame(() => { + t(25, E = (performance.now() - L) / 1e3), h && Ae(); + }); + } + function Me() { + t(25, E = 0), t(0, i = t(26, j = t(19, de = null))), h && (h = !1); + } + un(() => { + h && Me(); + }); + let de = null, je = null; + function m() { + he = !1, je !== null && clearTimeout(je); + } + n.$$.on_mount.push(function() { + r === void 0 && !("i18n" in e || n.$$.bound[n.$$.props.i18n]) && console.warn(" was created without expected prop 'i18n'"), a === void 0 && !("queue_position" in e || n.$$.bound[n.$$.props.queue_position]) && console.warn(" was created without expected prop 'queue_position'"), u === void 0 && !("queue_size" in e || n.$$.bound[n.$$.props.queue_size]) && console.warn(" was created without expected prop 'queue_size'"), c === void 0 && !("status" in e || n.$$.bound[n.$$.props.status]) && console.warn(" was created without expected prop 'status'"), w === void 0 && !("autoscroll" in e || n.$$.bound[n.$$.props.autoscroll]) && console.warn(" was created without expected prop 'autoscroll'"); + }); + const U = [ + "i18n", + "eta", + "queue_position", + "queue_size", + "status", + "scroll_to_output", + "timer", + "show_progress", + "message", + "progress", + "variant", + "loading_text", + "absolute", + "translucent", + "border", + "autoscroll" + ]; + Object.keys(e).forEach((_) => { + !~U.indexOf(_) && _.slice(0, 2) !== "$$" && _ !== "slot" && console.warn(` was created with unknown prop '${_}'`); + }); + function G(_) { + an[_ ? "unshift" : "push"](() => { + D = _, t(16, D), t(7, p), t(14, V), t(15, $); + }); + } + function Eo(_) { + an[_ ? "unshift" : "push"](() => { + S = _, t(13, S); + }); + } + return n.$$set = (_) => { + "i18n" in _ && t(1, r = _.i18n), "eta" in _ && t(0, i = _.eta), "queue_position" in _ && t(2, a = _.queue_position), "queue_size" in _ && t(3, u = _.queue_size), "status" in _ && t(4, c = _.status), "scroll_to_output" in _ && t(21, f = _.scroll_to_output), "timer" in _ && t(5, d = _.timer), "show_progress" in _ && t(6, g = _.show_progress), "message" in _ && t(22, v = _.message), "progress" in _ && t(7, p = _.progress), "variant" in _ && t(8, b = _.variant), "loading_text" in _ && t(9, y = _.loading_text), "absolute" in _ && t(10, k = _.absolute), "translucent" in _ && t(11, N = _.translucent), "border" in _ && t(12, R = _.border), "autoscroll" in _ && t(23, w = _.autoscroll), "$$scope" in _ && t(28, o = _.$$scope); + }, n.$capture_state = () => ({ + tick: to, + pretty_si: be, + items: Oe, + called: nt, + scroll_into_view: mn, + onDestroy: un, + Loader: Yn, + i18n: r, + eta: i, + queue_position: a, + queue_size: u, + status: c, + scroll_to_output: f, + timer: d, + show_progress: g, + message: v, + progress: p, + variant: b, + loading_text: y, + absolute: k, + translucent: N, + border: R, + autoscroll: w, + el: S, + _timer: h, + timer_start: L, + timer_diff: E, + old_eta: j, + eta_from_start: z, + message_visible: he, + eta_level: ge, + progress_level: V, + last_progress_level: $, + progress_bar: D, + show_eta_bar: we, + start_timer: Ne, + run: Ae, + stop_timer: Me, + formatted_eta: de, + show_message_timeout: je, + close_message: m, + formatted_timer: l + }), n.$inject_state = (_) => { + "i18n" in _ && t(1, r = _.i18n), "eta" in _ && t(0, i = _.eta), "queue_position" in _ && t(2, a = _.queue_position), "queue_size" in _ && t(3, u = _.queue_size), "status" in _ && t(4, c = _.status), "scroll_to_output" in _ && t(21, f = _.scroll_to_output), "timer" in _ && t(5, d = _.timer), "show_progress" in _ && t(6, g = _.show_progress), "message" in _ && t(22, v = _.message), "progress" in _ && t(7, p = _.progress), "variant" in _ && t(8, b = _.variant), "loading_text" in _ && t(9, y = _.loading_text), "absolute" in _ && t(10, k = _.absolute), "translucent" in _ && t(11, N = _.translucent), "border" in _ && t(12, R = _.border), "autoscroll" in _ && t(23, w = _.autoscroll), "el" in _ && t(13, S = _.el), "_timer" in _ && (h = _._timer), "timer_start" in _ && t(24, L = _.timer_start), "timer_diff" in _ && t(25, E = _.timer_diff), "old_eta" in _ && t(26, j = _.old_eta), "eta_from_start" in _ && t(27, z = _.eta_from_start), "message_visible" in _ && (he = _.message_visible), "eta_level" in _ && t(17, ge = _.eta_level), "progress_level" in _ && t(14, V = _.progress_level), "last_progress_level" in _ && t(15, $ = _.last_progress_level), "progress_bar" in _ && t(16, D = _.progress_bar), "show_eta_bar" in _ && t(18, we = _.show_eta_bar), "formatted_eta" in _ && t(19, de = _.formatted_eta), "show_message_timeout" in _ && (je = _.show_message_timeout), "formatted_timer" in _ && t(20, l = _.formatted_timer); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), n.$$.update = () => { + n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ + 218103809 && (i === null && t(0, i = j), i != null && j !== i && (t(27, z = (performance.now() - L) / 1e3 + i), t(19, de = z.toFixed(1)), t(26, j = i))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 167772160 && t(17, ge = z === null || z <= 0 || !E ? null : Math.min(E / z, 1)), n.$$.dirty[0] & /*progress*/ + 128 && p != null && t(18, we = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (p != null ? t(14, V = p.map((_) => { + if (_.index != null && _.length != null) + return _.index / _.length; + if (_.progress != null) + return _.progress; + })) : t(14, V = null), V ? (t(15, $ = V[V.length - 1]), D && ($ === 0 ? t(16, D.style.transition = "0", D) : t(16, D.style.transition = "150ms", D))) : t(15, $ = void 0)), n.$$.dirty[0] & /*status*/ + 16 && (c === "pending" ? Ne() : Me()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 10493968 && S && f && (c === "pending" || c === "complete") && mn(S, w), n.$$.dirty[0] & /*status, message*/ + 4194320 && (m(), c === "error" && v && (he = !0)), n.$$.dirty[0] & /*timer_diff*/ + 33554432 && t(20, l = E.toFixed(1)); + }, [ + i, + r, + a, + u, + c, + d, + g, + p, + b, + y, + k, + N, + R, + S, + V, + $, + D, + ge, + we, + de, + l, + f, + v, + w, + L, + E, + j, + z, + o, + s, + G, + Eo + ]; +} +class _o extends Us { + constructor(e) { + super(e), Js( + this, + e, + Ys, + Rt, + Xs, + { + i18n: 1, + eta: 0, + queue_position: 2, + queue_size: 3, + status: 4, + scroll_to_output: 21, + timer: 5, + show_progress: 6, + message: 22, + progress: 7, + variant: 8, + loading_text: 9, + absolute: 10, + translucent: 11, + border: 12, + autoscroll: 23 + }, + null, + [-1, -1] + ), T("SvelteRegisterComponent", { + component: this, + tagName: "Static", + options: e, + id: Rt.name + }); + } + get i18n() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set i18n(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get eta() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set eta(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get queue_position() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set queue_position(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get queue_size() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set queue_size(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get status() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set status(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get scroll_to_output() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set scroll_to_output(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get timer() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set timer(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get show_progress() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set show_progress(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get message() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set message(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get progress() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set progress(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get variant() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set variant(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get loading_text() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set loading_text(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get absolute() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set absolute(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get translucent() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set translucent(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get border() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set border(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get autoscroll() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set autoscroll(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const { + SvelteComponentDev: xs, + add_location: $s, + attr_dev: Fe, + detach_dev: ei, + dispatch_dev: mo, + element: ti, + init: ni, + insert_dev: oi, + noop: hn, + safe_not_equal: si, + src_url_equal: gn, + validate_slots: ii +} = window.__gradio__svelte__internal, li = "frontend/AuthorAvatar/AuthorAvatar.svelte"; +function Ct(n) { + let e, t, l; + const s = { + c: function() { + e = ti("img"), Fe(e, "alt", ""), Fe(e, "class", t = /*SIZE_CLASS*/ + n[3][ + /*size*/ + n[2] + ] + " " + /*author*/ + (n[0].type === "user" ? "rounded-full" : "rounded") + " " + /*classNames*/ + n[1] + " flex-none"), gn(e.src, l = /*author*/ + n[0].avatarUrl) || Fe(e, "src", l), Fe(e, "crossorigin", "anonymous"), $s(e, li, 20, 0, 250); + }, + l: function(r) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(r, i) { + oi(r, e, i); + }, + p: function(r, [i]) { + i & /*size, author, classNames*/ + 7 && t !== (t = /*SIZE_CLASS*/ + r[3][ + /*size*/ + r[2] + ] + " " + /*author*/ + (r[0].type === "user" ? "rounded-full" : "rounded") + " " + /*classNames*/ + r[1] + " flex-none") && Fe(e, "class", t), i & /*author*/ + 1 && !gn(e.src, l = /*author*/ + r[0].avatarUrl) && Fe(e, "src", l); + }, + i: hn, + o: hn, + d: function(r) { + r && ei(e); + } + }; + return mo("SvelteRegisterBlock", { + block: s, + id: Ct.name, + type: "component", + source: "", + ctx: n + }), s; +} +function ri(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + ii("AuthorAvatar", l, []); + let { author: o } = e, { classNames: r = "" } = e, { size: i = "md" } = e; + const a = { + xs: "w-2.5 h-2.5", + sm: "w-3 h-3", + md: "w-3.5 h-3.5", + lg: "w-5 h-5", + xl: "w-9 h-9", + xxl: "w-24 h-24" + }; + n.$$.on_mount.push(function() { + o === void 0 && !("author" in e || n.$$.bound[n.$$.props.author]) && console.warn(" was created without expected prop 'author'"); + }); + const u = ["author", "classNames", "size"]; + return Object.keys(e).forEach((c) => { + !~u.indexOf(c) && c.slice(0, 2) !== "$$" && c !== "slot" && console.warn(` was created with unknown prop '${c}'`); + }), n.$$set = (c) => { + "author" in c && t(0, o = c.author), "classNames" in c && t(1, r = c.classNames), "size" in c && t(2, i = c.size); + }, n.$capture_state = () => ({ author: o, classNames: r, size: i, SIZE_CLASS: a }), n.$inject_state = (c) => { + "author" in c && t(0, o = c.author), "classNames" in c && t(1, r = c.classNames), "size" in c && t(2, i = c.size); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [o, r, i, a]; +} +class ho extends xs { + constructor(e) { + super(e), ni(this, e, ri, Ct, si, { author: 0, classNames: 1, size: 2 }), mo("SvelteRegisterComponent", { + component: this, + tagName: "AuthorAvatar", + options: e, + id: Ct.name + }); + } + get author() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set author(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get classNames() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set classNames(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get size() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set size(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const { + SvelteComponentDev: ci, + add_location: wn, + append_dev: ai, + attr_dev: Q, + detach_dev: ui, + dispatch_dev: go, + init: fi, + insert_dev: di, + noop: pn, + safe_not_equal: _i, + svg_element: bn, + validate_slots: mi +} = window.__gradio__svelte__internal, vn = "frontend/Icons/IconArrowRight.svelte"; +function Nt(n) { + let e, t; + const l = { + c: function() { + e = bn("svg"), t = bn("path"), Q(t, "d", "M18 6l-1.4 1.4l7.5 7.6H3v2h21.1l-7.5 7.6L18 26l10-10z"), Q(t, "fill", "currentColor"), wn(t, vn, 16, 1, 303), Q( + e, + "class", + /*classNames*/ + n[0] + ), Q(e, "xmlns", "http://www.w3.org/2000/svg"), Q(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Q(e, "aria-hidden", "true"), Q(e, "focusable", "false"), Q(e, "role", "img"), Q(e, "width", "1em"), Q(e, "height", "1em"), Q(e, "preserveAspectRatio", "xMidYMid meet"), Q(e, "viewBox", "0 0 32 32"), wn(e, vn, 4, 0, 59); + }, + l: function(o) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(o, r) { + di(o, e, r), ai(e, t); + }, + p: function(o, [r]) { + r & /*classNames*/ + 1 && Q( + e, + "class", + /*classNames*/ + o[0] + ); + }, + i: pn, + o: pn, + d: function(o) { + o && ui(e); + } + }; + return go("SvelteRegisterBlock", { + block: l, + id: Nt.name, + type: "component", + source: "", + ctx: n + }), l; +} +function hi(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + mi("IconArrowRight", l, []); + let { classNames: o = "" } = e; + const r = ["classNames"]; + return Object.keys(e).forEach((i) => { + !~r.indexOf(i) && i.slice(0, 2) !== "$$" && i !== "slot" && console.warn(` was created with unknown prop '${i}'`); + }), n.$$set = (i) => { + "classNames" in i && t(0, o = i.classNames); + }, n.$capture_state = () => ({ classNames: o }), n.$inject_state = (i) => { + "classNames" in i && t(0, o = i.classNames); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [o]; +} +class Jt extends ci { + constructor(e) { + super(e), fi(this, e, hi, Nt, _i, { classNames: 0 }), go("SvelteRegisterComponent", { + component: this, + tagName: "IconArrowRight", + options: e, + id: Nt.name + }); + } + get classNames() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set classNames(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +const { + SvelteComponentDev: gi, + add_location: Je, + append_dev: pe, + attr_dev: x, + check_outros: yn, + create_component: Wt, + destroy_component: Xt, + detach_dev: Ve, + dispatch_dev: Be, + element: We, + group_outros: kn, + init: wi, + insert_dev: Ge, + listen_dev: pi, + mount_component: Zt, + noop: At, + safe_not_equal: bi, + set_data_dev: wo, + space: ot, + stop_propagation: vi, + text: Kt, + transition_in: _e, + transition_out: ye, + validate_slots: yi +} = window.__gradio__svelte__internal, Xe = "frontend/QuickSearchEntry/QuickSearchEntry.svelte"; +function po(n) { + let e, t, l; + const s = { + c: function() { + e = We("span"), t = Kt("new"), x(e, "class", l = "mr-1.5 rounded px-1 text-xs leading-tight " + /*isSelected*/ + (n[1] ? "bg-white/10 text-white" : "bg-blue-500/10 text-blue-700 dark:text-blue-200")), Je(e, Xe, 30, 2, 1040); + }, + m: function(r, i) { + Ge(r, e, i), pe(e, t); + }, + p: function(r, i) { + i & /*isSelected*/ + 2 && l !== (l = "mr-1.5 rounded px-1 text-xs leading-tight " + /*isSelected*/ + (r[1] ? "bg-white/10 text-white" : "bg-blue-500/10 text-blue-700 dark:text-blue-200")) && x(e, "class", l); + }, + i: At, + o: At, + d: function(r) { + r && Ve(e); + } + }; + return Be("SvelteRegisterBlock", { + block: s, + id: po.name, + type: "if", + source: "(30:45) ", + ctx: n + }), s; +} +function bo(n) { + let e, t; + e = new ho({ + props: { + author: { + avatarUrl: ( + /*entry*/ + n[0].imgUrl + ), + type: ( + /*entry*/ + n[0].type === "user" ? "user" : "org" + ) + }, + classNames: "mr-1.5" + }, + $$inline: !0 + }); + const l = { + c: function() { + Wt(e.$$.fragment); + }, + m: function(o, r) { + Zt(e, o, r), t = !0; + }, + p: function(o, r) { + const i = {}; + r & /*entry*/ + 1 && (i.author = { + avatarUrl: ( + /*entry*/ + o[0].imgUrl + ), + type: ( + /*entry*/ + o[0].type === "user" ? "user" : "org" + ) + }), e.$set(i); + }, + i: function(o) { + t || (_e(e.$$.fragment, o), t = !0); + }, + o: function(o) { + ye(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Xt(e, o); + } + }; + return Be("SvelteRegisterBlock", { + block: l, + id: bo.name, + type: "if", + source: "(22:64) ", + ctx: n + }), l; +} +function vo(n) { + let e, t; + e = new Jt({ + props: { classNames: "flex-none mr-1 h-3 w-3" }, + $$inline: !0 + }); + const l = { + c: function() { + Wt(e.$$.fragment); + }, + m: function(o, r) { + Zt(e, o, r), t = !0; + }, + p: At, + i: function(o) { + t || (_e(e.$$.fragment, o), t = !0); + }, + o: function(o) { + ye(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Xt(e, o); + } + }; + return Be("SvelteRegisterBlock", { + block: l, + id: vo.name, + type: "if", + source: '(20:1) {#if [\\"all-datasets\\", \\"all-models\\", \\"all-spaces\\"].includes(entry.type)}', + ctx: n + }), l; +} +function jt(n) { + let e, t, l, s = ( + /*entry*/ + n[0].description + "" + ), o, r; + const i = { + c: function() { + e = We("span"), e.textContent = "·", t = ot(), l = We("span"), o = Kt(s), x(e, "class", "pl-0.5 pr-1.5 text-gray-300"), Je(e, Xe, 45, 2, 1468), x(l, "class", r = "mr-2 truncate " + /*isSelected*/ + (n[1] ? "text-white" : "text-gray-400")), Je(l, Xe, 46, 2, 1521); + }, + m: function(u, c) { + Ge(u, e, c), Ge(u, t, c), Ge(u, l, c), pe(l, o); + }, + p: function(u, c) { + c & /*entry*/ + 1 && s !== (s = /*entry*/ + u[0].description + "") && wo(o, s), c & /*isSelected*/ + 2 && r !== (r = "mr-2 truncate " + /*isSelected*/ + (u[1] ? "text-white" : "text-gray-400")) && x(l, "class", r); + }, + d: function(u) { + u && (Ve(e), Ve(t), Ve(l)); + } + }; + return Be("SvelteRegisterBlock", { + block: i, + id: jt.name, + type: "if", + source: "(45:1) {#if entry.description}", + ctx: n + }), i; +} +function qt(n) { + let e, t; + e = new Jt({ + props: { + classNames: "flex-none ml-auto h-3.5 w-3.5" + }, + $$inline: !0 + }); + const l = { + c: function() { + Wt(e.$$.fragment); + }, + m: function(o, r) { + Zt(e, o, r), t = !0; + }, + i: function(o) { + t || (_e(e.$$.fragment, o), t = !0); + }, + o: function(o) { + ye(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Xt(e, o); + } + }; + return Be("SvelteRegisterBlock", { + block: l, + id: qt.name, + type: "if", + source: '(49:1) {#if entry.type === \\"full-text-search\\"}', + ctx: n + }), l; +} +function Lt(n) { + let e, t, l, s, o, r, i, a = ( + /*entry*/ + n[0].label + "" + ), u, c, f, d, g, v, p, b, y; + const k = [vo, bo, po], N = []; + function R(L, E) { + return E & /*entry*/ + 1 && (t = null), E & /*entry*/ + 1 && (l = null), t == null && (t = !!["all-datasets", "all-models", "all-spaces"].includes( + /*entry*/ + L[0].type + )), t ? 0 : (l == null && (l = !!(["org", "user"].includes( + /*entry*/ + L[0].type + ) && /*entry*/ + L[0].imgUrl)), l ? 1 : ( + /*entry*/ + L[0].type === "full-text-search" ? 2 : -1 + )); + } + ~(s = R(n, -1)) && (o = N[s] = k[s](n)); + let w = ( + /*entry*/ + n[0].description && jt(n) + ), S = ( + /*entry*/ + n[0].type === "full-text-search" && qt(n) + ); + const h = { + c: function() { + e = We("a"), o && o.c(), r = ot(), i = We("span"), u = Kt(a), f = ot(), w && w.c(), d = ot(), S && S.c(), x(i, "class", c = "flex-shrink-0 truncate " + /*entry*/ + (n[0].type === "model" && !/*isSelected*/ + n[1] ? "rounded bg-gradient-to-b from-gray-50 to-gray-100 px-1 dark:from-gray-925 dark:to-gray-950" : "px-1")), Je(i, Xe, 36, 1, 1221), x(e, "class", g = "flex h-8 cursor-pointer items-center px-2 " + (["dataset", "model", "no-results", "space"].includes( + /*entry*/ + n[0].type + ) ? "font-mono text-xs" : "") + " " + (["all-datasets", "all-models", "all-spaces"].includes( + /*entry*/ + n[0].type + ) && !/*isSelected*/ + n[1] ? "text-gray-400" : "") + " " + /*isSelected*/ + (n[1] ? "bg-blue-500 text-white dark:bg-blue-700" : "hover:bg-gray-50 dark:hover:bg-gray-900")), x(e, "href", v = /*entry*/ + n[0].href), Je(e, Xe, 11, 0, 224); + }, + l: function(E) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(E, j) { + Ge(E, e, j), ~s && N[s].m(e, null), pe(e, r), pe(e, i), pe(i, u), pe(e, f), w && w.m(e, null), pe(e, d), S && S.m(e, null), p = !0, b || (y = pi(e, "click", vi( + /*click_handler*/ + n[3] + ), !1, !1, !0, !1), b = !0); + }, + p: function(E, [j]) { + let z = s; + s = R(E, j), s === z ? ~s && N[s].p(E, j) : (o && (kn(), ye(N[z], 1, 1, () => { + N[z] = null; + }), yn()), ~s ? (o = N[s], o ? o.p(E, j) : (o = N[s] = k[s](E), o.c()), _e(o, 1), o.m(e, r)) : o = null), (!p || j & /*entry*/ + 1) && a !== (a = /*entry*/ + E[0].label + "") && wo(u, a), (!p || j & /*entry, isSelected*/ + 3 && c !== (c = "flex-shrink-0 truncate " + /*entry*/ + (E[0].type === "model" && !/*isSelected*/ + E[1] ? "rounded bg-gradient-to-b from-gray-50 to-gray-100 px-1 dark:from-gray-925 dark:to-gray-950" : "px-1"))) && x(i, "class", c), /*entry*/ + E[0].description ? w ? w.p(E, j) : (w = jt(E), w.c(), w.m(e, d)) : w && (w.d(1), w = null), /*entry*/ + E[0].type === "full-text-search" ? S ? j & /*entry*/ + 1 && _e(S, 1) : (S = qt(E), S.c(), _e(S, 1), S.m(e, null)) : S && (kn(), ye(S, 1, 1, () => { + S = null; + }), yn()), (!p || j & /*entry, isSelected*/ + 3 && g !== (g = "flex h-8 cursor-pointer items-center px-2 " + (["dataset", "model", "no-results", "space"].includes( + /*entry*/ + E[0].type + ) ? "font-mono text-xs" : "") + " " + (["all-datasets", "all-models", "all-spaces"].includes( + /*entry*/ + E[0].type + ) && !/*isSelected*/ + E[1] ? "text-gray-400" : "") + " " + /*isSelected*/ + (E[1] ? "bg-blue-500 text-white dark:bg-blue-700" : "hover:bg-gray-50 dark:hover:bg-gray-900"))) && x(e, "class", g), (!p || j & /*entry*/ + 1 && v !== (v = /*entry*/ + E[0].href)) && x(e, "href", v); + }, + i: function(E) { + p || (_e(o), _e(S), p = !0); + }, + o: function(E) { + ye(o), ye(S), p = !1; + }, + d: function(E) { + E && Ve(e), ~s && N[s].d(), w && w.d(), S && S.d(), b = !1, y(); + } + }; + return Be("SvelteRegisterBlock", { + block: h, + id: Lt.name, + type: "component", + source: "", + ctx: n + }), h; +} +function ki(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + yi("QuickSearchEntry", l, []); + let { entry: o } = e, { isSelected: r } = e, { onClick: i } = e; + n.$$.on_mount.push(function() { + o === void 0 && !("entry" in e || n.$$.bound[n.$$.props.entry]) && console.warn(" was created without expected prop 'entry'"), r === void 0 && !("isSelected" in e || n.$$.bound[n.$$.props.isSelected]) && console.warn(" was created without expected prop 'isSelected'"), i === void 0 && !("onClick" in e || n.$$.bound[n.$$.props.onClick]) && console.warn(" was created without expected prop 'onClick'"); + }); + const a = ["entry", "isSelected", "onClick"]; + Object.keys(e).forEach((c) => { + !~a.indexOf(c) && c.slice(0, 2) !== "$$" && c !== "slot" && console.warn(` was created with unknown prop '${c}'`); + }); + const u = () => i(o); + return n.$$set = (c) => { + "entry" in c && t(0, o = c.entry), "isSelected" in c && t(1, r = c.isSelected), "onClick" in c && t(2, i = c.onClick); + }, n.$capture_state = () => ({ + AuthorAvatar: ho, + IconArrowRight: Jt, + entry: o, + isSelected: r, + onClick: i + }), n.$inject_state = (c) => { + "entry" in c && t(0, o = c.entry), "isSelected" in c && t(1, r = c.isSelected), "onClick" in c && t(2, i = c.onClick); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), [o, r, i, u]; +} +class Ze extends gi { + constructor(e) { + super(e), wi(this, e, ki, Lt, bi, { entry: 0, isSelected: 1, onClick: 2 }), Be("SvelteRegisterComponent", { + component: this, + tagName: "QuickSearchEntry", + options: e, + id: Lt.name + }); + } + get entry() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set entry(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get isSelected() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set isSelected(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + get onClick() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + set onClick(e) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } +} +function Si(n) { + let e, t = n[0], l = 1; + for (; l < n.length; ) { + const s = n[l], o = n[l + 1]; + if (l += 2, (s === "optionalAccess" || s === "optionalCall") && t == null) + return; + s === "access" || s === "optionalAccess" ? (e = t, t = o(t)) : (s === "call" || s === "optionalCall") && (t = o((...r) => t.call(e, ...r)), e = void 0); + } + return t; +} +function Sn(n) { + const e = new URLSearchParams(); + for (const [l, s] of Object.entries(n)) + if (s !== void 0) + if (Array.isArray(s)) + for (const o of s) + e.append(l, String(o)); + else + e.set(l, String(s)); + const t = e.toString(); + return t ? `?${t}` : ""; +} +async function En(n, e) { + try { + return Si([n, "access", (t) => t.headers, "access", (t) => t.get, "call", (t) => t("content-type"), "optionalAccess", (t) => t.includes, "call", (t) => t("json")]) ? await n.json() : e === "blob" ? await n.blob() : await n.text(); + } catch { + return; + } +} +async function Ei(n, e, t = {}) { + try { + const l = { + ...t.headers, + ...t.responseType === "json" ? { Accept: "application/json" } : t.responseType === "text" ? { Accept: "text/plain" } : {} + }, s = await fetch(e, { + body: t.data instanceof File ? t.data : t.data ? JSON.stringify(t.data) : void 0, + headers: l, + method: n, + ...t.signal ? { signal: t.signal } : {}, + ...t.credentials ? { credentials: t.credentials } : {} + }), o = s.clone(); + if (!s.ok) { + let a = `${s.status} ${s.statusText}`; + const u = await En(s); + return typeof u == "object" && u && ("message" in u && typeof u.message == "string" ? a = u.message : "error" in u && typeof u.error == "string" && (a = u.error)), { + aborted: !1, + error: a, + isError: !0, + payload: u, + rawResponse: o, + statusCode: s.status + }; + } + const r = await En(s, t.responseType), i = s.headers.get("Link") ? Bi(s.headers.get("Link")) : void 0; + return r !== void 0 ? { + isError: !1, + payload: r, + rawResponse: o, + statusCode: s.status, + links: i + } : { + aborted: !1, + error: t.responseType === "json" ? "Error parsing JSON" : "Error parsing server response", + isError: !0, + payload: r, + rawResponse: o, + statusCode: s.status, + links: i + }; + } catch (l) { + return { + aborted: l instanceof DOMException && l.name === "AbortError", + error: (l instanceof TypeError || l instanceof DOMException) && l.message ? l.message : "Failed to fetch", + isError: !0, + payload: void 0, + rawResponse: void 0, + statusCode: 0 + }; + } +} +function Bn(n, e = {}) { + return Ei("GET", n, { ...e }); +} +function Bi(n) { + const e = /<(https?:[/][/][^>]+)>;\s+rel="([^"]+)"/g; + return Object.fromEntries([...n.matchAll(e)].map(([t, l, s]) => [s, l])); +} +function Pn(n, e) { + let t, l; + return function(...s) { + const o = Date.now(); + t && o < t + e ? (clearTimeout(l), l = setTimeout(function() { + t = o, n(...s); + }, e)) : (t = o, n(...s)); + }; +} +const { + SvelteComponentDev: Pi, + add_location: ke, + append_dev: oe, + assign: Ri, + attr_dev: Y, + binding_callbacks: Ci, + check_outros: ae, + create_component: Pe, + destroy_component: Re, + destroy_each: Ht, + detach_dev: se, + dispatch_dev: O, + element: Se, + empty: Yt, + ensure_array_like_dev: De, + flush: I, + get_spread_object: Ni, + get_spread_update: Ai, + globals: ji, + group_outros: ue, + init: qi, + insert_dev: ie, + listen_dev: He, + mount_component: Ce, + prop_dev: Li, + run_all: Fi, + safe_not_equal: Ti, + set_data_dev: zi, + set_input_value: Rn, + space: fe, + text: Ii, + toggle_class: Di, + transition_in: C, + transition_out: q, + validate_slots: Ui +} = window.__gradio__svelte__internal, { console: Ye } = ji, { tick: rt } = window.__gradio__svelte__internal, Ee = "frontend/Index.svelte"; +function Cn(n, e, t) { + const l = n.slice(); + return l[33] = e[t], l; +} +function Nn(n, e, t) { + const l = n.slice(); + return l[33] = e[t], l; +} +function An(n, e, t) { + const l = n.slice(); + return l[33] = e[t], l; +} +function Ft(n) { + let e, t; + const l = [ + { autoscroll: ( + /*gradio*/ + n[1].autoscroll + ) }, + { i18n: ( + /*gradio*/ + n[1].i18n + ) }, + /*loading_status*/ + n[10] + ]; + let s = {}; + for (let r = 0; r < l.length; r += 1) + s = Ri(s, l[r]); + e = new _o({ + props: s, + $$inline: !0 + }); + const o = { + c: function() { + Pe(e.$$.fragment); + }, + m: function(i, a) { + Ce(e, i, a), t = !0; + }, + p: function(i, a) { + const u = a[0] & /*gradio, loading_status*/ + 1026 ? Ai(l, [ + a[0] & /*gradio*/ + 2 && { autoscroll: ( + /*gradio*/ + i[1].autoscroll + ) }, + a[0] & /*gradio*/ + 2 && { i18n: ( + /*gradio*/ + i[1].i18n + ) }, + a[0] & /*loading_status*/ + 1024 && Ni( + /*loading_status*/ + i[10] + ) + ]) : {}; + e.$set(u); + }, + i: function(i) { + t || (C(e.$$.fragment, i), t = !0); + }, + o: function(i) { + q(e.$$.fragment, i), t = !1; + }, + d: function(i) { + Re(e, i); + } + }; + return O("SvelteRegisterBlock", { + block: o, + id: Ft.name, + type: "if", + source: "(174:1) {#if loading_status}", + ctx: n + }), o; +} +function yo(n) { + let e; + const t = { + c: function() { + e = Ii( + /*label*/ + n[2] + ); + }, + m: function(s, o) { + ie(s, e, o); + }, + p: function(s, o) { + o[0] & /*label*/ + 4 && zi( + e, + /*label*/ + s[2] + ); + }, + d: function(s) { + s && se(e); + } + }; + return O("SvelteRegisterBlock", { + block: t, + id: yo.name, + type: "slot", + source: "(183:2) ", + ctx: n + }), t; +} +function Tt(n) { + let e, t, l, s = ( + /*entries*/ + n[14].some(Tn) + ), o, r = ( + /*entries*/ + n[14].some(Fn) + ), i, a = ( + /*entries*/ + n[14].some(Ln) + ), u, c, f = !/*numResults*/ + n[16] && zt(n), d = s && It(n), g = r && Ut(n), v = a && Qt(n); + const p = { + c: function() { + e = Se("div"), t = Se("ul"), f && f.c(), l = fe(), d && d.c(), o = fe(), g && g.c(), i = fe(), v && v.c(), Y(t, "class", "mt-1 max-h-[calc(100vh-100px)] w-full divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-lg border border-gray-100 bg-white text-sm shadow-lg dark:divide-gray-900"), ke(t, Ee, 199, 4, 5038), Y(e, "class", u = /*position*/ + n[13] + " z-40 w-full md:min-w-[24rem]"), ke(e, Ee, 198, 3, 4980); + }, + m: function(y, k) { + ie(y, e, k), oe(e, t), f && f.m(t, null), oe(t, l), d && d.m(t, null), oe(t, o), g && g.m(t, null), oe(t, i), v && v.m(t, null), c = !0; + }, + p: function(y, k) { + /*numResults*/ + y[16] ? f && (ue(), q(f, 1, 1, () => { + f = null; + }), ae()) : f ? k[0] & /*numResults*/ + 65536 && C(f, 1) : (f = zt(y), f.c(), C(f, 1), f.m(t, l)), k[0] & /*entries*/ + 16384 && (s = /*entries*/ + y[14].some(Tn)), s ? d ? (d.p(y, k), k[0] & /*entries*/ + 16384 && C(d, 1)) : (d = It(y), d.c(), C(d, 1), d.m(t, o)) : d && (ue(), q(d, 1, 1, () => { + d = null; + }), ae()), k[0] & /*entries*/ + 16384 && (r = /*entries*/ + y[14].some(Fn)), r ? g ? (g.p(y, k), k[0] & /*entries*/ + 16384 && C(g, 1)) : (g = Ut(y), g.c(), C(g, 1), g.m(t, i)) : g && (ue(), q(g, 1, 1, () => { + g = null; + }), ae()), k[0] & /*entries*/ + 16384 && (a = /*entries*/ + y[14].some(Ln)), a ? v ? (v.p(y, k), k[0] & /*entries*/ + 16384 && C(v, 1)) : (v = Qt(y), v.c(), C(v, 1), v.m(t, null)) : v && (ue(), q(v, 1, 1, () => { + v = null; + }), ae()), (!c || k[0] & /*position*/ + 8192 && u !== (u = /*position*/ + y[13] + " z-40 w-full md:min-w-[24rem]")) && Y(e, "class", u); + }, + i: function(y) { + c || (C(f), C(d), C(g), C(v), c = !0); + }, + o: function(y) { + q(f), q(d), q(g), q(v), c = !1; + }, + d: function(y) { + y && se(e), f && f.d(), d && d.d(), g && g.d(), v && v.d(); + } + }; + return O("SvelteRegisterBlock", { + block: p, + id: Tt.name, + type: "if", + source: "(198:2) {#if isOpen}", + ctx: n + }), p; +} +function zt(n) { + let e, t; + e = new Ze({ + props: { + entry: { + id: "no-result", + label: "No results found :(", + type: "no-results" + }, + isSelected: !1, + onClick: Mi + }, + $$inline: !0 + }); + const l = { + c: function() { + Pe(e.$$.fragment); + }, + m: function(o, r) { + Ce(e, o, r), t = !0; + }, + i: function(o) { + t || (C(e.$$.fragment, o), t = !0); + }, + o: function(o) { + q(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Re(e, o); + } + }; + return O("SvelteRegisterBlock", { + block: l, + id: zt.name, + type: "if", + source: "(203:5) {#if !numResults}", + ctx: n + }), l; +} +function It(n) { + let e, t, l = De( + /*entries*/ + n[14].filter(zn) + ), s = []; + for (let i = 0; i < l.length; i += 1) + s[i] = Dt(An(n, l, i)); + const o = (i) => q(s[i], 1, 1, () => { + s[i] = null; + }), r = { + c: function() { + for (let a = 0; a < s.length; a += 1) + s[a].c(); + e = Yt(); + }, + m: function(a, u) { + for (let c = 0; c < s.length; c += 1) + s[c] && s[c].m(a, u); + ie(a, e, u), t = !0; + }, + p: function(a, u) { + if (u[0] & /*entries, isSelected, selectedEntryIdx, handleClickEntry*/ + 12730368) { + l = De( + /*entries*/ + a[14].filter(zn) + ); + let c; + for (c = 0; c < l.length; c += 1) { + const f = An(a, l, c); + s[c] ? (s[c].p(f, u), C(s[c], 1)) : (s[c] = Dt(f), s[c].c(), C(s[c], 1), s[c].m(e.parentNode, e)); + } + for (ue(), c = l.length; c < s.length; c += 1) + o(c); + ae(); + } + }, + i: function(a) { + if (!t) { + for (let u = 0; u < l.length; u += 1) + C(s[u]); + t = !0; + } + }, + o: function(a) { + s = s.filter(Boolean); + for (let u = 0; u < s.length; u += 1) + q(s[u]); + t = !1; + }, + d: function(a) { + a && se(e), Ht(s, a); + } + }; + return O("SvelteRegisterBlock", { + block: r, + id: It.name, + type: "if", + source: '(215:5) {#if entries.some(x => x.type === \\"model\\")}', + ctx: n + }), r; +} +function Dt(n) { + let e, t, l, s; + t = new Ze({ + props: { + entry: ( + /*entry*/ + n[33] + ), + isSelected: ( + /*isSelected*/ + n[22]( + /*selectedEntryIdx*/ + n[17], + /*entry*/ + n[33] + ) + ), + onClick: ( + /*handleClickEntry*/ + n[23] + ) + }, + $$inline: !0 + }); + const o = { + c: function() { + e = Se("li"), Pe(t.$$.fragment), l = fe(), ke(e, Ee, 216, 7, 5616); + }, + m: function(i, a) { + ie(i, e, a), Ce(t, e, null), oe(e, l), s = !0; + }, + p: function(i, a) { + const u = {}; + a[0] & /*entries*/ + 16384 && (u.entry = /*entry*/ + i[33]), a[0] & /*selectedEntryIdx, entries*/ + 147456 && (u.isSelected = /*isSelected*/ + i[22]( + /*selectedEntryIdx*/ + i[17], + /*entry*/ + i[33] + )), t.$set(u); + }, + i: function(i) { + s || (C(t.$$.fragment, i), s = !0); + }, + o: function(i) { + q(t.$$.fragment, i), s = !1; + }, + d: function(i) { + i && se(e), Re(t); + } + }; + return O("SvelteRegisterBlock", { + block: o, + id: Dt.name, + type: "each", + source: '(216:6) {#each entries.filter(x => [\\"model\\", \\"all-models\\"].includes(x.type)) as entry}', + ctx: n + }), o; +} +function Ut(n) { + let e, t, l = De( + /*entries*/ + n[14].filter(In) + ), s = []; + for (let i = 0; i < l.length; i += 1) + s[i] = Mt(Nn(n, l, i)); + const o = (i) => q(s[i], 1, 1, () => { + s[i] = null; + }), r = { + c: function() { + for (let a = 0; a < s.length; a += 1) + s[a].c(); + e = Yt(); + }, + m: function(a, u) { + for (let c = 0; c < s.length; c += 1) + s[c] && s[c].m(a, u); + ie(a, e, u), t = !0; + }, + p: function(a, u) { + if (u[0] & /*entries, isSelected, selectedEntryIdx, handleClickEntry*/ + 12730368) { + l = De( + /*entries*/ + a[14].filter(In) + ); + let c; + for (c = 0; c < l.length; c += 1) { + const f = Nn(a, l, c); + s[c] ? (s[c].p(f, u), C(s[c], 1)) : (s[c] = Mt(f), s[c].c(), C(s[c], 1), s[c].m(e.parentNode, e)); + } + for (ue(), c = l.length; c < s.length; c += 1) + o(c); + ae(); + } + }, + i: function(a) { + if (!t) { + for (let u = 0; u < l.length; u += 1) + C(s[u]); + t = !0; + } + }, + o: function(a) { + s = s.filter(Boolean); + for (let u = 0; u < s.length; u += 1) + q(s[u]); + t = !1; + }, + d: function(a) { + a && se(e), Ht(s, a); + } + }; + return O("SvelteRegisterBlock", { + block: r, + id: Ut.name, + type: "if", + source: '(223:5) {#if entries.some(x => x.type === \\"org\\")}', + ctx: n + }), r; +} +function Mt(n) { + let e, t, l, s; + t = new Ze({ + props: { + entry: ( + /*entry*/ + n[33] + ), + isSelected: ( + /*isSelected*/ + n[22]( + /*selectedEntryIdx*/ + n[17], + /*entry*/ + n[33] + ) + ), + onClick: ( + /*handleClickEntry*/ + n[23] + ) + }, + $$inline: !0 + }); + const o = { + c: function() { + e = Se("li"), Pe(t.$$.fragment), l = fe(), ke(e, Ee, 224, 7, 5893); + }, + m: function(i, a) { + ie(i, e, a), Ce(t, e, null), oe(e, l), s = !0; + }, + p: function(i, a) { + const u = {}; + a[0] & /*entries*/ + 16384 && (u.entry = /*entry*/ + i[33]), a[0] & /*selectedEntryIdx, entries*/ + 147456 && (u.isSelected = /*isSelected*/ + i[22]( + /*selectedEntryIdx*/ + i[17], + /*entry*/ + i[33] + )), t.$set(u); + }, + i: function(i) { + s || (C(t.$$.fragment, i), s = !0); + }, + o: function(i) { + q(t.$$.fragment, i), s = !1; + }, + d: function(i) { + i && se(e), Re(t); + } + }; + return O("SvelteRegisterBlock", { + block: o, + id: Mt.name, + type: "each", + source: '(224:6) {#each entries.filter(x => x.type === \\"org\\") as entry}', + ctx: n + }), o; +} +function Qt(n) { + let e, t, l = De( + /*entries*/ + n[14].filter(Dn) + ), s = []; + for (let i = 0; i < l.length; i += 1) + s[i] = Ot(Cn(n, l, i)); + const o = (i) => q(s[i], 1, 1, () => { + s[i] = null; + }), r = { + c: function() { + for (let a = 0; a < s.length; a += 1) + s[a].c(); + e = Yt(); + }, + m: function(a, u) { + for (let c = 0; c < s.length; c += 1) + s[c] && s[c].m(a, u); + ie(a, e, u), t = !0; + }, + p: function(a, u) { + if (u[0] & /*entries, isSelected, selectedEntryIdx, handleClickEntry*/ + 12730368) { + l = De( + /*entries*/ + a[14].filter(Dn) + ); + let c; + for (c = 0; c < l.length; c += 1) { + const f = Cn(a, l, c); + s[c] ? (s[c].p(f, u), C(s[c], 1)) : (s[c] = Ot(f), s[c].c(), C(s[c], 1), s[c].m(e.parentNode, e)); + } + for (ue(), c = l.length; c < s.length; c += 1) + o(c); + ae(); + } + }, + i: function(a) { + if (!t) { + for (let u = 0; u < l.length; u += 1) + C(s[u]); + t = !0; + } + }, + o: function(a) { + s = s.filter(Boolean); + for (let u = 0; u < s.length; u += 1) + q(s[u]); + t = !1; + }, + d: function(a) { + a && se(e), Ht(s, a); + } + }; + return O("SvelteRegisterBlock", { + block: r, + id: Qt.name, + type: "if", + source: '(231:5) {#if entries.some(x => x.type === \\"user\\")}', + ctx: n + }), r; +} +function Ot(n) { + let e, t, l, s; + t = new Ze({ + props: { + entry: ( + /*entry*/ + n[33] + ), + isSelected: ( + /*isSelected*/ + n[22]( + /*selectedEntryIdx*/ + n[17], + /*entry*/ + n[33] + ) + ), + onClick: ( + /*handleClickEntry*/ + n[23] + ) + }, + $$inline: !0 + }); + const o = { + c: function() { + e = Se("li"), Pe(t.$$.fragment), l = fe(), ke(e, Ee, 232, 7, 6167); + }, + m: function(i, a) { + ie(i, e, a), Ce(t, e, null), oe(e, l), s = !0; + }, + p: function(i, a) { + const u = {}; + a[0] & /*entries*/ + 16384 && (u.entry = /*entry*/ + i[33]), a[0] & /*selectedEntryIdx, entries*/ + 147456 && (u.isSelected = /*isSelected*/ + i[22]( + /*selectedEntryIdx*/ + i[17], + /*entry*/ + i[33] + )), t.$set(u); + }, + i: function(i) { + s || (C(t.$$.fragment, i), s = !0); + }, + o: function(i) { + q(t.$$.fragment, i), s = !1; + }, + d: function(i) { + i && se(e), Re(t); + } + }; + return O("SvelteRegisterBlock", { + block: o, + id: Ot.name, + type: "each", + source: '(232:6) {#each entries.filter(x => x.type === \\"user\\") as entry}', + ctx: n + }), o; +} +function ko(n) { + let e, t, l, s, o, r, i, a, u, c, f, d = ( + /*loading_status*/ + n[10] && Ft(n) + ); + l = new Wn({ + props: { + show_label: ( + /*show_label*/ + n[7] + ), + info: void 0, + $$slots: { default: [yo] }, + $$scope: { ctx: n } + }, + $$inline: !0 + }); + let g = ( + /*isOpen*/ + n[15] && Tt(n) + ); + const v = { + c: function() { + d && d.c(), e = fe(), t = Se("label"), Pe(l.$$.fragment), s = fe(), o = Se("input"), a = fe(), g && g.c(), Y(o, "data-testid", "textbox"), Y(o, "type", "text"), Y(o, "class", "scroll-hide s-8RhEEAzdBY_I"), Y( + o, + "placeholder", + /*placeholder*/ + n[6] + ), o.disabled = r = !/*interactive*/ + n[11], Y(o, "dir", i = /*rtl*/ + n[12] ? "rtl" : "ltr"), ke(o, Ee, 184, 2, 4697), Y(t, "class", "s-8RhEEAzdBY_I"), Di(t, "container", So), ke(t, Ee, 181, 1, 4605); + }, + m: function(b, y) { + d && d.m(b, y), ie(b, e, y), ie(b, t, y), Ce(l, t, null), oe(t, s), oe(t, o), Rn( + o, + /*value*/ + n[0] + ), n[27](o), oe(t, a), g && g.m(t, null), u = !0, c || (f = [ + He( + o, + "input", + /*input_input_handler*/ + n[26] + ), + He( + o, + "focus", + /*handleFocus*/ + n[20], + !1, + !1, + !1, + !1 + ), + He( + o, + "keypress", + /*handle_keypress*/ + n[19], + !1, + !1, + !1, + !1 + ), + He( + o, + "input", + /*handleInput*/ + n[21], + !1, + !1, + !1, + !1 + ) + ], c = !0); + }, + p: function(b, y) { + /*loading_status*/ + b[10] ? d ? (d.p(b, y), y[0] & /*loading_status*/ + 1024 && C(d, 1)) : (d = Ft(b), d.c(), C(d, 1), d.m(e.parentNode, e)) : d && (ue(), q(d, 1, 1, () => { + d = null; + }), ae()); + const k = {}; + y[0] & /*show_label*/ + 128 && (k.show_label = /*show_label*/ + b[7]), y[0] & /*label*/ + 4 | y[1] & /*$$scope*/ + 512 && (k.$$scope = { dirty: y, ctx: b }), l.$set(k), (!u || y[0] & /*placeholder*/ + 64) && Y( + o, + "placeholder", + /*placeholder*/ + b[6] + ), (!u || y[0] & /*interactive*/ + 2048 && r !== (r = !/*interactive*/ + b[11])) && Li(o, "disabled", r), (!u || y[0] & /*rtl*/ + 4096 && i !== (i = /*rtl*/ + b[12] ? "rtl" : "ltr")) && Y(o, "dir", i), y[0] & /*value*/ + 1 && o.value !== /*value*/ + b[0] && Rn( + o, + /*value*/ + b[0] + ), /*isOpen*/ + b[15] ? g ? (g.p(b, y), y[0] & /*isOpen*/ + 32768 && C(g, 1)) : (g = Tt(b), g.c(), C(g, 1), g.m(t, null)) : g && (ue(), q(g, 1, 1, () => { + g = null; + }), ae()); + }, + i: function(b) { + u || (C(d), C(l.$$.fragment, b), C(g), u = !0); + }, + o: function(b) { + q(d), q(l.$$.fragment, b), q(g), u = !1; + }, + d: function(b) { + b && (se(e), se(t)), d && d.d(b), Re(l), n[27](null), g && g.d(), c = !1, Fi(f); + } + }; + return O("SvelteRegisterBlock", { + block: v, + id: ko.name, + type: "slot", + source: "(165:0) ", + ctx: n + }), v; +} +function Vt(n) { + let e, t; + e = new On({ + props: { + visible: ( + /*visible*/ + n[5] + ), + elem_id: ( + /*elem_id*/ + n[3] + ), + elem_classes: ( + /*elem_classes*/ + n[4] + ), + scale: ( + /*scale*/ + n[8] + ), + min_width: ( + /*min_width*/ + n[9] + ), + allow_overflow: !1, + padding: !0, + $$slots: { default: [ko] }, + $$scope: { ctx: n } + }, + $$inline: !0 + }); + const l = { + c: function() { + Pe(e.$$.fragment); + }, + l: function(o) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function(o, r) { + Ce(e, o, r), t = !0; + }, + p: function(o, r) { + const i = {}; + r[0] & /*visible*/ + 32 && (i.visible = /*visible*/ + o[5]), r[0] & /*elem_id*/ + 8 && (i.elem_id = /*elem_id*/ + o[3]), r[0] & /*elem_classes*/ + 16 && (i.elem_classes = /*elem_classes*/ + o[4]), r[0] & /*scale*/ + 256 && (i.scale = /*scale*/ + o[8]), r[0] & /*min_width*/ + 512 && (i.min_width = /*min_width*/ + o[9]), r[0] & /*position, entries, selectedEntryIdx, numResults, isOpen, placeholder, interactive, rtl, value, el, show_label, label, gradio, loading_status*/ + 523463 | r[1] & /*$$scope*/ + 512 && (i.$$scope = { dirty: r, ctx: o }), e.$set(i); + }, + i: function(o) { + t || (C(e.$$.fragment, o), t = !0); + }, + o: function(o) { + q(e.$$.fragment, o), t = !1; + }, + d: function(o) { + Re(e, o); + } + }; + return O("SvelteRegisterBlock", { + block: l, + id: Vt.name, + type: "component", + source: "", + ctx: n + }), l; +} +const jn = 300, So = !0; +function ct(n) { + let e, t = n[0], l = 1; + for (; l < n.length; ) { + const s = n[l], o = n[l + 1]; + if (l += 2, (s === "optionalAccess" || s === "optionalCall") && t == null) + return; + s === "access" || s === "optionalAccess" ? (e = t, t = o(t)) : (s === "call" || s === "optionalCall") && (t = o((...r) => t.call(e, ...r)), e = void 0); + } + return t; +} +function qn(n) { + const e = n.models.map((s) => ({ + href: void 0, + id: s.id, + _id: s._id, + label: s.id, + type: "model" + })), t = n.orgs.map((s) => ({ + href: void 0, + id: s.name, + _id: s._id, + imgUrl: s.avatarUrl, + label: s.fullname, + type: "org" + })), l = n.users.map((s) => ({ + href: void 0, + id: s.user, + _id: s._id, + imgUrl: s.avatarUrl.startsWith("/") ? `https://huggingface.co${s.avatarUrl}` : s.avatarUrl, + label: s.user, + type: "user", + description: s.fullname + })); + return [...e, ...t, ...l]; +} +const Ln = (n) => n.type === "user", Fn = (n) => n.type === "org", Tn = (n) => n.type === "model", Mi = () => { +}, zn = (n) => ["model", "all-models"].includes(n.type), In = (n) => n.type === "org", Dn = (n) => n.type === "user"; +function Qi(n, e, t) { + let { $$slots: l = {}, $$scope: s } = e; + Ui("Index", l, []); + let { gradio: o } = e, { label: r = "Textbox" } = e, { elem_id: i = "" } = e, { elem_classes: a = [] } = e, { visible: u = !0 } = e, { value: c = "" } = e, { placeholder: f = "" } = e, { show_label: d } = e, { scale: g = null } = e, { min_width: v = void 0 } = e, { loading_status: p = void 0 } = e, { value_is_output: b = !1 } = e, { interactive: y } = e, { rtl: k = !1 } = e, { url: N = "https://huggingface.co/api/quicksearch" } = e, { position: R = "absolute" } = e, w = [], S = !1, h = null, L = 0, E = -1, j = new AbortController(), z; + function he() { + o.dispatch("change"), b || o.dispatch("input"); + } + async function ge(m) { + await rt(), m.key === "Enter" && (m.preventDefault(), o.dispatch("submit")); + } + async function V() { + h === null && await Ne(), t(15, S = !0); + } + const $ = Pn( + async () => { + t(15, S = !0), await rt(), await Ne(); + }, + jn + ); + function D(m, U) { + return ct([w, "access", (G) => G[m], "optionalAccess", (G) => G.id]) === U.id && ct([ + w, + "access", + (G) => G[m], + "optionalAccess", + (G) => G.type + ]) === U.type; + } + function we(m) { + t(17, E = w.findIndex((U) => U.id === m.id && U.type === m.type)), console.log(m); + } + async function Ne() { + const m = c.trim(); + if (m !== h) { + const U = await Ae(m); + if (U.isError) { + U.aborted || console.error(`QuickSearch Error: ${U.error}`); + return; + } + const G = qn(U.payload); + t(14, w = [...G]), console.log(w), t(16, L = G.length), h = m; + } + } + async function Ae(m = "") { + return j.abort(), j = new AbortController(), await Bn(N + Sn({ q: m, type: ["model", "org", "user"] }), { signal: j.signal }); + } + n.$$.on_mount.push(function() { + o === void 0 && !("gradio" in e || n.$$.bound[n.$$.props.gradio]) && Ye.warn(" was created without expected prop 'gradio'"), d === void 0 && !("show_label" in e || n.$$.bound[n.$$.props.show_label]) && Ye.warn(" was created without expected prop 'show_label'"), y === void 0 && !("interactive" in e || n.$$.bound[n.$$.props.interactive]) && Ye.warn(" was created without expected prop 'interactive'"); + }); + const Me = [ + "gradio", + "label", + "elem_id", + "elem_classes", + "visible", + "value", + "placeholder", + "show_label", + "scale", + "min_width", + "loading_status", + "value_is_output", + "interactive", + "rtl", + "url", + "position" + ]; + Object.keys(e).forEach((m) => { + !~Me.indexOf(m) && m.slice(0, 2) !== "$$" && m !== "slot" && Ye.warn(` was created with unknown prop '${m}'`); + }); + function de() { + c = this.value, t(0, c); + } + function je(m) { + Ci[m ? "unshift" : "push"](() => { + z = m, t(18, z); + }); + } + return n.$$set = (m) => { + "gradio" in m && t(1, o = m.gradio), "label" in m && t(2, r = m.label), "elem_id" in m && t(3, i = m.elem_id), "elem_classes" in m && t(4, a = m.elem_classes), "visible" in m && t(5, u = m.visible), "value" in m && t(0, c = m.value), "placeholder" in m && t(6, f = m.placeholder), "show_label" in m && t(7, d = m.show_label), "scale" in m && t(8, g = m.scale), "min_width" in m && t(9, v = m.min_width), "loading_status" in m && t(10, p = m.loading_status), "value_is_output" in m && t(24, b = m.value_is_output), "interactive" in m && t(11, y = m.interactive), "rtl" in m && t(12, k = m.rtl), "url" in m && t(25, N = m.url), "position" in m && t(13, R = m.position); + }, n.$capture_state = () => ({ + _optionalChain: ct, + BlockTitle: Wn, + Block: On, + StatusTracker: _o, + tick: rt, + QuickSearchEntry: Ze, + queryString: Sn, + httpGet: Bn, + throttle: Pn, + gradio: o, + label: r, + elem_id: i, + elem_classes: a, + visible: u, + value: c, + placeholder: f, + show_label: d, + scale: g, + min_width: v, + loading_status: p, + value_is_output: b, + interactive: y, + rtl: k, + url: N, + position: R, + entries: w, + isOpen: S, + lastQuery: h, + numResults: L, + selectedEntryIdx: E, + searchController: j, + THROTTLE_DELAY: jn, + el: z, + container: So, + handle_change: he, + handle_keypress: ge, + handleFocus: V, + handleInput: $, + isSelected: D, + handleClickEntry: we, + performSearch: Ne, + fetchResults: Ae, + getResultEntries: qn + }), n.$inject_state = (m) => { + "gradio" in m && t(1, o = m.gradio), "label" in m && t(2, r = m.label), "elem_id" in m && t(3, i = m.elem_id), "elem_classes" in m && t(4, a = m.elem_classes), "visible" in m && t(5, u = m.visible), "value" in m && t(0, c = m.value), "placeholder" in m && t(6, f = m.placeholder), "show_label" in m && t(7, d = m.show_label), "scale" in m && t(8, g = m.scale), "min_width" in m && t(9, v = m.min_width), "loading_status" in m && t(10, p = m.loading_status), "value_is_output" in m && t(24, b = m.value_is_output), "interactive" in m && t(11, y = m.interactive), "rtl" in m && t(12, k = m.rtl), "url" in m && t(25, N = m.url), "position" in m && t(13, R = m.position), "entries" in m && t(14, w = m.entries), "isOpen" in m && t(15, S = m.isOpen), "lastQuery" in m && (h = m.lastQuery), "numResults" in m && t(16, L = m.numResults), "selectedEntryIdx" in m && t(17, E = m.selectedEntryIdx), "searchController" in m && (j = m.searchController), "el" in m && t(18, z = m.el); + }, e && "$$inject" in e && n.$inject_state(e.$$inject), n.$$.update = () => { + n.$$.dirty[0] & /*value*/ + 1 && c === null && t(0, c = ""), n.$$.dirty[0] & /*value*/ + 1 && he(); + }, [ + c, + o, + r, + i, + a, + u, + f, + d, + g, + v, + p, + y, + k, + R, + w, + S, + L, + E, + z, + ge, + V, + $, + D, + we, + b, + N, + de, + je + ]; +} +class Oi extends Pi { + constructor(e) { + super(e), qi( + this, + e, + Qi, + Vt, + Ti, + { + gradio: 1, + label: 2, + elem_id: 3, + elem_classes: 4, + visible: 5, + value: 0, + placeholder: 6, + show_label: 7, + scale: 8, + min_width: 9, + loading_status: 10, + value_is_output: 24, + interactive: 11, + rtl: 12, + url: 25, + position: 13 + }, + null, + [-1, -1] + ), O("SvelteRegisterComponent", { + component: this, + tagName: "Index", + options: e, + id: Vt.name + }); + } + get gradio() { + return this.$$.ctx[1]; + } + set gradio(e) { + this.$$set({ gradio: e }), I(); + } + get label() { + return this.$$.ctx[2]; + } + set label(e) { + this.$$set({ label: e }), I(); + } + get elem_id() { + return this.$$.ctx[3]; + } + set elem_id(e) { + this.$$set({ elem_id: e }), I(); + } + get elem_classes() { + return this.$$.ctx[4]; + } + set elem_classes(e) { + this.$$set({ elem_classes: e }), I(); + } + get visible() { + return this.$$.ctx[5]; + } + set visible(e) { + this.$$set({ visible: e }), I(); + } + get value() { + return this.$$.ctx[0]; + } + set value(e) { + this.$$set({ value: e }), I(); + } + get placeholder() { + return this.$$.ctx[6]; + } + set placeholder(e) { + this.$$set({ placeholder: e }), I(); + } + get show_label() { + return this.$$.ctx[7]; + } + set show_label(e) { + this.$$set({ show_label: e }), I(); + } + get scale() { + return this.$$.ctx[8]; + } + set scale(e) { + this.$$set({ scale: e }), I(); + } + get min_width() { + return this.$$.ctx[9]; + } + set min_width(e) { + this.$$set({ min_width: e }), I(); + } + get loading_status() { + return this.$$.ctx[10]; + } + set loading_status(e) { + this.$$set({ loading_status: e }), I(); + } + get value_is_output() { + return this.$$.ctx[24]; + } + set value_is_output(e) { + this.$$set({ value_is_output: e }), I(); + } + get interactive() { + return this.$$.ctx[11]; + } + set interactive(e) { + this.$$set({ interactive: e }), I(); + } + get rtl() { + return this.$$.ctx[12]; + } + set rtl(e) { + this.$$set({ rtl: e }), I(); + } + get url() { + return this.$$.ctx[25]; + } + set url(e) { + this.$$set({ url: e }), I(); + } + get position() { + return this.$$.ctx[13]; + } + set position(e) { + this.$$set({ position: e }), I(); + } +} +export { + Oi as default +};