diff --git "a/src/backend/gradio_molecule3d/templates/component/index.js" "b/src/backend/gradio_molecule3d/templates/component/index.js" --- "a/src/backend/gradio_molecule3d/templates/component/index.js" +++ "b/src/backend/gradio_molecule3d/templates/component/index.js" @@ -17,82 +17,82 @@ const Block_svelte_svelte_type_style_lang = "", { transition_out: transition_out$b, update_slot_base: update_slot_base$4 } = window.__gradio__svelte__internal; -function create_dynamic_element(r) { - let e, t, n; +function create_dynamic_element(t) { + let e, r, n; const f = ( /*#slots*/ - r[17].default + t[17].default ), u = create_slot$4( f, - r, + t, /*$$scope*/ - r[16], + t[16], null ); - let y = [ + let b = [ { "data-testid": ( /*test_id*/ - r[7] + t[7] ) }, { id: ( /*elem_id*/ - r[2] + t[2] ) }, { - class: t = "block " + /*elem_classes*/ - r[3].join(" ") + " svelte-1t38q2d" + class: r = "block " + /*elem_classes*/ + t[3].join(" ") + " svelte-1t38q2d" } ], h = {}; - for (let _ = 0; _ < y.length; _ += 1) - h = assign$1(h, y[_]); + for (let _ = 0; _ < b.length; _ += 1) + h = assign$1(h, b[_]); return { c() { e = element$d( /*tag*/ - r[14] + t[14] ), u && u.c(), set_dynamic_element_data( /*tag*/ - r[14] + t[14] )(e, h), toggle_class$b( e, "hidden", /*visible*/ - r[10] === !1 + t[10] === !1 ), toggle_class$b( e, "padded", /*padding*/ - r[6] + t[6] ), toggle_class$b( e, "border_focus", /*border_mode*/ - r[5] === "focus" + t[5] === "focus" ), toggle_class$b(e, "hide-container", !/*explicit_call*/ - r[8] && !/*container*/ - r[9]), set_style$6(e, "height", typeof /*height*/ - r[0] == "number" ? ( + t[8] && !/*container*/ + t[9]), set_style$6(e, "height", typeof /*height*/ + t[0] == "number" ? ( /*height*/ - r[0] + "px" + t[0] + "px" ) : void 0), set_style$6(e, "width", typeof /*width*/ - r[1] == "number" ? `calc(min(${/*width*/ - r[1]}px, 100%))` : void 0), set_style$6( + t[1] == "number" ? `calc(min(${/*width*/ + t[1]}px, 100%))` : void 0), set_style$6( e, "border-style", /*variant*/ - r[4] + t[4] ), set_style$6( e, "overflow", /*allow_overflow*/ - r[11] ? "visible" : "hidden" + t[11] ? "visible" : "hidden" ), set_style$6( e, "flex-grow", /*scale*/ - r[12] + t[12] ), set_style$6(e, "min-width", `calc(min(${/*min_width*/ - r[13]}px, 100%))`), set_style$6(e, "border-width", "var(--block-border-width)"); + t[13]}px, 100%))`), set_style$6(e, "border-width", "var(--block-border-width)"); }, m(_, E) { insert$l(_, e, E), u && u.m(e, null), n = !0; @@ -119,7 +119,7 @@ function create_dynamic_element(r) { ), set_dynamic_element_data( /*tag*/ _[14] - )(e, h = get_spread_update$1(y, [ + )(e, h = get_spread_update$1(b, [ (!n || E & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -131,8 +131,8 @@ function create_dynamic_element(r) { _[2] ) }, (!n || E & /*elem_classes*/ - 8 && t !== (t = "block " + /*elem_classes*/ - _[3].join(" ") + " svelte-1t38q2d")) && { class: t } + 8 && r !== (r = "block " + /*elem_classes*/ + _[3].join(" ") + " svelte-1t38q2d")) && { class: r } ])), toggle_class$b( e, "hidden", @@ -191,54 +191,54 @@ function create_dynamic_element(r) { } }; } -function create_fragment$l(r) { - let e, t = ( +function create_fragment$l(t) { + let e, r = ( /*tag*/ - r[14] && create_dynamic_element(r) + t[14] && create_dynamic_element(t) ); return { c() { - t && t.c(); + r && r.c(); }, m(n, f) { - t && t.m(n, f), e = !0; + r && r.m(n, f), e = !0; }, p(n, [f]) { /*tag*/ - n[14] && t.p(n, f); + n[14] && r.p(n, f); }, i(n) { - e || (transition_in$c(t, n), e = !0); + e || (transition_in$c(r, n), e = !0); }, o(n) { - transition_out$b(t, n), e = !1; + transition_out$b(r, n), e = !1; }, d(n) { - t && t.d(n); + r && r.d(n); } }; } -function instance$f(r, e, t) { - let { $$slots: n = {}, $$scope: f } = e, { height: u = void 0 } = e, { width: y = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: _ = [] } = e, { variant: E = "solid" } = e, { border_mode: c = "base" } = e, { padding: C = !0 } = e, { type: b = "normal" } = e, { test_id: A = void 0 } = e, { explicit_call: S = !1 } = e, { container: s = !0 } = e, { visible: o = !0 } = e, { allow_overflow: w = !0 } = e, { scale: p = null } = e, { min_width: v = 0 } = e, a = b === "fieldset" ? "fieldset" : "div"; - return r.$$set = (l) => { - "height" in l && t(0, u = l.height), "width" in l && t(1, y = l.width), "elem_id" in l && t(2, h = l.elem_id), "elem_classes" in l && t(3, _ = l.elem_classes), "variant" in l && t(4, E = l.variant), "border_mode" in l && t(5, c = l.border_mode), "padding" in l && t(6, C = l.padding), "type" in l && t(15, b = l.type), "test_id" in l && t(7, A = l.test_id), "explicit_call" in l && t(8, S = l.explicit_call), "container" in l && t(9, s = l.container), "visible" in l && t(10, o = l.visible), "allow_overflow" in l && t(11, w = l.allow_overflow), "scale" in l && t(12, p = l.scale), "min_width" in l && t(13, v = l.min_width), "$$scope" in l && t(16, f = l.$$scope); +function instance$f(t, e, r) { + let { $$slots: n = {}, $$scope: f } = e, { height: u = void 0 } = e, { width: b = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: _ = [] } = e, { variant: E = "solid" } = e, { border_mode: c = "base" } = e, { padding: S = !0 } = e, { type: y = "normal" } = e, { test_id: w = void 0 } = e, { explicit_call: L = !1 } = e, { container: s = !0 } = e, { visible: o = !0 } = e, { allow_overflow: A = !0 } = e, { scale: p = null } = e, { min_width: v = 0 } = e, a = y === "fieldset" ? "fieldset" : "div"; + return t.$$set = (l) => { + "height" in l && r(0, u = l.height), "width" in l && r(1, b = l.width), "elem_id" in l && r(2, h = l.elem_id), "elem_classes" in l && r(3, _ = l.elem_classes), "variant" in l && r(4, E = l.variant), "border_mode" in l && r(5, c = l.border_mode), "padding" in l && r(6, S = l.padding), "type" in l && r(15, y = l.type), "test_id" in l && r(7, w = l.test_id), "explicit_call" in l && r(8, L = l.explicit_call), "container" in l && r(9, s = l.container), "visible" in l && r(10, o = l.visible), "allow_overflow" in l && r(11, A = l.allow_overflow), "scale" in l && r(12, p = l.scale), "min_width" in l && r(13, v = l.min_width), "$$scope" in l && r(16, f = l.$$scope); }, [ u, - y, + b, h, _, E, c, - C, - A, S, + w, + L, s, o, - w, + A, p, v, a, - b, + y, f, n ]; @@ -283,48 +283,48 @@ const Info_svelte_svelte_type_style_lang = "", BlockTitle_svelte_svelte_type_sty transition_in: transition_in$b, transition_out: transition_out$a } = window.__gradio__svelte__internal; -function create_fragment$k(r) { - let e, t, n, f, u, y; +function create_fragment$k(t) { + let e, r, n, f, u, b; return n = new /*Icon*/ - r[1]({}), { + t[1]({}), { c() { - e = element$c("label"), t = element$c("span"), create_component$8(n.$$.fragment), f = space$b(), u = text$7( + e = element$c("label"), r = element$c("span"), create_component$8(n.$$.fragment), f = space$b(), u = text$7( /*label*/ - r[0] - ), attr$i(t, "class", "svelte-9gxdi0"), attr$i(e, "for", ""), attr$i(e, "data-testid", "block-label"), attr$i(e, "class", "svelte-9gxdi0"), toggle_class$a(e, "hide", !/*show_label*/ - r[2]), toggle_class$a(e, "sr-only", !/*show_label*/ - r[2]), toggle_class$a( + t[0] + ), attr$i(r, "class", "svelte-9gxdi0"), attr$i(e, "for", ""), attr$i(e, "data-testid", "block-label"), attr$i(e, "class", "svelte-9gxdi0"), toggle_class$a(e, "hide", !/*show_label*/ + t[2]), toggle_class$a(e, "sr-only", !/*show_label*/ + t[2]), toggle_class$a( e, "float", /*float*/ - r[4] + t[4] ), toggle_class$a( e, "hide-label", /*disable*/ - r[3] + t[3] ); }, m(h, _) { - insert$k(h, e, _), append$i(e, t), mount_component$8(n, t, null), append$i(e, f), append$i(e, u), y = !0; + insert$k(h, e, _), append$i(e, r), mount_component$8(n, r, null), append$i(e, f), append$i(e, u), b = !0; }, p(h, [_]) { - (!y || _ & /*label*/ + (!b || _ & /*label*/ 1) && set_data$7( u, /*label*/ h[0] - ), (!y || _ & /*show_label*/ + ), (!b || _ & /*show_label*/ 4) && toggle_class$a(e, "hide", !/*show_label*/ - h[2]), (!y || _ & /*show_label*/ + h[2]), (!b || _ & /*show_label*/ 4) && toggle_class$a(e, "sr-only", !/*show_label*/ - h[2]), (!y || _ & /*float*/ + h[2]), (!b || _ & /*float*/ 16) && toggle_class$a( e, "float", /*float*/ h[4] - ), (!y || _ & /*disable*/ + ), (!b || _ & /*disable*/ 8) && toggle_class$a( e, "hide-label", @@ -333,21 +333,21 @@ function create_fragment$k(r) { ); }, i(h) { - y || (transition_in$b(n.$$.fragment, h), y = !0); + b || (transition_in$b(n.$$.fragment, h), b = !0); }, o(h) { - transition_out$a(n.$$.fragment, h), y = !1; + transition_out$a(n.$$.fragment, h), b = !1; }, d(h) { h && detach$k(e), destroy_component$8(n); } }; } -function instance$e(r, e, t) { - let { label: n = null } = e, { Icon: f } = e, { show_label: u = !0 } = e, { disable: y = !1 } = e, { float: h = !0 } = e; - return r.$$set = (_) => { - "label" in _ && t(0, n = _.label), "Icon" in _ && t(1, f = _.Icon), "show_label" in _ && t(2, u = _.show_label), "disable" in _ && t(3, y = _.disable), "float" in _ && t(4, h = _.float); - }, [n, f, u, y, h]; +function instance$e(t, e, r) { + let { label: n = null } = e, { Icon: f } = e, { show_label: u = !0 } = e, { disable: b = !1 } = e, { float: h = !0 } = e; + return t.$$set = (_) => { + "label" in _ && r(0, n = _.label), "Icon" in _ && r(1, f = _.Icon), "show_label" in _ && r(2, u = _.show_label), "disable" in _ && r(3, b = _.disable), "float" in _ && r(4, h = _.float); + }, [n, f, u, b, h]; } class BlockLabel extends SvelteComponent$k { constructor(e) { @@ -381,22 +381,22 @@ const IconButton_svelte_svelte_type_style_lang = "", { transition_in: transition_in$a, transition_out: transition_out$9 } = window.__gradio__svelte__internal; -function create_if_block$9(r) { - let e, t; +function create_if_block$9(t) { + let e, r; return { c() { - e = element$b("span"), t = text$6( + e = element$b("span"), r = text$6( /*label*/ - r[1] + t[1] ), attr$h(e, "class", "svelte-xtz2g8"); }, m(n, f) { - insert$j(n, e, f), append$h(e, t); + insert$j(n, e, f), append$h(e, r); }, p(n, f) { f & /*label*/ 2 && set_data$6( - t, + r, /*label*/ n[1] ); @@ -406,57 +406,57 @@ function create_if_block$9(r) { } }; } -function create_fragment$j(r) { - let e, t, n, f, u, y, h, _ = ( +function create_fragment$j(t) { + let e, r, n, f, u, b, h, _ = ( /*show_label*/ - r[2] && create_if_block$9(r) + t[2] && create_if_block$9(t) ); return f = new /*Icon*/ - r[0]({}), { + t[0]({}), { c() { - e = element$b("button"), _ && _.c(), t = space$a(), n = element$b("div"), create_component$7(f.$$.fragment), attr$h(n, "class", "svelte-xtz2g8"), toggle_class$9( + e = element$b("button"), _ && _.c(), r = space$a(), n = element$b("div"), create_component$7(f.$$.fragment), attr$h(n, "class", "svelte-xtz2g8"), toggle_class$9( n, "small", /*size*/ - r[4] === "small" + t[4] === "small" ), toggle_class$9( n, "large", /*size*/ - r[4] === "large" + t[4] === "large" ), attr$h( e, "aria-label", /*label*/ - r[1] + t[1] ), attr$h( e, "title", /*label*/ - r[1] + t[1] ), attr$h(e, "class", "svelte-xtz2g8"), toggle_class$9( e, "pending", /*pending*/ - r[3] + t[3] ), toggle_class$9( e, "padded", /*padded*/ - r[5] + t[5] ); }, m(E, c) { - insert$j(E, e, c), _ && _.m(e, null), append$h(e, t), append$h(e, n), mount_component$7(f, n, null), u = !0, y || (h = listen$4( + insert$j(E, e, c), _ && _.m(e, null), append$h(e, r), append$h(e, n), mount_component$7(f, n, null), u = !0, b || (h = listen$4( e, "click", /*click_handler*/ - r[6] - ), y = !0); + t[6] + ), b = !0); }, p(E, [c]) { /*show_label*/ - E[2] ? _ ? _.p(E, c) : (_ = create_if_block$9(E), _.c(), _.m(e, t)) : _ && (_.d(1), _ = null), (!u || c & /*size*/ + E[2] ? _ ? _.p(E, c) : (_ = create_if_block$9(E), _.c(), _.m(e, r)) : _ && (_.d(1), _ = null), (!u || c & /*size*/ 16) && toggle_class$9( n, "small", @@ -501,18 +501,18 @@ function create_fragment$j(r) { transition_out$9(f.$$.fragment, E), u = !1; }, d(E) { - E && detach$j(e), _ && _.d(), destroy_component$7(f), y = !1, h(); + E && detach$j(e), _ && _.d(), destroy_component$7(f), b = !1, h(); } }; } -function instance$d(r, e, t) { - let { Icon: n } = e, { label: f = "" } = e, { show_label: u = !1 } = e, { pending: y = !1 } = e, { size: h = "small" } = e, { padded: _ = !0 } = e; +function instance$d(t, e, r) { + let { Icon: n } = e, { label: f = "" } = e, { show_label: u = !1 } = e, { pending: b = !1 } = e, { size: h = "small" } = e, { padded: _ = !0 } = e; function E(c) { - bubble$3.call(this, r, c); + bubble$3.call(this, t, c); } - return r.$$set = (c) => { - "Icon" in c && t(0, n = c.Icon), "label" in c && t(1, f = c.label), "show_label" in c && t(2, u = c.show_label), "pending" in c && t(3, y = c.pending), "size" in c && t(4, h = c.size), "padded" in c && t(5, _ = c.padded); - }, [n, f, u, y, h, _, E]; + return t.$$set = (c) => { + "Icon" in c && r(0, n = c.Icon), "label" in c && r(1, f = c.label), "show_label" in c && r(2, u = c.show_label), "pending" in c && r(3, b = c.pending), "size" in c && r(4, h = c.size), "padded" in c && r(5, _ = c.padded); + }, [n, f, u, b, h, _, E]; } class IconButton extends SvelteComponent$j { constructor(e) { @@ -544,62 +544,62 @@ const Empty_svelte_svelte_type_style_lang = "", { transition_out: transition_out$8, update_slot_base: update_slot_base$3 } = window.__gradio__svelte__internal; -function create_fragment$i(r) { - let e, t, n; +function create_fragment$i(t) { + let e, r, n; const f = ( /*#slots*/ - r[5].default + t[5].default ), u = create_slot$3( f, - r, + t, /*$$scope*/ - r[4], + t[4], null ); return { c() { - e = element$a("div"), t = element$a("div"), u && u.c(), attr$g(t, "class", "icon svelte-3w3rth"), attr$g(e, "class", "empty svelte-3w3rth"), attr$g(e, "aria-label", "Empty value"), toggle_class$8( + e = element$a("div"), r = element$a("div"), u && u.c(), attr$g(r, "class", "icon svelte-3w3rth"), attr$g(e, "class", "empty svelte-3w3rth"), attr$g(e, "aria-label", "Empty value"), toggle_class$8( e, "small", /*size*/ - r[0] === "small" + t[0] === "small" ), toggle_class$8( e, "large", /*size*/ - r[0] === "large" + t[0] === "large" ), toggle_class$8( e, "unpadded_box", /*unpadded_box*/ - r[1] + t[1] ), toggle_class$8( e, "small_parent", /*parent_height*/ - r[3] + t[3] ); }, - m(y, h) { - insert$i(y, e, h), append$g(e, t), u && u.m(t, null), r[6](e), n = !0; + m(b, h) { + insert$i(b, e, h), append$g(e, r), u && u.m(r, null), t[6](e), n = !0; }, - p(y, [h]) { + p(b, [h]) { u && u.p && (!n || h & /*$$scope*/ 16) && update_slot_base$3( u, f, - y, + b, /*$$scope*/ - y[4], + b[4], n ? get_slot_changes$3( f, /*$$scope*/ - y[4], + b[4], h, null ) : get_all_dirty_from_scope$3( /*$$scope*/ - y[4] + b[4] ), null ), (!n || h & /*size*/ @@ -607,75 +607,75 @@ function create_fragment$i(r) { e, "small", /*size*/ - y[0] === "small" + b[0] === "small" ), (!n || h & /*size*/ 1) && toggle_class$8( e, "large", /*size*/ - y[0] === "large" + b[0] === "large" ), (!n || h & /*unpadded_box*/ 2) && toggle_class$8( e, "unpadded_box", /*unpadded_box*/ - y[1] + b[1] ), (!n || h & /*parent_height*/ 8) && toggle_class$8( e, "small_parent", /*parent_height*/ - y[3] + b[3] ); }, - i(y) { - n || (transition_in$9(u, y), n = !0); + i(b) { + n || (transition_in$9(u, b), n = !0); }, - o(y) { - transition_out$8(u, y), n = !1; + o(b) { + transition_out$8(u, b), n = !1; }, - d(y) { - y && detach$i(e), u && u.d(y), r[6](null); + d(b) { + b && detach$i(e), u && u.d(b), t[6](null); } }; } -function _optionalChain$1(r) { - let e, t = r[0], n = 1; - for (; n < r.length; ) { - const f = r[n], u = r[n + 1]; - if (n += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) +function _optionalChain$1(t) { + let e, r = t[0], n = 1; + for (; n < t.length; ) { + const f = t[n], u = t[n + 1]; + if (n += 2, (f === "optionalAccess" || f === "optionalCall") && r == null) return; - f === "access" || f === "optionalAccess" ? (e = t, t = u(t)) : (f === "call" || f === "optionalCall") && (t = u((...y) => t.call(e, ...y)), e = void 0); + f === "access" || f === "optionalAccess" ? (e = r, r = u(r)) : (f === "call" || f === "optionalCall") && (r = u((...b) => r.call(e, ...b)), e = void 0); } - return t; + return r; } -function instance$c(r, e, t) { - let n, { $$slots: f = {}, $$scope: u } = e, { size: y = "small" } = e, { unpadded_box: h = !1 } = e, _; - function E(C) { - if (!C) +function instance$c(t, e, r) { + let n, { $$slots: f = {}, $$scope: u } = e, { size: b = "small" } = e, { unpadded_box: h = !1 } = e, _; + function E(S) { + if (!S) return !1; - const { height: b } = C.getBoundingClientRect(), { height: A } = _optionalChain$1([ - C, + const { height: y } = S.getBoundingClientRect(), { height: w } = _optionalChain$1([ + S, "access", - (S) => S.parentElement, + (L) => L.parentElement, "optionalAccess", - (S) => S.getBoundingClientRect, + (L) => L.getBoundingClientRect, "call", - (S) => S() - ]) || { height: b }; - return b > A + 2; + (L) => L() + ]) || { height: y }; + return y > w + 2; } - function c(C) { - binding_callbacks$4[C ? "unshift" : "push"](() => { - _ = C, t(2, _); + function c(S) { + binding_callbacks$4[S ? "unshift" : "push"](() => { + _ = S, r(2, _); }); } - return r.$$set = (C) => { - "size" in C && t(0, y = C.size), "unpadded_box" in C && t(1, h = C.unpadded_box), "$$scope" in C && t(4, u = C.$$scope); - }, r.$$.update = () => { - r.$$.dirty & /*el*/ - 4 && t(3, n = E(_)); - }, [y, h, _, n, u, f, c]; + return t.$$set = (S) => { + "size" in S && r(0, b = S.size), "unpadded_box" in S && r(1, h = S.unpadded_box), "$$scope" in S && r(4, u = S.$$scope); + }, t.$$.update = () => { + t.$$.dirty & /*el*/ + 4 && r(3, n = E(_)); + }, [b, h, _, n, u, f, c]; } class Empty extends SvelteComponent$i { constructor(e) { @@ -694,14 +694,14 @@ const { set_style: set_style$5, svg_element: svg_element$8 } = window.__gradio__svelte__internal; -function create_fragment$h(r) { - let e, t, n, f; +function create_fragment$h(t) { + let e, r, n, f; return { c() { - e = svg_element$8("svg"), t = svg_element$8("g"), n = svg_element$8("path"), f = svg_element$8("path"), attr$f(n, "d", "M18,6L6.087,17.913"), set_style$5(n, "fill", "none"), set_style$5(n, "fill-rule", "nonzero"), set_style$5(n, "stroke-width", "2px"), attr$f(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$f(f, "d", "M4.364,4.364L19.636,19.636"), set_style$5(f, "fill", "none"), set_style$5(f, "fill-rule", "nonzero"), set_style$5(f, "stroke-width", "2px"), attr$f(e, "width", "100%"), attr$f(e, "height", "100%"), attr$f(e, "viewBox", "0 0 24 24"), attr$f(e, "version", "1.1"), attr$f(e, "xmlns", "http://www.w3.org/2000/svg"), attr$f(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$f(e, "xml:space", "preserve"), attr$f(e, "stroke", "currentColor"), set_style$5(e, "fill-rule", "evenodd"), set_style$5(e, "clip-rule", "evenodd"), set_style$5(e, "stroke-linecap", "round"), set_style$5(e, "stroke-linejoin", "round"); + e = svg_element$8("svg"), r = svg_element$8("g"), n = svg_element$8("path"), f = svg_element$8("path"), attr$f(n, "d", "M18,6L6.087,17.913"), set_style$5(n, "fill", "none"), set_style$5(n, "fill-rule", "nonzero"), set_style$5(n, "stroke-width", "2px"), attr$f(r, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$f(f, "d", "M4.364,4.364L19.636,19.636"), set_style$5(f, "fill", "none"), set_style$5(f, "fill-rule", "nonzero"), set_style$5(f, "stroke-width", "2px"), attr$f(e, "width", "100%"), attr$f(e, "height", "100%"), attr$f(e, "viewBox", "0 0 24 24"), attr$f(e, "version", "1.1"), attr$f(e, "xmlns", "http://www.w3.org/2000/svg"), attr$f(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$f(e, "xml:space", "preserve"), attr$f(e, "stroke", "currentColor"), set_style$5(e, "fill-rule", "evenodd"), set_style$5(e, "clip-rule", "evenodd"), set_style$5(e, "stroke-linecap", "round"), set_style$5(e, "stroke-linejoin", "round"); }, - m(u, y) { - insert$h(u, e, y), append$f(e, t), append$f(t, n), append$f(e, f); + m(u, b) { + insert$h(u, e, b), append$f(e, r), append$f(r, n), append$f(e, f); }, p: noop$c, i: noop$c, @@ -727,14 +727,14 @@ const DropdownArrow_svelte_svelte_type_style_lang = "", { safe_not_equal: safe_not_equal$h, svg_element: svg_element$7 } = window.__gradio__svelte__internal; -function create_fragment$g(r) { - let e, t; +function create_fragment$g(t) { + let e, r; return { c() { - e = svg_element$7("svg"), t = svg_element$7("path"), attr$e(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), attr$e(e, "xmlns", "http://www.w3.org/2000/svg"), attr$e(e, "width", "100%"), attr$e(e, "height", "100%"), attr$e(e, "viewBox", "0 0 24 24"), attr$e(e, "fill", "none"), attr$e(e, "stroke", "currentColor"), attr$e(e, "stroke-width", "1.5"), attr$e(e, "stroke-linecap", "round"), attr$e(e, "stroke-linejoin", "round"), attr$e(e, "class", "feather feather-edit-2"); + e = svg_element$7("svg"), r = svg_element$7("path"), attr$e(r, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), attr$e(e, "xmlns", "http://www.w3.org/2000/svg"), attr$e(e, "width", "100%"), attr$e(e, "height", "100%"), attr$e(e, "viewBox", "0 0 24 24"), attr$e(e, "fill", "none"), attr$e(e, "stroke", "currentColor"), attr$e(e, "stroke-width", "1.5"), attr$e(e, "stroke-linecap", "round"), attr$e(e, "stroke-linejoin", "round"), attr$e(e, "class", "feather feather-edit-2"); }, m(n, f) { - insert$g(n, e, f), append$e(e, t); + insert$g(n, e, f), append$e(e, r); }, p: noop$b, i: noop$b, @@ -760,14 +760,14 @@ const { safe_not_equal: safe_not_equal$g, svg_element: svg_element$6 } = window.__gradio__svelte__internal; -function create_fragment$f(r) { - let e, t, n; +function create_fragment$f(t) { + let e, r, n; return { c() { - e = svg_element$6("svg"), t = svg_element$6("path"), n = svg_element$6("polyline"), attr$d(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$d(n, "points", "13 2 13 9 20 9"), attr$d(e, "xmlns", "http://www.w3.org/2000/svg"), attr$d(e, "width", "100%"), attr$d(e, "height", "100%"), attr$d(e, "viewBox", "0 0 24 24"), attr$d(e, "fill", "none"), attr$d(e, "stroke", "currentColor"), attr$d(e, "stroke-width", "1.5"), attr$d(e, "stroke-linecap", "round"), attr$d(e, "stroke-linejoin", "round"), attr$d(e, "class", "feather feather-file"); + e = svg_element$6("svg"), r = svg_element$6("path"), n = svg_element$6("polyline"), attr$d(r, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$d(n, "points", "13 2 13 9 20 9"), attr$d(e, "xmlns", "http://www.w3.org/2000/svg"), attr$d(e, "width", "100%"), attr$d(e, "height", "100%"), attr$d(e, "viewBox", "0 0 24 24"), attr$d(e, "fill", "none"), attr$d(e, "stroke", "currentColor"), attr$d(e, "stroke-width", "1.5"), attr$d(e, "stroke-linecap", "round"), attr$d(e, "stroke-linejoin", "round"), attr$d(e, "class", "feather feather-file"); }, m(f, u) { - insert$f(f, e, u), append$d(e, t), append$d(e, n); + insert$f(f, e, u), append$d(e, r), append$d(e, n); }, p: noop$a, i: noop$a, @@ -793,14 +793,14 @@ const { safe_not_equal: safe_not_equal$f, svg_element: svg_element$5 } = window.__gradio__svelte__internal; -function create_fragment$e(r) { - let e, t, n; +function create_fragment$e(t) { + let e, r, n; return { c() { - e = svg_element$5("svg"), t = svg_element$5("polyline"), n = svg_element$5("path"), attr$c(t, "points", "1 4 1 10 7 10"), attr$c(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$c(e, "xmlns", "http://www.w3.org/2000/svg"), attr$c(e, "width", "100%"), attr$c(e, "height", "100%"), attr$c(e, "viewBox", "0 0 24 24"), attr$c(e, "fill", "none"), attr$c(e, "stroke", "currentColor"), attr$c(e, "stroke-width", "2"), attr$c(e, "stroke-linecap", "round"), attr$c(e, "stroke-linejoin", "round"), attr$c(e, "class", "feather feather-rotate-ccw"); + e = svg_element$5("svg"), r = svg_element$5("polyline"), n = svg_element$5("path"), attr$c(r, "points", "1 4 1 10 7 10"), attr$c(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$c(e, "xmlns", "http://www.w3.org/2000/svg"), attr$c(e, "width", "100%"), attr$c(e, "height", "100%"), attr$c(e, "viewBox", "0 0 24 24"), attr$c(e, "fill", "none"), attr$c(e, "stroke", "currentColor"), attr$c(e, "stroke-width", "2"), attr$c(e, "stroke-linecap", "round"), attr$c(e, "stroke-linejoin", "round"), attr$c(e, "class", "feather feather-rotate-ccw"); }, m(f, u) { - insert$e(f, e, u), append$c(e, t), append$c(e, n); + insert$e(f, e, u), append$c(e, r), append$c(e, n); }, p: noop$9, i: noop$9, @@ -826,14 +826,14 @@ const { safe_not_equal: safe_not_equal$e, svg_element: svg_element$4 } = window.__gradio__svelte__internal; -function create_fragment$d(r) { - let e, t, n, f; +function create_fragment$d(t) { + let e, r, n, f; return { c() { - e = svg_element$4("svg"), t = svg_element$4("path"), n = svg_element$4("polyline"), f = svg_element$4("line"), attr$b(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$b(n, "points", "17 8 12 3 7 8"), attr$b(f, "x1", "12"), attr$b(f, "y1", "3"), attr$b(f, "x2", "12"), attr$b(f, "y2", "15"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "width", "90%"), attr$b(e, "height", "90%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "fill", "none"), attr$b(e, "stroke", "currentColor"), attr$b(e, "stroke-width", "2"), attr$b(e, "stroke-linecap", "round"), attr$b(e, "stroke-linejoin", "round"), attr$b(e, "class", "feather feather-upload"); + e = svg_element$4("svg"), r = svg_element$4("path"), n = svg_element$4("polyline"), f = svg_element$4("line"), attr$b(r, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$b(n, "points", "17 8 12 3 7 8"), attr$b(f, "x1", "12"), attr$b(f, "y1", "3"), attr$b(f, "x2", "12"), attr$b(f, "y2", "15"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "width", "90%"), attr$b(e, "height", "90%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "fill", "none"), attr$b(e, "stroke", "currentColor"), attr$b(e, "stroke-width", "2"), attr$b(e, "stroke-linecap", "round"), attr$b(e, "stroke-linejoin", "round"), attr$b(e, "class", "feather feather-upload"); }, - m(u, y) { - insert$d(u, e, y), append$b(e, t), append$b(e, n), append$b(e, f); + m(u, b) { + insert$d(u, e, b), append$b(e, r), append$b(e, n), append$b(e, f); }, p: noop$8, i: noop$8, @@ -1153,10 +1153,10 @@ const color_values = [ } }; color_values.reduce( - (r, { color: e, primary: t, secondary: n }) => ({ - ...r, + (t, { color: e, primary: r, secondary: n }) => ({ + ...t, [e]: { - primary: tw_colors[e][t], + primary: tw_colors[e][r], secondary: tw_colors[e][n] } }), @@ -1181,21 +1181,21 @@ const UploadText_svelte_svelte_type_style_lang = "", { transition_in: transition_in$8, transition_out: transition_out$7 } = window.__gradio__svelte__internal; -function create_if_block$8(r) { - let e, t, n = ( +function create_if_block$8(t) { + let e, r, n = ( /*i18n*/ - r[1]("common.or") + "" - ), f, u, y, h = ( + t[1]("common.or") + "" + ), f, u, b, h = ( /*message*/ - (r[2] || /*i18n*/ - r[1]("upload_text.click_to_upload")) + "" + (t[2] || /*i18n*/ + t[1]("upload_text.click_to_upload")) + "" ), _; return { c() { - e = element$9("span"), t = text$5("- "), f = text$5(n), u = text$5(" -"), y = space$9(), _ = text$5(h), attr$a(e, "class", "or svelte-kzcjhc"); + e = element$9("span"), r = text$5("- "), f = text$5(n), u = text$5(" -"), b = space$9(), _ = text$5(h), attr$a(e, "class", "or svelte-kzcjhc"); }, m(E, c) { - insert$c(E, e, c), append$a(e, t), append$a(e, f), append$a(e, u), insert$c(E, y, c), insert$c(E, _, c); + insert$c(E, e, c), append$a(e, r), append$a(e, f), append$a(e, u), insert$c(E, b, c), insert$c(E, _, c); }, p(E, c) { c & /*i18n*/ @@ -1206,47 +1206,47 @@ function create_if_block$8(r) { E[1]("upload_text.click_to_upload")) + "") && set_data$5(_, h); }, d(E) { - E && (detach$c(e), detach$c(y), detach$c(_)); + E && (detach$c(e), detach$c(b), detach$c(_)); } }; } -function create_fragment$c(r) { - let e, t, n, f, u = ( +function create_fragment$c(t) { + let e, r, n, f, u = ( /*i18n*/ - r[1]( + t[1]( /*defs*/ - r[5][ + t[5][ /*type*/ - r[0] + t[0] ] || /*defs*/ - r[5].file + t[5].file ) + "" - ), y, h, _; + ), b, h, _; n = new Upload$1({}); let E = ( /*mode*/ - r[3] !== "short" && create_if_block$8(r) + t[3] !== "short" && create_if_block$8(t) ); return { c() { - e = element$9("div"), t = element$9("span"), create_component$6(n.$$.fragment), f = space$9(), y = text$5(u), h = space$9(), E && E.c(), attr$a(t, "class", "icon-wrap svelte-kzcjhc"), toggle_class$7( - t, + e = element$9("div"), r = element$9("span"), create_component$6(n.$$.fragment), f = space$9(), b = text$5(u), h = space$9(), E && E.c(), attr$a(r, "class", "icon-wrap svelte-kzcjhc"), toggle_class$7( + r, "hovered", /*hovered*/ - r[4] + t[4] ), attr$a(e, "class", "wrap svelte-kzcjhc"); }, - m(c, C) { - insert$c(c, e, C), append$a(e, t), mount_component$6(n, t, null), append$a(e, f), append$a(e, y), append$a(e, h), E && E.m(e, null), _ = !0; + m(c, S) { + insert$c(c, e, S), append$a(e, r), mount_component$6(n, r, null), append$a(e, f), append$a(e, b), append$a(e, h), E && E.m(e, null), _ = !0; }, - p(c, [C]) { - (!_ || C & /*hovered*/ + p(c, [S]) { + (!_ || S & /*hovered*/ 16) && toggle_class$7( - t, + r, "hovered", /*hovered*/ c[4] - ), (!_ || C & /*i18n, type*/ + ), (!_ || S & /*i18n, type*/ 3) && u !== (u = /*i18n*/ c[1]( /*defs*/ @@ -1255,8 +1255,8 @@ function create_fragment$c(r) { c[0] ] || /*defs*/ c[5].file - ) + "") && set_data$5(y, u), /*mode*/ - c[3] !== "short" ? E ? E.p(c, C) : (E = create_if_block$8(c), E.c(), E.m(e, null)) : E && (E.d(1), E = null); + ) + "") && set_data$5(b, u), /*mode*/ + c[3] !== "short" ? E ? E.p(c, S) : (E = create_if_block$8(c), E.c(), E.m(e, null)) : E && (E.d(1), E = null); }, i(c) { _ || (transition_in$8(n.$$.fragment, c), _ = !0); @@ -1269,8 +1269,8 @@ function create_fragment$c(r) { } }; } -function instance$b(r, e, t) { - let { type: n = "file" } = e, { i18n: f } = e, { message: u = void 0 } = e, { mode: y = "full" } = e, { hovered: h = !1 } = e; +function instance$b(t, e, r) { + let { type: n = "file" } = e, { i18n: f } = e, { message: u = void 0 } = e, { mode: b = "full" } = e, { hovered: h = !1 } = e; const _ = { image: "upload_text.drop_image", video: "upload_text.drop_video", @@ -1278,9 +1278,9 @@ function instance$b(r, e, t) { file: "upload_text.drop_file", csv: "upload_text.drop_csv" }; - return r.$$set = (E) => { - "type" in E && t(0, n = E.type), "i18n" in E && t(1, f = E.i18n), "message" in E && t(2, u = E.message), "mode" in E && t(3, y = E.mode), "hovered" in E && t(4, h = E.hovered); - }, [n, f, u, y, h, _]; + return t.$$set = (E) => { + "type" in E && r(0, n = E.type), "i18n" in E && r(1, f = E.i18n), "message" in E && r(2, u = E.message), "mode" in E && r(3, b = E.mode), "hovered" in E && r(4, h = E.hovered); + }, [n, f, u, b, h, _]; } class UploadText extends SvelteComponent$c { constructor(e) { @@ -1293,18 +1293,18 @@ class UploadText extends SvelteComponent$c { }); } } -const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (r) => { - let e = ["B", "KB", "MB", "GB", "PB"], t = 0; - for (; r > 1024; ) - r /= 1024, t++; - let n = e[t]; - return r.toFixed(1) + " " + n; -}, display_file_name = (r) => { +const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (t) => { + let e = ["B", "KB", "MB", "GB", "PB"], r = 0; + for (; t > 1024; ) + t /= 1024, r++; + let n = e[r]; + return t.toFixed(1) + " " + n; +}, display_file_name = (t) => { var e; - e = r.orig_name; - const t = 30; - if (e.length > t) { - const n = e.substring(0, t), f = e.lastIndexOf("."); + e = t.orig_name; + const r = 30; + if (e.length > r) { + const n = e.substring(0, r), f = e.lastIndexOf("."); if (f !== -1) { const u = e.slice(f); return `${n}..${u}`; @@ -1312,13 +1312,13 @@ const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (r) => { return n; } return e; -}, display_file_size = (r) => { +}, display_file_size = (t) => { var e = 0; - if (Array.isArray(r)) - for (var t of r) - t.size !== void 0 && (e += t.size); + if (Array.isArray(t)) + for (var r of t) + r.size !== void 0 && (e += r.size); else - e = r.size || 0; + e = t.size || 0; return prettyBytes(e); }, FilePreview_svelte_svelte_type_style_lang = "", { HtmlTag, @@ -1340,164 +1340,164 @@ const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (r) => { text: text$4, toggle_class: toggle_class$6 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4 } = window.__gradio__svelte__internal; -function get_each_context$3(r, e, t) { - const n = r.slice(); - return n[6] = e[t], n[8] = t, n; +function get_each_context$3(t, e, r) { + const n = t.slice(); + return n[6] = e[r], n[8] = r, n; } -function create_else_block$6(r) { +function create_else_block$6(t) { let e = ( /*i18n*/ - r[3]("file.uploading") + "" - ), t; + t[3]("file.uploading") + "" + ), r; return { c() { - t = text$4(e); + r = text$4(e); }, m(n, f) { - insert$b(n, t, f); + insert$b(n, r, f); }, p(n, f) { f & /*i18n*/ 8 && e !== (e = /*i18n*/ - n[3]("file.uploading") + "") && set_data$4(t, e); + n[3]("file.uploading") + "") && set_data$4(r, e); }, d(n) { - n && detach$b(t); + n && detach$b(r); } }; } -function create_if_block$7(r) { - let e, t, n = display_file_size( +function create_if_block$7(t) { + let e, r, n = display_file_size( /*file*/ - r[6] - ) + "", f, u, y; + t[6] + ) + "", f, u, b; return { c() { - e = element$8("a"), t = new HtmlTag(!1), f = text$4(" ⇣"), t.a = f, attr$9(e, "href", u = /*file*/ - r[6].url), attr$9(e, "target", "_blank"), attr$9(e, "download", y = window.__is_colab__ ? null : ( + e = element$8("a"), r = new HtmlTag(!1), f = text$4(" ⇣"), r.a = f, attr$9(e, "href", u = /*file*/ + t[6].url), attr$9(e, "target", "_blank"), attr$9(e, "download", b = window.__is_colab__ ? null : ( /*file*/ - r[6].orig_name + t[6].orig_name )), attr$9(e, "class", "svelte-usqupg"); }, m(h, _) { - insert$b(h, e, _), t.m(n, e), append$9(e, f); + insert$b(h, e, _), r.m(n, e), append$9(e, f); }, p(h, _) { _ & /*value*/ 1 && n !== (n = display_file_size( /*file*/ h[6] - ) + "") && t.p(n), _ & /*value*/ + ) + "") && r.p(n), _ & /*value*/ 1 && u !== (u = /*file*/ h[6].url) && attr$9(e, "href", u), _ & /*value*/ - 1 && y !== (y = window.__is_colab__ ? null : ( + 1 && b !== (b = window.__is_colab__ ? null : ( /*file*/ h[6].orig_name - )) && attr$9(e, "download", y); + )) && attr$9(e, "download", b); }, d(h) { h && detach$b(e); } }; } -function create_each_block$3(r) { - let e, t, n = display_file_name( +function create_each_block$3(t) { + let e, r, n = display_file_name( /*file*/ - r[6] - ) + "", f, u, y, h, _, E; - function c(S, s) { + t[6] + ) + "", f, u, b, h, _, E; + function c(L, s) { return ( /*file*/ - S[6].url ? create_if_block$7 : create_else_block$6 + L[6].url ? create_if_block$7 : create_else_block$6 ); } - let C = c(r), b = C(r); - function A() { + let S = c(t), y = S(t); + function w() { return ( /*click_handler*/ - r[5]( + t[5]( /*file*/ - r[6], + t[6], /*i*/ - r[8] + t[8] ) ); } return { c() { - e = element$8("tr"), t = element$8("td"), f = text$4(n), u = space$8(), y = element$8("td"), b.c(), h = space$8(), attr$9(t, "class", "svelte-usqupg"), attr$9(y, "class", "download svelte-usqupg"), attr$9(e, "class", "file svelte-usqupg"), toggle_class$6( + e = element$8("tr"), r = element$8("td"), f = text$4(n), u = space$8(), b = element$8("td"), y.c(), h = space$8(), attr$9(r, "class", "svelte-usqupg"), attr$9(b, "class", "download svelte-usqupg"), attr$9(e, "class", "file svelte-usqupg"), toggle_class$6( e, "selectable", /*selectable*/ - r[1] + t[1] ); }, - m(S, s) { - insert$b(S, e, s), append$9(e, t), append$9(t, f), append$9(e, u), append$9(e, y), b.m(y, null), append$9(e, h), _ || (E = listen$3(e, "click", A), _ = !0); + m(L, s) { + insert$b(L, e, s), append$9(e, r), append$9(r, f), append$9(e, u), append$9(e, b), y.m(b, null), append$9(e, h), _ || (E = listen$3(e, "click", w), _ = !0); }, - p(S, s) { - r = S, s & /*value*/ + p(L, s) { + t = L, s & /*value*/ 1 && n !== (n = display_file_name( /*file*/ - r[6] - ) + "") && set_data$4(f, n), C === (C = c(r)) && b ? b.p(r, s) : (b.d(1), b = C(r), b && (b.c(), b.m(y, null))), s & /*selectable*/ + t[6] + ) + "") && set_data$4(f, n), S === (S = c(t)) && y ? y.p(t, s) : (y.d(1), y = S(t), y && (y.c(), y.m(b, null))), s & /*selectable*/ 2 && toggle_class$6( e, "selectable", /*selectable*/ - r[1] + t[1] ); }, - d(S) { - S && detach$b(e), b.d(), _ = !1, E(); + d(L) { + L && detach$b(e), y.d(), _ = !1, E(); } }; } -function create_fragment$b(r) { - let e, t, n, f = ensure_array_like$3(Array.isArray( +function create_fragment$b(t) { + let e, r, n, f = ensure_array_like$3(Array.isArray( /*value*/ - r[0] + t[0] ) ? ( /*value*/ - r[0] + t[0] ) : [ /*value*/ - r[0] + t[0] ]), u = []; - for (let y = 0; y < f.length; y += 1) - u[y] = create_each_block$3(get_each_context$3(r, f, y)); + for (let b = 0; b < f.length; b += 1) + u[b] = create_each_block$3(get_each_context$3(t, f, b)); return { c() { - e = element$8("div"), t = element$8("table"), n = element$8("tbody"); - for (let y = 0; y < u.length; y += 1) - u[y].c(); - attr$9(n, "class", "svelte-usqupg"), attr$9(t, "class", "file-preview svelte-usqupg"), attr$9(e, "class", "file-preview-holder svelte-usqupg"), set_style$4(e, "max-height", typeof /*height*/ - r[2] === void 0 ? "auto" : ( + e = element$8("div"), r = element$8("table"), n = element$8("tbody"); + for (let b = 0; b < u.length; b += 1) + u[b].c(); + attr$9(n, "class", "svelte-usqupg"), attr$9(r, "class", "file-preview svelte-usqupg"), attr$9(e, "class", "file-preview-holder svelte-usqupg"), set_style$4(e, "max-height", typeof /*height*/ + t[2] === void 0 ? "auto" : ( /*height*/ - r[2] + "px" + t[2] + "px" )); }, - m(y, h) { - insert$b(y, e, h), append$9(e, t), append$9(t, n); + m(b, h) { + insert$b(b, e, h), append$9(e, r), append$9(r, n); for (let _ = 0; _ < u.length; _ += 1) u[_] && u[_].m(n, null); }, - p(y, [h]) { + p(b, [h]) { if (h & /*selectable, dispatch, Array, value, window, i18n*/ 27) { f = ensure_array_like$3(Array.isArray( /*value*/ - y[0] + b[0] ) ? ( /*value*/ - y[0] + b[0] ) : [ /*value*/ - y[0] + b[0] ]); let _; for (_ = 0; _ < f.length; _ += 1) { - const E = get_each_context$3(y, f, _); + const E = get_each_context$3(b, f, _); u[_] ? u[_].p(E, h) : (u[_] = create_each_block$3(E), u[_].c(), u[_].m(n, null)); } for (; _ < u.length; _ += 1) @@ -1506,25 +1506,25 @@ function create_fragment$b(r) { } h & /*height*/ 4 && set_style$4(e, "max-height", typeof /*height*/ - y[2] === void 0 ? "auto" : ( + b[2] === void 0 ? "auto" : ( /*height*/ - y[2] + "px" + b[2] + "px" )); }, i: noop$7, o: noop$7, - d(y) { - y && detach$b(e), destroy_each$3(u, y); + d(b) { + b && detach$b(e), destroy_each$3(u, b); } }; } -function instance$a(r, e, t) { +function instance$a(t, e, r) { const n = createEventDispatcher$4(); - let { value: f } = e, { selectable: u = !1 } = e, { height: y = void 0 } = e, { i18n: h } = e; + let { value: f } = e, { selectable: u = !1 } = e, { height: b = void 0 } = e, { i18n: h } = e; const _ = (E, c) => n("select", { value: E.orig_name, index: c }); - return r.$$set = (E) => { - "value" in E && t(0, f = E.value), "selectable" in E && t(1, u = E.selectable), "height" in E && t(2, y = E.height), "i18n" in E && t(3, h = E.i18n); - }, [f, u, y, h, n, _]; + return t.$$set = (E) => { + "value" in E && r(0, f = E.value), "selectable" in E && r(1, u = E.selectable), "height" in E && r(2, b = E.height), "i18n" in E && r(3, h = E.i18n); + }, [f, u, b, h, n, _]; } class FilePreview extends SvelteComponent$b { constructor(e) { @@ -1537,8 +1537,8 @@ class FilePreview extends SvelteComponent$b { } } var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function getDefaultExportFromCjs(r) { - return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r; +function getDefaultExportFromCjs(t) { + return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var _3Dmol$1 = { exports: {} }; /*! @@ -1547,8 +1547,8 @@ var _3Dmol$1 = { exports: {} }; * Author: David Koes and contributors */ (function(module, exports) { - (function(e, t) { - module.exports = t(); + (function(e, r) { + module.exports = r(); })(commonjsGlobal, () => ( /******/ (() => { @@ -1559,8 +1559,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/iobuffer/lib-esm/IOBuffer.js ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ IOBuffer: () => ( /* binding */ @@ -1568,14 +1568,14 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var n = t( + var n = r( /*! ./text */ "./node_modules/iobuffer/lib-esm/text.browser.js" ); const f = 1024 * 8, u = (() => { const _ = new Uint8Array(4), E = new Uint32Array(_.buffer); return !((E[0] = 1) & _[0]); - })(), y = { + })(), b = { int8: globalThis.Int8Array, uint8: globalThis.Uint8Array, int16: globalThis.Int16Array, @@ -1597,11 +1597,11 @@ var _3Dmol$1 = { exports: {} }; * @param options */ constructor(E = f, c = {}) { - let C = !1; - typeof E == "number" ? E = new ArrayBuffer(E) : (C = !0, this.lastWrittenByte = E.byteLength); - const b = c.offset ? c.offset >>> 0 : 0, A = E.byteLength - b; - let S = b; - (ArrayBuffer.isView(E) || E instanceof h) && (E.byteLength !== E.buffer.byteLength && (S = E.byteOffset + b), E = E.buffer), C ? this.lastWrittenByte = A : this.lastWrittenByte = 0, this.buffer = E, this.length = A, this.byteLength = A, this.byteOffset = S, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, S, A), this._mark = 0, this._marks = []; + let S = !1; + typeof E == "number" ? E = new ArrayBuffer(E) : (S = !0, this.lastWrittenByte = E.byteLength); + const y = c.offset ? c.offset >>> 0 : 0, w = E.byteLength - y; + let L = y; + (ArrayBuffer.isView(E) || E instanceof h) && (E.byteLength !== E.buffer.byteLength && (L = E.byteOffset + y), E = E.buffer), S ? this.lastWrittenByte = w : this.lastWrittenByte = 0, this.buffer = E, this.length = w, this.byteLength = w, this.byteOffset = L, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, L, w), this._mark = 0, this._marks = []; } /** * Checks if the memory allocated to the buffer is sufficient to store more @@ -1707,8 +1707,8 @@ var _3Dmol$1 = { exports: {} }; */ ensureAvailable(E = 1) { if (!this.available(E)) { - const C = (this.offset + E) * 2, b = new Uint8Array(C); - b.set(new Uint8Array(this.buffer)), this.buffer = b.buffer, this.length = this.byteLength = C, this._data = new DataView(this.buffer); + const S = (this.offset + E) * 2, y = new Uint8Array(S); + y.set(new Uint8Array(this.buffer)), this.buffer = y.buffer, this.length = this.byteLength = S, this._data = new DataView(this.buffer); } return this; } @@ -1750,15 +1750,15 @@ var _3Dmol$1 = { exports: {} }; * @param type - number type of elements to read */ readArray(E, c) { - const C = y[c].BYTES_PER_ELEMENT * E, b = this.byteOffset + this.offset, A = this.buffer.slice(b, b + C); + const S = b[c].BYTES_PER_ELEMENT * E, y = this.byteOffset + this.offset, w = this.buffer.slice(y, y + S); if (this.littleEndian === u && c !== "uint8" && c !== "int8") { - const s = new Uint8Array(this.buffer.slice(b, b + C)); + const s = new Uint8Array(this.buffer.slice(y, y + S)); s.reverse(); - const o = new y[c](s.buffer); - return this.offset += C, o.reverse(), o; + const o = new b[c](s.buffer); + return this.offset += S, o.reverse(), o; } - const S = new y[c](A); - return this.offset += C, S; + const L = new b[c](w); + return this.offset += S, L; } /** * Read a 16-bit signed integer and move pointer forward by 2 bytes. @@ -1827,7 +1827,7 @@ var _3Dmol$1 = { exports: {} }; */ readChars(E = 1) { let c = ""; - for (let C = 0; C < E; C++) + for (let S = 0; S < E; S++) c += this.readChar(); return c; } @@ -1986,8 +1986,8 @@ var _3Dmol$1 = { exports: {} }; \*****************************************************************/ /***/ function() { - (function(r) { - if (r.TextEncoder && r.TextDecoder) + (function(t) { + if (t.TextEncoder && t.TextDecoder) return !1; function e(n = "utf-8") { if (n !== "utf-8") @@ -1999,22 +1999,22 @@ var _3Dmol$1 = { exports: {} }; if (f.stream) throw new Error("Failed to encode: the 'stream' option is unsupported."); let u = 0; - const y = n.length; - let h = 0, _ = Math.max(32, y + (y >> 1) + 7), E = new Uint8Array(_ >> 3 << 3); - for (; u < y; ) { + const b = n.length; + let h = 0, _ = Math.max(32, b + (b >> 1) + 7), E = new Uint8Array(_ >> 3 << 3); + for (; u < b; ) { let c = n.charCodeAt(u++); if (c >= 55296 && c <= 56319) { - if (u < y) { - const C = n.charCodeAt(u); - (C & 64512) === 56320 && (++u, c = ((c & 1023) << 10) + (C & 1023) + 65536); + if (u < b) { + const S = n.charCodeAt(u); + (S & 64512) === 56320 && (++u, c = ((c & 1023) << 10) + (S & 1023) + 65536); } if (c >= 55296 && c <= 56319) continue; } if (h + 4 > E.length) { _ += 8, _ *= 1 + u / n.length * 2, _ = _ >> 3 << 3; - const C = new Uint8Array(_); - C.set(E), E = C; + const S = new Uint8Array(_); + S.set(E), E = S; } if (c & 4294967168) if (!(c & 4294965248)) @@ -2033,42 +2033,42 @@ var _3Dmol$1 = { exports: {} }; } return E.slice(0, h); }; - function t(n = "utf-8", f = { fatal: !1 }) { + function r(n = "utf-8", f = { fatal: !1 }) { if (n !== "utf-8") throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${n}') is invalid.`); if (f.fatal) throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported."); } - Object.defineProperty(t.prototype, "encoding", { + Object.defineProperty(r.prototype, "encoding", { value: "utf-8" - }), Object.defineProperty(t.prototype, "fatal", { value: !1 }), Object.defineProperty(t.prototype, "ignoreBOM", { + }), Object.defineProperty(r.prototype, "fatal", { value: !1 }), Object.defineProperty(r.prototype, "ignoreBOM", { value: !1 - }), t.prototype.decode = function(n, f = { stream: !1 }) { + }), r.prototype.decode = function(n, f = { stream: !1 }) { if (f.stream) throw new Error("Failed to decode: the 'stream' option is unsupported."); const u = new Uint8Array(n); - let y = 0; + let b = 0; const h = u.length, _ = []; - for (; y < h; ) { - const E = u[y++]; + for (; b < h; ) { + const E = u[b++]; if (E === 0) break; if (!(E & 128)) _.push(E); else if ((E & 224) === 192) { - const c = u[y++] & 63; + const c = u[b++] & 63; _.push((E & 31) << 6 | c); } else if ((E & 240) === 224) { - const c = u[y++] & 63, C = u[y++] & 63; - _.push((E & 31) << 12 | c << 6 | C); + const c = u[b++] & 63, S = u[b++] & 63; + _.push((E & 31) << 12 | c << 6 | S); } else if ((E & 248) === 240) { - const c = u[y++] & 63, C = u[y++] & 63, b = u[y++] & 63; - let A = (E & 7) << 18 | c << 12 | C << 6 | b; - A > 65535 && (A -= 65536, _.push(A >>> 10 & 1023 | 55296), A = 56320 | A & 1023), _.push(A); + const c = u[b++] & 63, S = u[b++] & 63, y = u[b++] & 63; + let w = (E & 7) << 18 | c << 12 | S << 6 | y; + w > 65535 && (w -= 65536, _.push(w >>> 10 & 1023 | 55296), w = 56320 | w & 1023), _.push(w); } } return String.fromCharCode.apply(null, _); - }, r.TextEncoder = e, r.TextDecoder = t; + }, t.TextEncoder = e, t.TextDecoder = r; })(typeof window < "u" ? window : typeof self < "u" ? self : this); } ), @@ -2078,8 +2078,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/iobuffer/lib-esm/text.browser.js ***! \*******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ decode: () => ( /* binding */ @@ -2091,16 +2091,16 @@ var _3Dmol$1 = { exports: {} }; u ) /* harmony export */ - }), t( + }), r( /*! ./text-encoding-polyfill */ "./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js" ); - function n(y, h = "utf8") { - return new TextDecoder(h).decode(y); + function n(b, h = "utf8") { + return new TextDecoder(h).decode(b); } const f = new TextEncoder(); - function u(y) { - return f.encode(y); + function u(b) { + return f.encode(b); } } ), @@ -2110,8 +2110,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/data.js ***! \***********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ nonRecord: () => ( /* binding */ @@ -2124,26 +2124,26 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var n = t( + var n = r( /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" ); - function f(y, h) { + function f(b, h) { const _ = (0, n.str2num)(h.type), E = h.size / (0, n.num2bytes)(_), c = new Array(E); - for (let C = 0; C < E; C++) - c[C] = (0, n.readType)(y, _, 1); + for (let S = 0; S < E; S++) + c[S] = (0, n.readType)(b, _, 1); return c; } - function u(y, h, _) { - const E = (0, n.str2num)(h.type), c = h.size ? h.size / (0, n.num2bytes)(E) : 1, C = _.length, b = new Array(C), A = _.recordStep; - if (A) - for (let S = 0; S < C; S++) { - const s = y.offset; - b[S] = (0, n.readType)(y, E, c), y.seek(s + A); + function u(b, h, _) { + const E = (0, n.str2num)(h.type), c = h.size ? h.size / (0, n.num2bytes)(E) : 1, S = _.length, y = new Array(S), w = _.recordStep; + if (w) + for (let L = 0; L < S; L++) { + const s = b.offset; + y[L] = (0, n.readType)(b, E, c), b.seek(s + w); } else throw new Error("recordDimension.recordStep is undefined"); - return b; + return y; } } ), @@ -2153,8 +2153,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/header.js ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ header: () => ( /* binding */ @@ -2162,57 +2162,57 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var n = t( + var n = r( /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" - ), f = t( + ), f = r( /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - const u = 0, y = 10, h = 11, _ = 12, E = 0; - function c(S, s) { - const o = { version: s }, w = { - length: S.readUint32() - }, p = C(S); - Array.isArray(p) || (w.id = p.recordId, w.name = p.recordName, o.dimensions = p.dimensions), o.globalAttributes = b(S); - const v = A(S, w == null ? void 0 : w.id, s); - return Array.isArray(v) || (o.variables = v.variables, w.recordStep = v.recordStep), o.recordDimension = w, o; + const u = 0, b = 10, h = 11, _ = 12, E = 0; + function c(L, s) { + const o = { version: s }, A = { + length: L.readUint32() + }, p = S(L); + Array.isArray(p) || (A.id = p.recordId, A.name = p.recordName, o.dimensions = p.dimensions), o.globalAttributes = y(L); + const v = w(L, A == null ? void 0 : A.id, s); + return Array.isArray(v) || (o.variables = v.variables, A.recordStep = v.recordStep), o.recordDimension = A, o; } - function C(S) { + function S(L) { const s = {}; - let o, w; - const p = S.readUint32(); + let o, A; + const p = L.readUint32(); let v; if (p === u) - return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of dimensions"), []; + return (0, f.notNetcdf)(L.readUint32() !== u, "wrong empty tag for list of dimensions"), []; { - (0, f.notNetcdf)(p !== y, "wrong tag for list of dimensions"); - const a = S.readUint32(); + (0, f.notNetcdf)(p !== b, "wrong tag for list of dimensions"); + const a = L.readUint32(); v = new Array(a); for (let l = 0; l < a; l++) { - const g = (0, f.readName)(S), M = S.readUint32(); - M === E && (o = l, w = g), v[l] = { + const g = (0, f.readName)(L), M = L.readUint32(); + M === E && (o = l, A = g), v[l] = { name: g, size: M }; } } - return o !== void 0 && (s.recordId = o), w !== void 0 && (s.recordName = w), s.dimensions = v, s; + return o !== void 0 && (s.recordId = o), A !== void 0 && (s.recordName = A), s.dimensions = v, s; } - function b(S) { - const s = S.readUint32(); + function y(L) { + const s = L.readUint32(); let o; if (s === u) - return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of attributes"), []; + return (0, f.notNetcdf)(L.readUint32() !== u, "wrong empty tag for list of attributes"), []; { (0, f.notNetcdf)(s !== _, "wrong tag for list of attributes"); - const w = S.readUint32(); - o = new Array(w); - for (let p = 0; p < w; p++) { - const v = (0, f.readName)(S), a = S.readUint32(); + const A = L.readUint32(); + o = new Array(A); + for (let p = 0; p < A; p++) { + const v = (0, f.readName)(L), a = L.readUint32(); (0, f.notNetcdf)(a < 1 || a > 6, `non valid type ${a}`); - const l = S.readUint32(), g = (0, n.readType)(S, a, l); - (0, f.padding)(S), o[p] = { + const l = L.readUint32(), g = (0, n.readType)(L, a, l); + (0, f.padding)(L), o[p] = { name: v, type: (0, n.num2str)(a), value: g @@ -2221,32 +2221,32 @@ var _3Dmol$1 = { exports: {} }; } return o; } - function A(S, s, o) { - const w = S.readUint32(); + function w(L, s, o) { + const A = L.readUint32(); let p = 0, v; - if (w === u) - return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of variables"), []; + if (A === u) + return (0, f.notNetcdf)(L.readUint32() !== u, "wrong empty tag for list of variables"), []; { - (0, f.notNetcdf)(w !== h, "wrong tag for list of variables"); - const a = S.readUint32(); + (0, f.notNetcdf)(A !== h, "wrong tag for list of variables"); + const a = L.readUint32(); v = new Array(a); for (let l = 0; l < a; l++) { - const g = (0, f.readName)(S), M = S.readUint32(), L = new Array(M); - for (let B = 0; B < M; B++) - L[B] = S.readUint32(); - const T = b(S), D = S.readUint32(); + const g = (0, f.readName)(L), M = L.readUint32(), C = new Array(M); + for (let z = 0; z < M; z++) + C[z] = L.readUint32(); + const T = y(L), D = L.readUint32(); (0, f.notNetcdf)(D < 1 && D > 6, `non valid type ${D}`); - const I = S.readUint32(); - let z = S.readUint32(); - o === 2 && ((0, f.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = S.readUint32()); + const I = L.readUint32(); + let B = L.readUint32(); + o === 2 && ((0, f.notNetcdf)(B > 0, "offsets larger than 4GB not supported"), B = L.readUint32()); let P = !1; - typeof s < "u" && L[0] === s && (p += I, P = !0), v[l] = { + typeof s < "u" && C[0] === s && (p += I, P = !0), v[l] = { name: g, - dimensions: L, + dimensions: C, attributes: T, type: (0, n.num2str)(D), size: I, - offset: z, + offset: B, record: P }; } @@ -2264,8 +2264,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/index.js ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ NetCDFReader: () => ( /* reexport safe */ @@ -2273,7 +2273,7 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var n = t( + var n = r( /*! ./parser */ "./node_modules/netcdfjs/lib-esm/parser.js" ); @@ -2285,8 +2285,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/parser.js ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ NetCDFReader: () => ( /* binding */ @@ -2294,29 +2294,29 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var n = t( + var n = r( /*! iobuffer */ "./node_modules/iobuffer/lib-esm/IOBuffer.js" - ), f = t( + ), f = r( /*! ./data */ "./node_modules/netcdfjs/lib-esm/data.js" - ), u = t( + ), u = r( /*! ./header */ "./node_modules/netcdfjs/lib-esm/header.js" - ), y = t( + ), b = r( /*! ./toString */ "./node_modules/netcdfjs/lib-esm/toString.js" - ), h = t( + ), h = r( /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); class _ { constructor(c) { - this.toString = y.toString; - const C = new n.IOBuffer(c); - C.setBigEndian(), (0, h.notNetcdf)(C.readChars(3) !== "CDF", "should start with CDF"); - const b = C.readByte(); - (0, h.notNetcdf)(b > 2, "unknown version"), this.header = (0, u.header)(C, b), this.buffer = C; + this.toString = b.toString; + const S = new n.IOBuffer(c); + S.setBigEndian(), (0, h.notNetcdf)(S.readChars(3) !== "CDF", "should start with CDF"); + const y = S.readByte(); + (0, h.notNetcdf)(y > 2, "unknown version"), this.header = (0, u.header)(S, y), this.buffer = S; } /** * @return - Version for the NetCDF format @@ -2357,8 +2357,8 @@ var _3Dmol$1 = { exports: {} }; * @return - Value of the attributeName or null */ getAttribute(c) { - const C = this.globalAttributes.find((b) => b.name === c); - return C ? C.value : null; + const S = this.globalAttributes.find((y) => y.name === c); + return S ? S.value : null; } /** * Returns the value of a variable as a string @@ -2366,8 +2366,8 @@ var _3Dmol$1 = { exports: {} }; * @return - Value of the variable as a string or null */ getDataVariableAsString(c) { - const C = this.getDataVariable(c); - return C ? C.join("") : null; + const S = this.getDataVariable(c); + return S ? S.join("") : null; } get variables() { return this.header.variables; @@ -2378,10 +2378,10 @@ var _3Dmol$1 = { exports: {} }; * @return The variable values */ getDataVariable(c) { - let C; - if (typeof c == "string" ? C = this.header.variables.find((b) => b.name === c) : C = c, C === void 0) + let S; + if (typeof c == "string" ? S = this.header.variables.find((y) => y.name === c) : S = c, S === void 0) throw new Error("Not a valid NetCDF v3.x file: variable not found"); - return this.buffer.seek(C.offset), C.record ? (0, f.record)(this.buffer, C, this.header.recordDimension) : (0, f.nonRecord)(this.buffer, C); + return this.buffer.seek(S.offset), S.record ? (0, f.record)(this.buffer, S, this.header.recordDimension) : (0, f.nonRecord)(this.buffer, S); } /** * Check if a dataVariable exists @@ -2389,7 +2389,7 @@ var _3Dmol$1 = { exports: {} }; * @return boolean */ dataVariableExists(c) { - return this.header.variables.find((b) => b.name === c) !== void 0; + return this.header.variables.find((y) => y.name === c) !== void 0; } /** * Check if an attribute exists @@ -2397,7 +2397,7 @@ var _3Dmol$1 = { exports: {} }; * @return boolean */ attributeExists(c) { - return this.globalAttributes.find((b) => b.name === c) !== void 0; + return this.globalAttributes.find((y) => y.name === c) !== void 0; } } } @@ -2408,8 +2408,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/toString.js ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ toString: () => ( /* binding */ @@ -2420,17 +2420,17 @@ var _3Dmol$1 = { exports: {} }; function n() { const f = []; f.push("DIMENSIONS"); - for (const y of this.dimensions) - f.push(` ${y.name.padEnd(30)} = size: ${y.size}`); + for (const b of this.dimensions) + f.push(` ${b.name.padEnd(30)} = size: ${b.size}`); f.push(""), f.push("GLOBAL ATTRIBUTES"); - for (const y of this.globalAttributes) - f.push(` ${y.name.padEnd(30)} = ${y.value}`); + for (const b of this.globalAttributes) + f.push(` ${b.name.padEnd(30)} = ${b.value}`); const u = JSON.parse(JSON.stringify(this.variables)); f.push(""), f.push("VARIABLES:"); - for (const y of u) { - y.value = this.getDataVariable(y); - let h = JSON.stringify(y.value); - h.length > 50 && (h = h.substring(0, 50)), isNaN(y.value.length) || (h += ` (length: ${y.value.length})`), f.push(` ${y.name.padEnd(30)} = ${h}`); + for (const b of u) { + b.value = this.getDataVariable(b); + let h = JSON.stringify(b.value); + h.length > 50 && (h = h.substring(0, 50)), isNaN(b.value.length) || (h += ` (length: ${b.value.length})`), f.push(` ${b.name.padEnd(30)} = ${h}`); } return f.join(` `); @@ -2443,8 +2443,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/types.js ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ num2bytes: () => ( /* binding */ @@ -2463,7 +2463,7 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ str2num: () => ( /* binding */ - y + b ) /* harmony export */ }); @@ -2511,7 +2511,7 @@ var _3Dmol$1 = { exports: {} }; return -1; } } - function y(c) { + function b(c) { switch (String(c)) { case "byte": return n.BYTE; @@ -2529,31 +2529,31 @@ var _3Dmol$1 = { exports: {} }; return -1; } } - function h(c, C) { + function h(c, S) { if (c !== 1) { - const b = new Array(c); - for (let A = 0; A < c; A++) - b[A] = C(); - return b; + const y = new Array(c); + for (let w = 0; w < c; w++) + y[w] = S(); + return y; } else - return C(); + return S(); } - function _(c, C, b) { - switch (C) { + function _(c, S, y) { + switch (S) { case n.BYTE: - return Array.from(c.readBytes(b)); + return Array.from(c.readBytes(y)); case n.CHAR: - return E(c.readChars(b)); + return E(c.readChars(y)); case n.SHORT: - return h(b, c.readInt16.bind(c)); + return h(y, c.readInt16.bind(c)); case n.INT: - return h(b, c.readInt32.bind(c)); + return h(y, c.readInt32.bind(c)); case n.FLOAT: - return h(b, c.readFloat32.bind(c)); + return h(y, c.readFloat32.bind(c)); case n.DOUBLE: - return h(b, c.readFloat64.bind(c)); + return h(y, c.readFloat64.bind(c)); default: - throw new Error(`non valid type ${C}`); + throw new Error(`non valid type ${S}`); } } function E(c) { @@ -2567,8 +2567,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./node_modules/netcdfjs/lib-esm/utils.js ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ notNetcdf: () => ( /* binding */ @@ -2586,16 +2586,16 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - function n(y, h) { - if (y) + function n(b, h) { + if (b) throw new TypeError(`Not a valid NetCDF v3.x file: ${h}`); } - function f(y) { - y.offset % 4 !== 0 && y.skip(4 - y.offset % 4); + function f(b) { + b.offset % 4 !== 0 && b.skip(4 - b.offset % 4); } - function u(y) { - const h = y.readUint32(), _ = y.readChars(h); - return f(y), _; + function u(b) { + const h = b.readUint32(), _ = b.readChars(h); + return f(b), _; } } ), @@ -2605,8 +2605,8 @@ var _3Dmol$1 = { exports: {} }; !*** ./src/WebGL/shaders/lib/basic/basic.frag ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2632,8 +2632,8 @@ void main() { !*** ./src/WebGL/shaders/lib/basic/basic.vert ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2663,8 +2663,8 @@ void main() { !*** ./src/WebGL/shaders/lib/instanced/instanced.frag ***! \********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2707,8 +2707,8 @@ void main() { !*** ./src/WebGL/shaders/lib/instanced/instanced.vert ***! \********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2762,8 +2762,8 @@ void main() { !*** ./src/WebGL/shaders/lib/lambert/lambert.frag ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2803,8 +2803,8 @@ void main() { !*** ./src/WebGL/shaders/lib/lambert/lambert.vert ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2853,8 +2853,8 @@ void main() { !*** ./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag ***! \****************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2904,8 +2904,8 @@ void main() { !*** ./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert ***! \****************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2961,8 +2961,8 @@ void main() { !*** ./src/WebGL/shaders/lib/outline/outline.frag ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -2990,8 +2990,8 @@ void main() { !*** ./src/WebGL/shaders/lib/outline/outline.vert ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3027,8 +3027,8 @@ void main() { !*** ./src/WebGL/shaders/lib/screen/screen.frag ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3049,8 +3049,8 @@ void main (void) { !*** ./src/WebGL/shaders/lib/screen/screen.vert ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3072,8 +3072,8 @@ void main() { !*** ./src/WebGL/shaders/lib/screenaa/screenaa.frag ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3144,8 +3144,8 @@ void main (void) { !*** ./src/WebGL/shaders/lib/screenaa/screenaa.vert ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3167,8 +3167,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag ***! \******************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3222,8 +3222,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert ***! \******************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3268,8 +3268,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag ***! \********************************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3313,8 +3313,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert ***! \********************************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3355,8 +3355,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sprite/sprite.frag ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3414,8 +3414,8 @@ void main() { !*** ./src/WebGL/shaders/lib/sprite/sprite.vert ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3471,8 +3471,8 @@ void main() { !*** ./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag ***! \************************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3491,8 +3491,8 @@ void main() { !*** ./src/WebGL/shaders/lib/stickimposter/stickimposter.vert ***! \****************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3569,8 +3569,8 @@ void main() { !*** ./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert ***! \******************************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3647,8 +3647,8 @@ void main() { !*** ./src/WebGL/shaders/lib/volumetric/volumetric.frag ***! \**********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3739,8 +3739,8 @@ void main(void) { !*** ./src/WebGL/shaders/lib/volumetric/volumetric.vert ***! \**********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3765,8 +3765,8 @@ void main() { !*** ./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag ***! \**************************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ default: () => n /* harmony export */ @@ -3852,8 +3852,8 @@ void main() { !*** ./src/GLDraw.ts ***! \***********************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CAP: () => ( /* binding */ @@ -3866,157 +3866,157 @@ void main() { ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), f; - (function(y) { - y[y.NONE = 0] = "NONE", y[y.FLAT = 1] = "FLAT", y[y.ROUND = 2] = "ROUND"; + (function(b) { + b[b.NONE = 0] = "NONE", b[b.FLAT = 1] = "FLAT", b[b.ROUND = 2] = "ROUND"; })(f || (f = {})); var u; - (function(y) { - function h(s, o, w) { + (function(b) { + function h(s, o, A) { var p = Math.hypot(s, o), v, a, l, g, M; - p < 1e-4 ? (a = 0, l = 1) : (a = -s / p, l = o / p), o = -a * s + l * o, v = Math.hypot(o, w), v < 1e-4 ? (g = 0, M = 1) : (g = w / v, M = o / v); - var L = new Float32Array(9); - return L[0] = l, L[1] = a, L[2] = 0, L[3] = -a * M, L[4] = l * M, L[5] = g, L[6] = a * g, L[7] = -l * g, L[8] = M, L; + p < 1e-4 ? (a = 0, l = 1) : (a = -s / p, l = o / p), o = -a * s + l * o, v = Math.hypot(o, A), v < 1e-4 ? (g = 0, M = 1) : (g = A / v, M = o / v); + var C = new Float32Array(9); + return C[0] = l, C[1] = a, C[2] = 0, C[3] = -a * M, C[4] = l * M, C[5] = g, C[6] = a * g, C[7] = -l * g, C[8] = M, C; } class _ { constructor() { this.cache = {}; - let o = [], w = 4, p = Math.pow(2, w), v = 2, a = Math.pow(2, v), l = p / a, g; - for (o[0] = new n.Vector3(-1, 0, 0), o[l] = new n.Vector3(0, 0, 1), o[l * 2] = new n.Vector3(1, 0, 0), o[l * 3] = new n.Vector3(0, 0, -1), v = 3; v <= w; v++) { + let o = [], A = 4, p = Math.pow(2, A), v = 2, a = Math.pow(2, v), l = p / a, g; + for (o[0] = new n.Vector3(-1, 0, 0), o[l] = new n.Vector3(0, 0, 1), o[l * 2] = new n.Vector3(1, 0, 0), o[l * 3] = new n.Vector3(0, 0, -1), v = 3; v <= A; v++) { for (a = Math.pow(2, v - 1), l = p / a, g = 0; g < a - 1; g++) o[l / 2 + g * l] = o[g * l].clone().add(o[(g + 1) * l]).normalize(); g = a - 1, o[l / 2 + g * l] = o[g * l].clone().add(o[0]).normalize(); } this.basisVectors = o; } - getVerticesForRadius(o, w, p) { - if (typeof this.cache < "u" && this.cache[o] !== void 0 && this.cache[o][w + p] !== void 0) - return this.cache[o][w + p]; + getVerticesForRadius(o, A, p) { + if (typeof this.cache < "u" && this.cache[o] !== void 0 && this.cache[o][A + p] !== void 0) + return this.cache[o][A + p]; for (var v = this.basisVectors.length, a = [], l = [], g, M = 0; M < v; M++) a.push(this.basisVectors[M].clone().multiplyScalar(o)), a.push(this.basisVectors[M].clone().multiplyScalar(o)), g = this.basisVectors[M].clone().normalize(), l.push(g), l.push(g); - var L = [], T = 10, D = v, I = 0, z = Math.PI * 2, P = 0, B = Math.PI, k, N, $ = !1, F = !1; + var C = [], T = 10, D = v, I = 0, B = Math.PI * 2, P = 0, z = Math.PI, k, N, R = !1, U = !1; for (N = 0; N <= T; N++) { - $ = N === 0 || N === T, F = N === T / 2; - var G = [], H = []; + R = N === 0 || N === T, U = N === T / 2; + var W = [], G = []; for (k = 0; k <= D; k++) { - if (F) { - var U = k < D ? 2 * k : 0; - H.push(U + 1), G.push(U); + if (U) { + var F = k < D ? 2 * k : 0; + G.push(F + 1), W.push(F); continue; } - var V = k / D, Q = N / T; - if (!$ || k === 0) + var V = k / D, J = N / T; + if (!R || k === 0) if (k < D) { - var ae = new n.Vector3(); - ae.x = -o * Math.cos(I + V * z) * Math.sin(P + Q * B), w == 1 ? ae.y = 0 : ae.y = o * Math.cos(P + Q * B), ae.z = o * Math.sin(I + V * z) * Math.sin(P + Q * B), Math.abs(ae.x) < 1e-5 && (ae.x = 0), Math.abs(ae.y) < 1e-5 && (ae.y = 0), Math.abs(ae.z) < 1e-5 && (ae.z = 0), w == f.FLAT ? (g = new n.Vector3(0, Math.cos(P + Q * B), 0), g.normalize()) : (g = new n.Vector3(ae.x, ae.y, ae.z), g.normalize()), a.push(ae), l.push(g), G.push(a.length - 1); + var X = new n.Vector3(); + X.x = -o * Math.cos(I + V * B) * Math.sin(P + J * z), A == 1 ? X.y = 0 : X.y = o * Math.cos(P + J * z), X.z = o * Math.sin(I + V * B) * Math.sin(P + J * z), Math.abs(X.x) < 1e-5 && (X.x = 0), Math.abs(X.y) < 1e-5 && (X.y = 0), Math.abs(X.z) < 1e-5 && (X.z = 0), A == f.FLAT ? (g = new n.Vector3(0, Math.cos(P + J * z), 0), g.normalize()) : (g = new n.Vector3(X.x, X.y, X.z), g.normalize()), a.push(X), l.push(g), W.push(a.length - 1); } else - G.push(a.length - D); + W.push(a.length - D); else - $ && G.push(a.length - 1); + R && W.push(a.length - 1); } - F && L.push(H), L.push(G); + U && C.push(G), C.push(W); } var oe = { vertices: a, normals: l, - verticesRows: L, + verticesRows: C, w: D, h: T }; - return o in this.cache || (this.cache[o] = {}), this.cache[o][w + p] = oe, oe; + return o in this.cache || (this.cache[o] = {}), this.cache[o][A + p] = oe, oe; } } var E = new _(); - function c(s, o, w, p, v, a = 0, l = 0) { - if (!(!o || !w)) { + function c(s, o, A, p, v, a = 0, l = 0) { + if (!(!o || !A)) { var g = l || a; v = v || { r: 0, g: 0, b: 0 }; - var M = h(w.x - o.x, w.y - o.y, w.z - o.z), L = E.getVerticesForRadius(p, l, "to"), T = L.w, D = L.h, I = g ? D * T + 2 : 2 * T, z = s.updateGeoGroup(I), P = L.vertices, B = L.normals, k = L.verticesRows, N = k[D / 2], $ = k[D / 2 + 1], F = z.vertices, G, H, U, V, Q, ae, oe = z.vertexArray, q = z.normalArray, me = z.colorArray, ne = z.faceArray; - for (U = 0; U < T; ++U) { - var fe = 2 * U; - V = M[0] * P[fe].x + M[3] * P[fe].y + M[6] * P[fe].z, Q = M[1] * P[fe].x + M[4] * P[fe].y + M[7] * P[fe].z, ae = M[5] * P[fe].y + M[8] * P[fe].z, G = 3 * (F + fe), H = z.faceidx, oe[G] = V + o.x, oe[G + 1] = Q + o.y, oe[G + 2] = ae + o.z, oe[G + 3] = V + w.x, oe[G + 4] = Q + w.y, oe[G + 5] = ae + w.z, q[G] = V, q[G + 3] = V, q[G + 1] = Q, q[G + 4] = Q, q[G + 2] = ae, q[G + 5] = ae, me[G] = v.r, me[G + 3] = v.r, me[G + 1] = v.g, me[G + 4] = v.g, me[G + 2] = v.b, me[G + 5] = v.b, ne[H] = $[U] + F, ne[H + 1] = $[U + 1] + F, ne[H + 2] = N[U] + F, ne[H + 3] = N[U] + F, ne[H + 4] = $[U + 1] + F, ne[H + 5] = N[U + 1] + F, z.faceidx += 6; + var M = h(A.x - o.x, A.y - o.y, A.z - o.z), C = E.getVerticesForRadius(p, l, "to"), T = C.w, D = C.h, I = g ? D * T + 2 : 2 * T, B = s.updateGeoGroup(I), P = C.vertices, z = C.normals, k = C.verticesRows, N = k[D / 2], R = k[D / 2 + 1], U = B.vertices, W, G, F, V, J, X, oe = B.vertexArray, te = B.normalArray, ve = B.colorArray, se = B.faceArray; + for (F = 0; F < T; ++F) { + var le = 2 * F; + V = M[0] * P[le].x + M[3] * P[le].y + M[6] * P[le].z, J = M[1] * P[le].x + M[4] * P[le].y + M[7] * P[le].z, X = M[5] * P[le].y + M[8] * P[le].z, W = 3 * (U + le), G = B.faceidx, oe[W] = V + o.x, oe[W + 1] = J + o.y, oe[W + 2] = X + o.z, oe[W + 3] = V + A.x, oe[W + 4] = J + A.y, oe[W + 5] = X + A.z, te[W] = V, te[W + 3] = V, te[W + 1] = J, te[W + 4] = J, te[W + 2] = X, te[W + 5] = X, ve[W] = v.r, ve[W + 3] = v.r, ve[W + 1] = v.g, ve[W + 4] = v.g, ve[W + 2] = v.b, ve[W + 5] = v.b, se[G] = R[F] + U, se[G + 1] = R[F + 1] + U, se[G + 2] = N[F] + U, se[G + 3] = N[F] + U, se[G + 4] = R[F + 1] + U, se[G + 5] = N[F + 1] + U, B.faceidx += 6; } if (g) { - var Ce = l ? 0 : D / 2, Me = a ? D + 1 : D / 2 + 1, Te, se, pe, we, Fe, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve, Ie, Re, Z, ce, Ae, ke, he, Oe, j, $e, Ve, R; - for (Q = Ce; Q < Me; Q++) - if (Q !== D / 2) { - var be = Q <= D / 2 ? w : o, Ee = E.getVerticesForRadius(p, l, "to"), X = E.getVerticesForRadius(p, a, "from"); - for (be === w ? (P = Ee.vertices, B = Ee.normals, k = Ee.verticesRows) : be == o && (P = X.vertices, B = X.normals, k = X.verticesRows), V = 0; V < T; V++) - H = z.faceidx, Te = k[Q][V + 1], j = (Te + F) * 3, se = k[Q][V], $e = (se + F) * 3, pe = k[Q + 1][V], Ve = (pe + F) * 3, we = k[Q + 1][V + 1], R = (we + F) * 3, Fe = M[0] * P[Te].x + M[3] * P[Te].y + M[6] * P[Te].z, Ue = M[0] * P[se].x + M[3] * P[se].y + M[6] * P[se].z, Ne = M[0] * P[pe].x + M[3] * P[pe].y + M[6] * P[pe].z, Be = M[0] * P[we].x + M[3] * P[we].y + M[6] * P[we].z, ue = M[1] * P[Te].x + M[4] * P[Te].y + M[7] * P[Te].z, ye = M[1] * P[se].x + M[4] * P[se].y + M[7] * P[se].z, ge = M[1] * P[pe].x + M[4] * P[pe].y + M[7] * P[pe].z, Se = M[1] * P[we].x + M[4] * P[we].y + M[7] * P[we].z, ze = M[5] * P[Te].y + M[8] * P[Te].z, He = M[5] * P[se].y + M[8] * P[se].z, We = M[5] * P[pe].y + M[8] * P[pe].z, Y = M[5] * P[we].y + M[8] * P[we].z, oe[j] = Fe + be.x, oe[$e] = Ue + be.x, oe[Ve] = Ne + be.x, oe[R] = Be + be.x, oe[j + 1] = ue + be.y, oe[$e + 1] = ye + be.y, oe[Ve + 1] = ge + be.y, oe[R + 1] = Se + be.y, oe[j + 2] = ze + be.z, oe[$e + 2] = He + be.z, oe[Ve + 2] = We + be.z, oe[R + 2] = Y + be.z, me[j] = v.r, me[$e] = v.r, me[Ve] = v.r, me[R] = v.r, me[j + 1] = v.g, me[$e + 1] = v.g, me[Ve + 1] = v.g, me[R + 1] = v.g, me[j + 2] = v.b, me[$e + 2] = v.b, me[Ve + 2] = v.b, me[R + 2] = v.b, K = M[0] * B[Te].x + M[3] * B[Te].y + M[6] * B[Te].z, ee = M[0] * B[se].x + M[3] * B[se].y + M[6] * B[se].z, de = M[0] * B[pe].x + M[3] * B[pe].y + M[6] * B[pe].z, ve = M[0] * B[we].x + M[3] * B[we].y + M[6] * B[we].z, Ie = M[1] * B[Te].x + M[4] * B[Te].y + M[7] * B[Te].z, Re = M[1] * B[se].x + M[4] * B[se].y + M[7] * B[se].z, Z = M[1] * B[pe].x + M[4] * B[pe].y + M[7] * B[pe].z, ce = M[1] * B[we].x + M[4] * B[we].y + M[7] * B[we].z, Ae = M[5] * B[Te].y + M[8] * B[Te].z, ke = M[5] * B[se].y + M[8] * B[se].z, he = M[5] * B[pe].y + M[8] * B[pe].z, Oe = M[5] * B[we].y + M[8] * B[we].z, Q === 0 ? (q[j] = K, q[Ve] = de, q[R] = ve, q[j + 1] = Ie, q[Ve + 1] = Z, q[R + 1] = ce, q[j + 2] = Ae, q[Ve + 2] = he, q[R + 2] = Oe, ne[H] = Te + F, ne[H + 1] = pe + F, ne[H + 2] = we + F, z.faceidx += 3) : Q === Me - 1 ? (q[j] = K, q[$e] = ee, q[Ve] = de, q[j + 1] = Ie, q[$e + 1] = Re, q[Ve + 1] = Z, q[j + 2] = Ae, q[$e + 2] = ke, q[Ve + 2] = he, ne[H] = Te + F, ne[H + 1] = se + F, ne[H + 2] = pe + F, z.faceidx += 3) : (q[j] = K, q[$e] = ee, q[R] = ve, q[j + 1] = Ie, q[$e + 1] = Re, q[R + 1] = ce, q[j + 2] = Ae, q[$e + 2] = ke, q[R + 2] = Oe, q[$e] = ee, q[Ve] = de, q[R] = ve, q[$e + 1] = Re, q[Ve + 1] = Z, q[R + 1] = ce, q[$e + 2] = ke, q[Ve + 2] = he, q[R + 2] = Oe, ne[H] = Te + F, ne[H + 1] = se + F, ne[H + 2] = we + F, ne[H + 3] = se + F, ne[H + 4] = pe + F, ne[H + 5] = we + F, z.faceidx += 6); + var Ce = l ? 0 : D / 2, be = a ? D + 1 : D / 2 + 1, Le, ae, _e, Ee, Be, Ne, Ge, ke, pe, de, ce, Ae, Oe, We, Ue, Z, j, ee, ge, ye, $e, Re, Y, ue, Se, Fe, he, De, K, ze, Ve, $; + for (J = Ce; J < be; J++) + if (J !== D / 2) { + var xe = J <= D / 2 ? A : o, Me = E.getVerticesForRadius(p, l, "to"), Q = E.getVerticesForRadius(p, a, "from"); + for (xe === A ? (P = Me.vertices, z = Me.normals, k = Me.verticesRows) : xe == o && (P = Q.vertices, z = Q.normals, k = Q.verticesRows), V = 0; V < T; V++) + G = B.faceidx, Le = k[J][V + 1], K = (Le + U) * 3, ae = k[J][V], ze = (ae + U) * 3, _e = k[J + 1][V], Ve = (_e + U) * 3, Ee = k[J + 1][V + 1], $ = (Ee + U) * 3, Be = M[0] * P[Le].x + M[3] * P[Le].y + M[6] * P[Le].z, Ne = M[0] * P[ae].x + M[3] * P[ae].y + M[6] * P[ae].z, Ge = M[0] * P[_e].x + M[3] * P[_e].y + M[6] * P[_e].z, ke = M[0] * P[Ee].x + M[3] * P[Ee].y + M[6] * P[Ee].z, pe = M[1] * P[Le].x + M[4] * P[Le].y + M[7] * P[Le].z, de = M[1] * P[ae].x + M[4] * P[ae].y + M[7] * P[ae].z, ce = M[1] * P[_e].x + M[4] * P[_e].y + M[7] * P[_e].z, Ae = M[1] * P[Ee].x + M[4] * P[Ee].y + M[7] * P[Ee].z, Oe = M[5] * P[Le].y + M[8] * P[Le].z, We = M[5] * P[ae].y + M[8] * P[ae].z, Ue = M[5] * P[_e].y + M[8] * P[_e].z, Z = M[5] * P[Ee].y + M[8] * P[Ee].z, oe[K] = Be + xe.x, oe[ze] = Ne + xe.x, oe[Ve] = Ge + xe.x, oe[$] = ke + xe.x, oe[K + 1] = pe + xe.y, oe[ze + 1] = de + xe.y, oe[Ve + 1] = ce + xe.y, oe[$ + 1] = Ae + xe.y, oe[K + 2] = Oe + xe.z, oe[ze + 2] = We + xe.z, oe[Ve + 2] = Ue + xe.z, oe[$ + 2] = Z + xe.z, ve[K] = v.r, ve[ze] = v.r, ve[Ve] = v.r, ve[$] = v.r, ve[K + 1] = v.g, ve[ze + 1] = v.g, ve[Ve + 1] = v.g, ve[$ + 1] = v.g, ve[K + 2] = v.b, ve[ze + 2] = v.b, ve[Ve + 2] = v.b, ve[$ + 2] = v.b, j = M[0] * z[Le].x + M[3] * z[Le].y + M[6] * z[Le].z, ee = M[0] * z[ae].x + M[3] * z[ae].y + M[6] * z[ae].z, ge = M[0] * z[_e].x + M[3] * z[_e].y + M[6] * z[_e].z, ye = M[0] * z[Ee].x + M[3] * z[Ee].y + M[6] * z[Ee].z, $e = M[1] * z[Le].x + M[4] * z[Le].y + M[7] * z[Le].z, Re = M[1] * z[ae].x + M[4] * z[ae].y + M[7] * z[ae].z, Y = M[1] * z[_e].x + M[4] * z[_e].y + M[7] * z[_e].z, ue = M[1] * z[Ee].x + M[4] * z[Ee].y + M[7] * z[Ee].z, Se = M[5] * z[Le].y + M[8] * z[Le].z, Fe = M[5] * z[ae].y + M[8] * z[ae].z, he = M[5] * z[_e].y + M[8] * z[_e].z, De = M[5] * z[Ee].y + M[8] * z[Ee].z, J === 0 ? (te[K] = j, te[Ve] = ge, te[$] = ye, te[K + 1] = $e, te[Ve + 1] = Y, te[$ + 1] = ue, te[K + 2] = Se, te[Ve + 2] = he, te[$ + 2] = De, se[G] = Le + U, se[G + 1] = _e + U, se[G + 2] = Ee + U, B.faceidx += 3) : J === be - 1 ? (te[K] = j, te[ze] = ee, te[Ve] = ge, te[K + 1] = $e, te[ze + 1] = Re, te[Ve + 1] = Y, te[K + 2] = Se, te[ze + 2] = Fe, te[Ve + 2] = he, se[G] = Le + U, se[G + 1] = ae + U, se[G + 2] = _e + U, B.faceidx += 3) : (te[K] = j, te[ze] = ee, te[$] = ye, te[K + 1] = $e, te[ze + 1] = Re, te[$ + 1] = ue, te[K + 2] = Se, te[ze + 2] = Fe, te[$ + 2] = De, te[ze] = ee, te[Ve] = ge, te[$] = ye, te[ze + 1] = Re, te[Ve + 1] = Y, te[$ + 1] = ue, te[ze + 2] = Fe, te[Ve + 2] = he, te[$ + 2] = De, se[G] = Le + U, se[G + 1] = ae + U, se[G + 2] = Ee + U, se[G + 3] = ae + U, se[G + 4] = _e + U, se[G + 5] = Ee + U, B.faceidx += 6); } } - z.vertices += I; + B.vertices += I; } } - y.drawCylinder = c; - function C(s, o, w, p, v) { - if (!o || !w) + b.drawCylinder = c; + function S(s, o, A, p, v) { + if (!o || !A) return; v = v || { r: 0, g: 0, b: 0 }; - let a = new n.Vector3(w.x - o.x, w.y - o.y, w.z - o.z); + let a = new n.Vector3(A.x - o.x, A.y - o.y, A.z - o.z); var l = h(a.x, a.y, a.z); a = a.normalize(); - var g = E.basisVectors.length, M = E.basisVectors, L = g + 2, T = s.updateGeoGroup(L), D = T.vertices, I, z, P, B, k, N, $ = T.vertexArray, F = T.normalArray, G = T.colorArray, H = T.faceArray; - for (I = D * 3, $[I] = o.x, $[I + 1] = o.y, $[I + 2] = o.z, F[I] = -a.x, F[I + 1] = -a.y, F[I + 2] = -a.z, G[I] = v.r, G[I + 1] = v.g, G[I + 2] = v.b, $[I + 3] = w.x, $[I + 4] = w.y, $[I + 5] = w.z, F[I + 3] = a.x, F[I + 4] = a.y, F[I + 5] = a.z, G[I + 3] = v.r, G[I + 4] = v.g, G[I + 5] = v.b, I += 6, P = 0; P < g; ++P) { - var U = M[P].clone(); - U.multiplyScalar(p), B = l[0] * U.x + l[3] * U.y + l[6] * U.z, k = l[1] * U.x + l[4] * U.y + l[7] * U.z, N = l[5] * U.y + l[8] * U.z, $[I] = B + o.x, $[I + 1] = k + o.y, $[I + 2] = N + o.z, F[I] = B, F[I + 1] = k, F[I + 2] = N, G[I] = v.r, G[I + 1] = v.g, G[I + 2] = v.b, I += 3; + var g = E.basisVectors.length, M = E.basisVectors, C = g + 2, T = s.updateGeoGroup(C), D = T.vertices, I, B, P, z, k, N, R = T.vertexArray, U = T.normalArray, W = T.colorArray, G = T.faceArray; + for (I = D * 3, R[I] = o.x, R[I + 1] = o.y, R[I + 2] = o.z, U[I] = -a.x, U[I + 1] = -a.y, U[I + 2] = -a.z, W[I] = v.r, W[I + 1] = v.g, W[I + 2] = v.b, R[I + 3] = A.x, R[I + 4] = A.y, R[I + 5] = A.z, U[I + 3] = a.x, U[I + 4] = a.y, U[I + 5] = a.z, W[I + 3] = v.r, W[I + 4] = v.g, W[I + 5] = v.b, I += 6, P = 0; P < g; ++P) { + var F = M[P].clone(); + F.multiplyScalar(p), z = l[0] * F.x + l[3] * F.y + l[6] * F.z, k = l[1] * F.x + l[4] * F.y + l[7] * F.z, N = l[5] * F.y + l[8] * F.z, R[I] = z + o.x, R[I + 1] = k + o.y, R[I + 2] = N + o.z, U[I] = z, U[I + 1] = k, U[I + 2] = N, W[I] = v.r, W[I + 1] = v.g, W[I + 2] = v.b, I += 3; } - for (T.vertices += g + 2, z = T.faceidx, P = 0; P < g; P++) { - var V = D + 2 + P, Q = D + 2 + (P + 1) % g; - H[z] = V, H[z + 1] = Q, H[z + 2] = D, z += 3, H[z] = V, H[z + 1] = Q, H[z + 2] = D + 1, z += 3; + for (T.vertices += g + 2, B = T.faceidx, P = 0; P < g; P++) { + var V = D + 2 + P, J = D + 2 + (P + 1) % g; + G[B] = V, G[B + 1] = J, G[B + 2] = D, B += 3, G[B] = V, G[B + 1] = J, G[B + 2] = D + 1, B += 3; } T.faceidx += 6 * g; } - y.drawCone = C; - class b { + b.drawCone = S; + class y { constructor() { this.cache = /* @__PURE__ */ new Map(); } - getVerticesForRadius(o, w) { - w = w || 2, this.cache.has(w) || this.cache.set(w, /* @__PURE__ */ new Map()); - let p = this.cache.get(w); + getVerticesForRadius(o, A) { + A = A || 2, this.cache.has(A) || this.cache.set(A, /* @__PURE__ */ new Map()); + let p = this.cache.get(A); if (p.has(o)) return p.get(o); var v = { vertices: [], verticesRows: [], normals: [] - }, a = 16 * w, l = 10 * w; - o < 1 && (a = 10 * w, l = 8 * w); - var g = 0, M = Math.PI * 2, L = 0, T = Math.PI, D, I; + }, a = 16 * A, l = 10 * A; + o < 1 && (a = 10 * A, l = 8 * A); + var g = 0, M = Math.PI * 2, C = 0, T = Math.PI, D, I; for (I = 0; I <= l; I++) { let P = []; for (D = 0; D <= a; D++) { - let B = D / a, k = I / l, N = -o * Math.cos(g + B * M) * Math.sin(L + k * T), $ = o * Math.cos(L + k * T), F = o * Math.sin(g + B * M) * Math.sin(L + k * T); - var z = new n.Vector3(N, $, F); - z.normalize(), v.vertices.push({ x: N, y: $, z: F }), v.normals.push(z), P.push(v.vertices.length - 1); + let z = D / a, k = I / l, N = -o * Math.cos(g + z * M) * Math.sin(C + k * T), R = o * Math.cos(C + k * T), U = o * Math.sin(g + z * M) * Math.sin(C + k * T); + var B = new n.Vector3(N, R, U); + B.normalize(), v.vertices.push({ x: N, y: R, z: U }), v.normals.push(B), P.push(v.vertices.length - 1); } v.verticesRows.push(P); } return p.set(o, v), v; } } - var A = new b(); - function S(s, o, w, p, v) { - var a = A.getVerticesForRadius(w, v), l = a.vertices, g = a.normals, M = s.updateGeoGroup(l.length), L = M.vertices, T = M.vertexArray, D = M.colorArray, I = M.faceArray, z = M.lineArray, P = M.normalArray; - for (let N = 0, $ = l.length; N < $; ++N) { - let F = 3 * (L + N), G = l[N]; - T[F] = G.x + o.x, T[F + 1] = G.y + o.y, T[F + 2] = G.z + o.z, D[F] = p.r, D[F + 1] = p.g, D[F + 2] = p.b; + var w = new y(); + function L(s, o, A, p, v) { + var a = w.getVerticesForRadius(A, v), l = a.vertices, g = a.normals, M = s.updateGeoGroup(l.length), C = M.vertices, T = M.vertexArray, D = M.colorArray, I = M.faceArray, B = M.lineArray, P = M.normalArray; + for (let N = 0, R = l.length; N < R; ++N) { + let U = 3 * (C + N), W = l[N]; + T[U] = W.x + o.x, T[U + 1] = W.y + o.y, T[U + 2] = W.z + o.z, D[U] = p.r, D[U + 1] = p.g, D[U + 2] = p.b; } M.vertices += l.length; - let B = a.verticesRows, k = B.length - 1; + let z = a.verticesRows, k = z.length - 1; for (let N = 0; N < k; N++) { - let $ = B[N].length - 1; - for (let F = 0; F < $; F++) { - let G = M.faceidx, H = M.lineidx, U = B[N][F + 1] + L, V = U * 3, Q = B[N][F] + L, ae = Q * 3, oe = B[N + 1][F] + L, q = oe * 3, me = B[N + 1][F + 1] + L, ne = me * 3, fe = g[U - L], Ce = g[Q - L], Me = g[oe - L], Te = g[me - L]; - Math.abs(l[U - L].y) === w ? (P[V] = fe.x, P[q] = Me.x, P[ne] = Te.x, P[V + 1] = fe.y, P[q + 1] = Me.y, P[ne + 1] = Te.y, P[V + 2] = fe.z, P[q + 2] = Me.z, P[ne + 2] = Te.z, I[G] = U, I[G + 1] = oe, I[G + 2] = me, z[H] = U, z[H + 1] = oe, z[H + 2] = U, z[H + 3] = me, z[H + 4] = oe, z[H + 5] = me, M.faceidx += 3, M.lineidx += 6) : Math.abs(l[oe - L].y) === w ? (P[V] = fe.x, P[ae] = Ce.x, P[q] = Me.x, P[V + 1] = fe.y, P[ae + 1] = Ce.y, P[q + 1] = Me.y, P[V + 2] = fe.z, P[ae + 2] = Ce.z, P[q + 2] = Me.z, I[G] = U, I[G + 1] = Q, I[G + 2] = oe, z[H] = U, z[H + 1] = Q, z[H + 2] = U, z[H + 3] = oe, z[H + 4] = Q, z[H + 5] = oe, M.faceidx += 3, M.lineidx += 6) : (P[V] = fe.x, P[ae] = Ce.x, P[ne] = Te.x, P[V + 1] = fe.y, P[ae + 1] = Ce.y, P[ne + 1] = Te.y, P[V + 2] = fe.z, P[ae + 2] = Ce.z, P[ne + 2] = Te.z, P[ae] = Ce.x, P[q] = Me.x, P[ne] = Te.x, P[ae + 1] = Ce.y, P[q + 1] = Me.y, P[ne + 1] = Te.y, P[ae + 2] = Ce.z, P[q + 2] = Me.z, P[ne + 2] = Te.z, I[G] = U, I[G + 1] = Q, I[G + 2] = me, I[G + 3] = Q, I[G + 4] = oe, I[G + 5] = me, z[H] = U, z[H + 1] = Q, z[H + 2] = U, z[H + 3] = me, z[H + 4] = Q, z[H + 5] = oe, z[H + 6] = oe, z[H + 7] = me, M.faceidx += 6, M.lineidx += 8); + let R = z[N].length - 1; + for (let U = 0; U < R; U++) { + let W = M.faceidx, G = M.lineidx, F = z[N][U + 1] + C, V = F * 3, J = z[N][U] + C, X = J * 3, oe = z[N + 1][U] + C, te = oe * 3, ve = z[N + 1][U + 1] + C, se = ve * 3, le = g[F - C], Ce = g[J - C], be = g[oe - C], Le = g[ve - C]; + Math.abs(l[F - C].y) === A ? (P[V] = le.x, P[te] = be.x, P[se] = Le.x, P[V + 1] = le.y, P[te + 1] = be.y, P[se + 1] = Le.y, P[V + 2] = le.z, P[te + 2] = be.z, P[se + 2] = Le.z, I[W] = F, I[W + 1] = oe, I[W + 2] = ve, B[G] = F, B[G + 1] = oe, B[G + 2] = F, B[G + 3] = ve, B[G + 4] = oe, B[G + 5] = ve, M.faceidx += 3, M.lineidx += 6) : Math.abs(l[oe - C].y) === A ? (P[V] = le.x, P[X] = Ce.x, P[te] = be.x, P[V + 1] = le.y, P[X + 1] = Ce.y, P[te + 1] = be.y, P[V + 2] = le.z, P[X + 2] = Ce.z, P[te + 2] = be.z, I[W] = F, I[W + 1] = J, I[W + 2] = oe, B[G] = F, B[G + 1] = J, B[G + 2] = F, B[G + 3] = oe, B[G + 4] = J, B[G + 5] = oe, M.faceidx += 3, M.lineidx += 6) : (P[V] = le.x, P[X] = Ce.x, P[se] = Le.x, P[V + 1] = le.y, P[X + 1] = Ce.y, P[se + 1] = Le.y, P[V + 2] = le.z, P[X + 2] = Ce.z, P[se + 2] = Le.z, P[X] = Ce.x, P[te] = be.x, P[se] = Le.x, P[X + 1] = Ce.y, P[te + 1] = be.y, P[se + 1] = Le.y, P[X + 2] = Ce.z, P[te + 2] = be.z, P[se + 2] = Le.z, I[W] = F, I[W + 1] = J, I[W + 2] = ve, I[W + 3] = J, I[W + 4] = oe, I[W + 5] = ve, B[G] = F, B[G + 1] = J, B[G + 2] = F, B[G + 3] = ve, B[G + 4] = J, B[G + 5] = oe, B[G + 6] = oe, B[G + 7] = ve, M.faceidx += 6, M.lineidx += 8); } } } - y.drawSphere = S; + b.drawSphere = L; })(u || (u = {})); } ), @@ -4026,8 +4026,8 @@ void main() { !*** ./src/GLModel.ts ***! \************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ GLModel: () => ( /* binding */ @@ -4035,46 +4035,46 @@ void main() { ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), u = t( + ), u = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), y = t( + ), b = r( /*! ./colors */ "./src/colors.ts" - ), h = t( + ), h = r( /*! ./GLDraw */ "./src/GLDraw.ts" - ), _ = t( + ), _ = r( /*! ./glcartoon */ "./src/glcartoon.ts" - ), E = t( + ), E = r( /*! ./utilities */ "./src/utilities.ts" - ), c = t( + ), c = r( /*! ./Gradient */ "./src/Gradient.ts" - ), C = t( + ), S = r( /*! ./parsers */ "./src/parsers/index.ts" - ), b = t( + ), y = r( /*! netcdfjs */ "./node_modules/netcdfjs/lib-esm/index.js" - ), A = t( + ), w = r( /*! pako */ "./node_modules/pako/dist/pako.esm.mjs" - ), S = t( + ), L = r( /*! ./parsers/utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function s(w) { + function s(A) { let p; - return typeof w == "string" ? p = new TextEncoder().encode(w) : p = new Uint8Array(w), (0, A.inflate)(p, { + return typeof A == "string" ? p = new TextEncoder().encode(A) : p = new Uint8Array(A), (0, w.inflate)(p, { to: "string" }); } @@ -4085,7 +4085,7 @@ void main() { return p && v ? JSON.stringify(p) == JSON.stringify(v) : p == v; } constructor(p, v) { - this.atoms = [], this.frames = [], this.box = null, this.atomdfs = null, this.id = 0, this.hidden = !1, this.molObj = null, this.renderedMolObj = null, this.lastColors = null, this.modelData = {}, this.modelDatas = null, this.idMatrix = new u.Matrix4(), this.dontDuplicateAtoms = !0, this.defaultColor = y.elementColors.defaultColor, this.defaultStickRadius = 0.25, this.options = v || {}, this.ElementColors = this.options.defaultcolors ? this.options.defaultcolors : y.elementColors.defaultColors, this.defaultSphereRadius = this.options.defaultSphereRadius ? this.options.defaultSphereRadius : 1.5, this.defaultCartoonQuality = this.options.cartoonQuality ? this.options.cartoonQuality : 10, this.id = p; + this.atoms = [], this.frames = [], this.box = null, this.atomdfs = null, this.id = 0, this.hidden = !1, this.molObj = null, this.renderedMolObj = null, this.lastColors = null, this.modelData = {}, this.modelDatas = null, this.idMatrix = new u.Matrix4(), this.dontDuplicateAtoms = !0, this.defaultColor = b.elementColors.defaultColor, this.defaultStickRadius = 0.25, this.options = v || {}, this.ElementColors = this.options.defaultcolors ? this.options.defaultcolors : b.elementColors.defaultColors, this.defaultSphereRadius = this.options.defaultSphereRadius ? this.options.defaultSphereRadius : 1.5, this.defaultCartoonQuality = this.options.cartoonQuality ? this.options.cartoonQuality : 10, this.id = p; } // return proper radius for atom given style /** @@ -4119,7 +4119,7 @@ void main() { if (!a.hidden) { var l = a.linewidth || o.defaultlineWidth; v[l] || (v[l] = new n.Geometry()); - var g = v[l].updateGeoGroup(6), M = this.getRadiusFromStyle(p, a), L = [ + var g = v[l].updateGeoGroup(6), M = this.getRadiusFromStyle(p, a), C = [ [M, 0, 0], [-M, 0, 0], [0, M, 0], @@ -4128,10 +4128,10 @@ void main() { [0, 0, -M] ], T = p.clickable || p.hoverable; T && p.intersectionShape === void 0 && (p.intersectionShape = { sphere: [], cylinder: [], line: [] }); - for (var D = (0, E.getColorFromStyle)(p, a), I = g.vertexArray, z = g.colorArray, P = 0; P < 6; P++) { - var B = g.vertices * 3; - if (g.vertices++, I[B] = p.x + L[P][0], I[B + 1] = p.y + L[P][1], I[B + 2] = p.z + L[P][2], z[B] = D.r, z[B + 1] = D.g, z[B + 2] = D.b, T) { - var k = new u.Vector3(L[P][0], L[P][1], L[P][2]); + for (var D = (0, E.getColorFromStyle)(p, a), I = g.vertexArray, B = g.colorArray, P = 0; P < 6; P++) { + var z = g.vertices * 3; + if (g.vertices++, I[z] = p.x + C[P][0], I[z + 1] = p.y + C[P][1], I[z + 2] = p.z + C[P][2], B[z] = D.r, B[z + 1] = D.g, B[z + 2] = D.b, T) { + var k = new u.Vector3(C[P][0], C[P][1], C[P][2]); k.multiplyScalar(0.1), k.set(k.x + p.x, k.y + p.y, k.z + p.z), p.intersectionShape.line.push(k); } } @@ -4139,11 +4139,11 @@ void main() { } } getGoodCross(p, v, a, l) { - for (var g = null, M = -1, L = 0, T = p.bonds.length; L < T; L++) - if (p.bonds[L] != v.index) { - let I = p.bonds[L], z = this.atoms[I], B = new u.Vector3(z.x, z.y, z.z).clone(); - B.sub(a); - let k = B.clone(); + for (var g = null, M = -1, C = 0, T = p.bonds.length; C < T; C++) + if (p.bonds[C] != v.index) { + let I = p.bonds[C], B = this.atoms[I], z = new u.Vector3(B.x, B.y, B.z).clone(); + z.sub(a); + let k = z.clone(); k.cross(l); var D = k.lengthSq(); if (D > M && (M = D, g = k, M > 0.1)) @@ -4154,14 +4154,14 @@ void main() { //from atom, return a normalized vector v that is orthogonal and along which //it is appropraite to draw multiple bonds getSideBondV(p, v, a) { - var l, g, M, L, T, D = new u.Vector3(p.x, p.y, p.z), I = new u.Vector3(v.x, v.y, v.z), z = I.clone(), P = null; - if (z.sub(D), p.bonds.length === 1) - v.bonds.length === 1 ? (P = z.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (l = (a + 1) % v.bonds.length, g = v.bonds[l], M = this.atoms[g], L = new u.Vector3(M.x, M.y, M.z), T = L.clone(), T.sub(D), P = T.clone(), P.cross(z)); - else if (P = this.getGoodCross(p, v, D, z), P.lengthSq() < 0.01) { - var B = this.getGoodCross(v, p, D, z); - B != null && (P = B); + var l, g, M, C, T, D = new u.Vector3(p.x, p.y, p.z), I = new u.Vector3(v.x, v.y, v.z), B = I.clone(), P = null; + if (B.sub(D), p.bonds.length === 1) + v.bonds.length === 1 ? (P = B.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (l = (a + 1) % v.bonds.length, g = v.bonds[l], M = this.atoms[g], C = new u.Vector3(M.x, M.y, M.z), T = C.clone(), T.sub(D), P = T.clone(), P.cross(B)); + else if (P = this.getGoodCross(p, v, D, B), P.lengthSq() < 0.01) { + var z = this.getGoodCross(v, p, D, B); + z != null && (P = z); } - return P.lengthSq() < 0.01 && (P = z.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1), P.cross(z), P.normalize(), P; + return P.lengthSq() < 0.01 && (P = B.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1), P.cross(B), P.normalize(), P; } addLine(p, v, a, l, g, M) { p[a] = l.x, p[a + 1] = l.y, p[a + 2] = l.z, v[a] = M.r, v[a + 1] = M.g, v[a + 2] = M.b, p[a + 3] = g.x, p[a + 4] = g.y, p[a + 5] = g.z, v[a + 3] = M.r, v[a + 4] = M.g, v[a + 5] = M.b; @@ -4179,26 +4179,26 @@ void main() { if (p.style.line) { var l = p.style.line; if (!l.hidden) { - var g, M, L, T, D = l.linewidth || o.defaultlineWidth; + var g, M, C, T, D = l.linewidth || o.defaultlineWidth; a[D] || (a[D] = new n.Geometry()); - for (var I = a[D].updateGeoGroup(6 * p.bonds.length), z = I.vertexArray, P = I.colorArray, B = 0; B < p.bonds.length; B++) { - var k = p.bonds[B], N = v[k]; + for (var I = a[D].updateGeoGroup(6 * p.bonds.length), B = I.vertexArray, P = I.colorArray, z = 0; z < p.bonds.length; z++) { + var k = p.bonds[z], N = v[k]; if (N.style.line && !(p.index >= N.index)) { - var $ = new u.Vector3(p.x, p.y, p.z), F = new u.Vector3(N.x, N.y, N.z), G = $.clone().add(F).multiplyScalar(0.5), H = !1, U = p.clickable || p.hoverable, V = N.clickable || N.hoverable; - (U || V) && (U && (p.intersectionShape === void 0 && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), p.intersectionShape.line.push($), p.intersectionShape.line.push(G)), V && (N.intersectionShape === void 0 && (N.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), N.intersectionShape.line.push(G), N.intersectionShape.line.push(F))); - var Q = (0, E.getColorFromStyle)(p, p.style.line), ae = (0, E.getColorFromStyle)(N, N.style.line); - if (p.bondStyles && p.bondStyles[B]) { - var oe = p.bondStyles[B]; + var R = new u.Vector3(p.x, p.y, p.z), U = new u.Vector3(N.x, N.y, N.z), W = R.clone().add(U).multiplyScalar(0.5), G = !1, F = p.clickable || p.hoverable, V = N.clickable || N.hoverable; + (F || V) && (F && (p.intersectionShape === void 0 && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), p.intersectionShape.line.push(R), p.intersectionShape.line.push(W)), V && (N.intersectionShape === void 0 && (N.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), N.intersectionShape.line.push(W), N.intersectionShape.line.push(U))); + var J = (0, E.getColorFromStyle)(p, p.style.line), X = (0, E.getColorFromStyle)(N, N.style.line); + if (p.bondStyles && p.bondStyles[z]) { + var oe = p.bondStyles[z]; if (!oe.iswire) continue; - oe.singleBond && (H = !0), typeof oe.color1 < "u" && (Q = y.CC.color(oe.color1)), typeof oe.color2 < "u" && (ae = y.CC.color(oe.color2)); + oe.singleBond && (G = !0), typeof oe.color1 < "u" && (J = b.CC.color(oe.color1)), typeof oe.color2 < "u" && (X = b.CC.color(oe.color2)); } - var q = I.vertices * 3, me, ne; - if (p.bondOrder[B] > 1 && p.bondOrder[B] < 4 && !H) { - var fe = this.getSideBondV(p, N, B), Ce = F.clone(); - Ce.sub($), p.bondOrder[B] == 2 ? (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == ae ? (I.vertices += 4, this.addLine(z, P, q, g, L, Q), this.addLine(z, P, q + 6, M, T, Q)) : (I.vertices += 8, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), ne = M.clone(), ne.add(Ce), this.addLine(z, P, q, g, me, Q), this.addLine(z, P, q + 6, me, L, ae), this.addLine(z, P, q + 12, M, ne, Q), this.addLine(z, P, q + 18, ne, T, ae))) : p.bondOrder[B] == 3 && (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == ae ? (I.vertices += 6, this.addLine(z, P, q, $, F, Q), this.addLine(z, P, q + 6, g, L, Q), this.addLine(z, P, q + 12, M, T, Q)) : (I.vertices += 12, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), ne = M.clone(), ne.add(Ce), this.addLine(z, P, q, $, G, Q), this.addLine(z, P, q + 6, G, F, ae), this.addLine(z, P, q + 12, g, me, Q), this.addLine(z, P, q + 18, me, L, ae), this.addLine(z, P, q + 24, M, ne, Q), this.addLine(z, P, q + 30, ne, T, ae))); + var te = I.vertices * 3, ve, se; + if (p.bondOrder[z] > 1 && p.bondOrder[z] < 4 && !G) { + var le = this.getSideBondV(p, N, z), Ce = U.clone(); + Ce.sub(R), p.bondOrder[z] == 2 ? (le.multiplyScalar(0.1), g = R.clone(), g.add(le), M = R.clone(), M.sub(le), C = g.clone(), C.add(Ce), T = M.clone(), T.add(Ce), J == X ? (I.vertices += 4, this.addLine(B, P, te, g, C, J), this.addLine(B, P, te + 6, M, T, J)) : (I.vertices += 8, Ce.multiplyScalar(0.5), ve = g.clone(), ve.add(Ce), se = M.clone(), se.add(Ce), this.addLine(B, P, te, g, ve, J), this.addLine(B, P, te + 6, ve, C, X), this.addLine(B, P, te + 12, M, se, J), this.addLine(B, P, te + 18, se, T, X))) : p.bondOrder[z] == 3 && (le.multiplyScalar(0.1), g = R.clone(), g.add(le), M = R.clone(), M.sub(le), C = g.clone(), C.add(Ce), T = M.clone(), T.add(Ce), J == X ? (I.vertices += 6, this.addLine(B, P, te, R, U, J), this.addLine(B, P, te + 6, g, C, J), this.addLine(B, P, te + 12, M, T, J)) : (I.vertices += 12, Ce.multiplyScalar(0.5), ve = g.clone(), ve.add(Ce), se = M.clone(), se.add(Ce), this.addLine(B, P, te, R, W, J), this.addLine(B, P, te + 6, W, U, X), this.addLine(B, P, te + 12, g, ve, J), this.addLine(B, P, te + 18, ve, C, X), this.addLine(B, P, te + 24, M, se, J), this.addLine(B, P, te + 30, se, T, X))); } else - Q == ae ? (I.vertices += 2, this.addLine(z, P, q, $, F, Q)) : (I.vertices += 4, this.addLine(z, P, q, $, G, Q), this.addLine(z, P, q + 6, G, F, ae)); + J == X ? (I.vertices += 2, this.addLine(B, P, te, R, U, J)) : (I.vertices += 4, this.addLine(B, P, te, R, W, J), this.addLine(B, P, te + 6, W, U, X)); } } } @@ -4241,8 +4241,8 @@ void main() { if (p.style.sphere) { var a = p.style.sphere; if (!a.hidden) { - var l = this.getRadiusFromStyle(p, a), g = (0, E.getColorFromStyle)(p, a), M = v.updateGeoGroup(1), L = M.vertices, T = L * 3, D = M.vertexArray, I = M.colorArray, z = M.radiusArray; - if (D[T] = p.x, D[T + 1] = p.y, D[T + 2] = p.z, I[T] = g.r, I[T + 1] = g.g, I[T + 2] = g.b, z[L] = l, (p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { + var l = this.getRadiusFromStyle(p, a), g = (0, E.getColorFromStyle)(p, a), M = v.updateGeoGroup(1), C = M.vertices, T = C * 3, D = M.vertexArray, I = M.colorArray, B = M.radiusArray; + if (D[T] = p.x, D[T + 1] = p.y, D[T + 2] = p.z, I[T] = g.r, I[T + 1] = g.g, I[T + 2] = g.b, B[C] = l, (p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { var P = new u.Vector3(p.x, p.y, p.z); p.intersectionShape.sphere.push(new f.Sphere(P, l)); } @@ -4251,15 +4251,15 @@ void main() { } } drawSphereImposter(p, v, a, l) { - var g = p.updateGeoGroup(4), M, L = g.vertices, T = L * 3, D = g.vertexArray, I = g.colorArray; + var g = p.updateGeoGroup(4), M, C = g.vertices, T = C * 3, D = g.vertexArray, I = g.colorArray; for (M = 0; M < 4; M++) D[T + 3 * M] = v.x, D[T + 3 * M + 1] = v.y, D[T + 3 * M + 2] = v.z; - var z = g.normalArray; + var B = g.normalArray; for (M = 0; M < 4; M++) I[T + 3 * M] = l.r, I[T + 3 * M + 1] = l.g, I[T + 3 * M + 2] = l.b; - z[T + 0] = -a, z[T + 1] = a, z[T + 2] = 0, z[T + 3] = -a, z[T + 4] = -a, z[T + 5] = 0, z[T + 6] = a, z[T + 7] = -a, z[T + 8] = 0, z[T + 9] = a, z[T + 10] = a, z[T + 11] = 0, g.vertices += 4; - var P = g.faceArray, B = g.faceidx; - P[B + 0] = L, P[B + 1] = L + 1, P[B + 2] = L + 2, P[B + 3] = L + 2, P[B + 4] = L + 3, P[B + 5] = L, g.faceidx += 6; + B[T + 0] = -a, B[T + 1] = a, B[T + 2] = 0, B[T + 3] = -a, B[T + 4] = -a, B[T + 5] = 0, B[T + 6] = a, B[T + 7] = -a, B[T + 8] = 0, B[T + 9] = a, B[T + 10] = a, B[T + 11] = 0, g.vertices += 4; + var P = g.faceArray, z = g.faceidx; + P[z + 0] = C, P[z + 1] = C + 1, P[z + 2] = C + 2, P[z + 3] = C + 2, P[z + 4] = C + 3, P[z + 5] = C, g.faceidx += 6; } //dkoes - code for sphere imposters drawAtomImposter(p, v) { @@ -4276,61 +4276,61 @@ void main() { } } static drawStickImposter(p, v, a, l, g) { - for (var M = p.updateGeoGroup(4), L = M.vertices, T = L * 3, D = M.vertexArray, I = M.colorArray, z = M.radiusArray, P = M.normalArray, B = g.r, k = g.g, N = g.b, $ = function(V) { - var Q = -V; - return Q == 0 && (Q = -1e-4), Q; - }, F = T, G = 0; G < 4; G++) - D[F] = v.x, P[F] = a.x, I[F] = B, F++, D[F] = v.y, P[F] = a.y, I[F] = k, F++, D[F] = v.z, P[F] = a.z, G < 2 ? I[F] = N : I[F] = $(N), F++; - M.vertices += 4, z[L] = -l, z[L + 1] = l, z[L + 2] = -l, z[L + 3] = l; - var H = M.faceArray, U = M.faceidx; - H[U + 0] = L, H[U + 1] = L + 1, H[U + 2] = L + 2, H[U + 3] = L + 2, H[U + 4] = L + 3, H[U + 5] = L, M.faceidx += 6; + for (var M = p.updateGeoGroup(4), C = M.vertices, T = C * 3, D = M.vertexArray, I = M.colorArray, B = M.radiusArray, P = M.normalArray, z = g.r, k = g.g, N = g.b, R = function(V) { + var J = -V; + return J == 0 && (J = -1e-4), J; + }, U = T, W = 0; W < 4; W++) + D[U] = v.x, P[U] = a.x, I[U] = z, U++, D[U] = v.y, P[U] = a.y, I[U] = k, U++, D[U] = v.z, P[U] = a.z, W < 2 ? I[U] = N : I[U] = R(N), U++; + M.vertices += 4, B[C] = -l, B[C + 1] = l, B[C + 2] = -l, B[C + 3] = l; + var G = M.faceArray, F = M.faceidx; + G[F + 0] = C, G[F + 1] = C + 1, G[F + 2] = C + 2, G[F + 3] = C + 2, G[F + 4] = C + 3, G[F + 5] = C, M.faceidx += 6; } // draws cylinders and small spheres (at bond radius) drawBondSticks(p, v, a) { if (p.style.stick) { var l = p.style.stick; if (!l.hidden) { - var g = l.radius || this.defaultStickRadius, M = l.doubleBondScaling || 0.4, L = l.tripleBondScaling || 0.25, T = g, D = l.singleBonds || !1, I = 0, z = 0, P, B, k, N, $, F, G, H, U, V, Q, ae = (0, E.getColorFromStyle)(p, l), oe, q, me; + var g = l.radius || this.defaultStickRadius, M = l.doubleBondScaling || 0.4, C = l.tripleBondScaling || 0.25, T = g, D = l.singleBonds || !1, I = 0, B = 0, P, z, k, N, R, U, W, G, F, V, J, X = (0, E.getColorFromStyle)(p, l), oe, te, ve; !p.capDrawn && p.bonds.length < 4 && (I = 2); - var ne = h.GLDraw.drawCylinder; - for (a.imposter && (ne = o.drawStickImposter), k = 0; k < p.bonds.length; k++) { - var fe = p.bonds[k], Ce = v[fe]; - if (oe = q = me = null, p.index < Ce.index) { - var Me = Ce.style; - if (!Me.stick || Me.stick.hidden) + var se = h.GLDraw.drawCylinder; + for (a.imposter && (se = o.drawStickImposter), k = 0; k < p.bonds.length; k++) { + var le = p.bonds[k], Ce = v[le]; + if (oe = te = ve = null, p.index < Ce.index) { + var be = Ce.style; + if (!be.stick || be.stick.hidden) continue; - var Te = (0, E.getColorFromStyle)(Ce, Me.stick); + var Le = (0, E.getColorFromStyle)(Ce, be.stick); if (T = g, N = D, p.bondStyles && p.bondStyles[k]) { - if ($ = p.bondStyles[k], $.iswire) + if (R = p.bondStyles[k], R.iswire) continue; - $.radius && (T = $.radius), $.singleBond && (N = !0), typeof $.color1 < "u" && (ae = y.CC.color($.color1)), typeof $.color2 < "u" && (Te = y.CC.color($.color2)); + R.radius && (T = R.radius), R.singleBond && (N = !0), typeof R.color1 < "u" && (X = b.CC.color(R.color1)), typeof R.color2 < "u" && (Le = b.CC.color(R.color2)); } - var se = new u.Vector3(p.x, p.y, p.z), pe = new u.Vector3(Ce.x, Ce.y, Ce.z); + var ae = new u.Vector3(p.x, p.y, p.z), _e = new u.Vector3(Ce.x, Ce.y, Ce.z); if (p.bondOrder[k] <= 1 || N || p.bondOrder[k] > 3) { - if (p.bondOrder[k] < 1 && (T *= p.bondOrder[k]), !Ce.capDrawn && Ce.bonds.length < 4 && (z = 2), ae != Te ? (oe = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5), ne(a, se, oe, T, ae, I, 0), ne(a, oe, pe, T, Te, 0, z)) : ne(a, se, pe, T, ae, I, z), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, P || B) { - if (oe || (oe = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5)), P) { - var we = new f.Cylinder(se, oe, T), Fe = new f.Sphere(se, T); - p.intersectionShape.cylinder.push(we), p.intersectionShape.sphere.push(Fe); + if (p.bondOrder[k] < 1 && (T *= p.bondOrder[k]), !Ce.capDrawn && Ce.bonds.length < 4 && (B = 2), X != Le ? (oe = new u.Vector3().addVectors(ae, _e).multiplyScalar(0.5), se(a, ae, oe, T, X, I, 0), se(a, oe, _e, T, Le, 0, B)) : se(a, ae, _e, T, X, I, B), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, P || z) { + if (oe || (oe = new u.Vector3().addVectors(ae, _e).multiplyScalar(0.5)), P) { + var Ee = new f.Cylinder(ae, oe, T), Be = new f.Sphere(ae, T); + p.intersectionShape.cylinder.push(Ee), p.intersectionShape.sphere.push(Be); } - if (B) { - var Ue = new f.Cylinder(pe, oe, T), Ne = new f.Sphere(pe, T); - Ce.intersectionShape.cylinder.push(Ue), Ce.intersectionShape.sphere.push(Ne); + if (z) { + var Ne = new f.Cylinder(_e, oe, T), Ge = new f.Sphere(_e, T); + Ce.intersectionShape.cylinder.push(Ne), Ce.intersectionShape.sphere.push(Ge); } } } else if (p.bondOrder[k] > 1) { - var Be = 0, ue = 0; - T != g && (Be = 2, ue = 2); - var ye = pe.clone(), ge = null; - ye.sub(se); - var Se, ze, He, We, Y; - ge = this.getSideBondV(p, Ce, k), p.bondOrder[k] == 2 ? (Se = T * M, ge.multiplyScalar(Se * 1.5), ze = se.clone(), ze.add(ge), He = se.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), ae != Te ? (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5), q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5), ne(a, ze, oe, Se, ae, Be, 0), ne(a, oe, We, Se, Te, 0, ue), ne(a, He, q, Se, ae, Be, 0), ne(a, q, Y, Se, Te, 0, ue)) : (ne(a, ze, We, Se, ae, Be, ue), ne(a, He, Y, Se, ae, Be, ue)), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, (P || B) && (oe || (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5)), q || (q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5)), P && (F = new f.Cylinder(ze, oe, Se), G = new f.Cylinder(He, q, Se), p.intersectionShape.cylinder.push(F), p.intersectionShape.cylinder.push(G)), B && (U = new f.Cylinder(We, oe, Se), V = new f.Cylinder(Y, q, Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V)))) : p.bondOrder[k] == 3 && (Se = T * L, ge.cross(ye), ge.normalize(), ge.multiplyScalar(Se * 3), ze = se.clone(), ze.add(ge), He = se.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), ae != Te ? (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5), q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5), me = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5), ne(a, ze, oe, Se, ae, Be, 0), ne(a, oe, We, Se, Te, 0, ue), ne(a, se, me, Se, ae, I, 0), ne(a, me, pe, Se, Te, 0, z), ne(a, He, q, Se, ae, Be, 0), ne(a, q, Y, Se, Te, 0, ue)) : (ne(a, ze, We, Se, ae, Be, ue), ne(a, se, pe, Se, ae, I, z), ne(a, He, Y, Se, ae, Be, ue)), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, (P || B) && (oe || (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5)), q || (q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5)), me || (me = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5)), P && (F = new f.Cylinder(ze.clone(), oe.clone(), Se), G = new f.Cylinder(He.clone(), q.clone(), Se), H = new f.Cylinder(se.clone(), me.clone(), Se), p.intersectionShape.cylinder.push(F), p.intersectionShape.cylinder.push(G), p.intersectionShape.cylinder.push(H)), B && (U = new f.Cylinder(We.clone(), oe.clone(), Se), V = new f.Cylinder(Y.clone(), q.clone(), Se), Q = new f.Cylinder(pe.clone(), me.clone(), Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V), Ce.intersectionShape.cylinder.push(Q)))); + var ke = 0, pe = 0; + T != g && (ke = 2, pe = 2); + var de = _e.clone(), ce = null; + de.sub(ae); + var Ae, Oe, We, Ue, Z; + ce = this.getSideBondV(p, Ce, k), p.bondOrder[k] == 2 ? (Ae = T * M, ce.multiplyScalar(Ae * 1.5), Oe = ae.clone(), Oe.add(ce), We = ae.clone(), We.sub(ce), Ue = Oe.clone(), Ue.add(de), Z = We.clone(), Z.add(de), X != Le ? (oe = new u.Vector3().addVectors(Oe, Ue).multiplyScalar(0.5), te = new u.Vector3().addVectors(We, Z).multiplyScalar(0.5), se(a, Oe, oe, Ae, X, ke, 0), se(a, oe, Ue, Ae, Le, 0, pe), se(a, We, te, Ae, X, ke, 0), se(a, te, Z, Ae, Le, 0, pe)) : (se(a, Oe, Ue, Ae, X, ke, pe), se(a, We, Z, Ae, X, ke, pe)), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, (P || z) && (oe || (oe = new u.Vector3().addVectors(Oe, Ue).multiplyScalar(0.5)), te || (te = new u.Vector3().addVectors(We, Z).multiplyScalar(0.5)), P && (U = new f.Cylinder(Oe, oe, Ae), W = new f.Cylinder(We, te, Ae), p.intersectionShape.cylinder.push(U), p.intersectionShape.cylinder.push(W)), z && (F = new f.Cylinder(Ue, oe, Ae), V = new f.Cylinder(Z, te, Ae), Ce.intersectionShape.cylinder.push(F), Ce.intersectionShape.cylinder.push(V)))) : p.bondOrder[k] == 3 && (Ae = T * C, ce.cross(de), ce.normalize(), ce.multiplyScalar(Ae * 3), Oe = ae.clone(), Oe.add(ce), We = ae.clone(), We.sub(ce), Ue = Oe.clone(), Ue.add(de), Z = We.clone(), Z.add(de), X != Le ? (oe = new u.Vector3().addVectors(Oe, Ue).multiplyScalar(0.5), te = new u.Vector3().addVectors(We, Z).multiplyScalar(0.5), ve = new u.Vector3().addVectors(ae, _e).multiplyScalar(0.5), se(a, Oe, oe, Ae, X, ke, 0), se(a, oe, Ue, Ae, Le, 0, pe), se(a, ae, ve, Ae, X, I, 0), se(a, ve, _e, Ae, Le, 0, B), se(a, We, te, Ae, X, ke, 0), se(a, te, Z, Ae, Le, 0, pe)) : (se(a, Oe, Ue, Ae, X, ke, pe), se(a, ae, _e, Ae, X, I, B), se(a, We, Z, Ae, X, ke, pe)), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, (P || z) && (oe || (oe = new u.Vector3().addVectors(Oe, Ue).multiplyScalar(0.5)), te || (te = new u.Vector3().addVectors(We, Z).multiplyScalar(0.5)), ve || (ve = new u.Vector3().addVectors(ae, _e).multiplyScalar(0.5)), P && (U = new f.Cylinder(Oe.clone(), oe.clone(), Ae), W = new f.Cylinder(We.clone(), te.clone(), Ae), G = new f.Cylinder(ae.clone(), ve.clone(), Ae), p.intersectionShape.cylinder.push(U), p.intersectionShape.cylinder.push(W), p.intersectionShape.cylinder.push(G)), z && (F = new f.Cylinder(Ue.clone(), oe.clone(), Ae), V = new f.Cylinder(Z.clone(), te.clone(), Ae), J = new f.Cylinder(_e.clone(), ve.clone(), Ae), Ce.intersectionShape.cylinder.push(F), Ce.intersectionShape.cylinder.push(V), Ce.intersectionShape.cylinder.push(J)))); } } } - var K = !1, ee = 0, de = !1; + var j = !1, ee = 0, ge = !1; for (k = 0; k < p.bonds.length; k++) - N = D, p.bondStyles && p.bondStyles[k] && ($ = p.bondStyles[k], $.singleBond && (N = !0), $.radius && $.radius != g && (de = !0)), (N || p.bondOrder[k] == 1) && ee++; - de ? ee > 0 && (K = !0) : ee == 0 && (p.bonds.length > 0 || l.showNonBonded) && (K = !0), K && (T = g, a.imposter ? this.drawSphereImposter(a.sphereGeometry, p, T, ae) : h.GLDraw.drawSphere(a, p, T, ae)); + N = D, p.bondStyles && p.bondStyles[k] && (R = p.bondStyles[k], R.singleBond && (N = !0), R.radius && R.radius != g && (ge = !0)), (N || p.bondOrder[k] == 1) && ee++; + ge ? ee > 0 && (j = !0) : ee == 0 && (p.bonds.length > 0 || l.showNonBonded) && (j = !0), j && (T = g, a.imposter ? this.drawSphereImposter(a.sphereGeometry, p, T, X) : h.GLDraw.drawSphere(a, p, T, X)); } } } @@ -4342,79 +4342,79 @@ void main() { /** param {AtomSpec[]} atoms */ createMolObj(p, v) { v = v || {}; - var a = new n.Object3D(), l = [], g = {}, M = {}, L = this.drawAtomSphere, T = null, D = null; - v.supportsImposters ? (L = this.drawAtomImposter, T = new n.Geometry(!0), T.imposter = !0, D = new n.Geometry(!0, !0), D.imposter = !0, D.sphereGeometry = new n.Geometry(!0), D.sphereGeometry.imposter = !0, D.drawnCaps = {}) : v.supportsAIA ? (L = this.drawAtomInstanced, T = new n.Geometry(!1, !0, !0), T.instanced = !0, D = new n.Geometry(!0)) : (T = new n.Geometry(!0), D = new n.Geometry(!0)); - var I, z, P, B, k = {}, N = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; + var a = new n.Object3D(), l = [], g = {}, M = {}, C = this.drawAtomSphere, T = null, D = null; + v.supportsImposters ? (C = this.drawAtomImposter, T = new n.Geometry(!0), T.imposter = !0, D = new n.Geometry(!0, !0), D.imposter = !0, D.sphereGeometry = new n.Geometry(!0), D.sphereGeometry.imposter = !0, D.drawnCaps = {}) : v.supportsAIA ? (C = this.drawAtomInstanced, T = new n.Geometry(!1, !0, !0), T.instanced = !0, D = new n.Geometry(!0)) : (T = new n.Geometry(!0), D = new n.Geometry(!0)); + var I, B, P, z, k = {}, N = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; for (I = 0, P = p.length; I < P; I++) { - var $ = p[I]; - if ($ && $.style) { - ($.clickable || $.hoverable) && $.intersectionShape === void 0 && ($.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), B = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; - for (z in B) - $.style[z] ? $.style[z].opacity ? B[z] = parseFloat($.style[z].opacity) : B[z] = 1 : B[z] = void 0, k[z] ? B[z] != null && k[z] != B[z] && (console.log("Warning: " + z + " opacity is ambiguous"), k[z] = 1) : k[z] = B[z]; - L.call(this, $, T), this.drawAtomClickSphere($), this.drawAtomCross($, M), this.drawBondLines($, p, g), this.drawBondSticks($, p, D), typeof $.style.cartoon < "u" && !$.style.cartoon.hidden && ($.style.cartoon.color === "spectrum" && typeof $.resi == "number" && !$.hetflag && ($.resi < N[0] && (N[0] = $.resi), $.resi > N[1] && (N[1] = $.resi)), l.push($)); + var R = p[I]; + if (R && R.style) { + (R.clickable || R.hoverable) && R.intersectionShape === void 0 && (R.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), z = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; + for (B in z) + R.style[B] ? R.style[B].opacity ? z[B] = parseFloat(R.style[B].opacity) : z[B] = 1 : z[B] = void 0, k[B] ? z[B] != null && k[B] != z[B] && (console.log("Warning: " + B + " opacity is ambiguous"), k[B] = 1) : k[B] = z[B]; + C.call(this, R, T), this.drawAtomClickSphere(R), this.drawAtomCross(R, M), this.drawBondLines(R, p, g), this.drawBondSticks(R, p, D), typeof R.style.cartoon < "u" && !R.style.cartoon.hidden && (R.style.cartoon.color === "spectrum" && typeof R.resi == "number" && !R.hetflag && (R.resi < N[0] && (N[0] = R.resi), R.resi > N[1] && (N[1] = R.resi)), l.push(R)); } } if (l.length > 0 && (0, _.drawCartoon)(a, l, N, this.defaultCartoonQuality), T && T.vertices > 0) { T.initTypedArrays(); - var F = null, G = null; - T.imposter ? F = new n.SphereImposterMaterial({ + var U = null, W = null; + T.imposter ? U = new n.SphereImposterMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }) : T.instanced ? (G = new n.Geometry(!0), h.GLDraw.drawSphere(G, { x: 0, y: 0, z: 0 }, 1, new y.Color(0.5, 0.5, 0.5)), G.initTypedArrays(), F = new n.InstancedMaterial({ + }) : T.instanced ? (W = new n.Geometry(!0), h.GLDraw.drawSphere(W, { x: 0, y: 0, z: 0 }, 1, new b.Color(0.5, 0.5, 0.5)), W.initTypedArrays(), U = new n.InstancedMaterial({ sphereMaterial: new n.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 }), - sphere: G - })) : F = new n.MeshLambertMaterial({ + sphere: W + })) : U = new n.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }), k.sphere < 1 && k.sphere >= 0 && (F.transparent = !0, F.opacity = k.sphere), G = new n.Mesh(T, F), a.add(G); + }), k.sphere < 1 && k.sphere >= 0 && (U.transparent = !0, U.opacity = k.sphere), W = new n.Mesh(T, U), a.add(W); } if (D.vertices > 0) { - var H = null, U = null, V = D.sphereGeometry; + var G = null, F = null, V = D.sphereGeometry; (!V || typeof V.vertices > "u" || V.vertices == 0) && (V = null), D.initTypedArrays(), V && V.initTypedArrays(); - var Q = { ambient: 0, vertexColors: !0, reflectivity: 0 }; - D.imposter ? (H = new n.StickImposterMaterial(Q), U = new n.SphereImposterMaterial(Q)) : (H = new n.MeshLambertMaterial(Q), U = new n.MeshLambertMaterial(Q), H.wireframe && (D.setUpWireframe(), V && V.setUpWireframe())), k.stick < 1 && k.stick >= 0 && (H.transparent = !0, H.opacity = k.stick, U.transparent = !0, U.opacity = k.stick); - var ae = new n.Mesh(D, H); - if (a.add(ae), V) { - var oe = new n.Mesh(V, U); + var J = { ambient: 0, vertexColors: !0, reflectivity: 0 }; + D.imposter ? (G = new n.StickImposterMaterial(J), F = new n.SphereImposterMaterial(J)) : (G = new n.MeshLambertMaterial(J), F = new n.MeshLambertMaterial(J), G.wireframe && (D.setUpWireframe(), V && V.setUpWireframe())), k.stick < 1 && k.stick >= 0 && (G.transparent = !0, G.opacity = k.stick, F.transparent = !0, F.opacity = k.stick); + var X = new n.Mesh(D, G); + if (a.add(X), V) { + var oe = new n.Mesh(V, F); a.add(oe); } } - var q; + var te; for (I in g) if (g.hasOwnProperty(I)) { - q = I; - var me = new n.LineBasicMaterial({ - linewidth: q, + te = I; + var ve = new n.LineBasicMaterial({ + linewidth: te, vertexColors: !0 }); - k.line < 1 && k.line >= 0 && (me.transparent = !0, me.opacity = k.line), g[I].initTypedArrays(); - var ne = new n.Line(g[I], me, n.LineStyle.LinePieces); - a.add(ne); + k.line < 1 && k.line >= 0 && (ve.transparent = !0, ve.opacity = k.line), g[I].initTypedArrays(); + var se = new n.Line(g[I], ve, n.LineStyle.LinePieces); + a.add(se); } for (I in M) if (M.hasOwnProperty(I)) { - q = I; - var fe = new n.LineBasicMaterial({ - linewidth: q, + te = I; + var le = new n.LineBasicMaterial({ + linewidth: te, vertexColors: !0 }); - k.cross < 1 && k.cross >= 0 && (fe.transparent = !0, fe.opacity = k.cross), M[I].initTypedArrays(); - var Ce = new n.Line(M[I], fe, n.LineStyle.LinePieces); + k.cross < 1 && k.cross >= 0 && (le.transparent = !0, le.opacity = k.cross), M[I].initTypedArrays(); + var Ce = new n.Line(M[I], le, n.LineStyle.LinePieces); a.add(Ce); } if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) { - var Me = new n.Object3D(), Te; - for (Te = 0; Te < this.modelData.symmetries.length; Te++) { - var se = new n.Object3D(); - se = a.clone(), se.matrix.copy(this.modelData.symmetries[Te]), se.matrixAutoUpdate = !1, Me.add(se); + var be = new n.Object3D(), Le; + for (Le = 0; Le < this.modelData.symmetries.length; Le++) { + var ae = new n.Object3D(); + ae = a.clone(), ae.matrix.copy(this.modelData.symmetries[Le]), ae.matrixAutoUpdate = !1, be.add(ae); } - return Me; + return be; } return a; } @@ -4464,7 +4464,7 @@ void main() { */ setCrystData(p, v, a, l, g, M) { p = p || 1, v = v || 1, a = a || 1, l = l || 90, g = g || 90, M = M || 90; - const L = (0, u.conversionMatrix3)(p, v, a, l, g, M); + const C = (0, u.conversionMatrix3)(p, v, a, l, g, M); this.modelData.cryst = { a: p, b: v, @@ -4472,7 +4472,7 @@ void main() { alpha: l, beta: g, gamma: M, - matrix: L + matrix: C }; } /** @@ -4531,10 +4531,10 @@ void main() { //attoms aren't split across the box adjustCoordinatesToBox() { if (this.box && this.atomdfs) - for (var p = this.box[0], v = this.box[1], a = this.box[2], l = p * 0.9, g = v * 0.9, M = a * 0.9, L = 0; L < this.atomdfs.length; L++) - for (var T = this.atomdfs[L], D = 1; D < T.length; D++) { - var I = this.atoms[T[D][0]], z = this.atoms[T[D][1]]; - I.x = this.adjustCoord(z.x, I.x, l, p), I.y = this.adjustCoord(z.y, I.y, g, v), I.z = this.adjustCoord(z.z, I.z, M, a); + for (var p = this.box[0], v = this.box[1], a = this.box[2], l = p * 0.9, g = v * 0.9, M = a * 0.9, C = 0; C < this.atomdfs.length; C++) + for (var T = this.atomdfs[C], D = 1; D < T.length; D++) { + var I = this.atoms[T[D][0]], B = this.atoms[T[D][1]]; + I.x = this.adjustCoord(B.x, I.x, l, p), I.y = this.adjustCoord(B.y, I.y, g, v), I.z = this.adjustCoord(B.z, I.z, M, a); } } /** @@ -4549,10 +4549,10 @@ void main() { let l = this; return new Promise(function(g, M) { if (a == 0 && g(), (p < 0 || p >= a) && (p = a - 1), l.frames.url != null) { - var L = l.frames.url; - (0, E.getbin)(L + "/traj/frame/" + p + "/" + l.frames.path, void 0, "POST", void 0).then(function(T) { - for (var D = new Float32Array(T, 44), I = 0, z = 0; z < l.atoms.length; z++) - l.atoms[z].x = D[I++], l.atoms[z].y = D[I++], l.atoms[z].z = D[I++]; + var C = l.frames.url; + (0, E.getbin)(C + "/traj/frame/" + p + "/" + l.frames.path, void 0, "POST", void 0).then(function(T) { + for (var D = new Float32Array(T, 44), I = 0, B = 0; B < l.atoms.length; B++) + l.atoms[B].x = D[I++], l.atoms[B].y = D[I++], l.atoms[B].z = D[I++]; l.box && l.atomdfs && l.adjustCoordinatesToBox(), g(); }).catch(M); } else @@ -4589,27 +4589,27 @@ void main() { }); */ vibrate(p = 10, v = 1, a = !1, l, g) { - var M = 0, L = p; - a && (M = -p, L = p), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), M < L && (this.frames = []), a && (this.frames.origIndex = p); - for (var T = M; T < L; T++) { + var M = 0, C = p; + a && (M = -p, C = p), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), M < C && (this.frames = []), a && (this.frames.origIndex = p); + for (var T = M; T < C; T++) { var D = [], I = this.frames.length; if (T == 0 && !g) { this.frames.push(this.atoms); continue; } - for (var z = 0; z < this.atoms.length; z++) { - var P = (0, E.getAtomProperty)(this.atoms[z], "dx"), B = (0, E.getAtomProperty)(this.atoms[z], "dy"), k = (0, E.getAtomProperty)(this.atoms[z], "dz"), N = new u.Vector3(P, B, k), $ = new u.Vector3(this.atoms[z].x, this.atoms[z].y, this.atoms[z].z), F = T * v / p; - N.multiplyScalar(F), $.add(N); - var G = {}; - for (var H in this.atoms[z]) - G[H] = this.atoms[z][H]; - if (G.x = $.x, G.y = $.y, G.z = $.z, D.push(G), l && g) { - var U = (0, E.extend)({}, g), V = new u.Vector3(P, B, k); - if (V.multiplyScalar(v), V.add($), U.start = $, U.end = V, U.frame = I, !U.color) { - var Q = G.style.sphere; - Q || (Q = G.style.stick), Q || (Q = G.style.line), U.color = (0, E.getColorFromStyle)(G, Q); + for (var B = 0; B < this.atoms.length; B++) { + var P = (0, E.getAtomProperty)(this.atoms[B], "dx"), z = (0, E.getAtomProperty)(this.atoms[B], "dy"), k = (0, E.getAtomProperty)(this.atoms[B], "dz"), N = new u.Vector3(P, z, k), R = new u.Vector3(this.atoms[B].x, this.atoms[B].y, this.atoms[B].z), U = T * v / p; + N.multiplyScalar(U), R.add(N); + var W = {}; + for (var G in this.atoms[B]) + W[G] = this.atoms[B][G]; + if (W.x = R.x, W.y = R.y, W.z = R.z, D.push(W), l && g) { + var F = (0, E.extend)({}, g), V = new u.Vector3(P, z, k); + if (V.multiplyScalar(v), V.add(R), F.start = R, F.end = V, F.frame = I, !F.color) { + var J = W.style.sphere; + J || (J = W.style.stick), J || (J = W.style.line), F.color = (0, E.getColorFromStyle)(W, J); } - l.addArrow(U); + l.addArrow(F); } } this.frames.push(D); @@ -4633,17 +4633,17 @@ void main() { this.dontDuplicateAtoms = !a.duplicateAssemblyAtoms; var g = l.modelData; if (g && (Array.isArray(g) ? (this.modelData = g[0], a.frames && (this.modelDatas = g)) : this.modelData = g), l.box ? this.box = l.box : this.box = null, this.frames.length == 0) { - for (let L = 0; L < l.length; L++) - l[L].length != 0 && this.frames.push(l[L]); + for (let C = 0; C < l.length; C++) + l[C].length != 0 && this.frames.push(l[C]); this.frames[0] && (this.atoms = this.frames[0]); } else if (a.frames) - for (let L = 0; L < l.length; L++) - this.frames.push(l[L]); + for (let C = 0; C < l.length; C++) + this.frames.push(l[C]); else for (var M = 0; M < l.length; M++) this.addAtoms(l[M]); - for (let L = 0; L < this.frames.length; L++) - this.setAtomDefaults(this.frames[L]); + for (let C = 0; C < this.frames.length; C++) + this.setAtomDefaults(this.frames[C]); a.vibrate && a.vibrate.frames && a.vibrate.amplitude && this.vibrate(a.vibrate.frames, a.vibrate.amplitude), a.style && this.setStyle({}, a.style); } setDontDuplicateAtoms(p) { @@ -4688,29 +4688,29 @@ void main() { typeof g == "object" && l != "properties" && l != "model" ? a[l] = o.deepCopyAndCache(g, v) : a[l] = g; if (l == "and" || l == "or") { const M = []; - for (const L of a[l]) { + for (const C of a[l]) { const T = /* @__PURE__ */ new Set(); - for (const D of v.selectedAtoms(L)) + for (const D of v.selectedAtoms(C)) T.add(D.index); M.push(T); } if (l == "and") { - const L = function(D, I) { - const z = /* @__PURE__ */ new Set(); + const C = function(D, I) { + const B = /* @__PURE__ */ new Set(); for (const P of I) - D.has(P) && z.add(P); - return z; + D.has(P) && B.add(P); + return B; }; let T = new Set(M[0]); for (const D of M.splice(1)) - T = L(T, D); + T = C(T, D); a[l].__cached_results = T; } else if (l == "or") { - const L = /* @__PURE__ */ new Set(); + const C = /* @__PURE__ */ new Set(); for (const T of M) for (const D of T) - L.add(D); - a[l].__cached_results = L; + C.add(D); + a[l].__cached_results = C; } } } @@ -4758,7 +4758,7 @@ void main() { l = !1; break; } - var L = !1; + var C = !1; if (g === "bonds") { var T = v[g]; if (T != p.bonds.length) { @@ -4767,18 +4767,18 @@ void main() { } } else if (Array.isArray(v[g])) { var D = v[g], I = p[g]; - for (let z = 0; z < D.length; z++) - if (this.propertyMatches(I, D[z])) { - L = !0; + for (let B = 0; B < D.length; B++) + if (this.propertyMatches(I, D[B])) { + C = !0; break; } - if (!L) { + if (!C) { l = !1; break; } } else { - let z = v[g]; - if (!this.propertyMatches(p[g], z)) { + let B = v[g]; + if (!this.propertyMatches(p[g], B)) { l = !1; break; } @@ -4806,8 +4806,8 @@ void main() { l[0][g] = a[0][g] - v, l[1][g] = a[1][g] + v, l[2][g] = a[2][g]; var M = []; for (let I = 0; I < this.atoms.length; I++) { - var L = this.atoms[I].x, T = this.atoms[I].y, D = this.atoms[I].z; - L >= l[0][0] && L <= l[1][0] && T >= l[0][1] && T <= l[1][1] && D >= l[0][2] && D <= l[1][2] && (L >= a[0][0] && L <= a[1][0] && T >= a[0][1] && T <= a[1][1] && D >= a[0][2] && D <= a[1][2] || M.push(this.atoms[I])); + var C = this.atoms[I].x, T = this.atoms[I].y, D = this.atoms[I].z; + C >= l[0][0] && C <= l[1][0] && T >= l[0][1] && T <= l[1][1] && D >= l[0][2] && D <= l[1][2] && (C >= a[0][0] && C <= a[1][0] && T >= a[0][1] && T <= a[1][1] && D >= a[0][2] && D <= a[1][2] || M.push(this.atoms[I])); } return M; } @@ -4836,44 +4836,44 @@ void main() { M && this.atomIsSelected(M, p) && a.push(M); } if (p.hasOwnProperty("expand")) { - const G = o.getFloat(p.expand); - let H = this.expandAtomList(a, G), U = a.length; - const V = G * G; - for (let Q = 0; Q < H.length; Q++) - for (let ae = 0; ae < U; ae++) { - var L = o.squaredDistance(H[Q], a[ae]); - L < V && L > 0 && a.push(H[Q]); + const W = o.getFloat(p.expand); + let G = this.expandAtomList(a, W), F = a.length; + const V = W * W; + for (let J = 0; J < G.length; J++) + for (let X = 0; X < F; X++) { + var C = o.squaredDistance(G[J], a[X]); + C < V && C > 0 && a.push(G[J]); } } if (p.hasOwnProperty("within") && p.within.hasOwnProperty("sel") && p.within.hasOwnProperty("distance")) { var T = this.selectedAtoms(p.within.sel, this.atoms), D = {}; - const G = o.getFloat(p.within.distance), H = G * G; - for (let U = 0; U < T.length; U++) + const W = o.getFloat(p.within.distance), G = W * W; + for (let F = 0; F < T.length; F++) for (let V = 0; V < a.length; V++) { - let Q = o.squaredDistance(T[U], a[V]); - Q < H && Q > 0 && (D[V] = 1); + let J = o.squaredDistance(T[F], a[V]); + J < G && J > 0 && (D[V] = 1); } var I = []; if (p.within.invert) - for (let U = 0; U < a.length; U++) - D[U] || I.push(a[U]); + for (let F = 0; F < a.length; F++) + D[F] || I.push(a[F]); else - for (let U in D) - I.push(a[U]); + for (let F in D) + I.push(a[F]); a = I; } if (p.hasOwnProperty("byres")) { - var z = {}, P = [], B = []; - for (let G = 0; G < a.length; G++) { - let H = a[G]; - var k = H.chain, N = H.resi; - if (z[k] === void 0 && (z[k] = {}), H.hasOwnProperty("resi") && z[k][N] === void 0) { - for (z[k][N] = !0, B.push(H); B.length > 0; ) - if (H = B.pop(), k = H.chain, N = H.resi, P[H.index] === void 0) { - P[H.index] = !0; - for (var $ = 0; $ < H.bonds.length; $++) { - var F = this.atoms[H.bonds[$]]; - P[F.index] === void 0 && F.hasOwnProperty("resi") && F.chain == k && F.resi == N && (B.push(F), a.push(F)); + var B = {}, P = [], z = []; + for (let W = 0; W < a.length; W++) { + let G = a[W]; + var k = G.chain, N = G.resi; + if (B[k] === void 0 && (B[k] = {}), G.hasOwnProperty("resi") && B[k][N] === void 0) { + for (B[k][N] = !0, z.push(G); z.length > 0; ) + if (G = z.pop(), k = G.chain, N = G.resi, P[G.index] === void 0) { + P[G.index] = !0; + for (var R = 0; R < G.bonds.length; R++) { + var U = this.atoms[G.bonds[R]]; + P[U.index] === void 0 && U.hasOwnProperty("resi") && U.chain == k && U.resi == N && (z.push(U), a.push(U)); } } } @@ -4900,13 +4900,13 @@ void main() { for (l = 0; l < p.length; l++) typeof p[l].index > "u" && (p[l].index = l), typeof p[l].serial > "u" && (p[l].serial = l), a[p[l].index] = v + l; for (l = 0; l < p.length; l++) { - var g = p[l], M = a[g.index], L = (0, E.extend)({}, g); - L.index = M, L.bonds = [], L.bondOrder = [], L.model = this.id, L.style = L.style || (0, E.deepCopy)(o.defaultAtomStyle), typeof L.color > "u" && (L.color = this.ElementColors[L.elem] || this.defaultColor); + var g = p[l], M = a[g.index], C = (0, E.extend)({}, g); + C.index = M, C.bonds = [], C.bondOrder = [], C.model = this.id, C.style = C.style || (0, E.deepCopy)(o.defaultAtomStyle), typeof C.color > "u" && (C.color = this.ElementColors[C.elem] || this.defaultColor); for (var T = g.bonds ? g.bonds.length : 0, D = 0; D < T; D++) { var I = a[g.bonds[D]]; - typeof I < "u" && (L.bonds.push(I), L.bondOrder.push(g.bondOrder ? g.bondOrder[D] : 1)); + typeof I < "u" && (C.bonds.push(I), C.bondOrder.push(g.bondOrder ? g.bondOrder[D] : 1)); } - this.atoms.push(L); + this.atoms.push(C); } } /** Assign bonds based on atomic coordinates. @@ -4914,7 +4914,7 @@ void main() { * consider valence constraints and will only create single bonds. */ assignBonds() { - (0, S.assignBonds)(this.atoms); + (0, L.assignBonds)(this.atoms); } /** Remove specified atoms from model * @@ -4960,8 +4960,8 @@ void main() { T[I] && (T[I].capDrawn = !1); for (let I = 0; I < D.length; I++) { l = !0, (D[I].clickable || D[I].hoverable) && (D[I].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), a || (D[I].style = {}); - for (let z in v) - v.hasOwnProperty(z) && (D[I].style[z] = D[I].style[z] || {}, Object.assign(D[I].style[z], v[z])); + for (let B in v) + v.hasOwnProperty(B) && (D[I].style[B] = D[I].style[B] || {}, Object.assign(D[I].style[B], v[B])); } }; if (p.frame !== void 0 && p.frame < this.frames.length) { @@ -4969,8 +4969,8 @@ void main() { T < 0 && (T = this.frames.length + T), M(this.frames[T]); } else { M(this.atoms); - for (var L = 0; L < this.frames.length; L++) - this.frames[L] !== this.atoms && M(this.frames[L]); + for (var C = 0; C < this.frames.length; C++) + this.frames[C] !== this.atoms && M(this.frames[C]); } l && (this.molObj = null); } @@ -5008,8 +5008,8 @@ void main() { return; } var g = this.selectedAtoms(p, this.atoms), M = g.length; - for (let L = 0; L < M; L++) - g[L].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[L].hoverable = v, a && (g[L].hover_callback = a), l && (g[L].unhover_callback = l); + for (let C = 0; C < M; C++) + g[C].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[C].hoverable = v, a && (g[C].hover_callback = a), l && (g[C].unhover_callback = l); M > 0 && (this.molObj = null); } /** enable context menu of selected atoms @@ -5046,9 +5046,9 @@ void main() { * @param {Gradient|string} scheme */ setColorByProperty(p, v, a, l) { - var g, M, L = this.selectedAtoms(p, L); - for (this.lastColors = null, L.length > 0 && (this.molObj = null), typeof a == "string" && typeof c.Gradient.builtinGradients[a] < "u" && (a = new c.Gradient.builtinGradients[a]()), a = a, l || (l = a.range()), l || (l = (0, E.getPropertyRange)(L, v)), g = 0; g < L.length; g++) { - M = L[g]; + var g, M, C = this.selectedAtoms(p, C); + for (this.lastColors = null, C.length > 0 && (this.molObj = null), typeof a == "string" && typeof c.Gradient.builtinGradients[a] < "u" && (a = new c.Gradient.builtinGradients[a]()), a = a, l || (l = a.range()), l || (l = (0, E.getPropertyRange)(C, v)), g = 0; g < C.length; g++) { + M = C[g]; var T = (0, E.getAtomProperty)(M, v); T != null && (M.color = a.valueToHex(parseFloat(M.properties[v]), l)); } @@ -5096,15 +5096,15 @@ void main() { a === v.s.length && v.s.push(M.style), a !== 0 && (g.s = a); } v.a.push(g); - for (let L = 0; L < M.bonds.length; L++) { - let T = l, D = M.bonds[L]; + for (let C = 0; C < M.bonds.length; C++) { + let T = l, D = M.bonds[C]; if (T >= D) continue; let I = { b: T, e: D - }, z = M.bondOrder[L]; - z != 1 && (I.o = z), v.b.push(I); + }, B = M.bondOrder[C]; + B != 1 && (I.o = B), v.b.push(I); } } return v; @@ -5170,8 +5170,8 @@ void main() { * @param {LabelSpec} options */ addPropertyLabels(p, v, a, l) { - for (var g = this.selectedAtoms(v, g), M = (0, E.deepCopy)(l), L = 0; L < g.length; L++) { - var T = g[L], D = null; + for (var g = this.selectedAtoms(v, g), M = (0, E.deepCopy)(l), C = 0; C < g.length; C++) { + var T = g[C], D = null; typeof T[p] < "u" ? D = String(T[p]) : typeof T.properties[p] < "u" && (D = String(T.properties[p])), D != null && (M.position = T, a.addLabel(D, M)); } } @@ -5186,31 +5186,31 @@ void main() { */ addResLabels(p, v, a, l = !1) { var g = [], M = function(T, D) { - for (var I = T.selectedAtoms(p, I), z = {}, P = 0; P < I.length; P++) { - var B = I[P], k = B.chain, N = B.resn, $ = B.resi, F = N + "" + $; - z[k] || (z[k] = {}), z[k][F] || (z[k][F] = []), z[k][F].push(B); + for (var I = T.selectedAtoms(p, I), B = {}, P = 0; P < I.length; P++) { + var z = I[P], k = z.chain, N = z.resn, R = z.resi, U = N + "" + R; + B[k] || (B[k] = {}), B[k][U] || (B[k][U] = []), B[k][U].push(z); } - var G = (0, E.deepCopy)(a); - for (let U in z) - if (z.hasOwnProperty(U)) { - var H = z[U]; - for (let V in H) - if (H.hasOwnProperty(V)) { - let Q = H[V], ae = new u.Vector3(0, 0, 0); - for (let q = 0; q < Q.length; q++) { - let me = Q[q]; - ae.x += me.x, ae.y += me.y, ae.z += me.z; + var W = (0, E.deepCopy)(a); + for (let F in B) + if (B.hasOwnProperty(F)) { + var G = B[F]; + for (let V in G) + if (G.hasOwnProperty(V)) { + let J = G[V], X = new u.Vector3(0, 0, 0); + for (let te = 0; te < J.length; te++) { + let ve = J[te]; + X.x += ve.x, X.y += ve.y, X.z += ve.z; } - ae.divideScalar(Q.length), G.position = ae, G.frame = D; - let oe = v.addLabel(V, G, void 0, !0); + X.divideScalar(J.length), W.position = X, W.frame = D; + let oe = v.addLabel(V, W, void 0, !0); g.push(oe); } } }; if (l) { - var L = this.getNumFrames(); + var C = this.getNumFrames(); let T = this.atoms; - for (let D = 0; D < L; D++) + for (let D = 0; D < C; D++) this.frames[D] && (this.atoms = this.frames[D], M(this, D)); this.atoms = T; } else @@ -5222,13 +5222,13 @@ void main() { this.atomdfs = []; var p = this, v = new Int8Array(this.atoms.length); v.fill(0); - for (var a = function(L, T, D) { - D.push([L, T]); - var I = p.atoms[L]; - v[L] = 1; - for (var z = 0; z < I.bonds.length; z++) { - var P = I.bonds[z]; - p.atoms[P] && !v[P] && a(P, L, D); + for (var a = function(C, T, D) { + D.push([C, T]); + var I = p.atoms[C]; + v[C] = 1; + for (var B = 0; B < I.bonds.length; B++) { + var P = I.bonds[B]; + p.atoms[P] && !v[P] && a(P, C, D); } }, l = 0; l < this.atoms.length; l++) { var g = this.atoms[l]; @@ -5273,21 +5273,21 @@ void main() { v = v.replace(/\.gz$/, ""); try { p = s(p); - } catch (z) { - console.log(z); + } catch (B) { + console.log(B); } } var a = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" }; if (a.hasOwnProperty(v)) { this.frames = []; for (var l = this.atoms.length, g = o.parseCrd(p, v), M = 0; M < g.length; ) { - for (var L = [], T = 0; T < l; T++) { + for (var C = [], T = 0; T < l; T++) { var D = {}; for (var I in this.atoms[T]) D[I] = this.atoms[T][I]; - L[T] = D, L[T].x = g[M++], L[T].y = g[M++], L[T].z = g[M++]; + C[T] = D, C[T].x = g[M++], C[T].y = g[M++], C[T].z = g[M++]; } - this.frames.push(L); + this.frames.push(C); } return this.atoms = this.frames[0], this.frames; } @@ -5322,16 +5322,16 @@ TER` && (g = p.indexOf(` ATOM`, g); } else if (v == "netcdf") { - var M = new b.NetCDFReader(p); + var M = new y.NetCDFReader(p); a = [].concat.apply([], M.getDataVariable("coordinates")); } else { if (v == "array" || Array.isArray(p)) return p.flat(2); { - let L = p.indexOf(` + let C = p.indexOf(` `); - v == "inpcrd" && (L = p.indexOf(` -`, L + 1)), p = p.slice(L + 1), a = p.match(/\S+/g).map(parseFloat); + v == "inpcrd" && (C = p.indexOf(` +`, C + 1)), p = p.slice(C + 1), a = p.match(/\S+/g).map(parseFloat); } } return a; @@ -5347,8 +5347,8 @@ ATOM`, g); console.log(M); } } - typeof C.Parsers[v] > "u" && (v = v.split(".").pop(), typeof C.Parsers[v] > "u" && (console.log("Unknown format: " + v), p instanceof Uint8Array ? v = "mmtf" : p.match(/^@MOLECULE/gm) ? v = "mol2" : p.match(/^data_/gm) && p.match(/^loop_/gm) ? v = "cif" : p.match(/^HETATM/gm) || p.match(/^ATOM/gm) ? v = "pdb" : p.match(/ITEM: TIMESTEP/gm) ? v = "lammpstrj" : p.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm) ? v = "sdf" : p.match(/^%VERSION\s+VERSION_STAMP/gm) ? v = "prmtop" : v = "xyz", console.log("Best guess: " + v))); - var l = C.Parsers[v], g = l(p, a); + typeof S.Parsers[v] > "u" && (v = v.split(".").pop(), typeof S.Parsers[v] > "u" && (console.log("Unknown format: " + v), p instanceof Uint8Array ? v = "mmtf" : p.match(/^@MOLECULE/gm) ? v = "mol2" : p.match(/^data_/gm) && p.match(/^loop_/gm) ? v = "cif" : p.match(/^HETATM/gm) || p.match(/^ATOM/gm) ? v = "pdb" : p.match(/ITEM: TIMESTEP/gm) ? v = "lammpstrj" : p.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm) ? v = "sdf" : p.match(/^%VERSION\s+VERSION_STAMP/gm) ? v = "prmtop" : v = "xyz", console.log("Best guess: " + v))); + var l = S.Parsers[v], g = l(p, a); return g; } } @@ -5418,49 +5418,49 @@ ATOM`, g); !*** ./src/GLShape.ts ***! \************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ GLShape: () => ( /* binding */ - b + y ), /* harmony export */ splitMesh: () => ( /* binding */ - A + w ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), u = t( + ), u = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), y = t( + ), b = r( /*! ./colors */ "./src/colors.ts" - ), h = t( + ), h = r( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), _ = t( + ), _ = r( /*! ./VolumeData */ "./src/VolumeData.ts" - ), E = t( + ), E = r( /*! ./GLDraw */ "./src/GLDraw.ts" - ), c = t( + ), c = r( /*! ./glcartoon */ "./src/glcartoon.ts" - ), C = t( + ), S = r( /*! ./utilities */ "./src/utilities.ts" ); - class b { + class y { static finalizeGeo(s) { var o = s.updateGeoGroup(0); o.vertices > 0 && o.truncateArrayBuffers(!0, !0); @@ -5472,17 +5472,17 @@ ATOM`, g); * @param {Color | colorlike} color */ static updateColor(s, o) { - o = o || y.CC.color(o), s.colorsNeedUpdate = !0; - var w, p, v; - o.constructor !== Array && (w = o.r, p = o.g, v = o.b); + o = o || b.CC.color(o), s.colorsNeedUpdate = !0; + var A, p, v; + o.constructor !== Array && (A = o.r, p = o.g, v = o.b); for (let a in s.geometryGroups) { let l = s.geometryGroups[a], g = l.colorArray; - for (let M = 0, L = l.vertices; M < L; ++M) { + for (let M = 0, C = l.vertices; M < C; ++M) { if (o.constructor === Array) { let T = o[M]; - w = T.r, p = T.g, v = T.b; + A = T.r, p = T.g, v = T.b; } - g[M * 3] = w, g[M * 3 + 1] = p, g[M * 3 + 2] = v; + g[M * 3] = A, g[M * 3 + 1] = p, g[M * 3 + 2] = v; } } } @@ -5494,44 +5494,44 @@ ATOM`, g); * @param {ArrowSpec} * spec */ - static drawArrow(s, o, w) { - var p = w.start, v = w.end, a = w.radius, l = w.radiusRatio, g = w.mid, M = w.midpos; + static drawArrow(s, o, A) { + var p = A.start, v = A.end, a = A.radius, l = A.radiusRatio, g = A.mid, M = A.midpos; if (!(p && v)) return; - var L = o.updateGeoGroup(51), T = new u.Vector3(v.x, v.y, v.z).sub(p); + var C = o.updateGeoGroup(51), T = new u.Vector3(v.x, v.y, v.z).sub(p); if (M) { let he = T.length(); M > 0 ? g = M / he : g = (he + M) / he; } T.multiplyScalar(g); var D = new u.Vector3(p.x, p.y, p.z).add(T), I = T.clone().negate(); - let z = new u.Vector3(p.x, p.y, p.z); - s.intersectionShape.cylinder.push(new f.Cylinder(z, D.clone(), a)), s.intersectionShape.sphere.push(new f.Sphere(z, a)); + let B = new u.Vector3(p.x, p.y, p.z); + s.intersectionShape.cylinder.push(new f.Cylinder(B, D.clone(), a)), s.intersectionShape.sphere.push(new f.Sphere(B, a)); var P = []; P[0] = T.clone(), Math.abs(P[0].x) > 1e-4 ? P[0].y += 1 : P[0].x += 1, P[0].cross(T), P[0].normalize(), P[4] = P[0].clone(), P[4].crossVectors(P[0], T), P[4].normalize(), P[8] = P[0].clone().negate(), P[12] = P[4].clone().negate(), P[2] = P[0].clone().add(P[4]).normalize(), P[6] = P[4].clone().add(P[8]).normalize(), P[10] = P[8].clone().add(P[12]).normalize(), P[14] = P[12].clone().add(P[0]).normalize(), P[1] = P[0].clone().add(P[2]).normalize(), P[3] = P[2].clone().add(P[4]).normalize(), P[5] = P[4].clone().add(P[6]).normalize(), P[7] = P[6].clone().add(P[8]).normalize(), P[9] = P[8].clone().add(P[10]).normalize(), P[11] = P[10].clone().add(P[12]).normalize(), P[13] = P[12].clone().add(P[14]).normalize(), P[15] = P[14].clone().add(P[0]).normalize(); - var B = L.vertices, k = L.vertexArray, N = L.faceArray, $ = L.normalArray, F = L.lineArray, G, H, U; - for (H = 0, U = P.length; H < U; ++H) { - G = 3 * (B + 3 * H); - var V = P[H].clone().multiplyScalar(a).add(p), Q = P[H].clone().multiplyScalar(a).add(D), ae = P[H].clone().multiplyScalar(a * l).add(D); - if (k[G] = V.x, k[G + 1] = V.y, k[G + 2] = V.z, k[G + 3] = Q.x, k[G + 4] = Q.y, k[G + 5] = Q.z, k[G + 6] = ae.x, k[G + 7] = ae.y, k[G + 8] = ae.z, H > 0) { - var oe = k[G - 3], q = k[G - 2], me = k[G - 1], ne = new u.Vector3(oe, q, me), fe = new u.Vector3(v.x, v.y, v.z), Ce = D.clone(), Me = new u.Vector3(ae.x, ae.y, ae.z); - s.intersectionShape.triangle.push(new f.Triangle(Me, fe, ne)), s.intersectionShape.triangle.push(new f.Triangle(ne.clone(), Ce, Me.clone())); + var z = C.vertices, k = C.vertexArray, N = C.faceArray, R = C.normalArray, U = C.lineArray, W, G, F; + for (G = 0, F = P.length; G < F; ++G) { + W = 3 * (z + 3 * G); + var V = P[G].clone().multiplyScalar(a).add(p), J = P[G].clone().multiplyScalar(a).add(D), X = P[G].clone().multiplyScalar(a * l).add(D); + if (k[W] = V.x, k[W + 1] = V.y, k[W + 2] = V.z, k[W + 3] = J.x, k[W + 4] = J.y, k[W + 5] = J.z, k[W + 6] = X.x, k[W + 7] = X.y, k[W + 8] = X.z, G > 0) { + var oe = k[W - 3], te = k[W - 2], ve = k[W - 1], se = new u.Vector3(oe, te, ve), le = new u.Vector3(v.x, v.y, v.z), Ce = D.clone(), be = new u.Vector3(X.x, X.y, X.z); + s.intersectionShape.triangle.push(new f.Triangle(be, le, se)), s.intersectionShape.triangle.push(new f.Triangle(se.clone(), Ce, be.clone())); } } - L.vertices += 48, G = L.vertices * 3, k[G] = p.x, k[G + 1] = p.y, k[G + 2] = p.z, k[G + 3] = D.x, k[G + 4] = D.y, k[G + 5] = D.z, k[G + 6] = v.x, k[G + 7] = v.y, k[G + 8] = v.z, L.vertices += 3; - var Te, se, pe, we, Fe, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve = L.vertices - 3, Ie = L.vertices - 2, Re = L.vertices - 1, Z = ve * 3, ce = Ie * 3, Ae = Re * 3; - for (H = 0, U = P.length - 1; H < U; ++H) { - var ke = B + 3 * H; - G = ke * 3, se = L.faceidx, pe = L.lineidx, we = ke, ye = we * 3, Fe = ke + 1, ge = Fe * 3, Ue = ke + 2, Se = Ue * 3, Ne = ke + 4, ze = Ne * 3, Be = ke + 5, He = Be * 3, ue = ke + 3, We = ue * 3, Y = K = P[H], ee = de = P[H + 1], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = ee.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = ee.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = ee.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = ee.x, $[Se + 1] = K.y, $[He + 1] = ee.y, $[Se + 2] = K.z, $[He + 2] = ee.z, N[se] = we, N[se + 1] = Fe, N[se + 2] = ue, N[se + 3] = Fe, N[se + 4] = Ne, N[se + 5] = ue, N[se + 6] = we, N[se + 7] = ue, N[se + 8] = ve, N[se + 9] = Ue, N[se + 10] = Ie, N[se + 11] = Be, N[se + 12] = Ue, N[se + 13] = Re, N[se + 14] = Be, F[pe] = we, F[pe + 1] = Fe, F[pe + 2] = we, F[pe + 3] = ue, F[pe + 4] = Ne, F[pe + 5] = ue, F[pe + 6] = we, F[pe + 7] = ue, F[pe + 8] = Ue, F[pe + 9] = Fe, F[pe + 10] = Ue, F[pe + 11] = Be, F[pe + 12] = Ne, F[pe + 13] = Be, F[pe + 14] = Ue, F[pe + 15] = Re, F[pe + 16] = Ue, F[pe + 17] = Be, F[pe + 18] = Re, F[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; - } - Te = [ - B + 45, - B + 46, - B + 1, - B, - B + 47, - B + 2 - ], se = L.faceidx, pe = L.lineidx, we = Te[0], ye = we * 3, Fe = Te[1], ge = Fe * 3, Ue = Te[4], Se = Ue * 3, Ne = Te[2], ze = Ne * 3, Be = Te[5], He = Be * 3, ue = Te[3], We = ue * 3, Y = K = P[15], ee = de = P[0], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = ee.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = ee.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = ee.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = ee.x, $[Se + 1] = K.y, $[He + 1] = ee.y, $[Se + 2] = K.z, $[He + 2] = ee.z, T.normalize(), I.normalize(), $[Z] = I.x, $[ce] = $[Ae] = T.x, $[Z + 1] = I.y, $[ce + 1] = $[Ae + 1] = T.y, $[Z + 2] = I.z, $[ce + 2] = $[Ae + 2] = T.z, N[se] = we, N[se + 1] = Fe, N[se + 2] = ue, N[se + 3] = Fe, N[se + 4] = Ne, N[se + 5] = ue, N[se + 6] = we, N[se + 7] = ue, N[se + 8] = ve, N[se + 9] = Ue, N[se + 10] = Ie, N[se + 11] = Be, N[se + 12] = Ue, N[se + 13] = Re, N[se + 14] = Be, F[pe] = we, F[pe + 1] = Fe, F[pe + 2] = we, F[pe + 3] = ue, F[pe + 4] = Ne, F[pe + 5] = ue, F[pe + 6] = we, F[pe + 7] = ue, F[pe + 8] = Ue, F[pe + 9] = Fe, F[pe + 10] = Ue, F[pe + 11] = Be, F[pe + 12] = Ne, F[pe + 13] = Be, F[pe + 14] = Ue, F[pe + 15] = Re, F[pe + 16] = Ue, F[pe + 17] = Be, F[pe + 18] = Re, F[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; + C.vertices += 48, W = C.vertices * 3, k[W] = p.x, k[W + 1] = p.y, k[W + 2] = p.z, k[W + 3] = D.x, k[W + 4] = D.y, k[W + 5] = D.z, k[W + 6] = v.x, k[W + 7] = v.y, k[W + 8] = v.z, C.vertices += 3; + var Le, ae, _e, Ee, Be, Ne, Ge, ke, pe, de, ce, Ae, Oe, We, Ue, Z, j, ee, ge, ye = C.vertices - 3, $e = C.vertices - 2, Re = C.vertices - 1, Y = ye * 3, ue = $e * 3, Se = Re * 3; + for (G = 0, F = P.length - 1; G < F; ++G) { + var Fe = z + 3 * G; + W = Fe * 3, ae = C.faceidx, _e = C.lineidx, Ee = Fe, de = Ee * 3, Be = Fe + 1, ce = Be * 3, Ne = Fe + 2, Ae = Ne * 3, Ge = Fe + 4, Oe = Ge * 3, ke = Fe + 5, We = ke * 3, pe = Fe + 3, Ue = pe * 3, Z = j = P[G], ee = ge = P[G + 1], R[de] = Z.x, R[ce] = j.x, R[Ue] = ge.x, R[de + 1] = Z.y, R[ce + 1] = j.y, R[Ue + 1] = ge.y, R[de + 2] = Z.z, R[ce + 2] = j.z, R[Ue + 2] = ge.z, R[ce] = j.x, R[Oe] = ee.x, R[Ue] = ge.x, R[ce + 1] = j.y, R[Oe + 1] = ee.y, R[Ue + 1] = ge.y, R[ce + 2] = j.z, R[Oe + 2] = ee.z, R[Ue + 2] = ge.z, R[Ae] = j.x, R[We] = ee.x, R[Ae + 1] = j.y, R[We + 1] = ee.y, R[Ae + 2] = j.z, R[We + 2] = ee.z, N[ae] = Ee, N[ae + 1] = Be, N[ae + 2] = pe, N[ae + 3] = Be, N[ae + 4] = Ge, N[ae + 5] = pe, N[ae + 6] = Ee, N[ae + 7] = pe, N[ae + 8] = ye, N[ae + 9] = Ne, N[ae + 10] = $e, N[ae + 11] = ke, N[ae + 12] = Ne, N[ae + 13] = Re, N[ae + 14] = ke, U[_e] = Ee, U[_e + 1] = Be, U[_e + 2] = Ee, U[_e + 3] = pe, U[_e + 4] = Ge, U[_e + 5] = pe, U[_e + 6] = Ee, U[_e + 7] = pe, U[_e + 8] = Ne, U[_e + 9] = Be, U[_e + 10] = Ne, U[_e + 11] = ke, U[_e + 12] = Ge, U[_e + 13] = ke, U[_e + 14] = Ne, U[_e + 15] = Re, U[_e + 16] = Ne, U[_e + 17] = ke, U[_e + 18] = Re, U[_e + 19] = ke, C.faceidx += 15, C.lineidx += 20; + } + Le = [ + z + 45, + z + 46, + z + 1, + z, + z + 47, + z + 2 + ], ae = C.faceidx, _e = C.lineidx, Ee = Le[0], de = Ee * 3, Be = Le[1], ce = Be * 3, Ne = Le[4], Ae = Ne * 3, Ge = Le[2], Oe = Ge * 3, ke = Le[5], We = ke * 3, pe = Le[3], Ue = pe * 3, Z = j = P[15], ee = ge = P[0], R[de] = Z.x, R[ce] = j.x, R[Ue] = ge.x, R[de + 1] = Z.y, R[ce + 1] = j.y, R[Ue + 1] = ge.y, R[de + 2] = Z.z, R[ce + 2] = j.z, R[Ue + 2] = ge.z, R[ce] = j.x, R[Oe] = ee.x, R[Ue] = ge.x, R[ce + 1] = j.y, R[Oe + 1] = ee.y, R[Ue + 1] = ge.y, R[ce + 2] = j.z, R[Oe + 2] = ee.z, R[Ue + 2] = ge.z, R[Ae] = j.x, R[We] = ee.x, R[Ae + 1] = j.y, R[We + 1] = ee.y, R[Ae + 2] = j.z, R[We + 2] = ee.z, T.normalize(), I.normalize(), R[Y] = I.x, R[ue] = R[Se] = T.x, R[Y + 1] = I.y, R[ue + 1] = R[Se + 1] = T.y, R[Y + 2] = I.z, R[ue + 2] = R[Se + 2] = T.z, N[ae] = Ee, N[ae + 1] = Be, N[ae + 2] = pe, N[ae + 3] = Be, N[ae + 4] = Ge, N[ae + 5] = pe, N[ae + 6] = Ee, N[ae + 7] = pe, N[ae + 8] = ye, N[ae + 9] = Ne, N[ae + 10] = $e, N[ae + 11] = ke, N[ae + 12] = Ne, N[ae + 13] = Re, N[ae + 14] = ke, U[_e] = Ee, U[_e + 1] = Be, U[_e + 2] = Ee, U[_e + 3] = pe, U[_e + 4] = Ge, U[_e + 5] = pe, U[_e + 6] = Ee, U[_e + 7] = pe, U[_e + 8] = Ne, U[_e + 9] = Be, U[_e + 10] = Ne, U[_e + 11] = ke, U[_e + 12] = Ge, U[_e + 13] = ke, U[_e + 14] = Ne, U[_e + 15] = Re, U[_e + 16] = Ne, U[_e + 17] = ke, U[_e + 18] = Re, U[_e + 19] = ke, C.faceidx += 15, C.lineidx += 20; } // Update a bounding sphere's position and radius // from list of centroids and new points @@ -5544,41 +5544,41 @@ ATOM`, g); * points, flat array of all points in shape * @param {int} numPoints, number of valid poitns in points */ - static updateBoundingFromPoints(s, o, w, p) { + static updateBoundingFromPoints(s, o, A, p) { s.center.set(0, 0, 0); - let v = 1 / 0, a = 1 / 0, l = 1 / 0, g = -1 / 0, M = -1 / 0, L = -1 / 0; - s.box && (v = s.box.min.x, g = s.box.max.x, a = s.box.min.y, M = s.box.max.y, l = s.box.min.z, L = s.box.max.z); - for (let z = 0, P = p; z < P; z++) { - var T = w[z * 3], D = w[z * 3 + 1], I = w[z * 3 + 2]; - T < v && (v = T), D < a && (a = D), I < l && (l = I), T > g && (g = T), D > M && (M = D), I > L && (L = I); + let v = 1 / 0, a = 1 / 0, l = 1 / 0, g = -1 / 0, M = -1 / 0, C = -1 / 0; + s.box && (v = s.box.min.x, g = s.box.max.x, a = s.box.min.y, M = s.box.max.y, l = s.box.min.z, C = s.box.max.z); + for (let B = 0, P = p; B < P; B++) { + var T = A[B * 3], D = A[B * 3 + 1], I = A[B * 3 + 2]; + T < v && (v = T), D < a && (a = D), I < l && (l = I), T > g && (g = T), D > M && (M = D), I > C && (C = I); } - s.center.set((g + v) / 2, (M + a) / 2, (L + l) / 2), s.radius = s.center.distanceTo({ x: g, y: M, z: L }), s.box = { min: { x: v, y: a, z: l }, max: { x: g, y: M, z: L } }; + s.center.set((g + v) / 2, (M + a) / 2, (C + l) / 2), s.radius = s.center.distanceTo({ x: g, y: M, z: C }), s.box = { min: { x: v, y: a, z: l }, max: { x: g, y: M, z: C } }; } //helper function for adding an appropriately sized mesh - static addCustomGeo(s, o, w, p, v) { - var a = o.addGeoGroup(), l = w.vertexArr, g = w.normalArr, M = w.faceArr; + static addCustomGeo(s, o, A, p, v) { + var a = o.addGeoGroup(), l = A.vertexArr, g = A.normalArr, M = A.faceArr; a.vertices = l.length, a.faceidx = M.length; - var L, T, D, I, z, P, B, k, N, $ = a.vertexArray, F = a.colorArray; - for (p.constructor !== Array && (k = p.r, N = p.g, I = p.b), P = 0, B = a.vertices; P < B; ++P) - L = P * 3, T = l[P], $[L] = T.x, $[L + 1] = T.y, $[L + 2] = T.z, p.constructor === Array && (z = p[P], k = z.r, N = z.g, I = z.b), F[L] = k, F[L + 1] = N, F[L + 2] = I; + var C, T, D, I, B, P, z, k, N, R = a.vertexArray, U = a.colorArray; + for (p.constructor !== Array && (k = p.r, N = p.g, I = p.b), P = 0, z = a.vertices; P < z; ++P) + C = P * 3, T = l[P], R[C] = T.x, R[C + 1] = T.y, R[C + 2] = T.z, p.constructor === Array && (B = p[P], k = B.r, N = B.g, I = B.b), U[C] = k, U[C + 1] = N, U[C + 2] = I; if (v) - for (P = 0, B = a.faceidx / 3; P < B; ++P) { - L = P * 3, D = M[L], I = M[L + 1], z = M[L + 2]; - var G = new u.Vector3(), H = new u.Vector3(), U = new u.Vector3(); - s.intersectionShape.triangle.push(new f.Triangle(G.copy(l[D]), H.copy(l[I]), U.copy(l[z]))); + for (P = 0, z = a.faceidx / 3; P < z; ++P) { + C = P * 3, D = M[C], I = M[C + 1], B = M[C + 2]; + var W = new u.Vector3(), G = new u.Vector3(), F = new u.Vector3(); + s.intersectionShape.triangle.push(new f.Triangle(W.copy(l[D]), G.copy(l[I]), F.copy(l[B]))); } if (v) { - var V = new u.Vector3(0, 0, 0), Q = 0; - for (let q = 0; q < o.geometryGroups.length; q++) - V.add(o.geometryGroups[q].getCentroid()), Q++; - V.divideScalar(Q), b.updateBoundingFromPoints(s.boundingSphere, { centroid: V }, $, a.vertices); + var V = new u.Vector3(0, 0, 0), J = 0; + for (let te = 0; te < o.geometryGroups.length; te++) + V.add(o.geometryGroups[te].getCentroid()), J++; + V.divideScalar(J), y.updateBoundingFromPoints(s.boundingSphere, { centroid: V }, R, a.vertices); } if (a.faceArray = new Uint16Array(M), a.truncateArrayBuffers(!0, !0), g.length < a.vertices) a.setNormals(); else { - var ae = a.normalArray = new Float32Array(a.vertices * 3), oe; - for (P = 0, B = a.vertices; P < B; ++P) - L = P * 3, oe = g[P], ae[L] = oe.x, ae[L + 1] = oe.y, ae[L + 2] = oe.z; + var X = a.normalArray = new Float32Array(a.vertices * 3), oe; + for (P = 0, z = a.vertices; P < z; ++P) + C = P * 3, oe = g[P], X[C] = oe.x, X[C + 1] = oe.y, X[C + 2] = oe.z; } a.setLineIndices(), a.lineidx = a.lineArray.length; } @@ -5591,7 +5591,7 @@ ATOM`, g); * @returns {undefined} */ static updateFromStyle(s, o) { - typeof o.color < "u" ? (s.color = o.color || new y.Color(), o.color instanceof y.Color || (s.color = y.CC.color(o.color))) : s.color = y.CC.color(0), s.wireframe = !!o.wireframe, s.opacity = o.alpha ? (0, u.clamp)(o.alpha, 0, 1) : 1, typeof o.opacity < "u" && (s.opacity = (0, u.clamp)(o.opacity, 0, 1)), s.side = o.side !== void 0 ? o.side : n.DoubleSide, s.linewidth = typeof o.linewidth > "u" ? 1 : o.linewidth, s.clickable = !!o.clickable, s.callback = (0, C.makeFunction)(o.callback), s.hoverable = !!o.hoverable, s.hover_callback = (0, C.makeFunction)(o.hover_callback), s.unhover_callback = (0, C.makeFunction)(o.unhover_callback), s.hidden = o.hidden, s.frame = o.frame; + typeof o.color < "u" ? (s.color = o.color || new b.Color(), o.color instanceof b.Color || (s.color = b.CC.color(o.color))) : s.color = b.CC.color(0), s.wireframe = !!o.wireframe, s.opacity = o.alpha ? (0, u.clamp)(o.alpha, 0, 1) : 1, typeof o.opacity < "u" && (s.opacity = (0, u.clamp)(o.opacity, 0, 1)), s.side = o.side !== void 0 ? o.side : n.DoubleSide, s.linewidth = typeof o.linewidth > "u" ? 1 : o.linewidth, s.clickable = !!o.clickable, s.callback = (0, S.makeFunction)(o.callback), s.hoverable = !!o.hoverable, s.hover_callback = (0, S.makeFunction)(o.hover_callback), s.unhover_callback = (0, S.makeFunction)(o.unhover_callback), s.hidden = o.hidden, s.frame = o.frame; } /** * Custom renderable shape @@ -5606,7 +5606,7 @@ ATOM`, g); cylinder: [], line: [], triangle: [] - }, b.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new n.Geometry(!0), this.linegeo = new n.Geometry(!0); + }, y.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new n.Geometry(!0), this.linegeo = new n.Geometry(!0); } /** Update shape with new style specification * @param {ShapeSpec} newspec @@ -5618,12 +5618,12 @@ ATOM`, g); updateStyle(s) { for (var o in s) this.stylespec[o] = s[o]; - if (b.updateFromStyle(this, this.stylespec), s.voldata && s.volscheme) { - (0, C.adjustVolumeStyle)(s); - const w = s.volscheme, p = s.voldata, v = y.CC, a = w.range() || [-1, 1]; + if (y.updateFromStyle(this, this.stylespec), s.voldata && s.volscheme) { + (0, S.adjustVolumeStyle)(s); + const A = s.volscheme, p = s.voldata, v = b.CC, a = A.range() || [-1, 1]; this.geo.setColors(function(l, g, M) { - let L = p.getVal(l, g, M); - return v.color(w.valueToHex(L, a)); + let C = p.getVal(l, g, M); + return v.color(A.valueToHex(C, a)); }), delete this.color; } } @@ -5632,7 +5632,7 @@ ATOM`, g); * @param {CustomShapeSpec} customSpec */ addCustom(s) { - s.vertexArr = s.vertexArr || [], s.faceArr = s.faceArr || [], s.normalArr = s.normalArr || [], b.drawCustom(this, this.geo, s); + s.vertexArr = s.vertexArr || [], s.faceArr = s.faceArr || [], s.normalArr = s.normalArr || [], y.drawCustom(this, this.geo, s); } /** * Creates a sphere shape @@ -5643,11 +5643,11 @@ ATOM`, g); viewer.render(); */ addSphere(s) { - s.center || (s.center = new u.Vector3(0, 0, 0)), s.radius = s.radius ? (0, u.clamp)(s.radius, 0, 1 / 0) : 1.5, s.color = y.CC.color(s.color), this.intersectionShape.sphere.push(new f.Sphere(s.center, s.radius)), E.GLDraw.drawSphere(this.geo, s.center, s.radius, s.color, s.quality), this.components.push({ + s.center || (s.center = new u.Vector3(0, 0, 0)), s.radius = s.radius ? (0, u.clamp)(s.radius, 0, 1 / 0) : 1.5, s.color = b.CC.color(s.color), this.intersectionShape.sphere.push(new f.Sphere(s.center, s.radius)), E.GLDraw.drawSphere(this.geo, s.center, s.radius, s.color, s.quality), this.components.push({ centroid: new u.Vector3(s.center.x, s.center.y, s.center.z) }); var o = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, o.vertexArray, o.vertices); + y.updateBoundingFromPoints(this.boundingSphere, this.components, o.vertexArray, o.vertices); } /** * Creates a box @@ -5664,39 +5664,39 @@ ATOM`, g); viewer.render(); */ addBox(s) { - var o = s.dimensions || { w: 1, h: 1, d: 1 }, w; - typeof o.w == "number" ? w = { x: o.w, y: 0, z: 0 } : w = o.w; + var o = s.dimensions || { w: 1, h: 1, d: 1 }, A; + typeof o.w == "number" ? A = { x: o.w, y: 0, z: 0 } : A = o.w; var p; typeof o.h == "number" ? p = { x: 0, y: o.h, z: 0 } : p = o.h; var v; typeof o.d == "number" ? v = { x: 0, y: 0, z: o.d } : v = o.d; var a = s.corner; a == null && (s.center !== void 0 ? a = { - x: s.center.x - 0.5 * (w.x + p.x + v.x), - y: s.center.y - 0.5 * (w.y + p.y + v.y), - z: s.center.z - 0.5 * (w.z + p.z + v.z) + x: s.center.x - 0.5 * (A.x + p.x + v.x), + y: s.center.y - 0.5 * (A.y + p.y + v.y), + z: s.center.z - 0.5 * (A.z + p.z + v.z) } : a = { x: 0, y: 0, z: 0 }); var l = [ { x: a.x, y: a.y, z: a.z }, - { x: a.x + w.x, y: a.y + w.y, z: a.z + w.z }, + { x: a.x + A.x, y: a.y + A.y, z: a.z + A.z }, { x: a.x + p.x, y: a.y + p.y, z: a.z + p.z }, - { x: a.x + w.x + p.x, y: a.y + w.y + p.y, z: a.z + w.z + p.z }, + { x: a.x + A.x + p.x, y: a.y + A.y + p.y, z: a.z + A.z + p.z }, { x: a.x + v.x, y: a.y + v.y, z: a.z + v.z }, - { x: a.x + w.x + v.x, y: a.y + w.y + v.y, z: a.z + w.z + v.z }, + { x: a.x + A.x + v.x, y: a.y + A.y + v.y, z: a.z + A.z + v.z }, { x: a.x + p.x + v.x, y: a.y + p.y + v.y, z: a.z + p.z + v.z }, - { x: a.x + w.x + p.x + v.x, y: a.y + w.y + p.y + v.y, z: a.z + w.z + p.z + v.z } + { x: a.x + A.x + p.x + v.x, y: a.y + A.y + p.y + v.y, z: a.z + A.z + p.z + v.z } ], g = [], M = []; g.splice(g.length, 0, l[0], l[1], l[2], l[3]), M.splice(M.length, 0, 0, 2, 1, 1, 2, 3); - var L = 4; - g.splice(g.length, 0, l[2], l[3], l[6], l[7]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[4], l[5], l[0], l[1]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[6], l[7], l[4], l[5]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[3], l[1], l[7], l[5]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[2], l[6], l[0], l[4]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4; - var T = (0, C.extend)({}, s); - T.vertexArr = g, T.faceArr = M, T.normalArr = [], b.drawCustom(this, this.geo, T); + var C = 4; + g.splice(g.length, 0, l[2], l[3], l[6], l[7]), M.splice(M.length, 0, C + 0, C + 2, C + 1, C + 1, C + 2, C + 3), C += 4, g.splice(g.length, 0, l[4], l[5], l[0], l[1]), M.splice(M.length, 0, C + 0, C + 2, C + 1, C + 1, C + 2, C + 3), C += 4, g.splice(g.length, 0, l[6], l[7], l[4], l[5]), M.splice(M.length, 0, C + 0, C + 2, C + 1, C + 1, C + 2, C + 3), C += 4, g.splice(g.length, 0, l[3], l[1], l[7], l[5]), M.splice(M.length, 0, C + 0, C + 2, C + 1, C + 1, C + 2, C + 3), C += 4, g.splice(g.length, 0, l[2], l[6], l[0], l[4]), M.splice(M.length, 0, C + 0, C + 2, C + 1, C + 1, C + 2, C + 3), C += 4; + var T = (0, S.extend)({}, s); + T.vertexArr = g, T.faceArr = M, T.normalArr = [], y.drawCustom(this, this.geo, T); var D = new u.Vector3(); this.components.push({ centroid: D.addVectors(l[0], l[7]).multiplyScalar(0.5) }); var I = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, I.vertexArray, I.vertices); + y.updateBoundingFromPoints(this.boundingSphere, this.components, I.vertexArray, I.vertices); } /** * Creates a cylinder shape @@ -5729,16 +5729,16 @@ ATOM`, g); viewer.render(); */ addCylinder(s) { - var o, w; - s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(0, 0, 0); - var p = s.radius || 0.1, v = y.CC.color(s.color); - this.intersectionShape.cylinder.push(new f.Cylinder(o, w, p)), E.GLDraw.drawCylinder(this.geo, o, w, p, v, s.fromCap, s.toCap); + var o, A; + s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (A = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof A.x > "u" && (A.x = 3)) : A = new u.Vector3(0, 0, 0); + var p = s.radius || 0.1, v = b.CC.color(s.color); + this.intersectionShape.cylinder.push(new f.Cylinder(o, A, p)), E.GLDraw.drawCylinder(this.geo, o, A, p, v, s.fromCap, s.toCap); var a = new u.Vector3(); this.components.push({ - centroid: a.addVectors(o, w).multiplyScalar(0.5) + centroid: a.addVectors(o, A).multiplyScalar(0.5) }); var l = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, l.vertexArray, l.vertices); + y.updateBoundingFromPoints(this.boundingSphere, this.components, l.vertexArray, l.vertices); } /** * Creates a dashed cylinder shape @@ -5748,16 +5748,16 @@ ATOM`, g); s.dashLength = s.dashLength || 0.25, s.gapLength = s.gapLength || 0.25; var o; s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0); - var w; - s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(3, 0, 0); - for (var p = s.radius || 0.1, v = y.CC.color(s.color), a = Math.sqrt(Math.pow(o.x - w.x, 2) + Math.pow(o.y - w.y, 2) + Math.pow(o.z - w.z, 2)), l = a / (s.gapLength + s.dashLength), g = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0), M = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), L = new u.Vector3((w.x - o.x) / (a / s.gapLength), (w.y - o.y) / (a / s.gapLength), (w.z - o.z) / (a / s.gapLength)), T = new u.Vector3((w.x - o.x) / (a / s.dashLength), (w.y - o.y) / (a / s.dashLength), (w.z - o.z) / (a / s.dashLength)), D = 0; D < l; D++) - M = new u.Vector3(g.x + T.x, g.y + T.y, g.z + T.z), this.intersectionShape.cylinder.push(new f.Cylinder(g, M, p)), E.GLDraw.drawCylinder(this.geo, g, M, p, v, s.fromCap, s.toCap), g = new u.Vector3(M.x + L.x, M.y + L.y, M.z + L.z); + var A; + s.end ? (A = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof A.x > "u" && (A.x = 3)) : A = new u.Vector3(3, 0, 0); + for (var p = s.radius || 0.1, v = b.CC.color(s.color), a = Math.sqrt(Math.pow(o.x - A.x, 2) + Math.pow(o.y - A.y, 2) + Math.pow(o.z - A.z, 2)), l = a / (s.gapLength + s.dashLength), g = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0), M = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), C = new u.Vector3((A.x - o.x) / (a / s.gapLength), (A.y - o.y) / (a / s.gapLength), (A.z - o.z) / (a / s.gapLength)), T = new u.Vector3((A.x - o.x) / (a / s.dashLength), (A.y - o.y) / (a / s.dashLength), (A.z - o.z) / (a / s.dashLength)), D = 0; D < l; D++) + M = new u.Vector3(g.x + T.x, g.y + T.y, g.z + T.z), this.intersectionShape.cylinder.push(new f.Cylinder(g, M, p)), E.GLDraw.drawCylinder(this.geo, g, M, p, v, s.fromCap, s.toCap), g = new u.Vector3(M.x + C.x, M.y + C.y, M.z + C.z); var I = new u.Vector3(); this.components.push({ - centroid: I.addVectors(o, w).multiplyScalar(0.5) + centroid: I.addVectors(o, A).multiplyScalar(0.5) }); - var z = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices); + var B = this.geo.updateGeoGroup(0); + y.updateBoundingFromPoints(this.boundingSphere, this.components, B.vertexArray, B.vertices); } /** * Creates a curved shape @@ -5770,13 +5770,13 @@ ATOM`, g); console.log("Too few points in addCurve"); return; } - var w = s.radius || 0.1, p = y.CC.color(s.color), v = 0, a = o.length - 1, l = o[0].distanceTo(o[1]), g = Math.ceil(2 * w / l); + var A = s.radius || 0.1, p = b.CC.color(s.color), v = 0, a = o.length - 1, l = o[0].distanceTo(o[1]), g = Math.ceil(2 * A / l); if (s.toArrow) { a -= g; let D = { start: o[a], end: o[o.length - 1], - radius: w, + radius: A, color: p, mid: 1e-4 }; @@ -5787,14 +5787,14 @@ ATOM`, g); let D = { start: o[v], end: o[0], - radius: w, + radius: A, color: p, mid: 1e-4 }; this.addArrow(D); } - for (var M = Math.ceil(o.length / 2), L = { radius: w, color: p, fromCap: 2, toCap: 2 }, T = v; T < a; T++) - L.start = o[T], L.end = o[T + 1], L.fromCap = 2, L.toCap = 2, T < M ? (L.fromCap = 2, L.toCap = 0) : T > M ? (L.fromCap = 0, L.toCap = 2) : (L.fromCap = 2, L.toCap = 2), this.addCylinder(L); + for (var M = Math.ceil(o.length / 2), C = { radius: A, color: p, fromCap: 2, toCap: 2 }, T = v; T < a; T++) + C.start = o[T], C.end = o[T + 1], C.fromCap = 2, C.toCap = 2, T < M ? (C.fromCap = 2, C.toCap = 0) : T > M ? (C.fromCap = 0, C.toCap = 2) : (C.fromCap = 2, C.toCap = 2), this.addCylinder(C); } /** * Creates a line shape @@ -5807,16 +5807,16 @@ ATOM`, g); */ addLine(s) { - var o, w; - s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(3, 0, 0); + var o, A; + s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (A = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof A.x > "u" && (A.x = 3)) : A = new u.Vector3(3, 0, 0); var p = this.geo.updateGeoGroup(2), v = p.vertices, a = v * 3, l = p.vertexArray; - l[a] = o.x, l[a + 1] = o.y, l[a + 2] = o.z, l[a + 3] = w.x, l[a + 4] = w.y, l[a + 5] = w.z, p.vertices += 2; + l[a] = o.x, l[a + 1] = o.y, l[a + 2] = o.z, l[a + 3] = A.x, l[a + 4] = A.y, l[a + 5] = A.z, p.vertices += 2; var g = p.lineArray, M = p.lineidx; g[M] = v, g[M + 1] = v + 1, p.lineidx += 2; - var L = new u.Vector3(); + var C = new u.Vector3(); this.components.push({ - centroid: L.addVectors(o, w).multiplyScalar(0.5) - }), p = this.geo.updateGeoGroup(0), b.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); + centroid: C.addVectors(o, A).multiplyScalar(0.5) + }), p = this.geo.updateGeoGroup(0), y.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); } /** * Creates an arrow shape @@ -5845,20 +5845,20 @@ ATOM`, g); s.end = o; } else s.end ? (s.end = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof s.end.x > "u" && (s.end.x = 3)) : s.end = new u.Vector3(3, 0, 0); - s.radius = s.radius || 0.1, s.radiusRatio = s.radiusRatio || 1.618034, s.mid = 0 < s.mid && s.mid < 1 ? s.mid : 0.618034, b.drawArrow(this, this.geo, s); - var w = new u.Vector3(); + s.radius = s.radius || 0.1, s.radiusRatio = s.radiusRatio || 1.618034, s.mid = 0 < s.mid && s.mid < 1 ? s.mid : 0.618034, y.drawArrow(this, this.geo, s); + var A = new u.Vector3(); this.components.push({ - centroid: w.addVectors(s.start, s.end).multiplyScalar(0.5) + centroid: A.addVectors(s.start, s.end).multiplyScalar(0.5) }); var p = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); + y.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); } static distance_from(s, o) { return Math.sqrt(Math.pow(s.x - o.x, 2) + Math.pow(s.y - o.y, 2) + Math.pow(s.z - o.z, 2)); } - static inSelectedRegion(s, o, w) { + static inSelectedRegion(s, o, A) { for (var p = 0; p < o.length; p++) - if (b.distance_from(o[p], s) <= w) + if (y.distance_from(o[p], s) <= A) return !0; return !1; } @@ -5889,17 +5889,17 @@ ATOM`, g); viewer.render(); }); */ - addIsosurface(s, o, w) { - var p = o.isoval !== void 0 && typeof o.isoval == "number" ? o.isoval : 0, v = !!o.voxel, a = o.smoothness === void 0 ? 1 : o.smoothness, l = s.size.x, g = s.size.y, M = s.size.z, L = new Int16Array(l * g * M), T = s.data, D, I; - for (D = 0, I = L.length; D < I; ++D) - L[D] = -1; - var z = new Uint8Array(l * g * M); + addIsosurface(s, o, A) { + var p = o.isoval !== void 0 && typeof o.isoval == "number" ? o.isoval : 0, v = !!o.voxel, a = o.smoothness === void 0 ? 1 : o.smoothness, l = s.size.x, g = s.size.y, M = s.size.z, C = new Int16Array(l * g * M), T = s.data, D, I; + for (D = 0, I = C.length; D < I; ++D) + C[D] = -1; + var B = new Uint8Array(l * g * M); for (D = 0, I = T.length; D < I; ++D) { var P = p >= 0 ? T[D] - p : p - T[D]; - P > 0 && (z[D] |= b.ISDONE); + P > 0 && (B[D] |= y.ISDONE); } - var B = [], k = []; - h.MarchingCube.march(z, B, k, { + var z = [], k = []; + h.MarchingCube.march(B, z, k, { fulltable: !0, voxel: v, unitCube: s.unit, @@ -5908,33 +5908,33 @@ ATOM`, g); nX: l, nY: g, nZ: M - }), !v && a > 0 && h.MarchingCube.laplacianSmooth(a, B, k); - var N = [], $ = [], F = []; + }), !v && a > 0 && h.MarchingCube.laplacianSmooth(a, z, k); + var N = [], R = [], U = []; if (o.selectedRegion && o.coords === void 0 && (o.coords = o.selectedRegion), o.coords !== void 0) { - var G = o.coords[0].x, H = o.coords[0].y, U = o.coords[0].z, V = o.coords[0].x, Q = o.coords[0].y, ae = o.coords[0].z; - for (let se = 0; se < o.coords.length; se++) - o.coords[se].x > G ? G = o.coords[se].x : o.coords[se].x < V && (V = o.coords[se].x), o.coords[se].y > H ? H = o.coords[se].y : o.coords[se].y < Q && (Q = o.coords[se].y), o.coords[se].z > U ? U = o.coords[se].z : o.coords[se].z < ae && (ae = o.coords[se].z); + var W = o.coords[0].x, G = o.coords[0].y, F = o.coords[0].z, V = o.coords[0].x, J = o.coords[0].y, X = o.coords[0].z; + for (let ae = 0; ae < o.coords.length; ae++) + o.coords[ae].x > W ? W = o.coords[ae].x : o.coords[ae].x < V && (V = o.coords[ae].x), o.coords[ae].y > G ? G = o.coords[ae].y : o.coords[ae].y < J && (J = o.coords[ae].y), o.coords[ae].z > F ? F = o.coords[ae].z : o.coords[ae].z < X && (X = o.coords[ae].z); var oe = 2; - o.radius !== void 0 && (oe = o.radius), o.selectedOffset !== void 0 && (oe = o.selectedOffset), o.seldist !== void 0 && (oe = o.seldist), V -= oe, G += oe, Q -= oe, H += oe, ae -= oe, U += oe; - for (let se = 0; se < B.length; se++) - B[se].x > V && B[se].x < G && B[se].y > Q && B[se].y < H && B[se].z > ae && B[se].z < U && b.inSelectedRegion(B[se], o.coords, oe) ? (N.push($.length), $.push(B[se])) : N.push(-1); - for (let se = 0; se + 2 < k.length; se += 3) - N[k[se]] !== -1 && N[k[se + 1]] !== -1 && N[k[se + 2]] !== -1 && (F.push(k[se] - (k[se] - N[k[se]])), F.push(k[se + 1] - (k[se + 1] - N[k[se + 1]])), F.push(k[se + 2] - (k[se + 2] - N[k[se + 2]]))); - B = $, k = F; - } - b.drawCustom(this, this.geo, { - vertexArr: B, + o.radius !== void 0 && (oe = o.radius), o.selectedOffset !== void 0 && (oe = o.selectedOffset), o.seldist !== void 0 && (oe = o.seldist), V -= oe, W += oe, J -= oe, G += oe, X -= oe, F += oe; + for (let ae = 0; ae < z.length; ae++) + z[ae].x > V && z[ae].x < W && z[ae].y > J && z[ae].y < G && z[ae].z > X && z[ae].z < F && y.inSelectedRegion(z[ae], o.coords, oe) ? (N.push(R.length), R.push(z[ae])) : N.push(-1); + for (let ae = 0; ae + 2 < k.length; ae += 3) + N[k[ae]] !== -1 && N[k[ae + 1]] !== -1 && N[k[ae + 2]] !== -1 && (U.push(k[ae] - (k[ae] - N[k[ae]])), U.push(k[ae + 1] - (k[ae + 1] - N[k[ae + 1]])), U.push(k[ae + 2] - (k[ae + 2] - N[k[ae + 2]]))); + z = R, k = U; + } + y.drawCustom(this, this.geo, { + vertexArr: z, faceArr: k, normalArr: [], clickable: o.clickable, hoverable: o.hoverable }), this.updateStyle(o); - var q = new u.Vector3(s.origin.x, s.origin.y, s.origin.z), me = new u.Vector3(s.size.x * s.unit.x, s.size.y * s.unit.y, s.size.z * s.unit.z), ne = new u.Vector3(0, 0, 0), fe = q.clone(), Ce = q.clone().add(me); - for (let se = 0; se < B.length; se++) - ne.add(B[se]), fe.max(B[se]), Ce.min(B[se]); - ne.divideScalar(B.length); - var Me = ne.distanceTo(Ce), Te = ne.distanceTo(fe); - this.boundingSphere.center = ne, this.boundingSphere.radius = Math.max(Me, Te), typeof w == "function" && w(); + var te = new u.Vector3(s.origin.x, s.origin.y, s.origin.z), ve = new u.Vector3(s.size.x * s.unit.x, s.size.y * s.unit.y, s.size.z * s.unit.z), se = new u.Vector3(0, 0, 0), le = te.clone(), Ce = te.clone().add(ve); + for (let ae = 0; ae < z.length; ae++) + se.add(z[ae]), le.max(z[ae]), Ce.min(z[ae]); + se.divideScalar(z.length); + var be = se.distanceTo(Ce), Le = se.distanceTo(le); + this.boundingSphere.center = se, this.boundingSphere.radius = Math.max(be, Le), typeof A == "function" && A(); } /** * @deprecated Use addIsosurface instead @@ -5943,12 +5943,12 @@ ATOM`, g); * @param {string} fmt - Input data format (e.g. 'cube' for cube file format) * @param {IsoSurfaceSpec} isoSpec - Volumetric data shape specification */ - addVolumetricData(s, o, w) { - s = new _.VolumeData(s, o), this.addIsosurface(s, w); + addVolumetricData(s, o, A) { + s = new _.VolumeData(s, o), this.addIsosurface(s, A); } //for internal use, truncate buffers to save memory finalize() { - return b.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.geo; + return y.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.geo; } /* * Initialize webgl objects for rendering @@ -5957,7 +5957,7 @@ ATOM`, g); */ globj(s) { if (this.renderedShapeObj && (s.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { - b.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && b.updateColor(this.geo, this.color), this.shapeObj = new n.Object3D(); + y.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && y.updateColor(this.geo, this.color), this.shapeObj = new n.Object3D(); var o = null; this.side == n.DoubleSide ? o = new n.MeshDoubleLambertMaterial({ wireframe: this.wireframe, @@ -5974,8 +5974,8 @@ ATOM`, g); wireframeLinewidth: this.linewidth, vertexColors: n.Coloring.VertexColors }); - var w = new n.Mesh(this.geo, o); - this.shapeObj.add(w); + var A = new n.Mesh(this.geo, o); + this.shapeObj.add(A); var p = new n.LineBasicMaterial({ linewidth: this.linewidth, color: this.color @@ -5999,28 +5999,28 @@ ATOM`, g); return this.boundingSphere.center.z; } } - b.ISDONE = 2, b.drawCustom = function(S, s, o) { - var w = o, p = w.vertexArr, v = w.faceArr; + y.ISDONE = 2, y.drawCustom = function(L, s, o) { + var A = o, p = A.vertexArr, v = A.faceArr; (p.length === 0 || v.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"); var a = o.color; - typeof a > "u" && (a = S.color), a = y.CC.color(a); - for (var l = A(w), g = 0, M = l.length; g < M; g++) - b.addCustomGeo(S, s, l[g], l[g].colorArr ? l[g].colorArr : a, o.clickable); + typeof a > "u" && (a = L.color), a = b.CC.color(a); + for (var l = w(A), g = 0, M = l.length; g < M; g++) + y.addCustomGeo(L, s, l[g], l[g].colorArr ? l[g].colorArr : a, o.clickable); }; - function A(S) { + function w(L) { var s = 64e3; - if (S.vertexArr.length < s) - return [S]; + if (L.vertexArr.length < s) + return [L]; var o = [{ vertexArr: [], normalArr: [], faceArr: [] }]; - S.colorArr && (o.colorArr = []); - var w = [], p = [], v = 0, a = S.faceArr; + L.colorArr && (o.colorArr = []); + var A = [], p = [], v = 0, a = L.faceArr; for (let g = 0, M = a.length; g < M; g += 3) { - let L = o[v]; + let C = o[v]; for (let T = 0; T < 3; T++) { var l = a[g + T]; - w[l] !== v && (w[l] = v, p[l] = L.vertexArr.length, L.vertexArr.push(S.vertexArr[l]), S.normalArr && S.normalArr[l] && L.normalArr.push(S.normalArr[l]), S.colorArr && S.colorArr[l] && L.colorArr.push(S.colorArr[l])), L.faceArr.push(p[l]); + A[l] !== v && (A[l] = v, p[l] = C.vertexArr.length, C.vertexArr.push(L.vertexArr[l]), L.normalArr && L.normalArr[l] && C.normalArr.push(L.normalArr[l]), L.colorArr && L.colorArr[l] && C.colorArr.push(L.colorArr[l])), C.faceArr.push(p[l]); } - L.vertexArr.length >= s && (o.push({ vertexArr: [], normalArr: [], faceArr: [] }), S.colorArr && (o.colorArr = []), v++); + C.vertexArr.length >= s && (o.push({ vertexArr: [], normalArr: [], faceArr: [] }), L.colorArr && (o.colorArr = []), v++); } return o; } @@ -6032,8 +6032,8 @@ ATOM`, g); !*** ./src/GLViewer.ts ***! \*************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ GLViewer: () => ( /* binding */ @@ -6052,44 +6052,44 @@ ATOM`, g); /* harmony export */ createViewerGrid: () => ( /* binding */ - w + A ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), u = t( + ), u = r( /*! ./colors */ "./src/colors.ts" - ), y = t( + ), b = r( /*! ./utilities */ "./src/utilities.ts" - ), h = t( + ), h = r( /*! ./Gradient */ "./src/Gradient.ts" - ), _ = t( + ), _ = r( /*! ./GLModel */ "./src/GLModel.ts" - ), E = t( + ), E = r( /*! ./Label */ "./src/Label.ts" - ), c = t( + ), c = r( /*! ./GLShape */ "./src/GLShape.ts" - ), C = t( + ), S = r( /*! ./VolumeData */ "./src/VolumeData.ts" - ), b = t( + ), y = r( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), A = t( + ), w = r( /*! ./VolumetricRender */ "./src/VolumetricRender.ts" - ), S = t( + ), L = r( /*! upng-js */ "./node_modules/upng-js/UPNG.js" ); @@ -6170,11 +6170,11 @@ ATOM`, g); if (g) { let M = g.selectedAtoms({ clickable: !0 - }), L = g.selectedAtoms({ + }), C = g.selectedAtoms({ hoverable: !0 }), T = g.selectedAtoms({ contextMenuEnabled: !0 }); - for (let D = 0; D < L.length; D++) - this.hoverables.push(L[D]); + for (let D = 0; D < C.length; D++) + this.hoverables.push(C[D]); for (let D = 0; D < M.length; D++) this.clickables.push(M[D]); for (let D = 0; D < T.length; D++) @@ -6190,21 +6190,21 @@ ATOM`, g); handleClickSelection(a, l, g) { let M = this.targetedObjects(a, l, this.clickables); if (M.length) { - var L = M[0].clickable; - L.callback !== void 0 && (typeof L.callback != "function" && (L.callback = (0, y.makeFunction)(L.callback)), typeof L.callback == "function" && L.callback(L, this._viewer, g, this.container, M)); + var C = M[0].clickable; + C.callback !== void 0 && (typeof C.callback != "function" && (C.callback = (0, b.makeFunction)(C.callback)), typeof C.callback == "function" && C.callback(C, this._viewer, g, this.container, M)); } } //return offset of container canvasOffset() { - let a = this.glDOM, l = a.getBoundingClientRect(), g = a.ownerDocument, M = g.documentElement, L = g.defaultView; + let a = this.glDOM, l = a.getBoundingClientRect(), g = a.ownerDocument, M = g.documentElement, C = g.defaultView; return { - top: l.top + L.pageYOffset - M.clientTop, - left: l.left + L.pageXOffset - M.clientLeft + top: l.top + C.pageYOffset - M.clientTop, + left: l.left + C.pageXOffset - M.clientLeft }; } //set current_hover to sel (which can be null), calling appropraite callbacks setHover(a, l, g) { - this.current_hover != a && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, y.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, l, this.container, g)), this.current_hover = a, a && a.hover_callback !== void 0 && (typeof a.hover_callback != "function" && (a.hover_callback = (0, y.makeFunction)(a.hover_callback)), typeof a.hover_callback == "function" && a.hover_callback(a, this._viewer, l, this.container, g))); + this.current_hover != a && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, b.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, l, this.container, g)), this.current_hover = a, a && a.hover_callback !== void 0 && (typeof a.hover_callback != "function" && (a.hover_callback = (0, b.makeFunction)(a.hover_callback)), typeof a.hover_callback == "function" && a.hover_callback(a, this._viewer, l, this.container, g))); } //checks for selection intersects on hover handleHoverSelection(a, l, g) { @@ -6212,8 +6212,8 @@ ATOM`, g); return; let M = this.targetedObjects(a, l, this.hoverables); if (M.length) { - var L = M[0].clickable; - this.setHover(L, g, M), this.current_hover = L; + var C = M[0].clickable; + this.setHover(C, g, M), this.current_hover = C; } else this.setHover(null); } @@ -6229,12 +6229,12 @@ ATOM`, g); * @param {{ allowTolerance, tolerance: number }} options */ closeEnoughForClick(a, { allowTolerance: l = a.targetTouches, tolerance: g = 5 } = {}) { - const M = this.getX(a), L = this.getY(a); + const M = this.getX(a), C = this.getY(a); if (l) { - const T = Math.abs(M - this.mouseStartX), D = Math.abs(L - this.mouseStartY); + const T = Math.abs(M - this.mouseStartX), D = Math.abs(C - this.mouseStartY); return T <= g && D <= g; } else - return M === this.mouseStartX && L === this.mouseStartY; + return M === this.mouseStartX && C === this.mouseStartY; } calcTouchDistance(a) { var l = a.targetTouches[0].pageX - a.targetTouches[1].pageX, g = a.targetTouches[0].pageY - a.targetTouches[1].pageY; @@ -6252,8 +6252,8 @@ ATOM`, g); //for grid viewers, return true if point is in this viewer isInViewer(a, l) { if (this.viewers != null) { - var g = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, L = this.canvasOffset(), T = a - L.left, D = l - L.top, I = this.rows - Math.floor(D / M) - 1, z = Math.floor(T / g); - if (I != this.row || z != this.col) + var g = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, C = this.canvasOffset(), T = a - C.left, D = l - C.top, I = this.rows - Math.floor(D / M) - 1, B = Math.floor(T / g); + if (I != this.row || B != this.col) return !1; } return !0; @@ -6280,13 +6280,13 @@ ATOM`, g); return a.clone(); let M = a.x * l.x + a.y * l.y + a.z * l.z + a.w * l.w; if (M > 0.9995) { - let B = new f.Quaternion(a.x + g * (l.x - a.x), a.y + g * (l.y - a.y), a.z + g * (l.z - a.z), a.w + g * (l.w - a.w)); - return B.normalize(), B; + let z = new f.Quaternion(a.x + g * (l.x - a.x), a.y + g * (l.y - a.y), a.z + g * (l.z - a.z), a.w + g * (l.w - a.w)); + return z.normalize(), z; } M < 0 && (l = l.clone().multiplyScalar(-1), M = -M), M > 1 ? M = 1 : M < -1 && (M = -1); - var L = Math.acos(M), T = L * g, D = l.clone(); + var C = Math.acos(M), T = C * g, D = l.clone(); D.sub(a.clone().multiplyScalar(M)), D.normalize(); - var I = Math.cos(T), z = Math.sin(T), P = new f.Quaternion(a.x * I + D.x * z, a.y * I + D.y * z, a.z * I + D.z * z, a.w * I + D.w * z); + var I = Math.cos(T), B = Math.sin(T), P = new f.Quaternion(a.x * I + D.x * B, a.y * I + D.y * B, a.z * I + D.z * B, a.w * I + D.w * B); return P.normalize(), P; } /* @param {Object} element HTML element within which to create viewer @@ -6322,13 +6322,13 @@ ATOM`, g); modelToScreen(a) { let l = !1; Array.isArray(a) || (a = [a], l = !0); - let g = this.renderer.getXRatio(), M = this.renderer.getYRatio(), L = this.col, T = this.row, D = L * (this.WIDTH / g), I = (M - T - 1) * (this.HEIGHT / M), z = [], P = this.canvasOffset(); - return a.forEach((B) => { - let k = new f.Vector3(B.x, B.y, B.z); + let g = this.renderer.getXRatio(), M = this.renderer.getYRatio(), C = this.col, T = this.row, D = C * (this.WIDTH / g), I = (M - T - 1) * (this.HEIGHT / M), B = [], P = this.canvasOffset(); + return a.forEach((z) => { + let k = new f.Vector3(z.x, z.y, z.z); k.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(k, this.camera); - let N = this.WIDTH / g * (k.x + 1) / 2 + P.left + D, $ = -(this.HEIGHT / M) * (k.y - 1) / 2 + P.top + I; - z.push({ x: N, y: $ }); - }), l && (z = z[0]), z; + let N = this.WIDTH / g * (k.x + 1) / 2 + P.left + D, R = -(this.HEIGHT / M) * (k.y - 1) / 2 + P.top + I; + B.push({ x: N, y: R }); + }), l && (B = B[0]), B; } /** * For a given screen (x,y) displacement return model displacement @@ -6337,8 +6337,8 @@ ATOM`, g); * @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis */ screenOffsetToModel(a, l, g) { - var M = a / this.WIDTH, L = l / this.HEIGHT, T = g === void 0 ? this.rotationGroup.position.z : g, D = this.rotationGroup.quaternion, I = new f.Vector3(0, 0, T); - return this.projector.projectVector(I, this.camera), I.x += M * 2, I.y -= L * 2, this.projector.unprojectVector(I, this.camera), I.z = 0, I.applyQuaternion(D), I; + var M = a / this.WIDTH, C = l / this.HEIGHT, T = g === void 0 ? this.rotationGroup.position.z : g, D = this.rotationGroup.quaternion, I = new f.Vector3(0, 0, T); + return this.projector.projectVector(I, this.camera), I.x += M * 2, I.y -= C * 2, this.projector.unprojectVector(I, this.camera), I.z = 0, I.applyQuaternion(D), I; } /** * Distance from screen coordinate to model coordinate assuming screen point @@ -6349,10 +6349,10 @@ ATOM`, g); screenToModelDistance(a, l) { let g = this.canvasOffset(), M = new f.Vector3(l.x, l.y, l.z); M.applyMatrix4(this.modelGroup.matrixWorld); - let L = M.clone(); + let C = M.clone(); this.projector.projectVector(M, this.camera); let T = new f.Vector3((a.x - g.left) * 2 / this.WIDTH - 1, (a.y - g.top) * 2 / -this.HEIGHT + 1, M.z); - return this.projector.unprojectVector(T, this.camera), T.distanceTo(L); + return this.projector.unprojectVector(T, this.camera), T.distanceTo(C); } /** * Set a callback to call when the view has potentially changed. @@ -6467,12 +6467,12 @@ ATOM`, g); if (a.preventDefault(), !!this.scene) { var l = this.getX(a), g = this.getY(a); if (l !== void 0 && !(!this.control_all && !this.isInViewer(l, g))) { - var M = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, L = 1; - if (a.ctrlKey && (L = -1), a.detail) - this.rotationGroup.position.z += L * M * a.detail / 10; + var M = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, C = 1; + if (a.ctrlKey && (C = -1), a.detail) + this.rotationGroup.position.z += C * M * a.detail / 10; else if (a.wheelDelta) { let T = a.wheelDelta * 600 / (a.wheelDelta + 600); - this.rotationGroup.position.z -= L * M * T / 400; + this.rotationGroup.position.z -= C * M * T / 400; } this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show(); } @@ -6492,22 +6492,22 @@ ATOM`, g); apngURI(a) { let l = this; return a = a || 1, new Promise(function(g) { - let M = 0, L = l.viewChangeCallback, T = [], D = [], I = Date.now(); + let M = 0, C = l.viewChangeCallback, T = [], D = [], I = Date.now(); l.viewChangeCallback = function() { - D.push(Date.now() - I), I = Date.now(), T.push(new Promise((z) => { + D.push(Date.now() - I), I = Date.now(), T.push(new Promise((B) => { l.getCanvas().toBlob(function(P) { - P.arrayBuffer().then(z); + P.arrayBuffer().then(B); }, "image/png"); - })), M += 1, M == a && (l.viewChangeCallback = L, Promise.all(T).then((z) => { + })), M += 1, M == a && (l.viewChangeCallback = C, Promise.all(T).then((B) => { let P = []; - for (let G = 0; G < z.length; G++) { - let H = (0, S.decode)(z[G]); - P.push((0, S.toRGBA8)(H)[0]); + for (let W = 0; W < B.length; W++) { + let G = (0, L.decode)(B[W]); + P.push((0, L.toRGBA8)(G)[0]); } - let B = l.getCanvas().width, k = l.getCanvas().height, N = (0, S.encode)(P, B, k, 0, D), $ = new Blob([N], { type: "image/png" }), F = new FileReader(); - F.onload = function(G) { - g(G.target.result); - }, F.readAsDataURL($); + let z = l.getCanvas().width, k = l.getCanvas().height, N = (0, L.encode)(P, z, k, 0, D), R = new Blob([N], { type: "image/png" }), U = new FileReader(); + U.onload = function(W) { + g(W.target.result); + }, U.readAsDataURL(R); })); }; }); @@ -6536,38 +6536,38 @@ ATOM`, g); this.hoverDuration = a; } mouseXY(a, l) { - let g = this.canvasOffset(), M = this.renderer.getXRatio(), L = this.renderer.getYRatio(), T = this.col, D = this.row, I = T * (this.WIDTH / M), z = (L - D - 1) * (this.HEIGHT / L), P = (a - g.left - I) / (this.WIDTH / M) * 2 - 1, B = -((l - g.top - z) / (this.HEIGHT / L)) * 2 + 1; - return { x: P, y: B }; + let g = this.canvasOffset(), M = this.renderer.getXRatio(), C = this.renderer.getYRatio(), T = this.col, D = this.row, I = T * (this.WIDTH / M), B = (C - D - 1) * (this.HEIGHT / C), P = (a - g.left - I) / (this.WIDTH / M) * 2 - 1, z = -((l - g.top - B) / (this.HEIGHT / C)) * 2 + 1; + return { x: P, y: z }; } _handleMouseMove(a) { clearTimeout(this.hoverTimeout), a.preventDefault(); let l = this.getX(a), g = this.getY(a); if (l === void 0) return; - let M = this.renderer.getXRatio(), L = this.renderer.getYRatio(), T = this.mouseXY(l, g), D = this; + let M = this.renderer.getXRatio(), C = this.renderer.getYRatio(), T = this.mouseXY(l, g), D = this; this.current_hover !== null && this.handleHoverContinue(T.x, T.y); var I = 0; if (!(!this.control_all && !this.isInViewer(l, g)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() { D.handleHoverSelection(T.x, T.y, a); }, this.hoverDuration)), !!this.isDragging)) { - var z = (l - this.mouseStartX) / this.WIDTH, P = (g - this.mouseStartY) / this.HEIGHT; + var B = (l - this.mouseStartX) / this.WIDTH, P = (g - this.mouseStartY) / this.HEIGHT; if (this.touchDistanceStart != 0 && a.targetTouches && a.targetTouches.length == 2) { - var B = this.calcTouchDistance(a); - I = 2, P = (B - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); + var z = this.calcTouchDistance(a); + I = 2, P = (z - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); } else a.targetTouches && a.targetTouches.length == 3 && (I = 1); - z *= M, P *= L; - var k = Math.hypot(z, P), N; + B *= M, P *= C; + var k = Math.hypot(B, P), N; if (I == 3 || this.mouseButton == 3 && a.ctrlKey) - this.slabNear = this.cslabNear + z * 100, this.slabFar = this.cslabFar - P * 100; + this.slabNear = this.cslabNear + B * 100, this.slabFar = this.cslabFar - P * 100; else if (I == 2 || this.mouseButton == 3 || a.shiftKey) N = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, N < 80 && (N = 80), this.rotationGroup.position.z = this.cz + P * N, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z); else if (I == 1 || this.mouseButton == 2 || a.ctrlKey) { - var $ = this.screenOffsetToModel(M * (l - this.mouseStartX), L * (g - this.mouseStartY)); - this.modelGroup.position.addVectors(this.currentModelPos, $); + var R = this.screenOffsetToModel(M * (l - this.mouseStartX), C * (g - this.mouseStartY)); + this.modelGroup.position.addVectors(this.currentModelPos, R); } else if ((I === 0 || this.mouseButton == 1) && k !== 0) { - var F = Math.sin(k * Math.PI) / k; - this.dq.x = Math.cos(k * Math.PI), this.dq.y = 0, this.dq.z = F * z, this.dq.w = -F * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); + var U = Math.sin(k * Math.PI) / k; + this.dq.x = Math.cos(k * Math.PI), this.dq.y = 0, this.dq.z = U * B, this.dq.w = -U * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); } this.show(); } @@ -6576,12 +6576,12 @@ ATOM`, g); a.preventDefault(); var l = this.getX(a), g = this.getY(a); if (!(l != this.mouseStartX || g != this.mouseStartY)) { - var T = this.mouseStartX, D = this.mouseStartY, L = this.canvasOffset(); - let I = this.mouseXY(T, D), z = I.x, P = I.y, B = this.targetedObjects(z, P, this.contextMenuEnabledAtoms); + var T = this.mouseStartX, D = this.mouseStartY, C = this.canvasOffset(); + let I = this.mouseXY(T, D), B = I.x, P = I.y, z = this.targetedObjects(B, P, this.contextMenuEnabledAtoms); var M = null; - B.length && (M = B[0].clickable); - var L = this.canvasOffset(), T = this.mouseStartX - L.left, D = this.mouseStartY - L.top; - this.userContextMenuHandler && this.userContextMenuHandler(M, T, D, B); + z.length && (M = z[0].clickable); + var C = this.canvasOffset(), T = this.mouseStartX - C.left, D = this.mouseStartY - C.top; + this.userContextMenuHandler && this.userContextMenuHandler(M, T, D, z); } } /** @@ -6593,7 +6593,7 @@ ATOM`, g); */ setContainer(a) { - let l = (0, y.getElement)(a) || this.container; + let l = (0, b.getElement)(a) || this.container; return this.initContainer(l), this; } /** @@ -6750,10 +6750,10 @@ ATOM`, g); //and rotationgroup quaternion //return array includes final position, but not current //the returned array includes an animate method - animateMotion(a, l, g, M, L, T) { + animateMotion(a, l, g, M, C, T) { var D = 20, I = Math.ceil(a / D); I < 1 && (I = 1), this.incAnim(); - var z = { + var B = { mpos: this.modelGroup.position.clone(), rz: this.rotationGroup.position.z, rot: this.rotationGroup.quaternion.clone(), @@ -6761,27 +6761,27 @@ ATOM`, g); }; if (l) { let k = new Array(I); - for (let G = 0; G < I; G++) { - let H = (G + 1) / I, U = { mpos: z.mpos, rz: z.rz, rot: z.rot }; - U.mpos = g.clone().sub(z.mpos).multiplyScalar(H).add(z.mpos), U.rz = z.rz + H * (M - z.rz), U.rot = s.slerp(z.rot, L, H), U.cam = T.clone().sub(z.cam).multiplyScalar(H).add(z.cam), k[G] = U; + for (let W = 0; W < I; W++) { + let G = (W + 1) / I, F = { mpos: B.mpos, rz: B.rz, rot: B.rot }; + F.mpos = g.clone().sub(B.mpos).multiplyScalar(G).add(B.mpos), F.rz = B.rz + G * (M - B.rz), F.rot = s.slerp(B.rot, C, G), F.cam = T.clone().sub(B.cam).multiplyScalar(G).add(B.cam), k[W] = F; } - let N = 0, $ = this, F = function() { - var G = k[N]; - N += 1, $.modelGroup.position = G.mpos, $.rotationGroup.position.z = G.rz, $.rotationGroup.quaternion = G.rot, $.camera.lookAt(G.cam), N < k.length ? setTimeout(F, D) : $.decAnim(), $.show(); + let N = 0, R = this, U = function() { + var W = k[N]; + N += 1, R.modelGroup.position = W.mpos, R.rotationGroup.position.z = W.rz, R.rotationGroup.quaternion = W.rot, R.camera.lookAt(W.cam), N < k.length ? setTimeout(U, D) : R.decAnim(), R.show(); }; - setTimeout(F, D); + setTimeout(U, D); } else { var P = {}; let k = 1 / I; - if (g && (P.mpos = g.clone().sub(z.mpos).multiplyScalar(k)), typeof M < "u" && M != null && (P.rz = k * (M - z.rz)), L) { - var B = s.slerp(z.rot, L, k); - P.rot = z.rot.clone().inverse().multiply(B); + if (g && (P.mpos = g.clone().sub(B.mpos).multiplyScalar(k)), typeof M < "u" && M != null && (P.rz = k * (M - B.rz)), C) { + var z = s.slerp(B.rot, C, k); + P.rot = B.rot.clone().inverse().multiply(z); } - T && (P.cam = T.clone().sub(z.cam).multiplyScalar(k)); - let N = 0, $ = this, F = function() { - N += 1, P.mpos && $.modelGroup.position.add(P.mpos), P.rz && ($.rotationGroup.position.z += P.rz), P.rot && $.rotationGroup.quaternion.multiply(P.rot), P.cam && ($.lookingAt.add(P.cam), $.camera.lookAt($.lookingAt)), N < I ? setTimeout(F, D) : $.decAnim(), $.show(); + T && (P.cam = T.clone().sub(B.cam).multiplyScalar(k)); + let N = 0, R = this, U = function() { + N += 1, P.mpos && R.modelGroup.position.add(P.mpos), P.rz && (R.rotationGroup.position.z += P.rz), P.rot && R.rotationGroup.quaternion.multiply(P.rot), P.cam && (R.lookingAt.add(P.cam), R.camera.lookAt(R.lookingAt)), N < I ? setTimeout(U, D) : R.decAnim(), R.show(); }; - setTimeout(F, D); + setTimeout(U, D); } } /** @@ -6809,16 +6809,16 @@ ATOM`, g); */ rotate(a, l = "y", g = 0, M = !1) { if (l == "x" ? l = { x: 1, y: 0, z: 0 } : l == "y" ? l = { x: 0, y: 1, z: 0 } : l == "z" && (l = { x: 0, y: 0, z: 1 }), l == "vx" ? l = { vx: 1, vy: 0, vz: 0 } : l == "vy" ? l = { vx: 0, vy: 1, vz: 0 } : l == "vz" && (l = { vx: 0, vy: 0, vz: 1 }), typeof l.vx < "u") { - var L = new f.Vector3(l.vx, l.vy, l.vz); - L.applyQuaternion(this.rotationGroup.quaternion), l = { x: L.x, y: L.y, z: L.z }; + var C = new f.Vector3(l.vx, l.vy, l.vz); + C.applyQuaternion(this.rotationGroup.quaternion), l = { x: C.x, y: C.y, z: C.z }; } var T = function(P) { - var B = Math.sin(P / 2), k = Math.cos(P / 2), N = 0, $ = 0, F = 0; - return N = l.x * B, $ = l.y * B, F = l.z * B, new f.Quaternion(N, $, F, k).normalize(); + var z = Math.sin(P / 2), k = Math.cos(P / 2), N = 0, R = 0, U = 0; + return N = l.x * z, R = l.y * z, U = l.z * z, new f.Quaternion(N, R, U, k).normalize(); }, D = Math.PI * a / 180, I = T(D); if (g) { - var z = new f.Quaternion().copy(this.rotationGroup.quaternion).multiply(I); - this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, z, this.lookingAt); + var B = new f.Quaternion().copy(this.rotationGroup.quaternion).multiply(I); + this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, B, this.lookingAt); } else this.rotationGroup.quaternion.multiply(I), this.show(); return this; @@ -6864,7 +6864,7 @@ ATOM`, g); this.renderer.setViewport(), this.updateClickables(); var g = this.getView(); this.stateChangeCallback && this.stateChangeCallback(this.getInternalState()); - var M, L; + var M, C; for (l || (l = this.renderer.supportedExtensions()), M = 0; M < this.models.length; M++) this.models[M] && this.models[M].globj(this.modelGroup, l); for (M = 0; M < this.shapes.length; M++) @@ -6874,21 +6874,21 @@ ATOM`, g); for (M in this.surfaces) if (this.surfaces.hasOwnProperty(M)) { var T = this.surfaces[M]; - for (L = 0; L < T.length; L++) - if (T.hasOwnProperty(L)) { - var D = T[L].geo; - if (!T[L].finished || l.regen) { - D.verticesNeedUpdate = !0, D.elementsNeedUpdate = !0, D.normalsNeedUpdate = !0, D.colorsNeedUpdate = !0, D.buffersNeedUpdate = !0, D.boundingSphere = null, T[L].done && (T[L].finished = !0), T[L].lastGL && this.modelGroup.remove(T[L].lastGL); + for (C = 0; C < T.length; C++) + if (T.hasOwnProperty(C)) { + var D = T[C].geo; + if (!T[C].finished || l.regen) { + D.verticesNeedUpdate = !0, D.elementsNeedUpdate = !0, D.normalsNeedUpdate = !0, D.colorsNeedUpdate = !0, D.buffersNeedUpdate = !0, D.boundingSphere = null, T[C].done && (T[C].finished = !0), T[C].lastGL && this.modelGroup.remove(T[C].lastGL); var I = null; - if (T[L].mat instanceof n.LineBasicMaterial ? I = new n.Line(D, T[L].mat) : I = new n.Mesh(D, T[L].mat), T[L].mat.transparent && T[L].mat.opacity == 0 ? I.visible = !1 : I.visible = !0, T[L].symmetries.length > 1 || T[L].symmetries.length == 1 && !T[L].symmetries[L].isIdentity()) { - var z, P = new n.Object3D(); - for (z = 0; z < T[L].symmetries.length; z++) { - var B = I.clone(); - B.matrix = T[L].symmetries[z], B.matrixAutoUpdate = !1, P.add(B); + if (T[C].mat instanceof n.LineBasicMaterial ? I = new n.Line(D, T[C].mat) : I = new n.Mesh(D, T[C].mat), T[C].mat.transparent && T[C].mat.opacity == 0 ? I.visible = !1 : I.visible = !0, T[C].symmetries.length > 1 || T[C].symmetries.length == 1 && !T[C].symmetries[C].isIdentity()) { + var B, P = new n.Object3D(); + for (B = 0; B < T[C].symmetries.length; B++) { + var z = I.clone(); + z.matrix = T[C].symmetries[B], z.matrixAutoUpdate = !1, P.add(z); } - T[L].lastGL = P, this.modelGroup.add(P); + T[C].lastGL = P, this.modelGroup.add(P); } else - T[L].lastGL = I, this.modelGroup.add(I); + T[C].lastGL = I, this.modelGroup.add(I); } } } @@ -6905,12 +6905,12 @@ ATOM`, g); else { let M = a.model; Array.isArray(M) || (M = [M]); - for (let L = 0; L < M.length; L++) - if (typeof M[L] == "number") { - var g = M[L]; + for (let C = 0; C < M.length; C++) + if (typeof M[C] == "number") { + var g = M[C]; g < 0 && (g += this.models.length), l.push(this.models[g]); } else - l.push(M[L]); + l.push(M[C]); } return l; } @@ -6961,9 +6961,9 @@ ATOM`, g); getUniqueValues(a, l) { typeof l > "u" && (l = {}); var g = this.getAtomsFromSel(l), M = {}; - for (var L in g) - if (g[L].hasOwnProperty(a)) { - var T = g[L][a]; + for (var C in g) + if (g[C].hasOwnProperty(a)) { + var T = g[C][a]; M[T] = !0; } return Object.keys(M); @@ -6975,7 +6975,7 @@ ATOM`, g); * @return {string} PDB string of selected atoms */ pdbData(a) { - for (var l = this.getAtomsFromSel(a), g = "", M = 0, L = l.length; M < L; ++M) + for (var l = this.getAtomsFromSel(a), g = "", M = 0, C = l.length; M < C; ++M) g += l[M].pdbline + ` `; return g; @@ -7002,8 +7002,8 @@ ATOM`, g); */ zoom(a = 2, l = 0, g = !1) { - var M = (this.CAMERA_Z - this.rotationGroup.position.z) / a, L = this.CAMERA_Z - M; - return l > 0 ? this.animateMotion(l, g, this.modelGroup.position, this.adjustZoomToLimits(L), this.rotationGroup.quaternion, this.lookingAt) : (this.rotationGroup.position.z = this.adjustZoomToLimits(L), this.show()), this; + var M = (this.CAMERA_Z - this.rotationGroup.position.z) / a, C = this.CAMERA_Z - M; + return l > 0 ? this.animateMotion(l, g, this.modelGroup.position, this.adjustZoomToLimits(C), this.rotationGroup.quaternion, this.lookingAt) : (this.rotationGroup.position.z = this.adjustZoomToLimits(C), this.show()), this; } /** * Translate current view by x,y screen coordinates @@ -7026,8 +7026,8 @@ ATOM`, g); }); */ translate(a, l, g = 0, M = !1) { - var L = a / this.WIDTH, T = l / this.HEIGHT, D = new f.Vector3(0, 0, -this.CAMERA_Z); - this.projector.projectVector(D, this.camera), D.x -= L, D.y -= T, this.projector.unprojectVector(D, this.camera), D.z = 0; + var C = a / this.WIDTH, T = l / this.HEIGHT, D = new f.Vector3(0, 0, -this.CAMERA_Z); + this.projector.projectVector(D, this.camera), D.x -= C, D.y -= T, this.projector.unprojectVector(D, this.camera), D.z = 0; var I = this.lookingAt.clone().add(D); return g > 0 ? this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, I) : (this.lookingAt = I, this.camera.lookAt(this.lookingAt), this.show()), this; } @@ -7053,7 +7053,7 @@ ATOM`, g); }); */ translateScene(a, l, g = 0, M = !1) { - var L = this.screenOffsetToModel(a, l), T = this.modelGroup.position.clone().add(L); + var C = this.screenOffsetToModel(a, l), T = this.modelGroup.position.clone().add(C); return g > 0 ? this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = T, this.show()), this; } /** @@ -7065,7 +7065,7 @@ ATOM`, g); */ fitSlab(a) { a = a || {}; - var l = this.getAtomsFromSel(a), g = (0, y.getExtent)(l), M = g[1][0] - g[0][0], L = g[1][1] - g[0][1], T = g[1][2] - g[0][2], D = Math.hypot(M, L, T); + var l = this.getAtomsFromSel(a), g = (0, b.getExtent)(l), M = g[1][0] - g[0][0], C = g[1][1] - g[0][1], T = g[1][2] - g[0][2], D = Math.hypot(M, C, T); return D < 5 && (D = 5), this.slabNear = -D / 1.9, this.slabFar = D / 2, this; } /** @@ -7093,23 +7093,23 @@ ATOM`, g); }); */ center(a = {}, l = 0, g = !1) { - var M, L, T = this.getAtomsFromSel(a), D = (0, y.getExtent)(T); - (0, y.isEmptyObject)(a) ? (this.shapes.forEach((H) => { - if (H && H.boundingSphere && H.boundingSphere.center) { - var U = H.boundingSphere.center, V = H.boundingSphere.radius; - V > 0 ? (T.push(new f.Vector3(U.x + V, U.y, U.z)), T.push(new f.Vector3(U.x - V, U.y, U.z)), T.push(new f.Vector3(U.x, U.y + V, U.z)), T.push(new f.Vector3(U.x, U.y - V, U.z)), T.push(new f.Vector3(U.x, U.y, U.z + V)), T.push(new f.Vector3(U.x, U.y, U.z - V))) : T.push(U); + var M, C, T = this.getAtomsFromSel(a), D = (0, b.getExtent)(T); + (0, b.isEmptyObject)(a) ? (this.shapes.forEach((G) => { + if (G && G.boundingSphere && G.boundingSphere.center) { + var F = G.boundingSphere.center, V = G.boundingSphere.radius; + V > 0 ? (T.push(new f.Vector3(F.x + V, F.y, F.z)), T.push(new f.Vector3(F.x - V, F.y, F.z)), T.push(new f.Vector3(F.x, F.y + V, F.z)), T.push(new f.Vector3(F.x, F.y - V, F.z)), T.push(new f.Vector3(F.x, F.y, F.z + V)), T.push(new f.Vector3(F.x, F.y, F.z - V))) : T.push(F); } - }), D = (0, y.getExtent)(T), M = T, L = D) : (M = this.getAtomsFromSel({}), L = (0, y.getExtent)(M)); - var I = new f.Vector3(D[2][0], D[2][1], D[2][2]), z = L[1][0] - L[0][0], P = L[1][1] - L[0][1], B = L[1][2] - L[0][2], k = Math.hypot(z, P, B); - k < 5 && (k = 5), this.slabNear = -k / 1.9, this.slabFar = k / 2, z = D[1][0] - D[0][0], P = D[1][1] - D[0][1], B = D[1][2] - D[0][2], k = Math.hypot(z, P, B), k < 5 && (k = 5); - for (var N = 25, $ = 0; $ < T.length; $++) - if (T[$]) { - var F = I.distanceToSquared(T[$]); - F > N && (N = F); + }), D = (0, b.getExtent)(T), M = T, C = D) : (M = this.getAtomsFromSel({}), C = (0, b.getExtent)(M)); + var I = new f.Vector3(D[2][0], D[2][1], D[2][2]), B = C[1][0] - C[0][0], P = C[1][1] - C[0][1], z = C[1][2] - C[0][2], k = Math.hypot(B, P, z); + k < 5 && (k = 5), this.slabNear = -k / 1.9, this.slabFar = k / 2, B = D[1][0] - D[0][0], P = D[1][1] - D[0][1], z = D[1][2] - D[0][2], k = Math.hypot(B, P, z), k < 5 && (k = 5); + for (var N = 25, R = 0; R < T.length; R++) + if (T[R]) { + var U = I.distanceToSquared(T[R]); + U > N && (N = U); } k = Math.sqrt(N) * 2; - var G = I.clone().multiplyScalar(-1); - return l > 0 ? this.animateMotion(l, g, G, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = G, this.show()), this; + var W = I.clone().multiplyScalar(-1); + return l > 0 ? this.animateMotion(l, g, W, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = W, this.show()), this; } /** * Zoom to center of atom selection. The slab will be set appropriately for @@ -7141,38 +7141,38 @@ ATOM`, g); }); */ zoomTo(a = {}, l = 0, g = !1) { - let M = this.getAtomsFromSel(a), L = (0, y.getExtent)(M), T = L; - if ((0, y.isEmptyObject)(a)) { - let U = M && M.length; + let M = this.getAtomsFromSel(a), C = (0, b.getExtent)(M), T = C; + if ((0, b.isEmptyObject)(a)) { + let F = M && M.length; if (this.shapes.forEach((V) => { if (V && V.boundingSphere) { if (V.boundingSphere.box) { let oe = V.boundingSphere.box; M.push(new f.Vector3(oe.min.x, oe.min.y, oe.min.z)), M.push(new f.Vector3(oe.max.x, oe.max.y, oe.max.z)); } else if (V.boundingSphere.center) { - var Q = V.boundingSphere.center, ae = V.boundingSphere.radius; - ae > 0 ? (M.push(new f.Vector3(Q.x + ae, Q.y, Q.z)), M.push(new f.Vector3(Q.x - ae, Q.y, Q.z)), M.push(new f.Vector3(Q.x, Q.y + ae, Q.z)), M.push(new f.Vector3(Q.x, Q.y - ae, Q.z)), M.push(new f.Vector3(Q.x, Q.y, Q.z + ae)), M.push(new f.Vector3(Q.x, Q.y, Q.z - ae))) : M.push(Q); + var J = V.boundingSphere.center, X = V.boundingSphere.radius; + X > 0 ? (M.push(new f.Vector3(J.x + X, J.y, J.z)), M.push(new f.Vector3(J.x - X, J.y, J.z)), M.push(new f.Vector3(J.x, J.y + X, J.z)), M.push(new f.Vector3(J.x, J.y - X, J.z)), M.push(new f.Vector3(J.x, J.y, J.z + X)), M.push(new f.Vector3(J.x, J.y, J.z - X))) : M.push(J); } } - }), T = (0, y.getExtent)(M), !U) + }), T = (0, b.getExtent)(M), !F) for (let V = 0; V < 3; V++) - L[2][V] = (T[0][V] + T[1][V]) / 2; + C[2][V] = (T[0][V] + T[1][V]) / 2; } else { - let U = this.getAtomsFromSel({}); - T = (0, y.getExtent)(U); + let F = this.getAtomsFromSel({}); + T = (0, b.getExtent)(F); } - var D = new f.Vector3(L[2][0], L[2][1], L[2][2]), I = T[1][0] - T[0][0], z = T[1][1] - T[0][1], P = T[1][2] - T[0][2], B = Math.hypot(I, z, P); - B < 5 && (B = 5), this.slabNear = -B / 1.9, this.slabFar = B / 2, Object.keys(a).length === 0 && (this.slabNear = Math.min(-B * 2, -50), this.slabFar = Math.max(B * 2, 50)); + var D = new f.Vector3(C[2][0], C[2][1], C[2][2]), I = T[1][0] - T[0][0], B = T[1][1] - T[0][1], P = T[1][2] - T[0][2], z = Math.hypot(I, B, P); + z < 5 && (z = 5), this.slabNear = -z / 1.9, this.slabFar = z / 2, Object.keys(a).length === 0 && (this.slabNear = Math.min(-z * 2, -50), this.slabFar = Math.max(z * 2, 50)); var k = this.config.minimumZoomToDistance || 5; - I = L[1][0] - L[0][0], z = L[1][1] - L[0][1], P = L[1][2] - L[0][2], B = Math.hypot(I, z, P), B < k && (B = k); - for (var N = k * k, $ = 0; $ < M.length; $++) - if (M[$]) { - var F = D.distanceToSquared(M[$]); - F > N && (N = F); + I = C[1][0] - C[0][0], B = C[1][1] - C[0][1], P = C[1][2] - C[0][2], z = Math.hypot(I, B, P), z < k && (z = k); + for (var N = k * k, R = 0; R < M.length; R++) + if (M[R]) { + var U = D.distanceToSquared(M[R]); + U > N && (N = U); } - B = Math.sqrt(N) * 2; - var G = D.clone().multiplyScalar(-1), H = -(B * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); - return H = this.adjustZoomToLimits(H), l > 0 ? this.animateMotion(l, g, G, H, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = G, this.rotationGroup.position.z = H, this.show()), this; + z = Math.sqrt(N) * 2; + var W = D.clone().multiplyScalar(-1), G = -(z * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); + return G = this.adjustZoomToLimits(G), l > 0 ? this.animateMotion(l, g, W, G, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = W, this.rotationGroup.position.z = G, this.show()), this; } /** * Set slab of view (contents outside of slab are clipped). @@ -7234,8 +7234,8 @@ ATOM`, g); */ addLabel(a, l = {}, g, M = !1) { if (g) { - var L = (0, y.getExtent)(this.getAtomsFromSel(g)); - l.position = { x: L[2][0], y: L[2][1], z: L[2][2] }; + var C = (0, b.getExtent)(this.getAtomsFromSel(g)); + l.position = { x: C[2][0], y: C[2][1], z: C[2][2] }; } var T = new E.Label(a, l); return T.setContext(), this.modelGroup.add(T.sprite), this.labels.push(T), M || this.show(), T; @@ -7389,7 +7389,7 @@ ATOM`, g); var l = this.getAtomsFromSel(a); if (l.length == 0) return { x: 0, y: 0, z: 0 }; - var g = (0, y.getExtent)(l); + var g = (0, b.getExtent)(l); return { x: g[0][0] + (g[1][0] - g[0][0]) / 2, y: g[0][1] + (g[1][1] - g[0][1]) / 2, z: g[0][2] + (g[1][2] - g[0][2]) / 2 }; } /** @@ -7570,12 +7570,12 @@ ATOM`, g); if (g.matrix) M = g.matrix; else { - var L = g.a, T = g.b, D = g.c, I = g.alpha, z = g.beta, P = g.gamma; - I = I * Math.PI / 180, z = z * Math.PI / 180, P = P * Math.PI / 180; - var B, k, N; - B = Math.cos(z), k = (Math.cos(I) - Math.cos(z) * Math.cos(P)) / Math.sin(P), N = Math.sqrt(Math.max(0, 1 - B * B - k * k)), M = new f.Matrix3(L, T * Math.cos(P), D * B, 0, T * Math.sin(P), D * k, 0, 0, D * N); + var C = g.a, T = g.b, D = g.c, I = g.alpha, B = g.beta, P = g.gamma; + I = I * Math.PI / 180, B = B * Math.PI / 180, P = P * Math.PI / 180; + var z, k, N; + z = Math.cos(B), k = (Math.cos(I) - Math.cos(B) * Math.cos(P)) / Math.sin(P), N = Math.sqrt(Math.max(0, 1 - z * z - k * k)), M = new f.Matrix3(C, T * Math.cos(P), D * z, 0, T * Math.sin(P), D * k, 0, 0, D * N); } - var $ = [ + var R = [ new f.Vector3(0, 0, 0), new f.Vector3(1, 0, 0), new f.Vector3(0, 1, 0), @@ -7586,45 +7586,45 @@ ATOM`, g); new f.Vector3(1, 1, 1) ]; if (g.matrix4) - for (let G = 0; G < $.length; G++) - g.size && $[G].multiplyVectors($[G], g.size), $[G] = $[G].applyMatrix4(g.matrix4); + for (let W = 0; W < R.length; W++) + g.size && R[W].multiplyVectors(R[W], g.size), R[W] = R[W].applyMatrix4(g.matrix4); else - for (let G = 0; G < $.length; G++) - $[G] = $[G].applyMatrix3(M); + for (let W = 0; W < R.length; W++) + R[W] = R[W].applyMatrix3(M); if (l.box && !l.box.hidden) { l.box.wireframe = !0; - var F = new c.GLShape(l.box); - F.shapePosition = this.shapes.length, F.addLine({ start: $[0], end: $[1] }), F.addLine({ start: $[0], end: $[2] }), F.addLine({ start: $[1], end: $[4] }), F.addLine({ start: $[2], end: $[4] }), F.addLine({ start: $[0], end: $[3] }), F.addLine({ start: $[3], end: $[5] }), F.addLine({ start: $[2], end: $[5] }), F.addLine({ start: $[1], end: $[6] }), F.addLine({ start: $[4], end: $[7] }), F.addLine({ start: $[6], end: $[7] }), F.addLine({ start: $[3], end: $[6] }), F.addLine({ start: $[5], end: $[7] }), this.shapes.push(F), a.unitCellObjects.shapes.push(F), F.finalize(); + var U = new c.GLShape(l.box); + U.shapePosition = this.shapes.length, U.addLine({ start: R[0], end: R[1] }), U.addLine({ start: R[0], end: R[2] }), U.addLine({ start: R[1], end: R[4] }), U.addLine({ start: R[2], end: R[4] }), U.addLine({ start: R[0], end: R[3] }), U.addLine({ start: R[3], end: R[5] }), U.addLine({ start: R[2], end: R[5] }), U.addLine({ start: R[1], end: R[6] }), U.addLine({ start: R[4], end: R[7] }), U.addLine({ start: R[6], end: R[7] }), U.addLine({ start: R[3], end: R[6] }), U.addLine({ start: R[5], end: R[7] }), this.shapes.push(U), a.unitCellObjects.shapes.push(U), U.finalize(); } if (!l.astyle.hidden) { - l.astyle.start = $[0], l.astyle.end = $[1]; - let G = this.addArrow(l.astyle); - a.unitCellObjects.shapes.push(G); + l.astyle.start = R[0], l.astyle.end = R[1]; + let W = this.addArrow(l.astyle); + a.unitCellObjects.shapes.push(W); } if (!l.bstyle.hidden) { - l.bstyle.start = $[0], l.bstyle.end = $[2]; - let G = this.addArrow(l.bstyle); - a.unitCellObjects.shapes.push(G); + l.bstyle.start = R[0], l.bstyle.end = R[2]; + let W = this.addArrow(l.bstyle); + a.unitCellObjects.shapes.push(W); } if (!l.cstyle.hidden) { - l.cstyle.start = $[0], l.cstyle.end = $[3]; - let G = this.addArrow(l.cstyle); - a.unitCellObjects.shapes.push(G); + l.cstyle.start = R[0], l.cstyle.end = R[3]; + let W = this.addArrow(l.cstyle); + a.unitCellObjects.shapes.push(W); } if (l.alabel) { - l.alabelstyle.position = $[1]; - let G = this.addLabel(l.alabel, l.alabelstyle); - a.unitCellObjects.labels.push(G); + l.alabelstyle.position = R[1]; + let W = this.addLabel(l.alabel, l.alabelstyle); + a.unitCellObjects.labels.push(W); } if (l.blabel) { - l.blabelstyle.position = $[2]; - let G = this.addLabel(l.blabel, l.blabelstyle); - a.unitCellObjects.labels.push(G); + l.blabelstyle.position = R[2]; + let W = this.addLabel(l.blabel, l.blabelstyle); + a.unitCellObjects.labels.push(W); } if (l.clabel) { - l.clabelstyle.position = $[3]; - let G = this.addLabel(l.clabel, l.clabelstyle); - a.unitCellObjects.labels.push(G); + l.clabelstyle.position = R[3]; + let W = this.addLabel(l.clabel, l.clabelstyle); + a.unitCellObjects.labels.push(W); } } } @@ -7672,31 +7672,31 @@ ATOM`, g); viewer.render(); }); */ - replicateUnitCell(a = 3, l = a, g = l, M, L) { + replicateUnitCell(a = 3, l = a, g = l, M, C) { M = this.getModel(M); let T = M.getCrystData(); if (T) { const D = M.selectedAtoms({}), I = T.matrix; - let z = function(P) { + let B = function(P) { return P % 2 == 0 ? -P / 2 : Math.ceil(P / 2); }; for (let P = 0; P < a; P++) - for (let B = 0; B < l; B++) + for (let z = 0; z < l; z++) for (let k = 0; k < g; k++) { - if (P == 0 && B == 0 && k == 0) + if (P == 0 && z == 0 && k == 0) continue; - let N = new f.Vector3(z(P), z(B), z(k)); + let N = new f.Vector3(B(P), B(z), B(k)); N.applyMatrix3(I); - let $ = []; - for (let F = 0; F < D.length; F++) { - let G = {}; - for (let H in D[F]) - G[H] = D[F][H]; - G.x += N.x, G.y += N.y, G.z += N.z, $.push(G); + let R = []; + for (let U = 0; U < D.length; U++) { + let W = {}; + for (let G in D[U]) + W[G] = D[U][G]; + W.x += N.x, W.y += N.y, W.z += N.z, R.push(W); } - M.addAtoms($); + M.addAtoms(R); } - L && M.assignBonds(); + C && M.assignBonds(); } } /** Add dashed line to shape */ @@ -7706,13 +7706,13 @@ ATOM`, g); a.start ? g = new f.Vector3(a.start.x || 0, a.start.y || 0, a.start.z || 0) : g = new f.Vector3(0, 0, 0); var M; a.end ? M = new f.Vector3(a.end.x, a.end.y || 0, a.end.z || 0) : M = new f.Vector3(0, 0, 0); - var L = new f.Vector3(), T = new f.Vector3(), D = new f.Vector3(), I, z, P, B = g.clone(), k = 0; - for (L.subVectors(M, g), I = L.length(), L.normalize(), T = L.clone(), D = L.clone(), T.multiplyScalar(a.dashLength), D.multiplyScalar(a.gapLength), z = T.length(), P = D.length(); k < I; ) { - if (k + z > I) { + var C = new f.Vector3(), T = new f.Vector3(), D = new f.Vector3(), I, B, P, z = g.clone(), k = 0; + for (C.subVectors(M, g), I = C.length(), C.normalize(), T = C.clone(), D = C.clone(), T.multiplyScalar(a.dashLength), D.multiplyScalar(a.gapLength), B = T.length(), P = D.length(); k < I; ) { + if (k + B > I) { a.start = g, a.end = M, l.addLine(a); break; } - B.addVectors(g, T), a.start = g, a.end = B, l.addLine(a), g = B.clone(), k += z, B.addVectors(g, D), g = B.clone(), k += P; + z.addVectors(g, T), a.start = g, a.end = z, l.addLine(a), g = z.clone(), k += B, z.addVectors(g, D), g = z.clone(), k += P; } return l.finalize(), l; } @@ -7774,7 +7774,7 @@ ATOM`, g); */ addVolumetricData(a, l, g = {}) { - var M = new C.VolumeData(a, l); + var M = new S.VolumeData(a, l); return g.hasOwnProperty("transferfn") ? this.addVolumetricRender(M, g) : this.addIsosurface(M, g); } /** @@ -7809,7 +7809,7 @@ ATOM`, g); */ addVolumetricRender(a, l) { l = l || {}; - var g = new A.GLVolumetricRender(a, l); + var g = new w.GLVolumetricRender(a, l); return g.shapePosition = this.shapes.length, this.shapes.push(g), g; } /** @@ -7840,8 +7840,8 @@ ATOM`, g); this.viewer_frame = a; let l = this; return new Promise(function(g) { - var M = l.models.map(function(L) { - return L.setFrame(a, l); + var M = l.models.map(function(C) { + return C.setFrame(a, l); }); Promise.all(M).then(function() { g(); @@ -7880,29 +7880,29 @@ ATOM`, g); this.incAnim(); var l = 100, g = "forward", M = 0; a = a || {}, a.interval && (l = a.interval), a.loop && (g = a.loop), a.reps && (M = a.reps); - var L = this.getNumFrames(), T = this, D = 0; - a.startFrame && (D = a.startFrame % L); + var C = this.getNumFrames(), T = this, D = 0; + a.startFrame && (D = a.startFrame % C); var I = 1; a.step && (I = a.step, M /= I); - var z = 0, P = L * M, B = /* @__PURE__ */ new Date(), k, N, $ = function(F) { - B = /* @__PURE__ */ new Date(), F == "forward" ? T.setFrame(D).then(function() { - D = (D + I) % L, k(); - }) : F == "backward" ? T.setFrame(L - 1 - D).then(function() { - D = (D + I) % L, k(); + var B = 0, P = C * M, z = /* @__PURE__ */ new Date(), k, N, R = function(U) { + z = /* @__PURE__ */ new Date(), U == "forward" ? T.setFrame(D).then(function() { + D = (D + I) % C, k(); + }) : U == "backward" ? T.setFrame(C - 1 - D).then(function() { + D = (D + I) % C, k(); }) : T.setFrame(D).then(function() { - D += I, I *= D % (L - 1) == 0 ? -1 : 1, k(); + D += I, I *= D % (C - 1) == 0 ? -1 : 1, k(); }); }; return k = function() { if (T.render(), !T.getCanvas().isConnected) T.stopAnimate(); - else if (++z == P || !T.isAnimated()) + else if (++B == P || !T.isAnimated()) N.cancel(), T.animationTimers.delete(N), T.decAnim(); else { - var F = l - ((/* @__PURE__ */ new Date()).getTime() - B.getTime()); - F = F > 0 ? F : 0, T.animationTimers.delete(N), N = new y.PausableTimer($, F, g), T.animationTimers.add(N); + var U = l - ((/* @__PURE__ */ new Date()).getTime() - z.getTime()); + U = U > 0 ? U : 0, T.animationTimers.delete(N), N = new b.PausableTimer(R, U, g), T.animationTimers.add(N); } - }, N = new y.PausableTimer($, 0, g), this.animationTimers.add(N), this; + }, N = new b.PausableTimer(R, 0, g), this.animationTimers.add(N), this; } /** * Stop animation of all models in viewer @@ -7972,9 +7972,9 @@ ATOM`, g); */ addModels(a, l, g) { g = g || {}, g.multimodel = !0, g.frames = !0; - for (var M = _.GLModel.parseMolData(a, l, g), L = 0; L < M.length; L++) { + for (var M = _.GLModel.parseMolData(a, l, g), C = 0; C < M.length; C++) { var T = new _.GLModel(this.models.length, this.defaultcolors); - T.setAtomDefaults(M[L]), T.addFrame(M[L]), T.setFrame(0), M.modelData && T.setModelData(M.modelData[L]), T.setDontDuplicateAtoms(!g.duplicateAssemblyAtoms), this.models.push(T); + T.setAtomDefaults(M[C]), T.addFrame(M[C]), T.setFrame(0), M.modelData && T.setModelData(M.modelData[C]), T.setDontDuplicateAtoms(!g.duplicateAssemblyAtoms), this.models.push(T); } return this.models; } @@ -8078,14 +8078,14 @@ ATOM`, g); createModelFrom(a, l = !1) { for (var g = new _.GLModel(this.models.length, this.defaultcolors), M = 0; M < this.models.length; M++) if (this.models[M]) { - var L = this.models[M].selectedAtoms(a); - g.addAtoms(L), l && this.models[M].removeAtoms(L); + var C = this.models[M].selectedAtoms(a); + g.addAtoms(C), l && this.models[M].removeAtoms(C); } return this.models.push(g), g; } - applyToModels(a, l, g, M, L, T, D) { - for (var I = this.getModelList(l), z = 0; z < I.length; z++) - I[z][a](l, g, M, L, T, D); + applyToModels(a, l, g, M, C, T, D) { + for (var I = this.getModelList(l), B = 0; B < I.length; B++) + I[B][a](l, g, M, C, T, D); } setStyle(a, l) { return typeof l > "u" && (l = a, a = {}), this.applyToModels("setStyle", a, l, !1), this; @@ -8190,8 +8190,8 @@ ATOM`, g); */ static getAtomsWithin(a, l) { var g = []; - for (let L = 0; L < a.length; L++) { - var M = a[L]; + for (let C = 0; C < a.length; C++) { + var M = a[C]; typeof M > "u" || M.x < l[0][0] || M.x > l[1][0] || M.y < l[0][1] || M.y > l[1][1] || M.z < l[0][2] || M.z > l[1][2] || g.push(M); } return g; @@ -8217,35 +8217,35 @@ ATOM`, g); * @return {Array} */ carveUpExtent(a, l, g) { - let M = [], L = {}; - for (let B = 0, k = l.length; B < k; B++) - L[l[B].index] = B; - let T = function(B) { + let M = [], C = {}; + for (let z = 0, k = l.length; z < k; z++) + C[l[z].index] = z; + let T = function(z) { let k = []; - for (let N = 0, $ = B.length; N < $; N++) - B[N].index in L && k.push(L[B[N].index]); + for (let N = 0, R = z.length; N < R; N++) + z[N].index in C && k.push(C[z[N].index]); return k; - }, D = function(B) { + }, D = function(z) { let k = []; - return k[0] = [B[0][0], B[0][1], B[0][2]], k[1] = [B[1][0], B[1][1], B[1][2]], k; - }, I = function(B) { - if (s.volume(B) < s.maxVolume) - return [B]; - var k = B[1][0] - B[0][0], N = B[1][1] - B[0][1], $ = B[1][2] - B[0][2], F; - k > N && k > $ ? F = 0 : N > k && N > $ ? F = 1 : F = 2; - var G = D(B), H = D(B), U = (B[1][F] - B[0][F]) / 2 + B[0][F]; - G[1][F] = U, H[0][F] = U; - var V = I(G), Q = I(H); - return V.concat(Q); - }, z = I(a), P = 6; - for (let B = 0, k = z.length; B < k; B++) { - let N = D(z[B]); + return k[0] = [z[0][0], z[0][1], z[0][2]], k[1] = [z[1][0], z[1][1], z[1][2]], k; + }, I = function(z) { + if (s.volume(z) < s.maxVolume) + return [z]; + var k = z[1][0] - z[0][0], N = z[1][1] - z[0][1], R = z[1][2] - z[0][2], U; + k > N && k > R ? U = 0 : N > k && N > R ? U = 1 : U = 2; + var W = D(z), G = D(z), F = (z[1][U] - z[0][U]) / 2 + z[0][U]; + W[1][U] = F, G[0][U] = F; + var V = I(W), J = I(G); + return V.concat(J); + }, B = I(a), P = 6; + for (let z = 0, k = B.length; z < k; z++) { + let N = D(B[z]); N[0][0] -= P, N[0][1] -= P, N[0][2] -= P, N[1][0] += P, N[1][1] += P, N[1][2] += P; - let $ = s.getAtomsWithin(l, N), F = s.getAtomsWithin(g, z[B]); + let R = s.getAtomsWithin(l, N), U = s.getAtomsWithin(g, B[z]); M.push({ - extent: z[B], - atoms: T($), - toshow: T(F) + extent: B[z], + atoms: T(R), + toshow: T(U) }); } return M; @@ -8262,36 +8262,36 @@ ATOM`, g); * @return {Mesh} */ static generateSurfaceMesh(a, l, g) { - var M = new n.Geometry(!0), L = M.updateGeoGroup(0), T = []; - for (let Me = 0, Te = a.length; Me < Te; Me++) { - var D = a[Me]; - D && (typeof D.surfaceColor < "u" ? T[Me] = D.surfaceColor : D.color && (T[Me] = u.CC.color(D.color))); + var M = new n.Geometry(!0), C = M.updateGeoGroup(0), T = []; + for (let be = 0, Le = a.length; be < Le; be++) { + var D = a[be]; + D && (typeof D.surfaceColor < "u" ? T[be] = D.surfaceColor : D.color && (T[be] = u.CC.color(D.color))); } - var I = L.vertexArray, z = l.vertices; - for (let Me = 0, Te = z.length; Me < Te; Me++) { - let se = L.vertices * 3; - I[se] = z[Me].x, I[se + 1] = z[Me].y, I[se + 2] = z[Me].z, L.vertices++; + var I = C.vertexArray, B = l.vertices; + for (let be = 0, Le = B.length; be < Le; be++) { + let ae = C.vertices * 3; + I[ae] = B[be].x, I[ae + 1] = B[be].y, I[ae + 2] = B[be].z, C.vertices++; } - var P = L.colorArray; + var P = C.colorArray; if (g.voldata && g.volscheme) { - var B = g.volscheme, k = g.voldata, N = B.range() || [-1, 1]; - for (let Me = 0, Te = z.length; Me < Te; Me++) { - let se = k.getVal(z[Me].x, z[Me].y, z[Me].z), pe = u.CC.color(B.valueToHex(se, N)), we = Me * 3; - P[we] = pe.r, P[we + 1] = pe.g, P[we + 2] = pe.b; + var z = g.volscheme, k = g.voldata, N = z.range() || [-1, 1]; + for (let be = 0, Le = B.length; be < Le; be++) { + let ae = k.getVal(B[be].x, B[be].y, B[be].z), _e = u.CC.color(z.valueToHex(ae, N)), Ee = be * 3; + P[Ee] = _e.r, P[Ee + 1] = _e.g, P[Ee + 2] = _e.b; } } else if (T.length > 0) - for (let Me = 0, Te = z.length; Me < Te; Me++) { - let se = z[Me].atomid, pe = Me * 3; - P[pe] = T[se].r, P[pe + 1] = T[se].g, P[pe + 2] = T[se].b; + for (let be = 0, Le = B.length; be < Le; be++) { + let ae = B[be].atomid, _e = be * 3; + P[_e] = T[ae].r, P[_e + 1] = T[ae].g, P[_e + 2] = T[ae].b; } - var $ = l.faces; - L.faceidx = $.length, M.initTypedArrays(); - var F = L.vertexArray, G = L.normalArray, H, U, V, Q; - for (let Me = 0, Te = $.length; Me < Te; Me += 3) { - var ae = $[Me], oe = $[Me + 1], q = $[Me + 2], me = ae * 3, ne = oe * 3, fe = q * 3; - H = new f.Vector3(F[me], F[me + 1], F[me + 2]), U = new f.Vector3(F[ne], F[ne + 1], F[ne + 2]), V = new f.Vector3(F[fe], F[fe + 1], F[fe + 2]), V.subVectors(V, U), H.subVectors(H, U), V.cross(H), Q = V, Q.normalize(), G[me] += Q.x, G[ne] += Q.x, G[fe] += Q.x, G[me + 1] += Q.y, G[ne + 1] += Q.y, G[fe + 1] += Q.y, G[me + 2] += Q.z, G[ne + 2] += Q.z, G[fe + 2] += Q.z; - } - L.faceArray = new Uint16Array($); + var R = l.faces; + C.faceidx = R.length, M.initTypedArrays(); + var U = C.vertexArray, W = C.normalArray, G, F, V, J; + for (let be = 0, Le = R.length; be < Le; be += 3) { + var X = R[be], oe = R[be + 1], te = R[be + 2], ve = X * 3, se = oe * 3, le = te * 3; + G = new f.Vector3(U[ve], U[ve + 1], U[ve + 2]), F = new f.Vector3(U[se], U[se + 1], U[se + 2]), V = new f.Vector3(U[le], U[le + 1], U[le + 2]), V.subVectors(V, F), G.subVectors(G, F), V.cross(G), J = V, J.normalize(), W[ve] += J.x, W[se] += J.x, W[le] += J.x, W[ve + 1] += J.y, W[se + 1] += J.y, W[le + 1] += J.y, W[ve + 2] += J.z, W[se + 2] += J.z, W[le + 2] += J.z; + } + C.faceArray = new Uint16Array(R); var Ce = new n.Mesh(M, g); return Ce; } @@ -8311,9 +8311,9 @@ ATOM`, g); * vol * @return {Object} */ - static generateMeshSyncHelper(a, l, g, M, L, T) { - var D = new b.ProteinSurface(); - return D.initparm(l, a !== 1, T), D.fillvoxels(L, g), D.buildboundary(), (a == b.SurfaceType.SES || a == b.SurfaceType.MS) && (D.fastdistancemap(), D.boundingatom(!1), D.fillvoxelswaals(L, g)), D.marchingcube(a), D.getFacesAndVertices(M); + static generateMeshSyncHelper(a, l, g, M, C, T) { + var D = new y.ProteinSurface(); + return D.initparm(l, a !== 1, T), D.fillvoxels(C, g), D.buildboundary(), (a == y.SurfaceType.SES || a == y.SurfaceType.MS) && (D.fastdistancemap(), D.boundingatom(!1), D.fillvoxelswaals(C, g)), D.marchingcube(a), D.getFacesAndVertices(M); } /* * @@ -8353,7 +8353,7 @@ ATOM`, g); var l = []; let g = a.length; for (let M = 0; M < g; M++) - l[M] = (0, y.extend)({}, a[M]); + l[M] = (0, b.extend)({}, a[M]); return l; } /** @@ -8366,150 +8366,150 @@ ATOM`, g); * @param {function} surfacecallback - function to be called after setting the surface * @return {Promise} promise - Returns a promise that ultimately resovles to the surfid. Returns surfid immediately if surfacecallback is specified. Returned promise has a [surfid, GLViewer, style, atomsel, allsel, focus] fields for immediate access. */ - addSurface(a, l = {}, g = {}, M, L, T) { - let D = this.nextSurfID(), I = null, z = this, P = b.SurfaceType.VDW; + addSurface(a, l = {}, g = {}, M, C, T) { + let D = this.nextSurfID(), I = null, B = this, P = y.SurfaceType.VDW; typeof a == "string" ? s.surfaceTypeMap[a.toUpperCase()] !== void 0 ? P = s.surfaceTypeMap[a] : console.log("Surface type : " + a + " is not recognized") : typeof a == "number" && (P = a); - var B = null, k = null, N = s.shallowCopy(this.getAtomsFromSel(g)); - M ? B = s.shallowCopy(this.getAtomsFromSel(M)) : B = N, (0, y.adjustVolumeStyle)(l); - var $ = !1, F; - for (F = 0; F < this.models.length; F++) - if (this.models[F]) { - var G = this.models[F].getSymmetries(); - if (G.length > 1 || G.length == 1 && !G[0].isIdentity()) { - $ = !0; + var z = null, k = null, N = s.shallowCopy(this.getAtomsFromSel(g)); + M ? z = s.shallowCopy(this.getAtomsFromSel(M)) : z = N, (0, b.adjustVolumeStyle)(l); + var R = !1, U; + for (U = 0; U < this.models.length; U++) + if (this.models[U]) { + var W = this.models[U].getSymmetries(); + if (W.length > 1 || W.length == 1 && !W[0].isIdentity()) { + R = !0; break; } } - var H = function(me, ne, fe) { - L ? k = s.shallowCopy(z.getAtomsFromSel(L)) : k = fe; - var Ce, Me = (0, y.getExtent)(fe, !0); + var G = function(ve, se, le) { + C ? k = s.shallowCopy(B.getAtomsFromSel(C)) : k = le; + var Ce, be = (0, b.getExtent)(le, !0); if (l.map && l.map.prop) { - var Te = l.map.prop; - let Se = (0, h.getGradient)(l.map.scheme || l.map.gradient || new h.Gradient.RWB()), ze = Se.range(); - ze || (ze = (0, y.getPropertyRange)(fe, Te)), l.colorscheme = { prop: Te, gradient: Se }; + var Le = l.map.prop; + let Ae = (0, h.getGradient)(l.map.scheme || l.map.gradient || new h.Gradient.RWB()), Oe = Ae.range(); + Oe || (Oe = (0, b.getPropertyRange)(le, Le)), l.colorscheme = { prop: Le, gradient: Ae }; } - for (let Se = 0, ze = ne.length; Se < ze; Se++) - Ce = ne[Se], Ce.surfaceColor = (0, y.getColorFromStyle)(Ce, l); - var se = s.volume(Me), pe = z.carveUpExtent(Me, ne, fe); + for (let Ae = 0, Oe = se.length; Ae < Oe; Ae++) + Ce = se[Ae], Ce.surfaceColor = (0, b.getColorFromStyle)(Ce, l); + var ae = s.volume(be), _e = B.carveUpExtent(be, se, le); if (k && k.length && k.length > 0) { - var we = (0, y.getExtent)(k, !0), Fe = function(Se, ze) { - var He = function(K, ee) { - var de = K.extent, ve = de[1][0] - de[0][0], Ie = de[1][1] - de[0][1], Re = de[1][2] - de[0][2], Z = ve - ee[2][0]; - Z *= Z; - var ce = Ie - ee[2][1]; - ce *= ce; - var Ae = Re - ee[2][2]; - return Ae *= Ae, Z + ce + Ae; - }, We = He(Se, we), Y = He(ze, we); - return We - Y; + var Ee = (0, b.getExtent)(k, !0), Be = function(Ae, Oe) { + var We = function(j, ee) { + var ge = j.extent, ye = ge[1][0] - ge[0][0], $e = ge[1][1] - ge[0][1], Re = ge[1][2] - ge[0][2], Y = ye - ee[2][0]; + Y *= Y; + var ue = $e - ee[2][1]; + ue *= ue; + var Se = Re - ee[2][2]; + return Se *= Se, Y + ue + Se; + }, Ue = We(Ae, Ee), Z = We(Oe, Ee); + return Ue - Z; }; - pe.sort(Fe); + _e.sort(Be); } - var Ue = []; - for (let Se = 0, ze = ne.length; Se < ze; Se++) - Ce = ne[Se], Ue[Se] = { + var Ne = []; + for (let Ae = 0, Oe = se.length; Ae < Oe; Ae++) + Ce = se[Ae], Ne[Ae] = { x: Ce.x, y: Ce.y, z: Ce.z, - serial: Se, + serial: Ae, elem: Ce.elem }; - var Ne = !!b.syncSurface; - if (Ne) { - var Be = function(ze) { - return new Promise(function(He) { - for (var We = s.generateMeshSyncHelper(P, pe[ze].extent, pe[ze].atoms, pe[ze].toshow, Ue, se), Y = (0, c.splitMesh)({ vertexArr: We.vertices, faceArr: We.faces }), K = 0, ee = Y.length; K < ee; K++) { - We = { - vertices: Y[K].vertexArr, - faces: Y[K].faceArr + var Ge = !!y.syncSurface; + if (Ge) { + var ke = function(Oe) { + return new Promise(function(We) { + for (var Ue = s.generateMeshSyncHelper(P, _e[Oe].extent, _e[Oe].atoms, _e[Oe].toshow, Ne, ae), Z = (0, c.splitMesh)({ vertexArr: Ue.vertices, faceArr: Ue.faces }), j = 0, ee = Z.length; j < ee; j++) { + Ue = { + vertices: Z[j].vertexArr, + faces: Z[j].faceArr }; - var de = s.generateSurfaceMesh(ne, We, I); - (0, y.mergeGeos)(me.geo, de); + var ge = s.generateSurfaceMesh(se, Ue, I); + (0, b.mergeGeos)(ve.geo, ge); } - z.render(), He(); + B.render(), We(); }); - }, ue = []; - for (let Se = 0; Se < pe.length; Se++) - ue.push(Be(Se)); - return Promise.all(ue).then(function() { - return me.done = !0, Promise.resolve(D); + }, pe = []; + for (let Ae = 0; Ae < _e.length; Ae++) + pe.push(ke(Ae)); + return Promise.all(pe).then(function() { + return ve.done = !0, Promise.resolve(D); }); } else { - var ye = []; + var de = []; P < 0 && (P = 0); - for (let Se = 0, ze = s.numWorkers; Se < ze; Se++) { - var ge = new Worker($3Dmol.SurfaceWorker); - ye.push(ge), ge.postMessage({ + for (let Ae = 0, Oe = s.numWorkers; Ae < Oe; Ae++) { + var ce = new Worker($3Dmol.SurfaceWorker); + de.push(ce), ce.postMessage({ type: -1, - atoms: Ue, - volume: se + atoms: Ne, + volume: ae }); } - return new Promise(function(Se, ze) { - var He = 0, We = function() { - !ye || !ye.length || ye.forEach(function(de) { - de && de.terminate && de.terminate(); + return new Promise(function(Ae, Oe) { + var We = 0, Ue = function() { + !de || !de.length || de.forEach(function(ge) { + ge && ge.terminate && ge.terminate(); }); - }, Y = function(de) { - for (var ve = (0, c.splitMesh)({ - vertexArr: de.data.vertices, - faceArr: de.data.faces - }), Ie = 0, Re = ve.length; Ie < Re; Ie++) { - var Z = { - vertices: ve[Ie].vertexArr, - faces: ve[Ie].faceArr - }, ce = s.generateSurfaceMesh(ne, Z, I); - (0, y.mergeGeos)(me.geo, ce); + }, Z = function(ge) { + for (var ye = (0, c.splitMesh)({ + vertexArr: ge.data.vertices, + faceArr: ge.data.faces + }), $e = 0, Re = ye.length; $e < Re; $e++) { + var Y = { + vertices: ye[$e].vertexArr, + faces: ye[$e].faceArr + }, ue = s.generateSurfaceMesh(se, Y, I); + (0, b.mergeGeos)(ve.geo, ue); } - z.render(), He++, He == pe.length && (me.done = !0, We(), Se(D)); - }, K = function(de) { - We(), console.log(de.message + " (" + de.filename + ":" + de.lineno + ")"), ze(de); + B.render(), We++, We == _e.length && (ve.done = !0, Ue(), Ae(D)); + }, j = function(ge) { + Ue(), console.log(ge.message + " (" + ge.filename + ":" + ge.lineno + ")"), Oe(ge); }; - for (let de = 0; de < pe.length; de++) { - var ee = ye[de % ye.length]; - ee.onmessage = Y, ee.onerror = K, ee.postMessage({ + for (let ge = 0; ge < _e.length; ge++) { + var ee = de[ge % de.length]; + ee.onmessage = Z, ee.onerror = j, ee.postMessage({ type: P, - expandedExtent: pe[de].extent, - extendedAtoms: pe[de].atoms, - atomsToShow: pe[de].toshow + expandedExtent: _e[ge].extent, + extendedAtoms: _e[ge].atoms, + atomsToShow: _e[ge].toshow }); } }); } }; l = l || {}, I = s.getMatWithStyle(l); - var U = []; - U.style = l, U.atomsel = g, U.allsel = M, U.focus = L; + var F = []; + F.style = l, F.atomsel = g, F.allsel = M, F.focus = C; var V = null; - if ($) { - var Q = {}, ae = {}; - for (F = 0; F < this.models.length; F++) - Q[F] = [], ae[F] = []; - for (F = 0; F < B.length; F++) - Q[B[F].model].push(B[F]); - for (F = 0; F < N.length; F++) - ae[N[F].model].push(N[F]); + if (R) { + var J = {}, X = {}; + for (U = 0; U < this.models.length; U++) + J[U] = [], X[U] = []; + for (U = 0; U < z.length; U++) + J[z[U].model].push(z[U]); + for (U = 0; U < N.length; U++) + X[N[U].model].push(N[U]); var oe = []; - for (F = 0; F < this.models.length; F++) - ae[F].length > 0 && (U.push({ + for (U = 0; U < this.models.length; U++) + X[U].length > 0 && (F.push({ geo: new n.Geometry(!0), mat: I, done: !1, finished: !1, - symmetries: this.models[F].getSymmetries() + symmetries: this.models[U].getSymmetries() // also webgl initialized - }), oe.push(H(U[U.length - 1], Q[F], ae[F]))); + }), oe.push(G(F[F.length - 1], J[U], X[U]))); V = Promise.all(oe); } else - U.push({ + F.push({ geo: new n.Geometry(!0), mat: I, done: !1, finished: !1, symmetries: [new f.Matrix4()] - }), V = H(U[U.length - 1], B, N); - return this.surfaces[D] = U, V.surfid = D, T && typeof T == "function" ? (V.then(function(q) { - T(q); + }), V = G(F[F.length - 1], z, N); + return this.surfaces[D] = F, V.surfid = D, T && typeof T == "function" ? (V.then(function(te) { + T(te); }), D) : V; } /** @@ -8528,22 +8528,22 @@ ATOM`, g); }); */ setSurfaceMaterialStyle(a, l) { - if ((0, y.adjustVolumeStyle)(l), this.surfaces[a]) { + if ((0, b.adjustVolumeStyle)(l), this.surfaces[a]) { var g = this.surfaces[a]; g.style = l; for (var M = 0; M < g.length; M++) { - var L = g[M].mat = s.getMatWithStyle(l); + var C = g[M].mat = s.getMatWithStyle(l); if (g[M].mat.side = n.FrontSide, l.color) { g[M].mat.color = l.color, g[M].geo.colorsNeedUpdate = !0; const T = u.CC.color(l.color); g[M].geo.setColors(function() { return T; }); - } else if (L.voldata && L.volscheme) { - const T = L.volscheme, D = L.voldata, I = u.CC, z = T.range() || [-1, 1]; - g[M].geo.setColors(function(P, B, k) { - let N = D.getVal(P, B, k); - return I.color(T.valueToHex(N, z)); + } else if (C.voldata && C.volscheme) { + const T = C.volscheme, D = C.voldata, I = u.CC, B = T.range() || [-1, 1]; + g[M].geo.setColors(function(P, z, k) { + let N = D.getVal(P, z, k); + return I.color(T.valueToHex(N, B)); }); } g[M].finished = !1; @@ -8619,11 +8619,11 @@ ATOM`, g); else for (let T = 0, D = g.length; T < D; T++) { var M = g[T]; - for (let I = 0, z = a.length; I < z; I++) { + for (let I = 0, B = a.length; I < B; I++) { let P = a[I]; if (P.props) - for (var L in P.props) - P.props.hasOwnProperty(L) && this.atomIsSelected(M, P) && (M.properties || (M.properties = {}), M.properties[L] = P.props[L]); + for (var C in P.props) + P.props.hasOwnProperty(C) && this.atomIsSelected(M, P) && (M.properties || (M.properties = {}), M.properties[C] = P.props[C]); } } return this; @@ -8669,13 +8669,13 @@ ATOM`, g); } } s.numWorkers = 4, s.maxVolume = 64e3, s.surfaceTypeMap = { - VDW: b.SurfaceType.VDW, - MS: b.SurfaceType.MS, - SAS: b.SurfaceType.SAS, - SES: b.SurfaceType.SES + VDW: y.SurfaceType.VDW, + MS: y.SurfaceType.MS, + SAS: y.SurfaceType.SAS, + SES: y.SurfaceType.SES }; function o(v, a) { - if (v = (0, y.getElement)(v), !!v) { + if (v = (0, b.getElement)(v), !!v) { a = a || {}; try { var l = new s(v, a); @@ -8685,48 +8685,48 @@ ATOM`, g); } } } - function w(v, a = {}, l = {}) { - if (v = (0, y.getElement)(v), !!v) { + function A(v, a = {}, l = {}) { + if (v = (0, b.getElement)(v), !!v) { var g = [], M = document.createElement("canvas"); l.rows = a.rows, l.cols = a.cols, l.control_all = a.control_all != null ? a.control_all : !1, v.appendChild(M); try { - for (var L = 0; L < a.rows; L++) { + for (var C = 0; C < a.rows; C++) { for (var T = [], D = 0; D < a.cols; D++) { - l.row = L, l.col = D, l.canvas = M, l.viewers = g, l.control_all = a.control_all; - var I = o(v, (0, y.extend)({}, l)); + l.row = C, l.col = D, l.canvas = M, l.viewers = g, l.control_all = a.control_all; + var I = o(v, (0, b.extend)({}, l)); T.push(I); } g.unshift(T); } - } catch (z) { - throw "error creating viewer grid: " + z; + } catch (B) { + throw "error creating viewer grid: " + B; } return g; } } function p(v) { var a = this; - if (v = (0, y.getElement)(v), !!v) { - var l = w(v, { rows: 1, cols: 2, control_all: !0 }); + if (v = (0, b.getElement)(v), !!v) { + var l = A(v, { rows: 1, cols: 2, control_all: !0 }); this.glviewer1 = l[0][0], this.glviewer2 = l[0][1], this.glviewer1.setAutoEyeSeparation(!1), this.glviewer2.setAutoEyeSeparation(!0), this.glviewer1.linkViewer(this.glviewer2), this.glviewer2.linkViewer(this.glviewer1); - for (var g = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function(L) { - return typeof a.glviewer1[L] == "function"; + for (var g = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function(C) { + return typeof a.glviewer1[C] == "function"; }), M = 0; M < g.length; M++) - this[g[M]] = function(L) { + this[g[M]] = /* @__PURE__ */ function(C) { return function() { - var T = this.glviewer1[L].apply(this.glviewer1, arguments), D = this.glviewer2[L].apply(this.glviewer2, arguments); + var T = this.glviewer1[C].apply(this.glviewer1, arguments), D = this.glviewer2[C].apply(this.glviewer2, arguments); return [T, D]; }; }(g[M]); - this.setCoordinates = function(L, T, D) { - for (var I = 0; I < L.length; I++) - L[I].setCoordinates(T, D); + this.setCoordinates = function(C, T, D) { + for (var I = 0; I < C.length; I++) + C[I].setCoordinates(T, D); }, this.surfacesFinished = function() { return this.glviewer1.surfacesFinished() && this.glviewer2.surfacesFinished(); }, this.isAnimated = function() { return this.glviewer1.isAnimated() || this.glviewer2.isAnimated(); - }, this.render = function(L) { - this.glviewer1.render(), this.glviewer2.render(), L && L(this); + }, this.render = function(C) { + this.glviewer1.render(), this.glviewer2.render(), C && C(this); }, this.getCanvas = function() { return this.glviewer1.getCanvas(); }; @@ -8740,8 +8740,8 @@ ATOM`, g); !*** ./src/Gradient.ts ***! \*************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CustomLinear: () => ( /* binding */ @@ -8750,7 +8750,7 @@ ATOM`, g); /* harmony export */ Gradient: () => ( /* binding */ - b + y ), /* harmony export */ GradientType: () => ( @@ -8775,12 +8775,12 @@ ATOM`, g); /* harmony export */ builtinGradients: () => ( /* binding */ - C + S ), /* harmony export */ getGradient: () => ( /* binding */ - y + b ), /* harmony export */ normalizeValue: () => ( @@ -8789,58 +8789,58 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./colors */ "./src/colors.ts" ); class f { } - function u(A, S, s) { - return S >= A ? (s < A && (s = A), s > S && (s = S), { lo: A, hi: S, val: s }) : (s > A && (s = A), s < S && (s = S), s = A - s + S, { lo: S, hi: A, val: s }); + function u(w, L, s) { + return L >= w ? (s < w && (s = w), s > L && (s = L), { lo: w, hi: L, val: s }) : (s > w && (s = w), s < L && (s = L), s = w - s + L, { lo: L, hi: w, val: s }); } - function y(A) { - if (A instanceof f) - return A; - if (A.gradient !== void 0 && C[A.gradient]) { - let S = A.min === void 0 ? -1 : A.min, s = A.max === void 0 ? 1 : A.max; - return A.mid === void 0 ? A.colors === void 0 ? new C[A.gradient](S, s) : new C[A.gradient](S, s, A.colors) : new C[A.gradient](S, s, A.mid); + function b(w) { + if (w instanceof f) + return w; + if (w.gradient !== void 0 && S[w.gradient]) { + let L = w.min === void 0 ? -1 : w.min, s = w.max === void 0 ? 1 : w.max; + return w.mid === void 0 ? w.colors === void 0 ? new S[w.gradient](L, s) : new S[w.gradient](L, s, w.colors) : new S[w.gradient](L, s, w.mid); } - return A; + return w; } class h extends f { - constructor(S, s, o) { - super(), this.gradient = "RWB", this.mult = 1, this.mid = o, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && s && !Array.isArray(S) && (this.min = S, this.max = s); + constructor(L, s, o) { + super(), this.gradient = "RWB", this.mult = 1, this.mid = o, this.min = L, this.max = s, typeof s > "u" && Array.isArray(L) && L.length >= 2 ? (this.max = L[1], this.min = L[0]) : L && s && !Array.isArray(L) && (this.min = L, this.max = s); } //return range used for color mapping, null if none set range() { return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } //map value to hex color, range is provided - valueToHex(S, s) { - var o, w; - if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), S === void 0) + valueToHex(L, s) { + var o, A; + if (L = this.mult * L, s ? (o = s[0], A = s[1]) : (o = this.min, A = this.max), L === void 0) return 16777215; - var p = u(o, w, S); - o = p.lo, w = p.hi, S = p.val; - var v = (w + o) / 2; - s && typeof s[2] < "u" ? v = s[2] : typeof this.mid < "u" ? v = this.mid : v = (o + w) / 2; + var p = u(o, A, L); + o = p.lo, A = p.hi, L = p.val; + var v = (A + o) / 2; + s && typeof s[2] < "u" ? v = s[2] : typeof this.mid < "u" ? v = this.mid : v = (o + A) / 2; var a, l; - return S < v ? (a = Math.floor(255 * Math.sqrt((S - o) / (v - o))), l = 16711680 + 256 * a + a, l) : S > v ? (a = Math.floor(255 * Math.sqrt(1 - (S - v) / (w - v))), l = 65536 * a + 256 * a + 255, l) : 16777215; + return L < v ? (a = Math.floor(255 * Math.sqrt((L - o) / (v - o))), l = 16711680 + 256 * a + a, l) : L > v ? (a = Math.floor(255 * Math.sqrt(1 - (L - v) / (A - v))), l = 65536 * a + 256 * a + 255, l) : 16777215; } } class _ extends f { - constructor(S, s) { - super(), this.gradient = "ROYGB", this.mult = 1, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && s && !Array.isArray(S) && (this.min = S, this.max = s); + constructor(L, s) { + super(), this.gradient = "ROYGB", this.mult = 1, this.min = L, this.max = s, typeof s > "u" && Array.isArray(L) && L.length >= 2 ? (this.max = L[1], this.min = L[0]) : L && s && !Array.isArray(L) && (this.min = L, this.max = s); } //map value to hex color, range is provided - valueToHex(S, s) { - var o, w; - if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), typeof S > "u") + valueToHex(L, s) { + var o, A; + if (L = this.mult * L, s ? (o = s[0], A = s[1]) : (o = this.min, A = this.max), typeof L > "u") return 16777215; - var p = u(o, w, S); - o = p.lo, w = p.hi, S = p.val; - var v = (o + w) / 2, a = (o + v) / 2, l = (v + w) / 2, g, M; - return S < a ? (g = Math.floor(255 * Math.sqrt((S - o) / (a - o))), M = 16711680 + 256 * g + 0, M) : S < v ? (g = Math.floor(255 * Math.sqrt(1 - (S - a) / (v - a))), M = 65536 * g + 65280 + 0, M) : S < l ? (g = Math.floor(255 * Math.sqrt((S - v) / (l - v))), M = 65280 + 1 * g, M) : (g = Math.floor(255 * Math.sqrt(1 - (S - l) / (w - l))), M = 0 + 256 * g + 255, M); + var p = u(o, A, L); + o = p.lo, A = p.hi, L = p.val; + var v = (o + A) / 2, a = (o + v) / 2, l = (v + A) / 2, g, M; + return L < a ? (g = Math.floor(255 * Math.sqrt((L - o) / (a - o))), M = 16711680 + 256 * g + 0, M) : L < v ? (g = Math.floor(255 * Math.sqrt(1 - (L - a) / (v - a))), M = 65536 * g + 65280 + 0, M) : L < l ? (g = Math.floor(255 * Math.sqrt((L - v) / (l - v))), M = 65280 + 1 * g, M) : (g = Math.floor(255 * Math.sqrt(1 - (L - l) / (A - l))), M = 0 + 256 * g + 255, M); } //return range used for color mapping, null if none set range() { @@ -8848,17 +8848,17 @@ ATOM`, g); } } class E extends f { - constructor(S, s) { - super(), this.gradient = "Sinebow", this.mult = 1, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 && (this.max = S[1], this.min = S[0]), s < S && (this.mult = -1, this.min *= -1, this.max *= -1); + constructor(L, s) { + super(), this.gradient = "Sinebow", this.mult = 1, this.min = L, this.max = s, typeof s > "u" && Array.isArray(L) && L.length >= 2 && (this.max = L[1], this.min = L[0]), s < L && (this.mult = -1, this.min *= -1, this.max *= -1); } //map value to hex color, range is provided - valueToHex(S, s) { - var o, w; - if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), typeof S > "u") + valueToHex(L, s) { + var o, A; + if (L = this.mult * L, s ? (o = s[0], A = s[1]) : (o = this.min, A = this.max), typeof L > "u") return 16777215; - var p = b.normalizeValue(o, w, S); - o = p.lo, w = p.hi, S = p.val; - var v = (S - o) / (w - o), a = 5 * v / 6 + 0.5, l = Math.sin(Math.PI * a); + var p = y.normalizeValue(o, A, L); + o = p.lo, A = p.hi, L = p.val; + var v = (L - o) / (A - o), a = 5 * v / 6 + 0.5, l = Math.sin(Math.PI * a); l *= l * 255; var g = Math.sin(Math.PI * (a + 1 / 3)); g *= g * 255; @@ -8871,11 +8871,11 @@ ATOM`, g); } } class c extends f { - constructor(S, s, o) { + constructor(L, s, o) { super(), this.gradient = "linear", this.colors = new Array(); - var w; - if (Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0], w = s) : (this.min = S, this.max = s, w = o), w) - for (let p of w) + var A; + if (Array.isArray(L) && L.length >= 2 ? (this.max = L[1], this.min = L[0], A = s) : (this.min = L, this.max = s, A = o), A) + for (let p of A) this.colors.push(n.CC.color(p)); else this.colors.push(n.CC.color(0)); @@ -8885,17 +8885,17 @@ ATOM`, g); return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } //map value to hex color, range is provided - valueToHex(S, s) { - var o, w; - if (s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), S === void 0) + valueToHex(L, s) { + var o, A; + if (s ? (o = s[0], A = s[1]) : (o = this.min, A = this.max), L === void 0) return 16777215; - var p = u(o, w, S); - o = p.lo, w = p.hi, S = p.val; - let v = this.colors.length, a = (w - o) / v, l = Math.min(Math.floor((S - o) / a), v - 1), g = Math.min(l + 1, v - 1), M = (S - o - l * a) / a, L = this.colors[l], T = this.colors[g]; - return new n.Color(L.r + M * (T.r - L.r), L.g + M * (T.g - L.g), L.b + M * (T.b - L.b)).getHex(); + var p = u(o, A, L); + o = p.lo, A = p.hi, L = p.val; + let v = this.colors.length, a = (A - o) / v, l = Math.min(Math.floor((L - o) / a), v - 1), g = Math.min(l + 1, v - 1), M = (L - o - l * a) / a, C = this.colors[l], T = this.colors[g]; + return new n.Color(C.r + M * (T.r - C.r), C.g + M * (T.g - C.g), C.b + M * (T.b - C.b)).getHex(); } } - const C = { + const S = { rwb: h, RWB: h, roygb: _, @@ -8903,15 +8903,15 @@ ATOM`, g); sinebow: E, linear: c }; - class b extends f { - valueToHex(S, s) { + class y extends f { + valueToHex(L, s) { return 0; } range() { return null; } } - b.RWB = h, b.ROYGB = _, b.Sinebow = E, b.CustomLinear = c, b.builtinGradients = C, b.normalizeValue = u, b.getGradient = y; + y.RWB = h, y.ROYGB = _, y.Sinebow = E, y.CustomLinear = c, y.builtinGradients = S, y.normalizeValue = u, y.getGradient = b; } ), /***/ @@ -8920,8 +8920,8 @@ ATOM`, g); !*** ./src/Label.ts ***! \**********************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Label: () => ( /* binding */ @@ -8930,83 +8930,83 @@ ATOM`, g); /* harmony export */ LabelCount: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./Gradient */ "./src/Gradient.ts" - ), u = t( + ), u = r( /*! ./colors */ "./src/colors.ts" ); - let y = 0; - function h(c, C, b, A, S, s, o) { - c.beginPath(), c.moveTo(C + s, b), c.lineTo(C + A - s, b), c.quadraticCurveTo(C + A, b, C + A, b + s), c.lineTo(C + A, b + S - s), c.quadraticCurveTo(C + A, b + S, C + A - s, b + S), c.lineTo(C + s, b + S), c.quadraticCurveTo(C, b + S, C, b + S - s), c.lineTo(C, b + s), c.quadraticCurveTo(C, b, C + s, b), c.closePath(), c.fill(), o && c.stroke(); + let b = 0; + function h(c, S, y, w, L, s, o) { + c.beginPath(), c.moveTo(S + s, y), c.lineTo(S + w - s, y), c.quadraticCurveTo(S + w, y, S + w, y + s), c.lineTo(S + w, y + L - s), c.quadraticCurveTo(S + w, y + L, S + w - s, y + L), c.lineTo(S + s, y + L), c.quadraticCurveTo(S, y + L, S, y + L - s), c.lineTo(S, y + s), c.quadraticCurveTo(S, y, S + s, y), c.closePath(), c.fill(), o && c.stroke(); } - function _(c, C, b) { - var A = b; - return typeof c < "u" && (c instanceof u.Color ? A = c.scaled() : (A = u.CC.color(c), typeof A.scaled < "u" && (A = A.scaled()))), typeof C < "u" && (A.a = parseFloat(C)), A; + function _(c, S, y) { + var w = y; + return typeof c < "u" && (c instanceof u.Color ? w = c.scaled() : (w = u.CC.color(c), typeof w.scaled < "u" && (w = w.scaled()))), typeof S < "u" && (w.a = parseFloat(S)), w; } class E { - constructor(C, b) { - this.id = y++, this.stylespec = b || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new n.Sprite(), this.text = C, this.frame = this.stylespec.frame; + constructor(S, y) { + this.id = b++, this.stylespec = y || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new n.Sprite(), this.text = S, this.frame = this.stylespec.frame; } getStyle() { return this.stylespec; } setContext() { - var C = this.stylespec, b = typeof C.useScreen > "u" ? !1 : C.useScreen, A = C.showBackground; - (A === "0" || A === "false") && (A = !1), typeof A > "u" && (A = !0); - var S = C.font ? C.font : "sans-serif", s = parseInt(C.fontSize) ? parseInt(C.fontSize) : 18, o = _(C.fontColor, C.fontOpacity, { + var S = this.stylespec, y = typeof S.useScreen > "u" ? !1 : S.useScreen, w = S.showBackground; + (w === "0" || w === "false") && (w = !1), typeof w > "u" && (w = !0); + var L = S.font ? S.font : "sans-serif", s = parseInt(S.fontSize) ? parseInt(S.fontSize) : 18, o = _(S.fontColor, S.fontOpacity, { r: 255, g: 255, b: 255, a: 1 - }), w = C.padding ? C.padding : 4, p = C.borderThickness ? C.borderThickness : 0, v = _(C.backgroundColor, C.backgroundOpacity, { + }), A = S.padding ? S.padding : 4, p = S.borderThickness ? S.borderThickness : 0, v = _(S.backgroundColor, S.backgroundOpacity, { r: 0, g: 0, b: 0, a: 1 - }), a = _(C.borderColor, C.borderOpacity, v), l = C.position ? C.position : { + }), a = _(S.borderColor, S.borderOpacity, v), l = S.position ? S.position : { x: -10, y: 1, z: 1 - }, g = C.inFront !== void 0 ? C.inFront : !0; + }, g = S.inFront !== void 0 ? S.inFront : !0; (g === "false" || g === "0") && (g = !1); - var M = C.alignment || n.SpriteAlignment.topLeft; + var M = S.alignment || n.SpriteAlignment.topLeft; typeof M == "string" && M in n.SpriteAlignment && (M = n.SpriteAlignment[M]); - var L = ""; - C.bold && (L = "bold "), this.context.font = L + s + "px " + S; + var C = ""; + S.bold && (C = "bold "), this.context.font = C + s + "px " + L; var T = this.context.measureText(this.text), D = T.width; - A || (p = 0); - var I = D + 2.5 * p + 2 * w, z = s * 1.25 + 2 * p + 2 * w; - if (C.backgroundImage) { - var P = C.backgroundImage, B = C.backgroundWidth ? C.backgroundWidth : P.width, k = C.backgroundHeight ? C.backgroundHeight : P.height; - B > I && (I = B), k > z && (z = k); - } - if (this.canvas.width = I, this.canvas.height = z, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), L = "", C.bold && (L = "bold "), this.context.font = L + s + "px " + S, this.context.fillStyle = "rgba(" + v.r + "," + v.g + "," + v.b + "," + v.a + ")", this.context.strokeStyle = "rgba(" + a.r + "," + a.g + "," + a.b + "," + a.a + ")", C.backgroundGradient) { - let $ = this.context.createLinearGradient(0, z / 2, I, z / 2), F = f.Gradient.getGradient(C.backgroundGradient), G = F.range(), H = -1, U = 1; - G && (H = G[0], U = G[1]); - let V = U - H; - for (let Q = 0; Q < 1.01; Q += 0.1) { - let ae = _(F.valueToHex(H + V * Q)), oe = "rgba(" + ae.r + "," + ae.g + "," + ae.b + "," + ae.a + ")"; - $.addColorStop(Q, oe); + w || (p = 0); + var I = D + 2.5 * p + 2 * A, B = s * 1.25 + 2 * p + 2 * A; + if (S.backgroundImage) { + var P = S.backgroundImage, z = S.backgroundWidth ? S.backgroundWidth : P.width, k = S.backgroundHeight ? S.backgroundHeight : P.height; + z > I && (I = z), k > B && (B = k); + } + if (this.canvas.width = I, this.canvas.height = B, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), C = "", S.bold && (C = "bold "), this.context.font = C + s + "px " + L, this.context.fillStyle = "rgba(" + v.r + "," + v.g + "," + v.b + "," + v.a + ")", this.context.strokeStyle = "rgba(" + a.r + "," + a.g + "," + a.b + "," + a.a + ")", S.backgroundGradient) { + let R = this.context.createLinearGradient(0, B / 2, I, B / 2), U = f.Gradient.getGradient(S.backgroundGradient), W = U.range(), G = -1, F = 1; + W && (G = W[0], F = W[1]); + let V = F - G; + for (let J = 0; J < 1.01; J += 0.1) { + let X = _(U.valueToHex(G + V * J)), oe = "rgba(" + X.r + "," + X.g + "," + X.b + "," + X.a + ")"; + R.addColorStop(J, oe); } - this.context.fillStyle = $; + this.context.fillStyle = R; } - this.context.lineWidth = p, A && h(this.context, p, p, I - 2 * p, z - 2 * p, 6, p > 0), C.backgroundImage && this.context.drawImage(P, 0, 0, I, z), this.context.fillStyle = "rgba(" + o.r + "," + o.g + "," + o.b + "," + o.a + ")", this.context.fillText(this.text, p + w, s + p + w, D); + this.context.lineWidth = p, w && h(this.context, p, p, I - 2 * p, B - 2 * p, 6, p > 0), S.backgroundImage && this.context.drawImage(P, 0, 0, I, B), this.context.fillStyle = "rgba(" + o.r + "," + o.g + "," + o.b + "," + o.a + ")", this.context.fillText(this.text, p + A, s + p + A, D); var N = new n.Texture(this.canvas); N.needsUpdate = !0, this.sprite.material = new n.SpriteMaterial({ map: N, - useScreenCoordinates: b, + useScreenCoordinates: y, alignment: M, depthTest: !g, - screenOffset: C.screenOffset || null + screenOffset: S.screenOffset || null }), this.sprite.scale.set(1, 1, 1), this.sprite.position.set(l.x, l.y, l.z); } // clean up material and texture @@ -9022,8 +9022,8 @@ ATOM`, g); !*** ./src/ProteinSurface4.ts ***! \********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MarchingCube: () => ( /* binding */ @@ -9052,7 +9052,7 @@ ATOM`, g); /* harmony export */ setSyncSurface: () => ( /* binding */ - y + b ), /* harmony export */ syncSurface: () => ( @@ -9061,16 +9061,16 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), f; - (function(C) { - C[C.VDW = 1] = "VDW", C[C.MS = 2] = "MS", C[C.SAS = 3] = "SAS", C[C.SES = 4] = "SES"; + (function(S) { + S[S.VDW = 1] = "VDW", S[S.MS = 2] = "MS", S[S.SAS = 3] = "SAS", S[S.SES = 4] = "SES"; })(f || (f = {})); var u = !1; - function y(C) { - u = C; + function b(S) { + u = S; } (window.navigator.userAgent.indexOf("MSIE ") >= 0 || window.navigator.userAgent.indexOf("Trident/") >= 0) && (u = !0); class h { @@ -10105,46 +10105,46 @@ ATOM`, g); [] ]; } - march(b, A, S, s) { - let o = !!s.fulltable, w = s.hasOwnProperty("origin") && s.origin.hasOwnProperty("x") ? s.origin : { x: 0, y: 0, z: 0 }, p = !!s.voxel, v = s.matrix, a = s.nX || 0, l = s.nY || 0, g = s.nZ || 0, M = s.scale || 1, L = null; - s.unitCube ? L = s.unitCube : L = { x: M, y: M, z: M }; + march(y, w, L, s) { + let o = !!s.fulltable, A = s.hasOwnProperty("origin") && s.origin.hasOwnProperty("x") ? s.origin : { x: 0, y: 0, z: 0 }, p = !!s.voxel, v = s.matrix, a = s.nX || 0, l = s.nY || 0, g = s.nZ || 0, M = s.scale || 1, C = null; + s.unitCube ? C = s.unitCube : C = { x: M, y: M, z: M }; let T = new Int32Array(a * l * g), D, I; for (D = 0, I = T.length; D < I; ++D) T[D] = -1; - let z = function(N, $, F, G, H, U) { - let V = { x: 0, y: 0, z: 0 }, Q = !!(G & 1 << H), ae = !!(G & 1 << U), oe = H; - if (!Q && ae && (oe = U), oe & 1 && F++, oe & 2 && $++, oe & 4 && N++, v) { - let me = new n.Vector3(N, $, F); - me = me.applyMatrix4(v), V = { x: me.x, y: me.y, z: me.z }; + let B = function(N, R, U, W, G, F) { + let V = { x: 0, y: 0, z: 0 }, J = !!(W & 1 << G), X = !!(W & 1 << F), oe = G; + if (!J && X && (oe = F), oe & 1 && U++, oe & 2 && R++, oe & 4 && N++, v) { + let ve = new n.Vector3(N, R, U); + ve = ve.applyMatrix4(v), V = { x: ve.x, y: ve.y, z: ve.z }; } else - V.x = w.x + L.x * N, V.y = w.y + L.y * $, V.z = w.z + L.z * F; - let q = (l * N + $) * g + F; - return p ? (A.push(V), A.length - 1) : (T[q] < 0 && (T[q] = A.length, A.push(V)), T[q]); - }, P = new Int32Array(12), B = o ? this.edgeTable2 : this.edgeTable, k = o ? this.triTable2 : this.triTable; + V.x = A.x + C.x * N, V.y = A.y + C.y * R, V.z = A.z + C.z * U; + let te = (l * N + R) * g + U; + return p ? (w.push(V), w.length - 1) : (T[te] < 0 && (T[te] = w.length, w.push(V)), T[te]); + }, P = new Int32Array(12), z = o ? this.edgeTable2 : this.edgeTable, k = o ? this.triTable2 : this.triTable; for (D = 0; D < a - 1; ++D) for (let N = 0; N < l - 1; ++N) - for (let $ = 0; $ < g - 1; ++$) { - let F = 0; - for (let U = 0; U < 8; ++U) { - let V = (l * (D + ((U & 4) >> 2)) + N + ((U & 2) >> 1)) * g + $ + (U & 1), Q = !!(b[V] & this.ISDONE); - F |= Q << U; + for (let R = 0; R < g - 1; ++R) { + let U = 0; + for (let F = 0; F < 8; ++F) { + let V = (l * (D + ((F & 4) >> 2)) + N + ((F & 2) >> 1)) * g + R + (F & 1), J = !!(y[V] & this.ISDONE); + U |= J << F; } - if (F === 0 || F === 255) + if (U === 0 || U === 255) continue; - let G = B[F]; - if (G === 0) + let W = z[U]; + if (W === 0) continue; - let H = k[F]; - G & 1 && (P[0] = z(D, N, $, F, 0, 1)), G & 2 && (P[1] = z(D, N, $, F, 1, 3)), G & 4 && (P[2] = z(D, N, $, F, 3, 2)), G & 8 && (P[3] = z(D, N, $, F, 2, 0)), G & 16 && (P[4] = z(D, N, $, F, 4, 5)), G & 32 && (P[5] = z(D, N, $, F, 5, 7)), G & 64 && (P[6] = z(D, N, $, F, 7, 6)), G & 128 && (P[7] = z(D, N, $, F, 6, 4)), G & 256 && (P[8] = z(D, N, $, F, 0, 4)), G & 512 && (P[9] = z(D, N, $, F, 1, 5)), G & 1024 && (P[10] = z(D, N, $, F, 3, 7)), G & 2048 && (P[11] = z(D, N, $, F, 2, 6)); - for (let U = 0; U < H.length; U += 3) { - let V = P[H[U]], Q = P[H[U + 1]], ae = P[H[U + 2]]; - p && U >= 3 && (A.push(A[V]), V = A.length - 1, A.push(A[Q]), Q = A.length - 1, A.push(A[ae]), ae = A.length - 1), S.push(V), S.push(Q), S.push(ae); + let G = k[U]; + W & 1 && (P[0] = B(D, N, R, U, 0, 1)), W & 2 && (P[1] = B(D, N, R, U, 1, 3)), W & 4 && (P[2] = B(D, N, R, U, 3, 2)), W & 8 && (P[3] = B(D, N, R, U, 2, 0)), W & 16 && (P[4] = B(D, N, R, U, 4, 5)), W & 32 && (P[5] = B(D, N, R, U, 5, 7)), W & 64 && (P[6] = B(D, N, R, U, 7, 6)), W & 128 && (P[7] = B(D, N, R, U, 6, 4)), W & 256 && (P[8] = B(D, N, R, U, 0, 4)), W & 512 && (P[9] = B(D, N, R, U, 1, 5)), W & 1024 && (P[10] = B(D, N, R, U, 3, 7)), W & 2048 && (P[11] = B(D, N, R, U, 2, 6)); + for (let F = 0; F < G.length; F += 3) { + let V = P[G[F]], J = P[G[F + 1]], X = P[G[F + 2]]; + p && F >= 3 && (w.push(w[V]), V = w.length - 1, w.push(w[J]), J = w.length - 1, w.push(w[X]), X = w.length - 1), L.push(V), L.push(J), L.push(X); } } } - laplacianSmooth(b, A, S) { - let s = new Array(A.length), o, w, p, v, a; - for (o = 0, w = A.length; o < w; o++) + laplacianSmooth(y, w, L) { + let s = new Array(w.length), o, A, p, v, a; + for (o = 0, A = w.length; o < A; o++) s[o] = { x: 0, y: 0, @@ -10152,75 +10152,75 @@ ATOM`, g); }; let l = new Array(20), g; for (o = 0; o < 20; o++) - l[o] = new Array(A.length); - for (o = 0, w = A.length; o < w; o++) + l[o] = new Array(w.length); + for (o = 0, A = w.length; o < A; o++) l[0][o] = 0; - for (o = 0, w = S.length / 3; o < w; o++) { + for (o = 0, A = L.length / 3; o < A; o++) { let T = o * 3, D = o * 3 + 1, I = o * 3 + 2; - for (g = !0, p = 0, v = l[0][S[T]]; p < v; p++) - if (S[D] == l[p + 1][S[T]]) { + for (g = !0, p = 0, v = l[0][L[T]]; p < v; p++) + if (L[D] == l[p + 1][L[T]]) { g = !1; break; } - for (g && (l[0][S[T]]++, l[l[0][S[T]]][S[T]] = S[D]), g = !0, p = 0, v = l[0][S[T]]; p < v; p++) - if (S[I] == l[p + 1][S[T]]) { + for (g && (l[0][L[T]]++, l[l[0][L[T]]][L[T]] = L[D]), g = !0, p = 0, v = l[0][L[T]]; p < v; p++) + if (L[I] == l[p + 1][L[T]]) { g = !1; break; } - for (g && (l[0][S[T]]++, l[l[0][S[T]]][S[T]] = S[I]), g = !0, p = 0, v = l[0][S[D]]; p < v; p++) - if (S[T] == l[p + 1][S[D]]) { + for (g && (l[0][L[T]]++, l[l[0][L[T]]][L[T]] = L[I]), g = !0, p = 0, v = l[0][L[D]]; p < v; p++) + if (L[T] == l[p + 1][L[D]]) { g = !1; break; } - for (g && (l[0][S[D]]++, l[l[0][S[D]]][S[D]] = S[T]), g = !0, p = 0, v = l[0][S[D]]; p < v; p++) - if (S[I] == l[p + 1][S[D]]) { + for (g && (l[0][L[D]]++, l[l[0][L[D]]][L[D]] = L[T]), g = !0, p = 0, v = l[0][L[D]]; p < v; p++) + if (L[I] == l[p + 1][L[D]]) { g = !1; break; } - for (g && (l[0][S[D]]++, l[l[0][S[D]]][S[D]] = S[I]), g = !0, p = 0; p < l[0][S[I]]; p++) - if (S[T] == l[p + 1][S[I]]) { + for (g && (l[0][L[D]]++, l[l[0][L[D]]][L[D]] = L[I]), g = !0, p = 0; p < l[0][L[I]]; p++) + if (L[T] == l[p + 1][L[I]]) { g = !1; break; } - for (g && (l[0][S[I]]++, l[l[0][S[I]]][S[I]] = S[T]), g = !0, p = 0, v = l[0][S[I]]; p < v; p++) - if (S[D] == l[p + 1][S[I]]) { + for (g && (l[0][L[I]]++, l[l[0][L[I]]][L[I]] = L[T]), g = !0, p = 0, v = l[0][L[I]]; p < v; p++) + if (L[D] == l[p + 1][L[I]]) { g = !1; break; } - g && (l[0][S[I]]++, l[l[0][S[I]]][S[I]] = S[D]); + g && (l[0][L[I]]++, l[l[0][L[I]]][L[I]] = L[D]); } - let M = 1, L = 0.5; - for (a = 0; a < b; a++) { - for (o = 0, w = A.length; o < w; o++) + let M = 1, C = 0.5; + for (a = 0; a < y; a++) { + for (o = 0, A = w.length; o < A; o++) if (l[0][o] < 3) - s[o].x = A[o].x, s[o].y = A[o].y, s[o].z = A[o].z; + s[o].x = w[o].x, s[o].y = w[o].y, s[o].z = w[o].z; else if (l[0][o] == 3 || l[0][o] == 4) { for (s[o].x = 0, s[o].y = 0, s[o].z = 0, p = 0, v = l[0][o]; p < v; p++) - s[o].x += A[l[p + 1][o]].x, s[o].y += A[l[p + 1][o]].y, s[o].z += A[l[p + 1][o]].z; - s[o].x += L * A[o].x, s[o].y += L * A[o].y, s[o].z += L * A[o].z, s[o].x /= L + l[0][o], s[o].y /= L + l[0][o], s[o].z /= L + l[0][o]; + s[o].x += w[l[p + 1][o]].x, s[o].y += w[l[p + 1][o]].y, s[o].z += w[l[p + 1][o]].z; + s[o].x += C * w[o].x, s[o].y += C * w[o].y, s[o].z += C * w[o].z, s[o].x /= C + l[0][o], s[o].y /= C + l[0][o], s[o].z /= C + l[0][o]; } else { for (s[o].x = 0, s[o].y = 0, s[o].z = 0, p = 0, v = l[0][o]; p < v; p++) - s[o].x += A[l[p + 1][o]].x, s[o].y += A[l[p + 1][o]].y, s[o].z += A[l[p + 1][o]].z; - s[o].x += M * A[o].x, s[o].y += M * A[o].y, s[o].z += M * A[o].z, s[o].x /= M + l[0][o], s[o].y /= M + l[0][o], s[o].z /= M + l[0][o]; + s[o].x += w[l[p + 1][o]].x, s[o].y += w[l[p + 1][o]].y, s[o].z += w[l[p + 1][o]].z; + s[o].x += M * w[o].x, s[o].y += M * w[o].y, s[o].z += M * w[o].z, s[o].x /= M + l[0][o], s[o].y /= M + l[0][o], s[o].z /= M + l[0][o]; } - for (o = 0, w = A.length; o < w; o++) - A[o].x = s[o].x, A[o].y = s[o].y, A[o].z = s[o].z; + for (o = 0, A = w.length; o < A; o++) + w[o].x = s[o].x, w[o].y = s[o].y, w[o].z = s[o].z; } } } let _ = new h(); class E { - constructor(b, A, S) { - this.data = new Int32Array(b * A * S * 3), this.width = A, this.height = S; + constructor(y, w, L) { + this.data = new Int32Array(y * w * L * 3), this.width = w, this.height = L; } // set position x,y,z to pt, which has ix,iy,and iz - set(b, A, S, s) { - let o = ((b * this.width + A) * this.height + S) * 3; + set(y, w, L, s) { + let o = ((y * this.width + w) * this.height + L) * 3; this.data[o] = s.ix, this.data[o + 1] = s.iy, this.data[o + 2] = s.iz; } // return point at x,y,z - get(b, A, S) { - let s = ((b * this.width + A) * this.height + S) * 3; + get(y, w, L) { + let s = ((y * this.width + w) * this.height + L) * 3; return { ix: this.data[s], iy: this.data[s + 1], @@ -10277,84 +10277,84 @@ ATOM`, g); new Int32Array([-1, -1, -1]) ], c.MarchingCube || (c.MarchingCube = new h()); } - getVDWIndex(b) { - return !b.elem || typeof this.vdwRadii[b.elem] > "u" ? "X" : b.elem; + getVDWIndex(y) { + return !y.elem || typeof this.vdwRadii[y.elem] > "u" ? "X" : y.elem; } - getFacesAndVertices(b) { - let A = {}; - for (let o = 0, w = b.length; o < w; o++) - A[b[o]] = !0; - let S = this.verts; - for (let o = 0, w = S.length; o < w; o++) - S[o].x = S[o].x / this.scaleFactor - this.ptranx, S[o].y = S[o].y / this.scaleFactor - this.ptrany, S[o].z = S[o].z / this.scaleFactor - this.ptranz; + getFacesAndVertices(y) { + let w = {}; + for (let o = 0, A = y.length; o < A; o++) + w[y[o]] = !0; + let L = this.verts; + for (let o = 0, A = L.length; o < A; o++) + L[o].x = L[o].x / this.scaleFactor - this.ptranx, L[o].y = L[o].y / this.scaleFactor - this.ptrany, L[o].z = L[o].z / this.scaleFactor - this.ptranz; let s = []; - for (let o = 0, w = this.faces.length; o < w; o += 3) { - let p = this.faces[o], v = this.faces[o + 1], a = this.faces[o + 2], l = S[p].atomid, g = S[v].atomid, M = S[a].atomid, L = l; - g < L && (L = g), M < L && (L = M), A[L] && p !== v && v !== a && p !== a && (s.push(p), s.push(v), s.push(a)); + for (let o = 0, A = this.faces.length; o < A; o += 3) { + let p = this.faces[o], v = this.faces[o + 1], a = this.faces[o + 2], l = L[p].atomid, g = L[v].atomid, M = L[a].atomid, C = l; + g < C && (C = g), M < C && (C = M), w[C] && p !== v && v !== a && p !== a && (s.push(p), s.push(v), s.push(a)); } return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, { - vertices: S, + vertices: L, faces: s }; } - initparm(b, A, S) { - S > 1e6 && (this.scaleFactor = this.defaultScaleFactor / 2); + initparm(y, w, L) { + L > 1e6 && (this.scaleFactor = this.defaultScaleFactor / 2); let s = 1 / this.scaleFactor * 5.5; - this.pminx = b[0][0], this.pmaxx = b[1][0], this.pminy = b[0][1], this.pmaxy = b[1][1], this.pminz = b[0][2], this.pmaxz = b[1][2], A ? (this.pminx -= this.probeRadius + s, this.pminy -= this.probeRadius + s, this.pminz -= this.probeRadius + s, this.pmaxx += this.probeRadius + s, this.pmaxy += this.probeRadius + s, this.pmaxz += this.probeRadius + s) : (this.pminx -= s, this.pminy -= s, this.pminz -= s, this.pmaxx += s, this.pmaxy += s, this.pmaxz += s), this.pminx = Math.floor(this.pminx * this.scaleFactor) / this.scaleFactor, this.pminy = Math.floor(this.pminy * this.scaleFactor) / this.scaleFactor, this.pminz = Math.floor(this.pminz * this.scaleFactor) / this.scaleFactor, this.pmaxx = Math.ceil(this.pmaxx * this.scaleFactor) / this.scaleFactor, this.pmaxy = Math.ceil(this.pmaxy * this.scaleFactor) / this.scaleFactor, this.pmaxz = Math.ceil(this.pmaxz * this.scaleFactor) / this.scaleFactor, this.ptranx = -this.pminx, this.ptrany = -this.pminy, this.ptranz = -this.pminz, this.pLength = Math.ceil(this.scaleFactor * (this.pmaxx - this.pminx)) + 1, this.pWidth = Math.ceil(this.scaleFactor * (this.pmaxy - this.pminy)) + 1, this.pHeight = Math.ceil(this.scaleFactor * (this.pmaxz - this.pminz)) + 1, this.boundingatom(A), this.cutRadius = this.probeRadius * this.scaleFactor, this.vpBits = new Uint8Array(this.pLength * this.pWidth * this.pHeight), this.vpDistance = new Float64Array(this.pLength * this.pWidth * this.pHeight), this.vpAtomID = new Int32Array(this.pLength * this.pWidth * this.pHeight); - } - boundingatom(b) { - let A = {}; - for (const S in this.vdwRadii) { - let s = this.vdwRadii[S]; - b ? A[S] = (s + this.probeRadius) * this.scaleFactor + 0.5 : A[S] = s * this.scaleFactor + 0.5; - let o = A[S] * A[S]; - this.widxz[S] = Math.floor(A[S]) + 1, this.depty[S] = new Int32Array(this.widxz[S] * this.widxz[S]); - let w = 0; - for (let p = 0; p < this.widxz[S]; p++) - for (let v = 0; v < this.widxz[S]; v++) { + this.pminx = y[0][0], this.pmaxx = y[1][0], this.pminy = y[0][1], this.pmaxy = y[1][1], this.pminz = y[0][2], this.pmaxz = y[1][2], w ? (this.pminx -= this.probeRadius + s, this.pminy -= this.probeRadius + s, this.pminz -= this.probeRadius + s, this.pmaxx += this.probeRadius + s, this.pmaxy += this.probeRadius + s, this.pmaxz += this.probeRadius + s) : (this.pminx -= s, this.pminy -= s, this.pminz -= s, this.pmaxx += s, this.pmaxy += s, this.pmaxz += s), this.pminx = Math.floor(this.pminx * this.scaleFactor) / this.scaleFactor, this.pminy = Math.floor(this.pminy * this.scaleFactor) / this.scaleFactor, this.pminz = Math.floor(this.pminz * this.scaleFactor) / this.scaleFactor, this.pmaxx = Math.ceil(this.pmaxx * this.scaleFactor) / this.scaleFactor, this.pmaxy = Math.ceil(this.pmaxy * this.scaleFactor) / this.scaleFactor, this.pmaxz = Math.ceil(this.pmaxz * this.scaleFactor) / this.scaleFactor, this.ptranx = -this.pminx, this.ptrany = -this.pminy, this.ptranz = -this.pminz, this.pLength = Math.ceil(this.scaleFactor * (this.pmaxx - this.pminx)) + 1, this.pWidth = Math.ceil(this.scaleFactor * (this.pmaxy - this.pminy)) + 1, this.pHeight = Math.ceil(this.scaleFactor * (this.pmaxz - this.pminz)) + 1, this.boundingatom(w), this.cutRadius = this.probeRadius * this.scaleFactor, this.vpBits = new Uint8Array(this.pLength * this.pWidth * this.pHeight), this.vpDistance = new Float64Array(this.pLength * this.pWidth * this.pHeight), this.vpAtomID = new Int32Array(this.pLength * this.pWidth * this.pHeight); + } + boundingatom(y) { + let w = {}; + for (const L in this.vdwRadii) { + let s = this.vdwRadii[L]; + y ? w[L] = (s + this.probeRadius) * this.scaleFactor + 0.5 : w[L] = s * this.scaleFactor + 0.5; + let o = w[L] * w[L]; + this.widxz[L] = Math.floor(w[L]) + 1, this.depty[L] = new Int32Array(this.widxz[L] * this.widxz[L]); + let A = 0; + for (let p = 0; p < this.widxz[L]; p++) + for (let v = 0; v < this.widxz[L]; v++) { let a = p * p + v * v; if (a > o) - this.depty[S][w] = -1; + this.depty[L][A] = -1; else { let l = Math.sqrt(o - a); - this.depty[S][w] = Math.floor(l); + this.depty[L][A] = Math.floor(l); } - w++; + A++; } } } - fillvoxels(b, A) { - for (let S = 0, s = this.vpBits.length; S < s; S++) - this.vpBits[S] = 0, this.vpDistance[S] = -1, this.vpAtomID[S] = -1; - for (let S in A) { - let s = b[A[S]]; - s !== void 0 && this.fillAtom(s, b); + fillvoxels(y, w) { + for (let L = 0, s = this.vpBits.length; L < s; L++) + this.vpBits[L] = 0, this.vpDistance[L] = -1, this.vpAtomID[L] = -1; + for (let L in w) { + let s = y[w[L]]; + s !== void 0 && this.fillAtom(s, y); } - for (let S = 0, s = this.vpBits.length; S < s; S++) - this.vpBits[S] & this.INOUT && (this.vpBits[S] |= this.ISDONE); + for (let L = 0, s = this.vpBits.length; L < s; L++) + this.vpBits[L] & this.INOUT && (this.vpBits[L] |= this.ISDONE); } - fillAtom(b, A) { - let S = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), s = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), o = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), w = this.getVDWIndex(b), p = 0, v = this.pWidth * this.pHeight; - for (let a = 0, l = this.widxz[w]; a < l; a++) + fillAtom(y, w) { + let L = Math.floor(0.5 + this.scaleFactor * (y.x + this.ptranx)), s = Math.floor(0.5 + this.scaleFactor * (y.y + this.ptrany)), o = Math.floor(0.5 + this.scaleFactor * (y.z + this.ptranz)), A = this.getVDWIndex(y), p = 0, v = this.pWidth * this.pHeight; + for (let a = 0, l = this.widxz[A]; a < l; a++) for (let g = 0; g < l; g++) { - if (this.depty[w][p] != -1) { + if (this.depty[A][p] != -1) { for (let M = -1; M < 2; M++) - for (let L = -1; L < 2; L++) + for (let C = -1; C < 2; C++) for (let T = -1; T < 2; T++) - if (M !== 0 && L !== 0 && T !== 0) { + if (M !== 0 && C !== 0 && T !== 0) { let D = M * a, I = T * g; - for (let z = 0; z <= this.depty[w][p]; z++) { - let P = z * L, B = S + D, k = s + P, N = o + I; - if (B < 0 || k < 0 || N < 0 || B >= this.pLength || k >= this.pWidth || N >= this.pHeight) + for (let B = 0; B <= this.depty[A][p]; B++) { + let P = B * C, z = L + D, k = s + P, N = o + I; + if (z < 0 || k < 0 || N < 0 || z >= this.pLength || k >= this.pWidth || N >= this.pHeight) continue; - let $ = B * v + k * this.pHeight + N; - if (!(this.vpBits[$] & this.INOUT)) - this.vpBits[$] |= this.INOUT, this.vpAtomID[$] = b.serial; + let R = z * v + k * this.pHeight + N; + if (!(this.vpBits[R] & this.INOUT)) + this.vpBits[R] |= this.INOUT, this.vpAtomID[R] = y.serial; else { - let F = A[this.vpAtomID[$]]; - if (F.serial != b.serial) { - let G = S + D - Math.floor(0.5 + this.scaleFactor * (F.x + this.ptranx)), H = s + P - Math.floor(0.5 + this.scaleFactor * (F.y + this.ptrany)), U = o + I - Math.floor(0.5 + this.scaleFactor * (F.z + this.ptranz)); - D * D + P * P + I * I < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); + let U = w[this.vpAtomID[R]]; + if (U.serial != y.serial) { + let W = L + D - Math.floor(0.5 + this.scaleFactor * (U.x + this.ptranx)), G = s + P - Math.floor(0.5 + this.scaleFactor * (U.y + this.ptrany)), F = o + I - Math.floor(0.5 + this.scaleFactor * (U.z + this.ptranz)); + D * D + P * P + I * I < W * W + G * G + F * F && (this.vpAtomID[R] = y.serial); } } } @@ -10363,158 +10363,158 @@ ATOM`, g); p++; } } - fillvoxelswaals(b, A) { - for (let S = 0, s = this.vpBits.length; S < s; S++) - this.vpBits[S] &= ~this.ISDONE; - for (let S in A) { - let s = b[A[S]]; - s !== void 0 && this.fillAtomWaals(s, b); + fillvoxelswaals(y, w) { + for (let L = 0, s = this.vpBits.length; L < s; L++) + this.vpBits[L] &= ~this.ISDONE; + for (let L in w) { + let s = y[w[L]]; + s !== void 0 && this.fillAtomWaals(s, y); } } - fillAtomWaals(b, A) { - let S = 0, s = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), o = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), w = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), p = this.getVDWIndex(b), v = this.pWidth * this.pHeight; + fillAtomWaals(y, w) { + let L = 0, s = Math.floor(0.5 + this.scaleFactor * (y.x + this.ptranx)), o = Math.floor(0.5 + this.scaleFactor * (y.y + this.ptrany)), A = Math.floor(0.5 + this.scaleFactor * (y.z + this.ptranz)), p = this.getVDWIndex(y), v = this.pWidth * this.pHeight; for (let a = 0, l = this.widxz[p]; a < l; a++) for (let g = 0; g < l; g++) { - if (this.depty[p][S] != -1) { + if (this.depty[p][L] != -1) { for (let M = -1; M < 2; M++) - for (let L = -1; L < 2; L++) + for (let C = -1; C < 2; C++) for (let T = -1; T < 2; T++) - if (M !== 0 && L !== 0 && T !== 0) { + if (M !== 0 && C !== 0 && T !== 0) { let D = M * a, I = T * g; - for (let z = 0; z <= this.depty[p][S]; z++) { - let P = z * L, B = s + D, k = o + P, N = w + I; - if (B < 0 || k < 0 || N < 0 || B >= this.pLength || k >= this.pWidth || N >= this.pHeight) + for (let B = 0; B <= this.depty[p][L]; B++) { + let P = B * C, z = s + D, k = o + P, N = A + I; + if (z < 0 || k < 0 || N < 0 || z >= this.pLength || k >= this.pWidth || N >= this.pHeight) continue; - let $ = B * v + k * this.pHeight + N; - if (!(this.vpBits[$] & this.ISDONE)) - this.vpBits[$] |= this.ISDONE, this.vpAtomID[$] = b.serial; + let R = z * v + k * this.pHeight + N; + if (!(this.vpBits[R] & this.ISDONE)) + this.vpBits[R] |= this.ISDONE, this.vpAtomID[R] = y.serial; else { - let F = A[this.vpAtomID[$]]; - if (F.serial != b.serial) { - let G = s + D - Math.floor(0.5 + this.scaleFactor * (F.x + this.ptranx)), H = o + P - Math.floor(0.5 + this.scaleFactor * (F.y + this.ptrany)), U = w + I - Math.floor(0.5 + this.scaleFactor * (F.z + this.ptranz)); - D * D + P * P + I * I < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); + let U = w[this.vpAtomID[R]]; + if (U.serial != y.serial) { + let W = s + D - Math.floor(0.5 + this.scaleFactor * (U.x + this.ptranx)), G = o + P - Math.floor(0.5 + this.scaleFactor * (U.y + this.ptrany)), F = A + I - Math.floor(0.5 + this.scaleFactor * (U.z + this.ptranz)); + D * D + P * P + I * I < W * W + G * G + F * F && (this.vpAtomID[R] = y.serial); } } } } } - S++; + L++; } } buildboundary() { - let b = this.pWidth * this.pHeight; - for (let A = 0; A < this.pLength; A++) - for (let S = 0; S < this.pHeight; S++) + let y = this.pWidth * this.pHeight; + for (let w = 0; w < this.pLength; w++) + for (let L = 0; L < this.pHeight; L++) for (let s = 0; s < this.pWidth; s++) { - let o = A * b + s * this.pHeight + S; + let o = w * y + s * this.pHeight + L; if (this.vpBits[o] & this.INOUT) { - let w = 0; - for (; w < 26; ) { - let p = A + this.nb[w][0], v = S + this.nb[w][2], a = s + this.nb[w][1]; - if (p > -1 && p < this.pLength && a > -1 && a < this.pWidth && v > -1 && v < this.pHeight && !(this.vpBits[p * b + a * this.pHeight + v] & this.INOUT)) { + let A = 0; + for (; A < 26; ) { + let p = w + this.nb[A][0], v = L + this.nb[A][2], a = s + this.nb[A][1]; + if (p > -1 && p < this.pLength && a > -1 && a < this.pWidth && v > -1 && v < this.pHeight && !(this.vpBits[p * y + a * this.pHeight + v] & this.INOUT)) { this.vpBits[o] |= this.ISBOUND; break; } else - w++; + A++; } } } } fastdistancemap() { - let b = new E(this.pLength, this.pWidth, this.pHeight), A = this.pWidth * this.pHeight, S = this.cutRadius * this.cutRadius, s = [], o = [], w; + let y = new E(this.pLength, this.pWidth, this.pHeight), w = this.pWidth * this.pHeight, L = this.cutRadius * this.cutRadius, s = [], o = [], A; for (let a = 0; a < this.pLength; a++) for (let l = 0; l < this.pWidth; l++) for (let g = 0; g < this.pHeight; g++) - if (w = a * A + l * this.pHeight + g, this.vpBits[w] &= ~this.ISDONE, this.vpBits[w] & this.INOUT && this.vpBits[w] & this.ISBOUND) { + if (A = a * w + l * this.pHeight + g, this.vpBits[A] &= ~this.ISDONE, this.vpBits[A] & this.INOUT && this.vpBits[A] & this.ISBOUND) { let M = { ix: a, iy: l, iz: g }; - b.set(a, l, g, M), s.push(M), this.vpDistance[w] = 0, this.vpBits[w] |= this.ISDONE, this.vpBits[w] &= ~this.ISBOUND; + y.set(a, l, g, M), s.push(M), this.vpDistance[A] = 0, this.vpBits[A] |= this.ISDONE, this.vpBits[A] &= ~this.ISBOUND; } do { - o = this.fastoneshell(s, b), s = []; + o = this.fastoneshell(s, y), s = []; for (let a = 0, l = o.length; a < l; a++) - w = A * o[a].ix + this.pHeight * o[a].iy + o[a].iz, this.vpBits[w] &= ~this.ISBOUND, this.vpDistance[w] <= 1.0404 * S && s.push({ + A = w * o[a].ix + this.pHeight * o[a].iy + o[a].iz, this.vpBits[A] &= ~this.ISBOUND, this.vpDistance[A] <= 1.0404 * L && s.push({ ix: o[a].ix, iy: o[a].iy, iz: o[a].iz }); } while (s.length !== 0); - s = [], o = [], b = null; + s = [], o = [], y = null; let p = this.scaleFactor - 0.5; p < 0 && (p = 0); - let v = S - 0.5 / (0.1 + p); + let v = L - 0.5 / (0.1 + p); for (let a = 0; a < this.pLength; a++) for (let l = 0; l < this.pWidth; l++) for (let g = 0; g < this.pHeight; g++) - w = a * A + l * this.pHeight + g, this.vpBits[w] &= ~this.ISBOUND, this.vpBits[w] & this.INOUT && (!(this.vpBits[w] & this.ISDONE) || this.vpBits[w] & this.ISDONE && this.vpDistance[w] >= v) && (this.vpBits[w] |= this.ISBOUND); + A = a * w + l * this.pHeight + g, this.vpBits[A] &= ~this.ISBOUND, this.vpBits[A] & this.INOUT && (!(this.vpBits[A] & this.ISDONE) || this.vpBits[A] & this.ISDONE && this.vpDistance[A] >= v) && (this.vpBits[A] |= this.ISBOUND); } - fastoneshell(b, A) { - let S, s, o, w, p, v, a, l, g, M = []; - if (b.length === 0) + fastoneshell(y, w) { + let L, s, o, A, p, v, a, l, g, M = []; + if (y.length === 0) return M; - let L = { + let C = { ix: -1, iy: -1, iz: -1 }, T = this.pWidth * this.pHeight; - for (let D = 0, I = b.length; D < I; D++) { - S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); - for (let z = 0; z < 6; z++) - L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz - })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, a < this.vpDistance[g] && (A.set(L.ix, L.iy, L.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz + for (let D = 0, I = y.length; D < I; D++) { + L = y[D].ix, s = y[D].iy, o = y[D].iz, l = w.get(L, s, o); + for (let B = 0; B < 6; B++) + C.ix = L + this.nb[B][0], C.iy = s + this.nb[B][1], C.iz = o + this.nb[B][2], C.ix < this.pLength && C.ix > -1 && C.iy < this.pWidth && C.iy > -1 && C.iz < this.pHeight && C.iz > -1 && (g = C.ix * T + this.pHeight * C.iy + C.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (w.set(C.ix, C.iy, o + this.nb[B][2], l), A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz + })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, a < this.vpDistance[g] && (w.set(C.ix, C.iy, C.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz }))))); } - for (let D = 0, I = b.length; D < I; D++) { - S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); - for (let z = 6; z < 18; z++) - L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz - })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, a < this.vpDistance[g] && (A.set(L.ix, L.iy, L.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz + for (let D = 0, I = y.length; D < I; D++) { + L = y[D].ix, s = y[D].iy, o = y[D].iz, l = w.get(L, s, o); + for (let B = 6; B < 18; B++) + C.ix = L + this.nb[B][0], C.iy = s + this.nb[B][1], C.iz = o + this.nb[B][2], C.ix < this.pLength && C.ix > -1 && C.iy < this.pWidth && C.iy > -1 && C.iz < this.pHeight && C.iz > -1 && (g = C.ix * T + this.pHeight * C.iy + C.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (w.set(C.ix, C.iy, o + this.nb[B][2], l), A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz + })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, a < this.vpDistance[g] && (w.set(C.ix, C.iy, C.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz }))))); } - for (let D = 0, I = b.length; D < I; D++) { - S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); - for (let z = 18; z < 26; z++) - L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz - })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, a < this.vpDistance[g] && (A.set(L.ix, L.iy, L.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ - ix: L.ix, - iy: L.iy, - iz: L.iz + for (let D = 0, I = y.length; D < I; D++) { + L = y[D].ix, s = y[D].iy, o = y[D].iz, l = w.get(L, s, o); + for (let B = 18; B < 26; B++) + C.ix = L + this.nb[B][0], C.iy = s + this.nb[B][1], C.iz = o + this.nb[B][2], C.ix < this.pLength && C.ix > -1 && C.iy < this.pWidth && C.iy > -1 && C.iz < this.pHeight && C.iz > -1 && (g = C.ix * T + this.pHeight * C.iy + C.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (w.set(C.ix, C.iy, o + this.nb[B][2], l), A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz + })) : this.vpBits[g] & this.INOUT && this.vpBits[g] & this.ISDONE && (A = C.ix - l.ix, p = C.iy - l.iy, v = C.iz - l.iz, a = A * A + p * p + v * v, a < this.vpDistance[g] && (w.set(C.ix, C.iy, C.iz, l), this.vpDistance[g] = a, this.vpBits[g] & this.ISBOUND || (this.vpBits[g] |= this.ISBOUND, M.push({ + ix: C.ix, + iy: C.iy, + iz: C.iz }))))); } return M; } - marchingcubeinit(b) { - for (let A = 0, S = this.vpBits.length; A < S; A++) - b == 1 ? this.vpBits[A] &= ~this.ISBOUND : b == 4 ? (this.vpBits[A] &= ~this.ISDONE, this.vpBits[A] & this.ISBOUND && (this.vpBits[A] |= this.ISDONE), this.vpBits[A] &= ~this.ISBOUND) : b == 2 ? this.vpBits[A] & this.ISBOUND && this.vpBits[A] & this.ISDONE ? this.vpBits[A] &= ~this.ISBOUND : this.vpBits[A] & this.ISBOUND && !(this.vpBits[A] & this.ISDONE) && (this.vpBits[A] |= this.ISDONE) : b == 3 && (this.vpBits[A] &= ~this.ISBOUND); + marchingcubeinit(y) { + for (let w = 0, L = this.vpBits.length; w < L; w++) + y == 1 ? this.vpBits[w] &= ~this.ISBOUND : y == 4 ? (this.vpBits[w] &= ~this.ISDONE, this.vpBits[w] & this.ISBOUND && (this.vpBits[w] |= this.ISDONE), this.vpBits[w] &= ~this.ISBOUND) : y == 2 ? this.vpBits[w] & this.ISBOUND && this.vpBits[w] & this.ISDONE ? this.vpBits[w] &= ~this.ISBOUND : this.vpBits[w] & this.ISBOUND && !(this.vpBits[w] & this.ISDONE) && (this.vpBits[w] |= this.ISDONE) : y == 3 && (this.vpBits[w] &= ~this.ISBOUND); } - marchingcube(b) { - this.marchingcubeinit(b), this.verts = [], this.faces = [], c.MarchingCube.march(this.vpBits, this.verts, this.faces, { + marchingcube(y) { + this.marchingcubeinit(y), this.verts = [], this.faces = [], c.MarchingCube.march(this.vpBits, this.verts, this.faces, { smooth: 1, nX: this.pLength, nY: this.pWidth, nZ: this.pHeight }); - let A = this.pWidth * this.pHeight; - for (let S = 0, s = this.verts.length; S < s; S++) - this.verts[S].atomid = this.vpAtomID[this.verts[S].x * A + this.pHeight * this.verts[S].y + this.verts[S].z]; + let w = this.pWidth * this.pHeight; + for (let L = 0, s = this.verts.length; L < s; L++) + this.verts[L].atomid = this.vpAtomID[this.verts[L].x * w + this.pHeight * this.verts[L].y + this.verts[L].z]; c.MarchingCube.laplacianSmooth(1, this.verts, this.faces); } } @@ -10527,8 +10527,8 @@ ATOM`, g); !*** ./src/VolumeData.ts ***! \***************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ VolumeData: () => ( /* binding */ @@ -10536,24 +10536,24 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utilities */ "./src/utilities.ts" - ), f = t( + ), f = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), u = t( + ), u = r( /*! ./parsers/VASP */ "./src/parsers/VASP.ts" - ), y = t( + ), b = r( /*! ./parsers/CUBE */ "./src/parsers/CUBE.ts" - ), h = t( + ), h = r( /*! pako */ "./node_modules/pako/dist/pako.esm.mjs" ); class _ { - constructor(c, C, b) { + constructor(c, S, y) { if (this.unit = { x: 1, y: 1, @@ -10566,91 +10566,91 @@ ATOM`, g); x: 0, y: 0, z: 0 - }, this.data = new Float32Array([]), this.matrix = null, this.inversematrix = null, this.isbinary = /* @__PURE__ */ new Set(["ccp4", "CCP4"]), this.getCoordinates = function(w) { - var p = w / (this.size.y * this.size.z), v = w % (this.size.y * this.size.z), a = w % this.size.z; + }, this.data = new Float32Array([]), this.matrix = null, this.inversematrix = null, this.isbinary = /* @__PURE__ */ new Set(["ccp4", "CCP4"]), this.getCoordinates = function(A) { + var p = A / (this.size.y * this.size.z), v = A % (this.size.y * this.size.z), a = A % this.size.z; return p *= this.unit.x, v *= this.unit.y, a *= this.unit.z, p += this.origin.x, v += this.origin.y, a += this.origin.z, { x: p, y: v, z: a }; - }, this.vasp = function(w) { - var p = w.replace(/^\s+/, "").split(/[\n\r]/), v = (0, u.VASP)(w)[0], a = v.length; + }, this.vasp = function(A) { + var p = A.replace(/^\s+/, "").split(/[\n\r]/), v = (0, u.VASP)(A)[0], a = v.length; if (a == 0) { console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."), this.data = []; return; } - var l = 1.889725992, g = 0.036749309, M = parseFloat(p[1]), L; - L = p[2].replace(/^\s+/, "").split(/\s+/); - var T = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l); - L = p[3].replace(/^\s+/, "").split(/\s+/); - var D = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l); - L = p[4].replace(/^\s+/, "").split(/\s+/); - var I = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l), z = T.x * (D.y * I.z - I.y * D.z) - D.x * (T.y * I.z - I.y * T.z) + I.x * (T.y * D.z - D.y * T.z); - z = Math.abs(z) / Math.pow(l, 3); - var P = 1 / z; + var l = 1.889725992, g = 0.036749309, M = parseFloat(p[1]), C; + C = p[2].replace(/^\s+/, "").split(/\s+/); + var T = new f.Vector3(parseFloat(C[0]), parseFloat(C[1]), parseFloat(C[2])).multiplyScalar(M * l); + C = p[3].replace(/^\s+/, "").split(/\s+/); + var D = new f.Vector3(parseFloat(C[0]), parseFloat(C[1]), parseFloat(C[2])).multiplyScalar(M * l); + C = p[4].replace(/^\s+/, "").split(/\s+/); + var I = new f.Vector3(parseFloat(C[0]), parseFloat(C[1]), parseFloat(C[2])).multiplyScalar(M * l), B = T.x * (D.y * I.z - I.y * D.z) - D.x * (T.y * I.z - I.y * T.z) + I.x * (T.y * D.z - D.y * T.z); + B = Math.abs(B) / Math.pow(l, 3); + var P = 1 / B; p.splice(0, 8 + a + 1); - var B = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), k = Math.abs(parseFloat(B[0])), N = Math.abs(parseFloat(B[1])), $ = Math.abs(parseFloat(B[2])), F = this.origin = new f.Vector3(0, 0, 0); - this.size = { x: k, y: N, z: $ }, this.unit = new f.Vector3(T.x, D.y, I.z), T = T.multiplyScalar(1 / (l * k)), D = D.multiplyScalar(1 / (l * N)), I = I.multiplyScalar(1 / (l * $)), (T.y != 0 || T.z != 0 || D.x != 0 || D.z != 0 || I.x != 0 || I.y != 0) && (this.matrix = new f.Matrix4(T.x, D.x, I.x, 0, T.y, D.y, I.y, 0, T.z, D.z, I.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(F.x, F.y, F.z)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1)), p.splice(0, 1); - var G = p.join(" "); - G = G.replace(/^\s+/, ""); - var H = G.split(/[\s\r]+/); - H.splice(k * N * $ + 1); - for (var U = Float32Array.from(H, parseFloat), V = 0; V < U.length; V++) - U[V] = U[V] * P * g; - this.data = U; - }, this.dx = function(w) { - var p = w.split(/[\n\r]+/), v, a = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, l = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, g = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, M = /data follows/, L = 0; - for (L = 0; L < p.length; L++) { - var T = p[L]; + var z = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), k = Math.abs(parseFloat(z[0])), N = Math.abs(parseFloat(z[1])), R = Math.abs(parseFloat(z[2])), U = this.origin = new f.Vector3(0, 0, 0); + this.size = { x: k, y: N, z: R }, this.unit = new f.Vector3(T.x, D.y, I.z), T = T.multiplyScalar(1 / (l * k)), D = D.multiplyScalar(1 / (l * N)), I = I.multiplyScalar(1 / (l * R)), (T.y != 0 || T.z != 0 || D.x != 0 || D.z != 0 || I.x != 0 || I.y != 0) && (this.matrix = new f.Matrix4(T.x, D.x, I.x, 0, T.y, D.y, I.y, 0, T.z, D.z, I.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(U.x, U.y, U.z)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1)), p.splice(0, 1); + var W = p.join(" "); + W = W.replace(/^\s+/, ""); + var G = W.split(/[\s\r]+/); + G.splice(k * N * R + 1); + for (var F = Float32Array.from(G, parseFloat), V = 0; V < F.length; V++) + F[V] = F[V] * P * g; + this.data = F; + }, this.dx = function(A) { + var p = A.split(/[\n\r]+/), v, a = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, l = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, g = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, M = /data follows/, C = 0; + for (C = 0; C < p.length; C++) { + var T = p[C]; if (v = a.exec(T)) { - var D = parseInt(v[1]), I = parseInt(v[2]), z = parseInt(v[3]); - this.size = { x: D, y: I, z }; + var D = parseInt(v[1]), I = parseInt(v[2]), B = parseInt(v[3]); + this.size = { x: D, y: I, z: B }; } else if (v = g.exec(T)) { var P = parseFloat(v[1]); - if ((parseFloat(v[2]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), L += 1, T = p[L], v = g.exec(T), v == null) { + if ((parseFloat(v[2]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), C += 1, T = p[C], v = g.exec(T), v == null) { console.log("Parse error in dx delta matrix"); return; } - var B = parseFloat(v[2]); - if ((parseFloat(v[1]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), L += 1, T = p[L], v = g.exec(T), v == null) { + var z = parseFloat(v[2]); + if ((parseFloat(v[1]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), C += 1, T = p[C], v = g.exec(T), v == null) { console.log("Parse error in dx delta matrix"); return; } var k = parseFloat(v[3]); - (parseFloat(v[1]) != 0 || parseFloat(v[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new f.Vector3(P, B, k); + (parseFloat(v[1]) != 0 || parseFloat(v[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new f.Vector3(P, z, k); } else if (v = l.exec(T)) { - var N = parseFloat(v[1]), $ = parseFloat(v[2]), F = parseFloat(v[3]); - this.origin = new f.Vector3(N, $, F); + var N = parseFloat(v[1]), R = parseFloat(v[2]), U = parseFloat(v[3]); + this.origin = new f.Vector3(N, R, U); } else if (v = M.exec(T)) break; } - if (L += 1, !this.size || !this.origin || !this.unit || !this.size) { + if (C += 1, !this.size || !this.origin || !this.unit || !this.size) { console.log("Error parsing dx format"); return; } - var G = p.splice(L).join(" "), H = G.split(/[\s\r]+/); - this.data = Float32Array.from(H, parseFloat); - }, C = C.toLowerCase(), /\.gz$/.test(C)) { - C = C.replace(/\.gz$/, ""); + var W = p.splice(C).join(" "), G = W.split(/[\s\r]+/); + this.data = Float32Array.from(G, parseFloat); + }, S = S.toLowerCase(), /\.gz$/.test(S)) { + S = S.replace(/\.gz$/, ""); try { - this[C] && this.isbinary.has(C) ? (typeof c == "string" && (c = (0, n.base64ToArray)(c)), c = (0, h.inflate)(c)) : c = new TextDecoder("utf-8").decode((0, h.inflate)(c)); - } catch (w) { - console.log(w); + this[S] && this.isbinary.has(S) ? (typeof c == "string" && (c = (0, n.base64ToArray)(c)), c = (0, h.inflate)(c)) : c = new TextDecoder("utf-8").decode((0, h.inflate)(c)); + } catch (A) { + console.log(A); } } - if (this[C] && (this.isbinary.has(C) && typeof c == "string" && (c = (0, n.base64ToArray)(c)), this[C](c)), b) { - if (b.negate) - for (let w = 0, p = this.data.length; w < p; w++) - this.data[w] = -this.data[w]; - if (b.normalize) { - var A = 0; - for (let w = 0, p = this.data.length; w < p; w++) - A += this.data[w]; - var S = A / this.data.length; - A = 0; - for (let w = 0, p = this.data.length; w < p; w++) { - var s = this.data[w] - S; - A += s * s; + if (this[S] && (this.isbinary.has(S) && typeof c == "string" && (c = (0, n.base64ToArray)(c)), this[S](c)), y) { + if (y.negate) + for (let A = 0, p = this.data.length; A < p; A++) + this.data[A] = -this.data[A]; + if (y.normalize) { + var w = 0; + for (let A = 0, p = this.data.length; A < p; A++) + w += this.data[A]; + var L = w / this.data.length; + w = 0; + for (let A = 0, p = this.data.length; A < p; A++) { + var s = this.data[A] - L; + w += s * s; } - var o = A / this.data.length; - for (let w = 0, p = this.data.length; w < p; w++) - this.data[w] = (this.data[w] - S) / o; + var o = w / this.data.length; + for (let A = 0, p = this.data.length; A < p; A++) + this.data[A] = (this.data[A] - L) / o; } } } @@ -10659,69 +10659,69 @@ ATOM`, g); * @param {number} x,y,z - the coordinates * @returns - index into flat array closest to provided coordinate; -1 if invalid */ - getIndex(c, C, b) { + getIndex(c, S, y) { if (this.matrix) { this.inversematrix == null && (this.inversematrix = new f.Matrix4().getInverse(this.matrix)); - var A = new f.Vector3(c, C, b); - A = A.applyMatrix4(this.inversematrix), c = A.x, C = A.y, b = A.z; + var w = new f.Vector3(c, S, y); + w = w.applyMatrix4(this.inversematrix), c = w.x, S = w.y, y = w.z; } else - c -= this.origin.x, C -= this.origin.y, b -= this.origin.z, c /= this.unit.x, C /= this.unit.y, b /= this.unit.z; - return c = Math.round(c), C = Math.round(C), b = Math.round(b), c < 0 || c >= this.size.x || C < 0 || C >= this.size.y || b < 0 || b >= this.size.z ? -1 : c * this.size.y * this.size.z + C * this.size.z + b; + c -= this.origin.x, S -= this.origin.y, y -= this.origin.z, c /= this.unit.x, S /= this.unit.y, y /= this.unit.z; + return c = Math.round(c), S = Math.round(S), y = Math.round(y), c < 0 || c >= this.size.x || S < 0 || S >= this.size.y || y < 0 || y >= this.size.z ? -1 : c * this.size.y * this.size.z + S * this.size.z + y; } /** * @function $3Dmol.VolumeData.getVal * @param {number} x,y,z - the coordinates * @returns - value closest to provided coordinate; zero if coordinate invalid */ - getVal(c, C, b) { - let A = this.getIndex(c, C, b); - return A < 0 ? 0 : this.data[A]; + getVal(c, S, y) { + let w = this.getIndex(c, S, y); + return w < 0 ? 0 : this.data[w]; } // parse cube data cube(c) { - var C = c.split(/\r?\n/); - if (!(C.length < 6)) { - var b = (0, y.CUBE)(c, {}).modelData[0].cryst, A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseFloat(A[0]), s = Math.abs(S); - this.origin = b.origin, this.size = b.size, this.unit = b.unit, this.matrix = b.matrix4; + var S = c.split(/\r?\n/); + if (!(S.length < 6)) { + var y = (0, b.CUBE)(c, {}).modelData[0].cryst, w = S[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), L = parseFloat(w[0]), s = Math.abs(L); + this.origin = y.origin, this.size = y.size, this.unit = y.unit, this.matrix = y.matrix4; var o = 6; - S < 0 && o++; - var w = C.splice(s + o).join(" "); - w = w.replace(/^\s+/, ""); - var p = w.split(/[\s\r]+/); + L < 0 && o++; + var A = S.splice(s + o).join(" "); + A = A.replace(/^\s+/, ""); + var p = A.split(/[\s\r]+/); this.data = Float32Array.from(p, parseFloat); } } //parse cp4 files ccp4(c) { - var C = {}; + var S = {}; c = new Int8Array(c); - var b = new Int32Array(c.buffer, 0, 56), A = new Float32Array(c.buffer, 0, 56), S = new DataView(c.buffer); - if (C.MAP = String.fromCharCode(S.getUint8(208), S.getUint8(209), S.getUint8(210), S.getUint8(211)), C.MACHST = [S.getUint8(212), S.getUint8(213)], C.MACHST[0] === 17 && C.MACHST[1] === 17) + var y = new Int32Array(c.buffer, 0, 56), w = new Float32Array(c.buffer, 0, 56), L = new DataView(c.buffer); + if (S.MAP = String.fromCharCode(L.getUint8(208), L.getUint8(209), L.getUint8(210), L.getUint8(211)), S.MACHST = [L.getUint8(212), L.getUint8(213)], S.MACHST[0] === 17 && S.MACHST[1] === 17) for (var s = c.byteLength, o = 0; o < s; o += 4) - S.setFloat32(o, S.getFloat32(o), !0); - C.NX = b[0], C.NY = b[1], C.NZ = b[2], C.MODE = b[3], C.NXSTART = b[4], C.NYSTART = b[5], C.NZSTART = b[6], C.MX = b[7], C.MY = b[8], C.MZ = b[9], C.xlen = A[10], C.ylen = A[11], C.zlen = A[12], C.alpha = A[13], C.beta = A[14], C.gamma = A[15], C.MAPC = b[16], C.MAPR = b[17], C.MAPS = b[18], C.DMIN = A[19], C.DMAX = A[20], C.DMEAN = A[21], C.ISPG = b[22], C.NSYMBT = b[23], C.LSKFLG = b[24], C.originX = A[49], C.originY = A[50], C.originZ = A[51], C.ARMS = A[54]; - var w = C, p = [ - w.xlen, + L.setFloat32(o, L.getFloat32(o), !0); + S.NX = y[0], S.NY = y[1], S.NZ = y[2], S.MODE = y[3], S.NXSTART = y[4], S.NYSTART = y[5], S.NZSTART = y[6], S.MX = y[7], S.MY = y[8], S.MZ = y[9], S.xlen = w[10], S.ylen = w[11], S.zlen = w[12], S.alpha = w[13], S.beta = w[14], S.gamma = w[15], S.MAPC = y[16], S.MAPR = y[17], S.MAPS = y[18], S.DMIN = w[19], S.DMAX = w[20], S.DMEAN = w[21], S.ISPG = y[22], S.NSYMBT = y[23], S.LSKFLG = y[24], S.originX = w[49], S.originY = w[50], S.originZ = w[51], S.ARMS = w[54]; + var A = S, p = [ + A.xlen, 0, 0 ], v = [ - w.ylen * Math.cos(Math.PI / 180 * w.gamma), - w.ylen * Math.sin(Math.PI / 180 * w.gamma), + A.ylen * Math.cos(Math.PI / 180 * A.gamma), + A.ylen * Math.sin(Math.PI / 180 * A.gamma), 0 ], a = [ - w.zlen * Math.cos(Math.PI / 180 * w.beta), - w.zlen * (Math.cos(Math.PI / 180 * w.alpha) - Math.cos(Math.PI / 180 * w.gamma) * Math.cos(Math.PI / 180 * w.beta)) / Math.sin(Math.PI / 180 * w.gamma), + A.zlen * Math.cos(Math.PI / 180 * A.beta), + A.zlen * (Math.cos(Math.PI / 180 * A.alpha) - Math.cos(Math.PI / 180 * A.gamma) * Math.cos(Math.PI / 180 * A.beta)) / Math.sin(Math.PI / 180 * A.gamma), 0 ]; - a[2] = Math.sqrt(w.zlen * w.zlen * Math.sin(Math.PI / 180 * w.beta) * Math.sin(Math.PI / 180 * w.beta) - a[1] * a[1]); - var l = [0, p, v, a], g = [0, w.MX, w.MY, w.MZ], M = [0, w.MAPC, w.MAPR, w.MAPS]; - this.matrix = new f.Matrix4(), this.matrix.set(l[M[1]][0] / g[M[1]], l[M[2]][0] / g[M[2]], l[M[3]][0] / g[M[3]], 0, l[M[1]][1] / g[M[1]], l[M[2]][1] / g[M[2]], l[M[3]][1] / g[M[3]], 0, l[M[1]][2] / g[M[1]], l[M[2]][2] / g[M[2]], l[M[3]][2] / g[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(w.NXSTART + w.originX, w.NYSTART + w.originY, w.NZSTART + w.originZ)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1), this.size = { x: C.NX, y: C.NY, z: C.NZ }, this.dimensionorder = [C.MAPC, C.MAPR, C.MAPS]; - var L = new Float32Array(c.buffer, 1024 + C.NSYMBT), T = C.NX, D = C.NY, I = C.NZ; + a[2] = Math.sqrt(A.zlen * A.zlen * Math.sin(Math.PI / 180 * A.beta) * Math.sin(Math.PI / 180 * A.beta) - a[1] * a[1]); + var l = [0, p, v, a], g = [0, A.MX, A.MY, A.MZ], M = [0, A.MAPC, A.MAPR, A.MAPS]; + this.matrix = new f.Matrix4(), this.matrix.set(l[M[1]][0] / g[M[1]], l[M[2]][0] / g[M[2]], l[M[3]][0] / g[M[3]], 0, l[M[1]][1] / g[M[1]], l[M[2]][1] / g[M[2]], l[M[3]][1] / g[M[3]], 0, l[M[1]][2] / g[M[1]], l[M[2]][2] / g[M[2]], l[M[3]][2] / g[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(A.NXSTART + A.originX, A.NYSTART + A.originY, A.NZSTART + A.originZ)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1), this.size = { x: S.NX, y: S.NY, z: S.NZ }, this.dimensionorder = [S.MAPC, S.MAPR, S.MAPS]; + var C = new Float32Array(c.buffer, 1024 + S.NSYMBT), T = S.NX, D = S.NY, I = S.NZ; this.data = new Float32Array(T * D * I); - for (let z = 0; z < T; z++) + for (let B = 0; B < T; B++) for (let P = 0; P < D; P++) - for (let B = 0; B < I; B++) - this.data[(z * D + P) * I + B] = L[(B * D + P) * T + z]; + for (let z = 0; z < I; z++) + this.data[(B * D + P) * I + z] = C[(z * D + P) * T + B]; } } } @@ -10732,8 +10732,8 @@ ATOM`, g); !*** ./src/VolumetricRender.ts ***! \*********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ GLVolumetricRender: () => ( /* binding */ @@ -10741,49 +10741,49 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), f = t( + ), f = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), u = t( + ), u = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), y = t( + ), b = r( /*! ./colors */ "./src/colors.ts" - ), h = t( + ), h = r( /*! ./GLShape */ "./src/GLShape.ts" ); class _ { - static interpolateArray(c, C) { - function b(a, l, g) { + static interpolateArray(c, S) { + function y(a, l, g) { return a + (l - a) * g; } - var A = [], S = (c.length - 1) / (C - 1); - A[0] = c[0]; - for (var s = 1; s < C - 1; s++) { - var o = s * S, w = Math.floor(o), p = Math.ceil(o), v = o - w; - A[s] = b(c[w], c[p], v); + var w = [], L = (c.length - 1) / (S - 1); + w[0] = c[0]; + for (var s = 1; s < S - 1; s++) { + var o = s * L, A = Math.floor(o), p = Math.ceil(o), v = o - A; + w[s] = y(c[A], c[p], v); } - return A[C - 1] = c[c.length - 1], A; + return w[S - 1] = c[c.length - 1], w; } - constructor(c, C) { - this.hidden = !1, this.boundingSphere = new n.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, C = C || {}; - var b = Object.assign([], C.transferfn); - this.subsamples = C.subsamples || 5; - let A = 256; - b.forEach(function(T) { + constructor(c, S) { + this.hidden = !1, this.boundingSphere = new n.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, S = S || {}; + var y = Object.assign([], S.transferfn); + this.subsamples = S.subsamples || 5; + let w = 256; + y.forEach(function(T) { T.value = parseFloat(T.value); - }), b.sort(function(T, D) { + }), y.sort(function(T, D) { return T.value - D.value; - }), this.min = b[0].value, b.length == 0 && b.push(b[0]), this.max = b[b.length - 1].value; - var S, s, o, w, p, v, a, l, g, M; - for (let T = 0; T < b.length - 1; T++) - if (o = y.CC.color(b[T].color), w = y.CC.color(b[T + 1].color), g = b[T].opacity, M = b[T + 1].opacity, S = Math.floor((b[T].value - this.min) * A / (this.max - this.min)), s = Math.floor((b[T + 1].value - this.min) * A / (this.max - this.min)), S != s) { - p = _.interpolateArray([o.r * 255, w.r * 255], s - S), v = _.interpolateArray([o.g * 255, w.g * 255], s - S), a = _.interpolateArray([o.b * 255, w.b * 255], s - S), l = _.interpolateArray([g * 255, M * 255], s - S); + }), this.min = y[0].value, y.length == 0 && y.push(y[0]), this.max = y[y.length - 1].value; + var L, s, o, A, p, v, a, l, g, M; + for (let T = 0; T < y.length - 1; T++) + if (o = b.CC.color(y[T].color), A = b.CC.color(y[T + 1].color), g = y[T].opacity, M = y[T + 1].opacity, L = Math.floor((y[T].value - this.min) * w / (this.max - this.min)), s = Math.floor((y[T + 1].value - this.min) * w / (this.max - this.min)), L != s) { + p = _.interpolateArray([o.r * 255, A.r * 255], s - L), v = _.interpolateArray([o.g * 255, A.g * 255], s - L), a = _.interpolateArray([o.b * 255, A.b * 255], s - L), l = _.interpolateArray([g * 255, M * 255], s - L); for (let D = 0; D < p.length; D++) this.transferfunctionbuffer.push(p[D]), this.transferfunctionbuffer.push(v[D]), this.transferfunctionbuffer.push(a[D]), this.transferfunctionbuffer.push(l[D]); } @@ -10792,8 +10792,8 @@ ATOM`, g); T.applyMatrix4(c.matrix), D.applyMatrix4(c.matrix), I.applyMatrix4(c.matrix).sub(T), this.extent = [[T.x, T.y, T.z], [D.x, D.y, D.z]]; for (let k = 1; k < 7; k++) D.x = k & 1 ? c.size.x : 0, D.y = k & 2 ? c.size.y : 0, D.z = k & 4 ? c.size.z : 0, D.applyMatrix4(c.matrix), this.extent[0][0] = Math.min(this.extent[0][0], D.x), this.extent[0][1] = Math.min(this.extent[0][1], D.y), this.extent[0][2] = Math.min(this.extent[0][2], D.z), this.extent[1][0] = Math.max(this.extent[1][0], D.x), this.extent[1][1] = Math.max(this.extent[1][1], D.y), this.extent[1][2] = Math.max(this.extent[1][2], D.z); - let z = D.x - T.x, P = D.y - T.y, B = D.z - T.z; - this.maxdepth = Math.sqrt(z * z + P * P + B * B), this.minunit = Math.min(Math.min(I.x, I.y), I.z), this.texmatrix = new f.Matrix4().identity().scale({ x: c.size.x, y: c.size.y, z: c.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(c.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); + let B = D.x - T.x, P = D.y - T.y, z = D.z - T.z; + this.maxdepth = Math.sqrt(B * B + P * P + z * z), this.minunit = Math.min(Math.min(I.x, I.y), I.z), this.texmatrix = new f.Matrix4().identity().scale({ x: c.size.x, y: c.size.y, z: c.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(c.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); } else { this.texmatrix = new f.Matrix4().identity(); let T = c.unit.x * c.size.x, D = c.unit.y * c.size.y, I = c.unit.z * c.size.z; @@ -10802,28 +10802,28 @@ ATOM`, g); [c.origin.x + T, c.origin.y + D, c.origin.z + I] ], this.maxdepth = Math.sqrt(T * T + D * D + I * I); } - var L = new h.GLShape({}); - if (L.addBox({ + var C = new h.GLShape({}); + if (C.addBox({ corner: { x: this.extent[0][0], y: this.extent[0][1], z: this.extent[0][2] }, dimensions: { w: this.extent[1][0] - this.extent[0][0], h: this.extent[1][1] - this.extent[0][1], d: this.extent[1][2] - this.extent[0][2] } - }), this.geo = L.finalize(), this.boundingSphere.center = new f.Vector3((this.extent[0][0] + this.extent[1][0]) / 2, (this.extent[0][1] + this.extent[1][1]) / 2, (this.extent[0][2] + this.extent[1][2]) / 2), this.boundingSphere.radius = this.maxdepth / 2, C.coords !== void 0 && C.seldist !== void 0) { - let T = new Uint8Array(c.data.length), D = C.seldist, I = D * D; - for (let z = 0, P = C.coords.length; z < P; z++) { - let B = C.coords[z], k = B.x - D, N = B.y - D, $ = B.z - D, F = B.x + D, G = B.y + D, H = B.z + D; - if (c.getIndex(k, N, $) >= 0 || c.getIndex(F, G, H) >= 0) - for (let U = k; U < F; U += this.minunit) - for (let V = N; V < G; V += this.minunit) - for (let Q = $; Q < H; Q += this.minunit) { - let ae = c.getIndex(U, V, Q); - ae >= 0 && !T[ae] && (U - B.x) * (U - B.x) + (V - B.y) * (V - B.y) + (Q - B.z) * (Q - B.z) < I && (T[ae] = 1); + }), this.geo = C.finalize(), this.boundingSphere.center = new f.Vector3((this.extent[0][0] + this.extent[1][0]) / 2, (this.extent[0][1] + this.extent[1][1]) / 2, (this.extent[0][2] + this.extent[1][2]) / 2), this.boundingSphere.radius = this.maxdepth / 2, S.coords !== void 0 && S.seldist !== void 0) { + let T = new Uint8Array(c.data.length), D = S.seldist, I = D * D; + for (let B = 0, P = S.coords.length; B < P; B++) { + let z = S.coords[B], k = z.x - D, N = z.y - D, R = z.z - D, U = z.x + D, W = z.y + D, G = z.z + D; + if (c.getIndex(k, N, R) >= 0 || c.getIndex(U, W, G) >= 0) + for (let F = k; F < U; F += this.minunit) + for (let V = N; V < W; V += this.minunit) + for (let J = R; J < G; J += this.minunit) { + let X = c.getIndex(F, V, J); + X >= 0 && !T[X] && (F - z.x) * (F - z.x) + (V - z.y) * (V - z.y) + (J - z.z) * (J - z.z) < I && (T[X] = 1); } } - for (let z = 0, P = c.data.length; z < P; z++) - T[z] == 0 && (c.data[z] = 1 / 0); + for (let B = 0, P = c.data.length; B < P; B++) + T[B] == 0 && (c.data[B] = 1 / 0); } this.data = c; } @@ -10835,20 +10835,20 @@ ATOM`, g); globj(c) { if (this.renderedShapeObj && (c.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { this.shapeObj = new u.Object3D(); - var C = null, b = new u.Texture(this.data, !0), A = new u.Texture(this.transferfunctionbuffer, !1); - b.needsUpdate = !0, A.needsUpdate = !0, A.flipY = !1, C = new u.VolumetricMaterial({ - transferfn: A, + var S = null, y = new u.Texture(this.data, !0), w = new u.Texture(this.transferfunctionbuffer, !1); + y.needsUpdate = !0, w.needsUpdate = !0, w.flipY = !1, S = new u.VolumetricMaterial({ + transferfn: w, transfermin: this.min, transfermax: this.max, - map: b, + map: y, extent: this.extent, maxdepth: this.maxdepth, texmatrix: this.texmatrix, unit: this.minunit, subsamples: this.subsamples }); - var S = new u.Mesh(this.geo, C); - this.shapeObj.add(S), this.renderedShapeObj = this.shapeObj.clone(), c.add(this.renderedShapeObj); + var L = new u.Mesh(this.geo, S); + this.shapeObj.add(L), this.renderedShapeObj = this.shapeObj.clone(), c.add(this.renderedShapeObj); } } removegl(c) { @@ -10875,8 +10875,8 @@ ATOM`, g); !*** ./src/WebGL/Camera.ts ***! \*****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Camera: () => ( /* binding */ @@ -10884,18 +10884,18 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./core */ "./src/WebGL/core/index.ts" - ), f = t( + ), f = r( /*! ./math */ "./src/WebGL/math/index.ts" ); class u extends n.Object3D { - constructor(h = 50, _ = 1, E = 0.1, c = 2e3, C = !1) { + constructor(h = 50, _ = 1, E = 0.1, c = 2e3, S = !1) { super(), this.projectionMatrix = new f.Matrix4(), this.projectionMatrixInverse = new f.Matrix4(), this.matrixWorldInverse = new f.Matrix4(), this.fov = h, this.aspect = _, this.near = E, this.far = c; - var b = this.position.z; - this.right = b * Math.tan(Math.PI / 180 * h), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!C, this.updateProjectionMatrix(); + var y = this.position.z; + this.right = y * Math.tan(Math.PI / 180 * h), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!S, this.updateProjectionMatrix(); } lookAt(h) { this.matrix.lookAt(this.position, h, this.up), this.rotationAutoUpdate && (this.useQuaternion === !1 && this.rotation instanceof f.Vector3 ? this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder) : console.error("Unimplemented math operation.")); @@ -10912,8 +10912,8 @@ ATOM`, g); !*** ./src/WebGL/Fog.ts ***! \**************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Fog: () => ( /* binding */ @@ -10921,13 +10921,13 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../colors */ "./src/colors.ts" ); class f { - constructor(y, h = 1, _ = 1e3) { - this.name = "", this.color = new n.Color(y), this.near = h, this.far = _; + constructor(b, h = 1, _ = 1e3) { + this.name = "", this.color = new n.Color(b), this.near = h, this.far = _; } clone() { return new f(this.color.getHex(), this.near, this.far); @@ -10941,47 +10941,47 @@ ATOM`, g); !*** ./src/WebGL/Renderer.ts ***! \*******************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Renderer: () => ( /* binding */ - A + w ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Camera */ "./src/WebGL/Camera.ts" - ), f = t( + ), f = r( /*! ./constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), u = t( + ), u = r( /*! ./constants/TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), y = t( + ), b = r( /*! ./core */ "./src/WebGL/core/index.ts" - ), h = t( + ), h = r( /*! ../colors */ "./src/colors.ts" - ), _ = t( + ), _ = r( /*! ./materials */ "./src/WebGL/materials/index.ts" - ), E = t( + ), E = r( /*! ./math */ "./src/WebGL/math/index.ts" - ), c = t( + ), c = r( /*! ./objects */ "./src/WebGL/objects/index.ts" - ), C = t( + ), S = r( /*! ./shaders */ "./src/WebGL/shaders/index.ts" - ), b = t( + ), y = r( /*! ./SpritePlugin */ "./src/WebGL/SpritePlugin.ts" ); - class A { + class w { constructor(s) { this.context = null, this.devicePixelRatio = 1, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.autoUpdateObjects = !0, this.autoUpdateScene = !0, this.info = { memory: { @@ -11023,7 +11023,7 @@ ATOM`, g); groundColors: [], positions: [] } - }, this.sprites = new b.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, s = s || {}, this.row = s.row, this.col = s.col, this.rows = s.rows, this.cols = s.cols, this._canvas = s.canvas !== void 0 ? s.canvas : document.createElement("canvas"), this._precision = s.precision !== void 0 ? s.precision : "highp", this._alpha = s.alpha !== void 0 ? s.alpha : !0, this._premultipliedAlpha = s.premultipliedAlpha !== void 0 ? s.premultipliedAlpha : !0, this._antialias = s.antialias !== void 0 ? s.antialias : !1, this._stencil = s.stencil !== void 0 ? s.stencil : !0, this._preserveDrawingBuffer = s.preserveDrawingBuffer !== void 0 ? s.preserveDrawingBuffer : !1, this._clearColor = s.clearColor !== void 0 ? new h.Color(s.clearColor) : new h.Color(0), this._clearAlpha = s.clearAlpha !== void 0 ? s.clearAlpha : 0, this._outlineMaterial = new _.MeshOutlineMaterial(s.outline), this._outlineSphereImposterMaterial = new _.SphereImposterOutlineMaterial(s.outline), this._outlineStickImposterMaterial = new _.StickImposterOutlineMaterial(s.outline), this._outlineEnabled = !!s.outline, this.domElement = this._canvas, this._canvas.id = s.id, this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = { + }, this.sprites = new y.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, s = s || {}, this.row = s.row, this.col = s.col, this.rows = s.rows, this.cols = s.cols, this._canvas = s.canvas !== void 0 ? s.canvas : document.createElement("canvas"), this._precision = s.precision !== void 0 ? s.precision : "highp", this._alpha = s.alpha !== void 0 ? s.alpha : !0, this._premultipliedAlpha = s.premultipliedAlpha !== void 0 ? s.premultipliedAlpha : !0, this._antialias = s.antialias !== void 0 ? s.antialias : !1, this._stencil = s.stencil !== void 0 ? s.stencil : !0, this._preserveDrawingBuffer = s.preserveDrawingBuffer !== void 0 ? s.preserveDrawingBuffer : !1, this._clearColor = s.clearColor !== void 0 ? new h.Color(s.clearColor) : new h.Color(0), this._clearAlpha = s.clearAlpha !== void 0 ? s.clearAlpha : 0, this._outlineMaterial = new _.MeshOutlineMaterial(s.outline), this._outlineSphereImposterMaterial = new _.SphereImposterOutlineMaterial(s.outline), this._outlineStickImposterMaterial = new _.StickImposterOutlineMaterial(s.outline), this._outlineEnabled = !!s.outline, this.domElement = this._canvas, this._canvas.id = s.id, this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = { vertexAttribDivisorANGLE: this._gl.vertexAttribDivisor.bind(this._gl), drawElementsInstancedANGLE: this._gl.drawElementsInstanced.bind(this._gl) }, this._extFragDepth = this._gl.getExtension("EXT_frag_depth"), this._extFloatLinear = this._gl.getExtension("OES_texture_float_linear"), this._extColorBufferFloat = this._gl.getExtension("EXT_color_buffer_float"), this.sprites.init(this); @@ -11062,22 +11062,22 @@ ATOM`, g); } setSize(s, o) { if (this.devicePixelRatio = window.devicePixelRatio !== void 0 ? window.devicePixelRatio : 1, this._antialias && this.devicePixelRatio < 2 && (this.devicePixelRatio *= 2), this.rows != null && this.cols != null && this.row != null && this.col != null) { - var w = s / this.cols, p = o / this.rows; - this._canvas.width = s * this.devicePixelRatio, this._canvas.height = o * this.devicePixelRatio, this._viewportWidth = w * this.devicePixelRatio, this._viewportHeight = p * this.devicePixelRatio, this._canvas.style.width = s + "px", this._canvas.style.height = o + "px", this.setViewport(); + var A = s / this.cols, p = o / this.rows; + this._canvas.width = s * this.devicePixelRatio, this._canvas.height = o * this.devicePixelRatio, this._viewportWidth = A * this.devicePixelRatio, this._viewportHeight = p * this.devicePixelRatio, this._canvas.style.width = s + "px", this._canvas.style.height = o + "px", this.setViewport(); } else this._viewportWidth = this._canvas.width = s * this.devicePixelRatio, this._viewportHeight = this._canvas.height = o * this.devicePixelRatio, this._canvas.style.width = s + "px", this._canvas.style.height = o + "px", this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight); this.initFrameBuffer(); } - clear(s, o, w) { + clear(s, o, A) { var p = 0; - (s === void 0 || s) && (p |= this._gl.COLOR_BUFFER_BIT), (o === void 0 || o) && (p |= this._gl.DEPTH_BUFFER_BIT), (w === void 0 || w) && (p |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(p); + (s === void 0 || s) && (p |= this._gl.COLOR_BUFFER_BIT), (o === void 0 || o) && (p |= this._gl.DEPTH_BUFFER_BIT), (A === void 0 || A) && (p |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(p); } - clearTarget(s, o, w) { - this.clear(s, o, w); + clearTarget(s, o, A) { + this.clear(s, o, A); } setMaterialFaces(s, o) { - var w = s.side === f.DoubleSide, p = s.side === f.BackSide; - s.imposter || (p = o ? !p : p), this._oldDoubleSided !== w && (w ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = w), this._oldFlipSided !== p && (p ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = p), this._gl.cullFace(this._gl.BACK); + var A = s.side === f.DoubleSide, p = s.side === f.BackSide; + s.imposter || (p = o ? !p : p), this._oldDoubleSided !== A && (A ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = A), this._oldFlipSided !== p && (p ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = p), this._gl.cullFace(this._gl.BACK); } setDepthTest(s) { this._oldDepthTest !== s && (s ? this._gl.enable(this._gl.DEPTH_TEST) : this._gl.disable(this._gl.DEPTH_TEST), this._oldDepthTest = s); @@ -11092,12 +11092,12 @@ ATOM`, g); // material object after attaching prgm // We need to attach appropriate uniform variables to material after shaders // have been chosen - initMaterial(s, o, w, p) { + initMaterial(s, o, A, p) { s.addEventListener("dispose", this.onMaterialDispose.bind(this)); var v, a; if (a = s.shaderID, a) { - var l = C.ShaderLib[a]; - s.vertexShader = l.vertexShader, s.fragmentShader = l.fragmentShader, s.uniforms = C.ShaderUtils.clone(l.uniforms); + var l = S.ShaderLib[a]; + s.vertexShader = l.vertexShader, s.fragmentShader = l.fragmentShader, s.uniforms = S.ShaderUtils.clone(l.uniforms); } v = { wireframe: s.wireframe, @@ -11105,18 +11105,18 @@ ATOM`, g); volumetric: s.volumetric }, s.program = this.buildProgram(s.fragmentShader, s.vertexShader, s.uniforms, v); } - renderBuffer(s, o, w, p, v, a) { + renderBuffer(s, o, A, p, v, a) { if (p.visible) { var l, g; - if (l = this.setProgram(s, o, w, p, a, this), !!l) { + if (l = this.setProgram(s, o, A, p, a, this), !!l) { g = l.attributes; - var M = !1, L = p.wireframe ? 1 : 0, T = v.id * 16777215 + l.id * 2 + L; + var M = !1, C = p.wireframe ? 1 : 0, T = v.id * 16777215 + l.id * 2 + C; T !== this._currentGeometryGroupHash && (this._currentGeometryGroupHash = T, M = !0), M && (this.disableAttributes(), g.position >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this.enableAttribute(g.position), this._gl.vertexAttribPointer(g.position, 3, this._gl.FLOAT, !1, 0, 0)), g.color >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglColorBuffer), this.enableAttribute(g.color), this._gl.vertexAttribPointer(g.color, 3, this._gl.FLOAT, !1, 0, 0)), g.normal >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this.enableAttribute(g.normal), this._gl.vertexAttribPointer(g.normal, 3, this._gl.FLOAT, !1, 0, 0)), g.offset >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglOffsetBuffer), this.enableAttribute(g.offset), this._gl.vertexAttribPointer(g.offset, 3, this._gl.FLOAT, !1, 0, 0)), g.radius >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglRadiusBuffer), this.enableAttribute(g.radius), this._gl.vertexAttribPointer(g.radius, 1, this._gl.FLOAT, !1, 0, 0))); var D, I; if (a instanceof c.Mesh) { if (p.shaderID === "instanced") { - var z = p.sphere.geometryGroups[0]; - M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, z.faceArray, this._gl.STATIC_DRAW)), D = z.faceidx, this._extInstanced.vertexAttribDivisorANGLE(g.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(g.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0, v.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(g.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(g.color, 0); + var B = p.sphere.geometryGroups[0]; + M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, B.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, B.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, B.faceArray, this._gl.STATIC_DRAW)), D = B.faceidx, this._extInstanced.vertexAttribDivisorANGLE(g.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(g.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0, v.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(g.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(g.color, 0); } else p.wireframe ? (I = v.lineidx, this.setLineWidth(p.wireframeLinewidth), M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, I, this._gl.UNSIGNED_SHORT, 0)) : (D = v.faceidx, M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0)); this.info.render.calls++, this.info.render.vertices += D, this.info.render.faces += D / 3; @@ -11125,18 +11125,18 @@ ATOM`, g); } } } - render(s, o, w) { + render(s, o, A) { if (!(o instanceof n.Camera)) { console.error("Renderer.render: camera is not an instance of Camera."); return; } - var p, v, a, l, g, M = s.__lights, L = s.fog; - this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && s.updateMatrixWorld(), o.parent === void 0 && o.updateMatrixWorld(), o.matrixWorldInverse.getInverse(o.matrixWorld), this._projScreenMatrix.multiplyMatrices(o.projectionMatrix, o.matrixWorldInverse), this.autoUpdateObjects && this.initWebGLObjects(s), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), (this.autoClear || w) && (this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil)), g = s.__webglObjects; + var p, v, a, l, g, M = s.__lights, C = s.fog; + this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && s.updateMatrixWorld(), o.parent === void 0 && o.updateMatrixWorld(), o.matrixWorldInverse.getInverse(o.matrixWorld), this._projScreenMatrix.multiplyMatrices(o.projectionMatrix, o.matrixWorldInverse), this.autoUpdateObjects && this.initWebGLObjects(s), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), (this.autoClear || A) && (this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil)), g = s.__webglObjects; var T = !1; for (p = 0, v = g.length; p < v; p++) a = g[p], l = a.object, a.render = !1, l.visible && (this.setupMatrices(l, o), this.unrollBufferMaterial(a), a.render = !0, a.volumetric && (T = !0)); var D = null; - this.setBlending(!1), this.renderObjects(s.__webglObjects, !0, "opaque", o, M, L, !1, D), this.renderSprites(s, o, !1), this.renderObjects(s.__webglObjects, !0, "blank", o, M, L, !0, D), this.renderObjects(s.__webglObjects, !1, "transparent", o, M, L, !0, D), T && this._fb && (this.reinitFrameBuffer(), this.renderObjects(s.__webglObjects, !1, "volumetric", o, M, L, !0, D)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(s, o, !0); + this.setBlending(!1), this.renderObjects(s.__webglObjects, !0, "opaque", o, M, C, !1, D), this.renderSprites(s, o, !1), this.renderObjects(s.__webglObjects, !0, "blank", o, M, C, !0, D), this.renderObjects(s.__webglObjects, !1, "transparent", o, M, C, !0, D), T && this._fb && (this.reinitFrameBuffer(), this.renderObjects(s.__webglObjects, !1, "volumetric", o, M, C, !0, D)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(s, o, !0); } //reinitialize framebuffer without the depth texture attached so we can read to it //do not allocate new textures @@ -11156,8 +11156,8 @@ ATOM`, g); return; let s = this._viewportWidth, o = this._viewportHeight; this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, s, o), this._gl.viewport(0, 0, s, o), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer(); - var w = C.ShaderLib.screen; - this._screenshader = this.buildProgram(w.fragmentShader, w.vertexShader, w.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition"); + var A = S.ShaderLib.screen; + this._screenshader = this.buildProgram(A.fragmentShader, A.vertexShader, A.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition"); var p = [ // First triangle: 1, @@ -11187,7 +11187,7 @@ ATOM`, g); } for (; s.__objectsRemoved.length; ) this.removeObject(s.__objectsRemoved[0], s), s.__objectsRemoved.splice(0, 1); - for (var o = 0, w = s.__webglObjects.length; o < w; o++) + for (var o = 0, A = s.__webglObjects.length; o < A; o++) this.updateObject(s.__webglObjects[o].object); } getYRatio() { @@ -11198,20 +11198,20 @@ ATOM`, g); } getAspect(s, o) { (s == null || o == null) && (s = this._canvas.width, o = this._canvas.height); - var w = s / o; + var A = s / o; if (this.rows != null && this.cols != null && this.row != null && this.col != null) { var p = s / this.cols, v = o / this.rows; - w = p / v; + A = p / v; } - return w; + return A; } - setTexture(s, o, w) { + setTexture(s, o, A) { if (s.needsUpdate) { s.__webglInit || (s.__webglInit = !0, s.addEventListener("dispose", this.onTextureDispose.bind(this)), s.__webglTexture = this._gl.createTexture(), this.info.memory.textures++), this._gl.activeTexture(this._gl.TEXTURE0 + o); - var p = w ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D; + var p = A ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D; this._gl.bindTexture(p, s.__webglTexture), this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, s.flipY), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, s.premultiplyAlpha), this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, s.unpackAlignment), this._gl.pixelStorei(this._gl.PACK_ALIGNMENT, s.unpackAlignment); var v = this.paramToGL(s.format), a = this.paramToGL(s.type); - if (w) + if (A) this.setTextureParameters(this._gl.TEXTURE_3D, s), this._gl.texImage3D(this._gl.TEXTURE_3D, 0, this._gl.R32F, s.image.size.z, s.image.size.y, s.image.size.x, 0, this._gl.RED, this._gl.FLOAT, s.image.data); else { var l = s.image, g = l.width, M = l.height; @@ -11219,7 +11219,7 @@ ATOM`, g); } s.needsUpdate = !1, s.onUpdate && s.onUpdate(); } else - this._gl.activeTexture(this._gl.TEXTURE0 + o), w ? this._gl.bindTexture(this._gl.TEXTURE_3D, s.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, s.__webglTexture); + this._gl.activeTexture(this._gl.TEXTURE0 + o), A ? this._gl.bindTexture(this._gl.TEXTURE_3D, s.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, s.__webglTexture); } supportsVolumetric() { return !this.isWebGL1(); @@ -11231,7 +11231,7 @@ ATOM`, g); for (let s in this._enabledAttributes) this._enabledAttributes[s] && (this._gl.disableVertexAttribArray(s), this._enabledAttributes[s] = !1); } - setPolygonOffset(s, o, w) { + setPolygonOffset(s, o, A) { this._oldPolygonOffset !== s && (s ? this._gl.enable(this._gl.POLYGON_OFFSET_FILL) : this._gl.disable(this._gl.POLYGON_OFFSET_FILL)); } setLineWidth(s) { @@ -11239,7 +11239,7 @@ ATOM`, g); } deallocateGeometry(s) { if (s.__webglInit = void 0, s.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(s.__webglVertexBuffer), s.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(s.__webglColorBuffer), s.geometryGroups !== void 0) - for (var o = 0, w = s.groups; o < w; o++) { + for (var o = 0, A = s.groups; o < A; o++) { var p = s.geometryGroups[o]; p.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(p.__webglVertexBuffer), p.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(p.__webglColorBuffer), p.__webglNormalBuffer !== void 0 && this._gl.deleteBuffer(p.__webglNormalBuffer), p.__webglFaceBuffer !== void 0 && this._gl.deleteBuffer(p.__webglFaceBuffer), p.__webglLineBuffer !== void 0 && this._gl.deleteBuffer(p.__webglLineBuffer); } @@ -11248,16 +11248,16 @@ ATOM`, g); var o = s.program; if (o !== void 0) { s.program = void 0; - var w, p, v, a = !1; - for (w = 0, p = this._programs.length; w < p; w++) - if (v = this._programs[w], v.program === o) { + var A, p, v, a = !1; + for (A = 0, p = this._programs.length; A < p; A++) + if (v = this._programs[A], v.program === o) { v.usedTimes--, v.usedTimes === 0 && (a = !0); break; } if (a === !0) { var l = []; - for (w = 0, p = this._programs.length; w < p; w++) - v = this._programs[w], v.program !== o && l.push(v); + for (A = 0, p = this._programs.length; A < p; A++) + v = this._programs[A], v.program !== o && l.push(v); this._programs = l, this._gl.deleteProgram(o), this.info.memory.programs--; } } @@ -11285,21 +11285,21 @@ ATOM`, g); } // Compile and return shader getShader(s, o) { - var w; + var A; return !this.isWebGL1() && !o.startsWith("#version") && (o = o.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), s == "fragment" ? o = o.replace(/varying/g, "in") : o = o.replace(/varying/g, "out"), o = o.replace(/attribute/g, "in"), o = o.replace(/texture2D/g, "texture"), o = o.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), o = o.replace(/gl_FragColor/g, "glFragColor"), o = `#version 300 es -` + o), s === "fragment" ? w = this._gl.createShader(this._gl.FRAGMENT_SHADER) : s === "vertex" && (w = this._gl.createShader(this._gl.VERTEX_SHADER)), w == null ? null : (this._gl.shaderSource(w, o), this._gl.compileShader(w), this._gl.getShaderParameter(w, this._gl.COMPILE_STATUS) ? w : (console.error(this._gl.getShaderInfoLog(w)), console.error("could not initialize shader"), null)); +` + o), s === "fragment" ? A = this._gl.createShader(this._gl.FRAGMENT_SHADER) : s === "vertex" && (A = this._gl.createShader(this._gl.VERTEX_SHADER)), A == null ? null : (this._gl.shaderSource(A, o), this._gl.compileShader(A), this._gl.getShaderParameter(A, this._gl.COMPILE_STATUS) ? A : (console.error(this._gl.getShaderInfoLog(A)), console.error("could not initialize shader"), null)); } // Compile appropriate shaders (if necessary) from source code and attach to // gl program. - buildProgram(s, o, w, p) { + buildProgram(s, o, A, p) { var v, a, l, g, M = []; M.push(s), M.push(o); for (v in p) M.push(v), M.push(p[v]); for (g = M.join(), v = 0, a = this._programs.length; v < a; v++) { - var L = this._programs[v]; - if (L.code === g) - return L.usedTimes++, L.program; + var C = this._programs[v]; + if (C.code === g) + return C.usedTimes++, C.program; } if (this.isWebGL1() && p.volumetric) throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware."); @@ -11309,26 +11309,26 @@ ATOM`, g); p.volumetric ? "#version 300 es" : "", D ].join(` -`), z = [ +`), B = [ p.volumetric ? "#version 300 es" : "", p.fragdepth && this.isWebGL1() ? "#extension GL_EXT_frag_depth: enable" : "", p.wireframe ? "#define WIREFRAME 1" : "", D ].join(` -`), P = this.getShader("fragment", z + s), B = this.getShader("vertex", I + o); - B != null && this._gl.attachShader(l, B), P != null && this._gl.attachShader(l, P), this._gl.linkProgram(l), this._gl.getProgramParameter(l, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), l.uniforms = {}, l.attributes = {}; - var k, N, $; +`), P = this.getShader("fragment", B + s), z = this.getShader("vertex", I + o); + z != null && this._gl.attachShader(l, z), P != null && this._gl.attachShader(l, P), this._gl.linkProgram(l), this._gl.getProgramParameter(l, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), l.uniforms = {}, l.attributes = {}; + var k, N, R; k = [ "viewMatrix", "modelViewMatrix", "projectionMatrix", "normalMatrix" ]; - for (N in w) + for (N in A) k.push(N); - for ($ = 0; $ < k.length; $++) { - var F = k[$]; - l.uniforms[F] = this._gl.getUniformLocation(l, F); + for (R = 0; R < k.length; R++) { + var U = k[R]; + l.uniforms[U] = this._gl.getUniformLocation(l, U); } for (k = [ "position", @@ -11337,9 +11337,9 @@ ATOM`, g); "lineDistance", "offset", "radius" - ], $ = 0; $ < k.length; $++) { - var G = k[$]; - l.attributes[G] = this._gl.getAttribLocation(l, G); + ], R = 0; R < k.length; R++) { + var W = k[R]; + l.attributes[W] = this._gl.getAttribLocation(l, W); } return l.id = this._programs_counter++, this._programs.push({ program: l, @@ -11347,49 +11347,49 @@ ATOM`, g); usedTimes: 1 }), this.info.memory.programs = this._programs.length, l; } - setProgram(s, o, w, p, v, a) { - if (p.needsUpdate && (p.program && this.deallocateMaterial(p), this.initMaterial(p, o, w, v), p.needsUpdate = !1), p.program == null) + setProgram(s, o, A, p, v, a) { + if (p.needsUpdate && (p.program && this.deallocateMaterial(p), this.initMaterial(p, o, A, v), p.needsUpdate = !1), p.program == null) return null; - var l = !1, g = p.program, M = g.uniforms, L = p.uniforms; + var l = !1, g = p.program, M = g.uniforms, C = p.uniforms; if (g != this._currentProgram && (this._gl.useProgram(g), this._currentProgram = g, l = !0), p.id != this._currentMaterialId && (this._currentMaterialId = p.id, l = !0), s != this._currentCamera && (this._currentCamera = s, l = !0), this._gl.uniformMatrix4fv(M.projectionMatrix, !1, s.projectionMatrix.elements), this._gl.uniformMatrix4fv(M.modelViewMatrix, !1, v._modelViewMatrix.elements), this._gl.uniformMatrix3fv(M.normalMatrix, !1, v._normalMatrix.elements), l) { - if (L.fogColor.value = w.color, L.fogNear.value = w.near, L.fogFar.value = w.far, p.shaderID.startsWith("lambert") || p.shaderID === "instanced" || p.shaderID.endsWith("imposter")) - this._gl.uniformMatrix4fv(M.viewMatrix, !1, s.matrixWorldInverse.elements), this._lightsNeedUpdate && (this.setupLights(g, o), this._lightsNeedUpdate = !1), L.directionalLightColor.value = this._lights.directional.colors, L.directionalLightDirection.value = this._lights.directional.positions; + if (C.fogColor.value = A.color, C.fogNear.value = A.near, C.fogFar.value = A.far, p.shaderID.startsWith("lambert") || p.shaderID === "instanced" || p.shaderID.endsWith("imposter")) + this._gl.uniformMatrix4fv(M.viewMatrix, !1, s.matrixWorldInverse.elements), this._lightsNeedUpdate && (this.setupLights(g, o), this._lightsNeedUpdate = !1), C.directionalLightColor.value = this._lights.directional.colors, C.directionalLightDirection.value = this._lights.directional.positions; else if (p.shaderID.endsWith("outline")) - L.outlineColor.value = p.outlineColor, L.outlineWidth.value = p.outlineWidth, L.outlinePushback.value = p.outlinePushback; + C.outlineColor.value = p.outlineColor, C.outlineWidth.value = p.outlineWidth, C.outlinePushback.value = p.outlinePushback; else if (p.shaderID === "volumetric") { v._modelViewMatrix.getScale(this._direction), this._worldInverse.getInverse(v._modelViewMatrix), this._projInverse.getInverse(s.projectionMatrix), this._textureMatrix.multiplyMatrices(v.material.texmatrix, this._worldInverse), this._gl.uniformMatrix4fv(M.textmat, !1, this._textureMatrix.elements), this._gl.uniformMatrix4fv(M.projinv, !1, this._projInverse.elements); let T = Math.min(Math.min(this._direction.x, this._direction.y), this._direction.z); - L.step.value = v.material.unit * T, L.maxdepth.value = v.material.maxdepth * T, L.transfermax.value = v.material.transfermax, L.transfermin.value = v.material.transfermin, L.subsamples.value = v.material.subsamples, a.setTexture(v.material.transferfn, 4, !1), a.setTexture(v.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture); + C.step.value = v.material.unit * T, C.maxdepth.value = v.material.maxdepth * T, C.transfermax.value = v.material.transfermax, C.transfermin.value = v.material.transfermin, C.subsamples.value = v.material.subsamples, a.setTexture(v.material.transferfn, 4, !1), a.setTexture(v.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture); } - L.opacity.value = p.opacity, this.loadMaterialUniforms(M, L); + C.opacity.value = p.opacity, this.loadMaterialUniforms(M, C); } return g; } loadMaterialUniforms(s, o) { - var w, p, v, a; - for (w in o) - s[w] && (p = o[w].type, v = o[w].value, a = s[w], p === "f" ? this._gl.uniform1f(a, v) : p === "i" ? this._gl.uniform1i(a, v) : p === "fv" ? this._gl.uniform3fv(a, v) : p === "c" ? this._gl.uniform3f(a, v.r, v.g, v.b) : p === "f4" && this._gl.uniform4f(a, v[0], v[1], v[2], v[3])); + var A, p, v, a; + for (A in o) + s[A] && (p = o[A].type, v = o[A].value, a = s[A], p === "f" ? this._gl.uniform1f(a, v) : p === "i" ? this._gl.uniform1i(a, v) : p === "fv" ? this._gl.uniform3fv(a, v) : p === "c" ? this._gl.uniform3f(a, v.r, v.g, v.b) : p === "f4" && this._gl.uniform4f(a, v[0], v[1], v[2], v[3])); } // Objects adding addObject(s, o) { - var w, p, v, a; + var A, p, v, a; if (!s.__webglInit && (s.__webglInit = !0, s._modelViewMatrix = new E.Matrix4(), s._normalMatrix = new E.Matrix3(), s.geometry !== void 0 && s.geometry.__webglInit === void 0 && (s.geometry.__webglInit = !0, s.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), s instanceof c.Mesh || s instanceof c.Line)) - for (v = s.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) - a = v.geometryGroups[w], a.id = this._geometryGroupCounter++, a.__webglVertexBuffer || (s instanceof c.Mesh ? (this.createMeshBuffers(a), v.elementsNeedUpdate = !0, v.normalsNeedUpdate = !0) : s instanceof c.Line && this.createLineBuffers(a), v.verticesNeedUpdate = !0, v.colorsNeedUpdate = !0); + for (v = s.geometry, A = 0, p = v.geometryGroups.length; A < p; A++) + a = v.geometryGroups[A], a.id = this._geometryGroupCounter++, a.__webglVertexBuffer || (s instanceof c.Mesh ? (this.createMeshBuffers(a), v.elementsNeedUpdate = !0, v.normalsNeedUpdate = !0) : s instanceof c.Line && this.createLineBuffers(a), v.verticesNeedUpdate = !0, v.colorsNeedUpdate = !0); if (!s.__webglActive) { if (s instanceof c.Mesh || s instanceof c.Line) - for (v = s.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) - a = v.geometryGroups[w], this.addBuffer(o.__webglObjects, a, s); + for (v = s.geometry, A = 0, p = v.geometryGroups.length; A < p; A++) + a = v.geometryGroups[A], this.addBuffer(o.__webglObjects, a, s); else s instanceof c.Sprite && o.__webglSprites.push(s); s.__webglActive = !0; } } updateObject(s) { - var o = s.geometry, w; + var o = s.geometry, A; if (s instanceof c.Mesh || s instanceof c.Line) { for (var p = 0, v = o.geometryGroups.length; p < v; p++) - w = o.geometryGroups[p], (o.verticesNeedUpdate || o.elementsNeedUpdate || o.colorsNeedUpdate || o.normalsNeedUpdate) && this.setBuffers(w, this._gl.STATIC_DRAW); + A = o.geometryGroups[p], (o.verticesNeedUpdate || o.elementsNeedUpdate || o.colorsNeedUpdate || o.normalsNeedUpdate) && this.setBuffers(A, this._gl.STATIC_DRAW); o.verticesNeedUpdate = !1, o.elementsNeedUpdate = !1, o.normalsNeedUpdate = !1, o.colorsNeedUpdate = !1, o.buffersNeedUpdate = !1; } } @@ -11397,28 +11397,28 @@ ATOM`, g); s instanceof c.Mesh || s instanceof c.Line ? this.removeInstances(o.__webglObjects, s) : s instanceof c.Sprite && this.removeInstancesDirect(o.__webglSprites, s), s.__webglActive = !1; } removeInstances(s, o) { - for (var w = s.length - 1; w >= 0; --w) - s[w].object === o && s.splice(w, 1); + for (var A = s.length - 1; A >= 0; --A) + s[A].object === o && s.splice(A, 1); } removeInstancesDirect(s, o) { - for (var w = s.length - 1; w >= 0; --w) - s[w] === o && s.splice(w, 1); + for (var A = s.length - 1; A >= 0; --A) + s[A] === o && s.splice(A, 1); } unrollBufferMaterial(s) { - var o = s.object, w = o.material; - if (w.volumetric) - s.opaque = null, s.transparent = null, s.volumetric = w; - else if (w.transparent) { - if (s.opaque = null, s.volumetric = null, s.transparent = w, !w.wireframe) { - var p = w.clone(); + var o = s.object, A = o.material; + if (A.volumetric) + s.opaque = null, s.transparent = null, s.volumetric = A; + else if (A.transparent) { + if (s.opaque = null, s.volumetric = null, s.transparent = A, !A.wireframe) { + var p = A.clone(); p.opacity = 0, s.blank = p; } } else - s.opaque = w, s.transparent = null, s.volumetric = null; + s.opaque = A, s.transparent = null, s.volumetric = null; } setBuffers(s, o) { - var w = s.vertexArray, p = s.colorArray; - if (s.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, o), s.normalArray && s.__webglNormalBuffer !== void 0) { + var A = s.vertexArray, p = s.colorArray; + if (s.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, A, o)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, A, o)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, o), s.normalArray && s.__webglNormalBuffer !== void 0) { var v = s.normalArray; this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, v, o); } @@ -11440,10 +11440,10 @@ ATOM`, g); createLineBuffers(s) { s.__webglVertexBuffer = this._gl.createBuffer(), s.__webglColorBuffer = this._gl.createBuffer(), this.info.memory.geometries++; } - addBuffer(s, o, w) { + addBuffer(s, o, A) { s.push({ buffer: o, - object: w, + object: A, opaque: null, transparent: null }); @@ -11463,14 +11463,14 @@ ATOM`, g); return s === u.UnsignedByteType ? this._gl.UNSIGNED_BYTE : s === u.RGBAFormat ? this._gl.RGBA : s === u.NearestFilter ? this._gl.NEAREST : 0; } setupLights(s, o) { - var w, p, v, a = 0, l = 0, g = 0, M, L, T = this._lights, D = T.directional.colors, I = T.directional.positions, z = 0, P = 0; - for (w = 0, p = o.length; w < p; w++) - if (v = o[w], M = v.color, L = v.intensity, v instanceof y.Light) { + var A, p, v, a = 0, l = 0, g = 0, M, C, T = this._lights, D = T.directional.colors, I = T.directional.positions, B = 0, P = 0; + for (A = 0, p = o.length; A < p; A++) + if (v = o[A], M = v.color, C = v.intensity, v instanceof b.Light) { if (this._direction.getPositionFromMatrix(v.matrixWorld), this._vector3.getPositionFromMatrix(v.target.matrixWorld), this._direction.sub(this._vector3), this._direction.normalize(), this._direction.x === 0 && this._direction.y === 0 && this._direction.z === 0) continue; - I[P] = this._direction.x, I[P + 1] = this._direction.y, I[P + 2] = this._direction.z, D[P] = M.r * L, D[P + 1] = M.g * L, D[P + 2] = M.b * L, P += 3, z++; + I[P] = this._direction.x, I[P + 1] = this._direction.y, I[P + 2] = this._direction.z, D[P] = M.r * C, D[P + 1] = M.g * C, D[P + 2] = M.b * C, P += 3, B++; } - T.ambient[0] = a, T.ambient[1] = l, T.ambient[2] = g, T.directional.length = z; + T.ambient[0] = a, T.ambient[1] = l, T.ambient[2] = g, T.directional.length = B; } initGL() { try { @@ -11507,20 +11507,20 @@ ATOM`, g); this._gl.clearColor(0, 0, 0, 1), this._gl.clearDepth(1), this._gl.clearStencil(0), this._gl.enable(this._gl.DEPTH_TEST), this._gl.depthFunc(this._gl.LEQUAL), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.enable(this._gl.CULL_FACE), this._gl.enable(this._gl.BLEND), this._gl.blendEquation(this._gl.FUNC_ADD), this._gl.blendFunc(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } // rendering - renderObjects(s, o, w, p, v, a, l, D) { - var M, L, T, D, I, z, P; - o ? (I = s.length - 1, z = -1, P = -1) : (I = 0, z = s.length, P = 1); - for (var B = I; B !== z; B += P) - if (M = s[B], M.render) { - if (L = M.object, T = M.buffer, D = M[w], !D) + renderObjects(s, o, A, p, v, a, l, D) { + var M, C, T, D, I, B, P; + o ? (I = s.length - 1, B = -1, P = -1) : (I = 0, B = s.length, P = 1); + for (var z = I; z !== B; z += P) + if (M = s[z], M.render) { + if (C = M.object, T = M.buffer, D = M[A], !D) continue; l && this.setBlending(!0), this.setDepthTest(D.depthTest), this.setDepthWrite(D.depthWrite), this.setPolygonOffset(D.polygonOffset, D.polygonOffsetFactor, D.polygonOffsetUnits); - var k = L._modelViewMatrix.isReflected(); - this.setMaterialFaces(D, k), this.renderBuffer(p, v, a, D, T, L), (this._outlineEnabled || D.outline) && (D.shaderID == "sphereimposter" ? this.renderBuffer(p, v, a, this._outlineSphereImposterMaterial, T, L) : D.shaderID == "stickimposter" ? this.renderBuffer(p, v, a, this._outlineStickImposterMaterial, T, L) : !D.wireframe && D.shaderID !== "basic" && D.opacity !== 0 && this.renderBuffer(p, v, a, this._outlineMaterial, T, L)); + var k = C._modelViewMatrix.isReflected(); + this.setMaterialFaces(D, k), this.renderBuffer(p, v, a, D, T, C), (this._outlineEnabled || D.outline) && (D.shaderID == "sphereimposter" ? this.renderBuffer(p, v, a, this._outlineSphereImposterMaterial, T, C) : D.shaderID == "stickimposter" ? this.renderBuffer(p, v, a, this._outlineStickImposterMaterial, T, C) : !D.wireframe && D.shaderID !== "basic" && D.opacity !== 0 && this.renderBuffer(p, v, a, this._outlineMaterial, T, C)); } } - renderSprites(s, o, w) { - this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(s, o, this._currentWidth, this._currentHeight, w), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; + renderSprites(s, o, A) { + this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(s, o, this._currentWidth, this._currentHeight, A), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; } } } @@ -11531,8 +11531,8 @@ ATOM`, g); !*** ./src/WebGL/SpritePlugin.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SpritePlugin: () => ( /* binding */ @@ -11540,7 +11540,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./shaders/index */ "./src/WebGL/shaders/index.ts" ); @@ -11567,35 +11567,35 @@ ATOM`, g); const E = {}; this.sprite.attributes.position = this.gl.getAttribLocation(this.sprite.program, "position"), this.sprite.attributes.uv = this.gl.getAttribLocation(this.sprite.program, "uv"), E.uvOffset = this.gl.getUniformLocation(this.sprite.program, "uvOffset"), E.uvScale = this.gl.getUniformLocation(this.sprite.program, "uvScale"), E.rotation = this.gl.getUniformLocation(this.sprite.program, "rotation"), E.scale = this.gl.getUniformLocation(this.sprite.program, "scale"), E.alignment = this.gl.getUniformLocation(this.sprite.program, "alignment"), E.color = this.gl.getUniformLocation(this.sprite.program, "color"), E.map = this.gl.getUniformLocation(this.sprite.program, "map"), E.opacity = this.gl.getUniformLocation(this.sprite.program, "opacity"), E.useScreenCoordinates = this.gl.getUniformLocation(this.sprite.program, "useScreenCoordinates"), E.screenPosition = this.gl.getUniformLocation(this.sprite.program, "screenPosition"), E.modelViewMatrix = this.gl.getUniformLocation(this.sprite.program, "modelViewMatrix"), E.projectionMatrix = this.gl.getUniformLocation(this.sprite.program, "projectionMatrix"), E.fogType = this.gl.getUniformLocation(this.sprite.program, "fogType"), E.fogDensity = this.gl.getUniformLocation(this.sprite.program, "fogDensity"), E.fogNear = this.gl.getUniformLocation(this.sprite.program, "fogNear"), E.fogFar = this.gl.getUniformLocation(this.sprite.program, "fogFar"), E.fogColor = this.gl.getUniformLocation(this.sprite.program, "fogColor"), E.alphaTest = this.gl.getUniformLocation(this.sprite.program, "alphaTest"), this.sprite.uniforms = E; } - render(h, _, E, c, C) { - var b, A, S, s, o, w, p, v, a, l; + render(h, _, E, c, S) { + var y, w, L, s, o, A, p, v, a, l; if (!this.gl) throw new Error("WebGLRenderer not initialized"); let g = []; - (b = h == null ? void 0 : h.__webglSprites) === null || b === void 0 || b.forEach((Q) => { - (C && Q.material.depthTest == !1 || !C && Q.material.depthTest) && g.push(Q); + (y = h == null ? void 0 : h.__webglSprites) === null || y === void 0 || y.forEach((J) => { + (S && J.material.depthTest == !1 || !S && J.material.depthTest) && g.push(J); }); let M = g.length; if (!M) return; - const L = this.sprite.attributes, T = this.sprite.uniforms; + const C = this.sprite.attributes, T = this.sprite.uniforms; if (!T) throw new Error("Uniforms not defined"); var D = E * 0.5, I = c * 0.5; - this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(L.position), this.gl.enableVertexAttribArray(L.uv), this.gl.disable(this.gl.CULL_FACE), this.gl.enable(this.gl.BLEND), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.vertexAttribPointer(L.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(L.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(T.projectionMatrix, !1, _.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(T.map, 0); - var z = 0, P = 0, B = h.fog; - B ? (this.gl.uniform3f(T.fogColor, B.color.r, B.color.g, B.color.b), this.gl.uniform1f(T.fogNear, B.near), this.gl.uniform1f(T.fogFar, B.far), this.gl.uniform1i(T.fogType, 1), z = 1, P = 1) : (this.gl.uniform1i(T.fogType, 0), z = 0, P = 0); + this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(C.position), this.gl.enableVertexAttribArray(C.uv), this.gl.disable(this.gl.CULL_FACE), this.gl.enable(this.gl.BLEND), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.vertexAttribPointer(C.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(C.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(T.projectionMatrix, !1, _.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(T.map, 0); + var B = 0, P = 0, z = h.fog; + z ? (this.gl.uniform3f(T.fogColor, z.color.r, z.color.g, z.color.b), this.gl.uniform1f(T.fogNear, z.near), this.gl.uniform1f(T.fogFar, z.far), this.gl.uniform1i(T.fogType, 1), B = 1, P = 1) : (this.gl.uniform1i(T.fogType, 0), B = 0, P = 0); var k; - let N, $, F, G, H = []; + let N, R, U, W, G = []; for (k = 0; k < M; k++) - N = g[k], $ = N.material, $ && ($.depthTest == !1 && !C || !N.visible || $.opacity === 0 || ($.useScreenCoordinates ? N.z = -N.position.z : (N._modelViewMatrix.multiplyMatrices(_.matrixWorldInverse, N.matrixWorld), N.z = -N._modelViewMatrix.elements[14]))); + N = g[k], R = N.material, R && (R.depthTest == !1 && !S || !N.visible || R.opacity === 0 || (R.useScreenCoordinates ? N.z = -N.position.z : (N._modelViewMatrix.multiplyMatrices(_.matrixWorldInverse, N.matrixWorld), N.z = -N._modelViewMatrix.elements[14]))); for (g.sort(u), k = 0; k < M; k++) - if (N = g[k], $ = N.material, !!$ && !(!N.visible || $.opacity === 0) && $.map && $.map.image && $.map.image.width) { - this.gl.uniform1f((T == null ? void 0 : T.alphaTest) || null, $.alphaTest); - var U = $.map.image.width, V = $.map.image.height; - H[0] = U * this.renderer.devicePixelRatio / E, H[1] = V * this.renderer.devicePixelRatio / c, $.useScreenCoordinates === !0 ? (this.gl.uniform1i(T.useScreenCoordinates, 1), this.gl.uniform3f(T.screenPosition, (N.position.x * this.renderer.devicePixelRatio - D) / D, (I - N.position.y * this.renderer.devicePixelRatio) / I, Math.max(0, Math.min(1, N.position.z)))) : (this.gl.uniform1i(T.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(T.modelViewMatrix, !1, N._modelViewMatrix.elements)), h.fog && $.fog ? G = P : G = 0, z !== G && (this.gl.uniform1i(T.fogType, G), z = G), F = 1 / ($.scaleByViewport ? c : 1), H[0] *= F * N.scale.x, H[1] *= F * N.scale.y; - let Q = (A = $ == null ? void 0 : $.alignment) === null || A === void 0 ? void 0 : A.x, ae = (S = $ == null ? void 0 : $.alignment) === null || S === void 0 ? void 0 : S.y; - $.screenOffset && (Q = (Q || 0) + 2 * $.screenOffset.x / U, ae = (ae || 0) + 2 * $.screenOffset.y / V), this.gl.uniform2f(T.uvScale, ((s = $ == null ? void 0 : $.uvScale) === null || s === void 0 ? void 0 : s.x) || 1, ((o = $ == null ? void 0 : $.uvScale) === null || o === void 0 ? void 0 : o.y) || 1), this.gl.uniform2f(T.uvOffset, ((w = $ == null ? void 0 : $.uvOffset) === null || w === void 0 ? void 0 : w.x) || 0, ((p = $ == null ? void 0 : $.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(T.alignment, Q || 0, ae || 0), this.gl.uniform1f(T.opacity, $.opacity), this.gl.uniform3f(T.color, ((v = $ == null ? void 0 : $.color) === null || v === void 0 ? void 0 : v.r) || 0, ((a = $ == null ? void 0 : $.color) === null || a === void 0 ? void 0 : a.g) || 0, ((l = $ == null ? void 0 : $.color) === null || l === void 0 ? void 0 : l.b) || 0), this.gl.uniform1f(T.rotation, N.rotation), this.gl.uniform2fv(T.scale, H), this.renderer.setDepthTest($.depthTest), this.renderer.setDepthWrite($.depthWrite), this.renderer.setTexture($.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); + if (N = g[k], R = N.material, !!R && !(!N.visible || R.opacity === 0) && R.map && R.map.image && R.map.image.width) { + this.gl.uniform1f((T == null ? void 0 : T.alphaTest) || null, R.alphaTest); + var F = R.map.image.width, V = R.map.image.height; + G[0] = F * this.renderer.devicePixelRatio / E, G[1] = V * this.renderer.devicePixelRatio / c, R.useScreenCoordinates === !0 ? (this.gl.uniform1i(T.useScreenCoordinates, 1), this.gl.uniform3f(T.screenPosition, (N.position.x * this.renderer.devicePixelRatio - D) / D, (I - N.position.y * this.renderer.devicePixelRatio) / I, Math.max(0, Math.min(1, N.position.z)))) : (this.gl.uniform1i(T.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(T.modelViewMatrix, !1, N._modelViewMatrix.elements)), h.fog && R.fog ? W = P : W = 0, B !== W && (this.gl.uniform1i(T.fogType, W), B = W), U = 1 / (R.scaleByViewport ? c : 1), G[0] *= U * N.scale.x, G[1] *= U * N.scale.y; + let J = (w = R == null ? void 0 : R.alignment) === null || w === void 0 ? void 0 : w.x, X = (L = R == null ? void 0 : R.alignment) === null || L === void 0 ? void 0 : L.y; + R.screenOffset && (J = (J || 0) + 2 * R.screenOffset.x / F, X = (X || 0) + 2 * R.screenOffset.y / V), this.gl.uniform2f(T.uvScale, ((s = R == null ? void 0 : R.uvScale) === null || s === void 0 ? void 0 : s.x) || 1, ((o = R == null ? void 0 : R.uvScale) === null || o === void 0 ? void 0 : o.y) || 1), this.gl.uniform2f(T.uvOffset, ((A = R == null ? void 0 : R.uvOffset) === null || A === void 0 ? void 0 : A.x) || 0, ((p = R == null ? void 0 : R.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(T.alignment, J || 0, X || 0), this.gl.uniform1f(T.opacity, R.opacity), this.gl.uniform3f(T.color, ((v = R == null ? void 0 : R.color) === null || v === void 0 ? void 0 : v.r) || 0, ((a = R == null ? void 0 : R.color) === null || a === void 0 ? void 0 : a.g) || 0, ((l = R == null ? void 0 : R.color) === null || l === void 0 ? void 0 : l.b) || 0), this.gl.uniform1f(T.rotation, N.rotation), this.gl.uniform2fv(T.scale, G), this.renderer.setDepthTest(R.depthTest), this.renderer.setDepthWrite(R.depthWrite), this.renderer.setTexture(R.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); } this.gl.enable(this.gl.CULL_FACE); } @@ -11605,22 +11605,22 @@ ATOM`, g); var E = this.gl.createProgram(); if (!E) throw new Error("Error creating webgl program"); - var c = this.gl.createShader(this.gl.FRAGMENT_SHADER), C = this.gl.createShader(this.gl.VERTEX_SHADER); + var c = this.gl.createShader(this.gl.FRAGMENT_SHADER), S = this.gl.createShader(this.gl.VERTEX_SHADER); if (!c) throw new Error("Unable to create fragment shader SpritePlugin.createProgram"); - if (!C) + if (!S) throw new Error("Unable to create vertex shader SpritePlugin.createProgram"); - var b = "precision " + _ + ` float; + var y = "precision " + _ + ` float; `; - if (this.gl.shaderSource(c, b + h.fragmentShader), this.gl.shaderSource(C, b + h.vertexShader), this.gl.compileShader(c), this.gl.compileShader(C), !this.gl.getShaderParameter(c, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(C, this.gl.COMPILE_STATUS)) + if (this.gl.shaderSource(c, y + h.fragmentShader), this.gl.shaderSource(S, y + h.vertexShader), this.gl.compileShader(c), this.gl.compileShader(S), !this.gl.getShaderParameter(c, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(S, this.gl.COMPILE_STATUS)) throw new Error(`Error compiling shader: ${this.gl.getShaderInfoLog(c)} - ${this.gl.getShaderInfoLog(C)}`); - return this.gl.attachShader(E, c), this.gl.attachShader(E, C), this.gl.linkProgram(E), this.gl.getProgramParameter(E, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), E; + ${this.gl.getShaderInfoLog(S)}`); + return this.gl.attachShader(E, c), this.gl.attachShader(E, S), this.gl.linkProgram(E), this.gl.getProgramParameter(E, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), E; } } - function u(y, h) { - return y.z !== h.z ? h.z - y.z : h.id - y.id; + function u(b, h) { + return b.z !== h.z ? h.z - b.z : h.id - b.id; } } ), @@ -11630,8 +11630,8 @@ ATOM`, g); !*** ./src/WebGL/constants/Coloring.ts ***! \*****************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Coloring: () => ( /* binding */ @@ -11651,8 +11651,8 @@ ATOM`, g); !*** ./src/WebGL/constants/Shading.ts ***! \****************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Shading: () => ( /* binding */ @@ -11672,8 +11672,8 @@ ATOM`, g); !*** ./src/WebGL/constants/Sides.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ BackSide: () => ( /* binding */ @@ -11700,8 +11700,8 @@ ATOM`, g); !*** ./src/WebGL/constants/SpriteAlignment.ts ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SpriteAlignment: () => ( /* binding */ @@ -11709,7 +11709,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" ); @@ -11732,8 +11732,8 @@ ATOM`, g); !*** ./src/WebGL/constants/TextureConstants.ts ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ClampToEdgeWrapping: () => ( /* binding */ @@ -11752,7 +11752,7 @@ ATOM`, g); /* harmony export */ LinearMipMapLinearFilter: () => ( /* binding */ - y + b ), /* harmony export */ NearestFilter: () => ( @@ -11762,7 +11762,7 @@ ATOM`, g); /* harmony export */ R32Format: () => ( /* binding */ - C + S ), /* harmony export */ RFormat: () => ( @@ -11781,7 +11781,7 @@ ATOM`, g); ) /* harmony export */ }); - const n = 1001, f = 1006, u = 1007, y = 1008, h = 1009, _ = 1010, E = 1021, c = 1022, C = 1023; + const n = 1001, f = 1006, u = 1007, b = 1008, h = 1009, _ = 1010, E = 1021, c = 1022, S = 1023; } ), /***/ @@ -11790,8 +11790,8 @@ ATOM`, g); !*** ./src/WebGL/constants/TextureOperations.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ TextureOperations: () => ( /* binding */ @@ -11811,8 +11811,8 @@ ATOM`, g); !*** ./src/WebGL/constants/index.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ BackSide: () => ( /* reexport safe */ @@ -11881,7 +11881,7 @@ ATOM`, g); /* harmony export */ SpriteAlignment: () => ( /* reexport safe */ - y.SpriteAlignment + b.SpriteAlignment ), /* harmony export */ TextureOperations: () => ( @@ -11895,22 +11895,22 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Coloring */ "./src/WebGL/constants/Coloring.ts" - ), f = t( + ), f = r( /*! ./Sides */ "./src/WebGL/constants/Sides.ts" - ), u = t( + ), u = r( /*! ./Shading */ "./src/WebGL/constants/Shading.ts" - ), y = t( + ), b = r( /*! ./SpriteAlignment */ "./src/WebGL/constants/SpriteAlignment.ts" - ), h = t( + ), h = r( /*! ./TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), _ = t( + ), _ = r( /*! ./TextureOperations */ "./src/WebGL/constants/TextureOperations.ts" ); @@ -11922,8 +11922,8 @@ ATOM`, g); !*** ./src/WebGL/core/EventDispatcher.ts ***! \*******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ EventDispatcher: () => ( /* binding */ @@ -11936,23 +11936,23 @@ ATOM`, g); this.listeners = {}; } dispatchEvent(u) { - var y = this.listeners[u.type]; - if (y !== void 0) { + var b = this.listeners[u.type]; + if (b !== void 0) { u.target = this; - for (var h = 0, _ = y.length; h < _; h++) - y[h].call(this, u); + for (var h = 0, _ = b.length; h < _; h++) + b[h].call(this, u); } } - removeEventListener(u, y) { - if (!y) + removeEventListener(u, b) { + if (!b) this.listeners[u] = []; else { - var h = this.listeners[u].indexOf(y); + var h = this.listeners[u].indexOf(b); h !== -1 && this.listeners[u].splice(h, 1); } } - addEventListener(u, y) { - this.listeners[u] === void 0 && (this.listeners[u] = []), this.listeners[u].indexOf(y) === -1 && this.listeners[u].push(y); + addEventListener(u, b) { + this.listeners[u] === void 0 && (this.listeners[u] = []), this.listeners[u].indexOf(b) === -1 && this.listeners[u].push(b); } } } @@ -11963,8 +11963,8 @@ ATOM`, g); !*** ./src/WebGL/core/Geometry.ts ***! \************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Geometry: () => ( /* binding */ @@ -11982,37 +11982,37 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../materials/LineBasicMaterial */ "./src/WebGL/materials/LineBasicMaterial.ts" - ), f = t( + ), f = r( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), u = t( + ), u = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), y = t( + ), b = r( /*! ../../colors */ "./src/colors.ts" ); const h = 65535; class _ { - constructor(b = 0) { - this.vertexArray = null, this.colorArray = null, this.normalArray = null, this.radiusArray = null, this.faceArray = null, this.lineArray = null, this.vertices = 0, this.faceidx = 0, this.lineidx = 0, this.__inittedArrays = !1, this.id = b; + constructor(y = 0) { + this.vertexArray = null, this.colorArray = null, this.normalArray = null, this.radiusArray = null, this.faceArray = null, this.lineArray = null, this.vertices = 0, this.faceidx = 0, this.lineidx = 0, this.__inittedArrays = !1, this.id = y; } - setColors(b) { - var A = this.vertexArray, S = this.colorArray; - if (!A) + setColors(y) { + var w = this.vertexArray, L = this.colorArray; + if (!w) throw new Error("vertex array not initialized"); - if (!S) + if (!L) throw new Error("color array not initialized"); - if (A.length != S.length) { + if (w.length != L.length) { console.log("Cannot re-color geometry group due to mismatched lengths."); return; } - for (var s = 0; s < A.length; s += 3) { - var o = b(A[s], A[s + 1], A[s + 2]); - o instanceof y.Color || (o = y.CC.color(o)), S[s] = o.r, S[s + 1] = o.g, S[s + 2] = o.b; + for (var s = 0; s < w.length; s += 3) { + var o = y(w[s], w[s + 1], w[s + 2]); + o instanceof b.Color || (o = b.CC.color(o)), L[s] = o.r, L[s + 1] = o.g, L[s + 2] = o.b; } } getNumVertices() { @@ -12024,22 +12024,22 @@ ATOM`, g); getCentroid() { if (!this.vertexArray) throw new Error("vertex array not initialized"); - for (var b = new u.Vector3(), A, S, s, o, w = 0; w < this.vertices; ++w) - A = w * 3, S = this.vertexArray[A], s = this.vertexArray[A + 1], o = this.vertexArray[A + 2], b.x += S, b.y += s, b.z += o; - return b.divideScalar(this.vertices), b; + for (var y = new u.Vector3(), w, L, s, o, A = 0; A < this.vertices; ++A) + w = A * 3, L = this.vertexArray[w], s = this.vertexArray[w + 1], o = this.vertexArray[w + 2], y.x += L, y.y += s, y.z += o; + return y.divideScalar(this.vertices), y; } //setup normals - vertex and face array must exist setNormals() { - var b = this.faceArray, A = this.vertexArray, S = this.normalArray; + var y = this.faceArray, w = this.vertexArray, L = this.normalArray; if (!(!this.vertices || !this.faceidx)) { - if (!b) + if (!y) throw new Error("face array not initialized"); - if (!A) + if (!w) throw new Error("vertex array not initialized"); - if (!S) + if (!L) throw new Error("normal array not initialized"); - for (var s, o, w, p, v, a, l, g = 0; g < b.length / 3; ++g) - s = b[g * 3] * 3, o = b[g * 3 + 1] * 3, w = b[g * 3 + 2] * 3, p = new u.Vector3(A[s], A[s + 1], A[s + 2]), v = new u.Vector3(A[o], A[o + 1], A[o + 2]), a = new u.Vector3(A[w], A[w + 1], A[w + 2]), p.subVectors(p, v), a.subVectors(a, v), a.cross(p), l = a, l.normalize(), S[s] += l.x, S[o] += l.x, S[w] += l.x, S[s + 1] += l.y, S[o + 1] += l.y, S[w + 1] += l.y, S[s + 2] += l.z, S[o + 2] += l.z, S[w + 2] += l.z; + for (var s, o, A, p, v, a, l, g = 0; g < y.length / 3; ++g) + s = y[g * 3] * 3, o = y[g * 3 + 1] * 3, A = y[g * 3 + 2] * 3, p = new u.Vector3(w[s], w[s + 1], w[s + 2]), v = new u.Vector3(w[o], w[o + 1], w[o + 2]), a = new u.Vector3(w[A], w[A + 1], w[A + 2]), p.subVectors(p, v), a.subVectors(a, v), a.cross(p), l = a, l.normalize(), L[s] += l.x, L[o] += l.x, L[A] += l.x, L[s + 1] += l.y, L[o + 1] += l.y, L[A + 1] += l.y, L[s + 2] += l.z, L[o + 2] += l.z, L[A + 2] += l.z; } } /* sets line index array from face arr @@ -12049,172 +12049,172 @@ ATOM`, g); as rectangles rather than two triangles) */ setLineIndices() { if (this.faceidx && !(this.lineArray && this.lineArray.length == this.faceidx * 2 && this.lineidx == this.faceidx * 2)) { - var b = this.faceArray, A = this.lineArray = new Uint16Array(this.faceidx * 2); - if (this.lineidx = this.faceidx * 2, !b) + var y = this.faceArray, w = this.lineArray = new Uint16Array(this.faceidx * 2); + if (this.lineidx = this.faceidx * 2, !y) throw new Error("face array not initialized"); - for (var S = 0; S < this.faceidx / 3; ++S) { - var s = S * 3, o = s * 2, w = b[s], p = b[s + 1], v = b[s + 2]; - A[o] = w, A[o + 1] = p, A[o + 2] = w, A[o + 3] = v, A[o + 4] = p, A[o + 5] = v; + for (var L = 0; L < this.faceidx / 3; ++L) { + var s = L * 3, o = s * 2, A = y[s], p = y[s + 1], v = y[s + 2]; + w[o] = A, w[o + 1] = p, w[o + 2] = A, w[o + 3] = v, w[o + 4] = p, w[o + 5] = v; } } } - vrml(b, A) { - var S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P = ""; - P += b + `Shape { -` + b + ` appearance Appearance { -` + b + ` material Material { -` + b + " diffuseColor " + ((S = A == null ? void 0 : A.color) === null || S === void 0 ? void 0 : S.r) + " " + ((s = A == null ? void 0 : A.color) === null || s === void 0 ? void 0 : s.g) + " " + ((o = A == null ? void 0 : A.color) === null || o === void 0 ? void 0 : o.b) + ` -`, A != null && A.transparent && (P += b + " transparency " + (1 - A.opacity) + ` -`), P += b + ` } -`, P += b + ` } + vrml(y, w) { + var L, s, o, A, p, v, a, l, g, M, C, T, D, I, B, P = ""; + P += y + `Shape { +` + y + ` appearance Appearance { +` + y + ` material Material { +` + y + " diffuseColor " + ((L = w == null ? void 0 : w.color) === null || L === void 0 ? void 0 : L.r) + " " + ((s = w == null ? void 0 : w.color) === null || s === void 0 ? void 0 : s.g) + " " + ((o = w == null ? void 0 : w.color) === null || o === void 0 ? void 0 : o.b) + ` +`, w != null && w.transparent && (P += y + " transparency " + (1 - w.opacity) + ` +`), P += y + ` } +`, P += y + ` } `; - var B = b; - if (b += " ", A instanceof n.LineBasicMaterial) { - P += b + `geometry IndexedLineSet { -` + b + ` colorPerVertex TRUE -` + b + ` coord Coordinate { -` + b + ` point [ + var z = y; + if (y += " ", w instanceof n.LineBasicMaterial) { + P += y + `geometry IndexedLineSet { +` + y + ` colorPerVertex TRUE +` + y + ` coord Coordinate { +` + y + ` point [ `; - let N, $, F; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - N = (w = this.vertexArray) === null || w === void 0 ? void 0 : w[H], $ = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[H + 1], F = (v = this.vertexArray) === null || v === void 0 ? void 0 : v[H + 2], P += b + " " + N + " " + $ + " " + F + `, + let N, R, U; + for (let W = 0; W < this.vertices; ++W) { + let G = W * 3; + N = (A = this.vertexArray) === null || A === void 0 ? void 0 : A[G], R = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[G + 1], U = (v = this.vertexArray) === null || v === void 0 ? void 0 : v[G + 2], P += y + " " + N + " " + R + " " + U + `, `; } - if (P += b + ` ] -`, P += b + ` } + if (P += y + ` ] +`, P += y + ` } `, this.colorArray) { - P += b + ` color Color { -` + b + ` color [ + P += y + ` color Color { +` + y + ` color [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - N = this.colorArray[H], $ = this.colorArray[H + 1], F = this.colorArray[H + 2], P += b + " " + N + " " + $ + " " + F + `, + for (let W = 0; W < this.vertices; ++W) { + let G = W * 3; + N = this.colorArray[G], R = this.colorArray[G + 1], U = this.colorArray[G + 2], P += y + " " + N + " " + R + " " + U + `, `; } - P += b + ` ] -`, P += b + ` } + P += y + ` ] +`, P += y + ` } `; } - P += b + ` coordIndex [ + P += y + ` coordIndex [ `; - for (let G = 0; G < this.vertices; G += 2) - P += b + " " + G + ", " + (G + 1) + `, -1, + for (let W = 0; W < this.vertices; W += 2) + P += y + " " + W + ", " + (W + 1) + `, -1, `; - P += b + ` ] -`, P += b + `} + P += y + ` ] +`, P += y + `} `; } else { - P += b + `geometry IndexedFaceSet { -` + b + ` colorPerVertex TRUE -` + b + ` normalPerVertex TRUE -` + b + ` solid FALSE -`, P += b + ` coord Coordinate { -` + b + ` point [ + P += y + `geometry IndexedFaceSet { +` + y + ` colorPerVertex TRUE +` + y + ` normalPerVertex TRUE +` + y + ` solid FALSE +`, P += y + ` coord Coordinate { +` + y + ` point [ `; - let N, $, F; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - N = (a = this.vertexArray) === null || a === void 0 ? void 0 : a[H], $ = (l = this.vertexArray) === null || l === void 0 ? void 0 : l[H + 1], F = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[H + 2], P += b + " " + N + " " + $ + " " + F + `, + let N, R, U; + for (let W = 0; W < this.vertices; ++W) { + let G = W * 3; + N = (a = this.vertexArray) === null || a === void 0 ? void 0 : a[G], R = (l = this.vertexArray) === null || l === void 0 ? void 0 : l[G + 1], U = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[G + 2], P += y + " " + N + " " + R + " " + U + `, `; } - P += b + ` ] -`, P += b + ` } -`, P += b + ` normal Normal { -` + b + ` vector [ + P += y + ` ] +`, P += y + ` } +`, P += y + ` normal Normal { +` + y + ` vector [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - N = (M = this.normalArray) === null || M === void 0 ? void 0 : M[H], $ = (L = this.normalArray) === null || L === void 0 ? void 0 : L[H + 1], F = (T = this.normalArray) === null || T === void 0 ? void 0 : T[H + 2], P += b + " " + N + " " + $ + " " + F + `, + for (let W = 0; W < this.vertices; ++W) { + let G = W * 3; + N = (M = this.normalArray) === null || M === void 0 ? void 0 : M[G], R = (C = this.normalArray) === null || C === void 0 ? void 0 : C[G + 1], U = (T = this.normalArray) === null || T === void 0 ? void 0 : T[G + 2], P += y + " " + N + " " + R + " " + U + `, `; } - if (P += b + ` ] -`, P += b + ` } + if (P += y + ` ] +`, P += y + ` } `, this.colorArray) { - P += b + ` color Color { -` + b + ` color [ + P += y + ` color Color { +` + y + ` color [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - N = this.colorArray[H], $ = this.colorArray[H + 1], F = this.colorArray[H + 2], P += b + " " + N + " " + $ + " " + F + `, + for (let W = 0; W < this.vertices; ++W) { + let G = W * 3; + N = this.colorArray[G], R = this.colorArray[G + 1], U = this.colorArray[G + 2], P += y + " " + N + " " + R + " " + U + `, `; } - P += b + ` ] -`, P += b + ` } + P += y + ` ] +`, P += y + ` } `; } - P += b + ` coordIndex [ + P += y + ` coordIndex [ `; for (var k = 0; k < this.faceidx; k += 3) - N = (D = this.faceArray) === null || D === void 0 ? void 0 : D[k], $ = (I = this.faceArray) === null || I === void 0 ? void 0 : I[k + 1], F = (z = this.faceArray) === null || z === void 0 ? void 0 : z[k + 2], P += b + " " + N + ", " + $ + ", " + F + `, -1, + N = (D = this.faceArray) === null || D === void 0 ? void 0 : D[k], R = (I = this.faceArray) === null || I === void 0 ? void 0 : I[k + 1], U = (B = this.faceArray) === null || B === void 0 ? void 0 : B[k + 2], P += y + " " + N + ", " + R + ", " + U + `, -1, `; - P += b + ` ] -`, P += b + `} + P += y + ` ] +`, P += y + `} `; } - return P += B + "}", P; + return P += z + "}", P; } - truncateArrayBuffers(b = !0, A = !1) { - var S = this.vertexArray, s = this.colorArray, o = this.normalArray, w = this.faceArray, p = this.lineArray, v = this.radiusArray; - this.vertexArray = (S == null ? void 0 : S.subarray(0, this.vertices * 3)) || null, this.colorArray = (s == null ? void 0 : s.subarray(0, this.vertices * 3)) || null, b ? (this.normalArray = (o == null ? void 0 : o.subarray(0, this.vertices * 3)) || null, this.faceArray = (w == null ? void 0 : w.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), v && (this.radiusArray = v.subarray(0, this.vertices)), A && (this.normalArray && (this.normalArray = new Float32Array(this.normalArray)), this.faceArray && (this.faceArray = new Uint16Array(this.faceArray)), this.lineArray && (this.lineArray = new Uint16Array(this.lineArray)), this.vertexArray && (this.vertexArray = new Float32Array(this.vertexArray)), this.colorArray && (this.colorArray = new Float32Array(this.colorArray)), this.radiusArray && (this.radiusArray = new Float32Array(this.radiusArray))), this.__inittedArrays = !0; + truncateArrayBuffers(y = !0, w = !1) { + var L = this.vertexArray, s = this.colorArray, o = this.normalArray, A = this.faceArray, p = this.lineArray, v = this.radiusArray; + this.vertexArray = (L == null ? void 0 : L.subarray(0, this.vertices * 3)) || null, this.colorArray = (s == null ? void 0 : s.subarray(0, this.vertices * 3)) || null, y ? (this.normalArray = (o == null ? void 0 : o.subarray(0, this.vertices * 3)) || null, this.faceArray = (A == null ? void 0 : A.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), v && (this.radiusArray = v.subarray(0, this.vertices)), w && (this.normalArray && (this.normalArray = new Float32Array(this.normalArray)), this.faceArray && (this.faceArray = new Uint16Array(this.faceArray)), this.lineArray && (this.lineArray = new Uint16Array(this.lineArray)), this.vertexArray && (this.vertexArray = new Float32Array(this.vertexArray)), this.colorArray && (this.colorArray = new Float32Array(this.colorArray)), this.radiusArray && (this.radiusArray = new Float32Array(this.radiusArray))), this.__inittedArrays = !0; } } class E extends f.EventDispatcher { - constructor(b = !1, A = !1, S = !1) { - super(), this.name = "", this.hasTangents = !1, this.dynamic = !0, this.verticesNeedUpdate = !1, this.elementsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.buffersNeedUpdate = !1, this.imposter = !1, this.instanced = !1, this.geometryGroups = [], this.groups = 0, this.id = c++, this.mesh = b, this.radii = A, this.offset = S; + constructor(y = !1, w = !1, L = !1) { + super(), this.name = "", this.hasTangents = !1, this.dynamic = !0, this.verticesNeedUpdate = !1, this.elementsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.buffersNeedUpdate = !1, this.imposter = !1, this.instanced = !1, this.geometryGroups = [], this.groups = 0, this.id = c++, this.mesh = y, this.radii = w, this.offset = L; } //Get geometry group to accomodate addVertices new vertices - create // new group if necessary - updateGeoGroup(b = 0) { - var A, S = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null; - return (!S || S.vertices + b > (((A = S == null ? void 0 : S.vertexArray) === null || A === void 0 ? void 0 : A.length) || 0) / 3) && (S = this.addGeoGroup()), S; + updateGeoGroup(y = 0) { + var w, L = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null; + return (!L || L.vertices + y > (((w = L == null ? void 0 : L.vertexArray) === null || w === void 0 ? void 0 : w.length) || 0) / 3) && (L = this.addGeoGroup()), L; } //return comma separated list of IndexedFace (or Line) sets from geometry groups - vrml(b, A) { - for (var S = "", s = this.geometryGroups.length, o = 0; o < s; o++) { - var w = this.geometryGroups[o]; - S += w.vrml(b, A) + `, + vrml(y, w) { + for (var L = "", s = this.geometryGroups.length, o = 0; o < s; o++) { + var A = this.geometryGroups[o]; + L += A.vrml(y, w) + `, `; } - return S; + return L; } addGeoGroup() { - var b = new _(this.geometryGroups.length); - return this.geometryGroups.push(b), this.groups = this.geometryGroups.length, b.vertexArray = new Float32Array(h * 3), b.colorArray = new Float32Array(h * 3), this.mesh && (b.normalArray = new Float32Array(h * 3), b.faceArray = new Uint16Array(h * 6), b.lineArray = new Uint16Array(h * 6)), this.radii && (b.radiusArray = new Float32Array(h)), b.useOffset = this.offset, b; + var y = new _(this.geometryGroups.length); + return this.geometryGroups.push(y), this.groups = this.geometryGroups.length, y.vertexArray = new Float32Array(h * 3), y.colorArray = new Float32Array(h * 3), this.mesh && (y.normalArray = new Float32Array(h * 3), y.faceArray = new Uint16Array(h * 6), y.lineArray = new Uint16Array(h * 6)), this.radii && (y.radiusArray = new Float32Array(h)), y.useOffset = this.offset, y; } - setUpNormals(...b) { - for (var A = 0; A < this.groups; A++) { - var S = this.geometryGroups[A]; - S.setNormals(...b); + setUpNormals(...y) { + for (var w = 0; w < this.groups; w++) { + var L = this.geometryGroups[w]; + L.setNormals(...y); } } - setColors(...b) { - for (var A = this.geometryGroups.length, S = 0; S < A; S++) { - var s = this.geometryGroups[S]; - s.setColors(...b); + setColors(...y) { + for (var w = this.geometryGroups.length, L = 0; L < w; L++) { + var s = this.geometryGroups[L]; + s.setColors(...y); } } - setUpWireframe(...b) { - for (var A = 0; A < this.groups; A++) { - var S = this.geometryGroups[A]; - S.setLineIndices(...b); + setUpWireframe(...y) { + for (var w = 0; w < this.groups; w++) { + var L = this.geometryGroups[w]; + L.setLineIndices(...y); } } //After vertices, colors, etc are collected in regular or typed arrays, // create typed arrays from regular arrays if they don't already exist, initTypedArrays() { - for (var b = 0; b < this.groups; b++) { - var A = this.geometryGroups[b]; - A.__inittedArrays !== !0 && A.truncateArrayBuffers(this.mesh, !1); + for (var y = 0; y < this.groups; y++) { + var w = this.geometryGroups[y]; + w.__inittedArrays !== !0 && w.truncateArrayBuffers(this.mesh, !1); } } dispose() { this.dispatchEvent({ type: "dispose" }); } get vertices() { - for (var b = 0, A = 0; A < this.groups; A++) - b += this.geometryGroups[A].vertices; - return b; + for (var y = 0, w = 0; w < this.groups; w++) + y += this.geometryGroups[w].vertices; + return y; } } let c = 0; @@ -12226,8 +12226,8 @@ ATOM`, g); !*** ./src/WebGL/core/Object3D.ts ***! \************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Light: () => ( /* binding */ @@ -12236,7 +12236,7 @@ ATOM`, g); /* harmony export */ Object3D: () => ( /* binding */ - y + b ), /* harmony export */ Object3DIDCount: () => ( @@ -12250,15 +12250,15 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), f = t( + ), f = r( /*! ../../colors */ "./src/colors.ts" ); let u = 0; - class y { + class b { constructor() { this.id = u++, this.name = "", this.children = [], this.position = new n.Vector3(), this.rotation = new n.Vector3(), this.matrix = new n.Matrix4(), this.matrixWorld = new n.Matrix4(), this.quaternion = new n.Quaternion(), this.eulerOrder = "XYZ", this.up = new n.Vector3(0, 1, 0), this.scale = new n.Vector3(1, 1, 1), this.matrixAutoUpdate = !0, this.matrixWorldNeedsUpdate = !0, this.rotationAutoUpdate = !0, this.useQuaternion = !1, this.visible = !0; } @@ -12272,30 +12272,30 @@ ATOM`, g); return; } c.parent = this, this.children.push(c); - for (var C = this; C.parent !== void 0; ) - C = C.parent; - C !== void 0 && C instanceof h && C.__addObject(c); + for (var S = this; S.parent !== void 0; ) + S = S.parent; + S !== void 0 && S instanceof h && S.__addObject(c); } remove(c) { - var C = this.children.indexOf(c); - if (C !== -1) { - c.parent = void 0, this.children.splice(C, 1); - for (var b = this; b.parent !== void 0; ) - b = b.parent; - b !== void 0 && b instanceof h && b.__removeObject(c); + var S = this.children.indexOf(c); + if (S !== -1) { + c.parent = void 0, this.children.splice(S, 1); + for (var y = this; y.parent !== void 0; ) + y = y.parent; + y !== void 0 && y instanceof h && y.__removeObject(c); } } //convert to vrml vrml(c) { c || (c = " "); - var C = 2 * Math.atan2(this.quaternion.lengthxyz(), this.quaternion.w), b = 0, A = 0, S = 0; - if (C != 0) { - let w = Math.sin(C / 2); - b = this.quaternion.x / w, A = this.quaternion.y / w, S = this.quaternion.z / w; + var S = 2 * Math.atan2(this.quaternion.lengthxyz(), this.quaternion.w), y = 0, w = 0, L = 0; + if (S != 0) { + let A = Math.sin(S / 2); + y = this.quaternion.x / A, w = this.quaternion.y / A, L = this.quaternion.z / A; } var s = c + `Transform { ` + c + " center " + this.position.x + " " + this.position.y + " " + this.position.z + ` -` + c + " rotation " + b + " " + A + " " + S + " " + C + ` +` + c + " rotation " + y + " " + w + " " + L + " " + S + ` ` + c + ` children [ `; this.geometry && (s += this.geometry.vrml(c, this.material)); @@ -12310,26 +12310,26 @@ ATOM`, g); } updateMatrixWorld(c) { this.matrixAutoUpdate === !0 && this.updateMatrix(), (this.matrixWorldNeedsUpdate === !0 || c === !0) && (this.parent === void 0 ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = !1; - for (var C = 0; C < this.children.length; C++) - this.children[C].updateMatrixWorld(!0); + for (var S = 0; S < this.children.length; S++) + this.children[S].updateMatrixWorld(!0); } clone(c) { - c === void 0 && (c = new y()), c.name = this.name, c.up.copy(this.up), c.position.copy(this.position), c.rotation instanceof n.Vector3 && this.rotation instanceof n.Vector3 ? c.rotation.copy(this.rotation) : c.rotation = this.rotation, c.eulerOrder = this.eulerOrder, c.scale.copy(this.scale), c.rotationAutoUpdate = this.rotationAutoUpdate, c.matrix.copy(this.matrix), c.matrixWorld.copy(this.matrixWorld), c.quaternion.copy(this.quaternion), c.matrixAutoUpdate = this.matrixAutoUpdate, c.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, c.useQuaternion = this.useQuaternion, c.visible = this.visible; - for (var C = 0; C < this.children.length; C++) { - var b = this.children[C]; - c.add(b.clone()); + c === void 0 && (c = new b()), c.name = this.name, c.up.copy(this.up), c.position.copy(this.position), c.rotation instanceof n.Vector3 && this.rotation instanceof n.Vector3 ? c.rotation.copy(this.rotation) : c.rotation = this.rotation, c.eulerOrder = this.eulerOrder, c.scale.copy(this.scale), c.rotationAutoUpdate = this.rotationAutoUpdate, c.matrix.copy(this.matrix), c.matrixWorld.copy(this.matrixWorld), c.quaternion.copy(this.quaternion), c.matrixAutoUpdate = this.matrixAutoUpdate, c.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, c.useQuaternion = this.useQuaternion, c.visible = this.visible; + for (var S = 0; S < this.children.length; S++) { + var y = this.children[S]; + c.add(y.clone()); } return c; } setVisible(c) { this.visible = c; - for (var C = 0; C < this.children.length; C++) { - var b = this.children[C]; - b.setVisible(c); + for (var S = 0; S < this.children.length; S++) { + var y = this.children[S]; + y.setVisible(c); } } } - class h extends y { + class h extends b { constructor() { super(...arguments), this.fog = null, this.overrideMaterial = null, this.matrixAutoUpdate = !1, this.__objects = [], this.__lights = [], this.__objectsAdded = [], this.__objectsRemoved = []; } @@ -12338,28 +12338,28 @@ ATOM`, g); this.__lights.indexOf(c) === -1 && this.__lights.push(c), c.target && c.target.parent === void 0 && this.add(c.target); else if (this.__objects.indexOf(c) === -1) { this.__objects.push(c), this.__objectsAdded.push(c); - var C = this.__objectsRemoved.indexOf(c); - C !== -1 && this.__objectsRemoved.splice(C, 1); + var S = this.__objectsRemoved.indexOf(c); + S !== -1 && this.__objectsRemoved.splice(S, 1); } - for (var b = 0; b < c.children.length; b++) - this.__addObject(c.children[b]); + for (var y = 0; y < c.children.length; y++) + this.__addObject(c.children[y]); } __removeObject(c) { - var C; + var S; if (c instanceof _) - C = this.__lights.indexOf(c), C !== -1 && this.__lights.splice(C, 1); - else if (C = this.__objects.indexOf(c), C !== -1) { - this.__objects.splice(C, 1), this.__objectsRemoved.push(c); - var b = this.__objectsAdded.indexOf(c); - b !== -1 && this.__objectsAdded.splice(C, 1); + S = this.__lights.indexOf(c), S !== -1 && this.__lights.splice(S, 1); + else if (S = this.__objects.indexOf(c), S !== -1) { + this.__objects.splice(S, 1), this.__objectsRemoved.push(c); + var y = this.__objectsAdded.indexOf(c); + y !== -1 && this.__objectsAdded.splice(S, 1); } - for (var A = 0; A < c.children.length; A++) - this.__removeObject(c.children[A]); + for (var w = 0; w < c.children.length; w++) + this.__removeObject(c.children[w]); } } - class _ extends y { - constructor(c, C = 1) { - super(), this.position = new n.Vector3(0, 1, 0), this.target = new y(), this.castShadow = !1, this.onlyShadow = !1, this.color = new f.Color(c), this.intensity = C; + class _ extends b { + constructor(c, S = 1) { + super(), this.position = new n.Vector3(0, 1, 0), this.target = new b(), this.castShadow = !1, this.onlyShadow = !1, this.color = new f.Color(c), this.intensity = S; } } } @@ -12370,8 +12370,8 @@ ATOM`, g); !*** ./src/WebGL/core/Projector.ts ***! \*************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Projector: () => ( /* binding */ @@ -12379,7 +12379,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" ); @@ -12406,8 +12406,8 @@ ATOM`, g); !*** ./src/WebGL/core/Raycaster.ts ***! \*************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Raycaster: () => ( /* binding */ @@ -12416,18 +12416,18 @@ ATOM`, g); /* harmony export */ intersectObject: () => ( /* binding */ - w + A ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), f = t( + ), f = r( /*! ../shapes */ "./src/WebGL/shapes/index.ts" ); - const u = (p, v) => p.distance - v.distance, y = new n.Matrix4(); + const u = (p, v) => p.distance - v.distance, b = new n.Matrix4(); class h { constructor(v, a, l, g) { this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new n.Ray(v, a), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = g || 0, this.far = l || 1 / 0; @@ -12436,61 +12436,61 @@ ATOM`, g); this.ray.set(v, a); } setFromCamera(v, a) { - a.ortho ? (this.ray.origin.set(v.x, v.y, (a.near + a.far) / (a.near - a.far)).unproject(a), this.ray.direction.set(0, 0, -1).transformDirection(a.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(a.matrixWorld), this.ray.direction.set(v.x, v.y, v.z), a.projectionMatrixInverse.getInverse(a.projectionMatrix), y.multiplyMatrices(a.matrixWorld, a.projectionMatrixInverse), this.ray.direction.applyProjection(y), this.ray.direction.sub(this.ray.origin).normalize()); + a.ortho ? (this.ray.origin.set(v.x, v.y, (a.near + a.far) / (a.near - a.far)).unproject(a), this.ray.direction.set(0, 0, -1).transformDirection(a.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(a.matrixWorld), this.ray.direction.set(v.x, v.y, v.z), a.projectionMatrixInverse.getInverse(a.projectionMatrix), b.multiplyMatrices(a.matrixWorld, a.projectionMatrixInverse), this.ray.direction.applyProjection(b), this.ray.direction.sub(this.ray.origin).normalize()); } intersectObjects(v, a) { for (var l = [], g = 0, M = a.length; g < M; g++) - w(v, a[g], this, l); + A(v, a[g], this, l); return l.sort(u), l; } } const _ = (p) => Math.min(Math.max(p, -1), 1); - var E = new f.Sphere(), c = new f.Cylinder(), C = new f.Triangle(), b = new n.Vector3(), A = new n.Vector3(), S = new n.Vector3(), s = new n.Vector3(), o = new n.Vector3(); - function w(p, v, a, l) { + var E = new f.Sphere(), c = new f.Cylinder(), S = new f.Triangle(), y = new n.Vector3(), w = new n.Vector3(), L = new n.Vector3(), s = new n.Vector3(), o = new n.Vector3(); + function A(p, v, a, l) { if (o.getPositionFromMatrix(p.matrixWorld), v.intersectionShape === void 0) return l; var g = v.intersectionShape, M = a.linePrecision; M *= p.matrixWorld.getMaxScaleOnAxis(); - var L = M * M; + var C = M * M; if (v.boundingSphere !== void 0 && v.boundingSphere instanceof f.Sphere && (E.copy(v.boundingSphere), E.applyMatrix4(p.matrixWorld), !a.ray.isIntersectionSphere(E))) return l; - var T, D, I, z, P, B, k, N, $, F, G, H, U, V; + var T, D, I, B, P, z, k, N, R, U, W, G, F, V; for (T = 0, D = g.triangle.length; T < D; T++) if (g.triangle[T] instanceof f.Triangle) { - if (C.copy(g.triangle[T]), C.applyMatrix4(p.matrixWorld), I = C.getNormal(), z = a.ray.direction.dot(I), z >= 0 || (b.subVectors(C.a, a.ray.origin), k = I.dot(b) / z, k < 0)) + if (S.copy(g.triangle[T]), S.applyMatrix4(p.matrixWorld), I = S.getNormal(), B = a.ray.direction.dot(I), B >= 0 || (y.subVectors(S.a, a.ray.origin), k = I.dot(y) / B, k < 0)) continue; - A.copy(a.ray.direction).multiplyScalar(k).add(a.ray.origin), A.sub(C.a), S.copy(C.b).sub(C.a), s.copy(C.c).sub(C.a); - var Q = S.dot(s), ae = S.lengthSq(), oe = s.lengthSq(); - if (H = (ae * A.dot(s) - Q * A.dot(S)) / (ae * oe - Q * Q), H < 0 || H > 1 || (G = (A.dot(S) - H * Q) / ae, G < 0 || G > 1 || G + H > 1)) + w.copy(a.ray.direction).multiplyScalar(k).add(a.ray.origin), w.sub(S.a), L.copy(S.b).sub(S.a), s.copy(S.c).sub(S.a); + var J = L.dot(s), X = L.lengthSq(), oe = s.lengthSq(); + if (G = (X * w.dot(s) - J * w.dot(L)) / (X * oe - J * J), G < 0 || G > 1 || (W = (w.dot(L) - G * J) / X, W < 0 || W > 1 || W + G > 1)) continue; l.push({ clickable: v, distance: k }); } for (T = 0, D = g.cylinder.length; T < D; T++) if (g.cylinder[T] instanceof f.Cylinder) { - if (c.copy(g.cylinder[T]), c.applyMatrix4(p.matrixWorld), b.subVectors(c.c1, a.ray.origin), P = b.dot(c.direction), B = b.dot(a.ray.direction), z = _(a.ray.direction.dot(c.direction)), $ = 1 - z * z, $ === 0) + if (c.copy(g.cylinder[T]), c.applyMatrix4(p.matrixWorld), y.subVectors(c.c1, a.ray.origin), P = y.dot(c.direction), z = y.dot(a.ray.direction), B = _(a.ray.direction.dot(c.direction)), R = 1 - B * B, R === 0) continue; - U = (z * B - P) / $, V = (B - z * P) / $, A.copy(c.direction).multiplyScalar(U).add(c.c1), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(A, S).lengthSq(); - var q = c.radius * c.radius; - if (N <= q) { - if (F = (z * P - B) * (z * P - B) - $ * (b.lengthSq() - P * P - q), F <= 0 ? H = k = Math.sqrt(N) : H = k = (B - z * P - Math.sqrt(F)) / $, G = z * H - P, G < 0 || G * G > c.lengthSq() || H < 0) + F = (B * z - P) / R, V = (z - B * P) / R, w.copy(c.direction).multiplyScalar(F).add(c.c1), L.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(w, L).lengthSq(); + var te = c.radius * c.radius; + if (N <= te) { + if (U = (B * P - z) * (B * P - z) - R * (y.lengthSq() - P * P - te), U <= 0 ? G = k = Math.sqrt(N) : G = k = (z - B * P - Math.sqrt(U)) / R, W = B * G - P, W < 0 || W * W > c.lengthSq() || G < 0) continue; l.push({ clickable: v, distance: k }); } } for (T = 0, D = g.line.length; T < D; T += 2) { - A.copy(g.line[T]), A.applyMatrix4(p.matrixWorld), S.copy(g.line[T + 1]), S.applyMatrix4(p.matrixWorld), s.subVectors(S, A); - var me = s.lengthSq(); - s.normalize(), b.subVectors(A, a.ray.origin); - var ne = b.dot(s); - B = b.dot(a.ray.direction), z = _(a.ray.direction.dot(s)), $ = 1 - z * z, $ !== 0 && (U = (z * B - ne) / $, V = (B - z * ne) / $, A.add(s.multiplyScalar(U)), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(S, A).lengthSq(), N < L && U * U < me && l.push({ clickable: v, distance: V })); + w.copy(g.line[T]), w.applyMatrix4(p.matrixWorld), L.copy(g.line[T + 1]), L.applyMatrix4(p.matrixWorld), s.subVectors(L, w); + var ve = s.lengthSq(); + s.normalize(), y.subVectors(w, a.ray.origin); + var se = y.dot(s); + z = y.dot(a.ray.direction), B = _(a.ray.direction.dot(s)), R = 1 - B * B, R !== 0 && (F = (B * z - se) / R, V = (z - B * se) / R, w.add(s.multiplyScalar(F)), L.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(L, w).lengthSq(), N < C && F * F < ve && l.push({ clickable: v, distance: V })); } for (T = 0, D = g.sphere.length; T < D; T++) if (g.sphere[T] instanceof f.Sphere && (E.copy(g.sphere[T]), E.applyMatrix4(p.matrixWorld), a.ray.isIntersectionSphere(E))) { - A.subVectors(E.center, a.ray.origin); - var fe = A.dot(a.ray.direction); - if (F = fe * fe - (A.lengthSq() - E.radius * E.radius), fe < 0) + w.subVectors(E.center, a.ray.origin); + var le = w.dot(a.ray.direction); + if (U = le * le - (w.lengthSq() - E.radius * E.radius), le < 0) return l; - F <= 0 ? k = fe : k = fe - Math.sqrt(F), l.push({ clickable: v, distance: k }); + U <= 0 ? k = le : k = le - Math.sqrt(U), l.push({ clickable: v, distance: k }); } return l; } @@ -12502,8 +12502,8 @@ ATOM`, g); !*** ./src/WebGL/core/Texture.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Texture: () => ( /* binding */ @@ -12516,22 +12516,22 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../constants/TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), f = t( + ), f = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), u = t( + ), u = r( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), y = t( + ), b = r( /*! ./UVMapping */ "./src/WebGL/core/UVMapping.ts" ); class h extends u.EventDispatcher { - constructor(c, C) { - super(), this.id = _++, this.name = "", this.image = c, this.mapping = new y.UVMapping(), this.wrapS = n.ClampToEdgeWrapping, this.wrapT = n.ClampToEdgeWrapping, this.anisotropy = 1, C ? (this.format = n.RFormat, this.type = n.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = n.NearestFilter, this.minFilter = n.NearestFilter) : (this.format = n.RGBAFormat, this.type = n.UnsignedByteType, this.offset = new f.Vector2(0, 0), this.repeat = new f.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = n.LinearFilter, this.minFilter = n.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; + constructor(c, S) { + super(), this.id = _++, this.name = "", this.image = c, this.mapping = new b.UVMapping(), this.wrapS = n.ClampToEdgeWrapping, this.wrapT = n.ClampToEdgeWrapping, this.anisotropy = 1, S ? (this.format = n.RFormat, this.type = n.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = n.NearestFilter, this.minFilter = n.NearestFilter) : (this.format = n.RGBAFormat, this.type = n.UnsignedByteType, this.offset = new f.Vector2(0, 0), this.repeat = new f.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = n.LinearFilter, this.minFilter = n.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; } clone(c = new h()) { return c.image = this.image, c.mapping = this.mapping, c.wrapS = this.wrapS, c.wrapT = this.wrapT, c.magFilter = this.magFilter, c.minFilter = this.minFilter, c.anisotropy = this.anisotropy, c.format = this.format, c.type = this.type, c.offset.copy(this.offset), c.repeat.copy(this.repeat), c.premultiplyAlpha = this.premultiplyAlpha, c.flipY = this.flipY, c.unpackAlignment = this.unpackAlignment, c; @@ -12549,8 +12549,8 @@ ATOM`, g); !*** ./src/WebGL/core/UVMapping.ts ***! \*************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ UVMapping: () => ( /* binding */ @@ -12568,8 +12568,8 @@ ATOM`, g); !*** ./src/WebGL/core/index.ts ***! \*********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ EventDispatcher: () => ( /* reexport safe */ @@ -12608,7 +12608,7 @@ ATOM`, g); /* harmony export */ Projector: () => ( /* reexport safe */ - y.Projector + b.Projector ), /* harmony export */ Raycaster: () => ( @@ -12642,25 +12642,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), f = t( + ), f = r( /*! ./Geometry */ "./src/WebGL/core/Geometry.ts" - ), u = t( + ), u = r( /*! ./Object3D */ "./src/WebGL/core/Object3D.ts" - ), y = t( + ), b = r( /*! ./Projector */ "./src/WebGL/core/Projector.ts" - ), h = t( + ), h = r( /*! ./Raycaster */ "./src/WebGL/core/Raycaster.ts" - ), _ = t( + ), _ = r( /*! ./Texture */ "./src/WebGL/core/Texture.ts" - ), E = t( + ), E = r( /*! ./UVMapping */ "./src/WebGL/core/UVMapping.ts" ); @@ -12672,8 +12672,8 @@ ATOM`, g); !*** ./src/WebGL/index.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ BackSide: () => ( /* reexport safe */ @@ -12717,7 +12717,7 @@ ATOM`, g); /* harmony export */ Fog: () => ( /* reexport safe */ - C.Fog + S.Fog ), /* harmony export */ FrontSide: () => ( @@ -12792,12 +12792,12 @@ ATOM`, g); /* harmony export */ Matrix3: () => ( /* reexport safe */ - y.Matrix3 + b.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - y.Matrix4 + b.Matrix4 ), /* harmony export */ Mesh: () => ( @@ -12842,7 +12842,7 @@ ATOM`, g); /* harmony export */ Quaternion: () => ( /* reexport safe */ - y.Quaternion + b.Quaternion ), /* harmony export */ R32Format: () => ( @@ -12862,7 +12862,7 @@ ATOM`, g); /* harmony export */ Ray: () => ( /* reexport safe */ - y.Ray + b.Ray ), /* harmony export */ Raycaster: () => ( @@ -12872,7 +12872,7 @@ ATOM`, g); /* harmony export */ Renderer: () => ( /* reexport safe */ - b.Renderer + y.Renderer ), /* harmony export */ Scene: () => ( @@ -12927,7 +12927,7 @@ ATOM`, g); /* harmony export */ SpritePlugin: () => ( /* reexport safe */ - A.SpritePlugin + w.SpritePlugin ), /* harmony export */ StickImposterMaterial: () => ( @@ -12972,12 +12972,12 @@ ATOM`, g); /* harmony export */ Vector2: () => ( /* reexport safe */ - y.Vector2 + b.Vector2 ), /* harmony export */ Vector3: () => ( /* reexport safe */ - y.Vector3 + b.Vector3 ), /* harmony export */ VolumetricMaterial: () => ( @@ -12992,7 +12992,7 @@ ATOM`, g); /* harmony export */ clamp: () => ( /* reexport safe */ - y.clamp + b.clamp ), /* harmony export */ clone: () => ( @@ -13002,12 +13002,12 @@ ATOM`, g); /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - y.conversionMatrix3 + b.conversionMatrix3 ), /* harmony export */ degToRad: () => ( /* reexport safe */ - y.degToRad + b.degToRad ), /* harmony export */ instanced: () => ( @@ -13076,37 +13076,37 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./constants */ "./src/WebGL/constants/index.ts" - ), f = t( + ), f = r( /*! ./core */ "./src/WebGL/core/index.ts" - ), u = t( + ), u = r( /*! ./materials */ "./src/WebGL/materials/index.ts" - ), y = t( + ), b = r( /*! ./math */ "./src/WebGL/math/index.ts" - ), h = t( + ), h = r( /*! ./objects */ "./src/WebGL/objects/index.ts" - ), _ = t( + ), _ = r( /*! ./shaders */ "./src/WebGL/shaders/index.ts" - ), E = t( + ), E = r( /*! ./shapes */ "./src/WebGL/shapes/index.ts" - ), c = t( + ), c = r( /*! ./Camera */ "./src/WebGL/Camera.ts" - ), C = t( + ), S = r( /*! ./Fog */ "./src/WebGL/Fog.ts" - ), b = t( + ), y = r( /*! ./Renderer */ "./src/WebGL/Renderer.ts" - ), A = t( + ), w = r( /*! ./SpritePlugin */ "./src/WebGL/SpritePlugin.ts" ); @@ -13118,8 +13118,8 @@ ATOM`, g); !*** ./src/WebGL/materials/ImposterMaterial.ts ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ImposterMaterial: () => ( /* binding */ @@ -13127,25 +13127,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), f = t( + ), f = r( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), u = t( + ), u = r( /*! ../../colors */ "./src/colors.ts" - ), y = t( + ), b = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), h = t( + ), h = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); class _ extends h.Material { constructor(c) { - super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new y.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = null, this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); + super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new b.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = null, this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); } clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c; @@ -13159,8 +13159,8 @@ ATOM`, g); !*** ./src/WebGL/materials/InstancedMaterial.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ InstancedMaterial: () => ( /* binding */ @@ -13168,25 +13168,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), f = t( + ), f = r( /*! ../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), u = t( + ), u = r( /*! ../../colors */ "./src/colors.ts" - ), y = t( + ), b = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), h = t( + ), h = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); class _ extends h.Material { constructor(c) { - super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.wrapAround = !1, this.wrapRGB = new y.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(c); + super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.wrapAround = !1, this.wrapRGB = new b.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(c); } clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c.sphere = this.sphere, c; @@ -13200,8 +13200,8 @@ ATOM`, g); !*** ./src/WebGL/materials/LineBasicMaterial.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ LineBasicMaterial: () => ( /* binding */ @@ -13209,10 +13209,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../colors */ "./src/colors.ts" - ), f = t( + ), f = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); @@ -13232,8 +13232,8 @@ ATOM`, g); !*** ./src/WebGL/materials/Material.ts ***! \*****************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Material: () => ( /* binding */ @@ -13246,16 +13246,16 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), f = t( + ), f = r( /*! ../core */ "./src/WebGL/core/index.ts" - ), u = t( + ), u = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), y = t( + ), b = r( /*! ../../colors */ "./src/colors.ts" ); @@ -13265,15 +13265,15 @@ ATOM`, g); } setValues(c = {}) { if (c !== void 0) - for (var C in c) { - var b = c[C]; - if (b === void 0) { - console.warn("$3Dmol.Material: '" + C + "' parameter is undefined."); + for (var S in c) { + var y = c[S]; + if (y === void 0) { + console.warn("$3Dmol.Material: '" + S + "' parameter is undefined."); continue; } - if (C in this) { - var A = this[C]; - A instanceof y.Color && b instanceof y.Color ? A.copy(b) : A instanceof y.Color ? A.set(b) : A instanceof u.Vector3 && b instanceof u.Vector3 ? A.copy(b) : this[C] = b; + if (S in this) { + var w = this[S]; + w instanceof b.Color && y instanceof b.Color ? w.copy(y) : w instanceof b.Color ? w.set(y) : w instanceof u.Vector3 && y instanceof u.Vector3 ? w.copy(y) : this[S] = y; } } } @@ -13294,8 +13294,8 @@ ATOM`, g); !*** ./src/WebGL/materials/MeshDoubleLambertMaterial.ts ***! \**********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MeshDoubleLambertMaterial: () => ( /* binding */ @@ -13303,10 +13303,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), f = t( + ), f = r( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" ); @@ -13326,8 +13326,8 @@ ATOM`, g); !*** ./src/WebGL/materials/MeshLambertMaterial.ts ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MeshLambertMaterial: () => ( /* binding */ @@ -13335,25 +13335,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), f = t( + ), f = r( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), u = t( + ), u = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" - ), y = t( + ), b = r( /*! ../../colors */ "./src/colors.ts" - ), h = t( + ), h = r( /*! ../math */ "./src/WebGL/math/index.ts" ); class _ extends u.Material { constructor(c) { - super(), this.color = new y.Color(16777215), this.ambient = new y.Color(1048575), this.emissive = new y.Color(0), this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); + super(), this.color = new b.Color(16777215), this.ambient = new b.Color(1048575), this.emissive = new b.Color(0), this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); } clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c; @@ -13367,8 +13367,8 @@ ATOM`, g); !*** ./src/WebGL/materials/MeshOutlineMaterial.ts ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MeshOutlineMaterial: () => ( /* binding */ @@ -13376,10 +13376,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../colors */ "./src/colors.ts" - ), f = t( + ), f = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); @@ -13399,8 +13399,8 @@ ATOM`, g); !*** ./src/WebGL/materials/SphereImposterMaterial.ts ***! \*******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SphereImposterMaterial: () => ( /* binding */ @@ -13408,16 +13408,16 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); class f extends n.ImposterMaterial { - constructor(y) { - super(y), this.shaderID = "sphereimposter", this.setValues(y); + constructor(b) { + super(b), this.shaderID = "sphereimposter", this.setValues(b); } - clone(y = new f()) { - return super.clone.call(this, y), y; + clone(b = new f()) { + return super.clone.call(this, b), b; } } } @@ -13428,8 +13428,8 @@ ATOM`, g); !*** ./src/WebGL/materials/SphereImposterOutlineMaterial.ts ***! \**************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SphereImposterOutlineMaterial: () => ( /* binding */ @@ -13437,10 +13437,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../colors */ "./src/colors.ts" - ), f = t( + ), f = r( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); @@ -13460,8 +13460,8 @@ ATOM`, g); !*** ./src/WebGL/materials/SpriteMaterial.ts ***! \***********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SpriteMaterial: () => ( /* binding */ @@ -13469,25 +13469,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../constants/SpriteAlignment */ "./src/WebGL/constants/SpriteAlignment.ts" - ), f = t( + ), f = r( /*! ../core/Texture */ "./src/WebGL/core/Texture.ts" - ), u = t( + ), u = r( /*! ../../colors */ "./src/colors.ts" - ), y = t( + ), b = r( /*! ../math */ "./src/WebGL/math/index.ts" - ), h = t( + ), h = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); class _ extends h.Material { constructor(c) { - super(), this.color = new u.Color(16777215), this.map = new f.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new y.Vector2(0, 0), this.uvScale = new y.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = n.SpriteAlignment.center.clone(), this.setValues(c), c = c || {}, c.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), c.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), c.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); + super(), this.color = new u.Color(16777215), this.map = new f.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new b.Vector2(0, 0), this.uvScale = new b.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = n.SpriteAlignment.center.clone(), this.setValues(c), c = c || {}, c.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), c.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), c.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); } clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.map = this.map, c.useScreenCoordinates = this.useScreenCoordinates, c.screenOffset = this.screenOffset, c.sizeAttenuation = this.sizeAttenuation, c.scaleByViewport = this.scaleByViewPort, c.alignment.copy(this.alignment), c.uvOffset.copy(this.uvOffset), c; @@ -13501,8 +13501,8 @@ ATOM`, g); !*** ./src/WebGL/materials/StickImposterMaterial.ts ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ StickImposterMaterial: () => ( /* binding */ @@ -13510,16 +13510,16 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); class f extends n.ImposterMaterial { - constructor(y) { - super(y), this.shaderID = "stickimposter", this.setValues(y); + constructor(b) { + super(b), this.shaderID = "stickimposter", this.setValues(b); } - clone(y = new f()) { - return super.clone.call(this, y), y; + clone(b = new f()) { + return super.clone.call(this, b), b; } } } @@ -13530,8 +13530,8 @@ ATOM`, g); !*** ./src/WebGL/materials/StickImposterOutlineMaterial.ts ***! \*************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ StickImposterOutlineMaterial: () => ( /* binding */ @@ -13539,10 +13539,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../colors */ "./src/colors.ts" - ), f = t( + ), f = r( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); @@ -13562,30 +13562,30 @@ ATOM`, g); !*** ./src/WebGL/materials/VolumetricMaterial.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ VolumetricMaterial: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), f = t( + ), f = r( /*! ../../colors */ "./src/colors.ts" - ), u = t( + ), u = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class y extends u.Material { + class b extends u.Material { constructor(_) { super(), this.transparent = !1, this.volumetric = !0, this.color = new f.Color(16777215), this.transferfn = null, this.map = void 0, this.extent = [], this.maxdepth = 100, this.unit = 0, this.texmatrix = null, this.transfermin = -1, this.transfermax = 1, this.subsamples = 5, this.shaderID = "volumetric", this.side = n.FrontSide, this.setValues(_); } - clone(_ = new y()) { + clone(_ = new b()) { return super.clone.call(this, _), _.transparent = this.transparent, _.volumetric = this.volumetric, _.color = this.color, _.transferfn = this.transferfn, _.map = this.map, _.extent = this.extent, _.maxdepth = this.maxdepth, _.unit = this.unit, _.texmatrix = this.texmatrix, _.transfermin = this.transfermin, _.transfermax = this.transfermax, _.subsamples = this.subsamples, _.shaderID = this.shaderID, _.side = this.side, _; } } @@ -13597,8 +13597,8 @@ ATOM`, g); !*** ./src/WebGL/materials/index.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ImposterMaterial: () => ( /* reexport safe */ @@ -13617,12 +13617,12 @@ ATOM`, g); /* harmony export */ Material: () => ( /* reexport safe */ - y.Material + b.Material ), /* harmony export */ MaterialIdCount: () => ( /* reexport safe */ - y.MaterialIdCount + b.MaterialIdCount ), /* harmony export */ MeshDoubleLambertMaterial: () => ( @@ -13647,22 +13647,22 @@ ATOM`, g); /* harmony export */ SphereImposterOutlineMaterial: () => ( /* reexport safe */ - C.SphereImposterOutlineMaterial + S.SphereImposterOutlineMaterial ), /* harmony export */ SpriteMaterial: () => ( /* reexport safe */ - b.SpriteMaterial + y.SpriteMaterial ), /* harmony export */ StickImposterMaterial: () => ( /* reexport safe */ - A.StickImposterMaterial + w.StickImposterMaterial ), /* harmony export */ StickImposterOutlineMaterial: () => ( /* reexport safe */ - S.StickImposterOutlineMaterial + L.StickImposterOutlineMaterial ), /* harmony export */ VolumetricMaterial: () => ( @@ -13671,43 +13671,43 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" - ), f = t( + ), f = r( /*! ./InstancedMaterial */ "./src/WebGL/materials/InstancedMaterial.ts" - ), u = t( + ), u = r( /*! ./LineBasicMaterial */ "./src/WebGL/materials/LineBasicMaterial.ts" - ), y = t( + ), b = r( /*! ./Material */ "./src/WebGL/materials/Material.ts" - ), h = t( + ), h = r( /*! ./MeshDoubleLambertMaterial */ "./src/WebGL/materials/MeshDoubleLambertMaterial.ts" - ), _ = t( + ), _ = r( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" - ), E = t( + ), E = r( /*! ./MeshOutlineMaterial */ "./src/WebGL/materials/MeshOutlineMaterial.ts" - ), c = t( + ), c = r( /*! ./SphereImposterMaterial */ "./src/WebGL/materials/SphereImposterMaterial.ts" - ), C = t( + ), S = r( /*! ./SphereImposterOutlineMaterial */ "./src/WebGL/materials/SphereImposterOutlineMaterial.ts" - ), b = t( + ), y = r( /*! ./SpriteMaterial */ "./src/WebGL/materials/SpriteMaterial.ts" - ), A = t( + ), w = r( /*! ./StickImposterMaterial */ "./src/WebGL/materials/StickImposterMaterial.ts" - ), S = t( + ), L = r( /*! ./StickImposterOutlineMaterial */ "./src/WebGL/materials/StickImposterOutlineMaterial.ts" - ), s = t( + ), s = r( /*! ./VolumetricMaterial */ "./src/WebGL/materials/VolumetricMaterial.ts" ); @@ -13719,8 +13719,8 @@ ATOM`, g); !*** ./src/WebGL/math/Quaternion.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Quaternion: () => ( /* binding */ @@ -13729,11 +13729,11 @@ ATOM`, g); /* harmony export */ }); class n { - constructor(u, y, h, _) { - this.x = u || 0, this.y = y || 0, this.z = h || 0, this.w = _ !== void 0 ? _ : 1; + constructor(u, b, h, _) { + this.x = u || 0, this.y = b || 0, this.z = h || 0, this.w = _ !== void 0 ? _ : 1; } - set(u, y, h, _) { - return this.x = u, this.y = y, this.z = h, this.w = _, this; + set(u, b, h, _) { + return this.x = u, this.y = b, this.z = h, this.w = _, this; } copy(u) { return this.x = u.x, this.y = u.y, this.z = u.z, this.w = u.w, this; @@ -13760,9 +13760,9 @@ ATOM`, g); multiplyScalar(u) { return this.x *= u, this.y *= u, this.z *= u, this.w *= u, this; } - multiplyQuaternions(u, y) { - const h = u.x, _ = u.y, E = u.z, c = u.w, C = y.x, b = y.y, A = y.z, S = y.w; - return this.x = h * S + c * C + _ * A - E * b, this.y = _ * S + c * b + E * C - h * A, this.z = E * S + c * A + h * b - _ * C, this.w = c * S - h * C - _ * b - E * A, this; + multiplyQuaternions(u, b) { + const h = u.x, _ = u.y, E = u.z, c = u.w, S = b.x, y = b.y, w = b.z, L = b.w; + return this.x = h * L + c * S + _ * w - E * y, this.y = _ * L + c * y + E * S - h * w, this.z = E * L + c * w + h * y - _ * S, this.w = c * L - h * S - _ * y - E * w, this; } sub(u) { return this.x -= u.x, this.y -= u.y, this.z -= u.z, this.w -= u.w, this; @@ -13771,8 +13771,8 @@ ATOM`, g); return new n(this.x, this.y, this.z, this.w); } setFromEuler(u) { - const y = Math.cos(u.x / 2), h = Math.cos(u.y / 2), _ = Math.cos(u.z / 2), E = Math.sin(u.x / 2), c = Math.sin(u.y / 2), C = Math.sin(u.z / 2); - return this.x = E * h * _ + y * c * C, this.y = y * c * _ - E * h * C, this.z = y * h * C + E * c * _, this.w = y * h * _ - E * c * C, this; + const b = Math.cos(u.x / 2), h = Math.cos(u.y / 2), _ = Math.cos(u.z / 2), E = Math.sin(u.x / 2), c = Math.sin(u.y / 2), S = Math.sin(u.z / 2); + return this.x = E * h * _ + b * c * S, this.y = b * c * _ - E * h * S, this.z = b * h * S + E * c * _, this.w = b * h * _ - E * c * S, this; } } } @@ -13783,8 +13783,8 @@ ATOM`, g); !*** ./src/WebGL/math/Vector2.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Vector2: () => ( /* binding */ @@ -13793,14 +13793,14 @@ ATOM`, g); /* harmony export */ }); class n { - constructor(u, y) { - this.x = u || 0, this.y = y || 0; + constructor(u, b) { + this.x = u || 0, this.y = b || 0; } - set(u, y) { - return this.x = u, this.y = y, this; + set(u, b) { + return this.x = u, this.y = b, this; } - subVectors(u, y) { - return this.x = u.x - y.x, this.y = u.y - y.y, this; + subVectors(u, b) { + return this.x = u.x - b.x, this.y = u.y - b.y, this; } copy(u) { return this.x = u.x, this.y = u.y, this; @@ -13817,8 +13817,8 @@ ATOM`, g); !*** ./src/WebGL/math/index.ts ***! \*********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Matrix3: () => ( /* reexport safe */ @@ -13857,7 +13857,7 @@ ATOM`, g); /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - y.conversionMatrix3 + b.conversionMatrix3 ), /* harmony export */ degToRad: () => ( @@ -13866,22 +13866,22 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Quaternion */ "./src/WebGL/math/Quaternion.ts" - ), f = t( + ), f = r( /*! ./Vector2 */ "./src/WebGL/math/Vector2.ts" - ), u = t( + ), u = r( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), y = t( + ), b = r( /*! ./utils/conversionMatrix3 */ "./src/WebGL/math/utils/conversionMatrix3.ts" - ), h = t( + ), h = r( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" - ), _ = t( + ), _ = r( /*! ./math */ "./src/WebGL/math/math.ts" ); @@ -13893,12 +13893,12 @@ ATOM`, g); !*** ./src/WebGL/math/math.ts ***! \********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Matrix3: () => ( /* binding */ - b + y ), /* harmony export */ Matrix4: () => ( @@ -13908,33 +13908,33 @@ ATOM`, g); /* harmony export */ Ray: () => ( /* binding */ - A + w ), /* harmony export */ Vector3: () => ( /* binding */ - C + S ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" - ), f = t( + ), f = r( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), u, y, h, _, E; + ), u, b, h, _, E; class c { - constructor(s = 1, o = 0, w = 0, p = 0, v = 0, a = 1, l = 0, g = 0, M = 0, L = 0, T = 1, D = 0, I = 0, z = 0, P = 0, B = 1) { - typeof s < "u" && typeof s != "number" ? this.elements = new Float32Array(s) : (this.elements = new Float32Array(16), this.elements[0] = s, this.elements[4] = o, this.elements[8] = w, this.elements[12] = p, this.elements[1] = v, this.elements[5] = a, this.elements[9] = l, this.elements[13] = g, this.elements[2] = M, this.elements[6] = L, this.elements[10] = T, this.elements[14] = D, this.elements[3] = I, this.elements[7] = z, this.elements[11] = P, this.elements[15] = B); + constructor(s = 1, o = 0, A = 0, p = 0, v = 0, a = 1, l = 0, g = 0, M = 0, C = 0, T = 1, D = 0, I = 0, B = 0, P = 0, z = 1) { + typeof s < "u" && typeof s != "number" ? this.elements = new Float32Array(s) : (this.elements = new Float32Array(16), this.elements[0] = s, this.elements[4] = o, this.elements[8] = A, this.elements[12] = p, this.elements[1] = v, this.elements[5] = a, this.elements[9] = l, this.elements[13] = g, this.elements[2] = M, this.elements[6] = C, this.elements[10] = T, this.elements[14] = D, this.elements[3] = I, this.elements[7] = B, this.elements[11] = P, this.elements[15] = z); } // eslint-disable-next-line no-unused-vars, class-methods-use-this - makeScale(s, o, w) { + makeScale(s, o, A) { throw new Error("Method not implemented."); } - set(s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B) { + set(s, o, A, p, v, a, l, g, M, C, T, D, I, B, P, z) { const k = this.elements; - return k[0] = s, k[4] = o, k[8] = w, k[12] = p, k[1] = v, k[5] = a, k[9] = l, k[13] = g, k[2] = M, k[6] = L, k[10] = T, k[14] = D, k[3] = I, k[7] = z, k[11] = P, k[15] = B, this; + return k[0] = s, k[4] = o, k[8] = A, k[12] = p, k[1] = v, k[5] = a, k[9] = l, k[13] = g, k[2] = M, k[6] = C, k[10] = T, k[14] = D, k[3] = I, k[7] = B, k[11] = P, k[15] = z, this; } identity() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this; @@ -13945,39 +13945,39 @@ ATOM`, g); } matrix3FromTopLeft() { const s = this.elements; - return new b(s[0], s[4], s[8], s[1], s[5], s[9], s[2], s[6], s[10]); + return new y(s[0], s[4], s[8], s[1], s[5], s[9], s[2], s[6], s[10]); } setRotationFromEuler(s, o) { - const w = this.elements, { x: p, y: v, z: a } = s, l = Math.cos(p), g = Math.sin(p), M = Math.cos(v), L = Math.sin(v), T = Math.cos(a), D = Math.sin(a); + const A = this.elements, { x: p, y: v, z: a } = s, l = Math.cos(p), g = Math.sin(p), M = Math.cos(v), C = Math.sin(v), T = Math.cos(a), D = Math.sin(a); if (o === void 0 || o === "XYZ") { - const I = l * T, z = l * D, P = g * T, B = g * D; - w[0] = M * T, w[4] = -M * D, w[8] = L, w[1] = z + P * L, w[5] = I - B * L, w[9] = -g * M, w[2] = B - I * L, w[6] = P + z * L, w[10] = l * M; + const I = l * T, B = l * D, P = g * T, z = g * D; + A[0] = M * T, A[4] = -M * D, A[8] = C, A[1] = B + P * C, A[5] = I - z * C, A[9] = -g * M, A[2] = z - I * C, A[6] = P + B * C, A[10] = l * M; } else console.error(`Error with matrix4 setRotationFromEuler. Order: ${o}`); return this; } setRotationFromQuaternion(s) { - const o = this.elements, { x: w, y: p, z: v, w: a } = s, l = w + w, g = p + p, M = v + v, L = w * l, T = w * g, D = w * M, I = p * g, z = p * M, P = v * M, B = a * l, k = a * g, N = a * M; - return o[0] = 1 - (I + P), o[4] = T - N, o[8] = D + k, o[1] = T + N, o[5] = 1 - (L + P), o[9] = z - B, o[2] = D - k, o[6] = z + B, o[10] = 1 - (L + I), this; + const o = this.elements, { x: A, y: p, z: v, w: a } = s, l = A + A, g = p + p, M = v + v, C = A * l, T = A * g, D = A * M, I = p * g, B = p * M, P = v * M, z = a * l, k = a * g, N = a * M; + return o[0] = 1 - (I + P), o[4] = T - N, o[8] = D + k, o[1] = T + N, o[5] = 1 - (C + P), o[9] = B - z, o[2] = D - k, o[6] = B + z, o[10] = 1 - (C + I), this; } multiplyMatrices(s, o) { - const w = s.elements, p = o.elements, v = this.elements, a = w[0], l = w[4], g = w[8], M = w[12], L = w[1], T = w[5], D = w[9], I = w[13], z = w[2], P = w[6], B = w[10], k = w[14], N = w[3], $ = w[7], F = w[11], G = w[15], H = p[0], U = p[4], V = p[8], Q = p[12], ae = p[1], oe = p[5], q = p[9], me = p[13], ne = p[2], fe = p[6], Ce = p[10], Me = p[14], Te = p[3], se = p[7], pe = p[11], we = p[15]; - return v[0] = a * H + l * ae + g * ne + M * Te, v[4] = a * U + l * oe + g * fe + M * se, v[8] = a * V + l * q + g * Ce + M * pe, v[12] = a * Q + l * me + g * Me + M * we, v[1] = L * H + T * ae + D * ne + I * Te, v[5] = L * U + T * oe + D * fe + I * se, v[9] = L * V + T * q + D * Ce + I * pe, v[13] = L * Q + T * me + D * Me + I * we, v[2] = z * H + P * ae + B * ne + k * Te, v[6] = z * U + P * oe + B * fe + k * se, v[10] = z * V + P * q + B * Ce + k * pe, v[14] = z * Q + P * me + B * Me + k * we, v[3] = N * H + $ * ae + F * ne + G * Te, v[7] = N * U + $ * oe + F * fe + G * se, v[11] = N * V + $ * q + F * Ce + G * pe, v[15] = N * Q + $ * me + F * Me + G * we, this; + const A = s.elements, p = o.elements, v = this.elements, a = A[0], l = A[4], g = A[8], M = A[12], C = A[1], T = A[5], D = A[9], I = A[13], B = A[2], P = A[6], z = A[10], k = A[14], N = A[3], R = A[7], U = A[11], W = A[15], G = p[0], F = p[4], V = p[8], J = p[12], X = p[1], oe = p[5], te = p[9], ve = p[13], se = p[2], le = p[6], Ce = p[10], be = p[14], Le = p[3], ae = p[7], _e = p[11], Ee = p[15]; + return v[0] = a * G + l * X + g * se + M * Le, v[4] = a * F + l * oe + g * le + M * ae, v[8] = a * V + l * te + g * Ce + M * _e, v[12] = a * J + l * ve + g * be + M * Ee, v[1] = C * G + T * X + D * se + I * Le, v[5] = C * F + T * oe + D * le + I * ae, v[9] = C * V + T * te + D * Ce + I * _e, v[13] = C * J + T * ve + D * be + I * Ee, v[2] = B * G + P * X + z * se + k * Le, v[6] = B * F + P * oe + z * le + k * ae, v[10] = B * V + P * te + z * Ce + k * _e, v[14] = B * J + P * ve + z * be + k * Ee, v[3] = N * G + R * X + U * se + W * Le, v[7] = N * F + R * oe + U * le + W * ae, v[11] = N * V + R * te + U * Ce + W * _e, v[15] = N * J + R * ve + U * be + W * Ee, this; } multiplyScalar(s) { const o = this.elements; return o[0] *= s, o[4] *= s, o[8] *= s, o[12] *= s, o[1] *= s, o[5] *= s, o[9] *= s, o[13] *= s, o[2] *= s, o[6] *= s, o[10] *= s, o[14] *= s, o[3] *= s, o[7] *= s, o[11] *= s, o[15] *= s, this; } - makeTranslation(s, o, w) { - return this.set(1, 0, 0, s, 0, 1, 0, o, 0, 0, 1, w, 0, 0, 0, 1), this; + makeTranslation(s, o, A) { + return this.set(1, 0, 0, s, 0, 1, 0, o, 0, 0, 1, A, 0, 0, 0, 1), this; } // snap values close to integers to their integer value // useful and identifying identity matrices snap(s) { - const o = Math.pow(10, 4), w = this.elements; + const o = Math.pow(10, 4), A = this.elements; for (let p = 0; p < 16; p++) { - const v = Math.round(w[p]); - v === Math.round(w[p] * o) / o && (w[p] = v); + const v = Math.round(A[p]); + v === Math.round(A[p] * o) / o && (A[p] = v); } return this; } @@ -13995,49 +13995,49 @@ ATOM`, g); return o[12] += s.x, o[13] += s.y, o[14] += s.z, this; } getInverse(s, o) { - const w = this.elements, p = s.elements, v = p[0], a = p[4], l = p[8], g = p[12], M = p[1], L = p[5], T = p[9], D = p[13], I = p[2], z = p[6], P = p[10], B = p[14], k = p[3], N = p[7], $ = p[11], F = p[15]; - w[0] = T * B * N - D * P * N + D * z * $ - L * B * $ - T * z * F + L * P * F, w[4] = g * P * N - l * B * N - g * z * $ + a * B * $ + l * z * F - a * P * F, w[8] = l * D * N - g * T * N + g * L * $ - a * D * $ - l * L * F + a * T * F, w[12] = g * T * z - l * D * z - g * L * P + a * D * P + l * L * B - a * T * B, w[1] = D * P * k - T * B * k - D * I * $ + M * B * $ + T * I * F - M * P * F, w[5] = l * B * k - g * P * k + g * I * $ - v * B * $ - l * I * F + v * P * F, w[9] = g * T * k - l * D * k - g * M * $ + v * D * $ + l * M * F - v * T * F, w[13] = l * D * I - g * T * I + g * M * P - v * D * P - l * M * B + v * T * B, w[2] = L * B * k - D * z * k + D * I * N - M * B * N - L * I * F + M * z * F, w[6] = g * z * k - a * B * k - g * I * N + v * B * N + a * I * F - v * z * F, w[10] = a * D * k - g * L * k + g * M * N - v * D * N - a * M * F + v * L * F, w[14] = g * L * I - a * D * I - g * M * z + v * D * z + a * M * B - v * L * B, w[3] = T * z * k - L * P * k - T * I * N + M * P * N + L * I * $ - M * z * $, w[7] = a * P * k - l * z * k + l * I * N - v * P * N - a * I * $ + v * z * $, w[11] = l * L * k - a * T * k - l * M * N + v * T * N + a * M * $ - v * L * $, w[15] = a * T * I - l * L * I + l * M * z - v * T * z - a * M * P + v * L * P; - const G = v * w[0] + M * w[4] + I * w[8] + k * w[12]; - if (G === 0) { - const H = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; + const A = this.elements, p = s.elements, v = p[0], a = p[4], l = p[8], g = p[12], M = p[1], C = p[5], T = p[9], D = p[13], I = p[2], B = p[6], P = p[10], z = p[14], k = p[3], N = p[7], R = p[11], U = p[15]; + A[0] = T * z * N - D * P * N + D * B * R - C * z * R - T * B * U + C * P * U, A[4] = g * P * N - l * z * N - g * B * R + a * z * R + l * B * U - a * P * U, A[8] = l * D * N - g * T * N + g * C * R - a * D * R - l * C * U + a * T * U, A[12] = g * T * B - l * D * B - g * C * P + a * D * P + l * C * z - a * T * z, A[1] = D * P * k - T * z * k - D * I * R + M * z * R + T * I * U - M * P * U, A[5] = l * z * k - g * P * k + g * I * R - v * z * R - l * I * U + v * P * U, A[9] = g * T * k - l * D * k - g * M * R + v * D * R + l * M * U - v * T * U, A[13] = l * D * I - g * T * I + g * M * P - v * D * P - l * M * z + v * T * z, A[2] = C * z * k - D * B * k + D * I * N - M * z * N - C * I * U + M * B * U, A[6] = g * B * k - a * z * k - g * I * N + v * z * N + a * I * U - v * B * U, A[10] = a * D * k - g * C * k + g * M * N - v * D * N - a * M * U + v * C * U, A[14] = g * C * I - a * D * I - g * M * B + v * D * B + a * M * z - v * C * z, A[3] = T * B * k - C * P * k - T * I * N + M * P * N + C * I * R - M * B * R, A[7] = a * P * k - l * B * k + l * I * N - v * P * N - a * I * R + v * B * R, A[11] = l * C * k - a * T * k - l * M * N + v * T * N + a * M * R - v * C * R, A[15] = a * T * I - l * C * I + l * M * B - v * T * B - a * M * P + v * C * P; + const W = v * A[0] + M * A[4] + I * A[8] + k * A[12]; + if (W === 0) { + const G = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; if (o) - throw new Error(H); - return console.warn(H), this.identity(), this; + throw new Error(G); + return console.warn(G), this.identity(), this; } - return this.multiplyScalar(1 / G), this; + return this.multiplyScalar(1 / W), this; } isReflected() { - const s = this.elements, o = s[0], w = s[4], p = s[8], v = s[1], a = s[5], l = s[9], g = s[2], M = s[6], L = s[10]; - return o * a * L + // +aei + const s = this.elements, o = s[0], A = s[4], p = s[8], v = s[1], a = s[5], l = s[9], g = s[2], M = s[6], C = s[10]; + return o * a * C + // +aei v * M * p + // +bfg - g * w * l - // +cdh + g * A * l - // +cdh g * a * p - // -ceg - v * w * L - // -bdi + v * A * C - // -bdi o * M * l < 0; } scale(s) { - const o = this.elements, { x: w } = s, { y: p } = s, { z: v } = s; - return o[0] *= w, o[4] *= p, o[8] *= v, o[1] *= w, o[5] *= p, o[9] *= v, o[2] *= w, o[6] *= p, o[10] *= v, o[3] *= w, o[7] *= p, o[11] *= v, this; + const o = this.elements, { x: A } = s, { y: p } = s, { z: v } = s; + return o[0] *= A, o[4] *= p, o[8] *= v, o[1] *= A, o[5] *= p, o[9] *= v, o[2] *= A, o[6] *= p, o[10] *= v, o[3] *= A, o[7] *= p, o[11] *= v, this; } getMaxScaleOnAxis() { - const s = this.elements, o = s[0] * s[0] + s[1] * s[1] + s[2] * s[2], w = s[4] * s[4] + s[5] * s[5] + s[6] * s[6], p = s[8] * s[8] + s[9] * s[9] + s[10] * s[10]; - return Math.sqrt(Math.max(o, Math.max(w, p))); + const s = this.elements, o = s[0] * s[0] + s[1] * s[1] + s[2] * s[2], A = s[4] * s[4] + s[5] * s[5] + s[6] * s[6], p = s[8] * s[8] + s[9] * s[9] + s[10] * s[10]; + return Math.sqrt(Math.max(o, Math.max(A, p))); } - makeFrustum(s, o, w, p, v, a) { - const l = this.elements, g = 2 * v / (o - s), M = 2 * v / (p - w), L = (o + s) / (o - s), T = (p + w) / (p - w), D = -(a + v) / (a - v), I = -2 * a * v / (a - v); - return l[0] = g, l[4] = 0, l[8] = L, l[12] = 0, l[1] = 0, l[5] = M, l[9] = T, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = D, l[14] = I, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this; + makeFrustum(s, o, A, p, v, a) { + const l = this.elements, g = 2 * v / (o - s), M = 2 * v / (p - A), C = (o + s) / (o - s), T = (p + A) / (p - A), D = -(a + v) / (a - v), I = -2 * a * v / (a - v); + return l[0] = g, l[4] = 0, l[8] = C, l[12] = 0, l[1] = 0, l[5] = M, l[9] = T, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = D, l[14] = I, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this; } - makePerspective(s, o, w, p) { - const v = w * Math.tan((0, n.degToRad)(s * 0.5)), a = -v, l = a * o, g = v * o; - return this.makeFrustum(l, g, a, v, w, p); + makePerspective(s, o, A, p) { + const v = A * Math.tan((0, n.degToRad)(s * 0.5)), a = -v, l = a * o, g = v * o; + return this.makeFrustum(l, g, a, v, A, p); } - makeOrthographic(s, o, w, p, v, a) { - const l = this.elements, g = 1 / (o - s), M = 1 / (w - p), L = 1 / (a - v), T = (o + s) * g, D = (w + p) * M, I = (a + v) * L; - return l[0] = 2 * g, l[4] = 0, l[8] = 0, l[12] = -T, l[1] = 0, l[5] = 2 * M, l[9] = 0, l[13] = -D, l[2] = 0, l[6] = 0, l[10] = -2 * L, l[14] = -I, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this; + makeOrthographic(s, o, A, p, v, a) { + const l = this.elements, g = 1 / (o - s), M = 1 / (A - p), C = 1 / (a - v), T = (o + s) * g, D = (A + p) * M, I = (a + v) * C; + return l[0] = 2 * g, l[4] = 0, l[8] = 0, l[12] = -T, l[1] = 0, l[5] = 2 * M, l[9] = 0, l[13] = -D, l[2] = 0, l[6] = 0, l[10] = -2 * C, l[14] = -I, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this; } isEqual(s) { - const o = s.elements, w = this.elements; - return w[0] === o[0] && w[4] === o[4] && w[8] === o[8] && w[12] === o[12] && w[1] === o[1] && w[5] === o[5] && w[9] === o[9] && w[13] === o[13] && w[2] === o[2] && w[6] === o[6] && w[10] === o[10] && w[14] === o[14] && w[3] === o[3] && w[7] === o[7] && w[11] === o[11] && w[15] === o[15]; + const o = s.elements, A = this.elements; + return A[0] === o[0] && A[4] === o[4] && A[8] === o[8] && A[12] === o[12] && A[1] === o[1] && A[5] === o[5] && A[9] === o[9] && A[13] === o[13] && A[2] === o[2] && A[6] === o[6] && A[10] === o[10] && A[14] === o[14] && A[3] === o[3] && A[7] === o[7] && A[11] === o[11] && A[15] === o[15]; } clone() { const s = this.elements; @@ -14053,24 +14053,24 @@ ATOM`, g); } getScale(s) { const o = this.elements; - return s = s || new C(), h.set(o[0], o[1], o[2]), _.set(o[4], o[5], o[6]), E.set(o[8], o[9], o[10]), s.x = h.length(), s.y = _.length(), s.z = E.length(), s; + return s = s || new S(), h.set(o[0], o[1], o[2]), _.set(o[4], o[5], o[6]), E.set(o[8], o[9], o[10]), s.x = h.length(), s.y = _.length(), s.z = E.length(), s; } - lookAt(s, o, w) { + lookAt(s, o, A) { const p = this.elements; - return E.subVectors(s, o).normalize(), E.length() === 0 && (E.z = 1), h.crossVectors(w, E).normalize(), h.length() === 0 && (E.x += 1e-4, h.crossVectors(w, E).normalize()), _.crossVectors(E, h), p[0] = h.x, p[4] = _.x, p[8] = E.x, p[1] = h.y, p[5] = _.y, p[9] = E.y, p[2] = h.z, p[6] = _.z, p[10] = E.z, this; + return E.subVectors(s, o).normalize(), E.length() === 0 && (E.z = 1), h.crossVectors(A, E).normalize(), h.length() === 0 && (E.x += 1e-4, h.crossVectors(A, E).normalize()), _.crossVectors(E, h), p[0] = h.x, p[4] = _.x, p[8] = E.x, p[1] = h.y, p[5] = _.y, p[9] = E.y, p[2] = h.z, p[6] = _.z, p[10] = E.z, this; } - compose(s, o, w) { + compose(s, o, A) { const p = this.elements; - return u.identity(), u.setRotationFromQuaternion(o), y.makeScale(w.x, w.y, w.z), this.multiplyMatrices(u, y), p[12] = s.x, p[13] = s.y, p[14] = s.z, this; + return u.identity(), u.setRotationFromQuaternion(o), b.makeScale(A.x, A.y, A.z), this.multiplyMatrices(u, b), p[12] = s.x, p[13] = s.y, p[14] = s.z, this; } } - u = new c(), y = new c(); - class C { - constructor(s, o, w) { - this.x = s || 0, this.y = o || 0, this.z = w || 0, this.atomid = void 0; + u = new c(), b = new c(); + class S { + constructor(s, o, A) { + this.x = s || 0, this.y = o || 0, this.z = A || 0, this.atomid = void 0; } - set(s, o, w) { - return this.x = s, this.y = o, this.z = w, this; + set(s, o, A) { + return this.x = s, this.y = o, this.z = A, this; } copy(s) { return this.x = s.x, this.y = s.y, this.z = s.z, this; @@ -14108,26 +14108,26 @@ ATOM`, g); return Math.sqrt(this.distanceToSquared(s)); } distanceToSquared(s) { - const o = this.x - s.x, w = this.y - s.y, p = this.z - s.z; - return o * o + w * w + p * p; + const o = this.x - s.x, A = this.y - s.y, p = this.z - s.z; + return o * o + A * A + p * p; } applyMatrix3(s) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; - return this.x = v[0] * o + v[3] * w + v[6] * p, this.y = v[1] * o + v[4] * w + v[7] * p, this.z = v[2] * o + v[5] * w + v[8] * p, this; + const { x: o } = this, { y: A } = this, { z: p } = this, v = s.elements; + return this.x = v[0] * o + v[3] * A + v[6] * p, this.y = v[1] * o + v[4] * A + v[7] * p, this.z = v[2] * o + v[5] * A + v[8] * p, this; } applyMatrix4(s) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; - return this.x = v[0] * o + v[4] * w + v[8] * p + v[12], this.y = v[1] * o + v[5] * w + v[9] * p + v[13], this.z = v[2] * o + v[6] * w + v[10] * p + v[14], this; + const { x: o } = this, { y: A } = this, { z: p } = this, v = s.elements; + return this.x = v[0] * o + v[4] * A + v[8] * p + v[12], this.y = v[1] * o + v[5] * A + v[9] * p + v[13], this.z = v[2] * o + v[6] * A + v[10] * p + v[14], this; } applyProjection(s) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements, a = v[3] * o + v[7] * w + v[11] * p + v[15]; - return this.x = (v[0] * o + v[4] * w + v[8] * p + v[12]) / a, this.y = (v[1] * o + v[5] * w + v[9] * p + v[13]) / a, this.z = (v[2] * o + v[6] * w + v[10] * p + v[14]) / a, this; + const { x: o } = this, { y: A } = this, { z: p } = this, v = s.elements, a = v[3] * o + v[7] * A + v[11] * p + v[15]; + return this.x = (v[0] * o + v[4] * A + v[8] * p + v[12]) / a, this.y = (v[1] * o + v[5] * A + v[9] * p + v[13]) / a, this.z = (v[2] * o + v[6] * A + v[10] * p + v[14]) / a, this; } applyQuaternion(s) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = s.x, a = s.y, l = s.z, g = s.w, M = {}; - M.x = 2 * (w * l - p * a), M.y = 2 * (p * v - o * l), M.z = 2 * (o * a - w * v); - const L = {}; - return L.x = M.y * l - M.z * a, L.y = M.z * v - M.x * l, L.z = M.x * a - M.y * v, this.x = o + g * M.x + L.x, this.y = w + g * M.y + L.y, this.z = p + g * M.z + L.z, this; + const { x: o } = this, { y: A } = this, { z: p } = this, v = s.x, a = s.y, l = s.z, g = s.w, M = {}; + M.x = 2 * (A * l - p * a), M.y = 2 * (p * v - o * l), M.z = 2 * (o * a - A * v); + const C = {}; + return C.x = M.y * l - M.z * a, C.y = M.z * v - M.x * l, C.z = M.x * a - M.y * v, this.x = o + g * M.x + C.x, this.y = A + g * M.y + C.y, this.z = p + g * M.z + C.z, this; } negate() { return this.multiplyScalar(-1); @@ -14145,8 +14145,8 @@ ATOM`, g); return this.divideScalar(this.length()); } cross(s) { - const { x: o } = this, { y: w } = this, { z: p } = this; - return this.x = w * s.z - p * s.y, this.y = p * s.x - o * s.z, this.z = o * s.y - w * s.x, this; + const { x: o } = this, { y: A } = this, { z: p } = this; + return this.x = A * s.z - p * s.y, this.y = p * s.x - o * s.z, this.z = o * s.y - A * s.x, this; } crossVectors(s, o) { return this.x = s.y * o.z - s.z * o.y, this.y = s.z * o.x - s.x * o.z, this.z = s.x * o.y - s.y * o.x, this; @@ -14158,12 +14158,12 @@ ATOM`, g); return this.x = s.elements[12], this.y = s.elements[13], this.z = s.elements[14], this; } setEulerFromRotationMatrix(s, o) { - const w = s.elements, p = w[0], v = w[4], a = w[8], l = w[5], g = w[9], M = w[6], L = w[10]; - return o === void 0 || o === "XYZ" ? (this.y = Math.asin((0, f.clamp)(a, -1, 1)), Math.abs(a) < 0.99999 ? (this.x = Math.atan2(-g, L), this.z = Math.atan2(-v, p)) : (this.x = Math.atan2(M, l), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${o}`), this; + const A = s.elements, p = A[0], v = A[4], a = A[8], l = A[5], g = A[9], M = A[6], C = A[10]; + return o === void 0 || o === "XYZ" ? (this.y = Math.asin((0, f.clamp)(a, -1, 1)), Math.abs(a) < 0.99999 ? (this.x = Math.atan2(-g, C), this.z = Math.atan2(-v, p)) : (this.x = Math.atan2(M, l), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${o}`), this; } rotateAboutVector(s, o) { s.normalize(); - const w = Math.cos(o), p = Math.sin(o), v = this.clone().multiplyScalar(w), a = s.clone().cross(this).multiplyScalar(p), l = s.clone().multiplyScalar(s.clone().dot(this)).multiplyScalar(1 - w), g = v.add(a).add(l); + const A = Math.cos(o), p = Math.sin(o), v = this.clone().multiplyScalar(A), a = s.clone().cross(this).multiplyScalar(p), l = s.clone().multiplyScalar(s.clone().dot(this)).multiplyScalar(1 - A), g = v.add(a).add(l); return this.x = g.x, this.y = g.y, this.z = g.z, this; } setFromMatrixPosition(s) { @@ -14172,25 +14172,25 @@ ATOM`, g); } // unproject is defined after Matrix4 transformDirection(s) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; - return this.x = v[0] * o + v[4] * w + v[8] * p, this.y = v[1] * o + v[5] * w + v[9] * p, this.z = v[2] * o + v[6] * w + v[10] * p, this.normalize(); + const { x: o } = this, { y: A } = this, { z: p } = this, v = s.elements; + return this.x = v[0] * o + v[4] * A + v[8] * p, this.y = v[1] * o + v[5] * A + v[9] * p, this.z = v[2] * o + v[6] * A + v[10] * p, this.normalize(); } clone() { - return new C(this.x, this.y, this.z); + return new S(this.x, this.y, this.z); } unproject(s) { const o = u; return o.multiplyMatrices(s.matrixWorld, o.getInverse(s.projectionMatrix)), this.applyMatrix4(o); } } - h = new C(), _ = new C(), E = new C(); - class b { - constructor(s = 1, o = 0, w = 0, p = 0, v = 1, a = 0, l = 0, g = 0, M = 1) { - this.elements = new Float32Array(9), this.set(s, o, w, p, v, a, l, g, M); + h = new S(), _ = new S(), E = new S(); + class y { + constructor(s = 1, o = 0, A = 0, p = 0, v = 1, a = 0, l = 0, g = 0, M = 1) { + this.elements = new Float32Array(9), this.set(s, o, A, p, v, a, l, g, M); } - set(s, o, w, p, v, a, l, g, M) { - const L = this.elements; - return L[0] = s, L[3] = o, L[6] = w, L[1] = p, L[4] = v, L[7] = a, L[2] = l, L[5] = g, L[8] = M, this; + set(s, o, A, p, v, a, l, g, M) { + const C = this.elements; + return C[0] = s, C[3] = o, C[6] = A, C[1] = p, C[4] = v, C[7] = a, C[2] = l, C[5] = g, C[8] = M, this; } identity() { return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this; @@ -14204,15 +14204,15 @@ ATOM`, g); return o[0] *= s, o[3] *= s, o[6] *= s, o[1] *= s, o[4] *= s, o[7] *= s, o[2] *= s, o[5] *= s, o[8] *= s, this; } getInverse3(s) { - const o = s.elements, w = this.elements; - w[0] = o[4] * o[8] - o[5] * o[7], w[3] = o[6] * o[5] - o[3] * o[8], w[6] = o[3] * o[7] - o[6] * o[4], w[1] = o[7] * o[2] - o[1] * o[8], w[4] = o[0] * o[8] - o[6] * o[2], w[7] = o[1] * o[6] - o[0] * o[7], w[2] = o[1] * o[5] - o[2] * o[4], w[5] = o[2] * o[3] - o[0] * o[5], w[8] = o[0] * o[4] - o[1] * o[3]; - const p = o[0] * w[0] + o[3] * w[1] + o[6] * w[2]; + const o = s.elements, A = this.elements; + A[0] = o[4] * o[8] - o[5] * o[7], A[3] = o[6] * o[5] - o[3] * o[8], A[6] = o[3] * o[7] - o[6] * o[4], A[1] = o[7] * o[2] - o[1] * o[8], A[4] = o[0] * o[8] - o[6] * o[2], A[7] = o[1] * o[6] - o[0] * o[7], A[2] = o[1] * o[5] - o[2] * o[4], A[5] = o[2] * o[3] - o[0] * o[5], A[8] = o[0] * o[4] - o[1] * o[3]; + const p = o[0] * A[0] + o[3] * A[1] + o[6] * A[2]; return this.multiplyScalar(1 / p), this; } getInverse(s, o) { - const w = s.elements, p = this.elements; - p[0] = w[10] * w[5] - w[6] * w[9], p[1] = -w[10] * w[1] + w[2] * w[9], p[2] = w[6] * w[1] - w[2] * w[5], p[3] = -w[10] * w[4] + w[6] * w[8], p[4] = w[10] * w[0] - w[2] * w[8], p[5] = -w[6] * w[0] + w[2] * w[4], p[6] = w[9] * w[4] - w[5] * w[8], p[7] = -w[9] * w[0] + w[1] * w[8], p[8] = w[5] * w[0] - w[1] * w[4]; - const v = w[0] * p[0] + w[1] * p[3] + w[2] * p[6]; + const A = s.elements, p = this.elements; + p[0] = A[10] * A[5] - A[6] * A[9], p[1] = -A[10] * A[1] + A[2] * A[9], p[2] = A[6] * A[1] - A[2] * A[5], p[3] = -A[10] * A[4] + A[6] * A[8], p[4] = A[10] * A[0] - A[2] * A[8], p[5] = -A[6] * A[0] + A[2] * A[4], p[6] = A[9] * A[4] - A[5] * A[8], p[7] = -A[9] * A[0] + A[1] * A[8], p[8] = A[5] * A[0] - A[1] * A[4]; + const v = A[0] * p[0] + A[1] * p[3] + A[2] * p[6]; if (v === 0) { const a = "Matrix3.getInverse(): can't invert matrix, determinant is 0"; if (o) @@ -14238,16 +14238,16 @@ ATOM`, g); } clone() { const s = this.elements; - return new b(s[0], s[3], s[6], s[1], s[4], s[7], s[2], s[5], s[8]); + return new y(s[0], s[3], s[6], s[1], s[4], s[7], s[2], s[5], s[8]); } getMatrix4() { const s = this.elements; return new c(s[0], s[3], s[6], 0, s[1], s[4], s[7], 0, s[2], s[5], s[8], 0); } } - class A { + class w { constructor(s, o) { - this.origin = s !== void 0 ? s : new C(), this.direction = o !== void 0 ? o : new C(); + this.origin = s !== void 0 ? s : new S(), this.direction = o !== void 0 ? o : new S(); } set(s, o) { return this.origin.copy(s), this.direction.copy(o), this; @@ -14256,21 +14256,21 @@ ATOM`, g); return this.origin.copy(s.origin), this.direction.copy(s.direction), this; } at(s, o) { - return (o || new C()).copy(this.direction).multiplyScalar(s).add(this.origin); + return (o || new S()).copy(this.direction).multiplyScalar(s).add(this.origin); } recast(s) { const o = h; return this.origin.copy(this.at(s, o)), this; } closestPointToPoint(s, o) { - const w = o || new C(); - w.subVectors(s, this.origin); - const p = w.dot(this.direction); - return w.copy(this.direction).multiplyScalar(p).add(this.origin); + const A = o || new S(); + A.subVectors(s, this.origin); + const p = A.dot(this.direction); + return A.copy(this.direction).multiplyScalar(p).add(this.origin); } distanceToPoint(s) { - const o = h, w = o.subVectors(s, this.origin).dot(this.direction); - return o.copy(this.direction).multiplyScalar(w).add(this.origin), o.distanceTo(s); + const o = h, A = o.subVectors(s, this.origin).dot(this.direction); + return o.copy(this.direction).multiplyScalar(A).add(this.origin), o.distanceTo(s); } // eslint-disable-next-line class-methods-use-this isIntersectionCylinder() { @@ -14286,15 +14286,15 @@ ATOM`, g); return o === 0 ? s.distanceToPoint(this.origin) === 0 ? 0 : void 0 : -(this.origin.dot(s.normal) + s.constant) / o; } intersectPlane(s, o) { - const w = this.distanceToPlane(s); - if (w !== void 0) - return this.at(w, o); + const A = this.distanceToPlane(s); + if (A !== void 0) + return this.at(A, o); } applyMatrix4(s) { return this.direction.add(this.origin).applyMatrix4(s), this.origin.applyMatrix4(s), this.direction.sub(this.origin), this; } clone() { - return new A().copy(this); + return new w().copy(this); } } } @@ -14305,8 +14305,8 @@ ATOM`, g); !*** ./src/WebGL/math/utils/clamp.ts ***! \***************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ clamp: () => ( /* binding */ @@ -14314,8 +14314,8 @@ ATOM`, g); ) /* harmony export */ }); - function n(f, u, y) { - return Math.min(Math.max(f, u), y); + function n(f, u, b) { + return Math.min(Math.max(f, u), b); } } ), @@ -14325,8 +14325,8 @@ ATOM`, g); !*** ./src/WebGL/math/utils/conversionMatrix3.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ conversionMatrix3: () => ( /* binding */ @@ -14334,14 +14334,14 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/math.ts" ); - function f(u, y, h, _, E, c) { + function f(u, b, h, _, E, c) { _ = _ * Math.PI / 180, E = E * Math.PI / 180, c = c * Math.PI / 180; - const C = (w) => w * w, b = Math.cos(_), A = Math.cos(E), S = Math.cos(c), s = Math.sin(c); - return new n.Matrix3(u, y * S, h * A, 0, y * s, h * (b - A * S) / s, 0, 0, h * Math.sqrt(1 - C(b) - C(A) - C(S) + 2 * b * A * S) / s); + const S = (A) => A * A, y = Math.cos(_), w = Math.cos(E), L = Math.cos(c), s = Math.sin(c); + return new n.Matrix3(u, b * L, h * w, 0, b * s, h * (y - w * L) / s, 0, 0, h * Math.sqrt(1 - S(y) - S(w) - S(L) + 2 * y * w * L) / s); } } ), @@ -14351,8 +14351,8 @@ ATOM`, g); !*** ./src/WebGL/math/utils/degToRad.ts ***! \******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ degToRad: () => ( /* binding */ @@ -14372,12 +14372,12 @@ ATOM`, g); !*** ./src/WebGL/objects/Line.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Line: () => ( /* binding */ - y + b ), /* harmony export */ LineStyle: () => ( @@ -14386,23 +14386,23 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../materials */ "./src/WebGL/materials/index.ts" - ), f = t( + ), f = r( /*! ../core */ "./src/WebGL/core/index.ts" ), u; (function(h) { h[h.LineStrip = 0] = "LineStrip", h[h.LinePieces = 1] = "LinePieces"; })(u || (u = {})); - class y extends f.Object3D { + class b extends f.Object3D { constructor(_, E = new n.LineBasicMaterial({ color: Math.random() * 16777215 }), c = u.LineStrip) { super(), this.geometry = _, this.material = E, this.type = c; } - clone(_ = new y(this.geometry, this.material, this.type)) { + clone(_ = new b(this.geometry, this.material, this.type)) { return super.clone.call(this, _), _; } } @@ -14414,8 +14414,8 @@ ATOM`, g); !*** ./src/WebGL/objects/Mesh.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Mesh: () => ( /* binding */ @@ -14423,16 +14423,16 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../core */ "./src/WebGL/core/index.ts" ); class f extends n.Object3D { - constructor(y, h) { - super(), this.geometry = y, this.material = h; + constructor(b, h) { + super(), this.geometry = b, this.material = h; } - clone(y) { - return y === void 0 && (y = new f(this.geometry, this.material)), super.clone.call(this, y), y; + clone(b) { + return b === void 0 && (b = new f(this.geometry, this.material)), super.clone.call(this, b), b; } } } @@ -14443,8 +14443,8 @@ ATOM`, g); !*** ./src/WebGL/objects/Sprite.ts ***! \*************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Sprite: () => ( /* binding */ @@ -14452,10 +14452,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../materials */ "./src/WebGL/materials/index.ts" - ), f = t( + ), f = r( /*! ../core */ "./src/WebGL/core/index.ts" ); @@ -14478,8 +14478,8 @@ ATOM`, g); !*** ./src/WebGL/objects/index.ts ***! \************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Line: () => ( /* reexport safe */ @@ -14502,13 +14502,13 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Line */ "./src/WebGL/objects/Line.ts" - ), f = t( + ), f = r( /*! ./Mesh */ "./src/WebGL/objects/Mesh.ts" - ), u = t( + ), u = r( /*! ./Sprite */ "./src/WebGL/objects/Sprite.ts" ); @@ -14520,8 +14520,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/ShaderType.ts ***! \*****************************************/ /***/ - (r, e, t) => { - t.r(e); + (t, e, r) => { + r.r(e); } ), /***/ @@ -14530,8 +14530,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/index.ts ***! \************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ShaderLib: () => ( /* reexport safe */ @@ -14614,14 +14614,14 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./lib */ "./src/WebGL/shaders/lib/index.ts" - ), f = t( + ), f = r( /*! ./utils */ "./src/WebGL/shaders/utils/index.ts" ); - t( + r( /*! ./ShaderType */ "./src/WebGL/shaders/ShaderType.ts" ); @@ -14633,26 +14633,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/basic/index.ts ***! \**********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ basic: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/basic/uniforms.ts" - ), f = t( + ), f = r( /*! ./basic.frag */ "./src/WebGL/shaders/lib/basic/basic.frag" - ), u = t( + ), u = r( /*! ./basic.vert */ "./src/WebGL/shaders/lib/basic/basic.vert" ); - const y = { + const b = { vertexShader: u.default.replace("#define GLSLIFY 1", ""), fragmentShader: f.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -14665,8 +14665,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/basic/uniforms.ts ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -14674,7 +14674,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -14692,8 +14692,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/index.ts ***! \****************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ShaderLib: () => ( /* binding */ @@ -14717,7 +14717,7 @@ ATOM`, g); /* harmony export */ lambertdouble: () => ( /* reexport safe */ - y.lambertdouble + b.lambertdouble ), /* harmony export */ outline: () => ( @@ -14742,22 +14742,22 @@ ATOM`, g); /* harmony export */ sphereimposteroutline: () => ( /* reexport safe */ - C.sphereimposteroutline + S.sphereimposteroutline ), /* harmony export */ sprite: () => ( /* reexport safe */ - b.sprite + y.sprite ), /* harmony export */ stickimposter: () => ( /* reexport safe */ - A.stickimposter + w.stickimposter ), /* harmony export */ stickimposteroutline: () => ( /* reexport safe */ - S.stickimposteroutline + L.stickimposteroutline ), /* harmony export */ volumetric: () => ( @@ -14766,43 +14766,43 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./basic */ "./src/WebGL/shaders/lib/basic/index.ts" - ), f = t( + ), f = r( /*! ./instanced */ "./src/WebGL/shaders/lib/instanced/index.ts" - ), u = t( + ), u = r( /*! ./lambert */ "./src/WebGL/shaders/lib/lambert/index.ts" - ), y = t( + ), b = r( /*! ./lambertdouble */ "./src/WebGL/shaders/lib/lambertdouble/index.ts" - ), h = t( + ), h = r( /*! ./outline */ "./src/WebGL/shaders/lib/outline/index.ts" - ), _ = t( + ), _ = r( /*! ./screen */ "./src/WebGL/shaders/lib/screen/index.ts" - ), E = t( + ), E = r( /*! ./screenaa */ "./src/WebGL/shaders/lib/screenaa/index.ts" - ), c = t( + ), c = r( /*! ./sphereimposter */ "./src/WebGL/shaders/lib/sphereimposter/index.ts" - ), C = t( + ), S = r( /*! ./sphereimposteroutline */ "./src/WebGL/shaders/lib/sphereimposteroutline/index.ts" - ), b = t( + ), y = r( /*! ./sprite */ "./src/WebGL/shaders/lib/sprite/index.ts" - ), A = t( + ), w = r( /*! ./stickimposter */ "./src/WebGL/shaders/lib/stickimposter/index.ts" - ), S = t( + ), L = r( /*! ./stickimposteroutline */ "./src/WebGL/shaders/lib/stickimposteroutline/index.ts" - ), s = t( + ), s = r( /*! ./volumetric */ "./src/WebGL/shaders/lib/volumetric/index.ts" ); @@ -14810,15 +14810,15 @@ ATOM`, g); basic: n.basic, instanced: f.instanced, lambert: u.lambert, - lambertdouble: y.lambertdouble, + lambertdouble: b.lambertdouble, outline: h.outline, screen: _.screen, screenaa: E.screenaa, sphereimposter: c.sphereimposter, - sphereimposteroutline: C.sphereimposteroutline, - sprite: b.sprite, - stickimposter: A.stickimposter, - stickimposteroutline: S.stickimposteroutline, + sphereimposteroutline: S.sphereimposteroutline, + sprite: y.sprite, + stickimposter: w.stickimposter, + stickimposteroutline: L.stickimposteroutline, volumetric: s.volumetric }; } @@ -14829,26 +14829,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/instanced/index.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ instanced: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/instanced/uniforms.ts" - ), f = t( + ), f = r( /*! ./instanced.frag */ "./src/WebGL/shaders/lib/instanced/instanced.frag" - ), u = t( + ), u = r( /*! ./instanced.vert */ "./src/WebGL/shaders/lib/instanced/instanced.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -14861,8 +14861,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/instanced/uniforms.ts ***! \*****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -14870,7 +14870,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -14890,26 +14890,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/lambert/index.ts ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ lambert: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambert/uniforms.ts" - ), f = t( + ), f = r( /*! ./lambert.frag */ "./src/WebGL/shaders/lib/lambert/lambert.frag" - ), u = t( + ), u = r( /*! ./lambert.vert */ "./src/WebGL/shaders/lib/lambert/lambert.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -14922,8 +14922,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/lambert/uniforms.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -14931,7 +14931,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -14951,26 +14951,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/lambertdouble/index.ts ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ lambertdouble: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambertdouble/uniforms.ts" - ), f = t( + ), f = r( /*! ./lambertdouble.frag */ "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag" - ), u = t( + ), u = r( /*! ./lambertdouble.vert */ "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -14983,8 +14983,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/lambertdouble/uniforms.ts ***! \*********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -14992,7 +14992,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15012,26 +15012,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/outline/index.ts ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ outline: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/outline/uniforms.ts" - ), f = t( + ), f = r( /*! ./outline.frag */ "./src/WebGL/shaders/lib/outline/outline.frag" - ), u = t( + ), u = r( /*! ./outline.vert */ "./src/WebGL/shaders/lib/outline/outline.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15044,8 +15044,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/outline/uniforms.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15053,7 +15053,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15074,26 +15074,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/screen/index.ts ***! \***********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ screen: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/screen/uniforms.ts" - ), f = t( + ), f = r( /*! ./screen.frag */ "./src/WebGL/shaders/lib/screen/screen.frag" - ), u = t( + ), u = r( /*! ./screen.vert */ "./src/WebGL/shaders/lib/screen/screen.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15106,8 +15106,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/screen/uniforms.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15124,26 +15124,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/screenaa/index.ts ***! \*************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ screenaa: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/screenaa/uniforms.ts" - ), f = t( + ), f = r( /*! ./screenaa.frag */ "./src/WebGL/shaders/lib/screenaa/screenaa.frag" - ), u = t( + ), u = r( /*! ./screenaa.vert */ "./src/WebGL/shaders/lib/screenaa/screenaa.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15156,8 +15156,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/screenaa/uniforms.ts ***! \****************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15174,26 +15174,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sphereimposter/index.ts ***! \*******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ sphereimposter: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposter/uniforms.ts" - ), f = t( + ), f = r( /*! ./sphereimposter.frag */ "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag" - ), u = t( + ), u = r( /*! ./sphereimposter.vert */ "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert" ); - const y = { + const b = { vertexShader: u.default.replace("#define GLSLIFY 1", ""), fragmentShader: f.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15206,8 +15206,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sphereimposter/uniforms.ts ***! \**********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15215,7 +15215,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15235,26 +15235,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sphereimposteroutline/index.ts ***! \**************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ sphereimposteroutline: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts" - ), f = t( + ), f = r( /*! ./sphereimposteroutline.frag */ "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag" - ), u = t( + ), u = r( /*! ./sphereimposteroutline.vert */ "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15267,8 +15267,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts ***! \*****************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15276,7 +15276,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15297,26 +15297,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sprite/index.ts ***! \***********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ sprite: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/sprite/uniforms.ts" - ), f = t( + ), f = r( /*! ./sprite.frag */ "./src/WebGL/shaders/lib/sprite/sprite.frag" - ), u = t( + ), u = r( /*! ./sprite.vert */ "./src/WebGL/shaders/lib/sprite/sprite.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15329,8 +15329,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/sprite/uniforms.ts ***! \**************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15347,8 +15347,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/stickimposter/index.ts ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ stickimposter: () => ( /* binding */ @@ -15356,23 +15356,23 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposter/uniforms.ts" - ), f = t( + ), f = r( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" - ), u = t( + ), u = r( /*! ./stickimposter.partial.frag */ "./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag" - ), y = t( + ), b = r( /*! ./stickimposter.vert */ "./src/WebGL/shaders/lib/stickimposter/stickimposter.vert" ); const _ = { fragmentShader: [f.default, u.default].join(` `).replace("#define GLSLIFY 1", ""), - vertexShader: y.default.replace("#define GLSLIFY 1", ""), + vertexShader: b.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms }; } @@ -15383,8 +15383,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/stickimposter/uniforms.ts ***! \*********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15392,7 +15392,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15412,8 +15412,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/stickimposteroutline/index.ts ***! \*************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ stickimposteroutline: () => ( /* binding */ @@ -15421,13 +15421,13 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts" - ), f = t( + ), f = r( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" - ), u = t( + ), u = r( /*! ./stickimposteroutline.vert */ "./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert" ); @@ -15444,8 +15444,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts ***! \****************************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15453,7 +15453,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15474,26 +15474,26 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/volumetric/index.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ volumetric: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./uniforms */ "./src/WebGL/shaders/lib/volumetric/uniforms.ts" - ), f = t( + ), f = r( /*! ./volumetric.frag */ "./src/WebGL/shaders/lib/volumetric/volumetric.frag" - ), u = t( + ), u = r( /*! ./volumetric.vert */ "./src/WebGL/shaders/lib/volumetric/volumetric.vert" ); - const y = { + const b = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), vertexShader: u.default.replace("#define GLSLIFY 1", ""), uniforms: n.uniforms @@ -15506,8 +15506,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/lib/volumetric/uniforms.ts ***! \******************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ uniforms: () => ( /* binding */ @@ -15515,7 +15515,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../../colors */ "./src/colors.ts" ); @@ -15543,8 +15543,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/utils/clone.ts ***! \******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ clone: () => ( /* binding */ @@ -15552,18 +15552,18 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../../colors */ "./src/colors.ts" ); function f(u) { - let y = {}; + let b = {}; for (const _ in u) { - y[_] = {}, y[_].type = u[_].type; + b[_] = {}, b[_].type = u[_].type; var h = u[_].value; - h instanceof n.Color ? y[_].value = h.clone() : typeof h == "number" ? y[_].value = h : h instanceof Array ? y[_].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); + h instanceof n.Color ? b[_].value = h.clone() : typeof h == "number" ? b[_].value = h : h instanceof Array ? b[_].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); } - return y; + return b; } } ), @@ -15573,8 +15573,8 @@ ATOM`, g); !*** ./src/WebGL/shaders/utils/index.ts ***! \******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ ShaderUtils: () => ( /* binding */ @@ -15587,10 +15587,10 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./clone */ "./src/WebGL/shaders/utils/clone.ts" - ), f = t( + ), f = r( /*! ./stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" ); @@ -15606,8 +15606,8 @@ ATOM`, g); !*** ./src/WebGL/shapes/Cylinder.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Cylinder: () => ( /* binding */ @@ -15615,7 +15615,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" ); @@ -15642,8 +15642,8 @@ ATOM`, g); !*** ./src/WebGL/shapes/Sphere.ts ***! \************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Sphere: () => ( /* binding */ @@ -15651,28 +15651,28 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" ); class f { - constructor(y = { x: 0, y: 0, z: 0 }, h = 0) { - this.center = new n.Vector3(y.x, y.y, y.z), this.radius = h; + constructor(b = { x: 0, y: 0, z: 0 }, h = 0) { + this.center = new n.Vector3(b.x, b.y, b.z), this.radius = h; } - set(y, h) { - return this.center.copy(y), this.radius = h, this; + set(b, h) { + return this.center.copy(b), this.radius = h, this; } - copy(y) { - return this.center.copy(y.center), this.radius = y.radius, this; + copy(b) { + return this.center.copy(b.center), this.radius = b.radius, this; } - applyMatrix4(y) { - return this.center.applyMatrix4(y), this.radius = this.radius * y.getMaxScaleOnAxis(), this; + applyMatrix4(b) { + return this.center.applyMatrix4(b), this.radius = this.radius * b.getMaxScaleOnAxis(), this; } - translate(y) { - return this.center.add(y), this; + translate(b) { + return this.center.add(b), this; } - equals(y) { - return y.center.equals(this.center) && y.radius === this.radius; + equals(b) { + return b.center.equals(this.center) && b.radius === this.radius; } clone() { return new f().copy(this); @@ -15686,8 +15686,8 @@ ATOM`, g); !*** ./src/WebGL/shapes/Triangle.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Triangle: () => ( /* binding */ @@ -15695,7 +15695,7 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../math */ "./src/WebGL/math/index.ts" ); @@ -15723,8 +15723,8 @@ ATOM`, g); !*** ./src/WebGL/shapes/index.ts ***! \***********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Cylinder: () => ( /* reexport safe */ @@ -15742,13 +15742,13 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Sphere */ "./src/WebGL/shapes/Sphere.ts" - ), f = t( + ), f = r( /*! ./Cylinder */ "./src/WebGL/shapes/Cylinder.ts" - ), u = t( + ), u = r( /*! ./Triangle */ "./src/WebGL/shapes/Triangle.ts" ); @@ -15834,28 +15834,28 @@ ATOM`, g); var m = stylere.exec(dataname), selname, newsel, styleobj; m && (selname = "select" + m[1], newsel = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]), styleobj = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]), selectstylelist.push([newsel, styleobj])), m = surfre.exec(dataname), m && (selname = "select" + m[1], newsel = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]), styleobj = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]), surfaces.push([newsel, styleobj])), m = reslabre.exec(dataname), m && (selname = "select" + m[1], newsel = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]), styleobj = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]), labels.push([newsel, styleobj])), dataname == "zoomto" && (zoomto = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname])), dataname == "spin" && (spin = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname])); } - var applyStyles = function(r) { - for (r.setStyle(select, style), UI && UI.createSelectionAndStyle(select, style), i = 0; i < selectstylelist.length; i++) { - let e = selectstylelist[i][0] || {}, t = selectstylelist[i][1] || { line: {} }; - r.setStyle(e, t), UI && UI.createSelectionAndStyle(select, style); + var applyStyles = function(t) { + for (t.setStyle(select, style), UI && UI.createSelectionAndStyle(select, style), i = 0; i < selectstylelist.length; i++) { + let e = selectstylelist[i][0] || {}, r = selectstylelist[i][1] || { line: {} }; + t.setStyle(e, r), UI && UI.createSelectionAndStyle(select, style); } for (i = 0; i < surfaces.length; i++) { - let e = surfaces[i][0] || {}, t = surfaces[i][1] || {}; - UI ? r.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, t, e, e).then((f) => { - UI.loadSurface("VDW", e, t, f); - }) : r.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, t, e, e); + let e = surfaces[i][0] || {}, r = surfaces[i][1] || {}; + UI ? t.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, r, e, e).then((f) => { + UI.loadSurface("VDW", e, r, f); + }) : t.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, r, e, e); } for (i = 0; i < labels.length; i++) { - let e = labels[i][0] || {}, t = labels[i][1] || {}; - r.addResLabels(e, t); + let e = labels[i][0] || {}, r = labels[i][1] || {}; + t.addResLabels(e, r); } - r.render(), r.zoomTo(zoomto), spin && r.spin(spin.axis, spin.speed); + t.render(), t.zoomTo(zoomto), spin && t.spin(spin.axis, spin.speed); }, glviewer = viewer; try { var config = (0, _utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.config) || {}; config.backgroundColor === void 0 && (config.backgroundColor = bgcolor), config.backgroundAlpha === void 0 && (config.backgroundAlpha = bgalpha), glviewer == null ? glviewer = viewers[viewerdiv.id || nviewers++] = (0, _GLViewer__WEBPACK_IMPORTED_MODULE_0__.createViewer)(viewerdiv, config) : (glviewer.setBackgroundColor(bgcolor, bgalpha), glviewer.setConfig(config), UI && UI.initiateUI()), viewerdiv.dataset.ui && $3Dmol.StateManager && (UI = new $3Dmol.StateManager(glviewer)); - } catch (r) { - console.log(r), viewerdiv.textContent = "WebGL appears to be disabled."; + } catch (t) { + console.log(t), viewerdiv.textContent = "WebGL appears to be disabled."; } if (datauri.length != 0) { let i = 0; @@ -15902,8 +15902,8 @@ ATOM`, g); !*** ./src/colors.ts ***! \***********************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CC: () => ( /* binding */ @@ -15917,7 +15917,7 @@ ATOM`, g); /* harmony export */ builtinColorSchemes: () => ( /* binding */ - C + S ), /* harmony export */ chains: () => ( @@ -15942,55 +15942,55 @@ ATOM`, g); /* harmony export */ ssColors: () => ( /* binding */ - y + b ) /* harmony export */ }); class n { - constructor(A, S, s) { - return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof A == "number" ? (this.r = A || 0, this.g = S || 0, this.b = s || 0, this) : this.set(A || 0); + constructor(w, L, s) { + return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof w == "number" ? (this.r = w || 0, this.g = L || 0, this.b = s || 0, this) : this.set(w || 0); } - set(A) { - return A instanceof n ? A.clone() : (typeof A == "number" ? this.setHex(A) : typeof A == "object" && (this.r = (A == null ? void 0 : A.r) || 0, this.g = (A == null ? void 0 : A.g) || 0, this.b = (A == null ? void 0 : A.b) || 0), this); + set(w) { + return w instanceof n ? w.clone() : (typeof w == "number" ? this.setHex(w) : typeof w == "object" && (this.r = (w == null ? void 0 : w.r) || 0, this.g = (w == null ? void 0 : w.g) || 0, this.b = (w == null ? void 0 : w.b) || 0), this); } - setHex(A) { - return A = Math.floor(A), this.r = (A >> 16 & 255) / 255, this.g = (A >> 8 & 255) / 255, this.b = (A & 255) / 255, this; + setHex(w) { + return w = Math.floor(w), this.r = (w >> 16 & 255) / 255, this.g = (w >> 8 & 255) / 255, this.b = (w & 255) / 255, this; } getHex() { - var A = Math.round(this.r * 255), S = Math.round(this.g * 255), s = Math.round(this.b * 255); - return A << 16 | S << 8 | s; + var w = Math.round(this.r * 255), L = Math.round(this.g * 255), s = Math.round(this.b * 255); + return w << 16 | L << 8 | s; } clone() { return new n(this.r, this.g, this.b); } - copy(A) { - return this.r = A.r, this.g = A.g, this.b = A.b, this; + copy(w) { + return this.r = w.r, this.g = w.g, this.b = w.b, this; } //return object that represents color components from 0 to 255 scaled() { - var A = {}; - return A.r = Math.round(this.r * 255), A.g = Math.round(this.g * 255), A.b = Math.round(this.b * 255), A.a = 1, A; + var w = {}; + return w.r = Math.round(this.r * 255), w.g = Math.round(this.g * 255), w.b = Math.round(this.b * 255), w.a = 1, w; } } class f { - static color(A) { - if (!A) + static color(w) { + if (!w) return f.cache[0]; - if (A instanceof n) - return A; - if (typeof A == "number" && typeof f.cache[A] < "u") - return f.cache[A]; - if (A && Array.isArray(A)) - return A.map(f.color); - let S = f.getHex(A), s = new n(S); - return f.cache[S] = s, s; - } - static getHex(A) { - var S; - if (Array.isArray(A)) - return A.map(f.getHex); - if (typeof A == "string") { - let s = A; + if (w instanceof n) + return w; + if (typeof w == "number" && typeof f.cache[w] < "u") + return f.cache[w]; + if (w && Array.isArray(w)) + return w.map(f.color); + let L = f.getHex(w), s = new n(L); + return f.cache[L] = s, s; + } + static getHex(w) { + var L; + if (Array.isArray(w)) + return w.map(f.getHex); + if (typeof w == "string") { + let s = w; if (!isNaN(parseInt(s))) return parseInt(s); if (s = s.trim(), s.length == 4 && s[0] == "#" && (s = "#" + s[1] + s[1] + s[2] + s[2] + s[3] + s[3]), s.length == 7 && s[0] == "#") @@ -15998,17 +15998,17 @@ ATOM`, g); let o = f.rgbRegEx.exec(s); if (o) { o[1] != "" && console.log("WARNING: Opacity value in rgba ignored. Specify separately as opacity attribute."); - let w = 0; + let A = 0; for (let p = 2; p < 5; p++) { - w *= 256; + A *= 256; let v = o[p].endsWith("%") ? 255 * parseFloat(o[p]) / 100 : parseFloat(o[p]); - w += Math.round(v); + A += Math.round(v); } - return w; + return A; } - return ((S = window == null ? void 0 : window.$3Dmol) === null || S === void 0 ? void 0 : S.htmlColors[A.toLowerCase()]) || 0; + return ((L = window == null ? void 0 : window.$3Dmol) === null || L === void 0 ? void 0 : L.htmlColors[w.toLowerCase()]) || 0; } - return A; + return w; } } f.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, f.cache = { 0: new n(0) }; @@ -16161,7 +16161,7 @@ ATOM`, g); whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 - }, y = { + }, b = { //names are in helix-sheet-coil order pyMol: { h: 16711680, s: 16776960, c: 65280 }, Jmol: { h: 16711808, s: 16762880, c: 16777215 } @@ -16552,10 +16552,10 @@ ATOM`, g); Y: 15250963, Z: 12726834 } - }, C = { + }, S = { /** secondary structure pymol */ - ssPyMol: { prop: "ss", map: y.pyMol }, - ssJmol: { prop: "ss", map: y.Jmol }, + ssPyMol: { prop: "ss", map: b.pyMol }, + ssJmol: { prop: "ss", map: b.Jmol }, Jmol: { prop: "elem", map: _.Jmol }, amino: { prop: "resn", map: E.amino }, shapely: { prop: "resn", map: E.shapely }, @@ -16581,12 +16581,12 @@ ATOM`, g); !*** ./src/glcartoon.ts ***! \**************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ drawCartoon: () => ( /* binding */ - z + B ), /* harmony export */ subdivide_spline: () => ( @@ -16595,226 +16595,226 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), f = t( + ), f = r( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), u = t( + ), u = r( /*! ./WebGL */ "./src/WebGL/index.ts" - ), y = t( + ), b = r( /*! ./Gradient */ "./src/Gradient.ts" - ), h = t( + ), h = r( /*! ./colors */ "./src/colors.ts" - ), _ = t( + ), _ = r( /*! ./GLDraw */ "./src/GLDraw.ts" - ), E = t( + ), E = r( /*! ./utilities */ "./src/utilities.ts" ); - function c(P, B) { + function c(P, z) { var k = [], N = P; N = [], N.push(P[0]); - var $, F, G, H, U, V, Q, ae, oe; - for ($ = 1, F = P.length - 1; $ < F; $++) - if (U = P[$], V = P[$ + 1], U.smoothen) { - var q = new n.Vector3((U.x + V.x) / 2, (U.y + V.y) / 2, (U.z + V.z) / 2); - q.atom = U.atom, N.push(q); + var R, U, W, G, F, V, J, X, oe; + for (R = 1, U = P.length - 1; R < U; R++) + if (F = P[R], V = P[R + 1], F.smoothen) { + var te = new n.Vector3((F.x + V.x) / 2, (F.y + V.y) / 2, (F.z + V.z) / 2); + te.atom = F.atom, N.push(te); } else - N.push(U); - for (N.push(P[P.length - 1]), $ = -1, G = N.length; $ <= G - 3; $++) - if (H = N[$ === -1 ? 0 : $], U = N[$ + 1], V = N[$ + 2], Q = N[$ === G - 3 ? G - 1 : $ + 3], ae = new n.Vector3().subVectors(V, H).multiplyScalar(0.5), oe = new n.Vector3().subVectors(Q, U).multiplyScalar(0.5), !V.skip) - for (var me = 0; me < B; me++) { - var ne = 1 / B * me, fe = U.x + ne * ae.x + ne * ne * (-3 * U.x + 3 * V.x - 2 * ae.x - oe.x) + ne * ne * ne * (2 * U.x - 2 * V.x + ae.x + oe.x), Ce = U.y + ne * ae.y + ne * ne * (-3 * U.y + 3 * V.y - 2 * ae.y - oe.y) + ne * ne * ne * (2 * U.y - 2 * V.y + ae.y + oe.y), Me = U.z + ne * ae.z + ne * ne * (-3 * U.z + 3 * V.z - 2 * ae.z - oe.z) + ne * ne * ne * (2 * U.z - 2 * V.z + ae.z + oe.z), Te = new n.Vector3(fe, Ce, Me); - me < B / 2 ? Te.atom = U.atom : Te.atom = V.atom, k.push(Te); + N.push(F); + for (N.push(P[P.length - 1]), R = -1, W = N.length; R <= W - 3; R++) + if (G = N[R === -1 ? 0 : R], F = N[R + 1], V = N[R + 2], J = N[R === W - 3 ? W - 1 : R + 3], X = new n.Vector3().subVectors(V, G).multiplyScalar(0.5), oe = new n.Vector3().subVectors(J, F).multiplyScalar(0.5), !V.skip) + for (var ve = 0; ve < z; ve++) { + var se = 1 / z * ve, le = F.x + se * X.x + se * se * (-3 * F.x + 3 * V.x - 2 * X.x - oe.x) + se * se * se * (2 * F.x - 2 * V.x + X.x + oe.x), Ce = F.y + se * X.y + se * se * (-3 * F.y + 3 * V.y - 2 * X.y - oe.y) + se * se * se * (2 * F.y - 2 * V.y + X.y + oe.y), be = F.z + se * X.z + se * se * (-3 * F.z + 3 * V.z - 2 * X.z - oe.z) + se * se * se * (2 * F.z - 2 * V.z + X.z + oe.z), Le = new n.Vector3(le, Ce, be); + ve < z / 2 ? Le.atom = F.atom : Le.atom = V.atom, k.push(Le); } return k.push(N[N.length - 1]), k; } - const C = 0.5, b = 1.3, A = 0.8, S = 0.4, s = 0.4; - function o(P, B, k, N) { - for (var $, F, G, H, U = 0, V = B.length; U < V; U++) { - H = Math.round(U * (N.length - 1) / V), G = h.CC.color(N[H]); - var Q = P.updateGeoGroup(2), ae = Q.vertexArray, oe = Q.colorArray, q = Q.faceArray; - $ = Q.vertices, F = $ * 3, ae[F] = B[U].x, ae[F + 1] = B[U].y, ae[F + 2] = B[U].z, ae[F + 3] = k[U].x, ae[F + 4] = k[U].y, ae[F + 5] = k[U].z; - for (var me = 0; me < 6; ++me) - oe[F + 3 * me] = G.r, oe[F + 1 + 3 * me] = G.g, oe[F + 2 + 3 * me] = G.b; - if (U > 0) { - var ne = [$, $ + 1, $ - 1, $ - 2], fe = Q.faceidx; - q[fe] = ne[0], q[fe + 1] = ne[1], q[fe + 2] = ne[3], q[fe + 3] = ne[1], q[fe + 4] = ne[2], q[fe + 5] = ne[3], Q.faceidx += 6; - } - Q.vertices += 2; + const S = 0.5, y = 1.3, w = 0.8, L = 0.4, s = 0.4; + function o(P, z, k, N) { + for (var R, U, W, G, F = 0, V = z.length; F < V; F++) { + G = Math.round(F * (N.length - 1) / V), W = h.CC.color(N[G]); + var J = P.updateGeoGroup(2), X = J.vertexArray, oe = J.colorArray, te = J.faceArray; + R = J.vertices, U = R * 3, X[U] = z[F].x, X[U + 1] = z[F].y, X[U + 2] = z[F].z, X[U + 3] = k[F].x, X[U + 4] = k[F].y, X[U + 5] = k[F].z; + for (var ve = 0; ve < 6; ++ve) + oe[U + 3 * ve] = W.r, oe[U + 1 + 3 * ve] = W.g, oe[U + 2 + 3 * ve] = W.b; + if (F > 0) { + var se = [R, R + 1, R - 1, R - 2], le = J.faceidx; + te[le] = se[0], te[le + 1] = se[1], te[le + 2] = se[3], te[le + 3] = se[1], te[le + 4] = se[2], te[le + 5] = se[3], J.faceidx += 6; + } + J.vertices += 2; } } - function w(P, B, k, N, $, F, G) { - var H, U, V, Q; - if (V = B.length, V < 2 || B[0].length < 2) + function A(P, z, k, N, R, U, W) { + var G, F, V, J; + if (V = z.length, V < 2 || z[0].length < 2) return; - for (H = 0; H < V; H++) - B[H] = c(B[H], N); - if (Q = B[0].length, !$) - return o(P, B[0], B[V - 1], k); - var ae, oe, q, me, ne, fe, Ce = [], Me = [], Te = []; - for (U = 0; U < V; U++) - Ce.push(0.25 + 1.5 * Math.sqrt((V - 1) * U - Math.pow(U, 2)) / (V - 1)), Me.push(0.5), Te.push(2 * (Math.pow(U / V, 2) - U / V) + 0.6); - var se = []; - for (U = 0; U < V * 2 - 1; U++) - se[U] = [U, U + 1, U + 1 - 2 * V, U - 2 * V]; - se[V * 2 - 1] = [ - U, - U + 1 - 2 * V, - U + 1 - 4 * V, - U - 2 * V + for (G = 0; G < V; G++) + z[G] = c(z[G], N); + if (J = z[0].length, !R) + return o(P, z[0], z[V - 1], k); + var X, oe, te, ve, se, le, Ce = [], be = [], Le = []; + for (F = 0; F < V; F++) + Ce.push(0.25 + 1.5 * Math.sqrt((V - 1) * F - Math.pow(F, 2)) / (V - 1)), be.push(0.5), Le.push(2 * (Math.pow(F / V, 2) - F / V) + 0.6); + var ae = []; + for (F = 0; F < V * 2 - 1; F++) + ae[F] = [F, F + 1, F + 1 - 2 * V, F - 2 * V]; + ae[V * 2 - 1] = [ + F, + F + 1 - 2 * V, + F + 1 - 4 * V, + F - 2 * V ]; - var pe, we, Fe, Ue, Ne, Be, ue, ye, ge, Se; - let ze = P.updateGeoGroup(); - for (H = 0; H < Q; H++) { - let K = P.groups, ee = !1; - ze = P.updateGeoGroup(2 * V), K != P.groups && H > 0 && (H = H - 1, ee = !0), Be = Math.round(H * (k.length - 1) / Q), Ne = h.CC.color(k[Be]), ne = q, fe = me, q = [], me = [], ae = [], B[0][H].atom !== void 0 && (Ue = B[0][H].atom, G === "oval" ? oe = Ce : G === "rectangle" ? oe = Me : G === "parabola" && (oe = Te)), oe || (oe = Me); - var He, We; - for (U = 0; U < V; U++) - H < Q - 1 ? He = B[U][H + 1].clone().sub(B[U][H]) : He = B[U][H - 1].clone().sub(B[U][H]).negate(), U < V - 1 ? We = B[U + 1][H].clone().sub(B[U][H]) : We = B[U - 1][H].clone().sub(B[U][H]).negate(), ae[U] = We.cross(He).normalize().multiplyScalar($ * oe[U]); - for (U = 0; U < V; U++) - q[U] = B[U][H].clone().add(ae[U].clone().negate()); - for (U = 0; U < V; U++) - me[U] = B[U][H].clone().add(ae[U]); - for (ue = ze.vertexArray, ye = ze.colorArray, ge = ze.faceArray, pe = ze.vertices, we = pe * 3, U = 0; U < V; U++) - ue[we + 3 * U + 0] = q[U].x, ue[we + 3 * U + 1] = q[U].y, ue[we + 3 * U + 2] = q[U].z; - for (U = 0; U < V; U++) - ue[we + 3 * U + 0 + 3 * V] = me[V - 1 - U].x, ue[we + 3 * U + 1 + 3 * V] = me[V - 1 - U].y, ue[we + 3 * U + 2 + 3 * V] = me[V - 1 - U].z; - for (U = 0; U < 2 * V; ++U) - ye[we + 3 * U + 0] = Ne.r, ye[we + 3 * U + 1] = Ne.g, ye[we + 3 * U + 2] = Ne.b; - if (H > 0 && !ee) { - for (U = 0; U < V * 2; U++) - Se = [ - pe + se[U][0], - pe + se[U][1], - pe + se[U][2], - pe + se[U][3] - ], Fe = ze.faceidx, ge[Fe] = Se[0], ge[Fe + 1] = Se[1], ge[Fe + 2] = Se[3], ge[Fe + 3] = Se[1], ge[Fe + 4] = Se[2], ge[Fe + 5] = Se[3], ze.faceidx += 6; - if (Ue.clickable || Ue.hoverable) { - var Y = []; - Y.push(new f.Triangle(ne[0], q[0], q[V - 1])), Y.push(new f.Triangle(ne[0], q[V - 1], ne[V - 1])), Y.push(new f.Triangle(ne[V - 1], q[V - 1], me[V - 1])), Y.push(new f.Triangle(ne[V - 1], me[V - 1], fe[V - 1])), Y.push(new f.Triangle(me[0], fe[0], fe[V - 1])), Y.push(new f.Triangle(me[V - 1], me[0], fe[V - 1])), Y.push(new f.Triangle(q[0], ne[0], fe[0])), Y.push(new f.Triangle(me[0], q[0], fe[0])); - for (U in Y) - Ue.intersectionShape.triangle.push(Y[U]); + var _e, Ee, Be, Ne, Ge, ke, pe, de, ce, Ae; + let Oe = P.updateGeoGroup(); + for (G = 0; G < J; G++) { + let j = P.groups, ee = !1; + Oe = P.updateGeoGroup(2 * V), j != P.groups && G > 0 && (G = G - 1, ee = !0), ke = Math.round(G * (k.length - 1) / J), Ge = h.CC.color(k[ke]), se = te, le = ve, te = [], ve = [], X = [], z[0][G].atom !== void 0 && (Ne = z[0][G].atom, W === "oval" ? oe = Ce : W === "rectangle" ? oe = be : W === "parabola" && (oe = Le)), oe || (oe = be); + var We, Ue; + for (F = 0; F < V; F++) + G < J - 1 ? We = z[F][G + 1].clone().sub(z[F][G]) : We = z[F][G - 1].clone().sub(z[F][G]).negate(), F < V - 1 ? Ue = z[F + 1][G].clone().sub(z[F][G]) : Ue = z[F - 1][G].clone().sub(z[F][G]).negate(), X[F] = Ue.cross(We).normalize().multiplyScalar(R * oe[F]); + for (F = 0; F < V; F++) + te[F] = z[F][G].clone().add(X[F].clone().negate()); + for (F = 0; F < V; F++) + ve[F] = z[F][G].clone().add(X[F]); + for (pe = Oe.vertexArray, de = Oe.colorArray, ce = Oe.faceArray, _e = Oe.vertices, Ee = _e * 3, F = 0; F < V; F++) + pe[Ee + 3 * F + 0] = te[F].x, pe[Ee + 3 * F + 1] = te[F].y, pe[Ee + 3 * F + 2] = te[F].z; + for (F = 0; F < V; F++) + pe[Ee + 3 * F + 0 + 3 * V] = ve[V - 1 - F].x, pe[Ee + 3 * F + 1 + 3 * V] = ve[V - 1 - F].y, pe[Ee + 3 * F + 2 + 3 * V] = ve[V - 1 - F].z; + for (F = 0; F < 2 * V; ++F) + de[Ee + 3 * F + 0] = Ge.r, de[Ee + 3 * F + 1] = Ge.g, de[Ee + 3 * F + 2] = Ge.b; + if (G > 0 && !ee) { + for (F = 0; F < V * 2; F++) + Ae = [ + _e + ae[F][0], + _e + ae[F][1], + _e + ae[F][2], + _e + ae[F][3] + ], Be = Oe.faceidx, ce[Be] = Ae[0], ce[Be + 1] = Ae[1], ce[Be + 2] = Ae[3], ce[Be + 3] = Ae[1], ce[Be + 4] = Ae[2], ce[Be + 5] = Ae[3], Oe.faceidx += 6; + if (Ne.clickable || Ne.hoverable) { + var Z = []; + Z.push(new f.Triangle(se[0], te[0], te[V - 1])), Z.push(new f.Triangle(se[0], te[V - 1], se[V - 1])), Z.push(new f.Triangle(se[V - 1], te[V - 1], ve[V - 1])), Z.push(new f.Triangle(se[V - 1], ve[V - 1], le[V - 1])), Z.push(new f.Triangle(ve[0], le[0], le[V - 1])), Z.push(new f.Triangle(ve[V - 1], ve[0], le[V - 1])), Z.push(new f.Triangle(te[0], se[0], le[0])), Z.push(new f.Triangle(ve[0], te[0], le[0])); + for (F in Z) + Ne.intersectionShape.triangle.push(Z[F]); } } - ze.vertices += 2 * V; - } - for (ue = ze.vertexArray, ye = ze.colorArray, ge = ze.faceArray, pe = ze.vertices, we = pe * 3, Fe = ze.faceidx, H = 0; H < V - 1; H++) - Se = [H, H + 1, 2 * V - 2 - H, 2 * V - 1 - H], Fe = ze.faceidx, ge[Fe] = Se[0], ge[Fe + 1] = Se[1], ge[Fe + 2] = Se[3], ge[Fe + 3] = Se[1], ge[Fe + 4] = Se[2], ge[Fe + 5] = Se[3], ze.faceidx += 6; - for (H = 0; H < V - 1; H++) - Se = [ - pe - 1 - H, - pe - 2 - H, - pe - 2 * V + H + 1, - pe - 2 * V + H - ], Fe = ze.faceidx, ge[Fe] = Se[0], ge[Fe + 1] = Se[1], ge[Fe + 2] = Se[3], ge[Fe + 3] = Se[1], ge[Fe + 4] = Se[2], ge[Fe + 5] = Se[3], ze.faceidx += 6; + Oe.vertices += 2 * V; + } + for (pe = Oe.vertexArray, de = Oe.colorArray, ce = Oe.faceArray, _e = Oe.vertices, Ee = _e * 3, Be = Oe.faceidx, G = 0; G < V - 1; G++) + Ae = [G, G + 1, 2 * V - 2 - G, 2 * V - 1 - G], Be = Oe.faceidx, ce[Be] = Ae[0], ce[Be + 1] = Ae[1], ce[Be + 2] = Ae[3], ce[Be + 3] = Ae[1], ce[Be + 4] = Ae[2], ce[Be + 5] = Ae[3], Oe.faceidx += 6; + for (G = 0; G < V - 1; G++) + Ae = [ + _e - 1 - G, + _e - 2 - G, + _e - 2 * V + G + 1, + _e - 2 * V + G + ], Be = Oe.faceidx, ce[Be] = Ae[0], ce[Be + 1] = Ae[1], ce[Be + 2] = Ae[3], ce[Be + 3] = Ae[1], ce[Be + 4] = Ae[2], ce[Be + 5] = Ae[3], Oe.faceidx += 6; } - function p(P, B, k, N, $, F) { - if (!(B.length < 2)) { - var G, H; - if (G = B[0], H = B[B.length - 1], G = c(G, N), H = c(H, N), !$) - return o(P, G, H, k); - var U = [], V, Q, ae, oe, q, me = [ + function p(P, z, k, N, R, U) { + if (!(z.length < 2)) { + var W, G; + if (W = z[0], G = z[z.length - 1], W = c(W, N), G = c(G, N), !R) + return o(P, W, G, k); + var F = [], V, J, X, oe, te, ve = [ [0, 2, -6, -8], [-4, -2, 6, 4], [7, -1, -5, 3], [-3, 5, 1, -7] - ], ne, fe, Ce, Me, Te, se, pe, we, Fe, Ue, Ne, Be, ue, ye, ge, Se, ze; - for (we = 0, Fe = G.length; we < Fe; we++) { - if (Te = Math.round(we * (k.length - 1) / Fe), Me = h.CC.color(k[Te]), U.push(Q = G[we]), U.push(Q), U.push(ae = H[we]), U.push(ae), we < Fe - 1) { - var He = G[we + 1].clone().sub(G[we]), We = H[we].clone().sub(G[we]); - V = We.cross(He).normalize().multiplyScalar($); + ], se, le, Ce, be, Le, ae, _e, Ee, Be, Ne, Ge, ke, pe, de, ce, Ae, Oe; + for (Ee = 0, Be = W.length; Ee < Be; Ee++) { + if (Le = Math.round(Ee * (k.length - 1) / Be), be = h.CC.color(k[Le]), F.push(J = W[Ee]), F.push(J), F.push(X = G[Ee]), F.push(X), Ee < Be - 1) { + var We = W[Ee + 1].clone().sub(W[Ee]), Ue = G[Ee].clone().sub(W[Ee]); + V = Ue.cross(We).normalize().multiplyScalar(R); } - for (U.push(oe = G[we].clone().add(V)), U.push(oe), U.push(q = H[we].clone().add(V)), U.push(q), Q.atom !== void 0 && (se = Q.atom), ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, ne = ye.vertices, fe = ne * 3, ge[fe] = Q.x, ge[fe + 1] = Q.y, ge[fe + 2] = Q.z, ge[fe + 3] = Q.x, ge[fe + 4] = Q.y, ge[fe + 5] = Q.z, ge[fe + 6] = ae.x, ge[fe + 7] = ae.y, ge[fe + 8] = ae.z, ge[fe + 9] = ae.x, ge[fe + 10] = ae.y, ge[fe + 11] = ae.z, ge[fe + 12] = oe.x, ge[fe + 13] = oe.y, ge[fe + 14] = oe.z, ge[fe + 15] = oe.x, ge[fe + 16] = oe.y, ge[fe + 17] = oe.z, ge[fe + 18] = q.x, ge[fe + 19] = q.y, ge[fe + 20] = q.z, ge[fe + 21] = q.x, ge[fe + 22] = q.y, ge[fe + 23] = q.z, Ue = 0; Ue < 8; ++Ue) - Se[fe + 3 * Ue] = Me.r, Se[fe + 1 + 3 * Ue] = Me.g, Se[fe + 2 + 3 * Ue] = Me.b; - if (we > 0) { - var Y = pe !== void 0 && se !== void 0 && pe.serial !== se.serial; - for (Ue = 0; Ue < 4; Ue++) { - var K = [ - ne + me[Ue][0], - ne + me[Ue][1], - ne + me[Ue][2], - ne + me[Ue][3] + for (F.push(oe = W[Ee].clone().add(V)), F.push(oe), F.push(te = G[Ee].clone().add(V)), F.push(te), J.atom !== void 0 && (ae = J.atom), de = P.updateGeoGroup(8), ce = de.vertexArray, Ae = de.colorArray, Oe = de.faceArray, se = de.vertices, le = se * 3, ce[le] = J.x, ce[le + 1] = J.y, ce[le + 2] = J.z, ce[le + 3] = J.x, ce[le + 4] = J.y, ce[le + 5] = J.z, ce[le + 6] = X.x, ce[le + 7] = X.y, ce[le + 8] = X.z, ce[le + 9] = X.x, ce[le + 10] = X.y, ce[le + 11] = X.z, ce[le + 12] = oe.x, ce[le + 13] = oe.y, ce[le + 14] = oe.z, ce[le + 15] = oe.x, ce[le + 16] = oe.y, ce[le + 17] = oe.z, ce[le + 18] = te.x, ce[le + 19] = te.y, ce[le + 20] = te.z, ce[le + 21] = te.x, ce[le + 22] = te.y, ce[le + 23] = te.z, Ne = 0; Ne < 8; ++Ne) + Ae[le + 3 * Ne] = be.r, Ae[le + 1 + 3 * Ne] = be.g, Ae[le + 2 + 3 * Ne] = be.b; + if (Ee > 0) { + var Z = _e !== void 0 && ae !== void 0 && _e.serial !== ae.serial; + for (Ne = 0; Ne < 4; Ne++) { + var j = [ + se + ve[Ne][0], + se + ve[Ne][1], + se + ve[Ne][2], + se + ve[Ne][3] ]; - if (Ce = ye.faceidx, ze[Ce] = K[0], ze[Ce + 1] = K[1], ze[Ce + 2] = K[3], ze[Ce + 3] = K[1], ze[Ce + 4] = K[2], ze[Ce + 5] = K[3], ye.faceidx += 6, se.clickable || pe.clickable || se.hoverable || pe.hoverable) { - var ee = U[K[3]].clone(), de = U[K[0]].clone(), ve = U[K[2]].clone(), Ie = U[K[1]].clone(); - if (ee.atom = U[K[3]].atom || null, ve.atom = U[K[2]].atom || null, de.atom = U[K[0]].atom || null, Ie.atom = U[K[1]].atom || null, Y) { - var Re = ee.clone().add(de).multiplyScalar(0.5), Z = ve.clone().add(Ie).multiplyScalar(0.5), ce = ee.clone().add(Ie).multiplyScalar(0.5); - Ue % 2 === 0 ? ((pe.clickable || pe.hoverable) && (Ne = new f.Triangle(Re, ce, ee), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, ee), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue)), (se.clickable || se.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be), se.intersectionShape.triangle.push(ue))) : ((se.clickable || se.hoverable) && (Ne = new f.Triangle(Re, ce, ee), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, ee), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be), se.intersectionShape.triangle.push(ue)), (pe.clickable || pe.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue))); + if (Ce = de.faceidx, Oe[Ce] = j[0], Oe[Ce + 1] = j[1], Oe[Ce + 2] = j[3], Oe[Ce + 3] = j[1], Oe[Ce + 4] = j[2], Oe[Ce + 5] = j[3], de.faceidx += 6, ae.clickable || _e.clickable || ae.hoverable || _e.hoverable) { + var ee = F[j[3]].clone(), ge = F[j[0]].clone(), ye = F[j[2]].clone(), $e = F[j[1]].clone(); + if (ee.atom = F[j[3]].atom || null, ye.atom = F[j[2]].atom || null, ge.atom = F[j[0]].atom || null, $e.atom = F[j[1]].atom || null, Z) { + var Re = ee.clone().add(ge).multiplyScalar(0.5), Y = ye.clone().add($e).multiplyScalar(0.5), ue = ee.clone().add($e).multiplyScalar(0.5); + Ne % 2 === 0 ? ((_e.clickable || _e.hoverable) && (Ge = new f.Triangle(Re, ue, ee), ke = new f.Triangle(Y, ye, ue), pe = new f.Triangle(ue, ye, ee), _e.intersectionShape.triangle.push(Ge), _e.intersectionShape.triangle.push(ke), _e.intersectionShape.triangle.push(pe)), (ae.clickable || ae.hoverable) && (Ge = new f.Triangle(ge, $e, ue), ke = new f.Triangle($e, Y, ue), pe = new f.Triangle(ge, ue, Re), ae.intersectionShape.triangle.push(Ge), ae.intersectionShape.triangle.push(ke), ae.intersectionShape.triangle.push(pe))) : ((ae.clickable || ae.hoverable) && (Ge = new f.Triangle(Re, ue, ee), ke = new f.Triangle(Y, ye, ue), pe = new f.Triangle(ue, ye, ee), ae.intersectionShape.triangle.push(Ge), ae.intersectionShape.triangle.push(ke), ae.intersectionShape.triangle.push(pe)), (_e.clickable || _e.hoverable) && (Ge = new f.Triangle(ge, $e, ue), ke = new f.Triangle($e, Y, ue), pe = new f.Triangle(ge, ue, Re), _e.intersectionShape.triangle.push(Ge), _e.intersectionShape.triangle.push(ke), _e.intersectionShape.triangle.push(pe))); } else - (se.clickable || se.hoverable) && (Ne = new f.Triangle(de, Ie, ee), Be = new f.Triangle(Ie, ve, ee), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be)); + (ae.clickable || ae.hoverable) && (Ge = new f.Triangle(ge, $e, ee), ke = new f.Triangle($e, ye, ee), ae.intersectionShape.triangle.push(Ge), ae.intersectionShape.triangle.push(ke)); } } } - ye.vertices += 8, pe = se; + de.vertices += 8, _e = ae; } - var Ae = U.length - 8; - for (ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, ne = ye.vertices, fe = ne * 3, Ce = ye.faceidx, we = 0; we < 4; we++) { - U.push(U[we * 2]), U.push(U[Ae + we * 2]); - var ke = U[we * 2], he = U[Ae + we * 2]; - ge[fe + 6 * we] = ke.x, ge[fe + 1 + 6 * we] = ke.y, ge[fe + 2 + 6 * we] = ke.z, ge[fe + 3 + 6 * we] = he.x, ge[fe + 4 + 6 * we] = he.y, ge[fe + 5 + 6 * we] = he.z, Se[fe + 6 * we] = Me.r, Se[fe + 1 + 6 * we] = Me.g, Se[fe + 2 + 6 * we] = Me.b, Se[fe + 3 + 6 * we] = Me.r, Se[fe + 4 + 6 * we] = Me.g, Se[fe + 5 + 6 * we] = Me.b; + var Se = F.length - 8; + for (de = P.updateGeoGroup(8), ce = de.vertexArray, Ae = de.colorArray, Oe = de.faceArray, se = de.vertices, le = se * 3, Ce = de.faceidx, Ee = 0; Ee < 4; Ee++) { + F.push(F[Ee * 2]), F.push(F[Se + Ee * 2]); + var Fe = F[Ee * 2], he = F[Se + Ee * 2]; + ce[le + 6 * Ee] = Fe.x, ce[le + 1 + 6 * Ee] = Fe.y, ce[le + 2 + 6 * Ee] = Fe.z, ce[le + 3 + 6 * Ee] = he.x, ce[le + 4 + 6 * Ee] = he.y, ce[le + 5 + 6 * Ee] = he.z, Ae[le + 6 * Ee] = be.r, Ae[le + 1 + 6 * Ee] = be.g, Ae[le + 2 + 6 * Ee] = be.b, Ae[le + 3 + 6 * Ee] = be.r, Ae[le + 4 + 6 * Ee] = be.g, Ae[le + 5 + 6 * Ee] = be.b; } - Ae += 8, Ne = [ne, ne + 2, ne + 6, ne + 4], Be = [ne + 1, ne + 5, ne + 7, ne + 3], ze[Ce] = Ne[0], ze[Ce + 1] = Ne[1], ze[Ce + 2] = Ne[3], ze[Ce + 3] = Ne[1], ze[Ce + 4] = Ne[2], ze[Ce + 5] = Ne[3], ze[Ce + 6] = Be[0], ze[Ce + 7] = Be[1], ze[Ce + 8] = Be[3], ze[Ce + 9] = Be[1], ze[Ce + 10] = Be[2], ze[Ce + 11] = Be[3], ye.faceidx += 12, ye.vertices += 8; + Se += 8, Ge = [se, se + 2, se + 6, se + 4], ke = [se + 1, se + 5, se + 7, se + 3], Oe[Ce] = Ge[0], Oe[Ce + 1] = Ge[1], Oe[Ce + 2] = Ge[3], Oe[Ce + 3] = Ge[1], Oe[Ce + 4] = Ge[2], Oe[Ce + 5] = Ge[3], Oe[Ce + 6] = ke[0], Oe[Ce + 7] = ke[1], Oe[Ce + 8] = ke[3], Oe[Ce + 9] = ke[1], Oe[Ce + 10] = ke[2], Oe[Ce + 11] = ke[3], de.faceidx += 12, de.vertices += 8; } } - function v(P, B, k, N, $, F, G) { - (!G || G === "default") && (G = "rectangle"), G === "edged" ? p(P, B, k, N, $) : (G === "rectangle" || G === "oval" || G === "parabola") && w(P, B, k, N, $, F, G); + function v(P, z, k, N, R, U, W) { + (!W || W === "default") && (W = "rectangle"), W === "edged" ? p(P, z, k, N, R) : (W === "rectangle" || W === "oval" || W === "parabola") && A(P, z, k, N, R, U, W); } function a(P) { return P && P.elem === "C" && P.atom === "CA"; } - function l(P, B) { - if (P && B && P.chain === B.chain) { - if (!P.hetflag && !B.hetflag && P.reschain === B.reschain && (P.resi === B.resi || P.resi === B.resi - 1)) + function l(P, z) { + if (P && z && P.chain === z.chain) { + if (!P.hetflag && !z.hetflag && P.reschain === z.reschain && (P.resi === z.resi || P.resi === z.resi - 1)) return !0; - if (P.resi < B.resi) { - var k = P.x - B.x, N = P.y - B.y, $ = P.z - B.z, F = k * k + N * N + $ * $; - if (P.atom == "CA" && B.atom == "CA" && F < 16) + if (P.resi < z.resi) { + var k = P.x - z.x, N = P.y - z.y, R = P.z - z.z, U = k * k + N * N + R * R; + if (P.atom == "CA" && z.atom == "CA" && U < 16) return !0; - if ((P.atom == "P" || B.atom == "P") && F < 64) + if ((P.atom == "P" || z.atom == "P") && U < 64) return !0; } } return !1; } - function g(P, B, k, N, $) { - if (!(B == null || B.vertices == 0)) { - $ && (B.initTypedArrays(), B.setUpNormals()); - var F = new u.MeshDoubleLambertMaterial(); - F.vertexColors = u.Coloring.FaceColors, typeof k == "number" && k >= 0 && k < 1 && (F.transparent = !0, F.opacity = k), F.outline = N; - var G = new u.Mesh(B, F); - P.add(G); + function g(P, z, k, N, R) { + if (!(z == null || z.vertices == 0)) { + R && (z.initTypedArrays(), z.setUpNormals()); + var U = new u.MeshDoubleLambertMaterial(); + U.vertexColors = u.Coloring.FaceColors, typeof k == "number" && k >= 0 && k < 1 && (U.transparent = !0, U.opacity = k), U.outline = N; + var W = new u.Mesh(z, U); + P.add(W); } } - function M(P, B, k, N, $, F, G, H, U) { - var V, Q, ae, oe, q, me; - if (!(!N || !$ || !G)) { - var ne = $.sub(N); - ne.normalize(); - var fe = H[U]; - for (Q = U + 1; Q < H.length && (fe = H[Q], fe.atom != G.atom); Q++) + function M(P, z, k, N, R, U, W, G, F) { + var V, J, X, oe, te, ve; + if (!(!N || !R || !W)) { + var se = R.sub(N); + se.normalize(); + var le = G[F]; + for (J = F + 1; J < G.length && (le = G[J], le.atom != W.atom); J++) ; - if (fe = fe ? new n.Vector3(fe.x, fe.y, fe.z) : new n.Vector3(0, 0, 0), fe.sub(N), G.ss === "arrow start") { - var Ce = fe.clone().multiplyScalar(0.3).cross($); + if (le = le ? new n.Vector3(le.x, le.y, le.z) : new n.Vector3(0, 0, 0), le.sub(N), W.ss === "arrow start") { + var Ce = le.clone().multiplyScalar(0.3).cross(R); N.add(Ce); - var Me = fe.clone().cross(ne).normalize(); - ne.rotateAboutVector(Me, 0.43); + var be = le.clone().cross(se).normalize(); + se.rotateAboutVector(be, 0.43); } - for (G.style.cartoon.ribbon ? V = G.style.cartoon.thickness || S : G.style.cartoon.width ? V = G.style.cartoon.width : G.ss === "c" ? G.atom === "P" ? V = A : V = C : G.ss === "arrow start" ? (V = b, q = !0) : G.ss === "arrow end" || G.ss === "h" && G.style.cartoon.tubes || G.ss === "tube start" ? V = C : V = b, F != null && ne.dot(F) < 0 && ne.negate(), ne.multiplyScalar(V), Q = 0; Q < B; Q++) - ae = -1 + Q * 2 / (B - 1), oe = new n.Vector3(N.x + ae * ne.x, N.y + ae * ne.y, N.z + ae * ne.z), oe.atom = G, k && G.ss === "s" && (oe.smoothen = !0), P[Q].push(oe); - if (q) - for (ne.multiplyScalar(2), Q = 0; Q < B; Q++) - ae = -1 + Q * 2 / (B - 1), oe = new n.Vector3(N.x + ae * ne.x, N.y + ae * ne.y, N.z + ae * ne.z), oe.atom = G, oe.smoothen = !1, oe.skip = !0, P[Q].push(oe); - return me = G.style.cartoon.style || "default", P.style ? P.style != me && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = me, (G.ss === "arrow start" || G.ss === "arrow end") && (G.ss = "s"), q; + for (W.style.cartoon.ribbon ? V = W.style.cartoon.thickness || L : W.style.cartoon.width ? V = W.style.cartoon.width : W.ss === "c" ? W.atom === "P" ? V = w : V = S : W.ss === "arrow start" ? (V = y, te = !0) : W.ss === "arrow end" || W.ss === "h" && W.style.cartoon.tubes || W.ss === "tube start" ? V = S : V = y, U != null && se.dot(U) < 0 && se.negate(), se.multiplyScalar(V), J = 0; J < z; J++) + X = -1 + J * 2 / (z - 1), oe = new n.Vector3(N.x + X * se.x, N.y + X * se.y, N.z + X * se.z), oe.atom = W, k && W.ss === "s" && (oe.smoothen = !0), P[J].push(oe); + if (te) + for (se.multiplyScalar(2), J = 0; J < z; J++) + X = -1 + J * 2 / (z - 1), oe = new n.Vector3(N.x + X * se.x, N.y + X * se.y, N.z + X * se.z), oe.atom = W, oe.smoothen = !1, oe.skip = !0, P[J].push(oe); + return ve = W.style.cartoon.style || "default", P.style ? P.style != ve && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = ve, (W.ss === "arrow start" || W.ss === "arrow end") && (W.ss = "s"), te; } } - const L = { + const C = { C: !0, CA: !0, O: !0, @@ -16832,85 +16832,85 @@ ATOM`, g); N1: !0, N3: !0 }, T = { DA: !0, DG: !0, A: !0, G: !0 }, D = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, I = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; - function z(P, B, k, N = 10) { - let $ = N, F = N; - var G, H, U, V, Q, ae, oe, q, me, ne, fe, Ce, Me, Te, se, pe, we, Fe, Ue = new u.Geometry(!0), Ne = new u.Geometry(!0), Be = [], ue = [], ye = 1, ge = !1, Se = {}; - for (var ze in y.Gradient.builtinGradients) - y.Gradient.builtinGradients.hasOwnProperty(ze) && (Se[ze] = new y.Gradient.builtinGradients[ze](k[1], k[0])); - var He = function(j, $e) { - return k && $e.color === "spectrum" ? $e.colorscheme in Se ? Se[$e.colorscheme].valueToHex(j.resi) : Se.sinebow.valueToHex(j.resi) : (0, E.getColorFromStyle)(j, $e).getHex(); + function B(P, z, k, N = 10) { + let R = N, U = N; + var W, G, F, V, J, X, oe, te, ve, se, le, Ce, be, Le, ae, _e, Ee, Be, Ne = new u.Geometry(!0), Ge = new u.Geometry(!0), ke = [], pe = [], de = 1, ce = !1, Ae = {}; + for (var Oe in b.Gradient.builtinGradients) + b.Gradient.builtinGradients.hasOwnProperty(Oe) && (Ae[Oe] = new b.Gradient.builtinGradients[Oe](k[1], k[0])); + var We = function(K, ze) { + return k && ze.color === "spectrum" ? ze.colorscheme in Ae ? Ae[ze.colorscheme].valueToHex(K.resi) : Ae.sinebow.valueToHex(K.resi) : (0, E.getColorFromStyle)(K, ze).getHex(); }; - for (q = 0; q < $; q++) - ue[q] = []; - var We = !1, Y = !1, K = []; - for (q in B) { - if (V = B[q], V.elem === "C" && V.atom === "CA") { - var ee = l(U, V); - ee && V.ss === "s" ? We = !0 : We && (U && H && U.style.cartoon.arrows && H.style.cartoon.arrows && (U.ss = "arrow end", H.ss = "arrow start"), We = !1), ee && (U.ss === "h" || U.ss == "tube start") && U.style.cartoon.tubes ? !Y && U.ss != "tube start" && V.style.cartoon.tubes && (V.ss = "tube start", Y = !0) : Y && (U.ss === "tube start" ? U.ss = "tube end" : H && H.style.cartoon.tubes && (H.ss = "tube end"), Y = !1), H = U, U = V; - } - V && V.atom in L && K.push(V); - } - Y && U.style.cartoon.tubes && (U.ss = "tube end", Y = !1); - var de = function(j) { - ue[0].length > 0 && v(Ne, ue, Be, F, oe, ye, ue.style); - var $e = [], Ve = null; - if (j) { - for (q = 0; q < $; q++) - $e[q] = ue[q][ue[q].length - 1]; - Ve = Be[Be.length - 1]; - } - for (ue = [], q = 0; q < $; q++) - ue[q] = []; - if (Be = [], j) { - for (q = 0; q < $; q++) - ue[q].push($e[q]); - Be.push(Ve); - } - g(P, Ne, ye, ge, !0), g(P, Ue, ye, ge, !1), Ne = new u.Geometry(!0), Ue = new u.Geometry(!0); + for (te = 0; te < R; te++) + pe[te] = []; + var Ue = !1, Z = !1, j = []; + for (te in z) { + if (V = z[te], V.elem === "C" && V.atom === "CA") { + var ee = l(F, V); + ee && V.ss === "s" ? Ue = !0 : Ue && (F && G && F.style.cartoon.arrows && G.style.cartoon.arrows && (F.ss = "arrow end", G.ss = "arrow start"), Ue = !1), ee && (F.ss === "h" || F.ss == "tube start") && F.style.cartoon.tubes ? !Z && F.ss != "tube start" && V.style.cartoon.tubes && (V.ss = "tube start", Z = !0) : Z && (F.ss === "tube start" ? F.ss = "tube end" : G && G.style.cartoon.tubes && (G.ss = "tube end"), Z = !1), G = F, F = V; + } + V && V.atom in C && j.push(V); + } + Z && F.style.cartoon.tubes && (F.ss = "tube end", Z = !1); + var ge = function(K) { + pe[0].length > 0 && v(Ge, pe, ke, U, oe, de, pe.style); + var ze = [], Ve = null; + if (K) { + for (te = 0; te < R; te++) + ze[te] = pe[te][pe[te].length - 1]; + Ve = ke[ke.length - 1]; + } + for (pe = [], te = 0; te < R; te++) + pe[te] = []; + if (ke = [], K) { + for (te = 0; te < R; te++) + pe[te].push(ze[te]); + ke.push(Ve); + } + g(P, Ge, de, ce, !0), g(P, Ne, de, ce, !1), Ge = new u.Geometry(!0), Ne = new u.Geometry(!0); }; - U = void 0; - for (var ve = 0; ve < K.length; ve++) { - V = K[ve]; - var Ie = V.resn.trim(), Re = Ie in I; - if (ye = 1, G = V.style.cartoon, U && U.style.cartoon && (ye = U.style.cartoon.opacity), U && U.style.cartoon && U.style.cartoon.outline && (ge = U.style.cartoon.outline), U && U.style.cartoon && (!V.style.cartoon || U.style.cartoon.opacity != V.style.cartoon.opacity) && de(U.chain == V.chain), G.style === "trace") { + F = void 0; + for (var ye = 0; ye < j.length; ye++) { + V = j[ye]; + var $e = V.resn.trim(), Re = $e in I; + if (de = 1, W = V.style.cartoon, F && F.style.cartoon && (de = F.style.cartoon.opacity), F && F.style.cartoon && F.style.cartoon.outline && (ce = F.style.cartoon.outline), F && F.style.cartoon && (!V.style.cartoon || F.style.cartoon.opacity != V.style.cartoon.opacity) && ge(F.chain == V.chain), W.style === "trace") { if (!V.hetflag) { if (V.elem === "C" && V.atom === "CA" || Re && V.atom === "P" || V.atom === "BB") { - if (ae = He(V, G), (0, E.isNumeric)(G.thickness) ? oe = G.thickness : oe = S, l(U, V)) - if (ae == Q) { - var Z = h.CC.color(ae); - _.GLDraw.drawCylinder(Ue, U, V, oe, Z, 2, 2); + if (X = We(V, W), (0, E.isNumeric)(W.thickness) ? oe = W.thickness : oe = L, l(F, V)) + if (X == J) { + var Y = h.CC.color(X); + _.GLDraw.drawCylinder(Ne, F, V, oe, Y, 2, 2); } else { - var ce = new n.Vector3().addVectors(U, V).multiplyScalar(0.5), Ae = h.CC.color(Q), ke = h.CC.color(ae); - _.GLDraw.drawCylinder(Ue, U, ce, oe, Ae, 2, 0), _.GLDraw.drawCylinder(Ue, ce, V, oe, ke, 0, 2); + var ue = new n.Vector3().addVectors(F, V).multiplyScalar(0.5), Se = h.CC.color(J), Fe = h.CC.color(X); + _.GLDraw.drawCylinder(Ne, F, ue, oe, Se, 2, 0), _.GLDraw.drawCylinder(Ne, ue, V, oe, Fe, 0, 2); } if ((V.clickable === !0 || V.hoverable) && V.intersectionShape !== void 0) { var he = new n.Vector3(V.x, V.y, V.z); V.intersectionShape.sphere.push(new f.Sphere(he, oe)); } - U = V, Q = ae; + F = V, J = X; } } } else { if (a(V) || Re && (V.atom === "P" || V.atom.indexOf("O5") == 0)) { - if (Fe) + if (Be) if (V.ss === "tube end") - Fe = !1, we = new n.Vector3(V.x, V.y, V.z), _.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1), V.ss = "h"; - else if (U.chain != V.chain || U.ss === "tube end") - Fe = !1, U.ss = "h", we = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1); + Be = !1, Ee = new n.Vector3(V.x, V.y, V.z), _.GLDraw.drawCylinder(Ne, _e, Ee, 2, h.CC.color(J), 1, 1), V.ss = "h"; + else if (F.chain != V.chain || F.ss === "tube end") + Be = !1, F.ss = "h", Ee = new n.Vector3(F.x, F.y, F.z), _.GLDraw.drawCylinder(Ne, _e, Ee, 2, h.CC.color(J), 1, 1); else continue; - if (U && (!l(U, V) || U.ss === "tube start")) { - for (U.ss === "tube start" && (Fe = !0, pe = new n.Vector3(U.x, U.y, U.z), U.ss = "h"), se && (Ce ? Te = new n.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(ae), Te = null, se = null), ue[0].length > 0 && v(Ne, ue, Be, F, oe, ye, ue.style), ue = [], q = 0; q < $; q++) - ue[q] = []; - Be = []; + if (F && (!l(F, V) || F.ss === "tube start")) { + for (F.ss === "tube start" && (Be = !0, _e = new n.Vector3(F.x, F.y, F.z), F.ss = "h"), ae && (Ce ? Le = new n.Vector3().addVectors(F, Ce).multiplyScalar(0.5) : Le = new n.Vector3(F.x, F.y, F.z), _.GLDraw.drawCylinder(Ne, Le, ae, s, h.CC.color(ae.color), 0, 2), M(pe, R, !0, Ce, be, le, F, j, ye), ke.push(X), Le = null, ae = null), pe[0].length > 0 && v(Ge, pe, ke, U, oe, de, pe.style), pe = [], te = 0; te < R; te++) + pe[te] = []; + ke = []; } - if (U === void 0 || U.rescode != V.rescode || U.resi != V.resi) { - if (se) { - Te = new n.Vector3().addVectors(U, V).multiplyScalar(0.5); - var Oe = Te.clone().sub(se).multiplyScalar(0.02); - Te.add(Oe), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), Te = null, se = null; + if (F === void 0 || F.rescode != V.rescode || F.resi != V.resi) { + if (ae) { + Le = new n.Vector3().addVectors(F, V).multiplyScalar(0.5); + var De = Le.clone().sub(ae).multiplyScalar(0.02); + Le.add(De), _.GLDraw.drawCylinder(Ne, Le, ae, s, h.CC.color(ae.color), 0, 2), Le = null, ae = null; } - ae = He(V, G), Be.push(ae), (0, E.isNumeric)(G.thickness) ? oe = G.thickness : oe = S, U = V, me = new n.Vector3(U.x, U.y, U.z), me.resi = U.resi, Q = ae; + X = We(V, W), ke.push(X), (0, E.isNumeric)(W.thickness) ? oe = W.thickness : oe = L, F = V, ve = new n.Vector3(F.x, F.y, F.z), ve.resi = F.resi, J = X; } (V.clickable === !0 || V.hoverable === !0) && (V.intersectionShape === void 0 || V.intersectionShape.triangle === void 0) && (V.intersectionShape = { sphere: null, @@ -16919,11 +16919,11 @@ ATOM`, g); triangle: [] }); } else - a(U) && V.atom === "O" || Re && U.atom === "P" && (V.atom === "OP2" || V.atom === "O2P") || Re && U.atom.indexOf("O5") == 0 && V.atom.indexOf("C5") == 0 ? (ne = new n.Vector3(V.x, V.y, V.z), ne.resi = V.resi, (V.atom === "OP2" || V.atom === "O2P") && (Me = new n.Vector3(V.x, V.y, V.z))) : Re && V.atom.indexOf("O3") == 0 ? Ce = new n.Vector3(V.x, V.y, V.z) : (V.atom === "N1" && Ie in T || V.atom === "N3" && Ie in D) && (se = new n.Vector3(V.x, V.y, V.z), se.color = (0, E.getColorFromStyle)(V, G).getHex()); - ne && me && ne.resi === me.resi && (M(ue, $, !0, me, ne, fe, U, K, ve), fe = ne, me = null, ne = null, Be.push(ae)); + a(F) && V.atom === "O" || Re && F.atom === "P" && (V.atom === "OP2" || V.atom === "O2P") || Re && F.atom.indexOf("O5") == 0 && V.atom.indexOf("C5") == 0 ? (se = new n.Vector3(V.x, V.y, V.z), se.resi = V.resi, (V.atom === "OP2" || V.atom === "O2P") && (be = new n.Vector3(V.x, V.y, V.z))) : Re && V.atom.indexOf("O3") == 0 ? Ce = new n.Vector3(V.x, V.y, V.z) : (V.atom === "N1" && $e in T || V.atom === "N3" && $e in D) && (ae = new n.Vector3(V.x, V.y, V.z), ae.color = (0, E.getColorFromStyle)(V, W).getHex()); + se && ve && se.resi === ve.resi && (M(pe, R, !0, ve, se, le, F, j, ye), le = se, ve = null, se = null, ke.push(X)); } } - se && (Ce ? Te = new n.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(ae)), de(!1); + ae && (Ce ? Le = new n.Vector3().addVectors(F, Ce).multiplyScalar(0.5) : Le = new n.Vector3(F.x, F.y, F.z), _.GLDraw.drawCylinder(Ne, Le, ae, s, h.CC.color(ae.color), 0, 2), M(pe, R, !0, Ce, be, le, F, j, ye), ke.push(X)), ge(!1); } } ), @@ -16933,8 +16933,8 @@ ATOM`, g); !*** ./src/index.ts ***! \**********************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CAP: () => ( /* reexport safe */ @@ -16968,12 +16968,12 @@ ATOM`, g); /* harmony export */ GLModel: () => ( /* reexport safe */ - w.GLModel + A.GLModel ), /* harmony export */ GLShape: () => ( /* reexport safe */ - S.GLShape + L.GLShape ), /* harmony export */ GLViewer: () => ( @@ -16983,7 +16983,7 @@ ATOM`, g); /* harmony export */ GLVolumetricRender: () => ( /* reexport safe */ - A.GLVolumetricRender + w.GLVolumetricRender ), /* harmony export */ Gradient: () => ( @@ -17008,12 +17008,12 @@ ATOM`, g); /* harmony export */ MarchingCube: () => ( /* reexport safe */ - C.MarchingCube + S.MarchingCube ), /* harmony export */ MarchingCubeInitializer: () => ( /* reexport safe */ - C.MarchingCubeInitializer + S.MarchingCubeInitializer ), /* harmony export */ Matrix3: () => ( @@ -17038,12 +17038,12 @@ ATOM`, g); /* harmony export */ PointGrid: () => ( /* reexport safe */ - C.PointGrid + S.PointGrid ), /* harmony export */ ProteinSurface: () => ( /* reexport safe */ - C.ProteinSurface + S.ProteinSurface ), /* harmony export */ Quaternion: () => ( @@ -17078,7 +17078,7 @@ ATOM`, g); /* harmony export */ SurfaceType: () => ( /* reexport safe */ - C.SurfaceType + S.SurfaceType ), /* harmony export */ Triangle: () => ( @@ -17098,7 +17098,7 @@ ATOM`, g); /* harmony export */ VolumeData: () => ( /* reexport safe */ - b.VolumeData + y.VolumeData ), /* harmony export */ adjustVolumeStyle: () => ( @@ -17108,7 +17108,7 @@ ATOM`, g); /* harmony export */ applyPartialCharges: () => ( /* reexport safe */ - y.applyPartialCharges + b.applyPartialCharges ), /* harmony export */ autoinit: () => ( @@ -17273,7 +17273,7 @@ ATOM`, g); /* harmony export */ partialCharges: () => ( /* reexport safe */ - y.partialCharges + b.partialCharges ), /* harmony export */ processing_autoinit: () => ( @@ -17293,7 +17293,7 @@ ATOM`, g); /* harmony export */ setSyncSurface: () => ( /* reexport safe */ - C.setSyncSurface + S.setSyncSurface ), /* harmony export */ specStringToObject: () => ( @@ -17303,7 +17303,7 @@ ATOM`, g); /* harmony export */ splitMesh: () => ( /* reexport safe */ - S.splitMesh + L.splitMesh ), /* harmony export */ ssColors: () => ( @@ -17318,7 +17318,7 @@ ATOM`, g); /* harmony export */ syncSurface: () => ( /* reexport safe */ - C.syncSurface + S.syncSurface ), /* harmony export */ viewers: () => ( @@ -17327,59 +17327,59 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./Gradient */ "./src/Gradient.ts" - ), f = t( + ), f = r( /*! ./colors */ "./src/colors.ts" - ), u = t( + ), u = r( /*! ./Label */ "./src/Label.ts" - ), y = t( + ), b = r( /*! ./partialCharges */ "./src/partialCharges.ts" - ), h = t( + ), h = r( /*! ./parsers */ "./src/parsers/index.ts" - ), _ = t( + ), _ = r( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), E = t( + ), E = r( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), c = t( + ), c = r( /*! ./utilities */ "./src/utilities.ts" - ), C = t( + ), S = r( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), b = t( + ), y = r( /*! ./VolumeData */ "./src/VolumeData.ts" - ), A = t( + ), w = r( /*! ./VolumetricRender */ "./src/VolumetricRender.ts" - ), S = t( + ), L = r( /*! ./GLShape */ "./src/GLShape.ts" - ), s = t( + ), s = r( /*! ./GLDraw */ "./src/GLDraw.ts" - ), o = t( + ), o = r( /*! ./glcartoon */ "./src/glcartoon.ts" - ), w = t( + ), A = r( /*! ./GLModel */ "./src/GLModel.ts" - ), p = t( + ), p = r( /*! ./GLViewer */ "./src/GLViewer.ts" - ), v = t( + ), v = r( /*! ./autoload */ "./src/autoload.ts" ); - t( + r( /*! ./specs */ "./src/specs.ts" ), window && (window.$3Dmol = e); @@ -17391,8 +17391,8 @@ ATOM`, g); !*** ./src/parsers/CDJSON.ts ***! \*******************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CDJSON: () => ( /* binding */ @@ -17401,19 +17401,19 @@ ATOM`, g); /* harmony export */ }); function n(f, u) { - var y = [[]]; + var b = [[]]; typeof f == "string" && (f = JSON.parse(f)); - for (var h = f.m, _ = h[0].a, E = h[0].b, c = h[0].s, C = u !== void 0 && u.parseStyle !== void 0 ? u.parseStyle : c !== void 0, b = y[y.length - 1].length, A = 0; A < _.length; A++) { - var S = _[A], s = {}; - s.id = S.i, s.x = S.x, s.y = S.y, s.z = S.z || 0, s.bonds = [], s.bondOrder = []; - var o = S.l || "C"; - s.elem = o[0].toUpperCase() + o.substring(1).toLowerCase(), s.serial = y[y.length - 1].length, C && (s.style = c[S.s || 0]), y[y.length - 1].push(s); - } - for (let w = 0; w < E.length; w++) { - let p = E[w], v = p.b + b, a = p.e + b, l = p.o || 1, g = y[y.length - 1][v], M = y[y.length - 1][a]; + for (var h = f.m, _ = h[0].a, E = h[0].b, c = h[0].s, S = u !== void 0 && u.parseStyle !== void 0 ? u.parseStyle : c !== void 0, y = b[b.length - 1].length, w = 0; w < _.length; w++) { + var L = _[w], s = {}; + s.id = L.i, s.x = L.x, s.y = L.y, s.z = L.z || 0, s.bonds = [], s.bondOrder = []; + var o = L.l || "C"; + s.elem = o[0].toUpperCase() + o.substring(1).toLowerCase(), s.serial = b[b.length - 1].length, S && (s.style = c[L.s || 0]), b[b.length - 1].push(s); + } + for (let A = 0; A < E.length; A++) { + let p = E[A], v = p.b + y, a = p.e + y, l = p.o || 1, g = b[b.length - 1][v], M = b[b.length - 1][a]; g.bonds.push(a), g.bondOrder.push(l), M.bonds.push(v), M.bondOrder.push(l); } - return y; + return b; } } ), @@ -17423,8 +17423,8 @@ ATOM`, g); !*** ./src/parsers/CIF.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CIF: () => ( /* binding */ @@ -17432,41 +17432,41 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" - ), f = t( + ), f = r( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), u = t( + ), u = r( /*! ./utils/processSymmetries */ "./src/parsers/utils/processSymmetries.ts" - ), y = t( + ), b = r( /*! ../WebGL */ "./src/WebGL/index.ts" ); function h(_, E = {}) { - var c = [], C = !E.doAssembly, b = c.modelData = [], A = E.assignBonds === void 0 ? !0 : E.assignBonds, S = function(K, ee, de, ve) { - return new y.Vector3(ee, de, ve).applyMatrix3(K); + var c = [], S = !E.doAssembly, y = c.modelData = [], w = E.assignBonds === void 0 ? !0 : E.assignBonds, L = function(j, ee, ge, ye) { + return new b.Vector3(ee, ge, ye).applyMatrix3(j); }; - function s(K, ee) { - for (var de = [], ve = 0, Ie = 0; Ie < K.length; ) { - for (; K.substring(Ie, Ie + ee.length) !== ee && Ie < K.length; ) { - if (K[Ie] === "'") - for (Ie++; Ie < K.length && K[Ie] !== "'"; ) - Ie++; - else if (K[Ie] === '"') - for (Ie++; Ie < K.length && K[Ie] !== '"'; ) - Ie++; - Ie++; + function s(j, ee) { + for (var ge = [], ye = 0, $e = 0; $e < j.length; ) { + for (; j.substring($e, $e + ee.length) !== ee && $e < j.length; ) { + if (j[$e] === "'") + for ($e++; $e < j.length && j[$e] !== "'"; ) + $e++; + else if (j[$e] === '"') + for ($e++; $e < j.length && j[$e] !== '"'; ) + $e++; + $e++; } - de.push(K.substring(ve, Ie)), ve = Ie = Ie + ee.length; + ge.push(j.substring(ye, $e)), ye = $e = $e + ee.length; } - return de; + return ge; } - var o = _.split(/\r?\n|\r/), w = [], p = !1; - for (let K = 0; K < o.length; K++) { - var v = o[K].split("#")[0]; + var o = _.split(/\r?\n|\r/), A = [], p = !1; + for (let j = 0; j < o.length; j++) { + var v = o[j].split("#")[0]; if (p ? v[0] === ";" && (p = !1) : v[0] === ";" && (p = !0), p || v !== "") { if (!p && (v = v.trim(), v[0] === "_")) { var a = v.split(/\s/)[0].indexOf("."); @@ -17475,106 +17475,106 @@ ATOM`, g); ee[a] = "_", v = ee.join(""), v = v.substring(0, a) + "_" + v.substring(a + 1); } } - w.push(v); + A.push(v); } } - for (var l = 0; l < w.length; ) { - for (; !w[l].startsWith("data_") || w[l] === "data_global"; ) + for (var l = 0; l < A.length; ) { + for (; !A[l].startsWith("data_") || A[l] === "data_global"; ) l++; l++; - for (var g = {}; l < w.length && !w[l].startsWith("data_"); ) - if (w[l][0] === void 0) + for (var g = {}; l < A.length && !A[l].startsWith("data_"); ) + if (A[l][0] === void 0) l++; - else if (w[l][0] === "_") { - var M = w[l].split(/\s/)[0].toLowerCase(), L = g[M] = g[M] || [], T = w[l].substring(w[l].indexOf(M) + M.length); + else if (A[l][0] === "_") { + var M = A[l].split(/\s/)[0].toLowerCase(), C = g[M] = g[M] || [], T = A[l].substring(A[l].indexOf(M) + M.length); if (T === "") - if (l++, w[l][0] === ";") { - var D = w[l].substring(1); - for (l++; w[l] !== ";"; ) + if (l++, A[l][0] === ";") { + var D = A[l].substring(1); + for (l++; A[l] !== ";"; ) D = D + ` -` + w[l], l++; - L.push(D); +` + A[l], l++; + C.push(D); } else - L.push(w[l]); + C.push(A[l]); else - L.push(T.trim()); + C.push(T.trim()); l++; - } else if (w[l].substring(0, 5) === "loop_") { + } else if (A[l].substring(0, 5) === "loop_") { l++; - for (var I = []; w[l] === "" || w[l][0] === "_"; ) { - if (w[l] !== "") { - let K = w[l].split(/\s/)[0].toLowerCase(), ee = g[K] = g[K] || []; + for (var I = []; A[l] === "" || A[l][0] === "_"; ) { + if (A[l] !== "") { + let j = A[l].split(/\s/)[0].toLowerCase(), ee = g[j] = g[j] || []; I.push(ee); } l++; } - for (var z = 0; l < w.length && w[l][0] !== "_" && !w[l].startsWith("loop_") && !w[l].startsWith("data_"); ) { - let K = s(w[l], " "); - for (var P = 0; P < K.length; P++) - K[P] !== "" && (I[z].push(K[P]), z = (z + 1) % I.length); + for (var B = 0; l < A.length && A[l][0] !== "_" && !A[l].startsWith("loop_") && !A[l].startsWith("data_"); ) { + let j = s(A[l], " "); + for (var P = 0; P < j.length; P++) + j[P] !== "" && (I[B].push(j[P]), B = (B + 1) % I.length); l++; } } else l++; - b.push({ symmetries: [] }), c.push([]); - var B = g._atom_site_id !== void 0 ? g._atom_site_id.length : g._atom_site_label.length, k; + y.push({ symmetries: [] }), c.push([]); + var z = g._atom_site_id !== void 0 ? g._atom_site_id.length : g._atom_site_label.length, k; if (g._cell_length_a !== void 0) { - var N = parseFloat(g._cell_length_a), $ = parseFloat(g._cell_length_b), F = parseFloat(g._cell_length_c), G = parseFloat(g._cell_angle_alpha) || 90, H = parseFloat(g._cell_angle_beta) || 90, U = parseFloat(g._cell_angle_gamma) || 90; - k = (0, y.conversionMatrix3)(N, $, F, G, H, U), b[b.length - 1].cryst = { + var N = parseFloat(g._cell_length_a), R = parseFloat(g._cell_length_b), U = parseFloat(g._cell_length_c), W = parseFloat(g._cell_angle_alpha) || 90, G = parseFloat(g._cell_angle_beta) || 90, F = parseFloat(g._cell_angle_gamma) || 90; + k = (0, b.conversionMatrix3)(N, R, U, W, G, F), y[y.length - 1].cryst = { a: N, - b: $, - c: F, - alpha: G, - beta: H, - gamma: U + b: R, + c: U, + alpha: W, + beta: G, + gamma: F }; } - for (var V = 0; V < B; V++) + for (var V = 0; V < z; V++) if (!(g._atom_site_group_pdb !== void 0 && g._atom_site_group_pdb[V] === "TER")) { - var Q = {}; + var J = {}; if (g._atom_site_cartn_x !== void 0) - Q.x = parseFloat(g._atom_site_cartn_x[V]), Q.y = parseFloat(g._atom_site_cartn_y[V]), Q.z = parseFloat(g._atom_site_cartn_z[V]); + J.x = parseFloat(g._atom_site_cartn_x[V]), J.y = parseFloat(g._atom_site_cartn_y[V]), J.z = parseFloat(g._atom_site_cartn_z[V]); else { - var ae = S(k, parseFloat(g._atom_site_fract_x[V]), parseFloat(g._atom_site_fract_y[V]), parseFloat(g._atom_site_fract_z[V])); - Q.x = ae.x, Q.y = ae.y, Q.z = ae.z; + var X = L(k, parseFloat(g._atom_site_fract_x[V]), parseFloat(g._atom_site_fract_y[V]), parseFloat(g._atom_site_fract_z[V])); + J.x = X.x, J.y = X.y, J.z = X.z; } - Q.chain = g._atom_site_auth_asym_id ? g._atom_site_auth_asym_id[V] : void 0, Q.resi = g._atom_site_auth_seq_id ? parseInt(g._atom_site_auth_seq_id[V]) : void 0, Q.resn = g._atom_site_auth_comp_id ? g._atom_site_auth_comp_id[V].trim() : void 0, Q.atom = g._atom_site_auth_atom_id ? g._atom_site_auth_atom_id[V].replace(/"/gm, "") : void 0, Q.hetflag = !g._atom_site_group_pdb || g._atom_site_group_pdb[V] === "HETA" || g._atom_site_group_pdb[V] === "HETATM"; + J.chain = g._atom_site_auth_asym_id ? g._atom_site_auth_asym_id[V] : void 0, J.resi = g._atom_site_auth_seq_id ? parseInt(g._atom_site_auth_seq_id[V]) : void 0, J.resn = g._atom_site_auth_comp_id ? g._atom_site_auth_comp_id[V].trim() : void 0, J.atom = g._atom_site_auth_atom_id ? g._atom_site_auth_atom_id[V].replace(/"/gm, "") : void 0, J.hetflag = !g._atom_site_group_pdb || g._atom_site_group_pdb[V] === "HETA" || g._atom_site_group_pdb[V] === "HETATM"; var oe = "X"; - g._atom_site_type_symbol ? oe = g._atom_site_type_symbol[V].replace(/\(?\+?\d+.*/, "") : g._atom_site_label && (oe = g._atom_site_label[V].split("_")[0].replace(/\(?\d+.*/, "")), Q.elem = oe[0].toUpperCase() + oe.substring(1, 2).toLowerCase(), Q.bonds = [], Q.ss = "c", Q.serial = V, Q.bondOrder = [], Q.properties = {}, c[c.length - 1].push(Q); + g._atom_site_type_symbol ? oe = g._atom_site_type_symbol[V].replace(/\(?\+?\d+.*/, "") : g._atom_site_label && (oe = g._atom_site_label[V].split("_")[0].replace(/\(?\d+.*/, "")), J.elem = oe[0].toUpperCase() + oe.substring(1, 2).toLowerCase(), J.bonds = [], J.ss = "c", J.serial = V, J.bondOrder = [], J.properties = {}, c[c.length - 1].push(J); } - if (g._pdbx_struct_oper_list_id !== void 0 && !C) - for (let K = 0; K < g._pdbx_struct_oper_list_id.length; K++) { - var q = parseFloat(g["_pdbx_struct_oper_list_matrix[1][1]"][K]), me = parseFloat(g["_pdbx_struct_oper_list_matrix[1][2]"][K]), ne = parseFloat(g["_pdbx_struct_oper_list_matrix[1][3]"][K]), fe = parseFloat(g["_pdbx_struct_oper_list_vector[1]"][K]), Ce = parseFloat(g["_pdbx_struct_oper_list_matrix[2][1]"][K]), Me = parseFloat(g["_pdbx_struct_oper_list_matrix[2][2]"][K]), Te = parseFloat(g["_pdbx_struct_oper_list_matrix[2][3]"][K]), se = parseFloat(g["_pdbx_struct_oper_list_vector[2]"][K]), pe = parseFloat(g["_pdbx_struct_oper_list_matrix[3][1]"][K]), we = parseFloat(g["_pdbx_struct_oper_list_matrix[3][2]"][K]), Fe = parseFloat(g["_pdbx_struct_oper_list_matrix[3][3]"][K]), Ue = parseFloat(g["_pdbx_struct_oper_list_vector[3]"][K]), Ne = new y.Matrix4(q, me, ne, fe, Ce, Me, Te, se, pe, we, Fe, Ue); - b[b.length - 1].symmetries.push(Ne); + if (g._pdbx_struct_oper_list_id !== void 0 && !S) + for (let j = 0; j < g._pdbx_struct_oper_list_id.length; j++) { + var te = parseFloat(g["_pdbx_struct_oper_list_matrix[1][1]"][j]), ve = parseFloat(g["_pdbx_struct_oper_list_matrix[1][2]"][j]), se = parseFloat(g["_pdbx_struct_oper_list_matrix[1][3]"][j]), le = parseFloat(g["_pdbx_struct_oper_list_vector[1]"][j]), Ce = parseFloat(g["_pdbx_struct_oper_list_matrix[2][1]"][j]), be = parseFloat(g["_pdbx_struct_oper_list_matrix[2][2]"][j]), Le = parseFloat(g["_pdbx_struct_oper_list_matrix[2][3]"][j]), ae = parseFloat(g["_pdbx_struct_oper_list_vector[2]"][j]), _e = parseFloat(g["_pdbx_struct_oper_list_matrix[3][1]"][j]), Ee = parseFloat(g["_pdbx_struct_oper_list_matrix[3][2]"][j]), Be = parseFloat(g["_pdbx_struct_oper_list_matrix[3][3]"][j]), Ne = parseFloat(g["_pdbx_struct_oper_list_vector[3]"][j]), Ge = new b.Matrix4(te, ve, se, le, Ce, be, Le, ae, _e, Ee, Be, Ne); + y[y.length - 1].symmetries.push(Ge); } - var Be = function(K) { - var ee = K.match("-"); - K = K.replace(/[-xyz]/g, ""); - var de = K.split("/"), ve, Ie; - return de[1] === void 0 ? Ie = 1 : Ie = parseInt(de[1]), de[0] === "" ? ve = 1 : ve = parseInt(de[0]), ve / Ie * (ee ? -1 : 1); + var ke = function(j) { + var ee = j.match("-"); + j = j.replace(/[-xyz]/g, ""); + var ge = j.split("/"), ye, $e; + return ge[1] === void 0 ? $e = 1 : $e = parseInt(ge[1]), ge[0] === "" ? ye = 1 : ye = parseInt(ge[0]), ye / $e * (ee ? -1 : 1); }; - if (g._symmetry_equiv_pos_as_xyz !== void 0 && !C) - for (var ue = 0; ue < g._symmetry_equiv_pos_as_xyz.length; ue++) { - var ye = g._symmetry_equiv_pos_as_xyz[ue].replace(/["' ]/g, ""), ge = ye.split(",").map(function(ee) { + if (g._symmetry_equiv_pos_as_xyz !== void 0 && !S) + for (var pe = 0; pe < g._symmetry_equiv_pos_as_xyz.length; pe++) { + var de = g._symmetry_equiv_pos_as_xyz[pe].replace(/["' ]/g, ""), ce = de.split(",").map(function(ee) { return ee.replace(/-/g, "+-"); }); - let K = new y.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + let j = new b.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); for (let ee = 0; ee < 3; ee++) { - var Se = ge[ee].split("+"); - for (let de = 0; de < Se.length; de++) { - var ze = Se[de]; - if (ze !== "") { - var He = Be(ze); - ze.match("x") ? K.elements[ee + 0] = He : ze.match("y") ? K.elements[ee + 4] = He : ze.match("z") ? K.elements[ee + 8] = He : K.elements[ee + 12] = He; + var Ae = ce[ee].split("+"); + for (let ge = 0; ge < Ae.length; ge++) { + var Oe = Ae[ge]; + if (Oe !== "") { + var We = ke(Oe); + Oe.match("x") ? j.elements[ee + 0] = We : Oe.match("y") ? j.elements[ee + 4] = We : Oe.match("z") ? j.elements[ee + 8] = We : j.elements[ee + 12] = We; } } } - var We = k.getMatrix4(), Y = new y.Matrix4().getInverse(We, !0); - K = new y.Matrix4().multiplyMatrices(K, Y), K = new y.Matrix4().multiplyMatrices(We, K), b[b.length - 1].symmetries.push(K); + var Ue = k.getMatrix4(), Z = new b.Matrix4().getInverse(Ue, !0); + j = new b.Matrix4().multiplyMatrices(j, Z), j = new b.Matrix4().multiplyMatrices(Ue, j), y[y.length - 1].symmetries.push(j); } } - for (let K = 0; K < c.length; K++) - A && (0, n.assignBonds)(c[K]), (0, f.computeSecondaryStructure)(c[K], E.hbondCutoff), (0, u.processSymmetries)(b[K].symmetries, c[K], E, b[K].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && A && (0, n.assignBonds)(c[K]); + for (let j = 0; j < c.length; j++) + w && (0, n.assignBonds)(c[j]), (0, f.computeSecondaryStructure)(c[j], E.hbondCutoff), (0, u.processSymmetries)(y[j].symmetries, c[j], E, y[j].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && w && (0, n.assignBonds)(c[j]); return c; } } @@ -17585,54 +17585,54 @@ ATOM`, g); !*** ./src/parsers/CUBE.ts ***! \*****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ CUBE: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ../WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" - ), u = t( + ), u = r( /*! ./utils/anumToSymbol */ "./src/parsers/utils/anumToSymbol.ts" ); - function y(h, _) { + function b(h, _) { _ = _ || {}; - var E = [[]], c = h.split(/\r?\n/), C = _.assignBonds === void 0 ? !0 : _.assignBonds; + var E = [[]], c = h.split(/\r?\n/), S = _.assignBonds === void 0 ? !0 : _.assignBonds; if (c.length < 6) return E; - var b = c[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), A = Math.abs(parseFloat(b[0])); - let S = {}; - var s = S.origin = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])); - b = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), b = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var o = b[0] > 0 ? 0.529177 : 1; + var y = c[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), w = Math.abs(parseFloat(y[0])); + let L = {}; + var s = L.origin = new n.Vector3(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])); + y = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), y = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var o = y[0] > 0 ? 0.529177 : 1; s.multiplyScalar(o); - var w = Math.abs(b[0]), p = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); - b = c[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var v = Math.abs(b[0]), a = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); - b = c[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var l = Math.abs(b[0]), g = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); - if (S.size = { x: w, y: v, z: l }, S.unit = new n.Vector3(p.x, a.y, g.z), p.y != 0 || p.z != 0 || a.x != 0 || a.z != 0 || g.x != 0 || g.y != 0) { - S.matrix4 = new n.Matrix4(p.x, a.x, g.x, 0, p.y, a.y, g.y, 0, p.z, a.z, g.z, 0, 0, 0, 0, 1); + var A = Math.abs(y[0]), p = new n.Vector3(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])).multiplyScalar(o); + y = c[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var v = Math.abs(y[0]), a = new n.Vector3(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])).multiplyScalar(o); + y = c[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var l = Math.abs(y[0]), g = new n.Vector3(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])).multiplyScalar(o); + if (L.size = { x: A, y: v, z: l }, L.unit = new n.Vector3(p.x, a.y, g.z), p.y != 0 || p.z != 0 || a.x != 0 || a.z != 0 || g.x != 0 || g.y != 0) { + L.matrix4 = new n.Matrix4(p.x, a.x, g.x, 0, p.y, a.y, g.y, 0, p.z, a.z, g.z, 0, 0, 0, 0, 1); let P = new n.Matrix4().makeTranslation(s.x, s.y, s.z); - S.matrix4 = S.matrix4.multiplyMatrices(P, S.matrix4), S.matrix = S.matrix4.matrix3FromTopLeft(), S.origin = new n.Vector3(0, 0, 0), S.unit = new n.Vector3(1, 1, 1); + L.matrix4 = L.matrix4.multiplyMatrices(P, L.matrix4), L.matrix = L.matrix4.matrix3FromTopLeft(), L.origin = new n.Vector3(0, 0, 0), L.unit = new n.Vector3(1, 1, 1); } - E.modelData = [{ cryst: S }], c = c.splice(6, A); - for (var M = E[E.length - 1].length, L = M + c.length, T = M; T < L; ++T) { + E.modelData = [{ cryst: L }], c = c.splice(6, w); + for (var M = E[E.length - 1].length, C = M + c.length, T = M; T < C; ++T) { var D = {}; D.serial = T; - var I = c[T - M], z = I.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - D.elem = u.anumToSymbol[z[0]], D.x = parseFloat(z[2]) * o, D.y = parseFloat(z[3]) * o, D.z = parseFloat(z[4]) * o, D.hetflag = !0, D.bonds = [], D.bondOrder = [], D.properties = {}, E[E.length - 1].push(D); + var I = c[T - M], B = I.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + D.elem = u.anumToSymbol[B[0]], D.x = parseFloat(B[2]) * o, D.y = parseFloat(B[3]) * o, D.z = parseFloat(B[4]) * o, D.hetflag = !0, D.bonds = [], D.bondOrder = [], D.properties = {}, E[E.length - 1].push(D); } - if (C) + if (S) for (let P = 0; P < E.length; P++) (0, f.assignBonds)(E[P]); return E; @@ -17645,8 +17645,8 @@ ATOM`, g); !*** ./src/parsers/GRO.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ GRO: () => ( /* binding */ @@ -17654,33 +17654,33 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" - ), f = t( + ), f = r( /*! ./utils/atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" ); - function u(y) { - for (var h = [], _ = y.split(/\r?\n|\r/); _.length > 0 && !(_.length < 3); ) { + function u(b) { + for (var h = [], _ = b.split(/\r?\n|\r/); _.length > 0 && !(_.length < 3); ) { var E = parseInt(_[1]); if (isNaN(E) || E <= 0 || _.length < E + 3) break; var c = []; h.push(c); - for (var C = 2, b = c.length, A = b + E, S = b; S < A; S++) { - var s = _[C++], o = {}; - o.serial = S, o.atom = s.slice(10, 15).trim(), o.elem = (0, f.atomNameToElem)(o.atom, !0), o.x = 10 * parseFloat(s.slice(20, 28)), o.y = 10 * parseFloat(s.slice(28, 36)), o.z = 10 * parseFloat(s.slice(36, 44)), o.resi = parseInt(s.slice(0, 5)), o.resn = s.slice(5, 10).trim(), o.bonds = [], o.bondOrder = [], o.properties = {}, s.length > 44 && (o.dx = 10 * parseFloat(s.slice(44, 52)), o.dy = 10 * parseFloat(s.slice(52, 60)), o.dz = 10 * parseFloat(s.slice(60, 68))), c[S] = o; + for (var S = 2, y = c.length, w = y + E, L = y; L < w; L++) { + var s = _[S++], o = {}; + o.serial = L, o.atom = s.slice(10, 15).trim(), o.elem = (0, f.atomNameToElem)(o.atom, !0), o.x = 10 * parseFloat(s.slice(20, 28)), o.y = 10 * parseFloat(s.slice(28, 36)), o.z = 10 * parseFloat(s.slice(36, 44)), o.resi = parseInt(s.slice(0, 5)), o.resn = s.slice(5, 10).trim(), o.bonds = [], o.bondOrder = [], o.properties = {}, s.length > 44 && (o.dx = 10 * parseFloat(s.slice(44, 52)), o.dy = 10 * parseFloat(s.slice(52, 60)), o.dz = 10 * parseFloat(s.slice(60, 68))), c[L] = o; } - if (_.length <= C + 3) { - var w = _[C++], p = w.trim().split(/\s+/); + if (_.length <= S + 3) { + var A = _[S++], p = A.trim().split(/\s+/); if (p.length == 3) { for (var v = 0; v < 3; v++) p[v] = parseFloat(p[v]) * 10; h.box = p; } } - _.splice(0, ++C); + _.splice(0, ++S); } for (let a = 0; a < h.length; a++) (0, n.assignPDBBonds)(h[a]); @@ -17694,8 +17694,8 @@ ATOM`, g); !*** ./src/parsers/LAMMPSTRJ.ts ***! \**********************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ LAMMPSTRJ: () => ( /* binding */ @@ -17703,11 +17703,11 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function f(u, y) { + function f(u, b) { for (var h = [], _ = { id: "serial", type: "atom", @@ -17726,24 +17726,24 @@ ATOM`, g); zu: "z", zs: "z", zsu: "z" - }, E = u.split(/\r?\n|\r/), c = 0, C = 0, b = 0; b < E.length - 9; ) { - for (var A = b; A < E.length; A++) - if (E[A].match(/ITEM: NUMBER OF ATOMS/) && (C = parseInt(E[A + 1])), E[A].match(/ITEM: ATOMS/)) { - c = A + 1; + }, E = u.split(/\r?\n|\r/), c = 0, S = 0, y = 0; y < E.length - 9; ) { + for (var w = y; w < E.length; w++) + if (E[w].match(/ITEM: NUMBER OF ATOMS/) && (S = parseInt(E[w + 1])), E[w].match(/ITEM: ATOMS/)) { + c = w + 1; break; } - var S = E[c - 1].replace("ITEM: ATOMS ", "").split(" "); + var L = E[c - 1].replace("ITEM: ATOMS ", "").split(" "); h.push([]); - for (let l = c; l < c + C; l++) { - for (var s = {}, o = {}, w = E[l].split(" "), p = 0; p < w.length; p++) { - var v = _[S[p]]; - v != null && (v == "serial" ? s[v] = parseInt(w[p]) : v == "x" || v == "y" || v === "z" ? s[v] = parseFloat(w[p]) : v == "charge" || v == "radius" ? o[v] = parseFloat(w[p]) : s[v] = w[p]), s.properties = o, s.bonds = [], s.bondOrder = []; + for (let l = c; l < c + S; l++) { + for (var s = {}, o = {}, A = E[l].split(" "), p = 0; p < A.length; p++) { + var v = _[L[p]]; + v != null && (v == "serial" ? s[v] = parseInt(A[p]) : v == "x" || v == "y" || v === "z" ? s[v] = parseFloat(A[p]) : v == "charge" || v == "radius" ? o[v] = parseFloat(A[p]) : s[v] = A[p]), s.properties = o, s.bonds = [], s.bondOrder = []; } h[h.length - 1][l - c] = s; } - b = c + C - 1; + y = c + S - 1; } - if (y.assignBonds) + if (b.assignBonds) for (var a = 0; a < h.length; a++) (0, n.assignBonds)(h[a]); return h; @@ -17756,34 +17756,34 @@ ATOM`, g); !*** ./src/parsers/MMTF.ts ***! \*****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MMTFparser: () => ( /* binding */ - C + S ) /* harmony export */ }); - var n = t( + var n = r( /*! ../utilities */ "./src/utilities.ts" - ), f = t( + ), f = r( /*! ../WebGL */ "./src/WebGL/index.ts" - ), u = t( + ), u = r( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), y = t( + ), b = r( /*! ./utils/processSymmetries */ "./src/parsers/utils/processSymmetries.ts" - ), h = t( + ), h = r( /*! ./src/vendor/mmtf.js */ "./src/vendor/mmtf.js" - ), _ = function(b) { - return String.fromCharCode.apply(null, b).replace(/\0/g, ""); - }, E = function(b) { - return b == 0 || b == 2 || b == 4 ? "h" : b == 3 ? "s" : "c"; + ), _ = function(y) { + return String.fromCharCode.apply(null, y).replace(/\0/g, ""); + }, E = function(y) { + return y == 0 || y == 2 || y == 4 ? "h" : y == 3 ? "s" : "c"; }; let c = /* @__PURE__ */ new Set([ "D-SACCHARIDE", @@ -17797,124 +17797,124 @@ ATOM`, g); "PEPTIDE-LIKE", "SACCHARIDE" ]); - function C(b, A) { - var S = !A.keepH, s = A.altLoc ? A.altLoc : "A", o = !!A.noSecondaryStructure, w = !A.noComputeSecondaryStructure, p = !A.doAssembly, v = A.assemblyIndex ? A.assemblyIndex : 0; - typeof b == "string" ? b = (0, n.base64ToArray)(b) : b = new Uint8Array(b); - var a = h.decode(b), l = [[]], g = l.modelData = [], M = 0, L = 0, T = 0, D = a.secStructList, I = a.bFactorList, z = a.altLocList, P = a.occupancyList, B = a.bondAtomList, k = a.bondOrderList, N = a.numModels; + function S(y, w) { + var L = !w.keepH, s = w.altLoc ? w.altLoc : "A", o = !!w.noSecondaryStructure, A = !w.noComputeSecondaryStructure, p = !w.doAssembly, v = w.assemblyIndex ? w.assemblyIndex : 0; + typeof y == "string" ? y = (0, n.base64ToArray)(y) : y = new Uint8Array(y); + var a = h.decode(y), l = [[]], g = l.modelData = [], M = 0, C = 0, T = 0, D = a.secStructList, I = a.bFactorList, B = a.altLocList, P = a.occupancyList, z = a.bondAtomList, k = a.bondOrderList, N = a.numModels; if (N == 0) return l; - A.multimodel || (N = 1); - var $, F, G, H, U, V, Q = []; + w.multimodel || (N = 1); + var R, U, W, G, F, V, J = []; if (!p && a.bioAssemblyList && a.bioAssemblyList.length > 0) { - var ae = a.bioAssemblyList[v].transformList; - for ($ = 0, V = ae.length; $ < V; $++) { - var oe = new f.Matrix4(ae[$].matrix); - oe.transpose(), Q.push(oe); + var X = a.bioAssemblyList[v].transformList; + for (R = 0, V = X.length; R < V; R++) { + var oe = new f.Matrix4(X[R].matrix); + oe.transpose(), J.push(oe); } } - var q = null; + var te = null; if (a.unitCell) { - var me = a.unitCell; - q = { a: me[0], b: me[1], c: me[2], alpha: me[3], beta: me[4], gamma: me[5] }; + var ve = a.unitCell; + te = { a: ve[0], b: ve[1], c: ve[2], alpha: ve[3], beta: ve[4], gamma: ve[5] }; } - let ne = []; - a.entityList.forEach((Ee) => { - Ee.chainIndexList.forEach((X) => { - ne[X] = Ee.type == "polymer"; + let se = []; + a.entityList.forEach((Me) => { + Me.chainIndexList.forEach((Q) => { + se[Q] = Me.type == "polymer"; }); }); - var fe = 0; - for (U = 0; U < N; U++) { - var Ce = a.chainsPerModel[U], Me = l[l.length - 1], Te = []; - for (g.push({ symmetries: Q, cryst: q }), $ = 0; $ < Ce; ++$) { - var se = a.groupsPerChain[M], pe = _(a.chainIdList.subarray(M * 4, M * 4 + 4)); - a.chainNameList && (pe = _(a.chainNameList.subarray(M * 4, M * 4 + 4))); - var we = L, Fe = ""; - for (F = 0; F < se; ++F) { - var Ue = a.groupList[a.groupTypeList[L]], Ne = Ue.atomNameList.length, Be = 0, ue = !1, ye = !1; + var le = 0; + for (F = 0; F < N; F++) { + var Ce = a.chainsPerModel[F], be = l[l.length - 1], Le = []; + for (g.push({ symmetries: J, cryst: te }), R = 0; R < Ce; ++R) { + var ae = a.groupsPerChain[M], _e = _(a.chainIdList.subarray(M * 4, M * 4 + 4)); + a.chainNameList && (_e = _(a.chainNameList.subarray(M * 4, M * 4 + 4))); + var Ee = C, Be = ""; + for (U = 0; U < ae; ++U) { + var Ne = a.groupList[a.groupTypeList[C]], Ge = Ne.atomNameList.length, ke = 0, pe = !1, de = !1; if (D) { - Be = D[L]; - var ge = E(Be); - (L == 0 || ge != Fe) && (ue = !0), Fe = ge; - var Se = L + 1; - (Se >= D.length || E(D[Se] != ge)) && (ye = !0); + ke = D[C]; + var ce = E(ke); + (C == 0 || ce != Be) && (pe = !0), Be = ce; + var Ae = C + 1; + (Ae >= D.length || E(D[Ae] != ce)) && (de = !0); } - var ze = a.groupIdList[L], He = Ue.groupName; - let Ee = Ue.chemCompType; - var We = T; - let X = c.has(Ee) || !ne[M]; - for (G = 0; G < Ne; ++G) { - var Y = Ue.elementList[G]; - if (S && Y == "H") { + var Oe = a.groupIdList[C], We = Ne.groupName; + let Me = Ne.chemCompType; + var Ue = T; + let Q = c.has(Me) || !se[M]; + for (W = 0; W < Ge; ++W) { + var Z = Ne.elementList[W]; + if (L && Z == "H") { T += 1; continue; } - var K = ""; - I && (K = I[T]); + var j = ""; + I && (j = I[T]); var ee = ""; - z && z[T] && (ee = String.fromCharCode(z[T])); - var de = ""; - if (P && (de = P[T]), ee != "" && ee != s && s != "*") { + B && B[T] && (ee = String.fromCharCode(B[T])); + var ge = ""; + if (P && (ge = P[T]), ee != "" && ee != s && s != "*") { T += 1; continue; } - var ve = a.atomIdList[T], Ie = Ue.atomNameList[G], Re = 0; - Ue.atomChargeList && (Re = Ue.atomChargeList[G]); - var Z = a.xCoordList[T], ce = a.yCoordList[T], Ae = a.zCoordList[T]; - Te[T] = Me.length, Me.push({ - resn: He, - x: Z, - y: ce, - z: Ae, - elem: Y, - hetflag: X, - chain: pe, - resi: ze, + var ye = a.atomIdList[T], $e = Ne.atomNameList[W], Re = 0; + Ne.atomChargeList && (Re = Ne.atomChargeList[W]); + var Y = a.xCoordList[T], ue = a.yCoordList[T], Se = a.zCoordList[T]; + Le[T] = be.length, be.push({ + resn: We, + x: Y, + y: ue, + z: Se, + elem: Z, + hetflag: Q, + chain: _e, + resi: Oe, icode: ee, - rescode: ze + (ee != " " ? "^" + ee : ""), + rescode: Oe + (ee != " " ? "^" + ee : ""), // resi // and // icode - serial: ve, + serial: ye, altLoc: ee, index: T, - atom: Ie, + atom: $e, bonds: [], - ss: E(Be), - ssbegin: ue, - ssend: ye, + ss: E(ke), + ssbegin: pe, + ssend: de, bondOrder: [], - properties: { charge: Re, occupancy: de }, - b: K + properties: { charge: Re, occupancy: ge }, + b: j }), T += 1; } - var ke = Ue.bondAtomList; - for (G = 0, H = Ue.bondOrderList.length; G < H; ++G) { - var he = We + ke[G * 2], Oe = We + ke[G * 2 + 1], j = Ue.bondOrderList[G], $e = Te[he], Ve = Te[Oe], R = Me[$e], be = Me[Ve]; - R && be && (R.bonds.push(Ve), R.bondOrder.push(j), be.bonds.push($e), be.bondOrder.push(j)); + var Fe = Ne.bondAtomList; + for (W = 0, G = Ne.bondOrderList.length; W < G; ++W) { + var he = Ue + Fe[W * 2], De = Ue + Fe[W * 2 + 1], K = Ne.bondOrderList[W], ze = Le[he], Ve = Le[De], $ = be[ze], xe = be[Ve]; + $ && xe && ($.bonds.push(Ve), $.bondOrder.push(K), xe.bonds.push(ze), xe.bondOrder.push(K)); } - L += 1; + C += 1; } - for (L = we, F = 0; F < se; ++F) - L += 1; + for (C = Ee, U = 0; U < ae; ++U) + C += 1; M += 1; } - if (B) - for (let Ee = fe, X = B.length; Ee < X; Ee += 2) { - let le = B[Ee], Le = B[Ee + 1], Ze = k ? k[Ee / 2] : 1; - if (le >= T) { - fe = Ee; + if (z) + for (let Me = le, Q = z.length; Me < Q; Me += 2) { + let fe = z[Me], Te = z[Me + 1], Ze = k ? k[Me / 2] : 1; + if (fe >= T) { + le = Me; break; } - let Ke = Te[le], je = Te[Le], Je = Me[Ke], Lt = Me[je]; - Je && Lt && (Je.bonds.push(je), Je.bondOrder.push(Ze), Lt.bonds.push(Ke), Lt.bondOrder.push(Ze)); + let Ke = Le[fe], je = Le[Te], Je = be[Ke], St = be[je]; + Je && St && (Je.bonds.push(je), Je.bondOrder.push(Ze), St.bonds.push(Ke), St.bondOrder.push(Ze)); } - A.multimodel && (A.onemol || l.push([])); + w.multimodel && (w.onemol || l.push([])); } if (!p) - for (let Ee = 0; Ee < l.length; Ee++) - (0, y.processSymmetries)(g[Ee].symmetries, l[Ee], A, g[Ee].cryst); - return w && !o && (0, u.computeSecondaryStructure)(l, A.hbondCutoff), l; + for (let Me = 0; Me < l.length; Me++) + (0, b.processSymmetries)(g[Me].symmetries, l[Me], w, g[Me].cryst); + return A && !o && (0, u.computeSecondaryStructure)(l, w.hbondCutoff), l; } } ), @@ -17924,8 +17924,8 @@ ATOM`, g); !*** ./src/parsers/MOL2.ts ***! \*****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ MOL2: () => ( /* binding */ @@ -17983,48 +17983,48 @@ ATOM`, g); "S.o2": "S", So2: "S" }; - function f(u, y) { + function f(u, b) { var h = [[]], _ = !1; - typeof y.keepH < "u" && (_ = !y.keepH); + typeof b.keepH < "u" && (_ = !b.keepH); var E = u.search(/@MOLECULE/), c = u.search(/@ATOM/); if (E == -1 || c == -1) return h; - for (var C = u.substring(E).split(/\r?\n|\r/); C.length > 0; ) { - var b = [], A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseInt(A[0]), s = 0; - A.length > 1 && (s = parseInt(A[1])); - var o = 4, w; - for (w = 3; w < C.length; w++) - if (C[w] == "@ATOM") { - o = w + 1; + for (var S = u.substring(E).split(/\r?\n|\r/); S.length > 0; ) { + var y = [], w = S[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), L = parseInt(w[0]), s = 0; + w.length > 1 && (s = parseInt(w[1])); + var o = 4, A; + for (A = 3; A < S.length; A++) + if (S[A] == "@ATOM") { + o = A + 1; break; } - var p = h[h.length - 1].length, v = p + S, a; - for (w = p; w < v; w++) { - a = C[o++], A = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var l = {}, g = A[5]; - if (n[g] !== void 0 ? g = n[g] : (g = g.split(".")[0], g = g[0].toUpperCase() + g.substring(1).toLowerCase()), l.atom = A[1], l.elem = g, !(l.elem == "H" && _)) { - var M = h[h.length - 1].length, L = parseInt(A[0]); - l.serial = L, l.x = parseFloat(A[2]), l.y = parseFloat(A[3]), l.z = parseFloat(A[4]), l.atom = A[5]; - var T = parseFloat(A[8]); + var p = h[h.length - 1].length, v = p + L, a; + for (A = p; A < v; A++) { + a = S[o++], w = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var l = {}, g = w[5]; + if (n[g] !== void 0 ? g = n[g] : (g = g.split(".")[0], g = g[0].toUpperCase() + g.substring(1).toLowerCase()), l.atom = w[1], l.elem = g, !(l.elem == "H" && _)) { + var M = h[h.length - 1].length, C = parseInt(w[0]); + l.serial = C, l.x = parseFloat(w[2]), l.y = parseFloat(w[3]), l.z = parseFloat(w[4]), l.atom = w[5]; + var T = parseFloat(w[8]); l.index = M, l.bonds = [], l.bondOrder = [], l.properties = { charge: T, partialCharge: T - }, b[L] = M, h[h.length - 1].push(l); + }, y[C] = M, h[h.length - 1].push(l); } } - for (var D = !1; o < C.length; ) - if (C[o++] == "@BOND") { + for (var D = !1; o < S.length; ) + if (S[o++] == "@BOND") { D = !0; break; } if (D && s) - for (w = 0; w < s; w++) { - a = C[o++], A = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var I = parseInt(A[1]), z = h[h.length - 1][b[I]], P = parseInt(A[2]), B = h[h.length - 1][b[P]], k = parseInt(A[3]); - isNaN(k) && (k = 1), z !== void 0 && B !== void 0 && (z.bonds.push(b[P]), z.bondOrder.push(k), B.bonds.push(b[I]), B.bondOrder.push(k)); + for (A = 0; A < s; A++) { + a = S[o++], w = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var I = parseInt(w[1]), B = h[h.length - 1][y[I]], P = parseInt(w[2]), z = h[h.length - 1][y[P]], k = parseInt(w[3]); + isNaN(k) && (k = 1), B !== void 0 && z !== void 0 && (B.bonds.push(y[P]), B.bondOrder.push(k), z.bonds.push(y[I]), z.bondOrder.push(k)); } - if (y.multimodel) { - y.onemol || h.push([]), C.splice(0, o), u = C.join(` + if (b.multimodel) { + b.onemol || h.push([]), S.splice(0, o), u = S.join(` `); continue; } else @@ -18040,8 +18040,8 @@ ATOM`, g); !*** ./src/parsers/PDB.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ PDB: () => ( /* binding */ @@ -18049,28 +18049,28 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/getSinglePDB */ "./src/parsers/utils/getSinglePDB.ts" ); - function f(u, y) { - y = y || {}; + function f(u, b) { + b = b || {}; var h = [], _ = {}; h.modelData = []; for (var E = u.split(/\r?\n|\r/); E.length > 0; ) { - var c = (0, n.getSinglePDB)(E, y, _), C = c[0], b = c[1]; - if (E = c[2], C.length != 0) { - if (y.multimodel && y.onemol && h.length > 0) - for (var A = h[0].length, S = 0; S < C.length; S++) { - var s = C[S]; - s.index = S; + var c = (0, n.getSinglePDB)(E, b, _), S = c[0], y = c[1]; + if (E = c[2], S.length != 0) { + if (b.multimodel && b.onemol && h.length > 0) + for (var w = h[0].length, L = 0; L < S.length; L++) { + var s = S[L]; + s.index = L; for (var o = 0; o < s.bonds.length; o++) - s.bonds[o] += A; + s.bonds[o] += w; h[0].push(s); } else - h.modelData.push(b), h.push(C); - if (!y.multimodel) + h.modelData.push(y), h.push(S); + if (!b.multimodel) break; } } @@ -18084,8 +18084,8 @@ ATOM`, g); !*** ./src/parsers/PQR.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ PQR: () => ( /* binding */ @@ -18093,41 +18093,41 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" - ), f = t( + ), f = r( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" ); - function u(y, h) { + function u(b, h) { var _ = [[]], E = !h.noSecondaryStructure; _.modelData = [{ symmetries: [] }]; - var c = [], C = y.split(/\r?\n|\r/), b; - for (let D = 0; D < C.length; D++) { - b = C[D].replace(/^\s*/, ""); - var A = b.substring(0, 6); - if (A.indexOf("END") == 0) + var c = [], S = b.split(/\r?\n|\r/), y; + for (let D = 0; D < S.length; D++) { + y = S[D].replace(/^\s*/, ""); + var w = y.substring(0, 6); + if (w.indexOf("END") == 0) if (h.multimodel) { h.onemol || _.push([]); continue; } else break; - else if (A == "ATOM " || A == "HETATM") { - var S; - let I = parseInt(b.substring(6, 11)), z = b.substring(12, 16).replace(/ /g, ""), P = b.substring(17, 20).trim(), B = b.substring(21, 22), k = parseInt(b.substring(22, 26)); - var s = b.substring(30).trim().split(/\s+/), o = parseFloat(s[0]), w = parseFloat(s[1]), p = parseFloat(s[2]), v = parseFloat(s[3]), a = parseFloat(s[4]), l = z[0]; - z.length > 1 && z[1].toUpperCase() != z[1] && (l = z.substring(0, 2)), b[0] == "H" ? S = !0 : S = !1, c[I] = _[_.length - 1].length, _[_.length - 1].push({ + else if (w == "ATOM " || w == "HETATM") { + var L; + let I = parseInt(y.substring(6, 11)), B = y.substring(12, 16).replace(/ /g, ""), P = y.substring(17, 20).trim(), z = y.substring(21, 22), k = parseInt(y.substring(22, 26)); + var s = y.substring(30).trim().split(/\s+/), o = parseFloat(s[0]), A = parseFloat(s[1]), p = parseFloat(s[2]), v = parseFloat(s[3]), a = parseFloat(s[4]), l = B[0]; + B.length > 1 && B[1].toUpperCase() != B[1] && (l = B.substring(0, 2)), y[0] == "H" ? L = !0 : L = !1, c[I] = _[_.length - 1].length, _[_.length - 1].push({ resn: P, x: o, - y: w, + y: A, z: p, elem: l, - hetflag: S, - chain: B, + hetflag: L, + chain: z, resi: k, serial: I, - atom: z, + atom: B, bonds: [], ss: "c", bondOrder: [], @@ -18136,13 +18136,13 @@ ATOM`, g); partialCharge: v, radius: a }, - pdbline: b + pdbline: y }); - } else if (A == "CONECT") { - var g = parseInt(b.substring(6, 11)), M = _[_.length - 1][c[g]]; + } else if (w == "CONECT") { + var g = parseInt(y.substring(6, 11)), M = _[_.length - 1][c[g]]; for (let I = 0; I < 4; I++) { - var L = parseInt(b.substring([11, 16, 21, 26][I], [11, 16, 21, 26][I] + 5)), T = _[_.length - 1][c[L]]; - M !== void 0 && T !== void 0 && (M.bonds.push(c[L]), M.bondOrder.push(1)); + var C = parseInt(y.substring([11, 16, 21, 26][I], [11, 16, 21, 26][I] + 5)), T = _[_.length - 1][c[C]]; + M !== void 0 && T !== void 0 && (M.bonds.push(c[C]), M.bondOrder.push(1)); } } } @@ -18158,8 +18158,8 @@ ATOM`, g); !*** ./src/parsers/PRMTOP.ts ***! \*******************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ PRMTOP: () => ( /* binding */ @@ -18168,76 +18168,76 @@ ATOM`, g); /* harmony export */ }); function n(f) { - var u = [], y, h = 0, _ = f.split(/\r?\n|\r/); + var u = [], b, h = 0, _ = f.split(/\r?\n|\r/); if (_.length > 0 && _[0].includes("VERSION")) { var E = _.filter(function(o) { return o.includes("POINTERS") || o.includes("ATOM_NAME") || o.includes("CHARGE") || o.includes("RADII") || o.includes("BONDS_INC_HYDROGEN") || o.includes("BONDS_WITHOUT_HYDROGEN"); - }), c = S("POINTERS"); + }), c = L("POINTERS"); if (c == -1) return []; - var C = s(c), b = parseInt(_[c + 1].slice(0, C[1])); - if (isNaN(b) || b <= 0) + var S = s(c), y = parseInt(_[c + 1].slice(0, S[1])); + if (isNaN(y) || y <= 0) return []; - if (c = S("ATOM_NAME"), c == -1) + if (c = L("ATOM_NAME"), c == -1) return []; - C = s(c); - var A = C[0]; - for (let o = 0; o < b / C[0]; o++) { - o == parseInt(b / C[0]) && (A = b % C[0]); - for (let w = 0; w < A; w++) { + S = s(c); + var w = S[0]; + for (let o = 0; o < y / S[0]; o++) { + o == parseInt(y / S[0]) && (w = y % S[0]); + for (let A = 0; A < w; A++) { let p = {}, v = { charge: "", radii: "" }; - p.serial = h, p.x = 0, p.y = 0, p.z = 0, p.atom = _[c + 1].slice(C[1] * w, C[1] * (w + 1)), p.elem = _[c + 1].slice(C[1] * w, C[1] * w + 1), p.properties = v, p.bonds = [], p.bondOrder = [], u.push(p), h++; + p.serial = h, p.x = 0, p.y = 0, p.z = 0, p.atom = _[c + 1].slice(S[1] * A, S[1] * (A + 1)), p.elem = _[c + 1].slice(S[1] * A, S[1] * A + 1), p.properties = v, p.bonds = [], p.bondOrder = [], u.push(p), h++; } c++; } - if (c = S("CHARGE"), c != -1) { - C = s(c), h = 0, A = C[0]; - for (let o = 0; o < b / C[0]; o++) { - o == parseInt(b / C[0]) && (A = b % C[0]); - for (let w = 0; w < A; w++) - u[h].properties.charge = parseFloat(_[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; + if (c = L("CHARGE"), c != -1) { + S = s(c), h = 0, w = S[0]; + for (let o = 0; o < y / S[0]; o++) { + o == parseInt(y / S[0]) && (w = y % S[0]); + for (let A = 0; A < w; A++) + u[h].properties.charge = parseFloat(_[c + 1].slice(S[1] * A, S[1] * (A + 1))), h++; c++; } } - if (c = S("RADII"), c != -1) { - C = s(c), h = 0, A = C[0]; - for (let o = 0; o < b / C[0]; o++) { - o == parseInt(b / C[0]) && (A = b % C[0]); - for (let w = 0; w < A; w++) - u[h].properties.radii = parseFloat(_[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; + if (c = L("RADII"), c != -1) { + S = s(c), h = 0, w = S[0]; + for (let o = 0; o < y / S[0]; o++) { + o == parseInt(y / S[0]) && (w = y % S[0]); + for (let A = 0; A < w; A++) + u[h].properties.radii = parseFloat(_[c + 1].slice(S[1] * A, S[1] * (A + 1))), h++; c++; } } - if (c = S("BONDS_WITHOUT_HYDROGEN"), c != -1) - for (C = s(c), h = 0, A = C[0], c = c + 1; !_[c].match(/^%FLAG/); ) { - _[c + 1].match(/^%FLAG/) && (A = b % C[0]); - for (let o = 0; o < A; o++) - h % 3 == 0 ? y = parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && u[y].bonds.push(parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; + if (c = L("BONDS_WITHOUT_HYDROGEN"), c != -1) + for (S = s(c), h = 0, w = S[0], c = c + 1; !_[c].match(/^%FLAG/); ) { + _[c + 1].match(/^%FLAG/) && (w = y % S[0]); + for (let o = 0; o < w; o++) + h % 3 == 0 ? b = parseInt(_[c].slice(S[1] * o, S[1] * (o + 1)) / 3) : h % 3 == 1 && u[b].bonds.push(parseInt(_[c].slice(S[1] * o, S[1] * (o + 1)) / 3)), h++; c++; } - if (c = S("BONDS_INC_HYDROGEN"), c != -1) - for (C = s(c), h = 0, A = C[0], c = c + 1; !_[c].match(/^%FLAG/); ) { - _[c + 1].match(/^%FLAG/) && (A = b % C[0]); - for (let o = 0; o < A; o++) - h % 3 == 0 ? y = parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && u[y].bonds.push(parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; + if (c = L("BONDS_INC_HYDROGEN"), c != -1) + for (S = s(c), h = 0, w = S[0], c = c + 1; !_[c].match(/^%FLAG/); ) { + _[c + 1].match(/^%FLAG/) && (w = y % S[0]); + for (let o = 0; o < w; o++) + h % 3 == 0 ? b = parseInt(_[c].slice(S[1] * o, S[1] * (o + 1)) / 3) : h % 3 == 1 && u[b].bonds.push(parseInt(_[c].slice(S[1] * o, S[1] * (o + 1)) / 3)), h++; c++; } } else return []; - function S(o) { - var w = _.indexOf(E.filter(function(p) { + function L(o) { + var A = _.indexOf(E.filter(function(p) { return p.includes(o); })[0]); - if (Number.isInteger(w) && w > 0) { - for (; !_[w].includes("FORMAT"); ) - w++; - return w; + if (Number.isInteger(A) && A > 0) { + for (; !_[A].includes("FORMAT"); ) + A++; + return A; } else return -1; } function s(o) { - var w = _[o].match(/\((\d*)\S*/), p = _[o].match(/[a-zA-Z](\d*)\)\s*/); - return p == null && (p = _[o].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [w[1], p[1]]; + var A = _[o].match(/\((\d*)\S*/), p = _[o].match(/[a-zA-Z](\d*)\)\s*/); + return p == null && (p = _[o].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [A[1], p[1]]; } return [u]; } @@ -18249,8 +18249,8 @@ ATOM`, g); !*** ./src/parsers/SDF.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ SDF: () => ( /* binding */ @@ -18258,82 +18258,82 @@ ATOM`, g); ) /* harmony export */ }); - var n = function(y, h) { + var n = function(b, h) { var _ = [[]], E = !1; - for (typeof h.keepH < "u" && (E = !h.keepH); y.length > 0 && !(y.length < 4); ) { - var c = parseInt(y[3].substring(0, 3)); + for (typeof h.keepH < "u" && (E = !h.keepH); b.length > 0 && !(b.length < 4); ) { + var c = parseInt(b[3].substring(0, 3)); if (isNaN(c) || c <= 0) break; - var C = parseInt(y[3].substring(3, 6)), b = 4; - if (y.length < 4 + c + C) + var S = parseInt(b[3].substring(3, 6)), y = 4; + if (b.length < 4 + c + S) break; - var A = [], S = _[_.length - 1].length, s = S + c, o, w; - for (o = S; o < s; o++, b++) { - w = y[b]; - var p = {}, v = w.substring(31, 34).replace(/ /g, ""); - p.atom = p.elem = v[0].toUpperCase() + v.substring(1).toLowerCase(), (p.elem !== "H" || !E) && (p.serial = o, A[o] = _[_.length - 1].length, p.x = parseFloat(w.substring(0, 10)), p.y = parseFloat(w.substring(10, 20)), p.z = parseFloat(w.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = _[_.length - 1].length, _[_.length - 1].push(p)); - } - for (o = 0; o < C; o++, b++) { - w = y[b]; - var a = A[parseInt(w.substring(0, 3)) - 1 + S], l = A[parseInt(w.substring(3, 6)) - 1 + S], g = parseFloat(w.substring(6)); + var w = [], L = _[_.length - 1].length, s = L + c, o, A; + for (o = L; o < s; o++, y++) { + A = b[y]; + var p = {}, v = A.substring(31, 34).replace(/ /g, ""); + p.atom = p.elem = v[0].toUpperCase() + v.substring(1).toLowerCase(), (p.elem !== "H" || !E) && (p.serial = o, w[o] = _[_.length - 1].length, p.x = parseFloat(A.substring(0, 10)), p.y = parseFloat(A.substring(10, 20)), p.z = parseFloat(A.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = _[_.length - 1].length, _[_.length - 1].push(p)); + } + for (o = 0; o < S; o++, y++) { + A = b[y]; + var a = w[parseInt(A.substring(0, 3)) - 1 + L], l = w[parseInt(A.substring(3, 6)) - 1 + L], g = parseFloat(A.substring(6)); typeof a < "u" && typeof l < "u" && (_[_.length - 1][a].bonds.push(l), _[_.length - 1][a].bondOrder.push(g), _[_.length - 1][l].bonds.push(a), _[_.length - 1][l].bondOrder.push(g)); } if (h.multimodel) { - for (h.onemol || _.push([]); y[b] !== "$$$$" && b < y.length; ) - b++; - y.splice(0, ++b); + for (h.onemol || _.push([]); b[y] !== "$$$$" && y < b.length; ) + y++; + b.splice(0, ++y); } else break; } return _; - }, f = function(y, h) { + }, f = function(b, h) { var _ = [[]], E = !1; - for (typeof h.keepH < "u" && (E = !h.keepH); y.length > 0 && !(y.length < 8 || !y[4].startsWith("M V30 BEGIN CTAB") || !y[5].startsWith("M V30 COUNTS") || y[5].length < 14); ) { - var c = y[5].substring(13).match(/\S+/g); + for (typeof h.keepH < "u" && (E = !h.keepH); b.length > 0 && !(b.length < 8 || !b[4].startsWith("M V30 BEGIN CTAB") || !b[5].startsWith("M V30 COUNTS") || b[5].length < 14); ) { + var c = b[5].substring(13).match(/\S+/g); if (c.length < 2) break; - var C = parseInt(c[0]); - if (isNaN(C) || C <= 0) + var S = parseInt(c[0]); + if (isNaN(S) || S <= 0) break; - var b = parseInt(c[1]), A = 7; - if (y.length < 8 + C + b) + var y = parseInt(c[1]), w = 7; + if (b.length < 8 + S + y) break; - var S = [], s = _[_.length - 1].length, o = s + C, w, p; - for (w = s; w < o; w++, A++) { - p = y[A]; + var L = [], s = _[_.length - 1].length, o = s + S, A, p; + for (A = s; A < o; A++, w++) { + p = b[w]; var v = p.substring(6).match(/\S+/g); if (v.length > 4) { var a = {}, l = v[1].replace(/ /g, ""); - a.atom = a.elem = l[0].toUpperCase() + l.substring(1).toLowerCase(), (a.elem !== "H" || !E) && (a.serial = w, S[w] = _[_.length - 1].length, a.x = parseFloat(v[2]), a.y = parseFloat(v[3]), a.z = parseFloat(v[4]), a.hetflag = !0, a.bonds = [], a.bondOrder = [], a.properties = {}, a.index = _[_.length - 1].length, _[_.length - 1].push(a)); + a.atom = a.elem = l[0].toUpperCase() + l.substring(1).toLowerCase(), (a.elem !== "H" || !E) && (a.serial = A, L[A] = _[_.length - 1].length, a.x = parseFloat(v[2]), a.y = parseFloat(v[3]), a.z = parseFloat(v[4]), a.hetflag = !0, a.bonds = [], a.bondOrder = [], a.properties = {}, a.index = _[_.length - 1].length, _[_.length - 1].push(a)); } } - if (y[A] === "M V30 END ATOM") - A++; + if (b[w] === "M V30 END ATOM") + w++; else break; - if (b !== 0 && y[A] === "M V30 BEGIN BOND") - A++; + if (y !== 0 && b[w] === "M V30 BEGIN BOND") + w++; else break; - for (w = 0; w < b; w++, A++) { - p = y[A]; + for (A = 0; A < y; A++, w++) { + p = b[w]; var g = p.substring(6).match(/\S+/g); if (g.length > 3) { - var M = S[parseInt(g[2]) - 1 + s], L = S[parseInt(g[3]) - 1 + s], T = parseFloat(g[1]); - typeof M < "u" && typeof L < "u" && (_[_.length - 1][M].bonds.push(L), _[_.length - 1][M].bondOrder.push(T), _[_.length - 1][L].bonds.push(M), _[_.length - 1][L].bondOrder.push(T)); + var M = L[parseInt(g[2]) - 1 + s], C = L[parseInt(g[3]) - 1 + s], T = parseFloat(g[1]); + typeof M < "u" && typeof C < "u" && (_[_.length - 1][M].bonds.push(C), _[_.length - 1][M].bondOrder.push(T), _[_.length - 1][C].bonds.push(M), _[_.length - 1][C].bondOrder.push(T)); } } if (h.multimodel) { - for (h.onemol || _.push([]); y[A] !== "$$$$" && A < y.length; ) - A++; - y.splice(0, ++A); + for (h.onemol || _.push([]); b[w] !== "$$$$" && w < b.length; ) + w++; + b.splice(0, ++w); } else break; } return _; }; - function u(y, h) { - var _ = "V2000", E = y.split(/\r?\n|\r/); + function u(b, h) { + var _ = "V2000", E = b.split(/\r?\n|\r/); return E.length > 3 && E[3].length > 38 && (_ = E[3].substring(34, 39)), _ === "V2000" ? n(E, h) : _ === "V3000" ? f(E, h) : [[""]]; } } @@ -18344,8 +18344,8 @@ ATOM`, g); !*** ./src/parsers/VASP.ts ***! \*****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ VASP: () => ( /* binding */ @@ -18353,41 +18353,41 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../WebGL */ "./src/WebGL/index.ts" ); function f(u) { - var y = [[]], h = {}, _ = u.replace(/^\s+/, "").split(/\r?\n/); + var b = [[]], h = {}, _ = u.replace(/^\s+/, "").split(/\r?\n/); if (_.length < 3) - return y; + return b; if (_[1].match(/\d+/)) h.length = parseFloat(_[1]); else - return console.log("Warning: second line of the vasp structure file must be a number"), y; + return console.log("Warning: second line of the vasp structure file must be a number"), b; if (h.length < 0) - return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), y; + return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), b; h.xVec = new Float32Array(_[2].replace(/^\s+/, "").split(/\s+/)), h.yVec = new Float32Array(_[3].replace(/^\s+/, "").split(/\s+/)), h.zVec = new Float32Array(_[4].replace(/^\s+/, "").split(/\s+/)); var E = new n.Matrix3(h.xVec[0], h.xVec[1], h.xVec[2], h.yVec[0], h.yVec[1], h.yVec[2], h.zVec[0], h.zVec[1], h.zVec[2]); - E.multiplyScalar(h.length), y.modelData = [{ symmetries: [], cryst: { matrix: E } }]; - var c = _[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), C = new Int16Array(_[6].replace(/^\s+/, "").split(/\s+/)), b = _[7].replace(/\s+/, ""); - if (b.match(/C/)) - b = "cartesian"; - else if (b.match(/D/)) - b = "direct"; + E.multiplyScalar(h.length), b.modelData = [{ symmetries: [], cryst: { matrix: E } }]; + var c = _[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), S = new Int16Array(_[6].replace(/^\s+/, "").split(/\s+/)), y = _[7].replace(/\s+/, ""); + if (y.match(/C/)) + y = "cartesian"; + else if (y.match(/D/)) + y = "direct"; else - return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), y; - if (c.length != C.length) - return console.log("Warning: declaration of atomary species wrong:"), console.log(c), console.log(C), y; + return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), b; + if (c.length != S.length) + return console.log("Warning: declaration of atomary species wrong:"), console.log(c), console.log(S), b; _.splice(0, 8); - for (var A = 0, S = 0, s = c.length; S < s; S++) { - for (var o = c[S], w = 0, p = C[S]; w < p; w++) { - var v = new Float32Array(_[A + w].replace(/^\s+/, "").split(/\s+/)), a = {}; - a.elem = o, b == "cartesian" ? (a.x = h.length * v[0], a.y = h.length * v[1], a.z = h.length * v[2]) : (a.x = h.length * (v[0] * h.xVec[0] + v[1] * h.yVec[0] + v[2] * h.zVec[0]), a.y = h.length * (v[0] * h.xVec[1] + v[1] * h.yVec[1] + v[2] * h.zVec[1]), a.z = h.length * (v[0] * h.xVec[2] + v[1] * h.yVec[2] + v[2] * h.zVec[2])), a.bonds = [], y[0].push(a); + for (var w = 0, L = 0, s = c.length; L < s; L++) { + for (var o = c[L], A = 0, p = S[L]; A < p; A++) { + var v = new Float32Array(_[w + A].replace(/^\s+/, "").split(/\s+/)), a = {}; + a.elem = o, y == "cartesian" ? (a.x = h.length * v[0], a.y = h.length * v[1], a.z = h.length * v[2]) : (a.x = h.length * (v[0] * h.xVec[0] + v[1] * h.yVec[0] + v[2] * h.zVec[0]), a.y = h.length * (v[0] * h.xVec[1] + v[1] * h.yVec[1] + v[2] * h.zVec[1]), a.z = h.length * (v[0] * h.xVec[2] + v[1] * h.yVec[2] + v[2] * h.zVec[2])), a.bonds = [], b[0].push(a); } - A += C[S]; + w += S[L]; } - return y; + return b; } } ), @@ -18397,8 +18397,8 @@ ATOM`, g); !*** ./src/parsers/XYZ.ts ***! \****************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ XYZ: () => ( /* binding */ @@ -18406,25 +18406,25 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function u(y, h) { + function u(b, h) { h = h || {}; - for (var _ = [[]], E = h.assignBonds === void 0 ? !0 : h.assignBonds, c = y.split(/\r?\n|\r/); c.length > 0 && !(c.length < 3); ) { - var C = parseInt(c[0]); - if (isNaN(C) || C <= 0 || c.length < C + 2) + for (var _ = [[]], E = h.assignBonds === void 0 ? !0 : h.assignBonds, c = b.split(/\r?\n|\r/); c.length > 0 && !(c.length < 3); ) { + var S = parseInt(c[0]); + if (isNaN(S) || S <= 0 || c.length < S + 2) break; - var b = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, A = b.exec(c[1]); - if (A != null && A.length > 1) { - var S = new Float32Array(A[1].split(/\s+/)), s = new n.Matrix3(S[0], S[3], S[6], S[1], S[4], S[7], S[2], S[5], S[8]); + var y = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, w = y.exec(c[1]); + if (w != null && w.length > 1) { + var L = new Float32Array(w[1].split(/\s+/)), s = new n.Matrix3(L[0], L[3], L[6], L[1], L[4], L[7], L[2], L[5], L[8]); _.modelData = [{ cryst: { matrix: s } }]; } - for (var o = 2, w = _[_.length - 1].length, p = w + C, v = w; v < p; v++) { + for (var o = 2, A = _[_.length - 1].length, p = A + S, v = A; v < p; v++) { var a = c[o++], l = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), g = {}; g.serial = v; var M = l[0]; @@ -18439,15 +18439,15 @@ ATOM`, g); for (let T = 0; T < _.length; T++) (0, f.assignBonds)(_[T]); if (h.onemol) { - var L = _; - _ = [], _.push(L[0]); - for (let T = 1; T < L.length; T++) { + var C = _; + _ = [], _.push(C[0]); + for (let T = 1; T < C.length; T++) { let D = _[0].length; - for (let I = 0; I < L[T].length; I++) { - let z = L[T][I]; - for (let P = 0; P < z.bonds.length; P++) - z.bonds[P] = z.bonds[P] + D; - z.index = _[0].length, z.serial = _[0].length, _[0].push(z); + for (let I = 0; I < C[T].length; I++) { + let B = C[T][I]; + for (let P = 0; P < B.bonds.length; P++) + B.bonds[P] = B.bonds[P] + D; + B.index = _[0].length, B.serial = _[0].length, _[0].push(B); } } } @@ -18461,12 +18461,12 @@ ATOM`, g); !*** ./src/parsers/index.ts ***! \******************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Parsers: () => ( /* binding */ - w + A ), /* harmony export */ bondLength: () => ( @@ -18480,58 +18480,58 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./VASP */ "./src/parsers/VASP.ts" - ), f = t( + ), f = r( /*! ./CUBE */ "./src/parsers/CUBE.ts" - ), u = t( + ), u = r( /*! ./XYZ */ "./src/parsers/XYZ.ts" - ), y = t( + ), b = r( /*! ./SDF */ "./src/parsers/SDF.ts" - ), h = t( + ), h = r( /*! ./CDJSON */ "./src/parsers/CDJSON.ts" - ), _ = t( + ), _ = r( /*! ./CIF */ "./src/parsers/CIF.ts" - ), E = t( + ), E = r( /*! ./MOL2 */ "./src/parsers/MOL2.ts" - ), c = t( + ), c = r( /*! ./PDB */ "./src/parsers/PDB.ts" - ), C = t( + ), S = r( /*! ./PQR */ "./src/parsers/PQR.ts" - ), b = t( + ), y = r( /*! ./MMTF */ "./src/parsers/MMTF.ts" - ), A = t( + ), w = r( /*! ./PRMTOP */ "./src/parsers/PRMTOP.ts" - ), S = t( + ), L = r( /*! ./GRO */ "./src/parsers/GRO.ts" - ), s = t( + ), s = r( /*! ./LAMMPSTRJ */ "./src/parsers/LAMMPSTRJ.ts" - ), o = t( + ), o = r( /*! ./utils/bondLength */ "./src/parsers/utils/bondLength.ts" ); - const w = { + const A = { vasp: n.VASP, VASP: n.VASP, cube: f.CUBE, CUBE: f.CUBE, xyz: u.XYZ, XYZ: u.XYZ, - sdf: y.SDF, - SDF: y.SDF, + sdf: b.SDF, + SDF: b.SDF, json: h.CDJSON, cdjson: h.CDJSON, CDJSON: h.CDJSON, @@ -18544,14 +18544,14 @@ ATOM`, g); PDB: c.PDB, pdbqt: c.PDB, PDBQT: c.PDB, - pqr: C.PQR, - PQR: C.PQR, - mmtf: b.MMTFparser, - MMTF: b.MMTFparser, - prmtop: A.PRMTOP, - PRMTOP: A.PRMTOP, - gro: S.GRO, - GRO: S.GRO, + pqr: S.PQR, + PQR: S.PQR, + mmtf: y.MMTFparser, + MMTF: y.MMTFparser, + prmtop: w.PRMTOP, + PRMTOP: w.PRMTOP, + gro: L.GRO, + GRO: L.GRO, lammpstrj: s.LAMMPSTRJ, LAMMPSTRJ: s.LAMMPSTRJ }; @@ -18563,8 +18563,8 @@ ATOM`, g); !*** ./src/parsers/utils/anumToSymbol.ts ***! \*******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ anumToSymbol: () => ( /* binding */ @@ -18699,8 +18699,8 @@ ATOM`, g); !*** ./src/parsers/utils/areConnected.ts ***! \*******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ areConnected: () => ( /* binding */ @@ -18708,24 +18708,24 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - function f(u, y) { - var h = (0, n.bondLength)(u.elem) + (0, n.bondLength)(y.elem); + function f(u, b) { + var h = (0, n.bondLength)(u.elem) + (0, n.bondLength)(b.elem); h += 0.25, h *= h; - var _ = u.x - y.x; + var _ = u.x - b.x; if (_ *= _, _ > h) return !1; - var E = u.y - y.y; + var E = u.y - b.y; if (E *= E, E > h) return !1; - var c = u.z - y.z; + var c = u.z - b.z; if (c *= c, c > h) return !1; - var C = _ + E + c; - return isNaN(C) || C < 0.5 || C > h ? !1 : !(u.altLoc != y.altLoc && u.altLoc != " " && y.altLoc != " "); + var S = _ + E + c; + return isNaN(S) || S < 0.5 || S > h ? !1 : !(u.altLoc != b.altLoc && u.altLoc != " " && b.altLoc != " "); } } ), @@ -18735,8 +18735,8 @@ ATOM`, g); !*** ./src/parsers/utils/assignBackboneHBonds.ts ***! \***************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ assignBackboneHBonds: () => ( /* binding */ @@ -18745,28 +18745,28 @@ ATOM`, g); /* harmony export */ }); function n(f, u) { - let y = u || 3.2, h = y * y, _ = []; - for (let o = 0, w = f.length; o < w; o++) { + let b = u || 3.2, h = b * b, _ = []; + for (let o = 0, A = f.length; o < A; o++) { f[o].index = o; var E = f[o]; !E.hetflag && (E.atom === "N" || E.atom === "O") && (_.push(E), E.hbondOther = null, E.hbondDistanceSq = Number.POSITIVE_INFINITY); } - _.sort(function(o, w) { - return o.z - w.z; + _.sort(function(o, A) { + return o.z - A.z; }); - for (let o = 0, w = _.length; o < w; o++) { + for (let o = 0, A = _.length; o < A; o++) { var c = _[o]; - for (let p = o + 1; p < w; p++) { - var C = _[p], b = C.z - c.z; - if (b > y) + for (let p = o + 1; p < A; p++) { + var S = _[p], y = S.z - c.z; + if (y > b) break; - if (C.atom != c.atom) { - var A = Math.abs(C.y - c.y); - if (!(A > y)) { - var S = Math.abs(C.x - c.x); - if (!(S > y)) { - var s = S * S + A * A + b * b; - s > h || C.chain == c.chain && Math.abs(C.resi - c.resi) < 4 || (s < c.hbondDistanceSq && (c.hbondOther = C, c.hbondDistanceSq = s), s < C.hbondDistanceSq && (C.hbondOther = c, C.hbondDistanceSq = s)); + if (S.atom != c.atom) { + var w = Math.abs(S.y - c.y); + if (!(w > b)) { + var L = Math.abs(S.x - c.x); + if (!(L > b)) { + var s = L * L + w * w + y * y; + s > h || S.chain == c.chain && Math.abs(S.resi - c.resi) < 4 || (s < c.hbondDistanceSq && (c.hbondOther = S, c.hbondDistanceSq = s), s < S.hbondDistanceSq && (S.hbondOther = c, S.hbondDistanceSq = s)); } } } @@ -18781,8 +18781,8 @@ ATOM`, g); !*** ./src/parsers/utils/assignBonds.ts ***! \******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ assignBonds: () => ( /* binding */ @@ -18790,24 +18790,24 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" ); function f(u) { - for (var y = 0, h = u.length; y < h; y++) - u[y].index || (u[y].index = y); + for (var b = 0, h = u.length; b < h; b++) + u[b].index || (u[b].index = b); for (var _ = {}, E = 4.95, c = 0; c < u.length; c++) { - var C = u[c], b = Math.floor(C.x / E), A = Math.floor(C.y / E), S = Math.floor(C.z / E); - _[b] || (_[b] = {}), _[b][A] || (_[b][A] = {}), _[b][A][S] || (_[b][A][S] = []), _[b][A][S].push(C); + var S = u[c], y = Math.floor(S.x / E), w = Math.floor(S.y / E), L = Math.floor(S.z / E); + _[y] || (_[y] = {}), _[y][w] || (_[y][w] = {}), _[y][w][L] || (_[y][w][L] = []), _[y][w][L].push(S); } - var s = function(w, p) { - for (var v = 0; v < w.length; v++) - for (var a = w[v], l = 0; l < p.length; l++) { + var s = function(A, p) { + for (var v = 0; v < A.length; v++) + for (var a = A[v], l = 0; l < p.length; l++) { var g = p[l]; if ((0, n.areConnected)(a, g)) { - var M = a.bonds.indexOf(g.index), L = g.bonds.indexOf(a.index); - M == -1 && L == -1 ? (a.bonds.push(g.index), a.bondOrder.push(1), g.bonds.push(a.index), g.bondOrder.push(1)) : M == -1 ? (a.bonds.push(g.index), a.bondOrder.push(g.bondOrder[L])) : L == -1 && (g.bonds.push(a.index), g.bondOrder.push(a.bondOrder[M])); + var M = a.bonds.indexOf(g.index), C = g.bonds.indexOf(a.index); + M == -1 && C == -1 ? (a.bonds.push(g.index), a.bondOrder.push(1), g.bonds.push(a.index), g.bondOrder.push(1)) : M == -1 ? (a.bonds.push(g.index), a.bondOrder.push(g.bondOrder[C])) : C == -1 && (g.bonds.push(a.index), g.bondOrder.push(a.bondOrder[M])); } } }, o = [ @@ -18825,21 +18825,21 @@ ATOM`, g); { x: 1, y: 1, z: 0 }, { x: 1, y: 1, z: 1 } ]; - for (let w in _) { - let p = parseInt(w); + for (let A in _) { + let p = parseInt(A); for (let v in _[p]) { let a = parseInt(v); for (let l in _[p][a]) { let g = parseInt(l), M = _[p][a][g]; - for (let L = 0; L < M.length; L++) { - let T = M[L]; - for (let D = L + 1; D < M.length; D++) { + for (let C = 0; C < M.length; C++) { + let T = M[C]; + for (let D = C + 1; D < M.length; D++) { let I = M[D]; (0, n.areConnected)(T, I) && T.bonds.indexOf(I.index) == -1 && (T.bonds.push(I.index), T.bondOrder.push(1), I.bonds.push(T.index), I.bondOrder.push(1)); } } - for (let L = 0; L < o.length; L++) { - let T = o[L]; + for (let C = 0; C < o.length; C++) { + let T = o[C]; if (!_[p + T.x] || !_[p + T.x][a + T.y] || !_[p + T.x][a + T.y][g + T.z]) continue; let D = _[p + T.x][a + T.y][g + T.z]; @@ -18857,40 +18857,40 @@ ATOM`, g); !*** ./src/parsers/utils/assignPDBBonds.ts ***! \*********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ assignPDBBonds: () => ( /* binding */ - y + b ) /* harmony export */ }); - var n = t( + var n = r( /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" - ), f = t( + ), f = r( /*! ./assignBonds */ "./src/parsers/utils/assignBonds.ts" - ), u = t( + ), u = r( /*! ./standardResidues */ "./src/parsers/utils/standardResidues.ts" ); - function y(h) { - var _ = [], E = [], c, C; - for (c = 0, C = h.length; c < C; c++) { - var b = h[c]; - b.index = c, b.hetflag || !u.standardResidues.has(b.resn) ? E.push(b) : _.push(b); + function b(h) { + var _ = [], E = [], c, S; + for (c = 0, S = h.length; c < S; c++) { + var y = h[c]; + y.index = c, y.hetflag || !u.standardResidues.has(y.resn) ? E.push(y) : _.push(y); } (0, f.assignBonds)(E), _.sort(function(v, a) { return v.chain != a.chain ? v.chain < a.chain ? -1 : 1 : v.resi - a.resi; }); - var A = -1, S = -1, s; - for (c = 0, C = _.length; c < C; c++) { + var w = -1, L = -1, s; + for (c = 0, S = _.length; c < S; c++) { var o = _[c]; - o.resi !== A && (A = o.resi, s || S++, s = !1), o.reschain = S; - for (var w = c + 1; w < _.length; w++) { - var p = _[w]; + o.resi !== w && (w = o.resi, s || L++, s = !1), o.reschain = L; + for (var A = c + 1; A < _.length; A++) { + var p = _[A]; if (p.chain != o.chain || p.resi - o.resi > 1) break; (0, n.areConnected)(o, p) && (o.bonds.indexOf(p.index) === -1 && (o.bonds.push(p.index), o.bondOrder.push(1), p.bonds.push(o.index), p.bondOrder.push(1)), o.resi !== p.resi && (s = !0)); @@ -18905,8 +18905,8 @@ ATOM`, g); !*** ./src/parsers/utils/atomNameToElem.ts ***! \*********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ atomNameToElem: () => ( /* binding */ @@ -18914,13 +18914,13 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - function f(u, y) { + function f(u, b) { var h = u.replace(/ /g, ""); - return h.length > 0 && h[0] == "H" && h != "Hg" && h != "He" && h != "Hf" && h != "Hs" && h != "Ho" && (h = "H"), h.length > 1 && (h = h[0].toUpperCase() + h.substring(1).toLowerCase(), typeof n.bondTable[h] > "u" ? h = h[0] : y && (h == "Ca" || h == "Cd") && (h = "C")), h; + return h.length > 0 && h[0] == "H" && h != "Hg" && h != "He" && h != "Hf" && h != "Hs" && h != "Ho" && (h = "H"), h.length > 1 && (h = h[0].toUpperCase() + h.substring(1).toLowerCase(), typeof n.bondTable[h] > "u" ? h = h[0] : b && (h == "Ca" || h == "Cd") && (h = "C")), h; } } ), @@ -18930,8 +18930,8 @@ ATOM`, g); !*** ./src/parsers/utils/bondLength.ts ***! \*****************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ bondLength: () => ( /* binding */ @@ -19024,11 +19024,11 @@ ATOM`, g); Rn: 1.45 // None of the bottom row or any of the Lanthanides have bond lengths }; - function f(y) { - return n[y] || 1.6; + function f(b) { + return n[b] || 1.6; } - function u(y, h) { - h < 0 && (h = 0), n[y] = h; + function u(b, h) { + h < 0 && (h = 0), n[b] = h; } } ), @@ -19038,8 +19038,8 @@ ATOM`, g); !*** ./src/parsers/utils/computeSecondaryStructure.ts ***! \********************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ computeSecondaryStructure: () => ( /* binding */ @@ -19047,42 +19047,42 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ./assignBackboneHBonds */ "./src/parsers/utils/assignBackboneHBonds.ts" ); - function f(u, y) { - (0, n.assignBackboneHBonds)(u, y); - var h = {}, _, E, c, C, b, A; + function f(u, b) { + (0, n.assignBackboneHBonds)(u, b); + var h = {}, _, E, c, S, y, w; for (_ = 0, E = u.length; _ < E; _++) - if (b = u[_], typeof h[b.chain] > "u" && (h[b.chain] = []), isFinite(b.hbondDistanceSq)) { - var S = b.hbondOther; - typeof h[S.chain] > "u" && (h[S.chain] = []), Math.abs(S.resi - b.resi) === 4 && (h[b.chain][b.resi] = "h"); + if (y = u[_], typeof h[y.chain] > "u" && (h[y.chain] = []), isFinite(y.hbondDistanceSq)) { + var L = y.hbondOther; + typeof h[L.chain] > "u" && (h[L.chain] = []), Math.abs(L.resi - y.resi) === 4 && (h[y.chain][y.resi] = "h"); } for (c in h) - for (C = 1; C < h[c].length - 1; C++) { - var s = h[c][C - 1], o = h[c][C + 1]; - A = h[c][C], s == "h" && s == o && A != s && (h[c][C] = s); + for (S = 1; S < h[c].length - 1; S++) { + var s = h[c][S - 1], o = h[c][S + 1]; + w = h[c][S], s == "h" && s == o && w != s && (h[c][S] = s); } for (_ = 0, E = u.length; _ < E; _++) - b = u[_], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] != "h" && b.ss != "h" && (h[b.chain][b.resi] = "maybesheet"); - for (let w = 0, p = u.length; w < p; w++) - if (b = u[w], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] == "maybesheet") { - let v = b.hbondOther, a = h[v.chain][v.resi]; - (a == "maybesheet" || a == "s") && (h[b.chain][b.resi] = "s", h[v.chain][v.resi] = "s"); + y = u[_], isFinite(y.hbondDistanceSq) && h[y.chain][y.resi] != "h" && y.ss != "h" && (h[y.chain][y.resi] = "maybesheet"); + for (let A = 0, p = u.length; A < p; A++) + if (y = u[A], isFinite(y.hbondDistanceSq) && h[y.chain][y.resi] == "maybesheet") { + let v = y.hbondOther, a = h[v.chain][v.resi]; + (a == "maybesheet" || a == "s") && (h[y.chain][y.resi] = "s", h[v.chain][v.resi] = "s"); } - for (let w in h) { - for (let p = 1; p < h[w].length - 1; p++) { - let v = h[w][p - 1], a = h[w][p + 1]; - A = h[w][p], v == "s" && v == a && A != v && (h[w][p] = v); + for (let A in h) { + for (let p = 1; p < h[A].length - 1; p++) { + let v = h[A][p - 1], a = h[A][p + 1]; + w = h[A][p], v == "s" && v == a && w != v && (h[A][p] = v); } - for (let p = 0; p < h[w].length; p++) { - let v = h[w][p]; - (v == "h" || v == "s") && h[w][p - 1] != v && h[w][p + 1] != v && delete h[w][p]; + for (let p = 0; p < h[A].length; p++) { + let v = h[A][p]; + (v == "h" || v == "s") && h[A][p - 1] != v && h[A][p + 1] != v && delete h[A][p]; } } for (_ = 0, E = u.length; _ < E; _++) - b = u[_], A = h[b.chain][b.resi], delete b.hbondOther, delete b.hbondDistanceSq, !(typeof A > "u" || A == "maybesheet") && (b.ss = A, h[b.chain][b.resi - 1] != A && (b.ssbegin = !0), h[b.chain][b.resi + 1] != A && (b.ssend = !0)); + y = u[_], w = h[y.chain][y.resi], delete y.hbondOther, delete y.hbondDistanceSq, !(typeof w > "u" || w == "maybesheet") && (y.ss = w, h[y.chain][y.resi - 1] != w && (y.ssbegin = !0), h[y.chain][y.resi + 1] != w && (y.ssend = !0)); } } ), @@ -19092,149 +19092,149 @@ ATOM`, g); !*** ./src/parsers/utils/getSinglePDB.ts ***! \*******************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ getSinglePDB: () => ( /* binding */ - C + S ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../WebGL */ "./src/WebGL/index.ts" - ), f = t( + ), f = r( /*! ./atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" - ), u = t( + ), u = r( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" - ), y = t( + ), b = r( /*! ./computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), h = t( + ), h = r( /*! ./isEmpty */ "./src/parsers/utils/isEmpty.ts" - ), _ = t( + ), _ = r( /*! ./processSymmetries */ "./src/parsers/utils/processSymmetries.ts" - ), E = t( + ), E = r( /*! ./assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" - ), c = t( + ), c = r( /*! ./validateBonds */ "./src/parsers/utils/validateBonds.ts" ); - function C(b, A, S) { - var s = [], o = A.assignBonds === void 0 ? !0 : A.assignBonds, w = !A.keepH, p = !!A.noSecondaryStructure, v = !A.noComputeSecondaryStructure, a = !A.doAssembly, l = A.altLoc ? A.altLoc : "A", g = { symmetries: [] }, M, L = [], T = [], D, I = {}; - for (let He = 0; He < b.length; He++) { - D = b[He].replace(/^\s*/, ""); - var z = D.substring(0, 6), P, B, k; - if (z.indexOf("END") == 0) { - if (L = b.slice(He + 1), z == "END") - for (var N in S) - S.hasOwnProperty(N) && delete S[N]; + function S(y, w, L) { + var s = [], o = w.assignBonds === void 0 ? !0 : w.assignBonds, A = !w.keepH, p = !!w.noSecondaryStructure, v = !w.noComputeSecondaryStructure, a = !w.doAssembly, l = w.altLoc ? w.altLoc : "A", g = { symmetries: [] }, M, C = [], T = [], D, I = {}; + for (let We = 0; We < y.length; We++) { + D = y[We].replace(/^\s*/, ""); + var B = D.substring(0, 6), P, z, k; + if (B.indexOf("END") == 0) { + if (C = y.slice(We + 1), B == "END") + for (var N in L) + L.hasOwnProperty(N) && delete L[N]; break; - } else if (z == "ATOM " || z == "HETATM") { - var $, F, G, H, U, V, Q, ae, oe, q, me, ne; - if (me = D.substring(16, 17), me != " " && me != l && l != "*" || (q = parseInt(D.substring(6, 11)), M = D.substring(12, 16).replace(/ /g, ""), $ = D.substring(17, 20).replace(/ /g, ""), F = D.substring(21, 22), G = parseInt(D.substring(22, 26)), H = D.substring(26, 27), U = parseFloat(D.substring(30, 38)), V = parseFloat(D.substring(38, 46)), Q = parseFloat(D.substring(46, 54)), ne = parseFloat(D.substring(60, 68)), oe = D.substring(76, 78).replace(/ /g, ""), oe === "" || typeof u.bondTable[oe] > "u" ? oe = (0, f.atomNameToElem)(D.substring(12, 14), D[0] == "A") : oe = oe[0].toUpperCase() + oe.substring(1).toLowerCase(), oe == "H" && w)) + } else if (B == "ATOM " || B == "HETATM") { + var R, U, W, G, F, V, J, X, oe, te, ve, se; + if (ve = D.substring(16, 17), ve != " " && ve != l && l != "*" || (te = parseInt(D.substring(6, 11)), M = D.substring(12, 16).replace(/ /g, ""), R = D.substring(17, 20).replace(/ /g, ""), U = D.substring(21, 22), W = parseInt(D.substring(22, 26)), G = D.substring(26, 27), F = parseFloat(D.substring(30, 38)), V = parseFloat(D.substring(38, 46)), J = parseFloat(D.substring(46, 54)), se = parseFloat(D.substring(60, 68)), oe = D.substring(76, 78).replace(/ /g, ""), oe === "" || typeof u.bondTable[oe] > "u" ? oe = (0, f.atomNameToElem)(D.substring(12, 14), D[0] == "A") : oe = oe[0].toUpperCase() + oe.substring(1).toLowerCase(), oe == "H" && A)) continue; - z[0] == "H" ? ae = !0 : ae = !1, T[q] = s.length, s.push({ - resn: $, - x: U, + B[0] == "H" ? X = !0 : X = !1, T[te] = s.length, s.push({ + resn: R, + x: F, y: V, - z: Q, + z: J, elem: oe, - hetflag: ae, - altLoc: me, - chain: F, - resi: G, - icode: H, - rescode: G + (H != " " ? "^" + H : ""), + hetflag: X, + altLoc: ve, + chain: U, + resi: W, + icode: G, + rescode: W + (G != " " ? "^" + G : ""), // resi // and // icode - serial: q, + serial: te, atom: M, bonds: [], ss: "c", bondOrder: [], properties: {}, - b: ne, + b: se, pdbline: D }); - } else if (z == "SHEET ") { - P = D.substring(21, 22), B = parseInt(D.substring(22, 26)), k = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][B] = "s1"; - for (var fe = B + 1; fe < k; fe++) - S[P][fe] = "s"; - S[P][k] = "s2"; - } else if (z == "CONECT") { - var Ce = parseInt(D.substring(6, 11)), Me = T[Ce], Te = s[Me], se = [11, 16, 21, 26]; - for (let We = 0; We < 4; We++) { - var pe = parseInt(D.substring(se[We], se[We] + 5)), we = T[pe]; - let Y = Me + ":" + we; - var Fe = s[we]; - if (Te !== void 0 && Fe !== void 0) - if (!I[Y]) - I[Y] = 1, (Te.bonds.length == 0 || Te.bonds[Te.bonds.length - 1] != we) && (Te.bonds.push(we), Te.bondOrder.push(1)); + } else if (B == "SHEET ") { + P = D.substring(21, 22), z = parseInt(D.substring(22, 26)), k = parseInt(D.substring(33, 37)), P in L || (L[P] = {}), L[P][z] = "s1"; + for (var le = z + 1; le < k; le++) + L[P][le] = "s"; + L[P][k] = "s2"; + } else if (B == "CONECT") { + var Ce = parseInt(D.substring(6, 11)), be = T[Ce], Le = s[be], ae = [11, 16, 21, 26]; + for (let Ue = 0; Ue < 4; Ue++) { + var _e = parseInt(D.substring(ae[Ue], ae[Ue] + 5)), Ee = T[_e]; + let Z = be + ":" + Ee; + var Be = s[Ee]; + if (Le !== void 0 && Be !== void 0) + if (!I[Z]) + I[Z] = 1, (Le.bonds.length == 0 || Le.bonds[Le.bonds.length - 1] != Ee) && (Le.bonds.push(Ee), Le.bondOrder.push(1)); else { - I[Y] += 1; - for (let K = 0; K < Te.bonds.length; K++) - if (Te.bonds[K] == we) { - var Ue = I[Y]; - Ue >= 4 ? Te.bondOrder[K] = 1 : Te.bondOrder[K] = Ue; + I[Z] += 1; + for (let j = 0; j < Le.bonds.length; j++) + if (Le.bonds[j] == Ee) { + var Ne = I[Z]; + Ne >= 4 ? Le.bondOrder[j] = 1 : Le.bondOrder[j] = Ne; } } } - } else if (z == "HELIX ") { - P = D.substring(19, 20), B = parseInt(D.substring(21, 25)), k = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][B] = "h1"; - for (let We = B + 1; We < k; We++) - S[P][We] = "h"; - S[P][k] = "h2"; - } else if (!a && z == "REMARK" && D.substring(13, 18) == "BIOMT") { - var Ne, Be = new n.Matrix4(); - for (Ne = 1; Ne <= 3; Ne++) - if (D = b[He].replace(/^\s*/, ""), parseInt(D.substring(18, 19)) == Ne) - Be.elements[Ne - 1] = parseFloat(D.substring(23, 33)), Be.elements[Ne - 1 + 4] = parseFloat(D.substring(33, 43)), Be.elements[Ne - 1 + 8] = parseFloat(D.substring(43, 53)), Be.elements[Ne - 1 + 12] = parseFloat(D.substring(53)), He++; + } else if (B == "HELIX ") { + P = D.substring(19, 20), z = parseInt(D.substring(21, 25)), k = parseInt(D.substring(33, 37)), P in L || (L[P] = {}), L[P][z] = "h1"; + for (let Ue = z + 1; Ue < k; Ue++) + L[P][Ue] = "h"; + L[P][k] = "h2"; + } else if (!a && B == "REMARK" && D.substring(13, 18) == "BIOMT") { + var Ge, ke = new n.Matrix4(); + for (Ge = 1; Ge <= 3; Ge++) + if (D = y[We].replace(/^\s*/, ""), parseInt(D.substring(18, 19)) == Ge) + ke.elements[Ge - 1] = parseFloat(D.substring(23, 33)), ke.elements[Ge - 1 + 4] = parseFloat(D.substring(33, 43)), ke.elements[Ge - 1 + 8] = parseFloat(D.substring(43, 53)), ke.elements[Ge - 1 + 12] = parseFloat(D.substring(53)), We++; else for (; D.substring(13, 18) == "BIOMT"; ) - He++, D = b[He].replace(/^\s*/, ""); - Be.elements[3] = 0, Be.elements[7] = 0, Be.elements[11] = 0, Be.elements[15] = 1, g.symmetries.push(Be), He--; - } else if (z == "CRYST1") { - let We, Y, K, ee, de, ve; - We = parseFloat(D.substring(7, 15)), Y = parseFloat(D.substring(16, 24)), K = parseFloat(D.substring(25, 33)), ee = parseFloat(D.substring(34, 40)), de = parseFloat(D.substring(41, 47)), ve = parseFloat(D.substring(48, 54)), g.cryst = { - a: We, - b: Y, - c: K, + We++, D = y[We].replace(/^\s*/, ""); + ke.elements[3] = 0, ke.elements[7] = 0, ke.elements[11] = 0, ke.elements[15] = 1, g.symmetries.push(ke), We--; + } else if (B == "CRYST1") { + let Ue, Z, j, ee, ge, ye; + Ue = parseFloat(D.substring(7, 15)), Z = parseFloat(D.substring(16, 24)), j = parseFloat(D.substring(25, 33)), ee = parseFloat(D.substring(34, 40)), ge = parseFloat(D.substring(41, 47)), ye = parseFloat(D.substring(48, 54)), g.cryst = { + a: Ue, + b: Z, + c: j, alpha: ee, - beta: de, - gamma: ve + beta: ge, + gamma: ye }; - } else if (z == "ANISOU") { - let We = parseInt(D.substring(6, 11)); - var ue = T[We], ye = s[ue]; - if (ye) { - var ge = D.substring(30).trim().split(/\s+/), Se = { - u11: parseInt(ge[0]), - u22: parseInt(ge[1]), - u33: parseInt(ge[2]), - u12: parseInt(ge[3]), - u13: parseInt(ge[4]), - u23: parseInt(ge[5]) + } else if (B == "ANISOU") { + let Ue = parseInt(D.substring(6, 11)); + var pe = T[Ue], de = s[pe]; + if (de) { + var ce = D.substring(30).trim().split(/\s+/), Ae = { + u11: parseInt(ce[0]), + u22: parseInt(ce[1]), + u33: parseInt(ce[2]), + u12: parseInt(ce[3]), + u13: parseInt(ce[4]), + u23: parseInt(ce[5]) }; - ye.uMat = Se; + de.uMat = Ae; } } } - if ((0, c.validateBonds)(s, T), o && (0, E.assignPDBBonds)(s), a || (0, _.processSymmetries)(g.symmetries, s, A, g.cryst), v && !p && (0, y.computeSecondaryStructure)(s, A.hbondCutoff), !(0, h.isEmpty)(S)) { - for (let He = 0; He < s.length; He++) - if (M = s[He], M !== void 0 && M.chain in S && M.resi in S[M.chain]) { - var ze = S[M.chain][M.resi]; - M.ss = ze[0], ze.length > 1 && (ze[1] == "1" ? M.ssbegin = !0 : ze[1] == "2" && (M.ssend = !0)); + if ((0, c.validateBonds)(s, T), o && (0, E.assignPDBBonds)(s), a || (0, _.processSymmetries)(g.symmetries, s, w, g.cryst), v && !p && (0, b.computeSecondaryStructure)(s, w.hbondCutoff), !(0, h.isEmpty)(L)) { + for (let We = 0; We < s.length; We++) + if (M = s[We], M !== void 0 && M.chain in L && M.resi in L[M.chain]) { + var Oe = L[M.chain][M.resi]; + M.ss = Oe[0], Oe.length > 1 && (Oe[1] == "1" ? M.ssbegin = !0 : Oe[1] == "2" && (M.ssend = !0)); } } - return [s, g, L]; + return [s, g, C]; } } ), @@ -19244,8 +19244,8 @@ ATOM`, g); !*** ./src/parsers/utils/isEmpty.ts ***! \**************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ isEmpty: () => ( /* binding */ @@ -19267,8 +19267,8 @@ ATOM`, g); !*** ./src/parsers/utils/processSymmetries.ts ***! \************************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ processSymmetries: () => ( /* binding */ @@ -19276,69 +19276,69 @@ ATOM`, g); ) /* harmony export */ }); - var n = t( + var n = r( /*! ../../WebGL */ "./src/WebGL/index.ts" ); - function f(u, y, h, _) { - var E = !h.duplicateAssemblyAtoms, c = y.length, C = c, b, A, S; + function f(u, b, h, _) { + var E = !h.duplicateAssemblyAtoms, c = b.length, S = c, y, w, L; let s = -1; if (h.normalizeAssembly && _) { let l = (0, n.conversionMatrix3)(_.a, _.b, _.c, _.alpha, _.beta, _.gamma), g = new n.Matrix3(); - for (g.getInverse3(l), b = 0; b < u.length; b++) { + for (g.getInverse3(l), y = 0; y < u.length; y++) { let M = new n.Vector3(0, 0, 0); - for (S = 0; S < c; S++) { - let I = new n.Vector3(y[S].x, y[S].y, y[S].z); - I.applyMatrix4(u[b]), I.applyMatrix3(g), M.add(I); + for (L = 0; L < c; L++) { + let I = new n.Vector3(b[L].x, b[L].y, b[L].z); + I.applyMatrix4(u[y]), I.applyMatrix3(g), M.add(I); } M.divideScalar(c); - const L = [M.x, M.y, M.z]; + const C = [M.x, M.y, M.z]; let T = [0, 0, 0]; for (let I = 0; I < 3; I++) { - for (; L[I] < -1e-3; ) - L[I] += 1, T[I] += 1; - for (; L[I] > 1.001; ) - L[I] -= 1, T[I] -= 1; + for (; C[I] < -1e-3; ) + C[I] += 1, T[I] += 1; + for (; C[I] > 1.001; ) + C[I] -= 1, T[I] -= 1; } const D = new n.Vector3(T[0], T[1], T[2]); - D.applyMatrix3(l), u[b].isNearlyIdentity() && D.lengthSq() > 1e-3 && (s = b), u[b].translate(D); + D.applyMatrix3(l), u[y].isNearlyIdentity() && D.lengthSq() > 1e-3 && (s = y), u[y].translate(D); } } if (E) { if (u.length > 1) - for (b = 0; b < y.length; b++) { + for (y = 0; y < b.length; y++) { var v = []; - for (A = 0; A < u.length; A++) - if (!u[A].isNearlyIdentity()) { + for (w = 0; w < u.length; w++) + if (!u[w].isNearlyIdentity()) { var a = new n.Vector3(); - a.set(y[b].x, y[b].y, y[b].z), a.applyMatrix4(u[A]), v.push(a); + a.set(b[y].x, b[y].y, b[y].z), a.applyMatrix4(u[w]), v.push(a); } - y[b].symmetries = v; + b[y].symmetries = v; } } else { - for (S = 0; S < c; S++) - y[S].sym = -1; - for (b = 0; b < u.length; b++) - if (!u[b].isNearlyIdentity() && s != b) { + for (L = 0; L < c; L++) + b[L].sym = -1; + for (y = 0; y < u.length; y++) + if (!u[y].isNearlyIdentity() && s != y) { let l = new n.Vector3(); - for (S = 0; S < c; S++) { + for (L = 0; L < c; L++) { var o = []; - for (A = 0; A < y[S].bonds.length; A++) - o.push(y[S].bonds[A] + C); - l.set(y[S].x, y[S].y, y[S].z), l.applyMatrix4(u[b]); - var w = {}; - for (var p in y[S]) - w[p] = y[S][p]; - w.x = l.x, w.y = l.y, w.z = l.z, w.bonds = o, w.sym = b, w.index = y.length, y.push(w); + for (w = 0; w < b[L].bonds.length; w++) + o.push(b[L].bonds[w] + S); + l.set(b[L].x, b[L].y, b[L].z), l.applyMatrix4(u[y]); + var A = {}; + for (var p in b[L]) + A[p] = b[L][p]; + A.x = l.x, A.y = l.y, A.z = l.z, A.bonds = o, A.sym = y, A.index = b.length, b.push(A); } - C = y.length; + S = b.length; } else - for (S = 0; S < c; S++) - y[S].sym = b; + for (L = 0; L < c; L++) + b[L].sym = y; if (s >= 0) { let l = new n.Vector3(); - for (S = 0; S < c; S++) - l.set(y[S].x, y[S].y, y[S].z), l.applyMatrix4(u[s]), y[S].x = l.x, y[S].y = l.y, y[S].z = l.z; + for (L = 0; L < c; L++) + l.set(b[L].x, b[L].y, b[L].z), l.applyMatrix4(u[s]), b[L].x = l.x, b[L].y = l.y, b[L].z = l.z; } u.length = 0; } @@ -19351,8 +19351,8 @@ ATOM`, g); !*** ./src/parsers/utils/standardResidues.ts ***! \***********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ standardResidues: () => ( /* binding */ @@ -19435,8 +19435,8 @@ ATOM`, g); !*** ./src/parsers/utils/validateBonds.ts ***! \********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ validateBonds: () => ( /* binding */ @@ -19445,12 +19445,12 @@ ATOM`, g); /* harmony export */ }); function n(f, u) { - for (var y = 0, h = f.length; y < h; y++) - for (var _ = f[y], E = 0; E < _.bonds.length; E++) { - var c = _.bonds[E], C = f[c], b = u[_.serial]; - if (C && b) { - var A = C.bonds.indexOf(b); - A < 0 && (C.bonds.push(b), C.bondOrder.push(_.bondOrder[E])); + for (var b = 0, h = f.length; b < h; b++) + for (var _ = f[b], E = 0; E < _.bonds.length; E++) { + var c = _.bonds[E], S = f[c], y = u[_.serial]; + if (S && y) { + var w = S.bonds.indexOf(y); + w < 0 && (S.bonds.push(y), S.bondOrder.push(_.bondOrder[E])); } } } @@ -19462,8 +19462,8 @@ ATOM`, g); !*** ./src/partialCharges.ts ***! \*******************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ applyPartialCharges: () => ( /* binding */ @@ -19645,8 +19645,8 @@ ATOM`, g); "VAL:C": 0.6, "VAL:O": -0.55 }; - function f(u, y) { - if ((!y || typeof u.partialCharge > "u") && u.resn && u.atom) { + function f(u, b) { + if ((!b || typeof u.partialCharge > "u") && u.resn && u.atom) { var h = u.resn + ":" + u.atom; u.properties.partialCharge = n[h]; } @@ -19659,8 +19659,8 @@ ATOM`, g); !*** ./src/specs.ts ***! \**********************/ /***/ - (r, e, t) => { - t.r(e); + (t, e, r) => { + r.r(e); } ), /***/ @@ -19773,64 +19773,64 @@ ATOM`, g); /*! ./colors */ "./src/colors.ts" ); - function extend(r, e) { - for (var t in e) - e.hasOwnProperty(t) && e[t] !== void 0 && (r[t] = e[t]); - return r; + function extend(t, e) { + for (var r in e) + e.hasOwnProperty(r) && e[r] !== void 0 && (t[r] = e[r]); + return t; } - function deepCopy(r) { - let e, t, n; - if (r == null) + function deepCopy(t) { + let e, r, n; + if (t == null) return {}; - if (typeof r != "object" || r === null) - return r; - e = Array.isArray(r) ? [] : {}; - for (n in r) - t = r[n], e[n] = deepCopy(t); + if (typeof t != "object" || t === null) + return t; + e = Array.isArray(t) ? [] : {}; + for (n in t) + r = t[n], e[n] = deepCopy(r); return e; } - function isNumeric(r) { - var e = typeof r; - return (e === "number" || e === "string") && !isNaN(r - parseFloat(r)); + function isNumeric(t) { + var e = typeof t; + return (e === "number" || e === "string") && !isNaN(t - parseFloat(t)); } - function isEmptyObject(r) { + function isEmptyObject(t) { var e; - for (e in r) + for (e in t) return !1; return !0; } function makeFunction(callback) { return callback && typeof callback == "string" && (callback = eval("(" + callback + ")")), callback && typeof callback != "function" ? null : callback; } - function adjustVolumeStyle(r) { - r && (r.volformat && !(r.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (r.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(r.voldata, r.volformat)), r.volscheme && (r.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(r.volscheme))); + function adjustVolumeStyle(t) { + t && (t.volformat && !(t.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (t.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(t.voldata, t.volformat)), t.volscheme && (t.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(t.volscheme))); } - function getExtent(r, e) { - var t, n, f, u, y, h, _, E, c, C, b = !e; - if (t = n = f = 9999, u = y = h = -9999, _ = E = c = C = 0, r.length === 0) + function getExtent(t, e) { + var r, n, f, u, b, h, _, E, c, S, y = !e; + if (r = n = f = 9999, u = b = h = -9999, _ = E = c = S = 0, t.length === 0) return [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; - for (var A = 0; A < r.length; A++) { - var S = r[A]; - if (!(typeof S > "u" || !isFinite(S.x) || !isFinite(S.y) || !isFinite(S.z)) && (C++, _ += S.x, E += S.y, c += S.z, t = t < S.x ? t : S.x, n = n < S.y ? n : S.y, f = f < S.z ? f : S.z, u = u > S.x ? u : S.x, y = y > S.y ? y : S.y, h = h > S.z ? h : S.z, S.symmetries && b)) - for (var s = 0; s < S.symmetries.length; s++) - C++, _ += S.symmetries[s].x, E += S.symmetries[s].y, c += S.symmetries[s].z, t = t < S.symmetries[s].x ? t : S.symmetries[s].x, n = n < S.symmetries[s].y ? n : S.symmetries[s].y, f = f < S.symmetries[s].z ? f : S.symmetries[s].z, u = u > S.symmetries[s].x ? u : S.symmetries[s].x, y = y > S.symmetries[s].y ? y : S.symmetries[s].y, h = h > S.symmetries[s].z ? h : S.symmetries[s].z; + for (var w = 0; w < t.length; w++) { + var L = t[w]; + if (!(typeof L > "u" || !isFinite(L.x) || !isFinite(L.y) || !isFinite(L.z)) && (S++, _ += L.x, E += L.y, c += L.z, r = r < L.x ? r : L.x, n = n < L.y ? n : L.y, f = f < L.z ? f : L.z, u = u > L.x ? u : L.x, b = b > L.y ? b : L.y, h = h > L.z ? h : L.z, L.symmetries && y)) + for (var s = 0; s < L.symmetries.length; s++) + S++, _ += L.symmetries[s].x, E += L.symmetries[s].y, c += L.symmetries[s].z, r = r < L.symmetries[s].x ? r : L.symmetries[s].x, n = n < L.symmetries[s].y ? n : L.symmetries[s].y, f = f < L.symmetries[s].z ? f : L.symmetries[s].z, u = u > L.symmetries[s].x ? u : L.symmetries[s].x, b = b > L.symmetries[s].y ? b : L.symmetries[s].y, h = h > L.symmetries[s].z ? h : L.symmetries[s].z; } return [ - [t, n, f], - [u, y, h], - [_ / C, E / C, c / C] + [r, n, f], + [u, b, h], + [_ / S, E / S, c / S] ]; } - function getPropertyRange(r, e) { - for (var t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, f = 0, u = r.length; f < u; f++) { - var y = r[f], h = getAtomProperty(y, e); - h != null && (h < t && (t = h), h > n && (n = h)); + function getPropertyRange(t, e) { + for (var r = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, f = 0, u = t.length; f < u; f++) { + var b = t[f], h = getAtomProperty(b, e); + h != null && (h < r && (r = h), h > n && (n = h)); } - return !isFinite(t) && !isFinite(n) ? t = n = 0 : isFinite(t) ? isFinite(n) || (n = t) : t = n, [t, n]; + return !isFinite(r) && !isFinite(n) ? r = n = 0 : isFinite(r) ? isFinite(n) || (n = r) : r = n, [r, n]; } class PausableTimer { - constructor(e, t, n) { - this.total_time_run = 0, this.fn = e, this.arg = n, this.countdown = t, this.start_time = (/* @__PURE__ */ new Date()).getTime(), this.ident = setTimeout(e, t, n); + constructor(e, r, n) { + this.total_time_run = 0, this.fn = e, this.arg = n, this.countdown = r, this.start_time = (/* @__PURE__ */ new Date()).getTime(), this.ident = setTimeout(e, r, n); } cancel() { clearTimeout(this.ident); @@ -19842,142 +19842,142 @@ ATOM`, g); this.ident = setTimeout(this.fn, Math.max(0, this.countdown - this.total_time_run), this.arg); } } - function base64ToArray(r) { - for (var e = window.atob(r), t = e.length, n = new Uint8Array(t), f = 0; f < t; f++) + function base64ToArray(t) { + for (var e = window.atob(t), r = e.length, n = new Uint8Array(r), f = 0; f < r; f++) n[f] = e.charCodeAt(f); return n; } - function getAtomProperty(r, e) { - var t = null; - return r.properties && typeof r.properties[e] < "u" ? t = r.properties[e] : typeof r[e] < "u" && (t = r[e]), t; + function getAtomProperty(t, e) { + var r = null; + return t.properties && typeof t.properties[e] < "u" ? r = t.properties[e] : typeof t[e] < "u" && (r = t[e]), r; } - function mergeGeos(r, e) { - var t = e.geometry; - t !== void 0 && r.geometryGroups.push(t.geometryGroups[0]); + function mergeGeos(t, e) { + var r = e.geometry; + r !== void 0 && t.geometryGroups.push(r.geometryGroups[0]); } - function specStringToObject(r) { - if (typeof r == "object") - return r; - if (typeof r > "u" || r == null) - return r; + function specStringToObject(t) { + if (typeof t == "object") + return t; + if (typeof t > "u" || t == null) + return t; try { - return JSON.parse(r); + return JSON.parse(t); } catch { } - r = r.replace(/%7E/g, "~"); - var e = function(b) { - return isNumeric(b) ? Math.floor(parseFloat(b)) == parseInt(b) || b.indexOf(".") >= 0 ? parseFloat(b) : parseInt(b) : b === "true" ? !0 : b === "false" ? !1 : b; - }, t = {}; - if (r === "all") - return t; - for (var n = r.split(";"), f = 0; f < n.length; f++) { - var u = n[f].split(":"), y = u[0], h = {}, _ = u[1]; + t = t.replace(/%7E/g, "~"); + var e = function(y) { + return isNumeric(y) ? Math.floor(parseFloat(y)) == parseInt(y) || y.indexOf(".") >= 0 ? parseFloat(y) : parseInt(y) : y === "true" ? !0 : y === "false" ? !1 : y; + }, r = {}; + if (t === "all") + return r; + for (var n = t.split(";"), f = 0; f < n.length; f++) { + var u = n[f].split(":"), b = u[0], h = {}, _ = u[1]; if (_) if (_ = _.replace(/~/g, "="), _.indexOf("=") !== -1) for (var E = _.split(","), c = 0; c < E.length; c++) { - var C = E[c].split("=", 2); - h[C[0]] = e(C[1]); + var S = E[c].split("=", 2); + h[S[0]] = e(S[1]); } else _.indexOf(",") !== -1 ? h = _.split(",") : h = e(_); - t[y] = h; + r[b] = h; } - return t; - } - function checkStatus(r) { - if (!r.ok) - throw new Error(`HTTP ${r.status} - ${r.statusText}`); return r; } - function get(r, e) { - var t = fetch(r).then(checkStatus).then((n) => n.text()); - return e ? t.then(e) : t; + function checkStatus(t) { + if (!t.ok) + throw new Error(`HTTP ${t.status} - ${t.statusText}`); + return t; + } + function get(t, e) { + var r = fetch(t).then(checkStatus).then((n) => n.text()); + return e ? r.then(e) : r; } - function getbin(r, e, t, n) { + function getbin(t, e, r, n) { var f; - return t == "POST" ? f = fetch(r, { method: "POST", body: n }).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()) : f = fetch(r).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()), e ? f.then(e) : f; + return r == "POST" ? f = fetch(t, { method: "POST", body: n }).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()) : f = fetch(t).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()), e ? f.then(e) : f; } - function download(r, e, t, n) { - var f = "", u = "", y = "", h = "", _ = null, E = e.addModel(); - if (r.indexOf(":") < 0 && (r.length == 4 ? r = "pdb:" + r : isNaN(r) ? r = "url:" + r : r = "cid:" + r), r.substring(0, 5) === "mmtf:") - u = t && t.pdbUri ? t.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", r = r.substring(5).toUpperCase(), h = u + r, t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), _ = new Promise(function(C) { - getbin(h).then(function(b) { - E.addMolData(b, "mmtf", t), e.zoomTo(), e.render(), C(E); + function download(t, e, r, n) { + var f = "", u = "", b = "", h = "", _ = null, E = e.addModel(); + if (t.indexOf(":") < 0 && (t.length == 4 ? t = "pdb:" + t : isNaN(t) ? t = "url:" + t : t = "cid:" + t), t.substring(0, 5) === "mmtf:") + u = r && r.pdbUri ? r.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", t = t.substring(5).toUpperCase(), h = u + t, r && typeof r.noComputeSecondaryStructure > "u" && (r.noComputeSecondaryStructure = !0), _ = new Promise(function(S) { + getbin(h).then(function(y) { + E.addMolData(y, "mmtf", r), e.zoomTo(), e.render(), S(E); }, function() { console.log("fetch of " + h + " failed."); }); }); else { - if (r.substring(0, 4) === "pdb:") { - if (f = "mmtf", t && t.format && (f = t.format), t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), r = r.substring(4).toUpperCase(), !r.match(/^[1-9][A-Za-z0-9]{3}$/)) { + if (t.substring(0, 4) === "pdb:") { + if (f = "mmtf", r && r.format && (f = r.format), r && typeof r.noComputeSecondaryStructure > "u" && (r.noComputeSecondaryStructure = !0), t = t.substring(4).toUpperCase(), !t.match(/^[1-9][A-Za-z0-9]{3}$/)) { alert("Wrong PDB ID"); return; } - f == "mmtf" ? (y = t && t.mmtfUri ? t.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", h = y + r.toUpperCase()) : (u = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = u + r + "." + f); - } else if (r.substring(0, 4) == "cid:") { - if (f = "sdf", r = r.substring(4), !r.match(/^[0-9]+$/)) { + f == "mmtf" ? (b = r && r.mmtfUri ? r.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", h = b + t.toUpperCase()) : (u = r && r.pdbUri ? r.pdbUri : "https://files.rcsb.org/view/", h = u + t + "." + f); + } else if (t.substring(0, 4) == "cid:") { + if (f = "sdf", t = t.substring(4), !t.match(/^[0-9]+$/)) { alert("Wrong Compound ID"); return; } - h = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + r + "/SDF?record_type=3d"; + h = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + t + "/SDF?record_type=3d"; } else - r.substring(0, 4) == "url:" && (h = r.substring(4), f = h); - var c = function(C) { - E.addMolData(C, f, t), e.zoomTo(), e.render(); + t.substring(0, 4) == "url:" && (h = t.substring(4), f = h); + var c = function(S) { + E.addMolData(S, f, r), e.zoomTo(), e.render(); }; - _ = new Promise(function(C) { - f == "mmtf" ? getbin(h).then(function(b) { - c(b), C(E); + _ = new Promise(function(S) { + f == "mmtf" ? getbin(h).then(function(y) { + c(y), S(E); }).catch(function() { - u = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = u + r + ".pdb", f = "pdb", console.log("falling back to pdb format"), get(h).then(function(b) { - c(b), C(E); - }).catch(function(b) { - c(""), C(E), console.log("fetch of " + h + " failed: " + b.statusText); + u = r && r.pdbUri ? r.pdbUri : "https://files.rcsb.org/view/", h = u + t + ".pdb", f = "pdb", console.log("falling back to pdb format"), get(h).then(function(y) { + c(y), S(E); + }).catch(function(y) { + c(""), S(E), console.log("fetch of " + h + " failed: " + y.statusText); }); - }) : get(h).then(function(b) { - c(b), C(E); - }).catch(function(b) { - c(""), C(E), console.log("fetch of " + h + " failed: " + b.statusText); + }) : get(h).then(function(y) { + c(y), S(E); + }).catch(function(y) { + c(""), S(E), console.log("fetch of " + h + " failed: " + y.statusText); }); }); } - return n ? (_.then(function(C) { - n(C); + return n ? (_.then(function(S) { + n(S); }), E) : _; } - function getColorFromStyle(r, e) { - let t = e.colorscheme; - if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] < "u") - t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t]; - else if (typeof t == "string" && t.endsWith("Carbon")) { - let y = t.substring(0, t.lastIndexOf("Carbon")).toLowerCase(); - if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[y] < "u") { + function getColorFromStyle(t, e) { + let r = e.colorscheme; + if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r] < "u") + r = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]; + else if (typeof r == "string" && r.endsWith("Carbon")) { + let b = r.substring(0, r.lastIndexOf("Carbon")).toLowerCase(); + if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[b] < "u") { let h = Object.assign({}, _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors.defaultColors); - h.C = _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[y], _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] = { prop: "elem", map: h }, t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t]; - } - } - let n = r.color; - if (typeof e.color < "u" && e.color != "spectrum" && (n = e.color), typeof t < "u") { - let y, h; - if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t] < "u") - t = _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t], typeof t[r[t.prop]] < "u" && (n = t.map[r[t.prop]]); - else if (typeof t[r[t.prop]] < "u") - n = t.map[r[t.prop]]; - else if (typeof t.prop < "u" && typeof t.gradient < "u") { - y = t.prop; - var f = t.gradient; - typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f] < "u" && (f = new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f](t.min, t.max, t.mid ? t.mid : t.colors)); + h.C = _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[b], _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r] = { prop: "elem", map: h }, r = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]; + } + } + let n = t.color; + if (typeof e.color < "u" && e.color != "spectrum" && (n = e.color), typeof r < "u") { + let b, h; + if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r] < "u") + r = _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r], typeof r[t[r.prop]] < "u" && (n = r.map[t[r.prop]]); + else if (typeof r[t[r.prop]] < "u") + n = r.map[t[r.prop]]; + else if (typeof r.prop < "u" && typeof r.gradient < "u") { + b = r.prop; + var f = r.gradient; + typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f] < "u" && (f = new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f](r.min, r.max, r.mid ? r.mid : r.colors)); let _ = f.range() || [-1, 1]; - h = getAtomProperty(r, y), h != null && (n = f.valueToHex(h, _)); + h = getAtomProperty(t, b), h != null && (n = f.valueToHex(h, _)); } else - typeof t.prop < "u" && typeof t.map < "u" ? (y = t.prop, h = getAtomProperty(r, y), typeof t.map[h] < "u" && (n = t.map[h])) : typeof e.colorscheme[r.elem] < "u" ? n = e.colorscheme[r.elem] : console.log("Could not interpret colorscheme " + t); + typeof r.prop < "u" && typeof r.map < "u" ? (b = r.prop, h = getAtomProperty(t, b), typeof r.map[h] < "u" && (n = r.map[h])) : typeof e.colorscheme[t.elem] < "u" ? n = e.colorscheme[t.elem] : console.log("Could not interpret colorscheme " + r); } else - typeof e.colorfunc < "u" && (n = e.colorfunc(r)); + typeof e.colorfunc < "u" && (n = e.colorfunc(t)); return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(n); } - function getElement(r) { - let e = r; - return typeof r == "string" ? e = document.querySelector("#" + r) : typeof r == "object" && r.get && (e = r.get(0)), e; + function getElement(t) { + let e = t; + return typeof t == "string" ? e = document.querySelector("#" + t) : typeof t == "object" && t.get && (e = t.get(0)), e; } } ), @@ -19987,121 +19987,121 @@ ATOM`, g); !*** ./node_modules/upng-js/UPNG.js ***! \**************************************/ /***/ - (r, e, t) => { + (t, e, r) => { (function() { var n = {}, f; - r.exports = n, f = t( + t.exports = n, f = r( /*! pako */ "./node_modules/upng-js/node_modules/pako/index.js" - ), function(u, y) { + ), function(u, b) { u.toRGBA8 = function(h) { var _ = h.width, E = h.height; if (h.tabs.acTL == null) return [u.toRGBA8.decodeImage(h.data, _, E, h).buffer]; var c = []; h.frames[0].data == null && (h.frames[0].data = h.data); - for (var C, b = new Uint8Array(_ * E * 4), A = 0; A < h.frames.length; A++) { - var S = h.frames[A], s = S.rect.x, o = S.rect.y, w = S.rect.width, p = S.rect.height, v = u.toRGBA8.decodeImage(S.data, w, p, h); - if (A == 0 ? C = v : S.blend == 0 ? u._copyTile(v, w, p, C, _, E, s, o, 0) : S.blend == 1 && u._copyTile(v, w, p, C, _, E, s, o, 1), c.push(C.buffer), C = C.slice(0), S.dispose != 0) { - if (S.dispose == 1) - u._copyTile(b, w, p, C, _, E, s, o, 0); - else if (S.dispose == 2) { - for (var a = A - 1; h.frames[a].dispose == 2; ) + for (var S, y = new Uint8Array(_ * E * 4), w = 0; w < h.frames.length; w++) { + var L = h.frames[w], s = L.rect.x, o = L.rect.y, A = L.rect.width, p = L.rect.height, v = u.toRGBA8.decodeImage(L.data, A, p, h); + if (w == 0 ? S = v : L.blend == 0 ? u._copyTile(v, A, p, S, _, E, s, o, 0) : L.blend == 1 && u._copyTile(v, A, p, S, _, E, s, o, 1), c.push(S.buffer), S = S.slice(0), L.dispose != 0) { + if (L.dispose == 1) + u._copyTile(y, A, p, S, _, E, s, o, 0); + else if (L.dispose == 2) { + for (var a = w - 1; h.frames[a].dispose == 2; ) a--; - C = new Uint8Array(c[a]).slice(0); + S = new Uint8Array(c[a]).slice(0); } } } return c; }, u.toRGBA8.decodeImage = function(h, _, E, c) { - var C = _ * E, b = u.decode._getBPP(c), A = Math.ceil(_ * b / 8), S = new Uint8Array(C * 4), s = new Uint32Array(S.buffer), o = c.ctype, w = c.depth, p = u._bin.readUshort; + var S = _ * E, y = u.decode._getBPP(c), w = Math.ceil(_ * y / 8), L = new Uint8Array(S * 4), s = new Uint32Array(L.buffer), o = c.ctype, A = c.depth, p = u._bin.readUshort; if (o == 6) { - var v = C << 2; - if (w == 8) + var v = S << 2; + if (A == 8) for (var a = 0; a < v; a++) - S[a] = h[a]; - if (w == 16) + L[a] = h[a]; + if (A == 16) for (var a = 0; a < v; a++) - S[a] = h[a << 1]; + L[a] = h[a << 1]; } else if (o == 2) { - var l = c.tabs.tRNS, g = -1, M = -1, L = -1; - if (l && (g = l[0], M = l[1], L = l[2]), w == 8) - for (var a = 0; a < C; a++) { + var l = c.tabs.tRNS, g = -1, M = -1, C = -1; + if (l && (g = l[0], M = l[1], C = l[2]), A == 8) + for (var a = 0; a < S; a++) { var T = a << 2, D = a * 3; - S[T] = h[D], S[T + 1] = h[D + 1], S[T + 2] = h[D + 2], S[T + 3] = 255, g != -1 && h[D] == g && h[D + 1] == M && h[D + 2] == L && (S[T + 3] = 0); + L[T] = h[D], L[T + 1] = h[D + 1], L[T + 2] = h[D + 2], L[T + 3] = 255, g != -1 && h[D] == g && h[D + 1] == M && h[D + 2] == C && (L[T + 3] = 0); } - if (w == 16) - for (var a = 0; a < C; a++) { + if (A == 16) + for (var a = 0; a < S; a++) { var T = a << 2, D = a * 6; - S[T] = h[D], S[T + 1] = h[D + 2], S[T + 2] = h[D + 4], S[T + 3] = 255, g != -1 && p(h, D) == g && p(h, D + 2) == M && p(h, D + 4) == L && (S[T + 3] = 0); + L[T] = h[D], L[T + 1] = h[D + 2], L[T + 2] = h[D + 4], L[T + 3] = 255, g != -1 && p(h, D) == g && p(h, D + 2) == M && p(h, D + 4) == C && (L[T + 3] = 0); } } else if (o == 3) { - var I = c.tabs.PLTE, z = c.tabs.tRNS, P = z ? z.length : 0; - if (w == 1) - for (var B = 0; B < E; B++) - for (var k = B * A, N = B * _, a = 0; a < _; a++) { - var T = N + a << 2, $ = h[k + (a >> 3)] >> 7 - ((a & 7) << 0) & 1, F = 3 * $; - S[T] = I[F], S[T + 1] = I[F + 1], S[T + 2] = I[F + 2], S[T + 3] = $ < P ? z[$] : 255; + var I = c.tabs.PLTE, B = c.tabs.tRNS, P = B ? B.length : 0; + if (A == 1) + for (var z = 0; z < E; z++) + for (var k = z * w, N = z * _, a = 0; a < _; a++) { + var T = N + a << 2, R = h[k + (a >> 3)] >> 7 - ((a & 7) << 0) & 1, U = 3 * R; + L[T] = I[U], L[T + 1] = I[U + 1], L[T + 2] = I[U + 2], L[T + 3] = R < P ? B[R] : 255; } - if (w == 2) - for (var B = 0; B < E; B++) - for (var k = B * A, N = B * _, a = 0; a < _; a++) { - var T = N + a << 2, $ = h[k + (a >> 2)] >> 6 - ((a & 3) << 1) & 3, F = 3 * $; - S[T] = I[F], S[T + 1] = I[F + 1], S[T + 2] = I[F + 2], S[T + 3] = $ < P ? z[$] : 255; + if (A == 2) + for (var z = 0; z < E; z++) + for (var k = z * w, N = z * _, a = 0; a < _; a++) { + var T = N + a << 2, R = h[k + (a >> 2)] >> 6 - ((a & 3) << 1) & 3, U = 3 * R; + L[T] = I[U], L[T + 1] = I[U + 1], L[T + 2] = I[U + 2], L[T + 3] = R < P ? B[R] : 255; } - if (w == 4) - for (var B = 0; B < E; B++) - for (var k = B * A, N = B * _, a = 0; a < _; a++) { - var T = N + a << 2, $ = h[k + (a >> 1)] >> 4 - ((a & 1) << 2) & 15, F = 3 * $; - S[T] = I[F], S[T + 1] = I[F + 1], S[T + 2] = I[F + 2], S[T + 3] = $ < P ? z[$] : 255; + if (A == 4) + for (var z = 0; z < E; z++) + for (var k = z * w, N = z * _, a = 0; a < _; a++) { + var T = N + a << 2, R = h[k + (a >> 1)] >> 4 - ((a & 1) << 2) & 15, U = 3 * R; + L[T] = I[U], L[T + 1] = I[U + 1], L[T + 2] = I[U + 2], L[T + 3] = R < P ? B[R] : 255; } - if (w == 8) - for (var a = 0; a < C; a++) { - var T = a << 2, $ = h[a], F = 3 * $; - S[T] = I[F], S[T + 1] = I[F + 1], S[T + 2] = I[F + 2], S[T + 3] = $ < P ? z[$] : 255; + if (A == 8) + for (var a = 0; a < S; a++) { + var T = a << 2, R = h[a], U = 3 * R; + L[T] = I[U], L[T + 1] = I[U + 1], L[T + 2] = I[U + 2], L[T + 3] = R < P ? B[R] : 255; } } else if (o == 4) { - if (w == 8) - for (var a = 0; a < C; a++) { - var T = a << 2, G = a << 1, H = h[G]; - S[T] = H, S[T + 1] = H, S[T + 2] = H, S[T + 3] = h[G + 1]; + if (A == 8) + for (var a = 0; a < S; a++) { + var T = a << 2, W = a << 1, G = h[W]; + L[T] = G, L[T + 1] = G, L[T + 2] = G, L[T + 3] = h[W + 1]; } - if (w == 16) - for (var a = 0; a < C; a++) { - var T = a << 2, G = a << 2, H = h[G]; - S[T] = H, S[T + 1] = H, S[T + 2] = H, S[T + 3] = h[G + 2]; + if (A == 16) + for (var a = 0; a < S; a++) { + var T = a << 2, W = a << 2, G = h[W]; + L[T] = G, L[T + 1] = G, L[T + 2] = G, L[T + 3] = h[W + 2]; } } else if (o == 0) { var g = c.tabs.tRNS ? c.tabs.tRNS : -1; - if (w == 1) - for (var a = 0; a < C; a++) { - var H = 255 * (h[a >> 3] >> 7 - (a & 7) & 1), U = H == g * 255 ? 0 : 255; - s[a] = U << 24 | H << 16 | H << 8 | H; + if (A == 1) + for (var a = 0; a < S; a++) { + var G = 255 * (h[a >> 3] >> 7 - (a & 7) & 1), F = G == g * 255 ? 0 : 255; + s[a] = F << 24 | G << 16 | G << 8 | G; } - if (w == 2) - for (var a = 0; a < C; a++) { - var H = 85 * (h[a >> 2] >> 6 - ((a & 3) << 1) & 3), U = H == g * 85 ? 0 : 255; - s[a] = U << 24 | H << 16 | H << 8 | H; + if (A == 2) + for (var a = 0; a < S; a++) { + var G = 85 * (h[a >> 2] >> 6 - ((a & 3) << 1) & 3), F = G == g * 85 ? 0 : 255; + s[a] = F << 24 | G << 16 | G << 8 | G; } - if (w == 4) - for (var a = 0; a < C; a++) { - var H = 17 * (h[a >> 1] >> 4 - ((a & 1) << 2) & 15), U = H == g * 17 ? 0 : 255; - s[a] = U << 24 | H << 16 | H << 8 | H; + if (A == 4) + for (var a = 0; a < S; a++) { + var G = 17 * (h[a >> 1] >> 4 - ((a & 1) << 2) & 15), F = G == g * 17 ? 0 : 255; + s[a] = F << 24 | G << 16 | G << 8 | G; } - if (w == 8) - for (var a = 0; a < C; a++) { - var H = h[a], U = H == g ? 0 : 255; - s[a] = U << 24 | H << 16 | H << 8 | H; + if (A == 8) + for (var a = 0; a < S; a++) { + var G = h[a], F = G == g ? 0 : 255; + s[a] = F << 24 | G << 16 | G << 8 | G; } - if (w == 16) - for (var a = 0; a < C; a++) { - var H = h[a << 1], U = p(h, a << 1) == g ? 0 : 255; - s[a] = U << 24 | H << 16 | H << 8 | H; + if (A == 16) + for (var a = 0; a < S; a++) { + var G = h[a << 1], F = p(h, a << 1) == g ? 0 : 255; + s[a] = F << 24 | G << 16 | G << 8 | G; } } - return S; + return L; }, u.decode = function(h) { - for (var _ = new Uint8Array(h), E = 8, c = u._bin, C = c.readUshort, b = c.readUint, A = { tabs: {}, frames: [] }, S = new Uint8Array(_.length), s = 0, o, w = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], v = 0; v < 8; v++) + for (var _ = new Uint8Array(h), E = 8, c = u._bin, S = c.readUshort, y = c.readUint, w = { tabs: {}, frames: [] }, L = new Uint8Array(_.length), s = 0, o, A = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], v = 0; v < 8; v++) if (_[v] != p[v]) throw "The input is not a PNG file!"; for (; E < _.length; ) { @@ -20109,156 +20109,156 @@ ATOM`, g); E += 4; var l = c.readASCII(_, E, 4); if (E += 4, l == "IHDR") - u.decode._IHDR(_, E, A); + u.decode._IHDR(_, E, w); else if (l == "IDAT") { for (var v = 0; v < a; v++) - S[s + v] = _[E + v]; + L[s + v] = _[E + v]; s += a; } else if (l == "acTL") - A.tabs[l] = { num_frames: b(_, E), num_plays: b(_, E + 4) }, o = new Uint8Array(_.length); + w.tabs[l] = { num_frames: y(_, E), num_plays: y(_, E + 4) }, o = new Uint8Array(_.length); else if (l == "fcTL") { - if (w != 0) { - var g = A.frames[A.frames.length - 1]; - g.data = u.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; + if (A != 0) { + var g = w.frames[w.frames.length - 1]; + g.data = u.decode._decompress(w, o.slice(0, A), g.rect.width, g.rect.height), A = 0; } - var M = { x: b(_, E + 12), y: b(_, E + 16), width: b(_, E + 4), height: b(_, E + 8) }, L = C(_, E + 22); - L = C(_, E + 20) / (L == 0 ? 100 : L); - var T = { rect: M, delay: Math.round(L * 1e3), dispose: _[E + 24], blend: _[E + 25] }; - A.frames.push(T); + var M = { x: y(_, E + 12), y: y(_, E + 16), width: y(_, E + 4), height: y(_, E + 8) }, C = S(_, E + 22); + C = S(_, E + 20) / (C == 0 ? 100 : C); + var T = { rect: M, delay: Math.round(C * 1e3), dispose: _[E + 24], blend: _[E + 25] }; + w.frames.push(T); } else if (l == "fdAT") { for (var v = 0; v < a - 4; v++) - o[w + v] = _[E + v + 4]; - w += a - 4; + o[A + v] = _[E + v + 4]; + A += a - 4; } else if (l == "pHYs") - A.tabs[l] = [c.readUint(_, E), c.readUint(_, E + 4), _[E + 8]]; + w.tabs[l] = [c.readUint(_, E), c.readUint(_, E + 4), _[E + 8]]; else if (l == "cHRM") { - A.tabs[l] = []; + w.tabs[l] = []; for (var v = 0; v < 8; v++) - A.tabs[l].push(c.readUint(_, E + v * 4)); + w.tabs[l].push(c.readUint(_, E + v * 4)); } else if (l == "tEXt") { - A.tabs[l] == null && (A.tabs[l] = {}); - var D = c.nextZero(_, E), I = c.readASCII(_, E, D - E), z = c.readASCII(_, D + 1, E + a - D - 1); - A.tabs[l][I] = z; + w.tabs[l] == null && (w.tabs[l] = {}); + var D = c.nextZero(_, E), I = c.readASCII(_, E, D - E), B = c.readASCII(_, D + 1, E + a - D - 1); + w.tabs[l][I] = B; } else if (l == "iTXt") { - A.tabs[l] == null && (A.tabs[l] = {}); + w.tabs[l] == null && (w.tabs[l] = {}); var D = 0, P = E; D = c.nextZero(_, P); var I = c.readASCII(_, P, D - P); P = D + 1, _[P], _[P + 1], P += 2, D = c.nextZero(_, P), c.readASCII(_, P, D - P), P = D + 1, D = c.nextZero(_, P), c.readUTF8(_, P, D - P), P = D + 1; - var z = c.readUTF8(_, P, a - (P - E)); - A.tabs[l][I] = z; + var B = c.readUTF8(_, P, a - (P - E)); + w.tabs[l][I] = B; } else if (l == "PLTE") - A.tabs[l] = c.readBytes(_, E, a); + w.tabs[l] = c.readBytes(_, E, a); else if (l == "hIST") { - var B = A.tabs.PLTE.length / 3; - A.tabs[l] = []; - for (var v = 0; v < B; v++) - A.tabs[l].push(C(_, E + v * 2)); + var z = w.tabs.PLTE.length / 3; + w.tabs[l] = []; + for (var v = 0; v < z; v++) + w.tabs[l].push(S(_, E + v * 2)); } else if (l == "tRNS") - A.ctype == 3 ? A.tabs[l] = c.readBytes(_, E, a) : A.ctype == 0 ? A.tabs[l] = C(_, E) : A.ctype == 2 && (A.tabs[l] = [C(_, E), C(_, E + 2), C(_, E + 4)]); + w.ctype == 3 ? w.tabs[l] = c.readBytes(_, E, a) : w.ctype == 0 ? w.tabs[l] = S(_, E) : w.ctype == 2 && (w.tabs[l] = [S(_, E), S(_, E + 2), S(_, E + 4)]); else if (l == "gAMA") - A.tabs[l] = c.readUint(_, E) / 1e5; + w.tabs[l] = c.readUint(_, E) / 1e5; else if (l == "sRGB") - A.tabs[l] = _[E]; + w.tabs[l] = _[E]; else if (l == "bKGD") - A.ctype == 0 || A.ctype == 4 ? A.tabs[l] = [C(_, E)] : A.ctype == 2 || A.ctype == 6 ? A.tabs[l] = [C(_, E), C(_, E + 2), C(_, E + 4)] : A.ctype == 3 && (A.tabs[l] = _[E]); + w.ctype == 0 || w.ctype == 4 ? w.tabs[l] = [S(_, E)] : w.ctype == 2 || w.ctype == 6 ? w.tabs[l] = [S(_, E), S(_, E + 2), S(_, E + 4)] : w.ctype == 3 && (w.tabs[l] = _[E]); else if (l == "IEND") { - if (w != 0) { - var g = A.frames[A.frames.length - 1]; - g.data = u.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; + if (A != 0) { + var g = w.frames[w.frames.length - 1]; + g.data = u.decode._decompress(w, o.slice(0, A), g.rect.width, g.rect.height), A = 0; } - A.data = u.decode._decompress(A, S, A.width, A.height); + w.data = u.decode._decompress(w, L, w.width, w.height); break; } E += a, c.readUint(_, E), E += 4; } - return delete A.compress, delete A.interlace, delete A.filter, A; + return delete w.compress, delete w.interlace, delete w.filter, w; }, u.decode._decompress = function(h, _, E, c) { return h.compress == 0 && (_ = u.decode._inflate(_)), h.interlace == 0 ? _ = u.decode._filterZero(_, h, 0, E, c) : h.interlace == 1 && (_ = u.decode._readInterlace(_, h)), _; }, u.decode._inflate = function(h) { - return y.inflate(h); + return b.inflate(h); }, u.decode._readInterlace = function(h, _) { - for (var E = _.width, c = _.height, C = u.decode._getBPP(_), b = C >> 3, A = Math.ceil(E * C / 8), S = new Uint8Array(c * A), s = 0, o = [0, 0, 4, 0, 2, 0, 1], w = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], v = [8, 8, 4, 4, 2, 2, 1], a = 0; a < 7; ) { - for (var l = p[a], g = v[a], M = 0, L = 0, T = o[a]; T < c; ) - T += l, L++; - for (var D = w[a]; D < E; ) + for (var E = _.width, c = _.height, S = u.decode._getBPP(_), y = S >> 3, w = Math.ceil(E * S / 8), L = new Uint8Array(c * w), s = 0, o = [0, 0, 4, 0, 2, 0, 1], A = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], v = [8, 8, 4, 4, 2, 2, 1], a = 0; a < 7; ) { + for (var l = p[a], g = v[a], M = 0, C = 0, T = o[a]; T < c; ) + T += l, C++; + for (var D = A[a]; D < E; ) D += g, M++; - var I = Math.ceil(M * C / 8); - u.decode._filterZero(h, _, s, M, L); - for (var z = 0, P = o[a]; P < c; ) { - for (var B = w[a], k = s + z * I << 3; B < E; ) { - if (C == 1) { + var I = Math.ceil(M * S / 8); + u.decode._filterZero(h, _, s, M, C); + for (var B = 0, P = o[a]; P < c; ) { + for (var z = A[a], k = s + B * I << 3; z < E; ) { + if (S == 1) { var N = h[k >> 3]; - N = N >> 7 - (k & 7) & 1, S[P * A + (B >> 3)] |= N << 7 - ((B & 3) << 0); + N = N >> 7 - (k & 7) & 1, L[P * w + (z >> 3)] |= N << 7 - ((z & 3) << 0); } - if (C == 2) { + if (S == 2) { var N = h[k >> 3]; - N = N >> 6 - (k & 7) & 3, S[P * A + (B >> 2)] |= N << 6 - ((B & 3) << 1); + N = N >> 6 - (k & 7) & 3, L[P * w + (z >> 2)] |= N << 6 - ((z & 3) << 1); } - if (C == 4) { + if (S == 4) { var N = h[k >> 3]; - N = N >> 4 - (k & 7) & 15, S[P * A + (B >> 1)] |= N << 4 - ((B & 1) << 2); + N = N >> 4 - (k & 7) & 15, L[P * w + (z >> 1)] |= N << 4 - ((z & 1) << 2); } - if (C >= 8) - for (var $ = P * A + B * b, F = 0; F < b; F++) - S[$ + F] = h[(k >> 3) + F]; - k += C, B += g; + if (S >= 8) + for (var R = P * w + z * y, U = 0; U < y; U++) + L[R + U] = h[(k >> 3) + U]; + k += S, z += g; } - z++, P += l; + B++, P += l; } - M * L != 0 && (s += L * (1 + I)), a = a + 1; + M * C != 0 && (s += C * (1 + I)), a = a + 1; } - return S; + return L; }, u.decode._getBPP = function(h) { var _ = [1, null, 3, 1, 2, null, 4][h.ctype]; return _ * h.depth; - }, u.decode._filterZero = function(h, _, E, c, C) { - var b = u.decode._getBPP(_), A = Math.ceil(c * b / 8), S = u.decode._paeth; - b = Math.ceil(b / 8); - for (var s = 0; s < C; s++) { - var o = E + s * A, w = o + s + 1, p = h[w - 1]; + }, u.decode._filterZero = function(h, _, E, c, S) { + var y = u.decode._getBPP(_), w = Math.ceil(c * y / 8), L = u.decode._paeth; + y = Math.ceil(y / 8); + for (var s = 0; s < S; s++) { + var o = E + s * w, A = o + s + 1, p = h[A - 1]; if (p == 0) - for (var v = 0; v < A; v++) - h[o + v] = h[w + v]; + for (var v = 0; v < w; v++) + h[o + v] = h[A + v]; else if (p == 1) { - for (var v = 0; v < b; v++) - h[o + v] = h[w + v]; - for (var v = b; v < A; v++) - h[o + v] = h[w + v] + h[o + v - b] & 255; + for (var v = 0; v < y; v++) + h[o + v] = h[A + v]; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] + h[o + v - y] & 255; } else if (s == 0) { - for (var v = 0; v < b; v++) - h[o + v] = h[w + v]; + for (var v = 0; v < y; v++) + h[o + v] = h[A + v]; if (p == 2) - for (var v = b; v < A; v++) - h[o + v] = h[w + v] & 255; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] & 255; if (p == 3) - for (var v = b; v < A; v++) - h[o + v] = h[w + v] + (h[o + v - b] >> 1) & 255; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] + (h[o + v - y] >> 1) & 255; if (p == 4) - for (var v = b; v < A; v++) - h[o + v] = h[w + v] + S(h[o + v - b], 0, 0) & 255; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] + L(h[o + v - y], 0, 0) & 255; } else { if (p == 2) - for (var v = 0; v < A; v++) - h[o + v] = h[w + v] + h[o + v - A] & 255; + for (var v = 0; v < w; v++) + h[o + v] = h[A + v] + h[o + v - w] & 255; if (p == 3) { - for (var v = 0; v < b; v++) - h[o + v] = h[w + v] + (h[o + v - A] >> 1) & 255; - for (var v = b; v < A; v++) - h[o + v] = h[w + v] + (h[o + v - A] + h[o + v - b] >> 1) & 255; + for (var v = 0; v < y; v++) + h[o + v] = h[A + v] + (h[o + v - w] >> 1) & 255; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] + (h[o + v - w] + h[o + v - y] >> 1) & 255; } if (p == 4) { - for (var v = 0; v < b; v++) - h[o + v] = h[w + v] + S(0, h[o + v - A], 0) & 255; - for (var v = b; v < A; v++) - h[o + v] = h[w + v] + S(h[o + v - b], h[o + v - A], h[o + v - b - A]) & 255; + for (var v = 0; v < y; v++) + h[o + v] = h[A + v] + L(0, h[o + v - w], 0) & 255; + for (var v = y; v < w; v++) + h[o + v] = h[A + v] + L(h[o + v - y], h[o + v - w], h[o + v - y - w]) & 255; } } } return h; }, u.decode._paeth = function(h, _, E) { - var c = h + _ - E, C = Math.abs(c - h), b = Math.abs(c - _), A = Math.abs(c - E); - return C <= b && C <= A ? h : b <= A ? _ : E; + var c = h + _ - E, S = Math.abs(c - h), y = Math.abs(c - _), w = Math.abs(c - E); + return S <= y && S <= w ? h : y <= w ? _ : E; }, u.decode._IHDR = function(h, _, E) { var c = u._bin; E.width = c.readUint(h, _), _ += 4, E.height = c.readUint(h, _), _ += 4, E.depth = h[_], _++, E.ctype = h[_], _++, E.compress = h[_], _++, E.filter = h[_], _++, E.interlace = h[_], _++; @@ -20281,8 +20281,8 @@ ATOM`, g); h[_] = E >> 24 & 255, h[_ + 1] = E >> 16 & 255, h[_ + 2] = E >> 8 & 255, h[_ + 3] = E & 255; }, readASCII: function(h, _, E) { - for (var c = "", C = 0; C < E; C++) - c += String.fromCharCode(h[_ + C]); + for (var c = "", S = 0; S < E; S++) + c += String.fromCharCode(h[_ + S]); return c; }, writeASCII: function(h, _, E) { @@ -20290,199 +20290,199 @@ ATOM`, g); h[_ + c] = E.charCodeAt(c); }, readBytes: function(h, _, E) { - for (var c = [], C = 0; C < E; C++) - c.push(h[_ + C]); + for (var c = [], S = 0; S < E; S++) + c.push(h[_ + S]); return c; }, pad: function(h) { return h.length < 2 ? "0" + h : h; }, readUTF8: function(h, _, E) { - for (var c = "", C, b = 0; b < E; b++) - c += "%" + u._bin.pad(h[_ + b].toString(16)); + for (var c = "", S, y = 0; y < E; y++) + c += "%" + u._bin.pad(h[_ + y].toString(16)); try { - C = decodeURIComponent(c); + S = decodeURIComponent(c); } catch { return u._bin.readASCII(h, _, E); } - return C; + return S; } - }, u._copyTile = function(h, _, E, c, C, b, A, S, s) { - for (var o = Math.min(_, C), w = Math.min(E, b), p = 0, v = 0, a = 0; a < w; a++) + }, u._copyTile = function(h, _, E, c, S, y, w, L, s) { + for (var o = Math.min(_, S), A = Math.min(E, y), p = 0, v = 0, a = 0; a < A; a++) for (var l = 0; l < o; l++) - if (A >= 0 && S >= 0 ? (p = a * _ + l << 2, v = (S + a) * C + A + l << 2) : (p = (-S + a) * _ - A + l << 2, v = a * C + l << 2), s == 0) + if (w >= 0 && L >= 0 ? (p = a * _ + l << 2, v = (L + a) * S + w + l << 2) : (p = (-L + a) * _ - w + l << 2, v = a * S + l << 2), s == 0) c[v] = h[p], c[v + 1] = h[p + 1], c[v + 2] = h[p + 2], c[v + 3] = h[p + 3]; else if (s == 1) { - var g = h[p + 3] * 0.00392156862745098, M = h[p] * g, L = h[p + 1] * g, T = h[p + 2] * g, D = c[v + 3] * (1 / 255), I = c[v] * D, z = c[v + 1] * D, P = c[v + 2] * D, B = 1 - g, k = g + D * B, N = k == 0 ? 0 : 1 / k; - c[v + 3] = 255 * k, c[v + 0] = (M + I * B) * N, c[v + 1] = (L + z * B) * N, c[v + 2] = (T + P * B) * N; + var g = h[p + 3] * 0.00392156862745098, M = h[p] * g, C = h[p + 1] * g, T = h[p + 2] * g, D = c[v + 3] * (1 / 255), I = c[v] * D, B = c[v + 1] * D, P = c[v + 2] * D, z = 1 - g, k = g + D * z, N = k == 0 ? 0 : 1 / k; + c[v + 3] = 255 * k, c[v + 0] = (M + I * z) * N, c[v + 1] = (C + B * z) * N, c[v + 2] = (T + P * z) * N; } else if (s == 2) { - var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], z = c[v + 1], P = c[v + 2]; - g == D && M == I && L == z && T == P ? (c[v] = 0, c[v + 1] = 0, c[v + 2] = 0, c[v + 3] = 0) : (c[v] = M, c[v + 1] = L, c[v + 2] = T, c[v + 3] = g); + var g = h[p + 3], M = h[p], C = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], B = c[v + 1], P = c[v + 2]; + g == D && M == I && C == B && T == P ? (c[v] = 0, c[v + 1] = 0, c[v + 2] = 0, c[v + 3] = 0) : (c[v] = M, c[v + 1] = C, c[v + 2] = T, c[v + 3] = g); } else if (s == 3) { - var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], z = c[v + 1], P = c[v + 2]; - if (g == D && M == I && L == z && T == P) + var g = h[p + 3], M = h[p], C = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], B = c[v + 1], P = c[v + 2]; + if (g == D && M == I && C == B && T == P) continue; if (g < 220 && D > 20) return !1; } return !0; - }, u.encode = function(h, _, E, c, C, b) { - c == null && (c = 0), b == null && (b = !1); - for (var A = new Uint8Array(h[0].byteLength * h.length + 100), S = [137, 80, 78, 71, 13, 10, 26, 10], s = 0; s < 8; s++) - A[s] = S[s]; - var o = 8, w = u._bin, p = u.crc.crc, v = w.writeUint, a = w.writeUshort, l = w.writeASCII, g = u.encode.compressPNG(h, _, E, c, b); - v(A, o, 13), o += 4, l(A, o, "IHDR"), o += 4, v(A, o, _), o += 4, v(A, o, E), o += 4, A[o] = g.depth, o++, A[o] = g.ctype, o++, A[o] = 0, o++, A[o] = 0, o++, A[o] = 0, o++, v(A, o, p(A, o - 17, 17)), o += 4, v(A, o, 1), o += 4, l(A, o, "sRGB"), o += 4, A[o] = 1, o++, v(A, o, p(A, o - 5, 5)), o += 4; + }, u.encode = function(h, _, E, c, S, y) { + c == null && (c = 0), y == null && (y = !1); + for (var w = new Uint8Array(h[0].byteLength * h.length + 100), L = [137, 80, 78, 71, 13, 10, 26, 10], s = 0; s < 8; s++) + w[s] = L[s]; + var o = 8, A = u._bin, p = u.crc.crc, v = A.writeUint, a = A.writeUshort, l = A.writeASCII, g = u.encode.compressPNG(h, _, E, c, y); + v(w, o, 13), o += 4, l(w, o, "IHDR"), o += 4, v(w, o, _), o += 4, v(w, o, E), o += 4, w[o] = g.depth, o++, w[o] = g.ctype, o++, w[o] = 0, o++, w[o] = 0, o++, w[o] = 0, o++, v(w, o, p(w, o - 17, 17)), o += 4, v(w, o, 1), o += 4, l(w, o, "sRGB"), o += 4, w[o] = 1, o++, v(w, o, p(w, o - 5, 5)), o += 4; var M = h.length > 1; - if (M && (v(A, o, 8), o += 4, l(A, o, "acTL"), o += 4, v(A, o, h.length), o += 4, v(A, o, 0), o += 4, v(A, o, p(A, o - 12, 12)), o += 4), g.ctype == 3) { - var L = g.plte.length; - v(A, o, L * 3), o += 4, l(A, o, "PLTE"), o += 4; - for (var s = 0; s < L; s++) { - var T = s * 3, D = g.plte[s], I = D & 255, z = D >> 8 & 255, P = D >> 16 & 255; - A[o + T + 0] = I, A[o + T + 1] = z, A[o + T + 2] = P; + if (M && (v(w, o, 8), o += 4, l(w, o, "acTL"), o += 4, v(w, o, h.length), o += 4, v(w, o, 0), o += 4, v(w, o, p(w, o - 12, 12)), o += 4), g.ctype == 3) { + var C = g.plte.length; + v(w, o, C * 3), o += 4, l(w, o, "PLTE"), o += 4; + for (var s = 0; s < C; s++) { + var T = s * 3, D = g.plte[s], I = D & 255, B = D >> 8 & 255, P = D >> 16 & 255; + w[o + T + 0] = I, w[o + T + 1] = B, w[o + T + 2] = P; } - if (o += L * 3, v(A, o, p(A, o - L * 3 - 4, L * 3 + 4)), o += 4, g.gotAlpha) { - v(A, o, L), o += 4, l(A, o, "tRNS"), o += 4; - for (var s = 0; s < L; s++) - A[o + s] = g.plte[s] >> 24 & 255; - o += L, v(A, o, p(A, o - L - 4, L + 4)), o += 4; + if (o += C * 3, v(w, o, p(w, o - C * 3 - 4, C * 3 + 4)), o += 4, g.gotAlpha) { + v(w, o, C), o += 4, l(w, o, "tRNS"), o += 4; + for (var s = 0; s < C; s++) + w[o + s] = g.plte[s] >> 24 & 255; + o += C, v(w, o, p(w, o - C - 4, C + 4)), o += 4; } } - for (var B = 0, k = 0; k < g.frames.length; k++) { + for (var z = 0, k = 0; k < g.frames.length; k++) { var N = g.frames[k]; - M && (v(A, o, 26), o += 4, l(A, o, "fcTL"), o += 4, v(A, o, B++), o += 4, v(A, o, N.rect.width), o += 4, v(A, o, N.rect.height), o += 4, v(A, o, N.rect.x), o += 4, v(A, o, N.rect.y), o += 4, a(A, o, C[k]), o += 2, a(A, o, 1e3), o += 2, A[o] = N.dispose, o++, A[o] = N.blend, o++, v(A, o, p(A, o - 30, 30)), o += 4); - var $ = N.cimg, L = $.length; - v(A, o, L + (k == 0 ? 0 : 4)), o += 4; - var F = o; - l(A, o, k == 0 ? "IDAT" : "fdAT"), o += 4, k != 0 && (v(A, o, B++), o += 4); - for (var s = 0; s < L; s++) - A[o + s] = $[s]; - o += L, v(A, o, p(A, F, o - F)), o += 4; + M && (v(w, o, 26), o += 4, l(w, o, "fcTL"), o += 4, v(w, o, z++), o += 4, v(w, o, N.rect.width), o += 4, v(w, o, N.rect.height), o += 4, v(w, o, N.rect.x), o += 4, v(w, o, N.rect.y), o += 4, a(w, o, S[k]), o += 2, a(w, o, 1e3), o += 2, w[o] = N.dispose, o++, w[o] = N.blend, o++, v(w, o, p(w, o - 30, 30)), o += 4); + var R = N.cimg, C = R.length; + v(w, o, C + (k == 0 ? 0 : 4)), o += 4; + var U = o; + l(w, o, k == 0 ? "IDAT" : "fdAT"), o += 4, k != 0 && (v(w, o, z++), o += 4); + for (var s = 0; s < C; s++) + w[o + s] = R[s]; + o += C, v(w, o, p(w, U, o - U)), o += 4; } - return v(A, o, 0), o += 4, l(A, o, "IEND"), o += 4, v(A, o, p(A, o - 4, 4)), o += 4, A.buffer.slice(0, o); - }, u.encode.compressPNG = function(h, _, E, c, C) { - for (var b = u.encode.compress(h, _, E, c, !1, C), A = 0; A < h.length; A++) { - var S = b.frames[A]; - S.rect.width; - var s = S.rect.height, o = S.bpl, w = S.bpp, p = new Uint8Array(s * o + s); - S.cimg = u.encode._filterZero(S.img, s, w, o, p); + return v(w, o, 0), o += 4, l(w, o, "IEND"), o += 4, v(w, o, p(w, o - 4, 4)), o += 4, w.buffer.slice(0, o); + }, u.encode.compressPNG = function(h, _, E, c, S) { + for (var y = u.encode.compress(h, _, E, c, !1, S), w = 0; w < h.length; w++) { + var L = y.frames[w]; + L.rect.width; + var s = L.rect.height, o = L.bpl, A = L.bpp, p = new Uint8Array(s * o + s); + L.cimg = u.encode._filterZero(L.img, s, A, o, p); } - return b; - }, u.encode.compress = function(h, _, E, c, C, b) { - b == null && (b = !1); - for (var A = 6, S = 8, s = 4, o = 255, w = 0; w < h.length; w++) - for (var p = new Uint8Array(h[w]), v = p.length, a = 0; a < v; a += 4) + return y; + }, u.encode.compress = function(h, _, E, c, S, y) { + y == null && (y = !1); + for (var w = 6, L = 8, s = 4, o = 255, A = 0; A < h.length; A++) + for (var p = new Uint8Array(h[A]), v = p.length, a = 0; a < v; a += 4) o &= p[a + 3]; var l = o != 255, g = {}, M = []; if (h.length != 0 && (g[0] = 0, M.push(0), c != 0 && c--), c != 0) { - var L = u.quantize(h, c, C); - h = L.bufs; - for (var a = 0; a < L.plte.length; a++) { - var T = L.plte[a].est.rgba; + var C = u.quantize(h, c, S); + h = C.bufs; + for (var a = 0; a < C.plte.length; a++) { + var T = C.plte[a].est.rgba; g[T] == null && (g[T] = M.length, M.push(T)); } } else - for (var w = 0; w < h.length; w++) - for (var D = new Uint32Array(h[w]), v = D.length, a = 0; a < v; a++) { + for (var A = 0; A < h.length; A++) + for (var D = new Uint32Array(h[A]), v = D.length, a = 0; a < v; a++) { var T = D[a]; if ((a < _ || T != D[a - 1] && T != D[a - _]) && g[T] == null && (g[T] = M.length, M.push(T), M.length >= 300)) break; } - var I = l ? C : !1, z = M.length; - z <= 256 && b == !1 && (z <= 2 ? S = 1 : z <= 4 ? S = 2 : z <= 16 ? S = 4 : S = 8, C && (S = 8), l = !0); - for (var P = [], w = 0; w < h.length; w++) { - var B = new Uint8Array(h[w]), k = new Uint32Array(B.buffer), N = 0, $ = 0, F = _, G = E, H = 0; - if (w != 0 && !I) { - for (var U = C || w == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, V = 0, Q = 1e9, ae = 0; ae < U; ae++) { - for (var se = new Uint8Array(h[w - 1 - ae]), oe = new Uint32Array(h[w - 1 - ae]), q = _, me = E, ne = -1, fe = -1, Ce = 0; Ce < E; Ce++) - for (var Me = 0; Me < _; Me++) { - var a = Ce * _ + Me; - k[a] != oe[a] && (Me < q && (q = Me), Me > ne && (ne = Me), Ce < me && (me = Ce), Ce > fe && (fe = Ce)); + var I = l ? S : !1, B = M.length; + B <= 256 && y == !1 && (B <= 2 ? L = 1 : B <= 4 ? L = 2 : B <= 16 ? L = 4 : L = 8, S && (L = 8), l = !0); + for (var P = [], A = 0; A < h.length; A++) { + var z = new Uint8Array(h[A]), k = new Uint32Array(z.buffer), N = 0, R = 0, U = _, W = E, G = 0; + if (A != 0 && !I) { + for (var F = S || A == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, V = 0, J = 1e9, X = 0; X < F; X++) { + for (var ae = new Uint8Array(h[A - 1 - X]), oe = new Uint32Array(h[A - 1 - X]), te = _, ve = E, se = -1, le = -1, Ce = 0; Ce < E; Ce++) + for (var be = 0; be < _; be++) { + var a = Ce * _ + be; + k[a] != oe[a] && (be < te && (te = be), be > se && (se = be), Ce < ve && (ve = Ce), Ce > le && (le = Ce)); } - var Te = ne == -1 ? 1 : (ne - q + 1) * (fe - me + 1); - Te < Q && (Q = Te, V = ae, ne == -1 ? (N = $ = 0, F = G = 1) : (N = q, $ = me, F = ne - q + 1, G = fe - me + 1)); + var Le = se == -1 ? 1 : (se - te + 1) * (le - ve + 1); + Le < J && (J = Le, V = X, se == -1 ? (N = R = 0, U = W = 1) : (N = te, R = ve, U = se - te + 1, W = le - ve + 1)); } - var se = new Uint8Array(h[w - 1 - V]); + var ae = new Uint8Array(h[A - 1 - V]); V == 1 && (P[P.length - 1].dispose = 2); - var pe = new Uint8Array(F * G * 4); - new Uint32Array(pe.buffer), u._copyTile(se, _, E, pe, F, G, -N, -$, 0), u._copyTile(B, _, E, pe, F, G, -N, -$, 3) ? (u._copyTile(B, _, E, pe, F, G, -N, -$, 2), H = 1) : (u._copyTile(B, _, E, pe, F, G, -N, -$, 0), H = 0), B = pe, k = new Uint32Array(B.buffer); + var _e = new Uint8Array(U * W * 4); + new Uint32Array(_e.buffer), u._copyTile(ae, _, E, _e, U, W, -N, -R, 0), u._copyTile(z, _, E, _e, U, W, -N, -R, 3) ? (u._copyTile(z, _, E, _e, U, W, -N, -R, 2), G = 1) : (u._copyTile(z, _, E, _e, U, W, -N, -R, 0), G = 0), z = _e, k = new Uint32Array(z.buffer); } - var we = 4 * F; - if (z <= 256 && b == !1) { - we = Math.ceil(S * F / 8); - for (var pe = new Uint8Array(we * G), Ce = 0; Ce < G; Ce++) { - var a = Ce * we, Fe = Ce * F; - if (S == 8) - for (var Me = 0; Me < F; Me++) - pe[a + Me] = g[k[Fe + Me]]; - else if (S == 4) - for (var Me = 0; Me < F; Me++) - pe[a + (Me >> 1)] |= g[k[Fe + Me]] << 4 - (Me & 1) * 4; - else if (S == 2) - for (var Me = 0; Me < F; Me++) - pe[a + (Me >> 2)] |= g[k[Fe + Me]] << 6 - (Me & 3) * 2; - else if (S == 1) - for (var Me = 0; Me < F; Me++) - pe[a + (Me >> 3)] |= g[k[Fe + Me]] << 7 - (Me & 7) * 1; + var Ee = 4 * U; + if (B <= 256 && y == !1) { + Ee = Math.ceil(L * U / 8); + for (var _e = new Uint8Array(Ee * W), Ce = 0; Ce < W; Ce++) { + var a = Ce * Ee, Be = Ce * U; + if (L == 8) + for (var be = 0; be < U; be++) + _e[a + be] = g[k[Be + be]]; + else if (L == 4) + for (var be = 0; be < U; be++) + _e[a + (be >> 1)] |= g[k[Be + be]] << 4 - (be & 1) * 4; + else if (L == 2) + for (var be = 0; be < U; be++) + _e[a + (be >> 2)] |= g[k[Be + be]] << 6 - (be & 3) * 2; + else if (L == 1) + for (var be = 0; be < U; be++) + _e[a + (be >> 3)] |= g[k[Be + be]] << 7 - (be & 7) * 1; } - B = pe, A = 3, s = 1; + z = _e, w = 3, s = 1; } else if (l == !1 && h.length == 1) { - for (var pe = new Uint8Array(F * G * 3), Ue = F * G, a = 0; a < Ue; a++) { - var Ne = a * 3, Be = a * 4; - pe[Ne] = B[Be], pe[Ne + 1] = B[Be + 1], pe[Ne + 2] = B[Be + 2]; + for (var _e = new Uint8Array(U * W * 3), Ne = U * W, a = 0; a < Ne; a++) { + var Ge = a * 3, ke = a * 4; + _e[Ge] = z[ke], _e[Ge + 1] = z[ke + 1], _e[Ge + 2] = z[ke + 2]; } - B = pe, A = 2, s = 3, we = 3 * F; + z = _e, w = 2, s = 3, Ee = 3 * U; } - P.push({ rect: { x: N, y: $, width: F, height: G }, img: B, bpl: we, bpp: s, blend: H, dispose: I ? 1 : 0 }); + P.push({ rect: { x: N, y: R, width: U, height: W }, img: z, bpl: Ee, bpp: s, blend: G, dispose: I ? 1 : 0 }); } - return { ctype: A, depth: S, plte: M, gotAlpha: l, frames: P }; - }, u.encode._filterZero = function(h, _, E, c, C) { - for (var b = [], A = 0; A < 5; A++) - if (!(_ * c > 5e5 && (A == 2 || A == 3 || A == 4))) { - for (var S = 0; S < _; S++) - u.encode._filterLine(C, h, S, c, E, A); - if (b.push(y.deflate(C)), E == 1) + return { ctype: w, depth: L, plte: M, gotAlpha: l, frames: P }; + }, u.encode._filterZero = function(h, _, E, c, S) { + for (var y = [], w = 0; w < 5; w++) + if (!(_ * c > 5e5 && (w == 2 || w == 3 || w == 4))) { + for (var L = 0; L < _; L++) + u.encode._filterLine(S, h, L, c, E, w); + if (y.push(b.deflate(S)), E == 1) break; } - for (var s, o = 1e9, w = 0; w < b.length; w++) - b[w].length < o && (s = w, o = b[w].length); - return b[s]; - }, u.encode._filterLine = function(h, _, E, c, C, b) { - var A = E * c, S = A + E, s = u.decode._paeth; - if (h[S] = b, S++, b == 0) + for (var s, o = 1e9, A = 0; A < y.length; A++) + y[A].length < o && (s = A, o = y[A].length); + return y[s]; + }, u.encode._filterLine = function(h, _, E, c, S, y) { + var w = E * c, L = w + E, s = u.decode._paeth; + if (h[L] = y, L++, y == 0) for (var o = 0; o < c; o++) - h[S + o] = _[A + o]; - else if (b == 1) { - for (var o = 0; o < C; o++) - h[S + o] = _[A + o]; - for (var o = C; o < c; o++) - h[S + o] = _[A + o] - _[A + o - C] + 256 & 255; + h[L + o] = _[w + o]; + else if (y == 1) { + for (var o = 0; o < S; o++) + h[L + o] = _[w + o]; + for (var o = S; o < c; o++) + h[L + o] = _[w + o] - _[w + o - S] + 256 & 255; } else if (E == 0) { - for (var o = 0; o < C; o++) - h[S + o] = _[A + o]; - if (b == 2) - for (var o = C; o < c; o++) - h[S + o] = _[A + o]; - if (b == 3) - for (var o = C; o < c; o++) - h[S + o] = _[A + o] - (_[A + o - C] >> 1) + 256 & 255; - if (b == 4) - for (var o = C; o < c; o++) - h[S + o] = _[A + o] - s(_[A + o - C], 0, 0) + 256 & 255; + for (var o = 0; o < S; o++) + h[L + o] = _[w + o]; + if (y == 2) + for (var o = S; o < c; o++) + h[L + o] = _[w + o]; + if (y == 3) + for (var o = S; o < c; o++) + h[L + o] = _[w + o] - (_[w + o - S] >> 1) + 256 & 255; + if (y == 4) + for (var o = S; o < c; o++) + h[L + o] = _[w + o] - s(_[w + o - S], 0, 0) + 256 & 255; } else { - if (b == 2) + if (y == 2) for (var o = 0; o < c; o++) - h[S + o] = _[A + o] + 256 - _[A + o - c] & 255; - if (b == 3) { - for (var o = 0; o < C; o++) - h[S + o] = _[A + o] + 256 - (_[A + o - c] >> 1) & 255; - for (var o = C; o < c; o++) - h[S + o] = _[A + o] + 256 - (_[A + o - c] + _[A + o - C] >> 1) & 255; + h[L + o] = _[w + o] + 256 - _[w + o - c] & 255; + if (y == 3) { + for (var o = 0; o < S; o++) + h[L + o] = _[w + o] + 256 - (_[w + o - c] >> 1) & 255; + for (var o = S; o < c; o++) + h[L + o] = _[w + o] + 256 - (_[w + o - c] + _[w + o - S] >> 1) & 255; } - if (b == 4) { - for (var o = 0; o < C; o++) - h[S + o] = _[A + o] + 256 - s(0, _[A + o - c], 0) & 255; - for (var o = C; o < c; o++) - h[S + o] = _[A + o] + 256 - s(_[A + o - C], _[A + o - c], _[A + o - C - c]) & 255; + if (y == 4) { + for (var o = 0; o < S; o++) + h[L + o] = _[w + o] + 256 - s(0, _[w + o - c], 0) & 255; + for (var o = S; o < c; o++) + h[L + o] = _[w + o] + 256 - s(_[w + o - S], _[w + o - c], _[w + o - S - c]) & 255; } } }, u.crc = { @@ -20495,118 +20495,118 @@ ATOM`, g); return h; }(), update: function(h, _, E, c) { - for (var C = 0; C < c; C++) - h = u.crc.table[(h ^ _[E + C]) & 255] ^ h >>> 8; + for (var S = 0; S < c; S++) + h = u.crc.table[(h ^ _[E + S]) & 255] ^ h >>> 8; return h; }, crc: function(h, _, E) { return u.crc.update(4294967295, h, _, E) ^ 4294967295; } }, u.quantize = function(h, _, E) { - for (var c = [], C = 0, b = 0; b < h.length; b++) - c.push(u.encode.alphaMul(new Uint8Array(h[b]), E)), C += h[b].byteLength; - for (var A = new Uint8Array(C), S = new Uint32Array(A.buffer), s = 0, b = 0; b < c.length; b++) { - for (var o = c[b], w = o.length, p = 0; p < w; p++) - A[s + p] = o[p]; - s += w; + for (var c = [], S = 0, y = 0; y < h.length; y++) + c.push(u.encode.alphaMul(new Uint8Array(h[y]), E)), S += h[y].byteLength; + for (var w = new Uint8Array(S), L = new Uint32Array(w.buffer), s = 0, y = 0; y < c.length; y++) { + for (var o = c[y], A = o.length, p = 0; p < A; p++) + w[s + p] = o[p]; + s += A; } - var v = { i0: 0, i1: A.length, bst: null, est: null, tdst: 0, left: null, right: null }; - v.bst = u.quantize.stats(A, v.i0, v.i1), v.est = u.quantize.estats(v.bst); + var v = { i0: 0, i1: w.length, bst: null, est: null, tdst: 0, left: null, right: null }; + v.bst = u.quantize.stats(w, v.i0, v.i1), v.est = u.quantize.estats(v.bst); for (var a = [v]; a.length < _; ) { - for (var l = 0, g = 0, b = 0; b < a.length; b++) - a[b].est.L > l && (l = a[b].est.L, g = b); + for (var l = 0, g = 0, y = 0; y < a.length; y++) + a[y].est.L > l && (l = a[y].est.L, g = y); if (l < 1e-3) break; - var M = a[g], L = u.quantize.splitPixels(A, S, M.i0, M.i1, M.est.e, M.est.eMq255), T = { i0: M.i0, i1: L, bst: null, est: null, tdst: 0, left: null, right: null }; - T.bst = u.quantize.stats(A, T.i0, T.i1), T.est = u.quantize.estats(T.bst); - var D = { i0: L, i1: M.i1, bst: null, est: null, tdst: 0, left: null, right: null }; + var M = a[g], C = u.quantize.splitPixels(w, L, M.i0, M.i1, M.est.e, M.est.eMq255), T = { i0: M.i0, i1: C, bst: null, est: null, tdst: 0, left: null, right: null }; + T.bst = u.quantize.stats(w, T.i0, T.i1), T.est = u.quantize.estats(T.bst); + var D = { i0: C, i1: M.i1, bst: null, est: null, tdst: 0, left: null, right: null }; D.bst = { R: [], m: [], N: M.bst.N - T.bst.N }; - for (var b = 0; b < 16; b++) - D.bst.R[b] = M.bst.R[b] - T.bst.R[b]; - for (var b = 0; b < 4; b++) - D.bst.m[b] = M.bst.m[b] - T.bst.m[b]; + for (var y = 0; y < 16; y++) + D.bst.R[y] = M.bst.R[y] - T.bst.R[y]; + for (var y = 0; y < 4; y++) + D.bst.m[y] = M.bst.m[y] - T.bst.m[y]; D.est = u.quantize.estats(D.bst), M.left = T, M.right = D, a[g] = T, a.push(D); } - a.sort(function(U, V) { - return V.bst.N - U.bst.N; + a.sort(function(F, V) { + return V.bst.N - F.bst.N; }); for (var I = 0; I < c.length; I++) { - for (var z = u.quantize.planeDst, P = new Uint8Array(c[I].buffer), B = new Uint32Array(c[I].buffer), k = P.length, b = 0; b < k; b += 4) { - for (var N = P[b] * 0.00392156862745098, $ = P[b + 1] * (1 / 255), F = P[b + 2] * (1 / 255), G = P[b + 3] * (1 / 255), H = v; H.left; ) - H = z(H.est, N, $, F, G) <= 0 ? H.left : H.right; - B[b >> 2] = H.est.rgba; + for (var B = u.quantize.planeDst, P = new Uint8Array(c[I].buffer), z = new Uint32Array(c[I].buffer), k = P.length, y = 0; y < k; y += 4) { + for (var N = P[y] * 0.00392156862745098, R = P[y + 1] * (1 / 255), U = P[y + 2] * (1 / 255), W = P[y + 3] * (1 / 255), G = v; G.left; ) + G = B(G.est, N, R, U, W) <= 0 ? G.left : G.right; + z[y >> 2] = G.est.rgba; } - c[I] = B.buffer; + c[I] = z.buffer; } return { bufs: c, plte: a }; - }, u.quantize.getNearest = function(h, _, E, c, C) { + }, u.quantize.getNearest = function(h, _, E, c, S) { if (h.left == null) - return h.tdst = u.quantize.dist(h.est.q, _, E, c, C), h; - var b = u.quantize.planeDst(h.est, _, E, c, C), A = h.left, S = h.right; - b > 0 && (A = h.right, S = h.left); - var s = u.quantize.getNearest(A, _, E, c, C); - if (s.tdst <= b * b) + return h.tdst = u.quantize.dist(h.est.q, _, E, c, S), h; + var y = u.quantize.planeDst(h.est, _, E, c, S), w = h.left, L = h.right; + y > 0 && (w = h.right, L = h.left); + var s = u.quantize.getNearest(w, _, E, c, S); + if (s.tdst <= y * y) return s; - var o = u.quantize.getNearest(S, _, E, c, C); + var o = u.quantize.getNearest(L, _, E, c, S); return o.tdst < s.tdst ? o : s; - }, u.quantize.planeDst = function(h, _, E, c, C) { - var b = h.e; - return b[0] * _ + b[1] * E + b[2] * c + b[3] * C - h.eMq; - }, u.quantize.dist = function(h, _, E, c, C) { - var b = _ - h[0], A = E - h[1], S = c - h[2], s = C - h[3]; - return b * b + A * A + S * S + s * s; - }, u.quantize.splitPixels = function(h, _, E, c, C, b) { - var A = u.quantize.vecDot; + }, u.quantize.planeDst = function(h, _, E, c, S) { + var y = h.e; + return y[0] * _ + y[1] * E + y[2] * c + y[3] * S - h.eMq; + }, u.quantize.dist = function(h, _, E, c, S) { + var y = _ - h[0], w = E - h[1], L = c - h[2], s = S - h[3]; + return y * y + w * w + L * L + s * s; + }, u.quantize.splitPixels = function(h, _, E, c, S, y) { + var w = u.quantize.vecDot; for (c -= 4; E < c; ) { - for (; A(h, E, C) <= b; ) + for (; w(h, E, S) <= y; ) E += 4; - for (; A(h, c, C) > b; ) + for (; w(h, c, S) > y; ) c -= 4; if (E >= c) break; - var S = _[E >> 2]; - _[E >> 2] = _[c >> 2], _[c >> 2] = S, E += 4, c -= 4; + var L = _[E >> 2]; + _[E >> 2] = _[c >> 2], _[c >> 2] = L, E += 4, c -= 4; } - for (; A(h, E, C) > b; ) + for (; w(h, E, S) > y; ) E -= 4; return E + 4; }, u.quantize.vecDot = function(h, _, E) { return h[_] * E[0] + h[_ + 1] * E[1] + h[_ + 2] * E[2] + h[_ + 3] * E[3]; }, u.quantize.stats = function(h, _, E) { - for (var c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], C = [0, 0, 0, 0], b = E - _ >> 2, A = _; A < E; A += 4) { - var S = h[A] * 0.00392156862745098, s = h[A + 1] * (1 / 255), o = h[A + 2] * (1 / 255), w = h[A + 3] * (1 / 255); - C[0] += S, C[1] += s, C[2] += o, C[3] += w, c[0] += S * S, c[1] += S * s, c[2] += S * o, c[3] += S * w, c[5] += s * s, c[6] += s * o, c[7] += s * w, c[10] += o * o, c[11] += o * w, c[15] += w * w; + for (var c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], S = [0, 0, 0, 0], y = E - _ >> 2, w = _; w < E; w += 4) { + var L = h[w] * 0.00392156862745098, s = h[w + 1] * (1 / 255), o = h[w + 2] * (1 / 255), A = h[w + 3] * (1 / 255); + S[0] += L, S[1] += s, S[2] += o, S[3] += A, c[0] += L * L, c[1] += L * s, c[2] += L * o, c[3] += L * A, c[5] += s * s, c[6] += s * o, c[7] += s * A, c[10] += o * o, c[11] += o * A, c[15] += A * A; } - return c[4] = c[1], c[8] = c[2], c[12] = c[3], c[9] = c[6], c[13] = c[7], c[14] = c[11], { R: c, m: C, N: b }; + return c[4] = c[1], c[8] = c[2], c[12] = c[3], c[9] = c[6], c[13] = c[7], c[14] = c[11], { R: c, m: S, N: y }; }, u.quantize.estats = function(h) { - var _ = h.R, E = h.m, c = h.N, C = E[0], b = E[1], A = E[2], S = E[3], s = c == 0 ? 0 : 1 / c, o = [ - _[0] - C * C * s, - _[1] - C * b * s, - _[2] - C * A * s, - _[3] - C * S * s, - _[4] - b * C * s, - _[5] - b * b * s, - _[6] - b * A * s, - _[7] - b * S * s, - _[8] - A * C * s, - _[9] - A * b * s, - _[10] - A * A * s, - _[11] - A * S * s, - _[12] - S * C * s, - _[13] - S * b * s, - _[14] - S * A * s, - _[15] - S * S * s - ], w = o, p = u.M4, v = [0.5, 0.5, 0.5, 0.5], a = 0, l = 0; + var _ = h.R, E = h.m, c = h.N, S = E[0], y = E[1], w = E[2], L = E[3], s = c == 0 ? 0 : 1 / c, o = [ + _[0] - S * S * s, + _[1] - S * y * s, + _[2] - S * w * s, + _[3] - S * L * s, + _[4] - y * S * s, + _[5] - y * y * s, + _[6] - y * w * s, + _[7] - y * L * s, + _[8] - w * S * s, + _[9] - w * y * s, + _[10] - w * w * s, + _[11] - w * L * s, + _[12] - L * S * s, + _[13] - L * y * s, + _[14] - L * w * s, + _[15] - L * L * s + ], A = o, p = u.M4, v = [0.5, 0.5, 0.5, 0.5], a = 0, l = 0; if (c != 0) - for (var g = 0; g < 10 && (v = p.multVec(w, v), l = Math.sqrt(p.dot(v, v)), v = p.sml(1 / l, v), !(Math.abs(l - a) < 1e-9)); g++) + for (var g = 0; g < 10 && (v = p.multVec(A, v), l = Math.sqrt(p.dot(v, v)), v = p.sml(1 / l, v), !(Math.abs(l - a) < 1e-9)); g++) a = l; - var M = [C * s, b * s, A * s, S * s], L = p.dot(p.sml(255, M), v), T = M[3] < 1e-3 ? 0 : 1 / M[3]; + var M = [S * s, y * s, w * s, L * s], C = p.dot(p.sml(255, M), v), T = M[3] < 1e-3 ? 0 : 1 / M[3]; return { Cov: o, q: M, e: v, L: a, - eMq255: L, + eMq255: C, eMq: p.dot(v, M), rgba: (Math.round(255 * M[3]) << 24 | Math.round(255 * M[2] * T) << 16 | Math.round(255 * M[1] * T) << 8 | Math.round(255 * M[0] * T) << 0) >>> 0 }; @@ -20626,11 +20626,11 @@ ATOM`, g); return [h * _[0], h * _[1], h * _[2], h * _[3]]; } }, u.encode.alphaMul = function(h, _) { - for (var E = new Uint8Array(h.length), c = h.length >> 2, C = 0; C < c; C++) { - var b = C << 2, A = h[b + 3]; - _ && (A = A < 128 ? 0 : 255); - var S = A * (1 / 255); - E[b + 0] = h[b + 0] * S, E[b + 1] = h[b + 1] * S, E[b + 2] = h[b + 2] * S, E[b + 3] = A; + for (var E = new Uint8Array(h.length), c = h.length >> 2, S = 0; S < c; S++) { + var y = S << 2, w = h[y + 3]; + _ && (w = w < 128 ? 0 : 255); + var L = w * (1 / 255); + E[y + 0] = h[y + 0] * L, E[y + 1] = h[y + 1] * L, E[y + 2] = h[y + 2] * L, E[y + 3] = w; } return E; }; @@ -20644,21 +20644,21 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/index.js ***! \*********************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ./lib/utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ).assign, f = t( + ).assign, f = r( /*! ./lib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/deflate.js" - ), u = t( + ), u = r( /*! ./lib/inflate */ "./node_modules/upng-js/node_modules/pako/lib/inflate.js" - ), y = t( + ), b = r( /*! ./lib/zlib/constants */ "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js" ), h = {}; - n(h, f, u, y), r.exports = h; + n(h, f, u, b), t.exports = h; } ), /***/ @@ -20667,28 +20667,28 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/deflate.js ***! \***************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ./zlib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js" - ), f = t( + ), f = r( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), u = t( + ), u = r( /*! ./utils/strings */ "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js" - ), y = t( + ), b = r( /*! ./zlib/messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), h = t( + ), h = r( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), _ = Object.prototype.toString, E = 0, c = 4, C = 0, b = 1, A = 2, S = -1, s = 0, o = 8; - function w(l) { - if (!(this instanceof w)) - return new w(l); + ), _ = Object.prototype.toString, E = 0, c = 4, S = 0, y = 1, w = 2, L = -1, s = 0, o = 8; + function A(l) { + if (!(this instanceof A)) + return new A(l); this.options = f.assign({ - level: S, + level: L, method: o, chunkSize: 16384, windowBits: 15, @@ -20706,35 +20706,35 @@ ATOM`, g); g.memLevel, g.strategy ); - if (M !== C) - throw new Error(y[M]); + if (M !== S) + throw new Error(b[M]); if (g.header && n.deflateSetHeader(this.strm, g.header), g.dictionary) { - var L; - if (typeof g.dictionary == "string" ? L = u.string2buf(g.dictionary) : _.call(g.dictionary) === "[object ArrayBuffer]" ? L = new Uint8Array(g.dictionary) : L = g.dictionary, M = n.deflateSetDictionary(this.strm, L), M !== C) - throw new Error(y[M]); + var C; + if (typeof g.dictionary == "string" ? C = u.string2buf(g.dictionary) : _.call(g.dictionary) === "[object ArrayBuffer]" ? C = new Uint8Array(g.dictionary) : C = g.dictionary, M = n.deflateSetDictionary(this.strm, C), M !== S) + throw new Error(b[M]); this._dict_set = !0; } } - w.prototype.push = function(l, g) { - var M = this.strm, L = this.options.chunkSize, T, D; + A.prototype.push = function(l, g) { + var M = this.strm, C = this.options.chunkSize, T, D; if (this.ended) return !1; D = g === ~~g ? g : g === !0 ? c : E, typeof l == "string" ? M.input = u.string2buf(l) : _.call(l) === "[object ArrayBuffer]" ? M.input = new Uint8Array(l) : M.input = l, M.next_in = 0, M.avail_in = M.input.length; do { - if (M.avail_out === 0 && (M.output = new f.Buf8(L), M.next_out = 0, M.avail_out = L), T = n.deflate(M, D), T !== b && T !== C) + if (M.avail_out === 0 && (M.output = new f.Buf8(C), M.next_out = 0, M.avail_out = C), T = n.deflate(M, D), T !== y && T !== S) return this.onEnd(T), this.ended = !0, !1; - (M.avail_out === 0 || M.avail_in === 0 && (D === c || D === A)) && (this.options.to === "string" ? this.onData(u.buf2binstring(f.shrinkBuf(M.output, M.next_out))) : this.onData(f.shrinkBuf(M.output, M.next_out))); - } while ((M.avail_in > 0 || M.avail_out === 0) && T !== b); - return D === c ? (T = n.deflateEnd(this.strm), this.onEnd(T), this.ended = !0, T === C) : (D === A && (this.onEnd(C), M.avail_out = 0), !0); - }, w.prototype.onData = function(l) { + (M.avail_out === 0 || M.avail_in === 0 && (D === c || D === w)) && (this.options.to === "string" ? this.onData(u.buf2binstring(f.shrinkBuf(M.output, M.next_out))) : this.onData(f.shrinkBuf(M.output, M.next_out))); + } while ((M.avail_in > 0 || M.avail_out === 0) && T !== y); + return D === c ? (T = n.deflateEnd(this.strm), this.onEnd(T), this.ended = !0, T === S) : (D === w && (this.onEnd(S), M.avail_out = 0), !0); + }, A.prototype.onData = function(l) { this.chunks.push(l); - }, w.prototype.onEnd = function(l) { - l === C && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = l, this.msg = this.strm.msg; + }, A.prototype.onEnd = function(l) { + l === S && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = l, this.msg = this.strm.msg; }; function p(l, g) { - var M = new w(g); + var M = new A(g); if (M.push(l, !0), M.err) - throw M.msg || y[M.err]; + throw M.msg || b[M.err]; return M.result; } function v(l, g) { @@ -20743,7 +20743,7 @@ ATOM`, g); function a(l, g) { return g = g || {}, g.gzip = !0, p(l, g); } - e.Deflate = w, e.deflate = p, e.deflateRaw = v, e.gzip = a; + e.Deflate = A, e.deflate = p, e.deflateRaw = v, e.gzip = a; } ), /***/ @@ -20752,74 +20752,74 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/inflate.js ***! \***************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ./zlib/inflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js" - ), f = t( + ), f = r( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), u = t( + ), u = r( /*! ./utils/strings */ "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js" - ), y = t( + ), b = r( /*! ./zlib/constants */ "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js" - ), h = t( + ), h = r( /*! ./zlib/messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), _ = t( + ), _ = r( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), E = t( + ), E = r( /*! ./zlib/gzheader */ "./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js" ), c = Object.prototype.toString; - function C(S) { - if (!(this instanceof C)) - return new C(S); + function S(L) { + if (!(this instanceof S)) + return new S(L); this.options = f.assign({ chunkSize: 16384, windowBits: 0, to: "" - }, S || {}); + }, L || {}); var s = this.options; - s.raw && s.windowBits >= 0 && s.windowBits < 16 && (s.windowBits = -s.windowBits, s.windowBits === 0 && (s.windowBits = -15)), s.windowBits >= 0 && s.windowBits < 16 && !(S && S.windowBits) && (s.windowBits += 32), s.windowBits > 15 && s.windowBits < 48 && (s.windowBits & 15 || (s.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new _(), this.strm.avail_out = 0; + s.raw && s.windowBits >= 0 && s.windowBits < 16 && (s.windowBits = -s.windowBits, s.windowBits === 0 && (s.windowBits = -15)), s.windowBits >= 0 && s.windowBits < 16 && !(L && L.windowBits) && (s.windowBits += 32), s.windowBits > 15 && s.windowBits < 48 && (s.windowBits & 15 || (s.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new _(), this.strm.avail_out = 0; var o = n.inflateInit2( this.strm, s.windowBits ); - if (o !== y.Z_OK) + if (o !== b.Z_OK) throw new Error(h[o]); - if (this.header = new E(), n.inflateGetHeader(this.strm, this.header), s.dictionary && (typeof s.dictionary == "string" ? s.dictionary = u.string2buf(s.dictionary) : c.call(s.dictionary) === "[object ArrayBuffer]" && (s.dictionary = new Uint8Array(s.dictionary)), s.raw && (o = n.inflateSetDictionary(this.strm, s.dictionary), o !== y.Z_OK))) + if (this.header = new E(), n.inflateGetHeader(this.strm, this.header), s.dictionary && (typeof s.dictionary == "string" ? s.dictionary = u.string2buf(s.dictionary) : c.call(s.dictionary) === "[object ArrayBuffer]" && (s.dictionary = new Uint8Array(s.dictionary)), s.raw && (o = n.inflateSetDictionary(this.strm, s.dictionary), o !== b.Z_OK))) throw new Error(h[o]); } - C.prototype.push = function(S, s) { - var o = this.strm, w = this.options.chunkSize, p = this.options.dictionary, v, a, l, g, M, L = !1; + S.prototype.push = function(L, s) { + var o = this.strm, A = this.options.chunkSize, p = this.options.dictionary, v, a, l, g, M, C = !1; if (this.ended) return !1; - a = s === ~~s ? s : s === !0 ? y.Z_FINISH : y.Z_NO_FLUSH, typeof S == "string" ? o.input = u.binstring2buf(S) : c.call(S) === "[object ArrayBuffer]" ? o.input = new Uint8Array(S) : o.input = S, o.next_in = 0, o.avail_in = o.input.length; + a = s === ~~s ? s : s === !0 ? b.Z_FINISH : b.Z_NO_FLUSH, typeof L == "string" ? o.input = u.binstring2buf(L) : c.call(L) === "[object ArrayBuffer]" ? o.input = new Uint8Array(L) : o.input = L, o.next_in = 0, o.avail_in = o.input.length; do { - if (o.avail_out === 0 && (o.output = new f.Buf8(w), o.next_out = 0, o.avail_out = w), v = n.inflate(o, y.Z_NO_FLUSH), v === y.Z_NEED_DICT && p && (v = n.inflateSetDictionary(this.strm, p)), v === y.Z_BUF_ERROR && L === !0 && (v = y.Z_OK, L = !1), v !== y.Z_STREAM_END && v !== y.Z_OK) + if (o.avail_out === 0 && (o.output = new f.Buf8(A), o.next_out = 0, o.avail_out = A), v = n.inflate(o, b.Z_NO_FLUSH), v === b.Z_NEED_DICT && p && (v = n.inflateSetDictionary(this.strm, p)), v === b.Z_BUF_ERROR && C === !0 && (v = b.Z_OK, C = !1), v !== b.Z_STREAM_END && v !== b.Z_OK) return this.onEnd(v), this.ended = !0, !1; - o.next_out && (o.avail_out === 0 || v === y.Z_STREAM_END || o.avail_in === 0 && (a === y.Z_FINISH || a === y.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (l = u.utf8border(o.output, o.next_out), g = o.next_out - l, M = u.buf2string(o.output, l), o.next_out = g, o.avail_out = w - g, g && f.arraySet(o.output, o.output, l, g, 0), this.onData(M)) : this.onData(f.shrinkBuf(o.output, o.next_out))), o.avail_in === 0 && o.avail_out === 0 && (L = !0); - } while ((o.avail_in > 0 || o.avail_out === 0) && v !== y.Z_STREAM_END); - return v === y.Z_STREAM_END && (a = y.Z_FINISH), a === y.Z_FINISH ? (v = n.inflateEnd(this.strm), this.onEnd(v), this.ended = !0, v === y.Z_OK) : (a === y.Z_SYNC_FLUSH && (this.onEnd(y.Z_OK), o.avail_out = 0), !0); - }, C.prototype.onData = function(S) { - this.chunks.push(S); - }, C.prototype.onEnd = function(S) { - S === y.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = S, this.msg = this.strm.msg; + o.next_out && (o.avail_out === 0 || v === b.Z_STREAM_END || o.avail_in === 0 && (a === b.Z_FINISH || a === b.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (l = u.utf8border(o.output, o.next_out), g = o.next_out - l, M = u.buf2string(o.output, l), o.next_out = g, o.avail_out = A - g, g && f.arraySet(o.output, o.output, l, g, 0), this.onData(M)) : this.onData(f.shrinkBuf(o.output, o.next_out))), o.avail_in === 0 && o.avail_out === 0 && (C = !0); + } while ((o.avail_in > 0 || o.avail_out === 0) && v !== b.Z_STREAM_END); + return v === b.Z_STREAM_END && (a = b.Z_FINISH), a === b.Z_FINISH ? (v = n.inflateEnd(this.strm), this.onEnd(v), this.ended = !0, v === b.Z_OK) : (a === b.Z_SYNC_FLUSH && (this.onEnd(b.Z_OK), o.avail_out = 0), !0); + }, S.prototype.onData = function(L) { + this.chunks.push(L); + }, S.prototype.onEnd = function(L) { + L === b.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = L, this.msg = this.strm.msg; }; - function b(S, s) { - var o = new C(s); - if (o.push(S, !0), o.err) + function y(L, s) { + var o = new S(s); + if (o.push(L, !0), o.err) throw o.msg || h[o.err]; return o.result; } - function A(S, s) { - return s = s || {}, s.raw = !0, b(S, s); + function w(L, s) { + return s = s || {}, s.raw = !0, y(L, s); } - e.Inflate = C, e.inflate = b, e.inflateRaw = A, e.ungzip = b; + e.Inflate = S, e.inflate = y, e.inflateRaw = w, e.ungzip = y; } ), /***/ @@ -20828,56 +20828,56 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/utils/common.js ***! \********************************************************************/ /***/ - (r, e) => { - var t = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u"; - function n(y, h) { - return Object.prototype.hasOwnProperty.call(y, h); + (t, e) => { + var r = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u"; + function n(b, h) { + return Object.prototype.hasOwnProperty.call(b, h); } - e.assign = function(y) { + e.assign = function(b) { for (var h = Array.prototype.slice.call(arguments, 1); h.length; ) { var _ = h.shift(); if (_) { if (typeof _ != "object") throw new TypeError(_ + "must be non-object"); for (var E in _) - n(_, E) && (y[E] = _[E]); + n(_, E) && (b[E] = _[E]); } } - return y; - }, e.shrinkBuf = function(y, h) { - return y.length === h ? y : y.subarray ? y.subarray(0, h) : (y.length = h, y); + return b; + }, e.shrinkBuf = function(b, h) { + return b.length === h ? b : b.subarray ? b.subarray(0, h) : (b.length = h, b); }; var f = { - arraySet: function(y, h, _, E, c) { - if (h.subarray && y.subarray) { - y.set(h.subarray(_, _ + E), c); + arraySet: function(b, h, _, E, c) { + if (h.subarray && b.subarray) { + b.set(h.subarray(_, _ + E), c); return; } - for (var C = 0; C < E; C++) - y[c + C] = h[_ + C]; + for (var S = 0; S < E; S++) + b[c + S] = h[_ + S]; }, // Join array of chunks to single array. - flattenChunks: function(y) { - var h, _, E, c, C, b; - for (E = 0, h = 0, _ = y.length; h < _; h++) - E += y[h].length; - for (b = new Uint8Array(E), c = 0, h = 0, _ = y.length; h < _; h++) - C = y[h], b.set(C, c), c += C.length; - return b; + flattenChunks: function(b) { + var h, _, E, c, S, y; + for (E = 0, h = 0, _ = b.length; h < _; h++) + E += b[h].length; + for (y = new Uint8Array(E), c = 0, h = 0, _ = b.length; h < _; h++) + S = b[h], y.set(S, c), c += S.length; + return y; } }, u = { - arraySet: function(y, h, _, E, c) { - for (var C = 0; C < E; C++) - y[c + C] = h[_ + C]; + arraySet: function(b, h, _, E, c) { + for (var S = 0; S < E; S++) + b[c + S] = h[_ + S]; }, // Join array of chunks to single array. - flattenChunks: function(y) { - return [].concat.apply([], y); + flattenChunks: function(b) { + return [].concat.apply([], b); } }; - e.setTyped = function(y) { - y ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, f)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, u)); - }, e.setTyped(t); + e.setTyped = function(b) { + b ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, f)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, u)); + }, e.setTyped(r); } ), /***/ @@ -20886,8 +20886,8 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/utils/strings.js ***! \*********************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ./common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), f = !0, u = !0; @@ -20901,54 +20901,54 @@ ATOM`, g); } catch { u = !1; } - for (var y = new n.Buf8(256), h = 0; h < 256; h++) - y[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1; - y[254] = y[254] = 1, e.string2buf = function(E) { - var c, C, b, A, S, s = E.length, o = 0; - for (A = 0; A < s; A++) - C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < s && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), o += C < 128 ? 1 : C < 2048 ? 2 : C < 65536 ? 3 : 4; - for (c = new n.Buf8(o), S = 0, A = 0; S < o; A++) - C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < s && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), C < 128 ? c[S++] = C : C < 2048 ? (c[S++] = 192 | C >>> 6, c[S++] = 128 | C & 63) : C < 65536 ? (c[S++] = 224 | C >>> 12, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63) : (c[S++] = 240 | C >>> 18, c[S++] = 128 | C >>> 12 & 63, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63); + for (var b = new n.Buf8(256), h = 0; h < 256; h++) + b[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1; + b[254] = b[254] = 1, e.string2buf = function(E) { + var c, S, y, w, L, s = E.length, o = 0; + for (w = 0; w < s; w++) + S = E.charCodeAt(w), (S & 64512) === 55296 && w + 1 < s && (y = E.charCodeAt(w + 1), (y & 64512) === 56320 && (S = 65536 + (S - 55296 << 10) + (y - 56320), w++)), o += S < 128 ? 1 : S < 2048 ? 2 : S < 65536 ? 3 : 4; + for (c = new n.Buf8(o), L = 0, w = 0; L < o; w++) + S = E.charCodeAt(w), (S & 64512) === 55296 && w + 1 < s && (y = E.charCodeAt(w + 1), (y & 64512) === 56320 && (S = 65536 + (S - 55296 << 10) + (y - 56320), w++)), S < 128 ? c[L++] = S : S < 2048 ? (c[L++] = 192 | S >>> 6, c[L++] = 128 | S & 63) : S < 65536 ? (c[L++] = 224 | S >>> 12, c[L++] = 128 | S >>> 6 & 63, c[L++] = 128 | S & 63) : (c[L++] = 240 | S >>> 18, c[L++] = 128 | S >>> 12 & 63, c[L++] = 128 | S >>> 6 & 63, c[L++] = 128 | S & 63); return c; }; function _(E, c) { if (c < 65534 && (E.subarray && u || !E.subarray && f)) return String.fromCharCode.apply(null, n.shrinkBuf(E, c)); - for (var C = "", b = 0; b < c; b++) - C += String.fromCharCode(E[b]); - return C; + for (var S = "", y = 0; y < c; y++) + S += String.fromCharCode(E[y]); + return S; } e.buf2binstring = function(E) { return _(E, E.length); }, e.binstring2buf = function(E) { - for (var c = new n.Buf8(E.length), C = 0, b = c.length; C < b; C++) - c[C] = E.charCodeAt(C); + for (var c = new n.Buf8(E.length), S = 0, y = c.length; S < y; S++) + c[S] = E.charCodeAt(S); return c; }, e.buf2string = function(E, c) { - var C, b, A, S, s = c || E.length, o = new Array(s * 2); - for (b = 0, C = 0; C < s; ) { - if (A = E[C++], A < 128) { - o[b++] = A; + var S, y, w, L, s = c || E.length, o = new Array(s * 2); + for (y = 0, S = 0; S < s; ) { + if (w = E[S++], w < 128) { + o[y++] = w; continue; } - if (S = y[A], S > 4) { - o[b++] = 65533, C += S - 1; + if (L = b[w], L > 4) { + o[y++] = 65533, S += L - 1; continue; } - for (A &= S === 2 ? 31 : S === 3 ? 15 : 7; S > 1 && C < s; ) - A = A << 6 | E[C++] & 63, S--; - if (S > 1) { - o[b++] = 65533; + for (w &= L === 2 ? 31 : L === 3 ? 15 : 7; L > 1 && S < s; ) + w = w << 6 | E[S++] & 63, L--; + if (L > 1) { + o[y++] = 65533; continue; } - A < 65536 ? o[b++] = A : (A -= 65536, o[b++] = 55296 | A >> 10 & 1023, o[b++] = 56320 | A & 1023); + w < 65536 ? o[y++] = w : (w -= 65536, o[y++] = 55296 | w >> 10 & 1023, o[y++] = 56320 | w & 1023); } - return _(o, b); + return _(o, y); }, e.utf8border = function(E, c) { - var C; - for (c = c || E.length, c > E.length && (c = E.length), C = c - 1; C >= 0 && (E[C] & 192) === 128; ) - C--; - return C < 0 || C === 0 ? c : C + y[E[C]] > c ? C : c; + var S; + for (c = c || E.length, c > E.length && (c = E.length), S = c - 1; S >= 0 && (E[S] & 192) === 128; ) + S--; + return S < 0 || S === 0 ? c : S + b[E[S]] > c ? S : c; }; } ), @@ -20958,18 +20958,18 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js ***! \********************************************************************/ /***/ - (r) => { - function e(t, n, f, u) { - for (var y = t & 65535 | 0, h = t >>> 16 & 65535 | 0, _ = 0; f !== 0; ) { + (t) => { + function e(r, n, f, u) { + for (var b = r & 65535 | 0, h = r >>> 16 & 65535 | 0, _ = 0; f !== 0; ) { _ = f > 2e3 ? 2e3 : f, f -= _; do - y = y + n[u++] | 0, h = h + y | 0; + b = b + n[u++] | 0, h = h + b | 0; while (--_); - y %= 65521, h %= 65521; + b %= 65521, h %= 65521; } - return y | h << 16 | 0; + return b | h << 16 | 0; } - r.exports = e; + t.exports = e; } ), /***/ @@ -20978,8 +20978,8 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js ***! \**********************************************************************/ /***/ - (r) => { - r.exports = { + (t) => { + t.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -21027,25 +21027,25 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js ***! \******************************************************************/ /***/ - (r) => { + (t) => { function e() { - for (var f, u = [], y = 0; y < 256; y++) { - f = y; + for (var f, u = [], b = 0; b < 256; b++) { + f = b; for (var h = 0; h < 8; h++) f = f & 1 ? 3988292384 ^ f >>> 1 : f >>> 1; - u[y] = f; + u[b] = f; } return u; } - var t = e(); - function n(f, u, y, h) { - var _ = t, E = h + y; + var r = e(); + function n(f, u, b, h) { + var _ = r, E = h + b; f ^= -1; for (var c = h; c < E; c++) f = f >>> 8 ^ _[(f ^ u[c]) & 255]; return f ^ -1; } - r.exports = n; + t.exports = n; } ), /***/ @@ -21054,324 +21054,324 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js ***! \********************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = t( + ), f = r( /*! ./trees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js" - ), u = t( + ), u = r( /*! ./adler32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js" - ), y = t( + ), b = r( /*! ./crc32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js" - ), h = t( + ), h = r( /*! ./messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), _ = 0, E = 1, c = 3, C = 4, b = 5, A = 0, S = 1, s = -2, o = -3, w = -5, p = -1, v = 1, a = 2, l = 3, g = 4, M = 0, L = 2, T = 8, D = 9, I = 15, z = 8, P = 29, B = 256, k = B + 1 + P, N = 30, $ = 19, F = 2 * k + 1, G = 15, H = 3, U = 258, V = U + H + 1, Q = 32, ae = 42, oe = 69, q = 73, me = 91, ne = 103, fe = 113, Ce = 666, Me = 1, Te = 2, se = 3, pe = 4, we = 3; - function Fe(R, be) { - return R.msg = h[be], be; + ), _ = 0, E = 1, c = 3, S = 4, y = 5, w = 0, L = 1, s = -2, o = -3, A = -5, p = -1, v = 1, a = 2, l = 3, g = 4, M = 0, C = 2, T = 8, D = 9, I = 15, B = 8, P = 29, z = 256, k = z + 1 + P, N = 30, R = 19, U = 2 * k + 1, W = 15, G = 3, F = 258, V = F + G + 1, J = 32, X = 42, oe = 69, te = 73, ve = 91, se = 103, le = 113, Ce = 666, be = 1, Le = 2, ae = 3, _e = 4, Ee = 3; + function Be($, xe) { + return $.msg = h[xe], xe; } - function Ue(R) { - return (R << 1) - (R > 4 ? 9 : 0); + function Ne($) { + return ($ << 1) - ($ > 4 ? 9 : 0); } - function Ne(R) { - for (var be = R.length; --be >= 0; ) - R[be] = 0; + function Ge($) { + for (var xe = $.length; --xe >= 0; ) + $[xe] = 0; } - function Be(R) { - var be = R.state, Ee = be.pending; - Ee > R.avail_out && (Ee = R.avail_out), Ee !== 0 && (n.arraySet(R.output, be.pending_buf, be.pending_out, Ee, R.next_out), R.next_out += Ee, be.pending_out += Ee, R.total_out += Ee, R.avail_out -= Ee, be.pending -= Ee, be.pending === 0 && (be.pending_out = 0)); + function ke($) { + var xe = $.state, Me = xe.pending; + Me > $.avail_out && (Me = $.avail_out), Me !== 0 && (n.arraySet($.output, xe.pending_buf, xe.pending_out, Me, $.next_out), $.next_out += Me, xe.pending_out += Me, $.total_out += Me, $.avail_out -= Me, xe.pending -= Me, xe.pending === 0 && (xe.pending_out = 0)); } - function ue(R, be) { - f._tr_flush_block(R, R.block_start >= 0 ? R.block_start : -1, R.strstart - R.block_start, be), R.block_start = R.strstart, Be(R.strm); + function pe($, xe) { + f._tr_flush_block($, $.block_start >= 0 ? $.block_start : -1, $.strstart - $.block_start, xe), $.block_start = $.strstart, ke($.strm); } - function ye(R, be) { - R.pending_buf[R.pending++] = be; + function de($, xe) { + $.pending_buf[$.pending++] = xe; } - function ge(R, be) { - R.pending_buf[R.pending++] = be >>> 8 & 255, R.pending_buf[R.pending++] = be & 255; + function ce($, xe) { + $.pending_buf[$.pending++] = xe >>> 8 & 255, $.pending_buf[$.pending++] = xe & 255; } - function Se(R, be, Ee, X) { - var le = R.avail_in; - return le > X && (le = X), le === 0 ? 0 : (R.avail_in -= le, n.arraySet(be, R.input, R.next_in, le, Ee), R.state.wrap === 1 ? R.adler = u(R.adler, be, le, Ee) : R.state.wrap === 2 && (R.adler = y(R.adler, be, le, Ee)), R.next_in += le, R.total_in += le, le); + function Ae($, xe, Me, Q) { + var fe = $.avail_in; + return fe > Q && (fe = Q), fe === 0 ? 0 : ($.avail_in -= fe, n.arraySet(xe, $.input, $.next_in, fe, Me), $.state.wrap === 1 ? $.adler = u($.adler, xe, fe, Me) : $.state.wrap === 2 && ($.adler = b($.adler, xe, fe, Me)), $.next_in += fe, $.total_in += fe, fe); } - function ze(R, be) { - var Ee = R.max_chain_length, X = R.strstart, le, Le, Ze = R.prev_length, Ke = R.nice_match, je = R.strstart > R.w_size - V ? R.strstart - (R.w_size - V) : 0, Je = R.window, Lt = R.w_mask, rt = R.prev, it = R.strstart + U, tt = Je[X + Ze - 1], Et = Je[X + Ze]; - R.prev_length >= R.good_match && (Ee >>= 2), Ke > R.lookahead && (Ke = R.lookahead); + function Oe($, xe) { + var Me = $.max_chain_length, Q = $.strstart, fe, Te, Ze = $.prev_length, Ke = $.nice_match, je = $.strstart > $.w_size - V ? $.strstart - ($.w_size - V) : 0, Je = $.window, St = $.w_mask, rt = $.prev, it = $.strstart + F, tt = Je[Q + Ze - 1], Et = Je[Q + Ze]; + $.prev_length >= $.good_match && (Me >>= 2), Ke > $.lookahead && (Ke = $.lookahead); do - if (le = be, !(Je[le + Ze] !== Et || Je[le + Ze - 1] !== tt || Je[le] !== Je[X] || Je[++le] !== Je[X + 1])) { - X += 2, le++; + if (fe = xe, !(Je[fe + Ze] !== Et || Je[fe + Ze - 1] !== tt || Je[fe] !== Je[Q] || Je[++fe] !== Je[Q + 1])) { + Q += 2, fe++; do ; - while (Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && X < it); - if (Le = U - (it - X), X = it - U, Le > Ze) { - if (R.match_start = be, Ze = Le, Le >= Ke) + while (Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Je[++Q] === Je[++fe] && Q < it); + if (Te = F - (it - Q), Q = it - F, Te > Ze) { + if ($.match_start = xe, Ze = Te, Te >= Ke) break; - tt = Je[X + Ze - 1], Et = Je[X + Ze]; + tt = Je[Q + Ze - 1], Et = Je[Q + Ze]; } } - while ((be = rt[be & Lt]) > je && --Ee !== 0); - return Ze <= R.lookahead ? Ze : R.lookahead; + while ((xe = rt[xe & St]) > je && --Me !== 0); + return Ze <= $.lookahead ? Ze : $.lookahead; } - function He(R) { - var be = R.w_size, Ee, X, le, Le, Ze; + function We($) { + var xe = $.w_size, Me, Q, fe, Te, Ze; do { - if (Le = R.window_size - R.lookahead - R.strstart, R.strstart >= be + (be - V)) { - n.arraySet(R.window, R.window, be, be, 0), R.match_start -= be, R.strstart -= be, R.block_start -= be, X = R.hash_size, Ee = X; + if (Te = $.window_size - $.lookahead - $.strstart, $.strstart >= xe + (xe - V)) { + n.arraySet($.window, $.window, xe, xe, 0), $.match_start -= xe, $.strstart -= xe, $.block_start -= xe, Q = $.hash_size, Me = Q; do - le = R.head[--Ee], R.head[Ee] = le >= be ? le - be : 0; - while (--X); - X = be, Ee = X; + fe = $.head[--Me], $.head[Me] = fe >= xe ? fe - xe : 0; + while (--Q); + Q = xe, Me = Q; do - le = R.prev[--Ee], R.prev[Ee] = le >= be ? le - be : 0; - while (--X); - Le += be; + fe = $.prev[--Me], $.prev[Me] = fe >= xe ? fe - xe : 0; + while (--Q); + Te += xe; } - if (R.strm.avail_in === 0) + if ($.strm.avail_in === 0) break; - if (X = Se(R.strm, R.window, R.strstart + R.lookahead, Le), R.lookahead += X, R.lookahead + R.insert >= H) - for (Ze = R.strstart - R.insert, R.ins_h = R.window[Ze], R.ins_h = (R.ins_h << R.hash_shift ^ R.window[Ze + 1]) & R.hash_mask; R.insert && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[Ze + H - 1]) & R.hash_mask, R.prev[Ze & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = Ze, Ze++, R.insert--, !(R.lookahead + R.insert < H)); ) + if (Q = Ae($.strm, $.window, $.strstart + $.lookahead, Te), $.lookahead += Q, $.lookahead + $.insert >= G) + for (Ze = $.strstart - $.insert, $.ins_h = $.window[Ze], $.ins_h = ($.ins_h << $.hash_shift ^ $.window[Ze + 1]) & $.hash_mask; $.insert && ($.ins_h = ($.ins_h << $.hash_shift ^ $.window[Ze + G - 1]) & $.hash_mask, $.prev[Ze & $.w_mask] = $.head[$.ins_h], $.head[$.ins_h] = Ze, Ze++, $.insert--, !($.lookahead + $.insert < G)); ) ; - } while (R.lookahead < V && R.strm.avail_in !== 0); + } while ($.lookahead < V && $.strm.avail_in !== 0); } - function We(R, be) { - var Ee = 65535; - for (Ee > R.pending_buf_size - 5 && (Ee = R.pending_buf_size - 5); ; ) { - if (R.lookahead <= 1) { - if (He(R), R.lookahead === 0 && be === _) - return Me; - if (R.lookahead === 0) + function Ue($, xe) { + var Me = 65535; + for (Me > $.pending_buf_size - 5 && (Me = $.pending_buf_size - 5); ; ) { + if ($.lookahead <= 1) { + if (We($), $.lookahead === 0 && xe === _) + return be; + if ($.lookahead === 0) break; } - R.strstart += R.lookahead, R.lookahead = 0; - var X = R.block_start + Ee; - if ((R.strstart === 0 || R.strstart >= X) && (R.lookahead = R.strstart - X, R.strstart = X, ue(R, !1), R.strm.avail_out === 0) || R.strstart - R.block_start >= R.w_size - V && (ue(R, !1), R.strm.avail_out === 0)) - return Me; + $.strstart += $.lookahead, $.lookahead = 0; + var Q = $.block_start + Me; + if (($.strstart === 0 || $.strstart >= Q) && ($.lookahead = $.strstart - Q, $.strstart = Q, pe($, !1), $.strm.avail_out === 0) || $.strstart - $.block_start >= $.w_size - V && (pe($, !1), $.strm.avail_out === 0)) + return be; } - return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : (R.strstart > R.block_start && (ue(R, !1), R.strm.avail_out === 0), Me); + return $.insert = 0, xe === S ? (pe($, !0), $.strm.avail_out === 0 ? ae : _e) : ($.strstart > $.block_start && (pe($, !1), $.strm.avail_out === 0), be); } - function Y(R, be) { - for (var Ee, X; ; ) { - if (R.lookahead < V) { - if (He(R), R.lookahead < V && be === _) - return Me; - if (R.lookahead === 0) + function Z($, xe) { + for (var Me, Q; ; ) { + if ($.lookahead < V) { + if (We($), $.lookahead < V && xe === _) + return be; + if ($.lookahead === 0) break; } - if (Ee = 0, R.lookahead >= H && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart), Ee !== 0 && R.strstart - Ee <= R.w_size - V && (R.match_length = ze(R, Ee)), R.match_length >= H) - if (X = f._tr_tally(R, R.strstart - R.match_start, R.match_length - H), R.lookahead -= R.match_length, R.match_length <= R.max_lazy_match && R.lookahead >= H) { - R.match_length--; + if (Me = 0, $.lookahead >= G && ($.ins_h = ($.ins_h << $.hash_shift ^ $.window[$.strstart + G - 1]) & $.hash_mask, Me = $.prev[$.strstart & $.w_mask] = $.head[$.ins_h], $.head[$.ins_h] = $.strstart), Me !== 0 && $.strstart - Me <= $.w_size - V && ($.match_length = Oe($, Me)), $.match_length >= G) + if (Q = f._tr_tally($, $.strstart - $.match_start, $.match_length - G), $.lookahead -= $.match_length, $.match_length <= $.max_lazy_match && $.lookahead >= G) { + $.match_length--; do - R.strstart++, R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart; - while (--R.match_length !== 0); - R.strstart++; + $.strstart++, $.ins_h = ($.ins_h << $.hash_shift ^ $.window[$.strstart + G - 1]) & $.hash_mask, Me = $.prev[$.strstart & $.w_mask] = $.head[$.ins_h], $.head[$.ins_h] = $.strstart; + while (--$.match_length !== 0); + $.strstart++; } else - R.strstart += R.match_length, R.match_length = 0, R.ins_h = R.window[R.strstart], R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + 1]) & R.hash_mask; + $.strstart += $.match_length, $.match_length = 0, $.ins_h = $.window[$.strstart], $.ins_h = ($.ins_h << $.hash_shift ^ $.window[$.strstart + 1]) & $.hash_mask; else - X = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++; - if (X && (ue(R, !1), R.strm.avail_out === 0)) - return Me; + Q = f._tr_tally($, 0, $.window[$.strstart]), $.lookahead--, $.strstart++; + if (Q && (pe($, !1), $.strm.avail_out === 0)) + return be; } - return R.insert = R.strstart < H - 1 ? R.strstart : H - 1, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; + return $.insert = $.strstart < G - 1 ? $.strstart : G - 1, xe === S ? (pe($, !0), $.strm.avail_out === 0 ? ae : _e) : $.last_lit && (pe($, !1), $.strm.avail_out === 0) ? be : Le; } - function K(R, be) { - for (var Ee, X, le; ; ) { - if (R.lookahead < V) { - if (He(R), R.lookahead < V && be === _) - return Me; - if (R.lookahead === 0) + function j($, xe) { + for (var Me, Q, fe; ; ) { + if ($.lookahead < V) { + if (We($), $.lookahead < V && xe === _) + return be; + if ($.lookahead === 0) break; } - if (Ee = 0, R.lookahead >= H && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart), R.prev_length = R.match_length, R.prev_match = R.match_start, R.match_length = H - 1, Ee !== 0 && R.prev_length < R.max_lazy_match && R.strstart - Ee <= R.w_size - V && (R.match_length = ze(R, Ee), R.match_length <= 5 && (R.strategy === v || R.match_length === H && R.strstart - R.match_start > 4096) && (R.match_length = H - 1)), R.prev_length >= H && R.match_length <= R.prev_length) { - le = R.strstart + R.lookahead - H, X = f._tr_tally(R, R.strstart - 1 - R.prev_match, R.prev_length - H), R.lookahead -= R.prev_length - 1, R.prev_length -= 2; + if (Me = 0, $.lookahead >= G && ($.ins_h = ($.ins_h << $.hash_shift ^ $.window[$.strstart + G - 1]) & $.hash_mask, Me = $.prev[$.strstart & $.w_mask] = $.head[$.ins_h], $.head[$.ins_h] = $.strstart), $.prev_length = $.match_length, $.prev_match = $.match_start, $.match_length = G - 1, Me !== 0 && $.prev_length < $.max_lazy_match && $.strstart - Me <= $.w_size - V && ($.match_length = Oe($, Me), $.match_length <= 5 && ($.strategy === v || $.match_length === G && $.strstart - $.match_start > 4096) && ($.match_length = G - 1)), $.prev_length >= G && $.match_length <= $.prev_length) { + fe = $.strstart + $.lookahead - G, Q = f._tr_tally($, $.strstart - 1 - $.prev_match, $.prev_length - G), $.lookahead -= $.prev_length - 1, $.prev_length -= 2; do - ++R.strstart <= le && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart); - while (--R.prev_length !== 0); - if (R.match_available = 0, R.match_length = H - 1, R.strstart++, X && (ue(R, !1), R.strm.avail_out === 0)) - return Me; - } else if (R.match_available) { - if (X = f._tr_tally(R, 0, R.window[R.strstart - 1]), X && ue(R, !1), R.strstart++, R.lookahead--, R.strm.avail_out === 0) - return Me; + ++$.strstart <= fe && ($.ins_h = ($.ins_h << $.hash_shift ^ $.window[$.strstart + G - 1]) & $.hash_mask, Me = $.prev[$.strstart & $.w_mask] = $.head[$.ins_h], $.head[$.ins_h] = $.strstart); + while (--$.prev_length !== 0); + if ($.match_available = 0, $.match_length = G - 1, $.strstart++, Q && (pe($, !1), $.strm.avail_out === 0)) + return be; + } else if ($.match_available) { + if (Q = f._tr_tally($, 0, $.window[$.strstart - 1]), Q && pe($, !1), $.strstart++, $.lookahead--, $.strm.avail_out === 0) + return be; } else - R.match_available = 1, R.strstart++, R.lookahead--; + $.match_available = 1, $.strstart++, $.lookahead--; } - return R.match_available && (X = f._tr_tally(R, 0, R.window[R.strstart - 1]), R.match_available = 0), R.insert = R.strstart < H - 1 ? R.strstart : H - 1, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; + return $.match_available && (Q = f._tr_tally($, 0, $.window[$.strstart - 1]), $.match_available = 0), $.insert = $.strstart < G - 1 ? $.strstart : G - 1, xe === S ? (pe($, !0), $.strm.avail_out === 0 ? ae : _e) : $.last_lit && (pe($, !1), $.strm.avail_out === 0) ? be : Le; } - function ee(R, be) { - for (var Ee, X, le, Le, Ze = R.window; ; ) { - if (R.lookahead <= U) { - if (He(R), R.lookahead <= U && be === _) - return Me; - if (R.lookahead === 0) + function ee($, xe) { + for (var Me, Q, fe, Te, Ze = $.window; ; ) { + if ($.lookahead <= F) { + if (We($), $.lookahead <= F && xe === _) + return be; + if ($.lookahead === 0) break; } - if (R.match_length = 0, R.lookahead >= H && R.strstart > 0 && (le = R.strstart - 1, X = Ze[le], X === Ze[++le] && X === Ze[++le] && X === Ze[++le])) { - Le = R.strstart + U; + if ($.match_length = 0, $.lookahead >= G && $.strstart > 0 && (fe = $.strstart - 1, Q = Ze[fe], Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe])) { + Te = $.strstart + F; do ; - while (X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && le < Le); - R.match_length = U - (Le - le), R.match_length > R.lookahead && (R.match_length = R.lookahead); + while (Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && Q === Ze[++fe] && fe < Te); + $.match_length = F - (Te - fe), $.match_length > $.lookahead && ($.match_length = $.lookahead); } - if (R.match_length >= H ? (Ee = f._tr_tally(R, 1, R.match_length - H), R.lookahead -= R.match_length, R.strstart += R.match_length, R.match_length = 0) : (Ee = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++), Ee && (ue(R, !1), R.strm.avail_out === 0)) - return Me; + if ($.match_length >= G ? (Me = f._tr_tally($, 1, $.match_length - G), $.lookahead -= $.match_length, $.strstart += $.match_length, $.match_length = 0) : (Me = f._tr_tally($, 0, $.window[$.strstart]), $.lookahead--, $.strstart++), Me && (pe($, !1), $.strm.avail_out === 0)) + return be; } - return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; + return $.insert = 0, xe === S ? (pe($, !0), $.strm.avail_out === 0 ? ae : _e) : $.last_lit && (pe($, !1), $.strm.avail_out === 0) ? be : Le; } - function de(R, be) { - for (var Ee; ; ) { - if (R.lookahead === 0 && (He(R), R.lookahead === 0)) { - if (be === _) - return Me; + function ge($, xe) { + for (var Me; ; ) { + if ($.lookahead === 0 && (We($), $.lookahead === 0)) { + if (xe === _) + return be; break; } - if (R.match_length = 0, Ee = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++, Ee && (ue(R, !1), R.strm.avail_out === 0)) - return Me; + if ($.match_length = 0, Me = f._tr_tally($, 0, $.window[$.strstart]), $.lookahead--, $.strstart++, Me && (pe($, !1), $.strm.avail_out === 0)) + return be; } - return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; + return $.insert = 0, xe === S ? (pe($, !0), $.strm.avail_out === 0 ? ae : _e) : $.last_lit && (pe($, !1), $.strm.avail_out === 0) ? be : Le; } - function ve(R, be, Ee, X, le) { - this.good_length = R, this.max_lazy = be, this.nice_length = Ee, this.max_chain = X, this.func = le; + function ye($, xe, Me, Q, fe) { + this.good_length = $, this.max_lazy = xe, this.nice_length = Me, this.max_chain = Q, this.func = fe; } - var Ie; - Ie = [ + var $e; + $e = [ /* good lazy nice chain */ - new ve(0, 0, 0, 0, We), + new ye(0, 0, 0, 0, Ue), /* 0 store only */ - new ve(4, 4, 8, 4, Y), + new ye(4, 4, 8, 4, Z), /* 1 max speed, no lazy matches */ - new ve(4, 5, 16, 8, Y), + new ye(4, 5, 16, 8, Z), /* 2 */ - new ve(4, 6, 32, 32, Y), + new ye(4, 6, 32, 32, Z), /* 3 */ - new ve(4, 4, 16, 16, K), + new ye(4, 4, 16, 16, j), /* 4 lazy matches */ - new ve(8, 16, 32, 32, K), + new ye(8, 16, 32, 32, j), /* 5 */ - new ve(8, 16, 128, 128, K), + new ye(8, 16, 128, 128, j), /* 6 */ - new ve(8, 32, 128, 256, K), + new ye(8, 32, 128, 256, j), /* 7 */ - new ve(32, 128, 258, 1024, K), + new ye(32, 128, 258, 1024, j), /* 8 */ - new ve(32, 258, 258, 4096, K) + new ye(32, 258, 258, 4096, j) /* 9 max compression */ ]; - function Re(R) { - R.window_size = 2 * R.w_size, Ne(R.head), R.max_lazy_match = Ie[R.level].max_lazy, R.good_match = Ie[R.level].good_length, R.nice_match = Ie[R.level].nice_length, R.max_chain_length = Ie[R.level].max_chain, R.strstart = 0, R.block_start = 0, R.lookahead = 0, R.insert = 0, R.match_length = R.prev_length = H - 1, R.match_available = 0, R.ins_h = 0; + function Re($) { + $.window_size = 2 * $.w_size, Ge($.head), $.max_lazy_match = $e[$.level].max_lazy, $.good_match = $e[$.level].good_length, $.nice_match = $e[$.level].nice_length, $.max_chain_length = $e[$.level].max_chain, $.strstart = 0, $.block_start = 0, $.lookahead = 0, $.insert = 0, $.match_length = $.prev_length = G - 1, $.match_available = 0, $.ins_h = 0; } - function Z() { - this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = T, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new n.Buf16(F * 2), this.dyn_dtree = new n.Buf16((2 * N + 1) * 2), this.bl_tree = new n.Buf16((2 * $ + 1) * 2), Ne(this.dyn_ltree), Ne(this.dyn_dtree), Ne(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new n.Buf16(G + 1), this.heap = new n.Buf16(2 * k + 1), Ne(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new n.Buf16(2 * k + 1), Ne(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; + function Y() { + this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = T, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new n.Buf16(U * 2), this.dyn_dtree = new n.Buf16((2 * N + 1) * 2), this.bl_tree = new n.Buf16((2 * R + 1) * 2), Ge(this.dyn_ltree), Ge(this.dyn_dtree), Ge(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new n.Buf16(W + 1), this.heap = new n.Buf16(2 * k + 1), Ge(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new n.Buf16(2 * k + 1), Ge(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } - function ce(R) { - var be; - return !R || !R.state ? Fe(R, s) : (R.total_in = R.total_out = 0, R.data_type = L, be = R.state, be.pending = 0, be.pending_out = 0, be.wrap < 0 && (be.wrap = -be.wrap), be.status = be.wrap ? ae : fe, R.adler = be.wrap === 2 ? 0 : 1, be.last_flush = _, f._tr_init(be), A); + function ue($) { + var xe; + return !$ || !$.state ? Be($, s) : ($.total_in = $.total_out = 0, $.data_type = C, xe = $.state, xe.pending = 0, xe.pending_out = 0, xe.wrap < 0 && (xe.wrap = -xe.wrap), xe.status = xe.wrap ? X : le, $.adler = xe.wrap === 2 ? 0 : 1, xe.last_flush = _, f._tr_init(xe), w); } - function Ae(R) { - var be = ce(R); - return be === A && Re(R.state), be; + function Se($) { + var xe = ue($); + return xe === w && Re($.state), xe; } - function ke(R, be) { - return !R || !R.state || R.state.wrap !== 2 ? s : (R.state.gzhead = be, A); + function Fe($, xe) { + return !$ || !$.state || $.state.wrap !== 2 ? s : ($.state.gzhead = xe, w); } - function he(R, be, Ee, X, le, Le) { - if (!R) + function he($, xe, Me, Q, fe, Te) { + if (!$) return s; var Ze = 1; - if (be === p && (be = 6), X < 0 ? (Ze = 0, X = -X) : X > 15 && (Ze = 2, X -= 16), le < 1 || le > D || Ee !== T || X < 8 || X > 15 || be < 0 || be > 9 || Le < 0 || Le > g) - return Fe(R, s); - X === 8 && (X = 9); - var Ke = new Z(); - return R.state = Ke, Ke.strm = R, Ke.wrap = Ze, Ke.gzhead = null, Ke.w_bits = X, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = le + 7, Ke.hash_size = 1 << Ke.hash_bits, Ke.hash_mask = Ke.hash_size - 1, Ke.hash_shift = ~~((Ke.hash_bits + H - 1) / H), Ke.window = new n.Buf8(Ke.w_size * 2), Ke.head = new n.Buf16(Ke.hash_size), Ke.prev = new n.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << le + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new n.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = be, Ke.strategy = Le, Ke.method = Ee, Ae(R); + if (xe === p && (xe = 6), Q < 0 ? (Ze = 0, Q = -Q) : Q > 15 && (Ze = 2, Q -= 16), fe < 1 || fe > D || Me !== T || Q < 8 || Q > 15 || xe < 0 || xe > 9 || Te < 0 || Te > g) + return Be($, s); + Q === 8 && (Q = 9); + var Ke = new Y(); + return $.state = Ke, Ke.strm = $, Ke.wrap = Ze, Ke.gzhead = null, Ke.w_bits = Q, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = fe + 7, Ke.hash_size = 1 << Ke.hash_bits, Ke.hash_mask = Ke.hash_size - 1, Ke.hash_shift = ~~((Ke.hash_bits + G - 1) / G), Ke.window = new n.Buf8(Ke.w_size * 2), Ke.head = new n.Buf16(Ke.hash_size), Ke.prev = new n.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << fe + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new n.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = xe, Ke.strategy = Te, Ke.method = Me, Se($); } - function Oe(R, be) { - return he(R, be, T, I, z, M); + function De($, xe) { + return he($, xe, T, I, B, M); } - function j(R, be) { - var Ee, X, le, Le; - if (!R || !R.state || be > b || be < 0) - return R ? Fe(R, s) : s; - if (X = R.state, !R.output || !R.input && R.avail_in !== 0 || X.status === Ce && be !== C) - return Fe(R, R.avail_out === 0 ? w : s); - if (X.strm = R, Ee = X.last_flush, X.last_flush = be, X.status === ae) - if (X.wrap === 2) - R.adler = 0, ye(X, 31), ye(X, 139), ye(X, 8), X.gzhead ? (ye( - X, - (X.gzhead.text ? 1 : 0) + (X.gzhead.hcrc ? 2 : 0) + (X.gzhead.extra ? 4 : 0) + (X.gzhead.name ? 8 : 0) + (X.gzhead.comment ? 16 : 0) - ), ye(X, X.gzhead.time & 255), ye(X, X.gzhead.time >> 8 & 255), ye(X, X.gzhead.time >> 16 & 255), ye(X, X.gzhead.time >> 24 & 255), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, X.gzhead.os & 255), X.gzhead.extra && X.gzhead.extra.length && (ye(X, X.gzhead.extra.length & 255), ye(X, X.gzhead.extra.length >> 8 & 255)), X.gzhead.hcrc && (R.adler = y(R.adler, X.pending_buf, X.pending, 0)), X.gzindex = 0, X.status = oe) : (ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, we), X.status = fe); + function K($, xe) { + var Me, Q, fe, Te; + if (!$ || !$.state || xe > y || xe < 0) + return $ ? Be($, s) : s; + if (Q = $.state, !$.output || !$.input && $.avail_in !== 0 || Q.status === Ce && xe !== S) + return Be($, $.avail_out === 0 ? A : s); + if (Q.strm = $, Me = Q.last_flush, Q.last_flush = xe, Q.status === X) + if (Q.wrap === 2) + $.adler = 0, de(Q, 31), de(Q, 139), de(Q, 8), Q.gzhead ? (de( + Q, + (Q.gzhead.text ? 1 : 0) + (Q.gzhead.hcrc ? 2 : 0) + (Q.gzhead.extra ? 4 : 0) + (Q.gzhead.name ? 8 : 0) + (Q.gzhead.comment ? 16 : 0) + ), de(Q, Q.gzhead.time & 255), de(Q, Q.gzhead.time >> 8 & 255), de(Q, Q.gzhead.time >> 16 & 255), de(Q, Q.gzhead.time >> 24 & 255), de(Q, Q.level === 9 ? 2 : Q.strategy >= a || Q.level < 2 ? 4 : 0), de(Q, Q.gzhead.os & 255), Q.gzhead.extra && Q.gzhead.extra.length && (de(Q, Q.gzhead.extra.length & 255), de(Q, Q.gzhead.extra.length >> 8 & 255)), Q.gzhead.hcrc && ($.adler = b($.adler, Q.pending_buf, Q.pending, 0)), Q.gzindex = 0, Q.status = oe) : (de(Q, 0), de(Q, 0), de(Q, 0), de(Q, 0), de(Q, 0), de(Q, Q.level === 9 ? 2 : Q.strategy >= a || Q.level < 2 ? 4 : 0), de(Q, Ee), Q.status = le); else { - var Ze = T + (X.w_bits - 8 << 4) << 8, Ke = -1; - X.strategy >= a || X.level < 2 ? Ke = 0 : X.level < 6 ? Ke = 1 : X.level === 6 ? Ke = 2 : Ke = 3, Ze |= Ke << 6, X.strstart !== 0 && (Ze |= Q), Ze += 31 - Ze % 31, X.status = fe, ge(X, Ze), X.strstart !== 0 && (ge(X, R.adler >>> 16), ge(X, R.adler & 65535)), R.adler = 1; - } - if (X.status === oe) - if (X.gzhead.extra) { - for (le = X.pending; X.gzindex < (X.gzhead.extra.length & 65535) && !(X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)); ) - ye(X, X.gzhead.extra[X.gzindex] & 255), X.gzindex++; - X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), X.gzindex === X.gzhead.extra.length && (X.gzindex = 0, X.status = q); + var Ze = T + (Q.w_bits - 8 << 4) << 8, Ke = -1; + Q.strategy >= a || Q.level < 2 ? Ke = 0 : Q.level < 6 ? Ke = 1 : Q.level === 6 ? Ke = 2 : Ke = 3, Ze |= Ke << 6, Q.strstart !== 0 && (Ze |= J), Ze += 31 - Ze % 31, Q.status = le, ce(Q, Ze), Q.strstart !== 0 && (ce(Q, $.adler >>> 16), ce(Q, $.adler & 65535)), $.adler = 1; + } + if (Q.status === oe) + if (Q.gzhead.extra) { + for (fe = Q.pending; Q.gzindex < (Q.gzhead.extra.length & 65535) && !(Q.pending === Q.pending_buf_size && (Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), ke($), fe = Q.pending, Q.pending === Q.pending_buf_size)); ) + de(Q, Q.gzhead.extra[Q.gzindex] & 255), Q.gzindex++; + Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), Q.gzindex === Q.gzhead.extra.length && (Q.gzindex = 0, Q.status = te); } else - X.status = q; - if (X.status === q) - if (X.gzhead.name) { - le = X.pending; + Q.status = te; + if (Q.status === te) + if (Q.gzhead.name) { + fe = Q.pending; do { - if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)) { - Le = 1; + if (Q.pending === Q.pending_buf_size && (Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), ke($), fe = Q.pending, Q.pending === Q.pending_buf_size)) { + Te = 1; break; } - X.gzindex < X.gzhead.name.length ? Le = X.gzhead.name.charCodeAt(X.gzindex++) & 255 : Le = 0, ye(X, Le); - } while (Le !== 0); - X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.gzindex = 0, X.status = me); + Q.gzindex < Q.gzhead.name.length ? Te = Q.gzhead.name.charCodeAt(Q.gzindex++) & 255 : Te = 0, de(Q, Te); + } while (Te !== 0); + Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), Te === 0 && (Q.gzindex = 0, Q.status = ve); } else - X.status = me; - if (X.status === me) - if (X.gzhead.comment) { - le = X.pending; + Q.status = ve; + if (Q.status === ve) + if (Q.gzhead.comment) { + fe = Q.pending; do { - if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)) { - Le = 1; + if (Q.pending === Q.pending_buf_size && (Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), ke($), fe = Q.pending, Q.pending === Q.pending_buf_size)) { + Te = 1; break; } - X.gzindex < X.gzhead.comment.length ? Le = X.gzhead.comment.charCodeAt(X.gzindex++) & 255 : Le = 0, ye(X, Le); - } while (Le !== 0); - X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.status = ne); + Q.gzindex < Q.gzhead.comment.length ? Te = Q.gzhead.comment.charCodeAt(Q.gzindex++) & 255 : Te = 0, de(Q, Te); + } while (Te !== 0); + Q.gzhead.hcrc && Q.pending > fe && ($.adler = b($.adler, Q.pending_buf, Q.pending - fe, fe)), Te === 0 && (Q.status = se); } else - X.status = ne; - if (X.status === ne && (X.gzhead.hcrc ? (X.pending + 2 > X.pending_buf_size && Be(R), X.pending + 2 <= X.pending_buf_size && (ye(X, R.adler & 255), ye(X, R.adler >> 8 & 255), R.adler = 0, X.status = fe)) : X.status = fe), X.pending !== 0) { - if (Be(R), R.avail_out === 0) - return X.last_flush = -1, A; - } else if (R.avail_in === 0 && Ue(be) <= Ue(Ee) && be !== C) - return Fe(R, w); - if (X.status === Ce && R.avail_in !== 0) - return Fe(R, w); - if (R.avail_in !== 0 || X.lookahead !== 0 || be !== _ && X.status !== Ce) { - var je = X.strategy === a ? de(X, be) : X.strategy === l ? ee(X, be) : Ie[X.level].func(X, be); - if ((je === se || je === pe) && (X.status = Ce), je === Me || je === se) - return R.avail_out === 0 && (X.last_flush = -1), A; - if (je === Te && (be === E ? f._tr_align(X) : be !== b && (f._tr_stored_block(X, 0, 0, !1), be === c && (Ne(X.head), X.lookahead === 0 && (X.strstart = 0, X.block_start = 0, X.insert = 0))), Be(R), R.avail_out === 0)) - return X.last_flush = -1, A; - } - return be !== C ? A : X.wrap <= 0 ? S : (X.wrap === 2 ? (ye(X, R.adler & 255), ye(X, R.adler >> 8 & 255), ye(X, R.adler >> 16 & 255), ye(X, R.adler >> 24 & 255), ye(X, R.total_in & 255), ye(X, R.total_in >> 8 & 255), ye(X, R.total_in >> 16 & 255), ye(X, R.total_in >> 24 & 255)) : (ge(X, R.adler >>> 16), ge(X, R.adler & 65535)), Be(R), X.wrap > 0 && (X.wrap = -X.wrap), X.pending !== 0 ? A : S); + Q.status = se; + if (Q.status === se && (Q.gzhead.hcrc ? (Q.pending + 2 > Q.pending_buf_size && ke($), Q.pending + 2 <= Q.pending_buf_size && (de(Q, $.adler & 255), de(Q, $.adler >> 8 & 255), $.adler = 0, Q.status = le)) : Q.status = le), Q.pending !== 0) { + if (ke($), $.avail_out === 0) + return Q.last_flush = -1, w; + } else if ($.avail_in === 0 && Ne(xe) <= Ne(Me) && xe !== S) + return Be($, A); + if (Q.status === Ce && $.avail_in !== 0) + return Be($, A); + if ($.avail_in !== 0 || Q.lookahead !== 0 || xe !== _ && Q.status !== Ce) { + var je = Q.strategy === a ? ge(Q, xe) : Q.strategy === l ? ee(Q, xe) : $e[Q.level].func(Q, xe); + if ((je === ae || je === _e) && (Q.status = Ce), je === be || je === ae) + return $.avail_out === 0 && (Q.last_flush = -1), w; + if (je === Le && (xe === E ? f._tr_align(Q) : xe !== y && (f._tr_stored_block(Q, 0, 0, !1), xe === c && (Ge(Q.head), Q.lookahead === 0 && (Q.strstart = 0, Q.block_start = 0, Q.insert = 0))), ke($), $.avail_out === 0)) + return Q.last_flush = -1, w; + } + return xe !== S ? w : Q.wrap <= 0 ? L : (Q.wrap === 2 ? (de(Q, $.adler & 255), de(Q, $.adler >> 8 & 255), de(Q, $.adler >> 16 & 255), de(Q, $.adler >> 24 & 255), de(Q, $.total_in & 255), de(Q, $.total_in >> 8 & 255), de(Q, $.total_in >> 16 & 255), de(Q, $.total_in >> 24 & 255)) : (ce(Q, $.adler >>> 16), ce(Q, $.adler & 65535)), ke($), Q.wrap > 0 && (Q.wrap = -Q.wrap), Q.pending !== 0 ? w : L); } - function $e(R) { - var be; - return !R || !R.state ? s : (be = R.state.status, be !== ae && be !== oe && be !== q && be !== me && be !== ne && be !== fe && be !== Ce ? Fe(R, s) : (R.state = null, be === fe ? Fe(R, o) : A)); + function ze($) { + var xe; + return !$ || !$.state ? s : (xe = $.state.status, xe !== X && xe !== oe && xe !== te && xe !== ve && xe !== se && xe !== le && xe !== Ce ? Be($, s) : ($.state = null, xe === le ? Be($, o) : w)); } - function Ve(R, be) { - var Ee = be.length, X, le, Le, Ze, Ke, je, Je, Lt; - if (!R || !R.state || (X = R.state, Ze = X.wrap, Ze === 2 || Ze === 1 && X.status !== ae || X.lookahead)) + function Ve($, xe) { + var Me = xe.length, Q, fe, Te, Ze, Ke, je, Je, St; + if (!$ || !$.state || (Q = $.state, Ze = Q.wrap, Ze === 2 || Ze === 1 && Q.status !== X || Q.lookahead)) return s; - for (Ze === 1 && (R.adler = u(R.adler, be, Ee, 0)), X.wrap = 0, Ee >= X.w_size && (Ze === 0 && (Ne(X.head), X.strstart = 0, X.block_start = 0, X.insert = 0), Lt = new n.Buf8(X.w_size), n.arraySet(Lt, be, Ee - X.w_size, X.w_size, 0), be = Lt, Ee = X.w_size), Ke = R.avail_in, je = R.next_in, Je = R.input, R.avail_in = Ee, R.next_in = 0, R.input = be, He(X); X.lookahead >= H; ) { - le = X.strstart, Le = X.lookahead - (H - 1); + for (Ze === 1 && ($.adler = u($.adler, xe, Me, 0)), Q.wrap = 0, Me >= Q.w_size && (Ze === 0 && (Ge(Q.head), Q.strstart = 0, Q.block_start = 0, Q.insert = 0), St = new n.Buf8(Q.w_size), n.arraySet(St, xe, Me - Q.w_size, Q.w_size, 0), xe = St, Me = Q.w_size), Ke = $.avail_in, je = $.next_in, Je = $.input, $.avail_in = Me, $.next_in = 0, $.input = xe, We(Q); Q.lookahead >= G; ) { + fe = Q.strstart, Te = Q.lookahead - (G - 1); do - X.ins_h = (X.ins_h << X.hash_shift ^ X.window[le + H - 1]) & X.hash_mask, X.prev[le & X.w_mask] = X.head[X.ins_h], X.head[X.ins_h] = le, le++; - while (--Le); - X.strstart = le, X.lookahead = H - 1, He(X); + Q.ins_h = (Q.ins_h << Q.hash_shift ^ Q.window[fe + G - 1]) & Q.hash_mask, Q.prev[fe & Q.w_mask] = Q.head[Q.ins_h], Q.head[Q.ins_h] = fe, fe++; + while (--Te); + Q.strstart = fe, Q.lookahead = G - 1, We(Q); } - return X.strstart += X.lookahead, X.block_start = X.strstart, X.insert = X.lookahead, X.lookahead = 0, X.match_length = X.prev_length = H - 1, X.match_available = 0, R.next_in = je, R.input = Je, R.avail_in = Ke, X.wrap = Ze, A; + return Q.strstart += Q.lookahead, Q.block_start = Q.strstart, Q.insert = Q.lookahead, Q.lookahead = 0, Q.match_length = Q.prev_length = G - 1, Q.match_available = 0, $.next_in = je, $.input = Je, $.avail_in = Ke, Q.wrap = Ze, w; } - e.deflateInit = Oe, e.deflateInit2 = he, e.deflateReset = Ae, e.deflateResetKeep = ce, e.deflateSetHeader = ke, e.deflate = j, e.deflateEnd = $e, e.deflateSetDictionary = Ve, e.deflateInfo = "pako deflate (from Nodeca project)"; + e.deflateInit = De, e.deflateInit2 = he, e.deflateReset = Se, e.deflateResetKeep = ue, e.deflateSetHeader = Fe, e.deflate = K, e.deflateEnd = ze, e.deflateSetDictionary = Ve, e.deflateInfo = "pako deflate (from Nodeca project)"; } ), /***/ @@ -21380,11 +21380,11 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js ***! \*********************************************************************/ /***/ - (r) => { + (t) => { function e() { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; } - r.exports = e; + t.exports = e; } ), /***/ @@ -21393,96 +21393,96 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js ***! \********************************************************************/ /***/ - (r) => { - var e = 30, t = 12; - r.exports = function(f, u) { - var y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B; - y = f.state, h = f.next_in, P = f.input, _ = h + (f.avail_in - 5), E = f.next_out, B = f.output, c = E - (u - f.avail_out), C = E + (f.avail_out - 257), b = y.dmax, A = y.wsize, S = y.whave, s = y.wnext, o = y.window, w = y.hold, p = y.bits, v = y.lencode, a = y.distcode, l = (1 << y.lenbits) - 1, g = (1 << y.distbits) - 1; + (t) => { + var e = 30, r = 12; + t.exports = function(f, u) { + var b, h, _, E, c, S, y, w, L, s, o, A, p, v, a, l, g, M, C, T, D, I, B, P, z; + b = f.state, h = f.next_in, P = f.input, _ = h + (f.avail_in - 5), E = f.next_out, z = f.output, c = E - (u - f.avail_out), S = E + (f.avail_out - 257), y = b.dmax, w = b.wsize, L = b.whave, s = b.wnext, o = b.window, A = b.hold, p = b.bits, v = b.lencode, a = b.distcode, l = (1 << b.lenbits) - 1, g = (1 << b.distbits) - 1; e: do { - p < 15 && (w += P[h++] << p, p += 8, w += P[h++] << p, p += 8), M = v[w & l]; + p < 15 && (A += P[h++] << p, p += 8, A += P[h++] << p, p += 8), M = v[A & l]; t: for (; ; ) { - if (L = M >>> 24, w >>>= L, p -= L, L = M >>> 16 & 255, L === 0) - B[E++] = M & 65535; - else if (L & 16) { - T = M & 65535, L &= 15, L && (p < L && (w += P[h++] << p, p += 8), T += w & (1 << L) - 1, w >>>= L, p -= L), p < 15 && (w += P[h++] << p, p += 8, w += P[h++] << p, p += 8), M = a[w & g]; + if (C = M >>> 24, A >>>= C, p -= C, C = M >>> 16 & 255, C === 0) + z[E++] = M & 65535; + else if (C & 16) { + T = M & 65535, C &= 15, C && (p < C && (A += P[h++] << p, p += 8), T += A & (1 << C) - 1, A >>>= C, p -= C), p < 15 && (A += P[h++] << p, p += 8, A += P[h++] << p, p += 8), M = a[A & g]; r: for (; ; ) { - if (L = M >>> 24, w >>>= L, p -= L, L = M >>> 16 & 255, L & 16) { - if (D = M & 65535, L &= 15, p < L && (w += P[h++] << p, p += 8, p < L && (w += P[h++] << p, p += 8)), D += w & (1 << L) - 1, D > b) { - f.msg = "invalid distance too far back", y.mode = e; + if (C = M >>> 24, A >>>= C, p -= C, C = M >>> 16 & 255, C & 16) { + if (D = M & 65535, C &= 15, p < C && (A += P[h++] << p, p += 8, p < C && (A += P[h++] << p, p += 8)), D += A & (1 << C) - 1, D > y) { + f.msg = "invalid distance too far back", b.mode = e; break e; } - if (w >>>= L, p -= L, L = E - c, D > L) { - if (L = D - L, L > S && y.sane) { - f.msg = "invalid distance too far back", y.mode = e; + if (A >>>= C, p -= C, C = E - c, D > C) { + if (C = D - C, C > L && b.sane) { + f.msg = "invalid distance too far back", b.mode = e; break e; } - if (I = 0, z = o, s === 0) { - if (I += A - L, L < T) { - T -= L; + if (I = 0, B = o, s === 0) { + if (I += w - C, C < T) { + T -= C; do - B[E++] = o[I++]; - while (--L); - I = E - D, z = B; + z[E++] = o[I++]; + while (--C); + I = E - D, B = z; } - } else if (s < L) { - if (I += A + s - L, L -= s, L < T) { - T -= L; + } else if (s < C) { + if (I += w + s - C, C -= s, C < T) { + T -= C; do - B[E++] = o[I++]; - while (--L); + z[E++] = o[I++]; + while (--C); if (I = 0, s < T) { - L = s, T -= L; + C = s, T -= C; do - B[E++] = o[I++]; - while (--L); - I = E - D, z = B; + z[E++] = o[I++]; + while (--C); + I = E - D, B = z; } } - } else if (I += s - L, L < T) { - T -= L; + } else if (I += s - C, C < T) { + T -= C; do - B[E++] = o[I++]; - while (--L); - I = E - D, z = B; + z[E++] = o[I++]; + while (--C); + I = E - D, B = z; } for (; T > 2; ) - B[E++] = z[I++], B[E++] = z[I++], B[E++] = z[I++], T -= 3; - T && (B[E++] = z[I++], T > 1 && (B[E++] = z[I++])); + z[E++] = B[I++], z[E++] = B[I++], z[E++] = B[I++], T -= 3; + T && (z[E++] = B[I++], T > 1 && (z[E++] = B[I++])); } else { I = E - D; do - B[E++] = B[I++], B[E++] = B[I++], B[E++] = B[I++], T -= 3; + z[E++] = z[I++], z[E++] = z[I++], z[E++] = z[I++], T -= 3; while (T > 2); - T && (B[E++] = B[I++], T > 1 && (B[E++] = B[I++])); + T && (z[E++] = z[I++], T > 1 && (z[E++] = z[I++])); } - } else if (L & 64) { - f.msg = "invalid distance code", y.mode = e; + } else if (C & 64) { + f.msg = "invalid distance code", b.mode = e; break e; } else { - M = a[(M & 65535) + (w & (1 << L) - 1)]; + M = a[(M & 65535) + (A & (1 << C) - 1)]; continue r; } break; } - } else if (L & 64) - if (L & 32) { - y.mode = t; + } else if (C & 64) + if (C & 32) { + b.mode = r; break e; } else { - f.msg = "invalid literal/length code", y.mode = e; + f.msg = "invalid literal/length code", b.mode = e; break e; } else { - M = v[(M & 65535) + (w & (1 << L) - 1)]; + M = v[(M & 65535) + (A & (1 << C) - 1)]; continue t; } break; } - } while (h < _ && E < C); - T = p >> 3, h -= T, p -= T << 3, w &= (1 << p) - 1, f.next_in = h, f.next_out = E, f.avail_in = h < _ ? 5 + (_ - h) : 5 - (h - _), f.avail_out = E < C ? 257 + (C - E) : 257 - (E - C), y.hold = w, y.bits = p; + } while (h < _ && E < S); + T = p >> 3, h -= T, p -= T << 3, A &= (1 << p) - 1, f.next_in = h, f.next_out = E, f.avail_in = h < _ ? 5 + (_ - h) : 5 - (h - _), f.avail_out = E < S ? 257 + (S - E) : 257 - (E - S), b.hold = A, b.bits = p; }; } ), @@ -21492,515 +21492,515 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js ***! \********************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = t( + ), f = r( /*! ./adler32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js" - ), u = t( + ), u = r( /*! ./crc32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js" - ), y = t( + ), b = r( /*! ./inffast */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js" - ), h = t( + ), h = r( /*! ./inftrees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js" - ), _ = 0, E = 1, c = 2, C = 4, b = 5, A = 6, S = 0, s = 1, o = 2, w = -2, p = -3, v = -4, a = -5, l = 8, g = 1, M = 2, L = 3, T = 4, D = 5, I = 6, z = 7, P = 8, B = 9, k = 10, N = 11, $ = 12, F = 13, G = 14, H = 15, U = 16, V = 17, Q = 18, ae = 19, oe = 20, q = 21, me = 22, ne = 23, fe = 24, Ce = 25, Me = 26, Te = 27, se = 28, pe = 29, we = 30, Fe = 31, Ue = 32, Ne = 852, Be = 592, ue = 15, ye = ue; - function ge(he) { + ), _ = 0, E = 1, c = 2, S = 4, y = 5, w = 6, L = 0, s = 1, o = 2, A = -2, p = -3, v = -4, a = -5, l = 8, g = 1, M = 2, C = 3, T = 4, D = 5, I = 6, B = 7, P = 8, z = 9, k = 10, N = 11, R = 12, U = 13, W = 14, G = 15, F = 16, V = 17, J = 18, X = 19, oe = 20, te = 21, ve = 22, se = 23, le = 24, Ce = 25, be = 26, Le = 27, ae = 28, _e = 29, Ee = 30, Be = 31, Ne = 32, Ge = 852, ke = 592, pe = 15, de = pe; + function ce(he) { return (he >>> 24 & 255) + (he >>> 8 & 65280) + ((he & 65280) << 8) + ((he & 255) << 24); } - function Se() { + function Ae() { this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new n.Buf16(320), this.work = new n.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } - function ze(he) { - var Oe; - return !he || !he.state ? w : (Oe = he.state, he.total_in = he.total_out = Oe.total = 0, he.msg = "", Oe.wrap && (he.adler = Oe.wrap & 1), Oe.mode = g, Oe.last = 0, Oe.havedict = 0, Oe.dmax = 32768, Oe.head = null, Oe.hold = 0, Oe.bits = 0, Oe.lencode = Oe.lendyn = new n.Buf32(Ne), Oe.distcode = Oe.distdyn = new n.Buf32(Be), Oe.sane = 1, Oe.back = -1, S); + function Oe(he) { + var De; + return !he || !he.state ? A : (De = he.state, he.total_in = he.total_out = De.total = 0, he.msg = "", De.wrap && (he.adler = De.wrap & 1), De.mode = g, De.last = 0, De.havedict = 0, De.dmax = 32768, De.head = null, De.hold = 0, De.bits = 0, De.lencode = De.lendyn = new n.Buf32(Ge), De.distcode = De.distdyn = new n.Buf32(ke), De.sane = 1, De.back = -1, L); } - function He(he) { - var Oe; - return !he || !he.state ? w : (Oe = he.state, Oe.wsize = 0, Oe.whave = 0, Oe.wnext = 0, ze(he)); + function We(he) { + var De; + return !he || !he.state ? A : (De = he.state, De.wsize = 0, De.whave = 0, De.wnext = 0, Oe(he)); } - function We(he, Oe) { - var j, $e; - return !he || !he.state || ($e = he.state, Oe < 0 ? (j = 0, Oe = -Oe) : (j = (Oe >> 4) + 1, Oe < 48 && (Oe &= 15)), Oe && (Oe < 8 || Oe > 15)) ? w : ($e.window !== null && $e.wbits !== Oe && ($e.window = null), $e.wrap = j, $e.wbits = Oe, He(he)); + function Ue(he, De) { + var K, ze; + return !he || !he.state || (ze = he.state, De < 0 ? (K = 0, De = -De) : (K = (De >> 4) + 1, De < 48 && (De &= 15)), De && (De < 8 || De > 15)) ? A : (ze.window !== null && ze.wbits !== De && (ze.window = null), ze.wrap = K, ze.wbits = De, We(he)); } - function Y(he, Oe) { - var j, $e; - return he ? ($e = new Se(), he.state = $e, $e.window = null, j = We(he, Oe), j !== S && (he.state = null), j) : w; + function Z(he, De) { + var K, ze; + return he ? (ze = new Ae(), he.state = ze, ze.window = null, K = Ue(he, De), K !== L && (he.state = null), K) : A; } - function K(he) { - return Y(he, ye); + function j(he) { + return Z(he, de); } - var ee = !0, de, ve; - function Ie(he) { + var ee = !0, ge, ye; + function $e(he) { if (ee) { - var Oe; - for (de = new n.Buf32(512), ve = new n.Buf32(32), Oe = 0; Oe < 144; ) - he.lens[Oe++] = 8; - for (; Oe < 256; ) - he.lens[Oe++] = 9; - for (; Oe < 280; ) - he.lens[Oe++] = 7; - for (; Oe < 288; ) - he.lens[Oe++] = 8; - for (h(E, he.lens, 0, 288, de, 0, he.work, { bits: 9 }), Oe = 0; Oe < 32; ) - he.lens[Oe++] = 5; - h(c, he.lens, 0, 32, ve, 0, he.work, { bits: 5 }), ee = !1; - } - he.lencode = de, he.lenbits = 9, he.distcode = ve, he.distbits = 5; + var De; + for (ge = new n.Buf32(512), ye = new n.Buf32(32), De = 0; De < 144; ) + he.lens[De++] = 8; + for (; De < 256; ) + he.lens[De++] = 9; + for (; De < 280; ) + he.lens[De++] = 7; + for (; De < 288; ) + he.lens[De++] = 8; + for (h(E, he.lens, 0, 288, ge, 0, he.work, { bits: 9 }), De = 0; De < 32; ) + he.lens[De++] = 5; + h(c, he.lens, 0, 32, ye, 0, he.work, { bits: 5 }), ee = !1; + } + he.lencode = ge, he.lenbits = 9, he.distcode = ye, he.distbits = 5; } - function Re(he, Oe, j, $e) { - var Ve, R = he.state; - return R.window === null && (R.wsize = 1 << R.wbits, R.wnext = 0, R.whave = 0, R.window = new n.Buf8(R.wsize)), $e >= R.wsize ? (n.arraySet(R.window, Oe, j - R.wsize, R.wsize, 0), R.wnext = 0, R.whave = R.wsize) : (Ve = R.wsize - R.wnext, Ve > $e && (Ve = $e), n.arraySet(R.window, Oe, j - $e, Ve, R.wnext), $e -= Ve, $e ? (n.arraySet(R.window, Oe, j - $e, $e, 0), R.wnext = $e, R.whave = R.wsize) : (R.wnext += Ve, R.wnext === R.wsize && (R.wnext = 0), R.whave < R.wsize && (R.whave += Ve))), 0; + function Re(he, De, K, ze) { + var Ve, $ = he.state; + return $.window === null && ($.wsize = 1 << $.wbits, $.wnext = 0, $.whave = 0, $.window = new n.Buf8($.wsize)), ze >= $.wsize ? (n.arraySet($.window, De, K - $.wsize, $.wsize, 0), $.wnext = 0, $.whave = $.wsize) : (Ve = $.wsize - $.wnext, Ve > ze && (Ve = ze), n.arraySet($.window, De, K - ze, Ve, $.wnext), ze -= Ve, ze ? (n.arraySet($.window, De, K - ze, ze, 0), $.wnext = ze, $.whave = $.wsize) : ($.wnext += Ve, $.wnext === $.wsize && ($.wnext = 0), $.whave < $.wsize && ($.whave += Ve))), 0; } - function Z(he, Oe) { - var j, $e, Ve, R, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt = 0, it, tt, Et, lt, wt, Pt, vt, bt, mt = new n.Buf8(4), Tt, Ot, kt = ( + function Y(he, De) { + var K, ze, Ve, $, xe, Me, Q, fe, Te, Ze, Ke, je, Je, St, rt = 0, it, tt, Et, lt, wt, Pt, vt, bt, mt = new n.Buf8(4), Tt, Ot, kt = ( /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] ); if (!he || !he.state || !he.output || !he.input && he.avail_in !== 0) - return w; - j = he.state, j.mode === $ && (j.mode = F), be = he.next_out, Ve = he.output, X = he.avail_out, R = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, Ze = Ee, Ke = X, bt = S; + return A; + K = he.state, K.mode === R && (K.mode = U), xe = he.next_out, Ve = he.output, Q = he.avail_out, $ = he.next_in, ze = he.input, Me = he.avail_in, fe = K.hold, Te = K.bits, Ze = Me, Ke = Q, bt = L; e: for (; ; ) - switch (j.mode) { + switch (K.mode) { case g: - if (j.wrap === 0) { - j.mode = F; + if (K.wrap === 0) { + K.mode = U; break; } - for (; Le < 16; ) { - if (Ee === 0) + for (; Te < 16; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (j.wrap & 2 && le === 35615) { - j.check = 0, mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0), le = 0, Le = 0, j.mode = M; + if (K.wrap & 2 && fe === 35615) { + K.check = 0, mt[0] = fe & 255, mt[1] = fe >>> 8 & 255, K.check = u(K.check, mt, 2, 0), fe = 0, Te = 0, K.mode = M; break; } - if (j.flags = 0, j.head && (j.head.done = !1), !(j.wrap & 1) || /* check if zlib header allowed */ - (((le & 255) << 8) + (le >> 8)) % 31) { - he.msg = "incorrect header check", j.mode = we; + if (K.flags = 0, K.head && (K.head.done = !1), !(K.wrap & 1) || /* check if zlib header allowed */ + (((fe & 255) << 8) + (fe >> 8)) % 31) { + he.msg = "incorrect header check", K.mode = Ee; break; } - if ((le & 15) !== l) { - he.msg = "unknown compression method", j.mode = we; + if ((fe & 15) !== l) { + he.msg = "unknown compression method", K.mode = Ee; break; } - if (le >>>= 4, Le -= 4, vt = (le & 15) + 8, j.wbits === 0) - j.wbits = vt; - else if (vt > j.wbits) { - he.msg = "invalid window size", j.mode = we; + if (fe >>>= 4, Te -= 4, vt = (fe & 15) + 8, K.wbits === 0) + K.wbits = vt; + else if (vt > K.wbits) { + he.msg = "invalid window size", K.mode = Ee; break; } - j.dmax = 1 << vt, he.adler = j.check = 1, j.mode = le & 512 ? k : $, le = 0, Le = 0; + K.dmax = 1 << vt, he.adler = K.check = 1, K.mode = fe & 512 ? k : R, fe = 0, Te = 0; break; case M: - for (; Le < 16; ) { - if (Ee === 0) + for (; Te < 16; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (j.flags = le, (j.flags & 255) !== l) { - he.msg = "unknown compression method", j.mode = we; + if (K.flags = fe, (K.flags & 255) !== l) { + he.msg = "unknown compression method", K.mode = Ee; break; } - if (j.flags & 57344) { - he.msg = "unknown header flags set", j.mode = we; + if (K.flags & 57344) { + he.msg = "unknown header flags set", K.mode = Ee; break; } - j.head && (j.head.text = le >> 8 & 1), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = L; - case L: - for (; Le < 32; ) { - if (Ee === 0) + K.head && (K.head.text = fe >> 8 & 1), K.flags & 512 && (mt[0] = fe & 255, mt[1] = fe >>> 8 & 255, K.check = u(K.check, mt, 2, 0)), fe = 0, Te = 0, K.mode = C; + case C: + for (; Te < 32; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.head && (j.head.time = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, mt[2] = le >>> 16 & 255, mt[3] = le >>> 24 & 255, j.check = u(j.check, mt, 4, 0)), le = 0, Le = 0, j.mode = T; + K.head && (K.head.time = fe), K.flags & 512 && (mt[0] = fe & 255, mt[1] = fe >>> 8 & 255, mt[2] = fe >>> 16 & 255, mt[3] = fe >>> 24 & 255, K.check = u(K.check, mt, 4, 0)), fe = 0, Te = 0, K.mode = T; case T: - for (; Le < 16; ) { - if (Ee === 0) + for (; Te < 16; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.head && (j.head.xflags = le & 255, j.head.os = le >> 8), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = D; + K.head && (K.head.xflags = fe & 255, K.head.os = fe >> 8), K.flags & 512 && (mt[0] = fe & 255, mt[1] = fe >>> 8 & 255, K.check = u(K.check, mt, 2, 0)), fe = 0, Te = 0, K.mode = D; case D: - if (j.flags & 1024) { - for (; Le < 16; ) { - if (Ee === 0) + if (K.flags & 1024) { + for (; Te < 16; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.length = le, j.head && (j.head.extra_len = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0; + K.length = fe, K.head && (K.head.extra_len = fe), K.flags & 512 && (mt[0] = fe & 255, mt[1] = fe >>> 8 & 255, K.check = u(K.check, mt, 2, 0)), fe = 0, Te = 0; } else - j.head && (j.head.extra = null); - j.mode = I; + K.head && (K.head.extra = null); + K.mode = I; case I: - if (j.flags & 1024 && (je = j.length, je > Ee && (je = Ee), je && (j.head && (vt = j.head.extra_len - j.length, j.head.extra || (j.head.extra = new Array(j.head.extra_len)), n.arraySet( - j.head.extra, - $e, - R, + if (K.flags & 1024 && (je = K.length, je > Me && (je = Me), je && (K.head && (vt = K.head.extra_len - K.length, K.head.extra || (K.head.extra = new Array(K.head.extra_len)), n.arraySet( + K.head.extra, + ze, + $, // extra field is limited to 65536 bytes // - no need for additional size check je, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ vt - )), j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, j.length -= je), j.length)) + )), K.flags & 512 && (K.check = u(K.check, ze, je, $)), Me -= je, $ += je, K.length -= je), K.length)) break e; - j.length = 0, j.mode = z; - case z: - if (j.flags & 2048) { - if (Ee === 0) + K.length = 0, K.mode = B; + case B: + if (K.flags & 2048) { + if (Me === 0) break e; je = 0; do - vt = $e[R + je++], j.head && vt && j.length < 65536 && (j.head.name += String.fromCharCode(vt)); - while (vt && je < Ee); - if (j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, vt) + vt = ze[$ + je++], K.head && vt && K.length < 65536 && (K.head.name += String.fromCharCode(vt)); + while (vt && je < Me); + if (K.flags & 512 && (K.check = u(K.check, ze, je, $)), Me -= je, $ += je, vt) break e; } else - j.head && (j.head.name = null); - j.length = 0, j.mode = P; + K.head && (K.head.name = null); + K.length = 0, K.mode = P; case P: - if (j.flags & 4096) { - if (Ee === 0) + if (K.flags & 4096) { + if (Me === 0) break e; je = 0; do - vt = $e[R + je++], j.head && vt && j.length < 65536 && (j.head.comment += String.fromCharCode(vt)); - while (vt && je < Ee); - if (j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, vt) + vt = ze[$ + je++], K.head && vt && K.length < 65536 && (K.head.comment += String.fromCharCode(vt)); + while (vt && je < Me); + if (K.flags & 512 && (K.check = u(K.check, ze, je, $)), Me -= je, $ += je, vt) break e; } else - j.head && (j.head.comment = null); - j.mode = B; - case B: - if (j.flags & 512) { - for (; Le < 16; ) { - if (Ee === 0) + K.head && (K.head.comment = null); + K.mode = z; + case z: + if (K.flags & 512) { + for (; Te < 16; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (le !== (j.check & 65535)) { - he.msg = "header crc mismatch", j.mode = we; + if (fe !== (K.check & 65535)) { + he.msg = "header crc mismatch", K.mode = Ee; break; } - le = 0, Le = 0; + fe = 0, Te = 0; } - j.head && (j.head.hcrc = j.flags >> 9 & 1, j.head.done = !0), he.adler = j.check = 0, j.mode = $; + K.head && (K.head.hcrc = K.flags >> 9 & 1, K.head.done = !0), he.adler = K.check = 0, K.mode = R; break; case k: - for (; Le < 32; ) { - if (Ee === 0) + for (; Te < 32; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - he.adler = j.check = ge(le), le = 0, Le = 0, j.mode = N; + he.adler = K.check = ce(fe), fe = 0, Te = 0, K.mode = N; case N: - if (j.havedict === 0) - return he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, o; - he.adler = j.check = 1, j.mode = $; - case $: - if (Oe === b || Oe === A) + if (K.havedict === 0) + return he.next_out = xe, he.avail_out = Q, he.next_in = $, he.avail_in = Me, K.hold = fe, K.bits = Te, o; + he.adler = K.check = 1, K.mode = R; + case R: + if (De === y || De === w) break e; - case F: - if (j.last) { - le >>>= Le & 7, Le -= Le & 7, j.mode = Te; + case U: + if (K.last) { + fe >>>= Te & 7, Te -= Te & 7, K.mode = Le; break; } - for (; Le < 3; ) { - if (Ee === 0) + for (; Te < 3; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - switch (j.last = le & 1, le >>>= 1, Le -= 1, le & 3) { + switch (K.last = fe & 1, fe >>>= 1, Te -= 1, fe & 3) { case 0: - j.mode = G; + K.mode = W; break; case 1: - if (Ie(j), j.mode = oe, Oe === A) { - le >>>= 2, Le -= 2; + if ($e(K), K.mode = oe, De === w) { + fe >>>= 2, Te -= 2; break e; } break; case 2: - j.mode = V; + K.mode = V; break; case 3: - he.msg = "invalid block type", j.mode = we; + he.msg = "invalid block type", K.mode = Ee; } - le >>>= 2, Le -= 2; + fe >>>= 2, Te -= 2; break; - case G: - for (le >>>= Le & 7, Le -= Le & 7; Le < 32; ) { - if (Ee === 0) + case W: + for (fe >>>= Te & 7, Te -= Te & 7; Te < 32; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if ((le & 65535) !== (le >>> 16 ^ 65535)) { - he.msg = "invalid stored block lengths", j.mode = we; + if ((fe & 65535) !== (fe >>> 16 ^ 65535)) { + he.msg = "invalid stored block lengths", K.mode = Ee; break; } - if (j.length = le & 65535, le = 0, Le = 0, j.mode = H, Oe === A) + if (K.length = fe & 65535, fe = 0, Te = 0, K.mode = G, De === w) break e; - case H: - j.mode = U; - case U: - if (je = j.length, je) { - if (je > Ee && (je = Ee), je > X && (je = X), je === 0) + case G: + K.mode = F; + case F: + if (je = K.length, je) { + if (je > Me && (je = Me), je > Q && (je = Q), je === 0) break e; - n.arraySet(Ve, $e, R, je, be), Ee -= je, R += je, X -= je, be += je, j.length -= je; + n.arraySet(Ve, ze, $, je, xe), Me -= je, $ += je, Q -= je, xe += je, K.length -= je; break; } - j.mode = $; + K.mode = R; break; case V: - for (; Le < 14; ) { - if (Ee === 0) + for (; Te < 14; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (j.nlen = (le & 31) + 257, le >>>= 5, Le -= 5, j.ndist = (le & 31) + 1, le >>>= 5, Le -= 5, j.ncode = (le & 15) + 4, le >>>= 4, Le -= 4, j.nlen > 286 || j.ndist > 30) { - he.msg = "too many length or distance symbols", j.mode = we; + if (K.nlen = (fe & 31) + 257, fe >>>= 5, Te -= 5, K.ndist = (fe & 31) + 1, fe >>>= 5, Te -= 5, K.ncode = (fe & 15) + 4, fe >>>= 4, Te -= 4, K.nlen > 286 || K.ndist > 30) { + he.msg = "too many length or distance symbols", K.mode = Ee; break; } - j.have = 0, j.mode = Q; - case Q: - for (; j.have < j.ncode; ) { - for (; Le < 3; ) { - if (Ee === 0) + K.have = 0, K.mode = J; + case J: + for (; K.have < K.ncode; ) { + for (; Te < 3; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.lens[kt[j.have++]] = le & 7, le >>>= 3, Le -= 3; + K.lens[kt[K.have++]] = fe & 7, fe >>>= 3, Te -= 3; } - for (; j.have < 19; ) - j.lens[kt[j.have++]] = 0; - if (j.lencode = j.lendyn, j.lenbits = 7, Tt = { bits: j.lenbits }, bt = h(_, j.lens, 0, 19, j.lencode, 0, j.work, Tt), j.lenbits = Tt.bits, bt) { - he.msg = "invalid code lengths set", j.mode = we; + for (; K.have < 19; ) + K.lens[kt[K.have++]] = 0; + if (K.lencode = K.lendyn, K.lenbits = 7, Tt = { bits: K.lenbits }, bt = h(_, K.lens, 0, 19, K.lencode, 0, K.work, Tt), K.lenbits = Tt.bits, bt) { + he.msg = "invalid code lengths set", K.mode = Ee; break; } - j.have = 0, j.mode = ae; - case ae: - for (; j.have < j.nlen + j.ndist; ) { - for (; rt = j.lencode[le & (1 << j.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { - if (Ee === 0) + K.have = 0, K.mode = X; + case X: + for (; K.have < K.nlen + K.ndist; ) { + for (; rt = K.lencode[fe & (1 << K.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Te); ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } if (Et < 16) - le >>>= it, Le -= it, j.lens[j.have++] = Et; + fe >>>= it, Te -= it, K.lens[K.have++] = Et; else { if (Et === 16) { - for (Ot = it + 2; Le < Ot; ) { - if (Ee === 0) + for (Ot = it + 2; Te < Ot; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (le >>>= it, Le -= it, j.have === 0) { - he.msg = "invalid bit length repeat", j.mode = we; + if (fe >>>= it, Te -= it, K.have === 0) { + he.msg = "invalid bit length repeat", K.mode = Ee; break; } - vt = j.lens[j.have - 1], je = 3 + (le & 3), le >>>= 2, Le -= 2; + vt = K.lens[K.have - 1], je = 3 + (fe & 3), fe >>>= 2, Te -= 2; } else if (Et === 17) { - for (Ot = it + 3; Le < Ot; ) { - if (Ee === 0) + for (Ot = it + 3; Te < Ot; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - le >>>= it, Le -= it, vt = 0, je = 3 + (le & 7), le >>>= 3, Le -= 3; + fe >>>= it, Te -= it, vt = 0, je = 3 + (fe & 7), fe >>>= 3, Te -= 3; } else { - for (Ot = it + 7; Le < Ot; ) { - if (Ee === 0) + for (Ot = it + 7; Te < Ot; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - le >>>= it, Le -= it, vt = 0, je = 11 + (le & 127), le >>>= 7, Le -= 7; + fe >>>= it, Te -= it, vt = 0, je = 11 + (fe & 127), fe >>>= 7, Te -= 7; } - if (j.have + je > j.nlen + j.ndist) { - he.msg = "invalid bit length repeat", j.mode = we; + if (K.have + je > K.nlen + K.ndist) { + he.msg = "invalid bit length repeat", K.mode = Ee; break; } for (; je--; ) - j.lens[j.have++] = vt; + K.lens[K.have++] = vt; } } - if (j.mode === we) + if (K.mode === Ee) break; - if (j.lens[256] === 0) { - he.msg = "invalid code -- missing end-of-block", j.mode = we; + if (K.lens[256] === 0) { + he.msg = "invalid code -- missing end-of-block", K.mode = Ee; break; } - if (j.lenbits = 9, Tt = { bits: j.lenbits }, bt = h(E, j.lens, 0, j.nlen, j.lencode, 0, j.work, Tt), j.lenbits = Tt.bits, bt) { - he.msg = "invalid literal/lengths set", j.mode = we; + if (K.lenbits = 9, Tt = { bits: K.lenbits }, bt = h(E, K.lens, 0, K.nlen, K.lencode, 0, K.work, Tt), K.lenbits = Tt.bits, bt) { + he.msg = "invalid literal/lengths set", K.mode = Ee; break; } - if (j.distbits = 6, j.distcode = j.distdyn, Tt = { bits: j.distbits }, bt = h(c, j.lens, j.nlen, j.ndist, j.distcode, 0, j.work, Tt), j.distbits = Tt.bits, bt) { - he.msg = "invalid distances set", j.mode = we; + if (K.distbits = 6, K.distcode = K.distdyn, Tt = { bits: K.distbits }, bt = h(c, K.lens, K.nlen, K.ndist, K.distcode, 0, K.work, Tt), K.distbits = Tt.bits, bt) { + he.msg = "invalid distances set", K.mode = Ee; break; } - if (j.mode = oe, Oe === A) + if (K.mode = oe, De === w) break e; case oe: - j.mode = q; - case q: - if (Ee >= 6 && X >= 258) { - he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, y(he, Ke), be = he.next_out, Ve = he.output, X = he.avail_out, R = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, j.mode === $ && (j.back = -1); + K.mode = te; + case te: + if (Me >= 6 && Q >= 258) { + he.next_out = xe, he.avail_out = Q, he.next_in = $, he.avail_in = Me, K.hold = fe, K.bits = Te, b(he, Ke), xe = he.next_out, Ve = he.output, Q = he.avail_out, $ = he.next_in, ze = he.input, Me = he.avail_in, fe = K.hold, Te = K.bits, K.mode === R && (K.back = -1); break; } - for (j.back = 0; rt = j.lencode[le & (1 << j.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { - if (Ee === 0) + for (K.back = 0; rt = K.lencode[fe & (1 << K.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Te); ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } if (tt && !(tt & 240)) { - for (lt = it, wt = tt, Pt = Et; rt = j.lencode[Pt + ((le & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Le); ) { - if (Ee === 0) + for (lt = it, wt = tt, Pt = Et; rt = K.lencode[Pt + ((fe & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Te); ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - le >>>= lt, Le -= lt, j.back += lt; + fe >>>= lt, Te -= lt, K.back += lt; } - if (le >>>= it, Le -= it, j.back += it, j.length = Et, tt === 0) { - j.mode = Me; + if (fe >>>= it, Te -= it, K.back += it, K.length = Et, tt === 0) { + K.mode = be; break; } if (tt & 32) { - j.back = -1, j.mode = $; + K.back = -1, K.mode = R; break; } if (tt & 64) { - he.msg = "invalid literal/length code", j.mode = we; + he.msg = "invalid literal/length code", K.mode = Ee; break; } - j.extra = tt & 15, j.mode = me; - case me: - if (j.extra) { - for (Ot = j.extra; Le < Ot; ) { - if (Ee === 0) + K.extra = tt & 15, K.mode = ve; + case ve: + if (K.extra) { + for (Ot = K.extra; Te < Ot; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.length += le & (1 << j.extra) - 1, le >>>= j.extra, Le -= j.extra, j.back += j.extra; + K.length += fe & (1 << K.extra) - 1, fe >>>= K.extra, Te -= K.extra, K.back += K.extra; } - j.was = j.length, j.mode = ne; - case ne: - for (; rt = j.distcode[le & (1 << j.distbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { - if (Ee === 0) + K.was = K.length, K.mode = se; + case se: + for (; rt = K.distcode[fe & (1 << K.distbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Te); ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } if (!(tt & 240)) { - for (lt = it, wt = tt, Pt = Et; rt = j.distcode[Pt + ((le & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Le); ) { - if (Ee === 0) + for (lt = it, wt = tt, Pt = Et; rt = K.distcode[Pt + ((fe & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Te); ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - le >>>= lt, Le -= lt, j.back += lt; + fe >>>= lt, Te -= lt, K.back += lt; } - if (le >>>= it, Le -= it, j.back += it, tt & 64) { - he.msg = "invalid distance code", j.mode = we; + if (fe >>>= it, Te -= it, K.back += it, tt & 64) { + he.msg = "invalid distance code", K.mode = Ee; break; } - j.offset = Et, j.extra = tt & 15, j.mode = fe; - case fe: - if (j.extra) { - for (Ot = j.extra; Le < Ot; ) { - if (Ee === 0) + K.offset = Et, K.extra = tt & 15, K.mode = le; + case le: + if (K.extra) { + for (Ot = K.extra; Te < Ot; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - j.offset += le & (1 << j.extra) - 1, le >>>= j.extra, Le -= j.extra, j.back += j.extra; + K.offset += fe & (1 << K.extra) - 1, fe >>>= K.extra, Te -= K.extra, K.back += K.extra; } - if (j.offset > j.dmax) { - he.msg = "invalid distance too far back", j.mode = we; + if (K.offset > K.dmax) { + he.msg = "invalid distance too far back", K.mode = Ee; break; } - j.mode = Ce; + K.mode = Ce; case Ce: - if (X === 0) + if (Q === 0) break e; - if (je = Ke - X, j.offset > je) { - if (je = j.offset - je, je > j.whave && j.sane) { - he.msg = "invalid distance too far back", j.mode = we; + if (je = Ke - Q, K.offset > je) { + if (je = K.offset - je, je > K.whave && K.sane) { + he.msg = "invalid distance too far back", K.mode = Ee; break; } - je > j.wnext ? (je -= j.wnext, Je = j.wsize - je) : Je = j.wnext - je, je > j.length && (je = j.length), Lt = j.window; + je > K.wnext ? (je -= K.wnext, Je = K.wsize - je) : Je = K.wnext - je, je > K.length && (je = K.length), St = K.window; } else - Lt = Ve, Je = be - j.offset, je = j.length; - je > X && (je = X), X -= je, j.length -= je; + St = Ve, Je = xe - K.offset, je = K.length; + je > Q && (je = Q), Q -= je, K.length -= je; do - Ve[be++] = Lt[Je++]; + Ve[xe++] = St[Je++]; while (--je); - j.length === 0 && (j.mode = q); + K.length === 0 && (K.mode = te); break; - case Me: - if (X === 0) + case be: + if (Q === 0) break e; - Ve[be++] = j.length, X--, j.mode = q; + Ve[xe++] = K.length, Q--, K.mode = te; break; - case Te: - if (j.wrap) { - for (; Le < 32; ) { - if (Ee === 0) + case Le: + if (K.wrap) { + for (; Te < 32; ) { + if (Me === 0) break e; - Ee--, le |= $e[R++] << Le, Le += 8; + Me--, fe |= ze[$++] << Te, Te += 8; } - if (Ke -= X, he.total_out += Ke, j.total += Ke, Ke && (he.adler = j.check = /*UPDATE(state.check, put - _out, _out);*/ - j.flags ? u(j.check, Ve, Ke, be - Ke) : f(j.check, Ve, Ke, be - Ke)), Ke = X, (j.flags ? le : ge(le)) !== j.check) { - he.msg = "incorrect data check", j.mode = we; + if (Ke -= Q, he.total_out += Ke, K.total += Ke, Ke && (he.adler = K.check = /*UPDATE(state.check, put - _out, _out);*/ + K.flags ? u(K.check, Ve, Ke, xe - Ke) : f(K.check, Ve, Ke, xe - Ke)), Ke = Q, (K.flags ? fe : ce(fe)) !== K.check) { + he.msg = "incorrect data check", K.mode = Ee; break; } - le = 0, Le = 0; + fe = 0, Te = 0; } - j.mode = se; - case se: - if (j.wrap && j.flags) { - for (; Le < 32; ) { - if (Ee === 0) + K.mode = ae; + case ae: + if (K.wrap && K.flags) { + for (; Te < 32; ) { + if (Me === 0) break e; - Ee--, le += $e[R++] << Le, Le += 8; + Me--, fe += ze[$++] << Te, Te += 8; } - if (le !== (j.total & 4294967295)) { - he.msg = "incorrect length check", j.mode = we; + if (fe !== (K.total & 4294967295)) { + he.msg = "incorrect length check", K.mode = Ee; break; } - le = 0, Le = 0; + fe = 0, Te = 0; } - j.mode = pe; - case pe: + K.mode = _e; + case _e: bt = s; break e; - case we: + case Ee: bt = p; break e; - case Fe: + case Be: return v; - case Ue: + case Ne: default: - return w; + return A; } - return he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, (j.wsize || Ke !== he.avail_out && j.mode < we && (j.mode < Te || Oe !== C)) && Re(he, he.output, he.next_out, Ke - he.avail_out), Ze -= he.avail_in, Ke -= he.avail_out, he.total_in += Ze, he.total_out += Ke, j.total += Ke, j.wrap && Ke && (he.adler = j.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - j.flags ? u(j.check, Ve, Ke, he.next_out - Ke) : f(j.check, Ve, Ke, he.next_out - Ke)), he.data_type = j.bits + (j.last ? 64 : 0) + (j.mode === $ ? 128 : 0) + (j.mode === oe || j.mode === H ? 256 : 0), (Ze === 0 && Ke === 0 || Oe === C) && bt === S && (bt = a), bt; + return he.next_out = xe, he.avail_out = Q, he.next_in = $, he.avail_in = Me, K.hold = fe, K.bits = Te, (K.wsize || Ke !== he.avail_out && K.mode < Ee && (K.mode < Le || De !== S)) && Re(he, he.output, he.next_out, Ke - he.avail_out), Ze -= he.avail_in, Ke -= he.avail_out, he.total_in += Ze, he.total_out += Ke, K.total += Ke, K.wrap && Ke && (he.adler = K.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + K.flags ? u(K.check, Ve, Ke, he.next_out - Ke) : f(K.check, Ve, Ke, he.next_out - Ke)), he.data_type = K.bits + (K.last ? 64 : 0) + (K.mode === R ? 128 : 0) + (K.mode === oe || K.mode === G ? 256 : 0), (Ze === 0 && Ke === 0 || De === S) && bt === L && (bt = a), bt; } - function ce(he) { + function ue(he) { if (!he || !he.state) - return w; - var Oe = he.state; - return Oe.window && (Oe.window = null), he.state = null, S; + return A; + var De = he.state; + return De.window && (De.window = null), he.state = null, L; } - function Ae(he, Oe) { - var j; - return !he || !he.state || (j = he.state, !(j.wrap & 2)) ? w : (j.head = Oe, Oe.done = !1, S); + function Se(he, De) { + var K; + return !he || !he.state || (K = he.state, !(K.wrap & 2)) ? A : (K.head = De, De.done = !1, L); } - function ke(he, Oe) { - var j = Oe.length, $e, Ve, R; - return !he || !he.state || ($e = he.state, $e.wrap !== 0 && $e.mode !== N) ? w : $e.mode === N && (Ve = 1, Ve = f(Ve, Oe, j, 0), Ve !== $e.check) ? p : (R = Re(he, Oe, j, j), R ? ($e.mode = Fe, v) : ($e.havedict = 1, S)); + function Fe(he, De) { + var K = De.length, ze, Ve, $; + return !he || !he.state || (ze = he.state, ze.wrap !== 0 && ze.mode !== N) ? A : ze.mode === N && (Ve = 1, Ve = f(Ve, De, K, 0), Ve !== ze.check) ? p : ($ = Re(he, De, K, K), $ ? (ze.mode = Be, v) : (ze.havedict = 1, L)); } - e.inflateReset = He, e.inflateReset2 = We, e.inflateResetKeep = ze, e.inflateInit = K, e.inflateInit2 = Y, e.inflate = Z, e.inflateEnd = ce, e.inflateGetHeader = Ae, e.inflateSetDictionary = ke, e.inflateInfo = "pako inflate (from Nodeca project)"; + e.inflateReset = We, e.inflateReset2 = Ue, e.inflateResetKeep = Oe, e.inflateInit = j, e.inflateInit2 = Z, e.inflate = Y, e.inflateEnd = ue, e.inflateGetHeader = Se, e.inflateSetDictionary = Fe, e.inflateInfo = "pako inflate (from Nodeca project)"; } ), /***/ @@ -22009,11 +22009,11 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js ***! \*********************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = 15, u = 852, y = 592, h = 0, _ = 1, E = 2, c = [ + ), f = 15, u = 852, b = 592, h = 0, _ = 1, E = 2, c = [ /* Length codes 257..285 base */ 3, 4, @@ -22046,7 +22046,7 @@ ATOM`, g); 258, 0, 0 - ], C = [ + ], S = [ /* Length codes 257..285 extra */ 16, 16, @@ -22079,7 +22079,7 @@ ATOM`, g); 16, 72, 78 - ], b = [ + ], y = [ /* Distance codes 0..29 base */ 1, 2, @@ -22113,7 +22113,7 @@ ATOM`, g); 24577, 0, 0 - ], A = [ + ], w = [ /* Distance codes 0..29 extra */ 16, 16, @@ -22148,50 +22148,50 @@ ATOM`, g); 64, 64 ]; - r.exports = function(s, o, w, p, v, a, l, g) { - var M = g.bits, L = 0, T = 0, D = 0, I = 0, z = 0, P = 0, B = 0, k = 0, N = 0, $ = 0, F, G, H, U, V, Q = null, ae = 0, oe, q = new n.Buf16(f + 1), me = new n.Buf16(f + 1), ne = null, fe = 0, Ce, Me, Te; - for (L = 0; L <= f; L++) - q[L] = 0; + t.exports = function(s, o, A, p, v, a, l, g) { + var M = g.bits, C = 0, T = 0, D = 0, I = 0, B = 0, P = 0, z = 0, k = 0, N = 0, R = 0, U, W, G, F, V, J = null, X = 0, oe, te = new n.Buf16(f + 1), ve = new n.Buf16(f + 1), se = null, le = 0, Ce, be, Le; + for (C = 0; C <= f; C++) + te[C] = 0; for (T = 0; T < p; T++) - q[o[w + T]]++; - for (z = M, I = f; I >= 1 && q[I] === 0; I--) + te[o[A + T]]++; + for (B = M, I = f; I >= 1 && te[I] === 0; I--) ; - if (z > I && (z = I), I === 0) + if (B > I && (B = I), I === 0) return v[a++] = 20971520, v[a++] = 20971520, g.bits = 1, 0; - for (D = 1; D < I && q[D] === 0; D++) + for (D = 1; D < I && te[D] === 0; D++) ; - for (z < D && (z = D), k = 1, L = 1; L <= f; L++) - if (k <<= 1, k -= q[L], k < 0) + for (B < D && (B = D), k = 1, C = 1; C <= f; C++) + if (k <<= 1, k -= te[C], k < 0) return -1; if (k > 0 && (s === h || I !== 1)) return -1; - for (me[1] = 0, L = 1; L < f; L++) - me[L + 1] = me[L] + q[L]; + for (ve[1] = 0, C = 1; C < f; C++) + ve[C + 1] = ve[C] + te[C]; for (T = 0; T < p; T++) - o[w + T] !== 0 && (l[me[o[w + T]]++] = T); - if (s === h ? (Q = ne = l, oe = 19) : s === _ ? (Q = c, ae -= 257, ne = C, fe -= 257, oe = 256) : (Q = b, ne = A, oe = -1), $ = 0, T = 0, L = D, V = a, P = z, B = 0, H = -1, N = 1 << z, U = N - 1, s === _ && N > u || s === E && N > y) + o[A + T] !== 0 && (l[ve[o[A + T]]++] = T); + if (s === h ? (J = se = l, oe = 19) : s === _ ? (J = c, X -= 257, se = S, le -= 257, oe = 256) : (J = y, se = w, oe = -1), R = 0, T = 0, C = D, V = a, P = B, z = 0, G = -1, N = 1 << B, F = N - 1, s === _ && N > u || s === E && N > b) return 1; for (; ; ) { - Ce = L - B, l[T] < oe ? (Me = 0, Te = l[T]) : l[T] > oe ? (Me = ne[fe + l[T]], Te = Q[ae + l[T]]) : (Me = 96, Te = 0), F = 1 << L - B, G = 1 << P, D = G; + Ce = C - z, l[T] < oe ? (be = 0, Le = l[T]) : l[T] > oe ? (be = se[le + l[T]], Le = J[X + l[T]]) : (be = 96, Le = 0), U = 1 << C - z, W = 1 << P, D = W; do - G -= F, v[V + ($ >> B) + G] = Ce << 24 | Me << 16 | Te | 0; - while (G !== 0); - for (F = 1 << L - 1; $ & F; ) - F >>= 1; - if (F !== 0 ? ($ &= F - 1, $ += F) : $ = 0, T++, --q[L] === 0) { - if (L === I) + W -= U, v[V + (R >> z) + W] = Ce << 24 | be << 16 | Le | 0; + while (W !== 0); + for (U = 1 << C - 1; R & U; ) + U >>= 1; + if (U !== 0 ? (R &= U - 1, R += U) : R = 0, T++, --te[C] === 0) { + if (C === I) break; - L = o[w + l[T]]; + C = o[A + l[T]]; } - if (L > z && ($ & U) !== H) { - for (B === 0 && (B = z), V += D, P = L - B, k = 1 << P; P + B < I && (k -= q[P + B], !(k <= 0)); ) + if (C > B && (R & F) !== G) { + for (z === 0 && (z = B), V += D, P = C - z, k = 1 << P; P + z < I && (k -= te[P + z], !(k <= 0)); ) P++, k <<= 1; - if (N += 1 << P, s === _ && N > u || s === E && N > y) + if (N += 1 << P, s === _ && N > u || s === E && N > b) return 1; - H = $ & U, v[H] = z << 24 | P << 16 | V - a | 0; + G = R & F, v[G] = B << 24 | P << 16 | V - a | 0; } } - return $ !== 0 && (v[V + $] = L - B << 24 | 4194304 | 0), g.bits = z, 0; + return R !== 0 && (v[V + R] = C - z << 24 | 4194304 | 0), g.bits = B, 0; }; } ), @@ -22201,8 +22201,8 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js ***! \*********************************************************************/ /***/ - (r) => { - r.exports = { + (t) => { + t.exports = { 2: "need dictionary", /* Z_NEED_DICT 2 */ 1: "stream end", @@ -22230,253 +22230,253 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js ***! \******************************************************************/ /***/ - (r, e, t) => { - var n = t( + (t, e, r) => { + var n = r( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = 4, u = 0, y = 1, h = 2; - function _(Z) { - for (var ce = Z.length; --ce >= 0; ) - Z[ce] = 0; + ), f = 4, u = 0, b = 1, h = 2; + function _(Y) { + for (var ue = Y.length; --ue >= 0; ) + Y[ue] = 0; } - var E = 0, c = 1, C = 2, b = 3, A = 258, S = 29, s = 256, o = s + 1 + S, w = 30, p = 19, v = 2 * o + 1, a = 15, l = 16, g = 7, M = 256, L = 16, T = 17, D = 18, I = ( + var E = 0, c = 1, S = 2, y = 3, w = 258, L = 29, s = 256, o = s + 1 + L, A = 30, p = 19, v = 2 * o + 1, a = 15, l = 16, g = 7, M = 256, C = 16, T = 17, D = 18, I = ( /* extra bits for each length code */ [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0] - ), z = ( + ), B = ( /* extra bits for each distance code */ [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13] ), P = ( /* extra bits for each bit length code */ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7] - ), B = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], k = 512, N = new Array((o + 2) * 2); + ), z = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], k = 512, N = new Array((o + 2) * 2); _(N); - var $ = new Array(w * 2); - _($); - var F = new Array(k); - _(F); - var G = new Array(A - b + 1); - _(G); - var H = new Array(S); - _(H); - var U = new Array(w); + var R = new Array(A * 2); + _(R); + var U = new Array(k); _(U); - function V(Z, ce, Ae, ke, he) { - this.static_tree = Z, this.extra_bits = ce, this.extra_base = Ae, this.elems = ke, this.max_length = he, this.has_stree = Z && Z.length; + var W = new Array(w - y + 1); + _(W); + var G = new Array(L); + _(G); + var F = new Array(A); + _(F); + function V(Y, ue, Se, Fe, he) { + this.static_tree = Y, this.extra_bits = ue, this.extra_base = Se, this.elems = Fe, this.max_length = he, this.has_stree = Y && Y.length; } - var Q, ae, oe; - function q(Z, ce) { - this.dyn_tree = Z, this.max_code = 0, this.stat_desc = ce; + var J, X, oe; + function te(Y, ue) { + this.dyn_tree = Y, this.max_code = 0, this.stat_desc = ue; } - function me(Z) { - return Z < 256 ? F[Z] : F[256 + (Z >>> 7)]; + function ve(Y) { + return Y < 256 ? U[Y] : U[256 + (Y >>> 7)]; } - function ne(Z, ce) { - Z.pending_buf[Z.pending++] = ce & 255, Z.pending_buf[Z.pending++] = ce >>> 8 & 255; + function se(Y, ue) { + Y.pending_buf[Y.pending++] = ue & 255, Y.pending_buf[Y.pending++] = ue >>> 8 & 255; } - function fe(Z, ce, Ae) { - Z.bi_valid > l - Ae ? (Z.bi_buf |= ce << Z.bi_valid & 65535, ne(Z, Z.bi_buf), Z.bi_buf = ce >> l - Z.bi_valid, Z.bi_valid += Ae - l) : (Z.bi_buf |= ce << Z.bi_valid & 65535, Z.bi_valid += Ae); + function le(Y, ue, Se) { + Y.bi_valid > l - Se ? (Y.bi_buf |= ue << Y.bi_valid & 65535, se(Y, Y.bi_buf), Y.bi_buf = ue >> l - Y.bi_valid, Y.bi_valid += Se - l) : (Y.bi_buf |= ue << Y.bi_valid & 65535, Y.bi_valid += Se); } - function Ce(Z, ce, Ae) { - fe( - Z, - Ae[ce * 2], - Ae[ce * 2 + 1] + function Ce(Y, ue, Se) { + le( + Y, + Se[ue * 2], + Se[ue * 2 + 1] /*.Len*/ ); } - function Me(Z, ce) { - var Ae = 0; + function be(Y, ue) { + var Se = 0; do - Ae |= Z & 1, Z >>>= 1, Ae <<= 1; - while (--ce > 0); - return Ae >>> 1; + Se |= Y & 1, Y >>>= 1, Se <<= 1; + while (--ue > 0); + return Se >>> 1; } - function Te(Z) { - Z.bi_valid === 16 ? (ne(Z, Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0) : Z.bi_valid >= 8 && (Z.pending_buf[Z.pending++] = Z.bi_buf & 255, Z.bi_buf >>= 8, Z.bi_valid -= 8); + function Le(Y) { + Y.bi_valid === 16 ? (se(Y, Y.bi_buf), Y.bi_buf = 0, Y.bi_valid = 0) : Y.bi_valid >= 8 && (Y.pending_buf[Y.pending++] = Y.bi_buf & 255, Y.bi_buf >>= 8, Y.bi_valid -= 8); } - function se(Z, ce) { - var Ae = ce.dyn_tree, ke = ce.max_code, he = ce.stat_desc.static_tree, Oe = ce.stat_desc.has_stree, j = ce.stat_desc.extra_bits, $e = ce.stat_desc.extra_base, Ve = ce.stat_desc.max_length, R, be, Ee, X, le, Le, Ze = 0; - for (X = 0; X <= a; X++) - Z.bl_count[X] = 0; - for (Ae[Z.heap[Z.heap_max] * 2 + 1] = 0, R = Z.heap_max + 1; R < v; R++) - be = Z.heap[R], X = Ae[Ae[be * 2 + 1] * 2 + 1] + 1, X > Ve && (X = Ve, Ze++), Ae[be * 2 + 1] = X, !(be > ke) && (Z.bl_count[X]++, le = 0, be >= $e && (le = j[be - $e]), Le = Ae[be * 2], Z.opt_len += Le * (X + le), Oe && (Z.static_len += Le * (he[be * 2 + 1] + le))); + function ae(Y, ue) { + var Se = ue.dyn_tree, Fe = ue.max_code, he = ue.stat_desc.static_tree, De = ue.stat_desc.has_stree, K = ue.stat_desc.extra_bits, ze = ue.stat_desc.extra_base, Ve = ue.stat_desc.max_length, $, xe, Me, Q, fe, Te, Ze = 0; + for (Q = 0; Q <= a; Q++) + Y.bl_count[Q] = 0; + for (Se[Y.heap[Y.heap_max] * 2 + 1] = 0, $ = Y.heap_max + 1; $ < v; $++) + xe = Y.heap[$], Q = Se[Se[xe * 2 + 1] * 2 + 1] + 1, Q > Ve && (Q = Ve, Ze++), Se[xe * 2 + 1] = Q, !(xe > Fe) && (Y.bl_count[Q]++, fe = 0, xe >= ze && (fe = K[xe - ze]), Te = Se[xe * 2], Y.opt_len += Te * (Q + fe), De && (Y.static_len += Te * (he[xe * 2 + 1] + fe))); if (Ze !== 0) { do { - for (X = Ve - 1; Z.bl_count[X] === 0; ) - X--; - Z.bl_count[X]--, Z.bl_count[X + 1] += 2, Z.bl_count[Ve]--, Ze -= 2; + for (Q = Ve - 1; Y.bl_count[Q] === 0; ) + Q--; + Y.bl_count[Q]--, Y.bl_count[Q + 1] += 2, Y.bl_count[Ve]--, Ze -= 2; } while (Ze > 0); - for (X = Ve; X !== 0; X--) - for (be = Z.bl_count[X]; be !== 0; ) - Ee = Z.heap[--R], !(Ee > ke) && (Ae[Ee * 2 + 1] !== X && (Z.opt_len += (X - Ae[Ee * 2 + 1]) * Ae[Ee * 2], Ae[Ee * 2 + 1] = X), be--); + for (Q = Ve; Q !== 0; Q--) + for (xe = Y.bl_count[Q]; xe !== 0; ) + Me = Y.heap[--$], !(Me > Fe) && (Se[Me * 2 + 1] !== Q && (Y.opt_len += (Q - Se[Me * 2 + 1]) * Se[Me * 2], Se[Me * 2 + 1] = Q), xe--); } } - function pe(Z, ce, Ae) { - var ke = new Array(a + 1), he = 0, Oe, j; - for (Oe = 1; Oe <= a; Oe++) - ke[Oe] = he = he + Ae[Oe - 1] << 1; - for (j = 0; j <= ce; j++) { - var $e = Z[j * 2 + 1]; - $e !== 0 && (Z[j * 2] = Me(ke[$e]++, $e)); + function _e(Y, ue, Se) { + var Fe = new Array(a + 1), he = 0, De, K; + for (De = 1; De <= a; De++) + Fe[De] = he = he + Se[De - 1] << 1; + for (K = 0; K <= ue; K++) { + var ze = Y[K * 2 + 1]; + ze !== 0 && (Y[K * 2] = be(Fe[ze]++, ze)); } } - function we() { - var Z, ce, Ae, ke, he, Oe = new Array(a + 1); - for (Ae = 0, ke = 0; ke < S - 1; ke++) - for (H[ke] = Ae, Z = 0; Z < 1 << I[ke]; Z++) - G[Ae++] = ke; - for (G[Ae - 1] = ke, he = 0, ke = 0; ke < 16; ke++) - for (U[ke] = he, Z = 0; Z < 1 << z[ke]; Z++) - F[he++] = ke; - for (he >>= 7; ke < w; ke++) - for (U[ke] = he << 7, Z = 0; Z < 1 << z[ke] - 7; Z++) - F[256 + he++] = ke; - for (ce = 0; ce <= a; ce++) - Oe[ce] = 0; - for (Z = 0; Z <= 143; ) - N[Z * 2 + 1] = 8, Z++, Oe[8]++; - for (; Z <= 255; ) - N[Z * 2 + 1] = 9, Z++, Oe[9]++; - for (; Z <= 279; ) - N[Z * 2 + 1] = 7, Z++, Oe[7]++; - for (; Z <= 287; ) - N[Z * 2 + 1] = 8, Z++, Oe[8]++; - for (pe(N, o + 1, Oe), Z = 0; Z < w; Z++) - $[Z * 2 + 1] = 5, $[Z * 2] = Me(Z, 5); - Q = new V(N, I, s + 1, o, a), ae = new V($, z, 0, w, a), oe = new V(new Array(0), P, 0, p, g); + function Ee() { + var Y, ue, Se, Fe, he, De = new Array(a + 1); + for (Se = 0, Fe = 0; Fe < L - 1; Fe++) + for (G[Fe] = Se, Y = 0; Y < 1 << I[Fe]; Y++) + W[Se++] = Fe; + for (W[Se - 1] = Fe, he = 0, Fe = 0; Fe < 16; Fe++) + for (F[Fe] = he, Y = 0; Y < 1 << B[Fe]; Y++) + U[he++] = Fe; + for (he >>= 7; Fe < A; Fe++) + for (F[Fe] = he << 7, Y = 0; Y < 1 << B[Fe] - 7; Y++) + U[256 + he++] = Fe; + for (ue = 0; ue <= a; ue++) + De[ue] = 0; + for (Y = 0; Y <= 143; ) + N[Y * 2 + 1] = 8, Y++, De[8]++; + for (; Y <= 255; ) + N[Y * 2 + 1] = 9, Y++, De[9]++; + for (; Y <= 279; ) + N[Y * 2 + 1] = 7, Y++, De[7]++; + for (; Y <= 287; ) + N[Y * 2 + 1] = 8, Y++, De[8]++; + for (_e(N, o + 1, De), Y = 0; Y < A; Y++) + R[Y * 2 + 1] = 5, R[Y * 2] = be(Y, 5); + J = new V(N, I, s + 1, o, a), X = new V(R, B, 0, A, a), oe = new V(new Array(0), P, 0, p, g); } - function Fe(Z) { - var ce; - for (ce = 0; ce < o; ce++) - Z.dyn_ltree[ce * 2] = 0; - for (ce = 0; ce < w; ce++) - Z.dyn_dtree[ce * 2] = 0; - for (ce = 0; ce < p; ce++) - Z.bl_tree[ce * 2] = 0; - Z.dyn_ltree[M * 2] = 1, Z.opt_len = Z.static_len = 0, Z.last_lit = Z.matches = 0; + function Be(Y) { + var ue; + for (ue = 0; ue < o; ue++) + Y.dyn_ltree[ue * 2] = 0; + for (ue = 0; ue < A; ue++) + Y.dyn_dtree[ue * 2] = 0; + for (ue = 0; ue < p; ue++) + Y.bl_tree[ue * 2] = 0; + Y.dyn_ltree[M * 2] = 1, Y.opt_len = Y.static_len = 0, Y.last_lit = Y.matches = 0; } - function Ue(Z) { - Z.bi_valid > 8 ? ne(Z, Z.bi_buf) : Z.bi_valid > 0 && (Z.pending_buf[Z.pending++] = Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0; + function Ne(Y) { + Y.bi_valid > 8 ? se(Y, Y.bi_buf) : Y.bi_valid > 0 && (Y.pending_buf[Y.pending++] = Y.bi_buf), Y.bi_buf = 0, Y.bi_valid = 0; } - function Ne(Z, ce, Ae, ke) { - Ue(Z), ke && (ne(Z, Ae), ne(Z, ~Ae)), n.arraySet(Z.pending_buf, Z.window, ce, Ae, Z.pending), Z.pending += Ae; + function Ge(Y, ue, Se, Fe) { + Ne(Y), Fe && (se(Y, Se), se(Y, ~Se)), n.arraySet(Y.pending_buf, Y.window, ue, Se, Y.pending), Y.pending += Se; } - function Be(Z, ce, Ae, ke) { - var he = ce * 2, Oe = Ae * 2; - return Z[he] < Z[Oe] || Z[he] === Z[Oe] && ke[ce] <= ke[Ae]; + function ke(Y, ue, Se, Fe) { + var he = ue * 2, De = Se * 2; + return Y[he] < Y[De] || Y[he] === Y[De] && Fe[ue] <= Fe[Se]; } - function ue(Z, ce, Ae) { - for (var ke = Z.heap[Ae], he = Ae << 1; he <= Z.heap_len && (he < Z.heap_len && Be(ce, Z.heap[he + 1], Z.heap[he], Z.depth) && he++, !Be(ce, ke, Z.heap[he], Z.depth)); ) - Z.heap[Ae] = Z.heap[he], Ae = he, he <<= 1; - Z.heap[Ae] = ke; + function pe(Y, ue, Se) { + for (var Fe = Y.heap[Se], he = Se << 1; he <= Y.heap_len && (he < Y.heap_len && ke(ue, Y.heap[he + 1], Y.heap[he], Y.depth) && he++, !ke(ue, Fe, Y.heap[he], Y.depth)); ) + Y.heap[Se] = Y.heap[he], Se = he, he <<= 1; + Y.heap[Se] = Fe; } - function ye(Z, ce, Ae) { - var ke, he, Oe = 0, j, $e; - if (Z.last_lit !== 0) + function de(Y, ue, Se) { + var Fe, he, De = 0, K, ze; + if (Y.last_lit !== 0) do - ke = Z.pending_buf[Z.d_buf + Oe * 2] << 8 | Z.pending_buf[Z.d_buf + Oe * 2 + 1], he = Z.pending_buf[Z.l_buf + Oe], Oe++, ke === 0 ? Ce(Z, he, ce) : (j = G[he], Ce(Z, j + s + 1, ce), $e = I[j], $e !== 0 && (he -= H[j], fe(Z, he, $e)), ke--, j = me(ke), Ce(Z, j, Ae), $e = z[j], $e !== 0 && (ke -= U[j], fe(Z, ke, $e))); - while (Oe < Z.last_lit); - Ce(Z, M, ce); + Fe = Y.pending_buf[Y.d_buf + De * 2] << 8 | Y.pending_buf[Y.d_buf + De * 2 + 1], he = Y.pending_buf[Y.l_buf + De], De++, Fe === 0 ? Ce(Y, he, ue) : (K = W[he], Ce(Y, K + s + 1, ue), ze = I[K], ze !== 0 && (he -= G[K], le(Y, he, ze)), Fe--, K = ve(Fe), Ce(Y, K, Se), ze = B[K], ze !== 0 && (Fe -= F[K], le(Y, Fe, ze))); + while (De < Y.last_lit); + Ce(Y, M, ue); } - function ge(Z, ce) { - var Ae = ce.dyn_tree, ke = ce.stat_desc.static_tree, he = ce.stat_desc.has_stree, Oe = ce.stat_desc.elems, j, $e, Ve = -1, R; - for (Z.heap_len = 0, Z.heap_max = v, j = 0; j < Oe; j++) - Ae[j * 2] !== 0 ? (Z.heap[++Z.heap_len] = Ve = j, Z.depth[j] = 0) : Ae[j * 2 + 1] = 0; - for (; Z.heap_len < 2; ) - R = Z.heap[++Z.heap_len] = Ve < 2 ? ++Ve : 0, Ae[R * 2] = 1, Z.depth[R] = 0, Z.opt_len--, he && (Z.static_len -= ke[R * 2 + 1]); - for (ce.max_code = Ve, j = Z.heap_len >> 1; j >= 1; j--) - ue(Z, Ae, j); - R = Oe; + function ce(Y, ue) { + var Se = ue.dyn_tree, Fe = ue.stat_desc.static_tree, he = ue.stat_desc.has_stree, De = ue.stat_desc.elems, K, ze, Ve = -1, $; + for (Y.heap_len = 0, Y.heap_max = v, K = 0; K < De; K++) + Se[K * 2] !== 0 ? (Y.heap[++Y.heap_len] = Ve = K, Y.depth[K] = 0) : Se[K * 2 + 1] = 0; + for (; Y.heap_len < 2; ) + $ = Y.heap[++Y.heap_len] = Ve < 2 ? ++Ve : 0, Se[$ * 2] = 1, Y.depth[$] = 0, Y.opt_len--, he && (Y.static_len -= Fe[$ * 2 + 1]); + for (ue.max_code = Ve, K = Y.heap_len >> 1; K >= 1; K--) + pe(Y, Se, K); + $ = De; do - j = Z.heap[ + K = Y.heap[ 1 /*SMALLEST*/ - ], Z.heap[ + ], Y.heap[ 1 /*SMALLEST*/ - ] = Z.heap[Z.heap_len--], ue( - Z, - Ae, + ] = Y.heap[Y.heap_len--], pe( + Y, + Se, 1 /*SMALLEST*/ - ), $e = Z.heap[ + ), ze = Y.heap[ 1 /*SMALLEST*/ - ], Z.heap[--Z.heap_max] = j, Z.heap[--Z.heap_max] = $e, Ae[R * 2] = Ae[j * 2] + Ae[$e * 2], Z.depth[R] = (Z.depth[j] >= Z.depth[$e] ? Z.depth[j] : Z.depth[$e]) + 1, Ae[j * 2 + 1] = Ae[$e * 2 + 1] = R, Z.heap[ + ], Y.heap[--Y.heap_max] = K, Y.heap[--Y.heap_max] = ze, Se[$ * 2] = Se[K * 2] + Se[ze * 2], Y.depth[$] = (Y.depth[K] >= Y.depth[ze] ? Y.depth[K] : Y.depth[ze]) + 1, Se[K * 2 + 1] = Se[ze * 2 + 1] = $, Y.heap[ 1 /*SMALLEST*/ - ] = R++, ue( - Z, - Ae, + ] = $++, pe( + Y, + Se, 1 /*SMALLEST*/ ); - while (Z.heap_len >= 2); - Z.heap[--Z.heap_max] = Z.heap[ + while (Y.heap_len >= 2); + Y.heap[--Y.heap_max] = Y.heap[ 1 /*SMALLEST*/ - ], se(Z, ce), pe(Ae, Ve, Z.bl_count); + ], ae(Y, ue), _e(Se, Ve, Y.bl_count); } - function Se(Z, ce, Ae) { - var ke, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, R = 4; - for (j === 0 && (Ve = 138, R = 3), ce[(Ae + 1) * 2 + 1] = 65535, ke = 0; ke <= Ae; ke++) - Oe = j, j = ce[(ke + 1) * 2 + 1], !(++$e < Ve && Oe === j) && ($e < R ? Z.bl_tree[Oe * 2] += $e : Oe !== 0 ? (Oe !== he && Z.bl_tree[Oe * 2]++, Z.bl_tree[L * 2]++) : $e <= 10 ? Z.bl_tree[T * 2]++ : Z.bl_tree[D * 2]++, $e = 0, he = Oe, j === 0 ? (Ve = 138, R = 3) : Oe === j ? (Ve = 6, R = 3) : (Ve = 7, R = 4)); + function Ae(Y, ue, Se) { + var Fe, he = -1, De, K = ue[0 * 2 + 1], ze = 0, Ve = 7, $ = 4; + for (K === 0 && (Ve = 138, $ = 3), ue[(Se + 1) * 2 + 1] = 65535, Fe = 0; Fe <= Se; Fe++) + De = K, K = ue[(Fe + 1) * 2 + 1], !(++ze < Ve && De === K) && (ze < $ ? Y.bl_tree[De * 2] += ze : De !== 0 ? (De !== he && Y.bl_tree[De * 2]++, Y.bl_tree[C * 2]++) : ze <= 10 ? Y.bl_tree[T * 2]++ : Y.bl_tree[D * 2]++, ze = 0, he = De, K === 0 ? (Ve = 138, $ = 3) : De === K ? (Ve = 6, $ = 3) : (Ve = 7, $ = 4)); } - function ze(Z, ce, Ae) { - var ke, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, R = 4; - for (j === 0 && (Ve = 138, R = 3), ke = 0; ke <= Ae; ke++) - if (Oe = j, j = ce[(ke + 1) * 2 + 1], !(++$e < Ve && Oe === j)) { - if ($e < R) + function Oe(Y, ue, Se) { + var Fe, he = -1, De, K = ue[0 * 2 + 1], ze = 0, Ve = 7, $ = 4; + for (K === 0 && (Ve = 138, $ = 3), Fe = 0; Fe <= Se; Fe++) + if (De = K, K = ue[(Fe + 1) * 2 + 1], !(++ze < Ve && De === K)) { + if (ze < $) do - Ce(Z, Oe, Z.bl_tree); - while (--$e !== 0); + Ce(Y, De, Y.bl_tree); + while (--ze !== 0); else - Oe !== 0 ? (Oe !== he && (Ce(Z, Oe, Z.bl_tree), $e--), Ce(Z, L, Z.bl_tree), fe(Z, $e - 3, 2)) : $e <= 10 ? (Ce(Z, T, Z.bl_tree), fe(Z, $e - 3, 3)) : (Ce(Z, D, Z.bl_tree), fe(Z, $e - 11, 7)); - $e = 0, he = Oe, j === 0 ? (Ve = 138, R = 3) : Oe === j ? (Ve = 6, R = 3) : (Ve = 7, R = 4); + De !== 0 ? (De !== he && (Ce(Y, De, Y.bl_tree), ze--), Ce(Y, C, Y.bl_tree), le(Y, ze - 3, 2)) : ze <= 10 ? (Ce(Y, T, Y.bl_tree), le(Y, ze - 3, 3)) : (Ce(Y, D, Y.bl_tree), le(Y, ze - 11, 7)); + ze = 0, he = De, K === 0 ? (Ve = 138, $ = 3) : De === K ? (Ve = 6, $ = 3) : (Ve = 7, $ = 4); } } - function He(Z) { - var ce; - for (Se(Z, Z.dyn_ltree, Z.l_desc.max_code), Se(Z, Z.dyn_dtree, Z.d_desc.max_code), ge(Z, Z.bl_desc), ce = p - 1; ce >= 3 && Z.bl_tree[B[ce] * 2 + 1] === 0; ce--) + function We(Y) { + var ue; + for (Ae(Y, Y.dyn_ltree, Y.l_desc.max_code), Ae(Y, Y.dyn_dtree, Y.d_desc.max_code), ce(Y, Y.bl_desc), ue = p - 1; ue >= 3 && Y.bl_tree[z[ue] * 2 + 1] === 0; ue--) ; - return Z.opt_len += 3 * (ce + 1) + 5 + 5 + 4, ce; + return Y.opt_len += 3 * (ue + 1) + 5 + 5 + 4, ue; } - function We(Z, ce, Ae, ke) { + function Ue(Y, ue, Se, Fe) { var he; - for (fe(Z, ce - 257, 5), fe(Z, Ae - 1, 5), fe(Z, ke - 4, 4), he = 0; he < ke; he++) - fe(Z, Z.bl_tree[B[he] * 2 + 1], 3); - ze(Z, Z.dyn_ltree, ce - 1), ze(Z, Z.dyn_dtree, Ae - 1); + for (le(Y, ue - 257, 5), le(Y, Se - 1, 5), le(Y, Fe - 4, 4), he = 0; he < Fe; he++) + le(Y, Y.bl_tree[z[he] * 2 + 1], 3); + Oe(Y, Y.dyn_ltree, ue - 1), Oe(Y, Y.dyn_dtree, Se - 1); } - function Y(Z) { - var ce = 4093624447, Ae; - for (Ae = 0; Ae <= 31; Ae++, ce >>>= 1) - if (ce & 1 && Z.dyn_ltree[Ae * 2] !== 0) + function Z(Y) { + var ue = 4093624447, Se; + for (Se = 0; Se <= 31; Se++, ue >>>= 1) + if (ue & 1 && Y.dyn_ltree[Se * 2] !== 0) return u; - if (Z.dyn_ltree[18] !== 0 || Z.dyn_ltree[20] !== 0 || Z.dyn_ltree[26] !== 0) - return y; - for (Ae = 32; Ae < s; Ae++) - if (Z.dyn_ltree[Ae * 2] !== 0) - return y; + if (Y.dyn_ltree[18] !== 0 || Y.dyn_ltree[20] !== 0 || Y.dyn_ltree[26] !== 0) + return b; + for (Se = 32; Se < s; Se++) + if (Y.dyn_ltree[Se * 2] !== 0) + return b; return u; } - var K = !1; - function ee(Z) { - K || (we(), K = !0), Z.l_desc = new q(Z.dyn_ltree, Q), Z.d_desc = new q(Z.dyn_dtree, ae), Z.bl_desc = new q(Z.bl_tree, oe), Z.bi_buf = 0, Z.bi_valid = 0, Fe(Z); + var j = !1; + function ee(Y) { + j || (Ee(), j = !0), Y.l_desc = new te(Y.dyn_ltree, J), Y.d_desc = new te(Y.dyn_dtree, X), Y.bl_desc = new te(Y.bl_tree, oe), Y.bi_buf = 0, Y.bi_valid = 0, Be(Y); } - function de(Z, ce, Ae, ke) { - fe(Z, (E << 1) + (ke ? 1 : 0), 3), Ne(Z, ce, Ae, !0); + function ge(Y, ue, Se, Fe) { + le(Y, (E << 1) + (Fe ? 1 : 0), 3), Ge(Y, ue, Se, !0); } - function ve(Z) { - fe(Z, c << 1, 3), Ce(Z, M, N), Te(Z); + function ye(Y) { + le(Y, c << 1, 3), Ce(Y, M, N), Le(Y); } - function Ie(Z, ce, Ae, ke) { - var he, Oe, j = 0; - Z.level > 0 ? (Z.strm.data_type === h && (Z.strm.data_type = Y(Z)), ge(Z, Z.l_desc), ge(Z, Z.d_desc), j = He(Z), he = Z.opt_len + 3 + 7 >>> 3, Oe = Z.static_len + 3 + 7 >>> 3, Oe <= he && (he = Oe)) : he = Oe = Ae + 5, Ae + 4 <= he && ce !== -1 ? de(Z, ce, Ae, ke) : Z.strategy === f || Oe === he ? (fe(Z, (c << 1) + (ke ? 1 : 0), 3), ye(Z, N, $)) : (fe(Z, (C << 1) + (ke ? 1 : 0), 3), We(Z, Z.l_desc.max_code + 1, Z.d_desc.max_code + 1, j + 1), ye(Z, Z.dyn_ltree, Z.dyn_dtree)), Fe(Z), ke && Ue(Z); + function $e(Y, ue, Se, Fe) { + var he, De, K = 0; + Y.level > 0 ? (Y.strm.data_type === h && (Y.strm.data_type = Z(Y)), ce(Y, Y.l_desc), ce(Y, Y.d_desc), K = We(Y), he = Y.opt_len + 3 + 7 >>> 3, De = Y.static_len + 3 + 7 >>> 3, De <= he && (he = De)) : he = De = Se + 5, Se + 4 <= he && ue !== -1 ? ge(Y, ue, Se, Fe) : Y.strategy === f || De === he ? (le(Y, (c << 1) + (Fe ? 1 : 0), 3), de(Y, N, R)) : (le(Y, (S << 1) + (Fe ? 1 : 0), 3), Ue(Y, Y.l_desc.max_code + 1, Y.d_desc.max_code + 1, K + 1), de(Y, Y.dyn_ltree, Y.dyn_dtree)), Be(Y), Fe && Ne(Y); } - function Re(Z, ce, Ae) { - return Z.pending_buf[Z.d_buf + Z.last_lit * 2] = ce >>> 8 & 255, Z.pending_buf[Z.d_buf + Z.last_lit * 2 + 1] = ce & 255, Z.pending_buf[Z.l_buf + Z.last_lit] = Ae & 255, Z.last_lit++, ce === 0 ? Z.dyn_ltree[Ae * 2]++ : (Z.matches++, ce--, Z.dyn_ltree[(G[Ae] + s + 1) * 2]++, Z.dyn_dtree[me(ce) * 2]++), Z.last_lit === Z.lit_bufsize - 1; + function Re(Y, ue, Se) { + return Y.pending_buf[Y.d_buf + Y.last_lit * 2] = ue >>> 8 & 255, Y.pending_buf[Y.d_buf + Y.last_lit * 2 + 1] = ue & 255, Y.pending_buf[Y.l_buf + Y.last_lit] = Se & 255, Y.last_lit++, ue === 0 ? Y.dyn_ltree[Se * 2]++ : (Y.matches++, ue--, Y.dyn_ltree[(W[Se] + s + 1) * 2]++, Y.dyn_dtree[ve(ue) * 2]++), Y.last_lit === Y.lit_bufsize - 1; } - e._tr_init = ee, e._tr_stored_block = de, e._tr_flush_block = Ie, e._tr_tally = Re, e._tr_align = ve; + e._tr_init = ee, e._tr_stored_block = ge, e._tr_flush_block = $e, e._tr_tally = Re, e._tr_align = ye; } ), /***/ @@ -22485,11 +22485,11 @@ ATOM`, g); !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js ***! \********************************************************************/ /***/ - (r) => { + (t) => { function e() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; } - r.exports = e; + t.exports = e; } ), /***/ @@ -22500,13 +22500,13 @@ ATOM`, g); /***/ () => { $3Dmol.workerString = (function() { - self.onmessage = function(r) { - var e = r.data, t = e.type; - if (t < 0) + self.onmessage = function(t) { + var e = t.data, r = e.type; + if (r < 0) self.atomData = e.atoms, self.volume = e.volume, self.ps = new ProteinSurface(); else { var n = self.ps; - n.initparm(e.expandedExtent, t != 1, self.volume), n.fillvoxels(self.atomData, e.extendedAtoms), n.buildboundary(), (t === 4 || t === 2) && (n.fastdistancemap(), n.boundingatom(!1), n.fillvoxelswaals(self.atomData, e.extendedAtoms)), n.marchingcube(t); + n.initparm(e.expandedExtent, r != 1, self.volume), n.fillvoxels(self.atomData, e.extendedAtoms), n.buildboundary(), (r === 4 || r === 2) && (n.fastdistancemap(), n.boundingatom(!1), n.fillvoxelswaals(self.atomData, e.extendedAtoms)), n.marchingcube(r); var f = n.getFacesAndVertices(e.atomsToShow); self.postMessage(f); } @@ -22529,8 +22529,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; !*** ./src/exporter.js ***! \*************************/ /***/ - (r) => { - typeof r.exports == "object" && (r.exports = window.$3Dmol); + (t) => { + typeof t.exports == "object" && (t.exports = window.$3Dmol); } ), /***/ @@ -22539,120 +22539,120 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; !*** ./src/vendor/mmtf.js ***! \****************************/ /***/ - function(r, e) { - (function(t, n) { + function(t, e) { + (function(r, n) { n(e); - })(this, function(t) { - function n(Y, K, ee) { - for (var de = (Y.byteLength, 0), ve = ee.length; ve > de; de++) { - var Ie = ee.charCodeAt(de); - if (128 > Ie) - Y.setUint8(K++, Ie >>> 0 & 127 | 0); - else if (2048 > Ie) - Y.setUint8(K++, Ie >>> 6 & 31 | 192), Y.setUint8(K++, Ie >>> 0 & 63 | 128); - else if (65536 > Ie) - Y.setUint8(K++, Ie >>> 12 & 15 | 224), Y.setUint8(K++, Ie >>> 6 & 63 | 128), Y.setUint8(K++, Ie >>> 0 & 63 | 128); + })(this, function(r) { + function n(Z, j, ee) { + for (var ge = (Z.byteLength, 0), ye = ee.length; ye > ge; ge++) { + var $e = ee.charCodeAt(ge); + if (128 > $e) + Z.setUint8(j++, $e >>> 0 & 127 | 0); + else if (2048 > $e) + Z.setUint8(j++, $e >>> 6 & 31 | 192), Z.setUint8(j++, $e >>> 0 & 63 | 128); + else if (65536 > $e) + Z.setUint8(j++, $e >>> 12 & 15 | 224), Z.setUint8(j++, $e >>> 6 & 63 | 128), Z.setUint8(j++, $e >>> 0 & 63 | 128); else { - if (!(1114112 > Ie)) - throw new Error("bad codepoint " + Ie); - Y.setUint8(K++, Ie >>> 18 & 7 | 240), Y.setUint8(K++, Ie >>> 12 & 63 | 128), Y.setUint8(K++, Ie >>> 6 & 63 | 128), Y.setUint8(K++, Ie >>> 0 & 63 | 128); + if (!(1114112 > $e)) + throw new Error("bad codepoint " + $e); + Z.setUint8(j++, $e >>> 18 & 7 | 240), Z.setUint8(j++, $e >>> 12 & 63 | 128), Z.setUint8(j++, $e >>> 6 & 63 | 128), Z.setUint8(j++, $e >>> 0 & 63 | 128); } } } - function f(Y) { - for (var K = 0, ee = 0, de = Y.length; de > ee; ee++) { - var ve = Y.charCodeAt(ee); - if (128 > ve) - K += 1; - else if (2048 > ve) - K += 2; - else if (65536 > ve) - K += 3; + function f(Z) { + for (var j = 0, ee = 0, ge = Z.length; ge > ee; ee++) { + var ye = Z.charCodeAt(ee); + if (128 > ye) + j += 1; + else if (2048 > ye) + j += 2; + else if (65536 > ye) + j += 3; else { - if (!(1114112 > ve)) - throw new Error("bad codepoint " + ve); - K += 4; + if (!(1114112 > ye)) + throw new Error("bad codepoint " + ye); + j += 4; } } - return K; - } - function u(Y, K, ee) { - var de = typeof Y; - if (de === "string") { - var ve = f(Y); - if (32 > ve) - return K.setUint8(ee, 160 | ve), n(K, ee + 1, Y), 1 + ve; - if (256 > ve) - return K.setUint8(ee, 217), K.setUint8(ee + 1, ve), n(K, ee + 2, Y), 2 + ve; - if (65536 > ve) - return K.setUint8(ee, 218), K.setUint16(ee + 1, ve), n(K, ee + 3, Y), 3 + ve; - if (4294967296 > ve) - return K.setUint8(ee, 219), K.setUint32(ee + 1, ve), n(K, ee + 5, Y), 5 + ve; - } - if (Y instanceof Uint8Array) { - var ve = Y.byteLength, Ie = new Uint8Array(K.buffer); - if (256 > ve) - return K.setUint8(ee, 196), K.setUint8(ee + 1, ve), Ie.set(Y, ee + 2), 2 + ve; - if (65536 > ve) - return K.setUint8(ee, 197), K.setUint16(ee + 1, ve), Ie.set(Y, ee + 3), 3 + ve; - if (4294967296 > ve) - return K.setUint8(ee, 198), K.setUint32(ee + 1, ve), Ie.set(Y, ee + 5), 5 + ve; - } - if (de === "number") { - if (!isFinite(Y)) - throw new Error("Number not finite: " + Y); - if (Math.floor(Y) !== Y) - return K.setUint8(ee, 203), K.setFloat64(ee + 1, Y), 9; - if (Y >= 0) { - if (128 > Y) - return K.setUint8(ee, Y), 1; - if (256 > Y) - return K.setUint8(ee, 204), K.setUint8(ee + 1, Y), 2; - if (65536 > Y) - return K.setUint8(ee, 205), K.setUint16(ee + 1, Y), 3; - if (4294967296 > Y) - return K.setUint8(ee, 206), K.setUint32(ee + 1, Y), 5; - throw new Error("Number too big 0x" + Y.toString(16)); + return j; + } + function u(Z, j, ee) { + var ge = typeof Z; + if (ge === "string") { + var ye = f(Z); + if (32 > ye) + return j.setUint8(ee, 160 | ye), n(j, ee + 1, Z), 1 + ye; + if (256 > ye) + return j.setUint8(ee, 217), j.setUint8(ee + 1, ye), n(j, ee + 2, Z), 2 + ye; + if (65536 > ye) + return j.setUint8(ee, 218), j.setUint16(ee + 1, ye), n(j, ee + 3, Z), 3 + ye; + if (4294967296 > ye) + return j.setUint8(ee, 219), j.setUint32(ee + 1, ye), n(j, ee + 5, Z), 5 + ye; + } + if (Z instanceof Uint8Array) { + var ye = Z.byteLength, $e = new Uint8Array(j.buffer); + if (256 > ye) + return j.setUint8(ee, 196), j.setUint8(ee + 1, ye), $e.set(Z, ee + 2), 2 + ye; + if (65536 > ye) + return j.setUint8(ee, 197), j.setUint16(ee + 1, ye), $e.set(Z, ee + 3), 3 + ye; + if (4294967296 > ye) + return j.setUint8(ee, 198), j.setUint32(ee + 1, ye), $e.set(Z, ee + 5), 5 + ye; + } + if (ge === "number") { + if (!isFinite(Z)) + throw new Error("Number not finite: " + Z); + if (Math.floor(Z) !== Z) + return j.setUint8(ee, 203), j.setFloat64(ee + 1, Z), 9; + if (Z >= 0) { + if (128 > Z) + return j.setUint8(ee, Z), 1; + if (256 > Z) + return j.setUint8(ee, 204), j.setUint8(ee + 1, Z), 2; + if (65536 > Z) + return j.setUint8(ee, 205), j.setUint16(ee + 1, Z), 3; + if (4294967296 > Z) + return j.setUint8(ee, 206), j.setUint32(ee + 1, Z), 5; + throw new Error("Number too big 0x" + Z.toString(16)); } - if (Y >= -32) - return K.setInt8(ee, Y), 1; - if (Y >= -128) - return K.setUint8(ee, 208), K.setInt8(ee + 1, Y), 2; - if (Y >= -32768) - return K.setUint8(ee, 209), K.setInt16(ee + 1, Y), 3; - if (Y >= -2147483648) - return K.setUint8(ee, 210), K.setInt32(ee + 1, Y), 5; - throw new Error("Number too small -0x" + (-Y).toString(16).substr(1)); - } - if (Y === null) - return K.setUint8(ee, 192), 1; - if (de === "boolean") - return K.setUint8(ee, Y ? 195 : 194), 1; - if (de === "object") { - var ve, ce = 0, Re = Array.isArray(Y); + if (Z >= -32) + return j.setInt8(ee, Z), 1; + if (Z >= -128) + return j.setUint8(ee, 208), j.setInt8(ee + 1, Z), 2; + if (Z >= -32768) + return j.setUint8(ee, 209), j.setInt16(ee + 1, Z), 3; + if (Z >= -2147483648) + return j.setUint8(ee, 210), j.setInt32(ee + 1, Z), 5; + throw new Error("Number too small -0x" + (-Z).toString(16).substr(1)); + } + if (Z === null) + return j.setUint8(ee, 192), 1; + if (ge === "boolean") + return j.setUint8(ee, Z ? 195 : 194), 1; + if (ge === "object") { + var ye, ue = 0, Re = Array.isArray(Z); if (Re) - ve = Y.length; + ye = Z.length; else { - var Z = Object.keys(Y); - ve = Z.length; + var Y = Object.keys(Z); + ye = Y.length; } - var ce; - if (16 > ve ? (K.setUint8(ee, ve | (Re ? 144 : 128)), ce = 1) : 65536 > ve ? (K.setUint8(ee, Re ? 220 : 222), K.setUint16(ee + 1, ve), ce = 3) : 4294967296 > ve && (K.setUint8(ee, Re ? 221 : 223), K.setUint32(ee + 1, ve), ce = 5), Re) - for (var Ae = 0; ve > Ae; Ae++) - ce += u(Y[Ae], K, ee + ce); + var ue; + if (16 > ye ? (j.setUint8(ee, ye | (Re ? 144 : 128)), ue = 1) : 65536 > ye ? (j.setUint8(ee, Re ? 220 : 222), j.setUint16(ee + 1, ye), ue = 3) : 4294967296 > ye && (j.setUint8(ee, Re ? 221 : 223), j.setUint32(ee + 1, ye), ue = 5), Re) + for (var Se = 0; ye > Se; Se++) + ue += u(Z[Se], j, ee + ue); else - for (var Ae = 0; ve > Ae; Ae++) { - var ke = Z[Ae]; - ce += u(ke, K, ee + ce), ce += u(Y[ke], K, ee + ce); + for (var Se = 0; ye > Se; Se++) { + var Fe = Y[Se]; + ue += u(Fe, j, ee + ue), ue += u(Z[Fe], j, ee + ue); } - return ce; + return ue; } - throw new Error("Unknown type " + de); + throw new Error("Unknown type " + ge); } - function y(Y) { - var K = typeof Y; - if (K === "string") { - var ee = f(Y); + function b(Z) { + var j = typeof Z; + if (j === "string") { + var ee = f(Z); if (32 > ee) return 1 + ee; if (256 > ee) @@ -22662,8 +22662,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (4294967296 > ee) return 5 + ee; } - if (Y instanceof Uint8Array) { - var ee = Y.byteLength; + if (Z instanceof Uint8Array) { + var ee = Z.byteLength; if (256 > ee) return 2 + ee; if (65536 > ee) @@ -22671,311 +22671,311 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (4294967296 > ee) return 5 + ee; } - if (K === "number") { - if (Math.floor(Y) !== Y) + if (j === "number") { + if (Math.floor(Z) !== Z) return 9; - if (Y >= 0) { - if (128 > Y) + if (Z >= 0) { + if (128 > Z) return 1; - if (256 > Y) + if (256 > Z) return 2; - if (65536 > Y) + if (65536 > Z) return 3; - if (4294967296 > Y) + if (4294967296 > Z) return 5; - throw new Error("Number too big 0x" + Y.toString(16)); + throw new Error("Number too big 0x" + Z.toString(16)); } - if (Y >= -32) + if (Z >= -32) return 1; - if (Y >= -128) + if (Z >= -128) return 2; - if (Y >= -32768) + if (Z >= -32768) return 3; - if (Y >= -2147483648) + if (Z >= -2147483648) return 5; - throw new Error("Number too small -0x" + Y.toString(16).substr(1)); + throw new Error("Number too small -0x" + Z.toString(16).substr(1)); } - if (K === "boolean" || Y === null) + if (j === "boolean" || Z === null) return 1; - if (K === "object") { - var ee, de = 0; - if (Array.isArray(Y)) { - ee = Y.length; - for (var ve = 0; ee > ve; ve++) - de += y(Y[ve]); + if (j === "object") { + var ee, ge = 0; + if (Array.isArray(Z)) { + ee = Z.length; + for (var ye = 0; ee > ye; ye++) + ge += b(Z[ye]); } else { - var Ie = Object.keys(Y); - ee = Ie.length; - for (var ve = 0; ee > ve; ve++) { - var Re = Ie[ve]; - de += y(Re) + y(Y[Re]); + var $e = Object.keys(Z); + ee = $e.length; + for (var ye = 0; ee > ye; ye++) { + var Re = $e[ye]; + ge += b(Re) + b(Z[Re]); } } if (16 > ee) - return 1 + de; + return 1 + ge; if (65536 > ee) - return 3 + de; + return 3 + ge; if (4294967296 > ee) - return 5 + de; + return 5 + ge; throw new Error("Array or object too long 0x" + ee.toString(16)); } - throw new Error("Unknown type " + K); - } - function h(Y) { - var K = new ArrayBuffer(y(Y)), ee = new DataView(K); - return u(Y, ee, 0), new Uint8Array(K); - } - function _(Y, K, ee) { - return K ? new Y(K.buffer, K.byteOffset, K.byteLength / (ee || 1)) : void 0; - } - function E(Y) { - return _(DataView, Y); - } - function c(Y) { - return _(Uint8Array, Y); - } - function C(Y) { - return _(Int8Array, Y); - } - function b(Y) { - return _(Int32Array, Y, 4); - } - function A(Y) { - return _(Float32Array, Y, 4); - } - function S(Y, K) { - var ee = Y.length / 2; - K || (K = new Int16Array(ee)); - for (var de = 0, ve = 0; ee > de; ++de, ve += 2) - K[de] = Y[ve] << 8 ^ Y[ve + 1] << 0; - return K; - } - function s(Y, K) { - var ee = Y.length; - K || (K = new Uint8Array(2 * ee)); - for (var de = E(K), ve = 0; ee > ve; ++ve) - de.setInt16(2 * ve, Y[ve]); - return c(K); - } - function o(Y, K) { - var ee = Y.length / 4; - K || (K = new Int32Array(ee)); - for (var de = 0, ve = 0; ee > de; ++de, ve += 4) - K[de] = Y[ve] << 24 ^ Y[ve + 1] << 16 ^ Y[ve + 2] << 8 ^ Y[ve + 3] << 0; - return K; - } - function w(Y, K) { - var ee = Y.length; - K || (K = new Uint8Array(4 * ee)); - for (var de = E(K), ve = 0; ee > ve; ++ve) - de.setInt32(4 * ve, Y[ve]); - return c(K); - } - function p(Y, K) { - var ee = Y.length; - K || (K = new Float32Array(ee / 4)); - for (var de = E(K), ve = E(Y), Ie = 0, Re = 0, Z = ee / 4; Z > Ie; ++Ie, Re += 4) - de.setFloat32(Re, ve.getFloat32(Re), !0); - return K; - } - function v(Y, K, ee) { - var de = Y.length, ve = 1 / K; - ee || (ee = new Float32Array(de)); - for (var Ie = 0; de > Ie; ++Ie) - ee[Ie] = Y[Ie] * ve; + throw new Error("Unknown type " + j); + } + function h(Z) { + var j = new ArrayBuffer(b(Z)), ee = new DataView(j); + return u(Z, ee, 0), new Uint8Array(j); + } + function _(Z, j, ee) { + return j ? new Z(j.buffer, j.byteOffset, j.byteLength / (ee || 1)) : void 0; + } + function E(Z) { + return _(DataView, Z); + } + function c(Z) { + return _(Uint8Array, Z); + } + function S(Z) { + return _(Int8Array, Z); + } + function y(Z) { + return _(Int32Array, Z, 4); + } + function w(Z) { + return _(Float32Array, Z, 4); + } + function L(Z, j) { + var ee = Z.length / 2; + j || (j = new Int16Array(ee)); + for (var ge = 0, ye = 0; ee > ge; ++ge, ye += 2) + j[ge] = Z[ye] << 8 ^ Z[ye + 1] << 0; + return j; + } + function s(Z, j) { + var ee = Z.length; + j || (j = new Uint8Array(2 * ee)); + for (var ge = E(j), ye = 0; ee > ye; ++ye) + ge.setInt16(2 * ye, Z[ye]); + return c(j); + } + function o(Z, j) { + var ee = Z.length / 4; + j || (j = new Int32Array(ee)); + for (var ge = 0, ye = 0; ee > ge; ++ge, ye += 4) + j[ge] = Z[ye] << 24 ^ Z[ye + 1] << 16 ^ Z[ye + 2] << 8 ^ Z[ye + 3] << 0; + return j; + } + function A(Z, j) { + var ee = Z.length; + j || (j = new Uint8Array(4 * ee)); + for (var ge = E(j), ye = 0; ee > ye; ++ye) + ge.setInt32(4 * ye, Z[ye]); + return c(j); + } + function p(Z, j) { + var ee = Z.length; + j || (j = new Float32Array(ee / 4)); + for (var ge = E(j), ye = E(Z), $e = 0, Re = 0, Y = ee / 4; Y > $e; ++$e, Re += 4) + ge.setFloat32(Re, ye.getFloat32(Re), !0); + return j; + } + function v(Z, j, ee) { + var ge = Z.length, ye = 1 / j; + ee || (ee = new Float32Array(ge)); + for (var $e = 0; ge > $e; ++$e) + ee[$e] = Z[$e] * ye; return ee; } - function a(Y, K, ee) { - var de = Y.length; - ee || (ee = new Int32Array(de)); - for (var ve = 0; de > ve; ++ve) - ee[ve] = Math.round(Y[ve] * K); + function a(Z, j, ee) { + var ge = Z.length; + ee || (ee = new Int32Array(ge)); + for (var ye = 0; ge > ye; ++ye) + ee[ye] = Math.round(Z[ye] * j); return ee; } - function l(Y, K) { - var ee, de; - if (!K) { - var ve = 0; - for (ee = 0, de = Y.length; de > ee; ee += 2) - ve += Y[ee + 1]; - K = new Y.constructor(ve); - } - var Ie = 0; - for (ee = 0, de = Y.length; de > ee; ee += 2) - for (var Re = Y[ee], Z = Y[ee + 1], ce = 0; Z > ce; ++ce) - K[Ie] = Re, ++Ie; - return K; - } - function g(Y) { - if (Y.length === 0) + function l(Z, j) { + var ee, ge; + if (!j) { + var ye = 0; + for (ee = 0, ge = Z.length; ge > ee; ee += 2) + ye += Z[ee + 1]; + j = new Z.constructor(ye); + } + var $e = 0; + for (ee = 0, ge = Z.length; ge > ee; ee += 2) + for (var Re = Z[ee], Y = Z[ee + 1], ue = 0; Y > ue; ++ue) + j[$e] = Re, ++$e; + return j; + } + function g(Z) { + if (Z.length === 0) return new Int32Array(); - var K, ee, de = 2; - for (K = 1, ee = Y.length; ee > K; ++K) - Y[K - 1] !== Y[K] && (de += 2); - var ve = new Int32Array(de), Ie = 0, Re = 1; - for (K = 1, ee = Y.length; ee > K; ++K) - Y[K - 1] !== Y[K] ? (ve[Ie] = Y[K - 1], ve[Ie + 1] = Re, Re = 1, Ie += 2) : ++Re; - return ve[Ie] = Y[Y.length - 1], ve[Ie + 1] = Re, ve; - } - function M(Y, K) { - var ee = Y.length; - K || (K = new Y.constructor(ee)), ee && (K[0] = Y[0]); - for (var de = 1; ee > de; ++de) - K[de] = Y[de] + K[de - 1]; - return K; - } - function L(Y, K) { - var ee = Y.length; - K || (K = new Y.constructor(ee)), K[0] = Y[0]; - for (var de = 1; ee > de; ++de) - K[de] = Y[de] - Y[de - 1]; - return K; - } - function T(Y, K) { - var ee, de, ve = Y instanceof Int8Array ? 127 : 32767, Ie = -ve - 1, Re = Y.length; - if (!K) { - var Z = 0; + var j, ee, ge = 2; + for (j = 1, ee = Z.length; ee > j; ++j) + Z[j - 1] !== Z[j] && (ge += 2); + var ye = new Int32Array(ge), $e = 0, Re = 1; + for (j = 1, ee = Z.length; ee > j; ++j) + Z[j - 1] !== Z[j] ? (ye[$e] = Z[j - 1], ye[$e + 1] = Re, Re = 1, $e += 2) : ++Re; + return ye[$e] = Z[Z.length - 1], ye[$e + 1] = Re, ye; + } + function M(Z, j) { + var ee = Z.length; + j || (j = new Z.constructor(ee)), ee && (j[0] = Z[0]); + for (var ge = 1; ee > ge; ++ge) + j[ge] = Z[ge] + j[ge - 1]; + return j; + } + function C(Z, j) { + var ee = Z.length; + j || (j = new Z.constructor(ee)), j[0] = Z[0]; + for (var ge = 1; ee > ge; ++ge) + j[ge] = Z[ge] - Z[ge - 1]; + return j; + } + function T(Z, j) { + var ee, ge, ye = Z instanceof Int8Array ? 127 : 32767, $e = -ye - 1, Re = Z.length; + if (!j) { + var Y = 0; for (ee = 0; Re > ee; ++ee) - Y[ee] < ve && Y[ee] > Ie && ++Z; - K = new Int32Array(Z); - } - for (ee = 0, de = 0; Re > ee; ) { - for (var ce = 0; Y[ee] === ve || Y[ee] === Ie; ) - ce += Y[ee], ++ee; - ce += Y[ee], ++ee, K[de] = ce, ++de; - } - return K; - } - function D(Y, K) { - var ee, de = K ? 127 : 32767, ve = -de - 1, Ie = Y.length, Re = 0; - for (ee = 0; Ie > ee; ++ee) { - var Z = Y[ee]; - Z === 0 ? ++Re : Z > 0 ? (Re += Math.ceil(Z / de), Z % de === 0 && (Re += 1)) : (Re += Math.ceil(Z / ve), Z % ve === 0 && (Re += 1)); - } - var ce = K ? new Int8Array(Re) : new Int16Array(Re), Ae = 0; - for (ee = 0; Ie > ee; ++ee) { - var Z = Y[ee]; - if (Z >= 0) - for (; Z >= de; ) - ce[Ae] = de, ++Ae, Z -= de; + Z[ee] < ye && Z[ee] > $e && ++Y; + j = new Int32Array(Y); + } + for (ee = 0, ge = 0; Re > ee; ) { + for (var ue = 0; Z[ee] === ye || Z[ee] === $e; ) + ue += Z[ee], ++ee; + ue += Z[ee], ++ee, j[ge] = ue, ++ge; + } + return j; + } + function D(Z, j) { + var ee, ge = j ? 127 : 32767, ye = -ge - 1, $e = Z.length, Re = 0; + for (ee = 0; $e > ee; ++ee) { + var Y = Z[ee]; + Y === 0 ? ++Re : Y > 0 ? (Re += Math.ceil(Y / ge), Y % ge === 0 && (Re += 1)) : (Re += Math.ceil(Y / ye), Y % ye === 0 && (Re += 1)); + } + var ue = j ? new Int8Array(Re) : new Int16Array(Re), Se = 0; + for (ee = 0; $e > ee; ++ee) { + var Y = Z[ee]; + if (Y >= 0) + for (; Y >= ge; ) + ue[Se] = ge, ++Se, Y -= ge; else - for (; ve >= Z; ) - ce[Ae] = ve, ++Ae, Z -= ve; - ce[Ae] = Z, ++Ae; + for (; ye >= Y; ) + ue[Se] = ye, ++Se, Y -= ye; + ue[Se] = Y, ++Se; } - return ce; + return ue; } - function I(Y, K) { - return M(l(Y), K); + function I(Z, j) { + return M(l(Z), j); } - function z(Y) { - return g(L(Y)); + function B(Z) { + return g(C(Z)); } - function P(Y, K, ee) { - return v(l(Y, b(ee)), K, ee); + function P(Z, j, ee) { + return v(l(Z, y(ee)), j, ee); } - function B(Y, K) { - return g(a(Y, K)); + function z(Z, j) { + return g(a(Z, j)); } - function k(Y, K, ee) { - return v(M(Y, b(ee)), K, ee); + function k(Z, j, ee) { + return v(M(Z, y(ee)), j, ee); } - function N(Y, K, ee) { - return L(a(Y, K), ee); + function N(Z, j, ee) { + return C(a(Z, j), ee); } - function $(Y, K, ee) { - return v(T(Y, b(ee)), K, ee); + function R(Z, j, ee) { + return v(T(Z, y(ee)), j, ee); } - function F(Y, K, ee) { - var de = T(Y, b(ee)); - return k(de, K, A(de)); + function U(Z, j, ee) { + var ge = T(Z, y(ee)); + return k(ge, j, w(ge)); } - function G(Y, K, ee) { - return D(N(Y, K), ee); + function W(Z, j, ee) { + return D(N(Z, j), ee); } - function H(Ie) { - var K = E(Ie), ee = K.getInt32(0), de = K.getInt32(4), ve = Ie.subarray(8, 12), Ie = Ie.subarray(12); - return [ee, Ie, de, ve]; + function G($e) { + var j = E($e), ee = j.getInt32(0), ge = j.getInt32(4), ye = $e.subarray(8, 12), $e = $e.subarray(12); + return [ee, $e, ge, ye]; } - function U(Y, K, ee, de) { - var ve = new ArrayBuffer(12 + de.byteLength), Ie = new Uint8Array(ve), Re = new DataView(ve); - return Re.setInt32(0, Y), Re.setInt32(4, K), ee && Ie.set(ee, 8), Ie.set(de, 12), Ie; + function F(Z, j, ee, ge) { + var ye = new ArrayBuffer(12 + ge.byteLength), $e = new Uint8Array(ye), Re = new DataView(ye); + return Re.setInt32(0, Z), Re.setInt32(4, j), ee && $e.set(ee, 8), $e.set(ge, 12), $e; } - function V(Y) { - var K = Y.length, ee = c(Y); - return U(2, K, void 0, ee); + function V(Z) { + var j = Z.length, ee = c(Z); + return F(2, j, void 0, ee); } - function Q(Y) { - var K = Y.length, ee = w(Y); - return U(4, K, void 0, ee); + function J(Z) { + var j = Z.length, ee = A(Z); + return F(4, j, void 0, ee); } - function ae(Y, K) { - var ee = Y.length / K, de = w([K]), ve = c(Y); - return U(5, ee, de, ve); + function X(Z, j) { + var ee = Z.length / j, ge = A([j]), ye = c(Z); + return F(5, ee, ge, ye); } - function oe(Y) { - var K = Y.length, ee = w(g(Y)); - return U(6, K, void 0, ee); + function oe(Z) { + var j = Z.length, ee = A(g(Z)); + return F(6, j, void 0, ee); } - function q(Y) { - var K = Y.length, ee = w(z(Y)); - return U(8, K, void 0, ee); + function te(Z) { + var j = Z.length, ee = A(B(Z)); + return F(8, j, void 0, ee); } - function me(Y, K) { - var ee = Y.length, de = w([K]), ve = w(B(Y, K)); - return U(9, ee, de, ve); + function ve(Z, j) { + var ee = Z.length, ge = A([j]), ye = A(z(Z, j)); + return F(9, ee, ge, ye); } - function ne(Y, K) { - var ee = Y.length, de = w([K]), ve = s(G(Y, K)); - return U(10, ee, de, ve); + function se(Z, j) { + var ee = Z.length, ge = A([j]), ye = s(W(Z, j)); + return F(10, ee, ge, ye); } - function fe(Y) { - var K = {}; - return ue.forEach(function(ee) { - Y[ee] !== void 0 && (K[ee] = Y[ee]); - }), Y.bondAtomList && (K.bondAtomList = Q(Y.bondAtomList)), Y.bondOrderList && (K.bondOrderList = V(Y.bondOrderList)), K.xCoordList = ne(Y.xCoordList, 1e3), K.yCoordList = ne(Y.yCoordList, 1e3), K.zCoordList = ne(Y.zCoordList, 1e3), Y.bFactorList && (K.bFactorList = ne(Y.bFactorList, 100)), Y.atomIdList && (K.atomIdList = q(Y.atomIdList)), Y.altLocList && (K.altLocList = oe(Y.altLocList)), Y.occupancyList && (K.occupancyList = me(Y.occupancyList, 100)), K.groupIdList = q(Y.groupIdList), K.groupTypeList = Q(Y.groupTypeList), Y.secStructList && (K.secStructList = V(Y.secStructList)), Y.insCodeList && (K.insCodeList = oe(Y.insCodeList)), Y.sequenceIndexList && (K.sequenceIndexList = q(Y.sequenceIndexList)), K.chainIdList = ae(Y.chainIdList, 4), Y.chainNameList && (K.chainNameList = ae(Y.chainNameList, 4)), K; + function le(Z) { + var j = {}; + return pe.forEach(function(ee) { + Z[ee] !== void 0 && (j[ee] = Z[ee]); + }), Z.bondAtomList && (j.bondAtomList = J(Z.bondAtomList)), Z.bondOrderList && (j.bondOrderList = V(Z.bondOrderList)), j.xCoordList = se(Z.xCoordList, 1e3), j.yCoordList = se(Z.yCoordList, 1e3), j.zCoordList = se(Z.zCoordList, 1e3), Z.bFactorList && (j.bFactorList = se(Z.bFactorList, 100)), Z.atomIdList && (j.atomIdList = te(Z.atomIdList)), Z.altLocList && (j.altLocList = oe(Z.altLocList)), Z.occupancyList && (j.occupancyList = ve(Z.occupancyList, 100)), j.groupIdList = te(Z.groupIdList), j.groupTypeList = J(Z.groupTypeList), Z.secStructList && (j.secStructList = V(Z.secStructList)), Z.insCodeList && (j.insCodeList = oe(Z.insCodeList)), Z.sequenceIndexList && (j.sequenceIndexList = te(Z.sequenceIndexList)), j.chainIdList = X(Z.chainIdList, 4), Z.chainNameList && (j.chainNameList = X(Z.chainNameList, 4)), j; } - function Ce(Y) { - function K(ce) { - for (var Ae = {}, ke = 0; ce > ke; ke++) { - var he = Ie(); - Ae[he] = Ie(); + function Ce(Z) { + function j(ue) { + for (var Se = {}, Fe = 0; ue > Fe; Fe++) { + var he = $e(); + Se[he] = $e(); } - return Ae; - } - function ee(ce) { - var Ae = Y.subarray(Re, Re + ce); - return Re += ce, Ae; - } - function de(ce) { - var Ae = Y.subarray(Re, Re + ce); - Re += ce; - var ke = 65535; - if (ce > ke) { - for (var he = [], Oe = 0; Oe < Ae.length; Oe += ke) - he.push(String.fromCharCode.apply(null, Ae.subarray(Oe, Oe + ke))); + return Se; + } + function ee(ue) { + var Se = Z.subarray(Re, Re + ue); + return Re += ue, Se; + } + function ge(ue) { + var Se = Z.subarray(Re, Re + ue); + Re += ue; + var Fe = 65535; + if (ue > Fe) { + for (var he = [], De = 0; De < Se.length; De += Fe) + he.push(String.fromCharCode.apply(null, Se.subarray(De, De + Fe))); return he.join(""); } - return String.fromCharCode.apply(null, Ae); - } - function ve(ce) { - for (var Ae = new Array(ce), ke = 0; ce > ke; ke++) - Ae[ke] = Ie(); - return Ae; - } - function Ie() { - var ce, Ae, ke = Y[Re]; - if (!(128 & ke)) - return Re++, ke; - if ((240 & ke) === 128) - return Ae = 15 & ke, Re++, K(Ae); - if ((240 & ke) === 144) - return Ae = 15 & ke, Re++, ve(Ae); - if ((224 & ke) === 160) - return Ae = 31 & ke, Re++, de(Ae); - if ((224 & ke) === 224) - return ce = Z.getInt8(Re), Re++, ce; - switch (ke) { + return String.fromCharCode.apply(null, Se); + } + function ye(ue) { + for (var Se = new Array(ue), Fe = 0; ue > Fe; Fe++) + Se[Fe] = $e(); + return Se; + } + function $e() { + var ue, Se, Fe = Z[Re]; + if (!(128 & Fe)) + return Re++, Fe; + if ((240 & Fe) === 128) + return Se = 15 & Fe, Re++, j(Se); + if ((240 & Fe) === 144) + return Se = 15 & Fe, Re++, ye(Se); + if ((224 & Fe) === 160) + return Se = 31 & Fe, Re++, ge(Se); + if ((224 & Fe) === 224) + return ue = Y.getInt8(Re), Re++, ue; + switch (Fe) { case 192: return Re++, null; case 194: @@ -22983,171 +22983,171 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 195: return Re++, !0; case 196: - return Ae = Z.getUint8(Re + 1), Re += 2, ee(Ae); + return Se = Y.getUint8(Re + 1), Re += 2, ee(Se); case 197: - return Ae = Z.getUint16(Re + 1), Re += 3, ee(Ae); + return Se = Y.getUint16(Re + 1), Re += 3, ee(Se); case 198: - return Ae = Z.getUint32(Re + 1), Re += 5, ee(Ae); + return Se = Y.getUint32(Re + 1), Re += 5, ee(Se); case 202: - return ce = Z.getFloat32(Re + 1), Re += 5, ce; + return ue = Y.getFloat32(Re + 1), Re += 5, ue; case 203: - return ce = Z.getFloat64(Re + 1), Re += 9, ce; + return ue = Y.getFloat64(Re + 1), Re += 9, ue; case 204: - return ce = Y[Re + 1], Re += 2, ce; + return ue = Z[Re + 1], Re += 2, ue; case 205: - return ce = Z.getUint16(Re + 1), Re += 3, ce; + return ue = Y.getUint16(Re + 1), Re += 3, ue; case 206: - return ce = Z.getUint32(Re + 1), Re += 5, ce; + return ue = Y.getUint32(Re + 1), Re += 5, ue; case 208: - return ce = Z.getInt8(Re + 1), Re += 2, ce; + return ue = Y.getInt8(Re + 1), Re += 2, ue; case 209: - return ce = Z.getInt16(Re + 1), Re += 3, ce; + return ue = Y.getInt16(Re + 1), Re += 3, ue; case 210: - return ce = Z.getInt32(Re + 1), Re += 5, ce; + return ue = Y.getInt32(Re + 1), Re += 5, ue; case 217: - return Ae = Z.getUint8(Re + 1), Re += 2, de(Ae); + return Se = Y.getUint8(Re + 1), Re += 2, ge(Se); case 218: - return Ae = Z.getUint16(Re + 1), Re += 3, de(Ae); + return Se = Y.getUint16(Re + 1), Re += 3, ge(Se); case 219: - return Ae = Z.getUint32(Re + 1), Re += 5, de(Ae); + return Se = Y.getUint32(Re + 1), Re += 5, ge(Se); case 220: - return Ae = Z.getUint16(Re + 1), Re += 3, ve(Ae); + return Se = Y.getUint16(Re + 1), Re += 3, ye(Se); case 221: - return Ae = Z.getUint32(Re + 1), Re += 5, ve(Ae); + return Se = Y.getUint32(Re + 1), Re += 5, ye(Se); case 222: - return Ae = Z.getUint16(Re + 1), Re += 3, K(Ae); + return Se = Y.getUint16(Re + 1), Re += 3, j(Se); case 223: - return Ae = Z.getUint32(Re + 1), Re += 5, K(Ae); + return Se = Y.getUint32(Re + 1), Re += 5, j(Se); } - throw new Error("Unknown type 0x" + ke.toString(16)); + throw new Error("Unknown type 0x" + Fe.toString(16)); } - var Re = 0, Z = new DataView(Y.buffer); - return Ie(); + var Re = 0, Y = new DataView(Z.buffer); + return $e(); } - function Me(Y, K, ee, de) { - switch (Y) { + function be(Z, j, ee, ge) { + switch (Z) { case 1: - return p(K); + return p(j); case 2: - return C(K); + return S(j); case 3: - return S(K); + return L(j); case 4: - return o(K); + return o(j); case 5: - return c(K); + return c(j); case 6: - return l(o(K), new Uint8Array(ee)); + return l(o(j), new Uint8Array(ee)); case 7: - return l(o(K)); + return l(o(j)); case 8: - return I(o(K)); + return I(o(j)); case 9: - return P(o(K), o(de)[0]); + return P(o(j), o(ge)[0]); case 10: - return F(S(K), o(de)[0]); + return U(L(j), o(ge)[0]); case 11: - return v(S(K), o(de)[0]); + return v(L(j), o(ge)[0]); case 12: - return $(S(K), o(de)[0]); + return R(L(j), o(ge)[0]); case 13: - return $(C(K), o(de)[0]); + return R(S(j), o(ge)[0]); case 14: - return T(S(K)); + return T(L(j)); case 15: - return T(C(K)); + return T(S(j)); } } - function Te(Y, K) { - K = K || {}; - var ee = K.ignoreFields, de = {}; - return ge.forEach(function(ve) { - var Ie = ee ? ee.indexOf(ve) !== -1 : !1, Re = Y[ve]; - Ie || Re === void 0 || (Re instanceof Uint8Array ? de[ve] = Me.apply(null, H(Re)) : de[ve] = Re); - }), de; + function Le(Z, j) { + j = j || {}; + var ee = j.ignoreFields, ge = {}; + return ce.forEach(function(ye) { + var $e = ee ? ee.indexOf(ye) !== -1 : !1, Re = Z[ye]; + $e || Re === void 0 || (Re instanceof Uint8Array ? ge[ye] = be.apply(null, G(Re)) : ge[ye] = Re); + }), ge; } - function se(Y) { - return String.fromCharCode.apply(null, Y).replace(/\0/g, ""); + function ae(Z) { + return String.fromCharCode.apply(null, Z).replace(/\0/g, ""); } - function pe(Y, K, ee) { + function _e(Z, j, ee) { ee = ee || {}; - var de, ve, Ie, Re, Z, ce, Ae = ee.firstModelOnly, ke = K.onModel, he = K.onChain, Oe = K.onGroup, j = K.onAtom, $e = K.onBond, Ve = 0, R = 0, be = 0, Ee = 0, X = 0, le = -1, Le = Y.chainNameList, Ze = Y.secStructList, Ke = Y.insCodeList, je = Y.sequenceIndexList, Je = Y.atomIdList, Lt = Y.bFactorList, rt = Y.altLocList, it = Y.occupancyList, tt = Y.bondAtomList, Et = Y.bondOrderList; - for (de = 0, ve = Y.chainsPerModel.length; ve > de && !(Ae && Ve > 0); ++de) { - var lt = Y.chainsPerModel[Ve]; - for (ke && ke({ chainCount: lt, modelIndex: Ve }), Ie = 0; lt > Ie; ++Ie) { - var wt = Y.groupsPerChain[R]; + var ge, ye, $e, Re, Y, ue, Se = ee.firstModelOnly, Fe = j.onModel, he = j.onChain, De = j.onGroup, K = j.onAtom, ze = j.onBond, Ve = 0, $ = 0, xe = 0, Me = 0, Q = 0, fe = -1, Te = Z.chainNameList, Ze = Z.secStructList, Ke = Z.insCodeList, je = Z.sequenceIndexList, Je = Z.atomIdList, St = Z.bFactorList, rt = Z.altLocList, it = Z.occupancyList, tt = Z.bondAtomList, Et = Z.bondOrderList; + for (ge = 0, ye = Z.chainsPerModel.length; ye > ge && !(Se && Ve > 0); ++ge) { + var lt = Z.chainsPerModel[Ve]; + for (Fe && Fe({ chainCount: lt, modelIndex: Ve }), $e = 0; lt > $e; ++$e) { + var wt = Z.groupsPerChain[$]; if (he) { - var Pt = se(Y.chainIdList.subarray(4 * R, 4 * R + 4)), vt = null; - Le && (vt = se(Le.subarray(4 * R, 4 * R + 4))), he({ groupCount: wt, chainIndex: R, modelIndex: Ve, chainId: Pt, chainName: vt }); + var Pt = ae(Z.chainIdList.subarray(4 * $, 4 * $ + 4)), vt = null; + Te && (vt = ae(Te.subarray(4 * $, 4 * $ + 4))), he({ groupCount: wt, chainIndex: $, modelIndex: Ve, chainId: Pt, chainName: vt }); } for (Re = 0; wt > Re; ++Re) { - var bt = Y.groupList[Y.groupTypeList[be]], mt = bt.atomNameList.length; - if (Oe) { + var bt = Z.groupList[Z.groupTypeList[xe]], mt = bt.atomNameList.length; + if (De) { var Tt = null; - Ze && (Tt = Ze[be]); + Ze && (Tt = Ze[xe]); var Ot = null; - Y.insCodeList && (Ot = String.fromCharCode(Ke[be])); + Z.insCodeList && (Ot = String.fromCharCode(Ke[xe])); var kt = null; - je && (kt = je[be]), Oe({ atomCount: mt, groupIndex: be, chainIndex: R, modelIndex: Ve, groupId: Y.groupIdList[be], groupType: Y.groupTypeList[be], groupName: bt.groupName, singleLetterCode: bt.singleLetterCode, chemCompType: bt.chemCompType, secStruct: Tt, insCode: Ot, sequenceIndex: kt }); + je && (kt = je[xe]), De({ atomCount: mt, groupIndex: xe, chainIndex: $, modelIndex: Ve, groupId: Z.groupIdList[xe], groupType: Z.groupTypeList[xe], groupName: bt.groupName, singleLetterCode: bt.singleLetterCode, chemCompType: bt.chemCompType, secStruct: Tt, insCode: Ot, sequenceIndex: kt }); } - for (Z = 0; mt > Z; ++Z) { - if (j) { - var Qt = null; - Je && (Qt = Je[Ee]); + for (Y = 0; mt > Y; ++Y) { + if (K) { + var Xt = null; + Je && (Xt = Je[Me]); var Ft = null; - Lt && (Ft = Lt[Ee]); + St && (Ft = St[Me]); + var Qt = null; + rt && (Qt = String.fromCharCode(rt[Me])); var Jt = null; - rt && (Jt = String.fromCharCode(rt[Ee])); - var qt = null; - it && (qt = it[Ee]), j({ atomIndex: Ee, groupIndex: be, chainIndex: R, modelIndex: Ve, atomId: Qt, element: bt.elementList[Z], atomName: bt.atomNameList[Z], formalCharge: bt.formalChargeList[Z], xCoord: Y.xCoordList[Ee], yCoord: Y.yCoordList[Ee], zCoord: Y.zCoordList[Ee], bFactor: Ft, altLoc: Jt, occupancy: qt }); + it && (Jt = it[Me]), K({ atomIndex: Me, groupIndex: xe, chainIndex: $, modelIndex: Ve, atomId: Xt, element: bt.elementList[Y], atomName: bt.atomNameList[Y], formalCharge: bt.formalChargeList[Y], xCoord: Z.xCoordList[Me], yCoord: Z.yCoordList[Me], zCoord: Z.zCoordList[Me], bFactor: Ft, altLoc: Qt, occupancy: Jt }); } - Ee += 1; + Me += 1; } - if ($e) { - var er = bt.bondAtomList; - for (Z = 0, ce = bt.bondOrderList.length; ce > Z; ++Z) - $e({ atomIndex1: Ee - mt + er[2 * Z], atomIndex2: Ee - mt + er[2 * Z + 1], bondOrder: bt.bondOrderList[Z] }); + if (ze) { + var qt = bt.bondAtomList; + for (Y = 0, ue = bt.bondOrderList.length; ue > Y; ++Y) + ze({ atomIndex1: Me - mt + qt[2 * Y], atomIndex2: Me - mt + qt[2 * Y + 1], bondOrder: bt.bondOrderList[Y] }); } - be += 1; + xe += 1; } - R += 1; + $ += 1; } - if (X = le + 1, le = Ee - 1, $e && tt) - for (Z = 0, ce = tt.length; ce > Z; Z += 2) { - var Ht = tt[Z], tr = tt[Z + 1]; - (Ht >= X && le >= Ht || tr >= X && le >= tr) && $e({ atomIndex1: Ht, atomIndex2: tr, bondOrder: Et ? Et[Z / 2] : null }); + if (Q = fe + 1, fe = Me - 1, ze && tt) + for (Y = 0, ue = tt.length; ue > Y; Y += 2) { + var er = tt[Y], tr = tt[Y + 1]; + (er >= Q && fe >= er || tr >= Q && fe >= tr) && ze({ atomIndex1: er, atomIndex2: tr, bondOrder: Et ? Et[Y / 2] : null }); } Ve += 1; } } - function we(Y) { - return h(fe(Y)); + function Ee(Z) { + return h(le(Z)); } - function Fe(Y, K) { - Y instanceof ArrayBuffer && (Y = new Uint8Array(Y)); + function Be(Z, j) { + Z instanceof ArrayBuffer && (Z = new Uint8Array(Z)); var ee; - return ee = Y instanceof Uint8Array ? Ce(Y) : Y, Te(ee, K); + return ee = Z instanceof Uint8Array ? Ce(Z) : Z, Le(ee, j); } - function Ue(Y, K, ee, de) { - function ve() { + function Ne(Z, j, ee, ge) { + function ye() { try { - var Re = Fe(Ie.response); + var Re = Be($e.response); ee(Re); - } catch (Z) { - de(Z); + } catch (Y) { + ge(Y); } } - var Ie = new XMLHttpRequest(); - Ie.addEventListener("load", ve, !0), Ie.addEventListener("error", de, !0), Ie.responseType = "arraybuffer", Ie.open("GET", K + Y.toUpperCase()), Ie.send(); + var $e = new XMLHttpRequest(); + $e.addEventListener("load", ye, !0), $e.addEventListener("error", ge, !0), $e.responseType = "arraybuffer", $e.open("GET", j + Z.toUpperCase()), $e.send(); } - function Ne(Y, K, ee) { - Ue(Y, He, K, ee); + function Ge(Z, j, ee) { + Ne(Z, We, j, ee); } - function Be(Y, K, ee) { - Ue(Y, We, K, ee); + function ke(Z, j, ee) { + Ne(Z, Ue, j, ee); } - var ue = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], ye = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], ge = ue.concat(ye), Se = "v1.0.1", ze = "//mmtf.rcsb.org/v1.0/", He = ze + "full/", We = ze + "reduced/"; - t.encode = we, t.decode = Fe, t.traverse = pe, t.fetch = Ne, t.fetchReduced = Be, t.version = Se, t.fetchUrl = He, t.fetchReducedUrl = We, t.encodeMsgpack = h, t.encodeMmtf = fe, t.decodeMsgpack = Ce, t.decodeMmtf = Te; + var pe = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], de = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], ce = pe.concat(de), Ae = "v1.0.1", Oe = "//mmtf.rcsb.org/v1.0/", We = Oe + "full/", Ue = Oe + "reduced/"; + r.encode = Ee, r.decode = Be, r.traverse = _e, r.fetch = Ge, r.fetchReduced = ke, r.version = Ae, r.fetchUrl = We, r.fetchReducedUrl = Ue, r.encodeMsgpack = h, r.encodeMmtf = le, r.decodeMsgpack = Ce, r.decodeMmtf = Le; }); } ), @@ -23157,8 +23157,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; !*** ./node_modules/pako/dist/pako.esm.mjs ***! \*********************************************/ /***/ - (r, e, t) => { - t.r(e), t.d(e, { + (t, e, r) => { + r.r(e), r.d(e, { /* harmony export */ Deflate: () => ( /* binding */ @@ -23212,66 +23212,66 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* harmony export */ }); /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ - const n = 4, f = 0, u = 1, y = 2; + const n = 4, f = 0, u = 1, b = 2; function h(x) { - let W = x.length; - for (; --W >= 0; ) - x[W] = 0; + let H = x.length; + for (; --H >= 0; ) + x[H] = 0; } - const _ = 0, E = 1, c = 2, C = 3, b = 258, A = 29, S = 256, s = S + 1 + A, o = 30, w = 19, p = 2 * s + 1, v = 15, a = 16, l = 7, g = 256, M = 16, L = 17, T = 18, D = ( + const _ = 0, E = 1, c = 2, S = 3, y = 258, w = 29, L = 256, s = L + 1 + w, o = 30, A = 19, p = 2 * s + 1, v = 15, a = 16, l = 7, g = 256, M = 16, C = 17, T = 18, D = ( /* extra bits for each length code */ new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]) ), I = ( /* extra bits for each distance code */ new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]) - ), z = ( + ), B = ( /* extra bits for each bit length code */ new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]) - ), P = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), B = 512, k = new Array((s + 2) * 2); + ), P = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), z = 512, k = new Array((s + 2) * 2); h(k); const N = new Array(o * 2); h(N); - const $ = new Array(B); - h($); - const F = new Array(b - C + 1); - h(F); - const G = new Array(A); + const R = new Array(z); + h(R); + const U = new Array(y - S + 1); + h(U); + const W = new Array(w); + h(W); + const G = new Array(o); h(G); - const H = new Array(o); - h(H); - function U(x, W, O, J, ie) { - this.static_tree = x, this.extra_bits = W, this.extra_base = O, this.elems = J, this.max_length = ie, this.has_stree = x && x.length; + function F(x, H, O, q, ne) { + this.static_tree = x, this.extra_bits = H, this.extra_base = O, this.elems = q, this.max_length = ne, this.has_stree = x && x.length; } - let V, Q, ae; - function oe(x, W) { - this.dyn_tree = x, this.max_code = 0, this.stat_desc = W; + let V, J, X; + function oe(x, H) { + this.dyn_tree = x, this.max_code = 0, this.stat_desc = H; } - const q = (x) => x < 256 ? $[x] : $[256 + (x >>> 7)], me = (x, W) => { - x.pending_buf[x.pending++] = W & 255, x.pending_buf[x.pending++] = W >>> 8 & 255; - }, ne = (x, W, O) => { - x.bi_valid > a - O ? (x.bi_buf |= W << x.bi_valid & 65535, me(x, x.bi_buf), x.bi_buf = W >> a - x.bi_valid, x.bi_valid += O - a) : (x.bi_buf |= W << x.bi_valid & 65535, x.bi_valid += O); - }, fe = (x, W, O) => { - ne( + const te = (x) => x < 256 ? R[x] : R[256 + (x >>> 7)], ve = (x, H) => { + x.pending_buf[x.pending++] = H & 255, x.pending_buf[x.pending++] = H >>> 8 & 255; + }, se = (x, H, O) => { + x.bi_valid > a - O ? (x.bi_buf |= H << x.bi_valid & 65535, ve(x, x.bi_buf), x.bi_buf = H >> a - x.bi_valid, x.bi_valid += O - a) : (x.bi_buf |= H << x.bi_valid & 65535, x.bi_valid += O); + }, le = (x, H, O) => { + se( x, - O[W * 2], - O[W * 2 + 1] + O[H * 2], + O[H * 2 + 1] /*.Len*/ ); - }, Ce = (x, W) => { + }, Ce = (x, H) => { let O = 0; do O |= x & 1, x >>>= 1, O <<= 1; - while (--W > 0); + while (--H > 0); return O >>> 1; - }, Me = (x) => { - x.bi_valid === 16 ? (me(x, x.bi_buf), x.bi_buf = 0, x.bi_valid = 0) : x.bi_valid >= 8 && (x.pending_buf[x.pending++] = x.bi_buf & 255, x.bi_buf >>= 8, x.bi_valid -= 8); - }, Te = (x, W) => { - const O = W.dyn_tree, J = W.max_code, ie = W.stat_desc.static_tree, te = W.stat_desc.has_stree, De = W.stat_desc.extra_bits, xe = W.stat_desc.extra_base, Qe = W.stat_desc.max_length; - let _e, Pe, ut, Xe, Ge, qe, Ct = 0; + }, be = (x) => { + x.bi_valid === 16 ? (ve(x, x.bi_buf), x.bi_buf = 0, x.bi_valid = 0) : x.bi_valid >= 8 && (x.pending_buf[x.pending++] = x.bi_buf & 255, x.bi_buf >>= 8, x.bi_valid -= 8); + }, Le = (x, H) => { + const O = H.dyn_tree, q = H.max_code, ne = H.stat_desc.static_tree, ie = H.stat_desc.has_stree, Pe = H.stat_desc.extra_bits, we = H.stat_desc.extra_base, Qe = H.stat_desc.max_length; + let me, Ie, ut, Xe, He, qe, Ct = 0; for (Xe = 0; Xe <= v; Xe++) x.bl_count[Xe] = 0; - for (O[x.heap[x.heap_max] * 2 + 1] = 0, _e = x.heap_max + 1; _e < p; _e++) - Pe = x.heap[_e], Xe = O[O[Pe * 2 + 1] * 2 + 1] + 1, Xe > Qe && (Xe = Qe, Ct++), O[Pe * 2 + 1] = Xe, !(Pe > J) && (x.bl_count[Xe]++, Ge = 0, Pe >= xe && (Ge = De[Pe - xe]), qe = O[Pe * 2], x.opt_len += qe * (Xe + Ge), te && (x.static_len += qe * (ie[Pe * 2 + 1] + Ge))); + for (O[x.heap[x.heap_max] * 2 + 1] = 0, me = x.heap_max + 1; me < p; me++) + Ie = x.heap[me], Xe = O[O[Ie * 2 + 1] * 2 + 1] + 1, Xe > Qe && (Xe = Qe, Ct++), O[Ie * 2 + 1] = Xe, !(Ie > q) && (x.bl_count[Xe]++, He = 0, Ie >= we && (He = Pe[Ie - we]), qe = O[Ie * 2], x.opt_len += qe * (Xe + He), ie && (x.static_len += qe * (ne[Ie * 2 + 1] + He))); if (Ct !== 0) { do { for (Xe = Qe - 1; x.bl_count[Xe] === 0; ) @@ -23279,99 +23279,99 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; x.bl_count[Xe]--, x.bl_count[Xe + 1] += 2, x.bl_count[Qe]--, Ct -= 2; } while (Ct > 0); for (Xe = Qe; Xe !== 0; Xe--) - for (Pe = x.bl_count[Xe]; Pe !== 0; ) - ut = x.heap[--_e], !(ut > J) && (O[ut * 2 + 1] !== Xe && (x.opt_len += (Xe - O[ut * 2 + 1]) * O[ut * 2], O[ut * 2 + 1] = Xe), Pe--); - } - }, se = (x, W, O) => { - const J = new Array(v + 1); - let ie = 0, te, De; - for (te = 1; te <= v; te++) - ie = ie + O[te - 1] << 1, J[te] = ie; - for (De = 0; De <= W; De++) { - let xe = x[De * 2 + 1]; - xe !== 0 && (x[De * 2] = Ce(J[xe]++, xe)); - } - }, pe = () => { - let x, W, O, J, ie; - const te = new Array(v + 1); - for (O = 0, J = 0; J < A - 1; J++) - for (G[J] = O, x = 0; x < 1 << D[J]; x++) - F[O++] = J; - for (F[O - 1] = J, ie = 0, J = 0; J < 16; J++) - for (H[J] = ie, x = 0; x < 1 << I[J]; x++) - $[ie++] = J; - for (ie >>= 7; J < o; J++) - for (H[J] = ie << 7, x = 0; x < 1 << I[J] - 7; x++) - $[256 + ie++] = J; - for (W = 0; W <= v; W++) - te[W] = 0; + for (Ie = x.bl_count[Xe]; Ie !== 0; ) + ut = x.heap[--me], !(ut > q) && (O[ut * 2 + 1] !== Xe && (x.opt_len += (Xe - O[ut * 2 + 1]) * O[ut * 2], O[ut * 2 + 1] = Xe), Ie--); + } + }, ae = (x, H, O) => { + const q = new Array(v + 1); + let ne = 0, ie, Pe; + for (ie = 1; ie <= v; ie++) + ne = ne + O[ie - 1] << 1, q[ie] = ne; + for (Pe = 0; Pe <= H; Pe++) { + let we = x[Pe * 2 + 1]; + we !== 0 && (x[Pe * 2] = Ce(q[we]++, we)); + } + }, _e = () => { + let x, H, O, q, ne; + const ie = new Array(v + 1); + for (O = 0, q = 0; q < w - 1; q++) + for (W[q] = O, x = 0; x < 1 << D[q]; x++) + U[O++] = q; + for (U[O - 1] = q, ne = 0, q = 0; q < 16; q++) + for (G[q] = ne, x = 0; x < 1 << I[q]; x++) + R[ne++] = q; + for (ne >>= 7; q < o; q++) + for (G[q] = ne << 7, x = 0; x < 1 << I[q] - 7; x++) + R[256 + ne++] = q; + for (H = 0; H <= v; H++) + ie[H] = 0; for (x = 0; x <= 143; ) - k[x * 2 + 1] = 8, x++, te[8]++; + k[x * 2 + 1] = 8, x++, ie[8]++; for (; x <= 255; ) - k[x * 2 + 1] = 9, x++, te[9]++; + k[x * 2 + 1] = 9, x++, ie[9]++; for (; x <= 279; ) - k[x * 2 + 1] = 7, x++, te[7]++; + k[x * 2 + 1] = 7, x++, ie[7]++; for (; x <= 287; ) - k[x * 2 + 1] = 8, x++, te[8]++; - for (se(k, s + 1, te), x = 0; x < o; x++) + k[x * 2 + 1] = 8, x++, ie[8]++; + for (ae(k, s + 1, ie), x = 0; x < o; x++) N[x * 2 + 1] = 5, N[x * 2] = Ce(x, 5); - V = new U(k, D, S + 1, s, v), Q = new U(N, I, 0, o, v), ae = new U(new Array(0), z, 0, w, l); - }, we = (x) => { - let W; - for (W = 0; W < s; W++) - x.dyn_ltree[W * 2] = 0; - for (W = 0; W < o; W++) - x.dyn_dtree[W * 2] = 0; - for (W = 0; W < w; W++) - x.bl_tree[W * 2] = 0; + V = new F(k, D, L + 1, s, v), J = new F(N, I, 0, o, v), X = new F(new Array(0), B, 0, A, l); + }, Ee = (x) => { + let H; + for (H = 0; H < s; H++) + x.dyn_ltree[H * 2] = 0; + for (H = 0; H < o; H++) + x.dyn_dtree[H * 2] = 0; + for (H = 0; H < A; H++) + x.bl_tree[H * 2] = 0; x.dyn_ltree[g * 2] = 1, x.opt_len = x.static_len = 0, x.sym_next = x.matches = 0; - }, Fe = (x) => { - x.bi_valid > 8 ? me(x, x.bi_buf) : x.bi_valid > 0 && (x.pending_buf[x.pending++] = x.bi_buf), x.bi_buf = 0, x.bi_valid = 0; - }, Ue = (x, W, O, J) => { - const ie = W * 2, te = O * 2; - return x[ie] < x[te] || x[ie] === x[te] && J[W] <= J[O]; - }, Ne = (x, W, O) => { - const J = x.heap[O]; - let ie = O << 1; - for (; ie <= x.heap_len && (ie < x.heap_len && Ue(W, x.heap[ie + 1], x.heap[ie], x.depth) && ie++, !Ue(W, J, x.heap[ie], x.depth)); ) - x.heap[O] = x.heap[ie], O = ie, ie <<= 1; - x.heap[O] = J; - }, Be = (x, W, O) => { - let J, ie, te = 0, De, xe; + }, Be = (x) => { + x.bi_valid > 8 ? ve(x, x.bi_buf) : x.bi_valid > 0 && (x.pending_buf[x.pending++] = x.bi_buf), x.bi_buf = 0, x.bi_valid = 0; + }, Ne = (x, H, O, q) => { + const ne = H * 2, ie = O * 2; + return x[ne] < x[ie] || x[ne] === x[ie] && q[H] <= q[O]; + }, Ge = (x, H, O) => { + const q = x.heap[O]; + let ne = O << 1; + for (; ne <= x.heap_len && (ne < x.heap_len && Ne(H, x.heap[ne + 1], x.heap[ne], x.depth) && ne++, !Ne(H, q, x.heap[ne], x.depth)); ) + x.heap[O] = x.heap[ne], O = ne, ne <<= 1; + x.heap[O] = q; + }, ke = (x, H, O) => { + let q, ne, ie = 0, Pe, we; if (x.sym_next !== 0) do - J = x.pending_buf[x.sym_buf + te++] & 255, J += (x.pending_buf[x.sym_buf + te++] & 255) << 8, ie = x.pending_buf[x.sym_buf + te++], J === 0 ? fe(x, ie, W) : (De = F[ie], fe(x, De + S + 1, W), xe = D[De], xe !== 0 && (ie -= G[De], ne(x, ie, xe)), J--, De = q(J), fe(x, De, O), xe = I[De], xe !== 0 && (J -= H[De], ne(x, J, xe))); - while (te < x.sym_next); - fe(x, g, W); - }, ue = (x, W) => { - const O = W.dyn_tree, J = W.stat_desc.static_tree, ie = W.stat_desc.has_stree, te = W.stat_desc.elems; - let De, xe, Qe = -1, _e; - for (x.heap_len = 0, x.heap_max = p, De = 0; De < te; De++) - O[De * 2] !== 0 ? (x.heap[++x.heap_len] = Qe = De, x.depth[De] = 0) : O[De * 2 + 1] = 0; + q = x.pending_buf[x.sym_buf + ie++] & 255, q += (x.pending_buf[x.sym_buf + ie++] & 255) << 8, ne = x.pending_buf[x.sym_buf + ie++], q === 0 ? le(x, ne, H) : (Pe = U[ne], le(x, Pe + L + 1, H), we = D[Pe], we !== 0 && (ne -= W[Pe], se(x, ne, we)), q--, Pe = te(q), le(x, Pe, O), we = I[Pe], we !== 0 && (q -= G[Pe], se(x, q, we))); + while (ie < x.sym_next); + le(x, g, H); + }, pe = (x, H) => { + const O = H.dyn_tree, q = H.stat_desc.static_tree, ne = H.stat_desc.has_stree, ie = H.stat_desc.elems; + let Pe, we, Qe = -1, me; + for (x.heap_len = 0, x.heap_max = p, Pe = 0; Pe < ie; Pe++) + O[Pe * 2] !== 0 ? (x.heap[++x.heap_len] = Qe = Pe, x.depth[Pe] = 0) : O[Pe * 2 + 1] = 0; for (; x.heap_len < 2; ) - _e = x.heap[++x.heap_len] = Qe < 2 ? ++Qe : 0, O[_e * 2] = 1, x.depth[_e] = 0, x.opt_len--, ie && (x.static_len -= J[_e * 2 + 1]); - for (W.max_code = Qe, De = x.heap_len >> 1; De >= 1; De--) - Ne(x, O, De); - _e = te; + me = x.heap[++x.heap_len] = Qe < 2 ? ++Qe : 0, O[me * 2] = 1, x.depth[me] = 0, x.opt_len--, ne && (x.static_len -= q[me * 2 + 1]); + for (H.max_code = Qe, Pe = x.heap_len >> 1; Pe >= 1; Pe--) + Ge(x, O, Pe); + me = ie; do - De = x.heap[ + Pe = x.heap[ 1 /*SMALLEST*/ ], x.heap[ 1 /*SMALLEST*/ - ] = x.heap[x.heap_len--], Ne( + ] = x.heap[x.heap_len--], Ge( x, O, 1 /*SMALLEST*/ - ), xe = x.heap[ + ), we = x.heap[ 1 /*SMALLEST*/ - ], x.heap[--x.heap_max] = De, x.heap[--x.heap_max] = xe, O[_e * 2] = O[De * 2] + O[xe * 2], x.depth[_e] = (x.depth[De] >= x.depth[xe] ? x.depth[De] : x.depth[xe]) + 1, O[De * 2 + 1] = O[xe * 2 + 1] = _e, x.heap[ + ], x.heap[--x.heap_max] = Pe, x.heap[--x.heap_max] = we, O[me * 2] = O[Pe * 2] + O[we * 2], x.depth[me] = (x.depth[Pe] >= x.depth[we] ? x.depth[Pe] : x.depth[we]) + 1, O[Pe * 2 + 1] = O[we * 2 + 1] = me, x.heap[ 1 /*SMALLEST*/ - ] = _e++, Ne( + ] = me++, Ge( x, O, 1 @@ -23381,90 +23381,90 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; x.heap[--x.heap_max] = x.heap[ 1 /*SMALLEST*/ - ], Te(x, W), se(O, Qe, x.bl_count); - }, ye = (x, W, O) => { - let J, ie = -1, te, De = W[0 * 2 + 1], xe = 0, Qe = 7, _e = 4; - for (De === 0 && (Qe = 138, _e = 3), W[(O + 1) * 2 + 1] = 65535, J = 0; J <= O; J++) - te = De, De = W[(J + 1) * 2 + 1], !(++xe < Qe && te === De) && (xe < _e ? x.bl_tree[te * 2] += xe : te !== 0 ? (te !== ie && x.bl_tree[te * 2]++, x.bl_tree[M * 2]++) : xe <= 10 ? x.bl_tree[L * 2]++ : x.bl_tree[T * 2]++, xe = 0, ie = te, De === 0 ? (Qe = 138, _e = 3) : te === De ? (Qe = 6, _e = 3) : (Qe = 7, _e = 4)); - }, ge = (x, W, O) => { - let J, ie = -1, te, De = W[0 * 2 + 1], xe = 0, Qe = 7, _e = 4; - for (De === 0 && (Qe = 138, _e = 3), J = 0; J <= O; J++) - if (te = De, De = W[(J + 1) * 2 + 1], !(++xe < Qe && te === De)) { - if (xe < _e) + ], Le(x, H), ae(O, Qe, x.bl_count); + }, de = (x, H, O) => { + let q, ne = -1, ie, Pe = H[0 * 2 + 1], we = 0, Qe = 7, me = 4; + for (Pe === 0 && (Qe = 138, me = 3), H[(O + 1) * 2 + 1] = 65535, q = 0; q <= O; q++) + ie = Pe, Pe = H[(q + 1) * 2 + 1], !(++we < Qe && ie === Pe) && (we < me ? x.bl_tree[ie * 2] += we : ie !== 0 ? (ie !== ne && x.bl_tree[ie * 2]++, x.bl_tree[M * 2]++) : we <= 10 ? x.bl_tree[C * 2]++ : x.bl_tree[T * 2]++, we = 0, ne = ie, Pe === 0 ? (Qe = 138, me = 3) : ie === Pe ? (Qe = 6, me = 3) : (Qe = 7, me = 4)); + }, ce = (x, H, O) => { + let q, ne = -1, ie, Pe = H[0 * 2 + 1], we = 0, Qe = 7, me = 4; + for (Pe === 0 && (Qe = 138, me = 3), q = 0; q <= O; q++) + if (ie = Pe, Pe = H[(q + 1) * 2 + 1], !(++we < Qe && ie === Pe)) { + if (we < me) do - fe(x, te, x.bl_tree); - while (--xe !== 0); + le(x, ie, x.bl_tree); + while (--we !== 0); else - te !== 0 ? (te !== ie && (fe(x, te, x.bl_tree), xe--), fe(x, M, x.bl_tree), ne(x, xe - 3, 2)) : xe <= 10 ? (fe(x, L, x.bl_tree), ne(x, xe - 3, 3)) : (fe(x, T, x.bl_tree), ne(x, xe - 11, 7)); - xe = 0, ie = te, De === 0 ? (Qe = 138, _e = 3) : te === De ? (Qe = 6, _e = 3) : (Qe = 7, _e = 4); + ie !== 0 ? (ie !== ne && (le(x, ie, x.bl_tree), we--), le(x, M, x.bl_tree), se(x, we - 3, 2)) : we <= 10 ? (le(x, C, x.bl_tree), se(x, we - 3, 3)) : (le(x, T, x.bl_tree), se(x, we - 11, 7)); + we = 0, ne = ie, Pe === 0 ? (Qe = 138, me = 3) : ie === Pe ? (Qe = 6, me = 3) : (Qe = 7, me = 4); } - }, Se = (x) => { - let W; - for (ye(x, x.dyn_ltree, x.l_desc.max_code), ye(x, x.dyn_dtree, x.d_desc.max_code), ue(x, x.bl_desc), W = w - 1; W >= 3 && x.bl_tree[P[W] * 2 + 1] === 0; W--) + }, Ae = (x) => { + let H; + for (de(x, x.dyn_ltree, x.l_desc.max_code), de(x, x.dyn_dtree, x.d_desc.max_code), pe(x, x.bl_desc), H = A - 1; H >= 3 && x.bl_tree[P[H] * 2 + 1] === 0; H--) ; - return x.opt_len += 3 * (W + 1) + 5 + 5 + 4, W; - }, ze = (x, W, O, J) => { - let ie; - for (ne(x, W - 257, 5), ne(x, O - 1, 5), ne(x, J - 4, 4), ie = 0; ie < J; ie++) - ne(x, x.bl_tree[P[ie] * 2 + 1], 3); - ge(x, x.dyn_ltree, W - 1), ge(x, x.dyn_dtree, O - 1); - }, He = (x) => { - let W = 4093624447, O; - for (O = 0; O <= 31; O++, W >>>= 1) - if (W & 1 && x.dyn_ltree[O * 2] !== 0) + return x.opt_len += 3 * (H + 1) + 5 + 5 + 4, H; + }, Oe = (x, H, O, q) => { + let ne; + for (se(x, H - 257, 5), se(x, O - 1, 5), se(x, q - 4, 4), ne = 0; ne < q; ne++) + se(x, x.bl_tree[P[ne] * 2 + 1], 3); + ce(x, x.dyn_ltree, H - 1), ce(x, x.dyn_dtree, O - 1); + }, We = (x) => { + let H = 4093624447, O; + for (O = 0; O <= 31; O++, H >>>= 1) + if (H & 1 && x.dyn_ltree[O * 2] !== 0) return f; if (x.dyn_ltree[9 * 2] !== 0 || x.dyn_ltree[10 * 2] !== 0 || x.dyn_ltree[13 * 2] !== 0) return u; - for (O = 32; O < S; O++) + for (O = 32; O < L; O++) if (x.dyn_ltree[O * 2] !== 0) return u; return f; }; - let We = !1; - const Y = (x) => { - We || (pe(), We = !0), x.l_desc = new oe(x.dyn_ltree, V), x.d_desc = new oe(x.dyn_dtree, Q), x.bl_desc = new oe(x.bl_tree, ae), x.bi_buf = 0, x.bi_valid = 0, we(x); - }, K = (x, W, O, J) => { - ne(x, (_ << 1) + (J ? 1 : 0), 3), Fe(x), me(x, O), me(x, ~O), O && x.pending_buf.set(x.window.subarray(W, W + O), x.pending), x.pending += O; + let Ue = !1; + const Z = (x) => { + Ue || (_e(), Ue = !0), x.l_desc = new oe(x.dyn_ltree, V), x.d_desc = new oe(x.dyn_dtree, J), x.bl_desc = new oe(x.bl_tree, X), x.bi_buf = 0, x.bi_valid = 0, Ee(x); + }, j = (x, H, O, q) => { + se(x, (_ << 1) + (q ? 1 : 0), 3), Be(x), ve(x, O), ve(x, ~O), O && x.pending_buf.set(x.window.subarray(H, H + O), x.pending), x.pending += O; }, ee = (x) => { - ne(x, E << 1, 3), fe(x, g, k), Me(x); - }, de = (x, W, O, J) => { - let ie, te, De = 0; - x.level > 0 ? (x.strm.data_type === y && (x.strm.data_type = He(x)), ue(x, x.l_desc), ue(x, x.d_desc), De = Se(x), ie = x.opt_len + 3 + 7 >>> 3, te = x.static_len + 3 + 7 >>> 3, te <= ie && (ie = te)) : ie = te = O + 5, O + 4 <= ie && W !== -1 ? K(x, W, O, J) : x.strategy === n || te === ie ? (ne(x, (E << 1) + (J ? 1 : 0), 3), Be(x, k, N)) : (ne(x, (c << 1) + (J ? 1 : 0), 3), ze(x, x.l_desc.max_code + 1, x.d_desc.max_code + 1, De + 1), Be(x, x.dyn_ltree, x.dyn_dtree)), we(x), J && Fe(x); - }, ve = (x, W, O) => (x.pending_buf[x.sym_buf + x.sym_next++] = W, x.pending_buf[x.sym_buf + x.sym_next++] = W >> 8, x.pending_buf[x.sym_buf + x.sym_next++] = O, W === 0 ? x.dyn_ltree[O * 2]++ : (x.matches++, W--, x.dyn_ltree[(F[O] + S + 1) * 2]++, x.dyn_dtree[q(W) * 2]++), x.sym_next === x.sym_end); - var Ie = Y, Re = K, Z = de, ce = ve, Ae = ee, ke = { - _tr_init: Ie, + se(x, E << 1, 3), le(x, g, k), be(x); + }, ge = (x, H, O, q) => { + let ne, ie, Pe = 0; + x.level > 0 ? (x.strm.data_type === b && (x.strm.data_type = We(x)), pe(x, x.l_desc), pe(x, x.d_desc), Pe = Ae(x), ne = x.opt_len + 3 + 7 >>> 3, ie = x.static_len + 3 + 7 >>> 3, ie <= ne && (ne = ie)) : ne = ie = O + 5, O + 4 <= ne && H !== -1 ? j(x, H, O, q) : x.strategy === n || ie === ne ? (se(x, (E << 1) + (q ? 1 : 0), 3), ke(x, k, N)) : (se(x, (c << 1) + (q ? 1 : 0), 3), Oe(x, x.l_desc.max_code + 1, x.d_desc.max_code + 1, Pe + 1), ke(x, x.dyn_ltree, x.dyn_dtree)), Ee(x), q && Be(x); + }, ye = (x, H, O) => (x.pending_buf[x.sym_buf + x.sym_next++] = H, x.pending_buf[x.sym_buf + x.sym_next++] = H >> 8, x.pending_buf[x.sym_buf + x.sym_next++] = O, H === 0 ? x.dyn_ltree[O * 2]++ : (x.matches++, H--, x.dyn_ltree[(U[O] + L + 1) * 2]++, x.dyn_dtree[te(H) * 2]++), x.sym_next === x.sym_end); + var $e = Z, Re = j, Y = ge, ue = ye, Se = ee, Fe = { + _tr_init: $e, _tr_stored_block: Re, - _tr_flush_block: Z, - _tr_tally: ce, - _tr_align: Ae - }, Oe = (x, W, O, J) => { - let ie = x & 65535 | 0, te = x >>> 16 & 65535 | 0, De = 0; + _tr_flush_block: Y, + _tr_tally: ue, + _tr_align: Se + }, De = (x, H, O, q) => { + let ne = x & 65535 | 0, ie = x >>> 16 & 65535 | 0, Pe = 0; for (; O !== 0; ) { - De = O > 2e3 ? 2e3 : O, O -= De; + Pe = O > 2e3 ? 2e3 : O, O -= Pe; do - ie = ie + W[J++] | 0, te = te + ie | 0; - while (--De); - ie %= 65521, te %= 65521; + ne = ne + H[q++] | 0, ie = ie + ne | 0; + while (--Pe); + ne %= 65521, ie %= 65521; } - return ie | te << 16 | 0; + return ne | ie << 16 | 0; }; - const j = () => { - let x, W = []; + const K = () => { + let x, H = []; for (var O = 0; O < 256; O++) { x = O; - for (var J = 0; J < 8; J++) + for (var q = 0; q < 8; q++) x = x & 1 ? 3988292384 ^ x >>> 1 : x >>> 1; - W[O] = x; + H[O] = x; } - return W; - }, $e = new Uint32Array(j()); - var R = (x, W, O, J) => { - const ie = $e, te = J + O; + return H; + }, ze = new Uint32Array(K()); + var $ = (x, H, O, q) => { + const ne = ze, ie = q + O; x ^= -1; - for (let De = J; De < te; De++) - x = x >>> 8 ^ ie[(x ^ W[De]) & 255]; + for (let Pe = q; Pe < ie; Pe++) + x = x >>> 8 ^ ne[(x ^ H[Pe]) & 255]; return x ^ -1; - }, be = { + }, xe = { 2: "need dictionary", /* Z_NEED_DICT 2 */ 1: "stream end", @@ -23483,7 +23483,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* Z_BUF_ERROR (-5) */ "-6": "incompatible version" /* Z_VERSION_ERROR (-6) */ - }, Ee = { + }, Me = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -23523,10 +23523,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; - const { _tr_init: X, _tr_stored_block: le, _tr_flush_block: Le, _tr_tally: Ze, _tr_align: Ke } = ke, { + const { _tr_init: Q, _tr_stored_block: fe, _tr_flush_block: Te, _tr_tally: Ze, _tr_align: Ke } = Fe, { Z_NO_FLUSH: je, Z_PARTIAL_FLUSH: Je, - Z_FULL_FLUSH: Lt, + Z_FULL_FLUSH: St, Z_FINISH: rt, Z_BLOCK: it, Z_OK: tt, @@ -23540,85 +23540,85 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_RLE: Tt, Z_FIXED: Ot, Z_DEFAULT_STRATEGY: kt, - Z_UNKNOWN: Qt, + Z_UNKNOWN: Xt, Z_DEFLATED: Ft - } = Ee, Jt = 9, qt = 15, er = 8, Ht = 29, lr = 256 + 1 + Ht, Or = 30, Dr = 19, Pr = 2 * lr + 1, Ir = 15, at = 3, Bt = 258, pt = Bt + at + 1, yt = 32, At = 42, rr = 57, Rr = 69, $r = 73, Br = 91, zr = 103, Vt = 113, hr = 666, Dt = 1, ir = 2, jt = 3, nr = 4, nn = 3, Kt = (x, W) => (x.msg = be[W], W), Xr = (x) => x * 2 - (x > 4 ? 9 : 0), Gt = (x) => { - let W = x.length; - for (; --W >= 0; ) - x[W] = 0; + } = Me, Qt = 9, Jt = 15, qt = 8, lr = 256 + 1 + 29, Or = 30, Dr = 19, Pr = 2 * lr + 1, Ir = 15, at = 3, Bt = 258, pt = Bt + at + 1, yt = 32, At = 42, rr = 57, $r = 69, Rr = 73, Br = 91, zr = 103, Ht = 113, fr = 666, Dt = 1, ir = 2, Vt = 3, nr = 4, nn = 3, jt = (x, H) => (x.msg = xe[H], H), Xr = (x) => x * 2 - (x > 4 ? 9 : 0), Gt = (x) => { + let H = x.length; + for (; --H >= 0; ) + x[H] = 0; }, sn = (x) => { - let W, O, J, ie = x.w_size; - W = x.hash_size, J = W; + let H, O, q, ne = x.w_size; + H = x.hash_size, q = H; do - O = x.head[--J], x.head[J] = O >= ie ? O - ie : 0; - while (--W); - W = ie, J = W; + O = x.head[--q], x.head[q] = O >= ne ? O - ne : 0; + while (--H); + H = ne, q = H; do - O = x.prev[--J], x.prev[J] = O >= ie ? O - ie : 0; - while (--W); + O = x.prev[--q], x.prev[q] = O >= ne ? O - ne : 0; + while (--H); }; - let Wt = (x, W, O) => (W << x.hash_shift ^ O) & x.hash_mask; + let Wt = (x, H, O) => (H << x.hash_shift ^ O) & x.hash_mask; const It = (x) => { - const W = x.state; - let O = W.pending; - O > x.avail_out && (O = x.avail_out), O !== 0 && (x.output.set(W.pending_buf.subarray(W.pending_out, W.pending_out + O), x.next_out), x.next_out += O, W.pending_out += O, x.total_out += O, x.avail_out -= O, W.pending -= O, W.pending === 0 && (W.pending_out = 0)); - }, Rt = (x, W) => { - Le(x, x.block_start >= 0 ? x.block_start : -1, x.strstart - x.block_start, W), x.block_start = x.strstart, It(x.strm); - }, dt = (x, W) => { - x.pending_buf[x.pending++] = W; - }, fr = (x, W) => { - x.pending_buf[x.pending++] = W >>> 8 & 255, x.pending_buf[x.pending++] = W & 255; - }, kr = (x, W, O, J) => { - let ie = x.avail_in; - return ie > J && (ie = J), ie === 0 ? 0 : (x.avail_in -= ie, W.set(x.input.subarray(x.next_in, x.next_in + ie), O), x.state.wrap === 1 ? x.adler = Oe(x.adler, W, ie, O) : x.state.wrap === 2 && (x.adler = R(x.adler, W, ie, O)), x.next_in += ie, x.total_in += ie, ie); - }, Qr = (x, W) => { - let O = x.max_chain_length, J = x.strstart, ie, te, De = x.prev_length, xe = x.nice_match; - const Qe = x.strstart > x.w_size - pt ? x.strstart - (x.w_size - pt) : 0, _e = x.window, Pe = x.w_mask, ut = x.prev, Xe = x.strstart + Bt; - let Ge = _e[J + De - 1], qe = _e[J + De]; - x.prev_length >= x.good_match && (O >>= 2), xe > x.lookahead && (xe = x.lookahead); + const H = x.state; + let O = H.pending; + O > x.avail_out && (O = x.avail_out), O !== 0 && (x.output.set(H.pending_buf.subarray(H.pending_out, H.pending_out + O), x.next_out), x.next_out += O, H.pending_out += O, x.total_out += O, x.avail_out -= O, H.pending -= O, H.pending === 0 && (H.pending_out = 0)); + }, $t = (x, H) => { + Te(x, x.block_start >= 0 ? x.block_start : -1, x.strstart - x.block_start, H), x.block_start = x.strstart, It(x.strm); + }, dt = (x, H) => { + x.pending_buf[x.pending++] = H; + }, hr = (x, H) => { + x.pending_buf[x.pending++] = H >>> 8 & 255, x.pending_buf[x.pending++] = H & 255; + }, kr = (x, H, O, q) => { + let ne = x.avail_in; + return ne > q && (ne = q), ne === 0 ? 0 : (x.avail_in -= ne, H.set(x.input.subarray(x.next_in, x.next_in + ne), O), x.state.wrap === 1 ? x.adler = De(x.adler, H, ne, O) : x.state.wrap === 2 && (x.adler = $(x.adler, H, ne, O)), x.next_in += ne, x.total_in += ne, ne); + }, Qr = (x, H) => { + let O = x.max_chain_length, q = x.strstart, ne, ie, Pe = x.prev_length, we = x.nice_match; + const Qe = x.strstart > x.w_size - pt ? x.strstart - (x.w_size - pt) : 0, me = x.window, Ie = x.w_mask, ut = x.prev, Xe = x.strstart + Bt; + let He = me[q + Pe - 1], qe = me[q + Pe]; + x.prev_length >= x.good_match && (O >>= 2), we > x.lookahead && (we = x.lookahead); do - if (ie = W, !(_e[ie + De] !== qe || _e[ie + De - 1] !== Ge || _e[ie] !== _e[J] || _e[++ie] !== _e[J + 1])) { - J += 2, ie++; + if (ne = H, !(me[ne + Pe] !== qe || me[ne + Pe - 1] !== He || me[ne] !== me[q] || me[++ne] !== me[q + 1])) { + q += 2, ne++; do ; - while (_e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && J < Xe); - if (te = Bt - (Xe - J), J = Xe - Bt, te > De) { - if (x.match_start = W, De = te, te >= xe) + while (me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && me[++q] === me[++ne] && q < Xe); + if (ie = Bt - (Xe - q), q = Xe - Bt, ie > Pe) { + if (x.match_start = H, Pe = ie, ie >= we) break; - Ge = _e[J + De - 1], qe = _e[J + De]; + He = me[q + Pe - 1], qe = me[q + Pe]; } } - while ((W = ut[W & Pe]) > Qe && --O !== 0); - return De <= x.lookahead ? De : x.lookahead; + while ((H = ut[H & Ie]) > Qe && --O !== 0); + return Pe <= x.lookahead ? Pe : x.lookahead; }, sr = (x) => { - const W = x.w_size; - let O, J, ie; + const H = x.w_size; + let O, q, ne; do { - if (J = x.window_size - x.lookahead - x.strstart, x.strstart >= W + (W - pt) && (x.window.set(x.window.subarray(W, W + W - J), 0), x.match_start -= W, x.strstart -= W, x.block_start -= W, x.insert > x.strstart && (x.insert = x.strstart), sn(x), J += W), x.strm.avail_in === 0) + if (q = x.window_size - x.lookahead - x.strstart, x.strstart >= H + (H - pt) && (x.window.set(x.window.subarray(H, H + H - q), 0), x.match_start -= H, x.strstart -= H, x.block_start -= H, x.insert > x.strstart && (x.insert = x.strstart), sn(x), q += H), x.strm.avail_in === 0) break; - if (O = kr(x.strm, x.window, x.strstart + x.lookahead, J), x.lookahead += O, x.lookahead + x.insert >= at) - for (ie = x.strstart - x.insert, x.ins_h = x.window[ie], x.ins_h = Wt(x, x.ins_h, x.window[ie + 1]); x.insert && (x.ins_h = Wt(x, x.ins_h, x.window[ie + at - 1]), x.prev[ie & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = ie, ie++, x.insert--, !(x.lookahead + x.insert < at)); ) + if (O = kr(x.strm, x.window, x.strstart + x.lookahead, q), x.lookahead += O, x.lookahead + x.insert >= at) + for (ne = x.strstart - x.insert, x.ins_h = x.window[ne], x.ins_h = Wt(x, x.ins_h, x.window[ne + 1]); x.insert && (x.ins_h = Wt(x, x.ins_h, x.window[ne + at - 1]), x.prev[ne & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = ne, ne++, x.insert--, !(x.lookahead + x.insert < at)); ) ; } while (x.lookahead < pt && x.strm.avail_in !== 0); - }, Jr = (x, W) => { - let O = x.pending_buf_size - 5 > x.w_size ? x.w_size : x.pending_buf_size - 5, J, ie, te, De = 0, xe = x.strm.avail_in; + }, Jr = (x, H) => { + let O = x.pending_buf_size - 5 > x.w_size ? x.w_size : x.pending_buf_size - 5, q, ne, ie, Pe = 0, we = x.strm.avail_in; do { - if (J = 65535, te = x.bi_valid + 42 >> 3, x.strm.avail_out < te || (te = x.strm.avail_out - te, ie = x.strstart - x.block_start, J > ie + x.strm.avail_in && (J = ie + x.strm.avail_in), J > te && (J = te), J < O && (J === 0 && W !== rt || W === je || J !== ie + x.strm.avail_in))) + if (q = 65535, ie = x.bi_valid + 42 >> 3, x.strm.avail_out < ie || (ie = x.strm.avail_out - ie, ne = x.strstart - x.block_start, q > ne + x.strm.avail_in && (q = ne + x.strm.avail_in), q > ie && (q = ie), q < O && (q === 0 && H !== rt || H === je || q !== ne + x.strm.avail_in))) break; - De = W === rt && J === ie + x.strm.avail_in ? 1 : 0, le(x, 0, 0, De), x.pending_buf[x.pending - 4] = J, x.pending_buf[x.pending - 3] = J >> 8, x.pending_buf[x.pending - 2] = ~J, x.pending_buf[x.pending - 1] = ~J >> 8, It(x.strm), ie && (ie > J && (ie = J), x.strm.output.set(x.window.subarray(x.block_start, x.block_start + ie), x.strm.next_out), x.strm.next_out += ie, x.strm.avail_out -= ie, x.strm.total_out += ie, x.block_start += ie, J -= ie), J && (kr(x.strm, x.strm.output, x.strm.next_out, J), x.strm.next_out += J, x.strm.avail_out -= J, x.strm.total_out += J); - } while (De === 0); - return xe -= x.strm.avail_in, xe && (xe >= x.w_size ? (x.matches = 2, x.window.set(x.strm.input.subarray(x.strm.next_in - x.w_size, x.strm.next_in), 0), x.strstart = x.w_size, x.insert = x.strstart) : (x.window_size - x.strstart <= xe && (x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, x.insert > x.strstart && (x.insert = x.strstart)), x.window.set(x.strm.input.subarray(x.strm.next_in - xe, x.strm.next_in), x.strstart), x.strstart += xe, x.insert += xe > x.w_size - x.insert ? x.w_size - x.insert : xe), x.block_start = x.strstart), x.high_water < x.strstart && (x.high_water = x.strstart), De ? nr : W !== je && W !== rt && x.strm.avail_in === 0 && x.strstart === x.block_start ? ir : (te = x.window_size - x.strstart, x.strm.avail_in > te && x.block_start >= x.w_size && (x.block_start -= x.w_size, x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, te += x.w_size, x.insert > x.strstart && (x.insert = x.strstart)), te > x.strm.avail_in && (te = x.strm.avail_in), te && (kr(x.strm, x.window, x.strstart, te), x.strstart += te, x.insert += te > x.w_size - x.insert ? x.w_size - x.insert : te), x.high_water < x.strstart && (x.high_water = x.strstart), te = x.bi_valid + 42 >> 3, te = x.pending_buf_size - te > 65535 ? 65535 : x.pending_buf_size - te, O = te > x.w_size ? x.w_size : te, ie = x.strstart - x.block_start, (ie >= O || (ie || W === rt) && W !== je && x.strm.avail_in === 0 && ie <= te) && (J = ie > te ? te : ie, De = W === rt && x.strm.avail_in === 0 && J === ie ? 1 : 0, le(x, x.block_start, J, De), x.block_start += J, It(x.strm)), De ? jt : Dt); - }, Fr = (x, W) => { - let O, J; + Pe = H === rt && q === ne + x.strm.avail_in ? 1 : 0, fe(x, 0, 0, Pe), x.pending_buf[x.pending - 4] = q, x.pending_buf[x.pending - 3] = q >> 8, x.pending_buf[x.pending - 2] = ~q, x.pending_buf[x.pending - 1] = ~q >> 8, It(x.strm), ne && (ne > q && (ne = q), x.strm.output.set(x.window.subarray(x.block_start, x.block_start + ne), x.strm.next_out), x.strm.next_out += ne, x.strm.avail_out -= ne, x.strm.total_out += ne, x.block_start += ne, q -= ne), q && (kr(x.strm, x.strm.output, x.strm.next_out, q), x.strm.next_out += q, x.strm.avail_out -= q, x.strm.total_out += q); + } while (Pe === 0); + return we -= x.strm.avail_in, we && (we >= x.w_size ? (x.matches = 2, x.window.set(x.strm.input.subarray(x.strm.next_in - x.w_size, x.strm.next_in), 0), x.strstart = x.w_size, x.insert = x.strstart) : (x.window_size - x.strstart <= we && (x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, x.insert > x.strstart && (x.insert = x.strstart)), x.window.set(x.strm.input.subarray(x.strm.next_in - we, x.strm.next_in), x.strstart), x.strstart += we, x.insert += we > x.w_size - x.insert ? x.w_size - x.insert : we), x.block_start = x.strstart), x.high_water < x.strstart && (x.high_water = x.strstart), Pe ? nr : H !== je && H !== rt && x.strm.avail_in === 0 && x.strstart === x.block_start ? ir : (ie = x.window_size - x.strstart, x.strm.avail_in > ie && x.block_start >= x.w_size && (x.block_start -= x.w_size, x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, ie += x.w_size, x.insert > x.strstart && (x.insert = x.strstart)), ie > x.strm.avail_in && (ie = x.strm.avail_in), ie && (kr(x.strm, x.window, x.strstart, ie), x.strstart += ie, x.insert += ie > x.w_size - x.insert ? x.w_size - x.insert : ie), x.high_water < x.strstart && (x.high_water = x.strstart), ie = x.bi_valid + 42 >> 3, ie = x.pending_buf_size - ie > 65535 ? 65535 : x.pending_buf_size - ie, O = ie > x.w_size ? x.w_size : ie, ne = x.strstart - x.block_start, (ne >= O || (ne || H === rt) && H !== je && x.strm.avail_in === 0 && ne <= ie) && (q = ne > ie ? ie : ne, Pe = H === rt && x.strm.avail_in === 0 && q === ne ? 1 : 0, fe(x, x.block_start, q, Pe), x.block_start += q, It(x.strm)), Pe ? Vt : Dt); + }, Fr = (x, H) => { + let O, q; for (; ; ) { if (x.lookahead < pt) { - if (sr(x), x.lookahead < pt && W === je) + if (sr(x), x.lookahead < pt && H === je) return Dt; if (x.lookahead === 0) break; } if (O = 0, x.lookahead >= at && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart), O !== 0 && x.strstart - O <= x.w_size - pt && (x.match_length = Qr(x, O)), x.match_length >= at) - if (J = Ze(x, x.strstart - x.match_start, x.match_length - at), x.lookahead -= x.match_length, x.match_length <= x.max_lazy_match && x.lookahead >= at) { + if (q = Ze(x, x.strstart - x.match_start, x.match_length - at), x.lookahead -= x.match_length, x.match_length <= x.max_lazy_match && x.lookahead >= at) { x.match_length--; do x.strstart++, x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart; @@ -23627,70 +23627,70 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } else x.strstart += x.match_length, x.match_length = 0, x.ins_h = x.window[x.strstart], x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + 1]); else - J = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++; - if (J && (Rt(x, !1), x.strm.avail_out === 0)) + q = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++; + if (q && ($t(x, !1), x.strm.avail_out === 0)) return Dt; } - return x.insert = x.strstart < at - 1 ? x.strstart : at - 1, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; - }, ar = (x, W) => { - let O, J, ie; + return x.insert = x.strstart < at - 1 ? x.strstart : at - 1, H === rt ? ($t(x, !0), x.strm.avail_out === 0 ? Vt : nr) : x.sym_next && ($t(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, ar = (x, H) => { + let O, q, ne; for (; ; ) { if (x.lookahead < pt) { - if (sr(x), x.lookahead < pt && W === je) + if (sr(x), x.lookahead < pt && H === je) return Dt; if (x.lookahead === 0) break; } if (O = 0, x.lookahead >= at && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart), x.prev_length = x.match_length, x.prev_match = x.match_start, x.match_length = at - 1, O !== 0 && x.prev_length < x.max_lazy_match && x.strstart - O <= x.w_size - pt && (x.match_length = Qr(x, O), x.match_length <= 5 && (x.strategy === bt || x.match_length === at && x.strstart - x.match_start > 4096) && (x.match_length = at - 1)), x.prev_length >= at && x.match_length <= x.prev_length) { - ie = x.strstart + x.lookahead - at, J = Ze(x, x.strstart - 1 - x.prev_match, x.prev_length - at), x.lookahead -= x.prev_length - 1, x.prev_length -= 2; + ne = x.strstart + x.lookahead - at, q = Ze(x, x.strstart - 1 - x.prev_match, x.prev_length - at), x.lookahead -= x.prev_length - 1, x.prev_length -= 2; do - ++x.strstart <= ie && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart); + ++x.strstart <= ne && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart); while (--x.prev_length !== 0); - if (x.match_available = 0, x.match_length = at - 1, x.strstart++, J && (Rt(x, !1), x.strm.avail_out === 0)) + if (x.match_available = 0, x.match_length = at - 1, x.strstart++, q && ($t(x, !1), x.strm.avail_out === 0)) return Dt; } else if (x.match_available) { - if (J = Ze(x, 0, x.window[x.strstart - 1]), J && Rt(x, !1), x.strstart++, x.lookahead--, x.strm.avail_out === 0) + if (q = Ze(x, 0, x.window[x.strstart - 1]), q && $t(x, !1), x.strstart++, x.lookahead--, x.strm.avail_out === 0) return Dt; } else x.match_available = 1, x.strstart++, x.lookahead--; } - return x.match_available && (J = Ze(x, 0, x.window[x.strstart - 1]), x.match_available = 0), x.insert = x.strstart < at - 1 ? x.strstart : at - 1, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; - }, an = (x, W) => { - let O, J, ie, te; - const De = x.window; + return x.match_available && (q = Ze(x, 0, x.window[x.strstart - 1]), x.match_available = 0), x.insert = x.strstart < at - 1 ? x.strstart : at - 1, H === rt ? ($t(x, !0), x.strm.avail_out === 0 ? Vt : nr) : x.sym_next && ($t(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, an = (x, H) => { + let O, q, ne, ie; + const Pe = x.window; for (; ; ) { if (x.lookahead <= Bt) { - if (sr(x), x.lookahead <= Bt && W === je) + if (sr(x), x.lookahead <= Bt && H === je) return Dt; if (x.lookahead === 0) break; } - if (x.match_length = 0, x.lookahead >= at && x.strstart > 0 && (ie = x.strstart - 1, J = De[ie], J === De[++ie] && J === De[++ie] && J === De[++ie])) { - te = x.strstart + Bt; + if (x.match_length = 0, x.lookahead >= at && x.strstart > 0 && (ne = x.strstart - 1, q = Pe[ne], q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne])) { + ie = x.strstart + Bt; do ; - while (J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && ie < te); - x.match_length = Bt - (te - ie), x.match_length > x.lookahead && (x.match_length = x.lookahead); + while (q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && q === Pe[++ne] && ne < ie); + x.match_length = Bt - (ie - ne), x.match_length > x.lookahead && (x.match_length = x.lookahead); } - if (x.match_length >= at ? (O = Ze(x, 1, x.match_length - at), x.lookahead -= x.match_length, x.strstart += x.match_length, x.match_length = 0) : (O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++), O && (Rt(x, !1), x.strm.avail_out === 0)) + if (x.match_length >= at ? (O = Ze(x, 1, x.match_length - at), x.lookahead -= x.match_length, x.strstart += x.match_length, x.match_length = 0) : (O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++), O && ($t(x, !1), x.strm.avail_out === 0)) return Dt; } - return x.insert = 0, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; - }, on = (x, W) => { + return x.insert = 0, H === rt ? ($t(x, !0), x.strm.avail_out === 0 ? Vt : nr) : x.sym_next && ($t(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, on = (x, H) => { let O; for (; ; ) { if (x.lookahead === 0 && (sr(x), x.lookahead === 0)) { - if (W === je) + if (H === je) return Dt; break; } - if (x.match_length = 0, O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++, O && (Rt(x, !1), x.strm.avail_out === 0)) + if (x.match_length = 0, O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++, O && ($t(x, !1), x.strm.avail_out === 0)) return Dt; } - return x.insert = 0, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; + return x.insert = 0, H === rt ? ($t(x, !0), x.strm.avail_out === 0 ? Vt : nr) : x.sym_next && ($t(x, !1), x.strm.avail_out === 0) ? Dt : ir; }; - function zt(x, W, O, J, ie) { - this.good_length = x, this.max_lazy = W, this.nice_length = O, this.max_chain = J, this.func = ie; + function zt(x, H, O, q, ne) { + this.good_length = x, this.max_lazy = H, this.nice_length = O, this.max_chain = q, this.func = ne; } const cr = [ /* good lazy nice chain */ @@ -23723,49 +23723,49 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; const ur = (x) => { if (!x) return 1; - const W = x.state; - return !W || W.strm !== x || W.status !== At && //#ifdef GZIP - W.status !== rr && //#endif - W.status !== Rr && W.status !== $r && W.status !== Br && W.status !== zr && W.status !== Vt && W.status !== hr ? 1 : 0; + const H = x.state; + return !H || H.strm !== x || H.status !== At && //#ifdef GZIP + H.status !== rr && //#endif + H.status !== $r && H.status !== Rr && H.status !== Br && H.status !== zr && H.status !== Ht && H.status !== fr ? 1 : 0; }, qr = (x) => { if (ur(x)) - return Kt(x, lt); - x.total_in = x.total_out = 0, x.data_type = Qt; - const W = x.state; - return W.pending = 0, W.pending_out = 0, W.wrap < 0 && (W.wrap = -W.wrap), W.status = //#ifdef GZIP - W.wrap === 2 ? rr : ( + return jt(x, lt); + x.total_in = x.total_out = 0, x.data_type = Xt; + const H = x.state; + return H.pending = 0, H.pending_out = 0, H.wrap < 0 && (H.wrap = -H.wrap), H.status = //#ifdef GZIP + H.wrap === 2 ? rr : ( //#endif - W.wrap ? At : Vt - ), x.adler = W.wrap === 2 ? 0 : 1, W.last_flush = -2, X(W), tt; + H.wrap ? At : Ht + ), x.adler = H.wrap === 2 ? 0 : 1, H.last_flush = -2, Q(H), tt; }, ei = (x) => { - const W = qr(x); - return W === tt && ln(x.state), W; - }, cn = (x, W) => ur(x) || x.state.wrap !== 2 ? lt : (x.state.gzhead = W, tt), ti = (x, W, O, J, ie, te) => { + const H = qr(x); + return H === tt && ln(x.state), H; + }, cn = (x, H) => ur(x) || x.state.wrap !== 2 ? lt : (x.state.gzhead = H, tt), ti = (x, H, O, q, ne, ie) => { if (!x) return lt; - let De = 1; - if (W === vt && (W = 6), J < 0 ? (De = 0, J = -J) : J > 15 && (De = 2, J -= 16), ie < 1 || ie > Jt || O !== Ft || J < 8 || J > 15 || W < 0 || W > 9 || te < 0 || te > Ot || J === 8 && De !== 1) - return Kt(x, lt); - J === 8 && (J = 9); - const xe = new hn(); - return x.state = xe, xe.strm = x, xe.status = At, xe.wrap = De, xe.gzhead = null, xe.w_bits = J, xe.w_size = 1 << xe.w_bits, xe.w_mask = xe.w_size - 1, xe.hash_bits = ie + 7, xe.hash_size = 1 << xe.hash_bits, xe.hash_mask = xe.hash_size - 1, xe.hash_shift = ~~((xe.hash_bits + at - 1) / at), xe.window = new Uint8Array(xe.w_size * 2), xe.head = new Uint16Array(xe.hash_size), xe.prev = new Uint16Array(xe.w_size), xe.lit_bufsize = 1 << ie + 6, xe.pending_buf_size = xe.lit_bufsize * 4, xe.pending_buf = new Uint8Array(xe.pending_buf_size), xe.sym_buf = xe.lit_bufsize, xe.sym_end = (xe.lit_bufsize - 1) * 3, xe.level = W, xe.strategy = te, xe.method = O, ei(x); - }, un = (x, W) => ti(x, W, Ft, qt, er, kt), dn = (x, W) => { - if (ur(x) || W > it || W < 0) - return x ? Kt(x, lt) : lt; + let Pe = 1; + if (H === vt && (H = 6), q < 0 ? (Pe = 0, q = -q) : q > 15 && (Pe = 2, q -= 16), ne < 1 || ne > Qt || O !== Ft || q < 8 || q > 15 || H < 0 || H > 9 || ie < 0 || ie > Ot || q === 8 && Pe !== 1) + return jt(x, lt); + q === 8 && (q = 9); + const we = new hn(); + return x.state = we, we.strm = x, we.status = At, we.wrap = Pe, we.gzhead = null, we.w_bits = q, we.w_size = 1 << we.w_bits, we.w_mask = we.w_size - 1, we.hash_bits = ne + 7, we.hash_size = 1 << we.hash_bits, we.hash_mask = we.hash_size - 1, we.hash_shift = ~~((we.hash_bits + at - 1) / at), we.window = new Uint8Array(we.w_size * 2), we.head = new Uint16Array(we.hash_size), we.prev = new Uint16Array(we.w_size), we.lit_bufsize = 1 << ne + 6, we.pending_buf_size = we.lit_bufsize * 4, we.pending_buf = new Uint8Array(we.pending_buf_size), we.sym_buf = we.lit_bufsize, we.sym_end = (we.lit_bufsize - 1) * 3, we.level = H, we.strategy = ie, we.method = O, ei(x); + }, un = (x, H) => ti(x, H, Ft, Jt, qt, kt), dn = (x, H) => { + if (ur(x) || H > it || H < 0) + return x ? jt(x, lt) : lt; const O = x.state; - if (!x.output || x.avail_in !== 0 && !x.input || O.status === hr && W !== rt) - return Kt(x, x.avail_out === 0 ? Pt : lt); - const J = O.last_flush; - if (O.last_flush = W, O.pending !== 0) { + if (!x.output || x.avail_in !== 0 && !x.input || O.status === fr && H !== rt) + return jt(x, x.avail_out === 0 ? Pt : lt); + const q = O.last_flush; + if (O.last_flush = H, O.pending !== 0) { if (It(x), x.avail_out === 0) return O.last_flush = -1, tt; - } else if (x.avail_in === 0 && Xr(W) <= Xr(J) && W !== rt) - return Kt(x, Pt); - if (O.status === hr && x.avail_in !== 0) - return Kt(x, Pt); - if (O.status === At && O.wrap === 0 && (O.status = Vt), O.status === At) { - let ie = Ft + (O.w_bits - 8 << 4) << 8, te = -1; - if (O.strategy >= mt || O.level < 2 ? te = 0 : O.level < 6 ? te = 1 : O.level === 6 ? te = 2 : te = 3, ie |= te << 6, O.strstart !== 0 && (ie |= yt), ie += 31 - ie % 31, fr(O, ie), O.strstart !== 0 && (fr(O, x.adler >>> 16), fr(O, x.adler & 65535)), x.adler = 1, O.status = Vt, It(x), O.pending !== 0) + } else if (x.avail_in === 0 && Xr(H) <= Xr(q) && H !== rt) + return jt(x, Pt); + if (O.status === fr && x.avail_in !== 0) + return jt(x, Pt); + if (O.status === At && O.wrap === 0 && (O.status = Ht), O.status === At) { + let ne = Ft + (O.w_bits - 8 << 4) << 8, ie = -1; + if (O.strategy >= mt || O.level < 2 ? ie = 0 : O.level < 6 ? ie = 1 : O.level === 6 ? ie = 2 : ie = 3, ne |= ie << 6, O.strstart !== 0 && (ne |= yt), ne += 31 - ne % 31, hr(O, ne), O.strstart !== 0 && (hr(O, x.adler >>> 16), hr(O, x.adler & 65535)), x.adler = 1, O.status = Ht, It(x), O.pending !== 0) return O.last_flush = -1, tt; } if (O.status === rr) { @@ -23773,51 +23773,51 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; dt( O, (O.gzhead.text ? 1 : 0) + (O.gzhead.hcrc ? 2 : 0) + (O.gzhead.extra ? 4 : 0) + (O.gzhead.name ? 8 : 0) + (O.gzhead.comment ? 16 : 0) - ), dt(O, O.gzhead.time & 255), dt(O, O.gzhead.time >> 8 & 255), dt(O, O.gzhead.time >> 16 & 255), dt(O, O.gzhead.time >> 24 & 255), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (dt(O, O.gzhead.extra.length & 255), dt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (x.adler = R(x.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Rr; - else if (dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, nn), O.status = Vt, It(x), O.pending !== 0) + ), dt(O, O.gzhead.time & 255), dt(O, O.gzhead.time >> 8 & 255), dt(O, O.gzhead.time >> 16 & 255), dt(O, O.gzhead.time >> 24 & 255), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (dt(O, O.gzhead.extra.length & 255), dt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (x.adler = $(x.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = $r; + else if (dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, nn), O.status = Ht, It(x), O.pending !== 0) return O.last_flush = -1, tt; } - if (O.status === Rr) { + if (O.status === $r) { if (O.gzhead.extra) { - let ie = O.pending, te = (O.gzhead.extra.length & 65535) - O.gzindex; - for (; O.pending + te > O.pending_buf_size; ) { - let xe = O.pending_buf_size - O.pending; - if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + xe), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex += xe, It(x), O.pending !== 0) + let ne = O.pending, ie = (O.gzhead.extra.length & 65535) - O.gzindex; + for (; O.pending + ie > O.pending_buf_size; ) { + let we = O.pending_buf_size - O.pending; + if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + we), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)), O.gzindex += we, It(x), O.pending !== 0) return O.last_flush = -1, tt; - ie = 0, te -= xe; + ne = 0, ie -= we; } - let De = new Uint8Array(O.gzhead.extra); - O.pending_buf.set(De.subarray(O.gzindex, O.gzindex + te), O.pending), O.pending += te, O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; + let Pe = new Uint8Array(O.gzhead.extra); + O.pending_buf.set(Pe.subarray(O.gzindex, O.gzindex + ie), O.pending), O.pending += ie, O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)), O.gzindex = 0; } - O.status = $r; + O.status = Rr; } - if (O.status === $r) { + if (O.status === Rr) { if (O.gzhead.name) { - let ie = O.pending, te; + let ne = O.pending, ie; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), It(x), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)), It(x), O.pending !== 0) return O.last_flush = -1, tt; - ie = 0; + ne = 0; } - O.gzindex < O.gzhead.name.length ? te = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : te = 0, dt(O, te); - } while (te !== 0); - O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; + O.gzindex < O.gzhead.name.length ? ie = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : ie = 0, dt(O, ie); + } while (ie !== 0); + O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)), O.gzindex = 0; } O.status = Br; } if (O.status === Br) { if (O.gzhead.comment) { - let ie = O.pending, te; + let ne = O.pending, ie; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), It(x), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)), It(x), O.pending !== 0) return O.last_flush = -1, tt; - ie = 0; + ne = 0; } - O.gzindex < O.gzhead.comment.length ? te = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : te = 0, dt(O, te); - } while (te !== 0); - O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)); + O.gzindex < O.gzhead.comment.length ? ie = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : ie = 0, dt(O, ie); + } while (ie !== 0); + O.gzhead.hcrc && O.pending > ne && (x.adler = $(x.adler, O.pending_buf, O.pending - ne, ne)); } O.status = zr; } @@ -23827,43 +23827,43 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return O.last_flush = -1, tt; dt(O, x.adler & 255), dt(O, x.adler >> 8 & 255), x.adler = 0; } - if (O.status = Vt, It(x), O.pending !== 0) + if (O.status = Ht, It(x), O.pending !== 0) return O.last_flush = -1, tt; } - if (x.avail_in !== 0 || O.lookahead !== 0 || W !== je && O.status !== hr) { - let ie = O.level === 0 ? Jr(O, W) : O.strategy === mt ? on(O, W) : O.strategy === Tt ? an(O, W) : cr[O.level].func(O, W); - if ((ie === jt || ie === nr) && (O.status = hr), ie === Dt || ie === jt) + if (x.avail_in !== 0 || O.lookahead !== 0 || H !== je && O.status !== fr) { + let ne = O.level === 0 ? Jr(O, H) : O.strategy === mt ? on(O, H) : O.strategy === Tt ? an(O, H) : cr[O.level].func(O, H); + if ((ne === Vt || ne === nr) && (O.status = fr), ne === Dt || ne === Vt) return x.avail_out === 0 && (O.last_flush = -1), tt; - if (ie === ir && (W === Je ? Ke(O) : W !== it && (le(O, 0, 0, !1), W === Lt && (Gt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), It(x), x.avail_out === 0)) + if (ne === ir && (H === Je ? Ke(O) : H !== it && (fe(O, 0, 0, !1), H === St && (Gt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), It(x), x.avail_out === 0)) return O.last_flush = -1, tt; } - return W !== rt ? tt : O.wrap <= 0 ? Et : (O.wrap === 2 ? (dt(O, x.adler & 255), dt(O, x.adler >> 8 & 255), dt(O, x.adler >> 16 & 255), dt(O, x.adler >> 24 & 255), dt(O, x.total_in & 255), dt(O, x.total_in >> 8 & 255), dt(O, x.total_in >> 16 & 255), dt(O, x.total_in >> 24 & 255)) : (fr(O, x.adler >>> 16), fr(O, x.adler & 65535)), It(x), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : Et); + return H !== rt ? tt : O.wrap <= 0 ? Et : (O.wrap === 2 ? (dt(O, x.adler & 255), dt(O, x.adler >> 8 & 255), dt(O, x.adler >> 16 & 255), dt(O, x.adler >> 24 & 255), dt(O, x.total_in & 255), dt(O, x.total_in >> 8 & 255), dt(O, x.total_in >> 16 & 255), dt(O, x.total_in >> 24 & 255)) : (hr(O, x.adler >>> 16), hr(O, x.adler & 65535)), It(x), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : Et); }, _n = (x) => { if (ur(x)) return lt; - const W = x.state.status; - return x.state = null, W === Vt ? Kt(x, wt) : tt; - }, pn = (x, W) => { - let O = W.length; + const H = x.state.status; + return x.state = null, H === Ht ? jt(x, wt) : tt; + }, pn = (x, H) => { + let O = H.length; if (ur(x)) return lt; - const J = x.state, ie = J.wrap; - if (ie === 2 || ie === 1 && J.status !== At || J.lookahead) + const q = x.state, ne = q.wrap; + if (ne === 2 || ne === 1 && q.status !== At || q.lookahead) return lt; - if (ie === 1 && (x.adler = Oe(x.adler, W, O, 0)), J.wrap = 0, O >= J.w_size) { - ie === 0 && (Gt(J.head), J.strstart = 0, J.block_start = 0, J.insert = 0); - let Qe = new Uint8Array(J.w_size); - Qe.set(W.subarray(O - J.w_size, O), 0), W = Qe, O = J.w_size; - } - const te = x.avail_in, De = x.next_in, xe = x.input; - for (x.avail_in = O, x.next_in = 0, x.input = W, sr(J); J.lookahead >= at; ) { - let Qe = J.strstart, _e = J.lookahead - (at - 1); + if (ne === 1 && (x.adler = De(x.adler, H, O, 0)), q.wrap = 0, O >= q.w_size) { + ne === 0 && (Gt(q.head), q.strstart = 0, q.block_start = 0, q.insert = 0); + let Qe = new Uint8Array(q.w_size); + Qe.set(H.subarray(O - q.w_size, O), 0), H = Qe, O = q.w_size; + } + const ie = x.avail_in, Pe = x.next_in, we = x.input; + for (x.avail_in = O, x.next_in = 0, x.input = H, sr(q); q.lookahead >= at; ) { + let Qe = q.strstart, me = q.lookahead - (at - 1); do - J.ins_h = Wt(J, J.ins_h, J.window[Qe + at - 1]), J.prev[Qe & J.w_mask] = J.head[J.ins_h], J.head[J.ins_h] = Qe, Qe++; - while (--_e); - J.strstart = Qe, J.lookahead = at - 1, sr(J); + q.ins_h = Wt(q, q.ins_h, q.window[Qe + at - 1]), q.prev[Qe & q.w_mask] = q.head[q.ins_h], q.head[q.ins_h] = Qe, Qe++; + while (--me); + q.strstart = Qe, q.lookahead = at - 1, sr(q); } - return J.strstart += J.lookahead, J.block_start = J.strstart, J.insert = J.lookahead, J.lookahead = 0, J.match_length = J.prev_length = at - 1, J.match_available = 0, x.next_in = De, x.input = xe, x.avail_in = te, J.wrap = ie, tt; + return q.strstart += q.lookahead, q.block_start = q.strstart, q.insert = q.lookahead, q.lookahead = 0, q.match_length = q.prev_length = at - 1, q.match_available = 0, x.next_in = Pe, x.input = we, x.avail_in = ie, q.wrap = ne, tt; }; var gn = un, mn = ti, vn = ei, bn = qr, yn = cn, xn = dn, En = _n, wn = pn, An = "pako deflate (from Nodeca project)", dr = { deflateInit: gn, @@ -23876,32 +23876,32 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; deflateSetDictionary: wn, deflateInfo: An }; - const Mn = (x, W) => Object.prototype.hasOwnProperty.call(x, W); + const Mn = (x, H) => Object.prototype.hasOwnProperty.call(x, H); var Cn = function(x) { - const W = Array.prototype.slice.call(arguments, 1); - for (; W.length; ) { - const O = W.shift(); + const H = Array.prototype.slice.call(arguments, 1); + for (; H.length; ) { + const O = H.shift(); if (O) { if (typeof O != "object") throw new TypeError(O + "must be non-object"); - for (const J in O) - Mn(O, J) && (x[J] = O[J]); + for (const q in O) + Mn(O, q) && (x[q] = O[q]); } } return x; - }, Ln = (x) => { - let W = 0; - for (let J = 0, ie = x.length; J < ie; J++) - W += x[J].length; - const O = new Uint8Array(W); - for (let J = 0, ie = 0, te = x.length; J < te; J++) { - let De = x[J]; - O.set(De, ie), ie += De.length; + }, Sn = (x) => { + let H = 0; + for (let q = 0, ne = x.length; q < ne; q++) + H += x[q].length; + const O = new Uint8Array(H); + for (let q = 0, ne = 0, ie = x.length; q < ie; q++) { + let Pe = x[q]; + O.set(Pe, ne), ne += Pe.length; } return O; }, yr = { assign: Cn, - flattenChunks: Ln + flattenChunks: Sn }; let ri = !0; try { @@ -23913,58 +23913,58 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (let x = 0; x < 256; x++) _r[x] = x >= 252 ? 6 : x >= 248 ? 5 : x >= 240 ? 4 : x >= 224 ? 3 : x >= 192 ? 2 : 1; _r[254] = _r[254] = 1; - var Sn = (x) => { + var Ln = (x) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) return new TextEncoder().encode(x); - let W, O, J, ie, te, De = x.length, xe = 0; - for (ie = 0; ie < De; ie++) - O = x.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = x.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), xe += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; - for (W = new Uint8Array(xe), te = 0, ie = 0; te < xe; ie++) - O = x.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = x.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), O < 128 ? W[te++] = O : O < 2048 ? (W[te++] = 192 | O >>> 6, W[te++] = 128 | O & 63) : O < 65536 ? (W[te++] = 224 | O >>> 12, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63) : (W[te++] = 240 | O >>> 18, W[te++] = 128 | O >>> 12 & 63, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63); - return W; + let H, O, q, ne, ie, Pe = x.length, we = 0; + for (ne = 0; ne < Pe; ne++) + O = x.charCodeAt(ne), (O & 64512) === 55296 && ne + 1 < Pe && (q = x.charCodeAt(ne + 1), (q & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (q - 56320), ne++)), we += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; + for (H = new Uint8Array(we), ie = 0, ne = 0; ie < we; ne++) + O = x.charCodeAt(ne), (O & 64512) === 55296 && ne + 1 < Pe && (q = x.charCodeAt(ne + 1), (q & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (q - 56320), ne++)), O < 128 ? H[ie++] = O : O < 2048 ? (H[ie++] = 192 | O >>> 6, H[ie++] = 128 | O & 63) : O < 65536 ? (H[ie++] = 224 | O >>> 12, H[ie++] = 128 | O >>> 6 & 63, H[ie++] = 128 | O & 63) : (H[ie++] = 240 | O >>> 18, H[ie++] = 128 | O >>> 12 & 63, H[ie++] = 128 | O >>> 6 & 63, H[ie++] = 128 | O & 63); + return H; }; - const Tn = (x, W) => { - if (W < 65534 && x.subarray && ri) - return String.fromCharCode.apply(null, x.length === W ? x : x.subarray(0, W)); + const Tn = (x, H) => { + if (H < 65534 && x.subarray && ri) + return String.fromCharCode.apply(null, x.length === H ? x : x.subarray(0, H)); let O = ""; - for (let J = 0; J < W; J++) - O += String.fromCharCode(x[J]); + for (let q = 0; q < H; q++) + O += String.fromCharCode(x[q]); return O; }; - var On = (x, W) => { - const O = W || x.length; + var On = (x, H) => { + const O = H || x.length; if (typeof TextDecoder == "function" && TextDecoder.prototype.decode) - return new TextDecoder().decode(x.subarray(0, W)); - let J, ie; - const te = new Array(O * 2); - for (ie = 0, J = 0; J < O; ) { - let De = x[J++]; - if (De < 128) { - te[ie++] = De; + return new TextDecoder().decode(x.subarray(0, H)); + let q, ne; + const ie = new Array(O * 2); + for (ne = 0, q = 0; q < O; ) { + let Pe = x[q++]; + if (Pe < 128) { + ie[ne++] = Pe; continue; } - let xe = _r[De]; - if (xe > 4) { - te[ie++] = 65533, J += xe - 1; + let we = _r[Pe]; + if (we > 4) { + ie[ne++] = 65533, q += we - 1; continue; } - for (De &= xe === 2 ? 31 : xe === 3 ? 15 : 7; xe > 1 && J < O; ) - De = De << 6 | x[J++] & 63, xe--; - if (xe > 1) { - te[ie++] = 65533; + for (Pe &= we === 2 ? 31 : we === 3 ? 15 : 7; we > 1 && q < O; ) + Pe = Pe << 6 | x[q++] & 63, we--; + if (we > 1) { + ie[ne++] = 65533; continue; } - De < 65536 ? te[ie++] = De : (De -= 65536, te[ie++] = 55296 | De >> 10 & 1023, te[ie++] = 56320 | De & 1023); + Pe < 65536 ? ie[ne++] = Pe : (Pe -= 65536, ie[ne++] = 55296 | Pe >> 10 & 1023, ie[ne++] = 56320 | Pe & 1023); } - return Tn(te, ie); - }, Dn = (x, W) => { - W = W || x.length, W > x.length && (W = x.length); - let O = W - 1; + return Tn(ie, ne); + }, Dn = (x, H) => { + H = H || x.length, H > x.length && (H = x.length); + let O = H - 1; for (; O >= 0 && (x[O] & 192) === 128; ) O--; - return O < 0 || O === 0 ? W : O + _r[x[O]] > W ? O : W; + return O < 0 || O === 0 ? H : O + _r[x[O]] > H ? O : H; }, pr = { - string2buf: Sn, + string2buf: Ln, buf2string: On, utf8border: Dn }; @@ -23974,15 +23974,15 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var ii = Pn; const ni = Object.prototype.toString, { Z_NO_FLUSH: In, - Z_SYNC_FLUSH: Rn, - Z_FULL_FLUSH: $n, + Z_SYNC_FLUSH: $n, + Z_FULL_FLUSH: Rn, Z_FINISH: Bn, Z_OK: xr, Z_STREAM_END: zn, Z_DEFAULT_COMPRESSION: kn, Z_DEFAULT_STRATEGY: Fn, Z_DEFLATED: Un - } = Ee; + } = Me; function gr(x) { this.options = yr.assign({ level: kn, @@ -23992,42 +23992,42 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; memLevel: 8, strategy: Fn }, x || {}); - let W = this.options; - W.raw && W.windowBits > 0 ? W.windowBits = -W.windowBits : W.gzip && W.windowBits > 0 && W.windowBits < 16 && (W.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; + let H = this.options; + H.raw && H.windowBits > 0 ? H.windowBits = -H.windowBits : H.gzip && H.windowBits > 0 && H.windowBits < 16 && (H.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; let O = dr.deflateInit2( this.strm, - W.level, - W.method, - W.windowBits, - W.memLevel, - W.strategy + H.level, + H.method, + H.windowBits, + H.memLevel, + H.strategy ); if (O !== xr) - throw new Error(be[O]); - if (W.header && dr.deflateSetHeader(this.strm, W.header), W.dictionary) { - let J; - if (typeof W.dictionary == "string" ? J = pr.string2buf(W.dictionary) : ni.call(W.dictionary) === "[object ArrayBuffer]" ? J = new Uint8Array(W.dictionary) : J = W.dictionary, O = dr.deflateSetDictionary(this.strm, J), O !== xr) - throw new Error(be[O]); + throw new Error(xe[O]); + if (H.header && dr.deflateSetHeader(this.strm, H.header), H.dictionary) { + let q; + if (typeof H.dictionary == "string" ? q = pr.string2buf(H.dictionary) : ni.call(H.dictionary) === "[object ArrayBuffer]" ? q = new Uint8Array(H.dictionary) : q = H.dictionary, O = dr.deflateSetDictionary(this.strm, q), O !== xr) + throw new Error(xe[O]); this._dict_set = !0; } } - gr.prototype.push = function(x, W) { - const O = this.strm, J = this.options.chunkSize; - let ie, te; + gr.prototype.push = function(x, H) { + const O = this.strm, q = this.options.chunkSize; + let ne, ie; if (this.ended) return !1; - for (W === ~~W ? te = W : te = W === !0 ? Bn : In, typeof x == "string" ? O.input = pr.string2buf(x) : ni.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { - if (O.avail_out === 0 && (O.output = new Uint8Array(J), O.next_out = 0, O.avail_out = J), (te === Rn || te === $n) && O.avail_out <= 6) { + for (H === ~~H ? ie = H : ie = H === !0 ? Bn : In, typeof x == "string" ? O.input = pr.string2buf(x) : ni.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { + if (O.avail_out === 0 && (O.output = new Uint8Array(q), O.next_out = 0, O.avail_out = q), (ie === $n || ie === Rn) && O.avail_out <= 6) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } - if (ie = dr.deflate(O, te), ie === zn) - return O.next_out > 0 && this.onData(O.output.subarray(0, O.next_out)), ie = dr.deflateEnd(this.strm), this.onEnd(ie), this.ended = !0, ie === xr; + if (ne = dr.deflate(O, ie), ne === zn) + return O.next_out > 0 && this.onData(O.output.subarray(0, O.next_out)), ne = dr.deflateEnd(this.strm), this.onEnd(ne), this.ended = !0, ne === xr; if (O.avail_out === 0) { this.onData(O.output); continue; } - if (te > 0 && O.next_out > 0) { + if (ie > 0 && O.next_out > 0) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } @@ -24040,19 +24040,19 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, gr.prototype.onEnd = function(x) { x === xr && (this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = x, this.msg = this.strm.msg; }; - function Ur(x, W) { - const O = new gr(W); + function Ur(x, H) { + const O = new gr(H); if (O.push(x, !0), O.err) - throw O.msg || be[O.err]; + throw O.msg || xe[O.err]; return O.result; } - function Nn(x, W) { - return W = W || {}, W.raw = !0, Ur(x, W); + function Nn(x, H) { + return H = H || {}, H.raw = !0, Ur(x, H); } - function Gn(x, W) { - return W = W || {}, W.gzip = !0, Ur(x, W); + function Gn(x, H) { + return H = H || {}, H.gzip = !0, Ur(x, H); } - var Wn = gr, Hn = Ur, Vn = Nn, jn = Gn, Kn = Ee, Zn = { + var Wn = gr, Hn = Ur, Vn = Nn, jn = Gn, Kn = Me, Zn = { Deflate: Wn, deflate: Hn, deflateRaw: Vn, @@ -24060,95 +24060,95 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; constants: Kn }; const Er = 16209, Yn = 16191; - var Xn = function(W, O) { - let J, ie, te, De, xe, Qe, _e, Pe, ut, Xe, Ge, qe, Ct, ft, st, gt, ot, Ye, _t, St, et, xt, ct, nt; - const ht = W.state; - J = W.next_in, ct = W.input, ie = J + (W.avail_in - 5), te = W.next_out, nt = W.output, De = te - (O - W.avail_out), xe = te + (W.avail_out - 257), Qe = ht.dmax, _e = ht.wsize, Pe = ht.whave, ut = ht.wnext, Xe = ht.window, Ge = ht.hold, qe = ht.bits, Ct = ht.lencode, ft = ht.distcode, st = (1 << ht.lenbits) - 1, gt = (1 << ht.distbits) - 1; + var Xn = function(H, O) { + let q, ne, ie, Pe, we, Qe, me, Ie, ut, Xe, He, qe, Ct, ht, st, gt, ot, Ye, _t, Lt, et, xt, ct, nt; + const ft = H.state; + q = H.next_in, ct = H.input, ne = q + (H.avail_in - 5), ie = H.next_out, nt = H.output, Pe = ie - (O - H.avail_out), we = ie + (H.avail_out - 257), Qe = ft.dmax, me = ft.wsize, Ie = ft.whave, ut = ft.wnext, Xe = ft.window, He = ft.hold, qe = ft.bits, Ct = ft.lencode, ht = ft.distcode, st = (1 << ft.lenbits) - 1, gt = (1 << ft.distbits) - 1; e: do { - qe < 15 && (Ge += ct[J++] << qe, qe += 8, Ge += ct[J++] << qe, qe += 8), ot = Ct[Ge & st]; + qe < 15 && (He += ct[q++] << qe, qe += 8, He += ct[q++] << qe, qe += 8), ot = Ct[He & st]; t: for (; ; ) { - if (Ye = ot >>> 24, Ge >>>= Ye, qe -= Ye, Ye = ot >>> 16 & 255, Ye === 0) - nt[te++] = ot & 65535; + if (Ye = ot >>> 24, He >>>= Ye, qe -= Ye, Ye = ot >>> 16 & 255, Ye === 0) + nt[ie++] = ot & 65535; else if (Ye & 16) { - _t = ot & 65535, Ye &= 15, Ye && (qe < Ye && (Ge += ct[J++] << qe, qe += 8), _t += Ge & (1 << Ye) - 1, Ge >>>= Ye, qe -= Ye), qe < 15 && (Ge += ct[J++] << qe, qe += 8, Ge += ct[J++] << qe, qe += 8), ot = ft[Ge & gt]; + _t = ot & 65535, Ye &= 15, Ye && (qe < Ye && (He += ct[q++] << qe, qe += 8), _t += He & (1 << Ye) - 1, He >>>= Ye, qe -= Ye), qe < 15 && (He += ct[q++] << qe, qe += 8, He += ct[q++] << qe, qe += 8), ot = ht[He & gt]; r: for (; ; ) { - if (Ye = ot >>> 24, Ge >>>= Ye, qe -= Ye, Ye = ot >>> 16 & 255, Ye & 16) { - if (St = ot & 65535, Ye &= 15, qe < Ye && (Ge += ct[J++] << qe, qe += 8, qe < Ye && (Ge += ct[J++] << qe, qe += 8)), St += Ge & (1 << Ye) - 1, St > Qe) { - W.msg = "invalid distance too far back", ht.mode = Er; + if (Ye = ot >>> 24, He >>>= Ye, qe -= Ye, Ye = ot >>> 16 & 255, Ye & 16) { + if (Lt = ot & 65535, Ye &= 15, qe < Ye && (He += ct[q++] << qe, qe += 8, qe < Ye && (He += ct[q++] << qe, qe += 8)), Lt += He & (1 << Ye) - 1, Lt > Qe) { + H.msg = "invalid distance too far back", ft.mode = Er; break e; } - if (Ge >>>= Ye, qe -= Ye, Ye = te - De, St > Ye) { - if (Ye = St - Ye, Ye > Pe && ht.sane) { - W.msg = "invalid distance too far back", ht.mode = Er; + if (He >>>= Ye, qe -= Ye, Ye = ie - Pe, Lt > Ye) { + if (Ye = Lt - Ye, Ye > Ie && ft.sane) { + H.msg = "invalid distance too far back", ft.mode = Er; break e; } if (et = 0, xt = Xe, ut === 0) { - if (et += _e - Ye, Ye < _t) { + if (et += me - Ye, Ye < _t) { _t -= Ye; do - nt[te++] = Xe[et++]; + nt[ie++] = Xe[et++]; while (--Ye); - et = te - St, xt = nt; + et = ie - Lt, xt = nt; } } else if (ut < Ye) { - if (et += _e + ut - Ye, Ye -= ut, Ye < _t) { + if (et += me + ut - Ye, Ye -= ut, Ye < _t) { _t -= Ye; do - nt[te++] = Xe[et++]; + nt[ie++] = Xe[et++]; while (--Ye); if (et = 0, ut < _t) { Ye = ut, _t -= Ye; do - nt[te++] = Xe[et++]; + nt[ie++] = Xe[et++]; while (--Ye); - et = te - St, xt = nt; + et = ie - Lt, xt = nt; } } } else if (et += ut - Ye, Ye < _t) { _t -= Ye; do - nt[te++] = Xe[et++]; + nt[ie++] = Xe[et++]; while (--Ye); - et = te - St, xt = nt; + et = ie - Lt, xt = nt; } for (; _t > 2; ) - nt[te++] = xt[et++], nt[te++] = xt[et++], nt[te++] = xt[et++], _t -= 3; - _t && (nt[te++] = xt[et++], _t > 1 && (nt[te++] = xt[et++])); + nt[ie++] = xt[et++], nt[ie++] = xt[et++], nt[ie++] = xt[et++], _t -= 3; + _t && (nt[ie++] = xt[et++], _t > 1 && (nt[ie++] = xt[et++])); } else { - et = te - St; + et = ie - Lt; do - nt[te++] = nt[et++], nt[te++] = nt[et++], nt[te++] = nt[et++], _t -= 3; + nt[ie++] = nt[et++], nt[ie++] = nt[et++], nt[ie++] = nt[et++], _t -= 3; while (_t > 2); - _t && (nt[te++] = nt[et++], _t > 1 && (nt[te++] = nt[et++])); + _t && (nt[ie++] = nt[et++], _t > 1 && (nt[ie++] = nt[et++])); } } else if (Ye & 64) { - W.msg = "invalid distance code", ht.mode = Er; + H.msg = "invalid distance code", ft.mode = Er; break e; } else { - ot = ft[(ot & 65535) + (Ge & (1 << Ye) - 1)]; + ot = ht[(ot & 65535) + (He & (1 << Ye) - 1)]; continue r; } break; } } else if (Ye & 64) if (Ye & 32) { - ht.mode = Yn; + ft.mode = Yn; break e; } else { - W.msg = "invalid literal/length code", ht.mode = Er; + H.msg = "invalid literal/length code", ft.mode = Er; break e; } else { - ot = Ct[(ot & 65535) + (Ge & (1 << Ye) - 1)]; + ot = Ct[(ot & 65535) + (He & (1 << Ye) - 1)]; continue t; } break; } - } while (J < ie && te < xe); - _t = qe >> 3, J -= _t, qe -= _t << 3, Ge &= (1 << qe) - 1, W.next_in = J, W.next_out = te, W.avail_in = J < ie ? 5 + (ie - J) : 5 - (J - ie), W.avail_out = te < xe ? 257 + (xe - te) : 257 - (te - xe), ht.hold = Ge, ht.bits = qe; + } while (q < ne && ie < we); + _t = qe >> 3, q -= _t, qe -= _t << 3, He &= (1 << qe) - 1, H.next_in = q, H.next_out = ie, H.avail_in = q < ne ? 5 + (ne - q) : 5 - (q - ne), H.avail_out = ie < we ? 257 + (we - ie) : 257 - (ie - we), ft.hold = He, ft.bits = qe; }; const or = 15, si = 852, ai = 592, oi = 0, Nr = 1, li = 2, Qn = new Uint16Array([ /* Length codes 257..285 base */ @@ -24285,132 +24285,132 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 64, 64 ]); - var mr = (x, W, O, J, ie, te, De, xe) => { - const Qe = xe.bits; - let _e = 0, Pe = 0, ut = 0, Xe = 0, Ge = 0, qe = 0, Ct = 0, ft = 0, st = 0, gt = 0, ot, Ye, _t, St, et, xt = null, ct; - const nt = new Uint16Array(or + 1), ht = new Uint16Array(or + 1); - let Xt = null, rn, Sr, Tr; - for (_e = 0; _e <= or; _e++) - nt[_e] = 0; - for (Pe = 0; Pe < J; Pe++) - nt[W[O + Pe]]++; - for (Ge = Qe, Xe = or; Xe >= 1 && nt[Xe] === 0; Xe--) + var mr = (x, H, O, q, ne, ie, Pe, we) => { + const Qe = we.bits; + let me = 0, Ie = 0, ut = 0, Xe = 0, He = 0, qe = 0, Ct = 0, ht = 0, st = 0, gt = 0, ot, Ye, _t, Lt, et, xt = null, ct; + const nt = new Uint16Array(or + 1), ft = new Uint16Array(or + 1); + let Yt = null, rn, Lr, Tr; + for (me = 0; me <= or; me++) + nt[me] = 0; + for (Ie = 0; Ie < q; Ie++) + nt[H[O + Ie]]++; + for (He = Qe, Xe = or; Xe >= 1 && nt[Xe] === 0; Xe--) ; - if (Ge > Xe && (Ge = Xe), Xe === 0) - return ie[te++] = 1 << 24 | 64 << 16 | 0, ie[te++] = 1 << 24 | 64 << 16 | 0, xe.bits = 1, 0; + if (He > Xe && (He = Xe), Xe === 0) + return ne[ie++] = 1 << 24 | 64 << 16 | 0, ne[ie++] = 1 << 24 | 64 << 16 | 0, we.bits = 1, 0; for (ut = 1; ut < Xe && nt[ut] === 0; ut++) ; - for (Ge < ut && (Ge = ut), ft = 1, _e = 1; _e <= or; _e++) - if (ft <<= 1, ft -= nt[_e], ft < 0) + for (He < ut && (He = ut), ht = 1, me = 1; me <= or; me++) + if (ht <<= 1, ht -= nt[me], ht < 0) return -1; - if (ft > 0 && (x === oi || Xe !== 1)) + if (ht > 0 && (x === oi || Xe !== 1)) return -1; - for (ht[1] = 0, _e = 1; _e < or; _e++) - ht[_e + 1] = ht[_e] + nt[_e]; - for (Pe = 0; Pe < J; Pe++) - W[O + Pe] !== 0 && (De[ht[W[O + Pe]]++] = Pe); - if (x === oi ? (xt = Xt = De, ct = 20) : x === Nr ? (xt = Qn, Xt = Jn, ct = 257) : (xt = qn, Xt = es, ct = 0), gt = 0, Pe = 0, _e = ut, et = te, qe = Ge, Ct = 0, _t = -1, st = 1 << Ge, St = st - 1, x === Nr && st > si || x === li && st > ai) + for (ft[1] = 0, me = 1; me < or; me++) + ft[me + 1] = ft[me] + nt[me]; + for (Ie = 0; Ie < q; Ie++) + H[O + Ie] !== 0 && (Pe[ft[H[O + Ie]]++] = Ie); + if (x === oi ? (xt = Yt = Pe, ct = 20) : x === Nr ? (xt = Qn, Yt = Jn, ct = 257) : (xt = qn, Yt = es, ct = 0), gt = 0, Ie = 0, me = ut, et = ie, qe = He, Ct = 0, _t = -1, st = 1 << He, Lt = st - 1, x === Nr && st > si || x === li && st > ai) return 1; for (; ; ) { - rn = _e - Ct, De[Pe] + 1 < ct ? (Sr = 0, Tr = De[Pe]) : De[Pe] >= ct ? (Sr = Xt[De[Pe] - ct], Tr = xt[De[Pe] - ct]) : (Sr = 32 + 64, Tr = 0), ot = 1 << _e - Ct, Ye = 1 << qe, ut = Ye; + rn = me - Ct, Pe[Ie] + 1 < ct ? (Lr = 0, Tr = Pe[Ie]) : Pe[Ie] >= ct ? (Lr = Yt[Pe[Ie] - ct], Tr = xt[Pe[Ie] - ct]) : (Lr = 96, Tr = 0), ot = 1 << me - Ct, Ye = 1 << qe, ut = Ye; do - Ye -= ot, ie[et + (gt >> Ct) + Ye] = rn << 24 | Sr << 16 | Tr | 0; + Ye -= ot, ne[et + (gt >> Ct) + Ye] = rn << 24 | Lr << 16 | Tr | 0; while (Ye !== 0); - for (ot = 1 << _e - 1; gt & ot; ) + for (ot = 1 << me - 1; gt & ot; ) ot >>= 1; - if (ot !== 0 ? (gt &= ot - 1, gt += ot) : gt = 0, Pe++, --nt[_e] === 0) { - if (_e === Xe) + if (ot !== 0 ? (gt &= ot - 1, gt += ot) : gt = 0, Ie++, --nt[me] === 0) { + if (me === Xe) break; - _e = W[O + De[Pe]]; + me = H[O + Pe[Ie]]; } - if (_e > Ge && (gt & St) !== _t) { - for (Ct === 0 && (Ct = Ge), et += ut, qe = _e - Ct, ft = 1 << qe; qe + Ct < Xe && (ft -= nt[qe + Ct], !(ft <= 0)); ) - qe++, ft <<= 1; + if (me > He && (gt & Lt) !== _t) { + for (Ct === 0 && (Ct = He), et += ut, qe = me - Ct, ht = 1 << qe; qe + Ct < Xe && (ht -= nt[qe + Ct], !(ht <= 0)); ) + qe++, ht <<= 1; if (st += 1 << qe, x === Nr && st > si || x === li && st > ai) return 1; - _t = gt & St, ie[_t] = Ge << 24 | qe << 16 | et - te | 0; + _t = gt & Lt, ne[_t] = He << 24 | qe << 16 | et - ie | 0; } } - return gt !== 0 && (ie[et + gt] = _e - Ct << 24 | 64 << 16 | 0), xe.bits = Ge, 0; + return gt !== 0 && (ne[et + gt] = me - Ct << 24 | 64 << 16 | 0), we.bits = He, 0; }; - const ts = 0, hi = 1, fi = 2, { + const ts = 0, fi = 1, hi = 2, { Z_FINISH: ci, Z_BLOCK: rs, Z_TREES: wr, - Z_OK: Zt, + Z_OK: Kt, Z_STREAM_END: is, Z_NEED_DICT: ns, - Z_STREAM_ERROR: $t, + Z_STREAM_ERROR: Rt, Z_DATA_ERROR: ui, Z_MEM_ERROR: di, Z_BUF_ERROR: ss, Z_DEFLATED: _i - } = Ee, Ar = 16180, pi = 16181, gi = 16182, mi = 16183, vi = 16184, bi = 16185, yi = 16186, xi = 16187, Ei = 16188, wi = 16189, Mr = 16190, Ut = 16191, Gr = 16192, Ai = 16193, Wr = 16194, Mi = 16195, Ci = 16196, Li = 16197, Si = 16198, Cr = 16199, Lr = 16200, Ti = 16201, Oi = 16202, Di = 16203, Pi = 16204, Ii = 16205, Hr = 16206, Ri = 16207, $i = 16208, Mt = 16209, Bi = 16210, zi = 16211, as = 852, os = 592, ls = 15, ki = (x) => (x >>> 24 & 255) + (x >>> 8 & 65280) + ((x & 65280) << 8) + ((x & 255) << 24); - function hs() { + } = Me, Ar = 16180, pi = 16181, gi = 16182, mi = 16183, vi = 16184, bi = 16185, yi = 16186, xi = 16187, Ei = 16188, wi = 16189, Mr = 16190, Ut = 16191, Gr = 16192, Ai = 16193, Wr = 16194, Mi = 16195, Ci = 16196, Si = 16197, Li = 16198, Cr = 16199, Sr = 16200, Ti = 16201, Oi = 16202, Di = 16203, Pi = 16204, Ii = 16205, Hr = 16206, $i = 16207, Ri = 16208, Mt = 16209, Bi = 16210, zi = 16211, as = 852, os = 592, ls = 15, ki = (x) => (x >>> 24 & 255) + (x >>> 8 & 65280) + ((x & 65280) << 8) + ((x & 255) << 24); + function fs() { this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } - const Yt = (x) => { + const Zt = (x) => { if (!x) return 1; - const W = x.state; - return !W || W.strm !== x || W.mode < Ar || W.mode > zi ? 1 : 0; + const H = x.state; + return !H || H.strm !== x || H.mode < Ar || H.mode > zi ? 1 : 0; }, Fi = (x) => { - if (Yt(x)) - return $t; - const W = x.state; - return x.total_in = x.total_out = W.total = 0, x.msg = "", W.wrap && (x.adler = W.wrap & 1), W.mode = Ar, W.last = 0, W.havedict = 0, W.flags = -1, W.dmax = 32768, W.head = null, W.hold = 0, W.bits = 0, W.lencode = W.lendyn = new Int32Array(as), W.distcode = W.distdyn = new Int32Array(os), W.sane = 1, W.back = -1, Zt; + if (Zt(x)) + return Rt; + const H = x.state; + return x.total_in = x.total_out = H.total = 0, x.msg = "", H.wrap && (x.adler = H.wrap & 1), H.mode = Ar, H.last = 0, H.havedict = 0, H.flags = -1, H.dmax = 32768, H.head = null, H.hold = 0, H.bits = 0, H.lencode = H.lendyn = new Int32Array(as), H.distcode = H.distdyn = new Int32Array(os), H.sane = 1, H.back = -1, Kt; }, Ui = (x) => { - if (Yt(x)) - return $t; - const W = x.state; - return W.wsize = 0, W.whave = 0, W.wnext = 0, Fi(x); - }, Ni = (x, W) => { + if (Zt(x)) + return Rt; + const H = x.state; + return H.wsize = 0, H.whave = 0, H.wnext = 0, Fi(x); + }, Ni = (x, H) => { let O; - if (Yt(x)) - return $t; - const J = x.state; - return W < 0 ? (O = 0, W = -W) : (O = (W >> 4) + 5, W < 48 && (W &= 15)), W && (W < 8 || W > 15) ? $t : (J.window !== null && J.wbits !== W && (J.window = null), J.wrap = O, J.wbits = W, Ui(x)); - }, Gi = (x, W) => { + if (Zt(x)) + return Rt; + const q = x.state; + return H < 0 ? (O = 0, H = -H) : (O = (H >> 4) + 5, H < 48 && (H &= 15)), H && (H < 8 || H > 15) ? Rt : (q.window !== null && q.wbits !== H && (q.window = null), q.wrap = O, q.wbits = H, Ui(x)); + }, Gi = (x, H) => { if (!x) - return $t; - const O = new hs(); + return Rt; + const O = new fs(); x.state = O, O.strm = x, O.window = null, O.mode = Ar; - const J = Ni(x, W); - return J !== Zt && (x.state = null), J; - }, fs = (x) => Gi(x, ls); + const q = Ni(x, H); + return q !== Kt && (x.state = null), q; + }, hs = (x) => Gi(x, ls); let Wi = !0, Vr, jr; const cs = (x) => { if (Wi) { Vr = new Int32Array(512), jr = new Int32Array(32); - let W = 0; - for (; W < 144; ) - x.lens[W++] = 8; - for (; W < 256; ) - x.lens[W++] = 9; - for (; W < 280; ) - x.lens[W++] = 7; - for (; W < 288; ) - x.lens[W++] = 8; - for (mr(hi, x.lens, 0, 288, Vr, 0, x.work, { bits: 9 }), W = 0; W < 32; ) - x.lens[W++] = 5; - mr(fi, x.lens, 0, 32, jr, 0, x.work, { bits: 5 }), Wi = !1; + let H = 0; + for (; H < 144; ) + x.lens[H++] = 8; + for (; H < 256; ) + x.lens[H++] = 9; + for (; H < 280; ) + x.lens[H++] = 7; + for (; H < 288; ) + x.lens[H++] = 8; + for (mr(fi, x.lens, 0, 288, Vr, 0, x.work, { bits: 9 }), H = 0; H < 32; ) + x.lens[H++] = 5; + mr(hi, x.lens, 0, 32, jr, 0, x.work, { bits: 5 }), Wi = !1; } x.lencode = Vr, x.lenbits = 9, x.distcode = jr, x.distbits = 5; - }, Hi = (x, W, O, J) => { - let ie; - const te = x.state; - return te.window === null && (te.wsize = 1 << te.wbits, te.wnext = 0, te.whave = 0, te.window = new Uint8Array(te.wsize)), J >= te.wsize ? (te.window.set(W.subarray(O - te.wsize, O), 0), te.wnext = 0, te.whave = te.wsize) : (ie = te.wsize - te.wnext, ie > J && (ie = J), te.window.set(W.subarray(O - J, O - J + ie), te.wnext), J -= ie, J ? (te.window.set(W.subarray(O - J, O), 0), te.wnext = J, te.whave = te.wsize) : (te.wnext += ie, te.wnext === te.wsize && (te.wnext = 0), te.whave < te.wsize && (te.whave += ie))), 0; - }, us = (x, W) => { - let O, J, ie, te, De, xe, Qe, _e, Pe, ut, Xe, Ge, qe, Ct, ft = 0, st, gt, ot, Ye, _t, St, et, xt; + }, Hi = (x, H, O, q) => { + let ne; + const ie = x.state; + return ie.window === null && (ie.wsize = 1 << ie.wbits, ie.wnext = 0, ie.whave = 0, ie.window = new Uint8Array(ie.wsize)), q >= ie.wsize ? (ie.window.set(H.subarray(O - ie.wsize, O), 0), ie.wnext = 0, ie.whave = ie.wsize) : (ne = ie.wsize - ie.wnext, ne > q && (ne = q), ie.window.set(H.subarray(O - q, O - q + ne), ie.wnext), q -= ne, q ? (ie.window.set(H.subarray(O - q, O), 0), ie.wnext = q, ie.whave = ie.wsize) : (ie.wnext += ne, ie.wnext === ie.wsize && (ie.wnext = 0), ie.whave < ie.wsize && (ie.whave += ne))), 0; + }, us = (x, H) => { + let O, q, ne, ie, Pe, we, Qe, me, Ie, ut, Xe, He, qe, Ct, ht = 0, st, gt, ot, Ye, _t, Lt, et, xt; const ct = new Uint8Array(4); - let nt, ht; - const Xt = ( + let nt, ft; + const Yt = ( /* permutation of code lengths */ new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]) ); - if (Yt(x) || !x.output || !x.input && x.avail_in !== 0) - return $t; - O = x.state, O.mode === Ut && (O.mode = Gr), De = x.next_out, ie = x.output, Qe = x.avail_out, te = x.next_in, J = x.input, xe = x.avail_in, _e = O.hold, Pe = O.bits, ut = xe, Xe = Qe, xt = Zt; + if (Zt(x) || !x.output || !x.input && x.avail_in !== 0) + return Rt; + O = x.state, O.mode === Ut && (O.mode = Gr), Pe = x.next_out, ne = x.output, Qe = x.avail_out, ie = x.next_in, q = x.input, we = x.avail_in, me = O.hold, Ie = O.bits, ut = we, Xe = Qe, xt = Kt; e: for (; ; ) switch (O.mode) { @@ -24419,37 +24419,37 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; O.mode = Gr; break; } - for (; Pe < 16; ) { - if (xe === 0) + for (; Ie < 16; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (O.wrap & 2 && _e === 35615) { - O.wbits === 0 && (O.wbits = 15), O.check = 0, ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0), _e = 0, Pe = 0, O.mode = pi; + if (O.wrap & 2 && me === 35615) { + O.wbits === 0 && (O.wbits = 15), O.check = 0, ct[0] = me & 255, ct[1] = me >>> 8 & 255, O.check = $(O.check, ct, 2, 0), me = 0, Ie = 0, O.mode = pi; break; } if (O.head && (O.head.done = !1), !(O.wrap & 1) || /* check if zlib header allowed */ - (((_e & 255) << 8) + (_e >> 8)) % 31) { + (((me & 255) << 8) + (me >> 8)) % 31) { x.msg = "incorrect header check", O.mode = Mt; break; } - if ((_e & 15) !== _i) { + if ((me & 15) !== _i) { x.msg = "unknown compression method", O.mode = Mt; break; } - if (_e >>>= 4, Pe -= 4, et = (_e & 15) + 8, O.wbits === 0 && (O.wbits = et), et > 15 || et > O.wbits) { + if (me >>>= 4, Ie -= 4, et = (me & 15) + 8, O.wbits === 0 && (O.wbits = et), et > 15 || et > O.wbits) { x.msg = "invalid window size", O.mode = Mt; break; } - O.dmax = 1 << O.wbits, O.flags = 0, x.adler = O.check = 1, O.mode = _e & 512 ? wi : Ut, _e = 0, Pe = 0; + O.dmax = 1 << O.wbits, O.flags = 0, x.adler = O.check = 1, O.mode = me & 512 ? wi : Ut, me = 0, Ie = 0; break; case pi: - for (; Pe < 16; ) { - if (xe === 0) + for (; Ie < 16; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (O.flags = _e, (O.flags & 255) !== _i) { + if (O.flags = me, (O.flags & 255) !== _i) { x.msg = "unknown compression method", O.mode = Mt; break; } @@ -24457,117 +24457,117 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; x.msg = "unknown header flags set", O.mode = Mt; break; } - O.head && (O.head.text = _e >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = gi; + O.head && (O.head.text = me >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ct[0] = me & 255, ct[1] = me >>> 8 & 255, O.check = $(O.check, ct, 2, 0)), me = 0, Ie = 0, O.mode = gi; case gi: - for (; Pe < 32; ) { - if (xe === 0) + for (; Ie < 32; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.head && (O.head.time = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, ct[2] = _e >>> 16 & 255, ct[3] = _e >>> 24 & 255, O.check = R(O.check, ct, 4, 0)), _e = 0, Pe = 0, O.mode = mi; + O.head && (O.head.time = me), O.flags & 512 && O.wrap & 4 && (ct[0] = me & 255, ct[1] = me >>> 8 & 255, ct[2] = me >>> 16 & 255, ct[3] = me >>> 24 & 255, O.check = $(O.check, ct, 4, 0)), me = 0, Ie = 0, O.mode = mi; case mi: - for (; Pe < 16; ) { - if (xe === 0) + for (; Ie < 16; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.head && (O.head.xflags = _e & 255, O.head.os = _e >> 8), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = vi; + O.head && (O.head.xflags = me & 255, O.head.os = me >> 8), O.flags & 512 && O.wrap & 4 && (ct[0] = me & 255, ct[1] = me >>> 8 & 255, O.check = $(O.check, ct, 2, 0)), me = 0, Ie = 0, O.mode = vi; case vi: if (O.flags & 1024) { - for (; Pe < 16; ) { - if (xe === 0) + for (; Ie < 16; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.length = _e, O.head && (O.head.extra_len = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0; + O.length = me, O.head && (O.head.extra_len = me), O.flags & 512 && O.wrap & 4 && (ct[0] = me & 255, ct[1] = me >>> 8 & 255, O.check = $(O.check, ct, 2, 0)), me = 0, Ie = 0; } else O.head && (O.head.extra = null); O.mode = bi; case bi: - if (O.flags & 1024 && (Ge = O.length, Ge > xe && (Ge = xe), Ge && (O.head && (et = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( - J.subarray( - te, + if (O.flags & 1024 && (He = O.length, He > we && (He = we), He && (O.head && (et = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( + q.subarray( + ie, // extra field is limited to 65536 bytes // - no need for additional size check - te + Ge + ie + He ), /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ et - )), O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, O.length -= Ge), O.length)) + )), O.flags & 512 && O.wrap & 4 && (O.check = $(O.check, q, He, ie)), we -= He, ie += He, O.length -= He), O.length)) break e; O.length = 0, O.mode = yi; case yi: if (O.flags & 2048) { - if (xe === 0) + if (we === 0) break e; - Ge = 0; + He = 0; do - et = J[te + Ge++], O.head && et && O.length < 65536 && (O.head.name += String.fromCharCode(et)); - while (et && Ge < xe); - if (O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) + et = q[ie + He++], O.head && et && O.length < 65536 && (O.head.name += String.fromCharCode(et)); + while (et && He < we); + if (O.flags & 512 && O.wrap & 4 && (O.check = $(O.check, q, He, ie)), we -= He, ie += He, et) break e; } else O.head && (O.head.name = null); O.length = 0, O.mode = xi; case xi: if (O.flags & 4096) { - if (xe === 0) + if (we === 0) break e; - Ge = 0; + He = 0; do - et = J[te + Ge++], O.head && et && O.length < 65536 && (O.head.comment += String.fromCharCode(et)); - while (et && Ge < xe); - if (O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) + et = q[ie + He++], O.head && et && O.length < 65536 && (O.head.comment += String.fromCharCode(et)); + while (et && He < we); + if (O.flags & 512 && O.wrap & 4 && (O.check = $(O.check, q, He, ie)), we -= He, ie += He, et) break e; } else O.head && (O.head.comment = null); O.mode = Ei; case Ei: if (O.flags & 512) { - for (; Pe < 16; ) { - if (xe === 0) + for (; Ie < 16; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (O.wrap & 4 && _e !== (O.check & 65535)) { + if (O.wrap & 4 && me !== (O.check & 65535)) { x.msg = "header crc mismatch", O.mode = Mt; break; } - _e = 0, Pe = 0; + me = 0, Ie = 0; } O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), x.adler = O.check = 0, O.mode = Ut; break; case wi: - for (; Pe < 32; ) { - if (xe === 0) + for (; Ie < 32; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - x.adler = O.check = ki(_e), _e = 0, Pe = 0, O.mode = Mr; + x.adler = O.check = ki(me), me = 0, Ie = 0, O.mode = Mr; case Mr: if (O.havedict === 0) - return x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, ns; + return x.next_out = Pe, x.avail_out = Qe, x.next_in = ie, x.avail_in = we, O.hold = me, O.bits = Ie, ns; x.adler = O.check = 1, O.mode = Ut; case Ut: - if (W === rs || W === wr) + if (H === rs || H === wr) break e; case Gr: if (O.last) { - _e >>>= Pe & 7, Pe -= Pe & 7, O.mode = Hr; + me >>>= Ie & 7, Ie -= Ie & 7, O.mode = Hr; break; } - for (; Pe < 3; ) { - if (xe === 0) + for (; Ie < 3; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - switch (O.last = _e & 1, _e >>>= 1, Pe -= 1, _e & 3) { + switch (O.last = me & 1, me >>>= 1, Ie -= 1, me & 3) { case 0: O.mode = Ai; break; case 1: - if (cs(O), O.mode = Cr, W === wr) { - _e >>>= 2, Pe -= 2; + if (cs(O), O.mode = Cr, H === wr) { + me >>>= 2, Ie -= 2; break e; } break; @@ -24577,99 +24577,99 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 3: x.msg = "invalid block type", O.mode = Mt; } - _e >>>= 2, Pe -= 2; + me >>>= 2, Ie -= 2; break; case Ai: - for (_e >>>= Pe & 7, Pe -= Pe & 7; Pe < 32; ) { - if (xe === 0) + for (me >>>= Ie & 7, Ie -= Ie & 7; Ie < 32; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if ((_e & 65535) !== (_e >>> 16 ^ 65535)) { + if ((me & 65535) !== (me >>> 16 ^ 65535)) { x.msg = "invalid stored block lengths", O.mode = Mt; break; } - if (O.length = _e & 65535, _e = 0, Pe = 0, O.mode = Wr, W === wr) + if (O.length = me & 65535, me = 0, Ie = 0, O.mode = Wr, H === wr) break e; case Wr: O.mode = Mi; case Mi: - if (Ge = O.length, Ge) { - if (Ge > xe && (Ge = xe), Ge > Qe && (Ge = Qe), Ge === 0) + if (He = O.length, He) { + if (He > we && (He = we), He > Qe && (He = Qe), He === 0) break e; - ie.set(J.subarray(te, te + Ge), De), xe -= Ge, te += Ge, Qe -= Ge, De += Ge, O.length -= Ge; + ne.set(q.subarray(ie, ie + He), Pe), we -= He, ie += He, Qe -= He, Pe += He, O.length -= He; break; } O.mode = Ut; break; case Ci: - for (; Pe < 14; ) { - if (xe === 0) + for (; Ie < 14; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (O.nlen = (_e & 31) + 257, _e >>>= 5, Pe -= 5, O.ndist = (_e & 31) + 1, _e >>>= 5, Pe -= 5, O.ncode = (_e & 15) + 4, _e >>>= 4, Pe -= 4, O.nlen > 286 || O.ndist > 30) { + if (O.nlen = (me & 31) + 257, me >>>= 5, Ie -= 5, O.ndist = (me & 31) + 1, me >>>= 5, Ie -= 5, O.ncode = (me & 15) + 4, me >>>= 4, Ie -= 4, O.nlen > 286 || O.ndist > 30) { x.msg = "too many length or distance symbols", O.mode = Mt; break; } - O.have = 0, O.mode = Li; - case Li: + O.have = 0, O.mode = Si; + case Si: for (; O.have < O.ncode; ) { - for (; Pe < 3; ) { - if (xe === 0) + for (; Ie < 3; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.lens[Xt[O.have++]] = _e & 7, _e >>>= 3, Pe -= 3; + O.lens[Yt[O.have++]] = me & 7, me >>>= 3, Ie -= 3; } for (; O.have < 19; ) - O.lens[Xt[O.have++]] = 0; + O.lens[Yt[O.have++]] = 0; if (O.lencode = O.lendyn, O.lenbits = 7, nt = { bits: O.lenbits }, xt = mr(ts, O.lens, 0, 19, O.lencode, 0, O.work, nt), O.lenbits = nt.bits, xt) { x.msg = "invalid code lengths set", O.mode = Mt; break; } - O.have = 0, O.mode = Si; - case Si: + O.have = 0, O.mode = Li; + case Li: for (; O.have < O.nlen + O.ndist; ) { - for (; ft = O.lencode[_e & (1 << O.lenbits) - 1], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(st <= Pe); ) { - if (xe === 0) + for (; ht = O.lencode[me & (1 << O.lenbits) - 1], st = ht >>> 24, gt = ht >>> 16 & 255, ot = ht & 65535, !(st <= Ie); ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } if (ot < 16) - _e >>>= st, Pe -= st, O.lens[O.have++] = ot; + me >>>= st, Ie -= st, O.lens[O.have++] = ot; else { if (ot === 16) { - for (ht = st + 2; Pe < ht; ) { - if (xe === 0) + for (ft = st + 2; Ie < ft; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (_e >>>= st, Pe -= st, O.have === 0) { + if (me >>>= st, Ie -= st, O.have === 0) { x.msg = "invalid bit length repeat", O.mode = Mt; break; } - et = O.lens[O.have - 1], Ge = 3 + (_e & 3), _e >>>= 2, Pe -= 2; + et = O.lens[O.have - 1], He = 3 + (me & 3), me >>>= 2, Ie -= 2; } else if (ot === 17) { - for (ht = st + 3; Pe < ht; ) { - if (xe === 0) + for (ft = st + 3; Ie < ft; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - _e >>>= st, Pe -= st, et = 0, Ge = 3 + (_e & 7), _e >>>= 3, Pe -= 3; + me >>>= st, Ie -= st, et = 0, He = 3 + (me & 7), me >>>= 3, Ie -= 3; } else { - for (ht = st + 7; Pe < ht; ) { - if (xe === 0) + for (ft = st + 7; Ie < ft; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - _e >>>= st, Pe -= st, et = 0, Ge = 11 + (_e & 127), _e >>>= 7, Pe -= 7; + me >>>= st, Ie -= st, et = 0, He = 11 + (me & 127), me >>>= 7, Ie -= 7; } - if (O.have + Ge > O.nlen + O.ndist) { + if (O.have + He > O.nlen + O.ndist) { x.msg = "invalid bit length repeat", O.mode = Mt; break; } - for (; Ge--; ) + for (; He--; ) O.lens[O.have++] = et; } } @@ -24679,37 +24679,37 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; x.msg = "invalid code -- missing end-of-block", O.mode = Mt; break; } - if (O.lenbits = 9, nt = { bits: O.lenbits }, xt = mr(hi, O.lens, 0, O.nlen, O.lencode, 0, O.work, nt), O.lenbits = nt.bits, xt) { + if (O.lenbits = 9, nt = { bits: O.lenbits }, xt = mr(fi, O.lens, 0, O.nlen, O.lencode, 0, O.work, nt), O.lenbits = nt.bits, xt) { x.msg = "invalid literal/lengths set", O.mode = Mt; break; } - if (O.distbits = 6, O.distcode = O.distdyn, nt = { bits: O.distbits }, xt = mr(fi, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, nt), O.distbits = nt.bits, xt) { + if (O.distbits = 6, O.distcode = O.distdyn, nt = { bits: O.distbits }, xt = mr(hi, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, nt), O.distbits = nt.bits, xt) { x.msg = "invalid distances set", O.mode = Mt; break; } - if (O.mode = Cr, W === wr) + if (O.mode = Cr, H === wr) break e; case Cr: - O.mode = Lr; - case Lr: - if (xe >= 6 && Qe >= 258) { - x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, Xn(x, Xe), De = x.next_out, ie = x.output, Qe = x.avail_out, te = x.next_in, J = x.input, xe = x.avail_in, _e = O.hold, Pe = O.bits, O.mode === Ut && (O.back = -1); + O.mode = Sr; + case Sr: + if (we >= 6 && Qe >= 258) { + x.next_out = Pe, x.avail_out = Qe, x.next_in = ie, x.avail_in = we, O.hold = me, O.bits = Ie, Xn(x, Xe), Pe = x.next_out, ne = x.output, Qe = x.avail_out, ie = x.next_in, q = x.input, we = x.avail_in, me = O.hold, Ie = O.bits, O.mode === Ut && (O.back = -1); break; } - for (O.back = 0; ft = O.lencode[_e & (1 << O.lenbits) - 1], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(st <= Pe); ) { - if (xe === 0) + for (O.back = 0; ht = O.lencode[me & (1 << O.lenbits) - 1], st = ht >>> 24, gt = ht >>> 16 & 255, ot = ht & 65535, !(st <= Ie); ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } if (gt && !(gt & 240)) { - for (Ye = st, _t = gt, St = ot; ft = O.lencode[St + ((_e & (1 << Ye + _t) - 1) >> Ye)], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(Ye + st <= Pe); ) { - if (xe === 0) + for (Ye = st, _t = gt, Lt = ot; ht = O.lencode[Lt + ((me & (1 << Ye + _t) - 1) >> Ye)], st = ht >>> 24, gt = ht >>> 16 & 255, ot = ht & 65535, !(Ye + st <= Ie); ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - _e >>>= Ye, Pe -= Ye, O.back += Ye; + me >>>= Ye, Ie -= Ye, O.back += Ye; } - if (_e >>>= st, Pe -= st, O.back += st, O.length = ot, gt === 0) { + if (me >>>= st, Ie -= st, O.back += st, O.length = ot, gt === 0) { O.mode = Ii; break; } @@ -24724,41 +24724,41 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; O.extra = gt & 15, O.mode = Ti; case Ti: if (O.extra) { - for (ht = O.extra; Pe < ht; ) { - if (xe === 0) + for (ft = O.extra; Ie < ft; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.length += _e & (1 << O.extra) - 1, _e >>>= O.extra, Pe -= O.extra, O.back += O.extra; + O.length += me & (1 << O.extra) - 1, me >>>= O.extra, Ie -= O.extra, O.back += O.extra; } O.was = O.length, O.mode = Oi; case Oi: - for (; ft = O.distcode[_e & (1 << O.distbits) - 1], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(st <= Pe); ) { - if (xe === 0) + for (; ht = O.distcode[me & (1 << O.distbits) - 1], st = ht >>> 24, gt = ht >>> 16 & 255, ot = ht & 65535, !(st <= Ie); ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } if (!(gt & 240)) { - for (Ye = st, _t = gt, St = ot; ft = O.distcode[St + ((_e & (1 << Ye + _t) - 1) >> Ye)], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(Ye + st <= Pe); ) { - if (xe === 0) + for (Ye = st, _t = gt, Lt = ot; ht = O.distcode[Lt + ((me & (1 << Ye + _t) - 1) >> Ye)], st = ht >>> 24, gt = ht >>> 16 & 255, ot = ht & 65535, !(Ye + st <= Ie); ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - _e >>>= Ye, Pe -= Ye, O.back += Ye; + me >>>= Ye, Ie -= Ye, O.back += Ye; } - if (_e >>>= st, Pe -= st, O.back += st, gt & 64) { + if (me >>>= st, Ie -= st, O.back += st, gt & 64) { x.msg = "invalid distance code", O.mode = Mt; break; } O.offset = ot, O.extra = gt & 15, O.mode = Di; case Di: if (O.extra) { - for (ht = O.extra; Pe < ht; ) { - if (xe === 0) + for (ft = O.extra; Ie < ft; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - O.offset += _e & (1 << O.extra) - 1, _e >>>= O.extra, Pe -= O.extra, O.back += O.extra; + O.offset += me & (1 << O.extra) - 1, me >>>= O.extra, Ie -= O.extra, O.back += O.extra; } if (O.offset > O.dmax) { x.msg = "invalid distance too far back", O.mode = Mt; @@ -24768,55 +24768,55 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case Pi: if (Qe === 0) break e; - if (Ge = Xe - Qe, O.offset > Ge) { - if (Ge = O.offset - Ge, Ge > O.whave && O.sane) { + if (He = Xe - Qe, O.offset > He) { + if (He = O.offset - He, He > O.whave && O.sane) { x.msg = "invalid distance too far back", O.mode = Mt; break; } - Ge > O.wnext ? (Ge -= O.wnext, qe = O.wsize - Ge) : qe = O.wnext - Ge, Ge > O.length && (Ge = O.length), Ct = O.window; + He > O.wnext ? (He -= O.wnext, qe = O.wsize - He) : qe = O.wnext - He, He > O.length && (He = O.length), Ct = O.window; } else - Ct = ie, qe = De - O.offset, Ge = O.length; - Ge > Qe && (Ge = Qe), Qe -= Ge, O.length -= Ge; + Ct = ne, qe = Pe - O.offset, He = O.length; + He > Qe && (He = Qe), Qe -= He, O.length -= He; do - ie[De++] = Ct[qe++]; - while (--Ge); - O.length === 0 && (O.mode = Lr); + ne[Pe++] = Ct[qe++]; + while (--He); + O.length === 0 && (O.mode = Sr); break; case Ii: if (Qe === 0) break e; - ie[De++] = O.length, Qe--, O.mode = Lr; + ne[Pe++] = O.length, Qe--, O.mode = Sr; break; case Hr: if (O.wrap) { - for (; Pe < 32; ) { - if (xe === 0) + for (; Ie < 32; ) { + if (we === 0) break e; - xe--, _e |= J[te++] << Pe, Pe += 8; + we--, me |= q[ie++] << Ie, Ie += 8; } if (Xe -= Qe, x.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (x.adler = O.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ - O.flags ? R(O.check, ie, Xe, De - Xe) : Oe(O.check, ie, Xe, De - Xe)), Xe = Qe, O.wrap & 4 && (O.flags ? _e : ki(_e)) !== O.check) { + O.flags ? $(O.check, ne, Xe, Pe - Xe) : De(O.check, ne, Xe, Pe - Xe)), Xe = Qe, O.wrap & 4 && (O.flags ? me : ki(me)) !== O.check) { x.msg = "incorrect data check", O.mode = Mt; break; } - _e = 0, Pe = 0; + me = 0, Ie = 0; } - O.mode = Ri; - case Ri: + O.mode = $i; + case $i: if (O.wrap && O.flags) { - for (; Pe < 32; ) { - if (xe === 0) + for (; Ie < 32; ) { + if (we === 0) break e; - xe--, _e += J[te++] << Pe, Pe += 8; + we--, me += q[ie++] << Ie, Ie += 8; } - if (O.wrap & 4 && _e !== (O.total & 4294967295)) { + if (O.wrap & 4 && me !== (O.total & 4294967295)) { x.msg = "incorrect length check", O.mode = Mt; break; } - _e = 0, Pe = 0; + me = 0, Ie = 0; } - O.mode = $i; - case $i: + O.mode = Ri; + case Ri: xt = is; break e; case Mt: @@ -24826,26 +24826,26 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return di; case zi: default: - return $t; + return Rt; } - return x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, (O.wsize || Xe !== x.avail_out && O.mode < Mt && (O.mode < Hr || W !== ci)) && Hi(x, x.output, x.next_out, Xe - x.avail_out), ut -= x.avail_in, Xe -= x.avail_out, x.total_in += ut, x.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (x.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ - O.flags ? R(O.check, ie, Xe, x.next_out - Xe) : Oe(O.check, ie, Xe, x.next_out - Xe)), x.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Ut ? 128 : 0) + (O.mode === Cr || O.mode === Wr ? 256 : 0), (ut === 0 && Xe === 0 || W === ci) && xt === Zt && (xt = ss), xt; + return x.next_out = Pe, x.avail_out = Qe, x.next_in = ie, x.avail_in = we, O.hold = me, O.bits = Ie, (O.wsize || Xe !== x.avail_out && O.mode < Mt && (O.mode < Hr || H !== ci)) && Hi(x, x.output, x.next_out, Xe - x.avail_out), ut -= x.avail_in, Xe -= x.avail_out, x.total_in += ut, x.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (x.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ + O.flags ? $(O.check, ne, Xe, x.next_out - Xe) : De(O.check, ne, Xe, x.next_out - Xe)), x.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Ut ? 128 : 0) + (O.mode === Cr || O.mode === Wr ? 256 : 0), (ut === 0 && Xe === 0 || H === ci) && xt === Kt && (xt = ss), xt; }, ds = (x) => { - if (Yt(x)) - return $t; - let W = x.state; - return W.window && (W.window = null), x.state = null, Zt; - }, _s = (x, W) => { - if (Yt(x)) - return $t; + if (Zt(x)) + return Rt; + let H = x.state; + return H.window && (H.window = null), x.state = null, Kt; + }, _s = (x, H) => { + if (Zt(x)) + return Rt; const O = x.state; - return O.wrap & 2 ? (O.head = W, W.done = !1, Zt) : $t; - }, ps = (x, W) => { - const O = W.length; - let J, ie, te; - return Yt(x) || (J = x.state, J.wrap !== 0 && J.mode !== Mr) ? $t : J.mode === Mr && (ie = 1, ie = Oe(ie, W, O, 0), ie !== J.check) ? ui : (te = Hi(x, W, O, O), te ? (J.mode = Bi, di) : (J.havedict = 1, Zt)); + return O.wrap & 2 ? (O.head = H, H.done = !1, Kt) : Rt; + }, ps = (x, H) => { + const O = H.length; + let q, ne, ie; + return Zt(x) || (q = x.state, q.wrap !== 0 && q.mode !== Mr) ? Rt : q.mode === Mr && (ne = 1, ne = De(ne, H, O, 0), ne !== q.check) ? ui : (ie = Hi(x, H, O, O), ie ? (q.mode = Bi, di) : (q.havedict = 1, Kt)); }; - var gs = Ui, ms = Ni, vs = Fi, bs = fs, ys = Gi, xs = us, Es = ds, ws = _s, As = ps, Ms = "pako inflate (from Nodeca project)", Nt = { + var gs = Ui, ms = Ni, vs = Fi, bs = hs, ys = Gi, xs = us, Es = ds, ws = _s, As = ps, Ms = "pako inflate (from Nodeca project)", Nt = { inflateReset: gs, inflateReset2: ms, inflateResetKeep: vs, @@ -24860,9 +24860,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; function Cs() { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; } - var Ls = Cs; + var Ss = Cs; const Vi = Object.prototype.toString, { - Z_NO_FLUSH: Ss, + Z_NO_FLUSH: Ls, Z_FINISH: Ts, Z_OK: vr, Z_STREAM_END: Kr, @@ -24870,48 +24870,48 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_STREAM_ERROR: Os, Z_DATA_ERROR: ji, Z_MEM_ERROR: Ds - } = Ee; + } = Me; function br(x) { this.options = yr.assign({ chunkSize: 65536, windowBits: 15, to: "" }, x || {}); - const W = this.options; - W.raw && W.windowBits >= 0 && W.windowBits < 16 && (W.windowBits = -W.windowBits, W.windowBits === 0 && (W.windowBits = -15)), W.windowBits >= 0 && W.windowBits < 16 && !(x && x.windowBits) && (W.windowBits += 32), W.windowBits > 15 && W.windowBits < 48 && (W.windowBits & 15 || (W.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; + const H = this.options; + H.raw && H.windowBits >= 0 && H.windowBits < 16 && (H.windowBits = -H.windowBits, H.windowBits === 0 && (H.windowBits = -15)), H.windowBits >= 0 && H.windowBits < 16 && !(x && x.windowBits) && (H.windowBits += 32), H.windowBits > 15 && H.windowBits < 48 && (H.windowBits & 15 || (H.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; let O = Nt.inflateInit2( this.strm, - W.windowBits + H.windowBits ); if (O !== vr) - throw new Error(be[O]); - if (this.header = new Ls(), Nt.inflateGetHeader(this.strm, this.header), W.dictionary && (typeof W.dictionary == "string" ? W.dictionary = pr.string2buf(W.dictionary) : Vi.call(W.dictionary) === "[object ArrayBuffer]" && (W.dictionary = new Uint8Array(W.dictionary)), W.raw && (O = Nt.inflateSetDictionary(this.strm, W.dictionary), O !== vr))) - throw new Error(be[O]); + throw new Error(xe[O]); + if (this.header = new Ss(), Nt.inflateGetHeader(this.strm, this.header), H.dictionary && (typeof H.dictionary == "string" ? H.dictionary = pr.string2buf(H.dictionary) : Vi.call(H.dictionary) === "[object ArrayBuffer]" && (H.dictionary = new Uint8Array(H.dictionary)), H.raw && (O = Nt.inflateSetDictionary(this.strm, H.dictionary), O !== vr))) + throw new Error(xe[O]); } - br.prototype.push = function(x, W) { - const O = this.strm, J = this.options.chunkSize, ie = this.options.dictionary; - let te, De, xe; + br.prototype.push = function(x, H) { + const O = this.strm, q = this.options.chunkSize, ne = this.options.dictionary; + let ie, Pe, we; if (this.ended) return !1; - for (W === ~~W ? De = W : De = W === !0 ? Ts : Ss, Vi.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { - for (O.avail_out === 0 && (O.output = new Uint8Array(J), O.next_out = 0, O.avail_out = J), te = Nt.inflate(O, De), te === Zr && ie && (te = Nt.inflateSetDictionary(O, ie), te === vr ? te = Nt.inflate(O, De) : te === ji && (te = Zr)); O.avail_in > 0 && te === Kr && O.state.wrap > 0 && x[O.next_in] !== 0; ) - Nt.inflateReset(O), te = Nt.inflate(O, De); - switch (te) { + for (H === ~~H ? Pe = H : Pe = H === !0 ? Ts : Ls, Vi.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (O.avail_out === 0 && (O.output = new Uint8Array(q), O.next_out = 0, O.avail_out = q), ie = Nt.inflate(O, Pe), ie === Zr && ne && (ie = Nt.inflateSetDictionary(O, ne), ie === vr ? ie = Nt.inflate(O, Pe) : ie === ji && (ie = Zr)); O.avail_in > 0 && ie === Kr && O.state.wrap > 0 && x[O.next_in] !== 0; ) + Nt.inflateReset(O), ie = Nt.inflate(O, Pe); + switch (ie) { case Os: case ji: case Zr: case Ds: - return this.onEnd(te), this.ended = !0, !1; + return this.onEnd(ie), this.ended = !0, !1; } - if (xe = O.avail_out, O.next_out && (O.avail_out === 0 || te === Kr)) + if (we = O.avail_out, O.next_out && (O.avail_out === 0 || ie === Kr)) if (this.options.to === "string") { - let Qe = pr.utf8border(O.output, O.next_out), _e = O.next_out - Qe, Pe = pr.buf2string(O.output, Qe); - O.next_out = _e, O.avail_out = J - _e, _e && O.output.set(O.output.subarray(Qe, Qe + _e), 0), this.onData(Pe); + let Qe = pr.utf8border(O.output, O.next_out), me = O.next_out - Qe, Ie = pr.buf2string(O.output, Qe); + O.next_out = me, O.avail_out = q - me, me && O.output.set(O.output.subarray(Qe, Qe + me), 0), this.onData(Ie); } else this.onData(O.output.length === O.next_out ? O.output : O.output.subarray(0, O.next_out)); - if (!(te === vr && xe === 0)) { - if (te === Kr) - return te = Nt.inflateEnd(this.strm), this.onEnd(te), this.ended = !0, !0; + if (!(ie === vr && we === 0)) { + if (ie === Kr) + return ie = Nt.inflateEnd(this.strm), this.onEnd(ie), this.ended = !0, !0; if (O.avail_in === 0) break; } @@ -24922,24 +24922,24 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, br.prototype.onEnd = function(x) { x === vr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = x, this.msg = this.strm.msg; }; - function Yr(x, W) { - const O = new br(W); + function Yr(x, H) { + const O = new br(H); if (O.push(x), O.err) - throw O.msg || be[O.err]; + throw O.msg || xe[O.err]; return O.result; } - function Ps(x, W) { - return W = W || {}, W.raw = !0, Yr(x, W); + function Ps(x, H) { + return H = H || {}, H.raw = !0, Yr(x, H); } - var Is = br, Rs = Yr, $s = Ps, Bs = Yr, zs = Ee, ks = { + var Is = br, $s = Yr, Rs = Ps, Bs = Yr, zs = Me, ks = { Inflate: Is, - inflate: Rs, - inflateRaw: $s, + inflate: $s, + inflateRaw: Rs, ungzip: Bs, constants: zs }; const { Deflate: Fs, deflate: Us, deflateRaw: Ns, gzip: Gs } = Zn, { Inflate: Ws, inflate: Hs, inflateRaw: Vs, ungzip: js } = ks; - var Ki = Fs, Zi = Us, Yi = Ns, Xi = Gs, Qi = Ws, Ji = Hs, qi = Vs, en = js, tn = Ee, Ks = { + var Ki = Fs, Zi = Us, Yi = Ns, Xi = Gs, Qi = Ws, Ji = Hs, qi = Vs, en = js, tn = Me, Ks = { Deflate: Ki, deflate: Zi, deflateRaw: Yi, @@ -24954,11 +24954,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ) /******/ }, __webpack_module_cache__ = {}; - function __webpack_require__(r) { - var e = __webpack_module_cache__[r]; + function __webpack_require__(t) { + var e = __webpack_module_cache__[t]; if (e !== void 0) return e.exports; - var t = __webpack_module_cache__[r] = { + var r = __webpack_module_cache__[t] = { /******/ // no module.id needed /******/ @@ -24967,22 +24967,22 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; exports: {} /******/ }; - return __webpack_modules__[r].call(t.exports, t, t.exports, __webpack_require__), t.exports; + return __webpack_modules__[t].call(r.exports, r, r.exports, __webpack_require__), r.exports; } - __webpack_require__.n = (r) => { - var e = r && r.__esModule ? ( + __webpack_require__.n = (t) => { + var e = t && t.__esModule ? ( /******/ - () => r.default + () => t.default ) : ( /******/ - () => r + () => t ); return __webpack_require__.d(e, { a: e }), e; - }, __webpack_require__.d = (r, e) => { - for (var t in e) - __webpack_require__.o(e, t) && !__webpack_require__.o(r, t) && Object.defineProperty(r, t, { enumerable: !0, get: e[t] }); - }, __webpack_require__.o = (r, e) => Object.prototype.hasOwnProperty.call(r, e), __webpack_require__.r = (r) => { - typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 }); + }, __webpack_require__.d = (t, e) => { + for (var r in e) + __webpack_require__.o(e, r) && !__webpack_require__.o(t, r) && Object.defineProperty(t, r, { enumerable: !0, get: e[r] }); + }, __webpack_require__.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), __webpack_require__.r = (t) => { + typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }, __webpack_require__("./src/index.ts"), __webpack_require__("./src/SurfaceWorker.js"); var __webpack_exports__ = __webpack_require__("./src/exporter.js"); return __webpack_exports__; @@ -25019,169 +25019,169 @@ const _3Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), Molecular toggle_class: toggle_class$5, transition_in: transition_in$7 } = window.__gradio__svelte__internal, { onMount: onMount$1 } = window.__gradio__svelte__internal; -function get_each_context$2(r, e, t) { - const n = r.slice(); - return n[53] = e[t], n[54] = e, n[55] = t, n; +function get_each_context$2(t, e, r) { + const n = t.slice(); + return n[53] = e[r], n[54] = e, n[55] = r, n; } -function get_each_context_1$1(r, e, t) { - const n = r.slice(); - return n[56] = e[t], n[58] = t, n; +function get_each_context_1$1(t, e, r) { + const n = t.slice(); + return n[56] = e[r], n[58] = r, n; } -function get_each_context_2(r, e, t) { - const n = r.slice(); - return n[59] = e[t], n[60] = e, n[61] = t, n; +function get_each_context_2(t, e, r) { + const n = t.slice(); + return n[59] = e[r], n[60] = e, n[61] = r, n; } -function get_each_context_3(r, e, t) { - const n = r.slice(); - return n[62] = e[t], n; +function get_each_context_3(t, e, r) { + const n = t.slice(); + return n[62] = e[r], n; } -function create_if_block_8$1(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P; +function create_if_block_8$1(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o, A, p, v, a, l, g, M, C, T, D, I, B, P; return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("span"), f.textContent = " ", u = element$7("span"), y = text$3("Very high ("), h = text$3( + e = element$7("div"), r = element$7("div"), n = element$7("div"), f = element$7("span"), f.textContent = " ", u = element$7("span"), b = text$3("Very high ("), h = text$3( /*confidenceLabel*/ - r[2] - ), _ = text$3(" > 90)"), E = space$7(), c = element$7("div"), C = element$7("span"), C.textContent = " ", b = element$7("span"), A = text$3("Confident (90 > "), S = text$3( + t[2] + ), _ = text$3(" > 90)"), E = space$7(), c = element$7("div"), S = element$7("span"), S.textContent = " ", y = element$7("span"), w = text$3("Confident (90 > "), L = text$3( /*confidenceLabel*/ - r[2] - ), s = text$3(" > 70)"), o = space$7(), w = element$7("div"), p = element$7("span"), p.textContent = " ", v = element$7("span"), a = text$3("Low (70 > "), l = text$3( + t[2] + ), s = text$3(" > 70)"), o = space$7(), A = element$7("div"), p = element$7("span"), p.textContent = " ", v = element$7("span"), a = text$3("Low (70 > "), l = text$3( /*confidenceLabel*/ - r[2] - ), g = text$3(" > 50)"), M = space$7(), L = element$7("div"), T = element$7("span"), T.textContent = " ", D = element$7("span"), I = text$3("Very low ("), z = text$3( + t[2] + ), g = text$3(" > 50)"), M = space$7(), C = element$7("div"), T = element$7("span"), T.textContent = " ", D = element$7("span"), I = text$3("Very low ("), B = text$3( /*confidenceLabel*/ - r[2] - ), P = text$3(" < 50)"), attr$8(f, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(f, "background-color", "rgb(0, 83, 214)"), attr$8(u, "class", "legendlabel svelte-1skivl7"), attr$8(n, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(C, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(C, "background-color", "rgb(101, 203, 243)"), attr$8(b, "class", "legendlabel svelte-1skivl7"), attr$8(c, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(p, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(p, "background-color", "rgb(255, 219, 19)"), attr$8(v, "class", "legendlabel svelte-1skivl7"), attr$8(w, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(T, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(T, "background-color", "rgb(255, 125, 69)"), attr$8(D, "class", "legendlabel svelte-1skivl7"), attr$8(L, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(t, "class", "flex text-sm items-center space-x-2 justify-center svelte-1skivl7"), attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 -mb-2 w-full bg-white svelte-1skivl7"); + t[2] + ), P = text$3(" < 50)"), attr$8(f, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(f, "background-color", "rgb(0, 83, 214)"), attr$8(u, "class", "legendlabel svelte-1skivl7"), attr$8(n, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(S, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(S, "background-color", "rgb(101, 203, 243)"), attr$8(y, "class", "legendlabel svelte-1skivl7"), attr$8(c, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(p, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(p, "background-color", "rgb(255, 219, 19)"), attr$8(v, "class", "legendlabel svelte-1skivl7"), attr$8(A, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(T, "class", "w-4 h-4 svelte-1skivl7"), set_style$3(T, "background-color", "rgb(255, 125, 69)"), attr$8(D, "class", "legendlabel svelte-1skivl7"), attr$8(C, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(r, "class", "flex text-sm items-center space-x-2 justify-center svelte-1skivl7"), attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 -mb-2 w-full bg-white svelte-1skivl7"); }, - m(B, k) { - insert$a(B, e, k), append$8(e, t), append$8(t, n), append$8(n, f), append$8(n, u), append$8(u, y), append$8(u, h), append$8(u, _), append$8(t, E), append$8(t, c), append$8(c, C), append$8(c, b), append$8(b, A), append$8(b, S), append$8(b, s), append$8(t, o), append$8(t, w), append$8(w, p), append$8(w, v), append$8(v, a), append$8(v, l), append$8(v, g), append$8(t, M), append$8(t, L), append$8(L, T), append$8(L, D), append$8(D, I), append$8(D, z), append$8(D, P); + m(z, k) { + insert$a(z, e, k), append$8(e, r), append$8(r, n), append$8(n, f), append$8(n, u), append$8(u, b), append$8(u, h), append$8(u, _), append$8(r, E), append$8(r, c), append$8(c, S), append$8(c, y), append$8(y, w), append$8(y, L), append$8(y, s), append$8(r, o), append$8(r, A), append$8(A, p), append$8(A, v), append$8(v, a), append$8(v, l), append$8(v, g), append$8(r, M), append$8(r, C), append$8(C, T), append$8(C, D), append$8(D, I), append$8(D, B), append$8(D, P); }, - p(B, k) { + p(z, k) { k[0] & /*confidenceLabel*/ 4 && set_data$3( h, /*confidenceLabel*/ - B[2] + z[2] ), k[0] & /*confidenceLabel*/ 4 && set_data$3( - S, + L, /*confidenceLabel*/ - B[2] + z[2] ), k[0] & /*confidenceLabel*/ 4 && set_data$3( l, /*confidenceLabel*/ - B[2] + z[2] ), k[0] & /*confidenceLabel*/ 4 && set_data$3( - z, + B, /*confidenceLabel*/ - B[2] + z[2] ); }, - d(B) { - B && detach$a(e); + d(z) { + z && detach$a(e); } }; } -function create_if_block_6$1(r) { +function create_if_block_6$1(t) { let e; - function t(u, y) { + function r(u, b) { return ( /*isAnimated*/ u[10] ? create_else_block$5 : create_if_block_7$1 ); } - let n = t(r), f = n(r); + let n = r(t), f = n(t); return { c() { e = element$7("div"), f.c(), attr$8(e, "class", "absolute z-50 bottom-0 right-0 mr-2 flex divide-x border border-gray-200 mb-2 rounded items-center justify-center svelte-1skivl7"); }, - m(u, y) { - insert$a(u, e, y), f.m(e, null); + m(u, b) { + insert$a(u, e, b), f.m(e, null); }, - p(u, y) { - n === (n = t(u)) && f ? f.p(u, y) : (f.d(1), f = n(u), f && (f.c(), f.m(e, null))); + p(u, b) { + n === (n = r(u)) && f ? f.p(u, b) : (f.d(1), f = n(u), f && (f.c(), f.m(e, null))); }, d(u) { u && detach$a(e), f.d(); } }; } -function create_else_block$5(r) { - let e, t, n; +function create_else_block$5(t) { + let e, r, n; return { c() { e = element$7("button"), e.innerHTML = '', attr$8(e, "class", "p-2 svelte-1skivl7"), attr$8(e, "title", "Pause"); }, m(f, u) { - insert$a(f, e, u), t || (n = listen$2( + insert$a(f, e, u), r || (n = listen$2( e, "click", /*toggleAnimation*/ - r[19] - ), t = !0); + t[19] + ), r = !0); }, p: noop$6, d(f) { - f && detach$a(e), t = !1, n(); + f && detach$a(e), r = !1, n(); } }; } -function create_if_block_7$1(r) { - let e, t, n; +function create_if_block_7$1(t) { + let e, r, n; return { c() { e = element$7("button"), e.innerHTML = '', attr$8(e, "class", "p-2 svelte-1skivl7"), attr$8(e, "title", "Play"); }, m(f, u) { - insert$a(f, e, u), t || (n = listen$2( + insert$a(f, e, u), r || (n = listen$2( e, "click", /*toggleAnimation*/ - r[19] - ), t = !0); + t[19] + ), r = !0); }, p: noop$6, d(f) { - f && detach$a(e), t = !1, n(); + f && detach$a(e), r = !1, n(); } }; } -function create_if_block_2$1(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p = ensure_array_like$2(Object.keys( +function create_if_block_2$1(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o, A, p = ensure_array_like$2(Object.keys( /*config*/ - r[0] + t[0] )), v = []; for (let a = 0; a < p.length; a += 1) - v[a] = create_each_block_2(get_each_context_2(r, p, a)); + v[a] = create_each_block_2(get_each_context_2(t, p, a)); return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("h5"), n.textContent = "Settings", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', y = space$7(); + e = element$7("div"), r = element$7("div"), n = element$7("h5"), n.textContent = "Settings", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', b = space$7(); for (let a = 0; a < v.length; a += 1) v[a].c(); - h = space$7(), _ = element$7("div"), E = element$7("div"), c = element$7("label"), c.textContent = "Label atoms on hover", C = space$7(), b = element$7("label"), A = element$7("input"), S = space$7(), s = element$7("div"), attr$8(n, "id", "settings-drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(t, "class", "p-4 svelte-1skivl7"), attr$8(c, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(A, "type", "checkbox"), attr$8(A, "class", "sr-only peer svelte-1skivl7"), attr$8(s, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(b, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7"), attr$8(E, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(_, "class", "bg-white svelte-1skivl7"), attr$8(e, "id", "settings-drawer"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "settings-drawer-label"); + h = space$7(), _ = element$7("div"), E = element$7("div"), c = element$7("label"), c.textContent = "Label atoms on hover", S = space$7(), y = element$7("label"), w = element$7("input"), L = space$7(), s = element$7("div"), attr$8(n, "id", "settings-drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(r, "class", "p-4 svelte-1skivl7"), attr$8(c, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(w, "type", "checkbox"), attr$8(w, "class", "sr-only peer svelte-1skivl7"), attr$8(s, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(y, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7"), attr$8(E, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(_, "class", "bg-white svelte-1skivl7"), attr$8(e, "id", "settings-drawer"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "settings-drawer-label"); }, m(a, l) { - insert$a(a, e, l), append$8(e, t), append$8(t, n), append$8(t, f), append$8(t, u), append$8(e, y); + insert$a(a, e, l), append$8(e, r), append$8(r, n), append$8(r, f), append$8(r, u), append$8(e, b); for (let g = 0; g < v.length; g += 1) v[g] && v[g].m(e, null); - append$8(e, h), append$8(e, _), append$8(_, E), append$8(E, c), append$8(E, C), append$8(E, b), append$8(b, A), set_input_value$1( - A, + append$8(e, h), append$8(e, _), append$8(_, E), append$8(E, c), append$8(E, S), append$8(E, y), append$8(y, w), set_input_value$1( + w, /*labelHover*/ - r[5] - ), append$8(b, S), append$8(b, s), o || (w = [ + t[5] + ), append$8(y, L), append$8(y, s), o || (A = [ listen$2( u, "click", /*toggleOffCanvas*/ - r[14] + t[14] ), listen$2( - A, + w, "change", /*input_change_handler_1*/ - r[25] + t[25] ) ], o = !0); }, @@ -25203,712 +25203,712 @@ function create_if_block_2$1(r) { } l[0] & /*labelHover*/ 32 && set_input_value$1( - A, + w, /*labelHover*/ a[5] ); }, d(a) { - a && detach$a(e), destroy_each$2(v, a), o = !1, run_all$3(w); + a && detach$a(e), destroy_each$2(v, a), o = !1, run_all$3(A); } }; } -function create_if_block_5$1(r) { - let e, t, n, f, u, y; +function create_if_block_5$1(t) { + let e, r, n, f, u, b; function h() { - r[22].call( - t, + t[22].call( + r, /*setting*/ - r[59] + t[59] ); } return { c() { - e = element$7("label"), t = element$7("input"), n = space$7(), f = element$7("div"), attr$8(t, "type", "checkbox"), t.__value = "", set_input_value$1(t, t.__value), attr$8(t, "class", "sr-only peer svelte-1skivl7"), attr$8(f, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(e, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7"); + e = element$7("label"), r = element$7("input"), n = space$7(), f = element$7("div"), attr$8(r, "type", "checkbox"), r.__value = "", set_input_value$1(r, r.__value), attr$8(r, "class", "sr-only peer svelte-1skivl7"), attr$8(f, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(e, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7"); }, m(_, E) { - insert$a(_, e, E), append$8(e, t), t.checked = /*config*/ - r[0][ + insert$a(_, e, E), append$8(e, r), r.checked = /*config*/ + t[0][ /*setting*/ - r[59] - ], append$8(e, n), append$8(e, f), u || (y = listen$2(t, "change", h), u = !0); + t[59] + ], append$8(e, n), append$8(e, f), u || (b = listen$2(r, "change", h), u = !0); }, p(_, E) { - r = _, E[0] & /*config, settings*/ - 4097 && (t.checked = /*config*/ - r[0][ + t = _, E[0] & /*config, settings*/ + 4097 && (r.checked = /*config*/ + t[0][ /*setting*/ - r[59] + t[59] ]); }, d(_) { - _ && detach$a(e), u = !1, y(); + _ && detach$a(e), u = !1, b(); } }; } -function create_if_block_4$1(r) { - let e, t, n, f, u, y, h, _, E = ( +function create_if_block_4$1(t) { + let e, r, n, f, u, b, h, _, E = ( /*config*/ - r[0][ + t[0][ /*setting*/ - r[59] + t[59] ] + "" - ), c, C, b; - function A() { + ), c, S, y; + function w() { return ( /*change_handler*/ - r[23]( + t[23]( /*setting*/ - r[59] + t[59] ) ); } return { c() { - e = element$7("div"), t = element$7("input"), h = space$7(), _ = element$7("span"), c = text$3(E), attr$8(t, "id", "medium-range"), attr$8(t, "type", "range"), t.value = n = /*config*/ - r[0][ + e = element$7("div"), r = element$7("input"), h = space$7(), _ = element$7("span"), c = text$3(E), attr$8(r, "id", "medium-range"), attr$8(r, "type", "range"), r.value = n = /*config*/ + t[0][ /*setting*/ - r[59] - ], attr$8(t, "min", f = /*settings*/ - r[12][ + t[59] + ], attr$8(r, "min", f = /*settings*/ + t[12][ /*setting*/ - r[59] - ].min), attr$8(t, "max", u = /*settings*/ - r[12][ + t[59] + ].min), attr$8(r, "max", u = /*settings*/ + t[12][ /*setting*/ - r[59] - ].max), attr$8(t, "step", y = /*settings*/ - r[12][ + t[59] + ].max), attr$8(r, "step", b = /*settings*/ + t[12][ /*setting*/ - r[59] - ].step), attr$8(t, "class", "w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(_, "class", "w-1/3 text-center text-sm font-medium text-gray-600 dark:text-gray-400 svelte-1skivl7"), attr$8(e, "class", "flex items-center svelte-1skivl7"); + t[59] + ].step), attr$8(r, "class", "w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(_, "class", "w-1/3 text-center text-sm font-medium text-gray-600 dark:text-gray-400 svelte-1skivl7"), attr$8(e, "class", "flex items-center svelte-1skivl7"); }, - m(S, s) { - insert$a(S, e, s), append$8(e, t), append$8(e, h), append$8(e, _), append$8(_, c), C || (b = listen$2(t, "change", A), C = !0); + m(L, s) { + insert$a(L, e, s), append$8(e, r), append$8(e, h), append$8(e, _), append$8(_, c), S || (y = listen$2(r, "change", w), S = !0); }, - p(S, s) { - r = S, s[0] & /*config, settings*/ + p(L, s) { + t = L, s[0] & /*config, settings*/ 4097 && n !== (n = /*config*/ - r[0][ + t[0][ /*setting*/ - r[59] - ]) && (t.value = n), s[0] & /*config, settings*/ + t[59] + ]) && (r.value = n), s[0] & /*config, settings*/ 4097 && f !== (f = /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] - ].min) && attr$8(t, "min", f), s[0] & /*config, settings*/ + t[59] + ].min) && attr$8(r, "min", f), s[0] & /*config, settings*/ 4097 && u !== (u = /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] - ].max) && attr$8(t, "max", u), s[0] & /*config, settings*/ - 4097 && y !== (y = /*settings*/ - r[12][ + t[59] + ].max) && attr$8(r, "max", u), s[0] & /*config, settings*/ + 4097 && b !== (b = /*settings*/ + t[12][ /*setting*/ - r[59] - ].step) && attr$8(t, "step", y), s[0] & /*config*/ + t[59] + ].step) && attr$8(r, "step", b), s[0] & /*config*/ 1 && E !== (E = /*config*/ - r[0][ + t[0][ /*setting*/ - r[59] + t[59] ] + "") && set_data$3(c, E); }, - d(S) { - S && detach$a(e), C = !1, b(); + d(L) { + L && detach$a(e), S = !1, y(); } }; } -function create_if_block_3$1(r) { - let e, t, n, f, u, y, h, _, E = ensure_array_like$2( +function create_if_block_3$1(t) { + let e, r, n, f, u, b, h, _, E = ensure_array_like$2( /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] + t[59] ].options ), c = []; - for (let b = 0; b < E.length; b += 1) - c[b] = create_each_block_3(get_each_context_3(r, E, b)); - function C() { - r[24].call( + for (let y = 0; y < E.length; y += 1) + c[y] = create_each_block_3(get_each_context_3(t, E, y)); + function S() { + t[24].call( u, /*setting*/ - r[59] + t[59] ); } return { c() { - e = element$7("label"), t = text$3("Select style"), f = space$7(), u = element$7("select"); - for (let b = 0; b < c.length; b += 1) - c[b].c(); + e = element$7("label"), r = text$3("Select style"), f = space$7(), u = element$7("select"); + for (let y = 0; y < c.length; y += 1) + c[y].c(); attr$8(e, "for", n = /*setting*/ - r[59]), attr$8(e, "class", "sr-only svelte-1skivl7"), attr$8(u, "id", y = /*setting*/ - r[59]), attr$8(u, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*config*/ - r[0][ + t[59]), attr$8(e, "class", "sr-only svelte-1skivl7"), attr$8(u, "id", b = /*setting*/ + t[59]), attr$8(u, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*config*/ + t[0][ /*setting*/ - r[59] - ] === void 0 && add_render_callback(C); + t[59] + ] === void 0 && add_render_callback(S); }, - m(b, A) { - insert$a(b, e, A), append$8(e, t), insert$a(b, f, A), insert$a(b, u, A); - for (let S = 0; S < c.length; S += 1) - c[S] && c[S].m(u, null); + m(y, w) { + insert$a(y, e, w), append$8(e, r), insert$a(y, f, w), insert$a(y, u, w); + for (let L = 0; L < c.length; L += 1) + c[L] && c[L].m(u, null); select_option( u, /*config*/ - r[0][ + t[0][ /*setting*/ - r[59] + t[59] ], !0 - ), h || (_ = listen$2(u, "change", C), h = !0); + ), h || (_ = listen$2(u, "change", S), h = !0); }, - p(b, A) { - if (r = b, A[0] & /*config, settings*/ + p(y, w) { + if (t = y, w[0] & /*config, settings*/ 4097 && n !== (n = /*setting*/ - r[59]) && attr$8(e, "for", n), A[0] & /*settings, config*/ + t[59]) && attr$8(e, "for", n), w[0] & /*settings, config*/ 4097) { E = ensure_array_like$2( /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] + t[59] ].options ); - let S; - for (S = 0; S < E.length; S += 1) { - const s = get_each_context_3(r, E, S); - c[S] ? c[S].p(s, A) : (c[S] = create_each_block_3(s), c[S].c(), c[S].m(u, null)); + let L; + for (L = 0; L < E.length; L += 1) { + const s = get_each_context_3(t, E, L); + c[L] ? c[L].p(s, w) : (c[L] = create_each_block_3(s), c[L].c(), c[L].m(u, null)); } - for (; S < c.length; S += 1) - c[S].d(1); + for (; L < c.length; L += 1) + c[L].d(1); c.length = E.length; } - A[0] & /*config, settings*/ - 4097 && y !== (y = /*setting*/ - r[59]) && attr$8(u, "id", y), A[0] & /*config, settings*/ + w[0] & /*config, settings*/ + 4097 && b !== (b = /*setting*/ + t[59]) && attr$8(u, "id", b), w[0] & /*config, settings*/ 4097 && select_option( u, /*config*/ - r[0][ + t[0][ /*setting*/ - r[59] + t[59] ] ); }, - d(b) { - b && (detach$a(e), detach$a(f), detach$a(u)), destroy_each$2(c, b), h = !1, _(); + d(y) { + y && (detach$a(e), detach$a(f), detach$a(u)), destroy_each$2(c, y), h = !1, _(); } }; } -function create_each_block_3(r) { - let e, t = ( +function create_each_block_3(t) { + let e, r = ( /*option*/ - r[62] + "" + t[62] + "" ), n, f, u; return { c() { - e = element$7("option"), n = text$3(t), e.__value = f = /*option*/ - r[62], set_input_value$1(e, e.__value), e.selected = u = /*option*/ - r[62] == /*config*/ - r[0][ + e = element$7("option"), n = text$3(r), e.__value = f = /*option*/ + t[62], set_input_value$1(e, e.__value), e.selected = u = /*option*/ + t[62] == /*config*/ + t[0][ /*setting*/ - r[59] + t[59] ], attr$8(e, "class", "svelte-1skivl7"); }, - m(y, h) { - insert$a(y, e, h), append$8(e, n); + m(b, h) { + insert$a(b, e, h), append$8(e, n); }, - p(y, h) { + p(b, h) { h[0] & /*config*/ - 1 && t !== (t = /*option*/ - y[62] + "") && set_data$3(n, t), h[0] & /*config, settings*/ + 1 && r !== (r = /*option*/ + b[62] + "") && set_data$3(n, r), h[0] & /*config, settings*/ 4097 && f !== (f = /*option*/ - y[62]) && (e.__value = f, set_input_value$1(e, e.__value)), h[0] & /*config, settings*/ + b[62]) && (e.__value = f, set_input_value$1(e, e.__value)), h[0] & /*config, settings*/ 4097 && u !== (u = /*option*/ - y[62] == /*config*/ - y[0][ + b[62] == /*config*/ + b[0][ /*setting*/ - y[59] + b[59] ]) && (e.selected = u); }, - d(y) { - y && detach$a(e); + d(b) { + b && detach$a(e); } }; } -function create_each_block_2(r) { - let e, t, n, f = ( +function create_each_block_2(t) { + let e, r, n, f = ( /*setting*/ - r[59] + "" - ), u, y, h, _, E, c = ( + t[59] + "" + ), u, b, h, _, E, c = ( /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] - ].type == "toggle" && create_if_block_5$1(r) - ), C = ( + t[59] + ].type == "toggle" && create_if_block_5$1(t) + ), S = ( /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] - ].type == "range" && create_if_block_4$1(r) - ), b = ( + t[59] + ].type == "range" && create_if_block_4$1(t) + ), y = ( /*settings*/ - r[12][ + t[12][ /*setting*/ - r[59] - ].type == "select" && create_if_block_3$1(r) + t[59] + ].type == "select" && create_if_block_3$1(t) ); return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("label"), u = text$3(f), h = space$7(), c && c.c(), _ = space$7(), C && C.c(), E = space$7(), b && b.c(), attr$8(n, "for", y = /*setting*/ - r[59]), attr$8(n, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(t, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(e, "class", "flex flex-col mb-4 divide-y svelte-1skivl7"); + e = element$7("div"), r = element$7("div"), n = element$7("label"), u = text$3(f), h = space$7(), c && c.c(), _ = space$7(), S && S.c(), E = space$7(), y && y.c(), attr$8(n, "for", b = /*setting*/ + t[59]), attr$8(n, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(r, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(e, "class", "flex flex-col mb-4 divide-y svelte-1skivl7"); }, - m(A, S) { - insert$a(A, e, S), append$8(e, t), append$8(t, n), append$8(n, u), append$8(t, h), c && c.m(t, null), append$8(t, _), C && C.m(t, null), append$8(t, E), b && b.m(t, null); + m(w, L) { + insert$a(w, e, L), append$8(e, r), append$8(r, n), append$8(n, u), append$8(r, h), c && c.m(r, null), append$8(r, _), S && S.m(r, null), append$8(r, E), y && y.m(r, null); }, - p(A, S) { - S[0] & /*config*/ + p(w, L) { + L[0] & /*config*/ 1 && f !== (f = /*setting*/ - A[59] + "") && set_data$3(u, f), S[0] & /*config, settings*/ - 4097 && y !== (y = /*setting*/ - A[59]) && attr$8(n, "for", y), /*settings*/ - A[12][ + w[59] + "") && set_data$3(u, f), L[0] & /*config, settings*/ + 4097 && b !== (b = /*setting*/ + w[59]) && attr$8(n, "for", b), /*settings*/ + w[12][ /*setting*/ - A[59] - ].type == "toggle" ? c ? c.p(A, S) : (c = create_if_block_5$1(A), c.c(), c.m(t, _)) : c && (c.d(1), c = null), /*settings*/ - A[12][ + w[59] + ].type == "toggle" ? c ? c.p(w, L) : (c = create_if_block_5$1(w), c.c(), c.m(r, _)) : c && (c.d(1), c = null), /*settings*/ + w[12][ /*setting*/ - A[59] - ].type == "range" ? C ? C.p(A, S) : (C = create_if_block_4$1(A), C.c(), C.m(t, E)) : C && (C.d(1), C = null), /*settings*/ - A[12][ + w[59] + ].type == "range" ? S ? S.p(w, L) : (S = create_if_block_4$1(w), S.c(), S.m(r, E)) : S && (S.d(1), S = null), /*settings*/ + w[12][ /*setting*/ - A[59] - ].type == "select" ? b ? b.p(A, S) : (b = create_if_block_3$1(A), b.c(), b.m(t, null)) : b && (b.d(1), b = null); + w[59] + ].type == "select" ? y ? y.p(w, L) : (y = create_if_block_3$1(w), y.c(), y.m(r, null)) : y && (y.d(1), y = null); }, - d(A) { - A && detach$a(e), c && c.d(), C && C.d(), b && b.d(); + d(w) { + w && detach$a(e), c && c.d(), S && S.d(), y && y.d(); } }; } -function create_if_block$6(r) { - let e, t, n, f, u, y, h, _, E, c, C = ensure_array_like$2( +function create_if_block$6(t) { + let e, r, n, f, u, b, h, _, E, c, S = ensure_array_like$2( /*representations*/ - r[1] - ), b = []; - for (let A = 0; A < C.length; A += 1) - b[A] = create_each_block$2(get_each_context$2(r, C, A)); + t[1] + ), y = []; + for (let w = 0; w < S.length; w += 1) + y[w] = create_each_block$2(get_each_context$2(t, S, w)); return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("h5"), n.textContent = "Representations", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', y = space$7(); - for (let A = 0; A < b.length; A += 1) - b[A].c(); - h = space$7(), _ = element$7("button"), _.innerHTML = '
Add representation
', attr$8(n, "id", "drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(t, "class", "p-4 svelte-1skivl7"), attr$8(_, "class", "w-full flex text-orange-600 justify-center my-2 text-sm space-x-2 items-center hover:text-gray-600 cursor-pointer svelte-1skivl7"), attr$8(e, "id", "drawer-example"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 border-l border-gray-200 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "drawer-label"); - }, - m(A, S) { - insert$a(A, e, S), append$8(e, t), append$8(t, n), append$8(t, f), append$8(t, u), append$8(e, y); - for (let s = 0; s < b.length; s += 1) - b[s] && b[s].m(e, null); + e = element$7("div"), r = element$7("div"), n = element$7("h5"), n.textContent = "Representations", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', b = space$7(); + for (let w = 0; w < y.length; w += 1) + y[w].c(); + h = space$7(), _ = element$7("button"), _.innerHTML = '
Add representation
', attr$8(n, "id", "drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(r, "class", "p-4 svelte-1skivl7"), attr$8(_, "class", "w-full flex text-orange-600 justify-center my-2 text-sm space-x-2 items-center hover:text-gray-600 cursor-pointer svelte-1skivl7"), attr$8(e, "id", "drawer-example"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 border-l border-gray-200 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "drawer-label"); + }, + m(w, L) { + insert$a(w, e, L), append$8(e, r), append$8(r, n), append$8(r, f), append$8(r, u), append$8(e, b); + for (let s = 0; s < y.length; s += 1) + y[s] && y[s].m(e, null); append$8(e, h), append$8(e, _), E || (c = [ listen$2( u, "click", /*toggleOffCanvasReps*/ - r[15] + t[15] ), listen$2( _, "click", /*insertRep*/ - r[17] + t[17] ) ], E = !0); }, - p(A, S) { - if (S[0] & /*representations, moldata, resetZoom, deleteRep*/ + p(w, L) { + if (L[0] & /*representations, moldata, resetZoom, deleteRep*/ 327690) { - C = ensure_array_like$2( + S = ensure_array_like$2( /*representations*/ - A[1] + w[1] ); let s; - for (s = 0; s < C.length; s += 1) { - const o = get_each_context$2(A, C, s); - b[s] ? b[s].p(o, S) : (b[s] = create_each_block$2(o), b[s].c(), b[s].m(e, h)); + for (s = 0; s < S.length; s += 1) { + const o = get_each_context$2(w, S, s); + y[s] ? y[s].p(o, L) : (y[s] = create_each_block$2(o), y[s].c(), y[s].m(e, h)); } - for (; s < b.length; s += 1) - b[s].d(1); - b.length = C.length; + for (; s < y.length; s += 1) + y[s].d(1); + y.length = S.length; } }, - d(A) { - A && detach$a(e), destroy_each$2(b, A), E = !1, run_all$3(c); + d(w) { + w && detach$a(e), destroy_each$2(y, w), E = !1, run_all$3(c); } }; } -function create_if_block_1$5(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B, k, N, $, F, G, H, U, V, Q, ae, oe, q, me, ne, fe, Ce, Me, Te, se, pe, we, Fe, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve, Ie, Re, Z, ce, Ae, ke, he, Oe, j, $e, Ve, R, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt, it, tt, Et, lt = ensure_array_like$2( +function create_if_block_1$5(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o, A, p, v, a, l, g, M, C, T, D, I, B, P, z, k, N, R, U, W, G, F, V, J, X, oe, te, ve, se, le, Ce, be, Le, ae, _e, Ee, Be, Ne, Ge, ke, pe, de, ce, Ae, Oe, We, Ue, Z, j, ee, ge, ye, $e, Re, Y, ue, Se, Fe, he, De, K, ze, Ve, $, xe, Me, Q, fe, Te, Ze, Ke, je, Je, St, rt, it, tt, Et, lt = ensure_array_like$2( /*moldata*/ - r[3] + t[3] ), wt = []; for (let pt = 0; pt < lt.length; pt += 1) - wt[pt] = create_each_block_1$1(get_each_context_1$1(r, lt, pt)); + wt[pt] = create_each_block_1$1(get_each_context_1$1(t, lt, pt)); function Pt() { - r[29].call( + t[29].call( n, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function vt() { - r[30].call( + t[30].call( u, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function bt() { - r[31].call( + t[31].call( _, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function mt() { - r[32].call( + t[32].call( c, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function Tt() { - r[33].call( + t[33].call( s, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function Ot(...pt) { return ( /*change_handler_1*/ - r[34]( + t[34]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55], + t[55], ...pt ) ); } function kt() { - r[35].call( - z, + t[35].call( + B, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } - function Qt() { - r[36].call( - U, + function Xt() { + t[36].call( + F, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } function Ft() { - r[37].call( - fe, + t[37].call( + le, /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ); } - function Jt() { + function Qt() { return ( /*click_handler_3*/ - r[38]( + t[38]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } - function qt() { + function Jt() { return ( /*click_handler_4*/ - r[39]( + t[39]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } - function er() { + function qt() { return ( /*click_handler_5*/ - r[40]( + t[40]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } - function Ht() { + function er() { return ( /*click_handler_6*/ - r[41]( + t[41]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function tr() { return ( /*click_handler_7*/ - r[42]( + t[42]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function lr() { return ( /*click_handler_8*/ - r[43]( + t[43]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function Or() { return ( /*click_handler_9*/ - r[44]( + t[44]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function Dr() { return ( /*click_handler_10*/ - r[45]( + t[45]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function Pr() { return ( /*click_handler_11*/ - r[46]( + t[46]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function Ir() { return ( /*click_handler_12*/ - r[47]( + t[47]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function at() { return ( /*click_handler_13*/ - r[48]( + t[48]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function Bt() { return ( /*click_handler_14*/ - r[49]( + t[49]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("select"); + e = element$7("div"), r = element$7("div"), n = element$7("select"); for (let pt = 0; pt < wt.length; pt += 1) wt[pt].c(); - f = space$7(), u = element$7("input"), y = space$7(), h = element$7("div"), _ = element$7("input"), E = space$7(), c = element$7("input"), C = space$7(), b = element$7("div"), A = element$7("label"), A.textContent = "Select style", S = space$7(), s = element$7("select"), o = element$7("option"), o.textContent = "Stick", w = element$7("option"), w.textContent = "Cartoon", p = element$7("option"), p.textContent = "Surface", v = text$3(`$ - `), a = element$7("option"), a.textContent = "Sphere", l = space$7(), g = element$7("div"), M = element$7("div"), M.textContent = "Expand selection", L = space$7(), T = element$7("input"), I = space$7(), z = element$7("input"), P = space$7(), B = element$7("div"), B.textContent = "Å", k = space$7(), N = element$7("div"), $ = element$7("div"), F = element$7("span"), F.textContent = "Full residue", G = space$7(), H = element$7("label"), U = element$7("input"), V = space$7(), Q = element$7("div"), ae = space$7(), oe = element$7("div"), q = element$7("span"), q.textContent = "Only sidechain", me = space$7(), ne = element$7("label"), fe = element$7("input"), Ce = space$7(), Me = element$7("div"), Te = space$7(), se = element$7("div"), pe = element$7("button"), Fe = space$7(), Ue = element$7("button"), Be = space$7(), ue = element$7("button"), ge = space$7(), Se = element$7("button"), He = space$7(), We = element$7("button"), K = space$7(), ee = element$7("button"), ve = space$7(), Ie = element$7("button"), Z = space$7(), ce = element$7("div"), Ae = element$7("button"), ke = text$3("AlphaFold"), Oe = space$7(), j = element$7("button"), $e = text$3("PyMol"), R = space$7(), be = element$7("button"), Ee = text$3("Jmol"), le = space$7(), Le = element$7("button"), Ze = text$3("Chain"), je = space$7(), Je = element$7("button"), Lt = text$3("Spectrum"), attr$8(n, "id", "style"), attr$8(n, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/ - r[53].model === void 0 && add_render_callback(Pt), attr$8(u, "type", "text"), attr$8(u, "id", "chain"), attr$8(u, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(u, "placeholder", "Chain"), attr$8(t, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(_, "type", "text"), attr$8(_, "id", "chain"), attr$8(_, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(_, "placeholder", "Resname"), attr$8(c, "type", "text"), attr$8(c, "id", "residue_range"), attr$8(c, "class", "w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(c, "placeholder", "Residue range"), attr$8(h, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(A, "for", "countries"), attr$8(A, "class", "block mb-2 text-sm w-1/3 font-medium text-gray-600 dark:text-white svelte-1skivl7"), o.__value = "stick", set_input_value$1(o, o.__value), attr$8(o, "class", "svelte-1skivl7"), w.__value = "cartoon", set_input_value$1(w, w.__value), attr$8(w, "class", "svelte-1skivl7"), p.__value = "surface", set_input_value$1(p, p.__value), attr$8(p, "class", "svelte-1skivl7"), a.__value = "sphere", set_input_value$1(a, a.__value), attr$8(a, "class", "svelte-1skivl7"), attr$8(s, "id", "style"), attr$8(s, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/ - r[53].style === void 0 && add_render_callback(Tt), attr$8(b, "class", "p-1 flex space-x-1 items-center svelte-1skivl7"), attr$8(M, "class", " svelte-1skivl7"), attr$8(T, "id", "around"), attr$8(T, "type", "range"), T.value = D = /*rep*/ - r[53].around, attr$8(T, "min", "0"), attr$8(T, "max", "10"), attr$8(T, "step", "0.5"), attr$8(T, "class", "h-2 w-1/3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(z, "type", "text"), attr$8(z, "class", "w-8 svelte-1skivl7"), attr$8(B, "class", "svelte-1skivl7"), attr$8(g, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(F, "class", "svelte-1skivl7"), attr$8(U, "type", "checkbox"), U.__value = "", set_input_value$1(U, U.__value), attr$8(U, "class", "sr-only peer svelte-1skivl7"), attr$8(Q, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(H, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8($, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(q, "class", "svelte-1skivl7"), attr$8(fe, "type", "checkbox"), fe.__value = "", set_input_value$1(fe, fe.__value), attr$8(fe, "class", "sr-only peer svelte-1skivl7"), attr$8(Me, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(ne, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8(oe, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(N, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(pe, "class", we = null_to_empty( + f = space$7(), u = element$7("input"), b = space$7(), h = element$7("div"), _ = element$7("input"), E = space$7(), c = element$7("input"), S = space$7(), y = element$7("div"), w = element$7("label"), w.textContent = "Select style", L = space$7(), s = element$7("select"), o = element$7("option"), o.textContent = "Stick", A = element$7("option"), A.textContent = "Cartoon", p = element$7("option"), p.textContent = "Surface", v = text$3(`$ + `), a = element$7("option"), a.textContent = "Sphere", l = space$7(), g = element$7("div"), M = element$7("div"), M.textContent = "Expand selection", C = space$7(), T = element$7("input"), I = space$7(), B = element$7("input"), P = space$7(), z = element$7("div"), z.textContent = "Å", k = space$7(), N = element$7("div"), R = element$7("div"), U = element$7("span"), U.textContent = "Full residue", W = space$7(), G = element$7("label"), F = element$7("input"), V = space$7(), J = element$7("div"), X = space$7(), oe = element$7("div"), te = element$7("span"), te.textContent = "Only sidechain", ve = space$7(), se = element$7("label"), le = element$7("input"), Ce = space$7(), be = element$7("div"), Le = space$7(), ae = element$7("div"), _e = element$7("button"), Be = space$7(), Ne = element$7("button"), ke = space$7(), pe = element$7("button"), ce = space$7(), Ae = element$7("button"), We = space$7(), Ue = element$7("button"), j = space$7(), ee = element$7("button"), ye = space$7(), $e = element$7("button"), Y = space$7(), ue = element$7("div"), Se = element$7("button"), Fe = text$3("AlphaFold"), De = space$7(), K = element$7("button"), ze = text$3("PyMol"), $ = space$7(), xe = element$7("button"), Me = text$3("Jmol"), fe = space$7(), Te = element$7("button"), Ze = text$3("Chain"), je = space$7(), Je = element$7("button"), St = text$3("Spectrum"), attr$8(n, "id", "style"), attr$8(n, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/ + t[53].model === void 0 && add_render_callback(Pt), attr$8(u, "type", "text"), attr$8(u, "id", "chain"), attr$8(u, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(u, "placeholder", "Chain"), attr$8(r, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(_, "type", "text"), attr$8(_, "id", "chain"), attr$8(_, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(_, "placeholder", "Resname"), attr$8(c, "type", "text"), attr$8(c, "id", "residue_range"), attr$8(c, "class", "w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(c, "placeholder", "Residue range"), attr$8(h, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(w, "for", "countries"), attr$8(w, "class", "block mb-2 text-sm w-1/3 font-medium text-gray-600 dark:text-white svelte-1skivl7"), o.__value = "stick", set_input_value$1(o, o.__value), attr$8(o, "class", "svelte-1skivl7"), A.__value = "cartoon", set_input_value$1(A, A.__value), attr$8(A, "class", "svelte-1skivl7"), p.__value = "surface", set_input_value$1(p, p.__value), attr$8(p, "class", "svelte-1skivl7"), a.__value = "sphere", set_input_value$1(a, a.__value), attr$8(a, "class", "svelte-1skivl7"), attr$8(s, "id", "style"), attr$8(s, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/ + t[53].style === void 0 && add_render_callback(Tt), attr$8(y, "class", "p-1 flex space-x-1 items-center svelte-1skivl7"), attr$8(M, "class", " svelte-1skivl7"), attr$8(T, "id", "around"), attr$8(T, "type", "range"), T.value = D = /*rep*/ + t[53].around, attr$8(T, "min", "0"), attr$8(T, "max", "10"), attr$8(T, "step", "0.5"), attr$8(T, "class", "h-2 w-1/3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(B, "type", "text"), attr$8(B, "class", "w-8 svelte-1skivl7"), attr$8(z, "class", "svelte-1skivl7"), attr$8(g, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(U, "class", "svelte-1skivl7"), attr$8(F, "type", "checkbox"), F.__value = "", set_input_value$1(F, F.__value), attr$8(F, "class", "sr-only peer svelte-1skivl7"), attr$8(J, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(G, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8(R, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(te, "class", "svelte-1skivl7"), attr$8(le, "type", "checkbox"), le.__value = "", set_input_value$1(le, le.__value), attr$8(le, "class", "sr-only peer svelte-1skivl7"), attr$8(be, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(se, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8(oe, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(N, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(_e, "class", Ee = null_to_empty( /*rep*/ - r[53].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(Ue, "class", Ne = null_to_empty( + t[53].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(Ne, "class", Ge = null_to_empty( /*rep*/ - r[53].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(ue, "class", ye = null_to_empty( + t[53].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(pe, "class", de = null_to_empty( /*rep*/ - r[53].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(Se, "class", ze = null_to_empty( + t[53].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(Ae, "class", Oe = null_to_empty( /*rep*/ - r[53].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(We, "class", Y = null_to_empty( + t[53].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(Ue, "class", Z = null_to_empty( /*rep*/ - r[53].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(ee, "class", de = null_to_empty( + t[53].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(ee, "class", ge = null_to_empty( /*rep*/ - r[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(Ie, "class", Re = null_to_empty( + t[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8($e, "class", Re = null_to_empty( /*rep*/ - r[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7"), attr$8(se, "class", "flex space-x-2 mt-2 svelte-1skivl7"), attr$8(Ae, "class", he = null_to_empty( + t[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7"), attr$8(ae, "class", "flex space-x-2 mt-2 svelte-1skivl7"), attr$8(Se, "class", he = null_to_empty( /*rep*/ - r[53].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7"), attr$8(j, "class", Ve = null_to_empty( + t[53].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7"), attr$8(K, "class", Ve = null_to_empty( /*rep*/ - r[53].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7"), attr$8(be, "class", X = null_to_empty( + t[53].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7"), attr$8(xe, "class", Q = null_to_empty( /*rep*/ - r[53].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7"), attr$8(Le, "class", Ke = null_to_empty( + t[53].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7"), attr$8(Te, "class", Ke = null_to_empty( /*rep*/ - r[53].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + t[53].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" ) + " svelte-1skivl7"), attr$8(Je, "class", rt = null_to_empty( /*rep*/ - r[53].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7"), attr$8(ce, "class", "flex space-x-2 py-2 text-sm svelte-1skivl7"), attr$8(e, "class", "svelte-1skivl7"); + t[53].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7"), attr$8(ue, "class", "flex space-x-2 py-2 text-sm svelte-1skivl7"), attr$8(e, "class", "svelte-1skivl7"); }, m(pt, yt) { - insert$a(pt, e, yt), append$8(e, t), append$8(t, n); + insert$a(pt, e, yt), append$8(e, r), append$8(r, n); for (let At = 0; At < wt.length; At += 1) wt[At] && wt[At].m(n, null); select_option( n, /*rep*/ - r[53].model, + t[53].model, !0 - ), append$8(t, f), append$8(t, u), set_input_value$1( + ), append$8(r, f), append$8(r, u), set_input_value$1( u, /*rep*/ - r[53].chain - ), append$8(e, y), append$8(e, h), append$8(h, _), set_input_value$1( + t[53].chain + ), append$8(e, b), append$8(e, h), append$8(h, _), set_input_value$1( _, /*rep*/ - r[53].resname + t[53].resname ), append$8(h, E), append$8(h, c), set_input_value$1( c, /*rep*/ - r[53].residue_range - ), append$8(e, C), append$8(e, b), append$8(b, A), append$8(b, S), append$8(b, s), append$8(s, o), append$8(s, w), append$8(s, p), append$8(s, v), append$8(s, a), select_option( + t[53].residue_range + ), append$8(e, S), append$8(e, y), append$8(y, w), append$8(y, L), append$8(y, s), append$8(s, o), append$8(s, A), append$8(s, p), append$8(s, v), append$8(s, a), select_option( s, /*rep*/ - r[53].style, + t[53].style, !0 - ), append$8(e, l), append$8(e, g), append$8(g, M), append$8(g, L), append$8(g, T), append$8(g, I), append$8(g, z), set_input_value$1( - z, + ), append$8(e, l), append$8(e, g), append$8(g, M), append$8(g, C), append$8(g, T), append$8(g, I), append$8(g, B), set_input_value$1( + B, /*rep*/ - r[53].around - ), append$8(g, P), append$8(g, B), append$8(e, k), append$8(e, N), append$8(N, $), append$8($, F), append$8($, G), append$8($, H), append$8(H, U), U.checked = /*rep*/ - r[53].byres, append$8(H, V), append$8(H, Q), append$8(N, ae), append$8(N, oe), append$8(oe, q), append$8(oe, me), append$8(oe, ne), append$8(ne, fe), fe.checked = /*rep*/ - r[53].sidechain, append$8(ne, Ce), append$8(ne, Me), append$8(e, Te), append$8(e, se), append$8(se, pe), append$8(se, Fe), append$8(se, Ue), append$8(se, Be), append$8(se, ue), append$8(se, ge), append$8(se, Se), append$8(se, He), append$8(se, We), append$8(se, K), append$8(se, ee), append$8(se, ve), append$8(se, Ie), append$8(e, Z), append$8(e, ce), append$8(ce, Ae), append$8(Ae, ke), append$8(ce, Oe), append$8(ce, j), append$8(j, $e), append$8(ce, R), append$8(ce, be), append$8(be, Ee), append$8(ce, le), append$8(ce, Le), append$8(Le, Ze), append$8(ce, je), append$8(ce, Je), append$8(Je, Lt), tt || (Et = [ + t[53].around + ), append$8(g, P), append$8(g, z), append$8(e, k), append$8(e, N), append$8(N, R), append$8(R, U), append$8(R, W), append$8(R, G), append$8(G, F), F.checked = /*rep*/ + t[53].byres, append$8(G, V), append$8(G, J), append$8(N, X), append$8(N, oe), append$8(oe, te), append$8(oe, ve), append$8(oe, se), append$8(se, le), le.checked = /*rep*/ + t[53].sidechain, append$8(se, Ce), append$8(se, be), append$8(e, Le), append$8(e, ae), append$8(ae, _e), append$8(ae, Be), append$8(ae, Ne), append$8(ae, ke), append$8(ae, pe), append$8(ae, ce), append$8(ae, Ae), append$8(ae, We), append$8(ae, Ue), append$8(ae, j), append$8(ae, ee), append$8(ae, ye), append$8(ae, $e), append$8(e, Y), append$8(e, ue), append$8(ue, Se), append$8(Se, Fe), append$8(ue, De), append$8(ue, K), append$8(K, ze), append$8(ue, $), append$8(ue, xe), append$8(xe, Me), append$8(ue, fe), append$8(ue, Te), append$8(Te, Ze), append$8(ue, je), append$8(ue, Je), append$8(Je, St), tt || (Et = [ listen$2(n, "change", Pt), listen$2(u, "input", vt), listen$2(_, "input", bt), listen$2(c, "input", mt), listen$2(s, "change", Tt), listen$2(T, "change", Ot), - listen$2(z, "input", kt), - listen$2(U, "change", Qt), - listen$2(fe, "change", Ft), - listen$2(pe, "click", Jt), - listen$2(Ue, "click", qt), - listen$2(ue, "click", er), - listen$2(Se, "click", Ht), - listen$2(We, "click", tr), + listen$2(B, "input", kt), + listen$2(F, "change", Xt), + listen$2(le, "change", Ft), + listen$2(_e, "click", Qt), + listen$2(Ne, "click", Jt), + listen$2(pe, "click", qt), + listen$2(Ae, "click", er), + listen$2(Ue, "click", tr), listen$2(ee, "click", lr), - listen$2(Ie, "click", Or), - listen$2(Ae, "click", Dr), - listen$2(j, "click", Pr), - listen$2(be, "click", Ir), - listen$2(Le, "click", at), + listen$2($e, "click", Or), + listen$2(Se, "click", Dr), + listen$2(K, "click", Pr), + listen$2(xe, "click", Ir), + listen$2(Te, "click", at), listen$2(Je, "click", Bt) ], tt = !0); }, p(pt, yt) { - if (r = pt, yt[0] & /*moldata*/ + if (t = pt, yt[0] & /*moldata*/ 8) { lt = ensure_array_like$2( /*moldata*/ - r[3] + t[3] ); let At; for (At = 0; At < lt.length; At += 1) { - const rr = get_each_context_1$1(r, lt, At); + const rr = get_each_context_1$1(t, lt, At); wt[At] ? wt[At].p(rr, yt) : (wt[At] = create_each_block_1$1(rr), wt[At].c(), wt[At].m(n, null)); } for (; At < wt.length; At += 1) @@ -25919,90 +25919,90 @@ function create_if_block_1$5(r) { 2 && select_option( n, /*rep*/ - r[53].model + t[53].model ), yt[0] & /*representations*/ 2 && u.value !== /*rep*/ - r[53].chain && set_input_value$1( + t[53].chain && set_input_value$1( u, /*rep*/ - r[53].chain + t[53].chain ), yt[0] & /*representations*/ 2 && _.value !== /*rep*/ - r[53].resname && set_input_value$1( + t[53].resname && set_input_value$1( _, /*rep*/ - r[53].resname + t[53].resname ), yt[0] & /*representations*/ 2 && c.value !== /*rep*/ - r[53].residue_range && set_input_value$1( + t[53].residue_range && set_input_value$1( c, /*rep*/ - r[53].residue_range + t[53].residue_range ), yt[0] & /*representations*/ 2 && select_option( s, /*rep*/ - r[53].style + t[53].style ), yt[0] & /*representations*/ 2 && D !== (D = /*rep*/ - r[53].around) && (T.value = D), yt[0] & /*representations*/ - 2 && z.value !== /*rep*/ - r[53].around && set_input_value$1( - z, + t[53].around) && (T.value = D), yt[0] & /*representations*/ + 2 && B.value !== /*rep*/ + t[53].around && set_input_value$1( + B, /*rep*/ - r[53].around + t[53].around ), yt[0] & /*representations*/ - 2 && (U.checked = /*rep*/ - r[53].byres), yt[0] & /*representations*/ - 2 && (fe.checked = /*rep*/ - r[53].sidechain), yt[0] & /*representations*/ - 2 && we !== (we = null_to_empty( + 2 && (F.checked = /*rep*/ + t[53].byres), yt[0] & /*representations*/ + 2 && (le.checked = /*rep*/ + t[53].sidechain), yt[0] & /*representations*/ + 2 && Ee !== (Ee = null_to_empty( /*rep*/ - r[53].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(pe, "class", we), yt[0] & /*representations*/ - 2 && Ne !== (Ne = null_to_empty( + t[53].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(_e, "class", Ee), yt[0] & /*representations*/ + 2 && Ge !== (Ge = null_to_empty( /*rep*/ - r[53].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(Ue, "class", Ne), yt[0] & /*representations*/ - 2 && ye !== (ye = null_to_empty( + t[53].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(Ne, "class", Ge), yt[0] & /*representations*/ + 2 && de !== (de = null_to_empty( /*rep*/ - r[53].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(ue, "class", ye), yt[0] & /*representations*/ - 2 && ze !== (ze = null_to_empty( + t[53].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(pe, "class", de), yt[0] & /*representations*/ + 2 && Oe !== (Oe = null_to_empty( /*rep*/ - r[53].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(Se, "class", ze), yt[0] & /*representations*/ - 2 && Y !== (Y = null_to_empty( + t[53].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(Ae, "class", Oe), yt[0] & /*representations*/ + 2 && Z !== (Z = null_to_empty( /*rep*/ - r[53].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(We, "class", Y), yt[0] & /*representations*/ - 2 && de !== (de = null_to_empty( + t[53].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(Ue, "class", Z), yt[0] & /*representations*/ + 2 && ge !== (ge = null_to_empty( /*rep*/ - r[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(ee, "class", de), yt[0] & /*representations*/ + t[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8(ee, "class", ge), yt[0] & /*representations*/ 2 && Re !== (Re = null_to_empty( /*rep*/ - r[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1skivl7") && attr$8(Ie, "class", Re), yt[0] & /*representations*/ + t[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" + ) + " svelte-1skivl7") && attr$8($e, "class", Re), yt[0] & /*representations*/ 2 && he !== (he = null_to_empty( /*rep*/ - r[53].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7") && attr$8(Ae, "class", he), yt[0] & /*representations*/ + t[53].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7") && attr$8(Se, "class", he), yt[0] & /*representations*/ 2 && Ve !== (Ve = null_to_empty( /*rep*/ - r[53].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7") && attr$8(j, "class", Ve), yt[0] & /*representations*/ - 2 && X !== (X = null_to_empty( + t[53].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7") && attr$8(K, "class", Ve), yt[0] & /*representations*/ + 2 && Q !== (Q = null_to_empty( /*rep*/ - r[53].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7") && attr$8(be, "class", X), yt[0] & /*representations*/ + t[53].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7") && attr$8(xe, "class", Q), yt[0] & /*representations*/ 2 && Ke !== (Ke = null_to_empty( /*rep*/ - r[53].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" - ) + " svelte-1skivl7") && attr$8(Le, "class", Ke), yt[0] & /*representations*/ + t[53].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + ) + " svelte-1skivl7") && attr$8(Te, "class", Ke), yt[0] & /*representations*/ 2 && rt !== (rt = null_to_empty( /*rep*/ - r[53].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" + t[53].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" ) + " svelte-1skivl7") && attr$8(Je, "class", rt); }, i(pt) { @@ -26016,179 +26016,179 @@ function create_if_block_1$5(r) { } }; } -function create_each_block_1$1(r) { - let e, t = ( +function create_each_block_1$1(t) { + let e, r = ( /*mol*/ - r[56].name + "" + t[56].name + "" ), n, f, u; return { c() { - e = element$7("option"), n = text$3(t), f = text$3(" #"), u = text$3( + e = element$7("option"), n = text$3(r), f = text$3(" #"), u = text$3( /*i*/ - r[58] + t[58] ), e.__value = /*i*/ - r[58], set_input_value$1(e, e.__value), attr$8(e, "class", "svelte-1skivl7"); + t[58], set_input_value$1(e, e.__value), attr$8(e, "class", "svelte-1skivl7"); }, - m(y, h) { - insert$a(y, e, h), append$8(e, n), append$8(e, f), append$8(e, u); + m(b, h) { + insert$a(b, e, h), append$8(e, n), append$8(e, f), append$8(e, u); }, - p(y, h) { + p(b, h) { h[0] & /*moldata*/ - 8 && t !== (t = /*mol*/ - y[56].name + "") && set_data$3(n, t); + 8 && r !== (r = /*mol*/ + b[56].name + "") && set_data$3(n, r); }, - d(y) { - y && detach$a(e); + d(b) { + b && detach$a(e); } }; } -function create_each_block$2(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o; - function w() { +function create_each_block$2(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o; + function A() { return ( /*click_handler*/ - r[26]( + t[26]( /*rep*/ - r[53], + t[53], /*each_value*/ - r[54], + t[54], /*index*/ - r[55] + t[55] ) ); } function p() { return ( /*click_handler_1*/ - r[27]( + t[27]( /*index*/ - r[55] + t[55] ) ); } function v() { return ( /*click_handler_2*/ - r[28]( + t[28]( /*rep*/ - r[53] + t[53] ) ); } let a = ( /*rep*/ - r[53].visible && create_if_block_1$5(r) + t[53].visible && create_if_block_1$5(t) ); return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("button"), u = svg_element$3("svg"), y = svg_element$3("path"), _ = space$7(), E = element$7("span"), E.textContent = `Representation #${/*index*/ - r[55]}`, c = space$7(), C = element$7("button"), C.innerHTML = '', b = space$7(), A = element$7("button"), A.innerHTML = '', S = space$7(), a && a.c(), attr$8(y, "stroke-linecap", "round"), attr$8(y, "stroke-linejoin", "round"), attr$8(y, "d", "M8.25 4.5l7.5 7.5-7.5 7.5"), attr$8(y, "class", "svelte-1skivl7"), attr$8(u, "xmlns", "http://www.w3.org/2000/svg"), attr$8(u, "fill", "none"), attr$8(u, "viewBox", "0 0 24 24"), attr$8(u, "stroke-width", "1.5"), attr$8(u, "stroke", "currentColor"), attr$8(u, "class", h = null_to_empty( + e = element$7("div"), r = element$7("div"), n = element$7("div"), f = element$7("button"), u = svg_element$3("svg"), b = svg_element$3("path"), _ = space$7(), E = element$7("span"), E.textContent = `Representation #${/*index*/ + t[55]}`, c = space$7(), S = element$7("button"), S.innerHTML = '', y = space$7(), w = element$7("button"), w.innerHTML = '', L = space$7(), a && a.c(), attr$8(b, "stroke-linecap", "round"), attr$8(b, "stroke-linejoin", "round"), attr$8(b, "d", "M8.25 4.5l7.5 7.5-7.5 7.5"), attr$8(b, "class", "svelte-1skivl7"), attr$8(u, "xmlns", "http://www.w3.org/2000/svg"), attr$8(u, "fill", "none"), attr$8(u, "viewBox", "0 0 24 24"), attr$8(u, "stroke-width", "1.5"), attr$8(u, "stroke", "currentColor"), attr$8(u, "class", h = null_to_empty( /*rep*/ - r[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " - ) + " svelte-1skivl7"), attr$8(E, "class", "svelte-1skivl7"), attr$8(f, "class", "flex items-center space-x-2 svelte-1skivl7"), attr$8(C, "class", "svelte-1skivl7"), attr$8(A, "title", "zoom to selection"), attr$8(A, "class", "svelte-1skivl7"), attr$8(n, "class", "flex space-x-2 items-center cursor-pointer p-1 svelte-1skivl7"), attr$8(t, "class", " svelte-1skivl7"), attr$8(e, "class", "bg-white border-b border-t border-gray-200 py-4 px-2 svelte-1skivl7"); + t[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " + ) + " svelte-1skivl7"), attr$8(E, "class", "svelte-1skivl7"), attr$8(f, "class", "flex items-center space-x-2 svelte-1skivl7"), attr$8(S, "class", "svelte-1skivl7"), attr$8(w, "title", "zoom to selection"), attr$8(w, "class", "svelte-1skivl7"), attr$8(n, "class", "flex space-x-2 items-center cursor-pointer p-1 svelte-1skivl7"), attr$8(r, "class", " svelte-1skivl7"), attr$8(e, "class", "bg-white border-b border-t border-gray-200 py-4 px-2 svelte-1skivl7"); }, m(l, g) { - insert$a(l, e, g), append$8(e, t), append$8(t, n), append$8(n, f), append$8(f, u), append$8(u, y), append$8(f, _), append$8(f, E), append$8(n, c), append$8(n, C), append$8(n, b), append$8(n, A), append$8(t, S), a && a.m(t, null), s || (o = [ - listen$2(f, "click", w), - listen$2(C, "click", p), - listen$2(A, "click", v) + insert$a(l, e, g), append$8(e, r), append$8(r, n), append$8(n, f), append$8(f, u), append$8(u, b), append$8(f, _), append$8(f, E), append$8(n, c), append$8(n, S), append$8(n, y), append$8(n, w), append$8(r, L), a && a.m(r, null), s || (o = [ + listen$2(f, "click", A), + listen$2(S, "click", p), + listen$2(w, "click", v) ], s = !0); }, p(l, g) { - r = l, g[0] & /*representations*/ + t = l, g[0] & /*representations*/ 2 && h !== (h = null_to_empty( /*rep*/ - r[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " + t[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " ) + " svelte-1skivl7") && attr$8(u, "class", h), /*rep*/ - r[53].visible ? a ? (a.p(r, g), g[0] & /*representations*/ - 2 && transition_in$7(a, 1)) : (a = create_if_block_1$5(r), a.c(), transition_in$7(a, 1), a.m(t, null)) : a && (a.d(1), a = null); + t[53].visible ? a ? (a.p(t, g), g[0] & /*representations*/ + 2 && transition_in$7(a, 1)) : (a = create_if_block_1$5(t), a.c(), transition_in$7(a, 1), a.m(r, null)) : a && (a.d(1), a = null); }, d(l) { l && detach$a(e), a && a.d(), s = !1, run_all$3(o); } }; } -function create_fragment$a(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M = ( +function create_fragment$a(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o, A, p, v, a, l, g, M = ( /*anyColorAlphaFold*/ - r[11] && create_if_block_8$1(r) - ), L = ( + t[11] && create_if_block_8$1(t) + ), C = ( /*hasFrames*/ - r[9] && create_if_block_6$1(r) + t[9] && create_if_block_6$1(t) ), T = ( /*showOffCanvas*/ - r[7] && create_if_block_2$1(r) + t[7] && create_if_block_2$1(t) ), D = ( /*showOffCanvasReps*/ - r[8] && create_if_block$6(r) + t[8] && create_if_block$6(t) ); return { c() { - e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("div"), u = element$7("button"), u.innerHTML = '', y = space$7(), h = element$7("button"), h.innerHTML = '', _ = space$7(), E = element$7("button"), E.innerHTML = '', c = space$7(), M && M.c(), C = space$7(), L && L.c(), b = space$7(), A = element$7("div"), S = element$7("button"), S.innerHTML = '', s = space$7(), o = element$7("span"), o.textContent = "Cite 3dmol.js as Rego & Koes, doi:10/gb5g5n", w = space$7(), p = element$7("div"), v = space$7(), T && T.c(), a = space$7(), D && D.c(), attr$8(u, "class", "p-2 svelte-1skivl7"), attr$8(u, "title", "Reset View"), attr$8(h, "class", "p-2 svelte-1skivl7"), attr$8(h, "title", "Settings"), attr$8(E, "class", "p-2 svelte-1skivl7"), attr$8(E, "title", "Representations"), attr$8(f, "class", "absolute z-50 top-0 right-0 mr-2 flex flex-col divide-y border border-gray-200 mt-2 rounded items-center justify-center bg-white dark:bg-gray-800 svelte-1skivl7"), attr$8(S, "class", "p-1 svelte-1skivl7"), attr$8(S, "title", "How to cite 3Dmol.js"), attr$8(o, "class", "absolute -top-1 left-6 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity svelte-1skivl7"), toggle_class$5( + e = element$7("div"), r = element$7("div"), n = element$7("div"), f = element$7("div"), u = element$7("button"), u.innerHTML = '', b = space$7(), h = element$7("button"), h.innerHTML = '', _ = space$7(), E = element$7("button"), E.innerHTML = '', c = space$7(), M && M.c(), S = space$7(), C && C.c(), y = space$7(), w = element$7("div"), L = element$7("button"), L.innerHTML = '', s = space$7(), o = element$7("span"), o.textContent = "Cite 3dmol.js as Rego & Koes, doi:10/gb5g5n", A = space$7(), p = element$7("div"), v = space$7(), T && T.c(), a = space$7(), D && D.c(), attr$8(u, "class", "p-2 svelte-1skivl7"), attr$8(u, "title", "Reset View"), attr$8(h, "class", "p-2 svelte-1skivl7"), attr$8(h, "title", "Settings"), attr$8(E, "class", "p-2 svelte-1skivl7"), attr$8(E, "title", "Representations"), attr$8(f, "class", "absolute z-50 top-0 right-0 mr-2 flex flex-col divide-y border border-gray-200 mt-2 rounded items-center justify-center bg-white dark:bg-gray-800 svelte-1skivl7"), attr$8(L, "class", "p-1 svelte-1skivl7"), attr$8(L, "title", "How to cite 3Dmol.js"), attr$8(o, "class", "absolute -top-1 left-6 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity svelte-1skivl7"), toggle_class$5( o, "opacity-100", /*showCiteTooltip*/ - r[6] - ), attr$8(A, "class", "absolute z-50 bottom-0 left-0 ml-2 flex divide-x mb-2 rounded items-center justify-center svelte-1skivl7"), attr$8(p, "class", "viewer w-full h-full z-10 svelte-1skivl7"), attr$8(n, "class", "gr-block gr-box relative w-full overflow-hidden svelte-1skivl7"), attr$8(t, "class", "overflow-hidden flex gap-px w-full h-full flex-wrap svelte-1skivl7"), attr$8(e, "class", "bg-white w-full minh svelte-1skivl7"); + t[6] + ), attr$8(w, "class", "absolute z-50 bottom-0 left-0 ml-2 flex divide-x mb-2 rounded items-center justify-center svelte-1skivl7"), attr$8(p, "class", "viewer w-full h-full z-10 svelte-1skivl7"), attr$8(n, "class", "gr-block gr-box relative w-full overflow-hidden svelte-1skivl7"), attr$8(r, "class", "overflow-hidden flex gap-px w-full h-full flex-wrap svelte-1skivl7"), attr$8(e, "class", "bg-white w-full minh svelte-1skivl7"); }, - m(I, z) { - insert$a(I, e, z), append$8(e, t), append$8(t, n), append$8(n, f), append$8(f, u), append$8(f, y), append$8(f, h), append$8(f, _), append$8(f, E), append$8(n, c), M && M.m(n, null), append$8(n, C), L && L.m(n, null), append$8(n, b), append$8(n, A), append$8(A, S), append$8(A, s), append$8(A, o), append$8(n, w), append$8(n, p), r[21](p), append$8(n, v), T && T.m(n, null), append$8(n, a), D && D.m(n, null), l || (g = [ + m(I, B) { + insert$a(I, e, B), append$8(e, r), append$8(r, n), append$8(n, f), append$8(f, u), append$8(f, b), append$8(f, h), append$8(f, _), append$8(f, E), append$8(n, c), M && M.m(n, null), append$8(n, S), C && C.m(n, null), append$8(n, y), append$8(n, w), append$8(w, L), append$8(w, s), append$8(w, o), append$8(n, A), append$8(n, p), t[21](p), append$8(n, v), T && T.m(n, null), append$8(n, a), D && D.m(n, null), l || (g = [ listen$2( u, "click", /*resetZoom*/ - r[18] + t[18] ), listen$2( h, "click", /*toggleOffCanvas*/ - r[14] + t[14] ), listen$2( E, "click", /*toggleOffCanvasReps*/ - r[15] + t[15] ), listen$2( - S, + L, "click", /*toggleCiteTooltip*/ - r[13] + t[13] ) ], l = !0); }, - p(I, z) { + p(I, B) { /*anyColorAlphaFold*/ - I[11] ? M ? M.p(I, z) : (M = create_if_block_8$1(I), M.c(), M.m(n, C)) : M && (M.d(1), M = null), /*hasFrames*/ - I[9] ? L ? L.p(I, z) : (L = create_if_block_6$1(I), L.c(), L.m(n, b)) : L && (L.d(1), L = null), z[0] & /*showCiteTooltip*/ + I[11] ? M ? M.p(I, B) : (M = create_if_block_8$1(I), M.c(), M.m(n, S)) : M && (M.d(1), M = null), /*hasFrames*/ + I[9] ? C ? C.p(I, B) : (C = create_if_block_6$1(I), C.c(), C.m(n, y)) : C && (C.d(1), C = null), B[0] & /*showCiteTooltip*/ 64 && toggle_class$5( o, "opacity-100", /*showCiteTooltip*/ I[6] ), /*showOffCanvas*/ - I[7] ? T ? T.p(I, z) : (T = create_if_block_2$1(I), T.c(), T.m(n, a)) : T && (T.d(1), T = null), /*showOffCanvasReps*/ - I[8] ? D ? D.p(I, z) : (D = create_if_block$6(I), D.c(), D.m(n, null)) : D && (D.d(1), D = null); + I[7] ? T ? T.p(I, B) : (T = create_if_block_2$1(I), T.c(), T.m(n, a)) : T && (T.d(1), T = null), /*showOffCanvasReps*/ + I[8] ? D ? D.p(I, B) : (D = create_if_block$6(I), D.c(), D.m(n, null)) : D && (D.d(1), D = null); }, i: noop$6, o: noop$6, d(I) { - I && detach$a(e), M && M.d(), L && L.d(), r[21](null), T && T.d(), D && D.d(), l = !1, run_all$3(g); + I && detach$a(e), M && M.d(), C && C.d(), t[21](null), T && T.d(), D && D.d(), l = !1, run_all$3(g); } }; } -function fade(r, { delay: e = 0, duration: t = 50 }) { - const n = +getComputedStyle(r).opacity; +function fade(t, { delay: e = 0, duration: r = 50 }) { + const n = +getComputedStyle(t).opacity; return { delay: e, - duration: t, + duration: r, css: (f) => `opacity: ${f * n}` }; } -function instance$9(r, e, t) { - let n = _3Dmol, f, { confidenceLabel: u = null } = e, { moldata: y = null } = e, h = { +function instance$9(t, e, r) { + let n = _3Dmol, f, { confidenceLabel: u = null } = e, { moldata: b = null } = e, h = { backgroundColor: { type: "select", options: ["white", "black", "gray", "lightgray", "beige", "orange"] @@ -26196,21 +26196,21 @@ function instance$9(r, e, t) { orthographic: { type: "toggle" }, disableFog: { type: "toggle" } }, { config: _ = {} } = e, E = !0, c = !1; - function C() { - t(6, c = !c); + function S() { + r(6, c = !c); } - let { representations: b = [] } = e, A = !1, S = !1; + let { representations: y = [] } = e, w = !1, L = !1; function s() { - t(7, A = !A); + r(7, w = !w); } function o() { - t(8, S = !S); + r(8, L = !L); } - function w(ue) { - b.splice(ue, 1), t(1, b); + function A(pe) { + y.splice(pe, 1), r(1, y); } function p() { - b.push({ + y.push({ model: 0, chain: "", resname: "", @@ -26220,178 +26220,178 @@ function instance$9(r, e, t) { around: 0, byres: !1, visible: !0 - }), t(1, b); + }), r(1, y); } - let v = function(ue) { - return ue.b < 50 ? "OrangeRed" : ue.b < 70 ? "Gold" : ue.b < 90 ? "MediumTurquoise" : "Blue"; + let v = function(pe) { + return pe.b < 50 ? "OrangeRed" : pe.b < 70 ? "Gold" : pe.b < 90 ? "MediumTurquoise" : "Blue"; }, a; - function l(ue) { - if (ue.type != null) + function l(pe) { + if (pe.type != null) a.zoomTo(); else { - let ye = { model: ue.model }; - ue.chain !== "" && (ye.chain = ue.chain), ue.residue_range !== "" && (ye.resi = ue.residue_range), ue.resname !== "" && (ye.resn = ue.resname), a.zoomTo(ye); + let de = { model: pe.model }; + pe.chain !== "" && (de.chain = pe.chain), pe.residue_range !== "" && (de.resi = pe.residue_range), pe.resname !== "" && (de.resn = pe.resname), a.zoomTo(de); } } - function g(ue) { - a !== void 0 && (a.setStyle(), a.removeAllSurfaces(), ue.forEach((ye) => { - let ge; - ye.color === "alphafold" ? ge = { colorfunc: v } : ye.color == "spectrum" ? ge = { color: "spectrum" } : ge = { colorscheme: ye.color }; - let Se = { model: ye.model }; - if (ye.chain !== "" && (Se.chain = ye.chain), ye.residue_range !== "" && (Se.resi = ye.residue_range), ye.resname !== "" && (Se.resn = ye.resname), Se.byres = ye.byres, ye.around !== 0 && (Se.expand = ye.around), ye.sidechain && (Se = { - and: [Se, { atom: ["N", "C", "O"], invert: !0 }] - }), ye.style === "surface") - ge.opacity = 0.8, a.addSurface(n.SurfaceType.VDW, ge, Se); + function g(pe) { + a !== void 0 && (a.setStyle(), a.removeAllSurfaces(), pe.forEach((de) => { + let ce; + de.color === "alphafold" ? ce = { colorfunc: v } : de.color == "spectrum" ? ce = { color: "spectrum" } : ce = { colorscheme: de.color }; + let Ae = { model: de.model }; + if (de.chain !== "" && (Ae.chain = de.chain), de.residue_range !== "" && (Ae.resi = de.residue_range), de.resname !== "" && (Ae.resn = de.resname), Ae.byres = de.byres, de.around !== 0 && (Ae.expand = de.around), de.sidechain && (Ae = { + and: [Ae, { atom: ["N", "C", "O"], invert: !0 }] + }), de.style === "surface") + ce.opacity = 0.8, a.addSurface(n.SurfaceType.VDW, ce, Ae); else try { - a.getModel(Se.model) != null && a.addStyle(Se, { [ye.style]: ge }); - } catch (ze) { - console.log(ze); + a.getModel(Ae.model) != null && a.addStyle(Ae, { [de.style]: ce }); + } catch (Oe) { + console.log(Oe); } }), a.render()); } onMount$1(() => { - let ue = { ..._, cartoonQuality: 7 }; - t(20, a = n.createViewer(f, ue)); - let ye = []; - b.forEach((ge) => { - ye.some((Se) => Se.model === ge.model && Se.chain === ge.chain && Se.resname === ge.resname && Se.style === ge.style && Se.color === ge.color && Se.residue_range === ge.residue_range && Se.around === ge.around && Se.byres === ge.byres && Se.sidechain === ge.sidechain) || ye.push(ge); - }), t(1, b = ye), y.length > 0 && y.forEach((ge) => { - ge.asFrames ? a.addModelsAsFrames(ge.data, ge.format) : a.addModel(ge.data, ge.format); - }), g(b), a.zoomTo(), a.render(), a.zoom(0.8, 2e3), b.forEach((ge) => { - ge.color === "alphafold" && t(11, T = !0); + let pe = { ..._, cartoonQuality: 7 }; + r(20, a = n.createViewer(f, pe)); + let de = []; + y.forEach((ce) => { + de.some((Ae) => Ae.model === ce.model && Ae.chain === ce.chain && Ae.resname === ce.resname && Ae.style === ce.style && Ae.color === ce.color && Ae.residue_range === ce.residue_range && Ae.around === ce.around && Ae.byres === ce.byres && Ae.sidechain === ce.sidechain) || de.push(ce); + }), r(1, y = de), b.length > 0 && b.forEach((ce) => { + ce.asFrames ? a.addModelsAsFrames(ce.data, ce.format) : a.addModel(ce.data, ce.format); + }), g(y), a.zoomTo(), a.render(), a.zoom(0.8, 2e3), y.forEach((ce) => { + ce.color === "alphafold" && r(11, T = !0); }), E && a.setHoverable( {}, !0, - function(ge, Se, ze, He) { - if (!ge.label) { - let We; - T ? We = ge.resn + ":" + ge.resi + ":" + ge.atom + " (" + u + " " + ge.b + ")" : We = ge.resn + ":" + ge.resi + ":" + ge.atom, ge.label = Se.addLabel(We, { - position: ge, + function(ce, Ae, Oe, We) { + if (!ce.label) { + let Ue; + T ? Ue = ce.resn + ":" + ce.resi + ":" + ce.atom + " (" + u + " " + ce.b + ")" : Ue = ce.resn + ":" + ce.resi + ":" + ce.atom, ce.label = Ae.addLabel(Ue, { + position: ce, backgroundColor: "#ffffff", borderColor: "#dddddd", fontColor: "black" }); } }, - function(ge, Se) { - ge.label && (Se.removeLabel(ge.label), delete ge.label); + function(ce, Ae) { + ce.label && (Ae.removeLabel(ce.label), delete ce.label); } ); }); - let M = !1, L = !1, T = !1; + let M = !1, C = !1, T = !1; function D() { - console.log(a.isAnimated()), L ? a.pauseAnimate() : a.animate({ loop: "forward", reps: 0 }), a.render(), console.log(a.isAnimated()), t(10, L = !L); + console.log(a.isAnimated()), C ? a.pauseAnimate() : a.animate({ loop: "forward", reps: 0 }), a.render(), console.log(a.isAnimated()), r(10, C = !C); } - function I(ue) { - binding_callbacks$3[ue ? "unshift" : "push"](() => { - f = ue, t(4, f); + function I(pe) { + binding_callbacks$3[pe ? "unshift" : "push"](() => { + f = pe, r(4, f); }); } - function z(ue) { - _[ue] = this.checked, t(0, _), t(12, h); + function B(pe) { + _[pe] = this.checked, r(0, _), r(12, h); } - const P = (ue) => { - t(0, _[ue] = event.target.value, _); + const P = (pe) => { + r(0, _[pe] = event.target.value, _); }; - function B(ue) { - _[ue] = select_value(this), t(0, _), t(12, h); + function z(pe) { + _[pe] = select_value(this), r(0, _), r(12, h); } function k() { - E = this.value, t(5, E); + E = this.value, r(5, E); } - const N = (ue, ye, ge) => t(1, ye[ge].visible = !ue.visible, b), $ = (ue) => w(ue), F = (ue) => l(ue); - function G(ue, ye) { - ue[ye].model = select_value(this), t(1, b); + const N = (pe, de, ce) => r(1, de[ce].visible = !pe.visible, y), R = (pe) => A(pe), U = (pe) => l(pe); + function W(pe, de) { + pe[de].model = select_value(this), r(1, y); } - function H(ue, ye) { - ue[ye].chain = this.value, t(1, b); + function G(pe, de) { + pe[de].chain = this.value, r(1, y); } - function U(ue, ye) { - ue[ye].resname = this.value, t(1, b); + function F(pe, de) { + pe[de].resname = this.value, r(1, y); } - function V(ue, ye) { - ue[ye].residue_range = this.value, t(1, b); + function V(pe, de) { + pe[de].residue_range = this.value, r(1, y); } - function Q(ue, ye) { - ue[ye].style = select_value(this), t(1, b); + function J(pe, de) { + pe[de].style = select_value(this), r(1, y); } - const ae = (ue, ye, ge, Se) => { - t(1, ye[ge].around = Se.target.value, b); + const X = (pe, de, ce, Ae) => { + r(1, de[ce].around = Ae.target.value, y); }; - function oe(ue, ye) { - ue[ye].around = this.value, t(1, b); + function oe(pe, de) { + pe[de].around = this.value, r(1, y); } - function q(ue, ye) { - ue[ye].byres = this.checked, t(1, b); + function te(pe, de) { + pe[de].byres = this.checked, r(1, y); } - function me(ue, ye) { - ue[ye].sidechain = this.checked, t(1, b); + function ve(pe, de) { + pe[de].sidechain = this.checked, r(1, y); } - const ne = (ue, ye, ge) => t(1, ye[ge].color = "orangeCarbon", b), fe = (ue, ye, ge) => t(1, ye[ge].color = "redCarbon", b), Ce = (ue, ye, ge) => t(1, ye[ge].color = "blackCarbon", b), Me = (ue, ye, ge) => t(1, ye[ge].color = "blueCarbon", b), Te = (ue, ye, ge) => t(1, ye[ge].color = "grayCarbon", b), se = (ue, ye, ge) => t(1, ye[ge].color = "greenCarbon", b), pe = (ue, ye, ge) => t(1, ye[ge].color = "cyanCarbon", b), we = (ue, ye, ge) => t(1, ye[ge].color = "alphafold", b), Fe = (ue, ye, ge) => t(1, ye[ge].color = "default", b), Ue = (ue, ye, ge) => t(1, ye[ge].color = "Jmol", b), Ne = (ue, ye, ge) => t(1, ye[ge].color = "chain", b), Be = (ue, ye, ge) => t(1, ye[ge].color = "spectrum", b); - return r.$$set = (ue) => { - "confidenceLabel" in ue && t(2, u = ue.confidenceLabel), "moldata" in ue && t(3, y = ue.moldata), "config" in ue && t(0, _ = ue.config), "representations" in ue && t(1, b = ue.representations); - }, r.$$.update = () => { - r.$$.dirty[0] & /*view, config*/ - 1048577 && a != null && (a.setBackgroundColor(_.backgroundColor), a.enableFog(!_.disableFog), a.setCameraParameters({ orthographic: _.orthographic })), r.$$.dirty[0] & /*representations*/ - 2 && g(b), r.$$.dirty[0] & /*moldata*/ - 8 && y.forEach((ue) => { - ue.asFrames && t(9, M = !0); - }), r.$$.dirty[0] & /*representations*/ - 2 && (t(11, T = !1), b.forEach((ue) => { - ue.color === "alphafold" && t(11, T = !0); + const se = (pe, de, ce) => r(1, de[ce].color = "orangeCarbon", y), le = (pe, de, ce) => r(1, de[ce].color = "redCarbon", y), Ce = (pe, de, ce) => r(1, de[ce].color = "blackCarbon", y), be = (pe, de, ce) => r(1, de[ce].color = "blueCarbon", y), Le = (pe, de, ce) => r(1, de[ce].color = "grayCarbon", y), ae = (pe, de, ce) => r(1, de[ce].color = "greenCarbon", y), _e = (pe, de, ce) => r(1, de[ce].color = "cyanCarbon", y), Ee = (pe, de, ce) => r(1, de[ce].color = "alphafold", y), Be = (pe, de, ce) => r(1, de[ce].color = "default", y), Ne = (pe, de, ce) => r(1, de[ce].color = "Jmol", y), Ge = (pe, de, ce) => r(1, de[ce].color = "chain", y), ke = (pe, de, ce) => r(1, de[ce].color = "spectrum", y); + return t.$$set = (pe) => { + "confidenceLabel" in pe && r(2, u = pe.confidenceLabel), "moldata" in pe && r(3, b = pe.moldata), "config" in pe && r(0, _ = pe.config), "representations" in pe && r(1, y = pe.representations); + }, t.$$.update = () => { + t.$$.dirty[0] & /*view, config*/ + 1048577 && a != null && (a.setBackgroundColor(_.backgroundColor), a.enableFog(!_.disableFog), a.setCameraParameters({ orthographic: _.orthographic })), t.$$.dirty[0] & /*representations*/ + 2 && g(y), t.$$.dirty[0] & /*moldata*/ + 8 && b.forEach((pe) => { + pe.asFrames && r(9, M = !0); + }), t.$$.dirty[0] & /*representations*/ + 2 && (r(11, T = !1), y.forEach((pe) => { + pe.color === "alphafold" && r(11, T = !0); })); }, [ _, - b, - u, y, + u, + b, f, E, c, - A, - S, - M, + w, L, + M, + C, T, h, - C, + S, s, o, - w, + A, p, l, D, a, I, - z, - P, B, + P, + z, k, N, - $, - F, - G, - H, + R, U, + W, + G, + F, V, - Q, - ae, + J, + X, oe, - q, - me, - ne, - fe, - Ce, - Me, - Te, + te, + ve, se, - pe, - we, - Fe, - Ue, + le, + Ce, + be, + Le, + ae, + _e, + Ee, + Be, Ne, - Be + Ge, + ke ]; } class MolecularViewer extends SvelteComponent$a { @@ -26430,21 +26430,21 @@ const { transition_in: transition_in$6, transition_out: transition_out$6 } = window.__gradio__svelte__internal; -function create_else_block$4(r) { - let e, t; +function create_else_block$4(t) { + let e, r; return e = new Empty({ props: { unpadded_box: !0, size: "large", $$slots: { default: [create_default_slot$2] }, - $$scope: { ctx: r } + $$scope: { ctx: t } } }), { c() { create_component$5(e.$$.fragment); }, m(n, f) { - mount_component$5(e, n, f), t = !0; + mount_component$5(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -26452,121 +26452,121 @@ function create_else_block$4(r) { 8192 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, i(n) { - t || (transition_in$6(e.$$.fragment, n), t = !0); + r || (transition_in$6(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$6(e.$$.fragment, n), t = !1; + transition_out$6(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$5(e, n); } }; } -function create_if_block$5(r) { - let e, t, n, f; +function create_if_block$5(t) { + let e, r, n, f; e = new FilePreview({ props: { i18n: ( /*i18n*/ - r[5] + t[5] ), selectable: ( /*selectable*/ - r[3] + t[3] ), value: ( /*value*/ - r[0] + t[0] ), height: ( /*height*/ - r[4] + t[4] ) } }), e.$on( "select", /*select_handler*/ - r[12] + t[12] ); let u = ( /*moldata*/ - r[9] != null && /*molviewer*/ - r[10] && create_if_block_1$4(r) + t[9] != null && /*molviewer*/ + t[10] && create_if_block_1$4(t) ); return { c() { - create_component$5(e.$$.fragment), t = space$6(), u && u.c(), n = empty$3(); + create_component$5(e.$$.fragment), r = space$6(), u && u.c(), n = empty$3(); }, - m(y, h) { - mount_component$5(e, y, h), insert$9(y, t, h), u && u.m(y, h), insert$9(y, n, h), f = !0; + m(b, h) { + mount_component$5(e, b, h), insert$9(b, r, h), u && u.m(b, h), insert$9(b, n, h), f = !0; }, - p(y, h) { + p(b, h) { const _ = {}; h & /*i18n*/ 32 && (_.i18n = /*i18n*/ - y[5]), h & /*selectable*/ + b[5]), h & /*selectable*/ 8 && (_.selectable = /*selectable*/ - y[3]), h & /*value*/ + b[3]), h & /*value*/ 1 && (_.value = /*value*/ - y[0]), h & /*height*/ + b[0]), h & /*height*/ 16 && (_.height = /*height*/ - y[4]), e.$set(_), /*moldata*/ - y[9] != null && /*molviewer*/ - y[10] ? u ? (u.p(y, h), h & /*moldata, molviewer*/ - 1536 && transition_in$6(u, 1)) : (u = create_if_block_1$4(y), u.c(), transition_in$6(u, 1), u.m(n.parentNode, n)) : u && (group_outros$5(), transition_out$6(u, 1, 1, () => { + b[4]), e.$set(_), /*moldata*/ + b[9] != null && /*molviewer*/ + b[10] ? u ? (u.p(b, h), h & /*moldata, molviewer*/ + 1536 && transition_in$6(u, 1)) : (u = create_if_block_1$4(b), u.c(), transition_in$6(u, 1), u.m(n.parentNode, n)) : u && (group_outros$5(), transition_out$6(u, 1, 1, () => { u = null; }), check_outros$5()); }, - i(y) { - f || (transition_in$6(e.$$.fragment, y), transition_in$6(u), f = !0); + i(b) { + f || (transition_in$6(e.$$.fragment, b), transition_in$6(u), f = !0); }, - o(y) { - transition_out$6(e.$$.fragment, y), transition_out$6(u), f = !1; + o(b) { + transition_out$6(e.$$.fragment, b), transition_out$6(u), f = !1; }, - d(y) { - y && (detach$9(t), detach$9(n)), destroy_component$5(e, y), u && u.d(y); + d(b) { + b && (detach$9(r), detach$9(n)), destroy_component$5(e, b), u && u.d(b); } }; } -function create_default_slot$2(r) { - let e, t; +function create_default_slot$2(t) { + let e, r; return e = new File$1({}), { c() { create_component$5(e.$$.fragment); }, m(n, f) { - mount_component$5(e, n, f), t = !0; + mount_component$5(e, n, f), r = !0; }, i(n) { - t || (transition_in$6(e.$$.fragment, n), t = !0); + r || (transition_in$6(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$6(e.$$.fragment, n), t = !1; + transition_out$6(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$5(e, n); } }; } -function create_if_block_1$4(r) { - let e, t; +function create_if_block_1$4(t) { + let e, r; return e = new MolecularViewer({ props: { moldata: ( /*moldata*/ - r[9] + t[9] ), config: ( /*config*/ - r[6] + t[6] ), confidenceLabel: ( /*confidenceLabel*/ - r[7] + t[7] ), representations: ( /*representations*/ - r[8] + t[8] ) } }), { @@ -26574,7 +26574,7 @@ function create_if_block_1$4(r) { create_component$5(e.$$.fragment); }, m(n, f) { - mount_component$5(e, n, f), t = !0; + mount_component$5(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -26589,94 +26589,94 @@ function create_if_block_1$4(r) { n[8]), e.$set(u); }, i(n) { - t || (transition_in$6(e.$$.fragment, n), t = !0); + r || (transition_in$6(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$6(e.$$.fragment, n), t = !1; + transition_out$6(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$5(e, n); } }; } -function create_fragment$9(r) { - let e, t, n, f, u, y; +function create_fragment$9(t) { + let e, r, n, f, u, b; e = new BlockLabel({ props: { show_label: ( /*show_label*/ - r[2] + t[2] ), float: ( /*value*/ - r[0] === null + t[0] === null ), Icon: File$1, label: ( /*label*/ - r[1] || "File" + t[1] || "File" ) } }); const h = [create_if_block$5, create_else_block$4], _ = []; - function E(c, C) { + function E(c, S) { return ( /*value*/ c[0] ? 0 : 1 ); } - return n = E(r), f = _[n] = h[n](r), { + return n = E(t), f = _[n] = h[n](t), { c() { - create_component$5(e.$$.fragment), t = space$6(), f.c(), u = empty$3(); - }, - m(c, C) { - mount_component$5(e, c, C), insert$9(c, t, C), _[n].m(c, C), insert$9(c, u, C), y = !0; - }, - p(c, [C]) { - const b = {}; - C & /*show_label*/ - 4 && (b.show_label = /*show_label*/ - c[2]), C & /*value*/ - 1 && (b.float = /*value*/ - c[0] === null), C & /*label*/ - 2 && (b.label = /*label*/ - c[1] || "File"), e.$set(b); - let A = n; - n = E(c), n === A ? _[n].p(c, C) : (group_outros$5(), transition_out$6(_[A], 1, 1, () => { - _[A] = null; - }), check_outros$5(), f = _[n], f ? f.p(c, C) : (f = _[n] = h[n](c), f.c()), transition_in$6(f, 1), f.m(u.parentNode, u)); + create_component$5(e.$$.fragment), r = space$6(), f.c(), u = empty$3(); + }, + m(c, S) { + mount_component$5(e, c, S), insert$9(c, r, S), _[n].m(c, S), insert$9(c, u, S), b = !0; + }, + p(c, [S]) { + const y = {}; + S & /*show_label*/ + 4 && (y.show_label = /*show_label*/ + c[2]), S & /*value*/ + 1 && (y.float = /*value*/ + c[0] === null), S & /*label*/ + 2 && (y.label = /*label*/ + c[1] || "File"), e.$set(y); + let w = n; + n = E(c), n === w ? _[n].p(c, S) : (group_outros$5(), transition_out$6(_[w], 1, 1, () => { + _[w] = null; + }), check_outros$5(), f = _[n], f ? f.p(c, S) : (f = _[n] = h[n](c), f.c()), transition_in$6(f, 1), f.m(u.parentNode, u)); }, i(c) { - y || (transition_in$6(e.$$.fragment, c), transition_in$6(f), y = !0); + b || (transition_in$6(e.$$.fragment, c), transition_in$6(f), b = !0); }, o(c) { - transition_out$6(e.$$.fragment, c), transition_out$6(f), y = !1; + transition_out$6(e.$$.fragment, c), transition_out$6(f), b = !1; }, d(c) { - c && (detach$9(t), detach$9(u)), destroy_component$5(e, c), _[n].d(c); + c && (detach$9(r), detach$9(u)), destroy_component$5(e, c), _[n].d(c); } }; } -function instance$8(r, e, t) { - let { value: n = null } = e, { label: f } = e, { show_label: u = !0 } = e, { selectable: y = !1 } = e, { height: h = void 0 } = e, { i18n: _ } = e, { config: E = {} } = e, { confidenceLabel: c = "" } = e, { representations: C = [] } = e, { moldata: b = null } = e, { molviewer: A = !1 } = e, { errors: S = [] } = e; +function instance$8(t, e, r) { + let { value: n = null } = e, { label: f } = e, { show_label: u = !0 } = e, { selectable: b = !1 } = e, { height: h = void 0 } = e, { i18n: _ } = e, { config: E = {} } = e, { confidenceLabel: c = "" } = e, { representations: S = [] } = e, { moldata: y = null } = e, { molviewer: w = !1 } = e, { errors: L = [] } = e; function s(o) { - bubble$2.call(this, r, o); + bubble$2.call(this, t, o); } - return r.$$set = (o) => { - "value" in o && t(0, n = o.value), "label" in o && t(1, f = o.label), "show_label" in o && t(2, u = o.show_label), "selectable" in o && t(3, y = o.selectable), "height" in o && t(4, h = o.height), "i18n" in o && t(5, _ = o.i18n), "config" in o && t(6, E = o.config), "confidenceLabel" in o && t(7, c = o.confidenceLabel), "representations" in o && t(8, C = o.representations), "moldata" in o && t(9, b = o.moldata), "molviewer" in o && t(10, A = o.molviewer), "errors" in o && t(11, S = o.errors); + return t.$$set = (o) => { + "value" in o && r(0, n = o.value), "label" in o && r(1, f = o.label), "show_label" in o && r(2, u = o.show_label), "selectable" in o && r(3, b = o.selectable), "height" in o && r(4, h = o.height), "i18n" in o && r(5, _ = o.i18n), "config" in o && r(6, E = o.config), "confidenceLabel" in o && r(7, c = o.confidenceLabel), "representations" in o && r(8, S = o.representations), "moldata" in o && r(9, y = o.moldata), "molviewer" in o && r(10, w = o.molviewer), "errors" in o && r(11, L = o.errors); }, [ n, f, u, - y, + b, h, _, E, c, - C, - b, - A, S, + y, + w, + L, s ]; } @@ -26698,26 +26698,26 @@ class File_1 extends SvelteComponent$9 { }); } } -var fn = new Intl.Collator(0, { numeric: 1 }).compare; -function semiver(r, e, t) { - return r = r.split("."), e = e.split("."), fn(r[0], e[0]) || fn(r[1], e[1]) || (e[2] = e.slice(2).join("."), t = /[.-]/.test(r[2] = r.slice(2).join(".")), t == /[.-]/.test(e[2]) ? fn(r[2], e[2]) : t ? -1 : 1); +var fn$1 = new Intl.Collator(0, { numeric: 1 }).compare; +function semiver$1(t, e, r) { + return t = t.split("."), e = e.split("."), fn$1(t[0], e[0]) || fn$1(t[1], e[1]) || (e[2] = e.slice(2).join("."), r = /[.-]/.test(t[2] = t.slice(2).join(".")), r == /[.-]/.test(e[2]) ? fn$1(t[2], e[2]) : r ? -1 : 1); } -function resolve_root(r, e, t) { - return e.startsWith("http://") || e.startsWith("https://") ? t ? r : e : r + e; +function resolve_root$1(t, e, r) { + return e.startsWith("http://") || e.startsWith("https://") ? r ? t : e : t + e; } -function determine_protocol(r) { - if (r.startsWith("http")) { - const { protocol: e, host: t } = new URL(r); - return t.endsWith("hf.space") ? { +function determine_protocol$1(t) { + if (t.startsWith("http")) { + const { protocol: e, host: r } = new URL(t); + return r.endsWith("hf.space") ? { ws_protocol: "wss", - host: t, + host: r, http_protocol: e } : { ws_protocol: e === "https:" ? "wss" : "ws", http_protocol: e, - host: t + host: r }; - } else if (r.startsWith("file:")) + } else if (t.startsWith("file:")) return { ws_protocol: "ws", http_protocol: "http:", @@ -26727,216 +26727,216 @@ function determine_protocol(r) { return { ws_protocol: "wss", http_protocol: "https:", - host: r + host: t }; } -const RE_SPACE_NAME = /^[^\/]*\/[^\/]*$/, RE_SPACE_DOMAIN = /.*hf\.space\/{0,1}$/; -async function process_endpoint(r, e) { - const t = {}; - e && (t.Authorization = `Bearer ${e}`); - const n = r.trim(); - if (RE_SPACE_NAME.test(n)) +const RE_SPACE_NAME$1 = /^[^\/]*\/[^\/]*$/, RE_SPACE_DOMAIN$1 = /.*hf\.space\/{0,1}$/; +async function process_endpoint$1(t, e) { + const r = {}; + e && (r.Authorization = `Bearer ${e}`); + const n = t.trim(); + if (RE_SPACE_NAME$1.test(n)) try { const f = await fetch( `https://huggingface.co/api/spaces/${n}/host`, - { headers: t } + { headers: r } ); if (f.status !== 200) throw new Error("Space metadata could not be loaded."); const u = (await f.json()).host; return { - space_id: r, - ...determine_protocol(u) + space_id: t, + ...determine_protocol$1(u) }; } catch (f) { throw new Error("Space metadata could not be loaded." + f.message); } - if (RE_SPACE_DOMAIN.test(n)) { - const { ws_protocol: f, http_protocol: u, host: y } = determine_protocol(n); + if (RE_SPACE_DOMAIN$1.test(n)) { + const { ws_protocol: f, http_protocol: u, host: b } = determine_protocol$1(n); return { - space_id: y.replace(".hf.space", ""), + space_id: b.replace(".hf.space", ""), ws_protocol: f, http_protocol: u, - host: y + host: b }; } return { space_id: !1, - ...determine_protocol(n) + ...determine_protocol$1(n) }; } -function map_names_to_ids(r) { +function map_names_to_ids$1(t) { let e = {}; - return r.forEach(({ api_name: t }, n) => { - t && (e[t] = n); + return t.forEach(({ api_name: r }, n) => { + r && (e[r] = n); }), e; } -const RE_DISABLED_DISCUSSION = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; -async function discussions_enabled(r) { +const RE_DISABLED_DISCUSSION$1 = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; +async function discussions_enabled$1(t) { try { - const t = (await fetch( - `https://huggingface.co/api/spaces/${r}/discussions`, + const r = (await fetch( + `https://huggingface.co/api/spaces/${t}/discussions`, { method: "HEAD" } )).headers.get("x-error-message"); - return !(t && RE_DISABLED_DISCUSSION.test(t)); + return !(r && RE_DISABLED_DISCUSSION$1.test(r)); } catch { return !1; } } -function normalise_file(r, e, t) { - if (r == null) +function normalise_file(t, e, r) { + if (t == null) return null; - if (Array.isArray(r)) { + if (Array.isArray(t)) { const n = []; - for (const f of r) - f == null ? n.push(null) : n.push(normalise_file(f, e, t)); + for (const f of t) + f == null ? n.push(null) : n.push(normalise_file(f, e, r)); return n; } - return r.is_stream ? t == null ? new FileData({ - ...r, - url: e + "/stream/" + r.path - }) : new FileData({ - ...r, - url: "/proxy=" + t + "stream/" + r.path - }) : new FileData({ - ...r, - url: get_fetchable_url_or_file(r.path, e, t) + return t.is_stream ? r == null ? new FileData$1({ + ...t, + url: e + "/stream/" + t.path + }) : new FileData$1({ + ...t, + url: "/proxy=" + r + "stream/" + t.path + }) : new FileData$1({ + ...t, + url: get_fetchable_url_or_file(t.path, e, r) }); } -function is_url(r) { +function is_url(t) { try { - const e = new URL(r); + const e = new URL(t); return e.protocol === "http:" || e.protocol === "https:"; } catch { return !1; } } -function get_fetchable_url_or_file(r, e, t) { - return r == null ? t ? `/proxy=${t}file=` : `${e}/file=` : is_url(r) ? r : t ? `/proxy=${t}file=${r}` : `${e}/file=${r}`; +function get_fetchable_url_or_file(t, e, r) { + return t == null ? r ? `/proxy=${r}file=` : `${e}/file=` : is_url(t) ? t : r ? `/proxy=${r}file=${t}` : `${e}/file=${t}`; } -async function upload(r, e, t = upload_files) { - let n = (Array.isArray(r) ? r : [r]).map( +async function upload$1(t, e, r = upload_files$1) { + let n = (Array.isArray(t) ? t : [t]).map( (f) => f.blob ); return await Promise.all( - await t(e, n).then( + await r(e, n).then( async (f) => { if (f.error) throw new Error(f.error); - return f.files ? f.files.map((u, y) => { - const h = new FileData({ ...r[y], path: u }); + return f.files ? f.files.map((u, b) => { + const h = new FileData$1({ ...t[b], path: u }); return normalise_file(h, e, null); }) : []; } ) ); } -async function prepare_files(r, e) { - return r.map( - (t, n) => new FileData({ - path: t.name, - orig_name: t.name, - blob: t, - size: t.size, - mime_type: t.type, +async function prepare_files(t, e) { + return t.map( + (r, n) => new FileData$1({ + path: r.name, + orig_name: r.name, + blob: r, + size: r.size, + mime_type: r.type, is_stream: e }) ); } -class FileData { +let FileData$1 = class { constructor({ path: e, - url: t, + url: r, orig_name: n, size: f, blob: u, - is_stream: y, + is_stream: b, mime_type: h, alt_text: _ }) { - this.path = e, this.url = t, this.orig_name = n, this.size = f, this.blob = t ? void 0 : u, this.is_stream = y, this.mime_type = h, this.alt_text = _; + this.path = e, this.url = r, this.orig_name = n, this.size = f, this.blob = r ? void 0 : u, this.is_stream = b, this.mime_type = h, this.alt_text = _; } -} -const QUEUE_FULL_MSG = "This application is too busy. Keep trying!", BROKEN_CONNECTION_MSG = "Connection errored out."; -let NodeBlob; -function api_factory(r, e) { - return { post_data: t, upload_files: n, client: f, handle_blob: u }; - async function t(y, h, _) { +}; +const QUEUE_FULL_MSG$1 = "This application is too busy. Keep trying!", BROKEN_CONNECTION_MSG$1 = "Connection errored out."; +let NodeBlob$1; +function api_factory$1(t, e) { + return { post_data: r, upload_files: n, client: f, handle_blob: u }; + async function r(b, h, _) { const E = { "Content-Type": "application/json" }; _ && (E.Authorization = `Bearer ${_}`); try { - var c = await r(y, { + var c = await t(b, { method: "POST", body: JSON.stringify(h), headers: E }); } catch { - return [{ error: BROKEN_CONNECTION_MSG }, 500]; + return [{ error: BROKEN_CONNECTION_MSG$1 }, 500]; } return [await c.json(), c.status]; } - async function n(y, h, _) { + async function n(b, h, _) { const E = {}; _ && (E.Authorization = `Bearer ${_}`); - const c = 1e3, C = []; - for (let A = 0; A < h.length; A += c) { - const S = h.slice(A, A + c), s = new FormData(); - S.forEach((w) => { - s.append("files", w); + const c = 1e3, S = []; + for (let w = 0; w < h.length; w += c) { + const L = h.slice(w, w + c), s = new FormData(); + L.forEach((A) => { + s.append("files", A); }); try { - var b = await r(`${y}/upload`, { + var y = await t(`${b}/upload`, { method: "POST", body: s, headers: E }); } catch { - return { error: BROKEN_CONNECTION_MSG }; + return { error: BROKEN_CONNECTION_MSG$1 }; } - const o = await b.json(); - C.push(...o); + const o = await y.json(); + S.push(...o); } - return { files: C }; + return { files: S }; } - async function f(y, h = { normalise_files: !0 }) { + async function f(b, h = { normalise_files: !0 }) { return new Promise(async (_) => { - const { status_callback: E, hf_token: c, normalise_files: C } = h, b = { + const { status_callback: E, hf_token: c, normalise_files: S } = h, y = { predict: D, submit: I, view_api: P, - component_server: z - }, A = C ?? !0; + component_server: B + }, w = S ?? !0; if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) { - const B = await import("./wrapper-98f94c21-f7f71f53.js"); - NodeBlob = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = B.WebSocket; + const z = await import("./wrapper-98f94c21-0e07ab68.js"); + NodeBlob$1 = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = z.WebSocket; } - const { ws_protocol: S, http_protocol: s, host: o, space_id: w } = await process_endpoint(y, c), p = Math.random().toString(36).substring(2), v = {}; + const { ws_protocol: L, http_protocol: s, host: o, space_id: A } = await process_endpoint$1(b, c), p = Math.random().toString(36).substring(2), v = {}; let a, l = {}, g = !1; - c && w && (g = await get_jwt(w, c)); - async function M(B) { - if (a = B, l = map_names_to_ids((B == null ? void 0 : B.dependencies) || []), a.auth_required) + c && A && (g = await get_jwt$1(A, c)); + async function M(z) { + if (a = z, l = map_names_to_ids$1((z == null ? void 0 : z.dependencies) || []), a.auth_required) return { config: a, - ...b + ...y }; try { - L = await P(a); + C = await P(a); } catch (k) { console.error(`Could not get api details: ${k.message}`); } return { config: a, - ...b + ...y }; } - let L; - async function T(B) { - if (E && E(B), B.status === "running") + let C; + async function T(z) { + if (E && E(z), z.status === "running") try { - a = await resolve_config( - r, + a = await resolve_config$1( + t, `${s}//${o}`, c ); @@ -26952,17 +26952,17 @@ function api_factory(r, e) { } } try { - a = await resolve_config( - r, + a = await resolve_config$1( + t, `${s}//${o}`, c ); - const B = await M(a); - _(B); - } catch (B) { - console.error(B), w ? check_space_status( - w, - RE_SPACE_NAME.test(w) ? "space_name" : "subdomain", + const z = await M(a); + _(z); + } catch (z) { + console.error(z), A ? check_space_status$1( + A, + RE_SPACE_NAME$1.test(A) ? "space_name" : "subdomain", T ) : E && E({ status: "error", @@ -26971,317 +26971,317 @@ function api_factory(r, e) { detail: "NOT_FOUND" }); } - function D(B, k, N) { - let $ = !1, F = !1, G; - if (typeof B == "number") - G = a.dependencies[B]; + function D(z, k, N) { + let R = !1, U = !1, W; + if (typeof z == "number") + W = a.dependencies[z]; else { - const H = B.replace(/^\//, ""); - G = a.dependencies[l[H]]; + const G = z.replace(/^\//, ""); + W = a.dependencies[l[G]]; } - if (G.types.continuous) + if (W.types.continuous) throw new Error( "Cannot call predict on this function as it may run forever. Use submit instead" ); - return new Promise((H, U) => { - const V = I(B, k, N); - let Q; - V.on("data", (ae) => { - F && (V.destroy(), H(ae)), $ = !0, Q = ae; - }).on("status", (ae) => { - ae.stage === "error" && U(ae), ae.stage === "complete" && (F = !0, $ && (V.destroy(), H(Q))); + return new Promise((G, F) => { + const V = I(z, k, N); + let J; + V.on("data", (X) => { + U && (V.destroy(), G(X)), R = !0, J = X; + }).on("status", (X) => { + X.stage === "error" && F(X), X.stage === "complete" && (U = !0, R && (V.destroy(), G(J))); }); }); } - function I(B, k, N) { - let $, F; - if (typeof B == "number") - $ = B, F = L.unnamed_endpoints[$]; + function I(z, k, N) { + let R, U; + if (typeof z == "number") + R = z, U = C.unnamed_endpoints[R]; else { - const se = B.replace(/^\//, ""); - $ = l[se], F = L.named_endpoints[B.trim()]; + const ae = z.replace(/^\//, ""); + R = l[ae], U = C.named_endpoints[z.trim()]; } - if (typeof $ != "number") + if (typeof R != "number") throw new Error( "There is no endpoint matching that name of fn_index matching that number." ); - let G, H, U = a.protocol ?? "sse"; - const V = typeof B == "number" ? "/predict" : B; - let Q, ae = null, oe = !1; - const q = {}; - let me = ""; - typeof window < "u" && (me = new URLSearchParams(window.location.search).toString()), u( - `${s}//${resolve_root(o, a.path, !0)}`, + let W, G, F = a.protocol ?? "sse"; + const V = typeof z == "number" ? "/predict" : z; + let J, X = null, oe = !1; + const te = {}; + let ve = ""; + typeof window < "u" && (ve = new URLSearchParams(window.location.search).toString()), u( + `${s}//${resolve_root$1(o, a.path, !0)}`, k, - F, + U, c - ).then((se) => { - if (Q = { data: se || [], event_data: N, fn_index: $ }, skip_queue($, a)) - ne({ + ).then((ae) => { + if (J = { data: ae || [], event_data: N, fn_index: R }, skip_queue$1(R, a)) + se({ type: "status", endpoint: V, stage: "pending", queue: !1, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date() - }), t( - `${s}//${resolve_root(o, a.path, !0)}/run${V.startsWith("/") ? V : `/${V}`}${me ? "?" + me : ""}`, + }), r( + `${s}//${resolve_root$1(o, a.path, !0)}/run${V.startsWith("/") ? V : `/${V}`}${ve ? "?" + ve : ""}`, { - ...Q, + ...J, session_hash: p }, c - ).then(([we, Fe]) => { - const Ue = A ? transform_output( - we.data, - F, + ).then(([Ee, Be]) => { + const Ne = w ? transform_output( + Ee.data, + U, a.root, a.root_url - ) : we.data; - Fe == 200 ? (ne({ + ) : Ee.data; + Be == 200 ? (se({ type: "data", endpoint: V, - fn_index: $, - data: Ue, + fn_index: R, + data: Ne, time: /* @__PURE__ */ new Date() - }), ne({ + }), se({ type: "status", endpoint: V, - fn_index: $, + fn_index: R, stage: "complete", - eta: we.average_duration, + eta: Ee.average_duration, queue: !1, time: /* @__PURE__ */ new Date() - })) : ne({ + })) : se({ type: "status", stage: "error", endpoint: V, - fn_index: $, - message: we.error, + fn_index: R, + message: Ee.error, queue: !1, time: /* @__PURE__ */ new Date() }); - }).catch((we) => { - ne({ + }).catch((Ee) => { + se({ type: "status", stage: "error", - message: we.message, + message: Ee.message, endpoint: V, - fn_index: $, + fn_index: R, queue: !1, time: /* @__PURE__ */ new Date() }); }); - else if (U == "ws") { - ne({ + else if (F == "ws") { + se({ type: "status", stage: "pending", queue: !0, endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date() }); - let we = new URL(`${S}://${resolve_root( + let Ee = new URL(`${L}://${resolve_root$1( o, a.path, !0 )} - /queue/join${me ? "?" + me : ""}`); - g && we.searchParams.set("__sign", g), G = e(we), G.onclose = (Fe) => { - Fe.wasClean || ne({ + /queue/join${ve ? "?" + ve : ""}`); + g && Ee.searchParams.set("__sign", g), W = e(Ee), W.onclose = (Be) => { + Be.wasClean || se({ type: "status", stage: "error", broken: !0, - message: BROKEN_CONNECTION_MSG, + message: BROKEN_CONNECTION_MSG$1, queue: !0, endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date() }); - }, G.onmessage = function(Fe) { - const Ue = JSON.parse(Fe.data), { type: Ne, status: Be, data: ue } = handle_message( - Ue, - v[$] + }, W.onmessage = function(Be) { + const Ne = JSON.parse(Be.data), { type: Ge, status: ke, data: pe } = handle_message$1( + Ne, + v[R] ); - if (Ne === "update" && Be && !oe) - ne({ + if (Ge === "update" && ke && !oe) + se({ type: "status", endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date(), - ...Be - }), Be.stage === "error" && G.close(); - else if (Ne === "hash") { - G.send(JSON.stringify({ fn_index: $, session_hash: p })); + ...ke + }), ke.stage === "error" && W.close(); + else if (Ge === "hash") { + W.send(JSON.stringify({ fn_index: R, session_hash: p })); return; } else - Ne === "data" ? G.send(JSON.stringify({ ...Q, session_hash: p })) : Ne === "complete" ? oe = Be : Ne === "log" ? ne({ + Ge === "data" ? W.send(JSON.stringify({ ...J, session_hash: p })) : Ge === "complete" ? oe = ke : Ge === "log" ? se({ type: "log", - log: ue.log, - level: ue.level, + log: pe.log, + level: pe.level, endpoint: V, - fn_index: $ - }) : Ne === "generating" && ne({ + fn_index: R + }) : Ge === "generating" && se({ type: "status", time: /* @__PURE__ */ new Date(), - ...Be, - stage: Be == null ? void 0 : Be.stage, + ...ke, + stage: ke == null ? void 0 : ke.stage, queue: !0, endpoint: V, - fn_index: $ + fn_index: R }); - ue && (ne({ + pe && (se({ type: "data", time: /* @__PURE__ */ new Date(), - data: A ? transform_output( - ue.data, - F, + data: w ? transform_output( + pe.data, + U, a.root, a.root_url - ) : ue.data, + ) : pe.data, endpoint: V, - fn_index: $ - }), oe && (ne({ + fn_index: R + }), oe && (se({ type: "status", time: /* @__PURE__ */ new Date(), ...oe, - stage: Be == null ? void 0 : Be.stage, + stage: ke == null ? void 0 : ke.stage, queue: !0, endpoint: V, - fn_index: $ - }), G.close())); - }, semiver(a.version || "2.0.0", "3.6") < 0 && addEventListener( + fn_index: R + }), W.close())); + }, semiver$1(a.version || "2.0.0", "3.6") < 0 && addEventListener( "open", - () => G.send(JSON.stringify({ hash: p })) + () => W.send(JSON.stringify({ hash: p })) ); } else { - ne({ + se({ type: "status", stage: "pending", queue: !0, endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date() }); - var pe = new URLSearchParams({ - fn_index: $.toString(), + var _e = new URLSearchParams({ + fn_index: R.toString(), session_hash: p }).toString(); - let we = new URL( - `${s}//${resolve_root( + let Ee = new URL( + `${s}//${resolve_root$1( o, a.path, !0 - )}/queue/join?${pe}` + )}/queue/join?${ve ? ve + "&" : ""}${_e}` ); - H = new EventSource(we), H.onmessage = async function(Fe) { - const Ue = JSON.parse(Fe.data), { type: Ne, status: Be, data: ue } = handle_message( - Ue, - v[$] + G = new EventSource(Ee), G.onmessage = async function(Be) { + const Ne = JSON.parse(Be.data), { type: Ge, status: ke, data: pe } = handle_message$1( + Ne, + v[R] ); - if (Ne === "update" && Be && !oe) - ne({ + if (Ge === "update" && ke && !oe) + se({ type: "status", endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date(), - ...Be - }), Be.stage === "error" && H.close(); - else if (Ne === "data") { - ae = Ue.event_id; - let [ye, ge] = await t( - `${s}//${resolve_root( + ...ke + }), ke.stage === "error" && G.close(); + else if (Ge === "data") { + X = Ne.event_id; + let [de, ce] = await r( + `${s}//${resolve_root$1( o, a.path, !0 )}/queue/data`, { - ...Q, + ...J, session_hash: p, - event_id: ae + event_id: X }, c ); - ge !== 200 && (ne({ + ce !== 200 && (se({ type: "status", stage: "error", - message: BROKEN_CONNECTION_MSG, + message: BROKEN_CONNECTION_MSG$1, queue: !0, endpoint: V, - fn_index: $, + fn_index: R, time: /* @__PURE__ */ new Date() - }), H.close()); + }), G.close()); } else - Ne === "complete" ? oe = Be : Ne === "log" ? ne({ + Ge === "complete" ? oe = ke : Ge === "log" ? se({ type: "log", - log: ue.log, - level: ue.level, + log: pe.log, + level: pe.level, endpoint: V, - fn_index: $ - }) : Ne === "generating" && ne({ + fn_index: R + }) : Ge === "generating" && se({ type: "status", time: /* @__PURE__ */ new Date(), - ...Be, - stage: Be == null ? void 0 : Be.stage, + ...ke, + stage: ke == null ? void 0 : ke.stage, queue: !0, endpoint: V, - fn_index: $ + fn_index: R }); - ue && (ne({ + pe && (se({ type: "data", time: /* @__PURE__ */ new Date(), - data: A ? transform_output( - ue.data, - F, + data: w ? transform_output( + pe.data, + U, a.root, a.root_url - ) : ue.data, + ) : pe.data, endpoint: V, - fn_index: $ - }), oe && (ne({ + fn_index: R + }), oe && (se({ type: "status", time: /* @__PURE__ */ new Date(), ...oe, - stage: Be == null ? void 0 : Be.stage, + stage: ke == null ? void 0 : ke.stage, queue: !0, endpoint: V, - fn_index: $ - }), H.close())); + fn_index: R + }), G.close())); }; } }); - function ne(se) { - const we = q[se.type] || []; - we == null || we.forEach((Fe) => Fe(se)); + function se(ae) { + const Ee = te[ae.type] || []; + Ee == null || Ee.forEach((Be) => Be(ae)); } - function fe(se, pe) { - const we = q, Fe = we[se] || []; - return we[se] = Fe, Fe == null || Fe.push(pe), { on: fe, off: Ce, cancel: Me, destroy: Te }; + function le(ae, _e) { + const Ee = te, Be = Ee[ae] || []; + return Ee[ae] = Be, Be == null || Be.push(_e), { on: le, off: Ce, cancel: be, destroy: Le }; } - function Ce(se, pe) { - const we = q; - let Fe = we[se] || []; - return Fe = Fe == null ? void 0 : Fe.filter((Ue) => Ue !== pe), we[se] = Fe, { on: fe, off: Ce, cancel: Me, destroy: Te }; + function Ce(ae, _e) { + const Ee = te; + let Be = Ee[ae] || []; + return Be = Be == null ? void 0 : Be.filter((Ne) => Ne !== _e), Ee[ae] = Be, { on: le, off: Ce, cancel: be, destroy: Le }; } - async function Me() { - const se = { + async function be() { + const ae = { stage: "complete", queue: !1, time: /* @__PURE__ */ new Date() }; - oe = se, ne({ - ...se, + oe = ae, se({ + ...ae, type: "status", endpoint: V, - fn_index: $ + fn_index: R }); - let pe = {}; - U === "ws" ? (G && G.readyState === 0 ? G.addEventListener("open", () => { - G.close(); - }) : G.close(), pe = { fn_index: $, session_hash: p }) : (H.close(), pe = { event_id: ae }); + let _e = {}; + F === "ws" ? (W && W.readyState === 0 ? W.addEventListener("open", () => { + W.close(); + }) : W.close(), _e = { fn_index: R, session_hash: p }) : (G.close(), _e = { event_id: X }); try { - await r( - `${s}//${resolve_root( + await t( + `${s}//${resolve_root$1( o, a.path, !0 @@ -27289,7 +27289,7 @@ function api_factory(r, e) { { headers: { "Content-Type": "application/json" }, method: "POST", - body: JSON.stringify(pe) + body: JSON.stringify(_e) } ); } catch { @@ -27298,77 +27298,77 @@ function api_factory(r, e) { ); } } - function Te() { - for (const se in q) - q[se].forEach((pe) => { - Ce(se, pe); + function Le() { + for (const ae in te) + te[ae].forEach((_e) => { + Ce(ae, _e); }); } return { - on: fe, + on: le, off: Ce, - cancel: Me, - destroy: Te + cancel: be, + destroy: Le }; } - async function z(B, k, N) { - var $; - const F = { "Content-Type": "application/json" }; - c && (F.Authorization = `Bearer ${c}`); - let G, H = a.components.find( - (Q) => Q.id === B + async function B(z, k, N) { + var R; + const U = { "Content-Type": "application/json" }; + c && (U.Authorization = `Bearer ${c}`); + let W, G = a.components.find( + (J) => J.id === z ); - ($ = H == null ? void 0 : H.props) != null && $.root_url ? G = H.props.root_url : G = `${s}//${resolve_root( + (R = G == null ? void 0 : G.props) != null && R.root_url ? W = G.props.root_url : W = `${s}//${resolve_root$1( o, a.path, !0 )}/`; - const U = await r( - `${G}component_server/`, + const F = await t( + `${W}component_server/`, { method: "POST", body: JSON.stringify({ data: N, - component_id: B, + component_id: z, fn_name: k, session_hash: p }), - headers: F + headers: U } ); - if (!U.ok) + if (!F.ok) throw new Error( - "Could not connect to component server: " + U.statusText + "Could not connect to component server: " + F.statusText ); - return await U.json(); + return await F.json(); } - async function P(B) { - if (L) - return L; + async function P(z) { + if (C) + return C; const k = { "Content-Type": "application/json" }; c && (k.Authorization = `Bearer ${c}`); let N; - if (semiver(B.version || "2.0.0", "3.30") < 0 ? N = await r( + if (semiver$1(z.version || "2.0.0", "3.30") < 0 ? N = await t( "https://gradio-space-api-fetcher-v2.hf.space/api", { method: "POST", body: JSON.stringify({ serialize: !1, - config: JSON.stringify(B) + config: JSON.stringify(z) }), headers: k } - ) : N = await r(`${B.root}/info`, { + ) : N = await t(`${z.root}/info`, { headers: k }), !N.ok) - throw new Error(BROKEN_CONNECTION_MSG); - let $ = await N.json(); - return "api" in $ && ($ = $.api), $.named_endpoints["/predict"] && !$.unnamed_endpoints[0] && ($.unnamed_endpoints[0] = $.named_endpoints["/predict"]), transform_api_info($, B, l); + throw new Error(BROKEN_CONNECTION_MSG$1); + let R = await N.json(); + return "api" in R && (R = R.api), R.named_endpoints["/predict"] && !R.unnamed_endpoints[0] && (R.unnamed_endpoints[0] = R.named_endpoints["/predict"]), transform_api_info$1(R, z, l); } }); } - async function u(y, h, _, E) { - const c = await walk_and_store_blobs( + async function u(b, h, _, E) { + const c = await walk_and_store_blobs$1( h, void 0, [], @@ -27376,35 +27376,35 @@ function api_factory(r, e) { _ ); return Promise.all( - c.map(async ({ path: C, blob: b, type: A }) => { - if (b) { - const S = (await n(y, [b], E)).files[0]; - return { path: C, file_url: S, type: A, name: b == null ? void 0 : b.name }; + c.map(async ({ path: S, blob: y, type: w }) => { + if (y) { + const L = (await n(b, [y], E)).files[0]; + return { path: S, file_url: L, type: w, name: y == null ? void 0 : y.name }; } - return { path: C, type: A }; + return { path: S, type: w }; }) - ).then((C) => (C.forEach(({ path: b, file_url: A, type: S, name: s }) => { - if (S === "Gallery") - update_object(h, A, b); - else if (A) { - const o = new FileData({ path: A, orig_name: s }); - update_object(h, o, b); + ).then((S) => (S.forEach(({ path: y, file_url: w, type: L, name: s }) => { + if (L === "Gallery") + update_object$1(h, w, y); + else if (w) { + const o = new FileData$1({ path: w, orig_name: s }); + update_object$1(h, o, y); } }), h)); } } -const { post_data, upload_files, client, handle_blob } = api_factory( +const { post_data: post_data$1, upload_files: upload_files$1, client: client$1, handle_blob: handle_blob$1 } = api_factory$1( fetch, - (...r) => new WebSocket(...r) + (...t) => new WebSocket(...t) ); -function transform_output(r, e, t, n) { - return r.map((f, u) => { - var y, h, _, E; - return ((h = (y = e == null ? void 0 : e.returns) == null ? void 0 : y[u]) == null ? void 0 : h.component) === "File" ? normalise_file(f, t, n) : ((E = (_ = e == null ? void 0 : e.returns) == null ? void 0 : _[u]) == null ? void 0 : E.component) === "Gallery" ? f.map((c) => Array.isArray(c) ? [normalise_file(c[0], t, n), c[1]] : [normalise_file(c, t, n), null]) : typeof f == "object" && f.path ? normalise_file(f, t, n) : f; +function transform_output(t, e, r, n) { + return t.map((f, u) => { + var b, h, _, E; + return ((h = (b = e == null ? void 0 : e.returns) == null ? void 0 : b[u]) == null ? void 0 : h.component) === "File" ? normalise_file(f, r, n) : ((E = (_ = e == null ? void 0 : e.returns) == null ? void 0 : _[u]) == null ? void 0 : E.component) === "Gallery" ? f.map((c) => Array.isArray(c) ? [normalise_file(c[0], r, n), c[1]] : [normalise_file(c, r, n), null]) : typeof f == "object" && f.path ? normalise_file(f, r, n) : f; }); } -function get_type(r, e, t, n) { - switch (r.type) { +function get_type$1(t, e, r, n) { + switch (t.type) { case "string": return "string"; case "boolean": @@ -27412,74 +27412,74 @@ function get_type(r, e, t, n) { case "number": return "number"; } - if (t === "JSONSerializable" || t === "StringSerializable") + if (r === "JSONSerializable" || r === "StringSerializable") return "any"; - if (t === "ListStringSerializable") + if (r === "ListStringSerializable") return "string[]"; if (e === "Image") return n === "parameter" ? "Blob | File | Buffer" : "string"; - if (t === "FileSerializable") - return (r == null ? void 0 : r.type) === "array" ? n === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : n === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}"; - if (t === "GallerySerializable") + if (r === "FileSerializable") + return (t == null ? void 0 : t.type) === "array" ? n === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : n === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}"; + if (r === "GallerySerializable") return n === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; } -function get_description(r, e) { - return e === "GallerySerializable" ? "array of [file, label] tuples" : e === "ListStringSerializable" ? "array of strings" : e === "FileSerializable" ? "array of files or single file" : r.description; +function get_description$1(t, e) { + return e === "GallerySerializable" ? "array of [file, label] tuples" : e === "ListStringSerializable" ? "array of strings" : e === "FileSerializable" ? "array of files or single file" : t.description; } -function transform_api_info(r, e, t) { +function transform_api_info$1(t, e, r) { const n = { named_endpoints: {}, unnamed_endpoints: {} }; - for (const f in r) { - const u = r[f]; - for (const y in u) { - const h = e.dependencies[y] ? y : t[y.replace("/", "")], _ = u[y]; - n[f][y] = {}, n[f][y].parameters = {}, n[f][y].returns = {}, n[f][y].type = e.dependencies[h].types, n[f][y].parameters = _.parameters.map( - ({ label: E, component: c, type: C, serializer: b }) => ({ + for (const f in t) { + const u = t[f]; + for (const b in u) { + const h = e.dependencies[b] ? b : r[b.replace("/", "")], _ = u[b]; + n[f][b] = {}, n[f][b].parameters = {}, n[f][b].returns = {}, n[f][b].type = e.dependencies[h].types, n[f][b].parameters = _.parameters.map( + ({ label: E, component: c, type: S, serializer: y }) => ({ label: E, component: c, - type: get_type(C, c, b, "parameter"), - description: get_description(C, b) + type: get_type$1(S, c, y, "parameter"), + description: get_description$1(S, y) }) - ), n[f][y].returns = _.returns.map( - ({ label: E, component: c, type: C, serializer: b }) => ({ + ), n[f][b].returns = _.returns.map( + ({ label: E, component: c, type: S, serializer: y }) => ({ label: E, component: c, - type: get_type(C, c, b, "return"), - description: get_description(C, b) + type: get_type$1(S, c, y, "return"), + description: get_description$1(S, y) }) ); } } return n; } -async function get_jwt(r, e) { +async function get_jwt$1(t, e) { try { - return (await (await fetch(`https://huggingface.co/api/spaces/${r}/jwt`, { + return (await (await fetch(`https://huggingface.co/api/spaces/${t}/jwt`, { headers: { Authorization: `Bearer ${e}` } })).json()).token || !1; - } catch (t) { - return console.error(t), !1; + } catch (r) { + return console.error(r), !1; } } -function update_object(r, e, t) { - for (; t.length > 1; ) - r = r[t.shift()]; - r[t.shift()] = e; +function update_object$1(t, e, r) { + for (; r.length > 1; ) + t = t[r.shift()]; + t[r.shift()] = e; } -async function walk_and_store_blobs(r, e = void 0, t = [], n = !1, f = void 0) { - if (Array.isArray(r)) { +async function walk_and_store_blobs$1(t, e = void 0, r = [], n = !1, f = void 0) { + if (Array.isArray(t)) { let u = []; return await Promise.all( - r.map(async (y, h) => { + t.map(async (b, h) => { var _; - let E = t.slice(); + let E = r.slice(); E.push(h); - const c = await walk_and_store_blobs( - r[h], + const c = await walk_and_store_blobs$1( + t[h], n ? ((_ = f == null ? void 0 : f.parameters[h]) == null ? void 0 : _.component) || void 0 : e, E, !1, @@ -27489,22 +27489,22 @@ async function walk_and_store_blobs(r, e = void 0, t = [], n = !1, f = void 0) { }) ), u; } else { - if (globalThis.Buffer && r instanceof globalThis.Buffer) + if (globalThis.Buffer && t instanceof globalThis.Buffer) return [ { - path: t, - blob: e === "Image" ? !1 : new NodeBlob([r]), + path: r, + blob: e === "Image" ? !1 : new NodeBlob$1([t]), type: e } ]; - if (typeof r == "object") { + if (typeof t == "object") { let u = []; - for (let y in r) - if (r.hasOwnProperty(y)) { - let h = t.slice(); - h.push(y), u = u.concat( - await walk_and_store_blobs( - r[y], + for (let b in t) + if (t.hasOwnProperty(b)) { + let h = r.slice(); + h.push(b), u = u.concat( + await walk_and_store_blobs$1( + t[b], void 0, h, !1, @@ -27517,17 +27517,17 @@ async function walk_and_store_blobs(r, e = void 0, t = [], n = !1, f = void 0) { } return []; } -function skip_queue(r, e) { - var t, n, f, u; - return !(((n = (t = e == null ? void 0 : e.dependencies) == null ? void 0 : t[r]) == null ? void 0 : n.queue) === null ? e.enable_queue : (u = (f = e == null ? void 0 : e.dependencies) == null ? void 0 : f[r]) != null && u.queue) || !1; +function skip_queue$1(t, e) { + var r, n, f, u; + return !(((n = (r = e == null ? void 0 : e.dependencies) == null ? void 0 : r[t]) == null ? void 0 : n.queue) === null ? e.enable_queue : (u = (f = e == null ? void 0 : e.dependencies) == null ? void 0 : f[t]) != null && u.queue) || !1; } -async function resolve_config(r, e, t) { +async function resolve_config$1(t, e, r) { const n = {}; - if (t && (n.Authorization = `Bearer ${t}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { + if (r && (n.Authorization = `Bearer ${r}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { const f = window.gradio_config.root, u = window.gradio_config; - return u.root = resolve_root(e, u.root, !1), { ...u, path: f }; + return u.root = resolve_root$1(e, u.root, !1), { ...u, path: f }; } else if (e) { - let f = await r(`${e}/config`, { + let f = await t(`${e}/config`, { headers: n }); if (f.status === 200) { @@ -27538,14 +27538,14 @@ async function resolve_config(r, e, t) { } throw new Error("No config or app endpoint found"); } -async function check_space_status(r, e, t) { - let n = e === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${r}` : `https://huggingface.co/api/spaces/${r}`, f, u; +async function check_space_status$1(t, e, r) { + let n = e === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${t}` : `https://huggingface.co/api/spaces/${t}`, f, u; try { if (f = await fetch(n), u = f.status, u !== 200) throw new Error(); f = await f.json(); } catch { - t({ + r({ status: "error", load_status: "error", message: "Could not get space status", @@ -27556,62 +27556,62 @@ async function check_space_status(r, e, t) { if (!f || u !== 200) return; const { - runtime: { stage: y }, + runtime: { stage: b }, id: h } = f; - switch (y) { + switch (b) { case "STOPPED": case "SLEEPING": - t({ + r({ status: "sleeping", load_status: "pending", message: "Space is asleep. Waking it up...", - detail: y + detail: b }), setTimeout(() => { - check_space_status(r, e, t); + check_space_status$1(t, e, r); }, 1e3); break; case "PAUSED": - t({ + r({ status: "paused", 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: y, - discussions_enabled: await discussions_enabled(h) + detail: b, + discussions_enabled: await discussions_enabled$1(h) }); break; case "RUNNING": case "RUNNING_BUILDING": - t({ + r({ status: "running", load_status: "complete", message: "", - detail: y + detail: b }); break; case "BUILDING": - t({ + r({ status: "building", load_status: "pending", message: "Space is building...", - detail: y + detail: b }), setTimeout(() => { - check_space_status(r, e, t); + check_space_status$1(t, e, r); }, 1e3); break; default: - t({ + r({ status: "space_error", load_status: "error", message: "This space is experiencing an issue.", - detail: y, - discussions_enabled: await discussions_enabled(h) + detail: b, + discussions_enabled: await discussions_enabled$1(h) }); break; } } -function handle_message(r, e) { - switch (r.msg) { +function handle_message$1(t, e) { + switch (t.msg) { case "send_data": return { type: "data" }; case "send_hash": @@ -27621,10 +27621,10 @@ function handle_message(r, e) { type: "update", status: { queue: !0, - message: QUEUE_FULL_MSG, + message: QUEUE_FULL_MSG$1, stage: "error", - code: r.code, - success: r.success + code: t.code, + success: t.success } }; case "estimation": @@ -27633,11 +27633,11 @@ function handle_message(r, e) { status: { queue: !0, stage: e || "pending", - code: r.code, - size: r.queue_size, - position: r.rank, - eta: r.rank_eta, - success: r.success + code: t.code, + size: t.queue_size, + position: t.rank, + eta: t.rank_eta, + success: t.success } }; case "progress": @@ -27646,47 +27646,47 @@ function handle_message(r, e) { status: { queue: !0, stage: "pending", - code: r.code, - progress_data: r.progress_data, - success: r.success + code: t.code, + progress_data: t.progress_data, + success: t.success } }; case "log": - return { type: "log", data: r }; + return { type: "log", data: t }; case "process_generating": return { type: "generating", status: { queue: !0, - message: r.success ? null : r.output.error, - stage: r.success ? "generating" : "error", - code: r.code, - progress_data: r.progress_data, - eta: r.average_duration + message: t.success ? null : t.output.error, + stage: t.success ? "generating" : "error", + code: t.code, + progress_data: t.progress_data, + eta: t.average_duration }, - data: r.success ? r.output : null + data: t.success ? t.output : null }; case "process_completed": - return "error" in r.output ? { + return "error" in t.output ? { type: "update", status: { queue: !0, - message: r.output.error, + message: t.output.error, stage: "error", - code: r.code, - success: r.success + code: t.code, + success: t.success } } : { type: "complete", status: { queue: !0, - message: r.success ? void 0 : r.output.error, - stage: r.success ? "complete" : "error", - code: r.code, - progress_data: r.progress_data, - eta: r.output.average_duration + message: t.success ? void 0 : t.output.error, + stage: t.success ? "complete" : "error", + code: t.code, + progress_data: t.progress_data, + eta: t.output.average_duration }, - data: r.success ? r.output : null + data: t.success ? t.output : null }; case "process_starts": return { @@ -27694,10 +27694,10 @@ function handle_message(r, e) { status: { queue: !0, stage: "pending", - code: r.code, - size: r.rank, + code: t.code, + size: t.rank, position: 0, - success: r.success + success: t.success } }; } @@ -27705,40 +27705,40 @@ function handle_message(r, e) { } function noop$5() { } -function run(r) { - return r(); +function run(t) { + return t(); } -function run_all$2(r) { - r.forEach(run); +function run_all$2(t) { + t.forEach(run); } -function is_function(r) { - return typeof r == "function"; +function is_function(t) { + return typeof t == "function"; } -function safe_not_equal$9(r, e) { - return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function"; +function safe_not_equal$9(t, e) { + return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function"; } -function subscribe(r, ...e) { - if (r == null) { +function subscribe(t, ...e) { + if (t == null) { for (const n of e) n(void 0); return noop$5; } - const t = r.subscribe(...e); - return t.unsubscribe ? () => t.unsubscribe() : t; + const r = t.subscribe(...e); + return r.unsubscribe ? () => r.unsubscribe() : r; } const is_client = typeof window < "u"; -let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (r) => requestAnimationFrame(r) : noop$5; +let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (t) => requestAnimationFrame(t) : noop$5; const tasks = /* @__PURE__ */ new Set(); -function run_tasks(r) { +function run_tasks(t) { tasks.forEach((e) => { - e.c(r) || (tasks.delete(e), e.f()); + e.c(t) || (tasks.delete(e), e.f()); }), tasks.size !== 0 && raf(run_tasks); } -function loop(r) { +function loop(t) { let e; return tasks.size === 0 && raf(run_tasks), { - promise: new Promise((t) => { - tasks.add(e = { c: r, f: t }); + promise: new Promise((r) => { + tasks.add(e = { c: t, f: r }); }), abort() { tasks.delete(e); @@ -27746,19 +27746,19 @@ function loop(r) { }; } const subscriber_queue = []; -function readable(r, e) { +function readable(t, e) { return { - subscribe: writable(r, e).subscribe + subscribe: writable(t, e).subscribe }; } -function writable(r, e = noop$5) { - let t; +function writable(t, e = noop$5) { + let r; const n = /* @__PURE__ */ new Set(); function f(h) { - if (safe_not_equal$9(r, h) && (r = h, t)) { + if (safe_not_equal$9(t, h) && (t = h, r)) { const _ = !subscriber_queue.length; for (const E of n) - E[1](), subscriber_queue.push(E, r); + E[1](), subscriber_queue.push(E, t); if (_) { for (let E = 0; E < subscriber_queue.length; E += 2) subscriber_queue[E][0](subscriber_queue[E + 1]); @@ -27767,85 +27767,85 @@ function writable(r, e = noop$5) { } } function u(h) { - f(h(r)); + f(h(t)); } - function y(h, _ = noop$5) { + function b(h, _ = noop$5) { const E = [h, _]; - return n.add(E), n.size === 1 && (t = e(f, u) || noop$5), h(r), () => { - n.delete(E), n.size === 0 && t && (t(), t = null); + return n.add(E), n.size === 1 && (r = e(f, u) || noop$5), h(t), () => { + n.delete(E), n.size === 0 && r && (r(), r = null); }; } - return { set: f, update: u, subscribe: y }; + return { set: f, update: u, subscribe: b }; } -function derived(r, e, t) { - const n = !Array.isArray(r), f = n ? [r] : r; +function derived(t, e, r) { + const n = !Array.isArray(t), f = n ? [t] : t; if (!f.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); const u = e.length < 2; - return readable(t, (y, h) => { + return readable(r, (b, h) => { let _ = !1; const E = []; - let c = 0, C = noop$5; - const b = () => { + let c = 0, S = noop$5; + const y = () => { if (c) return; - C(); - const S = e(n ? E[0] : E, y, h); - u ? y(S) : C = is_function(S) ? S : noop$5; - }, A = f.map( - (S, s) => subscribe( - S, + S(); + const L = e(n ? E[0] : E, b, h); + u ? b(L) : S = is_function(L) ? L : noop$5; + }, w = f.map( + (L, s) => subscribe( + L, (o) => { - E[s] = o, c &= ~(1 << s), _ && b(); + E[s] = o, c &= ~(1 << s), _ && y(); }, () => { c |= 1 << s; } ) ); - return _ = !0, b(), function() { - run_all$2(A), C(), _ = !1; + return _ = !0, y(), function() { + run_all$2(w), S(), _ = !1; }; }); } -function is_date(r) { - return Object.prototype.toString.call(r) === "[object Date]"; +function is_date(t) { + return Object.prototype.toString.call(t) === "[object Date]"; } -function tick_spring(r, e, t, n) { - if (typeof t == "number" || is_date(t)) { - const f = n - t, u = (t - e) / (r.dt || 1 / 60), y = r.opts.stiffness * f, h = r.opts.damping * u, _ = (y - h) * r.inv_mass, E = (u + _) * r.dt; - return Math.abs(E) < r.opts.precision && Math.abs(f) < r.opts.precision ? n : (r.settled = !1, is_date(t) ? new Date(t.getTime() + E) : t + E); +function tick_spring(t, e, r, n) { + if (typeof r == "number" || is_date(r)) { + const f = n - r, u = (r - e) / (t.dt || 1 / 60), b = t.opts.stiffness * f, h = t.opts.damping * u, _ = (b - h) * t.inv_mass, E = (u + _) * t.dt; + return Math.abs(E) < t.opts.precision && Math.abs(f) < t.opts.precision ? n : (t.settled = !1, is_date(r) ? new Date(r.getTime() + E) : r + E); } else { - if (Array.isArray(t)) - return t.map( - (f, u) => tick_spring(r, e[u], t[u], n[u]) + if (Array.isArray(r)) + return r.map( + (f, u) => tick_spring(t, e[u], r[u], n[u]) ); - if (typeof t == "object") { + if (typeof r == "object") { const f = {}; - for (const u in t) - f[u] = tick_spring(r, e[u], t[u], n[u]); + for (const u in r) + f[u] = tick_spring(t, e[u], r[u], n[u]); return f; } else - throw new Error(`Cannot spring ${typeof t} values`); + throw new Error(`Cannot spring ${typeof r} values`); } } -function spring(r, e = {}) { - const t = writable(r), { stiffness: n = 0.15, damping: f = 0.8, precision: u = 0.01 } = e; - let y, h, _, E = r, c = r, C = 1, b = 0, A = !1; - function S(o, w = {}) { +function spring(t, e = {}) { + const r = writable(t), { stiffness: n = 0.15, damping: f = 0.8, precision: u = 0.01 } = e; + let b, h, _, E = t, c = t, S = 1, y = 0, w = !1; + function L(o, A = {}) { c = o; const p = _ = {}; - return r == null || w.hard || s.stiffness >= 1 && s.damping >= 1 ? (A = !0, y = now(), E = o, t.set(r = c), Promise.resolve()) : (w.soft && (b = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), C = 0), h || (y = now(), A = !1, h = loop((v) => { - if (A) - return A = !1, h = null, !1; - C = Math.min(C + b, 1); + return t == null || A.hard || s.stiffness >= 1 && s.damping >= 1 ? (w = !0, b = now(), E = o, r.set(t = c), Promise.resolve()) : (A.soft && (y = 1 / ((A.soft === !0 ? 0.5 : +A.soft) * 60), S = 0), h || (b = now(), w = !1, h = loop((v) => { + if (w) + return w = !1, h = null, !1; + S = Math.min(S + y, 1); const a = { - inv_mass: C, + inv_mass: S, opts: s, settled: !0, - dt: (v - y) * 60 / 1e3 - }, l = tick_spring(a, E, r, c); - return y = v, E = r, t.set(r = l), a.settled && (h = null), !a.settled; + dt: (v - b) * 60 / 1e3 + }, l = tick_spring(a, E, t, c); + return b = v, E = t, r.set(t = l), a.settled && (h = null), !a.settled; })), new Promise((v) => { h.promise.then(() => { p === _ && v(); @@ -27853,171 +27853,171 @@ function spring(r, e = {}) { })); } const s = { - set: S, - update: (o, w) => S(o(c, r), w), - subscribe: t.subscribe, + set: L, + update: (o, A) => L(o(c, t), A), + subscribe: r.subscribe, stiffness: n, damping: f, precision: u }; return s; } -var isMergeableObject = function r(e) { +var isMergeableObject = function t(e) { return isNonNullObject(e) && !isSpecial(e); }; -function isNonNullObject(r) { - return !!r && typeof r == "object"; +function isNonNullObject(t) { + return !!t && typeof t == "object"; } -function isSpecial(r) { - var e = Object.prototype.toString.call(r); - return e === "[object RegExp]" || e === "[object Date]" || isReactElement(r); +function isSpecial(t) { + var e = Object.prototype.toString.call(t); + return e === "[object RegExp]" || e === "[object Date]" || isReactElement(t); } var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; -function isReactElement(r) { - return r.$$typeof === REACT_ELEMENT_TYPE; +function isReactElement(t) { + return t.$$typeof === REACT_ELEMENT_TYPE; } -function emptyTarget(r) { - return Array.isArray(r) ? [] : {}; +function emptyTarget(t) { + return Array.isArray(t) ? [] : {}; } -function cloneUnlessOtherwiseSpecified(r, e) { - return e.clone !== !1 && e.isMergeableObject(r) ? deepmerge(emptyTarget(r), r, e) : r; +function cloneUnlessOtherwiseSpecified(t, e) { + return e.clone !== !1 && e.isMergeableObject(t) ? deepmerge(emptyTarget(t), t, e) : t; } -function defaultArrayMerge(r, e, t) { - return r.concat(e).map(function(n) { - return cloneUnlessOtherwiseSpecified(n, t); +function defaultArrayMerge(t, e, r) { + return t.concat(e).map(function(n) { + return cloneUnlessOtherwiseSpecified(n, r); }); } -function getMergeFunction(r, e) { +function getMergeFunction(t, e) { if (!e.customMerge) return deepmerge; - var t = e.customMerge(r); - return typeof t == "function" ? t : deepmerge; + var r = e.customMerge(t); + return typeof r == "function" ? r : deepmerge; } -function getEnumerableOwnPropertySymbols(r) { - return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(r).filter(function(e) { - return Object.propertyIsEnumerable.call(r, e); +function getEnumerableOwnPropertySymbols(t) { + return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(e) { + return Object.propertyIsEnumerable.call(t, e); }) : []; } -function getKeys(r) { - return Object.keys(r).concat(getEnumerableOwnPropertySymbols(r)); +function getKeys(t) { + return Object.keys(t).concat(getEnumerableOwnPropertySymbols(t)); } -function propertyIsOnObject(r, e) { +function propertyIsOnObject(t, e) { try { - return e in r; + return e in t; } catch { return !1; } } -function propertyIsUnsafe(r, e) { - return propertyIsOnObject(r, e) && !(Object.hasOwnProperty.call(r, e) && Object.propertyIsEnumerable.call(r, e)); +function propertyIsUnsafe(t, e) { + return propertyIsOnObject(t, e) && !(Object.hasOwnProperty.call(t, e) && Object.propertyIsEnumerable.call(t, e)); } -function mergeObject(r, e, t) { +function mergeObject(t, e, r) { var n = {}; - return t.isMergeableObject(r) && getKeys(r).forEach(function(f) { - n[f] = cloneUnlessOtherwiseSpecified(r[f], t); + return r.isMergeableObject(t) && getKeys(t).forEach(function(f) { + n[f] = cloneUnlessOtherwiseSpecified(t[f], r); }), getKeys(e).forEach(function(f) { - propertyIsUnsafe(r, f) || (propertyIsOnObject(r, f) && t.isMergeableObject(e[f]) ? n[f] = getMergeFunction(f, t)(r[f], e[f], t) : n[f] = cloneUnlessOtherwiseSpecified(e[f], t)); + propertyIsUnsafe(t, f) || (propertyIsOnObject(t, f) && r.isMergeableObject(e[f]) ? n[f] = getMergeFunction(f, r)(t[f], e[f], r) : n[f] = cloneUnlessOtherwiseSpecified(e[f], r)); }), n; } -function deepmerge(r, e, t) { - t = t || {}, t.arrayMerge = t.arrayMerge || defaultArrayMerge, t.isMergeableObject = t.isMergeableObject || isMergeableObject, t.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; - var n = Array.isArray(e), f = Array.isArray(r), u = n === f; - return u ? n ? t.arrayMerge(r, e, t) : mergeObject(r, e, t) : cloneUnlessOtherwiseSpecified(e, t); +function deepmerge(t, e, r) { + r = r || {}, r.arrayMerge = r.arrayMerge || defaultArrayMerge, r.isMergeableObject = r.isMergeableObject || isMergeableObject, r.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; + var n = Array.isArray(e), f = Array.isArray(t), u = n === f; + return u ? n ? r.arrayMerge(t, e, r) : mergeObject(t, e, r) : cloneUnlessOtherwiseSpecified(e, r); } -deepmerge.all = function r(e, t) { +deepmerge.all = function t(e, r) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); return e.reduce(function(n, f) { - return deepmerge(n, f, t); + return deepmerge(n, f, r); }, {}); }; var deepmerge_1 = deepmerge, cjs = deepmerge_1; const deepmerge$1 = /* @__PURE__ */ getDefaultExportFromCjs(cjs); -var extendStatics = function(r, e) { - return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) { - t.__proto__ = n; - } || function(t, n) { +var extendStatics = function(t, e) { + return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) { + r.__proto__ = n; + } || function(r, n) { for (var f in n) - Object.prototype.hasOwnProperty.call(n, f) && (t[f] = n[f]); - }, extendStatics(r, e); + Object.prototype.hasOwnProperty.call(n, f) && (r[f] = n[f]); + }, extendStatics(t, e); }; -function __extends(r, e) { +function __extends(t, e) { if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null"); - extendStatics(r, e); - function t() { - this.constructor = r; + extendStatics(t, e); + function r() { + this.constructor = t; } - r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t()); + t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r()); } var __assign = function() { return __assign = Object.assign || function(e) { - for (var t, n = 1, f = arguments.length; n < f; n++) { - t = arguments[n]; - for (var u in t) - Object.prototype.hasOwnProperty.call(t, u) && (e[u] = t[u]); + for (var r, n = 1, f = arguments.length; n < f; n++) { + r = arguments[n]; + for (var u in r) + Object.prototype.hasOwnProperty.call(r, u) && (e[u] = r[u]); } return e; }, __assign.apply(this, arguments); }; -function __spreadArray(r, e, t) { - if (t || arguments.length === 2) +function __spreadArray(t, e, r) { + if (r || arguments.length === 2) for (var n = 0, f = e.length, u; n < f; n++) (u || !(n in e)) && (u || (u = Array.prototype.slice.call(e, 0, n)), u[n] = e[n]); - return r.concat(u || Array.prototype.slice.call(e)); + return t.concat(u || Array.prototype.slice.call(e)); } typeof SuppressedError == "function" && SuppressedError; var ErrorKind; -(function(r) { - r[r.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", r[r.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", r[r.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", r[r.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", r[r.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", r[r.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", r[r.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", r[r.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", r[r.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", r[r.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", r[r.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", r[r.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", r[r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", r[r.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", r[r.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", r[r.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", r[r.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", r[r.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", r[r.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", r[r.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", r[r.INVALID_TAG = 23] = "INVALID_TAG", r[r.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", r[r.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", r[r.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; +(function(t) { + t[t.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", t[t.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", t[t.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", t[t.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", t[t.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", t[t.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", t[t.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", t[t.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", t[t.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", t[t.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", t[t.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", t[t.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", t[t.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", t[t.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", t[t.INVALID_TAG = 23] = "INVALID_TAG", t[t.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", t[t.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", t[t.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(ErrorKind || (ErrorKind = {})); var TYPE; -(function(r) { - r[r.literal = 0] = "literal", r[r.argument = 1] = "argument", r[r.number = 2] = "number", r[r.date = 3] = "date", r[r.time = 4] = "time", r[r.select = 5] = "select", r[r.plural = 6] = "plural", r[r.pound = 7] = "pound", r[r.tag = 8] = "tag"; +(function(t) { + t[t.literal = 0] = "literal", t[t.argument = 1] = "argument", t[t.number = 2] = "number", t[t.date = 3] = "date", t[t.time = 4] = "time", t[t.select = 5] = "select", t[t.plural = 6] = "plural", t[t.pound = 7] = "pound", t[t.tag = 8] = "tag"; })(TYPE || (TYPE = {})); var SKELETON_TYPE; -(function(r) { - r[r.number = 0] = "number", r[r.dateTime = 1] = "dateTime"; +(function(t) { + t[t.number = 0] = "number", t[t.dateTime = 1] = "dateTime"; })(SKELETON_TYPE || (SKELETON_TYPE = {})); -function isLiteralElement(r) { - return r.type === TYPE.literal; +function isLiteralElement(t) { + return t.type === TYPE.literal; } -function isArgumentElement(r) { - return r.type === TYPE.argument; +function isArgumentElement(t) { + return t.type === TYPE.argument; } -function isNumberElement(r) { - return r.type === TYPE.number; +function isNumberElement(t) { + return t.type === TYPE.number; } -function isDateElement(r) { - return r.type === TYPE.date; +function isDateElement(t) { + return t.type === TYPE.date; } -function isTimeElement(r) { - return r.type === TYPE.time; +function isTimeElement(t) { + return t.type === TYPE.time; } -function isSelectElement(r) { - return r.type === TYPE.select; +function isSelectElement(t) { + return t.type === TYPE.select; } -function isPluralElement(r) { - return r.type === TYPE.plural; +function isPluralElement(t) { + return t.type === TYPE.plural; } -function isPoundElement(r) { - return r.type === TYPE.pound; +function isPoundElement(t) { + return t.type === TYPE.pound; } -function isTagElement(r) { - return r.type === TYPE.tag; +function isTagElement(t) { + return t.type === TYPE.tag; } -function isNumberSkeleton(r) { - return !!(r && typeof r == "object" && r.type === SKELETON_TYPE.number); +function isNumberSkeleton(t) { + return !!(t && typeof t == "object" && t.type === SKELETON_TYPE.number); } -function isDateTimeSkeleton(r) { - return !!(r && typeof r == "object" && r.type === SKELETON_TYPE.dateTime); +function isDateTimeSkeleton(t) { + return !!(t && typeof t == "object" && t.type === SKELETON_TYPE.dateTime); } var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, DATE_TIME_REGEX = /(?:[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 parseDateTimeSkeleton(r) { +function parseDateTimeSkeleton(t) { var e = {}; - return r.replace(DATE_TIME_REGEX, function(t) { - var n = t.length; - switch (t[0]) { + return t.replace(DATE_TIME_REGEX, function(r) { + var n = r.length; + switch (r[0]) { case "G": e.era = n === 4 ? "long" : n === 5 ? "narrow" : "short"; break; @@ -28105,36 +28105,36 @@ function parseDateTimeSkeleton(r) { }), e; } var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function parseNumberSkeletonFromString(r) { - if (r.length === 0) +function parseNumberSkeletonFromString(t) { + if (t.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var e = r.split(WHITE_SPACE_REGEX).filter(function(b) { - return b.length > 0; - }), t = [], n = 0, f = e; n < f.length; n++) { - var u = f[n], y = u.split("/"); - if (y.length === 0) + for (var e = t.split(WHITE_SPACE_REGEX).filter(function(y) { + return y.length > 0; + }), r = [], n = 0, f = e; n < f.length; n++) { + var u = f[n], b = u.split("/"); + if (b.length === 0) throw new Error("Invalid number skeleton"); - for (var h = y[0], _ = y.slice(1), E = 0, c = _; E < c.length; E++) { - var C = c[E]; - if (C.length === 0) + for (var h = b[0], _ = b.slice(1), E = 0, c = _; E < c.length; E++) { + var S = c[E]; + if (S.length === 0) throw new Error("Invalid number skeleton"); } - t.push({ stem: h, options: _ }); + r.push({ stem: h, options: _ }); } - return t; + return r; } -function icuUnitToEcma(r) { - return r.replace(/^(.*?)-/, ""); +function icuUnitToEcma(t) { + return t.replace(/^(.*?)-/, ""); } var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g, INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g, CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; -function parseSignificantPrecision(r) { +function parseSignificantPrecision(t) { var e = {}; - return r[r.length - 1] === "r" ? e.roundingPriority = "morePrecision" : r[r.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), r.replace(SIGNIFICANT_PRECISION_REGEX, function(t, n, f) { + return t[t.length - 1] === "r" ? e.roundingPriority = "morePrecision" : t[t.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), t.replace(SIGNIFICANT_PRECISION_REGEX, function(r, n, f) { return typeof f != "string" ? (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length) : f === "+" ? e.minimumSignificantDigits = n.length : n[0] === "#" ? e.maximumSignificantDigits = n.length : (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length + (typeof f == "string" ? f.length : 0)), ""; }), e; } -function parseSign(r) { - switch (r) { +function parseSign(t) { + switch (t) { case "sign-auto": return { signDisplay: "auto" @@ -28173,27 +28173,27 @@ function parseSign(r) { }; } } -function parseConciseScientificAndEngineeringStem(r) { +function parseConciseScientificAndEngineeringStem(t) { var e; - if (r[0] === "E" && r[1] === "E" ? (e = { + if (t[0] === "E" && t[1] === "E" ? (e = { notation: "engineering" - }, r = r.slice(2)) : r[0] === "E" && (e = { + }, t = t.slice(2)) : t[0] === "E" && (e = { notation: "scientific" - }, r = r.slice(1)), e) { - var t = r.slice(0, 2); - if (t === "+!" ? (e.signDisplay = "always", r = r.slice(2)) : t === "+?" && (e.signDisplay = "exceptZero", r = r.slice(2)), !CONCISE_INTEGER_WIDTH_REGEX.test(r)) + }, t = t.slice(1)), e) { + var r = t.slice(0, 2); + if (r === "+!" ? (e.signDisplay = "always", t = t.slice(2)) : r === "+?" && (e.signDisplay = "exceptZero", t = t.slice(2)), !CONCISE_INTEGER_WIDTH_REGEX.test(t)) throw new Error("Malformed concise eng/scientific notation"); - e.minimumIntegerDigits = r.length; + e.minimumIntegerDigits = t.length; } return e; } -function parseNotationOptions(r) { - var e = {}, t = parseSign(r); - return t || e; +function parseNotationOptions(t) { + var e = {}, r = parseSign(t); + return r || e; } -function parseNumberSkeleton(r) { - for (var e = {}, t = 0, n = r; t < n.length; t++) { - var f = n[t]; +function parseNumberSkeleton(t) { + for (var e = {}, r = 0, n = t; r < n.length; r++) { + var f = n[r]; switch (f.stem) { case "percent": case "%": @@ -28256,13 +28256,13 @@ function parseNumberSkeleton(r) { case "integer-width": if (f.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - f.options[0].replace(INTEGER_WIDTH_REGEX, function(_, E, c, C, b, A) { + f.options[0].replace(INTEGER_WIDTH_REGEX, function(_, E, c, S, y, w) { if (E) e.minimumIntegerDigits = c.length; else { - if (C && b) + if (S && y) throw new Error("We currently do not support maximum integer digits"); - if (A) + if (w) throw new Error("We currently do not support exact integer digits"); } return ""; @@ -28276,8 +28276,8 @@ function parseNumberSkeleton(r) { if (FRACTION_PRECISION_REGEX.test(f.stem)) { if (f.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - f.stem.replace(FRACTION_PRECISION_REGEX, function(_, E, c, C, b, A) { - return c === "*" ? e.minimumFractionDigits = E.length : C && C[0] === "#" ? e.maximumFractionDigits = C.length : b && A ? (e.minimumFractionDigits = b.length, e.maximumFractionDigits = b.length + A.length) : (e.minimumFractionDigits = E.length, e.maximumFractionDigits = E.length), ""; + f.stem.replace(FRACTION_PRECISION_REGEX, function(_, E, c, S, y, w) { + return c === "*" ? e.minimumFractionDigits = E.length : S && S[0] === "#" ? e.maximumFractionDigits = S.length : y && w ? (e.minimumFractionDigits = y.length, e.maximumFractionDigits = y.length + w.length) : (e.minimumFractionDigits = E.length, e.maximumFractionDigits = E.length), ""; }); var u = f.options[0]; u === "w" ? e = __assign(__assign({}, e), { trailingZeroDisplay: "stripIfInteger" }) : u && (e = __assign(__assign({}, e), parseSignificantPrecision(u))); @@ -28287,8 +28287,8 @@ function parseNumberSkeleton(r) { e = __assign(__assign({}, e), parseSignificantPrecision(f.stem)); continue; } - var y = parseSign(f.stem); - y && (e = __assign(__assign({}, e), y)); + var b = parseSign(f.stem); + b && (e = __assign(__assign({}, e), b)); var h = parseConciseScientificAndEngineeringStem(f.stem); h && (e = __assign(__assign({}, e), h)); } @@ -29631,27 +29631,27 @@ var timeData = { "h" ] }; -function getBestPattern(r, e) { - for (var t = "", n = 0; n < r.length; n++) { - var f = r.charAt(n); +function getBestPattern(t, e) { + for (var r = "", n = 0; n < t.length; n++) { + var f = t.charAt(n); if (f === "j") { - for (var u = 0; n + 1 < r.length && r.charAt(n + 1) === f; ) + for (var u = 0; n + 1 < t.length && t.charAt(n + 1) === f; ) u++, n++; - var y = 1 + (u & 1), h = u < 2 ? 1 : 3 + (u >> 1), _ = "a", E = getDefaultHourSymbolFromLocale(e); + var b = 1 + (u & 1), h = u < 2 ? 1 : 3 + (u >> 1), _ = "a", E = getDefaultHourSymbolFromLocale(e); for ((E == "H" || E == "k") && (h = 0); h-- > 0; ) - t += _; - for (; y-- > 0; ) - t = E + t; + r += _; + for (; b-- > 0; ) + r = E + r; } else - f === "J" ? t += "H" : t += f; + f === "J" ? r += "H" : r += f; } - return t; + return r; } -function getDefaultHourSymbolFromLocale(r) { - var e = r.hourCycle; +function getDefaultHourSymbolFromLocale(t) { + var e = t.hourCycle; if (e === void 0 && // @ts-ignore hourCycle(s) is not identified yet - r.hourCycles && // @ts-ignore - r.hourCycles.length && (e = r.hourCycles[0]), e) + t.hourCycles && // @ts-ignore + t.hourCycles.length && (e = t.hourCycles[0]), e) switch (e) { case "h24": return "k"; @@ -29664,43 +29664,43 @@ function getDefaultHourSymbolFromLocale(r) { default: throw new Error("Invalid hourCycle"); } - var t = r.language, n; - t !== "root" && (n = r.maximize().region); - var f = timeData[n || ""] || timeData[t || ""] || timeData["".concat(t, "-001")] || timeData["001"]; + var r = t.language, n; + r !== "root" && (n = t.maximize().region); + var f = timeData[n || ""] || timeData[r || ""] || timeData["".concat(r, "-001")] || timeData["001"]; return f[0]; } var _a, SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")), SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); -function createLocation(r, e) { - return { start: r, end: e }; +function createLocation(t, e) { + return { start: t, end: e }; } -var hasNativeStartsWith = !!String.prototype.startsWith, hasNativeFromCodePoint = !!String.fromCodePoint, hasNativeFromEntries = !!Object.fromEntries, hasNativeCodePointAt = !!String.prototype.codePointAt, hasTrimStart = !!String.prototype.trimStart, hasTrimEnd = !!String.prototype.trimEnd, hasNativeIsSafeInteger = !!Number.isSafeInteger, isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(r) { - return typeof r == "number" && isFinite(r) && Math.floor(r) === r && Math.abs(r) <= 9007199254740991; +var hasNativeStartsWith = !!String.prototype.startsWith, hasNativeFromCodePoint = !!String.fromCodePoint, hasNativeFromEntries = !!Object.fromEntries, hasNativeCodePointAt = !!String.prototype.codePointAt, hasTrimStart = !!String.prototype.trimStart, hasTrimEnd = !!String.prototype.trimEnd, hasNativeIsSafeInteger = !!Number.isSafeInteger, isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(t) { + return typeof t == "number" && isFinite(t) && Math.floor(t) === t && Math.abs(t) <= 9007199254740991; }, REGEX_SUPPORTS_U_AND_Y = !0; try { var re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a"; -} catch (r) { +} catch (t) { REGEX_SUPPORTS_U_AND_Y = !1; } var startsWith = hasNativeStartsWith ? ( // Native - function r(e, t, n) { - return e.startsWith(t, n); + function t(e, r, n) { + return e.startsWith(r, n); } ) : ( // For IE11 - function r(e, t, n) { - return e.slice(n, n + t.length) === t; + function t(e, r, n) { + return e.slice(n, n + r.length) === r; } ), fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : ( // IE11 - function r() { - for (var e = [], t = 0; t < arguments.length; t++) - e[t] = arguments[t]; - for (var n = "", f = e.length, u = 0, y; f > u; ) { - if (y = e[u++], y > 1114111) - throw RangeError(y + " is not a valid code point"); - n += y < 65536 ? String.fromCharCode(y) : String.fromCharCode(((y -= 65536) >> 10) + 55296, y % 1024 + 56320); + function t() { + for (var e = [], r = 0; r < arguments.length; r++) + e[r] = arguments[r]; + for (var n = "", f = e.length, u = 0, b; f > u; ) { + if (b = e[u++], b > 1114111) + throw RangeError(b + " is not a valid code point"); + n += b < 65536 ? String.fromCharCode(b) : String.fromCharCode(((b -= 65536) >> 10) + 55296, b % 1024 + 56320); } return n; } @@ -29708,93 +29708,93 @@ var startsWith = hasNativeStartsWith ? ( // native hasNativeFromEntries ? Object.fromEntries : ( // Ponyfill - function r(e) { - for (var t = {}, n = 0, f = e; n < f.length; n++) { - var u = f[n], y = u[0], h = u[1]; - t[y] = h; + function t(e) { + for (var r = {}, n = 0, f = e; n < f.length; n++) { + var u = f[n], b = u[0], h = u[1]; + r[b] = h; } - return t; + return r; } ) ), codePointAt = hasNativeCodePointAt ? ( // Native - function r(e, t) { - return e.codePointAt(t); + function t(e, r) { + return e.codePointAt(r); } ) : ( // IE 11 - function r(e, t) { + function t(e, r) { var n = e.length; - if (!(t < 0 || t >= n)) { - var f = e.charCodeAt(t), u; - return f < 55296 || f > 56319 || t + 1 === n || (u = e.charCodeAt(t + 1)) < 56320 || u > 57343 ? f : (f - 55296 << 10) + (u - 56320) + 65536; + if (!(r < 0 || r >= n)) { + var f = e.charCodeAt(r), u; + return f < 55296 || f > 56319 || r + 1 === n || (u = e.charCodeAt(r + 1)) < 56320 || u > 57343 ? f : (f - 55296 << 10) + (u - 56320) + 65536; } } ), trimStart = hasTrimStart ? ( // Native - function r(e) { + function t(e) { return e.trimStart(); } ) : ( // Ponyfill - function r(e) { + function t(e) { return e.replace(SPACE_SEPARATOR_START_REGEX, ""); } ), trimEnd = hasTrimEnd ? ( // Native - function r(e) { + function t(e) { return e.trimEnd(); } ) : ( // Ponyfill - function r(e) { + function t(e) { return e.replace(SPACE_SEPARATOR_END_REGEX, ""); } ); -function RE(r, e) { - return new RegExp(r, e); +function RE(t, e) { + return new RegExp(t, e); } var matchIdentifierAtIndex; if (REGEX_SUPPORTS_U_AND_Y) { var IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - matchIdentifierAtIndex = function(e, t) { + matchIdentifierAtIndex = function(e, r) { var n; - IDENTIFIER_PREFIX_RE_1.lastIndex = t; + IDENTIFIER_PREFIX_RE_1.lastIndex = r; var f = IDENTIFIER_PREFIX_RE_1.exec(e); return (n = f[1]) !== null && n !== void 0 ? n : ""; }; } else - matchIdentifierAtIndex = function(e, t) { + matchIdentifierAtIndex = function(e, r) { for (var n = []; ; ) { - var f = codePointAt(e, t); + var f = codePointAt(e, r); if (f === void 0 || _isWhiteSpace(f) || _isPatternSyntax(f)) break; - n.push(f), t += f >= 65536 ? 2 : 1; + n.push(f), r += f >= 65536 ? 2 : 1; } return fromCodePoint.apply(void 0, n); }; var Parser = ( /** @class */ function() { - function r(e, t) { - t === void 0 && (t = {}), this.message = e, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!t.ignoreTag, this.locale = t.locale, this.requiresOtherClause = !!t.requiresOtherClause, this.shouldParseSkeletons = !!t.shouldParseSkeletons; + function t(e, r) { + r === void 0 && (r = {}), this.message = e, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!r.ignoreTag, this.locale = r.locale, this.requiresOtherClause = !!r.requiresOtherClause, this.shouldParseSkeletons = !!r.shouldParseSkeletons; } - return r.prototype.parse = function() { + return t.prototype.parse = function() { if (this.offset() !== 0) throw Error("parser can only be used once"); return this.parseMessage(0, "", !1); - }, r.prototype.parseMessage = function(e, t, n) { + }, t.prototype.parseMessage = function(e, r, n) { for (var f = []; !this.isEOF(); ) { var u = this.char(); if (u === 123) { - var y = this.parseArgument(e, n); - if (y.err) - return y; - f.push(y.val); + var b = this.parseArgument(e, n); + if (b.err) + return b; + f.push(b.val); } else { if (u === 125 && e > 0) break; - if (u === 35 && (t === "plural" || t === "selectordinal")) { + if (u === 35 && (r === "plural" || r === "selectordinal")) { var h = this.clonePosition(); this.bump(), f.push({ type: TYPE.pound, @@ -29805,20 +29805,20 @@ var Parser = ( break; return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition())); } else if (u === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { - var y = this.parseTag(e, t); - if (y.err) - return y; - f.push(y.val); + var b = this.parseTag(e, r); + if (b.err) + return b; + f.push(b.val); } else { - var y = this.parseLiteral(e, t); - if (y.err) - return y; - f.push(y.val); + var b = this.parseLiteral(e, r); + if (b.err) + return b; + f.push(b.val); } } } return { val: f, err: null }; - }, r.prototype.parseTag = function(e, t) { + }, t.prototype.parseTag = function(e, r) { var n = this.clonePosition(); this.bump(); var f = this.parseTagName(); @@ -29832,10 +29832,10 @@ var Parser = ( err: null }; if (this.bumpIf(">")) { - var u = this.parseMessage(e + 1, t, !0); + var u = this.parseMessage(e + 1, r, !0); if (u.err) return u; - var y = u.val, h = this.clonePosition(); + var b = u.val, h = this.clonePosition(); if (this.bumpIf(" 0 ? null : (this.bump(), fromCodePoint(n)); - }, r.prototype.parseArgument = function(e, t) { + return n === 60 || n === 123 || n === 35 && (r === "plural" || r === "selectordinal") || n === 125 && e > 0 ? null : (this.bump(), fromCodePoint(n)); + }, t.prototype.parseArgument = function(e, r) { var n = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())); @@ -29947,20 +29947,20 @@ var Parser = ( err: null }; case 44: - return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())) : this.parseArgumentOptions(e, t, f, n); + return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())) : this.parseArgumentOptions(e, r, f, n); default: return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(n, this.clonePosition())); } - }, r.prototype.parseIdentifierIfPossible = function() { - var e = this.clonePosition(), t = this.offset(), n = matchIdentifierAtIndex(this.message, t), f = t + n.length; + }, t.prototype.parseIdentifierIfPossible = function() { + var e = this.clonePosition(), r = this.offset(), n = matchIdentifierAtIndex(this.message, r), f = r + n.length; this.bumpTo(f); - var u = this.clonePosition(), y = createLocation(e, u); - return { value: n, location: y }; - }, r.prototype.parseArgumentOptions = function(e, t, n, f) { - var u, y = this.clonePosition(), h = this.parseIdentifierIfPossible().value, _ = this.clonePosition(); + var u = this.clonePosition(), b = createLocation(e, u); + return { value: n, location: b }; + }, t.prototype.parseArgumentOptions = function(e, r, n, f) { + var u, b = this.clonePosition(), h = this.parseIdentifierIfPossible().value, _ = this.clonePosition(); switch (h) { case "": - return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(y, _)); + return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(b, _)); case "number": case "date": case "time": { @@ -29968,40 +29968,40 @@ var Parser = ( var E = null; if (this.bumpIf(",")) { this.bumpSpace(); - var c = this.clonePosition(), C = this.parseSimpleArgStyleIfPossible(); - if (C.err) - return C; - var b = trimEnd(C.val); - if (b.length === 0) + var c = this.clonePosition(), S = this.parseSimpleArgStyleIfPossible(); + if (S.err) + return S; + var y = trimEnd(S.val); + if (y.length === 0) return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition())); - var A = createLocation(c, this.clonePosition()); - E = { style: b, styleLocation: A }; + var w = createLocation(c, this.clonePosition()); + E = { style: y, styleLocation: w }; } - var S = this.tryParseArgumentClose(f); - if (S.err) - return S; + var L = this.tryParseArgumentClose(f); + if (L.err) + return L; var s = createLocation(f, this.clonePosition()); if (E && startsWith(E == null ? void 0 : E.style, "::", 0)) { var o = trimStart(E.style.slice(2)); if (h === "number") { - var C = this.parseNumberSkeletonFromString(o, E.styleLocation); - return C.err ? C : { - val: { type: TYPE.number, value: n, location: s, style: C.val }, + var S = this.parseNumberSkeletonFromString(o, E.styleLocation); + return S.err ? S : { + val: { type: TYPE.number, value: n, location: s, style: S.val }, err: null }; } else { if (o.length === 0) return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, s); - var w = o; - this.locale && (w = getBestPattern(o, this.locale)); - var b = { + var A = o; + this.locale && (A = getBestPattern(o, this.locale)); + var y = { type: SKELETON_TYPE.dateTime, - pattern: w, + pattern: A, location: E.styleLocation, - parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(w) : {} + parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(A) : {} }, p = h === "date" ? TYPE.date : TYPE.time; return { - val: { type: p, value: n, location: s, style: b }, + val: { type: p, value: n, location: s, style: y }, err: null }; } @@ -30028,17 +30028,17 @@ var Parser = ( if (!this.bumpIf(":")) return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition())); this.bumpSpace(); - var C = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); - if (C.err) - return C; - this.bumpSpace(), a = this.parseIdentifierIfPossible(), l = C.val; + var S = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); + if (S.err) + return S; + this.bumpSpace(), a = this.parseIdentifierIfPossible(), l = S.val; } - var g = this.tryParsePluralOrSelectOptions(e, h, t, a); + var g = this.tryParsePluralOrSelectOptions(e, h, r, a); if (g.err) return g; - var S = this.tryParseArgumentClose(f); - if (S.err) - return S; + var L = this.tryParseArgumentClose(f); + if (L.err) + return L; var M = createLocation(f, this.clonePosition()); return h === "select" ? { val: { @@ -30061,12 +30061,12 @@ var Parser = ( }; } default: - return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(y, _)); + return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(b, _)); } - }, r.prototype.tryParseArgumentClose = function(e) { + }, t.prototype.tryParseArgumentClose = function(e) { return this.isEOF() || this.char() !== 125 ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(e, this.clonePosition())) : (this.bump(), { val: !0, err: null }); - }, r.prototype.parseSimpleArgStyleIfPossible = function() { - for (var e = 0, t = this.clonePosition(); !this.isEOF(); ) { + }, t.prototype.parseSimpleArgStyleIfPossible = function() { + for (var e = 0, r = this.clonePosition(); !this.isEOF(); ) { var n = this.char(); switch (n) { case 39: { @@ -30086,7 +30086,7 @@ var Parser = ( e -= 1; else return { - val: this.message.slice(t.offset, this.offset()), + val: this.message.slice(r.offset, this.offset()), err: null }; break; @@ -30097,198 +30097,198 @@ var Parser = ( } } return { - val: this.message.slice(t.offset, this.offset()), + val: this.message.slice(r.offset, this.offset()), err: null }; - }, r.prototype.parseNumberSkeletonFromString = function(e, t) { + }, t.prototype.parseNumberSkeletonFromString = function(e, r) { var n = []; try { n = parseNumberSkeletonFromString(e); } catch { - return this.error(ErrorKind.INVALID_NUMBER_SKELETON, t); + return this.error(ErrorKind.INVALID_NUMBER_SKELETON, r); } return { val: { type: SKELETON_TYPE.number, tokens: n, - location: t, + location: r, parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(n) : {} }, err: null }; - }, r.prototype.tryParsePluralOrSelectOptions = function(e, t, n, f) { - for (var u, y = !1, h = [], _ = /* @__PURE__ */ new Set(), E = f.value, c = f.location; ; ) { + }, t.prototype.tryParsePluralOrSelectOptions = function(e, r, n, f) { + for (var u, b = !1, h = [], _ = /* @__PURE__ */ new Set(), E = f.value, c = f.location; ; ) { if (E.length === 0) { - var C = this.clonePosition(); - if (t !== "select" && this.bumpIf("=")) { - var b = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR); - if (b.err) - return b; - c = createLocation(C, this.clonePosition()), E = this.message.slice(C.offset, this.offset()); + var S = this.clonePosition(); + if (r !== "select" && this.bumpIf("=")) { + var y = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR); + if (y.err) + return y; + c = createLocation(S, this.clonePosition()), E = this.message.slice(S.offset, this.offset()); } else break; } if (_.has(E)) - return this.error(t === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, c); - E === "other" && (y = !0), this.bumpSpace(); - var A = this.clonePosition(); + return this.error(r === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, c); + E === "other" && (b = !0), this.bumpSpace(); + var w = this.clonePosition(); if (!this.bumpIf("{")) - return this.error(t === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); - var S = this.parseMessage(e + 1, t, n); - if (S.err) - return S; - var s = this.tryParseArgumentClose(A); + return this.error(r === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); + var L = this.parseMessage(e + 1, r, n); + if (L.err) + return L; + var s = this.tryParseArgumentClose(w); if (s.err) return s; h.push([ E, { - value: S.val, - location: createLocation(A, this.clonePosition()) + value: L.val, + location: createLocation(w, this.clonePosition()) } ]), _.add(E), this.bumpSpace(), u = this.parseIdentifierIfPossible(), E = u.value, c = u.location; } - return h.length === 0 ? this.error(t === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !y ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: h, err: null }; - }, r.prototype.tryParseDecimalInteger = function(e, t) { + return h.length === 0 ? this.error(r === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !b ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: h, err: null }; + }, t.prototype.tryParseDecimalInteger = function(e, r) { var n = 1, f = this.clonePosition(); this.bumpIf("+") || this.bumpIf("-") && (n = -1); - for (var u = !1, y = 0; !this.isEOF(); ) { + for (var u = !1, b = 0; !this.isEOF(); ) { var h = this.char(); if (h >= 48 && h <= 57) - u = !0, y = y * 10 + (h - 48), this.bump(); + u = !0, b = b * 10 + (h - 48), this.bump(); else break; } var _ = createLocation(f, this.clonePosition()); - return u ? (y *= n, isSafeInteger(y) ? { val: y, err: null } : this.error(t, _)) : this.error(e, _); - }, r.prototype.offset = function() { + return u ? (b *= n, isSafeInteger(b) ? { val: b, err: null } : this.error(r, _)) : this.error(e, _); + }, t.prototype.offset = function() { return this.position.offset; - }, r.prototype.isEOF = function() { + }, t.prototype.isEOF = function() { return this.offset() === this.message.length; - }, r.prototype.clonePosition = function() { + }, t.prototype.clonePosition = function() { return { offset: this.position.offset, line: this.position.line, column: this.position.column }; - }, r.prototype.char = function() { + }, t.prototype.char = function() { var e = this.position.offset; if (e >= this.message.length) throw Error("out of bound"); - var t = codePointAt(this.message, e); - if (t === void 0) + var r = codePointAt(this.message, e); + if (r === void 0) throw Error("Offset ".concat(e, " is at invalid UTF-16 code unit boundary")); - return t; - }, r.prototype.error = function(e, t) { + return r; + }, t.prototype.error = function(e, r) { return { val: null, err: { kind: e, message: this.message, - location: t + location: r } }; - }, r.prototype.bump = function() { + }, t.prototype.bump = function() { if (!this.isEOF()) { var e = this.char(); e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2); } - }, r.prototype.bumpIf = function(e) { + }, t.prototype.bumpIf = function(e) { if (startsWith(this.message, e, this.offset())) { - for (var t = 0; t < e.length; t++) + for (var r = 0; r < e.length; r++) this.bump(); return !0; } return !1; - }, r.prototype.bumpUntil = function(e) { - var t = this.offset(), n = this.message.indexOf(e, t); + }, t.prototype.bumpUntil = function(e) { + var r = this.offset(), n = this.message.indexOf(e, r); return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1); - }, r.prototype.bumpTo = function(e) { + }, t.prototype.bumpTo = function(e) { if (this.offset() > e) throw Error("targetOffset ".concat(e, " must be greater than or equal to the current offset ").concat(this.offset())); for (e = Math.min(e, this.message.length); ; ) { - var t = this.offset(); - if (t === e) + var r = this.offset(); + if (r === e) break; - if (t > e) + if (r > e) throw Error("targetOffset ".concat(e, " is at invalid UTF-16 code unit boundary")); if (this.bump(), this.isEOF()) break; } - }, r.prototype.bumpSpace = function() { + }, t.prototype.bumpSpace = function() { for (; !this.isEOF() && _isWhiteSpace(this.char()); ) this.bump(); - }, r.prototype.peek = function() { + }, t.prototype.peek = function() { if (this.isEOF()) return null; - var e = this.char(), t = this.offset(), n = this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)); + var e = this.char(), r = this.offset(), n = this.message.charCodeAt(r + (e >= 65536 ? 2 : 1)); return n ?? null; - }, r; + }, t; }() ); -function _isAlpha(r) { - return r >= 97 && r <= 122 || r >= 65 && r <= 90; +function _isAlpha(t) { + return t >= 97 && t <= 122 || t >= 65 && t <= 90; } -function _isAlphaOrSlash(r) { - return _isAlpha(r) || r === 47; +function _isAlphaOrSlash(t) { + return _isAlpha(t) || t === 47; } -function _isPotentialElementNameChar(r) { - return r === 45 || r === 46 || r >= 48 && r <= 57 || r === 95 || r >= 97 && r <= 122 || r >= 65 && r <= 90 || r == 183 || r >= 192 && r <= 214 || r >= 216 && r <= 246 || r >= 248 && r <= 893 || r >= 895 && r <= 8191 || r >= 8204 && r <= 8205 || r >= 8255 && r <= 8256 || r >= 8304 && r <= 8591 || r >= 11264 && r <= 12271 || r >= 12289 && r <= 55295 || r >= 63744 && r <= 64975 || r >= 65008 && r <= 65533 || r >= 65536 && r <= 983039; +function _isPotentialElementNameChar(t) { + return t === 45 || t === 46 || t >= 48 && t <= 57 || t === 95 || t >= 97 && t <= 122 || t >= 65 && t <= 90 || t == 183 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8255 && t <= 8256 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039; } -function _isWhiteSpace(r) { - return r >= 9 && r <= 13 || r === 32 || r === 133 || r >= 8206 && r <= 8207 || r === 8232 || r === 8233; +function _isWhiteSpace(t) { + return t >= 9 && t <= 13 || t === 32 || t === 133 || t >= 8206 && t <= 8207 || t === 8232 || t === 8233; } -function _isPatternSyntax(r) { - return r >= 33 && r <= 35 || r === 36 || r >= 37 && r <= 39 || r === 40 || r === 41 || r === 42 || r === 43 || r === 44 || r === 45 || r >= 46 && r <= 47 || r >= 58 && r <= 59 || r >= 60 && r <= 62 || r >= 63 && r <= 64 || r === 91 || r === 92 || r === 93 || r === 94 || r === 96 || r === 123 || r === 124 || r === 125 || r === 126 || r === 161 || r >= 162 && r <= 165 || r === 166 || r === 167 || r === 169 || r === 171 || r === 172 || r === 174 || r === 176 || r === 177 || r === 182 || r === 187 || r === 191 || r === 215 || r === 247 || r >= 8208 && r <= 8213 || r >= 8214 && r <= 8215 || r === 8216 || r === 8217 || r === 8218 || r >= 8219 && r <= 8220 || r === 8221 || r === 8222 || r === 8223 || r >= 8224 && r <= 8231 || r >= 8240 && r <= 8248 || r === 8249 || r === 8250 || r >= 8251 && r <= 8254 || r >= 8257 && r <= 8259 || r === 8260 || r === 8261 || r === 8262 || r >= 8263 && r <= 8273 || r === 8274 || r === 8275 || r >= 8277 && r <= 8286 || r >= 8592 && r <= 8596 || r >= 8597 && r <= 8601 || r >= 8602 && r <= 8603 || r >= 8604 && r <= 8607 || r === 8608 || r >= 8609 && r <= 8610 || r === 8611 || r >= 8612 && r <= 8613 || r === 8614 || r >= 8615 && r <= 8621 || r === 8622 || r >= 8623 && r <= 8653 || r >= 8654 && r <= 8655 || r >= 8656 && r <= 8657 || r === 8658 || r === 8659 || r === 8660 || r >= 8661 && r <= 8691 || r >= 8692 && r <= 8959 || r >= 8960 && r <= 8967 || r === 8968 || r === 8969 || r === 8970 || r === 8971 || r >= 8972 && r <= 8991 || r >= 8992 && r <= 8993 || r >= 8994 && r <= 9e3 || r === 9001 || r === 9002 || r >= 9003 && r <= 9083 || r === 9084 || r >= 9085 && r <= 9114 || r >= 9115 && r <= 9139 || r >= 9140 && r <= 9179 || r >= 9180 && r <= 9185 || r >= 9186 && r <= 9254 || r >= 9255 && r <= 9279 || r >= 9280 && r <= 9290 || r >= 9291 && r <= 9311 || r >= 9472 && r <= 9654 || r === 9655 || r >= 9656 && r <= 9664 || r === 9665 || r >= 9666 && r <= 9719 || r >= 9720 && r <= 9727 || r >= 9728 && r <= 9838 || r === 9839 || r >= 9840 && r <= 10087 || r === 10088 || r === 10089 || r === 10090 || r === 10091 || r === 10092 || r === 10093 || r === 10094 || r === 10095 || r === 10096 || r === 10097 || r === 10098 || r === 10099 || r === 10100 || r === 10101 || r >= 10132 && r <= 10175 || r >= 10176 && r <= 10180 || r === 10181 || r === 10182 || r >= 10183 && r <= 10213 || r === 10214 || r === 10215 || r === 10216 || r === 10217 || r === 10218 || r === 10219 || r === 10220 || r === 10221 || r === 10222 || r === 10223 || r >= 10224 && r <= 10239 || r >= 10240 && r <= 10495 || r >= 10496 && r <= 10626 || r === 10627 || r === 10628 || r === 10629 || r === 10630 || r === 10631 || r === 10632 || r === 10633 || r === 10634 || r === 10635 || r === 10636 || r === 10637 || r === 10638 || r === 10639 || r === 10640 || r === 10641 || r === 10642 || r === 10643 || r === 10644 || r === 10645 || r === 10646 || r === 10647 || r === 10648 || r >= 10649 && r <= 10711 || r === 10712 || r === 10713 || r === 10714 || r === 10715 || r >= 10716 && r <= 10747 || r === 10748 || r === 10749 || r >= 10750 && r <= 11007 || r >= 11008 && r <= 11055 || r >= 11056 && r <= 11076 || r >= 11077 && r <= 11078 || r >= 11079 && r <= 11084 || r >= 11085 && r <= 11123 || r >= 11124 && r <= 11125 || r >= 11126 && r <= 11157 || r === 11158 || r >= 11159 && r <= 11263 || r >= 11776 && r <= 11777 || r === 11778 || r === 11779 || r === 11780 || r === 11781 || r >= 11782 && r <= 11784 || r === 11785 || r === 11786 || r === 11787 || r === 11788 || r === 11789 || r >= 11790 && r <= 11798 || r === 11799 || r >= 11800 && r <= 11801 || r === 11802 || r === 11803 || r === 11804 || r === 11805 || r >= 11806 && r <= 11807 || r === 11808 || r === 11809 || r === 11810 || r === 11811 || r === 11812 || r === 11813 || r === 11814 || r === 11815 || r === 11816 || r === 11817 || r >= 11818 && r <= 11822 || r === 11823 || r >= 11824 && r <= 11833 || r >= 11834 && r <= 11835 || r >= 11836 && r <= 11839 || r === 11840 || r === 11841 || r === 11842 || r >= 11843 && r <= 11855 || r >= 11856 && r <= 11857 || r === 11858 || r >= 11859 && r <= 11903 || r >= 12289 && r <= 12291 || r === 12296 || r === 12297 || r === 12298 || r === 12299 || r === 12300 || r === 12301 || r === 12302 || r === 12303 || r === 12304 || r === 12305 || r >= 12306 && r <= 12307 || r === 12308 || r === 12309 || r === 12310 || r === 12311 || r === 12312 || r === 12313 || r === 12314 || r === 12315 || r === 12316 || r === 12317 || r >= 12318 && r <= 12319 || r === 12320 || r === 12336 || r === 64830 || r === 64831 || r >= 65093 && r <= 65094; +function _isPatternSyntax(t) { + return t >= 33 && t <= 35 || t === 36 || t >= 37 && t <= 39 || t === 40 || t === 41 || t === 42 || t === 43 || t === 44 || t === 45 || t >= 46 && t <= 47 || t >= 58 && t <= 59 || t >= 60 && t <= 62 || t >= 63 && t <= 64 || t === 91 || t === 92 || t === 93 || t === 94 || t === 96 || t === 123 || t === 124 || t === 125 || t === 126 || t === 161 || t >= 162 && t <= 165 || t === 166 || t === 167 || t === 169 || t === 171 || t === 172 || t === 174 || t === 176 || t === 177 || t === 182 || t === 187 || t === 191 || t === 215 || t === 247 || t >= 8208 && t <= 8213 || t >= 8214 && t <= 8215 || t === 8216 || t === 8217 || t === 8218 || t >= 8219 && t <= 8220 || t === 8221 || t === 8222 || t === 8223 || t >= 8224 && t <= 8231 || t >= 8240 && t <= 8248 || t === 8249 || t === 8250 || t >= 8251 && t <= 8254 || t >= 8257 && t <= 8259 || t === 8260 || t === 8261 || t === 8262 || t >= 8263 && t <= 8273 || t === 8274 || t === 8275 || t >= 8277 && t <= 8286 || t >= 8592 && t <= 8596 || t >= 8597 && t <= 8601 || t >= 8602 && t <= 8603 || t >= 8604 && t <= 8607 || t === 8608 || t >= 8609 && t <= 8610 || t === 8611 || t >= 8612 && t <= 8613 || t === 8614 || t >= 8615 && t <= 8621 || t === 8622 || t >= 8623 && t <= 8653 || t >= 8654 && t <= 8655 || t >= 8656 && t <= 8657 || t === 8658 || t === 8659 || t === 8660 || t >= 8661 && t <= 8691 || t >= 8692 && t <= 8959 || t >= 8960 && t <= 8967 || t === 8968 || t === 8969 || t === 8970 || t === 8971 || t >= 8972 && t <= 8991 || t >= 8992 && t <= 8993 || t >= 8994 && t <= 9e3 || t === 9001 || t === 9002 || t >= 9003 && t <= 9083 || t === 9084 || t >= 9085 && t <= 9114 || t >= 9115 && t <= 9139 || t >= 9140 && t <= 9179 || t >= 9180 && t <= 9185 || t >= 9186 && t <= 9254 || t >= 9255 && t <= 9279 || t >= 9280 && t <= 9290 || t >= 9291 && t <= 9311 || t >= 9472 && t <= 9654 || t === 9655 || t >= 9656 && t <= 9664 || t === 9665 || t >= 9666 && t <= 9719 || t >= 9720 && t <= 9727 || t >= 9728 && t <= 9838 || t === 9839 || t >= 9840 && t <= 10087 || t === 10088 || t === 10089 || t === 10090 || t === 10091 || t === 10092 || t === 10093 || t === 10094 || t === 10095 || t === 10096 || t === 10097 || t === 10098 || t === 10099 || t === 10100 || t === 10101 || t >= 10132 && t <= 10175 || t >= 10176 && t <= 10180 || t === 10181 || t === 10182 || t >= 10183 && t <= 10213 || t === 10214 || t === 10215 || t === 10216 || t === 10217 || t === 10218 || t === 10219 || t === 10220 || t === 10221 || t === 10222 || t === 10223 || t >= 10224 && t <= 10239 || t >= 10240 && t <= 10495 || t >= 10496 && t <= 10626 || t === 10627 || t === 10628 || t === 10629 || t === 10630 || t === 10631 || t === 10632 || t === 10633 || t === 10634 || t === 10635 || t === 10636 || t === 10637 || t === 10638 || t === 10639 || t === 10640 || t === 10641 || t === 10642 || t === 10643 || t === 10644 || t === 10645 || t === 10646 || t === 10647 || t === 10648 || t >= 10649 && t <= 10711 || t === 10712 || t === 10713 || t === 10714 || t === 10715 || t >= 10716 && t <= 10747 || t === 10748 || t === 10749 || t >= 10750 && t <= 11007 || t >= 11008 && t <= 11055 || t >= 11056 && t <= 11076 || t >= 11077 && t <= 11078 || t >= 11079 && t <= 11084 || t >= 11085 && t <= 11123 || t >= 11124 && t <= 11125 || t >= 11126 && t <= 11157 || t === 11158 || t >= 11159 && t <= 11263 || t >= 11776 && t <= 11777 || t === 11778 || t === 11779 || t === 11780 || t === 11781 || t >= 11782 && t <= 11784 || t === 11785 || t === 11786 || t === 11787 || t === 11788 || t === 11789 || t >= 11790 && t <= 11798 || t === 11799 || t >= 11800 && t <= 11801 || t === 11802 || t === 11803 || t === 11804 || t === 11805 || t >= 11806 && t <= 11807 || t === 11808 || t === 11809 || t === 11810 || t === 11811 || t === 11812 || t === 11813 || t === 11814 || t === 11815 || t === 11816 || t === 11817 || t >= 11818 && t <= 11822 || t === 11823 || t >= 11824 && t <= 11833 || t >= 11834 && t <= 11835 || t >= 11836 && t <= 11839 || t === 11840 || t === 11841 || t === 11842 || t >= 11843 && t <= 11855 || t >= 11856 && t <= 11857 || t === 11858 || t >= 11859 && t <= 11903 || t >= 12289 && t <= 12291 || t === 12296 || t === 12297 || t === 12298 || t === 12299 || t === 12300 || t === 12301 || t === 12302 || t === 12303 || t === 12304 || t === 12305 || t >= 12306 && t <= 12307 || t === 12308 || t === 12309 || t === 12310 || t === 12311 || t === 12312 || t === 12313 || t === 12314 || t === 12315 || t === 12316 || t === 12317 || t >= 12318 && t <= 12319 || t === 12320 || t === 12336 || t === 64830 || t === 64831 || t >= 65093 && t <= 65094; } -function pruneLocation(r) { - r.forEach(function(e) { +function pruneLocation(t) { + t.forEach(function(e) { if (delete e.location, isSelectElement(e) || isPluralElement(e)) - for (var t in e.options) - delete e.options[t].location, pruneLocation(e.options[t].value); + for (var r in e.options) + delete e.options[r].location, pruneLocation(e.options[r].value); else isNumberElement(e) && isNumberSkeleton(e.style) || (isDateElement(e) || isTimeElement(e)) && isDateTimeSkeleton(e.style) ? delete e.style.location : isTagElement(e) && pruneLocation(e.children); }); } -function parse(r, e) { +function parse(t, e) { e === void 0 && (e = {}), e = __assign({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); - var t = new Parser(r, e).parse(); - if (t.err) { - var n = SyntaxError(ErrorKind[t.err.kind]); - throw n.location = t.err.location, n.originalMessage = t.err.message, n; + var r = new Parser(t, e).parse(); + if (r.err) { + var n = SyntaxError(ErrorKind[r.err.kind]); + throw n.location = r.err.location, n.originalMessage = r.err.message, n; } - return e != null && e.captureLocation || pruneLocation(t.val), t.val; + return e != null && e.captureLocation || pruneLocation(r.val), r.val; } -function memoize(r, e) { - var t = e && e.cache ? e.cache : cacheDefault, n = e && e.serializer ? e.serializer : serializerDefault, f = e && e.strategy ? e.strategy : strategyDefault; - return f(r, { - cache: t, +function memoize(t, e) { + var r = e && e.cache ? e.cache : cacheDefault, n = e && e.serializer ? e.serializer : serializerDefault, f = e && e.strategy ? e.strategy : strategyDefault; + return f(t, { + cache: r, serializer: n }); } -function isPrimitive(r) { - return r == null || typeof r == "number" || typeof r == "boolean"; +function isPrimitive(t) { + return t == null || typeof t == "number" || typeof t == "boolean"; } -function monadic(r, e, t, n) { - var f = isPrimitive(n) ? n : t(n), u = e.get(f); - return typeof u > "u" && (u = r.call(this, n), e.set(f, u)), u; +function monadic(t, e, r, n) { + var f = isPrimitive(n) ? n : r(n), u = e.get(f); + return typeof u > "u" && (u = t.call(this, n), e.set(f, u)), u; } -function variadic(r, e, t) { - var n = Array.prototype.slice.call(arguments, 3), f = t(n), u = e.get(f); - return typeof u > "u" && (u = r.apply(this, n), e.set(f, u)), u; +function variadic(t, e, r) { + var n = Array.prototype.slice.call(arguments, 3), f = r(n), u = e.get(f); + return typeof u > "u" && (u = t.apply(this, n), e.set(f, u)), u; } -function assemble(r, e, t, n, f) { - return t.bind(e, r, n, f); +function assemble(t, e, r, n, f) { + return r.bind(e, t, n, f); } -function strategyDefault(r, e) { - var t = r.length === 1 ? monadic : variadic; - return assemble(r, this, t, e.cache.create(), e.serializer); +function strategyDefault(t, e) { + var r = t.length === 1 ? monadic : variadic; + return assemble(t, this, r, e.cache.create(), e.serializer); } -function strategyVariadic(r, e) { - return assemble(r, this, variadic, e.cache.create(), e.serializer); +function strategyVariadic(t, e) { + return assemble(t, this, variadic, e.cache.create(), e.serializer); } -function strategyMonadic(r, e) { - return assemble(r, this, monadic, e.cache.create(), e.serializer); +function strategyMonadic(t, e) { + return assemble(t, this, monadic, e.cache.create(), e.serializer); } var serializerDefault = function() { return JSON.stringify(arguments); @@ -30296,29 +30296,29 @@ var serializerDefault = function() { function ObjectWithoutPrototypeCache() { this.cache = /* @__PURE__ */ Object.create(null); } -ObjectWithoutPrototypeCache.prototype.get = function(r) { - return this.cache[r]; +ObjectWithoutPrototypeCache.prototype.get = function(t) { + return this.cache[t]; }; -ObjectWithoutPrototypeCache.prototype.set = function(r, e) { - this.cache[r] = e; +ObjectWithoutPrototypeCache.prototype.set = function(t, e) { + this.cache[t] = e; }; var cacheDefault = { - create: function r() { + create: function t() { return new ObjectWithoutPrototypeCache(); } }, strategies = { variadic: strategyVariadic, monadic: strategyMonadic }, ErrorCode; -(function(r) { - r.MISSING_VALUE = "MISSING_VALUE", r.INVALID_VALUE = "INVALID_VALUE", r.MISSING_INTL_API = "MISSING_INTL_API"; +(function(t) { + t.MISSING_VALUE = "MISSING_VALUE", t.INVALID_VALUE = "INVALID_VALUE", t.MISSING_INTL_API = "MISSING_INTL_API"; })(ErrorCode || (ErrorCode = {})); var FormatError = ( /** @class */ - function(r) { - __extends(e, r); - function e(t, n, f) { - var u = r.call(this, t) || this; + function(t) { + __extends(e, t); + function e(r, n, f) { + var u = t.call(this, r) || this; return u.code = n, u.originalMessage = f, u; } return e.prototype.toString = function() { @@ -30327,53 +30327,53 @@ var FormatError = ( }(Error) ), InvalidValueError = ( /** @class */ - function(r) { - __extends(e, r); - function e(t, n, f, u) { - return r.call(this, 'Invalid values for "'.concat(t, '": "').concat(n, '". Options are "').concat(Object.keys(f).join('", "'), '"'), ErrorCode.INVALID_VALUE, u) || this; + function(t) { + __extends(e, t); + function e(r, n, f, u) { + return t.call(this, 'Invalid values for "'.concat(r, '": "').concat(n, '". Options are "').concat(Object.keys(f).join('", "'), '"'), ErrorCode.INVALID_VALUE, u) || this; } return e; }(FormatError) ), InvalidValueTypeError = ( /** @class */ - function(r) { - __extends(e, r); - function e(t, n, f) { - return r.call(this, 'Value for "'.concat(t, '" must be of type ').concat(n), ErrorCode.INVALID_VALUE, f) || this; + function(t) { + __extends(e, t); + function e(r, n, f) { + return t.call(this, 'Value for "'.concat(r, '" must be of type ').concat(n), ErrorCode.INVALID_VALUE, f) || this; } return e; }(FormatError) ), MissingValueError = ( /** @class */ - function(r) { - __extends(e, r); - function e(t, n) { - return r.call(this, 'The intl string context variable "'.concat(t, '" was not provided to the string "').concat(n, '"'), ErrorCode.MISSING_VALUE, n) || this; + function(t) { + __extends(e, t); + function e(r, n) { + return t.call(this, 'The intl string context variable "'.concat(r, '" was not provided to the string "').concat(n, '"'), ErrorCode.MISSING_VALUE, n) || this; } return e; }(FormatError) ), PART_TYPE; -(function(r) { - r[r.literal = 0] = "literal", r[r.object = 1] = "object"; +(function(t) { + t[t.literal = 0] = "literal", t[t.object = 1] = "object"; })(PART_TYPE || (PART_TYPE = {})); -function mergeLiteral(r) { - return r.length < 2 ? r : r.reduce(function(e, t) { +function mergeLiteral(t) { + return t.length < 2 ? t : t.reduce(function(e, r) { var n = e[e.length - 1]; - return !n || n.type !== PART_TYPE.literal || t.type !== PART_TYPE.literal ? e.push(t) : n.value += t.value, e; + return !n || n.type !== PART_TYPE.literal || r.type !== PART_TYPE.literal ? e.push(r) : n.value += r.value, e; }, []); } -function isFormatXMLElementFn(r) { - return typeof r == "function"; +function isFormatXMLElementFn(t) { + return typeof t == "function"; } -function formatToParts(r, e, t, n, f, u, y) { - if (r.length === 1 && isLiteralElement(r[0])) +function formatToParts(t, e, r, n, f, u, b) { + if (t.length === 1 && isLiteralElement(t[0])) return [ { type: PART_TYPE.literal, - value: r[0].value + value: t[0].value } ]; - for (var h = [], _ = 0, E = r; _ < E.length; _++) { + for (var h = [], _ = 0, E = t; _ < E.length; _++) { var c = E[_]; if (isLiteralElement(c)) { h.push({ @@ -30385,50 +30385,50 @@ function formatToParts(r, e, t, n, f, u, y) { if (isPoundElement(c)) { typeof u == "number" && h.push({ type: PART_TYPE.literal, - value: t.getNumberFormat(e).format(u) + value: r.getNumberFormat(e).format(u) }); continue; } - var C = c.value; - if (!(f && C in f)) - throw new MissingValueError(C, y); - var b = f[C]; + var S = c.value; + if (!(f && S in f)) + throw new MissingValueError(S, b); + var y = f[S]; if (isArgumentElement(c)) { - (!b || typeof b == "string" || typeof b == "number") && (b = typeof b == "string" || typeof b == "number" ? String(b) : ""), h.push({ - type: typeof b == "string" ? PART_TYPE.literal : PART_TYPE.object, - value: b + (!y || typeof y == "string" || typeof y == "number") && (y = typeof y == "string" || typeof y == "number" ? String(y) : ""), h.push({ + type: typeof y == "string" ? PART_TYPE.literal : PART_TYPE.object, + value: y }); continue; } if (isDateElement(c)) { - var A = typeof c.style == "string" ? n.date[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : void 0; + var w = typeof c.style == "string" ? n.date[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : void 0; h.push({ type: PART_TYPE.literal, - value: t.getDateTimeFormat(e, A).format(b) + value: r.getDateTimeFormat(e, w).format(y) }); continue; } if (isTimeElement(c)) { - var A = typeof c.style == "string" ? n.time[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : n.time.medium; + var w = typeof c.style == "string" ? n.time[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : n.time.medium; h.push({ type: PART_TYPE.literal, - value: t.getDateTimeFormat(e, A).format(b) + value: r.getDateTimeFormat(e, w).format(y) }); continue; } if (isNumberElement(c)) { - var A = typeof c.style == "string" ? n.number[c.style] : isNumberSkeleton(c.style) ? c.style.parsedOptions : void 0; - A && A.scale && (b = b * (A.scale || 1)), h.push({ + var w = typeof c.style == "string" ? n.number[c.style] : isNumberSkeleton(c.style) ? c.style.parsedOptions : void 0; + w && w.scale && (y = y * (w.scale || 1)), h.push({ type: PART_TYPE.literal, - value: t.getNumberFormat(e, A).format(b) + value: r.getNumberFormat(e, w).format(y) }); continue; } if (isTagElement(c)) { - var S = c.children, s = c.value, o = f[s]; + var L = c.children, s = c.value, o = f[s]; if (!isFormatXMLElementFn(o)) - throw new InvalidValueTypeError(s, "function", y); - var w = formatToParts(S, e, t, n, f, u), p = o(w.map(function(l) { + throw new InvalidValueTypeError(s, "function", b); + var A = formatToParts(L, e, r, n, f, u), p = o(A.map(function(l) { return l.value; })); Array.isArray(p) || (p = [p]), h.push.apply(h, p.map(function(l) { @@ -30439,82 +30439,82 @@ function formatToParts(r, e, t, n, f, u, y) { })); } if (isSelectElement(c)) { - var v = c.options[b] || c.options.other; + var v = c.options[y] || c.options.other; if (!v) - throw new InvalidValueError(c.value, b, Object.keys(c.options), y); - h.push.apply(h, formatToParts(v.value, e, t, n, f)); + throw new InvalidValueError(c.value, y, Object.keys(c.options), b); + h.push.apply(h, formatToParts(v.value, e, r, n, f)); continue; } if (isPluralElement(c)) { - var v = c.options["=".concat(b)]; + var v = c.options["=".concat(y)]; if (!v) { if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" -`, ErrorCode.MISSING_INTL_API, y); - var a = t.getPluralRules(e, { type: c.pluralType }).select(b - (c.offset || 0)); +`, ErrorCode.MISSING_INTL_API, b); + var a = r.getPluralRules(e, { type: c.pluralType }).select(y - (c.offset || 0)); v = c.options[a] || c.options.other; } if (!v) - throw new InvalidValueError(c.value, b, Object.keys(c.options), y); - h.push.apply(h, formatToParts(v.value, e, t, n, f, b - (c.offset || 0))); + throw new InvalidValueError(c.value, y, Object.keys(c.options), b); + h.push.apply(h, formatToParts(v.value, e, r, n, f, y - (c.offset || 0))); continue; } } return mergeLiteral(h); } -function mergeConfig(r, e) { - return e ? __assign(__assign(__assign({}, r || {}), e || {}), Object.keys(r).reduce(function(t, n) { - return t[n] = __assign(__assign({}, r[n]), e[n] || {}), t; - }, {})) : r; +function mergeConfig(t, e) { + return e ? __assign(__assign(__assign({}, t || {}), e || {}), Object.keys(t).reduce(function(r, n) { + return r[n] = __assign(__assign({}, t[n]), e[n] || {}), r; + }, {})) : t; } -function mergeConfigs(r, e) { - return e ? Object.keys(r).reduce(function(t, n) { - return t[n] = mergeConfig(r[n], e[n]), t; - }, __assign({}, r)) : r; +function mergeConfigs(t, e) { + return e ? Object.keys(t).reduce(function(r, n) { + return r[n] = mergeConfig(t[n], e[n]), r; + }, __assign({}, t)) : t; } -function createFastMemoizeCache(r) { +function createFastMemoizeCache(t) { return { create: function() { return { get: function(e) { - return r[e]; + return t[e]; }, - set: function(e, t) { - r[e] = t; + set: function(e, r) { + t[e] = r; } }; } }; } -function createDefaultFormatters(r) { - return r === void 0 && (r = { +function createDefaultFormatters(t) { + return t === void 0 && (t = { number: {}, dateTime: {}, pluralRules: {} }), { getNumberFormat: memoize(function() { - for (var e, t = [], n = 0; n < arguments.length; n++) - t[n] = arguments[n]; - return new ((e = Intl.NumberFormat).bind.apply(e, __spreadArray([void 0], t, !1)))(); + for (var e, r = [], n = 0; n < arguments.length; n++) + r[n] = arguments[n]; + return new ((e = Intl.NumberFormat).bind.apply(e, __spreadArray([void 0], r, !1)))(); }, { - cache: createFastMemoizeCache(r.number), + cache: createFastMemoizeCache(t.number), strategy: strategies.variadic }), getDateTimeFormat: memoize(function() { - for (var e, t = [], n = 0; n < arguments.length; n++) - t[n] = arguments[n]; - return new ((e = Intl.DateTimeFormat).bind.apply(e, __spreadArray([void 0], t, !1)))(); + for (var e, r = [], n = 0; n < arguments.length; n++) + r[n] = arguments[n]; + return new ((e = Intl.DateTimeFormat).bind.apply(e, __spreadArray([void 0], r, !1)))(); }, { - cache: createFastMemoizeCache(r.dateTime), + cache: createFastMemoizeCache(t.dateTime), strategy: strategies.variadic }), getPluralRules: memoize(function() { - for (var e, t = [], n = 0; n < arguments.length; n++) - t[n] = arguments[n]; - return new ((e = Intl.PluralRules).bind.apply(e, __spreadArray([void 0], t, !1)))(); + for (var e, r = [], n = 0; n < arguments.length; n++) + r[n] = arguments[n]; + return new ((e = Intl.PluralRules).bind.apply(e, __spreadArray([void 0], r, !1)))(); }, { - cache: createFastMemoizeCache(r.pluralRules), + cache: createFastMemoizeCache(t.pluralRules), strategy: strategies.variadic }) }; @@ -30522,32 +30522,32 @@ function createDefaultFormatters(r) { var IntlMessageFormat = ( /** @class */ function() { - function r(e, t, n, f) { + function t(e, r, n, f) { var u = this; - if (t === void 0 && (t = r.defaultLocale), this.formatterCache = { + if (r === void 0 && (r = t.defaultLocale), this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} - }, this.format = function(y) { - var h = u.formatToParts(y); + }, this.format = function(b) { + var h = u.formatToParts(b); if (h.length === 1) return h[0].value; var _ = h.reduce(function(E, c) { return !E.length || c.type !== PART_TYPE.literal || typeof E[E.length - 1] != "string" ? E.push(c.value) : E[E.length - 1] += c.value, E; }, []); return _.length <= 1 ? _[0] || "" : _; - }, this.formatToParts = function(y) { - return formatToParts(u.ast, u.locales, u.formatters, u.formats, y, void 0, u.message); + }, this.formatToParts = function(b) { + return formatToParts(u.ast, u.locales, u.formatters, u.formats, b, void 0, u.message); }, this.resolvedOptions = function() { return { locale: u.resolvedLocale.toString() }; }, this.getAst = function() { return u.ast; - }, this.locales = t, this.resolvedLocale = r.resolveLocale(t), typeof e == "string") { - if (this.message = e, !r.__parse) + }, this.locales = r, this.resolvedLocale = t.resolveLocale(r), typeof e == "string") { + if (this.message = e, !t.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); - this.ast = r.__parse(e, { + this.ast = t.__parse(e, { ignoreTag: f == null ? void 0 : f.ignoreTag, locale: this.resolvedLocale }); @@ -30555,18 +30555,18 @@ var IntlMessageFormat = ( this.ast = e; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = mergeConfigs(r.formats, n), this.formatters = f && f.formatters || createDefaultFormatters(this.formatterCache); + this.formats = mergeConfigs(t.formats, n), this.formatters = f && f.formatters || createDefaultFormatters(this.formatterCache); } - return Object.defineProperty(r, "defaultLocale", { + return Object.defineProperty(t, "defaultLocale", { get: function() { - return r.memoizedDefaultLocale || (r.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), r.memoizedDefaultLocale; + return t.memoizedDefaultLocale || (t.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), t.memoizedDefaultLocale; }, enumerable: !1, configurable: !0 - }), r.memoizedDefaultLocale = null, r.resolveLocale = function(e) { - var t = Intl.NumberFormat.supportedLocalesOf(e); - return t.length > 0 ? new Intl.Locale(t[0]) : new Intl.Locale(typeof e == "string" ? e : e[0]); - }, r.__parse = parse, r.formats = { + }), t.memoizedDefaultLocale = null, t.resolveLocale = function(e) { + var r = Intl.NumberFormat.supportedLocalesOf(e); + return r.length > 0 ? new Intl.Locale(r[0]) : new Intl.Locale(typeof e == "string" ? e : e[0]); + }, t.__parse = parse, t.formats = { number: { integer: { maximumFractionDigits: 0 @@ -30624,114 +30624,114 @@ var IntlMessageFormat = ( timeZoneName: "short" } } - }, r; + }, t; }() ); -function delve(r, e) { +function delve(t, e) { if (e == null) return; - if (e in r) - return r[e]; - const t = e.split("."); - let n = r; - for (let f = 0; f < t.length; f++) + if (e in t) + return t[e]; + const r = e.split("."); + let n = t; + for (let f = 0; f < r.length; f++) if (typeof n == "object") { if (f > 0) { - const u = t.slice(f, t.length).join("."); + const u = r.slice(f, r.length).join("."); if (u in n) { n = n[u]; break; } } - n = n[t[f]]; + n = n[r[f]]; } else n = void 0; return n; } -const lookupCache = {}, addToCache = (r, e, t) => t && (e in lookupCache || (lookupCache[e] = {}), r in lookupCache[e] || (lookupCache[e][r] = t), t), lookup = (r, e) => { +const lookupCache = {}, addToCache = (t, e, r) => r && (e in lookupCache || (lookupCache[e] = {}), t in lookupCache[e] || (lookupCache[e][t] = r), r), lookup = (t, e) => { if (e == null) return; - if (e in lookupCache && r in lookupCache[e]) - return lookupCache[e][r]; - const t = getPossibleLocales(e); - for (let n = 0; n < t.length; n++) { - const f = t[n], u = getMessageFromDictionary(f, r); + if (e in lookupCache && t in lookupCache[e]) + return lookupCache[e][t]; + const r = getPossibleLocales(e); + for (let n = 0; n < r.length; n++) { + const f = r[n], u = getMessageFromDictionary(f, t); if (u) - return addToCache(r, e, u); + return addToCache(t, e, u); } }; let dictionary; const $dictionary = writable({}); -function getLocaleDictionary(r) { - return dictionary[r] || null; +function getLocaleDictionary(t) { + return dictionary[t] || null; } -function hasLocaleDictionary(r) { - return r in dictionary; +function hasLocaleDictionary(t) { + return t in dictionary; } -function getMessageFromDictionary(r, e) { - if (!hasLocaleDictionary(r)) +function getMessageFromDictionary(t, e) { + if (!hasLocaleDictionary(t)) return null; - const t = getLocaleDictionary(r); - return delve(t, e); + const r = getLocaleDictionary(t); + return delve(r, e); } -function getClosestAvailableLocale(r) { - if (r == null) +function getClosestAvailableLocale(t) { + if (t == null) return; - const e = getPossibleLocales(r); - for (let t = 0; t < e.length; t++) { - const n = e[t]; + const e = getPossibleLocales(t); + for (let r = 0; r < e.length; r++) { + const n = e[r]; if (hasLocaleDictionary(n)) return n; } } -function addMessages(r, ...e) { - delete lookupCache[r], $dictionary.update((t) => (t[r] = deepmerge$1.all([t[r] || {}, ...e]), t)); +function addMessages(t, ...e) { + delete lookupCache[t], $dictionary.update((r) => (r[t] = deepmerge$1.all([r[t] || {}, ...e]), r)); } derived( [$dictionary], - ([r]) => Object.keys(r) + ([t]) => Object.keys(t) ); -$dictionary.subscribe((r) => dictionary = r); +$dictionary.subscribe((t) => dictionary = t); const queue = {}; -function removeLoaderFromQueue(r, e) { - queue[r].delete(e), queue[r].size === 0 && delete queue[r]; +function removeLoaderFromQueue(t, e) { + queue[t].delete(e), queue[t].size === 0 && delete queue[t]; } -function getLocaleQueue(r) { - return queue[r]; +function getLocaleQueue(t) { + return queue[t]; } -function getLocalesQueues(r) { - return getPossibleLocales(r).map((e) => { - const t = getLocaleQueue(e); - return [e, t ? [...t] : []]; +function getLocalesQueues(t) { + return getPossibleLocales(t).map((e) => { + const r = getLocaleQueue(e); + return [e, r ? [...r] : []]; }).filter(([, e]) => e.length > 0); } -function hasLocaleQueue(r) { - return r == null ? !1 : getPossibleLocales(r).some( +function hasLocaleQueue(t) { + return t == null ? !1 : getPossibleLocales(t).some( (e) => { - var t; - return (t = getLocaleQueue(e)) == null ? void 0 : t.size; + var r; + return (r = getLocaleQueue(e)) == null ? void 0 : r.size; } ); } -function loadLocaleQueue(r, e) { +function loadLocaleQueue(t, e) { return Promise.all( - e.map((n) => (removeLoaderFromQueue(r, n), n().then((f) => f.default || f))) - ).then((n) => addMessages(r, ...n)); + e.map((n) => (removeLoaderFromQueue(t, n), n().then((f) => f.default || f))) + ).then((n) => addMessages(t, ...n)); } const activeFlushes = {}; -function flush$1(r) { - if (!hasLocaleQueue(r)) - return r in activeFlushes ? activeFlushes[r] : Promise.resolve(); - const e = getLocalesQueues(r); - return activeFlushes[r] = Promise.all( +function flush$1(t) { + if (!hasLocaleQueue(t)) + return t in activeFlushes ? activeFlushes[t] : Promise.resolve(); + const e = getLocalesQueues(t); + return activeFlushes[t] = Promise.all( e.map( - ([t, n]) => loadLocaleQueue(t, n) + ([r, n]) => loadLocaleQueue(r, n) ) ).then(() => { - if (hasLocaleQueue(r)) - return flush$1(r); - delete activeFlushes[r]; - }), activeFlushes[r]; + if (hasLocaleQueue(t)) + return flush$1(t); + delete activeFlushes[t]; + }), activeFlushes[t]; } const defaultFormats = { number: { @@ -30774,155 +30774,155 @@ function getOptions() { return options; } const $isLoading = writable(!1); -var __defProp$1 = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$1 = Object.getOwnPropertySymbols, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __propIsEnum$1 = Object.prototype.propertyIsEnumerable, __defNormalProp$1 = (r, e, t) => e in r ? __defProp$1(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, __spreadValues$1 = (r, e) => { - for (var t in e || (e = {})) - __hasOwnProp$1.call(e, t) && __defNormalProp$1(r, t, e[t]); +var __defProp$1 = Object.defineProperty, __defProps = Object.defineProperties, __getOwnPropDescs = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$1 = Object.getOwnPropertySymbols, __hasOwnProp$1 = Object.prototype.hasOwnProperty, __propIsEnum$1 = Object.prototype.propertyIsEnumerable, __defNormalProp$1 = (t, e, r) => e in t ? __defProp$1(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, __spreadValues$1 = (t, e) => { + for (var r in e || (e = {})) + __hasOwnProp$1.call(e, r) && __defNormalProp$1(t, r, e[r]); if (__getOwnPropSymbols$1) - for (var t of __getOwnPropSymbols$1(e)) - __propIsEnum$1.call(e, t) && __defNormalProp$1(r, t, e[t]); - return r; -}, __spreadProps = (r, e) => __defProps(r, __getOwnPropDescs(e)); + for (var r of __getOwnPropSymbols$1(e)) + __propIsEnum$1.call(e, r) && __defNormalProp$1(t, r, e[r]); + return t; +}, __spreadProps = (t, e) => __defProps(t, __getOwnPropDescs(e)); let current; const internalLocale = writable(null); -function getSubLocales(r) { - return r.split("-").map((e, t, n) => n.slice(0, t + 1).join("-")).reverse(); +function getSubLocales(t) { + return t.split("-").map((e, r, n) => n.slice(0, r + 1).join("-")).reverse(); } -function getPossibleLocales(r, e = getOptions().fallbackLocale) { - const t = getSubLocales(r); - return e ? [.../* @__PURE__ */ new Set([...t, ...getSubLocales(e)])] : t; +function getPossibleLocales(t, e = getOptions().fallbackLocale) { + const r = getSubLocales(t); + return e ? [.../* @__PURE__ */ new Set([...r, ...getSubLocales(e)])] : r; } function getCurrentLocale() { return current ?? void 0; } -internalLocale.subscribe((r) => { - current = r ?? void 0, typeof window < "u" && r != null && document.documentElement.setAttribute("lang", r); +internalLocale.subscribe((t) => { + current = t ?? void 0, typeof window < "u" && t != null && document.documentElement.setAttribute("lang", t); }); -const set = (r) => { - if (r && getClosestAvailableLocale(r) && hasLocaleQueue(r)) { +const set = (t) => { + if (t && getClosestAvailableLocale(t) && hasLocaleQueue(t)) { const { loadingDelay: e } = getOptions(); - let t; - return typeof window < "u" && getCurrentLocale() != null && e ? t = window.setTimeout( + let r; + return typeof window < "u" && getCurrentLocale() != null && e ? r = window.setTimeout( () => $isLoading.set(!0), e - ) : $isLoading.set(!0), flush$1(r).then(() => { - internalLocale.set(r); + ) : $isLoading.set(!0), flush$1(t).then(() => { + internalLocale.set(t); }).finally(() => { - clearTimeout(t), $isLoading.set(!1); + clearTimeout(r), $isLoading.set(!1); }); } - return internalLocale.set(r); + return internalLocale.set(t); }, $locale = __spreadProps(__spreadValues$1({}, internalLocale), { set -}), monadicMemoize = (r) => { +}), monadicMemoize = (t) => { const e = /* @__PURE__ */ Object.create(null); return (n) => { const f = JSON.stringify(n); - return f in e ? e[f] : e[f] = r(n); + return f in e ? e[f] : e[f] = t(n); }; }; -var __defProp = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (r, e, t) => e in r ? __defProp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, __spreadValues = (r, e) => { - for (var t in e || (e = {})) - __hasOwnProp.call(e, t) && __defNormalProp(r, t, e[t]); +var __defProp = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (t, e, r) => e in t ? __defProp(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, __spreadValues = (t, e) => { + for (var r in e || (e = {})) + __hasOwnProp.call(e, r) && __defNormalProp(t, r, e[r]); if (__getOwnPropSymbols) - for (var t of __getOwnPropSymbols(e)) - __propIsEnum.call(e, t) && __defNormalProp(r, t, e[t]); - return r; -}, __objRest = (r, e) => { - var t = {}; - for (var n in r) - __hasOwnProp.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]); - if (r != null && __getOwnPropSymbols) - for (var n of __getOwnPropSymbols(r)) - e.indexOf(n) < 0 && __propIsEnum.call(r, n) && (t[n] = r[n]); + for (var r of __getOwnPropSymbols(e)) + __propIsEnum.call(e, r) && __defNormalProp(t, r, e[r]); return t; +}, __objRest = (t, e) => { + var r = {}; + for (var n in t) + __hasOwnProp.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]); + if (t != null && __getOwnPropSymbols) + for (var n of __getOwnPropSymbols(t)) + e.indexOf(n) < 0 && __propIsEnum.call(t, n) && (r[n] = t[n]); + return r; }; -const getIntlFormatterOptions = (r, e) => { - const { formats: t } = getOptions(); - if (r in t && e in t[r]) - return t[r][e]; - throw new Error(`[svelte-i18n] Unknown "${e}" ${r} format.`); +const getIntlFormatterOptions = (t, e) => { + const { formats: r } = getOptions(); + if (t in r && e in r[t]) + return r[t][e]; + throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`); }, createNumberFormatter = monadicMemoize( - (r) => { - var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); - if (t == null) + (t) => { + var e = t, { locale: r, format: n } = e, f = __objRest(e, ["locale", "format"]); + if (r == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return n && (f = getIntlFormatterOptions("number", n)), new Intl.NumberFormat(t, f); + return n && (f = getIntlFormatterOptions("number", n)), new Intl.NumberFormat(r, f); } ), createDateFormatter = monadicMemoize( - (r) => { - var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); - if (t == null) + (t) => { + var e = t, { locale: r, format: n } = e, f = __objRest(e, ["locale", "format"]); + if (r == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return n ? f = getIntlFormatterOptions("date", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("date", "short")), new Intl.DateTimeFormat(t, f); + return n ? f = getIntlFormatterOptions("date", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("date", "short")), new Intl.DateTimeFormat(r, f); } ), createTimeFormatter = monadicMemoize( - (r) => { - var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); - if (t == null) + (t) => { + var e = t, { locale: r, format: n } = e, f = __objRest(e, ["locale", "format"]); + if (r == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return n ? f = getIntlFormatterOptions("time", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("time", "short")), new Intl.DateTimeFormat(t, f); + return n ? f = getIntlFormatterOptions("time", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("time", "short")), new Intl.DateTimeFormat(r, f); } -), getNumberFormatter = (r = {}) => { - var e = r, { - locale: t = getCurrentLocale() +), getNumberFormatter = (t = {}) => { + var e = t, { + locale: r = getCurrentLocale() } = e, n = __objRest(e, [ "locale" ]); - return createNumberFormatter(__spreadValues({ locale: t }, n)); -}, getDateFormatter = (r = {}) => { - var e = r, { - locale: t = getCurrentLocale() + return createNumberFormatter(__spreadValues({ locale: r }, n)); +}, getDateFormatter = (t = {}) => { + var e = t, { + locale: r = getCurrentLocale() } = e, n = __objRest(e, [ "locale" ]); - return createDateFormatter(__spreadValues({ locale: t }, n)); -}, getTimeFormatter = (r = {}) => { - var e = r, { - locale: t = getCurrentLocale() + return createDateFormatter(__spreadValues({ locale: r }, n)); +}, getTimeFormatter = (t = {}) => { + var e = t, { + locale: r = getCurrentLocale() } = e, n = __objRest(e, [ "locale" ]); - return createTimeFormatter(__spreadValues({ locale: t }, n)); + return createTimeFormatter(__spreadValues({ locale: r }, n)); }, getMessageFormatter = monadicMemoize( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (r, e = getCurrentLocale()) => new IntlMessageFormat(r, e, getOptions().formats, { + (t, e = getCurrentLocale()) => new IntlMessageFormat(t, e, getOptions().formats, { ignoreTag: getOptions().ignoreTag }) -), formatMessage = (r, e = {}) => { - var t, n, f, u; - let y = e; - typeof r == "object" && (y = r, r = y.id); +), formatMessage = (t, e = {}) => { + var r, n, f, u; + let b = e; + typeof t == "object" && (b = t, t = b.id); const { values: h, locale: _ = getCurrentLocale(), default: E - } = y; + } = b; if (_ == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let c = lookup(r, _); + let c = lookup(t, _); if (!c) - c = (u = (f = (n = (t = getOptions()).handleMissingMessage) == null ? void 0 : n.call(t, { locale: _, id: r, defaultValue: E })) != null ? f : E) != null ? u : r; + c = (u = (f = (n = (r = getOptions()).handleMissingMessage) == null ? void 0 : n.call(r, { locale: _, id: t, defaultValue: E })) != null ? f : E) != null ? u : t; else if (typeof c != "string") return console.warn( - `[svelte-i18n] Message with id "${r}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` + `[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` ), c; if (!h) return c; - let C = c; + let S = c; try { - C = getMessageFormatter(c, _).format(h); - } catch (b) { - b instanceof Error && console.warn( - `[svelte-i18n] Message "${r}" has syntax error:`, - b.message + S = getMessageFormatter(c, _).format(h); + } catch (y) { + y instanceof Error && console.warn( + `[svelte-i18n] Message "${t}" has syntax error:`, + y.message ); } - return C; -}, formatTime = (r, e) => getTimeFormatter(e).format(r), formatDate = (r, e) => getDateFormatter(e).format(r), formatNumber = (r, e) => getNumberFormatter(e).format(r), getJSON = (r, e = getCurrentLocale()) => lookup(r, e); + return S; +}, formatTime = (t, e) => getTimeFormatter(e).format(t), formatDate = (t, e) => getDateFormatter(e).format(t), formatNumber = (t, e) => getNumberFormatter(e).format(t), getJSON = (t, e = getCurrentLocale()) => lookup(t, e); derived([$locale, $dictionary], () => formatMessage); derived([$locale], () => formatTime); derived([$locale], () => formatDate); @@ -30952,279 +30952,279 @@ const Upload_svelte_svelte_type_style_lang = "", { transition_out: transition_out$5, update_slot_base: update_slot_base$2 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3, tick: tick$3, getContext: getContext$1 } = window.__gradio__svelte__internal; -function create_fragment$8(r) { - let e, t, n, f, u, y, h, _, E; +function create_fragment$8(t) { + let e, r, n, f, u, b, h, _, E; const c = ( /*#slots*/ - r[16].default - ), C = create_slot$2( + t[16].default + ), S = create_slot$2( c, - r, + t, /*$$scope*/ - r[15], + t[15], null ); return { c() { - e = element$6("button"), C && C.c(), t = space$5(), n = element$6("input"), attr$7(n, "type", "file"), attr$7( + e = element$6("button"), S && S.c(), r = space$5(), n = element$6("input"), attr$7(n, "type", "file"), attr$7( n, "accept", /*filetype*/ - r[0] + t[0] ), n.multiple = f = /*file_count*/ - r[4] === "multiple" || void 0, attr$7(n, "webkitdirectory", u = /*file_count*/ - r[4] === "directory" || void 0), attr$7(n, "mozdirectory", y = /*file_count*/ - r[4] === "directory" || void 0), attr$7(n, "class", "svelte-18dlsnh"), attr$7(e, "class", "svelte-18dlsnh"), toggle_class$4( + t[4] === "multiple" || void 0, attr$7(n, "webkitdirectory", u = /*file_count*/ + t[4] === "directory" || void 0), attr$7(n, "mozdirectory", b = /*file_count*/ + t[4] === "directory" || void 0), attr$7(n, "class", "svelte-18dlsnh"), attr$7(e, "class", "svelte-18dlsnh"), toggle_class$4( e, "hidden", /*hidden*/ - r[5] + t[5] ), toggle_class$4( e, "center", /*center*/ - r[2] + t[2] ), toggle_class$4( e, "boundedheight", /*boundedheight*/ - r[1] + t[1] ), toggle_class$4( e, "flex", /*flex*/ - r[3] + t[3] ); }, - m(b, A) { - insert$8(b, e, A), C && C.m(e, null), append$7(e, t), append$7(e, n), r[24](n), h = !0, _ || (E = [ + m(y, w) { + insert$8(y, e, w), S && S.m(e, null), append$7(e, r), append$7(e, n), t[24](n), h = !0, _ || (E = [ listen$1( n, "change", /*load_files_from_upload*/ - r[9] + t[9] ), listen$1(e, "drag", stop_propagation(prevent_default( /*drag_handler*/ - r[17] + t[17] ))), listen$1(e, "dragstart", stop_propagation(prevent_default( /*dragstart_handler*/ - r[18] + t[18] ))), listen$1(e, "dragend", stop_propagation(prevent_default( /*dragend_handler*/ - r[19] + t[19] ))), listen$1(e, "dragover", stop_propagation(prevent_default( /*dragover_handler*/ - r[20] + t[20] ))), listen$1(e, "dragenter", stop_propagation(prevent_default( /*dragenter_handler*/ - r[21] + t[21] ))), listen$1(e, "dragleave", stop_propagation(prevent_default( /*dragleave_handler*/ - r[22] + t[22] ))), listen$1(e, "drop", stop_propagation(prevent_default( /*drop_handler*/ - r[23] + t[23] ))), listen$1( e, "click", /*open_file_upload*/ - r[6] + t[6] ), listen$1( e, "drop", /*loadFilesFromDrop*/ - r[10] + t[10] ), listen$1( e, "dragenter", /*updateDragging*/ - r[8] + t[8] ), listen$1( e, "dragleave", /*updateDragging*/ - r[8] + t[8] ) ], _ = !0); }, - p(b, [A]) { - C && C.p && (!h || A & /*$$scope*/ + p(y, [w]) { + S && S.p && (!h || w & /*$$scope*/ 32768) && update_slot_base$2( - C, + S, c, - b, + y, /*$$scope*/ - b[15], + y[15], h ? get_slot_changes$2( c, /*$$scope*/ - b[15], - A, + y[15], + w, null ) : get_all_dirty_from_scope$2( /*$$scope*/ - b[15] + y[15] ), null - ), (!h || A & /*filetype*/ + ), (!h || w & /*filetype*/ 1) && attr$7( n, "accept", /*filetype*/ - b[0] - ), (!h || A & /*file_count*/ + y[0] + ), (!h || w & /*file_count*/ 16 && f !== (f = /*file_count*/ - b[4] === "multiple" || void 0)) && (n.multiple = f), (!h || A & /*file_count*/ + y[4] === "multiple" || void 0)) && (n.multiple = f), (!h || w & /*file_count*/ 16 && u !== (u = /*file_count*/ - b[4] === "directory" || void 0)) && attr$7(n, "webkitdirectory", u), (!h || A & /*file_count*/ - 16 && y !== (y = /*file_count*/ - b[4] === "directory" || void 0)) && attr$7(n, "mozdirectory", y), (!h || A & /*hidden*/ + y[4] === "directory" || void 0)) && attr$7(n, "webkitdirectory", u), (!h || w & /*file_count*/ + 16 && b !== (b = /*file_count*/ + y[4] === "directory" || void 0)) && attr$7(n, "mozdirectory", b), (!h || w & /*hidden*/ 32) && toggle_class$4( e, "hidden", /*hidden*/ - b[5] - ), (!h || A & /*center*/ + y[5] + ), (!h || w & /*center*/ 4) && toggle_class$4( e, "center", /*center*/ - b[2] - ), (!h || A & /*boundedheight*/ + y[2] + ), (!h || w & /*boundedheight*/ 2) && toggle_class$4( e, "boundedheight", /*boundedheight*/ - b[1] - ), (!h || A & /*flex*/ + y[1] + ), (!h || w & /*flex*/ 8) && toggle_class$4( e, "flex", /*flex*/ - b[3] + y[3] ); }, - i(b) { - h || (transition_in$5(C, b), h = !0); + i(y) { + h || (transition_in$5(S, y), h = !0); }, - o(b) { - transition_out$5(C, b), h = !1; + o(y) { + transition_out$5(S, y), h = !1; }, - d(b) { - b && detach$8(e), C && C.d(b), r[24](null), _ = !1, run_all$1(E); + d(y) { + y && detach$8(e), S && S.d(y), t[24](null), _ = !1, run_all$1(E); } }; } -function _optionalChain(r) { - let e, t = r[0], n = 1; - for (; n < r.length; ) { - const f = r[n], u = r[n + 1]; - if (n += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) +function _optionalChain(t) { + let e, r = t[0], n = 1; + for (; n < t.length; ) { + const f = t[n], u = t[n + 1]; + if (n += 2, (f === "optionalAccess" || f === "optionalCall") && r == null) return; - f === "access" || f === "optionalAccess" ? (e = t, t = u(t)) : (f === "call" || f === "optionalCall") && (t = u((...y) => t.call(e, ...y)), e = void 0); + f === "access" || f === "optionalAccess" ? (e = r, r = u(r)) : (f === "call" || f === "optionalCall") && (r = u((...b) => r.call(e, ...b)), e = void 0); } - return t; + return r; } -function is_valid_mimetype(r, e) { - return !r || r === "*" ? !0 : r.endsWith("/*") ? e.startsWith(r.slice(0, -1)) : r === e; +function is_valid_mimetype(t, e) { + return !t || t === "*" ? !0 : t.endsWith("/*") ? e.startsWith(t.slice(0, -1)) : t === e; } -function instance$7(r, e, t) { - let { $$slots: n = {}, $$scope: f } = e, { filetype: u = null } = e, { dragging: y = !1 } = e, { boundedheight: h = !0 } = e, { center: _ = !0 } = e, { flex: E = !0 } = e, { file_count: c = "single" } = e, { disable_click: C = !1 } = e, { root: b } = e, { hidden: A = !1 } = e; - const S = getContext$1("upload_files"); +function instance$7(t, e, r) { + let { $$slots: n = {}, $$scope: f } = e, { filetype: u = null } = e, { dragging: b = !1 } = e, { boundedheight: h = !0 } = e, { center: _ = !0 } = e, { flex: E = !0 } = e, { file_count: c = "single" } = e, { disable_click: S = !1 } = e, { root: y } = e, { hidden: w = !1 } = e; + const L = getContext$1("upload_files"); let s; const o = createEventDispatcher$3(); - function w() { - t(11, y = !y); + function A() { + r(11, b = !b); } function p() { - C || (t(7, s.value = "", s), s.click()); + S || (r(7, s.value = "", s), s.click()); } async function v(k) { await tick$3(); - const N = await upload(k, b, S); - return o("load", c === "single" ? _optionalChain([N, "optionalAccess", ($) => $[0]]) : N), N || []; + const N = await upload$1(k, y, L); + return o("load", c === "single" ? _optionalChain([N, "optionalAccess", (R) => R[0]]) : N), N || []; } async function a(k) { if (!k.length) return; - let N = k.map((F) => new File([F], F.name)), $ = await prepare_files(N); - return await v($); + let N = k.map((U) => new File([U], U.name)), R = await prepare_files(N); + return await v(R); } async function l(k) { const N = k.target; N.files && await a(Array.from(N.files)); } async function g(k) { - if (t(11, y = !1), !_optionalChain([k, "access", ($) => $.dataTransfer, "optionalAccess", ($) => $.files])) + if (r(11, b = !1), !_optionalChain([k, "access", (R) => R.dataTransfer, "optionalAccess", (R) => R.files])) return; - const N = Array.from(k.dataTransfer.files).filter(($) => is_valid_mimetype(u, $.type) ? !0 : (o("error", `Invalid file type only ${u} allowed.`), !1)); + const N = Array.from(k.dataTransfer.files).filter((R) => is_valid_mimetype(u, R.type) ? !0 : (o("error", `Invalid file type only ${u} allowed.`), !1)); await a(N); } function M(k) { - bubble$1.call(this, r, k); + bubble$1.call(this, t, k); } - function L(k) { - bubble$1.call(this, r, k); + function C(k) { + bubble$1.call(this, t, k); } function T(k) { - bubble$1.call(this, r, k); + bubble$1.call(this, t, k); } function D(k) { - bubble$1.call(this, r, k); + bubble$1.call(this, t, k); } function I(k) { - bubble$1.call(this, r, k); + bubble$1.call(this, t, k); } - function z(k) { - bubble$1.call(this, r, k); + function B(k) { + bubble$1.call(this, t, k); } function P(k) { - bubble$1.call(this, r, k); + bubble$1.call(this, t, k); } - function B(k) { + function z(k) { binding_callbacks$2[k ? "unshift" : "push"](() => { - s = k, t(7, s); + s = k, r(7, s); }); } - return r.$$set = (k) => { - "filetype" in k && t(0, u = k.filetype), "dragging" in k && t(11, y = k.dragging), "boundedheight" in k && t(1, h = k.boundedheight), "center" in k && t(2, _ = k.center), "flex" in k && t(3, E = k.flex), "file_count" in k && t(4, c = k.file_count), "disable_click" in k && t(12, C = k.disable_click), "root" in k && t(13, b = k.root), "hidden" in k && t(5, A = k.hidden), "$$scope" in k && t(15, f = k.$$scope); + return t.$$set = (k) => { + "filetype" in k && r(0, u = k.filetype), "dragging" in k && r(11, b = k.dragging), "boundedheight" in k && r(1, h = k.boundedheight), "center" in k && r(2, _ = k.center), "flex" in k && r(3, E = k.flex), "file_count" in k && r(4, c = k.file_count), "disable_click" in k && r(12, S = k.disable_click), "root" in k && r(13, y = k.root), "hidden" in k && r(5, w = k.hidden), "$$scope" in k && r(15, f = k.$$scope); }, [ u, h, _, E, c, - A, + w, p, s, - w, + A, l, g, - y, - C, b, + S, + y, a, f, n, M, - L, + C, T, D, I, - z, + B, P, - B + z ]; } class Upload extends SvelteComponent$8 { @@ -31270,26 +31270,26 @@ const ModifyUpload_svelte_svelte_type_style_lang = "", { transition_in: transition_in$4, transition_out: transition_out$4 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2 } = window.__gradio__svelte__internal; -function create_if_block_1$3(r) { - let e, t; +function create_if_block_1$3(t) { + let e, r; return e = new IconButton({ props: { Icon: Edit, label: ( /*i18n*/ - r[3]("common.edit") + t[3]("common.edit") ) } }), e.$on( "click", /*click_handler*/ - r[5] + t[5] ), { c() { create_component$4(e.$$.fragment); }, m(n, f) { - mount_component$4(e, n, f), t = !0; + mount_component$4(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -31298,36 +31298,36 @@ function create_if_block_1$3(r) { n[3]("common.edit")), e.$set(u); }, i(n) { - t || (transition_in$4(e.$$.fragment, n), t = !0); + r || (transition_in$4(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$4(e.$$.fragment, n), t = !1; + transition_out$4(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$4(e, n); } }; } -function create_if_block$4(r) { - let e, t; +function create_if_block$4(t) { + let e, r; return e = new IconButton({ props: { Icon: Undo, label: ( /*i18n*/ - r[3]("common.undo") + t[3]("common.undo") ) } }), e.$on( "click", /*click_handler_1*/ - r[6] + t[6] ), { c() { create_component$4(e.$$.fragment); }, m(n, f) { - mount_component$4(e, n, f), t = !0; + mount_component$4(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -31336,54 +31336,54 @@ function create_if_block$4(r) { n[3]("common.undo")), e.$set(u); }, i(n) { - t || (transition_in$4(e.$$.fragment, n), t = !0); + r || (transition_in$4(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$4(e.$$.fragment, n), t = !1; + transition_out$4(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$4(e, n); } }; } -function create_fragment$7(r) { - let e, t, n, f, u, y = ( +function create_fragment$7(t) { + let e, r, n, f, u, b = ( /*editable*/ - r[0] && create_if_block_1$3(r) + t[0] && create_if_block_1$3(t) ), h = ( /*undoable*/ - r[1] && create_if_block$4(r) + t[1] && create_if_block$4(t) ); return f = new IconButton({ props: { Icon: Clear, label: ( /*i18n*/ - r[3]("common.clear") + t[3]("common.clear") ) } }), f.$on( "click", /*click_handler_2*/ - r[7] + t[7] ), { c() { - e = element$5("div"), y && y.c(), t = space$4(), h && h.c(), n = space$4(), create_component$4(f.$$.fragment), attr$6(e, "class", "svelte-1wj0ocy"), toggle_class$3(e, "not-absolute", !/*absolute*/ - r[2]), set_style$2( + e = element$5("div"), b && b.c(), r = space$4(), h && h.c(), n = space$4(), create_component$4(f.$$.fragment), attr$6(e, "class", "svelte-1wj0ocy"), toggle_class$3(e, "not-absolute", !/*absolute*/ + t[2]), set_style$2( e, "position", /*absolute*/ - r[2] ? "absolute" : "static" + t[2] ? "absolute" : "static" ); }, m(_, E) { - insert$7(_, e, E), y && y.m(e, null), append$6(e, t), h && h.m(e, null), append$6(e, n), mount_component$4(f, e, null), u = !0; + insert$7(_, e, E), b && b.m(e, null), append$6(e, r), h && h.m(e, null), append$6(e, n), mount_component$4(f, e, null), u = !0; }, p(_, [E]) { /*editable*/ - _[0] ? y ? (y.p(_, E), E & /*editable*/ - 1 && transition_in$4(y, 1)) : (y = create_if_block_1$3(_), y.c(), transition_in$4(y, 1), y.m(e, t)) : y && (group_outros$4(), transition_out$4(y, 1, 1, () => { - y = null; + _[0] ? b ? (b.p(_, E), E & /*editable*/ + 1 && transition_in$4(b, 1)) : (b = create_if_block_1$3(_), b.c(), transition_in$4(b, 1), b.m(e, r)) : b && (group_outros$4(), transition_out$4(b, 1, 1, () => { + b = null; }), check_outros$4()), /*undoable*/ _[1] ? h ? (h.p(_, E), E & /*undoable*/ 2 && transition_in$4(h, 1)) : (h = create_if_block$4(_), h.c(), transition_in$4(h, 1), h.m(e, n)) : h && (group_outros$4(), transition_out$4(h, 1, 1, () => { @@ -31403,28 +31403,28 @@ function create_fragment$7(r) { ); }, i(_) { - u || (transition_in$4(y), transition_in$4(h), transition_in$4(f.$$.fragment, _), u = !0); + u || (transition_in$4(b), transition_in$4(h), transition_in$4(f.$$.fragment, _), u = !0); }, o(_) { - transition_out$4(y), transition_out$4(h), transition_out$4(f.$$.fragment, _), u = !1; + transition_out$4(b), transition_out$4(h), transition_out$4(f.$$.fragment, _), u = !1; }, d(_) { - _ && detach$7(e), y && y.d(), h && h.d(), destroy_component$4(f); + _ && detach$7(e), b && b.d(), h && h.d(), destroy_component$4(f); } }; } -function instance$6(r, e, t) { - let { editable: n = !1 } = e, { undoable: f = !1 } = e, { absolute: u = !0 } = e, { i18n: y } = e; - const h = createEventDispatcher$2(), _ = () => h("edit"), E = () => h("undo"), c = (C) => { - h("clear"), C.stopPropagation(); +function instance$6(t, e, r) { + let { editable: n = !1 } = e, { undoable: f = !1 } = e, { absolute: u = !0 } = e, { i18n: b } = e; + const h = createEventDispatcher$2(), _ = () => h("edit"), E = () => h("undo"), c = (S) => { + h("clear"), S.stopPropagation(); }; - return r.$$set = (C) => { - "editable" in C && t(0, n = C.editable), "undoable" in C && t(1, f = C.undoable), "absolute" in C && t(2, u = C.absolute), "i18n" in C && t(3, y = C.i18n); + return t.$$set = (S) => { + "editable" in S && r(0, n = S.editable), "undoable" in S && r(1, f = S.undoable), "absolute" in S && r(2, u = S.absolute), "i18n" in S && r(3, b = S.i18n); }, [ n, f, u, - y, + b, h, _, E, @@ -31441,146 +31441,1290 @@ class ModifyUpload extends SvelteComponent$7 { }); } } -const { - SvelteComponent: SvelteComponent$6, - append: append$5, - attr: attr$5, - detach: detach$6, - init: init$6, - insert: insert$6, - noop: noop$4, - safe_not_equal: safe_not_equal$6, - svg_element: svg_element$2 -} = window.__gradio__svelte__internal; -function create_fragment$6(r) { - let e, t, n, f, u, y, h, _, E, c, C, b; - return { - c() { - e = svg_element$2("svg"), t = svg_element$2("defs"), n = svg_element$2("linearGradient"), f = svg_element$2("stop"), u = svg_element$2("stop"), y = svg_element$2("stop"), h = svg_element$2("g"), _ = svg_element$2("g"), E = svg_element$2("path"), c = svg_element$2("animateTransform"), C = svg_element$2("circle"), b = svg_element$2("animateTransform"), attr$5(f, "stop-color", "#FF7C00"), attr$5(f, "stop-opacity", "0"), attr$5(f, "offset", "0%"), attr$5(u, "stop-color", "#FF7C00"), attr$5(u, "stop-opacity", ".631"), attr$5(u, "offset", "63.146%"), attr$5(y, "stop-color", "#FF7C00"), attr$5(y, "offset", "100%"), attr$5(n, "x1", "8.042%"), attr$5(n, "y1", "0%"), attr$5(n, "x2", "65.682%"), attr$5(n, "y2", "23.865%"), attr$5(n, "id", "a"), attr$5(c, "attributeName", "transform"), attr$5(c, "type", "rotate"), attr$5(c, "from", "0 18 18"), attr$5(c, "to", "360 18 18"), attr$5(c, "dur", "0.9s"), attr$5(c, "repeatCount", "indefinite"), attr$5(E, "d", "M36 18c0-9.94-8.06-18-18-18"), attr$5(E, "id", "Oval-2"), attr$5(E, "stroke", "url(#a)"), attr$5(E, "stroke-width", "2"), attr$5(b, "attributeName", "transform"), attr$5(b, "type", "rotate"), attr$5(b, "from", "0 18 18"), attr$5(b, "to", "360 18 18"), attr$5(b, "dur", "0.9s"), attr$5(b, "repeatCount", "indefinite"), attr$5(C, "fill", "#FFf"), attr$5(C, "cx", "36"), attr$5(C, "cy", "18"), attr$5(C, "r", "1"), attr$5(_, "transform", "translate(1 1)"), attr$5(h, "fill", "none"), attr$5(h, "fill-rule", "evenodd"), attr$5(e, "width", "20"), attr$5(e, "height", "20 "), attr$5(e, "viewBox", "0 0 38 38"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg"); - }, - m(A, S) { - insert$6(A, e, S), append$5(e, t), append$5(t, n), append$5(n, f), append$5(n, u), append$5(n, y), append$5(e, h), append$5(h, _), append$5(_, E), append$5(E, c), append$5(_, C), append$5(C, b); - }, - p: noop$4, - i: noop$4, - o: noop$4, - d(A) { - A && detach$6(e); - } - }; +var fn = new Intl.Collator(0, { numeric: 1 }).compare; +function semiver(t, e, r) { + return t = t.split("."), e = e.split("."), fn(t[0], e[0]) || fn(t[1], e[1]) || (e[2] = e.slice(2).join("."), r = /[.-]/.test(t[2] = t.slice(2).join(".")), r == /[.-]/.test(e[2]) ? fn(t[2], e[2]) : r ? -1 : 1); } -class Loading_spinner extends SvelteComponent$6 { - constructor(e) { - super(), init$6(this, e, null, create_fragment$6, safe_not_equal$6, {}); - } +function resolve_root(t, e, r) { + return e.startsWith("http://") || e.startsWith("https://") ? r ? t : e : t + e; } -const FileRetrieval_svelte_svelte_type_style_lang = "", { - SvelteComponent: SvelteComponent$5, - append: append$4, - attr: attr$4, - check_outros: check_outros$3, - create_component: create_component$3, - destroy_component: destroy_component$3, - detach: detach$5, - element: element$4, - group_outros: group_outros$3, - init: init$5, - insert: insert$5, - listen, - mount_component: mount_component$3, - noop: noop$3, - run_all, - safe_not_equal: safe_not_equal$5, - set_input_value, - space: space$3, - transition_in: transition_in$3, - transition_out: transition_out$3 -} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1, tick: tick$2, getContext } = window.__gradio__svelte__internal; -function create_else_block$3(r) { - let e; +function determine_protocol(t) { + if (t.startsWith("http")) { + const { protocol: e, host: r } = new URL(t); + return r.endsWith("hf.space") ? { + ws_protocol: "wss", + host: r, + http_protocol: e + } : { + ws_protocol: e === "https:" ? "wss" : "ws", + http_protocol: e, + host: r + }; + } else if (t.startsWith("file:")) + return { + ws_protocol: "ws", + http_protocol: "http:", + host: "lite.local" + // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`. + }; return { - c() { - e = element$4("span"), e.textContent = "Fetch"; - }, - m(t, n) { - insert$5(t, e, n); - }, - i: noop$3, - o: noop$3, - d(t) { - t && detach$5(e); - } + ws_protocol: "wss", + http_protocol: "https:", + host: t }; } -function create_if_block$3(r) { - let e, t; - return e = new Loading_spinner({}), { - c() { - create_component$3(e.$$.fragment); - }, - m(n, f) { - mount_component$3(e, n, f), t = !0; - }, - i(n) { - t || (transition_in$3(e.$$.fragment, n), t = !0); - }, - o(n) { - transition_out$3(e.$$.fragment, n), t = !1; - }, - d(n) { - destroy_component$3(e, n); +const RE_SPACE_NAME = /^[^\/]*\/[^\/]*$/, RE_SPACE_DOMAIN = /.*hf\.space\/{0,1}$/; +async function process_endpoint(t, e) { + const r = {}; + e && (r.Authorization = `Bearer ${e}`); + const n = t.trim(); + if (RE_SPACE_NAME.test(n)) + try { + const f = await fetch( + `https://huggingface.co/api/spaces/${n}/host`, + { headers: r } + ); + if (f.status !== 200) + throw new Error("Space metadata could not be loaded."); + const u = (await f.json()).host; + return { + space_id: t, + ...determine_protocol(u) + }; + } catch (f) { + throw new Error("Space metadata could not be loaded." + f.message); } + if (RE_SPACE_DOMAIN.test(n)) { + const { ws_protocol: f, http_protocol: u, host: b } = determine_protocol(n); + return { + space_id: b.replace(".hf.space", ""), + ws_protocol: f, + http_protocol: u, + host: b + }; + } + return { + space_id: !1, + ...determine_protocol(n) }; } -function create_fragment$5(r) { - let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p; - const v = [create_if_block$3, create_else_block$3], a = []; - function l(g, M) { - return ( - /*loading*/ - g[1] ? 0 : 1 - ); +function map_names_to_ids(t) { + let e = {}; + return t.forEach(({ api_name: r }, n) => { + r && (e[r] = n); + }), e; +} +const RE_DISABLED_DISCUSSION = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; +async function discussions_enabled(t) { + try { + const r = (await fetch( + `https://huggingface.co/api/spaces/${t}/discussions`, + { + method: "HEAD" + } + )).headers.get("x-error-message"); + return !(r && RE_DISABLED_DISCUSSION.test(r)); + } catch { + return !1; } - return b = l(r), A = a[b] = v[b](r), { - c() { - e = element$4("div"), t = element$4("div"), n = element$4("input"), f = space$3(), u = element$4("select"), y = element$4("option"), y.textContent = "PDB Assym. Unit", h = element$4("option"), h.textContent = "PDB BioAssembly", _ = element$4("option"), _.textContent = "AlphaFold DB", E = element$4("option"), E.textContent = "ESMFold DB", c = space$3(), C = element$4("button"), A.c(), S = space$3(), s = element$4("span"), s.textContent = "- or -", attr$4(n, "type", "text"), attr$4( +} +function apply_edit(t, e, r, n) { + if (e.length === 0) { + if (r === "replace") + return n; + if (r === "append") + return t + n; + throw new Error(`Unsupported action: ${r}`); + } + let f = t; + for (let b = 0; b < e.length - 1; b++) + f = f[e[b]]; + const u = e[e.length - 1]; + switch (r) { + case "replace": + f[u] = n; + break; + case "append": + f[u] += n; + break; + case "add": + Array.isArray(f) ? f.splice(Number(u), 0, n) : f[u] = n; + break; + case "delete": + Array.isArray(f) ? f.splice(Number(u), 1) : delete f[u]; + break; + default: + throw new Error(`Unknown action: ${r}`); + } + return t; +} +function apply_diff(t, e) { + return e.forEach(([r, n, f]) => { + t = apply_edit(t, n, r, f); + }), t; +} +async function upload(t, e, r, n = upload_files) { + let f = (Array.isArray(t) ? t : [t]).map( + (u) => u.blob + ); + return await Promise.all( + await n(e, f, void 0, r).then( + async (u) => { + if (u.error) + throw new Error(u.error); + return u.files ? u.files.map((b, h) => new FileData({ + ...t[h], + path: b, + url: e + "/file=" + b + })) : []; + } + ) + ); +} +class FileData { + constructor({ + path: e, + url: r, + orig_name: n, + size: f, + blob: u, + is_stream: b, + mime_type: h, + alt_text: _ + }) { + this.meta = { _type: "gradio.FileData" }, this.path = e, this.url = r, this.orig_name = n, this.size = f, this.blob = r ? void 0 : u, this.is_stream = b, this.mime_type = h, this.alt_text = _; + } +} +const QUEUE_FULL_MSG = "This application is too busy. Keep trying!", BROKEN_CONNECTION_MSG = "Connection errored out."; +let NodeBlob; +function api_factory(t, e) { + return { post_data: r, upload_files: n, client: f, handle_blob: u }; + async function r(b, h, _) { + const E = { "Content-Type": "application/json" }; + _ && (E.Authorization = `Bearer ${_}`); + try { + var c = await t(b, { + method: "POST", + body: JSON.stringify(h), + headers: E + }); + } catch { + return [{ error: BROKEN_CONNECTION_MSG }, 500]; + } + let S, y; + try { + S = await c.json(), y = c.status; + } catch (w) { + S = { error: `Could not parse server response: ${w}` }, y = 500; + } + return [S, y]; + } + async function n(b, h, _, E) { + const c = {}; + _ && (c.Authorization = `Bearer ${_}`); + const S = 1e3, y = []; + for (let L = 0; L < h.length; L += S) { + const s = h.slice(L, L + S), o = new FormData(); + s.forEach((p) => { + o.append("files", p); + }); + try { + const p = E ? `${b}/upload?upload_id=${E}` : `${b}/upload`; + var w = await t(p, { + method: "POST", + body: o, + headers: c + }); + } catch { + return { error: BROKEN_CONNECTION_MSG }; + } + const A = await w.json(); + y.push(...A); + } + return { files: y }; + } + async function f(b, h = {}) { + return new Promise(async (_) => { + const { status_callback: E, hf_token: c } = h, S = { + predict: z, + submit: k, + view_api: W, + component_server: U + }; + if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) { + const G = await import("./wrapper-6f348d45-19fa94bf.js"); + NodeBlob = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = G.WebSocket; + } + const { ws_protocol: y, http_protocol: w, host: L, space_id: s } = await process_endpoint(b, c), o = Math.random().toString(36).substring(2), A = {}; + let p = !1, v = {}, a = {}, l = null; + const g = {}, M = /* @__PURE__ */ new Set(); + let C, T = {}, D = !1; + c && s && (D = await get_jwt(s, c)); + async function I(G) { + if (C = G, window.location.protocol === "https:" && (C.root = C.root.replace("http://", "https://")), T = map_names_to_ids((G == null ? void 0 : G.dependencies) || []), C.auth_required) + return { + config: C, + ...S + }; + try { + B = await W(C); + } catch (F) { + console.error(`Could not get api details: ${F.message}`); + } + return { + config: C, + ...S + }; + } + let B; + async function P(G) { + if (E && E(G), G.status === "running") + try { + C = await resolve_config( + t, + `${w}//${L}`, + c + ); + const F = await I(C); + _(F); + } catch (F) { + console.error(F), E && E({ + status: "error", + message: "Could not load this space.", + load_status: "error", + detail: "NOT_FOUND" + }); + } + } + try { + C = await resolve_config( + t, + `${w}//${L}`, + c + ); + const G = await I(C); + _(G); + } catch (G) { + console.error(G), s ? check_space_status( + s, + RE_SPACE_NAME.test(s) ? "space_name" : "subdomain", + P + ) : E && E({ + status: "error", + message: "Could not load this space.", + load_status: "error", + detail: "NOT_FOUND" + }); + } + function z(G, F, V) { + let J = !1, X = !1, oe; + if (typeof G == "number") + oe = C.dependencies[G]; + else { + const te = G.replace(/^\//, ""); + oe = C.dependencies[T[te]]; + } + if (oe.types.continuous) + throw new Error( + "Cannot call predict on this function as it may run forever. Use submit instead" + ); + return new Promise((te, ve) => { + const se = k(G, F, V); + let le; + se.on("data", (Ce) => { + X && (se.destroy(), te(Ce)), J = !0, le = Ce; + }).on("status", (Ce) => { + Ce.stage === "error" && ve(Ce), Ce.stage === "complete" && (X = !0, J && (se.destroy(), te(le))); + }); + }); + } + function k(G, F, V, J = null) { + let X, oe; + if (typeof G == "number") + X = G, oe = B.unnamed_endpoints[X]; + else { + const de = G.replace(/^\//, ""); + X = T[de], oe = B.named_endpoints[G.trim()]; + } + if (typeof X != "number") + throw new Error( + "There is no endpoint matching that name of fn_index matching that number." + ); + let te, ve, se = C.protocol ?? "ws"; + const le = typeof G == "number" ? "/predict" : G; + let Ce, be = null, Le = !1; + const ae = {}; + let _e = ""; + typeof window < "u" && (_e = new URLSearchParams(window.location.search).toString()), u(`${C.root}`, F, oe, c).then( + (de) => { + if (Ce = { + data: de || [], + event_data: V, + fn_index: X, + trigger_id: J + }, skip_queue(X, C)) + Be({ + type: "status", + endpoint: le, + stage: "pending", + queue: !1, + fn_index: X, + time: /* @__PURE__ */ new Date() + }), r( + `${C.root}/run${le.startsWith("/") ? le : `/${le}`}${_e ? "?" + _e : ""}`, + { + ...Ce, + session_hash: o + }, + c + ).then(([Ae, Oe]) => { + const We = Ae.data; + Oe == 200 ? (Be({ + type: "data", + endpoint: le, + fn_index: X, + data: We, + time: /* @__PURE__ */ new Date() + }), Be({ + type: "status", + endpoint: le, + fn_index: X, + stage: "complete", + eta: Ae.average_duration, + queue: !1, + time: /* @__PURE__ */ new Date() + })) : Be({ + type: "status", + stage: "error", + endpoint: le, + fn_index: X, + message: Ae.error, + queue: !1, + time: /* @__PURE__ */ new Date() + }); + }).catch((Ae) => { + Be({ + type: "status", + stage: "error", + message: Ae.message, + endpoint: le, + fn_index: X, + queue: !1, + time: /* @__PURE__ */ new Date() + }); + }); + else if (se == "ws") { + Be({ + type: "status", + stage: "pending", + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + let Ae = new URL(`${y}://${resolve_root( + L, + C.path, + !0 + )} + /queue/join${_e ? "?" + _e : ""}`); + D && Ae.searchParams.set("__sign", D), te = new WebSocket(Ae), te.onclose = (Oe) => { + Oe.wasClean || Be({ + type: "status", + stage: "error", + broken: !0, + message: BROKEN_CONNECTION_MSG, + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + }, te.onmessage = function(Oe) { + const We = JSON.parse(Oe.data), { type: Ue, status: Z, data: j } = handle_message( + We, + A[X] + ); + if (Ue === "update" && Z && !Le) + Be({ + type: "status", + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date(), + ...Z + }), Z.stage === "error" && te.close(); + else if (Ue === "hash") { + te.send(JSON.stringify({ fn_index: X, session_hash: o })); + return; + } else + Ue === "data" ? te.send(JSON.stringify({ ...Ce, session_hash: o })) : Ue === "complete" ? Le = Z : Ue === "log" ? Be({ + type: "log", + log: j.log, + level: j.level, + endpoint: le, + fn_index: X + }) : Ue === "generating" && Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...Z, + stage: Z == null ? void 0 : Z.stage, + queue: !0, + endpoint: le, + fn_index: X + }); + j && (Be({ + type: "data", + time: /* @__PURE__ */ new Date(), + data: j.data, + endpoint: le, + fn_index: X + }), Le && (Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...Le, + stage: Z == null ? void 0 : Z.stage, + queue: !0, + endpoint: le, + fn_index: X + }), te.close())); + }, semiver(C.version || "2.0.0", "3.6") < 0 && addEventListener( + "open", + () => te.send(JSON.stringify({ hash: o })) + ); + } else if (se == "sse") { + Be({ + type: "status", + stage: "pending", + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + var ce = new URLSearchParams({ + fn_index: X.toString(), + session_hash: o + }).toString(); + let Ae = new URL( + `${C.root}/queue/join?${_e ? _e + "&" : ""}${ce}` + ); + ve = e(Ae), ve.onmessage = async function(Oe) { + const We = JSON.parse(Oe.data), { type: Ue, status: Z, data: j } = handle_message( + We, + A[X] + ); + if (Ue === "update" && Z && !Le) + Be({ + type: "status", + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date(), + ...Z + }), Z.stage === "error" && ve.close(); + else if (Ue === "data") { + be = We.event_id; + let [ee, ge] = await r( + `${C.root}/queue/data`, + { + ...Ce, + session_hash: o, + event_id: be + }, + c + ); + ge !== 200 && (Be({ + type: "status", + stage: "error", + message: BROKEN_CONNECTION_MSG, + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }), ve.close()); + } else + Ue === "complete" ? Le = Z : Ue === "log" ? Be({ + type: "log", + log: j.log, + level: j.level, + endpoint: le, + fn_index: X + }) : Ue === "generating" && Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...Z, + stage: Z == null ? void 0 : Z.stage, + queue: !0, + endpoint: le, + fn_index: X + }); + j && (Be({ + type: "data", + time: /* @__PURE__ */ new Date(), + data: j.data, + endpoint: le, + fn_index: X + }), Le && (Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...Le, + stage: Z == null ? void 0 : Z.stage, + queue: !0, + endpoint: le, + fn_index: X + }), ve.close())); + }; + } else + (se == "sse_v1" || se == "sse_v2" || se == "sse_v2.1") && (Be({ + type: "status", + stage: "pending", + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }), r( + `${C.root}/queue/join?${_e}`, + { + ...Ce, + session_hash: o + }, + c + ).then(([Ae, Oe]) => { + if (Oe === 503) + Be({ + type: "status", + stage: "error", + message: QUEUE_FULL_MSG, + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + else if (Oe !== 200) + Be({ + type: "status", + stage: "error", + message: BROKEN_CONNECTION_MSG, + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + else { + be = Ae.event_id; + let We = async function(Ue) { + try { + const { type: Z, status: j, data: ee } = handle_message( + Ue, + A[X] + ); + if (Z == "heartbeat") + return; + if (Z === "update" && j && !Le) + Be({ + type: "status", + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date(), + ...j + }); + else if (Z === "complete") + Le = j; + else if (Z == "unexpected_error") + console.error("Unexpected error", j == null ? void 0 : j.message), Be({ + type: "status", + stage: "error", + message: (j == null ? void 0 : j.message) || "An Unexpected Error Occurred!", + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }); + else if (Z === "log") { + Be({ + type: "log", + log: ee.log, + level: ee.level, + endpoint: le, + fn_index: X + }); + return; + } else + Z === "generating" && (Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...j, + stage: j == null ? void 0 : j.stage, + queue: !0, + endpoint: le, + fn_index: X + }), ee && (se === "sse_v2" || se === "sse_v2.1") && Ee(be, ee)); + ee && (Be({ + type: "data", + time: /* @__PURE__ */ new Date(), + data: ee.data, + endpoint: le, + fn_index: X + }), Le && Be({ + type: "status", + time: /* @__PURE__ */ new Date(), + ...Le, + stage: j == null ? void 0 : j.stage, + queue: !0, + endpoint: le, + fn_index: X + })), ((j == null ? void 0 : j.stage) === "complete" || (j == null ? void 0 : j.stage) === "error") && (g[be] && delete g[be], be in a && delete a[be]); + } catch (Z) { + console.error("Unexpected client exception", Z), Be({ + type: "status", + stage: "error", + message: "An Unexpected Error Occurred!", + queue: !0, + endpoint: le, + fn_index: X, + time: /* @__PURE__ */ new Date() + }), R(); + } + }; + be in v && (v[be].forEach( + (Ue) => We(Ue) + ), delete v[be]), g[be] = We, M.add(be), p || N(); + } + })); + } + ); + function Ee(de, ce) { + !a[de] ? (a[de] = [], ce.data.forEach((Oe, We) => { + a[de][We] = Oe; + })) : ce.data.forEach((Oe, We) => { + let Ue = apply_diff( + a[de][We], + Oe + ); + a[de][We] = Ue, ce.data[We] = Ue; + }); + } + function Be(de) { + const Ae = ae[de.type] || []; + Ae == null || Ae.forEach((Oe) => Oe(de)); + } + function Ne(de, ce) { + const Ae = ae, Oe = Ae[de] || []; + return Ae[de] = Oe, Oe == null || Oe.push(ce), { on: Ne, off: Ge, cancel: ke, destroy: pe }; + } + function Ge(de, ce) { + const Ae = ae; + let Oe = Ae[de] || []; + return Oe = Oe == null ? void 0 : Oe.filter((We) => We !== ce), Ae[de] = Oe, { on: Ne, off: Ge, cancel: ke, destroy: pe }; + } + async function ke() { + const de = { + stage: "complete", + queue: !1, + time: /* @__PURE__ */ new Date() + }; + Le = de, Be({ + ...de, + type: "status", + endpoint: le, + fn_index: X + }); + let ce = {}; + se === "ws" ? (te && te.readyState === 0 ? te.addEventListener("open", () => { + te.close(); + }) : te.close(), ce = { fn_index: X, session_hash: o }) : (ve.close(), ce = { event_id: be }); + try { + await t(`${C.root}/reset`, { + headers: { "Content-Type": "application/json" }, + method: "POST", + body: JSON.stringify(ce) + }); + } catch { + console.warn( + "The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable." + ); + } + } + function pe() { + for (const de in ae) + ae[de].forEach((ce) => { + Ge(de, ce); + }); + } + return { + on: Ne, + off: Ge, + cancel: ke, + destroy: pe + }; + } + function N() { + p = !0; + let G = new URLSearchParams({ + session_hash: o + }).toString(), F = new URL(`${C.root}/queue/data?${G}`); + l = e(F), l.onmessage = async function(V) { + let J = JSON.parse(V.data); + const X = J.event_id; + if (!X) + await Promise.all( + Object.keys(g).map( + (oe) => g[oe](J) + ) + ); + else if (g[X]) { + J.msg === "process_completed" && (M.delete(X), M.size === 0 && R()); + let oe = g[X]; + window.setTimeout(oe, 0, J); + } else + v[X] || (v[X] = []), v[X].push(J); + }, l.onerror = async function(V) { + await Promise.all( + Object.keys(g).map( + (J) => g[J]({ + msg: "unexpected_error", + message: BROKEN_CONNECTION_MSG + }) + ) + ), R(); + }; + } + function R() { + p = !1, l == null || l.close(); + } + async function U(G, F, V) { + var J; + const X = { "Content-Type": "application/json" }; + c && (X.Authorization = `Bearer ${c}`); + let oe, te = C.components.find( + (le) => le.id === G + ); + (J = te == null ? void 0 : te.props) != null && J.root_url ? oe = te.props.root_url : oe = C.root; + const ve = await t( + `${oe}/component_server/`, + { + method: "POST", + body: JSON.stringify({ + data: V, + component_id: G, + fn_name: F, + session_hash: o + }), + headers: X + } + ); + if (!ve.ok) + throw new Error( + "Could not connect to component server: " + ve.statusText + ); + return await ve.json(); + } + async function W(G) { + if (B) + return B; + const F = { "Content-Type": "application/json" }; + c && (F.Authorization = `Bearer ${c}`); + let V; + if (semiver(G.version || "2.0.0", "3.30") < 0 ? V = await t( + "https://gradio-space-api-fetcher-v2.hf.space/api", + { + method: "POST", + body: JSON.stringify({ + serialize: !1, + config: JSON.stringify(G) + }), + headers: F + } + ) : V = await t(`${G.root}/info`, { + headers: F + }), !V.ok) + throw new Error(BROKEN_CONNECTION_MSG); + let J = await V.json(); + return "api" in J && (J = J.api), J.named_endpoints["/predict"] && !J.unnamed_endpoints[0] && (J.unnamed_endpoints[0] = J.named_endpoints["/predict"]), transform_api_info(J, G, T); + } + }); + } + async function u(b, h, _, E) { + const c = await walk_and_store_blobs( + h, + void 0, + [], + !0, + _ + ); + return Promise.all( + c.map(async ({ path: S, blob: y, type: w }) => { + if (y) { + const L = (await n(b, [y], E)).files[0]; + return { path: S, file_url: L, type: w, name: y == null ? void 0 : y.name }; + } + return { path: S, type: w }; + }) + ).then((S) => (S.forEach(({ path: y, file_url: w, type: L, name: s }) => { + if (L === "Gallery") + update_object(h, w, y); + else if (w) { + const o = new FileData({ path: w, orig_name: s }); + update_object(h, o, y); + } + }), h)); + } +} +const { post_data, upload_files, client, handle_blob } = api_factory( + fetch, + (...t) => new EventSource(...t) +); +function get_type(t, e, r, n) { + switch (t.type) { + case "string": + return "string"; + case "boolean": + return "boolean"; + case "number": + return "number"; + } + if (r === "JSONSerializable" || r === "StringSerializable") + return "any"; + if (r === "ListStringSerializable") + return "string[]"; + if (e === "Image") + return n === "parameter" ? "Blob | File | Buffer" : "string"; + if (r === "FileSerializable") + return (t == null ? void 0 : t.type) === "array" ? n === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : n === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}"; + if (r === "GallerySerializable") + return n === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; +} +function get_description(t, e) { + return e === "GallerySerializable" ? "array of [file, label] tuples" : e === "ListStringSerializable" ? "array of strings" : e === "FileSerializable" ? "array of files or single file" : t.description; +} +function transform_api_info(t, e, r) { + const n = { + named_endpoints: {}, + unnamed_endpoints: {} + }; + for (const f in t) { + const u = t[f]; + for (const b in u) { + const h = e.dependencies[b] ? b : r[b.replace("/", "")], _ = u[b]; + n[f][b] = {}, n[f][b].parameters = {}, n[f][b].returns = {}, n[f][b].type = e.dependencies[h].types, n[f][b].parameters = _.parameters.map( + ({ label: E, component: c, type: S, serializer: y }) => ({ + label: E, + component: c, + type: get_type(S, c, y, "parameter"), + description: get_description(S, y) + }) + ), n[f][b].returns = _.returns.map( + ({ label: E, component: c, type: S, serializer: y }) => ({ + label: E, + component: c, + type: get_type(S, c, y, "return"), + description: get_description(S, y) + }) + ); + } + } + return n; +} +async function get_jwt(t, e) { + try { + return (await (await fetch(`https://huggingface.co/api/spaces/${t}/jwt`, { + headers: { + Authorization: `Bearer ${e}` + } + })).json()).token || !1; + } catch (r) { + return console.error(r), !1; + } +} +function update_object(t, e, r) { + for (; r.length > 1; ) + t = t[r.shift()]; + t[r.shift()] = e; +} +async function walk_and_store_blobs(t, e = void 0, r = [], n = !1, f = void 0) { + if (Array.isArray(t)) { + let u = []; + return await Promise.all( + t.map(async (b, h) => { + var _; + let E = r.slice(); + E.push(h); + const c = await walk_and_store_blobs( + t[h], + n ? ((_ = f == null ? void 0 : f.parameters[h]) == null ? void 0 : _.component) || void 0 : e, + E, + !1, + f + ); + u = u.concat(c); + }) + ), u; + } else { + if (globalThis.Buffer && t instanceof globalThis.Buffer) + return [ + { + path: r, + blob: e === "Image" ? !1 : new NodeBlob([t]), + type: e + } + ]; + if (typeof t == "object") { + let u = []; + for (let b in t) + if (t.hasOwnProperty(b)) { + let h = r.slice(); + h.push(b), u = u.concat( + await walk_and_store_blobs( + t[b], + void 0, + h, + !1, + f + ) + ); + } + return u; + } + } + return []; +} +function skip_queue(t, e) { + var r, n, f, u; + return !(((n = (r = e == null ? void 0 : e.dependencies) == null ? void 0 : r[t]) == null ? void 0 : n.queue) === null ? e.enable_queue : (u = (f = e == null ? void 0 : e.dependencies) == null ? void 0 : f[t]) != null && u.queue) || !1; +} +async function resolve_config(t, e, r) { + const n = {}; + if (r && (n.Authorization = `Bearer ${r}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { + const f = window.gradio_config.root, u = window.gradio_config; + return u.root = resolve_root(e, u.root, !1), { ...u, path: f }; + } else if (e) { + let f = await t(`${e}/config`, { + headers: n + }); + if (f.status === 200) { + const u = await f.json(); + return u.path = u.path ?? "", u.root = e, u; + } + throw new Error("Could not get config."); + } + throw new Error("No config or app endpoint found"); +} +async function check_space_status(t, e, r) { + let n = e === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${t}` : `https://huggingface.co/api/spaces/${t}`, f, u; + try { + if (f = await fetch(n), u = f.status, u !== 200) + throw new Error(); + f = await f.json(); + } catch { + r({ + status: "error", + load_status: "error", + message: "Could not get space status", + detail: "NOT_FOUND" + }); + return; + } + if (!f || u !== 200) + return; + const { + runtime: { stage: b }, + id: h + } = f; + switch (b) { + case "STOPPED": + case "SLEEPING": + r({ + status: "sleeping", + load_status: "pending", + message: "Space is asleep. Waking it up...", + detail: b + }), setTimeout(() => { + check_space_status(t, e, r); + }, 1e3); + break; + case "PAUSED": + r({ + status: "paused", + 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: b, + discussions_enabled: await discussions_enabled(h) + }); + break; + case "RUNNING": + case "RUNNING_BUILDING": + r({ + status: "running", + load_status: "complete", + message: "", + detail: b + }); + break; + case "BUILDING": + r({ + status: "building", + load_status: "pending", + message: "Space is building...", + detail: b + }), setTimeout(() => { + check_space_status(t, e, r); + }, 1e3); + break; + default: + r({ + status: "space_error", + load_status: "error", + message: "This space is experiencing an issue.", + detail: b, + discussions_enabled: await discussions_enabled(h) + }); + break; + } +} +function handle_message(t, e) { + switch (t.msg) { + case "send_data": + return { type: "data" }; + case "send_hash": + return { type: "hash" }; + case "queue_full": + return { + type: "update", + status: { + queue: !0, + message: QUEUE_FULL_MSG, + stage: "error", + code: t.code, + success: t.success + } + }; + case "heartbeat": + return { + type: "heartbeat" + }; + case "unexpected_error": + return { + type: "unexpected_error", + status: { + queue: !0, + message: t.message, + stage: "error", + success: !1 + } + }; + case "estimation": + return { + type: "update", + status: { + queue: !0, + stage: e || "pending", + code: t.code, + size: t.queue_size, + position: t.rank, + eta: t.rank_eta, + success: t.success + } + }; + case "progress": + return { + type: "update", + status: { + queue: !0, + stage: "pending", + code: t.code, + progress_data: t.progress_data, + success: t.success + } + }; + case "log": + return { type: "log", data: t }; + case "process_generating": + return { + type: "generating", + status: { + queue: !0, + message: t.success ? null : t.output.error, + stage: t.success ? "generating" : "error", + code: t.code, + progress_data: t.progress_data, + eta: t.average_duration + }, + data: t.success ? t.output : null + }; + case "process_completed": + return "error" in t.output ? { + type: "update", + status: { + queue: !0, + message: t.output.error, + stage: "error", + code: t.code, + success: t.success + } + } : { + type: "complete", + status: { + queue: !0, + message: t.success ? void 0 : t.output.error, + stage: t.success ? "complete" : "error", + code: t.code, + progress_data: t.progress_data + }, + data: t.success ? t.output : null + }; + case "process_starts": + return { + type: "update", + status: { + queue: !0, + stage: "pending", + code: t.code, + size: t.rank, + position: 0, + success: t.success, + eta: t.eta + } + }; + } + return { type: "none", status: { stage: "error", queue: !0 } }; +} +const { + SvelteComponent: SvelteComponent$6, + append: append$5, + attr: attr$5, + detach: detach$6, + init: init$6, + insert: insert$6, + noop: noop$4, + safe_not_equal: safe_not_equal$6, + svg_element: svg_element$2 +} = window.__gradio__svelte__internal; +function create_fragment$6(t) { + let e, r, n, f, u, b, h, _, E, c, S, y; + return { + c() { + e = svg_element$2("svg"), r = svg_element$2("defs"), n = svg_element$2("linearGradient"), f = svg_element$2("stop"), u = svg_element$2("stop"), b = svg_element$2("stop"), h = svg_element$2("g"), _ = svg_element$2("g"), E = svg_element$2("path"), c = svg_element$2("animateTransform"), S = svg_element$2("circle"), y = svg_element$2("animateTransform"), attr$5(f, "stop-color", "#FF7C00"), attr$5(f, "stop-opacity", "0"), attr$5(f, "offset", "0%"), attr$5(u, "stop-color", "#FF7C00"), attr$5(u, "stop-opacity", ".631"), attr$5(u, "offset", "63.146%"), attr$5(b, "stop-color", "#FF7C00"), attr$5(b, "offset", "100%"), attr$5(n, "x1", "8.042%"), attr$5(n, "y1", "0%"), attr$5(n, "x2", "65.682%"), attr$5(n, "y2", "23.865%"), attr$5(n, "id", "a"), attr$5(c, "attributeName", "transform"), attr$5(c, "type", "rotate"), attr$5(c, "from", "0 18 18"), attr$5(c, "to", "360 18 18"), attr$5(c, "dur", "0.9s"), attr$5(c, "repeatCount", "indefinite"), attr$5(E, "d", "M36 18c0-9.94-8.06-18-18-18"), attr$5(E, "id", "Oval-2"), attr$5(E, "stroke", "url(#a)"), attr$5(E, "stroke-width", "2"), attr$5(y, "attributeName", "transform"), attr$5(y, "type", "rotate"), attr$5(y, "from", "0 18 18"), attr$5(y, "to", "360 18 18"), attr$5(y, "dur", "0.9s"), attr$5(y, "repeatCount", "indefinite"), attr$5(S, "fill", "#FFf"), attr$5(S, "cx", "36"), attr$5(S, "cy", "18"), attr$5(S, "r", "1"), attr$5(_, "transform", "translate(1 1)"), attr$5(h, "fill", "none"), attr$5(h, "fill-rule", "evenodd"), attr$5(e, "width", "20"), attr$5(e, "height", "20 "), attr$5(e, "viewBox", "0 0 38 38"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg"); + }, + m(w, L) { + insert$6(w, e, L), append$5(e, r), append$5(r, n), append$5(n, f), append$5(n, u), append$5(n, b), append$5(e, h), append$5(h, _), append$5(_, E), append$5(E, c), append$5(_, S), append$5(S, y); + }, + p: noop$4, + i: noop$4, + o: noop$4, + d(w) { + w && detach$6(e); + } + }; +} +class Loading_spinner extends SvelteComponent$6 { + constructor(e) { + super(), init$6(this, e, null, create_fragment$6, safe_not_equal$6, {}); + } +} +const FileRetrieval_svelte_svelte_type_style_lang = "", { + SvelteComponent: SvelteComponent$5, + append: append$4, + attr: attr$4, + check_outros: check_outros$3, + create_component: create_component$3, + destroy_component: destroy_component$3, + detach: detach$5, + element: element$4, + group_outros: group_outros$3, + init: init$5, + insert: insert$5, + listen, + mount_component: mount_component$3, + noop: noop$3, + run_all, + safe_not_equal: safe_not_equal$5, + set_input_value, + space: space$3, + transition_in: transition_in$3, + transition_out: transition_out$3 +} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1, tick: tick$2, getContext } = window.__gradio__svelte__internal; +function create_else_block$3(t) { + let e; + return { + c() { + e = element$4("span"), e.textContent = "Fetch"; + }, + m(r, n) { + insert$5(r, e, n); + }, + i: noop$3, + o: noop$3, + d(r) { + r && detach$5(e); + } + }; +} +function create_if_block$3(t) { + let e, r; + return e = new Loading_spinner({}), { + c() { + create_component$3(e.$$.fragment); + }, + m(n, f) { + mount_component$3(e, n, f), r = !0; + }, + i(n) { + r || (transition_in$3(e.$$.fragment, n), r = !0); + }, + o(n) { + transition_out$3(e.$$.fragment, n), r = !1; + }, + d(n) { + destroy_component$3(e, n); + } + }; +} +function create_fragment$5(t) { + let e, r, n, f, u, b, h, _, E, c, S, y, w, L, s, o, A, p; + const v = [create_if_block$3, create_else_block$3], a = []; + function l(g, M) { + return ( + /*loading*/ + g[1] ? 0 : 1 + ); + } + return y = l(t), w = a[y] = v[y](t), { + c() { + e = element$4("div"), r = element$4("div"), n = element$4("input"), f = space$3(), u = element$4("select"), b = element$4("option"), b.textContent = "PDB Assym. Unit", h = element$4("option"), h.textContent = "PDB BioAssembly", _ = element$4("option"), _.textContent = "AlphaFold DB", E = element$4("option"), E.textContent = "ESMFold DB", c = space$3(), S = element$4("button"), w.c(), L = space$3(), s = element$4("span"), s.textContent = "- or -", attr$4(n, "type", "text"), attr$4( n, "placeholder", /*placeholder*/ - r[2] - ), attr$4(n, "class", "wfull inp svelte-18kpwjt"), y.__value = "pdb_assym", set_input_value(y, y.__value), h.__value = "pdb_bioass", set_input_value(h, h.__value), _.__value = "af", set_input_value(_, _.__value), E.__value = "esm", set_input_value(E, E.__value), attr$4(u, "name", ""), attr$4(u, "id", ""), attr$4(u, "class", "select svelte-18kpwjt"), attr$4(t, "class", "flex input wfull svelte-18kpwjt"), attr$4(C, "class", "btn text-center svelte-18kpwjt"), attr$4(e, "class", "flex mt-2 svelte-18kpwjt"), attr$4(s, "class", "or py svelte-18kpwjt"); + t[2] + ), attr$4(n, "class", "wfull inp svelte-18kpwjt"), b.__value = "pdb_assym", set_input_value(b, b.__value), h.__value = "pdb_bioass", set_input_value(h, h.__value), _.__value = "af", set_input_value(_, _.__value), E.__value = "esm", set_input_value(E, E.__value), attr$4(u, "name", ""), attr$4(u, "id", ""), attr$4(u, "class", "select svelte-18kpwjt"), attr$4(r, "class", "flex input wfull svelte-18kpwjt"), attr$4(S, "class", "btn text-center svelte-18kpwjt"), attr$4(e, "class", "flex mt-2 svelte-18kpwjt"), attr$4(s, "class", "or py svelte-18kpwjt"); }, m(g, M) { - insert$5(g, e, M), append$4(e, t), append$4(t, n), set_input_value( + insert$5(g, e, M), append$4(e, r), append$4(r, n), set_input_value( n, /*textInput*/ - r[3] - ), append$4(t, f), append$4(t, u), append$4(u, y), append$4(u, h), append$4(u, _), append$4(u, E), append$4(e, c), append$4(e, C), a[b].m(C, null), insert$5(g, S, M), insert$5(g, s, M), o = !0, w || (p = [ + t[3] + ), append$4(r, f), append$4(r, u), append$4(u, b), append$4(u, h), append$4(u, _), append$4(u, E), append$4(e, c), append$4(e, S), a[y].m(S, null), insert$5(g, L, M), insert$5(g, s, M), o = !0, A || (p = [ listen( n, "input", /*input_input_handler*/ - r[8] + t[8] ), listen( n, "keydown", /*isEnterPressed*/ - r[6] + t[6] ), listen( u, "change", /*handleSelect*/ - r[5] + t[5] ), listen( - C, + S, "click", /*click_handler*/ - r[9] + t[9] ) - ], w = !0); + ], A = !0); }, p(g, [M]) { (!o || M & /*placeholder*/ @@ -31596,29 +32740,30 @@ function create_fragment$5(r) { /*textInput*/ g[3] ); - let L = b; - b = l(g), b !== L && (group_outros$3(), transition_out$3(a[L], 1, 1, () => { - a[L] = null; - }), check_outros$3(), A = a[b], A || (A = a[b] = v[b](g), A.c()), transition_in$3(A, 1), A.m(C, null)); + let C = y; + y = l(g), y !== C && (group_outros$3(), transition_out$3(a[C], 1, 1, () => { + a[C] = null; + }), check_outros$3(), w = a[y], w || (w = a[y] = v[y](g), w.c()), transition_in$3(w, 1), w.m(S, null)); }, i(g) { - o || (transition_in$3(A), o = !0); + o || (transition_in$3(w), o = !0); }, o(g) { - transition_out$3(A), o = !1; + transition_out$3(w), o = !1; }, d(g) { - g && (detach$5(e), detach$5(S), detach$5(s)), a[b].d(), w = !1, run_all(p); + g && (detach$5(e), detach$5(L), detach$5(s)), a[y].d(), A = !1, run_all(p); } }; } -function instance$5(r, e, t) { +function instance$5(t, e, r) { let n; - const f = createEventDispatcher$1(); - let { root: u } = e; - const y = getContext("upload_files"); + const f = createEventDispatcher$1(), u = getContext("upload_files"); + let { root: b } = e; async function h(p) { - await tick$2(), n = await upload(p, u, y), n[0].orig_name = p.name, n[0].size = p.size, f("load", n); + await tick$2(); + const v = Math.random().toString(36).substring(2, 15); + console.log("file to upload", p), n = await upload([p], b, v, u), console.log("uploaded files", n[0]), f("load", n[0]); } let _ = !1; async function E(p, v) { @@ -31640,60 +32785,60 @@ function instance$5(r, e, t) { ext: ".pdb" } }, l = a[v].url, g = a[v].ext; - t(1, _ = !0); + r(1, _ = !0); let M = null; try { M = await fetch(l + p + g).then((T) => { - if (t(1, _ = !1), T.status == 200) { - let D = T.blob(); - return D.name = p + g, D; - } else - f("notfound"); - }); + if (r(1, _ = !1), T.status == 200) + return T.blob(); + f("notfound"); + }).then((T) => new File([T], p + g, { type: "text/plain" })); } catch { - t(1, _ = !1), f("notfound"); + r(1, _ = !1), f("notfound"); } - let L = { - name: p + ".pdb", + let C = new FileData({ + path: p + ".pdb", + orig_name: p + ".pdb", + blob: M, size: M.size, - data: "", - blob: M - }; - await h(L); + mime_type: M.type, + is_stream: !1 + }); + await h(C); } - let c = "pdb_assym", C = "", b = ""; - function A(p) { - t(0, c = p.target.value); + let c = "pdb_assym", S = "", y = ""; + function w(p) { + r(0, c = p.target.value); } - let S = { + let L = { pdb_assym: "Enter PDB identifier", pdb_bioass: "Enter PDB identifier", af: "Enter UniProt identifier", esm: "Enter MGnify protein identifier" }; function s(p) { - p.key === "Enter" && E(b, c); + p.key === "Enter" && (console.log("Enter pressed"), console.log(y), console.log(c), E(y, c)); } function o() { - b = this.value, t(3, b); + y = this.value, r(3, y); } - const w = () => E(b, c); - return r.$$set = (p) => { - "root" in p && t(7, u = p.root); - }, r.$$.update = () => { - r.$$.dirty & /*selectedValue*/ - 1 && t(2, C = S[c]); + const A = () => E(y, c); + return t.$$set = (p) => { + "root" in p && r(7, b = p.root); + }, t.$$.update = () => { + t.$$.dirty & /*selectedValue*/ + 1 && r(2, S = L[c]); }, [ c, _, - C, - b, + S, + y, E, - A, + w, s, - u, + b, o, - w + A ]; } class FileRetrieval extends SvelteComponent$5 { @@ -31725,69 +32870,69 @@ const { transition_out: transition_out$2, update_slot_base: update_slot_base$1 } = window.__gradio__svelte__internal, { createEventDispatcher, tick: tick$1 } = window.__gradio__svelte__internal; -function create_else_block$2(r) { - let e, t, n, f, u; +function create_else_block$2(t) { + let e, r, n, f, u; e = new FileRetrieval({ props: { root: ( /*root*/ - r[5] + t[5] ) } }), e.$on( "load", /*handle_upload*/ - r[15] + t[15] ), e.$on( "notfound", /*notfound_handler*/ - r[21] + t[21] ); - function y(_) { - r[22](_); + function b(_) { + t[22](_); } let h = { filetype: ( /*accept_file_types*/ - r[14] + t[14] ), file_count: ( /*file_count*/ - r[3] + t[3] ), root: ( /*root*/ - r[5] + t[5] ), $$slots: { default: [create_default_slot$1] }, - $$scope: { ctx: r } + $$scope: { ctx: t } }; return ( /*dragging*/ - r[13] !== void 0 && (h.dragging = /*dragging*/ - r[13]), n = new Upload({ props: h }), binding_callbacks$1.push(() => bind(n, "dragging", y)), n.$on( + t[13] !== void 0 && (h.dragging = /*dragging*/ + t[13]), n = new Upload({ props: h }), binding_callbacks$1.push(() => bind(n, "dragging", b)), n.$on( "load", /*handle_upload*/ - r[15] + t[15] ), { c() { - create_component$2(e.$$.fragment), t = space$2(), create_component$2(n.$$.fragment); + create_component$2(e.$$.fragment), r = space$2(), create_component$2(n.$$.fragment); }, m(_, E) { - mount_component$2(e, _, E), insert$4(_, t, E), mount_component$2(n, _, E), u = !0; + mount_component$2(e, _, E), insert$4(_, r, E), mount_component$2(n, _, E), u = !0; }, p(_, E) { const c = {}; E & /*root*/ 32 && (c.root = /*root*/ _[5]), e.$set(c); - const C = {}; + const S = {}; E & /*accept_file_types*/ - 16384 && (C.filetype = /*accept_file_types*/ + 16384 && (S.filetype = /*accept_file_types*/ _[14]), E & /*file_count*/ - 8 && (C.file_count = /*file_count*/ + 8 && (S.file_count = /*file_count*/ _[3]), E & /*root*/ - 32 && (C.root = /*root*/ + 32 && (S.root = /*root*/ _[5]), E & /*$$scope*/ - 8388608 && (C.$$scope = { dirty: E, ctx: _ }), !f && E & /*dragging*/ - 8192 && (f = !0, C.dragging = /*dragging*/ - _[13], add_flush_callback(() => f = !1)), n.$set(C); + 8388608 && (S.$$scope = { dirty: E, ctx: _ }), !f && E & /*dragging*/ + 8192 && (f = !0, S.dragging = /*dragging*/ + _[13], add_flush_callback(() => f = !1)), n.$set(S); }, i(_) { u || (transition_in$2(e.$$.fragment, _), transition_in$2(n.$$.fragment, _), u = !0); @@ -31796,73 +32941,73 @@ function create_else_block$2(r) { transition_out$2(e.$$.fragment, _), transition_out$2(n.$$.fragment, _), u = !1; }, d(_) { - _ && detach$4(t), destroy_component$2(e, _), destroy_component$2(n, _); + _ && detach$4(r), destroy_component$2(e, _), destroy_component$2(n, _); } } ); } -function create_if_block$2(r) { - let e, t, n, f, u, y; +function create_if_block$2(t) { + let e, r, n, f, u, b; e = new ModifyUpload({ props: { i18n: ( /*i18n*/ - r[7] + t[7] ), absolute: !0 } }), e.$on( "clear", /*handle_clear*/ - r[16] + t[16] ), n = new FilePreview({ props: { i18n: ( /*i18n*/ - r[7] + t[7] ), selectable: ( /*selectable*/ - r[4] + t[4] ), value: ( /*value*/ - r[0] + t[0] ), height: ( /*height*/ - r[6] + t[6] ) } }), n.$on( "select", /*select_handler*/ - r[20] + t[20] ); let h = ( /*moldata*/ - r[11] != null && /*molviewer*/ - r[12] && create_if_block_1$2(r) + t[11] != null && /*molviewer*/ + t[12] && create_if_block_1$2(t) ); return { c() { - create_component$2(e.$$.fragment), t = space$2(), create_component$2(n.$$.fragment), f = space$2(), h && h.c(), u = empty$2(); + create_component$2(e.$$.fragment), r = space$2(), create_component$2(n.$$.fragment), f = space$2(), h && h.c(), u = empty$2(); }, m(_, E) { - mount_component$2(e, _, E), insert$4(_, t, E), mount_component$2(n, _, E), insert$4(_, f, E), h && h.m(_, E), insert$4(_, u, E), y = !0; + mount_component$2(e, _, E), insert$4(_, r, E), mount_component$2(n, _, E), insert$4(_, f, E), h && h.m(_, E), insert$4(_, u, E), b = !0; }, p(_, E) { const c = {}; E & /*i18n*/ 128 && (c.i18n = /*i18n*/ _[7]), e.$set(c); - const C = {}; + const S = {}; E & /*i18n*/ - 128 && (C.i18n = /*i18n*/ + 128 && (S.i18n = /*i18n*/ _[7]), E & /*selectable*/ - 16 && (C.selectable = /*selectable*/ + 16 && (S.selectable = /*selectable*/ _[4]), E & /*value*/ - 1 && (C.value = /*value*/ + 1 && (S.value = /*value*/ _[0]), E & /*height*/ - 64 && (C.height = /*height*/ - _[6]), n.$set(C), /*moldata*/ + 64 && (S.height = /*height*/ + _[6]), n.$set(S), /*moldata*/ _[11] != null && /*molviewer*/ _[12] ? h ? (h.p(_, E), E & /*moldata, molviewer*/ 6144 && transition_in$2(h, 1)) : (h = create_if_block_1$2(_), h.c(), transition_in$2(h, 1), h.m(u.parentNode, u)) : h && (group_outros$2(), transition_out$2(h, 1, 1, () => { @@ -31870,26 +33015,26 @@ function create_if_block$2(r) { }), check_outros$2()); }, i(_) { - y || (transition_in$2(e.$$.fragment, _), transition_in$2(n.$$.fragment, _), transition_in$2(h), y = !0); + b || (transition_in$2(e.$$.fragment, _), transition_in$2(n.$$.fragment, _), transition_in$2(h), b = !0); }, o(_) { - transition_out$2(e.$$.fragment, _), transition_out$2(n.$$.fragment, _), transition_out$2(h), y = !1; + transition_out$2(e.$$.fragment, _), transition_out$2(n.$$.fragment, _), transition_out$2(h), b = !1; }, d(_) { - _ && (detach$4(t), detach$4(f), detach$4(u)), destroy_component$2(e, _), destroy_component$2(n, _), h && h.d(_); + _ && (detach$4(r), detach$4(f), detach$4(u)), destroy_component$2(e, _), destroy_component$2(n, _), h && h.d(_); } }; } -function create_default_slot$1(r) { +function create_default_slot$1(t) { let e; - const t = ( + const r = ( /*#slots*/ - r[19].default + t[19].default ), n = create_slot$1( - t, r, + t, /*$$scope*/ - r[23], + t[23], null ); return { @@ -31903,12 +33048,12 @@ function create_default_slot$1(r) { n && n.p && (!e || u & /*$$scope*/ 8388608) && update_slot_base$1( n, - t, + r, f, /*$$scope*/ f[23], e ? get_slot_changes$1( - t, + r, /*$$scope*/ f[23], u, @@ -31931,25 +33076,25 @@ function create_default_slot$1(r) { } }; } -function create_if_block_1$2(r) { - let e, t; +function create_if_block_1$2(t) { + let e, r; return e = new MolecularViewer({ props: { moldata: ( /*moldata*/ - r[11] + t[11] ), config: ( /*config*/ - r[8] + t[8] ), confidenceLabel: ( /*confidenceLabel*/ - r[9] + t[9] ), representations: ( /*representations*/ - r[10] + t[10] ) } }), { @@ -31957,7 +33102,7 @@ function create_if_block_1$2(r) { create_component$2(e.$$.fragment); }, m(n, f) { - mount_component$2(e, n, f), t = !0; + mount_component$2(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -31972,111 +33117,111 @@ function create_if_block_1$2(r) { n[10]), e.$set(u); }, i(n) { - t || (transition_in$2(e.$$.fragment, n), t = !0); + r || (transition_in$2(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$2(e.$$.fragment, n), t = !1; + transition_out$2(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$2(e, n); } }; } -function create_fragment$4(r) { - let e, t, n, f, u, y; +function create_fragment$4(t) { + let e, r, n, f, u, b; e = new BlockLabel({ props: { show_label: ( /*show_label*/ - r[2] + t[2] ), Icon: File$1, float: ( /*value*/ - r[0] === null + t[0] === null ), label: ( /*label*/ - r[1] || "File" + t[1] || "File" ) } }); const h = [create_if_block$2, create_else_block$2], _ = []; - function E(c, C) { + function E(c, S) { return ( /*value*/ c[0] ? 0 : 1 ); } - return n = E(r), f = _[n] = h[n](r), { + return n = E(t), f = _[n] = h[n](t), { c() { - create_component$2(e.$$.fragment), t = space$2(), f.c(), u = empty$2(); - }, - m(c, C) { - mount_component$2(e, c, C), insert$4(c, t, C), _[n].m(c, C), insert$4(c, u, C), y = !0; - }, - p(c, [C]) { - const b = {}; - C & /*show_label*/ - 4 && (b.show_label = /*show_label*/ - c[2]), C & /*value*/ - 1 && (b.float = /*value*/ - c[0] === null), C & /*label*/ - 2 && (b.label = /*label*/ - c[1] || "File"), e.$set(b); - let A = n; - n = E(c), n === A ? _[n].p(c, C) : (group_outros$2(), transition_out$2(_[A], 1, 1, () => { - _[A] = null; - }), check_outros$2(), f = _[n], f ? f.p(c, C) : (f = _[n] = h[n](c), f.c()), transition_in$2(f, 1), f.m(u.parentNode, u)); + create_component$2(e.$$.fragment), r = space$2(), f.c(), u = empty$2(); + }, + m(c, S) { + mount_component$2(e, c, S), insert$4(c, r, S), _[n].m(c, S), insert$4(c, u, S), b = !0; + }, + p(c, [S]) { + const y = {}; + S & /*show_label*/ + 4 && (y.show_label = /*show_label*/ + c[2]), S & /*value*/ + 1 && (y.float = /*value*/ + c[0] === null), S & /*label*/ + 2 && (y.label = /*label*/ + c[1] || "File"), e.$set(y); + let w = n; + n = E(c), n === w ? _[n].p(c, S) : (group_outros$2(), transition_out$2(_[w], 1, 1, () => { + _[w] = null; + }), check_outros$2(), f = _[n], f ? f.p(c, S) : (f = _[n] = h[n](c), f.c()), transition_in$2(f, 1), f.m(u.parentNode, u)); }, i(c) { - y || (transition_in$2(e.$$.fragment, c), transition_in$2(f), y = !0); + b || (transition_in$2(e.$$.fragment, c), transition_in$2(f), b = !0); }, o(c) { - transition_out$2(e.$$.fragment, c), transition_out$2(f), y = !1; + transition_out$2(e.$$.fragment, c), transition_out$2(f), b = !1; }, d(c) { - c && (detach$4(t), detach$4(u)), destroy_component$2(e, c), _[n].d(c); + c && (detach$4(r), detach$4(u)), destroy_component$2(e, c), _[n].d(c); } }; } -function instance$4(r, e, t) { - let { $$slots: n = {}, $$scope: f } = e, { value: u } = e, { label: y } = e, { show_label: h = !0 } = e, { file_count: _ = "single" } = e, { file_types: E = null } = e, { selectable: c = !1 } = e, { root: C } = e, { height: b = void 0 } = e, { i18n: A } = e, { config: S = {} } = e, { confidenceLabel: s = "" } = e, { representations: o = [] } = e, { moldata: w = null } = e, { molviewer: p = !1 } = e; +function instance$4(t, e, r) { + let { $$slots: n = {}, $$scope: f } = e, { value: u } = e, { label: b } = e, { show_label: h = !0 } = e, { file_count: _ = "single" } = e, { file_types: E = null } = e, { selectable: c = !1 } = e, { root: S } = e, { height: y = void 0 } = e, { i18n: w } = e, { config: L = {} } = e, { confidenceLabel: s = "" } = e, { representations: o = [] } = e, { moldata: A = null } = e, { molviewer: p = !1 } = e; async function v({ detail: I }) { - t(0, u = I), await tick$1(), l("change", u), l("upload", I); + r(0, u = I), await tick$1(), l("change", u), l("upload", I); } function a() { - t(0, u = null), l("change", null), l("clear"); + r(0, u = null), l("change", null), l("clear"); } const l = createEventDispatcher(); let g; E == null ? g = null : (E = E.map((I) => I.startsWith(".") ? I : I + "/*"), g = E.join(", ")); let M = !1; - function L(I) { - bubble.call(this, r, I); + function C(I) { + bubble.call(this, t, I); } const T = () => l("notfound"); function D(I) { - M = I, t(13, M); + M = I, r(13, M); } - return r.$$set = (I) => { - "value" in I && t(0, u = I.value), "label" in I && t(1, y = I.label), "show_label" in I && t(2, h = I.show_label), "file_count" in I && t(3, _ = I.file_count), "file_types" in I && t(18, E = I.file_types), "selectable" in I && t(4, c = I.selectable), "root" in I && t(5, C = I.root), "height" in I && t(6, b = I.height), "i18n" in I && t(7, A = I.i18n), "config" in I && t(8, S = I.config), "confidenceLabel" in I && t(9, s = I.confidenceLabel), "representations" in I && t(10, o = I.representations), "moldata" in I && t(11, w = I.moldata), "molviewer" in I && t(12, p = I.molviewer), "$$scope" in I && t(23, f = I.$$scope); - }, r.$$.update = () => { - r.$$.dirty & /*dragging*/ + return t.$$set = (I) => { + "value" in I && r(0, u = I.value), "label" in I && r(1, b = I.label), "show_label" in I && r(2, h = I.show_label), "file_count" in I && r(3, _ = I.file_count), "file_types" in I && r(18, E = I.file_types), "selectable" in I && r(4, c = I.selectable), "root" in I && r(5, S = I.root), "height" in I && r(6, y = I.height), "i18n" in I && r(7, w = I.i18n), "config" in I && r(8, L = I.config), "confidenceLabel" in I && r(9, s = I.confidenceLabel), "representations" in I && r(10, o = I.representations), "moldata" in I && r(11, A = I.moldata), "molviewer" in I && r(12, p = I.molviewer), "$$scope" in I && r(23, f = I.$$scope); + }, t.$$.update = () => { + t.$$.dirty & /*dragging*/ 8192 && l("drag", M); }, [ u, - y, + b, h, _, c, - C, - b, - A, S, + y, + w, + L, s, o, - w, + A, p, M, g, @@ -32085,7 +33230,7 @@ function instance$4(r, e, t) { l, E, n, - L, + C, T, D, f @@ -32111,12 +33256,12 @@ class FileUpload extends SvelteComponent$4 { }); } } -function pretty_si(r) { - let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0; - for (; r > 1e3 && t < e.length - 1; ) - r /= 1e3, t++; - let n = e[t]; - return (Number.isInteger(r) ? r : r.toFixed(1)) + n; +function pretty_si(t) { + let e = ["", "k", "M", "G", "T", "P", "E", "Z"], r = 0; + for (; t > 1e3 && r < e.length - 1; ) + t /= 1e3, r++; + let n = e[r]; + return (Number.isInteger(t) ? t : t.toFixed(1)) + n; } const Loader_svelte_svelte_type_style_lang = "", { SvelteComponent: SvelteComponent$3, @@ -32133,65 +33278,65 @@ const Loader_svelte_svelte_type_style_lang = "", { svg_element: svg_element$1, toggle_class: toggle_class$2 } = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal; -function create_fragment$3(r) { - let e, t, n, f, u, y, h, _, E, c, C, b; +function create_fragment$3(t) { + let e, r, n, f, u, b, h, _, E, c, S, y; return { c() { - e = element$3("div"), t = svg_element$1("svg"), n = svg_element$1("g"), f = svg_element$1("path"), u = svg_element$1("path"), y = svg_element$1("path"), h = svg_element$1("path"), _ = svg_element$1("g"), E = svg_element$1("path"), c = svg_element$1("path"), C = svg_element$1("path"), b = svg_element$1("path"), attr$3(f, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "fill-opacity", "0.4"), attr$3(f, "class", "svelte-43sxxs"), attr$3(u, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(u, "fill", "#FF7C00"), attr$3(u, "class", "svelte-43sxxs"), attr$3(y, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "fill-opacity", "0.4"), attr$3(y, "class", "svelte-43sxxs"), attr$3(h, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "class", "svelte-43sxxs"), set_style$1(n, "transform", "translate(" + /*$top*/ - r[1][0] + "px, " + /*$top*/ - r[1][1] + "px)"), attr$3(E, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(E, "fill", "#FF7C00"), attr$3(E, "fill-opacity", "0.4"), attr$3(E, "class", "svelte-43sxxs"), attr$3(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(c, "fill", "#FF7C00"), attr$3(c, "class", "svelte-43sxxs"), attr$3(C, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(C, "fill", "#FF7C00"), attr$3(C, "fill-opacity", "0.4"), attr$3(C, "class", "svelte-43sxxs"), attr$3(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(b, "fill", "#FF7C00"), attr$3(b, "class", "svelte-43sxxs"), set_style$1(_, "transform", "translate(" + /*$bottom*/ - r[2][0] + "px, " + /*$bottom*/ - r[2][1] + "px)"), attr$3(t, "viewBox", "-1200 -1200 3000 3000"), attr$3(t, "fill", "none"), attr$3(t, "xmlns", "http://www.w3.org/2000/svg"), attr$3(t, "class", "svelte-43sxxs"), attr$3(e, "class", "svelte-43sxxs"), toggle_class$2( + e = element$3("div"), r = svg_element$1("svg"), n = svg_element$1("g"), f = svg_element$1("path"), u = svg_element$1("path"), b = svg_element$1("path"), h = svg_element$1("path"), _ = svg_element$1("g"), E = svg_element$1("path"), c = svg_element$1("path"), S = svg_element$1("path"), y = svg_element$1("path"), attr$3(f, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "fill-opacity", "0.4"), attr$3(f, "class", "svelte-43sxxs"), attr$3(u, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(u, "fill", "#FF7C00"), attr$3(u, "class", "svelte-43sxxs"), attr$3(b, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(b, "fill", "#FF7C00"), attr$3(b, "fill-opacity", "0.4"), attr$3(b, "class", "svelte-43sxxs"), attr$3(h, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "class", "svelte-43sxxs"), set_style$1(n, "transform", "translate(" + /*$top*/ + t[1][0] + "px, " + /*$top*/ + t[1][1] + "px)"), attr$3(E, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(E, "fill", "#FF7C00"), attr$3(E, "fill-opacity", "0.4"), attr$3(E, "class", "svelte-43sxxs"), attr$3(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(c, "fill", "#FF7C00"), attr$3(c, "class", "svelte-43sxxs"), attr$3(S, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(S, "fill", "#FF7C00"), attr$3(S, "fill-opacity", "0.4"), attr$3(S, "class", "svelte-43sxxs"), attr$3(y, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "class", "svelte-43sxxs"), set_style$1(_, "transform", "translate(" + /*$bottom*/ + t[2][0] + "px, " + /*$bottom*/ + t[2][1] + "px)"), attr$3(r, "viewBox", "-1200 -1200 3000 3000"), attr$3(r, "fill", "none"), attr$3(r, "xmlns", "http://www.w3.org/2000/svg"), attr$3(r, "class", "svelte-43sxxs"), attr$3(e, "class", "svelte-43sxxs"), toggle_class$2( e, "margin", /*margin*/ - r[0] + t[0] ); }, - m(A, S) { - insert$3(A, e, S), append$3(e, t), append$3(t, n), append$3(n, f), append$3(n, u), append$3(n, y), append$3(n, h), append$3(t, _), append$3(_, E), append$3(_, c), append$3(_, C), append$3(_, b); + m(w, L) { + insert$3(w, e, L), append$3(e, r), append$3(r, n), append$3(n, f), append$3(n, u), append$3(n, b), append$3(n, h), append$3(r, _), append$3(_, E), append$3(_, c), append$3(_, S), append$3(_, y); }, - p(A, [S]) { - S & /*$top*/ + p(w, [L]) { + L & /*$top*/ 2 && set_style$1(n, "transform", "translate(" + /*$top*/ - A[1][0] + "px, " + /*$top*/ - A[1][1] + "px)"), S & /*$bottom*/ + w[1][0] + "px, " + /*$top*/ + w[1][1] + "px)"), L & /*$bottom*/ 4 && set_style$1(_, "transform", "translate(" + /*$bottom*/ - A[2][0] + "px, " + /*$bottom*/ - A[2][1] + "px)"), S & /*margin*/ + w[2][0] + "px, " + /*$bottom*/ + w[2][1] + "px)"), L & /*margin*/ 1 && toggle_class$2( e, "margin", /*margin*/ - A[0] + w[0] ); }, i: noop$2, o: noop$2, - d(A) { - A && detach$3(e); + d(w) { + w && detach$3(e); } }; } -function instance$3(r, e, t) { +function instance$3(t, e, r) { let n, f, { margin: u = !0 } = e; - const y = spring([0, 0]); - component_subscribe(r, y, (b) => t(1, n = b)); + const b = spring([0, 0]); + component_subscribe(t, b, (y) => r(1, n = y)); const h = spring([0, 0]); - component_subscribe(r, h, (b) => t(2, f = b)); + component_subscribe(t, h, (y) => r(2, f = y)); let _; async function E() { - await Promise.all([y.set([125, 140]), h.set([-125, -140])]), await Promise.all([y.set([-125, 140]), h.set([125, -140])]), await Promise.all([y.set([-125, 0]), h.set([125, -0])]), await Promise.all([y.set([125, 0]), h.set([-125, 0])]); + await Promise.all([b.set([125, 140]), h.set([-125, -140])]), await Promise.all([b.set([-125, 140]), h.set([125, -140])]), await Promise.all([b.set([-125, 0]), h.set([125, -0])]), await Promise.all([b.set([125, 0]), h.set([-125, 0])]); } async function c() { await E(), _ || c(); } - async function C() { - await Promise.all([y.set([125, 0]), h.set([-125, 0])]), c(); + async function S() { + await Promise.all([b.set([125, 0]), h.set([-125, 0])]), c(); } - return onMount(() => (C(), () => _ = !0)), r.$$set = (b) => { - "margin" in b && t(0, u = b.margin); - }, [u, n, f, y, h]; + return onMount(() => (S(), () => _ = !0)), t.$$set = (y) => { + "margin" in y && r(0, u = y.margin); + }, [u, n, f, b, h]; } class Loader extends SvelteComponent$3 { constructor(e) { @@ -32228,49 +33373,49 @@ const index_svelte_svelte_type_style_lang = "", { transition_in: transition_in$1, transition_out: transition_out$1, update_slot_base -} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, get_error_slot_changes = (r) => ({}), get_error_slot_context = (r) => ({}); -function get_each_context$1(r, e, t) { - const n = r.slice(); - return n[38] = e[t], n[40] = t, n; +} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, get_error_slot_changes = (t) => ({}), get_error_slot_context = (t) => ({}); +function get_each_context$1(t, e, r) { + const n = t.slice(); + return n[38] = e[r], n[40] = r, n; } -function get_each_context_1(r, e, t) { - const n = r.slice(); - return n[38] = e[t], n; +function get_each_context_1(t, e, r) { + const n = t.slice(); + return n[38] = e[r], n; } -function create_if_block_17(r) { - let e, t = ( +function create_if_block_17(t) { + let e, r = ( /*i18n*/ - r[1]("common.error") + "" + t[1]("common.error") + "" ), n, f, u; - const y = ( + const b = ( /*#slots*/ - r[29].error + t[29].error ), h = create_slot( - y, - r, + b, + t, /*$$scope*/ - r[28], + t[28], get_error_slot_context ); return { c() { - e = element$2("span"), n = text$2(t), f = space$1(), h && h.c(), attr$2(e, "class", "error svelte-14miwb5"); + e = element$2("span"), n = text$2(r), f = space$1(), h && h.c(), attr$2(e, "class", "error svelte-14miwb5"); }, m(_, E) { insert$2(_, e, E), append$2(e, n), insert$2(_, f, E), h && h.m(_, E), u = !0; }, p(_, E) { (!u || E[0] & /*i18n*/ - 2) && t !== (t = /*i18n*/ - _[1]("common.error") + "") && set_data$2(n, t), h && h.p && (!u || E[0] & /*$$scope*/ + 2) && r !== (r = /*i18n*/ + _[1]("common.error") + "") && set_data$2(n, r), h && h.p && (!u || E[0] & /*$$scope*/ 268435456) && update_slot_base( h, - y, + b, _, /*$$scope*/ _[28], u ? get_slot_changes( - y, + b, /*$$scope*/ _[28], E, @@ -32293,14 +33438,14 @@ function create_if_block_17(r) { } }; } -function create_if_block$1(r) { - let e, t, n, f, u, y, h, _, E, c = ( +function create_if_block$1(t) { + let e, r, n, f, u, b, h, _, E, c = ( /*variant*/ - r[8] === "default" && /*show_eta_bar*/ - r[18] && /*show_progress*/ - r[6] === "full" && create_if_block_16(r) + t[8] === "default" && /*show_eta_bar*/ + t[18] && /*show_progress*/ + t[6] === "full" && create_if_block_16(t) ); - function C(v, a) { + function S(v, a) { if ( /*progress*/ v[7] @@ -32319,12 +33464,12 @@ function create_if_block$1(r) { ) return create_if_block_15; } - let b = C(r), A = b && b(r), S = ( + let y = S(t), w = y && y(t), L = ( /*timer*/ - r[5] && create_if_block_10(r) + t[5] && create_if_block_10(t) ); const s = [create_if_block_2, create_if_block_9], o = []; - function w(v, a) { + function A(v, a) { return ( /*last_progress_level*/ v[15] != null ? 0 : ( @@ -32333,115 +33478,115 @@ function create_if_block$1(r) { ) ); } - ~(u = w(r)) && (y = o[u] = s[u](r)); + ~(u = A(t)) && (b = o[u] = s[u](t)); let p = !/*timer*/ - r[5] && create_if_block_1$1(r); + t[5] && create_if_block_1$1(t); return { c() { - c && c.c(), e = space$1(), t = element$2("div"), A && A.c(), n = space$1(), S && S.c(), f = space$1(), y && y.c(), h = space$1(), p && p.c(), _ = empty$1(), attr$2(t, "class", "progress-text svelte-14miwb5"), toggle_class$1( - t, + c && c.c(), e = space$1(), r = element$2("div"), w && w.c(), n = space$1(), L && L.c(), f = space$1(), b && b.c(), h = space$1(), p && p.c(), _ = empty$1(), attr$2(r, "class", "progress-text svelte-14miwb5"), toggle_class$1( + r, "meta-text-center", /*variant*/ - r[8] === "center" + t[8] === "center" ), toggle_class$1( - t, + r, "meta-text", /*variant*/ - r[8] === "default" + t[8] === "default" ); }, m(v, a) { - c && c.m(v, a), insert$2(v, e, a), insert$2(v, t, a), A && A.m(t, null), append$2(t, n), S && S.m(t, null), insert$2(v, f, a), ~u && o[u].m(v, a), insert$2(v, h, a), p && p.m(v, a), insert$2(v, _, a), E = !0; + c && c.m(v, a), insert$2(v, e, a), insert$2(v, r, a), w && w.m(r, null), append$2(r, n), L && L.m(r, null), insert$2(v, f, a), ~u && o[u].m(v, a), insert$2(v, h, a), p && p.m(v, a), insert$2(v, _, a), E = !0; }, p(v, a) { /*variant*/ v[8] === "default" && /*show_eta_bar*/ v[18] && /*show_progress*/ - v[6] === "full" ? c ? c.p(v, a) : (c = create_if_block_16(v), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), b === (b = C(v)) && A ? A.p(v, a) : (A && A.d(1), A = b && b(v), A && (A.c(), A.m(t, n))), /*timer*/ - v[5] ? S ? S.p(v, a) : (S = create_if_block_10(v), S.c(), S.m(t, null)) : S && (S.d(1), S = null), (!E || a[0] & /*variant*/ + v[6] === "full" ? c ? c.p(v, a) : (c = create_if_block_16(v), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), y === (y = S(v)) && w ? w.p(v, a) : (w && w.d(1), w = y && y(v), w && (w.c(), w.m(r, n))), /*timer*/ + v[5] ? L ? L.p(v, a) : (L = create_if_block_10(v), L.c(), L.m(r, null)) : L && (L.d(1), L = null), (!E || a[0] & /*variant*/ 256) && toggle_class$1( - t, + r, "meta-text-center", /*variant*/ v[8] === "center" ), (!E || a[0] & /*variant*/ 256) && toggle_class$1( - t, + r, "meta-text", /*variant*/ v[8] === "default" ); let l = u; - u = w(v), u === l ? ~u && o[u].p(v, a) : (y && (group_outros$1(), transition_out$1(o[l], 1, 1, () => { + u = A(v), u === l ? ~u && o[u].p(v, a) : (b && (group_outros$1(), transition_out$1(o[l], 1, 1, () => { o[l] = null; - }), check_outros$1()), ~u ? (y = o[u], y ? y.p(v, a) : (y = o[u] = s[u](v), y.c()), transition_in$1(y, 1), y.m(h.parentNode, h)) : y = null), /*timer*/ + }), check_outros$1()), ~u ? (b = o[u], b ? b.p(v, a) : (b = o[u] = s[u](v), b.c()), transition_in$1(b, 1), b.m(h.parentNode, h)) : b = null), /*timer*/ v[5] ? p && (p.d(1), p = null) : p ? p.p(v, a) : (p = create_if_block_1$1(v), p.c(), p.m(_.parentNode, _)); }, i(v) { - E || (transition_in$1(y), E = !0); + E || (transition_in$1(b), E = !0); }, o(v) { - transition_out$1(y), E = !1; + transition_out$1(b), E = !1; }, d(v) { - v && (detach$2(e), detach$2(t), detach$2(f), detach$2(h), detach$2(_)), c && c.d(v), A && A.d(), S && S.d(), ~u && o[u].d(v), p && p.d(v); + v && (detach$2(e), detach$2(r), detach$2(f), detach$2(h), detach$2(_)), c && c.d(v), w && w.d(), L && L.d(), ~u && o[u].d(v), p && p.d(v); } }; } -function create_if_block_16(r) { - let e, t = `translateX(${/*eta_level*/ - (r[17] || 0) * 100 - 100}%)`; +function create_if_block_16(t) { + let e, r = `translateX(${/*eta_level*/ + (t[17] || 0) * 100 - 100}%)`; return { c() { - e = element$2("div"), attr$2(e, "class", "eta-bar svelte-14miwb5"), set_style(e, "transform", t); + e = element$2("div"), attr$2(e, "class", "eta-bar svelte-14miwb5"), set_style(e, "transform", r); }, m(n, f) { insert$2(n, e, f); }, p(n, f) { f[0] & /*eta_level*/ - 131072 && t !== (t = `translateX(${/*eta_level*/ - (n[17] || 0) * 100 - 100}%)`) && set_style(e, "transform", t); + 131072 && r !== (r = `translateX(${/*eta_level*/ + (n[17] || 0) * 100 - 100}%)`) && set_style(e, "transform", r); }, d(n) { n && detach$2(e); } }; } -function create_if_block_15(r) { +function create_if_block_15(t) { let e; return { c() { e = text$2("processing |"); }, - m(t, n) { - insert$2(t, e, n); + m(r, n) { + insert$2(r, e, n); }, p: noop$1, - d(t) { - t && detach$2(e); + d(r) { + r && detach$2(e); } }; } -function create_if_block_14(r) { - let e, t = ( +function create_if_block_14(t) { + let e, r = ( /*queue_position*/ - r[2] + 1 + "" - ), n, f, u, y; + t[2] + 1 + "" + ), n, f, u, b; return { c() { - e = text$2("queue: "), n = text$2(t), f = text$2("/"), u = text$2( + e = text$2("queue: "), n = text$2(r), f = text$2("/"), u = text$2( /*queue_size*/ - r[3] - ), y = text$2(" |"); + t[3] + ), b = text$2(" |"); }, m(h, _) { - insert$2(h, e, _), insert$2(h, n, _), insert$2(h, f, _), insert$2(h, u, _), insert$2(h, y, _); + insert$2(h, e, _), insert$2(h, n, _), insert$2(h, f, _), insert$2(h, u, _), insert$2(h, b, _); }, p(h, _) { _[0] & /*queue_position*/ - 4 && t !== (t = /*queue_position*/ - h[2] + 1 + "") && set_data$2(n, t), _[0] & /*queue_size*/ + 4 && r !== (r = /*queue_position*/ + h[2] + 1 + "") && set_data$2(n, r), _[0] & /*queue_size*/ 8 && set_data$2( u, /*queue_size*/ @@ -32449,17 +33594,17 @@ function create_if_block_14(r) { ); }, d(h) { - h && (detach$2(e), detach$2(n), detach$2(f), detach$2(u), detach$2(y)); + h && (detach$2(e), detach$2(n), detach$2(f), detach$2(u), detach$2(b)); } }; } -function create_if_block_11(r) { - let e, t = ensure_array_like$1( +function create_if_block_11(t) { + let e, r = ensure_array_like$1( /*progress*/ - r[7] + t[7] ), n = []; - for (let f = 0; f < t.length; f += 1) - n[f] = create_each_block_1(get_each_context_1(r, t, f)); + for (let f = 0; f < r.length; f += 1) + n[f] = create_each_block_1(get_each_context_1(t, r, f)); return { c() { for (let f = 0; f < n.length; f += 1) @@ -32467,25 +33612,25 @@ function create_if_block_11(r) { e = empty$1(); }, m(f, u) { - for (let y = 0; y < n.length; y += 1) - n[y] && n[y].m(f, u); + for (let b = 0; b < n.length; b += 1) + n[b] && n[b].m(f, u); insert$2(f, e, u); }, p(f, u) { if (u[0] & /*progress*/ 128) { - t = ensure_array_like$1( + r = ensure_array_like$1( /*progress*/ f[7] ); - let y; - for (y = 0; y < t.length; y += 1) { - const h = get_each_context_1(f, t, y); - n[y] ? n[y].p(h, u) : (n[y] = create_each_block_1(h), n[y].c(), n[y].m(e.parentNode, e)); + let b; + for (b = 0; b < r.length; b += 1) { + const h = get_each_context_1(f, r, b); + n[b] ? n[b].p(h, u) : (n[b] = create_each_block_1(h), n[b].c(), n[b].m(e.parentNode, e)); } - for (; y < n.length; y += 1) - n[y].d(1); - n.length = t.length; + for (; b < n.length; b += 1) + n[b].d(1); + n.length = r.length; } }, d(f) { @@ -32493,156 +33638,156 @@ function create_if_block_11(r) { } }; } -function create_if_block_12(r) { - let e, t = ( +function create_if_block_12(t) { + let e, r = ( /*p*/ - r[38].unit + "" - ), n, f, u = " ", y; - function h(c, C) { + t[38].unit + "" + ), n, f, u = " ", b; + function h(c, S) { return ( /*p*/ c[38].length != null ? create_if_block_13 : create_else_block$1 ); } - let _ = h(r), E = _(r); + let _ = h(t), E = _(t); return { c() { - E.c(), e = space$1(), n = text$2(t), f = text$2(" | "), y = text$2(u); + E.c(), e = space$1(), n = text$2(r), f = text$2(" | "), b = text$2(u); }, - m(c, C) { - E.m(c, C), insert$2(c, e, C), insert$2(c, n, C), insert$2(c, f, C), insert$2(c, y, C); + m(c, S) { + E.m(c, S), insert$2(c, e, S), insert$2(c, n, S), insert$2(c, f, S), insert$2(c, b, S); }, - p(c, C) { - _ === (_ = h(c)) && E ? E.p(c, C) : (E.d(1), E = _(c), E && (E.c(), E.m(e.parentNode, e))), C[0] & /*progress*/ - 128 && t !== (t = /*p*/ - c[38].unit + "") && set_data$2(n, t); + p(c, S) { + _ === (_ = h(c)) && E ? E.p(c, S) : (E.d(1), E = _(c), E && (E.c(), E.m(e.parentNode, e))), S[0] & /*progress*/ + 128 && r !== (r = /*p*/ + c[38].unit + "") && set_data$2(n, r); }, d(c) { - c && (detach$2(e), detach$2(n), detach$2(f), detach$2(y)), E.d(c); + c && (detach$2(e), detach$2(n), detach$2(f), detach$2(b)), E.d(c); } }; } -function create_else_block$1(r) { +function create_else_block$1(t) { let e = pretty_si( /*p*/ - r[38].index || 0 - ) + "", t; + t[38].index || 0 + ) + "", r; return { c() { - t = text$2(e); + r = text$2(e); }, m(n, f) { - insert$2(n, t, f); + insert$2(n, r, f); }, p(n, f) { f[0] & /*progress*/ 128 && e !== (e = pretty_si( /*p*/ n[38].index || 0 - ) + "") && set_data$2(t, e); + ) + "") && set_data$2(r, e); }, d(n) { - n && detach$2(t); + n && detach$2(r); } }; } -function create_if_block_13(r) { +function create_if_block_13(t) { let e = pretty_si( /*p*/ - r[38].index || 0 - ) + "", t, n, f = pretty_si( + t[38].index || 0 + ) + "", r, n, f = pretty_si( /*p*/ - r[38].length + t[38].length ) + "", u; return { c() { - t = text$2(e), n = text$2("/"), u = text$2(f); + r = text$2(e), n = text$2("/"), u = text$2(f); }, - m(y, h) { - insert$2(y, t, h), insert$2(y, n, h), insert$2(y, u, h); + m(b, h) { + insert$2(b, r, h), insert$2(b, n, h), insert$2(b, u, h); }, - p(y, h) { + p(b, h) { h[0] & /*progress*/ 128 && e !== (e = pretty_si( /*p*/ - y[38].index || 0 - ) + "") && set_data$2(t, e), h[0] & /*progress*/ + b[38].index || 0 + ) + "") && set_data$2(r, e), h[0] & /*progress*/ 128 && f !== (f = pretty_si( /*p*/ - y[38].length + b[38].length ) + "") && set_data$2(u, f); }, - d(y) { - y && (detach$2(t), detach$2(n), detach$2(u)); + d(b) { + b && (detach$2(r), detach$2(n), detach$2(u)); } }; } -function create_each_block_1(r) { - let e, t = ( +function create_each_block_1(t) { + let e, r = ( /*p*/ - r[38].index != null && create_if_block_12(r) + t[38].index != null && create_if_block_12(t) ); return { c() { - t && t.c(), e = empty$1(); + r && r.c(), e = empty$1(); }, m(n, f) { - t && t.m(n, f), insert$2(n, e, f); + r && r.m(n, f), insert$2(n, e, f); }, p(n, f) { /*p*/ - n[38].index != null ? t ? t.p(n, f) : (t = create_if_block_12(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[38].index != null ? r ? r.p(n, f) : (r = create_if_block_12(n), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null); }, d(n) { - n && detach$2(e), t && t.d(n); + n && detach$2(e), r && r.d(n); } }; } -function create_if_block_10(r) { - let e, t = ( +function create_if_block_10(t) { + let e, r = ( /*eta*/ - r[0] ? `/${/*formatted_eta*/ - r[19]}` : "" + t[0] ? `/${/*formatted_eta*/ + t[19]}` : "" ), n, f; return { c() { e = text$2( /*formatted_timer*/ - r[20] - ), n = text$2(t), f = text$2("s"); + t[20] + ), n = text$2(r), f = text$2("s"); }, - m(u, y) { - insert$2(u, e, y), insert$2(u, n, y), insert$2(u, f, y); + m(u, b) { + insert$2(u, e, b), insert$2(u, n, b), insert$2(u, f, b); }, - p(u, y) { - y[0] & /*formatted_timer*/ + p(u, b) { + b[0] & /*formatted_timer*/ 1048576 && set_data$2( e, /*formatted_timer*/ u[20] - ), y[0] & /*eta, formatted_eta*/ - 524289 && t !== (t = /*eta*/ + ), b[0] & /*eta, formatted_eta*/ + 524289 && r !== (r = /*eta*/ u[0] ? `/${/*formatted_eta*/ - u[19]}` : "") && set_data$2(n, t); + u[19]}` : "") && set_data$2(n, r); }, d(u) { u && (detach$2(e), detach$2(n), detach$2(f)); } }; } -function create_if_block_9(r) { - let e, t; +function create_if_block_9(t) { + let e, r; return e = new Loader({ props: { margin: ( /*variant*/ - r[8] === "default" + t[8] === "default" ) } }), { c() { create_component$1(e.$$.fragment); }, m(n, f) { - mount_component$1(e, n, f), t = !0; + mount_component$1(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -32651,49 +33796,49 @@ function create_if_block_9(r) { n[8] === "default"), e.$set(u); }, i(n) { - t || (transition_in$1(e.$$.fragment, n), t = !0); + r || (transition_in$1(e.$$.fragment, n), r = !0); }, o(n) { - transition_out$1(e.$$.fragment, n), t = !1; + transition_out$1(e.$$.fragment, n), r = !1; }, d(n) { destroy_component$1(e, n); } }; } -function create_if_block_2(r) { - let e, t, n, f, u, y = `${/*last_progress_level*/ - r[15] * 100}%`, h = ( +function create_if_block_2(t) { + let e, r, n, f, u, b = `${/*last_progress_level*/ + t[15] * 100}%`, h = ( /*progress*/ - r[7] != null && create_if_block_3(r) + t[7] != null && create_if_block_3(t) ); return { c() { - e = element$2("div"), t = element$2("div"), h && h.c(), n = space$1(), f = element$2("div"), u = element$2("div"), attr$2(t, "class", "progress-level-inner svelte-14miwb5"), attr$2(u, "class", "progress-bar svelte-14miwb5"), set_style(u, "width", y), attr$2(f, "class", "progress-bar-wrap svelte-14miwb5"), attr$2(e, "class", "progress-level svelte-14miwb5"); + e = element$2("div"), r = element$2("div"), h && h.c(), n = space$1(), f = element$2("div"), u = element$2("div"), attr$2(r, "class", "progress-level-inner svelte-14miwb5"), attr$2(u, "class", "progress-bar svelte-14miwb5"), set_style(u, "width", b), attr$2(f, "class", "progress-bar-wrap svelte-14miwb5"), attr$2(e, "class", "progress-level svelte-14miwb5"); }, m(_, E) { - insert$2(_, e, E), append$2(e, t), h && h.m(t, null), append$2(e, n), append$2(e, f), append$2(f, u), r[30](u); + insert$2(_, e, E), append$2(e, r), h && h.m(r, null), append$2(e, n), append$2(e, f), append$2(f, u), t[30](u); }, p(_, E) { /*progress*/ - _[7] != null ? h ? h.p(_, E) : (h = create_if_block_3(_), h.c(), h.m(t, null)) : h && (h.d(1), h = null), E[0] & /*last_progress_level*/ - 32768 && y !== (y = `${/*last_progress_level*/ - _[15] * 100}%`) && set_style(u, "width", y); + _[7] != null ? h ? h.p(_, E) : (h = create_if_block_3(_), h.c(), h.m(r, null)) : h && (h.d(1), h = null), E[0] & /*last_progress_level*/ + 32768 && b !== (b = `${/*last_progress_level*/ + _[15] * 100}%`) && set_style(u, "width", b); }, i: noop$1, o: noop$1, d(_) { - _ && detach$2(e), h && h.d(), r[30](null); + _ && detach$2(e), h && h.d(), t[30](null); } }; } -function create_if_block_3(r) { - let e, t = ensure_array_like$1( +function create_if_block_3(t) { + let e, r = ensure_array_like$1( /*progress*/ - r[7] + t[7] ), n = []; - for (let f = 0; f < t.length; f += 1) - n[f] = create_each_block$1(get_each_context$1(r, t, f)); + for (let f = 0; f < r.length; f += 1) + n[f] = create_each_block$1(get_each_context$1(t, r, f)); return { c() { for (let f = 0; f < n.length; f += 1) @@ -32701,25 +33846,25 @@ function create_if_block_3(r) { e = empty$1(); }, m(f, u) { - for (let y = 0; y < n.length; y += 1) - n[y] && n[y].m(f, u); + for (let b = 0; b < n.length; b += 1) + n[b] && n[b].m(f, u); insert$2(f, e, u); }, p(f, u) { if (u[0] & /*progress_level, progress*/ 16512) { - t = ensure_array_like$1( + r = ensure_array_like$1( /*progress*/ f[7] ); - let y; - for (y = 0; y < t.length; y += 1) { - const h = get_each_context$1(f, t, y); - n[y] ? n[y].p(h, u) : (n[y] = create_each_block$1(h), n[y].c(), n[y].m(e.parentNode, e)); + let b; + for (b = 0; b < r.length; b += 1) { + const h = get_each_context$1(f, r, b); + n[b] ? n[b].p(h, u) : (n[b] = create_each_block$1(h), n[b].c(), n[b].m(e.parentNode, e)); } - for (; y < n.length; y += 1) - n[y].d(1); - n.length = t.length; + for (; b < n.length; b += 1) + n[b].d(1); + n.length = r.length; } }, d(f) { @@ -32727,35 +33872,35 @@ function create_if_block_3(r) { } }; } -function create_if_block_4(r) { - let e, t, n, f, u = ( +function create_if_block_4(t) { + let e, r, n, f, u = ( /*i*/ - r[40] !== 0 && create_if_block_8() - ), y = ( + t[40] !== 0 && create_if_block_8() + ), b = ( /*p*/ - r[38].desc != null && create_if_block_7(r) + t[38].desc != null && create_if_block_7(t) ), h = ( /*p*/ - r[38].desc != null && /*progress_level*/ - r[14] && /*progress_level*/ - r[14][ + t[38].desc != null && /*progress_level*/ + t[14] && /*progress_level*/ + t[14][ /*i*/ - r[40] + t[40] ] != null && create_if_block_6() ), _ = ( /*progress_level*/ - r[14] != null && create_if_block_5(r) + t[14] != null && create_if_block_5(t) ); return { c() { - u && u.c(), e = space$1(), y && y.c(), t = space$1(), h && h.c(), n = space$1(), _ && _.c(), f = empty$1(); + u && u.c(), e = space$1(), b && b.c(), r = space$1(), h && h.c(), n = space$1(), _ && _.c(), f = empty$1(); }, m(E, c) { - u && u.m(E, c), insert$2(E, e, c), y && y.m(E, c), insert$2(E, t, c), h && h.m(E, c), insert$2(E, n, c), _ && _.m(E, c), insert$2(E, f, c); + u && u.m(E, c), insert$2(E, e, c), b && b.m(E, c), insert$2(E, r, c), h && h.m(E, c), insert$2(E, n, c), _ && _.m(E, c), insert$2(E, f, c); }, p(E, c) { /*p*/ - E[38].desc != null ? y ? y.p(E, c) : (y = create_if_block_7(E), y.c(), y.m(t.parentNode, t)) : y && (y.d(1), y = null), /*p*/ + E[38].desc != null ? b ? b.p(E, c) : (b = create_if_block_7(E), b.c(), b.m(r.parentNode, r)) : b && (b.d(1), b = null), /*p*/ E[38].desc != null && /*progress_level*/ E[14] && /*progress_level*/ E[14][ @@ -32765,72 +33910,72 @@ function create_if_block_4(r) { E[14] != null ? _ ? _.p(E, c) : (_ = create_if_block_5(E), _.c(), _.m(f.parentNode, f)) : _ && (_.d(1), _ = null); }, d(E) { - E && (detach$2(e), detach$2(t), detach$2(n), detach$2(f)), u && u.d(E), y && y.d(E), h && h.d(E), _ && _.d(E); + E && (detach$2(e), detach$2(r), detach$2(n), detach$2(f)), u && u.d(E), b && b.d(E), h && h.d(E), _ && _.d(E); } }; } -function create_if_block_8(r) { +function create_if_block_8(t) { let e; return { c() { e = text$2(" /"); }, - m(t, n) { - insert$2(t, e, n); + m(r, n) { + insert$2(r, e, n); }, - d(t) { - t && detach$2(e); + d(r) { + r && detach$2(e); } }; } -function create_if_block_7(r) { +function create_if_block_7(t) { let e = ( /*p*/ - r[38].desc + "" - ), t; + t[38].desc + "" + ), r; return { c() { - t = text$2(e); + r = text$2(e); }, m(n, f) { - insert$2(n, t, f); + insert$2(n, r, f); }, p(n, f) { f[0] & /*progress*/ 128 && e !== (e = /*p*/ - n[38].desc + "") && set_data$2(t, e); + n[38].desc + "") && set_data$2(r, e); }, d(n) { - n && detach$2(t); + n && detach$2(r); } }; } -function create_if_block_6(r) { +function create_if_block_6(t) { let e; return { c() { e = text$2("-"); }, - m(t, n) { - insert$2(t, e, n); + m(r, n) { + insert$2(r, e, n); }, - d(t) { - t && detach$2(e); + d(r) { + r && detach$2(e); } }; } -function create_if_block_5(r) { +function create_if_block_5(t) { let e = (100 * /*progress_level*/ - (r[14][ + (t[14][ /*i*/ - r[40] - ] || 0)).toFixed(1) + "", t, n; + t[40] + ] || 0)).toFixed(1) + "", r, n; return { c() { - t = text$2(e), n = text$2("%"); + r = text$2(e), n = text$2("%"); }, m(f, u) { - insert$2(f, t, u), insert$2(f, n, u); + insert$2(f, r, u), insert$2(f, n, u); }, p(f, u) { u[0] & /*progress_level*/ @@ -32838,29 +33983,29 @@ function create_if_block_5(r) { (f[14][ /*i*/ f[40] - ] || 0)).toFixed(1) + "") && set_data$2(t, e); + ] || 0)).toFixed(1) + "") && set_data$2(r, e); }, d(f) { - f && (detach$2(t), detach$2(n)); + f && (detach$2(r), detach$2(n)); } }; } -function create_each_block$1(r) { - let e, t = ( +function create_each_block$1(t) { + let e, r = ( /*p*/ - (r[38].desc != null || /*progress_level*/ - r[14] && /*progress_level*/ - r[14][ + (t[38].desc != null || /*progress_level*/ + t[14] && /*progress_level*/ + t[14][ /*i*/ - r[40] - ] != null) && create_if_block_4(r) + t[40] + ] != null) && create_if_block_4(t) ); return { c() { - t && t.c(), e = empty$1(); + r && r.c(), e = empty$1(); }, m(n, f) { - t && t.m(n, f), insert$2(n, e, f); + r && r.m(n, f), insert$2(n, e, f); }, p(n, f) { /*p*/ @@ -32869,29 +34014,29 @@ function create_each_block$1(r) { n[14][ /*i*/ n[40] - ] != null ? t ? t.p(n, f) : (t = create_if_block_4(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + ] != null ? r ? r.p(n, f) : (r = create_if_block_4(n), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null); }, d(n) { - n && detach$2(e), t && t.d(n); + n && detach$2(e), r && r.d(n); } }; } -function create_if_block_1$1(r) { - let e, t; +function create_if_block_1$1(t) { + let e, r; return { c() { - e = element$2("p"), t = text$2( + e = element$2("p"), r = text$2( /*loading_text*/ - r[9] + t[9] ), attr$2(e, "class", "loading svelte-14miwb5"); }, m(n, f) { - insert$2(n, e, f), append$2(e, t); + insert$2(n, e, f), append$2(e, r); }, p(n, f) { f[0] & /*loading_text*/ 512 && set_data$2( - t, + r, /*loading_text*/ n[9] ); @@ -32901,9 +34046,9 @@ function create_if_block_1$1(r) { } }; } -function create_fragment$2(r) { - let e, t, n, f, u; - const y = [create_if_block$1, create_if_block_17], h = []; +function create_fragment$2(t) { + let e, r, n, f, u; + const b = [create_if_block$1, create_if_block_17], h = []; function _(E, c) { return ( /*status*/ @@ -32913,52 +34058,52 @@ function create_fragment$2(r) { ) ); } - return ~(t = _(r)) && (n = h[t] = y[t](r)), { + return ~(r = _(t)) && (n = h[r] = b[r](t)), { c() { e = element$2("div"), n && n.c(), attr$2(e, "class", f = "wrap " + /*variant*/ - r[8] + " " + /*show_progress*/ - r[6] + " svelte-14miwb5"), toggle_class$1(e, "hide", !/*status*/ - r[4] || /*status*/ - r[4] === "complete" || /*show_progress*/ - r[6] === "hidden"), toggle_class$1( + t[8] + " " + /*show_progress*/ + t[6] + " svelte-14miwb5"), toggle_class$1(e, "hide", !/*status*/ + t[4] || /*status*/ + t[4] === "complete" || /*show_progress*/ + t[6] === "hidden"), toggle_class$1( e, "translucent", /*variant*/ - r[8] === "center" && /*status*/ - (r[4] === "pending" || /*status*/ - r[4] === "error") || /*translucent*/ - r[11] || /*show_progress*/ - r[6] === "minimal" + t[8] === "center" && /*status*/ + (t[4] === "pending" || /*status*/ + t[4] === "error") || /*translucent*/ + t[11] || /*show_progress*/ + t[6] === "minimal" ), toggle_class$1( e, "generating", /*status*/ - r[4] === "generating" + t[4] === "generating" ), toggle_class$1( e, "border", /*border*/ - r[12] + t[12] ), set_style( e, "position", /*absolute*/ - r[10] ? "absolute" : "static" + t[10] ? "absolute" : "static" ), set_style( e, "padding", /*absolute*/ - r[10] ? "0" : "var(--size-8) 0" + t[10] ? "0" : "var(--size-8) 0" ); }, m(E, c) { - insert$2(E, e, c), ~t && h[t].m(e, null), r[31](e), u = !0; + insert$2(E, e, c), ~r && h[r].m(e, null), t[31](e), u = !0; }, p(E, c) { - let C = t; - t = _(E), t === C ? ~t && h[t].p(E, c) : (n && (group_outros$1(), transition_out$1(h[C], 1, 1, () => { - h[C] = null; - }), check_outros$1()), ~t ? (n = h[t], n ? n.p(E, c) : (n = h[t] = y[t](E), n.c()), transition_in$1(n, 1), n.m(e, null)) : n = null), (!u || c[0] & /*variant, show_progress*/ + let S = r; + r = _(E), r === S ? ~r && h[r].p(E, c) : (n && (group_outros$1(), transition_out$1(h[S], 1, 1, () => { + h[S] = null; + }), check_outros$1()), ~r ? (n = h[r], n ? n.p(E, c) : (n = h[r] = b[r](E), n.c()), transition_in$1(n, 1), n.m(e, null)) : n = null), (!u || c[0] & /*variant, show_progress*/ 320 && f !== (f = "wrap " + /*variant*/ E[8] + " " + /*show_progress*/ E[6] + " svelte-14miwb5")) && attr$2(e, "class", f), (!u || c[0] & /*variant, show_progress, status, show_progress*/ @@ -33008,95 +34153,95 @@ function create_fragment$2(r) { transition_out$1(n), u = !1; }, d(E) { - E && detach$2(e), ~t && h[t].d(), r[31](null); + E && detach$2(e), ~r && h[r].d(), t[31](null); } }; } let items = [], called = !1; -async function scroll_into_view(r, e = !0) { +async function scroll_into_view(t, e = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) { - if (items.push(r), !called) + if (items.push(t), !called) called = !0; else return; await tick(), requestAnimationFrame(() => { - let t = [0, 0]; + let r = [0, 0]; for (let n = 0; n < items.length; n++) { const u = items[n].getBoundingClientRect(); - (n === 0 || u.top + window.scrollY <= t[0]) && (t[0] = u.top + window.scrollY, t[1] = n); + (n === 0 || u.top + window.scrollY <= r[0]) && (r[0] = u.top + window.scrollY, r[1] = n); } - window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), called = !1, items = []; + window.scrollTo({ top: r[0] - 20, behavior: "smooth" }), called = !1, items = []; }); } } -function instance$2(r, e, t) { - let n, { $$slots: f = {}, $$scope: u } = e, { i18n: y } = e, { eta: h = null } = e, { queue: _ = !1 } = e, { queue_position: E } = e, { queue_size: c } = e, { status: C } = e, { scroll_to_output: b = !1 } = e, { timer: A = !0 } = e, { show_progress: S = "full" } = e, { message: s = null } = e, { progress: o = null } = e, { variant: w = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: a = !1 } = e, { border: l = !1 } = e, { autoscroll: g } = e, M, L = !1, T = 0, D = 0, I = null, z = 0, P = null, B, k = null, N = !0; - const $ = () => { - t(25, T = performance.now()), t(26, D = 0), L = !0, F(); +function instance$2(t, e, r) { + let n, { $$slots: f = {}, $$scope: u } = e, { i18n: b } = e, { eta: h = null } = e, { queue: _ = !1 } = e, { queue_position: E } = e, { queue_size: c } = e, { status: S } = e, { scroll_to_output: y = !1 } = e, { timer: w = !0 } = e, { show_progress: L = "full" } = e, { message: s = null } = e, { progress: o = null } = e, { variant: A = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: a = !1 } = e, { border: l = !1 } = e, { autoscroll: g } = e, M, C = !1, T = 0, D = 0, I = null, B = 0, P = null, z, k = null, N = !0; + const R = () => { + r(25, T = performance.now()), r(26, D = 0), C = !0, U(); }; - function F() { + function U() { requestAnimationFrame(() => { - t(26, D = (performance.now() - T) / 1e3), L && F(); + r(26, D = (performance.now() - T) / 1e3), C && U(); }); } - function G() { - t(26, D = 0), L && (L = !1); + function W() { + r(26, D = 0), C && (C = !1); } onDestroy(() => { - L && G(); + C && W(); }); - let H = null; - function U(Q) { - binding_callbacks[Q ? "unshift" : "push"](() => { - k = Q, t(16, k), t(7, o), t(14, P), t(15, B); + let G = null; + function F(J) { + binding_callbacks[J ? "unshift" : "push"](() => { + k = J, r(16, k), r(7, o), r(14, P), r(15, z); }); } - function V(Q) { - binding_callbacks[Q ? "unshift" : "push"](() => { - M = Q, t(13, M); + function V(J) { + binding_callbacks[J ? "unshift" : "push"](() => { + M = J, r(13, M); }); } - return r.$$set = (Q) => { - "i18n" in Q && t(1, y = Q.i18n), "eta" in Q && t(0, h = Q.eta), "queue" in Q && t(21, _ = Q.queue), "queue_position" in Q && t(2, E = Q.queue_position), "queue_size" in Q && t(3, c = Q.queue_size), "status" in Q && t(4, C = Q.status), "scroll_to_output" in Q && t(22, b = Q.scroll_to_output), "timer" in Q && t(5, A = Q.timer), "show_progress" in Q && t(6, S = Q.show_progress), "message" in Q && t(23, s = Q.message), "progress" in Q && t(7, o = Q.progress), "variant" in Q && t(8, w = Q.variant), "loading_text" in Q && t(9, p = Q.loading_text), "absolute" in Q && t(10, v = Q.absolute), "translucent" in Q && t(11, a = Q.translucent), "border" in Q && t(12, l = Q.border), "autoscroll" in Q && t(24, g = Q.autoscroll), "$$scope" in Q && t(28, u = Q.$$scope); - }, r.$$.update = () => { - r.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/ - 169869313 && (h === null ? t(0, h = I) : _ && t(0, h = (performance.now() - T) / 1e3 + h), h != null && (t(19, H = h.toFixed(1)), t(27, I = h))), r.$$.dirty[0] & /*eta, timer_diff*/ - 67108865 && t(17, z = h === null || h <= 0 || !D ? null : Math.min(D / h, 1)), r.$$.dirty[0] & /*progress*/ - 128 && o != null && t(18, N = !1), r.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (o != null ? t(14, P = o.map((Q) => { - if (Q.index != null && Q.length != null) - return Q.index / Q.length; - if (Q.progress != null) - return Q.progress; - })) : t(14, P = null), P ? (t(15, B = P[P.length - 1]), k && (B === 0 ? t(16, k.style.transition = "0", k) : t(16, k.style.transition = "150ms", k))) : t(15, B = void 0)), r.$$.dirty[0] & /*status*/ - 16 && (C === "pending" ? $() : G()), r.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && M && b && (C === "pending" || C === "complete") && scroll_into_view(M, g), r.$$.dirty[0] & /*status, message*/ - 8388624, r.$$.dirty[0] & /*timer_diff*/ - 67108864 && t(20, n = D.toFixed(1)); + return t.$$set = (J) => { + "i18n" in J && r(1, b = J.i18n), "eta" in J && r(0, h = J.eta), "queue" in J && r(21, _ = J.queue), "queue_position" in J && r(2, E = J.queue_position), "queue_size" in J && r(3, c = J.queue_size), "status" in J && r(4, S = J.status), "scroll_to_output" in J && r(22, y = J.scroll_to_output), "timer" in J && r(5, w = J.timer), "show_progress" in J && r(6, L = J.show_progress), "message" in J && r(23, s = J.message), "progress" in J && r(7, o = J.progress), "variant" in J && r(8, A = J.variant), "loading_text" in J && r(9, p = J.loading_text), "absolute" in J && r(10, v = J.absolute), "translucent" in J && r(11, a = J.translucent), "border" in J && r(12, l = J.border), "autoscroll" in J && r(24, g = J.autoscroll), "$$scope" in J && r(28, u = J.$$scope); + }, t.$$.update = () => { + t.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/ + 169869313 && (h === null ? r(0, h = I) : _ && r(0, h = (performance.now() - T) / 1e3 + h), h != null && (r(19, G = h.toFixed(1)), r(27, I = h))), t.$$.dirty[0] & /*eta, timer_diff*/ + 67108865 && r(17, B = h === null || h <= 0 || !D ? null : Math.min(D / h, 1)), t.$$.dirty[0] & /*progress*/ + 128 && o != null && r(18, N = !1), t.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (o != null ? r(14, P = o.map((J) => { + if (J.index != null && J.length != null) + return J.index / J.length; + if (J.progress != null) + return J.progress; + })) : r(14, P = null), P ? (r(15, z = P[P.length - 1]), k && (z === 0 ? r(16, k.style.transition = "0", k) : r(16, k.style.transition = "150ms", k))) : r(15, z = void 0)), t.$$.dirty[0] & /*status*/ + 16 && (S === "pending" ? R() : W()), t.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && M && y && (S === "pending" || S === "complete") && scroll_into_view(M, g), t.$$.dirty[0] & /*status, message*/ + 8388624, t.$$.dirty[0] & /*timer_diff*/ + 67108864 && r(20, n = D.toFixed(1)); }, [ h, - y, + b, E, c, - C, - A, S, - o, w, + L, + o, + A, p, v, a, l, M, P, - B, - k, z, + k, + B, N, - H, + G, n, _, - b, + y, s, g, T, @@ -33104,7 +34249,7 @@ function instance$2(r, e, t) { I, u, f, - U, + F, V ]; } @@ -33154,34 +34299,34 @@ const ToastContent_svelte_svelte_type_style_lang = "", Toast_svelte_svelte_type_ text: text$1, toggle_class } = window.__gradio__svelte__internal; -function create_fragment$1(r) { - let e, t = (Array.isArray( +function create_fragment$1(t) { + let e, r = (Array.isArray( /*value*/ - r[0] + t[0] ) ? ( /*value*/ - r[0].join(", ") + t[0].join(", ") ) : ( /*value*/ - r[0] + t[0] )) + "", n; return { c() { - e = element$1("div"), n = text$1(t), attr$1(e, "class", "svelte-1hgn91n"), toggle_class( + e = element$1("div"), n = text$1(r), attr$1(e, "class", "svelte-1hgn91n"), toggle_class( e, "table", /*type*/ - r[1] === "table" + t[1] === "table" ), toggle_class( e, "gallery", /*type*/ - r[1] === "gallery" + t[1] === "gallery" ), toggle_class( e, "selected", /*selected*/ - r[2] + t[2] ); }, m(f, u) { @@ -33189,7 +34334,7 @@ function create_fragment$1(r) { }, p(f, [u]) { u & /*value*/ - 1 && t !== (t = (Array.isArray( + 1 && r !== (r = (Array.isArray( /*value*/ f[0] ) ? ( @@ -33198,7 +34343,7 @@ function create_fragment$1(r) { ) : ( /*value*/ f[0] - )) + "") && set_data$1(n, t), u & /*type*/ + )) + "") && set_data$1(n, r), u & /*type*/ 2 && toggle_class( e, "table", @@ -33225,10 +34370,10 @@ function create_fragment$1(r) { } }; } -function instance$1(r, e, t) { +function instance$1(t, e, r) { let { value: n } = e, { type: f } = e, { selected: u = !1 } = e; - return r.$$set = (y) => { - "value" in y && t(0, n = y.value), "type" in y && t(1, f = y.type), "selected" in y && t(2, u = y.selected); + return t.$$set = (b) => { + "value" in b && r(0, n = b.value), "type" in b && r(1, f = b.type), "selected" in b && r(2, u = b.selected); }, [n, f, u]; } class Example extends SvelteComponent$1 { @@ -33264,103 +34409,103 @@ const Index_svelte_svelte_type_style_lang = "", { transition_in, transition_out } = window.__gradio__svelte__internal; -function get_each_context(r, e, t) { - const n = r.slice(); - return n[40] = e[t], n; +function get_each_context(t, e, r) { + const n = t.slice(); + return n[38] = e[r], n; } -function create_else_block(r) { - let e, t; +function create_else_block(t) { + let e, r; return e = new FileUpload({ props: { label: ( /*label*/ - r[6] + t[6] ), show_label: ( /*show_label*/ - r[7] + t[7] ), value: ( - /*_value*/ - r[22] + /*value*/ + t[0] ), file_count: ( /*file_count*/ - r[18] + t[18] ), file_types: ( /*file_types*/ - r[19] + t[19] ), selectable: ( /*_selectable*/ - r[12] + t[12] ), root: ( /*root*/ - r[5] + t[5] ), height: ( /*height*/ - r[8] + t[8] ), representations: ( /*representations*/ - r[24] + t[23] ), config: ( /*config*/ - r[9] + t[9] ), confidenceLabel: ( /*confidenceLabel*/ - r[10] + t[10] ), moldata: ( /*moldata*/ - r[20] + t[20] ), molviewer: ( /*showviewer*/ - r[11] + t[11] ), i18n: ( /*gradio*/ - r[17].i18n + t[17].i18n ), $$slots: { default: [create_default_slot_1] }, - $$scope: { ctx: r } + $$scope: { ctx: t } } }), e.$on( "change", /*change_handler*/ - r[30] + t[28] ), e.$on( "drag", /*drag_handler*/ - r[31] + t[29] ), e.$on( "clear", /*clear_handler*/ - r[32] + t[30] ), e.$on( "select", /*select_handler_1*/ - r[33] + t[31] ), e.$on( "notfound", /*notfound_handler*/ - r[34] + t[32] ), e.$on( "upload", /*upload_handler*/ - r[35] + t[33] ), { c() { create_component(e.$$.fragment); }, m(n, f) { - mount_component(e, n, f), t = !0; + mount_component(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -33368,9 +34513,9 @@ function create_else_block(r) { 64 && (u.label = /*label*/ n[6]), f[0] & /*show_label*/ 128 && (u.show_label = /*show_label*/ - n[7]), f[0] & /*_value*/ - 4194304 && (u.value = /*_value*/ - n[22]), f[0] & /*file_count*/ + n[7]), f[0] & /*value*/ + 1 && (u.value = /*value*/ + n[0]), f[0] & /*file_count*/ 262144 && (u.file_count = /*file_count*/ n[18]), f[0] & /*file_types*/ 524288 && (u.file_types = /*file_types*/ @@ -33392,90 +34537,90 @@ function create_else_block(r) { 131072 && (u.i18n = /*gradio*/ n[17].i18n), f[0] & /*gradio*/ 131072 | f[1] & /*$$scope*/ - 4096 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); + 1024 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, i(n) { - t || (transition_in(e.$$.fragment, n), t = !0); + r || (transition_in(e.$$.fragment, n), r = !0); }, o(n) { - transition_out(e.$$.fragment, n), t = !1; + transition_out(e.$$.fragment, n), r = !1; }, d(n) { destroy_component(e, n); } }; } -function create_if_block_1(r) { - let e, t; +function create_if_block_1(t) { + let e, r; return e = new File_1({ props: { selectable: ( /*_selectable*/ - r[12] + t[12] ), value: ( - /*_value*/ - r[22] + /*value*/ + t[0] ), label: ( /*label*/ - r[6] + t[6] ), show_label: ( /*show_label*/ - r[7] + t[7] ), height: ( /*height*/ - r[8] + t[8] ), representations: ( /*representations*/ - r[24] + t[23] ), config: ( /*config*/ - r[9] + t[9] ), confidenceLabel: ( /*confidenceLabel*/ - r[10] + t[10] ), moldata: ( /*moldata*/ - r[20] + t[20] ), errors: ( /*errors*/ - r[21] + t[21] ), i18n: ( /*gradio*/ - r[17].i18n + t[17].i18n ), molviewer: ( /*showviewer*/ - r[11] + t[11] ) } }), e.$on( "select", /*select_handler*/ - r[29] + t[27] ), { c() { create_component(e.$$.fragment); }, m(n, f) { - mount_component(e, n, f), t = !0; + mount_component(e, n, f), r = !0; }, p(n, f) { const u = {}; f[0] & /*_selectable*/ 4096 && (u.selectable = /*_selectable*/ - n[12]), f[0] & /*_value*/ - 4194304 && (u.value = /*_value*/ - n[22]), f[0] & /*label*/ + n[12]), f[0] & /*value*/ + 1 && (u.value = /*value*/ + n[0]), f[0] & /*label*/ 64 && (u.label = /*label*/ n[6]), f[0] & /*show_label*/ 128 && (u.show_label = /*show_label*/ @@ -33496,23 +34641,23 @@ function create_if_block_1(r) { n[11]), e.$set(u); }, i(n) { - t || (transition_in(e.$$.fragment, n), t = !0); + r || (transition_in(e.$$.fragment, n), r = !0); }, o(n) { - transition_out(e.$$.fragment, n), t = !1; + transition_out(e.$$.fragment, n), r = !1; }, d(n) { destroy_component(e, n); } }; } -function create_default_slot_1(r) { - let e, t; +function create_default_slot_1(t) { + let e, r; return e = new UploadText({ props: { i18n: ( /*gradio*/ - r[17].i18n + t[17].i18n ), type: "file" } @@ -33521,7 +34666,7 @@ function create_default_slot_1(r) { create_component(e.$$.fragment); }, m(n, f) { - mount_component(e, n, f), t = !0; + mount_component(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -33530,99 +34675,99 @@ function create_default_slot_1(r) { n[17].i18n), e.$set(u); }, i(n) { - t || (transition_in(e.$$.fragment, n), t = !0); + r || (transition_in(e.$$.fragment, n), r = !0); }, o(n) { - transition_out(e.$$.fragment, n), t = !1; + transition_out(e.$$.fragment, n), r = !1; }, d(n) { destroy_component(e, n); } }; } -function create_if_block(r) { - let e, t, n, f, u, y, h, _, E, c, C = ensure_array_like( +function create_if_block(t) { + let e, r, n, f, u, b, h, _, E, c, S = ensure_array_like( /*errors*/ - r[21] - ), b = []; - for (let A = 0; A < C.length; A += 1) - b[A] = create_each_block(get_each_context(r, C, A)); + t[21] + ), y = []; + for (let w = 0; w < S.length; w += 1) + y[w] = create_each_block(get_each_context(t, S, w)); return { c() { - e = element("div"), t = svg_element("svg"), n = svg_element("path"), f = space(), u = element("span"), u.textContent = "Error in the representations", y = space(), h = element("div"), _ = element("span"), _.textContent = "Couldn't display Molecule. Fix the following problems:", E = space(), c = element("ul"); - for (let A = 0; A < b.length; A += 1) - b[A].c(); - attr(n, "stroke-linecap", "round"), attr(n, "stroke-linejoin", "round"), attr(n, "d", "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"), attr(t, "class", "flex-shrink-0 inline w-4 h-4 mr-3 mt-[2px] svelte-1j3z0by"), attr(t, "xmlns", "http://www.w3.org/2000/svg"), attr(t, "fill", "none"), attr(t, "viewBox", "0 0 24 24"), attr(t, "stroke-width", "1.5"), attr(t, "stroke", "currentColor"), attr(u, "class", "sr-only svelte-1j3z0by"), attr(_, "class", "font-medium svelte-1j3z0by"), attr(c, "class", "mt-1.5 ml-4 list-disc list-inside svelte-1j3z0by"), attr(e, "class", "flex m-2 p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400 svelte-1j3z0by"), attr(e, "role", "alert"); - }, - m(A, S) { - insert(A, e, S), append(e, t), append(t, n), append(e, f), append(e, u), append(e, y), append(e, h), append(h, _), append(h, E), append(h, c); - for (let s = 0; s < b.length; s += 1) - b[s] && b[s].m(c, null); - }, - p(A, S) { - if (S[0] & /*errors*/ + e = element("div"), r = svg_element("svg"), n = svg_element("path"), f = space(), u = element("span"), u.textContent = "Error in the representations", b = space(), h = element("div"), _ = element("span"), _.textContent = "Couldn't display Molecule. Fix the following problems:", E = space(), c = element("ul"); + for (let w = 0; w < y.length; w += 1) + y[w].c(); + attr(n, "stroke-linecap", "round"), attr(n, "stroke-linejoin", "round"), attr(n, "d", "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"), attr(r, "class", "flex-shrink-0 inline w-4 h-4 mr-3 mt-[2px] svelte-1j3z0by"), attr(r, "xmlns", "http://www.w3.org/2000/svg"), attr(r, "fill", "none"), attr(r, "viewBox", "0 0 24 24"), attr(r, "stroke-width", "1.5"), attr(r, "stroke", "currentColor"), attr(u, "class", "sr-only svelte-1j3z0by"), attr(_, "class", "font-medium svelte-1j3z0by"), attr(c, "class", "mt-1.5 ml-4 list-disc list-inside svelte-1j3z0by"), attr(e, "class", "flex m-2 p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400 svelte-1j3z0by"), attr(e, "role", "alert"); + }, + m(w, L) { + insert(w, e, L), append(e, r), append(r, n), append(e, f), append(e, u), append(e, b), append(e, h), append(h, _), append(h, E), append(h, c); + for (let s = 0; s < y.length; s += 1) + y[s] && y[s].m(c, null); + }, + p(w, L) { + if (L[0] & /*errors*/ 2097152) { - C = ensure_array_like( + S = ensure_array_like( /*errors*/ - A[21] + w[21] ); let s; - for (s = 0; s < C.length; s += 1) { - const o = get_each_context(A, C, s); - b[s] ? b[s].p(o, S) : (b[s] = create_each_block(o), b[s].c(), b[s].m(c, null)); + for (s = 0; s < S.length; s += 1) { + const o = get_each_context(w, S, s); + y[s] ? y[s].p(o, L) : (y[s] = create_each_block(o), y[s].c(), y[s].m(c, null)); } - for (; s < b.length; s += 1) - b[s].d(1); - b.length = C.length; + for (; s < y.length; s += 1) + y[s].d(1); + y.length = S.length; } }, - d(A) { - A && detach(e), destroy_each(b, A); + d(w) { + w && detach(e), destroy_each(y, w); } }; } -function create_each_block(r) { - let e, t = ( +function create_each_block(t) { + let e, r = ( /*error*/ - r[40] + "" + t[38] + "" ), n; return { c() { - e = element("li"), n = text(t); + e = element("li"), n = text(r); }, m(f, u) { insert(f, e, u), append(e, n); }, p(f, u) { u[0] & /*errors*/ - 2097152 && t !== (t = /*error*/ - f[40] + "") && set_data(n, t); + 2097152 && r !== (r = /*error*/ + f[38] + "") && set_data(n, r); }, d(f) { f && detach(e); } }; } -function create_default_slot(r) { - var S; - let e, t, n, f, u, y, h; +function create_default_slot(t) { + var L; + let e, r, n, f, u, b, h; const _ = [ { autoscroll: ( /*gradio*/ - r[17].autoscroll + t[17].autoscroll ) }, { i18n: ( /*gradio*/ - r[17].i18n + t[17].i18n ) }, /*loading_status*/ - r[13], + t[13], { status: ( /*loading_status*/ - ((S = r[13]) == null ? void 0 : S.status) || "complete" + ((L = t[13]) == null ? void 0 : L.status) || "complete" ) } ]; @@ -33630,29 +34775,29 @@ function create_default_slot(r) { for (let s = 0; s < _.length; s += 1) E = assign(E, _[s]); e = new Static({ props: E }); - const c = [create_if_block_1, create_else_block], C = []; - function b(s, o) { + const c = [create_if_block_1, create_else_block], S = []; + function y(s, o) { return ( /*interactive*/ s[4] ? 1 : 0 ); } - n = b(r), f = C[n] = c[n](r); - let A = ( + n = y(t), f = S[n] = c[n](t); + let w = ( /*errors*/ - r[21].length > 0 && /*_value*/ - r[22] !== null && create_if_block(r) + t[21].length > 0 && /*value*/ + t[0] !== null && create_if_block(t) ); return { c() { - create_component(e.$$.fragment), t = space(), f.c(), u = space(), A && A.c(), y = empty(); + create_component(e.$$.fragment), r = space(), f.c(), u = space(), w && w.c(), b = empty(); }, m(s, o) { - mount_component(e, s, o), insert(s, t, o), C[n].m(s, o), insert(s, u, o), A && A.m(s, o), insert(s, y, o), h = !0; + mount_component(e, s, o), insert(s, r, o), S[n].m(s, o), insert(s, u, o), w && w.m(s, o), insert(s, b, o), h = !0; }, p(s, o) { var v; - const w = o[0] & /*gradio, loading_status*/ + const A = o[0] & /*gradio, loading_status*/ 139264 ? get_spread_update(_, [ o[0] & /*gradio*/ 131072 && { @@ -33679,13 +34824,13 @@ function create_default_slot(r) { ) } ]) : {}; - e.$set(w); + e.$set(A); let p = n; - n = b(s), n === p ? C[n].p(s, o) : (group_outros(), transition_out(C[p], 1, 1, () => { - C[p] = null; - }), check_outros(), f = C[n], f ? f.p(s, o) : (f = C[n] = c[n](s), f.c()), transition_in(f, 1), f.m(u.parentNode, u)), /*errors*/ - s[21].length > 0 && /*_value*/ - s[22] !== null ? A ? A.p(s, o) : (A = create_if_block(s), A.c(), A.m(y.parentNode, y)) : A && (A.d(1), A = null); + n = y(s), n === p ? S[n].p(s, o) : (group_outros(), transition_out(S[p], 1, 1, () => { + S[p] = null; + }), check_outros(), f = S[n], f ? f.p(s, o) : (f = S[n] = c[n](s), f.c()), transition_in(f, 1), f.m(u.parentNode, u)), /*errors*/ + s[21].length > 0 && /*value*/ + s[0] !== null ? w ? w.p(s, o) : (w = create_if_block(s), w.c(), w.m(b.parentNode, b)) : w && (w.d(1), w = null); }, i(s) { h || (transition_in(e.$$.fragment, s), transition_in(f), h = !0); @@ -33694,57 +34839,57 @@ function create_default_slot(r) { transition_out(e.$$.fragment, s), transition_out(f), h = !1; }, d(s) { - s && (detach(t), detach(u), detach(y)), destroy_component(e, s), C[n].d(s), A && A.d(s); + s && (detach(r), detach(u), detach(b)), destroy_component(e, s), S[n].d(s), w && w.d(s); } }; } -function create_fragment(r) { - let e, t; +function create_fragment(t) { + let e, r; return e = new Block({ props: { visible: ( /*visible*/ - r[3] + t[3] ), variant: ( /*value*/ - r[0] === null ? "dashed" : "solid" + t[0] === null ? "dashed" : "solid" ), border_mode: ( /*dragging*/ - r[23] ? "focus" : "base" + t[22] ? "focus" : "base" ), padding: !1, elem_id: ( /*elem_id*/ - r[1] + t[1] ), elem_classes: ( /*elem_classes*/ - r[2] + t[2] ), container: ( /*container*/ - r[14] + t[14] ), scale: ( /*scale*/ - r[15] + t[15] ), min_width: ( /*min_width*/ - r[16] + t[16] ), allow_overflow: !1, $$slots: { default: [create_default_slot] }, - $$scope: { ctx: r } + $$scope: { ctx: t } } }), { c() { create_component(e.$$.fragment); }, m(n, f) { - mount_component(e, n, f), t = !0; + mount_component(e, n, f), r = !0; }, p(n, f) { const u = {}; @@ -33753,8 +34898,8 @@ function create_fragment(r) { n[3]), f[0] & /*value*/ 1 && (u.variant = /*value*/ n[0] === null ? "dashed" : "solid"), f[0] & /*dragging*/ - 8388608 && (u.border_mode = /*dragging*/ - n[23] ? "focus" : "base"), f[0] & /*elem_id*/ + 4194304 && (u.border_mode = /*dragging*/ + n[22] ? "focus" : "base"), f[0] & /*elem_id*/ 2 && (u.elem_id = /*elem_id*/ n[1]), f[0] & /*elem_classes*/ 4 && (u.elem_classes = /*elem_classes*/ @@ -33764,26 +34909,26 @@ function create_fragment(r) { 32768 && (u.scale = /*scale*/ n[15]), f[0] & /*min_width*/ 65536 && (u.min_width = /*min_width*/ - n[16]), f[0] & /*errors, _value, _selectable, label, show_label, height, config, confidenceLabel, moldata, gradio, showviewer, interactive, file_count, file_types, root, value, dragging, loading_status*/ - 16662513 | f[1] & /*$$scope*/ - 4096 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); + n[16]), f[0] & /*errors, value, _selectable, label, show_label, height, config, confidenceLabel, moldata, gradio, showviewer, interactive, file_count, file_types, root, dragging, loading_status*/ + 8273905 | f[1] & /*$$scope*/ + 1024 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, i(n) { - t || (transition_in(e.$$.fragment, n), t = !0); + r || (transition_in(e.$$.fragment, n), r = !0); }, o(n) { - transition_out(e.$$.fragment, n), t = !1; + transition_out(e.$$.fragment, n), r = !1; }, d(n) { destroy_component(e, n); } }; } -async function fetchFileContent(r) { - return await (await fetch(r)).text(); +async function fetchFileContent(t) { + return await (await fetch(t)).text(); } -function instance(r, e, t) { - let n, { elem_id: f = "" } = e, { elem_classes: u = [] } = e, { visible: y = !0 } = e, { value: h } = e, { interactive: _ } = e, { root: E } = e, { label: c } = e, { show_label: C } = e, { height: b = void 0 } = e, { reps: A = [] } = e, { config: S = {} } = e, { confidenceLabel: s = "" } = e, { showviewer: o = !0 } = e, { proxy_url: w } = e, { _selectable: p = !1 } = e, { loading_status: v } = e, { container: a = !0 } = e, { scale: l = null } = e, { min_width: g = void 0 } = e, { gradio: M } = e, { file_count: L } = e, { file_types: T = ["file"] } = e, D = n, I = !1, z = { +function instance(t, e, r) { + let { elem_id: n = "" } = e, { elem_classes: f = [] } = e, { visible: u = !0 } = e, { value: b } = e, { interactive: h } = e, { root: _ } = e, { label: E } = e, { show_label: c } = e, { height: S = void 0 } = e, { reps: y = [] } = e, { config: w = {} } = e, { confidenceLabel: L = "" } = e, { showviewer: s = !0 } = e, { _selectable: o = !1 } = e, { loading_status: A } = e, { container: p = !0 } = e, { scale: v = null } = e, { min_width: a = void 0 } = e, { gradio: l } = e, { file_count: g } = e, { file_types: M = ["file"] } = e, C = b, T = !1, D = { model: { type: Number, default: 0 }, chain: { type: String, default: "" }, resname: { type: String, default: "" }, @@ -33815,99 +34960,96 @@ function instance(r, e, t) { around: { type: Number, default: 0 }, byres: { type: Boolean, default: !1 }, visible: { type: Boolean, default: !0 } - }, P = null, B = ["pdb", "sdf", "mol2"], k = []; - async function N(q) { - if (q == null) + }, I = null, B = ["pdb", "sdf", "mol2"], P = []; + async function z(X) { + if (X == null) return []; - if (Array.isArray(q)) { - let me = []; - for (const ne of q) { - let fe = ne.orig_name.split(".").pop(); - if (!B.includes(fe)) { - k.push(`Invalid file extension for ${ne.orig_name}. Expected one of ${B.join(", ")}, got ${fe}`), t(20, P = null); + if (Array.isArray(X)) { + let oe = []; + for (const te of X) { + let ve = te.orig_name.split(".").pop(); + if (!B.includes(ve)) { + P.push(`Invalid file extension for ${te.orig_name}. Expected one of ${B.join(", ")}, got ${ve}`), r(20, I = null); continue; } - me.push({ - data: await fetchFileContent(ne.url), - name: ne.orig_name, - format: fe, + oe.push({ + data: await fetchFileContent(te.url), + name: te.orig_name, + format: ve, asFrames: !1 }); } - t(20, P = me); - } else if (typeof q == "object" && q !== null) { - let me = q.orig_name.split(".").pop(); - if (!B.includes(me)) - k.push(`Invalid file extension for ${q.orig_name}. Expected one of ${B.join(", ")}, got ${me}`), t(20, P = null); + r(20, I = oe); + } else if (typeof X == "object" && X !== null) { + let oe = X.orig_name.split(".").pop(); + if (!B.includes(oe)) + P.push(`Invalid file extension for ${X.orig_name}. Expected one of ${B.join(", ")}, got ${oe}`), r(20, I = null); else { - let ne = await fetchFileContent(q.url); - t(20, P = [ + let te = await fetchFileContent(X.url); + console.log("t", te), r(20, I = [ { - data: ne, - name: q.orig_name, + data: te, + name: X.orig_name, format: "pdb", asFrames: !1 } ]); } } else - t(20, P = null); + r(20, I = null); } - let $ = 0, F = []; - const G = ({ detail: q }) => M.dispatch("select", q), H = ({ detail: q }) => { - t(21, k = []), t(0, h = q); - }, U = ({ detail: q }) => t(23, I = q), V = () => M.dispatch("clear"), Q = ({ detail: q }) => M.dispatch("select", q), ae = () => M.dispatch("error", "identifier not found in database, check spelling"), oe = () => M.dispatch("upload"); - return r.$$set = (q) => { - "elem_id" in q && t(1, f = q.elem_id), "elem_classes" in q && t(2, u = q.elem_classes), "visible" in q && t(3, y = q.visible), "value" in q && t(0, h = q.value), "interactive" in q && t(4, _ = q.interactive), "root" in q && t(5, E = q.root), "label" in q && t(6, c = q.label), "show_label" in q && t(7, C = q.show_label), "height" in q && t(8, b = q.height), "reps" in q && t(25, A = q.reps), "config" in q && t(9, S = q.config), "confidenceLabel" in q && t(10, s = q.confidenceLabel), "showviewer" in q && t(11, o = q.showviewer), "proxy_url" in q && t(26, w = q.proxy_url), "_selectable" in q && t(12, p = q._selectable), "loading_status" in q && t(13, v = q.loading_status), "container" in q && t(14, a = q.container), "scale" in q && t(15, l = q.scale), "min_width" in q && t(16, g = q.min_width), "gradio" in q && t(17, M = q.gradio), "file_count" in q && t(18, L = q.file_count), "file_types" in q && t(19, T = q.file_types); - }, r.$$.update = () => { - r.$$.dirty[0] & /*value, root, proxy_url*/ - 67108897 && t(22, n = normalise_file(h, E, w)), r.$$.dirty[0] & /*old_value, _value, gradio*/ - 138543104 && JSON.stringify(D) !== JSON.stringify(n) && (M.dispatch("change"), t(27, D = n), console.log("value change", n)), r.$$.dirty[0] & /*moldata*/ - 1048576 && t(28, $ = P ? P.length : 0), r.$$.dirty[0] & /*reps, errors, lenMoldata*/ - 304087040 && (A.forEach((q) => { - for (const [me, ne] of Object.entries(z)) - q[me] === void 0 && (q[me] = ne.default), q[me].constructor != ne.type && k.push(`Invalid type for ${me} in reps. Expected ${ne.type}, got ${typeof q[me]}`); - }), A.forEach((q) => { - q.model <= $ && F.push(q); - })), r.$$.dirty[0] & /*_value*/ - 4194304 && N(n); + let k = 0, N = []; + const R = ({ detail: X }) => l.dispatch("select", X), U = ({ detail: X }) => { + r(21, P = []), r(0, b = X); + }, W = ({ detail: X }) => r(22, T = X), G = () => l.dispatch("clear"), F = ({ detail: X }) => l.dispatch("select", X), V = () => l.dispatch("error", "identifier not found in database, check spelling"), J = () => l.dispatch("upload"); + return t.$$set = (X) => { + "elem_id" in X && r(1, n = X.elem_id), "elem_classes" in X && r(2, f = X.elem_classes), "visible" in X && r(3, u = X.visible), "value" in X && r(0, b = X.value), "interactive" in X && r(4, h = X.interactive), "root" in X && r(5, _ = X.root), "label" in X && r(6, E = X.label), "show_label" in X && r(7, c = X.show_label), "height" in X && r(8, S = X.height), "reps" in X && r(24, y = X.reps), "config" in X && r(9, w = X.config), "confidenceLabel" in X && r(10, L = X.confidenceLabel), "showviewer" in X && r(11, s = X.showviewer), "_selectable" in X && r(12, o = X._selectable), "loading_status" in X && r(13, A = X.loading_status), "container" in X && r(14, p = X.container), "scale" in X && r(15, v = X.scale), "min_width" in X && r(16, a = X.min_width), "gradio" in X && r(17, l = X.gradio), "file_count" in X && r(18, g = X.file_count), "file_types" in X && r(19, M = X.file_types); + }, t.$$.update = () => { + t.$$.dirty[0] & /*old_value, value, gradio*/ + 33685505 && JSON.stringify(C) !== JSON.stringify(b) && (l.dispatch("change"), r(25, C = b), console.log("value change", b)), t.$$.dirty[0] & /*moldata*/ + 1048576 && r(26, k = I ? I.length : 0), t.$$.dirty[0] & /*reps, errors, lenMoldata*/ + 85983232 && (y.forEach((X) => { + for (const [oe, te] of Object.entries(D)) + X[oe] === void 0 && (X[oe] = te.default), X[oe].constructor != te.type && P.push(`Invalid type for ${oe} in reps. Expected ${te.type}, got ${typeof X[oe]}`); + }), y.forEach((X) => { + X.model <= k && N.push(X); + })), t.$$.dirty[0] & /*value*/ + 1 && z(b); }, [ - h, + b, + n, f, u, - y, + h, _, E, c, - C, - b, S, + w, + L, s, o, + A, p, v, a, l, g, M, - L, - T, + I, P, + T, + N, + y, + C, k, - n, - I, - F, - A, - w, - D, - $, - G, - H, + R, U, + W, + G, + F, V, - Q, - ae, - oe + J ]; } class Index extends SvelteComponent { @@ -33928,11 +35070,10 @@ class Index extends SvelteComponent { label: 6, show_label: 7, height: 8, - reps: 25, + reps: 24, config: 9, confidenceLabel: 10, showviewer: 11, - proxy_url: 26, _selectable: 12, loading_status: 13, container: 14, @@ -34001,7 +35142,7 @@ class Index extends SvelteComponent { this.$$set({ height: e }), flush(); } get reps() { - return this.$$.ctx[25]; + return this.$$.ctx[24]; } set reps(e) { this.$$set({ reps: e }), flush(); @@ -34024,12 +35165,6 @@ class Index extends SvelteComponent { set showviewer(e) { this.$$set({ showviewer: e }), flush(); } - get proxy_url() { - return this.$$.ctx[26]; - } - set proxy_url(e) { - this.$$set({ proxy_url: e }), flush(); - } get _selectable() { return this.$$.ctx[12]; }