diff --git "a/src/backend/gradio_cofoldinginput/templates/component/index.js" "b/src/backend/gradio_cofoldinginput/templates/component/index.js" --- "a/src/backend/gradio_cofoldinginput/templates/component/index.js" +++ "b/src/backend/gradio_cofoldinginput/templates/component/index.js" @@ -19,11 +19,11 @@ const Block_svelte_svelte_type_style_lang = "", { } = window.__gradio__svelte__internal; function create_dynamic_element(y) { let s, e, l; - const g = ( + const p = ( /*#slots*/ y[18].default ), _ = create_slot$3( - g, + p, y, /*$$scope*/ y[17], @@ -43,8 +43,8 @@ function create_dynamic_element(y) { y[3].join(" ") + " svelte-1t38q2d" } ], o = {}; - for (let p = 0; p < x.length; p += 1) - o = assign$1(o, x[p]); + for (let g = 0; g < x.length; g += 1) + o = assign$1(o, x[g]); return { c() { s = element$c( @@ -104,110 +104,110 @@ function create_dynamic_element(y) { ), set_style$3(s, "min-width", `calc(min(${/*min_width*/ y[13]}px, 100%))`), set_style$3(s, "border-width", "var(--block-border-width)"); }, - m(p, E) { - insert$f(p, s, E), _ && _.m(s, null), l = !0; + m(g, E) { + insert$f(g, s, E), _ && _.m(s, null), l = !0; }, - p(p, E) { + p(g, E) { _ && _.p && (!l || E & /*$$scope*/ 131072) && update_slot_base$3( _, - g, p, + g, /*$$scope*/ - p[17], + g[17], l ? get_slot_changes$3( - g, + p, /*$$scope*/ - p[17], + g[17], E, null ) : get_all_dirty_from_scope$3( /*$$scope*/ - p[17] + g[17] ), null ), set_dynamic_element_data( /*tag*/ - p[14] + g[14] )(s, o = get_spread_update$1(x, [ (!l || E & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ - p[7] + g[7] ) }, (!l || E & /*elem_id*/ 4) && { id: ( /*elem_id*/ - p[2] + g[2] ) }, (!l || E & /*elem_classes*/ 8 && e !== (e = "block " + /*elem_classes*/ - p[3].join(" ") + " svelte-1t38q2d")) && { class: e } + g[3].join(" ") + " svelte-1t38q2d")) && { class: e } ])), toggle_class$7( s, "hidden", /*visible*/ - p[10] === !1 + g[10] === !1 ), toggle_class$7( s, "padded", /*padding*/ - p[6] + g[6] ), toggle_class$7( s, "border_focus", /*border_mode*/ - p[5] === "focus" + g[5] === "focus" ), toggle_class$7(s, "hide-container", !/*explicit_call*/ - p[8] && !/*container*/ - p[9]), E & /*height*/ + g[8] && !/*container*/ + g[9]), E & /*height*/ 1 && set_style$3( s, "height", /*get_dimension*/ - p[15]( + g[15]( /*height*/ - p[0] + g[0] ) ), E & /*width*/ 2 && set_style$3(s, "width", typeof /*width*/ - p[1] == "number" ? `calc(min(${/*width*/ - p[1]}px, 100%))` : ( + g[1] == "number" ? `calc(min(${/*width*/ + g[1]}px, 100%))` : ( /*get_dimension*/ - p[15]( + g[15]( /*width*/ - p[1] + g[1] ) )), E & /*variant*/ 16 && set_style$3( s, "border-style", /*variant*/ - p[4] + g[4] ), E & /*allow_overflow*/ 2048 && set_style$3( s, "overflow", /*allow_overflow*/ - p[11] ? "visible" : "hidden" + g[11] ? "visible" : "hidden" ), E & /*scale*/ 4096 && set_style$3( s, "flex-grow", /*scale*/ - p[12] + g[12] ), E & /*min_width*/ 8192 && set_style$3(s, "min-width", `calc(min(${/*min_width*/ - p[13]}px, 100%))`); + g[13]}px, 100%))`); }, - i(p) { - l || (transition_in$7(_, p), l = !0); + i(g) { + l || (transition_in$7(_, g), l = !0); }, - o(p) { - transition_out$7(_, p), l = !1; + o(g) { + transition_out$7(_, g), l = !1; }, - d(p) { - p && detach$f(s), _ && _.d(p); + d(g) { + g && detach$f(s), _ && _.d(g); } }; } @@ -220,12 +220,12 @@ function create_fragment$f(y) { c() { e && e.c(); }, - m(l, g) { - e && e.m(l, g), s = !0; + m(l, p) { + e && e.m(l, p), s = !0; }, - p(l, [g]) { + p(l, [p]) { /*tag*/ - l[14] && e.p(l, g); + l[14] && e.p(l, p); }, i(l) { s || (transition_in$7(e, l), s = !0); @@ -239,7 +239,7 @@ function create_fragment$f(y) { }; } function instance$d(y, s, e) { - let { $$slots: l = {}, $$scope: g } = s, { height: _ = void 0 } = s, { width: x = void 0 } = s, { elem_id: o = "" } = s, { elem_classes: p = [] } = s, { variant: E = "solid" } = s, { border_mode: u = "base" } = s, { padding: A = !0 } = s, { type: C = "normal" } = s, { test_id: L = void 0 } = s, { explicit_call: D = !1 } = s, { container: r = !0 } = s, { visible: n = !0 } = s, { allow_overflow: b = !0 } = s, { scale: f = null } = s, { min_width: c = 0 } = s, t = C === "fieldset" ? "fieldset" : "div"; + let { $$slots: l = {}, $$scope: p } = s, { height: _ = void 0 } = s, { width: x = void 0 } = s, { elem_id: o = "" } = s, { elem_classes: g = [] } = s, { variant: E = "solid" } = s, { border_mode: u = "base" } = s, { padding: A = !0 } = s, { type: L = "normal" } = s, { test_id: C = void 0 } = s, { explicit_call: D = !1 } = s, { container: r = !0 } = s, { visible: n = !0 } = s, { allow_overflow: b = !0 } = s, { scale: f = null } = s, { min_width: c = 0 } = s, t = L === "fieldset" ? "fieldset" : "div"; const a = (h) => { if (h !== void 0) { if (typeof h == "number") @@ -249,16 +249,16 @@ function instance$d(y, s, e) { } }; return y.$$set = (h) => { - "height" in h && e(0, _ = h.height), "width" in h && e(1, x = h.width), "elem_id" in h && e(2, o = h.elem_id), "elem_classes" in h && e(3, p = h.elem_classes), "variant" in h && e(4, E = h.variant), "border_mode" in h && e(5, u = h.border_mode), "padding" in h && e(6, A = h.padding), "type" in h && e(16, C = h.type), "test_id" in h && e(7, L = h.test_id), "explicit_call" in h && e(8, D = h.explicit_call), "container" in h && e(9, r = h.container), "visible" in h && e(10, n = h.visible), "allow_overflow" in h && e(11, b = h.allow_overflow), "scale" in h && e(12, f = h.scale), "min_width" in h && e(13, c = h.min_width), "$$scope" in h && e(17, g = h.$$scope); + "height" in h && e(0, _ = h.height), "width" in h && e(1, x = h.width), "elem_id" in h && e(2, o = h.elem_id), "elem_classes" in h && e(3, g = h.elem_classes), "variant" in h && e(4, E = h.variant), "border_mode" in h && e(5, u = h.border_mode), "padding" in h && e(6, A = h.padding), "type" in h && e(16, L = h.type), "test_id" in h && e(7, C = h.test_id), "explicit_call" in h && e(8, D = h.explicit_call), "container" in h && e(9, r = h.container), "visible" in h && e(10, n = h.visible), "allow_overflow" in h && e(11, b = h.allow_overflow), "scale" in h && e(12, f = h.scale), "min_width" in h && e(13, c = h.min_width), "$$scope" in h && e(17, p = h.$$scope); }, [ _, x, o, - p, + g, E, u, A, - L, + C, D, r, n, @@ -267,8 +267,8 @@ function instance$d(y, s, e) { c, t, a, - C, - g, + L, + p, l ]; } @@ -313,7 +313,7 @@ function create_fragment$e(y) { const l = ( /*#slots*/ y[1].default - ), g = create_slot$2( + ), p = create_slot$2( l, y, /*$$scope*/ @@ -322,15 +322,15 @@ function create_fragment$e(y) { ); return { c() { - s = element$b("div"), g && g.c(), attr$d(s, "class", "svelte-1hnfib2"); + s = element$b("div"), p && p.c(), attr$d(s, "class", "svelte-1hnfib2"); }, m(_, x) { - insert$e(_, s, x), g && g.m(s, null), e = !0; + insert$e(_, s, x), p && p.m(s, null), e = !0; }, p(_, [x]) { - g && g.p && (!e || x & /*$$scope*/ + p && p.p && (!e || x & /*$$scope*/ 1) && update_slot_base$2( - g, + p, l, _, /*$$scope*/ @@ -349,21 +349,21 @@ function create_fragment$e(y) { ); }, i(_) { - e || (transition_in$6(g, _), e = !0); + e || (transition_in$6(p, _), e = !0); }, o(_) { - transition_out$6(g, _), e = !1; + transition_out$6(p, _), e = !1; }, d(_) { - _ && detach$e(s), g && g.d(_); + _ && detach$e(s), p && p.d(_); } }; } function instance$c(y, s, e) { - let { $$slots: l = {}, $$scope: g } = s; + let { $$slots: l = {}, $$scope: p } = s; return y.$$set = (_) => { - "$$scope" in _ && e(0, g = _.$$scope); - }, [g, l]; + "$$scope" in _ && e(0, p = _.$$scope); + }, [p, l]; } class Info extends SvelteComponent$e { constructor(s) { @@ -406,13 +406,13 @@ function create_if_block$7(y) { c() { create_component$5(s.$$.fragment); }, - m(l, g) { - mount_component$5(s, l, g), e = !0; + m(l, p) { + mount_component$5(s, l, p), e = !0; }, - p(l, g) { + p(l, p) { const _ = {}; - g & /*$$scope, info*/ - 10 && (_.$$scope = { dirty: g, ctx: l }), s.$set(_); + p & /*$$scope, info*/ + 10 && (_.$$scope = { dirty: p, ctx: l }), s.$set(_); }, i(l) { e || (transition_in$5(s.$$.fragment, l), e = !0); @@ -451,7 +451,7 @@ function create_default_slot$2(y) { }; } function create_fragment$d(y) { - let s, e, l, g; + let s, e, l, p; const _ = ( /*#slots*/ y[2].default @@ -477,60 +477,60 @@ function create_fragment$d(y) { y[1] != null ); }, - m(p, E) { - insert$d(p, s, E), x && x.m(s, null), insert$d(p, e, E), o && o.m(p, E), insert$d(p, l, E), g = !0; + m(g, E) { + insert$d(g, s, E), x && x.m(s, null), insert$d(g, e, E), o && o.m(g, E), insert$d(g, l, E), p = !0; }, - p(p, [E]) { - x && x.p && (!g || E & /*$$scope*/ + p(g, [E]) { + x && x.p && (!p || E & /*$$scope*/ 8) && update_slot_base$1( x, _, - p, + g, /*$$scope*/ - p[3], - g ? get_slot_changes$1( + g[3], + p ? get_slot_changes$1( _, /*$$scope*/ - p[3], + g[3], E, null ) : get_all_dirty_from_scope$1( /*$$scope*/ - p[3] + g[3] ), null - ), (!g || E & /*show_label*/ + ), (!p || E & /*show_label*/ 1) && toggle_class$6(s, "sr-only", !/*show_label*/ - p[0]), (!g || E & /*show_label*/ + g[0]), (!p || E & /*show_label*/ 1) && toggle_class$6(s, "hide", !/*show_label*/ - p[0]), (!g || E & /*info*/ + g[0]), (!p || E & /*info*/ 2) && toggle_class$6( s, "has-info", /*info*/ - p[1] != null + g[1] != null ), /*info*/ - p[1] ? o ? (o.p(p, E), E & /*info*/ - 2 && transition_in$5(o, 1)) : (o = create_if_block$7(p), o.c(), transition_in$5(o, 1), o.m(l.parentNode, l)) : o && (group_outros$5(), transition_out$5(o, 1, 1, () => { + g[1] ? o ? (o.p(g, E), E & /*info*/ + 2 && transition_in$5(o, 1)) : (o = create_if_block$7(g), o.c(), transition_in$5(o, 1), o.m(l.parentNode, l)) : o && (group_outros$5(), transition_out$5(o, 1, 1, () => { o = null; }), check_outros$5()); }, - i(p) { - g || (transition_in$5(x, p), transition_in$5(o), g = !0); + i(g) { + p || (transition_in$5(x, g), transition_in$5(o), p = !0); }, - o(p) { - transition_out$5(x, p), transition_out$5(o), g = !1; + o(g) { + transition_out$5(x, g), transition_out$5(o), p = !1; }, - d(p) { - p && (detach$d(s), detach$d(e), detach$d(l)), x && x.d(p), o && o.d(p); + d(g) { + g && (detach$d(s), detach$d(e), detach$d(l)), x && x.d(g), o && o.d(g); } }; } function instance$b(y, s, e) { - let { $$slots: l = {}, $$scope: g } = s, { show_label: _ = !0 } = s, { info: x = void 0 } = s; + let { $$slots: l = {}, $$scope: p } = s, { show_label: _ = !0 } = s, { info: x = void 0 } = s; return y.$$set = (o) => { - "show_label" in o && e(0, _ = o.show_label), "info" in o && e(1, x = o.info), "$$scope" in o && e(3, g = o.$$scope); - }, [_, x, l, g]; + "show_label" in o && e(0, _ = o.show_label), "info" in o && e(1, x = o.info), "$$scope" in o && e(3, p = o.$$scope); + }, [_, x, l, p]; } class BlockTitle extends SvelteComponent$d { constructor(s) { @@ -554,8 +554,8 @@ function create_fragment$c(y) { c() { s = svg_element$3("svg"), e = svg_element$3("polyline"), attr$b(e, "points", "20 6 9 17 4 12"), attr$b(s, "xmlns", "http://www.w3.org/2000/svg"), attr$b(s, "viewBox", "2 0 20 20"), attr$b(s, "fill", "none"), attr$b(s, "stroke", "currentColor"), attr$b(s, "stroke-width", "3"), attr$b(s, "stroke-linecap", "round"), attr$b(s, "stroke-linejoin", "round"); }, - m(l, g) { - insert$c(l, s, g), append$a(s, e); + m(l, p) { + insert$c(l, s, p), append$a(s, e); }, p: noop$c, i: noop$c, @@ -587,14 +587,14 @@ function create_fragment$b(y) { c() { s = svg_element$2("svg"), e = svg_element$2("path"), l = svg_element$2("path"), attr$a(e, "fill", "currentColor"), attr$a(e, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), attr$a(l, "fill", "currentColor"), attr$a(l, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), attr$a(s, "xmlns", "http://www.w3.org/2000/svg"), attr$a(s, "viewBox", "0 0 33 33"), attr$a(s, "color", "currentColor"); }, - m(g, _) { - insert$b(g, s, _), append$9(s, e), append$9(s, l); + m(p, _) { + insert$b(p, s, _), append$9(s, e), append$9(s, l); }, p: noop$b, i: noop$b, o: noop$b, - d(g) { - g && detach$b(s); + d(p) { + p && detach$b(s); } }; } @@ -937,8 +937,8 @@ function create_if_block$6(y) { c() { s = element$9("button"), s.innerHTML = ' Covalent modifcation', attr$9(s, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"); }, - m(g, _) { - insert$a(g, s, _), e || (l = listen$4( + m(p, _) { + insert$a(p, s, _), e || (l = listen$4( s, "click", /*click_handler_3*/ @@ -946,22 +946,22 @@ function create_if_block$6(y) { ), e = !0); }, p: noop$a, - d(g) { - g && detach$a(s), e = !1, l(); + d(p) { + p && detach$a(s), e = !1, l(); } }; } function create_fragment$a(y) { - let s, e, l, g, _, x, o, p, E, u, A = ( + let s, e, l, p, _, x, o, g, E, u, A = ( /*displayCovMod*/ y[0] && create_if_block$6(y) ); return { c() { - s = element$9("div"), e = element$9("div"), l = element$9("button"), l.innerHTML = ' Protein', g = space$8(), _ = element$9("button"), _.innerHTML = ' Nucleic acid', x = space$8(), o = element$9("button"), o.innerHTML = ' Small molecule', p = space$8(), A && A.c(), attr$9(l, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(_, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(o, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(e, "class", "flex justify-center mt-2 svelte-8wrmgx"), attr$9(s, "class", "svelte-8wrmgx"); + s = element$9("div"), e = element$9("div"), l = element$9("button"), l.innerHTML = ' Protein', p = space$8(), _ = element$9("button"), _.innerHTML = ' Nucleic acid', x = space$8(), o = element$9("button"), o.innerHTML = ' Small molecule', g = space$8(), A && A.c(), attr$9(l, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(_, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(o, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(e, "class", "flex justify-center mt-2 svelte-8wrmgx"), attr$9(s, "class", "svelte-8wrmgx"); }, - m(C, L) { - insert$a(C, s, L), append$8(s, e), append$8(e, l), append$8(e, g), append$8(e, _), append$8(e, x), append$8(e, o), append$8(e, p), A && A.m(e, null), E || (u = [ + m(L, C) { + insert$a(L, s, C), append$8(s, e), append$8(e, l), append$8(e, p), append$8(e, _), append$8(e, x), append$8(e, o), append$8(e, g), A && A.m(e, null), E || (u = [ listen$4( l, "click", @@ -982,28 +982,28 @@ function create_fragment$a(y) { ) ], E = !0); }, - p(C, [L]) { + p(L, [C]) { /*displayCovMod*/ - C[0] ? A ? A.p(C, L) : (A = create_if_block$6(C), A.c(), A.m(e, null)) : A && (A.d(1), A = null); + L[0] ? A ? A.p(L, C) : (A = create_if_block$6(L), A.c(), A.m(e, null)) : A && (A.d(1), A = null); }, i: noop$a, o: noop$a, - d(C) { - C && detach$a(s), A && A.d(), E = !1, run_all$4(u); + d(L) { + L && detach$a(s), A && A.d(), E = !1, run_all$4(u); } }; } function instance$a(y, s, e) { const l = createEventDispatcher$5(); - let { vals: g = [] } = s; - function _(C) { - l("addNewChain", { type: C }); + let { vals: p = [] } = s; + function _(L) { + l("addNewChain", { type: L }); } function x() { l("addCovalentModification"); } let o = !1; - const p = () => { + const g = () => { _("protein"); }, E = () => { _("DNA"); @@ -1012,17 +1012,17 @@ function instance$a(y, s, e) { }, A = () => { x(); }; - return y.$$set = (C) => { - "vals" in C && e(3, g = C.vals); + return y.$$set = (L) => { + "vals" in L && e(3, p = L.vals); }, y.$$.update = () => { y.$$.dirty & /*vals*/ - 8 && e(0, o = g.filter((C) => C.class === "protein" && C.sequence.length > 0).length > 0 && g.filter((C) => C.class === "ligand" && C.sdf != "").length > 0); + 8 && e(0, o = p.filter((L) => L.class === "protein" && L.sequence.length > 0).length > 0 && p.filter((L) => L.class === "ligand" && L.sdf != "").length > 0); }, [ o, _, x, - g, p, + g, E, u, A @@ -1050,17 +1050,17 @@ const SearchInput_svelte_svelte_type_style_lang = "", { text: text$7 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4 } = window.__gradio__svelte__internal; function create_fragment$9(y) { - let s, e, l, g, _, x = ( + let s, e, l, p, _, x = ( /*databases*/ y[1][ /*currentSel*/ y[3] ] + "" - ), o, p, E, u, A, C, L, D, r, n; + ), o, g, E, u, A, L, C, D, r, n; return { c() { - s = element$8("form"), e = element$8("div"), l = element$8("label"), l.textContent = "Search", g = space$7(), _ = element$8("button"), o = text$7(x), p = space$7(), E = element$8("div"), E.innerHTML = '', u = space$7(), A = element$8("div"), C = element$8("input"), L = space$7(), D = element$8("button"), D.innerHTML = ' Search', attr$8(l, "for", "search-dropdown"), attr$8(l, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white svelte-8wrmgx"), attr$8(_, "id", "dropdown-button"), attr$8(_, "data-dropdown-toggle", "dropdown"), attr$8(_, "class", "flex-shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600 svelte-8wrmgx"), attr$8(_, "type", "button"), attr$8(E, "id", "dropdown"), attr$8(E, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 svelte-8wrmgx"), attr$8(C, "type", "search"), attr$8(C, "id", "search-dropdown"), attr$8(C, "class", "block p-2.5 w-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500 svelte-8wrmgx"), attr$8( - C, + s = element$8("form"), e = element$8("div"), l = element$8("label"), l.textContent = "Search", p = space$7(), _ = element$8("button"), o = text$7(x), g = space$7(), E = element$8("div"), E.innerHTML = '', u = space$7(), A = element$8("div"), L = element$8("input"), C = space$7(), D = element$8("button"), D.innerHTML = ' Search', attr$8(l, "for", "search-dropdown"), attr$8(l, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white svelte-8wrmgx"), attr$8(_, "id", "dropdown-button"), attr$8(_, "data-dropdown-toggle", "dropdown"), attr$8(_, "class", "flex-shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600 svelte-8wrmgx"), attr$8(_, "type", "button"), attr$8(E, "id", "dropdown"), attr$8(E, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 svelte-8wrmgx"), attr$8(L, "type", "search"), attr$8(L, "id", "search-dropdown"), attr$8(L, "class", "block p-2.5 w-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500 svelte-8wrmgx"), attr$8( + L, "placeholder", /*placeholder*/ y[2][ @@ -1070,9 +1070,9 @@ function create_fragment$9(y) { ), attr$8(D, "type", "submit"), attr$8(D, "class", "absolute top-0 end-0 p-2.5 text-sm font-medium h-full text-white bg-blue-700 rounded-e-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 svelte-8wrmgx"), attr$8(A, "class", "relative w-full svelte-8wrmgx"), attr$8(e, "class", "flex svelte-8wrmgx"), attr$8(s, "class", "max-w-lg mx-auto mb-2 my-2 svelte-8wrmgx"); }, m(b, f) { - insert$9(b, s, f), append$7(s, e), append$7(e, l), append$7(e, g), append$7(e, _), append$7(_, o), append$7(e, p), append$7(e, E), append$7(e, u), append$7(e, A), append$7(A, C), append$7(A, L), append$7(A, D), r || (n = [ + insert$9(b, s, f), append$7(s, e), append$7(e, l), append$7(e, p), append$7(e, _), append$7(_, o), append$7(e, g), append$7(e, E), append$7(e, u), append$7(e, A), append$7(A, L), append$7(A, C), append$7(A, D), r || (n = [ listen$3( - C, + L, "input", /*input_handler*/ y[7] @@ -1093,7 +1093,7 @@ function create_fragment$9(y) { } function instance$9(y, s, e) { const l = createEventDispatcher$4(); - let { database: g = "rcsb-bioass" } = s, { index: _ = 0 } = s, x = { + let { database: p = "rcsb-bioass" } = s, { index: _ = 0 } = s, x = { "rcsb-3ligand": "RCSB 3-Letter Codes", pubchem: "Pubchem", "rcsb-bioass": "RCSB BioAssembly" @@ -1101,24 +1101,24 @@ function instance$9(y, s, e) { "rcsb-3ligand": "e.g HEM, ZN, K, GOL ...", pubchem: "molecule name", "rcsb-bioass": "4 Letter PDB Code" - }, p = g, E = ""; + }, g = p, E = ""; function u() { l("triggerFetch", { text: E, - database: p, + database: g, index: _ }); } - const A = (C) => e(0, E = C.target.value); - return y.$$set = (C) => { - "database" in C && e(5, g = C.database), "index" in C && e(6, _ = C.index); + const A = (L) => e(0, E = L.target.value); + return y.$$set = (L) => { + "database" in L && e(5, p = L.database), "index" in L && e(6, _ = L.index); }, [ E, x, o, - p, - u, g, + u, + p, _, A ]; @@ -1156,10 +1156,10 @@ function create_each_block_1$2(y) { let s, e, l = ( /*letter*/ y[6] + "" - ), g; + ), p; return { c() { - s = element$7("span"), e = element$7("div"), g = text$6(l), attr$7(e, "class", "inline-block p-0.5 svelte-hhspdt"), attr$7(e, "title", "residue " + /*chunk_ids*/ + s = element$7("span"), e = element$7("div"), p = text$6(l), attr$7(e, "class", "inline-block p-0.5 svelte-hhspdt"), attr$7(e, "title", "residue " + /*chunk_ids*/ y[1][ /*i*/ y[5] @@ -1169,7 +1169,7 @@ function create_each_block_1$2(y) { ]), attr$7(s, "class", "p-0.1 text-center w-full inline hover:font-bold cursor-pointer item-selectable ds-selectable svelte-hhspdt"), set_style$2(s, "font-family", "monospace"); }, m(_, x) { - insert$8(_, s, x), append$6(s, e), append$6(e, g); + insert$8(_, s, x), append$6(s, e), append$6(e, p); }, p: noop$8, d(_) { @@ -1181,20 +1181,20 @@ function create_each_block$2(y) { let s, e, l = ensure_array_like$2( /*chunk*/ y[3] - ), g = []; + ), p = []; for (let _ = 0; _ < l.length; _ += 1) - g[_] = create_each_block_1$2(get_each_context_1$2(y, l, _)); + p[_] = create_each_block_1$2(get_each_context_1$2(y, l, _)); return { c() { s = element$7("div"); - for (let _ = 0; _ < g.length; _ += 1) - g[_].c(); + for (let _ = 0; _ < p.length; _ += 1) + p[_].c(); e = space$6(), attr$7(s, "class", "sequence__chunk svelte-hhspdt"); }, m(_, x) { insert$8(_, s, x); - for (let o = 0; o < g.length; o += 1) - g[o] && g[o].m(s, null); + for (let o = 0; o < p.length; o += 1) + p[o] && p[o].m(s, null); append$6(s, e); }, p(_, x) { @@ -1206,16 +1206,16 @@ function create_each_block$2(y) { ); let o; for (o = 0; o < l.length; o += 1) { - const p = get_each_context_1$2(_, l, o); - g[o] ? g[o].p(p, x) : (g[o] = create_each_block_1$2(p), g[o].c(), g[o].m(s, e)); + const g = get_each_context_1$2(_, l, o); + p[o] ? p[o].p(g, x) : (p[o] = create_each_block_1$2(g), p[o].c(), p[o].m(s, e)); } - for (; o < g.length; o += 1) - g[o].d(1); - g.length = l.length; + for (; o < p.length; o += 1) + p[o].d(1); + p.length = l.length; } }, d(_) { - _ && detach$8(s), destroy_each$2(g, _); + _ && detach$8(s), destroy_each$2(p, _); } }; } @@ -1224,30 +1224,30 @@ function create_fragment$8(y) { /*chunked_seq*/ y[0] ), l = []; - for (let g = 0; g < e.length; g += 1) - l[g] = create_each_block$2(get_each_context$2(y, e, g)); + for (let p = 0; p < e.length; p += 1) + l[p] = create_each_block$2(get_each_context$2(y, e, p)); return { c() { s = element$7("div"); - for (let g = 0; g < l.length; g += 1) - l[g].c(); + for (let p = 0; p < l.length; p += 1) + l[p].c(); attr$7(s, "class", "sequence_container text-xs svelte-hhspdt"); }, - m(g, _) { - insert$8(g, s, _); + m(p, _) { + insert$8(p, s, _); for (let x = 0; x < l.length; x += 1) l[x] && l[x].m(s, null); }, - p(g, [_]) { + p(p, [_]) { if (_ & /*chunked_seq, chunk_ids*/ 3) { e = ensure_array_like$2( /*chunked_seq*/ - g[0] + p[0] ); let x; for (x = 0; x < e.length; x += 1) { - const o = get_each_context$2(g, e, x); + const o = get_each_context$2(p, e, x); l[x] ? l[x].p(o, _) : (l[x] = create_each_block$2(o), l[x].c(), l[x].m(s, null)); } for (; x < l.length; x += 1) @@ -1257,16 +1257,16 @@ function create_fragment$8(y) { }, i: noop$8, o: noop$8, - d(g) { - g && detach$8(s), destroy_each$2(l, g); + d(p) { + p && detach$8(s), destroy_each$2(l, p); } }; } function instance$8(y, s, e) { - let { seq: l = "" } = s, g = l.match(/.{1,10}/g), _ = g.map((x, o) => x.split("").map((p, E) => o * 10 + E + 1)); + let { seq: l = "" } = s, p = l.match(/.{1,10}/g), _ = p.map((x, o) => x.split("").map((g, E) => o * 10 + E + 1)); return y.$$set = (x) => { "seq" in x && e(2, l = x.seq); - }, [g, _, l]; + }, [p, _, l]; } class Sequence extends SvelteComponent$8 { constructor(s) { @@ -1309,9 +1309,9 @@ var _3Dmol = { exports: {} }; /*! ./text */ "./node_modules/iobuffer/lib-esm/text.browser.js" ); - const g = 1024 * 8, _ = (() => { - const p = new Uint8Array(4), E = new Uint32Array(p.buffer); - return !((E[0] = 1) & p[0]); + const p = 1024 * 8, _ = (() => { + const g = new Uint8Array(4), E = new Uint32Array(g.buffer); + return !((E[0] = 1) & g[0]); })(), x = { int8: globalThis.Int8Array, uint8: globalThis.Uint8Array, @@ -1333,12 +1333,12 @@ var _3Dmol = { exports: {} }; * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer. * @param options */ - constructor(E = g, u = {}) { + constructor(E = p, u = {}) { let A = !1; typeof E == "number" ? E = new ArrayBuffer(E) : (A = !0, this.lastWrittenByte = E.byteLength); - const C = u.offset ? u.offset >>> 0 : 0, L = E.byteLength - C; - let D = C; - (ArrayBuffer.isView(E) || E instanceof o) && (E.byteLength !== E.buffer.byteLength && (D = E.byteOffset + C), E = E.buffer), A ? this.lastWrittenByte = L : this.lastWrittenByte = 0, this.buffer = E, this.length = L, this.byteLength = L, this.byteOffset = D, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, D, L), this._mark = 0, this._marks = []; + const L = u.offset ? u.offset >>> 0 : 0, C = E.byteLength - L; + let D = L; + (ArrayBuffer.isView(E) || E instanceof o) && (E.byteLength !== E.buffer.byteLength && (D = E.byteOffset + L), E = E.buffer), A ? this.lastWrittenByte = C : this.lastWrittenByte = 0, this.buffer = E, this.length = C, this.byteLength = C, this.byteOffset = D, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, D, C), this._mark = 0, this._marks = []; } /** * Checks if the memory allocated to the buffer is sufficient to store more @@ -1444,8 +1444,8 @@ var _3Dmol = { exports: {} }; */ ensureAvailable(E = 1) { if (!this.available(E)) { - const A = (this.offset + E) * 2, C = new Uint8Array(A); - C.set(new Uint8Array(this.buffer)), this.buffer = C.buffer, this.length = this.byteLength = A, this._data = new DataView(this.buffer); + const A = (this.offset + E) * 2, L = new Uint8Array(A); + L.set(new Uint8Array(this.buffer)), this.buffer = L.buffer, this.length = this.byteLength = A, this._data = new DataView(this.buffer); } return this; } @@ -1487,14 +1487,14 @@ var _3Dmol = { exports: {} }; * @param type - number type of elements to read */ readArray(E, u) { - const A = x[u].BYTES_PER_ELEMENT * E, C = this.byteOffset + this.offset, L = this.buffer.slice(C, C + A); + const A = x[u].BYTES_PER_ELEMENT * E, L = this.byteOffset + this.offset, C = this.buffer.slice(L, L + A); if (this.littleEndian === _ && u !== "uint8" && u !== "int8") { - const r = new Uint8Array(this.buffer.slice(C, C + A)); + const r = new Uint8Array(this.buffer.slice(L, L + A)); r.reverse(); const n = new x[u](r.buffer); return this.offset += A, n.reverse(), n; } - const D = new x[u](L); + const D = new x[u](C); return this.offset += A, D; } /** @@ -1732,12 +1732,12 @@ var _3Dmol = { exports: {} }; } Object.defineProperty(s.prototype, "encoding", { value: "utf-8" - }), s.prototype.encode = function(l, g = { stream: !1 }) { - if (g.stream) + }), s.prototype.encode = function(l, p = { stream: !1 }) { + if (p.stream) throw new Error("Failed to encode: the 'stream' option is unsupported."); let _ = 0; const x = l.length; - let o = 0, p = Math.max(32, x + (x >> 1) + 7), E = new Uint8Array(p >> 3 << 3); + let o = 0, g = Math.max(32, x + (x >> 1) + 7), E = new Uint8Array(g >> 3 << 3); for (; _ < x; ) { let u = l.charCodeAt(_++); if (u >= 55296 && u <= 56319) { @@ -1749,8 +1749,8 @@ var _3Dmol = { exports: {} }; continue; } if (o + 4 > E.length) { - p += 8, p *= 1 + _ / l.length * 2, p = p >> 3 << 3; - const A = new Uint8Array(p); + g += 8, g *= 1 + _ / l.length * 2, g = g >> 3 << 3; + const A = new Uint8Array(g); A.set(E), E = A; } if (u & 4294967168) @@ -1770,41 +1770,41 @@ var _3Dmol = { exports: {} }; } return E.slice(0, o); }; - function e(l = "utf-8", g = { fatal: !1 }) { + function e(l = "utf-8", p = { fatal: !1 }) { if (l !== "utf-8") throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${l}') is invalid.`); - if (g.fatal) + if (p.fatal) throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported."); } Object.defineProperty(e.prototype, "encoding", { value: "utf-8" }), Object.defineProperty(e.prototype, "fatal", { value: !1 }), Object.defineProperty(e.prototype, "ignoreBOM", { value: !1 - }), e.prototype.decode = function(l, g = { stream: !1 }) { - if (g.stream) + }), e.prototype.decode = function(l, p = { stream: !1 }) { + if (p.stream) throw new Error("Failed to decode: the 'stream' option is unsupported."); const _ = new Uint8Array(l); let x = 0; - const o = _.length, p = []; + const o = _.length, g = []; for (; x < o; ) { const E = _[x++]; if (E === 0) break; if (!(E & 128)) - p.push(E); + g.push(E); else if ((E & 224) === 192) { const u = _[x++] & 63; - p.push((E & 31) << 6 | u); + g.push((E & 31) << 6 | u); } else if ((E & 240) === 224) { const u = _[x++] & 63, A = _[x++] & 63; - p.push((E & 31) << 12 | u << 6 | A); + g.push((E & 31) << 12 | u << 6 | A); } else if ((E & 248) === 240) { - const u = _[x++] & 63, A = _[x++] & 63, C = _[x++] & 63; - let L = (E & 7) << 18 | u << 12 | A << 6 | C; - L > 65535 && (L -= 65536, p.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), p.push(L); + const u = _[x++] & 63, A = _[x++] & 63, L = _[x++] & 63; + let C = (E & 7) << 18 | u << 12 | A << 6 | L; + C > 65535 && (C -= 65536, g.push(C >>> 10 & 1023 | 55296), C = 56320 | C & 1023), g.push(C); } } - return String.fromCharCode.apply(null, p); + return String.fromCharCode.apply(null, g); }, y.TextEncoder = s, y.TextDecoder = e; })(typeof window < "u" ? window : typeof self < "u" ? self : this); } @@ -1835,9 +1835,9 @@ var _3Dmol = { exports: {} }; function l(x, o = "utf8") { return new TextDecoder(o).decode(x); } - const g = new TextEncoder(); + const p = new TextEncoder(); function _(x) { - return g.encode(x); + return p.encode(x); } } ), @@ -1852,7 +1852,7 @@ var _3Dmol = { exports: {} }; /* harmony export */ nonRecord: () => ( /* binding */ - g + p ), /* harmony export */ record: () => ( @@ -1865,22 +1865,22 @@ var _3Dmol = { exports: {} }; /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" ); - function g(x, o) { - const p = (0, l.str2num)(o.type), E = o.size / (0, l.num2bytes)(p), u = new Array(E); + function p(x, o) { + const g = (0, l.str2num)(o.type), E = o.size / (0, l.num2bytes)(g), u = new Array(E); for (let A = 0; A < E; A++) - u[A] = (0, l.readType)(x, p, 1); + u[A] = (0, l.readType)(x, g, 1); return u; } - function _(x, o, p) { - const E = (0, l.str2num)(o.type), u = o.size ? o.size / (0, l.num2bytes)(E) : 1, A = p.length, C = new Array(A), L = p.recordStep; - if (L) + function _(x, o, g) { + const E = (0, l.str2num)(o.type), u = o.size ? o.size / (0, l.num2bytes)(E) : 1, A = g.length, L = new Array(A), C = g.recordStep; + if (C) for (let D = 0; D < A; D++) { const r = x.offset; - C[D] = (0, l.readType)(x, E, u), x.seek(r + L); + L[D] = (0, l.readType)(x, E, u), x.seek(r + C); } else throw new Error("recordDimension.recordStep is undefined"); - return C; + return L; } } ), @@ -1902,17 +1902,17 @@ var _3Dmol = { exports: {} }; var l = e( /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" - ), g = e( + ), p = e( /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - const _ = 0, x = 10, o = 11, p = 12, E = 0; + const _ = 0, x = 10, o = 11, g = 12, E = 0; function u(D, r) { const n = { version: r }, b = { length: D.readUint32() }, f = A(D); - Array.isArray(f) || (b.id = f.recordId, b.name = f.recordName, n.dimensions = f.dimensions), n.globalAttributes = C(D); - const c = L(D, b == null ? void 0 : b.id, r); + Array.isArray(f) || (b.id = f.recordId, b.name = f.recordName, n.dimensions = f.dimensions), n.globalAttributes = L(D); + const c = C(D, b == null ? void 0 : b.id, r); return Array.isArray(c) || (n.variables = c.variables, b.recordStep = c.recordStep), n.recordDimension = b, n; } function A(D) { @@ -1921,13 +1921,13 @@ var _3Dmol = { exports: {} }; const f = D.readUint32(); let c; if (f === _) - return (0, g.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of dimensions"), []; + return (0, p.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of dimensions"), []; { - (0, g.notNetcdf)(f !== x, "wrong tag for list of dimensions"); + (0, p.notNetcdf)(f !== x, "wrong tag for list of dimensions"); const t = D.readUint32(); c = new Array(t); for (let a = 0; a < t; a++) { - const h = (0, g.readName)(D), M = D.readUint32(); + const h = (0, p.readName)(D), M = D.readUint32(); M === E && (n = a, b = h), c[a] = { name: h, size: M @@ -1936,20 +1936,20 @@ var _3Dmol = { exports: {} }; } return n !== void 0 && (r.recordId = n), b !== void 0 && (r.recordName = b), r.dimensions = c, r; } - function C(D) { + function L(D) { const r = D.readUint32(); let n; if (r === _) - return (0, g.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of attributes"), []; + return (0, p.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of attributes"), []; { - (0, g.notNetcdf)(r !== p, "wrong tag for list of attributes"); + (0, p.notNetcdf)(r !== g, "wrong tag for list of attributes"); const b = D.readUint32(); n = new Array(b); for (let f = 0; f < b; f++) { - const c = (0, g.readName)(D), t = D.readUint32(); - (0, g.notNetcdf)(t < 1 || t > 6, `non valid type ${t}`); + const c = (0, p.readName)(D), t = D.readUint32(); + (0, p.notNetcdf)(t < 1 || t > 6, `non valid type ${t}`); const a = D.readUint32(), h = (0, l.readType)(D, t, a); - (0, g.padding)(D), n[f] = { + (0, p.padding)(D), n[f] = { name: c, type: (0, l.num2str)(t), value: h @@ -1958,24 +1958,24 @@ var _3Dmol = { exports: {} }; } return n; } - function L(D, r, n) { + function C(D, r, n) { const b = D.readUint32(); let f = 0, c; if (b === _) - return (0, g.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of variables"), []; + return (0, p.notNetcdf)(D.readUint32() !== _, "wrong empty tag for list of variables"), []; { - (0, g.notNetcdf)(b !== o, "wrong tag for list of variables"); + (0, p.notNetcdf)(b !== o, "wrong tag for list of variables"); const t = D.readUint32(); c = new Array(t); for (let a = 0; a < t; a++) { - const h = (0, g.readName)(D), M = D.readUint32(), w = new Array(M); + const h = (0, p.readName)(D), M = D.readUint32(), w = new Array(M); for (let B = 0; B < M; B++) w[B] = D.readUint32(); - const S = C(D), T = D.readUint32(); - (0, g.notNetcdf)(T < 1 && T > 6, `non valid type ${T}`); + const S = L(D), T = D.readUint32(); + (0, p.notNetcdf)(T < 1 && T > 6, `non valid type ${T}`); const R = D.readUint32(); - let z = D.readUint32(); - n === 2 && ((0, g.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = D.readUint32()); + let $ = D.readUint32(); + n === 2 && ((0, p.notNetcdf)($ > 0, "offsets larger than 4GB not supported"), $ = D.readUint32()); let P = !1; typeof r < "u" && w[0] === r && (f += R, P = !0), c[a] = { name: h, @@ -1983,7 +1983,7 @@ var _3Dmol = { exports: {} }; attributes: S, type: (0, l.num2str)(T), size: R, - offset: z, + offset: $, record: P }; } @@ -2027,14 +2027,14 @@ var _3Dmol = { exports: {} }; /* harmony export */ NetCDFReader: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! iobuffer */ "./node_modules/iobuffer/lib-esm/IOBuffer.js" - ), g = e( + ), p = e( /*! ./data */ "./node_modules/netcdfjs/lib-esm/data.js" ), _ = e( @@ -2047,13 +2047,13 @@ var _3Dmol = { exports: {} }; /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - class p { + class g { constructor(u) { this.toString = x.toString; const A = new l.IOBuffer(u); A.setBigEndian(), (0, o.notNetcdf)(A.readChars(3) !== "CDF", "should start with CDF"); - const C = A.readByte(); - (0, o.notNetcdf)(C > 2, "unknown version"), this.header = (0, _.header)(A, C), this.buffer = A; + const L = A.readByte(); + (0, o.notNetcdf)(L > 2, "unknown version"), this.header = (0, _.header)(A, L), this.buffer = A; } /** * @return - Version for the NetCDF format @@ -2094,7 +2094,7 @@ var _3Dmol = { exports: {} }; * @return - Value of the attributeName or null */ getAttribute(u) { - const A = this.globalAttributes.find((C) => C.name === u); + const A = this.globalAttributes.find((L) => L.name === u); return A ? A.value : null; } /** @@ -2116,9 +2116,9 @@ var _3Dmol = { exports: {} }; */ getDataVariable(u) { let A; - if (typeof u == "string" ? A = this.header.variables.find((C) => C.name === u) : A = u, A === void 0) + if (typeof u == "string" ? A = this.header.variables.find((L) => L.name === u) : A = u, A === void 0) throw new Error("Not a valid NetCDF v3.x file: variable not found"); - return this.buffer.seek(A.offset), A.record ? (0, g.record)(this.buffer, A, this.header.recordDimension) : (0, g.nonRecord)(this.buffer, A); + return this.buffer.seek(A.offset), A.record ? (0, p.record)(this.buffer, A, this.header.recordDimension) : (0, p.nonRecord)(this.buffer, A); } /** * Check if a dataVariable exists @@ -2126,7 +2126,7 @@ var _3Dmol = { exports: {} }; * @return boolean */ dataVariableExists(u) { - return this.header.variables.find((C) => C.name === u) !== void 0; + return this.header.variables.find((L) => L.name === u) !== void 0; } /** * Check if an attribute exists @@ -2134,7 +2134,7 @@ var _3Dmol = { exports: {} }; * @return boolean */ attributeExists(u) { - return this.globalAttributes.find((C) => C.name === u) !== void 0; + return this.globalAttributes.find((L) => L.name === u) !== void 0; } } } @@ -2155,21 +2155,21 @@ var _3Dmol = { exports: {} }; /* harmony export */ }); function l() { - const g = []; - g.push("DIMENSIONS"); + const p = []; + p.push("DIMENSIONS"); for (const x of this.dimensions) - g.push(` ${x.name.padEnd(30)} = size: ${x.size}`); - g.push(""), g.push("GLOBAL ATTRIBUTES"); + p.push(` ${x.name.padEnd(30)} = size: ${x.size}`); + p.push(""), p.push("GLOBAL ATTRIBUTES"); for (const x of this.globalAttributes) - g.push(` ${x.name.padEnd(30)} = ${x.value}`); + p.push(` ${x.name.padEnd(30)} = ${x.value}`); const _ = JSON.parse(JSON.stringify(this.variables)); - g.push(""), g.push("VARIABLES:"); + p.push(""), p.push("VARIABLES:"); for (const x of _) { x.value = this.getDataVariable(x); let o = JSON.stringify(x.value); - o.length > 50 && (o = o.substring(0, 50)), isNaN(x.value.length) || (o += ` (length: ${x.value.length})`), g.push(` ${x.name.padEnd(30)} = ${o}`); + o.length > 50 && (o = o.substring(0, 50)), isNaN(x.value.length) || (o += ` (length: ${x.value.length})`), p.push(` ${x.name.padEnd(30)} = ${o}`); } - return g.join(` + return p.join(` `); } } @@ -2190,12 +2190,12 @@ var _3Dmol = { exports: {} }; /* harmony export */ num2str: () => ( /* binding */ - g + p ), /* harmony export */ readType: () => ( /* binding */ - p + g ), /* harmony export */ str2num: () => ( @@ -2212,7 +2212,7 @@ var _3Dmol = { exports: {} }; FLOAT: 5, DOUBLE: 6 }; - function g(u) { + function p(u) { switch (Number(u)) { case l.BYTE: return "byte"; @@ -2268,27 +2268,27 @@ var _3Dmol = { exports: {} }; } function o(u, A) { if (u !== 1) { - const C = new Array(u); - for (let L = 0; L < u; L++) - C[L] = A(); - return C; + const L = new Array(u); + for (let C = 0; C < u; C++) + L[C] = A(); + return L; } else return A(); } - function p(u, A, C) { + function g(u, A, L) { switch (A) { case l.BYTE: - return Array.from(u.readBytes(C)); + return Array.from(u.readBytes(L)); case l.CHAR: - return E(u.readChars(C)); + return E(u.readChars(L)); case l.SHORT: - return o(C, u.readInt16.bind(u)); + return o(L, u.readInt16.bind(u)); case l.INT: - return o(C, u.readInt32.bind(u)); + return o(L, u.readInt32.bind(u)); case l.FLOAT: - return o(C, u.readFloat32.bind(u)); + return o(L, u.readFloat32.bind(u)); case l.DOUBLE: - return o(C, u.readFloat64.bind(u)); + return o(L, u.readFloat64.bind(u)); default: throw new Error(`non valid type ${A}`); } @@ -2314,7 +2314,7 @@ var _3Dmol = { exports: {} }; /* harmony export */ padding: () => ( /* binding */ - g + p ), /* harmony export */ readName: () => ( @@ -2327,12 +2327,12 @@ var _3Dmol = { exports: {} }; if (x) throw new TypeError(`Not a valid NetCDF v3.x file: ${o}`); } - function g(x) { + function p(x) { x.offset % 4 !== 0 && x.skip(4 - x.offset % 4); } function _(x) { - const o = x.readUint32(), p = x.readChars(o); - return g(x), p; + const o = x.readUint32(), g = x.readChars(o); + return p(x), g; } } ), @@ -3594,7 +3594,7 @@ void main() { /* harmony export */ CAP: () => ( /* binding */ - g + p ), /* harmony export */ GLDraw: () => ( @@ -3606,10 +3606,10 @@ void main() { var l = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), g; + ), p; (function(x) { x[x.NONE = 0] = "NONE", x[x.FLAT = 1] = "FLAT", x[x.ROUND = 2] = "ROUND"; - })(g || (g = {})); + })(p || (p = {})); var _; (function(x) { function o(r, n, b) { @@ -3618,7 +3618,7 @@ void main() { var w = new Float32Array(9); return w[0] = a, w[1] = t, w[2] = 0, w[3] = -t * M, w[4] = a * M, w[5] = h, w[6] = t * h, w[7] = -a * h, w[8] = M, w; } - class p { + class g { constructor() { this.cache = {}; let n = [], b = 4, f = Math.pow(2, b), c = 2, t = Math.pow(2, c), a = f / t, h; @@ -3634,67 +3634,67 @@ void main() { return this.cache[n][b + f]; for (var c = this.basisVectors.length, t = [], a = [], h, M = 0; M < c; M++) t.push(this.basisVectors[M].clone().multiplyScalar(n)), t.push(this.basisVectors[M].clone().multiplyScalar(n)), h = this.basisVectors[M].clone().normalize(), a.push(h), a.push(h); - var w = [], S = 10, T = c, R = 0, z = Math.PI * 2, P = 0, B = Math.PI, U, F, $ = !1, W = !1; - for (F = 0; F <= S; F++) { - $ = F === 0 || F === S, W = F === S / 2; - var N = [], G = []; - for (U = 0; U <= T; U++) { + var w = [], S = 10, T = c, R = 0, $ = Math.PI * 2, P = 0, B = Math.PI, F, U, z = !1, W = !1; + for (U = 0; U <= S; U++) { + z = U === 0 || U === S, W = U === S / 2; + var V = [], N = []; + for (F = 0; F <= T; F++) { if (W) { - var k = U < T ? 2 * U : 0; - G.push(k + 1), N.push(k); + var k = F < T ? 2 * F : 0; + N.push(k + 1), V.push(k); continue; } - var j = U / T, Q = F / S; - if (!$ || U === 0) - if (U < T) { + var G = F / T, Q = U / S; + if (!z || F === 0) + if (F < T) { var ie = new l.Vector3(); - ie.x = -n * Math.cos(R + j * z) * Math.sin(P + Q * B), b == 1 ? ie.y = 0 : ie.y = n * Math.cos(P + Q * B), ie.z = n * Math.sin(R + j * z) * Math.sin(P + Q * B), Math.abs(ie.x) < 1e-5 && (ie.x = 0), Math.abs(ie.y) < 1e-5 && (ie.y = 0), Math.abs(ie.z) < 1e-5 && (ie.z = 0), b == g.FLAT ? (h = new l.Vector3(0, Math.cos(P + Q * B), 0), h.normalize()) : (h = new l.Vector3(ie.x, ie.y, ie.z), h.normalize()), t.push(ie), a.push(h), N.push(t.length - 1); + ie.x = -n * Math.cos(R + G * $) * Math.sin(P + Q * B), b == 1 ? ie.y = 0 : ie.y = n * Math.cos(P + Q * B), ie.z = n * Math.sin(R + G * $) * Math.sin(P + Q * B), Math.abs(ie.x) < 1e-5 && (ie.x = 0), Math.abs(ie.y) < 1e-5 && (ie.y = 0), Math.abs(ie.z) < 1e-5 && (ie.z = 0), b == p.FLAT ? (h = new l.Vector3(0, Math.cos(P + Q * B), 0), h.normalize()) : (h = new l.Vector3(ie.x, ie.y, ie.z), h.normalize()), t.push(ie), a.push(h), V.push(t.length - 1); } else - N.push(t.length - T); + V.push(t.length - T); else - $ && N.push(t.length - 1); + z && V.push(t.length - 1); } - W && w.push(G), w.push(N); + W && w.push(N), w.push(V); } - var pe = { + var ge = { vertices: t, normals: a, verticesRows: w, w: T, h: S }; - return n in this.cache || (this.cache[n] = {}), this.cache[n][b + f] = pe, pe; + return n in this.cache || (this.cache[n] = {}), this.cache[n][b + f] = ge, ge; } } - var E = new p(); + var E = new g(); function u(r, n, b, f, c, t = 0, a = 0) { if (!n || !b) return; let h = function(Ee) { if (typeof Ee == "string") { let He = Ee; - return He.toLowerCase() == "flat" ? g.FLAT : He.toLowerCase() == "round" ? g.ROUND : g.NONE; + return He.toLowerCase() == "flat" ? p.FLAT : He.toLowerCase() == "round" ? p.ROUND : p.NONE; } else return Ee; }; t = h(t), a = h(a); var M = a || t; c = c || { r: 0, g: 0, b: 0 }; - var w = o(b.x - n.x, b.y - n.y, b.z - n.z), S = E.getVerticesForRadius(f, a, "to"), T = S.w, R = S.h, z = M ? R * T + 2 : 2 * T, P = r.updateGeoGroup(z), B = S.vertices, U = S.normals, F = S.verticesRows, $ = F[R / 2], W = F[R / 2 + 1], N = P.vertices, G, k, j, Q, ie, pe, he = P.vertexArray, ue = P.normalArray, se = P.colorArray, ae = P.faceArray; - for (j = 0; j < T; ++j) { - var we = 2 * j; - Q = w[0] * B[we].x + w[3] * B[we].y + w[6] * B[we].z, ie = w[1] * B[we].x + w[4] * B[we].y + w[7] * B[we].z, pe = w[5] * B[we].y + w[8] * B[we].z, G = 3 * (N + we), k = P.faceidx, he[G] = Q + n.x, he[G + 1] = ie + n.y, he[G + 2] = pe + n.z, he[G + 3] = Q + b.x, he[G + 4] = ie + b.y, he[G + 5] = pe + b.z, ue[G] = Q, ue[G + 3] = Q, ue[G + 1] = ie, ue[G + 4] = ie, ue[G + 2] = pe, ue[G + 5] = pe, se[G] = c.r, se[G + 3] = c.r, se[G + 1] = c.g, se[G + 4] = c.g, se[G + 2] = c.b, se[G + 5] = c.b, ae[k] = W[j] + N, ae[k + 1] = W[j + 1] + N, ae[k + 2] = $[j] + N, ae[k + 3] = $[j] + N, ae[k + 4] = W[j + 1] + N, ae[k + 5] = $[j + 1] + N, P.faceidx += 6; + var w = o(b.x - n.x, b.y - n.y, b.z - n.z), S = E.getVerticesForRadius(f, a, "to"), T = S.w, R = S.h, $ = M ? R * T + 2 : 2 * T, P = r.updateGeoGroup($), B = S.vertices, F = S.normals, U = S.verticesRows, z = U[R / 2], W = U[R / 2 + 1], V = P.vertices, N, k, G, Q, ie, ge, le = P.vertexArray, oe = P.normalArray, he = P.colorArray, se = P.faceArray; + for (G = 0; G < T; ++G) { + var xe = 2 * G; + Q = w[0] * B[xe].x + w[3] * B[xe].y + w[6] * B[xe].z, ie = w[1] * B[xe].x + w[4] * B[xe].y + w[7] * B[xe].z, ge = w[5] * B[xe].y + w[8] * B[xe].z, N = 3 * (V + xe), k = P.faceidx, le[N] = Q + n.x, le[N + 1] = ie + n.y, le[N + 2] = ge + n.z, le[N + 3] = Q + b.x, le[N + 4] = ie + b.y, le[N + 5] = ge + b.z, oe[N] = Q, oe[N + 3] = Q, oe[N + 1] = ie, oe[N + 4] = ie, oe[N + 2] = ge, oe[N + 5] = ge, he[N] = c.r, he[N + 3] = c.r, he[N + 1] = c.g, he[N + 4] = c.g, he[N + 2] = c.b, he[N + 5] = c.b, se[k] = W[G] + V, se[k + 1] = W[G + 1] + V, se[k + 2] = z[G] + V, se[k + 3] = z[G] + V, se[k + 4] = W[G + 1] + V, se[k + 5] = z[G + 1] + V, P.faceidx += 6; } if (M) { - var xe = a ? 0 : R / 2, Ie = t ? R + 1 : R / 2 + 1, oe, ve, re, Se, ze, Ge, $e, Re, Be, ke, We, Te, je, Fe, X, Z, q, fe, _e, Me, Ae, H, ce, ye, Pe, le, De, K, Oe, Ne, I, me; - for (ie = xe; ie < Ie; ie++) + var ye = a ? 0 : R / 2, Pe = t ? R + 1 : R / 2 + 1, de, pe, re, Se, ke, $e, ze, Re, Fe, Ie, We, Ue, Be, Ne, H, K, q, fe, _e, Me, Ae, Z, ue, we, Te, ae, De, Y, Oe, Ve, I, me; + for (ie = ye; ie < Pe; ie++) if (ie !== R / 2) { - var ge = ie <= R / 2 ? b : n, Y = E.getVerticesForRadius(f, a, "to"), ne = E.getVerticesForRadius(f, t, "from"); - for (ge === b ? (B = Y.vertices, U = Y.normals, F = Y.verticesRows) : ge == n && (B = ne.vertices, U = ne.normals, F = ne.verticesRows), Q = 0; Q < T; Q++) - k = P.faceidx, oe = F[ie][Q + 1], Oe = (oe + N) * 3, ve = F[ie][Q], Ne = (ve + N) * 3, re = F[ie + 1][Q], I = (re + N) * 3, Se = F[ie + 1][Q + 1], me = (Se + N) * 3, ze = w[0] * B[oe].x + w[3] * B[oe].y + w[6] * B[oe].z, Ge = w[0] * B[ve].x + w[3] * B[ve].y + w[6] * B[ve].z, $e = w[0] * B[re].x + w[3] * B[re].y + w[6] * B[re].z, Re = w[0] * B[Se].x + w[3] * B[Se].y + w[6] * B[Se].z, Be = w[1] * B[oe].x + w[4] * B[oe].y + w[7] * B[oe].z, ke = w[1] * B[ve].x + w[4] * B[ve].y + w[7] * B[ve].z, We = w[1] * B[re].x + w[4] * B[re].y + w[7] * B[re].z, Te = w[1] * B[Se].x + w[4] * B[Se].y + w[7] * B[Se].z, je = w[5] * B[oe].y + w[8] * B[oe].z, Fe = w[5] * B[ve].y + w[8] * B[ve].z, X = w[5] * B[re].y + w[8] * B[re].z, Z = w[5] * B[Se].y + w[8] * B[Se].z, he[Oe] = ze + ge.x, he[Ne] = Ge + ge.x, he[I] = $e + ge.x, he[me] = Re + ge.x, he[Oe + 1] = Be + ge.y, he[Ne + 1] = ke + ge.y, he[I + 1] = We + ge.y, he[me + 1] = Te + ge.y, he[Oe + 2] = je + ge.z, he[Ne + 2] = Fe + ge.z, he[I + 2] = X + ge.z, he[me + 2] = Z + ge.z, se[Oe] = c.r, se[Ne] = c.r, se[I] = c.r, se[me] = c.r, se[Oe + 1] = c.g, se[Ne + 1] = c.g, se[I + 1] = c.g, se[me + 1] = c.g, se[Oe + 2] = c.b, se[Ne + 2] = c.b, se[I + 2] = c.b, se[me + 2] = c.b, q = w[0] * U[oe].x + w[3] * U[oe].y + w[6] * U[oe].z, fe = w[0] * U[ve].x + w[3] * U[ve].y + w[6] * U[ve].z, _e = w[0] * U[re].x + w[3] * U[re].y + w[6] * U[re].z, Me = w[0] * U[Se].x + w[3] * U[Se].y + w[6] * U[Se].z, Ae = w[1] * U[oe].x + w[4] * U[oe].y + w[7] * U[oe].z, H = w[1] * U[ve].x + w[4] * U[ve].y + w[7] * U[ve].z, ce = w[1] * U[re].x + w[4] * U[re].y + w[7] * U[re].z, ye = w[1] * U[Se].x + w[4] * U[Se].y + w[7] * U[Se].z, Pe = w[5] * U[oe].y + w[8] * U[oe].z, le = w[5] * U[ve].y + w[8] * U[ve].z, De = w[5] * U[re].y + w[8] * U[re].z, K = w[5] * U[Se].y + w[8] * U[Se].z, ie === 0 ? (ue[Oe] = q, ue[I] = _e, ue[me] = Me, ue[Oe + 1] = Ae, ue[I + 1] = ce, ue[me + 1] = ye, ue[Oe + 2] = Pe, ue[I + 2] = De, ue[me + 2] = K, ae[k] = oe + N, ae[k + 1] = re + N, ae[k + 2] = Se + N, P.faceidx += 3) : ie === Ie - 1 ? (ue[Oe] = q, ue[Ne] = fe, ue[I] = _e, ue[Oe + 1] = Ae, ue[Ne + 1] = H, ue[I + 1] = ce, ue[Oe + 2] = Pe, ue[Ne + 2] = le, ue[I + 2] = De, ae[k] = oe + N, ae[k + 1] = ve + N, ae[k + 2] = re + N, P.faceidx += 3) : (ue[Oe] = q, ue[Ne] = fe, ue[me] = Me, ue[Oe + 1] = Ae, ue[Ne + 1] = H, ue[me + 1] = ye, ue[Oe + 2] = Pe, ue[Ne + 2] = le, ue[me + 2] = K, ue[Ne] = fe, ue[I] = _e, ue[me] = Me, ue[Ne + 1] = H, ue[I + 1] = ce, ue[me + 1] = ye, ue[Ne + 2] = le, ue[I + 2] = De, ue[me + 2] = K, ae[k] = oe + N, ae[k + 1] = ve + N, ae[k + 2] = Se + N, ae[k + 3] = ve + N, ae[k + 4] = re + N, ae[k + 5] = Se + N, P.faceidx += 6); + var ve = ie <= R / 2 ? b : n, X = E.getVerticesForRadius(f, a, "to"), ne = E.getVerticesForRadius(f, t, "from"); + for (ve === b ? (B = X.vertices, F = X.normals, U = X.verticesRows) : ve == n && (B = ne.vertices, F = ne.normals, U = ne.verticesRows), Q = 0; Q < T; Q++) + k = P.faceidx, de = U[ie][Q + 1], Oe = (de + V) * 3, pe = U[ie][Q], Ve = (pe + V) * 3, re = U[ie + 1][Q], I = (re + V) * 3, Se = U[ie + 1][Q + 1], me = (Se + V) * 3, ke = w[0] * B[de].x + w[3] * B[de].y + w[6] * B[de].z, $e = w[0] * B[pe].x + w[3] * B[pe].y + w[6] * B[pe].z, ze = w[0] * B[re].x + w[3] * B[re].y + w[6] * B[re].z, Re = w[0] * B[Se].x + w[3] * B[Se].y + w[6] * B[Se].z, Fe = w[1] * B[de].x + w[4] * B[de].y + w[7] * B[de].z, Ie = w[1] * B[pe].x + w[4] * B[pe].y + w[7] * B[pe].z, We = w[1] * B[re].x + w[4] * B[re].y + w[7] * B[re].z, Ue = w[1] * B[Se].x + w[4] * B[Se].y + w[7] * B[Se].z, Be = w[5] * B[de].y + w[8] * B[de].z, Ne = w[5] * B[pe].y + w[8] * B[pe].z, H = w[5] * B[re].y + w[8] * B[re].z, K = w[5] * B[Se].y + w[8] * B[Se].z, le[Oe] = ke + ve.x, le[Ve] = $e + ve.x, le[I] = ze + ve.x, le[me] = Re + ve.x, le[Oe + 1] = Fe + ve.y, le[Ve + 1] = Ie + ve.y, le[I + 1] = We + ve.y, le[me + 1] = Ue + ve.y, le[Oe + 2] = Be + ve.z, le[Ve + 2] = Ne + ve.z, le[I + 2] = H + ve.z, le[me + 2] = K + ve.z, he[Oe] = c.r, he[Ve] = c.r, he[I] = c.r, he[me] = c.r, he[Oe + 1] = c.g, he[Ve + 1] = c.g, he[I + 1] = c.g, he[me + 1] = c.g, he[Oe + 2] = c.b, he[Ve + 2] = c.b, he[I + 2] = c.b, he[me + 2] = c.b, q = w[0] * F[de].x + w[3] * F[de].y + w[6] * F[de].z, fe = w[0] * F[pe].x + w[3] * F[pe].y + w[6] * F[pe].z, _e = w[0] * F[re].x + w[3] * F[re].y + w[6] * F[re].z, Me = w[0] * F[Se].x + w[3] * F[Se].y + w[6] * F[Se].z, Ae = w[1] * F[de].x + w[4] * F[de].y + w[7] * F[de].z, Z = w[1] * F[pe].x + w[4] * F[pe].y + w[7] * F[pe].z, ue = w[1] * F[re].x + w[4] * F[re].y + w[7] * F[re].z, we = w[1] * F[Se].x + w[4] * F[Se].y + w[7] * F[Se].z, Te = w[5] * F[de].y + w[8] * F[de].z, ae = w[5] * F[pe].y + w[8] * F[pe].z, De = w[5] * F[re].y + w[8] * F[re].z, Y = w[5] * F[Se].y + w[8] * F[Se].z, ie === 0 ? (oe[Oe] = q, oe[I] = _e, oe[me] = Me, oe[Oe + 1] = Ae, oe[I + 1] = ue, oe[me + 1] = we, oe[Oe + 2] = Te, oe[I + 2] = De, oe[me + 2] = Y, se[k] = de + V, se[k + 1] = re + V, se[k + 2] = Se + V, P.faceidx += 3) : ie === Pe - 1 ? (oe[Oe] = q, oe[Ve] = fe, oe[I] = _e, oe[Oe + 1] = Ae, oe[Ve + 1] = Z, oe[I + 1] = ue, oe[Oe + 2] = Te, oe[Ve + 2] = ae, oe[I + 2] = De, se[k] = de + V, se[k + 1] = pe + V, se[k + 2] = re + V, P.faceidx += 3) : (oe[Oe] = q, oe[Ve] = fe, oe[me] = Me, oe[Oe + 1] = Ae, oe[Ve + 1] = Z, oe[me + 1] = we, oe[Oe + 2] = Te, oe[Ve + 2] = ae, oe[me + 2] = Y, oe[Ve] = fe, oe[I] = _e, oe[me] = Me, oe[Ve + 1] = Z, oe[I + 1] = ue, oe[me + 1] = we, oe[Ve + 2] = ae, oe[I + 2] = De, oe[me + 2] = Y, se[k] = de + V, se[k + 1] = pe + V, se[k + 2] = Se + V, se[k + 3] = pe + V, se[k + 4] = re + V, se[k + 5] = Se + V, P.faceidx += 6); } } - P.vertices += z; + P.vertices += $; } x.drawCylinder = u; function A(r, n, b, f, c) { @@ -3704,19 +3704,19 @@ void main() { let t = new l.Vector3(b.x - n.x, b.y - n.y, b.z - n.z); var a = o(t.x, t.y, t.z); t = t.normalize(); - var h = E.basisVectors.length, M = E.basisVectors, w = h + 2, S = r.updateGeoGroup(w), T = S.vertices, R, z, P, B, U, F, $ = S.vertexArray, W = S.normalArray, N = S.colorArray, G = S.faceArray; - for (R = T * 3, $[R] = n.x, $[R + 1] = n.y, $[R + 2] = n.z, W[R] = -t.x, W[R + 1] = -t.y, W[R + 2] = -t.z, N[R] = c.r, N[R + 1] = c.g, N[R + 2] = c.b, $[R + 3] = b.x, $[R + 4] = b.y, $[R + 5] = b.z, W[R + 3] = t.x, W[R + 4] = t.y, W[R + 5] = t.z, N[R + 3] = c.r, N[R + 4] = c.g, N[R + 5] = c.b, R += 6, P = 0; P < h; ++P) { + var h = E.basisVectors.length, M = E.basisVectors, w = h + 2, S = r.updateGeoGroup(w), T = S.vertices, R, $, P, B, F, U, z = S.vertexArray, W = S.normalArray, V = S.colorArray, N = S.faceArray; + for (R = T * 3, z[R] = n.x, z[R + 1] = n.y, z[R + 2] = n.z, W[R] = -t.x, W[R + 1] = -t.y, W[R + 2] = -t.z, V[R] = c.r, V[R + 1] = c.g, V[R + 2] = c.b, z[R + 3] = b.x, z[R + 4] = b.y, z[R + 5] = b.z, W[R + 3] = t.x, W[R + 4] = t.y, W[R + 5] = t.z, V[R + 3] = c.r, V[R + 4] = c.g, V[R + 5] = c.b, R += 6, P = 0; P < h; ++P) { var k = M[P].clone(); - k.multiplyScalar(f), B = a[0] * k.x + a[3] * k.y + a[6] * k.z, U = a[1] * k.x + a[4] * k.y + a[7] * k.z, F = a[5] * k.y + a[8] * k.z, $[R] = B + n.x, $[R + 1] = U + n.y, $[R + 2] = F + n.z, W[R] = B, W[R + 1] = U, W[R + 2] = F, N[R] = c.r, N[R + 1] = c.g, N[R + 2] = c.b, R += 3; + k.multiplyScalar(f), B = a[0] * k.x + a[3] * k.y + a[6] * k.z, F = a[1] * k.x + a[4] * k.y + a[7] * k.z, U = a[5] * k.y + a[8] * k.z, z[R] = B + n.x, z[R + 1] = F + n.y, z[R + 2] = U + n.z, W[R] = B, W[R + 1] = F, W[R + 2] = U, V[R] = c.r, V[R + 1] = c.g, V[R + 2] = c.b, R += 3; } - for (S.vertices += h + 2, z = S.faceidx, P = 0; P < h; P++) { - var j = T + 2 + P, Q = T + 2 + (P + 1) % h; - G[z] = j, G[z + 1] = Q, G[z + 2] = T, z += 3, G[z] = j, G[z + 1] = Q, G[z + 2] = T + 1, z += 3; + for (S.vertices += h + 2, $ = S.faceidx, P = 0; P < h; P++) { + var G = T + 2 + P, Q = T + 2 + (P + 1) % h; + N[$] = G, N[$ + 1] = Q, N[$ + 2] = T, $ += 3, N[$] = G, N[$ + 1] = Q, N[$ + 2] = T + 1, $ += 3; } S.faceidx += 6 * h; } x.drawCone = A; - class C { + class L { constructor() { this.cache = /* @__PURE__ */ new Map(); } @@ -3735,29 +3735,29 @@ void main() { for (R = 0; R <= a; R++) { let P = []; for (T = 0; T <= t; T++) { - let B = T / t, U = R / a, F = -n * Math.cos(h + B * M) * Math.sin(w + U * S), $ = n * Math.cos(w + U * S), W = n * Math.sin(h + B * M) * Math.sin(w + U * S); - var z = new l.Vector3(F, $, W); - z.normalize(), c.vertices.push({ x: F, y: $, z: W }), c.normals.push(z), P.push(c.vertices.length - 1); + let B = T / t, F = R / a, U = -n * Math.cos(h + B * M) * Math.sin(w + F * S), z = n * Math.cos(w + F * S), W = n * Math.sin(h + B * M) * Math.sin(w + F * S); + var $ = new l.Vector3(U, z, W); + $.normalize(), c.vertices.push({ x: U, y: z, z: W }), c.normals.push($), P.push(c.vertices.length - 1); } c.verticesRows.push(P); } return f.set(n, c), c; } } - var L = new C(); + var C = new L(); function D(r, n, b, f, c) { - var t = L.getVerticesForRadius(b, c), a = t.vertices, h = t.normals, M = r.updateGeoGroup(a.length), w = M.vertices, S = M.vertexArray, T = M.colorArray, R = M.faceArray, z = M.lineArray, P = M.normalArray; - for (let F = 0, $ = a.length; F < $; ++F) { - let W = 3 * (w + F), N = a[F]; - S[W] = N.x + n.x, S[W + 1] = N.y + n.y, S[W + 2] = N.z + n.z, T[W] = f.r, T[W + 1] = f.g, T[W + 2] = f.b; + var t = C.getVerticesForRadius(b, c), a = t.vertices, h = t.normals, M = r.updateGeoGroup(a.length), w = M.vertices, S = M.vertexArray, T = M.colorArray, R = M.faceArray, $ = M.lineArray, P = M.normalArray; + for (let U = 0, z = a.length; U < z; ++U) { + let W = 3 * (w + U), V = a[U]; + S[W] = V.x + n.x, S[W + 1] = V.y + n.y, S[W + 2] = V.z + n.z, T[W] = f.r, T[W + 1] = f.g, T[W + 2] = f.b; } M.vertices += a.length; - let B = t.verticesRows, U = B.length - 1; - for (let F = 0; F < U; F++) { - let $ = B[F].length - 1; - for (let W = 0; W < $; W++) { - let N = M.faceidx, G = M.lineidx, k = B[F][W + 1] + w, j = k * 3, Q = B[F][W] + w, ie = Q * 3, pe = B[F + 1][W] + w, he = pe * 3, ue = B[F + 1][W + 1] + w, se = ue * 3, ae = h[k - w], we = h[Q - w], xe = h[pe - w], Ie = h[ue - w]; - Math.abs(a[k - w].y) === b ? (P[j] = ae.x, P[he] = xe.x, P[se] = Ie.x, P[j + 1] = ae.y, P[he + 1] = xe.y, P[se + 1] = Ie.y, P[j + 2] = ae.z, P[he + 2] = xe.z, P[se + 2] = Ie.z, R[N] = k, R[N + 1] = pe, R[N + 2] = ue, z[G] = k, z[G + 1] = pe, z[G + 2] = k, z[G + 3] = ue, z[G + 4] = pe, z[G + 5] = ue, M.faceidx += 3, M.lineidx += 6) : Math.abs(a[pe - w].y) === b ? (P[j] = ae.x, P[ie] = we.x, P[he] = xe.x, P[j + 1] = ae.y, P[ie + 1] = we.y, P[he + 1] = xe.y, P[j + 2] = ae.z, P[ie + 2] = we.z, P[he + 2] = xe.z, R[N] = k, R[N + 1] = Q, R[N + 2] = pe, z[G] = k, z[G + 1] = Q, z[G + 2] = k, z[G + 3] = pe, z[G + 4] = Q, z[G + 5] = pe, M.faceidx += 3, M.lineidx += 6) : (P[j] = ae.x, P[ie] = we.x, P[se] = Ie.x, P[j + 1] = ae.y, P[ie + 1] = we.y, P[se + 1] = Ie.y, P[j + 2] = ae.z, P[ie + 2] = we.z, P[se + 2] = Ie.z, P[ie] = we.x, P[he] = xe.x, P[se] = Ie.x, P[ie + 1] = we.y, P[he + 1] = xe.y, P[se + 1] = Ie.y, P[ie + 2] = we.z, P[he + 2] = xe.z, P[se + 2] = Ie.z, R[N] = k, R[N + 1] = Q, R[N + 2] = ue, R[N + 3] = Q, R[N + 4] = pe, R[N + 5] = ue, z[G] = k, z[G + 1] = Q, z[G + 2] = k, z[G + 3] = ue, z[G + 4] = Q, z[G + 5] = pe, z[G + 6] = pe, z[G + 7] = ue, M.faceidx += 6, M.lineidx += 8); + let B = t.verticesRows, F = B.length - 1; + for (let U = 0; U < F; U++) { + let z = B[U].length - 1; + for (let W = 0; W < z; W++) { + let V = M.faceidx, N = M.lineidx, k = B[U][W + 1] + w, G = k * 3, Q = B[U][W] + w, ie = Q * 3, ge = B[U + 1][W] + w, le = ge * 3, oe = B[U + 1][W + 1] + w, he = oe * 3, se = h[k - w], xe = h[Q - w], ye = h[ge - w], Pe = h[oe - w]; + Math.abs(a[k - w].y) === b ? (P[G] = se.x, P[le] = ye.x, P[he] = Pe.x, P[G + 1] = se.y, P[le + 1] = ye.y, P[he + 1] = Pe.y, P[G + 2] = se.z, P[le + 2] = ye.z, P[he + 2] = Pe.z, R[V] = k, R[V + 1] = ge, R[V + 2] = oe, $[N] = k, $[N + 1] = ge, $[N + 2] = k, $[N + 3] = oe, $[N + 4] = ge, $[N + 5] = oe, M.faceidx += 3, M.lineidx += 6) : Math.abs(a[ge - w].y) === b ? (P[G] = se.x, P[ie] = xe.x, P[le] = ye.x, P[G + 1] = se.y, P[ie + 1] = xe.y, P[le + 1] = ye.y, P[G + 2] = se.z, P[ie + 2] = xe.z, P[le + 2] = ye.z, R[V] = k, R[V + 1] = Q, R[V + 2] = ge, $[N] = k, $[N + 1] = Q, $[N + 2] = k, $[N + 3] = ge, $[N + 4] = Q, $[N + 5] = ge, M.faceidx += 3, M.lineidx += 6) : (P[G] = se.x, P[ie] = xe.x, P[he] = Pe.x, P[G + 1] = se.y, P[ie + 1] = xe.y, P[he + 1] = Pe.y, P[G + 2] = se.z, P[ie + 2] = xe.z, P[he + 2] = Pe.z, P[ie] = xe.x, P[le] = ye.x, P[he] = Pe.x, P[ie + 1] = xe.y, P[le + 1] = ye.y, P[he + 1] = Pe.y, P[ie + 2] = xe.z, P[le + 2] = ye.z, P[he + 2] = Pe.z, R[V] = k, R[V + 1] = Q, R[V + 2] = oe, R[V + 3] = Q, R[V + 4] = ge, R[V + 5] = oe, $[N] = k, $[N + 1] = Q, $[N + 2] = k, $[N + 3] = oe, $[N + 4] = Q, $[N + 5] = ge, $[N + 6] = ge, $[N + 7] = oe, M.faceidx += 6, M.lineidx += 8); } } } @@ -3783,7 +3783,7 @@ void main() { var l = e( /*! ./WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" ), _ = e( @@ -3795,7 +3795,7 @@ void main() { ), o = e( /*! ./GLDraw */ "./src/GLDraw.ts" - ), p = e( + ), g = e( /*! ./glcartoon */ "./src/glcartoon.ts" ), E = e( @@ -3807,10 +3807,10 @@ void main() { ), A = e( /*! ./parsers */ "./src/parsers/index.ts" - ), C = e( + ), L = e( /*! netcdfjs */ "./node_modules/netcdfjs/lib-esm/index.js" - ), L = e( + ), C = e( /*! pako */ "./node_modules/pako/dist/pako.esm.mjs" ), D = e( @@ -3819,7 +3819,7 @@ void main() { ); function r(b) { let f; - return typeof b == "string" ? f = new TextEncoder().encode(b) : f = new Uint8Array(b), (0, L.inflate)(f, { + return typeof b == "string" ? f = new TextEncoder().encode(b) : f = new Uint8Array(b), (0, C.inflate)(f, { to: "string" }); } @@ -3873,11 +3873,11 @@ void main() { [0, 0, -M] ], S = f.clickable || f.hoverable; S && f.intersectionShape === void 0 && (f.intersectionShape = { sphere: [], cylinder: [], line: [] }); - for (var T = (0, E.getColorFromStyle)(f, t), R = h.vertexArray, z = h.colorArray, P = 0; P < 6; P++) { + for (var T = (0, E.getColorFromStyle)(f, t), R = h.vertexArray, $ = h.colorArray, P = 0; P < 6; P++) { var B = h.vertices * 3; - if (h.vertices++, R[B] = f.x + w[P][0], R[B + 1] = f.y + w[P][1], R[B + 2] = f.z + w[P][2], z[B] = T.r, z[B + 1] = T.g, z[B + 2] = T.b, S) { - var U = new _.Vector3(w[P][0], w[P][1], w[P][2]); - U.multiplyScalar(0.1), U.set(U.x + f.x, U.y + f.y, U.z + f.z), f.intersectionShape.line.push(U); + if (h.vertices++, R[B] = f.x + w[P][0], R[B + 1] = f.y + w[P][1], R[B + 2] = f.z + w[P][2], $[B] = T.r, $[B + 1] = T.g, $[B + 2] = T.b, S) { + var F = new _.Vector3(w[P][0], w[P][1], w[P][2]); + F.multiplyScalar(0.1), F.set(F.x + f.x, F.y + f.y, F.z + f.z), f.intersectionShape.line.push(F); } } } @@ -3886,12 +3886,12 @@ void main() { getGoodCross(f, c, t, a) { for (var h = null, M = -1, w = 0, S = f.bonds.length; w < S; w++) if (f.bonds[w] != c.index) { - let R = f.bonds[w], z = this.atoms[R], B = new _.Vector3(z.x, z.y, z.z).clone(); + let R = f.bonds[w], $ = this.atoms[R], B = new _.Vector3($.x, $.y, $.z).clone(); B.sub(t); - let U = B.clone(); - U.cross(a); - var T = U.lengthSq(); - if (T > M && (M = T, h = U, M > 0.1)) + let F = B.clone(); + F.cross(a); + var T = F.lengthSq(); + if (T > M && (M = T, h = F, M > 0.1)) return h; } return h; @@ -3899,14 +3899,14 @@ void main() { //from atom, return a normalized vector v that is orthogonal and along which //it is appropraite to draw multiple bonds getSideBondV(f, c, t) { - var a, h, M, w, S, T = new _.Vector3(f.x, f.y, f.z), R = new _.Vector3(c.x, c.y, c.z), z = R.clone(), P = null; - if (z.sub(T), f.bonds.length === 1) - c.bonds.length === 1 ? (P = z.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (a = (t + 1) % c.bonds.length, h = c.bonds[a], M = this.atoms[h], M.index == f.index && (a = (a + 1) % c.bonds.length, h = c.bonds[a], M = this.atoms[h]), w = new _.Vector3(M.x, M.y, M.z), S = w.clone(), S.sub(T), P = S.clone(), P.cross(z)); - else if (P = this.getGoodCross(f, c, T, z), P.lengthSq() < 0.01) { - var B = this.getGoodCross(c, f, T, z); + var a, h, M, w, S, T = new _.Vector3(f.x, f.y, f.z), R = new _.Vector3(c.x, c.y, c.z), $ = R.clone(), P = null; + if ($.sub(T), f.bonds.length === 1) + c.bonds.length === 1 ? (P = $.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (a = (t + 1) % c.bonds.length, h = c.bonds[a], M = this.atoms[h], M.index == f.index && (a = (a + 1) % c.bonds.length, h = c.bonds[a], M = this.atoms[h]), w = new _.Vector3(M.x, M.y, M.z), S = w.clone(), S.sub(T), P = S.clone(), P.cross($)); + else if (P = this.getGoodCross(f, c, T, $), P.lengthSq() < 0.01) { + var B = this.getGoodCross(c, f, T, $); B != null && (P = B); } - 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 = $.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1), P.cross($), P.normalize(), P; } addLine(f, c, t, a, h, M) { f[t] = a.x, f[t + 1] = a.y, f[t + 2] = a.z, c[t] = M.r, c[t + 1] = M.g, c[t + 2] = M.b, f[t + 3] = h.x, f[t + 4] = h.y, f[t + 5] = h.z, c[t + 3] = M.r, c[t + 4] = M.g, c[t + 5] = M.b; @@ -3926,24 +3926,24 @@ void main() { if (!a.hidden) { var h, M, w, S, T = a.linewidth || n.defaultlineWidth; t[T] || (t[T] = new l.Geometry()); - for (var R = t[T].updateGeoGroup(6 * f.bonds.length), z = R.vertexArray, P = R.colorArray, B = 0; B < f.bonds.length; B++) { - var U = f.bonds[B], F = c[U]; - if (F.style.line && !(f.index >= F.index)) { - var $ = new _.Vector3(f.x, f.y, f.z), W = new _.Vector3(F.x, F.y, F.z), N = $.clone().add(W).multiplyScalar(0.5), G = !1, k = f.clickable || f.hoverable, j = F.clickable || F.hoverable; - (k || j) && (k && (f.intersectionShape === void 0 && (f.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), f.intersectionShape.line.push($), f.intersectionShape.line.push(N)), j && (F.intersectionShape === void 0 && (F.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), F.intersectionShape.line.push(N), F.intersectionShape.line.push(W))); - var Q = (0, E.getColorFromStyle)(f, f.style.line), ie = (0, E.getColorFromStyle)(F, F.style.line); + for (var R = t[T].updateGeoGroup(6 * f.bonds.length), $ = R.vertexArray, P = R.colorArray, B = 0; B < f.bonds.length; B++) { + var F = f.bonds[B], U = c[F]; + if (U.style.line && !(f.index >= U.index)) { + var z = new _.Vector3(f.x, f.y, f.z), W = new _.Vector3(U.x, U.y, U.z), V = z.clone().add(W).multiplyScalar(0.5), N = !1, k = f.clickable || f.hoverable, G = U.clickable || U.hoverable; + (k || G) && (k && (f.intersectionShape === void 0 && (f.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), f.intersectionShape.line.push(z), f.intersectionShape.line.push(V)), G && (U.intersectionShape === void 0 && (U.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), U.intersectionShape.line.push(V), U.intersectionShape.line.push(W))); + var Q = (0, E.getColorFromStyle)(f, f.style.line), ie = (0, E.getColorFromStyle)(U, U.style.line); if (f.bondStyles && f.bondStyles[B]) { - var pe = f.bondStyles[B]; - if (!pe.iswire) + var ge = f.bondStyles[B]; + if (!ge.iswire) continue; - pe.singleBond && (G = !0), typeof pe.color1 < "u" && (Q = x.CC.color(pe.color1)), typeof pe.color2 < "u" && (ie = x.CC.color(pe.color2)); + ge.singleBond && (N = !0), typeof ge.color1 < "u" && (Q = x.CC.color(ge.color1)), typeof ge.color2 < "u" && (ie = x.CC.color(ge.color2)); } - var he = R.vertices * 3, ue, se; - if (f.bondOrder[B] > 1 && f.bondOrder[B] < 4 && !G) { - var ae = this.getSideBondV(f, F, B), we = W.clone(); - we.sub($), f.bondOrder[B] == 2 ? (ae.multiplyScalar(0.1), h = $.clone(), h.add(ae), M = $.clone(), M.sub(ae), w = h.clone(), w.add(we), S = M.clone(), S.add(we), Q == ie ? (R.vertices += 4, this.addLine(z, P, he, h, w, Q), this.addLine(z, P, he + 6, M, S, Q)) : (R.vertices += 8, we.multiplyScalar(0.5), ue = h.clone(), ue.add(we), se = M.clone(), se.add(we), this.addLine(z, P, he, h, ue, Q), this.addLine(z, P, he + 6, ue, w, ie), this.addLine(z, P, he + 12, M, se, Q), this.addLine(z, P, he + 18, se, S, ie))) : f.bondOrder[B] == 3 && (ae.multiplyScalar(0.1), h = $.clone(), h.add(ae), M = $.clone(), M.sub(ae), w = h.clone(), w.add(we), S = M.clone(), S.add(we), Q == ie ? (R.vertices += 6, this.addLine(z, P, he, $, W, Q), this.addLine(z, P, he + 6, h, w, Q), this.addLine(z, P, he + 12, M, S, Q)) : (R.vertices += 12, we.multiplyScalar(0.5), ue = h.clone(), ue.add(we), se = M.clone(), se.add(we), this.addLine(z, P, he, $, N, Q), this.addLine(z, P, he + 6, N, W, ie), this.addLine(z, P, he + 12, h, ue, Q), this.addLine(z, P, he + 18, ue, w, ie), this.addLine(z, P, he + 24, M, se, Q), this.addLine(z, P, he + 30, se, S, ie))); + var le = R.vertices * 3, oe, he; + if (f.bondOrder[B] > 1 && f.bondOrder[B] < 4 && !N) { + var se = this.getSideBondV(f, U, B), xe = W.clone(); + xe.sub(z), f.bondOrder[B] == 2 ? (se.multiplyScalar(0.1), h = z.clone(), h.add(se), M = z.clone(), M.sub(se), w = h.clone(), w.add(xe), S = M.clone(), S.add(xe), Q == ie ? (R.vertices += 4, this.addLine($, P, le, h, w, Q), this.addLine($, P, le + 6, M, S, Q)) : (R.vertices += 8, xe.multiplyScalar(0.5), oe = h.clone(), oe.add(xe), he = M.clone(), he.add(xe), this.addLine($, P, le, h, oe, Q), this.addLine($, P, le + 6, oe, w, ie), this.addLine($, P, le + 12, M, he, Q), this.addLine($, P, le + 18, he, S, ie))) : f.bondOrder[B] == 3 && (se.multiplyScalar(0.1), h = z.clone(), h.add(se), M = z.clone(), M.sub(se), w = h.clone(), w.add(xe), S = M.clone(), S.add(xe), Q == ie ? (R.vertices += 6, this.addLine($, P, le, z, W, Q), this.addLine($, P, le + 6, h, w, Q), this.addLine($, P, le + 12, M, S, Q)) : (R.vertices += 12, xe.multiplyScalar(0.5), oe = h.clone(), oe.add(xe), he = M.clone(), he.add(xe), this.addLine($, P, le, z, V, Q), this.addLine($, P, le + 6, V, W, ie), this.addLine($, P, le + 12, h, oe, Q), this.addLine($, P, le + 18, oe, w, ie), this.addLine($, P, le + 24, M, he, Q), this.addLine($, P, le + 30, he, S, ie))); } else - Q == ie ? (R.vertices += 2, this.addLine(z, P, he, $, W, Q)) : (R.vertices += 4, this.addLine(z, P, he, $, N, Q), this.addLine(z, P, he + 6, N, W, ie)); + Q == ie ? (R.vertices += 2, this.addLine($, P, le, z, W, Q)) : (R.vertices += 4, this.addLine($, P, le, z, V, Q), this.addLine($, P, le + 6, V, W, ie)); } } } @@ -3963,7 +3963,7 @@ void main() { var a = (0, E.getColorFromStyle)(f, t), h = this.getRadiusFromStyle(f, t); if ((f.clickable === !0 || f.hoverable) && f.intersectionShape !== void 0) { var M = new _.Vector3(f.x, f.y, f.z); - f.intersectionShape.sphere.push(new g.Sphere(M, h)); + f.intersectionShape.sphere.push(new p.Sphere(M, h)); } o.GLDraw.drawSphere(c, f, h, a); } @@ -3977,7 +3977,7 @@ void main() { var t = this.getRadiusFromStyle(f, c); if ((f.clickable === !0 || f.hoverable) && f.intersectionShape !== void 0) { var a = new _.Vector3(f.x, f.y, f.z); - f.intersectionShape.sphere.push(new g.Sphere(a, t)); + f.intersectionShape.sphere.push(new p.Sphere(a, t)); } } } @@ -3986,10 +3986,10 @@ void main() { if (f.style.sphere) { var t = f.style.sphere; if (!t.hidden) { - var a = this.getRadiusFromStyle(f, t), h = (0, E.getColorFromStyle)(f, t), M = c.updateGeoGroup(1), w = M.vertices, S = w * 3, T = M.vertexArray, R = M.colorArray, z = M.radiusArray; - if (T[S] = f.x, T[S + 1] = f.y, T[S + 2] = f.z, R[S] = h.r, R[S + 1] = h.g, R[S + 2] = h.b, z[w] = a, (f.clickable === !0 || f.hoverable) && f.intersectionShape !== void 0) { + var a = this.getRadiusFromStyle(f, t), h = (0, E.getColorFromStyle)(f, t), M = c.updateGeoGroup(1), w = M.vertices, S = w * 3, T = M.vertexArray, R = M.colorArray, $ = M.radiusArray; + if (T[S] = f.x, T[S + 1] = f.y, T[S + 2] = f.z, R[S] = h.r, R[S + 1] = h.g, R[S + 2] = h.b, $[w] = a, (f.clickable === !0 || f.hoverable) && f.intersectionShape !== void 0) { var P = new _.Vector3(f.x, f.y, f.z); - f.intersectionShape.sphere.push(new g.Sphere(P, a)); + f.intersectionShape.sphere.push(new p.Sphere(P, a)); } M.vertices += 1; } @@ -3999,10 +3999,10 @@ void main() { var h = f.updateGeoGroup(4), M, w = h.vertices, S = w * 3, T = h.vertexArray, R = h.colorArray; for (M = 0; M < 4; M++) T[S + 3 * M] = c.x, T[S + 3 * M + 1] = c.y, T[S + 3 * M + 2] = c.z; - var z = h.normalArray; + var $ = h.normalArray; for (M = 0; M < 4; M++) R[S + 3 * M] = a.r, R[S + 3 * M + 1] = a.g, R[S + 3 * M + 2] = a.b; - z[S + 0] = -t, z[S + 1] = t, z[S + 2] = 0, z[S + 3] = -t, z[S + 4] = -t, z[S + 5] = 0, z[S + 6] = t, z[S + 7] = -t, z[S + 8] = 0, z[S + 9] = t, z[S + 10] = t, z[S + 11] = 0, h.vertices += 4; + $[S + 0] = -t, $[S + 1] = t, $[S + 2] = 0, $[S + 3] = -t, $[S + 4] = -t, $[S + 5] = 0, $[S + 6] = t, $[S + 7] = -t, $[S + 8] = 0, $[S + 9] = t, $[S + 10] = t, $[S + 11] = 0, h.vertices += 4; var P = h.faceArray, B = h.faceidx; P[B + 0] = w, P[B + 1] = w + 1, P[B + 2] = w + 2, P[B + 3] = w + 2, P[B + 4] = w + 3, P[B + 5] = w, h.faceidx += 6; } @@ -4014,7 +4014,7 @@ void main() { var a = this.getRadiusFromStyle(f, t), h = (0, E.getColorFromStyle)(f, t); if ((f.clickable === !0 || f.hoverable) && f.intersectionShape !== void 0) { var M = new _.Vector3(f.x, f.y, f.z); - f.intersectionShape.sphere.push(new g.Sphere(M, a)); + f.intersectionShape.sphere.push(new p.Sphere(M, a)); } this.drawSphereImposter(c, f, a, h); } @@ -4025,19 +4025,19 @@ void main() { t = Math.max(t, 0), h = Math.max(h, 0) + 2 * t, a = Math.max(a, 1e-3), a + h > M && (a = M, h = 0); var w = Math.floor((M - a) / (a + h)) + 1, S = w * a; h = (M - S) / w; - for (var T, R = new _.Vector3(f.x, f.y, f.z), z = new _.Vector3((c.x - f.x) / (M / h), (c.y - f.y) / (M / h), (c.z - f.z) / (M / h)), P = new _.Vector3((c.x - f.x) / (M / a), (c.y - f.y) / (M / a), (c.z - f.z) / (M / a)), B = [], U = 0; U < w; U++) - T = new _.Vector3(R.x + P.x, R.y + P.y, R.z + P.z), B.push({ from: R, to: T }), R = new _.Vector3(T.x + z.x, T.y + z.y, T.z + z.z); + for (var T, R = new _.Vector3(f.x, f.y, f.z), $ = new _.Vector3((c.x - f.x) / (M / h), (c.y - f.y) / (M / h), (c.z - f.z) / (M / h)), P = new _.Vector3((c.x - f.x) / (M / a), (c.y - f.y) / (M / a), (c.z - f.z) / (M / a)), B = [], F = 0; F < w; F++) + T = new _.Vector3(R.x + P.x, R.y + P.y, R.z + P.z), B.push({ from: R, to: T }), R = new _.Vector3(T.x + $.x, T.y + $.y, T.z + $.z); return B; } static drawStickImposter(f, c, t, a, h, M = 0, w = 0) { - for (var S = f.updateGeoGroup(4), T = S.vertices, R = T * 3, z = S.vertexArray, P = S.colorArray, B = S.radiusArray, U = S.normalArray, F = h.r, $ = h.g, W = h.b, N = function(ie) { - var pe = -ie; - return pe == 0 && (pe = -1e-4), pe; - }, G = R, k = 0; k < 4; k++) - z[G] = c.x, U[G] = t.x, P[G] = F, G++, z[G] = c.y, U[G] = t.y, P[G] = $, G++, z[G] = c.z, U[G] = t.z, k < 2 ? P[G] = W : P[G] = N(W), G++; + for (var S = f.updateGeoGroup(4), T = S.vertices, R = T * 3, $ = S.vertexArray, P = S.colorArray, B = S.radiusArray, F = S.normalArray, U = h.r, z = h.g, W = h.b, V = function(ie) { + var ge = -ie; + return ge == 0 && (ge = -1e-4), ge; + }, N = R, k = 0; k < 4; k++) + $[N] = c.x, F[N] = t.x, P[N] = U, N++, $[N] = c.y, F[N] = t.y, P[N] = z, N++, $[N] = c.z, F[N] = t.z, k < 2 ? P[N] = W : P[N] = V(W), N++; S.vertices += 4, B[T] = -a, B[T + 1] = a, B[T + 2] = -a, B[T + 3] = a; - var j = S.faceArray, Q = S.faceidx; - j[Q + 0] = T, j[Q + 1] = T + 1, j[Q + 2] = T + 2, j[Q + 3] = T + 2, j[Q + 4] = T + 3, j[Q + 5] = T, S.faceidx += 6; + var G = S.faceArray, Q = S.faceidx; + G[Q + 0] = T, G[Q + 1] = T + 1, G[Q + 2] = T + 2, G[Q + 3] = T + 2, G[Q + 4] = T + 3, G[Q + 5] = T, S.faceidx += 6; } // draws cylinders and small spheres (at bond radius) drawBondSticks(f, c, t) { @@ -4045,55 +4045,55 @@ void main() { if (f.style.stick) { var M = f.style.stick; if (!M.hidden) { - var w = M.radius || this.defaultStickRadius, S = M.doubleBondScaling || 0.4, T = M.tripleBondScaling || 0.25, R = ((a = M.dashedBondConfig) === null || a === void 0 ? void 0 : a.dashLength) || 0.1, z = ((h = M.dashedBondConfig) === null || h === void 0 ? void 0 : h.gapLength) || 0.25, P = w, B = M.singleBonds || !1, U = M.dashedBonds || !1, F = 0, $ = 0, W, N, G, k, j, Q, ie, pe, he, ue, se, ae = (0, E.getColorFromStyle)(f, M), we, xe, Ie; - !f.capDrawn && f.bonds.length < 4 && (F = 2); - var oe = (Pe) => { - var le = t.imposter ? n.drawStickImposter : o.GLDraw.drawCylinder; - return !U && Pe >= 1 ? le : (De, K, Oe, Ne, I, me = 0, ge = 0, Y = 0.1, ne = 0.25) => { - var Ee = this.calculateDashes(K, Oe, Ne, Y, ne); + var w = M.radius || this.defaultStickRadius, S = M.doubleBondScaling || 0.4, T = M.tripleBondScaling || 0.25, R = ((a = M.dashedBondConfig) === null || a === void 0 ? void 0 : a.dashLength) || 0.1, $ = ((h = M.dashedBondConfig) === null || h === void 0 ? void 0 : h.gapLength) || 0.25, P = w, B = M.singleBonds || !1, F = M.dashedBonds || !1, U = 0, z = 0, W, V, N, k, G, Q, ie, ge, le, oe, he, se = (0, E.getColorFromStyle)(f, M), xe, ye, Pe; + !f.capDrawn && f.bonds.length < 4 && (U = 2); + var de = (Te) => { + var ae = t.imposter ? n.drawStickImposter : o.GLDraw.drawCylinder; + return !F && Te >= 1 ? ae : (De, Y, Oe, Ve, I, me = 0, ve = 0, X = 0.1, ne = 0.25) => { + var Ee = this.calculateDashes(Y, Oe, Ve, X, ne); Ee.forEach((He) => { - le(De, He.from, He.to, Ne, I, me, ge); + ae(De, He.from, He.to, Ve, I, me, ve); }); }; }; - for (G = 0; G < f.bonds.length; G++) { - var ve = oe(f.bondOrder[G]), re = f.bonds[G], Se = c[re]; - if (we = xe = Ie = null, f.index < Se.index) { - var ze = Se.style; - if (!ze.stick || ze.stick.hidden) + for (N = 0; N < f.bonds.length; N++) { + var pe = de(f.bondOrder[N]), re = f.bonds[N], Se = c[re]; + if (xe = ye = Pe = null, f.index < Se.index) { + var ke = Se.style; + if (!ke.stick || ke.stick.hidden) continue; - var Ge = (0, E.getColorFromStyle)(Se, ze.stick); - if (P = w, k = B, f.bondStyles && f.bondStyles[G]) { - if (j = f.bondStyles[G], j.iswire) + var $e = (0, E.getColorFromStyle)(Se, ke.stick); + if (P = w, k = B, f.bondStyles && f.bondStyles[N]) { + if (G = f.bondStyles[N], G.iswire) continue; - j.radius && (P = j.radius), j.singleBond && (k = !0), typeof j.color1 < "u" && (ae = x.CC.color(j.color1)), typeof j.color2 < "u" && (Ge = x.CC.color(j.color2)); + G.radius && (P = G.radius), G.singleBond && (k = !0), typeof G.color1 < "u" && (se = x.CC.color(G.color1)), typeof G.color2 < "u" && ($e = x.CC.color(G.color2)); } - var $e = new _.Vector3(f.x, f.y, f.z), Re = new _.Vector3(Se.x, Se.y, Se.z); - if (f.bondOrder[G] <= 1 || k || f.bondOrder[G] > 3) { - if (f.bondOrder[G] < 1 && (P *= f.bondOrder[G]), !Se.capDrawn && Se.bonds.length < 4 && ($ = 2), ae != Ge ? (we = new _.Vector3().addVectors($e, Re).multiplyScalar(0.5), ve(t, $e, we, P, ae, F, 0, R, z), ve(t, we, Re, P, Ge, 0, $, R, z)) : ve(t, $e, Re, P, ae, F, $, R, z), W = f.clickable || f.hoverable, N = Se.clickable || Se.hoverable, W || N) { - if (we || (we = new _.Vector3().addVectors($e, Re).multiplyScalar(0.5)), W) { - var Be = new g.Cylinder($e, we, P), ke = new g.Sphere($e, P); - f.intersectionShape.cylinder.push(Be), f.intersectionShape.sphere.push(ke); + var ze = new _.Vector3(f.x, f.y, f.z), Re = new _.Vector3(Se.x, Se.y, Se.z); + if (f.bondOrder[N] <= 1 || k || f.bondOrder[N] > 3) { + if (f.bondOrder[N] < 1 && (P *= f.bondOrder[N]), !Se.capDrawn && Se.bonds.length < 4 && (z = 2), se != $e ? (xe = new _.Vector3().addVectors(ze, Re).multiplyScalar(0.5), pe(t, ze, xe, P, se, U, 0, R, $), pe(t, xe, Re, P, $e, 0, z, R, $)) : pe(t, ze, Re, P, se, U, z, R, $), W = f.clickable || f.hoverable, V = Se.clickable || Se.hoverable, W || V) { + if (xe || (xe = new _.Vector3().addVectors(ze, Re).multiplyScalar(0.5)), W) { + var Fe = new p.Cylinder(ze, xe, P), Ie = new p.Sphere(ze, P); + f.intersectionShape.cylinder.push(Fe), f.intersectionShape.sphere.push(Ie); } - if (N) { - var We = new g.Cylinder(Re, we, P), Te = new g.Sphere(Re, P); - Se.intersectionShape.cylinder.push(We), Se.intersectionShape.sphere.push(Te); + if (V) { + var We = new p.Cylinder(Re, xe, P), Ue = new p.Sphere(Re, P); + Se.intersectionShape.cylinder.push(We), Se.intersectionShape.sphere.push(Ue); } } - } else if (f.bondOrder[G] > 1) { - var je = 0, Fe = 0; - P != w && (je = 2, Fe = 2); - var X = Re.clone(), Z = null; - X.sub($e); + } else if (f.bondOrder[N] > 1) { + var Be = 0, Ne = 0; + P != w && (Be = 2, Ne = 2); + var H = Re.clone(), K = null; + H.sub(ze); var q, fe, _e, Me, Ae; - Z = this.getSideBondV(f, Se, G), f.bondOrder[G] == 2 ? (q = P * S, Z.multiplyScalar(q * 1.5), fe = $e.clone(), fe.add(Z), _e = $e.clone(), _e.sub(Z), Me = fe.clone(), Me.add(X), Ae = _e.clone(), Ae.add(X), ae != Ge ? (we = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5), xe = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5), ve(t, fe, we, q, ae, je, 0), ve(t, we, Me, q, Ge, 0, Fe), ve(t, _e, xe, q, ae, je, 0), ve(t, xe, Ae, q, Ge, 0, Fe)) : (ve(t, fe, Me, q, ae, je, Fe), ve(t, _e, Ae, q, ae, je, Fe)), W = f.clickable || f.hoverable, N = Se.clickable || Se.hoverable, (W || N) && (we || (we = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5)), xe || (xe = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5)), W && (Q = new g.Cylinder(fe, we, q), ie = new g.Cylinder(_e, xe, q), f.intersectionShape.cylinder.push(Q), f.intersectionShape.cylinder.push(ie)), N && (he = new g.Cylinder(Me, we, q), ue = new g.Cylinder(Ae, xe, q), Se.intersectionShape.cylinder.push(he), Se.intersectionShape.cylinder.push(ue)))) : f.bondOrder[G] == 3 && (q = P * T, Z.cross(X), Z.normalize(), Z.multiplyScalar(q * 3), fe = $e.clone(), fe.add(Z), _e = $e.clone(), _e.sub(Z), Me = fe.clone(), Me.add(X), Ae = _e.clone(), Ae.add(X), ae != Ge ? (we = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5), xe = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5), Ie = new _.Vector3().addVectors($e, Re).multiplyScalar(0.5), ve(t, fe, we, q, ae, je, 0), ve(t, we, Me, q, Ge, 0, Fe), ve(t, $e, Ie, q, ae, F, 0), ve(t, Ie, Re, q, Ge, 0, $), ve(t, _e, xe, q, ae, je, 0), ve(t, xe, Ae, q, Ge, 0, Fe)) : (ve(t, fe, Me, q, ae, je, Fe), ve(t, $e, Re, q, ae, F, $), ve(t, _e, Ae, q, ae, je, Fe)), W = f.clickable || f.hoverable, N = Se.clickable || Se.hoverable, (W || N) && (we || (we = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5)), xe || (xe = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5)), Ie || (Ie = new _.Vector3().addVectors($e, Re).multiplyScalar(0.5)), W && (Q = new g.Cylinder(fe.clone(), we.clone(), q), ie = new g.Cylinder(_e.clone(), xe.clone(), q), pe = new g.Cylinder($e.clone(), Ie.clone(), q), f.intersectionShape.cylinder.push(Q), f.intersectionShape.cylinder.push(ie), f.intersectionShape.cylinder.push(pe)), N && (he = new g.Cylinder(Me.clone(), we.clone(), q), ue = new g.Cylinder(Ae.clone(), xe.clone(), q), se = new g.Cylinder(Re.clone(), Ie.clone(), q), Se.intersectionShape.cylinder.push(he), Se.intersectionShape.cylinder.push(ue), Se.intersectionShape.cylinder.push(se)))); + K = this.getSideBondV(f, Se, N), f.bondOrder[N] == 2 ? (q = P * S, K.multiplyScalar(q * 1.5), fe = ze.clone(), fe.add(K), _e = ze.clone(), _e.sub(K), Me = fe.clone(), Me.add(H), Ae = _e.clone(), Ae.add(H), se != $e ? (xe = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5), ye = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5), pe(t, fe, xe, q, se, Be, 0), pe(t, xe, Me, q, $e, 0, Ne), pe(t, _e, ye, q, se, Be, 0), pe(t, ye, Ae, q, $e, 0, Ne)) : (pe(t, fe, Me, q, se, Be, Ne), pe(t, _e, Ae, q, se, Be, Ne)), W = f.clickable || f.hoverable, V = Se.clickable || Se.hoverable, (W || V) && (xe || (xe = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5)), ye || (ye = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5)), W && (Q = new p.Cylinder(fe, xe, q), ie = new p.Cylinder(_e, ye, q), f.intersectionShape.cylinder.push(Q), f.intersectionShape.cylinder.push(ie)), V && (le = new p.Cylinder(Me, xe, q), oe = new p.Cylinder(Ae, ye, q), Se.intersectionShape.cylinder.push(le), Se.intersectionShape.cylinder.push(oe)))) : f.bondOrder[N] == 3 && (q = P * T, K.cross(H), K.normalize(), K.multiplyScalar(q * 3), fe = ze.clone(), fe.add(K), _e = ze.clone(), _e.sub(K), Me = fe.clone(), Me.add(H), Ae = _e.clone(), Ae.add(H), se != $e ? (xe = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5), ye = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5), Pe = new _.Vector3().addVectors(ze, Re).multiplyScalar(0.5), pe(t, fe, xe, q, se, Be, 0), pe(t, xe, Me, q, $e, 0, Ne), pe(t, ze, Pe, q, se, U, 0), pe(t, Pe, Re, q, $e, 0, z), pe(t, _e, ye, q, se, Be, 0), pe(t, ye, Ae, q, $e, 0, Ne)) : (pe(t, fe, Me, q, se, Be, Ne), pe(t, ze, Re, q, se, U, z), pe(t, _e, Ae, q, se, Be, Ne)), W = f.clickable || f.hoverable, V = Se.clickable || Se.hoverable, (W || V) && (xe || (xe = new _.Vector3().addVectors(fe, Me).multiplyScalar(0.5)), ye || (ye = new _.Vector3().addVectors(_e, Ae).multiplyScalar(0.5)), Pe || (Pe = new _.Vector3().addVectors(ze, Re).multiplyScalar(0.5)), W && (Q = new p.Cylinder(fe.clone(), xe.clone(), q), ie = new p.Cylinder(_e.clone(), ye.clone(), q), ge = new p.Cylinder(ze.clone(), Pe.clone(), q), f.intersectionShape.cylinder.push(Q), f.intersectionShape.cylinder.push(ie), f.intersectionShape.cylinder.push(ge)), V && (le = new p.Cylinder(Me.clone(), xe.clone(), q), oe = new p.Cylinder(Ae.clone(), ye.clone(), q), he = new p.Cylinder(Re.clone(), Pe.clone(), q), Se.intersectionShape.cylinder.push(le), Se.intersectionShape.cylinder.push(oe), Se.intersectionShape.cylinder.push(he)))); } } } - var H = !1, ce = 0, ye = !1; - for (G = 0; G < f.bonds.length; G++) - k = B, f.bondStyles && f.bondStyles[G] && (j = f.bondStyles[G], j.singleBond && (k = !0), j.radius && j.radius != w && (ye = !0)), (k || f.bondOrder[G] == 1) && ce++; - ye ? ce > 0 && (H = !0) : ce == 0 && (f.bonds.length > 0 || M.showNonBonded) && (H = !0), H && (P = w, t.imposter ? this.drawSphereImposter(t.sphereGeometry, f, P, ae) : o.GLDraw.drawSphere(t, f, P, ae)); + var Z = !1, ue = 0, we = !1; + for (N = 0; N < f.bonds.length; N++) + k = B, f.bondStyles && f.bondStyles[N] && (G = f.bondStyles[N], G.singleBond && (k = !0), G.radius && G.radius != w && (we = !0)), (k || f.bondOrder[N] == 1) && ue++; + we ? ue > 0 && (Z = !0) : ue == 0 && (f.bonds.length > 0 || M.showNonBonded) && (Z = !0), Z && (P = w, t.imposter ? this.drawSphereImposter(t.sphereGeometry, f, P, se) : o.GLDraw.drawSphere(t, f, P, se)); } } } @@ -4107,77 +4107,77 @@ void main() { c = c || {}; var t = new l.Object3D(), a = [], h = {}, M = {}, w = this.drawAtomSphere, S = null, T = null; c.supportsImposters ? (w = this.drawAtomImposter, S = new l.Geometry(!0), S.imposter = !0, T = new l.Geometry(!0, !0), T.imposter = !0, T.sphereGeometry = new l.Geometry(!0), T.sphereGeometry.imposter = !0, T.drawnCaps = {}) : c.supportsAIA ? (w = this.drawAtomInstanced, S = new l.Geometry(!1, !0, !0), S.instanced = !0, T = new l.Geometry(!0)) : (S = new l.Geometry(!0), T = new l.Geometry(!0)); - var R, z, P, B, U = {}, F = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; + var R, $, P, B, F = {}, U = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; for (R = 0, P = f.length; R < P; R++) { - var $ = f[R]; - 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, U[z] ? B[z] != null && U[z] != B[z] && (console.log("Warning: " + z + " opacity is ambiguous"), U[z] = 1) : U[z] = B[z]; - w.call(this, $, S), this.drawAtomClickSphere($), this.drawAtomCross($, M), this.drawBondLines($, f, h), this.drawBondSticks($, f, T), typeof $.style.cartoon < "u" && !$.style.cartoon.hidden && ($.style.cartoon.color === "spectrum" && typeof $.resi == "number" && !$.hetflag && ($.resi < F[0] && (F[0] = $.resi), $.resi > F[1] && (F[1] = $.resi)), a.push($)); + var z = f[R]; + if (z && z.style) { + (z.clickable || z.hoverable) && z.intersectionShape === void 0 && (z.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), B = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; + for ($ in B) + z.style[$] ? z.style[$].opacity ? B[$] = parseFloat(z.style[$].opacity) : B[$] = 1 : B[$] = void 0, F[$] ? B[$] != null && F[$] != B[$] && (console.log("Warning: " + $ + " opacity is ambiguous"), F[$] = 1) : F[$] = B[$]; + w.call(this, z, S), this.drawAtomClickSphere(z), this.drawAtomCross(z, M), this.drawBondLines(z, f, h), this.drawBondSticks(z, f, T), typeof z.style.cartoon < "u" && !z.style.cartoon.hidden && (z.style.cartoon.color === "spectrum" && typeof z.resi == "number" && !z.hetflag && (z.resi < U[0] && (U[0] = z.resi), z.resi > U[1] && (U[1] = z.resi)), a.push(z)); } } - if (a.length > 0 && (0, p.drawCartoon)(t, a, F, this.defaultCartoonQuality), S && S.vertices > 0) { + if (a.length > 0 && (0, g.drawCartoon)(t, a, U, this.defaultCartoonQuality), S && S.vertices > 0) { S.initTypedArrays(); - var W = null, N = null; + var W = null, V = null; S.imposter ? W = new l.SphereImposterMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }) : S.instanced ? (N = new l.Geometry(!0), o.GLDraw.drawSphere(N, { x: 0, y: 0, z: 0 }, 1, new x.Color(0.5, 0.5, 0.5)), N.initTypedArrays(), W = new l.InstancedMaterial({ + }) : S.instanced ? (V = new l.Geometry(!0), o.GLDraw.drawSphere(V, { x: 0, y: 0, z: 0 }, 1, new x.Color(0.5, 0.5, 0.5)), V.initTypedArrays(), W = new l.InstancedMaterial({ sphereMaterial: new l.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 }), - sphere: N + sphere: V })) : W = new l.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }), U.sphere < 1 && U.sphere >= 0 && (W.transparent = !0, W.opacity = U.sphere), N = new l.Mesh(S, W), t.add(N); + }), F.sphere < 1 && F.sphere >= 0 && (W.transparent = !0, W.opacity = F.sphere), V = new l.Mesh(S, W), t.add(V); } if (T.vertices > 0) { - var G = null, k = null, j = T.sphereGeometry; - (!j || typeof j.vertices > "u" || j.vertices == 0) && (j = null), T.initTypedArrays(), j && j.initTypedArrays(); + var N = null, k = null, G = T.sphereGeometry; + (!G || typeof G.vertices > "u" || G.vertices == 0) && (G = null), T.initTypedArrays(), G && G.initTypedArrays(); var Q = { ambient: 0, vertexColors: !0, reflectivity: 0 }; - T.imposter ? (G = new l.StickImposterMaterial(Q), k = new l.SphereImposterMaterial(Q)) : (G = new l.MeshLambertMaterial(Q), k = new l.MeshLambertMaterial(Q), G.wireframe && (T.setUpWireframe(), j && j.setUpWireframe())), U.stick < 1 && U.stick >= 0 && (G.transparent = !0, G.opacity = U.stick, k.transparent = !0, k.opacity = U.stick); - var ie = new l.Mesh(T, G); - if (t.add(ie), j) { - var pe = new l.Mesh(j, k); - t.add(pe); + T.imposter ? (N = new l.StickImposterMaterial(Q), k = new l.SphereImposterMaterial(Q)) : (N = new l.MeshLambertMaterial(Q), k = new l.MeshLambertMaterial(Q), N.wireframe && (T.setUpWireframe(), G && G.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (N.transparent = !0, N.opacity = F.stick, k.transparent = !0, k.opacity = F.stick); + var ie = new l.Mesh(T, N); + if (t.add(ie), G) { + var ge = new l.Mesh(G, k); + t.add(ge); } } - var he; + var le; for (R in h) if (h.hasOwnProperty(R)) { - he = R; - var ue = new l.LineBasicMaterial({ - linewidth: he, + le = R; + var oe = new l.LineBasicMaterial({ + linewidth: le, vertexColors: !0 }); - U.line < 1 && U.line >= 0 && (ue.transparent = !0, ue.opacity = U.line), h[R].initTypedArrays(); - var se = new l.Line(h[R], ue, l.LineStyle.LinePieces); - t.add(se); + F.line < 1 && F.line >= 0 && (oe.transparent = !0, oe.opacity = F.line), h[R].initTypedArrays(); + var he = new l.Line(h[R], oe, l.LineStyle.LinePieces); + t.add(he); } for (R in M) if (M.hasOwnProperty(R)) { - he = R; - var ae = new l.LineBasicMaterial({ - linewidth: he, + le = R; + var se = new l.LineBasicMaterial({ + linewidth: le, vertexColors: !0 }); - U.cross < 1 && U.cross >= 0 && (ae.transparent = !0, ae.opacity = U.cross), M[R].initTypedArrays(); - var we = new l.Line(M[R], ae, l.LineStyle.LinePieces); - t.add(we); + F.cross < 1 && F.cross >= 0 && (se.transparent = !0, se.opacity = F.cross), M[R].initTypedArrays(); + var xe = new l.Line(M[R], se, l.LineStyle.LinePieces); + t.add(xe); } if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) { - var xe = new l.Object3D(), Ie; - for (Ie = 0; Ie < this.modelData.symmetries.length; Ie++) { - var oe = new l.Object3D(); - oe = t.clone(), oe.matrix.copy(this.modelData.symmetries[Ie]), oe.matrixAutoUpdate = !1, xe.add(oe); + var ye = new l.Object3D(), Pe; + for (Pe = 0; Pe < this.modelData.symmetries.length; Pe++) { + var de = new l.Object3D(); + de = t.clone(), de.matrix.copy(this.modelData.symmetries[Pe]), de.matrixAutoUpdate = !1, ye.add(de); } - return xe; + return ye; } return t; } @@ -4296,8 +4296,8 @@ void main() { if (this.box && this.atomdfs) for (var f = this.box[0], c = this.box[1], t = this.box[2], a = f * 0.9, h = c * 0.9, M = t * 0.9, w = 0; w < this.atomdfs.length; w++) for (var S = this.atomdfs[w], T = 1; T < S.length; T++) { - var R = this.atoms[S[T][0]], z = this.atoms[S[T][1]]; - R.x = this.adjustCoord(z.x, R.x, a, f), R.y = this.adjustCoord(z.y, R.y, h, c), R.z = this.adjustCoord(z.z, R.z, M, t); + var R = this.atoms[S[T][0]], $ = this.atoms[S[T][1]]; + R.x = this.adjustCoord($.x, R.x, a, f), R.y = this.adjustCoord($.y, R.y, h, c), R.z = this.adjustCoord($.z, R.z, M, t); } } /** @@ -4314,8 +4314,8 @@ void main() { if (t == 0 && h(), (f < 0 || f >= t) && (f = t - 1), a.frames.url != null) { var w = a.frames.url; (0, E.getbin)(w + "/traj/frame/" + f + "/" + a.frames.path, void 0, "POST", void 0).then(function(S) { - for (var T = new Float32Array(S, 44), R = 0, z = 0; z < a.atoms.length; z++) - a.atoms[z].x = T[R++], a.atoms[z].y = T[R++], a.atoms[z].z = T[R++]; + for (var T = new Float32Array(S, 44), R = 0, $ = 0; $ < a.atoms.length; $++) + a.atoms[$].x = T[R++], a.atoms[$].y = T[R++], a.atoms[$].z = T[R++]; a.box && a.atomdfs && a.adjustCoordinatesToBox(), h(); }).catch(M); } else @@ -4360,17 +4360,17 @@ void main() { 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"), U = (0, E.getAtomProperty)(this.atoms[z], "dz"), F = new _.Vector3(P, B, U), $ = new _.Vector3(this.atoms[z].x, this.atoms[z].y, this.atoms[z].z), W = S * c / f; - F.multiplyScalar(W), $.add(F); - var N = {}; - for (var G in this.atoms[z]) - N[G] = this.atoms[z][G]; - if (N.x = $.x, N.y = $.y, N.z = $.z, T.push(N), a && h) { - var k = (0, E.extend)({}, h), j = new _.Vector3(P, B, U); - if (j.multiplyScalar(c), j.add($), k.start = $, k.end = j, k.frame = R, !k.color) { - var Q = N.style.sphere; - Q || (Q = N.style.stick), Q || (Q = N.style.line), k.color = (0, E.getColorFromStyle)(N, Q); + for (var $ = 0; $ < this.atoms.length; $++) { + var P = (0, E.getAtomProperty)(this.atoms[$], "dx"), B = (0, E.getAtomProperty)(this.atoms[$], "dy"), F = (0, E.getAtomProperty)(this.atoms[$], "dz"), U = new _.Vector3(P, B, F), z = new _.Vector3(this.atoms[$].x, this.atoms[$].y, this.atoms[$].z), W = S * c / f; + U.multiplyScalar(W), z.add(U); + var V = {}; + for (var N in this.atoms[$]) + V[N] = this.atoms[$][N]; + if (V.x = z.x, V.y = z.y, V.z = z.z, T.push(V), a && h) { + var k = (0, E.extend)({}, h), G = new _.Vector3(P, B, F); + if (G.multiplyScalar(c), G.add(z), k.start = z, k.end = G, k.frame = R, !k.color) { + var Q = V.style.sphere; + Q || (Q = V.style.stick), Q || (Q = V.style.line), k.color = (0, E.getColorFromStyle)(V, Q); } a.addArrow(k); } @@ -4459,10 +4459,10 @@ void main() { } if (a == "and") { const w = function(T, R) { - const z = /* @__PURE__ */ new Set(); + const $ = /* @__PURE__ */ new Set(); for (const P of R) - T.has(P) && z.add(P); - return z; + T.has(P) && $.add(P); + return $; }; let S = new Set(M[0]); for (const T of M.splice(1)) @@ -4530,8 +4530,8 @@ void main() { } } else if (Array.isArray(c[h])) { var T = c[h], R = f[h]; - for (let z = 0; z < T.length; z++) - if (this.propertyMatches(R, T[z])) { + for (let $ = 0; $ < T.length; $++) + if (this.propertyMatches(R, T[$])) { w = !0; break; } @@ -4540,8 +4540,8 @@ void main() { break; } } else { - let z = c[h]; - if (!this.propertyMatches(f[h], z)) { + let $ = c[h]; + if (!this.propertyMatches(f[h], $)) { a = !1; break; } @@ -4599,22 +4599,22 @@ void main() { M && this.atomIsSelected(M, f) && t.push(M); } if (f.hasOwnProperty("expand")) { - const N = n.getFloat(f.expand); - let G = this.expandAtomList(t, N), k = t.length; - const j = N * N; - for (let Q = 0; Q < G.length; Q++) + const V = n.getFloat(f.expand); + let N = this.expandAtomList(t, V), k = t.length; + const G = V * V; + for (let Q = 0; Q < N.length; Q++) for (let ie = 0; ie < k; ie++) { - var w = n.squaredDistance(G[Q], t[ie]); - w < j && w > 0 && t.push(G[Q]); + var w = n.squaredDistance(N[Q], t[ie]); + w < G && w > 0 && t.push(N[Q]); } } if (f.hasOwnProperty("within") && f.within.hasOwnProperty("sel") && f.within.hasOwnProperty("distance")) { var S = this.selectedAtoms(f.within.sel, this.atoms), T = {}; - const N = n.getFloat(f.within.distance), G = N * N; + const V = n.getFloat(f.within.distance), N = V * V; for (let k = 0; k < S.length; k++) - for (let j = 0; j < t.length; j++) { - let Q = n.squaredDistance(S[k], t[j]); - Q < G && Q > 0 && (T[j] = 1); + for (let G = 0; G < t.length; G++) { + let Q = n.squaredDistance(S[k], t[G]); + Q < N && Q > 0 && (T[G] = 1); } var R = []; if (f.within.invert) @@ -4626,17 +4626,17 @@ void main() { t = R; } if (f.hasOwnProperty("byres")) { - var z = {}, P = [], B = []; - for (let N = 0; N < t.length; N++) { - let G = t[N]; - var U = G.chain, F = G.resi; - if (z[U] === void 0 && (z[U] = {}), G.hasOwnProperty("resi") && z[U][F] === void 0) { - for (z[U][F] = !0, B.push(G); B.length > 0; ) - if (G = B.pop(), U = G.chain, F = G.resi, P[G.index] === void 0) { - P[G.index] = !0; - for (var $ = 0; $ < G.bonds.length; $++) { - var W = this.atoms[G.bonds[$]]; - P[W.index] === void 0 && W.hasOwnProperty("resi") && W.chain == U && W.resi == F && (B.push(W), t.push(W)); + var $ = {}, P = [], B = []; + for (let V = 0; V < t.length; V++) { + let N = t[V]; + var F = N.chain, U = N.resi; + if ($[F] === void 0 && ($[F] = {}), N.hasOwnProperty("resi") && $[F][U] === void 0) { + for ($[F][U] = !0, B.push(N); B.length > 0; ) + if (N = B.pop(), F = N.chain, U = N.resi, P[N.index] === void 0) { + P[N.index] = !0; + for (var z = 0; z < N.bonds.length; z++) { + var W = this.atoms[N.bonds[z]]; + P[W.index] === void 0 && W.hasOwnProperty("resi") && W.chain == F && W.resi == U && (B.push(W), t.push(W)); } } } @@ -4723,8 +4723,8 @@ void main() { S[R] && (S[R].capDrawn = !1); for (let R = 0; R < T.length; R++) { a = !0, (T[R].clickable || T[R].hoverable) && (T[R].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), t || (T[R].style = {}); - for (let z in c) - c.hasOwnProperty(z) && (T[R].style[z] = T[R].style[z] || {}, Object.assign(T[R].style[z], c[z])); + for (let $ in c) + c.hasOwnProperty($) && (T[R].style[$] = T[R].style[$] || {}, Object.assign(T[R].style[$], c[$])); } }; if (f.frame !== void 0 && f.frame < this.frames.length) { @@ -4866,8 +4866,8 @@ void main() { let R = { b: S, e: T - }, z = M.bondOrder[w]; - z != 1 && (R.o = z), c.b.push(R); + }, $ = M.bondOrder[w]; + $ != 1 && (R.o = $), c.b.push(R); } } return c; @@ -4949,24 +4949,24 @@ void main() { */ addResLabels(f, c, t, a = !1) { var h = [], M = function(S, T) { - for (var R = S.selectedAtoms(f, R), z = {}, P = 0; P < R.length; P++) { - var B = R[P], U = B.chain, F = B.resn, $ = B.resi, W = F + "" + $; - z[U] || (z[U] = {}), z[U][W] || (z[U][W] = []), z[U][W].push(B); + for (var R = S.selectedAtoms(f, R), $ = {}, P = 0; P < R.length; P++) { + var B = R[P], F = B.chain, U = B.resn, z = B.resi, W = U + "" + z; + $[F] || ($[F] = {}), $[F][W] || ($[F][W] = []), $[F][W].push(B); } - var N = (0, E.deepCopy)(t); - for (let k in z) - if (z.hasOwnProperty(k)) { - var G = z[k]; - for (let j in G) - if (G.hasOwnProperty(j)) { - let Q = G[j], ie = new _.Vector3(0, 0, 0); - for (let he = 0; he < Q.length; he++) { - let ue = Q[he]; - ie.x += ue.x, ie.y += ue.y, ie.z += ue.z; + var V = (0, E.deepCopy)(t); + for (let k in $) + if ($.hasOwnProperty(k)) { + var N = $[k]; + for (let G in N) + if (N.hasOwnProperty(G)) { + let Q = N[G], ie = new _.Vector3(0, 0, 0); + for (let le = 0; le < Q.length; le++) { + let oe = Q[le]; + ie.x += oe.x, ie.y += oe.y, ie.z += oe.z; } - ie.divideScalar(Q.length), N.position = ie, N.frame = T; - let pe = c.addLabel(j, N, void 0, !0); - h.push(pe); + ie.divideScalar(Q.length), V.position = ie, V.frame = T; + let ge = c.addLabel(G, V, void 0, !0); + h.push(ge); } } }; @@ -4989,8 +4989,8 @@ void main() { T.push([w, S]); var R = f.atoms[w]; c[w] = 1; - for (var z = 0; z < R.bonds.length; z++) { - var P = R.bonds[z]; + for (var $ = 0; $ < R.bonds.length; $++) { + var P = R.bonds[$]; f.atoms[P] && !c[P] && t(P, w, T); } }, a = 0; a < this.atoms.length; a++) { @@ -5036,8 +5036,8 @@ void main() { c = c.replace(/\.gz$/, ""); try { f = r(f); - } catch (z) { - console.log(z); + } catch ($) { + console.log($); } } var t = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" }; @@ -5085,7 +5085,7 @@ TER` && (h = f.indexOf(` ATOM`, h); } else if (c == "netcdf") { - var M = new C.NetCDFReader(f); + var M = new L.NetCDFReader(f); t = [].concat.apply([], M.getDataVariable("coordinates")); } else { if (c == "array" || Array.isArray(f)) @@ -5186,19 +5186,19 @@ ATOM`, h); /* harmony export */ GLShape: () => ( /* binding */ - C + L ), /* harmony export */ splitMesh: () => ( /* binding */ - L + C ) /* harmony export */ }); var l = e( /*! ./WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" ), _ = e( @@ -5210,7 +5210,7 @@ ATOM`, h); ), o = e( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), p = e( + ), g = e( /*! ./VolumeData */ "./src/VolumeData.ts" ), E = e( @@ -5223,7 +5223,7 @@ ATOM`, h); /*! ./utilities */ "./src/utilities.ts" ); - class C { + class L { static finalizeGeo(r) { var n = r.updateGeoGroup(0); n.vertices > 0 && n.truncateArrayBuffers(!0, !0); @@ -5263,38 +5263,38 @@ ATOM`, h); return; var w = n.updateGeoGroup(51), S = new _.Vector3(c.x, c.y, c.z).sub(f); if (M) { - let le = S.length(); - M > 0 ? h = M / le : h = (le + M) / le; + let ae = S.length(); + M > 0 ? h = M / ae : h = (ae + M) / ae; } S.multiplyScalar(h); var T = new _.Vector3(f.x, f.y, f.z).add(S), R = S.clone().negate(); - let z = new _.Vector3(f.x, f.y, f.z); - r.intersectionShape.cylinder.push(new g.Cylinder(z, T.clone(), t)), r.intersectionShape.sphere.push(new g.Sphere(z, t)); + let $ = new _.Vector3(f.x, f.y, f.z); + r.intersectionShape.cylinder.push(new p.Cylinder($, T.clone(), t)), r.intersectionShape.sphere.push(new p.Sphere($, t)); var P = []; P[0] = S.clone(), Math.abs(P[0].x) > 1e-4 ? P[0].y += 1 : P[0].x += 1, P[0].cross(S), P[0].normalize(), P[4] = P[0].clone(), P[4].crossVectors(P[0], S), 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 = w.vertices, U = w.vertexArray, F = w.faceArray, $ = w.normalArray, W = w.lineArray, N, G, k; - for (G = 0, k = P.length; G < k; ++G) { - N = 3 * (B + 3 * G); - var j = P[G].clone().multiplyScalar(t).add(f), Q = P[G].clone().multiplyScalar(t).add(T), ie = P[G].clone().multiplyScalar(t * a).add(T); - if (U[N] = j.x, U[N + 1] = j.y, U[N + 2] = j.z, U[N + 3] = Q.x, U[N + 4] = Q.y, U[N + 5] = Q.z, U[N + 6] = ie.x, U[N + 7] = ie.y, U[N + 8] = ie.z, G > 0) { - var pe = U[N - 3], he = U[N - 2], ue = U[N - 1], se = new _.Vector3(pe, he, ue), ae = new _.Vector3(c.x, c.y, c.z), we = T.clone(), xe = new _.Vector3(ie.x, ie.y, ie.z); - r.intersectionShape.triangle.push(new g.Triangle(xe, ae, se)), r.intersectionShape.triangle.push(new g.Triangle(se.clone(), we, xe.clone())); + var B = w.vertices, F = w.vertexArray, U = w.faceArray, z = w.normalArray, W = w.lineArray, V, N, k; + for (N = 0, k = P.length; N < k; ++N) { + V = 3 * (B + 3 * N); + var G = P[N].clone().multiplyScalar(t).add(f), Q = P[N].clone().multiplyScalar(t).add(T), ie = P[N].clone().multiplyScalar(t * a).add(T); + if (F[V] = G.x, F[V + 1] = G.y, F[V + 2] = G.z, F[V + 3] = Q.x, F[V + 4] = Q.y, F[V + 5] = Q.z, F[V + 6] = ie.x, F[V + 7] = ie.y, F[V + 8] = ie.z, N > 0) { + var ge = F[V - 3], le = F[V - 2], oe = F[V - 1], he = new _.Vector3(ge, le, oe), se = new _.Vector3(c.x, c.y, c.z), xe = T.clone(), ye = new _.Vector3(ie.x, ie.y, ie.z); + r.intersectionShape.triangle.push(new p.Triangle(ye, se, he)), r.intersectionShape.triangle.push(new p.Triangle(he.clone(), xe, ye.clone())); } } - w.vertices += 48, N = w.vertices * 3, U[N] = f.x, U[N + 1] = f.y, U[N + 2] = f.z, U[N + 3] = T.x, U[N + 4] = T.y, U[N + 5] = T.z, U[N + 6] = c.x, U[N + 7] = c.y, U[N + 8] = c.z, w.vertices += 3; - var Ie, oe, ve, re, Se, ze, Ge, $e, Re, Be, ke, We, Te, je, Fe, X, Z, q, fe, _e = w.vertices - 3, Me = w.vertices - 2, Ae = w.vertices - 1, H = _e * 3, ce = Me * 3, ye = Ae * 3; - for (G = 0, k = P.length - 1; G < k; ++G) { - var Pe = B + 3 * G; - N = Pe * 3, oe = w.faceidx, ve = w.lineidx, re = Pe, Be = re * 3, Se = Pe + 1, ke = Se * 3, ze = Pe + 2, We = ze * 3, Ge = Pe + 4, Te = Ge * 3, $e = Pe + 5, je = $e * 3, Re = Pe + 3, Fe = Re * 3, X = Z = P[G], q = fe = P[G + 1], $[Be] = X.x, $[ke] = Z.x, $[Fe] = fe.x, $[Be + 1] = X.y, $[ke + 1] = Z.y, $[Fe + 1] = fe.y, $[Be + 2] = X.z, $[ke + 2] = Z.z, $[Fe + 2] = fe.z, $[ke] = Z.x, $[Te] = q.x, $[Fe] = fe.x, $[ke + 1] = Z.y, $[Te + 1] = q.y, $[Fe + 1] = fe.y, $[ke + 2] = Z.z, $[Te + 2] = q.z, $[Fe + 2] = fe.z, $[We] = Z.x, $[je] = q.x, $[We + 1] = Z.y, $[je + 1] = q.y, $[We + 2] = Z.z, $[je + 2] = q.z, F[oe] = re, F[oe + 1] = Se, F[oe + 2] = Re, F[oe + 3] = Se, F[oe + 4] = Ge, F[oe + 5] = Re, F[oe + 6] = re, F[oe + 7] = Re, F[oe + 8] = _e, F[oe + 9] = ze, F[oe + 10] = Me, F[oe + 11] = $e, F[oe + 12] = ze, F[oe + 13] = Ae, F[oe + 14] = $e, W[ve] = re, W[ve + 1] = Se, W[ve + 2] = re, W[ve + 3] = Re, W[ve + 4] = Ge, W[ve + 5] = Re, W[ve + 6] = re, W[ve + 7] = Re, W[ve + 8] = ze, W[ve + 9] = Se, W[ve + 10] = ze, W[ve + 11] = $e, W[ve + 12] = Ge, W[ve + 13] = $e, W[ve + 14] = ze, W[ve + 15] = Ae, W[ve + 16] = ze, W[ve + 17] = $e, W[ve + 18] = Ae, W[ve + 19] = $e, w.faceidx += 15, w.lineidx += 20; + w.vertices += 48, V = w.vertices * 3, F[V] = f.x, F[V + 1] = f.y, F[V + 2] = f.z, F[V + 3] = T.x, F[V + 4] = T.y, F[V + 5] = T.z, F[V + 6] = c.x, F[V + 7] = c.y, F[V + 8] = c.z, w.vertices += 3; + var Pe, de, pe, re, Se, ke, $e, ze, Re, Fe, Ie, We, Ue, Be, Ne, H, K, q, fe, _e = w.vertices - 3, Me = w.vertices - 2, Ae = w.vertices - 1, Z = _e * 3, ue = Me * 3, we = Ae * 3; + for (N = 0, k = P.length - 1; N < k; ++N) { + var Te = B + 3 * N; + V = Te * 3, de = w.faceidx, pe = w.lineidx, re = Te, Fe = re * 3, Se = Te + 1, Ie = Se * 3, ke = Te + 2, We = ke * 3, $e = Te + 4, Ue = $e * 3, ze = Te + 5, Be = ze * 3, Re = Te + 3, Ne = Re * 3, H = K = P[N], q = fe = P[N + 1], z[Fe] = H.x, z[Ie] = K.x, z[Ne] = fe.x, z[Fe + 1] = H.y, z[Ie + 1] = K.y, z[Ne + 1] = fe.y, z[Fe + 2] = H.z, z[Ie + 2] = K.z, z[Ne + 2] = fe.z, z[Ie] = K.x, z[Ue] = q.x, z[Ne] = fe.x, z[Ie + 1] = K.y, z[Ue + 1] = q.y, z[Ne + 1] = fe.y, z[Ie + 2] = K.z, z[Ue + 2] = q.z, z[Ne + 2] = fe.z, z[We] = K.x, z[Be] = q.x, z[We + 1] = K.y, z[Be + 1] = q.y, z[We + 2] = K.z, z[Be + 2] = q.z, U[de] = re, U[de + 1] = Se, U[de + 2] = Re, U[de + 3] = Se, U[de + 4] = $e, U[de + 5] = Re, U[de + 6] = re, U[de + 7] = Re, U[de + 8] = _e, U[de + 9] = ke, U[de + 10] = Me, U[de + 11] = ze, U[de + 12] = ke, U[de + 13] = Ae, U[de + 14] = ze, W[pe] = re, W[pe + 1] = Se, W[pe + 2] = re, W[pe + 3] = Re, W[pe + 4] = $e, W[pe + 5] = Re, W[pe + 6] = re, W[pe + 7] = Re, W[pe + 8] = ke, W[pe + 9] = Se, W[pe + 10] = ke, W[pe + 11] = ze, W[pe + 12] = $e, W[pe + 13] = ze, W[pe + 14] = ke, W[pe + 15] = Ae, W[pe + 16] = ke, W[pe + 17] = ze, W[pe + 18] = Ae, W[pe + 19] = ze, w.faceidx += 15, w.lineidx += 20; } - Ie = [ + Pe = [ B + 45, B + 46, B + 1, B, B + 47, B + 2 - ], oe = w.faceidx, ve = w.lineidx, re = Ie[0], Be = re * 3, Se = Ie[1], ke = Se * 3, ze = Ie[4], We = ze * 3, Ge = Ie[2], Te = Ge * 3, $e = Ie[5], je = $e * 3, Re = Ie[3], Fe = Re * 3, X = Z = P[15], q = fe = P[0], $[Be] = X.x, $[ke] = Z.x, $[Fe] = fe.x, $[Be + 1] = X.y, $[ke + 1] = Z.y, $[Fe + 1] = fe.y, $[Be + 2] = X.z, $[ke + 2] = Z.z, $[Fe + 2] = fe.z, $[ke] = Z.x, $[Te] = q.x, $[Fe] = fe.x, $[ke + 1] = Z.y, $[Te + 1] = q.y, $[Fe + 1] = fe.y, $[ke + 2] = Z.z, $[Te + 2] = q.z, $[Fe + 2] = fe.z, $[We] = Z.x, $[je] = q.x, $[We + 1] = Z.y, $[je + 1] = q.y, $[We + 2] = Z.z, $[je + 2] = q.z, S.normalize(), R.normalize(), $[H] = R.x, $[ce] = $[ye] = S.x, $[H + 1] = R.y, $[ce + 1] = $[ye + 1] = S.y, $[H + 2] = R.z, $[ce + 2] = $[ye + 2] = S.z, F[oe] = re, F[oe + 1] = Se, F[oe + 2] = Re, F[oe + 3] = Se, F[oe + 4] = Ge, F[oe + 5] = Re, F[oe + 6] = re, F[oe + 7] = Re, F[oe + 8] = _e, F[oe + 9] = ze, F[oe + 10] = Me, F[oe + 11] = $e, F[oe + 12] = ze, F[oe + 13] = Ae, F[oe + 14] = $e, W[ve] = re, W[ve + 1] = Se, W[ve + 2] = re, W[ve + 3] = Re, W[ve + 4] = Ge, W[ve + 5] = Re, W[ve + 6] = re, W[ve + 7] = Re, W[ve + 8] = ze, W[ve + 9] = Se, W[ve + 10] = ze, W[ve + 11] = $e, W[ve + 12] = Ge, W[ve + 13] = $e, W[ve + 14] = ze, W[ve + 15] = Ae, W[ve + 16] = ze, W[ve + 17] = $e, W[ve + 18] = Ae, W[ve + 19] = $e, w.faceidx += 15, w.lineidx += 20; + ], de = w.faceidx, pe = w.lineidx, re = Pe[0], Fe = re * 3, Se = Pe[1], Ie = Se * 3, ke = Pe[4], We = ke * 3, $e = Pe[2], Ue = $e * 3, ze = Pe[5], Be = ze * 3, Re = Pe[3], Ne = Re * 3, H = K = P[15], q = fe = P[0], z[Fe] = H.x, z[Ie] = K.x, z[Ne] = fe.x, z[Fe + 1] = H.y, z[Ie + 1] = K.y, z[Ne + 1] = fe.y, z[Fe + 2] = H.z, z[Ie + 2] = K.z, z[Ne + 2] = fe.z, z[Ie] = K.x, z[Ue] = q.x, z[Ne] = fe.x, z[Ie + 1] = K.y, z[Ue + 1] = q.y, z[Ne + 1] = fe.y, z[Ie + 2] = K.z, z[Ue + 2] = q.z, z[Ne + 2] = fe.z, z[We] = K.x, z[Be] = q.x, z[We + 1] = K.y, z[Be + 1] = q.y, z[We + 2] = K.z, z[Be + 2] = q.z, S.normalize(), R.normalize(), z[Z] = R.x, z[ue] = z[we] = S.x, z[Z + 1] = R.y, z[ue + 1] = z[we + 1] = S.y, z[Z + 2] = R.z, z[ue + 2] = z[we + 2] = S.z, U[de] = re, U[de + 1] = Se, U[de + 2] = Re, U[de + 3] = Se, U[de + 4] = $e, U[de + 5] = Re, U[de + 6] = re, U[de + 7] = Re, U[de + 8] = _e, U[de + 9] = ke, U[de + 10] = Me, U[de + 11] = ze, U[de + 12] = ke, U[de + 13] = Ae, U[de + 14] = ze, W[pe] = re, W[pe + 1] = Se, W[pe + 2] = re, W[pe + 3] = Re, W[pe + 4] = $e, W[pe + 5] = Re, W[pe + 6] = re, W[pe + 7] = Re, W[pe + 8] = ke, W[pe + 9] = Se, W[pe + 10] = ke, W[pe + 11] = ze, W[pe + 12] = $e, W[pe + 13] = ze, W[pe + 14] = ke, W[pe + 15] = Ae, W[pe + 16] = ke, W[pe + 17] = ze, W[pe + 18] = Ae, W[pe + 19] = ze, w.faceidx += 15, w.lineidx += 20; } // Update a bounding sphere's position and radius // from list of centroids and new points @@ -5311,8 +5311,8 @@ ATOM`, h); r.center.set(0, 0, 0); let c = 1 / 0, t = 1 / 0, a = 1 / 0, h = -1 / 0, M = -1 / 0, w = -1 / 0; r.box && (c = r.box.min.x, h = r.box.max.x, t = r.box.min.y, M = r.box.max.y, a = r.box.min.z, w = r.box.max.z); - for (let z = 0, P = f; z < P; z++) { - var S = b[z * 3], T = b[z * 3 + 1], R = b[z * 3 + 2]; + for (let $ = 0, P = f; $ < P; $++) { + var S = b[$ * 3], T = b[$ * 3 + 1], R = b[$ * 3 + 2]; S < c && (c = S), T < t && (t = T), R < a && (a = R), S > h && (h = S), T > M && (M = T), R > w && (w = R); } r.center.set((h + c) / 2, (M + t) / 2, (w + a) / 2), r.radius = r.center.distanceTo({ x: h, y: M, z: w }), r.box = { min: { x: c, y: t, z: a }, max: { x: h, y: M, z: w } }; @@ -5321,27 +5321,27 @@ ATOM`, h); static addCustomGeo(r, n, b, f, c) { var t = n.addGeoGroup(), a = b.vertexArr, h = b.normalArr, M = b.faceArr; t.vertices = a.length, t.faceidx = M.length; - var w, S, T, R, z, P, B, U, F, $ = t.vertexArray, W = t.colorArray; - for (f.constructor !== Array && (U = f.r, F = f.g, R = f.b), P = 0, B = t.vertices; P < B; ++P) - w = P * 3, S = a[P], $[w] = S.x, $[w + 1] = S.y, $[w + 2] = S.z, f.constructor === Array && (z = f[P], U = z.r, F = z.g, R = z.b), W[w] = U, W[w + 1] = F, W[w + 2] = R; + var w, S, T, R, $, P, B, F, U, z = t.vertexArray, W = t.colorArray; + for (f.constructor !== Array && (F = f.r, U = f.g, R = f.b), P = 0, B = t.vertices; P < B; ++P) + w = P * 3, S = a[P], z[w] = S.x, z[w + 1] = S.y, z[w + 2] = S.z, f.constructor === Array && ($ = f[P], F = $.r, U = $.g, R = $.b), W[w] = F, W[w + 1] = U, W[w + 2] = R; if (c) for (P = 0, B = t.faceidx / 3; P < B; ++P) { - w = P * 3, T = M[w], R = M[w + 1], z = M[w + 2]; - var N = new _.Vector3(), G = new _.Vector3(), k = new _.Vector3(); - r.intersectionShape.triangle.push(new g.Triangle(N.copy(a[T]), G.copy(a[R]), k.copy(a[z]))); + w = P * 3, T = M[w], R = M[w + 1], $ = M[w + 2]; + var V = new _.Vector3(), N = new _.Vector3(), k = new _.Vector3(); + r.intersectionShape.triangle.push(new p.Triangle(V.copy(a[T]), N.copy(a[R]), k.copy(a[$]))); } if (c) { - var j = new _.Vector3(0, 0, 0), Q = 0; - for (let he = 0; he < n.geometryGroups.length; he++) - j.add(n.geometryGroups[he].getCentroid()), Q++; - j.divideScalar(Q), C.updateBoundingFromPoints(r.boundingSphere, { centroid: j }, $, t.vertices); + var G = new _.Vector3(0, 0, 0), Q = 0; + for (let le = 0; le < n.geometryGroups.length; le++) + G.add(n.geometryGroups[le].getCentroid()), Q++; + G.divideScalar(Q), L.updateBoundingFromPoints(r.boundingSphere, { centroid: G }, z, t.vertices); } if (t.faceArray = new Uint16Array(M), t.truncateArrayBuffers(!0, !0), h.length < t.vertices) t.setNormals(); else { - var ie = t.normalArray = new Float32Array(t.vertices * 3), pe; + var ie = t.normalArray = new Float32Array(t.vertices * 3), ge; for (P = 0, B = t.vertices; P < B; ++P) - w = P * 3, pe = h[P], ie[w] = pe.x, ie[w + 1] = pe.y, ie[w + 2] = pe.z; + w = P * 3, ge = h[P], ie[w] = ge.x, ie[w + 1] = ge.y, ie[w + 2] = ge.z; } t.setLineIndices(), t.lineidx = t.lineArray.length; } @@ -5364,12 +5364,12 @@ ATOM`, h); * @param {ShapeSpec} stylespec */ constructor(r) { - this.color = 16777215, this.hidden = !1, this.wireframe = !1, this.opacity = 1, this.linewidth = 1, this.clickable = !1, this.hoverable = !1, this.side = l.DoubleSide, this.stylespec = r || {}, this.boundingSphere = new g.Sphere(), this.intersectionShape = { + this.color = 16777215, this.hidden = !1, this.wireframe = !1, this.opacity = 1, this.linewidth = 1, this.clickable = !1, this.hoverable = !1, this.side = l.DoubleSide, this.stylespec = r || {}, this.boundingSphere = new p.Sphere(), this.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] - }, C.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new l.Geometry(!0), this.linegeo = new l.Geometry(!0); + }, L.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new l.Geometry(!0), this.linegeo = new l.Geometry(!0); } /** Update shape with new style specification * @param {ShapeSpec} newspec @@ -5381,7 +5381,7 @@ ATOM`, h); updateStyle(r) { for (var n in r) this.stylespec[n] = r[n]; - if (C.updateFromStyle(this, this.stylespec), r.voldata && r.volscheme) { + if (L.updateFromStyle(this, this.stylespec), r.voldata && r.volscheme) { (0, A.adjustVolumeStyle)(r); const b = r.volscheme, f = r.voldata, c = x.CC, t = b.range() || [-1, 1]; this.geo.setColors(function(a, h, M) { @@ -5395,7 +5395,7 @@ ATOM`, h); * @param {CustomShapeSpec} customSpec */ addCustom(r) { - r.vertexArr = r.vertexArr || [], r.faceArr = r.faceArr || [], r.normalArr = r.normalArr || [], C.drawCustom(this, this.geo, r); + r.vertexArr = r.vertexArr || [], r.faceArr = r.faceArr || [], r.normalArr = r.normalArr || [], L.drawCustom(this, this.geo, r); } /** * Creates a sphere shape @@ -5406,11 +5406,11 @@ ATOM`, h); viewer.render(); */ addSphere(r) { - r.center || (r.center = new _.Vector3(0, 0, 0)), r.radius = r.radius ? (0, _.clamp)(r.radius, 0, 1 / 0) : 1.5, r.color = x.CC.color(r.color), this.intersectionShape.sphere.push(new g.Sphere(r.center, r.radius)), E.GLDraw.drawSphere(this.geo, r.center, r.radius, r.color, r.quality), this.components.push({ + r.center || (r.center = new _.Vector3(0, 0, 0)), r.radius = r.radius ? (0, _.clamp)(r.radius, 0, 1 / 0) : 1.5, r.color = x.CC.color(r.color), this.intersectionShape.sphere.push(new p.Sphere(r.center, r.radius)), E.GLDraw.drawSphere(this.geo, r.center, r.radius, r.color, r.quality), this.components.push({ centroid: new _.Vector3(r.center.x, r.center.y, r.center.z) }); var n = this.geo.updateGeoGroup(0); - C.updateBoundingFromPoints(this.boundingSphere, this.components, n.vertexArray, n.vertices); + L.updateBoundingFromPoints(this.boundingSphere, this.components, n.vertexArray, n.vertices); } /** * Creates a box @@ -5453,13 +5453,13 @@ ATOM`, h); var w = 4; h.splice(h.length, 0, a[2], a[3], a[6], a[7]), M.splice(M.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, h.splice(h.length, 0, a[4], a[5], a[0], a[1]), M.splice(M.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, h.splice(h.length, 0, a[6], a[7], a[4], a[5]), M.splice(M.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, h.splice(h.length, 0, a[3], a[1], a[7], a[5]), M.splice(M.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, h.splice(h.length, 0, a[2], a[6], a[0], a[4]), M.splice(M.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4; var S = (0, A.extend)({}, r); - S.vertexArr = h, S.faceArr = M, S.normalArr = [], C.drawCustom(this, this.geo, S); + S.vertexArr = h, S.faceArr = M, S.normalArr = [], L.drawCustom(this, this.geo, S); var T = new _.Vector3(); this.components.push({ centroid: T.addVectors(a[0], a[7]).multiplyScalar(0.5) }); var R = this.geo.updateGeoGroup(0); - C.updateBoundingFromPoints(this.boundingSphere, this.components, R.vertexArray, R.vertices); + L.updateBoundingFromPoints(this.boundingSphere, this.components, R.vertexArray, R.vertices); } /** * Creates a cylinder shape @@ -5495,13 +5495,13 @@ ATOM`, h); var n, b; r.start ? n = new _.Vector3(r.start.x || 0, r.start.y || 0, r.start.z || 0) : n = new _.Vector3(0, 0, 0), r.end ? (b = new _.Vector3(r.end.x, r.end.y || 0, r.end.z || 0), typeof b.x > "u" && (b.x = 3)) : b = new _.Vector3(0, 0, 0); var f = r.radius || 0.1, c = x.CC.color(r.color); - this.intersectionShape.cylinder.push(new g.Cylinder(n, b, f)), E.GLDraw.drawCylinder(this.geo, n, b, f, c, r.fromCap, r.toCap); + this.intersectionShape.cylinder.push(new p.Cylinder(n, b, f)), E.GLDraw.drawCylinder(this.geo, n, b, f, c, r.fromCap, r.toCap); var t = new _.Vector3(); this.components.push({ centroid: t.addVectors(n, b).multiplyScalar(0.5) }); var a = this.geo.updateGeoGroup(0); - C.updateBoundingFromPoints(this.boundingSphere, this.components, a.vertexArray, a.vertices); + L.updateBoundingFromPoints(this.boundingSphere, this.components, a.vertexArray, a.vertices); } /** * Creates a dashed cylinder shape @@ -5514,13 +5514,13 @@ ATOM`, h); var b; r.end ? (b = new _.Vector3(r.end.x, r.end.y || 0, r.end.z || 0), typeof b.x > "u" && (b.x = 3)) : b = new _.Vector3(3, 0, 0); for (var f = r.radius || 0.1, c = x.CC.color(r.color), t = Math.sqrt(Math.pow(n.x - b.x, 2) + Math.pow(n.y - b.y, 2) + Math.pow(n.z - b.z, 2)), a = t / (r.gapLength + r.dashLength), h = new _.Vector3(r.start.x || 0, r.start.y || 0, r.start.z || 0), M = new _.Vector3(r.end.x, r.end.y || 0, r.end.z || 0), w = new _.Vector3((b.x - n.x) / (t / r.gapLength), (b.y - n.y) / (t / r.gapLength), (b.z - n.z) / (t / r.gapLength)), S = new _.Vector3((b.x - n.x) / (t / r.dashLength), (b.y - n.y) / (t / r.dashLength), (b.z - n.z) / (t / r.dashLength)), T = 0; T < a; T++) - M = new _.Vector3(h.x + S.x, h.y + S.y, h.z + S.z), this.intersectionShape.cylinder.push(new g.Cylinder(h, M, f)), E.GLDraw.drawCylinder(this.geo, h, M, f, c, r.fromCap, r.toCap), h = new _.Vector3(M.x + w.x, M.y + w.y, M.z + w.z); + M = new _.Vector3(h.x + S.x, h.y + S.y, h.z + S.z), this.intersectionShape.cylinder.push(new p.Cylinder(h, M, f)), E.GLDraw.drawCylinder(this.geo, h, M, f, c, r.fromCap, r.toCap), h = new _.Vector3(M.x + w.x, M.y + w.y, M.z + w.z); var R = new _.Vector3(); this.components.push({ centroid: R.addVectors(n, b).multiplyScalar(0.5) }); - var z = this.geo.updateGeoGroup(0); - C.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices); + var $ = this.geo.updateGeoGroup(0); + L.updateBoundingFromPoints(this.boundingSphere, this.components, $.vertexArray, $.vertices); } /** * Creates a curved shape @@ -5579,7 +5579,7 @@ ATOM`, h); var w = new _.Vector3(); this.components.push({ centroid: w.addVectors(n, b).multiplyScalar(0.5) - }), f = this.geo.updateGeoGroup(0), C.updateBoundingFromPoints(this.boundingSphere, this.components, f.vertexArray, f.vertices); + }), f = this.geo.updateGeoGroup(0), L.updateBoundingFromPoints(this.boundingSphere, this.components, f.vertexArray, f.vertices); } /** * Creates an arrow shape @@ -5608,20 +5608,20 @@ ATOM`, h); r.end = n; } else r.end ? (r.end = new _.Vector3(r.end.x, r.end.y || 0, r.end.z || 0), typeof r.end.x > "u" && (r.end.x = 3)) : r.end = new _.Vector3(3, 0, 0); - r.radius = r.radius || 0.1, r.radiusRatio = r.radiusRatio || 1.618034, r.mid = 0 < r.mid && r.mid < 1 ? r.mid : 0.618034, C.drawArrow(this, this.geo, r); + r.radius = r.radius || 0.1, r.radiusRatio = r.radiusRatio || 1.618034, r.mid = 0 < r.mid && r.mid < 1 ? r.mid : 0.618034, L.drawArrow(this, this.geo, r); var b = new _.Vector3(); this.components.push({ centroid: b.addVectors(r.start, r.end).multiplyScalar(0.5) }); var f = this.geo.updateGeoGroup(0); - C.updateBoundingFromPoints(this.boundingSphere, this.components, f.vertexArray, f.vertices); + L.updateBoundingFromPoints(this.boundingSphere, this.components, f.vertexArray, f.vertices); } static distance_from(r, n) { return Math.sqrt(Math.pow(r.x - n.x, 2) + Math.pow(r.y - n.y, 2) + Math.pow(r.z - n.z, 2)); } static inSelectedRegion(r, n, b) { for (var f = 0; f < n.length; f++) - if (C.distance_from(n[f], r) <= b) + if (L.distance_from(n[f], r) <= b) return !0; return !1; } @@ -5656,13 +5656,13 @@ ATOM`, h); var f = n.isoval !== void 0 && typeof n.isoval == "number" ? n.isoval : 0, c = !!n.voxel, t = n.smoothness === void 0 ? 1 : n.smoothness, a = r.size.x, h = r.size.y, M = r.size.z, w = new Int16Array(a * h * M), S = r.data, T, R; for (T = 0, R = w.length; T < R; ++T) w[T] = -1; - var z = new Uint8Array(a * h * M); + var $ = new Uint8Array(a * h * M); for (T = 0, R = S.length; T < R; ++T) { var P = f >= 0 ? S[T] - f : f - S[T]; - P > 0 && (z[T] |= C.ISDONE); + P > 0 && ($[T] |= L.ISDONE); } - var B = [], U = []; - o.MarchingCube.march(z, B, U, { + var B = [], F = []; + o.MarchingCube.march($, B, F, { fulltable: !0, voxel: c, unitCube: r.unit, @@ -5671,33 +5671,33 @@ ATOM`, h); nX: a, nY: h, nZ: M - }), !c && t > 0 && o.MarchingCube.laplacianSmooth(t, B, U); - var F = [], $ = [], W = []; + }), !c && t > 0 && o.MarchingCube.laplacianSmooth(t, B, F); + var U = [], z = [], W = []; if (n.selectedRegion && n.coords === void 0 && (n.coords = n.selectedRegion), n.coords !== void 0) { - var N = n.coords[0].x, G = n.coords[0].y, k = n.coords[0].z, j = n.coords[0].x, Q = n.coords[0].y, ie = n.coords[0].z; - for (let oe = 0; oe < n.coords.length; oe++) - n.coords[oe].x > N ? N = n.coords[oe].x : n.coords[oe].x < j && (j = n.coords[oe].x), n.coords[oe].y > G ? G = n.coords[oe].y : n.coords[oe].y < Q && (Q = n.coords[oe].y), n.coords[oe].z > k ? k = n.coords[oe].z : n.coords[oe].z < ie && (ie = n.coords[oe].z); - var pe = 2; - n.radius !== void 0 && (pe = n.radius), n.selectedOffset !== void 0 && (pe = n.selectedOffset), n.seldist !== void 0 && (pe = n.seldist), j -= pe, N += pe, Q -= pe, G += pe, ie -= pe, k += pe; - for (let oe = 0; oe < B.length; oe++) - B[oe].x > j && B[oe].x < N && B[oe].y > Q && B[oe].y < G && B[oe].z > ie && B[oe].z < k && C.inSelectedRegion(B[oe], n.coords, pe) ? (F.push($.length), $.push(B[oe])) : F.push(-1); - for (let oe = 0; oe + 2 < U.length; oe += 3) - F[U[oe]] !== -1 && F[U[oe + 1]] !== -1 && F[U[oe + 2]] !== -1 && (W.push(U[oe] - (U[oe] - F[U[oe]])), W.push(U[oe + 1] - (U[oe + 1] - F[U[oe + 1]])), W.push(U[oe + 2] - (U[oe + 2] - F[U[oe + 2]]))); - B = $, U = W; - } - C.drawCustom(this, this.geo, { + var V = n.coords[0].x, N = n.coords[0].y, k = n.coords[0].z, G = n.coords[0].x, Q = n.coords[0].y, ie = n.coords[0].z; + for (let de = 0; de < n.coords.length; de++) + n.coords[de].x > V ? V = n.coords[de].x : n.coords[de].x < G && (G = n.coords[de].x), n.coords[de].y > N ? N = n.coords[de].y : n.coords[de].y < Q && (Q = n.coords[de].y), n.coords[de].z > k ? k = n.coords[de].z : n.coords[de].z < ie && (ie = n.coords[de].z); + var ge = 2; + n.radius !== void 0 && (ge = n.radius), n.selectedOffset !== void 0 && (ge = n.selectedOffset), n.seldist !== void 0 && (ge = n.seldist), G -= ge, V += ge, Q -= ge, N += ge, ie -= ge, k += ge; + for (let de = 0; de < B.length; de++) + B[de].x > G && B[de].x < V && B[de].y > Q && B[de].y < N && B[de].z > ie && B[de].z < k && L.inSelectedRegion(B[de], n.coords, ge) ? (U.push(z.length), z.push(B[de])) : U.push(-1); + for (let de = 0; de + 2 < F.length; de += 3) + U[F[de]] !== -1 && U[F[de + 1]] !== -1 && U[F[de + 2]] !== -1 && (W.push(F[de] - (F[de] - U[F[de]])), W.push(F[de + 1] - (F[de + 1] - U[F[de + 1]])), W.push(F[de + 2] - (F[de + 2] - U[F[de + 2]]))); + B = z, F = W; + } + L.drawCustom(this, this.geo, { vertexArr: B, - faceArr: U, + faceArr: F, normalArr: [], clickable: n.clickable, hoverable: n.hoverable }), this.updateStyle(n); - var he = new _.Vector3(r.origin.x, r.origin.y, r.origin.z), ue = new _.Vector3(r.size.x * r.unit.x, r.size.y * r.unit.y, r.size.z * r.unit.z), se = new _.Vector3(0, 0, 0), ae = he.clone(), we = he.clone().add(ue); - for (let oe = 0; oe < B.length; oe++) - se.add(B[oe]), ae.max(B[oe]), we.min(B[oe]); - se.divideScalar(B.length); - var xe = se.distanceTo(we), Ie = se.distanceTo(ae); - this.boundingSphere.center = se, this.boundingSphere.radius = Math.max(xe, Ie), typeof b == "function" && b(); + var le = new _.Vector3(r.origin.x, r.origin.y, r.origin.z), oe = new _.Vector3(r.size.x * r.unit.x, r.size.y * r.unit.y, r.size.z * r.unit.z), he = new _.Vector3(0, 0, 0), se = le.clone(), xe = le.clone().add(oe); + for (let de = 0; de < B.length; de++) + he.add(B[de]), se.max(B[de]), xe.min(B[de]); + he.divideScalar(B.length); + var ye = he.distanceTo(xe), Pe = he.distanceTo(se); + this.boundingSphere.center = he, this.boundingSphere.radius = Math.max(ye, Pe), typeof b == "function" && b(); } /** * @deprecated Use addIsosurface instead @@ -5707,11 +5707,11 @@ ATOM`, h); * @param {IsoSurfaceSpec} isoSpec - Volumetric data shape specification */ addVolumetricData(r, n, b) { - r = new p.VolumeData(r, n), this.addIsosurface(r, b); + r = new g.VolumeData(r, n), this.addIsosurface(r, b); } //for internal use, truncate buffers to save memory finalize() { - return C.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.geo; + return L.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.geo; } /* * Initialize webgl objects for rendering @@ -5720,7 +5720,7 @@ ATOM`, h); */ globj(r) { if (this.renderedShapeObj && (r.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { - C.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && C.updateColor(this.geo, this.color), this.shapeObj = new l.Object3D(); + L.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && L.updateColor(this.geo, this.color), this.shapeObj = new l.Object3D(); var n = null; this.side == l.DoubleSide ? n = new l.MeshDoubleLambertMaterial({ wireframe: this.wireframe, @@ -5762,15 +5762,15 @@ ATOM`, h); return this.boundingSphere.center.z; } } - C.ISDONE = 2, C.drawCustom = function(D, r, n) { + L.ISDONE = 2, L.drawCustom = function(D, r, n) { var b = n, f = b.vertexArr, c = b.faceArr; (f.length === 0 || c.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"); var t = n.color; typeof t > "u" && (t = D.color), t = x.CC.color(t); - for (var a = L(b), h = 0, M = a.length; h < M; h++) - C.addCustomGeo(D, r, a[h], a[h].colorArr ? a[h].colorArr : t, n.clickable); + for (var a = C(b), h = 0, M = a.length; h < M; h++) + L.addCustomGeo(D, r, a[h], a[h].colorArr ? a[h].colorArr : t, n.clickable); }; - function L(D) { + function C(D) { var r = 64e3; if (D.vertexArr.length < r) return [D]; @@ -5822,7 +5822,7 @@ ATOM`, h); var l = e( /*! ./WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), _ = e( @@ -5834,7 +5834,7 @@ ATOM`, h); ), o = e( /*! ./Gradient */ "./src/Gradient.ts" - ), p = e( + ), g = e( /*! ./GLModel */ "./src/GLModel.ts" ), E = e( @@ -5846,10 +5846,10 @@ ATOM`, h); ), A = e( /*! ./VolumeData */ "./src/VolumeData.ts" - ), C = e( + ), L = e( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), L = e( + ), C = e( /*! ./VolumetricRender */ "./src/VolumetricRender.ts" ), D = e( @@ -5889,9 +5889,9 @@ ATOM`, h); }), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.padding = "0", this.renderer.domElement.style.position = "absolute", this.renderer.domElement.style.top = "0px", this.renderer.domElement.style.left = "0px", this.renderer.domElement.style.zIndex = "0"; } initializeScene() { - this.scene = new l.Scene(), this.scene.fog = new l.Fog(this.bgColor, 100, 200), this.modelGroup = new l.Object3D(), this.rotationGroup = new l.Object3D(), this.rotationGroup.useQuaternion = !0, this.rotationGroup.quaternion = new g.Quaternion(0, 0, 0, 1), this.rotationGroup.add(this.modelGroup), this.scene.add(this.rotationGroup); + this.scene = new l.Scene(), this.scene.fog = new l.Fog(this.bgColor, 100, 200), this.modelGroup = new l.Object3D(), this.rotationGroup = new l.Object3D(), this.rotationGroup.useQuaternion = !0, this.rotationGroup.quaternion = new p.Quaternion(0, 0, 0, 1), this.rotationGroup.add(this.modelGroup), this.scene.add(this.rotationGroup); var t = new l.Light(16777215); - t.position = new g.Vector3(0.2, 0.2, 1).normalize(), t.intensity = 1, this.scene.add(t); + t.position = new p.Vector3(0.2, 0.2, 1).normalize(), t.intensity = 1, this.scene.add(t); } initContainer(t) { this.container = t, this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.renderer.setSize(this.WIDTH, this.HEIGHT), this.container.append(this.renderer.domElement), this.glDOM = this.renderer.domElement, this.nomouse || (this.glDOM.addEventListener("mousedown", this._handleMouseDown.bind(this), { passive: !1 }), this.glDOM.addEventListener("touchstart", this._handleMouseDown.bind(this), { passive: !1 }), this.glDOM.addEventListener("wheel", this._handleMouseScroll.bind(this), { passive: !1 }), this.glDOM.addEventListener("mousemove", this._handleMouseMove.bind(this), { passive: !1 }), this.glDOM.addEventListener("touchmove", this._handleMouseMove.bind(this), { passive: !1 }), this.glDOM.addEventListener("contextmenu", this._handleContextMenu.bind(this), { passive: !1 })); @@ -6015,8 +6015,8 @@ ATOM`, h); //for grid viewers, return true if point is in this viewer isInViewer(t, a) { if (this.viewers != null) { - var h = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, w = this.canvasOffset(), S = t - w.left, T = a - w.top, R = this.rows - Math.floor(T / M) - 1, z = Math.floor(S / h); - if (R != this.row || z != this.col) + var h = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, w = this.canvasOffset(), S = t - w.left, T = a - w.top, R = this.rows - Math.floor(T / M) - 1, $ = Math.floor(S / h); + if (R != this.row || $ != this.col) return !1; } return !0; @@ -6043,20 +6043,20 @@ ATOM`, h); return t.clone(); let M = t.x * a.x + t.y * a.y + t.z * a.z + t.w * a.w; if (M > 0.9995) { - let B = new g.Quaternion(t.x + h * (a.x - t.x), t.y + h * (a.y - t.y), t.z + h * (a.z - t.z), t.w + h * (a.w - t.w)); + let B = new p.Quaternion(t.x + h * (a.x - t.x), t.y + h * (a.y - t.y), t.z + h * (a.z - t.z), t.w + h * (a.w - t.w)); return B.normalize(), B; } M < 0 && (a = a.clone().multiplyScalar(-1), M = -M), M > 1 ? M = 1 : M < -1 && (M = -1); var w = Math.acos(M), S = w * h, T = a.clone(); T.sub(t.clone().multiplyScalar(M)), T.normalize(); - var R = Math.cos(S), z = Math.sin(S), P = new g.Quaternion(t.x * R + T.x * z, t.y * R + T.y * z, t.z * R + T.z * z, t.w * R + T.w * z); + var R = Math.cos(S), $ = Math.sin(S), P = new p.Quaternion(t.x * R + T.x * $, t.y * R + T.y * $, t.z * R + T.z * $, t.w * R + T.w * $); return P.normalize(), P; } /* @param {Object} element HTML element within which to create viewer * @param {ViewerSpec} config Object containing optional configuration for the viewer */ constructor(t, a = {}) { - this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledAtoms = [], this.current_hover = null, this.hoverDuration = 500, this.viewer_frame = 0, this.viewChangeCallback = null, this.stateChangeCallback = null, this.NEAR = 1, this.FAR = 800, this.CAMERA_Z = 150, this.fov = 20, this.linkedViewers = [], this.renderer = null, this.control_all = !1, this.scene = null, this.rotationGroup = null, this.modelGroup = null, this.fogStart = 0.4, this.slabNear = -50, this.slabFar = 50, this.cq = new g.Quaternion(0, 0, 0, 1), this.dq = new g.Quaternion(0, 0, 0, 1), this.animated = 0, this.animationTimers = /* @__PURE__ */ new Set(), this.isDragging = !1, this.mouseStartX = 0, this.mouseStartY = 0, this.touchDistanceStart = 0, this.touchHold = !1, this.currentModelPos = 0, this.cz = 0, this.cslabNear = 0, this.cslabFar = 0, this.userContextMenuHandler = null, this.config = a, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = _.elementColors.defaultColors), this.nomouse = this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = _.CC.color(this.config.backgroundColor).getHex()), this.config.backgroundAlpha = this.config.backgroundAlpha == null ? 1 : this.config.backgroundAlpha, this.camerax = 0, typeof this.config.camerax < "u" && (this.camerax = parseFloat(this.config.camerax)), this._viewer = this, this.container = t, this.config.hoverDuration != null && (this.hoverDuration = this.config.hoverDuration), this.config.antialias === void 0 && (this.config.antialias = !0), this.config.cartoonQuality === void 0 && (this.config.cartoonQuality = 10), this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.setupRenderer(), this.row = this.config.row == null ? 0 : this.config.row, this.col = this.config.col == null ? 0 : this.config.col, this.cols = this.config.cols, this.rows = this.config.rows, this.viewers = this.config.viewers, this.control_all = this.config.control_all, this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.camera = new l.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new g.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new g.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new l.Raycaster(new g.Vector3(0, 0, 0), new g.Vector3(0, 0, 0)), this.projector = new l.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = _.CC.color(this.bgColor), document.body.addEventListener("mouseup", this._handleMouseUp.bind(this)), document.body.addEventListener("touchend", this._handleMouseUp.bind(this)), this.initContainer(this.container), this.config.style && this.setViewStyle(this.config), window.addEventListener("resize", this.resize.bind(this)), typeof window.ResizeObserver < "u" && (this.divwatcher = new window.ResizeObserver(this.resize.bind(this)), this.divwatcher.observe(this.container)); + this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledAtoms = [], this.current_hover = null, this.hoverDuration = 500, this.viewer_frame = 0, this.viewChangeCallback = null, this.stateChangeCallback = null, this.NEAR = 1, this.FAR = 800, this.CAMERA_Z = 150, this.fov = 20, this.linkedViewers = [], this.renderer = null, this.control_all = !1, this.scene = null, this.rotationGroup = null, this.modelGroup = null, this.fogStart = 0.4, this.slabNear = -50, this.slabFar = 50, this.cq = new p.Quaternion(0, 0, 0, 1), this.dq = new p.Quaternion(0, 0, 0, 1), this.animated = 0, this.animationTimers = /* @__PURE__ */ new Set(), this.isDragging = !1, this.mouseStartX = 0, this.mouseStartY = 0, this.touchDistanceStart = 0, this.touchHold = !1, this.currentModelPos = 0, this.cz = 0, this.cslabNear = 0, this.cslabFar = 0, this.userContextMenuHandler = null, this.config = a, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = _.elementColors.defaultColors), this.nomouse = this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = _.CC.color(this.config.backgroundColor).getHex()), this.config.backgroundAlpha = this.config.backgroundAlpha == null ? 1 : this.config.backgroundAlpha, this.camerax = 0, typeof this.config.camerax < "u" && (this.camerax = parseFloat(this.config.camerax)), this._viewer = this, this.container = t, this.config.hoverDuration != null && (this.hoverDuration = this.config.hoverDuration), this.config.antialias === void 0 && (this.config.antialias = !0), this.config.cartoonQuality === void 0 && (this.config.cartoonQuality = 10), this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.setupRenderer(), this.row = this.config.row == null ? 0 : this.config.row, this.col = this.config.col == null ? 0 : this.config.col, this.cols = this.config.cols, this.rows = this.config.rows, this.viewers = this.config.viewers, this.control_all = this.config.control_all, this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.camera = new l.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new p.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new p.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new l.Raycaster(new p.Vector3(0, 0, 0), new p.Vector3(0, 0, 0)), this.projector = new l.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = _.CC.color(this.bgColor), document.body.addEventListener("mouseup", this._handleMouseUp.bind(this)), document.body.addEventListener("touchend", this._handleMouseUp.bind(this)), this.initContainer(this.container), this.config.style && this.setViewStyle(this.config), window.addEventListener("resize", this.resize.bind(this)), typeof window.ResizeObserver < "u" && (this.divwatcher = new window.ResizeObserver(this.resize.bind(this)), this.divwatcher.observe(this.container)); try { typeof this.callback == "function" && this.callback(this); } catch (h) { @@ -6085,13 +6085,13 @@ ATOM`, h); modelToScreen(t) { let a = !1; Array.isArray(t) || (t = [t], a = !0); - let h = this.renderer.getXRatio(), M = this.renderer.getYRatio(), w = this.col, S = this.row, T = w * (this.WIDTH / h), R = (M - S - 1) * (this.HEIGHT / M), z = [], P = this.canvasOffset(); + let h = this.renderer.getXRatio(), M = this.renderer.getYRatio(), w = this.col, S = this.row, T = w * (this.WIDTH / h), R = (M - S - 1) * (this.HEIGHT / M), $ = [], P = this.canvasOffset(); return t.forEach((B) => { - let U = new g.Vector3(B.x, B.y, B.z); - U.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(U, this.camera); - let F = this.WIDTH / h * (U.x + 1) / 2 + P.left + T, $ = -(this.HEIGHT / M) * (U.y - 1) / 2 + P.top + R; - z.push({ x: F, y: $ }); - }), a && (z = z[0]), z; + let F = new p.Vector3(B.x, B.y, B.z); + F.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(F, this.camera); + let U = this.WIDTH / h * (F.x + 1) / 2 + P.left + T, z = -(this.HEIGHT / M) * (F.y - 1) / 2 + P.top + R; + $.push({ x: U, y: z }); + }), a && ($ = $[0]), $; } /** * For a given screen (x,y) displacement return model displacement @@ -6100,7 +6100,7 @@ ATOM`, h); * @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis */ screenOffsetToModel(t, a, h) { - var M = t / this.WIDTH, w = a / this.HEIGHT, S = h === void 0 ? this.rotationGroup.position.z : h, T = this.rotationGroup.quaternion, R = new g.Vector3(0, 0, S); + var M = t / this.WIDTH, w = a / this.HEIGHT, S = h === void 0 ? this.rotationGroup.position.z : h, T = this.rotationGroup.quaternion, R = new p.Vector3(0, 0, S); return this.projector.projectVector(R, this.camera), R.x += M * 2, R.y -= w * 2, this.projector.unprojectVector(R, this.camera), R.z = 0, R.applyQuaternion(T), R; } /** @@ -6110,11 +6110,11 @@ ATOM`, h); * @param{model} xyz model coordinate */ screenToModelDistance(t, a) { - let h = this.canvasOffset(), M = new g.Vector3(a.x, a.y, a.z); + let h = this.canvasOffset(), M = new p.Vector3(a.x, a.y, a.z); M.applyMatrix4(this.modelGroup.matrixWorld); let w = M.clone(); this.projector.projectVector(M, this.camera); - let S = new g.Vector3((t.x - h.left) * 2 / this.WIDTH - 1, (t.y - h.top) * 2 / -this.HEIGHT + 1, M.z); + let S = new p.Vector3((t.x - h.left) * 2 / this.WIDTH - 1, (t.y - h.top) * 2 / -this.HEIGHT + 1, M.z); return this.projector.unprojectVector(S, this.camera), S.distanceTo(w); } /** @@ -6164,7 +6164,7 @@ ATOM`, h); this.clear(); var a = t.models; for (let h = 0; h < a.length; h++) - a[h] && (this.models[h] = new p.GLModel(h), this.models[h].setInternalState(a[h])); + a[h] && (this.models[h] = new g.GLModel(h), this.models[h].setInternalState(a[h])); this.render(); } /** @@ -6257,20 +6257,20 @@ ATOM`, h); return t = t || 1, new Promise(function(h) { let M = 0, w = a.viewChangeCallback, S = [], T = [], R = Date.now(); a.viewChangeCallback = function() { - T.push(Date.now() - R), R = Date.now(), S.push(new Promise((z) => { + T.push(Date.now() - R), R = Date.now(), S.push(new Promise(($) => { a.getCanvas().toBlob(function(P) { - P.arrayBuffer().then(z); + P.arrayBuffer().then($); }, "image/png"); - })), M += 1, M == t && (a.viewChangeCallback = w, Promise.all(S).then((z) => { + })), M += 1, M == t && (a.viewChangeCallback = w, Promise.all(S).then(($) => { let P = []; - for (let N = 0; N < z.length; N++) { - let G = (0, D.decode)(z[N]); - P.push((0, D.toRGBA8)(G)[0]); + for (let V = 0; V < $.length; V++) { + let N = (0, D.decode)($[V]); + P.push((0, D.toRGBA8)(N)[0]); } - let B = a.getCanvas().width, U = a.getCanvas().height, F = (0, D.encode)(P, B, U, 0, T), $ = new Blob([F], { type: "image/png" }), W = new FileReader(); - W.onload = function(N) { - h(N.target.result); - }, W.readAsDataURL($); + let B = a.getCanvas().width, F = a.getCanvas().height, U = (0, D.encode)(P, B, F, 0, T), z = new Blob([U], { type: "image/png" }), W = new FileReader(); + W.onload = function(V) { + h(V.target.result); + }, W.readAsDataURL(z); })); }; }); @@ -6299,7 +6299,7 @@ ATOM`, h); this.hoverDuration = t; } mouseXY(t, a) { - let h = this.canvasOffset(), M = this.renderer.getXRatio(), w = this.renderer.getYRatio(), S = this.col, T = this.row, R = S * (this.WIDTH / M), z = (w - T - 1) * (this.HEIGHT / w), P = (t - h.left - R) / (this.WIDTH / M) * 2 - 1, B = -((a - h.top - z) / (this.HEIGHT / w)) * 2 + 1; + let h = this.canvasOffset(), M = this.renderer.getXRatio(), w = this.renderer.getYRatio(), S = this.col, T = this.row, R = S * (this.WIDTH / M), $ = (w - T - 1) * (this.HEIGHT / w), P = (t - h.left - R) / (this.WIDTH / M) * 2 - 1, B = -((a - h.top - $) / (this.HEIGHT / w)) * 2 + 1; return { x: P, y: B }; } _handleMouseMove(t) { @@ -6313,24 +6313,24 @@ ATOM`, h); if (!(!this.control_all && !this.isInViewer(a, h)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() { T.handleHoverSelection(S.x, S.y, t); }, this.hoverDuration)), !!this.isDragging)) { - var z = (a - this.mouseStartX) / this.WIDTH, P = (h - this.mouseStartY) / this.HEIGHT; + var $ = (a - this.mouseStartX) / this.WIDTH, P = (h - this.mouseStartY) / this.HEIGHT; if (this.touchDistanceStart != 0 && t.targetTouches && t.targetTouches.length == 2) { var B = this.calcTouchDistance(t); R = 2, P = (B - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); } else t.targetTouches && t.targetTouches.length == 3 && (R = 1); - z *= M, P *= w; - var U = Math.hypot(z, P), F; + $ *= M, P *= w; + var F = Math.hypot($, P), U; if (R == 3 || this.mouseButton == 3 && t.ctrlKey) - this.slabNear = this.cslabNear + z * 100, this.slabFar = this.cslabFar - P * 100; + this.slabNear = this.cslabNear + $ * 100, this.slabFar = this.cslabFar - P * 100; else if (R == 2 || this.mouseButton == 3 || t.shiftKey) - F = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, F < 80 && (F = 80), this.rotationGroup.position.z = this.cz + P * F, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z); + U = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, U < 80 && (U = 80), this.rotationGroup.position.z = this.cz + P * U, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z); else if (R == 1 || this.mouseButton == 2 || t.ctrlKey) { - var $ = this.screenOffsetToModel(M * (a - this.mouseStartX), w * (h - this.mouseStartY)); - this.modelGroup.position.addVectors(this.currentModelPos, $); - } else if ((R === 0 || this.mouseButton == 1) && U !== 0) { - var W = Math.sin(U * Math.PI) / U; - this.dq.x = Math.cos(U * Math.PI), this.dq.y = 0, this.dq.z = W * z, this.dq.w = -W * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); + var z = this.screenOffsetToModel(M * (a - this.mouseStartX), w * (h - this.mouseStartY)); + this.modelGroup.position.addVectors(this.currentModelPos, z); + } else if ((R === 0 || this.mouseButton == 1) && F !== 0) { + var W = Math.sin(F * Math.PI) / F; + this.dq.x = Math.cos(F * Math.PI), this.dq.y = 0, this.dq.z = W * $, this.dq.w = -W * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); } this.show(); } @@ -6340,7 +6340,7 @@ ATOM`, h); var a = this.getX(t), h = this.getY(t); if (!(a != this.mouseStartX || h != this.mouseStartY)) { var S = this.mouseStartX, T = this.mouseStartY, w = this.canvasOffset(); - let R = this.mouseXY(S, T), z = R.x, P = R.y, B = this.targetedObjects(z, P, this.contextMenuEnabledAtoms); + let R = this.mouseXY(S, T), $ = R.x, P = R.y, B = this.targetedObjects($, P, this.contextMenuEnabledAtoms); var M = null; B.length && (M = B[0].clickable); var w = this.canvasOffset(), S = this.mouseStartX - w.left, T = this.mouseStartY - w.top; @@ -6486,7 +6486,7 @@ ATOM`, h); }); */ getModel(t) { - return t === void 0 ? this.models.length == 0 ? null : this.models[this.models.length - 1] : t instanceof p.GLModel ? t : t in this.models ? this.models[t] : this.models.length == 0 ? null : this.models[this.models.length - 1]; + return t === void 0 ? this.models.length == 0 ? null : this.models[this.models.length - 1] : t instanceof g.GLModel ? t : t in this.models ? this.models[t] : this.models.length == 0 ? null : this.models[this.models.length - 1]; } /** * Continuously rotate a scene around the specified axis. @@ -6524,33 +6524,33 @@ ATOM`, h); animateMotion(t, a, h, M, w, S) { var T = 20, R = Math.ceil(t / T); R < 1 && (R = 1), this.incAnim(); - var z = { + var $ = { mpos: this.modelGroup.position.clone(), rz: this.rotationGroup.position.z, rot: this.rotationGroup.quaternion.clone(), cam: this.lookingAt.clone() }; if (a) { - let U = new Array(R); - for (let N = 0; N < R; N++) { - let G = (N + 1) / R, k = { mpos: z.mpos, rz: z.rz, rot: z.rot }; - k.mpos = h.clone().sub(z.mpos).multiplyScalar(G).add(z.mpos), k.rz = z.rz + G * (M - z.rz), k.rot = r.slerp(z.rot, w, G), k.cam = S.clone().sub(z.cam).multiplyScalar(G).add(z.cam), U[N] = k; + let F = new Array(R); + for (let V = 0; V < R; V++) { + let N = (V + 1) / R, k = { mpos: $.mpos, rz: $.rz, rot: $.rot }; + k.mpos = h.clone().sub($.mpos).multiplyScalar(N).add($.mpos), k.rz = $.rz + N * (M - $.rz), k.rot = r.slerp($.rot, w, N), k.cam = S.clone().sub($.cam).multiplyScalar(N).add($.cam), F[V] = k; } - let F = 0, $ = this, W = function() { - var N = U[F]; - F += 1, $.modelGroup.position = N.mpos, $.rotationGroup.position.z = N.rz, $.rotationGroup.quaternion = N.rot, $.camera.lookAt(N.cam), F < U.length ? setTimeout(W, T) : $.decAnim(), $.show(); + let U = 0, z = this, W = function() { + var V = F[U]; + U += 1, z.modelGroup.position = V.mpos, z.rotationGroup.position.z = V.rz, z.rotationGroup.quaternion = V.rot, z.camera.lookAt(V.cam), U < F.length ? setTimeout(W, T) : z.decAnim(), z.show(); }; setTimeout(W, T); } else { var P = {}; - let U = 1 / R; - if (h && (P.mpos = h.clone().sub(z.mpos).multiplyScalar(U)), typeof M < "u" && M != null && (P.rz = U * (M - z.rz)), w) { - var B = r.slerp(z.rot, w, U); - P.rot = z.rot.clone().inverse().multiply(B); + let F = 1 / R; + if (h && (P.mpos = h.clone().sub($.mpos).multiplyScalar(F)), typeof M < "u" && M != null && (P.rz = F * (M - $.rz)), w) { + var B = r.slerp($.rot, w, F); + P.rot = $.rot.clone().inverse().multiply(B); } - S && (P.cam = S.clone().sub(z.cam).multiplyScalar(U)); - let F = 0, $ = this, W = function() { - F += 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)), F < R ? setTimeout(W, T) : $.decAnim(), $.show(); + S && (P.cam = S.clone().sub($.cam).multiplyScalar(F)); + let U = 0, z = this, W = function() { + U += 1, P.mpos && z.modelGroup.position.add(P.mpos), P.rz && (z.rotationGroup.position.z += P.rz), P.rot && z.rotationGroup.quaternion.multiply(P.rot), P.cam && (z.lookingAt.add(P.cam), z.camera.lookAt(z.lookingAt)), U < R ? setTimeout(W, T) : z.decAnim(), z.show(); }; setTimeout(W, T); } @@ -6580,16 +6580,16 @@ ATOM`, h); */ rotate(t, a = "y", h = 0, M = !1) { if (a == "x" ? a = { x: 1, y: 0, z: 0 } : a == "y" ? a = { x: 0, y: 1, z: 0 } : a == "z" && (a = { x: 0, y: 0, z: 1 }), a == "vx" ? a = { vx: 1, vy: 0, vz: 0 } : a == "vy" ? a = { vx: 0, vy: 1, vz: 0 } : a == "vz" && (a = { vx: 0, vy: 0, vz: 1 }), typeof a.vx < "u") { - var w = new g.Vector3(a.vx, a.vy, a.vz); + var w = new p.Vector3(a.vx, a.vy, a.vz); w.applyQuaternion(this.rotationGroup.quaternion), a = { x: w.x, y: w.y, z: w.z }; } var S = function(P) { - var B = Math.sin(P / 2), U = Math.cos(P / 2), F = 0, $ = 0, W = 0; - return F = a.x * B, $ = a.y * B, W = a.z * B, new g.Quaternion(F, $, W, U).normalize(); + var B = Math.sin(P / 2), F = Math.cos(P / 2), U = 0, z = 0, W = 0; + return U = a.x * B, z = a.y * B, W = a.z * B, new p.Quaternion(U, z, W, F).normalize(); }, T = Math.PI * t / 180, R = S(T); if (h) { - var z = new g.Quaternion().copy(this.rotationGroup.quaternion).multiply(R); - this.animateMotion(h, M, this.modelGroup.position, this.rotationGroup.position.z, z, this.lookingAt); + var $ = new p.Quaternion().copy(this.rotationGroup.quaternion).multiply(R); + this.animateMotion(h, M, this.modelGroup.position, this.rotationGroup.position.z, $, this.lookingAt); } else this.rotationGroup.quaternion.multiply(R), this.show(); return this; @@ -6652,10 +6652,10 @@ ATOM`, h); T.verticesNeedUpdate = !0, T.elementsNeedUpdate = !0, T.normalsNeedUpdate = !0, T.colorsNeedUpdate = !0, T.buffersNeedUpdate = !0, T.boundingSphere = null, S[w].mat.needsUpdate = !0, S[w].done && (S[w].finished = !0), S[w].lastGL && this.modelGroup.remove(S[w].lastGL); var R = null; if (S[w].mat instanceof l.LineBasicMaterial ? R = new l.Line(T, S[w].mat) : R = new l.Mesh(T, S[w].mat), S[w].mat.transparent && S[w].mat.opacity == 0 ? R.visible = !1 : R.visible = !0, S[w].symmetries.length > 1 || S[w].symmetries.length == 1 && !S[w].symmetries[w].isIdentity()) { - var z, P = new l.Object3D(); - for (z = 0; z < S[w].symmetries.length; z++) { + var $, P = new l.Object3D(); + for ($ = 0; $ < S[w].symmetries.length; $++) { var B = R.clone(); - B.matrix = S[w].symmetries[z], B.matrixAutoUpdate = !1, P.add(B); + B.matrix = S[w].symmetries[$], B.matrixAutoUpdate = !1, P.add(B); } S[w].lastGL = P, this.modelGroup.add(P); } else @@ -6797,7 +6797,7 @@ ATOM`, h); }); */ translate(t, a, h = 0, M = !1) { - var w = t / this.WIDTH, S = a / this.HEIGHT, T = new g.Vector3(0, 0, -this.CAMERA_Z); + var w = t / this.WIDTH, S = a / this.HEIGHT, T = new p.Vector3(0, 0, -this.CAMERA_Z); this.projector.projectVector(T, this.camera), T.x -= w, T.y -= S, this.projector.unprojectVector(T, this.camera), T.z = 0; var R = this.lookingAt.clone().add(T); return h > 0 ? this.animateMotion(h, M, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, R) : (this.lookingAt = R, this.camera.lookAt(this.lookingAt), this.show()), this; @@ -6865,22 +6865,22 @@ ATOM`, h); */ center(t = {}, a = 0, h = !1) { var M, w, S = this.getAtomsFromSel(t), T = (0, x.getExtent)(S); - (0, x.isEmptyObject)(t) ? (this.shapes.forEach((G) => { - if (G && G.boundingSphere && G.boundingSphere.center) { - var k = G.boundingSphere.center, j = G.boundingSphere.radius; - j > 0 ? (S.push(new g.Vector3(k.x + j, k.y, k.z)), S.push(new g.Vector3(k.x - j, k.y, k.z)), S.push(new g.Vector3(k.x, k.y + j, k.z)), S.push(new g.Vector3(k.x, k.y - j, k.z)), S.push(new g.Vector3(k.x, k.y, k.z + j)), S.push(new g.Vector3(k.x, k.y, k.z - j))) : S.push(k); + (0, x.isEmptyObject)(t) ? (this.shapes.forEach((N) => { + if (N && N.boundingSphere && N.boundingSphere.center) { + var k = N.boundingSphere.center, G = N.boundingSphere.radius; + G > 0 ? (S.push(new p.Vector3(k.x + G, k.y, k.z)), S.push(new p.Vector3(k.x - G, k.y, k.z)), S.push(new p.Vector3(k.x, k.y + G, k.z)), S.push(new p.Vector3(k.x, k.y - G, k.z)), S.push(new p.Vector3(k.x, k.y, k.z + G)), S.push(new p.Vector3(k.x, k.y, k.z - G))) : S.push(k); } }), T = (0, x.getExtent)(S), M = S, w = T) : (M = this.getAtomsFromSel({}), w = (0, x.getExtent)(M)); - var R = new g.Vector3(T[2][0], T[2][1], T[2][2]), z = w[1][0] - w[0][0], P = w[1][1] - w[0][1], B = w[1][2] - w[0][2], U = Math.hypot(z, P, B); - U < 5 && (U = 5), this.slabNear = -U / 1.9, this.slabFar = U / 2, z = T[1][0] - T[0][0], P = T[1][1] - T[0][1], B = T[1][2] - T[0][2], U = Math.hypot(z, P, B), U < 5 && (U = 5); - for (var F = 25, $ = 0; $ < S.length; $++) - if (S[$]) { - var W = R.distanceToSquared(S[$]); - W > F && (F = W); + var R = new p.Vector3(T[2][0], T[2][1], T[2][2]), $ = w[1][0] - w[0][0], P = w[1][1] - w[0][1], B = w[1][2] - w[0][2], F = Math.hypot($, P, B); + F < 5 && (F = 5), this.slabNear = -F / 1.9, this.slabFar = F / 2, $ = T[1][0] - T[0][0], P = T[1][1] - T[0][1], B = T[1][2] - T[0][2], F = Math.hypot($, P, B), F < 5 && (F = 5); + for (var U = 25, z = 0; z < S.length; z++) + if (S[z]) { + var W = R.distanceToSquared(S[z]); + W > U && (U = W); } - U = Math.sqrt(F) * 2; - var N = R.clone().multiplyScalar(-1); - return a > 0 ? this.animateMotion(a, h, N, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = N, this.show()), this; + F = Math.sqrt(U) * 2; + var V = R.clone().multiplyScalar(-1); + return a > 0 ? this.animateMotion(a, h, V, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = V, this.show()), this; } /** * Zoom to center of atom selection. The slab will be set appropriately for @@ -6915,35 +6915,35 @@ ATOM`, h); let M = this.getAtomsFromSel(t), w = (0, x.getExtent)(M), S = w; if ((0, x.isEmptyObject)(t)) { let k = M && M.length; - if (this.shapes.forEach((j) => { - if (j && j.boundingSphere) { - if (j.boundingSphere.box) { - let pe = j.boundingSphere.box; - M.push(new g.Vector3(pe.min.x, pe.min.y, pe.min.z)), M.push(new g.Vector3(pe.max.x, pe.max.y, pe.max.z)); - } else if (j.boundingSphere.center) { - var Q = j.boundingSphere.center, ie = j.boundingSphere.radius; - ie > 0 ? (M.push(new g.Vector3(Q.x + ie, Q.y, Q.z)), M.push(new g.Vector3(Q.x - ie, Q.y, Q.z)), M.push(new g.Vector3(Q.x, Q.y + ie, Q.z)), M.push(new g.Vector3(Q.x, Q.y - ie, Q.z)), M.push(new g.Vector3(Q.x, Q.y, Q.z + ie)), M.push(new g.Vector3(Q.x, Q.y, Q.z - ie))) : M.push(Q); + if (this.shapes.forEach((G) => { + if (G && G.boundingSphere) { + if (G.boundingSphere.box) { + let ge = G.boundingSphere.box; + M.push(new p.Vector3(ge.min.x, ge.min.y, ge.min.z)), M.push(new p.Vector3(ge.max.x, ge.max.y, ge.max.z)); + } else if (G.boundingSphere.center) { + var Q = G.boundingSphere.center, ie = G.boundingSphere.radius; + ie > 0 ? (M.push(new p.Vector3(Q.x + ie, Q.y, Q.z)), M.push(new p.Vector3(Q.x - ie, Q.y, Q.z)), M.push(new p.Vector3(Q.x, Q.y + ie, Q.z)), M.push(new p.Vector3(Q.x, Q.y - ie, Q.z)), M.push(new p.Vector3(Q.x, Q.y, Q.z + ie)), M.push(new p.Vector3(Q.x, Q.y, Q.z - ie))) : M.push(Q); } } }), S = (0, x.getExtent)(M), !k) - for (let j = 0; j < 3; j++) - w[2][j] = (S[0][j] + S[1][j]) / 2; + for (let G = 0; G < 3; G++) + w[2][G] = (S[0][G] + S[1][G]) / 2; } else { let k = this.getAtomsFromSel({}); S = (0, x.getExtent)(k); } - var T = new g.Vector3(w[2][0], w[2][1], w[2][2]), R = S[1][0] - S[0][0], z = S[1][1] - S[0][1], P = S[1][2] - S[0][2], B = Math.hypot(R, z, P); + var T = new p.Vector3(w[2][0], w[2][1], w[2][2]), R = S[1][0] - S[0][0], $ = S[1][1] - S[0][1], P = S[1][2] - S[0][2], B = Math.hypot(R, $, P); B < 5 && (B = 5), this.slabNear = -B / 1.9, this.slabFar = B / 2, Object.keys(t).length === 0 && (this.slabNear = Math.min(-B * 2, -50), this.slabFar = Math.max(B * 2, 50)); - var U = this.config.minimumZoomToDistance || 5; - R = w[1][0] - w[0][0], z = w[1][1] - w[0][1], P = w[1][2] - w[0][2], B = Math.hypot(R, z, P), B < U && (B = U); - for (var F = U * U, $ = 0; $ < M.length; $++) - if (M[$]) { - var W = T.distanceToSquared(M[$]); - W > F && (F = W); + var F = this.config.minimumZoomToDistance || 5; + R = w[1][0] - w[0][0], $ = w[1][1] - w[0][1], P = w[1][2] - w[0][2], B = Math.hypot(R, $, P), B < F && (B = F); + for (var U = F * F, z = 0; z < M.length; z++) + if (M[z]) { + var W = T.distanceToSquared(M[z]); + W > U && (U = W); } - B = Math.sqrt(F) * 2; - var N = T.clone().multiplyScalar(-1), G = -(B * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); - return G = this.adjustZoomToLimits(G), a > 0 ? this.animateMotion(a, h, N, G, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = N, this.rotationGroup.position.z = G, this.show()), this; + B = Math.sqrt(U) * 2; + var V = T.clone().multiplyScalar(-1), N = -(B * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); + return N = this.adjustZoomToLimits(N), a > 0 ? this.animateMotion(a, h, V, N, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = V, this.rotationGroup.position.z = N, this.show()), this; } /** * Set slab of view (contents outside of slab are clipped). @@ -7341,61 +7341,61 @@ ATOM`, h); if (h.matrix) M = h.matrix; else { - var w = h.a, S = h.b, T = h.c, R = h.alpha, z = h.beta, P = h.gamma; - R = R * Math.PI / 180, z = z * Math.PI / 180, P = P * Math.PI / 180; - var B, U, F; - B = Math.cos(z), U = (Math.cos(R) - Math.cos(z) * Math.cos(P)) / Math.sin(P), F = Math.sqrt(Math.max(0, 1 - B * B - U * U)), M = new g.Matrix3(w, S * Math.cos(P), T * B, 0, S * Math.sin(P), T * U, 0, 0, T * F); + var w = h.a, S = h.b, T = h.c, R = h.alpha, $ = h.beta, P = h.gamma; + R = R * Math.PI / 180, $ = $ * Math.PI / 180, P = P * Math.PI / 180; + var B, F, U; + B = Math.cos($), F = (Math.cos(R) - Math.cos($) * Math.cos(P)) / Math.sin(P), U = Math.sqrt(Math.max(0, 1 - B * B - F * F)), M = new p.Matrix3(w, S * Math.cos(P), T * B, 0, S * Math.sin(P), T * F, 0, 0, T * U); } - var $ = [ - new g.Vector3(0, 0, 0), - new g.Vector3(1, 0, 0), - new g.Vector3(0, 1, 0), - new g.Vector3(0, 0, 1), - new g.Vector3(1, 1, 0), - new g.Vector3(0, 1, 1), - new g.Vector3(1, 0, 1), - new g.Vector3(1, 1, 1) + var z = [ + new p.Vector3(0, 0, 0), + new p.Vector3(1, 0, 0), + new p.Vector3(0, 1, 0), + new p.Vector3(0, 0, 1), + new p.Vector3(1, 1, 0), + new p.Vector3(0, 1, 1), + new p.Vector3(1, 0, 1), + new p.Vector3(1, 1, 1) ]; if (h.matrix4) - for (let N = 0; N < $.length; N++) - h.size && $[N].multiplyVectors($[N], h.size), $[N] = $[N].applyMatrix4(h.matrix4); + for (let V = 0; V < z.length; V++) + h.size && z[V].multiplyVectors(z[V], h.size), z[V] = z[V].applyMatrix4(h.matrix4); else - for (let N = 0; N < $.length; N++) - $[N] = $[N].applyMatrix3(M); + for (let V = 0; V < z.length; V++) + z[V] = z[V].applyMatrix3(M); if (a.box && !a.box.hidden) { a.box.wireframe = !0; var W = new u.GLShape(a.box); - W.shapePosition = this.shapes.length, W.addLine({ start: $[0], end: $[1] }), W.addLine({ start: $[0], end: $[2] }), W.addLine({ start: $[1], end: $[4] }), W.addLine({ start: $[2], end: $[4] }), W.addLine({ start: $[0], end: $[3] }), W.addLine({ start: $[3], end: $[5] }), W.addLine({ start: $[2], end: $[5] }), W.addLine({ start: $[1], end: $[6] }), W.addLine({ start: $[4], end: $[7] }), W.addLine({ start: $[6], end: $[7] }), W.addLine({ start: $[3], end: $[6] }), W.addLine({ start: $[5], end: $[7] }), this.shapes.push(W), t.unitCellObjects.shapes.push(W), W.finalize(); + W.shapePosition = this.shapes.length, W.addLine({ start: z[0], end: z[1] }), W.addLine({ start: z[0], end: z[2] }), W.addLine({ start: z[1], end: z[4] }), W.addLine({ start: z[2], end: z[4] }), W.addLine({ start: z[0], end: z[3] }), W.addLine({ start: z[3], end: z[5] }), W.addLine({ start: z[2], end: z[5] }), W.addLine({ start: z[1], end: z[6] }), W.addLine({ start: z[4], end: z[7] }), W.addLine({ start: z[6], end: z[7] }), W.addLine({ start: z[3], end: z[6] }), W.addLine({ start: z[5], end: z[7] }), this.shapes.push(W), t.unitCellObjects.shapes.push(W), W.finalize(); } if (!a.astyle.hidden) { - a.astyle.start = $[0], a.astyle.end = $[1]; - let N = this.addArrow(a.astyle); - t.unitCellObjects.shapes.push(N); + a.astyle.start = z[0], a.astyle.end = z[1]; + let V = this.addArrow(a.astyle); + t.unitCellObjects.shapes.push(V); } if (!a.bstyle.hidden) { - a.bstyle.start = $[0], a.bstyle.end = $[2]; - let N = this.addArrow(a.bstyle); - t.unitCellObjects.shapes.push(N); + a.bstyle.start = z[0], a.bstyle.end = z[2]; + let V = this.addArrow(a.bstyle); + t.unitCellObjects.shapes.push(V); } if (!a.cstyle.hidden) { - a.cstyle.start = $[0], a.cstyle.end = $[3]; - let N = this.addArrow(a.cstyle); - t.unitCellObjects.shapes.push(N); + a.cstyle.start = z[0], a.cstyle.end = z[3]; + let V = this.addArrow(a.cstyle); + t.unitCellObjects.shapes.push(V); } if (a.alabel) { - a.alabelstyle.position = $[1]; - let N = this.addLabel(a.alabel, a.alabelstyle); - t.unitCellObjects.labels.push(N); + a.alabelstyle.position = z[1]; + let V = this.addLabel(a.alabel, a.alabelstyle); + t.unitCellObjects.labels.push(V); } if (a.blabel) { - a.blabelstyle.position = $[2]; - let N = this.addLabel(a.blabel, a.blabelstyle); - t.unitCellObjects.labels.push(N); + a.blabelstyle.position = z[2]; + let V = this.addLabel(a.blabel, a.blabelstyle); + t.unitCellObjects.labels.push(V); } if (a.clabel) { - a.clabelstyle.position = $[3]; - let N = this.addLabel(a.clabel, a.clabelstyle); - t.unitCellObjects.labels.push(N); + a.clabelstyle.position = z[3]; + let V = this.addLabel(a.clabel, a.clabelstyle); + t.unitCellObjects.labels.push(V); } } } @@ -7448,39 +7448,39 @@ ATOM`, h); M = this.getModel(M); let T = M.getCrystData(); if (T) { - const R = M.selectedAtoms({}), z = T.matrix; - let P = function(U) { - return U % 2 == 0 ? -U / 2 : Math.ceil(U / 2); + const R = M.selectedAtoms({}), $ = T.matrix; + let P = function(F) { + return F % 2 == 0 ? -F / 2 : Math.ceil(F / 2); }; t <= 1 && a <= 1 && h <= 1 && (S = !0, t = a = h = 3); - let B = function(U, F, $) { + let B = function(F, U, z) { return !1; }; if (S) { - const U = new g.Matrix3().getInverse3(z); - B = function(F, $, W) { - let N = new g.Vector3(F, $, W).applyMatrix3(U); - return !(N.x > -1e-4 && N.x < 1.0001 && N.y > -1e-4 && N.y < 1.0001 && N.z > -1e-4 && N.z < 1.0001); + const F = new p.Matrix3().getInverse3($); + B = function(U, z, W) { + let V = new p.Vector3(U, z, W).applyMatrix3(F); + return !(V.x > -1e-4 && V.x < 1.0001 && V.y > -1e-4 && V.y < 1.0001 && V.z > -1e-4 && V.z < 1.0001); }; } - for (let U = 0; U < t; U++) - for (let F = 0; F < a; F++) - for (let $ = 0; $ < h; $++) { - if (U == 0 && F == 0 && $ == 0) + for (let F = 0; F < t; F++) + for (let U = 0; U < a; U++) + for (let z = 0; z < h; z++) { + if (F == 0 && U == 0 && z == 0) continue; - let W = new g.Vector3(P(U), P(F), P($)); - W.applyMatrix3(z); - let N = []; - for (let G = 0; G < R.length; G++) { - let k = R[G].x + W.x, j = R[G].y + W.y, Q = R[G].z + W.z; - if (B(k, j, Q)) + let W = new p.Vector3(P(F), P(U), P(z)); + W.applyMatrix3($); + let V = []; + for (let N = 0; N < R.length; N++) { + let k = R[N].x + W.x, G = R[N].y + W.y, Q = R[N].z + W.z; + if (B(k, G, Q)) continue; let ie = {}; - for (let pe in R[G]) - ie[pe] = R[G][pe]; - ie.x = k, ie.y = j, ie.z = Q, N.push(ie); + for (let ge in R[N]) + ie[ge] = R[N][ge]; + ie.x = k, ie.y = G, ie.z = Q, V.push(ie); } - M.addAtoms(N); + M.addAtoms(V); } w && M.assignBonds(); } @@ -7489,16 +7489,16 @@ ATOM`, h); addLineDashed(t, a) { t.dashLength = t.dashLength || 0.5, t.gapLength = t.gapLength || 0.5; var h; - t.start ? h = new g.Vector3(t.start.x || 0, t.start.y || 0, t.start.z || 0) : h = new g.Vector3(0, 0, 0); + t.start ? h = new p.Vector3(t.start.x || 0, t.start.y || 0, t.start.z || 0) : h = new p.Vector3(0, 0, 0); var M; - t.end ? M = new g.Vector3(t.end.x, t.end.y || 0, t.end.z || 0) : M = new g.Vector3(0, 0, 0); - var w = new g.Vector3(), S = new g.Vector3(), T = new g.Vector3(), R, z, P, B = h.clone(), U = 0; - for (w.subVectors(M, h), R = w.length(), w.normalize(), S = w.clone(), T = w.clone(), S.multiplyScalar(t.dashLength), T.multiplyScalar(t.gapLength), z = S.length(), P = T.length(); U < R; ) { - if (U + z > R) { + t.end ? M = new p.Vector3(t.end.x, t.end.y || 0, t.end.z || 0) : M = new p.Vector3(0, 0, 0); + var w = new p.Vector3(), S = new p.Vector3(), T = new p.Vector3(), R, $, P, B = h.clone(), F = 0; + for (w.subVectors(M, h), R = w.length(), w.normalize(), S = w.clone(), T = w.clone(), S.multiplyScalar(t.dashLength), T.multiplyScalar(t.gapLength), $ = S.length(), P = T.length(); F < R; ) { + if (F + $ > R) { t.start = h, t.end = M, a.addLine(t); break; } - B.addVectors(h, S), t.start = h, t.end = B, a.addLine(t), h = B.clone(), U += z, B.addVectors(h, T), h = B.clone(), U += P; + B.addVectors(h, S), t.start = h, t.end = B, a.addLine(t), h = B.clone(), F += $, B.addVectors(h, T), h = B.clone(), F += P; } return a.finalize(), a; } @@ -7595,7 +7595,7 @@ ATOM`, h); */ addVolumetricRender(t, a) { a = a || {}; - var h = new L.GLVolumetricRender(t, a); + var h = new C.GLVolumetricRender(t, a); return h.shapePosition = this.shapes.length, this.shapes.push(h), h; } /** @@ -7670,25 +7670,25 @@ ATOM`, h); t.startFrame && (T = t.startFrame % w); var R = 1; t.step && (R = t.step, M /= R); - var z = 0, P = w * M, B = /* @__PURE__ */ new Date(), U, F, $ = function(W) { + var $ = 0, P = w * M, B = /* @__PURE__ */ new Date(), F, U, z = function(W) { B = /* @__PURE__ */ new Date(), W == "forward" ? S.setFrame(T).then(function() { - T = (T + R) % w, U(); + T = (T + R) % w, F(); }) : W == "backward" ? S.setFrame(w - 1 - T).then(function() { - T = (T + R) % w, U(); + T = (T + R) % w, F(); }) : S.setFrame(T).then(function() { - T += R, R *= T % (w - 1) == 0 ? -1 : 1, U(); + T += R, R *= T % (w - 1) == 0 ? -1 : 1, F(); }); }; - return U = function() { + return F = function() { if (S.render(), !S.getCanvas().isConnected) S.stopAnimate(); - else if (++z == P || !S.isAnimated()) - F.cancel(), S.animationTimers.delete(F), S.decAnim(); + else if (++$ == P || !S.isAnimated()) + U.cancel(), S.animationTimers.delete(U), S.decAnim(); else { var W = a - ((/* @__PURE__ */ new Date()).getTime() - B.getTime()); - W = W > 0 ? W : 0, S.animationTimers.delete(F), F = new x.PausableTimer($, W, h), S.animationTimers.add(F); + W = W > 0 ? W : 0, S.animationTimers.delete(U), U = new x.PausableTimer(z, W, h), S.animationTimers.add(U); } - }, F = new x.PausableTimer($, 0, h), this.animationTimers.add(F), this; + }, U = new x.PausableTimer(z, 0, h), this.animationTimers.add(U), this; } /** * Stop animation of all models in viewer @@ -7749,7 +7749,7 @@ ATOM`, h); */ addModel(t, a = "", h) { h = this.getModelOpt(h); - var M = new p.GLModel(this.models.length, h); + var M = new g.GLModel(this.models.length, h); return M.addMolData(t, a, h), this.models.push(M), M; } /** @@ -7762,8 +7762,8 @@ ATOM`, h); */ addModels(t, a, h) { h = this.getModelOpt(h), h.multimodel = !0, h.frames = !0; - for (var M = p.GLModel.parseMolData(t, a, h), w = 0; w < M.length; w++) { - var S = new p.GLModel(this.models.length, h); + for (var M = g.GLModel.parseMolData(t, a, h), w = 0; w < M.length; w++) { + var S = new g.GLModel(this.models.length, h); S.setAtomDefaults(M[w]), S.addFrame(M[w]), S.setFrame(0), M.modelData && S.setModelData(M.modelData[w]), S.setDontDuplicateAtoms(!h.duplicateAssemblyAtoms), this.models.push(S); } return this.models; @@ -7788,7 +7788,7 @@ ATOM`, h); */ addModelsAsFrames(t, a, h) { h = this.getModelOpt(h), h.multimodel = !0, h.frames = !0; - var M = new p.GLModel(this.models.length, h); + var M = new g.GLModel(this.models.length, h); return M.addMolData(t, a, h), this.models.push(M), M; } /** @@ -7809,7 +7809,7 @@ ATOM`, h); */ addAsOneMolecule(t, a, h) { h = this.getModelOpt(h), h.multimodel = !0, h.onemol = !0; - var M = new p.GLModel(this.models.length, h); + var M = new g.GLModel(this.models.length, h); return M.addMolData(t, a, h), this.models.push(M), M; } /** @@ -7866,7 +7866,7 @@ ATOM`, h); * @return {GLModel} */ createModelFrom(t, a = !1) { - for (var h = new p.GLModel(this.models.length, this.defaultcolors), M = 0; M < this.models.length; M++) + for (var h = new g.GLModel(this.models.length, this.defaultcolors), M = 0; M < this.models.length; M++) if (this.models[M]) { var w = this.models[M].selectedAtoms(t); h.addAtoms(w), a && this.models[M].removeAtoms(w); @@ -7874,8 +7874,8 @@ ATOM`, h); return this.models.push(h), h; } applyToModels(t, a, h, M, w, S, T) { - for (var R = this.getModelList(a), z = 0; z < R.length; z++) - R[z][t](a, h, M, w, S, T); + for (var R = this.getModelList(a), $ = 0; $ < R.length; $++) + R[$][t](a, h, M, w, S, T); } setStyle(t, a) { return typeof a > "u" && (a = t, t = {}), this.applyToModels("setStyle", t, a, !1), this; @@ -8008,33 +8008,33 @@ ATOM`, h); */ carveUpExtent(t, a, h) { let M = [], w = {}; - for (let B = 0, U = a.length; B < U; B++) + for (let B = 0, F = a.length; B < F; B++) w[a[B].index] = B; let S = function(B) { - let U = []; - for (let F = 0, $ = B.length; F < $; F++) - B[F].index in w && U.push(w[B[F].index]); - return U; + let F = []; + for (let U = 0, z = B.length; U < z; U++) + B[U].index in w && F.push(w[B[U].index]); + return F; }, T = function(B) { - let U = []; - return U[0] = [B[0][0], B[0][1], B[0][2]], U[1] = [B[1][0], B[1][1], B[1][2]], U; + let F = []; + return F[0] = [B[0][0], B[0][1], B[0][2]], F[1] = [B[1][0], B[1][1], B[1][2]], F; }, R = function(B) { if (r.volume(B) < r.maxVolume) return [B]; - var U = B[1][0] - B[0][0], F = B[1][1] - B[0][1], $ = B[1][2] - B[0][2], W; - U > F && U > $ ? W = 0 : F > U && F > $ ? W = 1 : W = 2; - var N = T(B), G = T(B), k = (B[1][W] - B[0][W]) / 2 + B[0][W]; - N[1][W] = k, G[0][W] = k; - var j = R(N), Q = R(G); - return j.concat(Q); - }, z = R(t), P = 6; - for (let B = 0, U = z.length; B < U; B++) { - let F = T(z[B]); - F[0][0] -= P, F[0][1] -= P, F[0][2] -= P, F[1][0] += P, F[1][1] += P, F[1][2] += P; - let $ = r.getAtomsWithin(a, F), W = r.getAtomsWithin(h, z[B]); + var F = B[1][0] - B[0][0], U = B[1][1] - B[0][1], z = B[1][2] - B[0][2], W; + F > U && F > z ? W = 0 : U > F && U > z ? W = 1 : W = 2; + var V = T(B), N = T(B), k = (B[1][W] - B[0][W]) / 2 + B[0][W]; + V[1][W] = k, N[0][W] = k; + var G = R(V), Q = R(N); + return G.concat(Q); + }, $ = R(t), P = 6; + for (let B = 0, F = $.length; B < F; B++) { + let U = T($[B]); + U[0][0] -= P, U[0][1] -= P, U[0][2] -= P, U[1][0] += P, U[1][1] += P, U[1][2] += P; + let z = r.getAtomsWithin(a, U), W = r.getAtomsWithin(h, $[B]); M.push({ - extent: z[B], - atoms: S($), + extent: $[B], + atoms: S(z), toshow: S(W) }); } @@ -8053,37 +8053,37 @@ ATOM`, h); */ static generateSurfaceMesh(t, a, h) { var M = new l.Geometry(!0), w = M.updateGeoGroup(0), S = []; - for (let xe = 0, Ie = t.length; xe < Ie; xe++) { - var T = t[xe]; - T && (typeof T.surfaceColor < "u" ? S[xe] = T.surfaceColor : T.color && (S[xe] = _.CC.color(T.color))); + for (let ye = 0, Pe = t.length; ye < Pe; ye++) { + var T = t[ye]; + T && (typeof T.surfaceColor < "u" ? S[ye] = T.surfaceColor : T.color && (S[ye] = _.CC.color(T.color))); } - var R = w.vertexArray, z = a.vertices; - for (let xe = 0, Ie = z.length; xe < Ie; xe++) { - let oe = w.vertices * 3; - R[oe] = z[xe].x, R[oe + 1] = z[xe].y, R[oe + 2] = z[xe].z, w.vertices++; + var R = w.vertexArray, $ = a.vertices; + for (let ye = 0, Pe = $.length; ye < Pe; ye++) { + let de = w.vertices * 3; + R[de] = $[ye].x, R[de + 1] = $[ye].y, R[de + 2] = $[ye].z, w.vertices++; } var P = w.colorArray; if (h.voldata && h.volscheme) { - var B = h.volscheme, U = h.voldata, F = B.range() || [-1, 1]; - for (let xe = 0, Ie = z.length; xe < Ie; xe++) { - let oe = U.getVal(z[xe].x, z[xe].y, z[xe].z), ve = _.CC.color(B.valueToHex(oe, F)), re = xe * 3; - P[re] = ve.r, P[re + 1] = ve.g, P[re + 2] = ve.b; + var B = h.volscheme, F = h.voldata, U = B.range() || [-1, 1]; + for (let ye = 0, Pe = $.length; ye < Pe; ye++) { + let de = F.getVal($[ye].x, $[ye].y, $[ye].z), pe = _.CC.color(B.valueToHex(de, U)), re = ye * 3; + P[re] = pe.r, P[re + 1] = pe.g, P[re + 2] = pe.b; } } else if (S.length > 0) - for (let xe = 0, Ie = z.length; xe < Ie; xe++) { - let oe = z[xe].atomid, ve = xe * 3; - P[ve] = S[oe].r, P[ve + 1] = S[oe].g, P[ve + 2] = S[oe].b; + for (let ye = 0, Pe = $.length; ye < Pe; ye++) { + let de = $[ye].atomid, pe = ye * 3; + P[pe] = S[de].r, P[pe + 1] = S[de].g, P[pe + 2] = S[de].b; } - var $ = a.faces; - w.faceidx = $.length, M.initTypedArrays(); - var W = w.vertexArray, N = w.normalArray, G, k, j, Q; - for (let xe = 0, Ie = $.length; xe < Ie; xe += 3) { - var ie = $[xe], pe = $[xe + 1], he = $[xe + 2], ue = ie * 3, se = pe * 3, ae = he * 3; - G = new g.Vector3(W[ue], W[ue + 1], W[ue + 2]), k = new g.Vector3(W[se], W[se + 1], W[se + 2]), j = new g.Vector3(W[ae], W[ae + 1], W[ae + 2]), j.subVectors(j, k), G.subVectors(G, k), j.cross(G), Q = j, Q.normalize(), N[ue] += Q.x, N[se] += Q.x, N[ae] += Q.x, N[ue + 1] += Q.y, N[se + 1] += Q.y, N[ae + 1] += Q.y, N[ue + 2] += Q.z, N[se + 2] += Q.z, N[ae + 2] += Q.z; + var z = a.faces; + w.faceidx = z.length, M.initTypedArrays(); + var W = w.vertexArray, V = w.normalArray, N, k, G, Q; + for (let ye = 0, Pe = z.length; ye < Pe; ye += 3) { + var ie = z[ye], ge = z[ye + 1], le = z[ye + 2], oe = ie * 3, he = ge * 3, se = le * 3; + N = new p.Vector3(W[oe], W[oe + 1], W[oe + 2]), k = new p.Vector3(W[he], W[he + 1], W[he + 2]), G = new p.Vector3(W[se], W[se + 1], W[se + 2]), G.subVectors(G, k), N.subVectors(N, k), G.cross(N), Q = G, Q.normalize(), V[oe] += Q.x, V[he] += Q.x, V[se] += Q.x, V[oe + 1] += Q.y, V[he + 1] += Q.y, V[se + 1] += Q.y, V[oe + 2] += Q.z, V[he + 2] += Q.z, V[se + 2] += Q.z; } - w.faceArray = new Uint16Array($); - var we = new l.Mesh(M, h); - return we; + w.faceArray = new Uint16Array(z); + var xe = new l.Mesh(M, h); + return xe; } // do same thing as worker in main thread /** @@ -8102,8 +8102,8 @@ ATOM`, h); * @return {Object} */ static generateMeshSyncHelper(t, a, h, M, w, S) { - var T = new C.ProteinSurface(); - return T.initparm(a, t !== 1, S), T.fillvoxels(w, h), T.buildboundary(), (t == C.SurfaceType.SES || t == C.SurfaceType.MS) && (T.fastdistancemap(), T.boundingatom(!1), T.fillvoxelswaals(w, h)), T.marchingcube(t), T.getFacesAndVertices(M); + var T = new L.ProteinSurface(); + return T.initparm(a, t !== 1, S), T.fillvoxels(w, h), T.buildboundary(), (t == L.SurfaceType.SES || t == L.SurfaceType.MS) && (T.fastdistancemap(), T.boundingatom(!1), T.fillvoxelswaals(w, h)), T.marchingcube(t), T.getFacesAndVertices(M); } /* * @@ -8157,111 +8157,111 @@ ATOM`, h); * @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(t, a = {}, h = {}, M, w, S) { - let T = this.nextSurfID(), R = null, z = this, P = C.SurfaceType.VDW; + let T = this.nextSurfID(), R = null, $ = this, P = L.SurfaceType.VDW; typeof t == "string" ? r.surfaceTypeMap[t.toUpperCase()] !== void 0 ? P = r.surfaceTypeMap[t] : console.log("Surface type : " + t + " is not recognized") : typeof t == "number" && (P = t); - var B = null, U = null, F = r.shallowCopy(this.getAtomsFromSel(h)); - M ? B = r.shallowCopy(this.getAtomsFromSel(M)) : B = F, (0, x.adjustVolumeStyle)(a); - var $ = !1, W; + var B = null, F = null, U = r.shallowCopy(this.getAtomsFromSel(h)); + M ? B = r.shallowCopy(this.getAtomsFromSel(M)) : B = U, (0, x.adjustVolumeStyle)(a); + var z = !1, W; for (W = 0; W < this.models.length; W++) if (this.models[W]) { - var N = this.models[W].getSymmetries(); - if (N.length > 1 || N.length == 1 && !N[0].isIdentity()) { - $ = !0; + var V = this.models[W].getSymmetries(); + if (V.length > 1 || V.length == 1 && !V[0].isIdentity()) { + z = !0; break; } } - var G = function(ue, se, ae) { - w ? U = r.shallowCopy(z.getAtomsFromSel(w)) : U = ae; - var we, xe = (0, x.getExtent)(ae, !0); + var N = function(oe, he, se) { + w ? F = r.shallowCopy($.getAtomsFromSel(w)) : F = se; + var xe, ye = (0, x.getExtent)(se, !0); if (a.map && a.map.prop) { - var Ie = a.map.prop; - let We = (0, o.getGradient)(a.map.scheme || a.map.gradient || new o.Gradient.RWB()), Te = We.range(); - Te || (Te = (0, x.getPropertyRange)(ae, Ie)), a.colorscheme = { prop: Ie, gradient: We }; + var Pe = a.map.prop; + let We = (0, o.getGradient)(a.map.scheme || a.map.gradient || new o.Gradient.RWB()), Ue = We.range(); + Ue || (Ue = (0, x.getPropertyRange)(se, Pe)), a.colorscheme = { prop: Pe, gradient: We }; } - for (let We = 0, Te = se.length; We < Te; We++) - we = se[We], we.surfaceColor = (0, x.getColorFromStyle)(we, a); - var oe = r.volume(xe), ve = z.carveUpExtent(xe, se, ae); - if (U && U.length && U.length > 0) { - var re = (0, x.getExtent)(U, !0), Se = function(We, Te) { - var je = function(Z, q) { - var fe = Z.extent, _e = fe[1][0] - fe[0][0], Me = fe[1][1] - fe[0][1], Ae = fe[1][2] - fe[0][2], H = _e - q[2][0]; - H *= H; - var ce = Me - q[2][1]; - ce *= ce; - var ye = Ae - q[2][2]; - return ye *= ye, H + ce + ye; - }, Fe = je(We, re), X = je(Te, re); - return Fe - X; + for (let We = 0, Ue = he.length; We < Ue; We++) + xe = he[We], xe.surfaceColor = (0, x.getColorFromStyle)(xe, a); + var de = r.volume(ye), pe = $.carveUpExtent(ye, he, se); + if (F && F.length && F.length > 0) { + var re = (0, x.getExtent)(F, !0), Se = function(We, Ue) { + var Be = function(K, q) { + var fe = K.extent, _e = fe[1][0] - fe[0][0], Me = fe[1][1] - fe[0][1], Ae = fe[1][2] - fe[0][2], Z = _e - q[2][0]; + Z *= Z; + var ue = Me - q[2][1]; + ue *= ue; + var we = Ae - q[2][2]; + return we *= we, Z + ue + we; + }, Ne = Be(We, re), H = Be(Ue, re); + return Ne - H; }; - ve.sort(Se); + pe.sort(Se); } - var ze = []; - for (let We = 0, Te = se.length; We < Te; We++) - we = se[We], ze[We] = { - x: we.x, - y: we.y, - z: we.z, + var ke = []; + for (let We = 0, Ue = he.length; We < Ue; We++) + xe = he[We], ke[We] = { + x: xe.x, + y: xe.y, + z: xe.z, serial: We, - elem: we.elem + elem: xe.elem }; - var Ge = !!C.syncSurface; - if (Ge) { - var $e = function(Te) { - return new Promise(function(je) { - for (var Fe = r.generateMeshSyncHelper(P, ve[Te].extent, ve[Te].atoms, ve[Te].toshow, ze, oe), X = (0, u.splitMesh)({ vertexArr: Fe.vertices, faceArr: Fe.faces }), Z = 0, q = X.length; Z < q; Z++) { - Fe = { - vertices: X[Z].vertexArr, - faces: X[Z].faceArr + var $e = !!L.syncSurface; + if ($e) { + var ze = function(Ue) { + return new Promise(function(Be) { + for (var Ne = r.generateMeshSyncHelper(P, pe[Ue].extent, pe[Ue].atoms, pe[Ue].toshow, ke, de), H = (0, u.splitMesh)({ vertexArr: Ne.vertices, faceArr: Ne.faces }), K = 0, q = H.length; K < q; K++) { + Ne = { + vertices: H[K].vertexArr, + faces: H[K].faceArr }; - var fe = r.generateSurfaceMesh(se, Fe, R); - (0, x.mergeGeos)(ue.geo, fe); + var fe = r.generateSurfaceMesh(he, Ne, R); + (0, x.mergeGeos)(oe.geo, fe); } - z.render(), je(); + $.render(), Be(); }); }, Re = []; - for (let We = 0; We < ve.length; We++) - Re.push($e(We)); + for (let We = 0; We < pe.length; We++) + Re.push(ze(We)); return Promise.all(Re).then(function() { - return ue.done = !0, Promise.resolve(T); + return oe.done = !0, Promise.resolve(T); }); } else { - var Be = []; + var Fe = []; P < 0 && (P = 0); - for (let We = 0, Te = r.numWorkers; We < Te; We++) { - var ke = new Worker($3Dmol.SurfaceWorker); - Be.push(ke), ke.postMessage({ + for (let We = 0, Ue = r.numWorkers; We < Ue; We++) { + var Ie = new Worker($3Dmol.SurfaceWorker); + Fe.push(Ie), Ie.postMessage({ type: -1, - atoms: ze, - volume: oe + atoms: ke, + volume: de }); } - return new Promise(function(We, Te) { - var je = 0, Fe = function() { - !Be || !Be.length || Be.forEach(function(fe) { + return new Promise(function(We, Ue) { + var Be = 0, Ne = function() { + !Fe || !Fe.length || Fe.forEach(function(fe) { fe && fe.terminate && fe.terminate(); }); - }, X = function(fe) { + }, H = function(fe) { for (var _e = (0, u.splitMesh)({ vertexArr: fe.data.vertices, faceArr: fe.data.faces }), Me = 0, Ae = _e.length; Me < Ae; Me++) { - var H = { + var Z = { vertices: _e[Me].vertexArr, faces: _e[Me].faceArr - }, ce = r.generateSurfaceMesh(se, H, R); - (0, x.mergeGeos)(ue.geo, ce); + }, ue = r.generateSurfaceMesh(he, Z, R); + (0, x.mergeGeos)(oe.geo, ue); } - z.render(), je++, je == ve.length && (ue.done = !0, Fe(), We(T)); - }, Z = function(fe) { - Fe(), console.log(fe.message + " (" + fe.filename + ":" + fe.lineno + ")"), Te(fe); + $.render(), Be++, Be == pe.length && (oe.done = !0, Ne(), We(T)); + }, K = function(fe) { + Ne(), console.log(fe.message + " (" + fe.filename + ":" + fe.lineno + ")"), Ue(fe); }; - for (let fe = 0; fe < ve.length; fe++) { - var q = Be[fe % Be.length]; - q.onmessage = X, q.onerror = Z, q.postMessage({ + for (let fe = 0; fe < pe.length; fe++) { + var q = Fe[fe % Fe.length]; + q.onmessage = H, q.onerror = K, q.postMessage({ type: P, - expandedExtent: ve[fe].extent, - extendedAtoms: ve[fe].atoms, - atomsToShow: ve[fe].toshow + expandedExtent: pe[fe].extent, + extendedAtoms: pe[fe].atoms, + atomsToShow: pe[fe].toshow }); } }); @@ -8270,16 +8270,16 @@ ATOM`, h); a = a || {}, R = r.getMatWithStyle(a); var k = []; k.style = a, k.atomsel = h, k.allsel = M, k.focus = w; - var j = null; - if ($) { + var G = null; + if (z) { var Q = {}, ie = {}; for (W = 0; W < this.models.length; W++) Q[W] = [], ie[W] = []; for (W = 0; W < B.length; W++) Q[B[W].model].push(B[W]); - for (W = 0; W < F.length; W++) - ie[F[W].model].push(F[W]); - var pe = []; + for (W = 0; W < U.length; W++) + ie[U[W].model].push(U[W]); + var ge = []; for (W = 0; W < this.models.length; W++) ie[W].length > 0 && (k.push({ geo: new l.Geometry(!0), @@ -8288,19 +8288,19 @@ ATOM`, h); finished: !1, symmetries: this.models[W].getSymmetries() // also webgl initialized - }), pe.push(G(k[k.length - 1], Q[W], ie[W]))); - j = Promise.all(pe); + }), ge.push(N(k[k.length - 1], Q[W], ie[W]))); + G = Promise.all(ge); } else k.push({ geo: new l.Geometry(!0), mat: R, done: !1, finished: !1, - symmetries: [new g.Matrix4()] - }), j = G(k[k.length - 1], B, F); - return this.surfaces[T] = k, j.surfid = T, S && typeof S == "function" ? (j.then(function(he) { - S(he); - }), T) : j; + symmetries: [new p.Matrix4()] + }), G = N(k[k.length - 1], B, U); + return this.surfaces[T] = k, G.surfid = T, S && typeof S == "function" ? (G.then(function(le) { + S(le); + }), T) : G; } /** * Set the surface material to something else, must render change @@ -8330,10 +8330,10 @@ ATOM`, h); return S; }); } else if (w.voldata && w.volscheme) { - const S = w.volscheme, T = w.voldata, R = _.CC, z = S.range() || [-1, 1]; - h[M].geo.setColors(function(P, B, U) { - let F = T.getVal(P, B, U); - return R.color(S.valueToHex(F, z)); + const S = w.volscheme, T = w.voldata, R = _.CC, $ = S.range() || [-1, 1]; + h[M].geo.setColors(function(P, B, F) { + let U = T.getVal(P, B, F); + return R.color(S.valueToHex(U, $)); }); } h[M].finished = !1; @@ -8409,7 +8409,7 @@ ATOM`, h); else for (let S = 0, T = h.length; S < T; S++) { var M = h[S]; - for (let R = 0, z = t.length; R < z; R++) { + for (let R = 0, $ = t.length; R < $; R++) { let P = t[R]; if (P.props) for (var w in P.props) @@ -8447,7 +8447,7 @@ ATOM`, h); */ setAutoEyeSeparation(t, a) { var h = this.getPerceivedDistance(); - return a || (a = 5), t || this.camera.position.x > 0 ? this.camera.position.x = h * Math.tan(Math.PI / 180 * a) : this.camera.position.x = -h * Math.tan(Math.PI / 180 * a), this.camera.lookAt(new g.Vector3(0, 0, this.rotationGroup.position.z)), this.camera.position.x; + return a || (a = 5), t || this.camera.position.x > 0 ? this.camera.position.x = h * Math.tan(Math.PI / 180 * a) : this.camera.position.x = -h * Math.tan(Math.PI / 180 * a), this.camera.lookAt(new p.Vector3(0, 0, this.rotationGroup.position.z)), this.camera.position.x; } /** * Set the default cartoon quality for newly created models. Default is 5. @@ -8459,10 +8459,10 @@ ATOM`, h); } } r.numWorkers = 4, r.maxVolume = 64e3, r.surfaceTypeMap = { - VDW: C.SurfaceType.VDW, - MS: C.SurfaceType.MS, - SAS: C.SurfaceType.SAS, - SES: C.SurfaceType.SES + VDW: L.SurfaceType.VDW, + MS: L.SurfaceType.MS, + SAS: L.SurfaceType.SAS, + SES: L.SurfaceType.SES }; function n(c, t) { if (c = (0, x.getElement)(c), !!c) { @@ -8488,8 +8488,8 @@ ATOM`, h); } h.unshift(S); } - } catch (z) { - throw "error creating viewer grid: " + z; + } catch ($) { + throw "error creating viewer grid: " + $; } return h; } @@ -8540,17 +8540,17 @@ ATOM`, h); /* harmony export */ Gradient: () => ( /* binding */ - C + L ), /* harmony export */ GradientType: () => ( /* binding */ - g + p ), /* harmony export */ ROYGB: () => ( /* binding */ - p + g ), /* harmony export */ RWB: () => ( @@ -8583,21 +8583,21 @@ ATOM`, h); /*! ./colors */ "./src/colors.ts" ); - class g { + class p { } - function _(L, D, r) { - return D >= L ? (r < L && (r = L), r > D && (r = D), { lo: L, hi: D, val: r }) : (r > L && (r = L), r < D && (r = D), r = L - r + D, { lo: D, hi: L, val: r }); + function _(C, D, r) { + return D >= C ? (r < C && (r = C), r > D && (r = D), { lo: C, hi: D, val: r }) : (r > C && (r = C), r < D && (r = D), r = C - r + D, { lo: D, hi: C, val: r }); } - function x(L) { - if (L instanceof g) - return L; - if (L.gradient !== void 0 && A[L.gradient]) { - let D = L.min === void 0 ? -1 : L.min, r = L.max === void 0 ? 1 : L.max; - return L.mid === void 0 ? L.colors === void 0 ? new A[L.gradient](D, r) : new A[L.gradient](D, r, L.colors) : new A[L.gradient](D, r, L.mid); + function x(C) { + if (C instanceof p) + return C; + if (C.gradient !== void 0 && A[C.gradient]) { + let D = C.min === void 0 ? -1 : C.min, r = C.max === void 0 ? 1 : C.max; + return C.mid === void 0 ? C.colors === void 0 ? new A[C.gradient](D, r) : new A[C.gradient](D, r, C.colors) : new A[C.gradient](D, r, C.mid); } - return L; + return C; } - class o extends g { + class o extends p { constructor(D, r, n) { super(), this.gradient = "RWB", this.mult = 1, this.mid = n, this.min = D, this.max = r, typeof r > "u" && Array.isArray(D) && D.length >= 2 ? (this.max = D[1], this.min = D[0]) : D && r && !Array.isArray(D) && (this.min = D, this.max = r); } @@ -8618,7 +8618,7 @@ ATOM`, h); return D < c ? (t = Math.floor(255 * Math.sqrt((D - n) / (c - n))), a = 16711680 + 256 * t + t, a) : D > c ? (t = Math.floor(255 * Math.sqrt(1 - (D - c) / (b - c))), a = 65536 * t + 256 * t + 255, a) : 16777215; } } - class p extends g { + class g extends p { constructor(D, r) { super(), this.gradient = "ROYGB", this.mult = 1, this.min = D, this.max = r, typeof r > "u" && Array.isArray(D) && D.length >= 2 ? (this.max = D[1], this.min = D[0]) : D && r && !Array.isArray(D) && (this.min = D, this.max = r); } @@ -8637,7 +8637,7 @@ ATOM`, h); return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } } - class E extends g { + class E extends p { constructor(D, r) { super(), this.gradient = "Sinebow", this.mult = 1, this.min = D, this.max = r, typeof r > "u" && Array.isArray(D) && D.length >= 2 && (this.max = D[1], this.min = D[0]), r < D && (this.mult = -1, this.min *= -1, this.max *= -1); } @@ -8646,7 +8646,7 @@ ATOM`, h); var n, b; if (D = this.mult * D, r ? (n = r[0], b = r[1]) : (n = this.min, b = this.max), typeof D > "u") return 16777215; - var f = C.normalizeValue(n, b, D); + var f = L.normalizeValue(n, b, D); n = f.lo, b = f.hi, D = f.val; var c = (D - n) / (b - n), t = 5 * c / 6 + 0.5, a = Math.sin(Math.PI * t); a *= a * 255; @@ -8660,7 +8660,7 @@ ATOM`, h); return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } } - class u extends g { + class u extends p { constructor(D, r, n) { super(), this.gradient = "linear", this.colors = new Array(); var b; @@ -8688,12 +8688,12 @@ ATOM`, h); const A = { rwb: o, RWB: o, - roygb: p, - ROYGB: p, + roygb: g, + ROYGB: g, sinebow: E, linear: u }; - class C extends g { + class L extends p { valueToHex(D, r) { return 0; } @@ -8701,7 +8701,7 @@ ATOM`, h); return null; } } - C.RWB = o, C.ROYGB = p, C.Sinebow = E, C.CustomLinear = u, C.builtinGradients = A, C.normalizeValue = _, C.getGradient = x; + L.RWB = o, L.ROYGB = g, L.Sinebow = E, L.CustomLinear = u, L.builtinGradients = A, L.normalizeValue = _, L.getGradient = x; } ), /***/ @@ -8727,7 +8727,7 @@ ATOM`, h); var l = e( /*! ./WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./Gradient */ "./src/Gradient.ts" ), _ = e( @@ -8735,34 +8735,34 @@ ATOM`, h); "./src/colors.ts" ); let x = 0; - function o(u, A, C, L, D, r, n) { - u.beginPath(), u.moveTo(A + r, C), u.lineTo(A + L - r, C), u.quadraticCurveTo(A + L, C, A + L, C + r), u.lineTo(A + L, C + D - r), u.quadraticCurveTo(A + L, C + D, A + L - r, C + D), u.lineTo(A + r, C + D), u.quadraticCurveTo(A, C + D, A, C + D - r), u.lineTo(A, C + r), u.quadraticCurveTo(A, C, A + r, C), u.closePath(), u.fill(), n && u.stroke(); + function o(u, A, L, C, D, r, n) { + u.beginPath(), u.moveTo(A + r, L), u.lineTo(A + C - r, L), u.quadraticCurveTo(A + C, L, A + C, L + r), u.lineTo(A + C, L + D - r), u.quadraticCurveTo(A + C, L + D, A + C - r, L + D), u.lineTo(A + r, L + D), u.quadraticCurveTo(A, L + D, A, L + D - r), u.lineTo(A, L + r), u.quadraticCurveTo(A, L, A + r, L), u.closePath(), u.fill(), n && u.stroke(); } - function p(u, A, C) { - var L = C; - return typeof u < "u" && (u instanceof _.Color ? L = u.scaled() : (L = _.CC.color(u), typeof L.scaled < "u" && (L = L.scaled()))), typeof A < "u" && (L.a = parseFloat(A)), L; + function g(u, A, L) { + var C = L; + return typeof u < "u" && (u instanceof _.Color ? C = u.scaled() : (C = _.CC.color(u), typeof C.scaled < "u" && (C = C.scaled()))), typeof A < "u" && (C.a = parseFloat(A)), C; } class E { - constructor(A, C) { - this.id = x++, this.stylespec = C || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new l.Sprite(), this.text = A, this.frame = this.stylespec.frame; + constructor(A, L) { + this.id = x++, this.stylespec = L || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new l.Sprite(), this.text = A, this.frame = this.stylespec.frame; } getStyle() { return this.stylespec; } setContext() { - var A = this.stylespec, C = typeof A.useScreen > "u" ? !1 : A.useScreen, L = A.showBackground; - (L === "0" || L === "false") && (L = !1), typeof L > "u" && (L = !0); - var D = A.font ? A.font : "sans-serif", r = parseInt(A.fontSize) ? parseInt(A.fontSize) : 18, n = p(A.fontColor, A.fontOpacity, { + var A = this.stylespec, L = typeof A.useScreen > "u" ? !1 : A.useScreen, C = A.showBackground; + (C === "0" || C === "false") && (C = !1), typeof C > "u" && (C = !0); + var D = A.font ? A.font : "sans-serif", r = parseInt(A.fontSize) ? parseInt(A.fontSize) : 18, n = g(A.fontColor, A.fontOpacity, { r: 255, g: 255, b: 255, a: 1 - }), b = A.padding ? A.padding : 4, f = A.borderThickness ? A.borderThickness : 0, c = p(A.backgroundColor, A.backgroundOpacity, { + }), b = A.padding ? A.padding : 4, f = A.borderThickness ? A.borderThickness : 0, c = g(A.backgroundColor, A.backgroundOpacity, { r: 0, g: 0, b: 0, a: 1 - }), t = p(A.borderColor, A.borderOpacity, c), a = A.position ? A.position : { + }), t = g(A.borderColor, A.borderOpacity, c), a = A.position ? A.position : { x: -10, y: 1, z: 1 @@ -8773,27 +8773,27 @@ ATOM`, h); var w = ""; A.bold && (w = "bold "), this.context.font = w + r + "px " + D; var S = this.context.measureText(this.text), T = S.width; - L || (f = 0); - var R = T + 2.5 * f + 2 * b, z = r * 1.25 + 2 * f + 2 * b; + C || (f = 0); + var R = T + 2.5 * f + 2 * b, $ = r * 1.25 + 2 * f + 2 * b; if (A.backgroundImage) { - var P = A.backgroundImage, B = A.backgroundWidth ? A.backgroundWidth : P.width, U = A.backgroundHeight ? A.backgroundHeight : P.height; - B > R && (R = B), U > z && (z = U); + var P = A.backgroundImage, B = A.backgroundWidth ? A.backgroundWidth : P.width, F = A.backgroundHeight ? A.backgroundHeight : P.height; + B > R && (R = B), F > $ && ($ = F); } - if (this.canvas.width = R, this.canvas.height = z, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), w = "", A.bold && (w = "bold "), this.context.font = w + r + "px " + D, this.context.fillStyle = "rgba(" + c.r + "," + c.g + "," + c.b + "," + c.a + ")", this.context.strokeStyle = "rgba(" + t.r + "," + t.g + "," + t.b + "," + t.a + ")", A.backgroundGradient) { - let $ = this.context.createLinearGradient(0, z / 2, R, z / 2), W = g.Gradient.getGradient(A.backgroundGradient), N = W.range(), G = -1, k = 1; - N && (G = N[0], k = N[1]); - let j = k - G; + if (this.canvas.width = R, this.canvas.height = $, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), w = "", A.bold && (w = "bold "), this.context.font = w + r + "px " + D, this.context.fillStyle = "rgba(" + c.r + "," + c.g + "," + c.b + "," + c.a + ")", this.context.strokeStyle = "rgba(" + t.r + "," + t.g + "," + t.b + "," + t.a + ")", A.backgroundGradient) { + let z = this.context.createLinearGradient(0, $ / 2, R, $ / 2), W = p.Gradient.getGradient(A.backgroundGradient), V = W.range(), N = -1, k = 1; + V && (N = V[0], k = V[1]); + let G = k - N; for (let Q = 0; Q < 1.01; Q += 0.1) { - let ie = p(W.valueToHex(G + j * Q)), pe = "rgba(" + ie.r + "," + ie.g + "," + ie.b + "," + ie.a + ")"; - $.addColorStop(Q, pe); + let ie = g(W.valueToHex(N + G * Q)), ge = "rgba(" + ie.r + "," + ie.g + "," + ie.b + "," + ie.a + ")"; + z.addColorStop(Q, ge); } - this.context.fillStyle = $; + this.context.fillStyle = z; } - this.context.lineWidth = f, L && o(this.context, f, f, R - 2 * f, z - 2 * f, 6, f > 0), A.backgroundImage && this.context.drawImage(P, 0, 0, R, z), this.context.fillStyle = "rgba(" + n.r + "," + n.g + "," + n.b + "," + n.a + ")", this.context.fillText(this.text, f + b, r + f + b, T); - var F = new l.Texture(this.canvas); - F.needsUpdate = !0, this.sprite.material = new l.SpriteMaterial({ - map: F, - useScreenCoordinates: C, + this.context.lineWidth = f, C && o(this.context, f, f, R - 2 * f, $ - 2 * f, 6, f > 0), A.backgroundImage && this.context.drawImage(P, 0, 0, R, $), this.context.fillStyle = "rgba(" + n.r + "," + n.g + "," + n.b + "," + n.a + ")", this.context.fillText(this.text, f + b, r + f + b, T); + var U = new l.Texture(this.canvas); + U.needsUpdate = !0, this.sprite.material = new l.SpriteMaterial({ + map: U, + useScreenCoordinates: L, alignment: M, depthTest: !h, screenOffset: A.screenOffset || null @@ -8817,7 +8817,7 @@ ATOM`, h); /* harmony export */ MarchingCube: () => ( /* binding */ - p + g ), /* harmony export */ MarchingCubeInitializer: () => ( @@ -8837,7 +8837,7 @@ ATOM`, h); /* harmony export */ SurfaceType: () => ( /* binding */ - g + p ), /* harmony export */ setSyncSurface: () => ( @@ -8854,10 +8854,10 @@ ATOM`, h); var l = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), g; + ), p; (function(A) { A[A.VDW = 1] = "VDW", A[A.MS = 2] = "MS", A[A.SAS = 3] = "SAS", A[A.SES = 4] = "SES"; - })(g || (g = {})); + })(p || (p = {})); var _ = !1; function x(A) { _ = A; @@ -9895,46 +9895,46 @@ ATOM`, h); [] ]; } - march(C, L, D, r) { + march(L, C, D, r) { let n = !!r.fulltable, b = r.hasOwnProperty("origin") && r.origin.hasOwnProperty("x") ? r.origin : { x: 0, y: 0, z: 0 }, f = !!r.voxel, c = r.matrix, t = r.nX || 0, a = r.nY || 0, h = r.nZ || 0, M = r.scale || 1, w = null; r.unitCube ? w = r.unitCube : w = { x: M, y: M, z: M }; let S = new Int32Array(t * a * h), T, R; for (T = 0, R = S.length; T < R; ++T) S[T] = -1; - let z = function(F, $, W, N, G, k) { - let j = { x: 0, y: 0, z: 0 }, Q = !!(N & 1 << G), ie = !!(N & 1 << k), pe = G; - if (!Q && ie && (pe = k), pe & 1 && W++, pe & 2 && $++, pe & 4 && F++, c) { - let ue = new l.Vector3(F, $, W); - ue = ue.applyMatrix4(c), j = { x: ue.x, y: ue.y, z: ue.z }; + let $ = function(U, z, W, V, N, k) { + let G = { x: 0, y: 0, z: 0 }, Q = !!(V & 1 << N), ie = !!(V & 1 << k), ge = N; + if (!Q && ie && (ge = k), ge & 1 && W++, ge & 2 && z++, ge & 4 && U++, c) { + let oe = new l.Vector3(U, z, W); + oe = oe.applyMatrix4(c), G = { x: oe.x, y: oe.y, z: oe.z }; } else - j.x = b.x + w.x * F, j.y = b.y + w.y * $, j.z = b.z + w.z * W; - let he = (a * F + $) * h + W; - return f ? (L.push(j), L.length - 1) : (S[he] < 0 && (S[he] = L.length, L.push(j)), S[he]); - }, P = new Int32Array(12), B = n ? this.edgeTable2 : this.edgeTable, U = n ? this.triTable2 : this.triTable; + G.x = b.x + w.x * U, G.y = b.y + w.y * z, G.z = b.z + w.z * W; + let le = (a * U + z) * h + W; + return f ? (C.push(G), C.length - 1) : (S[le] < 0 && (S[le] = C.length, C.push(G)), S[le]); + }, P = new Int32Array(12), B = n ? this.edgeTable2 : this.edgeTable, F = n ? this.triTable2 : this.triTable; for (T = 0; T < t - 1; ++T) - for (let F = 0; F < a - 1; ++F) - for (let $ = 0; $ < h - 1; ++$) { + for (let U = 0; U < a - 1; ++U) + for (let z = 0; z < h - 1; ++z) { let W = 0; for (let k = 0; k < 8; ++k) { - let j = (a * (T + ((k & 4) >> 2)) + F + ((k & 2) >> 1)) * h + $ + (k & 1), Q = !!(C[j] & this.ISDONE); + let G = (a * (T + ((k & 4) >> 2)) + U + ((k & 2) >> 1)) * h + z + (k & 1), Q = !!(L[G] & this.ISDONE); W |= Q << k; } if (W === 0 || W === 255) continue; - let N = B[W]; - if (N === 0) + let V = B[W]; + if (V === 0) continue; - let G = U[W]; - N & 1 && (P[0] = z(T, F, $, W, 0, 1)), N & 2 && (P[1] = z(T, F, $, W, 1, 3)), N & 4 && (P[2] = z(T, F, $, W, 3, 2)), N & 8 && (P[3] = z(T, F, $, W, 2, 0)), N & 16 && (P[4] = z(T, F, $, W, 4, 5)), N & 32 && (P[5] = z(T, F, $, W, 5, 7)), N & 64 && (P[6] = z(T, F, $, W, 7, 6)), N & 128 && (P[7] = z(T, F, $, W, 6, 4)), N & 256 && (P[8] = z(T, F, $, W, 0, 4)), N & 512 && (P[9] = z(T, F, $, W, 1, 5)), N & 1024 && (P[10] = z(T, F, $, W, 3, 7)), N & 2048 && (P[11] = z(T, F, $, W, 2, 6)); - for (let k = 0; k < G.length; k += 3) { - let j = P[G[k]], Q = P[G[k + 1]], ie = P[G[k + 2]]; - f && k >= 3 && (L.push(L[j]), j = L.length - 1, L.push(L[Q]), Q = L.length - 1, L.push(L[ie]), ie = L.length - 1), D.push(j), D.push(Q), D.push(ie); + let N = F[W]; + V & 1 && (P[0] = $(T, U, z, W, 0, 1)), V & 2 && (P[1] = $(T, U, z, W, 1, 3)), V & 4 && (P[2] = $(T, U, z, W, 3, 2)), V & 8 && (P[3] = $(T, U, z, W, 2, 0)), V & 16 && (P[4] = $(T, U, z, W, 4, 5)), V & 32 && (P[5] = $(T, U, z, W, 5, 7)), V & 64 && (P[6] = $(T, U, z, W, 7, 6)), V & 128 && (P[7] = $(T, U, z, W, 6, 4)), V & 256 && (P[8] = $(T, U, z, W, 0, 4)), V & 512 && (P[9] = $(T, U, z, W, 1, 5)), V & 1024 && (P[10] = $(T, U, z, W, 3, 7)), V & 2048 && (P[11] = $(T, U, z, W, 2, 6)); + for (let k = 0; k < N.length; k += 3) { + let G = P[N[k]], Q = P[N[k + 1]], ie = P[N[k + 2]]; + f && k >= 3 && (C.push(C[G]), G = C.length - 1, C.push(C[Q]), Q = C.length - 1, C.push(C[ie]), ie = C.length - 1), D.push(G), D.push(Q), D.push(ie); } } } - laplacianSmooth(C, L, D) { - let r = new Array(L.length), n, b, f, c, t; - for (n = 0, b = L.length; n < b; n++) + laplacianSmooth(L, C, D) { + let r = new Array(C.length), n, b, f, c, t; + for (n = 0, b = C.length; n < b; n++) r[n] = { x: 0, y: 0, @@ -9942,8 +9942,8 @@ ATOM`, h); }; let a = new Array(20), h; for (n = 0; n < 20; n++) - a[n] = new Array(L.length); - for (n = 0, b = L.length; n < b; n++) + a[n] = new Array(C.length); + for (n = 0, b = C.length; n < b; n++) a[0][n] = 0; for (n = 0, b = D.length / 3; n < b; n++) { let S = n * 3, T = n * 3 + 1, R = n * 3 + 2; @@ -9980,37 +9980,37 @@ ATOM`, h); h && (a[0][D[R]]++, a[a[0][D[R]]][D[R]] = D[T]); } let M = 1, w = 0.5; - for (t = 0; t < C; t++) { - for (n = 0, b = L.length; n < b; n++) + for (t = 0; t < L; t++) { + for (n = 0, b = C.length; n < b; n++) if (a[0][n] < 3) - r[n].x = L[n].x, r[n].y = L[n].y, r[n].z = L[n].z; + r[n].x = C[n].x, r[n].y = C[n].y, r[n].z = C[n].z; else if (a[0][n] == 3 || a[0][n] == 4) { for (r[n].x = 0, r[n].y = 0, r[n].z = 0, f = 0, c = a[0][n]; f < c; f++) - r[n].x += L[a[f + 1][n]].x, r[n].y += L[a[f + 1][n]].y, r[n].z += L[a[f + 1][n]].z; - r[n].x += w * L[n].x, r[n].y += w * L[n].y, r[n].z += w * L[n].z, r[n].x /= w + a[0][n], r[n].y /= w + a[0][n], r[n].z /= w + a[0][n]; + r[n].x += C[a[f + 1][n]].x, r[n].y += C[a[f + 1][n]].y, r[n].z += C[a[f + 1][n]].z; + r[n].x += w * C[n].x, r[n].y += w * C[n].y, r[n].z += w * C[n].z, r[n].x /= w + a[0][n], r[n].y /= w + a[0][n], r[n].z /= w + a[0][n]; } else { for (r[n].x = 0, r[n].y = 0, r[n].z = 0, f = 0, c = a[0][n]; f < c; f++) - r[n].x += L[a[f + 1][n]].x, r[n].y += L[a[f + 1][n]].y, r[n].z += L[a[f + 1][n]].z; - r[n].x += M * L[n].x, r[n].y += M * L[n].y, r[n].z += M * L[n].z, r[n].x /= M + a[0][n], r[n].y /= M + a[0][n], r[n].z /= M + a[0][n]; + r[n].x += C[a[f + 1][n]].x, r[n].y += C[a[f + 1][n]].y, r[n].z += C[a[f + 1][n]].z; + r[n].x += M * C[n].x, r[n].y += M * C[n].y, r[n].z += M * C[n].z, r[n].x /= M + a[0][n], r[n].y /= M + a[0][n], r[n].z /= M + a[0][n]; } - for (n = 0, b = L.length; n < b; n++) - L[n].x = r[n].x, L[n].y = r[n].y, L[n].z = r[n].z; + for (n = 0, b = C.length; n < b; n++) + C[n].x = r[n].x, C[n].y = r[n].y, C[n].z = r[n].z; } } } - let p = new o(); + let g = new o(); class E { - constructor(C, L, D) { - this.data = new Int32Array(C * L * D * 3), this.width = L, this.height = D; + constructor(L, C, D) { + this.data = new Int32Array(L * C * D * 3), this.width = C, this.height = D; } // set position x,y,z to pt, which has ix,iy,and iz - set(C, L, D, r) { - let n = ((C * this.width + L) * this.height + D) * 3; + set(L, C, D, r) { + let n = ((L * this.width + C) * this.height + D) * 3; this.data[n] = r.ix, this.data[n + 1] = r.iy, this.data[n + 2] = r.iz; } // return point at x,y,z - get(C, L, D) { - let r = ((C * this.width + L) * this.height + D) * 3; + get(L, C, D) { + let r = ((L * this.width + C) * this.height + D) * 3; return { ix: this.data[r], iy: this.data[r + 1], @@ -10067,38 +10067,38 @@ ATOM`, h); new Int32Array([-1, -1, -1]) ], u.MarchingCube || (u.MarchingCube = new o()); } - getVDWIndex(C) { - return !C.elem || typeof this.vdwRadii[C.elem] > "u" ? "X" : C.elem; + getVDWIndex(L) { + return !L.elem || typeof this.vdwRadii[L.elem] > "u" ? "X" : L.elem; } - getFacesAndVertices(C) { - let L = {}; - for (let n = 0, b = C.length; n < b; n++) - L[C[n]] = !0; + getFacesAndVertices(L) { + let C = {}; + for (let n = 0, b = L.length; n < b; n++) + C[L[n]] = !0; let D = this.verts; for (let n = 0, b = D.length; n < b; n++) D[n].x = D[n].x / this.scaleFactor - this.ptranx, D[n].y = D[n].y / this.scaleFactor - this.ptrany, D[n].z = D[n].z / this.scaleFactor - this.ptranz; let r = []; for (let n = 0, b = this.faces.length; n < b; n += 3) { let f = this.faces[n], c = this.faces[n + 1], t = this.faces[n + 2], a = D[f].atomid, h = D[c].atomid, M = D[t].atomid, w = a; - h < w && (w = h), M < w && (w = M), L[w] && f !== c && c !== t && f !== t && (r.push(f), r.push(c), r.push(t)); + h < w && (w = h), M < w && (w = M), C[w] && f !== c && c !== t && f !== t && (r.push(f), r.push(c), r.push(t)); } return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, { vertices: D, faces: r }; } - initparm(C, L, D) { + initparm(L, C, D) { D > 1e6 && (this.scaleFactor = this.defaultScaleFactor / 2); let r = 1 / this.scaleFactor * 5.5; - this.pminx = C[0][0], this.pmaxx = C[1][0], this.pminy = C[0][1], this.pmaxy = C[1][1], this.pminz = C[0][2], this.pmaxz = C[1][2], L ? (this.pminx -= this.probeRadius + r, this.pminy -= this.probeRadius + r, this.pminz -= this.probeRadius + r, this.pmaxx += this.probeRadius + r, this.pmaxy += this.probeRadius + r, this.pmaxz += this.probeRadius + r) : (this.pminx -= r, this.pminy -= r, this.pminz -= r, this.pmaxx += r, this.pmaxy += r, this.pmaxz += r), 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(L), 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); + this.pminx = L[0][0], this.pmaxx = L[1][0], this.pminy = L[0][1], this.pmaxy = L[1][1], this.pminz = L[0][2], this.pmaxz = L[1][2], C ? (this.pminx -= this.probeRadius + r, this.pminy -= this.probeRadius + r, this.pminz -= this.probeRadius + r, this.pmaxx += this.probeRadius + r, this.pmaxy += this.probeRadius + r, this.pmaxz += this.probeRadius + r) : (this.pminx -= r, this.pminy -= r, this.pminz -= r, this.pmaxx += r, this.pmaxy += r, this.pmaxz += r), 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(C), 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(C) { - let L = {}; + boundingatom(L) { + let C = {}; for (const D in this.vdwRadii) { let r = this.vdwRadii[D]; - C ? L[D] = (r + this.probeRadius) * this.scaleFactor + 0.5 : L[D] = r * this.scaleFactor + 0.5; - let n = L[D] * L[D]; - this.widxz[D] = Math.floor(L[D]) + 1, this.depty[D] = new Int32Array(this.widxz[D] * this.widxz[D]); + L ? C[D] = (r + this.probeRadius) * this.scaleFactor + 0.5 : C[D] = r * this.scaleFactor + 0.5; + let n = C[D] * C[D]; + this.widxz[D] = Math.floor(C[D]) + 1, this.depty[D] = new Int32Array(this.widxz[D] * this.widxz[D]); let b = 0; for (let f = 0; f < this.widxz[D]; f++) for (let c = 0; c < this.widxz[D]; c++) { @@ -10113,18 +10113,18 @@ ATOM`, h); } } } - fillvoxels(C, L) { + fillvoxels(L, C) { for (let D = 0, r = this.vpBits.length; D < r; D++) this.vpBits[D] = 0, this.vpDistance[D] = -1, this.vpAtomID[D] = -1; - for (let D in L) { - let r = C[L[D]]; - r !== void 0 && this.fillAtom(r, C); + for (let D in C) { + let r = L[C[D]]; + r !== void 0 && this.fillAtom(r, L); } for (let D = 0, r = this.vpBits.length; D < r; D++) this.vpBits[D] & this.INOUT && (this.vpBits[D] |= this.ISDONE); } - fillAtom(C, L) { - let D = Math.floor(0.5 + this.scaleFactor * (C.x + this.ptranx)), r = Math.floor(0.5 + this.scaleFactor * (C.y + this.ptrany)), n = Math.floor(0.5 + this.scaleFactor * (C.z + this.ptranz)), b = this.getVDWIndex(C), f = 0, c = this.pWidth * this.pHeight; + fillAtom(L, C) { + let D = Math.floor(0.5 + this.scaleFactor * (L.x + this.ptranx)), r = Math.floor(0.5 + this.scaleFactor * (L.y + this.ptrany)), n = Math.floor(0.5 + this.scaleFactor * (L.z + this.ptranz)), b = this.getVDWIndex(L), f = 0, c = this.pWidth * this.pHeight; for (let t = 0, a = this.widxz[b]; t < a; t++) for (let h = 0; h < a; h++) { if (this.depty[b][f] != -1) { @@ -10133,18 +10133,18 @@ ATOM`, h); for (let S = -1; S < 2; S++) if (M !== 0 && w !== 0 && S !== 0) { let T = M * t, R = S * h; - for (let z = 0; z <= this.depty[b][f]; z++) { - let P = z * w, B = D + T, U = r + P, F = n + R; - if (B < 0 || U < 0 || F < 0 || B >= this.pLength || U >= this.pWidth || F >= this.pHeight) + for (let $ = 0; $ <= this.depty[b][f]; $++) { + let P = $ * w, B = D + T, F = r + P, U = n + R; + if (B < 0 || F < 0 || U < 0 || B >= this.pLength || F >= this.pWidth || U >= this.pHeight) continue; - let $ = B * c + U * this.pHeight + F; - if (!(this.vpBits[$] & this.INOUT)) - this.vpBits[$] |= this.INOUT, this.vpAtomID[$] = C.serial; + let z = B * c + F * this.pHeight + U; + if (!(this.vpBits[z] & this.INOUT)) + this.vpBits[z] |= this.INOUT, this.vpAtomID[z] = L.serial; else { - let W = L[this.vpAtomID[$]]; - if (W.serial != C.serial) { - let N = D + T - Math.floor(0.5 + this.scaleFactor * (W.x + this.ptranx)), G = r + P - Math.floor(0.5 + this.scaleFactor * (W.y + this.ptrany)), k = n + R - Math.floor(0.5 + this.scaleFactor * (W.z + this.ptranz)); - T * T + P * P + R * R < N * N + G * G + k * k && (this.vpAtomID[$] = C.serial); + let W = C[this.vpAtomID[z]]; + if (W.serial != L.serial) { + let V = D + T - Math.floor(0.5 + this.scaleFactor * (W.x + this.ptranx)), N = r + P - Math.floor(0.5 + this.scaleFactor * (W.y + this.ptrany)), k = n + R - Math.floor(0.5 + this.scaleFactor * (W.z + this.ptranz)); + T * T + P * P + R * R < V * V + N * N + k * k && (this.vpAtomID[z] = L.serial); } } } @@ -10153,16 +10153,16 @@ ATOM`, h); f++; } } - fillvoxelswaals(C, L) { + fillvoxelswaals(L, C) { for (let D = 0, r = this.vpBits.length; D < r; D++) this.vpBits[D] &= ~this.ISDONE; - for (let D in L) { - let r = C[L[D]]; - r !== void 0 && this.fillAtomWaals(r, C); + for (let D in C) { + let r = L[C[D]]; + r !== void 0 && this.fillAtomWaals(r, L); } } - fillAtomWaals(C, L) { - let D = 0, r = Math.floor(0.5 + this.scaleFactor * (C.x + this.ptranx)), n = Math.floor(0.5 + this.scaleFactor * (C.y + this.ptrany)), b = Math.floor(0.5 + this.scaleFactor * (C.z + this.ptranz)), f = this.getVDWIndex(C), c = this.pWidth * this.pHeight; + fillAtomWaals(L, C) { + let D = 0, r = Math.floor(0.5 + this.scaleFactor * (L.x + this.ptranx)), n = Math.floor(0.5 + this.scaleFactor * (L.y + this.ptrany)), b = Math.floor(0.5 + this.scaleFactor * (L.z + this.ptranz)), f = this.getVDWIndex(L), c = this.pWidth * this.pHeight; for (let t = 0, a = this.widxz[f]; t < a; t++) for (let h = 0; h < a; h++) { if (this.depty[f][D] != -1) { @@ -10171,18 +10171,18 @@ ATOM`, h); for (let S = -1; S < 2; S++) if (M !== 0 && w !== 0 && S !== 0) { let T = M * t, R = S * h; - for (let z = 0; z <= this.depty[f][D]; z++) { - let P = z * w, B = r + T, U = n + P, F = b + R; - if (B < 0 || U < 0 || F < 0 || B >= this.pLength || U >= this.pWidth || F >= this.pHeight) + for (let $ = 0; $ <= this.depty[f][D]; $++) { + let P = $ * w, B = r + T, F = n + P, U = b + R; + if (B < 0 || F < 0 || U < 0 || B >= this.pLength || F >= this.pWidth || U >= this.pHeight) continue; - let $ = B * c + U * this.pHeight + F; - if (!(this.vpBits[$] & this.ISDONE)) - this.vpBits[$] |= this.ISDONE, this.vpAtomID[$] = C.serial; + let z = B * c + F * this.pHeight + U; + if (!(this.vpBits[z] & this.ISDONE)) + this.vpBits[z] |= this.ISDONE, this.vpAtomID[z] = L.serial; else { - let W = L[this.vpAtomID[$]]; - if (W.serial != C.serial) { - let N = r + T - Math.floor(0.5 + this.scaleFactor * (W.x + this.ptranx)), G = n + P - Math.floor(0.5 + this.scaleFactor * (W.y + this.ptrany)), k = b + R - Math.floor(0.5 + this.scaleFactor * (W.z + this.ptranz)); - T * T + P * P + R * R < N * N + G * G + k * k && (this.vpAtomID[$] = C.serial); + let W = C[this.vpAtomID[z]]; + if (W.serial != L.serial) { + let V = r + T - Math.floor(0.5 + this.scaleFactor * (W.x + this.ptranx)), N = n + P - Math.floor(0.5 + this.scaleFactor * (W.y + this.ptrany)), k = b + R - Math.floor(0.5 + this.scaleFactor * (W.z + this.ptranz)); + T * T + P * P + R * R < V * V + N * N + k * k && (this.vpAtomID[z] = L.serial); } } } @@ -10192,16 +10192,16 @@ ATOM`, h); } } buildboundary() { - let C = this.pWidth * this.pHeight; - for (let L = 0; L < this.pLength; L++) + let L = this.pWidth * this.pHeight; + for (let C = 0; C < this.pLength; C++) for (let D = 0; D < this.pHeight; D++) for (let r = 0; r < this.pWidth; r++) { - let n = L * C + r * this.pHeight + D; + let n = C * L + r * this.pHeight + D; if (this.vpBits[n] & this.INOUT) { let b = 0; for (; b < 26; ) { - let f = L + this.nb[b][0], c = D + this.nb[b][2], t = r + this.nb[b][1]; - if (f > -1 && f < this.pLength && t > -1 && t < this.pWidth && c > -1 && c < this.pHeight && !(this.vpBits[f * C + t * this.pHeight + c] & this.INOUT)) { + let f = C + this.nb[b][0], c = D + this.nb[b][2], t = r + this.nb[b][1]; + if (f > -1 && f < this.pLength && t > -1 && t < this.pWidth && c > -1 && c < this.pHeight && !(this.vpBits[f * L + t * this.pHeight + c] & this.INOUT)) { this.vpBits[n] |= this.ISBOUND; break; } else @@ -10211,79 +10211,79 @@ ATOM`, h); } } fastdistancemap() { - let C = new E(this.pLength, this.pWidth, this.pHeight), L = this.pWidth * this.pHeight, D = this.cutRadius * this.cutRadius, r = [], n = [], b; + let L = new E(this.pLength, this.pWidth, this.pHeight), C = this.pWidth * this.pHeight, D = this.cutRadius * this.cutRadius, r = [], n = [], b; for (let t = 0; t < this.pLength; t++) for (let a = 0; a < this.pWidth; a++) for (let h = 0; h < this.pHeight; h++) - if (b = t * L + a * this.pHeight + h, this.vpBits[b] &= ~this.ISDONE, this.vpBits[b] & this.INOUT && this.vpBits[b] & this.ISBOUND) { + if (b = t * C + a * this.pHeight + h, this.vpBits[b] &= ~this.ISDONE, this.vpBits[b] & this.INOUT && this.vpBits[b] & this.ISBOUND) { let M = { ix: t, iy: a, iz: h }; - C.set(t, a, h, M), r.push(M), this.vpDistance[b] = 0, this.vpBits[b] |= this.ISDONE, this.vpBits[b] &= ~this.ISBOUND; + L.set(t, a, h, M), r.push(M), this.vpDistance[b] = 0, this.vpBits[b] |= this.ISDONE, this.vpBits[b] &= ~this.ISBOUND; } do { - n = this.fastoneshell(r, C), r = []; + n = this.fastoneshell(r, L), r = []; for (let t = 0, a = n.length; t < a; t++) - b = L * n[t].ix + this.pHeight * n[t].iy + n[t].iz, this.vpBits[b] &= ~this.ISBOUND, this.vpDistance[b] <= 1.0404 * D && r.push({ + b = C * n[t].ix + this.pHeight * n[t].iy + n[t].iz, this.vpBits[b] &= ~this.ISBOUND, this.vpDistance[b] <= 1.0404 * D && r.push({ ix: n[t].ix, iy: n[t].iy, iz: n[t].iz }); } while (r.length !== 0); - r = [], n = [], C = null; + r = [], n = [], L = null; let f = this.scaleFactor - 0.5; f < 0 && (f = 0); let c = D - 0.5 / (0.1 + f); for (let t = 0; t < this.pLength; t++) for (let a = 0; a < this.pWidth; a++) for (let h = 0; h < this.pHeight; h++) - b = t * L + a * this.pHeight + h, this.vpBits[b] &= ~this.ISBOUND, this.vpBits[b] & this.INOUT && (!(this.vpBits[b] & this.ISDONE) || this.vpBits[b] & this.ISDONE && this.vpDistance[b] >= c) && (this.vpBits[b] |= this.ISBOUND); + b = t * C + a * this.pHeight + h, this.vpBits[b] &= ~this.ISBOUND, this.vpBits[b] & this.INOUT && (!(this.vpBits[b] & this.ISDONE) || this.vpBits[b] & this.ISDONE && this.vpDistance[b] >= c) && (this.vpBits[b] |= this.ISBOUND); } - fastoneshell(C, L) { + fastoneshell(L, C) { let D, r, n, b, f, c, t, a, h, M = []; - if (C.length === 0) + if (L.length === 0) return M; let w = { ix: -1, iy: -1, iz: -1 }, S = this.pWidth * this.pHeight; - for (let T = 0, R = C.length; T < R; T++) { - D = C[T].ix, r = C[T].iy, n = C[T].iz, a = L.get(D, r, n); - for (let z = 0; z < 6; z++) - w.ix = D + this.nb[z][0], w.iy = r + this.nb[z][1], w.iz = n + this.nb[z][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (L.set(w.ix, w.iy, n + this.nb[z][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ + for (let T = 0, R = L.length; T < R; T++) { + D = L[T].ix, r = L[T].iy, n = L[T].iz, a = C.get(D, r, n); + for (let $ = 0; $ < 6; $++) + w.ix = D + this.nb[$][0], w.iy = r + this.nb[$][1], w.iz = n + this.nb[$][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (C.set(w.ix, w.iy, n + this.nb[$][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (L.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ + })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (C.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz }))))); } - for (let T = 0, R = C.length; T < R; T++) { - D = C[T].ix, r = C[T].iy, n = C[T].iz, a = L.get(D, r, n); - for (let z = 6; z < 18; z++) - w.ix = D + this.nb[z][0], w.iy = r + this.nb[z][1], w.iz = n + this.nb[z][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (L.set(w.ix, w.iy, n + this.nb[z][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ + for (let T = 0, R = L.length; T < R; T++) { + D = L[T].ix, r = L[T].iy, n = L[T].iz, a = C.get(D, r, n); + for (let $ = 6; $ < 18; $++) + w.ix = D + this.nb[$][0], w.iy = r + this.nb[$][1], w.iz = n + this.nb[$][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (C.set(w.ix, w.iy, n + this.nb[$][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (L.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ + })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (C.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz }))))); } - for (let T = 0, R = C.length; T < R; T++) { - D = C[T].ix, r = C[T].iy, n = C[T].iz, a = L.get(D, r, n); - for (let z = 18; z < 26; z++) - w.ix = D + this.nb[z][0], w.iy = r + this.nb[z][1], w.iz = n + this.nb[z][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (L.set(w.ix, w.iy, n + this.nb[z][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ + for (let T = 0, R = L.length; T < R; T++) { + D = L[T].ix, r = L[T].iy, n = L[T].iz, a = C.get(D, r, n); + for (let $ = 18; $ < 26; $++) + w.ix = D + this.nb[$][0], w.iy = r + this.nb[$][1], w.iz = n + this.nb[$][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (h = w.ix * S + this.pHeight * w.iy + w.iz, this.vpBits[h] & this.INOUT && !(this.vpBits[h] & this.ISDONE) ? (C.set(w.ix, w.iy, n + this.nb[$][2], a), b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, this.vpDistance[h] = t, this.vpBits[h] |= this.ISDONE, this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (L.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ + })) : this.vpBits[h] & this.INOUT && this.vpBits[h] & this.ISDONE && (b = w.ix - a.ix, f = w.iy - a.iy, c = w.iz - a.iz, t = b * b + f * f + c * c, t < this.vpDistance[h] && (C.set(w.ix, w.iy, w.iz, a), this.vpDistance[h] = t, this.vpBits[h] & this.ISBOUND || (this.vpBits[h] |= this.ISBOUND, M.push({ ix: w.ix, iy: w.iy, iz: w.iz @@ -10291,20 +10291,20 @@ ATOM`, h); } return M; } - marchingcubeinit(C) { - for (let L = 0, D = this.vpBits.length; L < D; L++) - C == 1 ? this.vpBits[L] &= ~this.ISBOUND : C == 4 ? (this.vpBits[L] &= ~this.ISDONE, this.vpBits[L] & this.ISBOUND && (this.vpBits[L] |= this.ISDONE), this.vpBits[L] &= ~this.ISBOUND) : C == 2 ? this.vpBits[L] & this.ISBOUND && this.vpBits[L] & this.ISDONE ? this.vpBits[L] &= ~this.ISBOUND : this.vpBits[L] & this.ISBOUND && !(this.vpBits[L] & this.ISDONE) && (this.vpBits[L] |= this.ISDONE) : C == 3 && (this.vpBits[L] &= ~this.ISBOUND); + marchingcubeinit(L) { + for (let C = 0, D = this.vpBits.length; C < D; C++) + L == 1 ? this.vpBits[C] &= ~this.ISBOUND : L == 4 ? (this.vpBits[C] &= ~this.ISDONE, this.vpBits[C] & this.ISBOUND && (this.vpBits[C] |= this.ISDONE), this.vpBits[C] &= ~this.ISBOUND) : L == 2 ? this.vpBits[C] & this.ISBOUND && this.vpBits[C] & this.ISDONE ? this.vpBits[C] &= ~this.ISBOUND : this.vpBits[C] & this.ISBOUND && !(this.vpBits[C] & this.ISDONE) && (this.vpBits[C] |= this.ISDONE) : L == 3 && (this.vpBits[C] &= ~this.ISBOUND); } - marchingcube(C) { - this.marchingcubeinit(C), this.verts = [], this.faces = [], u.MarchingCube.march(this.vpBits, this.verts, this.faces, { + marchingcube(L) { + this.marchingcubeinit(L), this.verts = [], this.faces = [], u.MarchingCube.march(this.vpBits, this.verts, this.faces, { smooth: 1, nX: this.pLength, nY: this.pWidth, nZ: this.pHeight }); - let L = this.pWidth * this.pHeight; + let C = this.pWidth * this.pHeight; for (let D = 0, r = this.verts.length; D < r; D++) - this.verts[D].atomid = this.vpAtomID[this.verts[D].x * L + this.pHeight * this.verts[D].y + this.verts[D].z]; + this.verts[D].atomid = this.vpAtomID[this.verts[D].x * C + this.pHeight * this.verts[D].y + this.verts[D].z]; u.MarchingCube.laplacianSmooth(1, this.verts, this.faces); } } @@ -10322,14 +10322,14 @@ ATOM`, h); /* harmony export */ VolumeData: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ./utilities */ "./src/utilities.ts" - ), g = e( + ), p = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), _ = e( @@ -10342,8 +10342,8 @@ ATOM`, h); /*! pako */ "./node_modules/pako/dist/pako.esm.mjs" ); - class p { - constructor(u, A, C) { + class g { + constructor(u, A, L) { if (this.unit = { x: 1, y: 1, @@ -10367,30 +10367,30 @@ ATOM`, h); } var a = 1.889725992, h = 0.036749309, M = parseFloat(f[1]), w; w = f[2].replace(/^\s+/, "").split(/\s+/); - var S = new g.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a); + var S = new p.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a); w = f[3].replace(/^\s+/, "").split(/\s+/); - var T = new g.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a); + var T = new p.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a); w = f[4].replace(/^\s+/, "").split(/\s+/); - var R = new g.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a), z = S.x * (T.y * R.z - R.y * T.z) - T.x * (S.y * R.z - R.y * S.z) + R.x * (S.y * T.z - T.y * S.z); - z = Math.abs(z) / Math.pow(a, 3); - var P = 1 / z; + var R = new p.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(M * a), $ = S.x * (T.y * R.z - R.y * T.z) - T.x * (S.y * R.z - R.y * S.z) + R.x * (S.y * T.z - T.y * S.z); + $ = Math.abs($) / Math.pow(a, 3); + var P = 1 / $; f.splice(0, 8 + t + 1); - var B = f[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), U = Math.abs(parseFloat(B[0])), F = Math.abs(parseFloat(B[1])), $ = Math.abs(parseFloat(B[2])), W = this.origin = new g.Vector3(0, 0, 0); - this.size = { x: U, y: F, z: $ }, this.unit = new g.Vector3(S.x, T.y, R.z), S = S.multiplyScalar(1 / (a * U)), T = T.multiplyScalar(1 / (a * F)), R = R.multiplyScalar(1 / (a * $)), (S.y != 0 || S.z != 0 || T.x != 0 || T.z != 0 || R.x != 0 || R.y != 0) && (this.matrix = new g.Matrix4(S.x, T.x, R.x, 0, S.y, T.y, R.y, 0, S.z, T.z, R.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new g.Matrix4().makeTranslation(W.x, W.y, W.z)), this.origin = new g.Vector3(0, 0, 0), this.unit = new g.Vector3(1, 1, 1)), f.splice(0, 1); - var N = f.join(" "); - N = N.replace(/^\s+/, ""); - var G = N.split(/[\s\r]+/); - G.splice(U * F * $ + 1); - for (var k = Float32Array.from(G, parseFloat), j = 0; j < k.length; j++) - k[j] = k[j] * P * h; + var B = f[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), F = Math.abs(parseFloat(B[0])), U = Math.abs(parseFloat(B[1])), z = Math.abs(parseFloat(B[2])), W = this.origin = new p.Vector3(0, 0, 0); + this.size = { x: F, y: U, z }, this.unit = new p.Vector3(S.x, T.y, R.z), S = S.multiplyScalar(1 / (a * F)), T = T.multiplyScalar(1 / (a * U)), R = R.multiplyScalar(1 / (a * z)), (S.y != 0 || S.z != 0 || T.x != 0 || T.z != 0 || R.x != 0 || R.y != 0) && (this.matrix = new p.Matrix4(S.x, T.x, R.x, 0, S.y, T.y, R.y, 0, S.z, T.z, R.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new p.Matrix4().makeTranslation(W.x, W.y, W.z)), this.origin = new p.Vector3(0, 0, 0), this.unit = new p.Vector3(1, 1, 1)), f.splice(0, 1); + var V = f.join(" "); + V = V.replace(/^\s+/, ""); + var N = V.split(/[\s\r]+/); + N.splice(F * U * z + 1); + for (var k = Float32Array.from(N, parseFloat), G = 0; G < k.length; G++) + k[G] = k[G] * P * h; this.data = k; }, this.dx = function(b) { var f = b.split(/[\n\r]+/), c, t = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, a = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, h = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, M = /data follows/, w = 0; for (w = 0; w < f.length; w++) { var S = f[w]; if (c = t.exec(S)) { - var T = parseInt(c[1]), R = parseInt(c[2]), z = parseInt(c[3]); - this.size = { x: T, y: R, z }; + var T = parseInt(c[1]), R = parseInt(c[2]), $ = parseInt(c[3]); + this.size = { x: T, y: R, z: $ }; } else if (c = h.exec(S)) { var P = parseFloat(c[1]); if ((parseFloat(c[2]) != 0 || parseFloat(c[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, S = f[w], c = h.exec(S), c == null) { @@ -10402,11 +10402,11 @@ ATOM`, h); console.log("Parse error in dx delta matrix"); return; } - var U = parseFloat(c[3]); - (parseFloat(c[1]) != 0 || parseFloat(c[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new g.Vector3(P, B, U); + var F = parseFloat(c[3]); + (parseFloat(c[1]) != 0 || parseFloat(c[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new p.Vector3(P, B, F); } else if (c = a.exec(S)) { - var F = parseFloat(c[1]), $ = parseFloat(c[2]), W = parseFloat(c[3]); - this.origin = new g.Vector3(F, $, W); + var U = parseFloat(c[1]), z = parseFloat(c[2]), W = parseFloat(c[3]); + this.origin = new p.Vector3(U, z, W); } else if (c = M.exec(S)) break; } @@ -10414,8 +10414,8 @@ ATOM`, h); console.log("Error parsing dx format"); return; } - var N = f.splice(w).join(" "), G = N.split(/[\s\r]+/); - this.data = Float32Array.from(G, parseFloat); + var V = f.splice(w).join(" "), N = V.split(/[\s\r]+/); + this.data = Float32Array.from(N, parseFloat); }, A = A.toLowerCase(), /\.gz$/.test(A)) { A = A.replace(/\.gz$/, ""); try { @@ -10424,21 +10424,21 @@ ATOM`, h); console.log(b); } } - if (this[A] && (this.isbinary.has(A) && typeof u == "string" && (u = (0, l.base64ToArray)(u)), this[A](u)), C) { - if (C.negate) + if (this[A] && (this.isbinary.has(A) && typeof u == "string" && (u = (0, l.base64ToArray)(u)), this[A](u)), L) { + if (L.negate) for (let b = 0, f = this.data.length; b < f; b++) this.data[b] = -this.data[b]; - if (C.normalize) { - var L = 0; + if (L.normalize) { + var C = 0; for (let b = 0, f = this.data.length; b < f; b++) - L += this.data[b]; - var D = L / this.data.length; - L = 0; + C += this.data[b]; + var D = C / this.data.length; + C = 0; for (let b = 0, f = this.data.length; b < f; b++) { var r = this.data[b] - D; - L += r * r; + C += r * r; } - var n = L / this.data.length; + var n = C / this.data.length; for (let b = 0, f = this.data.length; b < f; b++) this.data[b] = (this.data[b] - D) / n; } @@ -10449,30 +10449,30 @@ ATOM`, h); * @param {number} x,y,z - the coordinates * @returns - index into flat array closest to provided coordinate; -1 if invalid */ - getIndex(u, A, C) { + getIndex(u, A, L) { if (this.matrix) { - this.inversematrix == null && (this.inversematrix = new g.Matrix4().getInverse(this.matrix)); - var L = new g.Vector3(u, A, C); - L = L.applyMatrix4(this.inversematrix), u = L.x, A = L.y, C = L.z; + this.inversematrix == null && (this.inversematrix = new p.Matrix4().getInverse(this.matrix)); + var C = new p.Vector3(u, A, L); + C = C.applyMatrix4(this.inversematrix), u = C.x, A = C.y, L = C.z; } else - u -= this.origin.x, A -= this.origin.y, C -= this.origin.z, u /= this.unit.x, A /= this.unit.y, C /= this.unit.z; - return u = Math.round(u), A = Math.round(A), C = Math.round(C), u < 0 || u >= this.size.x || A < 0 || A >= this.size.y || C < 0 || C >= this.size.z ? -1 : u * this.size.y * this.size.z + A * this.size.z + C; + u -= this.origin.x, A -= this.origin.y, L -= this.origin.z, u /= this.unit.x, A /= this.unit.y, L /= this.unit.z; + return u = Math.round(u), A = Math.round(A), L = Math.round(L), u < 0 || u >= this.size.x || A < 0 || A >= this.size.y || L < 0 || L >= this.size.z ? -1 : u * this.size.y * this.size.z + A * this.size.z + L; } /** * @function $3Dmol.VolumeData.getVal * @param {number} x,y,z - the coordinates * @returns - value closest to provided coordinate; zero if coordinate invalid */ - getVal(u, A, C) { - let L = this.getIndex(u, A, C); - return L < 0 ? 0 : this.data[L]; + getVal(u, A, L) { + let C = this.getIndex(u, A, L); + return C < 0 ? 0 : this.data[C]; } // parse cube data cube(u) { var A = u.split(/\r?\n/); if (!(A.length < 6)) { - var C = (0, x.CUBE)(u, {}).modelData[0].cryst, L = A[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), D = parseFloat(L[0]), r = Math.abs(D); - this.origin = C.origin, this.size = C.size, this.unit = C.unit, this.matrix = C.matrix4; + var L = (0, x.CUBE)(u, {}).modelData[0].cryst, C = A[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), D = parseFloat(C[0]), r = Math.abs(D); + this.origin = L.origin, this.size = L.size, this.unit = L.unit, this.matrix = L.matrix4; var n = 6; D < 0 && n++; var b = A.splice(r + n).join(" "); @@ -10485,11 +10485,11 @@ ATOM`, h); ccp4(u) { var A = {}; u = new Int8Array(u); - var C = new Int32Array(u.buffer, 0, 56), L = new Float32Array(u.buffer, 0, 56), D = new DataView(u.buffer); + var L = new Int32Array(u.buffer, 0, 56), C = new Float32Array(u.buffer, 0, 56), D = new DataView(u.buffer); if (A.MAP = String.fromCharCode(D.getUint8(208), D.getUint8(209), D.getUint8(210), D.getUint8(211)), A.MACHST = [D.getUint8(212), D.getUint8(213)], A.MACHST[0] === 17 && A.MACHST[1] === 17) for (var r = u.byteLength, n = 0; n < r; n += 4) D.setFloat32(n, D.getFloat32(n), !0); - A.NX = C[0], A.NY = C[1], A.NZ = C[2], A.MODE = C[3], A.NXSTART = C[4], A.NYSTART = C[5], A.NZSTART = C[6], A.MX = C[7], A.MY = C[8], A.MZ = C[9], A.xlen = L[10], A.ylen = L[11], A.zlen = L[12], A.alpha = L[13], A.beta = L[14], A.gamma = L[15], A.MAPC = C[16], A.MAPR = C[17], A.MAPS = C[18], A.DMIN = L[19], A.DMAX = L[20], A.DMEAN = L[21], A.ISPG = C[22], A.NSYMBT = C[23], A.LSKFLG = C[24], A.originX = L[49], A.originY = L[50], A.originZ = L[51], A.ARMS = L[54]; + A.NX = L[0], A.NY = L[1], A.NZ = L[2], A.MODE = L[3], A.NXSTART = L[4], A.NYSTART = L[5], A.NZSTART = L[6], A.MX = L[7], A.MY = L[8], A.MZ = L[9], A.xlen = C[10], A.ylen = C[11], A.zlen = C[12], A.alpha = C[13], A.beta = C[14], A.gamma = C[15], A.MAPC = L[16], A.MAPR = L[17], A.MAPS = L[18], A.DMIN = C[19], A.DMAX = C[20], A.DMEAN = C[21], A.ISPG = L[22], A.NSYMBT = L[23], A.LSKFLG = L[24], A.originX = C[49], A.originY = C[50], A.originZ = C[51], A.ARMS = C[54]; var b = A, f = [ b.xlen, 0, @@ -10505,13 +10505,13 @@ ATOM`, h); ]; t[2] = Math.sqrt(b.zlen * b.zlen * Math.sin(Math.PI / 180 * b.beta) * Math.sin(Math.PI / 180 * b.beta) - t[1] * t[1]); var a = [0, f, c, t], h = [0, b.MX, b.MY, b.MZ], M = [0, b.MAPC, b.MAPR, b.MAPS]; - this.matrix = new g.Matrix4(), this.matrix.set(a[M[1]][0] / h[M[1]], a[M[2]][0] / h[M[2]], a[M[3]][0] / h[M[3]], 0, a[M[1]][1] / h[M[1]], a[M[2]][1] / h[M[2]], a[M[3]][1] / h[M[3]], 0, a[M[1]][2] / h[M[1]], a[M[2]][2] / h[M[2]], a[M[3]][2] / h[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new g.Matrix4().makeTranslation(b.NXSTART + b.originX, b.NYSTART + b.originY, b.NZSTART + b.originZ)), this.origin = new g.Vector3(0, 0, 0), this.unit = new g.Vector3(1, 1, 1), this.size = { x: A.NX, y: A.NY, z: A.NZ }, this.dimensionorder = [A.MAPC, A.MAPR, A.MAPS]; + this.matrix = new p.Matrix4(), this.matrix.set(a[M[1]][0] / h[M[1]], a[M[2]][0] / h[M[2]], a[M[3]][0] / h[M[3]], 0, a[M[1]][1] / h[M[1]], a[M[2]][1] / h[M[2]], a[M[3]][1] / h[M[3]], 0, a[M[1]][2] / h[M[1]], a[M[2]][2] / h[M[2]], a[M[3]][2] / h[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new p.Matrix4().makeTranslation(b.NXSTART + b.originX, b.NYSTART + b.originY, b.NZSTART + b.originZ)), this.origin = new p.Vector3(0, 0, 0), this.unit = new p.Vector3(1, 1, 1), this.size = { x: A.NX, y: A.NY, z: A.NZ }, this.dimensionorder = [A.MAPC, A.MAPR, A.MAPS]; var w = new Float32Array(u.buffer, 1024 + A.NSYMBT), S = A.NX, T = A.NY, R = A.NZ; this.data = new Float32Array(S * T * R); - for (let z = 0; z < S; z++) + for (let $ = 0; $ < S; $++) for (let P = 0; P < T; P++) for (let B = 0; B < R; B++) - this.data[(z * T + P) * R + B] = w[(B * T + P) * S + z]; + this.data[($ * T + P) * R + B] = w[(B * T + P) * S + $]; } } } @@ -10527,14 +10527,14 @@ ATOM`, h); /* harmony export */ GLVolumetricRender: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), g = e( + ), p = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), _ = e( @@ -10547,45 +10547,45 @@ ATOM`, h); /*! ./GLShape */ "./src/GLShape.ts" ); - class p { + class g { static interpolateArray(u, A) { - function C(t, a, h) { + function L(t, a, h) { return t + (a - t) * h; } - var L = [], D = (u.length - 1) / (A - 1); - L[0] = u[0]; + var C = [], D = (u.length - 1) / (A - 1); + C[0] = u[0]; for (var r = 1; r < A - 1; r++) { var n = r * D, b = Math.floor(n), f = Math.ceil(n), c = n - b; - L[r] = C(u[b], u[f], c); + C[r] = L(u[b], u[f], c); } - return L[A - 1] = u[u.length - 1], L; + return C[A - 1] = u[u.length - 1], C; } constructor(u, A) { this.hidden = !1, this.boundingSphere = new l.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, A = A || {}; - var C = Object.assign([], A.transferfn); + var L = Object.assign([], A.transferfn); this.subsamples = A.subsamples || 5; - let L = 256; - C.forEach(function(S) { + let C = 256; + L.forEach(function(S) { S.value = parseFloat(S.value); - }), C.sort(function(S, T) { + }), L.sort(function(S, T) { return S.value - T.value; - }), this.min = C[0].value, C.length == 0 && C.push(C[0]), this.max = C[C.length - 1].value; + }), this.min = L[0].value, L.length == 0 && L.push(L[0]), this.max = L[L.length - 1].value; var D, r, n, b, f, c, t, a, h, M; - for (let S = 0; S < C.length - 1; S++) - if (n = x.CC.color(C[S].color), b = x.CC.color(C[S + 1].color), h = C[S].opacity, M = C[S + 1].opacity, D = Math.floor((C[S].value - this.min) * L / (this.max - this.min)), r = Math.floor((C[S + 1].value - this.min) * L / (this.max - this.min)), D != r) { - f = p.interpolateArray([n.r * 255, b.r * 255], r - D), c = p.interpolateArray([n.g * 255, b.g * 255], r - D), t = p.interpolateArray([n.b * 255, b.b * 255], r - D), a = p.interpolateArray([h * 255, M * 255], r - D); + for (let S = 0; S < L.length - 1; S++) + if (n = x.CC.color(L[S].color), b = x.CC.color(L[S + 1].color), h = L[S].opacity, M = L[S + 1].opacity, D = Math.floor((L[S].value - this.min) * C / (this.max - this.min)), r = Math.floor((L[S + 1].value - this.min) * C / (this.max - this.min)), D != r) { + f = g.interpolateArray([n.r * 255, b.r * 255], r - D), c = g.interpolateArray([n.g * 255, b.g * 255], r - D), t = g.interpolateArray([n.b * 255, b.b * 255], r - D), a = g.interpolateArray([h * 255, M * 255], r - D); for (let T = 0; T < f.length; T++) this.transferfunctionbuffer.push(f[T]), this.transferfunctionbuffer.push(c[T]), this.transferfunctionbuffer.push(t[T]), this.transferfunctionbuffer.push(a[T]); } if (this.transferfunctionbuffer = new Uint8ClampedArray(this.transferfunctionbuffer), u.matrix) { - let S = new g.Vector3(0, 0, 0), T = new g.Vector3(u.size.x, u.size.y, u.size.z), R = new g.Vector3(1, 1, 1); + let S = new p.Vector3(0, 0, 0), T = new p.Vector3(u.size.x, u.size.y, u.size.z), R = new p.Vector3(1, 1, 1); S.applyMatrix4(u.matrix), T.applyMatrix4(u.matrix), R.applyMatrix4(u.matrix).sub(S), this.extent = [[S.x, S.y, S.z], [T.x, T.y, T.z]]; - for (let U = 1; U < 7; U++) - T.x = U & 1 ? u.size.x : 0, T.y = U & 2 ? u.size.y : 0, T.z = U & 4 ? u.size.z : 0, T.applyMatrix4(u.matrix), this.extent[0][0] = Math.min(this.extent[0][0], T.x), this.extent[0][1] = Math.min(this.extent[0][1], T.y), this.extent[0][2] = Math.min(this.extent[0][2], T.z), this.extent[1][0] = Math.max(this.extent[1][0], T.x), this.extent[1][1] = Math.max(this.extent[1][1], T.y), this.extent[1][2] = Math.max(this.extent[1][2], T.z); - let z = T.x - S.x, P = T.y - S.y, B = T.z - S.z; - this.maxdepth = Math.sqrt(z * z + P * P + B * B), this.minunit = Math.min(Math.min(R.x, R.y), R.z), this.texmatrix = new g.Matrix4().identity().scale({ x: u.size.x, y: u.size.y, z: u.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(u.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); + for (let F = 1; F < 7; F++) + T.x = F & 1 ? u.size.x : 0, T.y = F & 2 ? u.size.y : 0, T.z = F & 4 ? u.size.z : 0, T.applyMatrix4(u.matrix), this.extent[0][0] = Math.min(this.extent[0][0], T.x), this.extent[0][1] = Math.min(this.extent[0][1], T.y), this.extent[0][2] = Math.min(this.extent[0][2], T.z), this.extent[1][0] = Math.max(this.extent[1][0], T.x), this.extent[1][1] = Math.max(this.extent[1][1], T.y), this.extent[1][2] = Math.max(this.extent[1][2], T.z); + let $ = T.x - S.x, P = T.y - S.y, B = T.z - S.z; + this.maxdepth = Math.sqrt($ * $ + P * P + B * B), this.minunit = Math.min(Math.min(R.x, R.y), R.z), this.texmatrix = new p.Matrix4().identity().scale({ x: u.size.x, y: u.size.y, z: u.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(u.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); } else { - this.texmatrix = new g.Matrix4().identity(); + this.texmatrix = new p.Matrix4().identity(); let S = u.unit.x * u.size.x, T = u.unit.y * u.size.y, R = u.unit.z * u.size.z; this.texmatrix.makeTranslation(-u.origin.x / S, -u.origin.y / T, -u.origin.z / R), this.texmatrix.scale({ x: 1 / S, y: 1 / T, z: 1 / R }), this.minunit = Math.min(Math.min(u.unit.x, u.unit.y), u.unit.z), this.extent = [ [u.origin.x, u.origin.y, u.origin.z], @@ -10600,20 +10600,20 @@ ATOM`, h); h: this.extent[1][1] - this.extent[0][1], d: this.extent[1][2] - this.extent[0][2] } - }), this.geo = w.finalize(), this.boundingSphere.center = new g.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, A.coords !== void 0 && A.seldist !== void 0) { + }), this.geo = w.finalize(), this.boundingSphere.center = new p.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, A.coords !== void 0 && A.seldist !== void 0) { let S = new Uint8Array(u.data.length), T = A.seldist, R = T * T; - for (let z = 0, P = A.coords.length; z < P; z++) { - let B = A.coords[z], U = B.x - T, F = B.y - T, $ = B.z - T, W = B.x + T, N = B.y + T, G = B.z + T; - if (u.getIndex(U, F, $) >= 0 || u.getIndex(W, N, G) >= 0) - for (let k = U; k < W; k += this.minunit) - for (let j = F; j < N; j += this.minunit) - for (let Q = $; Q < G; Q += this.minunit) { - let ie = u.getIndex(k, j, Q); - ie >= 0 && !S[ie] && (k - B.x) * (k - B.x) + (j - B.y) * (j - B.y) + (Q - B.z) * (Q - B.z) < R && (S[ie] = 1); + for (let $ = 0, P = A.coords.length; $ < P; $++) { + let B = A.coords[$], F = B.x - T, U = B.y - T, z = B.z - T, W = B.x + T, V = B.y + T, N = B.z + T; + if (u.getIndex(F, U, z) >= 0 || u.getIndex(W, V, N) >= 0) + for (let k = F; k < W; k += this.minunit) + for (let G = U; G < V; G += this.minunit) + for (let Q = z; Q < N; Q += this.minunit) { + let ie = u.getIndex(k, G, Q); + ie >= 0 && !S[ie] && (k - B.x) * (k - B.x) + (G - B.y) * (G - B.y) + (Q - B.z) * (Q - B.z) < R && (S[ie] = 1); } } - for (let z = 0, P = u.data.length; z < P; z++) - S[z] == 0 && (u.data[z] = 1 / 0); + for (let $ = 0, P = u.data.length; $ < P; $++) + S[$] == 0 && (u.data[$] = 1 / 0); } this.data = u; } @@ -10625,12 +10625,12 @@ ATOM`, h); globj(u) { if (this.renderedShapeObj && (u.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { this.shapeObj = new _.Object3D(); - var A = null, C = new _.Texture(this.data, !0), L = new _.Texture(this.transferfunctionbuffer, !1); - C.needsUpdate = !0, L.needsUpdate = !0, L.flipY = !1, A = new _.VolumetricMaterial({ - transferfn: L, + var A = null, L = new _.Texture(this.data, !0), C = new _.Texture(this.transferfunctionbuffer, !1); + L.needsUpdate = !0, C.needsUpdate = !0, C.flipY = !1, A = new _.VolumetricMaterial({ + transferfn: C, transfermin: this.min, transfermax: this.max, - map: C, + map: L, extent: this.extent, maxdepth: this.maxdepth, texmatrix: this.texmatrix, @@ -10677,18 +10677,18 @@ ATOM`, h); var l = e( /*! ./core */ "./src/WebGL/core/index.ts" - ), g = e( + ), p = e( /*! ./math */ "./src/WebGL/math/index.ts" ); class _ extends l.Object3D { - constructor(o = 50, p = 1, E = 0.1, u = 2e3, A = !1) { - super(), this.projectionMatrix = new g.Matrix4(), this.projectionMatrixInverse = new g.Matrix4(), this.matrixWorldInverse = new g.Matrix4(), this.fov = o, this.aspect = p, this.near = E, this.far = u; - var C = this.position.z; - this.right = C * Math.tan(Math.PI / 180 * o), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!A, this.updateProjectionMatrix(); + constructor(o = 50, g = 1, E = 0.1, u = 2e3, A = !1) { + super(), this.projectionMatrix = new p.Matrix4(), this.projectionMatrixInverse = new p.Matrix4(), this.matrixWorldInverse = new p.Matrix4(), this.fov = o, this.aspect = g, this.near = E, this.far = u; + var L = this.position.z; + this.right = L * Math.tan(Math.PI / 180 * o), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!A, this.updateProjectionMatrix(); } lookAt(o) { - this.matrix.lookAt(this.position, o, this.up), this.rotationAutoUpdate && (this.useQuaternion === !1 && this.rotation instanceof g.Vector3 ? this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder) : console.error("Unimplemented math operation.")); + this.matrix.lookAt(this.position, o, this.up), this.rotationAutoUpdate && (this.useQuaternion === !1 && this.rotation instanceof p.Vector3 ? this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder) : console.error("Unimplemented math operation.")); } updateProjectionMatrix() { this.ortho ? this.projectionMatrix.makeOrthographic(this.left, this.right, this.top, this.bottom, this.near, this.far) : this.projectionMatrix.makePerspective(this.fov, this.aspect, this.near, this.far), this.projectionMatrixInverse.getInverse(this.projectionMatrix); @@ -10707,7 +10707,7 @@ ATOM`, h); /* harmony export */ Fog: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -10715,12 +10715,12 @@ ATOM`, h); /*! ../colors */ "./src/colors.ts" ); - class g { - constructor(x, o = 1, p = 1e3) { - this.name = "", this.color = new l.Color(x), this.near = o, this.far = p; + class p { + constructor(x, o = 1, g = 1e3) { + this.name = "", this.color = new l.Color(x), this.near = o, this.far = g; } clone() { - return new g(this.color.getHex(), this.near, this.far); + return new p(this.color.getHex(), this.near, this.far); } } } @@ -10736,14 +10736,14 @@ ATOM`, h); /* harmony export */ Renderer: () => ( /* binding */ - L + C ) /* harmony export */ }); var l = e( /*! ./Camera */ "./src/WebGL/Camera.ts" - ), g = e( + ), p = e( /*! ./constants/Sides */ "./src/WebGL/constants/Sides.ts" ), _ = e( @@ -10755,7 +10755,7 @@ ATOM`, h); ), o = e( /*! ../colors */ "./src/colors.ts" - ), p = e( + ), g = e( /*! ./materials */ "./src/WebGL/materials/index.ts" ), E = e( @@ -10767,11 +10767,11 @@ ATOM`, h); ), A = e( /*! ./shaders */ "./src/WebGL/shaders/index.ts" - ), C = e( + ), L = e( /*! ./SpritePlugin */ "./src/WebGL/SpritePlugin.ts" ); - class L { + class C { constructor(r) { 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: { @@ -10813,7 +10813,7 @@ ATOM`, h); groundColors: [], positions: [] } - }, this.sprites = new C.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, r = r || {}, this.row = r.row, this.col = r.col, this.rows = r.rows, this.cols = r.cols, this._canvas = r.canvas !== void 0 ? r.canvas : document.createElement("canvas"), this._precision = r.precision !== void 0 ? r.precision : "highp", this._alpha = r.alpha !== void 0 ? r.alpha : !0, this._premultipliedAlpha = r.premultipliedAlpha !== void 0 ? r.premultipliedAlpha : !0, this._antialias = r.antialias !== void 0 ? r.antialias : !1, this._stencil = r.stencil !== void 0 ? r.stencil : !0, this._preserveDrawingBuffer = r.preserveDrawingBuffer !== void 0 ? r.preserveDrawingBuffer : !1, this._clearColor = r.clearColor !== void 0 ? new o.Color(r.clearColor) : new o.Color(0), this._clearAlpha = r.clearAlpha !== void 0 ? r.clearAlpha : 0, this._outlineMaterial = new p.MeshOutlineMaterial(r.outline), this._outlineSphereImposterMaterial = new p.SphereImposterOutlineMaterial(r.outline), this._outlineStickImposterMaterial = new p.StickImposterOutlineMaterial(r.outline), this._outlineEnabled = !!r.outline, this.domElement = this._canvas, this._canvas.id = r.id, this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = { + }, this.sprites = new L.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, r = r || {}, this.row = r.row, this.col = r.col, this.rows = r.rows, this.cols = r.cols, this._canvas = r.canvas !== void 0 ? r.canvas : document.createElement("canvas"), this._precision = r.precision !== void 0 ? r.precision : "highp", this._alpha = r.alpha !== void 0 ? r.alpha : !0, this._premultipliedAlpha = r.premultipliedAlpha !== void 0 ? r.premultipliedAlpha : !0, this._antialias = r.antialias !== void 0 ? r.antialias : !1, this._stencil = r.stencil !== void 0 ? r.stencil : !0, this._preserveDrawingBuffer = r.preserveDrawingBuffer !== void 0 ? r.preserveDrawingBuffer : !1, this._clearColor = r.clearColor !== void 0 ? new o.Color(r.clearColor) : new o.Color(0), this._clearAlpha = r.clearAlpha !== void 0 ? r.clearAlpha : 0, this._outlineMaterial = new g.MeshOutlineMaterial(r.outline), this._outlineSphereImposterMaterial = new g.SphereImposterOutlineMaterial(r.outline), this._outlineStickImposterMaterial = new g.StickImposterOutlineMaterial(r.outline), this._outlineEnabled = !!r.outline, this.domElement = this._canvas, this._canvas.id = r.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); @@ -10842,7 +10842,7 @@ ATOM`, h); this._clearColor.setHex(r), this._clearAlpha = n, this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } enableOutline(r) { - this._outlineMaterial = new p.MeshOutlineMaterial(r), this._outlineSphereImposterMaterial = new p.SphereImposterOutlineMaterial(r), this._outlineStickImposterMaterial = new p.StickImposterOutlineMaterial(r), this._outlineEnabled = !0; + this._outlineMaterial = new g.MeshOutlineMaterial(r), this._outlineSphereImposterMaterial = new g.SphereImposterOutlineMaterial(r), this._outlineStickImposterMaterial = new g.StickImposterOutlineMaterial(r), this._outlineEnabled = !0; } disableOutline() { this._outlineEnabled = !1; @@ -10869,7 +10869,7 @@ ATOM`, h); this.clear(r, n, b); } setMaterialFaces(r, n) { - var b = r.side === g.DoubleSide, f = r.side === g.BackSide; + var b = r.side === p.DoubleSide, f = r.side === p.BackSide; r.imposter || (f = n ? !f : f), this._oldDoubleSided !== b && (b ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = b), this._oldFlipSided !== f && (f ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = f), this._gl.cullFace(this._gl.BACK); } setDepthTest(r) { @@ -10908,8 +10908,8 @@ ATOM`, h); var T, R; if (t instanceof u.Mesh) { if (f.shaderID === "instanced") { - var z = f.sphere.geometryGroups[0]; - M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, z.faceArray, this._gl.STATIC_DRAW)), T = z.faceidx, this._extInstanced.vertexAttribDivisorANGLE(h.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(h.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(h.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, T, this._gl.UNSIGNED_SHORT, 0, c.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(h.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(h.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(h.color, 0); + var $ = f.sphere.geometryGroups[0]; + M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, $.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, $.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, $.faceArray, this._gl.STATIC_DRAW)), T = $.faceidx, this._extInstanced.vertexAttribDivisorANGLE(h.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(h.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(h.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, T, this._gl.UNSIGNED_SHORT, 0, c.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(h.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(h.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(h.color, 0); } else f.wireframe ? (R = c.lineidx, this.setLineWidth(f.wireframeLinewidth), M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, R, this._gl.UNSIGNED_SHORT, 0)) : (T = c.faceidx, M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, T, this._gl.UNSIGNED_SHORT, 0)); this.info.render.calls++, this.info.render.vertices += T, this.info.render.faces += T / 3; @@ -11102,37 +11102,37 @@ ATOM`, h); f.volumetric ? "#version 300 es" : "", T ].join(` -`), z = [ +`), $ = [ f.volumetric ? "#version 300 es" : "", f.fragdepth && this.isWebGL1() ? "#extension GL_EXT_frag_depth: enable" : "", f.wireframe ? "#define WIREFRAME 1" : "", T ].join(` -`), P = this.getShader("fragment", z + r), B = this.getShader("vertex", R + n); +`), P = this.getShader("fragment", $ + r), B = this.getShader("vertex", R + n); B != null && this._gl.attachShader(a, B), P != null && this._gl.attachShader(a, P), this._gl.linkProgram(a), this._gl.getProgramParameter(a, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), a.uniforms = {}, a.attributes = {}; - var U, F, $; - U = [ + var F, U, z; + F = [ "viewMatrix", "modelViewMatrix", "projectionMatrix", "normalMatrix" ]; - for (F in b) - U.push(F); - for ($ = 0; $ < U.length; $++) { - var W = U[$]; + for (U in b) + F.push(U); + for (z = 0; z < F.length; z++) { + var W = F[z]; a.uniforms[W] = this._gl.getUniformLocation(a, W); } - for (U = [ + for (F = [ "position", "normal", "color", "lineDistance", "offset", "radius" - ], $ = 0; $ < U.length; $++) { - var N = U[$]; - a.attributes[N] = this._gl.getAttribLocation(a, N); + ], z = 0; z < F.length; z++) { + var V = F[z]; + a.attributes[V] = this._gl.getAttribLocation(a, V); } return a.id = this._programs_counter++, this._programs.push({ program: a, @@ -11256,14 +11256,14 @@ ATOM`, h); return r === _.UnsignedByteType ? this._gl.UNSIGNED_BYTE : r === _.RGBAFormat ? this._gl.RGBA : r === _.NearestFilter ? this._gl.NEAREST : 0; } setupLights(r, n) { - var b, f, c, t = 0, a = 0, h = 0, M, w, S = this._lights, T = S.directional.colors, R = S.directional.positions, z = 0, P = 0; + var b, f, c, t = 0, a = 0, h = 0, M, w, S = this._lights, T = S.directional.colors, R = S.directional.positions, $ = 0, P = 0; for (b = 0, f = n.length; b < f; b++) if (c = n[b], M = c.color, w = c.intensity, c instanceof x.Light) { if (this._direction.getPositionFromMatrix(c.matrixWorld), this._vector3.getPositionFromMatrix(c.target.matrixWorld), this._direction.sub(this._vector3), this._direction.normalize(), this._direction.x === 0 && this._direction.y === 0 && this._direction.z === 0) continue; - R[P] = this._direction.x, R[P + 1] = this._direction.y, R[P + 2] = this._direction.z, T[P] = M.r * w, T[P + 1] = M.g * w, T[P + 2] = M.b * w, P += 3, z++; + R[P] = this._direction.x, R[P + 1] = this._direction.y, R[P + 2] = this._direction.z, T[P] = M.r * w, T[P + 1] = M.g * w, T[P + 2] = M.b * w, P += 3, $++; } - S.ambient[0] = t, S.ambient[1] = a, S.ambient[2] = h, S.directional.length = z; + S.ambient[0] = t, S.ambient[1] = a, S.ambient[2] = h, S.directional.length = $; } initGL() { try { @@ -11301,15 +11301,15 @@ ATOM`, h); } // rendering renderObjects(r, n, b, f, c, t, a, T) { - var M, w, S, T, R, z, P; - n ? (R = r.length - 1, z = -1, P = -1) : (R = 0, z = r.length, P = 1); - for (var B = R; B !== z; B += P) + var M, w, S, T, R, $, P; + n ? (R = r.length - 1, $ = -1, P = -1) : (R = 0, $ = r.length, P = 1); + for (var B = R; B !== $; B += P) if (M = r[B], M.render) { if (w = M.object, S = M.buffer, T = M[b], !T) continue; a && this.setBlending(!0), this.setDepthTest(T.depthTest), this.setDepthWrite(T.depthWrite), this.setPolygonOffset(T.polygonOffset, T.polygonOffsetFactor, T.polygonOffsetUnits); - var U = w._modelViewMatrix.isReflected(); - this.setMaterialFaces(T, U), this.renderBuffer(f, c, t, T, S, w), (this._outlineEnabled || T.outline) && (T.shaderID == "sphereimposter" ? this.renderBuffer(f, c, t, this._outlineSphereImposterMaterial, S, w) : T.shaderID == "stickimposter" ? this.renderBuffer(f, c, t, this._outlineStickImposterMaterial, S, w) : !T.wireframe && T.shaderID !== "basic" && T.opacity !== 0 && this.renderBuffer(f, c, t, this._outlineMaterial, S, w)); + var F = w._modelViewMatrix.isReflected(); + this.setMaterialFaces(T, F), this.renderBuffer(f, c, t, T, S, w), (this._outlineEnabled || T.outline) && (T.shaderID == "sphereimposter" ? this.renderBuffer(f, c, t, this._outlineSphereImposterMaterial, S, w) : T.shaderID == "stickimposter" ? this.renderBuffer(f, c, t, this._outlineStickImposterMaterial, S, w) : !T.wireframe && T.shaderID !== "basic" && T.opacity !== 0 && this.renderBuffer(f, c, t, this._outlineMaterial, S, w)); } } renderSprites(r, n, b) { @@ -11329,7 +11329,7 @@ ATOM`, h); /* harmony export */ SpritePlugin: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -11337,7 +11337,7 @@ ATOM`, h); /*! ./shaders/index */ "./src/WebGL/shaders/index.ts" ); - class g { + class p { constructor() { this.sprite = { vertices: null, @@ -11351,8 +11351,8 @@ ATOM`, h); } init(o) { this.gl = o.context, this.renderer = o, this.precision = o.getPrecision(), this.sprite.vertices = new Float32Array(16), this.sprite.faces = new Uint16Array(6); - var p = 0; - this.sprite.vertices[p++] = -1, this.sprite.vertices[p++] = -1, this.sprite.vertices[p++] = 0, this.sprite.vertices[p++] = 0, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = -1, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = 0, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = -1, this.sprite.vertices[p++] = 1, this.sprite.vertices[p++] = 0, this.sprite.vertices[p++] = 1, p = 0, this.sprite.faces[p++] = 0, this.sprite.faces[p++] = 1, this.sprite.faces[p++] = 2, this.sprite.faces[p++] = 0, this.sprite.faces[p++] = 2, this.sprite.faces[p++] = 3, this.sprite.vertexBuffer = this.gl.createBuffer(), this.sprite.elementBuffer = this.gl.createBuffer(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.sprite.vertices, this.gl.STATIC_DRAW), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.faces, this.gl.STATIC_DRAW), this.sprite.program = this.createProgram( + var g = 0; + this.sprite.vertices[g++] = -1, this.sprite.vertices[g++] = -1, this.sprite.vertices[g++] = 0, this.sprite.vertices[g++] = 0, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = -1, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = 0, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = -1, this.sprite.vertices[g++] = 1, this.sprite.vertices[g++] = 0, this.sprite.vertices[g++] = 1, g = 0, this.sprite.faces[g++] = 0, this.sprite.faces[g++] = 1, this.sprite.faces[g++] = 2, this.sprite.faces[g++] = 0, this.sprite.faces[g++] = 2, this.sprite.faces[g++] = 3, this.sprite.vertexBuffer = this.gl.createBuffer(), this.sprite.elementBuffer = this.gl.createBuffer(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.sprite.vertices, this.gl.STATIC_DRAW), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.faces, this.gl.STATIC_DRAW), this.sprite.program = this.createProgram( l.ShaderLib.sprite, this.precision || 1 /** added default to single precision */ @@ -11360,12 +11360,12 @@ ATOM`, h); 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(o, p, E, u, A) { - var C, L, D, r, n, b, f, c, t, a; + render(o, g, E, u, A) { + var L, C, D, r, n, b, f, c, t, a; if (!this.gl) throw new Error("WebGLRenderer not initialized"); let h = []; - (C = o == null ? void 0 : o.__webglSprites) === null || C === void 0 || C.forEach((Q) => { + (L = o == null ? void 0 : o.__webglSprites) === null || L === void 0 || L.forEach((Q) => { (A && Q.material.depthTest == !1 || !A && Q.material.depthTest) && h.push(Q); }); let M = h.length; @@ -11375,24 +11375,24 @@ ATOM`, h); if (!S) throw new Error("Uniforms not defined"); var T = E * 0.5, R = u * 0.5; - this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(w.position), this.gl.enableVertexAttribArray(w.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(w.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(w.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(S.projectionMatrix, !1, p.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(S.map, 0); - var z = 0, P = 0, B = o.fog; - B ? (this.gl.uniform3f(S.fogColor, B.color.r, B.color.g, B.color.b), this.gl.uniform1f(S.fogNear, B.near), this.gl.uniform1f(S.fogFar, B.far), this.gl.uniform1i(S.fogType, 1), z = 1, P = 1) : (this.gl.uniform1i(S.fogType, 0), z = 0, P = 0); - var U; - let F, $, W, N, G = []; - for (U = 0; U < M; U++) - F = h[U], $ = F.material, $ && ($.depthTest == !1 && !A || !F.visible || $.opacity === 0 || ($.useScreenCoordinates ? F.z = -F.position.z : (F._modelViewMatrix.multiplyMatrices(p.matrixWorldInverse, F.matrixWorld), F.z = -F._modelViewMatrix.elements[14]))); - for (h.sort(_), U = 0; U < M; U++) - if (F = h[U], $ = F.material, !!$ && !(!F.visible || $.opacity === 0) && $.map && $.map.image && $.map.image.width) { - this.gl.uniform1f((S == null ? void 0 : S.alphaTest) || null, $.alphaTest); - var k = $.map.image.width, j = $.map.image.height; - G[0] = k * this.renderer.devicePixelRatio / E, G[1] = j * this.renderer.devicePixelRatio / u, $.useScreenCoordinates === !0 ? (this.gl.uniform1i(S.useScreenCoordinates, 1), this.gl.uniform3f(S.screenPosition, (F.position.x * this.renderer.devicePixelRatio - T) / T, (R - F.position.y * this.renderer.devicePixelRatio) / R, Math.max(0, Math.min(1, F.position.z)))) : (this.gl.uniform1i(S.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(S.modelViewMatrix, !1, F._modelViewMatrix.elements)), o.fog && $.fog ? N = P : N = 0, z !== N && (this.gl.uniform1i(S.fogType, N), z = N), W = 1 / ($.scaleByViewport ? u : 1), G[0] *= W * F.scale.x, G[1] *= W * F.scale.y; - let Q = (L = $ == null ? void 0 : $.alignment) === null || L === void 0 ? void 0 : L.x, ie = (D = $ == null ? void 0 : $.alignment) === null || D === void 0 ? void 0 : D.y; - $.screenOffset && (Q = (Q || 0) + 2 * $.screenOffset.x / k, ie = (ie || 0) + 2 * $.screenOffset.y / j), this.gl.uniform2f(S.uvScale, ((r = $ == null ? void 0 : $.uvScale) === null || r === void 0 ? void 0 : r.x) || 1, ((n = $ == null ? void 0 : $.uvScale) === null || n === void 0 ? void 0 : n.y) || 1), this.gl.uniform2f(S.uvOffset, ((b = $ == null ? void 0 : $.uvOffset) === null || b === void 0 ? void 0 : b.x) || 0, ((f = $ == null ? void 0 : $.uvOffset) === null || f === void 0 ? void 0 : f.y) || 0), this.gl.uniform2f(S.alignment, Q || 0, ie || 0), this.gl.uniform1f(S.opacity, $.opacity), this.gl.uniform3f(S.color, ((c = $ == null ? void 0 : $.color) === null || c === void 0 ? void 0 : c.r) || 0, ((t = $ == null ? void 0 : $.color) === null || t === void 0 ? void 0 : t.g) || 0, ((a = $ == null ? void 0 : $.color) === null || a === void 0 ? void 0 : a.b) || 0), this.gl.uniform1f(S.rotation, F.rotation), this.gl.uniform2fv(S.scale, G), 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); + this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(w.position), this.gl.enableVertexAttribArray(w.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(w.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(w.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(S.projectionMatrix, !1, g.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(S.map, 0); + var $ = 0, P = 0, B = o.fog; + B ? (this.gl.uniform3f(S.fogColor, B.color.r, B.color.g, B.color.b), this.gl.uniform1f(S.fogNear, B.near), this.gl.uniform1f(S.fogFar, B.far), this.gl.uniform1i(S.fogType, 1), $ = 1, P = 1) : (this.gl.uniform1i(S.fogType, 0), $ = 0, P = 0); + var F; + let U, z, W, V, N = []; + for (F = 0; F < M; F++) + U = h[F], z = U.material, z && (z.depthTest == !1 && !A || !U.visible || z.opacity === 0 || (z.useScreenCoordinates ? U.z = -U.position.z : (U._modelViewMatrix.multiplyMatrices(g.matrixWorldInverse, U.matrixWorld), U.z = -U._modelViewMatrix.elements[14]))); + for (h.sort(_), F = 0; F < M; F++) + if (U = h[F], z = U.material, !!z && !(!U.visible || z.opacity === 0) && z.map && z.map.image && z.map.image.width) { + this.gl.uniform1f((S == null ? void 0 : S.alphaTest) || null, z.alphaTest); + var k = z.map.image.width, G = z.map.image.height; + N[0] = k * this.renderer.devicePixelRatio / E, N[1] = G * this.renderer.devicePixelRatio / u, z.useScreenCoordinates === !0 ? (this.gl.uniform1i(S.useScreenCoordinates, 1), this.gl.uniform3f(S.screenPosition, (U.position.x * this.renderer.devicePixelRatio - T) / T, (R - U.position.y * this.renderer.devicePixelRatio) / R, Math.max(0, Math.min(1, U.position.z)))) : (this.gl.uniform1i(S.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(S.modelViewMatrix, !1, U._modelViewMatrix.elements)), o.fog && z.fog ? V = P : V = 0, $ !== V && (this.gl.uniform1i(S.fogType, V), $ = V), W = 1 / (z.scaleByViewport ? u : 1), N[0] *= W * U.scale.x, N[1] *= W * U.scale.y; + let Q = (C = z == null ? void 0 : z.alignment) === null || C === void 0 ? void 0 : C.x, ie = (D = z == null ? void 0 : z.alignment) === null || D === void 0 ? void 0 : D.y; + z.screenOffset && (Q = (Q || 0) + 2 * z.screenOffset.x / k, ie = (ie || 0) + 2 * z.screenOffset.y / G), this.gl.uniform2f(S.uvScale, ((r = z == null ? void 0 : z.uvScale) === null || r === void 0 ? void 0 : r.x) || 1, ((n = z == null ? void 0 : z.uvScale) === null || n === void 0 ? void 0 : n.y) || 1), this.gl.uniform2f(S.uvOffset, ((b = z == null ? void 0 : z.uvOffset) === null || b === void 0 ? void 0 : b.x) || 0, ((f = z == null ? void 0 : z.uvOffset) === null || f === void 0 ? void 0 : f.y) || 0), this.gl.uniform2f(S.alignment, Q || 0, ie || 0), this.gl.uniform1f(S.opacity, z.opacity), this.gl.uniform3f(S.color, ((c = z == null ? void 0 : z.color) === null || c === void 0 ? void 0 : c.r) || 0, ((t = z == null ? void 0 : z.color) === null || t === void 0 ? void 0 : t.g) || 0, ((a = z == null ? void 0 : z.color) === null || a === void 0 ? void 0 : a.b) || 0), this.gl.uniform1f(S.rotation, U.rotation), this.gl.uniform2fv(S.scale, N), this.renderer.setDepthTest(z.depthTest), this.renderer.setDepthWrite(z.depthWrite), this.renderer.setTexture(z.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); } this.gl.enable(this.gl.CULL_FACE); } - createProgram(o, p) { + createProgram(o, g) { if (!this.gl) throw new Error("WebGL Rendering context not found"); var E = this.gl.createProgram(); @@ -11403,9 +11403,9 @@ ATOM`, h); throw new Error("Unable to create fragment shader SpritePlugin.createProgram"); if (!A) throw new Error("Unable to create vertex shader SpritePlugin.createProgram"); - var C = "precision " + p + ` float; + var L = "precision " + g + ` float; `; - if (this.gl.shaderSource(u, C + o.fragmentShader), this.gl.shaderSource(A, C + o.vertexShader), this.gl.compileShader(u), this.gl.compileShader(A), !this.gl.getShaderParameter(u, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(A, this.gl.COMPILE_STATUS)) + if (this.gl.shaderSource(u, L + o.fragmentShader), this.gl.shaderSource(A, L + o.vertexShader), this.gl.compileShader(u), this.gl.compileShader(A), !this.gl.getShaderParameter(u, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(A, this.gl.COMPILE_STATUS)) throw new Error(`Error compiling shader: ${this.gl.getShaderInfoLog(u)} ${this.gl.getShaderInfoLog(A)}`); @@ -11433,8 +11433,8 @@ ATOM`, h); /* harmony export */ }); var l; - (function(g) { - g[g.NoColors = 0] = "NoColors", g[g.FaceColors = 1] = "FaceColors", g[g.VertexColors = 2] = "VertexColors"; + (function(p) { + p[p.NoColors = 0] = "NoColors", p[p.FaceColors = 1] = "FaceColors", p[p.VertexColors = 2] = "VertexColors"; })(l || (l = {})); } ), @@ -11454,8 +11454,8 @@ ATOM`, h); /* harmony export */ }); var l; - (function(g) { - g[g.NoShading = 0] = "NoShading", g[g.FlatShading = 1] = "FlatShading", g[g.SmoothShading = 2] = "SmoothShading"; + (function(p) { + p[p.NoShading = 0] = "NoShading", p[p.FlatShading = 1] = "FlatShading", p[p.SmoothShading = 2] = "SmoothShading"; })(l || (l = {})); } ), @@ -11470,7 +11470,7 @@ ATOM`, h); /* harmony export */ BackSide: () => ( /* binding */ - g + p ), /* harmony export */ DoubleSide: () => ( @@ -11484,7 +11484,7 @@ ATOM`, h); ) /* harmony export */ }); - const l = 0, g = 1, _ = 2; + const l = 0, p = 1, _ = 2; } ), /***/ @@ -11498,7 +11498,7 @@ ATOM`, h); /* harmony export */ SpriteAlignment: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -11506,7 +11506,7 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - const g = { + const p = { topLeft: new l.Vector2(1, -1), topCenter: new l.Vector2(0, -1), topRight: new l.Vector2(-1, -1), @@ -11535,12 +11535,12 @@ ATOM`, h); /* harmony export */ FloatType: () => ( /* binding */ - p + g ), /* harmony export */ LinearFilter: () => ( /* binding */ - g + p ), /* harmony export */ LinearMipMapLinearFilter: () => ( @@ -11574,7 +11574,7 @@ ATOM`, h); ) /* harmony export */ }); - const l = 1001, g = 1006, _ = 1007, x = 1008, o = 1009, p = 1010, E = 1021, u = 1022, A = 1023; + const l = 1001, p = 1006, _ = 1007, x = 1008, o = 1009, g = 1010, E = 1021, u = 1022, A = 1023; } ), /***/ @@ -11593,8 +11593,8 @@ ATOM`, h); /* harmony export */ }); var l; - (function(g) { - g[g.MultiplyOperation = 0] = "MultiplyOperation", g[g.MixOperation = 1] = "MixOperation", g[g.AddOperation = 2] = "AddOperation"; + (function(p) { + p[p.MultiplyOperation = 0] = "MultiplyOperation", p[p.MixOperation = 1] = "MixOperation", p[p.AddOperation = 2] = "AddOperation"; })(l || (l = {})); } ), @@ -11609,7 +11609,7 @@ ATOM`, h); /* harmony export */ BackSide: () => ( /* reexport safe */ - g.BackSide + p.BackSide ), /* harmony export */ ClampToEdgeWrapping: () => ( @@ -11624,7 +11624,7 @@ ATOM`, h); /* harmony export */ DoubleSide: () => ( /* reexport safe */ - g.DoubleSide + p.DoubleSide ), /* harmony export */ FloatType: () => ( @@ -11634,7 +11634,7 @@ ATOM`, h); /* harmony export */ FrontSide: () => ( /* reexport safe */ - g.FrontSide + p.FrontSide ), /* harmony export */ LinearFilter: () => ( @@ -11679,7 +11679,7 @@ ATOM`, h); /* harmony export */ TextureOperations: () => ( /* reexport safe */ - p.TextureOperations + g.TextureOperations ), /* harmony export */ UnsignedByteType: () => ( @@ -11691,7 +11691,7 @@ ATOM`, h); var l = e( /*! ./Coloring */ "./src/WebGL/constants/Coloring.ts" - ), g = e( + ), p = e( /*! ./Sides */ "./src/WebGL/constants/Sides.ts" ), _ = e( @@ -11703,7 +11703,7 @@ ATOM`, h); ), o = e( /*! ./TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), p = e( + ), g = e( /*! ./TextureOperations */ "./src/WebGL/constants/TextureOperations.ts" ); @@ -11732,7 +11732,7 @@ ATOM`, h); var x = this.listeners[_.type]; if (x !== void 0) { _.target = this; - for (var o = 0, p = x.length; o < p; o++) + for (var o = 0, g = x.length; o < g; o++) x[o].call(this, _); } } @@ -11766,7 +11766,7 @@ ATOM`, h); /* harmony export */ GeometryGroup: () => ( /* binding */ - p + g ), /* harmony export */ GeometryIDCount: () => ( @@ -11778,7 +11778,7 @@ ATOM`, h); var l = e( /*! ../materials/LineBasicMaterial */ "./src/WebGL/materials/LineBasicMaterial.ts" - ), g = e( + ), p = e( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" ), _ = e( @@ -11789,22 +11789,22 @@ ATOM`, h); "./src/colors.ts" ); const o = 65535; - class p { - constructor(C = 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 = C; + class g { + constructor(L = 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 = L; } - setColors(C) { - var L = this.vertexArray, D = this.colorArray; - if (!L) + setColors(L) { + var C = this.vertexArray, D = this.colorArray; + if (!C) throw new Error("vertex array not initialized"); if (!D) throw new Error("color array not initialized"); - if (L.length != D.length) { + if (C.length != D.length) { console.log("Cannot re-color geometry group due to mismatched lengths."); return; } - for (var r = 0; r < L.length; r += 3) { - var n = C(L[r], L[r + 1], L[r + 2]); + for (var r = 0; r < C.length; r += 3) { + var n = L(C[r], C[r + 1], C[r + 2]); n instanceof x.Color || (n = x.CC.color(n)), D[r] = n.r, D[r + 1] = n.g, D[r + 2] = n.b; } } @@ -11817,22 +11817,22 @@ ATOM`, h); getCentroid() { if (!this.vertexArray) throw new Error("vertex array not initialized"); - for (var C = new _.Vector3(), L, D, r, n, b = 0; b < this.vertices; ++b) - L = b * 3, D = this.vertexArray[L], r = this.vertexArray[L + 1], n = this.vertexArray[L + 2], C.x += D, C.y += r, C.z += n; - return C.divideScalar(this.vertices), C; + for (var L = new _.Vector3(), C, D, r, n, b = 0; b < this.vertices; ++b) + C = b * 3, D = this.vertexArray[C], r = this.vertexArray[C + 1], n = this.vertexArray[C + 2], L.x += D, L.y += r, L.z += n; + return L.divideScalar(this.vertices), L; } //setup normals - vertex and face array must exist setNormals() { - var C = this.faceArray, L = this.vertexArray, D = this.normalArray; + var L = this.faceArray, C = this.vertexArray, D = this.normalArray; if (!(!this.vertices || !this.faceidx)) { - if (!C) - throw new Error("face array not initialized"); if (!L) + throw new Error("face array not initialized"); + if (!C) throw new Error("vertex array not initialized"); if (!D) throw new Error("normal array not initialized"); - for (var r, n, b, f, c, t, a, h = 0; h < C.length / 3; ++h) - r = C[h * 3] * 3, n = C[h * 3 + 1] * 3, b = C[h * 3 + 2] * 3, f = new _.Vector3(L[r], L[r + 1], L[r + 2]), c = new _.Vector3(L[n], L[n + 1], L[n + 2]), t = new _.Vector3(L[b], L[b + 1], L[b + 2]), f.subVectors(f, c), t.subVectors(t, c), t.cross(f), a = t, a.normalize(), D[r] += a.x, D[n] += a.x, D[b] += a.x, D[r + 1] += a.y, D[n + 1] += a.y, D[b + 1] += a.y, D[r + 2] += a.z, D[n + 2] += a.z, D[b + 2] += a.z; + for (var r, n, b, f, c, t, a, h = 0; h < L.length / 3; ++h) + r = L[h * 3] * 3, n = L[h * 3 + 1] * 3, b = L[h * 3 + 2] * 3, f = new _.Vector3(C[r], C[r + 1], C[r + 2]), c = new _.Vector3(C[n], C[n + 1], C[n + 2]), t = new _.Vector3(C[b], C[b + 1], C[b + 2]), f.subVectors(f, c), t.subVectors(t, c), t.cross(f), a = t, a.normalize(), D[r] += a.x, D[n] += a.x, D[b] += a.x, D[r + 1] += a.y, D[n + 1] += a.y, D[b + 1] += a.y, D[r + 2] += a.z, D[n + 2] += a.z, D[b + 2] += a.z; } } /* sets line index array from face arr @@ -11842,181 +11842,181 @@ ATOM`, h); as rectangles rather than two triangles) */ setLineIndices() { if (this.faceidx && !(this.lineArray && this.lineArray.length == this.faceidx * 2 && this.lineidx == this.faceidx * 2)) { - var C = this.faceArray, L = this.lineArray = new Uint16Array(this.faceidx * 2); - if (this.lineidx = this.faceidx * 2, !C) + var L = this.faceArray, C = this.lineArray = new Uint16Array(this.faceidx * 2); + if (this.lineidx = this.faceidx * 2, !L) throw new Error("face array not initialized"); for (var D = 0; D < this.faceidx / 3; ++D) { - var r = D * 3, n = r * 2, b = C[r], f = C[r + 1], c = C[r + 2]; - L[n] = b, L[n + 1] = f, L[n + 2] = b, L[n + 3] = c, L[n + 4] = f, L[n + 5] = c; + var r = D * 3, n = r * 2, b = L[r], f = L[r + 1], c = L[r + 2]; + C[n] = b, C[n + 1] = f, C[n + 2] = b, C[n + 3] = c, C[n + 4] = f, C[n + 5] = c; } } } - vrml(C, L) { - var D, r, n, b, f, c, t, a, h, M, w, S, T, R, z, P, B, U, F = ""; - if (F += C + `Shape { -` + C + ` appearance Appearance { -` + C + ` material Material { -` + C + " diffuseColor " + ((D = L == null ? void 0 : L.color) === null || D === void 0 ? void 0 : D.r) + " " + ((r = L == null ? void 0 : L.color) === null || r === void 0 ? void 0 : r.g) + " " + ((n = L == null ? void 0 : L.color) === null || n === void 0 ? void 0 : n.b) + ` -`, L.wireframe && this.colorArray) { + vrml(L, C) { + var D, r, n, b, f, c, t, a, h, M, w, S, T, R, $, P, B, F, U = ""; + if (U += L + `Shape { +` + L + ` appearance Appearance { +` + L + ` material Material { +` + L + " diffuseColor " + ((D = C == null ? void 0 : C.color) === null || D === void 0 ? void 0 : D.r) + " " + ((r = C == null ? void 0 : C.color) === null || r === void 0 ? void 0 : r.g) + " " + ((n = C == null ? void 0 : C.color) === null || n === void 0 ? void 0 : n.b) + ` +`, C.wireframe && this.colorArray) { let W = this.colorArray; - F += C + " emissiveColor " + W[0] + " " + W[1] + " " + W[2] + ` + U += L + " emissiveColor " + W[0] + " " + W[1] + " " + W[2] + ` `; } - L != null && L.transparent && (F += C + " transparency " + (1 - L.opacity) + ` -`), F += C + ` } -`, F += C + ` } + C != null && C.transparent && (U += L + " transparency " + (1 - C.opacity) + ` +`), U += L + ` } +`, U += L + ` } `; - var $ = C; - if (C += " ", L instanceof l.LineBasicMaterial || L.wireframe) { - F += C + `geometry IndexedLineSet { -` + C + ` colorPerVertex TRUE -` + C + ` coord Coordinate { -` + C + ` point [ + var z = L; + if (L += " ", C instanceof l.LineBasicMaterial || C.wireframe) { + U += L + `geometry IndexedLineSet { +` + L + ` colorPerVertex TRUE +` + L + ` coord Coordinate { +` + L + ` point [ `; - let W, N, G; + let W, V, N; for (let k = 0; k < this.vertices; ++k) { - let j = k * 3; - W = (b = this.vertexArray) === null || b === void 0 ? void 0 : b[j], N = (f = this.vertexArray) === null || f === void 0 ? void 0 : f[j + 1], G = (c = this.vertexArray) === null || c === void 0 ? void 0 : c[j + 2], F += C + " " + W + " " + N + " " + G + `, + let G = k * 3; + W = (b = this.vertexArray) === null || b === void 0 ? void 0 : b[G], V = (f = this.vertexArray) === null || f === void 0 ? void 0 : f[G + 1], N = (c = this.vertexArray) === null || c === void 0 ? void 0 : c[G + 2], U += L + " " + W + " " + V + " " + N + `, `; } - if (F += C + ` ] -`, F += C + ` } -`, this.colorArray && !L.wireframe) { - F += C + ` color Color { -` + C + ` color [ + if (U += L + ` ] +`, U += L + ` } +`, this.colorArray && !C.wireframe) { + U += L + ` color Color { +` + L + ` color [ `; for (let k = 0; k < this.vertices; ++k) { - let j = k * 3; - W = this.colorArray[j], N = this.colorArray[j + 1], G = this.colorArray[j + 2], F += C + " " + W + " " + N + " " + G + `, + let G = k * 3; + W = this.colorArray[G], V = this.colorArray[G + 1], N = this.colorArray[G + 2], U += L + " " + W + " " + V + " " + N + `, `; } - F += C + ` ] -`, F += C + ` } + U += L + ` ] +`, U += L + ` } `; } - if (F += C + ` coordIndex [ -`, L.wireframe && this.faceArray) + if (U += L + ` coordIndex [ +`, C.wireframe && this.faceArray) for (let k = 0; k < this.faceidx; k += 3) - W = (t = this.faceArray) === null || t === void 0 ? void 0 : t[k], N = (a = this.faceArray) === null || a === void 0 ? void 0 : a[k + 1], G = (h = this.faceArray) === null || h === void 0 ? void 0 : h[k + 2], F += C + " " + W + ", " + N + ", " + G + `, -1, + W = (t = this.faceArray) === null || t === void 0 ? void 0 : t[k], V = (a = this.faceArray) === null || a === void 0 ? void 0 : a[k + 1], N = (h = this.faceArray) === null || h === void 0 ? void 0 : h[k + 2], U += L + " " + W + ", " + V + ", " + N + `, -1, `; else for (let k = 0; k < this.vertices - 1; k += 2) - F += C + " " + k + ", " + (k + 1) + `, -1, + U += L + " " + k + ", " + (k + 1) + `, -1, `; - F += C + ` ] -`, F += C + `} + U += L + ` ] +`, U += L + `} `; } else { - F += C + `geometry IndexedFaceSet { -` + C + ` colorPerVertex TRUE -` + C + ` normalPerVertex TRUE -` + C + ` solid FALSE -`, F += C + ` coord Coordinate { -` + C + ` point [ + U += L + `geometry IndexedFaceSet { +` + L + ` colorPerVertex TRUE +` + L + ` normalPerVertex TRUE +` + L + ` solid FALSE +`, U += L + ` coord Coordinate { +` + L + ` point [ `; - let W, N, G; + let W, V, N; for (let k = 0; k < this.vertices; ++k) { - let j = k * 3; - W = (M = this.vertexArray) === null || M === void 0 ? void 0 : M[j], N = (w = this.vertexArray) === null || w === void 0 ? void 0 : w[j + 1], G = (S = this.vertexArray) === null || S === void 0 ? void 0 : S[j + 2], F += C + " " + W + " " + N + " " + G + `, + let G = k * 3; + W = (M = this.vertexArray) === null || M === void 0 ? void 0 : M[G], V = (w = this.vertexArray) === null || w === void 0 ? void 0 : w[G + 1], N = (S = this.vertexArray) === null || S === void 0 ? void 0 : S[G + 2], U += L + " " + W + " " + V + " " + N + `, `; } - F += C + ` ] -`, F += C + ` } -`, F += C + ` normal Normal { -` + C + ` vector [ + U += L + ` ] +`, U += L + ` } +`, U += L + ` normal Normal { +` + L + ` vector [ `; for (let k = 0; k < this.vertices; ++k) { - let j = k * 3; - W = (T = this.normalArray) === null || T === void 0 ? void 0 : T[j], N = (R = this.normalArray) === null || R === void 0 ? void 0 : R[j + 1], G = (z = this.normalArray) === null || z === void 0 ? void 0 : z[j + 2], F += C + " " + W + " " + N + " " + G + `, + let G = k * 3; + W = (T = this.normalArray) === null || T === void 0 ? void 0 : T[G], V = (R = this.normalArray) === null || R === void 0 ? void 0 : R[G + 1], N = ($ = this.normalArray) === null || $ === void 0 ? void 0 : $[G + 2], U += L + " " + W + " " + V + " " + N + `, `; } - if (F += C + ` ] -`, F += C + ` } + if (U += L + ` ] +`, U += L + ` } `, this.colorArray) { - F += C + ` color Color { -` + C + ` color [ + U += L + ` color Color { +` + L + ` color [ `; for (let k = 0; k < this.vertices; ++k) { - let j = k * 3; - W = this.colorArray[j], N = this.colorArray[j + 1], G = this.colorArray[j + 2], F += C + " " + W + " " + N + " " + G + `, + let G = k * 3; + W = this.colorArray[G], V = this.colorArray[G + 1], N = this.colorArray[G + 2], U += L + " " + W + " " + V + " " + N + `, `; } - F += C + ` ] -`, F += C + ` } + U += L + ` ] +`, U += L + ` } `; } - F += C + ` coordIndex [ + U += L + ` coordIndex [ `; for (let k = 0; k < this.faceidx; k += 3) - W = (P = this.faceArray) === null || P === void 0 ? void 0 : P[k], N = (B = this.faceArray) === null || B === void 0 ? void 0 : B[k + 1], G = (U = this.faceArray) === null || U === void 0 ? void 0 : U[k + 2], F += C + " " + W + ", " + N + ", " + G + `, -1, + W = (P = this.faceArray) === null || P === void 0 ? void 0 : P[k], V = (B = this.faceArray) === null || B === void 0 ? void 0 : B[k + 1], N = (F = this.faceArray) === null || F === void 0 ? void 0 : F[k + 2], U += L + " " + W + ", " + V + ", " + N + `, -1, `; - F += C + ` ] -`, F += C + `} + U += L + ` ] +`, U += L + `} `; } - return F += $ + "}", F; + return U += z + "}", U; } - truncateArrayBuffers(C = !0, L = !1) { + truncateArrayBuffers(L = !0, C = !1) { var D = this.vertexArray, r = this.colorArray, n = this.normalArray, b = this.faceArray, f = this.lineArray, c = this.radiusArray; - this.vertexArray = (D == null ? void 0 : D.subarray(0, this.vertices * 3)) || null, this.colorArray = (r == null ? void 0 : r.subarray(0, this.vertices * 3)) || null, C ? (this.normalArray = (n == null ? void 0 : n.subarray(0, this.vertices * 3)) || null, this.faceArray = (b == null ? void 0 : b.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (f == null ? void 0 : f.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)), c && (this.radiusArray = c.subarray(0, this.vertices)), L && (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; + this.vertexArray = (D == null ? void 0 : D.subarray(0, this.vertices * 3)) || null, this.colorArray = (r == null ? void 0 : r.subarray(0, this.vertices * 3)) || null, L ? (this.normalArray = (n == null ? void 0 : n.subarray(0, this.vertices * 3)) || null, this.faceArray = (b == null ? void 0 : b.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (f == null ? void 0 : f.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)), c && (this.radiusArray = c.subarray(0, this.vertices)), C && (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 g.EventDispatcher { - constructor(C = !1, L = !1, D = !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 = u++, this.mesh = C, this.radii = L, this.offset = D; + class E extends p.EventDispatcher { + constructor(L = !1, C = !1, D = !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 = u++, this.mesh = L, this.radii = C, this.offset = D; } //Get geometry group to accomodate addVertices new vertices - create // new group if necessary - updateGeoGroup(C = 0) { - var L, D = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null; - return (!D || D.vertices + C > (((L = D == null ? void 0 : D.vertexArray) === null || L === void 0 ? void 0 : L.length) || 0) / 3) && (D = this.addGeoGroup()), D; + updateGeoGroup(L = 0) { + var C, D = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null; + return (!D || D.vertices + L > (((C = D == null ? void 0 : D.vertexArray) === null || C === void 0 ? void 0 : C.length) || 0) / 3) && (D = this.addGeoGroup()), D; } //return comma separated list of IndexedFace (or Line) sets from geometry groups - vrml(C, L) { + vrml(L, C) { for (var D = "", r = this.geometryGroups.length, n = 0; n < r; n++) { var b = this.geometryGroups[n]; - D += b.vrml(C, L) + `, + D += b.vrml(L, C) + `, `; } return D; } addGeoGroup() { - var C = new p(this.geometryGroups.length); - return this.geometryGroups.push(C), this.groups = this.geometryGroups.length, C.vertexArray = new Float32Array(o * 3), C.colorArray = new Float32Array(o * 3), this.mesh && (C.normalArray = new Float32Array(o * 3), C.faceArray = new Uint16Array(o * 6), C.lineArray = new Uint16Array(o * 6)), this.radii && (C.radiusArray = new Float32Array(o)), C.useOffset = this.offset, C; + var L = new g(this.geometryGroups.length); + return this.geometryGroups.push(L), this.groups = this.geometryGroups.length, L.vertexArray = new Float32Array(o * 3), L.colorArray = new Float32Array(o * 3), this.mesh && (L.normalArray = new Float32Array(o * 3), L.faceArray = new Uint16Array(o * 6), L.lineArray = new Uint16Array(o * 6)), this.radii && (L.radiusArray = new Float32Array(o)), L.useOffset = this.offset, L; } - setUpNormals(...C) { - for (var L = 0; L < this.groups; L++) { - var D = this.geometryGroups[L]; - D.setNormals(...C); + setUpNormals(...L) { + for (var C = 0; C < this.groups; C++) { + var D = this.geometryGroups[C]; + D.setNormals(...L); } } - setColors(...C) { - for (var L = this.geometryGroups.length, D = 0; D < L; D++) { + setColors(...L) { + for (var C = this.geometryGroups.length, D = 0; D < C; D++) { var r = this.geometryGroups[D]; - r.setColors(...C); + r.setColors(...L); } } - setUpWireframe(...C) { - for (var L = 0; L < this.groups; L++) { - var D = this.geometryGroups[L]; - D.setLineIndices(...C); + setUpWireframe(...L) { + for (var C = 0; C < this.groups; C++) { + var D = this.geometryGroups[C]; + D.setLineIndices(...L); } } //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 C = 0; C < this.groups; C++) { - var L = this.geometryGroups[C]; - L.__inittedArrays !== !0 && L.truncateArrayBuffers(this.mesh, !1); + for (var L = 0; L < this.groups; L++) { + var C = this.geometryGroups[L]; + C.__inittedArrays !== !0 && C.truncateArrayBuffers(this.mesh, !1); } } dispose() { this.dispatchEvent({ type: "dispose" }); } get vertices() { - for (var C = 0, L = 0; L < this.groups; L++) - C += this.geometryGroups[L].vertices; - return C; + for (var L = 0, C = 0; C < this.groups; C++) + L += this.geometryGroups[C].vertices; + return L; } } let u = 0; @@ -12033,7 +12033,7 @@ ATOM`, h); /* harmony export */ Light: () => ( /* binding */ - p + g ), /* harmony export */ Object3D: () => ( @@ -12055,7 +12055,7 @@ ATOM`, h); var l = e( /*! ../math */ "./src/WebGL/math/index.ts" - ), g = e( + ), p = e( /*! ../../colors */ "./src/colors.ts" ); @@ -12082,22 +12082,22 @@ ATOM`, h); var A = this.children.indexOf(u); if (A !== -1) { u.parent = void 0, this.children.splice(A, 1); - for (var C = this; C.parent !== void 0; ) - C = C.parent; - C !== void 0 && C instanceof o && C.__removeObject(u); + for (var L = this; L.parent !== void 0; ) + L = L.parent; + L !== void 0 && L instanceof o && L.__removeObject(u); } } //convert to vrml vrml(u) { u || (u = " "); - var A = 2 * Math.atan2(this.quaternion.lengthxyz(), this.quaternion.w), C = 0, L = 0, D = 0; + var A = 2 * Math.atan2(this.quaternion.lengthxyz(), this.quaternion.w), L = 0, C = 0, D = 0; if (A != 0) { let b = Math.sin(A / 2); - C = this.quaternion.x / b, L = this.quaternion.y / b, D = this.quaternion.z / b; + L = this.quaternion.x / b, C = this.quaternion.y / b, D = this.quaternion.z / b; } var r = u + `Transform { ` + u + " center " + this.position.x + " " + this.position.y + " " + this.position.z + ` -` + u + " rotation " + C + " " + L + " " + D + " " + A + ` +` + u + " rotation " + L + " " + C + " " + D + " " + A + ` ` + u + ` children [ `; this.geometry && (r += this.geometry.vrml(u, this.material)); @@ -12118,16 +12118,16 @@ ATOM`, h); clone(u) { u === void 0 && (u = new x()), u.name = this.name, u.up.copy(this.up), u.position.copy(this.position), u.rotation instanceof l.Vector3 && this.rotation instanceof l.Vector3 ? u.rotation.copy(this.rotation) : u.rotation = this.rotation, u.eulerOrder = this.eulerOrder, u.scale.copy(this.scale), u.rotationAutoUpdate = this.rotationAutoUpdate, u.matrix.copy(this.matrix), u.matrixWorld.copy(this.matrixWorld), u.quaternion.copy(this.quaternion), u.matrixAutoUpdate = this.matrixAutoUpdate, u.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, u.useQuaternion = this.useQuaternion, u.visible = this.visible; for (var A = 0; A < this.children.length; A++) { - var C = this.children[A]; - u.add(C.clone()); + var L = this.children[A]; + u.add(L.clone()); } return u; } setVisible(u) { this.visible = u; for (var A = 0; A < this.children.length; A++) { - var C = this.children[A]; - C.setVisible(u); + var L = this.children[A]; + L.setVisible(u); } } } @@ -12136,32 +12136,32 @@ ATOM`, h); super(...arguments), this.fog = null, this.overrideMaterial = null, this.matrixAutoUpdate = !1, this.__objects = [], this.__lights = [], this.__objectsAdded = [], this.__objectsRemoved = []; } __addObject(u) { - if (u instanceof p) + if (u instanceof g) this.__lights.indexOf(u) === -1 && this.__lights.push(u), u.target && u.target.parent === void 0 && this.add(u.target); else if (this.__objects.indexOf(u) === -1) { this.__objects.push(u), this.__objectsAdded.push(u); var A = this.__objectsRemoved.indexOf(u); A !== -1 && this.__objectsRemoved.splice(A, 1); } - for (var C = 0; C < u.children.length; C++) - this.__addObject(u.children[C]); + for (var L = 0; L < u.children.length; L++) + this.__addObject(u.children[L]); } __removeObject(u) { var A; - if (u instanceof p) + if (u instanceof g) A = this.__lights.indexOf(u), A !== -1 && this.__lights.splice(A, 1); else if (A = this.__objects.indexOf(u), A !== -1) { this.__objects.splice(A, 1), this.__objectsRemoved.push(u); - var C = this.__objectsAdded.indexOf(u); - C !== -1 && this.__objectsAdded.splice(A, 1); + var L = this.__objectsAdded.indexOf(u); + L !== -1 && this.__objectsAdded.splice(A, 1); } - for (var L = 0; L < u.children.length; L++) - this.__removeObject(u.children[L]); + for (var C = 0; C < u.children.length; C++) + this.__removeObject(u.children[C]); } } - class p extends x { + class g extends x { constructor(u, A = 1) { - super(), this.position = new l.Vector3(0, 1, 0), this.target = new x(), this.castShadow = !1, this.onlyShadow = !1, this.color = new g.Color(u), this.intensity = A; + super(), this.position = new l.Vector3(0, 1, 0), this.target = new x(), this.castShadow = !1, this.onlyShadow = !1, this.color = new p.Color(u), this.intensity = A; } } } @@ -12185,19 +12185,19 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - const g = new l.Matrix4(); + const p = new l.Matrix4(); class _ { - static unprojectVector(o, p) { - return p.projectionMatrixInverse.getInverse(p.projectionMatrix), g.multiplyMatrices(p.matrixWorld, p.projectionMatrixInverse), o.applyProjection(g); + static unprojectVector(o, g) { + return g.projectionMatrixInverse.getInverse(g.projectionMatrix), p.multiplyMatrices(g.matrixWorld, g.projectionMatrixInverse), o.applyProjection(p); } - static projectVector(o, p) { - return p.matrixWorldInverse.getInverse(p.matrixWorld), g.multiplyMatrices(p.projectionMatrix, p.matrixWorldInverse), o.applyProjection(g); + static projectVector(o, g) { + return g.matrixWorldInverse.getInverse(g.matrixWorld), p.multiplyMatrices(g.projectionMatrix, g.matrixWorldInverse), o.applyProjection(p); } - projectVector(o, p) { - return _.projectVector(o, p); + projectVector(o, g) { + return _.projectVector(o, g); } - unprojectVector(o, p) { - return _.unprojectVector(o, p); + unprojectVector(o, g) { + return _.unprojectVector(o, g); } } } @@ -12225,7 +12225,7 @@ ATOM`, h); var l = e( /*! ../math */ "./src/WebGL/math/index.ts" - ), g = e( + ), p = e( /*! ../shapes */ "./src/WebGL/shapes/index.ts" ); @@ -12246,53 +12246,53 @@ ATOM`, h); return a.sort(_), a; } } - const p = (f) => Math.min(Math.max(f, -1), 1); - var E = new g.Sphere(), u = new g.Cylinder(), A = new g.Triangle(), C = new l.Vector3(), L = new l.Vector3(), D = new l.Vector3(), r = new l.Vector3(), n = new l.Vector3(); + const g = (f) => Math.min(Math.max(f, -1), 1); + var E = new p.Sphere(), u = new p.Cylinder(), A = new p.Triangle(), L = new l.Vector3(), C = new l.Vector3(), D = new l.Vector3(), r = new l.Vector3(), n = new l.Vector3(); function b(f, c, t, a) { if (n.getPositionFromMatrix(f.matrixWorld), c.intersectionShape === void 0) return a; var h = c.intersectionShape, M = t.linePrecision; M *= f.matrixWorld.getMaxScaleOnAxis(); var w = M * M; - if (c.boundingSphere !== void 0 && c.boundingSphere instanceof g.Sphere && (E.copy(c.boundingSphere), E.applyMatrix4(f.matrixWorld), !t.ray.isIntersectionSphere(E))) + if (c.boundingSphere !== void 0 && c.boundingSphere instanceof p.Sphere && (E.copy(c.boundingSphere), E.applyMatrix4(f.matrixWorld), !t.ray.isIntersectionSphere(E))) return a; - var S, T, R, z, P, B, U, F, $, W, N, G, k, j; + var S, T, R, $, P, B, F, U, z, W, V, N, k, G; for (S = 0, T = h.triangle.length; S < T; S++) - if (h.triangle[S] instanceof g.Triangle) { - if (A.copy(h.triangle[S]), A.applyMatrix4(f.matrixWorld), R = A.getNormal(), z = t.ray.direction.dot(R), z >= 0 || (C.subVectors(A.a, t.ray.origin), U = R.dot(C) / z, U < 0)) + if (h.triangle[S] instanceof p.Triangle) { + if (A.copy(h.triangle[S]), A.applyMatrix4(f.matrixWorld), R = A.getNormal(), $ = t.ray.direction.dot(R), $ >= 0 || (L.subVectors(A.a, t.ray.origin), F = R.dot(L) / $, F < 0)) continue; - L.copy(t.ray.direction).multiplyScalar(U).add(t.ray.origin), L.sub(A.a), D.copy(A.b).sub(A.a), r.copy(A.c).sub(A.a); - var Q = D.dot(r), ie = D.lengthSq(), pe = r.lengthSq(); - if (G = (ie * L.dot(r) - Q * L.dot(D)) / (ie * pe - Q * Q), G < 0 || G > 1 || (N = (L.dot(D) - G * Q) / ie, N < 0 || N > 1 || N + G > 1)) + C.copy(t.ray.direction).multiplyScalar(F).add(t.ray.origin), C.sub(A.a), D.copy(A.b).sub(A.a), r.copy(A.c).sub(A.a); + var Q = D.dot(r), ie = D.lengthSq(), ge = r.lengthSq(); + if (N = (ie * C.dot(r) - Q * C.dot(D)) / (ie * ge - Q * Q), N < 0 || N > 1 || (V = (C.dot(D) - N * Q) / ie, V < 0 || V > 1 || V + N > 1)) continue; - a.push({ clickable: c, distance: U }); + a.push({ clickable: c, distance: F }); } for (S = 0, T = h.cylinder.length; S < T; S++) - if (h.cylinder[S] instanceof g.Cylinder) { - if (u.copy(h.cylinder[S]), u.applyMatrix4(f.matrixWorld), C.subVectors(u.c1, t.ray.origin), P = C.dot(u.direction), B = C.dot(t.ray.direction), z = p(t.ray.direction.dot(u.direction)), $ = 1 - z * z, $ === 0) + if (h.cylinder[S] instanceof p.Cylinder) { + if (u.copy(h.cylinder[S]), u.applyMatrix4(f.matrixWorld), L.subVectors(u.c1, t.ray.origin), P = L.dot(u.direction), B = L.dot(t.ray.direction), $ = g(t.ray.direction.dot(u.direction)), z = 1 - $ * $, z === 0) continue; - k = (z * B - P) / $, j = (B - z * P) / $, L.copy(u.direction).multiplyScalar(k).add(u.c1), D.copy(t.ray.direction).multiplyScalar(j).add(t.ray.origin), F = r.subVectors(L, D).lengthSq(); - var he = u.radius * u.radius; - if (F <= he) { - if (W = (z * P - B) * (z * P - B) - $ * (C.lengthSq() - P * P - he), W <= 0 ? G = U = Math.sqrt(F) : G = U = (B - z * P - Math.sqrt(W)) / $, N = z * G - P, N < 0 || N * N > u.lengthSq() || G < 0) + k = ($ * B - P) / z, G = (B - $ * P) / z, C.copy(u.direction).multiplyScalar(k).add(u.c1), D.copy(t.ray.direction).multiplyScalar(G).add(t.ray.origin), U = r.subVectors(C, D).lengthSq(); + var le = u.radius * u.radius; + if (U <= le) { + if (W = ($ * P - B) * ($ * P - B) - z * (L.lengthSq() - P * P - le), W <= 0 ? N = F = Math.sqrt(U) : N = F = (B - $ * P - Math.sqrt(W)) / z, V = $ * N - P, V < 0 || V * V > u.lengthSq() || N < 0) continue; - a.push({ clickable: c, distance: U }); + a.push({ clickable: c, distance: F }); } } for (S = 0, T = h.line.length; S < T; S += 2) { - L.copy(h.line[S]), L.applyMatrix4(f.matrixWorld), D.copy(h.line[S + 1]), D.applyMatrix4(f.matrixWorld), r.subVectors(D, L); - var ue = r.lengthSq(); - r.normalize(), C.subVectors(L, t.ray.origin); - var se = C.dot(r); - B = C.dot(t.ray.direction), z = p(t.ray.direction.dot(r)), $ = 1 - z * z, $ !== 0 && (k = (z * B - se) / $, j = (B - z * se) / $, L.add(r.multiplyScalar(k)), D.copy(t.ray.direction).multiplyScalar(j).add(t.ray.origin), F = r.subVectors(D, L).lengthSq(), F < w && k * k < ue && a.push({ clickable: c, distance: j })); + C.copy(h.line[S]), C.applyMatrix4(f.matrixWorld), D.copy(h.line[S + 1]), D.applyMatrix4(f.matrixWorld), r.subVectors(D, C); + var oe = r.lengthSq(); + r.normalize(), L.subVectors(C, t.ray.origin); + var he = L.dot(r); + B = L.dot(t.ray.direction), $ = g(t.ray.direction.dot(r)), z = 1 - $ * $, z !== 0 && (k = ($ * B - he) / z, G = (B - $ * he) / z, C.add(r.multiplyScalar(k)), D.copy(t.ray.direction).multiplyScalar(G).add(t.ray.origin), U = r.subVectors(D, C).lengthSq(), U < w && k * k < oe && a.push({ clickable: c, distance: G })); } for (S = 0, T = h.sphere.length; S < T; S++) - if (h.sphere[S] instanceof g.Sphere && (E.copy(h.sphere[S]), E.applyMatrix4(f.matrixWorld), t.ray.isIntersectionSphere(E))) { - L.subVectors(E.center, t.ray.origin); - var ae = L.dot(t.ray.direction); - if (W = ae * ae - (L.lengthSq() - E.radius * E.radius), ae < 0) + if (h.sphere[S] instanceof p.Sphere && (E.copy(h.sphere[S]), E.applyMatrix4(f.matrixWorld), t.ray.isIntersectionSphere(E))) { + C.subVectors(E.center, t.ray.origin); + var se = C.dot(t.ray.direction); + if (W = se * se - (C.lengthSq() - E.radius * E.radius), se < 0) return a; - W <= 0 ? U = ae : U = ae - Math.sqrt(W), a.push({ clickable: c, distance: U }); + W <= 0 ? F = se : F = se - Math.sqrt(W), a.push({ clickable: c, distance: F }); } return a; } @@ -12314,14 +12314,14 @@ ATOM`, h); /* harmony export */ TextureIdCount: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ../constants/TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), g = e( + ), p = e( /*! ../math */ "./src/WebGL/math/index.ts" ), _ = e( @@ -12333,7 +12333,7 @@ ATOM`, h); ); class o extends _.EventDispatcher { constructor(u, A) { - super(), this.id = p++, this.name = "", this.image = u, this.mapping = new x.UVMapping(), this.wrapS = l.ClampToEdgeWrapping, this.wrapT = l.ClampToEdgeWrapping, this.anisotropy = 1, A ? (this.format = l.RFormat, this.type = l.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = l.NearestFilter, this.minFilter = l.NearestFilter) : (this.format = l.RGBAFormat, this.type = l.UnsignedByteType, this.offset = new g.Vector2(0, 0), this.repeat = new g.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = l.LinearFilter, this.minFilter = l.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; + super(), this.id = g++, this.name = "", this.image = u, this.mapping = new x.UVMapping(), this.wrapS = l.ClampToEdgeWrapping, this.wrapT = l.ClampToEdgeWrapping, this.anisotropy = 1, A ? (this.format = l.RFormat, this.type = l.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = l.NearestFilter, this.minFilter = l.NearestFilter) : (this.format = l.RGBAFormat, this.type = l.UnsignedByteType, this.offset = new p.Vector2(0, 0), this.repeat = new p.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = l.LinearFilter, this.minFilter = l.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; } clone(u = new o()) { return u.image = this.image, u.mapping = this.mapping, u.wrapS = this.wrapS, u.wrapT = this.wrapT, u.magFilter = this.magFilter, u.minFilter = this.minFilter, u.anisotropy = this.anisotropy, u.format = this.format, u.type = this.type, u.offset.copy(this.offset), u.repeat.copy(this.repeat), u.premultiplyAlpha = this.premultiplyAlpha, u.flipY = this.flipY, u.unpackAlignment = this.unpackAlignment, u; @@ -12342,7 +12342,7 @@ ATOM`, h); this.dispatchEvent({ type: "dispose" }); } } - let p = 0; + let g = 0; } ), /***/ @@ -12380,17 +12380,17 @@ ATOM`, h); /* harmony export */ Geometry: () => ( /* reexport safe */ - g.Geometry + p.Geometry ), /* harmony export */ GeometryGroup: () => ( /* reexport safe */ - g.GeometryGroup + p.GeometryGroup ), /* harmony export */ GeometryIDCount: () => ( /* reexport safe */ - g.GeometryIDCount + p.GeometryIDCount ), /* harmony export */ Light: () => ( @@ -12425,12 +12425,12 @@ ATOM`, h); /* harmony export */ Texture: () => ( /* reexport safe */ - p.Texture + g.Texture ), /* harmony export */ TextureIdCount: () => ( /* reexport safe */ - p.TextureIdCount + g.TextureIdCount ), /* harmony export */ UVMapping: () => ( @@ -12447,7 +12447,7 @@ ATOM`, h); var l = e( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), g = e( + ), p = e( /*! ./Geometry */ "./src/WebGL/core/Geometry.ts" ), _ = e( @@ -12459,7 +12459,7 @@ ATOM`, h); ), o = e( /*! ./Raycaster */ "./src/WebGL/core/Raycaster.ts" - ), p = e( + ), g = e( /*! ./Texture */ "./src/WebGL/core/Texture.ts" ), E = e( @@ -12509,7 +12509,7 @@ ATOM`, h); /* harmony export */ EventDispatcher: () => ( /* reexport safe */ - g.EventDispatcher + p.EventDispatcher ), /* harmony export */ FloatType: () => ( @@ -12529,17 +12529,17 @@ ATOM`, h); /* harmony export */ Geometry: () => ( /* reexport safe */ - g.Geometry + p.Geometry ), /* harmony export */ GeometryGroup: () => ( /* reexport safe */ - g.GeometryGroup + p.GeometryGroup ), /* harmony export */ GeometryIDCount: () => ( /* reexport safe */ - g.GeometryIDCount + p.GeometryIDCount ), /* harmony export */ ImposterMaterial: () => ( @@ -12554,7 +12554,7 @@ ATOM`, h); /* harmony export */ Light: () => ( /* reexport safe */ - g.Light + p.Light ), /* harmony export */ Line: () => ( @@ -12629,17 +12629,17 @@ ATOM`, h); /* harmony export */ Object3D: () => ( /* reexport safe */ - g.Object3D + p.Object3D ), /* harmony export */ Object3DIDCount: () => ( /* reexport safe */ - g.Object3DIDCount + p.Object3DIDCount ), /* harmony export */ Projector: () => ( /* reexport safe */ - g.Projector + p.Projector ), /* harmony export */ Quaternion: () => ( @@ -12669,27 +12669,27 @@ ATOM`, h); /* harmony export */ Raycaster: () => ( /* reexport safe */ - g.Raycaster + p.Raycaster ), /* harmony export */ Renderer: () => ( /* reexport safe */ - C.Renderer + L.Renderer ), /* harmony export */ Scene: () => ( /* reexport safe */ - g.Scene + p.Scene ), /* harmony export */ ShaderLib: () => ( /* reexport safe */ - p.ShaderLib + g.ShaderLib ), /* harmony export */ ShaderUtils: () => ( /* reexport safe */ - p.ShaderUtils + g.ShaderUtils ), /* harmony export */ Shading: () => ( @@ -12729,7 +12729,7 @@ ATOM`, h); /* harmony export */ SpritePlugin: () => ( /* reexport safe */ - L.SpritePlugin + C.SpritePlugin ), /* harmony export */ StickImposterMaterial: () => ( @@ -12744,12 +12744,12 @@ ATOM`, h); /* harmony export */ Texture: () => ( /* reexport safe */ - g.Texture + p.Texture ), /* harmony export */ TextureIdCount: () => ( /* reexport safe */ - g.TextureIdCount + p.TextureIdCount ), /* harmony export */ TextureOperations: () => ( @@ -12764,7 +12764,7 @@ ATOM`, h); /* harmony export */ UVMapping: () => ( /* reexport safe */ - g.UVMapping + p.UVMapping ), /* harmony export */ UnsignedByteType: () => ( @@ -12789,7 +12789,7 @@ ATOM`, h); /* harmony export */ basic: () => ( /* reexport safe */ - p.basic + g.basic ), /* harmony export */ clamp: () => ( @@ -12799,7 +12799,7 @@ ATOM`, h); /* harmony export */ clone: () => ( /* reexport safe */ - p.clone + g.clone ), /* harmony export */ conversionMatrix3: () => ( @@ -12814,74 +12814,74 @@ ATOM`, h); /* harmony export */ instanced: () => ( /* reexport safe */ - p.instanced + g.instanced ), /* harmony export */ intersectObject: () => ( /* reexport safe */ - g.intersectObject + p.intersectObject ), /* harmony export */ lambert: () => ( /* reexport safe */ - p.lambert + g.lambert ), /* harmony export */ lambertdouble: () => ( /* reexport safe */ - p.lambertdouble + g.lambertdouble ), /* harmony export */ outline: () => ( /* reexport safe */ - p.outline + g.outline ), /* harmony export */ screen: () => ( /* reexport safe */ - p.screen + g.screen ), /* harmony export */ screenaa: () => ( /* reexport safe */ - p.screenaa + g.screenaa ), /* harmony export */ sphereimposter: () => ( /* reexport safe */ - p.sphereimposter + g.sphereimposter ), /* harmony export */ sphereimposteroutline: () => ( /* reexport safe */ - p.sphereimposteroutline + g.sphereimposteroutline ), /* harmony export */ sprite: () => ( /* reexport safe */ - p.sprite + g.sprite ), /* harmony export */ stickimposter: () => ( /* reexport safe */ - p.stickimposter + g.stickimposter ), /* harmony export */ stickimposteroutline: () => ( /* reexport safe */ - p.stickimposteroutline + g.stickimposteroutline ), /* harmony export */ volumetric: () => ( /* reexport safe */ - p.volumetric + g.volumetric ) /* harmony export */ }); var l = e( /*! ./constants */ "./src/WebGL/constants/index.ts" - ), g = e( + ), p = e( /*! ./core */ "./src/WebGL/core/index.ts" ), _ = e( @@ -12893,7 +12893,7 @@ ATOM`, h); ), o = e( /*! ./objects */ "./src/WebGL/objects/index.ts" - ), p = e( + ), g = e( /*! ./shaders */ "./src/WebGL/shaders/index.ts" ), E = e( @@ -12905,10 +12905,10 @@ ATOM`, h); ), A = e( /*! ./Fog */ "./src/WebGL/Fog.ts" - ), C = e( + ), L = e( /*! ./Renderer */ "./src/WebGL/Renderer.ts" - ), L = e( + ), C = e( /*! ./SpritePlugin */ "./src/WebGL/SpritePlugin.ts" ); @@ -12925,14 +12925,14 @@ ATOM`, h); /* harmony export */ ImposterMaterial: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), g = e( + ), p = e( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" ), _ = e( @@ -12945,11 +12945,11 @@ ATOM`, h); /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class p extends o.Material { + class g extends o.Material { constructor(u) { - super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new x.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 = g.Shading.SmoothShading, this.shaderID = null, this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.setValues(u); + super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new x.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 = p.Shading.SmoothShading, this.shaderID = null, this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.setValues(u); } - clone(u = new p()) { + clone(u = new g()) { return super.clone.call(this, u), u.color.copy(this.color), u.ambient.copy(this.ambient), u.emissive.copy(this.emissive), u.wrapAround = this.wrapAround, u.wrapRGB.copy(this.wrapRGB), u.map = this.map, u.lightMap = this.lightMap, u.specularMap = this.specularMap, u.envMap = this.envMap, u.combine = this.combine, u.reflectivity = this.reflectivity, u.refractionRatio = this.refractionRatio, u.fog = this.fog, u.shading = this.shading, u.shaderID = this.shaderID, u.vertexColors = this.vertexColors, u.skinning = this.skinning, u.morphTargets = this.morphTargets, u.morphNormals = this.morphNormals, u; } } @@ -12966,14 +12966,14 @@ ATOM`, h); /* harmony export */ InstancedMaterial: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), g = e( + ), p = e( /*! ../constants/Shading */ "./src/WebGL/constants/Shading.ts" ), _ = e( @@ -12986,11 +12986,11 @@ ATOM`, h); /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class p extends o.Material { + class g extends o.Material { constructor(u) { - super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.wrapAround = !1, this.wrapRGB = new x.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 = g.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(u); + super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.wrapAround = !1, this.wrapRGB = new x.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 = p.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(u); } - clone(u = new p()) { + clone(u = new g()) { return super.clone.call(this, u), u.color.copy(this.color), u.ambient.copy(this.ambient), u.emissive.copy(this.emissive), u.wrapAround = this.wrapAround, u.wrapRGB.copy(this.wrapRGB), u.map = this.map, u.lightMap = this.lightMap, u.specularMap = this.specularMap, u.envMap = this.envMap, u.combine = this.combine, u.reflectivity = this.reflectivity, u.refractionRatio = this.refractionRatio, u.fog = this.fog, u.shading = this.shading, u.shaderID = this.shaderID, u.vertexColors = this.vertexColors, u.skinning = this.skinning, u.morphTargets = this.morphTargets, u.morphNormals = this.morphNormals, u.sphere = this.sphere, u; } } @@ -13014,11 +13014,11 @@ ATOM`, h); var l = e( /*! ../../colors */ "./src/colors.ts" - ), g = e( + ), p = e( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class _ extends g.Material { + class _ extends p.Material { constructor(o) { super(), this.color = new l.Color(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.vertexColors = !1, this.fog = !0, this.shaderID = "basic", this.setValues(o); } @@ -13044,14 +13044,14 @@ ATOM`, h); /* harmony export */ MaterialIdCount: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), g = e( + ), p = e( /*! ../core */ "./src/WebGL/core/index.ts" ), _ = e( @@ -13061,21 +13061,21 @@ ATOM`, h); /*! ../../colors */ "./src/colors.ts" ); - class o extends g.EventDispatcher { + class o extends p.EventDispatcher { constructor() { - super(...arguments), this.id = p++, this.name = "", this.side = l.FrontSide, this.opacity = 1, this.transparent = !1, this.depthTest = !0, this.depthWrite = !0, this.stencilTest = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.visible = !0, this.needsUpdate = !0, this.outline = !1, this.wireframe = !1; + super(...arguments), this.id = g++, this.name = "", this.side = l.FrontSide, this.opacity = 1, this.transparent = !1, this.depthTest = !0, this.depthWrite = !0, this.stencilTest = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.visible = !0, this.needsUpdate = !0, this.outline = !1, this.wireframe = !1; } setValues(u = {}) { if (u !== void 0) for (var A in u) { - var C = u[A]; - if (C === void 0) { + var L = u[A]; + if (L === void 0) { console.warn("$3Dmol.Material: '" + A + "' parameter is undefined."); continue; } if (A in this) { - var L = this[A]; - L instanceof x.Color && C instanceof x.Color ? L.copy(C) : L instanceof x.Color ? L.set(C) : L instanceof _.Vector3 && C instanceof _.Vector3 ? L.copy(C) : this[A] = C; + var C = this[A]; + C instanceof x.Color && L instanceof x.Color ? C.copy(L) : C instanceof x.Color ? C.set(L) : C instanceof _.Vector3 && L instanceof _.Vector3 ? C.copy(L) : this[A] = L; } } } @@ -13087,7 +13087,7 @@ ATOM`, h); this.dispatchEvent({ type: "dispose" }); } } - let p = 0; + let g = 0; } ), /***/ @@ -13108,11 +13108,11 @@ ATOM`, h); var l = e( /*! ./../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), g = e( + ), p = e( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" ); - class _ extends g.MeshLambertMaterial { + class _ extends p.MeshLambertMaterial { constructor(o) { super(o), this.shaderID = "lambertdouble", this.side = l.DoubleSide, this.outline = !1; } @@ -13133,14 +13133,14 @@ ATOM`, h); /* harmony export */ MeshLambertMaterial: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" - ), g = e( + ), p = e( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" ), _ = e( @@ -13153,11 +13153,11 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - class p extends _.Material { + class g extends _.Material { constructor(u) { - super(), this.color = new x.Color(16777215), this.ambient = new x.Color(1048575), this.emissive = new x.Color(0), this.wrapAround = !1, this.wrapRGB = new o.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 = g.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.setValues(u); + super(), this.color = new x.Color(16777215), this.ambient = new x.Color(1048575), this.emissive = new x.Color(0), this.wrapAround = !1, this.wrapRGB = new o.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 = p.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = l.Coloring.NoColors, this.skinning = !1, this.setValues(u); } - clone(u = new p()) { + clone(u = new g()) { return super.clone.call(this, u), u.color.copy(this.color), u.ambient.copy(this.ambient), u.emissive.copy(this.emissive), u.wrapAround = this.wrapAround, u.wrapRGB.copy(this.wrapRGB), u.map = this.map, u.lightMap = this.lightMap, u.specularMap = this.specularMap, u.envMap = this.envMap, u.combine = this.combine, u.reflectivity = this.reflectivity, u.refractionRatio = this.refractionRatio, u.fog = this.fog, u.shading = this.shading, u.shaderID = this.shaderID, u.vertexColors = this.vertexColors, u.skinning = this.skinning, u.morphTargets = this.morphTargets, u.morphNormals = this.morphNormals, u; } } @@ -13181,11 +13181,11 @@ ATOM`, h); var l = e( /*! ../../colors */ "./src/colors.ts" - ), g = e( + ), p = e( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class _ extends g.Material { + class _ extends p.Material { constructor(o) { super(), o = o || {}, this.fog = !0, this.shaderID = "outline", this.wireframe = !1, this.outlineColor = o.color || new l.Color(0, 0, 0), this.outlineWidth = o.width || 0.1, this.outlinePushback = o.pushback || 1; } @@ -13206,7 +13206,7 @@ ATOM`, h); /* harmony export */ SphereImposterMaterial: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -13214,11 +13214,11 @@ ATOM`, h); /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class g extends l.ImposterMaterial { + class p extends l.ImposterMaterial { constructor(x) { super(x), this.shaderID = "sphereimposter", this.setValues(x); } - clone(x = new g()) { + clone(x = new p()) { return super.clone.call(this, x), x; } } @@ -13242,11 +13242,11 @@ ATOM`, h); var l = e( /*! ../../colors */ "./src/colors.ts" - ), g = e( + ), p = e( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class _ extends g.ImposterMaterial { + class _ extends p.ImposterMaterial { constructor(o) { super(o), o = o || {}, this.shaderID = "sphereimposteroutline", this.outlineColor = o.color || new l.Color(0, 0, 0), this.outlineWidth = o.width || 0.1, this.outlinePushback = o.pushback || 1, this.setValues(o); } @@ -13267,14 +13267,14 @@ ATOM`, h); /* harmony export */ SpriteMaterial: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ../constants/SpriteAlignment */ "./src/WebGL/constants/SpriteAlignment.ts" - ), g = e( + ), p = e( /*! ../core/Texture */ "./src/WebGL/core/Texture.ts" ), _ = e( @@ -13287,11 +13287,11 @@ ATOM`, h); /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class p extends o.Material { + class g extends o.Material { constructor(u) { - super(), this.color = new _.Color(16777215), this.map = new g.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new x.Vector2(0, 0), this.uvScale = new x.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = l.SpriteAlignment.center.clone(), this.setValues(u), u = u || {}, u.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), u.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), u.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); + super(), this.color = new _.Color(16777215), this.map = new p.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new x.Vector2(0, 0), this.uvScale = new x.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = l.SpriteAlignment.center.clone(), this.setValues(u), u = u || {}, u.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), u.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), u.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); } - clone(u = new p()) { + clone(u = new g()) { return super.clone.call(this, u), u.color.copy(this.color), u.map = this.map, u.useScreenCoordinates = this.useScreenCoordinates, u.screenOffset = this.screenOffset, u.sizeAttenuation = this.sizeAttenuation, u.scaleByViewport = this.scaleByViewPort, u.alignment.copy(this.alignment), u.uvOffset.copy(this.uvOffset), u; } } @@ -13308,7 +13308,7 @@ ATOM`, h); /* harmony export */ StickImposterMaterial: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -13316,11 +13316,11 @@ ATOM`, h); /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class g extends l.ImposterMaterial { + class p extends l.ImposterMaterial { constructor(x) { super(x), this.shaderID = "stickimposter", this.setValues(x); } - clone(x = new g()) { + clone(x = new p()) { return super.clone.call(this, x), x; } } @@ -13344,11 +13344,11 @@ ATOM`, h); var l = e( /*! ../../colors */ "./src/colors.ts" - ), g = e( + ), p = e( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class _ extends g.ImposterMaterial { + class _ extends p.ImposterMaterial { constructor(o = {}) { super(o), this.shaderID = "stickimposteroutline", this.outlineColor = new l.Color(0, 0, 0), this.outlineWidth = 0.1, this.outlinePushback = 1, o.color && (this.outlineColor = o.color), o.width && (this.outlineWidth = o.width), o.pushback && (this.outlinePushback = o.pushback), this.setValues(o); } @@ -13376,7 +13376,7 @@ ATOM`, h); var l = e( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), g = e( + ), p = e( /*! ../../colors */ "./src/colors.ts" ), _ = e( @@ -13384,11 +13384,11 @@ ATOM`, h); "./src/WebGL/materials/Material.ts" ); class x extends _.Material { - constructor(p) { - super(), this.transparent = !1, this.volumetric = !0, this.color = new g.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 = l.FrontSide, this.setValues(p); + constructor(g) { + super(), this.transparent = !1, this.volumetric = !0, this.color = new p.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 = l.FrontSide, this.setValues(g); } - clone(p = new x()) { - return super.clone.call(this, p), p.transparent = this.transparent, p.volumetric = this.volumetric, p.color = this.color, p.transferfn = this.transferfn, p.map = this.map, p.extent = this.extent, p.maxdepth = this.maxdepth, p.unit = this.unit, p.texmatrix = this.texmatrix, p.transfermin = this.transfermin, p.transfermax = this.transfermax, p.subsamples = this.subsamples, p.shaderID = this.shaderID, p.side = this.side, p; + clone(g = new x()) { + return super.clone.call(this, g), g.transparent = this.transparent, g.volumetric = this.volumetric, g.color = this.color, g.transferfn = this.transferfn, g.map = this.map, g.extent = this.extent, g.maxdepth = this.maxdepth, g.unit = this.unit, g.texmatrix = this.texmatrix, g.transfermin = this.transfermin, g.transfermax = this.transfermax, g.subsamples = this.subsamples, g.shaderID = this.shaderID, g.side = this.side, g; } } } @@ -13409,7 +13409,7 @@ ATOM`, h); /* harmony export */ InstancedMaterial: () => ( /* reexport safe */ - g.InstancedMaterial + p.InstancedMaterial ), /* harmony export */ LineBasicMaterial: () => ( @@ -13434,7 +13434,7 @@ ATOM`, h); /* harmony export */ MeshLambertMaterial: () => ( /* reexport safe */ - p.MeshLambertMaterial + g.MeshLambertMaterial ), /* harmony export */ MeshOutlineMaterial: () => ( @@ -13454,12 +13454,12 @@ ATOM`, h); /* harmony export */ SpriteMaterial: () => ( /* reexport safe */ - C.SpriteMaterial + L.SpriteMaterial ), /* harmony export */ StickImposterMaterial: () => ( /* reexport safe */ - L.StickImposterMaterial + C.StickImposterMaterial ), /* harmony export */ StickImposterOutlineMaterial: () => ( @@ -13476,7 +13476,7 @@ ATOM`, h); var l = e( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" - ), g = e( + ), p = e( /*! ./InstancedMaterial */ "./src/WebGL/materials/InstancedMaterial.ts" ), _ = e( @@ -13488,7 +13488,7 @@ ATOM`, h); ), o = e( /*! ./MeshDoubleLambertMaterial */ "./src/WebGL/materials/MeshDoubleLambertMaterial.ts" - ), p = e( + ), g = e( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" ), E = e( @@ -13500,10 +13500,10 @@ ATOM`, h); ), A = e( /*! ./SphereImposterOutlineMaterial */ "./src/WebGL/materials/SphereImposterOutlineMaterial.ts" - ), C = e( + ), L = e( /*! ./SpriteMaterial */ "./src/WebGL/materials/SpriteMaterial.ts" - ), L = e( + ), C = e( /*! ./StickImposterMaterial */ "./src/WebGL/materials/StickImposterMaterial.ts" ), D = e( @@ -13531,11 +13531,11 @@ ATOM`, h); /* harmony export */ }); class l { - constructor(_, x, o, p) { - this.x = _ || 0, this.y = x || 0, this.z = o || 0, this.w = p !== void 0 ? p : 1; + constructor(_, x, o, g) { + this.x = _ || 0, this.y = x || 0, this.z = o || 0, this.w = g !== void 0 ? g : 1; } - set(_, x, o, p) { - return this.x = _, this.y = x, this.z = o, this.w = p, this; + set(_, x, o, g) { + return this.x = _, this.y = x, this.z = o, this.w = g, this; } copy(_) { return this.x = _.x, this.y = _.y, this.z = _.z, this.w = _.w, this; @@ -13563,8 +13563,8 @@ ATOM`, h); return this.x *= _, this.y *= _, this.z *= _, this.w *= _, this; } multiplyQuaternions(_, x) { - const o = _.x, p = _.y, E = _.z, u = _.w, A = x.x, C = x.y, L = x.z, D = x.w; - return this.x = o * D + u * A + p * L - E * C, this.y = p * D + u * C + E * A - o * L, this.z = E * D + u * L + o * C - p * A, this.w = u * D - o * A - p * C - E * L, this; + const o = _.x, g = _.y, E = _.z, u = _.w, A = x.x, L = x.y, C = x.z, D = x.w; + return this.x = o * D + u * A + g * C - E * L, this.y = g * D + u * L + E * A - o * C, this.z = E * D + u * C + o * L - g * A, this.w = u * D - o * A - g * L - E * C, this; } sub(_) { return this.x -= _.x, this.y -= _.y, this.z -= _.z, this.w -= _.w, this; @@ -13573,8 +13573,8 @@ ATOM`, h); return new l(this.x, this.y, this.z, this.w); } setFromEuler(_) { - const x = Math.cos(_.x / 2), o = Math.cos(_.y / 2), p = Math.cos(_.z / 2), E = Math.sin(_.x / 2), u = Math.sin(_.y / 2), A = Math.sin(_.z / 2); - return this.x = E * o * p + x * u * A, this.y = x * u * p - E * o * A, this.z = x * o * A + E * u * p, this.w = x * o * p - E * u * A, this; + const x = Math.cos(_.x / 2), o = Math.cos(_.y / 2), g = Math.cos(_.z / 2), E = Math.sin(_.x / 2), u = Math.sin(_.y / 2), A = Math.sin(_.z / 2); + return this.x = E * o * g + x * u * A, this.y = x * u * g - E * o * A, this.z = x * o * A + E * u * g, this.w = x * o * g - E * u * A, this; } } } @@ -13624,12 +13624,12 @@ ATOM`, h); /* harmony export */ Matrix3: () => ( /* reexport safe */ - p.Matrix3 + g.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - p.Matrix4 + g.Matrix4 ), /* harmony export */ Quaternion: () => ( @@ -13639,17 +13639,17 @@ ATOM`, h); /* harmony export */ Ray: () => ( /* reexport safe */ - p.Ray + g.Ray ), /* harmony export */ Vector2: () => ( /* reexport safe */ - g.Vector2 + p.Vector2 ), /* harmony export */ Vector3: () => ( /* reexport safe */ - p.Vector3 + g.Vector3 ), /* harmony export */ clamp: () => ( @@ -13671,7 +13671,7 @@ ATOM`, h); var l = e( /*! ./Quaternion */ "./src/WebGL/math/Quaternion.ts" - ), g = e( + ), p = e( /*! ./Vector2 */ "./src/WebGL/math/Vector2.ts" ), _ = e( @@ -13683,7 +13683,7 @@ ATOM`, h); ), o = e( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" - ), p = e( + ), g = e( /*! ./math */ "./src/WebGL/math/math.ts" ); @@ -13700,7 +13700,7 @@ ATOM`, h); /* harmony export */ Matrix3: () => ( /* binding */ - C + L ), /* harmony export */ Matrix4: () => ( @@ -13710,7 +13710,7 @@ ATOM`, h); /* harmony export */ Ray: () => ( /* binding */ - L + C ), /* harmony export */ Vector3: () => ( @@ -13722,21 +13722,21 @@ ATOM`, h); var l = e( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" - ), g = e( + ), p = e( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), _, x, o, p, E; + ), _, x, o, g, E; class u { - constructor(r = 1, n = 0, b = 0, f = 0, c = 0, t = 1, a = 0, h = 0, M = 0, w = 0, S = 1, T = 0, R = 0, z = 0, P = 0, B = 1) { - typeof r < "u" && typeof r != "number" ? this.elements = new Float32Array(r) : (this.elements = new Float32Array(16), this.elements[0] = r, this.elements[4] = n, this.elements[8] = b, this.elements[12] = f, this.elements[1] = c, this.elements[5] = t, this.elements[9] = a, this.elements[13] = h, this.elements[2] = M, this.elements[6] = w, this.elements[10] = S, this.elements[14] = T, this.elements[3] = R, this.elements[7] = z, this.elements[11] = P, this.elements[15] = B); + constructor(r = 1, n = 0, b = 0, f = 0, c = 0, t = 1, a = 0, h = 0, M = 0, w = 0, S = 1, T = 0, R = 0, $ = 0, P = 0, B = 1) { + typeof r < "u" && typeof r != "number" ? this.elements = new Float32Array(r) : (this.elements = new Float32Array(16), this.elements[0] = r, this.elements[4] = n, this.elements[8] = b, this.elements[12] = f, this.elements[1] = c, this.elements[5] = t, this.elements[9] = a, this.elements[13] = h, this.elements[2] = M, this.elements[6] = w, this.elements[10] = S, this.elements[14] = T, this.elements[3] = R, this.elements[7] = $, this.elements[11] = P, this.elements[15] = B); } // eslint-disable-next-line no-unused-vars, class-methods-use-this makeScale(r, n, b) { throw new Error("Method not implemented."); } - set(r, n, b, f, c, t, a, h, M, w, S, T, R, z, P, B) { - const U = this.elements; - return U[0] = r, U[4] = n, U[8] = b, U[12] = f, U[1] = c, U[5] = t, U[9] = a, U[13] = h, U[2] = M, U[6] = w, U[10] = S, U[14] = T, U[3] = R, U[7] = z, U[11] = P, U[15] = B, this; + set(r, n, b, f, c, t, a, h, M, w, S, T, R, $, P, B) { + const F = this.elements; + return F[0] = r, F[4] = n, F[8] = b, F[12] = f, F[1] = c, F[5] = t, F[9] = a, F[13] = h, F[2] = M, F[6] = w, F[10] = S, F[14] = T, F[3] = R, F[7] = $, F[11] = P, F[15] = B, this; } identity() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this; @@ -13747,24 +13747,24 @@ ATOM`, h); } matrix3FromTopLeft() { const r = this.elements; - return new C(r[0], r[4], r[8], r[1], r[5], r[9], r[2], r[6], r[10]); + return new L(r[0], r[4], r[8], r[1], r[5], r[9], r[2], r[6], r[10]); } setRotationFromEuler(r, n) { const b = this.elements, { x: f, y: c, z: t } = r, a = Math.cos(f), h = Math.sin(f), M = Math.cos(c), w = Math.sin(c), S = Math.cos(t), T = Math.sin(t); if (n === void 0 || n === "XYZ") { - const R = a * S, z = a * T, P = h * S, B = h * T; - b[0] = M * S, b[4] = -M * T, b[8] = w, b[1] = z + P * w, b[5] = R - B * w, b[9] = -h * M, b[2] = B - R * w, b[6] = P + z * w, b[10] = a * M; + const R = a * S, $ = a * T, P = h * S, B = h * T; + b[0] = M * S, b[4] = -M * T, b[8] = w, b[1] = $ + P * w, b[5] = R - B * w, b[9] = -h * M, b[2] = B - R * w, b[6] = P + $ * w, b[10] = a * M; } else console.error(`Error with matrix4 setRotationFromEuler. Order: ${n}`); return this; } setRotationFromQuaternion(r) { - const n = this.elements, { x: b, y: f, z: c, w: t } = r, a = b + b, h = f + f, M = c + c, w = b * a, S = b * h, T = b * M, R = f * h, z = f * M, P = c * M, B = t * a, U = t * h, F = t * M; - return n[0] = 1 - (R + P), n[4] = S - F, n[8] = T + U, n[1] = S + F, n[5] = 1 - (w + P), n[9] = z - B, n[2] = T - U, n[6] = z + B, n[10] = 1 - (w + R), this; + const n = this.elements, { x: b, y: f, z: c, w: t } = r, a = b + b, h = f + f, M = c + c, w = b * a, S = b * h, T = b * M, R = f * h, $ = f * M, P = c * M, B = t * a, F = t * h, U = t * M; + return n[0] = 1 - (R + P), n[4] = S - U, n[8] = T + F, n[1] = S + U, n[5] = 1 - (w + P), n[9] = $ - B, n[2] = T - F, n[6] = $ + B, n[10] = 1 - (w + R), this; } multiplyMatrices(r, n) { - const b = r.elements, f = n.elements, c = this.elements, t = b[0], a = b[4], h = b[8], M = b[12], w = b[1], S = b[5], T = b[9], R = b[13], z = b[2], P = b[6], B = b[10], U = b[14], F = b[3], $ = b[7], W = b[11], N = b[15], G = f[0], k = f[4], j = f[8], Q = f[12], ie = f[1], pe = f[5], he = f[9], ue = f[13], se = f[2], ae = f[6], we = f[10], xe = f[14], Ie = f[3], oe = f[7], ve = f[11], re = f[15]; - return c[0] = t * G + a * ie + h * se + M * Ie, c[4] = t * k + a * pe + h * ae + M * oe, c[8] = t * j + a * he + h * we + M * ve, c[12] = t * Q + a * ue + h * xe + M * re, c[1] = w * G + S * ie + T * se + R * Ie, c[5] = w * k + S * pe + T * ae + R * oe, c[9] = w * j + S * he + T * we + R * ve, c[13] = w * Q + S * ue + T * xe + R * re, c[2] = z * G + P * ie + B * se + U * Ie, c[6] = z * k + P * pe + B * ae + U * oe, c[10] = z * j + P * he + B * we + U * ve, c[14] = z * Q + P * ue + B * xe + U * re, c[3] = F * G + $ * ie + W * se + N * Ie, c[7] = F * k + $ * pe + W * ae + N * oe, c[11] = F * j + $ * he + W * we + N * ve, c[15] = F * Q + $ * ue + W * xe + N * re, this; + const b = r.elements, f = n.elements, c = this.elements, t = b[0], a = b[4], h = b[8], M = b[12], w = b[1], S = b[5], T = b[9], R = b[13], $ = b[2], P = b[6], B = b[10], F = b[14], U = b[3], z = b[7], W = b[11], V = b[15], N = f[0], k = f[4], G = f[8], Q = f[12], ie = f[1], ge = f[5], le = f[9], oe = f[13], he = f[2], se = f[6], xe = f[10], ye = f[14], Pe = f[3], de = f[7], pe = f[11], re = f[15]; + return c[0] = t * N + a * ie + h * he + M * Pe, c[4] = t * k + a * ge + h * se + M * de, c[8] = t * G + a * le + h * xe + M * pe, c[12] = t * Q + a * oe + h * ye + M * re, c[1] = w * N + S * ie + T * he + R * Pe, c[5] = w * k + S * ge + T * se + R * de, c[9] = w * G + S * le + T * xe + R * pe, c[13] = w * Q + S * oe + T * ye + R * re, c[2] = $ * N + P * ie + B * he + F * Pe, c[6] = $ * k + P * ge + B * se + F * de, c[10] = $ * G + P * le + B * xe + F * pe, c[14] = $ * Q + P * oe + B * ye + F * re, c[3] = U * N + z * ie + W * he + V * Pe, c[7] = U * k + z * ge + W * se + V * de, c[11] = U * G + z * le + W * xe + V * pe, c[15] = U * Q + z * oe + W * ye + V * re, this; } multiplyScalar(r) { const n = this.elements; @@ -13797,16 +13797,16 @@ ATOM`, h); return n[12] += r.x, n[13] += r.y, n[14] += r.z, this; } getInverse(r, n) { - const b = this.elements, f = r.elements, c = f[0], t = f[4], a = f[8], h = f[12], M = f[1], w = f[5], S = f[9], T = f[13], R = f[2], z = f[6], P = f[10], B = f[14], U = f[3], F = f[7], $ = f[11], W = f[15]; - b[0] = S * B * F - T * P * F + T * z * $ - w * B * $ - S * z * W + w * P * W, b[4] = h * P * F - a * B * F - h * z * $ + t * B * $ + a * z * W - t * P * W, b[8] = a * T * F - h * S * F + h * w * $ - t * T * $ - a * w * W + t * S * W, b[12] = h * S * z - a * T * z - h * w * P + t * T * P + a * w * B - t * S * B, b[1] = T * P * U - S * B * U - T * R * $ + M * B * $ + S * R * W - M * P * W, b[5] = a * B * U - h * P * U + h * R * $ - c * B * $ - a * R * W + c * P * W, b[9] = h * S * U - a * T * U - h * M * $ + c * T * $ + a * M * W - c * S * W, b[13] = a * T * R - h * S * R + h * M * P - c * T * P - a * M * B + c * S * B, b[2] = w * B * U - T * z * U + T * R * F - M * B * F - w * R * W + M * z * W, b[6] = h * z * U - t * B * U - h * R * F + c * B * F + t * R * W - c * z * W, b[10] = t * T * U - h * w * U + h * M * F - c * T * F - t * M * W + c * w * W, b[14] = h * w * R - t * T * R - h * M * z + c * T * z + t * M * B - c * w * B, b[3] = S * z * U - w * P * U - S * R * F + M * P * F + w * R * $ - M * z * $, b[7] = t * P * U - a * z * U + a * R * F - c * P * F - t * R * $ + c * z * $, b[11] = a * w * U - t * S * U - a * M * F + c * S * F + t * M * $ - c * w * $, b[15] = t * S * R - a * w * R + a * M * z - c * S * z - t * M * P + c * w * P; - const N = c * b[0] + M * b[4] + R * b[8] + U * b[12]; - if (N === 0) { - const G = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; + const b = this.elements, f = r.elements, c = f[0], t = f[4], a = f[8], h = f[12], M = f[1], w = f[5], S = f[9], T = f[13], R = f[2], $ = f[6], P = f[10], B = f[14], F = f[3], U = f[7], z = f[11], W = f[15]; + b[0] = S * B * U - T * P * U + T * $ * z - w * B * z - S * $ * W + w * P * W, b[4] = h * P * U - a * B * U - h * $ * z + t * B * z + a * $ * W - t * P * W, b[8] = a * T * U - h * S * U + h * w * z - t * T * z - a * w * W + t * S * W, b[12] = h * S * $ - a * T * $ - h * w * P + t * T * P + a * w * B - t * S * B, b[1] = T * P * F - S * B * F - T * R * z + M * B * z + S * R * W - M * P * W, b[5] = a * B * F - h * P * F + h * R * z - c * B * z - a * R * W + c * P * W, b[9] = h * S * F - a * T * F - h * M * z + c * T * z + a * M * W - c * S * W, b[13] = a * T * R - h * S * R + h * M * P - c * T * P - a * M * B + c * S * B, b[2] = w * B * F - T * $ * F + T * R * U - M * B * U - w * R * W + M * $ * W, b[6] = h * $ * F - t * B * F - h * R * U + c * B * U + t * R * W - c * $ * W, b[10] = t * T * F - h * w * F + h * M * U - c * T * U - t * M * W + c * w * W, b[14] = h * w * R - t * T * R - h * M * $ + c * T * $ + t * M * B - c * w * B, b[3] = S * $ * F - w * P * F - S * R * U + M * P * U + w * R * z - M * $ * z, b[7] = t * P * F - a * $ * F + a * R * U - c * P * U - t * R * z + c * $ * z, b[11] = a * w * F - t * S * F - a * M * U + c * S * U + t * M * z - c * w * z, b[15] = t * S * R - a * w * R + a * M * $ - c * S * $ - t * M * P + c * w * P; + const V = c * b[0] + M * b[4] + R * b[8] + F * b[12]; + if (V === 0) { + const N = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; if (n) - throw new Error(G); - return console.warn(G), this.identity(), this; + throw new Error(N); + return console.warn(N), this.identity(), this; } - return this.multiplyScalar(1 / N), this; + return this.multiplyScalar(1 / V), this; } isReflected() { const r = this.elements, n = r[0], b = r[4], f = r[8], c = r[1], t = r[5], a = r[9], h = r[2], M = r[6], w = r[10]; @@ -13855,11 +13855,11 @@ ATOM`, h); } getScale(r) { const n = this.elements; - return r = r || new A(), o.set(n[0], n[1], n[2]), p.set(n[4], n[5], n[6]), E.set(n[8], n[9], n[10]), r.x = o.length(), r.y = p.length(), r.z = E.length(), r; + return r = r || new A(), o.set(n[0], n[1], n[2]), g.set(n[4], n[5], n[6]), E.set(n[8], n[9], n[10]), r.x = o.length(), r.y = g.length(), r.z = E.length(), r; } lookAt(r, n, b) { const f = this.elements; - return E.subVectors(r, n).normalize(), E.length() === 0 && (E.z = 1), o.crossVectors(b, E).normalize(), o.length() === 0 && (E.x += 1e-4, o.crossVectors(b, E).normalize()), p.crossVectors(E, o), f[0] = o.x, f[4] = p.x, f[8] = E.x, f[1] = o.y, f[5] = p.y, f[9] = E.y, f[2] = o.z, f[6] = p.z, f[10] = E.z, this; + return E.subVectors(r, n).normalize(), E.length() === 0 && (E.z = 1), o.crossVectors(b, E).normalize(), o.length() === 0 && (E.x += 1e-4, o.crossVectors(b, E).normalize()), g.crossVectors(E, o), f[0] = o.x, f[4] = g.x, f[8] = E.x, f[1] = o.y, f[5] = g.y, f[9] = E.y, f[2] = o.z, f[6] = g.z, f[10] = E.z, this; } compose(r, n, b) { const f = this.elements; @@ -13961,7 +13961,7 @@ ATOM`, h); } setEulerFromRotationMatrix(r, n) { const b = r.elements, f = b[0], c = b[4], t = b[8], a = b[5], h = b[9], M = b[6], w = b[10]; - return n === void 0 || n === "XYZ" ? (this.y = Math.asin((0, g.clamp)(t, -1, 1)), Math.abs(t) < 0.99999 ? (this.x = Math.atan2(-h, w), this.z = Math.atan2(-c, f)) : (this.x = Math.atan2(M, a), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${n}`), this; + return n === void 0 || n === "XYZ" ? (this.y = Math.asin((0, p.clamp)(t, -1, 1)), Math.abs(t) < 0.99999 ? (this.x = Math.atan2(-h, w), this.z = Math.atan2(-c, f)) : (this.x = Math.atan2(M, a), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${n}`), this; } rotateAboutVector(r, n) { r.normalize(); @@ -13985,8 +13985,8 @@ ATOM`, h); return n.multiplyMatrices(r.matrixWorld, n.getInverse(r.projectionMatrix)), this.applyMatrix4(n); } } - o = new A(), p = new A(), E = new A(); - class C { + o = new A(), g = new A(), E = new A(); + class L { constructor(r = 1, n = 0, b = 0, f = 0, c = 1, t = 0, a = 0, h = 0, M = 1) { this.elements = new Float32Array(9), this.set(r, n, b, f, c, t, a, h, M); } @@ -14040,14 +14040,14 @@ ATOM`, h); } clone() { const r = this.elements; - return new C(r[0], r[3], r[6], r[1], r[4], r[7], r[2], r[5], r[8]); + return new L(r[0], r[3], r[6], r[1], r[4], r[7], r[2], r[5], r[8]); } getMatrix4() { const r = this.elements; return new u(r[0], r[3], r[6], 0, r[1], r[4], r[7], 0, r[2], r[5], r[8], 0); } } - class L { + class C { constructor(r, n) { this.origin = r !== void 0 ? r : new A(), this.direction = n !== void 0 ? n : new A(); } @@ -14096,7 +14096,7 @@ ATOM`, h); return this.direction.add(this.origin).applyMatrix4(r), this.origin.applyMatrix4(r), this.direction.sub(this.origin), this; } clone() { - return new L().copy(this); + return new C().copy(this); } } } @@ -14116,8 +14116,8 @@ ATOM`, h); ) /* harmony export */ }); - function l(g, _, x) { - return Math.min(Math.max(g, _), x); + function l(p, _, x) { + return Math.min(Math.max(p, _), x); } } ), @@ -14132,7 +14132,7 @@ ATOM`, h); /* harmony export */ conversionMatrix3: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14140,10 +14140,10 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/math.ts" ); - function g(_, x, o, p, E, u) { - p = p * Math.PI / 180, E = E * Math.PI / 180, u = u * Math.PI / 180; - const A = (b) => b * b, C = Math.cos(p), L = Math.cos(E), D = Math.cos(u), r = Math.sin(u); - return new l.Matrix3(_, x * D, o * L, 0, x * r, o * (C - L * D) / r, 0, 0, o * Math.sqrt(1 - A(C) - A(L) - A(D) + 2 * C * L * D) / r); + function p(_, x, o, g, E, u) { + g = g * Math.PI / 180, E = E * Math.PI / 180, u = u * Math.PI / 180; + const A = (b) => b * b, L = Math.cos(g), C = Math.cos(E), D = Math.cos(u), r = Math.sin(u); + return new l.Matrix3(_, x * D, o * C, 0, x * r, o * (L - C * D) / r, 0, 0, o * Math.sqrt(1 - A(L) - A(C) - A(D) + 2 * L * C * D) / r); } } ), @@ -14158,12 +14158,12 @@ ATOM`, h); /* harmony export */ degToRad: () => ( /* binding */ - g + p ) /* harmony export */ }); const l = Math.PI / 180; - function g(_) { + function p(_) { return _ * l; } } @@ -14191,21 +14191,21 @@ ATOM`, h); var l = e( /*! ../materials */ "./src/WebGL/materials/index.ts" - ), g = e( + ), p = e( /*! ../core */ "./src/WebGL/core/index.ts" ), _; (function(o) { o[o.LineStrip = 0] = "LineStrip", o[o.LinePieces = 1] = "LinePieces"; })(_ || (_ = {})); - class x extends g.Object3D { - constructor(p, E = new l.LineBasicMaterial({ + class x extends p.Object3D { + constructor(g, E = new l.LineBasicMaterial({ color: Math.random() * 16777215 }), u = _.LineStrip) { - super(), this.geometry = p, this.material = E, this.type = u; + super(), this.geometry = g, this.material = E, this.type = u; } - clone(p = new x(this.geometry, this.material, this.type)) { - return super.clone.call(this, p), p; + clone(g = new x(this.geometry, this.material, this.type)) { + return super.clone.call(this, g), g; } } } @@ -14221,7 +14221,7 @@ ATOM`, h); /* harmony export */ Mesh: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14229,12 +14229,12 @@ ATOM`, h); /*! ../core */ "./src/WebGL/core/index.ts" ); - class g extends l.Object3D { + class p extends l.Object3D { constructor(x, o) { super(), this.geometry = x, this.material = o; } clone(x) { - return x === void 0 && (x = new g(this.geometry, this.material)), super.clone.call(this, x), x; + return x === void 0 && (x = new p(this.geometry, this.material)), super.clone.call(this, x), x; } } } @@ -14257,11 +14257,11 @@ ATOM`, h); var l = e( /*! ../materials */ "./src/WebGL/materials/index.ts" - ), g = e( + ), p = e( /*! ../core */ "./src/WebGL/core/index.ts" ); - class _ extends g.Object3D { + class _ extends p.Object3D { constructor(o = new l.SpriteMaterial()) { super(), this.material = o, this.rotation3d = this.rotation, this.rotation = 0; } @@ -14269,7 +14269,7 @@ ATOM`, h); this.matrix.setPosition(this.position), this.rotation3d.set(0, 0, this.rotation), this.matrix.setRotationFromEuler(this.rotation3d), (this.scale.x !== 1 || this.scale.y !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0; } clone(o = new _(this.material)) { - return g.Object3D.prototype.clone.call(this, o), o; + return p.Object3D.prototype.clone.call(this, o), o; } } } @@ -14295,7 +14295,7 @@ ATOM`, h); /* harmony export */ Mesh: () => ( /* reexport safe */ - g.Mesh + p.Mesh ), /* harmony export */ Sprite: () => ( @@ -14307,7 +14307,7 @@ ATOM`, h); var l = e( /*! ./Line */ "./src/WebGL/objects/Line.ts" - ), g = e( + ), p = e( /*! ./Mesh */ "./src/WebGL/objects/Mesh.ts" ), _ = e( @@ -14342,7 +14342,7 @@ ATOM`, h); /* harmony export */ ShaderUtils: () => ( /* reexport safe */ - g.ShaderUtils + p.ShaderUtils ), /* harmony export */ basic: () => ( @@ -14352,7 +14352,7 @@ ATOM`, h); /* harmony export */ clone: () => ( /* reexport safe */ - g.clone + p.clone ), /* harmony export */ instanced: () => ( @@ -14419,7 +14419,7 @@ ATOM`, h); var l = e( /*! ./lib */ "./src/WebGL/shaders/lib/index.ts" - ), g = e( + ), p = e( /*! ./utils */ "./src/WebGL/shaders/utils/index.ts" ); @@ -14447,7 +14447,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/basic/uniforms.ts" - ), g = e( + ), p = e( /*! ./basic.frag */ "./src/WebGL/shaders/lib/basic/basic.frag" ), _ = e( @@ -14456,7 +14456,7 @@ ATOM`, h); ); const x = { vertexShader: _.default.replace("#define GLSLIFY 1", ""), - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; } @@ -14472,7 +14472,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14480,7 +14480,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -14509,7 +14509,7 @@ ATOM`, h); /* harmony export */ instanced: () => ( /* reexport safe */ - g.instanced + p.instanced ), /* harmony export */ lambert: () => ( @@ -14529,7 +14529,7 @@ ATOM`, h); /* harmony export */ screen: () => ( /* reexport safe */ - p.screen + g.screen ), /* harmony export */ screenaa: () => ( @@ -14549,12 +14549,12 @@ ATOM`, h); /* harmony export */ sprite: () => ( /* reexport safe */ - C.sprite + L.sprite ), /* harmony export */ stickimposter: () => ( /* reexport safe */ - L.stickimposter + C.stickimposter ), /* harmony export */ stickimposteroutline: () => ( @@ -14571,7 +14571,7 @@ ATOM`, h); var l = e( /*! ./basic */ "./src/WebGL/shaders/lib/basic/index.ts" - ), g = e( + ), p = e( /*! ./instanced */ "./src/WebGL/shaders/lib/instanced/index.ts" ), _ = e( @@ -14583,7 +14583,7 @@ ATOM`, h); ), o = e( /*! ./outline */ "./src/WebGL/shaders/lib/outline/index.ts" - ), p = e( + ), g = e( /*! ./screen */ "./src/WebGL/shaders/lib/screen/index.ts" ), E = e( @@ -14595,10 +14595,10 @@ ATOM`, h); ), A = e( /*! ./sphereimposteroutline */ "./src/WebGL/shaders/lib/sphereimposteroutline/index.ts" - ), C = e( + ), L = e( /*! ./sprite */ "./src/WebGL/shaders/lib/sprite/index.ts" - ), L = e( + ), C = e( /*! ./stickimposter */ "./src/WebGL/shaders/lib/stickimposter/index.ts" ), D = e( @@ -14610,16 +14610,16 @@ ATOM`, h); ); const n = { basic: l.basic, - instanced: g.instanced, + instanced: p.instanced, lambert: _.lambert, lambertdouble: x.lambertdouble, outline: o.outline, - screen: p.screen, + screen: g.screen, screenaa: E.screenaa, sphereimposter: u.sphereimposter, sphereimposteroutline: A.sphereimposteroutline, - sprite: C.sprite, - stickimposter: L.stickimposter, + sprite: L.sprite, + stickimposter: C.stickimposter, stickimposteroutline: D.stickimposteroutline, volumetric: r.volumetric }; @@ -14643,7 +14643,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/instanced/uniforms.ts" - ), g = e( + ), p = e( /*! ./instanced.frag */ "./src/WebGL/shaders/lib/instanced/instanced.frag" ), _ = e( @@ -14651,7 +14651,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/instanced/instanced.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14668,7 +14668,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14676,7 +14676,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -14704,7 +14704,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambert/uniforms.ts" - ), g = e( + ), p = e( /*! ./lambert.frag */ "./src/WebGL/shaders/lib/lambert/lambert.frag" ), _ = e( @@ -14712,7 +14712,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/lambert/lambert.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14729,7 +14729,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14737,7 +14737,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -14765,7 +14765,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambertdouble/uniforms.ts" - ), g = e( + ), p = e( /*! ./lambertdouble.frag */ "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag" ), _ = e( @@ -14773,7 +14773,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14790,7 +14790,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14798,7 +14798,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -14826,7 +14826,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/outline/uniforms.ts" - ), g = e( + ), p = e( /*! ./outline.frag */ "./src/WebGL/shaders/lib/outline/outline.frag" ), _ = e( @@ -14834,7 +14834,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/outline/outline.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14851,7 +14851,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -14859,7 +14859,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, outlineColor: { type: "c", value: new l.Color(0, 0, 0) }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, @@ -14888,7 +14888,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/screen/uniforms.ts" - ), g = e( + ), p = e( /*! ./screen.frag */ "./src/WebGL/shaders/lib/screen/screen.frag" ), _ = e( @@ -14896,7 +14896,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/screen/screen.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14938,7 +14938,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/screenaa/uniforms.ts" - ), g = e( + ), p = e( /*! ./screenaa.frag */ "./src/WebGL/shaders/lib/screenaa/screenaa.frag" ), _ = e( @@ -14946,7 +14946,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/screenaa/screenaa.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -14988,7 +14988,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposter/uniforms.ts" - ), g = e( + ), p = e( /*! ./sphereimposter.frag */ "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag" ), _ = e( @@ -14997,7 +14997,7 @@ ATOM`, h); ); const x = { vertexShader: _.default.replace("#define GLSLIFY 1", ""), - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; } @@ -15013,7 +15013,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15021,7 +15021,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -15049,7 +15049,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts" - ), g = e( + ), p = e( /*! ./sphereimposteroutline.frag */ "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag" ), _ = e( @@ -15057,7 +15057,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -15074,7 +15074,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15082,7 +15082,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, outlineColor: { type: "c", value: new l.Color(0, 0, 0) }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, @@ -15111,7 +15111,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/sprite/uniforms.ts" - ), g = e( + ), p = e( /*! ./sprite.frag */ "./src/WebGL/shaders/lib/sprite/sprite.frag" ), _ = e( @@ -15119,7 +15119,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/sprite/sprite.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -15154,14 +15154,14 @@ ATOM`, h); /* harmony export */ stickimposter: () => ( /* binding */ - p + g ) /* harmony export */ }); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposter/uniforms.ts" - ), g = e( + ), p = e( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" ), _ = e( @@ -15171,8 +15171,8 @@ ATOM`, h); /*! ./stickimposter.vert */ "./src/WebGL/shaders/lib/stickimposter/stickimposter.vert" ); - const p = { - fragmentShader: [g.default, _.default].join(` + const g = { + fragmentShader: [p.default, _.default].join(` `).replace("#define GLSLIFY 1", ""), vertexShader: x.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms @@ -15190,7 +15190,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15198,7 +15198,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -15226,7 +15226,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts" - ), g = e( + ), p = e( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" ), _ = e( @@ -15234,7 +15234,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert" ); const o = { - fragmentShader: (g.default + "gl_FragColor = vec4(color,1.0);}").replace("#define GLSLIFY 1", ""), + fragmentShader: (p.default + "gl_FragColor = vec4(color,1.0);}").replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -15251,7 +15251,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15259,7 +15259,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -15288,7 +15288,7 @@ ATOM`, h); var l = e( /*! ./uniforms */ "./src/WebGL/shaders/lib/volumetric/uniforms.ts" - ), g = e( + ), p = e( /*! ./volumetric.frag */ "./src/WebGL/shaders/lib/volumetric/volumetric.frag" ), _ = e( @@ -15296,7 +15296,7 @@ ATOM`, h); "./src/WebGL/shaders/lib/volumetric/volumetric.vert" ); const x = { - fragmentShader: g.default.replace("#define GLSLIFY 1", ""), + fragmentShader: p.default.replace("#define GLSLIFY 1", ""), vertexShader: _.default.replace("#define GLSLIFY 1", ""), uniforms: l.uniforms }; @@ -15313,7 +15313,7 @@ ATOM`, h); /* harmony export */ uniforms: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15321,7 +15321,7 @@ ATOM`, h); /*! ../../../../colors */ "./src/colors.ts" ); - const g = { + const p = { opacity: { type: "f", value: 1 }, fogColor: { type: "c", value: new l.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, @@ -15350,7 +15350,7 @@ ATOM`, h); /* harmony export */ clone: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15358,12 +15358,12 @@ ATOM`, h); /*! ../../../colors */ "./src/colors.ts" ); - function g(_) { + function p(_) { let x = {}; - for (const p in _) { - x[p] = {}, x[p].type = _[p].type; - var o = _[p].value; - o instanceof l.Color ? x[p].value = o.clone() : typeof o == "number" ? x[p].value = o : o instanceof Array ? x[p].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); + for (const g in _) { + x[g] = {}, x[g].type = _[g].type; + var o = _[g].value; + o instanceof l.Color ? x[g].value = o.clone() : typeof o == "number" ? x[g].value = o : o instanceof Array ? x[g].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); } return x; } @@ -15392,13 +15392,13 @@ ATOM`, h); var l = e( /*! ./clone */ "./src/WebGL/shaders/utils/clone.ts" - ), g = e( + ), p = e( /*! ./stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" ); const _ = { clone: l.clone, - stickimposterFragmentShader: g.default + stickimposterFragmentShader: p.default }; } ), @@ -15421,16 +15421,16 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - let g = new l.Vector3(); + let p = new l.Vector3(); class _ { - constructor(o = new l.Vector3(), p = new l.Vector3(), E = 0) { - this.c1 = o, this.c2 = p, this.radius = E, this.direction = new l.Vector3().subVectors(this.c2, this.c1).normalize(); + constructor(o = new l.Vector3(), g = new l.Vector3(), E = 0) { + this.c1 = o, this.c2 = g, this.radius = E, this.direction = new l.Vector3().subVectors(this.c2, this.c1).normalize(); } copy(o) { return this.c1.copy(o.c1), this.c2.copy(o.c2), this.direction.copy(o.direction), this.radius = o.radius, this; } lengthSq() { - return g.subVectors(this.c2, this.c1).lengthSq(); + return p.subVectors(this.c2, this.c1).lengthSq(); } applyMatrix4(o) { return this.direction.add(this.c1).applyMatrix4(o), this.c1.applyMatrix4(o), this.c2.applyMatrix4(o), this.direction.sub(this.c1).normalize(), this.radius = this.radius * o.getMaxScaleOnAxis(), this; @@ -15449,7 +15449,7 @@ ATOM`, h); /* harmony export */ Sphere: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -15457,7 +15457,7 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - class g { + class p { constructor(x = { x: 0, y: 0, z: 0 }, o = 0) { this.center = new l.Vector3(x.x, x.y, x.z), this.radius = o; } @@ -15477,7 +15477,7 @@ ATOM`, h); return x.center.equals(this.center) && x.radius === this.radius; } clone() { - return new g().copy(this); + return new p().copy(this); } } } @@ -15501,10 +15501,10 @@ ATOM`, h); /*! ../math */ "./src/WebGL/math/index.ts" ); - const g = new l.Vector3(); + const p = new l.Vector3(); class _ { - constructor(o = new l.Vector3(), p = new l.Vector3(), E = new l.Vector3()) { - this.a = o, this.b = p, this.c = E; + constructor(o = new l.Vector3(), g = new l.Vector3(), E = new l.Vector3()) { + this.a = o, this.b = g, this.c = E; } copy(o) { return this.a.copy(o.a), this.b.copy(o.b), this.c.copy(o.c), this; @@ -15514,7 +15514,7 @@ ATOM`, h); } getNormal() { var o = this.a.clone(); - return o.sub(this.b), g.subVectors(this.c, this.b), o.cross(g), o.normalize(), o; + return o.sub(this.b), p.subVectors(this.c, this.b), o.cross(p), o.normalize(), o; } } } @@ -15530,7 +15530,7 @@ ATOM`, h); /* harmony export */ Cylinder: () => ( /* reexport safe */ - g.Cylinder + p.Cylinder ), /* harmony export */ Sphere: () => ( @@ -15547,7 +15547,7 @@ ATOM`, h); var l = e( /*! ./Sphere */ "./src/WebGL/shapes/Sphere.ts" - ), g = e( + ), p = e( /*! ./Cylinder */ "./src/WebGL/shapes/Cylinder.ts" ), _ = e( @@ -15643,8 +15643,8 @@ ATOM`, h); } for (i = 0; i < surfaces.length; i++) { let s = surfaces[i][0] || {}, e = surfaces[i][1] || {}; - UI ? y.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, e, s, s).then((g) => { - UI.loadSurface("VDW", s, e, g); + UI ? y.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, e, s, s).then((p) => { + UI.loadSurface("VDW", s, e, p); }) : y.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW, e, s, s); } for (i = 0; i < labels.length; i++) { @@ -15709,7 +15709,7 @@ ATOM`, h); /* harmony export */ CC: () => ( /* binding */ - g + p ), /* harmony export */ Color: () => ( @@ -15729,7 +15729,7 @@ ATOM`, h); /* harmony export */ elementColors: () => ( /* binding */ - p + g ), /* harmony export */ htmlColors: () => ( @@ -15749,55 +15749,55 @@ ATOM`, h); /* harmony export */ }); class l { - constructor(L, D, r) { - return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof L == "number" ? (this.r = L || 0, this.g = D || 0, this.b = r || 0, this) : this.set(L || 0); + constructor(C, D, r) { + return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof C == "number" ? (this.r = C || 0, this.g = D || 0, this.b = r || 0, this) : this.set(C || 0); } - set(L) { - return L instanceof l ? L.clone() : (typeof L == "number" ? this.setHex(L) : typeof L == "object" && (this.r = (L == null ? void 0 : L.r) || 0, this.g = (L == null ? void 0 : L.g) || 0, this.b = (L == null ? void 0 : L.b) || 0), this); + set(C) { + return C instanceof l ? C.clone() : (typeof C == "number" ? this.setHex(C) : typeof C == "object" && (this.r = (C == null ? void 0 : C.r) || 0, this.g = (C == null ? void 0 : C.g) || 0, this.b = (C == null ? void 0 : C.b) || 0), this); } - setHex(L) { - return L = Math.floor(L), this.r = (L >> 16 & 255) / 255, this.g = (L >> 8 & 255) / 255, this.b = (L & 255) / 255, this; + setHex(C) { + return C = Math.floor(C), this.r = (C >> 16 & 255) / 255, this.g = (C >> 8 & 255) / 255, this.b = (C & 255) / 255, this; } getHex() { - var L = Math.round(this.r * 255), D = Math.round(this.g * 255), r = Math.round(this.b * 255); - return L << 16 | D << 8 | r; + var C = Math.round(this.r * 255), D = Math.round(this.g * 255), r = Math.round(this.b * 255); + return C << 16 | D << 8 | r; } clone() { return new l(this.r, this.g, this.b); } - copy(L) { - return this.r = L.r, this.g = L.g, this.b = L.b, this; + copy(C) { + return this.r = C.r, this.g = C.g, this.b = C.b, this; } //return object that represents color components from 0 to 255 scaled() { - var L = {}; - return L.r = Math.round(this.r * 255), L.g = Math.round(this.g * 255), L.b = Math.round(this.b * 255), L.a = 1, L; + var C = {}; + return C.r = Math.round(this.r * 255), C.g = Math.round(this.g * 255), C.b = Math.round(this.b * 255), C.a = 1, C; } } - class g { - static color(L) { - if (!L) - return g.cache[0]; - if (L instanceof l) - return L; - if (typeof L == "number" && typeof g.cache[L] < "u") - return g.cache[L]; - if (L && Array.isArray(L)) - return L.map(g.color); - let D = g.getHex(L), r = new l(D); - return g.cache[D] = r, r; - } - static getHex(L) { + class p { + static color(C) { + if (!C) + return p.cache[0]; + if (C instanceof l) + return C; + if (typeof C == "number" && typeof p.cache[C] < "u") + return p.cache[C]; + if (C && Array.isArray(C)) + return C.map(p.color); + let D = p.getHex(C), r = new l(D); + return p.cache[D] = r, r; + } + static getHex(C) { var D; - if (Array.isArray(L)) - return L.map(g.getHex); - if (typeof L == "string") { - let r = L; + if (Array.isArray(C)) + return C.map(p.getHex); + if (typeof C == "string") { + let r = C; if (!isNaN(parseInt(r))) return parseInt(r); if (r = r.trim(), r.length == 4 && r[0] == "#" && (r = "#" + r[1] + r[1] + r[2] + r[2] + r[3] + r[3]), r.length == 7 && r[0] == "#") return parseInt(r.substring(1), 16); - let n = g.rgbRegEx.exec(r); + let n = p.rgbRegEx.exec(r); if (n) { n[1] != "" && console.log("WARNING: Opacity value in rgba ignored. Specify separately as opacity attribute."); let b = 0; @@ -15808,12 +15808,12 @@ ATOM`, h); } return b; } - return ((D = window == null ? void 0 : window.$3Dmol) === null || D === void 0 ? void 0 : D.htmlColors[L.toLowerCase()]) || 0; + return ((D = window == null ? void 0 : window.$3Dmol) === null || D === void 0 ? void 0 : D.htmlColors[C.toLowerCase()]) || 0; } - return L; + return C; } } - g.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, g.cache = { 0: new l(0) }; + p.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, p.cache = { 0: new l(0) }; const _ = { aliceblue: 15792383, antiquewhite: 16444375, @@ -16015,7 +16015,7 @@ ATOM`, h); BA: 16753920, Au: 14329120, AU: 14329120 - }, p = { + }, g = { defaultColor: 16716947, /** Jmol-like element colors*/ Jmol: { @@ -16358,22 +16358,22 @@ ATOM`, h); /** secondary structure pymol */ ssPyMol: { prop: "ss", map: x.pyMol }, ssJmol: { prop: "ss", map: x.Jmol }, - Jmol: { prop: "elem", map: p.Jmol }, + Jmol: { prop: "elem", map: g.Jmol }, amino: { prop: "resn", map: E.amino }, shapely: { prop: "resn", map: E.shapely }, nucleic: { prop: "resn", map: E.nucleic }, chain: { prop: "chain", map: u.atom }, - rasmol: { prop: "elem", map: p.rasmol }, - default: { prop: "elem", map: p.defaultColors }, - greenCarbon: { prop: "elem", map: p.greenCarbon }, + rasmol: { prop: "elem", map: g.rasmol }, + default: { prop: "elem", map: g.defaultColors }, + greenCarbon: { prop: "elem", map: g.greenCarbon }, chainHetatm: { prop: "chain", map: u.hetatm }, - cyanCarbon: { prop: "elem", map: p.cyanCarbon }, - magentaCarbon: { prop: "elem", map: p.magentaCarbon }, - purpleCarbon: { prop: "elem", map: p.purpleCarbon }, - whiteCarbon: { prop: "elem", map: p.whiteCarbon }, - orangeCarbon: { prop: "elem", map: p.orangeCarbon }, - yellowCarbon: { prop: "elem", map: p.yellowCarbon }, - blueCarbon: { prop: "elem", map: p.blueCarbon } + cyanCarbon: { prop: "elem", map: g.cyanCarbon }, + magentaCarbon: { prop: "elem", map: g.magentaCarbon }, + purpleCarbon: { prop: "elem", map: g.purpleCarbon }, + whiteCarbon: { prop: "elem", map: g.whiteCarbon }, + orangeCarbon: { prop: "elem", map: g.orangeCarbon }, + yellowCarbon: { prop: "elem", map: g.yellowCarbon }, + blueCarbon: { prop: "elem", map: g.blueCarbon } }; } ), @@ -16388,7 +16388,7 @@ ATOM`, h); /* harmony export */ drawCartoon: () => ( /* binding */ - z + $ ), /* harmony export */ subdivide_spline: () => ( @@ -16400,7 +16400,7 @@ ATOM`, h); var l = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), g = e( + ), p = e( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" ), _ = e( @@ -16412,7 +16412,7 @@ ATOM`, h); ), o = e( /*! ./colors */ "./src/colors.ts" - ), p = e( + ), g = e( /*! ./GLDraw */ "./src/GLDraw.ts" ), E = e( @@ -16420,153 +16420,153 @@ ATOM`, h); "./src/utilities.ts" ); function u(P, B) { - var U = [], F = P; - F = [], F.push(P[0]); - var $, W, N, G, k, j, Q, ie, pe; - for ($ = 1, W = P.length - 1; $ < W; $++) - if (k = P[$], j = P[$ + 1], k.smoothen) { - var he = new l.Vector3((k.x + j.x) / 2, (k.y + j.y) / 2, (k.z + j.z) / 2); - he.atom = k.atom, F.push(he); + var F = [], U = P; + U = [], U.push(P[0]); + var z, W, V, N, k, G, Q, ie, ge; + for (z = 1, W = P.length - 1; z < W; z++) + if (k = P[z], G = P[z + 1], k.smoothen) { + var le = new l.Vector3((k.x + G.x) / 2, (k.y + G.y) / 2, (k.z + G.z) / 2); + le.atom = k.atom, U.push(le); } else - F.push(k); - for (F.push(P[P.length - 1]), $ = -1, N = F.length; $ <= N - 3; $++) - if (G = F[$ === -1 ? 0 : $], k = F[$ + 1], j = F[$ + 2], Q = F[$ === N - 3 ? N - 1 : $ + 3], ie = new l.Vector3().subVectors(j, G).multiplyScalar(0.5), pe = new l.Vector3().subVectors(Q, k).multiplyScalar(0.5), !j.skip) - for (var ue = 0; ue < B; ue++) { - var se = 1 / B * ue, ae = k.x + se * ie.x + se * se * (-3 * k.x + 3 * j.x - 2 * ie.x - pe.x) + se * se * se * (2 * k.x - 2 * j.x + ie.x + pe.x), we = k.y + se * ie.y + se * se * (-3 * k.y + 3 * j.y - 2 * ie.y - pe.y) + se * se * se * (2 * k.y - 2 * j.y + ie.y + pe.y), xe = k.z + se * ie.z + se * se * (-3 * k.z + 3 * j.z - 2 * ie.z - pe.z) + se * se * se * (2 * k.z - 2 * j.z + ie.z + pe.z), Ie = new l.Vector3(ae, we, xe); - ue < B / 2 ? Ie.atom = k.atom : Ie.atom = j.atom, U.push(Ie); + U.push(k); + for (U.push(P[P.length - 1]), z = -1, V = U.length; z <= V - 3; z++) + if (N = U[z === -1 ? 0 : z], k = U[z + 1], G = U[z + 2], Q = U[z === V - 3 ? V - 1 : z + 3], ie = new l.Vector3().subVectors(G, N).multiplyScalar(0.5), ge = new l.Vector3().subVectors(Q, k).multiplyScalar(0.5), !G.skip) + for (var oe = 0; oe < B; oe++) { + var he = 1 / B * oe, se = k.x + he * ie.x + he * he * (-3 * k.x + 3 * G.x - 2 * ie.x - ge.x) + he * he * he * (2 * k.x - 2 * G.x + ie.x + ge.x), xe = k.y + he * ie.y + he * he * (-3 * k.y + 3 * G.y - 2 * ie.y - ge.y) + he * he * he * (2 * k.y - 2 * G.y + ie.y + ge.y), ye = k.z + he * ie.z + he * he * (-3 * k.z + 3 * G.z - 2 * ie.z - ge.z) + he * he * he * (2 * k.z - 2 * G.z + ie.z + ge.z), Pe = new l.Vector3(se, xe, ye); + oe < B / 2 ? Pe.atom = k.atom : Pe.atom = G.atom, F.push(Pe); } - return U.push(F[F.length - 1]), U; + return F.push(U[U.length - 1]), F; } - const A = 0.5, C = 1.3, L = 0.8, D = 0.4, r = 0.4; - function n(P, B, U, F) { - for (var $, W, N, G, k = 0, j = B.length; k < j; k++) { - G = Math.round(k * (F.length - 1) / j), N = o.CC.color(F[G]); - var Q = P.updateGeoGroup(2), ie = Q.vertexArray, pe = Q.colorArray, he = Q.faceArray; - $ = Q.vertices, W = $ * 3, ie[W] = B[k].x, ie[W + 1] = B[k].y, ie[W + 2] = B[k].z, ie[W + 3] = U[k].x, ie[W + 4] = U[k].y, ie[W + 5] = U[k].z; - for (var ue = 0; ue < 6; ++ue) - pe[W + 3 * ue] = N.r, pe[W + 1 + 3 * ue] = N.g, pe[W + 2 + 3 * ue] = N.b; + const A = 0.5, L = 1.3, C = 0.8, D = 0.4, r = 0.4; + function n(P, B, F, U) { + for (var z, W, V, N, k = 0, G = B.length; k < G; k++) { + N = Math.round(k * (U.length - 1) / G), V = o.CC.color(U[N]); + var Q = P.updateGeoGroup(2), ie = Q.vertexArray, ge = Q.colorArray, le = Q.faceArray; + z = Q.vertices, W = z * 3, ie[W] = B[k].x, ie[W + 1] = B[k].y, ie[W + 2] = B[k].z, ie[W + 3] = F[k].x, ie[W + 4] = F[k].y, ie[W + 5] = F[k].z; + for (var oe = 0; oe < 6; ++oe) + ge[W + 3 * oe] = V.r, ge[W + 1 + 3 * oe] = V.g, ge[W + 2 + 3 * oe] = V.b; if (k > 0) { - var se = [$, $ + 1, $ - 1, $ - 2], ae = Q.faceidx; - he[ae] = se[0], he[ae + 1] = se[1], he[ae + 2] = se[3], he[ae + 3] = se[1], he[ae + 4] = se[2], he[ae + 5] = se[3], Q.faceidx += 6; + var he = [z, z + 1, z - 1, z - 2], se = Q.faceidx; + le[se] = he[0], le[se + 1] = he[1], le[se + 2] = he[3], le[se + 3] = he[1], le[se + 4] = he[2], le[se + 5] = he[3], Q.faceidx += 6; } Q.vertices += 2; } } - function b(P, B, U, F, $, W, N) { - var G, k, j, Q; - if (j = B.length, j < 2 || B[0].length < 2) + function b(P, B, F, U, z, W, V) { + var N, k, G, Q; + if (G = B.length, G < 2 || B[0].length < 2) return; - for (G = 0; G < j; G++) - B[G] = u(B[G], F); - if (Q = B[0].length, !$) - return n(P, B[0], B[j - 1], U); - var ie, pe, he, ue, se, ae, we = [], xe = [], Ie = []; - for (k = 0; k < j; k++) - we.push(0.25 + 1.5 * Math.sqrt((j - 1) * k - Math.pow(k, 2)) / (j - 1)), xe.push(0.5), Ie.push(2 * (Math.pow(k / j, 2) - k / j) + 0.6); - var oe = []; - for (k = 0; k < j * 2 - 1; k++) - oe[k] = [k, k + 1, k + 1 - 2 * j, k - 2 * j]; - oe[j * 2 - 1] = [ + for (N = 0; N < G; N++) + B[N] = u(B[N], U); + if (Q = B[0].length, !z) + return n(P, B[0], B[G - 1], F); + var ie, ge, le, oe, he, se, xe = [], ye = [], Pe = []; + for (k = 0; k < G; k++) + xe.push(0.25 + 1.5 * Math.sqrt((G - 1) * k - Math.pow(k, 2)) / (G - 1)), ye.push(0.5), Pe.push(2 * (Math.pow(k / G, 2) - k / G) + 0.6); + var de = []; + for (k = 0; k < G * 2 - 1; k++) + de[k] = [k, k + 1, k + 1 - 2 * G, k - 2 * G]; + de[G * 2 - 1] = [ k, - k + 1 - 2 * j, - k + 1 - 4 * j, - k - 2 * j + k + 1 - 2 * G, + k + 1 - 4 * G, + k - 2 * G ]; - var ve, re, Se, ze, Ge, $e, Re, Be, ke, We; - let Te = P.updateGeoGroup(); - for (G = 0; G < Q; G++) { - let Z = P.groups, q = !1; - Te = P.updateGeoGroup(2 * j), Z != P.groups && G > 0 && (G = G - 1, q = !0), $e = Math.round(G * (U.length - 1) / Q), Ge = o.CC.color(U[$e]), se = he, ae = ue, he = [], ue = [], ie = [], B[0][G].atom !== void 0 && (ze = B[0][G].atom, N === "oval" ? pe = we : N === "rectangle" ? pe = xe : N === "parabola" && (pe = Ie)), pe || (pe = xe); - var je, Fe; - for (k = 0; k < j; k++) - G < Q - 1 ? je = B[k][G + 1].clone().sub(B[k][G]) : je = B[k][G - 1].clone().sub(B[k][G]).negate(), k < j - 1 ? Fe = B[k + 1][G].clone().sub(B[k][G]) : Fe = B[k - 1][G].clone().sub(B[k][G]).negate(), ie[k] = Fe.cross(je).normalize().multiplyScalar($ * pe[k]); - for (k = 0; k < j; k++) - he[k] = B[k][G].clone().add(ie[k].clone().negate()); - for (k = 0; k < j; k++) - ue[k] = B[k][G].clone().add(ie[k]); - for (Re = Te.vertexArray, Be = Te.colorArray, ke = Te.faceArray, ve = Te.vertices, re = ve * 3, k = 0; k < j; k++) - Re[re + 3 * k + 0] = he[k].x, Re[re + 3 * k + 1] = he[k].y, Re[re + 3 * k + 2] = he[k].z; - for (k = 0; k < j; k++) - Re[re + 3 * k + 0 + 3 * j] = ue[j - 1 - k].x, Re[re + 3 * k + 1 + 3 * j] = ue[j - 1 - k].y, Re[re + 3 * k + 2 + 3 * j] = ue[j - 1 - k].z; - for (k = 0; k < 2 * j; ++k) - Be[re + 3 * k + 0] = Ge.r, Be[re + 3 * k + 1] = Ge.g, Be[re + 3 * k + 2] = Ge.b; - if (G > 0 && !q) { - for (k = 0; k < j * 2; k++) + var pe, re, Se, ke, $e, ze, Re, Fe, Ie, We; + let Ue = P.updateGeoGroup(); + for (N = 0; N < Q; N++) { + let K = P.groups, q = !1; + Ue = P.updateGeoGroup(2 * G), K != P.groups && N > 0 && (N = N - 1, q = !0), ze = Math.round(N * (F.length - 1) / Q), $e = o.CC.color(F[ze]), he = le, se = oe, le = [], oe = [], ie = [], B[0][N].atom !== void 0 && (ke = B[0][N].atom, V === "oval" ? ge = xe : V === "rectangle" ? ge = ye : V === "parabola" && (ge = Pe)), ge || (ge = ye); + var Be, Ne; + for (k = 0; k < G; k++) + N < Q - 1 ? Be = B[k][N + 1].clone().sub(B[k][N]) : Be = B[k][N - 1].clone().sub(B[k][N]).negate(), k < G - 1 ? Ne = B[k + 1][N].clone().sub(B[k][N]) : Ne = B[k - 1][N].clone().sub(B[k][N]).negate(), ie[k] = Ne.cross(Be).normalize().multiplyScalar(z * ge[k]); + for (k = 0; k < G; k++) + le[k] = B[k][N].clone().add(ie[k].clone().negate()); + for (k = 0; k < G; k++) + oe[k] = B[k][N].clone().add(ie[k]); + for (Re = Ue.vertexArray, Fe = Ue.colorArray, Ie = Ue.faceArray, pe = Ue.vertices, re = pe * 3, k = 0; k < G; k++) + Re[re + 3 * k + 0] = le[k].x, Re[re + 3 * k + 1] = le[k].y, Re[re + 3 * k + 2] = le[k].z; + for (k = 0; k < G; k++) + Re[re + 3 * k + 0 + 3 * G] = oe[G - 1 - k].x, Re[re + 3 * k + 1 + 3 * G] = oe[G - 1 - k].y, Re[re + 3 * k + 2 + 3 * G] = oe[G - 1 - k].z; + for (k = 0; k < 2 * G; ++k) + Fe[re + 3 * k + 0] = $e.r, Fe[re + 3 * k + 1] = $e.g, Fe[re + 3 * k + 2] = $e.b; + if (N > 0 && !q) { + for (k = 0; k < G * 2; k++) We = [ - ve + oe[k][0], - ve + oe[k][1], - ve + oe[k][2], - ve + oe[k][3] - ], Se = Te.faceidx, ke[Se] = We[0], ke[Se + 1] = We[1], ke[Se + 2] = We[3], ke[Se + 3] = We[1], ke[Se + 4] = We[2], ke[Se + 5] = We[3], Te.faceidx += 6; - if (ze.clickable || ze.hoverable) { - var X = []; - X.push(new g.Triangle(se[0], he[0], he[j - 1])), X.push(new g.Triangle(se[0], he[j - 1], se[j - 1])), X.push(new g.Triangle(se[j - 1], he[j - 1], ue[j - 1])), X.push(new g.Triangle(se[j - 1], ue[j - 1], ae[j - 1])), X.push(new g.Triangle(ue[0], ae[0], ae[j - 1])), X.push(new g.Triangle(ue[j - 1], ue[0], ae[j - 1])), X.push(new g.Triangle(he[0], se[0], ae[0])), X.push(new g.Triangle(ue[0], he[0], ae[0])); - for (k in X) - ze.intersectionShape.triangle.push(X[k]); + pe + de[k][0], + pe + de[k][1], + pe + de[k][2], + pe + de[k][3] + ], Se = Ue.faceidx, Ie[Se] = We[0], Ie[Se + 1] = We[1], Ie[Se + 2] = We[3], Ie[Se + 3] = We[1], Ie[Se + 4] = We[2], Ie[Se + 5] = We[3], Ue.faceidx += 6; + if (ke.clickable || ke.hoverable) { + var H = []; + H.push(new p.Triangle(he[0], le[0], le[G - 1])), H.push(new p.Triangle(he[0], le[G - 1], he[G - 1])), H.push(new p.Triangle(he[G - 1], le[G - 1], oe[G - 1])), H.push(new p.Triangle(he[G - 1], oe[G - 1], se[G - 1])), H.push(new p.Triangle(oe[0], se[0], se[G - 1])), H.push(new p.Triangle(oe[G - 1], oe[0], se[G - 1])), H.push(new p.Triangle(le[0], he[0], se[0])), H.push(new p.Triangle(oe[0], le[0], se[0])); + for (k in H) + ke.intersectionShape.triangle.push(H[k]); } } - Te.vertices += 2 * j; + Ue.vertices += 2 * G; } - for (Re = Te.vertexArray, Be = Te.colorArray, ke = Te.faceArray, ve = Te.vertices, re = ve * 3, Se = Te.faceidx, G = 0; G < j - 1; G++) - We = [G, G + 1, 2 * j - 2 - G, 2 * j - 1 - G], Se = Te.faceidx, ke[Se] = We[0], ke[Se + 1] = We[1], ke[Se + 2] = We[3], ke[Se + 3] = We[1], ke[Se + 4] = We[2], ke[Se + 5] = We[3], Te.faceidx += 6; - for (G = 0; G < j - 1; G++) + for (Re = Ue.vertexArray, Fe = Ue.colorArray, Ie = Ue.faceArray, pe = Ue.vertices, re = pe * 3, Se = Ue.faceidx, N = 0; N < G - 1; N++) + We = [N, N + 1, 2 * G - 2 - N, 2 * G - 1 - N], Se = Ue.faceidx, Ie[Se] = We[0], Ie[Se + 1] = We[1], Ie[Se + 2] = We[3], Ie[Se + 3] = We[1], Ie[Se + 4] = We[2], Ie[Se + 5] = We[3], Ue.faceidx += 6; + for (N = 0; N < G - 1; N++) We = [ - ve - 1 - G, - ve - 2 - G, - ve - 2 * j + G + 1, - ve - 2 * j + G - ], Se = Te.faceidx, ke[Se] = We[0], ke[Se + 1] = We[1], ke[Se + 2] = We[3], ke[Se + 3] = We[1], ke[Se + 4] = We[2], ke[Se + 5] = We[3], Te.faceidx += 6; + pe - 1 - N, + pe - 2 - N, + pe - 2 * G + N + 1, + pe - 2 * G + N + ], Se = Ue.faceidx, Ie[Se] = We[0], Ie[Se + 1] = We[1], Ie[Se + 2] = We[3], Ie[Se + 3] = We[1], Ie[Se + 4] = We[2], Ie[Se + 5] = We[3], Ue.faceidx += 6; } - function f(P, B, U, F, $, W) { + function f(P, B, F, U, z, W) { if (!(B.length < 2)) { - var N, G; - if (N = B[0], G = B[B.length - 1], N = u(N, F), G = u(G, F), !$) - return n(P, N, G, U); - var k = [], j, Q, ie, pe, he, ue = [ + var V, N; + if (V = B[0], N = B[B.length - 1], V = u(V, U), N = u(N, U), !z) + return n(P, V, N, F); + var k = [], G, Q, ie, ge, le, oe = [ [0, 2, -6, -8], [-4, -2, 6, 4], [7, -1, -5, 3], [-3, 5, 1, -7] - ], se, ae, we, xe, Ie, oe, ve, re, Se, ze, Ge, $e, Re, Be, ke, We, Te; - for (re = 0, Se = N.length; re < Se; re++) { - if (Ie = Math.round(re * (U.length - 1) / Se), xe = o.CC.color(U[Ie]), k.push(Q = N[re]), k.push(Q), k.push(ie = G[re]), k.push(ie), re < Se - 1) { - var je = N[re + 1].clone().sub(N[re]), Fe = G[re].clone().sub(N[re]); - j = Fe.cross(je).normalize().multiplyScalar($); + ], he, se, xe, ye, Pe, de, pe, re, Se, ke, $e, ze, Re, Fe, Ie, We, Ue; + for (re = 0, Se = V.length; re < Se; re++) { + if (Pe = Math.round(re * (F.length - 1) / Se), ye = o.CC.color(F[Pe]), k.push(Q = V[re]), k.push(Q), k.push(ie = N[re]), k.push(ie), re < Se - 1) { + var Be = V[re + 1].clone().sub(V[re]), Ne = N[re].clone().sub(V[re]); + G = Ne.cross(Be).normalize().multiplyScalar(z); } - for (k.push(pe = N[re].clone().add(j)), k.push(pe), k.push(he = G[re].clone().add(j)), k.push(he), Q.atom !== void 0 && (oe = Q.atom), Be = P.updateGeoGroup(8), ke = Be.vertexArray, We = Be.colorArray, Te = Be.faceArray, se = Be.vertices, ae = se * 3, ke[ae] = Q.x, ke[ae + 1] = Q.y, ke[ae + 2] = Q.z, ke[ae + 3] = Q.x, ke[ae + 4] = Q.y, ke[ae + 5] = Q.z, ke[ae + 6] = ie.x, ke[ae + 7] = ie.y, ke[ae + 8] = ie.z, ke[ae + 9] = ie.x, ke[ae + 10] = ie.y, ke[ae + 11] = ie.z, ke[ae + 12] = pe.x, ke[ae + 13] = pe.y, ke[ae + 14] = pe.z, ke[ae + 15] = pe.x, ke[ae + 16] = pe.y, ke[ae + 17] = pe.z, ke[ae + 18] = he.x, ke[ae + 19] = he.y, ke[ae + 20] = he.z, ke[ae + 21] = he.x, ke[ae + 22] = he.y, ke[ae + 23] = he.z, ze = 0; ze < 8; ++ze) - We[ae + 3 * ze] = xe.r, We[ae + 1 + 3 * ze] = xe.g, We[ae + 2 + 3 * ze] = xe.b; + for (k.push(ge = V[re].clone().add(G)), k.push(ge), k.push(le = N[re].clone().add(G)), k.push(le), Q.atom !== void 0 && (de = Q.atom), Fe = P.updateGeoGroup(8), Ie = Fe.vertexArray, We = Fe.colorArray, Ue = Fe.faceArray, he = Fe.vertices, se = he * 3, Ie[se] = Q.x, Ie[se + 1] = Q.y, Ie[se + 2] = Q.z, Ie[se + 3] = Q.x, Ie[se + 4] = Q.y, Ie[se + 5] = Q.z, Ie[se + 6] = ie.x, Ie[se + 7] = ie.y, Ie[se + 8] = ie.z, Ie[se + 9] = ie.x, Ie[se + 10] = ie.y, Ie[se + 11] = ie.z, Ie[se + 12] = ge.x, Ie[se + 13] = ge.y, Ie[se + 14] = ge.z, Ie[se + 15] = ge.x, Ie[se + 16] = ge.y, Ie[se + 17] = ge.z, Ie[se + 18] = le.x, Ie[se + 19] = le.y, Ie[se + 20] = le.z, Ie[se + 21] = le.x, Ie[se + 22] = le.y, Ie[se + 23] = le.z, ke = 0; ke < 8; ++ke) + We[se + 3 * ke] = ye.r, We[se + 1 + 3 * ke] = ye.g, We[se + 2 + 3 * ke] = ye.b; if (re > 0) { - var X = ve !== void 0 && oe !== void 0 && ve.serial !== oe.serial; - for (ze = 0; ze < 4; ze++) { - var Z = [ - se + ue[ze][0], - se + ue[ze][1], - se + ue[ze][2], - se + ue[ze][3] + var H = pe !== void 0 && de !== void 0 && pe.serial !== de.serial; + for (ke = 0; ke < 4; ke++) { + var K = [ + he + oe[ke][0], + he + oe[ke][1], + he + oe[ke][2], + he + oe[ke][3] ]; - if (we = Be.faceidx, Te[we] = Z[0], Te[we + 1] = Z[1], Te[we + 2] = Z[3], Te[we + 3] = Z[1], Te[we + 4] = Z[2], Te[we + 5] = Z[3], Be.faceidx += 6, oe.clickable || ve.clickable || oe.hoverable || ve.hoverable) { - var q = k[Z[3]].clone(), fe = k[Z[0]].clone(), _e = k[Z[2]].clone(), Me = k[Z[1]].clone(); - if (q.atom = k[Z[3]].atom || null, _e.atom = k[Z[2]].atom || null, fe.atom = k[Z[0]].atom || null, Me.atom = k[Z[1]].atom || null, X) { - var Ae = q.clone().add(fe).multiplyScalar(0.5), H = _e.clone().add(Me).multiplyScalar(0.5), ce = q.clone().add(Me).multiplyScalar(0.5); - ze % 2 === 0 ? ((ve.clickable || ve.hoverable) && (Ge = new g.Triangle(Ae, ce, q), $e = new g.Triangle(H, _e, ce), Re = new g.Triangle(ce, _e, q), ve.intersectionShape.triangle.push(Ge), ve.intersectionShape.triangle.push($e), ve.intersectionShape.triangle.push(Re)), (oe.clickable || oe.hoverable) && (Ge = new g.Triangle(fe, Me, ce), $e = new g.Triangle(Me, H, ce), Re = new g.Triangle(fe, ce, Ae), oe.intersectionShape.triangle.push(Ge), oe.intersectionShape.triangle.push($e), oe.intersectionShape.triangle.push(Re))) : ((oe.clickable || oe.hoverable) && (Ge = new g.Triangle(Ae, ce, q), $e = new g.Triangle(H, _e, ce), Re = new g.Triangle(ce, _e, q), oe.intersectionShape.triangle.push(Ge), oe.intersectionShape.triangle.push($e), oe.intersectionShape.triangle.push(Re)), (ve.clickable || ve.hoverable) && (Ge = new g.Triangle(fe, Me, ce), $e = new g.Triangle(Me, H, ce), Re = new g.Triangle(fe, ce, Ae), ve.intersectionShape.triangle.push(Ge), ve.intersectionShape.triangle.push($e), ve.intersectionShape.triangle.push(Re))); + if (xe = Fe.faceidx, Ue[xe] = K[0], Ue[xe + 1] = K[1], Ue[xe + 2] = K[3], Ue[xe + 3] = K[1], Ue[xe + 4] = K[2], Ue[xe + 5] = K[3], Fe.faceidx += 6, de.clickable || pe.clickable || de.hoverable || pe.hoverable) { + var q = k[K[3]].clone(), fe = k[K[0]].clone(), _e = k[K[2]].clone(), Me = k[K[1]].clone(); + if (q.atom = k[K[3]].atom || null, _e.atom = k[K[2]].atom || null, fe.atom = k[K[0]].atom || null, Me.atom = k[K[1]].atom || null, H) { + var Ae = q.clone().add(fe).multiplyScalar(0.5), Z = _e.clone().add(Me).multiplyScalar(0.5), ue = q.clone().add(Me).multiplyScalar(0.5); + ke % 2 === 0 ? ((pe.clickable || pe.hoverable) && ($e = new p.Triangle(Ae, ue, q), ze = new p.Triangle(Z, _e, ue), Re = new p.Triangle(ue, _e, q), pe.intersectionShape.triangle.push($e), pe.intersectionShape.triangle.push(ze), pe.intersectionShape.triangle.push(Re)), (de.clickable || de.hoverable) && ($e = new p.Triangle(fe, Me, ue), ze = new p.Triangle(Me, Z, ue), Re = new p.Triangle(fe, ue, Ae), de.intersectionShape.triangle.push($e), de.intersectionShape.triangle.push(ze), de.intersectionShape.triangle.push(Re))) : ((de.clickable || de.hoverable) && ($e = new p.Triangle(Ae, ue, q), ze = new p.Triangle(Z, _e, ue), Re = new p.Triangle(ue, _e, q), de.intersectionShape.triangle.push($e), de.intersectionShape.triangle.push(ze), de.intersectionShape.triangle.push(Re)), (pe.clickable || pe.hoverable) && ($e = new p.Triangle(fe, Me, ue), ze = new p.Triangle(Me, Z, ue), Re = new p.Triangle(fe, ue, Ae), pe.intersectionShape.triangle.push($e), pe.intersectionShape.triangle.push(ze), pe.intersectionShape.triangle.push(Re))); } else - (oe.clickable || oe.hoverable) && (Ge = new g.Triangle(fe, Me, q), $e = new g.Triangle(Me, _e, q), oe.intersectionShape.triangle.push(Ge), oe.intersectionShape.triangle.push($e)); + (de.clickable || de.hoverable) && ($e = new p.Triangle(fe, Me, q), ze = new p.Triangle(Me, _e, q), de.intersectionShape.triangle.push($e), de.intersectionShape.triangle.push(ze)); } } } - Be.vertices += 8, ve = oe; + Fe.vertices += 8, pe = de; } - var ye = k.length - 8; - for (Be = P.updateGeoGroup(8), ke = Be.vertexArray, We = Be.colorArray, Te = Be.faceArray, se = Be.vertices, ae = se * 3, we = Be.faceidx, re = 0; re < 4; re++) { - k.push(k[re * 2]), k.push(k[ye + re * 2]); - var Pe = k[re * 2], le = k[ye + re * 2]; - ke[ae + 6 * re] = Pe.x, ke[ae + 1 + 6 * re] = Pe.y, ke[ae + 2 + 6 * re] = Pe.z, ke[ae + 3 + 6 * re] = le.x, ke[ae + 4 + 6 * re] = le.y, ke[ae + 5 + 6 * re] = le.z, We[ae + 6 * re] = xe.r, We[ae + 1 + 6 * re] = xe.g, We[ae + 2 + 6 * re] = xe.b, We[ae + 3 + 6 * re] = xe.r, We[ae + 4 + 6 * re] = xe.g, We[ae + 5 + 6 * re] = xe.b; + var we = k.length - 8; + for (Fe = P.updateGeoGroup(8), Ie = Fe.vertexArray, We = Fe.colorArray, Ue = Fe.faceArray, he = Fe.vertices, se = he * 3, xe = Fe.faceidx, re = 0; re < 4; re++) { + k.push(k[re * 2]), k.push(k[we + re * 2]); + var Te = k[re * 2], ae = k[we + re * 2]; + Ie[se + 6 * re] = Te.x, Ie[se + 1 + 6 * re] = Te.y, Ie[se + 2 + 6 * re] = Te.z, Ie[se + 3 + 6 * re] = ae.x, Ie[se + 4 + 6 * re] = ae.y, Ie[se + 5 + 6 * re] = ae.z, We[se + 6 * re] = ye.r, We[se + 1 + 6 * re] = ye.g, We[se + 2 + 6 * re] = ye.b, We[se + 3 + 6 * re] = ye.r, We[se + 4 + 6 * re] = ye.g, We[se + 5 + 6 * re] = ye.b; } - ye += 8, Ge = [se, se + 2, se + 6, se + 4], $e = [se + 1, se + 5, se + 7, se + 3], Te[we] = Ge[0], Te[we + 1] = Ge[1], Te[we + 2] = Ge[3], Te[we + 3] = Ge[1], Te[we + 4] = Ge[2], Te[we + 5] = Ge[3], Te[we + 6] = $e[0], Te[we + 7] = $e[1], Te[we + 8] = $e[3], Te[we + 9] = $e[1], Te[we + 10] = $e[2], Te[we + 11] = $e[3], Be.faceidx += 12, Be.vertices += 8; + we += 8, $e = [he, he + 2, he + 6, he + 4], ze = [he + 1, he + 5, he + 7, he + 3], Ue[xe] = $e[0], Ue[xe + 1] = $e[1], Ue[xe + 2] = $e[3], Ue[xe + 3] = $e[1], Ue[xe + 4] = $e[2], Ue[xe + 5] = $e[3], Ue[xe + 6] = ze[0], Ue[xe + 7] = ze[1], Ue[xe + 8] = ze[3], Ue[xe + 9] = ze[1], Ue[xe + 10] = ze[2], Ue[xe + 11] = ze[3], Fe.faceidx += 12, Fe.vertices += 8; } } - function c(P, B, U, F, $, W, N) { - (!N || N === "default") && (N = "rectangle"), N === "edged" ? f(P, B, U, F, $) : (N === "rectangle" || N === "oval" || N === "parabola") && b(P, B, U, F, $, W, N); + function c(P, B, F, U, z, W, V) { + (!V || V === "default") && (V = "rectangle"), V === "edged" ? f(P, B, F, U, z) : (V === "rectangle" || V === "oval" || V === "parabola") && b(P, B, F, U, z, W, V); } function t(P) { return P && P.elem === "C" && P.atom === "CA"; @@ -16576,7 +16576,7 @@ ATOM`, h); if (!P.hetflag && !B.hetflag && P.reschain === B.reschain && (P.resi === B.resi || P.resi === B.resi - 1)) return !0; if (P.resi < B.resi) { - var U = P.x - B.x, F = P.y - B.y, $ = P.z - B.z, W = U * U + F * F + $ * $; + var F = P.x - B.x, U = P.y - B.y, z = P.z - B.z, W = F * F + U * U + z * z; if (P.atom == "CA" && B.atom == "CA" && W < 16) return !0; if ((P.atom == "P" || B.atom == "P") && W < 64) @@ -16585,35 +16585,35 @@ ATOM`, h); } return !1; } - function h(P, B, U, F, $) { + function h(P, B, F, U, z) { if (!(B == null || B.vertices == 0)) { - $ && (B.initTypedArrays(), B.setUpNormals()); + z && (B.initTypedArrays(), B.setUpNormals()); var W = new _.MeshDoubleLambertMaterial(); - W.vertexColors = _.Coloring.FaceColors, typeof U == "number" && U >= 0 && U < 1 && (W.transparent = !0, W.opacity = U), W.outline = F; - var N = new _.Mesh(B, W); - P.add(N); + W.vertexColors = _.Coloring.FaceColors, typeof F == "number" && F >= 0 && F < 1 && (W.transparent = !0, W.opacity = F), W.outline = U; + var V = new _.Mesh(B, W); + P.add(V); } } - function M(P, B, U, F, $, W, N, G, k) { - var j, Q, ie, pe, he, ue; - if (!(!F || !$ || !N)) { - var se = $.sub(F); - se.normalize(); - var ae = G[k]; - for (Q = k + 1; Q < G.length && (ae = G[Q], ae.atom != N.atom); Q++) + function M(P, B, F, U, z, W, V, N, k) { + var G, Q, ie, ge, le, oe; + if (!(!U || !z || !V)) { + var he = z.sub(U); + he.normalize(); + var se = N[k]; + for (Q = k + 1; Q < N.length && (se = N[Q], se.atom != V.atom); Q++) ; - if (ae = ae ? new l.Vector3(ae.x, ae.y, ae.z) : new l.Vector3(0, 0, 0), ae.sub(F), N.ss === "arrow start") { - var we = ae.clone().multiplyScalar(0.3).cross($); - F.add(we); - var xe = ae.clone().cross(se).normalize(); - se.rotateAboutVector(xe, 0.43); - } - for (N.style.cartoon.ribbon ? j = N.style.cartoon.thickness || D : N.style.cartoon.width ? j = N.style.cartoon.width : N.ss === "c" ? N.atom === "P" ? j = L : j = A : N.ss === "arrow start" ? (j = C, he = !0) : N.ss === "arrow end" || N.ss === "h" && N.style.cartoon.tubes || N.ss === "tube start" ? j = A : j = C, W != null && se.dot(W) < 0 && se.negate(), se.multiplyScalar(j), Q = 0; Q < B; Q++) - ie = -1 + Q * 2 / (B - 1), pe = new l.Vector3(F.x + ie * se.x, F.y + ie * se.y, F.z + ie * se.z), pe.atom = N, U && N.ss === "s" && (pe.smoothen = !0), P[Q].push(pe); - if (he) - for (se.multiplyScalar(2), Q = 0; Q < B; Q++) - ie = -1 + Q * 2 / (B - 1), pe = new l.Vector3(F.x + ie * se.x, F.y + ie * se.y, F.z + ie * se.z), pe.atom = N, pe.smoothen = !1, pe.skip = !0, P[Q].push(pe); - return ue = N.style.cartoon.style || "default", P.style ? P.style != ue && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = ue, (N.ss === "arrow start" || N.ss === "arrow end") && (N.ss = "s"), he; + if (se = se ? new l.Vector3(se.x, se.y, se.z) : new l.Vector3(0, 0, 0), se.sub(U), V.ss === "arrow start") { + var xe = se.clone().multiplyScalar(0.3).cross(z); + U.add(xe); + var ye = se.clone().cross(he).normalize(); + he.rotateAboutVector(ye, 0.43); + } + for (V.style.cartoon.ribbon ? G = V.style.cartoon.thickness || D : V.style.cartoon.width ? G = V.style.cartoon.width : V.ss === "c" ? V.atom === "P" ? G = C : G = A : V.ss === "arrow start" ? (G = L, le = !0) : V.ss === "arrow end" || V.ss === "h" && V.style.cartoon.tubes || V.ss === "tube start" ? G = A : G = L, W != null && he.dot(W) < 0 && he.negate(), he.multiplyScalar(G), Q = 0; Q < B; Q++) + ie = -1 + Q * 2 / (B - 1), ge = new l.Vector3(U.x + ie * he.x, U.y + ie * he.y, U.z + ie * he.z), ge.atom = V, F && V.ss === "s" && (ge.smoothen = !0), P[Q].push(ge); + if (le) + for (he.multiplyScalar(2), Q = 0; Q < B; Q++) + ie = -1 + Q * 2 / (B - 1), ge = new l.Vector3(U.x + ie * he.x, U.y + ie * he.y, U.z + ie * he.z), ge.atom = V, ge.smoothen = !1, ge.skip = !0, P[Q].push(ge); + return oe = V.style.cartoon.style || "default", P.style ? P.style != oe && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = oe, (V.ss === "arrow start" || V.ss === "arrow end") && (V.ss = "s"), le; } } const w = { @@ -16634,98 +16634,98 @@ ATOM`, h); N1: !0, N3: !0 }, S = { DA: !0, DG: !0, A: !0, G: !0 }, T = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, R = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; - function z(P, B, U, F = 10) { - let $ = F, W = F; - var N, G, k, j, Q, ie, pe, he, ue, se, ae, we, xe, Ie, oe, ve, re, Se, ze = new _.Geometry(!0), Ge = new _.Geometry(!0), $e = [], Re = [], Be = 1, ke = !1, We = {}; - for (var Te in x.Gradient.builtinGradients) - x.Gradient.builtinGradients.hasOwnProperty(Te) && (We[Te] = new x.Gradient.builtinGradients[Te](U[1], U[0])); - var je = function(K, Oe) { - return U && Oe.color === "spectrum" ? Oe.colorscheme in We ? We[Oe.colorscheme].valueToHex(K.resi) : We.sinebow.valueToHex(K.resi) : (0, E.getColorFromStyle)(K, Oe).getHex(); + function $(P, B, F, U = 10) { + let z = U, W = U; + var V, N, k, G, Q, ie, ge, le, oe, he, se, xe, ye, Pe, de, pe, re, Se, ke = new _.Geometry(!0), $e = new _.Geometry(!0), ze = [], Re = [], Fe = 1, Ie = !1, We = {}; + for (var Ue in x.Gradient.builtinGradients) + x.Gradient.builtinGradients.hasOwnProperty(Ue) && (We[Ue] = new x.Gradient.builtinGradients[Ue](F[1], F[0])); + var Be = function(Y, Oe) { + return F && Oe.color === "spectrum" ? Oe.colorscheme in We ? We[Oe.colorscheme].valueToHex(Y.resi) : We.sinebow.valueToHex(Y.resi) : (0, E.getColorFromStyle)(Y, Oe).getHex(); }; - for (he = 0; he < $; he++) - Re[he] = []; - var Fe = !1, X = !1, Z = []; - for (he in B) { - if (j = B[he], j.elem === "C" && j.atom === "CA") { - var q = a(k, j); - q && j.ss === "s" ? Fe = !0 : Fe && (k && G && k.style.cartoon.arrows && G.style.cartoon.arrows && (k.ss = "arrow end", G.ss = "arrow start"), Fe = !1), q && (k.ss === "h" || k.ss == "tube start") && k.style.cartoon.tubes ? !X && k.ss != "tube start" && j.style.cartoon.tubes && (j.ss = "tube start", X = !0) : X && (k.ss === "tube start" ? k.ss = "tube end" : G && G.style.cartoon.tubes && (G.ss = "tube end"), X = !1), G = k, k = j; - } - j && j.atom in w && Z.push(j); - } - X && k.style.cartoon.tubes && (k.ss = "tube end", X = !1); - var fe = function(K) { - Re[0].length > 0 && c(Ge, Re, $e, W, pe, Be, Re.style); - var Oe = [], Ne = null; - if (K) { - for (he = 0; he < $; he++) - Oe[he] = Re[he][Re[he].length - 1]; - Ne = $e[$e.length - 1]; - } - for (Re = [], he = 0; he < $; he++) - Re[he] = []; - if ($e = [], K) { - for (he = 0; he < $; he++) - Re[he].push(Oe[he]); - $e.push(Ne); - } - h(P, Ge, Be, ke, !0), h(P, ze, Be, ke, !1), Ge = new _.Geometry(!0), ze = new _.Geometry(!0); + for (le = 0; le < z; le++) + Re[le] = []; + var Ne = !1, H = !1, K = []; + for (le in B) { + if (G = B[le], G.elem === "C" && G.atom === "CA") { + var q = a(k, G); + q && G.ss === "s" ? Ne = !0 : Ne && (k && N && k.style.cartoon.arrows && N.style.cartoon.arrows && (k.ss = "arrow end", N.ss = "arrow start"), Ne = !1), q && (k.ss === "h" || k.ss == "tube start") && k.style.cartoon.tubes ? !H && k.ss != "tube start" && G.style.cartoon.tubes && (G.ss = "tube start", H = !0) : H && (k.ss === "tube start" ? k.ss = "tube end" : N && N.style.cartoon.tubes && (N.ss = "tube end"), H = !1), N = k, k = G; + } + G && G.atom in w && K.push(G); + } + H && k.style.cartoon.tubes && (k.ss = "tube end", H = !1); + var fe = function(Y) { + Re[0].length > 0 && c($e, Re, ze, W, ge, Fe, Re.style); + var Oe = [], Ve = null; + if (Y) { + for (le = 0; le < z; le++) + Oe[le] = Re[le][Re[le].length - 1]; + Ve = ze[ze.length - 1]; + } + for (Re = [], le = 0; le < z; le++) + Re[le] = []; + if (ze = [], Y) { + for (le = 0; le < z; le++) + Re[le].push(Oe[le]); + ze.push(Ve); + } + h(P, $e, Fe, Ie, !0), h(P, ke, Fe, Ie, !1), $e = new _.Geometry(!0), ke = new _.Geometry(!0); }; k = void 0; - for (var _e = 0; _e < Z.length; _e++) { - j = Z[_e]; - var Me = j.resn.trim(), Ae = Me in R; - if (Be = 1, N = j.style.cartoon, k && k.style.cartoon && (Be = k.style.cartoon.opacity), k && k.style.cartoon && k.style.cartoon.outline && (ke = k.style.cartoon.outline), k && k.style.cartoon && (!j.style.cartoon || k.style.cartoon.opacity != j.style.cartoon.opacity) && fe(k.chain == j.chain), N.style === "trace") { - if (!j.hetflag) { - if (j.elem === "C" && j.atom === "CA" || Ae && j.atom === "P" || j.atom === "BB") { - if (ie = je(j, N), (0, E.isNumeric)(N.thickness) ? pe = N.thickness : pe = D, a(k, j)) + for (var _e = 0; _e < K.length; _e++) { + G = K[_e]; + var Me = G.resn.trim(), Ae = Me in R; + if (Fe = 1, V = G.style.cartoon, k && k.style.cartoon && (Fe = k.style.cartoon.opacity), k && k.style.cartoon && k.style.cartoon.outline && (Ie = k.style.cartoon.outline), k && k.style.cartoon && (!G.style.cartoon || k.style.cartoon.opacity != G.style.cartoon.opacity) && fe(k.chain == G.chain), V.style === "trace") { + if (!G.hetflag) { + if (G.elem === "C" && G.atom === "CA" || Ae && G.atom === "P" || G.atom === "BB") { + if (ie = Be(G, V), (0, E.isNumeric)(V.thickness) ? ge = V.thickness : ge = D, a(k, G)) if (ie == Q) { - var H = o.CC.color(ie); - p.GLDraw.drawCylinder(ze, k, j, pe, H, 2, 2); + var Z = o.CC.color(ie); + g.GLDraw.drawCylinder(ke, k, G, ge, Z, 2, 2); } else { - var ce = new l.Vector3().addVectors(k, j).multiplyScalar(0.5), ye = o.CC.color(Q), Pe = o.CC.color(ie); - p.GLDraw.drawCylinder(ze, k, ce, pe, ye, 2, 0), p.GLDraw.drawCylinder(ze, ce, j, pe, Pe, 0, 2); + var ue = new l.Vector3().addVectors(k, G).multiplyScalar(0.5), we = o.CC.color(Q), Te = o.CC.color(ie); + g.GLDraw.drawCylinder(ke, k, ue, ge, we, 2, 0), g.GLDraw.drawCylinder(ke, ue, G, ge, Te, 0, 2); } - if ((j.clickable === !0 || j.hoverable) && j.intersectionShape !== void 0) { - var le = new l.Vector3(j.x, j.y, j.z); - j.intersectionShape.sphere.push(new g.Sphere(le, pe)); + if ((G.clickable === !0 || G.hoverable) && G.intersectionShape !== void 0) { + var ae = new l.Vector3(G.x, G.y, G.z); + G.intersectionShape.sphere.push(new p.Sphere(ae, ge)); } - k = j, Q = ie; + k = G, Q = ie; } } } else { - if (t(j) || Ae && (j.atom === "P" || j.atom.indexOf("O5") == 0)) { + if (t(G) || Ae && (G.atom === "P" || G.atom.indexOf("O5") == 0)) { if (Se) - if (j.ss === "tube end") - Se = !1, re = new l.Vector3(j.x, j.y, j.z), p.GLDraw.drawCylinder(ze, ve, re, 2, o.CC.color(Q), 1, 1), j.ss = "h"; - else if (k.chain != j.chain || k.ss === "tube end") - Se = !1, k.ss = "h", re = new l.Vector3(k.x, k.y, k.z), p.GLDraw.drawCylinder(ze, ve, re, 2, o.CC.color(Q), 1, 1); + if (G.ss === "tube end") + Se = !1, re = new l.Vector3(G.x, G.y, G.z), g.GLDraw.drawCylinder(ke, pe, re, 2, o.CC.color(Q), 1, 1), G.ss = "h"; + else if (k.chain != G.chain || k.ss === "tube end") + Se = !1, k.ss = "h", re = new l.Vector3(k.x, k.y, k.z), g.GLDraw.drawCylinder(ke, pe, re, 2, o.CC.color(Q), 1, 1); else continue; - if (k && (!a(k, j) || k.ss === "tube start")) { - for (k.ss === "tube start" && (Se = !0, ve = new l.Vector3(k.x, k.y, k.z), k.ss = "h"), oe && (we ? Ie = new l.Vector3().addVectors(k, we).multiplyScalar(0.5) : Ie = new l.Vector3(k.x, k.y, k.z), p.GLDraw.drawCylinder(ze, Ie, oe, r, o.CC.color(oe.color), 0, 2), M(Re, $, !0, we, xe, ae, k, Z, _e), $e.push(ie), Ie = null, oe = null), Re[0].length > 0 && c(Ge, Re, $e, W, pe, Be, Re.style), Re = [], he = 0; he < $; he++) - Re[he] = []; - $e = []; + if (k && (!a(k, G) || k.ss === "tube start")) { + for (k.ss === "tube start" && (Se = !0, pe = new l.Vector3(k.x, k.y, k.z), k.ss = "h"), de && (xe ? Pe = new l.Vector3().addVectors(k, xe).multiplyScalar(0.5) : Pe = new l.Vector3(k.x, k.y, k.z), g.GLDraw.drawCylinder(ke, Pe, de, r, o.CC.color(de.color), 0, 2), M(Re, z, !0, xe, ye, se, k, K, _e), ze.push(ie), Pe = null, de = null), Re[0].length > 0 && c($e, Re, ze, W, ge, Fe, Re.style), Re = [], le = 0; le < z; le++) + Re[le] = []; + ze = []; } - if (k === void 0 || k.rescode != j.rescode || k.resi != j.resi) { - if (oe && k != null) { - Ie = new l.Vector3().addVectors(k, j).multiplyScalar(0.5); - var De = Ie.clone().sub(oe).multiplyScalar(0.02); - Ie.add(De), p.GLDraw.drawCylinder(ze, Ie, oe, r, o.CC.color(oe.color), 0, 2), Ie = null, oe = null; + if (k === void 0 || k.rescode != G.rescode || k.resi != G.resi) { + if (de && k != null) { + Pe = new l.Vector3().addVectors(k, G).multiplyScalar(0.5); + var De = Pe.clone().sub(de).multiplyScalar(0.02); + Pe.add(De), g.GLDraw.drawCylinder(ke, Pe, de, r, o.CC.color(de.color), 0, 2), Pe = null, de = null; } - ie = je(j, N), $e.push(ie), (0, E.isNumeric)(N.thickness) ? pe = N.thickness : pe = D, k = j, ue = new l.Vector3(k.x, k.y, k.z), ue.resi = k.resi, Q = ie; + ie = Be(G, V), ze.push(ie), (0, E.isNumeric)(V.thickness) ? ge = V.thickness : ge = D, k = G, oe = new l.Vector3(k.x, k.y, k.z), oe.resi = k.resi, Q = ie; } - (j.clickable === !0 || j.hoverable === !0) && (j.intersectionShape === void 0 || j.intersectionShape.triangle === void 0) && (j.intersectionShape = { + (G.clickable === !0 || G.hoverable === !0) && (G.intersectionShape === void 0 || G.intersectionShape.triangle === void 0) && (G.intersectionShape = { sphere: null, cylinder: [], line: [], triangle: [] }); } else - k != null && (t(k) && j.atom === "O" || Ae && k.atom === "P" && (j.atom === "OP2" || j.atom === "O2P") || Ae && k.atom.indexOf("O5") == 0 && j.atom.indexOf("C5") == 0) ? (se = new l.Vector3(j.x, j.y, j.z), se.resi = j.resi, (j.atom === "OP2" || j.atom === "O2P") && (xe = new l.Vector3(j.x, j.y, j.z))) : Ae && j.atom.indexOf("O3") == 0 ? we = new l.Vector3(j.x, j.y, j.z) : (j.atom === "N1" && Me in S || j.atom === "N3" && Me in T) && (oe = new l.Vector3(j.x, j.y, j.z), oe.color = (0, E.getColorFromStyle)(j, N).getHex()); - se && ue && se.resi === ue.resi && (M(Re, $, !0, ue, se, ae, k, Z, _e), ae = se, ue = null, se = null, $e.push(ie)); + k != null && (t(k) && G.atom === "O" || Ae && k.atom === "P" && (G.atom === "OP2" || G.atom === "O2P") || Ae && k.atom.indexOf("O5") == 0 && G.atom.indexOf("C5") == 0) ? (he = new l.Vector3(G.x, G.y, G.z), he.resi = G.resi, (G.atom === "OP2" || G.atom === "O2P") && (ye = new l.Vector3(G.x, G.y, G.z))) : Ae && G.atom.indexOf("O3") == 0 ? xe = new l.Vector3(G.x, G.y, G.z) : (G.atom === "N1" && Me in S || G.atom === "N3" && Me in T) && (de = new l.Vector3(G.x, G.y, G.z), de.color = (0, E.getColorFromStyle)(G, V).getHex()); + he && oe && he.resi === oe.resi && (M(Re, z, !0, oe, he, se, k, K, _e), se = he, oe = null, he = null, ze.push(ie)); } } - oe && (we ? Ie = new l.Vector3().addVectors(k, we).multiplyScalar(0.5) : Ie = new l.Vector3(k.x, k.y, k.z), p.GLDraw.drawCylinder(ze, Ie, oe, r, o.CC.color(oe.color), 0, 2), M(Re, $, !0, we, xe, ae, k, Z, _e), $e.push(ie)), fe(!1); + de && (xe ? Pe = new l.Vector3().addVectors(k, xe).multiplyScalar(0.5) : Pe = new l.Vector3(k.x, k.y, k.z), g.GLDraw.drawCylinder(ke, Pe, de, r, o.CC.color(de.color), 0, 2), M(Re, z, !0, xe, ye, se, k, K, _e), ze.push(ie)), fe(!1); } } ), @@ -16745,12 +16745,12 @@ ATOM`, h); /* harmony export */ CC: () => ( /* reexport safe */ - g.CC + p.CC ), /* harmony export */ Color: () => ( /* reexport safe */ - g.Color + p.Color ), /* harmony export */ CustomLinear: () => ( @@ -16785,7 +16785,7 @@ ATOM`, h); /* harmony export */ GLVolumetricRender: () => ( /* reexport safe */ - L.GLVolumetricRender + C.GLVolumetricRender ), /* harmony export */ Gradient: () => ( @@ -16820,12 +16820,12 @@ ATOM`, h); /* harmony export */ Matrix3: () => ( /* reexport safe */ - p.Matrix3 + g.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - p.Matrix4 + g.Matrix4 ), /* harmony export */ Parsers: () => ( @@ -16850,7 +16850,7 @@ ATOM`, h); /* harmony export */ Quaternion: () => ( /* reexport safe */ - p.Quaternion + g.Quaternion ), /* harmony export */ ROYGB: () => ( @@ -16865,7 +16865,7 @@ ATOM`, h); /* harmony export */ Ray: () => ( /* reexport safe */ - p.Ray + g.Ray ), /* harmony export */ Sinebow: () => ( @@ -16890,17 +16890,17 @@ ATOM`, h); /* harmony export */ Vector2: () => ( /* reexport safe */ - p.Vector2 + g.Vector2 ), /* harmony export */ Vector3: () => ( /* reexport safe */ - p.Vector3 + g.Vector3 ), /* harmony export */ VolumeData: () => ( /* reexport safe */ - C.VolumeData + L.VolumeData ), /* harmony export */ adjustVolumeStyle: () => ( @@ -16935,7 +16935,7 @@ ATOM`, h); /* harmony export */ builtinColorSchemes: () => ( /* reexport safe */ - g.builtinColorSchemes + p.builtinColorSchemes ), /* harmony export */ builtinGradients: () => ( @@ -16945,17 +16945,17 @@ ATOM`, h); /* harmony export */ chains: () => ( /* reexport safe */ - g.chains + p.chains ), /* harmony export */ clamp: () => ( /* reexport safe */ - p.clamp + g.clamp ), /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - p.conversionMatrix3 + g.conversionMatrix3 ), /* harmony export */ createStereoViewer: () => ( @@ -16980,7 +16980,7 @@ ATOM`, h); /* harmony export */ degToRad: () => ( /* reexport safe */ - p.degToRad + g.degToRad ), /* harmony export */ download: () => ( @@ -16995,7 +16995,7 @@ ATOM`, h); /* harmony export */ elementColors: () => ( /* reexport safe */ - g.elementColors + p.elementColors ), /* harmony export */ extend: () => ( @@ -17045,7 +17045,7 @@ ATOM`, h); /* harmony export */ htmlColors: () => ( /* reexport safe */ - g.htmlColors + p.htmlColors ), /* harmony export */ isEmptyObject: () => ( @@ -17085,7 +17085,7 @@ ATOM`, h); /* harmony export */ residues: () => ( /* reexport safe */ - g.residues + p.residues ), /* harmony export */ setBondLength: () => ( @@ -17110,7 +17110,7 @@ ATOM`, h); /* harmony export */ ssColors: () => ( /* reexport safe */ - g.ssColors + p.ssColors ), /* harmony export */ subdivide_spline: () => ( @@ -17132,7 +17132,7 @@ ATOM`, h); var l = e( /*! ./Gradient */ "./src/Gradient.ts" - ), g = e( + ), p = e( /*! ./colors */ "./src/colors.ts" ), _ = e( @@ -17144,7 +17144,7 @@ ATOM`, h); ), o = e( /*! ./parsers */ "./src/parsers/index.ts" - ), p = e( + ), g = e( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), E = e( @@ -17156,10 +17156,10 @@ ATOM`, h); ), A = e( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), C = e( + ), L = e( /*! ./VolumeData */ "./src/VolumeData.ts" - ), L = e( + ), C = e( /*! ./VolumetricRender */ "./src/VolumetricRender.ts" ), D = e( @@ -17202,17 +17202,17 @@ ATOM`, h); ) /* harmony export */ }); - function l(g, _) { + function l(p, _) { var x = [[]]; - typeof g == "string" && (g = JSON.parse(g)); - for (var o = g.m, p = o[0].a, E = o[0].b, u = o[0].s, A = _ !== void 0 && _.parseStyle !== void 0 ? _.parseStyle : u !== void 0, C = x[x.length - 1].length, L = 0; L < p.length; L++) { - var D = p[L], r = {}; + typeof p == "string" && (p = JSON.parse(p)); + for (var o = p.m, g = o[0].a, E = o[0].b, u = o[0].s, A = _ !== void 0 && _.parseStyle !== void 0 ? _.parseStyle : u !== void 0, L = x[x.length - 1].length, C = 0; C < g.length; C++) { + var D = g[C], r = {}; r.id = D.i, r.x = D.x, r.y = D.y, r.z = D.z || 0, r.bonds = [], r.bondOrder = []; var n = D.l || "C"; r.elem = n[0].toUpperCase() + n.substring(1).toLowerCase(), r.serial = x[x.length - 1].length, A && (r.style = u[D.s || 0]), x[x.length - 1].push(r); } for (let b = 0; b < E.length; b++) { - let f = E[b], c = f.b + C, t = f.e + C, a = f.o || 1, h = x[x.length - 1][c], M = x[x.length - 1][t]; + let f = E[b], c = f.b + L, t = f.e + L, a = f.o || 1, h = x[x.length - 1][c], M = x[x.length - 1][t]; h.bonds.push(t), h.bondOrder.push(a), M.bonds.push(c), M.bondOrder.push(a); } return x; @@ -17237,7 +17237,7 @@ ATOM`, h); var l = e( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), g = e( + ), p = e( /*! ./utils/processSymmetries */ "./src/parsers/utils/processSymmetries.ts" ), _ = e( @@ -17247,31 +17247,31 @@ ATOM`, h); /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" ); - function o(p, E = {}) { - var u = [], A = !E.doAssembly, C = u.modelData = [], L = E.assignBonds === void 0 ? !0 : E.assignBonds, D = function(Z, q, fe, _e) { - return new _.Vector3(q, fe, _e).applyMatrix3(Z); + function o(g, E = {}) { + var u = [], A = !E.doAssembly, L = u.modelData = [], C = E.assignBonds === void 0 ? !0 : E.assignBonds, D = function(K, q, fe, _e) { + return new _.Vector3(q, fe, _e).applyMatrix3(K); }; - function r(Z, q) { - for (var fe = [], _e = 0, Me = 0; Me < Z.length; ) { - for (; Z.substring(Me, Me + q.length) !== q && Me < Z.length; ) - if (Z[Me] === "'") { - for (Me++; Me < Z.length && Z[Me] !== "'"; ) + function r(K, q) { + for (var fe = [], _e = 0, Me = 0; Me < K.length; ) { + for (; K.substring(Me, Me + q.length) !== q && Me < K.length; ) + if (K[Me] === "'") { + for (Me++; Me < K.length && K[Me] !== "'"; ) Me++; - for (; Z.substring(Me, Me + q.length) !== q && Me < Z.length; ) + for (; K.substring(Me, Me + q.length) !== q && Me < K.length; ) Me++; - } else if (Z[Me] === '"') { - for (Me++; Me < Z.length && Z[Me] !== '"'; ) + } else if (K[Me] === '"') { + for (Me++; Me < K.length && K[Me] !== '"'; ) Me++; Me++; } else Me++; - fe.push(Z.substring(_e, Me)), _e = Me = Me + q.length; + fe.push(K.substring(_e, Me)), _e = Me = Me + q.length; } return fe; } - var n = p.split(/\r?\n|\r/), b = [], f = !1; - for (let Z = 0; Z < n.length; Z++) { - var c = n[Z].split("#")[0]; + var n = g.split(/\r?\n|\r/), b = [], f = !1; + for (let K = 0; K < n.length; K++) { + var c = n[K].split("#")[0]; if (f ? c[0] === ";" && (f = !1) : c[0] === ";" && (f = !0), f || c !== "") { if (!f && (c = c.trim(), c[0] === "_")) { var t = c.split(/\s/)[0].indexOf("."); @@ -17308,78 +17308,78 @@ ATOM`, h); a++; for (var R = []; b[a] === "" || b[a][0] === "_"; ) { if (b[a] !== "") { - let Z = b[a].split(/\s/)[0].toLowerCase(), q = h[Z] = h[Z] || []; + let K = b[a].split(/\s/)[0].toLowerCase(), q = h[K] = h[K] || []; R.push(q); } a++; } - for (var z = 0; a < b.length && b[a][0] !== "_" && !b[a].startsWith("loop_") && !b[a].startsWith("data_"); ) { - let Z = r(b[a], " "); - for (var P = 0; P < Z.length; P++) - Z[P] !== "" && (R[z].push(Z[P]), z = (z + 1) % R.length); + for (var $ = 0; a < b.length && b[a][0] !== "_" && !b[a].startsWith("loop_") && !b[a].startsWith("data_"); ) { + let K = r(b[a], " "); + for (var P = 0; P < K.length; P++) + K[P] !== "" && (R[$].push(K[P]), $ = ($ + 1) % R.length); a++; } } else a++; - C.push({ symmetries: [] }), u.push([]); - var B = h._atom_site_id !== void 0 ? h._atom_site_id.length : h._atom_site_label.length, U; + L.push({ symmetries: [] }), u.push([]); + var B = h._atom_site_id !== void 0 ? h._atom_site_id.length : h._atom_site_label.length, F; if (h._cell_length_a !== void 0) { - var F = parseFloat(h._cell_length_a), $ = parseFloat(h._cell_length_b), W = parseFloat(h._cell_length_c), N = parseFloat(h._cell_angle_alpha) || 90, G = parseFloat(h._cell_angle_beta) || 90, k = parseFloat(h._cell_angle_gamma) || 90; - U = (0, _.conversionMatrix3)(F, $, W, N, G, k), C[C.length - 1].cryst = { - a: F, - b: $, + var U = parseFloat(h._cell_length_a), z = parseFloat(h._cell_length_b), W = parseFloat(h._cell_length_c), V = parseFloat(h._cell_angle_alpha) || 90, N = parseFloat(h._cell_angle_beta) || 90, k = parseFloat(h._cell_angle_gamma) || 90; + F = (0, _.conversionMatrix3)(U, z, W, V, N, k), L[L.length - 1].cryst = { + a: U, + b: z, c: W, - alpha: N, - beta: G, + alpha: V, + beta: N, gamma: k }; } - for (var j = 0; j < B; j++) - if (!(h._atom_site_group_pdb !== void 0 && h._atom_site_group_pdb[j] === "TER")) { + for (var G = 0; G < B; G++) + if (!(h._atom_site_group_pdb !== void 0 && h._atom_site_group_pdb[G] === "TER")) { var Q = {}; if (h._atom_site_cartn_x !== void 0) - Q.x = parseFloat(h._atom_site_cartn_x[j]), Q.y = parseFloat(h._atom_site_cartn_y[j]), Q.z = parseFloat(h._atom_site_cartn_z[j]); + Q.x = parseFloat(h._atom_site_cartn_x[G]), Q.y = parseFloat(h._atom_site_cartn_y[G]), Q.z = parseFloat(h._atom_site_cartn_z[G]); else { - var ie = D(U, parseFloat(h._atom_site_fract_x[j]), parseFloat(h._atom_site_fract_y[j]), parseFloat(h._atom_site_fract_z[j])); + var ie = D(F, parseFloat(h._atom_site_fract_x[G]), parseFloat(h._atom_site_fract_y[G]), parseFloat(h._atom_site_fract_z[G])); Q.x = ie.x, Q.y = ie.y, Q.z = ie.z; } - Q.chain = h._atom_site_auth_asym_id ? h._atom_site_auth_asym_id[j] : h._atom_site_label_asym_id ? h._atom_site_label_asym_id[j] : void 0, Q.resi = h._atom_site_auth_seq_id ? parseInt(h._atom_site_auth_seq_id[j]) : h._atom_site_label_seq_id ? h._atom_site_label_seq_id[j] : void 0, Q.resn = h._atom_site_auth_comp_id ? h._atom_site_auth_comp_id[j].trim() : h._atom_site_label_comp_id ? h._atom_site_label_comp_id[j].trim() : void 0, Q.atom = h._atom_site_auth_atom_id ? h._atom_site_auth_atom_id[j].replace(/"/gm, "") : h._atom_site_label_atom_id ? h._atom_site_label_atom_id[j].replace(/"/gm, "") : void 0, Q.hetflag = !h._atom_site_group_pdb || h._atom_site_group_pdb[j] === "HETA" || h._atom_site_group_pdb[j] === "HETATM"; - var pe = "X"; - h._atom_site_type_symbol ? pe = h._atom_site_type_symbol[j].replace(/\(?\+?\d+.*/, "") : h._atom_site_label && (pe = h._atom_site_label[j].split("_")[0].replace(/\(?\d+.*/, "")), Q.elem = pe[0].toUpperCase() + pe.substring(1, 2).toLowerCase(), Q.bonds = [], Q.ss = "c", Q.serial = j, Q.bondOrder = [], Q.properties = {}, u[u.length - 1].push(Q); + Q.chain = h._atom_site_auth_asym_id ? h._atom_site_auth_asym_id[G] : h._atom_site_label_asym_id ? h._atom_site_label_asym_id[G] : void 0, Q.resi = h._atom_site_auth_seq_id ? parseInt(h._atom_site_auth_seq_id[G]) : h._atom_site_label_seq_id ? h._atom_site_label_seq_id[G] : void 0, Q.resn = h._atom_site_auth_comp_id ? h._atom_site_auth_comp_id[G].trim() : h._atom_site_label_comp_id ? h._atom_site_label_comp_id[G].trim() : void 0, Q.atom = h._atom_site_auth_atom_id ? h._atom_site_auth_atom_id[G].replace(/"/gm, "") : h._atom_site_label_atom_id ? h._atom_site_label_atom_id[G].replace(/"/gm, "") : void 0, Q.hetflag = !h._atom_site_group_pdb || h._atom_site_group_pdb[G] === "HETA" || h._atom_site_group_pdb[G] === "HETATM"; + var ge = "X"; + h._atom_site_type_symbol ? ge = h._atom_site_type_symbol[G].replace(/\(?\+?\d+.*/, "") : h._atom_site_label && (ge = h._atom_site_label[G].split("_")[0].replace(/\(?\d+.*/, "")), Q.elem = ge[0].toUpperCase() + ge.substring(1, 2).toLowerCase(), Q.bonds = [], Q.ss = "c", Q.serial = G, Q.bondOrder = [], Q.properties = {}, u[u.length - 1].push(Q); } if (h._pdbx_struct_oper_list_id !== void 0 && !A) - for (let Z = 0; Z < h._pdbx_struct_oper_list_id.length; Z++) { - var he = parseFloat(h["_pdbx_struct_oper_list_matrix[1][1]"][Z]), ue = parseFloat(h["_pdbx_struct_oper_list_matrix[1][2]"][Z]), se = parseFloat(h["_pdbx_struct_oper_list_matrix[1][3]"][Z]), ae = parseFloat(h["_pdbx_struct_oper_list_vector[1]"][Z]), we = parseFloat(h["_pdbx_struct_oper_list_matrix[2][1]"][Z]), xe = parseFloat(h["_pdbx_struct_oper_list_matrix[2][2]"][Z]), Ie = parseFloat(h["_pdbx_struct_oper_list_matrix[2][3]"][Z]), oe = parseFloat(h["_pdbx_struct_oper_list_vector[2]"][Z]), ve = parseFloat(h["_pdbx_struct_oper_list_matrix[3][1]"][Z]), re = parseFloat(h["_pdbx_struct_oper_list_matrix[3][2]"][Z]), Se = parseFloat(h["_pdbx_struct_oper_list_matrix[3][3]"][Z]), ze = parseFloat(h["_pdbx_struct_oper_list_vector[3]"][Z]), Ge = new _.Matrix4(he, ue, se, ae, we, xe, Ie, oe, ve, re, Se, ze); - C[C.length - 1].symmetries.push(Ge); + for (let K = 0; K < h._pdbx_struct_oper_list_id.length; K++) { + var le = parseFloat(h["_pdbx_struct_oper_list_matrix[1][1]"][K]), oe = parseFloat(h["_pdbx_struct_oper_list_matrix[1][2]"][K]), he = parseFloat(h["_pdbx_struct_oper_list_matrix[1][3]"][K]), se = parseFloat(h["_pdbx_struct_oper_list_vector[1]"][K]), xe = parseFloat(h["_pdbx_struct_oper_list_matrix[2][1]"][K]), ye = parseFloat(h["_pdbx_struct_oper_list_matrix[2][2]"][K]), Pe = parseFloat(h["_pdbx_struct_oper_list_matrix[2][3]"][K]), de = parseFloat(h["_pdbx_struct_oper_list_vector[2]"][K]), pe = parseFloat(h["_pdbx_struct_oper_list_matrix[3][1]"][K]), re = parseFloat(h["_pdbx_struct_oper_list_matrix[3][2]"][K]), Se = parseFloat(h["_pdbx_struct_oper_list_matrix[3][3]"][K]), ke = parseFloat(h["_pdbx_struct_oper_list_vector[3]"][K]), $e = new _.Matrix4(le, oe, he, se, xe, ye, Pe, de, pe, re, Se, ke); + L[L.length - 1].symmetries.push($e); } - var $e = function(Z) { - var q = Z.match("-"); - Z = Z.replace(/[-xyz]/g, ""); - var fe = Z.split("/"), _e, Me; + var ze = function(K) { + var q = K.match("-"); + K = K.replace(/[-xyz]/g, ""); + var fe = K.split("/"), _e, Me; return fe[1] === void 0 ? Me = 1 : Me = parseInt(fe[1]), fe[0] === "" ? _e = 1 : _e = parseInt(fe[0]), _e / Me * (q ? -1 : 1); }; if (h._symmetry_equiv_pos_as_xyz !== void 0 && !A) for (var Re = 0; Re < h._symmetry_equiv_pos_as_xyz.length; Re++) { - var Be = h._symmetry_equiv_pos_as_xyz[Re].replace(/["' ]/g, ""), ke = Be.split(",").map(function(q) { + var Fe = h._symmetry_equiv_pos_as_xyz[Re].replace(/["' ]/g, ""), Ie = Fe.split(",").map(function(q) { return q.replace(/-/g, "+-"); }); - let Z = new _.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + let K = new _.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); for (let q = 0; q < 3; q++) { - var We = ke[q].split("+"); + var We = Ie[q].split("+"); for (let fe = 0; fe < We.length; fe++) { - var Te = We[fe]; - if (Te !== "") { - var je = $e(Te); - Te.match("x") ? Z.elements[q + 0] = je : Te.match("y") ? Z.elements[q + 4] = je : Te.match("z") ? Z.elements[q + 8] = je : Z.elements[q + 12] = je; + var Ue = We[fe]; + if (Ue !== "") { + var Be = ze(Ue); + Ue.match("x") ? K.elements[q + 0] = Be : Ue.match("y") ? K.elements[q + 4] = Be : Ue.match("z") ? K.elements[q + 8] = Be : K.elements[q + 12] = Be; } } } - var Fe = U.getMatrix4(), X = new _.Matrix4().getInverse(Fe, !0); - Z = new _.Matrix4().multiplyMatrices(Z, X), Z = new _.Matrix4().multiplyMatrices(Fe, Z), C[C.length - 1].symmetries.push(Z); + var Ne = F.getMatrix4(), H = new _.Matrix4().getInverse(Ne, !0); + K = new _.Matrix4().multiplyMatrices(K, H), K = new _.Matrix4().multiplyMatrices(Ne, K), L[L.length - 1].symmetries.push(K); } } - for (let Z = 0; Z < u.length; Z++) - L && !(E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms) && (0, x.assignPDBBonds)(u[Z], E), (0, l.computeSecondaryStructure)(u[Z], E.hbondCutoff), (0, g.processSymmetries)(C[Z].symmetries, u[Z], E, C[Z].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && L && (0, x.assignPDBBonds)(u[Z], E); + for (let K = 0; K < u.length; K++) + C && !(E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms) && (0, x.assignPDBBonds)(u[K], E), (0, l.computeSecondaryStructure)(u[K], E.hbondCutoff), (0, p.processSymmetries)(L[K].symmetries, u[K], E, L[K].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && C && (0, x.assignPDBBonds)(u[K], E); return u; } } @@ -17402,44 +17402,44 @@ ATOM`, h); var l = e( /*! ../WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ), _ = e( /*! ./utils/anumToSymbol */ "./src/parsers/utils/anumToSymbol.ts" ); - function x(o, p) { - p = p || {}; - var E = [[]], u = o.split(/\r?\n/), A = p.assignBonds === void 0 ? !0 : p.assignBonds; + function x(o, g) { + g = g || {}; + var E = [[]], u = o.split(/\r?\n/), A = g.assignBonds === void 0 ? !0 : g.assignBonds; if (u.length < 6) return E; - var C = u[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), L = Math.abs(parseFloat(C[0])); + var L = u[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), C = Math.abs(parseFloat(L[0])); let D = {}; - var r = D.origin = new l.Vector3(parseFloat(C[1]), parseFloat(C[2]), parseFloat(C[3])); - C = u[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), C = u[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var n = C[0] > 0 ? 0.529177 : 1; + var r = D.origin = new l.Vector3(parseFloat(L[1]), parseFloat(L[2]), parseFloat(L[3])); + L = u[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), L = u[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var n = L[0] > 0 ? 0.529177 : 1; r.multiplyScalar(n); - var b = Math.abs(C[0]), f = new l.Vector3(parseFloat(C[1]), parseFloat(C[2]), parseFloat(C[3])).multiplyScalar(n); - C = u[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var c = Math.abs(C[0]), t = new l.Vector3(parseFloat(C[1]), parseFloat(C[2]), parseFloat(C[3])).multiplyScalar(n); - C = u[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var a = Math.abs(C[0]), h = new l.Vector3(parseFloat(C[1]), parseFloat(C[2]), parseFloat(C[3])).multiplyScalar(n); + var b = Math.abs(L[0]), f = new l.Vector3(parseFloat(L[1]), parseFloat(L[2]), parseFloat(L[3])).multiplyScalar(n); + L = u[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var c = Math.abs(L[0]), t = new l.Vector3(parseFloat(L[1]), parseFloat(L[2]), parseFloat(L[3])).multiplyScalar(n); + L = u[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var a = Math.abs(L[0]), h = new l.Vector3(parseFloat(L[1]), parseFloat(L[2]), parseFloat(L[3])).multiplyScalar(n); if (D.size = { x: b, y: c, z: a }, D.unit = new l.Vector3(f.x, t.y, h.z), f.y != 0 || f.z != 0 || t.x != 0 || t.z != 0 || h.x != 0 || h.y != 0) { D.matrix4 = new l.Matrix4(f.x, t.x, h.x, 0, f.y, t.y, h.y, 0, f.z, t.z, h.z, 0, 0, 0, 0, 1); let P = new l.Matrix4().makeTranslation(r.x, r.y, r.z); D.matrix4 = D.matrix4.multiplyMatrices(P, D.matrix4), D.matrix = D.matrix4.matrix3FromTopLeft(), D.origin = new l.Vector3(0, 0, 0), D.unit = new l.Vector3(1, 1, 1); } - E.modelData = [{ cryst: D }], u = u.splice(6, L); + E.modelData = [{ cryst: D }], u = u.splice(6, C); for (var M = E[E.length - 1].length, w = M + u.length, S = M; S < w; ++S) { var T = {}; T.serial = S; - var R = u[S - M], z = R.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - T.elem = _.anumToSymbol[z[0]], T.x = parseFloat(z[2]) * n, T.y = parseFloat(z[3]) * n, T.z = parseFloat(z[4]) * n, T.hetflag = !0, T.bonds = [], T.bondOrder = [], T.properties = {}, E[E.length - 1].push(T); + var R = u[S - M], $ = R.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + T.elem = _.anumToSymbol[$[0]], T.x = parseFloat($[2]) * n, T.y = parseFloat($[3]) * n, T.z = parseFloat($[4]) * n, T.hetflag = !0, T.bonds = [], T.bondOrder = [], T.properties = {}, E[E.length - 1].push(T); } if (A) for (let P = 0; P < E.length; P++) - (0, g.assignBonds)(E[P], p); + (0, p.assignBonds)(E[P], g); return E; } } @@ -17462,34 +17462,34 @@ ATOM`, h); var l = e( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" - ), g = e( + ), p = e( /*! ./utils/atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" ); function _(x, o) { - for (var p = [], E = x.split(/\r?\n|\r/); E.length > 0 && !(E.length < 3); ) { + for (var g = [], E = x.split(/\r?\n|\r/); E.length > 0 && !(E.length < 3); ) { var u = parseInt(E[1]); if (isNaN(u) || u <= 0 || E.length < u + 3) break; var A = []; - p.push(A); - for (var C = 2, L = A.length, D = L + u, r = L; r < D; r++) { - var n = E[C++], b = {}; - b.serial = r, b.atom = n.slice(10, 15).trim(), b.elem = (0, g.atomNameToElem)(b.atom, !0), b.x = 10 * parseFloat(n.slice(20, 28)), b.y = 10 * parseFloat(n.slice(28, 36)), b.z = 10 * parseFloat(n.slice(36, 44)), b.resi = parseInt(n.slice(0, 5)), b.resn = n.slice(5, 10).trim(), b.bonds = [], b.bondOrder = [], b.properties = {}, n.length > 44 && (b.dx = 10 * parseFloat(n.slice(44, 52)), b.dy = 10 * parseFloat(n.slice(52, 60)), b.dz = 10 * parseFloat(n.slice(60, 68))), A[r] = b; + g.push(A); + for (var L = 2, C = A.length, D = C + u, r = C; r < D; r++) { + var n = E[L++], b = {}; + b.serial = r, b.atom = n.slice(10, 15).trim(), b.elem = (0, p.atomNameToElem)(b.atom, !0), b.x = 10 * parseFloat(n.slice(20, 28)), b.y = 10 * parseFloat(n.slice(28, 36)), b.z = 10 * parseFloat(n.slice(36, 44)), b.resi = parseInt(n.slice(0, 5)), b.resn = n.slice(5, 10).trim(), b.bonds = [], b.bondOrder = [], b.properties = {}, n.length > 44 && (b.dx = 10 * parseFloat(n.slice(44, 52)), b.dy = 10 * parseFloat(n.slice(52, 60)), b.dz = 10 * parseFloat(n.slice(60, 68))), A[r] = b; } - if (E.length <= C + 3) { - var f = E[C++], c = f.trim().split(/\s+/); + if (E.length <= L + 3) { + var f = E[L++], c = f.trim().split(/\s+/); if (c.length == 3) { for (var t = 0; t < 3; t++) c[t] = parseFloat(c[t]) * 10; - p.box = c; + g.box = c; } } - E.splice(0, ++C); + E.splice(0, ++L); } - for (let a = 0; a < p.length; a++) - (0, l.assignPDBBonds)(p[a], o); - return p; + for (let a = 0; a < g.length; a++) + (0, l.assignPDBBonds)(g[a], o); + return g; } } ), @@ -17504,7 +17504,7 @@ ATOM`, h); /* harmony export */ LAMMPSTRJ: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -17512,8 +17512,8 @@ ATOM`, h); /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function g(_, x) { - for (var o = [], p = { + function p(_, x) { + for (var o = [], g = { id: "serial", type: "atom", element: "elem", @@ -17531,22 +17531,22 @@ ATOM`, h); zu: "z", zs: "z", zsu: "z" - }, E = _.split(/\r?\n|\r/), u = 0, A = 0, C = 0; C < E.length - 9; ) { - for (var L = C; L < E.length; L++) - if (E[L].match(/ITEM: NUMBER OF ATOMS/) && (A = parseInt(E[L + 1])), E[L].match(/ITEM: ATOMS/)) { - u = L + 1; + }, E = _.split(/\r?\n|\r/), u = 0, A = 0, L = 0; L < E.length - 9; ) { + for (var C = L; C < E.length; C++) + if (E[C].match(/ITEM: NUMBER OF ATOMS/) && (A = parseInt(E[C + 1])), E[C].match(/ITEM: ATOMS/)) { + u = C + 1; break; } var D = E[u - 1].replace("ITEM: ATOMS ", "").split(" "); o.push([]); for (let a = u; a < u + A; a++) { for (var r = {}, n = {}, b = E[a].split(" "), f = 0; f < b.length; f++) { - var c = p[D[f]]; + var c = g[D[f]]; c != null && (c == "serial" ? r[c] = parseInt(b[f]) : c == "x" || c == "y" || c === "z" ? r[c] = parseFloat(b[f]) : c == "charge" || c == "radius" ? n[c] = parseFloat(b[f]) : r[c] = b[f]), r.properties = n, r.bonds = [], r.bondOrder = []; } o[o.length - 1][a - u] = r; } - C = u + A - 1; + L = u + A - 1; } if (x.assignBonds) for (var t = 0; t < o.length; t++) @@ -17573,7 +17573,7 @@ ATOM`, h); var l = e( /*! ../utilities */ "./src/utilities.ts" - ), g = e( + ), p = e( /*! ../WebGL */ "./src/WebGL/index.ts" ), _ = e( @@ -17585,10 +17585,10 @@ ATOM`, h); ), o = e( /*! ./src/vendor/mmtf.js */ "./src/vendor/mmtf.js" - ), p = function(C) { - return String.fromCharCode.apply(null, C).replace(/\0/g, ""); - }, E = function(C) { - return C == 0 || C == 2 || C == 4 ? "h" : C == 3 ? "s" : "c"; + ), g = function(L) { + return String.fromCharCode.apply(null, L).replace(/\0/g, ""); + }, E = function(L) { + return L == 0 || L == 2 || L == 4 ? "h" : L == 3 ? "s" : "c"; }; let u = /* @__PURE__ */ new Set([ "D-SACCHARIDE", @@ -17602,81 +17602,81 @@ ATOM`, h); "PEPTIDE-LIKE", "SACCHARIDE" ]); - function A(C, L) { - var D = !L.keepH, r = L.altLoc ? L.altLoc : "A", n = !!L.noSecondaryStructure, b = !L.noComputeSecondaryStructure, f = !L.doAssembly, c = L.assemblyIndex ? L.assemblyIndex : 0; - typeof C == "string" ? C = (0, l.base64ToArray)(C) : C = new Uint8Array(C); - var t = o.decode(C), a = [[]], h = a.modelData = [], M = 0, w = 0, S = 0, T = t.secStructList, R = t.bFactorList, z = t.altLocList, P = t.occupancyList, B = t.bondAtomList, U = t.bondOrderList, F = t.numModels; - if (F == 0) + function A(L, C) { + var D = !C.keepH, r = C.altLoc ? C.altLoc : "A", n = !!C.noSecondaryStructure, b = !C.noComputeSecondaryStructure, f = !C.doAssembly, c = C.assemblyIndex ? C.assemblyIndex : 0; + typeof L == "string" ? L = (0, l.base64ToArray)(L) : L = new Uint8Array(L); + var t = o.decode(L), a = [[]], h = a.modelData = [], M = 0, w = 0, S = 0, T = t.secStructList, R = t.bFactorList, $ = t.altLocList, P = t.occupancyList, B = t.bondAtomList, F = t.bondOrderList, U = t.numModels; + if (U == 0) return a; - L.multimodel || (F = 1); - var $, W, N, G, k, j, Q = []; + C.multimodel || (U = 1); + var z, W, V, N, k, G, Q = []; if (!f && t.bioAssemblyList && t.bioAssemblyList.length > 0) { var ie = t.bioAssemblyList[c].transformList; - for ($ = 0, j = ie.length; $ < j; $++) { - var pe = new g.Matrix4(ie[$].matrix); - pe.transpose(), Q.push(pe); + for (z = 0, G = ie.length; z < G; z++) { + var ge = new p.Matrix4(ie[z].matrix); + ge.transpose(), Q.push(ge); } } - var he = null; + var le = null; if (t.unitCell) { - var ue = t.unitCell; - he = { a: ue[0], b: ue[1], c: ue[2], alpha: ue[3], beta: ue[4], gamma: ue[5] }; + var oe = t.unitCell; + le = { a: oe[0], b: oe[1], c: oe[2], alpha: oe[3], beta: oe[4], gamma: oe[5] }; } - let se = []; - t.entityList.forEach((ge) => { - ge.chainIndexList.forEach((Y) => { - se[Y] = ge.type == "polymer"; + let he = []; + t.entityList.forEach((ve) => { + ve.chainIndexList.forEach((X) => { + he[X] = ve.type == "polymer"; }); }); - var ae = 0; - for (k = 0; k < F; k++) { - var we = t.chainsPerModel[k], xe = a[a.length - 1], Ie = []; - for (h.push({ symmetries: Q, cryst: he }), $ = 0; $ < we; ++$) { - var oe = t.groupsPerChain[M], ve = p(t.chainIdList.subarray(M * 4, M * 4 + 4)); - t.chainNameList && (ve = p(t.chainNameList.subarray(M * 4, M * 4 + 4))); + var se = 0; + for (k = 0; k < U; k++) { + var xe = t.chainsPerModel[k], ye = a[a.length - 1], Pe = []; + for (h.push({ symmetries: Q, cryst: le }), z = 0; z < xe; ++z) { + var de = t.groupsPerChain[M], pe = g(t.chainIdList.subarray(M * 4, M * 4 + 4)); + t.chainNameList && (pe = g(t.chainNameList.subarray(M * 4, M * 4 + 4))); var re = w, Se = ""; - for (W = 0; W < oe; ++W) { - var ze = t.groupList[t.groupTypeList[w]], Ge = ze.atomNameList.length, $e = 0, Re = !1, Be = !1; + for (W = 0; W < de; ++W) { + var ke = t.groupList[t.groupTypeList[w]], $e = ke.atomNameList.length, ze = 0, Re = !1, Fe = !1; if (T) { - $e = T[w]; - var ke = E($e); - (w == 0 || ke != Se) && (Re = !0), Se = ke; + ze = T[w]; + var Ie = E(ze); + (w == 0 || Ie != Se) && (Re = !0), Se = Ie; var We = w + 1; - (We >= T.length || E(T[We] != ke)) && (Be = !0); + (We >= T.length || E(T[We] != Ie)) && (Fe = !0); } - var Te = t.groupIdList[w], je = ze.groupName; - let ge = ze.chemCompType; - var Fe = S; - let Y = u.has(ge) || !se[M]; - for (N = 0; N < Ge; ++N) { - var X = ze.elementList[N]; - if (D && X == "H") { + var Ue = t.groupIdList[w], Be = ke.groupName; + let ve = ke.chemCompType; + var Ne = S; + let X = u.has(ve) || !he[M]; + for (V = 0; V < $e; ++V) { + var H = ke.elementList[V]; + if (D && H == "H") { S += 1; continue; } - var Z = ""; - R && (Z = R[S]); + var K = ""; + R && (K = R[S]); var q = ""; - z && z[S] && (q = String.fromCharCode(z[S])); + $ && $[S] && (q = String.fromCharCode($[S])); var fe = ""; if (P && (fe = P[S]), q != "" && q != r && r != "*") { S += 1; continue; } - var _e = t.atomIdList[S], Me = ze.atomNameList[N], Ae = 0; - ze.atomChargeList && (Ae = ze.atomChargeList[N]); - var H = t.xCoordList[S], ce = t.yCoordList[S], ye = t.zCoordList[S]; - Ie[S] = xe.length, xe.push({ - resn: je, - x: H, - y: ce, - z: ye, - elem: X, - hetflag: Y, - chain: ve, - resi: Te, + var _e = t.atomIdList[S], Me = ke.atomNameList[V], Ae = 0; + ke.atomChargeList && (Ae = ke.atomChargeList[V]); + var Z = t.xCoordList[S], ue = t.yCoordList[S], we = t.zCoordList[S]; + Pe[S] = ye.length, ye.push({ + resn: Be, + x: Z, + y: ue, + z: we, + elem: H, + hetflag: X, + chain: pe, + resi: Ue, icode: q, - rescode: Te + (q != " " ? "^" + q : ""), + rescode: Ue + (q != " " ? "^" + q : ""), // resi // and // icode @@ -17685,41 +17685,41 @@ ATOM`, h); index: S, atom: Me, bonds: [], - ss: E($e), + ss: E(ze), ssbegin: Re, - ssend: Be, + ssend: Fe, bondOrder: [], properties: { charge: Ae, occupancy: fe }, - b: Z + b: K }), S += 1; } - var Pe = ze.bondAtomList; - for (N = 0, G = ze.bondOrderList.length; N < G; ++N) { - var le = Fe + Pe[N * 2], De = Fe + Pe[N * 2 + 1], K = ze.bondOrderList[N], Oe = Ie[le], Ne = Ie[De], I = xe[Oe], me = xe[Ne]; - I && me && (I.bonds.push(Ne), I.bondOrder.push(K), me.bonds.push(Oe), me.bondOrder.push(K)); + var Te = ke.bondAtomList; + for (V = 0, N = ke.bondOrderList.length; V < N; ++V) { + var ae = Ne + Te[V * 2], De = Ne + Te[V * 2 + 1], Y = ke.bondOrderList[V], Oe = Pe[ae], Ve = Pe[De], I = ye[Oe], me = ye[Ve]; + I && me && (I.bonds.push(Ve), I.bondOrder.push(Y), me.bonds.push(Oe), me.bondOrder.push(Y)); } w += 1; } - for (w = re, W = 0; W < oe; ++W) + for (w = re, W = 0; W < de; ++W) w += 1; M += 1; } if (B) - for (let ge = ae, Y = B.length; ge < Y; ge += 2) { - let ne = B[ge], Ee = B[ge + 1], He = U ? U[ge / 2] : 1; + for (let ve = se, X = B.length; ve < X; ve += 2) { + let ne = B[ve], Ee = B[ve + 1], He = F ? F[ve / 2] : 1; if (ne >= S) { - ae = ge; + se = ve; break; } - let Ke = Ie[ne], Ve = Ie[Ee], qe = xe[Ke], wt = xe[Ve]; - qe && wt && (qe.bonds.push(Ve), qe.bondOrder.push(He), wt.bonds.push(Ke), wt.bondOrder.push(He)); + let Ke = Pe[ne], je = Pe[Ee], qe = ye[Ke], wt = ye[je]; + qe && wt && (qe.bonds.push(je), qe.bondOrder.push(He), wt.bonds.push(Ke), wt.bondOrder.push(He)); } - L.multimodel && (L.onemol || a.push([])); + C.multimodel && (C.onemol || a.push([])); } if (!f) - for (let ge = 0; ge < a.length; ge++) - (0, x.processSymmetries)(h[ge].symmetries, a[ge], L, h[ge].cryst); - return b && !n && (0, _.computeSecondaryStructure)(a, L.hbondCutoff), a; + for (let ve = 0; ve < a.length; ve++) + (0, x.processSymmetries)(h[ve].symmetries, a[ve], C, h[ve].cryst); + return b && !n && (0, _.computeSecondaryStructure)(a, C.hbondCutoff), a; } } ), @@ -17734,7 +17734,7 @@ ATOM`, h); /* harmony export */ MOL2: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -17788,15 +17788,15 @@ ATOM`, h); "S.o2": "S", So2: "S" }; - function g(_, x) { - var o = [[]], p = !1; - typeof x.keepH < "u" && (p = !x.keepH); + function p(_, x) { + var o = [[]], g = !1; + typeof x.keepH < "u" && (g = !x.keepH); var E = _.search(/@MOLECULE/), u = _.search(/@ATOM/); if (E == -1 || u == -1) return o; for (var A = _.substring(E).split(/\r?\n|\r/); A.length > 0; ) { - var C = [], L = A[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), D = parseInt(L[0]), r = 0; - L.length > 1 && (r = parseInt(L[1])); + var L = [], C = A[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), D = parseInt(C[0]), r = 0; + C.length > 1 && (r = parseInt(C[1])); var n = 4, b; for (b = 3; b < A.length; b++) if (A[b] == "@ATOM") { @@ -17805,16 +17805,16 @@ ATOM`, h); } var f = o[o.length - 1].length, c = f + D, t; for (b = f; b < c; b++) { - t = A[n++], L = t.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var a = {}, h = L[5]; - if (l[h] !== void 0 ? h = l[h] : (h = h.split(".")[0], h = h[0].toUpperCase() + h.substring(1).toLowerCase()), a.atom = L[1], a.elem = h, !(a.elem == "H" && p)) { - var M = o[o.length - 1].length, w = parseInt(L[0]); - a.serial = w, a.x = parseFloat(L[2]), a.y = parseFloat(L[3]), a.z = parseFloat(L[4]), a.atom = L[5]; - var S = parseFloat(L[8]); + t = A[n++], C = t.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var a = {}, h = C[5]; + if (l[h] !== void 0 ? h = l[h] : (h = h.split(".")[0], h = h[0].toUpperCase() + h.substring(1).toLowerCase()), a.atom = C[1], a.elem = h, !(a.elem == "H" && g)) { + var M = o[o.length - 1].length, w = parseInt(C[0]); + a.serial = w, a.x = parseFloat(C[2]), a.y = parseFloat(C[3]), a.z = parseFloat(C[4]), a.atom = C[5]; + var S = parseFloat(C[8]); a.index = M, a.bonds = [], a.bondOrder = [], a.properties = { charge: S, partialCharge: S - }, C[w] = M, o[o.length - 1].push(a); + }, L[w] = M, o[o.length - 1].push(a); } } for (var T = !1; n < A.length; ) @@ -17824,9 +17824,9 @@ ATOM`, h); } if (T && r) for (b = 0; b < r; b++) { - t = A[n++], L = t.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var R = parseInt(L[1]), z = o[o.length - 1][C[R]], P = parseInt(L[2]), B = o[o.length - 1][C[P]], U = parseInt(L[3]); - isNaN(U) && (U = 1), z !== void 0 && B !== void 0 && (z.bonds.push(C[P]), z.bondOrder.push(U), B.bonds.push(C[R]), B.bondOrder.push(U)); + t = A[n++], C = t.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + var R = parseInt(C[1]), $ = o[o.length - 1][L[R]], P = parseInt(C[2]), B = o[o.length - 1][L[P]], F = parseInt(C[3]); + isNaN(F) && (F = 1), $ !== void 0 && B !== void 0 && ($.bonds.push(L[P]), $.bondOrder.push(F), B.bonds.push(L[R]), B.bondOrder.push(F)); } if (x.multimodel) { x.onemol || o.push([]), A.splice(0, n), _ = A.join(` @@ -17850,7 +17850,7 @@ ATOM`, h); /* harmony export */ PDB: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -17858,23 +17858,23 @@ ATOM`, h); /*! ./utils/getSinglePDB */ "./src/parsers/utils/getSinglePDB.ts" ); - function g(_, x) { + function p(_, x) { x = x || {}; - var o = [], p = {}; + var o = [], g = {}; o.modelData = []; for (var E = _.split(/\r?\n|\r/); E.length > 0; ) { - var u = (0, l.getSinglePDB)(E, x, p), A = u[0], C = u[1]; + var u = (0, l.getSinglePDB)(E, x, g), A = u[0], L = u[1]; if (E = u[2], A.length != 0) { if (x.multimodel && x.onemol && o.length > 0) - for (var L = o[0].length, D = 0; D < A.length; D++) { + for (var C = o[0].length, D = 0; D < A.length; D++) { var r = A[D]; r.index = D; for (var n = 0; n < r.bonds.length; n++) - r.bonds[n] += L; + r.bonds[n] += C; o[0].push(r); } else - o.modelData.push(C), o.push(A); + o.modelData.push(L), o.push(A); if (!x.multimodel) break; } @@ -17901,28 +17901,28 @@ ATOM`, h); var l = e( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" - ), g = e( + ), p = e( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" ); function _(x, o) { - var p = [[]], E = !o.noSecondaryStructure; - p.modelData = [{ symmetries: [] }]; - var u = [], A = x.split(/\r?\n|\r/), C; + var g = [[]], E = !o.noSecondaryStructure; + g.modelData = [{ symmetries: [] }]; + var u = [], A = x.split(/\r?\n|\r/), L; for (let T = 0; T < A.length; T++) { - C = A[T].replace(/^\s*/, ""); - var L = C.substring(0, 6); - if (L.indexOf("END") == 0) + L = A[T].replace(/^\s*/, ""); + var C = L.substring(0, 6); + if (C.indexOf("END") == 0) if (o.multimodel) { - o.onemol || p.push([]); + o.onemol || g.push([]); continue; } else break; - else if (L == "ATOM " || L == "HETATM") { + else if (C == "ATOM " || C == "HETATM") { var D; - let R = parseInt(C.substring(6, 11)), z = C.substring(12, 16).replace(/ /g, ""), P = C.substring(17, 20).trim(), B = C.substring(21, 22), U = parseInt(C.substring(22, 26)); - var r = C.substring(30).trim().split(/\s+/), n = parseFloat(r[0]), b = parseFloat(r[1]), f = parseFloat(r[2]), c = parseFloat(r[3]), t = parseFloat(r[4]), a = z[0]; - z.length > 1 && z[1].toUpperCase() != z[1] && (a = z.substring(0, 2)), C[0] == "H" ? D = !0 : D = !1, u[R] = p[p.length - 1].length, p[p.length - 1].push({ + let R = parseInt(L.substring(6, 11)), $ = L.substring(12, 16).replace(/ /g, ""), P = L.substring(17, 20).trim(), B = L.substring(21, 22), F = parseInt(L.substring(22, 26)); + var r = L.substring(30).trim().split(/\s+/), n = parseFloat(r[0]), b = parseFloat(r[1]), f = parseFloat(r[2]), c = parseFloat(r[3]), t = parseFloat(r[4]), a = $[0]; + $.length > 1 && $[1].toUpperCase() != $[1] && (a = $.substring(0, 2)), L[0] == "H" ? D = !0 : D = !1, u[R] = g[g.length - 1].length, g[g.length - 1].push({ resn: P, x: n, y: b, @@ -17930,9 +17930,9 @@ ATOM`, h); elem: a, hetflag: D, chain: B, - resi: U, + resi: F, serial: R, - atom: z, + atom: $, bonds: [], ss: "c", bondOrder: [], @@ -17941,19 +17941,19 @@ ATOM`, h); partialCharge: c, radius: t }, - pdbline: C + pdbline: L }); - } else if (L == "CONECT") { - var h = parseInt(C.substring(6, 11)), M = p[p.length - 1][u[h]]; + } else if (C == "CONECT") { + var h = parseInt(L.substring(6, 11)), M = g[g.length - 1][u[h]]; for (let R = 0; R < 4; R++) { - var w = parseInt(C.substring([11, 16, 21, 26][R], [11, 16, 21, 26][R] + 5)), S = p[p.length - 1][u[w]]; + var w = parseInt(L.substring([11, 16, 21, 26][R], [11, 16, 21, 26][R] + 5)), S = g[g.length - 1][u[w]]; M !== void 0 && S !== void 0 && (M.bonds.push(u[w]), M.bondOrder.push(1)); } } } - for (let T = 0; T < p.length; T++) - (0, l.assignPDBBonds)(p[T], o), E && (0, g.computeSecondaryStructure)(p[T], o.hbondCutoff); - return p; + for (let T = 0; T < g.length; T++) + (0, l.assignPDBBonds)(g[T], o), E && (0, p.computeSecondaryStructure)(g[T], o.hbondCutoff); + return g; } } ), @@ -17972,77 +17972,77 @@ ATOM`, h); ) /* harmony export */ }); - function l(g) { - var _ = [], x, o = 0, p = g.split(/\r?\n|\r/); - if (p.length > 0 && p[0].includes("VERSION")) { - var E = p.filter(function(n) { + function l(p) { + var _ = [], x, o = 0, g = p.split(/\r?\n|\r/); + if (g.length > 0 && g[0].includes("VERSION")) { + var E = g.filter(function(n) { return n.includes("POINTERS") || n.includes("ATOM_NAME") || n.includes("CHARGE") || n.includes("RADII") || n.includes("BONDS_INC_HYDROGEN") || n.includes("BONDS_WITHOUT_HYDROGEN"); }), u = D("POINTERS"); if (u == -1) return []; - var A = r(u), C = parseInt(p[u + 1].slice(0, A[1])); - if (isNaN(C) || C <= 0) + var A = r(u), L = parseInt(g[u + 1].slice(0, A[1])); + if (isNaN(L) || L <= 0) return []; if (u = D("ATOM_NAME"), u == -1) return []; A = r(u); - var L = A[0]; - for (let n = 0; n < C / A[0]; n++) { - n == parseInt(C / A[0]) && (L = C % A[0]); - for (let b = 0; b < L; b++) { + var C = A[0]; + for (let n = 0; n < L / A[0]; n++) { + n == parseInt(L / A[0]) && (C = L % A[0]); + for (let b = 0; b < C; b++) { let f = {}, c = { charge: "", radii: "" }; - f.serial = o, f.x = 0, f.y = 0, f.z = 0, f.atom = p[u + 1].slice(A[1] * b, A[1] * (b + 1)), f.elem = p[u + 1].slice(A[1] * b, A[1] * b + 1), f.properties = c, f.bonds = [], f.bondOrder = [], _.push(f), o++; + f.serial = o, f.x = 0, f.y = 0, f.z = 0, f.atom = g[u + 1].slice(A[1] * b, A[1] * (b + 1)), f.elem = g[u + 1].slice(A[1] * b, A[1] * b + 1), f.properties = c, f.bonds = [], f.bondOrder = [], _.push(f), o++; } u++; } if (u = D("CHARGE"), u != -1) { - A = r(u), o = 0, L = A[0]; - for (let n = 0; n < C / A[0]; n++) { - n == parseInt(C / A[0]) && (L = C % A[0]); - for (let b = 0; b < L; b++) - _[o].properties.charge = parseFloat(p[u + 1].slice(A[1] * b, A[1] * (b + 1))), o++; + A = r(u), o = 0, C = A[0]; + for (let n = 0; n < L / A[0]; n++) { + n == parseInt(L / A[0]) && (C = L % A[0]); + for (let b = 0; b < C; b++) + _[o].properties.charge = parseFloat(g[u + 1].slice(A[1] * b, A[1] * (b + 1))), o++; u++; } } if (u = D("RADII"), u != -1) { - A = r(u), o = 0, L = A[0]; - for (let n = 0; n < C / A[0]; n++) { - n == parseInt(C / A[0]) && (L = C % A[0]); - for (let b = 0; b < L; b++) - _[o].properties.radii = parseFloat(p[u + 1].slice(A[1] * b, A[1] * (b + 1))), o++; + A = r(u), o = 0, C = A[0]; + for (let n = 0; n < L / A[0]; n++) { + n == parseInt(L / A[0]) && (C = L % A[0]); + for (let b = 0; b < C; b++) + _[o].properties.radii = parseFloat(g[u + 1].slice(A[1] * b, A[1] * (b + 1))), o++; u++; } } if (u = D("BONDS_WITHOUT_HYDROGEN"), u != -1) - for (A = r(u), o = 0, L = A[0], u = u + 1; !p[u].match(/^%FLAG/); ) { - p[u + 1].match(/^%FLAG/) && (L = C % A[0]); - for (let n = 0; n < L; n++) - o % 3 == 0 ? x = parseInt(p[u].slice(A[1] * n, A[1] * (n + 1)) / 3) : o % 3 == 1 && _[x].bonds.push(parseInt(p[u].slice(A[1] * n, A[1] * (n + 1)) / 3)), o++; + for (A = r(u), o = 0, C = A[0], u = u + 1; !g[u].match(/^%FLAG/); ) { + g[u + 1].match(/^%FLAG/) && (C = L % A[0]); + for (let n = 0; n < C; n++) + o % 3 == 0 ? x = parseInt(g[u].slice(A[1] * n, A[1] * (n + 1)) / 3) : o % 3 == 1 && _[x].bonds.push(parseInt(g[u].slice(A[1] * n, A[1] * (n + 1)) / 3)), o++; u++; } if (u = D("BONDS_INC_HYDROGEN"), u != -1) - for (A = r(u), o = 0, L = A[0], u = u + 1; !p[u].match(/^%FLAG/); ) { - p[u + 1].match(/^%FLAG/) && (L = C % A[0]); - for (let n = 0; n < L; n++) - o % 3 == 0 ? x = parseInt(p[u].slice(A[1] * n, A[1] * (n + 1)) / 3) : o % 3 == 1 && _[x].bonds.push(parseInt(p[u].slice(A[1] * n, A[1] * (n + 1)) / 3)), o++; + for (A = r(u), o = 0, C = A[0], u = u + 1; !g[u].match(/^%FLAG/); ) { + g[u + 1].match(/^%FLAG/) && (C = L % A[0]); + for (let n = 0; n < C; n++) + o % 3 == 0 ? x = parseInt(g[u].slice(A[1] * n, A[1] * (n + 1)) / 3) : o % 3 == 1 && _[x].bonds.push(parseInt(g[u].slice(A[1] * n, A[1] * (n + 1)) / 3)), o++; u++; } } else return []; function D(n) { - var b = p.indexOf(E.filter(function(f) { + var b = g.indexOf(E.filter(function(f) { return f.includes(n); })[0]); if (Number.isInteger(b) && b > 0) { - for (; !p[b].includes("FORMAT"); ) + for (; !g[b].includes("FORMAT"); ) b++; return b; } else return -1; } function r(n) { - var b = p[n].match(/\((\d*)\S*/), f = p[n].match(/[a-zA-Z](\d*)\)\s*/); - return f == null && (f = p[n].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [b[1], f[1]]; + var b = g[n].match(/\((\d*)\S*/), f = g[n].match(/[a-zA-Z](\d*)\)\s*/); + return f == null && (f = g[n].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [b[1], f[1]]; } return [_]; } @@ -18064,35 +18064,35 @@ ATOM`, h); /* harmony export */ }); var l = function(x, o) { - var p = [[]], E = !1; + var g = [[]], E = !1; for (typeof o.keepH < "u" && (E = !o.keepH); x.length > 0 && !(x.length < 4); ) { var u = parseInt(x[3].substring(0, 3)); if (isNaN(u) || u <= 0) break; - var A = parseInt(x[3].substring(3, 6)), C = 4; + var A = parseInt(x[3].substring(3, 6)), L = 4; if (x.length < 4 + u + A) break; - var L = [], D = p[p.length - 1].length, r = D + u, n, b; - for (n = D; n < r; n++, C++) { - b = x[C]; + var C = [], D = g[g.length - 1].length, r = D + u, n, b; + for (n = D; n < r; n++, L++) { + b = x[L]; var f = {}, c = b.substring(31, 34).replace(/ /g, ""); - f.atom = f.elem = c[0].toUpperCase() + c.substring(1).toLowerCase(), (f.elem !== "H" || !E) && (f.serial = n, L[n] = p[p.length - 1].length, f.x = parseFloat(b.substring(0, 10)), f.y = parseFloat(b.substring(10, 20)), f.z = parseFloat(b.substring(20, 30)), f.hetflag = !0, f.bonds = [], f.bondOrder = [], f.properties = {}, f.index = p[p.length - 1].length, p[p.length - 1].push(f)); + f.atom = f.elem = c[0].toUpperCase() + c.substring(1).toLowerCase(), (f.elem !== "H" || !E) && (f.serial = n, C[n] = g[g.length - 1].length, f.x = parseFloat(b.substring(0, 10)), f.y = parseFloat(b.substring(10, 20)), f.z = parseFloat(b.substring(20, 30)), f.hetflag = !0, f.bonds = [], f.bondOrder = [], f.properties = {}, f.index = g[g.length - 1].length, g[g.length - 1].push(f)); } - for (n = 0; n < A; n++, C++) { - b = x[C]; - var t = L[parseInt(b.substring(0, 3)) - 1 + D], a = L[parseInt(b.substring(3, 6)) - 1 + D], h = parseFloat(b.substring(6)); - typeof t < "u" && typeof a < "u" && (p[p.length - 1][t].bonds.push(a), p[p.length - 1][t].bondOrder.push(h), p[p.length - 1][a].bonds.push(t), p[p.length - 1][a].bondOrder.push(h)); + for (n = 0; n < A; n++, L++) { + b = x[L]; + var t = C[parseInt(b.substring(0, 3)) - 1 + D], a = C[parseInt(b.substring(3, 6)) - 1 + D], h = parseFloat(b.substring(6)); + typeof t < "u" && typeof a < "u" && (g[g.length - 1][t].bonds.push(a), g[g.length - 1][t].bondOrder.push(h), g[g.length - 1][a].bonds.push(t), g[g.length - 1][a].bondOrder.push(h)); } if (o.multimodel) { - for (o.onemol || p.push([]); x[C] !== "$$$$" && C < x.length; ) - C++; - x.splice(0, ++C); + for (o.onemol || g.push([]); x[L] !== "$$$$" && L < x.length; ) + L++; + x.splice(0, ++L); } else break; } - return p; - }, g = function(x, o) { - var p = [[]], E = !1; + return g; + }, p = function(x, o) { + var g = [[]], E = !1; for (typeof o.keepH < "u" && (E = !o.keepH); x.length > 0 && !(x.length < 8 || !x[4].startsWith("M V30 BEGIN CTAB") || !x[5].startsWith("M V30 COUNTS") || x[5].length < 14); ) { var u = x[5].substring(13).match(/\S+/g); if (u.length < 2) @@ -18100,46 +18100,46 @@ ATOM`, h); var A = parseInt(u[0]); if (isNaN(A) || A <= 0) break; - var C = parseInt(u[1]), L = 7; - if (x.length < 8 + A + C) + var L = parseInt(u[1]), C = 7; + if (x.length < 8 + A + L) break; - var D = [], r = p[p.length - 1].length, n = r + A, b, f; - for (b = r; b < n; b++, L++) { - f = x[L]; + var D = [], r = g[g.length - 1].length, n = r + A, b, f; + for (b = r; b < n; b++, C++) { + f = x[C]; var c = f.substring(6).match(/\S+/g); if (c.length > 4) { var t = {}, a = c[1].replace(/ /g, ""); - t.atom = t.elem = a[0].toUpperCase() + a.substring(1).toLowerCase(), (t.elem !== "H" || !E) && (t.serial = b, D[b] = p[p.length - 1].length, t.x = parseFloat(c[2]), t.y = parseFloat(c[3]), t.z = parseFloat(c[4]), t.hetflag = !0, t.bonds = [], t.bondOrder = [], t.properties = {}, t.index = p[p.length - 1].length, p[p.length - 1].push(t)); + t.atom = t.elem = a[0].toUpperCase() + a.substring(1).toLowerCase(), (t.elem !== "H" || !E) && (t.serial = b, D[b] = g[g.length - 1].length, t.x = parseFloat(c[2]), t.y = parseFloat(c[3]), t.z = parseFloat(c[4]), t.hetflag = !0, t.bonds = [], t.bondOrder = [], t.properties = {}, t.index = g[g.length - 1].length, g[g.length - 1].push(t)); } } - if (x[L] === "M V30 END ATOM") - L++; + if (x[C] === "M V30 END ATOM") + C++; else break; - if (C !== 0 && x[L] === "M V30 BEGIN BOND") - L++; + if (L !== 0 && x[C] === "M V30 BEGIN BOND") + C++; else break; - for (b = 0; b < C; b++, L++) { - f = x[L]; + for (b = 0; b < L; b++, C++) { + f = x[C]; var h = f.substring(6).match(/\S+/g); if (h.length > 3) { var M = D[parseInt(h[2]) - 1 + r], w = D[parseInt(h[3]) - 1 + r], S = parseFloat(h[1]); - typeof M < "u" && typeof w < "u" && (p[p.length - 1][M].bonds.push(w), p[p.length - 1][M].bondOrder.push(S), p[p.length - 1][w].bonds.push(M), p[p.length - 1][w].bondOrder.push(S)); + typeof M < "u" && typeof w < "u" && (g[g.length - 1][M].bonds.push(w), g[g.length - 1][M].bondOrder.push(S), g[g.length - 1][w].bonds.push(M), g[g.length - 1][w].bondOrder.push(S)); } } if (o.multimodel) { - for (o.onemol || p.push([]); x[L] !== "$$$$" && L < x.length; ) - L++; - x.splice(0, ++L); + for (o.onemol || g.push([]); x[C] !== "$$$$" && C < x.length; ) + C++; + x.splice(0, ++C); } else break; } - return p; + return g; }; function _(x, o) { - var p = "V2000", E = x.split(/\r?\n|\r/); - return E.length > 3 && E[3].length > 38 && (p = E[3].substring(34, 39)), p === "V2000" ? l(E, o) : p === "V3000" ? g(E, o) : [[""]]; + var g = "V2000", E = x.split(/\r?\n|\r/); + return E.length > 3 && E[3].length > 38 && (g = E[3].substring(34, 39)), g === "V2000" ? l(E, o) : g === "V3000" ? p(E, o) : [[""]]; } } ), @@ -18154,7 +18154,7 @@ ATOM`, h); /* harmony export */ VASP: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -18162,35 +18162,35 @@ ATOM`, h); /*! ../WebGL */ "./src/WebGL/index.ts" ); - function g(_) { - var x = [[]], o = {}, p = _.replace(/^\s+/, "").split(/\r?\n/); - if (p.length < 3) + function p(_) { + var x = [[]], o = {}, g = _.replace(/^\s+/, "").split(/\r?\n/); + if (g.length < 3) return x; - if (p[1].match(/\d+/)) - o.length = parseFloat(p[1]); + if (g[1].match(/\d+/)) + o.length = parseFloat(g[1]); else return console.log("Warning: second line of the vasp structure file must be a number"), x; if (o.length < 0) return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), x; - o.xVec = new Float32Array(p[2].replace(/^\s+/, "").split(/\s+/)), o.yVec = new Float32Array(p[3].replace(/^\s+/, "").split(/\s+/)), o.zVec = new Float32Array(p[4].replace(/^\s+/, "").split(/\s+/)); + o.xVec = new Float32Array(g[2].replace(/^\s+/, "").split(/\s+/)), o.yVec = new Float32Array(g[3].replace(/^\s+/, "").split(/\s+/)), o.zVec = new Float32Array(g[4].replace(/^\s+/, "").split(/\s+/)); var E = new l.Matrix3(o.xVec[0], o.xVec[1], o.xVec[2], o.yVec[0], o.yVec[1], o.yVec[2], o.zVec[0], o.zVec[1], o.zVec[2]); E.multiplyScalar(o.length), x.modelData = [{ symmetries: [], cryst: { matrix: E } }]; - var u = p[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), A = new Int16Array(p[6].replace(/^\s+/, "").split(/\s+/)), C = p[7].replace(/\s+/, ""); - if (C.match(/C/)) - C = "cartesian"; - else if (C.match(/D/)) - C = "direct"; + var u = g[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), A = new Int16Array(g[6].replace(/^\s+/, "").split(/\s+/)), L = g[7].replace(/\s+/, ""); + if (L.match(/C/)) + L = "cartesian"; + else if (L.match(/D/)) + L = "direct"; else return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), x; if (u.length != A.length) return console.log("Warning: declaration of atomary species wrong:"), console.log(u), console.log(A), x; - p.splice(0, 8); - for (var L = 0, D = 0, r = u.length; D < r; D++) { + g.splice(0, 8); + for (var C = 0, D = 0, r = u.length; D < r; D++) { for (var n = u[D], b = 0, f = A[D]; b < f; b++) { - var c = new Float32Array(p[L + b].replace(/^\s+/, "").split(/\s+/)), t = {}; - t.elem = n, C == "cartesian" ? (t.x = o.length * c[0], t.y = o.length * c[1], t.z = o.length * c[2]) : (t.x = o.length * (c[0] * o.xVec[0] + c[1] * o.yVec[0] + c[2] * o.zVec[0]), t.y = o.length * (c[0] * o.xVec[1] + c[1] * o.yVec[1] + c[2] * o.zVec[1]), t.z = o.length * (c[0] * o.xVec[2] + c[1] * o.yVec[2] + c[2] * o.zVec[2])), t.bonds = [], x[0].push(t); + var c = new Float32Array(g[C + b].replace(/^\s+/, "").split(/\s+/)), t = {}; + t.elem = n, L == "cartesian" ? (t.x = o.length * c[0], t.y = o.length * c[1], t.z = o.length * c[2]) : (t.x = o.length * (c[0] * o.xVec[0] + c[1] * o.yVec[0] + c[2] * o.zVec[0]), t.y = o.length * (c[0] * o.xVec[1] + c[1] * o.yVec[1] + c[2] * o.zVec[1]), t.z = o.length * (c[0] * o.xVec[2] + c[1] * o.yVec[2] + c[2] * o.zVec[2])), t.bonds = [], x[0].push(t); } - L += A[D]; + C += A[D]; } return x; } @@ -18214,49 +18214,49 @@ ATOM`, h); var l = e( /*! ../WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); function _(x, o) { o = o || {}; - for (var p = [[]], E = o.assignBonds === void 0 ? !0 : o.assignBonds, u = x.split(/\r?\n|\r/); u.length > 0 && !(u.length < 3); ) { + for (var g = [[]], E = o.assignBonds === void 0 ? !0 : o.assignBonds, u = x.split(/\r?\n|\r/); u.length > 0 && !(u.length < 3); ) { var A = parseInt(u[0]); if (isNaN(A) || A <= 0 || u.length < A + 2) break; - var C = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, L = C.exec(u[1]); - if (L != null && L.length > 1) { - var D = new Float32Array(L[1].split(/\s+/)), r = new l.Matrix3(D[0], D[3], D[6], D[1], D[4], D[7], D[2], D[5], D[8]); - p.modelData = [{ cryst: { matrix: r } }]; + var L = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, C = L.exec(u[1]); + if (C != null && C.length > 1) { + var D = new Float32Array(C[1].split(/\s+/)), r = new l.Matrix3(D[0], D[3], D[6], D[1], D[4], D[7], D[2], D[5], D[8]); + g.modelData = [{ cryst: { matrix: r } }]; } - for (var n = 2, b = p[p.length - 1].length, f = b + A, c = b; c < f; c++) { + for (var n = 2, b = g[g.length - 1].length, f = b + A, c = b; c < f; c++) { var t = u[n++], a = t.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), h = {}; h.serial = c; var M = a[0]; - h.atom = h.elem = M[0].toUpperCase() + M.substring(1, 2).toLowerCase(), h.x = parseFloat(a[1]), h.y = parseFloat(a[2]), h.z = parseFloat(a[3]), h.hetflag = !0, h.bonds = [], h.bondOrder = [], h.properties = {}, p[p.length - 1][c] = h, a.length >= 7 && (h.dx = parseFloat(a[4]), h.dy = parseFloat(a[5]), h.dz = parseFloat(a[6])); + h.atom = h.elem = M[0].toUpperCase() + M.substring(1, 2).toLowerCase(), h.x = parseFloat(a[1]), h.y = parseFloat(a[2]), h.z = parseFloat(a[3]), h.hetflag = !0, h.bonds = [], h.bondOrder = [], h.properties = {}, g[g.length - 1][c] = h, a.length >= 7 && (h.dx = parseFloat(a[4]), h.dy = parseFloat(a[5]), h.dz = parseFloat(a[6])); } if (o.multimodel) - p.push([]), u.splice(0, n); + g.push([]), u.splice(0, n); else break; } if (E) - for (let S = 0; S < p.length; S++) - (0, g.assignBonds)(p[S], o); + for (let S = 0; S < g.length; S++) + (0, p.assignBonds)(g[S], o); if (o.onemol) { - var w = p; - p = [], p.push(w[0]); + var w = g; + g = [], g.push(w[0]); for (let S = 1; S < w.length; S++) { - let T = p[0].length; + let T = g[0].length; for (let R = 0; R < w[S].length; R++) { - let z = w[S][R]; - for (let P = 0; P < z.bonds.length; P++) - z.bonds[P] = z.bonds[P] + T; - z.index = p[0].length, z.serial = p[0].length, p[0].push(z); + let $ = w[S][R]; + for (let P = 0; P < $.bonds.length; P++) + $.bonds[P] = $.bonds[P] + T; + $.index = g[0].length, $.serial = g[0].length, g[0].push($); } } } - return p; + return g; } } ), @@ -18288,7 +18288,7 @@ ATOM`, h); var l = e( /*! ./VASP */ "./src/parsers/VASP.ts" - ), g = e( + ), p = e( /*! ./CUBE */ "./src/parsers/CUBE.ts" ), _ = e( @@ -18300,7 +18300,7 @@ ATOM`, h); ), o = e( /*! ./CDJSON */ "./src/parsers/CDJSON.ts" - ), p = e( + ), g = e( /*! ./CIF */ "./src/parsers/CIF.ts" ), E = e( @@ -18312,10 +18312,10 @@ ATOM`, h); ), A = e( /*! ./PQR */ "./src/parsers/PQR.ts" - ), C = e( + ), L = e( /*! ./MMTF */ "./src/parsers/MMTF.ts" - ), L = e( + ), C = e( /*! ./PRMTOP */ "./src/parsers/PRMTOP.ts" ), D = e( @@ -18331,8 +18331,8 @@ ATOM`, h); const b = { vasp: l.VASP, VASP: l.VASP, - cube: g.CUBE, - CUBE: g.CUBE, + cube: p.CUBE, + CUBE: p.CUBE, xyz: _.XYZ, XYZ: _.XYZ, sdf: x.SDF, @@ -18340,9 +18340,9 @@ ATOM`, h); json: o.CDJSON, cdjson: o.CDJSON, CDJSON: o.CDJSON, - mcif: p.CIF, - cif: p.CIF, - CIF: p.CIF, + mcif: g.CIF, + cif: g.CIF, + CIF: g.CIF, mol2: E.MOL2, MOL2: E.MOL2, pdb: u.PDB, @@ -18351,10 +18351,10 @@ ATOM`, h); PDBQT: u.PDB, pqr: A.PQR, PQR: A.PQR, - mmtf: C.MMTFparser, - MMTF: C.MMTFparser, - prmtop: L.PRMTOP, - PRMTOP: L.PRMTOP, + mmtf: L.MMTFparser, + MMTF: L.MMTFparser, + prmtop: C.PRMTOP, + PRMTOP: C.PRMTOP, gro: D.GRO, GRO: D.GRO, lammpstrj: r.LAMMPSTRJ, @@ -18517,9 +18517,9 @@ ATOM`, h); /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - const g = /* @__PURE__ */ new Set(["Na", "K", "Ca", "Mg", "Mn", "Sr"]); - function _(x, o, p) { - if (p && p.unboundCations && (g.has(x.elem) || g.has(o.elem))) + const p = /* @__PURE__ */ new Set(["Na", "K", "Ca", "Mg", "Mn", "Sr"]); + function _(x, o, g) { + if (g && g.unboundCations && (p.has(x.elem) || p.has(o.elem))) return !1; let E = (0, l.bondLength)(x.elem) + (0, l.bondLength)(o.elem); E += 0.25, E *= E; @@ -18529,11 +18529,11 @@ ATOM`, h); let A = x.y - o.y; if (A *= A, A > E) return !1; - let C = x.z - o.z; - if (C *= C, C > E) + let L = x.z - o.z; + if (L *= L, L > E) return !1; - const L = u + A + C; - return !(isNaN(L) || L < 0.5 || L > E || x.altLoc !== o.altLoc && x.altLoc !== " " && o.altLoc !== " "); + const C = u + A + L; + return !(isNaN(C) || C < 0.5 || C > E || x.altLoc !== o.altLoc && x.altLoc !== " " && o.altLoc !== " "); } } ), @@ -18552,32 +18552,32 @@ ATOM`, h); ) /* harmony export */ }); - function l(g, _) { - const x = _ || 3.2, o = x * x, p = []; - for (let E = 0, u = g.length; E < u; E++) { - g[E].index = E; - const A = g[E]; - !A.hetflag && (A.atom === "N" || A.atom === "O") && (p.push(A), A.hbondOther = null, A.hbondDistanceSq = Number.POSITIVE_INFINITY); + function l(p, _) { + const x = _ || 3.2, o = x * x, g = []; + for (let E = 0, u = p.length; E < u; E++) { + p[E].index = E; + const A = p[E]; + !A.hetflag && (A.atom === "N" || A.atom === "O") && (g.push(A), A.hbondOther = null, A.hbondDistanceSq = Number.POSITIVE_INFINITY); } - p.sort(function(E, u) { + g.sort(function(E, u) { return E.z - u.z; }); - for (let E = 0, u = p.length; E < u; E++) { - const A = p[E]; - for (let C = E + 1; C < u; C++) { - const L = p[C], D = L.z - A.z; + for (let E = 0, u = g.length; E < u; E++) { + const A = g[E]; + for (let L = E + 1; L < u; L++) { + const C = g[L], D = C.z - A.z; if (D > x) break; - if (L.atom == A.atom) + if (C.atom == A.atom) continue; - const r = Math.abs(L.y - A.y); + const r = Math.abs(C.y - A.y); if (r > x) continue; - const n = Math.abs(L.x - A.x); + const n = Math.abs(C.x - A.x); if (n > x) continue; const b = n * n + r * r + D * D; - b > o || L.chain == A.chain && Math.abs(L.resi - A.resi) < 4 || (b < A.hbondDistanceSq && (A.hbondOther = L, A.hbondDistanceSq = b), b < L.hbondDistanceSq && (L.hbondOther = A, L.hbondDistanceSq = b)); + b > o || C.chain == A.chain && Math.abs(C.resi - A.resi) < 4 || (b < A.hbondDistanceSq && (A.hbondOther = C, A.hbondDistanceSq = b), b < C.hbondDistanceSq && (C.hbondOther = A, C.hbondDistanceSq = b)); } } } @@ -18602,7 +18602,7 @@ ATOM`, h); /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" ); - const g = [ + const p = [ { x: 0, y: 0, z: 1 }, { x: 0, y: 1, z: -1 }, { x: 0, y: 1, z: 0 }, @@ -18617,8 +18617,8 @@ ATOM`, h); { x: 1, y: 1, z: 0 }, { x: 1, y: 1, z: 1 } ], _ = 4.95; - function x(o, p) { - for (let A = 0, C = o.length; A < C; A++) + function x(o, g) { + for (let A = 0, L = o.length; A < L; A++) o[A].index || (o[A].index = A); const E = { x: { @@ -18628,15 +18628,15 @@ ATOM`, h); } }; for (let A = 0; A < o.length; A++) { - const C = o[A], L = Math.floor(C.x / _), D = Math.floor(C.y / _), r = Math.floor(C.z / _); - E[L] || (E[L] = {}), E[L][D] || (E[L][D] = {}), E[L][D][r] || (E[L][D][r] = []), E[L][D][r].push(C); - } - function u(A, C) { - for (let L = 0; L < A.length; L++) { - const D = A[L]; - for (let r = 0; r < C.length; r++) { - const n = C[r]; - if ((0, l.areConnected)(D, n, p)) { + const L = o[A], C = Math.floor(L.x / _), D = Math.floor(L.y / _), r = Math.floor(L.z / _); + E[C] || (E[C] = {}), E[C][D] || (E[C][D] = {}), E[C][D][r] || (E[C][D][r] = []), E[C][D][r].push(L); + } + function u(A, L) { + for (let C = 0; C < A.length; C++) { + const D = A[C]; + for (let r = 0; r < L.length; r++) { + const n = L[r]; + if ((0, l.areConnected)(D, n, g)) { const b = D.bonds.indexOf(n.index), f = n.bonds.indexOf(D.index); b === -1 && f === -1 ? (D.bonds.push(n.index), D.bondOrder.push(1), n.bonds.push(D.index), n.bondOrder.push(1)) : b === -1 ? (D.bonds.push(n.index), D.bondOrder.push(n.bondOrder[f])) : f === -1 && (n.bonds.push(D.index), n.bondOrder.push(D.bondOrder[b])); } @@ -18644,23 +18644,23 @@ ATOM`, h); } } for (let A in E) { - const C = parseInt(A); - for (let L in E[C]) { - const D = parseInt(L); - for (let r in E[C][D]) { - const n = parseInt(r), b = E[C][D][n]; + const L = parseInt(A); + for (let C in E[L]) { + const D = parseInt(C); + for (let r in E[L][D]) { + const n = parseInt(r), b = E[L][D][n]; for (let f = 0; f < b.length; f++) { const c = b[f]; for (let t = f + 1; t < b.length; t++) { const a = b[t]; - (0, l.areConnected)(c, a, p) && c.bonds.indexOf(a.index) == -1 && (c.bonds.push(a.index), c.bondOrder.push(1), a.bonds.push(c.index), a.bondOrder.push(1)); + (0, l.areConnected)(c, a, g) && c.bonds.indexOf(a.index) == -1 && (c.bonds.push(a.index), c.bondOrder.push(1), a.bonds.push(c.index), a.bondOrder.push(1)); } } - for (let f = 0; f < g.length; f++) { - const c = g[f]; - if (!E[C + c.x] || !E[C + c.x][D + c.y] || !E[C + c.x][D + c.y][n + c.z]) + for (let f = 0; f < p.length; f++) { + const c = p[f]; + if (!E[L + c.x] || !E[L + c.x][D + c.y] || !E[L + c.x][D + c.y][n + c.z]) continue; - const t = E[C + c.x][D + c.y][n + c.z]; + const t = E[L + c.x][D + c.y][n + c.z]; u(b, t); } } @@ -18687,31 +18687,31 @@ ATOM`, h); var l = e( /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" - ), g = e( + ), p = e( /*! ./assignBonds */ "./src/parsers/utils/assignBonds.ts" ), _ = e( /*! ./standardResidues */ "./src/parsers/utils/standardResidues.ts" ); - function x(o, p) { + function x(o, g) { const E = [], u = []; for (let D = 0, r = o.length; D < r; D++) { const n = o[D]; n.index = D, n.hetflag || !_.standardResidues.has(n.resn) ? u.push(n) : E.push(n); } - (0, g.assignBonds)(u, p), E.sort(function(D, r) { + (0, p.assignBonds)(u, g), E.sort(function(D, r) { return D.chain !== r.chain ? D.chain < r.chain ? -1 : 1 : D.resi - r.resi; }); - let A = -1, C = -1, L; + let A = -1, L = -1, C; for (let D = 0, r = E.length; D < r; D++) { const n = E[D]; - n.resi !== A && (A = n.resi, L || C++, L = !1), n.reschain = C; + n.resi !== A && (A = n.resi, C || L++, C = !1), n.reschain = L; for (let b = D + 1; b < E.length; b++) { const f = E[b]; if (f.chain !== n.chain || f.resi - n.resi > 1) break; - (0, l.areConnected)(n, f, p) && (n.bonds.indexOf(f.index) === -1 && (n.bonds.push(f.index), n.bondOrder.push(1), f.bonds.push(n.index), f.bondOrder.push(1)), n.resi !== f.resi && (L = !0)); + (0, l.areConnected)(n, f, g) && (n.bonds.indexOf(f.index) === -1 && (n.bonds.push(f.index), n.bondOrder.push(1), f.bonds.push(n.index), f.bondOrder.push(1)), n.resi !== f.resi && (C = !0)); } } } @@ -18728,7 +18728,7 @@ ATOM`, h); /* harmony export */ atomNameToElem: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -18736,7 +18736,7 @@ ATOM`, h); /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - function g(_, x) { + function p(_, x) { let o = _.replace(/ /g, ""); return o.length > 0 && o[0] === "H" && o !== "Hg" && o !== "He" && o !== "Hf" && o !== "Hs" && o !== "Ho" && (o = "H"), o.length > 1 && (o = o[0].toUpperCase() + o.substring(1).toLowerCase(), l.bondTable[o] === void 0 ? o = o[0] : x && (o === "Ca" || o === "Cd") && (o = "C")), o; } @@ -18753,7 +18753,7 @@ ATOM`, h); /* harmony export */ bondLength: () => ( /* binding */ - g + p ), /* harmony export */ bondTable: () => ( @@ -18842,7 +18842,7 @@ ATOM`, h); Rn: 1.45 // None of the bottom row or any of the Lanthanides have bond lengths }; - function g(x) { + function p(x) { return l[x] || 1.6; } function _(x, o) { @@ -18861,7 +18861,7 @@ ATOM`, h); /* harmony export */ computeSecondaryStructure: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -18869,39 +18869,39 @@ ATOM`, h); /*! ./assignBackboneHBonds */ "./src/parsers/utils/assignBackboneHBonds.ts" ); - function g(_, x) { + function p(_, x) { (0, l.assignBackboneHBonds)(_, x); const o = {}; - let p, E, u, A, C, L; - for (p = 0, E = _.length; p < E; p++) - if (C = _[p], o[C.chain] === void 0 && (o[C.chain] = []), isFinite(C.hbondDistanceSq)) { - const D = C.hbondOther; - o[D.chain] === void 0 && (o[D.chain] = []), Math.abs(D.resi - C.resi) === 4 && (o[C.chain][C.resi] = "h"); + let g, E, u, A, L, C; + for (g = 0, E = _.length; g < E; g++) + if (L = _[g], o[L.chain] === void 0 && (o[L.chain] = []), isFinite(L.hbondDistanceSq)) { + const D = L.hbondOther; + o[D.chain] === void 0 && (o[D.chain] = []), Math.abs(D.resi - L.resi) === 4 && (o[L.chain][L.resi] = "h"); } for (u in o) for (A = 1; A < o[u].length - 1; A++) { const D = o[u][A - 1], r = o[u][A + 1]; - L = o[u][A], D == "h" && D == r && L != D && (o[u][A] = D); + C = o[u][A], D == "h" && D == r && C != D && (o[u][A] = D); } - for (p = 0, E = _.length; p < E; p++) - C = _[p], isFinite(C.hbondDistanceSq) && o[C.chain][C.resi] != "h" && C.ss !== "h" && (o[C.chain][C.resi] = "maybesheet"); + for (g = 0, E = _.length; g < E; g++) + L = _[g], isFinite(L.hbondDistanceSq) && o[L.chain][L.resi] != "h" && L.ss !== "h" && (o[L.chain][L.resi] = "maybesheet"); for (let D = 0, r = _.length; D < r; D++) - if (C = _[D], isFinite(C.hbondDistanceSq) && o[C.chain][C.resi] == "maybesheet") { - let n = C.hbondOther, b = o[n.chain][n.resi]; - (b == "maybesheet" || b == "s") && (o[C.chain][C.resi] = "s", o[n.chain][n.resi] = "s"); + if (L = _[D], isFinite(L.hbondDistanceSq) && o[L.chain][L.resi] == "maybesheet") { + let n = L.hbondOther, b = o[n.chain][n.resi]; + (b == "maybesheet" || b == "s") && (o[L.chain][L.resi] = "s", o[n.chain][n.resi] = "s"); } for (let D in o) { for (let r = 1; r < o[D].length - 1; r++) { const n = o[D][r - 1], b = o[D][r + 1]; - L = o[D][r], n == "s" && n == b && L != n && (o[D][r] = n); + C = o[D][r], n == "s" && n == b && C != n && (o[D][r] = n); } for (let r = 0; r < o[D].length; r++) { const n = o[D][r]; (n == "h" || n == "s") && o[D][r - 1] != n && o[D][r + 1] != n && delete o[D][r]; } } - for (p = 0, E = _.length; p < E; p++) - C = _[p], L = o[C.chain][C.resi], delete C.hbondOther, delete C.hbondDistanceSq, !(L === void 0 || L === "maybesheet") && (C.ss = L, o[C.chain][C.resi - 1] != L && (C.ssbegin = !0), o[C.chain][C.resi + 1] != L && (C.ssend = !0)); + for (g = 0, E = _.length; g < E; g++) + L = _[g], C = o[L.chain][L.resi], delete L.hbondOther, delete L.hbondDistanceSq, !(C === void 0 || C === "maybesheet") && (L.ss = C, o[L.chain][L.resi - 1] != C && (L.ssbegin = !0), o[L.chain][L.resi + 1] != C && (L.ssend = !0)); } } ), @@ -18923,7 +18923,7 @@ ATOM`, h); var l = e( /*! ../../WebGL */ "./src/WebGL/index.ts" - ), g = e( + ), p = e( /*! ./atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" ), _ = e( @@ -18935,7 +18935,7 @@ ATOM`, h); ), o = e( /*! ./isEmpty */ "./src/parsers/utils/isEmpty.ts" - ), p = e( + ), g = e( /*! ./processSymmetries */ "./src/parsers/utils/processSymmetries.ts" ), E = e( @@ -18945,114 +18945,114 @@ ATOM`, h); /*! ./validateBonds */ "./src/parsers/utils/validateBonds.ts" ); - function A(C, L, D) { - const r = [], n = L.assignBonds === void 0 ? !0 : L.assignBonds, b = !L.keepH, f = !!L.noSecondaryStructure, c = !L.noComputeSecondaryStructure, t = !L.doAssembly, a = L.altLoc ? L.altLoc : "A", h = { symmetries: [], cryst: void 0 }; + function A(L, C, D) { + const r = [], n = C.assignBonds === void 0 ? !0 : C.assignBonds, b = !C.keepH, f = !!C.noSecondaryStructure, c = !C.noComputeSecondaryStructure, t = !C.doAssembly, a = C.altLoc ? C.altLoc : "A", h = { symmetries: [], cryst: void 0 }; let M, w = []; const S = []; let T; const R = {}; - for (let z = 0; z < C.length; z++) { - T = C[z].replace(/^\s*/, ""); + for (let $ = 0; $ < L.length; $++) { + T = L[$].replace(/^\s*/, ""); const P = T.substring(0, 6); - let B, U, F; + let B, F, U; if (P.indexOf("END") === 0) { - if (w = C.slice(z + 1), P === "END") - for (const $ in D) - D.hasOwnProperty($) && delete D[$]; + if (w = L.slice($ + 1), P === "END") + for (const z in D) + D.hasOwnProperty(z) && delete D[z]; break; } else if (P === "ATOM " || P === "HETATM") { - let $, W, N, G, k, j, Q, ie, pe, he, ue, se; - if (ue = T.substring(16, 17), ue !== " " && ue !== a && a !== "*" || (he = parseInt(T.substring(6, 11)), M = T.substring(12, 16).replace(/ /g, ""), $ = T.substring(17, 20).replace(/ /g, ""), W = T.substring(21, 22), N = parseInt(T.substring(22, 26)), G = T.substring(26, 27), k = parseFloat(T.substring(30, 38)), j = parseFloat(T.substring(38, 46)), Q = parseFloat(T.substring(46, 54)), se = parseFloat(T.substring(60, 68)), pe = T.substring(76, 78).replace(/ /g, ""), pe === "" || _.bondTable[pe] === void 0 ? pe = (0, g.atomNameToElem)(T.substring(12, 14), T[0] == "A") : pe = pe[0].toUpperCase() + pe.substring(1).toLowerCase(), pe === "H" && b)) + let z, W, V, N, k, G, Q, ie, ge, le, oe, he; + if (oe = T.substring(16, 17), oe !== " " && oe !== a && a !== "*" || (le = parseInt(T.substring(6, 11)), M = T.substring(12, 16).replace(/ /g, ""), z = T.substring(17, 20).replace(/ /g, ""), W = T.substring(21, 22), V = parseInt(T.substring(22, 26)), N = T.substring(26, 27), k = parseFloat(T.substring(30, 38)), G = parseFloat(T.substring(38, 46)), Q = parseFloat(T.substring(46, 54)), he = parseFloat(T.substring(60, 68)), ge = T.substring(76, 78).replace(/ /g, ""), ge === "" || _.bondTable[ge] === void 0 ? ge = (0, p.atomNameToElem)(T.substring(12, 14), T[0] == "A") : ge = ge[0].toUpperCase() + ge.substring(1).toLowerCase(), ge === "H" && b)) continue; - P[0] == "H" ? ie = !0 : ie = !1, S[he] = r.length, r.push({ - resn: $, + P[0] == "H" ? ie = !0 : ie = !1, S[le] = r.length, r.push({ + resn: z, x: k, - y: j, + y: G, z: Q, - elem: pe, + elem: ge, hetflag: ie, - altLoc: ue, + altLoc: oe, chain: W, - resi: N, - icode: G, - rescode: N + (G !== " " ? "^" + G : ""), + resi: V, + icode: N, + rescode: V + (N !== " " ? "^" + N : ""), // resi // and // icode - serial: he, + serial: le, atom: M, bonds: [], ss: "c", bondOrder: [], properties: {}, - b: se, + b: he, pdbline: T }); } else if (P === "SHEET ") { - B = T.substring(21, 22), U = parseInt(T.substring(22, 26)), F = parseInt(T.substring(33, 37)), B in D || (D[B] = {}), D[B][U] = "s1"; - for (let $ = U + 1; $ < F; $++) - D[B][$] = "s"; - D[B][F] = "s2"; + B = T.substring(21, 22), F = parseInt(T.substring(22, 26)), U = parseInt(T.substring(33, 37)), B in D || (D[B] = {}), D[B][F] = "s1"; + for (let z = F + 1; z < U; z++) + D[B][z] = "s"; + D[B][U] = "s2"; } else if (P === "CONECT") { - const $ = parseInt(T.substring(6, 11)), W = S[$], N = r[W], G = [11, 16, 21, 26]; + const z = parseInt(T.substring(6, 11)), W = S[z], V = r[W], N = [11, 16, 21, 26]; for (let k = 0; k < 4; k++) { - const j = parseInt(T.substring(G[k], G[k] + 5)), Q = S[j]; + const G = parseInt(T.substring(N[k], N[k] + 5)), Q = S[G]; let ie = W + ":" + Q; - const pe = r[Q]; - if (N !== void 0 && pe !== void 0) + const ge = r[Q]; + if (V !== void 0 && ge !== void 0) if (!R[ie]) - R[ie] = 1, (N.bonds.length == 0 || N.bonds[N.bonds.length - 1] !== Q) && (N.bonds.push(Q), N.bondOrder.push(1)); + R[ie] = 1, (V.bonds.length == 0 || V.bonds[V.bonds.length - 1] !== Q) && (V.bonds.push(Q), V.bondOrder.push(1)); else { R[ie] += 1; - for (let he = 0; he < N.bonds.length; he++) - if (N.bonds[he] == Q) { - const ue = R[ie]; - ue >= 4 ? N.bondOrder[he] = 1 : N.bondOrder[he] = ue; + for (let le = 0; le < V.bonds.length; le++) + if (V.bonds[le] == Q) { + const oe = R[ie]; + oe >= 4 ? V.bondOrder[le] = 1 : V.bondOrder[le] = oe; } } } } else if (P === "HELIX ") { - B = T.substring(19, 20), U = parseInt(T.substring(21, 25)), F = parseInt(T.substring(33, 37)), B in D || (D[B] = {}), D[B][U] = "h1"; - for (let $ = U + 1; $ < F; $++) - D[B][$] = "h"; - D[B][F] = "h2"; + B = T.substring(19, 20), F = parseInt(T.substring(21, 25)), U = parseInt(T.substring(33, 37)), B in D || (D[B] = {}), D[B][F] = "h1"; + for (let z = F + 1; z < U; z++) + D[B][z] = "h"; + D[B][U] = "h2"; } else if (!t && P === "REMARK" && T.substring(13, 18) === "BIOMT") { - let $, W = new l.Matrix4(); - for ($ = 1; $ <= 3; $++) - if (T = C[z].replace(/^\s*/, ""), parseInt(T.substring(18, 19)) == $) - W.elements[$ - 1] = parseFloat(T.substring(23, 33)), W.elements[$ - 1 + 4] = parseFloat(T.substring(33, 43)), W.elements[$ - 1 + 8] = parseFloat(T.substring(43, 53)), W.elements[$ - 1 + 12] = parseFloat(T.substring(53)), z++; + let z, W = new l.Matrix4(); + for (z = 1; z <= 3; z++) + if (T = L[$].replace(/^\s*/, ""), parseInt(T.substring(18, 19)) == z) + W.elements[z - 1] = parseFloat(T.substring(23, 33)), W.elements[z - 1 + 4] = parseFloat(T.substring(33, 43)), W.elements[z - 1 + 8] = parseFloat(T.substring(43, 53)), W.elements[z - 1 + 12] = parseFloat(T.substring(53)), $++; else for (; T.substring(13, 18) === "BIOMT"; ) - z++, T = C[z].replace(/^\s*/, ""); - W.elements[3] = 0, W.elements[7] = 0, W.elements[11] = 0, W.elements[15] = 1, h.symmetries.push(W), z--; + $++, T = L[$].replace(/^\s*/, ""); + W.elements[3] = 0, W.elements[7] = 0, W.elements[11] = 0, W.elements[15] = 1, h.symmetries.push(W), $--; } else if (P === "CRYST1") { - let $, W, N, G, k, j; - $ = parseFloat(T.substring(7, 15)), W = parseFloat(T.substring(16, 24)), N = parseFloat(T.substring(25, 33)), G = parseFloat(T.substring(34, 40)), k = parseFloat(T.substring(41, 47)), j = parseFloat(T.substring(48, 54)), h.cryst = { - a: $, + let z, W, V, N, k, G; + z = parseFloat(T.substring(7, 15)), W = parseFloat(T.substring(16, 24)), V = parseFloat(T.substring(25, 33)), N = parseFloat(T.substring(34, 40)), k = parseFloat(T.substring(41, 47)), G = parseFloat(T.substring(48, 54)), h.cryst = { + a: z, b: W, - c: N, - alpha: G, + c: V, + alpha: N, beta: k, - gamma: j + gamma: G }; } else if (P === "ANISOU") { - const $ = parseInt(T.substring(6, 11)), W = S[$], N = r[W]; - if (N) { - const G = T.substring(30).trim().split(/\s+/), k = { - u11: parseInt(G[0]), - u22: parseInt(G[1]), - u33: parseInt(G[2]), - u12: parseInt(G[3]), - u13: parseInt(G[4]), - u23: parseInt(G[5]) + const z = parseInt(T.substring(6, 11)), W = S[z], V = r[W]; + if (V) { + const N = T.substring(30).trim().split(/\s+/), k = { + u11: parseInt(N[0]), + u22: parseInt(N[1]), + u33: parseInt(N[2]), + u12: parseInt(N[3]), + u13: parseInt(N[4]), + u23: parseInt(N[5]) }; - N.uMat = k; + V.uMat = k; } } } - if ((0, u.validateBonds)(r, S), n && (0, E.assignPDBBonds)(r, L), t || (0, p.processSymmetries)(h.symmetries, r, L, h.cryst), c && !f && (0, x.computeSecondaryStructure)(r, L.hbondCutoff), !(0, o.isEmpty)(D)) - for (let z = 0; z < r.length; z++) { - const P = r[z]; + if ((0, u.validateBonds)(r, S), n && (0, E.assignPDBBonds)(r, C), t || (0, g.processSymmetries)(h.symmetries, r, C, h.cryst), c && !f && (0, x.computeSecondaryStructure)(r, C.hbondCutoff), !(0, o.isEmpty)(D)) + for (let $ = 0; $ < r.length; $++) { + const P = r[$]; if (P !== void 0 && P.chain in D && P.resi in D[P.chain]) { const B = D[P.chain][P.resi]; P.ss = B[0], B.length > 1 && (B[1] == "1" ? P.ssbegin = !0 : B[1] == "2" && (P.ssend = !0)); @@ -19077,8 +19077,8 @@ ATOM`, h); ) /* harmony export */ }); - function l(g) { - for (const _ in g) + function l(p) { + for (const _ in p) return !1; return !0; } @@ -19095,7 +19095,7 @@ ATOM`, h); /* harmony export */ processSymmetries: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -19103,10 +19103,10 @@ ATOM`, h); /*! ../../WebGL */ "./src/WebGL/index.ts" ); - function g(_, x, o, p) { + function p(_, x, o, g) { const E = !o.duplicateAssemblyAtoms, u = x.length; - let A = u, C = -1, L = null, D = null; - (o.normalizeAssembly || o.wrapAtoms) && p && (L = (0, l.conversionMatrix3)(p.a, p.b, p.c, p.alpha, p.beta, p.gamma), D = new l.Matrix3(), D.getInverse3(L)); + let A = u, L = -1, C = null, D = null; + (o.normalizeAssembly || o.wrapAtoms) && g && (C = (0, l.conversionMatrix3)(g.a, g.b, g.c, g.alpha, g.beta, g.gamma), D = new l.Matrix3(), D.getInverse3(C)); let r = function(f) { let c = f.clone().applyMatrix3(D); const t = [c.x, c.y, c.z], a = [0, 0, 0]; @@ -19117,9 +19117,9 @@ ATOM`, h); t[M] -= 1, a[M] -= 1; } const h = new l.Vector3(a[0], a[1], a[2]); - return h.applyMatrix3(L), h; + return h.applyMatrix3(C), h; }; - if (o.normalizeAssembly && p) + if (o.normalizeAssembly && g) for (let f = 0; f < _.length; f++) { const c = new l.Vector3(0, 0, 0); for (let a = 0; a < u; a++) { @@ -19128,7 +19128,7 @@ ATOM`, h); } c.divideScalar(u); const t = r(c); - _[f].isNearlyIdentity() && t.lengthSq() > 1e-3 && (C = f), _[f].translate(t); + _[f].isNearlyIdentity() && t.lengthSq() > 1e-3 && (L = f), _[f].translate(t); } if (E) { if (_.length > 1) @@ -19145,13 +19145,13 @@ ATOM`, h); for (let f = 0; f < u; f++) x[f].sym = -1; for (let f = 0; f < _.length; f++) - if (!_[f].isNearlyIdentity() && C != f) { + if (!_[f].isNearlyIdentity() && L != f) { let c = new l.Vector3(); for (let t = 0; t < u; t++) { const a = []; for (let M = 0; M < x[t].bonds.length; M++) a.push(x[t].bonds[M] + A); - if (c.set(x[t].x, x[t].y, x[t].z), c.applyMatrix4(_[f]), o.wrapAtoms && p) { + if (c.set(x[t].x, x[t].y, x[t].z), c.applyMatrix4(_[f]), o.wrapAtoms && g) { let M = r(c); c.add(M); } @@ -19164,7 +19164,7 @@ ATOM`, h); } else for (let c = 0; c < u; c++) x[c].sym = f; - if (o.wrapAtoms && p) { + if (o.wrapAtoms && g) { let f = new l.Vector3(); for (let c = 0; c < u; c++) { f.set(x[c].x, x[c].y, x[c].z); @@ -19172,10 +19172,10 @@ ATOM`, h); f.add(t), x[c].x = f.x, x[c].y = f.y, x[c].z = f.z; } } - if (C >= 0) { + if (L >= 0) { const f = new l.Vector3(); for (let c = 0; c < u; c++) - f.set(x[c].x, x[c].y, x[c].z), f.applyMatrix4(_[C]), x[c].x = f.x, x[c].y = f.y, x[c].z = f.z; + f.set(x[c].x, x[c].y, x[c].z), f.applyMatrix4(_[L]), x[c].x = f.x, x[c].y = f.y, x[c].z = f.z; } _.length = 0; } @@ -19281,12 +19281,12 @@ ATOM`, h); ) /* harmony export */ }); - function l(g, _) { - for (let x = 0, o = g.length; x < o; x++) { - const p = g[x]; - for (let E = 0; E < p.bonds.length; E++) { - const u = p.bonds[E], A = g[u], C = _[p.serial]; - A && C && A.bonds.indexOf(C) < 0 && (A.bonds.push(C), A.bondOrder.push(p.bondOrder[E])); + function l(p, _) { + for (let x = 0, o = p.length; x < o; x++) { + const g = p[x]; + for (let E = 0; E < g.bonds.length; E++) { + const u = g.bonds[E], A = p[u], L = _[g.serial]; + A && L && A.bonds.indexOf(L) < 0 && (A.bonds.push(L), A.bondOrder.push(g.bondOrder[E])); } } } @@ -19303,7 +19303,7 @@ ATOM`, h); /* harmony export */ applyPartialCharges: () => ( /* binding */ - g + p ), /* harmony export */ partialCharges: () => ( @@ -19481,7 +19481,7 @@ ATOM`, h); "VAL:C": 0.6, "VAL:O": -0.55 }; - function g(_, x) { + function p(_, x) { if ((!x || typeof _.partialCharge > "u") && _.resn && _.atom) { var o = _.resn + ":" + _.atom; _.properties.partialCharge = l[o]; @@ -19642,24 +19642,24 @@ ATOM`, h); y && (y.volformat && !(y.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (y.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(y.voldata, y.volformat)), y.volscheme && (y.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(y.volscheme))); } function getExtent(y, s) { - var e, l, g, _, x, o, p, E, u, A, C = !s; - if (e = l = g = 9999, _ = x = o = -9999, p = E = u = A = 0, y.length === 0) + var e, l, p, _, x, o, g, E, u, A, L = !s; + if (e = l = p = 9999, _ = x = o = -9999, g = E = u = A = 0, y.length === 0) return [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; - for (var L = 0; L < y.length; L++) { - var D = y[L]; - if (!(typeof D > "u" || !isFinite(D.x) || !isFinite(D.y) || !isFinite(D.z)) && (A++, p += D.x, E += D.y, u += D.z, e = e < D.x ? e : D.x, l = l < D.y ? l : D.y, g = g < D.z ? g : D.z, _ = _ > D.x ? _ : D.x, x = x > D.y ? x : D.y, o = o > D.z ? o : D.z, D.symmetries && C)) + for (var C = 0; C < y.length; C++) { + var D = y[C]; + if (!(typeof D > "u" || !isFinite(D.x) || !isFinite(D.y) || !isFinite(D.z)) && (A++, g += D.x, E += D.y, u += D.z, e = e < D.x ? e : D.x, l = l < D.y ? l : D.y, p = p < D.z ? p : D.z, _ = _ > D.x ? _ : D.x, x = x > D.y ? x : D.y, o = o > D.z ? o : D.z, D.symmetries && L)) for (var r = 0; r < D.symmetries.length; r++) - A++, p += D.symmetries[r].x, E += D.symmetries[r].y, u += D.symmetries[r].z, e = e < D.symmetries[r].x ? e : D.symmetries[r].x, l = l < D.symmetries[r].y ? l : D.symmetries[r].y, g = g < D.symmetries[r].z ? g : D.symmetries[r].z, _ = _ > D.symmetries[r].x ? _ : D.symmetries[r].x, x = x > D.symmetries[r].y ? x : D.symmetries[r].y, o = o > D.symmetries[r].z ? o : D.symmetries[r].z; + A++, g += D.symmetries[r].x, E += D.symmetries[r].y, u += D.symmetries[r].z, e = e < D.symmetries[r].x ? e : D.symmetries[r].x, l = l < D.symmetries[r].y ? l : D.symmetries[r].y, p = p < D.symmetries[r].z ? p : D.symmetries[r].z, _ = _ > D.symmetries[r].x ? _ : D.symmetries[r].x, x = x > D.symmetries[r].y ? x : D.symmetries[r].y, o = o > D.symmetries[r].z ? o : D.symmetries[r].z; } return [ - [e, l, g], + [e, l, p], [_, x, o], - [p / A, E / A, u / A] + [g / A, E / A, u / A] ]; } function getPropertyRange(y, s) { - for (var e = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, g = 0, _ = y.length; g < _; g++) { - var x = y[g], o = getAtomProperty(x, s); + for (var e = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, p = 0, _ = y.length; p < _; p++) { + var x = y[p], o = getAtomProperty(x, s); o != null && (o < e && (e = o), o > l && (l = o)); } return !isFinite(e) && !isFinite(l) ? e = l = 0 : isFinite(e) ? isFinite(l) || (l = e) : e = l, [e, l]; @@ -19679,8 +19679,8 @@ ATOM`, h); } } function base64ToArray(y) { - for (var s = window.atob(y), e = s.length, l = new Uint8Array(e), g = 0; g < e; g++) - l[g] = s.charCodeAt(g); + for (var s = window.atob(y), e = s.length, l = new Uint8Array(e), p = 0; p < e; p++) + l[p] = s.charCodeAt(p); return l; } function getAtomProperty(y, s) { @@ -19701,21 +19701,21 @@ ATOM`, h); } catch { } y = y.replace(/%7E/g, "~"); - var s = function(C) { - return isNumeric(C) ? Math.floor(parseFloat(C)) == parseInt(C) || C.indexOf(".") >= 0 ? parseFloat(C) : parseInt(C) : C === "true" ? !0 : C === "false" ? !1 : C; + var s = function(L) { + return isNumeric(L) ? Math.floor(parseFloat(L)) == parseInt(L) || L.indexOf(".") >= 0 ? parseFloat(L) : parseInt(L) : L === "true" ? !0 : L === "false" ? !1 : L; }, e = {}; if (y === "all") return e; - for (var l = y.split(";"), g = 0; g < l.length; g++) { - var _ = l[g].split(":"), x = _[0], o = {}, p = _[1]; - if (p) - if (p = p.replace(/~/g, "="), p.indexOf("=") !== -1) - for (var E = p.split(","), u = 0; u < E.length; u++) { + for (var l = y.split(";"), p = 0; p < l.length; p++) { + var _ = l[p].split(":"), x = _[0], o = {}, g = _[1]; + if (g) + if (g = g.replace(/~/g, "="), g.indexOf("=") !== -1) + for (var E = g.split(","), u = 0; u < E.length; u++) { var A = E[u].split("=", 2); o[A[0]] = s(A[1]); } else - p.indexOf(",") !== -1 ? o = p.split(",") : o = s(p); + g.indexOf(",") !== -1 ? o = g.split(",") : o = s(g); e[x] = o; } return e; @@ -19730,56 +19730,56 @@ ATOM`, h); return s ? e.then(s) : e; } function getbin(y, s, e, l) { - var g; - return e == "POST" ? g = fetch(y, { method: "POST", body: l }).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()) : g = fetch(y).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()), s ? g.then(s) : g; + var p; + return e == "POST" ? p = fetch(y, { method: "POST", body: l }).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()) : p = fetch(y).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()), s ? p.then(s) : p; } function download(y, s, e, l) { - var g = "", _ = "", x = "", o = "", p = null, E = s.addModel(); + var p = "", _ = "", x = "", o = "", g = null, E = s.addModel(); if (y.indexOf(":") < 0 && (y.length == 4 ? y = "pdb:" + y : isNaN(y) ? y = "url:" + y : y = "cid:" + y), y.substring(0, 5) === "mmtf:") - _ = e && e.pdbUri ? e.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", y = y.substring(5).toUpperCase(), o = _ + y, e && typeof e.noComputeSecondaryStructure > "u" && (e.noComputeSecondaryStructure = !0), p = new Promise(function(A) { - getbin(o).then(function(C) { - E.addMolData(C, "mmtf", e), s.zoomTo(), s.render(), A(E); + _ = e && e.pdbUri ? e.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", y = y.substring(5).toUpperCase(), o = _ + y, e && typeof e.noComputeSecondaryStructure > "u" && (e.noComputeSecondaryStructure = !0), g = new Promise(function(A) { + getbin(o).then(function(L) { + E.addMolData(L, "mmtf", e), s.zoomTo(), s.render(), A(E); }, function() { console.log("fetch of " + o + " failed."); }); }); else { if (y.substring(0, 4) === "pdb:") { - if (g = "mmtf", e && e.format && (g = e.format), e && typeof e.noComputeSecondaryStructure > "u" && (e.noComputeSecondaryStructure = !0), y = y.substring(4).toUpperCase(), !y.match(/^[1-9][A-Za-z0-9]{3}$/)) { + if (p = "mmtf", e && e.format && (p = e.format), e && typeof e.noComputeSecondaryStructure > "u" && (e.noComputeSecondaryStructure = !0), y = y.substring(4).toUpperCase(), !y.match(/^[1-9][A-Za-z0-9]{3}$/)) { alert("Wrong PDB ID"); return; } - g == "mmtf" ? (x = e && e.mmtfUri ? e.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", o = x + y.toUpperCase()) : (_ = e && e.pdbUri ? e.pdbUri : "https://files.rcsb.org/view/", o = _ + y + "." + g); + p == "mmtf" ? (x = e && e.mmtfUri ? e.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", o = x + y.toUpperCase()) : (_ = e && e.pdbUri ? e.pdbUri : "https://files.rcsb.org/view/", o = _ + y + "." + p); } else if (y.substring(0, 4) == "cid:") { - if (g = "sdf", y = y.substring(4), !y.match(/^[0-9]+$/)) { + if (p = "sdf", y = y.substring(4), !y.match(/^[0-9]+$/)) { alert("Wrong Compound ID"); return; } o = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + y + "/SDF?record_type=3d"; } else - y.substring(0, 4) == "url:" && (o = y.substring(4), g = o); + y.substring(0, 4) == "url:" && (o = y.substring(4), p = o); var u = function(A) { - E.addMolData(A, g, e), s.zoomTo(), s.render(); + E.addMolData(A, p, e), s.zoomTo(), s.render(); }; - p = new Promise(function(A) { - g == "mmtf" ? getbin(o).then(function(C) { - u(C), A(E); + g = new Promise(function(A) { + p == "mmtf" ? getbin(o).then(function(L) { + u(L), A(E); }).catch(function() { - _ = e && e.pdbUri ? e.pdbUri : "https://files.rcsb.org/view/", o = _ + y + ".pdb", g = "pdb", console.log("falling back to pdb format"), get(o).then(function(C) { - u(C), A(E); - }).catch(function(C) { - u(""), A(E), console.log("fetch of " + o + " failed: " + C.statusText); + _ = e && e.pdbUri ? e.pdbUri : "https://files.rcsb.org/view/", o = _ + y + ".pdb", p = "pdb", console.log("falling back to pdb format"), get(o).then(function(L) { + u(L), A(E); + }).catch(function(L) { + u(""), A(E), console.log("fetch of " + o + " failed: " + L.statusText); }); - }) : get(o).then(function(C) { - u(C), A(E); - }).catch(function(C) { - u(""), A(E), console.log("fetch of " + o + " failed: " + C.statusText); + }) : get(o).then(function(L) { + u(L), A(E); + }).catch(function(L) { + u(""), A(E), console.log("fetch of " + o + " failed: " + L.statusText); }); }); } - return l ? (p.then(function(A) { + return l ? (g.then(function(A) { l(A); - }), E) : p; + }), E) : g; } function getColorFromStyle(y, s) { let e = s.colorscheme; @@ -19801,10 +19801,10 @@ ATOM`, h); l = e.map[y[e.prop]]; else if (typeof e.prop < "u" && typeof e.gradient < "u") { x = e.prop; - var g = e.gradient; - typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[g] < "u" && (g = new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[g](e.min, e.max, e.mid ? e.mid : e.colors)); - let p = g.range() || [-1, 1]; - o = getAtomProperty(y, x), o != null && (l = g.valueToHex(o, p)); + var p = e.gradient; + typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[p] < "u" && (p = new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[p](e.min, e.max, e.mid ? e.mid : e.colors)); + let g = p.range() || [-1, 1]; + o = getAtomProperty(y, x), o != null && (l = p.valueToHex(o, g)); } else typeof e.prop < "u" && typeof e.map < "u" ? (x = e.prop, o = getAtomProperty(y, x), typeof e.map[o] < "u" && (l = e.map[o])) : typeof s.colorscheme[y.elem] < "u" ? l = s.colorscheme[y.elem] : console.log("Could not interpret colorscheme " + e); } else @@ -19825,32 +19825,32 @@ ATOM`, h); /***/ (y, s, e) => { (function() { - var l = {}, g; - y.exports = l, g = e( + var l = {}, p; + y.exports = l, p = e( /*! pako */ "./node_modules/upng-js/node_modules/pako/index.js" ), function(_, x) { _.toRGBA8 = function(o) { - var p = o.width, E = o.height; + var g = o.width, E = o.height; if (o.tabs.acTL == null) - return [_.toRGBA8.decodeImage(o.data, p, E, o).buffer]; + return [_.toRGBA8.decodeImage(o.data, g, E, o).buffer]; var u = []; o.frames[0].data == null && (o.frames[0].data = o.data); - for (var A, C = new Uint8Array(p * E * 4), L = 0; L < o.frames.length; L++) { - var D = o.frames[L], r = D.rect.x, n = D.rect.y, b = D.rect.width, f = D.rect.height, c = _.toRGBA8.decodeImage(D.data, b, f, o); - if (L == 0 ? A = c : D.blend == 0 ? _._copyTile(c, b, f, A, p, E, r, n, 0) : D.blend == 1 && _._copyTile(c, b, f, A, p, E, r, n, 1), u.push(A.buffer), A = A.slice(0), D.dispose != 0) { + for (var A, L = new Uint8Array(g * E * 4), C = 0; C < o.frames.length; C++) { + var D = o.frames[C], r = D.rect.x, n = D.rect.y, b = D.rect.width, f = D.rect.height, c = _.toRGBA8.decodeImage(D.data, b, f, o); + if (C == 0 ? A = c : D.blend == 0 ? _._copyTile(c, b, f, A, g, E, r, n, 0) : D.blend == 1 && _._copyTile(c, b, f, A, g, E, r, n, 1), u.push(A.buffer), A = A.slice(0), D.dispose != 0) { if (D.dispose == 1) - _._copyTile(C, b, f, A, p, E, r, n, 0); + _._copyTile(L, b, f, A, g, E, r, n, 0); else if (D.dispose == 2) { - for (var t = L - 1; o.frames[t].dispose == 2; ) + for (var t = C - 1; o.frames[t].dispose == 2; ) t--; A = new Uint8Array(u[t]).slice(0); } } } return u; - }, _.toRGBA8.decodeImage = function(o, p, E, u) { - var A = p * E, C = _.decode._getBPP(u), L = Math.ceil(p * C / 8), D = new Uint8Array(A * 4), r = new Uint32Array(D.buffer), n = u.ctype, b = u.depth, f = _._bin.readUshort; + }, _.toRGBA8.decodeImage = function(o, g, E, u) { + var A = g * E, L = _.decode._getBPP(u), C = Math.ceil(g * L / 8), D = new Uint8Array(A * 4), r = new Uint32Array(D.buffer), n = u.ctype, b = u.depth, f = _._bin.readUshort; if (n == 6) { var c = A << 2; if (b == 8) @@ -19872,340 +19872,340 @@ ATOM`, h); D[S] = o[T], D[S + 1] = o[T + 2], D[S + 2] = o[T + 4], D[S + 3] = 255, h != -1 && f(o, T) == h && f(o, T + 2) == M && f(o, T + 4) == w && (D[S + 3] = 0); } } else if (n == 3) { - var R = u.tabs.PLTE, z = u.tabs.tRNS, P = z ? z.length : 0; + var R = u.tabs.PLTE, $ = u.tabs.tRNS, P = $ ? $.length : 0; if (b == 1) for (var B = 0; B < E; B++) - for (var U = B * L, F = B * p, t = 0; t < p; t++) { - var S = F + t << 2, $ = o[U + (t >> 3)] >> 7 - ((t & 7) << 0) & 1, W = 3 * $; - D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = $ < P ? z[$] : 255; + for (var F = B * C, U = B * g, t = 0; t < g; t++) { + var S = U + t << 2, z = o[F + (t >> 3)] >> 7 - ((t & 7) << 0) & 1, W = 3 * z; + D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = z < P ? $[z] : 255; } if (b == 2) for (var B = 0; B < E; B++) - for (var U = B * L, F = B * p, t = 0; t < p; t++) { - var S = F + t << 2, $ = o[U + (t >> 2)] >> 6 - ((t & 3) << 1) & 3, W = 3 * $; - D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = $ < P ? z[$] : 255; + for (var F = B * C, U = B * g, t = 0; t < g; t++) { + var S = U + t << 2, z = o[F + (t >> 2)] >> 6 - ((t & 3) << 1) & 3, W = 3 * z; + D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = z < P ? $[z] : 255; } if (b == 4) for (var B = 0; B < E; B++) - for (var U = B * L, F = B * p, t = 0; t < p; t++) { - var S = F + t << 2, $ = o[U + (t >> 1)] >> 4 - ((t & 1) << 2) & 15, W = 3 * $; - D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = $ < P ? z[$] : 255; + for (var F = B * C, U = B * g, t = 0; t < g; t++) { + var S = U + t << 2, z = o[F + (t >> 1)] >> 4 - ((t & 1) << 2) & 15, W = 3 * z; + D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = z < P ? $[z] : 255; } if (b == 8) for (var t = 0; t < A; t++) { - var S = t << 2, $ = o[t], W = 3 * $; - D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = $ < P ? z[$] : 255; + var S = t << 2, z = o[t], W = 3 * z; + D[S] = R[W], D[S + 1] = R[W + 1], D[S + 2] = R[W + 2], D[S + 3] = z < P ? $[z] : 255; } } else if (n == 4) { if (b == 8) for (var t = 0; t < A; t++) { - var S = t << 2, N = t << 1, G = o[N]; - D[S] = G, D[S + 1] = G, D[S + 2] = G, D[S + 3] = o[N + 1]; + var S = t << 2, V = t << 1, N = o[V]; + D[S] = N, D[S + 1] = N, D[S + 2] = N, D[S + 3] = o[V + 1]; } if (b == 16) for (var t = 0; t < A; t++) { - var S = t << 2, N = t << 2, G = o[N]; - D[S] = G, D[S + 1] = G, D[S + 2] = G, D[S + 3] = o[N + 2]; + var S = t << 2, V = t << 2, N = o[V]; + D[S] = N, D[S + 1] = N, D[S + 2] = N, D[S + 3] = o[V + 2]; } } else if (n == 0) { var h = u.tabs.tRNS ? u.tabs.tRNS : -1; if (b == 1) for (var t = 0; t < A; t++) { - var G = 255 * (o[t >> 3] >> 7 - (t & 7) & 1), k = G == h * 255 ? 0 : 255; - r[t] = k << 24 | G << 16 | G << 8 | G; + var N = 255 * (o[t >> 3] >> 7 - (t & 7) & 1), k = N == h * 255 ? 0 : 255; + r[t] = k << 24 | N << 16 | N << 8 | N; } if (b == 2) for (var t = 0; t < A; t++) { - var G = 85 * (o[t >> 2] >> 6 - ((t & 3) << 1) & 3), k = G == h * 85 ? 0 : 255; - r[t] = k << 24 | G << 16 | G << 8 | G; + var N = 85 * (o[t >> 2] >> 6 - ((t & 3) << 1) & 3), k = N == h * 85 ? 0 : 255; + r[t] = k << 24 | N << 16 | N << 8 | N; } if (b == 4) for (var t = 0; t < A; t++) { - var G = 17 * (o[t >> 1] >> 4 - ((t & 1) << 2) & 15), k = G == h * 17 ? 0 : 255; - r[t] = k << 24 | G << 16 | G << 8 | G; + var N = 17 * (o[t >> 1] >> 4 - ((t & 1) << 2) & 15), k = N == h * 17 ? 0 : 255; + r[t] = k << 24 | N << 16 | N << 8 | N; } if (b == 8) for (var t = 0; t < A; t++) { - var G = o[t], k = G == h ? 0 : 255; - r[t] = k << 24 | G << 16 | G << 8 | G; + var N = o[t], k = N == h ? 0 : 255; + r[t] = k << 24 | N << 16 | N << 8 | N; } if (b == 16) for (var t = 0; t < A; t++) { - var G = o[t << 1], k = f(o, t << 1) == h ? 0 : 255; - r[t] = k << 24 | G << 16 | G << 8 | G; + var N = o[t << 1], k = f(o, t << 1) == h ? 0 : 255; + r[t] = k << 24 | N << 16 | N << 8 | N; } } return D; }, _.decode = function(o) { - for (var p = new Uint8Array(o), E = 8, u = _._bin, A = u.readUshort, C = u.readUint, L = { tabs: {}, frames: [] }, D = new Uint8Array(p.length), r = 0, n, b = 0, f = [137, 80, 78, 71, 13, 10, 26, 10], c = 0; c < 8; c++) - if (p[c] != f[c]) + for (var g = new Uint8Array(o), E = 8, u = _._bin, A = u.readUshort, L = u.readUint, C = { tabs: {}, frames: [] }, D = new Uint8Array(g.length), r = 0, n, b = 0, f = [137, 80, 78, 71, 13, 10, 26, 10], c = 0; c < 8; c++) + if (g[c] != f[c]) throw "The input is not a PNG file!"; - for (; E < p.length; ) { - var t = u.readUint(p, E); + for (; E < g.length; ) { + var t = u.readUint(g, E); E += 4; - var a = u.readASCII(p, E, 4); + var a = u.readASCII(g, E, 4); if (E += 4, a == "IHDR") - _.decode._IHDR(p, E, L); + _.decode._IHDR(g, E, C); else if (a == "IDAT") { for (var c = 0; c < t; c++) - D[r + c] = p[E + c]; + D[r + c] = g[E + c]; r += t; } else if (a == "acTL") - L.tabs[a] = { num_frames: C(p, E), num_plays: C(p, E + 4) }, n = new Uint8Array(p.length); + C.tabs[a] = { num_frames: L(g, E), num_plays: L(g, E + 4) }, n = new Uint8Array(g.length); else if (a == "fcTL") { if (b != 0) { - var h = L.frames[L.frames.length - 1]; - h.data = _.decode._decompress(L, n.slice(0, b), h.rect.width, h.rect.height), b = 0; + var h = C.frames[C.frames.length - 1]; + h.data = _.decode._decompress(C, n.slice(0, b), h.rect.width, h.rect.height), b = 0; } - var M = { x: C(p, E + 12), y: C(p, E + 16), width: C(p, E + 4), height: C(p, E + 8) }, w = A(p, E + 22); - w = A(p, E + 20) / (w == 0 ? 100 : w); - var S = { rect: M, delay: Math.round(w * 1e3), dispose: p[E + 24], blend: p[E + 25] }; - L.frames.push(S); + var M = { x: L(g, E + 12), y: L(g, E + 16), width: L(g, E + 4), height: L(g, E + 8) }, w = A(g, E + 22); + w = A(g, E + 20) / (w == 0 ? 100 : w); + var S = { rect: M, delay: Math.round(w * 1e3), dispose: g[E + 24], blend: g[E + 25] }; + C.frames.push(S); } else if (a == "fdAT") { for (var c = 0; c < t - 4; c++) - n[b + c] = p[E + c + 4]; + n[b + c] = g[E + c + 4]; b += t - 4; } else if (a == "pHYs") - L.tabs[a] = [u.readUint(p, E), u.readUint(p, E + 4), p[E + 8]]; + C.tabs[a] = [u.readUint(g, E), u.readUint(g, E + 4), g[E + 8]]; else if (a == "cHRM") { - L.tabs[a] = []; + C.tabs[a] = []; for (var c = 0; c < 8; c++) - L.tabs[a].push(u.readUint(p, E + c * 4)); + C.tabs[a].push(u.readUint(g, E + c * 4)); } else if (a == "tEXt") { - L.tabs[a] == null && (L.tabs[a] = {}); - var T = u.nextZero(p, E), R = u.readASCII(p, E, T - E), z = u.readASCII(p, T + 1, E + t - T - 1); - L.tabs[a][R] = z; + C.tabs[a] == null && (C.tabs[a] = {}); + var T = u.nextZero(g, E), R = u.readASCII(g, E, T - E), $ = u.readASCII(g, T + 1, E + t - T - 1); + C.tabs[a][R] = $; } else if (a == "iTXt") { - L.tabs[a] == null && (L.tabs[a] = {}); + C.tabs[a] == null && (C.tabs[a] = {}); var T = 0, P = E; - T = u.nextZero(p, P); - var R = u.readASCII(p, P, T - P); - P = T + 1, p[P], p[P + 1], P += 2, T = u.nextZero(p, P), u.readASCII(p, P, T - P), P = T + 1, T = u.nextZero(p, P), u.readUTF8(p, P, T - P), P = T + 1; - var z = u.readUTF8(p, P, t - (P - E)); - L.tabs[a][R] = z; + T = u.nextZero(g, P); + var R = u.readASCII(g, P, T - P); + P = T + 1, g[P], g[P + 1], P += 2, T = u.nextZero(g, P), u.readASCII(g, P, T - P), P = T + 1, T = u.nextZero(g, P), u.readUTF8(g, P, T - P), P = T + 1; + var $ = u.readUTF8(g, P, t - (P - E)); + C.tabs[a][R] = $; } else if (a == "PLTE") - L.tabs[a] = u.readBytes(p, E, t); + C.tabs[a] = u.readBytes(g, E, t); else if (a == "hIST") { - var B = L.tabs.PLTE.length / 3; - L.tabs[a] = []; + var B = C.tabs.PLTE.length / 3; + C.tabs[a] = []; for (var c = 0; c < B; c++) - L.tabs[a].push(A(p, E + c * 2)); + C.tabs[a].push(A(g, E + c * 2)); } else if (a == "tRNS") - L.ctype == 3 ? L.tabs[a] = u.readBytes(p, E, t) : L.ctype == 0 ? L.tabs[a] = A(p, E) : L.ctype == 2 && (L.tabs[a] = [A(p, E), A(p, E + 2), A(p, E + 4)]); + C.ctype == 3 ? C.tabs[a] = u.readBytes(g, E, t) : C.ctype == 0 ? C.tabs[a] = A(g, E) : C.ctype == 2 && (C.tabs[a] = [A(g, E), A(g, E + 2), A(g, E + 4)]); else if (a == "gAMA") - L.tabs[a] = u.readUint(p, E) / 1e5; + C.tabs[a] = u.readUint(g, E) / 1e5; else if (a == "sRGB") - L.tabs[a] = p[E]; + C.tabs[a] = g[E]; else if (a == "bKGD") - L.ctype == 0 || L.ctype == 4 ? L.tabs[a] = [A(p, E)] : L.ctype == 2 || L.ctype == 6 ? L.tabs[a] = [A(p, E), A(p, E + 2), A(p, E + 4)] : L.ctype == 3 && (L.tabs[a] = p[E]); + C.ctype == 0 || C.ctype == 4 ? C.tabs[a] = [A(g, E)] : C.ctype == 2 || C.ctype == 6 ? C.tabs[a] = [A(g, E), A(g, E + 2), A(g, E + 4)] : C.ctype == 3 && (C.tabs[a] = g[E]); else if (a == "IEND") { if (b != 0) { - var h = L.frames[L.frames.length - 1]; - h.data = _.decode._decompress(L, n.slice(0, b), h.rect.width, h.rect.height), b = 0; + var h = C.frames[C.frames.length - 1]; + h.data = _.decode._decompress(C, n.slice(0, b), h.rect.width, h.rect.height), b = 0; } - L.data = _.decode._decompress(L, D, L.width, L.height); + C.data = _.decode._decompress(C, D, C.width, C.height); break; } - E += t, u.readUint(p, E), E += 4; + E += t, u.readUint(g, E), E += 4; } - return delete L.compress, delete L.interlace, delete L.filter, L; - }, _.decode._decompress = function(o, p, E, u) { - return o.compress == 0 && (p = _.decode._inflate(p)), o.interlace == 0 ? p = _.decode._filterZero(p, o, 0, E, u) : o.interlace == 1 && (p = _.decode._readInterlace(p, o)), p; + return delete C.compress, delete C.interlace, delete C.filter, C; + }, _.decode._decompress = function(o, g, E, u) { + return o.compress == 0 && (g = _.decode._inflate(g)), o.interlace == 0 ? g = _.decode._filterZero(g, o, 0, E, u) : o.interlace == 1 && (g = _.decode._readInterlace(g, o)), g; }, _.decode._inflate = function(o) { return x.inflate(o); - }, _.decode._readInterlace = function(o, p) { - for (var E = p.width, u = p.height, A = _.decode._getBPP(p), C = A >> 3, L = Math.ceil(E * A / 8), D = new Uint8Array(u * L), r = 0, n = [0, 0, 4, 0, 2, 0, 1], b = [0, 4, 0, 2, 0, 1, 0], f = [8, 8, 8, 4, 4, 2, 2], c = [8, 8, 4, 4, 2, 2, 1], t = 0; t < 7; ) { + }, _.decode._readInterlace = function(o, g) { + for (var E = g.width, u = g.height, A = _.decode._getBPP(g), L = A >> 3, C = Math.ceil(E * A / 8), D = new Uint8Array(u * C), r = 0, n = [0, 0, 4, 0, 2, 0, 1], b = [0, 4, 0, 2, 0, 1, 0], f = [8, 8, 8, 4, 4, 2, 2], c = [8, 8, 4, 4, 2, 2, 1], t = 0; t < 7; ) { for (var a = f[t], h = c[t], M = 0, w = 0, S = n[t]; S < u; ) S += a, w++; for (var T = b[t]; T < E; ) T += h, M++; var R = Math.ceil(M * A / 8); - _.decode._filterZero(o, p, r, M, w); - for (var z = 0, P = n[t]; P < u; ) { - for (var B = b[t], U = r + z * R << 3; B < E; ) { + _.decode._filterZero(o, g, r, M, w); + for (var $ = 0, P = n[t]; P < u; ) { + for (var B = b[t], F = r + $ * R << 3; B < E; ) { if (A == 1) { - var F = o[U >> 3]; - F = F >> 7 - (U & 7) & 1, D[P * L + (B >> 3)] |= F << 7 - ((B & 3) << 0); + var U = o[F >> 3]; + U = U >> 7 - (F & 7) & 1, D[P * C + (B >> 3)] |= U << 7 - ((B & 3) << 0); } if (A == 2) { - var F = o[U >> 3]; - F = F >> 6 - (U & 7) & 3, D[P * L + (B >> 2)] |= F << 6 - ((B & 3) << 1); + var U = o[F >> 3]; + U = U >> 6 - (F & 7) & 3, D[P * C + (B >> 2)] |= U << 6 - ((B & 3) << 1); } if (A == 4) { - var F = o[U >> 3]; - F = F >> 4 - (U & 7) & 15, D[P * L + (B >> 1)] |= F << 4 - ((B & 1) << 2); + var U = o[F >> 3]; + U = U >> 4 - (F & 7) & 15, D[P * C + (B >> 1)] |= U << 4 - ((B & 1) << 2); } if (A >= 8) - for (var $ = P * L + B * C, W = 0; W < C; W++) - D[$ + W] = o[(U >> 3) + W]; - U += A, B += h; + for (var z = P * C + B * L, W = 0; W < L; W++) + D[z + W] = o[(F >> 3) + W]; + F += A, B += h; } - z++, P += a; + $++, P += a; } M * w != 0 && (r += w * (1 + R)), t = t + 1; } return D; }, _.decode._getBPP = function(o) { - var p = [1, null, 3, 1, 2, null, 4][o.ctype]; - return p * o.depth; - }, _.decode._filterZero = function(o, p, E, u, A) { - var C = _.decode._getBPP(p), L = Math.ceil(u * C / 8), D = _.decode._paeth; - C = Math.ceil(C / 8); + var g = [1, null, 3, 1, 2, null, 4][o.ctype]; + return g * o.depth; + }, _.decode._filterZero = function(o, g, E, u, A) { + var L = _.decode._getBPP(g), C = Math.ceil(u * L / 8), D = _.decode._paeth; + L = Math.ceil(L / 8); for (var r = 0; r < A; r++) { - var n = E + r * L, b = n + r + 1, f = o[b - 1]; + var n = E + r * C, b = n + r + 1, f = o[b - 1]; if (f == 0) - for (var c = 0; c < L; c++) + for (var c = 0; c < C; c++) o[n + c] = o[b + c]; else if (f == 1) { - for (var c = 0; c < C; c++) + for (var c = 0; c < L; c++) o[n + c] = o[b + c]; - for (var c = C; c < L; c++) - o[n + c] = o[b + c] + o[n + c - C] & 255; + for (var c = L; c < C; c++) + o[n + c] = o[b + c] + o[n + c - L] & 255; } else if (r == 0) { - for (var c = 0; c < C; c++) + for (var c = 0; c < L; c++) o[n + c] = o[b + c]; if (f == 2) - for (var c = C; c < L; c++) + for (var c = L; c < C; c++) o[n + c] = o[b + c] & 255; if (f == 3) - for (var c = C; c < L; c++) - o[n + c] = o[b + c] + (o[n + c - C] >> 1) & 255; + for (var c = L; c < C; c++) + o[n + c] = o[b + c] + (o[n + c - L] >> 1) & 255; if (f == 4) - for (var c = C; c < L; c++) - o[n + c] = o[b + c] + D(o[n + c - C], 0, 0) & 255; + for (var c = L; c < C; c++) + o[n + c] = o[b + c] + D(o[n + c - L], 0, 0) & 255; } else { if (f == 2) - for (var c = 0; c < L; c++) - o[n + c] = o[b + c] + o[n + c - L] & 255; - if (f == 3) { for (var c = 0; c < C; c++) - o[n + c] = o[b + c] + (o[n + c - L] >> 1) & 255; - for (var c = C; c < L; c++) - o[n + c] = o[b + c] + (o[n + c - L] + o[n + c - C] >> 1) & 255; + o[n + c] = o[b + c] + o[n + c - C] & 255; + if (f == 3) { + for (var c = 0; c < L; c++) + o[n + c] = o[b + c] + (o[n + c - C] >> 1) & 255; + for (var c = L; c < C; c++) + o[n + c] = o[b + c] + (o[n + c - C] + o[n + c - L] >> 1) & 255; } if (f == 4) { - for (var c = 0; c < C; c++) - o[n + c] = o[b + c] + D(0, o[n + c - L], 0) & 255; - for (var c = C; c < L; c++) - o[n + c] = o[b + c] + D(o[n + c - C], o[n + c - L], o[n + c - C - L]) & 255; + for (var c = 0; c < L; c++) + o[n + c] = o[b + c] + D(0, o[n + c - C], 0) & 255; + for (var c = L; c < C; c++) + o[n + c] = o[b + c] + D(o[n + c - L], o[n + c - C], o[n + c - L - C]) & 255; } } } return o; - }, _.decode._paeth = function(o, p, E) { - var u = o + p - E, A = Math.abs(u - o), C = Math.abs(u - p), L = Math.abs(u - E); - return A <= C && A <= L ? o : C <= L ? p : E; - }, _.decode._IHDR = function(o, p, E) { + }, _.decode._paeth = function(o, g, E) { + var u = o + g - E, A = Math.abs(u - o), L = Math.abs(u - g), C = Math.abs(u - E); + return A <= L && A <= C ? o : L <= C ? g : E; + }, _.decode._IHDR = function(o, g, E) { var u = _._bin; - E.width = u.readUint(o, p), p += 4, E.height = u.readUint(o, p), p += 4, E.depth = o[p], p++, E.ctype = o[p], p++, E.compress = o[p], p++, E.filter = o[p], p++, E.interlace = o[p], p++; + E.width = u.readUint(o, g), g += 4, E.height = u.readUint(o, g), g += 4, E.depth = o[g], g++, E.ctype = o[g], g++, E.compress = o[g], g++, E.filter = o[g], g++, E.interlace = o[g], g++; }, _._bin = { - nextZero: function(o, p) { - for (; o[p] != 0; ) - p++; - return p; + nextZero: function(o, g) { + for (; o[g] != 0; ) + g++; + return g; }, - readUshort: function(o, p) { - return o[p] << 8 | o[p + 1]; + readUshort: function(o, g) { + return o[g] << 8 | o[g + 1]; }, - writeUshort: function(o, p, E) { - o[p] = E >> 8 & 255, o[p + 1] = E & 255; + writeUshort: function(o, g, E) { + o[g] = E >> 8 & 255, o[g + 1] = E & 255; }, - readUint: function(o, p) { - return o[p] * 16777216 + (o[p + 1] << 16 | o[p + 2] << 8 | o[p + 3]); + readUint: function(o, g) { + return o[g] * 16777216 + (o[g + 1] << 16 | o[g + 2] << 8 | o[g + 3]); }, - writeUint: function(o, p, E) { - o[p] = E >> 24 & 255, o[p + 1] = E >> 16 & 255, o[p + 2] = E >> 8 & 255, o[p + 3] = E & 255; + writeUint: function(o, g, E) { + o[g] = E >> 24 & 255, o[g + 1] = E >> 16 & 255, o[g + 2] = E >> 8 & 255, o[g + 3] = E & 255; }, - readASCII: function(o, p, E) { + readASCII: function(o, g, E) { for (var u = "", A = 0; A < E; A++) - u += String.fromCharCode(o[p + A]); + u += String.fromCharCode(o[g + A]); return u; }, - writeASCII: function(o, p, E) { + writeASCII: function(o, g, E) { for (var u = 0; u < E.length; u++) - o[p + u] = E.charCodeAt(u); + o[g + u] = E.charCodeAt(u); }, - readBytes: function(o, p, E) { + readBytes: function(o, g, E) { for (var u = [], A = 0; A < E; A++) - u.push(o[p + A]); + u.push(o[g + A]); return u; }, pad: function(o) { return o.length < 2 ? "0" + o : o; }, - readUTF8: function(o, p, E) { - for (var u = "", A, C = 0; C < E; C++) - u += "%" + _._bin.pad(o[p + C].toString(16)); + readUTF8: function(o, g, E) { + for (var u = "", A, L = 0; L < E; L++) + u += "%" + _._bin.pad(o[g + L].toString(16)); try { A = decodeURIComponent(u); } catch { - return _._bin.readASCII(o, p, E); + return _._bin.readASCII(o, g, E); } return A; } - }, _._copyTile = function(o, p, E, u, A, C, L, D, r) { - for (var n = Math.min(p, A), b = Math.min(E, C), f = 0, c = 0, t = 0; t < b; t++) + }, _._copyTile = function(o, g, E, u, A, L, C, D, r) { + for (var n = Math.min(g, A), b = Math.min(E, L), f = 0, c = 0, t = 0; t < b; t++) for (var a = 0; a < n; a++) - if (L >= 0 && D >= 0 ? (f = t * p + a << 2, c = (D + t) * A + L + a << 2) : (f = (-D + t) * p - L + a << 2, c = t * A + a << 2), r == 0) + if (C >= 0 && D >= 0 ? (f = t * g + a << 2, c = (D + t) * A + C + a << 2) : (f = (-D + t) * g - C + a << 2, c = t * A + a << 2), r == 0) u[c] = o[f], u[c + 1] = o[f + 1], u[c + 2] = o[f + 2], u[c + 3] = o[f + 3]; else if (r == 1) { - var h = o[f + 3] * 0.00392156862745098, M = o[f] * h, w = o[f + 1] * h, S = o[f + 2] * h, T = u[c + 3] * (1 / 255), R = u[c] * T, z = u[c + 1] * T, P = u[c + 2] * T, B = 1 - h, U = h + T * B, F = U == 0 ? 0 : 1 / U; - u[c + 3] = 255 * U, u[c + 0] = (M + R * B) * F, u[c + 1] = (w + z * B) * F, u[c + 2] = (S + P * B) * F; + var h = o[f + 3] * 0.00392156862745098, M = o[f] * h, w = o[f + 1] * h, S = o[f + 2] * h, T = u[c + 3] * (1 / 255), R = u[c] * T, $ = u[c + 1] * T, P = u[c + 2] * T, B = 1 - h, F = h + T * B, U = F == 0 ? 0 : 1 / F; + u[c + 3] = 255 * F, u[c + 0] = (M + R * B) * U, u[c + 1] = (w + $ * B) * U, u[c + 2] = (S + P * B) * U; } else if (r == 2) { - var h = o[f + 3], M = o[f], w = o[f + 1], S = o[f + 2], T = u[c + 3], R = u[c], z = u[c + 1], P = u[c + 2]; - h == T && M == R && w == z && S == P ? (u[c] = 0, u[c + 1] = 0, u[c + 2] = 0, u[c + 3] = 0) : (u[c] = M, u[c + 1] = w, u[c + 2] = S, u[c + 3] = h); + var h = o[f + 3], M = o[f], w = o[f + 1], S = o[f + 2], T = u[c + 3], R = u[c], $ = u[c + 1], P = u[c + 2]; + h == T && M == R && w == $ && S == P ? (u[c] = 0, u[c + 1] = 0, u[c + 2] = 0, u[c + 3] = 0) : (u[c] = M, u[c + 1] = w, u[c + 2] = S, u[c + 3] = h); } else if (r == 3) { - var h = o[f + 3], M = o[f], w = o[f + 1], S = o[f + 2], T = u[c + 3], R = u[c], z = u[c + 1], P = u[c + 2]; - if (h == T && M == R && w == z && S == P) + var h = o[f + 3], M = o[f], w = o[f + 1], S = o[f + 2], T = u[c + 3], R = u[c], $ = u[c + 1], P = u[c + 2]; + if (h == T && M == R && w == $ && S == P) continue; if (h < 220 && T > 20) return !1; } return !0; - }, _.encode = function(o, p, E, u, A, C) { - u == null && (u = 0), C == null && (C = !1); - for (var L = new Uint8Array(o[0].byteLength * o.length + 100), D = [137, 80, 78, 71, 13, 10, 26, 10], r = 0; r < 8; r++) - L[r] = D[r]; - var n = 8, b = _._bin, f = _.crc.crc, c = b.writeUint, t = b.writeUshort, a = b.writeASCII, h = _.encode.compressPNG(o, p, E, u, C); - c(L, n, 13), n += 4, a(L, n, "IHDR"), n += 4, c(L, n, p), n += 4, c(L, n, E), n += 4, L[n] = h.depth, n++, L[n] = h.ctype, n++, L[n] = 0, n++, L[n] = 0, n++, L[n] = 0, n++, c(L, n, f(L, n - 17, 17)), n += 4, c(L, n, 1), n += 4, a(L, n, "sRGB"), n += 4, L[n] = 1, n++, c(L, n, f(L, n - 5, 5)), n += 4; + }, _.encode = function(o, g, E, u, A, L) { + u == null && (u = 0), L == null && (L = !1); + for (var C = new Uint8Array(o[0].byteLength * o.length + 100), D = [137, 80, 78, 71, 13, 10, 26, 10], r = 0; r < 8; r++) + C[r] = D[r]; + var n = 8, b = _._bin, f = _.crc.crc, c = b.writeUint, t = b.writeUshort, a = b.writeASCII, h = _.encode.compressPNG(o, g, E, u, L); + c(C, n, 13), n += 4, a(C, n, "IHDR"), n += 4, c(C, n, g), n += 4, c(C, n, E), n += 4, C[n] = h.depth, n++, C[n] = h.ctype, n++, C[n] = 0, n++, C[n] = 0, n++, C[n] = 0, n++, c(C, n, f(C, n - 17, 17)), n += 4, c(C, n, 1), n += 4, a(C, n, "sRGB"), n += 4, C[n] = 1, n++, c(C, n, f(C, n - 5, 5)), n += 4; var M = o.length > 1; - if (M && (c(L, n, 8), n += 4, a(L, n, "acTL"), n += 4, c(L, n, o.length), n += 4, c(L, n, 0), n += 4, c(L, n, f(L, n - 12, 12)), n += 4), h.ctype == 3) { + if (M && (c(C, n, 8), n += 4, a(C, n, "acTL"), n += 4, c(C, n, o.length), n += 4, c(C, n, 0), n += 4, c(C, n, f(C, n - 12, 12)), n += 4), h.ctype == 3) { var w = h.plte.length; - c(L, n, w * 3), n += 4, a(L, n, "PLTE"), n += 4; + c(C, n, w * 3), n += 4, a(C, n, "PLTE"), n += 4; for (var r = 0; r < w; r++) { - var S = r * 3, T = h.plte[r], R = T & 255, z = T >> 8 & 255, P = T >> 16 & 255; - L[n + S + 0] = R, L[n + S + 1] = z, L[n + S + 2] = P; + var S = r * 3, T = h.plte[r], R = T & 255, $ = T >> 8 & 255, P = T >> 16 & 255; + C[n + S + 0] = R, C[n + S + 1] = $, C[n + S + 2] = P; } - if (n += w * 3, c(L, n, f(L, n - w * 3 - 4, w * 3 + 4)), n += 4, h.gotAlpha) { - c(L, n, w), n += 4, a(L, n, "tRNS"), n += 4; + if (n += w * 3, c(C, n, f(C, n - w * 3 - 4, w * 3 + 4)), n += 4, h.gotAlpha) { + c(C, n, w), n += 4, a(C, n, "tRNS"), n += 4; for (var r = 0; r < w; r++) - L[n + r] = h.plte[r] >> 24 & 255; - n += w, c(L, n, f(L, n - w - 4, w + 4)), n += 4; + C[n + r] = h.plte[r] >> 24 & 255; + n += w, c(C, n, f(C, n - w - 4, w + 4)), n += 4; } } - for (var B = 0, U = 0; U < h.frames.length; U++) { - var F = h.frames[U]; - M && (c(L, n, 26), n += 4, a(L, n, "fcTL"), n += 4, c(L, n, B++), n += 4, c(L, n, F.rect.width), n += 4, c(L, n, F.rect.height), n += 4, c(L, n, F.rect.x), n += 4, c(L, n, F.rect.y), n += 4, t(L, n, A[U]), n += 2, t(L, n, 1e3), n += 2, L[n] = F.dispose, n++, L[n] = F.blend, n++, c(L, n, f(L, n - 30, 30)), n += 4); - var $ = F.cimg, w = $.length; - c(L, n, w + (U == 0 ? 0 : 4)), n += 4; + for (var B = 0, F = 0; F < h.frames.length; F++) { + var U = h.frames[F]; + M && (c(C, n, 26), n += 4, a(C, n, "fcTL"), n += 4, c(C, n, B++), n += 4, c(C, n, U.rect.width), n += 4, c(C, n, U.rect.height), n += 4, c(C, n, U.rect.x), n += 4, c(C, n, U.rect.y), n += 4, t(C, n, A[F]), n += 2, t(C, n, 1e3), n += 2, C[n] = U.dispose, n++, C[n] = U.blend, n++, c(C, n, f(C, n - 30, 30)), n += 4); + var z = U.cimg, w = z.length; + c(C, n, w + (F == 0 ? 0 : 4)), n += 4; var W = n; - a(L, n, U == 0 ? "IDAT" : "fdAT"), n += 4, U != 0 && (c(L, n, B++), n += 4); + a(C, n, F == 0 ? "IDAT" : "fdAT"), n += 4, F != 0 && (c(C, n, B++), n += 4); for (var r = 0; r < w; r++) - L[n + r] = $[r]; - n += w, c(L, n, f(L, W, n - W)), n += 4; + C[n + r] = z[r]; + n += w, c(C, n, f(C, W, n - W)), n += 4; } - return c(L, n, 0), n += 4, a(L, n, "IEND"), n += 4, c(L, n, f(L, n - 4, 4)), n += 4, L.buffer.slice(0, n); - }, _.encode.compressPNG = function(o, p, E, u, A) { - for (var C = _.encode.compress(o, p, E, u, !1, A), L = 0; L < o.length; L++) { - var D = C.frames[L]; + return c(C, n, 0), n += 4, a(C, n, "IEND"), n += 4, c(C, n, f(C, n - 4, 4)), n += 4, C.buffer.slice(0, n); + }, _.encode.compressPNG = function(o, g, E, u, A) { + for (var L = _.encode.compress(o, g, E, u, !1, A), C = 0; C < o.length; C++) { + var D = L.frames[C]; D.rect.width; var r = D.rect.height, n = D.bpl, b = D.bpp, f = new Uint8Array(r * n + r); D.cimg = _.encode._filterZero(D.img, r, b, n, f); } - return C; - }, _.encode.compress = function(o, p, E, u, A, C) { - C == null && (C = !1); - for (var L = 6, D = 8, r = 4, n = 255, b = 0; b < o.length; b++) + return L; + }, _.encode.compress = function(o, g, E, u, A, L) { + L == null && (L = !1); + for (var C = 6, D = 8, r = 4, n = 255, b = 0; b < o.length; b++) for (var f = new Uint8Array(o[b]), c = f.length, t = 0; t < c; t += 4) n &= f[t + 3]; var a = n != 255, h = {}, M = []; @@ -20220,223 +20220,223 @@ ATOM`, h); for (var b = 0; b < o.length; b++) for (var T = new Uint32Array(o[b]), c = T.length, t = 0; t < c; t++) { var S = T[t]; - if ((t < p || S != T[t - 1] && S != T[t - p]) && h[S] == null && (h[S] = M.length, M.push(S), M.length >= 300)) + if ((t < g || S != T[t - 1] && S != T[t - g]) && h[S] == null && (h[S] = M.length, M.push(S), M.length >= 300)) break; } - var R = a ? A : !1, z = M.length; - z <= 256 && C == !1 && (z <= 2 ? D = 1 : z <= 4 ? D = 2 : z <= 16 ? D = 4 : D = 8, A && (D = 8), a = !0); + var R = a ? A : !1, $ = M.length; + $ <= 256 && L == !1 && ($ <= 2 ? D = 1 : $ <= 4 ? D = 2 : $ <= 16 ? D = 4 : D = 8, A && (D = 8), a = !0); for (var P = [], b = 0; b < o.length; b++) { - var B = new Uint8Array(o[b]), U = new Uint32Array(B.buffer), F = 0, $ = 0, W = p, N = E, G = 0; + var B = new Uint8Array(o[b]), F = new Uint32Array(B.buffer), U = 0, z = 0, W = g, V = E, N = 0; if (b != 0 && !R) { - for (var k = A || b == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, j = 0, Q = 1e9, ie = 0; ie < k; ie++) { - for (var oe = new Uint8Array(o[b - 1 - ie]), pe = new Uint32Array(o[b - 1 - ie]), he = p, ue = E, se = -1, ae = -1, we = 0; we < E; we++) - for (var xe = 0; xe < p; xe++) { - var t = we * p + xe; - U[t] != pe[t] && (xe < he && (he = xe), xe > se && (se = xe), we < ue && (ue = we), we > ae && (ae = we)); + for (var k = A || b == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, G = 0, Q = 1e9, ie = 0; ie < k; ie++) { + for (var de = new Uint8Array(o[b - 1 - ie]), ge = new Uint32Array(o[b - 1 - ie]), le = g, oe = E, he = -1, se = -1, xe = 0; xe < E; xe++) + for (var ye = 0; ye < g; ye++) { + var t = xe * g + ye; + F[t] != ge[t] && (ye < le && (le = ye), ye > he && (he = ye), xe < oe && (oe = xe), xe > se && (se = xe)); } - var Ie = se == -1 ? 1 : (se - he + 1) * (ae - ue + 1); - Ie < Q && (Q = Ie, j = ie, se == -1 ? (F = $ = 0, W = N = 1) : (F = he, $ = ue, W = se - he + 1, N = ae - ue + 1)); + var Pe = he == -1 ? 1 : (he - le + 1) * (se - oe + 1); + Pe < Q && (Q = Pe, G = ie, he == -1 ? (U = z = 0, W = V = 1) : (U = le, z = oe, W = he - le + 1, V = se - oe + 1)); } - var oe = new Uint8Array(o[b - 1 - j]); - j == 1 && (P[P.length - 1].dispose = 2); - var ve = new Uint8Array(W * N * 4); - new Uint32Array(ve.buffer), _._copyTile(oe, p, E, ve, W, N, -F, -$, 0), _._copyTile(B, p, E, ve, W, N, -F, -$, 3) ? (_._copyTile(B, p, E, ve, W, N, -F, -$, 2), G = 1) : (_._copyTile(B, p, E, ve, W, N, -F, -$, 0), G = 0), B = ve, U = new Uint32Array(B.buffer); + var de = new Uint8Array(o[b - 1 - G]); + G == 1 && (P[P.length - 1].dispose = 2); + var pe = new Uint8Array(W * V * 4); + new Uint32Array(pe.buffer), _._copyTile(de, g, E, pe, W, V, -U, -z, 0), _._copyTile(B, g, E, pe, W, V, -U, -z, 3) ? (_._copyTile(B, g, E, pe, W, V, -U, -z, 2), N = 1) : (_._copyTile(B, g, E, pe, W, V, -U, -z, 0), N = 0), B = pe, F = new Uint32Array(B.buffer); } var re = 4 * W; - if (z <= 256 && C == !1) { + if ($ <= 256 && L == !1) { re = Math.ceil(D * W / 8); - for (var ve = new Uint8Array(re * N), we = 0; we < N; we++) { - var t = we * re, Se = we * W; + for (var pe = new Uint8Array(re * V), xe = 0; xe < V; xe++) { + var t = xe * re, Se = xe * W; if (D == 8) - for (var xe = 0; xe < W; xe++) - ve[t + xe] = h[U[Se + xe]]; + for (var ye = 0; ye < W; ye++) + pe[t + ye] = h[F[Se + ye]]; else if (D == 4) - for (var xe = 0; xe < W; xe++) - ve[t + (xe >> 1)] |= h[U[Se + xe]] << 4 - (xe & 1) * 4; + for (var ye = 0; ye < W; ye++) + pe[t + (ye >> 1)] |= h[F[Se + ye]] << 4 - (ye & 1) * 4; else if (D == 2) - for (var xe = 0; xe < W; xe++) - ve[t + (xe >> 2)] |= h[U[Se + xe]] << 6 - (xe & 3) * 2; + for (var ye = 0; ye < W; ye++) + pe[t + (ye >> 2)] |= h[F[Se + ye]] << 6 - (ye & 3) * 2; else if (D == 1) - for (var xe = 0; xe < W; xe++) - ve[t + (xe >> 3)] |= h[U[Se + xe]] << 7 - (xe & 7) * 1; + for (var ye = 0; ye < W; ye++) + pe[t + (ye >> 3)] |= h[F[Se + ye]] << 7 - (ye & 7) * 1; } - B = ve, L = 3, r = 1; + B = pe, C = 3, r = 1; } else if (a == !1 && o.length == 1) { - for (var ve = new Uint8Array(W * N * 3), ze = W * N, t = 0; t < ze; t++) { - var Ge = t * 3, $e = t * 4; - ve[Ge] = B[$e], ve[Ge + 1] = B[$e + 1], ve[Ge + 2] = B[$e + 2]; + for (var pe = new Uint8Array(W * V * 3), ke = W * V, t = 0; t < ke; t++) { + var $e = t * 3, ze = t * 4; + pe[$e] = B[ze], pe[$e + 1] = B[ze + 1], pe[$e + 2] = B[ze + 2]; } - B = ve, L = 2, r = 3, re = 3 * W; + B = pe, C = 2, r = 3, re = 3 * W; } - P.push({ rect: { x: F, y: $, width: W, height: N }, img: B, bpl: re, bpp: r, blend: G, dispose: R ? 1 : 0 }); + P.push({ rect: { x: U, y: z, width: W, height: V }, img: B, bpl: re, bpp: r, blend: N, dispose: R ? 1 : 0 }); } - return { ctype: L, depth: D, plte: M, gotAlpha: a, frames: P }; - }, _.encode._filterZero = function(o, p, E, u, A) { - for (var C = [], L = 0; L < 5; L++) - if (!(p * u > 5e5 && (L == 2 || L == 3 || L == 4))) { - for (var D = 0; D < p; D++) - _.encode._filterLine(A, o, D, u, E, L); - if (C.push(x.deflate(A)), E == 1) + return { ctype: C, depth: D, plte: M, gotAlpha: a, frames: P }; + }, _.encode._filterZero = function(o, g, E, u, A) { + for (var L = [], C = 0; C < 5; C++) + if (!(g * u > 5e5 && (C == 2 || C == 3 || C == 4))) { + for (var D = 0; D < g; D++) + _.encode._filterLine(A, o, D, u, E, C); + if (L.push(x.deflate(A)), E == 1) break; } - for (var r, n = 1e9, b = 0; b < C.length; b++) - C[b].length < n && (r = b, n = C[b].length); - return C[r]; - }, _.encode._filterLine = function(o, p, E, u, A, C) { - var L = E * u, D = L + E, r = _.decode._paeth; - if (o[D] = C, D++, C == 0) + for (var r, n = 1e9, b = 0; b < L.length; b++) + L[b].length < n && (r = b, n = L[b].length); + return L[r]; + }, _.encode._filterLine = function(o, g, E, u, A, L) { + var C = E * u, D = C + E, r = _.decode._paeth; + if (o[D] = L, D++, L == 0) for (var n = 0; n < u; n++) - o[D + n] = p[L + n]; - else if (C == 1) { + o[D + n] = g[C + n]; + else if (L == 1) { for (var n = 0; n < A; n++) - o[D + n] = p[L + n]; + o[D + n] = g[C + n]; for (var n = A; n < u; n++) - o[D + n] = p[L + n] - p[L + n - A] + 256 & 255; + o[D + n] = g[C + n] - g[C + n - A] + 256 & 255; } else if (E == 0) { for (var n = 0; n < A; n++) - o[D + n] = p[L + n]; - if (C == 2) + o[D + n] = g[C + n]; + if (L == 2) for (var n = A; n < u; n++) - o[D + n] = p[L + n]; - if (C == 3) + o[D + n] = g[C + n]; + if (L == 3) for (var n = A; n < u; n++) - o[D + n] = p[L + n] - (p[L + n - A] >> 1) + 256 & 255; - if (C == 4) + o[D + n] = g[C + n] - (g[C + n - A] >> 1) + 256 & 255; + if (L == 4) for (var n = A; n < u; n++) - o[D + n] = p[L + n] - r(p[L + n - A], 0, 0) + 256 & 255; + o[D + n] = g[C + n] - r(g[C + n - A], 0, 0) + 256 & 255; } else { - if (C == 2) + if (L == 2) for (var n = 0; n < u; n++) - o[D + n] = p[L + n] + 256 - p[L + n - u] & 255; - if (C == 3) { + o[D + n] = g[C + n] + 256 - g[C + n - u] & 255; + if (L == 3) { for (var n = 0; n < A; n++) - o[D + n] = p[L + n] + 256 - (p[L + n - u] >> 1) & 255; + o[D + n] = g[C + n] + 256 - (g[C + n - u] >> 1) & 255; for (var n = A; n < u; n++) - o[D + n] = p[L + n] + 256 - (p[L + n - u] + p[L + n - A] >> 1) & 255; + o[D + n] = g[C + n] + 256 - (g[C + n - u] + g[C + n - A] >> 1) & 255; } - if (C == 4) { + if (L == 4) { for (var n = 0; n < A; n++) - o[D + n] = p[L + n] + 256 - r(0, p[L + n - u], 0) & 255; + o[D + n] = g[C + n] + 256 - r(0, g[C + n - u], 0) & 255; for (var n = A; n < u; n++) - o[D + n] = p[L + n] + 256 - r(p[L + n - A], p[L + n - u], p[L + n - A - u]) & 255; + o[D + n] = g[C + n] + 256 - r(g[C + n - A], g[C + n - u], g[C + n - A - u]) & 255; } } }, _.crc = { table: function() { - for (var o = new Uint32Array(256), p = 0; p < 256; p++) { - for (var E = p, u = 0; u < 8; u++) + for (var o = new Uint32Array(256), g = 0; g < 256; g++) { + for (var E = g, u = 0; u < 8; u++) E & 1 ? E = 3988292384 ^ E >>> 1 : E = E >>> 1; - o[p] = E; + o[g] = E; } return o; }(), - update: function(o, p, E, u) { + update: function(o, g, E, u) { for (var A = 0; A < u; A++) - o = _.crc.table[(o ^ p[E + A]) & 255] ^ o >>> 8; + o = _.crc.table[(o ^ g[E + A]) & 255] ^ o >>> 8; return o; }, - crc: function(o, p, E) { - return _.crc.update(4294967295, o, p, E) ^ 4294967295; + crc: function(o, g, E) { + return _.crc.update(4294967295, o, g, E) ^ 4294967295; } - }, _.quantize = function(o, p, E) { - for (var u = [], A = 0, C = 0; C < o.length; C++) - u.push(_.encode.alphaMul(new Uint8Array(o[C]), E)), A += o[C].byteLength; - for (var L = new Uint8Array(A), D = new Uint32Array(L.buffer), r = 0, C = 0; C < u.length; C++) { - for (var n = u[C], b = n.length, f = 0; f < b; f++) - L[r + f] = n[f]; + }, _.quantize = function(o, g, E) { + for (var u = [], A = 0, L = 0; L < o.length; L++) + u.push(_.encode.alphaMul(new Uint8Array(o[L]), E)), A += o[L].byteLength; + for (var C = new Uint8Array(A), D = new Uint32Array(C.buffer), r = 0, L = 0; L < u.length; L++) { + for (var n = u[L], b = n.length, f = 0; f < b; f++) + C[r + f] = n[f]; r += b; } - var c = { i0: 0, i1: L.length, bst: null, est: null, tdst: 0, left: null, right: null }; - c.bst = _.quantize.stats(L, c.i0, c.i1), c.est = _.quantize.estats(c.bst); - for (var t = [c]; t.length < p; ) { - for (var a = 0, h = 0, C = 0; C < t.length; C++) - t[C].est.L > a && (a = t[C].est.L, h = C); + var c = { i0: 0, i1: C.length, bst: null, est: null, tdst: 0, left: null, right: null }; + c.bst = _.quantize.stats(C, c.i0, c.i1), c.est = _.quantize.estats(c.bst); + for (var t = [c]; t.length < g; ) { + for (var a = 0, h = 0, L = 0; L < t.length; L++) + t[L].est.L > a && (a = t[L].est.L, h = L); if (a < 1e-3) break; - var M = t[h], w = _.quantize.splitPixels(L, D, M.i0, M.i1, M.est.e, M.est.eMq255), S = { i0: M.i0, i1: w, bst: null, est: null, tdst: 0, left: null, right: null }; - S.bst = _.quantize.stats(L, S.i0, S.i1), S.est = _.quantize.estats(S.bst); + var M = t[h], w = _.quantize.splitPixels(C, D, M.i0, M.i1, M.est.e, M.est.eMq255), S = { i0: M.i0, i1: w, bst: null, est: null, tdst: 0, left: null, right: null }; + S.bst = _.quantize.stats(C, S.i0, S.i1), S.est = _.quantize.estats(S.bst); var T = { i0: w, i1: M.i1, bst: null, est: null, tdst: 0, left: null, right: null }; T.bst = { R: [], m: [], N: M.bst.N - S.bst.N }; - for (var C = 0; C < 16; C++) - T.bst.R[C] = M.bst.R[C] - S.bst.R[C]; - for (var C = 0; C < 4; C++) - T.bst.m[C] = M.bst.m[C] - S.bst.m[C]; + for (var L = 0; L < 16; L++) + T.bst.R[L] = M.bst.R[L] - S.bst.R[L]; + for (var L = 0; L < 4; L++) + T.bst.m[L] = M.bst.m[L] - S.bst.m[L]; T.est = _.quantize.estats(T.bst), M.left = S, M.right = T, t[h] = S, t.push(T); } - t.sort(function(k, j) { - return j.bst.N - k.bst.N; + t.sort(function(k, G) { + return G.bst.N - k.bst.N; }); for (var R = 0; R < u.length; R++) { - for (var z = _.quantize.planeDst, P = new Uint8Array(u[R].buffer), B = new Uint32Array(u[R].buffer), U = P.length, C = 0; C < U; C += 4) { - for (var F = P[C] * 0.00392156862745098, $ = P[C + 1] * (1 / 255), W = P[C + 2] * (1 / 255), N = P[C + 3] * (1 / 255), G = c; G.left; ) - G = z(G.est, F, $, W, N) <= 0 ? G.left : G.right; - B[C >> 2] = G.est.rgba; + for (var $ = _.quantize.planeDst, P = new Uint8Array(u[R].buffer), B = new Uint32Array(u[R].buffer), F = P.length, L = 0; L < F; L += 4) { + for (var U = P[L] * 0.00392156862745098, z = P[L + 1] * (1 / 255), W = P[L + 2] * (1 / 255), V = P[L + 3] * (1 / 255), N = c; N.left; ) + N = $(N.est, U, z, W, V) <= 0 ? N.left : N.right; + B[L >> 2] = N.est.rgba; } u[R] = B.buffer; } return { bufs: u, plte: t }; - }, _.quantize.getNearest = function(o, p, E, u, A) { + }, _.quantize.getNearest = function(o, g, E, u, A) { if (o.left == null) - return o.tdst = _.quantize.dist(o.est.q, p, E, u, A), o; - var C = _.quantize.planeDst(o.est, p, E, u, A), L = o.left, D = o.right; - C > 0 && (L = o.right, D = o.left); - var r = _.quantize.getNearest(L, p, E, u, A); - if (r.tdst <= C * C) + return o.tdst = _.quantize.dist(o.est.q, g, E, u, A), o; + var L = _.quantize.planeDst(o.est, g, E, u, A), C = o.left, D = o.right; + L > 0 && (C = o.right, D = o.left); + var r = _.quantize.getNearest(C, g, E, u, A); + if (r.tdst <= L * L) return r; - var n = _.quantize.getNearest(D, p, E, u, A); + var n = _.quantize.getNearest(D, g, E, u, A); return n.tdst < r.tdst ? n : r; - }, _.quantize.planeDst = function(o, p, E, u, A) { - var C = o.e; - return C[0] * p + C[1] * E + C[2] * u + C[3] * A - o.eMq; - }, _.quantize.dist = function(o, p, E, u, A) { - var C = p - o[0], L = E - o[1], D = u - o[2], r = A - o[3]; - return C * C + L * L + D * D + r * r; - }, _.quantize.splitPixels = function(o, p, E, u, A, C) { - var L = _.quantize.vecDot; + }, _.quantize.planeDst = function(o, g, E, u, A) { + var L = o.e; + return L[0] * g + L[1] * E + L[2] * u + L[3] * A - o.eMq; + }, _.quantize.dist = function(o, g, E, u, A) { + var L = g - o[0], C = E - o[1], D = u - o[2], r = A - o[3]; + return L * L + C * C + D * D + r * r; + }, _.quantize.splitPixels = function(o, g, E, u, A, L) { + var C = _.quantize.vecDot; for (u -= 4; E < u; ) { - for (; L(o, E, A) <= C; ) + for (; C(o, E, A) <= L; ) E += 4; - for (; L(o, u, A) > C; ) + for (; C(o, u, A) > L; ) u -= 4; if (E >= u) break; - var D = p[E >> 2]; - p[E >> 2] = p[u >> 2], p[u >> 2] = D, E += 4, u -= 4; + var D = g[E >> 2]; + g[E >> 2] = g[u >> 2], g[u >> 2] = D, E += 4, u -= 4; } - for (; L(o, E, A) > C; ) + for (; C(o, E, A) > L; ) E -= 4; return E + 4; - }, _.quantize.vecDot = function(o, p, E) { - return o[p] * E[0] + o[p + 1] * E[1] + o[p + 2] * E[2] + o[p + 3] * E[3]; - }, _.quantize.stats = function(o, p, E) { - for (var u = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], A = [0, 0, 0, 0], C = E - p >> 2, L = p; L < E; L += 4) { - var D = o[L] * 0.00392156862745098, r = o[L + 1] * (1 / 255), n = o[L + 2] * (1 / 255), b = o[L + 3] * (1 / 255); + }, _.quantize.vecDot = function(o, g, E) { + return o[g] * E[0] + o[g + 1] * E[1] + o[g + 2] * E[2] + o[g + 3] * E[3]; + }, _.quantize.stats = function(o, g, E) { + for (var u = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], A = [0, 0, 0, 0], L = E - g >> 2, C = g; C < E; C += 4) { + var D = o[C] * 0.00392156862745098, r = o[C + 1] * (1 / 255), n = o[C + 2] * (1 / 255), b = o[C + 3] * (1 / 255); A[0] += D, A[1] += r, A[2] += n, A[3] += b, u[0] += D * D, u[1] += D * r, u[2] += D * n, u[3] += D * b, u[5] += r * r, u[6] += r * n, u[7] += r * b, u[10] += n * n, u[11] += n * b, u[15] += b * b; } - return u[4] = u[1], u[8] = u[2], u[12] = u[3], u[9] = u[6], u[13] = u[7], u[14] = u[11], { R: u, m: A, N: C }; + return u[4] = u[1], u[8] = u[2], u[12] = u[3], u[9] = u[6], u[13] = u[7], u[14] = u[11], { R: u, m: A, N: L }; }, _.quantize.estats = function(o) { - var p = o.R, E = o.m, u = o.N, A = E[0], C = E[1], L = E[2], D = E[3], r = u == 0 ? 0 : 1 / u, n = [ - p[0] - A * A * r, - p[1] - A * C * r, - p[2] - A * L * r, - p[3] - A * D * r, - p[4] - C * A * r, - p[5] - C * C * r, - p[6] - C * L * r, - p[7] - C * D * r, - p[8] - L * A * r, - p[9] - L * C * r, - p[10] - L * L * r, - p[11] - L * D * r, - p[12] - D * A * r, - p[13] - D * C * r, - p[14] - D * L * r, - p[15] - D * D * r + var g = o.R, E = o.m, u = o.N, A = E[0], L = E[1], C = E[2], D = E[3], r = u == 0 ? 0 : 1 / u, n = [ + g[0] - A * A * r, + g[1] - A * L * r, + g[2] - A * C * r, + g[3] - A * D * r, + g[4] - L * A * r, + g[5] - L * L * r, + g[6] - L * C * r, + g[7] - L * D * r, + g[8] - C * A * r, + g[9] - C * L * r, + g[10] - C * C * r, + g[11] - C * D * r, + g[12] - D * A * r, + g[13] - D * L * r, + g[14] - D * C * r, + g[15] - D * D * r ], b = n, f = _.M4, c = [0.5, 0.5, 0.5, 0.5], t = 0, a = 0; if (u != 0) for (var h = 0; h < 10 && (c = f.multVec(b, c), a = Math.sqrt(f.dot(c, c)), c = f.sml(1 / a, c), !(Math.abs(a - t) < 1e-9)); h++) t = a; - var M = [A * r, C * r, L * r, D * r], w = f.dot(f.sml(255, M), c), S = M[3] < 1e-3 ? 0 : 1 / M[3]; + var M = [A * r, L * r, C * r, D * r], w = f.dot(f.sml(255, M), c), S = M[3] < 1e-3 ? 0 : 1 / M[3]; return { Cov: n, q: M, @@ -20447,30 +20447,30 @@ ATOM`, h); rgba: (Math.round(255 * M[3]) << 24 | Math.round(255 * M[2] * S) << 16 | Math.round(255 * M[1] * S) << 8 | Math.round(255 * M[0] * S) << 0) >>> 0 }; }, _.M4 = { - multVec: function(o, p) { + multVec: function(o, g) { return [ - o[0] * p[0] + o[1] * p[1] + o[2] * p[2] + o[3] * p[3], - o[4] * p[0] + o[5] * p[1] + o[6] * p[2] + o[7] * p[3], - o[8] * p[0] + o[9] * p[1] + o[10] * p[2] + o[11] * p[3], - o[12] * p[0] + o[13] * p[1] + o[14] * p[2] + o[15] * p[3] + o[0] * g[0] + o[1] * g[1] + o[2] * g[2] + o[3] * g[3], + o[4] * g[0] + o[5] * g[1] + o[6] * g[2] + o[7] * g[3], + o[8] * g[0] + o[9] * g[1] + o[10] * g[2] + o[11] * g[3], + o[12] * g[0] + o[13] * g[1] + o[14] * g[2] + o[15] * g[3] ]; }, - dot: function(o, p) { - return o[0] * p[0] + o[1] * p[1] + o[2] * p[2] + o[3] * p[3]; + dot: function(o, g) { + return o[0] * g[0] + o[1] * g[1] + o[2] * g[2] + o[3] * g[3]; }, - sml: function(o, p) { - return [o * p[0], o * p[1], o * p[2], o * p[3]]; + sml: function(o, g) { + return [o * g[0], o * g[1], o * g[2], o * g[3]]; } - }, _.encode.alphaMul = function(o, p) { + }, _.encode.alphaMul = function(o, g) { for (var E = new Uint8Array(o.length), u = o.length >> 2, A = 0; A < u; A++) { - var C = A << 2, L = o[C + 3]; - p && (L = L < 128 ? 0 : 255); - var D = L * (1 / 255); - E[C + 0] = o[C + 0] * D, E[C + 1] = o[C + 1] * D, E[C + 2] = o[C + 2] * D, E[C + 3] = L; + var L = A << 2, C = o[L + 3]; + g && (C = C < 128 ? 0 : 255); + var D = C * (1 / 255); + E[L + 0] = o[L + 0] * D, E[L + 1] = o[L + 1] * D, E[L + 2] = o[L + 2] * D, E[L + 3] = C; } return E; }; - }(l, g); + }(l, p); })(); } ), @@ -20484,7 +20484,7 @@ ATOM`, h); var l = e( /*! ./lib/utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ).assign, g = e( + ).assign, p = e( /*! ./lib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/deflate.js" ), _ = e( @@ -20494,7 +20494,7 @@ ATOM`, h); /*! ./lib/zlib/constants */ "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js" ), o = {}; - l(o, g, _, x), y.exports = o; + l(o, p, _, x), y.exports = o; } ), /***/ @@ -20507,7 +20507,7 @@ ATOM`, h); var l = e( /*! ./zlib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js" - ), g = e( + ), p = e( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), _ = e( @@ -20519,11 +20519,11 @@ ATOM`, h); ), o = e( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), p = Object.prototype.toString, E = 0, u = 4, A = 0, C = 1, L = 2, D = -1, r = 0, n = 8; + ), g = Object.prototype.toString, E = 0, u = 4, A = 0, L = 1, C = 2, D = -1, r = 0, n = 8; function b(a) { if (!(this instanceof b)) return new b(a); - this.options = g.assign({ + this.options = p.assign({ level: D, method: n, chunkSize: 16384, @@ -20546,7 +20546,7 @@ ATOM`, h); throw new Error(x[M]); if (h.header && l.deflateSetHeader(this.strm, h.header), h.dictionary) { var w; - if (typeof h.dictionary == "string" ? w = _.string2buf(h.dictionary) : p.call(h.dictionary) === "[object ArrayBuffer]" ? w = new Uint8Array(h.dictionary) : w = h.dictionary, M = l.deflateSetDictionary(this.strm, w), M !== A) + if (typeof h.dictionary == "string" ? w = _.string2buf(h.dictionary) : g.call(h.dictionary) === "[object ArrayBuffer]" ? w = new Uint8Array(h.dictionary) : w = h.dictionary, M = l.deflateSetDictionary(this.strm, w), M !== A) throw new Error(x[M]); this._dict_set = !0; } @@ -20555,17 +20555,17 @@ ATOM`, h); var M = this.strm, w = this.options.chunkSize, S, T; if (this.ended) return !1; - T = h === ~~h ? h : h === !0 ? u : E, typeof a == "string" ? M.input = _.string2buf(a) : p.call(a) === "[object ArrayBuffer]" ? M.input = new Uint8Array(a) : M.input = a, M.next_in = 0, M.avail_in = M.input.length; + T = h === ~~h ? h : h === !0 ? u : E, typeof a == "string" ? M.input = _.string2buf(a) : g.call(a) === "[object ArrayBuffer]" ? M.input = new Uint8Array(a) : M.input = a, M.next_in = 0, M.avail_in = M.input.length; do { - if (M.avail_out === 0 && (M.output = new g.Buf8(w), M.next_out = 0, M.avail_out = w), S = l.deflate(M, T), S !== C && S !== A) + if (M.avail_out === 0 && (M.output = new p.Buf8(w), M.next_out = 0, M.avail_out = w), S = l.deflate(M, T), S !== L && S !== A) return this.onEnd(S), this.ended = !0, !1; - (M.avail_out === 0 || M.avail_in === 0 && (T === u || T === L)) && (this.options.to === "string" ? this.onData(_.buf2binstring(g.shrinkBuf(M.output, M.next_out))) : this.onData(g.shrinkBuf(M.output, M.next_out))); - } while ((M.avail_in > 0 || M.avail_out === 0) && S !== C); - return T === u ? (S = l.deflateEnd(this.strm), this.onEnd(S), this.ended = !0, S === A) : (T === L && (this.onEnd(A), M.avail_out = 0), !0); + (M.avail_out === 0 || M.avail_in === 0 && (T === u || T === C)) && (this.options.to === "string" ? this.onData(_.buf2binstring(p.shrinkBuf(M.output, M.next_out))) : this.onData(p.shrinkBuf(M.output, M.next_out))); + } while ((M.avail_in > 0 || M.avail_out === 0) && S !== L); + return T === u ? (S = l.deflateEnd(this.strm), this.onEnd(S), this.ended = !0, S === A) : (T === C && (this.onEnd(A), M.avail_out = 0), !0); }, b.prototype.onData = function(a) { this.chunks.push(a); }, b.prototype.onEnd = function(a) { - a === A && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = g.flattenChunks(this.chunks)), this.chunks = [], this.err = a, this.msg = this.strm.msg; + a === A && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = p.flattenChunks(this.chunks)), this.chunks = [], this.err = a, this.msg = this.strm.msg; }; function f(a, h) { var M = new b(h); @@ -20592,7 +20592,7 @@ ATOM`, h); var l = e( /*! ./zlib/inflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js" - ), g = e( + ), p = e( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), _ = e( @@ -20604,7 +20604,7 @@ ATOM`, h); ), o = e( /*! ./zlib/messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), p = e( + ), g = e( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" ), E = e( @@ -20614,13 +20614,13 @@ ATOM`, h); function A(D) { if (!(this instanceof A)) return new A(D); - this.options = g.assign({ + this.options = p.assign({ chunkSize: 16384, windowBits: 0, to: "" }, D || {}); var r = this.options; - r.raw && r.windowBits >= 0 && r.windowBits < 16 && (r.windowBits = -r.windowBits, r.windowBits === 0 && (r.windowBits = -15)), r.windowBits >= 0 && r.windowBits < 16 && !(D && D.windowBits) && (r.windowBits += 32), r.windowBits > 15 && r.windowBits < 48 && (r.windowBits & 15 || (r.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new p(), this.strm.avail_out = 0; + r.raw && r.windowBits >= 0 && r.windowBits < 16 && (r.windowBits = -r.windowBits, r.windowBits === 0 && (r.windowBits = -15)), r.windowBits >= 0 && r.windowBits < 16 && !(D && D.windowBits) && (r.windowBits += 32), r.windowBits > 15 && r.windowBits < 48 && (r.windowBits & 15 || (r.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new g(), this.strm.avail_out = 0; var n = l.inflateInit2( this.strm, r.windowBits @@ -20636,26 +20636,26 @@ ATOM`, h); return !1; t = r === ~~r ? r : r === !0 ? x.Z_FINISH : x.Z_NO_FLUSH, typeof D == "string" ? n.input = _.binstring2buf(D) : u.call(D) === "[object ArrayBuffer]" ? n.input = new Uint8Array(D) : n.input = D, n.next_in = 0, n.avail_in = n.input.length; do { - if (n.avail_out === 0 && (n.output = new g.Buf8(b), n.next_out = 0, n.avail_out = b), c = l.inflate(n, x.Z_NO_FLUSH), c === x.Z_NEED_DICT && f && (c = l.inflateSetDictionary(this.strm, f)), c === x.Z_BUF_ERROR && w === !0 && (c = x.Z_OK, w = !1), c !== x.Z_STREAM_END && c !== x.Z_OK) + if (n.avail_out === 0 && (n.output = new p.Buf8(b), n.next_out = 0, n.avail_out = b), c = l.inflate(n, x.Z_NO_FLUSH), c === x.Z_NEED_DICT && f && (c = l.inflateSetDictionary(this.strm, f)), c === x.Z_BUF_ERROR && w === !0 && (c = x.Z_OK, w = !1), c !== x.Z_STREAM_END && c !== x.Z_OK) return this.onEnd(c), this.ended = !0, !1; - n.next_out && (n.avail_out === 0 || c === x.Z_STREAM_END || n.avail_in === 0 && (t === x.Z_FINISH || t === x.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (a = _.utf8border(n.output, n.next_out), h = n.next_out - a, M = _.buf2string(n.output, a), n.next_out = h, n.avail_out = b - h, h && g.arraySet(n.output, n.output, a, h, 0), this.onData(M)) : this.onData(g.shrinkBuf(n.output, n.next_out))), n.avail_in === 0 && n.avail_out === 0 && (w = !0); + n.next_out && (n.avail_out === 0 || c === x.Z_STREAM_END || n.avail_in === 0 && (t === x.Z_FINISH || t === x.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (a = _.utf8border(n.output, n.next_out), h = n.next_out - a, M = _.buf2string(n.output, a), n.next_out = h, n.avail_out = b - h, h && p.arraySet(n.output, n.output, a, h, 0), this.onData(M)) : this.onData(p.shrinkBuf(n.output, n.next_out))), n.avail_in === 0 && n.avail_out === 0 && (w = !0); } while ((n.avail_in > 0 || n.avail_out === 0) && c !== x.Z_STREAM_END); return c === x.Z_STREAM_END && (t = x.Z_FINISH), t === x.Z_FINISH ? (c = l.inflateEnd(this.strm), this.onEnd(c), this.ended = !0, c === x.Z_OK) : (t === x.Z_SYNC_FLUSH && (this.onEnd(x.Z_OK), n.avail_out = 0), !0); }, A.prototype.onData = function(D) { this.chunks.push(D); }, A.prototype.onEnd = function(D) { - D === x.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = g.flattenChunks(this.chunks)), this.chunks = [], this.err = D, this.msg = this.strm.msg; + D === x.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = p.flattenChunks(this.chunks)), this.chunks = [], this.err = D, this.msg = this.strm.msg; }; - function C(D, r) { + function L(D, r) { var n = new A(r); if (n.push(D, !0), n.err) throw n.msg || o[n.err]; return n.result; } - function L(D, r) { - return r = r || {}, r.raw = !0, C(D, r); + function C(D, r) { + return r = r || {}, r.raw = !0, L(D, r); } - s.Inflate = A, s.inflate = C, s.inflateRaw = L, s.ungzip = C; + s.Inflate = A, s.inflate = L, s.inflateRaw = C, s.ungzip = L; } ), /***/ @@ -20671,40 +20671,40 @@ ATOM`, h); } s.assign = function(x) { for (var o = Array.prototype.slice.call(arguments, 1); o.length; ) { - var p = o.shift(); - if (p) { - if (typeof p != "object") - throw new TypeError(p + "must be non-object"); - for (var E in p) - l(p, E) && (x[E] = p[E]); + var g = o.shift(); + if (g) { + if (typeof g != "object") + throw new TypeError(g + "must be non-object"); + for (var E in g) + l(g, E) && (x[E] = g[E]); } } return x; }, s.shrinkBuf = function(x, o) { return x.length === o ? x : x.subarray ? x.subarray(0, o) : (x.length = o, x); }; - var g = { - arraySet: function(x, o, p, E, u) { + var p = { + arraySet: function(x, o, g, E, u) { if (o.subarray && x.subarray) { - x.set(o.subarray(p, p + E), u); + x.set(o.subarray(g, g + E), u); return; } for (var A = 0; A < E; A++) - x[u + A] = o[p + A]; + x[u + A] = o[g + A]; }, // Join array of chunks to single array. flattenChunks: function(x) { - var o, p, E, u, A, C; - for (E = 0, o = 0, p = x.length; o < p; o++) + var o, g, E, u, A, L; + for (E = 0, o = 0, g = x.length; o < g; o++) E += x[o].length; - for (C = new Uint8Array(E), u = 0, o = 0, p = x.length; o < p; o++) - A = x[o], C.set(A, u), u += A.length; - return C; + for (L = new Uint8Array(E), u = 0, o = 0, g = x.length; o < g; o++) + A = x[o], L.set(A, u), u += A.length; + return L; } }, _ = { - arraySet: function(x, o, p, E, u) { + arraySet: function(x, o, g, E, u) { for (var A = 0; A < E; A++) - x[u + A] = o[p + A]; + x[u + A] = o[g + A]; }, // Join array of chunks to single array. flattenChunks: function(x) { @@ -20712,7 +20712,7 @@ ATOM`, h); } }; s.setTyped = function(x) { - x ? (s.Buf8 = Uint8Array, s.Buf16 = Uint16Array, s.Buf32 = Int32Array, s.assign(s, g)) : (s.Buf8 = Array, s.Buf16 = Array, s.Buf32 = Array, s.assign(s, _)); + x ? (s.Buf8 = Uint8Array, s.Buf16 = Uint16Array, s.Buf32 = Int32Array, s.assign(s, p)) : (s.Buf8 = Array, s.Buf16 = Array, s.Buf32 = Array, s.assign(s, _)); }, s.setTyped(e); } ), @@ -20726,11 +20726,11 @@ ATOM`, h); var l = e( /*! ./common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), g = !0, _ = !0; + ), p = !0, _ = !0; try { String.fromCharCode.apply(null, [0]); } catch { - g = !1; + p = !1; } try { String.fromCharCode.apply(null, new Uint8Array(1)); @@ -20740,46 +20740,46 @@ ATOM`, h); for (var x = new l.Buf8(256), o = 0; o < 256; o++) x[o] = o >= 252 ? 6 : o >= 248 ? 5 : o >= 240 ? 4 : o >= 224 ? 3 : o >= 192 ? 2 : 1; x[254] = x[254] = 1, s.string2buf = function(E) { - var u, A, C, L, D, r = E.length, n = 0; - for (L = 0; L < r; L++) - A = E.charCodeAt(L), (A & 64512) === 55296 && L + 1 < r && (C = E.charCodeAt(L + 1), (C & 64512) === 56320 && (A = 65536 + (A - 55296 << 10) + (C - 56320), L++)), n += A < 128 ? 1 : A < 2048 ? 2 : A < 65536 ? 3 : 4; - for (u = new l.Buf8(n), D = 0, L = 0; D < n; L++) - A = E.charCodeAt(L), (A & 64512) === 55296 && L + 1 < r && (C = E.charCodeAt(L + 1), (C & 64512) === 56320 && (A = 65536 + (A - 55296 << 10) + (C - 56320), L++)), A < 128 ? u[D++] = A : A < 2048 ? (u[D++] = 192 | A >>> 6, u[D++] = 128 | A & 63) : A < 65536 ? (u[D++] = 224 | A >>> 12, u[D++] = 128 | A >>> 6 & 63, u[D++] = 128 | A & 63) : (u[D++] = 240 | A >>> 18, u[D++] = 128 | A >>> 12 & 63, u[D++] = 128 | A >>> 6 & 63, u[D++] = 128 | A & 63); + var u, A, L, C, D, r = E.length, n = 0; + for (C = 0; C < r; C++) + A = E.charCodeAt(C), (A & 64512) === 55296 && C + 1 < r && (L = E.charCodeAt(C + 1), (L & 64512) === 56320 && (A = 65536 + (A - 55296 << 10) + (L - 56320), C++)), n += A < 128 ? 1 : A < 2048 ? 2 : A < 65536 ? 3 : 4; + for (u = new l.Buf8(n), D = 0, C = 0; D < n; C++) + A = E.charCodeAt(C), (A & 64512) === 55296 && C + 1 < r && (L = E.charCodeAt(C + 1), (L & 64512) === 56320 && (A = 65536 + (A - 55296 << 10) + (L - 56320), C++)), A < 128 ? u[D++] = A : A < 2048 ? (u[D++] = 192 | A >>> 6, u[D++] = 128 | A & 63) : A < 65536 ? (u[D++] = 224 | A >>> 12, u[D++] = 128 | A >>> 6 & 63, u[D++] = 128 | A & 63) : (u[D++] = 240 | A >>> 18, u[D++] = 128 | A >>> 12 & 63, u[D++] = 128 | A >>> 6 & 63, u[D++] = 128 | A & 63); return u; }; - function p(E, u) { - if (u < 65534 && (E.subarray && _ || !E.subarray && g)) + function g(E, u) { + if (u < 65534 && (E.subarray && _ || !E.subarray && p)) return String.fromCharCode.apply(null, l.shrinkBuf(E, u)); - for (var A = "", C = 0; C < u; C++) - A += String.fromCharCode(E[C]); + for (var A = "", L = 0; L < u; L++) + A += String.fromCharCode(E[L]); return A; } s.buf2binstring = function(E) { - return p(E, E.length); + return g(E, E.length); }, s.binstring2buf = function(E) { - for (var u = new l.Buf8(E.length), A = 0, C = u.length; A < C; A++) + for (var u = new l.Buf8(E.length), A = 0, L = u.length; A < L; A++) u[A] = E.charCodeAt(A); return u; }, s.buf2string = function(E, u) { - var A, C, L, D, r = u || E.length, n = new Array(r * 2); - for (C = 0, A = 0; A < r; ) { - if (L = E[A++], L < 128) { - n[C++] = L; + var A, L, C, D, r = u || E.length, n = new Array(r * 2); + for (L = 0, A = 0; A < r; ) { + if (C = E[A++], C < 128) { + n[L++] = C; continue; } - if (D = x[L], D > 4) { - n[C++] = 65533, A += D - 1; + if (D = x[C], D > 4) { + n[L++] = 65533, A += D - 1; continue; } - for (L &= D === 2 ? 31 : D === 3 ? 15 : 7; D > 1 && A < r; ) - L = L << 6 | E[A++] & 63, D--; + for (C &= D === 2 ? 31 : D === 3 ? 15 : 7; D > 1 && A < r; ) + C = C << 6 | E[A++] & 63, D--; if (D > 1) { - n[C++] = 65533; + n[L++] = 65533; continue; } - L < 65536 ? n[C++] = L : (L -= 65536, n[C++] = 55296 | L >> 10 & 1023, n[C++] = 56320 | L & 1023); + C < 65536 ? n[L++] = C : (C -= 65536, n[L++] = 55296 | C >> 10 & 1023, n[L++] = 56320 | C & 1023); } - return p(n, C); + return g(n, L); }, s.utf8border = function(E, u) { var A; for (u = u || E.length, u > E.length && (u = E.length), A = u - 1; A >= 0 && (E[A] & 192) === 128; ) @@ -20795,12 +20795,12 @@ ATOM`, h); \********************************************************************/ /***/ (y) => { - function s(e, l, g, _) { - for (var x = e & 65535 | 0, o = e >>> 16 & 65535 | 0, p = 0; g !== 0; ) { - p = g > 2e3 ? 2e3 : g, g -= p; + function s(e, l, p, _) { + for (var x = e & 65535 | 0, o = e >>> 16 & 65535 | 0, g = 0; p !== 0; ) { + g = p > 2e3 ? 2e3 : p, p -= g; do x = x + l[_++] | 0, o = o + x | 0; - while (--p); + while (--g); x %= 65521, o %= 65521; } return x | o << 16 | 0; @@ -20865,21 +20865,21 @@ ATOM`, h); /***/ (y) => { function s() { - for (var g, _ = [], x = 0; x < 256; x++) { - g = x; + for (var p, _ = [], x = 0; x < 256; x++) { + p = x; for (var o = 0; o < 8; o++) - g = g & 1 ? 3988292384 ^ g >>> 1 : g >>> 1; - _[x] = g; + p = p & 1 ? 3988292384 ^ p >>> 1 : p >>> 1; + _[x] = p; } return _; } var e = s(); - function l(g, _, x, o) { - var p = e, E = o + x; - g ^= -1; + function l(p, _, x, o) { + var g = e, E = o + x; + p ^= -1; for (var u = o; u < E; u++) - g = g >>> 8 ^ p[(g ^ _[u]) & 255]; - return g ^ -1; + p = p >>> 8 ^ g[(p ^ _[u]) & 255]; + return p ^ -1; } y.exports = l; } @@ -20894,7 +20894,7 @@ ATOM`, h); var l = e( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), g = e( + ), p = e( /*! ./trees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js" ), _ = e( @@ -20906,308 +20906,308 @@ ATOM`, h); ), o = e( /*! ./messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), p = 0, E = 1, u = 3, A = 4, C = 5, L = 0, D = 1, r = -2, n = -3, b = -5, f = -1, c = 1, t = 2, a = 3, h = 4, M = 0, w = 2, S = 8, T = 9, R = 15, z = 8, P = 29, B = 256, U = B + 1 + P, F = 30, $ = 19, W = 2 * U + 1, N = 15, G = 3, k = 258, j = k + G + 1, Q = 32, ie = 42, pe = 69, he = 73, ue = 91, se = 103, ae = 113, we = 666, xe = 1, Ie = 2, oe = 3, ve = 4, re = 3; + ), g = 0, E = 1, u = 3, A = 4, L = 5, C = 0, D = 1, r = -2, n = -3, b = -5, f = -1, c = 1, t = 2, a = 3, h = 4, M = 0, w = 2, S = 8, T = 9, R = 15, $ = 8, P = 29, B = 256, F = B + 1 + P, U = 30, z = 19, W = 2 * F + 1, V = 15, N = 3, k = 258, G = k + N + 1, Q = 32, ie = 42, ge = 69, le = 73, oe = 91, he = 103, se = 113, xe = 666, ye = 1, Pe = 2, de = 3, pe = 4, re = 3; function Se(I, me) { return I.msg = o[me], me; } - function ze(I) { + function ke(I) { return (I << 1) - (I > 4 ? 9 : 0); } - function Ge(I) { + function $e(I) { for (var me = I.length; --me >= 0; ) I[me] = 0; } - function $e(I) { - var me = I.state, ge = me.pending; - ge > I.avail_out && (ge = I.avail_out), ge !== 0 && (l.arraySet(I.output, me.pending_buf, me.pending_out, ge, I.next_out), I.next_out += ge, me.pending_out += ge, I.total_out += ge, I.avail_out -= ge, me.pending -= ge, me.pending === 0 && (me.pending_out = 0)); + function ze(I) { + var me = I.state, ve = me.pending; + ve > I.avail_out && (ve = I.avail_out), ve !== 0 && (l.arraySet(I.output, me.pending_buf, me.pending_out, ve, I.next_out), I.next_out += ve, me.pending_out += ve, I.total_out += ve, I.avail_out -= ve, me.pending -= ve, me.pending === 0 && (me.pending_out = 0)); } function Re(I, me) { - g._tr_flush_block(I, I.block_start >= 0 ? I.block_start : -1, I.strstart - I.block_start, me), I.block_start = I.strstart, $e(I.strm); + p._tr_flush_block(I, I.block_start >= 0 ? I.block_start : -1, I.strstart - I.block_start, me), I.block_start = I.strstart, ze(I.strm); } - function Be(I, me) { + function Fe(I, me) { I.pending_buf[I.pending++] = me; } - function ke(I, me) { + function Ie(I, me) { I.pending_buf[I.pending++] = me >>> 8 & 255, I.pending_buf[I.pending++] = me & 255; } - function We(I, me, ge, Y) { + function We(I, me, ve, X) { var ne = I.avail_in; - return ne > Y && (ne = Y), ne === 0 ? 0 : (I.avail_in -= ne, l.arraySet(me, I.input, I.next_in, ne, ge), I.state.wrap === 1 ? I.adler = _(I.adler, me, ne, ge) : I.state.wrap === 2 && (I.adler = x(I.adler, me, ne, ge)), I.next_in += ne, I.total_in += ne, ne); + return ne > X && (ne = X), ne === 0 ? 0 : (I.avail_in -= ne, l.arraySet(me, I.input, I.next_in, ne, ve), I.state.wrap === 1 ? I.adler = _(I.adler, me, ne, ve) : I.state.wrap === 2 && (I.adler = x(I.adler, me, ne, ve)), I.next_in += ne, I.total_in += ne, ne); } - function Te(I, me) { - var ge = I.max_chain_length, Y = I.strstart, ne, Ee, He = I.prev_length, Ke = I.nice_match, Ve = I.strstart > I.w_size - j ? I.strstart - (I.w_size - j) : 0, qe = I.window, wt = I.w_mask, nt = I.prev, rt = I.strstart + k, tt = qe[Y + He - 1], yt = qe[Y + He]; - I.prev_length >= I.good_match && (ge >>= 2), Ke > I.lookahead && (Ke = I.lookahead); + function Ue(I, me) { + var ve = I.max_chain_length, X = I.strstart, ne, Ee, He = I.prev_length, Ke = I.nice_match, je = I.strstart > I.w_size - G ? I.strstart - (I.w_size - G) : 0, qe = I.window, wt = I.w_mask, nt = I.prev, rt = I.strstart + k, tt = qe[X + He - 1], yt = qe[X + He]; + I.prev_length >= I.good_match && (ve >>= 2), Ke > I.lookahead && (Ke = I.lookahead); do - if (ne = me, !(qe[ne + He] !== yt || qe[ne + He - 1] !== tt || qe[ne] !== qe[Y] || qe[++ne] !== qe[Y + 1])) { - Y += 2, ne++; + if (ne = me, !(qe[ne + He] !== yt || qe[ne + He - 1] !== tt || qe[ne] !== qe[X] || qe[++ne] !== qe[X + 1])) { + X += 2, ne++; do ; - while (qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && qe[++Y] === qe[++ne] && Y < rt); - if (Ee = k - (rt - Y), Y = rt - k, Ee > He) { + while (qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && qe[++X] === qe[++ne] && X < rt); + if (Ee = k - (rt - X), X = rt - k, Ee > He) { if (I.match_start = me, He = Ee, Ee >= Ke) break; - tt = qe[Y + He - 1], yt = qe[Y + He]; + tt = qe[X + He - 1], yt = qe[X + He]; } } - while ((me = nt[me & wt]) > Ve && --ge !== 0); + while ((me = nt[me & wt]) > je && --ve !== 0); return He <= I.lookahead ? He : I.lookahead; } - function je(I) { - var me = I.w_size, ge, Y, ne, Ee, He; + function Be(I) { + var me = I.w_size, ve, X, ne, Ee, He; do { - if (Ee = I.window_size - I.lookahead - I.strstart, I.strstart >= me + (me - j)) { - l.arraySet(I.window, I.window, me, me, 0), I.match_start -= me, I.strstart -= me, I.block_start -= me, Y = I.hash_size, ge = Y; + if (Ee = I.window_size - I.lookahead - I.strstart, I.strstart >= me + (me - G)) { + l.arraySet(I.window, I.window, me, me, 0), I.match_start -= me, I.strstart -= me, I.block_start -= me, X = I.hash_size, ve = X; do - ne = I.head[--ge], I.head[ge] = ne >= me ? ne - me : 0; - while (--Y); - Y = me, ge = Y; + ne = I.head[--ve], I.head[ve] = ne >= me ? ne - me : 0; + while (--X); + X = me, ve = X; do - ne = I.prev[--ge], I.prev[ge] = ne >= me ? ne - me : 0; - while (--Y); + ne = I.prev[--ve], I.prev[ve] = ne >= me ? ne - me : 0; + while (--X); Ee += me; } if (I.strm.avail_in === 0) break; - if (Y = We(I.strm, I.window, I.strstart + I.lookahead, Ee), I.lookahead += Y, I.lookahead + I.insert >= G) - for (He = I.strstart - I.insert, I.ins_h = I.window[He], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[He + 1]) & I.hash_mask; I.insert && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[He + G - 1]) & I.hash_mask, I.prev[He & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = He, He++, I.insert--, !(I.lookahead + I.insert < G)); ) + if (X = We(I.strm, I.window, I.strstart + I.lookahead, Ee), I.lookahead += X, I.lookahead + I.insert >= N) + for (He = I.strstart - I.insert, I.ins_h = I.window[He], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[He + 1]) & I.hash_mask; I.insert && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[He + N - 1]) & I.hash_mask, I.prev[He & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = He, He++, I.insert--, !(I.lookahead + I.insert < N)); ) ; - } while (I.lookahead < j && I.strm.avail_in !== 0); + } while (I.lookahead < G && I.strm.avail_in !== 0); } - function Fe(I, me) { - var ge = 65535; - for (ge > I.pending_buf_size - 5 && (ge = I.pending_buf_size - 5); ; ) { + function Ne(I, me) { + var ve = 65535; + for (ve > I.pending_buf_size - 5 && (ve = I.pending_buf_size - 5); ; ) { if (I.lookahead <= 1) { - if (je(I), I.lookahead === 0 && me === p) - return xe; + if (Be(I), I.lookahead === 0 && me === g) + return ye; if (I.lookahead === 0) break; } I.strstart += I.lookahead, I.lookahead = 0; - var Y = I.block_start + ge; - if ((I.strstart === 0 || I.strstart >= Y) && (I.lookahead = I.strstart - Y, I.strstart = Y, Re(I, !1), I.strm.avail_out === 0) || I.strstart - I.block_start >= I.w_size - j && (Re(I, !1), I.strm.avail_out === 0)) - return xe; + var X = I.block_start + ve; + if ((I.strstart === 0 || I.strstart >= X) && (I.lookahead = I.strstart - X, I.strstart = X, Re(I, !1), I.strm.avail_out === 0) || I.strstart - I.block_start >= I.w_size - G && (Re(I, !1), I.strm.avail_out === 0)) + return ye; } - return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? oe : ve) : (I.strstart > I.block_start && (Re(I, !1), I.strm.avail_out === 0), xe); + return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? de : pe) : (I.strstart > I.block_start && (Re(I, !1), I.strm.avail_out === 0), ye); } - function X(I, me) { - for (var ge, Y; ; ) { - if (I.lookahead < j) { - if (je(I), I.lookahead < j && me === p) - return xe; + function H(I, me) { + for (var ve, X; ; ) { + if (I.lookahead < G) { + if (Be(I), I.lookahead < G && me === g) + return ye; if (I.lookahead === 0) break; } - if (ge = 0, I.lookahead >= G && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + G - 1]) & I.hash_mask, ge = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), ge !== 0 && I.strstart - ge <= I.w_size - j && (I.match_length = Te(I, ge)), I.match_length >= G) - if (Y = g._tr_tally(I, I.strstart - I.match_start, I.match_length - G), I.lookahead -= I.match_length, I.match_length <= I.max_lazy_match && I.lookahead >= G) { + if (ve = 0, I.lookahead >= N && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + N - 1]) & I.hash_mask, ve = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), ve !== 0 && I.strstart - ve <= I.w_size - G && (I.match_length = Ue(I, ve)), I.match_length >= N) + if (X = p._tr_tally(I, I.strstart - I.match_start, I.match_length - N), I.lookahead -= I.match_length, I.match_length <= I.max_lazy_match && I.lookahead >= N) { I.match_length--; do - I.strstart++, I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + G - 1]) & I.hash_mask, ge = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart; + I.strstart++, I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + N - 1]) & I.hash_mask, ve = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart; while (--I.match_length !== 0); I.strstart++; } else I.strstart += I.match_length, I.match_length = 0, I.ins_h = I.window[I.strstart], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + 1]) & I.hash_mask; else - Y = g._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++; - if (Y && (Re(I, !1), I.strm.avail_out === 0)) - return xe; + X = p._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++; + if (X && (Re(I, !1), I.strm.avail_out === 0)) + return ye; } - return I.insert = I.strstart < G - 1 ? I.strstart : G - 1, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? oe : ve) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? xe : Ie; + return I.insert = I.strstart < N - 1 ? I.strstart : N - 1, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? de : pe) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? ye : Pe; } - function Z(I, me) { - for (var ge, Y, ne; ; ) { - if (I.lookahead < j) { - if (je(I), I.lookahead < j && me === p) - return xe; + function K(I, me) { + for (var ve, X, ne; ; ) { + if (I.lookahead < G) { + if (Be(I), I.lookahead < G && me === g) + return ye; if (I.lookahead === 0) break; } - if (ge = 0, I.lookahead >= G && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + G - 1]) & I.hash_mask, ge = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), I.prev_length = I.match_length, I.prev_match = I.match_start, I.match_length = G - 1, ge !== 0 && I.prev_length < I.max_lazy_match && I.strstart - ge <= I.w_size - j && (I.match_length = Te(I, ge), I.match_length <= 5 && (I.strategy === c || I.match_length === G && I.strstart - I.match_start > 4096) && (I.match_length = G - 1)), I.prev_length >= G && I.match_length <= I.prev_length) { - ne = I.strstart + I.lookahead - G, Y = g._tr_tally(I, I.strstart - 1 - I.prev_match, I.prev_length - G), I.lookahead -= I.prev_length - 1, I.prev_length -= 2; + if (ve = 0, I.lookahead >= N && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + N - 1]) & I.hash_mask, ve = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), I.prev_length = I.match_length, I.prev_match = I.match_start, I.match_length = N - 1, ve !== 0 && I.prev_length < I.max_lazy_match && I.strstart - ve <= I.w_size - G && (I.match_length = Ue(I, ve), I.match_length <= 5 && (I.strategy === c || I.match_length === N && I.strstart - I.match_start > 4096) && (I.match_length = N - 1)), I.prev_length >= N && I.match_length <= I.prev_length) { + ne = I.strstart + I.lookahead - N, X = p._tr_tally(I, I.strstart - 1 - I.prev_match, I.prev_length - N), I.lookahead -= I.prev_length - 1, I.prev_length -= 2; do - ++I.strstart <= ne && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + G - 1]) & I.hash_mask, ge = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart); + ++I.strstart <= ne && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + N - 1]) & I.hash_mask, ve = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart); while (--I.prev_length !== 0); - if (I.match_available = 0, I.match_length = G - 1, I.strstart++, Y && (Re(I, !1), I.strm.avail_out === 0)) - return xe; + if (I.match_available = 0, I.match_length = N - 1, I.strstart++, X && (Re(I, !1), I.strm.avail_out === 0)) + return ye; } else if (I.match_available) { - if (Y = g._tr_tally(I, 0, I.window[I.strstart - 1]), Y && Re(I, !1), I.strstart++, I.lookahead--, I.strm.avail_out === 0) - return xe; + if (X = p._tr_tally(I, 0, I.window[I.strstart - 1]), X && Re(I, !1), I.strstart++, I.lookahead--, I.strm.avail_out === 0) + return ye; } else I.match_available = 1, I.strstart++, I.lookahead--; } - return I.match_available && (Y = g._tr_tally(I, 0, I.window[I.strstart - 1]), I.match_available = 0), I.insert = I.strstart < G - 1 ? I.strstart : G - 1, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? oe : ve) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? xe : Ie; + return I.match_available && (X = p._tr_tally(I, 0, I.window[I.strstart - 1]), I.match_available = 0), I.insert = I.strstart < N - 1 ? I.strstart : N - 1, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? de : pe) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? ye : Pe; } function q(I, me) { - for (var ge, Y, ne, Ee, He = I.window; ; ) { + for (var ve, X, ne, Ee, He = I.window; ; ) { if (I.lookahead <= k) { - if (je(I), I.lookahead <= k && me === p) - return xe; + if (Be(I), I.lookahead <= k && me === g) + return ye; if (I.lookahead === 0) break; } - if (I.match_length = 0, I.lookahead >= G && I.strstart > 0 && (ne = I.strstart - 1, Y = He[ne], Y === He[++ne] && Y === He[++ne] && Y === He[++ne])) { + if (I.match_length = 0, I.lookahead >= N && I.strstart > 0 && (ne = I.strstart - 1, X = He[ne], X === He[++ne] && X === He[++ne] && X === He[++ne])) { Ee = I.strstart + k; do ; - while (Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && Y === He[++ne] && ne < Ee); + while (X === He[++ne] && X === He[++ne] && X === He[++ne] && X === He[++ne] && X === He[++ne] && X === He[++ne] && X === He[++ne] && X === He[++ne] && ne < Ee); I.match_length = k - (Ee - ne), I.match_length > I.lookahead && (I.match_length = I.lookahead); } - if (I.match_length >= G ? (ge = g._tr_tally(I, 1, I.match_length - G), I.lookahead -= I.match_length, I.strstart += I.match_length, I.match_length = 0) : (ge = g._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++), ge && (Re(I, !1), I.strm.avail_out === 0)) - return xe; + if (I.match_length >= N ? (ve = p._tr_tally(I, 1, I.match_length - N), I.lookahead -= I.match_length, I.strstart += I.match_length, I.match_length = 0) : (ve = p._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++), ve && (Re(I, !1), I.strm.avail_out === 0)) + return ye; } - return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? oe : ve) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? xe : Ie; + return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? de : pe) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? ye : Pe; } function fe(I, me) { - for (var ge; ; ) { - if (I.lookahead === 0 && (je(I), I.lookahead === 0)) { - if (me === p) - return xe; + for (var ve; ; ) { + if (I.lookahead === 0 && (Be(I), I.lookahead === 0)) { + if (me === g) + return ye; break; } - if (I.match_length = 0, ge = g._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++, ge && (Re(I, !1), I.strm.avail_out === 0)) - return xe; + if (I.match_length = 0, ve = p._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++, ve && (Re(I, !1), I.strm.avail_out === 0)) + return ye; } - return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? oe : ve) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? xe : Ie; + return I.insert = 0, me === A ? (Re(I, !0), I.strm.avail_out === 0 ? de : pe) : I.last_lit && (Re(I, !1), I.strm.avail_out === 0) ? ye : Pe; } - function _e(I, me, ge, Y, ne) { - this.good_length = I, this.max_lazy = me, this.nice_length = ge, this.max_chain = Y, this.func = ne; + function _e(I, me, ve, X, ne) { + this.good_length = I, this.max_lazy = me, this.nice_length = ve, this.max_chain = X, this.func = ne; } var Me; Me = [ /* good lazy nice chain */ - new _e(0, 0, 0, 0, Fe), + new _e(0, 0, 0, 0, Ne), /* 0 store only */ - new _e(4, 4, 8, 4, X), + new _e(4, 4, 8, 4, H), /* 1 max speed, no lazy matches */ - new _e(4, 5, 16, 8, X), + new _e(4, 5, 16, 8, H), /* 2 */ - new _e(4, 6, 32, 32, X), + new _e(4, 6, 32, 32, H), /* 3 */ - new _e(4, 4, 16, 16, Z), + new _e(4, 4, 16, 16, K), /* 4 lazy matches */ - new _e(8, 16, 32, 32, Z), + new _e(8, 16, 32, 32, K), /* 5 */ - new _e(8, 16, 128, 128, Z), + new _e(8, 16, 128, 128, K), /* 6 */ - new _e(8, 32, 128, 256, Z), + new _e(8, 32, 128, 256, K), /* 7 */ - new _e(32, 128, 258, 1024, Z), + new _e(32, 128, 258, 1024, K), /* 8 */ - new _e(32, 258, 258, 4096, Z) + new _e(32, 258, 258, 4096, K) /* 9 max compression */ ]; function Ae(I) { - I.window_size = 2 * I.w_size, Ge(I.head), I.max_lazy_match = Me[I.level].max_lazy, I.good_match = Me[I.level].good_length, I.nice_match = Me[I.level].nice_length, I.max_chain_length = Me[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = G - 1, I.match_available = 0, I.ins_h = 0; + I.window_size = 2 * I.w_size, $e(I.head), I.max_lazy_match = Me[I.level].max_lazy, I.good_match = Me[I.level].good_length, I.nice_match = Me[I.level].nice_length, I.max_chain_length = Me[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = N - 1, I.match_available = 0, I.ins_h = 0; } - function H() { - 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 = S, 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 l.Buf16(W * 2), this.dyn_dtree = new l.Buf16((2 * F + 1) * 2), this.bl_tree = new l.Buf16((2 * $ + 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 l.Buf16(N + 1), this.heap = new l.Buf16(2 * U + 1), Ge(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new l.Buf16(2 * U + 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 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 = S, 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 l.Buf16(W * 2), this.dyn_dtree = new l.Buf16((2 * U + 1) * 2), this.bl_tree = new l.Buf16((2 * z + 1) * 2), $e(this.dyn_ltree), $e(this.dyn_dtree), $e(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new l.Buf16(V + 1), this.heap = new l.Buf16(2 * F + 1), $e(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new l.Buf16(2 * F + 1), $e(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(I) { + function ue(I) { var me; - return !I || !I.state ? Se(I, r) : (I.total_in = I.total_out = 0, I.data_type = w, me = I.state, me.pending = 0, me.pending_out = 0, me.wrap < 0 && (me.wrap = -me.wrap), me.status = me.wrap ? ie : ae, I.adler = me.wrap === 2 ? 0 : 1, me.last_flush = p, g._tr_init(me), L); + return !I || !I.state ? Se(I, r) : (I.total_in = I.total_out = 0, I.data_type = w, me = I.state, me.pending = 0, me.pending_out = 0, me.wrap < 0 && (me.wrap = -me.wrap), me.status = me.wrap ? ie : se, I.adler = me.wrap === 2 ? 0 : 1, me.last_flush = g, p._tr_init(me), C); } - function ye(I) { - var me = ce(I); - return me === L && Ae(I.state), me; + function we(I) { + var me = ue(I); + return me === C && Ae(I.state), me; } - function Pe(I, me) { - return !I || !I.state || I.state.wrap !== 2 ? r : (I.state.gzhead = me, L); + function Te(I, me) { + return !I || !I.state || I.state.wrap !== 2 ? r : (I.state.gzhead = me, C); } - function le(I, me, ge, Y, ne, Ee) { + function ae(I, me, ve, X, ne, Ee) { if (!I) return r; var He = 1; - if (me === f && (me = 6), Y < 0 ? (He = 0, Y = -Y) : Y > 15 && (He = 2, Y -= 16), ne < 1 || ne > T || ge !== S || Y < 8 || Y > 15 || me < 0 || me > 9 || Ee < 0 || Ee > h) + if (me === f && (me = 6), X < 0 ? (He = 0, X = -X) : X > 15 && (He = 2, X -= 16), ne < 1 || ne > T || ve !== S || X < 8 || X > 15 || me < 0 || me > 9 || Ee < 0 || Ee > h) return Se(I, r); - Y === 8 && (Y = 9); - var Ke = new H(); - return I.state = Ke, Ke.strm = I, Ke.wrap = He, Ke.gzhead = null, Ke.w_bits = Y, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = ne + 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 l.Buf8(Ke.w_size * 2), Ke.head = new l.Buf16(Ke.hash_size), Ke.prev = new l.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << ne + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new l.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = me, Ke.strategy = Ee, Ke.method = ge, ye(I); + X === 8 && (X = 9); + var Ke = new Z(); + return I.state = Ke, Ke.strm = I, Ke.wrap = He, Ke.gzhead = null, Ke.w_bits = X, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = ne + 7, Ke.hash_size = 1 << Ke.hash_bits, Ke.hash_mask = Ke.hash_size - 1, Ke.hash_shift = ~~((Ke.hash_bits + N - 1) / N), Ke.window = new l.Buf8(Ke.w_size * 2), Ke.head = new l.Buf16(Ke.hash_size), Ke.prev = new l.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << ne + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new l.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = me, Ke.strategy = Ee, Ke.method = ve, we(I); } function De(I, me) { - return le(I, me, S, R, z, M); + return ae(I, me, S, R, $, M); } - function K(I, me) { - var ge, Y, ne, Ee; - if (!I || !I.state || me > C || me < 0) + function Y(I, me) { + var ve, X, ne, Ee; + if (!I || !I.state || me > L || me < 0) return I ? Se(I, r) : r; - if (Y = I.state, !I.output || !I.input && I.avail_in !== 0 || Y.status === we && me !== A) + if (X = I.state, !I.output || !I.input && I.avail_in !== 0 || X.status === xe && me !== A) return Se(I, I.avail_out === 0 ? b : r); - if (Y.strm = I, ge = Y.last_flush, Y.last_flush = me, Y.status === ie) - if (Y.wrap === 2) - I.adler = 0, Be(Y, 31), Be(Y, 139), Be(Y, 8), Y.gzhead ? (Be( - Y, - (Y.gzhead.text ? 1 : 0) + (Y.gzhead.hcrc ? 2 : 0) + (Y.gzhead.extra ? 4 : 0) + (Y.gzhead.name ? 8 : 0) + (Y.gzhead.comment ? 16 : 0) - ), Be(Y, Y.gzhead.time & 255), Be(Y, Y.gzhead.time >> 8 & 255), Be(Y, Y.gzhead.time >> 16 & 255), Be(Y, Y.gzhead.time >> 24 & 255), Be(Y, Y.level === 9 ? 2 : Y.strategy >= t || Y.level < 2 ? 4 : 0), Be(Y, Y.gzhead.os & 255), Y.gzhead.extra && Y.gzhead.extra.length && (Be(Y, Y.gzhead.extra.length & 255), Be(Y, Y.gzhead.extra.length >> 8 & 255)), Y.gzhead.hcrc && (I.adler = x(I.adler, Y.pending_buf, Y.pending, 0)), Y.gzindex = 0, Y.status = pe) : (Be(Y, 0), Be(Y, 0), Be(Y, 0), Be(Y, 0), Be(Y, 0), Be(Y, Y.level === 9 ? 2 : Y.strategy >= t || Y.level < 2 ? 4 : 0), Be(Y, re), Y.status = ae); + if (X.strm = I, ve = X.last_flush, X.last_flush = me, X.status === ie) + if (X.wrap === 2) + I.adler = 0, Fe(X, 31), Fe(X, 139), Fe(X, 8), X.gzhead ? (Fe( + 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) + ), Fe(X, X.gzhead.time & 255), Fe(X, X.gzhead.time >> 8 & 255), Fe(X, X.gzhead.time >> 16 & 255), Fe(X, X.gzhead.time >> 24 & 255), Fe(X, X.level === 9 ? 2 : X.strategy >= t || X.level < 2 ? 4 : 0), Fe(X, X.gzhead.os & 255), X.gzhead.extra && X.gzhead.extra.length && (Fe(X, X.gzhead.extra.length & 255), Fe(X, X.gzhead.extra.length >> 8 & 255)), X.gzhead.hcrc && (I.adler = x(I.adler, X.pending_buf, X.pending, 0)), X.gzindex = 0, X.status = ge) : (Fe(X, 0), Fe(X, 0), Fe(X, 0), Fe(X, 0), Fe(X, 0), Fe(X, X.level === 9 ? 2 : X.strategy >= t || X.level < 2 ? 4 : 0), Fe(X, re), X.status = se); else { - var He = S + (Y.w_bits - 8 << 4) << 8, Ke = -1; - Y.strategy >= t || Y.level < 2 ? Ke = 0 : Y.level < 6 ? Ke = 1 : Y.level === 6 ? Ke = 2 : Ke = 3, He |= Ke << 6, Y.strstart !== 0 && (He |= Q), He += 31 - He % 31, Y.status = ae, ke(Y, He), Y.strstart !== 0 && (ke(Y, I.adler >>> 16), ke(Y, I.adler & 65535)), I.adler = 1; - } - if (Y.status === pe) - if (Y.gzhead.extra) { - for (ne = Y.pending; Y.gzindex < (Y.gzhead.extra.length & 65535) && !(Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), $e(I), ne = Y.pending, Y.pending === Y.pending_buf_size)); ) - Be(Y, Y.gzhead.extra[Y.gzindex] & 255), Y.gzindex++; - Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), Y.gzindex === Y.gzhead.extra.length && (Y.gzindex = 0, Y.status = he); + var He = S + (X.w_bits - 8 << 4) << 8, Ke = -1; + X.strategy >= t || X.level < 2 ? Ke = 0 : X.level < 6 ? Ke = 1 : X.level === 6 ? Ke = 2 : Ke = 3, He |= Ke << 6, X.strstart !== 0 && (He |= Q), He += 31 - He % 31, X.status = se, Ie(X, He), X.strstart !== 0 && (Ie(X, I.adler >>> 16), Ie(X, I.adler & 65535)), I.adler = 1; + } + if (X.status === ge) + if (X.gzhead.extra) { + for (ne = X.pending; X.gzindex < (X.gzhead.extra.length & 65535) && !(X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), ze(I), ne = X.pending, X.pending === X.pending_buf_size)); ) + Fe(X, X.gzhead.extra[X.gzindex] & 255), X.gzindex++; + X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), X.gzindex === X.gzhead.extra.length && (X.gzindex = 0, X.status = le); } else - Y.status = he; - if (Y.status === he) - if (Y.gzhead.name) { - ne = Y.pending; + X.status = le; + if (X.status === le) + if (X.gzhead.name) { + ne = X.pending; do { - if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), $e(I), ne = Y.pending, Y.pending === Y.pending_buf_size)) { + if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), ze(I), ne = X.pending, X.pending === X.pending_buf_size)) { Ee = 1; break; } - Y.gzindex < Y.gzhead.name.length ? Ee = Y.gzhead.name.charCodeAt(Y.gzindex++) & 255 : Ee = 0, Be(Y, Ee); + X.gzindex < X.gzhead.name.length ? Ee = X.gzhead.name.charCodeAt(X.gzindex++) & 255 : Ee = 0, Fe(X, Ee); } while (Ee !== 0); - Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), Ee === 0 && (Y.gzindex = 0, Y.status = ue); + X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), Ee === 0 && (X.gzindex = 0, X.status = oe); } else - Y.status = ue; - if (Y.status === ue) - if (Y.gzhead.comment) { - ne = Y.pending; + X.status = oe; + if (X.status === oe) + if (X.gzhead.comment) { + ne = X.pending; do { - if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), $e(I), ne = Y.pending, Y.pending === Y.pending_buf_size)) { + if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), ze(I), ne = X.pending, X.pending === X.pending_buf_size)) { Ee = 1; break; } - Y.gzindex < Y.gzhead.comment.length ? Ee = Y.gzhead.comment.charCodeAt(Y.gzindex++) & 255 : Ee = 0, Be(Y, Ee); + X.gzindex < X.gzhead.comment.length ? Ee = X.gzhead.comment.charCodeAt(X.gzindex++) & 255 : Ee = 0, Fe(X, Ee); } while (Ee !== 0); - Y.gzhead.hcrc && Y.pending > ne && (I.adler = x(I.adler, Y.pending_buf, Y.pending - ne, ne)), Ee === 0 && (Y.status = se); + X.gzhead.hcrc && X.pending > ne && (I.adler = x(I.adler, X.pending_buf, X.pending - ne, ne)), Ee === 0 && (X.status = he); } else - Y.status = se; - if (Y.status === se && (Y.gzhead.hcrc ? (Y.pending + 2 > Y.pending_buf_size && $e(I), Y.pending + 2 <= Y.pending_buf_size && (Be(Y, I.adler & 255), Be(Y, I.adler >> 8 & 255), I.adler = 0, Y.status = ae)) : Y.status = ae), Y.pending !== 0) { - if ($e(I), I.avail_out === 0) - return Y.last_flush = -1, L; - } else if (I.avail_in === 0 && ze(me) <= ze(ge) && me !== A) + X.status = he; + if (X.status === he && (X.gzhead.hcrc ? (X.pending + 2 > X.pending_buf_size && ze(I), X.pending + 2 <= X.pending_buf_size && (Fe(X, I.adler & 255), Fe(X, I.adler >> 8 & 255), I.adler = 0, X.status = se)) : X.status = se), X.pending !== 0) { + if (ze(I), I.avail_out === 0) + return X.last_flush = -1, C; + } else if (I.avail_in === 0 && ke(me) <= ke(ve) && me !== A) return Se(I, b); - if (Y.status === we && I.avail_in !== 0) + if (X.status === xe && I.avail_in !== 0) return Se(I, b); - if (I.avail_in !== 0 || Y.lookahead !== 0 || me !== p && Y.status !== we) { - var Ve = Y.strategy === t ? fe(Y, me) : Y.strategy === a ? q(Y, me) : Me[Y.level].func(Y, me); - if ((Ve === oe || Ve === ve) && (Y.status = we), Ve === xe || Ve === oe) - return I.avail_out === 0 && (Y.last_flush = -1), L; - if (Ve === Ie && (me === E ? g._tr_align(Y) : me !== C && (g._tr_stored_block(Y, 0, 0, !1), me === u && (Ge(Y.head), Y.lookahead === 0 && (Y.strstart = 0, Y.block_start = 0, Y.insert = 0))), $e(I), I.avail_out === 0)) - return Y.last_flush = -1, L; - } - return me !== A ? L : Y.wrap <= 0 ? D : (Y.wrap === 2 ? (Be(Y, I.adler & 255), Be(Y, I.adler >> 8 & 255), Be(Y, I.adler >> 16 & 255), Be(Y, I.adler >> 24 & 255), Be(Y, I.total_in & 255), Be(Y, I.total_in >> 8 & 255), Be(Y, I.total_in >> 16 & 255), Be(Y, I.total_in >> 24 & 255)) : (ke(Y, I.adler >>> 16), ke(Y, I.adler & 65535)), $e(I), Y.wrap > 0 && (Y.wrap = -Y.wrap), Y.pending !== 0 ? L : D); + if (I.avail_in !== 0 || X.lookahead !== 0 || me !== g && X.status !== xe) { + var je = X.strategy === t ? fe(X, me) : X.strategy === a ? q(X, me) : Me[X.level].func(X, me); + if ((je === de || je === pe) && (X.status = xe), je === ye || je === de) + return I.avail_out === 0 && (X.last_flush = -1), C; + if (je === Pe && (me === E ? p._tr_align(X) : me !== L && (p._tr_stored_block(X, 0, 0, !1), me === u && ($e(X.head), X.lookahead === 0 && (X.strstart = 0, X.block_start = 0, X.insert = 0))), ze(I), I.avail_out === 0)) + return X.last_flush = -1, C; + } + return me !== A ? C : X.wrap <= 0 ? D : (X.wrap === 2 ? (Fe(X, I.adler & 255), Fe(X, I.adler >> 8 & 255), Fe(X, I.adler >> 16 & 255), Fe(X, I.adler >> 24 & 255), Fe(X, I.total_in & 255), Fe(X, I.total_in >> 8 & 255), Fe(X, I.total_in >> 16 & 255), Fe(X, I.total_in >> 24 & 255)) : (Ie(X, I.adler >>> 16), Ie(X, I.adler & 65535)), ze(I), X.wrap > 0 && (X.wrap = -X.wrap), X.pending !== 0 ? C : D); } function Oe(I) { var me; - return !I || !I.state ? r : (me = I.state.status, me !== ie && me !== pe && me !== he && me !== ue && me !== se && me !== ae && me !== we ? Se(I, r) : (I.state = null, me === ae ? Se(I, n) : L)); + return !I || !I.state ? r : (me = I.state.status, me !== ie && me !== ge && me !== le && me !== oe && me !== he && me !== se && me !== xe ? Se(I, r) : (I.state = null, me === se ? Se(I, n) : C)); } - function Ne(I, me) { - var ge = me.length, Y, ne, Ee, He, Ke, Ve, qe, wt; - if (!I || !I.state || (Y = I.state, He = Y.wrap, He === 2 || He === 1 && Y.status !== ie || Y.lookahead)) + function Ve(I, me) { + var ve = me.length, X, ne, Ee, He, Ke, je, qe, wt; + if (!I || !I.state || (X = I.state, He = X.wrap, He === 2 || He === 1 && X.status !== ie || X.lookahead)) return r; - for (He === 1 && (I.adler = _(I.adler, me, ge, 0)), Y.wrap = 0, ge >= Y.w_size && (He === 0 && (Ge(Y.head), Y.strstart = 0, Y.block_start = 0, Y.insert = 0), wt = new l.Buf8(Y.w_size), l.arraySet(wt, me, ge - Y.w_size, Y.w_size, 0), me = wt, ge = Y.w_size), Ke = I.avail_in, Ve = I.next_in, qe = I.input, I.avail_in = ge, I.next_in = 0, I.input = me, je(Y); Y.lookahead >= G; ) { - ne = Y.strstart, Ee = Y.lookahead - (G - 1); + for (He === 1 && (I.adler = _(I.adler, me, ve, 0)), X.wrap = 0, ve >= X.w_size && (He === 0 && ($e(X.head), X.strstart = 0, X.block_start = 0, X.insert = 0), wt = new l.Buf8(X.w_size), l.arraySet(wt, me, ve - X.w_size, X.w_size, 0), me = wt, ve = X.w_size), Ke = I.avail_in, je = I.next_in, qe = I.input, I.avail_in = ve, I.next_in = 0, I.input = me, Be(X); X.lookahead >= N; ) { + ne = X.strstart, Ee = X.lookahead - (N - 1); do - Y.ins_h = (Y.ins_h << Y.hash_shift ^ Y.window[ne + G - 1]) & Y.hash_mask, Y.prev[ne & Y.w_mask] = Y.head[Y.ins_h], Y.head[Y.ins_h] = ne, ne++; + X.ins_h = (X.ins_h << X.hash_shift ^ X.window[ne + N - 1]) & X.hash_mask, X.prev[ne & X.w_mask] = X.head[X.ins_h], X.head[X.ins_h] = ne, ne++; while (--Ee); - Y.strstart = ne, Y.lookahead = G - 1, je(Y); + X.strstart = ne, X.lookahead = N - 1, Be(X); } - return Y.strstart += Y.lookahead, Y.block_start = Y.strstart, Y.insert = Y.lookahead, Y.lookahead = 0, Y.match_length = Y.prev_length = G - 1, Y.match_available = 0, I.next_in = Ve, I.input = qe, I.avail_in = Ke, Y.wrap = He, L; + return X.strstart += X.lookahead, X.block_start = X.strstart, X.insert = X.lookahead, X.lookahead = 0, X.match_length = X.prev_length = N - 1, X.match_available = 0, I.next_in = je, I.input = qe, I.avail_in = Ke, X.wrap = He, C; } - s.deflateInit = De, s.deflateInit2 = le, s.deflateReset = ye, s.deflateResetKeep = ce, s.deflateSetHeader = Pe, s.deflate = K, s.deflateEnd = Oe, s.deflateSetDictionary = Ne, s.deflateInfo = "pako deflate (from Nodeca project)"; + s.deflateInit = De, s.deflateInit2 = ae, s.deflateReset = we, s.deflateResetKeep = ue, s.deflateSetHeader = Te, s.deflate = Y, s.deflateEnd = Oe, s.deflateSetDictionary = Ve, s.deflateInfo = "pako deflate (from Nodeca project)"; } ), /***/ @@ -21231,9 +21231,9 @@ ATOM`, h); /***/ (y) => { var s = 30, e = 12; - y.exports = function(g, _) { - var x, o, p, E, u, A, C, L, D, r, n, b, f, c, t, a, h, M, w, S, T, R, z, P, B; - x = g.state, o = g.next_in, P = g.input, p = o + (g.avail_in - 5), E = g.next_out, B = g.output, u = E - (_ - g.avail_out), A = E + (g.avail_out - 257), C = x.dmax, L = x.wsize, D = x.whave, r = x.wnext, n = x.window, b = x.hold, f = x.bits, c = x.lencode, t = x.distcode, a = (1 << x.lenbits) - 1, h = (1 << x.distbits) - 1; + y.exports = function(p, _) { + var x, o, g, E, u, A, L, C, D, r, n, b, f, c, t, a, h, M, w, S, T, R, $, P, B; + x = p.state, o = p.next_in, P = p.input, g = o + (p.avail_in - 5), E = p.next_out, B = p.output, u = E - (_ - p.avail_out), A = E + (p.avail_out - 257), L = x.dmax, C = x.wsize, D = x.whave, r = x.wnext, n = x.window, b = x.hold, f = x.bits, c = x.lencode, t = x.distcode, a = (1 << x.lenbits) - 1, h = (1 << x.distbits) - 1; e: do { f < 15 && (b += P[o++] << f, f += 8, b += P[o++] << f, f += 8), M = c[b & a]; @@ -21246,25 +21246,25 @@ ATOM`, h); i: for (; ; ) { if (w = M >>> 24, b >>>= w, f -= w, w = M >>> 16 & 255, w & 16) { - if (T = M & 65535, w &= 15, f < w && (b += P[o++] << f, f += 8, f < w && (b += P[o++] << f, f += 8)), T += b & (1 << w) - 1, T > C) { - g.msg = "invalid distance too far back", x.mode = s; + if (T = M & 65535, w &= 15, f < w && (b += P[o++] << f, f += 8, f < w && (b += P[o++] << f, f += 8)), T += b & (1 << w) - 1, T > L) { + p.msg = "invalid distance too far back", x.mode = s; break e; } if (b >>>= w, f -= w, w = E - u, T > w) { if (w = T - w, w > D && x.sane) { - g.msg = "invalid distance too far back", x.mode = s; + p.msg = "invalid distance too far back", x.mode = s; break e; } - if (R = 0, z = n, r === 0) { - if (R += L - w, w < S) { + if (R = 0, $ = n, r === 0) { + if (R += C - w, w < S) { S -= w; do B[E++] = n[R++]; while (--w); - R = E - T, z = B; + R = E - T, $ = B; } } else if (r < w) { - if (R += L + r - w, w -= r, w < S) { + if (R += C + r - w, w -= r, w < S) { S -= w; do B[E++] = n[R++]; @@ -21274,7 +21274,7 @@ ATOM`, h); do B[E++] = n[R++]; while (--w); - R = E - T, z = B; + R = E - T, $ = B; } } } else if (R += r - w, w < S) { @@ -21282,11 +21282,11 @@ ATOM`, h); do B[E++] = n[R++]; while (--w); - R = E - T, z = B; + R = E - T, $ = B; } for (; S > 2; ) - B[E++] = z[R++], B[E++] = z[R++], B[E++] = z[R++], S -= 3; - S && (B[E++] = z[R++], S > 1 && (B[E++] = z[R++])); + B[E++] = $[R++], B[E++] = $[R++], B[E++] = $[R++], S -= 3; + S && (B[E++] = $[R++], S > 1 && (B[E++] = $[R++])); } else { R = E - T; do @@ -21295,7 +21295,7 @@ ATOM`, h); S && (B[E++] = B[R++], S > 1 && (B[E++] = B[R++])); } } else if (w & 64) { - g.msg = "invalid distance code", x.mode = s; + p.msg = "invalid distance code", x.mode = s; break e; } else { M = t[(M & 65535) + (b & (1 << w) - 1)]; @@ -21308,7 +21308,7 @@ ATOM`, h); x.mode = e; break e; } else { - g.msg = "invalid literal/length code", x.mode = s; + p.msg = "invalid literal/length code", x.mode = s; break e; } else { @@ -21317,8 +21317,8 @@ ATOM`, h); } break; } - } while (o < p && E < A); - S = f >> 3, o -= S, f -= S << 3, b &= (1 << f) - 1, g.next_in = o, g.next_out = E, g.avail_in = o < p ? 5 + (p - o) : 5 - (o - p), g.avail_out = E < A ? 257 + (A - E) : 257 - (E - A), x.hold = b, x.bits = f; + } while (o < g && E < A); + S = f >> 3, o -= S, f -= S << 3, b &= (1 << f) - 1, p.next_in = o, p.next_out = E, p.avail_in = o < g ? 5 + (g - o) : 5 - (o - g), p.avail_out = E < A ? 257 + (A - E) : 257 - (E - A), x.hold = b, x.bits = f; }; } ), @@ -21332,7 +21332,7 @@ ATOM`, h); var l = e( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), g = e( + ), p = e( /*! ./adler32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js" ), _ = e( @@ -21344,470 +21344,470 @@ ATOM`, h); ), o = e( /*! ./inftrees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js" - ), p = 0, E = 1, u = 2, A = 4, C = 5, L = 6, D = 0, r = 1, n = 2, b = -2, f = -3, c = -4, t = -5, a = 8, h = 1, M = 2, w = 3, S = 4, T = 5, R = 6, z = 7, P = 8, B = 9, U = 10, F = 11, $ = 12, W = 13, N = 14, G = 15, k = 16, j = 17, Q = 18, ie = 19, pe = 20, he = 21, ue = 22, se = 23, ae = 24, we = 25, xe = 26, Ie = 27, oe = 28, ve = 29, re = 30, Se = 31, ze = 32, Ge = 852, $e = 592, Re = 15, Be = Re; - function ke(le) { - return (le >>> 24 & 255) + (le >>> 8 & 65280) + ((le & 65280) << 8) + ((le & 255) << 24); + ), g = 0, E = 1, u = 2, A = 4, L = 5, C = 6, D = 0, r = 1, n = 2, b = -2, f = -3, c = -4, t = -5, a = 8, h = 1, M = 2, w = 3, S = 4, T = 5, R = 6, $ = 7, P = 8, B = 9, F = 10, U = 11, z = 12, W = 13, V = 14, N = 15, k = 16, G = 17, Q = 18, ie = 19, ge = 20, le = 21, oe = 22, he = 23, se = 24, xe = 25, ye = 26, Pe = 27, de = 28, pe = 29, re = 30, Se = 31, ke = 32, $e = 852, ze = 592, Re = 15, Fe = Re; + function Ie(ae) { + return (ae >>> 24 & 255) + (ae >>> 8 & 65280) + ((ae & 65280) << 8) + ((ae & 255) << 24); } function We() { 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 l.Buf16(320), this.work = new l.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } - function Te(le) { + function Ue(ae) { var De; - return !le || !le.state ? b : (De = le.state, le.total_in = le.total_out = De.total = 0, le.msg = "", De.wrap && (le.adler = De.wrap & 1), De.mode = h, De.last = 0, De.havedict = 0, De.dmax = 32768, De.head = null, De.hold = 0, De.bits = 0, De.lencode = De.lendyn = new l.Buf32(Ge), De.distcode = De.distdyn = new l.Buf32($e), De.sane = 1, De.back = -1, D); + return !ae || !ae.state ? b : (De = ae.state, ae.total_in = ae.total_out = De.total = 0, ae.msg = "", De.wrap && (ae.adler = De.wrap & 1), De.mode = h, De.last = 0, De.havedict = 0, De.dmax = 32768, De.head = null, De.hold = 0, De.bits = 0, De.lencode = De.lendyn = new l.Buf32($e), De.distcode = De.distdyn = new l.Buf32(ze), De.sane = 1, De.back = -1, D); } - function je(le) { + function Be(ae) { var De; - return !le || !le.state ? b : (De = le.state, De.wsize = 0, De.whave = 0, De.wnext = 0, Te(le)); + return !ae || !ae.state ? b : (De = ae.state, De.wsize = 0, De.whave = 0, De.wnext = 0, Ue(ae)); } - function Fe(le, De) { - var K, Oe; - return !le || !le.state || (Oe = le.state, De < 0 ? (K = 0, De = -De) : (K = (De >> 4) + 1, De < 48 && (De &= 15)), De && (De < 8 || De > 15)) ? b : (Oe.window !== null && Oe.wbits !== De && (Oe.window = null), Oe.wrap = K, Oe.wbits = De, je(le)); + function Ne(ae, De) { + var Y, Oe; + return !ae || !ae.state || (Oe = ae.state, De < 0 ? (Y = 0, De = -De) : (Y = (De >> 4) + 1, De < 48 && (De &= 15)), De && (De < 8 || De > 15)) ? b : (Oe.window !== null && Oe.wbits !== De && (Oe.window = null), Oe.wrap = Y, Oe.wbits = De, Be(ae)); } - function X(le, De) { - var K, Oe; - return le ? (Oe = new We(), le.state = Oe, Oe.window = null, K = Fe(le, De), K !== D && (le.state = null), K) : b; + function H(ae, De) { + var Y, Oe; + return ae ? (Oe = new We(), ae.state = Oe, Oe.window = null, Y = Ne(ae, De), Y !== D && (ae.state = null), Y) : b; } - function Z(le) { - return X(le, Be); + function K(ae) { + return H(ae, Fe); } var q = !0, fe, _e; - function Me(le) { + function Me(ae) { if (q) { var De; for (fe = new l.Buf32(512), _e = new l.Buf32(32), De = 0; De < 144; ) - le.lens[De++] = 8; + ae.lens[De++] = 8; for (; De < 256; ) - le.lens[De++] = 9; + ae.lens[De++] = 9; for (; De < 280; ) - le.lens[De++] = 7; + ae.lens[De++] = 7; for (; De < 288; ) - le.lens[De++] = 8; - for (o(E, le.lens, 0, 288, fe, 0, le.work, { bits: 9 }), De = 0; De < 32; ) - le.lens[De++] = 5; - o(u, le.lens, 0, 32, _e, 0, le.work, { bits: 5 }), q = !1; + ae.lens[De++] = 8; + for (o(E, ae.lens, 0, 288, fe, 0, ae.work, { bits: 9 }), De = 0; De < 32; ) + ae.lens[De++] = 5; + o(u, ae.lens, 0, 32, _e, 0, ae.work, { bits: 5 }), q = !1; } - le.lencode = fe, le.lenbits = 9, le.distcode = _e, le.distbits = 5; + ae.lencode = fe, ae.lenbits = 9, ae.distcode = _e, ae.distbits = 5; } - function Ae(le, De, K, Oe) { - var Ne, I = le.state; - return I.window === null && (I.wsize = 1 << I.wbits, I.wnext = 0, I.whave = 0, I.window = new l.Buf8(I.wsize)), Oe >= I.wsize ? (l.arraySet(I.window, De, K - I.wsize, I.wsize, 0), I.wnext = 0, I.whave = I.wsize) : (Ne = I.wsize - I.wnext, Ne > Oe && (Ne = Oe), l.arraySet(I.window, De, K - Oe, Ne, I.wnext), Oe -= Ne, Oe ? (l.arraySet(I.window, De, K - Oe, Oe, 0), I.wnext = Oe, I.whave = I.wsize) : (I.wnext += Ne, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += Ne))), 0; + function Ae(ae, De, Y, Oe) { + var Ve, I = ae.state; + return I.window === null && (I.wsize = 1 << I.wbits, I.wnext = 0, I.whave = 0, I.window = new l.Buf8(I.wsize)), Oe >= I.wsize ? (l.arraySet(I.window, De, Y - I.wsize, I.wsize, 0), I.wnext = 0, I.whave = I.wsize) : (Ve = I.wsize - I.wnext, Ve > Oe && (Ve = Oe), l.arraySet(I.window, De, Y - Oe, Ve, I.wnext), Oe -= Ve, Oe ? (l.arraySet(I.window, De, Y - Oe, Oe, 0), I.wnext = Oe, I.whave = I.wsize) : (I.wnext += Ve, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += Ve))), 0; } - function H(le, De) { - var K, Oe, Ne, I, me, ge, Y, ne, Ee, He, Ke, Ve, qe, wt, nt = 0, rt, tt, yt, _t, It, Ot, vt, mt, gt = new l.Buf8(4), Ct, Mt, Ft = ( + function Z(ae, De) { + var Y, Oe, Ve, I, me, ve, X, ne, Ee, He, Ke, je, qe, wt, nt = 0, rt, tt, yt, _t, It, Ot, vt, mt, pt = new l.Buf8(4), Ct, Mt, Ft = ( /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] ); - if (!le || !le.state || !le.output || !le.input && le.avail_in !== 0) + if (!ae || !ae.state || !ae.output || !ae.input && ae.avail_in !== 0) return b; - K = le.state, K.mode === $ && (K.mode = W), me = le.next_out, Ne = le.output, Y = le.avail_out, I = le.next_in, Oe = le.input, ge = le.avail_in, ne = K.hold, Ee = K.bits, He = ge, Ke = Y, mt = D; + Y = ae.state, Y.mode === z && (Y.mode = W), me = ae.next_out, Ve = ae.output, X = ae.avail_out, I = ae.next_in, Oe = ae.input, ve = ae.avail_in, ne = Y.hold, Ee = Y.bits, He = ve, Ke = X, mt = D; e: for (; ; ) - switch (K.mode) { + switch (Y.mode) { case h: - if (K.wrap === 0) { - K.mode = W; + if (Y.wrap === 0) { + Y.mode = W; break; } for (; Ee < 16; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (K.wrap & 2 && ne === 35615) { - K.check = 0, gt[0] = ne & 255, gt[1] = ne >>> 8 & 255, K.check = _(K.check, gt, 2, 0), ne = 0, Ee = 0, K.mode = M; + if (Y.wrap & 2 && ne === 35615) { + Y.check = 0, pt[0] = ne & 255, pt[1] = ne >>> 8 & 255, Y.check = _(Y.check, pt, 2, 0), ne = 0, Ee = 0, Y.mode = M; break; } - if (K.flags = 0, K.head && (K.head.done = !1), !(K.wrap & 1) || /* check if zlib header allowed */ + if (Y.flags = 0, Y.head && (Y.head.done = !1), !(Y.wrap & 1) || /* check if zlib header allowed */ (((ne & 255) << 8) + (ne >> 8)) % 31) { - le.msg = "incorrect header check", K.mode = re; + ae.msg = "incorrect header check", Y.mode = re; break; } if ((ne & 15) !== a) { - le.msg = "unknown compression method", K.mode = re; + ae.msg = "unknown compression method", Y.mode = re; break; } - if (ne >>>= 4, Ee -= 4, vt = (ne & 15) + 8, K.wbits === 0) - K.wbits = vt; - else if (vt > K.wbits) { - le.msg = "invalid window size", K.mode = re; + if (ne >>>= 4, Ee -= 4, vt = (ne & 15) + 8, Y.wbits === 0) + Y.wbits = vt; + else if (vt > Y.wbits) { + ae.msg = "invalid window size", Y.mode = re; break; } - K.dmax = 1 << vt, le.adler = K.check = 1, K.mode = ne & 512 ? U : $, ne = 0, Ee = 0; + Y.dmax = 1 << vt, ae.adler = Y.check = 1, Y.mode = ne & 512 ? F : z, ne = 0, Ee = 0; break; case M: for (; Ee < 16; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (K.flags = ne, (K.flags & 255) !== a) { - le.msg = "unknown compression method", K.mode = re; + if (Y.flags = ne, (Y.flags & 255) !== a) { + ae.msg = "unknown compression method", Y.mode = re; break; } - if (K.flags & 57344) { - le.msg = "unknown header flags set", K.mode = re; + if (Y.flags & 57344) { + ae.msg = "unknown header flags set", Y.mode = re; break; } - K.head && (K.head.text = ne >> 8 & 1), K.flags & 512 && (gt[0] = ne & 255, gt[1] = ne >>> 8 & 255, K.check = _(K.check, gt, 2, 0)), ne = 0, Ee = 0, K.mode = w; + Y.head && (Y.head.text = ne >> 8 & 1), Y.flags & 512 && (pt[0] = ne & 255, pt[1] = ne >>> 8 & 255, Y.check = _(Y.check, pt, 2, 0)), ne = 0, Ee = 0, Y.mode = w; case w: for (; Ee < 32; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.head && (K.head.time = ne), K.flags & 512 && (gt[0] = ne & 255, gt[1] = ne >>> 8 & 255, gt[2] = ne >>> 16 & 255, gt[3] = ne >>> 24 & 255, K.check = _(K.check, gt, 4, 0)), ne = 0, Ee = 0, K.mode = S; + Y.head && (Y.head.time = ne), Y.flags & 512 && (pt[0] = ne & 255, pt[1] = ne >>> 8 & 255, pt[2] = ne >>> 16 & 255, pt[3] = ne >>> 24 & 255, Y.check = _(Y.check, pt, 4, 0)), ne = 0, Ee = 0, Y.mode = S; case S: for (; Ee < 16; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.head && (K.head.xflags = ne & 255, K.head.os = ne >> 8), K.flags & 512 && (gt[0] = ne & 255, gt[1] = ne >>> 8 & 255, K.check = _(K.check, gt, 2, 0)), ne = 0, Ee = 0, K.mode = T; + Y.head && (Y.head.xflags = ne & 255, Y.head.os = ne >> 8), Y.flags & 512 && (pt[0] = ne & 255, pt[1] = ne >>> 8 & 255, Y.check = _(Y.check, pt, 2, 0)), ne = 0, Ee = 0, Y.mode = T; case T: - if (K.flags & 1024) { + if (Y.flags & 1024) { for (; Ee < 16; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.length = ne, K.head && (K.head.extra_len = ne), K.flags & 512 && (gt[0] = ne & 255, gt[1] = ne >>> 8 & 255, K.check = _(K.check, gt, 2, 0)), ne = 0, Ee = 0; + Y.length = ne, Y.head && (Y.head.extra_len = ne), Y.flags & 512 && (pt[0] = ne & 255, pt[1] = ne >>> 8 & 255, Y.check = _(Y.check, pt, 2, 0)), ne = 0, Ee = 0; } else - K.head && (K.head.extra = null); - K.mode = R; + Y.head && (Y.head.extra = null); + Y.mode = R; case R: - if (K.flags & 1024 && (Ve = K.length, Ve > ge && (Ve = ge), Ve && (K.head && (vt = K.head.extra_len - K.length, K.head.extra || (K.head.extra = new Array(K.head.extra_len)), l.arraySet( - K.head.extra, + if (Y.flags & 1024 && (je = Y.length, je > ve && (je = ve), je && (Y.head && (vt = Y.head.extra_len - Y.length, Y.head.extra || (Y.head.extra = new Array(Y.head.extra_len)), l.arraySet( + Y.head.extra, Oe, I, // extra field is limited to 65536 bytes // - no need for additional size check - Ve, + je, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ vt - )), K.flags & 512 && (K.check = _(K.check, Oe, Ve, I)), ge -= Ve, I += Ve, K.length -= Ve), K.length)) + )), Y.flags & 512 && (Y.check = _(Y.check, Oe, je, I)), ve -= je, I += je, Y.length -= je), Y.length)) break e; - K.length = 0, K.mode = z; - case z: - if (K.flags & 2048) { - if (ge === 0) + Y.length = 0, Y.mode = $; + case $: + if (Y.flags & 2048) { + if (ve === 0) break e; - Ve = 0; + je = 0; do - vt = Oe[I + Ve++], K.head && vt && K.length < 65536 && (K.head.name += String.fromCharCode(vt)); - while (vt && Ve < ge); - if (K.flags & 512 && (K.check = _(K.check, Oe, Ve, I)), ge -= Ve, I += Ve, vt) + vt = Oe[I + je++], Y.head && vt && Y.length < 65536 && (Y.head.name += String.fromCharCode(vt)); + while (vt && je < ve); + if (Y.flags & 512 && (Y.check = _(Y.check, Oe, je, I)), ve -= je, I += je, vt) break e; } else - K.head && (K.head.name = null); - K.length = 0, K.mode = P; + Y.head && (Y.head.name = null); + Y.length = 0, Y.mode = P; case P: - if (K.flags & 4096) { - if (ge === 0) + if (Y.flags & 4096) { + if (ve === 0) break e; - Ve = 0; + je = 0; do - vt = Oe[I + Ve++], K.head && vt && K.length < 65536 && (K.head.comment += String.fromCharCode(vt)); - while (vt && Ve < ge); - if (K.flags & 512 && (K.check = _(K.check, Oe, Ve, I)), ge -= Ve, I += Ve, vt) + vt = Oe[I + je++], Y.head && vt && Y.length < 65536 && (Y.head.comment += String.fromCharCode(vt)); + while (vt && je < ve); + if (Y.flags & 512 && (Y.check = _(Y.check, Oe, je, I)), ve -= je, I += je, vt) break e; } else - K.head && (K.head.comment = null); - K.mode = B; + Y.head && (Y.head.comment = null); + Y.mode = B; case B: - if (K.flags & 512) { + if (Y.flags & 512) { for (; Ee < 16; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (ne !== (K.check & 65535)) { - le.msg = "header crc mismatch", K.mode = re; + if (ne !== (Y.check & 65535)) { + ae.msg = "header crc mismatch", Y.mode = re; break; } ne = 0, Ee = 0; } - K.head && (K.head.hcrc = K.flags >> 9 & 1, K.head.done = !0), le.adler = K.check = 0, K.mode = $; + Y.head && (Y.head.hcrc = Y.flags >> 9 & 1, Y.head.done = !0), ae.adler = Y.check = 0, Y.mode = z; break; - case U: + case F: for (; Ee < 32; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - le.adler = K.check = ke(ne), ne = 0, Ee = 0, K.mode = F; - case F: - if (K.havedict === 0) - return le.next_out = me, le.avail_out = Y, le.next_in = I, le.avail_in = ge, K.hold = ne, K.bits = Ee, n; - le.adler = K.check = 1, K.mode = $; - case $: - if (De === C || De === L) + ae.adler = Y.check = Ie(ne), ne = 0, Ee = 0, Y.mode = U; + case U: + if (Y.havedict === 0) + return ae.next_out = me, ae.avail_out = X, ae.next_in = I, ae.avail_in = ve, Y.hold = ne, Y.bits = Ee, n; + ae.adler = Y.check = 1, Y.mode = z; + case z: + if (De === L || De === C) break e; case W: - if (K.last) { - ne >>>= Ee & 7, Ee -= Ee & 7, K.mode = Ie; + if (Y.last) { + ne >>>= Ee & 7, Ee -= Ee & 7, Y.mode = Pe; break; } for (; Ee < 3; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - switch (K.last = ne & 1, ne >>>= 1, Ee -= 1, ne & 3) { + switch (Y.last = ne & 1, ne >>>= 1, Ee -= 1, ne & 3) { case 0: - K.mode = N; + Y.mode = V; break; case 1: - if (Me(K), K.mode = pe, De === L) { + if (Me(Y), Y.mode = ge, De === C) { ne >>>= 2, Ee -= 2; break e; } break; case 2: - K.mode = j; + Y.mode = G; break; case 3: - le.msg = "invalid block type", K.mode = re; + ae.msg = "invalid block type", Y.mode = re; } ne >>>= 2, Ee -= 2; break; - case N: + case V: for (ne >>>= Ee & 7, Ee -= Ee & 7; Ee < 32; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } if ((ne & 65535) !== (ne >>> 16 ^ 65535)) { - le.msg = "invalid stored block lengths", K.mode = re; + ae.msg = "invalid stored block lengths", Y.mode = re; break; } - if (K.length = ne & 65535, ne = 0, Ee = 0, K.mode = G, De === L) + if (Y.length = ne & 65535, ne = 0, Ee = 0, Y.mode = N, De === C) break e; - case G: - K.mode = k; + case N: + Y.mode = k; case k: - if (Ve = K.length, Ve) { - if (Ve > ge && (Ve = ge), Ve > Y && (Ve = Y), Ve === 0) + if (je = Y.length, je) { + if (je > ve && (je = ve), je > X && (je = X), je === 0) break e; - l.arraySet(Ne, Oe, I, Ve, me), ge -= Ve, I += Ve, Y -= Ve, me += Ve, K.length -= Ve; + l.arraySet(Ve, Oe, I, je, me), ve -= je, I += je, X -= je, me += je, Y.length -= je; break; } - K.mode = $; + Y.mode = z; break; - case j: + case G: for (; Ee < 14; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (K.nlen = (ne & 31) + 257, ne >>>= 5, Ee -= 5, K.ndist = (ne & 31) + 1, ne >>>= 5, Ee -= 5, K.ncode = (ne & 15) + 4, ne >>>= 4, Ee -= 4, K.nlen > 286 || K.ndist > 30) { - le.msg = "too many length or distance symbols", K.mode = re; + if (Y.nlen = (ne & 31) + 257, ne >>>= 5, Ee -= 5, Y.ndist = (ne & 31) + 1, ne >>>= 5, Ee -= 5, Y.ncode = (ne & 15) + 4, ne >>>= 4, Ee -= 4, Y.nlen > 286 || Y.ndist > 30) { + ae.msg = "too many length or distance symbols", Y.mode = re; break; } - K.have = 0, K.mode = Q; + Y.have = 0, Y.mode = Q; case Q: - for (; K.have < K.ncode; ) { + for (; Y.have < Y.ncode; ) { for (; Ee < 3; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.lens[Ft[K.have++]] = ne & 7, ne >>>= 3, Ee -= 3; + Y.lens[Ft[Y.have++]] = ne & 7, ne >>>= 3, Ee -= 3; } - for (; K.have < 19; ) - K.lens[Ft[K.have++]] = 0; - if (K.lencode = K.lendyn, K.lenbits = 7, Ct = { bits: K.lenbits }, mt = o(p, K.lens, 0, 19, K.lencode, 0, K.work, Ct), K.lenbits = Ct.bits, mt) { - le.msg = "invalid code lengths set", K.mode = re; + for (; Y.have < 19; ) + Y.lens[Ft[Y.have++]] = 0; + if (Y.lencode = Y.lendyn, Y.lenbits = 7, Ct = { bits: Y.lenbits }, mt = o(g, Y.lens, 0, 19, Y.lencode, 0, Y.work, Ct), Y.lenbits = Ct.bits, mt) { + ae.msg = "invalid code lengths set", Y.mode = re; break; } - K.have = 0, K.mode = ie; + Y.have = 0, Y.mode = ie; case ie: - for (; K.have < K.nlen + K.ndist; ) { - for (; nt = K.lencode[ne & (1 << K.lenbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { - if (ge === 0) + for (; Y.have < Y.nlen + Y.ndist; ) { + for (; nt = Y.lencode[ne & (1 << Y.lenbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } if (yt < 16) - ne >>>= rt, Ee -= rt, K.lens[K.have++] = yt; + ne >>>= rt, Ee -= rt, Y.lens[Y.have++] = yt; else { if (yt === 16) { for (Mt = rt + 2; Ee < Mt; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (ne >>>= rt, Ee -= rt, K.have === 0) { - le.msg = "invalid bit length repeat", K.mode = re; + if (ne >>>= rt, Ee -= rt, Y.have === 0) { + ae.msg = "invalid bit length repeat", Y.mode = re; break; } - vt = K.lens[K.have - 1], Ve = 3 + (ne & 3), ne >>>= 2, Ee -= 2; + vt = Y.lens[Y.have - 1], je = 3 + (ne & 3), ne >>>= 2, Ee -= 2; } else if (yt === 17) { for (Mt = rt + 3; Ee < Mt; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - ne >>>= rt, Ee -= rt, vt = 0, Ve = 3 + (ne & 7), ne >>>= 3, Ee -= 3; + ne >>>= rt, Ee -= rt, vt = 0, je = 3 + (ne & 7), ne >>>= 3, Ee -= 3; } else { for (Mt = rt + 7; Ee < Mt; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - ne >>>= rt, Ee -= rt, vt = 0, Ve = 11 + (ne & 127), ne >>>= 7, Ee -= 7; + ne >>>= rt, Ee -= rt, vt = 0, je = 11 + (ne & 127), ne >>>= 7, Ee -= 7; } - if (K.have + Ve > K.nlen + K.ndist) { - le.msg = "invalid bit length repeat", K.mode = re; + if (Y.have + je > Y.nlen + Y.ndist) { + ae.msg = "invalid bit length repeat", Y.mode = re; break; } - for (; Ve--; ) - K.lens[K.have++] = vt; + for (; je--; ) + Y.lens[Y.have++] = vt; } } - if (K.mode === re) + if (Y.mode === re) break; - if (K.lens[256] === 0) { - le.msg = "invalid code -- missing end-of-block", K.mode = re; + if (Y.lens[256] === 0) { + ae.msg = "invalid code -- missing end-of-block", Y.mode = re; break; } - if (K.lenbits = 9, Ct = { bits: K.lenbits }, mt = o(E, K.lens, 0, K.nlen, K.lencode, 0, K.work, Ct), K.lenbits = Ct.bits, mt) { - le.msg = "invalid literal/lengths set", K.mode = re; + if (Y.lenbits = 9, Ct = { bits: Y.lenbits }, mt = o(E, Y.lens, 0, Y.nlen, Y.lencode, 0, Y.work, Ct), Y.lenbits = Ct.bits, mt) { + ae.msg = "invalid literal/lengths set", Y.mode = re; break; } - if (K.distbits = 6, K.distcode = K.distdyn, Ct = { bits: K.distbits }, mt = o(u, K.lens, K.nlen, K.ndist, K.distcode, 0, K.work, Ct), K.distbits = Ct.bits, mt) { - le.msg = "invalid distances set", K.mode = re; + if (Y.distbits = 6, Y.distcode = Y.distdyn, Ct = { bits: Y.distbits }, mt = o(u, Y.lens, Y.nlen, Y.ndist, Y.distcode, 0, Y.work, Ct), Y.distbits = Ct.bits, mt) { + ae.msg = "invalid distances set", Y.mode = re; break; } - if (K.mode = pe, De === L) + if (Y.mode = ge, De === C) break e; - case pe: - K.mode = he; - case he: - if (ge >= 6 && Y >= 258) { - le.next_out = me, le.avail_out = Y, le.next_in = I, le.avail_in = ge, K.hold = ne, K.bits = Ee, x(le, Ke), me = le.next_out, Ne = le.output, Y = le.avail_out, I = le.next_in, Oe = le.input, ge = le.avail_in, ne = K.hold, Ee = K.bits, K.mode === $ && (K.back = -1); + case ge: + Y.mode = le; + case le: + if (ve >= 6 && X >= 258) { + ae.next_out = me, ae.avail_out = X, ae.next_in = I, ae.avail_in = ve, Y.hold = ne, Y.bits = Ee, x(ae, Ke), me = ae.next_out, Ve = ae.output, X = ae.avail_out, I = ae.next_in, Oe = ae.input, ve = ae.avail_in, ne = Y.hold, Ee = Y.bits, Y.mode === z && (Y.back = -1); break; } - for (K.back = 0; nt = K.lencode[ne & (1 << K.lenbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { - if (ge === 0) + for (Y.back = 0; nt = Y.lencode[ne & (1 << Y.lenbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } if (tt && !(tt & 240)) { - for (_t = rt, It = tt, Ot = yt; nt = K.lencode[Ot + ((ne & (1 << _t + It) - 1) >> _t)], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(_t + rt <= Ee); ) { - if (ge === 0) + for (_t = rt, It = tt, Ot = yt; nt = Y.lencode[Ot + ((ne & (1 << _t + It) - 1) >> _t)], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(_t + rt <= Ee); ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - ne >>>= _t, Ee -= _t, K.back += _t; + ne >>>= _t, Ee -= _t, Y.back += _t; } - if (ne >>>= rt, Ee -= rt, K.back += rt, K.length = yt, tt === 0) { - K.mode = xe; + if (ne >>>= rt, Ee -= rt, Y.back += rt, Y.length = yt, tt === 0) { + Y.mode = ye; break; } if (tt & 32) { - K.back = -1, K.mode = $; + Y.back = -1, Y.mode = z; break; } if (tt & 64) { - le.msg = "invalid literal/length code", K.mode = re; + ae.msg = "invalid literal/length code", Y.mode = re; break; } - K.extra = tt & 15, K.mode = ue; - case ue: - if (K.extra) { - for (Mt = K.extra; Ee < Mt; ) { - if (ge === 0) + Y.extra = tt & 15, Y.mode = oe; + case oe: + if (Y.extra) { + for (Mt = Y.extra; Ee < Mt; ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.length += ne & (1 << K.extra) - 1, ne >>>= K.extra, Ee -= K.extra, K.back += K.extra; + Y.length += ne & (1 << Y.extra) - 1, ne >>>= Y.extra, Ee -= Y.extra, Y.back += Y.extra; } - K.was = K.length, K.mode = se; - case se: - for (; nt = K.distcode[ne & (1 << K.distbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { - if (ge === 0) + Y.was = Y.length, Y.mode = he; + case he: + for (; nt = Y.distcode[ne & (1 << Y.distbits) - 1], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(rt <= Ee); ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } if (!(tt & 240)) { - for (_t = rt, It = tt, Ot = yt; nt = K.distcode[Ot + ((ne & (1 << _t + It) - 1) >> _t)], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(_t + rt <= Ee); ) { - if (ge === 0) + for (_t = rt, It = tt, Ot = yt; nt = Y.distcode[Ot + ((ne & (1 << _t + It) - 1) >> _t)], rt = nt >>> 24, tt = nt >>> 16 & 255, yt = nt & 65535, !(_t + rt <= Ee); ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - ne >>>= _t, Ee -= _t, K.back += _t; + ne >>>= _t, Ee -= _t, Y.back += _t; } - if (ne >>>= rt, Ee -= rt, K.back += rt, tt & 64) { - le.msg = "invalid distance code", K.mode = re; + if (ne >>>= rt, Ee -= rt, Y.back += rt, tt & 64) { + ae.msg = "invalid distance code", Y.mode = re; break; } - K.offset = yt, K.extra = tt & 15, K.mode = ae; - case ae: - if (K.extra) { - for (Mt = K.extra; Ee < Mt; ) { - if (ge === 0) + Y.offset = yt, Y.extra = tt & 15, Y.mode = se; + case se: + if (Y.extra) { + for (Mt = Y.extra; Ee < Mt; ) { + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - K.offset += ne & (1 << K.extra) - 1, ne >>>= K.extra, Ee -= K.extra, K.back += K.extra; + Y.offset += ne & (1 << Y.extra) - 1, ne >>>= Y.extra, Ee -= Y.extra, Y.back += Y.extra; } - if (K.offset > K.dmax) { - le.msg = "invalid distance too far back", K.mode = re; + if (Y.offset > Y.dmax) { + ae.msg = "invalid distance too far back", Y.mode = re; break; } - K.mode = we; - case we: - if (Y === 0) + Y.mode = xe; + case xe: + if (X === 0) break e; - if (Ve = Ke - Y, K.offset > Ve) { - if (Ve = K.offset - Ve, Ve > K.whave && K.sane) { - le.msg = "invalid distance too far back", K.mode = re; + if (je = Ke - X, Y.offset > je) { + if (je = Y.offset - je, je > Y.whave && Y.sane) { + ae.msg = "invalid distance too far back", Y.mode = re; break; } - Ve > K.wnext ? (Ve -= K.wnext, qe = K.wsize - Ve) : qe = K.wnext - Ve, Ve > K.length && (Ve = K.length), wt = K.window; + je > Y.wnext ? (je -= Y.wnext, qe = Y.wsize - je) : qe = Y.wnext - je, je > Y.length && (je = Y.length), wt = Y.window; } else - wt = Ne, qe = me - K.offset, Ve = K.length; - Ve > Y && (Ve = Y), Y -= Ve, K.length -= Ve; + wt = Ve, qe = me - Y.offset, je = Y.length; + je > X && (je = X), X -= je, Y.length -= je; do - Ne[me++] = wt[qe++]; - while (--Ve); - K.length === 0 && (K.mode = he); + Ve[me++] = wt[qe++]; + while (--je); + Y.length === 0 && (Y.mode = le); break; - case xe: - if (Y === 0) + case ye: + if (X === 0) break e; - Ne[me++] = K.length, Y--, K.mode = he; + Ve[me++] = Y.length, X--, Y.mode = le; break; - case Ie: - if (K.wrap) { + case Pe: + if (Y.wrap) { for (; Ee < 32; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne |= Oe[I++] << Ee, Ee += 8; + ve--, ne |= Oe[I++] << Ee, Ee += 8; } - if (Ke -= Y, le.total_out += Ke, K.total += Ke, Ke && (le.adler = K.check = /*UPDATE(state.check, put - _out, _out);*/ - K.flags ? _(K.check, Ne, Ke, me - Ke) : g(K.check, Ne, Ke, me - Ke)), Ke = Y, (K.flags ? ne : ke(ne)) !== K.check) { - le.msg = "incorrect data check", K.mode = re; + if (Ke -= X, ae.total_out += Ke, Y.total += Ke, Ke && (ae.adler = Y.check = /*UPDATE(state.check, put - _out, _out);*/ + Y.flags ? _(Y.check, Ve, Ke, me - Ke) : p(Y.check, Ve, Ke, me - Ke)), Ke = X, (Y.flags ? ne : Ie(ne)) !== Y.check) { + ae.msg = "incorrect data check", Y.mode = re; break; } ne = 0, Ee = 0; } - K.mode = oe; - case oe: - if (K.wrap && K.flags) { + Y.mode = de; + case de: + if (Y.wrap && Y.flags) { for (; Ee < 32; ) { - if (ge === 0) + if (ve === 0) break e; - ge--, ne += Oe[I++] << Ee, Ee += 8; + ve--, ne += Oe[I++] << Ee, Ee += 8; } - if (ne !== (K.total & 4294967295)) { - le.msg = "incorrect length check", K.mode = re; + if (ne !== (Y.total & 4294967295)) { + ae.msg = "incorrect length check", Y.mode = re; break; } ne = 0, Ee = 0; } - K.mode = ve; - case ve: + Y.mode = pe; + case pe: mt = r; break e; case re: @@ -21815,28 +21815,28 @@ ATOM`, h); break e; case Se: return c; - case ze: + case ke: default: return b; } - return le.next_out = me, le.avail_out = Y, le.next_in = I, le.avail_in = ge, K.hold = ne, K.bits = Ee, (K.wsize || Ke !== le.avail_out && K.mode < re && (K.mode < Ie || De !== A)) && Ae(le, le.output, le.next_out, Ke - le.avail_out), He -= le.avail_in, Ke -= le.avail_out, le.total_in += He, le.total_out += Ke, K.total += Ke, K.wrap && Ke && (le.adler = K.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - K.flags ? _(K.check, Ne, Ke, le.next_out - Ke) : g(K.check, Ne, Ke, le.next_out - Ke)), le.data_type = K.bits + (K.last ? 64 : 0) + (K.mode === $ ? 128 : 0) + (K.mode === pe || K.mode === G ? 256 : 0), (He === 0 && Ke === 0 || De === A) && mt === D && (mt = t), mt; + return ae.next_out = me, ae.avail_out = X, ae.next_in = I, ae.avail_in = ve, Y.hold = ne, Y.bits = Ee, (Y.wsize || Ke !== ae.avail_out && Y.mode < re && (Y.mode < Pe || De !== A)) && Ae(ae, ae.output, ae.next_out, Ke - ae.avail_out), He -= ae.avail_in, Ke -= ae.avail_out, ae.total_in += He, ae.total_out += Ke, Y.total += Ke, Y.wrap && Ke && (ae.adler = Y.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + Y.flags ? _(Y.check, Ve, Ke, ae.next_out - Ke) : p(Y.check, Ve, Ke, ae.next_out - Ke)), ae.data_type = Y.bits + (Y.last ? 64 : 0) + (Y.mode === z ? 128 : 0) + (Y.mode === ge || Y.mode === N ? 256 : 0), (He === 0 && Ke === 0 || De === A) && mt === D && (mt = t), mt; } - function ce(le) { - if (!le || !le.state) + function ue(ae) { + if (!ae || !ae.state) return b; - var De = le.state; - return De.window && (De.window = null), le.state = null, D; + var De = ae.state; + return De.window && (De.window = null), ae.state = null, D; } - function ye(le, De) { - var K; - return !le || !le.state || (K = le.state, !(K.wrap & 2)) ? b : (K.head = De, De.done = !1, D); + function we(ae, De) { + var Y; + return !ae || !ae.state || (Y = ae.state, !(Y.wrap & 2)) ? b : (Y.head = De, De.done = !1, D); } - function Pe(le, De) { - var K = De.length, Oe, Ne, I; - return !le || !le.state || (Oe = le.state, Oe.wrap !== 0 && Oe.mode !== F) ? b : Oe.mode === F && (Ne = 1, Ne = g(Ne, De, K, 0), Ne !== Oe.check) ? f : (I = Ae(le, De, K, K), I ? (Oe.mode = Se, c) : (Oe.havedict = 1, D)); + function Te(ae, De) { + var Y = De.length, Oe, Ve, I; + return !ae || !ae.state || (Oe = ae.state, Oe.wrap !== 0 && Oe.mode !== U) ? b : Oe.mode === U && (Ve = 1, Ve = p(Ve, De, Y, 0), Ve !== Oe.check) ? f : (I = Ae(ae, De, Y, Y), I ? (Oe.mode = Se, c) : (Oe.havedict = 1, D)); } - s.inflateReset = je, s.inflateReset2 = Fe, s.inflateResetKeep = Te, s.inflateInit = Z, s.inflateInit2 = X, s.inflate = H, s.inflateEnd = ce, s.inflateGetHeader = ye, s.inflateSetDictionary = Pe, s.inflateInfo = "pako inflate (from Nodeca project)"; + s.inflateReset = Be, s.inflateReset2 = Ne, s.inflateResetKeep = Ue, s.inflateInit = K, s.inflateInit2 = H, s.inflate = Z, s.inflateEnd = ue, s.inflateGetHeader = we, s.inflateSetDictionary = Te, s.inflateInfo = "pako inflate (from Nodeca project)"; } ), /***/ @@ -21849,7 +21849,7 @@ ATOM`, h); var l = e( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), g = 15, _ = 852, x = 592, o = 0, p = 1, E = 2, u = [ + ), p = 15, _ = 852, x = 592, o = 0, g = 1, E = 2, u = [ /* Length codes 257..285 base */ 3, 4, @@ -21915,7 +21915,7 @@ ATOM`, h); 16, 72, 78 - ], C = [ + ], L = [ /* Distance codes 0..29 base */ 1, 2, @@ -21949,7 +21949,7 @@ ATOM`, h); 24577, 0, 0 - ], L = [ + ], C = [ /* Distance codes 0..29 extra */ 16, 16, @@ -21985,49 +21985,49 @@ ATOM`, h); 64 ]; y.exports = function(r, n, b, f, c, t, a, h) { - var M = h.bits, w = 0, S = 0, T = 0, R = 0, z = 0, P = 0, B = 0, U = 0, F = 0, $ = 0, W, N, G, k, j, Q = null, ie = 0, pe, he = new l.Buf16(g + 1), ue = new l.Buf16(g + 1), se = null, ae = 0, we, xe, Ie; - for (w = 0; w <= g; w++) - he[w] = 0; + var M = h.bits, w = 0, S = 0, T = 0, R = 0, $ = 0, P = 0, B = 0, F = 0, U = 0, z = 0, W, V, N, k, G, Q = null, ie = 0, ge, le = new l.Buf16(p + 1), oe = new l.Buf16(p + 1), he = null, se = 0, xe, ye, Pe; + for (w = 0; w <= p; w++) + le[w] = 0; for (S = 0; S < f; S++) - he[n[b + S]]++; - for (z = M, R = g; R >= 1 && he[R] === 0; R--) + le[n[b + S]]++; + for ($ = M, R = p; R >= 1 && le[R] === 0; R--) ; - if (z > R && (z = R), R === 0) + if ($ > R && ($ = R), R === 0) return c[t++] = 20971520, c[t++] = 20971520, h.bits = 1, 0; - for (T = 1; T < R && he[T] === 0; T++) + for (T = 1; T < R && le[T] === 0; T++) ; - for (z < T && (z = T), U = 1, w = 1; w <= g; w++) - if (U <<= 1, U -= he[w], U < 0) + for ($ < T && ($ = T), F = 1, w = 1; w <= p; w++) + if (F <<= 1, F -= le[w], F < 0) return -1; - if (U > 0 && (r === o || R !== 1)) + if (F > 0 && (r === o || R !== 1)) return -1; - for (ue[1] = 0, w = 1; w < g; w++) - ue[w + 1] = ue[w] + he[w]; + for (oe[1] = 0, w = 1; w < p; w++) + oe[w + 1] = oe[w] + le[w]; for (S = 0; S < f; S++) - n[b + S] !== 0 && (a[ue[n[b + S]]++] = S); - if (r === o ? (Q = se = a, pe = 19) : r === p ? (Q = u, ie -= 257, se = A, ae -= 257, pe = 256) : (Q = C, se = L, pe = -1), $ = 0, S = 0, w = T, j = t, P = z, B = 0, G = -1, F = 1 << z, k = F - 1, r === p && F > _ || r === E && F > x) + n[b + S] !== 0 && (a[oe[n[b + S]]++] = S); + if (r === o ? (Q = he = a, ge = 19) : r === g ? (Q = u, ie -= 257, he = A, se -= 257, ge = 256) : (Q = L, he = C, ge = -1), z = 0, S = 0, w = T, G = t, P = $, B = 0, N = -1, U = 1 << $, k = U - 1, r === g && U > _ || r === E && U > x) return 1; for (; ; ) { - we = w - B, a[S] < pe ? (xe = 0, Ie = a[S]) : a[S] > pe ? (xe = se[ae + a[S]], Ie = Q[ie + a[S]]) : (xe = 96, Ie = 0), W = 1 << w - B, N = 1 << P, T = N; + xe = w - B, a[S] < ge ? (ye = 0, Pe = a[S]) : a[S] > ge ? (ye = he[se + a[S]], Pe = Q[ie + a[S]]) : (ye = 96, Pe = 0), W = 1 << w - B, V = 1 << P, T = V; do - N -= W, c[j + ($ >> B) + N] = we << 24 | xe << 16 | Ie | 0; - while (N !== 0); - for (W = 1 << w - 1; $ & W; ) + V -= W, c[G + (z >> B) + V] = xe << 24 | ye << 16 | Pe | 0; + while (V !== 0); + for (W = 1 << w - 1; z & W; ) W >>= 1; - if (W !== 0 ? ($ &= W - 1, $ += W) : $ = 0, S++, --he[w] === 0) { + if (W !== 0 ? (z &= W - 1, z += W) : z = 0, S++, --le[w] === 0) { if (w === R) break; w = n[b + a[S]]; } - if (w > z && ($ & k) !== G) { - for (B === 0 && (B = z), j += T, P = w - B, U = 1 << P; P + B < R && (U -= he[P + B], !(U <= 0)); ) - P++, U <<= 1; - if (F += 1 << P, r === p && F > _ || r === E && F > x) + if (w > $ && (z & k) !== N) { + for (B === 0 && (B = $), G += T, P = w - B, F = 1 << P; P + B < R && (F -= le[P + B], !(F <= 0)); ) + P++, F <<= 1; + if (U += 1 << P, r === g && U > _ || r === E && U > x) return 1; - G = $ & k, c[G] = z << 24 | P << 16 | j - t | 0; + N = z & k, c[N] = $ << 24 | P << 16 | G - t | 0; } } - return $ !== 0 && (c[j + $] = w - B << 24 | 4194304 | 0), h.bits = z, 0; + return z !== 0 && (c[G + z] = w - B << 24 | 4194304 | 0), h.bits = $, 0; }; } ), @@ -22070,247 +22070,247 @@ ATOM`, h); var l = e( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), g = 4, _ = 0, x = 1, o = 2; - function p(H) { - for (var ce = H.length; --ce >= 0; ) - H[ce] = 0; + ), p = 4, _ = 0, x = 1, o = 2; + function g(Z) { + for (var ue = Z.length; --ue >= 0; ) + Z[ue] = 0; } - var E = 0, u = 1, A = 2, C = 3, L = 258, D = 29, r = 256, n = r + 1 + D, b = 30, f = 19, c = 2 * n + 1, t = 15, a = 16, h = 7, M = 256, w = 16, S = 17, T = 18, R = ( + var E = 0, u = 1, A = 2, L = 3, C = 258, D = 29, r = 256, n = r + 1 + D, b = 30, f = 19, c = 2 * n + 1, t = 15, a = 16, h = 7, M = 256, w = 16, S = 17, T = 18, R = ( /* 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 = ( + ), $ = ( /* 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], U = 512, F = new Array((n + 2) * 2); - p(F); - var $ = new Array(b * 2); - p($); - var W = new Array(U); - p(W); - var N = new Array(L - C + 1); - p(N); - var G = new Array(D); - p(G); + ), B = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], F = 512, U = new Array((n + 2) * 2); + g(U); + var z = new Array(b * 2); + g(z); + var W = new Array(F); + g(W); + var V = new Array(C - L + 1); + g(V); + var N = new Array(D); + g(N); var k = new Array(b); - p(k); - function j(H, ce, ye, Pe, le) { - this.static_tree = H, this.extra_bits = ce, this.extra_base = ye, this.elems = Pe, this.max_length = le, this.has_stree = H && H.length; + g(k); + function G(Z, ue, we, Te, ae) { + this.static_tree = Z, this.extra_bits = ue, this.extra_base = we, this.elems = Te, this.max_length = ae, this.has_stree = Z && Z.length; } - var Q, ie, pe; - function he(H, ce) { - this.dyn_tree = H, this.max_code = 0, this.stat_desc = ce; + var Q, ie, ge; + function le(Z, ue) { + this.dyn_tree = Z, this.max_code = 0, this.stat_desc = ue; } - function ue(H) { - return H < 256 ? W[H] : W[256 + (H >>> 7)]; + function oe(Z) { + return Z < 256 ? W[Z] : W[256 + (Z >>> 7)]; } - function se(H, ce) { - H.pending_buf[H.pending++] = ce & 255, H.pending_buf[H.pending++] = ce >>> 8 & 255; + function he(Z, ue) { + Z.pending_buf[Z.pending++] = ue & 255, Z.pending_buf[Z.pending++] = ue >>> 8 & 255; } - function ae(H, ce, ye) { - H.bi_valid > a - ye ? (H.bi_buf |= ce << H.bi_valid & 65535, se(H, H.bi_buf), H.bi_buf = ce >> a - H.bi_valid, H.bi_valid += ye - a) : (H.bi_buf |= ce << H.bi_valid & 65535, H.bi_valid += ye); + function se(Z, ue, we) { + Z.bi_valid > a - we ? (Z.bi_buf |= ue << Z.bi_valid & 65535, he(Z, Z.bi_buf), Z.bi_buf = ue >> a - Z.bi_valid, Z.bi_valid += we - a) : (Z.bi_buf |= ue << Z.bi_valid & 65535, Z.bi_valid += we); } - function we(H, ce, ye) { - ae( - H, - ye[ce * 2], - ye[ce * 2 + 1] + function xe(Z, ue, we) { + se( + Z, + we[ue * 2], + we[ue * 2 + 1] /*.Len*/ ); } - function xe(H, ce) { - var ye = 0; + function ye(Z, ue) { + var we = 0; do - ye |= H & 1, H >>>= 1, ye <<= 1; - while (--ce > 0); - return ye >>> 1; + we |= Z & 1, Z >>>= 1, we <<= 1; + while (--ue > 0); + return we >>> 1; } - function Ie(H) { - H.bi_valid === 16 ? (se(H, H.bi_buf), H.bi_buf = 0, H.bi_valid = 0) : H.bi_valid >= 8 && (H.pending_buf[H.pending++] = H.bi_buf & 255, H.bi_buf >>= 8, H.bi_valid -= 8); + function Pe(Z) { + Z.bi_valid === 16 ? (he(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 oe(H, ce) { - var ye = ce.dyn_tree, Pe = ce.max_code, le = ce.stat_desc.static_tree, De = ce.stat_desc.has_stree, K = ce.stat_desc.extra_bits, Oe = ce.stat_desc.extra_base, Ne = ce.stat_desc.max_length, I, me, ge, Y, ne, Ee, He = 0; - for (Y = 0; Y <= t; Y++) - H.bl_count[Y] = 0; - for (ye[H.heap[H.heap_max] * 2 + 1] = 0, I = H.heap_max + 1; I < c; I++) - me = H.heap[I], Y = ye[ye[me * 2 + 1] * 2 + 1] + 1, Y > Ne && (Y = Ne, He++), ye[me * 2 + 1] = Y, !(me > Pe) && (H.bl_count[Y]++, ne = 0, me >= Oe && (ne = K[me - Oe]), Ee = ye[me * 2], H.opt_len += Ee * (Y + ne), De && (H.static_len += Ee * (le[me * 2 + 1] + ne))); + function de(Z, ue) { + var we = ue.dyn_tree, Te = ue.max_code, ae = ue.stat_desc.static_tree, De = ue.stat_desc.has_stree, Y = ue.stat_desc.extra_bits, Oe = ue.stat_desc.extra_base, Ve = ue.stat_desc.max_length, I, me, ve, X, ne, Ee, He = 0; + for (X = 0; X <= t; X++) + Z.bl_count[X] = 0; + for (we[Z.heap[Z.heap_max] * 2 + 1] = 0, I = Z.heap_max + 1; I < c; I++) + me = Z.heap[I], X = we[we[me * 2 + 1] * 2 + 1] + 1, X > Ve && (X = Ve, He++), we[me * 2 + 1] = X, !(me > Te) && (Z.bl_count[X]++, ne = 0, me >= Oe && (ne = Y[me - Oe]), Ee = we[me * 2], Z.opt_len += Ee * (X + ne), De && (Z.static_len += Ee * (ae[me * 2 + 1] + ne))); if (He !== 0) { do { - for (Y = Ne - 1; H.bl_count[Y] === 0; ) - Y--; - H.bl_count[Y]--, H.bl_count[Y + 1] += 2, H.bl_count[Ne]--, He -= 2; + for (X = Ve - 1; Z.bl_count[X] === 0; ) + X--; + Z.bl_count[X]--, Z.bl_count[X + 1] += 2, Z.bl_count[Ve]--, He -= 2; } while (He > 0); - for (Y = Ne; Y !== 0; Y--) - for (me = H.bl_count[Y]; me !== 0; ) - ge = H.heap[--I], !(ge > Pe) && (ye[ge * 2 + 1] !== Y && (H.opt_len += (Y - ye[ge * 2 + 1]) * ye[ge * 2], ye[ge * 2 + 1] = Y), me--); + for (X = Ve; X !== 0; X--) + for (me = Z.bl_count[X]; me !== 0; ) + ve = Z.heap[--I], !(ve > Te) && (we[ve * 2 + 1] !== X && (Z.opt_len += (X - we[ve * 2 + 1]) * we[ve * 2], we[ve * 2 + 1] = X), me--); } } - function ve(H, ce, ye) { - var Pe = new Array(t + 1), le = 0, De, K; + function pe(Z, ue, we) { + var Te = new Array(t + 1), ae = 0, De, Y; for (De = 1; De <= t; De++) - Pe[De] = le = le + ye[De - 1] << 1; - for (K = 0; K <= ce; K++) { - var Oe = H[K * 2 + 1]; - Oe !== 0 && (H[K * 2] = xe(Pe[Oe]++, Oe)); + Te[De] = ae = ae + we[De - 1] << 1; + for (Y = 0; Y <= ue; Y++) { + var Oe = Z[Y * 2 + 1]; + Oe !== 0 && (Z[Y * 2] = ye(Te[Oe]++, Oe)); } } function re() { - var H, ce, ye, Pe, le, De = new Array(t + 1); - for (ye = 0, Pe = 0; Pe < D - 1; Pe++) - for (G[Pe] = ye, H = 0; H < 1 << R[Pe]; H++) - N[ye++] = Pe; - for (N[ye - 1] = Pe, le = 0, Pe = 0; Pe < 16; Pe++) - for (k[Pe] = le, H = 0; H < 1 << z[Pe]; H++) - W[le++] = Pe; - for (le >>= 7; Pe < b; Pe++) - for (k[Pe] = le << 7, H = 0; H < 1 << z[Pe] - 7; H++) - W[256 + le++] = Pe; - for (ce = 0; ce <= t; ce++) - De[ce] = 0; - for (H = 0; H <= 143; ) - F[H * 2 + 1] = 8, H++, De[8]++; - for (; H <= 255; ) - F[H * 2 + 1] = 9, H++, De[9]++; - for (; H <= 279; ) - F[H * 2 + 1] = 7, H++, De[7]++; - for (; H <= 287; ) - F[H * 2 + 1] = 8, H++, De[8]++; - for (ve(F, n + 1, De), H = 0; H < b; H++) - $[H * 2 + 1] = 5, $[H * 2] = xe(H, 5); - Q = new j(F, R, r + 1, n, t), ie = new j($, z, 0, b, t), pe = new j(new Array(0), P, 0, f, h); + var Z, ue, we, Te, ae, De = new Array(t + 1); + for (we = 0, Te = 0; Te < D - 1; Te++) + for (N[Te] = we, Z = 0; Z < 1 << R[Te]; Z++) + V[we++] = Te; + for (V[we - 1] = Te, ae = 0, Te = 0; Te < 16; Te++) + for (k[Te] = ae, Z = 0; Z < 1 << $[Te]; Z++) + W[ae++] = Te; + for (ae >>= 7; Te < b; Te++) + for (k[Te] = ae << 7, Z = 0; Z < 1 << $[Te] - 7; Z++) + W[256 + ae++] = Te; + for (ue = 0; ue <= t; ue++) + De[ue] = 0; + for (Z = 0; Z <= 143; ) + U[Z * 2 + 1] = 8, Z++, De[8]++; + for (; Z <= 255; ) + U[Z * 2 + 1] = 9, Z++, De[9]++; + for (; Z <= 279; ) + U[Z * 2 + 1] = 7, Z++, De[7]++; + for (; Z <= 287; ) + U[Z * 2 + 1] = 8, Z++, De[8]++; + for (pe(U, n + 1, De), Z = 0; Z < b; Z++) + z[Z * 2 + 1] = 5, z[Z * 2] = ye(Z, 5); + Q = new G(U, R, r + 1, n, t), ie = new G(z, $, 0, b, t), ge = new G(new Array(0), P, 0, f, h); } - function Se(H) { - var ce; - for (ce = 0; ce < n; ce++) - H.dyn_ltree[ce * 2] = 0; - for (ce = 0; ce < b; ce++) - H.dyn_dtree[ce * 2] = 0; - for (ce = 0; ce < f; ce++) - H.bl_tree[ce * 2] = 0; - H.dyn_ltree[M * 2] = 1, H.opt_len = H.static_len = 0, H.last_lit = H.matches = 0; + function Se(Z) { + var ue; + for (ue = 0; ue < n; ue++) + Z.dyn_ltree[ue * 2] = 0; + for (ue = 0; ue < b; ue++) + Z.dyn_dtree[ue * 2] = 0; + for (ue = 0; ue < f; ue++) + Z.bl_tree[ue * 2] = 0; + Z.dyn_ltree[M * 2] = 1, Z.opt_len = Z.static_len = 0, Z.last_lit = Z.matches = 0; } - function ze(H) { - H.bi_valid > 8 ? se(H, H.bi_buf) : H.bi_valid > 0 && (H.pending_buf[H.pending++] = H.bi_buf), H.bi_buf = 0, H.bi_valid = 0; + function ke(Z) { + Z.bi_valid > 8 ? he(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 Ge(H, ce, ye, Pe) { - ze(H), Pe && (se(H, ye), se(H, ~ye)), l.arraySet(H.pending_buf, H.window, ce, ye, H.pending), H.pending += ye; + function $e(Z, ue, we, Te) { + ke(Z), Te && (he(Z, we), he(Z, ~we)), l.arraySet(Z.pending_buf, Z.window, ue, we, Z.pending), Z.pending += we; } - function $e(H, ce, ye, Pe) { - var le = ce * 2, De = ye * 2; - return H[le] < H[De] || H[le] === H[De] && Pe[ce] <= Pe[ye]; + function ze(Z, ue, we, Te) { + var ae = ue * 2, De = we * 2; + return Z[ae] < Z[De] || Z[ae] === Z[De] && Te[ue] <= Te[we]; } - function Re(H, ce, ye) { - for (var Pe = H.heap[ye], le = ye << 1; le <= H.heap_len && (le < H.heap_len && $e(ce, H.heap[le + 1], H.heap[le], H.depth) && le++, !$e(ce, Pe, H.heap[le], H.depth)); ) - H.heap[ye] = H.heap[le], ye = le, le <<= 1; - H.heap[ye] = Pe; + function Re(Z, ue, we) { + for (var Te = Z.heap[we], ae = we << 1; ae <= Z.heap_len && (ae < Z.heap_len && ze(ue, Z.heap[ae + 1], Z.heap[ae], Z.depth) && ae++, !ze(ue, Te, Z.heap[ae], Z.depth)); ) + Z.heap[we] = Z.heap[ae], we = ae, ae <<= 1; + Z.heap[we] = Te; } - function Be(H, ce, ye) { - var Pe, le, De = 0, K, Oe; - if (H.last_lit !== 0) + function Fe(Z, ue, we) { + var Te, ae, De = 0, Y, Oe; + if (Z.last_lit !== 0) do - Pe = H.pending_buf[H.d_buf + De * 2] << 8 | H.pending_buf[H.d_buf + De * 2 + 1], le = H.pending_buf[H.l_buf + De], De++, Pe === 0 ? we(H, le, ce) : (K = N[le], we(H, K + r + 1, ce), Oe = R[K], Oe !== 0 && (le -= G[K], ae(H, le, Oe)), Pe--, K = ue(Pe), we(H, K, ye), Oe = z[K], Oe !== 0 && (Pe -= k[K], ae(H, Pe, Oe))); - while (De < H.last_lit); - we(H, M, ce); + Te = Z.pending_buf[Z.d_buf + De * 2] << 8 | Z.pending_buf[Z.d_buf + De * 2 + 1], ae = Z.pending_buf[Z.l_buf + De], De++, Te === 0 ? xe(Z, ae, ue) : (Y = V[ae], xe(Z, Y + r + 1, ue), Oe = R[Y], Oe !== 0 && (ae -= N[Y], se(Z, ae, Oe)), Te--, Y = oe(Te), xe(Z, Y, we), Oe = $[Y], Oe !== 0 && (Te -= k[Y], se(Z, Te, Oe))); + while (De < Z.last_lit); + xe(Z, M, ue); } - function ke(H, ce) { - var ye = ce.dyn_tree, Pe = ce.stat_desc.static_tree, le = ce.stat_desc.has_stree, De = ce.stat_desc.elems, K, Oe, Ne = -1, I; - for (H.heap_len = 0, H.heap_max = c, K = 0; K < De; K++) - ye[K * 2] !== 0 ? (H.heap[++H.heap_len] = Ne = K, H.depth[K] = 0) : ye[K * 2 + 1] = 0; - for (; H.heap_len < 2; ) - I = H.heap[++H.heap_len] = Ne < 2 ? ++Ne : 0, ye[I * 2] = 1, H.depth[I] = 0, H.opt_len--, le && (H.static_len -= Pe[I * 2 + 1]); - for (ce.max_code = Ne, K = H.heap_len >> 1; K >= 1; K--) - Re(H, ye, K); + function Ie(Z, ue) { + var we = ue.dyn_tree, Te = ue.stat_desc.static_tree, ae = ue.stat_desc.has_stree, De = ue.stat_desc.elems, Y, Oe, Ve = -1, I; + for (Z.heap_len = 0, Z.heap_max = c, Y = 0; Y < De; Y++) + we[Y * 2] !== 0 ? (Z.heap[++Z.heap_len] = Ve = Y, Z.depth[Y] = 0) : we[Y * 2 + 1] = 0; + for (; Z.heap_len < 2; ) + I = Z.heap[++Z.heap_len] = Ve < 2 ? ++Ve : 0, we[I * 2] = 1, Z.depth[I] = 0, Z.opt_len--, ae && (Z.static_len -= Te[I * 2 + 1]); + for (ue.max_code = Ve, Y = Z.heap_len >> 1; Y >= 1; Y--) + Re(Z, we, Y); I = De; do - K = H.heap[ + Y = Z.heap[ 1 /*SMALLEST*/ - ], H.heap[ + ], Z.heap[ 1 /*SMALLEST*/ - ] = H.heap[H.heap_len--], Re( - H, - ye, + ] = Z.heap[Z.heap_len--], Re( + Z, + we, 1 /*SMALLEST*/ - ), Oe = H.heap[ + ), Oe = Z.heap[ 1 /*SMALLEST*/ - ], H.heap[--H.heap_max] = K, H.heap[--H.heap_max] = Oe, ye[I * 2] = ye[K * 2] + ye[Oe * 2], H.depth[I] = (H.depth[K] >= H.depth[Oe] ? H.depth[K] : H.depth[Oe]) + 1, ye[K * 2 + 1] = ye[Oe * 2 + 1] = I, H.heap[ + ], Z.heap[--Z.heap_max] = Y, Z.heap[--Z.heap_max] = Oe, we[I * 2] = we[Y * 2] + we[Oe * 2], Z.depth[I] = (Z.depth[Y] >= Z.depth[Oe] ? Z.depth[Y] : Z.depth[Oe]) + 1, we[Y * 2 + 1] = we[Oe * 2 + 1] = I, Z.heap[ 1 /*SMALLEST*/ ] = I++, Re( - H, - ye, + Z, + we, 1 /*SMALLEST*/ ); - while (H.heap_len >= 2); - H.heap[--H.heap_max] = H.heap[ + while (Z.heap_len >= 2); + Z.heap[--Z.heap_max] = Z.heap[ 1 /*SMALLEST*/ - ], oe(H, ce), ve(ye, Ne, H.bl_count); + ], de(Z, ue), pe(we, Ve, Z.bl_count); } - function We(H, ce, ye) { - var Pe, le = -1, De, K = ce[0 * 2 + 1], Oe = 0, Ne = 7, I = 4; - for (K === 0 && (Ne = 138, I = 3), ce[(ye + 1) * 2 + 1] = 65535, Pe = 0; Pe <= ye; Pe++) - De = K, K = ce[(Pe + 1) * 2 + 1], !(++Oe < Ne && De === K) && (Oe < I ? H.bl_tree[De * 2] += Oe : De !== 0 ? (De !== le && H.bl_tree[De * 2]++, H.bl_tree[w * 2]++) : Oe <= 10 ? H.bl_tree[S * 2]++ : H.bl_tree[T * 2]++, Oe = 0, le = De, K === 0 ? (Ne = 138, I = 3) : De === K ? (Ne = 6, I = 3) : (Ne = 7, I = 4)); + function We(Z, ue, we) { + var Te, ae = -1, De, Y = ue[0 * 2 + 1], Oe = 0, Ve = 7, I = 4; + for (Y === 0 && (Ve = 138, I = 3), ue[(we + 1) * 2 + 1] = 65535, Te = 0; Te <= we; Te++) + De = Y, Y = ue[(Te + 1) * 2 + 1], !(++Oe < Ve && De === Y) && (Oe < I ? Z.bl_tree[De * 2] += Oe : De !== 0 ? (De !== ae && Z.bl_tree[De * 2]++, Z.bl_tree[w * 2]++) : Oe <= 10 ? Z.bl_tree[S * 2]++ : Z.bl_tree[T * 2]++, Oe = 0, ae = De, Y === 0 ? (Ve = 138, I = 3) : De === Y ? (Ve = 6, I = 3) : (Ve = 7, I = 4)); } - function Te(H, ce, ye) { - var Pe, le = -1, De, K = ce[0 * 2 + 1], Oe = 0, Ne = 7, I = 4; - for (K === 0 && (Ne = 138, I = 3), Pe = 0; Pe <= ye; Pe++) - if (De = K, K = ce[(Pe + 1) * 2 + 1], !(++Oe < Ne && De === K)) { + function Ue(Z, ue, we) { + var Te, ae = -1, De, Y = ue[0 * 2 + 1], Oe = 0, Ve = 7, I = 4; + for (Y === 0 && (Ve = 138, I = 3), Te = 0; Te <= we; Te++) + if (De = Y, Y = ue[(Te + 1) * 2 + 1], !(++Oe < Ve && De === Y)) { if (Oe < I) do - we(H, De, H.bl_tree); + xe(Z, De, Z.bl_tree); while (--Oe !== 0); else - De !== 0 ? (De !== le && (we(H, De, H.bl_tree), Oe--), we(H, w, H.bl_tree), ae(H, Oe - 3, 2)) : Oe <= 10 ? (we(H, S, H.bl_tree), ae(H, Oe - 3, 3)) : (we(H, T, H.bl_tree), ae(H, Oe - 11, 7)); - Oe = 0, le = De, K === 0 ? (Ne = 138, I = 3) : De === K ? (Ne = 6, I = 3) : (Ne = 7, I = 4); + De !== 0 ? (De !== ae && (xe(Z, De, Z.bl_tree), Oe--), xe(Z, w, Z.bl_tree), se(Z, Oe - 3, 2)) : Oe <= 10 ? (xe(Z, S, Z.bl_tree), se(Z, Oe - 3, 3)) : (xe(Z, T, Z.bl_tree), se(Z, Oe - 11, 7)); + Oe = 0, ae = De, Y === 0 ? (Ve = 138, I = 3) : De === Y ? (Ve = 6, I = 3) : (Ve = 7, I = 4); } } - function je(H) { - var ce; - for (We(H, H.dyn_ltree, H.l_desc.max_code), We(H, H.dyn_dtree, H.d_desc.max_code), ke(H, H.bl_desc), ce = f - 1; ce >= 3 && H.bl_tree[B[ce] * 2 + 1] === 0; ce--) + function Be(Z) { + var ue; + for (We(Z, Z.dyn_ltree, Z.l_desc.max_code), We(Z, Z.dyn_dtree, Z.d_desc.max_code), Ie(Z, Z.bl_desc), ue = f - 1; ue >= 3 && Z.bl_tree[B[ue] * 2 + 1] === 0; ue--) ; - return H.opt_len += 3 * (ce + 1) + 5 + 5 + 4, ce; + return Z.opt_len += 3 * (ue + 1) + 5 + 5 + 4, ue; } - function Fe(H, ce, ye, Pe) { - var le; - for (ae(H, ce - 257, 5), ae(H, ye - 1, 5), ae(H, Pe - 4, 4), le = 0; le < Pe; le++) - ae(H, H.bl_tree[B[le] * 2 + 1], 3); - Te(H, H.dyn_ltree, ce - 1), Te(H, H.dyn_dtree, ye - 1); + function Ne(Z, ue, we, Te) { + var ae; + for (se(Z, ue - 257, 5), se(Z, we - 1, 5), se(Z, Te - 4, 4), ae = 0; ae < Te; ae++) + se(Z, Z.bl_tree[B[ae] * 2 + 1], 3); + Ue(Z, Z.dyn_ltree, ue - 1), Ue(Z, Z.dyn_dtree, we - 1); } - function X(H) { - var ce = 4093624447, ye; - for (ye = 0; ye <= 31; ye++, ce >>>= 1) - if (ce & 1 && H.dyn_ltree[ye * 2] !== 0) + function H(Z) { + var ue = 4093624447, we; + for (we = 0; we <= 31; we++, ue >>>= 1) + if (ue & 1 && Z.dyn_ltree[we * 2] !== 0) return _; - if (H.dyn_ltree[18] !== 0 || H.dyn_ltree[20] !== 0 || H.dyn_ltree[26] !== 0) + if (Z.dyn_ltree[18] !== 0 || Z.dyn_ltree[20] !== 0 || Z.dyn_ltree[26] !== 0) return x; - for (ye = 32; ye < r; ye++) - if (H.dyn_ltree[ye * 2] !== 0) + for (we = 32; we < r; we++) + if (Z.dyn_ltree[we * 2] !== 0) return x; return _; } - var Z = !1; - function q(H) { - Z || (re(), Z = !0), H.l_desc = new he(H.dyn_ltree, Q), H.d_desc = new he(H.dyn_dtree, ie), H.bl_desc = new he(H.bl_tree, pe), H.bi_buf = 0, H.bi_valid = 0, Se(H); + var K = !1; + function q(Z) { + K || (re(), K = !0), Z.l_desc = new le(Z.dyn_ltree, Q), Z.d_desc = new le(Z.dyn_dtree, ie), Z.bl_desc = new le(Z.bl_tree, ge), Z.bi_buf = 0, Z.bi_valid = 0, Se(Z); } - function fe(H, ce, ye, Pe) { - ae(H, (E << 1) + (Pe ? 1 : 0), 3), Ge(H, ce, ye, !0); + function fe(Z, ue, we, Te) { + se(Z, (E << 1) + (Te ? 1 : 0), 3), $e(Z, ue, we, !0); } - function _e(H) { - ae(H, u << 1, 3), we(H, M, F), Ie(H); + function _e(Z) { + se(Z, u << 1, 3), xe(Z, M, U), Pe(Z); } - function Me(H, ce, ye, Pe) { - var le, De, K = 0; - H.level > 0 ? (H.strm.data_type === o && (H.strm.data_type = X(H)), ke(H, H.l_desc), ke(H, H.d_desc), K = je(H), le = H.opt_len + 3 + 7 >>> 3, De = H.static_len + 3 + 7 >>> 3, De <= le && (le = De)) : le = De = ye + 5, ye + 4 <= le && ce !== -1 ? fe(H, ce, ye, Pe) : H.strategy === g || De === le ? (ae(H, (u << 1) + (Pe ? 1 : 0), 3), Be(H, F, $)) : (ae(H, (A << 1) + (Pe ? 1 : 0), 3), Fe(H, H.l_desc.max_code + 1, H.d_desc.max_code + 1, K + 1), Be(H, H.dyn_ltree, H.dyn_dtree)), Se(H), Pe && ze(H); + function Me(Z, ue, we, Te) { + var ae, De, Y = 0; + Z.level > 0 ? (Z.strm.data_type === o && (Z.strm.data_type = H(Z)), Ie(Z, Z.l_desc), Ie(Z, Z.d_desc), Y = Be(Z), ae = Z.opt_len + 3 + 7 >>> 3, De = Z.static_len + 3 + 7 >>> 3, De <= ae && (ae = De)) : ae = De = we + 5, we + 4 <= ae && ue !== -1 ? fe(Z, ue, we, Te) : Z.strategy === p || De === ae ? (se(Z, (u << 1) + (Te ? 1 : 0), 3), Fe(Z, U, z)) : (se(Z, (A << 1) + (Te ? 1 : 0), 3), Ne(Z, Z.l_desc.max_code + 1, Z.d_desc.max_code + 1, Y + 1), Fe(Z, Z.dyn_ltree, Z.dyn_dtree)), Se(Z), Te && ke(Z); } - function Ae(H, ce, ye) { - return H.pending_buf[H.d_buf + H.last_lit * 2] = ce >>> 8 & 255, H.pending_buf[H.d_buf + H.last_lit * 2 + 1] = ce & 255, H.pending_buf[H.l_buf + H.last_lit] = ye & 255, H.last_lit++, ce === 0 ? H.dyn_ltree[ye * 2]++ : (H.matches++, ce--, H.dyn_ltree[(N[ye] + r + 1) * 2]++, H.dyn_dtree[ue(ce) * 2]++), H.last_lit === H.lit_bufsize - 1; + function Ae(Z, ue, we) { + return Z.pending_buf[Z.d_buf + Z.last_lit * 2] = ue >>> 8 & 255, Z.pending_buf[Z.d_buf + Z.last_lit * 2 + 1] = ue & 255, Z.pending_buf[Z.l_buf + Z.last_lit] = we & 255, Z.last_lit++, ue === 0 ? Z.dyn_ltree[we * 2]++ : (Z.matches++, ue--, Z.dyn_ltree[(V[we] + r + 1) * 2]++, Z.dyn_dtree[oe(ue) * 2]++), Z.last_lit === Z.lit_bufsize - 1; } s._tr_init = q, s._tr_stored_block = fe, s._tr_flush_block = Me, s._tr_tally = Ae, s._tr_align = _e; } @@ -22343,8 +22343,8 @@ ATOM`, h); else { var l = self.ps; l.initparm(s.expandedExtent, e != 1, self.volume), l.fillvoxels(self.atomData, s.extendedAtoms), l.buildboundary(), (e === 4 || e === 2) && (l.fastdistancemap(), l.boundingatom(!1), l.fillvoxelswaals(self.atomData, s.extendedAtoms)), l.marchingcube(e); - var g = l.getFacesAndVertices(s.atomsToShow); - self.postMessage(g); + var p = l.getFacesAndVertices(s.atomsToShow); + self.postMessage(p); } }; }).toString().replace(/(^.*?\{|\}$)/g, ""), $3Dmol.workerString += `; @@ -22379,116 +22379,116 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; (function(e, l) { l(s); })(this, function(e) { - function l(X, Z, q) { - for (var fe = (X.byteLength, 0), _e = q.length; _e > fe; fe++) { + function l(H, K, q) { + for (var fe = (H.byteLength, 0), _e = q.length; _e > fe; fe++) { var Me = q.charCodeAt(fe); if (128 > Me) - X.setUint8(Z++, Me >>> 0 & 127 | 0); + H.setUint8(K++, Me >>> 0 & 127 | 0); else if (2048 > Me) - X.setUint8(Z++, Me >>> 6 & 31 | 192), X.setUint8(Z++, Me >>> 0 & 63 | 128); + H.setUint8(K++, Me >>> 6 & 31 | 192), H.setUint8(K++, Me >>> 0 & 63 | 128); else if (65536 > Me) - X.setUint8(Z++, Me >>> 12 & 15 | 224), X.setUint8(Z++, Me >>> 6 & 63 | 128), X.setUint8(Z++, Me >>> 0 & 63 | 128); + H.setUint8(K++, Me >>> 12 & 15 | 224), H.setUint8(K++, Me >>> 6 & 63 | 128), H.setUint8(K++, Me >>> 0 & 63 | 128); else { if (!(1114112 > Me)) throw new Error("bad codepoint " + Me); - X.setUint8(Z++, Me >>> 18 & 7 | 240), X.setUint8(Z++, Me >>> 12 & 63 | 128), X.setUint8(Z++, Me >>> 6 & 63 | 128), X.setUint8(Z++, Me >>> 0 & 63 | 128); + H.setUint8(K++, Me >>> 18 & 7 | 240), H.setUint8(K++, Me >>> 12 & 63 | 128), H.setUint8(K++, Me >>> 6 & 63 | 128), H.setUint8(K++, Me >>> 0 & 63 | 128); } } } - function g(X) { - for (var Z = 0, q = 0, fe = X.length; fe > q; q++) { - var _e = X.charCodeAt(q); + function p(H) { + for (var K = 0, q = 0, fe = H.length; fe > q; q++) { + var _e = H.charCodeAt(q); if (128 > _e) - Z += 1; + K += 1; else if (2048 > _e) - Z += 2; + K += 2; else if (65536 > _e) - Z += 3; + K += 3; else { if (!(1114112 > _e)) throw new Error("bad codepoint " + _e); - Z += 4; + K += 4; } } - return Z; + return K; } - function _(X, Z, q) { - var fe = typeof X; + function _(H, K, q) { + var fe = typeof H; if (fe === "string") { - var _e = g(X); + var _e = p(H); if (32 > _e) - return Z.setUint8(q, 160 | _e), l(Z, q + 1, X), 1 + _e; + return K.setUint8(q, 160 | _e), l(K, q + 1, H), 1 + _e; if (256 > _e) - return Z.setUint8(q, 217), Z.setUint8(q + 1, _e), l(Z, q + 2, X), 2 + _e; + return K.setUint8(q, 217), K.setUint8(q + 1, _e), l(K, q + 2, H), 2 + _e; if (65536 > _e) - return Z.setUint8(q, 218), Z.setUint16(q + 1, _e), l(Z, q + 3, X), 3 + _e; + return K.setUint8(q, 218), K.setUint16(q + 1, _e), l(K, q + 3, H), 3 + _e; if (4294967296 > _e) - return Z.setUint8(q, 219), Z.setUint32(q + 1, _e), l(Z, q + 5, X), 5 + _e; + return K.setUint8(q, 219), K.setUint32(q + 1, _e), l(K, q + 5, H), 5 + _e; } - if (X instanceof Uint8Array) { - var _e = X.byteLength, Me = new Uint8Array(Z.buffer); + if (H instanceof Uint8Array) { + var _e = H.byteLength, Me = new Uint8Array(K.buffer); if (256 > _e) - return Z.setUint8(q, 196), Z.setUint8(q + 1, _e), Me.set(X, q + 2), 2 + _e; + return K.setUint8(q, 196), K.setUint8(q + 1, _e), Me.set(H, q + 2), 2 + _e; if (65536 > _e) - return Z.setUint8(q, 197), Z.setUint16(q + 1, _e), Me.set(X, q + 3), 3 + _e; + return K.setUint8(q, 197), K.setUint16(q + 1, _e), Me.set(H, q + 3), 3 + _e; if (4294967296 > _e) - return Z.setUint8(q, 198), Z.setUint32(q + 1, _e), Me.set(X, q + 5), 5 + _e; + return K.setUint8(q, 198), K.setUint32(q + 1, _e), Me.set(H, q + 5), 5 + _e; } if (fe === "number") { - if (!isFinite(X)) - throw new Error("Number not finite: " + X); - if (Math.floor(X) !== X) - return Z.setUint8(q, 203), Z.setFloat64(q + 1, X), 9; - if (X >= 0) { - if (128 > X) - return Z.setUint8(q, X), 1; - if (256 > X) - return Z.setUint8(q, 204), Z.setUint8(q + 1, X), 2; - if (65536 > X) - return Z.setUint8(q, 205), Z.setUint16(q + 1, X), 3; - if (4294967296 > X) - return Z.setUint8(q, 206), Z.setUint32(q + 1, X), 5; - throw new Error("Number too big 0x" + X.toString(16)); + if (!isFinite(H)) + throw new Error("Number not finite: " + H); + if (Math.floor(H) !== H) + return K.setUint8(q, 203), K.setFloat64(q + 1, H), 9; + if (H >= 0) { + if (128 > H) + return K.setUint8(q, H), 1; + if (256 > H) + return K.setUint8(q, 204), K.setUint8(q + 1, H), 2; + if (65536 > H) + return K.setUint8(q, 205), K.setUint16(q + 1, H), 3; + if (4294967296 > H) + return K.setUint8(q, 206), K.setUint32(q + 1, H), 5; + throw new Error("Number too big 0x" + H.toString(16)); } - if (X >= -32) - return Z.setInt8(q, X), 1; - if (X >= -128) - return Z.setUint8(q, 208), Z.setInt8(q + 1, X), 2; - if (X >= -32768) - return Z.setUint8(q, 209), Z.setInt16(q + 1, X), 3; - if (X >= -2147483648) - return Z.setUint8(q, 210), Z.setInt32(q + 1, X), 5; - throw new Error("Number too small -0x" + (-X).toString(16).substr(1)); - } - if (X === null) - return Z.setUint8(q, 192), 1; + if (H >= -32) + return K.setInt8(q, H), 1; + if (H >= -128) + return K.setUint8(q, 208), K.setInt8(q + 1, H), 2; + if (H >= -32768) + return K.setUint8(q, 209), K.setInt16(q + 1, H), 3; + if (H >= -2147483648) + return K.setUint8(q, 210), K.setInt32(q + 1, H), 5; + throw new Error("Number too small -0x" + (-H).toString(16).substr(1)); + } + if (H === null) + return K.setUint8(q, 192), 1; if (fe === "boolean") - return Z.setUint8(q, X ? 195 : 194), 1; + return K.setUint8(q, H ? 195 : 194), 1; if (fe === "object") { - var _e, ce = 0, Ae = Array.isArray(X); + var _e, ue = 0, Ae = Array.isArray(H); if (Ae) - _e = X.length; - else { - var H = Object.keys(X); _e = H.length; + else { + var Z = Object.keys(H); + _e = Z.length; } - var ce; - if (16 > _e ? (Z.setUint8(q, _e | (Ae ? 144 : 128)), ce = 1) : 65536 > _e ? (Z.setUint8(q, Ae ? 220 : 222), Z.setUint16(q + 1, _e), ce = 3) : 4294967296 > _e && (Z.setUint8(q, Ae ? 221 : 223), Z.setUint32(q + 1, _e), ce = 5), Ae) - for (var ye = 0; _e > ye; ye++) - ce += _(X[ye], Z, q + ce); + var ue; + if (16 > _e ? (K.setUint8(q, _e | (Ae ? 144 : 128)), ue = 1) : 65536 > _e ? (K.setUint8(q, Ae ? 220 : 222), K.setUint16(q + 1, _e), ue = 3) : 4294967296 > _e && (K.setUint8(q, Ae ? 221 : 223), K.setUint32(q + 1, _e), ue = 5), Ae) + for (var we = 0; _e > we; we++) + ue += _(H[we], K, q + ue); else - for (var ye = 0; _e > ye; ye++) { - var Pe = H[ye]; - ce += _(Pe, Z, q + ce), ce += _(X[Pe], Z, q + ce); + for (var we = 0; _e > we; we++) { + var Te = Z[we]; + ue += _(Te, K, q + ue), ue += _(H[Te], K, q + ue); } - return ce; + return ue; } throw new Error("Unknown type " + fe); } - function x(X) { - var Z = typeof X; - if (Z === "string") { - var q = g(X); + function x(H) { + var K = typeof H; + if (K === "string") { + var q = p(H); if (32 > q) return 1 + q; if (256 > q) @@ -22498,8 +22498,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (4294967296 > q) return 5 + q; } - if (X instanceof Uint8Array) { - var q = X.byteLength; + if (H instanceof Uint8Array) { + var q = H.byteLength; if (256 > q) return 2 + q; if (65536 > q) @@ -22507,44 +22507,44 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (4294967296 > q) return 5 + q; } - if (Z === "number") { - if (Math.floor(X) !== X) + if (K === "number") { + if (Math.floor(H) !== H) return 9; - if (X >= 0) { - if (128 > X) + if (H >= 0) { + if (128 > H) return 1; - if (256 > X) + if (256 > H) return 2; - if (65536 > X) + if (65536 > H) return 3; - if (4294967296 > X) + if (4294967296 > H) return 5; - throw new Error("Number too big 0x" + X.toString(16)); + throw new Error("Number too big 0x" + H.toString(16)); } - if (X >= -32) + if (H >= -32) return 1; - if (X >= -128) + if (H >= -128) return 2; - if (X >= -32768) + if (H >= -32768) return 3; - if (X >= -2147483648) + if (H >= -2147483648) return 5; - throw new Error("Number too small -0x" + X.toString(16).substr(1)); + throw new Error("Number too small -0x" + H.toString(16).substr(1)); } - if (Z === "boolean" || X === null) + if (K === "boolean" || H === null) return 1; - if (Z === "object") { + if (K === "object") { var q, fe = 0; - if (Array.isArray(X)) { - q = X.length; + if (Array.isArray(H)) { + q = H.length; for (var _e = 0; q > _e; _e++) - fe += x(X[_e]); + fe += x(H[_e]); } else { - var Me = Object.keys(X); + var Me = Object.keys(H); q = Me.length; for (var _e = 0; q > _e; _e++) { var Ae = Me[_e]; - fe += x(Ae) + x(X[Ae]); + fe += x(Ae) + x(H[Ae]); } } if (16 > q) @@ -22555,263 +22555,263 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return 5 + fe; throw new Error("Array or object too long 0x" + q.toString(16)); } - throw new Error("Unknown type " + Z); + throw new Error("Unknown type " + K); } - function o(X) { - var Z = new ArrayBuffer(x(X)), q = new DataView(Z); - return _(X, q, 0), new Uint8Array(Z); + function o(H) { + var K = new ArrayBuffer(x(H)), q = new DataView(K); + return _(H, q, 0), new Uint8Array(K); } - function p(X, Z, q) { - return Z ? new X(Z.buffer, Z.byteOffset, Z.byteLength / (q || 1)) : void 0; + function g(H, K, q) { + return K ? new H(K.buffer, K.byteOffset, K.byteLength / (q || 1)) : void 0; } - function E(X) { - return p(DataView, X); + function E(H) { + return g(DataView, H); } - function u(X) { - return p(Uint8Array, X); + function u(H) { + return g(Uint8Array, H); } - function A(X) { - return p(Int8Array, X); + function A(H) { + return g(Int8Array, H); } - function C(X) { - return p(Int32Array, X, 4); + function L(H) { + return g(Int32Array, H, 4); } - function L(X) { - return p(Float32Array, X, 4); + function C(H) { + return g(Float32Array, H, 4); } - function D(X, Z) { - var q = X.length / 2; - Z || (Z = new Int16Array(q)); + function D(H, K) { + var q = H.length / 2; + K || (K = new Int16Array(q)); for (var fe = 0, _e = 0; q > fe; ++fe, _e += 2) - Z[fe] = X[_e] << 8 ^ X[_e + 1] << 0; - return Z; - } - function r(X, Z) { - var q = X.length; - Z || (Z = new Uint8Array(2 * q)); - for (var fe = E(Z), _e = 0; q > _e; ++_e) - fe.setInt16(2 * _e, X[_e]); - return u(Z); - } - function n(X, Z) { - var q = X.length / 4; - Z || (Z = new Int32Array(q)); + K[fe] = H[_e] << 8 ^ H[_e + 1] << 0; + return K; + } + function r(H, K) { + var q = H.length; + K || (K = new Uint8Array(2 * q)); + for (var fe = E(K), _e = 0; q > _e; ++_e) + fe.setInt16(2 * _e, H[_e]); + return u(K); + } + function n(H, K) { + var q = H.length / 4; + K || (K = new Int32Array(q)); for (var fe = 0, _e = 0; q > fe; ++fe, _e += 4) - Z[fe] = X[_e] << 24 ^ X[_e + 1] << 16 ^ X[_e + 2] << 8 ^ X[_e + 3] << 0; - return Z; - } - function b(X, Z) { - var q = X.length; - Z || (Z = new Uint8Array(4 * q)); - for (var fe = E(Z), _e = 0; q > _e; ++_e) - fe.setInt32(4 * _e, X[_e]); - return u(Z); - } - function f(X, Z) { - var q = X.length; - Z || (Z = new Float32Array(q / 4)); - for (var fe = E(Z), _e = E(X), Me = 0, Ae = 0, H = q / 4; H > Me; ++Me, Ae += 4) + K[fe] = H[_e] << 24 ^ H[_e + 1] << 16 ^ H[_e + 2] << 8 ^ H[_e + 3] << 0; + return K; + } + function b(H, K) { + var q = H.length; + K || (K = new Uint8Array(4 * q)); + for (var fe = E(K), _e = 0; q > _e; ++_e) + fe.setInt32(4 * _e, H[_e]); + return u(K); + } + function f(H, K) { + var q = H.length; + K || (K = new Float32Array(q / 4)); + for (var fe = E(K), _e = E(H), Me = 0, Ae = 0, Z = q / 4; Z > Me; ++Me, Ae += 4) fe.setFloat32(Ae, _e.getFloat32(Ae), !0); - return Z; + return K; } - function c(X, Z, q) { - var fe = X.length, _e = 1 / Z; + function c(H, K, q) { + var fe = H.length, _e = 1 / K; q || (q = new Float32Array(fe)); for (var Me = 0; fe > Me; ++Me) - q[Me] = X[Me] * _e; + q[Me] = H[Me] * _e; return q; } - function t(X, Z, q) { - var fe = X.length; + function t(H, K, q) { + var fe = H.length; q || (q = new Int32Array(fe)); for (var _e = 0; fe > _e; ++_e) - q[_e] = Math.round(X[_e] * Z); + q[_e] = Math.round(H[_e] * K); return q; } - function a(X, Z) { + function a(H, K) { var q, fe; - if (!Z) { + if (!K) { var _e = 0; - for (q = 0, fe = X.length; fe > q; q += 2) - _e += X[q + 1]; - Z = new X.constructor(_e); + for (q = 0, fe = H.length; fe > q; q += 2) + _e += H[q + 1]; + K = new H.constructor(_e); } var Me = 0; - for (q = 0, fe = X.length; fe > q; q += 2) - for (var Ae = X[q], H = X[q + 1], ce = 0; H > ce; ++ce) - Z[Me] = Ae, ++Me; - return Z; + for (q = 0, fe = H.length; fe > q; q += 2) + for (var Ae = H[q], Z = H[q + 1], ue = 0; Z > ue; ++ue) + K[Me] = Ae, ++Me; + return K; } - function h(X) { - if (X.length === 0) + function h(H) { + if (H.length === 0) return new Int32Array(); - var Z, q, fe = 2; - for (Z = 1, q = X.length; q > Z; ++Z) - X[Z - 1] !== X[Z] && (fe += 2); + var K, q, fe = 2; + for (K = 1, q = H.length; q > K; ++K) + H[K - 1] !== H[K] && (fe += 2); var _e = new Int32Array(fe), Me = 0, Ae = 1; - for (Z = 1, q = X.length; q > Z; ++Z) - X[Z - 1] !== X[Z] ? (_e[Me] = X[Z - 1], _e[Me + 1] = Ae, Ae = 1, Me += 2) : ++Ae; - return _e[Me] = X[X.length - 1], _e[Me + 1] = Ae, _e; + for (K = 1, q = H.length; q > K; ++K) + H[K - 1] !== H[K] ? (_e[Me] = H[K - 1], _e[Me + 1] = Ae, Ae = 1, Me += 2) : ++Ae; + return _e[Me] = H[H.length - 1], _e[Me + 1] = Ae, _e; } - function M(X, Z) { - var q = X.length; - Z || (Z = new X.constructor(q)), q && (Z[0] = X[0]); + function M(H, K) { + var q = H.length; + K || (K = new H.constructor(q)), q && (K[0] = H[0]); for (var fe = 1; q > fe; ++fe) - Z[fe] = X[fe] + Z[fe - 1]; - return Z; + K[fe] = H[fe] + K[fe - 1]; + return K; } - function w(X, Z) { - var q = X.length; - Z || (Z = new X.constructor(q)), Z[0] = X[0]; + function w(H, K) { + var q = H.length; + K || (K = new H.constructor(q)), K[0] = H[0]; for (var fe = 1; q > fe; ++fe) - Z[fe] = X[fe] - X[fe - 1]; - return Z; + K[fe] = H[fe] - H[fe - 1]; + return K; } - function S(X, Z) { - var q, fe, _e = X instanceof Int8Array ? 127 : 32767, Me = -_e - 1, Ae = X.length; - if (!Z) { - var H = 0; + function S(H, K) { + var q, fe, _e = H instanceof Int8Array ? 127 : 32767, Me = -_e - 1, Ae = H.length; + if (!K) { + var Z = 0; for (q = 0; Ae > q; ++q) - X[q] < _e && X[q] > Me && ++H; - Z = new Int32Array(H); + H[q] < _e && H[q] > Me && ++Z; + K = new Int32Array(Z); } for (q = 0, fe = 0; Ae > q; ) { - for (var ce = 0; X[q] === _e || X[q] === Me; ) - ce += X[q], ++q; - ce += X[q], ++q, Z[fe] = ce, ++fe; + for (var ue = 0; H[q] === _e || H[q] === Me; ) + ue += H[q], ++q; + ue += H[q], ++q, K[fe] = ue, ++fe; } - return Z; + return K; } - function T(X, Z) { - var q, fe = Z ? 127 : 32767, _e = -fe - 1, Me = X.length, Ae = 0; + function T(H, K) { + var q, fe = K ? 127 : 32767, _e = -fe - 1, Me = H.length, Ae = 0; for (q = 0; Me > q; ++q) { - var H = X[q]; - H === 0 ? ++Ae : H > 0 ? (Ae += Math.ceil(H / fe), H % fe === 0 && (Ae += 1)) : (Ae += Math.ceil(H / _e), H % _e === 0 && (Ae += 1)); + var Z = H[q]; + Z === 0 ? ++Ae : Z > 0 ? (Ae += Math.ceil(Z / fe), Z % fe === 0 && (Ae += 1)) : (Ae += Math.ceil(Z / _e), Z % _e === 0 && (Ae += 1)); } - var ce = Z ? new Int8Array(Ae) : new Int16Array(Ae), ye = 0; + var ue = K ? new Int8Array(Ae) : new Int16Array(Ae), we = 0; for (q = 0; Me > q; ++q) { - var H = X[q]; - if (H >= 0) - for (; H >= fe; ) - ce[ye] = fe, ++ye, H -= fe; + var Z = H[q]; + if (Z >= 0) + for (; Z >= fe; ) + ue[we] = fe, ++we, Z -= fe; else - for (; _e >= H; ) - ce[ye] = _e, ++ye, H -= _e; - ce[ye] = H, ++ye; + for (; _e >= Z; ) + ue[we] = _e, ++we, Z -= _e; + ue[we] = Z, ++we; } - return ce; + return ue; } - function R(X, Z) { - return M(a(X), Z); + function R(H, K) { + return M(a(H), K); } - function z(X) { - return h(w(X)); + function $(H) { + return h(w(H)); } - function P(X, Z, q) { - return c(a(X, C(q)), Z, q); + function P(H, K, q) { + return c(a(H, L(q)), K, q); } - function B(X, Z) { - return h(t(X, Z)); + function B(H, K) { + return h(t(H, K)); } - function U(X, Z, q) { - return c(M(X, C(q)), Z, q); + function F(H, K, q) { + return c(M(H, L(q)), K, q); } - function F(X, Z, q) { - return w(t(X, Z), q); + function U(H, K, q) { + return w(t(H, K), q); } - function $(X, Z, q) { - return c(S(X, C(q)), Z, q); + function z(H, K, q) { + return c(S(H, L(q)), K, q); } - function W(X, Z, q) { - var fe = S(X, C(q)); - return U(fe, Z, L(fe)); + function W(H, K, q) { + var fe = S(H, L(q)); + return F(fe, K, C(fe)); } - function N(X, Z, q) { - return T(F(X, Z), q); + function V(H, K, q) { + return T(U(H, K), q); } - function G(Me) { - var Z = E(Me), q = Z.getInt32(0), fe = Z.getInt32(4), _e = Me.subarray(8, 12), Me = Me.subarray(12); + function N(Me) { + var K = E(Me), q = K.getInt32(0), fe = K.getInt32(4), _e = Me.subarray(8, 12), Me = Me.subarray(12); return [q, Me, fe, _e]; } - function k(X, Z, q, fe) { + function k(H, K, q, fe) { var _e = new ArrayBuffer(12 + fe.byteLength), Me = new Uint8Array(_e), Ae = new DataView(_e); - return Ae.setInt32(0, X), Ae.setInt32(4, Z), q && Me.set(q, 8), Me.set(fe, 12), Me; + return Ae.setInt32(0, H), Ae.setInt32(4, K), q && Me.set(q, 8), Me.set(fe, 12), Me; } - function j(X) { - var Z = X.length, q = u(X); - return k(2, Z, void 0, q); + function G(H) { + var K = H.length, q = u(H); + return k(2, K, void 0, q); } - function Q(X) { - var Z = X.length, q = b(X); - return k(4, Z, void 0, q); + function Q(H) { + var K = H.length, q = b(H); + return k(4, K, void 0, q); } - function ie(X, Z) { - var q = X.length / Z, fe = b([Z]), _e = u(X); + function ie(H, K) { + var q = H.length / K, fe = b([K]), _e = u(H); return k(5, q, fe, _e); } - function pe(X) { - var Z = X.length, q = b(h(X)); - return k(6, Z, void 0, q); + function ge(H) { + var K = H.length, q = b(h(H)); + return k(6, K, void 0, q); } - function he(X) { - var Z = X.length, q = b(z(X)); - return k(8, Z, void 0, q); + function le(H) { + var K = H.length, q = b($(H)); + return k(8, K, void 0, q); } - function ue(X, Z) { - var q = X.length, fe = b([Z]), _e = b(B(X, Z)); + function oe(H, K) { + var q = H.length, fe = b([K]), _e = b(B(H, K)); return k(9, q, fe, _e); } - function se(X, Z) { - var q = X.length, fe = b([Z]), _e = r(N(X, Z)); + function he(H, K) { + var q = H.length, fe = b([K]), _e = r(V(H, K)); return k(10, q, fe, _e); } - function ae(X) { - var Z = {}; + function se(H) { + var K = {}; return Re.forEach(function(q) { - X[q] !== void 0 && (Z[q] = X[q]); - }), X.bondAtomList && (Z.bondAtomList = Q(X.bondAtomList)), X.bondOrderList && (Z.bondOrderList = j(X.bondOrderList)), Z.xCoordList = se(X.xCoordList, 1e3), Z.yCoordList = se(X.yCoordList, 1e3), Z.zCoordList = se(X.zCoordList, 1e3), X.bFactorList && (Z.bFactorList = se(X.bFactorList, 100)), X.atomIdList && (Z.atomIdList = he(X.atomIdList)), X.altLocList && (Z.altLocList = pe(X.altLocList)), X.occupancyList && (Z.occupancyList = ue(X.occupancyList, 100)), Z.groupIdList = he(X.groupIdList), Z.groupTypeList = Q(X.groupTypeList), X.secStructList && (Z.secStructList = j(X.secStructList)), X.insCodeList && (Z.insCodeList = pe(X.insCodeList)), X.sequenceIndexList && (Z.sequenceIndexList = he(X.sequenceIndexList)), Z.chainIdList = ie(X.chainIdList, 4), X.chainNameList && (Z.chainNameList = ie(X.chainNameList, 4)), Z; - } - function we(X) { - function Z(ce) { - for (var ye = {}, Pe = 0; ce > Pe; Pe++) { - var le = Me(); - ye[le] = Me(); + H[q] !== void 0 && (K[q] = H[q]); + }), H.bondAtomList && (K.bondAtomList = Q(H.bondAtomList)), H.bondOrderList && (K.bondOrderList = G(H.bondOrderList)), K.xCoordList = he(H.xCoordList, 1e3), K.yCoordList = he(H.yCoordList, 1e3), K.zCoordList = he(H.zCoordList, 1e3), H.bFactorList && (K.bFactorList = he(H.bFactorList, 100)), H.atomIdList && (K.atomIdList = le(H.atomIdList)), H.altLocList && (K.altLocList = ge(H.altLocList)), H.occupancyList && (K.occupancyList = oe(H.occupancyList, 100)), K.groupIdList = le(H.groupIdList), K.groupTypeList = Q(H.groupTypeList), H.secStructList && (K.secStructList = G(H.secStructList)), H.insCodeList && (K.insCodeList = ge(H.insCodeList)), H.sequenceIndexList && (K.sequenceIndexList = le(H.sequenceIndexList)), K.chainIdList = ie(H.chainIdList, 4), H.chainNameList && (K.chainNameList = ie(H.chainNameList, 4)), K; + } + function xe(H) { + function K(ue) { + for (var we = {}, Te = 0; ue > Te; Te++) { + var ae = Me(); + we[ae] = Me(); } - return ye; - } - function q(ce) { - var ye = X.subarray(Ae, Ae + ce); - return Ae += ce, ye; - } - function fe(ce) { - var ye = X.subarray(Ae, Ae + ce); - Ae += ce; - var Pe = 65535; - if (ce > Pe) { - for (var le = [], De = 0; De < ye.length; De += Pe) - le.push(String.fromCharCode.apply(null, ye.subarray(De, De + Pe))); - return le.join(""); + return we; + } + function q(ue) { + var we = H.subarray(Ae, Ae + ue); + return Ae += ue, we; + } + function fe(ue) { + var we = H.subarray(Ae, Ae + ue); + Ae += ue; + var Te = 65535; + if (ue > Te) { + for (var ae = [], De = 0; De < we.length; De += Te) + ae.push(String.fromCharCode.apply(null, we.subarray(De, De + Te))); + return ae.join(""); } - return String.fromCharCode.apply(null, ye); + return String.fromCharCode.apply(null, we); } - function _e(ce) { - for (var ye = new Array(ce), Pe = 0; ce > Pe; Pe++) - ye[Pe] = Me(); - return ye; + function _e(ue) { + for (var we = new Array(ue), Te = 0; ue > Te; Te++) + we[Te] = Me(); + return we; } function Me() { - var ce, ye, Pe = X[Ae]; - if (!(128 & Pe)) - return Ae++, Pe; - if ((240 & Pe) === 128) - return ye = 15 & Pe, Ae++, Z(ye); - if ((240 & Pe) === 144) - return ye = 15 & Pe, Ae++, _e(ye); - if ((224 & Pe) === 160) - return ye = 31 & Pe, Ae++, fe(ye); - if ((224 & Pe) === 224) - return ce = H.getInt8(Ae), Ae++, ce; - switch (Pe) { + var ue, we, Te = H[Ae]; + if (!(128 & Te)) + return Ae++, Te; + if ((240 & Te) === 128) + return we = 15 & Te, Ae++, K(we); + if ((240 & Te) === 144) + return we = 15 & Te, Ae++, _e(we); + if ((224 & Te) === 160) + return we = 31 & Te, Ae++, fe(we); + if ((224 & Te) === 224) + return ue = Z.getInt8(Ae), Ae++, ue; + switch (Te) { case 192: return Ae++, null; case 194: @@ -22819,171 +22819,171 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 195: return Ae++, !0; case 196: - return ye = H.getUint8(Ae + 1), Ae += 2, q(ye); + return we = Z.getUint8(Ae + 1), Ae += 2, q(we); case 197: - return ye = H.getUint16(Ae + 1), Ae += 3, q(ye); + return we = Z.getUint16(Ae + 1), Ae += 3, q(we); case 198: - return ye = H.getUint32(Ae + 1), Ae += 5, q(ye); + return we = Z.getUint32(Ae + 1), Ae += 5, q(we); case 202: - return ce = H.getFloat32(Ae + 1), Ae += 5, ce; + return ue = Z.getFloat32(Ae + 1), Ae += 5, ue; case 203: - return ce = H.getFloat64(Ae + 1), Ae += 9, ce; + return ue = Z.getFloat64(Ae + 1), Ae += 9, ue; case 204: - return ce = X[Ae + 1], Ae += 2, ce; + return ue = H[Ae + 1], Ae += 2, ue; case 205: - return ce = H.getUint16(Ae + 1), Ae += 3, ce; + return ue = Z.getUint16(Ae + 1), Ae += 3, ue; case 206: - return ce = H.getUint32(Ae + 1), Ae += 5, ce; + return ue = Z.getUint32(Ae + 1), Ae += 5, ue; case 208: - return ce = H.getInt8(Ae + 1), Ae += 2, ce; + return ue = Z.getInt8(Ae + 1), Ae += 2, ue; case 209: - return ce = H.getInt16(Ae + 1), Ae += 3, ce; + return ue = Z.getInt16(Ae + 1), Ae += 3, ue; case 210: - return ce = H.getInt32(Ae + 1), Ae += 5, ce; + return ue = Z.getInt32(Ae + 1), Ae += 5, ue; case 217: - return ye = H.getUint8(Ae + 1), Ae += 2, fe(ye); + return we = Z.getUint8(Ae + 1), Ae += 2, fe(we); case 218: - return ye = H.getUint16(Ae + 1), Ae += 3, fe(ye); + return we = Z.getUint16(Ae + 1), Ae += 3, fe(we); case 219: - return ye = H.getUint32(Ae + 1), Ae += 5, fe(ye); + return we = Z.getUint32(Ae + 1), Ae += 5, fe(we); case 220: - return ye = H.getUint16(Ae + 1), Ae += 3, _e(ye); + return we = Z.getUint16(Ae + 1), Ae += 3, _e(we); case 221: - return ye = H.getUint32(Ae + 1), Ae += 5, _e(ye); + return we = Z.getUint32(Ae + 1), Ae += 5, _e(we); case 222: - return ye = H.getUint16(Ae + 1), Ae += 3, Z(ye); + return we = Z.getUint16(Ae + 1), Ae += 3, K(we); case 223: - return ye = H.getUint32(Ae + 1), Ae += 5, Z(ye); + return we = Z.getUint32(Ae + 1), Ae += 5, K(we); } - throw new Error("Unknown type 0x" + Pe.toString(16)); + throw new Error("Unknown type 0x" + Te.toString(16)); } - var Ae = 0, H = new DataView(X.buffer); + var Ae = 0, Z = new DataView(H.buffer); return Me(); } - function xe(X, Z, q, fe) { - switch (X) { + function ye(H, K, q, fe) { + switch (H) { case 1: - return f(Z); + return f(K); case 2: - return A(Z); + return A(K); case 3: - return D(Z); + return D(K); case 4: - return n(Z); + return n(K); case 5: - return u(Z); + return u(K); case 6: - return a(n(Z), new Uint8Array(q)); + return a(n(K), new Uint8Array(q)); case 7: - return a(n(Z)); + return a(n(K)); case 8: - return R(n(Z)); + return R(n(K)); case 9: - return P(n(Z), n(fe)[0]); + return P(n(K), n(fe)[0]); case 10: - return W(D(Z), n(fe)[0]); + return W(D(K), n(fe)[0]); case 11: - return c(D(Z), n(fe)[0]); + return c(D(K), n(fe)[0]); case 12: - return $(D(Z), n(fe)[0]); + return z(D(K), n(fe)[0]); case 13: - return $(A(Z), n(fe)[0]); + return z(A(K), n(fe)[0]); case 14: - return S(D(Z)); + return S(D(K)); case 15: - return S(A(Z)); + return S(A(K)); } } - function Ie(X, Z) { - Z = Z || {}; - var q = Z.ignoreFields, fe = {}; - return ke.forEach(function(_e) { - var Me = q ? q.indexOf(_e) !== -1 : !1, Ae = X[_e]; - Me || Ae === void 0 || (Ae instanceof Uint8Array ? fe[_e] = xe.apply(null, G(Ae)) : fe[_e] = Ae); + function Pe(H, K) { + K = K || {}; + var q = K.ignoreFields, fe = {}; + return Ie.forEach(function(_e) { + var Me = q ? q.indexOf(_e) !== -1 : !1, Ae = H[_e]; + Me || Ae === void 0 || (Ae instanceof Uint8Array ? fe[_e] = ye.apply(null, N(Ae)) : fe[_e] = Ae); }), fe; } - function oe(X) { - return String.fromCharCode.apply(null, X).replace(/\0/g, ""); + function de(H) { + return String.fromCharCode.apply(null, H).replace(/\0/g, ""); } - function ve(X, Z, q) { + function pe(H, K, q) { q = q || {}; - var fe, _e, Me, Ae, H, ce, ye = q.firstModelOnly, Pe = Z.onModel, le = Z.onChain, De = Z.onGroup, K = Z.onAtom, Oe = Z.onBond, Ne = 0, I = 0, me = 0, ge = 0, Y = 0, ne = -1, Ee = X.chainNameList, He = X.secStructList, Ke = X.insCodeList, Ve = X.sequenceIndexList, qe = X.atomIdList, wt = X.bFactorList, nt = X.altLocList, rt = X.occupancyList, tt = X.bondAtomList, yt = X.bondOrderList; - for (fe = 0, _e = X.chainsPerModel.length; _e > fe && !(ye && Ne > 0); ++fe) { - var _t = X.chainsPerModel[Ne]; - for (Pe && Pe({ chainCount: _t, modelIndex: Ne }), Me = 0; _t > Me; ++Me) { - var It = X.groupsPerChain[I]; - if (le) { - var Ot = oe(X.chainIdList.subarray(4 * I, 4 * I + 4)), vt = null; - Ee && (vt = oe(Ee.subarray(4 * I, 4 * I + 4))), le({ groupCount: It, chainIndex: I, modelIndex: Ne, chainId: Ot, chainName: vt }); + var fe, _e, Me, Ae, Z, ue, we = q.firstModelOnly, Te = K.onModel, ae = K.onChain, De = K.onGroup, Y = K.onAtom, Oe = K.onBond, Ve = 0, I = 0, me = 0, ve = 0, X = 0, ne = -1, Ee = H.chainNameList, He = H.secStructList, Ke = H.insCodeList, je = H.sequenceIndexList, qe = H.atomIdList, wt = H.bFactorList, nt = H.altLocList, rt = H.occupancyList, tt = H.bondAtomList, yt = H.bondOrderList; + for (fe = 0, _e = H.chainsPerModel.length; _e > fe && !(we && Ve > 0); ++fe) { + var _t = H.chainsPerModel[Ve]; + for (Te && Te({ chainCount: _t, modelIndex: Ve }), Me = 0; _t > Me; ++Me) { + var It = H.groupsPerChain[I]; + if (ae) { + var Ot = de(H.chainIdList.subarray(4 * I, 4 * I + 4)), vt = null; + Ee && (vt = de(Ee.subarray(4 * I, 4 * I + 4))), ae({ groupCount: It, chainIndex: I, modelIndex: Ve, chainId: Ot, chainName: vt }); } for (Ae = 0; It > Ae; ++Ae) { - var mt = X.groupList[X.groupTypeList[me]], gt = mt.atomNameList.length; + var mt = H.groupList[H.groupTypeList[me]], pt = mt.atomNameList.length; if (De) { var Ct = null; He && (Ct = He[me]); var Mt = null; - X.insCodeList && (Mt = String.fromCharCode(Ke[me])); + H.insCodeList && (Mt = String.fromCharCode(Ke[me])); var Ft = null; - Ve && (Ft = Ve[me]), De({ atomCount: gt, groupIndex: me, chainIndex: I, modelIndex: Ne, groupId: X.groupIdList[me], groupType: X.groupTypeList[me], groupName: mt.groupName, singleLetterCode: mt.singleLetterCode, chemCompType: mt.chemCompType, secStruct: Ct, insCode: Mt, sequenceIndex: Ft }); + je && (Ft = je[me]), De({ atomCount: pt, groupIndex: me, chainIndex: I, modelIndex: Ve, groupId: H.groupIdList[me], groupType: H.groupTypeList[me], groupName: mt.groupName, singleLetterCode: mt.singleLetterCode, chemCompType: mt.chemCompType, secStruct: Ct, insCode: Mt, sequenceIndex: Ft }); } - for (H = 0; gt > H; ++H) { - if (K) { + for (Z = 0; pt > Z; ++Z) { + if (Y) { var hi = null; - qe && (hi = qe[ge]); + qe && (hi = qe[ve]); var Ut = null; - wt && (Ut = wt[ge]); + wt && (Ut = wt[ve]); var di = null; - nt && (di = String.fromCharCode(nt[ge])); + nt && (di = String.fromCharCode(nt[ve])); var ci = null; - rt && (ci = rt[ge]), K({ atomIndex: ge, groupIndex: me, chainIndex: I, modelIndex: Ne, atomId: hi, element: mt.elementList[H], atomName: mt.atomNameList[H], formalCharge: mt.formalChargeList[H], xCoord: X.xCoordList[ge], yCoord: X.yCoordList[ge], zCoord: X.zCoordList[ge], bFactor: Ut, altLoc: di, occupancy: ci }); + rt && (ci = rt[ve]), Y({ atomIndex: ve, groupIndex: me, chainIndex: I, modelIndex: Ve, atomId: hi, element: mt.elementList[Z], atomName: mt.atomNameList[Z], formalCharge: mt.formalChargeList[Z], xCoord: H.xCoordList[ve], yCoord: H.yCoordList[ve], zCoord: H.zCoordList[ve], bFactor: Ut, altLoc: di, occupancy: ci }); } - ge += 1; + ve += 1; } if (Oe) { var ui = mt.bondAtomList; - for (H = 0, ce = mt.bondOrderList.length; ce > H; ++H) - Oe({ atomIndex1: ge - gt + ui[2 * H], atomIndex2: ge - gt + ui[2 * H + 1], bondOrder: mt.bondOrderList[H] }); + for (Z = 0, ue = mt.bondOrderList.length; ue > Z; ++Z) + Oe({ atomIndex1: ve - pt + ui[2 * Z], atomIndex2: ve - pt + ui[2 * Z + 1], bondOrder: mt.bondOrderList[Z] }); } me += 1; } I += 1; } - if (Y = ne + 1, ne = ge - 1, Oe && tt) - for (H = 0, ce = tt.length; ce > H; H += 2) { - var _i = tt[H], gi = tt[H + 1]; - (_i >= Y && ne >= _i || gi >= Y && ne >= gi) && Oe({ atomIndex1: _i, atomIndex2: gi, bondOrder: yt ? yt[H / 2] : null }); + if (X = ne + 1, ne = ve - 1, Oe && tt) + for (Z = 0, ue = tt.length; ue > Z; Z += 2) { + var _i = tt[Z], pi = tt[Z + 1]; + (_i >= X && ne >= _i || pi >= X && ne >= pi) && Oe({ atomIndex1: _i, atomIndex2: pi, bondOrder: yt ? yt[Z / 2] : null }); } - Ne += 1; + Ve += 1; } } - function re(X) { - return o(ae(X)); + function re(H) { + return o(se(H)); } - function Se(X, Z) { - X instanceof ArrayBuffer && (X = new Uint8Array(X)); + function Se(H, K) { + H instanceof ArrayBuffer && (H = new Uint8Array(H)); var q; - return q = X instanceof Uint8Array ? we(X) : X, Ie(q, Z); + return q = H instanceof Uint8Array ? xe(H) : H, Pe(q, K); } - function ze(X, Z, q, fe) { + function ke(H, K, q, fe) { function _e() { try { var Ae = Se(Me.response); q(Ae); - } catch (H) { - fe(H); + } catch (Z) { + fe(Z); } } var Me = new XMLHttpRequest(); - Me.addEventListener("load", _e, !0), Me.addEventListener("error", fe, !0), Me.responseType = "arraybuffer", Me.open("GET", Z + X.toUpperCase()), Me.send(); + Me.addEventListener("load", _e, !0), Me.addEventListener("error", fe, !0), Me.responseType = "arraybuffer", Me.open("GET", K + H.toUpperCase()), Me.send(); } - function Ge(X, Z, q) { - ze(X, je, Z, q); + function $e(H, K, q) { + ke(H, Be, K, q); } - function $e(X, Z, q) { - ze(X, Fe, Z, q); + function ze(H, K, q) { + ke(H, Ne, K, q); } - var Re = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], Be = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], ke = Re.concat(Be), We = "v1.0.1", Te = "//mmtf.rcsb.org/v1.0/", je = Te + "full/", Fe = Te + "reduced/"; - e.encode = re, e.decode = Se, e.traverse = ve, e.fetch = Ge, e.fetchReduced = $e, e.version = We, e.fetchUrl = je, e.fetchReducedUrl = Fe, e.encodeMsgpack = o, e.encodeMmtf = ae, e.decodeMsgpack = we, e.decodeMmtf = Ie; + var Re = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], Fe = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], Ie = Re.concat(Fe), We = "v1.0.1", Ue = "//mmtf.rcsb.org/v1.0/", Be = Ue + "full/", Ne = Ue + "reduced/"; + e.encode = re, e.decode = Se, e.traverse = pe, e.fetch = $e, e.fetchReduced = ze, e.version = We, e.fetchUrl = Be, e.fetchReducedUrl = Ne, e.encodeMsgpack = o, e.encodeMmtf = se, e.decodeMsgpack = xe, e.decodeMmtf = Pe; }); } ), @@ -23048,66 +23048,66 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* harmony export */ }); /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ - const l = 4, g = 0, _ = 1, x = 2; + const l = 4, p = 0, _ = 1, x = 2; function o(v) { - let V = v.length; - for (; --V >= 0; ) - v[V] = 0; + let j = v.length; + for (; --j >= 0; ) + v[j] = 0; } - const p = 0, E = 1, u = 2, A = 3, C = 258, L = 29, D = 256, r = D + 1 + L, n = 30, b = 19, f = 2 * r + 1, c = 15, t = 16, a = 7, h = 256, M = 16, w = 17, S = 18, T = ( + const g = 0, E = 1, u = 2, A = 3, L = 258, C = 29, D = 256, r = D + 1 + C, n = 30, b = 19, f = 2 * r + 1, c = 15, t = 16, a = 7, h = 256, M = 16, w = 17, S = 18, T = ( /* 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]) ), R = ( /* 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 = ( + ), $ = ( /* 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, U = new Array((r + 2) * 2); - o(U); - const F = new Array(n * 2); + ), P = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), B = 512, F = new Array((r + 2) * 2); o(F); - const $ = new Array(B); - o($); - const W = new Array(C - A + 1); + const U = new Array(n * 2); + o(U); + const z = new Array(B); + o(z); + const W = new Array(L - A + 1); o(W); - const N = new Array(L); + const V = new Array(C); + o(V); + const N = new Array(n); o(N); - const G = new Array(n); - o(G); - function k(v, V, O, J, te) { - this.static_tree = v, this.extra_bits = V, this.extra_base = O, this.elems = J, this.max_length = te, this.has_stree = v && v.length; + function k(v, j, O, J, te) { + this.static_tree = v, this.extra_bits = j, this.extra_base = O, this.elems = J, this.max_length = te, this.has_stree = v && v.length; } - let j, Q, ie; - function pe(v, V) { - this.dyn_tree = v, this.max_code = 0, this.stat_desc = V; + let G, Q, ie; + function ge(v, j) { + this.dyn_tree = v, this.max_code = 0, this.stat_desc = j; } - const he = (v) => v < 256 ? $[v] : $[256 + (v >>> 7)], ue = (v, V) => { - v.pending_buf[v.pending++] = V & 255, v.pending_buf[v.pending++] = V >>> 8 & 255; - }, se = (v, V, O) => { - v.bi_valid > t - O ? (v.bi_buf |= V << v.bi_valid & 65535, ue(v, v.bi_buf), v.bi_buf = V >> t - v.bi_valid, v.bi_valid += O - t) : (v.bi_buf |= V << v.bi_valid & 65535, v.bi_valid += O); - }, ae = (v, V, O) => { - se( + const le = (v) => v < 256 ? z[v] : z[256 + (v >>> 7)], oe = (v, j) => { + v.pending_buf[v.pending++] = j & 255, v.pending_buf[v.pending++] = j >>> 8 & 255; + }, he = (v, j, O) => { + v.bi_valid > t - O ? (v.bi_buf |= j << v.bi_valid & 65535, oe(v, v.bi_buf), v.bi_buf = j >> t - v.bi_valid, v.bi_valid += O - t) : (v.bi_buf |= j << v.bi_valid & 65535, v.bi_valid += O); + }, se = (v, j, O) => { + he( v, - O[V * 2], - O[V * 2 + 1] + O[j * 2], + O[j * 2 + 1] /*.Len*/ ); - }, we = (v, V) => { + }, xe = (v, j) => { let O = 0; do O |= v & 1, v >>>= 1, O <<= 1; - while (--V > 0); + while (--j > 0); return O >>> 1; - }, xe = (v) => { - v.bi_valid === 16 ? (ue(v, v.bi_buf), v.bi_buf = 0, v.bi_valid = 0) : v.bi_valid >= 8 && (v.pending_buf[v.pending++] = v.bi_buf & 255, v.bi_buf >>= 8, v.bi_valid -= 8); - }, Ie = (v, V) => { - const O = V.dyn_tree, J = V.max_code, te = V.stat_desc.static_tree, ee = V.stat_desc.has_stree, Ce = V.stat_desc.extra_bits, be = V.stat_desc.extra_base, Xe = V.stat_desc.max_length; - let de, Le, ht, Ye, Ue, Qe, xt = 0; + }, ye = (v) => { + v.bi_valid === 16 ? (oe(v, v.bi_buf), v.bi_buf = 0, v.bi_valid = 0) : v.bi_valid >= 8 && (v.pending_buf[v.pending++] = v.bi_buf & 255, v.bi_buf >>= 8, v.bi_valid -= 8); + }, Pe = (v, j) => { + const O = j.dyn_tree, J = j.max_code, te = j.stat_desc.static_tree, ee = j.stat_desc.has_stree, Ce = j.stat_desc.extra_bits, be = j.stat_desc.extra_base, Xe = j.stat_desc.max_length; + let ce, Le, ht, Ye, Ge, Qe, xt = 0; for (Ye = 0; Ye <= c; Ye++) v.bl_count[Ye] = 0; - for (O[v.heap[v.heap_max] * 2 + 1] = 0, de = v.heap_max + 1; de < f; de++) - Le = v.heap[de], Ye = O[O[Le * 2 + 1] * 2 + 1] + 1, Ye > Xe && (Ye = Xe, xt++), O[Le * 2 + 1] = Ye, !(Le > J) && (v.bl_count[Ye]++, Ue = 0, Le >= be && (Ue = Ce[Le - be]), Qe = O[Le * 2], v.opt_len += Qe * (Ye + Ue), ee && (v.static_len += Qe * (te[Le * 2 + 1] + Ue))); + for (O[v.heap[v.heap_max] * 2 + 1] = 0, ce = v.heap_max + 1; ce < f; ce++) + Le = v.heap[ce], Ye = O[O[Le * 2 + 1] * 2 + 1] + 1, Ye > Xe && (Ye = Xe, xt++), O[Le * 2 + 1] = Ye, !(Le > J) && (v.bl_count[Ye]++, Ge = 0, Le >= be && (Ge = Ce[Le - be]), Qe = O[Le * 2], v.opt_len += Qe * (Ye + Ge), ee && (v.static_len += Qe * (te[Le * 2 + 1] + Ge))); if (xt !== 0) { do { for (Ye = Xe - 1; v.bl_count[Ye] === 0; ) @@ -23116,79 +23116,79 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } while (xt > 0); for (Ye = Xe; Ye !== 0; Ye--) for (Le = v.bl_count[Ye]; Le !== 0; ) - ht = v.heap[--de], !(ht > J) && (O[ht * 2 + 1] !== Ye && (v.opt_len += (Ye - O[ht * 2 + 1]) * O[ht * 2], O[ht * 2 + 1] = Ye), Le--); + ht = v.heap[--ce], !(ht > J) && (O[ht * 2 + 1] !== Ye && (v.opt_len += (Ye - O[ht * 2 + 1]) * O[ht * 2], O[ht * 2 + 1] = Ye), Le--); } - }, oe = (v, V, O) => { + }, de = (v, j, O) => { const J = new Array(c + 1); let te = 0, ee, Ce; for (ee = 1; ee <= c; ee++) te = te + O[ee - 1] << 1, J[ee] = te; - for (Ce = 0; Ce <= V; Ce++) { + for (Ce = 0; Ce <= j; Ce++) { let be = v[Ce * 2 + 1]; - be !== 0 && (v[Ce * 2] = we(J[be]++, be)); + be !== 0 && (v[Ce * 2] = xe(J[be]++, be)); } - }, ve = () => { - let v, V, O, J, te; + }, pe = () => { + let v, j, O, J, te; const ee = new Array(c + 1); - for (O = 0, J = 0; J < L - 1; J++) - for (N[J] = O, v = 0; v < 1 << T[J]; v++) + for (O = 0, J = 0; J < C - 1; J++) + for (V[J] = O, v = 0; v < 1 << T[J]; v++) W[O++] = J; for (W[O - 1] = J, te = 0, J = 0; J < 16; J++) - for (G[J] = te, v = 0; v < 1 << R[J]; v++) - $[te++] = J; + for (N[J] = te, v = 0; v < 1 << R[J]; v++) + z[te++] = J; for (te >>= 7; J < n; J++) - for (G[J] = te << 7, v = 0; v < 1 << R[J] - 7; v++) - $[256 + te++] = J; - for (V = 0; V <= c; V++) - ee[V] = 0; + for (N[J] = te << 7, v = 0; v < 1 << R[J] - 7; v++) + z[256 + te++] = J; + for (j = 0; j <= c; j++) + ee[j] = 0; for (v = 0; v <= 143; ) - U[v * 2 + 1] = 8, v++, ee[8]++; + F[v * 2 + 1] = 8, v++, ee[8]++; for (; v <= 255; ) - U[v * 2 + 1] = 9, v++, ee[9]++; + F[v * 2 + 1] = 9, v++, ee[9]++; for (; v <= 279; ) - U[v * 2 + 1] = 7, v++, ee[7]++; + F[v * 2 + 1] = 7, v++, ee[7]++; for (; v <= 287; ) - U[v * 2 + 1] = 8, v++, ee[8]++; - for (oe(U, r + 1, ee), v = 0; v < n; v++) - F[v * 2 + 1] = 5, F[v * 2] = we(v, 5); - j = new k(U, T, D + 1, r, c), Q = new k(F, R, 0, n, c), ie = new k(new Array(0), z, 0, b, a); + F[v * 2 + 1] = 8, v++, ee[8]++; + for (de(F, r + 1, ee), v = 0; v < n; v++) + U[v * 2 + 1] = 5, U[v * 2] = xe(v, 5); + G = new k(F, T, D + 1, r, c), Q = new k(U, R, 0, n, c), ie = new k(new Array(0), $, 0, b, a); }, re = (v) => { - let V; - for (V = 0; V < r; V++) - v.dyn_ltree[V * 2] = 0; - for (V = 0; V < n; V++) - v.dyn_dtree[V * 2] = 0; - for (V = 0; V < b; V++) - v.bl_tree[V * 2] = 0; + let j; + for (j = 0; j < r; j++) + v.dyn_ltree[j * 2] = 0; + for (j = 0; j < n; j++) + v.dyn_dtree[j * 2] = 0; + for (j = 0; j < b; j++) + v.bl_tree[j * 2] = 0; v.dyn_ltree[h * 2] = 1, v.opt_len = v.static_len = 0, v.sym_next = v.matches = 0; }, Se = (v) => { - v.bi_valid > 8 ? ue(v, v.bi_buf) : v.bi_valid > 0 && (v.pending_buf[v.pending++] = v.bi_buf), v.bi_buf = 0, v.bi_valid = 0; - }, ze = (v, V, O, J) => { - const te = V * 2, ee = O * 2; - return v[te] < v[ee] || v[te] === v[ee] && J[V] <= J[O]; - }, Ge = (v, V, O) => { + v.bi_valid > 8 ? oe(v, v.bi_buf) : v.bi_valid > 0 && (v.pending_buf[v.pending++] = v.bi_buf), v.bi_buf = 0, v.bi_valid = 0; + }, ke = (v, j, O, J) => { + const te = j * 2, ee = O * 2; + return v[te] < v[ee] || v[te] === v[ee] && J[j] <= J[O]; + }, $e = (v, j, O) => { const J = v.heap[O]; let te = O << 1; - for (; te <= v.heap_len && (te < v.heap_len && ze(V, v.heap[te + 1], v.heap[te], v.depth) && te++, !ze(V, J, v.heap[te], v.depth)); ) + for (; te <= v.heap_len && (te < v.heap_len && ke(j, v.heap[te + 1], v.heap[te], v.depth) && te++, !ke(j, J, v.heap[te], v.depth)); ) v.heap[O] = v.heap[te], O = te, te <<= 1; v.heap[O] = J; - }, $e = (v, V, O) => { + }, ze = (v, j, O) => { let J, te, ee = 0, Ce, be; if (v.sym_next !== 0) do - J = v.pending_buf[v.sym_buf + ee++] & 255, J += (v.pending_buf[v.sym_buf + ee++] & 255) << 8, te = v.pending_buf[v.sym_buf + ee++], J === 0 ? ae(v, te, V) : (Ce = W[te], ae(v, Ce + D + 1, V), be = T[Ce], be !== 0 && (te -= N[Ce], se(v, te, be)), J--, Ce = he(J), ae(v, Ce, O), be = R[Ce], be !== 0 && (J -= G[Ce], se(v, J, be))); + J = v.pending_buf[v.sym_buf + ee++] & 255, J += (v.pending_buf[v.sym_buf + ee++] & 255) << 8, te = v.pending_buf[v.sym_buf + ee++], J === 0 ? se(v, te, j) : (Ce = W[te], se(v, Ce + D + 1, j), be = T[Ce], be !== 0 && (te -= V[Ce], he(v, te, be)), J--, Ce = le(J), se(v, Ce, O), be = R[Ce], be !== 0 && (J -= N[Ce], he(v, J, be))); while (ee < v.sym_next); - ae(v, h, V); - }, Re = (v, V) => { - const O = V.dyn_tree, J = V.stat_desc.static_tree, te = V.stat_desc.has_stree, ee = V.stat_desc.elems; - let Ce, be, Xe = -1, de; + se(v, h, j); + }, Re = (v, j) => { + const O = j.dyn_tree, J = j.stat_desc.static_tree, te = j.stat_desc.has_stree, ee = j.stat_desc.elems; + let Ce, be, Xe = -1, ce; for (v.heap_len = 0, v.heap_max = f, Ce = 0; Ce < ee; Ce++) O[Ce * 2] !== 0 ? (v.heap[++v.heap_len] = Xe = Ce, v.depth[Ce] = 0) : O[Ce * 2 + 1] = 0; for (; v.heap_len < 2; ) - de = v.heap[++v.heap_len] = Xe < 2 ? ++Xe : 0, O[de * 2] = 1, v.depth[de] = 0, v.opt_len--, te && (v.static_len -= J[de * 2 + 1]); - for (V.max_code = Xe, Ce = v.heap_len >> 1; Ce >= 1; Ce--) - Ge(v, O, Ce); - de = ee; + ce = v.heap[++v.heap_len] = Xe < 2 ? ++Xe : 0, O[ce * 2] = 1, v.depth[ce] = 0, v.opt_len--, te && (v.static_len -= J[ce * 2 + 1]); + for (j.max_code = Xe, Ce = v.heap_len >> 1; Ce >= 1; Ce--) + $e(v, O, Ce); + ce = ee; do Ce = v.heap[ 1 @@ -23196,7 +23196,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ], v.heap[ 1 /*SMALLEST*/ - ] = v.heap[v.heap_len--], Ge( + ] = v.heap[v.heap_len--], $e( v, O, 1 @@ -23204,10 +23204,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ), be = v.heap[ 1 /*SMALLEST*/ - ], v.heap[--v.heap_max] = Ce, v.heap[--v.heap_max] = be, O[de * 2] = O[Ce * 2] + O[be * 2], v.depth[de] = (v.depth[Ce] >= v.depth[be] ? v.depth[Ce] : v.depth[be]) + 1, O[Ce * 2 + 1] = O[be * 2 + 1] = de, v.heap[ + ], v.heap[--v.heap_max] = Ce, v.heap[--v.heap_max] = be, O[ce * 2] = O[Ce * 2] + O[be * 2], v.depth[ce] = (v.depth[Ce] >= v.depth[be] ? v.depth[Ce] : v.depth[be]) + 1, O[Ce * 2 + 1] = O[be * 2 + 1] = ce, v.heap[ 1 /*SMALLEST*/ - ] = de++, Ge( + ] = ce++, $e( v, O, 1 @@ -23217,88 +23217,88 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; v.heap[--v.heap_max] = v.heap[ 1 /*SMALLEST*/ - ], Ie(v, V), oe(O, Xe, v.bl_count); - }, Be = (v, V, O) => { - let J, te = -1, ee, Ce = V[0 * 2 + 1], be = 0, Xe = 7, de = 4; - for (Ce === 0 && (Xe = 138, de = 3), V[(O + 1) * 2 + 1] = 65535, J = 0; J <= O; J++) - ee = Ce, Ce = V[(J + 1) * 2 + 1], !(++be < Xe && ee === Ce) && (be < de ? v.bl_tree[ee * 2] += be : ee !== 0 ? (ee !== te && v.bl_tree[ee * 2]++, v.bl_tree[M * 2]++) : be <= 10 ? v.bl_tree[w * 2]++ : v.bl_tree[S * 2]++, be = 0, te = ee, Ce === 0 ? (Xe = 138, de = 3) : ee === Ce ? (Xe = 6, de = 3) : (Xe = 7, de = 4)); - }, ke = (v, V, O) => { - let J, te = -1, ee, Ce = V[0 * 2 + 1], be = 0, Xe = 7, de = 4; - for (Ce === 0 && (Xe = 138, de = 3), J = 0; J <= O; J++) - if (ee = Ce, Ce = V[(J + 1) * 2 + 1], !(++be < Xe && ee === Ce)) { - if (be < de) + ], Pe(v, j), de(O, Xe, v.bl_count); + }, Fe = (v, j, O) => { + let J, te = -1, ee, Ce = j[0 * 2 + 1], be = 0, Xe = 7, ce = 4; + for (Ce === 0 && (Xe = 138, ce = 3), j[(O + 1) * 2 + 1] = 65535, J = 0; J <= O; J++) + ee = Ce, Ce = j[(J + 1) * 2 + 1], !(++be < Xe && ee === Ce) && (be < ce ? v.bl_tree[ee * 2] += be : ee !== 0 ? (ee !== te && v.bl_tree[ee * 2]++, v.bl_tree[M * 2]++) : be <= 10 ? v.bl_tree[w * 2]++ : v.bl_tree[S * 2]++, be = 0, te = ee, Ce === 0 ? (Xe = 138, ce = 3) : ee === Ce ? (Xe = 6, ce = 3) : (Xe = 7, ce = 4)); + }, Ie = (v, j, O) => { + let J, te = -1, ee, Ce = j[0 * 2 + 1], be = 0, Xe = 7, ce = 4; + for (Ce === 0 && (Xe = 138, ce = 3), J = 0; J <= O; J++) + if (ee = Ce, Ce = j[(J + 1) * 2 + 1], !(++be < Xe && ee === Ce)) { + if (be < ce) do - ae(v, ee, v.bl_tree); + se(v, ee, v.bl_tree); while (--be !== 0); else - ee !== 0 ? (ee !== te && (ae(v, ee, v.bl_tree), be--), ae(v, M, v.bl_tree), se(v, be - 3, 2)) : be <= 10 ? (ae(v, w, v.bl_tree), se(v, be - 3, 3)) : (ae(v, S, v.bl_tree), se(v, be - 11, 7)); - be = 0, te = ee, Ce === 0 ? (Xe = 138, de = 3) : ee === Ce ? (Xe = 6, de = 3) : (Xe = 7, de = 4); + ee !== 0 ? (ee !== te && (se(v, ee, v.bl_tree), be--), se(v, M, v.bl_tree), he(v, be - 3, 2)) : be <= 10 ? (se(v, w, v.bl_tree), he(v, be - 3, 3)) : (se(v, S, v.bl_tree), he(v, be - 11, 7)); + be = 0, te = ee, Ce === 0 ? (Xe = 138, ce = 3) : ee === Ce ? (Xe = 6, ce = 3) : (Xe = 7, ce = 4); } }, We = (v) => { - let V; - for (Be(v, v.dyn_ltree, v.l_desc.max_code), Be(v, v.dyn_dtree, v.d_desc.max_code), Re(v, v.bl_desc), V = b - 1; V >= 3 && v.bl_tree[P[V] * 2 + 1] === 0; V--) + let j; + for (Fe(v, v.dyn_ltree, v.l_desc.max_code), Fe(v, v.dyn_dtree, v.d_desc.max_code), Re(v, v.bl_desc), j = b - 1; j >= 3 && v.bl_tree[P[j] * 2 + 1] === 0; j--) ; - return v.opt_len += 3 * (V + 1) + 5 + 5 + 4, V; - }, Te = (v, V, O, J) => { + return v.opt_len += 3 * (j + 1) + 5 + 5 + 4, j; + }, Ue = (v, j, O, J) => { let te; - for (se(v, V - 257, 5), se(v, O - 1, 5), se(v, J - 4, 4), te = 0; te < J; te++) - se(v, v.bl_tree[P[te] * 2 + 1], 3); - ke(v, v.dyn_ltree, V - 1), ke(v, v.dyn_dtree, O - 1); - }, je = (v) => { - let V = 4093624447, O; - for (O = 0; O <= 31; O++, V >>>= 1) - if (V & 1 && v.dyn_ltree[O * 2] !== 0) - return g; + for (he(v, j - 257, 5), he(v, O - 1, 5), he(v, J - 4, 4), te = 0; te < J; te++) + he(v, v.bl_tree[P[te] * 2 + 1], 3); + Ie(v, v.dyn_ltree, j - 1), Ie(v, v.dyn_dtree, O - 1); + }, Be = (v) => { + let j = 4093624447, O; + for (O = 0; O <= 31; O++, j >>>= 1) + if (j & 1 && v.dyn_ltree[O * 2] !== 0) + return p; if (v.dyn_ltree[9 * 2] !== 0 || v.dyn_ltree[10 * 2] !== 0 || v.dyn_ltree[13 * 2] !== 0) return _; for (O = 32; O < D; O++) if (v.dyn_ltree[O * 2] !== 0) return _; - return g; + return p; }; - let Fe = !1; - const X = (v) => { - Fe || (ve(), Fe = !0), v.l_desc = new pe(v.dyn_ltree, j), v.d_desc = new pe(v.dyn_dtree, Q), v.bl_desc = new pe(v.bl_tree, ie), v.bi_buf = 0, v.bi_valid = 0, re(v); - }, Z = (v, V, O, J) => { - se(v, (p << 1) + (J ? 1 : 0), 3), Se(v), ue(v, O), ue(v, ~O), O && v.pending_buf.set(v.window.subarray(V, V + O), v.pending), v.pending += O; + let Ne = !1; + const H = (v) => { + Ne || (pe(), Ne = !0), v.l_desc = new ge(v.dyn_ltree, G), v.d_desc = new ge(v.dyn_dtree, Q), v.bl_desc = new ge(v.bl_tree, ie), v.bi_buf = 0, v.bi_valid = 0, re(v); + }, K = (v, j, O, J) => { + he(v, (g << 1) + (J ? 1 : 0), 3), Se(v), oe(v, O), oe(v, ~O), O && v.pending_buf.set(v.window.subarray(j, j + O), v.pending), v.pending += O; }, q = (v) => { - se(v, E << 1, 3), ae(v, h, U), xe(v); - }, fe = (v, V, O, J) => { + he(v, E << 1, 3), se(v, h, F), ye(v); + }, fe = (v, j, O, J) => { let te, ee, Ce = 0; - v.level > 0 ? (v.strm.data_type === x && (v.strm.data_type = je(v)), Re(v, v.l_desc), Re(v, v.d_desc), Ce = We(v), te = v.opt_len + 3 + 7 >>> 3, ee = v.static_len + 3 + 7 >>> 3, ee <= te && (te = ee)) : te = ee = O + 5, O + 4 <= te && V !== -1 ? Z(v, V, O, J) : v.strategy === l || ee === te ? (se(v, (E << 1) + (J ? 1 : 0), 3), $e(v, U, F)) : (se(v, (u << 1) + (J ? 1 : 0), 3), Te(v, v.l_desc.max_code + 1, v.d_desc.max_code + 1, Ce + 1), $e(v, v.dyn_ltree, v.dyn_dtree)), re(v), J && Se(v); - }, _e = (v, V, O) => (v.pending_buf[v.sym_buf + v.sym_next++] = V, v.pending_buf[v.sym_buf + v.sym_next++] = V >> 8, v.pending_buf[v.sym_buf + v.sym_next++] = O, V === 0 ? v.dyn_ltree[O * 2]++ : (v.matches++, V--, v.dyn_ltree[(W[O] + D + 1) * 2]++, v.dyn_dtree[he(V) * 2]++), v.sym_next === v.sym_end); - var Me = X, Ae = Z, H = fe, ce = _e, ye = q, Pe = { + v.level > 0 ? (v.strm.data_type === x && (v.strm.data_type = Be(v)), Re(v, v.l_desc), Re(v, v.d_desc), Ce = We(v), te = v.opt_len + 3 + 7 >>> 3, ee = v.static_len + 3 + 7 >>> 3, ee <= te && (te = ee)) : te = ee = O + 5, O + 4 <= te && j !== -1 ? K(v, j, O, J) : v.strategy === l || ee === te ? (he(v, (E << 1) + (J ? 1 : 0), 3), ze(v, F, U)) : (he(v, (u << 1) + (J ? 1 : 0), 3), Ue(v, v.l_desc.max_code + 1, v.d_desc.max_code + 1, Ce + 1), ze(v, v.dyn_ltree, v.dyn_dtree)), re(v), J && Se(v); + }, _e = (v, j, O) => (v.pending_buf[v.sym_buf + v.sym_next++] = j, v.pending_buf[v.sym_buf + v.sym_next++] = j >> 8, v.pending_buf[v.sym_buf + v.sym_next++] = O, j === 0 ? v.dyn_ltree[O * 2]++ : (v.matches++, j--, v.dyn_ltree[(W[O] + D + 1) * 2]++, v.dyn_dtree[le(j) * 2]++), v.sym_next === v.sym_end); + var Me = H, Ae = K, Z = fe, ue = _e, we = q, Te = { _tr_init: Me, _tr_stored_block: Ae, - _tr_flush_block: H, - _tr_tally: ce, - _tr_align: ye - }, De = (v, V, O, J) => { + _tr_flush_block: Z, + _tr_tally: ue, + _tr_align: we + }, De = (v, j, O, J) => { let te = v & 65535 | 0, ee = v >>> 16 & 65535 | 0, Ce = 0; for (; O !== 0; ) { Ce = O > 2e3 ? 2e3 : O, O -= Ce; do - te = te + V[J++] | 0, ee = ee + te | 0; + te = te + j[J++] | 0, ee = ee + te | 0; while (--Ce); te %= 65521, ee %= 65521; } return te | ee << 16 | 0; }; - const K = () => { - let v, V = []; + const Y = () => { + let v, j = []; for (var O = 0; O < 256; O++) { v = O; for (var J = 0; J < 8; J++) v = v & 1 ? 3988292384 ^ v >>> 1 : v >>> 1; - V[O] = v; + j[O] = v; } - return V; - }, Oe = new Uint32Array(K()); - var I = (v, V, O, J) => { + return j; + }, Oe = new Uint32Array(Y()); + var I = (v, j, O, J) => { const te = Oe, ee = J + O; v ^= -1; for (let Ce = J; Ce < ee; Ce++) - v = v >>> 8 ^ te[(v ^ V[Ce]) & 255]; + v = v >>> 8 ^ te[(v ^ j[Ce]) & 255]; return v ^ -1; }, me = { 2: "need dictionary", @@ -23319,7 +23319,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* Z_BUF_ERROR (-5) */ "-6": "incompatible version" /* Z_VERSION_ERROR (-6) */ - }, ge = { + }, ve = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, @@ -23359,8 +23359,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; - const { _tr_init: Y, _tr_stored_block: ne, _tr_flush_block: Ee, _tr_tally: He, _tr_align: Ke } = Pe, { - Z_NO_FLUSH: Ve, + const { _tr_init: X, _tr_stored_block: ne, _tr_flush_block: Ee, _tr_tally: He, _tr_align: Ke } = Te, { + Z_NO_FLUSH: je, Z_PARTIAL_FLUSH: qe, Z_FULL_FLUSH: wt, Z_FINISH: nt, @@ -23372,83 +23372,83 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_BUF_ERROR: Ot, Z_DEFAULT_COMPRESSION: vt, Z_FILTERED: mt, - Z_HUFFMAN_ONLY: gt, + Z_HUFFMAN_ONLY: pt, Z_RLE: Ct, Z_FIXED: Mt, Z_DEFAULT_STRATEGY: Ft, Z_UNKNOWN: hi, Z_DEFLATED: Ut - } = ge, di = 9, ci = 15, ui = 8, Ci = 256 + 1 + 29, Qr = 30, Jr = 19, qr = 2 * Ci + 1, en = 15, at = 3, $t = 258, Tt = $t + at + 1, tn = 32, Kt = 42, Li = 57, Di = 69, Si = 73, Oi = 91, Ti = 103, Wt = 113, qt = 666, At = 1, Zt = 2, Gt = 3, Yt = 4, rn = 3, Nt = (v, V) => (v.msg = me[V], V), Vi = (v) => v * 2 - (v > 4 ? 9 : 0), Bt = (v) => { - let V = v.length; - for (; --V >= 0; ) - v[V] = 0; + } = ve, di = 9, ci = 15, ui = 8, Ci = 256 + 1 + 29, Qr = 30, Jr = 19, qr = 2 * Ci + 1, en = 15, at = 3, $t = 258, Tt = $t + at + 1, tn = 32, Kt = 42, Li = 57, Di = 69, Si = 73, Oi = 91, Ti = 103, Wt = 113, qt = 666, At = 1, Zt = 2, Gt = 3, Yt = 4, rn = 3, Nt = (v, j) => (v.msg = me[j], j), Vi = (v) => v * 2 - (v > 4 ? 9 : 0), Bt = (v) => { + let j = v.length; + for (; --j >= 0; ) + v[j] = 0; }, nn = (v) => { - let V, O, J, te = v.w_size; - V = v.hash_size, J = V; + let j, O, J, te = v.w_size; + j = v.hash_size, J = j; do O = v.head[--J], v.head[J] = O >= te ? O - te : 0; - while (--V); - V = te, J = V; + while (--j); + j = te, J = j; do O = v.prev[--J], v.prev[J] = O >= te ? O - te : 0; - while (--V); + while (--j); }; - let kt = (v, V, O) => (V << v.hash_shift ^ O) & v.hash_mask; + let kt = (v, j, O) => (j << v.hash_shift ^ O) & v.hash_mask; const Lt = (v) => { - const V = v.state; - let O = V.pending; - O > v.avail_out && (O = v.avail_out), O !== 0 && (v.output.set(V.pending_buf.subarray(V.pending_out, V.pending_out + O), v.next_out), v.next_out += O, V.pending_out += O, v.total_out += O, v.avail_out -= O, V.pending -= O, V.pending === 0 && (V.pending_out = 0)); - }, Dt = (v, V) => { - Ee(v, v.block_start >= 0 ? v.block_start : -1, v.strstart - v.block_start, V), v.block_start = v.strstart, Lt(v.strm); - }, dt = (v, V) => { - v.pending_buf[v.pending++] = V; - }, ei = (v, V) => { - v.pending_buf[v.pending++] = V >>> 8 & 255, v.pending_buf[v.pending++] = V & 255; - }, Pi = (v, V, O, J) => { + const j = v.state; + let O = j.pending; + O > v.avail_out && (O = v.avail_out), O !== 0 && (v.output.set(j.pending_buf.subarray(j.pending_out, j.pending_out + O), v.next_out), v.next_out += O, j.pending_out += O, v.total_out += O, v.avail_out -= O, j.pending -= O, j.pending === 0 && (j.pending_out = 0)); + }, Dt = (v, j) => { + Ee(v, v.block_start >= 0 ? v.block_start : -1, v.strstart - v.block_start, j), v.block_start = v.strstart, Lt(v.strm); + }, dt = (v, j) => { + v.pending_buf[v.pending++] = j; + }, ei = (v, j) => { + v.pending_buf[v.pending++] = j >>> 8 & 255, v.pending_buf[v.pending++] = j & 255; + }, Pi = (v, j, O, J) => { let te = v.avail_in; - return te > J && (te = J), te === 0 ? 0 : (v.avail_in -= te, V.set(v.input.subarray(v.next_in, v.next_in + te), O), v.state.wrap === 1 ? v.adler = De(v.adler, V, te, O) : v.state.wrap === 2 && (v.adler = I(v.adler, V, te, O)), v.next_in += te, v.total_in += te, te); - }, ji = (v, V) => { + return te > J && (te = J), te === 0 ? 0 : (v.avail_in -= te, j.set(v.input.subarray(v.next_in, v.next_in + te), O), v.state.wrap === 1 ? v.adler = De(v.adler, j, te, O) : v.state.wrap === 2 && (v.adler = I(v.adler, j, te, O)), v.next_in += te, v.total_in += te, te); + }, ji = (v, j) => { let O = v.max_chain_length, J = v.strstart, te, ee, Ce = v.prev_length, be = v.nice_match; - const Xe = v.strstart > v.w_size - Tt ? v.strstart - (v.w_size - Tt) : 0, de = v.window, Le = v.w_mask, ht = v.prev, Ye = v.strstart + $t; - let Ue = de[J + Ce - 1], Qe = de[J + Ce]; + const Xe = v.strstart > v.w_size - Tt ? v.strstart - (v.w_size - Tt) : 0, ce = v.window, Le = v.w_mask, ht = v.prev, Ye = v.strstart + $t; + let Ge = ce[J + Ce - 1], Qe = ce[J + Ce]; v.prev_length >= v.good_match && (O >>= 2), be > v.lookahead && (be = v.lookahead); do - if (te = V, !(de[te + Ce] !== Qe || de[te + Ce - 1] !== Ue || de[te] !== de[J] || de[++te] !== de[J + 1])) { + if (te = j, !(ce[te + Ce] !== Qe || ce[te + Ce - 1] !== Ge || ce[te] !== ce[J] || ce[++te] !== ce[J + 1])) { J += 2, te++; do ; - while (de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && de[++J] === de[++te] && J < Ye); + while (ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && ce[++J] === ce[++te] && J < Ye); if (ee = $t - (Ye - J), J = Ye - $t, ee > Ce) { - if (v.match_start = V, Ce = ee, ee >= be) + if (v.match_start = j, Ce = ee, ee >= be) break; - Ue = de[J + Ce - 1], Qe = de[J + Ce]; + Ge = ce[J + Ce - 1], Qe = ce[J + Ce]; } } - while ((V = ht[V & Le]) > Xe && --O !== 0); + while ((j = ht[j & Le]) > Xe && --O !== 0); return Ce <= v.lookahead ? Ce : v.lookahead; }, Xt = (v) => { - const V = v.w_size; + const j = v.w_size; let O, J, te; do { - if (J = v.window_size - v.lookahead - v.strstart, v.strstart >= V + (V - Tt) && (v.window.set(v.window.subarray(V, V + V - J), 0), v.match_start -= V, v.strstart -= V, v.block_start -= V, v.insert > v.strstart && (v.insert = v.strstart), nn(v), J += V), v.strm.avail_in === 0) + if (J = v.window_size - v.lookahead - v.strstart, v.strstart >= j + (j - Tt) && (v.window.set(v.window.subarray(j, j + j - J), 0), v.match_start -= j, v.strstart -= j, v.block_start -= j, v.insert > v.strstart && (v.insert = v.strstart), nn(v), J += j), v.strm.avail_in === 0) break; if (O = Pi(v.strm, v.window, v.strstart + v.lookahead, J), v.lookahead += O, v.lookahead + v.insert >= at) for (te = v.strstart - v.insert, v.ins_h = v.window[te], v.ins_h = kt(v, v.ins_h, v.window[te + 1]); v.insert && (v.ins_h = kt(v, v.ins_h, v.window[te + at - 1]), v.prev[te & v.w_mask] = v.head[v.ins_h], v.head[v.ins_h] = te, te++, v.insert--, !(v.lookahead + v.insert < at)); ) ; } while (v.lookahead < Tt && v.strm.avail_in !== 0); - }, Hi = (v, V) => { + }, Hi = (v, j) => { let O = v.pending_buf_size - 5 > v.w_size ? v.w_size : v.pending_buf_size - 5, J, te, ee, Ce = 0, be = v.strm.avail_in; do { - if (J = 65535, ee = v.bi_valid + 42 >> 3, v.strm.avail_out < ee || (ee = v.strm.avail_out - ee, te = v.strstart - v.block_start, J > te + v.strm.avail_in && (J = te + v.strm.avail_in), J > ee && (J = ee), J < O && (J === 0 && V !== nt || V === Ve || J !== te + v.strm.avail_in))) + if (J = 65535, ee = v.bi_valid + 42 >> 3, v.strm.avail_out < ee || (ee = v.strm.avail_out - ee, te = v.strstart - v.block_start, J > te + v.strm.avail_in && (J = te + v.strm.avail_in), J > ee && (J = ee), J < O && (J === 0 && j !== nt || j === je || J !== te + v.strm.avail_in))) break; - Ce = V === nt && J === te + v.strm.avail_in ? 1 : 0, ne(v, 0, 0, Ce), v.pending_buf[v.pending - 4] = J, v.pending_buf[v.pending - 3] = J >> 8, v.pending_buf[v.pending - 2] = ~J, v.pending_buf[v.pending - 1] = ~J >> 8, Lt(v.strm), te && (te > J && (te = J), v.strm.output.set(v.window.subarray(v.block_start, v.block_start + te), v.strm.next_out), v.strm.next_out += te, v.strm.avail_out -= te, v.strm.total_out += te, v.block_start += te, J -= te), J && (Pi(v.strm, v.strm.output, v.strm.next_out, J), v.strm.next_out += J, v.strm.avail_out -= J, v.strm.total_out += J); + Ce = j === nt && J === te + v.strm.avail_in ? 1 : 0, ne(v, 0, 0, Ce), v.pending_buf[v.pending - 4] = J, v.pending_buf[v.pending - 3] = J >> 8, v.pending_buf[v.pending - 2] = ~J, v.pending_buf[v.pending - 1] = ~J >> 8, Lt(v.strm), te && (te > J && (te = J), v.strm.output.set(v.window.subarray(v.block_start, v.block_start + te), v.strm.next_out), v.strm.next_out += te, v.strm.avail_out -= te, v.strm.total_out += te, v.block_start += te, J -= te), J && (Pi(v.strm, v.strm.output, v.strm.next_out, J), v.strm.next_out += J, v.strm.avail_out -= J, v.strm.total_out += J); } while (Ce === 0); - return be -= v.strm.avail_in, be && (be >= v.w_size ? (v.matches = 2, v.window.set(v.strm.input.subarray(v.strm.next_in - v.w_size, v.strm.next_in), 0), v.strstart = v.w_size, v.insert = v.strstart) : (v.window_size - v.strstart <= be && (v.strstart -= v.w_size, v.window.set(v.window.subarray(v.w_size, v.w_size + v.strstart), 0), v.matches < 2 && v.matches++, v.insert > v.strstart && (v.insert = v.strstart)), v.window.set(v.strm.input.subarray(v.strm.next_in - be, v.strm.next_in), v.strstart), v.strstart += be, v.insert += be > v.w_size - v.insert ? v.w_size - v.insert : be), v.block_start = v.strstart), v.high_water < v.strstart && (v.high_water = v.strstart), Ce ? Yt : V !== Ve && V !== nt && v.strm.avail_in === 0 && v.strstart === v.block_start ? Zt : (ee = v.window_size - v.strstart, v.strm.avail_in > ee && v.block_start >= v.w_size && (v.block_start -= v.w_size, v.strstart -= v.w_size, v.window.set(v.window.subarray(v.w_size, v.w_size + v.strstart), 0), v.matches < 2 && v.matches++, ee += v.w_size, v.insert > v.strstart && (v.insert = v.strstart)), ee > v.strm.avail_in && (ee = v.strm.avail_in), ee && (Pi(v.strm, v.window, v.strstart, ee), v.strstart += ee, v.insert += ee > v.w_size - v.insert ? v.w_size - v.insert : ee), v.high_water < v.strstart && (v.high_water = v.strstart), ee = v.bi_valid + 42 >> 3, ee = v.pending_buf_size - ee > 65535 ? 65535 : v.pending_buf_size - ee, O = ee > v.w_size ? v.w_size : ee, te = v.strstart - v.block_start, (te >= O || (te || V === nt) && V !== Ve && v.strm.avail_in === 0 && te <= ee) && (J = te > ee ? ee : te, Ce = V === nt && v.strm.avail_in === 0 && J === te ? 1 : 0, ne(v, v.block_start, J, Ce), v.block_start += J, Lt(v.strm)), Ce ? Gt : At); - }, Ii = (v, V) => { + return be -= v.strm.avail_in, be && (be >= v.w_size ? (v.matches = 2, v.window.set(v.strm.input.subarray(v.strm.next_in - v.w_size, v.strm.next_in), 0), v.strstart = v.w_size, v.insert = v.strstart) : (v.window_size - v.strstart <= be && (v.strstart -= v.w_size, v.window.set(v.window.subarray(v.w_size, v.w_size + v.strstart), 0), v.matches < 2 && v.matches++, v.insert > v.strstart && (v.insert = v.strstart)), v.window.set(v.strm.input.subarray(v.strm.next_in - be, v.strm.next_in), v.strstart), v.strstart += be, v.insert += be > v.w_size - v.insert ? v.w_size - v.insert : be), v.block_start = v.strstart), v.high_water < v.strstart && (v.high_water = v.strstart), Ce ? Yt : j !== je && j !== nt && v.strm.avail_in === 0 && v.strstart === v.block_start ? Zt : (ee = v.window_size - v.strstart, v.strm.avail_in > ee && v.block_start >= v.w_size && (v.block_start -= v.w_size, v.strstart -= v.w_size, v.window.set(v.window.subarray(v.w_size, v.w_size + v.strstart), 0), v.matches < 2 && v.matches++, ee += v.w_size, v.insert > v.strstart && (v.insert = v.strstart)), ee > v.strm.avail_in && (ee = v.strm.avail_in), ee && (Pi(v.strm, v.window, v.strstart, ee), v.strstart += ee, v.insert += ee > v.w_size - v.insert ? v.w_size - v.insert : ee), v.high_water < v.strstart && (v.high_water = v.strstart), ee = v.bi_valid + 42 >> 3, ee = v.pending_buf_size - ee > 65535 ? 65535 : v.pending_buf_size - ee, O = ee > v.w_size ? v.w_size : ee, te = v.strstart - v.block_start, (te >= O || (te || j === nt) && j !== je && v.strm.avail_in === 0 && te <= ee) && (J = te > ee ? ee : te, Ce = j === nt && v.strm.avail_in === 0 && J === te ? 1 : 0, ne(v, v.block_start, J, Ce), v.block_start += J, Lt(v.strm)), Ce ? Gt : At); + }, Ii = (v, j) => { let O, J; for (; ; ) { if (v.lookahead < Tt) { - if (Xt(v), v.lookahead < Tt && V === Ve) + if (Xt(v), v.lookahead < Tt && j === je) return At; if (v.lookahead === 0) break; @@ -23467,12 +23467,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (J && (Dt(v, !1), v.strm.avail_out === 0)) return At; } - return v.insert = v.strstart < at - 1 ? v.strstart : at - 1, V === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; - }, Qt = (v, V) => { + return v.insert = v.strstart < at - 1 ? v.strstart : at - 1, j === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; + }, Qt = (v, j) => { let O, J, te; for (; ; ) { if (v.lookahead < Tt) { - if (Xt(v), v.lookahead < Tt && V === Ve) + if (Xt(v), v.lookahead < Tt && j === je) return At; if (v.lookahead === 0) break; @@ -23490,13 +23490,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } else v.match_available = 1, v.strstart++, v.lookahead--; } - return v.match_available && (J = He(v, 0, v.window[v.strstart - 1]), v.match_available = 0), v.insert = v.strstart < at - 1 ? v.strstart : at - 1, V === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; - }, sn = (v, V) => { + return v.match_available && (J = He(v, 0, v.window[v.strstart - 1]), v.match_available = 0), v.insert = v.strstart < at - 1 ? v.strstart : at - 1, j === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; + }, sn = (v, j) => { let O, J, te, ee; const Ce = v.window; for (; ; ) { if (v.lookahead <= $t) { - if (Xt(v), v.lookahead <= $t && V === Ve) + if (Xt(v), v.lookahead <= $t && j === je) return At; if (v.lookahead === 0) break; @@ -23511,22 +23511,22 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (v.match_length >= at ? (O = He(v, 1, v.match_length - at), v.lookahead -= v.match_length, v.strstart += v.match_length, v.match_length = 0) : (O = He(v, 0, v.window[v.strstart]), v.lookahead--, v.strstart++), O && (Dt(v, !1), v.strm.avail_out === 0)) return At; } - return v.insert = 0, V === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; - }, an = (v, V) => { + return v.insert = 0, j === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; + }, an = (v, j) => { let O; for (; ; ) { if (v.lookahead === 0 && (Xt(v), v.lookahead === 0)) { - if (V === Ve) + if (j === je) return At; break; } if (v.match_length = 0, O = He(v, 0, v.window[v.strstart]), v.lookahead--, v.strstart++, O && (Dt(v, !1), v.strm.avail_out === 0)) return At; } - return v.insert = 0, V === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; + return v.insert = 0, j === nt ? (Dt(v, !0), v.strm.avail_out === 0 ? Gt : Yt) : v.sym_next && (Dt(v, !1), v.strm.avail_out === 0) ? At : Zt; }; - function Pt(v, V, O, J, te) { - this.good_length = v, this.max_lazy = V, this.nice_length = O, this.max_chain = J, this.func = te; + function Pt(v, j, O, J, te) { + this.good_length = v, this.max_lazy = j, this.nice_length = O, this.max_chain = J, this.func = te; } const ti = [ /* good lazy nice chain */ @@ -23559,49 +23559,49 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; const ii = (v) => { if (!v) return 1; - const V = v.state; - return !V || V.strm !== v || V.status !== Kt && //#ifdef GZIP - V.status !== Li && //#endif - V.status !== Di && V.status !== Si && V.status !== Oi && V.status !== Ti && V.status !== Wt && V.status !== qt ? 1 : 0; + const j = v.state; + return !j || j.strm !== v || j.status !== Kt && //#ifdef GZIP + j.status !== Li && //#endif + j.status !== Di && j.status !== Si && j.status !== Oi && j.status !== Ti && j.status !== Wt && j.status !== qt ? 1 : 0; }, Ki = (v) => { if (ii(v)) return Nt(v, _t); v.total_in = v.total_out = 0, v.data_type = hi; - const V = v.state; - return V.pending = 0, V.pending_out = 0, V.wrap < 0 && (V.wrap = -V.wrap), V.status = //#ifdef GZIP - V.wrap === 2 ? Li : ( + const j = v.state; + return j.pending = 0, j.pending_out = 0, j.wrap < 0 && (j.wrap = -j.wrap), j.status = //#ifdef GZIP + j.wrap === 2 ? Li : ( //#endif - V.wrap ? Kt : Wt - ), v.adler = V.wrap === 2 ? 0 : 1, V.last_flush = -2, Y(V), tt; + j.wrap ? Kt : Wt + ), v.adler = j.wrap === 2 ? 0 : 1, j.last_flush = -2, X(j), tt; }, Zi = (v) => { - const V = Ki(v); - return V === tt && ln(v.state), V; - }, fn = (v, V) => ii(v) || v.state.wrap !== 2 ? _t : (v.state.gzhead = V, tt), Yi = (v, V, O, J, te, ee) => { + const j = Ki(v); + return j === tt && ln(v.state), j; + }, fn = (v, j) => ii(v) || v.state.wrap !== 2 ? _t : (v.state.gzhead = j, tt), Yi = (v, j, O, J, te, ee) => { if (!v) return _t; let Ce = 1; - if (V === vt && (V = 6), J < 0 ? (Ce = 0, J = -J) : J > 15 && (Ce = 2, J -= 16), te < 1 || te > di || O !== Ut || J < 8 || J > 15 || V < 0 || V > 9 || ee < 0 || ee > Mt || J === 8 && Ce !== 1) + if (j === vt && (j = 6), J < 0 ? (Ce = 0, J = -J) : J > 15 && (Ce = 2, J -= 16), te < 1 || te > di || O !== Ut || J < 8 || J > 15 || j < 0 || j > 9 || ee < 0 || ee > Mt || J === 8 && Ce !== 1) return Nt(v, _t); J === 8 && (J = 9); const be = new on(); - return v.state = be, be.strm = v, be.status = Kt, be.wrap = Ce, be.gzhead = null, be.w_bits = J, be.w_size = 1 << be.w_bits, be.w_mask = be.w_size - 1, be.hash_bits = te + 7, be.hash_size = 1 << be.hash_bits, be.hash_mask = be.hash_size - 1, be.hash_shift = ~~((be.hash_bits + at - 1) / at), be.window = new Uint8Array(be.w_size * 2), be.head = new Uint16Array(be.hash_size), be.prev = new Uint16Array(be.w_size), be.lit_bufsize = 1 << te + 6, be.pending_buf_size = be.lit_bufsize * 4, be.pending_buf = new Uint8Array(be.pending_buf_size), be.sym_buf = be.lit_bufsize, be.sym_end = (be.lit_bufsize - 1) * 3, be.level = V, be.strategy = ee, be.method = O, Zi(v); - }, hn = (v, V) => Yi(v, V, Ut, ci, ui, Ft), dn = (v, V) => { - if (ii(v) || V > rt || V < 0) + return v.state = be, be.strm = v, be.status = Kt, be.wrap = Ce, be.gzhead = null, be.w_bits = J, be.w_size = 1 << be.w_bits, be.w_mask = be.w_size - 1, be.hash_bits = te + 7, be.hash_size = 1 << be.hash_bits, be.hash_mask = be.hash_size - 1, be.hash_shift = ~~((be.hash_bits + at - 1) / at), be.window = new Uint8Array(be.w_size * 2), be.head = new Uint16Array(be.hash_size), be.prev = new Uint16Array(be.w_size), be.lit_bufsize = 1 << te + 6, be.pending_buf_size = be.lit_bufsize * 4, be.pending_buf = new Uint8Array(be.pending_buf_size), be.sym_buf = be.lit_bufsize, be.sym_end = (be.lit_bufsize - 1) * 3, be.level = j, be.strategy = ee, be.method = O, Zi(v); + }, hn = (v, j) => Yi(v, j, Ut, ci, ui, Ft), dn = (v, j) => { + if (ii(v) || j > rt || j < 0) return v ? Nt(v, _t) : _t; const O = v.state; - if (!v.output || v.avail_in !== 0 && !v.input || O.status === qt && V !== nt) + if (!v.output || v.avail_in !== 0 && !v.input || O.status === qt && j !== nt) return Nt(v, v.avail_out === 0 ? Ot : _t); const J = O.last_flush; - if (O.last_flush = V, O.pending !== 0) { + if (O.last_flush = j, O.pending !== 0) { if (Lt(v), v.avail_out === 0) return O.last_flush = -1, tt; - } else if (v.avail_in === 0 && Vi(V) <= Vi(J) && V !== nt) + } else if (v.avail_in === 0 && Vi(j) <= Vi(J) && j !== nt) return Nt(v, Ot); if (O.status === qt && v.avail_in !== 0) return Nt(v, Ot); if (O.status === Kt && O.wrap === 0 && (O.status = Wt), O.status === Kt) { let te = Ut + (O.w_bits - 8 << 4) << 8, ee = -1; - if (O.strategy >= gt || O.level < 2 ? ee = 0 : O.level < 6 ? ee = 1 : O.level === 6 ? ee = 2 : ee = 3, te |= ee << 6, O.strstart !== 0 && (te |= tn), te += 31 - te % 31, ei(O, te), O.strstart !== 0 && (ei(O, v.adler >>> 16), ei(O, v.adler & 65535)), v.adler = 1, O.status = Wt, Lt(v), O.pending !== 0) + if (O.strategy >= pt || O.level < 2 ? ee = 0 : O.level < 6 ? ee = 1 : O.level === 6 ? ee = 2 : ee = 3, te |= ee << 6, O.strstart !== 0 && (te |= tn), te += 31 - te % 31, ei(O, te), O.strstart !== 0 && (ei(O, v.adler >>> 16), ei(O, v.adler & 65535)), v.adler = 1, O.status = Wt, Lt(v), O.pending !== 0) return O.last_flush = -1, tt; } if (O.status === Li) { @@ -23609,8 +23609,8 @@ 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 >= gt || 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 && (v.adler = I(v.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Di; - 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 >= gt || O.level < 2 ? 4 : 0), dt(O, rn), O.status = Wt, Lt(v), 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 >= pt || 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 && (v.adler = I(v.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Di; + 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 >= pt || O.level < 2 ? 4 : 0), dt(O, rn), O.status = Wt, Lt(v), O.pending !== 0) return O.last_flush = -1, tt; } if (O.status === Di) { @@ -23666,45 +23666,45 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (O.status = Wt, Lt(v), O.pending !== 0) return O.last_flush = -1, tt; } - if (v.avail_in !== 0 || O.lookahead !== 0 || V !== Ve && O.status !== qt) { - let te = O.level === 0 ? Hi(O, V) : O.strategy === gt ? an(O, V) : O.strategy === Ct ? sn(O, V) : ti[O.level].func(O, V); + if (v.avail_in !== 0 || O.lookahead !== 0 || j !== je && O.status !== qt) { + let te = O.level === 0 ? Hi(O, j) : O.strategy === pt ? an(O, j) : O.strategy === Ct ? sn(O, j) : ti[O.level].func(O, j); if ((te === Gt || te === Yt) && (O.status = qt), te === At || te === Gt) return v.avail_out === 0 && (O.last_flush = -1), tt; - if (te === Zt && (V === qe ? Ke(O) : V !== rt && (ne(O, 0, 0, !1), V === wt && (Bt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), Lt(v), v.avail_out === 0)) + if (te === Zt && (j === qe ? Ke(O) : j !== rt && (ne(O, 0, 0, !1), j === wt && (Bt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), Lt(v), v.avail_out === 0)) return O.last_flush = -1, tt; } - return V !== nt ? tt : O.wrap <= 0 ? yt : (O.wrap === 2 ? (dt(O, v.adler & 255), dt(O, v.adler >> 8 & 255), dt(O, v.adler >> 16 & 255), dt(O, v.adler >> 24 & 255), dt(O, v.total_in & 255), dt(O, v.total_in >> 8 & 255), dt(O, v.total_in >> 16 & 255), dt(O, v.total_in >> 24 & 255)) : (ei(O, v.adler >>> 16), ei(O, v.adler & 65535)), Lt(v), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : yt); + return j !== nt ? tt : O.wrap <= 0 ? yt : (O.wrap === 2 ? (dt(O, v.adler & 255), dt(O, v.adler >> 8 & 255), dt(O, v.adler >> 16 & 255), dt(O, v.adler >> 24 & 255), dt(O, v.total_in & 255), dt(O, v.total_in >> 8 & 255), dt(O, v.total_in >> 16 & 255), dt(O, v.total_in >> 24 & 255)) : (ei(O, v.adler >>> 16), ei(O, v.adler & 65535)), Lt(v), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : yt); }, cn = (v) => { if (ii(v)) return _t; - const V = v.state.status; - return v.state = null, V === Wt ? Nt(v, It) : tt; - }, un = (v, V) => { - let O = V.length; + const j = v.state.status; + return v.state = null, j === Wt ? Nt(v, It) : tt; + }, un = (v, j) => { + let O = j.length; if (ii(v)) return _t; const J = v.state, te = J.wrap; if (te === 2 || te === 1 && J.status !== Kt || J.lookahead) return _t; - if (te === 1 && (v.adler = De(v.adler, V, O, 0)), J.wrap = 0, O >= J.w_size) { + if (te === 1 && (v.adler = De(v.adler, j, O, 0)), J.wrap = 0, O >= J.w_size) { te === 0 && (Bt(J.head), J.strstart = 0, J.block_start = 0, J.insert = 0); let Xe = new Uint8Array(J.w_size); - Xe.set(V.subarray(O - J.w_size, O), 0), V = Xe, O = J.w_size; + Xe.set(j.subarray(O - J.w_size, O), 0), j = Xe, O = J.w_size; } const ee = v.avail_in, Ce = v.next_in, be = v.input; - for (v.avail_in = O, v.next_in = 0, v.input = V, Xt(J); J.lookahead >= at; ) { - let Xe = J.strstart, de = J.lookahead - (at - 1); + for (v.avail_in = O, v.next_in = 0, v.input = j, Xt(J); J.lookahead >= at; ) { + let Xe = J.strstart, ce = J.lookahead - (at - 1); do J.ins_h = kt(J, J.ins_h, J.window[Xe + at - 1]), J.prev[Xe & J.w_mask] = J.head[J.ins_h], J.head[J.ins_h] = Xe, Xe++; - while (--de); + while (--ce); J.strstart = Xe, J.lookahead = at - 1, Xt(J); } 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, v.next_in = Ce, v.input = be, v.avail_in = ee, J.wrap = te, tt; }; - var _n = hn, gn = Yi, pn = Zi, vn = Ki, mn = fn, bn = dn, xn = cn, yn = un, wn = "pako deflate (from Nodeca project)", ri = { + var _n = hn, pn = Yi, gn = Zi, vn = Ki, mn = fn, bn = dn, xn = cn, yn = un, wn = "pako deflate (from Nodeca project)", ri = { deflateInit: _n, - deflateInit2: gn, - deflateReset: pn, + deflateInit2: pn, + deflateReset: gn, deflateResetKeep: vn, deflateSetHeader: mn, deflate: bn, @@ -23712,11 +23712,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; deflateSetDictionary: yn, deflateInfo: wn }; - const En = (v, V) => Object.prototype.hasOwnProperty.call(v, V); + const En = (v, j) => Object.prototype.hasOwnProperty.call(v, j); var Mn = function(v) { - const V = Array.prototype.slice.call(arguments, 1); - for (; V.length; ) { - const O = V.shift(); + const j = Array.prototype.slice.call(arguments, 1); + for (; j.length; ) { + const O = j.shift(); if (O) { if (typeof O != "object") throw new TypeError(O + "must be non-object"); @@ -23726,16 +23726,16 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return v; }, An = (v) => { - let V = 0; + let j = 0; for (let J = 0, te = v.length; J < te; J++) - V += v[J].length; - const O = new Uint8Array(V); + j += v[J].length; + const O = new Uint8Array(j); for (let J = 0, te = 0, ee = v.length; J < ee; J++) { let Ce = v[J]; O.set(Ce, te), te += Ce.length; } return O; - }, pi = { + }, gi = { assign: Mn, flattenChunks: An }; @@ -23752,25 +23752,25 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Cn = (v) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) return new TextEncoder().encode(v); - let V, O, J, te, ee, Ce = v.length, be = 0; + let j, O, J, te, ee, Ce = v.length, be = 0; for (te = 0; te < Ce; te++) O = v.charCodeAt(te), (O & 64512) === 55296 && te + 1 < Ce && (J = v.charCodeAt(te + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), te++)), be += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; - for (V = new Uint8Array(be), ee = 0, te = 0; ee < be; te++) - O = v.charCodeAt(te), (O & 64512) === 55296 && te + 1 < Ce && (J = v.charCodeAt(te + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), te++)), O < 128 ? V[ee++] = O : O < 2048 ? (V[ee++] = 192 | O >>> 6, V[ee++] = 128 | O & 63) : O < 65536 ? (V[ee++] = 224 | O >>> 12, V[ee++] = 128 | O >>> 6 & 63, V[ee++] = 128 | O & 63) : (V[ee++] = 240 | O >>> 18, V[ee++] = 128 | O >>> 12 & 63, V[ee++] = 128 | O >>> 6 & 63, V[ee++] = 128 | O & 63); - return V; + for (j = new Uint8Array(be), ee = 0, te = 0; ee < be; te++) + O = v.charCodeAt(te), (O & 64512) === 55296 && te + 1 < Ce && (J = v.charCodeAt(te + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), te++)), O < 128 ? j[ee++] = O : O < 2048 ? (j[ee++] = 192 | O >>> 6, j[ee++] = 128 | O & 63) : O < 65536 ? (j[ee++] = 224 | O >>> 12, j[ee++] = 128 | O >>> 6 & 63, j[ee++] = 128 | O & 63) : (j[ee++] = 240 | O >>> 18, j[ee++] = 128 | O >>> 12 & 63, j[ee++] = 128 | O >>> 6 & 63, j[ee++] = 128 | O & 63); + return j; }; - const Ln = (v, V) => { - if (V < 65534 && v.subarray && Xi) - return String.fromCharCode.apply(null, v.length === V ? v : v.subarray(0, V)); + const Ln = (v, j) => { + if (j < 65534 && v.subarray && Xi) + return String.fromCharCode.apply(null, v.length === j ? v : v.subarray(0, j)); let O = ""; - for (let J = 0; J < V; J++) + for (let J = 0; J < j; J++) O += String.fromCharCode(v[J]); return O; }; - var Dn = (v, V) => { - const O = V || v.length; + var Dn = (v, j) => { + const O = j || v.length; if (typeof TextDecoder == "function" && TextDecoder.prototype.decode) - return new TextDecoder().decode(v.subarray(0, V)); + return new TextDecoder().decode(v.subarray(0, j)); let J, te; const ee = new Array(O * 2); for (te = 0, J = 0; J < O; ) { @@ -23793,12 +23793,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Ce < 65536 ? ee[te++] = Ce : (Ce -= 65536, ee[te++] = 55296 | Ce >> 10 & 1023, ee[te++] = 56320 | Ce & 1023); } return Ln(ee, te); - }, Sn = (v, V) => { - V = V || v.length, V > v.length && (V = v.length); - let O = V - 1; + }, Sn = (v, j) => { + j = j || v.length, j > v.length && (j = v.length); + let O = j - 1; for (; O >= 0 && (v[O] & 192) === 128; ) O--; - return O < 0 || O === 0 ? V : O + ni[v[O]] > V ? O : V; + return O < 0 || O === 0 ? j : O + ni[v[O]] > j ? O : j; }, si = { string2buf: Cn, buf2string: Dn, @@ -23818,9 +23818,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFAULT_COMPRESSION: $n, Z_DEFAULT_STRATEGY: Bn, Z_DEFLATED: kn - } = ge; + } = ve; function ai(v) { - this.options = pi.assign({ + this.options = gi.assign({ level: $n, method: kn, chunkSize: 16384, @@ -23828,31 +23828,31 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; memLevel: 8, strategy: Bn }, v || {}); - let V = this.options; - V.raw && V.windowBits > 0 ? V.windowBits = -V.windowBits : V.gzip && V.windowBits > 0 && V.windowBits < 16 && (V.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Qi(), this.strm.avail_out = 0; + let j = this.options; + j.raw && j.windowBits > 0 ? j.windowBits = -j.windowBits : j.gzip && j.windowBits > 0 && j.windowBits < 16 && (j.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Qi(), this.strm.avail_out = 0; let O = ri.deflateInit2( this.strm, - V.level, - V.method, - V.windowBits, - V.memLevel, - V.strategy + j.level, + j.method, + j.windowBits, + j.memLevel, + j.strategy ); if (O !== vi) throw new Error(me[O]); - if (V.header && ri.deflateSetHeader(this.strm, V.header), V.dictionary) { + if (j.header && ri.deflateSetHeader(this.strm, j.header), j.dictionary) { let J; - if (typeof V.dictionary == "string" ? J = si.string2buf(V.dictionary) : Ji.call(V.dictionary) === "[object ArrayBuffer]" ? J = new Uint8Array(V.dictionary) : J = V.dictionary, O = ri.deflateSetDictionary(this.strm, J), O !== vi) + if (typeof j.dictionary == "string" ? J = si.string2buf(j.dictionary) : Ji.call(j.dictionary) === "[object ArrayBuffer]" ? J = new Uint8Array(j.dictionary) : J = j.dictionary, O = ri.deflateSetDictionary(this.strm, J), O !== vi) throw new Error(me[O]); this._dict_set = !0; } } - ai.prototype.push = function(v, V) { + ai.prototype.push = function(v, j) { const O = this.strm, J = this.options.chunkSize; let te, ee; if (this.ended) return !1; - for (V === ~~V ? ee = V : ee = V === !0 ? Rn : Tn, typeof v == "string" ? O.input = si.string2buf(v) : Ji.call(v) === "[object ArrayBuffer]" ? O.input = new Uint8Array(v) : O.input = v, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (j === ~~j ? ee = j : ee = j === !0 ? Rn : Tn, typeof v == "string" ? O.input = si.string2buf(v) : Ji.call(v) === "[object ArrayBuffer]" ? O.input = new Uint8Array(v) : O.input = v, 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), (ee === Pn || ee === In) && O.avail_out <= 6) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; @@ -23874,21 +23874,21 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, ai.prototype.onData = function(v) { this.chunks.push(v); }, ai.prototype.onEnd = function(v) { - v === vi && (this.result = pi.flattenChunks(this.chunks)), this.chunks = [], this.err = v, this.msg = this.strm.msg; + v === vi && (this.result = gi.flattenChunks(this.chunks)), this.chunks = [], this.err = v, this.msg = this.strm.msg; }; - function Ri(v, V) { - const O = new ai(V); + function Ri(v, j) { + const O = new ai(j); if (O.push(v, !0), O.err) throw O.msg || me[O.err]; return O.result; } - function Fn(v, V) { - return V = V || {}, V.raw = !0, Ri(v, V); + function Fn(v, j) { + return j = j || {}, j.raw = !0, Ri(v, j); } - function Un(v, V) { - return V = V || {}, V.gzip = !0, Ri(v, V); + function Un(v, j) { + return j = j || {}, j.gzip = !0, Ri(v, j); } - var Wn = ai, Gn = Ri, Nn = Fn, Vn = Un, jn = ge, Hn = { + var Wn = ai, Gn = Ri, Nn = Fn, Vn = Un, jn = ve, Hn = { Deflate: Wn, deflate: Gn, deflateRaw: Nn, @@ -23896,41 +23896,41 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; constants: jn }; const mi = 16209, Kn = 16191; - var Zn = function(V, O) { - let J, te, ee, Ce, be, Xe, de, Le, ht, Ye, Ue, Qe, xt, ot, it, ut, st, Ze, ct, Et, Je, pt, ft, et; - const lt = V.state; - J = V.next_in, ft = V.input, te = J + (V.avail_in - 5), ee = V.next_out, et = V.output, Ce = ee - (O - V.avail_out), be = ee + (V.avail_out - 257), Xe = lt.dmax, de = lt.wsize, Le = lt.whave, ht = lt.wnext, Ye = lt.window, Ue = lt.hold, Qe = lt.bits, xt = lt.lencode, ot = lt.distcode, it = (1 << lt.lenbits) - 1, ut = (1 << lt.distbits) - 1; + var Zn = function(j, O) { + let J, te, ee, Ce, be, Xe, ce, Le, ht, Ye, Ge, Qe, xt, ot, it, ut, st, Ze, ct, Et, Je, gt, ft, et; + const lt = j.state; + J = j.next_in, ft = j.input, te = J + (j.avail_in - 5), ee = j.next_out, et = j.output, Ce = ee - (O - j.avail_out), be = ee + (j.avail_out - 257), Xe = lt.dmax, ce = lt.wsize, Le = lt.whave, ht = lt.wnext, Ye = lt.window, Ge = lt.hold, Qe = lt.bits, xt = lt.lencode, ot = lt.distcode, it = (1 << lt.lenbits) - 1, ut = (1 << lt.distbits) - 1; e: do { - Qe < 15 && (Ue += ft[J++] << Qe, Qe += 8, Ue += ft[J++] << Qe, Qe += 8), st = xt[Ue & it]; + Qe < 15 && (Ge += ft[J++] << Qe, Qe += 8, Ge += ft[J++] << Qe, Qe += 8), st = xt[Ge & it]; t: for (; ; ) { - if (Ze = st >>> 24, Ue >>>= Ze, Qe -= Ze, Ze = st >>> 16 & 255, Ze === 0) + if (Ze = st >>> 24, Ge >>>= Ze, Qe -= Ze, Ze = st >>> 16 & 255, Ze === 0) et[ee++] = st & 65535; else if (Ze & 16) { - ct = st & 65535, Ze &= 15, Ze && (Qe < Ze && (Ue += ft[J++] << Qe, Qe += 8), ct += Ue & (1 << Ze) - 1, Ue >>>= Ze, Qe -= Ze), Qe < 15 && (Ue += ft[J++] << Qe, Qe += 8, Ue += ft[J++] << Qe, Qe += 8), st = ot[Ue & ut]; + ct = st & 65535, Ze &= 15, Ze && (Qe < Ze && (Ge += ft[J++] << Qe, Qe += 8), ct += Ge & (1 << Ze) - 1, Ge >>>= Ze, Qe -= Ze), Qe < 15 && (Ge += ft[J++] << Qe, Qe += 8, Ge += ft[J++] << Qe, Qe += 8), st = ot[Ge & ut]; i: for (; ; ) { - if (Ze = st >>> 24, Ue >>>= Ze, Qe -= Ze, Ze = st >>> 16 & 255, Ze & 16) { - if (Et = st & 65535, Ze &= 15, Qe < Ze && (Ue += ft[J++] << Qe, Qe += 8, Qe < Ze && (Ue += ft[J++] << Qe, Qe += 8)), Et += Ue & (1 << Ze) - 1, Et > Xe) { - V.msg = "invalid distance too far back", lt.mode = mi; + if (Ze = st >>> 24, Ge >>>= Ze, Qe -= Ze, Ze = st >>> 16 & 255, Ze & 16) { + if (Et = st & 65535, Ze &= 15, Qe < Ze && (Ge += ft[J++] << Qe, Qe += 8, Qe < Ze && (Ge += ft[J++] << Qe, Qe += 8)), Et += Ge & (1 << Ze) - 1, Et > Xe) { + j.msg = "invalid distance too far back", lt.mode = mi; break e; } - if (Ue >>>= Ze, Qe -= Ze, Ze = ee - Ce, Et > Ze) { + if (Ge >>>= Ze, Qe -= Ze, Ze = ee - Ce, Et > Ze) { if (Ze = Et - Ze, Ze > Le && lt.sane) { - V.msg = "invalid distance too far back", lt.mode = mi; + j.msg = "invalid distance too far back", lt.mode = mi; break e; } - if (Je = 0, pt = Ye, ht === 0) { - if (Je += de - Ze, Ze < ct) { + if (Je = 0, gt = Ye, ht === 0) { + if (Je += ce - Ze, Ze < ct) { ct -= Ze; do et[ee++] = Ye[Je++]; while (--Ze); - Je = ee - Et, pt = et; + Je = ee - Et, gt = et; } } else if (ht < Ze) { - if (Je += de + ht - Ze, Ze -= ht, Ze < ct) { + if (Je += ce + ht - Ze, Ze -= ht, Ze < ct) { ct -= Ze; do et[ee++] = Ye[Je++]; @@ -23940,7 +23940,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do et[ee++] = Ye[Je++]; while (--Ze); - Je = ee - Et, pt = et; + Je = ee - Et, gt = et; } } } else if (Je += ht - Ze, Ze < ct) { @@ -23948,11 +23948,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do et[ee++] = Ye[Je++]; while (--Ze); - Je = ee - Et, pt = et; + Je = ee - Et, gt = et; } for (; ct > 2; ) - et[ee++] = pt[Je++], et[ee++] = pt[Je++], et[ee++] = pt[Je++], ct -= 3; - ct && (et[ee++] = pt[Je++], ct > 1 && (et[ee++] = pt[Je++])); + et[ee++] = gt[Je++], et[ee++] = gt[Je++], et[ee++] = gt[Je++], ct -= 3; + ct && (et[ee++] = gt[Je++], ct > 1 && (et[ee++] = gt[Je++])); } else { Je = ee - Et; do @@ -23961,10 +23961,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ct && (et[ee++] = et[Je++], ct > 1 && (et[ee++] = et[Je++])); } } else if (Ze & 64) { - V.msg = "invalid distance code", lt.mode = mi; + j.msg = "invalid distance code", lt.mode = mi; break e; } else { - st = ot[(st & 65535) + (Ue & (1 << Ze) - 1)]; + st = ot[(st & 65535) + (Ge & (1 << Ze) - 1)]; continue i; } break; @@ -23974,17 +23974,17 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; lt.mode = Kn; break e; } else { - V.msg = "invalid literal/length code", lt.mode = mi; + j.msg = "invalid literal/length code", lt.mode = mi; break e; } else { - st = xt[(st & 65535) + (Ue & (1 << Ze) - 1)]; + st = xt[(st & 65535) + (Ge & (1 << Ze) - 1)]; continue t; } break; } } while (J < te && ee < be); - ct = Qe >> 3, J -= ct, Qe -= ct << 3, Ue &= (1 << Qe) - 1, V.next_in = J, V.next_out = ee, V.avail_in = J < te ? 5 + (te - J) : 5 - (J - te), V.avail_out = ee < be ? 257 + (be - ee) : 257 - (ee - be), lt.hold = Ue, lt.bits = Qe; + ct = Qe >> 3, J -= ct, Qe -= ct << 3, Ge &= (1 << Qe) - 1, j.next_in = J, j.next_out = ee, j.avail_in = J < te ? 5 + (te - J) : 5 - (J - te), j.avail_out = ee < be ? 257 + (be - ee) : 257 - (ee - be), lt.hold = Ge, lt.bits = Qe; }; const Jt = 15, qi = 852, er = 592, tr = 0, zi = 1, ir = 2, Yn = new Uint16Array([ /* Length codes 257..285 base */ @@ -24121,53 +24121,53 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 64, 64 ]); - var li = (v, V, O, J, te, ee, Ce, be) => { + var li = (v, j, O, J, te, ee, Ce, be) => { const Xe = be.bits; - let de = 0, Le = 0, ht = 0, Ye = 0, Ue = 0, Qe = 0, xt = 0, ot = 0, it = 0, ut = 0, st, Ze, ct, Et, Je, pt = null, ft; + let ce = 0, Le = 0, ht = 0, Ye = 0, Ge = 0, Qe = 0, xt = 0, ot = 0, it = 0, ut = 0, st, Ze, ct, Et, Je, gt = null, ft; const et = new Uint16Array(Jt + 1), lt = new Uint16Array(Jt + 1); let Ht = null, Xr, Mi, Ai; - for (de = 0; de <= Jt; de++) - et[de] = 0; + for (ce = 0; ce <= Jt; ce++) + et[ce] = 0; for (Le = 0; Le < J; Le++) - et[V[O + Le]]++; - for (Ue = Xe, Ye = Jt; Ye >= 1 && et[Ye] === 0; Ye--) + et[j[O + Le]]++; + for (Ge = Xe, Ye = Jt; Ye >= 1 && et[Ye] === 0; Ye--) ; - if (Ue > Ye && (Ue = Ye), Ye === 0) + if (Ge > Ye && (Ge = Ye), Ye === 0) return te[ee++] = 1 << 24 | 64 << 16 | 0, te[ee++] = 1 << 24 | 64 << 16 | 0, be.bits = 1, 0; for (ht = 1; ht < Ye && et[ht] === 0; ht++) ; - for (Ue < ht && (Ue = ht), ot = 1, de = 1; de <= Jt; de++) - if (ot <<= 1, ot -= et[de], ot < 0) + for (Ge < ht && (Ge = ht), ot = 1, ce = 1; ce <= Jt; ce++) + if (ot <<= 1, ot -= et[ce], ot < 0) return -1; if (ot > 0 && (v === tr || Ye !== 1)) return -1; - for (lt[1] = 0, de = 1; de < Jt; de++) - lt[de + 1] = lt[de] + et[de]; + for (lt[1] = 0, ce = 1; ce < Jt; ce++) + lt[ce + 1] = lt[ce] + et[ce]; for (Le = 0; Le < J; Le++) - V[O + Le] !== 0 && (Ce[lt[V[O + Le]]++] = Le); - if (v === tr ? (pt = Ht = Ce, ft = 20) : v === zi ? (pt = Yn, Ht = Xn, ft = 257) : (pt = Qn, Ht = Jn, ft = 0), ut = 0, Le = 0, de = ht, Je = ee, Qe = Ue, xt = 0, ct = -1, it = 1 << Ue, Et = it - 1, v === zi && it > qi || v === ir && it > er) + j[O + Le] !== 0 && (Ce[lt[j[O + Le]]++] = Le); + if (v === tr ? (gt = Ht = Ce, ft = 20) : v === zi ? (gt = Yn, Ht = Xn, ft = 257) : (gt = Qn, Ht = Jn, ft = 0), ut = 0, Le = 0, ce = ht, Je = ee, Qe = Ge, xt = 0, ct = -1, it = 1 << Ge, Et = it - 1, v === zi && it > qi || v === ir && it > er) return 1; for (; ; ) { - Xr = de - xt, Ce[Le] + 1 < ft ? (Mi = 0, Ai = Ce[Le]) : Ce[Le] >= ft ? (Mi = Ht[Ce[Le] - ft], Ai = pt[Ce[Le] - ft]) : (Mi = 96, Ai = 0), st = 1 << de - xt, Ze = 1 << Qe, ht = Ze; + Xr = ce - xt, Ce[Le] + 1 < ft ? (Mi = 0, Ai = Ce[Le]) : Ce[Le] >= ft ? (Mi = Ht[Ce[Le] - ft], Ai = gt[Ce[Le] - ft]) : (Mi = 96, Ai = 0), st = 1 << ce - xt, Ze = 1 << Qe, ht = Ze; do Ze -= st, te[Je + (ut >> xt) + Ze] = Xr << 24 | Mi << 16 | Ai | 0; while (Ze !== 0); - for (st = 1 << de - 1; ut & st; ) + for (st = 1 << ce - 1; ut & st; ) st >>= 1; - if (st !== 0 ? (ut &= st - 1, ut += st) : ut = 0, Le++, --et[de] === 0) { - if (de === Ye) + if (st !== 0 ? (ut &= st - 1, ut += st) : ut = 0, Le++, --et[ce] === 0) { + if (ce === Ye) break; - de = V[O + Ce[Le]]; + ce = j[O + Ce[Le]]; } - if (de > Ue && (ut & Et) !== ct) { - for (xt === 0 && (xt = Ue), Je += ht, Qe = de - xt, ot = 1 << Qe; Qe + xt < Ye && (ot -= et[Qe + xt], !(ot <= 0)); ) + if (ce > Ge && (ut & Et) !== ct) { + for (xt === 0 && (xt = Ge), Je += ht, Qe = ce - xt, ot = 1 << Qe; Qe + xt < Ye && (ot -= et[Qe + xt], !(ot <= 0)); ) Qe++, ot <<= 1; if (it += 1 << Qe, v === zi && it > qi || v === ir && it > er) return 1; - ct = ut & Et, te[ct] = Ue << 24 | Qe << 16 | Je - ee | 0; + ct = ut & Et, te[ct] = Ge << 24 | Qe << 16 | Je - ee | 0; } } - return ut !== 0 && (te[Je + ut] = de - xt << 24 | 64 << 16 | 0), be.bits = Ue, 0; + return ut !== 0 && (te[Je + ut] = ce - xt << 24 | 64 << 16 | 0), be.bits = Ge, 0; }; const qn = 0, rr = 1, nr = 2, { Z_FINISH: sr, @@ -24181,63 +24181,63 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_MEM_ERROR: lr, Z_BUF_ERROR: rs, Z_DEFLATED: or - } = ge, xi = 16180, fr = 16181, hr = 16182, dr = 16183, cr = 16184, ur = 16185, _r = 16186, gr = 16187, pr = 16188, vr = 16189, yi = 16190, Rt = 16191, $i = 16192, mr = 16193, Bi = 16194, br = 16195, xr = 16196, yr = 16197, wr = 16198, wi = 16199, Ei = 16200, Er = 16201, Mr = 16202, Ar = 16203, Cr = 16204, Lr = 16205, ki = 16206, Dr = 16207, Sr = 16208, bt = 16209, Or = 16210, Tr = 16211, ns = 852, ss = 592, as = 15, Pr = (v) => (v >>> 24 & 255) + (v >>> 8 & 65280) + ((v & 65280) << 8) + ((v & 255) << 24); + } = ve, xi = 16180, fr = 16181, hr = 16182, dr = 16183, cr = 16184, ur = 16185, _r = 16186, pr = 16187, gr = 16188, vr = 16189, yi = 16190, Rt = 16191, $i = 16192, mr = 16193, Bi = 16194, br = 16195, xr = 16196, yr = 16197, wr = 16198, wi = 16199, Ei = 16200, Er = 16201, Mr = 16202, Ar = 16203, Cr = 16204, Lr = 16205, ki = 16206, Dr = 16207, Sr = 16208, bt = 16209, Or = 16210, Tr = 16211, ns = 852, ss = 592, as = 15, Pr = (v) => (v >>> 24 & 255) + (v >>> 8 & 65280) + ((v & 65280) << 8) + ((v & 255) << 24); function ls() { 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 jt = (v) => { if (!v) return 1; - const V = v.state; - return !V || V.strm !== v || V.mode < xi || V.mode > Tr ? 1 : 0; + const j = v.state; + return !j || j.strm !== v || j.mode < xi || j.mode > Tr ? 1 : 0; }, Ir = (v) => { if (jt(v)) return St; - const V = v.state; - return v.total_in = v.total_out = V.total = 0, v.msg = "", V.wrap && (v.adler = V.wrap & 1), V.mode = xi, V.last = 0, V.havedict = 0, V.flags = -1, V.dmax = 32768, V.head = null, V.hold = 0, V.bits = 0, V.lencode = V.lendyn = new Int32Array(ns), V.distcode = V.distdyn = new Int32Array(ss), V.sane = 1, V.back = -1, Vt; + const j = v.state; + return v.total_in = v.total_out = j.total = 0, v.msg = "", j.wrap && (v.adler = j.wrap & 1), j.mode = xi, j.last = 0, j.havedict = 0, j.flags = -1, j.dmax = 32768, j.head = null, j.hold = 0, j.bits = 0, j.lencode = j.lendyn = new Int32Array(ns), j.distcode = j.distdyn = new Int32Array(ss), j.sane = 1, j.back = -1, Vt; }, Rr = (v) => { if (jt(v)) return St; - const V = v.state; - return V.wsize = 0, V.whave = 0, V.wnext = 0, Ir(v); - }, zr = (v, V) => { + const j = v.state; + return j.wsize = 0, j.whave = 0, j.wnext = 0, Ir(v); + }, zr = (v, j) => { let O; if (jt(v)) return St; const J = v.state; - return V < 0 ? (O = 0, V = -V) : (O = (V >> 4) + 5, V < 48 && (V &= 15)), V && (V < 8 || V > 15) ? St : (J.window !== null && J.wbits !== V && (J.window = null), J.wrap = O, J.wbits = V, Rr(v)); - }, $r = (v, V) => { + return j < 0 ? (O = 0, j = -j) : (O = (j >> 4) + 5, j < 48 && (j &= 15)), j && (j < 8 || j > 15) ? St : (J.window !== null && J.wbits !== j && (J.window = null), J.wrap = O, J.wbits = j, Rr(v)); + }, $r = (v, j) => { if (!v) return St; const O = new ls(); v.state = O, O.strm = v, O.window = null, O.mode = xi; - const J = zr(v, V); + const J = zr(v, j); return J !== Vt && (v.state = null), J; }, os = (v) => $r(v, as); let Br = !0, Fi, Ui; const fs = (v) => { if (Br) { Fi = new Int32Array(512), Ui = new Int32Array(32); - let V = 0; - for (; V < 144; ) - v.lens[V++] = 8; - for (; V < 256; ) - v.lens[V++] = 9; - for (; V < 280; ) - v.lens[V++] = 7; - for (; V < 288; ) - v.lens[V++] = 8; - for (li(rr, v.lens, 0, 288, Fi, 0, v.work, { bits: 9 }), V = 0; V < 32; ) - v.lens[V++] = 5; + let j = 0; + for (; j < 144; ) + v.lens[j++] = 8; + for (; j < 256; ) + v.lens[j++] = 9; + for (; j < 280; ) + v.lens[j++] = 7; + for (; j < 288; ) + v.lens[j++] = 8; + for (li(rr, v.lens, 0, 288, Fi, 0, v.work, { bits: 9 }), j = 0; j < 32; ) + v.lens[j++] = 5; li(nr, v.lens, 0, 32, Ui, 0, v.work, { bits: 5 }), Br = !1; } v.lencode = Fi, v.lenbits = 9, v.distcode = Ui, v.distbits = 5; - }, kr = (v, V, O, J) => { + }, kr = (v, j, O, J) => { let te; const ee = v.state; - return ee.window === null && (ee.wsize = 1 << ee.wbits, ee.wnext = 0, ee.whave = 0, ee.window = new Uint8Array(ee.wsize)), J >= ee.wsize ? (ee.window.set(V.subarray(O - ee.wsize, O), 0), ee.wnext = 0, ee.whave = ee.wsize) : (te = ee.wsize - ee.wnext, te > J && (te = J), ee.window.set(V.subarray(O - J, O - J + te), ee.wnext), J -= te, J ? (ee.window.set(V.subarray(O - J, O), 0), ee.wnext = J, ee.whave = ee.wsize) : (ee.wnext += te, ee.wnext === ee.wsize && (ee.wnext = 0), ee.whave < ee.wsize && (ee.whave += te))), 0; - }, hs = (v, V) => { - let O, J, te, ee, Ce, be, Xe, de, Le, ht, Ye, Ue, Qe, xt, ot = 0, it, ut, st, Ze, ct, Et, Je, pt; + return ee.window === null && (ee.wsize = 1 << ee.wbits, ee.wnext = 0, ee.whave = 0, ee.window = new Uint8Array(ee.wsize)), J >= ee.wsize ? (ee.window.set(j.subarray(O - ee.wsize, O), 0), ee.wnext = 0, ee.whave = ee.wsize) : (te = ee.wsize - ee.wnext, te > J && (te = J), ee.window.set(j.subarray(O - J, O - J + te), ee.wnext), J -= te, J ? (ee.window.set(j.subarray(O - J, O), 0), ee.wnext = J, ee.whave = ee.wsize) : (ee.wnext += te, ee.wnext === ee.wsize && (ee.wnext = 0), ee.whave < ee.wsize && (ee.whave += te))), 0; + }, hs = (v, j) => { + let O, J, te, ee, Ce, be, Xe, ce, Le, ht, Ye, Ge, Qe, xt, ot = 0, it, ut, st, Ze, ct, Et, Je, gt; const ft = new Uint8Array(4); let et, lt; const Ht = ( @@ -24246,7 +24246,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ); if (jt(v) || !v.output || !v.input && v.avail_in !== 0) return St; - O = v.state, O.mode === Rt && (O.mode = $i), Ce = v.next_out, te = v.output, Xe = v.avail_out, ee = v.next_in, J = v.input, be = v.avail_in, de = O.hold, Le = O.bits, ht = be, Ye = Xe, pt = Vt; + O = v.state, O.mode === Rt && (O.mode = $i), Ce = v.next_out, te = v.output, Xe = v.avail_out, ee = v.next_in, J = v.input, be = v.avail_in, ce = O.hold, Le = O.bits, ht = be, Ye = Xe, gt = Vt; e: for (; ; ) switch (O.mode) { @@ -24258,34 +24258,34 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 16; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (O.wrap & 2 && de === 35615) { - O.wbits === 0 && (O.wbits = 15), O.check = 0, ft[0] = de & 255, ft[1] = de >>> 8 & 255, O.check = I(O.check, ft, 2, 0), de = 0, Le = 0, O.mode = fr; + if (O.wrap & 2 && ce === 35615) { + O.wbits === 0 && (O.wbits = 15), O.check = 0, ft[0] = ce & 255, ft[1] = ce >>> 8 & 255, O.check = I(O.check, ft, 2, 0), ce = 0, Le = 0, O.mode = fr; break; } if (O.head && (O.head.done = !1), !(O.wrap & 1) || /* check if zlib header allowed */ - (((de & 255) << 8) + (de >> 8)) % 31) { + (((ce & 255) << 8) + (ce >> 8)) % 31) { v.msg = "incorrect header check", O.mode = bt; break; } - if ((de & 15) !== or) { + if ((ce & 15) !== or) { v.msg = "unknown compression method", O.mode = bt; break; } - if (de >>>= 4, Le -= 4, Je = (de & 15) + 8, O.wbits === 0 && (O.wbits = Je), Je > 15 || Je > O.wbits) { + if (ce >>>= 4, Le -= 4, Je = (ce & 15) + 8, O.wbits === 0 && (O.wbits = Je), Je > 15 || Je > O.wbits) { v.msg = "invalid window size", O.mode = bt; break; } - O.dmax = 1 << O.wbits, O.flags = 0, v.adler = O.check = 1, O.mode = de & 512 ? vr : Rt, de = 0, Le = 0; + O.dmax = 1 << O.wbits, O.flags = 0, v.adler = O.check = 1, O.mode = ce & 512 ? vr : Rt, ce = 0, Le = 0; break; case fr: for (; Le < 16; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (O.flags = de, (O.flags & 255) !== or) { + if (O.flags = ce, (O.flags & 255) !== or) { v.msg = "unknown compression method", O.mode = bt; break; } @@ -24293,83 +24293,83 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; v.msg = "unknown header flags set", O.mode = bt; break; } - O.head && (O.head.text = de >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ft[0] = de & 255, ft[1] = de >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), de = 0, Le = 0, O.mode = hr; + O.head && (O.head.text = ce >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ft[0] = ce & 255, ft[1] = ce >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), ce = 0, Le = 0, O.mode = hr; case hr: for (; Le < 32; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.head && (O.head.time = de), O.flags & 512 && O.wrap & 4 && (ft[0] = de & 255, ft[1] = de >>> 8 & 255, ft[2] = de >>> 16 & 255, ft[3] = de >>> 24 & 255, O.check = I(O.check, ft, 4, 0)), de = 0, Le = 0, O.mode = dr; + O.head && (O.head.time = ce), O.flags & 512 && O.wrap & 4 && (ft[0] = ce & 255, ft[1] = ce >>> 8 & 255, ft[2] = ce >>> 16 & 255, ft[3] = ce >>> 24 & 255, O.check = I(O.check, ft, 4, 0)), ce = 0, Le = 0, O.mode = dr; case dr: for (; Le < 16; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.head && (O.head.xflags = de & 255, O.head.os = de >> 8), O.flags & 512 && O.wrap & 4 && (ft[0] = de & 255, ft[1] = de >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), de = 0, Le = 0, O.mode = cr; + O.head && (O.head.xflags = ce & 255, O.head.os = ce >> 8), O.flags & 512 && O.wrap & 4 && (ft[0] = ce & 255, ft[1] = ce >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), ce = 0, Le = 0, O.mode = cr; case cr: if (O.flags & 1024) { for (; Le < 16; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.length = de, O.head && (O.head.extra_len = de), O.flags & 512 && O.wrap & 4 && (ft[0] = de & 255, ft[1] = de >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), de = 0, Le = 0; + O.length = ce, O.head && (O.head.extra_len = ce), O.flags & 512 && O.wrap & 4 && (ft[0] = ce & 255, ft[1] = ce >>> 8 & 255, O.check = I(O.check, ft, 2, 0)), ce = 0, Le = 0; } else O.head && (O.head.extra = null); O.mode = ur; case ur: - if (O.flags & 1024 && (Ue = O.length, Ue > be && (Ue = be), Ue && (O.head && (Je = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( + if (O.flags & 1024 && (Ge = O.length, Ge > be && (Ge = be), Ge && (O.head && (Je = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( J.subarray( ee, // extra field is limited to 65536 bytes // - no need for additional size check - ee + Ue + ee + Ge ), /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ Je - )), O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ue, ee)), be -= Ue, ee += Ue, O.length -= Ue), O.length)) + )), O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, ee)), be -= Ge, ee += Ge, O.length -= Ge), O.length)) break e; O.length = 0, O.mode = _r; case _r: if (O.flags & 2048) { if (be === 0) break e; - Ue = 0; + Ge = 0; do - Je = J[ee + Ue++], O.head && Je && O.length < 65536 && (O.head.name += String.fromCharCode(Je)); - while (Je && Ue < be); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ue, ee)), be -= Ue, ee += Ue, Je) + Je = J[ee + Ge++], O.head && Je && O.length < 65536 && (O.head.name += String.fromCharCode(Je)); + while (Je && Ge < be); + if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, ee)), be -= Ge, ee += Ge, Je) break e; } else O.head && (O.head.name = null); - O.length = 0, O.mode = gr; - case gr: + O.length = 0, O.mode = pr; + case pr: if (O.flags & 4096) { if (be === 0) break e; - Ue = 0; + Ge = 0; do - Je = J[ee + Ue++], O.head && Je && O.length < 65536 && (O.head.comment += String.fromCharCode(Je)); - while (Je && Ue < be); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ue, ee)), be -= Ue, ee += Ue, Je) + Je = J[ee + Ge++], O.head && Je && O.length < 65536 && (O.head.comment += String.fromCharCode(Je)); + while (Je && Ge < be); + if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, ee)), be -= Ge, ee += Ge, Je) break e; } else O.head && (O.head.comment = null); - O.mode = pr; - case pr: + O.mode = gr; + case gr: if (O.flags & 512) { for (; Le < 16; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (O.wrap & 4 && de !== (O.check & 65535)) { + if (O.wrap & 4 && ce !== (O.check & 65535)) { v.msg = "header crc mismatch", O.mode = bt; break; } - de = 0, Le = 0; + ce = 0, Le = 0; } O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), v.adler = O.check = 0, O.mode = Rt; break; @@ -24377,33 +24377,33 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 32; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - v.adler = O.check = Pr(de), de = 0, Le = 0, O.mode = yi; + v.adler = O.check = Pr(ce), ce = 0, Le = 0, O.mode = yi; case yi: if (O.havedict === 0) - return v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = de, O.bits = Le, is; + return v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = ce, O.bits = Le, is; v.adler = O.check = 1, O.mode = Rt; case Rt: - if (V === es || V === bi) + if (j === es || j === bi) break e; case $i: if (O.last) { - de >>>= Le & 7, Le -= Le & 7, O.mode = ki; + ce >>>= Le & 7, Le -= Le & 7, O.mode = ki; break; } for (; Le < 3; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - switch (O.last = de & 1, de >>>= 1, Le -= 1, de & 3) { + switch (O.last = ce & 1, ce >>>= 1, Le -= 1, ce & 3) { case 0: O.mode = mr; break; case 1: - if (fs(O), O.mode = wi, V === bi) { - de >>>= 2, Le -= 2; + if (fs(O), O.mode = wi, j === bi) { + ce >>>= 2, Le -= 2; break e; } break; @@ -24413,27 +24413,27 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 3: v.msg = "invalid block type", O.mode = bt; } - de >>>= 2, Le -= 2; + ce >>>= 2, Le -= 2; break; case mr: - for (de >>>= Le & 7, Le -= Le & 7; Le < 32; ) { + for (ce >>>= Le & 7, Le -= Le & 7; Le < 32; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if ((de & 65535) !== (de >>> 16 ^ 65535)) { + if ((ce & 65535) !== (ce >>> 16 ^ 65535)) { v.msg = "invalid stored block lengths", O.mode = bt; break; } - if (O.length = de & 65535, de = 0, Le = 0, O.mode = Bi, V === bi) + if (O.length = ce & 65535, ce = 0, Le = 0, O.mode = Bi, j === bi) break e; case Bi: O.mode = br; case br: - if (Ue = O.length, Ue) { - if (Ue > be && (Ue = be), Ue > Xe && (Ue = Xe), Ue === 0) + if (Ge = O.length, Ge) { + if (Ge > be && (Ge = be), Ge > Xe && (Ge = Xe), Ge === 0) break e; - te.set(J.subarray(ee, ee + Ue), Ce), be -= Ue, ee += Ue, Xe -= Ue, Ce += Ue, O.length -= Ue; + te.set(J.subarray(ee, ee + Ge), Ce), be -= Ge, ee += Ge, Xe -= Ge, Ce += Ge, O.length -= Ge; break; } O.mode = Rt; @@ -24442,9 +24442,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 14; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (O.nlen = (de & 31) + 257, de >>>= 5, Le -= 5, O.ndist = (de & 31) + 1, de >>>= 5, Le -= 5, O.ncode = (de & 15) + 4, de >>>= 4, Le -= 4, O.nlen > 286 || O.ndist > 30) { + if (O.nlen = (ce & 31) + 257, ce >>>= 5, Le -= 5, O.ndist = (ce & 31) + 1, ce >>>= 5, Le -= 5, O.ncode = (ce & 15) + 4, ce >>>= 4, Le -= 4, O.nlen > 286 || O.ndist > 30) { v.msg = "too many length or distance symbols", O.mode = bt; break; } @@ -24454,58 +24454,58 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 3; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.lens[Ht[O.have++]] = de & 7, de >>>= 3, Le -= 3; + O.lens[Ht[O.have++]] = ce & 7, ce >>>= 3, Le -= 3; } for (; O.have < 19; ) O.lens[Ht[O.have++]] = 0; - if (O.lencode = O.lendyn, O.lenbits = 7, et = { bits: O.lenbits }, pt = li(qn, O.lens, 0, 19, O.lencode, 0, O.work, et), O.lenbits = et.bits, pt) { + if (O.lencode = O.lendyn, O.lenbits = 7, et = { bits: O.lenbits }, gt = li(qn, O.lens, 0, 19, O.lencode, 0, O.work, et), O.lenbits = et.bits, gt) { v.msg = "invalid code lengths set", O.mode = bt; break; } O.have = 0, O.mode = wr; case wr: for (; O.have < O.nlen + O.ndist; ) { - for (; ot = O.lencode[de & (1 << O.lenbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { + for (; ot = O.lencode[ce & (1 << O.lenbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } if (st < 16) - de >>>= it, Le -= it, O.lens[O.have++] = st; + ce >>>= it, Le -= it, O.lens[O.have++] = st; else { if (st === 16) { for (lt = it + 2; Le < lt; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (de >>>= it, Le -= it, O.have === 0) { + if (ce >>>= it, Le -= it, O.have === 0) { v.msg = "invalid bit length repeat", O.mode = bt; break; } - Je = O.lens[O.have - 1], Ue = 3 + (de & 3), de >>>= 2, Le -= 2; + Je = O.lens[O.have - 1], Ge = 3 + (ce & 3), ce >>>= 2, Le -= 2; } else if (st === 17) { for (lt = it + 3; Le < lt; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - de >>>= it, Le -= it, Je = 0, Ue = 3 + (de & 7), de >>>= 3, Le -= 3; + ce >>>= it, Le -= it, Je = 0, Ge = 3 + (ce & 7), ce >>>= 3, Le -= 3; } else { for (lt = it + 7; Le < lt; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - de >>>= it, Le -= it, Je = 0, Ue = 11 + (de & 127), de >>>= 7, Le -= 7; + ce >>>= it, Le -= it, Je = 0, Ge = 11 + (ce & 127), ce >>>= 7, Le -= 7; } - if (O.have + Ue > O.nlen + O.ndist) { + if (O.have + Ge > O.nlen + O.ndist) { v.msg = "invalid bit length repeat", O.mode = bt; break; } - for (; Ue--; ) + for (; Ge--; ) O.lens[O.have++] = Je; } } @@ -24515,37 +24515,37 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; v.msg = "invalid code -- missing end-of-block", O.mode = bt; break; } - if (O.lenbits = 9, et = { bits: O.lenbits }, pt = li(rr, O.lens, 0, O.nlen, O.lencode, 0, O.work, et), O.lenbits = et.bits, pt) { + if (O.lenbits = 9, et = { bits: O.lenbits }, gt = li(rr, O.lens, 0, O.nlen, O.lencode, 0, O.work, et), O.lenbits = et.bits, gt) { v.msg = "invalid literal/lengths set", O.mode = bt; break; } - if (O.distbits = 6, O.distcode = O.distdyn, et = { bits: O.distbits }, pt = li(nr, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, et), O.distbits = et.bits, pt) { + if (O.distbits = 6, O.distcode = O.distdyn, et = { bits: O.distbits }, gt = li(nr, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, et), O.distbits = et.bits, gt) { v.msg = "invalid distances set", O.mode = bt; break; } - if (O.mode = wi, V === bi) + if (O.mode = wi, j === bi) break e; case wi: O.mode = Ei; case Ei: if (be >= 6 && Xe >= 258) { - v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = de, O.bits = Le, Zn(v, Ye), Ce = v.next_out, te = v.output, Xe = v.avail_out, ee = v.next_in, J = v.input, be = v.avail_in, de = O.hold, Le = O.bits, O.mode === Rt && (O.back = -1); + v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = ce, O.bits = Le, Zn(v, Ye), Ce = v.next_out, te = v.output, Xe = v.avail_out, ee = v.next_in, J = v.input, be = v.avail_in, ce = O.hold, Le = O.bits, O.mode === Rt && (O.back = -1); break; } - for (O.back = 0; ot = O.lencode[de & (1 << O.lenbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { + for (O.back = 0; ot = O.lencode[ce & (1 << O.lenbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } if (ut && !(ut & 240)) { - for (Ze = it, ct = ut, Et = st; ot = O.lencode[Et + ((de & (1 << Ze + ct) - 1) >> Ze)], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(Ze + it <= Le); ) { + for (Ze = it, ct = ut, Et = st; ot = O.lencode[Et + ((ce & (1 << Ze + ct) - 1) >> Ze)], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(Ze + it <= Le); ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - de >>>= Ze, Le -= Ze, O.back += Ze; + ce >>>= Ze, Le -= Ze, O.back += Ze; } - if (de >>>= it, Le -= it, O.back += it, O.length = st, ut === 0) { + if (ce >>>= it, Le -= it, O.back += it, O.length = st, ut === 0) { O.mode = Lr; break; } @@ -24563,26 +24563,26 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (lt = O.extra; Le < lt; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.length += de & (1 << O.extra) - 1, de >>>= O.extra, Le -= O.extra, O.back += O.extra; + O.length += ce & (1 << O.extra) - 1, ce >>>= O.extra, Le -= O.extra, O.back += O.extra; } O.was = O.length, O.mode = Mr; case Mr: - for (; ot = O.distcode[de & (1 << O.distbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { + for (; ot = O.distcode[ce & (1 << O.distbits) - 1], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(it <= Le); ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } if (!(ut & 240)) { - for (Ze = it, ct = ut, Et = st; ot = O.distcode[Et + ((de & (1 << Ze + ct) - 1) >> Ze)], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(Ze + it <= Le); ) { + for (Ze = it, ct = ut, Et = st; ot = O.distcode[Et + ((ce & (1 << Ze + ct) - 1) >> Ze)], it = ot >>> 24, ut = ot >>> 16 & 255, st = ot & 65535, !(Ze + it <= Le); ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - de >>>= Ze, Le -= Ze, O.back += Ze; + ce >>>= Ze, Le -= Ze, O.back += Ze; } - if (de >>>= it, Le -= it, O.back += it, ut & 64) { + if (ce >>>= it, Le -= it, O.back += it, ut & 64) { v.msg = "invalid distance code", O.mode = bt; break; } @@ -24592,9 +24592,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (lt = O.extra; Le < lt; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - O.offset += de & (1 << O.extra) - 1, de >>>= O.extra, Le -= O.extra, O.back += O.extra; + O.offset += ce & (1 << O.extra) - 1, ce >>>= O.extra, Le -= O.extra, O.back += O.extra; } if (O.offset > O.dmax) { v.msg = "invalid distance too far back", O.mode = bt; @@ -24604,18 +24604,18 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case Cr: if (Xe === 0) break e; - if (Ue = Ye - Xe, O.offset > Ue) { - if (Ue = O.offset - Ue, Ue > O.whave && O.sane) { + if (Ge = Ye - Xe, O.offset > Ge) { + if (Ge = O.offset - Ge, Ge > O.whave && O.sane) { v.msg = "invalid distance too far back", O.mode = bt; break; } - Ue > O.wnext ? (Ue -= O.wnext, Qe = O.wsize - Ue) : Qe = O.wnext - Ue, Ue > O.length && (Ue = O.length), xt = O.window; + Ge > O.wnext ? (Ge -= O.wnext, Qe = O.wsize - Ge) : Qe = O.wnext - Ge, Ge > O.length && (Ge = O.length), xt = O.window; } else - xt = te, Qe = Ce - O.offset, Ue = O.length; - Ue > Xe && (Ue = Xe), Xe -= Ue, O.length -= Ue; + xt = te, Qe = Ce - O.offset, Ge = O.length; + Ge > Xe && (Ge = Xe), Xe -= Ge, O.length -= Ge; do te[Ce++] = xt[Qe++]; - while (--Ue); + while (--Ge); O.length === 0 && (O.mode = Ei); break; case Lr: @@ -24628,14 +24628,14 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 32; ) { if (be === 0) break e; - be--, de |= J[ee++] << Le, Le += 8; + be--, ce |= J[ee++] << Le, Le += 8; } if (Ye -= Xe, v.total_out += Ye, O.total += Ye, O.wrap & 4 && Ye && (v.adler = O.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ - O.flags ? I(O.check, te, Ye, Ce - Ye) : De(O.check, te, Ye, Ce - Ye)), Ye = Xe, O.wrap & 4 && (O.flags ? de : Pr(de)) !== O.check) { + O.flags ? I(O.check, te, Ye, Ce - Ye) : De(O.check, te, Ye, Ce - Ye)), Ye = Xe, O.wrap & 4 && (O.flags ? ce : Pr(ce)) !== O.check) { v.msg = "incorrect data check", O.mode = bt; break; } - de = 0, Le = 0; + ce = 0, Le = 0; } O.mode = Dr; case Dr: @@ -24643,20 +24643,20 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; Le < 32; ) { if (be === 0) break e; - be--, de += J[ee++] << Le, Le += 8; + be--, ce += J[ee++] << Le, Le += 8; } - if (O.wrap & 4 && de !== (O.total & 4294967295)) { + if (O.wrap & 4 && ce !== (O.total & 4294967295)) { v.msg = "incorrect length check", O.mode = bt; break; } - de = 0, Le = 0; + ce = 0, Le = 0; } O.mode = Sr; case Sr: - pt = ts; + gt = ts; break e; case bt: - pt = ar; + gt = ar; break e; case Or: return lr; @@ -24664,27 +24664,27 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; default: return St; } - return v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = de, O.bits = Le, (O.wsize || Ye !== v.avail_out && O.mode < bt && (O.mode < ki || V !== sr)) && kr(v, v.output, v.next_out, Ye - v.avail_out), ht -= v.avail_in, Ye -= v.avail_out, v.total_in += ht, v.total_out += Ye, O.total += Ye, O.wrap & 4 && Ye && (v.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ - O.flags ? I(O.check, te, Ye, v.next_out - Ye) : De(O.check, te, Ye, v.next_out - Ye)), v.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Rt ? 128 : 0) + (O.mode === wi || O.mode === Bi ? 256 : 0), (ht === 0 && Ye === 0 || V === sr) && pt === Vt && (pt = rs), pt; + return v.next_out = Ce, v.avail_out = Xe, v.next_in = ee, v.avail_in = be, O.hold = ce, O.bits = Le, (O.wsize || Ye !== v.avail_out && O.mode < bt && (O.mode < ki || j !== sr)) && kr(v, v.output, v.next_out, Ye - v.avail_out), ht -= v.avail_in, Ye -= v.avail_out, v.total_in += ht, v.total_out += Ye, O.total += Ye, O.wrap & 4 && Ye && (v.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ + O.flags ? I(O.check, te, Ye, v.next_out - Ye) : De(O.check, te, Ye, v.next_out - Ye)), v.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Rt ? 128 : 0) + (O.mode === wi || O.mode === Bi ? 256 : 0), (ht === 0 && Ye === 0 || j === sr) && gt === Vt && (gt = rs), gt; }, ds = (v) => { if (jt(v)) return St; - let V = v.state; - return V.window && (V.window = null), v.state = null, Vt; - }, cs = (v, V) => { + let j = v.state; + return j.window && (j.window = null), v.state = null, Vt; + }, cs = (v, j) => { if (jt(v)) return St; const O = v.state; - return O.wrap & 2 ? (O.head = V, V.done = !1, Vt) : St; - }, us = (v, V) => { - const O = V.length; + return O.wrap & 2 ? (O.head = j, j.done = !1, Vt) : St; + }, us = (v, j) => { + const O = j.length; let J, te, ee; - return jt(v) || (J = v.state, J.wrap !== 0 && J.mode !== yi) ? St : J.mode === yi && (te = 1, te = De(te, V, O, 0), te !== J.check) ? ar : (ee = kr(v, V, O, O), ee ? (J.mode = Or, lr) : (J.havedict = 1, Vt)); + return jt(v) || (J = v.state, J.wrap !== 0 && J.mode !== yi) ? St : J.mode === yi && (te = 1, te = De(te, j, O, 0), te !== J.check) ? ar : (ee = kr(v, j, O, O), ee ? (J.mode = Or, lr) : (J.havedict = 1, Vt)); }; - var _s = Rr, gs = zr, ps = Ir, vs = os, ms = $r, bs = hs, xs = ds, ys = cs, ws = us, Es = "pako inflate (from Nodeca project)", zt = { + var _s = Rr, ps = zr, gs = Ir, vs = os, ms = $r, bs = hs, xs = ds, ys = cs, ws = us, Es = "pako inflate (from Nodeca project)", zt = { inflateReset: _s, - inflateReset2: gs, - inflateResetKeep: ps, + inflateReset2: ps, + inflateResetKeep: gs, inflateInit: vs, inflateInit2: ms, inflate: bs, @@ -24706,30 +24706,30 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_STREAM_ERROR: Ds, Z_DATA_ERROR: Ur, Z_MEM_ERROR: Ss - } = ge; + } = ve; function fi(v) { - this.options = pi.assign({ + this.options = gi.assign({ chunkSize: 65536, windowBits: 15, to: "" }, v || {}); - const V = this.options; - V.raw && V.windowBits >= 0 && V.windowBits < 16 && (V.windowBits = -V.windowBits, V.windowBits === 0 && (V.windowBits = -15)), V.windowBits >= 0 && V.windowBits < 16 && !(v && v.windowBits) && (V.windowBits += 32), V.windowBits > 15 && V.windowBits < 48 && (V.windowBits & 15 || (V.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Qi(), this.strm.avail_out = 0; + const j = this.options; + j.raw && j.windowBits >= 0 && j.windowBits < 16 && (j.windowBits = -j.windowBits, j.windowBits === 0 && (j.windowBits = -15)), j.windowBits >= 0 && j.windowBits < 16 && !(v && v.windowBits) && (j.windowBits += 32), j.windowBits > 15 && j.windowBits < 48 && (j.windowBits & 15 || (j.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Qi(), this.strm.avail_out = 0; let O = zt.inflateInit2( this.strm, - V.windowBits + j.windowBits ); if (O !== oi) throw new Error(me[O]); - if (this.header = new As(), zt.inflateGetHeader(this.strm, this.header), V.dictionary && (typeof V.dictionary == "string" ? V.dictionary = si.string2buf(V.dictionary) : Fr.call(V.dictionary) === "[object ArrayBuffer]" && (V.dictionary = new Uint8Array(V.dictionary)), V.raw && (O = zt.inflateSetDictionary(this.strm, V.dictionary), O !== oi))) + if (this.header = new As(), zt.inflateGetHeader(this.strm, this.header), j.dictionary && (typeof j.dictionary == "string" ? j.dictionary = si.string2buf(j.dictionary) : Fr.call(j.dictionary) === "[object ArrayBuffer]" && (j.dictionary = new Uint8Array(j.dictionary)), j.raw && (O = zt.inflateSetDictionary(this.strm, j.dictionary), O !== oi))) throw new Error(me[O]); } - fi.prototype.push = function(v, V) { + fi.prototype.push = function(v, j) { const O = this.strm, J = this.options.chunkSize, te = this.options.dictionary; let ee, Ce, be; if (this.ended) return !1; - for (V === ~~V ? Ce = V : Ce = V === !0 ? Ls : Cs, Fr.call(v) === "[object ArrayBuffer]" ? O.input = new Uint8Array(v) : O.input = v, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (j === ~~j ? Ce = j : Ce = j === !0 ? Ls : Cs, Fr.call(v) === "[object ArrayBuffer]" ? O.input = new Uint8Array(v) : O.input = v, 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), ee = zt.inflate(O, Ce), ee === Gi && te && (ee = zt.inflateSetDictionary(O, te), ee === oi ? ee = zt.inflate(O, Ce) : ee === Ur && (ee = Gi)); O.avail_in > 0 && ee === Wi && O.state.wrap > 0 && v[O.next_in] !== 0; ) zt.inflateReset(O), ee = zt.inflate(O, Ce); switch (ee) { @@ -24741,8 +24741,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } if (be = O.avail_out, O.next_out && (O.avail_out === 0 || ee === Wi)) if (this.options.to === "string") { - let Xe = si.utf8border(O.output, O.next_out), de = O.next_out - Xe, Le = si.buf2string(O.output, Xe); - O.next_out = de, O.avail_out = J - de, de && O.output.set(O.output.subarray(Xe, Xe + de), 0), this.onData(Le); + let Xe = si.utf8border(O.output, O.next_out), ce = O.next_out - Xe, Le = si.buf2string(O.output, Xe); + O.next_out = ce, O.avail_out = J - ce, ce && O.output.set(O.output.subarray(Xe, Xe + ce), 0), this.onData(Le); } else this.onData(O.output.length === O.next_out ? O.output : O.output.subarray(0, O.next_out)); if (!(ee === oi && be === 0)) { @@ -24756,18 +24756,18 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, fi.prototype.onData = function(v) { this.chunks.push(v); }, fi.prototype.onEnd = function(v) { - v === oi && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = pi.flattenChunks(this.chunks)), this.chunks = [], this.err = v, this.msg = this.strm.msg; + v === oi && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = gi.flattenChunks(this.chunks)), this.chunks = [], this.err = v, this.msg = this.strm.msg; }; - function Ni(v, V) { - const O = new fi(V); + function Ni(v, j) { + const O = new fi(j); if (O.push(v), O.err) throw O.msg || me[O.err]; return O.result; } - function Os(v, V) { - return V = V || {}, V.raw = !0, Ni(v, V); + function Os(v, j) { + return j = j || {}, j.raw = !0, Ni(v, j); } - var Ts = fi, Ps = Ni, Is = Os, Rs = Ni, zs = ge, $s = { + var Ts = fi, Ps = Ni, Is = Os, Rs = Ni, zs = ve, $s = { Inflate: Ts, inflate: Ps, inflateRaw: Is, @@ -24775,7 +24775,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; constants: zs }; const { Deflate: Bs, deflate: ks, deflateRaw: Fs, gzip: Us } = Hn, { Inflate: Ws, inflate: Gs, inflateRaw: Ns, ungzip: Vs } = $s; - var Wr = Bs, Gr = ks, Nr = Fs, Vr = Us, jr = Ws, Hr = Gs, Kr = Ns, Zr = Vs, Yr = ge, js = { + var Wr = Bs, Gr = ks, Nr = Fs, Vr = Us, jr = Ws, Hr = Gs, Kr = Ns, Zr = Vs, Yr = ve, js = { Deflate: Wr, deflate: Gr, deflateRaw: Nr, @@ -24845,37 +24845,37 @@ const Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), Molecule_sv toggle_class: toggle_class$5 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3, afterUpdate: afterUpdate$2 } = window.__gradio__svelte__internal; function create_if_block$5(y) { - let s, e, l, g, _, x, o, p, E, u, A, C, L, D, r, n, b, f, c, t, a, h, M, w, S; - function T(F, $) { + let s, e, l, p, _, x, o, g, E, u, A, L, C, D, r, n, b, f, c, t, a, h, M, w, S; + function T(U, z) { return ( /*attachmentIndex*/ - F[1] !== null ? create_if_block_2$3 : create_else_block_1$2 + U[1] !== null ? create_if_block_2$3 : create_else_block_1$2 ); } - let R = T(y), z = R(y); - function P(F, $) { + let R = T(y), $ = R(y); + function P(U, z) { return ( /*deleteIndexes*/ - F[2].length > 0 ? create_if_block_1$4 : create_else_block$4 + U[2].length > 0 ? create_if_block_1$4 : create_else_block$4 ); } - let B = P(y), U = B(y); + let B = P(y), F = B(y); return { c() { - s = element$6("div"), s.textContent = "Covalent Modification", e = space$5(), l = element$6("div"), l.innerHTML = ' click on atoms in viewer to select them', g = space$5(), _ = element$6("div"), x = element$6("button"), x.innerHTML = ' Attachment atom', o = space$5(), p = element$6("button"), p.innerHTML = ' Atoms to delete', E = space$5(), u = element$6("div"), A = element$6("table"), C = element$6("thead"), C.innerHTML = ' index', L = space$5(), D = element$6("tbody"), r = element$6("tr"), n = element$6("th"), n.textContent = "Attachment atom", b = space$5(), f = element$6("td"), z.c(), c = space$5(), t = element$6("tr"), a = element$6("th"), a.textContent = "Deleted atoms", h = space$5(), M = element$6("td"), U.c(), attr$6(s, "class", "w-full text-center text-lg mb-2 svelte-1jhdl43"), attr$6(l, "class", "flex items-center space-x-2 justify-center mb-2 text-xs svelte-1jhdl43"), attr$6(x, "class", "w-1/2 flex items-center rounded-l-full px-4 py-2 transition-colors duration-300 ease-in hover:text-orange-600 focus:text-orange-600 focus:outline-none svelte-1jhdl43"), attr$6(x, "id", "attach"), toggle_class$5( + s = element$6("div"), s.textContent = "Covalent Modification", e = space$5(), l = element$6("div"), l.innerHTML = ' click on atoms in viewer to select them', p = space$5(), _ = element$6("div"), x = element$6("button"), x.innerHTML = ' Attachment atom', o = space$5(), g = element$6("button"), g.innerHTML = ' Atoms to delete', E = space$5(), u = element$6("div"), A = element$6("table"), L = element$6("thead"), L.innerHTML = ' index', C = space$5(), D = element$6("tbody"), r = element$6("tr"), n = element$6("th"), n.textContent = "Attachment atom", b = space$5(), f = element$6("td"), $.c(), c = space$5(), t = element$6("tr"), a = element$6("th"), a.textContent = "Deleted atoms", h = space$5(), M = element$6("td"), F.c(), attr$6(s, "class", "w-full text-center text-lg mb-2 svelte-1jhdl43"), attr$6(l, "class", "flex items-center space-x-2 justify-center mb-2 text-xs svelte-1jhdl43"), attr$6(x, "class", "w-1/2 flex items-center rounded-l-full px-4 py-2 transition-colors duration-300 ease-in hover:text-orange-600 focus:text-orange-600 focus:outline-none svelte-1jhdl43"), attr$6(x, "id", "attach"), toggle_class$5( x, "active", /*mode*/ y[3] === "attach" - ), attr$6(p, "class", "w-1/2 flex items-center rounded-r-full px-4 py-2 transition-colors duration-300 ease-in hover:text-orange-600 focus:text-orange-600 focus:outline-none svelte-1jhdl43"), attr$6(p, "id", "delete"), toggle_class$5( - p, + ), attr$6(g, "class", "w-1/2 flex items-center rounded-r-full px-4 py-2 transition-colors duration-300 ease-in hover:text-orange-600 focus:text-orange-600 focus:outline-none svelte-1jhdl43"), attr$6(g, "id", "delete"), toggle_class$5( + g, "active", /*mode*/ y[3] === "delete" - ), attr$6(_, "class", "flex rounded-full border-2 border-gray-200 bg-gray-200 text-sm leading-none text-gray-500 svelte-1jhdl43"), attr$6(C, "class", "text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 svelte-1jhdl43"), attr$6(n, "scope", "row"), attr$6(n, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(f, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(r, "class", "bg-white border-b dark:bg-gray-800 dark:border-gray-700 svelte-1jhdl43"), attr$6(a, "scope", "row"), attr$6(a, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(M, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(t, "class", "bg-white dark:bg-gray-800 svelte-1jhdl43"), attr$6(D, "class", "svelte-1jhdl43"), attr$6(A, "class", "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 svelte-1jhdl43"), attr$6(u, "class", "relative overflow-x-auto mt-3 svelte-1jhdl43"); + ), attr$6(_, "class", "flex rounded-full border-2 border-gray-200 bg-gray-200 text-sm leading-none text-gray-500 svelte-1jhdl43"), attr$6(L, "class", "text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 svelte-1jhdl43"), attr$6(n, "scope", "row"), attr$6(n, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(f, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(r, "class", "bg-white border-b dark:bg-gray-800 dark:border-gray-700 svelte-1jhdl43"), attr$6(a, "scope", "row"), attr$6(a, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(M, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(t, "class", "bg-white dark:bg-gray-800 svelte-1jhdl43"), attr$6(D, "class", "svelte-1jhdl43"), attr$6(A, "class", "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 svelte-1jhdl43"), attr$6(u, "class", "relative overflow-x-auto mt-3 svelte-1jhdl43"); }, - m(F, $) { - insert$7(F, s, $), insert$7(F, e, $), insert$7(F, l, $), insert$7(F, g, $), insert$7(F, _, $), append$5(_, x), append$5(_, o), append$5(_, p), insert$7(F, E, $), insert$7(F, u, $), append$5(u, A), append$5(A, C), append$5(A, L), append$5(A, D), append$5(D, r), append$5(r, n), append$5(r, b), append$5(r, f), z.m(f, null), append$5(D, c), append$5(D, t), append$5(t, a), append$5(t, h), append$5(t, M), U.m(M, null), w || (S = [ + m(U, z) { + insert$7(U, s, z), insert$7(U, e, z), insert$7(U, l, z), insert$7(U, p, z), insert$7(U, _, z), append$5(_, x), append$5(_, o), append$5(_, g), insert$7(U, E, z), insert$7(U, u, z), append$5(u, A), append$5(A, L), append$5(A, C), append$5(A, D), append$5(D, r), append$5(r, n), append$5(r, b), append$5(r, f), $.m(f, null), append$5(D, c), append$5(D, t), append$5(t, a), append$5(t, h), append$5(t, M), F.m(M, null), w || (S = [ listen$2( x, "click", @@ -24883,30 +24883,30 @@ function create_if_block$5(y) { y[7] ), listen$2( - p, + g, "click", /*click_handler_1*/ y[8] ) ], w = !0); }, - p(F, $) { - $ & /*mode*/ + p(U, z) { + z & /*mode*/ 8 && toggle_class$5( x, "active", /*mode*/ - F[3] === "attach" - ), $ & /*mode*/ + U[3] === "attach" + ), z & /*mode*/ 8 && toggle_class$5( - p, + g, "active", /*mode*/ - F[3] === "delete" - ), R === (R = T(F)) && z ? z.p(F, $) : (z.d(1), z = R(F), z && (z.c(), z.m(f, null))), B === (B = P(F)) && U ? U.p(F, $) : (U.d(1), U = B(F), U && (U.c(), U.m(M, null))); + U[3] === "delete" + ), R === (R = T(U)) && $ ? $.p(U, z) : ($.d(1), $ = R(U), $ && ($.c(), $.m(f, null))), B === (B = P(U)) && F ? F.p(U, z) : (F.d(1), F = B(U), F && (F.c(), F.m(M, null))); }, - d(F) { - F && (detach$7(s), detach$7(e), detach$7(l), detach$7(g), detach$7(_), detach$7(E), detach$7(u)), z.d(), U.d(), w = !1, run_all$2(S); + d(U) { + U && (detach$7(s), detach$7(e), detach$7(l), detach$7(p), detach$7(_), detach$7(E), detach$7(u)), $.d(), F.d(), w = !1, run_all$2(S); } }; } @@ -24974,11 +24974,11 @@ function create_if_block_1$4(y) { c() { e = text$5(s); }, - m(l, g) { - insert$7(l, e, g); + m(l, p) { + insert$7(l, e, p); }, - p(l, g) { - g & /*deleteIndexes*/ + p(l, p) { + p & /*deleteIndexes*/ 4 && s !== (s = /*deleteIndexes*/ l[2].join(", ") + "") && set_data$5(e, s); }, @@ -24988,20 +24988,20 @@ function create_if_block_1$4(y) { }; } function create_fragment$7(y) { - let s, e, l, g, _, x = ( + let s, e, l, p, _, x = ( /*showCovMod*/ y[0] > -1 && create_if_block$5(y) ); return { c() { - s = element$6("div"), e = element$6("div"), l = element$6("div"), g = space$5(), _ = element$6("div"), x && x.c(), attr$6(l, "class", "mol-canvas svelte-1jhdl43"), attr$6(e, "class", "relative svelte-1jhdl43"), attr$6(_, "class", "flex flex-col justify-center svelte-1jhdl43"), attr$6(s, "class", "mol-wrapper svelte-1jhdl43"); + s = element$6("div"), e = element$6("div"), l = element$6("div"), p = space$5(), _ = element$6("div"), x && x.c(), attr$6(l, "class", "mol-canvas svelte-1jhdl43"), attr$6(e, "class", "relative svelte-1jhdl43"), attr$6(_, "class", "flex flex-col justify-center svelte-1jhdl43"), attr$6(s, "class", "mol-wrapper svelte-1jhdl43"); }, - m(o, p) { - insert$7(o, s, p), append$5(s, e), append$5(e, l), y[6](l), append$5(s, g), append$5(s, _), x && x.m(_, null); + m(o, g) { + insert$7(o, s, g), append$5(s, e), append$5(e, l), y[6](l), append$5(s, p), append$5(s, _), x && x.m(_, null); }, - p(o, [p]) { + p(o, [g]) { /*showCovMod*/ - o[0] > -1 ? x ? x.p(o, p) : (x = create_if_block$5(o), x.c(), x.m(_, null)) : x && (x.d(1), x = null); + o[0] > -1 ? x ? x.p(o, g) : (x = create_if_block$5(o), x.c(), x.m(_, null)) : x && (x.d(1), x = null); }, i: noop$7, o: noop$7, @@ -25012,42 +25012,42 @@ function create_fragment$7(y) { } function instance$7(y, s, e) { const l = createEventDispatcher$3(); - let g = null, _ = [], x = "attach"; + let p = null, _ = [], x = "attach"; function o(r) { - r.setStyle({ stick: {} }), u > -1 && (g !== null && r.addStyle({ index: g }, { sphere: { color: "blue", scale: 0.5 } }), r.addStyle({ index: _ }, { sphere: { color: "red", scale: 0.5 } }), l("updateMol", { - attachmentIndex: g, + r.setStyle({ stick: {} }), u > -1 && (p !== null && r.addStyle({ index: p }, { sphere: { color: "blue", scale: 0.5 } }), r.addStyle({ index: _ }, { sphere: { color: "red", scale: 0.5 } }), l("updateMol", { + attachmentIndex: p, deleteIndexes: _, index: u, mol: r.exportJSON() })); } - function p(r, n) { + function g(r, n) { let b = Dmol.createViewer(n, {}); return b.addModel(r, "sdf"), o(b), b.setBackgroundColor("white"), b.zoomTo(), b.getModel(0).setClickable({}, !0, function(f, c, t, a) { - u > -1 && (x === "attach" ? e(1, g = f.serial) : (_.includes(f.serial) ? e(2, _ = _.filter((h) => h !== f.serial)) : _.push(f.serial), e(2, _), o(c))); + u > -1 && (x === "attach" ? e(1, p = f.serial) : (_.includes(f.serial) ? e(2, _ = _.filter((h) => h !== f.serial)) : _.push(f.serial), e(2, _), o(c))); }), b.render(), b; } let { molvalue: E = "" } = s, { showCovMod: u = -1 } = s, A = null; afterUpdate$2(() => { - p(E, A); + g(E, A); }); - function C(r) { + function L(r) { binding_callbacks$4[r ? "unshift" : "push"](() => { A = r, e(4, A); }); } - const L = () => e(3, x = "attach"), D = () => e(3, x = "delete"); + const C = () => e(3, x = "attach"), D = () => e(3, x = "delete"); return y.$$set = (r) => { "molvalue" in r && e(5, E = r.molvalue), "showCovMod" in r && e(0, u = r.showCovMod); }, [ u, - g, + p, _, x, A, E, - C, L, + C, D ]; } @@ -25090,27 +25090,31 @@ const Accordion_svelte_svelte_type_style_lang = "", { } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2 } = window.__gradio__svelte__internal; function get_each_context$1(y, s, e) { const l = y.slice(); - return l[33] = s[e], l[34] = s, l[35] = e, l; + return l[35] = s[e], l[36] = s, l[37] = e, l; } function get_each_context_1$1(y, s, e) { const l = y.slice(); - return l[36] = s[e], l; + return l[38] = s[e], l; } function get_each_context_2(y, s, e) { const l = y.slice(); - return l[39] = s[e], l; + return l[41] = s[e], l; } function get_each_context_3(y, s, e) { const l = y.slice(); - return l[36] = s[e], l; + return l[44] = s[e], l[37] = e, l; } function get_each_context_4(y, s, e) { const l = y.slice(); - return l[44] = s[e], l[45] = s, l[35] = e, l; + return l[38] = s[e], l; } function get_each_context_5(y, s, e) { const l = y.slice(); - return l[46] = s[e], l; + return l[48] = s[e], l[49] = s, l[37] = e, l; +} +function get_each_context_6(y, s, e) { + const l = y.slice(); + return l[50] = s[e], l; } function create_if_block_11$1(y) { let s, e; @@ -25119,10 +25123,10 @@ function create_if_block_11$1(y) { 1 && (s = null), s == null && (s = !!/*metals*/ x[8].includes( /*item*/ - x[44].name + x[48].name )), s ? create_if_block_12$1 : create_else_block_2; } - let g = l(y, [-1, -1]), _ = g(y); + let p = l(y, [-1, -1]), _ = p(y); return { c() { _.c(), e = empty$3(); @@ -25131,7 +25135,7 @@ function create_if_block_11$1(y) { _.m(x, o), insert$6(x, e, o); }, p(x, o) { - g === (g = l(x, o)) && _ ? _.p(x, o) : (_.d(1), _ = g(x), _ && (_.c(), _.m(e.parentNode, e))); + p === (p = l(x, o)) && _ ? _.p(x, o) : (_.d(1), _ = p(x), _ && (_.c(), _.m(e.parentNode, e))); }, d(x) { x && detach$6(e), _.d(x); @@ -25141,19 +25145,19 @@ function create_if_block_11$1(y) { function create_else_block_2(y) { let s = ( /*item*/ - y[44].smiles + "" + y[48].smiles + "" ), e; return { c() { e = text$4(s); }, - m(l, g) { - insert$6(l, e, g); + m(l, p) { + insert$6(l, e, p); }, - p(l, g) { - g[0] & /*vals*/ + p(l, p) { + p[0] & /*vals*/ 1 && s !== (s = /*item*/ - l[44].smiles + "") && set_data$4(e, s); + l[48].smiles + "") && set_data$4(e, s); }, d(l) { l && detach$6(e); @@ -25163,19 +25167,19 @@ function create_else_block_2(y) { function create_if_block_12$1(y) { let s = ( /*item*/ - y[44].name + "" + y[48].name + "" ), e; return { c() { e = text$4(s); }, - m(l, g) { - insert$6(l, e, g); + m(l, p) { + insert$6(l, e, p); }, - p(l, g) { - g[0] & /*vals*/ + p(l, p) { + p[0] & /*vals*/ 1 && s !== (s = /*item*/ - l[44].name + "") && set_data$4(e, s); + l[48].name + "") && set_data$4(e, s); }, d(l) { l && detach$6(e); @@ -25183,32 +25187,32 @@ function create_if_block_12$1(y) { }; } function create_if_block_8$1(y) { - let s, e, l, g, _, x; - const o = [create_if_block_9$1, create_if_block_10$1], p = []; + let s, e, l, p, _, x; + const o = [create_if_block_9$1, create_if_block_10$1], g = []; function E(u, A) { return A[0] & /*vals*/ 1 && (l = null), l == null && (l = !!["DNA", "RNA", "protein"].includes( /*item*/ - u[44].class + u[48].class )), l ? 0 : ( /*item*/ - u[44].class === "ligand" ? 1 : -1 + u[48].class === "ligand" ? 1 : -1 ); } - return ~(g = E(y, [-1, -1])) && (_ = p[g] = o[g](y)), { + return ~(p = E(y, [-1, -1])) && (_ = g[p] = o[p](y)), { c() { - s = element$5("div"), e = element$5("div"), _ && _.c(), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900 svelte-fryf3t"), attr$5(s, "id", `accordion-collapse-body-${/*i*/ - y[35]}`), attr$5(s, "aria-labelledby", `accordion-collapse-heading-${/*i*/ - y[35]}`), attr$5(s, "class", "svelte-fryf3t"); + s = element$5("div"), e = element$5("div"), _ && _.c(), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900 svelte-bt9x4p"), attr$5(s, "id", `accordion-collapse-body-${/*i*/ + y[37]}`), attr$5(s, "aria-labelledby", `accordion-collapse-heading-${/*i*/ + y[37]}`), attr$5(s, "class", "svelte-bt9x4p"); }, m(u, A) { - insert$6(u, s, A), append$4(s, e), ~g && p[g].m(e, null), x = !0; + insert$6(u, s, A), append$4(s, e), ~p && g[p].m(e, null), x = !0; }, p(u, A) { - let C = g; - g = E(u, A), g === C ? ~g && p[g].p(u, A) : (_ && (group_outros$4(), transition_out$4(p[C], 1, 1, () => { - p[C] = null; - }), check_outros$4()), ~g ? (_ = p[g], _ ? _.p(u, A) : (_ = p[g] = o[g](u), _.c()), transition_in$4(_, 1), _.m(e, null)) : _ = null); + let L = p; + p = E(u, A), p === L ? ~p && g[p].p(u, A) : (_ && (group_outros$4(), transition_out$4(g[L], 1, 1, () => { + g[L] = null; + }), check_outros$4()), ~p ? (_ = g[p], _ ? _.p(u, A) : (_ = g[p] = o[p](u), _.c()), transition_in$4(_, 1), _.m(e, null)) : _ = null); }, i(u) { x || (transition_in$4(_), x = !0); @@ -25217,18 +25221,18 @@ function create_if_block_8$1(y) { transition_out$4(_), x = !1; }, d(u) { - u && detach$6(s), ~g && p[g].d(); + u && detach$6(s), ~p && g[p].d(); } }; } function create_if_block_10$1(y) { - let s, e, l, g, _, x, o, p, E, u, A, C, L, D, r, n, b, f, c, t; + let s, e, l, p, _, x, o, g, E, u, A, L, C, D, r, n, b, f, c, t; function a(...S) { return ( /*input_handler_1*/ - y[16]( + y[17]( /*i*/ - y[35], + y[37], ...S ) ); @@ -25238,20 +25242,20 @@ function create_if_block_10$1(y) { database: "rcsb-3ligand", index: ( /*i*/ - y[35] + y[37] ) } }), x.$on( "triggerFetch", /*handleMessage*/ - y[12] + y[13] ); function h(...S) { return ( /*input_handler_2*/ - y[17]( + y[18]( /*i*/ - y[35], + y[37], ...S ) ); @@ -25261,18 +25265,18 @@ function create_if_block_10$1(y) { y[8] ), w = []; for (let S = 0; S < M.length; S += 1) - w[S] = create_each_block_5(get_each_context_5(y, M, S)); + w[S] = create_each_block_6(get_each_context_6(y, M, S)); return { c() { - s = element$5("textarea"), l = space$4(), g = element$5("div"), g.textContent = "- or -", _ = space$4(), create_component$4(x.$$.fragment), o = space$4(), p = element$5("div"), p.textContent = "- or -", E = space$4(), u = element$5("textarea"), C = space$4(), L = element$5("div"), L.textContent = "- or -", D = space$4(), r = element$5("div"), r.textContent = "Metal ion", n = space$4(), b = element$5("div"); + s = element$5("textarea"), l = space$4(), p = element$5("div"), p.textContent = "- or -", _ = space$4(), create_component$4(x.$$.fragment), o = space$4(), g = element$5("div"), g.textContent = "- or -", E = space$4(), u = element$5("textarea"), L = space$4(), C = element$5("div"), C.textContent = "- or -", D = space$4(), r = element$5("div"), r.textContent = "Metal ion", n = space$4(), b = element$5("div"); for (let S = 0; S < w.length; S += 1) w[S].c(); - attr$5(s, "rows", "1"), attr$5(s, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-fryf3t"), attr$5(s, "placeholder", "SMILES like CCC ..."), s.value = e = /*item*/ - y[44].smiles, attr$5(g, "class", "text-center text-gray-400 w-full my-2 svelte-fryf3t"), attr$5(p, "class", "text-center text-gray-400 w-full my-2 svelte-fryf3t"), attr$5(u, "rows", "3"), attr$5(u, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-fryf3t"), attr$5(u, "placeholder", "SDF format 3D molecule ..."), u.value = A = /*item*/ - y[44].sdf, attr$5(L, "class", "text-center text-gray-400 w-full my-2 svelte-fryf3t"), attr$5(r, "class", "text-center text-gray-600 font-bold mb-2 svelte-fryf3t"), attr$5(b, "class", "flex justify-center space-x-2 svelte-fryf3t"); + attr$5(s, "rows", "1"), attr$5(s, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-bt9x4p"), attr$5(s, "placeholder", "SMILES like CCC ..."), s.value = e = /*item*/ + y[48].smiles, attr$5(p, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(g, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(u, "rows", "3"), attr$5(u, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-bt9x4p"), attr$5(u, "placeholder", "SDF format 3D molecule ..."), u.value = A = /*item*/ + y[48].sdf, attr$5(C, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(r, "class", "text-center text-gray-600 font-bold mb-2 svelte-bt9x4p"), attr$5(b, "class", "flex justify-center space-x-2 svelte-bt9x4p"); }, m(S, T) { - insert$6(S, s, T), insert$6(S, l, T), insert$6(S, g, T), insert$6(S, _, T), mount_component$4(x, S, T), insert$6(S, o, T), insert$6(S, p, T), insert$6(S, E, T), insert$6(S, u, T), insert$6(S, C, T), insert$6(S, L, T), insert$6(S, D, T), insert$6(S, r, T), insert$6(S, n, T), insert$6(S, b, T); + insert$6(S, s, T), insert$6(S, l, T), insert$6(S, p, T), insert$6(S, _, T), mount_component$4(x, S, T), insert$6(S, o, T), insert$6(S, g, T), insert$6(S, E, T), insert$6(S, u, T), insert$6(S, L, T), insert$6(S, C, T), insert$6(S, D, T), insert$6(S, r, T), insert$6(S, n, T), insert$6(S, b, T); for (let R = 0; R < w.length; R += 1) w[R] && w[R].m(b, null); f = !0, c || (t = [ @@ -25283,9 +25287,9 @@ function create_if_block_10$1(y) { p(S, T) { if (y = S, (!f || T[0] & /*vals*/ 1 && e !== (e = /*item*/ - y[44].smiles)) && (s.value = e), (!f || T[0] & /*vals*/ + y[48].smiles)) && (s.value = e), (!f || T[0] & /*vals*/ 1 && A !== (A = /*item*/ - y[44].sdf)) && (u.value = A), T[0] & /*vals, metals, dispatch*/ + y[48].sdf)) && (u.value = A), T[0] & /*vals, metals, dispatch*/ 289) { M = ensure_array_like$1( /*metals*/ @@ -25293,8 +25297,8 @@ function create_if_block_10$1(y) { ); let R; for (R = 0; R < M.length; R += 1) { - const z = get_each_context_5(y, M, R); - w[R] ? w[R].p(z, T) : (w[R] = create_each_block_5(z), w[R].c(), w[R].m(b, null)); + const $ = get_each_context_6(y, M, R); + w[R] ? w[R].p($, T) : (w[R] = create_each_block_6($), w[R].c(), w[R].m(b, null)); } for (; R < w.length; R += 1) w[R].d(1); @@ -25308,122 +25312,122 @@ function create_if_block_10$1(y) { transition_out$4(x.$$.fragment, S), f = !1; }, d(S) { - S && (detach$6(s), detach$6(l), detach$6(g), detach$6(_), detach$6(o), detach$6(p), detach$6(E), detach$6(u), detach$6(C), detach$6(L), detach$6(D), detach$6(r), detach$6(n), detach$6(b)), destroy_component$4(x, S), destroy_each$1(w, S), c = !1, run_all$1(t); + S && (detach$6(s), detach$6(l), detach$6(p), detach$6(_), detach$6(o), detach$6(g), detach$6(E), detach$6(u), detach$6(L), detach$6(C), detach$6(D), detach$6(r), detach$6(n), detach$6(b)), destroy_component$4(x, S), destroy_each$1(w, S), c = !1, run_all$1(t); } }; } function create_if_block_9$1(y) { - let s, e, l, g; + let s, e, l, p; function _(...x) { return ( /*input_handler*/ - y[15]( + y[16]( /*i*/ - y[35], + y[37], ...x ) ); } return { c() { - s = element$5("textarea"), attr$5(s, "id", "message"), attr$5(s, "rows", "4"), attr$5(s, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-fryf3t"), attr$5(s, "placeholder", "MSAVGH..."), s.value = e = /*item*/ - y[44].sequence; + s = element$5("textarea"), attr$5(s, "id", "message"), attr$5(s, "rows", "4"), attr$5(s, "class", "block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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-bt9x4p"), attr$5(s, "placeholder", "MSAVGH..."), s.value = e = /*item*/ + y[48].sequence; }, m(x, o) { - insert$6(x, s, o), l || (g = listen$1(s, "input", _), l = !0); + insert$6(x, s, o), l || (p = listen$1(s, "input", _), l = !0); }, p(x, o) { y = x, o[0] & /*vals*/ 1 && e !== (e = /*item*/ - y[44].sequence) && (s.value = e); + y[48].sequence) && (s.value = e); }, i: noop$6, o: noop$6, d(x) { - x && detach$6(s), l = !1, g(); + x && detach$6(s), l = !1, p(); } }; } -function create_each_block_5(y) { - let s, e, l, g, _; +function create_each_block_6(y) { + let s, e, l, p, _; function x() { return ( /*click_handler_2*/ - y[18]( + y[19]( /*metal*/ - y[46], + y[50], /*i*/ - y[35] + y[37] ) ); } return { c() { s = element$5("button"), e = element$5("span"), e.textContent = `${/*metal*/ - y[46]}`, l = space$4(), attr$5(e, "class", "font-medium text-gray-600 dark:text-gray-300 svelte-fryf3t"), attr$5(s, "class", "relative inline-flex items-center justify-center w-10 h-10 overflow-hidden rounded-full dark:bg-gray-600 svelte-fryf3t"), toggle_class$4( + y[50]}`, l = space$4(), attr$5(e, "class", "font-medium text-gray-600 dark:text-gray-300 svelte-bt9x4p"), attr$5(s, "class", "relative inline-flex items-center justify-center w-10 h-10 overflow-hidden rounded-full dark:bg-gray-600 svelte-bt9x4p"), toggle_class$4( s, "bg-blue-200", /*item*/ - y[44].name === /*metal*/ - y[46] + y[48].name === /*metal*/ + y[50] ), toggle_class$4( s, "bg-violet-100", /*item*/ - y[44].name !== /*metal*/ - y[46] + y[48].name !== /*metal*/ + y[50] ); }, - m(o, p) { - insert$6(o, s, p), append$4(s, e), append$4(s, l), g || (_ = listen$1(s, "click", x), g = !0); + m(o, g) { + insert$6(o, s, g), append$4(s, e), append$4(s, l), p || (_ = listen$1(s, "click", x), p = !0); }, - p(o, p) { - y = o, p[0] & /*vals, metals*/ + p(o, g) { + y = o, g[0] & /*vals, metals*/ 257 && toggle_class$4( s, "bg-blue-200", /*item*/ - y[44].name === /*metal*/ - y[46] - ), p[0] & /*vals, metals*/ + y[48].name === /*metal*/ + y[50] + ), g[0] & /*vals, metals*/ 257 && toggle_class$4( s, "bg-violet-100", /*item*/ - y[44].name !== /*metal*/ - y[46] + y[48].name !== /*metal*/ + y[50] ); }, d(o) { - o && detach$6(s), g = !1, _(); + o && detach$6(s), p = !1, _(); } }; } function create_if_block_3$2(y) { - let s, e, l, g, _; + let s, e, l, p, _; const x = [create_if_block_4$2, create_if_block_6$1], o = []; - function p(E, u) { + function g(E, u) { return u[0] & /*vals*/ 1 && (s = null), s == null && (s = !!["DNA", "RNA", "protein"].includes( /*item*/ - E[44].class + E[48].class )), s ? 0 : ( /*item*/ - E[44].class === "ligand" ? 1 : -1 + E[48].class === "ligand" ? 1 : -1 ); } - return ~(e = p(y, [-1, -1])) && (l = o[e] = x[e](y)), { + return ~(e = g(y, [-1, -1])) && (l = o[e] = x[e](y)), { c() { - l && l.c(), g = empty$3(); + l && l.c(), p = empty$3(); }, m(E, u) { - ~e && o[e].m(E, u), insert$6(E, g, u), _ = !0; + ~e && o[e].m(E, u), insert$6(E, p, u), _ = !0; }, p(E, u) { let A = e; - e = p(E, u), e === A ? ~e && o[e].p(E, u) : (l && (group_outros$4(), transition_out$4(o[A], 1, 1, () => { + e = g(E, u), e === A ? ~e && o[e].p(E, u) : (l && (group_outros$4(), transition_out$4(o[A], 1, 1, () => { o[A] = null; - }), check_outros$4()), ~e ? (l = o[e], l ? l.p(E, u) : (l = o[e] = x[e](E), l.c()), transition_in$4(l, 1), l.m(g.parentNode, g)) : l = null); + }), check_outros$4()), ~e ? (l = o[e], l ? l.p(E, u) : (l = o[e] = x[e](E), l.c()), transition_in$4(l, 1), l.m(p.parentNode, p)) : l = null); }, i(E) { _ || (transition_in$4(l), _ = !0); @@ -25432,141 +25436,141 @@ function create_if_block_3$2(y) { transition_out$4(l), _ = !1; }, d(E) { - E && detach$6(g), ~e && o[e].d(E); + E && detach$6(p), ~e && o[e].d(E); } }; } function create_if_block_6$1(y) { let s, e, l = ( /*item*/ - y[44].sdf !== "" && create_if_block_7$1(y) + y[48].sdf !== "" && create_if_block_7$1(y) ); return { c() { l && l.c(), s = empty$3(); }, - m(g, _) { - l && l.m(g, _), insert$6(g, s, _), e = !0; + m(p, _) { + l && l.m(p, _), insert$6(p, s, _), e = !0; }, - p(g, _) { + p(p, _) { /*item*/ - g[44].sdf !== "" ? l ? (l.p(g, _), _[0] & /*vals*/ - 1 && transition_in$4(l, 1)) : (l = create_if_block_7$1(g), l.c(), transition_in$4(l, 1), l.m(s.parentNode, s)) : l && (group_outros$4(), transition_out$4(l, 1, 1, () => { + p[48].sdf !== "" ? l ? (l.p(p, _), _[0] & /*vals*/ + 1 && transition_in$4(l, 1)) : (l = create_if_block_7$1(p), l.c(), transition_in$4(l, 1), l.m(s.parentNode, s)) : l && (group_outros$4(), transition_out$4(l, 1, 1, () => { l = null; }), check_outros$4()); }, - i(g) { + i(p) { e || (transition_in$4(l), e = !0); }, - o(g) { + o(p) { transition_out$4(l), e = !1; }, - d(g) { - g && detach$6(s), l && l.d(g); + d(p) { + p && detach$6(s), l && l.d(p); } }; } function create_if_block_4$2(y) { - let s, e, l, g = ( + let s, e, l, p = ( /*item*/ - y[44].sequence !== "" && create_if_block_5$2(y) + y[48].sequence !== "" && create_if_block_5$2(y) ); return { c() { - s = element$5("div"), e = element$5("div"), g && g.c(), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-fryf3t"), toggle_class$4( + s = element$5("div"), e = element$5("div"), p && p.c(), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-bt9x4p"), toggle_class$4( e, "border-b-0", /*i*/ - y[35] != /*vals*/ + y[37] != /*vals*/ y[0].length - 1 ), attr$5(s, "id", `accordion-collapse-body-${/*i*/ - y[35]}`), attr$5(s, "aria-labelledby", `accordion-collapse-heading-${/*i*/ - y[35]}`), attr$5(s, "class", "svelte-fryf3t"); + y[37]}`), attr$5(s, "aria-labelledby", `accordion-collapse-heading-${/*i*/ + y[37]}`), attr$5(s, "class", "svelte-bt9x4p"); }, m(_, x) { - insert$6(_, s, x), append$4(s, e), g && g.m(e, null), l = !0; + insert$6(_, s, x), append$4(s, e), p && p.m(e, null), l = !0; }, p(_, x) { /*item*/ - _[44].sequence !== "" ? g ? (g.p(_, x), x[0] & /*vals*/ - 1 && transition_in$4(g, 1)) : (g = create_if_block_5$2(_), g.c(), transition_in$4(g, 1), g.m(e, null)) : g && (group_outros$4(), transition_out$4(g, 1, 1, () => { - g = null; + _[48].sequence !== "" ? p ? (p.p(_, x), x[0] & /*vals*/ + 1 && transition_in$4(p, 1)) : (p = create_if_block_5$2(_), p.c(), transition_in$4(p, 1), p.m(e, null)) : p && (group_outros$4(), transition_out$4(p, 1, 1, () => { + p = null; }), check_outros$4()), (!l || x[0] & /*vals*/ 1) && toggle_class$4( e, "border-b-0", /*i*/ - _[35] != /*vals*/ + _[37] != /*vals*/ _[0].length - 1 ); }, i(_) { - l || (transition_in$4(g), l = !0); + l || (transition_in$4(p), l = !0); }, o(_) { - transition_out$4(g), l = !1; + transition_out$4(p), l = !1; }, d(_) { - _ && detach$6(s), g && g.d(); + _ && detach$6(s), p && p.d(); } }; } function create_if_block_7$1(y) { - let s, e, l, g; + let s, e, l, p; return l = new Molecule({ props: { molvalue: ( /*item*/ - y[44].sdf + y[48].sdf ), showCovMod: ( /*showCovModVals*/ y[2][ /*i*/ - y[35] + y[37] ] ) } }), l.$on( "updateMol", /*updateMol*/ - y[11] + y[12] ), { c() { - s = element$5("div"), e = element$5("div"), create_component$4(l.$$.fragment), attr$5(e, "class", "relative svelte-fryf3t"), attr$5(s, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-fryf3t"), toggle_class$4( + s = element$5("div"), e = element$5("div"), create_component$4(l.$$.fragment), attr$5(e, "class", "relative svelte-bt9x4p"), attr$5(s, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-bt9x4p"), toggle_class$4( s, "border-b-0", /*i*/ - y[35] != /*vals*/ + y[37] != /*vals*/ y[0].length - 1 ); }, m(_, x) { - insert$6(_, s, x), append$4(s, e), mount_component$4(l, e, null), g = !0; + insert$6(_, s, x), append$4(s, e), mount_component$4(l, e, null), p = !0; }, p(_, x) { const o = {}; x[0] & /*vals*/ 1 && (o.molvalue = /*item*/ - _[44].sdf), x[0] & /*showCovModVals*/ + _[48].sdf), x[0] & /*showCovModVals*/ 4 && (o.showCovMod = /*showCovModVals*/ _[2][ /*i*/ - _[35] - ]), l.$set(o), (!g || x[0] & /*vals*/ + _[37] + ]), l.$set(o), (!p || x[0] & /*vals*/ 1) && toggle_class$4( s, "border-b-0", /*i*/ - _[35] != /*vals*/ + _[37] != /*vals*/ _[0].length - 1 ); }, i(_) { - g || (transition_in$4(l.$$.fragment, _), g = !0); + p || (transition_in$4(l.$$.fragment, _), p = !0); }, o(_) { - transition_out$4(l.$$.fragment, _), g = !1; + transition_out$4(l.$$.fragment, _), p = !1; }, d(_) { _ && detach$6(s), destroy_component$4(l); @@ -25578,20 +25582,20 @@ function create_if_block_5$2(y) { return s = new Sequence({ props: { seq: ( /*item*/ - y[44].sequence + y[48].sequence ) } }), { c() { create_component$4(s.$$.fragment); }, - m(l, g) { - mount_component$4(s, l, g), e = !0; + m(l, p) { + mount_component$4(s, l, p), e = !0; }, - p(l, g) { + p(l, p) { const _ = {}; - g[0] & /*vals*/ + p[0] & /*vals*/ 1 && (_.seq = /*item*/ - l[44].sequence), s.$set(_); + l[48].sequence), s.$set(_); }, i(l) { e || (transition_in$4(s.$$.fragment, l), e = !0); @@ -25604,183 +25608,183 @@ function create_if_block_5$2(y) { } }; } -function create_each_block_4(y) { - let s, e, l, g, _ = ( +function create_each_block_5(y) { + let s, e, l, p, _ = ( /*item*/ - y[44].chain + "" - ), x, o, p, E, u = ( + y[48].chain + "" + ), x, o, g, E, u = ( /*labels*/ y[6][ /*item*/ - y[44].class + y[48].class ] + "" - ), A, C, L, D, r, n, b, f, c, t, a, h, M, w, S, T, R, z = !/*item*/ - y[44].open && /*item*/ - y[44].class === "ligand" && create_if_block_11$1(y); - function P(...$) { + ), A, L, C, D, r, n, b, f, c, t, a, h, M, w, S, T, R, $ = !/*item*/ + y[48].open && /*item*/ + y[48].class === "ligand" && create_if_block_11$1(y); + function P(...z) { return ( /*click_handler*/ - y[13]( + y[14]( /*i*/ - y[35], - ...$ + y[37], + ...z ) ); } function B() { return ( /*click_handler_1*/ - y[14]( + y[15]( /*item*/ - y[44], - /*each_value_4*/ - y[45], + y[48], + /*each_value_5*/ + y[49], /*i*/ - y[35] + y[37] ) ); } - let U = ( + let F = ( /*item*/ - y[44].open && create_if_block_8$1(y) - ), F = !/*item*/ - y[44].open && create_if_block_3$2(y); + y[48].open && create_if_block_8$1(y) + ), U = !/*item*/ + y[48].open && create_if_block_3$2(y); return { c() { - s = element$5("h2"), e = element$5("button"), l = element$5("div"), g = element$5("span"), x = text$4(_), p = space$4(), E = element$5("span"), A = text$4(u), C = space$4(), L = element$5("span"), z && z.c(), D = space$4(), r = element$5("div"), n = svg_element$1("svg"), b = svg_element$1("path"), f = space$4(), c = svg_element$1("svg"), t = svg_element$1("path"), h = space$4(), U && U.c(), M = space$4(), F && F.c(), w = empty$3(), attr$5(g, "class", o = "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full " + /*colorCode*/ + s = element$5("h2"), e = element$5("button"), l = element$5("div"), p = element$5("span"), x = text$4(_), g = space$4(), E = element$5("span"), A = text$4(u), L = space$4(), C = element$5("span"), $ && $.c(), D = space$4(), r = element$5("div"), n = svg_element$1("svg"), b = svg_element$1("path"), f = space$4(), c = svg_element$1("svg"), t = svg_element$1("path"), h = space$4(), F && F.c(), M = space$4(), U && U.c(), w = empty$3(), attr$5(p, "class", o = "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full " + /*colorCode*/ y[7][ /*item*/ - y[44].class - ] + " svelte-fryf3t"), attr$5(E, "class", "svelte-fryf3t"), attr$5(L, "class", "px-2 text-gray-800 font-bold svelte-fryf3t"), attr$5(l, "class", "svelte-fryf3t"), attr$5(b, "stroke-linecap", "round"), attr$5(b, "stroke-linejoin", "round"), attr$5(b, "d", "M6 18 18 6M6 6l12 12"), attr$5(b, "class", "svelte-fryf3t"), attr$5(n, "data-slot", "icon"), attr$5(n, "fill", "none"), attr$5(n, "stroke-width", "3"), attr$5(n, "stroke", "currentColor"), attr$5(n, "viewBox", "0 0 24 24"), attr$5(n, "xmlns", "http://www.w3.org/2000/svg"), attr$5(n, "aria-hidden", "true"), attr$5(n, "class", "w-4 h-4 text-red-800 svelte-fryf3t"), attr$5(t, "stroke", "currentColor"), attr$5(t, "stroke-linecap", "round"), attr$5(t, "stroke-linejoin", "round"), attr$5(t, "stroke-width", "2"), attr$5(t, "d", "M9 5 5 1 1 5"), attr$5(t, "class", "svelte-fryf3t"), attr$5(c, "data-accordion-icon", ""), attr$5(c, "class", "w-3 h-3 shrink-0 svelte-fryf3t"), attr$5(c, "aria-hidden", "true"), attr$5(c, "xmlns", "http://www.w3.org/2000/svg"), attr$5(c, "fill", "none"), attr$5(c, "viewBox", "0 0 10 6"), toggle_class$4( + y[48].class + ] + " svelte-bt9x4p"), attr$5(E, "class", "svelte-bt9x4p"), attr$5(C, "class", "px-2 text-gray-800 font-bold svelte-bt9x4p"), attr$5(l, "class", "svelte-bt9x4p"), attr$5(b, "stroke-linecap", "round"), attr$5(b, "stroke-linejoin", "round"), attr$5(b, "d", "M6 18 18 6M6 6l12 12"), attr$5(b, "class", "svelte-bt9x4p"), attr$5(n, "data-slot", "icon"), attr$5(n, "fill", "none"), attr$5(n, "stroke-width", "3"), attr$5(n, "stroke", "currentColor"), attr$5(n, "viewBox", "0 0 24 24"), attr$5(n, "xmlns", "http://www.w3.org/2000/svg"), attr$5(n, "aria-hidden", "true"), attr$5(n, "class", "w-4 h-4 text-red-800 svelte-bt9x4p"), attr$5(t, "stroke", "currentColor"), attr$5(t, "stroke-linecap", "round"), attr$5(t, "stroke-linejoin", "round"), attr$5(t, "stroke-width", "2"), attr$5(t, "d", "M9 5 5 1 1 5"), attr$5(t, "class", "svelte-bt9x4p"), attr$5(c, "data-accordion-icon", ""), attr$5(c, "class", "w-3 h-3 shrink-0 svelte-bt9x4p"), attr$5(c, "aria-hidden", "true"), attr$5(c, "xmlns", "http://www.w3.org/2000/svg"), attr$5(c, "fill", "none"), attr$5(c, "viewBox", "0 0 10 6"), toggle_class$4( c, "rotate-180", /*item*/ - y[44].open + y[48].open ), toggle_class$4(c, "-rotate-90", !/*item*/ - y[44].open), attr$5(r, "class", "flex items-center space-x-2 svelte-fryf3t"), attr$5(e, "type", "button"), attr$5(e, "class", "flex items-center justify-between w-full p-5 font-medium rtl:text-right text-gray-500 border border-gray-200 dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 gap-3 svelte-fryf3t"), attr$5(e, "data-accordion-target", `#accordion-collapse-body-${/*i*/ - y[35]}`), attr$5(e, "aria-expanded", a = /*item*/ - y[44].open), attr$5(e, "aria-controls", `accordion-collapse-body-${/*i*/ - y[35]}`), toggle_class$4( + y[48].open), attr$5(r, "class", "flex items-center space-x-2 svelte-bt9x4p"), attr$5(e, "type", "button"), attr$5(e, "class", "flex items-center justify-between w-full p-5 font-medium rtl:text-right text-gray-500 border border-gray-200 dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 gap-3 svelte-bt9x4p"), attr$5(e, "data-accordion-target", `#accordion-collapse-body-${/*i*/ + y[37]}`), attr$5(e, "aria-expanded", a = /*item*/ + y[48].open), attr$5(e, "aria-controls", `accordion-collapse-body-${/*i*/ + y[37]}`), toggle_class$4( e, "rounded-t-xl", /*i*/ - y[35] === 0 + y[37] === 0 ), toggle_class$4( e, "rounded-b-xl", /*i*/ - y[35] == /*vals*/ + y[37] == /*vals*/ y[0].length - 1 ), toggle_class$4( e, "border-b-0", /*i*/ - y[35] != /*vals*/ + y[37] != /*vals*/ y[0].length - 1 ), attr$5(s, "id", `accordion-collapse-heading-${/*i*/ - y[35]}`), attr$5(s, "class", "svelte-fryf3t"); + y[37]}`), attr$5(s, "class", "svelte-bt9x4p"); }, - m($, W) { - insert$6($, s, W), append$4(s, e), append$4(e, l), append$4(l, g), append$4(g, x), append$4(l, p), append$4(l, E), append$4(E, A), append$4(l, C), append$4(l, L), z && z.m(L, null), append$4(e, D), append$4(e, r), append$4(r, n), append$4(n, b), append$4(r, f), append$4(r, c), append$4(c, t), insert$6($, h, W), U && U.m($, W), insert$6($, M, W), F && F.m($, W), insert$6($, w, W), S = !0, T || (R = [ + m(z, W) { + insert$6(z, s, W), append$4(s, e), append$4(e, l), append$4(l, p), append$4(p, x), append$4(l, g), append$4(l, E), append$4(E, A), append$4(l, L), append$4(l, C), $ && $.m(C, null), append$4(e, D), append$4(e, r), append$4(r, n), append$4(n, b), append$4(r, f), append$4(r, c), append$4(c, t), insert$6(z, h, W), F && F.m(z, W), insert$6(z, M, W), U && U.m(z, W), insert$6(z, w, W), S = !0, T || (R = [ listen$1(n, "click", P), listen$1(e, "click", B) ], T = !0); }, - p($, W) { - y = $, (!S || W[0] & /*vals*/ + p(z, W) { + y = z, (!S || W[0] & /*vals*/ 1) && _ !== (_ = /*item*/ - y[44].chain + "") && set_data$4(x, _), (!S || W[0] & /*vals*/ + y[48].chain + "") && set_data$4(x, _), (!S || W[0] & /*vals*/ 1 && o !== (o = "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full " + /*colorCode*/ y[7][ /*item*/ - y[44].class - ] + " svelte-fryf3t")) && attr$5(g, "class", o), (!S || W[0] & /*vals*/ + y[48].class + ] + " svelte-bt9x4p")) && attr$5(p, "class", o), (!S || W[0] & /*vals*/ 1) && u !== (u = /*labels*/ y[6][ /*item*/ - y[44].class + y[48].class ] + "") && set_data$4(A, u), !/*item*/ - y[44].open && /*item*/ - y[44].class === "ligand" ? z ? z.p(y, W) : (z = create_if_block_11$1(y), z.c(), z.m(L, null)) : z && (z.d(1), z = null), (!S || W[0] & /*vals*/ + y[48].open && /*item*/ + y[48].class === "ligand" ? $ ? $.p(y, W) : ($ = create_if_block_11$1(y), $.c(), $.m(C, null)) : $ && ($.d(1), $ = null), (!S || W[0] & /*vals*/ 1) && toggle_class$4( c, "rotate-180", /*item*/ - y[44].open + y[48].open ), (!S || W[0] & /*vals*/ 1) && toggle_class$4(c, "-rotate-90", !/*item*/ - y[44].open), (!S || W[0] & /*vals*/ + y[48].open), (!S || W[0] & /*vals*/ 1 && a !== (a = /*item*/ - y[44].open)) && attr$5(e, "aria-expanded", a), (!S || W[0] & /*vals*/ + y[48].open)) && attr$5(e, "aria-expanded", a), (!S || W[0] & /*vals*/ 1) && toggle_class$4( e, "rounded-b-xl", /*i*/ - y[35] == /*vals*/ + y[37] == /*vals*/ y[0].length - 1 ), (!S || W[0] & /*vals*/ 1) && toggle_class$4( e, "border-b-0", /*i*/ - y[35] != /*vals*/ + y[37] != /*vals*/ y[0].length - 1 ), /*item*/ - y[44].open ? U ? (U.p(y, W), W[0] & /*vals*/ - 1 && transition_in$4(U, 1)) : (U = create_if_block_8$1(y), U.c(), transition_in$4(U, 1), U.m(M.parentNode, M)) : U && (group_outros$4(), transition_out$4(U, 1, 1, () => { - U = null; - }), check_outros$4()), /*item*/ - y[44].open ? F && (group_outros$4(), transition_out$4(F, 1, 1, () => { + y[48].open ? F ? (F.p(y, W), W[0] & /*vals*/ + 1 && transition_in$4(F, 1)) : (F = create_if_block_8$1(y), F.c(), transition_in$4(F, 1), F.m(M.parentNode, M)) : F && (group_outros$4(), transition_out$4(F, 1, 1, () => { F = null; - }), check_outros$4()) : F ? (F.p(y, W), W[0] & /*vals*/ - 1 && transition_in$4(F, 1)) : (F = create_if_block_3$2(y), F.c(), transition_in$4(F, 1), F.m(w.parentNode, w)); + }), check_outros$4()), /*item*/ + y[48].open ? U && (group_outros$4(), transition_out$4(U, 1, 1, () => { + U = null; + }), check_outros$4()) : U ? (U.p(y, W), W[0] & /*vals*/ + 1 && transition_in$4(U, 1)) : (U = create_if_block_3$2(y), U.c(), transition_in$4(U, 1), U.m(w.parentNode, w)); }, - i($) { - S || (transition_in$4(U), transition_in$4(F), S = !0); + i(z) { + S || (transition_in$4(F), transition_in$4(U), S = !0); }, - o($) { - transition_out$4(U), transition_out$4(F), S = !1; + o(z) { + transition_out$4(F), transition_out$4(U), S = !1; }, - d($) { - $ && (detach$6(s), detach$6(h), detach$6(M), detach$6(w)), z && z.d(), U && U.d($), F && F.d($), T = !1, run_all$1(R); + d(z) { + z && (detach$6(s), detach$6(h), detach$6(M), detach$6(w)), $ && $.d(), F && F.d(z), U && U.d(z), T = !1, run_all$1(R); } }; } function create_if_block$4(y) { - let s, e, l, g = ensure_array_like$1( + let s, e, l, p = ensure_array_like$1( /*covMods*/ y[1] ), _ = []; - for (let x = 0; x < g.length; x += 1) - _[x] = create_each_block$1(get_each_context$1(y, g, x)); + for (let x = 0; x < p.length; x += 1) + _[x] = create_each_block$1(get_each_context$1(y, p, x)); return { c() { s = element$5("h4"), s.textContent = "Covalent Modification", e = space$4(); for (let x = 0; x < _.length; x += 1) _[x].c(); - l = empty$3(), attr$5(s, "class", "text-center font-bold text-xl svelte-fryf3t"); + l = empty$3(), attr$5(s, "class", "text-center font-bold text-xl svelte-bt9x4p"); }, m(x, o) { insert$6(x, s, o), insert$6(x, e, o); - for (let p = 0; p < _.length; p += 1) - _[p] && _[p].m(x, o); + for (let g = 0; g < _.length; g += 1) + _[g] && _[g].m(x, o); insert$6(x, l, o); }, p(x, o) { - if (o[0] & /*dispatch, covMods, ligandChains, getResAtoms, getResname, proteinChains*/ - 1594) { - g = ensure_array_like$1( + if (o[0] & /*dispatch, covMods, ligandChains, getResAtoms, getResname, getResidues, proteinChains*/ + 3642) { + p = ensure_array_like$1( /*covMods*/ x[1] ); - let p; - for (p = 0; p < g.length; p += 1) { - const E = get_each_context$1(x, g, p); - _[p] ? _[p].p(E, o) : (_[p] = create_each_block$1(E), _[p].c(), _[p].m(l.parentNode, l)); + let g; + for (g = 0; g < p.length; g += 1) { + const E = get_each_context$1(x, p, g); + _[g] ? _[g].p(E, o) : (_[g] = create_each_block$1(E), _[g].c(), _[g].m(l.parentNode, l)); } - for (; p < _.length; p += 1) - _[p].d(1); - _.length = g.length; + for (; g < _.length; g += 1) + _[g].d(1); + _.length = p.length; } }, d(x) { @@ -25788,15 +25792,15 @@ function create_if_block$4(y) { } }; } -function create_each_block_3(y) { +function create_each_block_4(y) { let s, e = ( /*chain*/ - y[36] + "" - ), l, g; + y[38] + "" + ), l, p; return { c() { - s = element$5("option"), l = text$4(e), s.__value = g = /*chain*/ - y[36], set_input_value$1(s, s.__value), attr$5(s, "class", "svelte-fryf3t"); + s = element$5("option"), l = text$4(e), s.__value = p = /*chain*/ + y[38], set_input_value$1(s, s.__value), attr$5(s, "class", "svelte-bt9x4p"); }, m(_, x) { insert$6(_, s, x), append$4(s, l); @@ -25804,20 +25808,46 @@ function create_each_block_3(y) { p(_, x) { x[0] & /*proteinChains*/ 8 && e !== (e = /*chain*/ - _[36] + "") && set_data$4(l, e), x[0] & /*proteinChains*/ - 8 && g !== (g = /*chain*/ - _[36]) && (s.__value = g, set_input_value$1(s, s.__value)); + _[38] + "") && set_data$4(l, e), x[0] & /*proteinChains*/ + 8 && p !== (p = /*chain*/ + _[38]) && (s.__value = p, set_input_value$1(s, s.__value)); }, d(_) { _ && detach$6(s); } }; } +function create_each_block_3(y) { + let s, e = ( + /*i*/ + y[37] + 1 + "" + ), l, p, _ = ( + /*resi*/ + y[44] + "" + ), x; + return { + c() { + s = element$5("option"), l = text$4(e), p = space$4(), x = text$4(_), s.__value = /*i*/ + y[37] + 1, set_input_value$1(s, s.__value), attr$5(s, "class", "svelte-bt9x4p"); + }, + m(o, g) { + insert$6(o, s, g), append$4(s, l), append$4(s, p), append$4(s, x); + }, + p(o, g) { + g[0] & /*covMods*/ + 2 && _ !== (_ = /*resi*/ + o[44] + "") && set_data$4(x, _); + }, + d(o) { + o && detach$6(s); + } + }; +} function create_else_block_1$1(y) { let s; return { c() { - s = element$5("option"), s.disabled = !0, s.__value = "", set_input_value$1(s, s.__value), attr$5(s, "class", "svelte-fryf3t"); + s = element$5("option"), s.disabled = !0, s.__value = "", set_input_value$1(s, s.__value), attr$5(s, "class", "svelte-bt9x4p"); }, m(e, l) { insert$6(e, s, l); @@ -25833,35 +25863,35 @@ function create_if_block_2$2(y) { /*getResAtoms*/ y[9]( /*covMod*/ - y[33] + y[35] ) ), l = []; - for (let g = 0; g < e.length; g += 1) - l[g] = create_each_block_2(get_each_context_2(y, e, g)); + for (let p = 0; p < e.length; p += 1) + l[p] = create_each_block_2(get_each_context_2(y, e, p)); return { c() { - for (let g = 0; g < l.length; g += 1) - l[g].c(); + for (let p = 0; p < l.length; p += 1) + l[p].c(); s = empty$3(); }, - m(g, _) { + m(p, _) { for (let x = 0; x < l.length; x += 1) - l[x] && l[x].m(g, _); - insert$6(g, s, _); + l[x] && l[x].m(p, _); + insert$6(p, s, _); }, - p(g, _) { + p(p, _) { if (_[0] & /*getResAtoms, covMods, getResname*/ - 1538) { + 2562) { e = ensure_array_like$1( /*getResAtoms*/ - g[9]( + p[9]( /*covMod*/ - g[33] + p[35] ) ); let x; for (x = 0; x < e.length; x += 1) { - const o = get_each_context_2(g, e, x); + const o = get_each_context_2(p, e, x); l[x] ? l[x].p(o, _) : (l[x] = create_each_block_2(o), l[x].c(), l[x].m(s.parentNode, s)); } for (; x < l.length; x += 1) @@ -25869,42 +25899,42 @@ function create_if_block_2$2(y) { l.length = e.length; } }, - d(g) { - g && detach$6(s), destroy_each$1(l, g); + d(p) { + p && detach$6(s), destroy_each$1(l, p); } }; } function create_each_block_2(y) { let s, e, l = ( /*getResname*/ - y[10]( + y[11]( /*covMod*/ - y[33] + y[35] ) + "" - ), g, _, x = ( + ), p, _, x = ( /*atom*/ - y[39] + "" - ), o, p; + y[41] + "" + ), o, g; return { c() { s = text$4(`} - `), e = element$5("option"), g = text$4(l), _ = text$4(":"), o = text$4(x), e.__value = p = /*atom*/ - y[39], set_input_value$1(e, e.__value), attr$5(e, "class", "svelte-fryf3t"); + `), e = element$5("option"), p = text$4(l), _ = text$4(":"), o = text$4(x), e.__value = g = /*atom*/ + y[41], set_input_value$1(e, e.__value), attr$5(e, "class", "svelte-bt9x4p"); }, m(E, u) { - insert$6(E, s, u), insert$6(E, e, u), append$4(e, g), append$4(e, _), append$4(e, o); + insert$6(E, s, u), insert$6(E, e, u), append$4(e, p), append$4(e, _), append$4(e, o); }, p(E, u) { u[0] & /*covMods*/ 2 && l !== (l = /*getResname*/ - E[10]( + E[11]( /*covMod*/ - E[33] - ) + "") && set_data$4(g, l), u[0] & /*covMods*/ + E[35] + ) + "") && set_data$4(p, l), u[0] & /*covMods*/ 2 && x !== (x = /*atom*/ - E[39] + "") && set_data$4(o, x), u[0] & /*covMods, proteinChains*/ - 10 && p !== (p = /*atom*/ - E[39]) && (e.__value = p, set_input_value$1(e, e.__value)); + E[41] + "") && set_data$4(o, x), u[0] & /*covMods, proteinChains*/ + 10 && g !== (g = /*atom*/ + E[41]) && (e.__value = g, set_input_value$1(e, e.__value)); }, d(E) { E && (detach$6(s), detach$6(e)); @@ -25914,14 +25944,14 @@ function create_each_block_2(y) { function create_each_block_1$1(y) { let s, e = ( /*chain*/ - y[36] + "" - ), l, g, _; + y[38] + "" + ), l, p, _; return { c() { - s = element$5("option"), l = text$4(e), s.__value = g = /*chain*/ - y[36], set_input_value$1(s, s.__value), s.selected = _ = /*chain*/ - y[36] === /*covMod*/ - y[33].ligand, attr$5(s, "class", "svelte-fryf3t"); + s = element$5("option"), l = text$4(e), s.__value = p = /*chain*/ + y[38], set_input_value$1(s, s.__value), s.selected = _ = /*chain*/ + y[38] === /*covMod*/ + y[35].ligand, attr$5(s, "class", "svelte-bt9x4p"); }, m(x, o) { insert$6(x, s, o), append$4(s, l); @@ -25929,12 +25959,12 @@ function create_each_block_1$1(y) { p(x, o) { o[0] & /*ligandChains*/ 16 && e !== (e = /*chain*/ - x[36] + "") && set_data$4(l, e), o[0] & /*ligandChains*/ - 16 && g !== (g = /*chain*/ - x[36]) && (s.__value = g, set_input_value$1(s, s.__value)), o[0] & /*ligandChains, covMods, proteinChains*/ + x[38] + "") && set_data$4(l, e), o[0] & /*ligandChains*/ + 16 && p !== (p = /*chain*/ + x[38]) && (s.__value = p, set_input_value$1(s, s.__value)), o[0] & /*ligandChains, covMods, proteinChains*/ 26 && _ !== (_ = /*chain*/ - x[36] === /*covMod*/ - x[33].ligand) && (s.selected = _); + x[38] === /*covMod*/ + x[35].ligand) && (s.selected = _); }, d(x) { x && detach$6(s); @@ -25945,7 +25975,7 @@ function create_else_block$3(y) { let s; return { c() { - s = element$5("p"), s.textContent = "click on atom", attr$5(s, "class", "font-mono svelte-fryf3t"); + s = element$5("p"), s.textContent = "click on atom", attr$5(s, "class", "font-mono svelte-bt9x4p"); }, m(e, l) { insert$6(e, s, l); @@ -25959,19 +25989,19 @@ function create_else_block$3(y) { function create_if_block_1$3(y) { let s, e, l = ( /*covMod*/ - y[33].attachmentIndex + "" - ), g; + y[35].attachmentIndex + "" + ), p; return { c() { - s = element$5("p"), e = text$4("index "), g = text$4(l), attr$5(s, "class", "font-mono svelte-fryf3t"); + s = element$5("p"), e = text$4("index "), p = text$4(l), attr$5(s, "class", "font-mono svelte-bt9x4p"); }, m(_, x) { - insert$6(_, s, x), append$4(s, e), append$4(s, g); + insert$6(_, s, x), append$4(s, e), append$4(s, p); }, p(_, x) { x[0] & /*covMods*/ 2 && l !== (l = /*covMod*/ - _[33].attachmentIndex + "") && set_data$4(g, l); + _[35].attachmentIndex + "") && set_data$4(p, l); }, d(_) { _ && detach$6(s); @@ -25979,296 +26009,349 @@ function create_if_block_1$3(y) { }; } function create_each_block$1(y) { - let s, e, l, g, _, x, o, p, E, u, A, C, L, D, r, n, b, f, c, t, a, h, M, w, S, T, R, z, P, B, U, F, $, W, N, G, k, j, Q, ie, pe, he, ue = ensure_array_like$1( + let s, e, l, p, _, x, o, g, E, u, A, L, C, D, r, n, b, f, c, t, a, h, M, w, S, T, R, $, P, B, F, U, z, W, V, N, k, G, Q, ie, ge, le = ensure_array_like$1( /*proteinChains*/ y[3] - ), se = []; - for (let Te = 0; Te < ue.length; Te += 1) - se[Te] = create_each_block_3(get_each_context_3(y, ue, Te)); - function ae() { - y[19].call( + ), oe = []; + for (let Be = 0; Be < le.length; Be += 1) + oe[Be] = create_each_block_4(get_each_context_4(y, le, Be)); + function he() { + y[20].call( E, /*i*/ - y[35] + y[37] ); } - function we(...Te) { - return ( - /*input_handler_3*/ - y[21]( - /*i*/ - y[35], - ...Te - ) + let se = ensure_array_like$1( + /*getResidues*/ + y[10]( + /*covMod*/ + y[35] + ) + ), xe = []; + for (let Be = 0; Be < se.length; Be += 1) + xe[Be] = create_each_block_3(get_each_context_3(y, se, Be)); + function ye() { + y[22].call( + A, + /*i*/ + y[37] ); } - function xe(Te, je) { + function Pe(Be, Ne) { return ( /*covMod*/ - Te[33].residue != "" ? create_if_block_2$2 : create_else_block_1$1 + Be[35].residue != "" ? create_if_block_2$2 : create_else_block_1$1 ); } - let Ie = xe(y), oe = Ie(y); - function ve() { - y[22].call( - D, + let de = Pe(y), pe = de(y); + function re() { + y[24].call( + C, /*i*/ - y[35] + y[37] ); } - function re() { - y[24].call( - n, + function Se() { + y[26].call( + r, /*i*/ - y[35] + y[37] ); } - let Se = ensure_array_like$1( + let ke = ensure_array_like$1( /*ligandChains*/ y[4] - ), ze = []; - for (let Te = 0; Te < Se.length; Te += 1) - ze[Te] = create_each_block_1$1(get_each_context_1$1(y, Se, Te)); - function Ge() { - y[26].call( - z, + ), $e = []; + for (let Be = 0; Be < ke.length; Be += 1) + $e[Be] = create_each_block_1$1(get_each_context_1$1(y, ke, Be)); + function ze() { + y[28].call( + R, /*i*/ - y[35] + y[37] ); } - function $e(Te, je) { + function Re(Be, Ne) { return ( /*covMod*/ - Te[33].attachmentIndex ? create_if_block_1$3 : create_else_block$3 + Be[35].attachmentIndex ? create_if_block_1$3 : create_else_block$3 ); } - let Re = $e(y), Be = Re(y); - function ke() { - y[28].call( + let Fe = Re(y), Ie = Fe(y); + function We() { + y[30].call( F, /*i*/ - y[35] + y[37] ); } - function We(...Te) { + function Ue(...Be) { return ( /*click_handler_3*/ - y[30]( + y[32]( /*i*/ - y[35], - ...Te + y[37], + ...Be ) ); } return { c() { - s = element$5("div"), e = element$5("div"), l = element$5("div"), g = element$5("div"), g.innerHTML = 'Protein', _ = space$4(), x = element$5("div"), x.innerHTML = 'Chain Residue Atom Chirality', o = space$4(), p = element$5("div"), E = element$5("select"); - for (let Te = 0; Te < se.length; Te += 1) - se[Te].c(); - u = space$4(), A = element$5("input"), L = space$4(), D = element$5("select"), oe.c(), r = space$4(), n = element$5("select"), b = element$5("option"), b.textContent = "no chirality defined", f = element$5("option"), f.textContent = "CW", c = element$5("option"), c.textContent = "CCW", t = space$4(), a = element$5("div"), h = element$5("div"), M = element$5("div"), M.innerHTML = 'Small molecule', w = space$4(), S = element$5("div"), S.innerHTML = 'Chain Atom index Chirality', T = space$4(), R = element$5("div"), z = element$5("select"); - for (let Te = 0; Te < ze.length; Te += 1) - ze[Te].c(); - P = space$4(), B = element$5("div"), Be.c(), U = space$4(), F = element$5("select"), $ = element$5("option"), $.textContent = "no chirality defined", W = element$5("option"), W.textContent = "CW", N = element$5("option"), N.textContent = "CCW", G = space$4(), k = element$5("div"), j = svg_element$1("svg"), Q = svg_element$1("path"), ie = space$4(), attr$5(g, "class", "flex justify-center svelte-fryf3t"), attr$5(x, "class", "grid grid-cols-4 font-bold svelte-fryf3t"), attr$5(E, "name", ""), attr$5(E, "id", ""), attr$5(E, "class", "svelte-fryf3t"), /*covMods*/ + s = element$5("div"), e = element$5("div"), l = element$5("div"), p = element$5("div"), p.innerHTML = 'Protein', _ = space$4(), x = element$5("div"), x.innerHTML = 'Chain Residue Atom Chirality', o = space$4(), g = element$5("div"), E = element$5("select"); + for (let Be = 0; Be < oe.length; Be += 1) + oe[Be].c(); + u = space$4(), A = element$5("select"); + for (let Be = 0; Be < xe.length; Be += 1) + xe[Be].c(); + L = space$4(), C = element$5("select"), pe.c(), D = space$4(), r = element$5("select"), n = element$5("option"), n.textContent = "no chirality defined", b = element$5("option"), b.textContent = "CW", f = element$5("option"), f.textContent = "CCW", c = space$4(), t = element$5("div"), a = element$5("div"), h = element$5("div"), h.innerHTML = 'Small molecule', M = space$4(), w = element$5("div"), w.innerHTML = 'Chain Atom index Chirality', S = space$4(), T = element$5("div"), R = element$5("select"); + for (let Be = 0; Be < $e.length; Be += 1) + $e[Be].c(); + $ = space$4(), P = element$5("div"), Ie.c(), B = space$4(), F = element$5("select"), U = element$5("option"), U.textContent = "no chirality defined", z = element$5("option"), z.textContent = "CW", W = element$5("option"), W.textContent = "CCW", V = space$4(), N = element$5("div"), k = svg_element$1("svg"), G = svg_element$1("path"), Q = space$4(), attr$5(p, "class", "flex justify-center svelte-bt9x4p"), attr$5(x, "class", "grid grid-cols-4 font-bold svelte-bt9x4p"), attr$5(E, "name", ""), attr$5(E, "id", ""), attr$5(E, "class", "svelte-bt9x4p"), /*covMods*/ y[1][ /*i*/ - y[35] - ].protein === void 0 && add_render_callback$2(ae), attr$5(A, "type", "text"), attr$5(A, "placeholder", "residue "), attr$5(A, "class", "px-3 svelte-fryf3t"), A.value = C = /*covMod*/ - y[33].residue, attr$5(D, "name", ""), attr$5(D, "id", ""), attr$5(D, "class", "svelte-fryf3t"), /*covMods*/ + y[37] + ].protein === void 0 && add_render_callback$2(he), attr$5(A, "name", ""), attr$5(A, "id", ""), attr$5(A, "class", "svelte-bt9x4p"), /*covMods*/ y[1][ /*i*/ - y[35] - ].atom === void 0 && add_render_callback$2(ve), b.__value = "", set_input_value$1(b, b.__value), attr$5(b, "class", "svelte-fryf3t"), f.__value = "CW", set_input_value$1(f, f.__value), attr$5(f, "class", "svelte-fryf3t"), c.__value = "CCW", set_input_value$1(c, c.__value), attr$5(c, "class", "svelte-fryf3t"), attr$5(n, "name", ""), attr$5(n, "id", ""), attr$5(n, "class", "svelte-fryf3t"), /*covMods*/ + y[37] + ].residue === void 0 && add_render_callback$2(ye), attr$5(C, "name", ""), attr$5(C, "id", ""), attr$5(C, "class", "svelte-bt9x4p"), /*covMods*/ y[1][ /*i*/ - y[35] - ].protein_symmetry === void 0 && add_render_callback$2(re), attr$5(p, "class", "grid grid-cols-4 svelte-fryf3t"), attr$5(l, "class", "w-3/5 flex-col px-2 svelte-fryf3t"), attr$5(M, "class", "flex justify-center svelte-fryf3t"), attr$5(S, "class", "grid grid-cols-3 font-bold svelte-fryf3t"), attr$5(z, "name", ""), attr$5(z, "id", ""), attr$5(z, "title", "click on atom in structure"), attr$5(z, "class", "svelte-fryf3t"), /*covMods*/ + y[37] + ].atom === void 0 && add_render_callback$2(re), n.__value = "", set_input_value$1(n, n.__value), attr$5(n, "class", "svelte-bt9x4p"), b.__value = "CW", set_input_value$1(b, b.__value), attr$5(b, "class", "svelte-bt9x4p"), f.__value = "CCW", set_input_value$1(f, f.__value), attr$5(f, "class", "svelte-bt9x4p"), attr$5(r, "name", ""), attr$5(r, "id", ""), attr$5(r, "class", "svelte-bt9x4p"), /*covMods*/ y[1][ /*i*/ - y[35] - ].ligand === void 0 && add_render_callback$2(Ge), attr$5(B, "class", "svelte-fryf3t"), $.__value = "", set_input_value$1($, $.__value), attr$5($, "class", "svelte-fryf3t"), W.__value = "CW", set_input_value$1(W, W.__value), attr$5(W, "class", "svelte-fryf3t"), N.__value = "CCW", set_input_value$1(N, N.__value), attr$5(N, "class", "svelte-fryf3t"), attr$5(F, "name", ""), attr$5(F, "id", ""), attr$5(F, "class", "svelte-fryf3t"), /*covMods*/ + y[37] + ].protein_symmetry === void 0 && add_render_callback$2(Se), attr$5(g, "class", "grid grid-cols-4 svelte-bt9x4p"), attr$5(l, "class", "w-3/5 flex-col px-2 svelte-bt9x4p"), attr$5(h, "class", "flex justify-center svelte-bt9x4p"), attr$5(w, "class", "grid grid-cols-3 font-bold svelte-bt9x4p"), attr$5(R, "name", ""), attr$5(R, "id", ""), attr$5(R, "title", "click on atom in structure"), attr$5(R, "class", "svelte-bt9x4p"), /*covMods*/ y[1][ /*i*/ - y[35] - ].ligand_symmetry === void 0 && add_render_callback$2(ke), attr$5(R, "class", "grid grid-cols-3 svelte-fryf3t"), attr$5(h, "class", "flex-col p-1 svelte-fryf3t"), attr$5(a, "class", "w-2/5 px-2 svelte-fryf3t"), attr$5(e, "class", "flex divide-x rounded border p-1 svelte-fryf3t"), attr$5(Q, "stroke-linecap", "round"), attr$5(Q, "stroke-linejoin", "round"), attr$5(Q, "d", "M6 18 18 6M6 6l12 12"), attr$5(Q, "class", "svelte-fryf3t"), attr$5(j, "data-slot", "icon"), attr$5(j, "fill", "none"), attr$5(j, "stroke-width", "2"), attr$5(j, "stroke", "currentColor"), attr$5(j, "viewBox", "0 0 24 24"), attr$5(j, "xmlns", "http://www.w3.org/2000/svg"), attr$5(j, "aria-hidden", "true"), attr$5(j, "class", "w-8 h-8 text-red-800 cursor-pointer svelte-fryf3t"), attr$5(k, "class", "flex items-center p-2 svelte-fryf3t"), attr$5(s, "class", "flex p-10 svelte-fryf3t"); + y[37] + ].ligand === void 0 && add_render_callback$2(ze), attr$5(P, "class", "svelte-bt9x4p"), U.__value = "", set_input_value$1(U, U.__value), attr$5(U, "class", "svelte-bt9x4p"), z.__value = "CW", set_input_value$1(z, z.__value), attr$5(z, "class", "svelte-bt9x4p"), W.__value = "CCW", set_input_value$1(W, W.__value), attr$5(W, "class", "svelte-bt9x4p"), attr$5(F, "name", ""), attr$5(F, "id", ""), attr$5(F, "class", "svelte-bt9x4p"), /*covMods*/ + y[1][ + /*i*/ + y[37] + ].ligand_symmetry === void 0 && add_render_callback$2(We), attr$5(T, "class", "grid grid-cols-3 svelte-bt9x4p"), attr$5(a, "class", "flex-col p-1 svelte-bt9x4p"), attr$5(t, "class", "w-2/5 px-2 svelte-bt9x4p"), attr$5(e, "class", "flex divide-x rounded border p-1 w-full svelte-bt9x4p"), attr$5(G, "stroke-linecap", "round"), attr$5(G, "stroke-linejoin", "round"), attr$5(G, "d", "M6 18 18 6M6 6l12 12"), attr$5(G, "class", "svelte-bt9x4p"), attr$5(k, "data-slot", "icon"), attr$5(k, "fill", "none"), attr$5(k, "stroke-width", "2"), attr$5(k, "stroke", "currentColor"), attr$5(k, "viewBox", "0 0 24 24"), attr$5(k, "xmlns", "http://www.w3.org/2000/svg"), attr$5(k, "aria-hidden", "true"), attr$5(k, "class", "w-8 h-8 text-red-800 cursor-pointer svelte-bt9x4p"), attr$5(N, "class", "flex items-center p-2 svelte-bt9x4p"), attr$5(s, "class", "flex p-10 svelte-bt9x4p"); }, - m(Te, je) { - insert$6(Te, s, je), append$4(s, e), append$4(e, l), append$4(l, g), append$4(l, _), append$4(l, x), append$4(l, o), append$4(l, p), append$4(p, E); - for (let Fe = 0; Fe < se.length; Fe += 1) - se[Fe] && se[Fe].m(E, null); + m(Be, Ne) { + insert$6(Be, s, Ne), append$4(s, e), append$4(e, l), append$4(l, p), append$4(l, _), append$4(l, x), append$4(l, o), append$4(l, g), append$4(g, E); + for (let H = 0; H < oe.length; H += 1) + oe[H] && oe[H].m(E, null); select_option( E, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].protein, !0 - ), append$4(p, u), append$4(p, A), append$4(p, L), append$4(p, D), oe.m(D, null), select_option( - D, + ), append$4(g, u), append$4(g, A); + for (let H = 0; H < xe.length; H += 1) + xe[H] && xe[H].m(A, null); + select_option( + A, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] + ].residue, + !0 + ), append$4(g, L), append$4(g, C), pe.m(C, null), select_option( + C, + /*covMods*/ + y[1][ + /*i*/ + y[37] ].atom, !0 - ), append$4(p, r), append$4(p, n), append$4(n, b), append$4(n, f), append$4(n, c), select_option( - n, + ), append$4(g, D), append$4(g, r), append$4(r, n), append$4(r, b), append$4(r, f), select_option( + r, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].protein_symmetry, !0 - ), append$4(e, t), append$4(e, a), append$4(a, h), append$4(h, M), append$4(h, w), append$4(h, S), append$4(h, T), append$4(h, R), append$4(R, z); - for (let Fe = 0; Fe < ze.length; Fe += 1) - ze[Fe] && ze[Fe].m(z, null); + ), append$4(e, c), append$4(e, t), append$4(t, a), append$4(a, h), append$4(a, M), append$4(a, w), append$4(a, S), append$4(a, T), append$4(T, R); + for (let H = 0; H < $e.length; H += 1) + $e[H] && $e[H].m(R, null); select_option( - z, + R, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].ligand, !0 - ), append$4(R, P), append$4(R, B), Be.m(B, null), append$4(R, U), append$4(R, F), append$4(F, $), append$4(F, W), append$4(F, N), select_option( + ), append$4(T, $), append$4(T, P), Ie.m(P, null), append$4(T, B), append$4(T, F), append$4(F, U), append$4(F, z), append$4(F, W), select_option( F, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].ligand_symmetry, !0 - ), append$4(s, G), append$4(s, k), append$4(k, j), append$4(j, Q), append$4(s, ie), pe || (he = [ - listen$1(E, "change", ae), + ), append$4(s, V), append$4(s, N), append$4(N, k), append$4(k, G), append$4(s, Q), ie || (ge = [ + listen$1(E, "change", he), listen$1( E, "change", /*change_handler*/ - y[20] + y[21] ), - listen$1(A, "input", we), - listen$1(D, "change", ve), + listen$1(A, "change", ye), listen$1( - D, + A, "change", /*change_handler_1*/ y[23] ), - listen$1(n, "change", re), + listen$1(C, "change", re), listen$1( - n, + C, "change", /*change_handler_2*/ y[25] ), - listen$1(z, "change", Ge), + listen$1(r, "change", Se), listen$1( - z, + r, "change", /*change_handler_3*/ y[27] ), - listen$1(F, "change", ke), + listen$1(R, "change", ze), listen$1( - F, + R, "change", /*change_handler_4*/ y[29] ), - listen$1(j, "click", We) - ], pe = !0); + listen$1(F, "change", We), + listen$1( + F, + "change", + /*change_handler_5*/ + y[31] + ), + listen$1(k, "click", Ue) + ], ie = !0); }, - p(Te, je) { - if (y = Te, je[0] & /*proteinChains*/ + p(Be, Ne) { + if (y = Be, Ne[0] & /*proteinChains*/ 8) { - ue = ensure_array_like$1( + le = ensure_array_like$1( /*proteinChains*/ y[3] ); - let Fe; - for (Fe = 0; Fe < ue.length; Fe += 1) { - const X = get_each_context_3(y, ue, Fe); - se[Fe] ? se[Fe].p(X, je) : (se[Fe] = create_each_block_3(X), se[Fe].c(), se[Fe].m(E, null)); + let H; + for (H = 0; H < le.length; H += 1) { + const K = get_each_context_4(y, le, H); + oe[H] ? oe[H].p(K, Ne) : (oe[H] = create_each_block_4(K), oe[H].c(), oe[H].m(E, null)); } - for (; Fe < se.length; Fe += 1) - se[Fe].d(1); - se.length = ue.length; + for (; H < oe.length; H += 1) + oe[H].d(1); + oe.length = le.length; } - if (je[0] & /*covMods, proteinChains*/ + if (Ne[0] & /*covMods, proteinChains*/ 10 && select_option( E, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].protein - ), je[0] & /*covMods, proteinChains*/ - 10 && C !== (C = /*covMod*/ - y[33].residue) && A.value !== C && (A.value = C), Ie === (Ie = xe(y)) && oe ? oe.p(y, je) : (oe.d(1), oe = Ie(y), oe && (oe.c(), oe.m(D, null))), je[0] & /*covMods, proteinChains*/ + ), Ne[0] & /*getResidues, covMods*/ + 1026) { + se = ensure_array_like$1( + /*getResidues*/ + y[10]( + /*covMod*/ + y[35] + ) + ); + let H; + for (H = 0; H < se.length; H += 1) { + const K = get_each_context_3(y, se, H); + xe[H] ? xe[H].p(K, Ne) : (xe[H] = create_each_block_3(K), xe[H].c(), xe[H].m(A, null)); + } + for (; H < xe.length; H += 1) + xe[H].d(1); + xe.length = se.length; + } + if (Ne[0] & /*covMods, proteinChains*/ 10 && select_option( - D, + A, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] + ].residue + ), de === (de = Pe(y)) && pe ? pe.p(y, Ne) : (pe.d(1), pe = de(y), pe && (pe.c(), pe.m(C, null))), Ne[0] & /*covMods, proteinChains*/ + 10 && select_option( + C, + /*covMods*/ + y[1][ + /*i*/ + y[37] ].atom - ), je[0] & /*covMods, proteinChains*/ + ), Ne[0] & /*covMods, proteinChains*/ 10 && select_option( - n, + r, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].protein_symmetry - ), je[0] & /*ligandChains, covMods*/ + ), Ne[0] & /*ligandChains, covMods*/ 18) { - Se = ensure_array_like$1( + ke = ensure_array_like$1( /*ligandChains*/ y[4] ); - let Fe; - for (Fe = 0; Fe < Se.length; Fe += 1) { - const X = get_each_context_1$1(y, Se, Fe); - ze[Fe] ? ze[Fe].p(X, je) : (ze[Fe] = create_each_block_1$1(X), ze[Fe].c(), ze[Fe].m(z, null)); + let H; + for (H = 0; H < ke.length; H += 1) { + const K = get_each_context_1$1(y, ke, H); + $e[H] ? $e[H].p(K, Ne) : ($e[H] = create_each_block_1$1(K), $e[H].c(), $e[H].m(R, null)); } - for (; Fe < ze.length; Fe += 1) - ze[Fe].d(1); - ze.length = Se.length; + for (; H < $e.length; H += 1) + $e[H].d(1); + $e.length = ke.length; } - je[0] & /*covMods, proteinChains*/ + Ne[0] & /*covMods, proteinChains*/ 10 && select_option( - z, + R, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].ligand - ), Re === (Re = $e(y)) && Be ? Be.p(y, je) : (Be.d(1), Be = Re(y), Be && (Be.c(), Be.m(B, null))), je[0] & /*covMods, proteinChains*/ + ), Fe === (Fe = Re(y)) && Ie ? Ie.p(y, Ne) : (Ie.d(1), Ie = Fe(y), Ie && (Ie.c(), Ie.m(P, null))), Ne[0] & /*covMods, proteinChains*/ 10 && select_option( F, /*covMods*/ y[1][ /*i*/ - y[35] + y[37] ].ligand_symmetry ); }, - d(Te) { - Te && detach$6(s), destroy_each$1(se, Te), oe.d(), destroy_each$1(ze, Te), Be.d(), pe = !1, run_all$1(he); + d(Be) { + Be && detach$6(s), destroy_each$1(oe, Be), destroy_each$1(xe, Be), pe.d(), destroy_each$1($e, Be), Ie.d(), ie = !1, run_all$1(ge); } }; } function create_fragment$6(y) { - let s, e, l, g, _ = ensure_array_like$1( + let s, e, l, p, _ = ensure_array_like$1( /*vals*/ y[0] ), x = []; for (let E = 0; E < _.length; E += 1) - x[E] = create_each_block_4(get_each_context_4(y, _, E)); + x[E] = create_each_block_5(get_each_context_5(y, _, E)); const o = (E) => transition_out$4(x[E], 1, 1, () => { x[E] = null; }); - let p = ( + let g = ( /*covMods*/ y[1].length > 0 && create_if_block$4(y) ); @@ -26277,64 +26360,64 @@ function create_fragment$6(y) { s = element$5("div"); for (let E = 0; E < x.length; E += 1) x[E].c(); - e = space$4(), l = element$5("div"), p && p.c(), attr$5(l, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-fryf3t"), attr$5(s, "id", "accordion-collapse"), attr$5(s, "data-accordion", "collapse"), attr$5(s, "class", "svelte-fryf3t"); + e = space$4(), l = element$5("div"), g && g.c(), attr$5(l, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 w-full svelte-bt9x4p"), attr$5(s, "id", "accordion-collapse"), attr$5(s, "data-accordion", "collapse"), attr$5(s, "class", "svelte-bt9x4p"); }, m(E, u) { insert$6(E, s, u); for (let A = 0; A < x.length; A += 1) x[A] && x[A].m(s, null); - append$4(s, e), append$4(s, l), p && p.m(l, null), g = !0; + append$4(s, e), append$4(s, l), g && g.m(l, null), p = !0; }, p(E, u) { if (u[0] & /*vals, showCovModVals, updateMol, dispatch, metals, handleMessage, labels, colorCode*/ - 6629) { + 12773) { _ = ensure_array_like$1( /*vals*/ E[0] ); let A; for (A = 0; A < _.length; A += 1) { - const C = get_each_context_4(E, _, A); - x[A] ? (x[A].p(C, u), transition_in$4(x[A], 1)) : (x[A] = create_each_block_4(C), x[A].c(), transition_in$4(x[A], 1), x[A].m(s, e)); + const L = get_each_context_5(E, _, A); + x[A] ? (x[A].p(L, u), transition_in$4(x[A], 1)) : (x[A] = create_each_block_5(L), x[A].c(), transition_in$4(x[A], 1), x[A].m(s, e)); } for (group_outros$4(), A = _.length; A < x.length; A += 1) o(A); check_outros$4(); } /*covMods*/ - E[1].length > 0 ? p ? p.p(E, u) : (p = create_if_block$4(E), p.c(), p.m(l, null)) : p && (p.d(1), p = null); + E[1].length > 0 ? g ? g.p(E, u) : (g = create_if_block$4(E), g.c(), g.m(l, null)) : g && (g.d(1), g = null); }, i(E) { - if (!g) { + if (!p) { for (let u = 0; u < _.length; u += 1) transition_in$4(x[u]); - g = !0; + p = !0; } }, o(E) { x = x.filter(Boolean); for (let u = 0; u < x.length; u += 1) transition_out$4(x[u]); - g = !1; + p = !1; }, d(E) { - E && detach$6(s), destroy_each$1(x, E), p && p.d(); + E && detach$6(s), destroy_each$1(x, E), g && g.d(); } }; } function instance$6(y, s, e) { const l = createEventDispatcher$2(); - let { vals: g = [] } = s, { covMods: _ = [] } = s, x = [], o = { + let { vals: p = [] } = s, { covMods: _ = [] } = s, x = [], o = { DNA: "NA sequence", RNA: "NA sequence", protein: "Protein sequence", ligand: "Small molecule" - }, p = { + }, g = { DNA: "bg-green-200 text-blue-800", RNA: "bg-green-200 text-blue-800", protein: "bg-blue-200 text-blue-800", ligand: "bg-orange-200 text-blue-800" - }, E = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"], u = [], A = [], C = { + }, E = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"], u = [], A = [], L = { A: ["C", "CA", "CB", "N", "O"], R: ["C", "CA", "CB", "CG", "CD", "CZ", "N", "NE", "O", "NH1", "NH2"], D: ["C", "CA", "CB", "CG", "N", "O", "OD1", "OD2"], @@ -26370,7 +26453,7 @@ function instance$6(y, s, e) { ], Y: ["C", "CA", "CB", "CG", "CD1", "CD2", "CE1", "CE2", "CZ", "N", "O", "OH"], V: ["C", "CA", "CB", "CG1", "CG2", "N", "O"] - }, L = { + }, C = { H: "HIS", A: "ALA", R: "ARG", @@ -26394,84 +26477,90 @@ function instance$6(y, s, e) { V: "VAL" }; function D(G) { - let k = g.find((Q) => Q.chain === G.protein).sequence; - if (k.length < G.residue) + let Q = p.find((ge) => ge.chain === G.protein).sequence; + if (Q.length < G.residue) return alert("Residue number is too high"), []; - let j = k[G.residue - 1]; - return C[j]; + let ie = Q[G.residue - 1]; + return L[ie]; } function r(G) { - let j = g.find((Q) => Q.chain === G.protein).sequence[G.residue - 1]; - return L[j]; + let Q = p.find((ie) => ie.chain === G.protein).sequence; + return Array.from(Q).map((ie) => C[ie]); } function n(G) { - let k = G.detail.index; - e(1, _[k].mol = G.detail.mol, _), e(1, _[k].attachmentIndex = G.detail.attachmentIndex, _), e(1, _[k].deleteIndexes = G.detail.deleteIndexes, _), l("updateCovMod", _); + let ie = p.find((ge) => ge.chain === G.protein).sequence[G.residue - 1]; + return C[ie]; } function b(G) { - fetch(`https://files.rcsb.org/ligands/download/${G.detail.text}_ideal.sdf`).then((k) => { - if (!k.ok) + let Q = G.detail.index; + e(1, _[Q].mol = G.detail.mol, _), e(1, _[Q].attachmentIndex = G.detail.attachmentIndex, _), e(1, _[Q].deleteIndexes = G.detail.deleteIndexes, _), l("updateCovMod", _); + } + function f(G) { + fetch(`https://files.rcsb.org/ligands/download/${G.detail.text}_ideal.sdf`).then((Q) => { + if (!Q.ok) throw new Error("Network response was not ok"); - return k.text(); - }).then((k) => { + return Q.text(); + }).then((Q) => { l("updateVals", { - sdf: k, + sdf: Q, index: G.detail.index, close: !0 }); - }).catch((k) => { + }).catch((Q) => { alert("Error fetching sdf file"); }); } - const f = (G, k) => { + const c = (G, Q) => { l("removeVal", G); - }, c = (G, k, j) => e(0, k[j].open = !G.open, g), t = (G, k) => { - l("updateVals", { sequence: k.target.value, index: G }); - }, a = (G, k) => { - l("updateVals", { smiles: k.target.value, index: G }); - }, h = (G, k) => { - l("updateVals", { sdf: k.target.value, index: G }); - }, M = (G, k) => l("updateVals", { name: G, index: k }); - function w(G) { - _[G].protein = select_value(this), e(1, _), e(3, u), e(0, g); + }, t = (G, Q, ie) => e(0, Q[ie].open = !G.open, p), a = (G, Q) => { + l("updateVals", { sequence: Q.target.value, index: G }); + }, h = (G, Q) => { + l("updateVals", { smiles: Q.target.value, index: G }); + }, M = (G, Q) => { + l("updateVals", { sdf: Q.target.value, index: G }); + }, w = (G, Q) => l("updateVals", { name: G, index: Q }); + function S(G) { + _[G].protein = select_value(this), e(1, _), e(3, u), e(0, p); } - const S = () => l("updateCovMod", _), T = (G, k) => { - e(1, _[G].residue = k.target.value, _), l("updateCovMod", _); - }; + const T = () => l("updateCovMod", _); function R(G) { - _[G].atom = select_value(this), e(1, _), e(3, u), e(0, g); + _[G].residue = select_value(this), e(1, _), e(3, u), e(0, p); } - const z = () => l("updateCovMod", _); + const $ = () => l("updateCovMod", _); function P(G) { - _[G].protein_symmetry = select_value(this), e(1, _), e(3, u), e(0, g); + _[G].atom = select_value(this), e(1, _), e(3, u), e(0, p); } const B = () => l("updateCovMod", _); - function U(G) { - _[G].ligand = select_value(this), e(1, _), e(3, u), e(0, g); + function F(G) { + _[G].protein_symmetry = select_value(this), e(1, _), e(3, u), e(0, p); + } + const U = () => l("updateCovMod", _); + function z(G) { + _[G].ligand = select_value(this), e(1, _), e(3, u), e(0, p); } - const F = () => l("updateCovMod", _); - function $(G) { - _[G].ligand_symmetry = select_value(this), e(1, _), e(3, u), e(0, g); + const W = () => l("updateCovMod", _); + function V(G) { + _[G].ligand_symmetry = select_value(this), e(1, _), e(3, u), e(0, p); } - const W = () => l("updateCovMod", _), N = (G, k) => { + const N = () => l("updateCovMod", _), k = (G, Q) => { l("removeCovMod", G); }; return y.$$set = (G) => { - "vals" in G && e(0, g = G.vals), "covMods" in G && e(1, _ = G.covMods); + "vals" in G && e(0, p = G.vals), "covMods" in G && e(1, _ = G.covMods); }, y.$$.update = () => { y.$$.dirty[0] & /*covMods, vals*/ - 3 && _ && e(2, x = g.map((G) => _.findIndex((k) => k.ligand === G.chain))), y.$$.dirty[0] & /*vals*/ - 1 && e(3, u = g.filter((G) => G.class === "protein").map((G) => G.chain)), y.$$.dirty[0] & /*vals*/ - 1 && e(4, A = g.filter((G) => G.class === "ligand").map((G) => G.chain)); + 3 && _ && e(2, x = p.map((G) => _.findIndex((Q) => Q.ligand === G.chain))), y.$$.dirty[0] & /*vals*/ + 1 && e(3, u = p.filter((G) => G.class === "protein").map((G) => G.chain)), y.$$.dirty[0] & /*vals*/ + 1 && e(4, A = p.filter((G) => G.class === "ligand").map((G) => G.chain)); }, [ - g, + p, _, x, u, A, l, o, - p, + g, E, D, r, @@ -26487,14 +26576,16 @@ function instance$6(y, s, e) { S, T, R, - z, + $, P, B, - U, F, - $, + U, + z, W, - N + V, + N, + k ]; } class Accordion extends SvelteComponent$6 { @@ -26523,60 +26614,60 @@ const SequenceInput_svelte_svelte_type_style_lang = "", { transition_out: transition_out$3 } = window.__gradio__svelte__internal, { tick: tick$2 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1, onMount: onMount$3, afterUpdate: afterUpdate$1 } = window.__gradio__svelte__internal; function create_if_block$3(y) { - let s, e, l, g; + let s, e, l, p; const _ = [create_if_block_1$2, create_else_block$2], x = []; - function o(p, E) { + function o(g, E) { return ( /*vals*/ - p[0].length > 0 ? 0 : 1 + g[0].length > 0 ? 0 : 1 ); } return s = o(y), e = x[s] = _[s](y), { c() { e.c(), l = empty$2(); }, - m(p, E) { - x[s].m(p, E), insert$5(p, l, E), g = !0; + m(g, E) { + x[s].m(g, E), insert$5(g, l, E), p = !0; }, - p(p, E) { + p(g, E) { let u = s; - s = o(p), s === u ? x[s].p(p, E) : (group_outros$3(), transition_out$3(x[u], 1, 1, () => { + s = o(g), s === u ? x[s].p(g, E) : (group_outros$3(), transition_out$3(x[u], 1, 1, () => { x[u] = null; - }), check_outros$3(), e = x[s], e ? e.p(p, E) : (e = x[s] = _[s](p), e.c()), transition_in$3(e, 1), e.m(l.parentNode, l)); + }), check_outros$3(), e = x[s], e ? e.p(g, E) : (e = x[s] = _[s](g), e.c()), transition_in$3(e, 1), e.m(l.parentNode, l)); }, - i(p) { - g || (transition_in$3(e), g = !0); + i(g) { + p || (transition_in$3(e), p = !0); }, - o(p) { - transition_out$3(e), g = !1; + o(g) { + transition_out$3(e), p = !1; }, - d(p) { - p && detach$5(l), x[s].d(p); + d(g) { + g && detach$5(l), x[s].d(g); } }; } function create_else_block$2(y) { - let s, e, l, g, _, x, o, p; + let s, e, l, p, _, x, o, g; return _ = new SearchInput({ props: { database: "rcsb-bioass" } }), _.$on( "triggerFetch", /*handleMessage*/ y[2] ), { c() { - s = element$4("div"), s.textContent = "Empty input", e = space$3(), l = element$4("div"), l.textContent = "You can import a protein from the PDB", g = space$3(), create_component$3(_.$$.fragment), x = space$3(), o = element$4("div"), o.textContent = "- or create the input from scratch -", attr$4(s, "class", "my-8 text-center text-gray-600 svelte-13zuw1o"), attr$4(l, "class", "text-center text-gray-400 svelte-13zuw1o"), attr$4(o, "class", "text-center text-gray-400 w-full my-2 svelte-13zuw1o"); + s = element$4("div"), s.textContent = "Empty input", e = space$3(), l = element$4("div"), l.textContent = "You can import a protein from the PDB", p = space$3(), create_component$3(_.$$.fragment), x = space$3(), o = element$4("div"), o.textContent = "- or create the input from scratch -", attr$4(s, "class", "my-8 text-center text-gray-600 svelte-13zuw1o"), attr$4(l, "class", "text-center text-gray-400 svelte-13zuw1o"), attr$4(o, "class", "text-center text-gray-400 w-full my-2 svelte-13zuw1o"); }, m(E, u) { - insert$5(E, s, u), insert$5(E, e, u), insert$5(E, l, u), insert$5(E, g, u), mount_component$3(_, E, u), insert$5(E, x, u), insert$5(E, o, u), p = !0; + insert$5(E, s, u), insert$5(E, e, u), insert$5(E, l, u), insert$5(E, p, u), mount_component$3(_, E, u), insert$5(E, x, u), insert$5(E, o, u), g = !0; }, p: noop$5, i(E) { - p || (transition_in$3(_.$$.fragment, E), p = !0); + g || (transition_in$3(_.$$.fragment, E), g = !0); }, o(E) { - transition_out$3(_.$$.fragment, E), p = !1; + transition_out$3(_.$$.fragment, E), g = !1; }, d(E) { - E && (detach$5(s), detach$5(e), detach$5(l), detach$5(g), detach$5(x), detach$5(o)), destroy_component$3(_, E); + E && (detach$5(s), detach$5(e), detach$5(l), detach$5(p), detach$5(x), detach$5(o)), destroy_component$3(_, E); } }; } @@ -26613,14 +26704,14 @@ function create_if_block_1$2(y) { c() { create_component$3(s.$$.fragment); }, - m(l, g) { - mount_component$3(s, l, g), e = !0; + m(l, p) { + mount_component$3(s, l, p), e = !0; }, - p(l, g) { + p(l, p) { const _ = {}; - g & /*vals*/ + p & /*vals*/ 1 && (_.vals = /*vals*/ - l[0]), g & /*covMods*/ + l[0]), p & /*covMods*/ 2 && (_.covMods = /*covMods*/ l[1]), s.$set(_); }, @@ -26636,7 +26727,7 @@ function create_if_block_1$2(y) { }; } function create_fragment$5(y) { - let s, e, l, g = ( + let s, e, l, p = ( /*vals*/ y[0] != null && create_if_block$3(y) ); @@ -26653,16 +26744,16 @@ function create_fragment$5(y) { y[6] ), { c() { - g && g.c(), s = space$3(), create_component$3(e.$$.fragment); + p && p.c(), s = space$3(), create_component$3(e.$$.fragment); }, m(_, x) { - g && g.m(_, x), insert$5(_, s, x), mount_component$3(e, _, x), l = !0; + p && p.m(_, x), insert$5(_, s, x), mount_component$3(e, _, x), l = !0; }, p(_, [x]) { /*vals*/ - _[0] != null ? g ? (g.p(_, x), x & /*vals*/ - 1 && transition_in$3(g, 1)) : (g = create_if_block$3(_), g.c(), transition_in$3(g, 1), g.m(s.parentNode, s)) : g && (group_outros$3(), transition_out$3(g, 1, 1, () => { - g = null; + _[0] != null ? p ? (p.p(_, x), x & /*vals*/ + 1 && transition_in$3(p, 1)) : (p = create_if_block$3(_), p.c(), transition_in$3(p, 1), p.m(s.parentNode, s)) : p && (group_outros$3(), transition_out$3(p, 1, 1, () => { + p = null; }), check_outros$3()); const o = {}; x & /*vals*/ @@ -26670,13 +26761,13 @@ function create_fragment$5(y) { _[0]), e.$set(o); }, i(_) { - l || (transition_in$3(g), transition_in$3(e.$$.fragment, _), l = !0); + l || (transition_in$3(p), transition_in$3(e.$$.fragment, _), l = !0); }, o(_) { - transition_out$3(g), transition_out$3(e.$$.fragment, _), l = !1; + transition_out$3(p), transition_out$3(e.$$.fragment, _), l = !1; }, d(_) { - _ && detach$5(s), g && g.d(_), destroy_component$3(e, _); + _ && detach$5(s), p && p.d(_), destroy_component$3(e, _); } }; } @@ -26767,7 +26858,7 @@ function importBioAssembly(y) { } function instance$5(y, s, e) { let { value: l = { chains: [], covMods: [] } } = s; - const g = createEventDispatcher$1(); + const p = createEventDispatcher$1(); let _ = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"]; async function x(n) { let b = n.detail.text; @@ -26800,11 +26891,11 @@ function instance$5(y, s, e) { }); await tick$2(); } - })), e(0, o = c), g("updateVals", o); + })), e(0, o = c), p("updateVals", o); } - let o = [], p = []; + let o = [], g = []; function E(n) { - n.detail.sequence !== void 0 && e(0, o[n.detail.index].sequence = n.detail.sequence, o), n.detail.name !== void 0 && (e(0, o[n.detail.index].name = n.detail.name, o), e(0, o[n.detail.index].open = n.detail.open, o), e(0, o[n.detail.index].sdf = "", o), e(0, o[n.detail.index].smiles = "", o)), n.detail.smiles !== void 0 && (e(0, o[n.detail.index].smiles = n.detail.smiles, o), e(0, o[n.detail.index].sdf = "", o), e(0, o[n.detail.index].name = "", o)), n.detail.sdf !== void 0 && (n.detail.close == !0 && e(0, o[n.detail.index].open = !1, o), e(0, o[n.detail.index].sdf = n.detail.sdf, o), e(0, o[n.detail.index].name = "", o), e(0, o[n.detail.index].smiles = "", o)), g("updateVals", o); + n.detail.sequence !== void 0 && e(0, o[n.detail.index].sequence = n.detail.sequence, o), n.detail.name !== void 0 && (e(0, o[n.detail.index].name = n.detail.name, o), e(0, o[n.detail.index].open = n.detail.open, o), e(0, o[n.detail.index].sdf = "", o), e(0, o[n.detail.index].smiles = "", o)), n.detail.smiles !== void 0 && (e(0, o[n.detail.index].smiles = n.detail.smiles, o), e(0, o[n.detail.index].sdf = "", o), e(0, o[n.detail.index].name = "", o)), n.detail.sdf !== void 0 && (n.detail.close == !0 && e(0, o[n.detail.index].open = !1, o), e(0, o[n.detail.index].sdf = n.detail.sdf, o), e(0, o[n.detail.index].name = "", o), e(0, o[n.detail.index].smiles = "", o)), p("updateVals", o); } function u() { let n = "A"; @@ -26831,10 +26922,10 @@ function instance$5(y, s, e) { chain: b }), e(0, o); } - function C(n) { - o.splice(n.detail, 1), e(0, o), g("updateVals", o); - } function L(n) { + o.splice(n.detail, 1), e(0, o), p("updateVals", o); + } + function C(n) { let b = o.find((t) => t.class === "protein").chain; if (b === void 0) { alert("Please add a protein chain first"); @@ -26855,26 +26946,26 @@ function instance$5(y, s, e) { deleteIndexes: [], ligand_symmetry: "CW" }; - p.push(c), e(1, p), e(0, o), g("updateCovMod", p); + g.push(c), e(1, g), e(0, o), p("updateCovMod", g); } function D(n) { - p.splice(n.detail, 1), e(1, p); + g.splice(n.detail, 1), e(1, g); } function r(n) { - e(1, p = n.detail), g("updateCovMod", p); + e(1, g = n.detail), p("updateCovMod", g); } return onMount$3(async () => { - e(0, o = l.chains), e(1, p = l.covMods); + e(0, o = l.chains), e(1, g = l.covMods); }), y.$$set = (n) => { "value" in n && e(9, l = n.value); }, [ o, - p, + g, x, E, A, - C, L, + C, D, r, l @@ -26924,24 +27015,24 @@ function loop(y) { }; } function fade(y, { delay: s = 0, duration: e = 400, easing: l = identity } = {}) { - const g = +getComputedStyle(y).opacity; + const p = +getComputedStyle(y).opacity; return { delay: s, duration: e, easing: l, - css: (_) => `opacity: ${_ * g}` + css: (_) => `opacity: ${_ * p}` }; } const subscriber_queue = []; function writable(y, s = noop$4) { let e; const l = /* @__PURE__ */ new Set(); - function g(o) { + function p(o) { if (safe_not_equal$5(y, o) && (y = o, e)) { - const p = !subscriber_queue.length; + const g = !subscriber_queue.length; for (const E of l) E[1](), subscriber_queue.push(E, y); - if (p) { + if (g) { for (let E = 0; E < subscriber_queue.length; E += 2) subscriber_queue[E][0](subscriber_queue[E + 1]); subscriber_queue.length = 0; @@ -26949,47 +27040,47 @@ function writable(y, s = noop$4) { } } function _(o) { - g(o(y)); + p(o(y)); } - function x(o, p = noop$4) { - const E = [o, p]; - return l.add(E), l.size === 1 && (e = s(g, _) || noop$4), o(y), () => { + function x(o, g = noop$4) { + const E = [o, g]; + return l.add(E), l.size === 1 && (e = s(p, _) || noop$4), o(y), () => { l.delete(E), l.size === 0 && e && (e(), e = null); }; } - return { set: g, update: _, subscribe: x }; + return { set: p, update: _, subscribe: x }; } function is_date(y) { return Object.prototype.toString.call(y) === "[object Date]"; } function tick_spring(y, s, e, l) { if (typeof e == "number" || is_date(e)) { - const g = l - e, _ = (e - s) / (y.dt || 1 / 60), x = y.opts.stiffness * g, o = y.opts.damping * _, p = (x - o) * y.inv_mass, E = (_ + p) * y.dt; - return Math.abs(E) < y.opts.precision && Math.abs(g) < y.opts.precision ? l : (y.settled = !1, is_date(e) ? new Date(e.getTime() + E) : e + E); + const p = l - e, _ = (e - s) / (y.dt || 1 / 60), x = y.opts.stiffness * p, o = y.opts.damping * _, g = (x - o) * y.inv_mass, E = (_ + g) * y.dt; + return Math.abs(E) < y.opts.precision && Math.abs(p) < y.opts.precision ? l : (y.settled = !1, is_date(e) ? new Date(e.getTime() + E) : e + E); } else { if (Array.isArray(e)) return e.map( - (g, _) => tick_spring(y, s[_], e[_], l[_]) + (p, _) => tick_spring(y, s[_], e[_], l[_]) ); if (typeof e == "object") { - const g = {}; + const p = {}; for (const _ in e) - g[_] = tick_spring(y, s[_], e[_], l[_]); - return g; + p[_] = tick_spring(y, s[_], e[_], l[_]); + return p; } else throw new Error(`Cannot spring ${typeof e} values`); } } function spring(y, s = {}) { - const e = writable(y), { stiffness: l = 0.15, damping: g = 0.8, precision: _ = 0.01 } = s; - let x, o, p, E = y, u = y, A = 1, C = 0, L = !1; + const e = writable(y), { stiffness: l = 0.15, damping: p = 0.8, precision: _ = 0.01 } = s; + let x, o, g, E = y, u = y, A = 1, L = 0, C = !1; function D(n, b = {}) { u = n; - const f = p = {}; - return y == null || b.hard || r.stiffness >= 1 && r.damping >= 1 ? (L = !0, x = now(), E = n, e.set(y = u), Promise.resolve()) : (b.soft && (C = 1 / ((b.soft === !0 ? 0.5 : +b.soft) * 60), A = 0), o || (x = now(), L = !1, o = loop((c) => { - if (L) - return L = !1, o = null, !1; - A = Math.min(A + C, 1); + const f = g = {}; + return y == null || b.hard || r.stiffness >= 1 && r.damping >= 1 ? (C = !0, x = now(), E = n, e.set(y = u), Promise.resolve()) : (b.soft && (L = 1 / ((b.soft === !0 ? 0.5 : +b.soft) * 60), A = 0), o || (x = now(), C = !1, o = loop((c) => { + if (C) + return C = !1, o = null, !1; + A = Math.min(A + L, 1); const t = { inv_mass: A, opts: r, @@ -26999,7 +27090,7 @@ function spring(y, s = {}) { return x = c, E = y, e.set(y = a), t.settled && (o = null), !t.settled; })), new Promise((c) => { o.promise.then(() => { - f === p && c(); + f === g && c(); }); })); } @@ -27008,7 +27099,7 @@ function spring(y, s = {}) { update: (n, b) => D(n(u, y), b), subscribe: e.subscribe, stiffness: l, - damping: g, + damping: p, precision: _ }; return r; @@ -27029,12 +27120,12 @@ const Loader_svelte_svelte_type_style_lang = "", { toggle_class: toggle_class$3 } = window.__gradio__svelte__internal, { onMount: onMount$2 } = window.__gradio__svelte__internal; function create_fragment$4(y) { - let s, e, l, g, _, x, o, p, E, u, A, C; + let s, e, l, p, _, x, o, g, E, u, A, L; return { c() { - s = element$3("div"), e = svg_element("svg"), l = svg_element("g"), g = svg_element("path"), _ = svg_element("path"), x = svg_element("path"), o = svg_element("path"), p = svg_element("g"), E = svg_element("path"), u = svg_element("path"), A = svg_element("path"), C = svg_element("path"), attr$3(g, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(g, "fill", "#FF7C00"), attr$3(g, "fill-opacity", "0.4"), attr$3(g, "class", "svelte-43sxxs"), attr$3(_, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(_, "fill", "#FF7C00"), attr$3(_, "class", "svelte-43sxxs"), attr$3(x, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(x, "fill", "#FF7C00"), attr$3(x, "fill-opacity", "0.4"), attr$3(x, "class", "svelte-43sxxs"), attr$3(o, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(o, "fill", "#FF7C00"), attr$3(o, "class", "svelte-43sxxs"), set_style$1(l, "transform", "translate(" + /*$top*/ + s = element$3("div"), e = svg_element("svg"), l = svg_element("g"), p = svg_element("path"), _ = svg_element("path"), x = svg_element("path"), o = svg_element("path"), g = svg_element("g"), E = svg_element("path"), u = svg_element("path"), A = svg_element("path"), L = svg_element("path"), attr$3(p, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(p, "fill", "#FF7C00"), attr$3(p, "fill-opacity", "0.4"), attr$3(p, "class", "svelte-43sxxs"), attr$3(_, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(_, "fill", "#FF7C00"), attr$3(_, "class", "svelte-43sxxs"), attr$3(x, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(x, "fill", "#FF7C00"), attr$3(x, "fill-opacity", "0.4"), attr$3(x, "class", "svelte-43sxxs"), attr$3(o, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(o, "fill", "#FF7C00"), attr$3(o, "class", "svelte-43sxxs"), set_style$1(l, "transform", "translate(" + /*$top*/ y[1][0] + "px, " + /*$top*/ - y[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(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(u, "fill", "#FF7C00"), attr$3(u, "class", "svelte-43sxxs"), attr$3(A, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(A, "fill", "#FF7C00"), attr$3(A, "fill-opacity", "0.4"), attr$3(A, "class", "svelte-43sxxs"), attr$3(C, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(C, "fill", "#FF7C00"), attr$3(C, "class", "svelte-43sxxs"), set_style$1(p, "transform", "translate(" + /*$bottom*/ + y[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(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(u, "fill", "#FF7C00"), attr$3(u, "class", "svelte-43sxxs"), attr$3(A, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(A, "fill", "#FF7C00"), attr$3(A, "fill-opacity", "0.4"), attr$3(A, "class", "svelte-43sxxs"), attr$3(L, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(L, "fill", "#FF7C00"), attr$3(L, "class", "svelte-43sxxs"), set_style$1(g, "transform", "translate(" + /*$bottom*/ y[2][0] + "px, " + /*$bottom*/ y[2][1] + "px)"), attr$3(e, "viewBox", "-1200 -1200 3000 3000"), attr$3(e, "fill", "none"), attr$3(e, "xmlns", "http://www.w3.org/2000/svg"), attr$3(e, "class", "svelte-43sxxs"), attr$3(s, "class", "svelte-43sxxs"), toggle_class$3( s, @@ -27043,50 +27134,50 @@ function create_fragment$4(y) { y[0] ); }, - m(L, D) { - insert$4(L, s, D), append$3(s, e), append$3(e, l), append$3(l, g), append$3(l, _), append$3(l, x), append$3(l, o), append$3(e, p), append$3(p, E), append$3(p, u), append$3(p, A), append$3(p, C); + m(C, D) { + insert$4(C, s, D), append$3(s, e), append$3(e, l), append$3(l, p), append$3(l, _), append$3(l, x), append$3(l, o), append$3(e, g), append$3(g, E), append$3(g, u), append$3(g, A), append$3(g, L); }, - p(L, [D]) { + p(C, [D]) { D & /*$top*/ 2 && set_style$1(l, "transform", "translate(" + /*$top*/ - L[1][0] + "px, " + /*$top*/ - L[1][1] + "px)"), D & /*$bottom*/ - 4 && set_style$1(p, "transform", "translate(" + /*$bottom*/ - L[2][0] + "px, " + /*$bottom*/ - L[2][1] + "px)"), D & /*margin*/ + C[1][0] + "px, " + /*$top*/ + C[1][1] + "px)"), D & /*$bottom*/ + 4 && set_style$1(g, "transform", "translate(" + /*$bottom*/ + C[2][0] + "px, " + /*$bottom*/ + C[2][1] + "px)"), D & /*margin*/ 1 && toggle_class$3( s, "margin", /*margin*/ - L[0] + C[0] ); }, i: noop$3, o: noop$3, - d(L) { - L && detach$4(s); + d(C) { + C && detach$4(s); } }; } function instance$4(y, s, e) { - let l, g, { margin: _ = !0 } = s; + let l, p, { margin: _ = !0 } = s; const x = spring([0, 0]); - component_subscribe(y, x, (C) => e(1, l = C)); + component_subscribe(y, x, (L) => e(1, l = L)); const o = spring([0, 0]); - component_subscribe(y, o, (C) => e(2, g = C)); - let p; + component_subscribe(y, o, (L) => e(2, p = L)); + let g; async function E() { await Promise.all([x.set([125, 140]), o.set([-125, -140])]), await Promise.all([x.set([-125, 140]), o.set([125, -140])]), await Promise.all([x.set([-125, 0]), o.set([125, -0])]), await Promise.all([x.set([125, 0]), o.set([-125, 0])]); } async function u() { - await E(), p || u(); + await E(), g || u(); } async function A() { await Promise.all([x.set([125, 0]), o.set([-125, 0])]), u(); } - return onMount$2(() => (A(), () => p = !0)), y.$$set = (C) => { - "margin" in C && e(0, _ = C.margin); - }, [_, l, g, x, o]; + return onMount$2(() => (A(), () => g = !0)), y.$$set = (L) => { + "margin" in L && e(0, _ = L.margin); + }, [_, l, p, x, o]; } class Loader extends SvelteComponent$4 { constructor(s) { @@ -27136,7 +27227,7 @@ function create_if_block_17(y) { let s, e = ( /*i18n*/ y[1]("common.error") + "" - ), l, g, _; + ), l, p, _; const x = ( /*#slots*/ y[29].error @@ -27149,47 +27240,47 @@ function create_if_block_17(y) { ); return { c() { - s = element$2("span"), l = text$3(e), g = space$2(), o && o.c(), attr$2(s, "class", "error svelte-1yserjw"); + s = element$2("span"), l = text$3(e), p = space$2(), o && o.c(), attr$2(s, "class", "error svelte-1yserjw"); }, - m(p, E) { - insert$3(p, s, E), append$2(s, l), insert$3(p, g, E), o && o.m(p, E), _ = !0; + m(g, E) { + insert$3(g, s, E), append$2(s, l), insert$3(g, p, E), o && o.m(g, E), _ = !0; }, - p(p, E) { + p(g, E) { (!_ || E[0] & /*i18n*/ 2) && e !== (e = /*i18n*/ - p[1]("common.error") + "") && set_data$3(l, e), o && o.p && (!_ || E[0] & /*$$scope*/ + g[1]("common.error") + "") && set_data$3(l, e), o && o.p && (!_ || E[0] & /*$$scope*/ 268435456) && update_slot_base( o, x, - p, + g, /*$$scope*/ - p[28], + g[28], _ ? get_slot_changes( x, /*$$scope*/ - p[28], + g[28], E, get_error_slot_changes ) : get_all_dirty_from_scope( /*$$scope*/ - p[28] + g[28] ), get_error_slot_context ); }, - i(p) { - _ || (transition_in$2(o, p), _ = !0); + i(g) { + _ || (transition_in$2(o, g), _ = !0); }, - o(p) { - transition_out$2(o, p), _ = !1; + o(g) { + transition_out$2(o, g), _ = !1; }, - d(p) { - p && (detach$3(s), detach$3(g)), o && o.d(p); + d(g) { + g && (detach$3(s), detach$3(p)), o && o.d(g); } }; } function create_if_block$2(y) { - let s, e, l, g, _, x, o, p, E, u = ( + let s, e, l, p, _, x, o, g, E, u = ( /*variant*/ y[8] === "default" && /*show_eta_bar*/ y[18] && /*show_progress*/ @@ -27214,7 +27305,7 @@ function create_if_block$2(y) { ) return create_if_block_15; } - let C = A(y), L = C && C(y), D = ( + let L = A(y), C = L && L(y), D = ( /*timer*/ y[5] && create_if_block_10(y) ); @@ -27233,7 +27324,7 @@ function create_if_block$2(y) { y[5] && create_if_block_1$1(y); return { c() { - u && u.c(), s = space$2(), e = element$2("div"), L && L.c(), l = space$2(), D && D.c(), g = space$2(), x && x.c(), o = space$2(), f && f.c(), p = empty$1(), attr$2(e, "class", "progress-text svelte-1yserjw"), toggle_class$2( + u && u.c(), s = space$2(), e = element$2("div"), C && C.c(), l = space$2(), D && D.c(), p = space$2(), x && x.c(), o = space$2(), f && f.c(), g = empty$1(), attr$2(e, "class", "progress-text svelte-1yserjw"), toggle_class$2( e, "meta-text-center", /*variant*/ @@ -27246,13 +27337,13 @@ function create_if_block$2(y) { ); }, m(c, t) { - u && u.m(c, t), insert$3(c, s, t), insert$3(c, e, t), L && L.m(e, null), append$2(e, l), D && D.m(e, null), insert$3(c, g, t), ~_ && n[_].m(c, t), insert$3(c, o, t), f && f.m(c, t), insert$3(c, p, t), E = !0; + u && u.m(c, t), insert$3(c, s, t), insert$3(c, e, t), C && C.m(e, null), append$2(e, l), D && D.m(e, null), insert$3(c, p, t), ~_ && n[_].m(c, t), insert$3(c, o, t), f && f.m(c, t), insert$3(c, g, t), E = !0; }, p(c, t) { /*variant*/ c[8] === "default" && /*show_eta_bar*/ c[18] && /*show_progress*/ - c[6] === "full" ? u ? u.p(c, t) : (u = create_if_block_16(c), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null), C === (C = A(c)) && L ? L.p(c, t) : (L && L.d(1), L = C && C(c), L && (L.c(), L.m(e, l))), /*timer*/ + c[6] === "full" ? u ? u.p(c, t) : (u = create_if_block_16(c), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null), L === (L = A(c)) && C ? C.p(c, t) : (C && C.d(1), C = L && L(c), C && (C.c(), C.m(e, l))), /*timer*/ c[5] ? D ? D.p(c, t) : (D = create_if_block_10(c), D.c(), D.m(e, null)) : D && (D.d(1), D = null), (!E || t[0] & /*variant*/ 256) && toggle_class$2( e, @@ -27270,7 +27361,7 @@ function create_if_block$2(y) { _ = b(c), _ === a ? ~_ && n[_].p(c, t) : (x && (group_outros$2(), transition_out$2(n[a], 1, 1, () => { n[a] = null; }), check_outros$2()), ~_ ? (x = n[_], x ? x.p(c, t) : (x = n[_] = r[_](c), x.c()), transition_in$2(x, 1), x.m(o.parentNode, o)) : x = null), /*timer*/ - c[5] ? f && (f.d(1), f = null) : f ? f.p(c, t) : (f = create_if_block_1$1(c), f.c(), f.m(p.parentNode, p)); + c[5] ? f && (f.d(1), f = null) : f ? f.p(c, t) : (f = create_if_block_1$1(c), f.c(), f.m(g.parentNode, g)); }, i(c) { E || (transition_in$2(x), E = !0); @@ -27279,7 +27370,7 @@ function create_if_block$2(y) { transition_out$2(x), E = !1; }, d(c) { - c && (detach$3(s), detach$3(e), detach$3(g), detach$3(o), detach$3(p)), u && u.d(c), L && L.d(), D && D.d(), ~_ && n[_].d(c), f && f.d(c); + c && (detach$3(s), detach$3(e), detach$3(p), detach$3(o), detach$3(g)), u && u.d(c), C && C.d(), D && D.d(), ~_ && n[_].d(c), f && f.d(c); } }; } @@ -27290,11 +27381,11 @@ function create_if_block_16(y) { c() { s = element$2("div"), attr$2(s, "class", "eta-bar svelte-1yserjw"), set_style(s, "transform", e); }, - m(l, g) { - insert$3(l, s, g); + m(l, p) { + insert$3(l, s, p); }, - p(l, g) { - g[0] & /*eta_level*/ + p(l, p) { + p[0] & /*eta_level*/ 131072 && e !== (e = `translateX(${/*eta_level*/ (l[17] || 0) * 100 - 100}%)`) && set_style(s, "transform", e); }, @@ -27322,21 +27413,21 @@ function create_if_block_14(y) { let s, e = ( /*queue_position*/ y[2] + 1 + "" - ), l, g, _, x; + ), l, p, _, x; return { c() { - s = text$3("queue: "), l = text$3(e), g = text$3("/"), _ = text$3( + s = text$3("queue: "), l = text$3(e), p = text$3("/"), _ = text$3( /*queue_size*/ y[3] ), x = text$3(" |"); }, - m(o, p) { - insert$3(o, s, p), insert$3(o, l, p), insert$3(o, g, p), insert$3(o, _, p), insert$3(o, x, p); + m(o, g) { + insert$3(o, s, g), insert$3(o, l, g), insert$3(o, p, g), insert$3(o, _, g), insert$3(o, x, g); }, - p(o, p) { - p[0] & /*queue_position*/ + p(o, g) { + g[0] & /*queue_position*/ 4 && e !== (e = /*queue_position*/ - o[2] + 1 + "") && set_data$3(l, e), p[0] & /*queue_size*/ + o[2] + 1 + "") && set_data$3(l, e), g[0] & /*queue_size*/ 8 && set_data$3( _, /*queue_size*/ @@ -27344,7 +27435,7 @@ function create_if_block_14(y) { ); }, d(o) { - o && (detach$3(s), detach$3(l), detach$3(g), detach$3(_), detach$3(x)); + o && (detach$3(s), detach$3(l), detach$3(p), detach$3(_), detach$3(x)); } }; } @@ -27353,29 +27444,29 @@ function create_if_block_11(y) { /*progress*/ y[7] ), l = []; - for (let g = 0; g < e.length; g += 1) - l[g] = create_each_block_1(get_each_context_1(y, e, g)); + for (let p = 0; p < e.length; p += 1) + l[p] = create_each_block_1(get_each_context_1(y, e, p)); return { c() { - for (let g = 0; g < l.length; g += 1) - l[g].c(); + for (let p = 0; p < l.length; p += 1) + l[p].c(); s = empty$1(); }, - m(g, _) { + m(p, _) { for (let x = 0; x < l.length; x += 1) - l[x] && l[x].m(g, _); - insert$3(g, s, _); + l[x] && l[x].m(p, _); + insert$3(p, s, _); }, - p(g, _) { + p(p, _) { if (_[0] & /*progress*/ 128) { e = ensure_array_like( /*progress*/ - g[7] + p[7] ); let x; for (x = 0; x < e.length; x += 1) { - const o = get_each_context_1(g, e, x); + const o = get_each_context_1(p, e, x); l[x] ? l[x].p(o, _) : (l[x] = create_each_block_1(o), l[x].c(), l[x].m(s.parentNode, s)); } for (; x < l.length; x += 1) @@ -27383,8 +27474,8 @@ function create_if_block_11(y) { l.length = e.length; } }, - d(g) { - g && detach$3(s), destroy_each(l, g); + d(p) { + p && detach$3(s), destroy_each(l, p); } }; } @@ -27392,28 +27483,28 @@ function create_if_block_12(y) { let s, e = ( /*p*/ y[38].unit + "" - ), l, g, _ = " ", x; + ), l, p, _ = " ", x; function o(u, A) { return ( /*p*/ u[38].length != null ? create_if_block_13 : create_else_block$1 ); } - let p = o(y), E = p(y); + let g = o(y), E = g(y); return { c() { - E.c(), s = space$2(), l = text$3(e), g = text$3(" | "), x = text$3(_); + E.c(), s = space$2(), l = text$3(e), p = text$3(" | "), x = text$3(_); }, m(u, A) { - E.m(u, A), insert$3(u, s, A), insert$3(u, l, A), insert$3(u, g, A), insert$3(u, x, A); + E.m(u, A), insert$3(u, s, A), insert$3(u, l, A), insert$3(u, p, A), insert$3(u, x, A); }, p(u, A) { - p === (p = o(u)) && E ? E.p(u, A) : (E.d(1), E = p(u), E && (E.c(), E.m(s.parentNode, s))), A[0] & /*progress*/ + g === (g = o(u)) && E ? E.p(u, A) : (E.d(1), E = g(u), E && (E.c(), E.m(s.parentNode, s))), A[0] & /*progress*/ 128 && e !== (e = /*p*/ u[38].unit + "") && set_data$3(l, e); }, d(u) { - u && (detach$3(s), detach$3(l), detach$3(g), detach$3(x)), E.d(u); + u && (detach$3(s), detach$3(l), detach$3(p), detach$3(x)), E.d(u); } }; } @@ -27426,11 +27517,11 @@ function create_else_block$1(y) { c() { e = text$3(s); }, - m(l, g) { - insert$3(l, e, g); + m(l, p) { + insert$3(l, e, p); }, - p(l, g) { - g[0] & /*progress*/ + p(l, p) { + p[0] & /*progress*/ 128 && s !== (s = pretty_si( /*p*/ l[38].index || 0 @@ -27445,13 +27536,13 @@ function create_if_block_13(y) { let s = pretty_si( /*p*/ y[38].index || 0 - ) + "", e, l, g = pretty_si( + ) + "", e, l, p = pretty_si( /*p*/ y[38].length ) + "", _; return { c() { - e = text$3(s), l = text$3("/"), _ = text$3(g); + e = text$3(s), l = text$3("/"), _ = text$3(p); }, m(x, o) { insert$3(x, e, o), insert$3(x, l, o), insert$3(x, _, o); @@ -27462,10 +27553,10 @@ function create_if_block_13(y) { /*p*/ x[38].index || 0 ) + "") && set_data$3(e, s), o[0] & /*progress*/ - 128 && g !== (g = pretty_si( + 128 && p !== (p = pretty_si( /*p*/ x[38].length - ) + "") && set_data$3(_, g); + ) + "") && set_data$3(_, p); }, d(x) { x && (detach$3(e), detach$3(l), detach$3(_)); @@ -27481,12 +27572,12 @@ function create_each_block_1(y) { c() { e && e.c(), s = empty$1(); }, - m(l, g) { - e && e.m(l, g), insert$3(l, s, g); + m(l, p) { + e && e.m(l, p), insert$3(l, s, p); }, - p(l, g) { + p(l, p) { /*p*/ - l[38].index != null ? e ? e.p(l, g) : (e = create_if_block_12(l), e.c(), e.m(s.parentNode, s)) : e && (e.d(1), e = null); + l[38].index != null ? e ? e.p(l, p) : (e = create_if_block_12(l), e.c(), e.m(s.parentNode, s)) : e && (e.d(1), e = null); }, d(l) { l && detach$3(s), e && e.d(l); @@ -27498,16 +27589,16 @@ function create_if_block_10(y) { /*eta*/ y[0] ? `/${/*formatted_eta*/ y[19]}` : "" - ), l, g; + ), l, p; return { c() { s = text$3( /*formatted_timer*/ y[20] - ), l = text$3(e), g = text$3("s"); + ), l = text$3(e), p = text$3("s"); }, m(_, x) { - insert$3(_, s, x), insert$3(_, l, x), insert$3(_, g, x); + insert$3(_, s, x), insert$3(_, l, x), insert$3(_, p, x); }, p(_, x) { x[0] & /*formatted_timer*/ @@ -27521,7 +27612,7 @@ function create_if_block_10(y) { _[19]}` : "") && set_data$3(l, e); }, d(_) { - _ && (detach$3(s), detach$3(l), detach$3(g)); + _ && (detach$3(s), detach$3(l), detach$3(p)); } }; } @@ -27536,12 +27627,12 @@ function create_if_block_9(y) { c() { create_component$2(s.$$.fragment); }, - m(l, g) { - mount_component$2(s, l, g), e = !0; + m(l, p) { + mount_component$2(s, l, p), e = !0; }, - p(l, g) { + p(l, p) { const _ = {}; - g[0] & /*variant*/ + p[0] & /*variant*/ 256 && (_.margin = /*variant*/ l[8] === "default"), s.$set(_); }, @@ -27557,28 +27648,28 @@ function create_if_block_9(y) { }; } function create_if_block_2$1(y) { - let s, e, l, g, _, x = `${/*last_progress_level*/ + let s, e, l, p, _, x = `${/*last_progress_level*/ y[15] * 100}%`, o = ( /*progress*/ y[7] != null && create_if_block_3$1(y) ); return { c() { - s = element$2("div"), e = element$2("div"), o && o.c(), l = space$2(), g = element$2("div"), _ = element$2("div"), attr$2(e, "class", "progress-level-inner svelte-1yserjw"), attr$2(_, "class", "progress-bar svelte-1yserjw"), set_style(_, "width", x), attr$2(g, "class", "progress-bar-wrap svelte-1yserjw"), attr$2(s, "class", "progress-level svelte-1yserjw"); + s = element$2("div"), e = element$2("div"), o && o.c(), l = space$2(), p = element$2("div"), _ = element$2("div"), attr$2(e, "class", "progress-level-inner svelte-1yserjw"), attr$2(_, "class", "progress-bar svelte-1yserjw"), set_style(_, "width", x), attr$2(p, "class", "progress-bar-wrap svelte-1yserjw"), attr$2(s, "class", "progress-level svelte-1yserjw"); }, - m(p, E) { - insert$3(p, s, E), append$2(s, e), o && o.m(e, null), append$2(s, l), append$2(s, g), append$2(g, _), y[30](_); + m(g, E) { + insert$3(g, s, E), append$2(s, e), o && o.m(e, null), append$2(s, l), append$2(s, p), append$2(p, _), y[30](_); }, - p(p, E) { + p(g, E) { /*progress*/ - p[7] != null ? o ? o.p(p, E) : (o = create_if_block_3$1(p), o.c(), o.m(e, null)) : o && (o.d(1), o = null), E[0] & /*last_progress_level*/ + g[7] != null ? o ? o.p(g, E) : (o = create_if_block_3$1(g), o.c(), o.m(e, null)) : o && (o.d(1), o = null), E[0] & /*last_progress_level*/ 32768 && x !== (x = `${/*last_progress_level*/ - p[15] * 100}%`) && set_style(_, "width", x); + g[15] * 100}%`) && set_style(_, "width", x); }, i: noop$2, o: noop$2, - d(p) { - p && detach$3(s), o && o.d(), y[30](null); + d(g) { + g && detach$3(s), o && o.d(), y[30](null); } }; } @@ -27587,29 +27678,29 @@ function create_if_block_3$1(y) { /*progress*/ y[7] ), l = []; - for (let g = 0; g < e.length; g += 1) - l[g] = create_each_block(get_each_context(y, e, g)); + for (let p = 0; p < e.length; p += 1) + l[p] = create_each_block(get_each_context(y, e, p)); return { c() { - for (let g = 0; g < l.length; g += 1) - l[g].c(); + for (let p = 0; p < l.length; p += 1) + l[p].c(); s = empty$1(); }, - m(g, _) { + m(p, _) { for (let x = 0; x < l.length; x += 1) - l[x] && l[x].m(g, _); - insert$3(g, s, _); + l[x] && l[x].m(p, _); + insert$3(p, s, _); }, - p(g, _) { + p(p, _) { if (_[0] & /*progress_level, progress*/ 16512) { e = ensure_array_like( /*progress*/ - g[7] + p[7] ); let x; for (x = 0; x < e.length; x += 1) { - const o = get_each_context(g, e, x); + const o = get_each_context(p, e, x); l[x] ? l[x].p(o, _) : (l[x] = create_each_block(o), l[x].c(), l[x].m(s.parentNode, s)); } for (; x < l.length; x += 1) @@ -27617,13 +27708,13 @@ function create_if_block_3$1(y) { l.length = e.length; } }, - d(g) { - g && detach$3(s), destroy_each(l, g); + d(p) { + p && detach$3(s), destroy_each(l, p); } }; } function create_if_block_4$1(y) { - let s, e, l, g, _ = ( + let s, e, l, p, _ = ( /*i*/ y[40] !== 0 && create_if_block_8() ), x = ( @@ -27637,16 +27728,16 @@ function create_if_block_4$1(y) { /*i*/ y[40] ] != null && create_if_block_6() - ), p = ( + ), g = ( /*progress_level*/ y[14] != null && create_if_block_5$1(y) ); return { c() { - _ && _.c(), s = space$2(), x && x.c(), e = space$2(), o && o.c(), l = space$2(), p && p.c(), g = empty$1(); + _ && _.c(), s = space$2(), x && x.c(), e = space$2(), o && o.c(), l = space$2(), g && g.c(), p = empty$1(); }, m(E, u) { - _ && _.m(E, u), insert$3(E, s, u), x && x.m(E, u), insert$3(E, e, u), o && o.m(E, u), insert$3(E, l, u), p && p.m(E, u), insert$3(E, g, u); + _ && _.m(E, u), insert$3(E, s, u), x && x.m(E, u), insert$3(E, e, u), o && o.m(E, u), insert$3(E, l, u), g && g.m(E, u), insert$3(E, p, u); }, p(E, u) { /*p*/ @@ -27657,10 +27748,10 @@ function create_if_block_4$1(y) { /*i*/ E[40] ] != null ? o || (o = create_if_block_6(), o.c(), o.m(l.parentNode, l)) : o && (o.d(1), o = null), /*progress_level*/ - E[14] != null ? p ? p.p(E, u) : (p = create_if_block_5$1(E), p.c(), p.m(g.parentNode, g)) : p && (p.d(1), p = null); + E[14] != null ? g ? g.p(E, u) : (g = create_if_block_5$1(E), g.c(), g.m(p.parentNode, p)) : g && (g.d(1), g = null); }, d(E) { - E && (detach$3(s), detach$3(e), detach$3(l), detach$3(g)), _ && _.d(E), x && x.d(E), o && o.d(E), p && p.d(E); + E && (detach$3(s), detach$3(e), detach$3(l), detach$3(p)), _ && _.d(E), x && x.d(E), o && o.d(E), g && g.d(E); } }; } @@ -27687,11 +27778,11 @@ function create_if_block_7(y) { c() { e = text$3(s); }, - m(l, g) { - insert$3(l, e, g); + m(l, p) { + insert$3(l, e, p); }, - p(l, g) { - g[0] & /*progress*/ + p(l, p) { + p[0] & /*progress*/ 128 && s !== (s = /*p*/ l[38].desc + "") && set_data$3(e, s); }, @@ -27724,19 +27815,19 @@ function create_if_block_5$1(y) { c() { e = text$3(s), l = text$3("%"); }, - m(g, _) { - insert$3(g, e, _), insert$3(g, l, _); + m(p, _) { + insert$3(p, e, _), insert$3(p, l, _); }, - p(g, _) { + p(p, _) { _[0] & /*progress_level*/ 16384 && s !== (s = (100 * /*progress_level*/ - (g[14][ + (p[14][ /*i*/ - g[40] + p[40] ] || 0)).toFixed(1) + "") && set_data$3(e, s); }, - d(g) { - g && (detach$3(e), detach$3(l)); + d(p) { + p && (detach$3(e), detach$3(l)); } }; } @@ -27754,17 +27845,17 @@ function create_each_block(y) { c() { e && e.c(), s = empty$1(); }, - m(l, g) { - e && e.m(l, g), insert$3(l, s, g); + m(l, p) { + e && e.m(l, p), insert$3(l, s, p); }, - p(l, g) { + p(l, p) { /*p*/ l[38].desc != null || /*progress_level*/ l[14] && /*progress_level*/ l[14][ /*i*/ l[40] - ] != null ? e ? e.p(l, g) : (e = create_if_block_4$1(l), e.c(), e.m(s.parentNode, s)) : e && (e.d(1), e = null); + ] != null ? e ? e.p(l, p) : (e = create_if_block_4$1(l), e.c(), e.m(s.parentNode, s)) : e && (e.d(1), e = null); }, d(l) { l && detach$3(s), e && e.d(l); @@ -27780,11 +27871,11 @@ function create_if_block_1$1(y) { y[9] ), attr$2(s, "class", "loading svelte-1yserjw"); }, - m(l, g) { - insert$3(l, s, g), append$2(s, e); + m(l, p) { + insert$3(l, s, p), append$2(s, e); }, - p(l, g) { - g[0] & /*loading_text*/ + p(l, p) { + p[0] & /*loading_text*/ 512 && set_data$3( e, /*loading_text*/ @@ -27797,9 +27888,9 @@ function create_if_block_1$1(y) { }; } function create_fragment$3(y) { - let s, e, l, g, _; + let s, e, l, p, _; const x = [create_if_block$2, create_if_block_17], o = []; - function p(E, u) { + function g(E, u) { return ( /*status*/ E[4] === "pending" ? 0 : ( @@ -27808,9 +27899,9 @@ function create_fragment$3(y) { ) ); } - return ~(e = p(y)) && (l = o[e] = x[e](y)), { + return ~(e = g(y)) && (l = o[e] = x[e](y)), { c() { - s = element$2("div"), l && l.c(), attr$2(s, "class", g = "wrap " + /*variant*/ + s = element$2("div"), l && l.c(), attr$2(s, "class", p = "wrap " + /*variant*/ y[8] + " " + /*show_progress*/ y[6] + " svelte-1yserjw"), toggle_class$2(s, "hide", !/*status*/ y[4] || /*status*/ @@ -27851,12 +27942,12 @@ function create_fragment$3(y) { }, p(E, u) { let A = e; - e = p(E), e === A ? ~e && o[e].p(E, u) : (l && (group_outros$2(), transition_out$2(o[A], 1, 1, () => { + e = g(E), e === A ? ~e && o[e].p(E, u) : (l && (group_outros$2(), transition_out$2(o[A], 1, 1, () => { o[A] = null; }), check_outros$2()), ~e ? (l = o[e], l ? l.p(E, u) : (l = o[e] = x[e](E), l.c()), transition_in$2(l, 1), l.m(s, null)) : l = null), (!_ || u[0] & /*variant, show_progress*/ - 320 && g !== (g = "wrap " + /*variant*/ + 320 && p !== (p = "wrap " + /*variant*/ E[8] + " " + /*show_progress*/ - E[6] + " svelte-1yserjw")) && attr$2(s, "class", g), (!_ || u[0] & /*variant, show_progress, status, show_progress*/ + E[6] + " svelte-1yserjw")) && attr$2(s, "class", p), (!_ || u[0] & /*variant, show_progress, status, show_progress*/ 336) && toggle_class$2(s, "hide", !/*status*/ E[4] || /*status*/ E[4] === "complete" || /*show_progress*/ @@ -27925,57 +28016,57 @@ async function scroll_into_view(y, s = !0) { } } function instance$3(y, s, e) { - let l, { $$slots: g = {}, $$scope: _ } = s, { i18n: x } = s, { eta: o = null } = s, { queue_position: p } = s, { queue_size: E } = s, { status: u } = s, { scroll_to_output: A = !1 } = s, { timer: C = !0 } = s, { show_progress: L = "full" } = s, { message: D = null } = s, { progress: r = null } = s, { variant: n = "default" } = s, { loading_text: b = "Loading..." } = s, { absolute: f = !0 } = s, { translucent: c = !1 } = s, { border: t = !1 } = s, { autoscroll: a } = s, h, M = !1, w = 0, S = 0, T = null, R = null, z = 0, P = null, B, U = null, F = !0; - const $ = () => { - e(0, o = e(26, T = e(19, G = null))), e(24, w = performance.now()), e(25, S = 0), M = !0, W(); + let l, { $$slots: p = {}, $$scope: _ } = s, { i18n: x } = s, { eta: o = null } = s, { queue_position: g } = s, { queue_size: E } = s, { status: u } = s, { scroll_to_output: A = !1 } = s, { timer: L = !0 } = s, { show_progress: C = "full" } = s, { message: D = null } = s, { progress: r = null } = s, { variant: n = "default" } = s, { loading_text: b = "Loading..." } = s, { absolute: f = !0 } = s, { translucent: c = !1 } = s, { border: t = !1 } = s, { autoscroll: a } = s, h, M = !1, w = 0, S = 0, T = null, R = null, $ = 0, P = null, B, F = null, U = !0; + const z = () => { + e(0, o = e(26, T = e(19, N = null))), e(24, w = performance.now()), e(25, S = 0), M = !0, W(); }; function W() { requestAnimationFrame(() => { e(25, S = (performance.now() - w) / 1e3), M && W(); }); } - function N() { - e(25, S = 0), e(0, o = e(26, T = e(19, G = null))), M && (M = !1); + function V() { + e(25, S = 0), e(0, o = e(26, T = e(19, N = null))), M && (M = !1); } onDestroy(() => { - M && N(); + M && V(); }); - let G = null; + let N = null; function k(Q) { binding_callbacks$3[Q ? "unshift" : "push"](() => { - U = Q, e(16, U), e(7, r), e(14, P), e(15, B); + F = Q, e(16, F), e(7, r), e(14, P), e(15, B); }); } - function j(Q) { + function G(Q) { binding_callbacks$3[Q ? "unshift" : "push"](() => { h = Q, e(13, h); }); } return y.$$set = (Q) => { - "i18n" in Q && e(1, x = Q.i18n), "eta" in Q && e(0, o = Q.eta), "queue_position" in Q && e(2, p = Q.queue_position), "queue_size" in Q && e(3, E = Q.queue_size), "status" in Q && e(4, u = Q.status), "scroll_to_output" in Q && e(21, A = Q.scroll_to_output), "timer" in Q && e(5, C = Q.timer), "show_progress" in Q && e(6, L = Q.show_progress), "message" in Q && e(22, D = Q.message), "progress" in Q && e(7, r = Q.progress), "variant" in Q && e(8, n = Q.variant), "loading_text" in Q && e(9, b = Q.loading_text), "absolute" in Q && e(10, f = Q.absolute), "translucent" in Q && e(11, c = Q.translucent), "border" in Q && e(12, t = Q.border), "autoscroll" in Q && e(23, a = Q.autoscroll), "$$scope" in Q && e(28, _ = Q.$$scope); + "i18n" in Q && e(1, x = Q.i18n), "eta" in Q && e(0, o = Q.eta), "queue_position" in Q && e(2, g = Q.queue_position), "queue_size" in Q && e(3, E = Q.queue_size), "status" in Q && e(4, u = Q.status), "scroll_to_output" in Q && e(21, A = Q.scroll_to_output), "timer" in Q && e(5, L = Q.timer), "show_progress" in Q && e(6, C = Q.show_progress), "message" in Q && e(22, D = Q.message), "progress" in Q && e(7, r = Q.progress), "variant" in Q && e(8, n = Q.variant), "loading_text" in Q && e(9, b = Q.loading_text), "absolute" in Q && e(10, f = Q.absolute), "translucent" in Q && e(11, c = Q.translucent), "border" in Q && e(12, t = Q.border), "autoscroll" in Q && e(23, a = Q.autoscroll), "$$scope" in Q && e(28, _ = Q.$$scope); }, y.$$.update = () => { y.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 218103809 && (o === null && e(0, o = T), o != null && T !== o && (e(27, R = (performance.now() - w) / 1e3 + o), e(19, G = R.toFixed(1)), e(26, T = o))), y.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 167772160 && e(17, z = R === null || R <= 0 || !S ? null : Math.min(S / R, 1)), y.$$.dirty[0] & /*progress*/ - 128 && r != null && e(18, F = !1), y.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 218103809 && (o === null && e(0, o = T), o != null && T !== o && (e(27, R = (performance.now() - w) / 1e3 + o), e(19, N = R.toFixed(1)), e(26, T = o))), y.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 167772160 && e(17, $ = R === null || R <= 0 || !S ? null : Math.min(S / R, 1)), y.$$.dirty[0] & /*progress*/ + 128 && r != null && e(18, U = !1), y.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ 114816 && (r != null ? e(14, P = r.map((Q) => { if (Q.index != null && Q.length != null) return Q.index / Q.length; if (Q.progress != null) return Q.progress; - })) : e(14, P = null), P ? (e(15, B = P[P.length - 1]), U && (B === 0 ? e(16, U.style.transition = "0", U) : e(16, U.style.transition = "150ms", U))) : e(15, B = void 0)), y.$$.dirty[0] & /*status*/ - 16 && (u === "pending" ? $() : N()), y.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + })) : e(14, P = null), P ? (e(15, B = P[P.length - 1]), F && (B === 0 ? e(16, F.style.transition = "0", F) : e(16, F.style.transition = "150ms", F))) : e(15, B = void 0)), y.$$.dirty[0] & /*status*/ + 16 && (u === "pending" ? z() : V()), y.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ 10493968 && h && A && (u === "pending" || u === "complete") && scroll_into_view(h, a), y.$$.dirty[0] & /*status, message*/ 4194320, y.$$.dirty[0] & /*timer_diff*/ 33554432 && e(20, l = S.toFixed(1)); }, [ o, x, - p, + g, E, u, - C, L, + C, r, n, b, @@ -27985,10 +28076,10 @@ function instance$3(y, s, e) { h, P, B, - U, - z, F, - G, + $, + U, + N, l, A, D, @@ -27998,9 +28089,9 @@ function instance$3(y, s, e) { T, R, _, - g, + p, k, - j + G ]; } class Static extends SvelteComponent$3 { @@ -28058,7 +28149,7 @@ function create_fragment$2(y) { /*value*/ y[0] ) : "") + "" - ), l, g; + ), l, p; return { c() { s = element$1("div"), l = text$2(e), attr$1(s, "class", "svelte-84cxb8"), add_render_callback$1(() => ( @@ -28082,7 +28173,7 @@ function create_fragment$2(y) { ); }, m(_, x) { - insert$2(_, s, x), append$1(s, l), g = add_iframe_resize_listener( + insert$2(_, s, x), append$1(s, l), p = add_iframe_resize_listener( s, /*div_elementresize_handler*/ y[5].bind(s) @@ -28117,17 +28208,17 @@ function create_fragment$2(y) { i: noop$1, o: noop$1, d(_) { - _ && detach$2(s), g(), y[6](null); + _ && detach$2(s), p(), y[6](null); } }; } function instance$2(y, s, e) { - let { value: l } = s, { type: g } = s, { selected: _ = !1 } = s, x, o; - function p(A, C) { - !A || !C || (o.style.setProperty("--local-text-width", `${C < 150 ? C : 200}px`), e(4, o.style.whiteSpace = "unset", o)); + let { value: l } = s, { type: p } = s, { selected: _ = !1 } = s, x, o; + function g(A, L) { + !A || !L || (o.style.setProperty("--local-text-width", `${L < 150 ? L : 200}px`), e(4, o.style.whiteSpace = "unset", o)); } onMount$1(() => { - p(o, x); + g(o, x); }); function E() { x = this.clientWidth, e(3, x); @@ -28138,8 +28229,8 @@ function instance$2(y, s, e) { }); } return y.$$set = (A) => { - "value" in A && e(0, l = A.value), "type" in A && e(1, g = A.type), "selected" in A && e(2, _ = A.selected); - }, [l, g, _, x, o, E, u]; + "value" in A && e(0, l = A.value), "type" in A && e(1, p = A.type), "selected" in A && e(2, _ = A.selected); + }, [l, p, _, x, o, E, u]; } class Example extends SvelteComponent$2 { constructor(s) { @@ -28204,7 +28295,7 @@ function create_default_slot$1(y) { }; } function create_else_block(y) { - let s, e, l, g, _, x, o, p, E = ( + let s, e, l, p, _, x, o, g, E = ( /*show_label*/ y[6] && /*show_copy_button*/ y[10] && create_if_block_4(y) @@ -28224,7 +28315,7 @@ function create_else_block(y) { y[1] ), e.disabled = /*disabled*/ y[5], e.autofocus = /*autofocus*/ - y[12], attr(e, "style", g = /*text_align*/ + y[12], attr(e, "style", p = /*text_align*/ y[13] ? "text-align: " + /*text_align*/ y[13] : ""); }, @@ -28234,7 +28325,7 @@ function create_else_block(y) { /*value*/ y[0] ), y[38](e), x = !0, /*autofocus*/ - y[12] && e.focus(), o || (p = [ + y[12] && e.focus(), o || (g = [ action_destroyer(_ = /*text_area_resize*/ y[20].call( null, @@ -28305,9 +28396,9 @@ function create_else_block(y) { u[5]), (!x || A[0] & /*autofocus*/ 4096) && (e.autofocus = /*autofocus*/ u[12]), (!x || A[0] & /*text_align*/ - 8192 && g !== (g = /*text_align*/ + 8192 && p !== (p = /*text_align*/ u[13] ? "text-align: " + /*text_align*/ - u[13] : "")) && attr(e, "style", g), _ && is_function(_.update) && A[0] & /*value*/ + u[13] : "")) && attr(e, "style", p), _ && is_function(_.update) && A[0] & /*value*/ 1 && _.update.call( null, /*value*/ @@ -28326,7 +28417,7 @@ function create_else_block(y) { transition_out$1(E), x = !1; }, d(u) { - u && (detach$1(s), detach$1(e)), E && E.d(u), y[38](null), o = !1, run_all(p); + u && (detach$1(s), detach$1(e)), E && E.d(u), y[38](null), o = !1, run_all(g); } }; } @@ -28349,70 +28440,70 @@ function create_if_block$1(y) { ) return create_if_block_3; } - let l = e(y), g = l && l(y); + let l = e(y), p = l && l(y); return { c() { - g && g.c(), s = empty(); + p && p.c(), s = empty(); }, m(_, x) { - g && g.m(_, x), insert$1(_, s, x); + p && p.m(_, x), insert$1(_, s, x); }, p(_, x) { - l === (l = e(_)) && g ? g.p(_, x) : (g && g.d(1), g = l && l(_), g && (g.c(), g.m(s.parentNode, s))); + l === (l = e(_)) && p ? p.p(_, x) : (p && p.d(1), p = l && l(_), p && (p.c(), p.m(s.parentNode, s))); }, i: noop, o: noop, d(_) { - _ && detach$1(s), g && g.d(_); + _ && detach$1(s), p && p.d(_); } }; } function create_if_block_4(y) { - let s, e, l, g; + let s, e, l, p; const _ = [create_if_block_5, create_else_block_1], x = []; - function o(p, E) { + function o(g, E) { return ( /*copied*/ - p[15] ? 0 : 1 + g[15] ? 0 : 1 ); } return s = o(y), e = x[s] = _[s](y), { c() { e.c(), l = empty(); }, - m(p, E) { - x[s].m(p, E), insert$1(p, l, E), g = !0; + m(g, E) { + x[s].m(g, E), insert$1(g, l, E), p = !0; }, - p(p, E) { + p(g, E) { let u = s; - s = o(p), s === u ? x[s].p(p, E) : (group_outros$1(), transition_out$1(x[u], 1, 1, () => { + s = o(g), s === u ? x[s].p(g, E) : (group_outros$1(), transition_out$1(x[u], 1, 1, () => { x[u] = null; - }), check_outros$1(), e = x[s], e ? e.p(p, E) : (e = x[s] = _[s](p), e.c()), transition_in$1(e, 1), e.m(l.parentNode, l)); + }), check_outros$1(), e = x[s], e ? e.p(g, E) : (e = x[s] = _[s](g), e.c()), transition_in$1(e, 1), e.m(l.parentNode, l)); }, - i(p) { - g || (transition_in$1(e), g = !0); + i(g) { + p || (transition_in$1(e), p = !0); }, - o(p) { - transition_out$1(e), g = !1; + o(g) { + transition_out$1(e), p = !1; }, - d(p) { - p && detach$1(l), x[s].d(p); + d(g) { + g && detach$1(l), x[s].d(g); } }; } function create_else_block_1(y) { - let s, e, l, g, _; + let s, e, l, p, _; return e = new Copy({}), { c() { s = element("button"), create_component$1(e.$$.fragment), attr(s, "aria-label", "Copy"), attr(s, "aria-roledescription", "Copy text"), attr(s, "class", "svelte-18tqgac"); }, m(x, o) { - insert$1(x, s, o), mount_component$1(e, s, null), l = !0, g || (_ = listen( + insert$1(x, s, o), mount_component$1(e, s, null), l = !0, p || (_ = listen( s, "click", /*handle_copy*/ y[16] - ), g = !0); + ), p = !0); }, p: noop, i(x) { @@ -28422,27 +28513,27 @@ function create_else_block_1(y) { transition_out$1(e.$$.fragment, x), l = !1; }, d(x) { - x && detach$1(s), destroy_component$1(e), g = !1, _(); + x && detach$1(s), destroy_component$1(e), p = !1, _(); } }; } function create_if_block_5(y) { - let s, e, l, g; + let s, e, l, p; return e = new Check({}), { c() { s = element("button"), create_component$1(e.$$.fragment), attr(s, "aria-label", "Copied"), attr(s, "aria-roledescription", "Text copied"), attr(s, "class", "svelte-18tqgac"); }, m(_, x) { - insert$1(_, s, x), mount_component$1(e, s, null), g = !0; + insert$1(_, s, x), mount_component$1(e, s, null), p = !0; }, p: noop, i(_) { - g || (transition_in$1(e.$$.fragment, _), _ && (l || add_render_callback(() => { + p || (transition_in$1(e.$$.fragment, _), _ && (l || add_render_callback(() => { l = create_in_transition(s, fade, { duration: 300 }), l.start(); - })), g = !0); + })), p = !0); }, o(_) { - transition_out$1(e.$$.fragment, _), g = !1; + transition_out$1(e.$$.fragment, _), p = !1; }, d(_) { _ && detach$1(s), destroy_component$1(e); @@ -28462,8 +28553,8 @@ function create_if_block_3(y) { y[5], s.autofocus = /*autofocus*/ y[12], attr(s, "autocomplete", "email"); }, - m(g, _) { - insert$1(g, s, _), set_input_value( + m(p, _) { + insert$1(p, s, _), set_input_value( s, /*value*/ y[0] @@ -28501,27 +28592,27 @@ function create_if_block_3(y) { ) ], e = !0); }, - p(g, _) { + p(p, _) { _[0] & /*placeholder*/ 4 && attr( s, "placeholder", /*placeholder*/ - g[2] + p[2] ), _[0] & /*disabled*/ 32 && (s.disabled = /*disabled*/ - g[5]), _[0] & /*autofocus*/ + p[5]), _[0] & /*autofocus*/ 4096 && (s.autofocus = /*autofocus*/ - g[12]), _[0] & /*value*/ + p[12]), _[0] & /*value*/ 1 && s.value !== /*value*/ - g[0] && set_input_value( + p[0] && set_input_value( s, /*value*/ - g[0] + p[0] ); }, - d(g) { - g && detach$1(s), y[36](null), e = !1, run_all(l); + d(p) { + p && detach$1(s), y[36](null), e = !1, run_all(l); } }; } @@ -28538,8 +28629,8 @@ function create_if_block_2(y) { y[5], s.autofocus = /*autofocus*/ y[12], attr(s, "autocomplete", ""); }, - m(g, _) { - insert$1(g, s, _), set_input_value( + m(p, _) { + insert$1(p, s, _), set_input_value( s, /*value*/ y[0] @@ -28577,32 +28668,32 @@ function create_if_block_2(y) { ) ], e = !0); }, - p(g, _) { + p(p, _) { _[0] & /*placeholder*/ 4 && attr( s, "placeholder", /*placeholder*/ - g[2] + p[2] ), _[0] & /*disabled*/ 32 && (s.disabled = /*disabled*/ - g[5]), _[0] & /*autofocus*/ + p[5]), _[0] & /*autofocus*/ 4096 && (s.autofocus = /*autofocus*/ - g[12]), _[0] & /*value*/ + p[12]), _[0] & /*value*/ 1 && s.value !== /*value*/ - g[0] && set_input_value( + p[0] && set_input_value( s, /*value*/ - g[0] + p[0] ); }, - d(g) { - g && detach$1(s), y[34](null), e = !1, run_all(l); + d(p) { + p && detach$1(s), y[34](null), e = !1, run_all(l); } }; } function create_if_block_1(y) { - let s, e, l, g, _; + let s, e, l, p, _; return { c() { s = element("input"), attr(s, "data-testid", "textbox"), attr(s, "type", "text"), attr(s, "class", "scroll-hide svelte-18tqgac"), attr(s, "dir", e = /*rtl*/ @@ -28623,7 +28714,7 @@ function create_if_block_1(y) { /*value*/ y[0] ), y[32](s), /*autofocus*/ - y[12] && s.focus(), g || (_ = [ + y[12] && s.focus(), p || (_ = [ listen( s, "input", @@ -28654,7 +28745,7 @@ function create_if_block_1(y) { /*focus_handler*/ y[24] ) - ], g = !0); + ], p = !0); }, p(x, o) { o[0] & /*rtl*/ @@ -28681,12 +28772,12 @@ function create_if_block_1(y) { ); }, d(x) { - x && detach$1(s), y[32](null), g = !1, run_all(_); + x && detach$1(s), y[32](null), p = !1, run_all(_); } }; } function create_fragment$1(y) { - let s, e, l, g, _, x; + let s, e, l, p, _, x; e = new BlockTitle({ props: { show_label: ( @@ -28701,7 +28792,7 @@ function create_fragment$1(y) { $$scope: { ctx: y } } }); - const o = [create_if_block$1, create_else_block], p = []; + const o = [create_if_block$1, create_else_block], g = []; function E(u, A) { return ( /*lines*/ @@ -28709,7 +28800,7 @@ function create_fragment$1(y) { u[8] === 1 ? 0 : 1 ); } - return g = E(y), _ = p[g] = o[g](y), { + return p = E(y), _ = g[p] = o[p](y), { c() { s = element("label"), create_component$1(e.$$.fragment), l = space$1(), _.c(), attr(s, "class", "svelte-18tqgac"), toggle_class( s, @@ -28719,21 +28810,21 @@ function create_fragment$1(y) { ); }, m(u, A) { - insert$1(u, s, A), mount_component$1(e, s, null), append(s, l), p[g].m(s, null), x = !0; + insert$1(u, s, A), mount_component$1(e, s, null), append(s, l), g[p].m(s, null), x = !0; }, p(u, A) { - const C = {}; + const L = {}; A[0] & /*show_label*/ - 64 && (C.show_label = /*show_label*/ + 64 && (L.show_label = /*show_label*/ u[6]), A[0] & /*info*/ - 16 && (C.info = /*info*/ + 16 && (L.info = /*info*/ u[4]), A[0] & /*label*/ 8 | A[1] & /*$$scope*/ - 131072 && (C.$$scope = { dirty: A, ctx: u }), e.$set(C); - let L = g; - g = E(u), g === L ? p[g].p(u, A) : (group_outros$1(), transition_out$1(p[L], 1, 1, () => { - p[L] = null; - }), check_outros$1(), _ = p[g], _ ? _.p(u, A) : (_ = p[g] = o[g](u), _.c()), transition_in$1(_, 1), _.m(s, null)), (!x || A[0] & /*container*/ + 131072 && (L.$$scope = { dirty: A, ctx: u }), e.$set(L); + let C = p; + p = E(u), p === C ? g[p].p(u, A) : (group_outros$1(), transition_out$1(g[C], 1, 1, () => { + g[C] = null; + }), check_outros$1(), _ = g[p], _ ? _.p(u, A) : (_ = g[p] = o[p](u), _.c()), transition_in$1(_, 1), _.m(s, null)), (!x || A[0] & /*container*/ 128) && toggle_class( s, "container", @@ -28748,12 +28839,12 @@ function create_fragment$1(y) { transition_out$1(e.$$.fragment, u), transition_out$1(_), x = !1; }, d(u) { - u && detach$1(s), destroy_component$1(e), p[g].d(); + u && detach$1(s), destroy_component$1(e), g[p].d(); } }; } function instance$1(y, s, e) { - let { value: l = "" } = s, { value_is_output: g = !1 } = s, { lines: _ = 1 } = s, { placeholder: x = "Type here..." } = s, { label: o } = s, { info: p = void 0 } = s, { disabled: E = !1 } = s, { show_label: u = !0 } = s, { container: A = !0 } = s, { max_lines: C } = s, { type: L = "text" } = s, { show_copy_button: D = !1 } = s, { rtl: r = !1 } = s, { autofocus: n = !1 } = s, { text_align: b = void 0 } = s, { autoscroll: f = !0 } = s, c, t = !1, a, h, M = 0, w = !1; + let { value: l = "" } = s, { value_is_output: p = !1 } = s, { lines: _ = 1 } = s, { placeholder: x = "Type here..." } = s, { label: o } = s, { info: g = void 0 } = s, { disabled: E = !1 } = s, { show_label: u = !0 } = s, { container: A = !0 } = s, { max_lines: L } = s, { type: C = "text" } = s, { show_copy_button: D = !1 } = s, { rtl: r = !1 } = s, { autofocus: n = !1 } = s, { text_align: b = void 0 } = s, { autoscroll: f = !0 } = s, c, t = !1, a, h, M = 0, w = !1; const S = createEventDispatcher(); beforeUpdate(() => { h = c && c.offsetHeight + c.scrollTop > c.scrollHeight - 100; @@ -28762,12 +28853,12 @@ function instance$1(y, s, e) { h && f && !w && c.scrollTo(0, c.scrollHeight); }; function R() { - S("change", l), g || S("input"); + S("change", l), p || S("input"); } afterUpdate(() => { - n && c.focus(), h && f && T(), e(21, g = !1); + n && c.focus(), h && f && T(), e(21, p = !1); }); - async function z() { + async function $() { "clipboard" in navigator && (await navigator.clipboard.writeText(l), P()); } function P() { @@ -28779,43 +28870,43 @@ function instance$1(y, s, e) { ); } function B(re) { - const Se = re.target, ze = Se.value, Ge = [Se.selectionStart, Se.selectionEnd]; - S("select", { value: ze.substring(...Ge), index: Ge }); + const Se = re.target, ke = Se.value, $e = [Se.selectionStart, Se.selectionEnd]; + S("select", { value: ke.substring(...$e), index: $e }); } - async function U(re) { - await tick(), (re.key === "Enter" && re.shiftKey && _ > 1 || re.key === "Enter" && !re.shiftKey && _ === 1 && C >= 1) && (re.preventDefault(), S("submit")); + async function F(re) { + await tick(), (re.key === "Enter" && re.shiftKey && _ > 1 || re.key === "Enter" && !re.shiftKey && _ === 1 && L >= 1) && (re.preventDefault(), S("submit")); } - function F(re) { - const Se = re.target, ze = Se.scrollTop; - ze < M && (w = !0), M = ze; - const Ge = Se.scrollHeight - Se.clientHeight; - ze >= Ge && (w = !1); + function U(re) { + const Se = re.target, ke = Se.scrollTop; + ke < M && (w = !0), M = ke; + const $e = Se.scrollHeight - Se.clientHeight; + ke >= $e && (w = !1); } - async function $(re) { - if (await tick(), _ === C) + async function z(re) { + if (await tick(), _ === L) return; - let Se = C === void 0 ? !1 : C === void 0 ? 21 * 11 : 21 * (C + 1), ze = 21 * (_ + 1); - const Ge = re.target; - Ge.style.height = "1px"; - let $e; - Se && Ge.scrollHeight > Se ? $e = Se : Ge.scrollHeight < ze ? $e = ze : $e = Ge.scrollHeight, Ge.style.height = `${$e}px`; + let Se = L === void 0 ? !1 : L === void 0 ? 21 * 11 : 21 * (L + 1), ke = 21 * (_ + 1); + const $e = re.target; + $e.style.height = "1px"; + let ze; + Se && $e.scrollHeight > Se ? ze = Se : $e.scrollHeight < ke ? ze = ke : ze = $e.scrollHeight, $e.style.height = `${ze}px`; } function W(re, Se) { - if (_ !== C && (re.style.overflowY = "scroll", re.addEventListener("input", $), !!Se.trim())) - return $({ target: re }), { - destroy: () => re.removeEventListener("input", $) + if (_ !== L && (re.style.overflowY = "scroll", re.addEventListener("input", z), !!Se.trim())) + return z({ target: re }), { + destroy: () => re.removeEventListener("input", z) }; } - function N(re) { + function V(re) { bubble.call(this, y, re); } - function G(re) { + function N(re) { bubble.call(this, y, re); } function k(re) { bubble.call(this, y, re); } - function j(re) { + function G(re) { bubble.call(this, y, re); } function Q(re) { @@ -28824,91 +28915,91 @@ function instance$1(y, s, e) { function ie(re) { bubble.call(this, y, re); } - function pe(re) { + function ge(re) { bubble.call(this, y, re); } - function he(re) { + function le(re) { bubble.call(this, y, re); } - function ue() { + function oe() { l = this.value, e(0, l); } - function se(re) { + function he(re) { binding_callbacks$1[re ? "unshift" : "push"](() => { c = re, e(14, c); }); } - function ae() { + function se() { l = this.value, e(0, l); } - function we(re) { + function xe(re) { binding_callbacks$1[re ? "unshift" : "push"](() => { c = re, e(14, c); }); } - function xe() { + function ye() { l = this.value, e(0, l); } - function Ie(re) { + function Pe(re) { binding_callbacks$1[re ? "unshift" : "push"](() => { c = re, e(14, c); }); } - function oe() { + function de() { l = this.value, e(0, l); } - function ve(re) { + function pe(re) { binding_callbacks$1[re ? "unshift" : "push"](() => { c = re, e(14, c); }); } return y.$$set = (re) => { - "value" in re && e(0, l = re.value), "value_is_output" in re && e(21, g = re.value_is_output), "lines" in re && e(1, _ = re.lines), "placeholder" in re && e(2, x = re.placeholder), "label" in re && e(3, o = re.label), "info" in re && e(4, p = re.info), "disabled" in re && e(5, E = re.disabled), "show_label" in re && e(6, u = re.show_label), "container" in re && e(7, A = re.container), "max_lines" in re && e(8, C = re.max_lines), "type" in re && e(9, L = re.type), "show_copy_button" in re && e(10, D = re.show_copy_button), "rtl" in re && e(11, r = re.rtl), "autofocus" in re && e(12, n = re.autofocus), "text_align" in re && e(13, b = re.text_align), "autoscroll" in re && e(22, f = re.autoscroll); + "value" in re && e(0, l = re.value), "value_is_output" in re && e(21, p = re.value_is_output), "lines" in re && e(1, _ = re.lines), "placeholder" in re && e(2, x = re.placeholder), "label" in re && e(3, o = re.label), "info" in re && e(4, g = re.info), "disabled" in re && e(5, E = re.disabled), "show_label" in re && e(6, u = re.show_label), "container" in re && e(7, A = re.container), "max_lines" in re && e(8, L = re.max_lines), "type" in re && e(9, C = re.type), "show_copy_button" in re && e(10, D = re.show_copy_button), "rtl" in re && e(11, r = re.rtl), "autofocus" in re && e(12, n = re.autofocus), "text_align" in re && e(13, b = re.text_align), "autoscroll" in re && e(22, f = re.autoscroll); }, y.$$.update = () => { y.$$.dirty[0] & /*value*/ 1 && l === null && e(0, l = ""), y.$$.dirty[0] & /*value, el, lines, max_lines*/ - 16643 && c && _ !== C && $({ target: c }), y.$$.dirty[0] & /*value*/ + 16643 && c && _ !== L && z({ target: c }), y.$$.dirty[0] & /*value*/ 1 && R(); }, [ l, _, x, o, - p, + g, E, u, A, - C, L, + C, D, r, n, b, c, t, - z, + $, B, - U, F, + U, W, - g, + p, f, + V, N, - G, k, - j, + G, Q, ie, - pe, + ge, + le, + oe, he, - ue, se, - ae, - we, xe, - Ie, - oe, - ve + ye, + Pe, + de, + pe ]; } class Textbox extends SvelteComponent$1 { @@ -28980,10 +29071,10 @@ function create_if_block(y) { /*loading_status*/ y[11] ]; - let g = {}; + let p = {}; for (let _ = 0; _ < l.length; _ += 1) - g = assign(g, l[_]); - return s = new Static({ props: g }), { + p = assign(p, l[_]); + return s = new Static({ props: p }), { c() { create_component(s.$$.fragment); }, @@ -29048,7 +29139,7 @@ function create_default_slot_1(y) { }; } function create_default_slot(y) { - let s, e, l, g, _, x, o = ( + let s, e, l, p, _, x, o = ( /*loading_status*/ y[11] && create_if_block(y) ); @@ -29066,27 +29157,27 @@ function create_default_slot(y) { $$scope: { ctx: y } } }); - function p(u) { + function g(u) { y[14](u); } let E = {}; return ( /*value*/ y[0] !== void 0 && (E.value = /*value*/ - y[0]), g = new SequenceInput({ props: E }), binding_callbacks.push(() => bind(g, "value", p)), g.$on( + y[0]), p = new SequenceInput({ props: E }), binding_callbacks.push(() => bind(p, "value", g)), p.$on( "updateVals", /*syncValue*/ y[12] - ), g.$on( + ), p.$on( "updateCovMod", /*syncCovMod*/ y[13] ), { c() { - o && o.c(), s = space(), create_component(e.$$.fragment), l = space(), create_component(g.$$.fragment); + o && o.c(), s = space(), create_component(e.$$.fragment), l = space(), create_component(p.$$.fragment); }, m(u, A) { - o && o.m(u, A), insert(u, s, A), mount_component(e, u, A), insert(u, l, A), mount_component(g, u, A), x = !0; + o && o.m(u, A), insert(u, s, A), mount_component(e, u, A), insert(u, l, A), mount_component(p, u, A), x = !0; }, p(u, A) { /*loading_status*/ @@ -29094,26 +29185,26 @@ function create_default_slot(y) { 2048 && transition_in(o, 1)) : (o = create_if_block(u), o.c(), transition_in(o, 1), o.m(s.parentNode, s)) : o && (group_outros(), transition_out(o, 1, 1, () => { o = null; }), check_outros()); - const C = {}; + const L = {}; A & /*show_label*/ - 128 && (C.show_label = /*show_label*/ + 128 && (L.show_label = /*show_label*/ u[7]), A & /*info*/ - 8 && (C.info = /*info*/ + 8 && (L.info = /*info*/ u[3]), A & /*$$scope, label*/ - 32772 && (C.$$scope = { dirty: A, ctx: u }), e.$set(C); - const L = {}; + 32772 && (L.$$scope = { dirty: A, ctx: u }), e.$set(L); + const C = {}; !_ && A & /*value*/ - 1 && (_ = !0, L.value = /*value*/ - u[0], add_flush_callback(() => _ = !1)), g.$set(L); + 1 && (_ = !0, C.value = /*value*/ + u[0], add_flush_callback(() => _ = !1)), p.$set(C); }, i(u) { - x || (transition_in(o), transition_in(e.$$.fragment, u), transition_in(g.$$.fragment, u), x = !0); + x || (transition_in(o), transition_in(e.$$.fragment, u), transition_in(p.$$.fragment, u), x = !0); }, o(u) { - transition_out(o), transition_out(e.$$.fragment, u), transition_out(g.$$.fragment, u), x = !1; + transition_out(o), transition_out(e.$$.fragment, u), transition_out(p.$$.fragment, u), x = !1; }, d(u) { - u && (detach(s), detach(l)), o && o.d(u), destroy_component(e, u), destroy_component(g, u); + u && (detach(s), detach(l)), o && o.d(u), destroy_component(e, u), destroy_component(p, u); } } ); @@ -29154,25 +29245,25 @@ function create_fragment(y) { c() { create_component(s.$$.fragment); }, - m(l, g) { - mount_component(s, l, g), e = !0; + m(l, p) { + mount_component(s, l, p), e = !0; }, - p(l, [g]) { + p(l, [p]) { const _ = {}; - g & /*visible*/ + p & /*visible*/ 64 && (_.visible = /*visible*/ - l[6]), g & /*elem_id*/ + l[6]), p & /*elem_id*/ 16 && (_.elem_id = /*elem_id*/ - l[4]), g & /*elem_classes*/ + l[4]), p & /*elem_classes*/ 32 && (_.elem_classes = /*elem_classes*/ - l[5]), g & /*scale*/ + l[5]), p & /*scale*/ 512 && (_.scale = /*scale*/ - l[9]), g & /*min_width*/ + l[9]), p & /*min_width*/ 1024 && (_.min_width = /*min_width*/ - l[10]), g & /*container*/ + l[10]), p & /*container*/ 256 && (_.padding = /*container*/ - l[8]), g & /*$$scope, value, show_label, info, label, gradio, loading_status*/ - 34959 && (_.$$scope = { dirty: g, ctx: l }), s.$set(_); + l[8]), p & /*$$scope, value, show_label, info, label, gradio, loading_status*/ + 34959 && (_.$$scope = { dirty: p, ctx: l }), s.$set(_); }, i(l) { e || (transition_in(s.$$.fragment, l), e = !0); @@ -29186,7 +29277,7 @@ function create_fragment(y) { }; } function instance(y, s, e) { - let { gradio: l } = s, { label: g = "CofoldingInput" } = s, { info: _ = void 0 } = s, { elem_id: x = "" } = s, { elem_classes: o = [] } = s, { visible: p = !0 } = s, { value: E = { chains: [], covMods: [] } } = s, { show_label: u } = s, { container: A = !0 } = s, { scale: C = null } = s, { min_width: L = void 0 } = s, { loading_status: D = void 0 } = s; + let { gradio: l } = s, { label: p = "CofoldingInput" } = s, { info: _ = void 0 } = s, { elem_id: x = "" } = s, { elem_classes: o = [] } = s, { visible: g = !0 } = s, { value: E = { chains: [], covMods: [] } } = s, { show_label: u } = s, { container: A = !0 } = s, { scale: L = null } = s, { min_width: C = void 0 } = s, { loading_status: D = void 0 } = s; function r(f) { let c = f.detail.map((t) => Object.fromEntries(Object.entries(t).filter(([a, h]) => a !== "open" && h !== ""))); e(0, E.chains = c, E); @@ -29200,19 +29291,19 @@ function instance(y, s, e) { E = f, e(0, E); } return y.$$set = (f) => { - "gradio" in f && e(1, l = f.gradio), "label" in f && e(2, g = f.label), "info" in f && e(3, _ = f.info), "elem_id" in f && e(4, x = f.elem_id), "elem_classes" in f && e(5, o = f.elem_classes), "visible" in f && e(6, p = f.visible), "value" in f && e(0, E = f.value), "show_label" in f && e(7, u = f.show_label), "container" in f && e(8, A = f.container), "scale" in f && e(9, C = f.scale), "min_width" in f && e(10, L = f.min_width), "loading_status" in f && e(11, D = f.loading_status); + "gradio" in f && e(1, l = f.gradio), "label" in f && e(2, p = f.label), "info" in f && e(3, _ = f.info), "elem_id" in f && e(4, x = f.elem_id), "elem_classes" in f && e(5, o = f.elem_classes), "visible" in f && e(6, g = f.visible), "value" in f && e(0, E = f.value), "show_label" in f && e(7, u = f.show_label), "container" in f && e(8, A = f.container), "scale" in f && e(9, L = f.scale), "min_width" in f && e(10, C = f.min_width), "loading_status" in f && e(11, D = f.loading_status); }, [ E, l, - g, + p, _, x, o, - p, + g, u, A, - C, L, + C, D, r, n,