diff --git "a/src/backend/gradio_carousel/templates/component/index.js" "b/src/backend/gradio_carousel/templates/component/index.js" --- "a/src/backend/gradio_carousel/templates/component/index.js" +++ "b/src/backend/gradio_carousel/templates/component/index.js" @@ -1,28 +1,28 @@ const { - SvelteComponent: ra, - assign: ia, - create_slot: oa, - detach: la, - element: sa, - get_all_dirty_from_scope: aa, - get_slot_changes: ua, - get_spread_update: fa, - init: ca, - insert: da, - safe_not_equal: _a, - set_dynamic_element_data: Mi, - set_style: Pe, - toggle_class: ot, - transition_in: Il, - transition_out: Ll, - update_slot_base: ha + SvelteComponent: Ys, + assign: Ks, + create_slot: $s, + detach: ea, + element: ta, + get_all_dirty_from_scope: na, + get_slot_changes: ra, + get_spread_update: ia, + init: oa, + insert: la, + safe_not_equal: sa, + set_dynamic_element_data: Pi, + set_style: Oe, + toggle_class: nt, + transition_in: Sl, + transition_out: kl, + update_slot_base: aa } = window.__gradio__svelte__internal; -function ma(e) { +function ua(e) { let t, n, r; const i = ( /*#slots*/ e[18].default - ), o = oa( + ), o = $s( i, e, /*$$scope*/ @@ -44,33 +44,33 @@ function ma(e) { } ], u = {}; for (let s = 0; s < l.length; s += 1) - u = ia(u, l[s]); + u = Ks(u, l[s]); return { c() { - t = sa( + t = ta( /*tag*/ e[14] - ), o && o.c(), Mi( + ), o && o.c(), Pi( /*tag*/ e[14] - )(t, u), ot( + )(t, u), nt( t, "hidden", /*visible*/ e[10] === !1 - ), ot( + ), nt( t, "padded", /*padding*/ e[6] - ), ot( + ), nt( t, "border_focus", /*border_mode*/ e[5] === "focus" - ), ot(t, "hide-container", !/*explicit_call*/ + ), nt(t, "hide-container", !/*explicit_call*/ e[8] && !/*container*/ - e[9]), Pe( + e[9]), Oe( t, "height", /*get_dimension*/ @@ -78,7 +78,7 @@ function ma(e) { /*height*/ e[0] ) - ), Pe(t, "width", typeof /*width*/ + ), Oe(t, "width", typeof /*width*/ e[1] == "number" ? `calc(min(${/*width*/ e[1]}px, 100%))` : ( /*get_dimension*/ @@ -86,50 +86,50 @@ function ma(e) { /*width*/ e[1] ) - )), Pe( + )), Oe( t, "border-style", /*variant*/ e[4] - ), Pe( + ), Oe( t, "overflow", /*allow_overflow*/ e[11] ? "visible" : "hidden" - ), Pe( + ), Oe( t, "flex-grow", /*scale*/ e[12] - ), Pe(t, "min-width", `calc(min(${/*min_width*/ - e[13]}px, 100%))`), Pe(t, "border-width", "var(--block-border-width)"); + ), Oe(t, "min-width", `calc(min(${/*min_width*/ + e[13]}px, 100%))`), Oe(t, "border-width", "var(--block-border-width)"); }, m(s, a) { - da(s, t, a), o && o.m(t, null), r = !0; + la(s, t, a), o && o.m(t, null), r = !0; }, p(s, a) { o && o.p && (!r || a & /*$$scope*/ - 131072) && ha( + 131072) && aa( o, i, s, /*$$scope*/ s[17], - r ? ua( + r ? ra( i, /*$$scope*/ s[17], a, null - ) : aa( + ) : na( /*$$scope*/ s[17] ), null - ), Mi( + ), Pi( /*tag*/ s[14] - )(t, u = fa(l, [ + )(t, u = ia(l, [ (!r || a & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -143,25 +143,25 @@ function ma(e) { (!r || a & /*elem_classes*/ 8 && n !== (n = "block " + /*elem_classes*/ s[3].join(" ") + " svelte-1t38q2d")) && { class: n } - ])), ot( + ])), nt( t, "hidden", /*visible*/ s[10] === !1 - ), ot( + ), nt( t, "padded", /*padding*/ s[6] - ), ot( + ), nt( t, "border_focus", /*border_mode*/ s[5] === "focus" - ), ot(t, "hide-container", !/*explicit_call*/ + ), nt(t, "hide-container", !/*explicit_call*/ s[8] && !/*container*/ s[9]), a & /*height*/ - 1 && Pe( + 1 && Oe( t, "height", /*get_dimension*/ @@ -170,7 +170,7 @@ function ma(e) { s[0] ) ), a & /*width*/ - 2 && Pe(t, "width", typeof /*width*/ + 2 && Oe(t, "width", typeof /*width*/ s[1] == "number" ? `calc(min(${/*width*/ s[1]}px, 100%))` : ( /*get_dimension*/ @@ -179,42 +179,42 @@ function ma(e) { s[1] ) )), a & /*variant*/ - 16 && Pe( + 16 && Oe( t, "border-style", /*variant*/ s[4] ), a & /*allow_overflow*/ - 2048 && Pe( + 2048 && Oe( t, "overflow", /*allow_overflow*/ s[11] ? "visible" : "hidden" ), a & /*scale*/ - 4096 && Pe( + 4096 && Oe( t, "flex-grow", /*scale*/ s[12] ), a & /*min_width*/ - 8192 && Pe(t, "min-width", `calc(min(${/*min_width*/ + 8192 && Oe(t, "min-width", `calc(min(${/*min_width*/ s[13]}px, 100%))`); }, i(s) { - r || (Il(o, s), r = !0); + r || (Sl(o, s), r = !0); }, o(s) { - Ll(o, s), r = !1; + kl(o, s), r = !1; }, d(s) { - s && la(t), o && o.d(s); + s && ea(t), o && o.d(s); } }; } -function pa(e) { +function fa(e) { let t, n = ( /*tag*/ - e[14] && ma(e) + e[14] && ua(e) ); return { c() { @@ -228,28 +228,28 @@ function pa(e) { r[14] && n.p(r, i); }, i(r) { - t || (Il(n, r), t = !0); + t || (Sl(n, r), t = !0); }, o(r) { - Ll(n, r), t = !1; + kl(n, r), t = !1; }, d(r) { n && n.d(r); } }; } -function ga(e, t, n) { - let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: u = "" } = t, { elem_classes: s = [] } = t, { variant: a = "solid" } = t, { border_mode: f = "base" } = t, { padding: d = !0 } = t, { type: c = "normal" } = t, { test_id: h = void 0 } = t, { explicit_call: _ = !1 } = t, { container: m = !0 } = t, { visible: g = !0 } = t, { allow_overflow: p = !0 } = t, { scale: v = null } = t, { min_width: b = 0 } = t, w = c === "fieldset" ? "fieldset" : "div"; - const y = (S) => { - if (S !== void 0) { - if (typeof S == "number") - return S + "px"; - if (typeof S == "string") - return S; +function ca(e, t, n) { + let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: u = "" } = t, { elem_classes: s = [] } = t, { variant: a = "solid" } = t, { border_mode: f = "base" } = t, { padding: d = !0 } = t, { type: c = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: h = !1 } = t, { container: p = !0 } = t, { visible: g = !0 } = t, { allow_overflow: m = !0 } = t, { scale: v = null } = t, { min_width: w = 0 } = t, b = c === "fieldset" ? "fieldset" : "div"; + const y = (k) => { + if (k !== void 0) { + if (typeof k == "number") + return k + "px"; + if (typeof k == "string") + return k; } }; - return e.$$set = (S) => { - "height" in S && n(0, o = S.height), "width" in S && n(1, l = S.width), "elem_id" in S && n(2, u = S.elem_id), "elem_classes" in S && n(3, s = S.elem_classes), "variant" in S && n(4, a = S.variant), "border_mode" in S && n(5, f = S.border_mode), "padding" in S && n(6, d = S.padding), "type" in S && n(16, c = S.type), "test_id" in S && n(7, h = S.test_id), "explicit_call" in S && n(8, _ = S.explicit_call), "container" in S && n(9, m = S.container), "visible" in S && n(10, g = S.visible), "allow_overflow" in S && n(11, p = S.allow_overflow), "scale" in S && n(12, v = S.scale), "min_width" in S && n(13, b = S.min_width), "$$scope" in S && n(17, i = S.$$scope); + return e.$$set = (k) => { + "height" in k && n(0, o = k.height), "width" in k && n(1, l = k.width), "elem_id" in k && n(2, u = k.elem_id), "elem_classes" in k && n(3, s = k.elem_classes), "variant" in k && n(4, a = k.variant), "border_mode" in k && n(5, f = k.border_mode), "padding" in k && n(6, d = k.padding), "type" in k && n(16, c = k.type), "test_id" in k && n(7, _ = k.test_id), "explicit_call" in k && n(8, h = k.explicit_call), "container" in k && n(9, p = k.container), "visible" in k && n(10, g = k.visible), "allow_overflow" in k && n(11, m = k.allow_overflow), "scale" in k && n(12, v = k.scale), "min_width" in k && n(13, w = k.min_width), "$$scope" in k && n(17, i = k.$$scope); }, [ o, l, @@ -258,23 +258,23 @@ function ga(e, t, n) { a, f, d, - h, _, - m, - g, + h, p, + g, + m, v, - b, w, + b, y, c, i, r ]; } -class ba extends ra { +class da extends Ys { constructor(t) { - super(), ca(this, t, ga, pa, _a, { + super(), oa(this, t, ca, fa, sa, { height: 0, width: 1, elem_id: 2, @@ -294,40 +294,40 @@ class ba extends ra { } } const { - SvelteComponent: wa, - append: dr, - attr: Tn, - create_component: va, - destroy_component: ya, - detach: Ea, - element: Di, - init: Sa, - insert: ka, - mount_component: Ta, - safe_not_equal: Aa, - set_data: Ba, - space: Ca, - text: Ia, - toggle_class: lt, - transition_in: La, - transition_out: Pa + SvelteComponent: _a, + append: fr, + attr: kn, + create_component: ha, + destroy_component: ma, + detach: pa, + element: Ni, + init: ga, + insert: ba, + mount_component: wa, + safe_not_equal: va, + set_data: ya, + space: Ea, + text: Sa, + toggle_class: rt, + transition_in: ka, + transition_out: Ta } = window.__gradio__svelte__internal; -function Oa(e) { +function Aa(e) { let t, n, r, i, o, l; return r = new /*Icon*/ e[1]({}), { c() { - t = Di("label"), n = Di("span"), va(r.$$.fragment), i = Ca(), o = Ia( + t = Ni("label"), n = Ni("span"), ha(r.$$.fragment), i = Ea(), o = Sa( /*label*/ e[0] - ), Tn(n, "class", "svelte-9gxdi0"), Tn(t, "for", ""), Tn(t, "data-testid", "block-label"), Tn(t, "class", "svelte-9gxdi0"), lt(t, "hide", !/*show_label*/ - e[2]), lt(t, "sr-only", !/*show_label*/ - e[2]), lt( + ), kn(n, "class", "svelte-9gxdi0"), kn(t, "for", ""), kn(t, "data-testid", "block-label"), kn(t, "class", "svelte-9gxdi0"), rt(t, "hide", !/*show_label*/ + e[2]), rt(t, "sr-only", !/*show_label*/ + e[2]), rt( t, "float", /*float*/ e[4] - ), lt( + ), rt( t, "hide-label", /*disable*/ @@ -335,26 +335,26 @@ function Oa(e) { ); }, m(u, s) { - ka(u, t, s), dr(t, n), Ta(r, n, null), dr(t, i), dr(t, o), l = !0; + ba(u, t, s), fr(t, n), wa(r, n, null), fr(t, i), fr(t, o), l = !0; }, p(u, [s]) { (!l || s & /*label*/ - 1) && Ba( + 1) && ya( o, /*label*/ u[0] ), (!l || s & /*show_label*/ - 4) && lt(t, "hide", !/*show_label*/ + 4) && rt(t, "hide", !/*show_label*/ u[2]), (!l || s & /*show_label*/ - 4) && lt(t, "sr-only", !/*show_label*/ + 4) && rt(t, "sr-only", !/*show_label*/ u[2]), (!l || s & /*float*/ - 16) && lt( + 16) && rt( t, "float", /*float*/ u[4] ), (!l || s & /*disable*/ - 8) && lt( + 8) && rt( t, "hide-label", /*disable*/ @@ -362,25 +362,25 @@ function Oa(e) { ); }, i(u) { - l || (La(r.$$.fragment, u), l = !0); + l || (ka(r.$$.fragment, u), l = !0); }, o(u) { - Pa(r.$$.fragment, u), l = !1; + Ta(r.$$.fragment, u), l = !1; }, d(u) { - u && Ea(t), ya(r); + u && pa(t), ma(r); } }; } -function Ha(e, t, n) { +function Ba(e, t, n) { let { label: r = null } = t, { Icon: i } = t, { show_label: o = !0 } = t, { disable: l = !1 } = t, { float: u = !0 } = t; return e.$$set = (s) => { "label" in s && n(0, r = s.label), "Icon" in s && n(1, i = s.Icon), "show_label" in s && n(2, o = s.show_label), "disable" in s && n(3, l = s.disable), "float" in s && n(4, u = s.float); }, [r, i, o, l, u]; } -class Pl extends wa { +class Tl extends _a { constructor(t) { - super(), Sa(this, t, Ha, Oa, Aa, { + super(), ga(this, t, Ba, Aa, va, { label: 0, Icon: 1, show_label: 2, @@ -390,66 +390,66 @@ class Pl extends wa { } } const { - SvelteComponent: Na, - append: zr, + SvelteComponent: Ca, + append: qr, attr: et, - bubble: Ma, - create_component: Da, - destroy_component: Ra, - detach: Ol, - element: Vr, - init: Ua, - insert: Hl, - listen: Fa, - mount_component: Ga, - safe_not_equal: qa, - set_data: ja, - set_style: An, - space: xa, - text: za, - toggle_class: Ne, - transition_in: Va, - transition_out: Xa + bubble: Ia, + create_component: La, + destroy_component: Oa, + detach: Al, + element: jr, + init: Pa, + insert: Bl, + listen: Na, + mount_component: Ha, + safe_not_equal: Da, + set_data: Ma, + set_style: Tn, + space: Ra, + text: Ua, + toggle_class: He, + transition_in: Fa, + transition_out: Ga } = window.__gradio__svelte__internal; -function Ri(e) { +function Hi(e) { let t, n; return { c() { - t = Vr("span"), n = za( + t = jr("span"), n = Ua( /*label*/ e[1] ), et(t, "class", "svelte-lpi64a"); }, m(r, i) { - Hl(r, t, i), zr(t, n); + Bl(r, t, i), qr(t, n); }, p(r, i) { i & /*label*/ - 2 && ja( + 2 && Ma( n, /*label*/ r[1] ); }, d(r) { - r && Ol(t); + r && Al(t); } }; } -function Wa(e) { +function qa(e) { let t, n, r, i, o, l, u, s = ( /*show_label*/ - e[2] && Ri(e) + e[2] && Hi(e) ); return i = new /*Icon*/ e[0]({}), { c() { - t = Vr("button"), s && s.c(), n = xa(), r = Vr("div"), Da(i.$$.fragment), et(r, "class", "svelte-lpi64a"), Ne( + t = jr("button"), s && s.c(), n = Ra(), r = jr("div"), La(i.$$.fragment), et(r, "class", "svelte-lpi64a"), He( r, "small", /*size*/ e[4] === "small" - ), Ne( + ), He( r, "large", /*size*/ @@ -470,39 +470,39 @@ function Wa(e) { "title", /*label*/ e[1] - ), et(t, "class", "svelte-lpi64a"), Ne( + ), et(t, "class", "svelte-lpi64a"), He( t, "pending", /*pending*/ e[3] - ), Ne( + ), He( t, "padded", /*padded*/ e[5] - ), Ne( + ), He( t, "highlight", /*highlight*/ e[6] - ), Ne( + ), He( t, "transparent", /*transparent*/ e[9] - ), An(t, "color", !/*disabled*/ + ), Tn(t, "color", !/*disabled*/ e[7] && /*_color*/ e[11] ? ( /*_color*/ e[11] - ) : "var(--block-label-text-color)"), An(t, "--bg-color", /*disabled*/ + ) : "var(--block-label-text-color)"), Tn(t, "--bg-color", /*disabled*/ e[7] ? "auto" : ( /*background*/ e[10] )); }, m(a, f) { - Hl(a, t, f), s && s.m(t, null), zr(t, n), zr(t, r), Ga(i, r, null), o = !0, l || (u = Fa( + Bl(a, t, f), s && s.m(t, null), qr(t, n), qr(t, r), Ha(i, r, null), o = !0, l || (u = Na( t, "click", /*click_handler*/ @@ -511,14 +511,14 @@ function Wa(e) { }, p(a, [f]) { /*show_label*/ - a[2] ? s ? s.p(a, f) : (s = Ri(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/ - 16) && Ne( + a[2] ? s ? s.p(a, f) : (s = Hi(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/ + 16) && He( r, "small", /*size*/ a[4] === "small" ), (!o || f & /*size*/ - 16) && Ne( + 16) && He( r, "large", /*size*/ @@ -544,63 +544,63 @@ function Wa(e) { /*label*/ a[1] ), (!o || f & /*pending*/ - 8) && Ne( + 8) && He( t, "pending", /*pending*/ a[3] ), (!o || f & /*padded*/ - 32) && Ne( + 32) && He( t, "padded", /*padded*/ a[5] ), (!o || f & /*highlight*/ - 64) && Ne( + 64) && He( t, "highlight", /*highlight*/ a[6] ), (!o || f & /*transparent*/ - 512) && Ne( + 512) && He( t, "transparent", /*transparent*/ a[9] ), f & /*disabled, _color*/ - 2176 && An(t, "color", !/*disabled*/ + 2176 && Tn(t, "color", !/*disabled*/ a[7] && /*_color*/ a[11] ? ( /*_color*/ a[11] ) : "var(--block-label-text-color)"), f & /*disabled, background*/ - 1152 && An(t, "--bg-color", /*disabled*/ + 1152 && Tn(t, "--bg-color", /*disabled*/ a[7] ? "auto" : ( /*background*/ a[10] )); }, i(a) { - o || (Va(i.$$.fragment, a), o = !0); + o || (Fa(i.$$.fragment, a), o = !0); }, o(a) { - Xa(i.$$.fragment, a), o = !1; + Ga(i.$$.fragment, a), o = !1; }, d(a) { - a && Ol(t), s && s.d(), Ra(i), l = !1, u(); + a && Al(t), s && s.d(), Oa(i), l = !1, u(); } }; } -function Za(e, t, n) { - let r, { Icon: i } = t, { label: o = "" } = t, { show_label: l = !1 } = t, { pending: u = !1 } = t, { size: s = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: d = !1 } = t, { hasPopup: c = !1 } = t, { color: h = "var(--block-label-text-color)" } = t, { transparent: _ = !1 } = t, { background: m = "var(--background-fill-primary)" } = t; - function g(p) { - Ma.call(this, e, p); +function ja(e, t, n) { + let r, { Icon: i } = t, { label: o = "" } = t, { show_label: l = !1 } = t, { pending: u = !1 } = t, { size: s = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: d = !1 } = t, { hasPopup: c = !1 } = t, { color: _ = "var(--block-label-text-color)" } = t, { transparent: h = !1 } = t, { background: p = "var(--background-fill-primary)" } = t; + function g(m) { + Ia.call(this, e, m); } - return e.$$set = (p) => { - "Icon" in p && n(0, i = p.Icon), "label" in p && n(1, o = p.label), "show_label" in p && n(2, l = p.show_label), "pending" in p && n(3, u = p.pending), "size" in p && n(4, s = p.size), "padded" in p && n(5, a = p.padded), "highlight" in p && n(6, f = p.highlight), "disabled" in p && n(7, d = p.disabled), "hasPopup" in p && n(8, c = p.hasPopup), "color" in p && n(12, h = p.color), "transparent" in p && n(9, _ = p.transparent), "background" in p && n(10, m = p.background); + return e.$$set = (m) => { + "Icon" in m && n(0, i = m.Icon), "label" in m && n(1, o = m.label), "show_label" in m && n(2, l = m.show_label), "pending" in m && n(3, u = m.pending), "size" in m && n(4, s = m.size), "padded" in m && n(5, a = m.padded), "highlight" in m && n(6, f = m.highlight), "disabled" in m && n(7, d = m.disabled), "hasPopup" in m && n(8, c = m.hasPopup), "color" in m && n(12, _ = m.color), "transparent" in m && n(9, h = m.transparent), "background" in m && n(10, p = m.background); }, e.$$.update = () => { e.$$.dirty & /*highlight, color*/ - 4160 && n(11, r = f ? "var(--color-accent)" : h); + 4160 && n(11, r = f ? "var(--color-accent)" : _); }, [ i, o, @@ -611,16 +611,16 @@ function Za(e, t, n) { f, d, c, - _, - m, - r, h, + p, + r, + _, g ]; } -class Jt extends Na { +class dn extends Ca { constructor(t) { - super(), Ua(this, t, Za, Wa, qa, { + super(), Pa(this, t, ja, qa, Da, { Icon: 0, label: 1, show_label: 2, @@ -637,29 +637,29 @@ class Jt extends Na { } } const { - SvelteComponent: Ja, - append: Qa, - attr: _r, - binding_callbacks: Ya, - create_slot: Ka, - detach: $a, - element: Ui, - get_all_dirty_from_scope: eu, - get_slot_changes: tu, - init: nu, - insert: ru, - safe_not_equal: iu, - toggle_class: st, - transition_in: ou, - transition_out: lu, - update_slot_base: su + SvelteComponent: xa, + append: za, + attr: cr, + binding_callbacks: Va, + create_slot: Xa, + detach: Wa, + element: Di, + get_all_dirty_from_scope: Za, + get_slot_changes: Ja, + init: Qa, + insert: Ya, + safe_not_equal: Ka, + toggle_class: it, + transition_in: $a, + transition_out: eu, + update_slot_base: tu } = window.__gradio__svelte__internal; -function au(e) { +function nu(e) { let t, n, r; const i = ( /*#slots*/ e[5].default - ), o = Ka( + ), o = Xa( i, e, /*$$scope*/ @@ -668,22 +668,22 @@ function au(e) { ); return { c() { - t = Ui("div"), n = Ui("div"), o && o.c(), _r(n, "class", "icon svelte-3w3rth"), _r(t, "class", "empty svelte-3w3rth"), _r(t, "aria-label", "Empty value"), st( + t = Di("div"), n = Di("div"), o && o.c(), cr(n, "class", "icon svelte-3w3rth"), cr(t, "class", "empty svelte-3w3rth"), cr(t, "aria-label", "Empty value"), it( t, "small", /*size*/ e[0] === "small" - ), st( + ), it( t, "large", /*size*/ e[0] === "large" - ), st( + ), it( t, "unpadded_box", /*unpadded_box*/ e[1] - ), st( + ), it( t, "small_parent", /*parent_height*/ @@ -691,47 +691,47 @@ function au(e) { ); }, m(l, u) { - ru(l, t, u), Qa(t, n), o && o.m(n, null), e[6](t), r = !0; + Ya(l, t, u), za(t, n), o && o.m(n, null), e[6](t), r = !0; }, p(l, [u]) { o && o.p && (!r || u & /*$$scope*/ - 16) && su( + 16) && tu( o, i, l, /*$$scope*/ l[4], - r ? tu( + r ? Ja( i, /*$$scope*/ l[4], u, null - ) : eu( + ) : Za( /*$$scope*/ l[4] ), null ), (!r || u & /*size*/ - 1) && st( + 1) && it( t, "small", /*size*/ l[0] === "small" ), (!r || u & /*size*/ - 1) && st( + 1) && it( t, "large", /*size*/ l[0] === "large" ), (!r || u & /*unpadded_box*/ - 2) && st( + 2) && it( t, "unpadded_box", /*unpadded_box*/ l[1] ), (!r || u & /*parent_height*/ - 8) && st( + 8) && it( t, "small_parent", /*parent_height*/ @@ -739,17 +739,17 @@ function au(e) { ); }, i(l) { - r || (ou(o, l), r = !0); + r || ($a(o, l), r = !0); }, o(l) { - lu(o, l), r = !1; + eu(o, l), r = !1; }, d(l) { - l && $a(t), o && o.d(l), e[6](null); + l && Wa(t), o && o.d(l), e[6](null); } }; } -function uu(e) { +function ru(e) { let t, n = e[0], r = 1; for (; r < e.length; ) { const i = e[r], o = e[r + 1]; @@ -759,24 +759,24 @@ function uu(e) { } return n; } -function fu(e, t, n) { +function iu(e, t, n) { let r, { $$slots: i = {}, $$scope: o } = t, { size: l = "small" } = t, { unpadded_box: u = !1 } = t, s; function a(d) { if (!d) return !1; - const { height: c } = d.getBoundingClientRect(), { height: h } = uu([ + const { height: c } = d.getBoundingClientRect(), { height: _ } = ru([ d, "access", - (_) => _.parentElement, + (h) => h.parentElement, "optionalAccess", - (_) => _.getBoundingClientRect, + (h) => h.getBoundingClientRect, "call", - (_) => _() + (h) => h() ]) || { height: c }; - return c > h + 2; + return c > _ + 2; } function f(d) { - Ya[d ? "unshift" : "push"](() => { + Va[d ? "unshift" : "push"](() => { s = d, n(2, s); }); } @@ -787,310 +787,277 @@ function fu(e, t, n) { 4 && n(3, r = a(s)); }, [l, u, s, r, o, i, f]; } -class cu extends Ja { +class ou extends xa { constructor(t) { - super(), nu(this, t, fu, au, iu, { size: 0, unpadded_box: 1 }); + super(), Qa(this, t, iu, nu, Ka, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: du, - append: hr, - attr: qe, - detach: _u, - init: hu, - insert: mu, - noop: mr, - safe_not_equal: pu, - set_style: Je, - svg_element: Bn + SvelteComponent: lu, + append: dr, + attr: Fe, + detach: su, + init: au, + insert: uu, + noop: _r, + safe_not_equal: fu, + set_style: Ze, + svg_element: An } = window.__gradio__svelte__internal; -function gu(e) { +function cu(e) { let t, n, r, i; return { c() { - t = Bn("svg"), n = Bn("g"), r = Bn("path"), i = Bn("path"), qe(r, "d", "M18,6L6.087,17.913"), Je(r, "fill", "none"), Je(r, "fill-rule", "nonzero"), Je(r, "stroke-width", "2px"), qe(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), qe(i, "d", "M4.364,4.364L19.636,19.636"), Je(i, "fill", "none"), Je(i, "fill-rule", "nonzero"), Je(i, "stroke-width", "2px"), qe(t, "width", "100%"), qe(t, "height", "100%"), qe(t, "viewBox", "0 0 24 24"), qe(t, "version", "1.1"), qe(t, "xmlns", "http://www.w3.org/2000/svg"), qe(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), qe(t, "xml:space", "preserve"), qe(t, "stroke", "currentColor"), Je(t, "fill-rule", "evenodd"), Je(t, "clip-rule", "evenodd"), Je(t, "stroke-linecap", "round"), Je(t, "stroke-linejoin", "round"); + t = An("svg"), n = An("g"), r = An("path"), i = An("path"), Fe(r, "d", "M18,6L6.087,17.913"), Ze(r, "fill", "none"), Ze(r, "fill-rule", "nonzero"), Ze(r, "stroke-width", "2px"), Fe(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Fe(i, "d", "M4.364,4.364L19.636,19.636"), Ze(i, "fill", "none"), Ze(i, "fill-rule", "nonzero"), Ze(i, "stroke-width", "2px"), Fe(t, "width", "100%"), Fe(t, "height", "100%"), Fe(t, "viewBox", "0 0 24 24"), Fe(t, "version", "1.1"), Fe(t, "xmlns", "http://www.w3.org/2000/svg"), Fe(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Fe(t, "xml:space", "preserve"), Fe(t, "stroke", "currentColor"), Ze(t, "fill-rule", "evenodd"), Ze(t, "clip-rule", "evenodd"), Ze(t, "stroke-linecap", "round"), Ze(t, "stroke-linejoin", "round"); }, m(o, l) { - mu(o, t, l), hr(t, n), hr(n, r), hr(t, i); + uu(o, t, l), dr(t, n), dr(n, r), dr(t, i); }, - p: mr, - i: mr, - o: mr, + p: _r, + i: _r, + o: _r, d(o) { - o && _u(t); - } - }; -} -class bu extends du { - constructor(t) { - super(), hu(this, t, null, gu, pu, {}); - } -} -const { - SvelteComponent: wu, - append: vu, - attr: en, - detach: yu, - init: Eu, - insert: Su, - noop: pr, - safe_not_equal: ku, - svg_element: Fi -} = window.__gradio__svelte__internal; -function Tu(e) { - let t, n; - return { - c() { - t = Fi("svg"), n = Fi("path"), en(n, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), en(n, "fill", "currentColor"), en(t, "id", "icon"), en(t, "xmlns", "http://www.w3.org/2000/svg"), en(t, "viewBox", "0 0 32 32"); - }, - m(r, i) { - Su(r, t, i), vu(t, n); - }, - p: pr, - i: pr, - o: pr, - d(r) { - r && yu(t); + o && su(t); } }; } -class Au extends wu { +class du extends lu { constructor(t) { - super(), Eu(this, t, null, Tu, ku, {}); + super(), au(this, t, null, cu, fu, {}); } } const { - SvelteComponent: Bu, - append: Cu, - attr: Nt, - detach: Iu, - init: Lu, - insert: Pu, - noop: gr, - safe_not_equal: Ou, - svg_element: Gi + SvelteComponent: _u, + append: hu, + attr: Ht, + detach: mu, + init: pu, + insert: gu, + noop: hr, + safe_not_equal: bu, + svg_element: Mi } = window.__gradio__svelte__internal; -function Hu(e) { +function wu(e) { let t, n; return { c() { - t = Gi("svg"), n = Gi("path"), Nt(n, "fill", "currentColor"), Nt(n, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Nt(t, "xmlns", "http://www.w3.org/2000/svg"), Nt(t, "width", "100%"), Nt(t, "height", "100%"), Nt(t, "viewBox", "0 0 32 32"); + t = Mi("svg"), n = Mi("path"), Ht(n, "fill", "currentColor"), Ht(n, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Ht(t, "xmlns", "http://www.w3.org/2000/svg"), Ht(t, "width", "100%"), Ht(t, "height", "100%"), Ht(t, "viewBox", "0 0 32 32"); }, m(r, i) { - Pu(r, t, i), Cu(t, n); + gu(r, t, i), hu(t, n); }, - p: gr, - i: gr, - o: gr, + p: hr, + i: hr, + o: hr, d(r) { - r && Iu(t); + r && mu(t); } }; } -class Nl extends Bu { +class Cl extends _u { constructor(t) { - super(), Lu(this, t, null, Hu, Ou, {}); + super(), pu(this, t, null, wu, bu, {}); } } const { - SvelteComponent: Nu, - append: Mu, - attr: je, - detach: Du, - init: Ru, - insert: Uu, - noop: br, - safe_not_equal: Fu, - svg_element: qi + SvelteComponent: vu, + append: yu, + attr: Ge, + detach: Eu, + init: Su, + insert: ku, + noop: mr, + safe_not_equal: Tu, + svg_element: Ri } = window.__gradio__svelte__internal; -function Gu(e) { +function Au(e) { let t, n; return { c() { - t = qi("svg"), n = qi("path"), je(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), je(t, "xmlns", "http://www.w3.org/2000/svg"), je(t, "width", "100%"), je(t, "height", "100%"), je(t, "viewBox", "0 0 24 24"), je(t, "fill", "none"), je(t, "stroke", "currentColor"), je(t, "stroke-width", "1.5"), je(t, "stroke-linecap", "round"), je(t, "stroke-linejoin", "round"), je(t, "class", "feather feather-edit-2"); + t = Ri("svg"), n = Ri("path"), Ge(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), Ge(t, "xmlns", "http://www.w3.org/2000/svg"), Ge(t, "width", "100%"), Ge(t, "height", "100%"), Ge(t, "viewBox", "0 0 24 24"), Ge(t, "fill", "none"), Ge(t, "stroke", "currentColor"), Ge(t, "stroke-width", "1.5"), Ge(t, "stroke-linecap", "round"), Ge(t, "stroke-linejoin", "round"), Ge(t, "class", "feather feather-edit-2"); }, m(r, i) { - Uu(r, t, i), Mu(t, n); + ku(r, t, i), yu(t, n); }, - p: br, - i: br, - o: br, + p: mr, + i: mr, + o: mr, d(r) { - r && Du(t); + r && Eu(t); } }; } -class qu extends Nu { +class Bu extends vu { constructor(t) { - super(), Ru(this, t, null, Gu, Fu, {}); + super(), Su(this, t, null, Au, Tu, {}); } } const { - SvelteComponent: ju, - append: ji, - attr: Me, - detach: xu, - init: zu, - insert: Vu, - noop: wr, - safe_not_equal: Xu, - svg_element: vr + SvelteComponent: Cu, + append: Ui, + attr: De, + detach: Iu, + init: Lu, + insert: Ou, + noop: pr, + safe_not_equal: Pu, + svg_element: gr } = window.__gradio__svelte__internal; -function Wu(e) { +function Nu(e) { let t, n, r; return { c() { - t = vr("svg"), n = vr("path"), r = vr("polyline"), Me(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), Me(r, "points", "13 2 13 9 20 9"), Me(t, "xmlns", "http://www.w3.org/2000/svg"), Me(t, "width", "100%"), Me(t, "height", "100%"), Me(t, "viewBox", "0 0 24 24"), Me(t, "fill", "none"), Me(t, "stroke", "currentColor"), Me(t, "stroke-width", "1.5"), Me(t, "stroke-linecap", "round"), Me(t, "stroke-linejoin", "round"), Me(t, "class", "feather feather-file"); + t = gr("svg"), n = gr("path"), r = gr("polyline"), De(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), De(r, "points", "13 2 13 9 20 9"), De(t, "xmlns", "http://www.w3.org/2000/svg"), De(t, "width", "100%"), De(t, "height", "100%"), De(t, "viewBox", "0 0 24 24"), De(t, "fill", "none"), De(t, "stroke", "currentColor"), De(t, "stroke-width", "1.5"), De(t, "stroke-linecap", "round"), De(t, "stroke-linejoin", "round"), De(t, "class", "feather feather-file"); }, m(i, o) { - Vu(i, t, o), ji(t, n), ji(t, r); + Ou(i, t, o), Ui(t, n), Ui(t, r); }, - p: wr, - i: wr, - o: wr, + p: pr, + i: pr, + o: pr, d(i) { - i && xu(t); + i && Iu(t); } }; } -let Zu = class extends ju { +let Hu = class extends Cu { constructor(t) { - super(), zu(this, t, null, Wu, Xu, {}); + super(), Lu(this, t, null, Nu, Pu, {}); } }; const { - SvelteComponent: Ju, - append: yr, + SvelteComponent: Du, + append: br, attr: he, - detach: Qu, - init: Yu, - insert: Ku, - noop: Er, - safe_not_equal: $u, - svg_element: Cn + detach: Mu, + init: Ru, + insert: Uu, + noop: wr, + safe_not_equal: Fu, + svg_element: Bn } = window.__gradio__svelte__internal; -function ef(e) { +function Gu(e) { let t, n, r, i; return { c() { - t = Cn("svg"), n = Cn("rect"), r = Cn("circle"), i = Cn("polyline"), he(n, "x", "3"), he(n, "y", "3"), he(n, "width", "18"), he(n, "height", "18"), he(n, "rx", "2"), he(n, "ry", "2"), he(r, "cx", "8.5"), he(r, "cy", "8.5"), he(r, "r", "1.5"), he(i, "points", "21 15 16 10 5 21"), he(t, "xmlns", "http://www.w3.org/2000/svg"), he(t, "width", "100%"), he(t, "height", "100%"), he(t, "viewBox", "0 0 24 24"), he(t, "fill", "none"), he(t, "stroke", "currentColor"), he(t, "stroke-width", "1.5"), he(t, "stroke-linecap", "round"), he(t, "stroke-linejoin", "round"), he(t, "class", "feather feather-image"); + t = Bn("svg"), n = Bn("rect"), r = Bn("circle"), i = Bn("polyline"), he(n, "x", "3"), he(n, "y", "3"), he(n, "width", "18"), he(n, "height", "18"), he(n, "rx", "2"), he(n, "ry", "2"), he(r, "cx", "8.5"), he(r, "cy", "8.5"), he(r, "r", "1.5"), he(i, "points", "21 15 16 10 5 21"), he(t, "xmlns", "http://www.w3.org/2000/svg"), he(t, "width", "100%"), he(t, "height", "100%"), he(t, "viewBox", "0 0 24 24"), he(t, "fill", "none"), he(t, "stroke", "currentColor"), he(t, "stroke-width", "1.5"), he(t, "stroke-linecap", "round"), he(t, "stroke-linejoin", "round"), he(t, "class", "feather feather-image"); }, m(o, l) { - Ku(o, t, l), yr(t, n), yr(t, r), yr(t, i); + Uu(o, t, l), br(t, n), br(t, r), br(t, i); }, - p: Er, - i: Er, - o: Er, + p: wr, + i: wr, + o: wr, d(o) { - o && Qu(t); + o && Mu(t); } }; } -let Ml = class extends Ju { +let Il = class extends Du { constructor(t) { - super(), Yu(this, t, null, ef, $u, {}); + super(), Ru(this, t, null, Gu, Fu, {}); } }; const { - SvelteComponent: tf, - append: nf, - attr: Mt, - detach: rf, - init: of, - insert: lf, - noop: Sr, - safe_not_equal: sf, - svg_element: xi + SvelteComponent: qu, + append: ju, + attr: Dt, + detach: xu, + init: zu, + insert: Vu, + noop: vr, + safe_not_equal: Xu, + svg_element: Fi } = window.__gradio__svelte__internal; -function af(e) { +function Wu(e) { let t, n; return { c() { - t = xi("svg"), n = xi("path"), Mt(n, "fill", "currentColor"), Mt(n, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a3.99 3.99 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z"), Mt(t, "xmlns", "http://www.w3.org/2000/svg"), Mt(t, "width", "100%"), Mt(t, "height", "100%"), Mt(t, "viewBox", "0 0 24 24"); + t = Fi("svg"), n = Fi("path"), Dt(n, "fill", "currentColor"), Dt(n, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a3.99 3.99 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z"), Dt(t, "xmlns", "http://www.w3.org/2000/svg"), Dt(t, "width", "100%"), Dt(t, "height", "100%"), Dt(t, "viewBox", "0 0 24 24"); }, m(r, i) { - lf(r, t, i), nf(t, n); + Vu(r, t, i), ju(t, n); }, - p: Sr, - i: Sr, - o: Sr, + p: vr, + i: vr, + o: vr, d(r) { - r && rf(t); + r && xu(t); } }; } -class uf extends tf { +class Zu extends qu { constructor(t) { - super(), of(this, t, null, af, sf, {}); + super(), zu(this, t, null, Wu, Xu, {}); } } const { - SvelteComponent: ff, - append: zi, - attr: De, - detach: cf, - init: df, - insert: _f, - noop: kr, - safe_not_equal: hf, - svg_element: Tr + SvelteComponent: Ju, + append: Gi, + attr: Me, + detach: Qu, + init: Yu, + insert: Ku, + noop: yr, + safe_not_equal: $u, + svg_element: Er } = window.__gradio__svelte__internal; -function mf(e) { +function ef(e) { let t, n, r; return { c() { - t = Tr("svg"), n = Tr("polyline"), r = Tr("path"), De(n, "points", "1 4 1 10 7 10"), De(r, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), De(t, "xmlns", "http://www.w3.org/2000/svg"), De(t, "width", "100%"), De(t, "height", "100%"), De(t, "viewBox", "0 0 24 24"), De(t, "fill", "none"), De(t, "stroke", "currentColor"), De(t, "stroke-width", "2"), De(t, "stroke-linecap", "round"), De(t, "stroke-linejoin", "round"), De(t, "class", "feather feather-rotate-ccw"); + t = Er("svg"), n = Er("polyline"), r = Er("path"), Me(n, "points", "1 4 1 10 7 10"), Me(r, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Me(t, "xmlns", "http://www.w3.org/2000/svg"), Me(t, "width", "100%"), Me(t, "height", "100%"), Me(t, "viewBox", "0 0 24 24"), Me(t, "fill", "none"), Me(t, "stroke", "currentColor"), Me(t, "stroke-width", "2"), Me(t, "stroke-linecap", "round"), Me(t, "stroke-linejoin", "round"), Me(t, "class", "feather feather-rotate-ccw"); }, m(i, o) { - _f(i, t, o), zi(t, n), zi(t, r); + Ku(i, t, o), Gi(t, n), Gi(t, r); }, - p: kr, - i: kr, - o: kr, + p: yr, + i: yr, + o: yr, d(i) { - i && cf(t); + i && Qu(t); } }; } -class pf extends ff { +class tf extends Ju { constructor(t) { - super(), df(this, t, null, mf, hf, {}); + super(), Yu(this, t, null, ef, $u, {}); } } const { - SvelteComponent: gf, - append: Ar, + SvelteComponent: nf, + append: Sr, attr: ve, - detach: bf, - init: wf, - insert: vf, - noop: Br, - safe_not_equal: yf, - svg_element: In + detach: rf, + init: of, + insert: lf, + noop: kr, + safe_not_equal: sf, + svg_element: Cn } = window.__gradio__svelte__internal; -function Ef(e) { +function af(e) { let t, n, r, i; return { c() { - t = In("svg"), n = In("path"), r = In("polyline"), i = In("line"), ve(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ve(r, "points", "17 8 12 3 7 8"), ve(i, "x1", "12"), ve(i, "y1", "3"), ve(i, "x2", "12"), ve(i, "y2", "15"), ve(t, "xmlns", "http://www.w3.org/2000/svg"), ve(t, "width", "90%"), ve(t, "height", "90%"), ve(t, "viewBox", "0 0 24 24"), ve(t, "fill", "none"), ve(t, "stroke", "currentColor"), ve(t, "stroke-width", "2"), ve(t, "stroke-linecap", "round"), ve(t, "stroke-linejoin", "round"), ve(t, "class", "feather feather-upload"); + t = Cn("svg"), n = Cn("path"), r = Cn("polyline"), i = Cn("line"), ve(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), ve(r, "points", "17 8 12 3 7 8"), ve(i, "x1", "12"), ve(i, "y1", "3"), ve(i, "x2", "12"), ve(i, "y2", "15"), ve(t, "xmlns", "http://www.w3.org/2000/svg"), ve(t, "width", "90%"), ve(t, "height", "90%"), ve(t, "viewBox", "0 0 24 24"), ve(t, "fill", "none"), ve(t, "stroke", "currentColor"), ve(t, "stroke-width", "2"), ve(t, "stroke-linecap", "round"), ve(t, "stroke-linejoin", "round"), ve(t, "class", "feather feather-upload"); }, m(o, l) { - vf(o, t, l), Ar(t, n), Ar(t, r), Ar(t, i); + lf(o, t, l), Sr(t, n), Sr(t, r), Sr(t, i); }, - p: Br, - i: Br, - o: Br, + p: kr, + i: kr, + o: kr, d(o) { - o && bf(t); + o && rf(t); } }; } -let Sf = class extends gf { +let uf = class extends nf { constructor(t) { - super(), wf(this, t, null, Ef, yf, {}); + super(), of(this, t, null, af, sf, {}); } }; -const kf = [ +const ff = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -1101,7 +1068,7 @@ const kf = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], Vi = { +], qi = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -1394,203 +1361,78 @@ const kf = [ 950: "#4c0519" } }; -kf.reduce( +ff.reduce( (e, { color: t, primary: n, secondary: r }) => ({ ...e, [t]: { - primary: Vi[t][n], - secondary: Vi[t][r] + primary: qi[t][n], + secondary: qi[t][r] } }), {} ); -function Tf(e) { - let t, n = e[0], r = 1; - for (; r < e.length; ) { - const i = e[r], o = e[r + 1]; - if (r += 2, (i === "optionalAccess" || i === "optionalCall") && n == null) - return; - i === "access" || i === "optionalAccess" ? (t = n, n = o(n)) : (i === "call" || i === "optionalCall") && (n = o((...l) => n.call(t, ...l)), t = void 0); - } - return n; -} -class Nn extends Error { - constructor(t) { - super(t), this.name = "ShareError"; - } -} -async function Af(e, t) { - if (window.__gradio_space__ == null) - throw new Nn("Must be on Spaces to share."); - let n, r, i; - if (t === "url") { - const s = await fetch(e); - n = await s.blob(), r = s.headers.get("content-type") || "", i = s.headers.get("content-disposition") || ""; - } else - n = Bf(e), r = e.split(";")[0].split(":")[1], i = "file" + r.split("/")[1]; - const o = new File([n], i, { type: r }), l = await fetch("https://huggingface.co/uploads", { - method: "POST", - body: o, - headers: { - "Content-Type": o.type, - "X-Requested-With": "XMLHttpRequest" - } - }); - if (!l.ok) { - if (Tf([l, "access", (s) => s.headers, "access", (s) => s.get, "call", (s) => s("content-type"), "optionalAccess", (s) => s.includes, "call", (s) => s("application/json")])) { - const s = await l.json(); - throw new Nn(`Upload failed: ${s.error}`); - } - throw new Nn("Upload failed."); - } - return await l.text(); -} -function Bf(e) { - for (var t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]), i = r.length, o = new Uint8Array(i); i--; ) - o[i] = r.charCodeAt(i); - return new Blob([o], { type: n }); -} -const { - SvelteComponent: Cf, - create_component: If, - destroy_component: Lf, - init: Pf, - mount_component: Of, - safe_not_equal: Hf, - transition_in: Nf, - transition_out: Mf -} = window.__gradio__svelte__internal, { createEventDispatcher: Df } = window.__gradio__svelte__internal; -function Rf(e) { - let t, n; - return t = new Jt({ - props: { - Icon: Au, - label: ( - /*i18n*/ - e[2]("common.share") - ), - pending: ( - /*pending*/ - e[3] - ) - } - }), t.$on( - "click", - /*click_handler*/ - e[5] - ), { - c() { - If(t.$$.fragment); - }, - m(r, i) { - Of(t, r, i), n = !0; - }, - p(r, [i]) { - const o = {}; - i & /*i18n*/ - 4 && (o.label = /*i18n*/ - r[2]("common.share")), i & /*pending*/ - 8 && (o.pending = /*pending*/ - r[3]), t.$set(o); - }, - i(r) { - n || (Nf(t.$$.fragment, r), n = !0); - }, - o(r) { - Mf(t.$$.fragment, r), n = !1; - }, - d(r) { - Lf(t, r); - } - }; -} -function Uf(e, t, n) { - const r = Df(); - let { formatter: i } = t, { value: o } = t, { i18n: l } = t, u = !1; - const s = async () => { - try { - n(3, u = !0); - const a = await i(o); - r("share", { description: a }); - } catch (a) { - console.error(a); - let f = a instanceof Nn ? a.message : "Share failed."; - r("error", f); - } finally { - n(3, u = !1); - } - }; - return e.$$set = (a) => { - "formatter" in a && n(0, i = a.formatter), "value" in a && n(1, o = a.value), "i18n" in a && n(2, l = a.i18n); - }, [i, o, l, u, r, s]; -} -class Ff extends Cf { - constructor(t) { - super(), Pf(this, t, Uf, Rf, Hf, { formatter: 0, value: 1, i18n: 2 }); - } -} const { - SvelteComponent: Gf, - append: yt, - attr: Xr, - check_outros: qf, - create_component: Dl, - destroy_component: Rl, - detach: Mn, - element: Wr, - group_outros: jf, - init: xf, - insert: Dn, - mount_component: Ul, - safe_not_equal: zf, - set_data: Zr, - space: Jr, - text: rn, - toggle_class: Xi, - transition_in: Gn, - transition_out: qn + SvelteComponent: cf, + append: wt, + attr: xr, + check_outros: df, + create_component: Ll, + destroy_component: Ol, + detach: Nn, + element: zr, + group_outros: _f, + init: hf, + insert: Hn, + mount_component: Pl, + safe_not_equal: mf, + set_data: Vr, + space: Xr, + text: tn, + toggle_class: ji, + transition_in: Un, + transition_out: Fn } = window.__gradio__svelte__internal; -function Vf(e) { +function pf(e) { let t, n; - return t = new Sf({}), { + return t = new uf({}), { c() { - Dl(t.$$.fragment); + Ll(t.$$.fragment); }, m(r, i) { - Ul(t, r, i), n = !0; + Pl(t, r, i), n = !0; }, i(r) { - n || (Gn(t.$$.fragment, r), n = !0); + n || (Un(t.$$.fragment, r), n = !0); }, o(r) { - qn(t.$$.fragment, r), n = !1; + Fn(t.$$.fragment, r), n = !1; }, d(r) { - Rl(t, r); + Ol(t, r); } }; } -function Xf(e) { +function gf(e) { let t, n; - return t = new uf({}), { + return t = new Zu({}), { c() { - Dl(t.$$.fragment); + Ll(t.$$.fragment); }, m(r, i) { - Ul(t, r, i), n = !0; + Pl(t, r, i), n = !0; }, i(r) { - n || (Gn(t.$$.fragment, r), n = !0); + n || (Un(t.$$.fragment, r), n = !0); }, o(r) { - qn(t.$$.fragment, r), n = !1; + Fn(t.$$.fragment, r), n = !1; }, d(r) { - Rl(t, r); + Ol(t, r); } }; } -function Wi(e) { +function xi(e) { let t, n, r = ( /*i18n*/ e[1]("common.or") + "" @@ -1601,25 +1443,25 @@ function Wi(e) { ), s; return { c() { - t = Wr("span"), n = rn("- "), i = rn(r), o = rn(" -"), l = Jr(), s = rn(u), Xr(t, "class", "or svelte-kzcjhc"); + t = zr("span"), n = tn("- "), i = tn(r), o = tn(" -"), l = Xr(), s = tn(u), xr(t, "class", "or svelte-kzcjhc"); }, m(a, f) { - Dn(a, t, f), yt(t, n), yt(t, i), yt(t, o), Dn(a, l, f), Dn(a, s, f); + Hn(a, t, f), wt(t, n), wt(t, i), wt(t, o), Hn(a, l, f), Hn(a, s, f); }, p(a, f) { f & /*i18n*/ 2 && r !== (r = /*i18n*/ - a[1]("common.or") + "") && Zr(i, r), f & /*message, i18n*/ + a[1]("common.or") + "") && Vr(i, r), f & /*message, i18n*/ 6 && u !== (u = /*message*/ (a[2] || /*i18n*/ - a[1]("upload_text.click_to_upload")) + "") && Zr(s, u); + a[1]("upload_text.click_to_upload")) + "") && Vr(s, u); }, d(a) { - a && (Mn(t), Mn(l), Mn(s)); + a && (Nn(t), Nn(l), Nn(s)); } }; } -function Wf(e) { +function bf(e) { let t, n, r, i, o, l = ( /*i18n*/ e[1]( @@ -1631,64 +1473,64 @@ function Wf(e) { e[5].file ) + "" ), u, s, a; - const f = [Xf, Vf], d = []; - function c(_, m) { + const f = [gf, pf], d = []; + function c(h, p) { return ( /*type*/ - _[0] === "clipboard" ? 0 : 1 + h[0] === "clipboard" ? 0 : 1 ); } r = c(e), i = d[r] = f[r](e); - let h = ( + let _ = ( /*mode*/ - e[3] !== "short" && Wi(e) + e[3] !== "short" && xi(e) ); return { c() { - t = Wr("div"), n = Wr("span"), i.c(), o = Jr(), u = rn(l), s = Jr(), h && h.c(), Xr(n, "class", "icon-wrap svelte-kzcjhc"), Xi( + t = zr("div"), n = zr("span"), i.c(), o = Xr(), u = tn(l), s = Xr(), _ && _.c(), xr(n, "class", "icon-wrap svelte-kzcjhc"), ji( n, "hovered", /*hovered*/ e[4] - ), Xr(t, "class", "wrap svelte-kzcjhc"); + ), xr(t, "class", "wrap svelte-kzcjhc"); }, - m(_, m) { - Dn(_, t, m), yt(t, n), d[r].m(n, null), yt(t, o), yt(t, u), yt(t, s), h && h.m(t, null), a = !0; + m(h, p) { + Hn(h, t, p), wt(t, n), d[r].m(n, null), wt(t, o), wt(t, u), wt(t, s), _ && _.m(t, null), a = !0; }, - p(_, [m]) { + p(h, [p]) { let g = r; - r = c(_), r !== g && (jf(), qn(d[g], 1, 1, () => { + r = c(h), r !== g && (_f(), Fn(d[g], 1, 1, () => { d[g] = null; - }), qf(), i = d[r], i || (i = d[r] = f[r](_), i.c()), Gn(i, 1), i.m(n, null)), (!a || m & /*hovered*/ - 16) && Xi( + }), df(), i = d[r], i || (i = d[r] = f[r](h), i.c()), Un(i, 1), i.m(n, null)), (!a || p & /*hovered*/ + 16) && ji( n, "hovered", /*hovered*/ - _[4] - ), (!a || m & /*i18n, type*/ + h[4] + ), (!a || p & /*i18n, type*/ 3) && l !== (l = /*i18n*/ - _[1]( + h[1]( /*defs*/ - _[5][ + h[5][ /*type*/ - _[0] + h[0] ] || /*defs*/ - _[5].file - ) + "") && Zr(u, l), /*mode*/ - _[3] !== "short" ? h ? h.p(_, m) : (h = Wi(_), h.c(), h.m(t, null)) : h && (h.d(1), h = null); + h[5].file + ) + "") && Vr(u, l), /*mode*/ + h[3] !== "short" ? _ ? _.p(h, p) : (_ = xi(h), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null); }, - i(_) { - a || (Gn(i), a = !0); + i(h) { + a || (Un(i), a = !0); }, - o(_) { - qn(i), a = !1; + o(h) { + Fn(i), a = !1; }, - d(_) { - _ && Mn(t), d[r].d(), h && h.d(); + d(h) { + h && Nn(t), d[r].d(), _ && _.d(); } }; } -function Zf(e, t, n) { +function wf(e, t, n) { let { type: r = "file" } = t, { i18n: i } = t, { message: o = void 0 } = t, { mode: l = "full" } = t, { hovered: u = !1 } = t; const s = { image: "upload_text.drop_image", @@ -1703,9 +1545,9 @@ function Zf(e, t, n) { "type" in a && n(0, r = a.type), "i18n" in a && n(1, i = a.i18n), "message" in a && n(2, o = a.message), "mode" in a && n(3, l = a.mode), "hovered" in a && n(4, u = a.hovered); }, [r, i, o, l, u, s]; } -class Jf extends Gf { +class vf extends cf { constructor(t) { - super(), xf(this, t, Zf, Wf, zf, { + super(), hf(this, t, wf, bf, mf, { type: 0, i18n: 1, message: 2, @@ -1714,14 +1556,14 @@ class Jf extends Gf { }); } } -var Cr = new Intl.Collator(0, { numeric: 1 }).compare; -function Zi(e, t, n) { - return e = e.split("."), t = t.split("."), Cr(e[0], t[0]) || Cr(e[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(e[2] = e.slice(2).join(".")), n == /[.-]/.test(t[2]) ? Cr(e[2], t[2]) : n ? -1 : 1); +var Tr = new Intl.Collator(0, { numeric: 1 }).compare; +function zi(e, t, n) { + return e = e.split("."), t = t.split("."), Tr(e[0], t[0]) || Tr(e[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(e[2] = e.slice(2).join(".")), n == /[.-]/.test(t[2]) ? Tr(e[2], t[2]) : n ? -1 : 1); } -function Fl(e, t, n) { +function Nl(e, t, n) { return t.startsWith("http://") || t.startsWith("https://") ? n ? e : t : e + t; } -function Ir(e) { +function Ar(e) { if (e.startsWith("http")) { const { protocol: t, host: n } = new URL(e); return n.endsWith("hf.space") ? { @@ -1746,12 +1588,12 @@ function Ir(e) { host: e }; } -const Gl = /^[^\/]*\/[^\/]*$/, Qf = /.*hf\.space\/{0,1}$/; -async function Yf(e, t) { +const Hl = /^[^\/]*\/[^\/]*$/, yf = /.*hf\.space\/{0,1}$/; +async function Ef(e, t) { const n = {}; t && (n.Authorization = `Bearer ${t}`); const r = e.trim(); - if (Gl.test(r)) + if (Hl.test(r)) try { const i = await fetch( `https://huggingface.co/api/spaces/${r}/host`, @@ -1762,13 +1604,13 @@ async function Yf(e, t) { const o = (await i.json()).host; return { space_id: e, - ...Ir(o) + ...Ar(o) }; } catch (i) { throw new Error("Space metadata could not be loaded." + i.message); } - if (Qf.test(r)) { - const { ws_protocol: i, http_protocol: o, host: l } = Ir(r); + if (yf.test(r)) { + const { ws_protocol: i, http_protocol: o, host: l } = Ar(r); return { space_id: l.replace(".hf.space", ""), ws_protocol: i, @@ -1778,17 +1620,17 @@ async function Yf(e, t) { } return { space_id: !1, - ...Ir(r) + ...Ar(r) }; } -function Kf(e) { +function Sf(e) { let t = {}; return e.forEach(({ api_name: n }, r) => { n && (t[n] = r); }), t; } -const $f = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; -async function Ji(e) { +const kf = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; +async function Vi(e) { try { const n = (await fetch( `https://huggingface.co/api/spaces/${e}/discussions`, @@ -1796,18 +1638,18 @@ async function Ji(e) { method: "HEAD" } )).headers.get("x-error-message"); - return !(n && $f.test(n)); + return !(n && kf.test(n)); } catch { return !1; } } -function Et(e, t, n) { +function vt(e, t, n) { if (e == null) return null; if (Array.isArray(e)) { const r = []; for (const i of e) - i == null ? r.push(null) : r.push(Et(i, t, n)); + i == null ? r.push(null) : r.push(vt(i, t, n)); return r; } return e.is_stream ? n == null ? new Ft({ @@ -1818,10 +1660,10 @@ function Et(e, t, n) { url: "/proxy=" + n + "stream/" + e.path }) : new Ft({ ...e, - url: tc(e.path, t, n) + url: Af(e.path, t, n) }); } -function ec(e) { +function Tf(e) { try { const t = new URL(e); return t.protocol === "http:" || t.protocol === "https:"; @@ -1829,10 +1671,10 @@ function ec(e) { return !1; } } -function tc(e, t, n) { - return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : ec(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; +function Af(e, t, n) { + return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : Tf(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; } -async function nc(e, t, n, r = oc) { +async function Bf(e, t, n, r = Lf) { let i = (Array.isArray(e) ? e : [e]).map( (o) => o.blob ); @@ -1843,13 +1685,13 @@ async function nc(e, t, n, r = oc) { throw new Error(o.error); return o.files ? o.files.map((l, u) => { const s = new Ft({ ...e[u], path: l }); - return Et(s, t, null); + return vt(s, t, null); }) : []; } ) ); } -async function rc(e, t) { +async function Cf(e, t) { return e.map( (n, r) => new Ft({ path: n.name, @@ -1875,9 +1717,9 @@ class Ft { this.path = t, this.url = n, this.orig_name = r, this.size = i, this.blob = n ? void 0 : o, this.is_stream = l, this.mime_type = u, this.alt_text = s; } } -const ql = "This application is too busy. Keep trying!", ht = "Connection errored out."; -let jl; -function ic(e, t) { +const Dl = "This application is too busy. Keep trying!", dt = "Connection errored out."; +let Ml; +function If(e, t) { return { post_data: n, upload_files: r, client: i, handle_blob: o }; async function n(l, u, s) { const a = { "Content-Type": "application/json" }; @@ -1889,13 +1731,13 @@ function ic(e, t) { headers: a }); } catch { - return [{ error: ht }, 500]; + return [{ error: dt }, 500]; } let d, c; try { d = await f.json(), c = f.status; - } catch (h) { - d = { error: `Could not parse server response: ${h}` }, c = 500; + } catch (_) { + d = { error: `Could not parse server response: ${_}` }, c = 500; } return [d, c]; } @@ -1903,72 +1745,72 @@ function ic(e, t) { const f = {}; s && (f.Authorization = `Bearer ${s}`); const d = 1e3, c = []; - for (let _ = 0; _ < u.length; _ += d) { - const m = u.slice(_, _ + d), g = new FormData(); - m.forEach((v) => { + for (let h = 0; h < u.length; h += d) { + const p = u.slice(h, h + d), g = new FormData(); + p.forEach((v) => { g.append("files", v); }); try { const v = a ? `${l}/upload?upload_id=${a}` : `${l}/upload`; - var h = await e(v, { + var _ = await e(v, { method: "POST", body: g, headers: f }); } catch { - return { error: ht }; + return { error: dt }; } - const p = await h.json(); - c.push(...p); + const m = await _.json(); + c.push(...m); } return { files: c }; } async function i(l, u = { normalise_files: !0 }) { return new Promise(async (s) => { const { status_callback: a, hf_token: f, normalise_files: d } = u, c = { - predict: ne, - submit: ce, + predict: te, + submit: fe, view_api: pe, component_server: B - }, h = d ?? !0; + }, _ = d ?? !0; if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) { - const E = await import("./wrapper-6f348d45-f837cf34.js"); - jl = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = E.WebSocket; + const S = await import("./wrapper-6f348d45-f837cf34.js"); + Ml = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = S.WebSocket; } - const { ws_protocol: _, http_protocol: m, host: g, space_id: p } = await Yf(l, f), v = Math.random().toString(36).substring(2), b = {}; - let w = !1, y = {}, S = null; - const C = {}, P = /* @__PURE__ */ new Set(); - let k, O = {}, U = !1; - f && p && (U = await sc(p, f)); - async function x(E) { - if (k = E, O = Kf((E == null ? void 0 : E.dependencies) || []), k.auth_required) + const { ws_protocol: h, http_protocol: p, host: g, space_id: m } = await Ef(l, f), v = Math.random().toString(36).substring(2), w = {}; + let b = !1, y = {}, k = null; + const C = {}, O = /* @__PURE__ */ new Set(); + let T, P = {}, M = !1; + f && m && (M = await Pf(m, f)); + async function j(S) { + if (T = S, P = Sf((S == null ? void 0 : S.dependencies) || []), T.auth_required) return { - config: k, + config: T, ...c }; try { - j = await pe(k); - } catch (M) { - console.error(`Could not get api details: ${M.message}`); + q = await pe(T); + } catch (D) { + console.error(`Could not get api details: ${D.message}`); } return { - config: k, + config: T, ...c }; } - let j; - async function te(E) { - if (a && a(E), E.status === "running") + let q; + async function ee(S) { + if (a && a(S), S.status === "running") try { - k = await $i( + T = await Ji( e, - `${m}//${g}`, + `${p}//${g}`, f ); - const M = await x(k); - s(M); - } catch (M) { - console.error(M), a && a({ + const D = await j(T); + s(D); + } catch (D) { + console.error(D), a && a({ status: "error", message: "Could not load this space.", load_status: "error", @@ -1977,18 +1819,18 @@ function ic(e, t) { } } try { - k = await $i( + T = await Ji( e, - `${m}//${g}`, + `${p}//${g}`, f ); - const E = await x(k); - s(E); - } catch (E) { - console.error(E), p ? Yr( - p, - Gl.test(p) ? "space_name" : "subdomain", - te + const S = await j(T); + s(S); + } catch (S) { + console.error(S), m ? Zr( + m, + Hl.test(m) ? "space_name" : "subdomain", + ee ) : a && a({ status: "error", message: "Could not load this space.", @@ -1996,196 +1838,196 @@ function ic(e, t) { detail: "NOT_FOUND" }); } - function ne(E, M, A) { - let F = !1, L = !1, re; - if (typeof E == "number") - re = k.dependencies[E]; + function te(S, D, A) { + let R = !1, L = !1, ne; + if (typeof S == "number") + ne = T.dependencies[S]; else { - const z = E.replace(/^\//, ""); - re = k.dependencies[O[z]]; + const E = S.replace(/^\//, ""); + ne = T.dependencies[P[E]]; } - if (re.types.continuous) + if (ne.types.continuous) throw new Error( "Cannot call predict on this function as it may run forever. Use submit instead" ); - return new Promise((z, ee) => { - const T = ce(E, M, A); - let H; - T.on("data", (D) => { - L && (T.destroy(), z(D)), F = !0, H = D; - }).on("status", (D) => { - D.stage === "error" && ee(D), D.stage === "complete" && (L = !0, F && (T.destroy(), z(H))); + return new Promise((E, z) => { + const K = fe(S, D, A); + let N; + K.on("data", (U) => { + L && (K.destroy(), E(U)), R = !0, N = U; + }).on("status", (U) => { + U.stage === "error" && z(U), U.stage === "complete" && (L = !0, R && (K.destroy(), E(N))); }); }); } - function ce(E, M, A, F = null) { - let L, re; - if (typeof E == "number") - L = E, re = j.unnamed_endpoints[L]; + function fe(S, D, A, R = null) { + let L, ne; + if (typeof S == "number") + L = S, ne = q.unnamed_endpoints[L]; else { - const de = E.replace(/^\//, ""); - L = O[de], re = j.named_endpoints[E.trim()]; + const ce = S.replace(/^\//, ""); + L = P[ce], ne = q.named_endpoints[S.trim()]; } if (typeof L != "number") throw new Error( "There is no endpoint matching that name of fn_index matching that number." ); - let z, ee, T = k.protocol ?? "ws"; - const H = typeof E == "number" ? "/predict" : E; - let D, I = null, N = !1; - const Q = {}; - let Y = ""; - typeof window < "u" && (Y = new URLSearchParams(window.location.search).toString()), o(`${k.root}`, M, re, f).then( - (de) => { - if (D = { - data: de || [], + let E, z, K = T.protocol ?? "ws"; + const N = typeof S == "number" ? "/predict" : S; + let U, I = null, H = !1; + const Z = {}; + let oe = ""; + typeof window < "u" && (oe = new URLSearchParams(window.location.search).toString()), o(`${T.root}`, D, ne, f).then( + (ce) => { + if (U = { + data: ce || [], event_data: A, fn_index: L, - trigger_id: F - }, ac(L, k)) - R({ + trigger_id: R + }, Nf(L, T)) + x({ type: "status", - endpoint: H, + endpoint: N, stage: "pending", queue: !1, fn_index: L, time: /* @__PURE__ */ new Date() }), n( - `${k.root}/run${H.startsWith("/") ? H : `/${H}`}${Y ? "?" + Y : ""}`, + `${T.root}/run${N.startsWith("/") ? N : `/${N}`}${oe ? "?" + oe : ""}`, { - ...D, + ...U, session_hash: v }, f - ).then(([oe, se]) => { - const Le = h ? Ln( - oe.data, - re, - k.root, - k.root_url - ) : oe.data; - se == 200 ? (R({ + ).then(([re, le]) => { + const Le = _ ? In( + re.data, + ne, + T.root, + T.root_url + ) : re.data; + le == 200 ? (x({ type: "data", - endpoint: H, + endpoint: N, fn_index: L, data: Le, time: /* @__PURE__ */ new Date() - }), R({ + }), x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, stage: "complete", - eta: oe.average_duration, + eta: re.average_duration, queue: !1, time: /* @__PURE__ */ new Date() - })) : R({ + })) : x({ type: "status", stage: "error", - endpoint: H, + endpoint: N, fn_index: L, - message: oe.error, + message: re.error, queue: !1, time: /* @__PURE__ */ new Date() }); - }).catch((oe) => { - R({ + }).catch((re) => { + x({ type: "status", stage: "error", - message: oe.message, - endpoint: H, + message: re.message, + endpoint: N, fn_index: L, queue: !1, time: /* @__PURE__ */ new Date() }); }); - else if (T == "ws") { - R({ + else if (K == "ws") { + x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - let oe = new URL(`${_}://${Fl( + let re = new URL(`${h}://${Nl( g, - k.path, + T.path, !0 )} - /queue/join${Y ? "?" + Y : ""}`); - U && oe.searchParams.set("__sign", U), z = new WebSocket(oe), z.onclose = (se) => { - se.wasClean || R({ + /queue/join${oe ? "?" + oe : ""}`); + M && re.searchParams.set("__sign", M), E = new WebSocket(re), E.onclose = (le) => { + le.wasClean || x({ type: "status", stage: "error", broken: !0, - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - }, z.onmessage = function(se) { - const Le = JSON.parse(se.data), { type: ge, status: K, data: Z } = Lr( + }, E.onmessage = function(le) { + const Le = JSON.parse(le.data), { type: ge, status: Q, data: J } = Br( Le, - b[L] + w[L] ); - if (ge === "update" && K && !N) - R({ + if (ge === "update" && Q && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...K - }), K.stage === "error" && z.close(); + ...Q + }), Q.stage === "error" && E.close(); else if (ge === "hash") { - z.send(JSON.stringify({ fn_index: L, session_hash: v })); + E.send(JSON.stringify({ fn_index: L, session_hash: v })); return; } else - ge === "data" ? z.send(JSON.stringify({ ...D, session_hash: v })) : ge === "complete" ? N = K : ge === "log" ? R({ + ge === "data" ? E.send(JSON.stringify({ ...U, session_hash: v })) : ge === "complete" ? H = Q : ge === "log" ? x({ type: "log", - log: Z.log, - level: Z.level, - endpoint: H, + log: J.log, + level: J.level, + endpoint: N, fn_index: L - }) : ge === "generating" && R({ + }) : ge === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...K, - stage: K == null ? void 0 : K.stage, + ...Q, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Z && (R({ + J && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( - Z.data, - re, - k.root, - k.root_url - ) : Z.data, - endpoint: H, + data: _ ? In( + J.data, + ne, + T.root, + T.root_url + ) : J.data, + endpoint: N, fn_index: L - }), N && (R({ + }), H && (x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: K == null ? void 0 : K.stage, + ...H, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - }), z.close())); - }, Zi(k.version || "2.0.0", "3.6") < 0 && addEventListener( + }), E.close())); + }, zi(T.version || "2.0.0", "3.6") < 0 && addEventListener( "open", - () => z.send(JSON.stringify({ hash: v })) + () => E.send(JSON.stringify({ hash: v })) ); - } else if (T == "sse") { - R({ + } else if (K == "sse") { + x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); @@ -2193,191 +2035,191 @@ function ic(e, t) { fn_index: L.toString(), session_hash: v }).toString(); - let oe = new URL( - `${k.root}/queue/join?${Y ? Y + "&" : ""}${we}` + let re = new URL( + `${T.root}/queue/join?${oe ? oe + "&" : ""}${we}` ); - ee = t(oe), ee.onmessage = async function(se) { - const Le = JSON.parse(se.data), { type: ge, status: K, data: Z } = Lr( + z = t(re), z.onmessage = async function(le) { + const Le = JSON.parse(le.data), { type: ge, status: Q, data: J } = Br( Le, - b[L] + w[L] ); - if (ge === "update" && K && !N) - R({ + if (ge === "update" && Q && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...K - }), K.stage === "error" && ee.close(); + ...Q + }), Q.stage === "error" && z.close(); else if (ge === "data") { I = Le.event_id; - let [Ae, $t] = await n( - `${k.root}/queue/data`, + let [Ae, Kt] = await n( + `${T.root}/queue/data`, { - ...D, + ...U, session_hash: v, event_id: I }, f ); - $t !== 200 && (R({ + Kt !== 200 && (x({ type: "status", stage: "error", - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() - }), ee.close()); + }), z.close()); } else - ge === "complete" ? N = K : ge === "log" ? R({ + ge === "complete" ? H = Q : ge === "log" ? x({ type: "log", - log: Z.log, - level: Z.level, - endpoint: H, + log: J.log, + level: J.level, + endpoint: N, fn_index: L - }) : ge === "generating" && R({ + }) : ge === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...K, - stage: K == null ? void 0 : K.stage, + ...Q, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Z && (R({ + J && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( - Z.data, - re, - k.root, - k.root_url - ) : Z.data, - endpoint: H, + data: _ ? In( + J.data, + ne, + T.root, + T.root_url + ) : J.data, + endpoint: N, fn_index: L - }), N && (R({ + }), H && (x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: K == null ? void 0 : K.stage, + ...H, + stage: Q == null ? void 0 : Q.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - }), ee.close())); + }), z.close())); }; } else - T == "sse_v1" && (R({ + K == "sse_v1" && (x({ type: "status", stage: "pending", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }), n( - `${k.root}/queue/join?${Y}`, + `${T.root}/queue/join?${oe}`, { - ...D, + ...U, session_hash: v }, f - ).then(([oe, se]) => { - if (se === 503) - R({ + ).then(([re, le]) => { + if (le === 503) + x({ type: "status", stage: "error", - message: ql, + message: Dl, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - else if (se !== 200) - R({ + else if (le !== 200) + x({ type: "status", stage: "error", - message: ht, + message: dt, queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); else { - I = oe.event_id; + I = re.event_id; let Le = async function(ge) { try { - const { type: K, status: Z, data: Ae } = Lr( + const { type: Q, status: J, data: Ae } = Br( ge, - b[L] + w[L] ); - if (K == "heartbeat") + if (Q == "heartbeat") return; - if (K === "update" && Z && !N) - R({ + if (Q === "update" && J && !H) + x({ type: "status", - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date(), - ...Z + ...J }); - else if (K === "complete") - N = Z; - else if (K == "unexpected_error") - console.error("Unexpected error", Z == null ? void 0 : Z.message), R({ + else if (Q === "complete") + H = J; + else if (Q == "unexpected_error") + console.error("Unexpected error", J == null ? void 0 : J.message), x({ type: "status", stage: "error", - message: (Z == null ? void 0 : Z.message) || "An Unexpected Error Occurred!", + message: (J == null ? void 0 : J.message) || "An Unexpected Error Occurred!", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }); - else if (K === "log") { - R({ + else if (Q === "log") { + x({ type: "log", log: Ae.log, level: Ae.level, - endpoint: H, + endpoint: N, fn_index: L }); return; } else - K === "generating" && R({ + Q === "generating" && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...Z, - stage: Z == null ? void 0 : Z.stage, + ...J, + stage: J == null ? void 0 : J.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L }); - Ae && (R({ + Ae && (x({ type: "data", time: /* @__PURE__ */ new Date(), - data: h ? Ln( + data: _ ? In( Ae.data, - re, - k.root, - k.root_url + ne, + T.root, + T.root_url ) : Ae.data, - endpoint: H, + endpoint: N, fn_index: L - }), N && R({ + }), H && x({ type: "status", time: /* @__PURE__ */ new Date(), - ...N, - stage: Z == null ? void 0 : Z.stage, + ...H, + stage: J == null ? void 0 : J.stage, queue: !0, - endpoint: H, + endpoint: N, fn_index: L - })), ((Z == null ? void 0 : Z.stage) === "complete" || (Z == null ? void 0 : Z.stage) === "error") && C[I] && delete C[I]; - } catch (K) { - console.error("Unexpected client exception", K), R({ + })), ((J == null ? void 0 : J.stage) === "complete" || (J == null ? void 0 : J.stage) === "error") && C[I] && delete C[I]; + } catch (Q) { + console.error("Unexpected client exception", Q), x({ type: "status", stage: "error", message: "An Unexpected Error Occurred!", queue: !0, - endpoint: H, + endpoint: N, fn_index: L, time: /* @__PURE__ */ new Date() }), _e(); @@ -2385,42 +2227,42 @@ function ic(e, t) { }; I in y && (y[I].forEach( (ge) => Le(ge) - ), delete y[I]), C[I] = Le, P.add(I), w || me(); + ), delete y[I]), C[I] = Le, O.add(I), b || me(); } })); } ); - function R(de) { - const oe = Q[de.type] || []; - oe == null || oe.forEach((se) => se(de)); + function x(ce) { + const re = Z[ce.type] || []; + re == null || re.forEach((le) => le(ce)); } - function Te(de, we) { - const oe = Q, se = oe[de] || []; - return oe[de] = se, se == null || se.push(we), { on: Te, off: He, cancel: Ie, destroy: $e }; + function Te(ce, we) { + const re = Z, le = re[ce] || []; + return re[ce] = le, le == null || le.push(we), { on: Te, off: Ne, cancel: Ie, destroy: $e }; } - function He(de, we) { - const oe = Q; - let se = oe[de] || []; - return se = se == null ? void 0 : se.filter((Le) => Le !== we), oe[de] = se, { on: Te, off: He, cancel: Ie, destroy: $e }; + function Ne(ce, we) { + const re = Z; + let le = re[ce] || []; + return le = le == null ? void 0 : le.filter((Le) => Le !== we), re[ce] = le, { on: Te, off: Ne, cancel: Ie, destroy: $e }; } async function Ie() { - const de = { + const ce = { stage: "complete", queue: !1, time: /* @__PURE__ */ new Date() }; - N = de, R({ - ...de, + H = ce, x({ + ...ce, type: "status", - endpoint: H, + endpoint: N, fn_index: L }); let we = {}; - T === "ws" ? (z && z.readyState === 0 ? z.addEventListener("open", () => { - z.close(); - }) : z.close(), we = { fn_index: L, session_hash: v }) : (ee.close(), we = { event_id: I }); + K === "ws" ? (E && E.readyState === 0 ? E.addEventListener("open", () => { + E.close(); + }) : E.close(), we = { fn_index: L, session_hash: v }) : (z.close(), we = { event_id: I }); try { - await e(`${k.root}/reset`, { + await e(`${T.root}/reset`, { headers: { "Content-Type": "application/json" }, method: "POST", body: JSON.stringify(we) @@ -2432,106 +2274,106 @@ function ic(e, t) { } } function $e() { - for (const de in Q) - Q[de].forEach((we) => { - He(de, we); + for (const ce in Z) + Z[ce].forEach((we) => { + Ne(ce, we); }); } return { on: Te, - off: He, + off: Ne, cancel: Ie, destroy: $e }; } function me() { - w = !0; - let E = new URLSearchParams({ + b = !0; + let S = new URLSearchParams({ session_hash: v - }).toString(), M = new URL(`${k.root}/queue/data?${E}`); - S = t(M), S.onmessage = async function(A) { - let F = JSON.parse(A.data); - const L = F.event_id; + }).toString(), D = new URL(`${T.root}/queue/data?${S}`); + k = t(D), k.onmessage = async function(A) { + let R = JSON.parse(A.data); + const L = R.event_id; if (!L) await Promise.all( Object.keys(C).map( - (re) => C[re](F) + (ne) => C[ne](R) ) ); else if (C[L]) { - F.msg === "process_completed" && (P.delete(L), P.size === 0 && _e()); - let re = C[L]; - window.setTimeout(re, 0, F); + R.msg === "process_completed" && (O.delete(L), O.size === 0 && _e()); + let ne = C[L]; + window.setTimeout(ne, 0, R); } else - y[L] || (y[L] = []), y[L].push(F); - }, S.onerror = async function(A) { + y[L] || (y[L] = []), y[L].push(R); + }, k.onerror = async function(A) { await Promise.all( Object.keys(C).map( - (F) => C[F]({ + (R) => C[R]({ msg: "unexpected_error", - message: ht + message: dt }) ) ), _e(); }; } function _e() { - w = !1, S == null || S.close(); + b = !1, k == null || k.close(); } - async function B(E, M, A) { - var F; + async function B(S, D, A) { + var R; const L = { "Content-Type": "application/json" }; f && (L.Authorization = `Bearer ${f}`); - let re, z = k.components.find( - (H) => H.id === E + let ne, E = T.components.find( + (N) => N.id === S ); - (F = z == null ? void 0 : z.props) != null && F.root_url ? re = z.props.root_url : re = k.root; - const ee = await e( - `${re}/component_server/`, + (R = E == null ? void 0 : E.props) != null && R.root_url ? ne = E.props.root_url : ne = T.root; + const z = await e( + `${ne}/component_server/`, { method: "POST", body: JSON.stringify({ data: A, - component_id: E, - fn_name: M, + component_id: S, + fn_name: D, session_hash: v }), headers: L } ); - if (!ee.ok) + if (!z.ok) throw new Error( - "Could not connect to component server: " + ee.statusText + "Could not connect to component server: " + z.statusText ); - return await ee.json(); + return await z.json(); } - async function pe(E) { - if (j) - return j; - const M = { "Content-Type": "application/json" }; - f && (M.Authorization = `Bearer ${f}`); + async function pe(S) { + if (q) + return q; + const D = { "Content-Type": "application/json" }; + f && (D.Authorization = `Bearer ${f}`); let A; - if (Zi(E.version || "2.0.0", "3.30") < 0 ? A = await e( + if (zi(S.version || "2.0.0", "3.30") < 0 ? A = await e( "https://gradio-space-api-fetcher-v2.hf.space/api", { method: "POST", body: JSON.stringify({ serialize: !1, - config: JSON.stringify(E) + config: JSON.stringify(S) }), - headers: M + headers: D } - ) : A = await e(`${E.root}/info`, { - headers: M + ) : A = await e(`${S.root}/info`, { + headers: D }), !A.ok) - throw new Error(ht); - let F = await A.json(); - return "api" in F && (F = F.api), F.named_endpoints["/predict"] && !F.unnamed_endpoints[0] && (F.unnamed_endpoints[0] = F.named_endpoints["/predict"]), lc(F, E, O); + throw new Error(dt); + let R = await A.json(); + return "api" in R && (R = R.api), R.named_endpoints["/predict"] && !R.unnamed_endpoints[0] && (R.unnamed_endpoints[0] = R.named_endpoints["/predict"]), Of(R, S, P); } }); } async function o(l, u, s, a) { - const f = await Qr( + const f = await Wr( u, void 0, [], @@ -2539,34 +2381,34 @@ function ic(e, t) { s ); return Promise.all( - f.map(async ({ path: d, blob: c, type: h }) => { + f.map(async ({ path: d, blob: c, type: _ }) => { if (c) { - const _ = (await r(l, [c], a)).files[0]; - return { path: d, file_url: _, type: h, name: c == null ? void 0 : c.name }; + const h = (await r(l, [c], a)).files[0]; + return { path: d, file_url: h, type: _, name: c == null ? void 0 : c.name }; } - return { path: d, type: h }; + return { path: d, type: _ }; }) - ).then((d) => (d.forEach(({ path: c, file_url: h, type: _, name: m }) => { - if (_ === "Gallery") - Ki(u, h, c); - else if (h) { - const g = new Ft({ path: h, orig_name: m }); - Ki(u, g, c); + ).then((d) => (d.forEach(({ path: c, file_url: _, type: h, name: p }) => { + if (h === "Gallery") + Zi(u, _, c); + else if (_) { + const g = new Ft({ path: _, orig_name: p }); + Zi(u, g, c); } }), u)); } } -const { post_data: op, upload_files: oc, client: lp, handle_blob: sp } = ic( +const { post_data: Im, upload_files: Lf, client: Lm, handle_blob: Om } = If( fetch, (...e) => new EventSource(...e) ); -function Ln(e, t, n, r) { +function In(e, t, n, r) { return e.map((i, o) => { var l, u, s, a; - return ((u = (l = t == null ? void 0 : t.returns) == null ? void 0 : l[o]) == null ? void 0 : u.component) === "File" ? Et(i, n, r) : ((a = (s = t == null ? void 0 : t.returns) == null ? void 0 : s[o]) == null ? void 0 : a.component) === "Gallery" ? i.map((f) => Array.isArray(f) ? [Et(f[0], n, r), f[1]] : [Et(f, n, r), null]) : typeof i == "object" && i.path ? Et(i, n, r) : i; + return ((u = (l = t == null ? void 0 : t.returns) == null ? void 0 : l[o]) == null ? void 0 : u.component) === "File" ? vt(i, n, r) : ((a = (s = t == null ? void 0 : t.returns) == null ? void 0 : s[o]) == null ? void 0 : a.component) === "Gallery" ? i.map((f) => Array.isArray(f) ? [vt(f[0], n, r), f[1]] : [vt(f, n, r), null]) : typeof i == "object" && i.path ? vt(i, n, r) : i; }); } -function Qi(e, t, n, r) { +function Xi(e, t, n, r) { switch (e.type) { case "string": return "string"; @@ -2586,10 +2428,10 @@ function Qi(e, t, n, r) { if (n === "GallerySerializable") return r === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; } -function Yi(e, t) { +function Wi(e, t) { return t === "GallerySerializable" ? "array of [file, label] tuples" : t === "ListStringSerializable" ? "array of strings" : t === "FileSerializable" ? "array of files or single file" : e.description; } -function lc(e, t, n) { +function Of(e, t, n) { const r = { named_endpoints: {}, unnamed_endpoints: {} @@ -2602,22 +2444,22 @@ function lc(e, t, n) { ({ label: a, component: f, type: d, serializer: c }) => ({ label: a, component: f, - type: Qi(d, f, c, "parameter"), - description: Yi(d, c) + type: Xi(d, f, c, "parameter"), + description: Wi(d, c) }) ), r[i][l].returns = s.returns.map( ({ label: a, component: f, type: d, serializer: c }) => ({ label: a, component: f, - type: Qi(d, f, c, "return"), - description: Yi(d, c) + type: Xi(d, f, c, "return"), + description: Wi(d, c) }) ); } } return r; } -async function sc(e, t) { +async function Pf(e, t) { try { return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, { headers: { @@ -2628,12 +2470,12 @@ async function sc(e, t) { return console.error(n), !1; } } -function Ki(e, t, n) { +function Zi(e, t, n) { for (; n.length > 1; ) e = e[n.shift()]; e[n.shift()] = t; } -async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { +async function Wr(e, t = void 0, n = [], r = !1, i = void 0) { if (Array.isArray(e)) { let o = []; return await Promise.all( @@ -2641,7 +2483,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { var s; let a = n.slice(); a.push(u); - const f = await Qr( + const f = await Wr( e[u], r ? ((s = i == null ? void 0 : i.parameters[u]) == null ? void 0 : s.component) || void 0 : t, a, @@ -2656,7 +2498,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { return [ { path: n, - blob: t === "Image" ? !1 : new jl([e]), + blob: t === "Image" ? !1 : new Ml([e]), type: t } ]; @@ -2666,7 +2508,7 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { if (e.hasOwnProperty(l)) { let u = n.slice(); u.push(l), o = o.concat( - await Qr( + await Wr( e[l], void 0, u, @@ -2680,15 +2522,15 @@ async function Qr(e, t = void 0, n = [], r = !1, i = void 0) { } return []; } -function ac(e, t) { +function Nf(e, t) { var n, r, i, o; return !(((r = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[e]) == null ? void 0 : r.queue) === null ? t.enable_queue : (o = (i = t == null ? void 0 : t.dependencies) == null ? void 0 : i[e]) != null && o.queue) || !1; } -async function $i(e, t, n) { +async function Ji(e, t, n) { const r = {}; if (n && (r.Authorization = `Bearer ${n}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { const i = window.gradio_config.root, o = window.gradio_config; - return o.root = Fl(t, o.root, !1), { ...o, path: i }; + return o.root = Nl(t, o.root, !1), { ...o, path: i }; } else if (t) { let i = await e(`${t}/config`, { headers: r @@ -2701,7 +2543,7 @@ async function $i(e, t, n) { } throw new Error("No config or app endpoint found"); } -async function Yr(e, t, n) { +async function Zr(e, t, n) { let r = t === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${e}` : `https://huggingface.co/api/spaces/${e}`, i, o; try { if (i = await fetch(r), o = i.status, o !== 200) @@ -2731,7 +2573,7 @@ async function Yr(e, t, n) { message: "Space is asleep. Waking it up...", detail: l }), setTimeout(() => { - Yr(e, t, n); + Zr(e, t, n); }, 1e3); break; case "PAUSED": @@ -2740,7 +2582,7 @@ async function Yr(e, t, n) { load_status: "error", message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.", detail: l, - discussions_enabled: await Ji(u) + discussions_enabled: await Vi(u) }); break; case "RUNNING": @@ -2759,7 +2601,7 @@ async function Yr(e, t, n) { message: "Space is building...", detail: l }), setTimeout(() => { - Yr(e, t, n); + Zr(e, t, n); }, 1e3); break; default: @@ -2768,12 +2610,12 @@ async function Yr(e, t, n) { load_status: "error", message: "This space is experiencing an issue.", detail: l, - discussions_enabled: await Ji(u) + discussions_enabled: await Vi(u) }); break; } } -function Lr(e, t) { +function Br(e, t) { switch (e.msg) { case "send_data": return { type: "data" }; @@ -2784,7 +2626,7 @@ function Lr(e, t) { type: "update", status: { queue: !0, - message: ql, + message: Dl, stage: "error", code: e.code, success: e.success @@ -2880,40 +2722,40 @@ function Lr(e, t) { } return { type: "none", status: { stage: "error", queue: !0 } }; } -function kt() { +function Et() { } -function uc(e) { +function Hf(e) { return e(); } -function fc(e) { - e.forEach(uc); +function Df(e) { + e.forEach(Hf); } -function cc(e) { +function Mf(e) { return typeof e == "function"; } -function dc(e, t) { +function Rf(e, t) { return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function"; } -function _c(e, ...t) { +function Uf(e, ...t) { if (e == null) { for (const r of t) r(void 0); - return kt; + return Et; } const n = e.subscribe(...t); return n.unsubscribe ? () => n.unsubscribe() : n; } -const xl = typeof window < "u"; -let eo = xl ? () => window.performance.now() : () => Date.now(), zl = xl ? (e) => requestAnimationFrame(e) : kt; +const Rl = typeof window < "u"; +let Qi = Rl ? () => window.performance.now() : () => Date.now(), Ul = Rl ? (e) => requestAnimationFrame(e) : Et; const Gt = /* @__PURE__ */ new Set(); -function Vl(e) { +function Fl(e) { Gt.forEach((t) => { t.c(e) || (Gt.delete(t), t.f()); - }), Gt.size !== 0 && zl(Vl); + }), Gt.size !== 0 && Ul(Fl); } -function hc(e) { +function Ff(e) { let t; - return Gt.size === 0 && zl(Vl), { + return Gt.size === 0 && Ul(Fl), { promise: new Promise((n) => { Gt.add(t = { c: e, f: n }); }), @@ -2922,187 +2764,187 @@ function hc(e) { } }; } -const Dt = []; -function mc(e, t) { +const Mt = []; +function Gf(e, t) { return { - subscribe: hn(e, t).subscribe + subscribe: _n(e, t).subscribe }; } -function hn(e, t = kt) { +function _n(e, t = Et) { let n; const r = /* @__PURE__ */ new Set(); function i(u) { - if (dc(e, u) && (e = u, n)) { - const s = !Dt.length; + if (Rf(e, u) && (e = u, n)) { + const s = !Mt.length; for (const a of r) - a[1](), Dt.push(a, e); + a[1](), Mt.push(a, e); if (s) { - for (let a = 0; a < Dt.length; a += 2) - Dt[a][0](Dt[a + 1]); - Dt.length = 0; + for (let a = 0; a < Mt.length; a += 2) + Mt[a][0](Mt[a + 1]); + Mt.length = 0; } } } function o(u) { i(u(e)); } - function l(u, s = kt) { + function l(u, s = Et) { const a = [u, s]; - return r.add(a), r.size === 1 && (n = t(i, o) || kt), u(e), () => { + return r.add(a), r.size === 1 && (n = t(i, o) || Et), u(e), () => { r.delete(a), r.size === 0 && n && (n(), n = null); }; } return { set: i, update: o, subscribe: l }; } -function Qt(e, t, n) { +function Jt(e, t, n) { const r = !Array.isArray(e), i = r ? [e] : e; if (!i.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); const o = t.length < 2; - return mc(n, (l, u) => { + return Gf(n, (l, u) => { let s = !1; const a = []; - let f = 0, d = kt; + let f = 0, d = Et; const c = () => { if (f) return; d(); - const _ = t(r ? a[0] : a, l, u); - o ? l(_) : d = cc(_) ? _ : kt; - }, h = i.map( - (_, m) => _c( - _, + const h = t(r ? a[0] : a, l, u); + o ? l(h) : d = Mf(h) ? h : Et; + }, _ = i.map( + (h, p) => Uf( + h, (g) => { - a[m] = g, f &= ~(1 << m), s && c(); + a[p] = g, f &= ~(1 << p), s && c(); }, () => { - f |= 1 << m; + f |= 1 << p; } ) ); return s = !0, c(), function() { - fc(h), d(), s = !1; + Df(_), d(), s = !1; }; }); } -function to(e) { +function Yi(e) { return Object.prototype.toString.call(e) === "[object Date]"; } -function Kr(e, t, n, r) { - if (typeof n == "number" || to(n)) { +function Jr(e, t, n, r) { + if (typeof n == "number" || Yi(n)) { const i = r - n, o = (n - t) / (e.dt || 1 / 60), l = e.opts.stiffness * i, u = e.opts.damping * o, s = (l - u) * e.inv_mass, a = (o + s) * e.dt; - return Math.abs(a) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, to(n) ? new Date(n.getTime() + a) : n + a); + return Math.abs(a) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, Yi(n) ? new Date(n.getTime() + a) : n + a); } else { if (Array.isArray(n)) return n.map( - (i, o) => Kr(e, t[o], n[o], r[o]) + (i, o) => Jr(e, t[o], n[o], r[o]) ); if (typeof n == "object") { const i = {}; for (const o in n) - i[o] = Kr(e, t[o], n[o], r[o]); + i[o] = Jr(e, t[o], n[o], r[o]); return i; } else throw new Error(`Cannot spring ${typeof n} values`); } } -function no(e, t = {}) { - const n = hn(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t; - let l, u, s, a = e, f = e, d = 1, c = 0, h = !1; - function _(g, p = {}) { +function Ki(e, t = {}) { + const n = _n(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t; + let l, u, s, a = e, f = e, d = 1, c = 0, _ = !1; + function h(g, m = {}) { f = g; const v = s = {}; - return e == null || p.hard || m.stiffness >= 1 && m.damping >= 1 ? (h = !0, l = eo(), a = g, n.set(e = f), Promise.resolve()) : (p.soft && (c = 1 / ((p.soft === !0 ? 0.5 : +p.soft) * 60), d = 0), u || (l = eo(), h = !1, u = hc((b) => { - if (h) - return h = !1, u = null, !1; + return e == null || m.hard || p.stiffness >= 1 && p.damping >= 1 ? (_ = !0, l = Qi(), a = g, n.set(e = f), Promise.resolve()) : (m.soft && (c = 1 / ((m.soft === !0 ? 0.5 : +m.soft) * 60), d = 0), u || (l = Qi(), _ = !1, u = Ff((w) => { + if (_) + return _ = !1, u = null, !1; d = Math.min(d + c, 1); - const w = { + const b = { inv_mass: d, - opts: m, + opts: p, settled: !0, - dt: (b - l) * 60 / 1e3 - }, y = Kr(w, a, e, f); - return l = b, a = e, n.set(e = y), w.settled && (u = null), !w.settled; - })), new Promise((b) => { + dt: (w - l) * 60 / 1e3 + }, y = Jr(b, a, e, f); + return l = w, a = e, n.set(e = y), b.settled && (u = null), !b.settled; + })), new Promise((w) => { u.promise.then(() => { - v === s && b(); + v === s && w(); }); })); } - const m = { - set: _, - update: (g, p) => _(g(f, e), p), + const p = { + set: h, + update: (g, m) => h(g(f, e), m), subscribe: n.subscribe, stiffness: r, damping: i, precision: o }; - return m; + return p; } -function pc(e) { +function qf(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var gc = function(t) { - return bc(t) && !wc(t); +var jf = function(t) { + return xf(t) && !zf(t); }; -function bc(e) { +function xf(e) { return !!e && typeof e == "object"; } -function wc(e) { +function zf(e) { var t = Object.prototype.toString.call(e); - return t === "[object RegExp]" || t === "[object Date]" || Ec(e); + return t === "[object RegExp]" || t === "[object Date]" || Wf(e); } -var vc = typeof Symbol == "function" && Symbol.for, yc = vc ? Symbol.for("react.element") : 60103; -function Ec(e) { - return e.$$typeof === yc; +var Vf = typeof Symbol == "function" && Symbol.for, Xf = Vf ? Symbol.for("react.element") : 60103; +function Wf(e) { + return e.$$typeof === Xf; } -function Sc(e) { +function Zf(e) { return Array.isArray(e) ? [] : {}; } -function an(e, t) { - return t.clone !== !1 && t.isMergeableObject(e) ? jt(Sc(e), e, t) : e; +function ln(e, t) { + return t.clone !== !1 && t.isMergeableObject(e) ? jt(Zf(e), e, t) : e; } -function kc(e, t, n) { +function Jf(e, t, n) { return e.concat(t).map(function(r) { - return an(r, n); + return ln(r, n); }); } -function Tc(e, t) { +function Qf(e, t) { if (!t.customMerge) return jt; var n = t.customMerge(e); return typeof n == "function" ? n : jt; } -function Ac(e) { +function Yf(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) { return Object.propertyIsEnumerable.call(e, t); }) : []; } -function ro(e) { - return Object.keys(e).concat(Ac(e)); +function $i(e) { + return Object.keys(e).concat(Yf(e)); } -function Xl(e, t) { +function Gl(e, t) { try { return t in e; } catch { return !1; } } -function Bc(e, t) { - return Xl(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); +function Kf(e, t) { + return Gl(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); } -function Cc(e, t, n) { +function $f(e, t, n) { var r = {}; - return n.isMergeableObject(e) && ro(e).forEach(function(i) { - r[i] = an(e[i], n); - }), ro(t).forEach(function(i) { - Bc(e, i) || (Xl(e, i) && n.isMergeableObject(t[i]) ? r[i] = Tc(i, n)(e[i], t[i], n) : r[i] = an(t[i], n)); + return n.isMergeableObject(e) && $i(e).forEach(function(i) { + r[i] = ln(e[i], n); + }), $i(t).forEach(function(i) { + Kf(e, i) || (Gl(e, i) && n.isMergeableObject(t[i]) ? r[i] = Qf(i, n)(e[i], t[i], n) : r[i] = ln(t[i], n)); }), r; } function jt(e, t, n) { - n = n || {}, n.arrayMerge = n.arrayMerge || kc, n.isMergeableObject = n.isMergeableObject || gc, n.cloneUnlessOtherwiseSpecified = an; + n = n || {}, n.arrayMerge = n.arrayMerge || Jf, n.isMergeableObject = n.isMergeableObject || jf, n.cloneUnlessOtherwiseSpecified = ln; var r = Array.isArray(t), i = Array.isArray(e), o = r === i; - return o ? r ? n.arrayMerge(e, t, n) : Cc(e, t, n) : an(t, n); + return o ? r ? n.arrayMerge(e, t, n) : $f(e, t, n) : ln(t, n); } jt.all = function(t, n) { if (!Array.isArray(t)) @@ -3111,36 +2953,36 @@ jt.all = function(t, n) { return jt(r, i, n); }, {}); }; -var Ic = jt, Lc = Ic; -const Pc = /* @__PURE__ */ pc(Lc); -var $r = function(e, t) { - return $r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) { +var ec = jt, tc = ec; +const nc = /* @__PURE__ */ qf(tc); +var Qr = function(e, t) { + return Qr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) { n.__proto__ = r; } || function(n, r) { for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]); - }, $r(e, t); + }, Qr(e, t); }; -function tr(e, t) { +function $n(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); - $r(e, t); + Qr(e, t); function n() { this.constructor = e; } e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n()); } -var $ = function() { - return $ = Object.assign || function(t) { +var Y = function() { + return Y = Object.assign || function(t) { for (var n, r = 1, i = arguments.length; r < i; r++) { n = arguments[r]; for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); } return t; - }, $.apply(this, arguments); + }, Y.apply(this, arguments); }; -function Pr(e, t, n) { +function Cr(e, t, n) { if (n || arguments.length === 2) for (var r = 0, i = t.length, o; r < i; r++) (o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]); @@ -3150,51 +2992,51 @@ var V; (function(e) { e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(V || (V = {})); -var ae; +var se; (function(e) { e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag"; -})(ae || (ae = {})); +})(se || (se = {})); var xt; (function(e) { e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime"; })(xt || (xt = {})); -function io(e) { - return e.type === ae.literal; +function eo(e) { + return e.type === se.literal; } -function Oc(e) { - return e.type === ae.argument; +function rc(e) { + return e.type === se.argument; } -function Wl(e) { - return e.type === ae.number; +function ql(e) { + return e.type === se.number; } -function Zl(e) { - return e.type === ae.date; +function jl(e) { + return e.type === se.date; } -function Jl(e) { - return e.type === ae.time; +function xl(e) { + return e.type === se.time; } -function Ql(e) { - return e.type === ae.select; +function zl(e) { + return e.type === se.select; } -function Yl(e) { - return e.type === ae.plural; +function Vl(e) { + return e.type === se.plural; } -function Hc(e) { - return e.type === ae.pound; +function ic(e) { + return e.type === se.pound; } -function Kl(e) { - return e.type === ae.tag; +function Xl(e) { + return e.type === se.tag; } -function $l(e) { +function Wl(e) { return !!(e && typeof e == "object" && e.type === xt.number); } -function ei(e) { +function Yr(e) { return !!(e && typeof e == "object" && e.type === xt.dateTime); } -var es = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Nc = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; -function Mc(e) { +var Zl = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, oc = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; +function lc(e) { var t = {}; - return e.replace(Nc, function(n) { + return e.replace(oc, function(n) { var r = n.length; switch (n[0]) { case "G": @@ -3283,11 +3125,11 @@ function Mc(e) { return ""; }), t; } -var Dc = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function Rc(e) { +var sc = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function ac(e) { if (e.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var t = e.split(Dc).filter(function(c) { + for (var t = e.split(sc).filter(function(c) { return c.length > 0; }), n = [], r = 0, i = t; r < i.length; r++) { var o = i[r], l = o.split("/"); @@ -3302,17 +3144,17 @@ function Rc(e) { } return n; } -function Uc(e) { +function uc(e) { return e.replace(/^(.*?)-/, ""); } -var oo = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, ts = /^(@+)?(\+|#+)?[rs]?$/g, Fc = /(\*)(0+)|(#+)(0+)|(0+)/g, ns = /^(0+)$/; -function lo(e) { +var to = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Jl = /^(@+)?(\+|#+)?[rs]?$/g, fc = /(\*)(0+)|(#+)(0+)|(0+)/g, Ql = /^(0+)$/; +function no(e) { var t = {}; - return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(ts, function(n, r, i) { + return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Jl, function(n, r, i) { return typeof i != "string" ? (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length) : i === "+" ? t.minimumSignificantDigits = r.length : r[0] === "#" ? t.maximumSignificantDigits = r.length : (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length + (typeof i == "string" ? i.length : 0)), ""; }), t; } -function rs(e) { +function Yl(e) { switch (e) { case "sign-auto": return { @@ -3352,7 +3194,7 @@ function rs(e) { }; } } -function Gc(e) { +function cc(e) { var t; if (e[0] === "E" && e[1] === "E" ? (t = { notation: "engineering" @@ -3360,17 +3202,17 @@ function Gc(e) { notation: "scientific" }, e = e.slice(1)), t) { var n = e.slice(0, 2); - if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !ns.test(e)) + if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Ql.test(e)) throw new Error("Malformed concise eng/scientific notation"); t.minimumIntegerDigits = e.length; } return t; } -function so(e) { - var t = {}, n = rs(e); +function ro(e) { + var t = {}, n = Yl(e); return n || t; } -function qc(e) { +function dc(e) { for (var t = {}, n = 0, r = e; n < r.length; n++) { var i = r[n]; switch (i.stem) { @@ -3394,7 +3236,7 @@ function qc(e) { continue; case "measure-unit": case "unit": - t.style = "unit", t.unit = Uc(i.options[0]); + t.style = "unit", t.unit = uc(i.options[0]); continue; case "compact-short": case "K": @@ -3405,13 +3247,13 @@ function qc(e) { t.notation = "compact", t.compactDisplay = "long"; continue; case "scientific": - t = $($($({}, t), { notation: "scientific" }), i.options.reduce(function(s, a) { - return $($({}, s), so(a)); + t = Y(Y(Y({}, t), { notation: "scientific" }), i.options.reduce(function(s, a) { + return Y(Y({}, s), ro(a)); }, {})); continue; case "engineering": - t = $($($({}, t), { notation: "engineering" }), i.options.reduce(function(s, a) { - return $($({}, s), so(a)); + t = Y(Y(Y({}, t), { notation: "engineering" }), i.options.reduce(function(s, a) { + return Y(Y({}, s), ro(a)); }, {})); continue; case "notation-simple": @@ -3435,45 +3277,45 @@ function qc(e) { case "integer-width": if (i.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - i.options[0].replace(Fc, function(s, a, f, d, c, h) { + i.options[0].replace(fc, function(s, a, f, d, c, _) { if (a) t.minimumIntegerDigits = f.length; else { if (d && c) throw new Error("We currently do not support maximum integer digits"); - if (h) + if (_) throw new Error("We currently do not support exact integer digits"); } return ""; }); continue; } - if (ns.test(i.stem)) { + if (Ql.test(i.stem)) { t.minimumIntegerDigits = i.stem.length; continue; } - if (oo.test(i.stem)) { + if (to.test(i.stem)) { if (i.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - i.stem.replace(oo, function(s, a, f, d, c, h) { - return f === "*" ? t.minimumFractionDigits = a.length : d && d[0] === "#" ? t.maximumFractionDigits = d.length : c && h ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + h.length) : (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length), ""; + i.stem.replace(to, function(s, a, f, d, c, _) { + return f === "*" ? t.minimumFractionDigits = a.length : d && d[0] === "#" ? t.maximumFractionDigits = d.length : c && _ ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + _.length) : (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length), ""; }); var o = i.options[0]; - o === "w" ? t = $($({}, t), { trailingZeroDisplay: "stripIfInteger" }) : o && (t = $($({}, t), lo(o))); + o === "w" ? t = Y(Y({}, t), { trailingZeroDisplay: "stripIfInteger" }) : o && (t = Y(Y({}, t), no(o))); continue; } - if (ts.test(i.stem)) { - t = $($({}, t), lo(i.stem)); + if (Jl.test(i.stem)) { + t = Y(Y({}, t), no(i.stem)); continue; } - var l = rs(i.stem); - l && (t = $($({}, t), l)); - var u = Gc(i.stem); - u && (t = $($({}, t), u)); + var l = Yl(i.stem); + l && (t = Y(Y({}, t), l)); + var u = cc(i.stem); + u && (t = Y(Y({}, t), u)); } return t; } -var Pn = { +var Ln = { AX: [ "H" ], @@ -4810,13 +4652,13 @@ var Pn = { "h" ] }; -function jc(e, t) { +function _c(e, t) { for (var n = "", r = 0; r < e.length; r++) { var i = e.charAt(r); if (i === "j") { for (var o = 0; r + 1 < e.length && e.charAt(r + 1) === i; ) o++, r++; - var l = 1 + (o & 1), u = o < 2 ? 1 : 3 + (o >> 1), s = "a", a = xc(t); + var l = 1 + (o & 1), u = o < 2 ? 1 : 3 + (o >> 1), s = "a", a = hc(t); for ((a == "H" || a == "k") && (u = 0); u-- > 0; ) n += s; for (; l-- > 0; ) @@ -4826,7 +4668,7 @@ function jc(e, t) { } return n; } -function xc(e) { +function hc(e) { var t = e.hourCycle; if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet e.hourCycles && // @ts-ignore @@ -4845,23 +4687,23 @@ function xc(e) { } var n = e.language, r; n !== "root" && (r = e.maximize().region); - var i = Pn[r || ""] || Pn[n || ""] || Pn["".concat(n, "-001")] || Pn["001"]; + var i = Ln[r || ""] || Ln[n || ""] || Ln["".concat(n, "-001")] || Ln["001"]; return i[0]; } -var Or, zc = new RegExp("^".concat(es.source, "*")), Vc = new RegExp("".concat(es.source, "*$")); +var Ir, mc = new RegExp("^".concat(Zl.source, "*")), pc = new RegExp("".concat(Zl.source, "*$")); function X(e, t) { return { start: e, end: t }; } -var Xc = !!String.prototype.startsWith, Wc = !!String.fromCodePoint, Zc = !!Object.fromEntries, Jc = !!String.prototype.codePointAt, Qc = !!String.prototype.trimStart, Yc = !!String.prototype.trimEnd, Kc = !!Number.isSafeInteger, $c = Kc ? Number.isSafeInteger : function(e) { +var gc = !!String.prototype.startsWith, bc = !!String.fromCodePoint, wc = !!Object.fromEntries, vc = !!String.prototype.codePointAt, yc = !!String.prototype.trimStart, Ec = !!String.prototype.trimEnd, Sc = !!Number.isSafeInteger, kc = Sc ? Number.isSafeInteger : function(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991; -}, ti = !0; +}, Kr = !0; try { - var e0 = os("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - ti = ((Or = e0.exec("a")) === null || Or === void 0 ? void 0 : Or[0]) === "a"; + var Tc = $l("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + Kr = ((Ir = Tc.exec("a")) === null || Ir === void 0 ? void 0 : Ir[0]) === "a"; } catch { - ti = !1; + Kr = !1; } -var ao = Xc ? ( +var io = gc ? ( // Native function(t, n, r) { return t.startsWith(n, r); @@ -4871,7 +4713,7 @@ var ao = Xc ? ( function(t, n, r) { return t.slice(r, r + n.length) === n; } -), ni = Wc ? String.fromCodePoint : ( +), $r = bc ? String.fromCodePoint : ( // IE11 function() { for (var t = [], n = 0; n < arguments.length; n++) @@ -4883,9 +4725,9 @@ var ao = Xc ? ( } return r; } -), uo = ( +), oo = ( // native - Zc ? Object.fromEntries : ( + wc ? Object.fromEntries : ( // Ponyfill function(t) { for (var n = {}, r = 0, i = t; r < i.length; r++) { @@ -4895,7 +4737,7 @@ var ao = Xc ? ( return n; } ) -), is = Jc ? ( +), Kl = vc ? ( // Native function(t, n) { return t.codePointAt(n); @@ -4909,7 +4751,7 @@ var ao = Xc ? ( return i < 55296 || i > 56319 || n + 1 === r || (o = t.charCodeAt(n + 1)) < 56320 || o > 57343 ? i : (i - 55296 << 10) + (o - 56320) + 65536; } } -), t0 = Qc ? ( +), Ac = yc ? ( // Native function(t) { return t.trimStart(); @@ -4917,9 +4759,9 @@ var ao = Xc ? ( ) : ( // Ponyfill function(t) { - return t.replace(zc, ""); + return t.replace(mc, ""); } -), n0 = Yc ? ( +), Bc = Ec ? ( // Native function(t) { return t.trimEnd(); @@ -4927,32 +4769,32 @@ var ao = Xc ? ( ) : ( // Ponyfill function(t) { - return t.replace(Vc, ""); + return t.replace(pc, ""); } ); -function os(e, t) { +function $l(e, t) { return new RegExp(e, t); } -var ri; -if (ti) { - var fo = os("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - ri = function(t, n) { +var ei; +if (Kr) { + var lo = $l("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + ei = function(t, n) { var r; - fo.lastIndex = n; - var i = fo.exec(t); + lo.lastIndex = n; + var i = lo.exec(t); return (r = i[1]) !== null && r !== void 0 ? r : ""; }; } else - ri = function(t, n) { + ei = function(t, n) { for (var r = []; ; ) { - var i = is(t, n); - if (i === void 0 || ls(i) || l0(i)) + var i = Kl(t, n); + if (i === void 0 || es(i) || Oc(i)) break; r.push(i), n += i >= 65536 ? 2 : 1; } - return ni.apply(void 0, r); + return $r.apply(void 0, r); }; -var r0 = ( +var Cc = ( /** @class */ function() { function e(t, n) { @@ -4976,14 +4818,14 @@ var r0 = ( if (o === 35 && (n === "plural" || n === "selectordinal")) { var u = this.clonePosition(); this.bump(), i.push({ - type: ae.pound, + type: se.pound, location: X(u, this.clonePosition()) }); } else if (o === 60 && !this.ignoreTag && this.peek() === 47) { if (r) break; return this.error(V.UNMATCHED_CLOSING_TAG, X(this.clonePosition(), this.clonePosition())); - } else if (o === 60 && !this.ignoreTag && ii(this.peek() || 0)) { + } else if (o === 60 && !this.ignoreTag && ti(this.peek() || 0)) { var l = this.parseTag(t, n); if (l.err) return l; @@ -5004,7 +4846,7 @@ var r0 = ( if (this.bumpSpace(), this.bumpIf("/>")) return { val: { - type: ae.literal, + type: se.literal, value: "<".concat(i, "/>"), location: X(r, this.clonePosition()) }, @@ -5016,12 +4858,12 @@ var r0 = ( return o; var l = o.val, u = this.clonePosition(); if (this.bumpIf("")) { - if (this.isEOF() || !ii(this.char())) + if (this.isEOF() || !ti(this.char())) return this.error(V.INVALID_TAG, X(u, this.clonePosition())); var s = this.clonePosition(), a = this.parseTagName(); return i !== a ? this.error(V.UNMATCHED_CLOSING_TAG, X(s, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { val: { - type: ae.tag, + type: se.tag, value: i, children: l, location: X(r, this.clonePosition()) @@ -5034,7 +4876,7 @@ var r0 = ( return this.error(V.INVALID_TAG, X(r, this.clonePosition())); }, e.prototype.parseTagName = function() { var t = this.offset(); - for (this.bump(); !this.isEOF() && o0(this.char()); ) + for (this.bump(); !this.isEOF() && Lc(this.char()); ) this.bump(); return this.message.slice(t, this.offset()); }, e.prototype.parseLiteral = function(t, n) { @@ -5058,12 +4900,12 @@ var r0 = ( } var s = X(r, this.clonePosition()); return { - val: { type: ae.literal, value: i, location: s }, + val: { type: se.literal, value: i, location: s }, err: null }; }, e.prototype.tryParseLeftAngleBracket = function() { return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. - !i0(this.peek() || 0)) ? (this.bump(), "<") : null; + !Ic(this.peek() || 0)) ? (this.bump(), "<") : null; }, e.prototype.tryParseQuote = function(t) { if (this.isEOF() || this.char() !== 39) return null; @@ -5097,12 +4939,12 @@ var r0 = ( n.push(r); this.bump(); } - return ni.apply(void 0, n); + return $r.apply(void 0, n); }, e.prototype.tryParseUnquoted = function(t, n) { if (this.isEOF()) return null; var r = this.char(); - return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), ni(r)); + return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), $r(r)); }, e.prototype.parseArgument = function(t, n) { var r = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) @@ -5118,7 +4960,7 @@ var r0 = ( case 125: return this.bump(), { val: { - type: ae.argument, + type: se.argument, // value does not include the opening and closing braces. value: i, location: X(r, this.clonePosition()) @@ -5131,7 +4973,7 @@ var r0 = ( return this.error(V.MALFORMED_ARGUMENT, X(r, this.clonePosition())); } }, e.prototype.parseIdentifierIfPossible = function() { - var t = this.clonePosition(), n = this.offset(), r = ri(this.message, n), i = n + r.length; + var t = this.clonePosition(), n = this.offset(), r = ei(this.message, n), i = n + r.length; this.bumpTo(i); var o = this.clonePosition(), l = X(t, o); return { value: r, location: l }; @@ -5150,46 +4992,46 @@ var r0 = ( var f = this.clonePosition(), d = this.parseSimpleArgStyleIfPossible(); if (d.err) return d; - var c = n0(d.val); + var c = Bc(d.val); if (c.length === 0) return this.error(V.EXPECT_ARGUMENT_STYLE, X(this.clonePosition(), this.clonePosition())); - var h = X(f, this.clonePosition()); - a = { style: c, styleLocation: h }; + var _ = X(f, this.clonePosition()); + a = { style: c, styleLocation: _ }; } - var _ = this.tryParseArgumentClose(i); - if (_.err) - return _; - var m = X(i, this.clonePosition()); - if (a && ao(a == null ? void 0 : a.style, "::", 0)) { - var g = t0(a.style.slice(2)); + var h = this.tryParseArgumentClose(i); + if (h.err) + return h; + var p = X(i, this.clonePosition()); + if (a && io(a == null ? void 0 : a.style, "::", 0)) { + var g = Ac(a.style.slice(2)); if (u === "number") { var d = this.parseNumberSkeletonFromString(g, a.styleLocation); return d.err ? d : { - val: { type: ae.number, value: r, location: m, style: d.val }, + val: { type: se.number, value: r, location: p, style: d.val }, err: null }; } else { if (g.length === 0) - return this.error(V.EXPECT_DATE_TIME_SKELETON, m); - var p = g; - this.locale && (p = jc(g, this.locale)); + return this.error(V.EXPECT_DATE_TIME_SKELETON, p); + var m = g; + this.locale && (m = _c(g, this.locale)); var c = { type: xt.dateTime, - pattern: p, + pattern: m, location: a.styleLocation, - parsedOptions: this.shouldParseSkeletons ? Mc(p) : {} - }, v = u === "date" ? ae.date : ae.time; + parsedOptions: this.shouldParseSkeletons ? lc(m) : {} + }, v = u === "date" ? se.date : se.time; return { - val: { type: v, value: r, location: m, style: c }, + val: { type: v, value: r, location: p, style: c }, err: null }; } } return { val: { - type: u === "number" ? ae.number : u === "date" ? ae.date : ae.time, + type: u === "number" ? se.number : u === "date" ? se.date : se.time, value: r, - location: m, + location: p, style: (o = a == null ? void 0 : a.style) !== null && o !== void 0 ? o : null }, err: null @@ -5198,40 +5040,40 @@ var r0 = ( case "plural": case "selectordinal": case "select": { - var b = this.clonePosition(); + var w = this.clonePosition(); if (this.bumpSpace(), !this.bumpIf(",")) - return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS, X(b, $({}, b))); + return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS, X(w, Y({}, w))); this.bumpSpace(); - var w = this.parseIdentifierIfPossible(), y = 0; - if (u !== "select" && w.value === "offset") { + var b = this.parseIdentifierIfPossible(), y = 0; + if (u !== "select" && b.value === "offset") { if (!this.bumpIf(":")) return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, X(this.clonePosition(), this.clonePosition())); this.bumpSpace(); var d = this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); if (d.err) return d; - this.bumpSpace(), w = this.parseIdentifierIfPossible(), y = d.val; + this.bumpSpace(), b = this.parseIdentifierIfPossible(), y = d.val; } - var S = this.tryParsePluralOrSelectOptions(t, u, n, w); - if (S.err) - return S; - var _ = this.tryParseArgumentClose(i); - if (_.err) - return _; + var k = this.tryParsePluralOrSelectOptions(t, u, n, b); + if (k.err) + return k; + var h = this.tryParseArgumentClose(i); + if (h.err) + return h; var C = X(i, this.clonePosition()); return u === "select" ? { val: { - type: ae.select, + type: se.select, value: r, - options: uo(S.val), + options: oo(k.val), location: C }, err: null } : { val: { - type: ae.plural, + type: se.plural, value: r, - options: uo(S.val), + options: oo(k.val), offset: y, pluralType: u === "plural" ? "cardinal" : "ordinal", location: C @@ -5282,7 +5124,7 @@ var r0 = ( }, e.prototype.parseNumberSkeletonFromString = function(t, n) { var r = []; try { - r = Rc(t); + r = ac(t); } catch { return this.error(V.INVALID_NUMBER_SKELETON, n); } @@ -5291,7 +5133,7 @@ var r0 = ( type: xt.number, tokens: r, location: n, - parsedOptions: this.shouldParseSkeletons ? qc(r) : {} + parsedOptions: this.shouldParseSkeletons ? dc(r) : {} }, err: null }; @@ -5310,20 +5152,20 @@ var r0 = ( if (s.has(a)) return this.error(n === "select" ? V.DUPLICATE_SELECT_ARGUMENT_SELECTOR : V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f); a === "other" && (l = !0), this.bumpSpace(); - var h = this.clonePosition(); + var _ = this.clonePosition(); if (!this.bumpIf("{")) return this.error(n === "select" ? V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, X(this.clonePosition(), this.clonePosition())); - var _ = this.parseMessage(t + 1, n, r); - if (_.err) - return _; - var m = this.tryParseArgumentClose(h); - if (m.err) - return m; + var h = this.parseMessage(t + 1, n, r); + if (h.err) + return h; + var p = this.tryParseArgumentClose(_); + if (p.err) + return p; u.push([ a, { - value: _.val, - location: X(h, this.clonePosition()) + value: h.val, + location: X(_, this.clonePosition()) } ]), s.add(a), this.bumpSpace(), o = this.parseIdentifierIfPossible(), a = o.value, f = o.location; } @@ -5339,7 +5181,7 @@ var r0 = ( break; } var s = X(i, this.clonePosition()); - return o ? (l *= r, $c(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s); + return o ? (l *= r, kc(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s); }, e.prototype.offset = function() { return this.position.offset; }, e.prototype.isEOF = function() { @@ -5354,7 +5196,7 @@ var r0 = ( var t = this.position.offset; if (t >= this.message.length) throw Error("out of bound"); - var n = is(this.message, t); + var n = Kl(this.message, t); if (n === void 0) throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary")); return n; @@ -5373,7 +5215,7 @@ var r0 = ( t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2); } }, e.prototype.bumpIf = function(t) { - if (ao(this.message, t, this.offset())) { + if (io(this.message, t, this.offset())) { for (var n = 0; n < t.length; n++) this.bump(); return !0; @@ -5395,7 +5237,7 @@ var r0 = ( break; } }, e.prototype.bumpSpace = function() { - for (; !this.isEOF() && ls(this.char()); ) + for (; !this.isEOF() && es(this.char()); ) this.bump(); }, e.prototype.peek = function() { if (this.isEOF()) @@ -5405,97 +5247,97 @@ var r0 = ( }, e; }() ); -function ii(e) { +function ti(e) { return e >= 97 && e <= 122 || e >= 65 && e <= 90; } -function i0(e) { - return ii(e) || e === 47; +function Ic(e) { + return ti(e) || e === 47; } -function o0(e) { +function Lc(e) { return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039; } -function ls(e) { +function es(e) { return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233; } -function l0(e) { +function Oc(e) { return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094; } -function oi(e) { +function ni(e) { e.forEach(function(t) { - if (delete t.location, Ql(t) || Yl(t)) + if (delete t.location, zl(t) || Vl(t)) for (var n in t.options) - delete t.options[n].location, oi(t.options[n].value); + delete t.options[n].location, ni(t.options[n].value); else - Wl(t) && $l(t.style) || (Zl(t) || Jl(t)) && ei(t.style) ? delete t.style.location : Kl(t) && oi(t.children); + ql(t) && Wl(t.style) || (jl(t) || xl(t)) && Yr(t.style) ? delete t.style.location : Xl(t) && ni(t.children); }); } -function s0(e, t) { - t === void 0 && (t = {}), t = $({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); - var n = new r0(e, t).parse(); +function Pc(e, t) { + t === void 0 && (t = {}), t = Y({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); + var n = new Cc(e, t).parse(); if (n.err) { var r = SyntaxError(V[n.err.kind]); throw r.location = n.err.location, r.originalMessage = n.err.message, r; } - return t != null && t.captureLocation || oi(n.val), n.val; + return t != null && t.captureLocation || ni(n.val), n.val; } -function Hr(e, t) { - var n = t && t.cache ? t.cache : _0, r = t && t.serializer ? t.serializer : d0, i = t && t.strategy ? t.strategy : u0; +function Lr(e, t) { + var n = t && t.cache ? t.cache : Uc, r = t && t.serializer ? t.serializer : Rc, i = t && t.strategy ? t.strategy : Hc; return i(e, { cache: n, serializer: r }); } -function a0(e) { +function Nc(e) { return e == null || typeof e == "number" || typeof e == "boolean"; } -function ss(e, t, n, r) { - var i = a0(r) ? r : n(r), o = t.get(i); +function ts(e, t, n, r) { + var i = Nc(r) ? r : n(r), o = t.get(i); return typeof o > "u" && (o = e.call(this, r), t.set(i, o)), o; } -function as(e, t, n) { +function ns(e, t, n) { var r = Array.prototype.slice.call(arguments, 3), i = n(r), o = t.get(i); return typeof o > "u" && (o = e.apply(this, r), t.set(i, o)), o; } -function pi(e, t, n, r, i) { +function _i(e, t, n, r, i) { return n.bind(t, e, r, i); } -function u0(e, t) { - var n = e.length === 1 ? ss : as; - return pi(e, this, n, t.cache.create(), t.serializer); +function Hc(e, t) { + var n = e.length === 1 ? ts : ns; + return _i(e, this, n, t.cache.create(), t.serializer); } -function f0(e, t) { - return pi(e, this, as, t.cache.create(), t.serializer); +function Dc(e, t) { + return _i(e, this, ns, t.cache.create(), t.serializer); } -function c0(e, t) { - return pi(e, this, ss, t.cache.create(), t.serializer); +function Mc(e, t) { + return _i(e, this, ts, t.cache.create(), t.serializer); } -var d0 = function() { +var Rc = function() { return JSON.stringify(arguments); }; -function gi() { +function hi() { this.cache = /* @__PURE__ */ Object.create(null); } -gi.prototype.get = function(e) { +hi.prototype.get = function(e) { return this.cache[e]; }; -gi.prototype.set = function(e, t) { +hi.prototype.set = function(e, t) { this.cache[e] = t; }; -var _0 = { +var Uc = { create: function() { - return new gi(); + return new hi(); } -}, Nr = { - variadic: f0, - monadic: c0 +}, Or = { + variadic: Dc, + monadic: Mc }, zt; (function(e) { e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API"; })(zt || (zt = {})); -var nr = ( +var er = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i) { var o = e.call(this, n) || this; return o.code = r, o.originalMessage = i, o; @@ -5504,155 +5346,155 @@ var nr = ( return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); }, t; }(Error) -), co = ( +), so = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i, o) { return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(i).join('", "'), '"'), zt.INVALID_VALUE, o) || this; } return t; - }(nr) -), h0 = ( + }(er) +), Fc = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r, i) { return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), zt.INVALID_VALUE, i) || this; } return t; - }(nr) -), m0 = ( + }(er) +), Gc = ( /** @class */ function(e) { - tr(t, e); + $n(t, e); function t(n, r) { return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'), zt.MISSING_VALUE, r) || this; } return t; - }(nr) -), ke; + }(er) +), Se; (function(e) { e[e.literal = 0] = "literal", e[e.object = 1] = "object"; -})(ke || (ke = {})); -function p0(e) { +})(Se || (Se = {})); +function qc(e) { return e.length < 2 ? e : e.reduce(function(t, n) { var r = t[t.length - 1]; - return !r || r.type !== ke.literal || n.type !== ke.literal ? t.push(n) : r.value += n.value, t; + return !r || r.type !== Se.literal || n.type !== Se.literal ? t.push(n) : r.value += n.value, t; }, []); } -function g0(e) { +function jc(e) { return typeof e == "function"; } -function Rn(e, t, n, r, i, o, l) { - if (e.length === 1 && io(e[0])) +function Dn(e, t, n, r, i, o, l) { + if (e.length === 1 && eo(e[0])) return [ { - type: ke.literal, + type: Se.literal, value: e[0].value } ]; for (var u = [], s = 0, a = e; s < a.length; s++) { var f = a[s]; - if (io(f)) { + if (eo(f)) { u.push({ - type: ke.literal, + type: Se.literal, value: f.value }); continue; } - if (Hc(f)) { + if (ic(f)) { typeof o == "number" && u.push({ - type: ke.literal, + type: Se.literal, value: n.getNumberFormat(t).format(o) }); continue; } var d = f.value; if (!(i && d in i)) - throw new m0(d, l); + throw new Gc(d, l); var c = i[d]; - if (Oc(f)) { + if (rc(f)) { (!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), u.push({ - type: typeof c == "string" ? ke.literal : ke.object, + type: typeof c == "string" ? Se.literal : Se.object, value: c }); continue; } - if (Zl(f)) { - var h = typeof f.style == "string" ? r.date[f.style] : ei(f.style) ? f.style.parsedOptions : void 0; + if (jl(f)) { + var _ = typeof f.style == "string" ? r.date[f.style] : Yr(f.style) ? f.style.parsedOptions : void 0; u.push({ - type: ke.literal, - value: n.getDateTimeFormat(t, h).format(c) + type: Se.literal, + value: n.getDateTimeFormat(t, _).format(c) }); continue; } - if (Jl(f)) { - var h = typeof f.style == "string" ? r.time[f.style] : ei(f.style) ? f.style.parsedOptions : r.time.medium; + if (xl(f)) { + var _ = typeof f.style == "string" ? r.time[f.style] : Yr(f.style) ? f.style.parsedOptions : r.time.medium; u.push({ - type: ke.literal, - value: n.getDateTimeFormat(t, h).format(c) + type: Se.literal, + value: n.getDateTimeFormat(t, _).format(c) }); continue; } - if (Wl(f)) { - var h = typeof f.style == "string" ? r.number[f.style] : $l(f.style) ? f.style.parsedOptions : void 0; - h && h.scale && (c = c * (h.scale || 1)), u.push({ - type: ke.literal, - value: n.getNumberFormat(t, h).format(c) + if (ql(f)) { + var _ = typeof f.style == "string" ? r.number[f.style] : Wl(f.style) ? f.style.parsedOptions : void 0; + _ && _.scale && (c = c * (_.scale || 1)), u.push({ + type: Se.literal, + value: n.getNumberFormat(t, _).format(c) }); continue; } - if (Kl(f)) { - var _ = f.children, m = f.value, g = i[m]; - if (!g0(g)) - throw new h0(m, "function", l); - var p = Rn(_, t, n, r, i, o), v = g(p.map(function(y) { + if (Xl(f)) { + var h = f.children, p = f.value, g = i[p]; + if (!jc(g)) + throw new Fc(p, "function", l); + var m = Dn(h, t, n, r, i, o), v = g(m.map(function(y) { return y.value; })); Array.isArray(v) || (v = [v]), u.push.apply(u, v.map(function(y) { return { - type: typeof y == "string" ? ke.literal : ke.object, + type: typeof y == "string" ? Se.literal : Se.object, value: y }; })); } - if (Ql(f)) { - var b = f.options[c] || f.options.other; - if (!b) - throw new co(f.value, c, Object.keys(f.options), l); - u.push.apply(u, Rn(b.value, t, n, r, i)); + if (zl(f)) { + var w = f.options[c] || f.options.other; + if (!w) + throw new so(f.value, c, Object.keys(f.options), l); + u.push.apply(u, Dn(w.value, t, n, r, i)); continue; } - if (Yl(f)) { - var b = f.options["=".concat(c)]; - if (!b) { + if (Vl(f)) { + var w = f.options["=".concat(c)]; + if (!w) { if (!Intl.PluralRules) - throw new nr(`Intl.PluralRules is not available in this environment. + throw new er(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" `, zt.MISSING_INTL_API, l); - var w = n.getPluralRules(t, { type: f.pluralType }).select(c - (f.offset || 0)); - b = f.options[w] || f.options.other; + var b = n.getPluralRules(t, { type: f.pluralType }).select(c - (f.offset || 0)); + w = f.options[b] || f.options.other; } - if (!b) - throw new co(f.value, c, Object.keys(f.options), l); - u.push.apply(u, Rn(b.value, t, n, r, i, c - (f.offset || 0))); + if (!w) + throw new so(f.value, c, Object.keys(f.options), l); + u.push.apply(u, Dn(w.value, t, n, r, i, c - (f.offset || 0))); continue; } } - return p0(u); + return qc(u); } -function b0(e, t) { - return t ? $($($({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) { - return n[r] = $($({}, e[r]), t[r] || {}), n; +function xc(e, t) { + return t ? Y(Y(Y({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) { + return n[r] = Y(Y({}, e[r]), t[r] || {}), n; }, {})) : e; } -function w0(e, t) { +function zc(e, t) { return t ? Object.keys(e).reduce(function(n, r) { - return n[r] = b0(e[r], t[r]), n; - }, $({}, e)) : e; + return n[r] = xc(e[r], t[r]), n; + }, Y({}, e)) : e; } -function Mr(e) { +function Pr(e) { return { create: function() { return { @@ -5666,39 +5508,39 @@ function Mr(e) { } }; } -function v0(e) { +function Vc(e) { return e === void 0 && (e = { number: {}, dateTime: {}, pluralRules: {} }), { - getNumberFormat: Hr(function() { + getNumberFormat: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.NumberFormat).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.NumberFormat).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.number), - strategy: Nr.variadic + cache: Pr(e.number), + strategy: Or.variadic }), - getDateTimeFormat: Hr(function() { + getDateTimeFormat: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.DateTimeFormat).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.DateTimeFormat).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.dateTime), - strategy: Nr.variadic + cache: Pr(e.dateTime), + strategy: Or.variadic }), - getPluralRules: Hr(function() { + getPluralRules: Lr(function() { for (var t, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r]; - return new ((t = Intl.PluralRules).bind.apply(t, Pr([void 0], n, !1)))(); + return new ((t = Intl.PluralRules).bind.apply(t, Cr([void 0], n, !1)))(); }, { - cache: Mr(e.pluralRules), - strategy: Nr.variadic + cache: Pr(e.pluralRules), + strategy: Or.variadic }) }; } -var y0 = ( +var Xc = ( /** @class */ function() { function e(t, n, r, i) { @@ -5712,11 +5554,11 @@ var y0 = ( if (u.length === 1) return u[0].value; var s = u.reduce(function(a, f) { - return !a.length || f.type !== ke.literal || typeof a[a.length - 1] != "string" ? a.push(f.value) : a[a.length - 1] += f.value, a; + return !a.length || f.type !== Se.literal || typeof a[a.length - 1] != "string" ? a.push(f.value) : a[a.length - 1] += f.value, a; }, []); return s.length <= 1 ? s[0] || "" : s; }, this.formatToParts = function(l) { - return Rn(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message); + return Dn(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message); }, this.resolvedOptions = function() { return { locale: o.resolvedLocale.toString() @@ -5734,7 +5576,7 @@ var y0 = ( this.ast = t; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = w0(e.formats, r), this.formatters = i && i.formatters || v0(this.formatterCache); + this.formats = zc(e.formats, r), this.formatters = i && i.formatters || Vc(this.formatterCache); } return Object.defineProperty(e, "defaultLocale", { get: function() { @@ -5745,7 +5587,7 @@ var y0 = ( }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) { var n = Intl.NumberFormat.supportedLocalesOf(t); return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]); - }, e.__parse = s0, e.formats = { + }, e.__parse = Pc, e.formats = { number: { integer: { maximumFractionDigits: 0 @@ -5806,7 +5648,7 @@ var y0 = ( }, e; }() ); -function E0(e, t) { +function Wc(e, t) { if (t == null) return; if (t in e) @@ -5827,92 +5669,92 @@ function E0(e, t) { r = void 0; return r; } -const ut = {}, S0 = (e, t, n) => n && (t in ut || (ut[t] = {}), e in ut[t] || (ut[t][e] = n), n), us = (e, t) => { +const lt = {}, Zc = (e, t, n) => n && (t in lt || (lt[t] = {}), e in lt[t] || (lt[t][e] = n), n), rs = (e, t) => { if (t == null) return; - if (t in ut && e in ut[t]) - return ut[t][e]; - const n = rr(t); + if (t in lt && e in lt[t]) + return lt[t][e]; + const n = tr(t); for (let r = 0; r < n.length; r++) { - const i = n[r], o = T0(i, e); + const i = n[r], o = Qc(i, e); if (o) - return S0(e, t, o); + return Zc(e, t, o); } }; -let bi; -const mn = hn({}); -function k0(e) { - return bi[e] || null; +let mi; +const hn = _n({}); +function Jc(e) { + return mi[e] || null; } -function fs(e) { - return e in bi; +function is(e) { + return e in mi; } -function T0(e, t) { - if (!fs(e)) +function Qc(e, t) { + if (!is(e)) return null; - const n = k0(e); - return E0(n, t); + const n = Jc(e); + return Wc(n, t); } -function A0(e) { +function Yc(e) { if (e == null) return; - const t = rr(e); + const t = tr(e); for (let n = 0; n < t.length; n++) { const r = t[n]; - if (fs(r)) + if (is(r)) return r; } } -function B0(e, ...t) { - delete ut[e], mn.update((n) => (n[e] = Pc.all([n[e] || {}, ...t]), n)); +function Kc(e, ...t) { + delete lt[e], hn.update((n) => (n[e] = nc.all([n[e] || {}, ...t]), n)); } -Qt( - [mn], +Jt( + [hn], ([e]) => Object.keys(e) ); -mn.subscribe((e) => bi = e); -const Un = {}; -function C0(e, t) { - Un[e].delete(t), Un[e].size === 0 && delete Un[e]; +hn.subscribe((e) => mi = e); +const Mn = {}; +function $c(e, t) { + Mn[e].delete(t), Mn[e].size === 0 && delete Mn[e]; } -function cs(e) { - return Un[e]; +function os(e) { + return Mn[e]; } -function I0(e) { - return rr(e).map((t) => { - const n = cs(t); +function e0(e) { + return tr(e).map((t) => { + const n = os(t); return [t, n ? [...n] : []]; }).filter(([, t]) => t.length > 0); } -function li(e) { - return e == null ? !1 : rr(e).some( +function ri(e) { + return e == null ? !1 : tr(e).some( (t) => { var n; - return (n = cs(t)) == null ? void 0 : n.size; + return (n = os(t)) == null ? void 0 : n.size; } ); } -function L0(e, t) { +function t0(e, t) { return Promise.all( - t.map((r) => (C0(e, r), r().then((i) => i.default || i))) - ).then((r) => B0(e, ...r)); -} -const tn = {}; -function ds(e) { - if (!li(e)) - return e in tn ? tn[e] : Promise.resolve(); - const t = I0(e); - return tn[e] = Promise.all( + t.map((r) => ($c(e, r), r().then((i) => i.default || i))) + ).then((r) => Kc(e, ...r)); +} +const $t = {}; +function ls(e) { + if (!ri(e)) + return e in $t ? $t[e] : Promise.resolve(); + const t = e0(e); + return $t[e] = Promise.all( t.map( - ([n, r]) => L0(n, r) + ([n, r]) => t0(n, r) ) ).then(() => { - if (li(e)) - return ds(e); - delete tn[e]; - }), tn[e]; + if (ri(e)) + return ls(e); + delete $t[e]; + }), $t[e]; } -const P0 = { +const n0 = { number: { scientific: { notation: "scientific" }, engineering: { notation: "engineering" }, @@ -5941,148 +5783,148 @@ const P0 = { timeZoneName: "short" } } -}, O0 = { +}, r0 = { fallbackLocale: null, loadingDelay: 200, - formats: P0, + formats: n0, warnOnMissingMessages: !0, handleMissingMessage: void 0, ignoreTag: !0 -}, H0 = O0; +}, i0 = r0; function Vt() { - return H0; + return i0; } -const Dr = hn(!1); -var N0 = Object.defineProperty, M0 = Object.defineProperties, D0 = Object.getOwnPropertyDescriptors, _o = Object.getOwnPropertySymbols, R0 = Object.prototype.hasOwnProperty, U0 = Object.prototype.propertyIsEnumerable, ho = (e, t, n) => t in e ? N0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, F0 = (e, t) => { +const Nr = _n(!1); +var o0 = Object.defineProperty, l0 = Object.defineProperties, s0 = Object.getOwnPropertyDescriptors, ao = Object.getOwnPropertySymbols, a0 = Object.prototype.hasOwnProperty, u0 = Object.prototype.propertyIsEnumerable, uo = (e, t, n) => t in e ? o0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f0 = (e, t) => { for (var n in t || (t = {})) - R0.call(t, n) && ho(e, n, t[n]); - if (_o) - for (var n of _o(t)) - U0.call(t, n) && ho(e, n, t[n]); + a0.call(t, n) && uo(e, n, t[n]); + if (ao) + for (var n of ao(t)) + u0.call(t, n) && uo(e, n, t[n]); return e; -}, G0 = (e, t) => M0(e, D0(t)); -let si; -const jn = hn(null); -function mo(e) { +}, c0 = (e, t) => l0(e, s0(t)); +let ii; +const Gn = _n(null); +function fo(e) { return e.split("-").map((t, n, r) => r.slice(0, n + 1).join("-")).reverse(); } -function rr(e, t = Vt().fallbackLocale) { - const n = mo(e); - return t ? [.../* @__PURE__ */ new Set([...n, ...mo(t)])] : n; +function tr(e, t = Vt().fallbackLocale) { + const n = fo(e); + return t ? [.../* @__PURE__ */ new Set([...n, ...fo(t)])] : n; } -function Ht() { - return si ?? void 0; +function Nt() { + return ii ?? void 0; } -jn.subscribe((e) => { - si = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); +Gn.subscribe((e) => { + ii = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); }); -const q0 = (e) => { - if (e && A0(e) && li(e)) { +const d0 = (e) => { + if (e && Yc(e) && ri(e)) { const { loadingDelay: t } = Vt(); let n; - return typeof window < "u" && Ht() != null && t ? n = window.setTimeout( - () => Dr.set(!0), + return typeof window < "u" && Nt() != null && t ? n = window.setTimeout( + () => Nr.set(!0), t - ) : Dr.set(!0), ds(e).then(() => { - jn.set(e); + ) : Nr.set(!0), ls(e).then(() => { + Gn.set(e); }).finally(() => { - clearTimeout(n), Dr.set(!1); + clearTimeout(n), Nr.set(!1); }); } - return jn.set(e); -}, pn = G0(F0({}, jn), { - set: q0 -}), ir = (e) => { + return Gn.set(e); +}, mn = c0(f0({}, Gn), { + set: d0 +}), nr = (e) => { const t = /* @__PURE__ */ Object.create(null); return (r) => { const i = JSON.stringify(r); return i in t ? t[i] : t[i] = e(r); }; }; -var j0 = Object.defineProperty, xn = Object.getOwnPropertySymbols, _s = Object.prototype.hasOwnProperty, hs = Object.prototype.propertyIsEnumerable, po = (e, t, n) => t in e ? j0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, wi = (e, t) => { +var _0 = Object.defineProperty, qn = Object.getOwnPropertySymbols, ss = Object.prototype.hasOwnProperty, as = Object.prototype.propertyIsEnumerable, co = (e, t, n) => t in e ? _0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, pi = (e, t) => { for (var n in t || (t = {})) - _s.call(t, n) && po(e, n, t[n]); - if (xn) - for (var n of xn(t)) - hs.call(t, n) && po(e, n, t[n]); + ss.call(t, n) && co(e, n, t[n]); + if (qn) + for (var n of qn(t)) + as.call(t, n) && co(e, n, t[n]); return e; -}, Yt = (e, t) => { +}, Qt = (e, t) => { var n = {}; for (var r in e) - _s.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); - if (e != null && xn) - for (var r of xn(e)) - t.indexOf(r) < 0 && hs.call(e, r) && (n[r] = e[r]); + ss.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); + if (e != null && qn) + for (var r of qn(e)) + t.indexOf(r) < 0 && as.call(e, r) && (n[r] = e[r]); return n; }; -const un = (e, t) => { +const sn = (e, t) => { const { formats: n } = Vt(); if (e in n && t in n[e]) return n[e][t]; throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`); -}, x0 = ir( +}, h0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return r && (i = un("number", r)), new Intl.NumberFormat(n, i); + return r && (i = sn("number", r)), new Intl.NumberFormat(n, i); } -), z0 = ir( +), m0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return r ? i = un("date", r) : Object.keys(i).length === 0 && (i = un("date", "short")), new Intl.DateTimeFormat(n, i); + return r ? i = sn("date", r) : Object.keys(i).length === 0 && (i = sn("date", "short")), new Intl.DateTimeFormat(n, i); } -), V0 = ir( +), p0 = nr( (e) => { - var t = e, { locale: n, format: r } = t, i = Yt(t, ["locale", "format"]); + var t = e, { locale: n, format: r } = t, i = Qt(t, ["locale", "format"]); if (n == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return r ? i = un("time", r) : Object.keys(i).length === 0 && (i = un("time", "short")), new Intl.DateTimeFormat(n, i); + return r ? i = sn("time", r) : Object.keys(i).length === 0 && (i = sn("time", "short")), new Intl.DateTimeFormat(n, i); } -), X0 = (e = {}) => { +), g0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return x0(wi({ locale: n }, r)); -}, W0 = (e = {}) => { + return h0(pi({ locale: n }, r)); +}, b0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return z0(wi({ locale: n }, r)); -}, Z0 = (e = {}) => { + return m0(pi({ locale: n }, r)); +}, w0 = (e = {}) => { var t = e, { - locale: n = Ht() - } = t, r = Yt(t, [ + locale: n = Nt() + } = t, r = Qt(t, [ "locale" ]); - return V0(wi({ locale: n }, r)); -}, J0 = ir( + return p0(pi({ locale: n }, r)); +}, v0 = nr( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (e, t = Ht()) => new y0(e, t, Vt().formats, { + (e, t = Nt()) => new Xc(e, t, Vt().formats, { ignoreTag: Vt().ignoreTag }) -), Q0 = (e, t = {}) => { +), y0 = (e, t = {}) => { var n, r, i, o; let l = t; typeof e == "object" && (l = e, e = l.id); const { values: u, - locale: s = Ht(), + locale: s = Nt(), default: a } = l; if (s == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let f = us(e, s); + let f = rs(e, s); if (!f) f = (o = (i = (r = (n = Vt()).handleMissingMessage) == null ? void 0 : r.call(n, { locale: s, id: e, defaultValue: a })) != null ? i : a) != null ? o : e; else if (typeof f != "string") @@ -6093,7 +5935,7 @@ const un = (e, t) => { return f; let d = f; try { - d = J0(f, s).format(u); + d = v0(f, s).format(u); } catch (c) { c instanceof Error && console.warn( `[svelte-i18n] Message "${e}" has syntax error:`, @@ -6101,30 +5943,30 @@ const un = (e, t) => { ); } return d; -}, Y0 = (e, t) => Z0(t).format(e), K0 = (e, t) => W0(t).format(e), $0 = (e, t) => X0(t).format(e), ed = (e, t = Ht()) => us(e, t); -Qt([pn, mn], () => Q0); -Qt([pn], () => Y0); -Qt([pn], () => K0); -Qt([pn], () => $0); -Qt([pn, mn], () => ed); +}, E0 = (e, t) => w0(t).format(e), S0 = (e, t) => b0(t).format(e), k0 = (e, t) => g0(t).format(e), T0 = (e, t = Nt()) => rs(e, t); +Jt([mn, hn], () => y0); +Jt([mn], () => E0); +Jt([mn], () => S0); +Jt([mn], () => k0); +Jt([mn, hn], () => T0); const { - SvelteComponent: td, + SvelteComponent: A0, append: Ce, - attr: wt, - detach: ms, - element: vt, - init: nd, - insert: ps, - noop: go, - safe_not_equal: rd, - set_data: zn, - set_style: Rr, - space: ai, + attr: gt, + detach: us, + element: bt, + init: B0, + insert: fs, + noop: _o, + safe_not_equal: C0, + set_data: jn, + set_style: Hr, + space: oi, text: Rt, - toggle_class: bo -} = window.__gradio__svelte__internal, { onMount: id, createEventDispatcher: od, getContext: ld } = window.__gradio__svelte__internal; -function wo(e) { - let t, n, r, i, o = on( + toggle_class: ho +} = window.__gradio__svelte__internal, { onMount: I0, createEventDispatcher: L0, getContext: O0 } = window.__gradio__svelte__internal; +function mo(e) { + let t, n, r, i, o = nn( /*file_to_display*/ e[2] ) + "", l, u, s, a, f = ( @@ -6133,33 +5975,33 @@ function wo(e) { ), d; return { c() { - t = vt("div"), n = vt("span"), r = vt("div"), i = vt("progress"), l = Rt(o), s = ai(), a = vt("span"), d = Rt(f), Rr(i, "visibility", "hidden"), Rr(i, "height", "0"), Rr(i, "width", "0"), i.value = u = on( + t = bt("div"), n = bt("span"), r = bt("div"), i = bt("progress"), l = Rt(o), s = oi(), a = bt("span"), d = Rt(f), Hr(i, "visibility", "hidden"), Hr(i, "height", "0"), Hr(i, "width", "0"), i.value = u = nn( /*file_to_display*/ e[2] - ), wt(i, "max", "100"), wt(i, "class", "svelte-12ckl9l"), wt(r, "class", "progress-bar svelte-12ckl9l"), wt(a, "class", "file-name svelte-12ckl9l"), wt(t, "class", "file svelte-12ckl9l"); + ), gt(i, "max", "100"), gt(i, "class", "svelte-12ckl9l"), gt(r, "class", "progress-bar svelte-12ckl9l"), gt(a, "class", "file-name svelte-12ckl9l"), gt(t, "class", "file svelte-12ckl9l"); }, - m(c, h) { - ps(c, t, h), Ce(t, n), Ce(n, r), Ce(r, i), Ce(i, l), Ce(t, s), Ce(t, a), Ce(a, d); + m(c, _) { + fs(c, t, _), Ce(t, n), Ce(n, r), Ce(r, i), Ce(i, l), Ce(t, s), Ce(t, a), Ce(a, d); }, - p(c, h) { - h & /*file_to_display*/ - 4 && o !== (o = on( + p(c, _) { + _ & /*file_to_display*/ + 4 && o !== (o = nn( /*file_to_display*/ c[2] - ) + "") && zn(l, o), h & /*file_to_display*/ - 4 && u !== (u = on( + ) + "") && jn(l, o), _ & /*file_to_display*/ + 4 && u !== (u = nn( /*file_to_display*/ c[2] - )) && (i.value = u), h & /*file_to_display*/ + )) && (i.value = u), _ & /*file_to_display*/ 4 && f !== (f = /*file_to_display*/ - c[2].orig_name + "") && zn(d, f); + c[2].orig_name + "") && jn(d, f); }, d(c) { - c && ms(t); + c && us(t); } }; } -function sd(e) { +function P0(e) { let t, n, r, i = ( /*files_with_progress*/ e[0].length + "" @@ -6168,67 +6010,67 @@ function sd(e) { e[0].length > 1 ? "files" : "file" ), s, a, f, d = ( /*file_to_display*/ - e[2] && wo(e) + e[2] && mo(e) ); return { c() { - t = vt("div"), n = vt("span"), r = Rt("Uploading "), o = Rt(i), l = ai(), s = Rt(u), a = Rt("..."), f = ai(), d && d.c(), wt(n, "class", "uploading svelte-12ckl9l"), wt(t, "class", "wrap svelte-12ckl9l"), bo( + t = bt("div"), n = bt("span"), r = Rt("Uploading "), o = Rt(i), l = oi(), s = Rt(u), a = Rt("..."), f = oi(), d && d.c(), gt(n, "class", "uploading svelte-12ckl9l"), gt(t, "class", "wrap svelte-12ckl9l"), ho( t, "progress", /*progress*/ e[1] ); }, - m(c, h) { - ps(c, t, h), Ce(t, n), Ce(n, r), Ce(n, o), Ce(n, l), Ce(n, s), Ce(n, a), Ce(t, f), d && d.m(t, null); + m(c, _) { + fs(c, t, _), Ce(t, n), Ce(n, r), Ce(n, o), Ce(n, l), Ce(n, s), Ce(n, a), Ce(t, f), d && d.m(t, null); }, - p(c, [h]) { - h & /*files_with_progress*/ + p(c, [_]) { + _ & /*files_with_progress*/ 1 && i !== (i = /*files_with_progress*/ - c[0].length + "") && zn(o, i), h & /*files_with_progress*/ + c[0].length + "") && jn(o, i), _ & /*files_with_progress*/ 1 && u !== (u = /*files_with_progress*/ - c[0].length > 1 ? "files" : "file") && zn(s, u), /*file_to_display*/ - c[2] ? d ? d.p(c, h) : (d = wo(c), d.c(), d.m(t, null)) : d && (d.d(1), d = null), h & /*progress*/ - 2 && bo( + c[0].length > 1 ? "files" : "file") && jn(s, u), /*file_to_display*/ + c[2] ? d ? d.p(c, _) : (d = mo(c), d.c(), d.m(t, null)) : d && (d.d(1), d = null), _ & /*progress*/ + 2 && ho( t, "progress", /*progress*/ c[1] ); }, - i: go, - o: go, + i: _o, + o: _o, d(c) { - c && ms(t), d && d.d(); + c && us(t), d && d.d(); } }; } -function on(e) { +function nn(e) { return e.progress * 100 / (e.size || 0) || 0; } -function ad(e) { +function N0(e) { let t = 0; return e.forEach((n) => { - t += on(n); + t += nn(n); }), document.documentElement.style.setProperty("--upload-progress-width", (t / e.length).toFixed(2) + "%"), t / e.length; } -function ud(e, t, n) { - let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, u = !1, s, a, f = o.map((_) => ({ ..._, progress: 0 })); - const d = od(); - function c(_, m) { - n(0, f = f.map((g) => (g.orig_name === _ && (g.progress += m), g))); - } - const h = ld("EventSource_factory"); - return id(() => { - l = h(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(_) { - const m = JSON.parse(_.data); - u || n(1, u = !0), m.msg === "done" ? (l.close(), d("done")) : (n(6, s = m), c(m.orig_name, m.chunk_size)); +function H0(e, t, n) { + let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, u = !1, s, a, f = o.map((h) => ({ ...h, progress: 0 })); + const d = L0(); + function c(h, p) { + n(0, f = f.map((g) => (g.orig_name === h && (g.progress += p), g))); + } + const _ = O0("EventSource_factory"); + return I0(() => { + l = _(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(h) { + const p = JSON.parse(h.data); + u || n(1, u = !0), p.msg === "done" ? (l.close(), d("done")) : (n(6, s = p), c(p.orig_name, p.chunk_size)); }; - }), e.$$set = (_) => { - "upload_id" in _ && n(3, r = _.upload_id), "root" in _ && n(4, i = _.root), "files" in _ && n(5, o = _.files); + }), e.$$set = (h) => { + "upload_id" in h && n(3, r = h.upload_id), "root" in h && n(4, i = h.root), "files" in h && n(5, o = h.files); }, e.$$.update = () => { e.$$.dirty & /*files_with_progress*/ - 1 && ad(f), e.$$.dirty & /*current_file_upload, files_with_progress*/ + 1 && N0(f), e.$$.dirty & /*current_file_upload, files_with_progress*/ 65 && n(2, a = s || f[0]); }, [ f, @@ -6240,48 +6082,48 @@ function ud(e, t, n) { s ]; } -class fd extends td { +class D0 extends A0 { constructor(t) { - super(), nd(this, t, ud, sd, rd, { upload_id: 3, root: 4, files: 5 }); + super(), B0(this, t, H0, P0, C0, { upload_id: 3, root: 4, files: 5 }); } } const { - SvelteComponent: cd, - append: vo, + SvelteComponent: M0, + append: po, attr: ye, - binding_callbacks: dd, - bubble: mt, - check_outros: gs, - create_component: _d, - create_slot: bs, - destroy_component: hd, - detach: or, - element: ui, - empty: ws, - get_all_dirty_from_scope: vs, - get_slot_changes: ys, - group_outros: Es, - init: md, - insert: lr, - listen: Oe, - mount_component: pd, - prevent_default: pt, - run_all: gd, - safe_not_equal: bd, - set_style: Ss, - space: wd, - stop_propagation: gt, + binding_callbacks: R0, + bubble: _t, + check_outros: cs, + create_component: U0, + create_slot: ds, + destroy_component: F0, + detach: rr, + element: li, + empty: _s, + get_all_dirty_from_scope: hs, + get_slot_changes: ms, + group_outros: ps, + init: G0, + insert: ir, + listen: Pe, + mount_component: q0, + prevent_default: ht, + run_all: j0, + safe_not_equal: x0, + set_style: gs, + space: z0, + stop_propagation: mt, toggle_class: Ee, - transition_in: ct, - transition_out: It, - update_slot_base: ks -} = window.__gradio__svelte__internal, { createEventDispatcher: vd, tick: yd, getContext: Ed } = window.__gradio__svelte__internal; -function Sd(e) { + transition_in: at, + transition_out: Bt, + update_slot_base: bs +} = window.__gradio__svelte__internal, { createEventDispatcher: V0, tick: X0, getContext: W0 } = window.__gradio__svelte__internal; +function Z0(e) { let t, n, r, i, o, l, u, s, a, f; const d = ( /*#slots*/ e[22].default - ), c = bs( + ), c = ds( d, e, /*$$scope*/ @@ -6290,7 +6132,7 @@ function Sd(e) { ); return { c() { - t = ui("button"), c && c.c(), n = wd(), r = ui("input"), ye(r, "aria-label", "file upload"), ye(r, "data-testid", "file-upload"), ye(r, "type", "file"), ye( + t = li("button"), c && c.c(), n = z0(), r = li("input"), ye(r, "aria-label", "file upload"), ye(r, "data-testid", "file-upload"), ye(r, "type", "file"), ye( r, "accept", /*accept_file_types*/ @@ -6319,63 +6161,63 @@ function Sd(e) { "flex", /*flex*/ e[4] - ), Ss(t, "height", "100%"); + ), gs(t, "height", "100%"); }, - m(h, _) { - lr(h, t, _), c && c.m(t, null), vo(t, n), vo(t, r), e[30](r), s = !0, a || (f = [ - Oe( + m(_, h) { + ir(_, t, h), c && c.m(t, null), po(t, n), po(t, r), e[30](r), s = !0, a || (f = [ + Pe( r, "change", /*load_files_from_upload*/ e[15] ), - Oe(t, "drag", gt(pt( + Pe(t, "drag", mt(ht( /*drag_handler*/ e[23] ))), - Oe(t, "dragstart", gt(pt( + Pe(t, "dragstart", mt(ht( /*dragstart_handler*/ e[24] ))), - Oe(t, "dragend", gt(pt( + Pe(t, "dragend", mt(ht( /*dragend_handler*/ e[25] ))), - Oe(t, "dragover", gt(pt( + Pe(t, "dragover", mt(ht( /*dragover_handler*/ e[26] ))), - Oe(t, "dragenter", gt(pt( + Pe(t, "dragenter", mt(ht( /*dragenter_handler*/ e[27] ))), - Oe(t, "dragleave", gt(pt( + Pe(t, "dragleave", mt(ht( /*dragleave_handler*/ e[28] ))), - Oe(t, "drop", gt(pt( + Pe(t, "drop", mt(ht( /*drop_handler*/ e[29] ))), - Oe( + Pe( t, "click", /*open_file_upload*/ e[9] ), - Oe( + Pe( t, "drop", /*loadFilesFromDrop*/ e[16] ), - Oe( + Pe( t, "dragenter", /*updateDragging*/ e[14] ), - Oe( + Pe( t, "dragleave", /*updateDragging*/ @@ -6383,110 +6225,110 @@ function Sd(e) { ) ], a = !0); }, - p(h, _) { - c && c.p && (!s || _[0] & /*$$scope*/ - 2097152) && ks( + p(_, h) { + c && c.p && (!s || h[0] & /*$$scope*/ + 2097152) && bs( c, d, - h, + _, /*$$scope*/ - h[21], - s ? ys( + _[21], + s ? ms( d, /*$$scope*/ - h[21], - _, + _[21], + h, null - ) : vs( + ) : hs( /*$$scope*/ - h[21] + _[21] ), null - ), (!s || _[0] & /*accept_file_types*/ + ), (!s || h[0] & /*accept_file_types*/ 4096) && ye( r, "accept", /*accept_file_types*/ - h[12] - ), (!s || _[0] & /*file_count*/ + _[12] + ), (!s || h[0] & /*file_count*/ 32 && i !== (i = /*file_count*/ - h[5] === "multiple" || void 0)) && (r.multiple = i), (!s || _[0] & /*file_count*/ + _[5] === "multiple" || void 0)) && (r.multiple = i), (!s || h[0] & /*file_count*/ 32 && o !== (o = /*file_count*/ - h[5] === "directory" || void 0)) && ye(r, "webkitdirectory", o), (!s || _[0] & /*file_count*/ + _[5] === "directory" || void 0)) && ye(r, "webkitdirectory", o), (!s || h[0] & /*file_count*/ 32 && l !== (l = /*file_count*/ - h[5] === "directory" || void 0)) && ye(r, "mozdirectory", l), (!s || _[0] & /*hidden*/ + _[5] === "directory" || void 0)) && ye(r, "mozdirectory", l), (!s || h[0] & /*hidden*/ 128 && u !== (u = /*hidden*/ - h[7] ? -1 : 0)) && ye(t, "tabindex", u), (!s || _[0] & /*hidden*/ + _[7] ? -1 : 0)) && ye(t, "tabindex", u), (!s || h[0] & /*hidden*/ 128) && Ee( t, "hidden", /*hidden*/ - h[7] - ), (!s || _[0] & /*center*/ + _[7] + ), (!s || h[0] & /*center*/ 8) && Ee( t, "center", /*center*/ - h[3] - ), (!s || _[0] & /*boundedheight*/ + _[3] + ), (!s || h[0] & /*boundedheight*/ 4) && Ee( t, "boundedheight", /*boundedheight*/ - h[2] - ), (!s || _[0] & /*flex*/ + _[2] + ), (!s || h[0] & /*flex*/ 16) && Ee( t, "flex", /*flex*/ - h[4] + _[4] ); }, - i(h) { - s || (ct(c, h), s = !0); + i(_) { + s || (at(c, _), s = !0); }, - o(h) { - It(c, h), s = !1; + o(_) { + Bt(c, _), s = !1; }, - d(h) { - h && or(t), c && c.d(h), e[30](null), a = !1, gd(f); + d(_) { + _ && rr(t), c && c.d(_), e[30](null), a = !1, j0(f); } }; } -function kd(e) { +function J0(e) { let t, n, r = !/*hidden*/ - e[7] && yo(e); + e[7] && go(e); return { c() { - r && r.c(), t = ws(); + r && r.c(), t = _s(); }, m(i, o) { - r && r.m(i, o), lr(i, t, o), n = !0; + r && r.m(i, o), ir(i, t, o), n = !0; }, p(i, o) { /*hidden*/ - i[7] ? r && (Es(), It(r, 1, 1, () => { + i[7] ? r && (ps(), Bt(r, 1, 1, () => { r = null; - }), gs()) : r ? (r.p(i, o), o[0] & /*hidden*/ - 128 && ct(r, 1)) : (r = yo(i), r.c(), ct(r, 1), r.m(t.parentNode, t)); + }), cs()) : r ? (r.p(i, o), o[0] & /*hidden*/ + 128 && at(r, 1)) : (r = go(i), r.c(), at(r, 1), r.m(t.parentNode, t)); }, i(i) { - n || (ct(r), n = !0); + n || (at(r), n = !0); }, o(i) { - It(r), n = !1; + Bt(r), n = !1; }, d(i) { - i && or(t), r && r.d(i); + i && rr(t), r && r.d(i); } }; } -function Td(e) { +function Q0(e) { let t, n, r, i, o; const l = ( /*#slots*/ e[22].default - ), u = bs( + ), u = ds( l, e, /*$$scope*/ @@ -6495,7 +6337,7 @@ function Td(e) { ); return { c() { - t = ui("button"), u && u.c(), ye(t, "tabindex", n = /*hidden*/ + t = li("button"), u && u.c(), ye(t, "tabindex", n = /*hidden*/ e[7] ? -1 : 0), ye(t, "class", "svelte-1aq8tno"), Ee( t, "hidden", @@ -6516,10 +6358,10 @@ function Td(e) { "flex", /*flex*/ e[4] - ), Ss(t, "height", "100%"); + ), gs(t, "height", "100%"); }, m(s, a) { - lr(s, t, a), u && u.m(t, null), r = !0, i || (o = Oe( + ir(s, t, a), u && u.m(t, null), r = !0, i || (o = Pe( t, "click", /*paste_clipboard*/ @@ -6528,19 +6370,19 @@ function Td(e) { }, p(s, a) { u && u.p && (!r || a[0] & /*$$scope*/ - 2097152) && ks( + 2097152) && bs( u, l, s, /*$$scope*/ s[21], - r ? ys( + r ? ms( l, /*$$scope*/ s[21], a, null - ) : vs( + ) : hs( /*$$scope*/ s[21] ), @@ -6574,19 +6416,19 @@ function Td(e) { ); }, i(s) { - r || (ct(u, s), r = !0); + r || (at(u, s), r = !0); }, o(s) { - It(u, s), r = !1; + Bt(u, s), r = !1; }, d(s) { - s && or(t), u && u.d(s), i = !1, o(); + s && rr(t), u && u.d(s), i = !1, o(); } }; } -function yo(e) { +function go(e) { let t, n; - return t = new fd({ + return t = new D0({ props: { root: ( /*root*/ @@ -6603,10 +6445,10 @@ function yo(e) { } }), { c() { - _d(t.$$.fragment); + U0(t.$$.fragment); }, m(r, i) { - pd(t, r, i), n = !0; + q0(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -6619,19 +6461,19 @@ function yo(e) { r[11]), t.$set(o); }, i(r) { - n || (ct(t.$$.fragment, r), n = !0); + n || (at(t.$$.fragment, r), n = !0); }, o(r) { - It(t.$$.fragment, r), n = !1; + Bt(t.$$.fragment, r), n = !1; }, d(r) { - hd(t, r); + F0(t, r); } }; } -function Ad(e) { +function Y0(e) { let t, n, r, i; - const o = [Td, kd, Sd], l = []; + const o = [Q0, J0, Z0], l = []; function u(s, a) { return ( /*filetype*/ @@ -6643,29 +6485,29 @@ function Ad(e) { } return t = u(e), n = l[t] = o[t](e), { c() { - n.c(), r = ws(); + n.c(), r = _s(); }, m(s, a) { - l[t].m(s, a), lr(s, r, a), i = !0; + l[t].m(s, a), ir(s, r, a), i = !0; }, p(s, a) { let f = t; - t = u(s), t === f ? l[t].p(s, a) : (Es(), It(l[f], 1, 1, () => { + t = u(s), t === f ? l[t].p(s, a) : (ps(), Bt(l[f], 1, 1, () => { l[f] = null; - }), gs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), ct(n, 1), n.m(r.parentNode, r)); + }), cs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), at(n, 1), n.m(r.parentNode, r)); }, i(s) { - i || (ct(n), i = !0); + i || (at(n), i = !0); }, o(s) { - It(n), i = !1; + Bt(n), i = !1; }, d(s) { - s && or(r), l[t].d(s); + s && rr(r), l[t].d(s); } }; } -function Eo(e) { +function bo(e) { let t, n = e[0], r = 1; for (; r < e.length; ) { const i = e[r], o = e[r + 1]; @@ -6675,143 +6517,143 @@ function Eo(e) { } return n; } -function Bd(e, t) { +function K0(e, t) { return !e || e === "*" || e === "file/*" ? !0 : (typeof e == "string" && e.endsWith("/*") && (e = e.split(",")), Array.isArray(e) ? e.includes(t) || e.some((n) => { const [r] = n.split("/"); return n.endsWith("/*") && t.startsWith(r + "/"); }) : e === t); } -function Cd(e, t, n) { - let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: u = !0 } = t, { center: s = !0 } = t, { flex: a = !0 } = t, { file_count: f = "single" } = t, { disable_click: d = !1 } = t, { root: c } = t, { hidden: h = !1 } = t, { format: _ = "file" } = t, { uploading: m = !1 } = t, g, p, v; - const b = Ed("upload_files"); - let w; - const y = vd(); - function S() { +function $0(e, t, n) { + let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: u = !0 } = t, { center: s = !0 } = t, { flex: a = !0 } = t, { file_count: f = "single" } = t, { disable_click: d = !1 } = t, { root: c } = t, { hidden: _ = !1 } = t, { format: h = "file" } = t, { uploading: p = !1 } = t, g, m, v; + const w = W0("upload_files"); + let b; + const y = V0(); + function k() { n(17, l = !l); } function C() { - navigator.clipboard.read().then(async (E) => { - for (let M = 0; M < E.length; M++) { - const A = E[M].types.find((F) => F.startsWith("image/")); + navigator.clipboard.read().then(async (S) => { + for (let D = 0; D < S.length; D++) { + const A = S[D].types.find((R) => R.startsWith("image/")); if (A) { - E[M].getType(A).then(async (F) => { - const L = new File([F], `clipboard.${A.replace("image/", "")}`); - await O([L]); + S[D].getType(A).then(async (R) => { + const L = new File([R], `clipboard.${A.replace("image/", "")}`); + await P([L]); }); break; } } }); } - function P() { - d || (n(13, w.value = "", w), w.click()); + function O() { + d || (n(13, b.value = "", b), b.click()); } - async function k(E) { - await yd(), n(10, g = Math.random().toString(36).substring(2, 15)), n(1, m = !0); - const M = await nc(E, c, g, b); - return y("load", f === "single" ? Eo([M, "optionalAccess", (A) => A[0]]) : M), n(1, m = !1), M || []; + async function T(S) { + await X0(), n(10, g = Math.random().toString(36).substring(2, 15)), n(1, p = !0); + const D = await Bf(S, c, g, w); + return y("load", f === "single" ? bo([D, "optionalAccess", (A) => A[0]]) : D), n(1, p = !1), D || []; } - async function O(E) { - if (!E.length) + async function P(S) { + if (!S.length) return; - let M = E.map((A) => new File([A], A.name)); - return n(11, p = await rc(M)), await k(p); - } - async function U(E) { - const M = E.target; - if (M.files) - if (_ != "blob") - await O(Array.from(M.files)); + let D = S.map((A) => new File([A], A.name)); + return n(11, m = await Cf(D)), await T(m); + } + async function M(S) { + const D = S.target; + if (D.files) + if (h != "blob") + await P(Array.from(D.files)); else { if (f === "single") { - y("load", M.files[0]); + y("load", D.files[0]); return; } - y("load", M.files); + y("load", D.files); } } - async function x(E) { - if (n(17, l = !1), !Eo([E, "access", (A) => A.dataTransfer, "optionalAccess", (A) => A.files])) + async function j(S) { + if (n(17, l = !1), !bo([S, "access", (A) => A.dataTransfer, "optionalAccess", (A) => A.files])) return; - const M = Array.from(E.dataTransfer.files).filter((A) => { - const F = "." + A.name.split(".").pop(); - return A.type && Bd(o, A.type) || (F && Array.isArray(o) ? o.includes(F) : F === o) ? !0 : (y("error", `Invalid file type only ${o} allowed.`), !1); + const D = Array.from(S.dataTransfer.files).filter((A) => { + const R = "." + A.name.split(".").pop(); + return A.type && K0(o, A.type) || (R && Array.isArray(o) ? o.includes(R) : R === o) ? !0 : (y("error", `Invalid file type only ${o} allowed.`), !1); }); - await O(M); + await P(D); } - function j(E) { - mt.call(this, e, E); + function q(S) { + _t.call(this, e, S); } - function te(E) { - mt.call(this, e, E); + function ee(S) { + _t.call(this, e, S); } - function ne(E) { - mt.call(this, e, E); + function te(S) { + _t.call(this, e, S); } - function ce(E) { - mt.call(this, e, E); + function fe(S) { + _t.call(this, e, S); } - function me(E) { - mt.call(this, e, E); + function me(S) { + _t.call(this, e, S); } - function _e(E) { - mt.call(this, e, E); + function _e(S) { + _t.call(this, e, S); } - function B(E) { - mt.call(this, e, E); + function B(S) { + _t.call(this, e, S); } - function pe(E) { - dd[E ? "unshift" : "push"](() => { - w = E, n(13, w); + function pe(S) { + R0[S ? "unshift" : "push"](() => { + b = S, n(13, b); }); } - return e.$$set = (E) => { - "filetype" in E && n(0, o = E.filetype), "dragging" in E && n(17, l = E.dragging), "boundedheight" in E && n(2, u = E.boundedheight), "center" in E && n(3, s = E.center), "flex" in E && n(4, a = E.flex), "file_count" in E && n(5, f = E.file_count), "disable_click" in E && n(18, d = E.disable_click), "root" in E && n(6, c = E.root), "hidden" in E && n(7, h = E.hidden), "format" in E && n(19, _ = E.format), "uploading" in E && n(1, m = E.uploading), "$$scope" in E && n(21, i = E.$$scope); + return e.$$set = (S) => { + "filetype" in S && n(0, o = S.filetype), "dragging" in S && n(17, l = S.dragging), "boundedheight" in S && n(2, u = S.boundedheight), "center" in S && n(3, s = S.center), "flex" in S && n(4, a = S.flex), "file_count" in S && n(5, f = S.file_count), "disable_click" in S && n(18, d = S.disable_click), "root" in S && n(6, c = S.root), "hidden" in S && n(7, _ = S.hidden), "format" in S && n(19, h = S.format), "uploading" in S && n(1, p = S.uploading), "$$scope" in S && n(21, i = S.$$scope); }, e.$$.update = () => { e.$$.dirty[0] & /*filetype*/ - 1 && (o == null || typeof o == "string" ? n(12, v = o) : (n(0, o = o.map((E) => E.startsWith(".") ? E : E + "/*")), n(12, v = o.join(", ")))); + 1 && (o == null || typeof o == "string" ? n(12, v = o) : (n(0, o = o.map((S) => S.startsWith(".") ? S : S + "/*")), n(12, v = o.join(", ")))); }, [ o, - m, + p, u, s, a, f, c, - h, + _, C, - P, + O, g, - p, + m, v, - w, - S, - U, - x, + b, + k, + M, + j, l, d, - _, - O, + h, + P, i, r, - j, + q, + ee, te, - ne, - ce, + fe, me, _e, B, pe ]; } -class Id extends cd { +class ed extends M0 { constructor(t) { - super(), md( + super(), G0( this, t, - Cd, - Ad, - bd, + $0, + Y0, + x0, { filetype: 0, dragging: 17, @@ -6842,30 +6684,30 @@ class Id extends cd { return this.$$.ctx[20]; } } -const { setContext: ap, getContext: Ld } = window.__gradio__svelte__internal, Pd = "WORKER_PROXY_CONTEXT_KEY"; -function Ts() { - return Ld(Pd); +const { setContext: Pm, getContext: td } = window.__gradio__svelte__internal, nd = "WORKER_PROXY_CONTEXT_KEY"; +function ws() { + return td(nd); } -function Od(e) { +function rd(e) { return e.host === window.location.host || e.host === "localhost:7860" || e.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 e.host === "lite.local"; } -function As(e, t) { +function vs(e, t) { const n = t.toLowerCase(); for (const [r, i] of Object.entries(e)) if (r.toLowerCase() === n) return i; } -function Bs(e) { +function ys(e) { if (e == null) return !1; const t = new URL(e); - return !(!Od(t) || t.protocol !== "http:" && t.protocol !== "https:"); + return !(!rd(t) || t.protocol !== "http:" && t.protocol !== "https:"); } -async function Hd(e) { - if (e == null || !Bs(e)) +async function id(e) { + if (e == null || !ys(e)) return e; - const t = Ts(); + const t = ws(); if (t == null) return e; const r = new URL(e).pathname; @@ -6878,41 +6720,41 @@ async function Hd(e) { if (i.status !== 200) throw new Error(`Failed to get file ${r} from the Wasm worker.`); const o = new Blob([i.body], { - type: As(i.headers, "content-type") + type: vs(i.headers, "content-type") }); return URL.createObjectURL(o); }); } const { - SvelteComponent: Nd, - assign: Vn, - check_outros: Cs, - compute_rest_props: So, - create_slot: vi, - detach: sr, - element: Is, - empty: Ls, - exclude_internal_props: Md, - get_all_dirty_from_scope: yi, - get_slot_changes: Ei, - get_spread_update: Ps, - group_outros: Os, - init: Dd, - insert: ar, - listen: Hs, - prevent_default: Rd, - safe_not_equal: Ud, - set_attributes: Xn, - transition_in: Lt, - transition_out: Pt, - update_slot_base: Si -} = window.__gradio__svelte__internal, { createEventDispatcher: Fd } = window.__gradio__svelte__internal; -function Gd(e) { + SvelteComponent: od, + assign: xn, + check_outros: Es, + compute_rest_props: wo, + create_slot: gi, + detach: or, + element: Ss, + empty: ks, + exclude_internal_props: ld, + get_all_dirty_from_scope: bi, + get_slot_changes: wi, + get_spread_update: Ts, + group_outros: As, + init: sd, + insert: lr, + listen: Bs, + prevent_default: ad, + safe_not_equal: ud, + set_attributes: zn, + transition_in: Ct, + transition_out: It, + update_slot_base: vi +} = window.__gradio__svelte__internal, { createEventDispatcher: fd } = window.__gradio__svelte__internal; +function cd(e) { let t, n, r, i, o; const l = ( /*#slots*/ e[8].default - ), u = vi( + ), u = gi( l, e, /*$$scope*/ @@ -6936,13 +6778,13 @@ function Gd(e) { e[6] ], a = {}; for (let f = 0; f < s.length; f += 1) - a = Vn(a, s[f]); + a = xn(a, s[f]); return { c() { - t = Is("a"), u && u.c(), Xn(t, a); + t = Ss("a"), u && u.c(), zn(t, a); }, m(f, d) { - ar(f, t, d), u && u.m(t, null), r = !0, i || (o = Hs( + lr(f, t, d), u && u.m(t, null), r = !0, i || (o = Bs( t, "click", /*dispatch*/ @@ -6951,24 +6793,24 @@ function Gd(e) { }, p(f, d) { u && u.p && (!r || d & /*$$scope*/ - 128) && Si( + 128) && vi( u, l, f, /*$$scope*/ f[7], - r ? Ei( + r ? wi( l, /*$$scope*/ f[7], d, null - ) : yi( + ) : bi( /*$$scope*/ f[7] ), null - ), Xn(t, a = Ps(s, [ + ), zn(t, a = Ts(s, [ (!r || d & /*href*/ 1) && { href: ( /*href*/ @@ -6987,19 +6829,19 @@ function Gd(e) { ])); }, i(f) { - r || (Lt(u, f), r = !0); + r || (Ct(u, f), r = !0); }, o(f) { - Pt(u, f), r = !1; + It(u, f), r = !1; }, d(f) { - f && sr(t), u && u.d(f), i = !1, o(); + f && or(t), u && u.d(f), i = !1, o(); } }; } -function qd(e) { +function dd(e) { let t, n, r, i; - const o = [xd, jd], l = []; + const o = [hd, _d], l = []; function u(s, a) { return ( /*is_downloading*/ @@ -7008,34 +6850,34 @@ function qd(e) { } return t = u(e), n = l[t] = o[t](e), { c() { - n.c(), r = Ls(); + n.c(), r = ks(); }, m(s, a) { - l[t].m(s, a), ar(s, r, a), i = !0; + l[t].m(s, a), lr(s, r, a), i = !0; }, p(s, a) { let f = t; - t = u(s), t === f ? l[t].p(s, a) : (Os(), Pt(l[f], 1, 1, () => { + t = u(s), t === f ? l[t].p(s, a) : (As(), It(l[f], 1, 1, () => { l[f] = null; - }), Cs(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), Lt(n, 1), n.m(r.parentNode, r)); + }), Es(), n = l[t], n ? n.p(s, a) : (n = l[t] = o[t](s), n.c()), Ct(n, 1), n.m(r.parentNode, r)); }, i(s) { - i || (Lt(n), i = !0); + i || (Ct(n), i = !0); }, o(s) { - Pt(n), i = !1; + It(n), i = !1; }, d(s) { - s && sr(r), l[t].d(s); + s && or(r), l[t].d(s); } }; } -function jd(e) { +function _d(e) { let t, n, r, i; const o = ( /*#slots*/ e[8].default - ), l = vi( + ), l = gi( o, e, /*$$scope*/ @@ -7051,37 +6893,37 @@ function jd(e) { ) } ], s = {}; for (let a = 0; a < u.length; a += 1) - s = Vn(s, u[a]); + s = xn(s, u[a]); return { c() { - t = Is("a"), l && l.c(), Xn(t, s); + t = Ss("a"), l && l.c(), zn(t, s); }, m(a, f) { - ar(a, t, f), l && l.m(t, null), n = !0, r || (i = Hs(t, "click", Rd( + lr(a, t, f), l && l.m(t, null), n = !0, r || (i = Bs(t, "click", ad( /*wasm_click_handler*/ e[5] )), r = !0); }, p(a, f) { l && l.p && (!n || f & /*$$scope*/ - 128) && Si( + 128) && vi( l, o, a, /*$$scope*/ a[7], - n ? Ei( + n ? wi( o, /*$$scope*/ a[7], f, null - ) : yi( + ) : bi( /*$$scope*/ a[7] ), null - ), Xn(t, s = Ps(u, [ + ), zn(t, s = Ts(u, [ f & /*$$restProps*/ 64 && /*$$restProps*/ a[6], @@ -7093,22 +6935,22 @@ function jd(e) { ])); }, i(a) { - n || (Lt(l, a), n = !0); + n || (Ct(l, a), n = !0); }, o(a) { - Pt(l, a), n = !1; + It(l, a), n = !1; }, d(a) { - a && sr(t), l && l.d(a), r = !1, i(); + a && or(t), l && l.d(a), r = !1, i(); } }; } -function xd(e) { +function hd(e) { let t; const n = ( /*#slots*/ e[8].default - ), r = vi( + ), r = gi( n, e, /*$$scope*/ @@ -7124,19 +6966,19 @@ function xd(e) { }, p(i, o) { r && r.p && (!t || o & /*$$scope*/ - 128) && Si( + 128) && vi( r, n, i, /*$$scope*/ i[7], - t ? Ei( + t ? wi( n, /*$$scope*/ i[7], o, null - ) : yi( + ) : bi( /*$$scope*/ i[7] ), @@ -7144,57 +6986,57 @@ function xd(e) { ); }, i(i) { - t || (Lt(r, i), t = !0); + t || (Ct(r, i), t = !0); }, o(i) { - Pt(r, i), t = !1; + It(r, i), t = !1; }, d(i) { r && r.d(i); } }; } -function zd(e) { +function md(e) { let t, n, r, i, o; - const l = [qd, Gd], u = []; + const l = [dd, cd], u = []; function s(a, f) { return f & /*href*/ 1 && (t = null), t == null && (t = !!/*worker_proxy*/ - (a[4] && Bs( + (a[4] && ys( /*href*/ a[0] ))), t ? 0 : 1; } return n = s(e, -1), r = u[n] = l[n](e), { c() { - r.c(), i = Ls(); + r.c(), i = ks(); }, m(a, f) { - u[n].m(a, f), ar(a, i, f), o = !0; + u[n].m(a, f), lr(a, i, f), o = !0; }, p(a, [f]) { let d = n; - n = s(a, f), n === d ? u[n].p(a, f) : (Os(), Pt(u[d], 1, 1, () => { + n = s(a, f), n === d ? u[n].p(a, f) : (As(), It(u[d], 1, 1, () => { u[d] = null; - }), Cs(), r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Lt(r, 1), r.m(i.parentNode, i)); + }), Es(), r = u[n], r ? r.p(a, f) : (r = u[n] = l[n](a), r.c()), Ct(r, 1), r.m(i.parentNode, i)); }, i(a) { - o || (Lt(r), o = !0); + o || (Ct(r), o = !0); }, o(a) { - Pt(r), o = !1; + It(r), o = !1; }, d(a) { - a && sr(i), u[n].d(a); + a && or(i), u[n].d(a); } }; } -function Vd(e, t, n) { +function pd(e, t, n) { const r = ["href", "download"]; - let i = So(t, r), { $$slots: o = {}, $$scope: l } = t, { href: u = void 0 } = t, { download: s } = t; - const a = Fd(); + let i = wo(t, r), { $$slots: o = {}, $$scope: l } = t, { href: u = void 0 } = t, { download: s } = t; + const a = fd(); let f = !1; - const d = Ts(); + const d = ws(); async function c() { if (f) return; @@ -7202,28 +7044,28 @@ function Vd(e, t, n) { throw new Error("href is not defined."); if (d == null) throw new Error("Wasm worker proxy is not available."); - const _ = new URL(u).pathname; + const h = new URL(u).pathname; n(2, f = !0), d.httpRequest({ method: "GET", - path: _, + path: h, headers: {}, query_string: "" - }).then((m) => { - if (m.status !== 200) - throw new Error(`Failed to get file ${_} from the Wasm worker.`); + }).then((p) => { + if (p.status !== 200) + throw new Error(`Failed to get file ${h} from the Wasm worker.`); const g = new Blob( - [m.body], + [p.body], { - type: As(m.headers, "content-type") + type: vs(p.headers, "content-type") } - ), p = URL.createObjectURL(g), v = document.createElement("a"); - v.href = p, v.download = s, v.click(), URL.revokeObjectURL(p); + ), m = URL.createObjectURL(g), v = document.createElement("a"); + v.href = m, v.download = s, v.click(), URL.revokeObjectURL(m); }).finally(() => { n(2, f = !1); }); } - return e.$$set = (h) => { - t = Vn(Vn({}, t), Md(h)), n(6, i = So(t, r)), "href" in h && n(0, u = h.href), "download" in h && n(1, s = h.download), "$$scope" in h && n(7, l = h.$$scope); + return e.$$set = (_) => { + t = xn(xn({}, t), ld(_)), n(6, i = wo(t, r)), "href" in _ && n(0, u = _.href), "download" in _ && n(1, s = _.download), "$$scope" in _ && n(7, l = _.$$scope); }, [ u, s, @@ -7236,36 +7078,36 @@ function Vd(e, t, n) { o ]; } -class Ns extends Nd { +class Cs extends od { constructor(t) { - super(), Dd(this, t, Vd, zd, Ud, { href: 0, download: 1 }); + super(), sd(this, t, pd, md, ud, { href: 0, download: 1 }); } } const { - SvelteComponent: Xd, - append: Ur, - attr: Wd, - check_outros: Fr, - create_component: gn, - destroy_component: bn, - detach: Zd, - element: Jd, - group_outros: Gr, - init: Qd, - insert: Yd, - mount_component: wn, - safe_not_equal: Kd, - set_style: ko, - space: qr, - toggle_class: To, + SvelteComponent: gd, + append: Dr, + attr: bd, + check_outros: Mr, + create_component: pn, + destroy_component: gn, + detach: wd, + element: vd, + group_outros: Rr, + init: yd, + insert: Ed, + mount_component: bn, + safe_not_equal: Sd, + set_style: vo, + space: Ur, + toggle_class: yo, transition_in: Be, - transition_out: Xe -} = window.__gradio__svelte__internal, { createEventDispatcher: $d } = window.__gradio__svelte__internal; -function Ao(e) { + transition_out: ze +} = window.__gradio__svelte__internal, { createEventDispatcher: kd } = window.__gradio__svelte__internal; +function Eo(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: qu, + Icon: Bu, label: ( /*i18n*/ e[4]("common.edit") @@ -7277,10 +7119,10 @@ function Ao(e) { e[6] ), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7292,18 +7134,18 @@ function Ao(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function Bo(e) { +function So(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: pf, + Icon: tf, label: ( /*i18n*/ e[4]("common.undo") @@ -7315,10 +7157,10 @@ function Bo(e) { e[7] ), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7330,31 +7172,31 @@ function Bo(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function Co(e) { +function ko(e) { let t, n; - return t = new Ns({ + return t = new Cs({ props: { href: ( /*download*/ e[2] ), download: !0, - $$slots: { default: [e_] }, + $$slots: { default: [Td] }, $$scope: { ctx: e } } }), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7367,18 +7209,18 @@ function Co(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function e_(e) { +function Td(e) { let t, n; - return t = new Jt({ + return t = new dn({ props: { - Icon: Nl, + Icon: Cl, label: ( /*i18n*/ e[4]("common.download") @@ -7386,10 +7228,10 @@ function e_(e) { } }), { c() { - gn(t.$$.fragment); + pn(t.$$.fragment); }, m(r, i) { - wn(t, r, i), n = !0; + bn(t, r, i), n = !0; }, p(r, i) { const o = {}; @@ -7401,27 +7243,27 @@ function e_(e) { n || (Be(t.$$.fragment, r), n = !0); }, o(r) { - Xe(t.$$.fragment, r), n = !1; + ze(t.$$.fragment, r), n = !1; }, d(r) { - bn(t, r); + gn(t, r); } }; } -function t_(e) { +function Ad(e) { let t, n, r, i, o, l, u = ( /*editable*/ - e[0] && Ao(e) + e[0] && Eo(e) ), s = ( /*undoable*/ - e[1] && Bo(e) + e[1] && So(e) ), a = ( /*download*/ - e[2] && Co(e) + e[2] && ko(e) ); - return o = new Jt({ + return o = new dn({ props: { - Icon: bu, + Icon: du, label: ( /*i18n*/ e[4]("common.clear") @@ -7433,8 +7275,8 @@ function t_(e) { e[8] ), { c() { - t = Jd("div"), u && u.c(), n = qr(), s && s.c(), r = qr(), a && a.c(), i = qr(), gn(o.$$.fragment), Wd(t, "class", "svelte-1wj0ocy"), To(t, "not-absolute", !/*absolute*/ - e[3]), ko( + t = vd("div"), u && u.c(), n = Ur(), s && s.c(), r = Ur(), a && a.c(), i = Ur(), pn(o.$$.fragment), bd(t, "class", "svelte-1wj0ocy"), yo(t, "not-absolute", !/*absolute*/ + e[3]), vo( t, "position", /*absolute*/ @@ -7442,29 +7284,29 @@ function t_(e) { ); }, m(f, d) { - Yd(f, t, d), u && u.m(t, null), Ur(t, n), s && s.m(t, null), Ur(t, r), a && a.m(t, null), Ur(t, i), wn(o, t, null), l = !0; + Ed(f, t, d), u && u.m(t, null), Dr(t, n), s && s.m(t, null), Dr(t, r), a && a.m(t, null), Dr(t, i), bn(o, t, null), l = !0; }, p(f, [d]) { /*editable*/ f[0] ? u ? (u.p(f, d), d & /*editable*/ - 1 && Be(u, 1)) : (u = Ao(f), u.c(), Be(u, 1), u.m(t, n)) : u && (Gr(), Xe(u, 1, 1, () => { + 1 && Be(u, 1)) : (u = Eo(f), u.c(), Be(u, 1), u.m(t, n)) : u && (Rr(), ze(u, 1, 1, () => { u = null; - }), Fr()), /*undoable*/ + }), Mr()), /*undoable*/ f[1] ? s ? (s.p(f, d), d & /*undoable*/ - 2 && Be(s, 1)) : (s = Bo(f), s.c(), Be(s, 1), s.m(t, r)) : s && (Gr(), Xe(s, 1, 1, () => { + 2 && Be(s, 1)) : (s = So(f), s.c(), Be(s, 1), s.m(t, r)) : s && (Rr(), ze(s, 1, 1, () => { s = null; - }), Fr()), /*download*/ + }), Mr()), /*download*/ f[2] ? a ? (a.p(f, d), d & /*download*/ - 4 && Be(a, 1)) : (a = Co(f), a.c(), Be(a, 1), a.m(t, i)) : a && (Gr(), Xe(a, 1, 1, () => { + 4 && Be(a, 1)) : (a = ko(f), a.c(), Be(a, 1), a.m(t, i)) : a && (Rr(), ze(a, 1, 1, () => { a = null; - }), Fr()); + }), Mr()); const c = {}; d & /*i18n*/ 16 && (c.label = /*i18n*/ f[4]("common.clear")), o.$set(c), (!l || d & /*absolute*/ - 8) && To(t, "not-absolute", !/*absolute*/ + 8) && yo(t, "not-absolute", !/*absolute*/ f[3]), d & /*absolute*/ - 8 && ko( + 8 && vo( t, "position", /*absolute*/ @@ -7475,16 +7317,16 @@ function t_(e) { l || (Be(u), Be(s), Be(a), Be(o.$$.fragment, f), l = !0); }, o(f) { - Xe(u), Xe(s), Xe(a), Xe(o.$$.fragment, f), l = !1; + ze(u), ze(s), ze(a), ze(o.$$.fragment, f), l = !1; }, d(f) { - f && Zd(t), u && u.d(), s && s.d(), a && a.d(), bn(o); + f && wd(t), u && u.d(), s && s.d(), a && a.d(), gn(o); } }; } -function n_(e, t, n) { +function Bd(e, t, n) { let { editable: r = !1 } = t, { undoable: i = !1 } = t, { download: o = null } = t, { absolute: l = !0 } = t, { i18n: u } = t; - const s = $d(), a = () => s("edit"), f = () => s("undo"), d = (c) => { + const s = kd(), a = () => s("edit"), f = () => s("undo"), d = (c) => { s("clear"), c.stopPropagation(); }; return e.$$set = (c) => { @@ -7501,9 +7343,9 @@ function n_(e, t, n) { d ]; } -class ki extends Xd { +class yi extends gd { constructor(t) { - super(), Qd(this, t, n_, t_, Kd, { + super(), yd(this, t, Bd, Ad, Sd, { editable: 0, undoable: 1, download: 2, @@ -7513,21 +7355,21 @@ class ki extends Xd { } } const { - SvelteComponent: r_, - assign: fi, - compute_rest_props: Io, - detach: i_, - element: o_, - exclude_internal_props: l_, - get_spread_update: s_, - init: a_, - insert: u_, - noop: Lo, - safe_not_equal: f_, - set_attributes: Po, - src_url_equal: c_ + SvelteComponent: Cd, + assign: si, + compute_rest_props: To, + detach: Id, + element: Ld, + exclude_internal_props: Od, + get_spread_update: Pd, + init: Nd, + insert: Hd, + noop: Ao, + safe_not_equal: Dd, + set_attributes: Bo, + src_url_equal: Md } = window.__gradio__svelte__internal; -function d_(e) { +function Rd(e) { let t, n, r = [ { src: n = /*resolved_src*/ @@ -7537,59 +7379,59 @@ function d_(e) { e[1] ], i = {}; for (let o = 0; o < r.length; o += 1) - i = fi(i, r[o]); + i = si(i, r[o]); return { c() { - t = o_("img"), Po(t, i); + t = Ld("img"), Bo(t, i); }, m(o, l) { - u_(o, t, l); + Hd(o, t, l); }, p(o, [l]) { - Po(t, i = s_(r, [ + Bo(t, i = Pd(r, [ l & /*resolved_src*/ - 1 && !c_(t.src, n = /*resolved_src*/ + 1 && !Md(t.src, n = /*resolved_src*/ o[0]) && { src: n }, l & /*$$restProps*/ 2 && /*$$restProps*/ o[1] ])); }, - i: Lo, - o: Lo, + i: Ao, + o: Ao, d(o) { - o && i_(t); + o && Id(t); } }; } -function __(e, t, n) { +function Ud(e, t, n) { const r = ["src"]; - let i = Io(t, r), { src: o = void 0 } = t, l, u; + let i = To(t, r), { src: o = void 0 } = t, l, u; return e.$$set = (s) => { - t = fi(fi({}, t), l_(s)), n(1, i = Io(t, r)), "src" in s && n(2, o = s.src); + t = si(si({}, t), Od(s)), n(1, i = To(t, r)), "src" in s && n(2, o = s.src); }, e.$$.update = () => { if (e.$$.dirty & /*src, latest_src*/ 12) { n(0, l = o), n(3, u = o); const s = o; - Hd(s).then((a) => { + id(s).then((a) => { u === s && n(0, l = a); }); } }, [l, i, o, u]; } -class Ms extends r_ { +class Is extends Cd { constructor(t) { - super(), a_(this, t, __, d_, f_, { src: 2 }); + super(), Nd(this, t, Ud, Rd, Dd, { src: 2 }); } } -var Oo = Object.prototype.hasOwnProperty; -function Ho(e, t, n) { +var Co = Object.prototype.hasOwnProperty; +function Io(e, t, n) { for (n of e.keys()) - if (ln(n, t)) + if (rn(n, t)) return n; } -function ln(e, t) { +function rn(e, t) { var n, r, i; if (e === t) return !0; @@ -7600,7 +7442,7 @@ function ln(e, t) { return e.toString() === t.toString(); if (n === Array) { if ((r = e.length) === t.length) - for (; r-- && ln(e[r], t[r]); ) + for (; r-- && rn(e[r], t[r]); ) ; return r === -1; } @@ -7608,7 +7450,7 @@ function ln(e, t) { if (e.size !== t.size) return !1; for (r of e) - if (i = r, i && typeof i == "object" && (i = Ho(t, i), !i) || !t.has(i)) + if (i = r, i && typeof i == "object" && (i = Io(t, i), !i) || !t.has(i)) return !1; return !0; } @@ -7616,7 +7458,7 @@ function ln(e, t) { if (e.size !== t.size) return !1; for (r of e) - if (i = r[0], i && typeof i == "object" && (i = Ho(t, i), !i) || !ln(r[1], t.get(i))) + if (i = r[0], i && typeof i == "object" && (i = Io(t, i), !i) || !rn(r[1], t.get(i))) return !1; return !0; } @@ -7637,99 +7479,99 @@ function ln(e, t) { if (!n || typeof e == "object") { r = 0; for (n in e) - if (Oo.call(e, n) && ++r && !Oo.call(t, n) || !(n in t) || !ln(e[n], t[n])) + if (Co.call(e, n) && ++r && !Co.call(t, n) || !(n in t) || !rn(e[n], t[n])) return !1; return Object.keys(t).length === r; } } return e !== e && t !== t; } -function h_(e) { +function Fd(e) { return Object.prototype.toString.call(e) === "[object Object]"; } -function No(e) { - return h_(e) || Array.isArray(e); +function Lo(e) { + return Fd(e) || Array.isArray(e); } -function m_() { +function Gd() { return !!(typeof window < "u" && window.document && window.document.createElement); } -function Ti(e, t) { +function Ei(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; const i = JSON.stringify(Object.keys(e.breakpoints || {})), o = JSON.stringify(Object.keys(t.breakpoints || {})); return i !== o ? !1 : n.every((l) => { const u = e[l], s = t[l]; - return typeof u == "function" ? `${u}` == `${s}` : !No(u) || !No(s) ? u === s : Ti(u, s); + return typeof u == "function" ? `${u}` == `${s}` : !Lo(u) || !Lo(s) ? u === s : Ei(u, s); }); } -function Mo(e) { +function Oo(e) { return e.concat().sort((t, n) => t.name > n.name ? 1 : -1).map((t) => t.options); } -function p_(e, t) { +function qd(e, t) { if (e.length !== t.length) return !1; - const n = Mo(e), r = Mo(t); + const n = Oo(e), r = Oo(t); return n.every((i, o) => { const l = r[o]; - return Ti(i, l); + return Ei(i, l); }); } -function Ai(e) { +function Si(e) { return typeof e == "number"; } -function ci(e) { +function ai(e) { return typeof e == "string"; } -function Bi(e) { +function ki(e) { return typeof e == "boolean"; } -function Do(e) { +function Po(e) { return Object.prototype.toString.call(e) === "[object Object]"; } -function ue(e) { +function ae(e) { return Math.abs(e); } -function Ci(e) { +function Ti(e) { return Math.sign(e); } -function sn(e, t) { - return ue(e - t); +function on(e, t) { + return ae(e - t); } -function g_(e, t) { - if (e === 0 || t === 0 || ue(e) <= ue(t)) +function jd(e, t) { + if (e === 0 || t === 0 || ae(e) <= ae(t)) return 0; - const n = sn(ue(e), ue(t)); - return ue(n / e); + const n = on(ae(e), ae(t)); + return ae(n / e); } -function fn(e) { - return cn(e).map(Number); +function an(e) { + return un(e).map(Number); } -function Ze(e) { - return e[vn(e)]; +function Ve(e) { + return e[wn(e)]; } -function vn(e) { +function wn(e) { return Math.max(0, e.length - 1); } -function Ii(e, t) { - return t === vn(e); +function Ai(e, t) { + return t === wn(e); } -function Ro(e, t = 0) { +function No(e, t = 0) { return Array.from(Array(e), (n, r) => t + r); } -function cn(e) { +function un(e) { return Object.keys(e); } -function Ds(e, t) { - return [e, t].reduce((n, r) => (cn(r).forEach((i) => { - const o = n[i], l = r[i], u = Do(o) && Do(l); - n[i] = u ? Ds(o, l) : l; +function Ls(e, t) { + return [e, t].reduce((n, r) => (un(r).forEach((i) => { + const o = n[i], l = r[i], u = Po(o) && Po(l); + n[i] = u ? Ls(o, l) : l; }), n), {}); } -function Rs(e, t) { +function Os(e, t) { return typeof t.MouseEvent < "u" && e instanceof t.MouseEvent; } -function b_(e, t) { +function xd(e, t) { const n = { start: r, center: i, @@ -7745,13 +7587,13 @@ function b_(e, t) { return t - s; } function l(s, a) { - return ci(e) ? n[e](s) : e(t, s, a); + return ai(e) ? n[e](s) : e(t, s, a); } return { measure: l }; } -function dn() { +function fn() { let e = []; function t(i, o, l, u = { passive: !0 @@ -7774,44 +7616,44 @@ function dn() { }; return r; } -function w_(e, t, n, r) { - const i = dn(), o = 1e3 / 60; +function zd(e, t, n, r) { + const i = fn(), o = 1e3 / 60; let l = null, u = 0, s = 0; function a() { i.add(e, "visibilitychange", () => { - e.hidden && _(); + e.hidden && h(); }); } function f() { - h(), i.clear(); + _(), i.clear(); } function d(g) { l || (l = g); - const p = g - l; - for (l = g, u += p; u >= o; ) + const m = g - l; + for (l = g, u += m; u >= o; ) n(), u -= o; - const v = ue(u / o); + const v = ae(u / o); r(v), s && t.requestAnimationFrame(d); } function c() { s || (s = t.requestAnimationFrame(d)); } - function h() { + function _() { t.cancelAnimationFrame(s), l = null, u = 0, s = 0; } - function _() { + function h() { l = null, u = 0; } return { init: a, destroy: f, start: c, - stop: h, + stop: _, update: n, render: r }; } -function v_(e, t) { +function Vd(e, t) { const n = e === "y" ? "y" : "x", r = e === "y" ? "x" : "y", i = u(), o = s(); function l(f) { const { @@ -7834,8 +7676,8 @@ function v_(e, t) { measureSize: l }; } -function Ot(e = 0, t = 0) { - const n = ue(e - t); +function Lt(e = 0, t = 0) { + const n = ae(e - t); function r(a) { return a < e; } @@ -7862,13 +7704,13 @@ function Ot(e = 0, t = 0) { removeOffset: u }; } -function Us(e, t, n) { +function Ps(e, t, n) { const { constrain: r - } = Ot(0, e), i = e + 1; + } = Lt(0, e), i = e + 1; let o = l(t); function l(c) { - return n ? ue((i + c) % i) : r(c); + return n ? ae((i + c) % i) : r(c); } function u() { return o; @@ -7880,7 +7722,7 @@ function Us(e, t, n) { return f().set(u() + c); } function f() { - return Us(e, u(), n); + return Ps(e, u(), n); } const d = { get: u, @@ -7890,7 +7732,7 @@ function Us(e, t, n) { }; return d; } -function y_(e) { +function Xd(e) { const t = e === "rtl" ? -1 : 1; function n(i) { return i * t; @@ -7899,96 +7741,96 @@ function y_(e) { apply: n }; } -function E_(e, t, n, r, i, o, l, u, s, a, f, d, c, h, _, m, g, p, v, b) { +function Wd(e, t, n, r, i, o, l, u, s, a, f, d, c, _, h, p, g, m, v, w) { const { - cross: w - } = e, y = ["INPUT", "SELECT", "TEXTAREA"], S = { + cross: b + } = e, y = ["INPUT", "SELECT", "TEXTAREA"], k = { passive: !1 - }, C = dn(), P = dn(), k = Ot(50, 225).constrain(_.measure(20)), O = { + }, C = fn(), O = fn(), T = Lt(50, 225).constrain(h.measure(20)), P = { mouse: 300, touch: 400 - }, U = { + }, M = { mouse: 500, touch: 600 - }, x = m ? 43 : 25; - let j = !1, te = 0, ne = 0, ce = !1, me = !1, _e = !1, B = !1; + }, j = p ? 43 : 25; + let q = !1, ee = 0, te = 0, fe = !1, me = !1, _e = !1, B = !1; function pe(I) { - if (!b) + if (!w) return; - function N(Y) { - (Bi(b) || b(I, Y)) && re(Y); + function H(oe) { + (ki(w) || w(I, oe)) && ne(oe); } - const Q = n; - C.add(Q, "dragstart", (Y) => Y.preventDefault(), S).add(Q, "touchmove", () => { - }, S).add(Q, "touchend", () => { - }).add(Q, "touchstart", N).add(Q, "mousedown", N).add(Q, "touchcancel", ee).add(Q, "contextmenu", ee).add(Q, "click", T, !0); + const Z = n; + C.add(Z, "dragstart", (oe) => oe.preventDefault(), k).add(Z, "touchmove", () => { + }, k).add(Z, "touchend", () => { + }).add(Z, "touchstart", H).add(Z, "mousedown", H).add(Z, "touchcancel", z).add(Z, "contextmenu", z).add(Z, "click", K, !0); } - function E() { - C.clear(), P.clear(); + function S() { + C.clear(), O.clear(); } - function M() { + function D() { const I = B ? r : n; - P.add(I, "touchmove", z, S).add(I, "touchend", ee).add(I, "mousemove", z, S).add(I, "mouseup", ee); + O.add(I, "touchmove", E, k).add(I, "touchend", z).add(I, "mousemove", E, k).add(I, "mouseup", z); } function A(I) { - const N = I.nodeName || ""; - return y.includes(N); + const H = I.nodeName || ""; + return y.includes(H); } - function F() { - return (m ? U : O)[B ? "mouse" : "touch"]; + function R() { + return (p ? M : P)[B ? "mouse" : "touch"]; } - function L(I, N) { - const Q = c.add(Ci(I) * -1), Y = d.byDistance(I, !m).distance; - return m || ue(I) < k ? Y : p && N ? Y * 0.5 : d.byIndex(Q.get(), 0).distance; + function L(I, H) { + const Z = c.add(Ti(I) * -1), oe = d.byDistance(I, !p).distance; + return p || ae(I) < T ? oe : m && H ? oe * 0.5 : d.byIndex(Z.get(), 0).distance; } - function re(I) { - const N = Rs(I, i); - B = N, !(N && I.button !== 0) && (A(I.target) || (_e = m && N && !I.buttons && j, j = sn(o.get(), u.get()) >= 2, ce = !0, l.pointerDown(I), f.useFriction(0).useDuration(0), o.set(u), M(), te = l.readPoint(I), ne = l.readPoint(I, w), h.emit("pointerDown"))); + function ne(I) { + const H = Os(I, i); + B = H, !(H && I.button !== 0) && (A(I.target) || (_e = p && H && !I.buttons && q, q = on(o.get(), u.get()) >= 2, fe = !0, l.pointerDown(I), f.useFriction(0).useDuration(0), o.set(u), D(), ee = l.readPoint(I), te = l.readPoint(I, b), _.emit("pointerDown"))); } - function z(I) { - const N = l.readPoint(I), Q = l.readPoint(I, w), Y = sn(N, te), R = sn(Q, ne); - if (!me && !B && (!I.cancelable || (me = Y > R, !me))) - return ee(I); + function E(I) { + const H = l.readPoint(I), Z = l.readPoint(I, b), oe = on(H, ee), x = on(Z, te); + if (!me && !B && (!I.cancelable || (me = oe > x, !me))) + return z(I); const Te = l.pointerMove(I); - Y > g && (_e = !0), f.useFriction(0.3).useDuration(1), s.start(), o.add(t.apply(Te)), I.preventDefault(); + oe > g && (_e = !0), f.useFriction(0.3).useDuration(1), s.start(), o.add(t.apply(Te)), I.preventDefault(); } - function ee(I) { - const Q = d.byDistance(0, !1).index !== c.get(), Y = l.pointerUp(I) * F(), R = L(t.apply(Y), Q), Te = g_(Y, R), He = x - 10 * Te, Ie = v + Te / 50; - me = !1, ce = !1, P.clear(), f.useDuration(He).useFriction(Ie), a.distance(R, !m), B = !1, h.emit("pointerUp"); + function z(I) { + const Z = d.byDistance(0, !1).index !== c.get(), oe = l.pointerUp(I) * R(), x = L(t.apply(oe), Z), Te = jd(oe, x), Ne = j - 10 * Te, Ie = v + Te / 50; + me = !1, fe = !1, O.clear(), f.useDuration(Ne).useFriction(Ie), a.distance(x, !p), B = !1, _.emit("pointerUp"); } - function T(I) { + function K(I) { _e && (I.stopPropagation(), I.preventDefault()); } - function H() { - return ce; + function N() { + return fe; } return { init: pe, - pointerDown: H, - destroy: E + pointerDown: N, + destroy: S }; } -function S_(e, t) { +function Zd(e, t) { let r, i; function o(d) { return d.timeStamp; } function l(d, c) { - const _ = `client${(c || e.scroll) === "x" ? "X" : "Y"}`; - return (Rs(d, t) ? d : d.touches[0])[_]; + const h = `client${(c || e.scroll) === "x" ? "X" : "Y"}`; + return (Os(d, t) ? d : d.touches[0])[h]; } function u(d) { return r = d, i = d, l(d); } function s(d) { - const c = l(d) - l(i), h = o(d) - o(r) > 170; - return i = d, h && (r = d), c; + const c = l(d) - l(i), _ = o(d) - o(r) > 170; + return i = d, _ && (r = d), c; } function a(d) { if (!r || !i) return 0; - const c = l(i) - l(r), h = o(d) - o(r), _ = o(d) - o(i) > 170, m = c / h; - return h && !_ && ue(m) > 0.1 ? m : 0; + const c = l(i) - l(r), _ = o(d) - o(r), h = o(d) - o(i) > 170, p = c / _; + return _ && !h && ae(p) > 0.1 ? p : 0; } return { pointerDown: u, @@ -7997,7 +7839,7 @@ function S_(e, t) { readPoint: l }; } -function k_() { +function Jd() { function e(n) { const { offsetTop: r, @@ -8018,7 +7860,7 @@ function k_() { measure: e }; } -function T_(e) { +function Qd(e) { function t(r) { return e * (r / 100); } @@ -8026,120 +7868,120 @@ function T_(e) { measure: t }; } -function A_(e, t, n, r, i, o, l) { +function Yd(e, t, n, r, i, o, l) { let u, s, a = [], f = !1; - function d(m) { - return i.measureSize(l.measure(m)); + function d(p) { + return i.measureSize(l.measure(p)); } - function c(m) { + function c(p) { if (!o) return; s = d(e), a = r.map(d); function g(v) { - for (const b of v) { - const w = b.target === e, y = r.indexOf(b.target), S = w ? s : a[y], C = d(w ? e : r[y]); - if (ue(C - S) >= 0.5) { + for (const w of v) { + const b = w.target === e, y = r.indexOf(w.target), k = b ? s : a[y], C = d(b ? e : r[y]); + if (ae(C - k) >= 0.5) { n.requestAnimationFrame(() => { - m.reInit(), t.emit("resize"); + p.reInit(), t.emit("resize"); }); break; } } } u = new ResizeObserver((v) => { - f || (Bi(o) || o(m, v)) && g(v); + f || (ki(o) || o(p, v)) && g(v); }), [e].concat(r).forEach((v) => u.observe(v)); } - function h() { + function _() { u && u.disconnect(), f = !0; } return { init: c, - destroy: h + destroy: _ }; } -function B_(e, t, n, r, i) { +function Kd(e, t, n, r, i) { let o = 0, l = 0, u = r, s = i, a = e.get(), f = 0; function d() { - const y = n.get() - e.get(), S = !u; + const y = n.get() - e.get(), k = !u; let C = 0; - return S ? (o = 0, e.set(n), C = y) : (o += y / u, o *= s, a += o, e.add(o), C = a - f), l = Ci(C), f = a, w; + return k ? (o = 0, e.set(n), C = y) : (o += y / u, o *= s, a += o, e.add(o), C = a - f), l = Ti(C), f = a, b; } function c() { const y = n.get() - t.get(); - return ue(y) < 1e-3; + return ae(y) < 1e-3; } - function h() { + function _() { return u; } - function _() { + function h() { return l; } - function m() { + function p() { return o; } function g() { return v(r); } - function p() { - return b(i); + function m() { + return w(i); } function v(y) { - return u = y, w; + return u = y, b; } - function b(y) { - return s = y, w; + function w(y) { + return s = y, b; } - const w = { - direction: _, - duration: h, - velocity: m, + const b = { + direction: h, + duration: _, + velocity: p, seek: d, settled: c, - useBaseFriction: p, + useBaseFriction: m, useBaseDuration: g, - useFriction: b, + useFriction: w, useDuration: v }; - return w; + return b; } -function C_(e, t, n, r, i) { - const o = i.measure(10), l = i.measure(50), u = Ot(0.1, 0.99); +function $d(e, t, n, r, i) { + const o = i.measure(10), l = i.measure(50), u = Lt(0.1, 0.99); let s = !1; function a() { return !(s || !e.reachedAny(n.get()) || !e.reachedAny(t.get())); } - function f(h) { + function f(_) { if (!a()) return; - const _ = e.reachedMin(t.get()) ? "min" : "max", m = ue(e[_] - t.get()), g = n.get() - t.get(), p = u.constrain(m / l); - n.subtract(g * p), !h && ue(g) < o && (n.set(e.constrain(n.get())), r.useDuration(25).useBaseFriction()); + const h = e.reachedMin(t.get()) ? "min" : "max", p = ae(e[h] - t.get()), g = n.get() - t.get(), m = u.constrain(p / l); + n.subtract(g * m), !_ && ae(g) < o && (n.set(e.constrain(n.get())), r.useDuration(25).useBaseFriction()); } - function d(h) { - s = !h; + function d(_) { + s = !_; } return { constrain: f, toggleActive: d }; } -function I_(e, t, n, r, i) { - const o = Ot(-t + e, 0), l = d(), u = f(), s = c(); - function a(_, m) { - return sn(_, m) < 1; +function e_(e, t, n, r, i) { + const o = Lt(-t + e, 0), l = d(), u = f(), s = c(); + function a(h, p) { + return on(h, p) < 1; } function f() { - const _ = l[0], m = Ze(l), g = l.lastIndexOf(_), p = l.indexOf(m) + 1; - return Ot(g, p); + const h = l[0], p = Ve(l), g = l.lastIndexOf(h), m = l.indexOf(p) + 1; + return Lt(g, m); } function d() { - return n.map((_, m) => { + return n.map((h, p) => { const { min: g, - max: p - } = o, v = o.constrain(_), b = !m, w = Ii(n, m); - return b ? p : w || a(g, v) ? g : a(p, v) ? p : v; - }).map((_) => parseFloat(_.toFixed(3))); + max: m + } = o, v = o.constrain(h), w = !p, b = Ai(n, p); + return w ? m : b || a(g, v) ? g : a(m, v) ? m : v; + }).map((h) => parseFloat(h.toFixed(3))); } function c() { if (t <= e + i) @@ -8147,41 +7989,41 @@ function I_(e, t, n, r, i) { if (r === "keepSnaps") return l; const { - min: _, - max: m + min: h, + max: p } = u; - return l.slice(_, m); + return l.slice(h, p); } return { snapsContained: s, scrollContainLimit: u }; } -function L_(e, t, n) { - const r = t[0], i = n ? r - e : Ze(t); +function t_(e, t, n) { + const r = t[0], i = n ? r - e : Ve(t); return { - limit: Ot(i, r) + limit: Lt(i, r) }; } -function P_(e, t, n, r) { +function n_(e, t, n, r) { const o = t.min + 0.1, l = t.max + 0.1, { reachedMin: u, reachedMax: s - } = Ot(o, l); + } = Lt(o, l); function a(c) { return c === 1 ? s(n.get()) : c === -1 ? u(n.get()) : !1; } function f(c) { if (!a(c)) return; - const h = e * (c * -1); - r.forEach((_) => _.add(h)); + const _ = e * (c * -1); + r.forEach((h) => h.add(_)); } return { loop: f }; } -function O_(e) { +function r_(e) { const { max: t, length: n @@ -8194,28 +8036,28 @@ function O_(e) { get: r }; } -function H_(e, t, n, r, i) { +function i_(e, t, n, r, i) { const { startEdge: o, endEdge: l } = e, { groupSlides: u - } = i, s = d().map(t.measure), a = c(), f = h(); + } = i, s = d().map(t.measure), a = c(), f = _(); function d() { - return u(r).map((m) => Ze(m)[l] - m[0][o]).map(ue); + return u(r).map((p) => Ve(p)[l] - p[0][o]).map(ae); } function c() { - return r.map((m) => n[o] - m[o]).map((m) => -ue(m)); + return r.map((p) => n[o] - p[o]).map((p) => -ae(p)); } - function h() { - return u(a).map((m) => m[0]).map((m, g) => m + s[g]); + function _() { + return u(a).map((p) => p[0]).map((p, g) => p + s[g]); } return { snaps: a, snapsAligned: f }; } -function N_(e, t, n, r, i, o) { +function o_(e, t, n, r, i, o) { const { groupSlides: l } = i, { @@ -8223,74 +8065,74 @@ function N_(e, t, n, r, i, o) { max: s } = r, a = f(); function f() { - const c = l(o), h = !e || t === "keepSnaps"; - return n.length === 1 ? [o] : h ? c : c.slice(u, s).map((_, m, g) => { - const p = !m, v = Ii(g, m); - if (p) { - const b = Ze(g[0]) + 1; - return Ro(b); + const c = l(o), _ = !e || t === "keepSnaps"; + return n.length === 1 ? [o] : _ ? c : c.slice(u, s).map((h, p, g) => { + const m = !p, v = Ai(g, p); + if (m) { + const w = Ve(g[0]) + 1; + return No(w); } if (v) { - const b = vn(o) - Ze(g)[0] + 1; - return Ro(b, Ze(g)[0]); + const w = wn(o) - Ve(g)[0] + 1; + return No(w, Ve(g)[0]); } - return _; + return h; }); } return { slideRegistry: a }; } -function M_(e, t, n, r, i) { +function l_(e, t, n, r, i) { const { reachedAny: o, removeOffset: l, constrain: u } = r; - function s(_) { - return _.concat().sort((m, g) => ue(m) - ue(g))[0]; + function s(h) { + return h.concat().sort((p, g) => ae(p) - ae(g))[0]; } - function a(_) { - const m = e ? l(_) : u(_), g = t.map((v) => v - m).map((v) => f(v, 0)).map((v, b) => ({ + function a(h) { + const p = e ? l(h) : u(h), g = t.map((v) => v - p).map((v) => f(v, 0)).map((v, w) => ({ diff: v, - index: b - })).sort((v, b) => ue(v.diff) - ue(b.diff)), { - index: p + index: w + })).sort((v, w) => ae(v.diff) - ae(w.diff)), { + index: m } = g[0]; return { - index: p, - distance: m + index: m, + distance: p }; } - function f(_, m) { - const g = [_, _ + n, _ - n]; + function f(h, p) { + const g = [h, h + n, h - n]; if (!e) return g[0]; - if (!m) + if (!p) return s(g); - const p = g.filter((v) => Ci(v) === m); - return p.length ? s(p) : Ze(g) - n; + const m = g.filter((v) => Ti(v) === p); + return m.length ? s(m) : Ve(g) - n; } - function d(_, m) { - const g = t[_] - i.get(), p = f(g, m); + function d(h, p) { + const g = t[h] - i.get(), m = f(g, p); return { - index: _, - distance: p + index: h, + distance: m }; } - function c(_, m) { - const g = i.get() + _, { - index: p, + function c(h, p) { + const g = i.get() + h, { + index: m, distance: v - } = a(g), b = !e && o(g); - if (!m || b) + } = a(g), w = !e && o(g); + if (!p || w) return { - index: p, - distance: _ + index: m, + distance: h }; - const w = t[p] - v, y = _ + f(w, 0); + const b = t[m] - v, y = h + f(b, 0); return { - index: p, + index: m, distance: y }; } @@ -8300,25 +8142,25 @@ function M_(e, t, n, r, i) { shortcut: f }; } -function D_(e, t, n, r, i, o, l) { +function s_(e, t, n, r, i, o, l) { function u(d) { - const c = d.distance, h = d.index !== t.get(); - o.add(c), c && (r.duration() ? e.start() : (e.update(), e.render(1), e.update())), h && (n.set(t.get()), t.set(d.index), l.emit("select")); + const c = d.distance, _ = d.index !== t.get(); + o.add(c), c && (r.duration() ? e.start() : (e.update(), e.render(1), e.update())), _ && (n.set(t.get()), t.set(d.index), l.emit("select")); } function s(d, c) { - const h = i.byDistance(d, c); - u(h); + const _ = i.byDistance(d, c); + u(_); } function a(d, c) { - const h = t.clone().set(d), _ = i.byIndex(h.get(), c); - u(_); + const _ = t.clone().set(d), h = i.byIndex(_.get(), c); + u(h); } return { distance: s, index: a }; } -function R_(e, t, n, r, i, o) { +function a_(e, t, n, r, i, o) { let l = 0; function u() { o.add(document, "keydown", s, !1), t.forEach(a); @@ -8331,8 +8173,8 @@ function R_(e, t, n, r, i, o) { if ((/* @__PURE__ */ new Date()).getTime() - l > 10) return; e.scrollLeft = 0; - const m = t.indexOf(d), g = n.findIndex((p) => p.includes(m)); - Ai(g) && (i.useDuration(0), r.index(g, 0)); + const p = t.indexOf(d), g = n.findIndex((m) => m.includes(p)); + Si(g) && (i.useDuration(0), r.index(g, 0)); }; o.add(d, "focus", c, { passive: !0, @@ -8343,7 +8185,7 @@ function R_(e, t, n, r, i, o) { init: u }; } -function Fn(e) { +function Rn(e) { let t = e; function n() { return t; @@ -8358,7 +8200,7 @@ function Fn(e) { t -= l(s); } function l(s) { - return Ai(s) ? s : s.get(); + return Si(s) ? s : s.get(); } return { get: n, @@ -8367,7 +8209,7 @@ function Fn(e) { subtract: o }; } -function Fs(e, t, n) { +function Ns(e, t, n) { const r = e.scroll === "x" ? l : u, i = n.style; let o = !1; function l(c) { @@ -8391,70 +8233,70 @@ function Fs(e, t, n) { toggleActive: a }; } -function U_(e, t, n, r, i, o, l, u, s, a) { - const d = fn(o), c = fn(o).reverse(), h = v().concat(b()); - function _(P, k) { - return P.reduce((O, U) => O - o[U], k); +function u_(e, t, n, r, i, o, l, u, s, a) { + const d = an(o), c = an(o).reverse(), _ = v().concat(w()); + function h(O, T) { + return O.reduce((P, M) => P - o[M], T); } - function m(P, k) { - return P.reduce((O, U) => _(O, k) > 0 ? O.concat([U]) : O, []); + function p(O, T) { + return O.reduce((P, M) => h(P, T) > 0 ? P.concat([M]) : P, []); } - function g(P) { - return l.map((k, O) => ({ - start: k - i[O] + 0.5 + P, - end: k + n - 0.5 + P + function g(O) { + return l.map((T, P) => ({ + start: T - i[P] + 0.5 + O, + end: T + n - 0.5 + O })); } - function p(P, k, O) { - const U = g(k); - return P.map((x) => { - const j = O ? 0 : -r, te = O ? r : 0, ne = O ? "end" : "start", ce = U[x][ne]; + function m(O, T, P) { + const M = g(T); + return O.map((j) => { + const q = P ? 0 : -r, ee = P ? r : 0, te = P ? "end" : "start", fe = M[j][te]; return { - index: x, - loopPoint: ce, - slideLocation: Fn(-1), - translate: Fs(e, t, a[x]), - target: () => s.get() > ce ? j : te + index: j, + loopPoint: fe, + slideLocation: Rn(-1), + translate: Ns(e, t, a[j]), + target: () => s.get() > fe ? q : ee }; }); } function v() { - const P = u[0], k = m(c, P); - return p(k, r, !1); - } - function b() { - const P = n - u[0] - 1, k = m(d, P); - return p(k, -r, !0); + const O = u[0], T = p(c, O); + return m(T, r, !1); } function w() { - return h.every(({ - index: P + const O = n - u[0] - 1, T = p(d, O); + return m(T, -r, !0); + } + function b() { + return _.every(({ + index: O }) => { - const k = d.filter((O) => O !== P); - return _(k, n) <= 0.1; + const T = d.filter((P) => P !== O); + return h(T, n) <= 0.1; }); } function y() { - h.forEach((P) => { + _.forEach((O) => { const { - target: k, - translate: O, - slideLocation: U - } = P, x = k(); - x !== U.get() && (O.to(x), U.set(x)); + target: T, + translate: P, + slideLocation: M + } = O, j = T(); + j !== M.get() && (P.to(j), M.set(j)); }); } - function S() { - h.forEach((P) => P.translate.clear()); + function k() { + _.forEach((O) => O.translate.clear()); } return { - canLoop: w, - clear: S, + canLoop: b, + clear: k, loop: y, - loopPoints: h + loopPoints: _ }; } -function F_(e, t, n) { +function f_(e, t, n) { let r, i = !1; function o(s) { if (!n) @@ -8467,7 +8309,7 @@ function F_(e, t, n) { } } r = new MutationObserver((f) => { - i || (Bi(n) || n(s, f)) && a(f); + i || (ki(n) || n(s, f)) && a(f); }), r.observe(e, { childList: !0 }); @@ -8480,38 +8322,38 @@ function F_(e, t, n) { destroy: l }; } -function G_(e, t, n, r) { +function c_(e, t, n, r) { const i = {}; let o = null, l = null, u, s = !1; function a() { - u = new IntersectionObserver((_) => { - s || (_.forEach((m) => { - const g = t.indexOf(m.target); - i[g] = m; + u = new IntersectionObserver((h) => { + s || (h.forEach((p) => { + const g = t.indexOf(p.target); + i[g] = p; }), o = null, l = null, n.emit("slidesInView")); }, { root: e.parentElement, threshold: r - }), t.forEach((_) => u.observe(_)); + }), t.forEach((h) => u.observe(h)); } function f() { u && u.disconnect(), s = !0; } - function d(_) { - return cn(i).reduce((m, g) => { - const p = parseInt(g), { + function d(h) { + return un(i).reduce((p, g) => { + const m = parseInt(g), { isIntersecting: v - } = i[p]; - return (_ && v || !_ && !v) && m.push(p), m; + } = i[m]; + return (h && v || !h && !v) && p.push(m), p; }, []); } - function c(_ = !0) { - if (_ && o) + function c(h = !0) { + if (h && o) return o; - if (!_ && l) + if (!h && l) return l; - const m = d(_); - return _ && (o = m), _ || (l = m), m; + const p = d(h); + return h && (o = p), h || (l = p), p; } return { init: a, @@ -8519,62 +8361,62 @@ function G_(e, t, n, r) { get: c }; } -function q_(e, t, n, r, i, o) { +function d_(e, t, n, r, i, o) { const { measureSize: l, startEdge: u, endEdge: s - } = e, a = n[0] && i, f = _(), d = m(), c = n.map(l), h = g(); - function _() { + } = e, a = n[0] && i, f = h(), d = p(), c = n.map(l), _ = g(); + function h() { if (!a) return 0; const v = n[0]; - return ue(t[u] - v[u]); + return ae(t[u] - v[u]); } - function m() { + function p() { if (!a) return 0; - const v = o.getComputedStyle(Ze(r)); + const v = o.getComputedStyle(Ve(r)); return parseFloat(v.getPropertyValue(`margin-${s}`)); } function g() { - return n.map((v, b, w) => { - const y = !b, S = Ii(w, b); - return y ? c[b] + f : S ? c[b] + d : w[b + 1][u] - v[u]; - }).map(ue); + return n.map((v, w, b) => { + const y = !w, k = Ai(b, w); + return y ? c[w] + f : k ? c[w] + d : b[w + 1][u] - v[u]; + }).map(ae); } return { slideSizes: c, - slideSizesWithGaps: h, + slideSizesWithGaps: _, startGap: f, endGap: d }; } -function j_(e, t, n, r, i, o, l, u, s, a) { +function __(e, t, n, r, i, o, l, u, s, a) { const { startEdge: f, endEdge: d - } = e, c = Ai(r); - function h(p, v) { - return fn(p).filter((b) => b % v === 0).map((b) => p.slice(b, b + v)); - } - function _(p) { - return p.length ? fn(p).reduce((v, b) => { - const w = Ze(v) || 0, y = w === 0, S = b === vn(p), C = o[f] - l[w][f], P = o[f] - l[b][d], k = !i && y ? t.apply(u) : 0, O = !i && S ? t.apply(s) : 0; - return ue(P - O - (C + k)) > n + a && v.push(b), S && v.push(p.length), v; - }, []).map((v, b, w) => { - const y = Math.max(w[b - 1] || 0); - return p.slice(y, v); + } = e, c = Si(r); + function _(m, v) { + return an(m).filter((w) => w % v === 0).map((w) => m.slice(w, w + v)); + } + function h(m) { + return m.length ? an(m).reduce((v, w) => { + const b = Ve(v) || 0, y = b === 0, k = w === wn(m), C = o[f] - l[b][f], O = o[f] - l[w][d], T = !i && y ? t.apply(u) : 0, P = !i && k ? t.apply(s) : 0; + return ae(O - P - (C + T)) > n + a && v.push(w), k && v.push(m.length), v; + }, []).map((v, w, b) => { + const y = Math.max(b[w - 1] || 0); + return m.slice(y, v); }) : []; } - function m(p) { - return c ? h(p, r) : _(p); + function p(m) { + return c ? _(m, r) : h(m); } return { - groupSlides: m + groupSlides: p }; } -function x_(e, t, n, r, i, o, l) { +function h_(e, t, n, r, i, o, l) { const { align: u, axis: s, @@ -8582,95 +8424,95 @@ function x_(e, t, n, r, i, o, l) { startIndex: f, loop: d, duration: c, - dragFree: h, - dragThreshold: _, - inViewThreshold: m, + dragFree: _, + dragThreshold: h, + inViewThreshold: p, slidesToScroll: g, - skipSnaps: p, + skipSnaps: m, containScroll: v, - watchResize: b, - watchSlides: w, + watchResize: w, + watchSlides: b, watchDrag: y - } = o, S = 2, C = k_(), P = C.measure(t), k = n.map(C.measure), O = y_(a), U = v_(s, a), x = U.measureSize(P), j = T_(x), te = b_(u, x), ne = !d && !!v, ce = d || !!v, { + } = o, k = 2, C = Jd(), O = C.measure(t), T = n.map(C.measure), P = Xd(a), M = Vd(s, a), j = M.measureSize(O), q = Qd(j), ee = xd(u, j), te = !d && !!v, fe = d || !!v, { slideSizes: me, slideSizesWithGaps: _e, startGap: B, endGap: pe - } = q_(U, P, k, n, ce, i), E = j_(U, O, x, g, d, P, k, B, pe, S), { - snaps: M, + } = d_(M, O, T, n, fe, i), S = __(M, P, j, g, d, O, T, B, pe, k), { + snaps: D, snapsAligned: A - } = H_(U, te, P, k, E), F = -Ze(M) + Ze(_e), { + } = i_(M, ee, O, T, S), R = -Ve(D) + Ve(_e), { snapsContained: L, - scrollContainLimit: re - } = I_(x, F, A, v, S), z = ne ? L : A, { - limit: ee - } = L_(F, z, d), T = Us(vn(z), f, d), H = T.clone(), D = fn(n), I = ({ + scrollContainLimit: ne + } = e_(j, R, A, v, k), E = te ? L : A, { + limit: z + } = t_(R, E, d), K = Ps(wn(E), f, d), N = K.clone(), U = an(n), I = ({ dragHandler: Ae, - scrollBody: $t, - scrollBounds: cr, + scrollBody: Kt, + scrollBounds: ur, options: { - loop: kn + loop: Sn } }) => { - kn || cr.constrain(Ae.pointerDown()), $t.seek(); - }, N = ({ + Sn || ur.constrain(Ae.pointerDown()), Kt.seek(); + }, H = ({ scrollBody: Ae, - translate: $t, - location: cr, - offsetLocation: kn, - scrollLooper: Ys, - slideLooper: Ks, - dragHandler: $s, - animation: ea, - eventHandler: Oi, + translate: Kt, + location: ur, + offsetLocation: Sn, + scrollLooper: Vs, + slideLooper: Xs, + dragHandler: Ws, + animation: Zs, + eventHandler: Ii, options: { - loop: ta + loop: Js } - }, na) => { - const Hi = Ae.velocity(), Ni = Ae.settled(); - Ni && !$s.pointerDown() && (ea.stop(), Oi.emit("settle")), Ni || Oi.emit("scroll"), kn.set(cr.get() - Hi + Hi * na), ta && (Ys.loop(Ae.direction()), Ks.loop()), $t.to(kn.get()); - }, Q = w_(r, i, () => I(Z), (Ae) => N(Z, Ae)), Y = 0.68, R = z[T.get()], Te = Fn(R), He = Fn(R), Ie = Fn(R), $e = B_(Te, He, Ie, c, Y), de = M_(d, z, F, ee, Ie), we = D_(Q, T, H, $e, de, Ie, l), oe = O_(ee), se = dn(), Le = G_(t, n, l, m), { + }, Qs) => { + const Li = Ae.velocity(), Oi = Ae.settled(); + Oi && !Ws.pointerDown() && (Zs.stop(), Ii.emit("settle")), Oi || Ii.emit("scroll"), Sn.set(ur.get() - Li + Li * Qs), Js && (Vs.loop(Ae.direction()), Xs.loop()), Kt.to(Sn.get()); + }, Z = zd(r, i, () => I(J), (Ae) => H(J, Ae)), oe = 0.68, x = E[K.get()], Te = Rn(x), Ne = Rn(x), Ie = Rn(x), $e = Kd(Te, Ne, Ie, c, oe), ce = l_(d, E, R, z, Ie), we = s_(Z, K, N, $e, ce, Ie, l), re = r_(z), le = fn(), Le = c_(t, n, l, p), { slideRegistry: ge - } = N_(ne, v, z, re, E, D), K = R_(e, n, ge, we, $e, se), Z = { + } = o_(te, v, E, ne, S, U), Q = a_(e, n, ge, we, $e, le), J = { ownerDocument: r, ownerWindow: i, eventHandler: l, - containerRect: P, - slideRects: k, - animation: Q, - axis: U, - direction: O, - dragHandler: E_(U, O, e, r, i, Ie, S_(U, i), Te, Q, we, $e, de, T, l, j, h, _, p, Y, y), - eventStore: se, - percentOfView: j, - index: T, - indexPrevious: H, - limit: ee, + containerRect: O, + slideRects: T, + animation: Z, + axis: M, + direction: P, + dragHandler: Wd(M, P, e, r, i, Ie, Zd(M, i), Te, Z, we, $e, ce, K, l, q, _, h, m, oe, y), + eventStore: le, + percentOfView: q, + index: K, + indexPrevious: N, + limit: z, location: Te, - offsetLocation: He, + offsetLocation: Ne, options: o, - resizeHandler: A_(t, l, i, n, U, b, C), + resizeHandler: Yd(t, l, i, n, M, w, C), scrollBody: $e, - scrollBounds: C_(ee, Te, Ie, $e, j), - scrollLooper: P_(F, ee, He, [Te, He, Ie]), - scrollProgress: oe, - scrollSnapList: z.map(oe.get), - scrollSnaps: z, - scrollTarget: de, + scrollBounds: $d(z, Te, Ie, $e, q), + scrollLooper: n_(R, z, Ne, [Te, Ne, Ie]), + scrollProgress: re, + scrollSnapList: E.map(re.get), + scrollSnaps: E, + scrollTarget: ce, scrollTo: we, - slideLooper: U_(U, O, x, F, me, _e, M, z, He, n), - slideFocus: K, - slidesHandler: F_(t, l, w), + slideLooper: u_(M, P, j, R, me, _e, D, E, Ne, n), + slideFocus: Q, + slidesHandler: f_(t, l, b), slidesInView: Le, - slideIndexes: D, + slideIndexes: U, slideRegistry: ge, - slidesToScroll: E, + slidesToScroll: S, target: Ie, - translate: Fs(U, O, t) + translate: Ns(M, P, t) }; - return Z; + return J; } -function z_() { +function m_() { const e = {}; let t; function n(s) { @@ -8696,7 +8538,7 @@ function z_() { }; return u; } -const V_ = { +const p_ = { align: "center", axis: "x", container: null, @@ -8717,16 +8559,16 @@ const V_ = { watchResize: !0, watchSlides: !0 }; -function X_(e) { +function g_(e) { function t(o, l) { - return Ds(o, l || {}); + return Ls(o, l || {}); } function n(o) { - const l = o.breakpoints || {}, u = cn(l).filter((s) => e.matchMedia(s).matches).map((s) => l[s]).reduce((s, a) => t(s, a), {}); + const l = o.breakpoints || {}, u = un(l).filter((s) => e.matchMedia(s).matches).map((s) => l[s]).reduce((s, a) => t(s, a), {}); return t(o, u); } function r(o) { - return o.map((l) => cn(l.breakpoints || {})).reduce((l, u) => l.concat(u), []).map(e.matchMedia); + return o.map((l) => un(l.breakpoints || {})).reduce((l, u) => l.concat(u), []).map(e.matchMedia); } return { mergeOptions: t, @@ -8734,7 +8576,7 @@ function X_(e) { optionsMediaQueries: r }; } -function W_(e) { +function b_(e) { let t = []; function n(o, l) { return t = l.filter(({ @@ -8751,148 +8593,148 @@ function W_(e) { destroy: r }; } -function Wn(e, t, n) { - const r = e.ownerDocument, i = r.defaultView, o = X_(i), l = W_(o), u = dn(), s = z_(), { +function Vn(e, t, n) { + const r = e.ownerDocument, i = r.defaultView, o = g_(i), l = b_(o), u = fn(), s = m_(), { mergeOptions: a, optionsAtMedia: f, optionsMediaQueries: d } = o, { on: c, - off: h, - emit: _ - } = s, m = U; - let g = !1, p, v = a(V_, Wn.globalOptions), b = a(v), w = [], y, S, C; - function P() { + off: _, + emit: h + } = s, p = M; + let g = !1, m, v = a(p_, Vn.globalOptions), w = a(v), b = [], y, k, C; + function O() { const { - container: D, + container: U, slides: I - } = b; - S = (ci(D) ? e.querySelector(D) : D) || e.children[0]; - const Q = ci(I) ? S.querySelectorAll(I) : I; - C = [].slice.call(Q || S.children); - } - function k(D) { - const I = x_(e, S, C, r, i, D, s); - if (D.loop && !I.slideLooper.canLoop()) { - const N = Object.assign({}, D, { + } = w; + k = (ai(U) ? e.querySelector(U) : U) || e.children[0]; + const Z = ai(I) ? k.querySelectorAll(I) : I; + C = [].slice.call(Z || k.children); + } + function T(U) { + const I = h_(e, k, C, r, i, U, s); + if (U.loop && !I.slideLooper.canLoop()) { + const H = Object.assign({}, U, { loop: !1 }); - return k(N); + return T(H); } return I; } - function O(D, I) { - g || (v = a(v, D), b = f(v), w = I || w, P(), p = k(b), d([v, ...w.map(({ - options: N - }) => N)]).forEach((N) => u.add(N, "change", U)), b.active && (p.translate.to(p.location.get()), p.animation.init(), p.slidesInView.init(), p.slideFocus.init(), p.eventHandler.init(H), p.resizeHandler.init(H), p.slidesHandler.init(H), p.options.loop && p.slideLooper.loop(), S.offsetParent && C.length && p.dragHandler.init(H), y = l.init(H, w))); + function P(U, I) { + g || (v = a(v, U), w = f(v), b = I || b, O(), m = T(w), d([v, ...b.map(({ + options: H + }) => H)]).forEach((H) => u.add(H, "change", M)), w.active && (m.translate.to(m.location.get()), m.animation.init(), m.slidesInView.init(), m.slideFocus.init(), m.eventHandler.init(N), m.resizeHandler.init(N), m.slidesHandler.init(N), m.options.loop && m.slideLooper.loop(), k.offsetParent && C.length && m.dragHandler.init(N), y = l.init(N, b))); } - function U(D, I) { - const N = E(); - x(), O(a({ - startIndex: N - }, D), I), s.emit("reInit"); - } - function x() { - p.dragHandler.destroy(), p.eventStore.clear(), p.translate.clear(), p.slideLooper.clear(), p.resizeHandler.destroy(), p.slidesHandler.destroy(), p.slidesInView.destroy(), p.animation.destroy(), l.destroy(), u.clear(); + function M(U, I) { + const H = S(); + j(), P(a({ + startIndex: H + }, U), I), s.emit("reInit"); } function j() { - g || (g = !0, u.clear(), x(), s.emit("destroy")); + m.dragHandler.destroy(), m.eventStore.clear(), m.translate.clear(), m.slideLooper.clear(), m.resizeHandler.destroy(), m.slidesHandler.destroy(), m.slidesInView.destroy(), m.animation.destroy(), l.destroy(), u.clear(); + } + function q() { + g || (g = !0, u.clear(), j(), s.emit("destroy")); } - function te(D, I, N) { - !b.active || g || (p.scrollBody.useBaseFriction().useDuration(I === !0 ? 0 : b.duration), p.scrollTo.index(D, N || 0)); + function ee(U, I, H) { + !w.active || g || (m.scrollBody.useBaseFriction().useDuration(I === !0 ? 0 : w.duration), m.scrollTo.index(U, H || 0)); } - function ne(D) { - const I = p.index.add(1).get(); - te(I, D, -1); + function te(U) { + const I = m.index.add(1).get(); + ee(I, U, -1); } - function ce(D) { - const I = p.index.add(-1).get(); - te(I, D, 1); + function fe(U) { + const I = m.index.add(-1).get(); + ee(I, U, 1); } function me() { - return p.index.add(1).get() !== E(); + return m.index.add(1).get() !== S(); } function _e() { - return p.index.add(-1).get() !== E(); + return m.index.add(-1).get() !== S(); } function B() { - return p.scrollSnapList; + return m.scrollSnapList; } function pe() { - return p.scrollProgress.get(p.location.get()); + return m.scrollProgress.get(m.location.get()); } - function E() { - return p.index.get(); + function S() { + return m.index.get(); } - function M() { - return p.indexPrevious.get(); + function D() { + return m.indexPrevious.get(); } function A() { - return p.slidesInView.get(); + return m.slidesInView.get(); } - function F() { - return p.slidesInView.get(!1); + function R() { + return m.slidesInView.get(!1); } function L() { return y; } - function re() { - return p; + function ne() { + return m; } - function z() { + function E() { return e; } - function ee() { - return S; + function z() { + return k; } - function T() { + function K() { return C; } - const H = { + const N = { canScrollNext: me, canScrollPrev: _e, - containerNode: ee, - internalEngine: re, - destroy: j, - off: h, + containerNode: z, + internalEngine: ne, + destroy: q, + off: _, on: c, - emit: _, + emit: h, plugins: L, - previousScrollSnap: M, - reInit: m, - rootNode: z, - scrollNext: ne, - scrollPrev: ce, + previousScrollSnap: D, + reInit: p, + rootNode: E, + scrollNext: te, + scrollPrev: fe, scrollProgress: pe, scrollSnapList: B, - scrollTo: te, - selectedScrollSnap: E, - slideNodes: T, + scrollTo: ee, + selectedScrollSnap: S, + slideNodes: K, slidesInView: A, - slidesNotInView: F + slidesNotInView: R }; - return O(t, n), setTimeout(() => s.emit("init"), 0), H; + return P(t, n), setTimeout(() => s.emit("init"), 0), N; } -Wn.globalOptions = void 0; -function Li(e, t = { +Vn.globalOptions = void 0; +function Bi(e, t = { options: {}, plugins: [] }) { let n = t, r; - return m_() && (Wn.globalOptions = Li.globalOptions, r = Wn(e, n.options, n.plugins), r.on("init", () => e.dispatchEvent(new CustomEvent("emblaInit", { + return Gd() && (Vn.globalOptions = Bi.globalOptions, r = Vn(e, n.options, n.plugins), r.on("init", () => e.dispatchEvent(new CustomEvent("emblaInit", { detail: r })))), { destroy: () => { r && r.destroy(); }, update: (i) => { - const o = !Ti(n.options, i.options), l = !p_(n.plugins, i.plugins); + const o = !Ei(n.options, i.options), l = !qd(n.plugins, i.plugins); !o && !l || (n = i, r && r.reInit(n.options, n.plugins)); } }; } -Li.globalOptions = void 0; -const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { +Bi.globalOptions = void 0; +const w_ = 4.2, v_ = (e, t, n) => Math.min(Math.max(e, t), n), y_ = (e) => { const t = e.internalEngine(), n = e.scrollProgress(); return e.scrollSnapList().map((r, i) => { if (!e.slidesInView().includes(i)) @@ -8905,14 +8747,14 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { a === -1 && (o = r - (1 + n)), a === 1 && (o = r + (1 - n)); } }); - const l = 1 - Math.abs(o * Z_); - return J_(l, 0, 1); + const l = 1 - Math.abs(o * w_); + return v_(l, 0, 1); }); -}, Y_ = (e) => { +}, E_ = (e) => { const t = e.slideNodes(); return { applyTweenOpacity: () => { - Q_(e).forEach((o, l) => { + y_(e).forEach((o, l) => { t[l].style.opacity = o.toString(); }); }, @@ -8920,7 +8762,7 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { t.forEach((i) => i.removeAttribute("style")); } }; -}, K_ = { +}, S_ = { active: !0, breakpoints: {}, delay: 4e3, @@ -8932,26 +8774,26 @@ const Z_ = 4.2, J_ = (e, t, n) => Math.min(Math.max(e, t), n), Q_ = (e) => { stopOnLastSnap: !1, rootNode: null }; -function Pi(e = {}) { +function Ci(e = {}) { let t, n, r, i = !1, o = !0, l = !1, u = 0, s = 0; - function a(w, y) { - n = w; + function a(b, y) { + n = b; const { - mergeOptions: S, + mergeOptions: k, optionsAtMedia: C - } = y, P = S(K_, Pi.globalOptions), k = S(P, e); - if (t = C(k), n.scrollSnapList().length <= 1) + } = y, O = k(S_, Ci.globalOptions), T = k(O, e); + if (t = C(T), n.scrollSnapList().length <= 1) return; l = t.jump, r = !1; const { - eventStore: O, - ownerDocument: U - } = n.internalEngine(), x = n.rootNode(), j = t.rootNode && t.rootNode(x) || x, te = n.containerNode(); - n.on("pointerDown", c), t.stopOnInteraction || n.on("pointerUp", d), t.stopOnMouseEnter && (O.add(j, "mouseenter", () => { + eventStore: P, + ownerDocument: M + } = n.internalEngine(), j = n.rootNode(), q = t.rootNode && t.rootNode(j) || j, ee = n.containerNode(); + n.on("pointerDown", c), t.stopOnInteraction || n.on("pointerUp", d), t.stopOnMouseEnter && (P.add(q, "mouseenter", () => { o = !1, c(); - }), t.stopOnInteraction || O.add(j, "mouseleave", () => { + }), t.stopOnInteraction || P.add(q, "mouseleave", () => { o = !0, d(); - })), t.stopOnFocusIn && (O.add(te, "focusin", c), t.stopOnInteraction || O.add(te, "focusout", d)), O.add(U, "visibilitychange", h), t.playOnInit && n.on("init", d).on("reInit", d); + })), t.stopOnFocusIn && (P.add(ee, "focusin", c), t.stopOnInteraction || P.add(ee, "focusout", d)), P.add(M, "visibilitychange", _), t.playOnInit && n.on("init", d).on("reInit", d); } function f() { r = !0, i = !1, n.off("init", d).off("reInit", d).off("pointerDown", c).off("pointerUp", d), c(), cancelAnimationFrame(u), u = 0; @@ -8961,45 +8803,45 @@ function Pi(e = {}) { return; i || n.emit("autoplay:play"); const { - ownerWindow: w + ownerWindow: b } = n.internalEngine(); - w.clearInterval(s), s = w.setInterval(v, t.delay), i = !0; + b.clearInterval(s), s = b.setInterval(v, t.delay), i = !0; } function c() { if (r) return; i && n.emit("autoplay:stop"); const { - ownerWindow: w + ownerWindow: b } = n.internalEngine(); - w.clearInterval(s), s = 0, i = !1; + b.clearInterval(s), s = 0, i = !1; } - function h() { + function _() { const { - ownerDocument: w + ownerDocument: b } = n.internalEngine(); - if (w.visibilityState === "hidden") + if (b.visibilityState === "hidden") return o = i, c(); o && d(); } - function _(w) { - typeof w < "u" && (l = w), o = !0, d(); + function h(b) { + typeof b < "u" && (l = b), o = !0, d(); } - function m() { + function p() { i && c(); } function g() { - i && _(); + i && h(); } - function p() { + function m() { return i; } function v() { u = requestAnimationFrame(() => { const { - index: w - } = n.internalEngine(), y = w.clone().add(1).get(), S = n.scrollSnapList().length - 1; - t.stopOnLastSnap && y === S && c(), n.canScrollNext() ? n.scrollNext(l) : n.scrollTo(0, l); + index: b + } = n.internalEngine(), y = b.clone().add(1).get(), k = n.scrollSnapList().length - 1; + t.stopOnLastSnap && y === k && c(), n.canScrollNext() ? n.scrollNext(l) : n.scrollTo(0, l); }); } return { @@ -9007,68 +8849,62 @@ function Pi(e = {}) { options: e, init: a, destroy: f, - play: _, - stop: m, + play: h, + stop: p, reset: g, - isPlaying: p + isPlaying: m }; } -Pi.globalOptions = void 0; -async function $_(e) { - return e ? `