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" @@ -1,3 +1,11 @@ +var is = Object.defineProperty; +var hn = (n) => { + throw TypeError(n); +}; +var ns = (n, e, t) => e in n ? is(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; +var Dt = (n, e, t) => ns(n, typeof e != "symbol" ? e + "" : e, t), as = (n, e, t) => e.has(n) || hn("Cannot " + t); +var cn = (n, e, t) => e.has(n) ? hn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t); +var zr = (n, e, t) => (as(n, e, "access private method"), t); function _mergeNamespaces(n, e) { for (var t = 0; t < e.length; t++) { const r = e[t]; @@ -29,7 +37,7 @@ const { insert_hydration: insert_hydration$i, safe_not_equal: safe_not_equal$j, set_dynamic_element_data, - set_style: set_style$5, + set_style: set_style$7, toggle_class: toggle_class$9, transition_in: transition_in$8, transition_out: transition_out$8, @@ -58,7 +66,7 @@ function create_dynamic_element(n) { ) }, { class: t = "block " + /*elem_classes*/ - n[6].join(" ") + " svelte-dbzldu" + n[6].join(" ") + " svelte-1df3mrj" } ], o = {}; for (let d = 0; d < h.length; d += 1) @@ -81,8 +89,8 @@ function create_dynamic_element(n) { class: !0 } ); - var v = children$g(e); - s && s.l(v), v.forEach(detach$i), this.h(); + var _ = children$g(e); + s && s.l(_), _.forEach(detach$i), this.h(); }, h() { set_dynamic_element_data( @@ -120,7 +128,7 @@ function create_dynamic_element(n) { "auto-margin", /*scale*/ n[16] === null - ), set_style$5( + ), set_style$7( e, "height", /*get_dimension*/ @@ -128,7 +136,7 @@ function create_dynamic_element(n) { /*height*/ n[1] ) - ), set_style$5( + ), set_style$7( e, "min-height", /*get_dimension*/ @@ -136,7 +144,7 @@ function create_dynamic_element(n) { /*min_height*/ n[2] ) - ), set_style$5( + ), set_style$7( e, "max-height", /*get_dimension*/ @@ -144,7 +152,7 @@ function create_dynamic_element(n) { /*max_height*/ n[3] ) - ), set_style$5(e, "width", typeof /*width*/ + ), set_style$7(e, "width", typeof /*width*/ n[4] == "number" ? `calc(min(${/*width*/ n[4]}px, 100%))` : ( /*get_dimension*/ @@ -152,12 +160,12 @@ function create_dynamic_element(n) { /*width*/ n[4] ) - )), set_style$5( + )), set_style$7( e, "border-style", /*variant*/ n[7] - ), set_style$5( + ), set_style$7( e, "overflow", /*allow_overflow*/ @@ -165,19 +173,19 @@ function create_dynamic_element(n) { /*overflow_behavior*/ n[15] ) : "hidden" - ), set_style$5( + ), set_style$7( e, "flex-grow", /*scale*/ n[16] - ), set_style$5(e, "min-width", `calc(min(${/*min_width*/ - n[17]}px, 100%))`), set_style$5(e, "border-width", "var(--block-border-width)"); + ), set_style$7(e, "min-width", `calc(min(${/*min_width*/ + n[17]}px, 100%))`), set_style$7(e, "border-width", "var(--block-border-width)"); }, - m(d, v) { - insert_hydration$i(d, e, v), s && s.m(e, null), r = !0; + m(d, _) { + insert_hydration$i(d, e, _), s && s.m(e, null), r = !0; }, - p(d, v) { - s && s.p && (!r || v & /*$$scope*/ + p(d, _) { + s && s.p && (!r || _ & /*$$scope*/ 2097152) && update_slot_base$3( s, a, @@ -188,7 +196,7 @@ function create_dynamic_element(n) { a, /*$$scope*/ d[21], - v, + _, null ) : get_all_dirty_from_scope$3( /*$$scope*/ @@ -199,19 +207,19 @@ function create_dynamic_element(n) { /*tag*/ d[18] )(e, o = get_spread_update$1(h, [ - (!r || v & /*test_id*/ + (!r || _ & /*test_id*/ 1024) && { "data-testid": ( /*test_id*/ d[10] ) }, - (!r || v & /*elem_id*/ + (!r || _ & /*elem_id*/ 32) && { id: ( /*elem_id*/ d[5] ) }, - (!r || v & /*elem_classes*/ + (!r || _ & /*elem_classes*/ 64 && t !== (t = "block " + /*elem_classes*/ - d[6].join(" ") + " svelte-dbzldu")) && { class: t } + d[6].join(" ") + " svelte-1df3mrj")) && { class: t } ])), toggle_class$9( e, "hidden", @@ -244,8 +252,8 @@ function create_dynamic_element(n) { "auto-margin", /*scale*/ d[16] === null - ), v & /*height*/ - 2 && set_style$5( + ), _ & /*height*/ + 2 && set_style$7( e, "height", /*get_dimension*/ @@ -253,8 +261,8 @@ function create_dynamic_element(n) { /*height*/ d[1] ) - ), v & /*min_height*/ - 4 && set_style$5( + ), _ & /*min_height*/ + 4 && set_style$7( e, "min-height", /*get_dimension*/ @@ -262,8 +270,8 @@ function create_dynamic_element(n) { /*min_height*/ d[2] ) - ), v & /*max_height*/ - 8 && set_style$5( + ), _ & /*max_height*/ + 8 && set_style$7( e, "max-height", /*get_dimension*/ @@ -271,8 +279,8 @@ function create_dynamic_element(n) { /*max_height*/ d[3] ) - ), v & /*width*/ - 16 && set_style$5(e, "width", typeof /*width*/ + ), _ & /*width*/ + 16 && set_style$7(e, "width", typeof /*width*/ d[4] == "number" ? `calc(min(${/*width*/ d[4]}px, 100%))` : ( /*get_dimension*/ @@ -280,14 +288,14 @@ function create_dynamic_element(n) { /*width*/ d[4] ) - )), v & /*variant*/ - 128 && set_style$5( + )), _ & /*variant*/ + 128 && set_style$7( e, "border-style", /*variant*/ d[7] - ), v & /*allow_overflow, overflow_behavior*/ - 49152 && set_style$5( + ), _ & /*allow_overflow, overflow_behavior*/ + 49152 && set_style$7( e, "overflow", /*allow_overflow*/ @@ -295,14 +303,14 @@ function create_dynamic_element(n) { /*overflow_behavior*/ d[15] ) : "hidden" - ), v & /*scale*/ - 65536 && set_style$5( + ), _ & /*scale*/ + 65536 && set_style$7( e, "flex-grow", /*scale*/ d[16] - ), v & /*min_width*/ - 131072 && set_style$5(e, "min-width", `calc(min(${/*min_width*/ + ), _ & /*min_width*/ + 131072 && set_style$7(e, "min-width", `calc(min(${/*min_width*/ d[17]}px, 100%))`); }, i(d) { @@ -347,7 +355,7 @@ function create_fragment$i(n) { }; } function instance$f(n, e, t) { - let { $$slots: r = {}, $$scope: a } = e, { height: s = void 0 } = e, { min_height: h = void 0 } = e, { max_height: o = void 0 } = e, { width: d = void 0 } = e, { elem_id: v = "" } = e, { elem_classes: f = [] } = e, { variant: y = "solid" } = e, { border_mode: A = "base" } = e, { padding: x = !0 } = e, { type: M = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: l = !1 } = e, { container: u = !0 } = e, { visible: p = !0 } = e, { allow_overflow: g = !0 } = e, { overflow_behavior: b = "auto" } = e, { scale: c = null } = e, { min_width: _ = 0 } = e, { flex: E = !1 } = e; + let { $$slots: r = {}, $$scope: a } = e, { height: s = void 0 } = e, { min_height: h = void 0 } = e, { max_height: o = void 0 } = e, { width: d = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: f = [] } = e, { variant: y = "solid" } = e, { border_mode: A = "base" } = e, { padding: x = !0 } = e, { type: M = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: l = !1 } = e, { container: u = !0 } = e, { visible: p = !0 } = e, { allow_overflow: g = !0 } = e, { overflow_behavior: b = "auto" } = e, { scale: c = null } = e, { min_width: v = 0 } = e, { flex: E = !1 } = e; p || (E = !1); let w = M === "fieldset" ? "fieldset" : "div"; const k = ($) => { @@ -359,14 +367,14 @@ function instance$f(n, e, t) { } }; return n.$$set = ($) => { - "height" in $ && t(1, s = $.height), "min_height" in $ && t(2, h = $.min_height), "max_height" in $ && t(3, o = $.max_height), "width" in $ && t(4, d = $.width), "elem_id" in $ && t(5, v = $.elem_id), "elem_classes" in $ && t(6, f = $.elem_classes), "variant" in $ && t(7, y = $.variant), "border_mode" in $ && t(8, A = $.border_mode), "padding" in $ && t(9, x = $.padding), "type" in $ && t(20, M = $.type), "test_id" in $ && t(10, m = $.test_id), "explicit_call" in $ && t(11, l = $.explicit_call), "container" in $ && t(12, u = $.container), "visible" in $ && t(13, p = $.visible), "allow_overflow" in $ && t(14, g = $.allow_overflow), "overflow_behavior" in $ && t(15, b = $.overflow_behavior), "scale" in $ && t(16, c = $.scale), "min_width" in $ && t(17, _ = $.min_width), "flex" in $ && t(0, E = $.flex), "$$scope" in $ && t(21, a = $.$$scope); + "height" in $ && t(1, s = $.height), "min_height" in $ && t(2, h = $.min_height), "max_height" in $ && t(3, o = $.max_height), "width" in $ && t(4, d = $.width), "elem_id" in $ && t(5, _ = $.elem_id), "elem_classes" in $ && t(6, f = $.elem_classes), "variant" in $ && t(7, y = $.variant), "border_mode" in $ && t(8, A = $.border_mode), "padding" in $ && t(9, x = $.padding), "type" in $ && t(20, M = $.type), "test_id" in $ && t(10, m = $.test_id), "explicit_call" in $ && t(11, l = $.explicit_call), "container" in $ && t(12, u = $.container), "visible" in $ && t(13, p = $.visible), "allow_overflow" in $ && t(14, g = $.allow_overflow), "overflow_behavior" in $ && t(15, b = $.overflow_behavior), "scale" in $ && t(16, c = $.scale), "min_width" in $ && t(17, v = $.min_width), "flex" in $ && t(0, E = $.flex), "$$scope" in $ && t(21, a = $.$$scope); }, [ E, s, h, o, d, - v, + _, f, y, A, @@ -378,7 +386,7 @@ function instance$f(n, e, t) { g, b, c, - _, + v, w, k, M, @@ -455,10 +463,10 @@ class ParseError { if (h && h.start <= h.end) { var o = h.lexer.input; a = h.start, s = h.end, a === o.length ? r += " at end of input: " : r += " at position " + (a + 1) + ": "; - var d = o.slice(a, s).replace(/[^]/g, "$&̲"), v; - a > 15 ? v = "…" + o.slice(a - 15, a) : v = o.slice(0, a); + var d = o.slice(a, s).replace(/[^]/g, "$&̲"), _; + a > 15 ? _ = "…" + o.slice(a - 15, a) : _ = o.slice(0, a); var f; - s + 15 < o.length ? f = o.slice(s, s + 15) + "…" : f = o.slice(s), r += v + d + f; + s + 15 < o.length ? f = o.slice(s, s + 15) + "…" : f = o.slice(s), r += _ + d + f; } var y = new Error(r); return y.name = "ParseError", y.__proto__ = ParseError.prototype, y.position = a, a != null && s != null && (y.length = s - a), y.rawMessage = e, y; @@ -3874,8 +3882,8 @@ var iCombinations = { class SymbolNode { constructor(e, t, r, a, s, h, o, d) { this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = e, this.height = t || 0, this.depth = r || 0, this.italic = a || 0, this.skew = s || 0, this.width = h || 0, this.classes = o || [], this.style = d || {}, this.maxFontSize = 0; - var v = scriptFromCodepoint(this.text.charCodeAt(0)); - v && this.classes.push(v + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]); + var _ = scriptFromCodepoint(this.text.charCodeAt(0)); + _ && this.classes.push(_ + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]); } hasClass(e) { return utils.contains(this.classes, e); @@ -4729,8 +4737,8 @@ var wideLatinLetterData = [ e = h.value; var d; if (o) { - var v = o.italic; - (r === "text" || a && a.font === "mathit") && (v = 0), d = new SymbolNode(e, o.height, o.depth, v, o.skew, o.width, s); + var _ = o.italic; + (r === "text" || a && a.font === "mathit") && (_ = 0), d = new SymbolNode(e, o.height, o.depth, _, o.skew, o.width, s); } else typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + r + "'")), d = new SymbolNode(e, 0, 0, 0, 0, 0, s); if (a) { @@ -4750,9 +4758,9 @@ var wideLatinLetterData = [ fontClass: "mathbf" }; }, makeOrd = function(e, t, r) { - var a = e.mode, s = e.text, h = ["mord"], o = a === "math" || a === "text" && t.font, d = o ? t.font : t.fontFamily, v = "", f = ""; - if (s.charCodeAt(0) === 55349 && ([v, f] = wideCharacterFont(s, a)), v.length > 0) - return makeSymbol(s, v, a, t, h.concat(f)); + var a = e.mode, s = e.text, h = ["mord"], o = a === "math" || a === "text" && t.font, d = o ? t.font : t.fontFamily, _ = "", f = ""; + if (s.charCodeAt(0) === 55349 && ([_, f] = wideCharacterFont(s, a)), _.length > 0) + return makeSymbol(s, _, a, t, h.concat(f)); if (d) { var y, A; if (d === "boldsymbol") { @@ -4838,29 +4846,29 @@ var wideLatinLetterData = [ depth: a }; } - var v; + var _; if (e.positionType === "top") { for (var f = e.positionData, y = 0; y < e.children.length; y++) { var A = e.children[y]; f -= A.type === "kern" ? A.size : A.elem.height + A.elem.depth; } - v = f; + _ = f; } else if (e.positionType === "bottom") - v = -e.positionData; + _ = -e.positionData; else { var x = e.children[0]; if (x.type !== "elem") throw new Error('First child must have type "elem".'); if (e.positionType === "shift") - v = -x.elem.depth - e.positionData; + _ = -x.elem.depth - e.positionData; else if (e.positionType === "firstBaseline") - v = -x.elem.depth; + _ = -x.elem.depth; else throw new Error("Invalid positionType " + e.positionType + "."); } return { children: e.children, - depth: v + depth: _ }; }, makeVList = function(e, t) { for (var { @@ -4874,14 +4882,14 @@ var wideLatinLetterData = [ } } s += 2; - var v = makeSpan$2(["pstrut"], []); - v.style.height = makeEm(s); + var _ = makeSpan$2(["pstrut"], []); + _.style.height = makeEm(s); for (var f = [], y = a, A = a, x = a, M = 0; M < r.length; M++) { var m = r[M]; if (m.type === "kern") x += m.size; else { - var l = m.elem, u = m.wrapperClasses || [], p = m.wrapperStyle || {}, g = makeSpan$2(u, [v, l], void 0, p); + var l = m.elem, u = m.wrapperClasses || [], p = m.wrapperStyle || {}, g = makeSpan$2(u, [_, l], void 0, p); g.style.top = makeEm(-s - x - l.depth), m.marginLeft && (g.style.marginLeft = m.marginLeft), m.marginRight && (g.style.marginRight = m.marginRight), f.push(g), x += l.height + l.depth; } y = Math.min(y, x), A = Math.max(A, x); @@ -4890,7 +4898,7 @@ var wideLatinLetterData = [ b.style.height = makeEm(A); var c; if (y < 0) { - var _ = makeSpan$2([], []), E = makeSpan$2(["vlist"], [_]); + var v = makeSpan$2([], []), E = makeSpan$2(["vlist"], [v]); E.style.height = makeEm(-y); var w = makeSpan$2(["vlist-s"], [new SymbolNode("​")]); c = [makeSpan$2(["vlist-r"], [b, w]), makeSpan$2(["vlist-r"], [E])]; @@ -5156,10 +5164,10 @@ var normalizeArgument = function(e) { } if (buildCommon.tryCombineChars(s), !r) return s; - var v = t; + var _ = t; if (e.length === 1) { var f = e[0]; - f.type === "sizing" ? v = t.havingSize(f.size) : f.type === "styling" && (v = t.havingStyle(styleMap$1[f.style])); + f.type === "sizing" ? _ = t.havingSize(f.size) : f.type === "styling" && (_ = t.havingStyle(styleMap$1[f.style])); } var y = makeSpan$1([a[0] || "leftmost"], [], t), A = makeSpan$1([a[1] || "rightmost"], [], t), x = r === "root"; return traverseNonSpaceNodes(s, (M, m) => { @@ -5170,7 +5178,7 @@ var normalizeArgument = function(e) { }, A, x), traverseNonSpaceNodes(s, (M, m) => { var l = getTypeOfDomTree(m), u = getTypeOfDomTree(M), p = l && u ? M.hasClass("mtight") ? tightSpacings[l][u] : spacings[l][u] : null; if (p) - return buildCommon.makeGlue(p, v); + return buildCommon.makeGlue(p, _); }, { node: y }, A, x), s; @@ -5182,12 +5190,12 @@ var normalizeArgument = function(e) { n(d.children, t, r, null, s); continue; } - var v = !o.hasClass("mspace"); - if (v) { + var _ = !o.hasClass("mspace"); + if (_) { var f = t(o, r.node); f && (r.insertAfter ? r.insertAfter(f) : (e.unshift(f), h++)); } - v ? r.node = o : s && o.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((y) => (A) => { + _ ? r.node = o : s && o.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((y) => (A) => { e.splice(y + 1, 0, A), h++; })(h); } @@ -5241,11 +5249,11 @@ function buildHTML(n, e) { d || (s.push(buildHTMLUnbreakable(h, e)), h = []); } else r[o].hasClass("newline") && (h.pop(), h.length > 0 && (s.push(buildHTMLUnbreakable(h, e)), h = []), s.push(r[o])); h.length > 0 && s.push(buildHTMLUnbreakable(h, e)); - var v; - t ? (v = buildHTMLUnbreakable(buildExpression$1(t, e, !0)), v.classes = ["tag"], s.push(v)) : a && s.push(a); + var _; + t ? (_ = buildHTMLUnbreakable(buildExpression$1(t, e, !0)), _.classes = ["tag"], s.push(_)) : a && s.push(a); var f = makeSpan$1(["katex-html"], s); - if (f.setAttribute("aria-hidden", "true"), v) { - var y = v.children[0]; + if (f.setAttribute("aria-hidden", "true"), _) { + var y = _.children[0]; y.style.height = makeEm(f.height + f.depth), f.depth && (y.style.verticalAlign = makeEm(-f.depth)); } return f; @@ -5416,8 +5424,8 @@ var mathMLTree = { h.children.push(...d.children); continue; } else if (d.type === "mi" && d.children.length === 1 && h.type === "mn") { - var v = d.children[0]; - if (v instanceof TextNode && v.text === ".") { + var _ = d.children[0]; + if (_ instanceof TextNode && _.text === ".") { h.children.push(...d.children); continue; } @@ -5448,10 +5456,10 @@ function buildMathML(n, e, t, r, a) { s.length === 1 && s[0] instanceof MathNode && utils.contains(["mrow", "mtable"], s[0].type) ? h = s[0] : h = new mathMLTree.MathNode("mrow", s); var o = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(e)]); o.setAttribute("encoding", "application/x-tex"); - var d = new mathMLTree.MathNode("semantics", [h, o]), v = new mathMLTree.MathNode("math", [d]); - v.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && v.setAttribute("display", "block"); + var d = new mathMLTree.MathNode("semantics", [h, o]), _ = new mathMLTree.MathNode("math", [d]); + _.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && _.setAttribute("display", "block"); var f = a ? "katex" : "katex-mathml"; - return buildCommon.makeSpan([f], [v]); + return buildCommon.makeSpan([f], [_]); } var optionsFromSettings = function(e) { return new Options({ @@ -5581,7 +5589,7 @@ var optionsFromSettings = function(e) { function r() { var o = 4e5, d = e.label.slice(1); if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], d)) { - var v = e, f = groupLength(v.base), y, A, x; + var _ = e, f = groupLength(_.base), y, A, x; if (f > 5) d === "widehat" || d === "widecheck" ? (y = 420, o = 2364, x = 0.42, A = d + "4") : (y = 312, o = 2340, x = 0.34, A = "tilde4"); else { @@ -5600,7 +5608,7 @@ var optionsFromSettings = function(e) { height: x }; } else { - var u = [], p = katexImagesData[d], [g, b, c] = p, _ = c / 1e3, E = g.length, w, k; + var u = [], p = katexImagesData[d], [g, b, c] = p, v = c / 1e3, E = g.length, w, k; if (E === 1) { var $ = p[3]; w = ["hide-tail"], k = [$]; @@ -5612,24 +5620,24 @@ var optionsFromSettings = function(e) { throw new Error(`Correct katexImagesData or update code here to support ` + E + " children."); for (var L = 0; L < E; L++) { - var z = new PathNode(g[L]), F = new SvgNode([z], { + var I = new PathNode(g[L]), F = new SvgNode([I], { width: "400em", - height: makeEm(_), + height: makeEm(v), viewBox: "0 0 " + o + " " + c, preserveAspectRatio: k[L] + " slice" - }), R = buildCommon.makeSvgSpan([w[L]], [F], t); + }), P = buildCommon.makeSvgSpan([w[L]], [F], t); if (E === 1) return { - span: R, + span: P, minWidth: b, - height: _ + height: v }; - R.style.height = makeEm(_), u.push(R); + P.style.height = makeEm(v), u.push(P); } return { span: buildCommon.makeSpan(["stretchy"], u, t), minWidth: b, - height: _ + height: v }; } } @@ -5647,21 +5655,21 @@ var optionsFromSettings = function(e) { d && (h.style.borderColor = d); } } else { - var v = []; - /^[bx]cancel$/.test(t) && v.push(new LineNode({ + var _ = []; + /^[bx]cancel$/.test(t) && _.push(new LineNode({ x1: "0", y1: "0", x2: "100%", y2: "100%", "stroke-width": "0.046em" - })), /^x?cancel$/.test(t) && v.push(new LineNode({ + })), /^x?cancel$/.test(t) && _.push(new LineNode({ x1: "0", y1: "100%", x2: "100%", y2: "0", "stroke-width": "0.046em" })); - var f = new SvgNode(v, { + var f = new SvgNode(_, { width: "100%", height: makeEm(o) }); @@ -5692,8 +5700,8 @@ var htmlBuilder$a = (n, e) => { n && n.type === "supsub" ? (r = assertNodeType(n.base, "accent"), t = r.base, n.base = t, a = assertSpan(buildGroup$1(n, e)), n.base = r) : (r = assertNodeType(n, "accent"), t = r.base); var s = buildGroup$1(t, e.havingCrampedStyle()), h = r.isShifty && utils.isCharacterBox(t), o = 0; if (h) { - var d = utils.getBaseElem(t), v = buildGroup$1(d, e.havingCrampedStyle()); - o = assertSymbolDomNode(v).skew; + var d = utils.getBaseElem(t), _ = buildGroup$1(d, e.havingCrampedStyle()); + o = assertSymbolDomNode(_).skew; } var f = r.label === "\\c", y = f ? s.height + s.depth : Math.min(s.height, e.fontMetrics().xHeight), A; if (r.isStretchy) @@ -5886,8 +5894,8 @@ defineFunction({ a.classes.push(s + "-arrow-pad"); var h; n.below && (r = e.havingStyle(t.sub()), h = buildCommon.wrapFragment(buildGroup$1(n.below, r, e), e), h.classes.push(s + "-arrow-pad")); - var o = stretchy.svgSpan(n, e), d = -e.fontMetrics().axisHeight + 0.5 * o.height, v = -e.fontMetrics().axisHeight - 0.5 * o.height - 0.111; - (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (v -= a.depth); + var o = stretchy.svgSpan(n, e), d = -e.fontMetrics().axisHeight + 0.5 * o.height, _ = -e.fontMetrics().axisHeight - 0.5 * o.height - 0.111; + (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (_ -= a.depth); var f; if (h) { var y = -e.fontMetrics().axisHeight + h.height + 0.5 * o.height + 0.111; @@ -5896,7 +5904,7 @@ defineFunction({ children: [{ type: "elem", elem: a, - shift: v + shift: _ }, { type: "elem", elem: o, @@ -5913,7 +5921,7 @@ defineFunction({ children: [{ type: "elem", elem: a, - shift: v + shift: _ }, { type: "elem", elem: o, @@ -6100,12 +6108,12 @@ function cdArrow(n, e, t) { case "\\\\cdlongequal": return t.callFunction("\\\\cdlongequal", [], []); case "\\Vert": { - var v = { + var _ = { type: "textord", text: "\\Vert", mode: "math" }; - return t.callFunction("\\Big", [v], []); + return t.callFunction("\\Big", [_], []); } default: return { @@ -6134,7 +6142,7 @@ function parseCD(n) { o.body.push(h[d]); else { r.push(o), d += 1; - var v = assertSymbolNodeType(h[d]).text, f = new Array(2); + var _ = assertSymbolNodeType(h[d]).text, f = new Array(2); if (f[0] = { type: "ordgroup", mode: "math", @@ -6143,23 +6151,23 @@ function parseCD(n) { type: "ordgroup", mode: "math", body: [] - }, !("=|.".indexOf(v) > -1)) if ("<>AV".indexOf(v) > -1) + }, !("=|.".indexOf(_) > -1)) if ("<>AV".indexOf(_) > -1) for (var y = 0; y < 2; y++) { for (var A = !0, x = d + 1; x < h.length; x++) { - if (isLabelEnd(h[x], v)) { + if (isLabelEnd(h[x], _)) { A = !1, d = x; break; } if (isStartOfArrow(h[x])) - throw new ParseError("Missing a " + v + " character to complete a CD arrow.", h[x]); + throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[x]); f[y].body.push(h[x]); } if (A) - throw new ParseError("Missing a " + v + " character to complete a CD arrow.", h[d]); + throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[d]); } else throw new ParseError('Expected one of "<>AV=|." after @', h[d]); - var M = cdArrow(v, f, n), m = { + var M = cdArrow(_, f, n), m = { type: "styling", body: [M], mode: "math", @@ -6256,15 +6264,15 @@ defineFunction({ var o = assertNodeType(a[h], "textord"); s += o.text; } - var d = parseInt(s), v; + var d = parseInt(s), _; if (isNaN(d)) throw new ParseError("\\@char has non-numeric argument " + s); if (d < 0 || d >= 1114111) throw new ParseError("\\@char with invalid code point " + s); - return d <= 65535 ? v = String.fromCharCode(d) : (d -= 65536, v = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), { + return d <= 65535 ? _ = String.fromCharCode(d) : (d -= 65536, _ = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), { type: "textord", mode: t.mode, - text: v + text: _ }; } }); @@ -6539,44 +6547,44 @@ var getMetrics = function(e, t, r) { type: "kern", size: -1 * lapInEms }, verts = ["|", "\\lvert", "\\rvert", "\\vert"], doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"], makeStackedDelim = function(e, t, r, a, s, h) { - var o, d, v, f, y = "", A = 0; - o = v = f = e, d = null; + var o, d, _, f, y = "", A = 0; + o = _ = f = e, d = null; var x = "Size1-Regular"; - e === "\\uparrow" ? v = f = "⏐" : e === "\\Uparrow" ? v = f = "‖" : e === "\\downarrow" ? o = v = "⏐" : e === "\\Downarrow" ? o = v = "‖" : e === "\\updownarrow" ? (o = "\\uparrow", v = "⏐", f = "\\downarrow") : e === "\\Updownarrow" ? (o = "\\Uparrow", v = "‖", f = "\\Downarrow") : utils.contains(verts, e) ? (v = "∣", y = "vert", A = 333) : utils.contains(doubleVerts, e) ? (v = "∥", y = "doublevert", A = 556) : e === "[" || e === "\\lbrack" ? (o = "⎡", v = "⎢", f = "⎣", x = "Size4-Regular", y = "lbrack", A = 667) : e === "]" || e === "\\rbrack" ? (o = "⎤", v = "⎥", f = "⎦", x = "Size4-Regular", y = "rbrack", A = 667) : e === "\\lfloor" || e === "⌊" ? (v = o = "⎢", f = "⎣", x = "Size4-Regular", y = "lfloor", A = 667) : e === "\\lceil" || e === "⌈" ? (o = "⎡", v = f = "⎢", x = "Size4-Regular", y = "lceil", A = 667) : e === "\\rfloor" || e === "⌋" ? (v = o = "⎥", f = "⎦", x = "Size4-Regular", y = "rfloor", A = 667) : e === "\\rceil" || e === "⌉" ? (o = "⎤", v = f = "⎥", x = "Size4-Regular", y = "rceil", A = 667) : e === "(" || e === "\\lparen" ? (o = "⎛", v = "⎜", f = "⎝", x = "Size4-Regular", y = "lparen", A = 875) : e === ")" || e === "\\rparen" ? (o = "⎞", v = "⎟", f = "⎠", x = "Size4-Regular", y = "rparen", A = 875) : e === "\\{" || e === "\\lbrace" ? (o = "⎧", d = "⎨", f = "⎩", v = "⎪", x = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (o = "⎫", d = "⎬", f = "⎭", v = "⎪", x = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (o = "⎧", f = "⎩", v = "⎪", x = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (o = "⎫", f = "⎭", v = "⎪", x = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (o = "⎧", f = "⎭", v = "⎪", x = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (o = "⎫", f = "⎩", v = "⎪", x = "Size4-Regular"); - var M = getMetrics(o, x, s), m = M.height + M.depth, l = getMetrics(v, x, s), u = l.height + l.depth, p = getMetrics(f, x, s), g = p.height + p.depth, b = 0, c = 1; + e === "\\uparrow" ? _ = f = "⏐" : e === "\\Uparrow" ? _ = f = "‖" : e === "\\downarrow" ? o = _ = "⏐" : e === "\\Downarrow" ? o = _ = "‖" : e === "\\updownarrow" ? (o = "\\uparrow", _ = "⏐", f = "\\downarrow") : e === "\\Updownarrow" ? (o = "\\Uparrow", _ = "‖", f = "\\Downarrow") : utils.contains(verts, e) ? (_ = "∣", y = "vert", A = 333) : utils.contains(doubleVerts, e) ? (_ = "∥", y = "doublevert", A = 556) : e === "[" || e === "\\lbrack" ? (o = "⎡", _ = "⎢", f = "⎣", x = "Size4-Regular", y = "lbrack", A = 667) : e === "]" || e === "\\rbrack" ? (o = "⎤", _ = "⎥", f = "⎦", x = "Size4-Regular", y = "rbrack", A = 667) : e === "\\lfloor" || e === "⌊" ? (_ = o = "⎢", f = "⎣", x = "Size4-Regular", y = "lfloor", A = 667) : e === "\\lceil" || e === "⌈" ? (o = "⎡", _ = f = "⎢", x = "Size4-Regular", y = "lceil", A = 667) : e === "\\rfloor" || e === "⌋" ? (_ = o = "⎥", f = "⎦", x = "Size4-Regular", y = "rfloor", A = 667) : e === "\\rceil" || e === "⌉" ? (o = "⎤", _ = f = "⎥", x = "Size4-Regular", y = "rceil", A = 667) : e === "(" || e === "\\lparen" ? (o = "⎛", _ = "⎜", f = "⎝", x = "Size4-Regular", y = "lparen", A = 875) : e === ")" || e === "\\rparen" ? (o = "⎞", _ = "⎟", f = "⎠", x = "Size4-Regular", y = "rparen", A = 875) : e === "\\{" || e === "\\lbrace" ? (o = "⎧", d = "⎨", f = "⎩", _ = "⎪", x = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (o = "⎫", d = "⎬", f = "⎭", _ = "⎪", x = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (o = "⎧", f = "⎩", _ = "⎪", x = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (o = "⎫", f = "⎭", _ = "⎪", x = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (o = "⎧", f = "⎭", _ = "⎪", x = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (o = "⎫", f = "⎩", _ = "⎪", x = "Size4-Regular"); + var M = getMetrics(o, x, s), m = M.height + M.depth, l = getMetrics(_, x, s), u = l.height + l.depth, p = getMetrics(f, x, s), g = p.height + p.depth, b = 0, c = 1; if (d !== null) { - var _ = getMetrics(d, x, s); - b = _.height + _.depth, c = 2; + var v = getMetrics(d, x, s); + b = v.height + v.depth, c = 2; } var E = m + g + b, w = Math.max(0, Math.ceil((t - E) / (c * u))), k = E + w * c * u, $ = a.fontMetrics().axisHeight; r && ($ *= a.sizeMultiplier); - var L = k / 2 - $, z = []; + var L = k / 2 - $, I = []; if (y.length > 0) { - var F = k - m - g, R = Math.round(k * 1e3), P = tallDelim(y, Math.round(F * 1e3)), U = new PathNode(y, P), N = (A / 1e3).toFixed(3) + "em", B = (R / 1e3).toFixed(3) + "em", W = new SvgNode([U], { - width: N, - height: B, - viewBox: "0 0 " + A + " " + R - }), V = buildCommon.makeSvgSpan([], [W], a); - V.height = R / 1e3, V.style.width = N, V.style.height = B, z.push({ + var F = k - m - g, P = Math.round(k * 1e3), B = tallDelim(y, Math.round(F * 1e3)), G = new PathNode(y, B), U = (A / 1e3).toFixed(3) + "em", R = (P / 1e3).toFixed(3) + "em", W = new SvgNode([G], { + width: U, + height: R, + viewBox: "0 0 " + A + " " + P + }), H = buildCommon.makeSvgSpan([], [W], a); + H.height = P / 1e3, H.style.width = U, H.style.height = R, I.push({ type: "elem", - elem: V + elem: H }); } else { - if (z.push(makeGlyphSpan(f, x, s)), z.push(lap), d === null) { - var G = k - m - g + 2 * lapInEms; - z.push(makeInner(v, G, a)); + if (I.push(makeGlyphSpan(f, x, s)), I.push(lap), d === null) { + var N = k - m - g + 2 * lapInEms; + I.push(makeInner(_, N, a)); } else { - var H = (k - m - g - b) / 2 + 2 * lapInEms; - z.push(makeInner(v, H, a)), z.push(lap), z.push(makeGlyphSpan(d, x, s)), z.push(lap), z.push(makeInner(v, H, a)); + var V = (k - m - g - b) / 2 + 2 * lapInEms; + I.push(makeInner(_, V, a)), I.push(lap), I.push(makeGlyphSpan(d, x, s)), I.push(lap), I.push(makeInner(_, V, a)); } - z.push(lap), z.push(makeGlyphSpan(o, x, s)); + I.push(lap), I.push(makeGlyphSpan(o, x, s)); } - var Q = a.havingBaseStyle(Style$1.TEXT), te = buildCommon.makeVList({ + var J = a.havingBaseStyle(Style$1.TEXT), re = buildCommon.makeVList({ positionType: "bottom", positionData: L, - children: z - }, Q); - return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [te], Q), Style$1.TEXT, a, h); + children: I + }, J); + return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [re], J), Style$1.TEXT, a, h); }, vbPad = 80, emPad = 0.08, sqrtSvg = function(e, t, r, a, s) { var h = sqrtPath(e, a, r), o = new PathNode(e, h), d = new SvgNode([o], { // Note: 1000:1 ratio of viewBox to document em width. @@ -6587,8 +6595,8 @@ var getMetrics = function(e, t, r) { }); return buildCommon.makeSvgSpan(["hide-tail"], [d], s); }, makeSqrtImage = function(e, t) { - var r = t.havingBaseSizing(), a = traverseSequence("\\surd", e * r.sizeMultiplier, stackLargeDelimiterSequence, r), s = r.sizeMultiplier, h = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), o, d = 0, v = 0, f = 0, y; - return a.type === "small" ? (f = 1e3 + 1e3 * h + vbPad, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), d = (1 + h + emPad) / s, v = (1 + h) / s, o = sqrtSvg("sqrtMain", d, f, h, t), o.style.minWidth = "0.853em", y = 0.833 / s) : a.type === "large" ? (f = (1e3 + vbPad) * sizeToMaxHeight[a.size], v = (sizeToMaxHeight[a.size] + h) / s, d = (sizeToMaxHeight[a.size] + h + emPad) / s, o = sqrtSvg("sqrtSize" + a.size, d, f, h, t), o.style.minWidth = "1.02em", y = 1 / s) : (d = e + h + emPad, v = e + h, f = Math.floor(1e3 * e + h) + vbPad, o = sqrtSvg("sqrtTall", d, f, h, t), o.style.minWidth = "0.742em", y = 1.056), o.height = v, o.style.height = makeEm(d), { + var r = t.havingBaseSizing(), a = traverseSequence("\\surd", e * r.sizeMultiplier, stackLargeDelimiterSequence, r), s = r.sizeMultiplier, h = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), o, d = 0, _ = 0, f = 0, y; + return a.type === "small" ? (f = 1e3 + 1e3 * h + vbPad, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), d = (1 + h + emPad) / s, _ = (1 + h) / s, o = sqrtSvg("sqrtMain", d, f, h, t), o.style.minWidth = "0.853em", y = 0.833 / s) : a.type === "large" ? (f = (1e3 + vbPad) * sizeToMaxHeight[a.size], _ = (sizeToMaxHeight[a.size] + h) / s, d = (sizeToMaxHeight[a.size] + h + emPad) / s, o = sqrtSvg("sqrtSize" + a.size, d, f, h, t), o.style.minWidth = "1.02em", y = 1 / s) : (d = e + h + emPad, _ = e + h, f = Math.floor(1e3 * e + h) + vbPad, o = sqrtSvg("sqrtTall", d, f, h, t), o.style.minWidth = "0.742em", y = 1.056), o.height = _, o.style.height = makeEm(d), { span: o, advanceWidth: y, // Calculate the actual line width. @@ -6670,8 +6678,8 @@ var getMetrics = function(e, t, r) { for (var s = Math.min(2, 3 - a.style.size), h = s; h < r.length && r[h].type !== "stack"; h++) { var o = getMetrics(e, delimTypeToFont(r[h]), "math"), d = o.height + o.depth; if (r[h].type === "small") { - var v = a.havingBaseStyle(r[h].style); - d *= v.sizeMultiplier; + var _ = a.havingBaseStyle(r[h].style); + d *= _.sizeMultiplier; } if (d > t) return r[h]; @@ -6684,7 +6692,7 @@ var getMetrics = function(e, t, r) { var d = traverseSequence(e, t, o, a); return d.type === "small" ? makeSmallDelim(e, d.style, r, a, s, h) : d.type === "large" ? makeLargeDelim(e, d.size, r, a, s, h) : makeStackedDelim(e, t, r, a, s, h); }, makeLeftRightDelim = function(e, t, r, a, s, h) { - var o = a.fontMetrics().axisHeight * a.sizeMultiplier, d = 901, v = 5 / a.fontMetrics().ptPerEm, f = Math.max(t - o, r + o), y = Math.max( + var o = a.fontMetrics().axisHeight * a.sizeMultiplier, d = 901, _ = 5 / a.fontMetrics().ptPerEm, f = Math.max(t - o, r + o), y = Math.max( // In real TeX, calculations are done using integral values which are // 65536 per pt, or 655360 per em. So, the division here truncates in // TeX but doesn't here, producing different results. If we wanted to @@ -6695,7 +6703,7 @@ var getMetrics = function(e, t, r) { // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} // in TeX and KaTeX) f / 500 * d, - 2 * f - v + 2 * f - _ ); return makeCustomSizedDelim(e, y, !0, a, s, h); }, delimiter = { @@ -6857,7 +6865,7 @@ defineFunction({ var o; if (n.left === "." ? o = makeNullDelimiter(e, ["mopen"]) : o = delimiter.leftRightDelim(n.left, r, a, e, n.mode, ["mopen"]), t.unshift(o), s) for (var d = 1; d < t.length; d++) { - var v = t[d], f = v.isMiddle; + var _ = t[d], f = _.isMiddle; f && (t[d] = delimiter.leftRightDelim(f.delim, r, a, f.options, n.mode, [])); } var y; @@ -6927,12 +6935,12 @@ var htmlBuilder$7 = (n, e) => { var d = calculateSize({ number: 0.6, unit: "pt" - }, e), v = calculateSize({ + }, e), _ = calculateSize({ number: 0.35, unit: "ex" }, e), f = e.havingBaseSizing(); a = a / f.sizeMultiplier; - var y = t.height + t.depth + d + v; + var y = t.height + t.depth + d + _; t.style.paddingLeft = makeEm(y / 2 + d); var A = Math.floor(1e3 * y * a), x = phasePath(A), M = new SvgNode([new PathNode("phase", x)], { width: "400em", @@ -6940,7 +6948,7 @@ var htmlBuilder$7 = (n, e) => { viewBox: "0 0 400000 " + A, preserveAspectRatio: "xMinYMin slice" }); - s = buildCommon.makeSvgSpan(["hide-tail"], [M], e), s.style.height = makeEm(y), h = t.depth + d + v; + s = buildCommon.makeSvgSpan(["hide-tail"], [M], e), s.style.height = makeEm(y), h = t.depth + d + _; } else { /cancel/.test(r) ? o || t.classes.push("cancel-pad") : r === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad"); var m = 0, l = 0, u = 0; @@ -7187,12 +7195,12 @@ function parseArray(n, e, t) { arraystretch: h, colSeparationType: o, autoTag: d, - singleRow: v, + singleRow: _, emptySingleRow: f, maxNumCols: y, leqno: A } = e; - if (n.gullet.beginGroup(), v || n.gullet.macros.set("\\cr", "\\\\\\relax"), !h) { + if (n.gullet.beginGroup(), _ || n.gullet.macros.set("\\cr", "\\\\\\relax"), !h) { var x = n.gullet.expandMacroAsText("\\arraystretch"); if (x == null) h = 1; @@ -7208,7 +7216,7 @@ function parseArray(n, e, t) { p && (n.gullet.macros.get("\\df@tag") ? (p.push(n.subparse([new Token("\\df@tag")])), n.gullet.macros.set("\\df@tag", void 0, !0)) : p.push(!!d && n.gullet.macros.get("\\@eqnsw") === "1")); } for (g(), u.push(getHLines(n)); ; ) { - var c = n.parseExpression(!1, v ? "\\end" : "\\\\"); + var c = n.parseExpression(!1, _ ? "\\end" : "\\\\"); n.gullet.endGroup(), n.gullet.beginGroup(), c = { type: "ordgroup", mode: n.mode, @@ -7219,18 +7227,18 @@ function parseArray(n, e, t) { style: t, body: [c] }), M.push(c); - var _ = n.fetch().text; - if (_ === "&") { + var v = n.fetch().text; + if (v === "&") { if (y && M.length === y) { - if (v || o) + if (_ || o) throw new ParseError("Too many tab characters: &", n.nextToken); n.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); } n.consume(); - } else if (_ === "\\end") { + } else if (v === "\\end") { b(), M.length === 1 && c.type === "styling" && c.body[0].body.length === 0 && (m.length > 1 || !f) && m.pop(), u.length < m.length + 1 && u.push([]); break; - } else if (_ === "\\\\") { + } else if (v === "\\\\") { n.consume(); var E = void 0; n.gullet.future().text !== " " && (E = n.parseSizeGroup(!0)), l.push(E ? E.value : null), b(), u.push(getHLines(n)), M = [], m.push(M), g(); @@ -7256,7 +7264,7 @@ function dCellStyle(n) { return n.slice(0, 1) === "d" ? "display" : "text"; } var htmlBuilder$6 = function(e, t) { - var r, a, s = e.body.length, h = e.hLinesBeforeRow, o = 0, d = new Array(s), v = [], f = Math.max( + var r, a, s = e.body.length, h = e.hLinesBeforeRow, o = 0, d = new Array(s), _ = [], f = Math.max( // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. t.fontMetrics().arrayRuleWidth, t.minRuleThickness @@ -7270,109 +7278,109 @@ var htmlBuilder$6 = function(e, t) { number: 3, unit: "ex" }, t) : 12 * y, m = 3 * y, l = e.arraystretch * M, u = 0.7 * l, p = 0.3 * l, g = 0; - function b(Be) { - for (var Ue = 0; Ue < Be.length; ++Ue) - Ue > 0 && (g += 0.25), v.push({ + function b(Pe) { + for (var Ne = 0; Ne < Pe.length; ++Ne) + Ne > 0 && (g += 0.25), _.push({ pos: g, - isDashed: Be[Ue] + isDashed: Pe[Ne] }); } for (b(h[0]), r = 0; r < e.body.length; ++r) { - var c = e.body[r], _ = u, E = p; + var c = e.body[r], v = u, E = p; o < c.length && (o = c.length); var w = new Array(c.length); for (a = 0; a < c.length; ++a) { var k = buildGroup$1(c[a], t); - E < k.depth && (E = k.depth), _ < k.height && (_ = k.height), w[a] = k; + E < k.depth && (E = k.depth), v < k.height && (v = k.height), w[a] = k; } var $ = e.rowGaps[r], L = 0; - $ && (L = calculateSize($, t), L > 0 && (L += p, E < L && (E = L), L = 0)), e.addJot && (E += m), w.height = _, w.depth = E, g += _, w.pos = g, g += E + L, d[r] = w, b(h[r + 1]); + $ && (L = calculateSize($, t), L > 0 && (L += p, E < L && (E = L), L = 0)), e.addJot && (E += m), w.height = v, w.depth = E, g += v, w.pos = g, g += E + L, d[r] = w, b(h[r + 1]); } - var z = g / 2 + t.fontMetrics().axisHeight, F = e.cols || [], R = [], P, U, N = []; - if (e.tags && e.tags.some((Be) => Be)) + var I = g / 2 + t.fontMetrics().axisHeight, F = e.cols || [], P = [], B, G, U = []; + if (e.tags && e.tags.some((Pe) => Pe)) for (r = 0; r < s; ++r) { - var B = d[r], W = B.pos - z, V = e.tags[r], G = void 0; - V === !0 ? G = buildCommon.makeSpan(["eqn-num"], [], t) : V === !1 ? G = buildCommon.makeSpan([], [], t) : G = buildCommon.makeSpan([], buildExpression$1(V, t, !0), t), G.depth = B.depth, G.height = B.height, N.push({ + var R = d[r], W = R.pos - I, H = e.tags[r], N = void 0; + H === !0 ? N = buildCommon.makeSpan(["eqn-num"], [], t) : H === !1 ? N = buildCommon.makeSpan([], [], t) : N = buildCommon.makeSpan([], buildExpression$1(H, t, !0), t), N.depth = R.depth, N.height = R.height, U.push({ type: "elem", - elem: G, + elem: N, shift: W }); } for ( - a = 0, U = 0; + a = 0, G = 0; // Continue while either there are more columns or more column // descriptions, so trailing separators don't get lost. - a < o || U < F.length; - ++a, ++U + a < o || G < F.length; + ++a, ++G ) { - for (var H = F[U] || {}, Q = !0; H.type === "separator"; ) { - if (Q || (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(t.fontMetrics().doubleRuleSep), R.push(P)), H.separator === "|" || H.separator === ":") { - var te = H.separator === "|" ? "solid" : "dashed", ee = buildCommon.makeSpan(["vertical-separator"], [], t); - ee.style.height = makeEm(g), ee.style.borderRightWidth = makeEm(f), ee.style.borderRightStyle = te, ee.style.margin = "0 " + makeEm(-f / 2); - var ce = g - z; - ce && (ee.style.verticalAlign = makeEm(-ce)), R.push(ee); + for (var V = F[G] || {}, J = !0; V.type === "separator"; ) { + if (J || (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(t.fontMetrics().doubleRuleSep), P.push(B)), V.separator === "|" || V.separator === ":") { + var re = V.separator === "|" ? "solid" : "dashed", te = buildCommon.makeSpan(["vertical-separator"], [], t); + te.style.height = makeEm(g), te.style.borderRightWidth = makeEm(f), te.style.borderRightStyle = re, te.style.margin = "0 " + makeEm(-f / 2); + var ue = g - I; + ue && (te.style.verticalAlign = makeEm(-ue)), P.push(te); } else - throw new ParseError("Invalid separator type: " + H.separator); - U++, H = F[U] || {}, Q = !1; + throw new ParseError("Invalid separator type: " + V.separator); + G++, V = F[G] || {}, J = !1; } if (!(a >= o)) { - var fe = void 0; - (a > 0 || e.hskipBeforeAndAfter) && (fe = utils.deflt(H.pregap, A), fe !== 0 && (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(fe), R.push(P))); - var oe = []; + var ie = void 0; + (a > 0 || e.hskipBeforeAndAfter) && (ie = utils.deflt(V.pregap, A), ie !== 0 && (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(ie), P.push(B))); + var ae = []; for (r = 0; r < s; ++r) { - var he = d[r], Ae = he[a]; - if (Ae) { - var Se = he.pos - z; - Ae.depth = he.depth, Ae.height = he.height, oe.push({ + var ce = d[r], Me = ce[a]; + if (Me) { + var Ae = ce.pos - I; + Me.depth = ce.depth, Me.height = ce.height, ae.push({ type: "elem", - elem: Ae, - shift: Se + elem: Me, + shift: Ae }); } } - oe = buildCommon.makeVList({ + ae = buildCommon.makeVList({ positionType: "individualShift", - children: oe - }, t), oe = buildCommon.makeSpan(["col-align-" + (H.align || "c")], [oe]), R.push(oe), (a < o - 1 || e.hskipBeforeAndAfter) && (fe = utils.deflt(H.postgap, A), fe !== 0 && (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(fe), R.push(P))); + children: ae + }, t), ae = buildCommon.makeSpan(["col-align-" + (V.align || "c")], [ae]), P.push(ae), (a < o - 1 || e.hskipBeforeAndAfter) && (ie = utils.deflt(V.postgap, A), ie !== 0 && (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(ie), P.push(B))); } } - if (d = buildCommon.makeSpan(["mtable"], R), v.length > 0) { - for (var Ie = buildCommon.makeLineSpan("hline", t, f), pe = buildCommon.makeLineSpan("hdashline", t, f), le = [{ + if (d = buildCommon.makeSpan(["mtable"], P), _.length > 0) { + for (var Ie = buildCommon.makeLineSpan("hline", t, f), pe = buildCommon.makeLineSpan("hdashline", t, f), se = [{ type: "elem", elem: d, shift: 0 - }]; v.length > 0; ) { - var ne = v.pop(), Te = ne.pos - z; - ne.isDashed ? le.push({ + }]; _.length > 0; ) { + var Q = _.pop(), ye = Q.pos - I; + Q.isDashed ? se.push({ type: "elem", elem: pe, - shift: Te - }) : le.push({ + shift: ye + }) : se.push({ type: "elem", elem: Ie, - shift: Te + shift: ye }); } d = buildCommon.makeVList({ positionType: "individualShift", - children: le + children: se }, t); } - if (N.length === 0) + if (U.length === 0) return buildCommon.makeSpan(["mord"], [d], t); - var Oe = buildCommon.makeVList({ + var ke = buildCommon.makeVList({ positionType: "individualShift", - children: N + children: U }, t); - return Oe = buildCommon.makeSpan(["tag"], [Oe], t), buildCommon.makeFragment([d, Oe]); + return ke = buildCommon.makeSpan(["tag"], [ke], t), buildCommon.makeFragment([d, ke]); }, alignMap = { c: "center ", l: "left ", r: "right " }, mathmlBuilder$5 = function(e, t) { for (var r = [], a = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), s = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), h = 0; h < e.body.length; h++) { - for (var o = e.body[h], d = [], v = 0; v < o.length; v++) - d.push(new mathMLTree.MathNode("mtd", [buildGroup(o[v], t)])); + for (var o = e.body[h], d = [], _ = 0; _ < o.length; _++) + d.push(new mathMLTree.MathNode("mtd", [buildGroup(o[_], t)])); e.tags && e.tags[h] && (d.unshift(a), d.push(a), e.leqno ? d.unshift(s) : d.push(s)), r.push(new mathMLTree.MathNode("mtr", d)); } var f = new mathMLTree.MathNode("mtable", r), y = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0); @@ -7386,8 +7394,8 @@ var htmlBuilder$6 = function(e, t) { f.setAttribute("columnalign", x.trim()), /[sd]/.test(m) && f.setAttribute("columnlines", m.trim()); } if (e.colSeparationType === "align") { - for (var b = e.cols || [], c = "", _ = 1; _ < b.length; _++) - c += _ % 2 ? "0em " : "1em "; + for (var b = e.cols || [], c = "", v = 1; v < b.length; v++) + c += v % 2 ? "0em " : "1em "; f.setAttribute("columnspacing", c.trim()); } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? f.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? f.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? f.setAttribute("columnspacing", "0.5em") : f.setAttribute("columnspacing", "1em"); var E = "", w = e.hLinesBeforeRow; @@ -7405,7 +7413,7 @@ var htmlBuilder$6 = function(e, t) { colSeparationType: a, maxNumCols: s ? 2 : void 0, leqno: e.parser.settings.leqno - }, "display"), o, d = 0, v = { + }, "display"), o, d = 0, _ = { type: "ordgroup", mode: e.mode, body: [] @@ -7421,7 +7429,7 @@ var htmlBuilder$6 = function(e, t) { h.body.forEach(function(u) { for (var p = 1; p < u.length; p += 2) { var g = assertNodeType(u[p], "styling"), b = assertNodeType(g.body[0], "ordgroup"); - b.body.unshift(v); + b.body.unshift(_); } if (x) d < u.length && (d = u.length); @@ -7723,12 +7731,12 @@ defineFunction({ throw new ParseError("No such environment: " + s, a); var o = environments[s], { args: d, - optArgs: v + optArgs: _ } = t.parseArguments("\\begin{" + s + "}", o), f = { mode: t.mode, envName: s, parser: t - }, y = o.handler(f, d, v); + }, y = o.handler(f, d, _); t.expect("\\end", !1); var A = t.nextToken, x = assertNodeType(t.parseFunction(), "environment"); if (x.name !== s) @@ -7859,20 +7867,20 @@ var adjustStyle = (n, e) => { h.height = h.height < o ? o : h.height, h.depth = h.depth < d ? d : h.depth; } s = e.havingStyle(a); - var v = buildGroup$1(n.denom, s, e), f, y, A; + var _ = buildGroup$1(n.denom, s, e), f, y, A; n.hasBarLine ? (n.barSize ? (y = calculateSize(n.barSize, e), f = buildCommon.makeLineSpan("frac-line", e, y)) : f = buildCommon.makeLineSpan("frac-line", e), y = f.height, A = f.height) : (f = null, y = 0, A = e.fontMetrics().defaultRuleThickness); var x, M, m; t.size === Style$1.DISPLAY.size || n.size === "display" ? (x = e.fontMetrics().num1, y > 0 ? M = 3 * A : M = 7 * A, m = e.fontMetrics().denom1) : (y > 0 ? (x = e.fontMetrics().num2, M = A) : (x = e.fontMetrics().num3, M = 3 * A), m = e.fontMetrics().denom2); var l; if (f) { var p = e.fontMetrics().axisHeight; - x - h.depth - (p + 0.5 * y) < M && (x += M - (x - h.depth - (p + 0.5 * y))), p - 0.5 * y - (v.height - m) < M && (m += M - (p - 0.5 * y - (v.height - m))); + x - h.depth - (p + 0.5 * y) < M && (x += M - (x - h.depth - (p + 0.5 * y))), p - 0.5 * y - (_.height - m) < M && (m += M - (p - 0.5 * y - (_.height - m))); var g = -(p - 0.5 * y); l = buildCommon.makeVList({ positionType: "individualShift", children: [{ type: "elem", - elem: v, + elem: _, shift: m }, { type: "elem", @@ -7885,12 +7893,12 @@ var adjustStyle = (n, e) => { }] }, e); } else { - var u = x - h.depth - (v.height - m); + var u = x - h.depth - (_.height - m); u < M && (x += 0.5 * (M - u), m += 0.5 * (M - u)), l = buildCommon.makeVList({ positionType: "individualShift", children: [{ type: "elem", - elem: v, + elem: _, shift: m }, { type: "elem", @@ -7902,8 +7910,8 @@ var adjustStyle = (n, e) => { s = e.havingStyle(t), l.height *= s.sizeMultiplier / e.sizeMultiplier, l.depth *= s.sizeMultiplier / e.sizeMultiplier; var b; t.size === Style$1.DISPLAY.size ? b = e.fontMetrics().delim1 : t.size === Style$1.SCRIPTSCRIPT.size ? b = e.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : b = e.fontMetrics().delim2; - var c, _; - return n.leftDelim == null ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.customSizedDelim(n.leftDelim, b, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? _ = buildCommon.makeSpan([]) : n.rightDelim == null ? _ = makeNullDelimiter(e, ["mclose"]) : _ = delimiter.customSizedDelim(n.rightDelim, b, !0, e.havingStyle(t), n.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(s.sizingClasses(e)), [c, buildCommon.makeSpan(["mfrac"], [l]), _], e); + var c, v; + return n.leftDelim == null ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.customSizedDelim(n.leftDelim, b, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? v = buildCommon.makeSpan([]) : n.rightDelim == null ? v = makeNullDelimiter(e, ["mclose"]) : v = delimiter.customSizedDelim(n.rightDelim, b, !0, e.havingStyle(t), n.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(s.sizingClasses(e)), [c, buildCommon.makeSpan(["mfrac"], [l]), v], e); }, mathmlBuilder$3 = (n, e) => { var t = new mathMLTree.MathNode("mfrac", [buildGroup(n.numer, e), buildGroup(n.denom, e)]); if (!n.hasBarLine) @@ -7955,7 +7963,7 @@ defineFunction({ var { parser: t, funcName: r - } = n, a = e[0], s = e[1], h, o = null, d = null, v = "auto"; + } = n, a = e[0], s = e[1], h, o = null, d = null, _ = "auto"; switch (r) { case "\\dfrac": case "\\frac": @@ -7982,11 +7990,11 @@ defineFunction({ switch (r) { case "\\dfrac": case "\\dbinom": - v = "display"; + _ = "display"; break; case "\\tfrac": case "\\tbinom": - v = "text"; + _ = "text"; break; } return { @@ -7998,7 +8006,7 @@ defineFunction({ hasBarLine: h, leftDelim: o, rightDelim: d, - size: v, + size: _, barSize: null }; }, @@ -8085,8 +8093,8 @@ defineFunction({ handler(n, e) { var { parser: t - } = n, r = e[4], a = e[5], s = normalizeArgument(e[0]), h = s.type === "atom" && s.family === "open" ? delimFromValue(s.text) : null, o = normalizeArgument(e[1]), d = o.type === "atom" && o.family === "close" ? delimFromValue(o.text) : null, v = assertNodeType(e[2], "size"), f, y = null; - v.isBlank ? f = !0 : (y = v.value, f = y.number > 0); + } = n, r = e[4], a = e[5], s = normalizeArgument(e[0]), h = s.type === "atom" && s.family === "open" ? delimFromValue(s.text) : null, o = normalizeArgument(e[1]), d = o.type === "atom" && o.family === "close" ? delimFromValue(o.text) : null, _ = assertNodeType(e[2], "size"), f, y = null; + _.isBlank ? f = !0 : (y = _.value, f = y.number > 0); var A = "auto", x = e[3]; if (x.type === "ordgroup") { if (x.body.length > 0) { @@ -8380,8 +8388,8 @@ defineFunction({ }; break; case "\\htmlData": { - for (var v = s.split(","), f = 0; f < v.length; f++) { - var y = v[f].split("="); + for (var _ = s.split(","), f = 0; f < _.length; f++) { + var y = _[f].split("="); if (y.length !== 2) throw new ParseError("Error parsing key-value for \\htmlData"); d["data-" + y[0].trim()] = y[1].trim(); @@ -8477,8 +8485,8 @@ defineFunction({ unit: "em" }, o = ""; if (t[0]) - for (var d = assertNodeType(t[0], "raw").string, v = d.split(","), f = 0; f < v.length; f++) { - var y = v[f].split("="); + for (var d = assertNodeType(t[0], "raw").string, _ = d.split(","), f = 0; f < _.length; f++) { + var y = _[f].split("="); if (y.length === 2) { var A = y[1].trim(); switch (y[0].trim()) { @@ -8683,10 +8691,10 @@ defineFunction({ }); var assembleSupSub = (n, e, t, r, a, s, h) => { n = buildCommon.makeSpan([], [n]); - var o = t && utils.isCharacterBox(t), d, v; + var o = t && utils.isCharacterBox(t), d, _; if (e) { var f = buildGroup$1(e, r.havingStyle(a.sup()), r); - v = { + _ = { elem: f, kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - f.depth) }; @@ -8699,7 +8707,7 @@ var assembleSupSub = (n, e, t, r, a, s, h) => { }; } var A; - if (v && d) { + if (_ && d) { var x = r.fontMetrics().bigOpSpacing5 + d.elem.height + d.elem.depth + d.kern + n.depth + h; A = buildCommon.makeVList({ positionType: "bottom", @@ -8719,10 +8727,10 @@ var assembleSupSub = (n, e, t, r, a, s, h) => { elem: n }, { type: "kern", - size: v.kern + size: _.kern }, { type: "elem", - elem: v.elem, + elem: _.elem, marginLeft: makeEm(s) }, { type: "kern", @@ -8749,7 +8757,7 @@ var assembleSupSub = (n, e, t, r, a, s, h) => { elem: n }] }, r); - } else if (v) { + } else if (_) { var m = n.depth + h; A = buildCommon.makeVList({ positionType: "bottom", @@ -8759,10 +8767,10 @@ var assembleSupSub = (n, e, t, r, a, s, h) => { elem: n }, { type: "kern", - size: v.kern + size: _.kern }, { type: "elem", - elem: v.elem, + elem: _.elem, marginLeft: makeEm(s) }, { type: "kern", @@ -8784,8 +8792,8 @@ var assembleSupSub = (n, e, t, r, a, s, h) => { h.size === Style$1.DISPLAY.size && s.symbol && !utils.contains(noSuccessor, s.name) && (o = !0); var d; if (s.symbol) { - var v = o ? "Size2-Regular" : "Size1-Regular", f = ""; - if ((s.name === "\\oiint" || s.name === "\\oiiint") && (f = s.name.slice(1), s.name = f === "oiint" ? "\\iint" : "\\iiint"), d = buildCommon.makeSymbol(s.name, v, "math", e, ["mop", "op-symbol", o ? "large-op" : "small-op"]), f.length > 0) { + var _ = o ? "Size2-Regular" : "Size1-Regular", f = ""; + if ((s.name === "\\oiint" || s.name === "\\oiiint") && (f = s.name.slice(1), s.name = f === "oiint" ? "\\iint" : "\\iiint"), d = buildCommon.makeSymbol(s.name, _, "math", e, ["mop", "op-symbol", o ? "large-op" : "small-op"]), f.length > 0) { var y = d.italic, A = buildCommon.staticSvg(f + "Size" + (o ? "2" : "1"), e); d = buildCommon.makeVList({ positionType: "individualShift", @@ -8971,8 +8979,8 @@ var htmlBuilder$1 = (n, e) => { mode: y.mode, text: A } : y; - }), d = buildExpression$1(o, e.withFont("mathrm"), !0), v = 0; v < d.length; v++) { - var f = d[v]; + }), d = buildExpression$1(o, e.withFont("mathrm"), !0), _ = 0; _ < d.length; _++) { + var f = d[_]; f instanceof SymbolNode && (f.text = f.text.replace(/\u2212/, "-").replace(/\u2217/, "*")); } h = buildCommon.makeSpan(["mop"], d, e); @@ -9007,8 +9015,8 @@ var htmlBuilder$1 = (n, e) => { } var d = new mathMLTree.MathNode("mi", t); d.setAttribute("mathvariant", "normal"); - var v = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]); - return n.parentIsSupSub ? new mathMLTree.MathNode("mrow", [d, v]) : mathMLTree.newDocumentFragment([d, v]); + var _ = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]); + return n.parentIsSupSub ? new mathMLTree.MathNode("mrow", [d, _]) : mathMLTree.newDocumentFragment([d, _]); }; defineFunction({ type: "operatorname", @@ -9307,8 +9315,8 @@ defineFunction({ } = n, a = !1, s = !1, h = t[0] && assertNodeType(t[0], "ordgroup"); if (h) for (var o = "", d = 0; d < h.body.length; ++d) { - var v = h.body[d]; - if (o = v.text, o === "t") + var _ = h.body[d]; + if (o = _.text, o === "t") a = !0; else if (o === "b") s = !0; @@ -9377,11 +9385,11 @@ defineFunction({ e.style.id < Style$1.TEXT.id && (s = e.fontMetrics().xHeight); var h = a + s / 4, o = t.height + t.depth + h + a, { span: d, - ruleWidth: v, + ruleWidth: _, advanceWidth: f - } = delimiter.sqrtImage(o, e), y = d.height - v; + } = delimiter.sqrtImage(o, e), y = d.height - _; y > t.height + t.depth + h && (h = (h + y - t.height - t.depth) / 2); - var A = d.height - t.height - h - v; + var A = d.height - t.height - h - _; t.style.paddingLeft = makeEm(f); var x = buildCommon.makeVList({ positionType: "firstBaseline", @@ -9397,7 +9405,7 @@ defineFunction({ elem: d }, { type: "kern", - size: v + size: _ }] }, e); if (n.index) { @@ -9494,7 +9502,7 @@ defineFunctionBuilders({ base: r, sup: a, sub: s - } = n, h = buildGroup$1(r, e), o, d, v = e.fontMetrics(), f = 0, y = 0, A = r && utils.isCharacterBox(r); + } = n, h = buildGroup$1(r, e), o, d, _ = e.fontMetrics(), f = 0, y = 0, A = r && utils.isCharacterBox(r); if (a) { var x = e.havingStyle(e.style.sup()); o = buildGroup$1(a, x, e), A || (f = h.height - x.fontMetrics().supDrop * x.sizeMultiplier / e.sizeMultiplier); @@ -9504,19 +9512,19 @@ defineFunctionBuilders({ d = buildGroup$1(s, M, e), A || (y = h.depth + M.fontMetrics().subDrop * M.sizeMultiplier / e.sizeMultiplier); } var m; - e.style === Style$1.DISPLAY ? m = v.sup1 : e.style.cramped ? m = v.sup3 : m = v.sup2; - var l = e.sizeMultiplier, u = makeEm(0.5 / v.ptPerEm / l), p = null; + e.style === Style$1.DISPLAY ? m = _.sup1 : e.style.cramped ? m = _.sup3 : m = _.sup2; + var l = e.sizeMultiplier, u = makeEm(0.5 / _.ptPerEm / l), p = null; if (d) { var g = n.base && n.base.type === "op" && n.base.name && (n.base.name === "\\oiint" || n.base.name === "\\oiiint"); (h instanceof SymbolNode || g) && (p = makeEm(-h.italic)); } var b; if (o && d) { - f = Math.max(f, m, o.depth + 0.25 * v.xHeight), y = Math.max(y, v.sub2); - var c = v.defaultRuleThickness, _ = 4 * c; - if (f - o.depth - (d.height - y) < _) { - y = _ - (f - o.depth) + d.height; - var E = 0.8 * v.xHeight - (f - o.depth); + f = Math.max(f, m, o.depth + 0.25 * _.xHeight), y = Math.max(y, _.sub2); + var c = _.defaultRuleThickness, v = 4 * c; + if (f - o.depth - (d.height - y) < v) { + y = v - (f - o.depth) + d.height; + var E = 0.8 * _.xHeight - (f - o.depth); E > 0 && (f += E, y -= E); } var w = [{ @@ -9536,7 +9544,7 @@ defineFunctionBuilders({ children: w }, e); } else if (d) { - y = Math.max(y, v.sub1, d.height - 0.8 * v.xHeight); + y = Math.max(y, _.sub1, d.height - 0.8 * _.xHeight); var k = [{ type: "elem", elem: d, @@ -9549,7 +9557,7 @@ defineFunctionBuilders({ children: k }, e); } else if (o) - f = Math.max(f, m, o.depth + 0.25 * v.xHeight), b = buildCommon.makeVList({ + f = Math.max(f, m, o.depth + 0.25 * _.xHeight), b = buildCommon.makeVList({ positionType: "shift", positionData: -f, children: [{ @@ -9573,8 +9581,8 @@ defineFunctionBuilders({ h = r ? "mover" : "munder"; else if (n.sub) if (n.sup) { - var v = n.base; - v && v.type === "op" && v.limits && e.style === Style$1.DISPLAY || v && v.type === "operatorname" && v.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || v.limits) ? h = "munderover" : h = "msubsup"; + var _ = n.base; + _ && _.type === "op" && _.limits && e.style === Style$1.DISPLAY || _ && _.type === "operatorname" && _.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || _.limits) ? h = "munderover" : h = "msubsup"; } else { var d = n.base; d && d.type === "op" && d.limits && (e.style === Style$1.DISPLAY || d.alwaysHandleSupSub) || d && d.type === "operatorname" && d.alwaysHandleSupSub && (d.limits || e.style === Style$1.DISPLAY) ? h = "munder" : h = "msub"; @@ -10468,9 +10476,9 @@ var braketHelper = (n) => (e) => { }; }; e.macros.set("|", d(!1)), a.length && e.macros.set("\\|", d(!0)); - var v = e.consumeArg().tokens, f = e.expandTokens([ + var _ = e.consumeArg().tokens, f = e.expandTokens([ ...s, - ...v, + ..._, ...t // reversed ]); @@ -10817,8 +10825,8 @@ class MacroExpander { if (a.indexOf("#") !== -1) for (var h = a.replace(/##/g, ""); h.indexOf("#" + (s + 1)) !== -1; ) ++s; - for (var o = new Lexer(a, this.settings), d = [], v = o.lex(); v.text !== "EOF"; ) - d.push(v), v = o.lex(); + for (var o = new Lexer(a, this.settings), d = [], _ = o.lex(); _.text !== "EOF"; ) + d.push(_), _ = o.lex(); d.reverse(); var f = { tokens: d, @@ -11447,8 +11455,8 @@ class Parser { mode: this.mode, body: d }; - var v; - return r === "\\\\abovefrac" ? v = this.callFunction(r, [s, e[t], h], []) : v = this.callFunction(r, [s, h], []), [v]; + var _; + return r === "\\\\abovefrac" ? _ = this.callFunction(r, [s, e[t], h], []) : _ = this.callFunction(r, [s, h], []), [_]; } else return e; } @@ -11529,15 +11537,15 @@ class Parser { body: d }; } else if (uSubsAndSups[s.text]) { - var v = unicodeSubRegEx.test(s.text), f = []; + var _ = unicodeSubRegEx.test(s.text), f = []; for (f.push(new Token(uSubsAndSups[s.text])), this.consume(); ; ) { var y = this.fetch().text; - if (!uSubsAndSups[y] || unicodeSubRegEx.test(y) !== v) + if (!uSubsAndSups[y] || unicodeSubRegEx.test(y) !== _) break; f.unshift(new Token(uSubsAndSups[y])), this.consume(); } var A = this.subparse(f); - v ? a = { + _ ? a = { type: "ordgroup", mode: "math", body: A @@ -11604,11 +11612,11 @@ class Parser { var o = t.argTypes && t.argTypes[h], d = h < t.numOptionalArgs; (t.primitive && o == null || // \sqrt expands into primitive if optional argument doesn't exist t.type === "sqrt" && h === 1 && s[0] == null) && (o = "primitive"); - var v = this.parseGroupOfType("argument to '" + e + "'", o, d); + var _ = this.parseGroupOfType("argument to '" + e + "'", o, d); if (d) - s.push(v); - else if (v != null) - a.push(v); + s.push(_); + else if (_ != null) + a.push(_); else throw new ParseError("Null argument, please report this as a bug"); } @@ -11858,10 +11866,10 @@ class Parser { var h; if (symbols[this.mode][t]) { this.settings.strict && this.mode === "math" && extraLatin.indexOf(t) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e); - var o = symbols[this.mode][t].group, d = SourceLocation.range(e), v; + var o = symbols[this.mode][t].group, d = SourceLocation.range(e), _; if (ATOMS.hasOwnProperty(o)) { var f = o; - v = { + _ = { type: "atom", mode: this.mode, family: f, @@ -11869,13 +11877,13 @@ class Parser { text: t }; } else - v = { + _ = { type: o, mode: this.mode, loc: d, text: t }; - h = v; + h = _; } else if (t.charCodeAt(0) >= 128) this.settings.strict && (supportedCodepoint(t.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + t[0] + '"' + (" (" + t.charCodeAt(0) + ")"), e)), h = { type: "textord", @@ -12055,12 +12063,12 @@ var renderToString = function(e, t) { }, escapeRegex = function(e) { return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); }, amsRegex = /^\\begin{/, splitAtDelimiters = function(e, t) { - for (var r, a = [], s = new RegExp("(" + t.map((v) => escapeRegex(v.left)).join("|") + ")"); r = e.search(s), r !== -1; ) { + for (var r, a = [], s = new RegExp("(" + t.map((_) => escapeRegex(_.left)).join("|") + ")"); r = e.search(s), r !== -1; ) { r > 0 && (a.push({ type: "text", data: e.slice(0, r) }), e = e.slice(r)); - var h = t.findIndex((v) => e.startsWith(v.left)); + var h = t.findIndex((_) => e.startsWith(_.left)); if (r = findEndOfMath(t[h].right, e, t[h].left.length), r === -1) break; var o = e.slice(0, r + t[h].right.length), d = amsRegex.test(o) ? o : e.slice(t[h].left.length, r); @@ -12104,7 +12112,7 @@ var renderToString = function(e, t) { s += h.textContent, h = h.nextSibling, o++; var d = renderMathInText(s, t); if (d) { - for (var v = 0; v < o; v++) + for (var _ = 0; _ < o; _++) a.nextSibling.remove(); r += d.childNodes.length - 1, e.replaceChild(d, a); } else @@ -12228,8 +12236,8 @@ function cleanUrl(n) { const noopTest = { exec: () => null }; function splitCells(n, e) { const t = n.replace(/\|/g, (s, h, o) => { - let d = !1, v = h; - for (; --v >= 0 && o[v] === "\\"; ) + let d = !1, _ = h; + for (; --_ >= 0 && o[_] === "\\"; ) d = !d; return d ? "|" : " |"; }), r = t.split(/ \|/); @@ -12311,12 +12319,12 @@ function indentCodeCompensation(n, e) { `); } class _Tokenizer { - options; - rules; - // set by the lexer - lexer; // set by the lexer constructor(e) { + Dt(this, "options"); + Dt(this, "rules"); + // set by the lexer + Dt(this, "lexer"); this.options = e || _defaults; } space(e) { @@ -12409,7 +12417,7 @@ class _Tokenizer { }; r = a ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = a ? r : "[*+-]"); const h = new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`); - let o = "", d = "", v = !1; + let o = "", d = "", _ = !1; for (; e; ) { let f = !1; if (!(t = h.exec(e)) || this.rules.block.hr.test(e)) @@ -12441,7 +12449,7 @@ class _Tokenizer { `, e = e.substring(c.length + 1), y = A.slice(x); } } - s.loose || (v ? s.loose = !0 : /\n *\n *$/.test(o) && (v = !0)); + s.loose || (_ ? s.loose = !0 : /\n *\n *$/.test(o) && (_ = !0)); let m = null, l; this.options.gfm && (m = /^\[[ xX]\] /.exec(d), m && (l = m[0] !== "[ ] ", d = d.replace(/^\[[ xX]\] +/, ""))), s.items.push({ type: "list_item", @@ -12622,21 +12630,21 @@ class _Tokenizer { return; if (!(a[1] || a[2] || "") || !r || this.rules.inline.punctuation.exec(r)) { const h = [...a[0]].length - 1; - let o, d, v = h, f = 0; + let o, d, _ = h, f = 0; const y = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; for (y.lastIndex = 0, t = t.slice(-1 * e.length + h); (a = y.exec(t)) != null; ) { if (o = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !o) continue; if (d = [...o].length, a[3] || a[4]) { - v += d; + _ += d; continue; } else if ((a[5] || a[6]) && h % 3 && !((h + d) % 3)) { f += d; continue; } - if (v -= d, v > 0) + if (_ -= d, _ > 0) continue; - d = Math.min(d, d + v + f); + d = Math.min(d, d + _ + f); const A = [...a[0]][0].length, x = e.slice(0, h + a.index + A + d); if (Math.min(h, d) % 2) { const m = x.slice(1, -1); @@ -12707,28 +12715,29 @@ class _Tokenizer { } } url(e) { + var r; let t; if (t = this.rules.inline.url.exec(e)) { - let r, a; + let a, s; if (t[2] === "@") - r = escape$1$1(t[0]), a = "mailto:" + r; + a = escape$1$1(t[0]), s = "mailto:" + a; else { - let s; + let h; do - s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? ""; - while (s !== t[0]); - r = escape$1$1(t[0]), t[1] === "www." ? a = "http://" + t[0] : a = t[0]; + h = t[0], t[0] = ((r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) ?? ""; + while (h !== t[0]); + a = escape$1$1(t[0]), t[1] === "www." ? s = "http://" + t[0] : s = t[0]; } return { type: "link", raw: t[0], - text: r, - href: a, + text: a, + href: s, tokens: [ { type: "text", - raw: r, - text: r + raw: a, + text: a } ] }; @@ -12821,12 +12830,12 @@ const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$)) pedantic: inlinePedantic }; class _Lexer { - tokens; - options; - state; - tokenizer; - inlineQueue; constructor(e) { + Dt(this, "tokens"); + Dt(this, "options"); + Dt(this, "state"); + Dt(this, "tokenizer"); + Dt(this, "inlineQueue"); this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || _defaults, this.options.tokenizer = this.options.tokenizer || new _Tokenizer(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, @@ -12872,7 +12881,7 @@ class _Lexer { return this.inlineQueue = [], this.tokens; } blockTokens(e, t = []) { - this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (o, d, v) => d + " ".repeat(v.length)); + this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (o, d, _) => d + " ".repeat(_.length)); let r, a, s, h; for (; e; ) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((o) => (r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) { @@ -12931,9 +12940,9 @@ class _Lexer { if (s = e, this.options.extensions && this.options.extensions.startBlock) { let o = 1 / 0; const d = e.slice(1); - let v; + let _; this.options.extensions.startBlock.forEach((f) => { - v = f.call({ lexer: this }, d), typeof v == "number" && v >= 0 && (o = Math.min(o, v)); + _ = f.call({ lexer: this }, d), typeof _ == "number" && _ >= 0 && (o = Math.min(o, _)); }), o < 1 / 0 && o >= 0 && (s = e.substring(0, o + 1)); } if (this.state.top && (r = this.tokenizer.paragraph(s))) { @@ -12966,7 +12975,7 @@ class _Lexer { * Lexing/Compiling */ inlineTokens(e, t = []) { - let r, a, s, h = e, o, d, v; + let r, a, s, h = e, o, d, _; if (this.tokens.links) { const f = Object.keys(this.tokens.links); if (f.length > 0) @@ -12978,7 +12987,7 @@ class _Lexer { for (; (o = this.tokenizer.rules.inline.anyPunctuation.exec(h)) != null; ) h = h.slice(0, o.index) + "++" + h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); for (; e; ) - if (d || (v = ""), d = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (r = f.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) { + if (d || (_ = ""), d = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (r = f.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) { if (r = this.tokenizer.escape(e)) { e = e.substring(r.raw.length), t.push(r); continue; @@ -12995,7 +13004,7 @@ class _Lexer { e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r); continue; } - if (r = this.tokenizer.emStrong(e, h, v)) { + if (r = this.tokenizer.emStrong(e, h, _)) { e = e.substring(r.raw.length), t.push(r); continue; } @@ -13028,7 +13037,7 @@ class _Lexer { }), f < 1 / 0 && f >= 0 && (s = e.substring(0, f + 1)); } if (r = this.tokenizer.inlineText(s)) { - e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (v = r.raw.slice(-1)), d = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r); + e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (_ = r.raw.slice(-1)), d = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r); continue; } if (e) { @@ -13044,12 +13053,13 @@ class _Lexer { } } class _Renderer { - options; constructor(e) { + Dt(this, "options"); this.options = e || _defaults; } code(e, t, r) { - const a = (t || "").match(/^\S*/)?.[0]; + var s; + const a = (s = (t || "").match(/^\S*/)) == null ? void 0 : s[0]; return e = e.replace(/\n$/, "") + ` `, a ? '
' + (r ? e : escape$1$1(e, !0)) + `
` : "
" + (r ? e : escape$1$1(e, !0)) + `
@@ -13174,10 +13184,10 @@ class _TextRenderer { } } class _Parser { - options; - renderer; - textRenderer; constructor(e) { + Dt(this, "options"); + Dt(this, "renderer"); + Dt(this, "textRenderer"); this.options = e || _defaults, this.options.renderer = this.options.renderer || new _Renderer(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new _TextRenderer(); } /** @@ -13229,15 +13239,15 @@ class _Parser { for (let f = 0; f < h.header.length; f++) d += this.renderer.tablecell(this.parseInline(h.header[f].tokens), { header: !0, align: h.align[f] }); o += this.renderer.tablerow(d); - let v = ""; + let _ = ""; for (let f = 0; f < h.rows.length; f++) { const y = h.rows[f]; d = ""; for (let A = 0; A < y.length; A++) d += this.renderer.tablecell(this.parseInline(y[A].tokens), { header: !1, align: h.align[A] }); - v += this.renderer.tablerow(d); + _ += this.renderer.tablerow(d); } - r += this.renderer.table(o, v); + r += this.renderer.table(o, _); continue; } case "blockquote": { @@ -13246,19 +13256,19 @@ class _Parser { continue; } case "list": { - const h = s, o = h.ordered, d = h.start, v = h.loose; + const h = s, o = h.ordered, d = h.start, _ = h.loose; let f = ""; for (let y = 0; y < h.items.length; y++) { const A = h.items[y], x = A.checked, M = A.task; let m = ""; if (A.task) { const l = this.renderer.checkbox(!!x); - v ? A.tokens.length > 0 && A.tokens[0].type === "paragraph" ? (A.tokens[0].text = l + " " + A.tokens[0].text, A.tokens[0].tokens && A.tokens[0].tokens.length > 0 && A.tokens[0].tokens[0].type === "text" && (A.tokens[0].tokens[0].text = l + " " + A.tokens[0].tokens[0].text)) : A.tokens.unshift({ + _ ? A.tokens.length > 0 && A.tokens[0].type === "paragraph" ? (A.tokens[0].text = l + " " + A.tokens[0].text, A.tokens[0].tokens && A.tokens[0].tokens.length > 0 && A.tokens[0].tokens[0].type === "text" && (A.tokens[0].tokens[0].text = l + " " + A.tokens[0].tokens[0].text)) : A.tokens.unshift({ type: "text", text: l + " " }) : m += l + " "; } - m += this.parse(A.tokens, v), f += this.renderer.listitem(m, M, !!x); + m += this.parse(A.tokens, _), f += this.renderer.listitem(m, M, !!x); } r += this.renderer.list(f, o, d); continue; @@ -13368,15 +13378,10 @@ class _Parser { } } class _Hooks { - options; constructor(e) { + Dt(this, "options"); this.options = e || _defaults; } - static passThroughHooks = /* @__PURE__ */ new Set([ - "preprocess", - "postprocess", - "processAllTokens" - ]); /** * Process markdown before marked */ @@ -13396,47 +13401,55 @@ class _Hooks { return e; } } +Dt(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([ + "preprocess", + "postprocess", + "processAllTokens" +])); +var ir, Jr, un; class Marked { - defaults = _getDefaults(); - options = this.setOptions; - parse = this.#e(_Lexer.lex, _Parser.parse); - parseInline = this.#e(_Lexer.lexInline, _Parser.parseInline); - Parser = _Parser; - Renderer = _Renderer; - TextRenderer = _TextRenderer; - Lexer = _Lexer; - Tokenizer = _Tokenizer; - Hooks = _Hooks; constructor(...e) { + cn(this, ir); + Dt(this, "defaults", _getDefaults()); + Dt(this, "options", this.setOptions); + Dt(this, "parse", zr(this, ir, Jr).call(this, _Lexer.lex, _Parser.parse)); + Dt(this, "parseInline", zr(this, ir, Jr).call(this, _Lexer.lexInline, _Parser.parseInline)); + Dt(this, "Parser", _Parser); + Dt(this, "Renderer", _Renderer); + Dt(this, "TextRenderer", _TextRenderer); + Dt(this, "Lexer", _Lexer); + Dt(this, "Tokenizer", _Tokenizer); + Dt(this, "Hooks", _Hooks); this.use(...e); } /** * Run callback for every token */ walkTokens(e, t) { + var a, s; let r = []; - for (const a of e) - switch (r = r.concat(t.call(this, a)), a.type) { + for (const h of e) + switch (r = r.concat(t.call(this, h)), h.type) { case "table": { - const s = a; - for (const h of s.header) - r = r.concat(this.walkTokens(h.tokens, t)); - for (const h of s.rows) - for (const o of h) - r = r.concat(this.walkTokens(o.tokens, t)); + const o = h; + for (const d of o.header) + r = r.concat(this.walkTokens(d.tokens, t)); + for (const d of o.rows) + for (const _ of d) + r = r.concat(this.walkTokens(_.tokens, t)); break; } case "list": { - const s = a; - r = r.concat(this.walkTokens(s.items, t)); + const o = h; + r = r.concat(this.walkTokens(o.items, t)); break; } default: { - const s = a; - this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((h) => { - const o = s[h].flat(1 / 0); - r = r.concat(this.walkTokens(o, t)); - }) : s.tokens && (r = r.concat(this.walkTokens(s.tokens, t))); + const o = h; + (s = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && s[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((d) => { + const _ = o[d].flat(1 / 0); + r = r.concat(this.walkTokens(_, t)); + }) : o.tokens && (r = r.concat(this.walkTokens(o.tokens, t))); } } return r; @@ -13469,10 +13482,10 @@ class Marked { throw new Error(`renderer '${h}' does not exist`); if (h === "options") continue; - const o = h, d = r.renderer[o], v = s[o]; + const o = h, d = r.renderer[o], _ = s[o]; s[o] = (...f) => { let y = d.apply(s, f); - return y === !1 && (y = v.apply(s, f)), y || ""; + return y === !1 && (y = _.apply(s, f)), y || ""; }; } a.renderer = s; @@ -13484,10 +13497,10 @@ class Marked { throw new Error(`tokenizer '${h}' does not exist`); if (["options", "rules", "lexer"].includes(h)) continue; - const o = h, d = r.tokenizer[o], v = s[o]; + const o = h, d = r.tokenizer[o], _ = s[o]; s[o] = (...f) => { let y = d.apply(s, f); - return y === !1 && (y = v.apply(s, f)), y; + return y === !1 && (y = _.apply(s, f)), y; }; } a.tokenizer = s; @@ -13499,15 +13512,15 @@ class Marked { throw new Error(`hook '${h}' does not exist`); if (h === "options") continue; - const o = h, d = r.hooks[o], v = s[o]; + const o = h, d = r.hooks[o], _ = s[o]; _Hooks.passThroughHooks.has(h) ? s[o] = (f) => { if (this.defaults.async) - return Promise.resolve(d.call(s, f)).then((A) => v.call(s, A)); + return Promise.resolve(d.call(s, f)).then((A) => _.call(s, A)); const y = d.call(s, f); - return v.call(s, y); + return _.call(s, y); } : s[o] = (...f) => { let y = d.apply(s, f); - return y === !1 && (y = v.apply(s, f)), y; + return y === !1 && (y = _.apply(s, f)), y; }; } a.hooks = s; @@ -13531,41 +13544,40 @@ class Marked { parser(e, t) { return _Parser.parse(e, t ?? this.defaults); } - #e(e, t) { - return (r, a) => { - const s = { ...a }, h = { ...this.defaults, ...s }; - this.defaults.async === !0 && s.async === !1 && (h.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), h.async = !0); - const o = this.#t(!!h.silent, !!h.async); - if (typeof r > "u" || r === null) - return o(new Error("marked(): input parameter is undefined or null")); - if (typeof r != "string") - return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected")); - if (h.hooks && (h.hooks.options = h), h.async) - return Promise.resolve(h.hooks ? h.hooks.preprocess(r) : r).then((d) => e(d, h)).then((d) => h.hooks ? h.hooks.processAllTokens(d) : d).then((d) => h.walkTokens ? Promise.all(this.walkTokens(d, h.walkTokens)).then(() => d) : d).then((d) => t(d, h)).then((d) => h.hooks ? h.hooks.postprocess(d) : d).catch(o); - try { - h.hooks && (r = h.hooks.preprocess(r)); - let d = e(r, h); - h.hooks && (d = h.hooks.processAllTokens(d)), h.walkTokens && this.walkTokens(d, h.walkTokens); - let v = t(d, h); - return h.hooks && (v = h.hooks.postprocess(v)), v; - } catch (d) { - return o(d); - } - }; - } - #t(e, t) { - return (r) => { - if (r.message += ` -Please report this to https://github.com/markedjs/marked.`, e) { - const a = "

An error occurred:

" + escape$1$1(r.message + "", !0) + "
"; - return t ? Promise.resolve(a) : a; - } - if (t) - return Promise.reject(r); - throw r; - }; - } } +ir = new WeakSet(), Jr = function(e, t) { + return (r, a) => { + const s = { ...a }, h = { ...this.defaults, ...s }; + this.defaults.async === !0 && s.async === !1 && (h.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), h.async = !0); + const o = zr(this, ir, un).call(this, !!h.silent, !!h.async); + if (typeof r > "u" || r === null) + return o(new Error("marked(): input parameter is undefined or null")); + if (typeof r != "string") + return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected")); + if (h.hooks && (h.hooks.options = h), h.async) + return Promise.resolve(h.hooks ? h.hooks.preprocess(r) : r).then((d) => e(d, h)).then((d) => h.hooks ? h.hooks.processAllTokens(d) : d).then((d) => h.walkTokens ? Promise.all(this.walkTokens(d, h.walkTokens)).then(() => d) : d).then((d) => t(d, h)).then((d) => h.hooks ? h.hooks.postprocess(d) : d).catch(o); + try { + h.hooks && (r = h.hooks.preprocess(r)); + let d = e(r, h); + h.hooks && (d = h.hooks.processAllTokens(d)), h.walkTokens && this.walkTokens(d, h.walkTokens); + let _ = t(d, h); + return h.hooks && (_ = h.hooks.postprocess(_)), _; + } catch (d) { + return o(d); + } + }; +}, un = function(e, t) { + return (r) => { + if (r.message += ` +Please report this to https://github.com/markedjs/marked.`, e) { + const a = "

An error occurred:

" + escape$1$1(r.message + "", !0) + "
"; + return t ? Promise.resolve(a) : a; + } + if (t) + return Promise.reject(r); + throw r; + }; +}; const markedInstance = new Marked(); function marked(n, e) { return markedInstance.parse(n, e); @@ -13829,13 +13841,13 @@ var prism = { exports: {} }; */ clone: function p(g, b) { b = b || {}; - var c, _; + var c, v; switch (o.util.type(g)) { case "Object": - if (_ = o.util.objId(g), b[_]) - return b[_]; + if (v = o.util.objId(g), b[v]) + return b[v]; c = /** @type {Record} */ - {}, b[_] = c; + {}, b[v] = c; for (var E in g) g.hasOwnProperty(E) && (c[E] = p(g[E], b)); return ( @@ -13843,7 +13855,7 @@ var prism = { exports: {} }; c ); case "Array": - return _ = o.util.objId(g), b[_] ? b[_] : (c = [], b[_] = c, /** @type {Array} */ + return v = o.util.objId(g), b[v] ? b[v] : (c = [], b[v] = c, /** @type {Array} */ /** @type {any} */ g.forEach(function(w, k) { c[k] = p(w, b); @@ -13929,10 +13941,10 @@ var prism = { exports: {} }; */ isActive: function(p, g, b) { for (var c = "no-" + g; p; ) { - var _ = p.classList; - if (_.contains(g)) + var v = p.classList; + if (v.contains(g)) return !0; - if (_.contains(c)) + if (v.contains(c)) return !1; p = p.parentElement; } @@ -14066,28 +14078,28 @@ var prism = { exports: {} }; insertBefore: function(p, g, b, c) { c = c || /** @type {any} */ o.languages; - var _ = c[p], E = {}; - for (var w in _) - if (_.hasOwnProperty(w)) { + var v = c[p], E = {}; + for (var w in v) + if (v.hasOwnProperty(w)) { if (w == g) for (var k in b) b.hasOwnProperty(k) && (E[k] = b[k]); - b.hasOwnProperty(w) || (E[w] = _[w]); + b.hasOwnProperty(w) || (E[w] = v[w]); } var $ = c[p]; - return c[p] = E, o.languages.DFS(o.languages, function(L, z) { - z === $ && L != p && (this[L] = E); + return c[p] = E, o.languages.DFS(o.languages, function(L, I) { + I === $ && L != p && (this[L] = E); }), E; }, // Traverse a language definition with Depth First Search - DFS: function p(g, b, c, _) { - _ = _ || {}; + DFS: function p(g, b, c, v) { + v = v || {}; var E = o.util.objId; for (var w in g) if (g.hasOwnProperty(w)) { b.call(g, w, g[w], c || w); var k = g[w], $ = o.util.type(k); - $ === "Object" && !_[E(k)] ? (_[E(k)] = !0, p(k, b, null, _)) : $ === "Array" && !_[E(k)] && (_[E(k)] = !0, p(k, b, w, _)); + $ === "Object" && !v[E(k)] ? (v[E(k)] = !0, p(k, b, null, v)) : $ === "Array" && !v[E(k)] && (v[E(k)] = !0, p(k, b, w, v)); } } }, @@ -14129,7 +14141,7 @@ var prism = { exports: {} }; selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' }; o.hooks.run("before-highlightall", c), c.elements = Array.prototype.slice.apply(c.container.querySelectorAll(c.selector)), o.hooks.run("before-all-elements-highlight", c); - for (var _ = 0, E; E = c.elements[_++]; ) + for (var v = 0, E; E = c.elements[v++]; ) o.highlightElement(E, g === !0, c.callback); }, /** @@ -14161,18 +14173,18 @@ var prism = { exports: {} }; * @public */ highlightElement: function(p, g, b) { - var c = o.util.getLanguage(p), _ = o.languages[c]; + var c = o.util.getLanguage(p), v = o.languages[c]; o.util.setLanguage(p, c); var E = p.parentElement; E && E.nodeName.toLowerCase() === "pre" && o.util.setLanguage(E, c); var w = p.textContent, k = { element: p, language: c, - grammar: _, + grammar: v, code: w }; - function $(z) { - k.highlightedCode = z, o.hooks.run("before-insert", k), k.element.innerHTML = k.highlightedCode, o.hooks.run("after-highlight", k), o.hooks.run("complete", k), b && b.call(k.element); + function $(I) { + k.highlightedCode = I, o.hooks.run("before-insert", k), k.element.innerHTML = k.highlightedCode, o.hooks.run("after-highlight", k), o.hooks.run("complete", k), b && b.call(k.element); } if (o.hooks.run("before-sanity-check", k), E = k.element.parentElement, E && E.nodeName.toLowerCase() === "pre" && !E.hasAttribute("tabindex") && E.setAttribute("tabindex", "0"), !k.code) { o.hooks.run("complete", k), b && b.call(k.element); @@ -14184,8 +14196,8 @@ var prism = { exports: {} }; } if (g && r.Worker) { var L = new Worker(o.filename); - L.onmessage = function(z) { - $(z.data); + L.onmessage = function(I) { + $(I.data); }, L.postMessage(JSON.stringify({ language: k.language, code: k.code, @@ -14255,8 +14267,8 @@ var prism = { exports: {} }; g[c] = b[c]; delete g.rest; } - var _ = new y(); - return A(_, _.head, p), f(p, _, g, _.head, 0), M(_); + var v = new y(); + return A(v, v.head, p), f(p, v, g, v.head, 0), M(v); }, /** * @namespace @@ -14293,8 +14305,8 @@ var prism = { exports: {} }; run: function(p, g) { var b = o.hooks.all[p]; if (!(!b || !b.length)) - for (var c = 0, _; _ = b[c++]; ) - _(g); + for (var c = 0, v; v = b[c++]; ) + v(g); } }, Token: d @@ -14312,7 +14324,7 @@ var prism = { exports: {} }; c += p($, b); }), c; } - var _ = { + var v = { type: g.type, content: p(g.content, b), tag: "span", @@ -14320,22 +14332,22 @@ var prism = { exports: {} }; attributes: {}, language: b }, E = g.alias; - E && (Array.isArray(E) ? Array.prototype.push.apply(_.classes, E) : _.classes.push(E)), o.hooks.run("wrap", _); + E && (Array.isArray(E) ? Array.prototype.push.apply(v.classes, E) : v.classes.push(E)), o.hooks.run("wrap", v); var w = ""; - for (var k in _.attributes) - w += " " + k + '="' + (_.attributes[k] || "").replace(/"/g, """) + '"'; - return "<" + _.tag + ' class="' + _.classes.join(" ") + '"' + w + ">" + _.content + ""; + for (var k in v.attributes) + w += " " + k + '="' + (v.attributes[k] || "").replace(/"/g, """) + '"'; + return "<" + v.tag + ' class="' + v.classes.join(" ") + '"' + w + ">" + v.content + ""; }; - function v(p, g, b, c) { + function _(p, g, b, c) { p.lastIndex = g; - var _ = p.exec(b); - if (_ && c && _[1]) { - var E = _[1].length; - _.index += E, _[0] = _[0].slice(E); + var v = p.exec(b); + if (v && c && v[1]) { + var E = v[1].length; + v.index += E, v[0] = v[0].slice(E); } - return _; + return v; } - function f(p, g, b, c, _, E) { + function f(p, g, b, c, v, E) { for (var w in b) if (!(!b.hasOwnProperty(w) || !b[w])) { var k = b[w]; @@ -14343,41 +14355,41 @@ var prism = { exports: {} }; for (var $ = 0; $ < k.length; ++$) { if (E && E.cause == w + "," + $) return; - var L = k[$], z = L.inside, F = !!L.lookbehind, R = !!L.greedy, P = L.alias; - if (R && !L.pattern.global) { - var U = L.pattern.toString().match(/[imsuy]*$/)[0]; - L.pattern = RegExp(L.pattern.source, U + "g"); + var L = k[$], I = L.inside, F = !!L.lookbehind, P = !!L.greedy, B = L.alias; + if (P && !L.pattern.global) { + var G = L.pattern.toString().match(/[imsuy]*$/)[0]; + L.pattern = RegExp(L.pattern.source, G + "g"); } - for (var N = L.pattern || L, B = c.next, W = _; B !== g.tail && !(E && W >= E.reach); W += B.value.length, B = B.next) { - var V = B.value; + for (var U = L.pattern || L, R = c.next, W = v; R !== g.tail && !(E && W >= E.reach); W += R.value.length, R = R.next) { + var H = R.value; if (g.length > p.length) return; - if (!(V instanceof d)) { - var G = 1, H; - if (R) { - if (H = v(N, W, p, F), !H || H.index >= p.length) + if (!(H instanceof d)) { + var N = 1, V; + if (P) { + if (V = _(U, W, p, F), !V || V.index >= p.length) break; - var ce = H.index, Q = H.index + H[0].length, te = W; - for (te += B.value.length; ce >= te; ) - B = B.next, te += B.value.length; - if (te -= B.value.length, W = te, B.value instanceof d) + var ue = V.index, J = V.index + V[0].length, re = W; + for (re += R.value.length; ue >= re; ) + R = R.next, re += R.value.length; + if (re -= R.value.length, W = re, R.value instanceof d) continue; - for (var ee = B; ee !== g.tail && (te < Q || typeof ee.value == "string"); ee = ee.next) - G++, te += ee.value.length; - G--, V = p.slice(W, te), H.index -= W; - } else if (H = v(N, 0, V, F), !H) + for (var te = R; te !== g.tail && (re < J || typeof te.value == "string"); te = te.next) + N++, re += te.value.length; + N--, H = p.slice(W, re), V.index -= W; + } else if (V = _(U, 0, H, F), !V) continue; - var ce = H.index, fe = H[0], oe = V.slice(0, ce), he = V.slice(ce + fe.length), Ae = W + V.length; - E && Ae > E.reach && (E.reach = Ae); - var Se = B.prev; - oe && (Se = A(g, Se, oe), W += oe.length), x(g, Se, G); - var Ie = new d(w, z ? o.tokenize(fe, z) : fe, P, fe); - if (B = A(g, Se, Ie), he && A(g, B, he), G > 1) { + var ue = V.index, ie = V[0], ae = H.slice(0, ue), ce = H.slice(ue + ie.length), Me = W + H.length; + E && Me > E.reach && (E.reach = Me); + var Ae = R.prev; + ae && (Ae = A(g, Ae, ae), W += ae.length), x(g, Ae, N); + var Ie = new d(w, I ? o.tokenize(ie, I) : ie, B, ie); + if (R = A(g, Ae, Ie), ce && A(g, R, ce), N > 1) { var pe = { cause: w + "," + $, - reach: Ae + reach: Me }; - f(p, g, b, B.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach); + f(p, g, b, R.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach); } } } @@ -14389,13 +14401,13 @@ var prism = { exports: {} }; p.next = g, this.head = p, this.tail = g, this.length = 0; } function A(p, g, b) { - var c = g.next, _ = { value: b, prev: g, next: c }; - return g.next = _, c.prev = _, p.length++, _; + var c = g.next, v = { value: b, prev: g, next: c }; + return g.next = v, c.prev = v, p.length++, v; } function x(p, g, b) { - for (var c = g.next, _ = 0; _ < b && c !== p.tail; _++) + for (var c = g.next, v = 0; v < b && c !== p.tail; v++) c = c.next; - g.next = c, c.prev = g, p.length -= _; + g.next = c, c.prev = g, p.length -= v; } function M(p) { for (var g = [], b = p.head.next; b !== p.tail; ) @@ -14404,8 +14416,8 @@ var prism = { exports: {} }; } if (!r.document) return r.addEventListener && (o.disableWorkerMessageHandler || r.addEventListener("message", function(p) { - var g = JSON.parse(p.data), b = g.language, c = g.code, _ = g.immediateClose; - r.postMessage(o.highlight(c, o.languages[b], b)), _ && r.close(); + var g = JSON.parse(p.data), b = g.language, c = g.code, v = g.immediateClose; + r.postMessage(o.highlight(c, o.languages[b], b)), v && r.close(); }, !1)), o; var m = o.util.currentScript(); m && (o.filename = m.src, m.hasAttribute("data-manual") && (o.manual = !0)); @@ -14808,7 +14820,7 @@ var prism = { exports: {} }; bat: "batch", h: "c", tex: "latex" - }, o = "data-src-status", d = "loading", v = "loaded", f = "failed", y = "pre[data-src]:not([" + o + '="' + v + '"]):not([' + o + '="' + d + '"])'; + }, o = "data-src-status", d = "loading", _ = "loaded", f = "failed", y = "pre[data-src]:not([" + o + '="' + _ + '"]):not([' + o + '="' + d + '"])'; function A(m, l, u) { var p = new XMLHttpRequest(); p.open("GET", m, !0), p.onreadystatechange = function() { @@ -14842,18 +14854,18 @@ var prism = { exports: {} }; var c = t.plugins.autoloader; c && c.loadLanguages(g), A( p, - function(_) { - l.setAttribute(o, v); + function(v) { + l.setAttribute(o, _); var E = x(l.getAttribute("data-range")); if (E) { - var w = _.split(/\r\n?|\n/g), k = E[0], $ = E[1] == null ? w.length : E[1]; - k < 0 && (k += w.length), k = Math.max(0, Math.min(k - 1, w.length)), $ < 0 && ($ += w.length), $ = Math.max(0, Math.min($, w.length)), _ = w.slice(k, $).join(` + var w = v.split(/\r\n?|\n/g), k = E[0], $ = E[1] == null ? w.length : E[1]; + k < 0 && (k += w.length), k = Math.max(0, Math.min(k - 1, w.length)), $ < 0 && ($ += w.length), $ = Math.max(0, Math.min($, w.length)), v = w.slice(k, $).join(` `), l.hasAttribute("data-start") || l.setAttribute("data-start", String(k + 1)); } - u.textContent = _, t.highlightElement(u); + u.textContent = v, t.highlightElement(u); }, - function(_) { - l.setAttribute(o, f), u.textContent = _; + function(v) { + l.setAttribute(o, f), u.textContent = v; } ); } @@ -15281,7 +15293,8 @@ function createLatexTokenizer(n) { } const renderer = { code(n, e, t) { - const r = (e ?? "").match(/\S*/)?.[0] ?? ""; + var a; + const r = ((a = (e ?? "").match(/\S*/)) == null ? void 0 : a[0]) ?? ""; return n = n.replace(/\n$/, "") + ` `, r ? '
' + COPY_BUTTON_CODE + '
' + (t ? n : escape(n, !0)) + `
` : '
' + COPY_BUTTON_CODE + "
" + (t ? n : escape(n, !0)) + `
@@ -15310,8 +15323,8 @@ function create_marked({ name: "heading", level: "block", renderer(s) { - const h = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + slugger.slug(h), d = s.depth, v = this.parser.parseInline(s.tokens); - return `${LINK_ICON_CODE}${v} + const h = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + slugger.slug(h), d = s.depth, _ = this.parser.parseInline(s.tokens); + return `${LINK_ICON_CODE}${_} `; } } @@ -16136,8 +16149,8 @@ class Amuchina { const w = x.getAttributeNames(), k = w.length; if (k) { for (let $ = 0; $ < k; $++) { - const L = w[$], z = A[L]; - (!z || !z.has(E) && !z.has(c)) && x.removeAttribute(L); + const L = w[$], I = A[L]; + (!I || !I.has(E) && !I.has(c)) && x.removeAttribute(L); } if (isElementFunky(x)) if (isElementHyperlink(x)) { @@ -16164,8 +16177,8 @@ class Amuchina { if (o) throw new Error('"dropAttributes" is not supported yet, use "allowAttributes" instead'); __classPrivateFieldSet(this, _Amuchina_configuration, cloneDeep(DEFAULTS), "f"); - const { allowElements: d, allowAttributes: v } = e; - d && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements = e.allowElements), v && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes = e.allowAttributes), __classPrivateFieldSet(this, _Amuchina_allowElements, new Set(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements), "f"), __classPrivateFieldSet(this, _Amuchina_allowAttributes, Object.fromEntries(Object.entries(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes || {}).map(([f, y]) => [f, new Set(y)])), "f"); + const { allowElements: d, allowAttributes: _ } = e; + d && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements = e.allowElements), _ && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes = e.allowAttributes), __classPrivateFieldSet(this, _Amuchina_allowElements, new Set(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements), "f"), __classPrivateFieldSet(this, _Amuchina_allowAttributes, Object.fromEntries(Object.entries(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes || {}).map(([f, y]) => [f, new Set(y)])), "f"); } } _Amuchina_configuration = /* @__PURE__ */ new WeakMap(), _Amuchina_allowElements = /* @__PURE__ */ new WeakMap(), _Amuchina_allowAttributes = /* @__PURE__ */ new WeakMap(); @@ -16185,7 +16198,7 @@ function sanitize(n, e) { } function walk_nodes(n, e, t) { n && (n.nodeName === e || typeof e == "function") && t(n); - const r = n?.childNodes || []; + const r = (n == null ? void 0 : n.childNodes) || []; for (let a = 0; a < r.length; a++) walk_nodes(r[a], e, t); } @@ -16217,7 +16230,7 @@ function create_fragment$h(n) { t = claim_html_tag(a, !1), a.forEach(detach$h), this.h(); }, h() { - t.a = null, attr$g(e, "class", "md svelte-1m32c2s"), toggle_class$8( + t.a = null, attr$g(e, "class", "md svelte-n3seak"), toggle_class$8( e, "chatbot", /*chatbot*/ @@ -16266,9 +16279,9 @@ function escapeRegExp(n) { return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function instance$e(n, e, t) { - let { chatbot: r = !0 } = e, { message: a } = e, { sanitize_html: s = !0 } = e, { latex_delimiters: h = [] } = e, { render_markdown: o = !0 } = e, { line_breaks: d = !0 } = e, { header_links: v = !1 } = e, { root: f } = e, y, A; + let { chatbot: r = !0 } = e, { message: a } = e, { sanitize_html: s = !0 } = e, { latex_delimiters: h = [] } = e, { render_markdown: o = !0 } = e, { line_breaks: d = !0 } = e, { header_links: _ = !1 } = e, { root: f } = e, y, A; const x = create_marked({ - header_links: v, + header_links: _, line_breaks: d, latex_delimiters: h }); @@ -16277,7 +16290,7 @@ function instance$e(n, e, t) { if (o) { const g = []; h.forEach((b, c) => { - const _ = escapeRegExp(b.left), E = escapeRegExp(b.right), w = new RegExp(`${_}([\\s\\S]+?)${E}`, "g"); + const v = escapeRegExp(b.left), E = escapeRegExp(b.right), w = new RegExp(`${v}([\\s\\S]+?)${E}`, "g"); p = p.replace(w, (k, $) => (g.push(k), `%%%LATEX_BLOCK_${g.length - 1}%%%`)); }), p = x.parse(p), p = p.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (b, c) => g[parseInt(c, 10)]); } @@ -16298,7 +16311,7 @@ function instance$e(n, e, t) { }); } return n.$$set = (u) => { - "chatbot" in u && t(0, r = u.chatbot), "message" in u && t(4, a = u.message), "sanitize_html" in u && t(5, s = u.sanitize_html), "latex_delimiters" in u && t(6, h = u.latex_delimiters), "render_markdown" in u && t(1, o = u.render_markdown), "line_breaks" in u && t(7, d = u.line_breaks), "header_links" in u && t(8, v = u.header_links), "root" in u && t(9, f = u.root); + "chatbot" in u && t(0, r = u.chatbot), "message" in u && t(4, a = u.message), "sanitize_html" in u && t(5, s = u.sanitize_html), "latex_delimiters" in u && t(6, h = u.latex_delimiters), "render_markdown" in u && t(1, o = u.render_markdown), "line_breaks" in u && t(7, d = u.line_breaks), "header_links" in u && t(8, _ = u.header_links), "root" in u && t(9, f = u.root); }, n.$$.update = () => { n.$$.dirty & /*message*/ 16 && (a && a.trim() ? t(3, A = M(a)) : t(3, A = "")); @@ -16311,7 +16324,7 @@ function instance$e(n, e, t) { s, h, d, - v, + _, f, l ]; @@ -16371,7 +16384,7 @@ function create_fragment$g(n) { claim_component$7(t.$$.fragment, s), s.forEach(detach$g), this.h(); }, h() { - attr$f(e, "class", "svelte-17qq50w"); + attr$f(e, "class", "svelte-4zcnwf"); }, m(a, s) { insert_hydration$g(a, e, s), mount_component$7(t, e, null), r = !0; @@ -16497,11 +16510,11 @@ function create_fragment$f(n) { }, l(d) { e = claim_element$b(d, "SPAN", { "data-testid": !0, class: !0 }); - var v = children$d(e); - h && h.l(v), v.forEach(detach$f), t = claim_space$b(d), o && o.l(d), r = empty$5(), this.h(); + var _ = children$d(e); + h && h.l(_), _.forEach(detach$f), t = claim_space$b(d), o && o.l(d), r = empty$5(), this.h(); }, h() { - attr$e(e, "data-testid", "block-info"), attr$e(e, "class", "svelte-22c38v"), toggle_class$7(e, "sr-only", !/*show_label*/ + attr$e(e, "data-testid", "block-info"), attr$e(e, "class", "svelte-1i21bw0"), toggle_class$7(e, "sr-only", !/*show_label*/ n[0]), toggle_class$7(e, "hide", !/*show_label*/ n[0]), toggle_class$7( e, @@ -16510,11 +16523,11 @@ function create_fragment$f(n) { n[1] != null ); }, - m(d, v) { - insert_hydration$f(d, e, v), h && h.m(e, null), insert_hydration$f(d, t, v), o && o.m(d, v), insert_hydration$f(d, r, v), a = !0; + m(d, _) { + insert_hydration$f(d, e, _), h && h.m(e, null), insert_hydration$f(d, t, _), o && o.m(d, _), insert_hydration$f(d, r, _), a = !0; }, - p(d, [v]) { - h && h.p && (!a || v & /*$$scope*/ + p(d, [_]) { + h && h.p && (!a || _ & /*$$scope*/ 8) && update_slot_base$2( h, s, @@ -16525,25 +16538,25 @@ function create_fragment$f(n) { s, /*$$scope*/ d[3], - v, + _, null ) : get_all_dirty_from_scope$2( /*$$scope*/ d[3] ), null - ), (!a || v & /*show_label*/ + ), (!a || _ & /*show_label*/ 1) && toggle_class$7(e, "sr-only", !/*show_label*/ - d[0]), (!a || v & /*show_label*/ + d[0]), (!a || _ & /*show_label*/ 1) && toggle_class$7(e, "hide", !/*show_label*/ - d[0]), (!a || v & /*info*/ + d[0]), (!a || _ & /*info*/ 2) && toggle_class$7( e, "has-info", /*info*/ d[1] != null ), /*info*/ - d[1] ? o ? (o.p(d, v), v & /*info*/ + d[1] ? o ? (o.p(d, _), _ & /*info*/ 2 && transition_in$6(o, 1)) : (o = create_if_block$9(d), o.c(), transition_in$6(o, 1), o.m(r.parentNode, r)) : o && (group_outros$6(), transition_out$6(o, 1, 1, () => { o = null; }), check_outros$6()); @@ -16595,8 +16608,8 @@ const { listen: listen$5, mount_component: mount_component$5, safe_not_equal: safe_not_equal$f, - set_data: set_data$6, - set_style: set_style$4, + set_data: set_data$7, + set_style: set_style$6, space: space$a, text: text$9, toggle_class: toggle_class$6, @@ -16623,14 +16636,14 @@ function create_if_block$8(n) { ), a.forEach(detach$e), this.h(); }, h() { - attr$d(e, "class", "svelte-vk34kx"); + attr$d(e, "class", "svelte-ivutx"); }, m(r, a) { insert_hydration$e(r, e, a), append_hydration$c(e, t); }, p(r, a) { a & /*label*/ - 2 && set_data$6( + 2 && set_data$7( t, /*label*/ r[1] @@ -16642,7 +16655,7 @@ function create_if_block$8(n) { }; } function create_fragment$e(n) { - let e, t, r, a, s, h, o, d, v = ( + let e, t, r, a, s, h, o, d, _ = ( /*show_label*/ n[2] && create_if_block$8(n) ); @@ -16666,7 +16679,7 @@ function create_fragment$e(n) { ); return { c() { - e = element$a("button"), v && v.c(), t = space$a(), r = element$a("div"), a && create_component$5(a.$$.fragment), s = space$a(), x && x.c(), this.h(); + e = element$a("button"), _ && _.c(), t = space$a(), r = element$a("div"), a && create_component$5(a.$$.fragment), s = space$a(), x && x.c(), this.h(); }, l(M) { e = claim_element$a(M, "BUTTON", { @@ -16676,12 +16689,12 @@ function create_fragment$e(n) { class: !0 }); var m = children$c(e); - v && v.l(m), t = claim_space$a(m), r = claim_element$a(m, "DIV", { class: !0 }); + _ && _.l(m), t = claim_space$a(m), r = claim_element$a(m, "DIV", { class: !0 }); var l = children$c(r); a && claim_component$5(a.$$.fragment, l), s = claim_space$a(l), x && x.l(l), l.forEach(detach$e), m.forEach(detach$e), this.h(); }, h() { - attr$d(r, "class", "svelte-vk34kx"), toggle_class$6( + attr$d(r, "class", "svelte-ivutx"), toggle_class$6( r, "small", /*size*/ @@ -16712,7 +16725,7 @@ function create_fragment$e(n) { "title", /*label*/ n[1] - ), attr$d(e, "class", "svelte-vk34kx"), toggle_class$6( + ), attr$d(e, "class", "svelte-ivutx"), toggle_class$6( e, "pending", /*pending*/ @@ -16732,19 +16745,19 @@ function create_fragment$e(n) { "transparent", /*transparent*/ n[9] - ), set_style$4(e, "color", !/*disabled*/ + ), set_style$6(e, "color", !/*disabled*/ n[7] && /*_color*/ n[11] ? ( /*_color*/ n[11] - ) : "var(--block-label-text-color)"), set_style$4(e, "--bg-color", /*disabled*/ + ) : "var(--block-label-text-color)"), set_style$6(e, "--bg-color", /*disabled*/ n[7] ? "auto" : ( /*background*/ n[10] )); }, m(M, m) { - insert_hydration$e(M, e, m), v && v.m(e, null), append_hydration$c(e, t), append_hydration$c(e, r), a && mount_component$5(a, r, null), append_hydration$c(r, s), x && x.m(r, null), h = !0, o || (d = listen$5( + insert_hydration$e(M, e, m), _ && _.m(e, null), append_hydration$c(e, t), append_hydration$c(e, r), a && mount_component$5(a, r, null), append_hydration$c(r, s), x && x.m(r, null), h = !0, o || (d = listen$5( e, "click", /*click_handler*/ @@ -16753,7 +16766,7 @@ function create_fragment$e(n) { }, p(M, [m]) { if (/*show_label*/ - M[2] ? v ? v.p(M, m) : (v = create_if_block$8(M), v.c(), v.m(e, t)) : v && (v.d(1), v = null), m & /*Icon*/ + M[2] ? _ ? _.p(M, m) : (_ = create_if_block$8(M), _.c(), _.m(e, t)) : _ && (_.d(1), _ = null), m & /*Icon*/ 1 && f !== (f = /*Icon*/ M[0])) { if (a) { @@ -16846,13 +16859,13 @@ function create_fragment$e(n) { /*transparent*/ M[9] ), m & /*disabled, _color*/ - 2176 && set_style$4(e, "color", !/*disabled*/ + 2176 && set_style$6(e, "color", !/*disabled*/ M[7] && /*_color*/ M[11] ? ( /*_color*/ M[11] ) : "var(--block-label-text-color)"), m & /*disabled, background*/ - 1152 && set_style$4(e, "--bg-color", /*disabled*/ + 1152 && set_style$6(e, "--bg-color", /*disabled*/ M[7] ? "auto" : ( /*background*/ M[10] @@ -16865,17 +16878,17 @@ function create_fragment$e(n) { a && transition_out$5(a.$$.fragment, M), transition_out$5(x, M), h = !1; }, d(M) { - M && detach$e(e), v && v.d(), a && destroy_component$5(a), x && x.d(M), o = !1, d(); + M && detach$e(e), _ && _.d(), a && destroy_component$5(a), x && x.d(M), o = !1, d(); } }; } function instance$b(n, e, t) { - let r, { $$slots: a = {}, $$scope: s } = e, { Icon: h } = e, { label: o = "" } = e, { show_label: d = !1 } = e, { pending: v = !1 } = e, { size: f = "small" } = e, { padded: y = !0 } = e, { highlight: A = !1 } = e, { disabled: x = !1 } = e, { hasPopup: M = !1 } = e, { color: m = "var(--block-label-text-color)" } = e, { transparent: l = !1 } = e, { background: u = "var(--block-background-fill)" } = e; + let r, { $$slots: a = {}, $$scope: s } = e, { Icon: h } = e, { label: o = "" } = e, { show_label: d = !1 } = e, { pending: _ = !1 } = e, { size: f = "small" } = e, { padded: y = !0 } = e, { highlight: A = !1 } = e, { disabled: x = !1 } = e, { hasPopup: M = !1 } = e, { color: m = "var(--block-label-text-color)" } = e, { transparent: l = !1 } = e, { background: u = "var(--block-background-fill)" } = e; function p(g) { bubble$1.call(this, n, g); } return n.$$set = (g) => { - "Icon" in g && t(0, h = g.Icon), "label" in g && t(1, o = g.label), "show_label" in g && t(2, d = g.show_label), "pending" in g && t(3, v = g.pending), "size" in g && t(4, f = g.size), "padded" in g && t(5, y = g.padded), "highlight" in g && t(6, A = g.highlight), "disabled" in g && t(7, x = g.disabled), "hasPopup" in g && t(8, M = g.hasPopup), "color" in g && t(12, m = g.color), "transparent" in g && t(9, l = g.transparent), "background" in g && t(10, u = g.background), "$$scope" in g && t(13, s = g.$$scope); + "Icon" in g && t(0, h = g.Icon), "label" in g && t(1, o = g.label), "show_label" in g && t(2, d = g.show_label), "pending" in g && t(3, _ = g.pending), "size" in g && t(4, f = g.size), "padded" in g && t(5, y = g.padded), "highlight" in g && t(6, A = g.highlight), "disabled" in g && t(7, x = g.disabled), "hasPopup" in g && t(8, M = g.hasPopup), "color" in g && t(12, m = g.color), "transparent" in g && t(9, l = g.transparent), "background" in g && t(10, u = g.background), "$$scope" in g && t(13, s = g.$$scope); }, n.$$.update = () => { n.$$.dirty & /*highlight, color*/ 4160 && t(11, r = A ? "var(--color-accent)" : m); @@ -16883,7 +16896,7 @@ function instance$b(n, e, t) { h, o, d, - v, + _, f, y, A, @@ -16981,7 +16994,7 @@ const { insert_hydration: insert_hydration$c, noop: noop$c, safe_not_equal: safe_not_equal$d, - set_style: set_style$3, + set_style: set_style$5, svg_element: svg_element$3 } = window.__gradio__svelte__internal; function create_fragment$c(n) { @@ -17008,7 +17021,7 @@ function create_fragment$c(n) { r = claim_svg_element$3(o, "path", { d: !0, style: !0 }), children$a(r).forEach(detach$c), o.forEach(detach$c), a = claim_svg_element$3(h, "path", { d: !0, style: !0 }), children$a(a).forEach(detach$c), h.forEach(detach$c), this.h(); }, h() { - attr$b(r, "d", "M18,6L6.087,17.913"), set_style$3(r, "fill", "none"), set_style$3(r, "fill-rule", "nonzero"), set_style$3(r, "stroke-width", "2px"), attr$b(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$b(a, "d", "M4.364,4.364L19.636,19.636"), set_style$3(a, "fill", "none"), set_style$3(a, "fill-rule", "nonzero"), set_style$3(a, "stroke-width", "2px"), attr$b(e, "width", "100%"), attr$b(e, "height", "100%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "version", "1.1"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$b(e, "xml:space", "preserve"), attr$b(e, "stroke", "currentColor"), set_style$3(e, "fill-rule", "evenodd"), set_style$3(e, "clip-rule", "evenodd"), set_style$3(e, "stroke-linecap", "round"), set_style$3(e, "stroke-linejoin", "round"); + attr$b(r, "d", "M18,6L6.087,17.913"), set_style$5(r, "fill", "none"), set_style$5(r, "fill-rule", "nonzero"), set_style$5(r, "stroke-width", "2px"), attr$b(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$b(a, "d", "M4.364,4.364L19.636,19.636"), set_style$5(a, "fill", "none"), set_style$5(a, "fill-rule", "nonzero"), set_style$5(a, "stroke-width", "2px"), attr$b(e, "width", "100%"), attr$b(e, "height", "100%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "version", "1.1"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$b(e, "xml:space", "preserve"), attr$b(e, "stroke", "currentColor"), set_style$5(e, "fill-rule", "evenodd"), set_style$5(e, "clip-rule", "evenodd"), set_style$5(e, "stroke-linecap", "round"), set_style$5(e, "stroke-linejoin", "round"); }, m(s, h) { insert_hydration$c(s, e, h), append_hydration$a(e, t), append_hydration$a(t, r), append_hydration$a(e, a); @@ -17409,16 +17422,16 @@ const { space: space$9 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$6 } = window.__gradio__svelte__internal; function create_if_block$7(n) { - let e, t = ' Covalent modifcation', r, a; + let e, t = ' Covalent modifcation', r, a; return { c() { e = element$9("button"), e.innerHTML = t, this.h(); }, l(s) { - e = claim_element$9(s, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(e) !== "svelte-1ffedkh" && (e.innerHTML = t), this.h(); + e = claim_element$9(s, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(e) !== "svelte-15d988a" && (e.innerHTML = t), this.h(); }, h() { - attr$9(e, "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 items-center space-x-2 block rounded-full px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"); }, m(s, h) { insert_hydration$a(s, e, h), r || (a = listen$4( @@ -17435,26 +17448,26 @@ function create_if_block$7(n) { }; } function create_fragment$a(n) { - let e, t, r, a = ' Protein', s, h, o = ' Nucleic acid', d, v, f = ' Small molecule', y, A, x, M = ( + let e, t, r, a = ' Protein', s, h, o = ' Nucleic acid', d, _, f = ' Small molecule', y, A, x, M = ( /*displayCovMod*/ n[0] && create_if_block$7(n) ); return { c() { - e = element$9("div"), t = element$9("div"), r = element$9("button"), r.innerHTML = a, s = space$9(), h = element$9("button"), h.innerHTML = o, d = space$9(), v = element$9("button"), v.innerHTML = f, y = space$9(), M && M.c(), this.h(); + e = element$9("div"), t = element$9("div"), r = element$9("button"), r.innerHTML = a, s = space$9(), h = element$9("button"), h.innerHTML = o, d = space$9(), _ = element$9("button"), _.innerHTML = f, y = space$9(), M && M.c(), this.h(); }, l(m) { - e = claim_element$9(m, "DIV", { class: !0 }); + e = claim_element$9(m, "DIV", {}); var l = children$8(e); t = claim_element$9(l, "DIV", { class: !0 }); var u = children$8(t); - r = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(r) !== "svelte-1qxi4yp" && (r.innerHTML = a), s = claim_space$9(u), h = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(h) !== "svelte-z7tz1a" && (h.innerHTML = o), d = claim_space$9(u), v = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(v) !== "svelte-3ixhlr" && (v.innerHTML = f), y = claim_space$9(u), M && M.l(u), u.forEach(detach$a), l.forEach(detach$a), this.h(); + r = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(r) !== "svelte-t3r19q" && (r.innerHTML = a), s = claim_space$9(u), h = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(h) !== "svelte-qeks3z" && (h.innerHTML = o), d = claim_space$9(u), _ = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(_) !== "svelte-in8vmg" && (_.innerHTML = f), y = claim_space$9(u), M && M.l(u), u.forEach(detach$a), l.forEach(detach$a), this.h(); }, h() { - attr$9(r, "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(h, "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(v, "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(t, "class", "flex justify-center mt-2 svelte-8wrmgx"), attr$9(e, "class", "svelte-8wrmgx"); + attr$9(r, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(h, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(_, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(t, "class", "flex justify-center mt-2 gap-2"); }, m(m, l) { - insert_hydration$a(m, e, l), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, s), append_hydration$8(t, h), append_hydration$8(t, d), append_hydration$8(t, v), append_hydration$8(t, y), M && M.m(t, null), A || (x = [ + insert_hydration$a(m, e, l), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, s), append_hydration$8(t, h), append_hydration$8(t, d), append_hydration$8(t, _), append_hydration$8(t, y), M && M.m(t, null), A || (x = [ listen$4( r, "click", @@ -17468,7 +17481,7 @@ function create_fragment$a(n) { n[5] ), listen$4( - v, + _, "click", /*click_handler_2*/ n[6] @@ -17498,7 +17511,7 @@ function instance$a(n, e, t) { let o = !1; const d = () => { s("protein"); - }, v = () => { + }, _ = () => { s("DNA"); }, f = () => { s("ligand"); @@ -17516,7 +17529,7 @@ function instance$a(n, e, t) { h, a, d, - v, + _, f, y ]; @@ -17544,6 +17557,7 @@ const { prevent_default, run_all: run_all$3, safe_not_equal: safe_not_equal$a, + set_style: set_style$4, space: space$8, text: text$8 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$5 } = window.__gradio__svelte__internal; @@ -17554,46 +17568,47 @@ function create_fragment$9(n) { /*currentSel*/ n[3] ] + "" - ), d, v, f, y = '', A, x, M, m, l, u = ' Search', p, g; + ), d, _, f, y = '', A, x, M, m, l, u = ' Search', p, g; return { c() { - e = element$8("form"), t = element$8("div"), r = element$8("label"), r.textContent = a, s = space$8(), h = element$8("button"), d = text$8(o), v = space$8(), f = element$8("div"), f.innerHTML = y, A = space$8(), x = element$8("div"), M = element$8("input"), m = space$8(), l = element$8("button"), l.innerHTML = u, this.h(); + e = element$8("form"), t = element$8("div"), r = element$8("label"), r.textContent = a, s = space$8(), h = element$8("button"), d = text$8(o), _ = space$8(), f = element$8("div"), f.innerHTML = y, A = space$8(), x = element$8("div"), M = element$8("input"), m = space$8(), l = element$8("button"), l.innerHTML = u, this.h(); }, l(b) { e = claim_element$8(b, "FORM", { class: !0 }); var c = children$7(e); t = claim_element$8(c, "DIV", { class: !0 }); - var _ = children$7(t); - r = claim_element$8(_, "LABEL", { + var v = children$7(t); + r = claim_element$8(v, "LABEL", { for: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$4(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$8(_), h = claim_element$8(_, "BUTTON", { + }), get_svelte_dataset$4(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$8(v), h = claim_element$8(v, "BUTTON", { id: !0, "data-dropdown-toggle": !0, class: !0, type: !0 }); var E = children$7(h); - d = claim_text$7(E, o), E.forEach(detach$9), v = claim_space$8(_), f = claim_element$8(_, "DIV", { + d = claim_text$7(E, o), E.forEach(detach$9), _ = claim_space$8(v), f = claim_element$8(v, "DIV", { id: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$4(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$8(_), x = claim_element$8(_, "DIV", { class: !0 }); + }), get_svelte_dataset$4(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$8(v), x = claim_element$8(v, "DIV", { class: !0 }); var w = children$7(x); M = claim_element$8(w, "INPUT", { type: !0, id: !0, class: !0, + style: !0, placeholder: !0 }), m = claim_space$8(w), l = claim_element$8(w, "BUTTON", { type: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$4(l) !== "svelte-12vvhvj" && (l.innerHTML = u), w.forEach(detach$9), _.forEach(detach$9), c.forEach(detach$9), this.h(); + }), get_svelte_dataset$4(l) !== "svelte-12vvhvj" && (l.innerHTML = u), w.forEach(detach$9), v.forEach(detach$9), c.forEach(detach$9), this.h(); }, h() { - attr$8(r, "for", "search-dropdown"), attr$8(r, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white svelte-8wrmgx"), attr$8(h, "id", "dropdown-button"), attr$8(h, "data-dropdown-toggle", "dropdown"), attr$8(h, "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(h, "type", "button"), attr$8(f, "id", "dropdown"), attr$8(f, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 svelte-8wrmgx"), attr$8(M, "type", "search"), attr$8(M, "id", "search-dropdown"), attr$8(M, "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( + attr$8(r, "for", "search-dropdown"), attr$8(r, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"), attr$8(h, "id", "dropdown-button"), attr$8(h, "data-dropdown-toggle", "dropdown"), attr$8(h, "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"), attr$8(h, "type", "button"), attr$8(f, "id", "dropdown"), attr$8(f, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700"), attr$8(M, "type", "search"), attr$8(M, "id", "search-dropdown"), attr$8(M, "class", "p-2.5 w-full h-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"), set_style$4(M, "display", "block"), attr$8( M, "placeholder", /*placeholder*/ @@ -17601,10 +17616,10 @@ function create_fragment$9(n) { /*currentSel*/ n[3] ] - ), attr$8(l, "type", "submit"), attr$8(l, "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(x, "class", "relative w-full svelte-8wrmgx"), attr$8(t, "class", "flex svelte-8wrmgx"), attr$8(e, "class", "max-w-lg mx-auto mb-2 my-2 svelte-8wrmgx"); + ), attr$8(l, "type", "submit"), attr$8(l, "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"), attr$8(x, "class", "relative w-full"), attr$8(t, "class", "flex"), attr$8(e, "class", "max-w-lg mx-auto mb-2 my-2"); }, m(b, c) { - insert_hydration$9(b, e, c), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(t, s), append_hydration$7(t, h), append_hydration$7(h, d), append_hydration$7(t, v), append_hydration$7(t, f), append_hydration$7(t, A), append_hydration$7(t, x), append_hydration$7(x, M), append_hydration$7(x, m), append_hydration$7(x, l), p || (g = [ + insert_hydration$9(b, e, c), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(t, s), append_hydration$7(t, h), append_hydration$7(h, d), append_hydration$7(t, _), append_hydration$7(t, f), append_hydration$7(t, A), append_hydration$7(t, x), append_hydration$7(x, M), append_hydration$7(x, m), append_hydration$7(x, l), p || (g = [ listen$3( M, "input", @@ -17628,26 +17643,26 @@ function create_fragment$9(n) { function instance$9(n, e, t) { const r = createEventDispatcher$5(); let { database: a = "rcsb-bioass" } = e, { index: s = 0 } = e, h = { - "rcsb-3ligand": "RCSB 3-Letter Codes", + "rcsb-3ligand": "CCD", pubchem: "Pubchem", "rcsb-bioass": "RCSB BioAssembly" }, o = { "rcsb-3ligand": "e.g HEM, ZN, K, GOL ...", pubchem: "molecule name", "rcsb-bioass": "4 Letter PDB Code" - }, d = a, v = ""; + }, d = a, _ = ""; function f() { r("triggerFetch", { - text: v, + text: _, database: d, index: s }); } - const y = (A) => t(0, v = A.target.value); + const y = (A) => t(0, _ = A.target.value); return n.$$set = (A) => { "database" in A && t(5, a = A.database), "index" in A && t(6, s = A.index); }, [ - v, + _, h, o, d, @@ -17678,7 +17693,8 @@ const { insert_hydration: insert_hydration$8, noop: noop$8, safe_not_equal: safe_not_equal$9, - set_style: set_style$2, + set_data: set_data$6, + set_style: set_style$3, space: space$7, text: text$7 } = window.__gradio__svelte__internal; @@ -17707,19 +17723,23 @@ function create_each_block_1$2(n) { a = claim_text$6(o, r), o.forEach(detach$8), h.forEach(detach$8), this.h(); }, h() { - attr$7(t, "class", "inline-block p-0.5 svelte-hhspdt"), attr$7(t, "title", "residue " + /*chunk_ids*/ + attr$7(t, "class", "inline-block p-0.5"), attr$7(t, "title", "residue " + /*chunk_ids*/ n[1][ /*i*/ n[5] ][ /*j*/ n[8] - ]), attr$7(e, "class", "p-0.1 text-center w-full inline hover:font-bold cursor-pointer item-selectable ds-selectable svelte-hhspdt"), set_style$2(e, "font-family", "monospace"); + ]), attr$7(e, "class", "p-0.1 text-center w-full inline hover:font-bold cursor-pointer item-selectable ds-selectable svelte-1sw8ehj"), set_style$3(e, "font-family", "monospace"); }, m(s, h) { insert_hydration$8(s, e, h), append_hydration$6(e, t), append_hydration$6(t, a); }, - p: noop$8, + p(s, h) { + h & /*chunked_seq*/ + 1 && r !== (r = /*letter*/ + s[6] + "") && set_data$6(a, r); + }, d(s) { s && detach$8(e); } @@ -17747,7 +17767,7 @@ function create_each_block$3(n) { t = claim_space$7(h), h.forEach(detach$8), this.h(); }, h() { - attr$7(e, "class", "sequence__chunk svelte-hhspdt"); + attr$7(e, "class", "sequence__chunk svelte-1sw8ehj"); }, m(s, h) { insert_hydration$8(s, e, h); @@ -17799,7 +17819,7 @@ function create_fragment$8(n) { s.forEach(detach$8), this.h(); }, h() { - attr$7(e, "class", "sequence_container text-xs svelte-hhspdt"); + attr$7(e, "class", "sequence_container text-xs svelte-1sw8ehj"); }, m(a, s) { insert_hydration$8(a, e, s); @@ -17831,7 +17851,9 @@ function create_fragment$8(n) { }; } function instance$8(n, e, t) { - let { seq: r = "" } = e, a = r.match(/.{1,10}/g), s = a.map((h, o) => h.split("").map((d, v) => o * 10 + v + 1)); + let { seq: r = "" } = e, a = r.match(/.{1,10}/g); + a == null && (a = []); + let s = a.map((h, o) => h.split("").map((d, _) => o * 10 + _ + 1)); return n.$$set = (h) => { "seq" in h && t(2, r = h.seq); }, [a, s, r]; @@ -17874,8 +17896,8 @@ var _3Dmol$1 = { exports: {} }; "./node_modules/iobuffer/lib-esm/text.browser.js" ); const a = 1024 * 8, s = (() => { - const d = new Uint8Array(4), v = new Uint32Array(d.buffer); - return !((v[0] = 1) & d[0]); + const d = new Uint8Array(4), _ = new Uint32Array(d.buffer); + return !((_[0] = 1) & d[0]); })(), h = { int8: globalThis.Int8Array, uint8: globalThis.Uint8Array, @@ -17897,12 +17919,12 @@ var _3Dmol$1 = { exports: {} }; * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer. * @param options */ - constructor(v = a, f = {}) { + constructor(_ = a, f = {}) { let y = !1; - typeof v == "number" ? v = new ArrayBuffer(v) : (y = !0, this.lastWrittenByte = v.byteLength); - const A = f.offset ? f.offset >>> 0 : 0, x = v.byteLength - A; + typeof _ == "number" ? _ = new ArrayBuffer(_) : (y = !0, this.lastWrittenByte = _.byteLength); + const A = f.offset ? f.offset >>> 0 : 0, x = _.byteLength - A; let M = A; - (ArrayBuffer.isView(v) || v instanceof o) && (v.byteLength !== v.buffer.byteLength && (M = v.byteOffset + A), v = v.buffer), y ? this.lastWrittenByte = x : this.lastWrittenByte = 0, this.buffer = v, this.length = x, this.byteLength = x, this.byteOffset = M, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, M, x), this._mark = 0, this._marks = []; + (ArrayBuffer.isView(_) || _ instanceof o) && (_.byteLength !== _.buffer.byteLength && (M = _.byteOffset + A), _ = _.buffer), y ? this.lastWrittenByte = x : this.lastWrittenByte = 0, this.buffer = _, this.length = x, this.byteLength = x, this.byteOffset = M, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, M, x), this._mark = 0, this._marks = []; } /** * Checks if the memory allocated to the buffer is sufficient to store more @@ -17910,8 +17932,8 @@ var _3Dmol$1 = { exports: {} }; * @param byteLength - The needed memory in bytes. * @returns `true` if there is sufficient space and `false` otherwise. */ - available(v = 1) { - return this.offset + v <= this.length; + available(_ = 1) { + return this.offset + _ <= this.length; } /** * Check if little-endian mode is used for reading and writing multi-byte @@ -17944,22 +17966,22 @@ var _3Dmol$1 = { exports: {} }; * Move the pointer n bytes forward. * @param n - Number of bytes to skip. */ - skip(v = 1) { - return this.offset += v, this; + skip(_ = 1) { + return this.offset += _, this; } /** * Move the pointer n bytes backward. * @param n - Number of bytes to move back. */ - back(v = 1) { - return this.offset -= v, this; + back(_ = 1) { + return this.offset -= _, this; } /** * Move the pointer to the given offset. * @param offset */ - seek(v) { - return this.offset = v, this; + seek(_) { + return this.offset = _, this; } /** * Store the current pointer offset. @@ -17988,10 +18010,10 @@ var _3Dmol$1 = { exports: {} }; * @see {@link IOBuffer#pushMark} */ popMark() { - const v = this._marks.pop(); - if (v === void 0) + const _ = this._marks.pop(); + if (_ === void 0) throw new Error("Mark stack empty"); - return this.seek(v), this; + return this.seek(_), this; } /** * Move the pointer offset back to 0. @@ -18006,9 +18028,9 @@ var _3Dmol$1 = { exports: {} }; * buffer (a copy) with a length that is twice (byteLength + current offset). * @param byteLength */ - ensureAvailable(v = 1) { - if (!this.available(v)) { - const y = (this.offset + v) * 2, A = new Uint8Array(y); + ensureAvailable(_ = 1) { + if (!this.available(_)) { + const y = (this.offset + _) * 2, A = new Uint8Array(y); A.set(new Uint8Array(this.buffer)), this.buffer = A.buffer, this.length = this.byteLength = y, this._data = new DataView(this.buffer); } return this; @@ -18041,8 +18063,8 @@ var _3Dmol$1 = { exports: {} }; /** * Read `n` bytes and move pointer forward by `n` bytes. */ - readBytes(v = 1) { - return this.readArray(v, "uint8"); + readBytes(_ = 1) { + return this.readArray(_, "uint8"); } /** * Creates an array of corresponding to the type `type` and size `size`. @@ -18050,8 +18072,8 @@ var _3Dmol$1 = { exports: {} }; * @param size - size of the resulting array * @param type - number type of elements to read */ - readArray(v, f) { - const y = h[f].BYTES_PER_ELEMENT * v, A = this.byteOffset + this.offset, x = this.buffer.slice(A, A + y); + readArray(_, f) { + const y = h[f].BYTES_PER_ELEMENT * _, A = this.byteOffset + this.offset, x = this.buffer.slice(A, A + y); if (this.littleEndian === s && f !== "uint8" && f !== "int8") { const m = new Uint8Array(this.buffer.slice(A, A + y)); m.reverse(); @@ -18065,57 +18087,57 @@ var _3Dmol$1 = { exports: {} }; * Read a 16-bit signed integer and move pointer forward by 2 bytes. */ readInt16() { - const v = this._data.getInt16(this.offset, this.littleEndian); - return this.offset += 2, v; + const _ = this._data.getInt16(this.offset, this.littleEndian); + return this.offset += 2, _; } /** * Read a 16-bit unsigned integer and move pointer forward by 2 bytes. */ readUint16() { - const v = this._data.getUint16(this.offset, this.littleEndian); - return this.offset += 2, v; + const _ = this._data.getUint16(this.offset, this.littleEndian); + return this.offset += 2, _; } /** * Read a 32-bit signed integer and move pointer forward by 4 bytes. */ readInt32() { - const v = this._data.getInt32(this.offset, this.littleEndian); - return this.offset += 4, v; + const _ = this._data.getInt32(this.offset, this.littleEndian); + return this.offset += 4, _; } /** * Read a 32-bit unsigned integer and move pointer forward by 4 bytes. */ readUint32() { - const v = this._data.getUint32(this.offset, this.littleEndian); - return this.offset += 4, v; + const _ = this._data.getUint32(this.offset, this.littleEndian); + return this.offset += 4, _; } /** * Read a 32-bit floating number and move pointer forward by 4 bytes. */ readFloat32() { - const v = this._data.getFloat32(this.offset, this.littleEndian); - return this.offset += 4, v; + const _ = this._data.getFloat32(this.offset, this.littleEndian); + return this.offset += 4, _; } /** * Read a 64-bit floating number and move pointer forward by 8 bytes. */ readFloat64() { - const v = this._data.getFloat64(this.offset, this.littleEndian); - return this.offset += 8, v; + const _ = this._data.getFloat64(this.offset, this.littleEndian); + return this.offset += 8, _; } /** * Read a 64-bit signed integer number and move pointer forward by 8 bytes. */ readBigInt64() { - const v = this._data.getBigInt64(this.offset, this.littleEndian); - return this.offset += 8, v; + const _ = this._data.getBigInt64(this.offset, this.littleEndian); + return this.offset += 8, _; } /** * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes. */ readBigUint64() { - const v = this._data.getBigUint64(this.offset, this.littleEndian); - return this.offset += 8, v; + const _ = this._data.getBigUint64(this.offset, this.littleEndian); + return this.offset += 8, _; } /** * Read a 1-byte ASCII character and move pointer forward by 1 byte. @@ -18126,9 +18148,9 @@ var _3Dmol$1 = { exports: {} }; /** * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes. */ - readChars(v = 1) { + readChars(_ = 1) { let f = ""; - for (let y = 0; y < v; y++) + for (let y = 0; y < _; y++) f += this.readChar(); return f; } @@ -18136,131 +18158,131 @@ var _3Dmol$1 = { exports: {} }; * Read the next `n` bytes, return a UTF-8 decoded string and move pointer * forward by `n` bytes. */ - readUtf8(v = 1) { - return (0, r.decode)(this.readBytes(v)); + readUtf8(_ = 1) { + return (0, r.decode)(this.readBytes(_)); } /** * Read the next `n` bytes, return a string decoded with `encoding` and move pointer * forward by `n` bytes. * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8} */ - decodeText(v = 1, f = "utf-8") { - return (0, r.decode)(this.readBytes(v), f); + decodeText(_ = 1, f = "utf-8") { + return (0, r.decode)(this.readBytes(_), f); } /** * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer * forward by 1 byte. */ - writeBoolean(v) { - return this.writeUint8(v ? 255 : 0), this; + writeBoolean(_) { + return this.writeUint8(_ ? 255 : 0), this; } /** * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte. */ - writeInt8(v) { - return this.ensureAvailable(1), this._data.setInt8(this.offset++, v), this._updateLastWrittenByte(), this; + writeInt8(_) { + return this.ensureAvailable(1), this._data.setInt8(this.offset++, _), this._updateLastWrittenByte(), this; } /** * Write `value` as an 8-bit unsigned integer and move pointer forward by 1 * byte. */ - writeUint8(v) { - return this.ensureAvailable(1), this._data.setUint8(this.offset++, v), this._updateLastWrittenByte(), this; + writeUint8(_) { + return this.ensureAvailable(1), this._data.setUint8(this.offset++, _), this._updateLastWrittenByte(), this; } /** * An alias for {@link IOBuffer#writeUint8}. */ - writeByte(v) { - return this.writeUint8(v); + writeByte(_) { + return this.writeUint8(_); } /** * Write all elements of `bytes` as uint8 values and move pointer forward by * `bytes.length` bytes. */ - writeBytes(v) { - this.ensureAvailable(v.length); - for (let f = 0; f < v.length; f++) - this._data.setUint8(this.offset++, v[f]); + writeBytes(_) { + this.ensureAvailable(_.length); + for (let f = 0; f < _.length; f++) + this._data.setUint8(this.offset++, _[f]); return this._updateLastWrittenByte(), this; } /** * Write `value` as a 16-bit signed integer and move pointer forward by 2 * bytes. */ - writeInt16(v) { - return this.ensureAvailable(2), this._data.setInt16(this.offset, v, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this; + writeInt16(_) { + return this.ensureAvailable(2), this._data.setInt16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this; } /** * Write `value` as a 16-bit unsigned integer and move pointer forward by 2 * bytes. */ - writeUint16(v) { - return this.ensureAvailable(2), this._data.setUint16(this.offset, v, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this; + writeUint16(_) { + return this.ensureAvailable(2), this._data.setUint16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this; } /** * Write `value` as a 32-bit signed integer and move pointer forward by 4 * bytes. */ - writeInt32(v) { - return this.ensureAvailable(4), this._data.setInt32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; + writeInt32(_) { + return this.ensureAvailable(4), this._data.setInt32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; } /** * Write `value` as a 32-bit unsigned integer and move pointer forward by 4 * bytes. */ - writeUint32(v) { - return this.ensureAvailable(4), this._data.setUint32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; + writeUint32(_) { + return this.ensureAvailable(4), this._data.setUint32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; } /** * Write `value` as a 32-bit floating number and move pointer forward by 4 * bytes. */ - writeFloat32(v) { - return this.ensureAvailable(4), this._data.setFloat32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; + writeFloat32(_) { + return this.ensureAvailable(4), this._data.setFloat32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this; } /** * Write `value` as a 64-bit floating number and move pointer forward by 8 * bytes. */ - writeFloat64(v) { - return this.ensureAvailable(8), this._data.setFloat64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; + writeFloat64(_) { + return this.ensureAvailable(8), this._data.setFloat64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; } /** * Write `value` as a 64-bit signed bigint and move pointer forward by 8 * bytes. */ - writeBigInt64(v) { - return this.ensureAvailable(8), this._data.setBigInt64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; + writeBigInt64(_) { + return this.ensureAvailable(8), this._data.setBigInt64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; } /** * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8 * bytes. */ - writeBigUint64(v) { - return this.ensureAvailable(8), this._data.setBigUint64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; + writeBigUint64(_) { + return this.ensureAvailable(8), this._data.setBigUint64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this; } /** * Write the charCode of `str`'s first character as an 8-bit unsigned integer * and move pointer forward by 1 byte. */ - writeChar(v) { - return this.writeUint8(v.charCodeAt(0)); + writeChar(_) { + return this.writeUint8(_.charCodeAt(0)); } /** * Write the charCodes of all `str`'s characters as 8-bit unsigned integers * and move pointer forward by `str.length` bytes. */ - writeChars(v) { - for (let f = 0; f < v.length; f++) - this.writeUint8(v.charCodeAt(f)); + writeChars(_) { + for (let f = 0; f < _.length; f++) + this.writeUint8(_.charCodeAt(f)); return this; } /** * UTF-8 encode and write `str` to the current pointer offset and move pointer * forward according to the encoded length. */ - writeUtf8(v) { - return this.writeBytes((0, r.encode)(v)); + writeUtf8(_) { + return this.writeBytes((0, r.encode)(_)); } /** * Export a Uint8Array view of the internal buffer. @@ -18301,7 +18323,7 @@ var _3Dmol$1 = { exports: {} }; throw new Error("Failed to encode: the 'stream' option is unsupported."); let s = 0; const h = r.length; - let o = 0, d = Math.max(32, h + (h >> 1) + 7), v = new Uint8Array(d >> 3 << 3); + let o = 0, d = Math.max(32, h + (h >> 1) + 7), _ = new Uint8Array(d >> 3 << 3); for (; s < h; ) { let f = r.charCodeAt(s++); if (f >= 55296 && f <= 56319) { @@ -18312,27 +18334,27 @@ var _3Dmol$1 = { exports: {} }; if (f >= 55296 && f <= 56319) continue; } - if (o + 4 > v.length) { + if (o + 4 > _.length) { d += 8, d *= 1 + s / r.length * 2, d = d >> 3 << 3; const y = new Uint8Array(d); - y.set(v), v = y; + y.set(_), _ = y; } if (f & 4294967168) if (!(f & 4294965248)) - v[o++] = f >> 6 & 31 | 192; + _[o++] = f >> 6 & 31 | 192; else if (!(f & 4294901760)) - v[o++] = f >> 12 & 15 | 224, v[o++] = f >> 6 & 63 | 128; + _[o++] = f >> 12 & 15 | 224, _[o++] = f >> 6 & 63 | 128; else if (!(f & 4292870144)) - v[o++] = f >> 18 & 7 | 240, v[o++] = f >> 12 & 63 | 128, v[o++] = f >> 6 & 63 | 128; + _[o++] = f >> 18 & 7 | 240, _[o++] = f >> 12 & 63 | 128, _[o++] = f >> 6 & 63 | 128; else continue; else { - v[o++] = f; + _[o++] = f; continue; } - v[o++] = f & 63 | 128; + _[o++] = f & 63 | 128; } - return v.slice(0, o); + return _.slice(0, o); }; function t(r = "utf-8", a = { fatal: !1 }) { if (r !== "utf-8") @@ -18351,20 +18373,20 @@ var _3Dmol$1 = { exports: {} }; let h = 0; const o = s.length, d = []; for (; h < o; ) { - const v = s[h++]; - if (v === 0) + const _ = s[h++]; + if (_ === 0) break; - if (!(v & 128)) - d.push(v); - else if ((v & 224) === 192) { + if (!(_ & 128)) + d.push(_); + else if ((_ & 224) === 192) { const f = s[h++] & 63; - d.push((v & 31) << 6 | f); - } else if ((v & 240) === 224) { + d.push((_ & 31) << 6 | f); + } else if ((_ & 240) === 224) { const f = s[h++] & 63, y = s[h++] & 63; - d.push((v & 31) << 12 | f << 6 | y); - } else if ((v & 248) === 240) { + d.push((_ & 31) << 12 | f << 6 | y); + } else if ((_ & 248) === 240) { const f = s[h++] & 63, y = s[h++] & 63, A = s[h++] & 63; - let x = (v & 7) << 18 | f << 12 | y << 6 | A; + let x = (_ & 7) << 18 | f << 12 | y << 6 | A; x > 65535 && (x -= 65536, d.push(x >>> 10 & 1023 | 55296), x = 56320 | x & 1023), d.push(x); } } @@ -18430,17 +18452,17 @@ var _3Dmol$1 = { exports: {} }; "./node_modules/netcdfjs/lib-esm/types.js" ); function a(h, o) { - const d = (0, r.str2num)(o.type), v = o.size / (0, r.num2bytes)(d), f = new Array(v); - for (let y = 0; y < v; y++) + const d = (0, r.str2num)(o.type), _ = o.size / (0, r.num2bytes)(d), f = new Array(_); + for (let y = 0; y < _; y++) f[y] = (0, r.readType)(h, d, 1); return f; } function s(h, o, d) { - const v = (0, r.str2num)(o.type), f = o.size ? o.size / (0, r.num2bytes)(v) : 1, y = d.length, A = new Array(y), x = d.recordStep; + const _ = (0, r.str2num)(o.type), f = o.size ? o.size / (0, r.num2bytes)(_) : 1, y = d.length, A = new Array(y), x = d.recordStep; if (x) for (let M = 0; M < y; M++) { const m = h.offset; - A[M] = (0, r.readType)(h, v, f), h.seek(m + x); + A[M] = (0, r.readType)(h, _, f), h.seek(m + x); } else throw new Error("recordDimension.recordStep is undefined"); @@ -18470,13 +18492,13 @@ var _3Dmol$1 = { exports: {} }; /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - const s = 0, h = 10, o = 11, d = 12, v = 0; + const s = 0, h = 10, o = 11, d = 12, _ = 0; function f(M, m) { const l = { version: m }, u = { length: M.readUint32() }, p = y(M); Array.isArray(p) || (u.id = p.recordId, u.name = p.recordName, l.dimensions = p.dimensions), l.globalAttributes = A(M); - const g = x(M, u?.id, m); + const g = x(M, u == null ? void 0 : u.id, m); return Array.isArray(g) || (l.variables = g.variables, u.recordStep = g.recordStep), l.recordDimension = u, l; } function y(M) { @@ -18491,9 +18513,9 @@ var _3Dmol$1 = { exports: {} }; const b = M.readUint32(); g = new Array(b); for (let c = 0; c < b; c++) { - const _ = (0, a.readName)(M), E = M.readUint32(); - E === v && (l = c, u = _), g[c] = { - name: _, + const v = (0, a.readName)(M), E = M.readUint32(); + E === _ && (l = c, u = v), g[c] = { + name: v, size: E }; } @@ -18512,11 +18534,11 @@ var _3Dmol$1 = { exports: {} }; for (let p = 0; p < u; p++) { const g = (0, a.readName)(M), b = M.readUint32(); (0, a.notNetcdf)(b < 1 || b > 6, `non valid type ${b}`); - const c = M.readUint32(), _ = (0, r.readType)(M, b, c); + const c = M.readUint32(), v = (0, r.readType)(M, b, c); (0, a.padding)(M), l[p] = { name: g, type: (0, r.num2str)(b), - value: _ + value: v }; } } @@ -18532,22 +18554,22 @@ var _3Dmol$1 = { exports: {} }; const b = M.readUint32(); g = new Array(b); for (let c = 0; c < b; c++) { - const _ = (0, a.readName)(M), E = M.readUint32(), w = new Array(E); - for (let R = 0; R < E; R++) - w[R] = M.readUint32(); + const v = (0, a.readName)(M), E = M.readUint32(), w = new Array(E); + for (let P = 0; P < E; P++) + w[P] = M.readUint32(); const k = A(M), $ = M.readUint32(); (0, a.notNetcdf)($ < 1 && $ > 6, `non valid type ${$}`); const L = M.readUint32(); - let z = M.readUint32(); - l === 2 && ((0, a.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = M.readUint32()); + let I = M.readUint32(); + l === 2 && ((0, a.notNetcdf)(I > 0, "offsets larger than 4GB not supported"), I = M.readUint32()); let F = !1; typeof m < "u" && w[0] === m && (p += L, F = !0), g[c] = { - name: _, + name: v, dimensions: w, attributes: k, type: (0, r.num2str)($), size: L, - offset: z, + offset: I, record: F }; } @@ -18844,7 +18866,7 @@ var _3Dmol$1 = { exports: {} }; case r.BYTE: return Array.from(f.readBytes(A)); case r.CHAR: - return v(f.readChars(A)); + return _(f.readChars(A)); case r.SHORT: return o(A, f.readInt16.bind(f)); case r.INT: @@ -18857,7 +18879,7 @@ var _3Dmol$1 = { exports: {} }; throw new Error(`non valid type ${y}`); } } - function v(f) { + function _(f) { return f.charCodeAt(f.length - 1) === 0 ? f.substring(0, f.length - 1) : f; } } @@ -20580,87 +20602,87 @@ void main() { var s; (function(h) { function o(m, l, u) { - var p = Math.hypot(m, l), g, b, c, _, E; - p < 1e-4 ? (b = 0, c = 1) : (b = -m / p, c = l / p), l = -b * m + c * l, g = Math.hypot(l, u), g < 1e-4 ? (_ = 0, E = 1) : (_ = u / g, E = l / g); + var p = Math.hypot(m, l), g, b, c, v, E; + p < 1e-4 ? (b = 0, c = 1) : (b = -m / p, c = l / p), l = -b * m + c * l, g = Math.hypot(l, u), g < 1e-4 ? (v = 0, E = 1) : (v = u / g, E = l / g); var w = new Float32Array(9); - return w[0] = c, w[1] = b, w[2] = 0, w[3] = -b * E, w[4] = c * E, w[5] = _, w[6] = b * _, w[7] = -c * _, w[8] = E, w; + return w[0] = c, w[1] = b, w[2] = 0, w[3] = -b * E, w[4] = c * E, w[5] = v, w[6] = b * v, w[7] = -c * v, w[8] = E, w; } class d { constructor() { this.cache = {}; - let l = [], u = 4, p = Math.pow(2, u), g = 2, b = Math.pow(2, g), c = p / b, _; + let l = [], u = 4, p = Math.pow(2, u), g = 2, b = Math.pow(2, g), c = p / b, v; for (l[0] = new r.Vector3(-1, 0, 0), l[c] = new r.Vector3(0, 0, 1), l[c * 2] = new r.Vector3(1, 0, 0), l[c * 3] = new r.Vector3(0, 0, -1), g = 3; g <= u; g++) { - for (b = Math.pow(2, g - 1), c = p / b, _ = 0; _ < b - 1; _++) - l[c / 2 + _ * c] = l[_ * c].clone().add(l[(_ + 1) * c]).normalize(); - _ = b - 1, l[c / 2 + _ * c] = l[_ * c].clone().add(l[0]).normalize(); + for (b = Math.pow(2, g - 1), c = p / b, v = 0; v < b - 1; v++) + l[c / 2 + v * c] = l[v * c].clone().add(l[(v + 1) * c]).normalize(); + v = b - 1, l[c / 2 + v * c] = l[v * c].clone().add(l[0]).normalize(); } this.basisVectors = l; } getVerticesForRadius(l, u, p) { if (typeof this.cache < "u" && this.cache[l] !== void 0 && this.cache[l][u + p] !== void 0) return this.cache[l][u + p]; - for (var g = this.basisVectors.length, b = [], c = [], _, E = 0; E < g; E++) - b.push(this.basisVectors[E].clone().multiplyScalar(l)), b.push(this.basisVectors[E].clone().multiplyScalar(l)), _ = this.basisVectors[E].clone().normalize(), c.push(_), c.push(_); - var w = [], k = 10, $ = g, L = 0, z = Math.PI * 2, F = 0, R = Math.PI, P, U, N = !1, B = !1; - for (U = 0; U <= k; U++) { - N = U === 0 || U === k, B = U === k / 2; - var W = [], V = []; - for (P = 0; P <= $; P++) { - if (B) { - var G = P < $ ? 2 * P : 0; - V.push(G + 1), W.push(G); + for (var g = this.basisVectors.length, b = [], c = [], v, E = 0; E < g; E++) + b.push(this.basisVectors[E].clone().multiplyScalar(l)), b.push(this.basisVectors[E].clone().multiplyScalar(l)), v = this.basisVectors[E].clone().normalize(), c.push(v), c.push(v); + var w = [], k = 10, $ = g, L = 0, I = Math.PI * 2, F = 0, P = Math.PI, B, G, U = !1, R = !1; + for (G = 0; G <= k; G++) { + U = G === 0 || G === k, R = G === k / 2; + var W = [], H = []; + for (B = 0; B <= $; B++) { + if (R) { + var N = B < $ ? 2 * B : 0; + H.push(N + 1), W.push(N); continue; } - var H = P / $, Q = U / k; - if (!N || P === 0) - if (P < $) { - var te = new r.Vector3(); - te.x = -l * Math.cos(L + H * z) * Math.sin(F + Q * R), u == 1 ? te.y = 0 : te.y = l * Math.cos(F + Q * R), te.z = l * Math.sin(L + H * z) * Math.sin(F + Q * R), Math.abs(te.x) < 1e-5 && (te.x = 0), Math.abs(te.y) < 1e-5 && (te.y = 0), Math.abs(te.z) < 1e-5 && (te.z = 0), u == a.FLAT ? (_ = new r.Vector3(0, Math.cos(F + Q * R), 0), _.normalize()) : (_ = new r.Vector3(te.x, te.y, te.z), _.normalize()), b.push(te), c.push(_), W.push(b.length - 1); + var V = B / $, J = G / k; + if (!U || B === 0) + if (B < $) { + var re = new r.Vector3(); + re.x = -l * Math.cos(L + V * I) * Math.sin(F + J * P), u == 1 ? re.y = 0 : re.y = l * Math.cos(F + J * P), re.z = l * Math.sin(L + V * I) * Math.sin(F + J * P), Math.abs(re.x) < 1e-5 && (re.x = 0), Math.abs(re.y) < 1e-5 && (re.y = 0), Math.abs(re.z) < 1e-5 && (re.z = 0), u == a.FLAT ? (v = new r.Vector3(0, Math.cos(F + J * P), 0), v.normalize()) : (v = new r.Vector3(re.x, re.y, re.z), v.normalize()), b.push(re), c.push(v), W.push(b.length - 1); } else W.push(b.length - $); - else N && W.push(b.length - 1); + else U && W.push(b.length - 1); } - B && w.push(V), w.push(W); + R && w.push(H), w.push(W); } - var ee = { + var te = { vertices: b, normals: c, verticesRows: w, w: $, h: k }; - return l in this.cache || (this.cache[l] = {}), this.cache[l][u + p] = ee, ee; + return l in this.cache || (this.cache[l] = {}), this.cache[l][u + p] = te, te; } } - var v = new d(); + var _ = new d(); function f(m, l, u, p, g, b = 0, c = 0) { if (!l || !u) return; - let _ = function(Me) { - if (typeof Me == "string") { - let Ye = Me; + let v = function(De) { + if (typeof De == "string") { + let Ye = De; return Ye.toLowerCase() == "flat" ? a.FLAT : Ye.toLowerCase() == "round" ? a.ROUND : a.NONE; } else - return Me; + return De; }; - b = _(b), c = _(c); + b = v(b), c = v(c); var E = c || b; g = g || { r: 0, g: 0, b: 0 }; - var w = o(u.x - l.x, u.y - l.y, u.z - l.z), k = v.getVerticesForRadius(p, c, "to"), $ = k.w, L = k.h, z = E ? L * $ + 2 : 2 * $, F = m.updateGeoGroup(z), R = k.vertices, P = k.normals, U = k.verticesRows, N = U[L / 2], B = U[L / 2 + 1], W = F.vertices, V, G, H, Q, te, ee, ce = F.vertexArray, fe = F.normalArray, oe = F.colorArray, he = F.faceArray; - for (H = 0; H < $; ++H) { - var Ae = 2 * H; - Q = w[0] * R[Ae].x + w[3] * R[Ae].y + w[6] * R[Ae].z, te = w[1] * R[Ae].x + w[4] * R[Ae].y + w[7] * R[Ae].z, ee = w[5] * R[Ae].y + w[8] * R[Ae].z, V = 3 * (W + Ae), G = F.faceidx, ce[V] = Q + l.x, ce[V + 1] = te + l.y, ce[V + 2] = ee + l.z, ce[V + 3] = Q + u.x, ce[V + 4] = te + u.y, ce[V + 5] = ee + u.z, fe[V] = Q, fe[V + 3] = Q, fe[V + 1] = te, fe[V + 4] = te, fe[V + 2] = ee, fe[V + 5] = ee, oe[V] = g.r, oe[V + 3] = g.r, oe[V + 1] = g.g, oe[V + 4] = g.g, oe[V + 2] = g.b, oe[V + 5] = g.b, he[G] = B[H] + W, he[G + 1] = B[H + 1] + W, he[G + 2] = N[H] + W, he[G + 3] = N[H] + W, he[G + 4] = B[H + 1] + W, he[G + 5] = N[H + 1] + W, F.faceidx += 6; + var w = o(u.x - l.x, u.y - l.y, u.z - l.z), k = _.getVerticesForRadius(p, c, "to"), $ = k.w, L = k.h, I = E ? L * $ + 2 : 2 * $, F = m.updateGeoGroup(I), P = k.vertices, B = k.normals, G = k.verticesRows, U = G[L / 2], R = G[L / 2 + 1], W = F.vertices, H, N, V, J, re, te, ue = F.vertexArray, ie = F.normalArray, ae = F.colorArray, ce = F.faceArray; + for (V = 0; V < $; ++V) { + var Me = 2 * V; + J = w[0] * P[Me].x + w[3] * P[Me].y + w[6] * P[Me].z, re = w[1] * P[Me].x + w[4] * P[Me].y + w[7] * P[Me].z, te = w[5] * P[Me].y + w[8] * P[Me].z, H = 3 * (W + Me), N = F.faceidx, ue[H] = J + l.x, ue[H + 1] = re + l.y, ue[H + 2] = te + l.z, ue[H + 3] = J + u.x, ue[H + 4] = re + u.y, ue[H + 5] = te + u.z, ie[H] = J, ie[H + 3] = J, ie[H + 1] = re, ie[H + 4] = re, ie[H + 2] = te, ie[H + 5] = te, ae[H] = g.r, ae[H + 3] = g.r, ae[H + 1] = g.g, ae[H + 4] = g.g, ae[H + 2] = g.b, ae[H + 5] = g.b, ce[N] = R[V] + W, ce[N + 1] = R[V + 1] + W, ce[N + 2] = U[V] + W, ce[N + 3] = U[V] + W, ce[N + 4] = R[V + 1] + W, ce[N + 5] = U[V + 1] + W, F.faceidx += 6; } if (E) { - var Se = c ? 0 : L / 2, Ie = b ? L + 1 : L / 2 + 1, pe, le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re, De, je, Xe, X, q, re, ye, me, ze, ke, K, ae, ge, xe, ue, Ce, Z, Fe, We, I, we; - for (te = Se; te < Ie; te++) - if (te !== L / 2) { - var ve = te <= L / 2 ? u : l, Y = v.getVerticesForRadius(p, c, "to"), de = v.getVerticesForRadius(p, b, "from"); - for (ve === u ? (R = Y.vertices, P = Y.normals, U = Y.verticesRows) : ve == l && (R = de.vertices, P = de.normals, U = de.verticesRows), Q = 0; Q < $; Q++) - G = F.faceidx, pe = U[te][Q + 1], Fe = (pe + W) * 3, le = U[te][Q], We = (le + W) * 3, ne = U[te + 1][Q], I = (ne + W) * 3, Te = U[te + 1][Q + 1], we = (Te + W) * 3, Oe = w[0] * R[pe].x + w[3] * R[pe].y + w[6] * R[pe].z, Be = w[0] * R[le].x + w[3] * R[le].y + w[6] * R[le].z, Ue = w[0] * R[ne].x + w[3] * R[ne].y + w[6] * R[ne].z, Pe = w[0] * R[Te].x + w[3] * R[Te].y + w[6] * R[Te].z, Ge = w[1] * R[pe].x + w[4] * R[pe].y + w[7] * R[pe].z, Ne = w[1] * R[le].x + w[4] * R[le].y + w[7] * R[le].z, Re = w[1] * R[ne].x + w[4] * R[ne].y + w[7] * R[ne].z, De = w[1] * R[Te].x + w[4] * R[Te].y + w[7] * R[Te].z, je = w[5] * R[pe].y + w[8] * R[pe].z, Xe = w[5] * R[le].y + w[8] * R[le].z, X = w[5] * R[ne].y + w[8] * R[ne].z, q = w[5] * R[Te].y + w[8] * R[Te].z, ce[Fe] = Oe + ve.x, ce[We] = Be + ve.x, ce[I] = Ue + ve.x, ce[we] = Pe + ve.x, ce[Fe + 1] = Ge + ve.y, ce[We + 1] = Ne + ve.y, ce[I + 1] = Re + ve.y, ce[we + 1] = De + ve.y, ce[Fe + 2] = je + ve.z, ce[We + 2] = Xe + ve.z, ce[I + 2] = X + ve.z, ce[we + 2] = q + ve.z, oe[Fe] = g.r, oe[We] = g.r, oe[I] = g.r, oe[we] = g.r, oe[Fe + 1] = g.g, oe[We + 1] = g.g, oe[I + 1] = g.g, oe[we + 1] = g.g, oe[Fe + 2] = g.b, oe[We + 2] = g.b, oe[I + 2] = g.b, oe[we + 2] = g.b, re = w[0] * P[pe].x + w[3] * P[pe].y + w[6] * P[pe].z, ye = w[0] * P[le].x + w[3] * P[le].y + w[6] * P[le].z, me = w[0] * P[ne].x + w[3] * P[ne].y + w[6] * P[ne].z, ze = w[0] * P[Te].x + w[3] * P[Te].y + w[6] * P[Te].z, ke = w[1] * P[pe].x + w[4] * P[pe].y + w[7] * P[pe].z, K = w[1] * P[le].x + w[4] * P[le].y + w[7] * P[le].z, ae = w[1] * P[ne].x + w[4] * P[ne].y + w[7] * P[ne].z, ge = w[1] * P[Te].x + w[4] * P[Te].y + w[7] * P[Te].z, xe = w[5] * P[pe].y + w[8] * P[pe].z, ue = w[5] * P[le].y + w[8] * P[le].z, Ce = w[5] * P[ne].y + w[8] * P[ne].z, Z = w[5] * P[Te].y + w[8] * P[Te].z, te === 0 ? (fe[Fe] = re, fe[I] = me, fe[we] = ze, fe[Fe + 1] = ke, fe[I + 1] = ae, fe[we + 1] = ge, fe[Fe + 2] = xe, fe[I + 2] = Ce, fe[we + 2] = Z, he[G] = pe + W, he[G + 1] = ne + W, he[G + 2] = Te + W, F.faceidx += 3) : te === Ie - 1 ? (fe[Fe] = re, fe[We] = ye, fe[I] = me, fe[Fe + 1] = ke, fe[We + 1] = K, fe[I + 1] = ae, fe[Fe + 2] = xe, fe[We + 2] = ue, fe[I + 2] = Ce, he[G] = pe + W, he[G + 1] = le + W, he[G + 2] = ne + W, F.faceidx += 3) : (fe[Fe] = re, fe[We] = ye, fe[we] = ze, fe[Fe + 1] = ke, fe[We + 1] = K, fe[we + 1] = ge, fe[Fe + 2] = xe, fe[We + 2] = ue, fe[we + 2] = Z, fe[We] = ye, fe[I] = me, fe[we] = ze, fe[We + 1] = K, fe[I + 1] = ae, fe[we + 1] = ge, fe[We + 2] = ue, fe[I + 2] = Ce, fe[we + 2] = Z, he[G] = pe + W, he[G + 1] = le + W, he[G + 2] = Te + W, he[G + 3] = le + W, he[G + 4] = ne + W, he[G + 5] = Te + W, F.faceidx += 6); + var Ae = c ? 0 : L / 2, Ie = b ? L + 1 : L / 2 + 1, pe, se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re, Ce, je, Xe, X, q, ne, xe, me, ze, $e, K, oe, ge, we, de, Te, Z, Fe, We, z, Ee; + for (re = Ae; re < Ie; re++) + if (re !== L / 2) { + var ve = re <= L / 2 ? u : l, Y = _.getVerticesForRadius(p, c, "to"), fe = _.getVerticesForRadius(p, b, "from"); + for (ve === u ? (P = Y.vertices, B = Y.normals, G = Y.verticesRows) : ve == l && (P = fe.vertices, B = fe.normals, G = fe.verticesRows), J = 0; J < $; J++) + N = F.faceidx, pe = G[re][J + 1], Fe = (pe + W) * 3, se = G[re][J], We = (se + W) * 3, Q = G[re + 1][J], z = (Q + W) * 3, ye = G[re + 1][J + 1], Ee = (ye + W) * 3, ke = w[0] * P[pe].x + w[3] * P[pe].y + w[6] * P[pe].z, Pe = w[0] * P[se].x + w[3] * P[se].y + w[6] * P[se].z, Ne = w[0] * P[Q].x + w[3] * P[Q].y + w[6] * P[Q].z, Be = w[0] * P[ye].x + w[3] * P[ye].y + w[6] * P[ye].z, Ge = w[1] * P[pe].x + w[4] * P[pe].y + w[7] * P[pe].z, Ue = w[1] * P[se].x + w[4] * P[se].y + w[7] * P[se].z, Re = w[1] * P[Q].x + w[4] * P[Q].y + w[7] * P[Q].z, Ce = w[1] * P[ye].x + w[4] * P[ye].y + w[7] * P[ye].z, je = w[5] * P[pe].y + w[8] * P[pe].z, Xe = w[5] * P[se].y + w[8] * P[se].z, X = w[5] * P[Q].y + w[8] * P[Q].z, q = w[5] * P[ye].y + w[8] * P[ye].z, ue[Fe] = ke + ve.x, ue[We] = Pe + ve.x, ue[z] = Ne + ve.x, ue[Ee] = Be + ve.x, ue[Fe + 1] = Ge + ve.y, ue[We + 1] = Ue + ve.y, ue[z + 1] = Re + ve.y, ue[Ee + 1] = Ce + ve.y, ue[Fe + 2] = je + ve.z, ue[We + 2] = Xe + ve.z, ue[z + 2] = X + ve.z, ue[Ee + 2] = q + ve.z, ae[Fe] = g.r, ae[We] = g.r, ae[z] = g.r, ae[Ee] = g.r, ae[Fe + 1] = g.g, ae[We + 1] = g.g, ae[z + 1] = g.g, ae[Ee + 1] = g.g, ae[Fe + 2] = g.b, ae[We + 2] = g.b, ae[z + 2] = g.b, ae[Ee + 2] = g.b, ne = w[0] * B[pe].x + w[3] * B[pe].y + w[6] * B[pe].z, xe = w[0] * B[se].x + w[3] * B[se].y + w[6] * B[se].z, me = w[0] * B[Q].x + w[3] * B[Q].y + w[6] * B[Q].z, ze = w[0] * B[ye].x + w[3] * B[ye].y + w[6] * B[ye].z, $e = w[1] * B[pe].x + w[4] * B[pe].y + w[7] * B[pe].z, K = w[1] * B[se].x + w[4] * B[se].y + w[7] * B[se].z, oe = w[1] * B[Q].x + w[4] * B[Q].y + w[7] * B[Q].z, ge = w[1] * B[ye].x + w[4] * B[ye].y + w[7] * B[ye].z, we = w[5] * B[pe].y + w[8] * B[pe].z, de = w[5] * B[se].y + w[8] * B[se].z, Te = w[5] * B[Q].y + w[8] * B[Q].z, Z = w[5] * B[ye].y + w[8] * B[ye].z, re === 0 ? (ie[Fe] = ne, ie[z] = me, ie[Ee] = ze, ie[Fe + 1] = $e, ie[z + 1] = oe, ie[Ee + 1] = ge, ie[Fe + 2] = we, ie[z + 2] = Te, ie[Ee + 2] = Z, ce[N] = pe + W, ce[N + 1] = Q + W, ce[N + 2] = ye + W, F.faceidx += 3) : re === Ie - 1 ? (ie[Fe] = ne, ie[We] = xe, ie[z] = me, ie[Fe + 1] = $e, ie[We + 1] = K, ie[z + 1] = oe, ie[Fe + 2] = we, ie[We + 2] = de, ie[z + 2] = Te, ce[N] = pe + W, ce[N + 1] = se + W, ce[N + 2] = Q + W, F.faceidx += 3) : (ie[Fe] = ne, ie[We] = xe, ie[Ee] = ze, ie[Fe + 1] = $e, ie[We + 1] = K, ie[Ee + 1] = ge, ie[Fe + 2] = we, ie[We + 2] = de, ie[Ee + 2] = Z, ie[We] = xe, ie[z] = me, ie[Ee] = ze, ie[We + 1] = K, ie[z + 1] = oe, ie[Ee + 1] = ge, ie[We + 2] = de, ie[z + 2] = Te, ie[Ee + 2] = Z, ce[N] = pe + W, ce[N + 1] = se + W, ce[N + 2] = ye + W, ce[N + 3] = se + W, ce[N + 4] = Q + W, ce[N + 5] = ye + W, F.faceidx += 6); } } - F.vertices += z; + F.vertices += I; } h.drawCylinder = f; function y(m, l, u, p, g) { @@ -20670,16 +20692,16 @@ void main() { let b = new r.Vector3(u.x - l.x, u.y - l.y, u.z - l.z); var c = o(b.x, b.y, b.z); b = b.normalize(); - var _ = v.basisVectors.length, E = v.basisVectors, w = _ + 2, k = m.updateGeoGroup(w), $ = k.vertices, L, z, F, R, P, U, N = k.vertexArray, B = k.normalArray, W = k.colorArray, V = k.faceArray; - for (L = $ * 3, N[L] = l.x, N[L + 1] = l.y, N[L + 2] = l.z, B[L] = -b.x, B[L + 1] = -b.y, B[L + 2] = -b.z, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, N[L + 3] = u.x, N[L + 4] = u.y, N[L + 5] = u.z, B[L + 3] = b.x, B[L + 4] = b.y, B[L + 5] = b.z, W[L + 3] = g.r, W[L + 4] = g.g, W[L + 5] = g.b, L += 6, F = 0; F < _; ++F) { - var G = E[F].clone(); - G.multiplyScalar(p), R = c[0] * G.x + c[3] * G.y + c[6] * G.z, P = c[1] * G.x + c[4] * G.y + c[7] * G.z, U = c[5] * G.y + c[8] * G.z, N[L] = R + l.x, N[L + 1] = P + l.y, N[L + 2] = U + l.z, B[L] = R, B[L + 1] = P, B[L + 2] = U, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, L += 3; + var v = _.basisVectors.length, E = _.basisVectors, w = v + 2, k = m.updateGeoGroup(w), $ = k.vertices, L, I, F, P, B, G, U = k.vertexArray, R = k.normalArray, W = k.colorArray, H = k.faceArray; + for (L = $ * 3, U[L] = l.x, U[L + 1] = l.y, U[L + 2] = l.z, R[L] = -b.x, R[L + 1] = -b.y, R[L + 2] = -b.z, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, U[L + 3] = u.x, U[L + 4] = u.y, U[L + 5] = u.z, R[L + 3] = b.x, R[L + 4] = b.y, R[L + 5] = b.z, W[L + 3] = g.r, W[L + 4] = g.g, W[L + 5] = g.b, L += 6, F = 0; F < v; ++F) { + var N = E[F].clone(); + N.multiplyScalar(p), P = c[0] * N.x + c[3] * N.y + c[6] * N.z, B = c[1] * N.x + c[4] * N.y + c[7] * N.z, G = c[5] * N.y + c[8] * N.z, U[L] = P + l.x, U[L + 1] = B + l.y, U[L + 2] = G + l.z, R[L] = P, R[L + 1] = B, R[L + 2] = G, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, L += 3; } - for (k.vertices += _ + 2, z = k.faceidx, F = 0; F < _; F++) { - var H = $ + 2 + F, Q = $ + 2 + (F + 1) % _; - V[z] = H, V[z + 1] = Q, V[z + 2] = $, z += 3, V[z] = H, V[z + 1] = Q, V[z + 2] = $ + 1, z += 3; + for (k.vertices += v + 2, I = k.faceidx, F = 0; F < v; F++) { + var V = $ + 2 + F, J = $ + 2 + (F + 1) % v; + H[I] = V, H[I + 1] = J, H[I + 2] = $, I += 3, H[I] = V, H[I + 1] = J, H[I + 2] = $ + 1, I += 3; } - k.faceidx += 6 * _; + k.faceidx += 6 * v; } h.drawCone = y; class A { @@ -20697,13 +20719,13 @@ void main() { normals: [] }, b = 16 * u, c = 10 * u; l < 1 && (b = 10 * u, c = 8 * u); - var _ = 0, E = Math.PI * 2, w = 0, k = Math.PI, $, L; + var v = 0, E = Math.PI * 2, w = 0, k = Math.PI, $, L; for (L = 0; L <= c; L++) { let F = []; for ($ = 0; $ <= b; $++) { - let R = $ / b, P = L / c, U = -l * Math.cos(_ + R * E) * Math.sin(w + P * k), N = l * Math.cos(w + P * k), B = l * Math.sin(_ + R * E) * Math.sin(w + P * k); - var z = new r.Vector3(U, N, B); - z.normalize(), g.vertices.push({ x: U, y: N, z: B }), g.normals.push(z), F.push(g.vertices.length - 1); + let P = $ / b, B = L / c, G = -l * Math.cos(v + P * E) * Math.sin(w + B * k), U = l * Math.cos(w + B * k), R = l * Math.sin(v + P * E) * Math.sin(w + B * k); + var I = new r.Vector3(G, U, R); + I.normalize(), g.vertices.push({ x: G, y: U, z: R }), g.normals.push(I), F.push(g.vertices.length - 1); } g.verticesRows.push(F); } @@ -20712,18 +20734,18 @@ void main() { } var x = new A(); function M(m, l, u, p, g) { - var b = x.getVerticesForRadius(u, g), c = b.vertices, _ = b.normals, E = m.updateGeoGroup(c.length), w = E.vertices, k = E.vertexArray, $ = E.colorArray, L = E.faceArray, z = E.lineArray, F = E.normalArray; - for (let U = 0, N = c.length; U < N; ++U) { - let B = 3 * (w + U), W = c[U]; - k[B] = W.x + l.x, k[B + 1] = W.y + l.y, k[B + 2] = W.z + l.z, $[B] = p.r, $[B + 1] = p.g, $[B + 2] = p.b; + var b = x.getVerticesForRadius(u, g), c = b.vertices, v = b.normals, E = m.updateGeoGroup(c.length), w = E.vertices, k = E.vertexArray, $ = E.colorArray, L = E.faceArray, I = E.lineArray, F = E.normalArray; + for (let G = 0, U = c.length; G < U; ++G) { + let R = 3 * (w + G), W = c[G]; + k[R] = W.x + l.x, k[R + 1] = W.y + l.y, k[R + 2] = W.z + l.z, $[R] = p.r, $[R + 1] = p.g, $[R + 2] = p.b; } E.vertices += c.length; - let R = b.verticesRows, P = R.length - 1; - for (let U = 0; U < P; U++) { - let N = R[U].length - 1; - for (let B = 0; B < N; B++) { - let W = E.faceidx, V = E.lineidx, G = R[U][B + 1] + w, H = G * 3, Q = R[U][B] + w, te = Q * 3, ee = R[U + 1][B] + w, ce = ee * 3, fe = R[U + 1][B + 1] + w, oe = fe * 3, he = _[G - w], Ae = _[Q - w], Se = _[ee - w], Ie = _[fe - w]; - Math.abs(c[G - w].y) === u ? (F[H] = he.x, F[ce] = Se.x, F[oe] = Ie.x, F[H + 1] = he.y, F[ce + 1] = Se.y, F[oe + 1] = Ie.y, F[H + 2] = he.z, F[ce + 2] = Se.z, F[oe + 2] = Ie.z, L[W] = G, L[W + 1] = ee, L[W + 2] = fe, z[V] = G, z[V + 1] = ee, z[V + 2] = G, z[V + 3] = fe, z[V + 4] = ee, z[V + 5] = fe, E.faceidx += 3, E.lineidx += 6) : Math.abs(c[ee - w].y) === u ? (F[H] = he.x, F[te] = Ae.x, F[ce] = Se.x, F[H + 1] = he.y, F[te + 1] = Ae.y, F[ce + 1] = Se.y, F[H + 2] = he.z, F[te + 2] = Ae.z, F[ce + 2] = Se.z, L[W] = G, L[W + 1] = Q, L[W + 2] = ee, z[V] = G, z[V + 1] = Q, z[V + 2] = G, z[V + 3] = ee, z[V + 4] = Q, z[V + 5] = ee, E.faceidx += 3, E.lineidx += 6) : (F[H] = he.x, F[te] = Ae.x, F[oe] = Ie.x, F[H + 1] = he.y, F[te + 1] = Ae.y, F[oe + 1] = Ie.y, F[H + 2] = he.z, F[te + 2] = Ae.z, F[oe + 2] = Ie.z, F[te] = Ae.x, F[ce] = Se.x, F[oe] = Ie.x, F[te + 1] = Ae.y, F[ce + 1] = Se.y, F[oe + 1] = Ie.y, F[te + 2] = Ae.z, F[ce + 2] = Se.z, F[oe + 2] = Ie.z, L[W] = G, L[W + 1] = Q, L[W + 2] = fe, L[W + 3] = Q, L[W + 4] = ee, L[W + 5] = fe, z[V] = G, z[V + 1] = Q, z[V + 2] = G, z[V + 3] = fe, z[V + 4] = Q, z[V + 5] = ee, z[V + 6] = ee, z[V + 7] = fe, E.faceidx += 6, E.lineidx += 8); + let P = b.verticesRows, B = P.length - 1; + for (let G = 0; G < B; G++) { + let U = P[G].length - 1; + for (let R = 0; R < U; R++) { + let W = E.faceidx, H = E.lineidx, N = P[G][R + 1] + w, V = N * 3, J = P[G][R] + w, re = J * 3, te = P[G + 1][R] + w, ue = te * 3, ie = P[G + 1][R + 1] + w, ae = ie * 3, ce = v[N - w], Me = v[J - w], Ae = v[te - w], Ie = v[ie - w]; + Math.abs(c[N - w].y) === u ? (F[V] = ce.x, F[ue] = Ae.x, F[ae] = Ie.x, F[V + 1] = ce.y, F[ue + 1] = Ae.y, F[ae + 1] = Ie.y, F[V + 2] = ce.z, F[ue + 2] = Ae.z, F[ae + 2] = Ie.z, L[W] = N, L[W + 1] = te, L[W + 2] = ie, I[H] = N, I[H + 1] = te, I[H + 2] = N, I[H + 3] = ie, I[H + 4] = te, I[H + 5] = ie, E.faceidx += 3, E.lineidx += 6) : Math.abs(c[te - w].y) === u ? (F[V] = ce.x, F[re] = Me.x, F[ue] = Ae.x, F[V + 1] = ce.y, F[re + 1] = Me.y, F[ue + 1] = Ae.y, F[V + 2] = ce.z, F[re + 2] = Me.z, F[ue + 2] = Ae.z, L[W] = N, L[W + 1] = J, L[W + 2] = te, I[H] = N, I[H + 1] = J, I[H + 2] = N, I[H + 3] = te, I[H + 4] = J, I[H + 5] = te, E.faceidx += 3, E.lineidx += 6) : (F[V] = ce.x, F[re] = Me.x, F[ae] = Ie.x, F[V + 1] = ce.y, F[re + 1] = Me.y, F[ae + 1] = Ie.y, F[V + 2] = ce.z, F[re + 2] = Me.z, F[ae + 2] = Ie.z, F[re] = Me.x, F[ue] = Ae.x, F[ae] = Ie.x, F[re + 1] = Me.y, F[ue + 1] = Ae.y, F[ae + 1] = Ie.y, F[re + 2] = Me.z, F[ue + 2] = Ae.z, F[ae + 2] = Ie.z, L[W] = N, L[W + 1] = J, L[W + 2] = ie, L[W + 3] = J, L[W + 4] = te, L[W + 5] = ie, I[H] = N, I[H + 1] = J, I[H + 2] = N, I[H + 3] = ie, I[H + 4] = J, I[H + 5] = te, I[H + 6] = te, I[H + 7] = ie, E.faceidx += 6, E.lineidx += 8); } } } @@ -20764,7 +20786,7 @@ void main() { ), d = t( /*! ./glcartoon */ "./src/glcartoon.ts" - ), v = t( + ), _ = t( /*! ./utilities */ "./src/utilities.ts" ), f = t( @@ -20821,7 +20843,7 @@ void main() { if (!p.hidden) { var g = p.linewidth || M.defaultlineWidth; u[g] || (u[g] = new r.Geometry()); - var b = u[g].updateGeoGroup(6), c = this.getRadiusFromStyle(l, p), _ = [ + var b = u[g].updateGeoGroup(6), c = this.getRadiusFromStyle(l, p), v = [ [c, 0, 0], [-c, 0, 0], [0, c, 0], @@ -20830,10 +20852,10 @@ void main() { [0, 0, -c] ], E = l.clickable || l.hoverable; E && l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [] }); - for (var w = (0, v.getColorFromStyle)(l, p), k = b.vertexArray, $ = b.colorArray, L = 0; L < 6; L++) { - var z = b.vertices * 3; - if (b.vertices++, k[z] = l.x + _[L][0], k[z + 1] = l.y + _[L][1], k[z + 2] = l.z + _[L][2], $[z] = w.r, $[z + 1] = w.g, $[z + 2] = w.b, E) { - var F = new s.Vector3(_[L][0], _[L][1], _[L][2]); + for (var w = (0, _.getColorFromStyle)(l, p), k = b.vertexArray, $ = b.colorArray, L = 0; L < 6; L++) { + var I = b.vertices * 3; + if (b.vertices++, k[I] = l.x + v[L][0], k[I + 1] = l.y + v[L][1], k[I + 2] = l.z + v[L][2], $[I] = w.r, $[I + 1] = w.g, $[I + 2] = w.b, E) { + var F = new s.Vector3(v[L][0], v[L][1], v[L][2]); F.multiplyScalar(0.1), F.set(F.x + l.x, F.y + l.y, F.z + l.z), l.intersectionShape.line.push(F); } } @@ -20841,11 +20863,11 @@ void main() { } } getGoodCross(l, u, p, g) { - for (var b = null, c = -1, _ = 0, E = l.bonds.length; _ < E; _++) - if (l.bonds[_] != u.index) { - let k = l.bonds[_], $ = this.atoms[k], z = new s.Vector3($.x, $.y, $.z).clone(); - z.sub(p); - let F = z.clone(); + for (var b = null, c = -1, v = 0, E = l.bonds.length; v < E; v++) + if (l.bonds[v] != u.index) { + let k = l.bonds[v], $ = this.atoms[k], I = new s.Vector3($.x, $.y, $.z).clone(); + I.sub(p); + let F = I.clone(); F.cross(g); var w = F.lengthSq(); if (w > c && (c = w, b = F, c > 0.1)) @@ -20856,12 +20878,12 @@ void main() { //from atom, return a normalized vector v that is orthogonal and along which //it is appropraite to draw multiple bonds getSideBondV(l, u, p) { - var g, b, c, _, E, w = new s.Vector3(l.x, l.y, l.z), k = new s.Vector3(u.x, u.y, u.z), $ = k.clone(), L = null; + var g, b, c, v, E, w = new s.Vector3(l.x, l.y, l.z), k = new s.Vector3(u.x, u.y, u.z), $ = k.clone(), L = null; if ($.sub(w), l.bonds.length === 1) - u.bonds.length === 1 ? (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1) : (g = (p + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b], c.index == l.index && (g = (g + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b]), _ = new s.Vector3(c.x, c.y, c.z), E = _.clone(), E.sub(w), L = E.clone(), L.cross($)); + u.bonds.length === 1 ? (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1) : (g = (p + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b], c.index == l.index && (g = (g + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b]), v = new s.Vector3(c.x, c.y, c.z), E = v.clone(), E.sub(w), L = E.clone(), L.cross($)); else if (L = this.getGoodCross(l, u, w, $), L.lengthSq() < 0.01) { - var z = this.getGoodCross(u, l, w, $); - z != null && (L = z); + var I = this.getGoodCross(u, l, w, $); + I != null && (L = I); } return L.lengthSq() < 0.01 && (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1), L.cross($), L.normalize(), L; } @@ -20881,26 +20903,26 @@ void main() { if (l.style.line) { var g = l.style.line; if (!g.hidden) { - var b, c, _, E, w = g.linewidth || M.defaultlineWidth; + var b, c, v, E, w = g.linewidth || M.defaultlineWidth; p[w] || (p[w] = new r.Geometry()); - for (var k = p[w].updateGeoGroup(6 * l.bonds.length), $ = k.vertexArray, L = k.colorArray, z = 0; z < l.bonds.length; z++) { - var F = l.bonds[z], R = u[F]; - if (R.style.line && !(l.index >= R.index)) { - var P = new s.Vector3(l.x, l.y, l.z), U = new s.Vector3(R.x, R.y, R.z), N = P.clone().add(U).multiplyScalar(0.5), B = !1, W = l.clickable || l.hoverable, V = R.clickable || R.hoverable; - (W || V) && (W && (l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), l.intersectionShape.line.push(P), l.intersectionShape.line.push(N)), V && (R.intersectionShape === void 0 && (R.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), R.intersectionShape.line.push(N), R.intersectionShape.line.push(U))); - var G = (0, v.getColorFromStyle)(l, l.style.line), H = (0, v.getColorFromStyle)(R, R.style.line); - if (l.bondStyles && l.bondStyles[z]) { - var Q = l.bondStyles[z]; - if (!Q.iswire) + for (var k = p[w].updateGeoGroup(6 * l.bonds.length), $ = k.vertexArray, L = k.colorArray, I = 0; I < l.bonds.length; I++) { + var F = l.bonds[I], P = u[F]; + if (P.style.line && !(l.index >= P.index)) { + var B = new s.Vector3(l.x, l.y, l.z), G = new s.Vector3(P.x, P.y, P.z), U = B.clone().add(G).multiplyScalar(0.5), R = !1, W = l.clickable || l.hoverable, H = P.clickable || P.hoverable; + (W || H) && (W && (l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), l.intersectionShape.line.push(B), l.intersectionShape.line.push(U)), H && (P.intersectionShape === void 0 && (P.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), P.intersectionShape.line.push(U), P.intersectionShape.line.push(G))); + var N = (0, _.getColorFromStyle)(l, l.style.line), V = (0, _.getColorFromStyle)(P, P.style.line); + if (l.bondStyles && l.bondStyles[I]) { + var J = l.bondStyles[I]; + if (!J.iswire) continue; - Q.singleBond && (B = !0), typeof Q.color1 < "u" && (G = h.CC.color(Q.color1)), typeof Q.color2 < "u" && (H = h.CC.color(Q.color2)); + J.singleBond && (R = !0), typeof J.color1 < "u" && (N = h.CC.color(J.color1)), typeof J.color2 < "u" && (V = h.CC.color(J.color2)); } - var te = k.vertices * 3, ee, ce; - if (l.bondOrder[z] > 1 && l.bondOrder[z] < 4 && !B) { - var fe = this.getSideBondV(l, R, z), oe = U.clone(); - oe.sub(P), l.bondOrder[z] == 2 ? (fe.multiplyScalar(0.1), b = P.clone(), b.add(fe), c = P.clone(), c.sub(fe), _ = b.clone(), _.add(oe), E = c.clone(), E.add(oe), G == H ? (k.vertices += 4, this.addLine($, L, te, b, _, G), this.addLine($, L, te + 6, c, E, G)) : (k.vertices += 8, oe.multiplyScalar(0.5), ee = b.clone(), ee.add(oe), ce = c.clone(), ce.add(oe), this.addLine($, L, te, b, ee, G), this.addLine($, L, te + 6, ee, _, H), this.addLine($, L, te + 12, c, ce, G), this.addLine($, L, te + 18, ce, E, H))) : l.bondOrder[z] == 3 && (fe.multiplyScalar(0.1), b = P.clone(), b.add(fe), c = P.clone(), c.sub(fe), _ = b.clone(), _.add(oe), E = c.clone(), E.add(oe), G == H ? (k.vertices += 6, this.addLine($, L, te, P, U, G), this.addLine($, L, te + 6, b, _, G), this.addLine($, L, te + 12, c, E, G)) : (k.vertices += 12, oe.multiplyScalar(0.5), ee = b.clone(), ee.add(oe), ce = c.clone(), ce.add(oe), this.addLine($, L, te, P, N, G), this.addLine($, L, te + 6, N, U, H), this.addLine($, L, te + 12, b, ee, G), this.addLine($, L, te + 18, ee, _, H), this.addLine($, L, te + 24, c, ce, G), this.addLine($, L, te + 30, ce, E, H))); + var re = k.vertices * 3, te, ue; + if (l.bondOrder[I] > 1 && l.bondOrder[I] < 4 && !R) { + var ie = this.getSideBondV(l, P, I), ae = G.clone(); + ae.sub(B), l.bondOrder[I] == 2 ? (ie.multiplyScalar(0.1), b = B.clone(), b.add(ie), c = B.clone(), c.sub(ie), v = b.clone(), v.add(ae), E = c.clone(), E.add(ae), N == V ? (k.vertices += 4, this.addLine($, L, re, b, v, N), this.addLine($, L, re + 6, c, E, N)) : (k.vertices += 8, ae.multiplyScalar(0.5), te = b.clone(), te.add(ae), ue = c.clone(), ue.add(ae), this.addLine($, L, re, b, te, N), this.addLine($, L, re + 6, te, v, V), this.addLine($, L, re + 12, c, ue, N), this.addLine($, L, re + 18, ue, E, V))) : l.bondOrder[I] == 3 && (ie.multiplyScalar(0.1), b = B.clone(), b.add(ie), c = B.clone(), c.sub(ie), v = b.clone(), v.add(ae), E = c.clone(), E.add(ae), N == V ? (k.vertices += 6, this.addLine($, L, re, B, G, N), this.addLine($, L, re + 6, b, v, N), this.addLine($, L, re + 12, c, E, N)) : (k.vertices += 12, ae.multiplyScalar(0.5), te = b.clone(), te.add(ae), ue = c.clone(), ue.add(ae), this.addLine($, L, re, B, U, N), this.addLine($, L, re + 6, U, G, V), this.addLine($, L, re + 12, b, te, N), this.addLine($, L, re + 18, te, v, V), this.addLine($, L, re + 24, c, ue, N), this.addLine($, L, re + 30, ue, E, V))); } else - G == H ? (k.vertices += 2, this.addLine($, L, te, P, U, G)) : (k.vertices += 4, this.addLine($, L, te, P, N, G), this.addLine($, L, te + 6, N, U, H)); + N == V ? (k.vertices += 2, this.addLine($, L, re, B, G, N)) : (k.vertices += 4, this.addLine($, L, re, B, U, N), this.addLine($, L, re + 6, U, G, V)); } } } @@ -20917,7 +20939,7 @@ void main() { if (l.style.sphere) { var p = l.style.sphere; if (!p.hidden) { - var g = (0, v.getColorFromStyle)(l, p), b = this.getRadiusFromStyle(l, p); + var g = (0, _.getColorFromStyle)(l, p), b = this.getRadiusFromStyle(l, p); if ((l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { var c = new s.Vector3(l.x, l.y, l.z); l.intersectionShape.sphere.push(new a.Sphere(c, b)); @@ -20943,8 +20965,8 @@ void main() { if (l.style.sphere) { var p = l.style.sphere; if (!p.hidden) { - var g = this.getRadiusFromStyle(l, p), b = (0, v.getColorFromStyle)(l, p), c = u.updateGeoGroup(1), _ = c.vertices, E = _ * 3, w = c.vertexArray, k = c.colorArray, $ = c.radiusArray; - if (w[E] = l.x, w[E + 1] = l.y, w[E + 2] = l.z, k[E] = b.r, k[E + 1] = b.g, k[E + 2] = b.b, $[_] = g, (l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { + var g = this.getRadiusFromStyle(l, p), b = (0, _.getColorFromStyle)(l, p), c = u.updateGeoGroup(1), v = c.vertices, E = v * 3, w = c.vertexArray, k = c.colorArray, $ = c.radiusArray; + if (w[E] = l.x, w[E + 1] = l.y, w[E + 2] = l.z, k[E] = b.r, k[E + 1] = b.g, k[E + 2] = b.b, $[v] = g, (l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { var L = new s.Vector3(l.x, l.y, l.z); l.intersectionShape.sphere.push(new a.Sphere(L, g)); } @@ -20953,22 +20975,22 @@ void main() { } } drawSphereImposter(l, u, p, g) { - var b = l.updateGeoGroup(4), c, _ = b.vertices, E = _ * 3, w = b.vertexArray, k = b.colorArray; + var b = l.updateGeoGroup(4), c, v = b.vertices, E = v * 3, w = b.vertexArray, k = b.colorArray; for (c = 0; c < 4; c++) w[E + 3 * c] = u.x, w[E + 3 * c + 1] = u.y, w[E + 3 * c + 2] = u.z; var $ = b.normalArray; for (c = 0; c < 4; c++) k[E + 3 * c] = g.r, k[E + 3 * c + 1] = g.g, k[E + 3 * c + 2] = g.b; $[E + 0] = -p, $[E + 1] = p, $[E + 2] = 0, $[E + 3] = -p, $[E + 4] = -p, $[E + 5] = 0, $[E + 6] = p, $[E + 7] = -p, $[E + 8] = 0, $[E + 9] = p, $[E + 10] = p, $[E + 11] = 0, b.vertices += 4; - var L = b.faceArray, z = b.faceidx; - L[z + 0] = _, L[z + 1] = _ + 1, L[z + 2] = _ + 2, L[z + 3] = _ + 2, L[z + 4] = _ + 3, L[z + 5] = _, b.faceidx += 6; + var L = b.faceArray, I = b.faceidx; + L[I + 0] = v, L[I + 1] = v + 1, L[I + 2] = v + 2, L[I + 3] = v + 2, L[I + 4] = v + 3, L[I + 5] = v, b.faceidx += 6; } //dkoes - code for sphere imposters drawAtomImposter(l, u) { if (l.style.sphere) { var p = l.style.sphere; if (!p.hidden) { - var g = this.getRadiusFromStyle(l, p), b = (0, v.getColorFromStyle)(l, p); + var g = this.getRadiusFromStyle(l, p), b = (0, _.getColorFromStyle)(l, p); if ((l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { var c = new s.Vector3(l.x, l.y, l.z); l.intersectionShape.sphere.push(new a.Sphere(c, g)); @@ -20980,21 +21002,21 @@ void main() { calculateDashes(l, u, p, g, b) { var c = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2)); p = Math.max(p, 0), b = Math.max(b, 0) + 2 * p, g = Math.max(g, 1e-3), g + b > c && (g = c, b = 0); - var _ = Math.floor((c - g) / (g + b)) + 1, E = _ * g; - b = (c - E) / _; - for (var w, k = new s.Vector3(l.x, l.y, l.z), $ = new s.Vector3((u.x - l.x) / (c / b), (u.y - l.y) / (c / b), (u.z - l.z) / (c / b)), L = new s.Vector3((u.x - l.x) / (c / g), (u.y - l.y) / (c / g), (u.z - l.z) / (c / g)), z = [], F = 0; F < _; F++) - w = new s.Vector3(k.x + L.x, k.y + L.y, k.z + L.z), z.push({ from: k, to: w }), k = new s.Vector3(w.x + $.x, w.y + $.y, w.z + $.z); - return z; - } - static drawStickImposter(l, u, p, g, b, c = 0, _ = 0) { - for (var E = l.updateGeoGroup(4), w = E.vertices, k = w * 3, $ = E.vertexArray, L = E.colorArray, z = E.radiusArray, F = E.normalArray, R = b.r, P = b.g, U = b.b, N = function(H) { - var Q = -H; - return Q == 0 && (Q = -1e-4), Q; - }, B = k, W = 0; W < 4; W++) - $[B] = u.x, F[B] = p.x, L[B] = R, B++, $[B] = u.y, F[B] = p.y, L[B] = P, B++, $[B] = u.z, F[B] = p.z, W < 2 ? L[B] = U : L[B] = N(U), B++; - E.vertices += 4, z[w] = -g, z[w + 1] = g, z[w + 2] = -g, z[w + 3] = g; - var V = E.faceArray, G = E.faceidx; - V[G + 0] = w, V[G + 1] = w + 1, V[G + 2] = w + 2, V[G + 3] = w + 2, V[G + 4] = w + 3, V[G + 5] = w, E.faceidx += 6; + var v = Math.floor((c - g) / (g + b)) + 1, E = v * g; + b = (c - E) / v; + for (var w, k = new s.Vector3(l.x, l.y, l.z), $ = new s.Vector3((u.x - l.x) / (c / b), (u.y - l.y) / (c / b), (u.z - l.z) / (c / b)), L = new s.Vector3((u.x - l.x) / (c / g), (u.y - l.y) / (c / g), (u.z - l.z) / (c / g)), I = [], F = 0; F < v; F++) + w = new s.Vector3(k.x + L.x, k.y + L.y, k.z + L.z), I.push({ from: k, to: w }), k = new s.Vector3(w.x + $.x, w.y + $.y, w.z + $.z); + return I; + } + static drawStickImposter(l, u, p, g, b, c = 0, v = 0) { + for (var E = l.updateGeoGroup(4), w = E.vertices, k = w * 3, $ = E.vertexArray, L = E.colorArray, I = E.radiusArray, F = E.normalArray, P = b.r, B = b.g, G = b.b, U = function(V) { + var J = -V; + return J == 0 && (J = -1e-4), J; + }, R = k, W = 0; W < 4; W++) + $[R] = u.x, F[R] = p.x, L[R] = P, R++, $[R] = u.y, F[R] = p.y, L[R] = B, R++, $[R] = u.z, F[R] = p.z, W < 2 ? L[R] = G : L[R] = U(G), R++; + E.vertices += 4, I[w] = -g, I[w + 1] = g, I[w + 2] = -g, I[w + 3] = g; + var H = E.faceArray, N = E.faceidx; + H[N + 0] = w, H[N + 1] = w + 1, H[N + 2] = w + 2, H[N + 3] = w + 2, H[N + 4] = w + 3, H[N + 5] = w, E.faceidx += 6; } // draws cylinders and small spheres (at bond radius) drawBondSticks(l, u, p) { @@ -21002,55 +21024,55 @@ void main() { if (l.style.stick) { var c = l.style.stick; if (!c.hidden) { - var _ = c.radius || this.defaultStickRadius, E = c.doubleBondScaling || 0.4, w = c.tripleBondScaling || 0.25, k = ((g = c.dashedBondConfig) === null || g === void 0 ? void 0 : g.dashLength) || 0.1, $ = ((b = c.dashedBondConfig) === null || b === void 0 ? void 0 : b.gapLength) || 0.25, L = _, z = c.singleBonds || !1, F = c.dashedBonds || !1, R = 0, P = 0, U, N, B, W, V, G, H, Q, te, ee, ce, fe = (0, v.getColorFromStyle)(l, c), oe, he, Ae; - !l.capDrawn && l.bonds.length < 4 && (R = 2); - var Se = (ae) => { + var v = c.radius || this.defaultStickRadius, E = c.doubleBondScaling || 0.4, w = c.tripleBondScaling || 0.25, k = ((g = c.dashedBondConfig) === null || g === void 0 ? void 0 : g.dashLength) || 0.1, $ = ((b = c.dashedBondConfig) === null || b === void 0 ? void 0 : b.gapLength) || 0.25, L = v, I = c.singleBonds || !1, F = c.dashedBonds || !1, P = 0, B = 0, G, U, R, W, H, N, V, J, re, te, ue, ie = (0, _.getColorFromStyle)(l, c), ae, ce, Me; + !l.capDrawn && l.bonds.length < 4 && (P = 2); + var Ae = (oe) => { var ge = p.imposter ? M.drawStickImposter : o.GLDraw.drawCylinder; - return !F && ae >= 1 ? ge : (xe, ue, Ce, Z, Fe, We = 0, I = 0, we = 0.1, ve = 0.25) => { - var Y = this.calculateDashes(ue, Ce, Z, we, ve); - Y.forEach((de) => { - ge(xe, de.from, de.to, Z, Fe, We, I); + return !F && oe >= 1 ? ge : (we, de, Te, Z, Fe, We = 0, z = 0, Ee = 0.1, ve = 0.25) => { + var Y = this.calculateDashes(de, Te, Z, Ee, ve); + Y.forEach((fe) => { + ge(we, fe.from, fe.to, Z, Fe, We, z); }); }; }; - for (B = 0; B < l.bonds.length; B++) { - var Ie = Se(l.bondOrder[B]), pe = l.bonds[B], le = u[pe]; - if (oe = he = Ae = null, l.index < le.index) { - var ne = le.style; - if (!ne.stick || ne.stick.hidden) + for (R = 0; R < l.bonds.length; R++) { + var Ie = Ae(l.bondOrder[R]), pe = l.bonds[R], se = u[pe]; + if (ae = ce = Me = null, l.index < se.index) { + var Q = se.style; + if (!Q.stick || Q.stick.hidden) continue; - var Te = (0, v.getColorFromStyle)(le, ne.stick); - if (L = _, W = z, l.bondStyles && l.bondStyles[B]) { - if (V = l.bondStyles[B], V.iswire) + var ye = (0, _.getColorFromStyle)(se, Q.stick); + if (L = v, W = I, l.bondStyles && l.bondStyles[R]) { + if (H = l.bondStyles[R], H.iswire) continue; - V.radius && (L = V.radius), V.singleBond && (W = !0), typeof V.color1 < "u" && (fe = h.CC.color(V.color1)), typeof V.color2 < "u" && (Te = h.CC.color(V.color2)); + H.radius && (L = H.radius), H.singleBond && (W = !0), typeof H.color1 < "u" && (ie = h.CC.color(H.color1)), typeof H.color2 < "u" && (ye = h.CC.color(H.color2)); } - var Oe = new s.Vector3(l.x, l.y, l.z), Be = new s.Vector3(le.x, le.y, le.z); - if (l.bondOrder[B] <= 1 || W || l.bondOrder[B] > 3) { - if (l.bondOrder[B] < 1 && (L *= l.bondOrder[B]), !le.capDrawn && le.bonds.length < 4 && (P = 2), fe != Te ? (oe = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5), Ie(p, Oe, oe, L, fe, R, 0, k, $), Ie(p, oe, Be, L, Te, 0, P, k, $)) : Ie(p, Oe, Be, L, fe, R, P, k, $), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, U || N) { - if (oe || (oe = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5)), U) { - var Ue = new a.Cylinder(Oe, oe, L), Pe = new a.Sphere(Oe, L); - l.intersectionShape.cylinder.push(Ue), l.intersectionShape.sphere.push(Pe); + var ke = new s.Vector3(l.x, l.y, l.z), Pe = new s.Vector3(se.x, se.y, se.z); + if (l.bondOrder[R] <= 1 || W || l.bondOrder[R] > 3) { + if (l.bondOrder[R] < 1 && (L *= l.bondOrder[R]), !se.capDrawn && se.bonds.length < 4 && (B = 2), ie != ye ? (ae = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5), Ie(p, ke, ae, L, ie, P, 0, k, $), Ie(p, ae, Pe, L, ye, 0, B, k, $)) : Ie(p, ke, Pe, L, ie, P, B, k, $), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, G || U) { + if (ae || (ae = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5)), G) { + var Ne = new a.Cylinder(ke, ae, L), Be = new a.Sphere(ke, L); + l.intersectionShape.cylinder.push(Ne), l.intersectionShape.sphere.push(Be); } - if (N) { - var Ge = new a.Cylinder(Be, oe, L), Ne = new a.Sphere(Be, L); - le.intersectionShape.cylinder.push(Ge), le.intersectionShape.sphere.push(Ne); + if (U) { + var Ge = new a.Cylinder(Pe, ae, L), Ue = new a.Sphere(Pe, L); + se.intersectionShape.cylinder.push(Ge), se.intersectionShape.sphere.push(Ue); } } - } else if (l.bondOrder[B] > 1) { - var Re = 0, De = 0; - L != _ && (Re = 2, De = 2); - var je = Be.clone(), Xe = null; - je.sub(Oe); - var X, q, re, ye, me; - Xe = this.getSideBondV(l, le, B), l.bondOrder[B] == 2 ? (X = L * E, Xe.multiplyScalar(X * 1.5), q = Oe.clone(), q.add(Xe), re = Oe.clone(), re.sub(Xe), ye = q.clone(), ye.add(je), me = re.clone(), me.add(je), fe != Te ? (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5), he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5), Ie(p, q, oe, X, fe, Re, 0), Ie(p, oe, ye, X, Te, 0, De), Ie(p, re, he, X, fe, Re, 0), Ie(p, he, me, X, Te, 0, De)) : (Ie(p, q, ye, X, fe, Re, De), Ie(p, re, me, X, fe, Re, De)), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, (U || N) && (oe || (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5)), he || (he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5)), U && (G = new a.Cylinder(q, oe, X), H = new a.Cylinder(re, he, X), l.intersectionShape.cylinder.push(G), l.intersectionShape.cylinder.push(H)), N && (te = new a.Cylinder(ye, oe, X), ee = new a.Cylinder(me, he, X), le.intersectionShape.cylinder.push(te), le.intersectionShape.cylinder.push(ee)))) : l.bondOrder[B] == 3 && (X = L * w, Xe.cross(je), Xe.normalize(), Xe.multiplyScalar(X * 3), q = Oe.clone(), q.add(Xe), re = Oe.clone(), re.sub(Xe), ye = q.clone(), ye.add(je), me = re.clone(), me.add(je), fe != Te ? (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5), he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5), Ae = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5), Ie(p, q, oe, X, fe, Re, 0), Ie(p, oe, ye, X, Te, 0, De), Ie(p, Oe, Ae, X, fe, R, 0), Ie(p, Ae, Be, X, Te, 0, P), Ie(p, re, he, X, fe, Re, 0), Ie(p, he, me, X, Te, 0, De)) : (Ie(p, q, ye, X, fe, Re, De), Ie(p, Oe, Be, X, fe, R, P), Ie(p, re, me, X, fe, Re, De)), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, (U || N) && (oe || (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5)), he || (he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5)), Ae || (Ae = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5)), U && (G = new a.Cylinder(q.clone(), oe.clone(), X), H = new a.Cylinder(re.clone(), he.clone(), X), Q = new a.Cylinder(Oe.clone(), Ae.clone(), X), l.intersectionShape.cylinder.push(G), l.intersectionShape.cylinder.push(H), l.intersectionShape.cylinder.push(Q)), N && (te = new a.Cylinder(ye.clone(), oe.clone(), X), ee = new a.Cylinder(me.clone(), he.clone(), X), ce = new a.Cylinder(Be.clone(), Ae.clone(), X), le.intersectionShape.cylinder.push(te), le.intersectionShape.cylinder.push(ee), le.intersectionShape.cylinder.push(ce)))); + } else if (l.bondOrder[R] > 1) { + var Re = 0, Ce = 0; + L != v && (Re = 2, Ce = 2); + var je = Pe.clone(), Xe = null; + je.sub(ke); + var X, q, ne, xe, me; + Xe = this.getSideBondV(l, se, R), l.bondOrder[R] == 2 ? (X = L * E, Xe.multiplyScalar(X * 1.5), q = ke.clone(), q.add(Xe), ne = ke.clone(), ne.sub(Xe), xe = q.clone(), xe.add(je), me = ne.clone(), me.add(je), ie != ye ? (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5), ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5), Ie(p, q, ae, X, ie, Re, 0), Ie(p, ae, xe, X, ye, 0, Ce), Ie(p, ne, ce, X, ie, Re, 0), Ie(p, ce, me, X, ye, 0, Ce)) : (Ie(p, q, xe, X, ie, Re, Ce), Ie(p, ne, me, X, ie, Re, Ce)), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, (G || U) && (ae || (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5)), ce || (ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5)), G && (N = new a.Cylinder(q, ae, X), V = new a.Cylinder(ne, ce, X), l.intersectionShape.cylinder.push(N), l.intersectionShape.cylinder.push(V)), U && (re = new a.Cylinder(xe, ae, X), te = new a.Cylinder(me, ce, X), se.intersectionShape.cylinder.push(re), se.intersectionShape.cylinder.push(te)))) : l.bondOrder[R] == 3 && (X = L * w, Xe.cross(je), Xe.normalize(), Xe.multiplyScalar(X * 3), q = ke.clone(), q.add(Xe), ne = ke.clone(), ne.sub(Xe), xe = q.clone(), xe.add(je), me = ne.clone(), me.add(je), ie != ye ? (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5), ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5), Me = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5), Ie(p, q, ae, X, ie, Re, 0), Ie(p, ae, xe, X, ye, 0, Ce), Ie(p, ke, Me, X, ie, P, 0), Ie(p, Me, Pe, X, ye, 0, B), Ie(p, ne, ce, X, ie, Re, 0), Ie(p, ce, me, X, ye, 0, Ce)) : (Ie(p, q, xe, X, ie, Re, Ce), Ie(p, ke, Pe, X, ie, P, B), Ie(p, ne, me, X, ie, Re, Ce)), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, (G || U) && (ae || (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5)), ce || (ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5)), Me || (Me = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5)), G && (N = new a.Cylinder(q.clone(), ae.clone(), X), V = new a.Cylinder(ne.clone(), ce.clone(), X), J = new a.Cylinder(ke.clone(), Me.clone(), X), l.intersectionShape.cylinder.push(N), l.intersectionShape.cylinder.push(V), l.intersectionShape.cylinder.push(J)), U && (re = new a.Cylinder(xe.clone(), ae.clone(), X), te = new a.Cylinder(me.clone(), ce.clone(), X), ue = new a.Cylinder(Pe.clone(), Me.clone(), X), se.intersectionShape.cylinder.push(re), se.intersectionShape.cylinder.push(te), se.intersectionShape.cylinder.push(ue)))); } } } - var ze = !1, ke = 0, K = !1; - for (B = 0; B < l.bonds.length; B++) - W = z, l.bondStyles && l.bondStyles[B] && (V = l.bondStyles[B], V.singleBond && (W = !0), V.radius && V.radius != _ && (K = !0)), (W || l.bondOrder[B] == 1) && ke++; - K ? ke > 0 && (ze = !0) : ke == 0 && (l.bonds.length > 0 || c.showNonBonded) && (ze = !0), ze && (L = _, p.imposter ? this.drawSphereImposter(p.sphereGeometry, l, L, fe) : o.GLDraw.drawSphere(p, l, L, fe)); + var ze = !1, $e = 0, K = !1; + for (R = 0; R < l.bonds.length; R++) + W = I, l.bondStyles && l.bondStyles[R] && (H = l.bondStyles[R], H.singleBond && (W = !0), H.radius && H.radius != v && (K = !0)), (W || l.bondOrder[R] == 1) && $e++; + K ? $e > 0 && (ze = !0) : $e == 0 && (l.bonds.length > 0 || c.showNonBonded) && (ze = !0), ze && (L = v, p.imposter ? this.drawSphereImposter(p.sphereGeometry, l, L, ie) : o.GLDraw.drawSphere(p, l, L, ie)); } } } @@ -21062,79 +21084,79 @@ void main() { /** param {AtomSpec[]} atoms */ createMolObj(l, u) { u = u || {}; - var p = new r.Object3D(), g = [], b = {}, c = {}, _ = this.drawAtomSphere, E = null, w = null; - u.supportsImposters ? (_ = this.drawAtomImposter, E = new r.Geometry(!0), E.imposter = !0, w = new r.Geometry(!0, !0), w.imposter = !0, w.sphereGeometry = new r.Geometry(!0), w.sphereGeometry.imposter = !0, w.drawnCaps = {}) : u.supportsAIA ? (_ = this.drawAtomInstanced, E = new r.Geometry(!1, !0, !0), E.instanced = !0, w = new r.Geometry(!0)) : (E = new r.Geometry(!0), w = new r.Geometry(!0)); - var k, $, L, z, F = {}, R = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; + var p = new r.Object3D(), g = [], b = {}, c = {}, v = this.drawAtomSphere, E = null, w = null; + u.supportsImposters ? (v = this.drawAtomImposter, E = new r.Geometry(!0), E.imposter = !0, w = new r.Geometry(!0, !0), w.imposter = !0, w.sphereGeometry = new r.Geometry(!0), w.sphereGeometry.imposter = !0, w.drawnCaps = {}) : u.supportsAIA ? (v = this.drawAtomInstanced, E = new r.Geometry(!1, !0, !0), E.instanced = !0, w = new r.Geometry(!0)) : (E = new r.Geometry(!0), w = new r.Geometry(!0)); + var k, $, L, I, F = {}, P = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; for (k = 0, L = l.length; k < L; k++) { - var P = l[k]; - if (P && P.style) { - (P.clickable || P.hoverable) && P.intersectionShape === void 0 && (P.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), z = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; - for ($ in z) - P.style[$] ? P.style[$].opacity ? z[$] = parseFloat(P.style[$].opacity) : z[$] = 1 : z[$] = void 0, F[$] ? z[$] != null && F[$] != z[$] && (console.log("Warning: " + $ + " opacity is ambiguous"), F[$] = 1) : F[$] = z[$]; - _.call(this, P, E), this.drawAtomClickSphere(P), this.drawAtomCross(P, c), this.drawBondLines(P, l, b), this.drawBondSticks(P, l, w), typeof P.style.cartoon < "u" && !P.style.cartoon.hidden && (P.style.cartoon.color === "spectrum" && typeof P.resi == "number" && !P.hetflag && (P.resi < R[0] && (R[0] = P.resi), P.resi > R[1] && (R[1] = P.resi)), g.push(P)); + var B = l[k]; + if (B && B.style) { + (B.clickable || B.hoverable) && B.intersectionShape === void 0 && (B.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), I = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; + for ($ in I) + B.style[$] ? B.style[$].opacity ? I[$] = parseFloat(B.style[$].opacity) : I[$] = 1 : I[$] = void 0, F[$] ? I[$] != null && F[$] != I[$] && (console.log("Warning: " + $ + " opacity is ambiguous"), F[$] = 1) : F[$] = I[$]; + v.call(this, B, E), this.drawAtomClickSphere(B), this.drawAtomCross(B, c), this.drawBondLines(B, l, b), this.drawBondSticks(B, l, w), typeof B.style.cartoon < "u" && !B.style.cartoon.hidden && (B.style.cartoon.color === "spectrum" && typeof B.resi == "number" && !B.hetflag && (B.resi < P[0] && (P[0] = B.resi), B.resi > P[1] && (P[1] = B.resi)), g.push(B)); } } - if (g.length > 0 && (0, d.drawCartoon)(p, g, R, this.defaultCartoonQuality), E && E.vertices > 0) { + if (g.length > 0 && (0, d.drawCartoon)(p, g, P, this.defaultCartoonQuality), E && E.vertices > 0) { E.initTypedArrays(); - var U = null, N = null; - E.imposter ? U = new r.SphereImposterMaterial({ + var G = null, U = null; + E.imposter ? G = new r.SphereImposterMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }) : E.instanced ? (N = new r.Geometry(!0), o.GLDraw.drawSphere(N, { x: 0, y: 0, z: 0 }, 1, new h.Color(0.5, 0.5, 0.5)), N.initTypedArrays(), U = new r.InstancedMaterial({ + }) : E.instanced ? (U = new r.Geometry(!0), o.GLDraw.drawSphere(U, { x: 0, y: 0, z: 0 }, 1, new h.Color(0.5, 0.5, 0.5)), U.initTypedArrays(), G = new r.InstancedMaterial({ sphereMaterial: new r.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 }), - sphere: N - })) : U = new r.MeshLambertMaterial({ + sphere: U + })) : G = new r.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }), F.sphere < 1 && F.sphere >= 0 && (U.transparent = !0, U.opacity = F.sphere), N = new r.Mesh(E, U), p.add(N); + }), F.sphere < 1 && F.sphere >= 0 && (G.transparent = !0, G.opacity = F.sphere), U = new r.Mesh(E, G), p.add(U); } if (w.vertices > 0) { - var B = null, W = null, V = w.sphereGeometry; - (!V || typeof V.vertices > "u" || V.vertices == 0) && (V = null), w.initTypedArrays(), V && V.initTypedArrays(); - var G = { ambient: 0, vertexColors: !0, reflectivity: 0 }; - w.imposter ? (B = new r.StickImposterMaterial(G), W = new r.SphereImposterMaterial(G)) : (B = new r.MeshLambertMaterial(G), W = new r.MeshLambertMaterial(G), B.wireframe && (w.setUpWireframe(), V && V.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (B.transparent = !0, B.opacity = F.stick, W.transparent = !0, W.opacity = F.stick); - var H = new r.Mesh(w, B); - if (p.add(H), V) { - var Q = new r.Mesh(V, W); - p.add(Q); + var R = null, W = null, H = w.sphereGeometry; + (!H || typeof H.vertices > "u" || H.vertices == 0) && (H = null), w.initTypedArrays(), H && H.initTypedArrays(); + var N = { ambient: 0, vertexColors: !0, reflectivity: 0 }; + w.imposter ? (R = new r.StickImposterMaterial(N), W = new r.SphereImposterMaterial(N)) : (R = new r.MeshLambertMaterial(N), W = new r.MeshLambertMaterial(N), R.wireframe && (w.setUpWireframe(), H && H.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (R.transparent = !0, R.opacity = F.stick, W.transparent = !0, W.opacity = F.stick); + var V = new r.Mesh(w, R); + if (p.add(V), H) { + var J = new r.Mesh(H, W); + p.add(J); } } - var te; + var re; for (k in b) if (b.hasOwnProperty(k)) { - te = k; - var ee = new r.LineBasicMaterial({ - linewidth: te, + re = k; + var te = new r.LineBasicMaterial({ + linewidth: re, vertexColors: !0 }); - F.line < 1 && F.line >= 0 && (ee.transparent = !0, ee.opacity = F.line), b[k].initTypedArrays(); - var ce = new r.Line(b[k], ee, r.LineStyle.LinePieces); - p.add(ce); + F.line < 1 && F.line >= 0 && (te.transparent = !0, te.opacity = F.line), b[k].initTypedArrays(); + var ue = new r.Line(b[k], te, r.LineStyle.LinePieces); + p.add(ue); } for (k in c) if (c.hasOwnProperty(k)) { - te = k; - var fe = new r.LineBasicMaterial({ - linewidth: te, + re = k; + var ie = new r.LineBasicMaterial({ + linewidth: re, vertexColors: !0 }); - F.cross < 1 && F.cross >= 0 && (fe.transparent = !0, fe.opacity = F.cross), c[k].initTypedArrays(); - var oe = new r.Line(c[k], fe, r.LineStyle.LinePieces); - p.add(oe); + F.cross < 1 && F.cross >= 0 && (ie.transparent = !0, ie.opacity = F.cross), c[k].initTypedArrays(); + var ae = new r.Line(c[k], ie, r.LineStyle.LinePieces); + p.add(ae); } if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) { - var he = new r.Object3D(), Ae; - for (Ae = 0; Ae < this.modelData.symmetries.length; Ae++) { - var Se = new r.Object3D(); - Se = p.clone(), Se.matrix.copy(this.modelData.symmetries[Ae]), Se.matrixAutoUpdate = !1, he.add(Se); + var ce = new r.Object3D(), Me; + for (Me = 0; Me < this.modelData.symmetries.length; Me++) { + var Ae = new r.Object3D(); + Ae = p.clone(), Ae.matrix.copy(this.modelData.symmetries[Me]), Ae.matrixAutoUpdate = !1, ce.add(Ae); } - return he; + return ce; } return p; } @@ -21184,7 +21206,7 @@ void main() { */ setCrystData(l, u, p, g, b, c) { l = l || 1, u = u || 1, p = p || 1, g = g || 90, b = b || 90, c = c || 90; - const _ = (0, s.conversionMatrix3)(l, u, p, g, b, c); + const v = (0, s.conversionMatrix3)(l, u, p, g, b, c); this.modelData.cryst = { a: l, b: u, @@ -21192,7 +21214,7 @@ void main() { alpha: g, beta: b, gamma: c, - matrix: _ + matrix: v }; } /** @@ -21251,8 +21273,8 @@ void main() { //attoms aren't split across the box adjustCoordinatesToBox() { if (this.box && this.atomdfs) - for (var l = this.box[0], u = this.box[1], p = this.box[2], g = l * 0.9, b = u * 0.9, c = p * 0.9, _ = 0; _ < this.atomdfs.length; _++) - for (var E = this.atomdfs[_], w = 1; w < E.length; w++) { + for (var l = this.box[0], u = this.box[1], p = this.box[2], g = l * 0.9, b = u * 0.9, c = p * 0.9, v = 0; v < this.atomdfs.length; v++) + for (var E = this.atomdfs[v], w = 1; w < E.length; w++) { var k = this.atoms[E[w][0]], $ = this.atoms[E[w][1]]; k.x = this.adjustCoord($.x, k.x, g, l), k.y = this.adjustCoord($.y, k.y, b, u), k.z = this.adjustCoord($.z, k.z, c, p); } @@ -21269,8 +21291,8 @@ void main() { let g = this; return new Promise(function(b, c) { if (p == 0 && b(), (l < 0 || l >= p) && (l = p - 1), g.frames.url != null) { - var _ = g.frames.url; - (0, v.getbin)(_ + "/traj/frame/" + l + "/" + g.frames.path, void 0, "POST", void 0).then(function(E) { + var v = g.frames.url; + (0, _.getbin)(v + "/traj/frame/" + l + "/" + g.frames.path, void 0, "POST", void 0).then(function(E) { for (var w = new Float32Array(E, 44), k = 0, $ = 0; $ < g.atoms.length; $++) g.atoms[$].x = w[k++], g.atoms[$].y = w[k++], g.atoms[$].z = w[k++]; g.box && g.atomdfs && g.adjustCoordinatesToBox(), b(); @@ -21309,25 +21331,25 @@ void main() { }); */ vibrate(l = 10, u = 1, p = !1, g, b) { - var c = 0, _ = l; - p && (c = -l, _ = l), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), c < _ && (this.frames = []), p && (this.frames.origIndex = l); - for (var E = c; E < _; E++) { + var c = 0, v = l; + p && (c = -l, v = l), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), c < v && (this.frames = []), p && (this.frames.origIndex = l); + for (var E = c; E < v; E++) { var w = [], k = this.frames.length; if (E == 0 && !b) { this.frames.push(this.atoms); continue; } for (var $ = 0; $ < this.atoms.length; $++) { - var L = (0, v.getAtomProperty)(this.atoms[$], "dx"), z = (0, v.getAtomProperty)(this.atoms[$], "dy"), F = (0, v.getAtomProperty)(this.atoms[$], "dz"), R = new s.Vector3(L, z, F), P = new s.Vector3(this.atoms[$].x, this.atoms[$].y, this.atoms[$].z), U = E * u / l; - R.multiplyScalar(U), P.add(R); - var N = {}; - for (var B in this.atoms[$]) - N[B] = this.atoms[$][B]; - if (N.x = P.x, N.y = P.y, N.z = P.z, w.push(N), g && b) { - var W = (0, v.extend)({}, b), V = new s.Vector3(L, z, F); - if (V.multiplyScalar(u), V.add(P), W.start = P, W.end = V, W.frame = k, !W.color) { - var G = N.style.sphere; - G || (G = N.style.stick), G || (G = N.style.line), W.color = (0, v.getColorFromStyle)(N, G); + var L = (0, _.getAtomProperty)(this.atoms[$], "dx"), I = (0, _.getAtomProperty)(this.atoms[$], "dy"), F = (0, _.getAtomProperty)(this.atoms[$], "dz"), P = new s.Vector3(L, I, F), B = new s.Vector3(this.atoms[$].x, this.atoms[$].y, this.atoms[$].z), G = E * u / l; + P.multiplyScalar(G), B.add(P); + var U = {}; + for (var R in this.atoms[$]) + U[R] = this.atoms[$][R]; + if (U.x = B.x, U.y = B.y, U.z = B.z, w.push(U), g && b) { + var W = (0, _.extend)({}, b), H = new s.Vector3(L, I, F); + if (H.multiplyScalar(u), H.add(B), W.start = B, W.end = H, W.frame = k, !W.color) { + var N = U.style.sphere; + N || (N = U.style.stick), N || (N = U.style.line), W.color = (0, _.getColorFromStyle)(U, N); } g.addArrow(W); } @@ -21339,7 +21361,7 @@ void main() { setAtomDefaults(l) { for (let u = 0; u < l.length; u++) { let p = l[u]; - p && (p.style = p.style || (0, v.deepCopy)(M.defaultAtomStyle), p.color = p.color || this.ElementColors[p.elem] || this.defaultColor, p.model = this.id, (p.clickable || p.hoverable) && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] })); + p && (p.style = p.style || (0, _.deepCopy)(M.defaultAtomStyle), p.color = p.color || this.ElementColors[p.elem] || this.defaultColor, p.model = this.id, (p.clickable || p.hoverable) && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] })); } } /** add atoms to this model from molecular data string @@ -21353,17 +21375,17 @@ void main() { this.dontDuplicateAtoms = !p.duplicateAssemblyAtoms; var b = g.modelData; if (b && (Array.isArray(b) ? (this.modelData = b[0], p.frames && (this.modelDatas = b)) : this.modelData = b), g.box ? this.box = g.box : this.box = null, this.frames.length == 0) { - for (let _ = 0; _ < g.length; _++) - g[_].length != 0 && this.frames.push(g[_]); + for (let v = 0; v < g.length; v++) + g[v].length != 0 && this.frames.push(g[v]); this.frames[0] && (this.atoms = this.frames[0]); } else if (p.frames) - for (let _ = 0; _ < g.length; _++) - this.frames.push(g[_]); + for (let v = 0; v < g.length; v++) + this.frames.push(g[v]); else for (var c = 0; c < g.length; c++) this.addAtoms(g[c]); - for (let _ = 0; _ < this.frames.length; _++) - this.setAtomDefaults(this.frames[_]); + for (let v = 0; v < this.frames.length; v++) + this.setAtomDefaults(this.frames[v]); p.vibrate && p.vibrate.frames && p.vibrate.amplitude && this.vibrate(p.vibrate.frames, p.vibrate.amplitude), p.style && this.setStyle({}, p.style); } setDontDuplicateAtoms(l) { @@ -21407,14 +21429,14 @@ void main() { } else typeof b == "object" && g != "properties" && g != "model" ? p[g] = M.deepCopyAndCache(b, u) : p[g] = b; if (g == "and" || g == "or") { const c = []; - for (const _ of p[g]) { + for (const v of p[g]) { const E = /* @__PURE__ */ new Set(); - for (const w of u.selectedAtoms(_)) + for (const w of u.selectedAtoms(v)) E.add(w.index); c.push(E); } if (g == "and") { - const _ = function(w, k) { + const v = function(w, k) { const $ = /* @__PURE__ */ new Set(); for (const L of k) w.has(L) && $.add(L); @@ -21422,14 +21444,14 @@ void main() { }; let E = new Set(c[0]); for (const w of c.splice(1)) - E = _(E, w); + E = v(E, w); p[g].__cached_results = E; } else if (g == "or") { - const _ = /* @__PURE__ */ new Set(); + const v = /* @__PURE__ */ new Set(); for (const E of c) for (const w of E) - _.add(w); - p[g].__cached_results = _; + v.add(w); + p[g].__cached_results = v; } } } @@ -21477,7 +21499,7 @@ void main() { g = !1; break; } - var _ = !1; + var v = !1; if (b === "bonds") { var E = u[b]; if (E != l.bonds.length) { @@ -21488,10 +21510,10 @@ void main() { var w = u[b], k = l[b]; for (let $ = 0; $ < w.length; $++) if (this.propertyMatches(k, w[$])) { - _ = !0; + v = !0; break; } - if (!_) { + if (!v) { g = !1; break; } @@ -21521,12 +21543,12 @@ void main() { expandAtomList(l, u) { if (u <= 0) return l; - for (var p = (0, v.getExtent)(l, void 0), g = [[], [], []], b = 0; b < 3; b++) + for (var p = (0, _.getExtent)(l, void 0), g = [[], [], []], b = 0; b < 3; b++) g[0][b] = p[0][b] - u, g[1][b] = p[1][b] + u, g[2][b] = p[2][b]; var c = []; for (let k = 0; k < this.atoms.length; k++) { - var _ = this.atoms[k].x, E = this.atoms[k].y, w = this.atoms[k].z; - _ >= g[0][0] && _ <= g[1][0] && E >= g[0][1] && E <= g[1][1] && w >= g[0][2] && w <= g[1][2] && (_ >= p[0][0] && _ <= p[1][0] && E >= p[0][1] && E <= p[1][1] && w >= p[0][2] && w <= p[1][2] || c.push(this.atoms[k])); + var v = this.atoms[k].x, E = this.atoms[k].y, w = this.atoms[k].z; + v >= g[0][0] && v <= g[1][0] && E >= g[0][1] && E <= g[1][1] && w >= g[0][2] && w <= g[1][2] && (v >= p[0][0] && v <= p[1][0] && E >= p[0][1] && E <= p[1][1] && w >= p[0][2] && w <= p[1][2] || c.push(this.atoms[k])); } return c; } @@ -21555,22 +21577,22 @@ void main() { c && this.atomIsSelected(c, l) && p.push(c); } if (l.hasOwnProperty("expand")) { - const N = M.getFloat(l.expand); - let B = this.expandAtomList(p, N), W = p.length; - const V = N * N; - for (let G = 0; G < B.length; G++) - for (let H = 0; H < W; H++) { - var _ = M.squaredDistance(B[G], p[H]); - _ < V && _ > 0 && p.push(B[G]); + const U = M.getFloat(l.expand); + let R = this.expandAtomList(p, U), W = p.length; + const H = U * U; + for (let N = 0; N < R.length; N++) + for (let V = 0; V < W; V++) { + var v = M.squaredDistance(R[N], p[V]); + v < H && v > 0 && p.push(R[N]); } } if (l.hasOwnProperty("within") && l.within.hasOwnProperty("sel") && l.within.hasOwnProperty("distance")) { var E = this.selectedAtoms(l.within.sel, this.atoms), w = {}; - const N = M.getFloat(l.within.distance), B = N * N; + const U = M.getFloat(l.within.distance), R = U * U; for (let W = 0; W < E.length; W++) - for (let V = 0; V < p.length; V++) { - let G = M.squaredDistance(E[W], p[V]); - G < B && G > 0 && (w[V] = 1); + for (let H = 0; H < p.length; H++) { + let N = M.squaredDistance(E[W], p[H]); + N < R && N > 0 && (w[H] = 1); } var k = []; if (l.within.invert) @@ -21582,17 +21604,17 @@ void main() { p = k; } if (l.hasOwnProperty("byres")) { - var $ = {}, L = [], z = []; - for (let N = 0; N < p.length; N++) { - let B = p[N]; - var F = B.chain, R = B.resi; - if ($[F] === void 0 && ($[F] = {}), B.hasOwnProperty("resi") && $[F][R] === void 0) { - for ($[F][R] = !0, z.push(B); z.length > 0; ) - if (B = z.pop(), F = B.chain, R = B.resi, L[B.index] === void 0) { - L[B.index] = !0; - for (var P = 0; P < B.bonds.length; P++) { - var U = this.atoms[B.bonds[P]]; - L[U.index] === void 0 && U.hasOwnProperty("resi") && U.chain == F && U.resi == R && (z.push(U), p.push(U)); + var $ = {}, L = [], I = []; + for (let U = 0; U < p.length; U++) { + let R = p[U]; + var F = R.chain, P = R.resi; + if ($[F] === void 0 && ($[F] = {}), R.hasOwnProperty("resi") && $[F][P] === void 0) { + for ($[F][P] = !0, I.push(R); I.length > 0; ) + if (R = I.pop(), F = R.chain, P = R.resi, L[R.index] === void 0) { + L[R.index] = !0; + for (var B = 0; B < R.bonds.length; B++) { + var G = this.atoms[R.bonds[B]]; + L[G.index] === void 0 && G.hasOwnProperty("resi") && G.chain == F && G.resi == P && (I.push(G), p.push(G)); } } } @@ -21619,13 +21641,13 @@ void main() { for (g = 0; g < l.length; g++) typeof l[g].index > "u" && (l[g].index = g), typeof l[g].serial > "u" && (l[g].serial = g), p[l[g].index] = u + g; for (g = 0; g < l.length; g++) { - var b = l[g], c = p[b.index], _ = (0, v.extend)({}, b); - _.index = c, _.bonds = [], _.bondOrder = [], _.model = this.id, _.style = _.style || (0, v.deepCopy)(M.defaultAtomStyle), typeof _.color > "u" && (_.color = this.ElementColors[_.elem] || this.defaultColor); + var b = l[g], c = p[b.index], v = (0, _.extend)({}, b); + v.index = c, v.bonds = [], v.bondOrder = [], v.model = this.id, v.style = v.style || (0, _.deepCopy)(M.defaultAtomStyle), typeof v.color > "u" && (v.color = this.ElementColors[v.elem] || this.defaultColor); for (var E = b.bonds ? b.bonds.length : 0, w = 0; w < E; w++) { var k = p[b.bonds[w]]; - typeof k < "u" && (_.bonds.push(k), _.bondOrder.push(b.bondOrder ? b.bondOrder[w] : 1)); + typeof k < "u" && (v.bonds.push(k), v.bondOrder.push(b.bondOrder ? b.bondOrder[w] : 1)); } - this.atoms.push(_); + this.atoms.push(v); } } /** Assign bonds based on atomic coordinates. @@ -21672,7 +21694,7 @@ void main() { }); */ setStyle(l, u, p) { - typeof u > "u" && typeof p > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, v.specStringToObject)(u)); + typeof u > "u" && typeof p > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, _.specStringToObject)(u)); var g = !1, b = this, c = function(E) { var w = b.selectedAtoms(l, E); for (let k = 0; k < E.length; k++) @@ -21688,8 +21710,8 @@ void main() { E < 0 && (E = this.frames.length + E), c(this.frames[E]); } else { c(this.atoms); - for (var _ = 0; _ < this.frames.length; _++) - this.frames[_] !== this.atoms && c(this.frames[_]); + for (var v = 0; v < this.frames.length; v++) + this.frames[v] !== this.atoms && c(this.frames[v]); } g && (this.molObj = null); } @@ -21701,7 +21723,7 @@ void main() { */ setClickable(l, u, p) { - if (u = !!u, p = (0, v.makeFunction)(p), p === null) { + if (u = !!u, p = (0, _.makeFunction)(p), p === null) { console.log("Callback is not a function"); return; } @@ -21718,7 +21740,7 @@ void main() { * @param {function} unhover_callback - function called when the mouse moves out of the hover area */ setHoverable(l, u, p, g) { - if (u = !!u, p = (0, v.makeFunction)(p), g = (0, v.makeFunction)(g), p === null) { + if (u = !!u, p = (0, _.makeFunction)(p), g = (0, _.makeFunction)(g), p === null) { console.log("Hover_callback is not a function"); return; } @@ -21727,8 +21749,8 @@ void main() { return; } var b = this.selectedAtoms(l, this.atoms), c = b.length; - for (let _ = 0; _ < c; _++) - b[_].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[_].hoverable = u, p && (b[_].hover_callback = p), g && (b[_].unhover_callback = g); + for (let v = 0; v < c; v++) + b[v].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[v].hoverable = u, p && (b[v].hover_callback = p), g && (b[v].unhover_callback = g); c > 0 && (this.molObj = null); } /** enable context menu of selected atoms @@ -21765,10 +21787,10 @@ void main() { * @param {Gradient|string} scheme */ setColorByProperty(l, u, p, g) { - var b, c, _ = this.selectedAtoms(l, _); - for (this.lastColors = null, _.length > 0 && (this.molObj = null), typeof p == "string" && typeof f.Gradient.builtinGradients[p] < "u" && (p = new f.Gradient.builtinGradients[p]()), p = p, g || (g = p.range()), g || (g = (0, v.getPropertyRange)(_, u)), b = 0; b < _.length; b++) { - c = _[b]; - var E = (0, v.getAtomProperty)(c, u); + var b, c, v = this.selectedAtoms(l, v); + for (this.lastColors = null, v.length > 0 && (this.molObj = null), typeof p == "string" && typeof f.Gradient.builtinGradients[p] < "u" && (p = new f.Gradient.builtinGradients[p]()), p = p, g || (g = p.range()), g || (g = (0, _.getPropertyRange)(v, u)), b = 0; b < v.length; b++) { + c = v[b]; + var E = (0, _.getAtomProperty)(c, u); E != null && (c.color = p.valueToHex(parseFloat(c.properties[u]), g)); } } @@ -21815,14 +21837,14 @@ void main() { p === u.s.length && u.s.push(c.style), p !== 0 && (b.s = p); } u.a.push(b); - for (let _ = 0; _ < c.bonds.length; _++) { - let E = g, w = c.bonds[_]; + for (let v = 0; v < c.bonds.length; v++) { + let E = g, w = c.bonds[v]; if (E >= w) continue; let k = { b: E, e: w - }, $ = c.bondOrder[_]; + }, $ = c.bondOrder[v]; $ != 1 && (k.o = $), u.b.push(k); } } @@ -21889,8 +21911,8 @@ void main() { * @param {LabelSpec} options */ addPropertyLabels(l, u, p, g) { - for (var b = this.selectedAtoms(u, b), c = (0, v.deepCopy)(g), _ = 0; _ < b.length; _++) { - var E = b[_], w = null; + for (var b = this.selectedAtoms(u, b), c = (0, _.deepCopy)(g), v = 0; v < b.length; v++) { + var E = b[v], w = null; typeof E[l] < "u" ? w = String(E[l]) : typeof E.properties[l] < "u" && (w = String(E.properties[l])), w != null && (c.position = E, p.addLabel(w, c)); } } @@ -21906,30 +21928,30 @@ void main() { addResLabels(l, u, p, g = !1) { var b = [], c = function(E, w) { for (var k = E.selectedAtoms(l, k), $ = {}, L = 0; L < k.length; L++) { - var z = k[L], F = z.chain, R = z.resn, P = z.resi, U = R + "" + P; - $[F] || ($[F] = {}), $[F][U] || ($[F][U] = []), $[F][U].push(z); + var I = k[L], F = I.chain, P = I.resn, B = I.resi, G = P + "" + B; + $[F] || ($[F] = {}), $[F][G] || ($[F][G] = []), $[F][G].push(I); } - var N = (0, v.deepCopy)(p); + var U = (0, _.deepCopy)(p); for (let W in $) if ($.hasOwnProperty(W)) { - var B = $[W]; - for (let V in B) - if (B.hasOwnProperty(V)) { - let G = B[V], H = new s.Vector3(0, 0, 0); - for (let te = 0; te < G.length; te++) { - let ee = G[te]; - H.x += ee.x, H.y += ee.y, H.z += ee.z; + var R = $[W]; + for (let H in R) + if (R.hasOwnProperty(H)) { + let N = R[H], V = new s.Vector3(0, 0, 0); + for (let re = 0; re < N.length; re++) { + let te = N[re]; + V.x += te.x, V.y += te.y, V.z += te.z; } - H.divideScalar(G.length), N.position = H, N.frame = w; - let Q = u.addLabel(V, N, void 0, !0); - b.push(Q); + V.divideScalar(N.length), U.position = V, U.frame = w; + let J = u.addLabel(H, U, void 0, !0); + b.push(J); } } }; if (g) { - var _ = this.getNumFrames(); + var v = this.getNumFrames(); let E = this.atoms; - for (let w = 0; w < _; w++) + for (let w = 0; w < v; w++) this.frames[w] && (this.atoms = this.frames[w], c(this, w)); this.atoms = E; } else @@ -21941,13 +21963,13 @@ void main() { this.atomdfs = []; var l = this, u = new Int8Array(this.atoms.length); u.fill(0); - for (var p = function(_, E, w) { - w.push([_, E]); - var k = l.atoms[_]; - u[_] = 1; + for (var p = function(v, E, w) { + w.push([v, E]); + var k = l.atoms[v]; + u[v] = 1; for (var $ = 0; $ < k.bonds.length; $++) { var L = k.bonds[$]; - l.atoms[L] && !u[L] && p(L, _, w); + l.atoms[L] && !u[L] && p(L, v, w); } }, g = 0; g < this.atoms.length; g++) { var b = this.atoms[g]; @@ -21966,7 +21988,7 @@ void main() { setCoordinatesFromURL(l, u) { this.frames = []; var p = this; - return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, v.get)(l + "/traj/numframes/" + u, function(g) { + return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, _.get)(l + "/traj/numframes/" + u, function(g) { if (!isNaN(parseInt(g))) return p.frames.push(p.atoms), p.frames.numFrames = g, p.frames.url = l, p.frames.path = u, p.setFrame(0); }); @@ -21991,7 +22013,7 @@ void main() { if (/\.gz$/.test(u)) { u = u.replace(/\.gz$/, ""); try { - l = (0, v.inflateString)(l); + l = (0, _.inflateString)(l); } catch ($) { console.log($); } @@ -22000,13 +22022,13 @@ void main() { if (p.hasOwnProperty(u)) { this.frames = []; for (var g = this.atoms.length, b = M.parseCrd(l, u), c = 0; c < b.length; ) { - for (var _ = [], E = 0; E < g; E++) { + for (var v = [], E = 0; E < g; E++) { var w = {}; for (var k in this.atoms[E]) w[k] = this.atoms[E][k]; - _[E] = w, _[E].x = b[c++], _[E].y = b[c++], _[E].z = b[c++]; + v[E] = w, v[E].x = b[c++], v[E].y = b[c++], v[E].z = b[c++]; } - this.frames.push(_); + this.frames.push(v); } return this.atoms = this.frames[0], this.frames; } @@ -22047,10 +22069,10 @@ ATOM`, b); if (u == "array" || Array.isArray(l)) return l.flat(2); { - let _ = l.indexOf(` + let v = l.indexOf(` `); - u == "inpcrd" && (_ = l.indexOf(` -`, _ + 1)), l = l.slice(_ + 1), p = l.match(/\S+/g).map(parseFloat); + u == "inpcrd" && (v = l.indexOf(` +`, v + 1)), l = l.slice(v + 1), p = l.match(/\S+/g).map(parseFloat); } } return p; @@ -22061,7 +22083,7 @@ ATOM`, b); if (/\.gz$/.test(u)) { u = u.replace(/\.gz$/, ""); try { - u.match(/bcif/i) ? l = (0, v.inflateString)(l, !1) : l = (0, v.inflateString)(l); + u.match(/bcif/i) ? l = (0, _.inflateString)(l, !1) : l = (0, _.inflateString)(l); } catch (c) { console.log(c); } @@ -22169,7 +22191,7 @@ ATOM`, b); ), d = t( /*! ./VolumeData */ "./src/VolumeData.ts" - ), v = t( + ), _ = t( /*! ./GLDraw */ "./src/GLDraw.ts" ), f = t( @@ -22195,13 +22217,13 @@ ATOM`, b); var u, p, g; l.constructor !== Array && (u = l.r, p = l.g, g = l.b); for (let b in m.geometryGroups) { - let c = m.geometryGroups[b], _ = c.colorArray; + let c = m.geometryGroups[b], v = c.colorArray; for (let E = 0, w = c.vertices; E < w; ++E) { if (l.constructor === Array) { let k = l[E]; u = k.r, p = k.g, g = k.b; } - _[E * 3] = u, _[E * 3 + 1] = p, _[E * 3 + 2] = g; + v[E * 3] = u, v[E * 3 + 1] = p, v[E * 3 + 2] = g; } } } @@ -22214,43 +22236,43 @@ ATOM`, b); * spec */ static drawArrow(m, l, u) { - var p = u.start, g = u.end, b = u.radius, c = u.radiusRatio, _ = u.mid, E = u.midpos; + var p = u.start, g = u.end, b = u.radius, c = u.radiusRatio, v = u.mid, E = u.midpos; if (!(p && g)) return; var w = l.updateGeoGroup(51), k = new s.Vector3(g.x, g.y, g.z).sub(p); if (E) { - let ue = k.length(); - E > 0 ? _ = E / ue : _ = (ue + E) / ue; + let de = k.length(); + E > 0 ? v = E / de : v = (de + E) / de; } - k.multiplyScalar(_); + k.multiplyScalar(v); var $ = new s.Vector3(p.x, p.y, p.z).add(k), L = k.clone().negate(); - let z = new s.Vector3(p.x, p.y, p.z); - m.intersectionShape.cylinder.push(new a.Cylinder(z, $.clone(), b)), m.intersectionShape.sphere.push(new a.Sphere(z, b)); + let I = new s.Vector3(p.x, p.y, p.z); + m.intersectionShape.cylinder.push(new a.Cylinder(I, $.clone(), b)), m.intersectionShape.sphere.push(new a.Sphere(I, b)); var F = []; F[0] = k.clone(), Math.abs(F[0].x) > 1e-4 ? F[0].y += 1 : F[0].x += 1, F[0].cross(k), F[0].normalize(), F[4] = F[0].clone(), F[4].crossVectors(F[0], k), F[4].normalize(), F[8] = F[0].clone().negate(), F[12] = F[4].clone().negate(), F[2] = F[0].clone().add(F[4]).normalize(), F[6] = F[4].clone().add(F[8]).normalize(), F[10] = F[8].clone().add(F[12]).normalize(), F[14] = F[12].clone().add(F[0]).normalize(), F[1] = F[0].clone().add(F[2]).normalize(), F[3] = F[2].clone().add(F[4]).normalize(), F[5] = F[4].clone().add(F[6]).normalize(), F[7] = F[6].clone().add(F[8]).normalize(), F[9] = F[8].clone().add(F[10]).normalize(), F[11] = F[10].clone().add(F[12]).normalize(), F[13] = F[12].clone().add(F[14]).normalize(), F[15] = F[14].clone().add(F[0]).normalize(); - var R = w.vertices, P = w.vertexArray, U = w.faceArray, N = w.normalArray, B = w.lineArray, W, V, G; - for (V = 0, G = F.length; V < G; ++V) { - W = 3 * (R + 3 * V); - var H = F[V].clone().multiplyScalar(b).add(p), Q = F[V].clone().multiplyScalar(b).add($), te = F[V].clone().multiplyScalar(b * c).add($); - if (P[W] = H.x, P[W + 1] = H.y, P[W + 2] = H.z, P[W + 3] = Q.x, P[W + 4] = Q.y, P[W + 5] = Q.z, P[W + 6] = te.x, P[W + 7] = te.y, P[W + 8] = te.z, V > 0) { - var ee = P[W - 3], ce = P[W - 2], fe = P[W - 1], oe = new s.Vector3(ee, ce, fe), he = new s.Vector3(g.x, g.y, g.z), Ae = $.clone(), Se = new s.Vector3(te.x, te.y, te.z); - m.intersectionShape.triangle.push(new a.Triangle(Se, he, oe)), m.intersectionShape.triangle.push(new a.Triangle(oe.clone(), Ae, Se.clone())); + var P = w.vertices, B = w.vertexArray, G = w.faceArray, U = w.normalArray, R = w.lineArray, W, H, N; + for (H = 0, N = F.length; H < N; ++H) { + W = 3 * (P + 3 * H); + var V = F[H].clone().multiplyScalar(b).add(p), J = F[H].clone().multiplyScalar(b).add($), re = F[H].clone().multiplyScalar(b * c).add($); + if (B[W] = V.x, B[W + 1] = V.y, B[W + 2] = V.z, B[W + 3] = J.x, B[W + 4] = J.y, B[W + 5] = J.z, B[W + 6] = re.x, B[W + 7] = re.y, B[W + 8] = re.z, H > 0) { + var te = B[W - 3], ue = B[W - 2], ie = B[W - 1], ae = new s.Vector3(te, ue, ie), ce = new s.Vector3(g.x, g.y, g.z), Me = $.clone(), Ae = new s.Vector3(re.x, re.y, re.z); + m.intersectionShape.triangle.push(new a.Triangle(Ae, ce, ae)), m.intersectionShape.triangle.push(new a.Triangle(ae.clone(), Me, Ae.clone())); } } - w.vertices += 48, W = w.vertices * 3, P[W] = p.x, P[W + 1] = p.y, P[W + 2] = p.z, P[W + 3] = $.x, P[W + 4] = $.y, P[W + 5] = $.z, P[W + 6] = g.x, P[W + 7] = g.y, P[W + 8] = g.z, w.vertices += 3; - var Ie, pe, le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re, De, je, Xe, X, q, re, ye, me = w.vertices - 3, ze = w.vertices - 2, ke = w.vertices - 1, K = me * 3, ae = ze * 3, ge = ke * 3; - for (V = 0, G = F.length - 1; V < G; ++V) { - var xe = R + 3 * V; - W = xe * 3, pe = w.faceidx, le = w.lineidx, ne = xe, Ge = ne * 3, Te = xe + 1, Ne = Te * 3, Oe = xe + 2, Re = Oe * 3, Be = xe + 4, De = Be * 3, Ue = xe + 5, je = Ue * 3, Pe = xe + 3, Xe = Pe * 3, X = q = F[V], re = ye = F[V + 1], N[Ge] = X.x, N[Ne] = q.x, N[Xe] = ye.x, N[Ge + 1] = X.y, N[Ne + 1] = q.y, N[Xe + 1] = ye.y, N[Ge + 2] = X.z, N[Ne + 2] = q.z, N[Xe + 2] = ye.z, N[Ne] = q.x, N[De] = re.x, N[Xe] = ye.x, N[Ne + 1] = q.y, N[De + 1] = re.y, N[Xe + 1] = ye.y, N[Ne + 2] = q.z, N[De + 2] = re.z, N[Xe + 2] = ye.z, N[Re] = q.x, N[je] = re.x, N[Re + 1] = q.y, N[je + 1] = re.y, N[Re + 2] = q.z, N[je + 2] = re.z, U[pe] = ne, U[pe + 1] = Te, U[pe + 2] = Pe, U[pe + 3] = Te, U[pe + 4] = Be, U[pe + 5] = Pe, U[pe + 6] = ne, U[pe + 7] = Pe, U[pe + 8] = me, U[pe + 9] = Oe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Oe, U[pe + 13] = ke, U[pe + 14] = Ue, B[le] = ne, B[le + 1] = Te, B[le + 2] = ne, B[le + 3] = Pe, B[le + 4] = Be, B[le + 5] = Pe, B[le + 6] = ne, B[le + 7] = Pe, B[le + 8] = Oe, B[le + 9] = Te, B[le + 10] = Oe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Oe, B[le + 15] = ke, B[le + 16] = Oe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20; + w.vertices += 48, W = w.vertices * 3, B[W] = p.x, B[W + 1] = p.y, B[W + 2] = p.z, B[W + 3] = $.x, B[W + 4] = $.y, B[W + 5] = $.z, B[W + 6] = g.x, B[W + 7] = g.y, B[W + 8] = g.z, w.vertices += 3; + var Ie, pe, se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re, Ce, je, Xe, X, q, ne, xe, me = w.vertices - 3, ze = w.vertices - 2, $e = w.vertices - 1, K = me * 3, oe = ze * 3, ge = $e * 3; + for (H = 0, N = F.length - 1; H < N; ++H) { + var we = P + 3 * H; + W = we * 3, pe = w.faceidx, se = w.lineidx, Q = we, Ge = Q * 3, ye = we + 1, Ue = ye * 3, ke = we + 2, Re = ke * 3, Pe = we + 4, Ce = Pe * 3, Ne = we + 5, je = Ne * 3, Be = we + 3, Xe = Be * 3, X = q = F[H], ne = xe = F[H + 1], U[Ge] = X.x, U[Ue] = q.x, U[Xe] = xe.x, U[Ge + 1] = X.y, U[Ue + 1] = q.y, U[Xe + 1] = xe.y, U[Ge + 2] = X.z, U[Ue + 2] = q.z, U[Xe + 2] = xe.z, U[Ue] = q.x, U[Ce] = ne.x, U[Xe] = xe.x, U[Ue + 1] = q.y, U[Ce + 1] = ne.y, U[Xe + 1] = xe.y, U[Ue + 2] = q.z, U[Ce + 2] = ne.z, U[Xe + 2] = xe.z, U[Re] = q.x, U[je] = ne.x, U[Re + 1] = q.y, U[je + 1] = ne.y, U[Re + 2] = q.z, U[je + 2] = ne.z, G[pe] = Q, G[pe + 1] = ye, G[pe + 2] = Be, G[pe + 3] = ye, G[pe + 4] = Pe, G[pe + 5] = Be, G[pe + 6] = Q, G[pe + 7] = Be, G[pe + 8] = me, G[pe + 9] = ke, G[pe + 10] = ze, G[pe + 11] = Ne, G[pe + 12] = ke, G[pe + 13] = $e, G[pe + 14] = Ne, R[se] = Q, R[se + 1] = ye, R[se + 2] = Q, R[se + 3] = Be, R[se + 4] = Pe, R[se + 5] = Be, R[se + 6] = Q, R[se + 7] = Be, R[se + 8] = ke, R[se + 9] = ye, R[se + 10] = ke, R[se + 11] = Ne, R[se + 12] = Pe, R[se + 13] = Ne, R[se + 14] = ke, R[se + 15] = $e, R[se + 16] = ke, R[se + 17] = Ne, R[se + 18] = $e, R[se + 19] = Ne, w.faceidx += 15, w.lineidx += 20; } Ie = [ - R + 45, - R + 46, - R + 1, - R, - R + 47, - R + 2 - ], pe = w.faceidx, le = w.lineidx, ne = Ie[0], Ge = ne * 3, Te = Ie[1], Ne = Te * 3, Oe = Ie[4], Re = Oe * 3, Be = Ie[2], De = Be * 3, Ue = Ie[5], je = Ue * 3, Pe = Ie[3], Xe = Pe * 3, X = q = F[15], re = ye = F[0], N[Ge] = X.x, N[Ne] = q.x, N[Xe] = ye.x, N[Ge + 1] = X.y, N[Ne + 1] = q.y, N[Xe + 1] = ye.y, N[Ge + 2] = X.z, N[Ne + 2] = q.z, N[Xe + 2] = ye.z, N[Ne] = q.x, N[De] = re.x, N[Xe] = ye.x, N[Ne + 1] = q.y, N[De + 1] = re.y, N[Xe + 1] = ye.y, N[Ne + 2] = q.z, N[De + 2] = re.z, N[Xe + 2] = ye.z, N[Re] = q.x, N[je] = re.x, N[Re + 1] = q.y, N[je + 1] = re.y, N[Re + 2] = q.z, N[je + 2] = re.z, k.normalize(), L.normalize(), N[K] = L.x, N[ae] = N[ge] = k.x, N[K + 1] = L.y, N[ae + 1] = N[ge + 1] = k.y, N[K + 2] = L.z, N[ae + 2] = N[ge + 2] = k.z, U[pe] = ne, U[pe + 1] = Te, U[pe + 2] = Pe, U[pe + 3] = Te, U[pe + 4] = Be, U[pe + 5] = Pe, U[pe + 6] = ne, U[pe + 7] = Pe, U[pe + 8] = me, U[pe + 9] = Oe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Oe, U[pe + 13] = ke, U[pe + 14] = Ue, B[le] = ne, B[le + 1] = Te, B[le + 2] = ne, B[le + 3] = Pe, B[le + 4] = Be, B[le + 5] = Pe, B[le + 6] = ne, B[le + 7] = Pe, B[le + 8] = Oe, B[le + 9] = Te, B[le + 10] = Oe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Oe, B[le + 15] = ke, B[le + 16] = Oe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20; + P + 45, + P + 46, + P + 1, + P, + P + 47, + P + 2 + ], pe = w.faceidx, se = w.lineidx, Q = Ie[0], Ge = Q * 3, ye = Ie[1], Ue = ye * 3, ke = Ie[4], Re = ke * 3, Pe = Ie[2], Ce = Pe * 3, Ne = Ie[5], je = Ne * 3, Be = Ie[3], Xe = Be * 3, X = q = F[15], ne = xe = F[0], U[Ge] = X.x, U[Ue] = q.x, U[Xe] = xe.x, U[Ge + 1] = X.y, U[Ue + 1] = q.y, U[Xe + 1] = xe.y, U[Ge + 2] = X.z, U[Ue + 2] = q.z, U[Xe + 2] = xe.z, U[Ue] = q.x, U[Ce] = ne.x, U[Xe] = xe.x, U[Ue + 1] = q.y, U[Ce + 1] = ne.y, U[Xe + 1] = xe.y, U[Ue + 2] = q.z, U[Ce + 2] = ne.z, U[Xe + 2] = xe.z, U[Re] = q.x, U[je] = ne.x, U[Re + 1] = q.y, U[je + 1] = ne.y, U[Re + 2] = q.z, U[je + 2] = ne.z, k.normalize(), L.normalize(), U[K] = L.x, U[oe] = U[ge] = k.x, U[K + 1] = L.y, U[oe + 1] = U[ge + 1] = k.y, U[K + 2] = L.z, U[oe + 2] = U[ge + 2] = k.z, G[pe] = Q, G[pe + 1] = ye, G[pe + 2] = Be, G[pe + 3] = ye, G[pe + 4] = Pe, G[pe + 5] = Be, G[pe + 6] = Q, G[pe + 7] = Be, G[pe + 8] = me, G[pe + 9] = ke, G[pe + 10] = ze, G[pe + 11] = Ne, G[pe + 12] = ke, G[pe + 13] = $e, G[pe + 14] = Ne, R[se] = Q, R[se + 1] = ye, R[se + 2] = Q, R[se + 3] = Be, R[se + 4] = Pe, R[se + 5] = Be, R[se + 6] = Q, R[se + 7] = Be, R[se + 8] = ke, R[se + 9] = ye, R[se + 10] = ke, R[se + 11] = Ne, R[se + 12] = Pe, R[se + 13] = Ne, R[se + 14] = ke, R[se + 15] = $e, R[se + 16] = ke, R[se + 17] = Ne, R[se + 18] = $e, R[se + 19] = Ne, w.faceidx += 15, w.lineidx += 20; } // Update a bounding sphere's position and radius // from list of centroids and new points @@ -22265,39 +22287,39 @@ ATOM`, b); */ static updateBoundingFromPoints(m, l, u, p) { m.center.set(0, 0, 0); - let g = 1 / 0, b = 1 / 0, c = 1 / 0, _ = -1 / 0, E = -1 / 0, w = -1 / 0; - m.box && (g = m.box.min.x, _ = m.box.max.x, b = m.box.min.y, E = m.box.max.y, c = m.box.min.z, w = m.box.max.z); - for (let z = 0, F = p; z < F; z++) { - var k = u[z * 3], $ = u[z * 3 + 1], L = u[z * 3 + 2]; - k < g && (g = k), $ < b && (b = $), L < c && (c = L), k > _ && (_ = k), $ > E && (E = $), L > w && (w = L); + let g = 1 / 0, b = 1 / 0, c = 1 / 0, v = -1 / 0, E = -1 / 0, w = -1 / 0; + m.box && (g = m.box.min.x, v = m.box.max.x, b = m.box.min.y, E = m.box.max.y, c = m.box.min.z, w = m.box.max.z); + for (let I = 0, F = p; I < F; I++) { + var k = u[I * 3], $ = u[I * 3 + 1], L = u[I * 3 + 2]; + k < g && (g = k), $ < b && (b = $), L < c && (c = L), k > v && (v = k), $ > E && (E = $), L > w && (w = L); } - m.center.set((_ + g) / 2, (E + b) / 2, (w + c) / 2), m.radius = m.center.distanceTo({ x: _, y: E, z: w }), m.box = { min: { x: g, y: b, z: c }, max: { x: _, y: E, z: w } }; + m.center.set((v + g) / 2, (E + b) / 2, (w + c) / 2), m.radius = m.center.distanceTo({ x: v, y: E, z: w }), m.box = { min: { x: g, y: b, z: c }, max: { x: v, y: E, z: w } }; } //helper function for adding an appropriately sized mesh static addCustomGeo(m, l, u, p, g) { - var b = l.addGeoGroup(), c = u.vertexArr, _ = u.normalArr, E = u.faceArr; + var b = l.addGeoGroup(), c = u.vertexArr, v = u.normalArr, E = u.faceArr; b.vertices = c.length, b.faceidx = E.length; - var w, k, $, L, z, F, R, P, U, N = b.vertexArray, B = b.colorArray; - for (p.constructor !== Array && (P = p.r, U = p.g, L = p.b), F = 0, R = b.vertices; F < R; ++F) - w = F * 3, k = c[F], N[w] = k.x, N[w + 1] = k.y, N[w + 2] = k.z, p.constructor === Array && (z = p[F], P = z.r, U = z.g, L = z.b), B[w] = P, B[w + 1] = U, B[w + 2] = L; + var w, k, $, L, I, F, P, B, G, U = b.vertexArray, R = b.colorArray; + for (p.constructor !== Array && (B = p.r, G = p.g, L = p.b), F = 0, P = b.vertices; F < P; ++F) + w = F * 3, k = c[F], U[w] = k.x, U[w + 1] = k.y, U[w + 2] = k.z, p.constructor === Array && (I = p[F], B = I.r, G = I.g, L = I.b), R[w] = B, R[w + 1] = G, R[w + 2] = L; if (g) - for (F = 0, R = b.faceidx / 3; F < R; ++F) { - w = F * 3, $ = E[w], L = E[w + 1], z = E[w + 2]; - var W = new s.Vector3(), V = new s.Vector3(), G = new s.Vector3(); - m.intersectionShape.triangle.push(new a.Triangle(W.copy(c[$]), V.copy(c[L]), G.copy(c[z]))); + for (F = 0, P = b.faceidx / 3; F < P; ++F) { + w = F * 3, $ = E[w], L = E[w + 1], I = E[w + 2]; + var W = new s.Vector3(), H = new s.Vector3(), N = new s.Vector3(); + m.intersectionShape.triangle.push(new a.Triangle(W.copy(c[$]), H.copy(c[L]), N.copy(c[I]))); } if (g) { - var H = new s.Vector3(0, 0, 0), Q = 0; - for (let ce = 0; ce < l.geometryGroups.length; ce++) - H.add(l.geometryGroups[ce].getCentroid()), Q++; - H.divideScalar(Q), A.updateBoundingFromPoints(m.boundingSphere, { centroid: H }, N, b.vertices); + var V = new s.Vector3(0, 0, 0), J = 0; + for (let ue = 0; ue < l.geometryGroups.length; ue++) + V.add(l.geometryGroups[ue].getCentroid()), J++; + V.divideScalar(J), A.updateBoundingFromPoints(m.boundingSphere, { centroid: V }, U, b.vertices); } - if (b.faceArray = new Uint16Array(E), b.truncateArrayBuffers(!0, !0), _.length < b.vertices) + if (b.faceArray = new Uint16Array(E), b.truncateArrayBuffers(!0, !0), v.length < b.vertices) b.setNormals(); else { - var te = b.normalArray = new Float32Array(b.vertices * 3), ee; - for (F = 0, R = b.vertices; F < R; ++F) - w = F * 3, ee = _[F], te[w] = ee.x, te[w + 1] = ee.y, te[w + 2] = ee.z; + var re = b.normalArray = new Float32Array(b.vertices * 3), te; + for (F = 0, P = b.vertices; F < P; ++F) + w = F * 3, te = v[F], re[w] = te.x, re[w + 1] = te.y, re[w + 2] = te.z; } b.setLineIndices(), b.lineidx = b.lineArray.length; } @@ -22340,8 +22362,8 @@ ATOM`, b); if (A.updateFromStyle(this, this.stylespec), m.voldata && m.volscheme) { (0, y.adjustVolumeStyle)(m); const u = m.volscheme, p = m.voldata, g = h.CC, b = u.range() || [-1, 1]; - this.geo.setColors(function(c, _, E) { - let w = p.getVal(c, _, E); + this.geo.setColors(function(c, v, E) { + let w = p.getVal(c, v, E); return g.color(u.valueToHex(w, b)); }), delete this.color; } @@ -22362,7 +22384,7 @@ ATOM`, b); viewer.render(); */ addSphere(m) { - m.center || (m.center = new s.Vector3(0, 0, 0)), m.radius = m.radius ? (0, s.clamp)(m.radius, 0, 1 / 0) : 1.5, m.color = h.CC.color(m.color), this.intersectionShape.sphere.push(new a.Sphere(m.center, m.radius)), v.GLDraw.drawSphere(this.geo, m.center, m.radius, m.color, m.quality), this.components.push({ + m.center || (m.center = new s.Vector3(0, 0, 0)), m.radius = m.radius ? (0, s.clamp)(m.radius, 0, 1 / 0) : 1.5, m.color = h.CC.color(m.color), this.intersectionShape.sphere.push(new a.Sphere(m.center, m.radius)), _.GLDraw.drawSphere(this.geo, m.center, m.radius, m.color, m.quality), this.components.push({ centroid: new s.Vector3(m.center.x, m.center.y, m.center.z) }); var l = this.geo.updateGeoGroup(0); @@ -22404,12 +22426,12 @@ ATOM`, b); { x: b.x + u.x + g.x, y: b.y + u.y + g.y, z: b.z + u.z + g.z }, { x: b.x + p.x + g.x, y: b.y + p.y + g.y, z: b.z + p.z + g.z }, { x: b.x + u.x + p.x + g.x, y: b.y + u.y + p.y + g.y, z: b.z + u.z + p.z + g.z } - ], _ = [], E = []; - _.splice(_.length, 0, c[0], c[1], c[2], c[3]), E.splice(E.length, 0, 0, 2, 1, 1, 2, 3); + ], v = [], E = []; + v.splice(v.length, 0, c[0], c[1], c[2], c[3]), E.splice(E.length, 0, 0, 2, 1, 1, 2, 3); var w = 4; - _.splice(_.length, 0, c[2], c[3], c[6], c[7]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[4], c[5], c[0], c[1]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[6], c[7], c[4], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[3], c[1], c[7], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[2], c[6], c[0], c[4]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4; + v.splice(v.length, 0, c[2], c[3], c[6], c[7]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[4], c[5], c[0], c[1]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[6], c[7], c[4], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[3], c[1], c[7], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[2], c[6], c[0], c[4]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4; var k = (0, y.extend)({}, m); - k.vertexArr = _, k.faceArr = E, k.normalArr = [], A.drawCustom(this, this.geo, k); + k.vertexArr = v, k.faceArr = E, k.normalArr = [], A.drawCustom(this, this.geo, k); var $ = new s.Vector3(); this.components.push({ centroid: $.addVectors(c[0], c[7]).multiplyScalar(0.5) @@ -22451,7 +22473,7 @@ ATOM`, b); var l, u; m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0), m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(0, 0, 0); var p = m.radius || 0.1, g = h.CC.color(m.color); - this.intersectionShape.cylinder.push(new a.Cylinder(l, u, p)), v.GLDraw.drawCylinder(this.geo, l, u, p, g, m.fromCap, m.toCap); + this.intersectionShape.cylinder.push(new a.Cylinder(l, u, p)), _.GLDraw.drawCylinder(this.geo, l, u, p, g, m.fromCap, m.toCap); var b = new s.Vector3(); this.components.push({ centroid: b.addVectors(l, u).multiplyScalar(0.5) @@ -22469,14 +22491,14 @@ ATOM`, b); m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0); var u; m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(3, 0, 0); - for (var p = m.radius || 0.1, g = h.CC.color(m.color), b = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2)), c = b / (m.gapLength + m.dashLength), _ = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0), E = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), w = new s.Vector3((u.x - l.x) / (b / m.gapLength), (u.y - l.y) / (b / m.gapLength), (u.z - l.z) / (b / m.gapLength)), k = new s.Vector3((u.x - l.x) / (b / m.dashLength), (u.y - l.y) / (b / m.dashLength), (u.z - l.z) / (b / m.dashLength)), $ = 0; $ < c; $++) - E = new s.Vector3(_.x + k.x, _.y + k.y, _.z + k.z), this.intersectionShape.cylinder.push(new a.Cylinder(_, E, p)), v.GLDraw.drawCylinder(this.geo, _, E, p, g, m.fromCap, m.toCap), _ = new s.Vector3(E.x + w.x, E.y + w.y, E.z + w.z); + for (var p = m.radius || 0.1, g = h.CC.color(m.color), b = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2)), c = b / (m.gapLength + m.dashLength), v = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0), E = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), w = new s.Vector3((u.x - l.x) / (b / m.gapLength), (u.y - l.y) / (b / m.gapLength), (u.z - l.z) / (b / m.gapLength)), k = new s.Vector3((u.x - l.x) / (b / m.dashLength), (u.y - l.y) / (b / m.dashLength), (u.z - l.z) / (b / m.dashLength)), $ = 0; $ < c; $++) + E = new s.Vector3(v.x + k.x, v.y + k.y, v.z + k.z), this.intersectionShape.cylinder.push(new a.Cylinder(v, E, p)), _.GLDraw.drawCylinder(this.geo, v, E, p, g, m.fromCap, m.toCap), v = new s.Vector3(E.x + w.x, E.y + w.y, E.z + w.z); var L = new s.Vector3(); this.components.push({ centroid: L.addVectors(l, u).multiplyScalar(0.5) }); - var z = this.geo.updateGeoGroup(0); - A.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices); + var I = this.geo.updateGeoGroup(0); + A.updateBoundingFromPoints(this.boundingSphere, this.components, I.vertexArray, I.vertices); } /** * Creates a curved shape @@ -22489,9 +22511,9 @@ ATOM`, b); console.log("Too few points in addCurve"); return; } - var u = m.radius || 0.1, p = h.CC.color(m.color), g = 0, b = l.length - 1, c = l[0].distanceTo(l[1]), _ = Math.ceil(2 * u / c); + var u = m.radius || 0.1, p = h.CC.color(m.color), g = 0, b = l.length - 1, c = l[0].distanceTo(l[1]), v = Math.ceil(2 * u / c); if (m.toArrow) { - b -= _; + b -= v; let $ = { start: l[b], end: l[l.length - 1], @@ -22502,7 +22524,7 @@ ATOM`, b); this.addArrow($); } if (m.fromArrow) { - g += _; + g += v; let $ = { start: l[g], end: l[0], @@ -22530,8 +22552,8 @@ ATOM`, b); m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0), m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(3, 0, 0); var p = this.geo.updateGeoGroup(2), g = p.vertices, b = g * 3, c = p.vertexArray; c[b] = l.x, c[b + 1] = l.y, c[b + 2] = l.z, c[b + 3] = u.x, c[b + 4] = u.y, c[b + 5] = u.z, p.vertices += 2; - var _ = p.lineArray, E = p.lineidx; - _[E] = g, _[E + 1] = g + 1, p.lineidx += 2; + var v = p.lineArray, E = p.lineidx; + v[E] = g, v[E + 1] = g + 1, p.lineidx += 2; var w = new s.Vector3(); this.components.push({ centroid: w.addVectors(l, u).multiplyScalar(0.5) @@ -22608,51 +22630,51 @@ ATOM`, b); }); */ addIsosurface(m, l, u, p) { - var g = l.isoval !== void 0 && typeof l.isoval == "number" ? l.isoval : 0, b = !!l.voxel, c = l.smoothness === void 0 ? 1 : l.smoothness, _ = m.size.x, E = m.size.y, w = m.size.z, k = new Int16Array(_ * E * w), $ = m.data, L, z; - for (L = 0, z = k.length; L < z; ++L) + var g = l.isoval !== void 0 && typeof l.isoval == "number" ? l.isoval : 0, b = !!l.voxel, c = l.smoothness === void 0 ? 1 : l.smoothness, v = m.size.x, E = m.size.y, w = m.size.z, k = new Int16Array(v * E * w), $ = m.data, L, I; + for (L = 0, I = k.length; L < I; ++L) k[L] = -1; - var F = new Uint8Array(_ * E * w); - for (L = 0, z = $.length; L < z; ++L) { - var R = g >= 0 ? $[L] - g : g - $[L]; - R > 0 && (F[L] |= A.ISDONE); + var F = new Uint8Array(v * E * w); + for (L = 0, I = $.length; L < I; ++L) { + var P = g >= 0 ? $[L] - g : g - $[L]; + P > 0 && (F[L] |= A.ISDONE); } - var P = [], U = []; - o.MarchingCube.march(F, P, U, { + var B = [], G = []; + o.MarchingCube.march(F, B, G, { fulltable: !0, voxel: b, unitCube: m.unit, origin: m.origin, matrix: m.matrix, - nX: _, + nX: v, nY: E, nZ: w - }), !b && c > 0 && o.MarchingCube.laplacianSmooth(c, P, U); - var N = [], B = [], W = []; + }), !b && c > 0 && o.MarchingCube.laplacianSmooth(c, B, G); + var U = [], R = [], W = []; if (l.selectedRegion && l.coords === void 0 && (l.coords = l.selectedRegion), l.coords === void 0 && l.selection !== void 0 && (p ? l.coords = p.selectedAtoms(l.selection) : console.log("addIsosurface needs viewer is selection provided.")), l.coords !== void 0) { - var V = l.coords[0].x, G = l.coords[0].y, H = l.coords[0].z, Q = l.coords[0].x, te = l.coords[0].y, ee = l.coords[0].z; - for (let le = 0; le < l.coords.length; le++) - l.coords[le].x > V ? V = l.coords[le].x : l.coords[le].x < Q && (Q = l.coords[le].x), l.coords[le].y > G ? G = l.coords[le].y : l.coords[le].y < te && (te = l.coords[le].y), l.coords[le].z > H ? H = l.coords[le].z : l.coords[le].z < ee && (ee = l.coords[le].z); - var ce = 2; - l.radius !== void 0 && (ce = l.radius), l.selectedOffset !== void 0 && (ce = l.selectedOffset), l.seldist !== void 0 && (ce = l.seldist), Q -= ce, V += ce, te -= ce, G += ce, ee -= ce, H += ce; - for (let le = 0; le < P.length; le++) - P[le].x > Q && P[le].x < V && P[le].y > te && P[le].y < G && P[le].z > ee && P[le].z < H && A.inSelectedRegion(P[le], l.coords, ce) ? (N.push(B.length), B.push(P[le])) : N.push(-1); - for (let le = 0; le + 2 < U.length; le += 3) - N[U[le]] !== -1 && N[U[le + 1]] !== -1 && N[U[le + 2]] !== -1 && (W.push(U[le] - (U[le] - N[U[le]])), W.push(U[le + 1] - (U[le + 1] - N[U[le + 1]])), W.push(U[le + 2] - (U[le + 2] - N[U[le + 2]]))); - P = B, U = W; + var H = l.coords[0].x, N = l.coords[0].y, V = l.coords[0].z, J = l.coords[0].x, re = l.coords[0].y, te = l.coords[0].z; + for (let se = 0; se < l.coords.length; se++) + l.coords[se].x > H ? H = l.coords[se].x : l.coords[se].x < J && (J = l.coords[se].x), l.coords[se].y > N ? N = l.coords[se].y : l.coords[se].y < re && (re = l.coords[se].y), l.coords[se].z > V ? V = l.coords[se].z : l.coords[se].z < te && (te = l.coords[se].z); + var ue = 2; + l.radius !== void 0 && (ue = l.radius), l.selectedOffset !== void 0 && (ue = l.selectedOffset), l.seldist !== void 0 && (ue = l.seldist), J -= ue, H += ue, re -= ue, N += ue, te -= ue, V += ue; + for (let se = 0; se < B.length; se++) + B[se].x > J && B[se].x < H && B[se].y > re && B[se].y < N && B[se].z > te && B[se].z < V && A.inSelectedRegion(B[se], l.coords, ue) ? (U.push(R.length), R.push(B[se])) : U.push(-1); + for (let se = 0; se + 2 < G.length; se += 3) + U[G[se]] !== -1 && U[G[se + 1]] !== -1 && U[G[se + 2]] !== -1 && (W.push(G[se] - (G[se] - U[G[se]])), W.push(G[se + 1] - (G[se + 1] - U[G[se + 1]])), W.push(G[se + 2] - (G[se + 2] - U[G[se + 2]]))); + B = R, G = W; } A.drawCustom(this, this.geo, { - vertexArr: P, - faceArr: U, + vertexArr: B, + faceArr: G, normalArr: [], clickable: l.clickable, hoverable: l.hoverable }), this.updateStyle(l); - var fe = new s.Vector3(m.origin.x, m.origin.y, m.origin.z), oe = new s.Vector3(m.size.x * m.unit.x, m.size.y * m.unit.y, m.size.z * m.unit.z), he = new s.Vector3(0, 0, 0), Ae = fe.clone(), Se = fe.clone().add(oe); - for (let le = 0; le < P.length; le++) - he.add(P[le]), Ae.max(P[le]), Se.min(P[le]); - he.divideScalar(P.length); - var Ie = he.distanceTo(Se), pe = he.distanceTo(Ae); - this.boundingSphere.center = he, this.boundingSphere.radius = Math.max(Ie, pe), typeof u == "function" && u(); + var ie = new s.Vector3(m.origin.x, m.origin.y, m.origin.z), ae = new s.Vector3(m.size.x * m.unit.x, m.size.y * m.unit.y, m.size.z * m.unit.z), ce = new s.Vector3(0, 0, 0), Me = ie.clone(), Ae = ie.clone().add(ae); + for (let se = 0; se < B.length; se++) + ce.add(B[se]), Me.max(B[se]), Ae.min(B[se]); + ce.divideScalar(B.length); + var Ie = ce.distanceTo(Ae), pe = ce.distanceTo(Me); + this.boundingSphere.center = ce, this.boundingSphere.radius = Math.max(Ie, pe), typeof u == "function" && u(); } /** * @deprecated Use addIsosurface instead @@ -22724,8 +22746,8 @@ ATOM`, b); (p.length === 0 || g.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"); var b = l.color; typeof b > "u" && (b = M.color), b = h.CC.color(b); - for (var c = x(u), _ = 0, E = c.length; _ < E; _++) - A.addCustomGeo(M, m, c[_], c[_].colorArr ? c[_].colorArr : b, l.clickable); + for (var c = x(u), v = 0, E = c.length; v < E; v++) + A.addCustomGeo(M, m, c[v], c[v].colorArr ? c[v].colorArr : b, l.clickable); }; function x(M) { var m = 64e3; @@ -22734,10 +22756,10 @@ ATOM`, b); var l = [{ vertexArr: [], normalArr: [], faceArr: [] }]; M.colorArr && (l.colorArr = []); var u = [], p = [], g = 0, b = M.faceArr; - for (let _ = 0, E = b.length; _ < E; _ += 3) { + for (let v = 0, E = b.length; v < E; v += 3) { let w = l[g]; for (let k = 0; k < 3; k++) { - var c = b[_ + k]; + var c = b[v + k]; u[c] !== g && (u[c] = g, p[c] = w.vertexArr.length, w.vertexArr.push(M.vertexArr[c]), M.normalArr && M.normalArr[c] && w.normalArr.push(M.normalArr[c]), M.colorArr && M.colorArr[c] && w.colorArr.push(M.colorArr[c])), w.faceArr.push(p[c]); } w.vertexArr.length >= m && (l.push({ vertexArr: [], normalArr: [], faceArr: [] }), M.colorArr && (l.colorArr = []), g++); @@ -22799,7 +22821,7 @@ ATOM`, b); ), d = t( /*! ./GLModel */ "./src/GLModel.ts" - ), v = t( + ), _ = t( /*! ./Label */ "./src/Label.ts" ), f = t( @@ -22821,20 +22843,20 @@ ATOM`, b); const m = 16; class l { getWidth() { - let c = this.container, _ = c.offsetWidth; - if (_ == 0 && c.style.display === "none") { + let c = this.container, v = c.offsetWidth; + if (v == 0 && c.style.display === "none") { let E = c.style.position, w = c.style.visibility; - c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", _ = c.offsetWidth, c.style.display = "none", c.style.visibility = w, c.style.position = E; + c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", v = c.offsetWidth, c.style.display = "none", c.style.visibility = w, c.style.position = E; } - return _; + return v; } getHeight() { - let c = this.container, _ = c.offsetHeight; - if (_ == 0 && c.style.display === "none") { + let c = this.container, v = c.offsetHeight; + if (v == 0 && c.style.display === "none") { let E = c.style.position, w = c.style.visibility; - c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", _ = c.offsetHeight, c.style.display = "none", c.style.visibility = w, c.style.position = E; + c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", v = c.offsetHeight, c.style.display = "none", c.style.visibility = w, c.style.position = E; } - return _; + return v; } setupRenderer() { this.renderer = new r.Renderer({ @@ -22860,14 +22882,14 @@ ATOM`, b); c.position = new a.Vector3(0.2, 0.2, 1).normalize(), c.intensity = 1, this.scene.add(c); } _handleLostContext(c) { - const _ = function(E) { + const v = function(E) { const w = E.getBoundingClientRect(); return !(w.right < 0 || w.bottom < 0 || w.top > (window.innerHeight || document.documentElement.clientHeight) || w.left > (window.innerWidth || document.documentElement.clientWidth)); }; - if (_(this.container)) { + if (v(this.container)) { let E = 0; for (let w of document.getElementsByTagName("canvas")) - if (_(w) && w._3dmol_viewer != null && (w._3dmol_viewer.resize(), E += 1, E >= m)) + if (v(w) && w._3dmol_viewer != null && (w._3dmol_viewer.resize(), E += 1, E >= m)) break; } } @@ -22884,8 +22906,8 @@ ATOM`, b); var c = 0; for (let E in this.surfaces) if (this.surfaces.hasOwnProperty(E)) { - var _ = parseInt(E); - isNaN(_) || _ > c && (c = _); + var v = parseInt(E); + isNaN(v) || v > c && (c = v); } return c + 1; } @@ -22897,16 +22919,16 @@ ATOM`, b); //if nolink is set/true, don't propagate changes to linked viewers show(c) { if (this.renderer.setViewport(), !!this.scene && (this.setSlabAndFog(), this.renderer.render(this.scene, this.camera), this.viewChangeCallback && this.viewChangeCallback(this._viewer.getView()), !c && this.linkedViewers.length > 0)) - for (var _ = this._viewer.getView(), E = 0; E < this.linkedViewers.length; E++) { + for (var v = this._viewer.getView(), E = 0; E < this.linkedViewers.length; E++) { var w = this.linkedViewers[E]; - w.setView(_, !0); + w.setView(v, !0); } } //regenerate the list of clickables //also updates hoverables updateClickables() { this.clickables.splice(0, this.clickables.length), this.hoverables.splice(0, this.hoverables.length), this.contextMenuEnabledObjects.splice(0, this.contextMenuEnabledObjects.length); - for (let c = 0, _ = this.models.length; c < _; c++) { + for (let c = 0, v = this.models.length; c < v; c++) { let E = this.models[c]; if (E) { let w = E.selectedAtoms({ @@ -22922,14 +22944,14 @@ ATOM`, b); this.contextMenuEnabledObjects.push($[L]); } } - for (let c = 0, _ = this.shapes.length; c < _; c++) { + for (let c = 0, v = this.shapes.length; c < v; c++) { let E = this.shapes[c]; E && E.clickable && this.clickables.push(E), E && E.hoverable && this.hoverables.push(E), E && E.contextMenuEnabled && this.contextMenuEnabledObjects.push(E); } } // Checks for selection intersects on mousedown - handleClickSelection(c, _, E) { - let w = this.targetedObjects(c, _, this.clickables); + handleClickSelection(c, v, E) { + let w = this.targetedObjects(c, v, this.clickables); if (w.length) { var k = w[0].clickable; k.callback !== void 0 && (typeof k.callback != "function" && (k.callback = (0, h.makeFunction)(k.callback)), typeof k.callback == "function" && (this.mouseButton === 3 && this.contextMenuEnabledObjects.includes(k) && this.userContextMenuHandler || k.callback(k, this._viewer, E, this.container, w))); @@ -22937,21 +22959,21 @@ ATOM`, b); } //return offset of container canvasOffset() { - let c = this.glDOM, _ = c.getBoundingClientRect(), E = c.ownerDocument, w = E.documentElement, k = E.defaultView; + let c = this.glDOM, v = c.getBoundingClientRect(), E = c.ownerDocument, w = E.documentElement, k = E.defaultView; return { - top: _.top + k.pageYOffset - w.clientTop, - left: _.left + k.pageXOffset - w.clientLeft + top: v.top + k.pageYOffset - w.clientTop, + left: v.left + k.pageXOffset - w.clientLeft }; } //set current_hover to sel (which can be null), calling appropraite callbacks - setHover(c, _, E) { - this.current_hover != c && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, h.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, _, this.container, E)), this.current_hover = c, c && c.hover_callback !== void 0 && (typeof c.hover_callback != "function" && (c.hover_callback = (0, h.makeFunction)(c.hover_callback)), typeof c.hover_callback == "function" && c.hover_callback(c, this._viewer, _, this.container, E))); + setHover(c, v, E) { + this.current_hover != c && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, h.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, v, this.container, E)), this.current_hover = c, c && c.hover_callback !== void 0 && (typeof c.hover_callback != "function" && (c.hover_callback = (0, h.makeFunction)(c.hover_callback)), typeof c.hover_callback == "function" && c.hover_callback(c, this._viewer, v, this.container, E))); } //checks for selection intersects on hover - handleHoverSelection(c, _, E) { + handleHoverSelection(c, v, E) { if (this.hoverables.length == 0) return; - let w = this.targetedObjects(c, _, this.hoverables); + let w = this.targetedObjects(c, v, this.hoverables); if (w.length) { var k = w[0].clickable; this.setHover(k, E, w), this.current_hover = k; @@ -22959,8 +22981,8 @@ ATOM`, b); this.setHover(null); } //sees if the mouse is still on the object that invoked a hover event and if not then the unhover callback is called - handleHoverContinue(c, _) { - let E = this.targetedObjects(c, _, this.hoverables); + handleHoverContinue(c, v) { + let E = this.targetedObjects(c, v, this.hoverables); (E.length == 0 || E[0] === void 0) && this.setHover(null), E[0] !== void 0 && E[0].clickable !== this.current_hover && this.setHover(null); } /** @@ -22969,32 +22991,32 @@ ATOM`, b); * @param {Event} event * @param {{ allowTolerance, tolerance: number }} options */ - closeEnoughForClick(c, { allowTolerance: _ = c.targetTouches, tolerance: E = 5 } = {}) { + closeEnoughForClick(c, { allowTolerance: v = c.targetTouches, tolerance: E = 5 } = {}) { const w = this.getX(c), k = this.getY(c); - if (_) { + if (v) { const $ = Math.abs(w - this.mouseStartX), L = Math.abs(k - this.mouseStartY); return $ <= E && L <= E; } else return w === this.mouseStartX && k === this.mouseStartY; } calcTouchDistance(c) { - var _ = c.targetTouches[0].pageX - c.targetTouches[1].pageX, E = c.targetTouches[0].pageY - c.targetTouches[1].pageY; - return Math.hypot(_, E); + var v = c.targetTouches[0].pageX - c.targetTouches[1].pageX, E = c.targetTouches[0].pageY - c.targetTouches[1].pageY; + return Math.hypot(v, E); } //check targetTouches as well getX(c) { - var _ = c.pageX; - return _ == null && (_ = c.pageX), c.targetTouches && c.targetTouches[0] ? _ = c.targetTouches[0].pageX : c.changedTouches && c.changedTouches[0] && (_ = c.changedTouches[0].pageX), _; + var v = c.pageX; + return v == null && (v = c.pageX), c.targetTouches && c.targetTouches[0] ? v = c.targetTouches[0].pageX : c.changedTouches && c.changedTouches[0] && (v = c.changedTouches[0].pageX), v; } getY(c) { - var _ = c.pageY; - return _ == null && (_ = c.pageY), c.targetTouches && c.targetTouches[0] ? _ = c.targetTouches[0].pageY : c.changedTouches && c.changedTouches[0] && (_ = c.changedTouches[0].pageY), _; + var v = c.pageY; + return v == null && (v = c.pageY), c.targetTouches && c.targetTouches[0] ? v = c.targetTouches[0].pageY : c.changedTouches && c.changedTouches[0] && (v = c.changedTouches[0].pageY), v; } //for grid viewers, return true if point is in this viewer - isInViewer(c, _) { + isInViewer(c, v) { if (this.viewers != null) { - var E = this.WIDTH / this.cols, w = this.HEIGHT / this.rows, k = this.canvasOffset(), $ = c - k.left, L = _ - k.top, z = this.rows - Math.floor(L / w) - 1, F = Math.floor($ / E); - if (z != this.row || F != this.col) + var E = this.WIDTH / this.cols, w = this.HEIGHT / this.rows, k = this.canvasOffset(), $ = c - k.left, L = v - k.top, I = this.rows - Math.floor(L / w) - 1, F = Math.floor($ / E); + if (I != this.row || F != this.col) return !1; } return !0; @@ -23003,38 +23025,38 @@ ATOM`, b); //also, make sure we don't go past CAMERA_Z adjustZoomToLimits(c) { if (this.config.lowerZoomLimit && this.config.lowerZoomLimit > 0) { - let _ = this.CAMERA_Z - this.config.lowerZoomLimit; - c > _ && (c = _); + let v = this.CAMERA_Z - this.config.lowerZoomLimit; + c > v && (c = v); } if (this.config.upperZoomLimit && this.config.upperZoomLimit > 0) { - let _ = this.CAMERA_Z - this.config.upperZoomLimit; - c < _ && (c = _); + let v = this.CAMERA_Z - this.config.upperZoomLimit; + c < v && (c = v); } return c > this.CAMERA_Z - 1 && (c = this.CAMERA_Z - 1), c; } //interpolate between two normalized quaternions (t between 0 and 1) //https://en.wikipedia.org/wiki/Slerp - static slerp(c, _, E) { + static slerp(c, v, E) { if (E == 1) - return _.clone(); + return v.clone(); if (E == 0) return c.clone(); - let w = c.x * _.x + c.y * _.y + c.z * _.z + c.w * _.w; + let w = c.x * v.x + c.y * v.y + c.z * v.z + c.w * v.w; if (w > 0.9995) { - let P = new a.Quaternion(c.x + E * (_.x - c.x), c.y + E * (_.y - c.y), c.z + E * (_.z - c.z), c.w + E * (_.w - c.w)); - return P.normalize(), P; + let B = new a.Quaternion(c.x + E * (v.x - c.x), c.y + E * (v.y - c.y), c.z + E * (v.z - c.z), c.w + E * (v.w - c.w)); + return B.normalize(), B; } - w < 0 && (_ = _.clone().multiplyScalar(-1), w = -w), w > 1 ? w = 1 : w < -1 && (w = -1); - var k = Math.acos(w), $ = k * E, L = _.clone(); + w < 0 && (v = v.clone().multiplyScalar(-1), w = -w), w > 1 ? w = 1 : w < -1 && (w = -1); + var k = Math.acos(w), $ = k * E, L = v.clone(); L.sub(c.clone().multiplyScalar(w)), L.normalize(); - var z = Math.cos($), F = Math.sin($), R = new a.Quaternion(c.x * z + L.x * F, c.y * z + L.y * F, c.z * z + L.z * F, c.w * z + L.w * F); - return R.normalize(), R; + var I = Math.cos($), F = Math.sin($), P = new a.Quaternion(c.x * I + L.x * F, c.y * I + L.y * F, c.z * I + L.z * F, c.w * I + L.w * F); + 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(c, _ = {}) { - if (this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledObjects = [], this.current_hover = null, this.hoverDuration = 500, this.longTouchDuration = 1e3, 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 a.Quaternion(0, 0, 0, 1), this.dq = new a.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 = _, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = s.elementColors.defaultColors), this.nomouse = !!this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = s.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 = typeof this.config.camerax == "string" ? parseFloat(this.config.camerax) : this.config.camerax), this._viewer = this, this.container = c, 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 r.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new a.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new a.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new r.Raycaster(new a.Vector3(0, 0, 0), new a.Vector3(0, 0, 0)), this.projector = new r.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = s.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)), typeof window.IntersectionObserver < "u") { + constructor(c, v = {}) { + if (this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledObjects = [], this.current_hover = null, this.hoverDuration = 500, this.longTouchDuration = 1e3, 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 a.Quaternion(0, 0, 0, 1), this.dq = new a.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 = v, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = s.elementColors.defaultColors), this.nomouse = !!this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = s.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 = typeof this.config.camerax == "string" ? parseFloat(this.config.camerax) : this.config.camerax), this._viewer = this, this.container = c, 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 r.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new a.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new a.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new r.Raycaster(new a.Vector3(0, 0, 0), new a.Vector3(0, 0, 0)), this.projector = new r.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = s.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)), typeof window.IntersectionObserver < "u") { let E = (w, k) => { w.forEach(($) => { $.isIntersecting && this.resize(); @@ -23055,10 +23077,10 @@ ATOM`, b); * @param y - y position in screen coordinates * @param {Object[]} - list of objects or selection object specifying what object to check for targeting */ - targetedObjects(c, _, E) { + targetedObjects(c, v, E) { var w = { x: c, - y: _, + y: v, z: -1 }; return Array.isArray(E) || (E = this.selectedAtoms(E)), E.length == 0 ? [] : (this.raycaster.setFromCamera(w, this.camera), this.raycaster.intersectObjects(this.modelGroup, E)); @@ -23068,15 +23090,15 @@ ATOM`, b); * @return {object | list} - and object or list of {x: screenX, y: screenY} */ modelToScreen(c) { - let _ = !1; - Array.isArray(c) || (c = [c], _ = !0); - let E = this.renderer.getXRatio(), w = this.renderer.getYRatio(), k = this.col, $ = this.row, L = k * (this.WIDTH / E), z = (w - $ - 1) * (this.HEIGHT / w), F = [], R = this.canvasOffset(); - return c.forEach((P) => { - let U = new a.Vector3(P.x, P.y, P.z); - U.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(U, this.camera); - let N = this.WIDTH / E * (U.x + 1) / 2 + R.left + L, B = -(this.HEIGHT / w) * (U.y - 1) / 2 + R.top + z; - F.push({ x: N, y: B }); - }), _ && (F = F[0]), F; + let v = !1; + Array.isArray(c) || (c = [c], v = !0); + let E = this.renderer.getXRatio(), w = this.renderer.getYRatio(), k = this.col, $ = this.row, L = k * (this.WIDTH / E), I = (w - $ - 1) * (this.HEIGHT / w), F = [], P = this.canvasOffset(); + return c.forEach((B) => { + let G = new a.Vector3(B.x, B.y, B.z); + G.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(G, this.camera); + let U = this.WIDTH / E * (G.x + 1) / 2 + P.left + L, R = -(this.HEIGHT / w) * (G.y - 1) / 2 + P.top + I; + F.push({ x: U, y: R }); + }), v && (F = F[0]), F; } /** * For a given screen (x,y) displacement return model displacement @@ -23084,9 +23106,9 @@ ATOM`, b); * @param{y} y displacement in screen corodinates * @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis */ - screenOffsetToModel(c, _, E) { - var w = c / this.WIDTH, k = _ / this.HEIGHT, $ = E === void 0 ? this.rotationGroup.position.z : E, L = this.rotationGroup.quaternion, z = new a.Vector3(0, 0, $); - return this.projector.projectVector(z, this.camera), z.x += w * 2, z.y -= k * 2, this.projector.unprojectVector(z, this.camera), z.z = 0, z.applyQuaternion(L), z; + screenOffsetToModel(c, v, E) { + var w = c / this.WIDTH, k = v / this.HEIGHT, $ = E === void 0 ? this.rotationGroup.position.z : E, L = this.rotationGroup.quaternion, I = new a.Vector3(0, 0, $); + return this.projector.projectVector(I, this.camera), I.x += w * 2, I.y -= k * 2, this.projector.unprojectVector(I, this.camera), I.z = 0, I.applyQuaternion(L), I; } /** * Distance from screen coordinate to model coordinate assuming screen point @@ -23094,8 +23116,8 @@ ATOM`, b); * @param{screen} xy screen coordinate * @param{model} xyz model coordinate */ - screenToModelDistance(c, _) { - let E = this.canvasOffset(), w = new a.Vector3(_.x, _.y, _.z); + screenToModelDistance(c, v) { + let E = this.canvasOffset(), w = new a.Vector3(v.x, v.y, v.z); w.applyMatrix4(this.modelGroup.matrixWorld); let k = w.clone(); this.projector.projectVector(w, this.camera); @@ -23136,8 +23158,8 @@ ATOM`, b); */ getInternalState() { var c = { models: [], surfaces: [], shapes: [], labels: [] }; - for (let _ = 0; _ < this.models.length; _++) - this.models[_] && (c.models[_] = this.models[_].getInternalState()); + for (let v = 0; v < this.models.length; v++) + this.models[v] && (c.models[v] = this.models[v].getInternalState()); return c; } /** @@ -23147,9 +23169,9 @@ ATOM`, b); */ setInternalState(c) { this.clear(); - var _ = c.models; - for (let E = 0; E < _.length; E++) - _[E] && (this.models[E] = new d.GLModel(E), this.models[E].setInternalState(_[E])); + var v = c.models; + for (let E = 0; E < v.length; E++) + v[E] && (this.models[E] = new d.GLModel(E), this.models[E].setInternalState(v[E])); this.render(); } /** @@ -23167,8 +23189,8 @@ ATOM`, b); viewer.render(); }); */ - setZoomLimits(c, _) { - typeof c < "u" && (this.config.lowerZoomLimit = c), _ && (this.config.upperZoomLimit = _), this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show(); + setZoomLimits(c, v) { + typeof c < "u" && (this.config.lowerZoomLimit = c), v && (this.config.upperZoomLimit = v), this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show(); } /** * Set camera parameters (distance to the origin and field of view) @@ -23192,10 +23214,10 @@ ATOM`, b); _handleMouseDown(c) { if (c.preventDefault(), !this.scene) return; - var _ = this.getX(c), E = this.getY(c); - if (_ === void 0) + var v = this.getX(c), E = this.getY(c); + if (v === void 0) return; - this.isDragging = !0, this.mouseButton = c.which, this.mouseStartX = _, this.mouseStartY = E, this.touchHold = !0, this.touchDistanceStart = 0, c.targetTouches && c.targetTouches.length == 2 && (this.touchDistanceStart = this.calcTouchDistance(c)), this.cq = this.rotationGroup.quaternion.clone(), this.cz = this.rotationGroup.position.z, this.currentModelPos = this.modelGroup.position.clone(), this.cslabNear = this.slabNear, this.cslabFar = this.slabFar; + this.isDragging = !0, this.mouseButton = c.which, this.mouseStartX = v, this.mouseStartY = E, this.touchHold = !0, this.touchDistanceStart = 0, c.targetTouches && c.targetTouches.length == 2 && (this.touchDistanceStart = this.calcTouchDistance(c)), this.cq = this.rotationGroup.quaternion.clone(), this.cz = this.rotationGroup.position.z, this.currentModelPos = this.modelGroup.position.clone(), this.cslabNear = this.slabNear, this.cslabFar = this.slabFar; let w = this; c.targetTouches && c.targetTouches.length === 1 && (this.longTouchTimeout = setTimeout(function() { if (w.touchHold == !0) { @@ -23207,9 +23229,9 @@ ATOM`, b); } _handleMouseUp(c) { if (this.touchHold = !1, this.isDragging && this.scene) { - var _ = this.getX(c), E = this.getY(c); - if (this.closeEnoughForClick(c) && this.isInViewer(_, E)) { - let w = this.mouseXY(_, E); + var v = this.getX(c), E = this.getY(c); + if (this.closeEnoughForClick(c) && this.isInViewer(v, E)) { + let w = this.mouseXY(v, E); this.handleClickSelection(w.x, w.y, c); } } @@ -23217,8 +23239,8 @@ ATOM`, b); } _handleMouseScroll(c) { if (c.preventDefault(), !!this.scene) { - var _ = this.getX(c), E = this.getY(c); - if (_ !== void 0 && !(!this.control_all && !this.isInViewer(_, E))) { + var v = this.getX(c), E = this.getY(c); + if (v !== void 0 && !(!this.control_all && !this.isInViewer(v, E))) { var w = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, k = 1; if (c.ctrlKey && (k = -1), c.detail) this.rotationGroup.position.z += k * w * c.detail / 10; @@ -23242,24 +23264,24 @@ ATOM`, b); * @return {Promise} */ apngURI(c) { - let _ = this; + let v = this; return c = c || 1, new Promise(function(E) { - let w = 0, k = _.viewChangeCallback, $ = [], L = [], z = Date.now(); - _.viewChangeCallback = function() { - L.push(Date.now() - z), z = Date.now(), $.push(new Promise((F) => { - _.getCanvas().toBlob(function(R) { - R.arrayBuffer().then(F); + let w = 0, k = v.viewChangeCallback, $ = [], L = [], I = Date.now(); + v.viewChangeCallback = function() { + L.push(Date.now() - I), I = Date.now(), $.push(new Promise((F) => { + v.getCanvas().toBlob(function(P) { + P.arrayBuffer().then(F); }, "image/png"); - })), w += 1, w == c && (_.viewChangeCallback = k, Promise.all($).then((F) => { - let R = []; - for (let V = 0; V < F.length; V++) { - let G = (0, M.decode)(F[V]); - R.push((0, M.toRGBA8)(G)[0]); + })), w += 1, w == c && (v.viewChangeCallback = k, Promise.all($).then((F) => { + let P = []; + for (let H = 0; H < F.length; H++) { + let N = (0, M.decode)(F[H]); + P.push((0, M.toRGBA8)(N)[0]); } - let P = _.getCanvas().width, U = _.getCanvas().height, N = (0, M.encode)(R, P, U, 0, L), B = new Blob([N], { type: "image/png" }), W = new FileReader(); - W.onload = function(V) { - E(V.target.result); - }, W.readAsDataURL(B); + let B = v.getCanvas().width, G = v.getCanvas().height, U = (0, M.encode)(P, B, G, 0, L), R = new Blob([U], { type: "image/png" }), W = new FileReader(); + W.onload = function(H) { + E(H.target.result); + }, W.readAsDataURL(R); })); }; }); @@ -23287,39 +23309,39 @@ ATOM`, b); setHoverDuration(c) { this.hoverDuration = c; } - mouseXY(c, _) { - let E = this.canvasOffset(), w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.col, L = this.row, z = $ * (this.WIDTH / w), F = (k - L - 1) * (this.HEIGHT / k), R = (c - E.left - z) / (this.WIDTH / w) * 2 - 1, P = -((_ - E.top - F) / (this.HEIGHT / k)) * 2 + 1; - return { x: R, y: P }; + mouseXY(c, v) { + let E = this.canvasOffset(), w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.col, L = this.row, I = $ * (this.WIDTH / w), F = (k - L - 1) * (this.HEIGHT / k), P = (c - E.left - I) / (this.WIDTH / w) * 2 - 1, B = -((v - E.top - F) / (this.HEIGHT / k)) * 2 + 1; + return { x: P, y: B }; } _handleMouseMove(c) { clearTimeout(this.hoverTimeout), c.preventDefault(); - let _ = this.getX(c), E = this.getY(c); - if (_ === void 0) + let v = this.getX(c), E = this.getY(c); + if (v === void 0) return; - let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.mouseXY(_, E), L = this; + let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.mouseXY(v, E), L = this; this.current_hover !== null && this.handleHoverContinue($.x, $.y); - var z = 0; - if (!(!this.control_all && !this.isInViewer(_, E)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() { + var I = 0; + if (!(!this.control_all && !this.isInViewer(v, E)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() { L.handleHoverSelection($.x, $.y, c); }, this.hoverDuration)), !!this.isDragging)) { c.targetTouches && (c.targetTouches.length > 1 || c.targetTouches.length === 1 && !this.closeEnoughForClick(c)) && clearTimeout(this.longTouchTimeout); - var F = (_ - this.mouseStartX) / this.WIDTH, R = (E - this.mouseStartY) / this.HEIGHT; + var F = (v - this.mouseStartX) / this.WIDTH, P = (E - this.mouseStartY) / this.HEIGHT; if (this.touchDistanceStart != 0 && c.targetTouches && c.targetTouches.length == 2) { - var P = this.calcTouchDistance(c); - z = 2, R = (P - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); - } else c.targetTouches && c.targetTouches.length == 3 && (z = 1); - F *= w, R *= k; - var U = Math.hypot(F, R), N; - if (z == 3 || this.mouseButton == 3 && c.ctrlKey) - this.slabNear = this.cslabNear + F * 100, this.slabFar = this.cslabFar - R * 100; - else if (z == 2 || this.mouseButton == 3 || c.shiftKey) - N = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, N < 80 && (N = 80), this.rotationGroup.position.z = this.cz + R * N, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z); - else if (z == 1 || this.mouseButton == 2 || c.ctrlKey) { - var B = this.screenOffsetToModel(w * (_ - this.mouseStartX), k * (E - this.mouseStartY)); - this.modelGroup.position.addVectors(this.currentModelPos, B); - } else if ((z === 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 * F, this.dq.w = -W * R, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); + var B = this.calcTouchDistance(c); + I = 2, P = (B - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); + } else c.targetTouches && c.targetTouches.length == 3 && (I = 1); + F *= w, P *= k; + var G = Math.hypot(F, P), U; + if (I == 3 || this.mouseButton == 3 && c.ctrlKey) + this.slabNear = this.cslabNear + F * 100, this.slabFar = this.cslabFar - P * 100; + else if (I == 2 || this.mouseButton == 3 || c.shiftKey) + 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 (I == 1 || this.mouseButton == 2 || c.ctrlKey) { + var R = this.screenOffsetToModel(w * (v - this.mouseStartX), k * (E - this.mouseStartY)); + this.modelGroup.position.addVectors(this.currentModelPos, R); + } else if ((I === 0 || this.mouseButton == 1) && G !== 0) { + var W = Math.sin(G * Math.PI) / G; + this.dq.x = Math.cos(G * Math.PI), this.dq.y = 0, this.dq.z = W * F, 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(); } @@ -23327,11 +23349,11 @@ ATOM`, b); _handleContextMenu(c) { if (c.preventDefault(), this.closeEnoughForClick(c)) { var w = this.mouseStartX, k = this.mouseStartY, E = this.canvasOffset(); - let $ = this.mouseXY(w, k), L = $.x, z = $.y, F = this.targetedObjects(L, z, this.contextMenuEnabledObjects); - var _ = null; - F.length && (_ = F[0].clickable); + let $ = this.mouseXY(w, k), L = $.x, I = $.y, F = this.targetedObjects(L, I, this.contextMenuEnabledObjects); + var v = null; + F.length && (v = F[0].clickable); var E = this.canvasOffset(), w = this.mouseStartX - E.left, k = this.mouseStartY - E.top; - this.userContextMenuHandler && (this.userContextMenuHandler(_, w, k, F, c), this.isDragging = !1); + this.userContextMenuHandler && (this.userContextMenuHandler(v, w, k, F, c), this.isDragging = !1); } } /** @@ -23343,8 +23365,8 @@ ATOM`, b); */ setContainer(c) { - let _ = (0, h.getElement)(c) || this.container; - return this.initContainer(_), this; + let v = (0, h.getElement)(c) || this.container; + return this.initContainer(v), this; } /** * Set the background color (default white) @@ -23361,10 +23383,10 @@ ATOM`, b); * */ - setBackgroundColor(c, _) { - (typeof _ > "u" || _ < 0 || _ > 1) && (_ = 1); + setBackgroundColor(c, v) { + (typeof v > "u" || v < 0 || v > 1) && (v = 1); var E = s.CC.color(c); - return this.scene.fog.color = E, this.bgColor = E.getHex(), this.renderer.setClearColorHex(E.getHex(), _), this.show(), this; + return this.scene.fog.color = E, this.bgColor = E.getHex(), this.renderer.setClearColorHex(E.getHex(), v), this.show(), this; } /** * Set view projection scheme. Either orthographic or perspective. @@ -23406,8 +23428,8 @@ ATOM`, b); */ setViewStyle(c) { if (c = c || {}, c.style = c.style || "", c.style.includes("outline") ? this.renderer.enableOutline(c) : this.renderer.disableOutline(), c.style.includes("ambientOcclusion")) { - var _ = {}; - c.strength && (_.strength = c.strength), c.radius && (_.radius = c.radius), this.renderer.enableAmbientOcclusion(_); + var v = {}; + c.strength && (v.strength = c.strength), c.radius && (v.radius = c.radius), this.renderer.enableAmbientOcclusion(v); } else this.renderer.disableAmbientOcclusion(); return this; @@ -23439,16 +23461,16 @@ ATOM`, b); this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(); let c = !1; if (this.renderer.isLost() && this.WIDTH > 0 && this.HEIGHT > 0) { - let _ = !1, E = this.container.querySelector("canvas"); - E && E != this.renderer.getCanvas() ? this.config.canvas = E : (E.remove(), this.config && this.config.canvas != null && (delete this.config.canvas, _ = !0)), this.setupRenderer(), this.initContainer(this.container), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), c = !0, _ && (this.config.canvas = this.renderer.getCanvas()); + let v = !1, E = this.container.querySelector("canvas"); + E && E != this.renderer.getCanvas() ? this.config.canvas = E : (E.remove(), this.config && this.config.canvas != null && (delete this.config.canvas, v = !0)), this.setupRenderer(), this.initContainer(this.container), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), c = !0, v && (this.config.canvas = this.renderer.getCanvas()); } if (this.WIDTH == 0 || this.HEIGHT == 0 ? this.animated && this._viewer.pauseAnimate() : this.animated && this._viewer.resumeAnimate(), this.updateSize(), c) { - let _ = this.renderer.supportedExtensions(); - if (_.regen = !0, this.viewers) + let v = this.renderer.supportedExtensions(); + if (v.regen = !0, this.viewers) for (let E = 0, w = this.viewers.length; E < w; E++) for (let k = 0, $ = this.viewers[E].length; k < $; k++) - this.viewers[E][k].render(null, _); - this._viewer.render(null, _); + this.viewers[E][k].render(null, v); + this._viewer.render(null, v); } else this.show(); return this; @@ -23488,7 +23510,7 @@ ATOM`, b); * value reverses the direction of the spin. * */ - spin(c, _ = 1) { + spin(c, v = 1) { if (clearInterval(this.spinInterval), typeof c > "u" && (c = "y"), typeof c == "boolean") if (c) c = "y"; @@ -23497,7 +23519,7 @@ ATOM`, b); Array.isArray(c) && (c = { x: c[0], y: c[1], z: c[2] }); var E = this; this.spinInterval = setInterval(function() { - !E.getCanvas().isConnected && E.renderer.isLost() && clearInterval(E.spinInterval), E.rotate(1 * _, c); + !E.getCanvas().isConnected && E.renderer.isLost() && clearInterval(E.spinInterval), E.rotate(1 * v, c); }, 25); } //animate motion between current position and passed position @@ -23508,36 +23530,36 @@ ATOM`, b); //and rotationgroup quaternion //return array includes final position, but not current //the returned array includes an animate method - animateMotion(c, _, E, w, k, $) { - var L = 20, z = Math.ceil(c / L); - z < 1 && (z = 1), this.incAnim(); + animateMotion(c, v, E, w, k, $) { + var L = 20, I = Math.ceil(c / L); + I < 1 && (I = 1), this.incAnim(); var F = { mpos: this.modelGroup.position.clone(), rz: this.rotationGroup.position.z, rot: this.rotationGroup.quaternion.clone(), cam: this.lookingAt.clone() }; - if (_) { - let U = new Array(z); - for (let V = 0; V < z; V++) { - let G = (V + 1) / z, H = { mpos: F.mpos, rz: F.rz, rot: F.rot }; - H.mpos = E.clone().sub(F.mpos).multiplyScalar(G).add(F.mpos), H.rz = F.rz + G * (w - F.rz), H.rot = l.slerp(F.rot, k, G), H.cam = $.clone().sub(F.cam).multiplyScalar(G).add(F.cam), U[V] = H; + if (v) { + let G = new Array(I); + for (let H = 0; H < I; H++) { + let N = (H + 1) / I, V = { mpos: F.mpos, rz: F.rz, rot: F.rot }; + V.mpos = E.clone().sub(F.mpos).multiplyScalar(N).add(F.mpos), V.rz = F.rz + N * (w - F.rz), V.rot = l.slerp(F.rot, k, N), V.cam = $.clone().sub(F.cam).multiplyScalar(N).add(F.cam), G[H] = V; } - let N = 0, B = this, W = function() { - var V = U[N]; - N += 1, B.modelGroup.position = V.mpos, B.rotationGroup.position.z = V.rz, B.rotationGroup.quaternion = V.rot, B.camera.lookAt(V.cam), N < U.length ? setTimeout(W, L) : B.decAnim(), B.show(); + let U = 0, R = this, W = function() { + var H = G[U]; + U += 1, R.modelGroup.position = H.mpos, R.rotationGroup.position.z = H.rz, R.rotationGroup.quaternion = H.rot, R.camera.lookAt(H.cam), U < G.length ? setTimeout(W, L) : R.decAnim(), R.show(); }; setTimeout(W, L); } else { - var R = {}; - let U = 1 / z; - if (E && (R.mpos = E.clone().sub(F.mpos).multiplyScalar(U)), typeof w < "u" && w != null && (R.rz = U * (w - F.rz)), k) { - var P = l.slerp(F.rot, k, U); - R.rot = F.rot.clone().inverse().multiply(P); + var P = {}; + let G = 1 / I; + if (E && (P.mpos = E.clone().sub(F.mpos).multiplyScalar(G)), typeof w < "u" && w != null && (P.rz = G * (w - F.rz)), k) { + var B = l.slerp(F.rot, k, G); + P.rot = F.rot.clone().inverse().multiply(B); } - $ && (R.cam = $.clone().sub(F.cam).multiplyScalar(U)); - let N = 0, B = this, W = function() { - N += 1, R.mpos && B.modelGroup.position.add(R.mpos), R.rz && (B.rotationGroup.position.z += R.rz), R.rot && B.rotationGroup.quaternion.multiply(R.rot), R.cam && (B.lookingAt.add(R.cam), B.camera.lookAt(B.lookingAt)), N < z ? setTimeout(W, L) : B.decAnim(), B.show(); + $ && (P.cam = $.clone().sub(F.cam).multiplyScalar(G)); + let U = 0, R = this, W = function() { + U += 1, P.mpos && R.modelGroup.position.add(P.mpos), P.rz && (R.rotationGroup.position.z += P.rz), P.rot && R.rotationGroup.quaternion.multiply(P.rot), P.cam && (R.lookingAt.add(P.cam), R.camera.lookAt(R.lookingAt)), U < I ? setTimeout(W, L) : R.decAnim(), R.show(); }; setTimeout(W, L); } @@ -23565,20 +23587,20 @@ ATOM`, b); * */ - rotate(c, _ = "y", E = 0, w = !1) { - if (_ == "x" ? _ = { x: 1, y: 0, z: 0 } : _ == "y" ? _ = { x: 0, y: 1, z: 0 } : _ == "z" && (_ = { x: 0, y: 0, z: 1 }), _ == "vx" ? _ = { vx: 1, vy: 0, vz: 0 } : _ == "vy" ? _ = { vx: 0, vy: 1, vz: 0 } : _ == "vz" && (_ = { vx: 0, vy: 0, vz: 1 }), typeof _.vx < "u") { - var k = new a.Vector3(_.vx, _.vy, _.vz); - k.applyQuaternion(this.rotationGroup.quaternion), _ = { x: k.x, y: k.y, z: k.z }; - } - var $ = function(R) { - var P = Math.sin(R / 2), U = Math.cos(R / 2), N = 0, B = 0, W = 0; - return N = _.x * P, B = _.y * P, W = _.z * P, new a.Quaternion(N, B, W, U).normalize(); - }, L = Math.PI * c / 180, z = $(L); + rotate(c, v = "y", E = 0, w = !1) { + if (v == "x" ? v = { x: 1, y: 0, z: 0 } : v == "y" ? v = { x: 0, y: 1, z: 0 } : v == "z" && (v = { x: 0, y: 0, z: 1 }), v == "vx" ? v = { vx: 1, vy: 0, vz: 0 } : v == "vy" ? v = { vx: 0, vy: 1, vz: 0 } : v == "vz" && (v = { vx: 0, vy: 0, vz: 1 }), typeof v.vx < "u") { + var k = new a.Vector3(v.vx, v.vy, v.vz); + k.applyQuaternion(this.rotationGroup.quaternion), v = { x: k.x, y: k.y, z: k.z }; + } + var $ = function(P) { + var B = Math.sin(P / 2), G = Math.cos(P / 2), U = 0, R = 0, W = 0; + return U = v.x * B, R = v.y * B, W = v.z * B, new a.Quaternion(U, R, W, G).normalize(); + }, L = Math.PI * c / 180, I = $(L); if (E) { - var F = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(z); + var F = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(I); this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, F, this.lookingAt); } else - this.rotationGroup.quaternion.multiply(z), this.show(); + this.rotationGroup.quaternion.multiply(I), this.show(); return this; } surfacesFinished() { @@ -23594,23 +23616,23 @@ ATOM`, b); getView() { if (!this.modelGroup) return [0, 0, 0, 0, 0, 0, 0, 1]; - var c = this.modelGroup.position, _ = this.rotationGroup.quaternion; + var c = this.modelGroup.position, v = this.rotationGroup.quaternion; return [ c.x, c.y, c.z, this.rotationGroup.position.z, - _.x, - _.y, - _.z, - _.w + v.x, + v.y, + v.z, + v.w ]; } /** Sets the view to the specified translation, zoom, and rotation. * * @param {Array.} arg Array formatted identically to the return value of getView */ - setView(c, _) { - return c === void 0 || !(c instanceof Array || c.length !== 8) ? this : !this.modelGroup || !this.rotationGroup ? this : (this.modelGroup.position.x = c[0], this.modelGroup.position.y = c[1], this.modelGroup.position.z = c[2], this.rotationGroup.position.z = c[3], this.rotationGroup.quaternion.x = c[4], this.rotationGroup.quaternion.y = c[5], this.rotationGroup.quaternion.z = c[6], this.rotationGroup.quaternion.w = c[7], typeof c[8] < "u" && (this.rotationGroup.position.x = c[8], this.rotationGroup.position.y = c[9]), this.show(_), this); + setView(c, v) { + return c === void 0 || !(c instanceof Array || c.length !== 8) ? this : !this.modelGroup || !this.rotationGroup ? this : (this.modelGroup.position.x = c[0], this.modelGroup.position.y = c[1], this.modelGroup.position.z = c[2], this.rotationGroup.position.z = c[3], this.rotationGroup.quaternion.x = c[4], this.rotationGroup.quaternion.y = c[5], this.rotationGroup.quaternion.z = c[6], this.rotationGroup.quaternion.w = c[7], typeof c[8] < "u" && (this.rotationGroup.position.x = c[8], this.rotationGroup.position.y = c[9]), this.show(v), this); } // apply styles, models, etc in viewer /** @@ -23618,35 +23640,35 @@ ATOM`, b); * adding/removing models, applying styles, etc. * */ - render(c, _) { + render(c, v) { this.renderer.setViewport(), this.updateClickables(); var E = this.getView(); this.stateChangeCallback && this.stateChangeCallback(this.getInternalState()); var w, k; - for (_ || (_ = this.renderer.supportedExtensions()), w = 0; w < this.models.length; w++) - this.models[w] && this.models[w].globj(this.modelGroup, _); + for (v || (v = this.renderer.supportedExtensions()), w = 0; w < this.models.length; w++) + this.models[w] && this.models[w].globj(this.modelGroup, v); for (w = 0; w < this.shapes.length; w++) - this.shapes[w] && (typeof this.shapes[w].frame > "u" || this.viewer_frame < 0 || this.shapes[w].frame < 0 || this.shapes[w].frame == this.viewer_frame ? this.shapes[w].globj(this.modelGroup, _) : this.shapes[w].removegl(this.modelGroup)); + this.shapes[w] && (typeof this.shapes[w].frame > "u" || this.viewer_frame < 0 || this.shapes[w].frame < 0 || this.shapes[w].frame == this.viewer_frame ? this.shapes[w].globj(this.modelGroup, v) : this.shapes[w].removegl(this.modelGroup)); for (w = 0; w < this.labels.length; w++) - _.regen && (this.labels[w].dispose(), this.modelGroup.remove(this.labels[w].sprite), this.labels[w].setContext(), this.modelGroup.add(this.labels[w].sprite)), this.labels[w] && typeof this.labels[w].frame < "u" && this.labels[w].frame >= 0 && (this.modelGroup.remove(this.labels[w].sprite), (this.viewer_frame < 0 || this.labels[w].frame == this.viewer_frame) && this.modelGroup.add(this.labels[w].sprite)); + v.regen && (this.labels[w].dispose(), this.modelGroup.remove(this.labels[w].sprite), this.labels[w].setContext(), this.modelGroup.add(this.labels[w].sprite)), this.labels[w] && typeof this.labels[w].frame < "u" && this.labels[w].frame >= 0 && (this.modelGroup.remove(this.labels[w].sprite), (this.viewer_frame < 0 || this.labels[w].frame == this.viewer_frame) && this.modelGroup.add(this.labels[w].sprite)); for (w in this.surfaces) if (this.surfaces.hasOwnProperty(w)) { var $ = this.surfaces[w]; for (k = 0; k < $.length; k++) if ($.hasOwnProperty(k)) { var L = $[k].geo; - if (!$[k].finished || _.regen) { + if (!$[k].finished || v.regen) { L.verticesNeedUpdate = !0, L.elementsNeedUpdate = !0, L.normalsNeedUpdate = !0, L.colorsNeedUpdate = !0, L.buffersNeedUpdate = !0, $[k].mat.needsUpdate = !0, $[k].done && ($[k].finished = !0), $[k].lastGL && this.modelGroup.remove($[k].lastGL); - var z = null; - if ($[k].mat instanceof r.LineBasicMaterial ? z = new r.Line(L, $[k].mat) : z = new r.Mesh(L, $[k].mat), $[k].mat.transparent && $[k].mat.opacity == 0 ? z.visible = !1 : z.visible = !0, $[k].symmetries.length > 1 || $[k].symmetries.length == 1 && !$[k].symmetries[k].isIdentity()) { - var F, R = new r.Object3D(); + var I = null; + if ($[k].mat instanceof r.LineBasicMaterial ? I = new r.Line(L, $[k].mat) : I = new r.Mesh(L, $[k].mat), $[k].mat.transparent && $[k].mat.opacity == 0 ? I.visible = !1 : I.visible = !0, $[k].symmetries.length > 1 || $[k].symmetries.length == 1 && !$[k].symmetries[k].isIdentity()) { + var F, P = new r.Object3D(); for (F = 0; F < $[k].symmetries.length; F++) { - var P = z.clone(); - P.matrix = $[k].symmetries[F], P.matrixAutoUpdate = !1, R.add(P); + var B = I.clone(); + B.matrix = $[k].symmetries[F], B.matrixAutoUpdate = !1, P.add(B); } - $[k].lastGL = R, this.modelGroup.add(R); + $[k].lastGL = P, this.modelGroup.add(P); } else - $[k].lastGL = z, this.modelGroup.add(z); + $[k].lastGL = I, this.modelGroup.add(I); } } } @@ -23656,21 +23678,21 @@ ATOM`, b); * @return list of models specified by sel */ getModelList(c) { - let _ = []; + let v = []; if (typeof c > "u" || typeof c.model > "u") for (let w = 0; w < this.models.length; w++) - this.models[w] && _.push(this.models[w]); + this.models[w] && v.push(this.models[w]); else { let w = c.model; Array.isArray(w) || (w = [w]); for (let k = 0; k < w.length; k++) if (typeof w[k] == "number") { var E = w[k]; - E < 0 && (E += this.models.length), _.push(this.models[E]); + E < 0 && (E += this.models.length), v.push(this.models[E]); } else - _.push(w[k]); + v.push(w[k]); } - return _; + return v; } /** * @@ -23679,12 +23701,12 @@ ATOM`, b); * @return {AtomSpec[]} */ getAtomsFromSel(c) { - var _ = []; + var v = []; typeof c > "u" && (c = {}); var E = this.getModelList(c); for (let w = 0; w < E.length; w++) - _ = _.concat(E[w].selectedAtoms(c)); - return _; + v = v.concat(E[w].selectedAtoms(c)); + return v; } /** * @@ -23694,10 +23716,10 @@ ATOM`, b); * sel * @return {boolean} */ - atomIsSelected(c, _) { - typeof _ > "u" && (_ = {}); - for (var E = this.getModelList(_), w = 0; w < E.length; w++) - if (E[w].atomIsSelected(c, _)) + atomIsSelected(c, v) { + typeof v > "u" && (v = {}); + for (var E = this.getModelList(v), w = 0; w < E.length; w++) + if (E[w].atomIsSelected(c, v)) return !0; return !1; } @@ -23716,9 +23738,9 @@ ATOM`, b); * @return {Array.} * */ - getUniqueValues(c, _) { - typeof _ > "u" && (_ = {}); - var E = this.getAtomsFromSel(_), w = {}; + getUniqueValues(c, v) { + typeof v > "u" && (v = {}); + var E = this.getAtomsFromSel(v), w = {}; for (var k in E) if (E[k].hasOwnProperty(c)) { var $ = E[k][c]; @@ -23733,8 +23755,8 @@ ATOM`, b); * @return {string} PDB string of selected atoms */ pdbData(c) { - for (var _ = this.getAtomsFromSel(c), E = "", w = 0, k = _.length; w < k; ++w) - E += _[w].pdbline + ` + for (var v = this.getAtomsFromSel(c), E = "", w = 0, k = v.length; w < k; ++w) + E += v[w].pdbline + ` `; return E; } @@ -23759,9 +23781,9 @@ ATOM`, b); }); */ - zoom(c = 2, _ = 0, E = !1) { + zoom(c = 2, v = 0, E = !1) { var w = (this.CAMERA_Z - this.rotationGroup.position.z) / c, k = this.CAMERA_Z - w; - return _ > 0 ? this.animateMotion(_, E, this.modelGroup.position, this.adjustZoomToLimits(k), this.rotationGroup.quaternion, this.lookingAt) : (this.rotationGroup.position.z = this.adjustZoomToLimits(k), this.show()), this; + return v > 0 ? this.animateMotion(v, E, this.modelGroup.position, this.adjustZoomToLimits(k), this.rotationGroup.quaternion, this.lookingAt) : (this.rotationGroup.position.z = this.adjustZoomToLimits(k), this.show()), this; } /** * Translate current view by x,y screen coordinates @@ -23783,11 +23805,11 @@ ATOM`, b); viewer.render(callback); }); */ - translate(c, _, E = 0, w = !1) { - var k = c / this.WIDTH, $ = _ / this.HEIGHT, L = new a.Vector3(0, 0, -this.CAMERA_Z); + translate(c, v, E = 0, w = !1) { + var k = c / this.WIDTH, $ = v / this.HEIGHT, L = new a.Vector3(0, 0, -this.CAMERA_Z); this.projector.projectVector(L, this.camera), L.x -= k, L.y -= $, this.projector.unprojectVector(L, this.camera), L.z = 0; - var z = this.lookingAt.clone().add(L); - return E > 0 ? this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, z) : (this.lookingAt = z, this.camera.lookAt(this.lookingAt), this.show()), this; + var I = this.lookingAt.clone().add(L); + return E > 0 ? this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, I) : (this.lookingAt = I, this.camera.lookAt(this.lookingAt), this.show()), this; } /** * Translate current models by x,y screen coordinates @@ -23810,8 +23832,8 @@ ATOM`, b); viewer.render(callback); }); */ - translateScene(c, _, E = 0, w = !1) { - var k = this.screenOffsetToModel(c, _), $ = this.modelGroup.position.clone().add(k); + translateScene(c, v, E = 0, w = !1) { + var k = this.screenOffsetToModel(c, v), $ = this.modelGroup.position.clone().add(k); return E > 0 ? this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = $, this.show()), this; } /** @@ -23823,7 +23845,7 @@ ATOM`, b); */ fitSlab(c) { c = c || {}; - var _ = this.getAtomsFromSel(c), E = (0, h.getExtent)(_), w = E[1][0] - E[0][0], k = E[1][1] - E[0][1], $ = E[1][2] - E[0][2], L = Math.hypot(w, k, $); + var v = this.getAtomsFromSel(c), E = (0, h.getExtent)(v), w = E[1][0] - E[0][0], k = E[1][1] - E[0][1], $ = E[1][2] - E[0][2], L = Math.hypot(w, k, $); return L < 5 && (L = 5), this.slabNear = -L / 1.9, this.slabFar = L / 2, this; } /** @@ -23850,24 +23872,24 @@ ATOM`, b); viewer.render(callback); }); */ - center(c = {}, _ = 0, E = !1) { + center(c = {}, v = 0, E = !1) { var w, k, $ = this.getAtomsFromSel(c), L = (0, h.getExtent)($); - (0, h.isEmptyObject)(c) ? (this.shapes.forEach((G) => { - if (G && G.boundingSphere && G.boundingSphere.center) { - var H = G.boundingSphere.center, Q = G.boundingSphere.radius; - Q > 0 ? ($.push(new a.Vector3(H.x + Q, H.y, H.z)), $.push(new a.Vector3(H.x - Q, H.y, H.z)), $.push(new a.Vector3(H.x, H.y + Q, H.z)), $.push(new a.Vector3(H.x, H.y - Q, H.z)), $.push(new a.Vector3(H.x, H.y, H.z + Q)), $.push(new a.Vector3(H.x, H.y, H.z - Q))) : $.push(H); + (0, h.isEmptyObject)(c) ? (this.shapes.forEach((N) => { + if (N && N.boundingSphere && N.boundingSphere.center) { + var V = N.boundingSphere.center, J = N.boundingSphere.radius; + J > 0 ? ($.push(new a.Vector3(V.x + J, V.y, V.z)), $.push(new a.Vector3(V.x - J, V.y, V.z)), $.push(new a.Vector3(V.x, V.y + J, V.z)), $.push(new a.Vector3(V.x, V.y - J, V.z)), $.push(new a.Vector3(V.x, V.y, V.z + J)), $.push(new a.Vector3(V.x, V.y, V.z - J))) : $.push(V); } }), L = (0, h.getExtent)($), w = $, k = L) : (w = this.getAtomsFromSel({}), k = (0, h.getExtent)(w)); - var z = new a.Vector3(L[2][0], L[2][1], L[2][2]), F = k[1][0] - k[0][0], R = k[1][1] - k[0][1], P = k[1][2] - k[0][2], U = Math.hypot(F, R, P); - U < 5 && (U = 5), this.slabNear = -U / 1.9, this.slabFar = U / 2, F = L[1][0] - L[0][0], R = L[1][1] - L[0][1], P = L[1][2] - L[0][2], U = Math.hypot(F, R, P), U < 5 && (U = 5); - for (var N = 25, B = 0; B < $.length; B++) - if ($[B]) { - var W = z.distanceToSquared($[B]); - W > N && (N = W); + var I = new a.Vector3(L[2][0], L[2][1], L[2][2]), F = k[1][0] - k[0][0], P = k[1][1] - k[0][1], B = k[1][2] - k[0][2], G = Math.hypot(F, P, B); + G < 5 && (G = 5), this.slabNear = -G / 1.9, this.slabFar = G / 2, F = L[1][0] - L[0][0], P = L[1][1] - L[0][1], B = L[1][2] - L[0][2], G = Math.hypot(F, P, B), G < 5 && (G = 5); + for (var U = 25, R = 0; R < $.length; R++) + if ($[R]) { + var W = I.distanceToSquared($[R]); + W > U && (U = W); } - U = Math.sqrt(N) * 2; - var V = z.clone().multiplyScalar(-1); - return _ > 0 ? this.animateMotion(_, E, V, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = V, this.show()), this; + G = Math.sqrt(U) * 2; + var H = I.clone().multiplyScalar(-1); + return v > 0 ? this.animateMotion(v, E, H, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = H, this.show()), this; } /** * Zoom to center of atom selection. The slab will be set appropriately for @@ -23898,39 +23920,39 @@ ATOM`, b); }); }); */ - zoomTo(c = {}, _ = 0, E = !1) { + zoomTo(c = {}, v = 0, E = !1) { let w = this.getAtomsFromSel(c), k = (0, h.getExtent)(w), $ = k; if ((0, h.isEmptyObject)(c)) { - let H = w && w.length; - if (this.shapes.forEach((Q) => { - if (Q && Q.boundingSphere) { - if (Q.boundingSphere.box) { - let ce = Q.boundingSphere.box; - w.push(new a.Vector3(ce.min.x, ce.min.y, ce.min.z)), w.push(new a.Vector3(ce.max.x, ce.max.y, ce.max.z)); - } else if (Q.boundingSphere.center) { - var te = Q.boundingSphere.center, ee = Q.boundingSphere.radius; - ee > 0 ? (w.push(new a.Vector3(te.x + ee, te.y, te.z)), w.push(new a.Vector3(te.x - ee, te.y, te.z)), w.push(new a.Vector3(te.x, te.y + ee, te.z)), w.push(new a.Vector3(te.x, te.y - ee, te.z)), w.push(new a.Vector3(te.x, te.y, te.z + ee)), w.push(new a.Vector3(te.x, te.y, te.z - ee))) : w.push(te); + let V = w && w.length; + if (this.shapes.forEach((J) => { + if (J && J.boundingSphere) { + if (J.boundingSphere.box) { + let ue = J.boundingSphere.box; + w.push(new a.Vector3(ue.min.x, ue.min.y, ue.min.z)), w.push(new a.Vector3(ue.max.x, ue.max.y, ue.max.z)); + } else if (J.boundingSphere.center) { + var re = J.boundingSphere.center, te = J.boundingSphere.radius; + te > 0 ? (w.push(new a.Vector3(re.x + te, re.y, re.z)), w.push(new a.Vector3(re.x - te, re.y, re.z)), w.push(new a.Vector3(re.x, re.y + te, re.z)), w.push(new a.Vector3(re.x, re.y - te, re.z)), w.push(new a.Vector3(re.x, re.y, re.z + te)), w.push(new a.Vector3(re.x, re.y, re.z - te))) : w.push(re); } } - }), $ = (0, h.getExtent)(w), !H) - for (let Q = 0; Q < 3; Q++) - k[2][Q] = ($[0][Q] + $[1][Q]) / 2; + }), $ = (0, h.getExtent)(w), !V) + for (let J = 0; J < 3; J++) + k[2][J] = ($[0][J] + $[1][J]) / 2; } else { - let H = this.getAtomsFromSel({}); - $ = (0, h.getExtent)(H); - } - var L = new a.Vector3(k[2][0], k[2][1], k[2][2]), z = $[1][0] - $[0][0], F = $[1][1] - $[0][1], R = $[1][2] - $[0][2], P = Math.hypot(z, F, R); - P < 5 && (P = 5), this.slabNear = -P / 1.9, this.slabFar = P / 2, Object.keys(c).length === 0 && (this.slabNear = Math.min(-P * 2, -50), this.slabFar = Math.max(P * 2, 50)); - var U = this.config.minimumZoomToDistance || 5; - z = k[1][0] - k[0][0], F = k[1][1] - k[0][1], R = k[1][2] - k[0][2], P = Math.hypot(z, F, R), P < U && (P = U); - for (var N = U * U, B = 0; B < w.length; B++) - if (w[B]) { - var W = L.distanceToSquared(w[B]); - W > N && (N = W); + let V = this.getAtomsFromSel({}); + $ = (0, h.getExtent)(V); + } + var L = new a.Vector3(k[2][0], k[2][1], k[2][2]), I = $[1][0] - $[0][0], F = $[1][1] - $[0][1], P = $[1][2] - $[0][2], B = Math.hypot(I, F, P); + B < 5 && (B = 5), this.slabNear = -B / 1.9, this.slabFar = B / 2, Object.keys(c).length === 0 && (this.slabNear = Math.min(-B * 2, -50), this.slabFar = Math.max(B * 2, 50)); + var G = this.config.minimumZoomToDistance || 5; + I = k[1][0] - k[0][0], F = k[1][1] - k[0][1], P = k[1][2] - k[0][2], B = Math.hypot(I, F, P), B < G && (B = G); + for (var U = G * G, R = 0; R < w.length; R++) + if (w[R]) { + var W = L.distanceToSquared(w[R]); + W > U && (U = W); } - P = Math.sqrt(N) * 2; - var V = L.clone().multiplyScalar(-1), G = -(P * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); - return G = this.adjustZoomToLimits(G), _ > 0 ? this.animateMotion(_, E, V, G, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = V, this.rotationGroup.position.z = G, this.show()), this; + B = Math.sqrt(U) * 2; + var H = L.clone().multiplyScalar(-1), N = -(B * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); + return N = this.adjustZoomToLimits(N), v > 0 ? this.animateMotion(v, E, H, N, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = H, this.rotationGroup.position.z = N, this.show()), this; } /** * Set slab of view (contents outside of slab are clipped). @@ -23939,8 +23961,8 @@ ATOM`, b); * @param {number} near near clipping plane distance * @param {number} far far clipping plane distance */ - setSlab(c, _) { - this.slabNear = c, this.slabFar = _; + setSlab(c, v) { + this.slabNear = c, this.slabFar = v; } /** * Get slab of view (contents outside of slab are clipped). @@ -23990,12 +24012,12 @@ ATOM`, b); }); */ - addLabel(c, _ = {}, E, w = !1) { + addLabel(c, v = {}, E, w = !1) { if (E) { var k = (0, h.getExtent)(this.getAtomsFromSel(E)); - _.position = { x: k[2][0], y: k[2][1], z: k[2][2] }; + v.position = { x: k[2][0], y: k[2][1], z: k[2][2] }; } - var $ = new v.Label(c, _); + var $ = new _.Label(c, v); return $.setContext(), this.modelGroup.add($.sprite), this.labels.push($), w || this.show(), $; } /** Add residue labels. This will generate one label per a @@ -24015,9 +24037,9 @@ ATOM`, b); viewer.render(); }); */ - addResLabels(c, _, E = !1) { + addResLabels(c, v, E = !1) { let w = this.labels.length; - return this.applyToModels("addResLabels", c, this, _, E), this.show(), this.labels.slice(w); + return this.applyToModels("addResLabels", c, this, v, E), this.show(), this.labels.slice(w); } /** Add property labels. This will generate one label per a selected * atom at the atom's coordinates with the property value as the label text. @@ -24034,8 +24056,8 @@ ATOM`, b); viewer.render(); }); */ - addPropertyLabels(c, _, E) { - return this.applyToModels("addPropertyLabels", c, _, this, E), this.show(), this; + addPropertyLabels(c, v, E) { + return this.applyToModels("addPropertyLabels", c, v, this, E), this.show(), this; } /** * Remove label from viewer @@ -24056,9 +24078,9 @@ ATOM`, b); */ removeLabel(c) { - for (var _ = 0; _ < this.labels.length; _++) - if (this.labels[_] == c) { - this.labels.splice(_, 1), c.dispose(), this.modelGroup.remove(c.sprite); + for (var v = 0; v < this.labels.length; v++) + if (this.labels[v] == c) { + this.labels.splice(v, 1), c.dispose(), this.modelGroup.remove(c.sprite); break; } return this.show(), this; @@ -24091,8 +24113,8 @@ ATOM`, b); * stylespec - Label style specification * @return {Label} */ - setLabelStyle(c, _) { - return this.modelGroup.remove(c.sprite), c.dispose(), c.stylespec = _, c.setContext(), this.modelGroup.add(c.sprite), this.show(), c; + setLabelStyle(c, v) { + return this.modelGroup.remove(c.sprite), c.dispose(), c.stylespec = v, c.setContext(), this.modelGroup.add(c.sprite), this.show(), c; } // Change label text /** @@ -24103,8 +24125,8 @@ ATOM`, b); * text - Label text * @return {Label} */ - setLabelText(c, _) { - return this.modelGroup.remove(c.sprite), c.dispose(), c.text = _, c.setContext(), this.modelGroup.add(c.sprite), this.show(), c; + setLabelText(c, v) { + return this.modelGroup.remove(c.sprite), c.dispose(), c.text = v, c.setContext(), this.modelGroup.add(c.sprite), this.show(), c; } /** * Add shape object to viewer @@ -24115,8 +24137,8 @@ ATOM`, b); */ addShape(c) { c = c || {}; - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, this.shapes.push(_), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, this.shapes.push(v), v; } /** * Remove shape object from viewer @@ -24135,8 +24157,8 @@ ATOM`, b); */ removeAllShapes() { for (var c = 0; c < this.shapes.length; c++) { - var _ = this.shapes[c]; - _ && _.removegl(this.modelGroup); + var v = this.shapes[c]; + v && v.removegl(this.modelGroup); } return this.shapes.splice(0, this.shapes.length), this; } @@ -24144,10 +24166,10 @@ ATOM`, b); getSelectionCenter(c) { if (c.hasOwnProperty("x") && c.hasOwnProperty("y") && c.hasOwnProperty("z")) return c; - var _ = this.getAtomsFromSel(c); - if (_.length == 0) + var v = this.getAtomsFromSel(c); + if (v.length == 0) return { x: 0, y: 0, z: 0 }; - var E = (0, h.getExtent)(_); + var E = (0, h.getExtent)(v); return { x: E[0][0] + (E[1][0] - E[0][0]) / 2, y: E[0][1] + (E[1][1] - E[0][1]) / 2, z: E[0][2] + (E[1][2] - E[0][2]) / 2 }; } /** @@ -24164,8 +24186,8 @@ ATOM`, b); */ addSphere(c) { c = c || {}, c.center = this.getSelectionCenter(c.center); - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, _.addSphere(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, v.addSphere(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add box shape. This method provides a shorthand @@ -24186,8 +24208,8 @@ ATOM`, b); */ addBox(c = {}) { c.corner != null && (c.corner = this.getSelectionCenter(c.corner)), c.center != null && (c.center = this.getSelectionCenter(c.center)); - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, _.addBox(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, v.addBox(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add arrow shape @@ -24215,8 +24237,8 @@ ATOM`, b); */ addArrow(c = {}) { c.start = this.getSelectionCenter(c.start), c.end = this.getSelectionCenter(c.end); - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, _.addArrow(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, v.addArrow(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add cylinder shape @@ -24254,8 +24276,8 @@ ATOM`, b); */ addCylinder(c = {}) { c.start = this.getSelectionCenter(c.start), c.end = this.getSelectionCenter(c.end); - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, c.dashed ? _.addDashedCylinder(c) : _.addCylinder(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, c.dashed ? v.addDashedCylinder(c) : v.addCylinder(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add Curve shape @@ -24281,8 +24303,8 @@ ATOM`, b); viewer.render(); */ addCurve(c = {}) { - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, _.addCurve(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, v.addCurve(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add line shape @@ -24304,8 +24326,8 @@ ATOM`, b); */ addLine(c = {}) { c.start = this.getSelectionCenter(c.start), c.end = this.getSelectionCenter(c.end), c.wireframe = !0; - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, c.dashed ? _ = this.addLineDashed(c, _) : _.addLine(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, c.dashed ? v = this.addLineDashed(c, v) : v.addLine(c), this.shapes.push(v), v.finalize(), v; } /** * Create and add unit cell visualization. @@ -24321,19 +24343,19 @@ ATOM`, b); viewer.render(); }); */ - addUnitCell(c, _) { - c = this.getModel(c), _ = _ || { alabel: "a", blabel: "b", clabel: "c" }, _.box = _.box || {}, _.astyle = _.astyle || { color: "red", radius: 0.1, midpos: -1 }, _.bstyle = _.bstyle || { color: "green", radius: 0.1, midpos: -1 }, _.cstyle = _.cstyle || { color: "blue", radius: 0.1, midpos: -1 }, _.alabelstyle = _.alabelstyle || { fontColor: "red", showBackground: !1, alignment: "center", inFront: !1 }, _.blabelstyle = _.blabelstyle || { fontColor: "green", showBackground: !1, alignment: "center", inFront: !1 }, _.clabelstyle = _.clabelstyle || { fontColor: "blue", showBackground: !1, alignment: "center", inFront: !1 }, c.unitCellObjects && this.removeUnitCell(c), c.unitCellObjects = { shapes: [], labels: [] }; + addUnitCell(c, v) { + c = this.getModel(c), v = v || { alabel: "a", blabel: "b", clabel: "c" }, v.box = v.box || {}, v.astyle = v.astyle || { color: "red", radius: 0.1, midpos: -1 }, v.bstyle = v.bstyle || { color: "green", radius: 0.1, midpos: -1 }, v.cstyle = v.cstyle || { color: "blue", radius: 0.1, midpos: -1 }, v.alabelstyle = v.alabelstyle || { fontColor: "red", showBackground: !1, alignment: "center", inFront: !1 }, v.blabelstyle = v.blabelstyle || { fontColor: "green", showBackground: !1, alignment: "center", inFront: !1 }, v.clabelstyle = v.clabelstyle || { fontColor: "blue", showBackground: !1, alignment: "center", inFront: !1 }, c.unitCellObjects && this.removeUnitCell(c), c.unitCellObjects = { shapes: [], labels: [] }; var E = c.getCrystData(), w = null; if (E) { if (E.matrix) w = E.matrix; else { - var k = E.a, $ = E.b, L = E.c, z = E.alpha, F = E.beta, R = E.gamma; - z = z * Math.PI / 180, F = F * Math.PI / 180, R = R * Math.PI / 180; - var P, U, N; - P = Math.cos(F), U = (Math.cos(z) - Math.cos(F) * Math.cos(R)) / Math.sin(R), N = Math.sqrt(Math.max(0, 1 - P * P - U * U)), w = new a.Matrix3(k, $ * Math.cos(R), L * P, 0, $ * Math.sin(R), L * U, 0, 0, L * N); + var k = E.a, $ = E.b, L = E.c, I = E.alpha, F = E.beta, P = E.gamma; + I = I * Math.PI / 180, F = F * Math.PI / 180, P = P * Math.PI / 180; + var B, G, U; + B = Math.cos(F), G = (Math.cos(I) - Math.cos(F) * Math.cos(P)) / Math.sin(P), U = Math.sqrt(Math.max(0, 1 - B * B - G * G)), w = new a.Matrix3(k, $ * Math.cos(P), L * B, 0, $ * Math.sin(P), L * G, 0, 0, L * U); } - var B = [ + var R = [ new a.Vector3(0, 0, 0), new a.Vector3(1, 0, 0), new a.Vector3(0, 1, 0), @@ -24344,45 +24366,45 @@ ATOM`, b); new a.Vector3(1, 1, 1) ]; if (E.matrix4) - for (let V = 0; V < B.length; V++) - E.size && B[V].multiplyVectors(B[V], E.size), B[V] = B[V].applyMatrix4(E.matrix4); + for (let H = 0; H < R.length; H++) + E.size && R[H].multiplyVectors(R[H], E.size), R[H] = R[H].applyMatrix4(E.matrix4); else - for (let V = 0; V < B.length; V++) - B[V] = B[V].applyMatrix3(w); - if (_.box && !_.box.hidden) { - _.box.wireframe = !0; - var W = new f.GLShape(_.box); - W.shapePosition = this.shapes.length, W.addLine({ start: B[0], end: B[1] }), W.addLine({ start: B[0], end: B[2] }), W.addLine({ start: B[1], end: B[4] }), W.addLine({ start: B[2], end: B[4] }), W.addLine({ start: B[0], end: B[3] }), W.addLine({ start: B[3], end: B[5] }), W.addLine({ start: B[2], end: B[5] }), W.addLine({ start: B[1], end: B[6] }), W.addLine({ start: B[4], end: B[7] }), W.addLine({ start: B[6], end: B[7] }), W.addLine({ start: B[3], end: B[6] }), W.addLine({ start: B[5], end: B[7] }), this.shapes.push(W), c.unitCellObjects.shapes.push(W), W.finalize(); + for (let H = 0; H < R.length; H++) + R[H] = R[H].applyMatrix3(w); + if (v.box && !v.box.hidden) { + v.box.wireframe = !0; + var W = new f.GLShape(v.box); + W.shapePosition = this.shapes.length, W.addLine({ start: R[0], end: R[1] }), W.addLine({ start: R[0], end: R[2] }), W.addLine({ start: R[1], end: R[4] }), W.addLine({ start: R[2], end: R[4] }), W.addLine({ start: R[0], end: R[3] }), W.addLine({ start: R[3], end: R[5] }), W.addLine({ start: R[2], end: R[5] }), W.addLine({ start: R[1], end: R[6] }), W.addLine({ start: R[4], end: R[7] }), W.addLine({ start: R[6], end: R[7] }), W.addLine({ start: R[3], end: R[6] }), W.addLine({ start: R[5], end: R[7] }), this.shapes.push(W), c.unitCellObjects.shapes.push(W), W.finalize(); } - if (!_.astyle.hidden) { - _.astyle.start = B[0], _.astyle.end = B[1]; - let V = this.addArrow(_.astyle); - c.unitCellObjects.shapes.push(V); + if (!v.astyle.hidden) { + v.astyle.start = R[0], v.astyle.end = R[1]; + let H = this.addArrow(v.astyle); + c.unitCellObjects.shapes.push(H); } - if (!_.bstyle.hidden) { - _.bstyle.start = B[0], _.bstyle.end = B[2]; - let V = this.addArrow(_.bstyle); - c.unitCellObjects.shapes.push(V); + if (!v.bstyle.hidden) { + v.bstyle.start = R[0], v.bstyle.end = R[2]; + let H = this.addArrow(v.bstyle); + c.unitCellObjects.shapes.push(H); } - if (!_.cstyle.hidden) { - _.cstyle.start = B[0], _.cstyle.end = B[3]; - let V = this.addArrow(_.cstyle); - c.unitCellObjects.shapes.push(V); + if (!v.cstyle.hidden) { + v.cstyle.start = R[0], v.cstyle.end = R[3]; + let H = this.addArrow(v.cstyle); + c.unitCellObjects.shapes.push(H); } - if (_.alabel) { - _.alabelstyle.position = B[1]; - let V = this.addLabel(_.alabel, _.alabelstyle); - c.unitCellObjects.labels.push(V); + if (v.alabel) { + v.alabelstyle.position = R[1]; + let H = this.addLabel(v.alabel, v.alabelstyle); + c.unitCellObjects.labels.push(H); } - if (_.blabel) { - _.blabelstyle.position = B[2]; - let V = this.addLabel(_.blabel, _.blabelstyle); - c.unitCellObjects.labels.push(V); + if (v.blabel) { + v.blabelstyle.position = R[2]; + let H = this.addLabel(v.blabel, v.blabelstyle); + c.unitCellObjects.labels.push(H); } - if (_.clabel) { - _.clabelstyle.position = B[3]; - let V = this.addLabel(_.clabel, _.clabelstyle); - c.unitCellObjects.labels.push(V); + if (v.clabel) { + v.clabelstyle.position = R[3]; + let H = this.addLabel(v.clabel, v.clabelstyle); + c.unitCellObjects.labels.push(H); } } } @@ -24402,11 +24424,11 @@ ATOM`, b); */ removeUnitCell(c) { if (c = this.getModel(c), c.unitCellObjects) { - let _ = this; + let v = this; c.unitCellObjects.shapes.forEach(function(E) { - _.removeShape(E); + v.removeShape(E); }), c.unitCellObjects.labels.forEach(function(E) { - _.removeLabel(E); + v.removeLabel(E); }); } delete c.unitCellObjects; @@ -24431,63 +24453,63 @@ ATOM`, b); viewer.render(); }); */ - replicateUnitCell(c = 3, _ = c, E = _, w, k, $) { + replicateUnitCell(c = 3, v = c, E = v, w, k, $) { w = this.getModel(w); let L = w.getCrystData(); if (L) { - const z = w.selectedAtoms({}), F = L.matrix; - let R = function(U) { - return U % 2 == 0 ? -U / 2 : Math.ceil(U / 2); + const I = w.selectedAtoms({}), F = L.matrix; + let P = function(G) { + return G % 2 == 0 ? -G / 2 : Math.ceil(G / 2); }; - c <= 1 && _ <= 1 && E <= 1 && ($ = !0, c = _ = E = 3); - let P = function(U, N, B) { + c <= 1 && v <= 1 && E <= 1 && ($ = !0, c = v = E = 3); + let B = function(G, U, R) { return !1; }; if ($) { - const U = new a.Matrix3().getInverse3(F); - P = function(N, B, W) { - let V = new a.Vector3(N, B, W).applyMatrix3(U); - 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); + const G = new a.Matrix3().getInverse3(F); + B = function(U, R, W) { + let H = new a.Vector3(U, R, W).applyMatrix3(G); + return !(H.x > -1e-4 && H.x < 1.0001 && H.y > -1e-4 && H.y < 1.0001 && H.z > -1e-4 && H.z < 1.0001); }; } - for (let U = 0; U < c; U++) - for (let N = 0; N < _; N++) - for (let B = 0; B < E; B++) { - if (U == 0 && N == 0 && B == 0) + for (let G = 0; G < c; G++) + for (let U = 0; U < v; U++) + for (let R = 0; R < E; R++) { + if (G == 0 && U == 0 && R == 0) continue; - let W = new a.Vector3(R(U), R(N), R(B)); + let W = new a.Vector3(P(G), P(U), P(R)); W.applyMatrix3(F); - let V = []; - for (let G = 0; G < z.length; G++) { - let H = z[G].x + W.x, Q = z[G].y + W.y, te = z[G].z + W.z; - if (P(H, Q, te)) + let H = []; + for (let N = 0; N < I.length; N++) { + let V = I[N].x + W.x, J = I[N].y + W.y, re = I[N].z + W.z; + if (B(V, J, re)) continue; - let ee = {}; - for (let ce in z[G]) - ee[ce] = z[G][ce]; - ee.x = H, ee.y = Q, ee.z = te, V.push(ee); + let te = {}; + for (let ue in I[N]) + te[ue] = I[N][ue]; + te.x = V, te.y = J, te.z = re, H.push(te); } - w.addAtoms(V); + w.addAtoms(H); } k && w.assignBonds(); } } /** Add dashed line to shape */ - addLineDashed(c, _) { + addLineDashed(c, v) { c.dashLength = c.dashLength || 0.5, c.gapLength = c.gapLength || 0.5; var E; c.start ? E = new a.Vector3(c.start.x || 0, c.start.y || 0, c.start.z || 0) : E = new a.Vector3(0, 0, 0); var w; c.end ? w = new a.Vector3(c.end.x, c.end.y || 0, c.end.z || 0) : w = new a.Vector3(0, 0, 0); - var k = new a.Vector3(), $ = new a.Vector3(), L = new a.Vector3(), z, F, R, P = E.clone(), U = 0; - for (k.subVectors(w, E), z = k.length(), k.normalize(), $ = k.clone(), L = k.clone(), $.multiplyScalar(c.dashLength), L.multiplyScalar(c.gapLength), F = $.length(), R = L.length(); U < z; ) { - if (U + F > z) { - c.start = E, c.end = w, _.addLine(c); + var k = new a.Vector3(), $ = new a.Vector3(), L = new a.Vector3(), I, F, P, B = E.clone(), G = 0; + for (k.subVectors(w, E), I = k.length(), k.normalize(), $ = k.clone(), L = k.clone(), $.multiplyScalar(c.dashLength), L.multiplyScalar(c.gapLength), F = $.length(), P = L.length(); G < I; ) { + if (G + F > I) { + c.start = E, c.end = w, v.addLine(c); break; } - P.addVectors(E, $), c.start = E, c.end = P, _.addLine(c), E = P.clone(), U += F, P.addVectors(E, L), E = P.clone(), U += R; + B.addVectors(E, $), c.start = E, c.end = B, v.addLine(c), E = B.clone(), G += F, B.addVectors(E, L), E = B.clone(), G += P; } - return _.finalize(), _; + return v.finalize(), v; } /** * Add custom shape component from user supplied function @@ -24523,8 +24545,8 @@ ATOM`, b); */ addCustom(c) { c = c || {}; - var _ = new f.GLShape(c); - return _.shapePosition = this.shapes.length, _.addCustom(c), this.shapes.push(_), _.finalize(), _; + var v = new f.GLShape(c); + return v.shapePosition = this.shapes.length, v.addCustom(c), this.shapes.push(v), v.finalize(), v; } /** * Construct isosurface from volumetric data in gaussian cube format @@ -24546,8 +24568,8 @@ ATOM`, b); */ - addVolumetricData(c, _, E = {}) { - var w = new y.VolumeData(c, _); + addVolumetricData(c, v, E = {}) { + var w = new y.VolumeData(c, v); return E.hasOwnProperty("transferfn") ? this.addVolumetricRender(w, E) : this.addIsosurface(w, E); } /** @@ -24568,9 +24590,9 @@ ATOM`, b); viewer.render(); }); */ - addIsosurface(c, _ = {}, E) { - var w = new f.GLShape(_); - return w.shapePosition = this.shapes.length, w.addIsosurface(c, _, E, this), this.shapes.push(w), w; + addIsosurface(c, v = {}, E) { + var w = new f.GLShape(v); + return w.shapePosition = this.shapes.length, w.addIsosurface(c, v, E, this), this.shapes.push(w), w; } /** * Create volumetric renderer for volumetricData @@ -24580,9 +24602,9 @@ ATOM`, b); * @return {GLShape} * */ - addVolumetricRender(c, _) { - _ = _ || {}; - var E = new x.GLVolumetricRender(c, _, this); + addVolumetricRender(c, v) { + v = v || {}; + var E = new x.GLVolumetricRender(c, v, this); return E.shapePosition = this.shapes.length, this.shapes.push(E), E; } /** @@ -24611,10 +24633,10 @@ ATOM`, b); */ setFrame(c) { this.viewer_frame = c; - let _ = this; + let v = this; return new Promise(function(E) { - var w = _.models.map(function(k) { - return k.setFrame(c, _); + var w = v.models.map(function(k) { + return k.setFrame(c, v); }); Promise.all(w).then(function() { E(); @@ -24635,12 +24657,12 @@ ATOM`, b); */ getNumFrames() { var c = 0; - for (let _ = 0; _ < this.models.length; _++) - this.models[_].getNumFrames() > c && (c = this.models[_].getNumFrames()); - for (let _ = 0; _ < this.shapes.length; _++) - this.shapes[_].frame && this.shapes[_].frame >= c && (c = this.shapes[_].frame + 1); - for (let _ = 0; _ < this.labels.length; _++) - this.labels[_].frame && this.labels[_].frame >= c && (c = this.labels[_].frame + 1); + for (let v = 0; v < this.models.length; v++) + this.models[v].getNumFrames() > c && (c = this.models[v].getNumFrames()); + for (let v = 0; v < this.shapes.length; v++) + this.shapes[v].frame && this.shapes[v].frame >= c && (c = this.shapes[v].frame + 1); + for (let v = 0; v < this.labels.length; v++) + this.labels[v].frame && this.labels[v].frame >= c && (c = this.labels[v].frame + 1); return c; } /** @@ -24651,31 +24673,31 @@ ATOM`, b); */ animate(c) { this.incAnim(); - var _ = 100, E = "forward", w = 1 / 0; - c = c || {}, c.interval && (_ = c.interval), c.loop && (E = c.loop), c.reps && (w = c.reps); + var v = 100, E = "forward", w = 1 / 0; + c = c || {}, c.interval && (v = c.interval), c.loop && (E = c.loop), c.reps && (w = c.reps); var k = this.getNumFrames(), $ = this, L = 0; c.startFrame && (L = c.startFrame % k); - var z = 1; - c.step && (z = c.step, w /= z); - var F = 0, R = k * w, P = /* @__PURE__ */ new Date(), U, N, B = function(W) { - P = /* @__PURE__ */ new Date(), W == "forward" ? $.setFrame(L).then(function() { - L = (L + z) % k, U(); + var I = 1; + c.step && (I = c.step, w /= I); + var F = 0, P = k * w, B = /* @__PURE__ */ new Date(), G, U, R = function(W) { + B = /* @__PURE__ */ new Date(), W == "forward" ? $.setFrame(L).then(function() { + L = (L + I) % k, G(); }) : W == "backward" ? $.setFrame(k - 1 - L).then(function() { - L = (L + z) % k, U(); + L = (L + I) % k, G(); }) : $.setFrame(L).then(function() { - L += z, z *= L % (k - 1) == 0 ? -1 : 1, U(); + L += I, I *= L % (k - 1) == 0 ? -1 : 1, G(); }); }; - return U = function() { + return G = function() { if ($.render(), !$.getCanvas().isConnected) $.stopAnimate(); - else if (++F >= R || !$.isAnimated()) - N.cancel(), $.animationTimers.delete(N), $.decAnim(); + else if (++F >= P || !$.isAnimated()) + U.cancel(), $.animationTimers.delete(U), $.decAnim(); else { - var W = _ - ((/* @__PURE__ */ new Date()).getTime() - P.getTime()); - W = W > 0 ? W : 0, $.animationTimers.delete(N), N = new h.PausableTimer(B, W, E), $.animationTimers.add(N); + var W = v - ((/* @__PURE__ */ new Date()).getTime() - B.getTime()); + W = W > 0 ? W : 0, $.animationTimers.delete(U), U = new h.PausableTimer(R, W, E), $.animationTimers.add(U); } - }, N = new h.PausableTimer(B, 0, E), this.animationTimers.add(N), this; + }, U = new h.PausableTimer(R, 0, E), this.animationTimers.add(U), this; } /** * Stop animation of all models in viewer @@ -24734,10 +24756,10 @@ ATOM`, b); * * @return {GLModel} */ - addModel(c, _ = "", E) { + addModel(c, v = "", E) { E = this.getModelOpt(E); var w = new d.GLModel(this.models.length, E); - return w.addMolData(c, _, E), this.models.push(w), w; + return w.addMolData(c, v, E), this.models.push(w), w; } /** * Given multimodel file and its format, add atom data to the viewer as separate models @@ -24747,9 +24769,9 @@ ATOM`, b); * @param {string} format - Input format (see {@link FileFormats}) * @return {Array} */ - addModels(c, _, E) { + addModels(c, v, E) { E = this.getModelOpt(E), E.multimodel = !0, E.frames = !0; - for (var w = d.GLModel.parseMolData(c, _, E), k = 0; k < w.length; k++) { + for (var w = d.GLModel.parseMolData(c, v, E), k = 0; k < w.length; k++) { var $ = new d.GLModel(this.models.length, E); $.setAtomDefaults(w[k]), $.addFrame(w[k]), $.setFrame(0), w.modelData && $.setModelData(w.modelData[k]), $.setDontDuplicateAtoms(!E.duplicateAssemblyAtoms), this.models.push($); } @@ -24773,10 +24795,10 @@ ATOM`, b); viewer.render(); }); */ - addModelsAsFrames(c, _, E) { + addModelsAsFrames(c, v, E) { E = this.getModelOpt(E), E.multimodel = !0, E.frames = !0; var w = new d.GLModel(this.models.length, E); - return w.addMolData(c, _, E), this.models.push(w), w; + return w.addMolData(c, v, E), this.models.push(w), w; } /** * Create and add model to viewer. Given multimodel file and its format, @@ -24794,10 +24816,10 @@ ATOM`, b); viewer.render(); }); */ - addAsOneMolecule(c, _, E) { + addAsOneMolecule(c, v, E) { E = this.getModelOpt(E), E.multimodel = !0, E.onemol = !0; var w = new d.GLModel(this.models.length, E); - return w.addMolData(c, _, E), this.models.push(w), w; + return w.addMolData(c, v, E), this.models.push(w), w; } /** * Delete specified model from viewer @@ -24816,8 +24838,8 @@ ATOM`, b); */ removeAllModels() { for (var c = 0; c < this.models.length; c++) { - var _ = this.models[c]; - _ && _.removegl(this.modelGroup); + var v = this.models[c]; + v && v.removegl(this.modelGroup); } return this.models.splice(0, this.models.length), this; } @@ -24827,11 +24849,11 @@ ATOM`, b); * @param {number} modelID - Optional parameter for which model to export. If left out, export all of them. * @return {string} */ - exportJSON(c, _) { + exportJSON(c, v) { var E = {}; - return _ === void 0 ? E.m = this.models.map(function(w) { + return v === void 0 ? E.m = this.models.map(function(w) { return w.toCDObject(c); - }) : E.m = [this.models[_].toCDObject()], JSON.stringify(E); + }) : E.m = [this.models[v].toCDObject()], JSON.stringify(E); } /** return a VRML string representation of the scene. Include VRML header information * @return VRML @@ -24839,10 +24861,10 @@ ATOM`, b); exportVRML() { var c = this.modelGroup; this.applyToModels("removegl", this.modelGroup), this.modelGroup = new r.Object3D(), this.render(null, { supportsImposters: !1, supportsAIA: !1, regen: !0 }); - var _ = `#VRML V2.0 utf8 + var v = `#VRML V2.0 utf8 ` + this.modelGroup.vrml() + ` `; - return this.applyToModels("removegl", this.modelGroup), this.modelGroup = c, _; + return this.applyToModels("removegl", this.modelGroup), this.modelGroup = c, v; } /** * Create a new model from atoms specified by sel. @@ -24852,23 +24874,23 @@ ATOM`, b); * @param {boolean=} extract - If true, remove selected atoms from existing models * @return {GLModel} */ - createModelFrom(c, _ = !1) { + createModelFrom(c, v = !1) { for (var E = new d.GLModel(this.models.length, this.defaultcolors), w = 0; w < this.models.length; w++) if (this.models[w]) { var k = this.models[w].selectedAtoms(c); - E.addAtoms(k), _ && this.models[w].removeAtoms(k); + E.addAtoms(k), v && this.models[w].removeAtoms(k); } return this.models.push(E), E; } - applyToModels(c, _, E, w, k, $, L) { - for (var z = this.getModelList(_), F = 0; F < z.length; F++) - z[F][c](_, E, w, k, $, L); + applyToModels(c, v, E, w, k, $, L) { + for (var I = this.getModelList(v), F = 0; F < I.length; F++) + I[F][c](v, E, w, k, $, L); } - setStyle(c, _) { - return typeof _ > "u" && (_ = c, c = {}), this.applyToModels("setStyle", c, _, !1), this; + setStyle(c, v) { + return typeof v > "u" && (v = c, c = {}), this.applyToModels("setStyle", c, v, !1), this; } - addStyle(c, _) { - return typeof _ > "u" && (_ = c, c = {}), this.applyToModels("setStyle", c, _, !0), this; + addStyle(c, v) { + return typeof v > "u" && (v = c, c = {}), this.applyToModels("setStyle", c, v, !0), this; } /** * Set click-handling properties to all selected atoms. *Important*: render must be called for this to take effect. @@ -24889,8 +24911,8 @@ ATOM`, b); viewer.render(); }); */ - setClickable(c, _, E) { - return this.applyToModels("setClickable", c, _, E), this; + setClickable(c, v, E) { + return this.applyToModels("setClickable", c, v, E), this; } /** Set hoverable and callback of selected atoms * @@ -24918,8 +24940,8 @@ ATOM`, b); }); */ - setHoverable(c, _, E, w) { - return this.applyToModels("setHoverable", c, _, E, w), this; + setHoverable(c, v, E, w) { + return this.applyToModels("setHoverable", c, v, E, w), this; } /** enable context menu and callback of selected atoms * @@ -24927,8 +24949,8 @@ ATOM`, b); * @param {boolean} contextMenuEnabled - whether contextMenu-handling is enabled for the selection */ - enableContextMenu(c, _) { - return this.applyToModels("enableContextMenu", c, _), this; + enableContextMenu(c, v) { + return this.applyToModels("enableContextMenu", c, v), this; } /** * If atoms have dx, dy, dz properties (in some xyz files), vibrate populates each model's frame property based on parameters. @@ -24939,8 +24961,8 @@ ATOM`, b); * @param {boolean} bothWays - if true, extend both in positive and negative directions by numFrames * @param {ArrowSpec} arrowSpec - specification for drawing animated arrows. If color isn't specified, atom color (sphere, stick, line preference) is used. */ - vibrate(c, _, E, w) { - return this.applyToModels("vibrate", c, _, E, this, w), this; + vibrate(c, v, E, w) { + return this.applyToModels("vibrate", c, v, E, this, w), this; } /** * @param {AtomSelectionSpec} sel @@ -24948,15 +24970,15 @@ ATOM`, b); * @param {Gradient|string} scheme * @param {object} range */ - setColorByProperty(c, _, E, w) { - return this.applyToModels("setColorByProperty", c, _, E, w), this; + setColorByProperty(c, v, E, w) { + return this.applyToModels("setColorByProperty", c, v, E, w), this; } /** * @param {AtomSelectionSpec} sel * @param {object} colors */ - setColorByElement(c, _) { - return this.applyToModels("setColorByElement", c, _), this; + setColorByElement(c, v) { + return this.applyToModels("setColorByElement", c, v), this; } /** * @@ -24965,18 +24987,18 @@ ATOM`, b); * extent * @return {Array} */ - static getAtomsWithin(c, _) { + static getAtomsWithin(c, v) { var E = []; for (let k = 0; k < c.length; k++) { var w = c[k]; - typeof w > "u" || w.x < _[0][0] || w.x > _[1][0] || w.y < _[0][1] || w.y > _[1][1] || w.z < _[0][2] || w.z > _[1][2] || E.push(w); + typeof w > "u" || w.x < v[0][0] || w.x > v[1][0] || w.y < v[0][1] || w.y > v[1][1] || w.z < v[0][2] || w.z > v[1][2] || E.push(w); } return E; } // return volume of extent static volume(c) { - var _ = c[1][0] - c[0][0], E = c[1][1] - c[0][1], w = c[1][2] - c[0][2]; - return _ * E * w; + var v = c[1][0] - c[0][0], E = c[1][1] - c[0][1], w = c[1][2] - c[0][2]; + return v * E * w; } // volume /* @@ -24993,35 +25015,35 @@ ATOM`, b); * @param {AtomSpec[]} atomstoshow * @return {Array} */ - carveUpExtent(c, _, E) { + carveUpExtent(c, v, E) { let w = [], k = {}; - for (let P = 0, U = _.length; P < U; P++) - k[_[P].index] = P; - let $ = function(P) { - let U = []; - for (let N = 0, B = P.length; N < B; N++) - P[N].index in k && U.push(k[P[N].index]); - return U; - }, L = function(P) { - let U = []; - return U[0] = [P[0][0], P[0][1], P[0][2]], U[1] = [P[1][0], P[1][1], P[1][2]], U; - }, z = function(P) { - if (l.volume(P) < l.maxVolume) - return [P]; - var U = P[1][0] - P[0][0], N = P[1][1] - P[0][1], B = P[1][2] - P[0][2], W; - U > N && U > B ? W = 0 : N > U && N > B ? W = 1 : W = 2; - var V = L(P), G = L(P), H = (P[1][W] - P[0][W]) / 2 + P[0][W]; - V[1][W] = H, G[0][W] = H; - var Q = z(V), te = z(G); - return Q.concat(te); - }, F = z(c), R = 6; - for (let P = 0, U = F.length; P < U; P++) { - let N = L(F[P]); - N[0][0] -= R, N[0][1] -= R, N[0][2] -= R, N[1][0] += R, N[1][1] += R, N[1][2] += R; - let B = l.getAtomsWithin(_, N), W = l.getAtomsWithin(E, F[P]); + for (let B = 0, G = v.length; B < G; B++) + k[v[B].index] = B; + let $ = function(B) { + let G = []; + for (let U = 0, R = B.length; U < R; U++) + B[U].index in k && G.push(k[B[U].index]); + return G; + }, L = function(B) { + let G = []; + return G[0] = [B[0][0], B[0][1], B[0][2]], G[1] = [B[1][0], B[1][1], B[1][2]], G; + }, I = function(B) { + if (l.volume(B) < l.maxVolume) + return [B]; + var G = B[1][0] - B[0][0], U = B[1][1] - B[0][1], R = B[1][2] - B[0][2], W; + G > U && G > R ? W = 0 : U > G && U > R ? W = 1 : W = 2; + var H = L(B), N = L(B), V = (B[1][W] - B[0][W]) / 2 + B[0][W]; + H[1][W] = V, N[0][W] = V; + var J = I(H), re = I(N); + return J.concat(re); + }, F = I(c), P = 6; + for (let B = 0, G = F.length; B < G; B++) { + let U = L(F[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 R = l.getAtomsWithin(v, U), W = l.getAtomsWithin(E, F[B]); w.push({ - extent: F[P], - atoms: $(B), + extent: F[B], + atoms: $(R), toshow: $(W) }); } @@ -25038,36 +25060,36 @@ ATOM`, b); * mat * @return {Mesh} */ - static generateSurfaceMesh(c, _, E) { + static generateSurfaceMesh(c, v, E) { var w = new r.Geometry(!0), k = w.updateGeoGroup(0), $ = []; - for (let pe = 0, le = c.length; pe < le; pe++) { + for (let pe = 0, se = c.length; pe < se; pe++) { var L = c[pe]; L && (typeof L.surfaceColor < "u" ? $[pe] = L.surfaceColor : L.color && ($[pe] = s.CC.color(L.color))); } - var z = k.vertexArray, F = _.vertices; - for (let pe = 0, le = F.length; pe < le; pe++) { - let ne = k.vertices * 3; - z[ne] = F[pe].x, z[ne + 1] = F[pe].y, z[ne + 2] = F[pe].z, k.vertices++; + var I = k.vertexArray, F = v.vertices; + for (let pe = 0, se = F.length; pe < se; pe++) { + let Q = k.vertices * 3; + I[Q] = F[pe].x, I[Q + 1] = F[pe].y, I[Q + 2] = F[pe].z, k.vertices++; } - var R = k.colorArray; - let P = k.atomArray; + var P = k.colorArray; + let B = k.atomArray; if (E.voldata && E.volscheme) { - var U = E.volscheme, N = E.voldata, B = U.range() || [-1, 1]; - for (let pe = 0, le = F.length; pe < le; pe++) { - let ne = F[pe].atomid, Te = N.getVal(F[pe].x, F[pe].y, F[pe].z), Oe = s.CC.color(U.valueToHex(Te, B)), Be = pe * 3; - R[Be] = Oe.r, R[Be + 1] = Oe.g, R[Be + 2] = Oe.b, P[pe] = c[ne]; + var G = E.volscheme, U = E.voldata, R = G.range() || [-1, 1]; + for (let pe = 0, se = F.length; pe < se; pe++) { + let Q = F[pe].atomid, ye = U.getVal(F[pe].x, F[pe].y, F[pe].z), ke = s.CC.color(G.valueToHex(ye, R)), Pe = pe * 3; + P[Pe] = ke.r, P[Pe + 1] = ke.g, P[Pe + 2] = ke.b, B[pe] = c[Q]; } } else if ($.length > 0) - for (let pe = 0, le = F.length; pe < le; pe++) { - let ne = F[pe].atomid, Te = pe * 3; - R[Te] = $[ne].r, R[Te + 1] = $[ne].g, R[Te + 2] = $[ne].b, P[pe] = c[ne]; + for (let pe = 0, se = F.length; pe < se; pe++) { + let Q = F[pe].atomid, ye = pe * 3; + P[ye] = $[Q].r, P[ye + 1] = $[Q].g, P[ye + 2] = $[Q].b, B[pe] = c[Q]; } - var W = _.faces; + var W = v.faces; k.faceidx = W.length, w.initTypedArrays(); - var V = k.vertexArray, G = k.normalArray, H, Q, te, ee; - for (let pe = 0, le = W.length; pe < le; pe += 3) { - var ce = W[pe], fe = W[pe + 1], oe = W[pe + 2], he = ce * 3, Ae = fe * 3, Se = oe * 3; - H = new a.Vector3(V[he], V[he + 1], V[he + 2]), Q = new a.Vector3(V[Ae], V[Ae + 1], V[Ae + 2]), te = new a.Vector3(V[Se], V[Se + 1], V[Se + 2]), te.subVectors(te, Q), H.subVectors(H, Q), te.cross(H), ee = te, ee.normalize(), G[he] += ee.x, G[Ae] += ee.x, G[Se] += ee.x, G[he + 1] += ee.y, G[Ae + 1] += ee.y, G[Se + 1] += ee.y, G[he + 2] += ee.z, G[Ae + 2] += ee.z, G[Se + 2] += ee.z; + var H = k.vertexArray, N = k.normalArray, V, J, re, te; + for (let pe = 0, se = W.length; pe < se; pe += 3) { + var ue = W[pe], ie = W[pe + 1], ae = W[pe + 2], ce = ue * 3, Me = ie * 3, Ae = ae * 3; + V = new a.Vector3(H[ce], H[ce + 1], H[ce + 2]), J = new a.Vector3(H[Me], H[Me + 1], H[Me + 2]), re = new a.Vector3(H[Ae], H[Ae + 1], H[Ae + 2]), re.subVectors(re, J), V.subVectors(V, J), re.cross(V), te = re, te.normalize(), N[ce] += te.x, N[Me] += te.x, N[Ae] += te.x, N[ce + 1] += te.y, N[Me + 1] += te.y, N[Ae + 1] += te.y, N[ce + 2] += te.z, N[Me + 2] += te.z, N[Ae + 2] += te.z; } k.faceArray = new Uint16Array(W); var Ie = new r.Mesh(w, E); @@ -25089,9 +25111,9 @@ ATOM`, b); * vol * @return {Object} */ - static generateMeshSyncHelper(c, _, E, w, k, $) { + static generateMeshSyncHelper(c, v, E, w, k, $) { var L = new A.ProteinSurface(); - return L.initparm(_, c !== 1, $), L.fillvoxels(k, E), L.buildboundary(), (c == A.SurfaceType.SES || c == A.SurfaceType.MS) && (L.fastdistancemap(), L.boundingatom(!1), L.fillvoxelswaals(k, E)), L.marchingcube(c), L.getFacesAndVertices(w); + return L.initparm(v, c !== 1, $), L.fillvoxels(k, E), L.buildboundary(), (c == A.SurfaceType.SES || c == A.SurfaceType.MS) && (L.fastdistancemap(), L.boundingatom(!1), L.fillvoxelswaals(k, E)), L.marchingcube(c), L.getFacesAndVertices(w); } /* * @@ -25100,11 +25122,11 @@ ATOM`, b); * @return {MeshLambertMaterial} */ static getMatWithStyle(c) { - let _ = null; - c.onesided ? _ = new r.MeshLambertMaterial() : _ = new r.MeshDoubleLambertMaterial(), _.vertexColors = r.Coloring.VertexColors; + let v = null; + c.onesided ? v = new r.MeshLambertMaterial() : v = new r.MeshDoubleLambertMaterial(), v.vertexColors = r.Coloring.VertexColors; for (var E in c) - E === "color" || E === "map" || c.hasOwnProperty(E) && (_[E] = c[E]); - return c.opacity !== void 0 && (c.opacity === 1 ? _.transparent = !1 : _.transparent = !0), _; + E === "color" || E === "map" || c.hasOwnProperty(E) && (v[E] = c[E]); + return c.opacity !== void 0 && (c.opacity === 1 ? v.transparent = !1 : v.transparent = !0), v; } /** * Adds an explicit mesh as a surface object. @@ -25115,24 +25137,24 @@ ATOM`, b); * @returns {number} surfid */ addMesh(c) { - var _ = { + var v = { geo: c.geometry, mat: c.material, done: !0, finished: !1 //the rendered finishes surfaces when they are done }, E = this.nextSurfID(); - return this.surfaces[E] = [_], E; + return this.surfaces[E] = [v], E; } //return a shallow copy of list l, e.g., for atoms so we can //ignore superficial changes (ie surfacecolor, position) that happen //while we're surface building static shallowCopy(c) { - var _ = []; + var v = []; let E = c.length; for (let w = 0; w < E; w++) - _[w] = (0, h.extend)({}, c[w]); - return _; + v[w] = (0, h.extend)({}, c[w]); + return v; } /** * Add surface representation to atoms @@ -25144,151 +25166,151 @@ ATOM`, b); * @param {function} surfacecallback - function to be called after setting the surface * @return {Promise} promise - Returns a promise that ultimately resovles to the surfid. Returns surfid immediately if surfacecallback is specified. Returned promise has a [surfid, GLViewer, style, atomsel, allsel, focus] fields for immediate access. */ - addSurface(c, _ = {}, E = {}, w, k, $) { - let L = this.nextSurfID(), z = null, F = this, R = A.SurfaceType.VDW; - typeof c == "string" ? l.surfaceTypeMap[c.toUpperCase()] !== void 0 ? R = l.surfaceTypeMap[c] : console.log("Surface type : " + c + " is not recognized") : typeof c == "number" && (R = c); - var P = null, U = null, N = l.shallowCopy(this.getAtomsFromSel(E)); - w ? P = l.shallowCopy(this.getAtomsFromSel(w)) : P = N, (0, h.adjustVolumeStyle)(_); - var B = !1, W; + addSurface(c, v = {}, E = {}, w, k, $) { + let L = this.nextSurfID(), I = null, F = this, P = A.SurfaceType.VDW; + typeof c == "string" ? l.surfaceTypeMap[c.toUpperCase()] !== void 0 ? P = l.surfaceTypeMap[c] : console.log("Surface type : " + c + " is not recognized") : typeof c == "number" && (P = c); + var B = null, G = null, U = l.shallowCopy(this.getAtomsFromSel(E)); + w ? B = l.shallowCopy(this.getAtomsFromSel(w)) : B = U, (0, h.adjustVolumeStyle)(v); + var R = !1, W; for (W = 0; W < this.models.length; W++) if (this.models[W]) { - var V = this.models[W].getSymmetries(); - if (V.length > 1 || V.length == 1 && !V[0].isIdentity()) { - B = !0; + var H = this.models[W].getSymmetries(); + if (H.length > 1 || H.length == 1 && !H[0].isIdentity()) { + R = !0; break; } } - var G = function(oe, he, Ae) { - k ? U = l.shallowCopy(F.getAtomsFromSel(k)) : U = Ae; - var Se, Ie = (0, h.getExtent)(Ae, !0); - if (_.map && _.map.prop) { - var pe = _.map.prop; - let De = (0, o.getGradient)(_.map.scheme || _.map.gradient || new o.Gradient.RWB()), je = De.range(); - je || (je = (0, h.getPropertyRange)(Ae, pe)), _.colorscheme = { prop: pe, gradient: De }; + var N = function(ae, ce, Me) { + k ? G = l.shallowCopy(F.getAtomsFromSel(k)) : G = Me; + var Ae, Ie = (0, h.getExtent)(Me, !0); + if (v.map && v.map.prop) { + var pe = v.map.prop; + let Ce = (0, o.getGradient)(v.map.scheme || v.map.gradient || new o.Gradient.RWB()), je = Ce.range(); + je || (je = (0, h.getPropertyRange)(Me, pe)), v.colorscheme = { prop: pe, gradient: Ce }; } - for (let De = 0, je = he.length; De < je; De++) - Se = he[De], Se.surfaceColor = (0, h.getColorFromStyle)(Se, _); - var le = l.volume(Ie), ne = F.carveUpExtent(Ie, he, Ae); - if (U && U.length && U.length > 0) { - var Te = (0, h.getExtent)(U, !0), Oe = function(De, je) { - var Xe = function(re, ye) { - var me = re.extent, ze = me[1][0] - me[0][0], ke = me[1][1] - me[0][1], K = me[1][2] - me[0][2], ae = ze - ye[2][0]; - ae *= ae; - var ge = ke - ye[2][1]; + for (let Ce = 0, je = ce.length; Ce < je; Ce++) + Ae = ce[Ce], Ae.surfaceColor = (0, h.getColorFromStyle)(Ae, v); + var se = l.volume(Ie), Q = F.carveUpExtent(Ie, ce, Me); + if (G && G.length && G.length > 0) { + var ye = (0, h.getExtent)(G, !0), ke = function(Ce, je) { + var Xe = function(ne, xe) { + var me = ne.extent, ze = me[1][0] - me[0][0], $e = me[1][1] - me[0][1], K = me[1][2] - me[0][2], oe = ze - xe[2][0]; + oe *= oe; + var ge = $e - xe[2][1]; ge *= ge; - var xe = K - ye[2][2]; - return xe *= xe, ae + ge + xe; - }, X = Xe(De, Te), q = Xe(je, Te); + var we = K - xe[2][2]; + return we *= we, oe + ge + we; + }, X = Xe(Ce, ye), q = Xe(je, ye); return X - q; }; - ne.sort(Oe); + Q.sort(ke); } - var Be = []; - for (let De = 0, je = he.length; De < je; De++) - Se = he[De], Be[De] = { - x: Se.x, - y: Se.y, - z: Se.z, - serial: De, - elem: Se.elem + var Pe = []; + for (let Ce = 0, je = ce.length; Ce < je; Ce++) + Ae = ce[Ce], Pe[Ce] = { + x: Ae.x, + y: Ae.y, + z: Ae.z, + serial: Ce, + elem: Ae.elem }; - var Ue = !!A.syncSurface; - if (Ue) { - var Pe = function(je) { + var Ne = !!A.syncSurface; + if (Ne) { + var Be = function(je) { return new Promise(function(Xe) { - for (var X = l.generateMeshSyncHelper(R, ne[je].extent, ne[je].atoms, ne[je].toshow, Be, le), q = (0, f.splitMesh)({ vertexArr: X.vertices, faceArr: X.faces }), re = 0, ye = q.length; re < ye; re++) { + for (var X = l.generateMeshSyncHelper(P, Q[je].extent, Q[je].atoms, Q[je].toshow, Pe, se), q = (0, f.splitMesh)({ vertexArr: X.vertices, faceArr: X.faces }), ne = 0, xe = q.length; ne < xe; ne++) { X = { - vertices: q[re].vertexArr, - faces: q[re].faceArr + vertices: q[ne].vertexArr, + faces: q[ne].faceArr }; - var me = l.generateSurfaceMesh(he, X, z); - (0, h.mergeGeos)(oe.geo, me); + var me = l.generateSurfaceMesh(ce, X, I); + (0, h.mergeGeos)(ae.geo, me); } F.render(), Xe(); }); }, Ge = []; - for (let De = 0; De < ne.length; De++) - Ge.push(Pe(De)); + for (let Ce = 0; Ce < Q.length; Ce++) + Ge.push(Be(Ce)); return Promise.all(Ge).then(function() { - return oe.done = !0, Promise.resolve(L); + return ae.done = !0, Promise.resolve(L); }); } else { - var Ne = []; - R < 0 && (R = 0); - for (let De = 0, je = l.numWorkers; De < je; De++) { + var Ue = []; + P < 0 && (P = 0); + for (let Ce = 0, je = l.numWorkers; Ce < je; Ce++) { var Re = new Worker($3Dmol.SurfaceWorker); - Ne.push(Re), Re.postMessage({ + Ue.push(Re), Re.postMessage({ type: -1, - atoms: Be, - volume: le + atoms: Pe, + volume: se }); } - return new Promise(function(De, je) { + return new Promise(function(Ce, je) { var Xe = 0, X = function() { - !Ne || !Ne.length || Ne.forEach(function(me) { + !Ue || !Ue.length || Ue.forEach(function(me) { me && me.terminate && me.terminate(); }); }, q = function(me) { for (var ze = (0, f.splitMesh)({ vertexArr: me.data.vertices, faceArr: me.data.faces - }), ke = 0, K = ze.length; ke < K; ke++) { - var ae = { - vertices: ze[ke].vertexArr, - faces: ze[ke].faceArr - }, ge = l.generateSurfaceMesh(he, ae, z); - (0, h.mergeGeos)(oe.geo, ge); + }), $e = 0, K = ze.length; $e < K; $e++) { + var oe = { + vertices: ze[$e].vertexArr, + faces: ze[$e].faceArr + }, ge = l.generateSurfaceMesh(ce, oe, I); + (0, h.mergeGeos)(ae.geo, ge); } - F.render(), Xe++, Xe == ne.length && (oe.done = !0, X(), De(L)); - }, re = function(me) { + F.render(), Xe++, Xe == Q.length && (ae.done = !0, X(), Ce(L)); + }, ne = function(me) { X(), console.log(me.message + " (" + me.filename + ":" + me.lineno + ")"), je(me); }; - for (let me = 0; me < ne.length; me++) { - var ye = Ne[me % Ne.length]; - ye.onmessage = q, ye.onerror = re, ye.postMessage({ - type: R, - expandedExtent: ne[me].extent, - extendedAtoms: ne[me].atoms, - atomsToShow: ne[me].toshow + for (let me = 0; me < Q.length; me++) { + var xe = Ue[me % Ue.length]; + xe.onmessage = q, xe.onerror = ne, xe.postMessage({ + type: P, + expandedExtent: Q[me].extent, + extendedAtoms: Q[me].atoms, + atomsToShow: Q[me].toshow }); } }); } }; - _ = _ || {}, z = l.getMatWithStyle(_); - var H = []; - H.style = _, H.atomsel = E, H.allsel = w, H.focus = k; - var Q = null; - if (B) { - var te = {}, ee = {}; + v = v || {}, I = l.getMatWithStyle(v); + var V = []; + V.style = v, V.atomsel = E, V.allsel = w, V.focus = k; + var J = null; + if (R) { + var re = {}, te = {}; for (W = 0; W < this.models.length; W++) - te[W] = [], ee[W] = []; - for (W = 0; W < P.length; W++) - te[P[W].model].push(P[W]); - for (W = 0; W < N.length; W++) - ee[N[W].model].push(N[W]); - var ce = []; + re[W] = [], te[W] = []; + for (W = 0; W < B.length; W++) + re[B[W].model].push(B[W]); + for (W = 0; W < U.length; W++) + te[U[W].model].push(U[W]); + var ue = []; for (W = 0; W < this.models.length; W++) - ee[W].length > 0 && (H.push({ + te[W].length > 0 && (V.push({ geo: new r.Geometry(!0), - mat: z, + mat: I, done: !1, finished: !1, symmetries: this.models[W].getSymmetries() // also webgl initialized - }), ce.push(G(H[H.length - 1], te[W], ee[W]))); - Q = Promise.all(ce); + }), ue.push(N(V[V.length - 1], re[W], te[W]))); + J = Promise.all(ue); } else - H.push({ + V.push({ geo: new r.Geometry(!0), - mat: z, + mat: I, done: !1, finished: !1, symmetries: [new a.Matrix4()] - }), Q = G(H[H.length - 1], P, N); - return this.surfaces[L] = H, Q.surfid = L, $ && typeof $ == "function" ? (Q.then(function(fe) { - $(fe); - }), L) : Q; + }), J = N(V[V.length - 1], B, U); + return this.surfaces[L] = V, J.surfid = L, $ && typeof $ == "function" ? (J.then(function(ie) { + $(ie); + }), L) : J; } /** * Set the surface material to something else, must render change @@ -25305,27 +25327,27 @@ ATOM`, b); }); }); */ - setSurfaceMaterialStyle(c, _) { - if ((0, h.adjustVolumeStyle)(_), this.surfaces[c]) { + setSurfaceMaterialStyle(c, v) { + if ((0, h.adjustVolumeStyle)(v), this.surfaces[c]) { var E = this.surfaces[c]; for (let k = 0; k < E.length; k++) { - var w = E[k].mat = l.getMatWithStyle(_); - if (E[k].mat.side = r.FrontSide, _.color) { - E[k].mat.color = s.CC.color(_.color), E[k].geo.colorsNeedUpdate = !0; - const $ = s.CC.color(_.color); + var w = E[k].mat = l.getMatWithStyle(v); + if (E[k].mat.side = r.FrontSide, v.color) { + E[k].mat.color = s.CC.color(v.color), E[k].geo.colorsNeedUpdate = !0; + const $ = s.CC.color(v.color); E[k].geo.setColor($); } else if (w.voldata && w.volscheme) { - const $ = w.volscheme, L = w.voldata, z = s.CC, F = $.range() || [-1, 1]; - E[k].geo.setColors(function(R, P, U) { - let N = L.getVal(R, P, U); - return z.color($.valueToHex(N, F)); + const $ = w.volscheme, L = w.voldata, I = s.CC, F = $.range() || [-1, 1]; + E[k].geo.setColors(function(P, B, G) { + let U = L.getVal(P, B, G); + return I.color($.valueToHex(U, F)); }); } else { E[k].geo.colorsNeedUpdate = !0; for (let $ of E[k].geo.geometryGroups) for (let L = 0; L < $.vertices; L++) { - let z = (0, h.getColorFromStyle)($.atomArray[L], _), F = 3 * L; - $.colorArray[F] = z.r, $.colorArray[F + 1] = z.g, $.colorArray[F + 2] = z.b; + let I = (0, h.getColorFromStyle)($.atomArray[L], v), F = 3 * L; + $.colorArray[F] = I.r, $.colorArray[F + 1] = I.g, $.colorArray[F + 2] = I.b; } } E[k].finished = !1; @@ -25345,8 +25367,8 @@ ATOM`, b); * @param {number} surf - surface id */ removeSurface(c) { - for (var _ = this.surfaces[c], E = 0; E < _.length; E++) - _[E] && _[E].lastGL && (_[E].geo !== void 0 && _[E].geo.dispose(), _[E].mat !== void 0 && _[E].mat.dispose(), this.modelGroup.remove(_[E].lastGL)); + for (var v = this.surfaces[c], E = 0; E < v.length; E++) + v[E] && v[E].lastGL && (v[E].geo !== void 0 && v[E].geo.dispose(), v[E].mat !== void 0 && v[E].mat.dispose(), this.modelGroup.remove(v[E].lastGL)); return delete this.surfaces[c], this.show(), this; } /** Remove all surfaces. @@ -25354,16 +25376,16 @@ ATOM`, b); removeAllSurfaces() { for (var c in this.surfaces) if (this.surfaces.hasOwnProperty(c)) { - for (var _ = this.surfaces[c], E = 0; E < _.length; E++) - _[E] && _[E].lastGL && (_[E].geo !== void 0 && _[E].geo.dispose(), _[E].mat !== void 0 && _[E].mat.dispose(), this.modelGroup.remove(_[E].lastGL)); + for (var v = this.surfaces[c], E = 0; E < v.length; E++) + v[E] && v[E].lastGL && (v[E].geo !== void 0 && v[E].geo.dispose(), v[E].mat !== void 0 && v[E].mat.dispose(), this.modelGroup.remove(v[E].lastGL)); delete this.surfaces[c]; } return this.show(), this; } /** return Jmol moveto command to position this scene */ jmolMoveTo() { - var c = this.modelGroup.position, _ = "center { " + -c.x + " " + -c.y + " " + -c.z + " }; ", E = this.rotationGroup.quaternion; - return _ += "moveto .5 quaternion { " + E.x + " " + E.y + " " + E.z + " " + E.w + " };", _; + var c = this.modelGroup.position, v = "center { " + -c.x + " " + -c.y + " " + -c.z + " }; ", E = this.rotationGroup.quaternion; + return v += "moveto .5 quaternion { " + E.x + " " + E.y + " " + E.z + " " + E.w + " };", v; } /** Clear scene of all objects * */ @@ -25390,22 +25412,22 @@ ATOM`, b); viewer.render(); }); */ - mapAtomProperties(c, _) { - _ = _ || {}; - var E = this.getAtomsFromSel(_); + mapAtomProperties(c, v) { + v = v || {}; + var E = this.getAtomsFromSel(v); if (typeof c == "function") for (let $ = 0, L = E.length; $ < L; $++) { - let z = E[$]; - c(z); + let I = E[$]; + c(I); } else for (let $ = 0, L = E.length; $ < L; $++) { var w = E[$]; - for (let z = 0, F = c.length; z < F; z++) { - let R = c[z]; - if (R.props) - for (var k in R.props) - R.props.hasOwnProperty(k) && this.atomIsSelected(w, R) && (w.properties || (w.properties = {}), w.properties[k] = R.props[k]); + for (let I = 0, F = c.length; I < F; I++) { + let P = c[I]; + if (P.props) + for (var k in P.props) + P.props.hasOwnProperty(k) && this.atomIsSelected(w, P) && (w.properties || (w.properties = {}), w.properties[k] = P.props[k]); } } return this; @@ -25437,9 +25459,9 @@ ATOM`, b); * Used for setting an approx value of eyeSeparation. Created for calling by StereoViewer object * @return {number} camera x position */ - setAutoEyeSeparation(c, _) { + setAutoEyeSeparation(c, v) { var E = this.getPerceivedDistance(); - return _ || (_ = 5), c || this.camera.position.x > 0 ? this.camera.position.x = E * Math.tan(Math.PI / 180 * _) : this.camera.position.x = -E * Math.tan(Math.PI / 180 * _), this.camera.lookAt(new a.Vector3(0, 0, this.rotationGroup.position.z)), this.camera.position.x; + return v || (v = 5), c || this.camera.position.x > 0 ? this.camera.position.x = E * Math.tan(Math.PI / 180 * v) : this.camera.position.x = -E * Math.tan(Math.PI / 180 * v), this.camera.lookAt(new a.Vector3(0, 0, this.rotationGroup.position.z)), this.camera.position.x; } /** * Set the default cartoon quality for newly created models. Default is 5. @@ -25460,23 +25482,23 @@ ATOM`, b); if (b = (0, h.getElement)(b), !!b) { c = c || {}; try { - var _ = new l(b, c); - return _; + var v = new l(b, c); + return v; } catch (E) { throw "error creating viewer: " + E; } } } - function p(b, c = {}, _ = {}) { + function p(b, c = {}, v = {}) { if (b = (0, h.getElement)(b), !!b) { var E = [], w = document.createElement("canvas"); - _.rows = c.rows, _.cols = c.cols, _.control_all = c.control_all != null ? c.control_all : !1, b.appendChild(w); + v.rows = c.rows, v.cols = c.cols, v.control_all = c.control_all != null ? c.control_all : !1, b.appendChild(w); try { for (var k = 0; k < c.rows; k++) { for (var $ = [], L = 0; L < c.cols; L++) { - _.row = k, _.col = L, _.canvas = w, _.viewers = E, _.control_all = c.control_all; - var z = u(b, (0, h.extend)({}, _)); - $.push(z); + v.row = k, v.col = L, v.canvas = w, v.viewers = E, v.control_all = c.control_all; + var I = u(b, (0, h.extend)({}, v)); + $.push(I); } E.unshift($); } @@ -25489,8 +25511,8 @@ ATOM`, b); function g(b) { var c = this; if (b = (0, h.getElement)(b), !!b) { - var _ = p(b, { rows: 1, cols: 2, control_all: !0 }); - this.glviewer1 = _[0][0], this.glviewer2 = _[0][1], this.glviewer1.setAutoEyeSeparation(!1), this.glviewer2.setAutoEyeSeparation(!0), this.glviewer1.linkViewer(this.glviewer2), this.glviewer2.linkViewer(this.glviewer1); + var v = p(b, { rows: 1, cols: 2, control_all: !0 }); + this.glviewer1 = v[0][0], this.glviewer2 = v[0][1], this.glviewer1.setAutoEyeSeparation(!1), this.glviewer2.setAutoEyeSeparation(!0), this.glviewer1.linkViewer(this.glviewer2), this.glviewer2.linkViewer(this.glviewer1); for (var E = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function(k) { return typeof c.glviewer1[k] == "function"; }), w = 0; w < E.length; w++) @@ -25501,8 +25523,8 @@ ATOM`, b); }; }(E[w]); this.setCoordinates = function(k, $, L) { - for (var z = 0; z < k.length; z++) - k[z].setCoordinates($, L); + for (var I = 0; I < k.length; I++) + k[I].setCoordinates($, L); }, this.surfacesFinished = function() { return this.glviewer1.surfacesFinished() && this.glviewer2.surfacesFinished(); }, this.isAnimated = function() { @@ -25552,7 +25574,7 @@ ATOM`, b); /* harmony export */ Sinebow: () => ( /* binding */ - v + _ ), /* harmony export */ builtinGradients: () => ( @@ -25626,15 +25648,15 @@ ATOM`, b); return 16777215; var p = s(l, u, M); l = p.lo, u = p.hi, M = p.val; - var g = (l + u) / 2, b = (l + g) / 2, c = (g + u) / 2, _, E; - return M < b ? (_ = Math.floor(255 * Math.sqrt((M - l) / (b - l))), E = 16711680 + 256 * _ + 0, E) : M < g ? (_ = Math.floor(255 * Math.sqrt(1 - (M - b) / (g - b))), E = 65536 * _ + 65280 + 0, E) : M < c ? (_ = Math.floor(255 * Math.sqrt((M - g) / (c - g))), E = 65280 + 1 * _, E) : (_ = Math.floor(255 * Math.sqrt(1 - (M - c) / (u - c))), E = 0 + 256 * _ + 255, E); + var g = (l + u) / 2, b = (l + g) / 2, c = (g + u) / 2, v, E; + return M < b ? (v = Math.floor(255 * Math.sqrt((M - l) / (b - l))), E = 16711680 + 256 * v + 0, E) : M < g ? (v = Math.floor(255 * Math.sqrt(1 - (M - b) / (g - b))), E = 65536 * v + 65280 + 0, E) : M < c ? (v = Math.floor(255 * Math.sqrt((M - g) / (c - g))), E = 65280 + 1 * v, E) : (v = Math.floor(255 * Math.sqrt(1 - (M - c) / (u - c))), E = 0 + 256 * v + 255, E); } //return range used for color mapping, null if none set range() { return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } } - class v extends a { + class _ extends a { constructor(M, m) { super(), this.gradient = "Sinebow", this.mult = 1, this.min = M, this.max = m, typeof m > "u" && Array.isArray(M) && M.length >= 2 && (this.max = M[1], this.min = M[0]), m < M && (this.mult = -1, this.min *= -1, this.max *= -1); } @@ -25647,10 +25669,10 @@ ATOM`, b); l = p.lo, u = p.hi, M = p.val; var g = (M - l) / (u - l), b = 5 * g / 6 + 0.5, c = Math.sin(Math.PI * b); c *= c * 255; - var _ = Math.sin(Math.PI * (b + 1 / 3)); - _ *= _ * 255; + var v = Math.sin(Math.PI * (b + 1 / 3)); + v *= v * 255; var E = Math.sin(Math.PI * (b + 2 / 3)); - return E *= E * 255, 65536 * Math.floor(c) + 256 * Math.floor(E) + 1 * Math.floor(_); + return E *= E * 255, 65536 * Math.floor(c) + 256 * Math.floor(E) + 1 * Math.floor(v); } //return range used for color mapping, null if none set range() { @@ -25678,7 +25700,7 @@ ATOM`, b); return 16777215; var p = s(l, u, M); l = p.lo, u = p.hi, M = p.val; - let g = this.colors.length, b = (u - l) / g, c = Math.min(Math.floor((M - l) / b), g - 1), _ = Math.min(c + 1, g - 1), E = (M - l - c * b) / b, w = this.colors[c], k = this.colors[_]; + let g = this.colors.length, b = (u - l) / g, c = Math.min(Math.floor((M - l) / b), g - 1), v = Math.min(c + 1, g - 1), E = (M - l - c * b) / b, w = this.colors[c], k = this.colors[v]; return new r.Color(w.r + E * (k.r - w.r), w.g + E * (k.g - w.g), w.b + E * (k.b - w.b)).getHex(); } } @@ -25687,7 +25709,7 @@ ATOM`, b); RWB: o, roygb: d, ROYGB: d, - sinebow: v, + sinebow: _, linear: f }; class A extends a { @@ -25698,7 +25720,7 @@ ATOM`, b); return null; } } - A.RWB = o, A.ROYGB = d, A.Sinebow = v, A.CustomLinear = f, A.builtinGradients = y, A.normalizeValue = s, A.getGradient = h; + A.RWB = o, A.ROYGB = d, A.Sinebow = _, A.CustomLinear = f, A.builtinGradients = y, A.normalizeValue = s, A.getGradient = h; } ), /***/ @@ -25712,7 +25734,7 @@ ATOM`, b); /* harmony export */ Label: () => ( /* binding */ - v + _ ), /* harmony export */ LabelCount: () => ( @@ -25739,7 +25761,7 @@ ATOM`, b); var x = A; return typeof f < "u" && (f instanceof s.Color ? x = f.scaled() : (x = s.CC.color(f), typeof x.scaled < "u" && (x = x.scaled()))), typeof y < "u" && (x.a = parseFloat(y)), x; } - class v { + class _ { constructor(y, A) { this.id = h++, this.stylespec = A || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new r.Sprite(), this.text = y, this.frame = this.stylespec.frame; } @@ -25771,36 +25793,36 @@ ATOM`, b); x: -10, y: 1, z: 1 - }, _ = y.inFront !== void 0 ? y.inFront : !0; - (_ === "false" || _ === "0") && (_ = !1); + }, v = y.inFront !== void 0 ? y.inFront : !0; + (v === "false" || v === "0") && (v = !1); var E = y.alignment || r.SpriteAlignment.topLeft; typeof E == "string" && E in r.SpriteAlignment && (E = r.SpriteAlignment[E]); var w = ""; y.bold && (w = "bold "), this.context.font = w + m + "px " + M; var k = this.context.measureText(this.text), $ = k.width; x || (p = 0); - var L = $ + 2.5 * p + 2 * u, z = m * 1.25 + 2 * p + 2 * u; + var L = $ + 2.5 * p + 2 * u, I = m * 1.25 + 2 * p + 2 * u; if (y.backgroundImage) { - var F = y.backgroundImage, R = y.backgroundWidth ? y.backgroundWidth : F.width, P = y.backgroundHeight ? y.backgroundHeight : F.height; - R > L && (L = R), P > z && (z = P); - } - if (this.canvas.width = L, this.canvas.height = z, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), w = "", y.bold && (w = "bold "), this.context.font = w + m + "px " + M, this.context.fillStyle = "rgba(" + g.r + "," + g.g + "," + g.b + "," + g.a + ")", this.context.strokeStyle = "rgba(" + b.r + "," + b.g + "," + b.b + "," + b.a + ")", y.backgroundGradient) { - let N = this.context.createLinearGradient(0, z / 2, L, z / 2), B = a.Gradient.getGradient(y.backgroundGradient), W = B.range(), V = -1, G = 1; - W && (V = W[0], G = W[1]); - let H = G - V; - for (let Q = 0; Q < 1.01; Q += 0.1) { - let te = d(B.valueToHex(V + H * Q)), ee = "rgba(" + te.r + "," + te.g + "," + te.b + "," + te.a + ")"; - N.addColorStop(Q, ee); + var F = y.backgroundImage, P = y.backgroundWidth ? y.backgroundWidth : F.width, B = y.backgroundHeight ? y.backgroundHeight : F.height; + P > L && (L = P), B > I && (I = B); + } + if (this.canvas.width = L, this.canvas.height = I, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), w = "", y.bold && (w = "bold "), this.context.font = w + m + "px " + M, this.context.fillStyle = "rgba(" + g.r + "," + g.g + "," + g.b + "," + g.a + ")", this.context.strokeStyle = "rgba(" + b.r + "," + b.g + "," + b.b + "," + b.a + ")", y.backgroundGradient) { + let U = this.context.createLinearGradient(0, I / 2, L, I / 2), R = a.Gradient.getGradient(y.backgroundGradient), W = R.range(), H = -1, N = 1; + W && (H = W[0], N = W[1]); + let V = N - H; + for (let J = 0; J < 1.01; J += 0.1) { + let re = d(R.valueToHex(H + V * J)), te = "rgba(" + re.r + "," + re.g + "," + re.b + "," + re.a + ")"; + U.addColorStop(J, te); } - this.context.fillStyle = N; + this.context.fillStyle = U; } - this.context.lineWidth = p, x && o(this.context, p, p, L - 2 * p, z - 2 * p, 6, p > 0), y.backgroundImage && this.context.drawImage(F, 0, 0, L, z), this.context.fillStyle = "rgba(" + l.r + "," + l.g + "," + l.b + "," + l.a + ")", this.context.fillText(this.text, p + u, m + p + u, $); - var U = new r.Texture(this.canvas); - U.needsUpdate = !0, this.sprite.material = new r.SpriteMaterial({ - map: U, + this.context.lineWidth = p, x && o(this.context, p, p, L - 2 * p, I - 2 * p, 6, p > 0), y.backgroundImage && this.context.drawImage(F, 0, 0, L, I), this.context.fillStyle = "rgba(" + l.r + "," + l.g + "," + l.b + "," + l.a + ")", this.context.fillText(this.text, p + u, m + p + u, $); + var G = new r.Texture(this.canvas); + G.needsUpdate = !0, this.sprite.material = new r.SpriteMaterial({ + map: G, useScreenCoordinates: A, alignment: E, - depthTest: !_, + depthTest: !v, screenOffset: y.screenOffset || null }), this.sprite.scale.set(1, 1, 1), this.sprite.position.set(c.x, c.y, c.z); } @@ -25832,7 +25854,7 @@ ATOM`, b); /* harmony export */ PointGrid: () => ( /* binding */ - v + _ ), /* harmony export */ ProteinSurface: () => ( @@ -26901,39 +26923,39 @@ ATOM`, b); ]; } march(A, x, M, m) { - let l = !!m.fulltable, u = m.hasOwnProperty("origin") && m.origin.hasOwnProperty("x") ? m.origin : { x: 0, y: 0, z: 0 }, p = !!m.voxel, g = m.matrix, b = m.nX || 0, c = m.nY || 0, _ = m.nZ || 0, E = m.scale || 1, w = null; + let l = !!m.fulltable, u = m.hasOwnProperty("origin") && m.origin.hasOwnProperty("x") ? m.origin : { x: 0, y: 0, z: 0 }, p = !!m.voxel, g = m.matrix, b = m.nX || 0, c = m.nY || 0, v = m.nZ || 0, E = m.scale || 1, w = null; m.unitCube ? w = m.unitCube : w = { x: E, y: E, z: E }; - let k = new Int32Array(b * c * _), $, L; + let k = new Int32Array(b * c * v), $, L; for ($ = 0, L = k.length; $ < L; ++$) k[$] = -1; - let z = function(U, N, B, W, V, G) { - let H = { x: 0, y: 0, z: 0 }, Q = !!(W & 1 << V), te = !!(W & 1 << G), ee = V; - if (!Q && te && (ee = G), ee & 1 && B++, ee & 2 && N++, ee & 4 && U++, g) { - let fe = new r.Vector3(U, N, B); - fe = fe.applyMatrix4(g), H = { x: fe.x, y: fe.y, z: fe.z }; + let I = function(G, U, R, W, H, N) { + let V = { x: 0, y: 0, z: 0 }, J = !!(W & 1 << H), re = !!(W & 1 << N), te = H; + if (!J && re && (te = N), te & 1 && R++, te & 2 && U++, te & 4 && G++, g) { + let ie = new r.Vector3(G, U, R); + ie = ie.applyMatrix4(g), V = { x: ie.x, y: ie.y, z: ie.z }; } else - H.x = u.x + w.x * U, H.y = u.y + w.y * N, H.z = u.z + w.z * B; - let ce = (c * U + N) * _ + B; - return p ? (x.push(H), x.length - 1) : (k[ce] < 0 && (k[ce] = x.length, x.push(H)), k[ce]); - }, F = new Int32Array(12), R = l ? this.edgeTable2 : this.edgeTable, P = l ? this.triTable2 : this.triTable; + V.x = u.x + w.x * G, V.y = u.y + w.y * U, V.z = u.z + w.z * R; + let ue = (c * G + U) * v + R; + return p ? (x.push(V), x.length - 1) : (k[ue] < 0 && (k[ue] = x.length, x.push(V)), k[ue]); + }, F = new Int32Array(12), P = l ? this.edgeTable2 : this.edgeTable, B = l ? this.triTable2 : this.triTable; for ($ = 0; $ < b - 1; ++$) - for (let U = 0; U < c - 1; ++U) - for (let N = 0; N < _ - 1; ++N) { - let B = 0; - for (let G = 0; G < 8; ++G) { - let H = (c * ($ + ((G & 4) >> 2)) + U + ((G & 2) >> 1)) * _ + N + (G & 1), Q = !!(A[H] & this.ISDONE); - B |= Q << G; + for (let G = 0; G < c - 1; ++G) + for (let U = 0; U < v - 1; ++U) { + let R = 0; + for (let N = 0; N < 8; ++N) { + let V = (c * ($ + ((N & 4) >> 2)) + G + ((N & 2) >> 1)) * v + U + (N & 1), J = !!(A[V] & this.ISDONE); + R |= J << N; } - if (B === 0 || B === 255) + if (R === 0 || R === 255) continue; - let W = R[B]; + let W = P[R]; if (W === 0) continue; - let V = P[B]; - W & 1 && (F[0] = z($, U, N, B, 0, 1)), W & 2 && (F[1] = z($, U, N, B, 1, 3)), W & 4 && (F[2] = z($, U, N, B, 3, 2)), W & 8 && (F[3] = z($, U, N, B, 2, 0)), W & 16 && (F[4] = z($, U, N, B, 4, 5)), W & 32 && (F[5] = z($, U, N, B, 5, 7)), W & 64 && (F[6] = z($, U, N, B, 7, 6)), W & 128 && (F[7] = z($, U, N, B, 6, 4)), W & 256 && (F[8] = z($, U, N, B, 0, 4)), W & 512 && (F[9] = z($, U, N, B, 1, 5)), W & 1024 && (F[10] = z($, U, N, B, 3, 7)), W & 2048 && (F[11] = z($, U, N, B, 2, 6)); - for (let G = 0; G < V.length; G += 3) { - let H = F[V[G]], Q = F[V[G + 1]], te = F[V[G + 2]]; - p && G >= 3 && (x.push(x[H]), H = x.length - 1, x.push(x[Q]), Q = x.length - 1, x.push(x[te]), te = x.length - 1), M.push(H), M.push(Q), M.push(te); + let H = B[R]; + W & 1 && (F[0] = I($, G, U, R, 0, 1)), W & 2 && (F[1] = I($, G, U, R, 1, 3)), W & 4 && (F[2] = I($, G, U, R, 3, 2)), W & 8 && (F[3] = I($, G, U, R, 2, 0)), W & 16 && (F[4] = I($, G, U, R, 4, 5)), W & 32 && (F[5] = I($, G, U, R, 5, 7)), W & 64 && (F[6] = I($, G, U, R, 7, 6)), W & 128 && (F[7] = I($, G, U, R, 6, 4)), W & 256 && (F[8] = I($, G, U, R, 0, 4)), W & 512 && (F[9] = I($, G, U, R, 1, 5)), W & 1024 && (F[10] = I($, G, U, R, 3, 7)), W & 2048 && (F[11] = I($, G, U, R, 2, 6)); + for (let N = 0; N < H.length; N += 3) { + let V = F[H[N]], J = F[H[N + 1]], re = F[H[N + 2]]; + p && N >= 3 && (x.push(x[V]), V = x.length - 1, x.push(x[J]), J = x.length - 1, x.push(x[re]), re = x.length - 1), M.push(V), M.push(J), M.push(re); } } } @@ -26945,44 +26967,44 @@ ATOM`, b); y: 0, z: 0 }; - let c = new Array(20), _; + let c = new Array(20), v; for (l = 0; l < 20; l++) c[l] = new Array(x.length); for (l = 0, u = x.length; l < u; l++) c[0][l] = 0; for (l = 0, u = M.length / 3; l < u; l++) { let k = l * 3, $ = l * 3 + 1, L = l * 3 + 2; - for (_ = !0, p = 0, g = c[0][M[k]]; p < g; p++) + for (v = !0, p = 0, g = c[0][M[k]]; p < g; p++) if (M[$] == c[p + 1][M[k]]) { - _ = !1; + v = !1; break; } - for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[$]), _ = !0, p = 0, g = c[0][M[k]]; p < g; p++) + for (v && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[$]), v = !0, p = 0, g = c[0][M[k]]; p < g; p++) if (M[L] == c[p + 1][M[k]]) { - _ = !1; + v = !1; break; } - for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[L]), _ = !0, p = 0, g = c[0][M[$]]; p < g; p++) + for (v && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[L]), v = !0, p = 0, g = c[0][M[$]]; p < g; p++) if (M[k] == c[p + 1][M[$]]) { - _ = !1; + v = !1; break; } - for (_ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[k]), _ = !0, p = 0, g = c[0][M[$]]; p < g; p++) + for (v && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[k]), v = !0, p = 0, g = c[0][M[$]]; p < g; p++) if (M[L] == c[p + 1][M[$]]) { - _ = !1; + v = !1; break; } - for (_ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[L]), _ = !0, p = 0; p < c[0][M[L]]; p++) + for (v && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[L]), v = !0, p = 0; p < c[0][M[L]]; p++) if (M[k] == c[p + 1][M[L]]) { - _ = !1; + v = !1; break; } - for (_ && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[k]), _ = !0, p = 0, g = c[0][M[L]]; p < g; p++) + for (v && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[k]), v = !0, p = 0, g = c[0][M[L]]; p < g; p++) if (M[$] == c[p + 1][M[L]]) { - _ = !1; + v = !1; break; } - _ && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[$]); + v && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[$]); } let E = 1, w = 0.5; for (b = 0; b < A; b++) { @@ -27004,7 +27026,7 @@ ATOM`, b); } } let d = new o(); - class v { + class _ { constructor(A, x, M) { this.data = new Int32Array(A * x * M * 3), this.width = x, this.height = M; } @@ -27084,8 +27106,8 @@ ATOM`, b); M[l].x = M[l].x / this.scaleFactor - this.ptranx, M[l].y = M[l].y / this.scaleFactor - this.ptrany, M[l].z = M[l].z / this.scaleFactor - this.ptranz; let m = []; for (let l = 0, u = this.faces.length; l < u; l += 3) { - let p = this.faces[l], g = this.faces[l + 1], b = this.faces[l + 2], c = M[p].atomid, _ = M[g].atomid, E = M[b].atomid, w = c; - _ < w && (w = _), E < w && (w = E), x[w] && p !== g && g !== b && p !== b && (m.push(p), m.push(g), m.push(b)); + let p = this.faces[l], g = this.faces[l + 1], b = this.faces[l + 2], c = M[p].atomid, v = M[g].atomid, E = M[b].atomid, w = c; + v < w && (w = v), E < w && (w = E), x[w] && p !== g && g !== b && p !== b && (m.push(p), m.push(g), m.push(b)); } return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, { vertices: M, @@ -27131,25 +27153,25 @@ ATOM`, b); fillAtom(A, x) { let M = Math.floor(0.5 + this.scaleFactor * (A.x + this.ptranx)), m = Math.floor(0.5 + this.scaleFactor * (A.y + this.ptrany)), l = Math.floor(0.5 + this.scaleFactor * (A.z + this.ptranz)), u = this.getVDWIndex(A), p = 0, g = this.pWidth * this.pHeight; for (let b = 0, c = this.widxz[u]; b < c; b++) - for (let _ = 0; _ < c; _++) { + for (let v = 0; v < c; v++) { if (this.depty[u][p] != -1) { for (let E = -1; E < 2; E++) for (let w = -1; w < 2; w++) for (let k = -1; k < 2; k++) if (E !== 0 && w !== 0 && k !== 0) { - let $ = E * b, L = k * _; - for (let z = 0; z <= this.depty[u][p]; z++) { - let F = z * w, R = M + $, P = m + F, U = l + L; - if (R < 0 || P < 0 || U < 0 || R >= this.pLength || P >= this.pWidth || U >= this.pHeight) + let $ = E * b, L = k * v; + for (let I = 0; I <= this.depty[u][p]; I++) { + let F = I * w, P = M + $, B = m + F, G = l + L; + if (P < 0 || B < 0 || G < 0 || P >= this.pLength || B >= this.pWidth || G >= this.pHeight) continue; - let N = R * g + P * this.pHeight + U; - if (!(this.vpBits[N] & this.INOUT)) - this.vpBits[N] |= this.INOUT, this.vpAtomID[N] = A.serial; + let U = P * g + B * this.pHeight + G; + if (!(this.vpBits[U] & this.INOUT)) + this.vpBits[U] |= this.INOUT, this.vpAtomID[U] = A.serial; else { - let B = x[this.vpAtomID[N]]; - if (B.serial != A.serial) { - let W = M + $ - Math.floor(0.5 + this.scaleFactor * (B.x + this.ptranx)), V = m + F - Math.floor(0.5 + this.scaleFactor * (B.y + this.ptrany)), G = l + L - Math.floor(0.5 + this.scaleFactor * (B.z + this.ptranz)); - $ * $ + F * F + L * L < W * W + V * V + G * G && (this.vpAtomID[N] = A.serial); + let R = x[this.vpAtomID[U]]; + if (R.serial != A.serial) { + let W = M + $ - Math.floor(0.5 + this.scaleFactor * (R.x + this.ptranx)), H = m + F - Math.floor(0.5 + this.scaleFactor * (R.y + this.ptrany)), N = l + L - Math.floor(0.5 + this.scaleFactor * (R.z + this.ptranz)); + $ * $ + F * F + L * L < W * W + H * H + N * N && (this.vpAtomID[U] = A.serial); } } } @@ -27169,25 +27191,25 @@ ATOM`, b); fillAtomWaals(A, x) { let M = 0, m = Math.floor(0.5 + this.scaleFactor * (A.x + this.ptranx)), l = Math.floor(0.5 + this.scaleFactor * (A.y + this.ptrany)), u = Math.floor(0.5 + this.scaleFactor * (A.z + this.ptranz)), p = this.getVDWIndex(A), g = this.pWidth * this.pHeight; for (let b = 0, c = this.widxz[p]; b < c; b++) - for (let _ = 0; _ < c; _++) { + for (let v = 0; v < c; v++) { if (this.depty[p][M] != -1) { for (let E = -1; E < 2; E++) for (let w = -1; w < 2; w++) for (let k = -1; k < 2; k++) if (E !== 0 && w !== 0 && k !== 0) { - let $ = E * b, L = k * _; - for (let z = 0; z <= this.depty[p][M]; z++) { - let F = z * w, R = m + $, P = l + F, U = u + L; - if (R < 0 || P < 0 || U < 0 || R >= this.pLength || P >= this.pWidth || U >= this.pHeight) + let $ = E * b, L = k * v; + for (let I = 0; I <= this.depty[p][M]; I++) { + let F = I * w, P = m + $, B = l + F, G = u + L; + if (P < 0 || B < 0 || G < 0 || P >= this.pLength || B >= this.pWidth || G >= this.pHeight) continue; - let N = R * g + P * this.pHeight + U; - if (!(this.vpBits[N] & this.ISDONE)) - this.vpBits[N] |= this.ISDONE, this.vpAtomID[N] = A.serial; + let U = P * g + B * this.pHeight + G; + if (!(this.vpBits[U] & this.ISDONE)) + this.vpBits[U] |= this.ISDONE, this.vpAtomID[U] = A.serial; else { - let B = x[this.vpAtomID[N]]; - if (B.serial != A.serial) { - let W = m + $ - Math.floor(0.5 + this.scaleFactor * (B.x + this.ptranx)), V = l + F - Math.floor(0.5 + this.scaleFactor * (B.y + this.ptrany)), G = u + L - Math.floor(0.5 + this.scaleFactor * (B.z + this.ptranz)); - $ * $ + F * F + L * L < W * W + V * V + G * G && (this.vpAtomID[N] = A.serial); + let R = x[this.vpAtomID[U]]; + if (R.serial != A.serial) { + let W = m + $ - Math.floor(0.5 + this.scaleFactor * (R.x + this.ptranx)), H = l + F - Math.floor(0.5 + this.scaleFactor * (R.y + this.ptrany)), N = u + L - Math.floor(0.5 + this.scaleFactor * (R.z + this.ptranz)); + $ * $ + F * F + L * L < W * W + H * H + N * N && (this.vpAtomID[U] = A.serial); } } } @@ -27216,17 +27238,17 @@ ATOM`, b); } } fastdistancemap() { - let A = new v(this.pLength, this.pWidth, this.pHeight), x = this.pWidth * this.pHeight, M = this.cutRadius * this.cutRadius, m = [], l = [], u; + let A = new _(this.pLength, this.pWidth, this.pHeight), x = this.pWidth * this.pHeight, M = this.cutRadius * this.cutRadius, m = [], l = [], u; for (let b = 0; b < this.pLength; b++) for (let c = 0; c < this.pWidth; c++) - for (let _ = 0; _ < this.pHeight; _++) - if (u = b * x + c * this.pHeight + _, this.vpBits[u] &= ~this.ISDONE, this.vpBits[u] & this.INOUT && this.vpBits[u] & this.ISBOUND) { + for (let v = 0; v < this.pHeight; v++) + if (u = b * x + c * this.pHeight + v, this.vpBits[u] &= ~this.ISDONE, this.vpBits[u] & this.INOUT && this.vpBits[u] & this.ISBOUND) { let E = { ix: b, iy: c, - iz: _ + iz: v }; - A.set(b, c, _, E), m.push(E), this.vpDistance[u] = 0, this.vpBits[u] |= this.ISDONE, this.vpBits[u] &= ~this.ISBOUND; + A.set(b, c, v, E), m.push(E), this.vpDistance[u] = 0, this.vpBits[u] |= this.ISDONE, this.vpBits[u] &= ~this.ISBOUND; } do { l = this.fastoneshell(m, A), m = []; @@ -27243,11 +27265,11 @@ ATOM`, b); let g = M - 0.5 / (0.1 + p); for (let b = 0; b < this.pLength; b++) for (let c = 0; c < this.pWidth; c++) - for (let _ = 0; _ < this.pHeight; _++) - u = b * x + c * this.pHeight + _, this.vpBits[u] &= ~this.ISBOUND, this.vpBits[u] & this.INOUT && (!(this.vpBits[u] & this.ISDONE) || this.vpBits[u] & this.ISDONE && this.vpDistance[u] >= g) && (this.vpBits[u] |= this.ISBOUND); + for (let v = 0; v < this.pHeight; v++) + u = b * x + c * this.pHeight + v, this.vpBits[u] &= ~this.ISBOUND, this.vpBits[u] & this.INOUT && (!(this.vpBits[u] & this.ISDONE) || this.vpBits[u] & this.ISDONE && this.vpDistance[u] >= g) && (this.vpBits[u] |= this.ISBOUND); } fastoneshell(A, x) { - let M, m, l, u, p, g, b, c, _, E = []; + let M, m, l, u, p, g, b, c, v, E = []; if (A.length === 0) return E; let w = { @@ -27257,12 +27279,12 @@ ATOM`, b); }, k = this.pWidth * this.pHeight; for (let $ = 0, L = A.length; $ < L; $++) { M = A[$].ix, m = A[$].iy, l = A[$].iz, c = x.get(M, m, l); - for (let z = 0; z < 6; z++) - w.ix = M + this.nb[z][0], w.iy = m + this.nb[z][1], w.iz = l + 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 && (_ = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[_] & this.INOUT && !(this.vpBits[_] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[z][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + for (let I = 0; I < 6; I++) + w.ix = M + this.nb[I][0], w.iy = m + this.nb[I][1], w.iz = l + this.nb[I][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (v = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[I][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[v] = b, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[_] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[_] = b, this.vpBits[_] & this.ISBOUND || (this.vpBits[_] |= this.ISBOUND, E.push({ + })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[v] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[v] = b, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz @@ -27270,12 +27292,12 @@ ATOM`, b); } for (let $ = 0, L = A.length; $ < L; $++) { M = A[$].ix, m = A[$].iy, l = A[$].iz, c = x.get(M, m, l); - for (let z = 6; z < 18; z++) - w.ix = M + this.nb[z][0], w.iy = m + this.nb[z][1], w.iz = l + 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 && (_ = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[_] & this.INOUT && !(this.vpBits[_] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[z][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + for (let I = 6; I < 18; I++) + w.ix = M + this.nb[I][0], w.iy = m + this.nb[I][1], w.iz = l + this.nb[I][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (v = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[I][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[v] = b, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[_] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[_] = b, this.vpBits[_] & this.ISBOUND || (this.vpBits[_] |= this.ISBOUND, E.push({ + })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[v] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[v] = b, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz @@ -27283,12 +27305,12 @@ ATOM`, b); } for (let $ = 0, L = A.length; $ < L; $++) { M = A[$].ix, m = A[$].iy, l = A[$].iz, c = x.get(M, m, l); - for (let z = 18; z < 26; z++) - w.ix = M + this.nb[z][0], w.iy = m + this.nb[z][1], w.iz = l + 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 && (_ = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[_] & this.INOUT && !(this.vpBits[_] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[z][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + for (let I = 18; I < 26; I++) + w.ix = M + this.nb[I][0], w.iy = m + this.nb[I][1], w.iz = l + this.nb[I][2], w.ix < this.pLength && w.ix > -1 && w.iy < this.pWidth && w.iy > -1 && w.iz < this.pHeight && w.iz > -1 && (v = w.ix * k + this.pHeight * w.iy + w.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (x.set(w.ix, w.iy, l + this.nb[I][2], c), u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, this.vpDistance[v] = b, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[_] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[_] = b, this.vpBits[_] & this.ISBOUND || (this.vpBits[_] |= this.ISBOUND, E.push({ + })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = w.ix - c.ix, p = w.iy - c.iy, g = w.iz - c.iz, b = u * u + p * p + g * g, b < this.vpDistance[v] && (x.set(w.ix, w.iy, w.iz, c), this.vpDistance[v] = b, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, E.push({ ix: w.ix, iy: w.iy, iz: w.iz @@ -27370,48 +27392,48 @@ ATOM`, b); console.warn("No good formating of CHG or CHGCAR file, not atomic information provided in the file."), this.data = []; return; } - var c = 1.889725992, _ = 0.036749309, E = parseFloat(p[1]), w; + var c = 1.889725992, v = 0.036749309, E = parseFloat(p[1]), w; w = p[2].replace(/^\s+/, "").split(/\s+/); var k = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c); w = p[3].replace(/^\s+/, "").split(/\s+/); var $ = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c); w = p[4].replace(/^\s+/, "").split(/\s+/); - var L = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c), z = k.x * ($.y * L.z - L.y * $.z) - $.x * (k.y * L.z - L.y * k.z) + L.x * (k.y * $.z - $.y * k.z); - z = Math.abs(z) / Math.pow(c, 3); - var F = 1 / z; + var L = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c), I = k.x * ($.y * L.z - L.y * $.z) - $.x * (k.y * L.z - L.y * k.z) + L.x * (k.y * $.z - $.y * k.z); + I = Math.abs(I) / Math.pow(c, 3); + var F = 1 / I; p.splice(0, 8 + b + 1); - var R = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), P = Math.abs(parseFloat(R[0])), U = Math.abs(parseFloat(R[1])), N = Math.abs(parseFloat(R[2])), B = this.origin = new a.Vector3(0, 0, 0); - this.size = { x: P, y: U, z: N }, this.unit = new a.Vector3(k.x, $.y, L.z), k = k.multiplyScalar(1 / (c * P)), $ = $.multiplyScalar(1 / (c * U)), L = L.multiplyScalar(1 / (c * N)), (k.y != 0 || k.z != 0 || $.x != 0 || $.z != 0 || L.x != 0 || L.y != 0) && (this.matrix = new a.Matrix4(k.x, $.x, L.x, 0, k.y, $.y, L.y, 0, k.z, $.z, L.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(B.x, B.y, B.z)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1)), p.splice(0, 1); + var P = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), B = Math.abs(parseFloat(P[0])), G = Math.abs(parseFloat(P[1])), U = Math.abs(parseFloat(P[2])), R = this.origin = new a.Vector3(0, 0, 0); + this.size = { x: B, y: G, z: U }, this.unit = new a.Vector3(k.x, $.y, L.z), k = k.multiplyScalar(1 / (c * B)), $ = $.multiplyScalar(1 / (c * G)), L = L.multiplyScalar(1 / (c * U)), (k.y != 0 || k.z != 0 || $.x != 0 || $.z != 0 || L.x != 0 || L.y != 0) && (this.matrix = new a.Matrix4(k.x, $.x, L.x, 0, k.y, $.y, L.y, 0, k.z, $.z, L.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(R.x, R.y, R.z)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1)), p.splice(0, 1); var W = p.join(" "); W = W.replace(/^\s+/, ""); - var V = W.split(/[\s\r]+/); - V.splice(P * U * N + 1); - for (var G = Float32Array.from(V, parseFloat), H = 0; H < G.length; H++) - G[H] = G[H] * F * _; - this.data = G; + var H = W.split(/[\s\r]+/); + H.splice(B * G * U + 1); + for (var N = Float32Array.from(H, parseFloat), V = 0; V < N.length; V++) + N[V] = N[V] * F * v; + this.data = N; }, this.dx = function(u) { - var p = u.split(/[\n\r]+/), g, b = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, c = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, _ = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, E = /data follows/, w = 0; + var p = u.split(/[\n\r]+/), g, b = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, c = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, v = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, E = /data follows/, w = 0; for (w = 0; w < p.length; w++) { var k = p[w]; if (g = b.exec(k)) { - var $ = parseInt(g[1]), L = parseInt(g[2]), z = parseInt(g[3]); - this.size = { x: $, y: L, z }; - } else if (g = _.exec(k)) { + var $ = parseInt(g[1]), L = parseInt(g[2]), I = parseInt(g[3]); + this.size = { x: $, y: L, z: I }; + } else if (g = v.exec(k)) { var F = parseFloat(g[1]); - if ((parseFloat(g[2]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = p[w], g = _.exec(k), g == null) { + if ((parseFloat(g[2]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = p[w], g = v.exec(k), g == null) { console.error("Parse error in dx delta matrix"); return; } - var R = parseFloat(g[2]); - if ((parseFloat(g[1]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = p[w], g = _.exec(k), g == null) { + var P = parseFloat(g[2]); + if ((parseFloat(g[1]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = p[w], g = v.exec(k), g == null) { console.error("Parse error in dx delta matrix"); return; } - var P = parseFloat(g[3]); - (parseFloat(g[1]) != 0 || parseFloat(g[2]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new a.Vector3(F, R, P); + var B = parseFloat(g[3]); + (parseFloat(g[1]) != 0 || parseFloat(g[2]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new a.Vector3(F, P, B); } else if (g = c.exec(k)) { - var U = parseFloat(g[1]), N = parseFloat(g[2]), B = parseFloat(g[3]); - this.origin = new a.Vector3(U, N, B); + var G = parseFloat(g[1]), U = parseFloat(g[2]), R = parseFloat(g[3]); + this.origin = new a.Vector3(G, U, R); } else if (g = E.exec(k)) break; } @@ -27419,8 +27441,8 @@ ATOM`, b); console.error("Error parsing dx format"); return; } - var W = p.splice(w).join(" "), V = W.split(/[\s\r]+/); - this.data = Float32Array.from(V, parseFloat); + var W = p.splice(w).join(" "), H = W.split(/[\s\r]+/); + this.data = Float32Array.from(H, parseFloat); }, y = y.toLowerCase(), /\.gz$/.test(y)) { y = y.replace(/\.gz$/, ""); try { @@ -27509,14 +27531,14 @@ ATOM`, b); 0 ]; b[2] = Math.sqrt(u.zlen * u.zlen * Math.sin(Math.PI / 180 * u.beta) * Math.sin(Math.PI / 180 * u.beta) - b[1] * b[1]); - var c = [0, p, g, b], _ = [0, u.MX, u.MY, u.MZ], E = [0, u.MAPC, u.MAPR, u.MAPS]; - this.matrix = new a.Matrix4(), this.matrix.set(c[E[1]][0] / _[E[1]], c[E[2]][0] / _[E[2]], c[E[3]][0] / _[E[3]], 0, c[E[1]][1] / _[E[1]], c[E[2]][1] / _[E[2]], c[E[3]][1] / _[E[3]], 0, c[E[1]][2] / _[E[1]], c[E[2]][2] / _[E[2]], c[E[3]][2] / _[E[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(u.NXSTART + u.originX, u.NYSTART + u.originY, u.NZSTART + u.originZ)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1), this.size = { x: y.NX, y: y.NY, z: y.NZ }, this.dimensionorder = [y.MAPC, y.MAPR, y.MAPS]; + var c = [0, p, g, b], v = [0, u.MX, u.MY, u.MZ], E = [0, u.MAPC, u.MAPR, u.MAPS]; + this.matrix = new a.Matrix4(), this.matrix.set(c[E[1]][0] / v[E[1]], c[E[2]][0] / v[E[2]], c[E[3]][0] / v[E[3]], 0, c[E[1]][1] / v[E[1]], c[E[2]][1] / v[E[2]], c[E[3]][1] / v[E[3]], 0, c[E[1]][2] / v[E[1]], c[E[2]][2] / v[E[2]], c[E[3]][2] / v[E[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(u.NXSTART + u.originX, u.NYSTART + u.originY, u.NZSTART + u.originZ)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1), this.size = { x: y.NX, y: y.NY, z: y.NZ }, this.dimensionorder = [y.MAPC, y.MAPR, y.MAPS]; var w = new Float32Array(f.buffer, 1024 + y.NSYMBT), k = y.NX, $ = y.NY, L = y.NZ; this.data = new Float32Array(k * $ * L); - for (let z = 0; z < k; z++) + for (let I = 0; I < k; I++) for (let F = 0; F < $; F++) - for (let R = 0; R < L; R++) - this.data[(z * $ + F) * L + R] = w[(R * $ + F) * k + z]; + for (let P = 0; P < L; P++) + this.data[(I * $ + F) * L + P] = w[(P * $ + F) * k + I]; } } } @@ -27554,8 +27576,8 @@ ATOM`, b); ); class d { static interpolateArray(f, y) { - function A(b, c, _) { - return b + (c - b) * _; + function A(b, c, v) { + return b + (c - b) * v; } var x = [], M = (f.length - 1) / (y - 1); x[0] = f[0]; @@ -27575,27 +27597,27 @@ ATOM`, b); }), x.sort(function($, L) { return $.value - L.value; }), this.min = x[0].value, x.length == 0 && x.push(x[0]), this.max = x[x.length - 1].value; - var m, l, u, p, g, b, c, _, E, w; + var m, l, u, p, g, b, c, v, E, w; for (let $ = 0; $ < x.length - 1; $++) if (u = h.CC.color(x[$].color), p = h.CC.color(x[$ + 1].color), E = x[$].opacity, w = x[$ + 1].opacity, m = Math.floor((x[$].value - this.min) * M / (this.max - this.min)), l = Math.floor((x[$ + 1].value - this.min) * M / (this.max - this.min)), m != l) { - g = d.interpolateArray([u.r * 255, p.r * 255], l - m), b = d.interpolateArray([u.g * 255, p.g * 255], l - m), c = d.interpolateArray([u.b * 255, p.b * 255], l - m), _ = d.interpolateArray([E * 255, w * 255], l - m); + g = d.interpolateArray([u.r * 255, p.r * 255], l - m), b = d.interpolateArray([u.g * 255, p.g * 255], l - m), c = d.interpolateArray([u.b * 255, p.b * 255], l - m), v = d.interpolateArray([E * 255, w * 255], l - m); for (let L = 0; L < g.length; L++) - this.transferfunctionbuffer.push(g[L]), this.transferfunctionbuffer.push(b[L]), this.transferfunctionbuffer.push(c[L]), this.transferfunctionbuffer.push(_[L]); + this.transferfunctionbuffer.push(g[L]), this.transferfunctionbuffer.push(b[L]), this.transferfunctionbuffer.push(c[L]), this.transferfunctionbuffer.push(v[L]); } if (this.transferfunctionbuffer = new Uint8ClampedArray(this.transferfunctionbuffer), f.matrix) { - let $ = new a.Vector3(0, 0, 0), L = new a.Vector3(f.size.x, f.size.y, f.size.z), z = new a.Vector3(1, 1, 1); - $.applyMatrix4(f.matrix), L.applyMatrix4(f.matrix), z.applyMatrix4(f.matrix).sub($), this.extent = [[$.x, $.y, $.z], [L.x, L.y, L.z]]; - for (let U = 1; U < 7; U++) - L.x = U & 1 ? f.size.x : 0, L.y = U & 2 ? f.size.y : 0, L.z = U & 4 ? f.size.z : 0, L.applyMatrix4(f.matrix), this.extent[0][0] = Math.min(this.extent[0][0], L.x), this.extent[0][1] = Math.min(this.extent[0][1], L.y), this.extent[0][2] = Math.min(this.extent[0][2], L.z), this.extent[1][0] = Math.max(this.extent[1][0], L.x), this.extent[1][1] = Math.max(this.extent[1][1], L.y), this.extent[1][2] = Math.max(this.extent[1][2], L.z); - let F = L.x - $.x, R = L.y - $.y, P = L.z - $.z; - this.maxdepth = Math.sqrt(F * F + R * R + P * P), this.minunit = Math.min(Math.min(z.x, z.y), z.z), this.texmatrix = new a.Matrix4().identity().scale({ x: f.size.x, y: f.size.y, z: f.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(f.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); + let $ = new a.Vector3(0, 0, 0), L = new a.Vector3(f.size.x, f.size.y, f.size.z), I = new a.Vector3(1, 1, 1); + $.applyMatrix4(f.matrix), L.applyMatrix4(f.matrix), I.applyMatrix4(f.matrix).sub($), this.extent = [[$.x, $.y, $.z], [L.x, L.y, L.z]]; + for (let G = 1; G < 7; G++) + L.x = G & 1 ? f.size.x : 0, L.y = G & 2 ? f.size.y : 0, L.z = G & 4 ? f.size.z : 0, L.applyMatrix4(f.matrix), this.extent[0][0] = Math.min(this.extent[0][0], L.x), this.extent[0][1] = Math.min(this.extent[0][1], L.y), this.extent[0][2] = Math.min(this.extent[0][2], L.z), this.extent[1][0] = Math.max(this.extent[1][0], L.x), this.extent[1][1] = Math.max(this.extent[1][1], L.y), this.extent[1][2] = Math.max(this.extent[1][2], L.z); + let F = L.x - $.x, P = L.y - $.y, B = L.z - $.z; + this.maxdepth = Math.sqrt(F * F + P * P + B * B), this.minunit = Math.min(Math.min(I.x, I.y), I.z), this.texmatrix = new a.Matrix4().identity().scale({ x: f.size.x, y: f.size.y, z: f.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(f.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); } else { this.texmatrix = new a.Matrix4().identity(); - let $ = f.unit.x * f.size.x, L = f.unit.y * f.size.y, z = f.unit.z * f.size.z; - this.texmatrix.makeTranslation(-f.origin.x / $, -f.origin.y / L, -f.origin.z / z), this.texmatrix.scale({ x: 1 / $, y: 1 / L, z: 1 / z }), this.minunit = Math.min(Math.min(f.unit.x, f.unit.y), f.unit.z), this.extent = [ + let $ = f.unit.x * f.size.x, L = f.unit.y * f.size.y, I = f.unit.z * f.size.z; + this.texmatrix.makeTranslation(-f.origin.x / $, -f.origin.y / L, -f.origin.z / I), this.texmatrix.scale({ x: 1 / $, y: 1 / L, z: 1 / I }), this.minunit = Math.min(Math.min(f.unit.x, f.unit.y), f.unit.z), this.extent = [ [f.origin.x, f.origin.y, f.origin.z], - [f.origin.x + $, f.origin.y + L, f.origin.z + z] - ], this.maxdepth = Math.sqrt($ * $ + L * L + z * z); + [f.origin.x + $, f.origin.y + L, f.origin.z + I] + ], this.maxdepth = Math.sqrt($ * $ + L * L + I * I); } var k = new o.GLShape({}); if (k.addBox({ @@ -27606,18 +27628,18 @@ ATOM`, b); d: this.extent[1][2] - this.extent[0][2] } }), this.geo = k.finalize(), this.boundingSphere.center = new a.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, y.coords === void 0 && y.selection !== void 0 && (A ? y.coords = A.selectedAtoms(y.selection) : console.log("Need to provide viewer to volumetric renderer if selection specified.")), y.coords !== void 0 && y.seldist !== void 0) { - let $ = new Uint8Array(f.data.length), L = y.seldist, z = L * L; - for (let F = 0, R = y.coords.length; F < R; F++) { - let P = y.coords[F], U = P.x - L, N = P.y - L, B = P.z - L, W = P.x + L, V = P.y + L, G = P.z + L; - if (f.getIndex(U, N, B) >= 0 || f.getIndex(W, V, G) >= 0) - for (let H = U; H < W; H += this.minunit) - for (let Q = N; Q < V; Q += this.minunit) - for (let te = B; te < G; te += this.minunit) { - let ee = f.getIndex(H, Q, te); - ee >= 0 && !$[ee] && (H - P.x) * (H - P.x) + (Q - P.y) * (Q - P.y) + (te - P.z) * (te - P.z) < z && ($[ee] = 1); + let $ = new Uint8Array(f.data.length), L = y.seldist, I = L * L; + for (let F = 0, P = y.coords.length; F < P; F++) { + let B = y.coords[F], G = B.x - L, U = B.y - L, R = B.z - L, W = B.x + L, H = B.y + L, N = B.z + L; + if (f.getIndex(G, U, R) >= 0 || f.getIndex(W, H, N) >= 0) + for (let V = G; V < W; V += this.minunit) + for (let J = U; J < H; J += this.minunit) + for (let re = R; re < N; re += this.minunit) { + let te = f.getIndex(V, J, re); + te >= 0 && !$[te] && (V - B.x) * (V - B.x) + (J - B.y) * (J - B.y) + (re - B.z) * (re - B.z) < I && ($[te] = 1); } } - for (let F = 0, R = f.data.length; F < R; F++) + for (let F = 0, P = f.data.length; F < P; F++) $[F] == 0 && (f.data[F] = 1 / 0); } this.data = f; @@ -27687,8 +27709,8 @@ ATOM`, b); "./src/WebGL/math/index.ts" ); class s extends r.Object3D { - constructor(o = 50, d = 1, v = 0.1, f = 2e3, y = !1) { - super(), this.projectionMatrix = new a.Matrix4(), this.projectionMatrixInverse = new a.Matrix4(), this.matrixWorldInverse = new a.Matrix4(), this.fov = o, this.aspect = d, this.near = v, this.far = f; + constructor(o = 50, d = 1, _ = 0.1, f = 2e3, y = !1) { + super(), this.projectionMatrix = new a.Matrix4(), this.projectionMatrixInverse = new a.Matrix4(), this.matrixWorldInverse = new a.Matrix4(), this.fov = o, this.aspect = d, this.near = _, this.far = f; var A = this.position.z; this.right = A * Math.tan(Math.PI / 180 * o), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!y, this.updateProjectionMatrix(); } @@ -27763,7 +27785,7 @@ ATOM`, b); ), d = t( /*! ./materials */ "./src/WebGL/materials/index.ts" - ), v = t( + ), _ = t( /*! ./math */ "./src/WebGL/math/index.ts" ), f = t( @@ -27790,7 +27812,7 @@ ATOM`, b); faces: 0, points: 0 } - }, this._offscreen = null, this._bitmap = null, this._programs = [], this._programs_counter = 0, this._webglversion = 1, this._currentProgram = null, this._currentMaterialId = -1, this._currentGeometryGroupHash = null, this._currentCamera = null, this._geometryGroupCounter = 0, this._oldDoubleSided = -1, this._oldFlipSided = -1, this._oldDepthTest = -1, this._oldDepthWrite = -1, this._oldPolygonOffset = null, this._oldLineWidth = null, this._viewportWidth = 0, this._viewportHeight = 0, this._currentWidth = 0, this._currentHeight = 0, this._enabledAttributes = {}, this._vector3 = new v.Vector3(), this._worldInverse = new v.Matrix4(), this._projInverse = new v.Matrix4(), this._textureMatrix = new v.Matrix4(), this._fullProjModelMatrix = new v.Matrix4(), this._fullProjModelMatrixInv = new v.Matrix4(), this._direction = new v.Vector3(), this._lightsNeedUpdate = !0, this._lights = { + }, this._offscreen = null, this._bitmap = null, this._programs = [], this._programs_counter = 0, this._webglversion = 1, this._currentProgram = null, this._currentMaterialId = -1, this._currentGeometryGroupHash = null, this._currentCamera = null, this._geometryGroupCounter = 0, this._oldDoubleSided = -1, this._oldFlipSided = -1, this._oldDepthTest = -1, this._oldDepthWrite = -1, this._oldPolygonOffset = null, this._oldLineWidth = null, this._viewportWidth = 0, this._viewportHeight = 0, this._currentWidth = 0, this._currentHeight = 0, this._enabledAttributes = {}, this._vector3 = new _.Vector3(), this._worldInverse = new _.Matrix4(), this._projInverse = new _.Matrix4(), this._textureMatrix = new _.Matrix4(), this._fullProjModelMatrix = new _.Matrix4(), this._fullProjModelMatrixInv = new _.Matrix4(), this._direction = new _.Vector3(), this._lightsNeedUpdate = !0, this._lights = { ambient: [0, 0, 0], directional: { length: 0, @@ -27895,9 +27917,9 @@ ATOM`, b); // have been chosen initMaterial(u, p, g, b) { u.addEventListener("dispose", this.onMaterialDispose.bind(this)); - var c, _; - if (_ = u.shaderID, _) { - var E = y.ShaderLib[_]; + var c, v; + if (v = u.shaderID, v) { + var E = y.ShaderLib[v]; u.vertexShader = E.vertexShader, u.fragmentShader = E.fragmentShader, u.uniforms = y.ShaderUtils.clone(E.uniforms), u.shaded && u.makeShaded(this.SHADE_TEXTURE); } c = { @@ -27907,21 +27929,21 @@ ATOM`, b); shaded: u.shaded }, u.program = this.buildProgram(u.fragmentShader, u.vertexShader, u.uniforms, c); } - renderBuffer(u, p, g, b, c, _) { + renderBuffer(u, p, g, b, c, v) { if (b.visible) { var E, w; - if (E = this.setProgram(u, p, g, b, _, this), !!E) { + if (E = this.setProgram(u, p, g, b, v, this), !!E) { w = E.attributes; var k = !1, $ = b.wireframe ? 1 : 0, L = c.id * 16777215 + E.id * 2 + $; L !== this._currentGeometryGroupHash && (this._currentGeometryGroupHash = L, k = !0), k && (this.disableAttributes(), w.position >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglVertexBuffer), this.enableAttribute(w.position), this._gl.vertexAttribPointer(w.position, 3, this._gl.FLOAT, !1, 0, 0)), w.color >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglColorBuffer), this.enableAttribute(w.color), this._gl.vertexAttribPointer(w.color, 3, this._gl.FLOAT, !1, 0, 0)), w.normal >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglNormalBuffer), this.enableAttribute(w.normal), this._gl.vertexAttribPointer(w.normal, 3, this._gl.FLOAT, !1, 0, 0)), w.offset >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglOffsetBuffer), this.enableAttribute(w.offset), this._gl.vertexAttribPointer(w.offset, 3, this._gl.FLOAT, !1, 0, 0)), w.radius >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglRadiusBuffer), this.enableAttribute(w.radius), this._gl.vertexAttribPointer(w.radius, 1, this._gl.FLOAT, !1, 0, 0))); - var z, F; - if (_ instanceof f.Mesh) { + var I, F; + if (v instanceof f.Mesh) { if (b.shaderID === "instanced") { - var R = b.sphere.geometryGroups[0]; - k && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, R.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, R.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, R.faceArray, this._gl.STATIC_DRAW)), z = R.faceidx, this._extInstanced.vertexAttribDivisorANGLE(w.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(w.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(w.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, z, this._gl.UNSIGNED_SHORT, 0, c.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(w.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(w.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(w.color, 0); - } else b.wireframe ? (F = c.lineidx, this.setLineWidth(b.wireframeLinewidth), k && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, F, this._gl.UNSIGNED_SHORT, 0)) : (z = c.faceidx, k && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, z, this._gl.UNSIGNED_SHORT, 0)); - this.info.render.calls++, this.info.render.vertices += z, this.info.render.faces += z / 3; - } else _ instanceof f.Line && (F = c.vertices, this.setLineWidth(b.linewidth), this._gl.drawArrays(this._gl.LINES, 0, F), this.info.render.calls++); + var P = b.sphere.geometryGroups[0]; + k && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, P.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, c.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, P.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, P.faceArray, this._gl.STATIC_DRAW)), I = P.faceidx, this._extInstanced.vertexAttribDivisorANGLE(w.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(w.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(w.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, I, this._gl.UNSIGNED_SHORT, 0, c.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(w.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(w.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(w.color, 0); + } else b.wireframe ? (F = c.lineidx, this.setLineWidth(b.wireframeLinewidth), k && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, F, this._gl.UNSIGNED_SHORT, 0)) : (I = c.faceidx, k && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, I, this._gl.UNSIGNED_SHORT, 0)); + this.info.render.calls++, this.info.render.vertices += I, this.info.render.faces += I / 3; + } else v instanceof f.Line && (F = c.vertices, this.setLineWidth(b.linewidth), this._gl.drawArrays(this._gl.LINES, 0, F), this.info.render.calls++); } } } @@ -27932,12 +27954,12 @@ ATOM`, b); /* Setup the shading buffer to reflect desired shading (ambient occlusion) values. Only the matching object with materialType are considered. */ setShading(u, p, g) { - let b = u.__lights, c = u.fog, _ = []; + let b = u.__lights, c = u.fog, v = []; for (let k = 0, $ = u.__webglObjects.length; k < $; k++) { let L = u.__webglObjects[k]; - L.render && L[g] && _.push(L); + L.render && L[g] && v.push(L); } - if (_.length == 0) + if (v.length == 0) return; this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this._gl.framebufferTexture2D( this._gl.FRAMEBUFFER, @@ -27948,8 +27970,8 @@ ATOM`, b); 0 ), this.renderObjects(u.__webglObjects, !0, g + "Depth", p, b, c, !1), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._scratchTexture, 0), this.clear(!1, !0, !1), this._gl.useProgram(this._AOshader), this._currentProgram = this._AOshader, this.setDepthTest(-1), this.setDepthWrite(-1); let E = this._AOshader.uniforms; - this._gl.uniform1f(E.total_strength, this._AOstrength), this._gl.uniform1f(E.radius, this._AOradius), this._fullProjModelMatrix = new v.Matrix4(), this._fullProjModelMatrixInv = new v.Matrix4(); - let w = _[0].object; + this._gl.uniform1f(E.total_strength, this._AOstrength), this._gl.uniform1f(E.radius, this._AOradius), this._fullProjModelMatrix = new _.Matrix4(), this._fullProjModelMatrixInv = new _.Matrix4(); + let w = v[0].object; this._fullProjModelMatrix.multiplyMatrices(p.projectionMatrix, w._modelViewMatrix), this._fullProjModelMatrixInv.getInverse(this._fullProjModelMatrix), this._gl.uniformMatrix4fv(E.projectionMatrix, !1, this._fullProjModelMatrix.elements), this._gl.uniformMatrix4fv(E.projinv, !1, this._fullProjModelMatrixInv.elements), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._aovertexattribpos), this._gl.vertexAttribPointer(this._aovertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this.clear(!1, !0, !1), this._gl.useProgram(this._blurshader), this._currentProgram = this._blurshader, this.setDepthTest(-1), this.setDepthWrite(-1), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._blurvertexattribpos), this._gl.vertexAttribPointer(this._blurvertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._scratchTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._targetTexture, 0), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0); } render(u, p) { @@ -27957,16 +27979,16 @@ ATOM`, b); console.error("Renderer.render: camera is not an instance of Camera."); return; } - var g, b, c, _, E, w = u.__lights, k = u.fog; + var g, b, c, v, E, w = u.__lights, k = u.fog; if (this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && u.updateMatrixWorld(), p.parent === void 0 && p.updateMatrixWorld(), p.matrixWorldInverse.getInverse(p.matrixWorld), this.isLost()) return; this.autoUpdateObjects && this.initWebGLObjects(u), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(!0, !0, !0), E = u.__webglObjects; let $ = !1, L = this._AOEnabled; for (g = 0, b = E.length; g < b; g++) - c = E[g], _ = c.object, c.render = !1, _.visible && (this.setupMatrices(_, p), this.unrollBufferMaterial(c), c.render = !0, c.volumetric && ($ = !0), c.hasAO && (L = !0)); + c = E[g], v = c.object, c.render = !1, v.visible && (this.setupMatrices(v, p), this.unrollBufferMaterial(c), c.render = !0, c.volumetric && ($ = !0), c.hasAO && (L = !0)); if (this.setBlending(!1), L && this.setShading(u, p, "opaque"), this.renderObjects(u.__webglObjects, !0, "opaque", p, w, k, !1), L && this.clearShading(), this.renderSprites(u, p, !1), this.renderObjects(u.__webglObjects, !0, "transparentDepth", p, w, k, !0), this.renderObjects(u.__webglObjects, !1, "transparent", p, w, k, !0), $ && this._fb && (this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, null, 0), this.renderObjects(u.__webglObjects, !1, "volumetric", p, w, k, !0)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(u, p, !0), this._bitmap) { - const z = this._offscreen.transferToImageBitmap(); - this._bitmap.transferFromImageBitmap(z); + const I = this._offscreen.transferToImageBitmap(); + this._bitmap.transferFromImageBitmap(I); } } //setup framebuffer for drawing into, assumes buffers already allocated @@ -28003,8 +28025,8 @@ ATOM`, b); this._screenQuadVBO = this._gl.createBuffer(), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(b), this._gl.STATIC_DRAW); let c = y.ShaderLib.ssao; this._AOshader = this.buildProgram(c.fragmentShader, c.vertexShader, c.uniforms, {}), this._aovertexattribpos = this._gl.getAttribLocation(this._AOshader, "vertexPosition"); - let _ = y.ShaderLib.blur; - this._blurshader = this.buildProgram(_.fragmentShader, _.vertexShader, _.uniforms, {}), this._blurvertexattribpos = this._gl.getAttribLocation(this._blurshader, "vertexPosition"); + let v = y.ShaderLib.blur; + this._blurshader = this.buildProgram(v.fragmentShader, v.vertexShader, v.uniforms, {}), this._blurvertexattribpos = this._gl.getAttribLocation(this._blurshader, "vertexPosition"); } renderFrameBuffertoScreen() { this.isWebGL1() || this._fb === null || (this.setViewport(), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null), this._gl.clear(this._gl.COLOR_BUFFER_BIT | this._gl.DEPTH_BUFFER_BIT), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.useProgram(this._screenshader), this._currentProgram = this._screenshader, this.setDepthTest(-1), this.setDepthWrite(-1), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._vertexattribpos), this._gl.vertexAttribPointer(this._vertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6)); @@ -28040,12 +28062,12 @@ ATOM`, b); u.__webglInit || (u.__webglInit = !0, u.addEventListener("dispose", this.onTextureDispose.bind(this)), u.__webglTexture = this._gl.createTexture(), this.info.memory.textures++), this._gl.activeTexture(this._gl.TEXTURE0 + p); var b = g ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D; this._gl.bindTexture(b, u.__webglTexture), this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, u.flipY), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, u.premultiplyAlpha), this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, u.unpackAlignment), this._gl.pixelStorei(this._gl.PACK_ALIGNMENT, u.unpackAlignment); - var c = this.paramToGL(u.format), _ = this.paramToGL(u.type); + var c = this.paramToGL(u.format), v = this.paramToGL(u.type); if (g) this.setTextureParameters(this._gl.TEXTURE_3D, u), this._gl.texImage3D(this._gl.TEXTURE_3D, 0, this._gl.R32F, u.image.size.z, u.image.size.y, u.image.size.x, 0, this._gl.RED, this._gl.FLOAT, u.image.data); else { var E = u.image, w = E.width, k = E.height; - typeof w > "u" && (w = E.length, c == this._gl.RGBA && (w /= 4), k = 1), this.setTextureParameters(this._gl.TEXTURE_2D, u), this.isWebGL1() ? this._gl.texImage2D(this._gl.TEXTURE_2D, 0, c, c, _, u.image) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, c, w, k, 0, c, _, u.image); + typeof w > "u" && (w = E.length, c == this._gl.RGBA && (w /= 4), k = 1), this.setTextureParameters(this._gl.TEXTURE_2D, u), this.isWebGL1() ? this._gl.texImage2D(this._gl.TEXTURE_2D, 0, c, c, v, u.image) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, c, w, k, 0, c, v, u.image); } u.needsUpdate = !1, u.onUpdate && u.onUpdate(); } else @@ -28078,13 +28100,13 @@ ATOM`, b); var p = u.program; if (p !== void 0) { u.program = void 0; - var g, b, c, _ = !1; + var g, b, c, v = !1; for (g = 0, b = this._programs.length; g < b; g++) if (c = this._programs[g], c.program === p) { - c.usedTimes--, c.usedTimes === 0 && (_ = !0); + c.usedTimes--, c.usedTimes === 0 && (v = !0); break; } - if (_ === !0) { + if (v === !0) { var E = []; for (g = 0, b = this._programs.length; g < b; g++) c = this._programs[g], c.program !== p && E.push(c); @@ -28122,11 +28144,11 @@ ATOM`, b); // Compile appropriate shaders (if necessary) from source code and attach to // gl program. buildProgram(u, p, g, b) { - var c, _, E, w, k = []; + var c, v, E, w, k = []; k.push(u), k.push(p); for (c in b) k.push(c), k.push(b[c]); - for (w = k.join(), c = 0, _ = this._programs.length; c < _; c++) { + for (w = k.join(), c = 0, v = this._programs.length; c < v; c++) { var $ = this._programs[c]; if ($.code === w) return $.usedTimes++, $.program; @@ -28135,21 +28157,21 @@ ATOM`, b); throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware."); if (E = this._gl.createProgram(), E == null) return null; - var L = this._precision, z = "precision " + L + " float;", F = [ + var L = this._precision, I = "precision " + L + " float;", F = [ b.volumetric ? "#version 300 es" : "", - z + I ].join(` -`), R = [ +`), P = [ b.volumetric ? "#version 300 es" : "", b.fragdepth && this.isWebGL1() ? "#extension GL_EXT_frag_depth: enable" : "", b.shaded ? "#define SHADED 1" : "", b.wireframe ? "#define WIREFRAME 1" : "", - z + I ].join(` -`), P = this.getShader("fragment", R + u), U = this.getShader("vertex", F + p); - U != null && this._gl.attachShader(E, U), P != null && this._gl.attachShader(E, P), this._gl.linkProgram(E), this._gl.getProgramParameter(E, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), E.uniforms = {}, E.attributes = {}; - var N, B, W; - N = [ +`), B = this.getShader("fragment", P + u), G = this.getShader("vertex", F + p); + G != null && this._gl.attachShader(E, G), B != null && this._gl.attachShader(E, B), this._gl.linkProgram(E), this._gl.getProgramParameter(E, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), E.uniforms = {}, E.attributes = {}; + var U, R, W; + U = [ "viewMatrix", "modelViewMatrix", "projectionMatrix", @@ -28157,22 +28179,22 @@ ATOM`, b); "vWidth", "vHeight" ]; - for (B in g) - N.push(B); - for (W = 0; W < N.length; W++) { - var V = N[W]; - E.uniforms[V] = this._gl.getUniformLocation(E, V); + for (R in g) + U.push(R); + for (W = 0; W < U.length; W++) { + var H = U[W]; + E.uniforms[H] = this._gl.getUniformLocation(E, H); } - for (N = [ + for (U = [ "position", "normal", "color", "lineDistance", "offset", "radius" - ], W = 0; W < N.length; W++) { - var G = N[W]; - E.attributes[G] = this._gl.getAttribLocation(E, G); + ], W = 0; W < U.length; W++) { + var N = U[W]; + E.attributes[N] = this._gl.getAttribLocation(E, N); } return E.id = this._programs_counter++, this._programs.push({ program: E, @@ -28180,7 +28202,7 @@ ATOM`, b); usedTimes: 1 }), this.info.memory.programs = this._programs.length, E; } - setProgram(u, p, g, b, c, _) { + setProgram(u, p, g, b, c, v) { if (b.needsUpdate && (b.program && this.deallocateMaterial(b), this.initMaterial(b, p, g, c), b.needsUpdate = !1), b.program == null) return null; var E = !1, w = b.program, k = w.uniforms, $ = b.uniforms; @@ -28192,27 +28214,27 @@ ATOM`, b); else if (b.shaderID === "volumetric") { c._modelViewMatrix.getScale(this._direction), this._worldInverse.getInverse(c._modelViewMatrix), this._projInverse.getInverse(u.projectionMatrix), this._textureMatrix.multiplyMatrices(c.material.texmatrix, this._worldInverse), this._gl.uniformMatrix4fv(k.textmat, !1, this._textureMatrix.elements), this._gl.uniformMatrix4fv(k.projinv, !1, this._projInverse.elements); let L = Math.min(Math.min(this._direction.x, this._direction.y), this._direction.z); - $.step.value = c.material.unit * L, $.maxdepth.value = c.material.maxdepth * L, $.transfermax.value = c.material.transfermax, $.transfermin.value = c.material.transfermin, $.subsamples.value = c.material.subsamples, _.setTexture(c.material.transferfn, 4, !1), _.setTexture(c.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture); + $.step.value = c.material.unit * L, $.maxdepth.value = c.material.maxdepth * L, $.transfermax.value = c.material.transfermax, $.transfermin.value = c.material.transfermin, $.subsamples.value = c.material.subsamples, v.setTexture(c.material.transferfn, 4, !1), v.setTexture(c.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture); } $.opacity.value = b.opacity, this.loadMaterialUniforms(k, $); } return $.shading && ($.shading.value == 3 ? (this._gl.activeTexture(this._gl.TEXTURE0 + this.SHADE_TEXTURE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture)) : console.error("Invalid shading textures.")), w; } loadMaterialUniforms(u, p) { - var g, b, c, _; + var g, b, c, v; for (g in p) - u[g] && (b = p[g].type, c = p[g].value, _ = u[g], b === "f" ? this._gl.uniform1f(_, c) : b === "i" ? this._gl.uniform1i(_, c) : b === "fv" ? this._gl.uniform3fv(_, c) : b === "c" ? this._gl.uniform3f(_, c.r, c.g, c.b) : b === "f4" && this._gl.uniform4f(_, c[0], c[1], c[2], c[3])); + u[g] && (b = p[g].type, c = p[g].value, v = u[g], b === "f" ? this._gl.uniform1f(v, c) : b === "i" ? this._gl.uniform1i(v, c) : b === "fv" ? this._gl.uniform3fv(v, c) : b === "c" ? this._gl.uniform3f(v, c.r, c.g, c.b) : b === "f4" && this._gl.uniform4f(v, c[0], c[1], c[2], c[3])); } // Objects adding addObject(u, p) { - var g, b, c, _; - if (!u.__webglInit && (u.__webglInit = !0, u._modelViewMatrix = new v.Matrix4(), u._normalMatrix = new v.Matrix3(), u.geometry !== void 0 && u.geometry.__webglInit === void 0 && (u.geometry.__webglInit = !0, u.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), u instanceof f.Mesh || u instanceof f.Line)) + var g, b, c, v; + if (!u.__webglInit && (u.__webglInit = !0, u._modelViewMatrix = new _.Matrix4(), u._normalMatrix = new _.Matrix3(), u.geometry !== void 0 && u.geometry.__webglInit === void 0 && (u.geometry.__webglInit = !0, u.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), u instanceof f.Mesh || u instanceof f.Line)) for (c = u.geometry, g = 0, b = c.geometryGroups.length; g < b; g++) - _ = c.geometryGroups[g], _.id = this._geometryGroupCounter++, _.__webglVertexBuffer || (u instanceof f.Mesh ? (this.createMeshBuffers(_), c.elementsNeedUpdate = !0, c.normalsNeedUpdate = !0) : u instanceof f.Line && this.createLineBuffers(_), c.verticesNeedUpdate = !0, c.colorsNeedUpdate = !0); + v = c.geometryGroups[g], v.id = this._geometryGroupCounter++, v.__webglVertexBuffer || (u instanceof f.Mesh ? (this.createMeshBuffers(v), c.elementsNeedUpdate = !0, c.normalsNeedUpdate = !0) : u instanceof f.Line && this.createLineBuffers(v), c.verticesNeedUpdate = !0, c.colorsNeedUpdate = !0); if (!u.__webglActive) { if (u instanceof f.Mesh || u instanceof f.Line) for (c = u.geometry, g = 0, b = c.geometryGroups.length; g < b; g++) - _ = c.geometryGroups[g], this.addBuffer(p.__webglObjects, _, u); + v = c.geometryGroups[g], this.addBuffer(p.__webglObjects, v, u); else u instanceof f.Sprite && p.__webglSprites.push(u); u.__webglActive = !0; } @@ -28260,8 +28282,8 @@ ATOM`, b); this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, c, p); } if (u.radiusArray && u.__webglRadiusBuffer !== void 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglRadiusBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, u.radiusArray, p)), u.faceArray && u.__webglFaceBuffer !== void 0) { - var _ = u.faceArray; - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, _, p); + var v = u.faceArray; + this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, v, p); } if (u.lineArray && u.__webglLineBuffer !== void 0) { var E = u.lineArray; @@ -28300,14 +28322,14 @@ ATOM`, b); return u === s.UnsignedByteType ? this._gl.UNSIGNED_BYTE : u === s.RGBAFormat ? this._gl.RGBA : u === s.NearestFilter ? this._gl.NEAREST : 0; } setupLights(u, p) { - var g, b, c, _ = 0, E = 0, w = 0, k, $, L = this._lights, z = L.directional.colors, F = L.directional.positions, R = 0, P = 0; + var g, b, c, v = 0, E = 0, w = 0, k, $, L = this._lights, I = L.directional.colors, F = L.directional.positions, P = 0, B = 0; for (g = 0, b = p.length; g < b; g++) if (c = p[g], k = c.color, $ = c.intensity, c instanceof h.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; - F[P] = this._direction.x, F[P + 1] = this._direction.y, F[P + 2] = this._direction.z, z[P] = k.r * $, z[P + 1] = k.g * $, z[P + 2] = k.b * $, P += 3, R++; + F[B] = this._direction.x, F[B + 1] = this._direction.y, F[B + 2] = this._direction.z, I[B] = k.r * $, I[B + 1] = k.g * $, I[B + 2] = k.b * $, B += 3, P++; } - L.ambient[0] = _, L.ambient[1] = E, L.ambient[2] = w, L.directional.length = R; + L.ambient[0] = v, L.ambient[1] = E, L.ambient[2] = w, L.directional.length = P; } initGL() { try { @@ -28350,18 +28372,18 @@ ATOM`, b); this._gl.clearDepth(1), this._gl.clearStencil(0), this._gl.enable(this._gl.DEPTH_TEST), this._gl.depthFunc(this._gl.LEQUAL), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.enable(this._gl.CULL_FACE), this._gl.enable(this._gl.BLEND), this._gl.blendEquation(this._gl.FUNC_ADD), this._gl.blendFunc(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } // rendering - renderObjects(u, p, g, b, c, _, E) { - var w, k, $, L, z, F, R; - p ? (z = u.length - 1, F = -1, R = -1) : (z = 0, F = u.length, R = 1); - for (var P = z; P !== F; P += R) - if (w = u[P], w.render) { + renderObjects(u, p, g, b, c, v, E) { + var w, k, $, L, I, F, P; + p ? (I = u.length - 1, F = -1, P = -1) : (I = 0, F = u.length, P = 1); + for (var B = I; B !== F; B += P) + if (w = u[B], w.render) { if (k = w.object, $ = w.buffer, L = w[g], (w.hasAO || this._AOEnabled) && w[g + "Shaded"] && (L = w[g + "Shaded"]), !L) continue; E && this.setBlending(!0), this.setDepthTest(L.depthTest), this.setDepthWrite(L.depthWrite), this.setPolygonOffset(L.polygonOffset, L.polygonOffsetFactor, L.polygonOffsetUnits); - var U = k._modelViewMatrix.isReflected(); - if (this.setMaterialFaces(L, U), this.renderBuffer(b, c, _, L, $, k), (this._outlineEnabled || L.outline) && !L.wireframe && L.shaderID !== "basic" && L.opacity !== 0) { - let N = this._outlineMaterial; - L.shaderID == "sphereimposter" ? N = this._outlineSphereImposterMaterial : L.shaderID == "stickimposter" && (N = this._outlineStickImposterMaterial), this.renderBuffer(b, c, _, N, $, k); + var G = k._modelViewMatrix.isReflected(); + if (this.setMaterialFaces(L, G), this.renderBuffer(b, c, v, L, $, k), (this._outlineEnabled || L.outline) && !L.wireframe && L.shaderID !== "basic" && L.opacity !== 0) { + let U = this._outlineMaterial; + L.shaderID == "sphereimposter" ? U = this._outlineSphereImposterMaterial : L.shaderID == "stickimposter" && (U = this._outlineStickImposterMaterial), this.renderBuffer(b, c, v, U, $, k); } } } @@ -28410,46 +28432,46 @@ ATOM`, b); this.precision || 1 /** added default to single precision */ ), this.sprite.attributes = {}; - const v = {}; - this.sprite.attributes.position = this.gl.getAttribLocation(this.sprite.program, "position"), this.sprite.attributes.uv = this.gl.getAttribLocation(this.sprite.program, "uv"), v.uvOffset = this.gl.getUniformLocation(this.sprite.program, "uvOffset"), v.uvScale = this.gl.getUniformLocation(this.sprite.program, "uvScale"), v.rotation = this.gl.getUniformLocation(this.sprite.program, "rotation"), v.scale = this.gl.getUniformLocation(this.sprite.program, "scale"), v.alignment = this.gl.getUniformLocation(this.sprite.program, "alignment"), v.color = this.gl.getUniformLocation(this.sprite.program, "color"), v.map = this.gl.getUniformLocation(this.sprite.program, "map"), v.opacity = this.gl.getUniformLocation(this.sprite.program, "opacity"), v.useScreenCoordinates = this.gl.getUniformLocation(this.sprite.program, "useScreenCoordinates"), v.screenPosition = this.gl.getUniformLocation(this.sprite.program, "screenPosition"), v.modelViewMatrix = this.gl.getUniformLocation(this.sprite.program, "modelViewMatrix"), v.projectionMatrix = this.gl.getUniformLocation(this.sprite.program, "projectionMatrix"), v.fogType = this.gl.getUniformLocation(this.sprite.program, "fogType"), v.fogDensity = this.gl.getUniformLocation(this.sprite.program, "fogDensity"), v.fogNear = this.gl.getUniformLocation(this.sprite.program, "fogNear"), v.fogFar = this.gl.getUniformLocation(this.sprite.program, "fogFar"), v.fogColor = this.gl.getUniformLocation(this.sprite.program, "fogColor"), v.alphaTest = this.gl.getUniformLocation(this.sprite.program, "alphaTest"), this.sprite.uniforms = v; + const _ = {}; + this.sprite.attributes.position = this.gl.getAttribLocation(this.sprite.program, "position"), this.sprite.attributes.uv = this.gl.getAttribLocation(this.sprite.program, "uv"), _.uvOffset = this.gl.getUniformLocation(this.sprite.program, "uvOffset"), _.uvScale = this.gl.getUniformLocation(this.sprite.program, "uvScale"), _.rotation = this.gl.getUniformLocation(this.sprite.program, "rotation"), _.scale = this.gl.getUniformLocation(this.sprite.program, "scale"), _.alignment = this.gl.getUniformLocation(this.sprite.program, "alignment"), _.color = this.gl.getUniformLocation(this.sprite.program, "color"), _.map = this.gl.getUniformLocation(this.sprite.program, "map"), _.opacity = this.gl.getUniformLocation(this.sprite.program, "opacity"), _.useScreenCoordinates = this.gl.getUniformLocation(this.sprite.program, "useScreenCoordinates"), _.screenPosition = this.gl.getUniformLocation(this.sprite.program, "screenPosition"), _.modelViewMatrix = this.gl.getUniformLocation(this.sprite.program, "modelViewMatrix"), _.projectionMatrix = this.gl.getUniformLocation(this.sprite.program, "projectionMatrix"), _.fogType = this.gl.getUniformLocation(this.sprite.program, "fogType"), _.fogDensity = this.gl.getUniformLocation(this.sprite.program, "fogDensity"), _.fogNear = this.gl.getUniformLocation(this.sprite.program, "fogNear"), _.fogFar = this.gl.getUniformLocation(this.sprite.program, "fogFar"), _.fogColor = this.gl.getUniformLocation(this.sprite.program, "fogColor"), _.alphaTest = this.gl.getUniformLocation(this.sprite.program, "alphaTest"), this.sprite.uniforms = _; } - render(o, d, v, f, y) { + render(o, d, _, f, y) { var A, x, M, m, l, u, p, g, b, c; if (!this.gl) throw new Error("WebGLRenderer not initialized"); - let _ = []; - (A = o?.__webglSprites) === null || A === void 0 || A.forEach((Q) => { - (y && Q.material.depthTest == !1 || !y && Q.material.depthTest) && _.push(Q); + let v = []; + (A = o == null ? void 0 : o.__webglSprites) === null || A === void 0 || A.forEach((J) => { + (y && J.material.depthTest == !1 || !y && J.material.depthTest) && v.push(J); }); - let E = _.length; + let E = v.length; if (!E) return; const w = this.sprite.attributes, k = this.sprite.uniforms; if (!k) throw new Error("Uniforms not defined"); - var $ = v * 0.5, L = f * 0.5; + var $ = _ * 0.5, L = f * 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(k.projectionMatrix, !1, d.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(k.map, 0); - var z = 0, F = 0, R = o.fog; - R ? (this.gl.uniform3f(k.fogColor, R.color.r, R.color.g, R.color.b), this.gl.uniform1f(k.fogNear, R.near), this.gl.uniform1f(k.fogFar, R.far), this.gl.uniform1i(k.fogType, 1), z = 1, F = 1) : (this.gl.uniform1i(k.fogType, 0), z = 0, F = 0); - var P; - let U, N, B, W, V = []; - for (P = 0; P < E; P++) - U = _[P], N = U.material, N && (N.depthTest == !1 && !y || !U.visible || N.opacity === 0 || (N.useScreenCoordinates ? U.z = -U.position.z : (U._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse, U.matrixWorld), U.z = -U._modelViewMatrix.elements[14]))); - for (_.sort(s), P = 0; P < E; P++) - if (U = _[P], N = U.material, !!N && !(!U.visible || N.opacity === 0) && N.map && N.map.image && N.map.image.width) { - this.gl.uniform1f(k?.alphaTest || null, N.alphaTest); - var G = N.map.image.width, H = N.map.image.height; - V[0] = G * this.renderer.devicePixelRatio / v, V[1] = H * this.renderer.devicePixelRatio / f, N.useScreenCoordinates === !0 ? (this.gl.uniform1i(k.useScreenCoordinates, 1), this.gl.uniform3f(k.screenPosition, (U.position.x * this.renderer.devicePixelRatio - $) / $, (L - U.position.y * this.renderer.devicePixelRatio) / L, Math.max(0, Math.min(1, U.position.z)))) : (this.gl.uniform1i(k.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(k.modelViewMatrix, !1, U._modelViewMatrix.elements)), o.fog && N.fog ? W = F : W = 0, z !== W && (this.gl.uniform1i(k.fogType, W), z = W), B = 1 / (N.scaleByViewport ? f : 1), V[0] *= B * U.scale.x, V[1] *= B * U.scale.y; - let Q = (x = N?.alignment) === null || x === void 0 ? void 0 : x.x, te = (M = N?.alignment) === null || M === void 0 ? void 0 : M.y; - N.screenOffset && (Q = (Q || 0) + 2 * N.screenOffset.x / G, te = (te || 0) + 2 * N.screenOffset.y / H), this.gl.uniform2f(k.uvScale, ((m = N?.uvScale) === null || m === void 0 ? void 0 : m.x) || 1, ((l = N?.uvScale) === null || l === void 0 ? void 0 : l.y) || 1), this.gl.uniform2f(k.uvOffset, ((u = N?.uvOffset) === null || u === void 0 ? void 0 : u.x) || 0, ((p = N?.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(k.alignment, Q || 0, te || 0), this.gl.uniform1f(k.opacity, N.opacity), this.gl.uniform3f(k.color, ((g = N?.color) === null || g === void 0 ? void 0 : g.r) || 0, ((b = N?.color) === null || b === void 0 ? void 0 : b.g) || 0, ((c = N?.color) === null || c === void 0 ? void 0 : c.b) || 0), this.gl.uniform1f(k.rotation, U.rotation), this.gl.uniform2fv(k.scale, V), this.renderer.setDepthTest(N.depthTest), this.renderer.setDepthWrite(N.depthWrite), this.renderer.setTexture(N.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); + var I = 0, F = 0, P = o.fog; + P ? (this.gl.uniform3f(k.fogColor, P.color.r, P.color.g, P.color.b), this.gl.uniform1f(k.fogNear, P.near), this.gl.uniform1f(k.fogFar, P.far), this.gl.uniform1i(k.fogType, 1), I = 1, F = 1) : (this.gl.uniform1i(k.fogType, 0), I = 0, F = 0); + var B; + let G, U, R, W, H = []; + for (B = 0; B < E; B++) + G = v[B], U = G.material, U && (U.depthTest == !1 && !y || !G.visible || U.opacity === 0 || (U.useScreenCoordinates ? G.z = -G.position.z : (G._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse, G.matrixWorld), G.z = -G._modelViewMatrix.elements[14]))); + for (v.sort(s), B = 0; B < E; B++) + if (G = v[B], U = G.material, !!U && !(!G.visible || U.opacity === 0) && U.map && U.map.image && U.map.image.width) { + this.gl.uniform1f((k == null ? void 0 : k.alphaTest) || null, U.alphaTest); + var N = U.map.image.width, V = U.map.image.height; + H[0] = N * this.renderer.devicePixelRatio / _, H[1] = V * this.renderer.devicePixelRatio / f, U.useScreenCoordinates === !0 ? (this.gl.uniform1i(k.useScreenCoordinates, 1), this.gl.uniform3f(k.screenPosition, (G.position.x * this.renderer.devicePixelRatio - $) / $, (L - G.position.y * this.renderer.devicePixelRatio) / L, Math.max(0, Math.min(1, G.position.z)))) : (this.gl.uniform1i(k.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(k.modelViewMatrix, !1, G._modelViewMatrix.elements)), o.fog && U.fog ? W = F : W = 0, I !== W && (this.gl.uniform1i(k.fogType, W), I = W), R = 1 / (U.scaleByViewport ? f : 1), H[0] *= R * G.scale.x, H[1] *= R * G.scale.y; + let J = (x = U == null ? void 0 : U.alignment) === null || x === void 0 ? void 0 : x.x, re = (M = U == null ? void 0 : U.alignment) === null || M === void 0 ? void 0 : M.y; + U.screenOffset && (J = (J || 0) + 2 * U.screenOffset.x / N, re = (re || 0) + 2 * U.screenOffset.y / V), this.gl.uniform2f(k.uvScale, ((m = U == null ? void 0 : U.uvScale) === null || m === void 0 ? void 0 : m.x) || 1, ((l = U == null ? void 0 : U.uvScale) === null || l === void 0 ? void 0 : l.y) || 1), this.gl.uniform2f(k.uvOffset, ((u = U == null ? void 0 : U.uvOffset) === null || u === void 0 ? void 0 : u.x) || 0, ((p = U == null ? void 0 : U.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(k.alignment, J || 0, re || 0), this.gl.uniform1f(k.opacity, U.opacity), this.gl.uniform3f(k.color, ((g = U == null ? void 0 : U.color) === null || g === void 0 ? void 0 : g.r) || 0, ((b = U == null ? void 0 : U.color) === null || b === void 0 ? void 0 : b.g) || 0, ((c = U == null ? void 0 : U.color) === null || c === void 0 ? void 0 : c.b) || 0), this.gl.uniform1f(k.rotation, G.rotation), this.gl.uniform2fv(k.scale, H), this.renderer.setDepthTest(U.depthTest), this.renderer.setDepthWrite(U.depthWrite), this.renderer.setTexture(U.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); } this.gl.enable(this.gl.CULL_FACE); } createProgram(o, d) { if (!this.gl) throw new Error("WebGL Rendering context not found"); - var v = this.gl.createProgram(); - if (!v) + var _ = this.gl.createProgram(); + if (!_) throw new Error("Error creating webgl program"); var f = this.gl.createShader(this.gl.FRAGMENT_SHADER), y = this.gl.createShader(this.gl.VERTEX_SHADER); if (!f) @@ -28462,7 +28484,7 @@ ATOM`, b); throw new Error(`Error compiling shader: ${this.gl.getShaderInfoLog(f)} ${this.gl.getShaderInfoLog(y)}`); - return this.gl.attachShader(v, f), this.gl.attachShader(v, y), this.gl.linkProgram(v), this.gl.getProgramParameter(v, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), v; + return this.gl.attachShader(_, f), this.gl.attachShader(_, y), this.gl.linkProgram(_), this.gl.getProgramParameter(_, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), _; } } function s(h, o) { @@ -28618,7 +28640,7 @@ ATOM`, b); /* harmony export */ RGBAFormat: () => ( /* binding */ - v + _ ), /* harmony export */ UnsignedByteType: () => ( @@ -28627,7 +28649,7 @@ ATOM`, b); ) /* harmony export */ }); - const r = 1001, a = 1006, s = 1007, h = 1008, o = 1009, d = 1010, v = 1021, f = 1022, y = 1023; + const r = 1001, a = 1006, s = 1007, h = 1008, o = 1009, d = 1010, _ = 1021, f = 1022, y = 1023; } ), /***/ @@ -28814,7 +28836,7 @@ ATOM`, b); /* harmony export */ Geometry: () => ( /* binding */ - v + _ ), /* harmony export */ GeometryGroup: () => ( @@ -28894,8 +28916,8 @@ ATOM`, b); throw new Error("vertex array not initialized"); if (!M) throw new Error("normal array not initialized"); - for (var m, l, u, p, g, b, c, _ = 0; _ < A.length / 3; ++_) - m = A[_ * 3] * 3, l = A[_ * 3 + 1] * 3, u = A[_ * 3 + 2] * 3, p = new s.Vector3(x[m], x[m + 1], x[m + 2]), g = new s.Vector3(x[l], x[l + 1], x[l + 2]), b = new s.Vector3(x[u], x[u + 1], x[u + 2]), p.subVectors(p, g), b.subVectors(b, g), b.cross(p), c = b, c.normalize(), M[m] += c.x, M[l] += c.x, M[u] += c.x, M[m + 1] += c.y, M[l + 1] += c.y, M[u + 1] += c.y, M[m + 2] += c.z, M[l + 2] += c.z, M[u + 2] += c.z; + for (var m, l, u, p, g, b, c, v = 0; v < A.length / 3; ++v) + m = A[v * 3] * 3, l = A[v * 3 + 1] * 3, u = A[v * 3 + 2] * 3, p = new s.Vector3(x[m], x[m + 1], x[m + 2]), g = new s.Vector3(x[l], x[l + 1], x[l + 2]), b = new s.Vector3(x[u], x[u + 1], x[u + 2]), p.subVectors(p, g), b.subVectors(b, g), b.cross(p), c = b, c.normalize(), M[m] += c.x, M[l] += c.x, M[u] += c.x, M[m + 1] += c.y, M[l + 1] += c.y, M[u + 1] += c.y, M[m + 2] += c.z, M[l + 2] += c.z, M[u + 2] += c.z; } } /* sets line index array from face arr @@ -28915,116 +28937,116 @@ ATOM`, b); } } vrml(A, x) { - var M, m, l, u, p, g, b, c, _, E, w, k, $, L, z, F, R, P, U = ""; - if (U += A + `Shape { + var M, m, l, u, p, g, b, c, v, E, w, k, $, L, I, F, P, B, G = ""; + if (G += A + `Shape { ` + A + ` appearance Appearance { ` + A + ` material Material { -` + A + " diffuseColor " + ((M = x?.color) === null || M === void 0 ? void 0 : M.r) + " " + ((m = x?.color) === null || m === void 0 ? void 0 : m.g) + " " + ((l = x?.color) === null || l === void 0 ? void 0 : l.b) + ` +` + A + " diffuseColor " + ((M = x == null ? void 0 : x.color) === null || M === void 0 ? void 0 : M.r) + " " + ((m = x == null ? void 0 : x.color) === null || m === void 0 ? void 0 : m.g) + " " + ((l = x == null ? void 0 : x.color) === null || l === void 0 ? void 0 : l.b) + ` `, x.wireframe && this.colorArray) { - let B = this.colorArray; - U += A + " emissiveColor " + B[0] + " " + B[1] + " " + B[2] + ` + let R = this.colorArray; + G += A + " emissiveColor " + R[0] + " " + R[1] + " " + R[2] + ` `; } - x?.transparent && (U += A + " transparency " + (1 - x.opacity) + ` -`), U += A + ` } -`, U += A + ` } + x != null && x.transparent && (G += A + " transparency " + (1 - x.opacity) + ` +`), G += A + ` } +`, G += A + ` } `; - var N = A; + var U = A; if (A += " ", x instanceof r.LineBasicMaterial || x.wireframe) { - U += A + `geometry IndexedLineSet { + G += A + `geometry IndexedLineSet { ` + A + ` colorPerVertex TRUE ` + A + ` coord Coordinate { ` + A + ` point [ `; - let B, W, V; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - B = (u = this.vertexArray) === null || u === void 0 ? void 0 : u[H], W = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[H + 1], V = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[H + 2], U += A + " " + B + " " + W + " " + V + `, + let R, W, H; + for (let N = 0; N < this.vertices; ++N) { + let V = N * 3; + R = (u = this.vertexArray) === null || u === void 0 ? void 0 : u[V], W = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[V + 1], H = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[V + 2], G += A + " " + R + " " + W + " " + H + `, `; } - if (U += A + ` ] -`, U += A + ` } + if (G += A + ` ] +`, G += A + ` } `, this.colorArray && !x.wireframe) { - U += A + ` color Color { + G += A + ` color Color { ` + A + ` color [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - B = this.colorArray[H], W = this.colorArray[H + 1], V = this.colorArray[H + 2], U += A + " " + B + " " + W + " " + V + `, + for (let N = 0; N < this.vertices; ++N) { + let V = N * 3; + R = this.colorArray[V], W = this.colorArray[V + 1], H = this.colorArray[V + 2], G += A + " " + R + " " + W + " " + H + `, `; } - U += A + ` ] -`, U += A + ` } + G += A + ` ] +`, G += A + ` } `; } - if (U += A + ` coordIndex [ + if (G += A + ` coordIndex [ `, x.wireframe && this.faceArray) - for (let G = 0; G < this.faceidx; G += 3) - B = (b = this.faceArray) === null || b === void 0 ? void 0 : b[G], W = (c = this.faceArray) === null || c === void 0 ? void 0 : c[G + 1], V = (_ = this.faceArray) === null || _ === void 0 ? void 0 : _[G + 2], U += A + " " + B + ", " + W + ", " + V + `, -1, + for (let N = 0; N < this.faceidx; N += 3) + R = (b = this.faceArray) === null || b === void 0 ? void 0 : b[N], W = (c = this.faceArray) === null || c === void 0 ? void 0 : c[N + 1], H = (v = this.faceArray) === null || v === void 0 ? void 0 : v[N + 2], G += A + " " + R + ", " + W + ", " + H + `, -1, `; else - for (let G = 0; G < this.vertices - 1; G += 2) - U += A + " " + G + ", " + (G + 1) + `, -1, + for (let N = 0; N < this.vertices - 1; N += 2) + G += A + " " + N + ", " + (N + 1) + `, -1, `; - U += A + ` ] -`, U += A + `} + G += A + ` ] +`, G += A + `} `; } else { - U += A + `geometry IndexedFaceSet { + G += A + `geometry IndexedFaceSet { ` + A + ` colorPerVertex TRUE ` + A + ` normalPerVertex TRUE ` + A + ` solid FALSE -`, U += A + ` coord Coordinate { +`, G += A + ` coord Coordinate { ` + A + ` point [ `; - let B, W, V; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - B = (E = this.vertexArray) === null || E === void 0 ? void 0 : E[H], W = (w = this.vertexArray) === null || w === void 0 ? void 0 : w[H + 1], V = (k = this.vertexArray) === null || k === void 0 ? void 0 : k[H + 2], U += A + " " + B + " " + W + " " + V + `, + let R, W, H; + for (let N = 0; N < this.vertices; ++N) { + let V = N * 3; + R = (E = this.vertexArray) === null || E === void 0 ? void 0 : E[V], W = (w = this.vertexArray) === null || w === void 0 ? void 0 : w[V + 1], H = (k = this.vertexArray) === null || k === void 0 ? void 0 : k[V + 2], G += A + " " + R + " " + W + " " + H + `, `; } - U += A + ` ] -`, U += A + ` } -`, U += A + ` normal Normal { + G += A + ` ] +`, G += A + ` } +`, G += A + ` normal Normal { ` + A + ` vector [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - B = ($ = this.normalArray) === null || $ === void 0 ? void 0 : $[H], W = (L = this.normalArray) === null || L === void 0 ? void 0 : L[H + 1], V = (z = this.normalArray) === null || z === void 0 ? void 0 : z[H + 2], U += A + " " + B + " " + W + " " + V + `, + for (let N = 0; N < this.vertices; ++N) { + let V = N * 3; + R = ($ = this.normalArray) === null || $ === void 0 ? void 0 : $[V], W = (L = this.normalArray) === null || L === void 0 ? void 0 : L[V + 1], H = (I = this.normalArray) === null || I === void 0 ? void 0 : I[V + 2], G += A + " " + R + " " + W + " " + H + `, `; } - if (U += A + ` ] -`, U += A + ` } + if (G += A + ` ] +`, G += A + ` } `, this.colorArray) { - U += A + ` color Color { + G += A + ` color Color { ` + A + ` color [ `; - for (let G = 0; G < this.vertices; ++G) { - let H = G * 3; - B = this.colorArray[H], W = this.colorArray[H + 1], V = this.colorArray[H + 2], U += A + " " + B + " " + W + " " + V + `, + for (let N = 0; N < this.vertices; ++N) { + let V = N * 3; + R = this.colorArray[V], W = this.colorArray[V + 1], H = this.colorArray[V + 2], G += A + " " + R + " " + W + " " + H + `, `; } - U += A + ` ] -`, U += A + ` } + G += A + ` ] +`, G += A + ` } `; } - U += A + ` coordIndex [ + G += A + ` coordIndex [ `; - for (let G = 0; G < this.faceidx; G += 3) - B = (F = this.faceArray) === null || F === void 0 ? void 0 : F[G], W = (R = this.faceArray) === null || R === void 0 ? void 0 : R[G + 1], V = (P = this.faceArray) === null || P === void 0 ? void 0 : P[G + 2], U += A + " " + B + ", " + W + ", " + V + `, -1, + for (let N = 0; N < this.faceidx; N += 3) + R = (F = this.faceArray) === null || F === void 0 ? void 0 : F[N], W = (P = this.faceArray) === null || P === void 0 ? void 0 : P[N + 1], H = (B = this.faceArray) === null || B === void 0 ? void 0 : B[N + 2], G += A + " " + R + ", " + W + ", " + H + `, -1, `; - U += A + ` ] -`, U += A + `} + G += A + ` ] +`, G += A + `} `; } - return U += N + "}", U; + return G += U + "}", G; } truncateArrayBuffers(A = !0, x = !1) { var M = this.vertexArray, m = this.colorArray, l = this.normalArray, u = this.faceArray, p = this.lineArray, g = this.radiusArray; - this.vertexArray = M?.subarray(0, this.vertices * 3) || null, this.colorArray = m?.subarray(0, this.vertices * 3) || null, A ? (this.normalArray = l?.subarray(0, this.vertices * 3) || null, this.faceArray = u?.subarray(0, this.faceidx) || null, this.lineidx > 0 ? this.lineArray = p?.subarray(0, this.lineidx) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), g && (this.radiusArray = g.subarray(0, this.vertices)), x && (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 = (M == null ? void 0 : M.subarray(0, this.vertices * 3)) || null, this.colorArray = (m == null ? void 0 : m.subarray(0, this.vertices * 3)) || null, A ? (this.normalArray = (l == null ? void 0 : l.subarray(0, this.vertices * 3)) || null, this.faceArray = (u == null ? void 0 : u.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), g && (this.radiusArray = g.subarray(0, this.vertices)), x && (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 v extends a.EventDispatcher { + class _ extends a.EventDispatcher { constructor(A = !1, x = !1, M = !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 = f++, this.mesh = A, this.radii = x, this.offset = M; } @@ -29032,7 +29054,7 @@ ATOM`, b); // new group if necessary updateGeoGroup(A = 0) { var x, M = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null; - return (!M || M.vertices + A > (((x = M?.vertexArray) === null || x === void 0 ? void 0 : x.length) || 0) / 3) && (M = this.addGeoGroup()), M; + return (!M || M.vertices + A > (((x = M == null ? void 0 : M.vertexArray) === null || x === void 0 ? void 0 : x.length) || 0) / 3) && (M = this.addGeoGroup()), M; } //return comma separated list of IndexedFace (or Line) sets from geometry groups vrml(A, x) { @@ -29300,8 +29322,8 @@ ATOM`, b); ); const s = (p, g) => p.distance - g.distance, h = new r.Matrix4(); class o { - constructor(g, b, c, _) { - this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new r.Ray(g, b), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = _ || 0, this.far = c || 1 / 0; + constructor(g, b, c, v) { + this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new r.Ray(g, b), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = v || 0, this.far = c || 1 / 0; } set(g, b) { this.ray.set(g, b); @@ -29310,58 +29332,58 @@ ATOM`, b); b.ortho ? (this.ray.origin.set(g.x, g.y, (b.near + b.far) / (b.near - b.far)).unproject(b), this.ray.direction.set(0, 0, -1).transformDirection(b.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(b.matrixWorld), this.ray.direction.set(g.x, g.y, g.z), b.projectionMatrixInverse.getInverse(b.projectionMatrix), h.multiplyMatrices(b.matrixWorld, b.projectionMatrixInverse), this.ray.direction.applyProjection(h), this.ray.direction.sub(this.ray.origin).normalize()); } intersectObjects(g, b) { - for (var c = [], _ = 0, E = b.length; _ < E; _++) - u(g, b[_], this, c); + for (var c = [], v = 0, E = b.length; v < E; v++) + u(g, b[v], this, c); return c.sort(s), c; } } const d = (p) => Math.min(Math.max(p, -1), 1); - var v = new a.Sphere(), f = new a.Cylinder(), y = new a.Triangle(), A = new r.Vector3(), x = new r.Vector3(), M = new r.Vector3(), m = new r.Vector3(), l = new r.Vector3(); + var _ = new a.Sphere(), f = new a.Cylinder(), y = new a.Triangle(), A = new r.Vector3(), x = new r.Vector3(), M = new r.Vector3(), m = new r.Vector3(), l = new r.Vector3(); function u(p, g, b, c) { if (l.getPositionFromMatrix(p.matrixWorld), g.intersectionShape === void 0) return c; - var _ = g.intersectionShape, E = b.linePrecision; + var v = g.intersectionShape, E = b.linePrecision; E *= p.matrixWorld.getMaxScaleOnAxis(); var w = E * E; - if (g.boundingSphere !== void 0 && g.boundingSphere instanceof a.Sphere && (v.copy(g.boundingSphere), v.applyMatrix4(p.matrixWorld), !b.ray.isIntersectionSphere(v))) + if (g.boundingSphere !== void 0 && g.boundingSphere instanceof a.Sphere && (_.copy(g.boundingSphere), _.applyMatrix4(p.matrixWorld), !b.ray.isIntersectionSphere(_))) return c; - var k, $, L, z, F, R, P, U, N, B, W, V, G, H; - for (k = 0, $ = _.triangle.length; k < $; k++) - if (_.triangle[k] instanceof a.Triangle) { - if (y.copy(_.triangle[k]), y.applyMatrix4(p.matrixWorld), L = y.getNormal(), z = b.ray.direction.dot(L), z >= 0 || (A.subVectors(y.a, b.ray.origin), P = L.dot(A) / z, P < 0)) + var k, $, L, I, F, P, B, G, U, R, W, H, N, V; + for (k = 0, $ = v.triangle.length; k < $; k++) + if (v.triangle[k] instanceof a.Triangle) { + if (y.copy(v.triangle[k]), y.applyMatrix4(p.matrixWorld), L = y.getNormal(), I = b.ray.direction.dot(L), I >= 0 || (A.subVectors(y.a, b.ray.origin), B = L.dot(A) / I, B < 0)) continue; - x.copy(b.ray.direction).multiplyScalar(P).add(b.ray.origin), x.sub(y.a), M.copy(y.b).sub(y.a), m.copy(y.c).sub(y.a); - var Q = M.dot(m), te = M.lengthSq(), ee = m.lengthSq(); - if (V = (te * x.dot(m) - Q * x.dot(M)) / (te * ee - Q * Q), V < 0 || V > 1 || (W = (x.dot(M) - V * Q) / te, W < 0 || W > 1 || W + V > 1)) + x.copy(b.ray.direction).multiplyScalar(B).add(b.ray.origin), x.sub(y.a), M.copy(y.b).sub(y.a), m.copy(y.c).sub(y.a); + var J = M.dot(m), re = M.lengthSq(), te = m.lengthSq(); + if (H = (re * x.dot(m) - J * x.dot(M)) / (re * te - J * J), H < 0 || H > 1 || (W = (x.dot(M) - H * J) / re, W < 0 || W > 1 || W + H > 1)) continue; - c.push({ clickable: g, distance: P }); + c.push({ clickable: g, distance: B }); } - for (k = 0, $ = _.cylinder.length; k < $; k++) - if (_.cylinder[k] instanceof a.Cylinder) { - if (f.copy(_.cylinder[k]), f.applyMatrix4(p.matrixWorld), A.subVectors(f.c1, b.ray.origin), F = A.dot(f.direction), R = A.dot(b.ray.direction), z = d(b.ray.direction.dot(f.direction)), N = 1 - z * z, N === 0) + for (k = 0, $ = v.cylinder.length; k < $; k++) + if (v.cylinder[k] instanceof a.Cylinder) { + if (f.copy(v.cylinder[k]), f.applyMatrix4(p.matrixWorld), A.subVectors(f.c1, b.ray.origin), F = A.dot(f.direction), P = A.dot(b.ray.direction), I = d(b.ray.direction.dot(f.direction)), U = 1 - I * I, U === 0) continue; - G = (z * R - F) / N, H = (R - z * F) / N, x.copy(f.direction).multiplyScalar(G).add(f.c1), M.copy(b.ray.direction).multiplyScalar(H).add(b.ray.origin), U = m.subVectors(x, M).lengthSq(); - var ce = f.radius * f.radius; - if (U <= ce) { - if (B = (z * F - R) * (z * F - R) - N * (A.lengthSq() - F * F - ce), B <= 0 ? V = P = Math.sqrt(U) : V = P = (R - z * F - Math.sqrt(B)) / N, W = z * V - F, W < 0 || W * W > f.lengthSq() || V < 0) + N = (I * P - F) / U, V = (P - I * F) / U, x.copy(f.direction).multiplyScalar(N).add(f.c1), M.copy(b.ray.direction).multiplyScalar(V).add(b.ray.origin), G = m.subVectors(x, M).lengthSq(); + var ue = f.radius * f.radius; + if (G <= ue) { + if (R = (I * F - P) * (I * F - P) - U * (A.lengthSq() - F * F - ue), R <= 0 ? H = B = Math.sqrt(G) : H = B = (P - I * F - Math.sqrt(R)) / U, W = I * H - F, W < 0 || W * W > f.lengthSq() || H < 0) continue; - c.push({ clickable: g, distance: P }); + c.push({ clickable: g, distance: B }); } } - for (k = 0, $ = _.line.length; k < $; k += 2) { - x.copy(_.line[k]), x.applyMatrix4(p.matrixWorld), M.copy(_.line[k + 1]), M.applyMatrix4(p.matrixWorld), m.subVectors(M, x); - var fe = m.lengthSq(); + for (k = 0, $ = v.line.length; k < $; k += 2) { + x.copy(v.line[k]), x.applyMatrix4(p.matrixWorld), M.copy(v.line[k + 1]), M.applyMatrix4(p.matrixWorld), m.subVectors(M, x); + var ie = m.lengthSq(); m.normalize(), A.subVectors(x, b.ray.origin); - var oe = A.dot(m); - R = A.dot(b.ray.direction), z = d(b.ray.direction.dot(m)), N = 1 - z * z, N !== 0 && (G = (z * R - oe) / N, H = (R - z * oe) / N, x.add(m.multiplyScalar(G)), M.copy(b.ray.direction).multiplyScalar(H).add(b.ray.origin), U = m.subVectors(M, x).lengthSq(), U < w && G * G < fe && c.push({ clickable: g, distance: H })); - } - for (k = 0, $ = _.sphere.length; k < $; k++) - if (_.sphere[k] instanceof a.Sphere && (v.copy(_.sphere[k]), v.applyMatrix4(p.matrixWorld), b.ray.isIntersectionSphere(v))) { - x.subVectors(v.center, b.ray.origin); - var he = x.dot(b.ray.direction); - if (B = he * he - (x.lengthSq() - v.radius * v.radius), he < 0) + var ae = A.dot(m); + P = A.dot(b.ray.direction), I = d(b.ray.direction.dot(m)), U = 1 - I * I, U !== 0 && (N = (I * P - ae) / U, V = (P - I * ae) / U, x.add(m.multiplyScalar(N)), M.copy(b.ray.direction).multiplyScalar(V).add(b.ray.origin), G = m.subVectors(M, x).lengthSq(), G < w && N * N < ie && c.push({ clickable: g, distance: V })); + } + for (k = 0, $ = v.sphere.length; k < $; k++) + if (v.sphere[k] instanceof a.Sphere && (_.copy(v.sphere[k]), _.applyMatrix4(p.matrixWorld), b.ray.isIntersectionSphere(_))) { + x.subVectors(_.center, b.ray.origin); + var ce = x.dot(b.ray.direction); + if (R = ce * ce - (x.lengthSq() - _.radius * _.radius), ce < 0) return c; - B <= 0 ? P = he : P = he - Math.sqrt(B), c.push({ clickable: g, distance: P }); + R <= 0 ? B = ce : B = ce - Math.sqrt(R), c.push({ clickable: g, distance: B }); } return c; } @@ -29504,7 +29526,7 @@ ATOM`, b); /* harmony export */ UVMapping: () => ( /* reexport safe */ - v.UVMapping + _.UVMapping ), /* harmony export */ intersectObject: () => ( @@ -29531,7 +29553,7 @@ ATOM`, b); ), d = t( /*! ./Texture */ "./src/WebGL/core/Texture.ts" - ), v = t( + ), _ = t( /*! ./UVMapping */ "./src/WebGL/core/UVMapping.ts" ); @@ -29568,7 +29590,7 @@ ATOM`, b); /* harmony export */ Cylinder: () => ( /* reexport safe */ - v.Cylinder + _.Cylinder ), /* harmony export */ DoubleSide: () => ( @@ -29768,7 +29790,7 @@ ATOM`, b); /* harmony export */ Sphere: () => ( /* reexport safe */ - v.Sphere + _.Sphere ), /* harmony export */ SphereImposterMaterial: () => ( @@ -29828,7 +29850,7 @@ ATOM`, b); /* harmony export */ Triangle: () => ( /* reexport safe */ - v.Triangle + _.Triangle ), /* harmony export */ UVMapping: () => ( @@ -29965,7 +29987,7 @@ ATOM`, b); ), d = t( /*! ./shaders */ "./src/WebGL/shaders/index.ts" - ), v = t( + ), _ = t( /*! ./shapes */ "./src/WebGL/shapes/index.ts" ), f = t( @@ -30511,7 +30533,7 @@ ATOM`, b); /* harmony export */ MeshOutlineMaterial: () => ( /* reexport safe */ - v.MeshOutlineMaterial + _.MeshOutlineMaterial ), /* harmony export */ SphereImposterMaterial: () => ( @@ -30563,7 +30585,7 @@ ATOM`, b); ), d = t( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" - ), v = t( + ), _ = t( /*! ./MeshOutlineMaterial */ "./src/WebGL/materials/MeshOutlineMaterial.ts" ), f = t( @@ -30635,8 +30657,8 @@ ATOM`, b); return this.x *= s, this.y *= s, this.z *= s, this.w *= s, this; } multiplyQuaternions(s, h) { - const o = s.x, d = s.y, v = s.z, f = s.w, y = h.x, A = h.y, x = h.z, M = h.w; - return this.x = o * M + f * y + d * x - v * A, this.y = d * M + f * A + v * y - o * x, this.z = v * M + f * x + o * A - d * y, this.w = f * M - o * y - d * A - v * x, this; + const o = s.x, d = s.y, _ = s.z, f = s.w, y = h.x, A = h.y, x = h.z, M = h.w; + return this.x = o * M + f * y + d * x - _ * A, this.y = d * M + f * A + _ * y - o * x, this.z = _ * M + f * x + o * A - d * y, this.w = f * M - o * y - d * A - _ * x, this; } sub(s) { return this.x -= s.x, this.y -= s.y, this.z -= s.z, this.w -= s.w, this; @@ -30645,8 +30667,8 @@ ATOM`, b); return new r(this.x, this.y, this.z, this.w); } setFromEuler(s) { - const h = Math.cos(s.x / 2), o = Math.cos(s.y / 2), d = Math.cos(s.z / 2), v = Math.sin(s.x / 2), f = Math.sin(s.y / 2), y = Math.sin(s.z / 2); - return this.x = v * o * d + h * f * y, this.y = h * f * d - v * o * y, this.z = h * o * y + v * f * d, this.w = h * o * d - v * f * y, this; + const h = Math.cos(s.x / 2), o = Math.cos(s.y / 2), d = Math.cos(s.z / 2), _ = Math.sin(s.x / 2), f = Math.sin(s.y / 2), y = Math.sin(s.z / 2); + return this.x = _ * o * d + h * f * y, this.y = h * f * d - _ * o * y, this.z = h * o * y + _ * f * d, this.w = h * o * d - _ * f * y, this; } } } @@ -30797,18 +30819,18 @@ ATOM`, b); ), a = t( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), s, h, o, d, v; + ), s, h, o, d, _; class f { - constructor(m = 1, l = 0, u = 0, p = 0, g = 0, b = 1, c = 0, _ = 0, E = 0, w = 0, k = 1, $ = 0, L = 0, z = 0, F = 0, R = 1) { - typeof m < "u" && typeof m != "number" ? this.elements = new Float32Array(m) : (this.elements = new Float32Array(16), this.elements[0] = m, this.elements[4] = l, this.elements[8] = u, this.elements[12] = p, this.elements[1] = g, this.elements[5] = b, this.elements[9] = c, this.elements[13] = _, this.elements[2] = E, this.elements[6] = w, this.elements[10] = k, this.elements[14] = $, this.elements[3] = L, this.elements[7] = z, this.elements[11] = F, this.elements[15] = R); + constructor(m = 1, l = 0, u = 0, p = 0, g = 0, b = 1, c = 0, v = 0, E = 0, w = 0, k = 1, $ = 0, L = 0, I = 0, F = 0, P = 1) { + typeof m < "u" && typeof m != "number" ? this.elements = new Float32Array(m) : (this.elements = new Float32Array(16), this.elements[0] = m, this.elements[4] = l, this.elements[8] = u, this.elements[12] = p, this.elements[1] = g, this.elements[5] = b, this.elements[9] = c, this.elements[13] = v, this.elements[2] = E, this.elements[6] = w, this.elements[10] = k, this.elements[14] = $, this.elements[3] = L, this.elements[7] = I, this.elements[11] = F, this.elements[15] = P); } // eslint-disable-next-line no-unused-vars, class-methods-use-this makeScale(m, l, u) { throw new Error("Method not implemented."); } - set(m, l, u, p, g, b, c, _, E, w, k, $, L, z, F, R) { - const P = this.elements; - return P[0] = m, P[4] = l, P[8] = u, P[12] = p, P[1] = g, P[5] = b, P[9] = c, P[13] = _, P[2] = E, P[6] = w, P[10] = k, P[14] = $, P[3] = L, P[7] = z, P[11] = F, P[15] = R, this; + set(m, l, u, p, g, b, c, v, E, w, k, $, L, I, F, P) { + const B = this.elements; + return B[0] = m, B[4] = l, B[8] = u, B[12] = p, B[1] = g, B[5] = b, B[9] = c, B[13] = v, B[2] = E, B[6] = w, B[10] = k, B[14] = $, B[3] = L, B[7] = I, B[11] = F, B[15] = P, this; } identity() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this; @@ -30822,21 +30844,21 @@ ATOM`, b); return new A(m[0], m[4], m[8], m[1], m[5], m[9], m[2], m[6], m[10]); } setRotationFromEuler(m, l) { - const u = this.elements, { x: p, y: g, z: b } = m, c = Math.cos(p), _ = Math.sin(p), E = Math.cos(g), w = Math.sin(g), k = Math.cos(b), $ = Math.sin(b); + const u = this.elements, { x: p, y: g, z: b } = m, c = Math.cos(p), v = Math.sin(p), E = Math.cos(g), w = Math.sin(g), k = Math.cos(b), $ = Math.sin(b); if (l === void 0 || l === "XYZ") { - const L = c * k, z = c * $, F = _ * k, R = _ * $; - u[0] = E * k, u[4] = -E * $, u[8] = w, u[1] = z + F * w, u[5] = L - R * w, u[9] = -_ * E, u[2] = R - L * w, u[6] = F + z * w, u[10] = c * E; + const L = c * k, I = c * $, F = v * k, P = v * $; + u[0] = E * k, u[4] = -E * $, u[8] = w, u[1] = I + F * w, u[5] = L - P * w, u[9] = -v * E, u[2] = P - L * w, u[6] = F + I * w, u[10] = c * E; } else console.error(`Error with matrix4 setRotationFromEuler. Order: ${l}`); return this; } setRotationFromQuaternion(m) { - const l = this.elements, { x: u, y: p, z: g, w: b } = m, c = u + u, _ = p + p, E = g + g, w = u * c, k = u * _, $ = u * E, L = p * _, z = p * E, F = g * E, R = b * c, P = b * _, U = b * E; - return l[0] = 1 - (L + F), l[4] = k - U, l[8] = $ + P, l[1] = k + U, l[5] = 1 - (w + F), l[9] = z - R, l[2] = $ - P, l[6] = z + R, l[10] = 1 - (w + L), this; + const l = this.elements, { x: u, y: p, z: g, w: b } = m, c = u + u, v = p + p, E = g + g, w = u * c, k = u * v, $ = u * E, L = p * v, I = p * E, F = g * E, P = b * c, B = b * v, G = b * E; + return l[0] = 1 - (L + F), l[4] = k - G, l[8] = $ + B, l[1] = k + G, l[5] = 1 - (w + F), l[9] = I - P, l[2] = $ - B, l[6] = I + P, l[10] = 1 - (w + L), this; } multiplyMatrices(m, l) { - const u = m.elements, p = l.elements, g = this.elements, b = u[0], c = u[4], _ = u[8], E = u[12], w = u[1], k = u[5], $ = u[9], L = u[13], z = u[2], F = u[6], R = u[10], P = u[14], U = u[3], N = u[7], B = u[11], W = u[15], V = p[0], G = p[4], H = p[8], Q = p[12], te = p[1], ee = p[5], ce = p[9], fe = p[13], oe = p[2], he = p[6], Ae = p[10], Se = p[14], Ie = p[3], pe = p[7], le = p[11], ne = p[15]; - return g[0] = b * V + c * te + _ * oe + E * Ie, g[4] = b * G + c * ee + _ * he + E * pe, g[8] = b * H + c * ce + _ * Ae + E * le, g[12] = b * Q + c * fe + _ * Se + E * ne, g[1] = w * V + k * te + $ * oe + L * Ie, g[5] = w * G + k * ee + $ * he + L * pe, g[9] = w * H + k * ce + $ * Ae + L * le, g[13] = w * Q + k * fe + $ * Se + L * ne, g[2] = z * V + F * te + R * oe + P * Ie, g[6] = z * G + F * ee + R * he + P * pe, g[10] = z * H + F * ce + R * Ae + P * le, g[14] = z * Q + F * fe + R * Se + P * ne, g[3] = U * V + N * te + B * oe + W * Ie, g[7] = U * G + N * ee + B * he + W * pe, g[11] = U * H + N * ce + B * Ae + W * le, g[15] = U * Q + N * fe + B * Se + W * ne, this; + const u = m.elements, p = l.elements, g = this.elements, b = u[0], c = u[4], v = u[8], E = u[12], w = u[1], k = u[5], $ = u[9], L = u[13], I = u[2], F = u[6], P = u[10], B = u[14], G = u[3], U = u[7], R = u[11], W = u[15], H = p[0], N = p[4], V = p[8], J = p[12], re = p[1], te = p[5], ue = p[9], ie = p[13], ae = p[2], ce = p[6], Me = p[10], Ae = p[14], Ie = p[3], pe = p[7], se = p[11], Q = p[15]; + return g[0] = b * H + c * re + v * ae + E * Ie, g[4] = b * N + c * te + v * ce + E * pe, g[8] = b * V + c * ue + v * Me + E * se, g[12] = b * J + c * ie + v * Ae + E * Q, g[1] = w * H + k * re + $ * ae + L * Ie, g[5] = w * N + k * te + $ * ce + L * pe, g[9] = w * V + k * ue + $ * Me + L * se, g[13] = w * J + k * ie + $ * Ae + L * Q, g[2] = I * H + F * re + P * ae + B * Ie, g[6] = I * N + F * te + P * ce + B * pe, g[10] = I * V + F * ue + P * Me + B * se, g[14] = I * J + F * ie + P * Ae + B * Q, g[3] = G * H + U * re + R * ae + W * Ie, g[7] = G * N + U * te + R * ce + W * pe, g[11] = G * V + U * ue + R * Me + W * se, g[15] = G * J + U * ie + R * Ae + W * Q, this; } multiplyScalar(m) { const l = this.elements; @@ -30869,23 +30891,23 @@ ATOM`, b); return l[12] += m.x, l[13] += m.y, l[14] += m.z, this; } getInverse(m, l) { - const u = this.elements, p = m.elements, g = p[0], b = p[4], c = p[8], _ = p[12], E = p[1], w = p[5], k = p[9], $ = p[13], L = p[2], z = p[6], F = p[10], R = p[14], P = p[3], U = p[7], N = p[11], B = p[15]; - u[0] = k * R * U - $ * F * U + $ * z * N - w * R * N - k * z * B + w * F * B, u[4] = _ * F * U - c * R * U - _ * z * N + b * R * N + c * z * B - b * F * B, u[8] = c * $ * U - _ * k * U + _ * w * N - b * $ * N - c * w * B + b * k * B, u[12] = _ * k * z - c * $ * z - _ * w * F + b * $ * F + c * w * R - b * k * R, u[1] = $ * F * P - k * R * P - $ * L * N + E * R * N + k * L * B - E * F * B, u[5] = c * R * P - _ * F * P + _ * L * N - g * R * N - c * L * B + g * F * B, u[9] = _ * k * P - c * $ * P - _ * E * N + g * $ * N + c * E * B - g * k * B, u[13] = c * $ * L - _ * k * L + _ * E * F - g * $ * F - c * E * R + g * k * R, u[2] = w * R * P - $ * z * P + $ * L * U - E * R * U - w * L * B + E * z * B, u[6] = _ * z * P - b * R * P - _ * L * U + g * R * U + b * L * B - g * z * B, u[10] = b * $ * P - _ * w * P + _ * E * U - g * $ * U - b * E * B + g * w * B, u[14] = _ * w * L - b * $ * L - _ * E * z + g * $ * z + b * E * R - g * w * R, u[3] = k * z * P - w * F * P - k * L * U + E * F * U + w * L * N - E * z * N, u[7] = b * F * P - c * z * P + c * L * U - g * F * U - b * L * N + g * z * N, u[11] = c * w * P - b * k * P - c * E * U + g * k * U + b * E * N - g * w * N, u[15] = b * k * L - c * w * L + c * E * z - g * k * z - b * E * F + g * w * F; - const W = g * u[0] + E * u[4] + L * u[8] + P * u[12]; + const u = this.elements, p = m.elements, g = p[0], b = p[4], c = p[8], v = p[12], E = p[1], w = p[5], k = p[9], $ = p[13], L = p[2], I = p[6], F = p[10], P = p[14], B = p[3], G = p[7], U = p[11], R = p[15]; + u[0] = k * P * G - $ * F * G + $ * I * U - w * P * U - k * I * R + w * F * R, u[4] = v * F * G - c * P * G - v * I * U + b * P * U + c * I * R - b * F * R, u[8] = c * $ * G - v * k * G + v * w * U - b * $ * U - c * w * R + b * k * R, u[12] = v * k * I - c * $ * I - v * w * F + b * $ * F + c * w * P - b * k * P, u[1] = $ * F * B - k * P * B - $ * L * U + E * P * U + k * L * R - E * F * R, u[5] = c * P * B - v * F * B + v * L * U - g * P * U - c * L * R + g * F * R, u[9] = v * k * B - c * $ * B - v * E * U + g * $ * U + c * E * R - g * k * R, u[13] = c * $ * L - v * k * L + v * E * F - g * $ * F - c * E * P + g * k * P, u[2] = w * P * B - $ * I * B + $ * L * G - E * P * G - w * L * R + E * I * R, u[6] = v * I * B - b * P * B - v * L * G + g * P * G + b * L * R - g * I * R, u[10] = b * $ * B - v * w * B + v * E * G - g * $ * G - b * E * R + g * w * R, u[14] = v * w * L - b * $ * L - v * E * I + g * $ * I + b * E * P - g * w * P, u[3] = k * I * B - w * F * B - k * L * G + E * F * G + w * L * U - E * I * U, u[7] = b * F * B - c * I * B + c * L * G - g * F * G - b * L * U + g * I * U, u[11] = c * w * B - b * k * B - c * E * G + g * k * G + b * E * U - g * w * U, u[15] = b * k * L - c * w * L + c * E * I - g * k * I - b * E * F + g * w * F; + const W = g * u[0] + E * u[4] + L * u[8] + B * u[12]; if (W === 0) { - const V = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; + const H = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; if (l) - throw new Error(V); - return console.warn(V), this.identity(), this; + throw new Error(H); + return console.warn(H), this.identity(), this; } return this.multiplyScalar(1 / W), this; } isReflected() { - const m = this.elements, l = m[0], u = m[4], p = m[8], g = m[1], b = m[5], c = m[9], _ = m[2], E = m[6], w = m[10]; + const m = this.elements, l = m[0], u = m[4], p = m[8], g = m[1], b = m[5], c = m[9], v = m[2], E = m[6], w = m[10]; return l * b * w + // +aei g * E * p + // +bfg - _ * u * c - // +cdh - _ * b * p - // -ceg + v * u * c - // +cdh + v * b * p - // -ceg g * u * w - // -bdi l * E * c < 0; } @@ -30898,16 +30920,16 @@ ATOM`, b); return Math.sqrt(Math.max(l, Math.max(u, p))); } makeFrustum(m, l, u, p, g, b) { - const c = this.elements, _ = 2 * g / (l - m), E = 2 * g / (p - u), w = (l + m) / (l - m), k = (p + u) / (p - u), $ = -(b + g) / (b - g), L = -2 * b * g / (b - g); - return c[0] = _, c[4] = 0, c[8] = w, c[12] = 0, c[1] = 0, c[5] = E, c[9] = k, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = $, c[14] = L, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this; + const c = this.elements, v = 2 * g / (l - m), E = 2 * g / (p - u), w = (l + m) / (l - m), k = (p + u) / (p - u), $ = -(b + g) / (b - g), L = -2 * b * g / (b - g); + return c[0] = v, c[4] = 0, c[8] = w, c[12] = 0, c[1] = 0, c[5] = E, c[9] = k, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = $, c[14] = L, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this; } makePerspective(m, l, u, p) { - const g = u * Math.tan((0, r.degToRad)(m * 0.5)), b = -g, c = b * l, _ = g * l; - return this.makeFrustum(c, _, b, g, u, p); + const g = u * Math.tan((0, r.degToRad)(m * 0.5)), b = -g, c = b * l, v = g * l; + return this.makeFrustum(c, v, b, g, u, p); } makeOrthographic(m, l, u, p, g, b) { - const c = this.elements, _ = 1 / (l - m), E = 1 / (u - p), w = 1 / (b - g), k = (l + m) * _, $ = (u + p) * E, L = (b + g) * w; - return c[0] = 2 * _, c[4] = 0, c[8] = 0, c[12] = -k, c[1] = 0, c[5] = 2 * E, c[9] = 0, c[13] = -$, c[2] = 0, c[6] = 0, c[10] = -2 * w, c[14] = -L, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this; + const c = this.elements, v = 1 / (l - m), E = 1 / (u - p), w = 1 / (b - g), k = (l + m) * v, $ = (u + p) * E, L = (b + g) * w; + return c[0] = 2 * v, c[4] = 0, c[8] = 0, c[12] = -k, c[1] = 0, c[5] = 2 * E, c[9] = 0, c[13] = -$, c[2] = 0, c[6] = 0, c[10] = -2 * w, c[14] = -L, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this; } isEqual(m) { const l = m.elements, u = this.elements; @@ -30927,11 +30949,11 @@ ATOM`, b); } getScale(m) { const l = this.elements; - return m = m || new y(), o.set(l[0], l[1], l[2]), d.set(l[4], l[5], l[6]), v.set(l[8], l[9], l[10]), m.x = o.length(), m.y = d.length(), m.z = v.length(), m; + return m = m || new y(), o.set(l[0], l[1], l[2]), d.set(l[4], l[5], l[6]), _.set(l[8], l[9], l[10]), m.x = o.length(), m.y = d.length(), m.z = _.length(), m; } lookAt(m, l, u) { const p = this.elements; - return v.subVectors(m, l).normalize(), v.length() === 0 && (v.z = 1), o.crossVectors(u, v).normalize(), o.length() === 0 && (v.x += 1e-4, o.crossVectors(u, v).normalize()), d.crossVectors(v, o), p[0] = o.x, p[4] = d.x, p[8] = v.x, p[1] = o.y, p[5] = d.y, p[9] = v.y, p[2] = o.z, p[6] = d.z, p[10] = v.z, this; + return _.subVectors(m, l).normalize(), _.length() === 0 && (_.z = 1), o.crossVectors(u, _).normalize(), o.length() === 0 && (_.x += 1e-4, o.crossVectors(u, _).normalize()), d.crossVectors(_, o), p[0] = o.x, p[4] = d.x, p[8] = _.x, p[1] = o.y, p[5] = d.y, p[9] = _.y, p[2] = o.z, p[6] = d.z, p[10] = _.z, this; } compose(m, l, u) { const p = this.elements; @@ -30998,10 +31020,10 @@ ATOM`, b); return this.x = (g[0] * l + g[4] * u + g[8] * p + g[12]) / b, this.y = (g[1] * l + g[5] * u + g[9] * p + g[13]) / b, this.z = (g[2] * l + g[6] * u + g[10] * p + g[14]) / b, this; } applyQuaternion(m) { - const { x: l } = this, { y: u } = this, { z: p } = this, g = m.x, b = m.y, c = m.z, _ = m.w, E = {}; + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.x, b = m.y, c = m.z, v = m.w, E = {}; E.x = 2 * (u * c - p * b), E.y = 2 * (p * g - l * c), E.z = 2 * (l * b - u * g); const w = {}; - return w.x = E.y * c - E.z * b, w.y = E.z * g - E.x * c, w.z = E.x * b - E.y * g, this.x = l + _ * E.x + w.x, this.y = u + _ * E.y + w.y, this.z = p + _ * E.z + w.z, this; + return w.x = E.y * c - E.z * b, w.y = E.z * g - E.x * c, w.z = E.x * b - E.y * g, this.x = l + v * E.x + w.x, this.y = u + v * E.y + w.y, this.z = p + v * E.z + w.z, this; } negate() { return this.multiplyScalar(-1); @@ -31032,13 +31054,13 @@ ATOM`, b); return this.x = m.elements[12], this.y = m.elements[13], this.z = m.elements[14], this; } setEulerFromRotationMatrix(m, l) { - const u = m.elements, p = u[0], g = u[4], b = u[8], c = u[5], _ = u[9], E = u[6], w = u[10]; - return l === void 0 || l === "XYZ" ? (this.y = Math.asin((0, a.clamp)(b, -1, 1)), Math.abs(b) < 0.99999 ? (this.x = Math.atan2(-_, w), this.z = Math.atan2(-g, p)) : (this.x = Math.atan2(E, c), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${l}`), this; + const u = m.elements, p = u[0], g = u[4], b = u[8], c = u[5], v = u[9], E = u[6], w = u[10]; + return l === void 0 || l === "XYZ" ? (this.y = Math.asin((0, a.clamp)(b, -1, 1)), Math.abs(b) < 0.99999 ? (this.x = Math.atan2(-v, w), this.z = Math.atan2(-g, p)) : (this.x = Math.atan2(E, c), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${l}`), this; } rotateAboutVector(m, l) { m.normalize(); - const u = Math.cos(l), p = Math.sin(l), g = this.clone().multiplyScalar(u), b = m.clone().cross(this).multiplyScalar(p), c = m.clone().multiplyScalar(m.clone().dot(this)).multiplyScalar(1 - u), _ = g.add(b).add(c); - return this.x = _.x, this.y = _.y, this.z = _.z, this; + const u = Math.cos(l), p = Math.sin(l), g = this.clone().multiplyScalar(u), b = m.clone().cross(this).multiplyScalar(p), c = m.clone().multiplyScalar(m.clone().dot(this)).multiplyScalar(1 - u), v = g.add(b).add(c); + return this.x = v.x, this.y = v.y, this.z = v.z, this; } setFromMatrixPosition(m) { const l = m.elements; @@ -31057,14 +31079,14 @@ ATOM`, b); return l.multiplyMatrices(m.matrixWorld, l.getInverse(m.projectionMatrix)), this.applyMatrix4(l); } } - o = new y(), d = new y(), v = new y(); + o = new y(), d = new y(), _ = new y(); class A { - constructor(m = 1, l = 0, u = 0, p = 0, g = 1, b = 0, c = 0, _ = 0, E = 1) { - this.elements = new Float32Array(9), this.set(m, l, u, p, g, b, c, _, E); + constructor(m = 1, l = 0, u = 0, p = 0, g = 1, b = 0, c = 0, v = 0, E = 1) { + this.elements = new Float32Array(9), this.set(m, l, u, p, g, b, c, v, E); } - set(m, l, u, p, g, b, c, _, E) { + set(m, l, u, p, g, b, c, v, E) { const w = this.elements; - return w[0] = m, w[3] = l, w[6] = u, w[1] = p, w[4] = g, w[7] = b, w[2] = c, w[5] = _, w[8] = E, this; + return w[0] = m, w[3] = l, w[6] = u, w[1] = p, w[4] = g, w[7] = b, w[2] = c, w[5] = v, w[8] = E, this; } identity() { return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this; @@ -31212,9 +31234,9 @@ ATOM`, b); /*! ../math */ "./src/WebGL/math/math.ts" ); - function a(s, h, o, d, v, f) { - d = d * Math.PI / 180, v = v * Math.PI / 180, f = f * Math.PI / 180; - const y = (u) => u * u, A = Math.cos(d), x = Math.cos(v), M = Math.cos(f), m = Math.sin(f); + function a(s, h, o, d, _, f) { + d = d * Math.PI / 180, _ = _ * Math.PI / 180, f = f * Math.PI / 180; + const y = (u) => u * u, A = Math.cos(d), x = Math.cos(_), M = Math.cos(f), m = Math.sin(f); return new r.Matrix3(s, h * M, o * x, 0, h * m, o * (A - x * M) / m, 0, 0, o * Math.sqrt(1 - y(A) - y(x) - y(M) + 2 * A * x * M) / m); } } @@ -31271,10 +31293,10 @@ ATOM`, b); o[o.LineStrip = 0] = "LineStrip", o[o.LinePieces = 1] = "LinePieces"; })(s || (s = {})); class h extends a.Object3D { - constructor(d, v = new r.LineBasicMaterial({ + constructor(d, _ = new r.LineBasicMaterial({ color: Math.random() * 16777215 }), f = s.LineStrip) { - super(), this.geometry = d, this.material = v, this.type = f; + super(), this.geometry = d, this.material = _, this.type = f; } clone(d = new h(this.geometry, this.material, this.type)) { return super.clone.call(this, d), d; @@ -31656,7 +31678,7 @@ ATOM`, b); /* harmony export */ screenaa: () => ( /* reexport safe */ - v.screenaa + _.screenaa ), /* harmony export */ sphereimposter: () => ( @@ -31708,7 +31730,7 @@ ATOM`, b); ), d = t( /*! ./screen */ "./src/WebGL/shaders/lib/screen/index.ts" - ), v = t( + ), _ = t( /*! ./screenaa */ "./src/WebGL/shaders/lib/screenaa/index.ts" ), f = t( @@ -31744,7 +31766,7 @@ ATOM`, b); lambertdouble: h.lambertdouble, outline: o.outline, screen: d.screen, - screenaa: v.screenaa, + screenaa: _.screenaa, ssao: l.ssao, sphereimposter: f.sphereimposter, sphereimposteroutline: y.sphereimposteroutline, @@ -32607,8 +32629,8 @@ ATOM`, b); ); let a = new r.Vector3(); class s { - constructor(o = new r.Vector3(), d = new r.Vector3(), v = 0) { - this.c1 = o, this.c2 = d, this.radius = v, this.direction = new r.Vector3().subVectors(this.c2, this.c1).normalize(); + constructor(o = new r.Vector3(), d = new r.Vector3(), _ = 0) { + this.c1 = o, this.c2 = d, this.radius = _, this.direction = new r.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; @@ -32687,8 +32709,8 @@ ATOM`, b); ); const a = new r.Vector3(); class s { - constructor(o = new r.Vector3(), d = new r.Vector3(), v = new r.Vector3()) { - this.a = o, this.b = d, this.c = v; + constructor(o = new r.Vector3(), d = new r.Vector3(), _ = new r.Vector3()) { + this.a = o, this.b = d, this.c = _; } copy(o) { return this.a.copy(o.a), this.b.copy(o.b), this.c.copy(o.c), this; @@ -32766,7 +32788,7 @@ ATOM`, b); /* harmony export */ viewers: () => ( /* binding */ - v + _ ) /* harmony export */ }); @@ -32782,7 +32804,7 @@ ATOM`, b); ), h = t( /*! ./colors */ "./src/colors.ts" - ), o = !1, d = !1, v = {}; + ), o = !1, d = !1, _ = {}; function f(y, A) { var x, M, m; if (document.querySelector(".viewer_3Dmoljs") != null && (o = !0), o) { @@ -32802,8 +32824,8 @@ ATOM`, b); m = b.substring(pe + 1); } g.push(m); - var _ = b.substring(b.lastIndexOf("/") + 1, b.lastIndexOf(".")); - _ == "/" && (_ = b.substring(b.lastIndexOf("/") + 1)), u.dataset[g[g.length - 1]] = _; + var v = b.substring(b.lastIndexOf("/") + 1, b.lastIndexOf(".")); + v == "/" && (v = b.substring(b.lastIndexOf("/") + 1)), u.dataset[g[g.length - 1]] = v; } let E = u.dataset; for (x in E) @@ -32814,57 +32836,57 @@ ATOM`, b); $ = $ == null ? 1 : parseFloat($); var L = { line: {} }; u.dataset.style && (L = (0, s.specStringToObject)(u.dataset.style)); - var z = {}; - u.dataset.select && (z = (0, s.specStringToObject)(u.dataset.select)); - var F = [], R = [], P = [], U = {}, N = null, B = u.dataset, W = /style(.+)/, V = /surface(.*)/, G = /labelres(.*)/, H = []; - for (M in B) - Object.prototype.hasOwnProperty.call(B, M) && H.push(M); - for (H.sort(), x = 0; x < H.length; x++) { - M = H[x]; - var Q = W.exec(M), te, ee, ce; - Q && (te = "select" + Q[1], ee = (0, s.specStringToObject)(B[te]), ce = (0, s.specStringToObject)(B[M]), F.push([ee, ce])), Q = V.exec(M), Q && (te = "select" + Q[1], ee = (0, s.specStringToObject)(B[te]), ce = (0, s.specStringToObject)(B[M]), R.push([ee, ce])), Q = G.exec(M), Q && (te = "select" + Q[1], ee = (0, s.specStringToObject)(B[te]), ce = (0, s.specStringToObject)(B[M]), P.push([ee, ce])), M == "zoomto" && (U = (0, s.specStringToObject)(B[M])), M == "spin" && (N = (0, s.specStringToObject)(B[M])); + var I = {}; + u.dataset.select && (I = (0, s.specStringToObject)(u.dataset.select)); + var F = [], P = [], B = [], G = {}, U = null, R = u.dataset, W = /style(.+)/, H = /surface(.*)/, N = /labelres(.*)/, V = []; + for (M in R) + Object.prototype.hasOwnProperty.call(R, M) && V.push(M); + for (V.sort(), x = 0; x < V.length; x++) { + M = V[x]; + var J = W.exec(M), re, te, ue; + J && (re = "select" + J[1], te = (0, s.specStringToObject)(R[re]), ue = (0, s.specStringToObject)(R[M]), F.push([te, ue])), J = H.exec(M), J && (re = "select" + J[1], te = (0, s.specStringToObject)(R[re]), ue = (0, s.specStringToObject)(R[M]), P.push([te, ue])), J = N.exec(M), J && (re = "select" + J[1], te = (0, s.specStringToObject)(R[re]), ue = (0, s.specStringToObject)(R[M]), B.push([te, ue])), M == "zoomto" && (G = (0, s.specStringToObject)(R[M])), M == "spin" && (U = (0, s.specStringToObject)(R[M])); } - var fe = function(pe) { - for (pe.setStyle(z, L), c && c.createSelectionAndStyle(z, L), x = 0; x < F.length; x++) { - let le = F[x][0] || {}, ne = F[x][1] || { line: {} }; - pe.setStyle(le, ne), c && c.createSelectionAndStyle(z, L); - } - for (x = 0; x < R.length; x++) { - let le = R[x][0] || {}, ne = R[x][1] || {}; - c ? pe.addSurface(a.SurfaceType.VDW, ne, le, le).then((Oe) => { - c.loadSurface("VDW", le, ne, Oe); - }) : pe.addSurface(a.SurfaceType.VDW, ne, le, le); + var ie = function(pe) { + for (pe.setStyle(I, L), c && c.createSelectionAndStyle(I, L), x = 0; x < F.length; x++) { + let se = F[x][0] || {}, Q = F[x][1] || { line: {} }; + pe.setStyle(se, Q), c && c.createSelectionAndStyle(I, L); } for (x = 0; x < P.length; x++) { - let le = P[x][0] || {}, ne = P[x][1] || {}; - pe.addResLabels(le, ne); + let se = P[x][0] || {}, Q = P[x][1] || {}; + c ? pe.addSurface(a.SurfaceType.VDW, Q, se, se).then((ke) => { + c.loadSurface("VDW", se, Q, ke); + }) : pe.addSurface(a.SurfaceType.VDW, Q, se, se); + } + for (x = 0; x < B.length; x++) { + let se = B[x][0] || {}, Q = B[x][1] || {}; + pe.addResLabels(se, Q); } - pe.render(), pe.zoomTo(U), N && pe.spin(N.axis, N.speed); + pe.render(), pe.zoomTo(G), U && pe.spin(U.axis, U.speed); }; - let oe = y; + let ae = y; try { - var he = (0, s.specStringToObject)(u.dataset.config) || {}; - he.backgroundColor === void 0 && (he.backgroundColor = k), he.backgroundAlpha === void 0 && (he.backgroundAlpha = $), oe == null ? oe = v[u.id || l++] = (0, r.createViewer)(u, he) : (oe.setBackgroundColor(k, $), oe.setConfig(he), c && c.initiateUI()), u.dataset.ui && $3Dmol.StateManager && (c = new $3Dmol.StateManager(oe)); + var ce = (0, s.specStringToObject)(u.dataset.config) || {}; + ce.backgroundColor === void 0 && (ce.backgroundColor = k), ce.backgroundAlpha === void 0 && (ce.backgroundAlpha = $), ae == null ? ae = _[u.id || l++] = (0, r.createViewer)(u, ce) : (ae.setBackgroundColor(k, $), ae.setConfig(ce), c && c.initiateUI()), u.dataset.ui && $3Dmol.StateManager && (c = new $3Dmol.StateManager(ae)); } catch (pe) { console.log(pe), u.textContent = "WebGL appears to be disabled."; } if (p.length != 0) { - let pe = 0, le = /* @__PURE__ */ ((ne, Te) => function(Oe) { + let pe = 0, se = /* @__PURE__ */ ((Q, ye) => function(ke) { b = p[pe]; - var Be = ne.dataset.type || ne.dataset.datatype || g[pe]; - if (Te.addModel(Oe, Be, w), c) { - var Ue = ne.dataset[g[pe]]; - c.setModelTitle(Ue); + var Pe = Q.dataset.type || Q.dataset.datatype || g[pe]; + if (ye.addModel(ke, Pe, w), c) { + var Ne = Q.dataset[g[pe]]; + c.setModelTitle(Ne); } - pe += 1, pe < p.length ? (0, s.get)(p[pe]).then(le) : (fe(Te), ne.dataset.callback && (0, s.makeFunction)(ne.dataset.callback)(Te), d = !1, A && A(Te)); - })(u, oe); - m && m.endsWith("gz") ? (0, s.getbin)(p[0]).then(le) : (0, s.get)(p[0]).then(le); + pe += 1, pe < p.length ? (0, s.get)(p[pe]).then(se) : (ie(ye), Q.dataset.callback && (0, s.makeFunction)(Q.dataset.callback)(ye), d = !1, A && A(ye)); + })(u, ae); + m && m.endsWith("gz") ? (0, s.getbin)(p[0]).then(se) : (0, s.get)(p[0]).then(se); } else { if (u.dataset.element) { - var Ae = "#" + u.dataset.element, Se = document.querySelector(Ae), Ie = Se ? Se.textContent : ""; - m = u.dataset.type || u.dataset.datatype, oe.addModel(Ie, m, w); + var Me = "#" + u.dataset.element, Ae = document.querySelector(Me), Ie = Ae ? Ae.textContent : ""; + m = u.dataset.type || u.dataset.datatype, ae.addModel(Ie, m, w); } - fe(oe), u.dataset.callback && (0, s.makeFunction)(u.dataset.callback)(oe), d = !1, A && A(oe); + ie(ae), u.dataset.callback && (0, s.makeFunction)(u.dataset.callback)(ae), d = !1, A && A(ae); } }); } @@ -32915,7 +32937,7 @@ ATOM`, b); /* harmony export */ residues: () => ( /* binding */ - v + _ ), /* harmony export */ ssColors: () => ( @@ -32929,7 +32951,7 @@ ATOM`, b); return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof x == "number" ? (this.r = x || 0, this.g = M || 0, this.b = m || 0, this) : this.set(x || 0); } set(x) { - return x instanceof r ? x.clone() : (typeof x == "number" ? this.setHex(x) : typeof x == "object" && (this.r = x?.r || 0, this.g = x?.g || 0, this.b = x?.b || 0), this); + return x instanceof r ? x.clone() : (typeof x == "number" ? this.setHex(x) : typeof x == "object" && (this.r = (x == null ? void 0 : x.r) || 0, this.g = (x == null ? void 0 : x.g) || 0, this.b = (x == null ? void 0 : x.b) || 0), this); } setHex(x) { return x = Math.floor(x), this.r = (x >> 16 & 255) / 255, this.g = (x >> 8 & 255) / 255, this.b = (x & 255) / 255, this; @@ -32984,7 +33006,7 @@ ATOM`, b); } return u; } - return ((M = window?.$3Dmol) === null || M === void 0 ? void 0 : M.htmlColors[x.toLowerCase()]) || 0; + return ((M = window == null ? void 0 : window.$3Dmol) === null || M === void 0 ? void 0 : M.htmlColors[x.toLowerCase()]) || 0; } return x; } @@ -33411,7 +33433,7 @@ ATOM`, b); orangeCarbon: Object.assign(Object.assign({}, o), { C: 16753920 }), purpleCarbon: Object.assign(Object.assign({}, o), { C: 8388736 }), blueCarbon: Object.assign(Object.assign({}, o), { C: 255 }) - }, v = { + }, _ = { /** @property standard amino acid color scheme*/ amino: { ALA: 13158600, @@ -33535,9 +33557,9 @@ ATOM`, b); ssPyMol: { prop: "ss", map: h.pyMol }, ssJmol: { prop: "ss", map: h.Jmol }, Jmol: { prop: "elem", map: d.Jmol }, - amino: { prop: "resn", map: v.amino }, - shapely: { prop: "resn", map: v.shapely }, - nucleic: { prop: "resn", map: v.nucleic }, + amino: { prop: "resn", map: _.amino }, + shapely: { prop: "resn", map: _.shapely }, + nucleic: { prop: "resn", map: _.nucleic }, chain: { prop: "chain", map: f.atom }, rasmol: { prop: "elem", map: d.rasmol }, default: { prop: "elem", map: d.defaultColors }, @@ -33564,7 +33586,7 @@ ATOM`, b); /* harmony export */ drawCartoon: () => ( /* binding */ - z + I ), /* harmony export */ subdivide_spline: () => ( @@ -33591,204 +33613,204 @@ ATOM`, b); ), d = t( /*! ./GLDraw */ "./src/GLDraw.ts" - ), v = t( + ), _ = t( /*! ./utilities */ "./src/utilities.ts" ); - function f(F, R) { - var P = [], U = F; - U = [], U.push(F[0]); - var N, B, W, V, G, H, Q, te, ee; - for (N = 1, B = F.length - 1; N < B; N++) - if (G = F[N], H = F[N + 1], G.smoothen) { - var ce = new r.Vector3((G.x + H.x) / 2, (G.y + H.y) / 2, (G.z + H.z) / 2); - ce.atom = G.atom, U.push(ce); + function f(F, P) { + var B = [], G = F; + G = [], G.push(F[0]); + var U, R, W, H, N, V, J, re, te; + for (U = 1, R = F.length - 1; U < R; U++) + if (N = F[U], V = F[U + 1], N.smoothen) { + var ue = new r.Vector3((N.x + V.x) / 2, (N.y + V.y) / 2, (N.z + V.z) / 2); + ue.atom = N.atom, G.push(ue); } else - U.push(G); - for (U.push(F[F.length - 1]), N = -1, W = U.length; N <= W - 3; N++) - if (V = U[N === -1 ? 0 : N], G = U[N + 1], H = U[N + 2], Q = U[N === W - 3 ? W - 1 : N + 3], te = new r.Vector3().subVectors(H, V).multiplyScalar(0.5), ee = new r.Vector3().subVectors(Q, G).multiplyScalar(0.5), !H.skip) - for (var fe = 0; fe < R; fe++) { - var oe = 1 / R * fe, he = G.x + oe * te.x + oe * oe * (-3 * G.x + 3 * H.x - 2 * te.x - ee.x) + oe * oe * oe * (2 * G.x - 2 * H.x + te.x + ee.x), Ae = G.y + oe * te.y + oe * oe * (-3 * G.y + 3 * H.y - 2 * te.y - ee.y) + oe * oe * oe * (2 * G.y - 2 * H.y + te.y + ee.y), Se = G.z + oe * te.z + oe * oe * (-3 * G.z + 3 * H.z - 2 * te.z - ee.z) + oe * oe * oe * (2 * G.z - 2 * H.z + te.z + ee.z), Ie = new r.Vector3(he, Ae, Se); - fe < R / 2 ? Ie.atom = G.atom : Ie.atom = H.atom, P.push(Ie); + G.push(N); + for (G.push(F[F.length - 1]), U = -1, W = G.length; U <= W - 3; U++) + if (H = G[U === -1 ? 0 : U], N = G[U + 1], V = G[U + 2], J = G[U === W - 3 ? W - 1 : U + 3], re = new r.Vector3().subVectors(V, H).multiplyScalar(0.5), te = new r.Vector3().subVectors(J, N).multiplyScalar(0.5), !V.skip) + for (var ie = 0; ie < P; ie++) { + var ae = 1 / P * ie, ce = N.x + ae * re.x + ae * ae * (-3 * N.x + 3 * V.x - 2 * re.x - te.x) + ae * ae * ae * (2 * N.x - 2 * V.x + re.x + te.x), Me = N.y + ae * re.y + ae * ae * (-3 * N.y + 3 * V.y - 2 * re.y - te.y) + ae * ae * ae * (2 * N.y - 2 * V.y + re.y + te.y), Ae = N.z + ae * re.z + ae * ae * (-3 * N.z + 3 * V.z - 2 * re.z - te.z) + ae * ae * ae * (2 * N.z - 2 * V.z + re.z + te.z), Ie = new r.Vector3(ce, Me, Ae); + ie < P / 2 ? Ie.atom = N.atom : Ie.atom = V.atom, B.push(Ie); } - return P.push(U[U.length - 1]), P; + return B.push(G[G.length - 1]), B; } const y = 0.5, A = 1.3, x = 0.8, M = 0.4, m = 0.4; - function l(F, R, P, U) { - for (var N, B, W, V, G = 0, H = R.length; G < H; G++) { - V = Math.round(G * (U.length - 1) / H), W = o.CC.color(U[V]); - var Q = F.updateGeoGroup(2), te = Q.vertexArray, ee = Q.colorArray, ce = Q.faceArray; - N = Q.vertices, B = N * 3, te[B] = R[G].x, te[B + 1] = R[G].y, te[B + 2] = R[G].z, te[B + 3] = P[G].x, te[B + 4] = P[G].y, te[B + 5] = P[G].z; - for (var fe = 0; fe < 6; ++fe) - ee[B + 3 * fe] = W.r, ee[B + 1 + 3 * fe] = W.g, ee[B + 2 + 3 * fe] = W.b; - if (G > 0) { - var oe = [N, N + 1, N - 1, N - 2], he = Q.faceidx; - ce[he] = oe[0], ce[he + 1] = oe[1], ce[he + 2] = oe[3], ce[he + 3] = oe[1], ce[he + 4] = oe[2], ce[he + 5] = oe[3], Q.faceidx += 6; - } - Q.vertices += 2; - } - } - function u(F, R, P, U, N, B, W) { - var V, G, H, Q; - if (H = R.length, H < 2 || R[0].length < 2) + function l(F, P, B, G) { + for (var U, R, W, H, N = 0, V = P.length; N < V; N++) { + H = Math.round(N * (G.length - 1) / V), W = o.CC.color(G[H]); + var J = F.updateGeoGroup(2), re = J.vertexArray, te = J.colorArray, ue = J.faceArray; + U = J.vertices, R = U * 3, re[R] = P[N].x, re[R + 1] = P[N].y, re[R + 2] = P[N].z, re[R + 3] = B[N].x, re[R + 4] = B[N].y, re[R + 5] = B[N].z; + for (var ie = 0; ie < 6; ++ie) + te[R + 3 * ie] = W.r, te[R + 1 + 3 * ie] = W.g, te[R + 2 + 3 * ie] = W.b; + if (N > 0) { + var ae = [U, U + 1, U - 1, U - 2], ce = J.faceidx; + ue[ce] = ae[0], ue[ce + 1] = ae[1], ue[ce + 2] = ae[3], ue[ce + 3] = ae[1], ue[ce + 4] = ae[2], ue[ce + 5] = ae[3], J.faceidx += 6; + } + J.vertices += 2; + } + } + function u(F, P, B, G, U, R, W) { + var H, N, V, J; + if (V = P.length, V < 2 || P[0].length < 2) return; - for (V = 0; V < H; V++) - R[V] = f(R[V], U); - if (Q = R[0].length, !N) - return l(F, R[0], R[H - 1], P); - var te, ee, ce, fe, oe, he, Ae = [], Se = [], Ie = []; - for (G = 0; G < H; G++) - Ae.push(0.25 + 1.5 * Math.sqrt((H - 1) * G - Math.pow(G, 2)) / (H - 1)), Se.push(0.5), Ie.push(2 * (Math.pow(G / H, 2) - G / H) + 0.6); + for (H = 0; H < V; H++) + P[H] = f(P[H], G); + if (J = P[0].length, !U) + return l(F, P[0], P[V - 1], B); + var re, te, ue, ie, ae, ce, Me = [], Ae = [], Ie = []; + for (N = 0; N < V; N++) + Me.push(0.25 + 1.5 * Math.sqrt((V - 1) * N - Math.pow(N, 2)) / (V - 1)), Ae.push(0.5), Ie.push(2 * (Math.pow(N / V, 2) - N / V) + 0.6); var pe = []; - for (G = 0; G < H * 2 - 1; G++) - pe[G] = [G, G + 1, G + 1 - 2 * H, G - 2 * H]; - pe[H * 2 - 1] = [ - G, - G + 1 - 2 * H, - G + 1 - 4 * H, - G - 2 * H + for (N = 0; N < V * 2 - 1; N++) + pe[N] = [N, N + 1, N + 1 - 2 * V, N - 2 * V]; + pe[V * 2 - 1] = [ + N, + N + 1 - 2 * V, + N + 1 - 4 * V, + N - 2 * V ]; - var le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re; - let De = F.updateGeoGroup(); - for (V = 0; V < Q; V++) { - let q = F.groups, re = !1; - De = F.updateGeoGroup(2 * H), q != F.groups && V > 0 && (V = V - 1, re = !0), Ue = Math.round(V * (P.length - 1) / Q), Be = o.CC.color(P[Ue]), oe = ce, he = fe, ce = [], fe = [], te = [], R[0][V].atom !== void 0 && (Oe = R[0][V].atom, W === "oval" ? ee = Ae : W === "rectangle" ? ee = Se : W === "parabola" && (ee = Ie)), ee || (ee = Se); + var se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re; + let Ce = F.updateGeoGroup(); + for (H = 0; H < J; H++) { + let q = F.groups, ne = !1; + Ce = F.updateGeoGroup(2 * V), q != F.groups && H > 0 && (H = H - 1, ne = !0), Ne = Math.round(H * (B.length - 1) / J), Pe = o.CC.color(B[Ne]), ae = ue, ce = ie, ue = [], ie = [], re = [], P[0][H].atom !== void 0 && (ke = P[0][H].atom, W === "oval" ? te = Me : W === "rectangle" ? te = Ae : W === "parabola" && (te = Ie)), te || (te = Ae); var je, Xe; - for (G = 0; G < H; G++) - V < Q - 1 ? je = R[G][V + 1].clone().sub(R[G][V]) : je = R[G][V - 1].clone().sub(R[G][V]).negate(), G < H - 1 ? Xe = R[G + 1][V].clone().sub(R[G][V]) : Xe = R[G - 1][V].clone().sub(R[G][V]).negate(), te[G] = Xe.cross(je).normalize().multiplyScalar(N * ee[G]); - for (G = 0; G < H; G++) - ce[G] = R[G][V].clone().add(te[G].clone().negate()); - for (G = 0; G < H; G++) - fe[G] = R[G][V].clone().add(te[G]); - for (Pe = De.vertexArray, Ge = De.colorArray, Ne = De.faceArray, le = De.vertices, ne = le * 3, G = 0; G < H; G++) - Pe[ne + 3 * G + 0] = ce[G].x, Pe[ne + 3 * G + 1] = ce[G].y, Pe[ne + 3 * G + 2] = ce[G].z; - for (G = 0; G < H; G++) - Pe[ne + 3 * G + 0 + 3 * H] = fe[H - 1 - G].x, Pe[ne + 3 * G + 1 + 3 * H] = fe[H - 1 - G].y, Pe[ne + 3 * G + 2 + 3 * H] = fe[H - 1 - G].z; - for (G = 0; G < 2 * H; ++G) - Ge[ne + 3 * G + 0] = Be.r, Ge[ne + 3 * G + 1] = Be.g, Ge[ne + 3 * G + 2] = Be.b; - if (V > 0 && !re) { - for (G = 0; G < H * 2; G++) + for (N = 0; N < V; N++) + H < J - 1 ? je = P[N][H + 1].clone().sub(P[N][H]) : je = P[N][H - 1].clone().sub(P[N][H]).negate(), N < V - 1 ? Xe = P[N + 1][H].clone().sub(P[N][H]) : Xe = P[N - 1][H].clone().sub(P[N][H]).negate(), re[N] = Xe.cross(je).normalize().multiplyScalar(U * te[N]); + for (N = 0; N < V; N++) + ue[N] = P[N][H].clone().add(re[N].clone().negate()); + for (N = 0; N < V; N++) + ie[N] = P[N][H].clone().add(re[N]); + for (Be = Ce.vertexArray, Ge = Ce.colorArray, Ue = Ce.faceArray, se = Ce.vertices, Q = se * 3, N = 0; N < V; N++) + Be[Q + 3 * N + 0] = ue[N].x, Be[Q + 3 * N + 1] = ue[N].y, Be[Q + 3 * N + 2] = ue[N].z; + for (N = 0; N < V; N++) + Be[Q + 3 * N + 0 + 3 * V] = ie[V - 1 - N].x, Be[Q + 3 * N + 1 + 3 * V] = ie[V - 1 - N].y, Be[Q + 3 * N + 2 + 3 * V] = ie[V - 1 - N].z; + for (N = 0; N < 2 * V; ++N) + Ge[Q + 3 * N + 0] = Pe.r, Ge[Q + 3 * N + 1] = Pe.g, Ge[Q + 3 * N + 2] = Pe.b; + if (H > 0 && !ne) { + for (N = 0; N < V * 2; N++) Re = [ - le + pe[G][0], - le + pe[G][1], - le + pe[G][2], - le + pe[G][3] - ], Te = De.faceidx, Ne[Te] = Re[0], Ne[Te + 1] = Re[1], Ne[Te + 2] = Re[3], Ne[Te + 3] = Re[1], Ne[Te + 4] = Re[2], Ne[Te + 5] = Re[3], De.faceidx += 6; - if (Oe.clickable || Oe.hoverable) { + se + pe[N][0], + se + pe[N][1], + se + pe[N][2], + se + pe[N][3] + ], ye = Ce.faceidx, Ue[ye] = Re[0], Ue[ye + 1] = Re[1], Ue[ye + 2] = Re[3], Ue[ye + 3] = Re[1], Ue[ye + 4] = Re[2], Ue[ye + 5] = Re[3], Ce.faceidx += 6; + if (ke.clickable || ke.hoverable) { var X = []; - X.push(new a.Triangle(oe[0], ce[0], ce[H - 1])), X.push(new a.Triangle(oe[0], ce[H - 1], oe[H - 1])), X.push(new a.Triangle(oe[H - 1], ce[H - 1], fe[H - 1])), X.push(new a.Triangle(oe[H - 1], fe[H - 1], he[H - 1])), X.push(new a.Triangle(fe[0], he[0], he[H - 1])), X.push(new a.Triangle(fe[H - 1], fe[0], he[H - 1])), X.push(new a.Triangle(ce[0], oe[0], he[0])), X.push(new a.Triangle(fe[0], ce[0], he[0])); - for (G in X) - Oe.intersectionShape.triangle.push(X[G]); + X.push(new a.Triangle(ae[0], ue[0], ue[V - 1])), X.push(new a.Triangle(ae[0], ue[V - 1], ae[V - 1])), X.push(new a.Triangle(ae[V - 1], ue[V - 1], ie[V - 1])), X.push(new a.Triangle(ae[V - 1], ie[V - 1], ce[V - 1])), X.push(new a.Triangle(ie[0], ce[0], ce[V - 1])), X.push(new a.Triangle(ie[V - 1], ie[0], ce[V - 1])), X.push(new a.Triangle(ue[0], ae[0], ce[0])), X.push(new a.Triangle(ie[0], ue[0], ce[0])); + for (N in X) + ke.intersectionShape.triangle.push(X[N]); } } - De.vertices += 2 * H; + Ce.vertices += 2 * V; } - for (Pe = De.vertexArray, Ge = De.colorArray, Ne = De.faceArray, le = De.vertices, ne = le * 3, Te = De.faceidx, V = 0; V < H - 1; V++) - Re = [V, V + 1, 2 * H - 2 - V, 2 * H - 1 - V], Te = De.faceidx, Ne[Te] = Re[0], Ne[Te + 1] = Re[1], Ne[Te + 2] = Re[3], Ne[Te + 3] = Re[1], Ne[Te + 4] = Re[2], Ne[Te + 5] = Re[3], De.faceidx += 6; - for (V = 0; V < H - 1; V++) + for (Be = Ce.vertexArray, Ge = Ce.colorArray, Ue = Ce.faceArray, se = Ce.vertices, Q = se * 3, ye = Ce.faceidx, H = 0; H < V - 1; H++) + Re = [H, H + 1, 2 * V - 2 - H, 2 * V - 1 - H], ye = Ce.faceidx, Ue[ye] = Re[0], Ue[ye + 1] = Re[1], Ue[ye + 2] = Re[3], Ue[ye + 3] = Re[1], Ue[ye + 4] = Re[2], Ue[ye + 5] = Re[3], Ce.faceidx += 6; + for (H = 0; H < V - 1; H++) Re = [ - le - 1 - V, - le - 2 - V, - le - 2 * H + V + 1, - le - 2 * H + V - ], Te = De.faceidx, Ne[Te] = Re[0], Ne[Te + 1] = Re[1], Ne[Te + 2] = Re[3], Ne[Te + 3] = Re[1], Ne[Te + 4] = Re[2], Ne[Te + 5] = Re[3], De.faceidx += 6; - } - function p(F, R, P, U, N, B) { - if (!(R.length < 2)) { - var W, V; - if (W = R[0], V = R[R.length - 1], W = f(W, U), V = f(V, U), !N) - return l(F, W, V, P); - var G = [], H, Q, te, ee, ce, fe = [ + se - 1 - H, + se - 2 - H, + se - 2 * V + H + 1, + se - 2 * V + H + ], ye = Ce.faceidx, Ue[ye] = Re[0], Ue[ye + 1] = Re[1], Ue[ye + 2] = Re[3], Ue[ye + 3] = Re[1], Ue[ye + 4] = Re[2], Ue[ye + 5] = Re[3], Ce.faceidx += 6; + } + function p(F, P, B, G, U, R) { + if (!(P.length < 2)) { + var W, H; + if (W = P[0], H = P[P.length - 1], W = f(W, G), H = f(H, G), !U) + return l(F, W, H, B); + var N = [], V, J, re, te, ue, ie = [ [0, 2, -6, -8], [-4, -2, 6, 4], [7, -1, -5, 3], [-3, 5, 1, -7] - ], oe, he, Ae, Se, Ie, pe, le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re, De; - for (ne = 0, Te = W.length; ne < Te; ne++) { - if (Ie = Math.round(ne * (P.length - 1) / Te), Se = o.CC.color(P[Ie]), G.push(Q = W[ne]), G.push(Q), G.push(te = V[ne]), G.push(te), ne < Te - 1) { - var je = W[ne + 1].clone().sub(W[ne]), Xe = V[ne].clone().sub(W[ne]); - H = Xe.cross(je).normalize().multiplyScalar(N); + ], ae, ce, Me, Ae, Ie, pe, se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re, Ce; + for (Q = 0, ye = W.length; Q < ye; Q++) { + if (Ie = Math.round(Q * (B.length - 1) / ye), Ae = o.CC.color(B[Ie]), N.push(J = W[Q]), N.push(J), N.push(re = H[Q]), N.push(re), Q < ye - 1) { + var je = W[Q + 1].clone().sub(W[Q]), Xe = H[Q].clone().sub(W[Q]); + V = Xe.cross(je).normalize().multiplyScalar(U); } - for (G.push(ee = W[ne].clone().add(H)), G.push(ee), G.push(ce = V[ne].clone().add(H)), G.push(ce), Q.atom !== void 0 && (pe = Q.atom), Ge = F.updateGeoGroup(8), Ne = Ge.vertexArray, Re = Ge.colorArray, De = Ge.faceArray, oe = Ge.vertices, he = oe * 3, Ne[he] = Q.x, Ne[he + 1] = Q.y, Ne[he + 2] = Q.z, Ne[he + 3] = Q.x, Ne[he + 4] = Q.y, Ne[he + 5] = Q.z, Ne[he + 6] = te.x, Ne[he + 7] = te.y, Ne[he + 8] = te.z, Ne[he + 9] = te.x, Ne[he + 10] = te.y, Ne[he + 11] = te.z, Ne[he + 12] = ee.x, Ne[he + 13] = ee.y, Ne[he + 14] = ee.z, Ne[he + 15] = ee.x, Ne[he + 16] = ee.y, Ne[he + 17] = ee.z, Ne[he + 18] = ce.x, Ne[he + 19] = ce.y, Ne[he + 20] = ce.z, Ne[he + 21] = ce.x, Ne[he + 22] = ce.y, Ne[he + 23] = ce.z, Oe = 0; Oe < 8; ++Oe) - Re[he + 3 * Oe] = Se.r, Re[he + 1 + 3 * Oe] = Se.g, Re[he + 2 + 3 * Oe] = Se.b; - if (ne > 0) { - var X = le !== void 0 && pe !== void 0 && le.serial !== pe.serial; - for (Oe = 0; Oe < 4; Oe++) { + for (N.push(te = W[Q].clone().add(V)), N.push(te), N.push(ue = H[Q].clone().add(V)), N.push(ue), J.atom !== void 0 && (pe = J.atom), Ge = F.updateGeoGroup(8), Ue = Ge.vertexArray, Re = Ge.colorArray, Ce = Ge.faceArray, ae = Ge.vertices, ce = ae * 3, Ue[ce] = J.x, Ue[ce + 1] = J.y, Ue[ce + 2] = J.z, Ue[ce + 3] = J.x, Ue[ce + 4] = J.y, Ue[ce + 5] = J.z, Ue[ce + 6] = re.x, Ue[ce + 7] = re.y, Ue[ce + 8] = re.z, Ue[ce + 9] = re.x, Ue[ce + 10] = re.y, Ue[ce + 11] = re.z, Ue[ce + 12] = te.x, Ue[ce + 13] = te.y, Ue[ce + 14] = te.z, Ue[ce + 15] = te.x, Ue[ce + 16] = te.y, Ue[ce + 17] = te.z, Ue[ce + 18] = ue.x, Ue[ce + 19] = ue.y, Ue[ce + 20] = ue.z, Ue[ce + 21] = ue.x, Ue[ce + 22] = ue.y, Ue[ce + 23] = ue.z, ke = 0; ke < 8; ++ke) + Re[ce + 3 * ke] = Ae.r, Re[ce + 1 + 3 * ke] = Ae.g, Re[ce + 2 + 3 * ke] = Ae.b; + if (Q > 0) { + var X = se !== void 0 && pe !== void 0 && se.serial !== pe.serial; + for (ke = 0; ke < 4; ke++) { var q = [ - oe + fe[Oe][0], - oe + fe[Oe][1], - oe + fe[Oe][2], - oe + fe[Oe][3] + ae + ie[ke][0], + ae + ie[ke][1], + ae + ie[ke][2], + ae + ie[ke][3] ]; - if (Ae = Ge.faceidx, De[Ae] = q[0], De[Ae + 1] = q[1], De[Ae + 2] = q[3], De[Ae + 3] = q[1], De[Ae + 4] = q[2], De[Ae + 5] = q[3], Ge.faceidx += 6, pe.clickable || le.clickable || pe.hoverable || le.hoverable) { - var re = G[q[3]].clone(), ye = G[q[0]].clone(), me = G[q[2]].clone(), ze = G[q[1]].clone(); - if (re.atom = G[q[3]].atom || null, me.atom = G[q[2]].atom || null, ye.atom = G[q[0]].atom || null, ze.atom = G[q[1]].atom || null, X) { - var ke = re.clone().add(ye).multiplyScalar(0.5), K = me.clone().add(ze).multiplyScalar(0.5), ae = re.clone().add(ze).multiplyScalar(0.5); - Oe % 2 === 0 ? ((le.clickable || le.hoverable) && (Be = new a.Triangle(ke, ae, re), Ue = new a.Triangle(K, me, ae), Pe = new a.Triangle(ae, me, re), le.intersectionShape.triangle.push(Be), le.intersectionShape.triangle.push(Ue), le.intersectionShape.triangle.push(Pe)), (pe.clickable || pe.hoverable) && (Be = new a.Triangle(ye, ze, ae), Ue = new a.Triangle(ze, K, ae), Pe = new a.Triangle(ye, ae, ke), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(Ue), pe.intersectionShape.triangle.push(Pe))) : ((pe.clickable || pe.hoverable) && (Be = new a.Triangle(ke, ae, re), Ue = new a.Triangle(K, me, ae), Pe = new a.Triangle(ae, me, re), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(Ue), pe.intersectionShape.triangle.push(Pe)), (le.clickable || le.hoverable) && (Be = new a.Triangle(ye, ze, ae), Ue = new a.Triangle(ze, K, ae), Pe = new a.Triangle(ye, ae, ke), le.intersectionShape.triangle.push(Be), le.intersectionShape.triangle.push(Ue), le.intersectionShape.triangle.push(Pe))); - } else (pe.clickable || pe.hoverable) && (Be = new a.Triangle(ye, ze, re), Ue = new a.Triangle(ze, me, re), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(Ue)); + if (Me = Ge.faceidx, Ce[Me] = q[0], Ce[Me + 1] = q[1], Ce[Me + 2] = q[3], Ce[Me + 3] = q[1], Ce[Me + 4] = q[2], Ce[Me + 5] = q[3], Ge.faceidx += 6, pe.clickable || se.clickable || pe.hoverable || se.hoverable) { + var ne = N[q[3]].clone(), xe = N[q[0]].clone(), me = N[q[2]].clone(), ze = N[q[1]].clone(); + if (ne.atom = N[q[3]].atom || null, me.atom = N[q[2]].atom || null, xe.atom = N[q[0]].atom || null, ze.atom = N[q[1]].atom || null, X) { + var $e = ne.clone().add(xe).multiplyScalar(0.5), K = me.clone().add(ze).multiplyScalar(0.5), oe = ne.clone().add(ze).multiplyScalar(0.5); + ke % 2 === 0 ? ((se.clickable || se.hoverable) && (Pe = new a.Triangle($e, oe, ne), Ne = new a.Triangle(K, me, oe), Be = new a.Triangle(oe, me, ne), se.intersectionShape.triangle.push(Pe), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be)), (pe.clickable || pe.hoverable) && (Pe = new a.Triangle(xe, ze, oe), Ne = new a.Triangle(ze, K, oe), Be = new a.Triangle(xe, oe, $e), pe.intersectionShape.triangle.push(Pe), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be))) : ((pe.clickable || pe.hoverable) && (Pe = new a.Triangle($e, oe, ne), Ne = new a.Triangle(K, me, oe), Be = new a.Triangle(oe, me, ne), pe.intersectionShape.triangle.push(Pe), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be)), (se.clickable || se.hoverable) && (Pe = new a.Triangle(xe, ze, oe), Ne = new a.Triangle(ze, K, oe), Be = new a.Triangle(xe, oe, $e), se.intersectionShape.triangle.push(Pe), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be))); + } else (pe.clickable || pe.hoverable) && (Pe = new a.Triangle(xe, ze, ne), Ne = new a.Triangle(ze, me, ne), pe.intersectionShape.triangle.push(Pe), pe.intersectionShape.triangle.push(Ne)); } } } - Ge.vertices += 8, le = pe; + Ge.vertices += 8, se = pe; } - var ge = G.length - 8; - for (Ge = F.updateGeoGroup(8), Ne = Ge.vertexArray, Re = Ge.colorArray, De = Ge.faceArray, oe = Ge.vertices, he = oe * 3, Ae = Ge.faceidx, ne = 0; ne < 4; ne++) { - G.push(G[ne * 2]), G.push(G[ge + ne * 2]); - var xe = G[ne * 2], ue = G[ge + ne * 2]; - Ne[he + 6 * ne] = xe.x, Ne[he + 1 + 6 * ne] = xe.y, Ne[he + 2 + 6 * ne] = xe.z, Ne[he + 3 + 6 * ne] = ue.x, Ne[he + 4 + 6 * ne] = ue.y, Ne[he + 5 + 6 * ne] = ue.z, Re[he + 6 * ne] = Se.r, Re[he + 1 + 6 * ne] = Se.g, Re[he + 2 + 6 * ne] = Se.b, Re[he + 3 + 6 * ne] = Se.r, Re[he + 4 + 6 * ne] = Se.g, Re[he + 5 + 6 * ne] = Se.b; + var ge = N.length - 8; + for (Ge = F.updateGeoGroup(8), Ue = Ge.vertexArray, Re = Ge.colorArray, Ce = Ge.faceArray, ae = Ge.vertices, ce = ae * 3, Me = Ge.faceidx, Q = 0; Q < 4; Q++) { + N.push(N[Q * 2]), N.push(N[ge + Q * 2]); + var we = N[Q * 2], de = N[ge + Q * 2]; + Ue[ce + 6 * Q] = we.x, Ue[ce + 1 + 6 * Q] = we.y, Ue[ce + 2 + 6 * Q] = we.z, Ue[ce + 3 + 6 * Q] = de.x, Ue[ce + 4 + 6 * Q] = de.y, Ue[ce + 5 + 6 * Q] = de.z, Re[ce + 6 * Q] = Ae.r, Re[ce + 1 + 6 * Q] = Ae.g, Re[ce + 2 + 6 * Q] = Ae.b, Re[ce + 3 + 6 * Q] = Ae.r, Re[ce + 4 + 6 * Q] = Ae.g, Re[ce + 5 + 6 * Q] = Ae.b; } - ge += 8, Be = [oe, oe + 2, oe + 6, oe + 4], Ue = [oe + 1, oe + 5, oe + 7, oe + 3], De[Ae] = Be[0], De[Ae + 1] = Be[1], De[Ae + 2] = Be[3], De[Ae + 3] = Be[1], De[Ae + 4] = Be[2], De[Ae + 5] = Be[3], De[Ae + 6] = Ue[0], De[Ae + 7] = Ue[1], De[Ae + 8] = Ue[3], De[Ae + 9] = Ue[1], De[Ae + 10] = Ue[2], De[Ae + 11] = Ue[3], Ge.faceidx += 12, Ge.vertices += 8; + ge += 8, Pe = [ae, ae + 2, ae + 6, ae + 4], Ne = [ae + 1, ae + 5, ae + 7, ae + 3], Ce[Me] = Pe[0], Ce[Me + 1] = Pe[1], Ce[Me + 2] = Pe[3], Ce[Me + 3] = Pe[1], Ce[Me + 4] = Pe[2], Ce[Me + 5] = Pe[3], Ce[Me + 6] = Ne[0], Ce[Me + 7] = Ne[1], Ce[Me + 8] = Ne[3], Ce[Me + 9] = Ne[1], Ce[Me + 10] = Ne[2], Ce[Me + 11] = Ne[3], Ge.faceidx += 12, Ge.vertices += 8; } } - function g(F, R, P, U, N, B, W) { - (!W || W === "default") && (W = "rectangle"), W === "edged" ? p(F, R, P, U, N) : (W === "rectangle" || W === "oval" || W === "parabola") && u(F, R, P, U, N, B, W); + function g(F, P, B, G, U, R, W) { + (!W || W === "default") && (W = "rectangle"), W === "edged" ? p(F, P, B, G, U) : (W === "rectangle" || W === "oval" || W === "parabola") && u(F, P, B, G, U, R, W); } function b(F) { return F && F.elem === "C" && F.atom === "CA"; } - function c(F, R) { - if (F && R && F.chain === R.chain) { - if (!F.hetflag && !R.hetflag && F.reschain === R.reschain && (F.resi === R.resi || F.resi === R.resi - 1)) + function c(F, P) { + if (F && P && F.chain === P.chain) { + if (!F.hetflag && !P.hetflag && F.reschain === P.reschain && (F.resi === P.resi || F.resi === P.resi - 1)) return !0; - if (F.resi < R.resi) { - var P = F.x - R.x, U = F.y - R.y, N = F.z - R.z, B = P * P + U * U + N * N; - if (F.atom == "CA" && R.atom == "CA" && B < 16) + if (F.resi < P.resi) { + var B = F.x - P.x, G = F.y - P.y, U = F.z - P.z, R = B * B + G * G + U * U; + if (F.atom == "CA" && P.atom == "CA" && R < 16) return !0; - if ((F.atom == "P" || R.atom == "P") && B < 64) + if ((F.atom == "P" || P.atom == "P") && R < 64) return !0; } } return !1; } - function _(F, R, P, U, N) { - if (!(R == null || R.vertices == 0)) { - N && (R.initTypedArrays(), R.setUpNormals()); - var B = new s.MeshDoubleLambertMaterial(); - B.vertexColors = s.Coloring.FaceColors, typeof P == "number" && P >= 0 && P < 1 && (B.transparent = !0, B.opacity = P), B.outline = U; - var W = new s.Mesh(R, B); + function v(F, P, B, G, U) { + if (!(P == null || P.vertices == 0)) { + U && (P.initTypedArrays(), P.setUpNormals()); + var R = new s.MeshDoubleLambertMaterial(); + R.vertexColors = s.Coloring.FaceColors, typeof B == "number" && B >= 0 && B < 1 && (R.transparent = !0, R.opacity = B), R.outline = G; + var W = new s.Mesh(P, R); F.add(W); } } - function E(F, R, P, U, N, B, W, V, G) { - var H, Q, te, ee, ce, fe; - if (!(!U || !N || !W)) { - var oe = N.sub(U); - oe.normalize(); - var he = V[G]; - for (Q = G + 1; Q < V.length && (he = V[Q], he.atom != W.atom); Q++) + function E(F, P, B, G, U, R, W, H, N) { + var V, J, re, te, ue, ie; + if (!(!G || !U || !W)) { + var ae = U.sub(G); + ae.normalize(); + var ce = H[N]; + for (J = N + 1; J < H.length && (ce = H[J], ce.atom != W.atom); J++) ; - if (he = he ? new r.Vector3(he.x, he.y, he.z) : new r.Vector3(0, 0, 0), he.sub(U), W.ss === "arrow start") { - var Ae = he.clone().multiplyScalar(0.3).cross(N); - U.add(Ae); - var Se = he.clone().cross(oe).normalize(); - oe.rotateAboutVector(Se, 0.43); + if (ce = ce ? new r.Vector3(ce.x, ce.y, ce.z) : new r.Vector3(0, 0, 0), ce.sub(G), W.ss === "arrow start") { + var Me = ce.clone().multiplyScalar(0.3).cross(U); + G.add(Me); + var Ae = ce.clone().cross(ae).normalize(); + ae.rotateAboutVector(Ae, 0.43); } - for (W.style.cartoon.ribbon ? H = W.style.cartoon.thickness || M : W.style.cartoon.width ? H = W.style.cartoon.width : W.ss === "c" ? W.atom === "P" ? H = x : H = y : W.ss === "arrow start" ? (H = A, ce = !0) : W.ss === "arrow end" || W.ss === "h" && W.style.cartoon.tubes || W.ss === "tube start" ? H = y : H = A, B != null && oe.dot(B) < 0 && oe.negate(), oe.multiplyScalar(H), Q = 0; Q < R; Q++) - te = -1 + Q * 2 / (R - 1), ee = new r.Vector3(U.x + te * oe.x, U.y + te * oe.y, U.z + te * oe.z), ee.atom = W, W.ss === "s" && (ee.smoothen = !0), F[Q].push(ee); - if (ce) - for (oe.multiplyScalar(2), Q = 0; Q < R; Q++) - te = -1 + Q * 2 / (R - 1), ee = new r.Vector3(U.x + te * oe.x, U.y + te * oe.y, U.z + te * oe.z), ee.atom = W, ee.smoothen = !1, ee.skip = !0, F[Q].push(ee); - return fe = W.style.cartoon.style || "default", F.style ? F.style != fe && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), F.style = "default") : F.style = fe, (W.ss === "arrow start" || W.ss === "arrow end") && (W.ss = "s"), ce; + for (W.style.cartoon.ribbon ? V = W.style.cartoon.thickness || M : W.style.cartoon.width ? V = W.style.cartoon.width : W.ss === "c" ? W.atom === "P" ? V = x : V = y : W.ss === "arrow start" ? (V = A, ue = !0) : W.ss === "arrow end" || W.ss === "h" && W.style.cartoon.tubes || W.ss === "tube start" ? V = y : V = A, R != null && ae.dot(R) < 0 && ae.negate(), ae.multiplyScalar(V), J = 0; J < P; J++) + re = -1 + J * 2 / (P - 1), te = new r.Vector3(G.x + re * ae.x, G.y + re * ae.y, G.z + re * ae.z), te.atom = W, W.ss === "s" && (te.smoothen = !0), F[J].push(te); + if (ue) + for (ae.multiplyScalar(2), J = 0; J < P; J++) + re = -1 + J * 2 / (P - 1), te = new r.Vector3(G.x + re * ae.x, G.y + re * ae.y, G.z + re * ae.z), te.atom = W, te.smoothen = !1, te.skip = !0, F[J].push(te); + return ie = W.style.cartoon.style || "default", F.style ? F.style != ie && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), F.style = "default") : F.style = ie, (W.ss === "arrow start" || W.ss === "arrow end") && (W.ss = "s"), ue; } } const w = { @@ -33809,97 +33831,97 @@ ATOM`, b); N1: !0, N3: !0 }, k = { DA: !0, DG: !0, A: !0, G: !0 }, $ = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, L = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; - function z(F, R, P, U = 10) { - let N = U, B = U; - var W, V, G, H, Q, te, ee, ce, fe, oe, he, Ae, Se, Ie, pe, le, ne, Te, Oe = new s.Geometry(!0), Be = new s.Geometry(!0), Ue = [], Pe = [], Ge = 1, Ne = !1, Re = {}; - for (var De in h.Gradient.builtinGradients) - h.Gradient.builtinGradients.hasOwnProperty(De) && (Re[De] = new h.Gradient.builtinGradients[De](P[1], P[0])); + function I(F, P, B, G = 10) { + let U = G, R = G; + var W, H, N, V, J, re, te, ue, ie, ae, ce, Me, Ae, Ie, pe, se, Q, ye, ke = new s.Geometry(!0), Pe = new s.Geometry(!0), Ne = [], Be = [], Ge = 1, Ue = !1, Re = {}; + for (var Ce in h.Gradient.builtinGradients) + h.Gradient.builtinGradients.hasOwnProperty(Ce) && (Re[Ce] = new h.Gradient.builtinGradients[Ce](B[1], B[0])); var je = function(Z, Fe) { - return P && Fe.color === "spectrum" ? Fe.colorscheme in Re ? Re[Fe.colorscheme].valueToHex(Z.resi) : Re.sinebow.valueToHex(Z.resi) : (0, v.getColorFromStyle)(Z, Fe).getHex(); + return B && Fe.color === "spectrum" ? Fe.colorscheme in Re ? Re[Fe.colorscheme].valueToHex(Z.resi) : Re.sinebow.valueToHex(Z.resi) : (0, _.getColorFromStyle)(Z, Fe).getHex(); }; - for (ce = 0; ce < N; ce++) - Pe[ce] = []; + for (ue = 0; ue < U; ue++) + Be[ue] = []; var Xe = !1, X = !1, q = []; - for (ce in R) { - if (H = R[ce], H.elem === "C" && H.atom === "CA") { - var re = c(G, H); - re && H.ss === "s" ? Xe = !0 : Xe && (G && V && G.style.cartoon.arrows && V.style.cartoon.arrows && (G.ss = "arrow end", V.ss = "arrow start"), Xe = !1), re && (G.ss === "h" || G.ss == "tube start") && G.style.cartoon.tubes ? !X && G.ss != "tube start" && H.style.cartoon.tubes && (H.ss = "tube start", X = !0) : X && (G.ss === "tube start" ? G.ss = "tube end" : V && V.style.cartoon.tubes && (V.ss = "tube end"), X = !1), V = G, G = H; + for (ue in P) { + if (V = P[ue], V.elem === "C" && V.atom === "CA") { + var ne = c(N, V); + ne && V.ss === "s" ? Xe = !0 : Xe && (N && H && N.style.cartoon.arrows && H.style.cartoon.arrows && (N.ss = "arrow end", H.ss = "arrow start"), Xe = !1), ne && (N.ss === "h" || N.ss == "tube start") && N.style.cartoon.tubes ? !X && N.ss != "tube start" && V.style.cartoon.tubes && (V.ss = "tube start", X = !0) : X && (N.ss === "tube start" ? N.ss = "tube end" : H && H.style.cartoon.tubes && (H.ss = "tube end"), X = !1), H = N, N = V; } - H && H.atom in w && q.push(H); + V && V.atom in w && q.push(V); } - X && G.style.cartoon.tubes && (G.ss = "tube end", X = !1); - var ye = function(Z) { - Pe[0].length > 0 && g(Be, Pe, Ue, B, ee, Ge, Pe.style); + X && N.style.cartoon.tubes && (N.ss = "tube end", X = !1); + var xe = function(Z) { + Be[0].length > 0 && g(Pe, Be, Ne, R, te, Ge, Be.style); var Fe = [], We = null; if (Z) { - for (ce = 0; ce < N; ce++) - Fe[ce] = Pe[ce][Pe[ce].length - 1]; - We = Ue[Ue.length - 1]; - } - for (Pe = [], ce = 0; ce < N; ce++) - Pe[ce] = []; - if (Ue = [], Z) { - for (ce = 0; ce < N; ce++) - Pe[ce].push(Fe[ce]); - Ue.push(We); - } - _(F, Be, Ge, Ne, !0), _(F, Oe, Ge, Ne, !1), Be = new s.Geometry(!0), Oe = new s.Geometry(!0); + for (ue = 0; ue < U; ue++) + Fe[ue] = Be[ue][Be[ue].length - 1]; + We = Ne[Ne.length - 1]; + } + for (Be = [], ue = 0; ue < U; ue++) + Be[ue] = []; + if (Ne = [], Z) { + for (ue = 0; ue < U; ue++) + Be[ue].push(Fe[ue]); + Ne.push(We); + } + v(F, Pe, Ge, Ue, !0), v(F, ke, Ge, Ue, !1), Pe = new s.Geometry(!0), ke = new s.Geometry(!0); }; - G = void 0; + N = void 0; for (var me = 0; me < q.length; me++) { - H = q[me]; - var ze = H.resn.trim(), ke = ze in L; - if (Ge = 1, W = H.style.cartoon, G && G.style.cartoon && (Ge = G.style.cartoon.opacity), G && G.style.cartoon && G.style.cartoon.outline && (Ne = G.style.cartoon.outline), G && G.style.cartoon && (!H.style.cartoon || G.style.cartoon.opacity != H.style.cartoon.opacity) && ye(G.chain == H.chain), W.style === "trace") { - if (!H.hetflag) { - if (H.elem === "C" && H.atom === "CA" || ke && H.atom === "P" || H.atom === "BB") { - if (te = je(H, W), (0, v.isNumeric)(W.thickness) ? ee = W.thickness : ee = M, c(G, H)) - if (te == Q) { - var K = o.CC.color(te); - d.GLDraw.drawCylinder(Oe, G, H, ee, K, 2, 2); + V = q[me]; + var ze = V.resn.trim(), $e = ze in L; + if (Ge = 1, W = V.style.cartoon, N && N.style.cartoon && (Ge = N.style.cartoon.opacity), N && N.style.cartoon && N.style.cartoon.outline && (Ue = N.style.cartoon.outline), N && N.style.cartoon && (!V.style.cartoon || N.style.cartoon.opacity != V.style.cartoon.opacity) && xe(N.chain == V.chain), W.style === "trace") { + if (!V.hetflag) { + if (V.elem === "C" && V.atom === "CA" || $e && V.atom === "P" || V.atom === "BB") { + if (re = je(V, W), (0, _.isNumeric)(W.thickness) ? te = W.thickness : te = M, c(N, V)) + if (re == J) { + var K = o.CC.color(re); + d.GLDraw.drawCylinder(ke, N, V, te, K, 2, 2); } else { - var ae = new r.Vector3().addVectors(G, H).multiplyScalar(0.5), ge = o.CC.color(Q), xe = o.CC.color(te); - d.GLDraw.drawCylinder(Oe, G, ae, ee, ge, 2, 0), d.GLDraw.drawCylinder(Oe, ae, H, ee, xe, 0, 2); + var oe = new r.Vector3().addVectors(N, V).multiplyScalar(0.5), ge = o.CC.color(J), we = o.CC.color(re); + d.GLDraw.drawCylinder(ke, N, oe, te, ge, 2, 0), d.GLDraw.drawCylinder(ke, oe, V, te, we, 0, 2); } - if ((H.clickable === !0 || H.hoverable) && H.intersectionShape !== void 0) { - var ue = new r.Vector3(H.x, H.y, H.z); - H.intersectionShape.sphere.push(new a.Sphere(ue, ee)); + if ((V.clickable === !0 || V.hoverable) && V.intersectionShape !== void 0) { + var de = new r.Vector3(V.x, V.y, V.z); + V.intersectionShape.sphere.push(new a.Sphere(de, te)); } - G = H, Q = te; + N = V, J = re; } } } else { - if (b(H) || ke && (H.atom === "P" || H.atom.indexOf("O5") == 0)) { - if (Te) - if (H.ss === "tube end") - Te = !1, ne = new r.Vector3(H.x, H.y, H.z), d.GLDraw.drawCylinder(Oe, le, ne, 2, o.CC.color(Q), 1, 1), H.ss = "h"; - else if (G.chain != H.chain || G.ss === "tube end") - Te = !1, G.ss = "h", ne = new r.Vector3(G.x, G.y, G.z), d.GLDraw.drawCylinder(Oe, le, ne, 2, o.CC.color(Q), 1, 1); + if (b(V) || $e && (V.atom === "P" || V.atom.indexOf("O5") == 0)) { + if (ye) + if (V.ss === "tube end") + ye = !1, Q = new r.Vector3(V.x, V.y, V.z), d.GLDraw.drawCylinder(ke, se, Q, 2, o.CC.color(J), 1, 1), V.ss = "h"; + else if (N.chain != V.chain || N.ss === "tube end") + ye = !1, N.ss = "h", Q = new r.Vector3(N.x, N.y, N.z), d.GLDraw.drawCylinder(ke, se, Q, 2, o.CC.color(J), 1, 1); else continue; - if (G && (!c(G, H) || G.ss === "tube start")) { - for (G.ss === "tube start" && (Te = !0, le = new r.Vector3(G.x, G.y, G.z), G.ss = "h"), pe && (Ae ? Ie = new r.Vector3().addVectors(G, Ae).multiplyScalar(0.5) : Ie = new r.Vector3(G.x, G.y, G.z), d.GLDraw.drawCylinder(Oe, Ie, pe, m, o.CC.color(pe.color), 0, 2), E(Pe, N, !0, Ae, Se, he, G, q, me), Ue.push(te), Ie = null, pe = null), Pe[0].length > 0 && g(Be, Pe, Ue, B, ee, Ge, Pe.style), Pe = [], ce = 0; ce < N; ce++) - Pe[ce] = []; - Ue = []; + if (N && (!c(N, V) || N.ss === "tube start")) { + for (N.ss === "tube start" && (ye = !0, se = new r.Vector3(N.x, N.y, N.z), N.ss = "h"), pe && (Me ? Ie = new r.Vector3().addVectors(N, Me).multiplyScalar(0.5) : Ie = new r.Vector3(N.x, N.y, N.z), d.GLDraw.drawCylinder(ke, Ie, pe, m, o.CC.color(pe.color), 0, 2), E(Be, U, !0, Me, Ae, ce, N, q, me), Ne.push(re), Ie = null, pe = null), Be[0].length > 0 && g(Pe, Be, Ne, R, te, Ge, Be.style), Be = [], ue = 0; ue < U; ue++) + Be[ue] = []; + Ne = []; } - if (G === void 0 || G.rescode != H.rescode || G.resi != H.resi) { - if (pe && G != null) { - Ie = new r.Vector3().addVectors(G, H).multiplyScalar(0.5); - var Ce = Ie.clone().sub(pe).multiplyScalar(0.02); - Ie.add(Ce), d.GLDraw.drawCylinder(Oe, Ie, pe, m, o.CC.color(pe.color), 0, 2), Ie = null, pe = null; + if (N === void 0 || N.rescode != V.rescode || N.resi != V.resi) { + if (pe && N != null) { + Ie = new r.Vector3().addVectors(N, V).multiplyScalar(0.5); + var Te = Ie.clone().sub(pe).multiplyScalar(0.02); + Ie.add(Te), d.GLDraw.drawCylinder(ke, Ie, pe, m, o.CC.color(pe.color), 0, 2), Ie = null, pe = null; } - te = je(H, W), Ue.push(te), (0, v.isNumeric)(W.thickness) ? ee = W.thickness : ee = M, G = H, fe = new r.Vector3(G.x, G.y, G.z), fe.resi = G.resi, Q = te; + re = je(V, W), Ne.push(re), (0, _.isNumeric)(W.thickness) ? te = W.thickness : te = M, N = V, ie = new r.Vector3(N.x, N.y, N.z), ie.resi = N.resi, J = re; } - (H.clickable === !0 || H.hoverable === !0) && (H.intersectionShape === void 0 || H.intersectionShape.triangle === void 0) && (H.intersectionShape = { + (V.clickable === !0 || V.hoverable === !0) && (V.intersectionShape === void 0 || V.intersectionShape.triangle === void 0) && (V.intersectionShape = { sphere: null, cylinder: [], line: [], triangle: [] }); - } else G != null && (b(G) && H.atom === "O" || ke && G.atom === "P" && (H.atom === "OP2" || H.atom === "O2P") || ke && G.atom.indexOf("O5") == 0 && H.atom.indexOf("C5") == 0) ? (oe = new r.Vector3(H.x, H.y, H.z), oe.resi = H.resi, (H.atom === "OP2" || H.atom === "O2P") && (Se = new r.Vector3(H.x, H.y, H.z))) : ke && H.atom.indexOf("O3") == 0 ? Ae = new r.Vector3(H.x, H.y, H.z) : (H.atom === "N1" && ze in k || H.atom === "N3" && ze in $) && (pe = new r.Vector3(H.x, H.y, H.z), pe.color = (0, v.getColorFromStyle)(H, W).getHex()); - oe && fe && oe.resi === fe.resi && (E(Pe, N, !0, fe, oe, he, G, q, me), he = oe, fe = null, oe = null, Ue.push(te)); + } else N != null && (b(N) && V.atom === "O" || $e && N.atom === "P" && (V.atom === "OP2" || V.atom === "O2P") || $e && N.atom.indexOf("O5") == 0 && V.atom.indexOf("C5") == 0) ? (ae = new r.Vector3(V.x, V.y, V.z), ae.resi = V.resi, (V.atom === "OP2" || V.atom === "O2P") && (Ae = new r.Vector3(V.x, V.y, V.z))) : $e && V.atom.indexOf("O3") == 0 ? Me = new r.Vector3(V.x, V.y, V.z) : (V.atom === "N1" && ze in k || V.atom === "N3" && ze in $) && (pe = new r.Vector3(V.x, V.y, V.z), pe.color = (0, _.getColorFromStyle)(V, W).getHex()); + ae && ie && ae.resi === ie.resi && (E(Be, U, !0, ie, ae, ce, N, q, me), ce = ae, ie = null, ae = null, Ne.push(re)); } } - pe && (Ae ? Ie = new r.Vector3().addVectors(G, Ae).multiplyScalar(0.5) : Ie = new r.Vector3(G.x, G.y, G.z), d.GLDraw.drawCylinder(Oe, Ie, pe, m, o.CC.color(pe.color), 0, 2), E(Pe, N, !0, Ae, Se, he, G, q, me), Ue.push(te)), ye(!1); + pe && (Me ? Ie = new r.Vector3().addVectors(N, Me).multiplyScalar(0.5) : Ie = new r.Vector3(N.x, N.y, N.z), d.GLDraw.drawCylinder(ke, Ie, pe, m, o.CC.color(pe.color), 0, 2), E(Be, U, !0, Me, Ae, ce, N, q, me), Ne.push(re)), xe(!1); } } ), @@ -33939,7 +33961,7 @@ ATOM`, b); /* harmony export */ Cylinder: () => ( /* reexport safe */ - v.Cylinder + _.Cylinder ), /* harmony export */ GLDraw: () => ( @@ -34054,7 +34076,7 @@ ATOM`, b); /* harmony export */ Sphere: () => ( /* reexport safe */ - v.Sphere + _.Sphere ), /* harmony export */ SurfaceType: () => ( @@ -34064,7 +34086,7 @@ ATOM`, b); /* harmony export */ Triangle: () => ( /* reexport safe */ - v.Triangle + _.Triangle ), /* harmony export */ Vector2: () => ( @@ -34331,7 +34353,7 @@ ATOM`, b); ), d = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), v = t( + ), _ = t( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" ), f = t( @@ -34404,7 +34426,7 @@ ATOM`, b); ), d = t( /*! ../WebGL */ "./src/WebGL/index.ts" - ), v = t( + ), _ = t( /*! ./utils/isEmpty */ "./src/parsers/utils/isEmpty.ts" ), f = t( @@ -34416,8 +34438,8 @@ ATOM`, b); if (this.C = {}, l) { let u = l.getField("comp_id"), p = l.getField("atom_id_1"), g = l.getField("atom_id_2"), b = l.getField("value_order"); for (let c = 0; c < u.length; c++) { - let _ = u[c], E = p[c], w = g[c], k = b[c], $ = 1; - k == "doub" ? $ = 2 : k == "trip" && ($ = 3), this.C[_] == null && (this.C[_] = {}), this.C[_][E] == null && (this.C[_][E] = {}), this.C[_][w] == null && (this.C[_][w] = {}), this.C[_][E][w] = $, this.C[_][w][E] = $; + let v = u[c], E = p[c], w = g[c], k = b[c], $ = 1; + k == "doub" ? $ = 2 : k == "trip" && ($ = 3), this.C[v] == null && (this.C[v] = {}), this.C[v][E] == null && (this.C[v][E] = {}), this.C[v][w] == null && (this.C[v][w] = {}), this.C[v][E][w] = $, this.C[v][w][E] = $; } } } @@ -34429,11 +34451,11 @@ ATOM`, b); class A { constructor(l) { if (this.C = [], l) { - let u = l.getField("conn_type_id"), p = l.getField("ptnr1_label_asym_id"), g = l.getField("ptnr1_label_seq_id"), b = l.getField("ptnr1_label_comp_id"), c = l.getField("ptnr1_label_atom_id"), _ = l.getField("ptnr2_label_asym_id"), E = l.getField("ptnr2_label_seq_id"), w = l.getField("ptnr2_label_comp_id"), k = l.getField("ptnr2_label_atom_id"), $ = l.getField("pdbx_value_order"); + let u = l.getField("conn_type_id"), p = l.getField("ptnr1_label_asym_id"), g = l.getField("ptnr1_label_seq_id"), b = l.getField("ptnr1_label_comp_id"), c = l.getField("ptnr1_label_atom_id"), v = l.getField("ptnr2_label_asym_id"), E = l.getField("ptnr2_label_seq_id"), w = l.getField("ptnr2_label_comp_id"), k = l.getField("ptnr2_label_atom_id"), $ = l.getField("pdbx_value_order"); for (let L = 0; L < u.length; L++) if (u[L] == "disulf" || u[L] == "covale") { - let z = $ ? $[L] == "" ? 1 : parseInt($[L]) : 1; - this.C.push([[p[L], g[L], b[L], c[L]], [_[L], E[L], w[L], k[L]], z]); + let I = $ ? $[L] == "" ? 1 : parseInt($[L]) : 1; + this.C.push([[p[L], g[L], b[L], c[L]], [v[L], E[L], w[L], k[L]], I]); } } } @@ -34454,15 +34476,15 @@ ATOM`, b); for (let g in this.R[p]) for (let b in this.R[p][g]) { let c = this.R[p][g][b]; - for (let _ = 0; _ < c.length; _++) - for (let E = _ + 1; E < c.length; E++) { - let w = c[_], k = c[E], $ = l.order(b, w.atom, k.atom); + for (let v = 0; v < c.length; v++) + for (let E = v + 1; E < c.length; E++) { + let w = c[v], k = c[E], $ = l.order(b, w.atom, k.atom); $ > 0 && (w.bonds.push(k.index), k.bonds.push(w.index), w.bondOrder.push($), k.bondOrder.push($)); } } for (let p of u.C) { - let g = p[0], b = p[1], c = p[2], _ = this.geta(g), E = this.geta(b); - _ != null && E != null && (_.bonds.push(E.index), E.bonds.push(_.index), _.bondOrder.push(c), E.bondOrder.push(c)); + let g = p[0], b = p[1], c = p[2], v = this.geta(g), E = this.geta(b); + v != null && E != null && (v.bonds.push(E.index), E.bonds.push(v.index), v.bondOrder.push(c), E.bondOrder.push(c)); } } } @@ -34477,71 +34499,71 @@ ATOM`, b); } else m = new Uint8Array(m); - var _ = f.decodeMsgpack(m); - _ == 31 && (m = (0, r.inflateString)(m, !1), _ = f.decodeMsgpack(m)); - var E = [], w = E.modelData = [], k = _.dataBlocks.length; + var v = f.decodeMsgpack(m); + v == 31 && (m = (0, r.inflateString)(m, !1), v = f.decodeMsgpack(m)); + var E = [], w = E.modelData = [], k = v.dataBlocks.length; if (k == 0) return E; l.multimodel || (k = 1); for (let $ = 0; $ < k; $++) { let L = E.length; - const z = []; + const I = []; w.push({ symmetries: [] }), E.push([]); - const F = _.dataBlocks[$], R = /* @__PURE__ */ Object.create(null); + const F = v.dataBlocks[$], P = /* @__PURE__ */ Object.create(null); for (const Re of F.categories) - R[Re.name.substr(1)] = (0, h.Category)(Re); - let P = {}, U = R.struct_conf; - if (U) { - let Re = U.getField("conf_type_id"), De = U.getField("beg_label_asym_id"), je = U.getField("beg_label_seq_id"), Xe = U.getField("end_label_seq_id"); + P[Re.name.substr(1)] = (0, h.Category)(Re); + let B = {}, G = P.struct_conf; + if (G) { + let Re = G.getField("conf_type_id"), Ce = G.getField("beg_label_asym_id"), je = G.getField("beg_label_seq_id"), Xe = G.getField("end_label_seq_id"); for (let X = 0; X < Re.length; X++) if (Re[X].startsWith("H")) { - let q = De[X], re = je[X], ye = Xe[X]; - q in P || (P[q] = {}), P[q][re] = "h1"; - for (let me = re + 1; me < ye; me++) - P[q][me] = "h"; - P[q][ye] = "h2"; + let q = Ce[X], ne = je[X], xe = Xe[X]; + q in B || (B[q] = {}), B[q][ne] = "h1"; + for (let me = ne + 1; me < xe; me++) + B[q][me] = "h"; + B[q][xe] = "h2"; } } - let N = R.struct_sheet_range; - if (N) { - let Re = N.getField("id"), De = N.getField("beg_label_asym_id"), je = N.getField("beg_label_seq_id"), Xe = N.getField("end_label_seq_id"); + let U = P.struct_sheet_range; + if (U) { + let Re = U.getField("id"), Ce = U.getField("beg_label_asym_id"), je = U.getField("beg_label_seq_id"), Xe = U.getField("end_label_seq_id"); for (let X = 0; X < Re.length; X++) { - let q = De[X], re = je[X], ye = Xe[X]; - q in P || (P[q] = {}), P[q][re] = "s1"; - for (let me = re + 1; me < ye; me++) - P[q][me] = "s"; - P[q][ye] = "s2"; + let q = Ce[X], ne = je[X], xe = Xe[X]; + q in B || (B[q] = {}), B[q][ne] = "s1"; + for (let me = ne + 1; me < xe; me++) + B[q][me] = "s"; + B[q][xe] = "s2"; } } - let B = R.pdbx_struct_oper_list, W = B.getField("id"); + let R = P.pdbx_struct_oper_list, W = R.getField("id"); if (W && !b) { - let Re = B.getField("matrix[1][1]"), De = B.getField("matrix[1][2]"), je = B.getField("matrix[1][3]"), Xe = B.getField("matrix[2][1]"), X = B.getField("matrix[2][2]"), q = B.getField("matrix[2][3]"), re = B.getField("matrix[3][1]"), ye = B.getField("matrix[3][2]"), me = B.getField("matrix[3][3]"), ze = B.getField("vector[1]"), ke = B.getField("vector[2]"), K = B.getField("vector[3]"); - for (let ae = 0; ae < W.length; ae++) { - const ge = new d.Matrix4(Re[ae], De[ae], je[ae], ze[ae], Xe[ae], X[ae], q[ae], ke[ae], re[ae], ye[ae], me[ae], K[ae]); + let Re = R.getField("matrix[1][1]"), Ce = R.getField("matrix[1][2]"), je = R.getField("matrix[1][3]"), Xe = R.getField("matrix[2][1]"), X = R.getField("matrix[2][2]"), q = R.getField("matrix[2][3]"), ne = R.getField("matrix[3][1]"), xe = R.getField("matrix[3][2]"), me = R.getField("matrix[3][3]"), ze = R.getField("vector[1]"), $e = R.getField("vector[2]"), K = R.getField("vector[3]"); + for (let oe = 0; oe < W.length; oe++) { + const ge = new d.Matrix4(Re[oe], Ce[oe], je[oe], ze[oe], Xe[oe], X[oe], q[oe], $e[oe], ne[oe], xe[oe], me[oe], K[oe]); w[w.length - 1].symmetries.push(ge); } } - let V = new y(R.chem_comp_bond), G = new x(), H = new A(R.struct_conn), Q = R.atom_site, te = Q.rowCount, ee = Q.getField("group_PDB"), ce = Q.getField("Cartn_x"), fe = Q.getField("Cartn_y"), oe = Q.getField("Cartn_z"), he = Q.getField("auth_asym_id"), Ae = Q.getField("label_asym_id"), Se = Q.getField("auth_seq_id"), Ie = Q.getField("label_seq_id"), pe = Q.getField("auth_comp_id"), le = Q.getField("label_comp_id"), ne = Q.getField("auth_atom_id"), Te = Q.getField("label_atom_id"), Oe = Q.getField("type_symbol"), Be = Q.getField("B_iso_or_equiv"), Ue = Q.getField("id"), Pe = Q.getField("label_alt_id"), Ge = Q.getField("pdbx_PDB_model_num"), Ne = Ge ? Ge[0] : 0; - for (let Re = 0; Re < te; Re++) { - if (ee !== void 0 && ee[Re] === "TER") + let H = new y(P.chem_comp_bond), N = new x(), V = new A(P.struct_conn), J = P.atom_site, re = J.rowCount, te = J.getField("group_PDB"), ue = J.getField("Cartn_x"), ie = J.getField("Cartn_y"), ae = J.getField("Cartn_z"), ce = J.getField("auth_asym_id"), Me = J.getField("label_asym_id"), Ae = J.getField("auth_seq_id"), Ie = J.getField("label_seq_id"), pe = J.getField("auth_comp_id"), se = J.getField("label_comp_id"), Q = J.getField("auth_atom_id"), ye = J.getField("label_atom_id"), ke = J.getField("type_symbol"), Pe = J.getField("B_iso_or_equiv"), Ne = J.getField("id"), Be = J.getField("label_alt_id"), Ge = J.getField("pdbx_PDB_model_num"), Ue = Ge ? Ge[0] : 0; + for (let Re = 0; Re < re; Re++) { + if (te !== void 0 && te[Re] === "TER") continue; - if (Ge && Ge[Re] != Ne) - if (Ne = Ge[Re], l.multimodel) - l.onemol || (E.push([]), w.push(w[w.length - 1]), Ne = Ge[Re], G.setBonds(V, H), G = new x()); + if (Ge && Ge[Re] != Ue) + if (Ue = Ge[Re], l.multimodel) + l.onemol || (E.push([]), w.push(w[w.length - 1]), Ue = Ge[Re], N.setBonds(H, V), N = new x()); else break; - const De = {}; - De.x = ce[Re], De.y = fe[Re], De.z = oe[Re], De.chain = he ? he[Re] : Ae ? Ae[Re] : void 0, De.lchain = Ae ? Ae[Re] : void 0, De.resi = Se ? Se[Re] : Ie ? Ie[Re] : void 0, De.lresi = Ie ? Ie[Re] : void 0, De.resn = pe ? pe[Re].trim() : le ? le[Re].trim() : void 0, De.lresn = le ? le[Re].trim() : void 0, De.atom = ne ? ne[Re].replace(/"/gm, "") : Te ? Te[Re].replace(/"/gm, "") : void 0, De.icode = Pe ? Pe[Re] : void 0, De.altLoc = De.icode, De.hetflag = !ee || ee[Re] === "HETA" || ee[Re] === "HETATM"; + const Ce = {}; + Ce.x = ue[Re], Ce.y = ie[Re], Ce.z = ae[Re], Ce.chain = ce ? ce[Re] : Me ? Me[Re] : void 0, Ce.lchain = Me ? Me[Re] : void 0, Ce.resi = Ae ? Ae[Re] : Ie ? Ie[Re] : void 0, Ce.lresi = Ie ? Ie[Re] : void 0, Ce.resn = pe ? pe[Re].trim() : se ? se[Re].trim() : void 0, Ce.lresn = se ? se[Re].trim() : void 0, Ce.atom = Q ? Q[Re].replace(/"/gm, "") : ye ? ye[Re].replace(/"/gm, "") : void 0, Ce.icode = Be ? Be[Re] : void 0, Ce.altLoc = Ce.icode, Ce.hetflag = !te || te[Re] === "HETA" || te[Re] === "HETATM"; let je = "X"; - Oe && (je = Oe[Re].replace(/\(?\+?\d+.*/, "")), De.elem = je[0].toUpperCase() + je.substring(1, 2).toLowerCase(), Be && (De.b = Be[Re]), !(u && De.elem == "H") && (De.altLoc != "" && De.altLoc != p && p != "*" || (De.bonds = [], De.ss = "c", De.serial = Ue[Re], De.model = Ne, De.bondOrder = [], De.properties = {}, De.index = E[E.length - 1].length, z[De.serial] = [E.length, De.index], E[E.length - 1].push(De), G.add(De))); + ke && (je = ke[Re].replace(/\(?\+?\d+.*/, "")), Ce.elem = je[0].toUpperCase() + je.substring(1, 2).toLowerCase(), Pe && (Ce.b = Pe[Re]), !(u && Ce.elem == "H") && (Ce.altLoc != "" && Ce.altLoc != p && p != "*" || (Ce.bonds = [], Ce.ss = "c", Ce.serial = Ne[Re], Ce.model = Ue, Ce.bondOrder = [], Ce.properties = {}, Ce.index = E[E.length - 1].length, I[Ce.serial] = [E.length, Ce.index], E[E.length - 1].push(Ce), N.add(Ce))); } - if (G.setBonds(V, H), !(0, v.isEmpty)(P)) + if (N.setBonds(H, V), !(0, _.isEmpty)(B)) for (let Re = L; Re < E.length; Re++) { - let De = E[Re]; - for (let je = 0; je < De.length; je++) { - const Xe = De[je]; - if (Xe !== void 0 && Xe.lchain in P && Xe.lresi in P[Xe.lchain]) { - const X = P[Xe.lchain][Xe.lresi]; + let Ce = E[Re]; + for (let je = 0; je < Ce.length; je++) { + const Xe = Ce[je]; + if (Xe !== void 0 && Xe.lchain in B && Xe.lresi in B[Xe.lchain]) { + const X = B[Xe.lchain][Xe.lresi]; Xe.ss = X[0], X.length > 1 && (X[1] == "1" ? Xe.ssbegin = !0 : X[1] == "2" && (Xe.ssend = !0)); } } @@ -34572,15 +34594,15 @@ ATOM`, b); function r(a, s) { var h = [[]]; typeof a == "string" && (a = JSON.parse(a)); - for (var o = a.m, d = o[0].a, v = o[0].b, f = o[0].s, y = s !== void 0 && s.parseStyle !== void 0 ? s.parseStyle : f !== void 0, A = h[h.length - 1].length, x = 0; x < d.length; x++) { + for (var o = a.m, d = o[0].a, _ = o[0].b, f = o[0].s, y = s !== void 0 && s.parseStyle !== void 0 ? s.parseStyle : f !== void 0, A = h[h.length - 1].length, x = 0; x < d.length; x++) { var M = d[x], m = {}; m.id = M.i, m.x = M.x, m.y = M.y, m.z = M.z || 0, m.bonds = [], m.bondOrder = []; var l = M.l || "C"; m.elem = l[0].toUpperCase() + l.substring(1).toLowerCase(), m.serial = h[h.length - 1].length, y && (m.style = f[M.s || 0]), h[h.length - 1].push(m); } - for (let u = 0; u < v.length; u++) { - let p = v[u], g = p.b + A, b = p.e + A, c = p.o || 1, _ = h[h.length - 1][g], E = h[h.length - 1][b]; - _.bonds.push(b), _.bondOrder.push(c), E.bonds.push(g), E.bondOrder.push(c); + for (let u = 0; u < _.length; u++) { + let p = _[u], g = p.b + A, b = p.e + A, c = p.o || 1, v = h[h.length - 1][g], E = h[h.length - 1][b]; + v.bonds.push(b), v.bondOrder.push(c), E.bonds.push(g), E.bondOrder.push(c); } return h; } @@ -34614,20 +34636,20 @@ ATOM`, b); /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" ); - const o = function(v, f, y, A) { - return new s.Vector3(f, y, A).applyMatrix3(v); + const o = function(_, f, y, A) { + return new s.Vector3(f, y, A).applyMatrix3(_); }; - function d(v, f = {}) { + function d(_, f = {}) { const y = [], A = !f.doAssembly, x = y.modelData = [], M = f.assignBonds === void 0 ? !0 : f.assignBonds; - function m(c, _) { + function m(c, v) { const E = []; let w = 0, k = 0; for (; k < c.length; ) { - for (; c.substring(k, k + _.length) !== _ && k < c.length; ) + for (; c.substring(k, k + v.length) !== v && k < c.length; ) if (c[k] === "'") { for (k++; k < c.length && c[k] !== "'"; ) k++; - for (; c.substring(k, k + _.length) !== _ && k < c.length; ) + for (; c.substring(k, k + v.length) !== v && k < c.length; ) k++; } else if (c[k] === '"') { for (k++; k < c.length && c[k] !== '"'; ) @@ -34635,20 +34657,20 @@ ATOM`, b); k++; } else k++; - E.push(c.substring(w, k)), w = k = k + _.length; + E.push(c.substring(w, k)), w = k = k + v.length; } return E; } - const l = v.split(/\r?\n|\r/), u = []; + const l = _.split(/\r?\n|\r/), u = []; let p = !1; for (let c = 0; c < l.length; c++) { var g = l[c].split("#")[0]; if (p ? g[0] === ";" && (p = !1) : g[0] === ";" && (p = !0), p || g !== "") { if (!p && (g = g.trim(), g[0] === "_")) { - const _ = g.split(/\s/)[0].indexOf("."); - if (_ > -1) { + const v = g.split(/\s/)[0].indexOf("."); + if (v > -1) { let E = g.split(""); - E[_] = "_", g = E.join(""), g = g.substring(0, _) + "_" + g.substring(_ + 1); + E[v] = "_", g = E.join(""), g = g.substring(0, v) + "_" + g.substring(v + 1); } } u.push(g); @@ -34667,11 +34689,11 @@ ATOM`, b); const k = u[b].split(/\s/)[0].toLowerCase(), $ = c[k] = c[k] || [], L = u[b].substring(u[b].indexOf(k) + k.length); if (L === "") if (b++, u[b][0] === ";") { - let z = u[b].substring(1); + let I = u[b].substring(1); for (b++; u[b] !== ";"; ) - z = z + ` + I = I + ` ` + u[b], b++; - $.push(z); + $.push(I); } else $.push(u[b]); else @@ -34682,43 +34704,43 @@ ATOM`, b); const k = []; for (; u[b] === "" || u[b][0] === "_"; ) { if (u[b] !== "") { - let L = u[b].split(/\s/)[0].toLowerCase(), z = c[L] = c[L] || []; - k.push(z); + let L = u[b].split(/\s/)[0].toLowerCase(), I = c[L] = c[L] || []; + k.push(I); } b++; } let $ = 0; for (; b < u.length && u[b][0] !== "_" && !u[b].startsWith("loop_") && !u[b].startsWith("data_"); ) { let L = m(u[b], " "); - for (let z = 0; z < L.length; z++) - L[z] !== "" && (k[$].push(L[z]), $ = ($ + 1) % k.length); + for (let I = 0; I < L.length; I++) + L[I] !== "" && (k[$].push(L[I]), $ = ($ + 1) % k.length); b++; } } else b++; x.push({ symmetries: [] }), y.push([]); - const _ = c._atom_site_id !== void 0 ? c._atom_site_id.length : c._atom_site_label.length; + const v = c._atom_site_id !== void 0 ? c._atom_site_id.length : c._atom_site_label.length; let E; if (c._cell_length_a !== void 0) { - const k = parseFloat(c._cell_length_a), $ = parseFloat(c._cell_length_b), L = parseFloat(c._cell_length_c), z = parseFloat(c._cell_angle_alpha) || 90, F = parseFloat(c._cell_angle_beta) || 90, R = parseFloat(c._cell_angle_gamma) || 90; - E = (0, s.conversionMatrix3)(k, $, L, z, F, R), x[x.length - 1].cryst = { + const k = parseFloat(c._cell_length_a), $ = parseFloat(c._cell_length_b), L = parseFloat(c._cell_length_c), I = parseFloat(c._cell_angle_alpha) || 90, F = parseFloat(c._cell_angle_beta) || 90, P = parseFloat(c._cell_angle_gamma) || 90; + E = (0, s.conversionMatrix3)(k, $, L, I, F, P), x[x.length - 1].cryst = { a: k, b: $, c: L, - alpha: z, + alpha: I, beta: F, - gamma: R + gamma: P }; } - for (let k = 0; k < _; k++) { + for (let k = 0; k < v; k++) { if (c._atom_site_group_pdb !== void 0 && c._atom_site_group_pdb[k] === "TER") continue; const $ = {}; if (c._atom_site_cartn_x !== void 0) $.x = parseFloat(c._atom_site_cartn_x[k]), $.y = parseFloat(c._atom_site_cartn_y[k]), $.z = parseFloat(c._atom_site_cartn_z[k]); else { - const z = o(E, parseFloat(c._atom_site_fract_x[k]), parseFloat(c._atom_site_fract_y[k]), parseFloat(c._atom_site_fract_z[k])); - $.x = z.x, $.y = z.y, $.z = z.z; + const I = o(E, parseFloat(c._atom_site_fract_x[k]), parseFloat(c._atom_site_fract_y[k]), parseFloat(c._atom_site_fract_z[k])); + $.x = I.x, $.y = I.y, $.z = I.z; } $.chain = c._atom_site_auth_asym_id ? c._atom_site_auth_asym_id[k] : c._atom_site_label_asym_id ? c._atom_site_label_asym_id[k] : void 0, $.resi = c._atom_site_auth_seq_id ? parseInt(c._atom_site_auth_seq_id[k]) : c._atom_site_label_seq_id ? c._atom_site_label_seq_id[k] : void 0, $.resn = c._atom_site_auth_comp_id ? c._atom_site_auth_comp_id[k].trim() : c._atom_site_label_comp_id ? c._atom_site_label_comp_id[k].trim() : void 0, $.atom = c._atom_site_auth_atom_id ? c._atom_site_auth_atom_id[k].replace(/"/gm, "") : c._atom_site_label_atom_id ? c._atom_site_label_atom_id[k].replace(/"/gm, "") : void 0, $.hetflag = !c._atom_site_group_pdb || c._atom_site_group_pdb[k] === "HETA" || c._atom_site_group_pdb[k] === "HETATM", c._atom_site_b_iso_or_equiv && ($.b = parseFloat(c._atom_site_b_iso_or_equiv[k])); let L = "X"; @@ -34726,34 +34748,34 @@ ATOM`, b); } if (c._pdbx_struct_oper_list_id !== void 0 && !A) for (let k = 0; k < c._pdbx_struct_oper_list_id.length; k++) { - const $ = parseFloat(c["_pdbx_struct_oper_list_matrix[1][1]"][k]), L = parseFloat(c["_pdbx_struct_oper_list_matrix[1][2]"][k]), z = parseFloat(c["_pdbx_struct_oper_list_matrix[1][3]"][k]), F = parseFloat(c["_pdbx_struct_oper_list_vector[1]"][k]), R = parseFloat(c["_pdbx_struct_oper_list_matrix[2][1]"][k]), P = parseFloat(c["_pdbx_struct_oper_list_matrix[2][2]"][k]), U = parseFloat(c["_pdbx_struct_oper_list_matrix[2][3]"][k]), N = parseFloat(c["_pdbx_struct_oper_list_vector[2]"][k]), B = parseFloat(c["_pdbx_struct_oper_list_matrix[3][1]"][k]), W = parseFloat(c["_pdbx_struct_oper_list_matrix[3][2]"][k]), V = parseFloat(c["_pdbx_struct_oper_list_matrix[3][3]"][k]), G = parseFloat(c["_pdbx_struct_oper_list_vector[3]"][k]), H = new s.Matrix4($, L, z, F, R, P, U, N, B, W, V, G); - x[x.length - 1].symmetries.push(H); + const $ = parseFloat(c["_pdbx_struct_oper_list_matrix[1][1]"][k]), L = parseFloat(c["_pdbx_struct_oper_list_matrix[1][2]"][k]), I = parseFloat(c["_pdbx_struct_oper_list_matrix[1][3]"][k]), F = parseFloat(c["_pdbx_struct_oper_list_vector[1]"][k]), P = parseFloat(c["_pdbx_struct_oper_list_matrix[2][1]"][k]), B = parseFloat(c["_pdbx_struct_oper_list_matrix[2][2]"][k]), G = parseFloat(c["_pdbx_struct_oper_list_matrix[2][3]"][k]), U = parseFloat(c["_pdbx_struct_oper_list_vector[2]"][k]), R = parseFloat(c["_pdbx_struct_oper_list_matrix[3][1]"][k]), W = parseFloat(c["_pdbx_struct_oper_list_matrix[3][2]"][k]), H = parseFloat(c["_pdbx_struct_oper_list_matrix[3][3]"][k]), N = parseFloat(c["_pdbx_struct_oper_list_vector[3]"][k]), V = new s.Matrix4($, L, I, F, P, B, G, U, R, W, H, N); + x[x.length - 1].symmetries.push(V); } const w = function(k) { const $ = k.match("-"); k = k.replace(/[-xyz]/g, ""); const L = k.split("/"); - let z, F; - return L[1] === void 0 ? F = 1 : F = parseInt(L[1]), L[0] === "" ? z = 1 : z = parseInt(L[0]), z / F * ($ ? -1 : 1); + let I, F; + return L[1] === void 0 ? F = 1 : F = parseInt(L[1]), L[0] === "" ? I = 1 : I = parseInt(L[0]), I / F * ($ ? -1 : 1); }; if (c._symmetry_equiv_pos_as_xyz !== void 0 && !A) for (let k = 0; k < c._symmetry_equiv_pos_as_xyz.length; k++) { - const L = c._symmetry_equiv_pos_as_xyz[k].replace(/["' ]/g, "").split(",").map(function(P) { - return P.replace(/-/g, "+-"); + const L = c._symmetry_equiv_pos_as_xyz[k].replace(/["' ]/g, "").split(",").map(function(B) { + return B.replace(/-/g, "+-"); }); - let z = new s.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); - for (let P = 0; P < 3; P++) { - const U = L[P].split("+"); - for (let N = 0; N < U.length; N++) { - const B = U[N]; - if (B === "") + let I = new s.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + for (let B = 0; B < 3; B++) { + const G = L[B].split("+"); + for (let U = 0; U < G.length; U++) { + const R = G[U]; + if (R === "") continue; - const W = w(B); - B.match("x") ? z.elements[P + 0] = W : B.match("y") ? z.elements[P + 4] = W : B.match("z") ? z.elements[P + 8] = W : z.elements[P + 12] = W; + const W = w(R); + R.match("x") ? I.elements[B + 0] = W : R.match("y") ? I.elements[B + 4] = W : R.match("z") ? I.elements[B + 8] = W : I.elements[B + 12] = W; } } - const F = E.getMatrix4(), R = new s.Matrix4().getInverse(F, !0); - z = new s.Matrix4().multiplyMatrices(z, R), z = new s.Matrix4().multiplyMatrices(F, z), x[x.length - 1].symmetries.push(z); + const F = E.getMatrix4(), P = new s.Matrix4().getInverse(F, !0); + I = new s.Matrix4().multiplyMatrices(I, P), I = new s.Matrix4().multiplyMatrices(F, I), x[x.length - 1].symmetries.push(I); } } for (let c = 0; c < y.length; c++) @@ -34789,11 +34811,11 @@ ATOM`, b); ); function h(o, d) { d = d || {}; - const v = [[]]; + const _ = [[]]; let f = o.split(/\r?\n/); const y = d.assignBonds === void 0 ? !0 : d.assignBonds; if (f.length < 6) - return v; + return _; let A = f[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); const x = Math.abs(parseFloat(A[0])); let M = { @@ -34811,23 +34833,23 @@ ATOM`, b); A = f[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); const g = Math.abs(A[0]), b = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); A = f[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - const c = Math.abs(A[0]), _ = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); - if (M.size = { x: u, y: g, z: c }, M.unit = new r.Vector3(p.x, b.y, _.z), p.y != 0 || p.z != 0 || b.x != 0 || b.z != 0 || _.x != 0 || _.y != 0) { - M.matrix4 = new r.Matrix4(p.x, b.x, _.x, 0, p.y, b.y, _.y, 0, p.z, b.z, _.z, 0, 0, 0, 0, 1); + const c = Math.abs(A[0]), v = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); + if (M.size = { x: u, y: g, z: c }, M.unit = new r.Vector3(p.x, b.y, v.z), p.y != 0 || p.z != 0 || b.x != 0 || b.z != 0 || v.x != 0 || v.y != 0) { + M.matrix4 = new r.Matrix4(p.x, b.x, v.x, 0, p.y, b.y, v.y, 0, p.z, b.z, v.z, 0, 0, 0, 0, 1); let F = new r.Matrix4().makeTranslation(m.x, m.y, m.z); M.matrix4 = M.matrix4.multiplyMatrices(F, M.matrix4), M.matrix = M.matrix4.matrix3FromTopLeft(), M.origin = new r.Vector3(0, 0, 0), M.unit = new r.Vector3(1, 1, 1); } - v.modelData = [{ cryst: M }], f = f.splice(6, x); - for (var E = v[v.length - 1].length, w = E + f.length, k = E; k < w; ++k) { + _.modelData = [{ cryst: M }], f = f.splice(6, x); + for (var E = _[_.length - 1].length, w = E + f.length, k = E; k < w; ++k) { var $ = {}; $.serial = k; - var L = f[k - E], z = L.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - $.elem = s.anumToSymbol[z[0]], $.x = parseFloat(z[2]) * l, $.y = parseFloat(z[3]) * l, $.z = parseFloat(z[4]) * l, $.hetflag = !0, $.bonds = [], $.bondOrder = [], $.properties = {}, v[v.length - 1].push($); + var L = f[k - E], I = L.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + $.elem = s.anumToSymbol[I[0]], $.x = parseFloat(I[2]) * l, $.y = parseFloat(I[3]) * l, $.z = parseFloat(I[4]) * l, $.hetflag = !0, $.bonds = [], $.bondOrder = [], $.properties = {}, _[_.length - 1].push($); } if (y) - for (let F = 0; F < v.length; F++) - (0, a.assignBonds)(v[F], d); - return v; + for (let F = 0; F < _.length; F++) + (0, a.assignBonds)(_[F], d); + return _; } } ), @@ -34854,28 +34876,28 @@ ATOM`, b); "./src/parsers/utils/atomNameToElem.ts" ); function s(h, o) { - const d = [], v = h.split(/\r?\n|\r/); - for (; v.length > 0; ) { - const f = parseInt(v[1]); - if (v.length < 3 || isNaN(f) || f <= 0 || v.length < f + 3) + const d = [], _ = h.split(/\r?\n|\r/); + for (; _.length > 0; ) { + const f = parseInt(_[1]); + if (_.length < 3 || isNaN(f) || f <= 0 || _.length < f + 3) break; const A = []; d.push(A); let x = 2; const M = A.length, m = M + f; for (let l = M; l < m; l++) { - const u = v[x++], p = {}; + const u = _[x++], p = {}; p.serial = l, p.atom = u.slice(10, 15).trim(), p.elem = (0, a.atomNameToElem)(p.atom, !0), p.x = 10 * parseFloat(u.slice(20, 28)), p.y = 10 * parseFloat(u.slice(28, 36)), p.z = 10 * parseFloat(u.slice(36, 44)), p.resi = parseInt(u.slice(0, 5)), p.resn = u.slice(5, 10).trim(), p.bonds = [], p.bondOrder = [], p.properties = {}, u.length > 44 && (p.dx = 10 * parseFloat(u.slice(44, 52)), p.dy = 10 * parseFloat(u.slice(52, 60)), p.dz = 10 * parseFloat(u.slice(60, 68))), A[l] = p; } - if (v.length <= x + 3) { - const u = v[x++].trim().split(/\s+/); + if (_.length <= x + 3) { + const u = _[x++].trim().split(/\s+/); if (u.length === 3) { for (let p = 0; p < 3; p++) u[p] = (parseFloat(u[p]) * 10).toString(); d.box = u; } } - v.splice(0, ++x); + _.splice(0, ++x); } for (let f = 0; f < d.length; f++) (0, r.assignPDBBonds)(d[f], o); @@ -34922,18 +34944,18 @@ ATOM`, b); zsu: "z" }; function s(h, o) { - const d = [], v = h.split(/\r?\n|\r/); + const d = [], _ = h.split(/\r?\n|\r/); let f = 0, y = 0, A = 0; - for (; A < v.length - 9; ) { - for (var x = A; x < v.length; x++) - if (v[x].match(/ITEM: NUMBER OF ATOMS/) && (y = parseInt(v[x + 1])), v[x].match(/ITEM: ATOMS/)) { + for (; A < _.length - 9; ) { + for (var x = A; x < _.length; x++) + if (_[x].match(/ITEM: NUMBER OF ATOMS/) && (y = parseInt(_[x + 1])), _[x].match(/ITEM: ATOMS/)) { f = x + 1; break; } - const M = v[f - 1].replace("ITEM: ATOMS ", "").split(" "); + const M = _[f - 1].replace("ITEM: ATOMS ", "").split(" "); d.push([]); for (let m = f; m < f + y; m++) { - const l = {}, u = {}, p = v[m].split(" "); + const l = {}, u = {}, p = _[m].split(" "); for (let g = 0; g < p.length; g++) { const b = a[M[g]]; b !== void 0 && (b === "serial" ? l[b] = parseInt(p[g]) : b === "x" || b === "y" || b === "z" ? l[b] = parseFloat(p[g]) : b === "charge" || b === "radius" ? u[b] = parseFloat(p[g]) : l[b] = p[g]), l.properties = u, l.bonds = [], l.bondOrder = []; @@ -34981,7 +35003,7 @@ ATOM`, b); "./src/vendor/mmtf.js" ), d = function(A) { return String.fromCharCode.apply(null, A).replace(/\0/g, ""); - }, v = function(A) { + }, _ = function(A) { return A == 0 || A == 2 || A == 4 ? "h" : A == 3 ? "s" : "c"; }; let f = /* @__PURE__ */ new Set([ @@ -34999,120 +35021,120 @@ ATOM`, b); function y(A, x) { var M = !x.keepH, m = x.altLoc ? x.altLoc : "A", l = !!x.noSecondaryStructure, u = !x.noComputeSecondaryStructure, p = !x.doAssembly, g = x.assemblyIndex ? x.assemblyIndex : 0; typeof A == "string" ? A = (0, r.base64ToArray)(A) : A = new Uint8Array(A); - var b = o.decode(A), c = [[]], _ = c.modelData = [], E = 0, w = 0, k = 0, $ = b.secStructList, L = b.bFactorList, z = b.altLocList, F = b.occupancyList, R = b.bondAtomList, P = b.bondOrderList, U = b.numModels; - if (U == 0) + var b = o.decode(A), c = [[]], v = c.modelData = [], E = 0, w = 0, k = 0, $ = b.secStructList, L = b.bFactorList, I = b.altLocList, F = b.occupancyList, P = b.bondAtomList, B = b.bondOrderList, G = b.numModels; + if (G == 0) return c; - x.multimodel || (U = 1); - var N, B, W, V, G, H, Q = []; + x.multimodel || (G = 1); + var U, R, W, H, N, V, J = []; if (!p && b.bioAssemblyList && b.bioAssemblyList.length > 0) { - var te = b.bioAssemblyList[g].transformList; - for (N = 0, H = te.length; N < H; N++) { - var ee = new a.Matrix4(te[N].matrix); - ee.transpose(), Q.push(ee); + var re = b.bioAssemblyList[g].transformList; + for (U = 0, V = re.length; U < V; U++) { + var te = new a.Matrix4(re[U].matrix); + te.transpose(), J.push(te); } } - var ce = null; + var ue = null; if (b.unitCell) { - var fe = b.unitCell; - ce = { a: fe[0], b: fe[1], c: fe[2], alpha: fe[3], beta: fe[4], gamma: fe[5] }; + var ie = b.unitCell; + ue = { a: ie[0], b: ie[1], c: ie[2], alpha: ie[3], beta: ie[4], gamma: ie[5] }; } - let oe = []; + let ae = []; b.entityList.forEach((ve) => { ve.chainIndexList.forEach((Y) => { - oe[Y] = ve.type == "polymer"; + ae[Y] = ve.type == "polymer"; }); }); - var he = 0; - for (G = 0; G < U; G++) { - var Ae = b.chainsPerModel[G], Se = c[c.length - 1], Ie = []; - for (_.push({ symmetries: Q, cryst: ce }), N = 0; N < Ae; ++N) { - var pe = b.groupsPerChain[E], le = d(b.chainIdList.subarray(E * 4, E * 4 + 4)); - b.chainNameList && (le = d(b.chainNameList.subarray(E * 4, E * 4 + 4))); - var ne = w, Te = ""; - for (B = 0; B < pe; ++B) { - var Oe = b.groupList[b.groupTypeList[w]], Be = Oe.atomNameList.length, Ue = 0, Pe = !1, Ge = !1; + var ce = 0; + for (N = 0; N < G; N++) { + var Me = b.chainsPerModel[N], Ae = c[c.length - 1], Ie = []; + for (v.push({ symmetries: J, cryst: ue }), U = 0; U < Me; ++U) { + var pe = b.groupsPerChain[E], se = d(b.chainIdList.subarray(E * 4, E * 4 + 4)); + b.chainNameList && (se = d(b.chainNameList.subarray(E * 4, E * 4 + 4))); + var Q = w, ye = ""; + for (R = 0; R < pe; ++R) { + var ke = b.groupList[b.groupTypeList[w]], Pe = ke.atomNameList.length, Ne = 0, Be = !1, Ge = !1; if ($) { - Ue = $[w]; - var Ne = v(Ue); - (w == 0 || Ne != Te) && (Pe = !0), Te = Ne; + Ne = $[w]; + var Ue = _(Ne); + (w == 0 || Ue != ye) && (Be = !0), ye = Ue; var Re = w + 1; - (Re >= $.length || v($[Re] != Ne)) && (Ge = !0); + (Re >= $.length || _($[Re] != Ue)) && (Ge = !0); } - var De = b.groupIdList[w], je = Oe.groupName; - let ve = Oe.chemCompType; + var Ce = b.groupIdList[w], je = ke.groupName; + let ve = ke.chemCompType; var Xe = k; - let Y = f.has(ve) || !oe[E]; - for (W = 0; W < Be; ++W) { - var X = Oe.elementList[W]; + let Y = f.has(ve) || !ae[E]; + for (W = 0; W < Pe; ++W) { + var X = ke.elementList[W]; if (M && X == "H") { k += 1; continue; } var q = ""; L && (q = L[k]); - var re = ""; - z && z[k] && (re = String.fromCharCode(z[k])); - var ye = ""; - if (F && (ye = F[k]), re != "" && re != m && m != "*") { + var ne = ""; + I && I[k] && (ne = String.fromCharCode(I[k])); + var xe = ""; + if (F && (xe = F[k]), ne != "" && ne != m && m != "*") { k += 1; continue; } - var me = b.atomIdList[k], ze = Oe.atomNameList[W], ke = 0; - Oe.atomChargeList && (ke = Oe.atomChargeList[W]); - var K = b.xCoordList[k], ae = b.yCoordList[k], ge = b.zCoordList[k]; - Ie[k] = Se.length, Se.push({ + var me = b.atomIdList[k], ze = ke.atomNameList[W], $e = 0; + ke.atomChargeList && ($e = ke.atomChargeList[W]); + var K = b.xCoordList[k], oe = b.yCoordList[k], ge = b.zCoordList[k]; + Ie[k] = Ae.length, Ae.push({ resn: je, x: K, - y: ae, + y: oe, z: ge, elem: X, hetflag: Y, - chain: le, - resi: De, - icode: re, - rescode: De + (re != " " ? "^" + re : ""), + chain: se, + resi: Ce, + icode: ne, + rescode: Ce + (ne != " " ? "^" + ne : ""), // resi // and // icode serial: me, - altLoc: re, + altLoc: ne, index: k, atom: ze, bonds: [], - ss: v(Ue), - ssbegin: Pe, + ss: _(Ne), + ssbegin: Be, ssend: Ge, bondOrder: [], - properties: { charge: ke, occupancy: ye }, + properties: { charge: $e, occupancy: xe }, b: q }), k += 1; } - var xe = Oe.bondAtomList; - for (W = 0, V = Oe.bondOrderList.length; W < V; ++W) { - var ue = Xe + xe[W * 2], Ce = Xe + xe[W * 2 + 1], Z = Oe.bondOrderList[W], Fe = Ie[ue], We = Ie[Ce], I = Se[Fe], we = Se[We]; - I && we && (I.bonds.push(We), I.bondOrder.push(Z), we.bonds.push(Fe), we.bondOrder.push(Z)); + var we = ke.bondAtomList; + for (W = 0, H = ke.bondOrderList.length; W < H; ++W) { + var de = Xe + we[W * 2], Te = Xe + we[W * 2 + 1], Z = ke.bondOrderList[W], Fe = Ie[de], We = Ie[Te], z = Ae[Fe], Ee = Ae[We]; + z && Ee && (z.bonds.push(We), z.bondOrder.push(Z), Ee.bonds.push(Fe), Ee.bondOrder.push(Z)); } w += 1; } - for (w = ne, B = 0; B < pe; ++B) + for (w = Q, R = 0; R < pe; ++R) w += 1; E += 1; } - if (R) - for (let ve = he, Y = R.length; ve < Y; ve += 2) { - let de = R[ve], Me = R[ve + 1], Ye = P ? P[ve / 2] : 1; - if (de >= k) { - he = ve; + if (P) + for (let ve = ce, Y = P.length; ve < Y; ve += 2) { + let fe = P[ve], De = P[ve + 1], Ye = B ? B[ve / 2] : 1; + if (fe >= k) { + ce = ve; break; } - let Ze = Ie[de], Ke = Ie[Me], rt = Se[Ze], wt = Se[Ke]; + let Ze = Ie[fe], Ke = Ie[De], rt = Ae[Ze], wt = Ae[Ke]; rt && wt && (rt.bonds.push(Ke), rt.bondOrder.push(Ye), wt.bonds.push(Ze), wt.bondOrder.push(Ye)); } x.multimodel && (x.onemol || c.push([])); } if (!p) for (let ve = 0; ve < c.length; ve++) - (0, h.processSymmetries)(_[ve].symmetries, c[ve], x, _[ve].cryst); + (0, h.processSymmetries)(v[ve].symmetries, c[ve], x, v[ve].cryst); return u && !l && (0, s.computeSecondaryStructure)(c, x.hbondCutoff), c; } } @@ -35185,10 +35207,10 @@ ATOM`, b); function a(s, h) { var o = [[]], d = !1; typeof h.keepH < "u" && (d = !h.keepH); - var v = s.search(/@MOLECULE/), f = s.search(/@ATOM/); - if (v == -1 || f == -1) + var _ = s.search(/@MOLECULE/), f = s.search(/@ATOM/); + if (_ == -1 || f == -1) return o; - for (var y = s.substring(v).split(/\r?\n|\r/); y.length > 0; ) { + for (var y = s.substring(_).split(/\r?\n|\r/); y.length > 0; ) { var A = [], x = y[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), M = parseInt(x[0]), m = 0; x.length > 1 && (m = parseInt(x[1])); var l = 4, u; @@ -35200,8 +35222,8 @@ ATOM`, b); var p = o[o.length - 1].length, g = p + M, b; for (u = p; u < g; u++) { b = y[l++], x = b.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var c = {}, _ = x[5]; - if (r[_] !== void 0 ? _ = r[_] : (_ = _.split(".")[0], _ = _[0].toUpperCase() + _.substring(1).toLowerCase()), c.atom = x[1], c.elem = _, !(c.elem == "H" && d)) { + var c = {}, v = x[5]; + if (r[v] !== void 0 ? v = r[v] : (v = v.split(".")[0], v = v[0].toUpperCase() + v.substring(1).toLowerCase()), c.atom = x[1], c.elem = v, !(c.elem == "H" && d)) { var E = o[o.length - 1].length, w = parseInt(x[0]); c.serial = w, c.x = parseFloat(x[2]), c.y = parseFloat(x[3]), c.z = parseFloat(x[4]), c.atom = x[5]; var k = parseFloat(x[8]); @@ -35219,8 +35241,8 @@ ATOM`, b); if ($ && m) for (u = 0; u < m; u++) { b = y[l++], x = b.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var L = parseInt(x[1]), z = o[o.length - 1][A[L]], F = parseInt(x[2]), R = o[o.length - 1][A[F]], P = parseInt(x[3]); - isNaN(P) && (P = 1), z !== void 0 && R !== void 0 && (z.bonds.push(A[F]), z.bondOrder.push(P), R.bonds.push(A[L]), R.bondOrder.push(P)); + var L = parseInt(x[1]), I = o[o.length - 1][A[L]], F = parseInt(x[2]), P = o[o.length - 1][A[F]], B = parseInt(x[3]); + isNaN(B) && (B = 1), I !== void 0 && P !== void 0 && (I.bonds.push(A[F]), I.bondOrder.push(B), P.bonds.push(A[L]), P.bondOrder.push(B)); } if (h.multimodel) { h.onemol || o.push([]), y.splice(0, l), s = y.join(` @@ -35256,9 +35278,9 @@ ATOM`, b); h = h || {}; var o = [], d = {}; o.modelData = []; - for (var v = s.split(/\r?\n|\r/); v.length > 0; ) { - var f = (0, r.getSinglePDB)(v, h, d), y = f[0], A = f[1]; - if (v = f[2], y.length != 0) { + for (var _ = s.split(/\r?\n|\r/); _.length > 0; ) { + var f = (0, r.getSinglePDB)(_, h, d), y = f[0], A = f[1]; + if (_ = f[2], y.length != 0) { if (h.multimodel && h.onemol && o.length > 0) for (var x = o[0].length, M = 0; M < y.length; M++) { var m = y[M]; @@ -35300,7 +35322,7 @@ ATOM`, b); "./src/parsers/utils/computeSecondaryStructure.ts" ); function s(h, o) { - var d = [[]], v = !o.noSecondaryStructure; + var d = [[]], _ = !o.noSecondaryStructure; d.modelData = [{ symmetries: [] }]; var f = [], y = h.split(/\r?\n|\r/), A; for (let $ = 0; $ < y.length; $++) { @@ -35314,19 +35336,19 @@ ATOM`, b); break; else if (x == "ATOM " || x == "HETATM") { var M; - let L = parseInt(A.substring(6, 11)), z = A.substring(12, 16).replace(/ /g, ""), F = A.substring(17, 20).trim(), R = A.substring(21, 22), P = parseInt(A.substring(22, 26)); - var m = A.substring(30).trim().split(/\s+/), l = parseFloat(m[0]), u = parseFloat(m[1]), p = parseFloat(m[2]), g = parseFloat(m[3]), b = parseFloat(m[4]), c = z[0]; - z.length > 1 && z[1].toUpperCase() != z[1] && (c = z.substring(0, 2)), A[0] == "H" ? M = !0 : M = !1, f[L] = d[d.length - 1].length, d[d.length - 1].push({ + let L = parseInt(A.substring(6, 11)), I = A.substring(12, 16).replace(/ /g, ""), F = A.substring(17, 20).trim(), P = A.substring(21, 22), B = parseInt(A.substring(22, 26)); + var m = A.substring(30).trim().split(/\s+/), l = parseFloat(m[0]), u = parseFloat(m[1]), p = parseFloat(m[2]), g = parseFloat(m[3]), b = parseFloat(m[4]), c = I[0]; + I.length > 1 && I[1].toUpperCase() != I[1] && (c = I.substring(0, 2)), A[0] == "H" ? M = !0 : M = !1, f[L] = d[d.length - 1].length, d[d.length - 1].push({ resn: F, x: l, y: u, z: p, elem: c, hetflag: M, - chain: R, - resi: P, + chain: P, + resi: B, serial: L, - atom: z, + atom: I, bonds: [], ss: "c", bondOrder: [], @@ -35338,7 +35360,7 @@ ATOM`, b); pdbline: A }); } else if (x == "CONECT") { - var _ = parseInt(A.substring(6, 11)), E = d[d.length - 1][f[_]]; + var v = parseInt(A.substring(6, 11)), E = d[d.length - 1][f[v]]; for (let L = 0; L < 4; L++) { var w = parseInt(A.substring([11, 16, 21, 26][L], [11, 16, 21, 26][L] + 5)), k = d[d.length - 1][f[w]]; E !== void 0 && k !== void 0 && (E.bonds.push(f[w]), E.bondOrder.push(1)); @@ -35346,7 +35368,7 @@ ATOM`, b); } } for (let $ = 0; $ < d.length; $++) - (0, r.assignPDBBonds)(d[$], o), v && (0, a.computeSecondaryStructure)(d[$], o.hbondCutoff); + (0, r.assignPDBBonds)(d[$], o), _ && (0, a.computeSecondaryStructure)(d[$], o.hbondCutoff); return d; } } @@ -35369,7 +35391,7 @@ ATOM`, b); function r(a) { var s = [], h, o = 0, d = a.split(/\r?\n|\r/); if (d.length > 0 && d[0].includes("VERSION")) { - var v = d.filter(function(l) { + var _ = d.filter(function(l) { return l.includes("POINTERS") || l.includes("ATOM_NAME") || l.includes("CHARGE") || l.includes("RADII") || l.includes("BONDS_INC_HYDROGEN") || l.includes("BONDS_WITHOUT_HYDROGEN"); }), f = M("POINTERS"); if (f == -1) @@ -35424,7 +35446,7 @@ ATOM`, b); } else return []; function M(l) { - var u = d.indexOf(v.filter(function(p) { + var u = d.indexOf(_.filter(function(p) { return p.includes(l); })[0]); if (Number.isInteger(u) && u > 0) { @@ -35458,8 +35480,8 @@ ATOM`, b); /* harmony export */ }); var r = function(h, o) { - var d = [[]], v = !1; - for (typeof o.keepH < "u" && (v = !o.keepH); h.length > 0 && !(h.length < 4); ) { + var d = [[]], _ = !1; + for (typeof o.keepH < "u" && (_ = !o.keepH); h.length > 0 && !(h.length < 4); ) { var f = parseInt(h[3].substring(0, 3)); if (isNaN(f) || f <= 0) break; @@ -35470,12 +35492,12 @@ ATOM`, b); for (l = M; l < m; l++, A++) { u = h[A]; var p = {}, g = u.substring(31, 34).replace(/ /g, ""); - p.atom = p.elem = g[0].toUpperCase() + g.substring(1).toLowerCase(), (p.elem !== "H" || !v) && (p.serial = l, x[l] = d[d.length - 1].length, p.x = parseFloat(u.substring(0, 10)), p.y = parseFloat(u.substring(10, 20)), p.z = parseFloat(u.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = d[d.length - 1].length, d[d.length - 1].push(p)); + p.atom = p.elem = g[0].toUpperCase() + g.substring(1).toLowerCase(), (p.elem !== "H" || !_) && (p.serial = l, x[l] = d[d.length - 1].length, p.x = parseFloat(u.substring(0, 10)), p.y = parseFloat(u.substring(10, 20)), p.z = parseFloat(u.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = d[d.length - 1].length, d[d.length - 1].push(p)); } for (l = 0; l < y; l++, A++) { u = h[A]; - var b = x[parseInt(u.substring(0, 3)) - 1 + M], c = x[parseInt(u.substring(3, 6)) - 1 + M], _ = parseFloat(u.substring(6)); - typeof b < "u" && typeof c < "u" && (d[d.length - 1][b].bonds.push(c), d[d.length - 1][b].bondOrder.push(_), d[d.length - 1][c].bonds.push(b), d[d.length - 1][c].bondOrder.push(_)); + var b = x[parseInt(u.substring(0, 3)) - 1 + M], c = x[parseInt(u.substring(3, 6)) - 1 + M], v = parseFloat(u.substring(6)); + typeof b < "u" && typeof c < "u" && (d[d.length - 1][b].bonds.push(c), d[d.length - 1][b].bondOrder.push(v), d[d.length - 1][c].bonds.push(b), d[d.length - 1][c].bondOrder.push(v)); } if (o.multimodel) { for (o.onemol || d.push([]); h[A] !== "$$$$" && A < h.length; ) @@ -35486,8 +35508,8 @@ ATOM`, b); } return d; }, a = function(h, o) { - var d = [[]], v = !1; - for (typeof o.keepH < "u" && (v = !o.keepH); h.length > 0 && !(h.length < 8 || !h[4].startsWith("M V30 BEGIN CTAB") || !h[5].startsWith("M V30 COUNTS") || h[5].length < 14); ) { + var d = [[]], _ = !1; + for (typeof o.keepH < "u" && (_ = !o.keepH); h.length > 0 && !(h.length < 8 || !h[4].startsWith("M V30 BEGIN CTAB") || !h[5].startsWith("M V30 COUNTS") || h[5].length < 14); ) { var f = h[5].substring(13).match(/\S+/g); if (f.length < 2) break; @@ -35503,7 +35525,7 @@ ATOM`, b); var g = p.substring(6).match(/\S+/g); if (g.length > 4) { var b = {}, c = g[1].replace(/ /g, ""); - b.atom = b.elem = c[0].toUpperCase() + c.substring(1).toLowerCase(), (b.elem !== "H" || !v) && (b.serial = u, M[u] = d[d.length - 1].length, b.x = parseFloat(g[2]), b.y = parseFloat(g[3]), b.z = parseFloat(g[4]), b.hetflag = !0, b.bonds = [], b.bondOrder = [], b.properties = {}, b.index = d[d.length - 1].length, d[d.length - 1].push(b)); + b.atom = b.elem = c[0].toUpperCase() + c.substring(1).toLowerCase(), (b.elem !== "H" || !_) && (b.serial = u, M[u] = d[d.length - 1].length, b.x = parseFloat(g[2]), b.y = parseFloat(g[3]), b.z = parseFloat(g[4]), b.hetflag = !0, b.bonds = [], b.bondOrder = [], b.properties = {}, b.index = d[d.length - 1].length, d[d.length - 1].push(b)); } } if (h[x] === "M V30 END ATOM") @@ -35516,9 +35538,9 @@ ATOM`, b); break; for (u = 0; u < A; u++, x++) { p = h[x]; - var _ = p.substring(6).match(/\S+/g); - if (_.length > 3) { - var E = M[parseInt(_[2]) - 1 + m], w = M[parseInt(_[3]) - 1 + m], k = parseFloat(_[1]); + var v = p.substring(6).match(/\S+/g); + if (v.length > 3) { + var E = M[parseInt(v[2]) - 1 + m], w = M[parseInt(v[3]) - 1 + m], k = parseFloat(v[1]); typeof E < "u" && typeof w < "u" && (d[d.length - 1][E].bonds.push(w), d[d.length - 1][E].bondOrder.push(k), d[d.length - 1][w].bonds.push(E), d[d.length - 1][w].bondOrder.push(k)); } } @@ -35532,8 +35554,8 @@ ATOM`, b); return d; }; function s(h, o) { - var d = "V2000", v = h.split(/\r?\n|\r/); - return v.length > 3 && v[3].length > 38 && (d = v[3].substring(34, 39)), d === "V2000" ? r(v, o) : d === "V3000" ? a(v, o) : [[""]]; + var d = "V2000", _ = h.split(/\r?\n|\r/); + return _.length > 3 && _[3].length > 38 && (d = _[3].substring(34, 39)), d === "V2000" ? r(_, o) : d === "V3000" ? a(_, o) : [[""]]; } } ), @@ -35560,20 +35582,20 @@ ATOM`, b); "./src/parsers/utils/assignBonds.ts" ); function s(h, o = {}) { - var d = [[]], v = {}; + var d = [[]], _ = {}; const f = o.assignBonds === void 0 ? !0 : o.assignBonds; var y = h.replace(/^\s+/, "").split(/\r?\n/); if (y.length < 3) return d; if (y[1].match(/\d+/)) - v.length = parseFloat(y[1]); + _.length = parseFloat(y[1]); else return console.log("Warning: second line of the vasp structure file must be a number"), d; - if (v.length < 0) + if (_.length < 0) return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), d; - v.xVec = new Float32Array(y[2].replace(/^\s+/, "").split(/\s+/)), v.yVec = new Float32Array(y[3].replace(/^\s+/, "").split(/\s+/)), v.zVec = new Float32Array(y[4].replace(/^\s+/, "").split(/\s+/)); - var A = new r.Matrix3(v.xVec[0], v.xVec[1], v.xVec[2], v.yVec[0], v.yVec[1], v.yVec[2], v.zVec[0], v.zVec[1], v.zVec[2]); - A.multiplyScalar(v.length), d.modelData = [{ symmetries: [], cryst: { matrix: A } }]; + _.xVec = new Float32Array(y[2].replace(/^\s+/, "").split(/\s+/)), _.yVec = new Float32Array(y[3].replace(/^\s+/, "").split(/\s+/)), _.zVec = new Float32Array(y[4].replace(/^\s+/, "").split(/\s+/)); + var A = new r.Matrix3(_.xVec[0], _.xVec[1], _.xVec[2], _.yVec[0], _.yVec[1], _.yVec[2], _.zVec[0], _.zVec[1], _.zVec[2]); + A.multiplyScalar(_.length), d.modelData = [{ symmetries: [], cryst: { matrix: A } }]; var x = y[5].trim().split(/\s+/), M = new Int16Array(y[6].trim().split(/\s+/)), m = y[7].trim(), l = !1; if (m.match(/S/) && (l = !0, m = y[8].trim()), m.toLowerCase()[0] == "c") m = "cartesian"; @@ -35585,9 +35607,9 @@ ATOM`, b); return console.log("Warning: declaration of atomary species wrong:"), console.log(x), console.log(M), d; l ? y.splice(0, 9) : y.splice(0, 8); for (var u = 0, p = 0, g = x.length; p < g; p++) { - for (var b = x[p], c = 0, _ = M[p]; c < _; c++) { + for (var b = x[p], c = 0, v = M[p]; c < v; c++) { var E = new Float32Array(y[u + c].trim().split(/\s+/)), w = {}; - w.elem = b, m == "cartesian" ? (w.x = v.length * E[0], w.y = v.length * E[1], w.z = v.length * E[2]) : (w.x = v.length * (E[0] * v.xVec[0] + E[1] * v.yVec[0] + E[2] * v.zVec[0]), w.y = v.length * (E[0] * v.xVec[1] + E[1] * v.yVec[1] + E[2] * v.zVec[1]), w.z = v.length * (E[0] * v.xVec[2] + E[1] * v.yVec[2] + E[2] * v.zVec[2])), w.bonds = [], w.bondOrder = [], d[0].push(w); + w.elem = b, m == "cartesian" ? (w.x = _.length * E[0], w.y = _.length * E[1], w.z = _.length * E[2]) : (w.x = _.length * (E[0] * _.xVec[0] + E[1] * _.yVec[0] + E[2] * _.zVec[0]), w.y = _.length * (E[0] * _.xVec[1] + E[1] * _.yVec[1] + E[2] * _.zVec[1]), w.z = _.length * (E[0] * _.xVec[2] + E[1] * _.yVec[2] + E[2] * _.zVec[2])), w.bonds = [], w.bondOrder = [], d[0].push(w); } u += M[p]; } @@ -35622,7 +35644,7 @@ ATOM`, b); ); function s(h, o) { o = o || {}; - for (var d = [[]], v = o.assignBonds === void 0 ? !0 : o.assignBonds, f = h.split(/\r?\n|\r/); f.length > 0 && !(f.length < 3); ) { + for (var d = [[]], _ = o.assignBonds === void 0 ? !0 : o.assignBonds, f = h.split(/\r?\n|\r/); f.length > 0 && !(f.length < 3); ) { var y = parseInt(f[0]); if (isNaN(y) || y <= 0 || f.length < y + 2) break; @@ -35632,17 +35654,17 @@ ATOM`, b); d.modelData = [{ cryst: { matrix: m } }]; } for (var l = 2, u = d[d.length - 1].length, p = u + y, g = u; g < p; g++) { - var b = f[l++], c = b.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), _ = {}; - _.serial = g; + var b = f[l++], c = b.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), v = {}; + v.serial = g; var E = c[0]; - _.atom = _.elem = E[0].toUpperCase() + E.substring(1, 2).toLowerCase(), _.x = parseFloat(c[1]), _.y = parseFloat(c[2]), _.z = parseFloat(c[3]), _.hetflag = !0, _.bonds = [], _.bondOrder = [], _.properties = {}, d[d.length - 1][g] = _, c.length >= 7 && (_.dx = parseFloat(c[4]), _.dy = parseFloat(c[5]), _.dz = parseFloat(c[6])); + v.atom = v.elem = E[0].toUpperCase() + E.substring(1, 2).toLowerCase(), v.x = parseFloat(c[1]), v.y = parseFloat(c[2]), v.z = parseFloat(c[3]), v.hetflag = !0, v.bonds = [], v.bondOrder = [], v.properties = {}, d[d.length - 1][g] = v, c.length >= 7 && (v.dx = parseFloat(c[4]), v.dy = parseFloat(c[5]), v.dz = parseFloat(c[6])); } if (o.multimodel) d.push([]), f.splice(0, l); else break; } - if (v) + if (_) for (let k = 0; k < d.length; k++) (0, a.assignBonds)(d[k], o); if (o.onemol) { @@ -35651,10 +35673,10 @@ ATOM`, b); for (let k = 1; k < w.length; k++) { let $ = d[0].length; for (let L = 0; L < w[k].length; L++) { - let z = w[k][L]; - for (let F = 0; F < z.bonds.length; F++) - z.bonds[F] = z.bonds[F] + $; - z.index = d[0].length, z.serial = d[0].length, d[0].push(z); + let I = w[k][L]; + for (let F = 0; F < I.bonds.length; F++) + I.bonds[F] = I.bonds[F] + $; + I.index = d[0].length, I.serial = d[0].length, d[0].push(I); } } } @@ -35690,9 +35712,9 @@ ATOM`, b); name: s.name.substring(1), fieldNames: s.columns.map((d) => d.name), getField(d) { - const v = h[d]; - if (v) - return o[d] || (o[d] = (0, r.decode)(v.data)), o[d]; + const _ = h[d]; + if (_) + return o[d] || (o[d] = (0, r.decode)(_.data)), o[d]; } }; } @@ -35719,16 +35741,16 @@ ATOM`, b); ); const a = new Uint16Array(new Uint8Array([18, 52]).buffer)[0] === 13330; function s($, L) { - const z = new ArrayBuffer($.length), F = new Uint8Array(z); - for (let R = 0, P = $.length; R < P; R += L) - for (let U = 0; U < L; U++) - F[R + L - U - 1] = $[R + U]; - return z; + const I = new ArrayBuffer($.length), F = new Uint8Array(I); + for (let P = 0, B = $.length; P < B; P += L) + for (let G = 0; G < L; G++) + F[P + L - G - 1] = $[P + G]; + return I; } function h($) { let L = $.data; - for (let z = $.encoding.length - 1; z >= 0; z--) - L = o(L, $.encoding[z]); + for (let I = $.encoding.length - 1; I >= 0; I--) + L = o(L, $.encoding[I]); return L; } function o($, L) { @@ -35786,7 +35808,7 @@ ATOM`, b); return new Int32Array(L); } } - function v($, L) { + function _($, L) { switch ($) { case r.Encoding.FloatDataType.Float32: return new Float32Array(L); @@ -35799,8 +35821,8 @@ ATOM`, b); function f($) { return new Int8Array($.buffer, $.byteOffset); } - function y($, L, z) { - return ($.byteOffset != 0 || $.byteLength != $.buffer.byteLength) && ($ = new Uint8Array($)), a ? new z($.buffer) : new z(s($, L)); + function y($, L, I) { + return ($.byteOffset != 0 || $.byteLength != $.buffer.byteLength) && ($ = new Uint8Array($)), a ? new I($.buffer) : new I(s($, L)); } function A($) { return y($, 2, Int16Array); @@ -35821,71 +35843,71 @@ ATOM`, b); return y($, 8, Float64Array); } function p($, L) { - const z = $.length, F = v(L.srcType, z), R = 1 / L.factor; - for (let P = 0; P < z; P++) - F[P] = R * $[P]; + const I = $.length, F = _(L.srcType, I), P = 1 / L.factor; + for (let B = 0; B < I; B++) + F[B] = P * $[B]; return F; } function g($, L) { - const z = $.length, F = v(L.srcType, z), R = (L.max - L.min) / (L.numSteps - 1), P = L.min; - for (let U = 0; U < z; U++) - F[U] = P + R * $[U]; + const I = $.length, F = _(L.srcType, I), P = (L.max - L.min) / (L.numSteps - 1), B = L.min; + for (let G = 0; G < I; G++) + F[G] = B + P * $[G]; return F; } function b($, L) { - const z = d(L.srcType, L.srcSize); + const I = d(L.srcType, L.srcSize); let F = 0; - for (let R = 0, P = $.length; R < P; R += 2) { - const U = $[R], N = $[R + 1]; - for (let B = 0; B < N; ++B) - z[F++] = U; + for (let P = 0, B = $.length; P < B; P += 2) { + const G = $[P], U = $[P + 1]; + for (let R = 0; R < U; ++R) + I[F++] = G; } - return z; + return I; } function c($, L) { - const z = $.length, F = d(L.srcType, z); - if (!z) + const I = $.length, F = d(L.srcType, I); + if (!I) return $; F[0] = $[0] + (L.origin | 0); - for (let R = 1; R < z; ++R) - F[R] = $[R] + F[R - 1]; + for (let P = 1; P < I; ++P) + F[P] = $[P] + F[P - 1]; return F; } - function _($, L) { - const z = L.byteCount === 1 ? 127 : 32767, F = -z - 1, R = $.length, P = new Int32Array(L.srcSize); - let U = 0, N = 0; - for (; U < R; ) { - let B = 0, W = $[U]; - for (; W === z || W === F; ) - B += W, U++, W = $[U]; - B += W, P[N] = B, U++, N++; + function v($, L) { + const I = L.byteCount === 1 ? 127 : 32767, F = -I - 1, P = $.length, B = new Int32Array(L.srcSize); + let G = 0, U = 0; + for (; G < P; ) { + let R = 0, W = $[G]; + for (; W === I || W === F; ) + R += W, G++, W = $[G]; + R += W, B[U] = R, G++, U++; } - return P; + return B; } function E($, L) { - const z = L.byteCount === 1 ? 255 : 65535, F = $.length, R = new Int32Array(L.srcSize); - let P = 0, U = 0; - for (; P < F; ) { - let N = 0, B = $[P]; - for (; B === z; ) - N += B, P++, B = $[P]; - N += B, R[U] = N, P++, U++; + const I = L.byteCount === 1 ? 255 : 65535, F = $.length, P = new Int32Array(L.srcSize); + let B = 0, G = 0; + for (; B < F; ) { + let U = 0, R = $[B]; + for (; R === I; ) + U += R, B++, R = $[B]; + U += R, P[G] = U, B++, G++; } - return R; + return P; } function w($, L) { - return $.length === L.srcSize ? $ : L.isUnsigned ? E($, L) : _($, L); + return $.length === L.srcSize ? $ : L.isUnsigned ? E($, L) : v($, L); } function k($, L) { - const z = h({ encoding: L.offsetEncoding, data: L.offsets }), F = h({ encoding: L.dataEncoding, data: $ }), R = L.stringData, P = new Array(z.length); - P[0] = ""; - for (let B = 1, W = z.length; B < W; B++) - P[B] = R.substring(z[B - 1], z[B]); - let U = 0; - const N = new Array(F.length); - for (let B = 0, W = F.length; B < W; B++) - N[U++] = P[F[B] + 1]; - return N; + const I = h({ encoding: L.offsetEncoding, data: L.offsets }), F = h({ encoding: L.dataEncoding, data: $ }), P = L.stringData, B = new Array(I.length); + B[0] = ""; + for (let R = 1, W = I.length; R < W; R++) + B[R] = P.substring(I[R - 1], I[R]); + let G = 0; + const U = new Array(F.length); + for (let R = 0, W = F.length; R < W; R++) + U[G++] = B[F[R] + 1]; + return U; } } ), @@ -35918,15 +35940,15 @@ ATOM`, b); d[d.Float32 = 32] = "Float32", d[d.Float64 = 33] = "Float64"; }(s.FloatDataType || (s.FloatDataType = {})); function h(d) { - let v; - return d instanceof Int8Array ? v = s.IntDataType.Int8 : d instanceof Int16Array ? v = s.IntDataType.Int16 : d instanceof Int32Array ? v = s.IntDataType.Int32 : d instanceof Uint8Array ? v = s.IntDataType.Uint8 : d instanceof Uint16Array ? v = s.IntDataType.Uint16 : d instanceof Uint32Array ? v = s.IntDataType.Uint32 : d instanceof Float32Array ? v = s.FloatDataType.Float32 : d instanceof Float64Array ? v = s.FloatDataType.Float64 : v = s.IntDataType.Int32, v; + let _; + return d instanceof Int8Array ? _ = s.IntDataType.Int8 : d instanceof Int16Array ? _ = s.IntDataType.Int16 : d instanceof Int32Array ? _ = s.IntDataType.Int32 : d instanceof Uint8Array ? _ = s.IntDataType.Uint8 : d instanceof Uint16Array ? _ = s.IntDataType.Uint16 : d instanceof Uint32Array ? _ = s.IntDataType.Uint32 : d instanceof Float32Array ? _ = s.FloatDataType.Float32 : d instanceof Float64Array ? _ = s.FloatDataType.Float64 : _ = s.IntDataType.Int32, _; } s.getDataType = h; function o(d) { if (d instanceof Int8Array || d instanceof Int16Array || d instanceof Int32Array) return !0; - for (let v = 0, f = d.length; v < f; v++) - if (v < 0) + for (let _ = 0, f = d.length; _ < f; _++) + if (_ < 0) return !1; return !0; } @@ -35977,7 +35999,7 @@ ATOM`, b); ), d = t( /*! ./CIF */ "./src/parsers/CIF.ts" - ), v = t( + ), _ = t( /*! ./MOL2 */ "./src/parsers/MOL2.ts" ), f = t( @@ -36020,8 +36042,8 @@ ATOM`, b); mcif: d.CIF, cif: d.CIF, CIF: d.CIF, - mol2: v.MOL2, - MOL2: v.MOL2, + mol2: _.MOL2, + MOL2: _.MOL2, pdb: f.PDB, PDB: f.PDB, pdbqt: f.PDB, @@ -36200,19 +36222,19 @@ ATOM`, b); function s(h, o, d) { if (d && d.unboundCations && (a.has(h.elem) || a.has(o.elem))) return !1; - let v = (0, r.bondLength)(h.elem) + (0, r.bondLength)(o.elem); - v += 0.25, v *= v; + let _ = (0, r.bondLength)(h.elem) + (0, r.bondLength)(o.elem); + _ += 0.25, _ *= _; let f = h.x - o.x; - if (f *= f, f > v) + if (f *= f, f > _) return !1; let y = h.y - o.y; - if (y *= y, y > v) + if (y *= y, y > _) return !1; let A = h.z - o.z; - if (A *= A, A > v) + if (A *= A, A > _) return !1; const x = f + y + A; - return !(isNaN(x) || x < 0.5 || x > v || h.altLoc !== o.altLoc && h.altLoc.trim() !== "" && o.altLoc.trim() !== ""); + return !(isNaN(x) || x < 0.5 || x > _ || h.altLoc !== o.altLoc && h.altLoc.trim() !== "" && o.altLoc.trim() !== ""); } } ), @@ -36233,17 +36255,17 @@ ATOM`, b); }); function r(a, s) { const h = s || 3.2, o = h * h, d = []; - for (let v = 0, f = a.length; v < f; v++) { - a[v].index = v; - const y = a[v]; + for (let _ = 0, f = a.length; _ < f; _++) { + a[_].index = _; + const y = a[_]; !y.hetflag && (y.atom === "N" || y.atom === "O") && (d.push(y), y.hbondOther = null, y.hbondDistanceSq = Number.POSITIVE_INFINITY); } - d.sort(function(v, f) { - return v.z - f.z; + d.sort(function(_, f) { + return _.z - f.z; }); - for (let v = 0, f = d.length; v < f; v++) { - const y = d[v]; - for (let A = v + 1; A < f; A++) { + for (let _ = 0, f = d.length; _ < f; _++) { + const y = d[_]; + for (let A = _ + 1; A < f; A++) { const x = d[A], M = x.z - y.z; if (M > h) break; @@ -36299,7 +36321,7 @@ ATOM`, b); function h(o, d) { for (let y = 0, A = o.length; y < A; y++) o[y].index || (o[y].index = y); - const v = { + const _ = { x: { y: { z: [] @@ -36308,7 +36330,7 @@ ATOM`, b); }; for (let y = 0; y < o.length; y++) { const A = o[y], x = Math.floor(A.x / s), M = Math.floor(A.y / s), m = Math.floor(A.z / s); - v[x] || (v[x] = {}), v[x][M] || (v[x][M] = {}), v[x][M][m] || (v[x][M][m] = []), v[x][M][m].push(A); + _[x] || (_[x] = {}), _[x][M] || (_[x][M] = {}), _[x][M][m] || (_[x][M][m] = []), _[x][M][m].push(A); } function f(y, A) { for (let x = 0; x < y.length; x++) { @@ -36322,12 +36344,12 @@ ATOM`, b); } } } - for (let y in v) { + for (let y in _) { const A = parseInt(y); - for (let x in v[A]) { + for (let x in _[A]) { const M = parseInt(x); - for (let m in v[A][M]) { - const l = parseInt(m), u = v[A][M][l]; + for (let m in _[A][M]) { + const l = parseInt(m), u = _[A][M][l]; for (let p = 0; p < u.length; p++) { const g = u[p]; for (let b = p + 1; b < u.length; b++) { @@ -36337,9 +36359,9 @@ ATOM`, b); } for (let p = 0; p < a.length; p++) { const g = a[p]; - if (!v[A + g.x] || !v[A + g.x][M + g.y] || !v[A + g.x][M + g.y][l + g.z]) + if (!_[A + g.x] || !_[A + g.x][M + g.y] || !_[A + g.x][M + g.y][l + g.z]) continue; - const b = v[A + g.x][M + g.y][l + g.z]; + const b = _[A + g.x][M + g.y][l + g.z]; f(u, b); } } @@ -36374,20 +36396,20 @@ ATOM`, b); "./src/parsers/utils/standardResidues.ts" ); function h(o, d) { - const v = [], f = []; + const _ = [], f = []; for (let M = 0, m = o.length; M < m; M++) { const l = o[M]; - l.index = M, l.hetflag || !s.standardResidues.has(l.resn) ? f.push(l) : v.push(l); + l.index = M, l.hetflag || !s.standardResidues.has(l.resn) ? f.push(l) : _.push(l); } - (0, a.assignBonds)(f, d), v.sort(function(M, m) { + (0, a.assignBonds)(f, d), _.sort(function(M, m) { return M.chain !== m.chain ? M.chain < m.chain ? -1 : 1 : M.resi - m.resi; }); let y = -1, A = -1, x; - for (let M = 0, m = v.length; M < m; M++) { - const l = v[M]; + for (let M = 0, m = _.length; M < m; M++) { + const l = _[M]; l.resi !== y && (y = l.resi, x || A++, x = !1), l.reschain = A; - for (let u = M + 1; u < v.length; u++) { - const p = v[u]; + for (let u = M + 1; u < _.length; u++) { + const p = _[u]; if (p.chain !== l.chain || p.resi - l.resi > 1) break; (0, r.areConnected)(l, p, d) && (l.bonds.indexOf(p.index) === -1 && (l.bonds.push(p.index), l.bondOrder.push(1), p.bonds.push(l.index), p.bondOrder.push(1)), l.resi !== p.resi && (x = !0)); @@ -36551,8 +36573,8 @@ ATOM`, b); function a(s, h) { (0, r.assignBackboneHBonds)(s, h); const o = {}; - let d, v, f, y, A, x; - for (d = 0, v = s.length; d < v; d++) + let d, _, f, y, A, x; + for (d = 0, _ = s.length; d < _; d++) if (A = s[d], o[A.chain] === void 0 && (o[A.chain] = []), isFinite(A.hbondDistanceSq)) { const M = A.hbondOther; o[M.chain] === void 0 && (o[M.chain] = []), Math.abs(M.resi - A.resi) === 4 && (o[A.chain][A.resi] = "h"); @@ -36562,7 +36584,7 @@ ATOM`, b); const M = o[f][y - 1], m = o[f][y + 1]; x = o[f][y], M == "h" && M == m && x != M && (o[f][y] = M); } - for (d = 0, v = s.length; d < v; d++) + for (d = 0, _ = s.length; d < _; d++) A = s[d], isFinite(A.hbondDistanceSq) && o[A.chain][A.resi] != "h" && A.ss !== "h" && (o[A.chain][A.resi] = "maybesheet"); for (let M = 0, m = s.length; M < m; M++) if (A = s[M], isFinite(A.hbondDistanceSq) && o[A.chain][A.resi] == "maybesheet") { @@ -36579,7 +36601,7 @@ ATOM`, b); (l == "h" || l == "s") && o[M][m - 1] != l && o[M][m + 1] != l && delete o[M][m]; } } - for (d = 0, v = s.length; d < v; d++) + for (d = 0, _ = s.length; d < _; d++) A = s[d], x = o[A.chain][A.resi], delete A.hbondOther, delete A.hbondDistanceSq, !(x === void 0 || x === "maybesheet") && (A.ss = x, o[A.chain][A.resi - 1] != x && (A.ssbegin = !0), o[A.chain][A.resi + 1] != x && (A.ssend = !0)); } } @@ -36617,7 +36639,7 @@ ATOM`, b); ), d = t( /*! ./processSymmetries */ "./src/parsers/utils/processSymmetries.ts" - ), v = t( + ), _ = t( /*! ./assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" ), f = t( @@ -36625,119 +36647,119 @@ ATOM`, b); "./src/parsers/utils/validateBonds.ts" ); function y(A, x, M) { - const m = [], l = x.assignBonds === void 0 ? !0 : x.assignBonds, u = !x.keepH, p = !!x.noSecondaryStructure, g = !x.noComputeSecondaryStructure, b = !x.doAssembly, c = x.altLoc ? x.altLoc : "A", _ = { symmetries: [], cryst: void 0 }; + const m = [], l = x.assignBonds === void 0 ? !0 : x.assignBonds, u = !x.keepH, p = !!x.noSecondaryStructure, g = !x.noComputeSecondaryStructure, b = !x.doAssembly, c = x.altLoc ? x.altLoc : "A", v = { symmetries: [], cryst: void 0 }; let E, w = []; const k = []; let $; const L = {}; - for (let z = 0; z < A.length; z++) { - $ = A[z].replace(/^\s*/, ""); + for (let I = 0; I < A.length; I++) { + $ = A[I].replace(/^\s*/, ""); const F = $.substring(0, 6); - let R, P, U; + let P, B, G; if (F.indexOf("END") === 0) { - if (w = A.slice(z + 1), F === "END") - for (const N in M) - M.hasOwnProperty(N) && delete M[N]; + if (w = A.slice(I + 1), F === "END") + for (const U in M) + M.hasOwnProperty(U) && delete M[U]; break; } else if (F === "ATOM " || F === "HETATM") { - let N, B, W, V, G, H, Q, te, ee, ce, fe, oe; - if (fe = $.substring(16, 17), fe !== " " && fe !== c && c !== "*" || (ce = parseInt($.substring(6, 11)), E = $.substring(12, 16).replace(/ /g, ""), N = $.substring(17, 20).replace(/ /g, ""), B = $.substring(21, 22), W = parseInt($.substring(22, 26)), V = $.substring(26, 27), G = parseFloat($.substring(30, 38)), H = parseFloat($.substring(38, 46)), Q = parseFloat($.substring(46, 54)), oe = parseFloat($.substring(60, 68)), ee = $.substring(76, 78).replace(/ /g, ""), ee === "" || s.bondTable[ee] === void 0 ? ee = (0, a.atomNameToElem)($.substring(12, 14), $[0] == "A") : ee = ee[0].toUpperCase() + ee.substring(1).toLowerCase(), ee === "H" && u)) + let U, R, W, H, N, V, J, re, te, ue, ie, ae; + if (ie = $.substring(16, 17), ie !== " " && ie !== c && c !== "*" || (ue = parseInt($.substring(6, 11)), E = $.substring(12, 16).replace(/ /g, ""), U = $.substring(17, 20).replace(/ /g, ""), R = $.substring(21, 22), W = parseInt($.substring(22, 26)), H = $.substring(26, 27), N = parseFloat($.substring(30, 38)), V = parseFloat($.substring(38, 46)), J = parseFloat($.substring(46, 54)), ae = parseFloat($.substring(60, 68)), te = $.substring(76, 78).replace(/ /g, ""), te === "" || s.bondTable[te] === void 0 ? te = (0, a.atomNameToElem)($.substring(12, 14), $[0] == "A") : te = te[0].toUpperCase() + te.substring(1).toLowerCase(), te === "H" && u)) continue; - F[0] == "H" ? te = !0 : te = !1, k[ce] = m.length, m.push({ - resn: N, - x: G, - y: H, - z: Q, - elem: ee, - hetflag: te, - altLoc: fe, - chain: B, + F[0] == "H" ? re = !0 : re = !1, k[ue] = m.length, m.push({ + resn: U, + x: N, + y: V, + z: J, + elem: te, + hetflag: re, + altLoc: ie, + chain: R, resi: W, - icode: V, - rescode: W + (V !== " " ? "^" + V : ""), + icode: H, + rescode: W + (H !== " " ? "^" + H : ""), // resi // and // icode - serial: ce, + serial: ue, atom: E, bonds: [], ss: "c", bondOrder: [], properties: {}, - b: oe, + b: ae, pdbline: $ }); } else if (F === "SHEET ") { - R = $.substring(21, 22), P = parseInt($.substring(22, 26)), U = parseInt($.substring(33, 37)), R in M || (M[R] = {}), M[R][P] = "s1"; - for (let N = P + 1; N < U; N++) - M[R][N] = "s"; - M[R][U] = "s2"; + P = $.substring(21, 22), B = parseInt($.substring(22, 26)), G = parseInt($.substring(33, 37)), P in M || (M[P] = {}), M[P][B] = "s1"; + for (let U = B + 1; U < G; U++) + M[P][U] = "s"; + M[P][G] = "s2"; } else if (F === "CONECT") { - const N = parseInt($.substring(6, 11)), B = k[N], W = m[B], V = [11, 16, 21, 26]; - for (let G = 0; G < 4; G++) { - const H = parseInt($.substring(V[G], V[G] + 5)), Q = k[H]; - let te = B + ":" + Q; - const ee = m[Q]; - if (W !== void 0 && ee !== void 0) - if (!L[te]) - L[te] = 1, (W.bonds.length == 0 || W.bonds[W.bonds.length - 1] !== Q) && (W.bonds.push(Q), W.bondOrder.push(1)); + const U = parseInt($.substring(6, 11)), R = k[U], W = m[R], H = [11, 16, 21, 26]; + for (let N = 0; N < 4; N++) { + const V = parseInt($.substring(H[N], H[N] + 5)), J = k[V]; + let re = R + ":" + J; + const te = m[J]; + if (W !== void 0 && te !== void 0) + if (!L[re]) + L[re] = 1, (W.bonds.length == 0 || W.bonds[W.bonds.length - 1] !== J) && (W.bonds.push(J), W.bondOrder.push(1)); else { - L[te] += 1; - for (let ce = 0; ce < W.bonds.length; ce++) - if (W.bonds[ce] == Q) { - const fe = L[te]; - fe >= 4 ? W.bondOrder[ce] = 1 : W.bondOrder[ce] = fe; + L[re] += 1; + for (let ue = 0; ue < W.bonds.length; ue++) + if (W.bonds[ue] == J) { + const ie = L[re]; + ie >= 4 ? W.bondOrder[ue] = 1 : W.bondOrder[ue] = ie; } } } } else if (F === "HELIX ") { - R = $.substring(19, 20), P = parseInt($.substring(21, 25)), U = parseInt($.substring(33, 37)), R in M || (M[R] = {}), M[R][P] = "h1"; - for (let N = P + 1; N < U; N++) - M[R][N] = "h"; - M[R][U] = "h2"; + P = $.substring(19, 20), B = parseInt($.substring(21, 25)), G = parseInt($.substring(33, 37)), P in M || (M[P] = {}), M[P][B] = "h1"; + for (let U = B + 1; U < G; U++) + M[P][U] = "h"; + M[P][G] = "h2"; } else if (!b && F === "REMARK" && $.substring(13, 18) === "BIOMT") { - let N, B = new r.Matrix4(); - for (N = 1; N <= 3; N++) - if ($ = A[z].replace(/^\s*/, ""), parseInt($.substring(18, 19)) == N) - B.elements[N - 1] = parseFloat($.substring(23, 33)), B.elements[N - 1 + 4] = parseFloat($.substring(33, 43)), B.elements[N - 1 + 8] = parseFloat($.substring(43, 53)), B.elements[N - 1 + 12] = parseFloat($.substring(53)), z++; + let U, R = new r.Matrix4(); + for (U = 1; U <= 3; U++) + if ($ = A[I].replace(/^\s*/, ""), parseInt($.substring(18, 19)) == U) + R.elements[U - 1] = parseFloat($.substring(23, 33)), R.elements[U - 1 + 4] = parseFloat($.substring(33, 43)), R.elements[U - 1 + 8] = parseFloat($.substring(43, 53)), R.elements[U - 1 + 12] = parseFloat($.substring(53)), I++; else for (; $.substring(13, 18) === "BIOMT"; ) - z++, $ = A[z].replace(/^\s*/, ""); - B.elements[3] = 0, B.elements[7] = 0, B.elements[11] = 0, B.elements[15] = 1, _.symmetries.push(B), z--; + I++, $ = A[I].replace(/^\s*/, ""); + R.elements[3] = 0, R.elements[7] = 0, R.elements[11] = 0, R.elements[15] = 1, v.symmetries.push(R), I--; } else if (F === "CRYST1") { - let N, B, W, V, G, H; - N = parseFloat($.substring(7, 15)), B = parseFloat($.substring(16, 24)), W = parseFloat($.substring(25, 33)), V = parseFloat($.substring(34, 40)), G = parseFloat($.substring(41, 47)), H = parseFloat($.substring(48, 54)), _.cryst = { - a: N, - b: B, + let U, R, W, H, N, V; + U = parseFloat($.substring(7, 15)), R = parseFloat($.substring(16, 24)), W = parseFloat($.substring(25, 33)), H = parseFloat($.substring(34, 40)), N = parseFloat($.substring(41, 47)), V = parseFloat($.substring(48, 54)), v.cryst = { + a: U, + b: R, c: W, - alpha: V, - beta: G, - gamma: H + alpha: H, + beta: N, + gamma: V }; } else if (F === "ANISOU") { - const N = parseInt($.substring(6, 11)), B = k[N], W = m[B]; + const U = parseInt($.substring(6, 11)), R = k[U], W = m[R]; if (W) { - const V = $.substring(30).trim().split(/\s+/), G = { - u11: parseInt(V[0]), - u22: parseInt(V[1]), - u33: parseInt(V[2]), - u12: parseInt(V[3]), - u13: parseInt(V[4]), - u23: parseInt(V[5]) + const H = $.substring(30).trim().split(/\s+/), N = { + u11: parseInt(H[0]), + u22: parseInt(H[1]), + u33: parseInt(H[2]), + u12: parseInt(H[3]), + u13: parseInt(H[4]), + u23: parseInt(H[5]) }; - W.uMat = G; + W.uMat = N; } } } - if ((0, f.validateBonds)(m, k), l && (0, v.assignPDBBonds)(m, x), b || (0, d.processSymmetries)(_.symmetries, m, x, _.cryst), g && !p && (0, h.computeSecondaryStructure)(m, x.hbondCutoff), !(0, o.isEmpty)(M)) - for (let z = 0; z < m.length; z++) { - const F = m[z]; + if ((0, f.validateBonds)(m, k), l && (0, _.assignPDBBonds)(m, x), b || (0, d.processSymmetries)(v.symmetries, m, x, v.cryst), g && !p && (0, h.computeSecondaryStructure)(m, x.hbondCutoff), !(0, o.isEmpty)(M)) + for (let I = 0; I < m.length; I++) { + const F = m[I]; if (F !== void 0 && F.chain in M && F.resi in M[F.chain]) { - const R = M[F.chain][F.resi]; - F.ss = R[0], R.length > 1 && (R[1] == "1" ? F.ssbegin = !0 : R[1] == "2" && (F.ssend = !0)); + const P = M[F.chain][F.resi]; + F.ss = P[0], P.length > 1 && (P[1] == "1" ? F.ssbegin = !0 : P[1] == "2" && (F.ssend = !0)); } } - return [m, _, w]; + return [m, v, w]; } } ), @@ -36783,7 +36805,7 @@ ATOM`, b); "./src/WebGL/index.ts" ); function a(s, h, o, d) { - const v = !o.duplicateAssemblyAtoms, f = h.length; + const _ = !o.duplicateAssemblyAtoms, f = h.length; let y = f, A = -1, x = null, M = null; (o.normalizeAssembly || o.wrapAtoms) && d && (x = (0, r.conversionMatrix3)(d.a, d.b, d.c, d.alpha, d.beta, d.gamma), M = new r.Matrix3(), M.getInverse3(x)); let m = function(p) { @@ -36795,21 +36817,21 @@ ATOM`, b); for (; b[E] > 1.001; ) b[E] -= 1, c[E] -= 1; } - const _ = new r.Vector3(c[0], c[1], c[2]); - return _.applyMatrix3(x), _; + const v = new r.Vector3(c[0], c[1], c[2]); + return v.applyMatrix3(x), v; }; if (o.normalizeAssembly && d) for (let p = 0; p < s.length; p++) { const g = new r.Vector3(0, 0, 0); for (let c = 0; c < f; c++) { - const _ = new r.Vector3(h[c].x, h[c].y, h[c].z); - _.applyMatrix4(s[p]), g.add(_); + const v = new r.Vector3(h[c].x, h[c].y, h[c].z); + v.applyMatrix4(s[p]), g.add(v); } g.divideScalar(f); const b = m(g); s[p].isNearlyIdentity() && b.lengthSq() > 1e-3 && (A = p), s[p].translate(b); } - if (v) { + if (_) { if (s.length > 1) for (let p = 0; p < h.length; p++) { var l = []; @@ -36834,10 +36856,10 @@ ATOM`, b); let E = m(g); g.add(E); } - const _ = {}; + const v = {}; for (const E in h[b]) - _[E] = h[b][E]; - _.x = g.x, _.y = g.y, _.z = g.z, _.bonds = c, _.sym = p, _.index = h.length, h.push(_); + v[E] = h[b][E]; + v.x = g.x, v.y = g.y, v.z = g.z, v.bonds = c, v.sym = p, v.index = h.length, h.push(v); } y = h.length; } else @@ -36963,9 +36985,9 @@ ATOM`, b); function r(a, s) { for (let h = 0, o = a.length; h < o; h++) { const d = a[h]; - for (let v = 0; v < d.bonds.length; v++) { - const f = d.bonds[v], y = a[f], A = s[d.serial]; - y && A && y.bonds.indexOf(A) < 0 && (y.bonds.push(A), y.bondOrder.push(d.bondOrder[v])); + for (let _ = 0; _ < d.bonds.length; _++) { + const f = d.bonds[_], y = a[f], A = s[d.serial]; + y && A && y.bonds.indexOf(A) < 0 && (y.bonds.push(A), y.bondOrder.push(d.bondOrder[_])); } } } @@ -37330,19 +37352,19 @@ ATOM`, b); n && (n.volformat && !(n.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (n.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(n.voldata, n.volformat)), n.volscheme && (n.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(n.volscheme))); } function getExtent(n, e) { - var t, r, a, s, h, o, d, v, f, y, A = !e; - if (t = r = a = 9999, s = h = o = -9999, d = v = f = y = 0, n.length === 0) + var t, r, a, s, h, o, d, _, f, y, A = !e; + if (t = r = a = 9999, s = h = o = -9999, d = _ = f = y = 0, n.length === 0) return [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; for (var x = 0; x < n.length; x++) { var M = n[x]; - if (!(typeof M > "u" || !isFinite(M.x) || !isFinite(M.y) || !isFinite(M.z)) && (y++, d += M.x, v += M.y, f += M.z, t = t < M.x ? t : M.x, r = r < M.y ? r : M.y, a = a < M.z ? a : M.z, s = s > M.x ? s : M.x, h = h > M.y ? h : M.y, o = o > M.z ? o : M.z, M.symmetries && A)) + if (!(typeof M > "u" || !isFinite(M.x) || !isFinite(M.y) || !isFinite(M.z)) && (y++, d += M.x, _ += M.y, f += M.z, t = t < M.x ? t : M.x, r = r < M.y ? r : M.y, a = a < M.z ? a : M.z, s = s > M.x ? s : M.x, h = h > M.y ? h : M.y, o = o > M.z ? o : M.z, M.symmetries && A)) for (var m = 0; m < M.symmetries.length; m++) - y++, d += M.symmetries[m].x, v += M.symmetries[m].y, f += M.symmetries[m].z, t = t < M.symmetries[m].x ? t : M.symmetries[m].x, r = r < M.symmetries[m].y ? r : M.symmetries[m].y, a = a < M.symmetries[m].z ? a : M.symmetries[m].z, s = s > M.symmetries[m].x ? s : M.symmetries[m].x, h = h > M.symmetries[m].y ? h : M.symmetries[m].y, o = o > M.symmetries[m].z ? o : M.symmetries[m].z; + y++, d += M.symmetries[m].x, _ += M.symmetries[m].y, f += M.symmetries[m].z, t = t < M.symmetries[m].x ? t : M.symmetries[m].x, r = r < M.symmetries[m].y ? r : M.symmetries[m].y, a = a < M.symmetries[m].z ? a : M.symmetries[m].z, s = s > M.symmetries[m].x ? s : M.symmetries[m].x, h = h > M.symmetries[m].y ? h : M.symmetries[m].y, o = o > M.symmetries[m].z ? o : M.symmetries[m].z; } return [ [t, r, a], [s, h, o], - [d / y, v / y, f / y] + [d / y, _ / y, f / y] ]; } function getPropertyRange(n, e) { @@ -37398,8 +37420,8 @@ ATOM`, b); var s = r[a].split(":"), h = s[0], o = {}, d = s[1]; if (d) if (d = d.replace(/~/g, "="), d.indexOf("=") !== -1) - for (var v = d.split(","), f = 0; f < v.length; f++) { - var y = v[f].split("=", 2); + for (var _ = d.split(","), f = 0; f < _.length; f++) { + var y = _[f].split("=", 2); o[y[0]] = e(y[1]); } else d.indexOf(",") !== -1 ? o = d.split(",") : o = e(d); @@ -37444,22 +37466,22 @@ ATOM`, b); } h = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + n + "/SDF?record_type=3d"; } else n.substring(0, 4) == "url:" && (h = n.substring(4), a = h); - var v = function(f) { + var _ = function(f) { d.addMolData(f, a, t), e.zoomTo(), e.render(); }; o = new Promise(function(f) { a == "bcif" ? getbin(h).then(function(y) { - v(y), f(d); + _(y), f(d); }).catch(function() { s = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = s + n + ".pdb", a = "pdb", console.warn("falling back to pdb format"), get(h).then(function(y) { - v(y), f(d); + _(y), f(d); }).catch(function(y) { - v(""), f(d), console.error("fetch of " + h + " failed: " + y.statusText); + _(""), f(d), console.error("fetch of " + h + " failed: " + y.statusText); }); }) : get(h).then(function(y) { - v(y), f(d); + _(y), f(d); }).catch(function(y) { - v(""), f(d), console.error("fetch of " + h + " failed: " + y.statusText); + _(""), f(d), console.error("fetch of " + h + " failed: " + y.statusText); }); }); } @@ -37521,14 +37543,14 @@ ATOM`, b); "./node_modules/upng-js/node_modules/pako/index.js" ), function(s, h) { s.toRGBA8 = function(o) { - var d = o.width, v = o.height; - if (o.tabs.acTL == null) return [s.toRGBA8.decodeImage(o.data, d, v, o).buffer]; + var d = o.width, _ = o.height; + if (o.tabs.acTL == null) return [s.toRGBA8.decodeImage(o.data, d, _, o).buffer]; var f = []; o.frames[0].data == null && (o.frames[0].data = o.data); - for (var y, A = new Uint8Array(d * v * 4), x = 0; x < o.frames.length; x++) { + for (var y, A = new Uint8Array(d * _ * 4), x = 0; x < o.frames.length; x++) { var M = o.frames[x], m = M.rect.x, l = M.rect.y, u = M.rect.width, p = M.rect.height, g = s.toRGBA8.decodeImage(M.data, u, p, o); - if (x == 0 ? y = g : M.blend == 0 ? s._copyTile(g, u, p, y, d, v, m, l, 0) : M.blend == 1 && s._copyTile(g, u, p, y, d, v, m, l, 1), f.push(y.buffer), y = y.slice(0), M.dispose != 0) { - if (M.dispose == 1) s._copyTile(A, u, p, y, d, v, m, l, 0); + if (x == 0 ? y = g : M.blend == 0 ? s._copyTile(g, u, p, y, d, _, m, l, 0) : M.blend == 1 && s._copyTile(g, u, p, y, d, _, m, l, 1), f.push(y.buffer), y = y.slice(0), M.dispose != 0) { + if (M.dispose == 1) s._copyTile(A, u, p, y, d, _, m, l, 0); else if (M.dispose == 2) { for (var b = x - 1; o.frames[b].dispose == 2; ) b--; y = new Uint8Array(f[b]).slice(0); @@ -37536,8 +37558,8 @@ ATOM`, b); } } return f; - }, s.toRGBA8.decodeImage = function(o, d, v, f) { - var y = d * v, A = s.decode._getBPP(f), x = Math.ceil(d * A / 8), M = new Uint8Array(y * 4), m = new Uint32Array(M.buffer), l = f.ctype, u = f.depth, p = s._bin.readUshort; + }, s.toRGBA8.decodeImage = function(o, d, _, f) { + var y = d * _, A = s.decode._getBPP(f), x = Math.ceil(d * A / 8), M = new Uint8Array(y * 4), m = new Uint32Array(M.buffer), l = f.ctype, u = f.depth, p = s._bin.readUshort; if (l == 6) { var g = y << 2; if (u == 8) for (var b = 0; b < g; b++) @@ -37545,165 +37567,165 @@ ATOM`, b); if (u == 16) for (var b = 0; b < g; b++) M[b] = o[b << 1]; } else if (l == 2) { - var c = f.tabs.tRNS, _ = -1, E = -1, w = -1; - if (c && (_ = c[0], E = c[1], w = c[2]), u == 8) for (var b = 0; b < y; b++) { + var c = f.tabs.tRNS, v = -1, E = -1, w = -1; + if (c && (v = c[0], E = c[1], w = c[2]), u == 8) for (var b = 0; b < y; b++) { var k = b << 2, $ = b * 3; - M[k] = o[$], M[k + 1] = o[$ + 1], M[k + 2] = o[$ + 2], M[k + 3] = 255, _ != -1 && o[$] == _ && o[$ + 1] == E && o[$ + 2] == w && (M[k + 3] = 0); + M[k] = o[$], M[k + 1] = o[$ + 1], M[k + 2] = o[$ + 2], M[k + 3] = 255, v != -1 && o[$] == v && o[$ + 1] == E && o[$ + 2] == w && (M[k + 3] = 0); } if (u == 16) for (var b = 0; b < y; b++) { var k = b << 2, $ = b * 6; - M[k] = o[$], M[k + 1] = o[$ + 2], M[k + 2] = o[$ + 4], M[k + 3] = 255, _ != -1 && p(o, $) == _ && p(o, $ + 2) == E && p(o, $ + 4) == w && (M[k + 3] = 0); + M[k] = o[$], M[k + 1] = o[$ + 2], M[k + 2] = o[$ + 4], M[k + 3] = 255, v != -1 && p(o, $) == v && p(o, $ + 2) == E && p(o, $ + 4) == w && (M[k + 3] = 0); } } else if (l == 3) { - var L = f.tabs.PLTE, z = f.tabs.tRNS, F = z ? z.length : 0; - if (u == 1) for (var R = 0; R < v; R++) - for (var P = R * x, U = R * d, b = 0; b < d; b++) { - var k = U + b << 2, N = o[P + (b >> 3)] >> 7 - ((b & 7) << 0) & 1, B = 3 * N; - M[k] = L[B], M[k + 1] = L[B + 1], M[k + 2] = L[B + 2], M[k + 3] = N < F ? z[N] : 255; + var L = f.tabs.PLTE, I = f.tabs.tRNS, F = I ? I.length : 0; + if (u == 1) for (var P = 0; P < _; P++) + for (var B = P * x, G = P * d, b = 0; b < d; b++) { + var k = G + b << 2, U = o[B + (b >> 3)] >> 7 - ((b & 7) << 0) & 1, R = 3 * U; + M[k] = L[R], M[k + 1] = L[R + 1], M[k + 2] = L[R + 2], M[k + 3] = U < F ? I[U] : 255; } - if (u == 2) for (var R = 0; R < v; R++) - for (var P = R * x, U = R * d, b = 0; b < d; b++) { - var k = U + b << 2, N = o[P + (b >> 2)] >> 6 - ((b & 3) << 1) & 3, B = 3 * N; - M[k] = L[B], M[k + 1] = L[B + 1], M[k + 2] = L[B + 2], M[k + 3] = N < F ? z[N] : 255; + if (u == 2) for (var P = 0; P < _; P++) + for (var B = P * x, G = P * d, b = 0; b < d; b++) { + var k = G + b << 2, U = o[B + (b >> 2)] >> 6 - ((b & 3) << 1) & 3, R = 3 * U; + M[k] = L[R], M[k + 1] = L[R + 1], M[k + 2] = L[R + 2], M[k + 3] = U < F ? I[U] : 255; } - if (u == 4) for (var R = 0; R < v; R++) - for (var P = R * x, U = R * d, b = 0; b < d; b++) { - var k = U + b << 2, N = o[P + (b >> 1)] >> 4 - ((b & 1) << 2) & 15, B = 3 * N; - M[k] = L[B], M[k + 1] = L[B + 1], M[k + 2] = L[B + 2], M[k + 3] = N < F ? z[N] : 255; + if (u == 4) for (var P = 0; P < _; P++) + for (var B = P * x, G = P * d, b = 0; b < d; b++) { + var k = G + b << 2, U = o[B + (b >> 1)] >> 4 - ((b & 1) << 2) & 15, R = 3 * U; + M[k] = L[R], M[k + 1] = L[R + 1], M[k + 2] = L[R + 2], M[k + 3] = U < F ? I[U] : 255; } if (u == 8) for (var b = 0; b < y; b++) { - var k = b << 2, N = o[b], B = 3 * N; - M[k] = L[B], M[k + 1] = L[B + 1], M[k + 2] = L[B + 2], M[k + 3] = N < F ? z[N] : 255; + var k = b << 2, U = o[b], R = 3 * U; + M[k] = L[R], M[k + 1] = L[R + 1], M[k + 2] = L[R + 2], M[k + 3] = U < F ? I[U] : 255; } } else if (l == 4) { if (u == 8) for (var b = 0; b < y; b++) { - var k = b << 2, W = b << 1, V = o[W]; - M[k] = V, M[k + 1] = V, M[k + 2] = V, M[k + 3] = o[W + 1]; + var k = b << 2, W = b << 1, H = o[W]; + M[k] = H, M[k + 1] = H, M[k + 2] = H, M[k + 3] = o[W + 1]; } if (u == 16) for (var b = 0; b < y; b++) { - var k = b << 2, W = b << 2, V = o[W]; - M[k] = V, M[k + 1] = V, M[k + 2] = V, M[k + 3] = o[W + 2]; + var k = b << 2, W = b << 2, H = o[W]; + M[k] = H, M[k + 1] = H, M[k + 2] = H, M[k + 3] = o[W + 2]; } } else if (l == 0) { - var _ = f.tabs.tRNS ? f.tabs.tRNS : -1; + var v = f.tabs.tRNS ? f.tabs.tRNS : -1; if (u == 1) for (var b = 0; b < y; b++) { - var V = 255 * (o[b >> 3] >> 7 - (b & 7) & 1), G = V == _ * 255 ? 0 : 255; - m[b] = G << 24 | V << 16 | V << 8 | V; + var H = 255 * (o[b >> 3] >> 7 - (b & 7) & 1), N = H == v * 255 ? 0 : 255; + m[b] = N << 24 | H << 16 | H << 8 | H; } if (u == 2) for (var b = 0; b < y; b++) { - var V = 85 * (o[b >> 2] >> 6 - ((b & 3) << 1) & 3), G = V == _ * 85 ? 0 : 255; - m[b] = G << 24 | V << 16 | V << 8 | V; + var H = 85 * (o[b >> 2] >> 6 - ((b & 3) << 1) & 3), N = H == v * 85 ? 0 : 255; + m[b] = N << 24 | H << 16 | H << 8 | H; } if (u == 4) for (var b = 0; b < y; b++) { - var V = 17 * (o[b >> 1] >> 4 - ((b & 1) << 2) & 15), G = V == _ * 17 ? 0 : 255; - m[b] = G << 24 | V << 16 | V << 8 | V; + var H = 17 * (o[b >> 1] >> 4 - ((b & 1) << 2) & 15), N = H == v * 17 ? 0 : 255; + m[b] = N << 24 | H << 16 | H << 8 | H; } if (u == 8) for (var b = 0; b < y; b++) { - var V = o[b], G = V == _ ? 0 : 255; - m[b] = G << 24 | V << 16 | V << 8 | V; + var H = o[b], N = H == v ? 0 : 255; + m[b] = N << 24 | H << 16 | H << 8 | H; } if (u == 16) for (var b = 0; b < y; b++) { - var V = o[b << 1], G = p(o, b << 1) == _ ? 0 : 255; - m[b] = G << 24 | V << 16 | V << 8 | V; + var H = o[b << 1], N = p(o, b << 1) == v ? 0 : 255; + m[b] = N << 24 | H << 16 | H << 8 | H; } } return M; }, s.decode = function(o) { - for (var d = new Uint8Array(o), v = 8, f = s._bin, y = f.readUshort, A = f.readUint, x = { tabs: {}, frames: [] }, M = new Uint8Array(d.length), m = 0, l, u = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], g = 0; g < 8; g++) if (d[g] != p[g]) throw "The input is not a PNG file!"; - for (; v < d.length; ) { - var b = f.readUint(d, v); - v += 4; - var c = f.readASCII(d, v, 4); - if (v += 4, c == "IHDR") - s.decode._IHDR(d, v, x); + for (var d = new Uint8Array(o), _ = 8, f = s._bin, y = f.readUshort, A = f.readUint, x = { tabs: {}, frames: [] }, M = new Uint8Array(d.length), m = 0, l, u = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], g = 0; g < 8; g++) if (d[g] != p[g]) throw "The input is not a PNG file!"; + for (; _ < d.length; ) { + var b = f.readUint(d, _); + _ += 4; + var c = f.readASCII(d, _, 4); + if (_ += 4, c == "IHDR") + s.decode._IHDR(d, _, x); else if (c == "IDAT") { - for (var g = 0; g < b; g++) M[m + g] = d[v + g]; + for (var g = 0; g < b; g++) M[m + g] = d[_ + g]; m += b; } else if (c == "acTL") - x.tabs[c] = { num_frames: A(d, v), num_plays: A(d, v + 4) }, l = new Uint8Array(d.length); + x.tabs[c] = { num_frames: A(d, _), num_plays: A(d, _ + 4) }, l = new Uint8Array(d.length); else if (c == "fcTL") { if (u != 0) { - var _ = x.frames[x.frames.length - 1]; - _.data = s.decode._decompress(x, l.slice(0, u), _.rect.width, _.rect.height), u = 0; + var v = x.frames[x.frames.length - 1]; + v.data = s.decode._decompress(x, l.slice(0, u), v.rect.width, v.rect.height), u = 0; } - var E = { x: A(d, v + 12), y: A(d, v + 16), width: A(d, v + 4), height: A(d, v + 8) }, w = y(d, v + 22); - w = y(d, v + 20) / (w == 0 ? 100 : w); - var k = { rect: E, delay: Math.round(w * 1e3), dispose: d[v + 24], blend: d[v + 25] }; + var E = { x: A(d, _ + 12), y: A(d, _ + 16), width: A(d, _ + 4), height: A(d, _ + 8) }, w = y(d, _ + 22); + w = y(d, _ + 20) / (w == 0 ? 100 : w); + var k = { rect: E, delay: Math.round(w * 1e3), dispose: d[_ + 24], blend: d[_ + 25] }; x.frames.push(k); } else if (c == "fdAT") { - for (var g = 0; g < b - 4; g++) l[u + g] = d[v + g + 4]; + for (var g = 0; g < b - 4; g++) l[u + g] = d[_ + g + 4]; u += b - 4; } else if (c == "pHYs") - x.tabs[c] = [f.readUint(d, v), f.readUint(d, v + 4), d[v + 8]]; + x.tabs[c] = [f.readUint(d, _), f.readUint(d, _ + 4), d[_ + 8]]; else if (c == "cHRM") { x.tabs[c] = []; - for (var g = 0; g < 8; g++) x.tabs[c].push(f.readUint(d, v + g * 4)); + for (var g = 0; g < 8; g++) x.tabs[c].push(f.readUint(d, _ + g * 4)); } else if (c == "tEXt") { x.tabs[c] == null && (x.tabs[c] = {}); - var $ = f.nextZero(d, v), L = f.readASCII(d, v, $ - v), z = f.readASCII(d, $ + 1, v + b - $ - 1); - x.tabs[c][L] = z; + var $ = f.nextZero(d, _), L = f.readASCII(d, _, $ - _), I = f.readASCII(d, $ + 1, _ + b - $ - 1); + x.tabs[c][L] = I; } else if (c == "iTXt") { x.tabs[c] == null && (x.tabs[c] = {}); - var $ = 0, F = v; + var $ = 0, F = _; $ = f.nextZero(d, F); var L = f.readASCII(d, F, $ - F); F = $ + 1, d[F], d[F + 1], F += 2, $ = f.nextZero(d, F), f.readASCII(d, F, $ - F), F = $ + 1, $ = f.nextZero(d, F), f.readUTF8(d, F, $ - F), F = $ + 1; - var z = f.readUTF8(d, F, b - (F - v)); - x.tabs[c][L] = z; + var I = f.readUTF8(d, F, b - (F - _)); + x.tabs[c][L] = I; } else if (c == "PLTE") - x.tabs[c] = f.readBytes(d, v, b); + x.tabs[c] = f.readBytes(d, _, b); else if (c == "hIST") { - var R = x.tabs.PLTE.length / 3; + var P = x.tabs.PLTE.length / 3; x.tabs[c] = []; - for (var g = 0; g < R; g++) x.tabs[c].push(y(d, v + g * 2)); + for (var g = 0; g < P; g++) x.tabs[c].push(y(d, _ + g * 2)); } else if (c == "tRNS") - x.ctype == 3 ? x.tabs[c] = f.readBytes(d, v, b) : x.ctype == 0 ? x.tabs[c] = y(d, v) : x.ctype == 2 && (x.tabs[c] = [y(d, v), y(d, v + 2), y(d, v + 4)]); - else if (c == "gAMA") x.tabs[c] = f.readUint(d, v) / 1e5; - else if (c == "sRGB") x.tabs[c] = d[v]; + x.ctype == 3 ? x.tabs[c] = f.readBytes(d, _, b) : x.ctype == 0 ? x.tabs[c] = y(d, _) : x.ctype == 2 && (x.tabs[c] = [y(d, _), y(d, _ + 2), y(d, _ + 4)]); + else if (c == "gAMA") x.tabs[c] = f.readUint(d, _) / 1e5; + else if (c == "sRGB") x.tabs[c] = d[_]; else if (c == "bKGD") - x.ctype == 0 || x.ctype == 4 ? x.tabs[c] = [y(d, v)] : x.ctype == 2 || x.ctype == 6 ? x.tabs[c] = [y(d, v), y(d, v + 2), y(d, v + 4)] : x.ctype == 3 && (x.tabs[c] = d[v]); + x.ctype == 0 || x.ctype == 4 ? x.tabs[c] = [y(d, _)] : x.ctype == 2 || x.ctype == 6 ? x.tabs[c] = [y(d, _), y(d, _ + 2), y(d, _ + 4)] : x.ctype == 3 && (x.tabs[c] = d[_]); else if (c == "IEND") { if (u != 0) { - var _ = x.frames[x.frames.length - 1]; - _.data = s.decode._decompress(x, l.slice(0, u), _.rect.width, _.rect.height), u = 0; + var v = x.frames[x.frames.length - 1]; + v.data = s.decode._decompress(x, l.slice(0, u), v.rect.width, v.rect.height), u = 0; } x.data = s.decode._decompress(x, M, x.width, x.height); break; } - v += b, f.readUint(d, v), v += 4; + _ += b, f.readUint(d, _), _ += 4; } return delete x.compress, delete x.interlace, delete x.filter, x; - }, s.decode._decompress = function(o, d, v, f) { - return o.compress == 0 && (d = s.decode._inflate(d)), o.interlace == 0 ? d = s.decode._filterZero(d, o, 0, v, f) : o.interlace == 1 && (d = s.decode._readInterlace(d, o)), d; + }, s.decode._decompress = function(o, d, _, f) { + return o.compress == 0 && (d = s.decode._inflate(d)), o.interlace == 0 ? d = s.decode._filterZero(d, o, 0, _, f) : o.interlace == 1 && (d = s.decode._readInterlace(d, o)), d; }, s.decode._inflate = function(o) { return h.inflate(o); }, s.decode._readInterlace = function(o, d) { - for (var v = d.width, f = d.height, y = s.decode._getBPP(d), A = y >> 3, x = Math.ceil(v * y / 8), M = new Uint8Array(f * x), m = 0, l = [0, 0, 4, 0, 2, 0, 1], u = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], g = [8, 8, 4, 4, 2, 2, 1], b = 0; b < 7; ) { - for (var c = p[b], _ = g[b], E = 0, w = 0, k = l[b]; k < f; ) + for (var _ = d.width, f = d.height, y = s.decode._getBPP(d), A = y >> 3, x = Math.ceil(_ * y / 8), M = new Uint8Array(f * x), m = 0, l = [0, 0, 4, 0, 2, 0, 1], u = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], g = [8, 8, 4, 4, 2, 2, 1], b = 0; b < 7; ) { + for (var c = p[b], v = g[b], E = 0, w = 0, k = l[b]; k < f; ) k += c, w++; - for (var $ = u[b]; $ < v; ) - $ += _, E++; + for (var $ = u[b]; $ < _; ) + $ += v, E++; var L = Math.ceil(E * y / 8); s.decode._filterZero(o, d, m, E, w); - for (var z = 0, F = l[b]; F < f; ) { - for (var R = u[b], P = m + z * L << 3; R < v; ) { + for (var I = 0, F = l[b]; F < f; ) { + for (var P = u[b], B = m + I * L << 3; P < _; ) { if (y == 1) { - var U = o[P >> 3]; - U = U >> 7 - (P & 7) & 1, M[F * x + (R >> 3)] |= U << 7 - ((R & 3) << 0); + var G = o[B >> 3]; + G = G >> 7 - (B & 7) & 1, M[F * x + (P >> 3)] |= G << 7 - ((P & 3) << 0); } if (y == 2) { - var U = o[P >> 3]; - U = U >> 6 - (P & 7) & 3, M[F * x + (R >> 2)] |= U << 6 - ((R & 3) << 1); + var G = o[B >> 3]; + G = G >> 6 - (B & 7) & 3, M[F * x + (P >> 2)] |= G << 6 - ((P & 3) << 1); } if (y == 4) { - var U = o[P >> 3]; - U = U >> 4 - (P & 7) & 15, M[F * x + (R >> 1)] |= U << 4 - ((R & 1) << 2); + var G = o[B >> 3]; + G = G >> 4 - (B & 7) & 15, M[F * x + (P >> 1)] |= G << 4 - ((P & 1) << 2); } if (y >= 8) - for (var N = F * x + R * A, B = 0; B < A; B++) M[N + B] = o[(P >> 3) + B]; - P += y, R += _; + for (var U = F * x + P * A, R = 0; R < A; R++) M[U + R] = o[(B >> 3) + R]; + B += y, P += v; } - z++, F += c; + I++, F += c; } E * w != 0 && (m += w * (1 + L)), b = b + 1; } @@ -37711,11 +37733,11 @@ ATOM`, b); }, s.decode._getBPP = function(o) { var d = [1, null, 3, 1, 2, null, 4][o.ctype]; return d * o.depth; - }, s.decode._filterZero = function(o, d, v, f, y) { + }, s.decode._filterZero = function(o, d, _, f, y) { var A = s.decode._getBPP(d), x = Math.ceil(f * A / 8), M = s.decode._paeth; A = Math.ceil(A / 8); for (var m = 0; m < y; m++) { - var l = v + m * x, u = l + m + 1, p = o[u - 1]; + var l = _ + m * x, u = l + m + 1, p = o[u - 1]; if (p == 0) for (var g = 0; g < x; g++) o[l + g] = o[u + g]; else if (p == 1) { for (var g = 0; g < A; g++) o[l + g] = o[u + g]; @@ -37739,12 +37761,12 @@ ATOM`, b); } } return o; - }, s.decode._paeth = function(o, d, v) { - var f = o + d - v, y = Math.abs(f - o), A = Math.abs(f - d), x = Math.abs(f - v); - return y <= A && y <= x ? o : A <= x ? d : v; - }, s.decode._IHDR = function(o, d, v) { + }, s.decode._paeth = function(o, d, _) { + var f = o + d - _, y = Math.abs(f - o), A = Math.abs(f - d), x = Math.abs(f - _); + return y <= A && y <= x ? o : A <= x ? d : _; + }, s.decode._IHDR = function(o, d, _) { var f = s._bin; - v.width = f.readUint(o, d), d += 4, v.height = f.readUint(o, d), d += 4, v.depth = o[d], d++, v.ctype = o[d], d++, v.compress = o[d], d++, v.filter = o[d], d++, v.interlace = o[d], d++; + _.width = f.readUint(o, d), d += 4, _.height = f.readUint(o, d), d += 4, _.depth = o[d], d++, _.ctype = o[d], d++, _.compress = o[d], d++, _.filter = o[d], d++, _.interlace = o[d], d++; }, s._bin = { nextZero: function(o, d) { for (; o[d] != 0; ) d++; @@ -37753,166 +37775,166 @@ ATOM`, b); readUshort: function(o, d) { return o[d] << 8 | o[d + 1]; }, - writeUshort: function(o, d, v) { - o[d] = v >> 8 & 255, o[d + 1] = v & 255; + writeUshort: function(o, d, _) { + o[d] = _ >> 8 & 255, o[d + 1] = _ & 255; }, readUint: function(o, d) { return o[d] * 16777216 + (o[d + 1] << 16 | o[d + 2] << 8 | o[d + 3]); }, - writeUint: function(o, d, v) { - o[d] = v >> 24 & 255, o[d + 1] = v >> 16 & 255, o[d + 2] = v >> 8 & 255, o[d + 3] = v & 255; + writeUint: function(o, d, _) { + o[d] = _ >> 24 & 255, o[d + 1] = _ >> 16 & 255, o[d + 2] = _ >> 8 & 255, o[d + 3] = _ & 255; }, - readASCII: function(o, d, v) { - for (var f = "", y = 0; y < v; y++) f += String.fromCharCode(o[d + y]); + readASCII: function(o, d, _) { + for (var f = "", y = 0; y < _; y++) f += String.fromCharCode(o[d + y]); return f; }, - writeASCII: function(o, d, v) { - for (var f = 0; f < v.length; f++) o[d + f] = v.charCodeAt(f); + writeASCII: function(o, d, _) { + for (var f = 0; f < _.length; f++) o[d + f] = _.charCodeAt(f); }, - readBytes: function(o, d, v) { - for (var f = [], y = 0; y < v; y++) f.push(o[d + y]); + readBytes: function(o, d, _) { + for (var f = [], y = 0; y < _; y++) f.push(o[d + y]); return f; }, pad: function(o) { return o.length < 2 ? "0" + o : o; }, - readUTF8: function(o, d, v) { - for (var f = "", y, A = 0; A < v; A++) f += "%" + s._bin.pad(o[d + A].toString(16)); + readUTF8: function(o, d, _) { + for (var f = "", y, A = 0; A < _; A++) f += "%" + s._bin.pad(o[d + A].toString(16)); try { y = decodeURIComponent(f); } catch { - return s._bin.readASCII(o, d, v); + return s._bin.readASCII(o, d, _); } return y; } - }, s._copyTile = function(o, d, v, f, y, A, x, M, m) { - for (var l = Math.min(d, y), u = Math.min(v, A), p = 0, g = 0, b = 0; b < u; b++) + }, s._copyTile = function(o, d, _, f, y, A, x, M, m) { + for (var l = Math.min(d, y), u = Math.min(_, A), p = 0, g = 0, b = 0; b < u; b++) for (var c = 0; c < l; c++) if (x >= 0 && M >= 0 ? (p = b * d + c << 2, g = (M + b) * y + x + c << 2) : (p = (-M + b) * d - x + c << 2, g = b * y + c << 2), m == 0) f[g] = o[p], f[g + 1] = o[p + 1], f[g + 2] = o[p + 2], f[g + 3] = o[p + 3]; else if (m == 1) { - var _ = o[p + 3] * 0.00392156862745098, E = o[p] * _, w = o[p + 1] * _, k = o[p + 2] * _, $ = f[g + 3] * (1 / 255), L = f[g] * $, z = f[g + 1] * $, F = f[g + 2] * $, R = 1 - _, P = _ + $ * R, U = P == 0 ? 0 : 1 / P; - f[g + 3] = 255 * P, f[g + 0] = (E + L * R) * U, f[g + 1] = (w + z * R) * U, f[g + 2] = (k + F * R) * U; + var v = o[p + 3] * 0.00392156862745098, E = o[p] * v, w = o[p + 1] * v, k = o[p + 2] * v, $ = f[g + 3] * (1 / 255), L = f[g] * $, I = f[g + 1] * $, F = f[g + 2] * $, P = 1 - v, B = v + $ * P, G = B == 0 ? 0 : 1 / B; + f[g + 3] = 255 * B, f[g + 0] = (E + L * P) * G, f[g + 1] = (w + I * P) * G, f[g + 2] = (k + F * P) * G; } else if (m == 2) { - var _ = o[p + 3], E = o[p], w = o[p + 1], k = o[p + 2], $ = f[g + 3], L = f[g], z = f[g + 1], F = f[g + 2]; - _ == $ && E == L && w == z && k == F ? (f[g] = 0, f[g + 1] = 0, f[g + 2] = 0, f[g + 3] = 0) : (f[g] = E, f[g + 1] = w, f[g + 2] = k, f[g + 3] = _); + var v = o[p + 3], E = o[p], w = o[p + 1], k = o[p + 2], $ = f[g + 3], L = f[g], I = f[g + 1], F = f[g + 2]; + v == $ && E == L && w == I && k == F ? (f[g] = 0, f[g + 1] = 0, f[g + 2] = 0, f[g + 3] = 0) : (f[g] = E, f[g + 1] = w, f[g + 2] = k, f[g + 3] = v); } else if (m == 3) { - var _ = o[p + 3], E = o[p], w = o[p + 1], k = o[p + 2], $ = f[g + 3], L = f[g], z = f[g + 1], F = f[g + 2]; - if (_ == $ && E == L && w == z && k == F) continue; - if (_ < 220 && $ > 20) return !1; + var v = o[p + 3], E = o[p], w = o[p + 1], k = o[p + 2], $ = f[g + 3], L = f[g], I = f[g + 1], F = f[g + 2]; + if (v == $ && E == L && w == I && k == F) continue; + if (v < 220 && $ > 20) return !1; } return !0; - }, s.encode = function(o, d, v, f, y, A) { + }, s.encode = function(o, d, _, f, y, A) { f == null && (f = 0), A == null && (A = !1); for (var x = new Uint8Array(o[0].byteLength * o.length + 100), M = [137, 80, 78, 71, 13, 10, 26, 10], m = 0; m < 8; m++) x[m] = M[m]; - var l = 8, u = s._bin, p = s.crc.crc, g = u.writeUint, b = u.writeUshort, c = u.writeASCII, _ = s.encode.compressPNG(o, d, v, f, A); - g(x, l, 13), l += 4, c(x, l, "IHDR"), l += 4, g(x, l, d), l += 4, g(x, l, v), l += 4, x[l] = _.depth, l++, x[l] = _.ctype, l++, x[l] = 0, l++, x[l] = 0, l++, x[l] = 0, l++, g(x, l, p(x, l - 17, 17)), l += 4, g(x, l, 1), l += 4, c(x, l, "sRGB"), l += 4, x[l] = 1, l++, g(x, l, p(x, l - 5, 5)), l += 4; + var l = 8, u = s._bin, p = s.crc.crc, g = u.writeUint, b = u.writeUshort, c = u.writeASCII, v = s.encode.compressPNG(o, d, _, f, A); + g(x, l, 13), l += 4, c(x, l, "IHDR"), l += 4, g(x, l, d), l += 4, g(x, l, _), l += 4, x[l] = v.depth, l++, x[l] = v.ctype, l++, x[l] = 0, l++, x[l] = 0, l++, x[l] = 0, l++, g(x, l, p(x, l - 17, 17)), l += 4, g(x, l, 1), l += 4, c(x, l, "sRGB"), l += 4, x[l] = 1, l++, g(x, l, p(x, l - 5, 5)), l += 4; var E = o.length > 1; - if (E && (g(x, l, 8), l += 4, c(x, l, "acTL"), l += 4, g(x, l, o.length), l += 4, g(x, l, 0), l += 4, g(x, l, p(x, l - 12, 12)), l += 4), _.ctype == 3) { - var w = _.plte.length; + if (E && (g(x, l, 8), l += 4, c(x, l, "acTL"), l += 4, g(x, l, o.length), l += 4, g(x, l, 0), l += 4, g(x, l, p(x, l - 12, 12)), l += 4), v.ctype == 3) { + var w = v.plte.length; g(x, l, w * 3), l += 4, c(x, l, "PLTE"), l += 4; for (var m = 0; m < w; m++) { - var k = m * 3, $ = _.plte[m], L = $ & 255, z = $ >> 8 & 255, F = $ >> 16 & 255; - x[l + k + 0] = L, x[l + k + 1] = z, x[l + k + 2] = F; + var k = m * 3, $ = v.plte[m], L = $ & 255, I = $ >> 8 & 255, F = $ >> 16 & 255; + x[l + k + 0] = L, x[l + k + 1] = I, x[l + k + 2] = F; } - if (l += w * 3, g(x, l, p(x, l - w * 3 - 4, w * 3 + 4)), l += 4, _.gotAlpha) { + if (l += w * 3, g(x, l, p(x, l - w * 3 - 4, w * 3 + 4)), l += 4, v.gotAlpha) { g(x, l, w), l += 4, c(x, l, "tRNS"), l += 4; - for (var m = 0; m < w; m++) x[l + m] = _.plte[m] >> 24 & 255; + for (var m = 0; m < w; m++) x[l + m] = v.plte[m] >> 24 & 255; l += w, g(x, l, p(x, l - w - 4, w + 4)), l += 4; } } - for (var R = 0, P = 0; P < _.frames.length; P++) { - var U = _.frames[P]; - E && (g(x, l, 26), l += 4, c(x, l, "fcTL"), l += 4, g(x, l, R++), l += 4, g(x, l, U.rect.width), l += 4, g(x, l, U.rect.height), l += 4, g(x, l, U.rect.x), l += 4, g(x, l, U.rect.y), l += 4, b(x, l, y[P]), l += 2, b(x, l, 1e3), l += 2, x[l] = U.dispose, l++, x[l] = U.blend, l++, g(x, l, p(x, l - 30, 30)), l += 4); - var N = U.cimg, w = N.length; - g(x, l, w + (P == 0 ? 0 : 4)), l += 4; - var B = l; - c(x, l, P == 0 ? "IDAT" : "fdAT"), l += 4, P != 0 && (g(x, l, R++), l += 4); - for (var m = 0; m < w; m++) x[l + m] = N[m]; - l += w, g(x, l, p(x, B, l - B)), l += 4; + for (var P = 0, B = 0; B < v.frames.length; B++) { + var G = v.frames[B]; + E && (g(x, l, 26), l += 4, c(x, l, "fcTL"), l += 4, g(x, l, P++), l += 4, g(x, l, G.rect.width), l += 4, g(x, l, G.rect.height), l += 4, g(x, l, G.rect.x), l += 4, g(x, l, G.rect.y), l += 4, b(x, l, y[B]), l += 2, b(x, l, 1e3), l += 2, x[l] = G.dispose, l++, x[l] = G.blend, l++, g(x, l, p(x, l - 30, 30)), l += 4); + var U = G.cimg, w = U.length; + g(x, l, w + (B == 0 ? 0 : 4)), l += 4; + var R = l; + c(x, l, B == 0 ? "IDAT" : "fdAT"), l += 4, B != 0 && (g(x, l, P++), l += 4); + for (var m = 0; m < w; m++) x[l + m] = U[m]; + l += w, g(x, l, p(x, R, l - R)), l += 4; } return g(x, l, 0), l += 4, c(x, l, "IEND"), l += 4, g(x, l, p(x, l - 4, 4)), l += 4, x.buffer.slice(0, l); - }, s.encode.compressPNG = function(o, d, v, f, y) { - for (var A = s.encode.compress(o, d, v, f, !1, y), x = 0; x < o.length; x++) { + }, s.encode.compressPNG = function(o, d, _, f, y) { + for (var A = s.encode.compress(o, d, _, f, !1, y), x = 0; x < o.length; x++) { var M = A.frames[x]; M.rect.width; var m = M.rect.height, l = M.bpl, u = M.bpp, p = new Uint8Array(m * l + m); M.cimg = s.encode._filterZero(M.img, m, u, l, p); } return A; - }, s.encode.compress = function(o, d, v, f, y, A) { + }, s.encode.compress = function(o, d, _, f, y, A) { A == null && (A = !1); for (var x = 6, M = 8, m = 4, l = 255, u = 0; u < o.length; u++) for (var p = new Uint8Array(o[u]), g = p.length, b = 0; b < g; b += 4) l &= p[b + 3]; - var c = l != 255, _ = {}, E = []; - if (o.length != 0 && (_[0] = 0, E.push(0), f != 0 && f--), f != 0) { + var c = l != 255, v = {}, E = []; + if (o.length != 0 && (v[0] = 0, E.push(0), f != 0 && f--), f != 0) { var w = s.quantize(o, f, y); o = w.bufs; for (var b = 0; b < w.plte.length; b++) { var k = w.plte[b].est.rgba; - _[k] == null && (_[k] = E.length, E.push(k)); + v[k] == null && (v[k] = E.length, E.push(k)); } } else for (var u = 0; u < o.length; u++) for (var $ = new Uint32Array(o[u]), g = $.length, b = 0; b < g; b++) { var k = $[b]; - if ((b < d || k != $[b - 1] && k != $[b - d]) && _[k] == null && (_[k] = E.length, E.push(k), E.length >= 300)) + if ((b < d || k != $[b - 1] && k != $[b - d]) && v[k] == null && (v[k] = E.length, E.push(k), E.length >= 300)) break; } - var L = c ? y : !1, z = E.length; - z <= 256 && A == !1 && (z <= 2 ? M = 1 : z <= 4 ? M = 2 : z <= 16 ? M = 4 : M = 8, y && (M = 8), c = !0); + var L = c ? y : !1, I = E.length; + I <= 256 && A == !1 && (I <= 2 ? M = 1 : I <= 4 ? M = 2 : I <= 16 ? M = 4 : M = 8, y && (M = 8), c = !0); for (var F = [], u = 0; u < o.length; u++) { - var R = new Uint8Array(o[u]), P = new Uint32Array(R.buffer), U = 0, N = 0, B = d, W = v, V = 0; + var P = new Uint8Array(o[u]), B = new Uint32Array(P.buffer), G = 0, U = 0, R = d, W = _, H = 0; if (u != 0 && !L) { - for (var G = y || u == 1 || F[F.length - 2].dispose == 2 ? 1 : 2, H = 0, Q = 1e9, te = 0; te < G; te++) { - for (var pe = new Uint8Array(o[u - 1 - te]), ee = new Uint32Array(o[u - 1 - te]), ce = d, fe = v, oe = -1, he = -1, Ae = 0; Ae < v; Ae++) for (var Se = 0; Se < d; Se++) { - var b = Ae * d + Se; - P[b] != ee[b] && (Se < ce && (ce = Se), Se > oe && (oe = Se), Ae < fe && (fe = Ae), Ae > he && (he = Ae)); + for (var N = y || u == 1 || F[F.length - 2].dispose == 2 ? 1 : 2, V = 0, J = 1e9, re = 0; re < N; re++) { + for (var pe = new Uint8Array(o[u - 1 - re]), te = new Uint32Array(o[u - 1 - re]), ue = d, ie = _, ae = -1, ce = -1, Me = 0; Me < _; Me++) for (var Ae = 0; Ae < d; Ae++) { + var b = Me * d + Ae; + B[b] != te[b] && (Ae < ue && (ue = Ae), Ae > ae && (ae = Ae), Me < ie && (ie = Me), Me > ce && (ce = Me)); } - var Ie = oe == -1 ? 1 : (oe - ce + 1) * (he - fe + 1); - Ie < Q && (Q = Ie, H = te, oe == -1 ? (U = N = 0, B = W = 1) : (U = ce, N = fe, B = oe - ce + 1, W = he - fe + 1)); + var Ie = ae == -1 ? 1 : (ae - ue + 1) * (ce - ie + 1); + Ie < J && (J = Ie, V = re, ae == -1 ? (G = U = 0, R = W = 1) : (G = ue, U = ie, R = ae - ue + 1, W = ce - ie + 1)); } - var pe = new Uint8Array(o[u - 1 - H]); - H == 1 && (F[F.length - 1].dispose = 2); - var le = new Uint8Array(B * W * 4); - new Uint32Array(le.buffer), s._copyTile(pe, d, v, le, B, W, -U, -N, 0), s._copyTile(R, d, v, le, B, W, -U, -N, 3) ? (s._copyTile(R, d, v, le, B, W, -U, -N, 2), V = 1) : (s._copyTile(R, d, v, le, B, W, -U, -N, 0), V = 0), R = le, P = new Uint32Array(R.buffer); + var pe = new Uint8Array(o[u - 1 - V]); + V == 1 && (F[F.length - 1].dispose = 2); + var se = new Uint8Array(R * W * 4); + new Uint32Array(se.buffer), s._copyTile(pe, d, _, se, R, W, -G, -U, 0), s._copyTile(P, d, _, se, R, W, -G, -U, 3) ? (s._copyTile(P, d, _, se, R, W, -G, -U, 2), H = 1) : (s._copyTile(P, d, _, se, R, W, -G, -U, 0), H = 0), P = se, B = new Uint32Array(P.buffer); } - var ne = 4 * B; - if (z <= 256 && A == !1) { - ne = Math.ceil(M * B / 8); - for (var le = new Uint8Array(ne * W), Ae = 0; Ae < W; Ae++) { - var b = Ae * ne, Te = Ae * B; - if (M == 8) for (var Se = 0; Se < B; Se++) le[b + Se] = _[P[Te + Se]]; - else if (M == 4) for (var Se = 0; Se < B; Se++) le[b + (Se >> 1)] |= _[P[Te + Se]] << 4 - (Se & 1) * 4; - else if (M == 2) for (var Se = 0; Se < B; Se++) le[b + (Se >> 2)] |= _[P[Te + Se]] << 6 - (Se & 3) * 2; - else if (M == 1) for (var Se = 0; Se < B; Se++) le[b + (Se >> 3)] |= _[P[Te + Se]] << 7 - (Se & 7) * 1; + var Q = 4 * R; + if (I <= 256 && A == !1) { + Q = Math.ceil(M * R / 8); + for (var se = new Uint8Array(Q * W), Me = 0; Me < W; Me++) { + var b = Me * Q, ye = Me * R; + if (M == 8) for (var Ae = 0; Ae < R; Ae++) se[b + Ae] = v[B[ye + Ae]]; + else if (M == 4) for (var Ae = 0; Ae < R; Ae++) se[b + (Ae >> 1)] |= v[B[ye + Ae]] << 4 - (Ae & 1) * 4; + else if (M == 2) for (var Ae = 0; Ae < R; Ae++) se[b + (Ae >> 2)] |= v[B[ye + Ae]] << 6 - (Ae & 3) * 2; + else if (M == 1) for (var Ae = 0; Ae < R; Ae++) se[b + (Ae >> 3)] |= v[B[ye + Ae]] << 7 - (Ae & 7) * 1; } - R = le, x = 3, m = 1; + P = se, x = 3, m = 1; } else if (c == !1 && o.length == 1) { - for (var le = new Uint8Array(B * W * 3), Oe = B * W, b = 0; b < Oe; b++) { - var Be = b * 3, Ue = b * 4; - le[Be] = R[Ue], le[Be + 1] = R[Ue + 1], le[Be + 2] = R[Ue + 2]; + for (var se = new Uint8Array(R * W * 3), ke = R * W, b = 0; b < ke; b++) { + var Pe = b * 3, Ne = b * 4; + se[Pe] = P[Ne], se[Pe + 1] = P[Ne + 1], se[Pe + 2] = P[Ne + 2]; } - R = le, x = 2, m = 3, ne = 3 * B; + P = se, x = 2, m = 3, Q = 3 * R; } - F.push({ rect: { x: U, y: N, width: B, height: W }, img: R, bpl: ne, bpp: m, blend: V, dispose: L ? 1 : 0 }); + F.push({ rect: { x: G, y: U, width: R, height: W }, img: P, bpl: Q, bpp: m, blend: H, dispose: L ? 1 : 0 }); } return { ctype: x, depth: M, plte: E, gotAlpha: c, frames: F }; - }, s.encode._filterZero = function(o, d, v, f, y) { + }, s.encode._filterZero = function(o, d, _, f, y) { for (var A = [], x = 0; x < 5; x++) if (!(d * f > 5e5 && (x == 2 || x == 3 || x == 4))) { - for (var M = 0; M < d; M++) s.encode._filterLine(y, o, M, f, v, x); - if (A.push(h.deflate(y)), v == 1) break; + for (var M = 0; M < d; M++) s.encode._filterLine(y, o, M, f, _, x); + if (A.push(h.deflate(y)), _ == 1) break; } for (var m, l = 1e9, u = 0; u < A.length; u++) A[u].length < l && (m = u, l = A[u].length); return A[m]; - }, s.encode._filterLine = function(o, d, v, f, y, A) { - var x = v * f, M = x + v, m = s.decode._paeth; + }, s.encode._filterLine = function(o, d, _, f, y, A) { + var x = _ * f, M = x + _, m = s.decode._paeth; if (o[M] = A, M++, A == 0) for (var l = 0; l < f; l++) o[M + l] = d[x + l]; else if (A == 1) { for (var l = 0; l < y; l++) o[M + l] = d[x + l]; for (var l = y; l < f; l++) o[M + l] = d[x + l] - d[x + l - y] + 256 & 255; - } else if (v == 0) { + } else if (_ == 0) { for (var l = 0; l < y; l++) o[M + l] = d[x + l]; if (A == 2) for (var l = y; l < f; l++) o[M + l] = d[x + l]; if (A == 3) for (var l = y; l < f; l++) o[M + l] = d[x + l] - (d[x + l - y] >> 1) + 256 & 255; @@ -37932,22 +37954,22 @@ ATOM`, b); }, s.crc = { table: function() { for (var o = new Uint32Array(256), d = 0; d < 256; d++) { - for (var v = d, f = 0; f < 8; f++) - v & 1 ? v = 3988292384 ^ v >>> 1 : v = v >>> 1; - o[d] = v; + for (var _ = d, f = 0; f < 8; f++) + _ & 1 ? _ = 3988292384 ^ _ >>> 1 : _ = _ >>> 1; + o[d] = _; } return o; }(), - update: function(o, d, v, f) { - for (var y = 0; y < f; y++) o = s.crc.table[(o ^ d[v + y]) & 255] ^ o >>> 8; + update: function(o, d, _, f) { + for (var y = 0; y < f; y++) o = s.crc.table[(o ^ d[_ + y]) & 255] ^ o >>> 8; return o; }, - crc: function(o, d, v) { - return s.crc.update(4294967295, o, d, v) ^ 4294967295; + crc: function(o, d, _) { + return s.crc.update(4294967295, o, d, _) ^ 4294967295; } - }, s.quantize = function(o, d, v) { + }, s.quantize = function(o, d, _) { for (var f = [], y = 0, A = 0; A < o.length; A++) - f.push(s.encode.alphaMul(new Uint8Array(o[A]), v)), y += o[A].byteLength; + f.push(s.encode.alphaMul(new Uint8Array(o[A]), _)), y += o[A].byteLength; for (var x = new Uint8Array(y), M = new Uint32Array(x.buffer), m = 0, A = 0; A < f.length; A++) { for (var l = f[A], u = l.length, p = 0; p < u; p++) x[m + p] = l[p]; m += u; @@ -37955,63 +37977,63 @@ ATOM`, b); var g = { i0: 0, i1: x.length, bst: null, est: null, tdst: 0, left: null, right: null }; g.bst = s.quantize.stats(x, g.i0, g.i1), g.est = s.quantize.estats(g.bst); for (var b = [g]; b.length < d; ) { - for (var c = 0, _ = 0, A = 0; A < b.length; A++) b[A].est.L > c && (c = b[A].est.L, _ = A); + for (var c = 0, v = 0, A = 0; A < b.length; A++) b[A].est.L > c && (c = b[A].est.L, v = A); if (c < 1e-3) break; - var E = b[_], w = s.quantize.splitPixels(x, M, E.i0, E.i1, E.est.e, E.est.eMq255), k = { i0: E.i0, i1: w, bst: null, est: null, tdst: 0, left: null, right: null }; + var E = b[v], w = s.quantize.splitPixels(x, M, E.i0, E.i1, E.est.e, E.est.eMq255), k = { i0: E.i0, i1: w, bst: null, est: null, tdst: 0, left: null, right: null }; k.bst = s.quantize.stats(x, k.i0, k.i1), k.est = s.quantize.estats(k.bst); var $ = { i0: w, i1: E.i1, bst: null, est: null, tdst: 0, left: null, right: null }; $.bst = { R: [], m: [], N: E.bst.N - k.bst.N }; for (var A = 0; A < 16; A++) $.bst.R[A] = E.bst.R[A] - k.bst.R[A]; for (var A = 0; A < 4; A++) $.bst.m[A] = E.bst.m[A] - k.bst.m[A]; - $.est = s.quantize.estats($.bst), E.left = k, E.right = $, b[_] = k, b.push($); + $.est = s.quantize.estats($.bst), E.left = k, E.right = $, b[v] = k, b.push($); } - b.sort(function(G, H) { - return H.bst.N - G.bst.N; + b.sort(function(N, V) { + return V.bst.N - N.bst.N; }); for (var L = 0; L < f.length; L++) { - for (var z = s.quantize.planeDst, F = new Uint8Array(f[L].buffer), R = new Uint32Array(f[L].buffer), P = F.length, A = 0; A < P; A += 4) { - for (var U = F[A] * 0.00392156862745098, N = F[A + 1] * (1 / 255), B = F[A + 2] * (1 / 255), W = F[A + 3] * (1 / 255), V = g; V.left; ) V = z(V.est, U, N, B, W) <= 0 ? V.left : V.right; - R[A >> 2] = V.est.rgba; + for (var I = s.quantize.planeDst, F = new Uint8Array(f[L].buffer), P = new Uint32Array(f[L].buffer), B = F.length, A = 0; A < B; A += 4) { + for (var G = F[A] * 0.00392156862745098, U = F[A + 1] * (1 / 255), R = F[A + 2] * (1 / 255), W = F[A + 3] * (1 / 255), H = g; H.left; ) H = I(H.est, G, U, R, W) <= 0 ? H.left : H.right; + P[A >> 2] = H.est.rgba; } - f[L] = R.buffer; + f[L] = P.buffer; } return { bufs: f, plte: b }; - }, s.quantize.getNearest = function(o, d, v, f, y) { + }, s.quantize.getNearest = function(o, d, _, f, y) { if (o.left == null) - return o.tdst = s.quantize.dist(o.est.q, d, v, f, y), o; - var A = s.quantize.planeDst(o.est, d, v, f, y), x = o.left, M = o.right; + return o.tdst = s.quantize.dist(o.est.q, d, _, f, y), o; + var A = s.quantize.planeDst(o.est, d, _, f, y), x = o.left, M = o.right; A > 0 && (x = o.right, M = o.left); - var m = s.quantize.getNearest(x, d, v, f, y); + var m = s.quantize.getNearest(x, d, _, f, y); if (m.tdst <= A * A) return m; - var l = s.quantize.getNearest(M, d, v, f, y); + var l = s.quantize.getNearest(M, d, _, f, y); return l.tdst < m.tdst ? l : m; - }, s.quantize.planeDst = function(o, d, v, f, y) { + }, s.quantize.planeDst = function(o, d, _, f, y) { var A = o.e; - return A[0] * d + A[1] * v + A[2] * f + A[3] * y - o.eMq; - }, s.quantize.dist = function(o, d, v, f, y) { - var A = d - o[0], x = v - o[1], M = f - o[2], m = y - o[3]; + return A[0] * d + A[1] * _ + A[2] * f + A[3] * y - o.eMq; + }, s.quantize.dist = function(o, d, _, f, y) { + var A = d - o[0], x = _ - o[1], M = f - o[2], m = y - o[3]; return A * A + x * x + M * M + m * m; - }, s.quantize.splitPixels = function(o, d, v, f, y, A) { + }, s.quantize.splitPixels = function(o, d, _, f, y, A) { var x = s.quantize.vecDot; - for (f -= 4; v < f; ) { - for (; x(o, v, y) <= A; ) v += 4; + for (f -= 4; _ < f; ) { + for (; x(o, _, y) <= A; ) _ += 4; for (; x(o, f, y) > A; ) f -= 4; - if (v >= f) break; - var M = d[v >> 2]; - d[v >> 2] = d[f >> 2], d[f >> 2] = M, v += 4, f -= 4; + if (_ >= f) break; + var M = d[_ >> 2]; + d[_ >> 2] = d[f >> 2], d[f >> 2] = M, _ += 4, f -= 4; } - for (; x(o, v, y) > A; ) v -= 4; - return v + 4; - }, s.quantize.vecDot = function(o, d, v) { - return o[d] * v[0] + o[d + 1] * v[1] + o[d + 2] * v[2] + o[d + 3] * v[3]; - }, s.quantize.stats = function(o, d, v) { - for (var f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0], A = v - d >> 2, x = d; x < v; x += 4) { + for (; x(o, _, y) > A; ) _ -= 4; + return _ + 4; + }, s.quantize.vecDot = function(o, d, _) { + return o[d] * _[0] + o[d + 1] * _[1] + o[d + 2] * _[2] + o[d + 3] * _[3]; + }, s.quantize.stats = function(o, d, _) { + for (var f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0], A = _ - d >> 2, x = d; x < _; x += 4) { var M = o[x] * 0.00392156862745098, m = o[x + 1] * (1 / 255), l = o[x + 2] * (1 / 255), u = o[x + 3] * (1 / 255); y[0] += M, y[1] += m, y[2] += l, y[3] += u, f[0] += M * M, f[1] += M * m, f[2] += M * l, f[3] += M * u, f[5] += m * m, f[6] += m * l, f[7] += m * u, f[10] += l * l, f[11] += l * u, f[15] += u * u; } return f[4] = f[1], f[8] = f[2], f[12] = f[3], f[9] = f[6], f[13] = f[7], f[14] = f[11], { R: f, m: y, N: A }; }, s.quantize.estats = function(o) { - var d = o.R, v = o.m, f = o.N, y = v[0], A = v[1], x = v[2], M = v[3], m = f == 0 ? 0 : 1 / f, l = [ + var d = o.R, _ = o.m, f = o.N, y = _[0], A = _[1], x = _[2], M = _[3], m = f == 0 ? 0 : 1 / f, l = [ d[0] - y * y * m, d[1] - y * A * m, d[2] - y * x * m, @@ -38030,7 +38052,7 @@ ATOM`, b); d[15] - M * M * m ], u = l, p = s.M4, g = [0.5, 0.5, 0.5, 0.5], b = 0, c = 0; if (f != 0) - for (var _ = 0; _ < 10 && (g = p.multVec(u, g), c = Math.sqrt(p.dot(g, g)), g = p.sml(1 / c, g), !(Math.abs(c - b) < 1e-9)); _++) + for (var v = 0; v < 10 && (g = p.multVec(u, g), c = Math.sqrt(p.dot(g, g)), g = p.sml(1 / c, g), !(Math.abs(c - b) < 1e-9)); v++) b = c; var E = [y * m, A * m, x * m, M * m], w = p.dot(p.sml(255, E), g), k = E[3] < 1e-3 ? 0 : 1 / E[3]; return { @@ -38058,13 +38080,13 @@ ATOM`, b); return [o * d[0], o * d[1], o * d[2], o * d[3]]; } }, s.encode.alphaMul = function(o, d) { - for (var v = new Uint8Array(o.length), f = o.length >> 2, y = 0; y < f; y++) { + for (var _ = new Uint8Array(o.length), f = o.length >> 2, y = 0; y < f; y++) { var A = y << 2, x = o[A + 3]; d && (x = x < 128 ? 0 : 255); var M = x * (1 / 255); - v[A + 0] = o[A + 0] * M, v[A + 1] = o[A + 1] * M, v[A + 2] = o[A + 2] * M, v[A + 3] = x; + _[A + 0] = o[A + 0] * M, _[A + 1] = o[A + 1] * M, _[A + 2] = o[A + 2] * M, _[A + 3] = x; } - return v; + return _; }; }(r, a); })(); @@ -38115,7 +38137,7 @@ ATOM`, b); ), o = t( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), d = Object.prototype.toString, v = 0, f = 4, y = 0, A = 1, x = 2, M = -1, m = 0, l = 8; + ), d = Object.prototype.toString, _ = 0, f = 4, y = 0, A = 1, x = 2, M = -1, m = 0, l = 8; function u(c) { if (!(this instanceof u)) return new u(c); this.options = a.assign({ @@ -38127,30 +38149,30 @@ ATOM`, b); strategy: m, to: "" }, c || {}); - var _ = this.options; - _.raw && _.windowBits > 0 ? _.windowBits = -_.windowBits : _.gzip && _.windowBits > 0 && _.windowBits < 16 && (_.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new o(), this.strm.avail_out = 0; + var 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 o(), this.strm.avail_out = 0; var E = r.deflateInit2( this.strm, - _.level, - _.method, - _.windowBits, - _.memLevel, - _.strategy + v.level, + v.method, + v.windowBits, + v.memLevel, + v.strategy ); if (E !== y) throw new Error(h[E]); - if (_.header && r.deflateSetHeader(this.strm, _.header), _.dictionary) { + if (v.header && r.deflateSetHeader(this.strm, v.header), v.dictionary) { var w; - if (typeof _.dictionary == "string" ? w = s.string2buf(_.dictionary) : d.call(_.dictionary) === "[object ArrayBuffer]" ? w = new Uint8Array(_.dictionary) : w = _.dictionary, E = r.deflateSetDictionary(this.strm, w), E !== y) + if (typeof v.dictionary == "string" ? w = s.string2buf(v.dictionary) : d.call(v.dictionary) === "[object ArrayBuffer]" ? w = new Uint8Array(v.dictionary) : w = v.dictionary, E = r.deflateSetDictionary(this.strm, w), E !== y) throw new Error(h[E]); this._dict_set = !0; } } - u.prototype.push = function(c, _) { + u.prototype.push = function(c, v) { var E = this.strm, w = this.options.chunkSize, k, $; if (this.ended) return !1; - $ = _ === ~~_ ? _ : _ === !0 ? f : v, typeof c == "string" ? E.input = s.string2buf(c) : d.call(c) === "[object ArrayBuffer]" ? E.input = new Uint8Array(c) : E.input = c, E.next_in = 0, E.avail_in = E.input.length; + $ = v === ~~v ? v : v === !0 ? f : _, typeof c == "string" ? E.input = s.string2buf(c) : d.call(c) === "[object ArrayBuffer]" ? E.input = new Uint8Array(c) : E.input = c, E.next_in = 0, E.avail_in = E.input.length; do { if (E.avail_out === 0 && (E.output = new a.Buf8(w), E.next_out = 0, E.avail_out = w), k = r.deflate(E, $), k !== A && k !== y) return this.onEnd(k), this.ended = !0, !1; @@ -38162,17 +38184,17 @@ ATOM`, b); }, u.prototype.onEnd = function(c) { c === y && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = a.flattenChunks(this.chunks)), this.chunks = [], this.err = c, this.msg = this.strm.msg; }; - function p(c, _) { - var E = new u(_); + function p(c, v) { + var E = new u(v); if (E.push(c, !0), E.err) throw E.msg || h[E.err]; return E.result; } - function g(c, _) { - return _ = _ || {}, _.raw = !0, p(c, _); + function g(c, v) { + return v = v || {}, v.raw = !0, p(c, v); } - function b(c, _) { - return _ = _ || {}, _.gzip = !0, p(c, _); + function b(c, v) { + return v = v || {}, v.gzip = !0, p(c, v); } e.Deflate = u, e.deflate = p, e.deflateRaw = g, e.gzip = b; } @@ -38202,7 +38224,7 @@ ATOM`, b); ), d = t( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), v = t( + ), _ = t( /*! ./zlib/gzheader */ "./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js" ), f = Object.prototype.toString; @@ -38221,18 +38243,18 @@ ATOM`, b); ); if (l !== h.Z_OK) throw new Error(o[l]); - if (this.header = new v(), r.inflateGetHeader(this.strm, this.header), m.dictionary && (typeof m.dictionary == "string" ? m.dictionary = s.string2buf(m.dictionary) : f.call(m.dictionary) === "[object ArrayBuffer]" && (m.dictionary = new Uint8Array(m.dictionary)), m.raw && (l = r.inflateSetDictionary(this.strm, m.dictionary), l !== h.Z_OK))) + if (this.header = new _(), r.inflateGetHeader(this.strm, this.header), m.dictionary && (typeof m.dictionary == "string" ? m.dictionary = s.string2buf(m.dictionary) : f.call(m.dictionary) === "[object ArrayBuffer]" && (m.dictionary = new Uint8Array(m.dictionary)), m.raw && (l = r.inflateSetDictionary(this.strm, m.dictionary), l !== h.Z_OK))) throw new Error(o[l]); } y.prototype.push = function(M, m) { - var l = this.strm, u = this.options.chunkSize, p = this.options.dictionary, g, b, c, _, E, w = !1; + var l = this.strm, u = this.options.chunkSize, p = this.options.dictionary, g, b, c, v, E, w = !1; if (this.ended) return !1; b = m === ~~m ? m : m === !0 ? h.Z_FINISH : h.Z_NO_FLUSH, typeof M == "string" ? l.input = s.binstring2buf(M) : f.call(M) === "[object ArrayBuffer]" ? l.input = new Uint8Array(M) : l.input = M, l.next_in = 0, l.avail_in = l.input.length; do { if (l.avail_out === 0 && (l.output = new a.Buf8(u), l.next_out = 0, l.avail_out = u), g = r.inflate(l, h.Z_NO_FLUSH), g === h.Z_NEED_DICT && p && (g = r.inflateSetDictionary(this.strm, p)), g === h.Z_BUF_ERROR && w === !0 && (g = h.Z_OK, w = !1), g !== h.Z_STREAM_END && g !== h.Z_OK) return this.onEnd(g), this.ended = !0, !1; - l.next_out && (l.avail_out === 0 || g === h.Z_STREAM_END || l.avail_in === 0 && (b === h.Z_FINISH || b === h.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (c = s.utf8border(l.output, l.next_out), _ = l.next_out - c, E = s.buf2string(l.output, c), l.next_out = _, l.avail_out = u - _, _ && a.arraySet(l.output, l.output, c, _, 0), this.onData(E)) : this.onData(a.shrinkBuf(l.output, l.next_out))), l.avail_in === 0 && l.avail_out === 0 && (w = !0); + l.next_out && (l.avail_out === 0 || g === h.Z_STREAM_END || l.avail_in === 0 && (b === h.Z_FINISH || b === h.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (c = s.utf8border(l.output, l.next_out), v = l.next_out - c, E = s.buf2string(l.output, c), l.next_out = v, l.avail_out = u - v, v && a.arraySet(l.output, l.output, c, v, 0), this.onData(E)) : this.onData(a.shrinkBuf(l.output, l.next_out))), l.avail_in === 0 && l.avail_out === 0 && (w = !0); } while ((l.avail_in > 0 || l.avail_out === 0) && g !== h.Z_STREAM_END); return g === h.Z_STREAM_END && (b = h.Z_FINISH), b === h.Z_FINISH ? (g = r.inflateEnd(this.strm), this.onEnd(g), this.ended = !0, g === h.Z_OK) : (b === h.Z_SYNC_FLUSH && (this.onEnd(h.Z_OK), l.avail_out = 0), !0); }, y.prototype.onData = function(M) { @@ -38269,8 +38291,8 @@ ATOM`, b); if (d) { if (typeof d != "object") throw new TypeError(d + "must be non-object"); - for (var v in d) - r(d, v) && (h[v] = d[v]); + for (var _ in d) + r(d, _) && (h[_] = d[_]); } } return h; @@ -38278,26 +38300,26 @@ ATOM`, b); return h.length === o ? h : h.subarray ? h.subarray(0, o) : (h.length = o, h); }; var a = { - arraySet: function(h, o, d, v, f) { + arraySet: function(h, o, d, _, f) { if (o.subarray && h.subarray) { - h.set(o.subarray(d, d + v), f); + h.set(o.subarray(d, d + _), f); return; } - for (var y = 0; y < v; y++) + for (var y = 0; y < _; y++) h[f + y] = o[d + y]; }, // Join array of chunks to single array. flattenChunks: function(h) { - var o, d, v, f, y, A; - for (v = 0, o = 0, d = h.length; o < d; o++) - v += h[o].length; - for (A = new Uint8Array(v), f = 0, o = 0, d = h.length; o < d; o++) + var o, d, _, f, y, A; + for (_ = 0, o = 0, d = h.length; o < d; o++) + _ += h[o].length; + for (A = new Uint8Array(_), f = 0, o = 0, d = h.length; o < d; o++) y = h[o], A.set(y, f), f += y.length; return A; } }, s = { - arraySet: function(h, o, d, v, f) { - for (var y = 0; y < v; y++) + arraySet: function(h, o, d, _, f) { + for (var y = 0; y < _; y++) h[f + y] = o[d + y]; }, // Join array of chunks to single array. @@ -38333,31 +38355,31 @@ ATOM`, b); } for (var h = new r.Buf8(256), o = 0; o < 256; o++) h[o] = o >= 252 ? 6 : o >= 248 ? 5 : o >= 240 ? 4 : o >= 224 ? 3 : o >= 192 ? 2 : 1; - h[254] = h[254] = 1, e.string2buf = function(v) { - var f, y, A, x, M, m = v.length, l = 0; + h[254] = h[254] = 1, e.string2buf = function(_) { + var f, y, A, x, M, m = _.length, l = 0; for (x = 0; x < m; x++) - y = v.charCodeAt(x), (y & 64512) === 55296 && x + 1 < m && (A = v.charCodeAt(x + 1), (A & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (A - 56320), x++)), l += y < 128 ? 1 : y < 2048 ? 2 : y < 65536 ? 3 : 4; + y = _.charCodeAt(x), (y & 64512) === 55296 && x + 1 < m && (A = _.charCodeAt(x + 1), (A & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (A - 56320), x++)), l += y < 128 ? 1 : y < 2048 ? 2 : y < 65536 ? 3 : 4; for (f = new r.Buf8(l), M = 0, x = 0; M < l; x++) - y = v.charCodeAt(x), (y & 64512) === 55296 && x + 1 < m && (A = v.charCodeAt(x + 1), (A & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (A - 56320), x++)), y < 128 ? f[M++] = y : y < 2048 ? (f[M++] = 192 | y >>> 6, f[M++] = 128 | y & 63) : y < 65536 ? (f[M++] = 224 | y >>> 12, f[M++] = 128 | y >>> 6 & 63, f[M++] = 128 | y & 63) : (f[M++] = 240 | y >>> 18, f[M++] = 128 | y >>> 12 & 63, f[M++] = 128 | y >>> 6 & 63, f[M++] = 128 | y & 63); + y = _.charCodeAt(x), (y & 64512) === 55296 && x + 1 < m && (A = _.charCodeAt(x + 1), (A & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (A - 56320), x++)), y < 128 ? f[M++] = y : y < 2048 ? (f[M++] = 192 | y >>> 6, f[M++] = 128 | y & 63) : y < 65536 ? (f[M++] = 224 | y >>> 12, f[M++] = 128 | y >>> 6 & 63, f[M++] = 128 | y & 63) : (f[M++] = 240 | y >>> 18, f[M++] = 128 | y >>> 12 & 63, f[M++] = 128 | y >>> 6 & 63, f[M++] = 128 | y & 63); return f; }; - function d(v, f) { - if (f < 65534 && (v.subarray && s || !v.subarray && a)) - return String.fromCharCode.apply(null, r.shrinkBuf(v, f)); + function d(_, f) { + if (f < 65534 && (_.subarray && s || !_.subarray && a)) + return String.fromCharCode.apply(null, r.shrinkBuf(_, f)); for (var y = "", A = 0; A < f; A++) - y += String.fromCharCode(v[A]); + y += String.fromCharCode(_[A]); return y; } - e.buf2binstring = function(v) { - return d(v, v.length); - }, e.binstring2buf = function(v) { - for (var f = new r.Buf8(v.length), y = 0, A = f.length; y < A; y++) - f[y] = v.charCodeAt(y); + e.buf2binstring = function(_) { + return d(_, _.length); + }, e.binstring2buf = function(_) { + for (var f = new r.Buf8(_.length), y = 0, A = f.length; y < A; y++) + f[y] = _.charCodeAt(y); return f; - }, e.buf2string = function(v, f) { - var y, A, x, M, m = f || v.length, l = new Array(m * 2); + }, e.buf2string = function(_, f) { + var y, A, x, M, m = f || _.length, l = new Array(m * 2); for (A = 0, y = 0; y < m; ) { - if (x = v[y++], x < 128) { + if (x = _[y++], x < 128) { l[A++] = x; continue; } @@ -38366,7 +38388,7 @@ ATOM`, b); continue; } for (x &= M === 2 ? 31 : M === 3 ? 15 : 7; M > 1 && y < m; ) - x = x << 6 | v[y++] & 63, M--; + x = x << 6 | _[y++] & 63, M--; if (M > 1) { l[A++] = 65533; continue; @@ -38374,11 +38396,11 @@ ATOM`, b); x < 65536 ? l[A++] = x : (x -= 65536, l[A++] = 55296 | x >> 10 & 1023, l[A++] = 56320 | x & 1023); } return d(l, A); - }, e.utf8border = function(v, f) { + }, e.utf8border = function(_, f) { var y; - for (f = f || v.length, f > v.length && (f = v.length), y = f - 1; y >= 0 && (v[y] & 192) === 128; ) + for (f = f || _.length, f > _.length && (f = _.length), y = f - 1; y >= 0 && (_[y] & 192) === 128; ) y--; - return y < 0 || y === 0 ? f : y + h[v[y]] > f ? y : f; + return y < 0 || y === 0 ? f : y + h[_[y]] > f ? y : f; }; } ), @@ -38469,9 +38491,9 @@ ATOM`, b); } var t = e(); function r(a, s, h, o) { - var d = t, v = o + h; + var d = t, _ = o + h; a ^= -1; - for (var f = o; f < v; f++) + for (var f = o; f < _; f++) a = a >>> 8 ^ d[(a ^ s[f]) & 255]; return a ^ -1; } @@ -38500,170 +38522,170 @@ ATOM`, b); ), o = t( /*! ./messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), d = 0, v = 1, f = 3, y = 4, A = 5, x = 0, M = 1, m = -2, l = -3, u = -5, p = -1, g = 1, b = 2, c = 3, _ = 4, E = 0, w = 2, k = 8, $ = 9, L = 15, z = 8, F = 29, R = 256, P = R + 1 + F, U = 30, N = 19, B = 2 * P + 1, W = 15, V = 3, G = 258, H = G + V + 1, Q = 32, te = 42, ee = 69, ce = 73, fe = 91, oe = 103, he = 113, Ae = 666, Se = 1, Ie = 2, pe = 3, le = 4, ne = 3; - function Te(I, we) { - return I.msg = o[we], we; + ), d = 0, _ = 1, f = 3, y = 4, A = 5, x = 0, M = 1, m = -2, l = -3, u = -5, p = -1, g = 1, b = 2, c = 3, v = 4, E = 0, w = 2, k = 8, $ = 9, L = 15, I = 8, F = 29, P = 256, B = P + 1 + F, G = 30, U = 19, R = 2 * B + 1, W = 15, H = 3, N = 258, V = N + H + 1, J = 32, re = 42, te = 69, ue = 73, ie = 91, ae = 103, ce = 113, Me = 666, Ae = 1, Ie = 2, pe = 3, se = 4, Q = 3; + function ye(z, Ee) { + return z.msg = o[Ee], Ee; } - function Oe(I) { - return (I << 1) - (I > 4 ? 9 : 0); + function ke(z) { + return (z << 1) - (z > 4 ? 9 : 0); } - function Be(I) { - for (var we = I.length; --we >= 0; ) - I[we] = 0; + function Pe(z) { + for (var Ee = z.length; --Ee >= 0; ) + z[Ee] = 0; } - function Ue(I) { - var we = I.state, ve = we.pending; - ve > I.avail_out && (ve = I.avail_out), ve !== 0 && (r.arraySet(I.output, we.pending_buf, we.pending_out, ve, I.next_out), I.next_out += ve, we.pending_out += ve, I.total_out += ve, I.avail_out -= ve, we.pending -= ve, we.pending === 0 && (we.pending_out = 0)); + function Ne(z) { + var Ee = z.state, ve = Ee.pending; + ve > z.avail_out && (ve = z.avail_out), ve !== 0 && (r.arraySet(z.output, Ee.pending_buf, Ee.pending_out, ve, z.next_out), z.next_out += ve, Ee.pending_out += ve, z.total_out += ve, z.avail_out -= ve, Ee.pending -= ve, Ee.pending === 0 && (Ee.pending_out = 0)); } - function Pe(I, we) { - a._tr_flush_block(I, I.block_start >= 0 ? I.block_start : -1, I.strstart - I.block_start, we), I.block_start = I.strstart, Ue(I.strm); + function Be(z, Ee) { + a._tr_flush_block(z, z.block_start >= 0 ? z.block_start : -1, z.strstart - z.block_start, Ee), z.block_start = z.strstart, Ne(z.strm); } - function Ge(I, we) { - I.pending_buf[I.pending++] = we; + function Ge(z, Ee) { + z.pending_buf[z.pending++] = Ee; } - function Ne(I, we) { - I.pending_buf[I.pending++] = we >>> 8 & 255, I.pending_buf[I.pending++] = we & 255; + function Ue(z, Ee) { + z.pending_buf[z.pending++] = Ee >>> 8 & 255, z.pending_buf[z.pending++] = Ee & 255; } - function Re(I, we, ve, Y) { - var de = I.avail_in; - return de > Y && (de = Y), de === 0 ? 0 : (I.avail_in -= de, r.arraySet(we, I.input, I.next_in, de, ve), I.state.wrap === 1 ? I.adler = s(I.adler, we, de, ve) : I.state.wrap === 2 && (I.adler = h(I.adler, we, de, ve)), I.next_in += de, I.total_in += de, de); + function Re(z, Ee, ve, Y) { + var fe = z.avail_in; + return fe > Y && (fe = Y), fe === 0 ? 0 : (z.avail_in -= fe, r.arraySet(Ee, z.input, z.next_in, fe, ve), z.state.wrap === 1 ? z.adler = s(z.adler, Ee, fe, ve) : z.state.wrap === 2 && (z.adler = h(z.adler, Ee, fe, ve)), z.next_in += fe, z.total_in += fe, fe); } - function De(I, we) { - var ve = I.max_chain_length, Y = I.strstart, de, Me, Ye = I.prev_length, Ze = I.nice_match, Ke = I.strstart > I.w_size - H ? I.strstart - (I.w_size - H) : 0, rt = I.window, wt = I.w_mask, st = I.prev, ot = I.strstart + G, at = rt[Y + Ye - 1], Mt = rt[Y + Ye]; - I.prev_length >= I.good_match && (ve >>= 2), Ze > I.lookahead && (Ze = I.lookahead); + function Ce(z, Ee) { + var ve = z.max_chain_length, Y = z.strstart, fe, De, Ye = z.prev_length, Ze = z.nice_match, Ke = z.strstart > z.w_size - V ? z.strstart - (z.w_size - V) : 0, rt = z.window, wt = z.w_mask, st = z.prev, ot = z.strstart + N, at = rt[Y + Ye - 1], Mt = rt[Y + Ye]; + z.prev_length >= z.good_match && (ve >>= 2), Ze > z.lookahead && (Ze = z.lookahead); do - if (de = we, !(rt[de + Ye] !== Mt || rt[de + Ye - 1] !== at || rt[de] !== rt[Y] || rt[++de] !== rt[Y + 1])) { - Y += 2, de++; + if (fe = Ee, !(rt[fe + Ye] !== Mt || rt[fe + Ye - 1] !== at || rt[fe] !== rt[Y] || rt[++fe] !== rt[Y + 1])) { + Y += 2, fe++; do ; - while (rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && rt[++Y] === rt[++de] && Y < ot); - if (Me = G - (ot - Y), Y = ot - G, Me > Ye) { - if (I.match_start = we, Ye = Me, Me >= Ze) + while (rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && rt[++Y] === rt[++fe] && Y < ot); + if (De = N - (ot - Y), Y = ot - N, De > Ye) { + if (z.match_start = Ee, Ye = De, De >= Ze) break; at = rt[Y + Ye - 1], Mt = rt[Y + Ye]; } } - while ((we = st[we & wt]) > Ke && --ve !== 0); - return Ye <= I.lookahead ? Ye : I.lookahead; + while ((Ee = st[Ee & wt]) > Ke && --ve !== 0); + return Ye <= z.lookahead ? Ye : z.lookahead; } - function je(I) { - var we = I.w_size, ve, Y, de, Me, Ye; + function je(z) { + var Ee = z.w_size, ve, Y, fe, De, Ye; do { - if (Me = I.window_size - I.lookahead - I.strstart, I.strstart >= we + (we - H)) { - r.arraySet(I.window, I.window, we, we, 0), I.match_start -= we, I.strstart -= we, I.block_start -= we, Y = I.hash_size, ve = Y; + if (De = z.window_size - z.lookahead - z.strstart, z.strstart >= Ee + (Ee - V)) { + r.arraySet(z.window, z.window, Ee, Ee, 0), z.match_start -= Ee, z.strstart -= Ee, z.block_start -= Ee, Y = z.hash_size, ve = Y; do - de = I.head[--ve], I.head[ve] = de >= we ? de - we : 0; + fe = z.head[--ve], z.head[ve] = fe >= Ee ? fe - Ee : 0; while (--Y); - Y = we, ve = Y; + Y = Ee, ve = Y; do - de = I.prev[--ve], I.prev[ve] = de >= we ? de - we : 0; + fe = z.prev[--ve], z.prev[ve] = fe >= Ee ? fe - Ee : 0; while (--Y); - Me += we; + De += Ee; } - if (I.strm.avail_in === 0) + if (z.strm.avail_in === 0) break; - if (Y = Re(I.strm, I.window, I.strstart + I.lookahead, Me), I.lookahead += Y, I.lookahead + I.insert >= V) - for (Ye = I.strstart - I.insert, I.ins_h = I.window[Ye], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ye + 1]) & I.hash_mask; I.insert && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ye + V - 1]) & I.hash_mask, I.prev[Ye & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = Ye, Ye++, I.insert--, !(I.lookahead + I.insert < V)); ) + if (Y = Re(z.strm, z.window, z.strstart + z.lookahead, De), z.lookahead += Y, z.lookahead + z.insert >= H) + for (Ye = z.strstart - z.insert, z.ins_h = z.window[Ye], z.ins_h = (z.ins_h << z.hash_shift ^ z.window[Ye + 1]) & z.hash_mask; z.insert && (z.ins_h = (z.ins_h << z.hash_shift ^ z.window[Ye + H - 1]) & z.hash_mask, z.prev[Ye & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = Ye, Ye++, z.insert--, !(z.lookahead + z.insert < H)); ) ; - } while (I.lookahead < H && I.strm.avail_in !== 0); + } while (z.lookahead < V && z.strm.avail_in !== 0); } - function Xe(I, we) { + function Xe(z, Ee) { 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 && we === d) - return Se; - if (I.lookahead === 0) + for (ve > z.pending_buf_size - 5 && (ve = z.pending_buf_size - 5); ; ) { + if (z.lookahead <= 1) { + if (je(z), z.lookahead === 0 && Ee === d) + return Ae; + if (z.lookahead === 0) break; } - I.strstart += I.lookahead, I.lookahead = 0; - var Y = I.block_start + ve; - if ((I.strstart === 0 || I.strstart >= Y) && (I.lookahead = I.strstart - Y, I.strstart = Y, Pe(I, !1), I.strm.avail_out === 0) || I.strstart - I.block_start >= I.w_size - H && (Pe(I, !1), I.strm.avail_out === 0)) - return Se; + z.strstart += z.lookahead, z.lookahead = 0; + var Y = z.block_start + ve; + if ((z.strstart === 0 || z.strstart >= Y) && (z.lookahead = z.strstart - Y, z.strstart = Y, Be(z, !1), z.strm.avail_out === 0) || z.strstart - z.block_start >= z.w_size - V && (Be(z, !1), z.strm.avail_out === 0)) + return Ae; } - return I.insert = 0, we === y ? (Pe(I, !0), I.strm.avail_out === 0 ? pe : le) : (I.strstart > I.block_start && (Pe(I, !1), I.strm.avail_out === 0), Se); + return z.insert = 0, Ee === y ? (Be(z, !0), z.strm.avail_out === 0 ? pe : se) : (z.strstart > z.block_start && (Be(z, !1), z.strm.avail_out === 0), Ae); } - function X(I, we) { + function X(z, Ee) { for (var ve, Y; ; ) { - if (I.lookahead < H) { - if (je(I), I.lookahead < H && we === d) - return Se; - if (I.lookahead === 0) + if (z.lookahead < V) { + if (je(z), z.lookahead < V && Ee === d) + return Ae; + if (z.lookahead === 0) break; } - if (ve = 0, I.lookahead >= V && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + V - 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 - H && (I.match_length = De(I, ve)), I.match_length >= V) - if (Y = a._tr_tally(I, I.strstart - I.match_start, I.match_length - V), I.lookahead -= I.match_length, I.match_length <= I.max_lazy_match && I.lookahead >= V) { - I.match_length--; + if (ve = 0, z.lookahead >= H && (z.ins_h = (z.ins_h << z.hash_shift ^ z.window[z.strstart + H - 1]) & z.hash_mask, ve = z.prev[z.strstart & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = z.strstart), ve !== 0 && z.strstart - ve <= z.w_size - V && (z.match_length = Ce(z, ve)), z.match_length >= H) + if (Y = a._tr_tally(z, z.strstart - z.match_start, z.match_length - H), z.lookahead -= z.match_length, z.match_length <= z.max_lazy_match && z.lookahead >= H) { + z.match_length--; do - I.strstart++, I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + V - 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++; + z.strstart++, z.ins_h = (z.ins_h << z.hash_shift ^ z.window[z.strstart + H - 1]) & z.hash_mask, ve = z.prev[z.strstart & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = z.strstart; + while (--z.match_length !== 0); + z.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; + z.strstart += z.match_length, z.match_length = 0, z.ins_h = z.window[z.strstart], z.ins_h = (z.ins_h << z.hash_shift ^ z.window[z.strstart + 1]) & z.hash_mask; else - Y = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++; - if (Y && (Pe(I, !1), I.strm.avail_out === 0)) - return Se; - } - return I.insert = I.strstart < V - 1 ? I.strstart : V - 1, we === y ? (Pe(I, !0), I.strm.avail_out === 0 ? pe : le) : I.last_lit && (Pe(I, !1), I.strm.avail_out === 0) ? Se : Ie; - } - function q(I, we) { - for (var ve, Y, de; ; ) { - if (I.lookahead < H) { - if (je(I), I.lookahead < H && we === d) - return Se; - if (I.lookahead === 0) + Y = a._tr_tally(z, 0, z.window[z.strstart]), z.lookahead--, z.strstart++; + if (Y && (Be(z, !1), z.strm.avail_out === 0)) + return Ae; + } + return z.insert = z.strstart < H - 1 ? z.strstart : H - 1, Ee === y ? (Be(z, !0), z.strm.avail_out === 0 ? pe : se) : z.last_lit && (Be(z, !1), z.strm.avail_out === 0) ? Ae : Ie; + } + function q(z, Ee) { + for (var ve, Y, fe; ; ) { + if (z.lookahead < V) { + if (je(z), z.lookahead < V && Ee === d) + return Ae; + if (z.lookahead === 0) break; } - if (ve = 0, I.lookahead >= V && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + V - 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 = V - 1, ve !== 0 && I.prev_length < I.max_lazy_match && I.strstart - ve <= I.w_size - H && (I.match_length = De(I, ve), I.match_length <= 5 && (I.strategy === g || I.match_length === V && I.strstart - I.match_start > 4096) && (I.match_length = V - 1)), I.prev_length >= V && I.match_length <= I.prev_length) { - de = I.strstart + I.lookahead - V, Y = a._tr_tally(I, I.strstart - 1 - I.prev_match, I.prev_length - V), I.lookahead -= I.prev_length - 1, I.prev_length -= 2; + if (ve = 0, z.lookahead >= H && (z.ins_h = (z.ins_h << z.hash_shift ^ z.window[z.strstart + H - 1]) & z.hash_mask, ve = z.prev[z.strstart & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = z.strstart), z.prev_length = z.match_length, z.prev_match = z.match_start, z.match_length = H - 1, ve !== 0 && z.prev_length < z.max_lazy_match && z.strstart - ve <= z.w_size - V && (z.match_length = Ce(z, ve), z.match_length <= 5 && (z.strategy === g || z.match_length === H && z.strstart - z.match_start > 4096) && (z.match_length = H - 1)), z.prev_length >= H && z.match_length <= z.prev_length) { + fe = z.strstart + z.lookahead - H, Y = a._tr_tally(z, z.strstart - 1 - z.prev_match, z.prev_length - H), z.lookahead -= z.prev_length - 1, z.prev_length -= 2; do - ++I.strstart <= de && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + V - 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 = V - 1, I.strstart++, Y && (Pe(I, !1), I.strm.avail_out === 0)) - return Se; - } else if (I.match_available) { - if (Y = a._tr_tally(I, 0, I.window[I.strstart - 1]), Y && Pe(I, !1), I.strstart++, I.lookahead--, I.strm.avail_out === 0) - return Se; + ++z.strstart <= fe && (z.ins_h = (z.ins_h << z.hash_shift ^ z.window[z.strstart + H - 1]) & z.hash_mask, ve = z.prev[z.strstart & z.w_mask] = z.head[z.ins_h], z.head[z.ins_h] = z.strstart); + while (--z.prev_length !== 0); + if (z.match_available = 0, z.match_length = H - 1, z.strstart++, Y && (Be(z, !1), z.strm.avail_out === 0)) + return Ae; + } else if (z.match_available) { + if (Y = a._tr_tally(z, 0, z.window[z.strstart - 1]), Y && Be(z, !1), z.strstart++, z.lookahead--, z.strm.avail_out === 0) + return Ae; } else - I.match_available = 1, I.strstart++, I.lookahead--; + z.match_available = 1, z.strstart++, z.lookahead--; } - return I.match_available && (Y = a._tr_tally(I, 0, I.window[I.strstart - 1]), I.match_available = 0), I.insert = I.strstart < V - 1 ? I.strstart : V - 1, we === y ? (Pe(I, !0), I.strm.avail_out === 0 ? pe : le) : I.last_lit && (Pe(I, !1), I.strm.avail_out === 0) ? Se : Ie; + return z.match_available && (Y = a._tr_tally(z, 0, z.window[z.strstart - 1]), z.match_available = 0), z.insert = z.strstart < H - 1 ? z.strstart : H - 1, Ee === y ? (Be(z, !0), z.strm.avail_out === 0 ? pe : se) : z.last_lit && (Be(z, !1), z.strm.avail_out === 0) ? Ae : Ie; } - function re(I, we) { - for (var ve, Y, de, Me, Ye = I.window; ; ) { - if (I.lookahead <= G) { - if (je(I), I.lookahead <= G && we === d) - return Se; - if (I.lookahead === 0) + function ne(z, Ee) { + for (var ve, Y, fe, De, Ye = z.window; ; ) { + if (z.lookahead <= N) { + if (je(z), z.lookahead <= N && Ee === d) + return Ae; + if (z.lookahead === 0) break; } - if (I.match_length = 0, I.lookahead >= V && I.strstart > 0 && (de = I.strstart - 1, Y = Ye[de], Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de])) { - Me = I.strstart + G; + if (z.match_length = 0, z.lookahead >= H && z.strstart > 0 && (fe = z.strstart - 1, Y = Ye[fe], Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe])) { + De = z.strstart + N; do ; - while (Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && Y === Ye[++de] && de < Me); - I.match_length = G - (Me - de), I.match_length > I.lookahead && (I.match_length = I.lookahead); + while (Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && Y === Ye[++fe] && fe < De); + z.match_length = N - (De - fe), z.match_length > z.lookahead && (z.match_length = z.lookahead); } - if (I.match_length >= V ? (ve = a._tr_tally(I, 1, I.match_length - V), I.lookahead -= I.match_length, I.strstart += I.match_length, I.match_length = 0) : (ve = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++), ve && (Pe(I, !1), I.strm.avail_out === 0)) - return Se; + if (z.match_length >= H ? (ve = a._tr_tally(z, 1, z.match_length - H), z.lookahead -= z.match_length, z.strstart += z.match_length, z.match_length = 0) : (ve = a._tr_tally(z, 0, z.window[z.strstart]), z.lookahead--, z.strstart++), ve && (Be(z, !1), z.strm.avail_out === 0)) + return Ae; } - return I.insert = 0, we === y ? (Pe(I, !0), I.strm.avail_out === 0 ? pe : le) : I.last_lit && (Pe(I, !1), I.strm.avail_out === 0) ? Se : Ie; + return z.insert = 0, Ee === y ? (Be(z, !0), z.strm.avail_out === 0 ? pe : se) : z.last_lit && (Be(z, !1), z.strm.avail_out === 0) ? Ae : Ie; } - function ye(I, we) { + function xe(z, Ee) { for (var ve; ; ) { - if (I.lookahead === 0 && (je(I), I.lookahead === 0)) { - if (we === d) - return Se; + if (z.lookahead === 0 && (je(z), z.lookahead === 0)) { + if (Ee === d) + return Ae; break; } - if (I.match_length = 0, ve = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++, ve && (Pe(I, !1), I.strm.avail_out === 0)) - return Se; + if (z.match_length = 0, ve = a._tr_tally(z, 0, z.window[z.strstart]), z.lookahead--, z.strstart++, ve && (Be(z, !1), z.strm.avail_out === 0)) + return Ae; } - return I.insert = 0, we === y ? (Pe(I, !0), I.strm.avail_out === 0 ? pe : le) : I.last_lit && (Pe(I, !1), I.strm.avail_out === 0) ? Se : Ie; + return z.insert = 0, Ee === y ? (Be(z, !0), z.strm.avail_out === 0 ? pe : se) : z.last_lit && (Be(z, !1), z.strm.avail_out === 0) ? Ae : Ie; } - function me(I, we, ve, Y, de) { - this.good_length = I, this.max_lazy = we, this.nice_length = ve, this.max_chain = Y, this.func = de; + function me(z, Ee, ve, Y, fe) { + this.good_length = z, this.max_lazy = Ee, this.nice_length = ve, this.max_chain = Y, this.func = fe; } var ze; ze = [ @@ -38689,119 +38711,119 @@ ATOM`, b); new me(32, 258, 258, 4096, q) /* 9 max compression */ ]; - function ke(I) { - I.window_size = 2 * I.w_size, Be(I.head), I.max_lazy_match = ze[I.level].max_lazy, I.good_match = ze[I.level].good_length, I.nice_match = ze[I.level].nice_length, I.max_chain_length = ze[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = V - 1, I.match_available = 0, I.ins_h = 0; + function $e(z) { + z.window_size = 2 * z.w_size, Pe(z.head), z.max_lazy_match = ze[z.level].max_lazy, z.good_match = ze[z.level].good_length, z.nice_match = ze[z.level].nice_length, z.max_chain_length = ze[z.level].max_chain, z.strstart = 0, z.block_start = 0, z.lookahead = 0, z.insert = 0, z.match_length = z.prev_length = H - 1, z.match_available = 0, z.ins_h = 0; } function K() { - 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 = k, 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 r.Buf16(B * 2), this.dyn_dtree = new r.Buf16((2 * U + 1) * 2), this.bl_tree = new r.Buf16((2 * N + 1) * 2), Be(this.dyn_ltree), Be(this.dyn_dtree), Be(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new r.Buf16(W + 1), this.heap = new r.Buf16(2 * P + 1), Be(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new r.Buf16(2 * P + 1), Be(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; + 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 = k, 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 r.Buf16(R * 2), this.dyn_dtree = new r.Buf16((2 * G + 1) * 2), this.bl_tree = new r.Buf16((2 * U + 1) * 2), Pe(this.dyn_ltree), Pe(this.dyn_dtree), Pe(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new r.Buf16(W + 1), this.heap = new r.Buf16(2 * B + 1), Pe(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new r.Buf16(2 * B + 1), Pe(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 ae(I) { - var we; - return !I || !I.state ? Te(I, m) : (I.total_in = I.total_out = 0, I.data_type = w, we = I.state, we.pending = 0, we.pending_out = 0, we.wrap < 0 && (we.wrap = -we.wrap), we.status = we.wrap ? te : he, I.adler = we.wrap === 2 ? 0 : 1, we.last_flush = d, a._tr_init(we), x); + function oe(z) { + var Ee; + return !z || !z.state ? ye(z, m) : (z.total_in = z.total_out = 0, z.data_type = w, Ee = z.state, Ee.pending = 0, Ee.pending_out = 0, Ee.wrap < 0 && (Ee.wrap = -Ee.wrap), Ee.status = Ee.wrap ? re : ce, z.adler = Ee.wrap === 2 ? 0 : 1, Ee.last_flush = d, a._tr_init(Ee), x); } - function ge(I) { - var we = ae(I); - return we === x && ke(I.state), we; + function ge(z) { + var Ee = oe(z); + return Ee === x && $e(z.state), Ee; } - function xe(I, we) { - return !I || !I.state || I.state.wrap !== 2 ? m : (I.state.gzhead = we, x); + function we(z, Ee) { + return !z || !z.state || z.state.wrap !== 2 ? m : (z.state.gzhead = Ee, x); } - function ue(I, we, ve, Y, de, Me) { - if (!I) + function de(z, Ee, ve, Y, fe, De) { + if (!z) return m; var Ye = 1; - if (we === p && (we = 6), Y < 0 ? (Ye = 0, Y = -Y) : Y > 15 && (Ye = 2, Y -= 16), de < 1 || de > $ || ve !== k || Y < 8 || Y > 15 || we < 0 || we > 9 || Me < 0 || Me > _) - return Te(I, m); + if (Ee === p && (Ee = 6), Y < 0 ? (Ye = 0, Y = -Y) : Y > 15 && (Ye = 2, Y -= 16), fe < 1 || fe > $ || ve !== k || Y < 8 || Y > 15 || Ee < 0 || Ee > 9 || De < 0 || De > v) + return ye(z, m); Y === 8 && (Y = 9); var Ze = new K(); - return I.state = Ze, Ze.strm = I, Ze.wrap = Ye, Ze.gzhead = null, Ze.w_bits = Y, Ze.w_size = 1 << Ze.w_bits, Ze.w_mask = Ze.w_size - 1, Ze.hash_bits = de + 7, Ze.hash_size = 1 << Ze.hash_bits, Ze.hash_mask = Ze.hash_size - 1, Ze.hash_shift = ~~((Ze.hash_bits + V - 1) / V), Ze.window = new r.Buf8(Ze.w_size * 2), Ze.head = new r.Buf16(Ze.hash_size), Ze.prev = new r.Buf16(Ze.w_size), Ze.lit_bufsize = 1 << de + 6, Ze.pending_buf_size = Ze.lit_bufsize * 4, Ze.pending_buf = new r.Buf8(Ze.pending_buf_size), Ze.d_buf = 1 * Ze.lit_bufsize, Ze.l_buf = 3 * Ze.lit_bufsize, Ze.level = we, Ze.strategy = Me, Ze.method = ve, ge(I); - } - function Ce(I, we) { - return ue(I, we, k, L, z, E); - } - function Z(I, we) { - var ve, Y, de, Me; - if (!I || !I.state || we > A || we < 0) - return I ? Te(I, m) : m; - if (Y = I.state, !I.output || !I.input && I.avail_in !== 0 || Y.status === Ae && we !== y) - return Te(I, I.avail_out === 0 ? u : m); - if (Y.strm = I, ve = Y.last_flush, Y.last_flush = we, Y.status === te) + return z.state = Ze, Ze.strm = z, Ze.wrap = Ye, Ze.gzhead = null, Ze.w_bits = Y, Ze.w_size = 1 << Ze.w_bits, Ze.w_mask = Ze.w_size - 1, Ze.hash_bits = fe + 7, Ze.hash_size = 1 << Ze.hash_bits, Ze.hash_mask = Ze.hash_size - 1, Ze.hash_shift = ~~((Ze.hash_bits + H - 1) / H), Ze.window = new r.Buf8(Ze.w_size * 2), Ze.head = new r.Buf16(Ze.hash_size), Ze.prev = new r.Buf16(Ze.w_size), Ze.lit_bufsize = 1 << fe + 6, Ze.pending_buf_size = Ze.lit_bufsize * 4, Ze.pending_buf = new r.Buf8(Ze.pending_buf_size), Ze.d_buf = 1 * Ze.lit_bufsize, Ze.l_buf = 3 * Ze.lit_bufsize, Ze.level = Ee, Ze.strategy = De, Ze.method = ve, ge(z); + } + function Te(z, Ee) { + return de(z, Ee, k, L, I, E); + } + function Z(z, Ee) { + var ve, Y, fe, De; + if (!z || !z.state || Ee > A || Ee < 0) + return z ? ye(z, m) : m; + if (Y = z.state, !z.output || !z.input && z.avail_in !== 0 || Y.status === Me && Ee !== y) + return ye(z, z.avail_out === 0 ? u : m); + if (Y.strm = z, ve = Y.last_flush, Y.last_flush = Ee, Y.status === re) if (Y.wrap === 2) - I.adler = 0, Ge(Y, 31), Ge(Y, 139), Ge(Y, 8), Y.gzhead ? (Ge( + z.adler = 0, Ge(Y, 31), Ge(Y, 139), Ge(Y, 8), Y.gzhead ? (Ge( 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) - ), Ge(Y, Y.gzhead.time & 255), Ge(Y, Y.gzhead.time >> 8 & 255), Ge(Y, Y.gzhead.time >> 16 & 255), Ge(Y, Y.gzhead.time >> 24 & 255), Ge(Y, Y.level === 9 ? 2 : Y.strategy >= b || Y.level < 2 ? 4 : 0), Ge(Y, Y.gzhead.os & 255), Y.gzhead.extra && Y.gzhead.extra.length && (Ge(Y, Y.gzhead.extra.length & 255), Ge(Y, Y.gzhead.extra.length >> 8 & 255)), Y.gzhead.hcrc && (I.adler = h(I.adler, Y.pending_buf, Y.pending, 0)), Y.gzindex = 0, Y.status = ee) : (Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, Y.level === 9 ? 2 : Y.strategy >= b || Y.level < 2 ? 4 : 0), Ge(Y, ne), Y.status = he); + ), Ge(Y, Y.gzhead.time & 255), Ge(Y, Y.gzhead.time >> 8 & 255), Ge(Y, Y.gzhead.time >> 16 & 255), Ge(Y, Y.gzhead.time >> 24 & 255), Ge(Y, Y.level === 9 ? 2 : Y.strategy >= b || Y.level < 2 ? 4 : 0), Ge(Y, Y.gzhead.os & 255), Y.gzhead.extra && Y.gzhead.extra.length && (Ge(Y, Y.gzhead.extra.length & 255), Ge(Y, Y.gzhead.extra.length >> 8 & 255)), Y.gzhead.hcrc && (z.adler = h(z.adler, Y.pending_buf, Y.pending, 0)), Y.gzindex = 0, Y.status = te) : (Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, 0), Ge(Y, Y.level === 9 ? 2 : Y.strategy >= b || Y.level < 2 ? 4 : 0), Ge(Y, Q), Y.status = ce); else { var Ye = k + (Y.w_bits - 8 << 4) << 8, Ze = -1; - Y.strategy >= b || Y.level < 2 ? Ze = 0 : Y.level < 6 ? Ze = 1 : Y.level === 6 ? Ze = 2 : Ze = 3, Ye |= Ze << 6, Y.strstart !== 0 && (Ye |= Q), Ye += 31 - Ye % 31, Y.status = he, Ne(Y, Ye), Y.strstart !== 0 && (Ne(Y, I.adler >>> 16), Ne(Y, I.adler & 65535)), I.adler = 1; + Y.strategy >= b || Y.level < 2 ? Ze = 0 : Y.level < 6 ? Ze = 1 : Y.level === 6 ? Ze = 2 : Ze = 3, Ye |= Ze << 6, Y.strstart !== 0 && (Ye |= J), Ye += 31 - Ye % 31, Y.status = ce, Ue(Y, Ye), Y.strstart !== 0 && (Ue(Y, z.adler >>> 16), Ue(Y, z.adler & 65535)), z.adler = 1; } - if (Y.status === ee) + if (Y.status === te) if (Y.gzhead.extra) { - for (de = Y.pending; Y.gzindex < (Y.gzhead.extra.length & 65535) && !(Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Ue(I), de = Y.pending, Y.pending === Y.pending_buf_size)); ) + for (fe = Y.pending; Y.gzindex < (Y.gzhead.extra.length & 65535) && !(Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), Ne(z), fe = Y.pending, Y.pending === Y.pending_buf_size)); ) Ge(Y, Y.gzhead.extra[Y.gzindex] & 255), Y.gzindex++; - Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Y.gzindex === Y.gzhead.extra.length && (Y.gzindex = 0, Y.status = ce); + Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), Y.gzindex === Y.gzhead.extra.length && (Y.gzindex = 0, Y.status = ue); } else - Y.status = ce; - if (Y.status === ce) + Y.status = ue; + if (Y.status === ue) if (Y.gzhead.name) { - de = Y.pending; + fe = Y.pending; do { - if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Ue(I), de = Y.pending, Y.pending === Y.pending_buf_size)) { - Me = 1; + if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), Ne(z), fe = Y.pending, Y.pending === Y.pending_buf_size)) { + De = 1; break; } - Y.gzindex < Y.gzhead.name.length ? Me = Y.gzhead.name.charCodeAt(Y.gzindex++) & 255 : Me = 0, Ge(Y, Me); - } while (Me !== 0); - Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Me === 0 && (Y.gzindex = 0, Y.status = fe); + Y.gzindex < Y.gzhead.name.length ? De = Y.gzhead.name.charCodeAt(Y.gzindex++) & 255 : De = 0, Ge(Y, De); + } while (De !== 0); + Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), De === 0 && (Y.gzindex = 0, Y.status = ie); } else - Y.status = fe; - if (Y.status === fe) + Y.status = ie; + if (Y.status === ie) if (Y.gzhead.comment) { - de = Y.pending; + fe = Y.pending; do { - if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Ue(I), de = Y.pending, Y.pending === Y.pending_buf_size)) { - Me = 1; + if (Y.pending === Y.pending_buf_size && (Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), Ne(z), fe = Y.pending, Y.pending === Y.pending_buf_size)) { + De = 1; break; } - Y.gzindex < Y.gzhead.comment.length ? Me = Y.gzhead.comment.charCodeAt(Y.gzindex++) & 255 : Me = 0, Ge(Y, Me); - } while (Me !== 0); - Y.gzhead.hcrc && Y.pending > de && (I.adler = h(I.adler, Y.pending_buf, Y.pending - de, de)), Me === 0 && (Y.status = oe); + Y.gzindex < Y.gzhead.comment.length ? De = Y.gzhead.comment.charCodeAt(Y.gzindex++) & 255 : De = 0, Ge(Y, De); + } while (De !== 0); + Y.gzhead.hcrc && Y.pending > fe && (z.adler = h(z.adler, Y.pending_buf, Y.pending - fe, fe)), De === 0 && (Y.status = ae); } else - Y.status = oe; - if (Y.status === oe && (Y.gzhead.hcrc ? (Y.pending + 2 > Y.pending_buf_size && Ue(I), Y.pending + 2 <= Y.pending_buf_size && (Ge(Y, I.adler & 255), Ge(Y, I.adler >> 8 & 255), I.adler = 0, Y.status = he)) : Y.status = he), Y.pending !== 0) { - if (Ue(I), I.avail_out === 0) + Y.status = ae; + if (Y.status === ae && (Y.gzhead.hcrc ? (Y.pending + 2 > Y.pending_buf_size && Ne(z), Y.pending + 2 <= Y.pending_buf_size && (Ge(Y, z.adler & 255), Ge(Y, z.adler >> 8 & 255), z.adler = 0, Y.status = ce)) : Y.status = ce), Y.pending !== 0) { + if (Ne(z), z.avail_out === 0) return Y.last_flush = -1, x; - } else if (I.avail_in === 0 && Oe(we) <= Oe(ve) && we !== y) - return Te(I, u); - if (Y.status === Ae && I.avail_in !== 0) - return Te(I, u); - if (I.avail_in !== 0 || Y.lookahead !== 0 || we !== d && Y.status !== Ae) { - var Ke = Y.strategy === b ? ye(Y, we) : Y.strategy === c ? re(Y, we) : ze[Y.level].func(Y, we); - if ((Ke === pe || Ke === le) && (Y.status = Ae), Ke === Se || Ke === pe) - return I.avail_out === 0 && (Y.last_flush = -1), x; - if (Ke === Ie && (we === v ? a._tr_align(Y) : we !== A && (a._tr_stored_block(Y, 0, 0, !1), we === f && (Be(Y.head), Y.lookahead === 0 && (Y.strstart = 0, Y.block_start = 0, Y.insert = 0))), Ue(I), I.avail_out === 0)) + } else if (z.avail_in === 0 && ke(Ee) <= ke(ve) && Ee !== y) + return ye(z, u); + if (Y.status === Me && z.avail_in !== 0) + return ye(z, u); + if (z.avail_in !== 0 || Y.lookahead !== 0 || Ee !== d && Y.status !== Me) { + var Ke = Y.strategy === b ? xe(Y, Ee) : Y.strategy === c ? ne(Y, Ee) : ze[Y.level].func(Y, Ee); + if ((Ke === pe || Ke === se) && (Y.status = Me), Ke === Ae || Ke === pe) + return z.avail_out === 0 && (Y.last_flush = -1), x; + if (Ke === Ie && (Ee === _ ? a._tr_align(Y) : Ee !== A && (a._tr_stored_block(Y, 0, 0, !1), Ee === f && (Pe(Y.head), Y.lookahead === 0 && (Y.strstart = 0, Y.block_start = 0, Y.insert = 0))), Ne(z), z.avail_out === 0)) return Y.last_flush = -1, x; } - return we !== y ? x : Y.wrap <= 0 ? M : (Y.wrap === 2 ? (Ge(Y, I.adler & 255), Ge(Y, I.adler >> 8 & 255), Ge(Y, I.adler >> 16 & 255), Ge(Y, I.adler >> 24 & 255), Ge(Y, I.total_in & 255), Ge(Y, I.total_in >> 8 & 255), Ge(Y, I.total_in >> 16 & 255), Ge(Y, I.total_in >> 24 & 255)) : (Ne(Y, I.adler >>> 16), Ne(Y, I.adler & 65535)), Ue(I), Y.wrap > 0 && (Y.wrap = -Y.wrap), Y.pending !== 0 ? x : M); + return Ee !== y ? x : Y.wrap <= 0 ? M : (Y.wrap === 2 ? (Ge(Y, z.adler & 255), Ge(Y, z.adler >> 8 & 255), Ge(Y, z.adler >> 16 & 255), Ge(Y, z.adler >> 24 & 255), Ge(Y, z.total_in & 255), Ge(Y, z.total_in >> 8 & 255), Ge(Y, z.total_in >> 16 & 255), Ge(Y, z.total_in >> 24 & 255)) : (Ue(Y, z.adler >>> 16), Ue(Y, z.adler & 65535)), Ne(z), Y.wrap > 0 && (Y.wrap = -Y.wrap), Y.pending !== 0 ? x : M); } - function Fe(I) { - var we; - return !I || !I.state ? m : (we = I.state.status, we !== te && we !== ee && we !== ce && we !== fe && we !== oe && we !== he && we !== Ae ? Te(I, m) : (I.state = null, we === he ? Te(I, l) : x)); + function Fe(z) { + var Ee; + return !z || !z.state ? m : (Ee = z.state.status, Ee !== re && Ee !== te && Ee !== ue && Ee !== ie && Ee !== ae && Ee !== ce && Ee !== Me ? ye(z, m) : (z.state = null, Ee === ce ? ye(z, l) : x)); } - function We(I, we) { - var ve = we.length, Y, de, Me, Ye, Ze, Ke, rt, wt; - if (!I || !I.state || (Y = I.state, Ye = Y.wrap, Ye === 2 || Ye === 1 && Y.status !== te || Y.lookahead)) + function We(z, Ee) { + var ve = Ee.length, Y, fe, De, Ye, Ze, Ke, rt, wt; + if (!z || !z.state || (Y = z.state, Ye = Y.wrap, Ye === 2 || Ye === 1 && Y.status !== re || Y.lookahead)) return m; - for (Ye === 1 && (I.adler = s(I.adler, we, ve, 0)), Y.wrap = 0, ve >= Y.w_size && (Ye === 0 && (Be(Y.head), Y.strstart = 0, Y.block_start = 0, Y.insert = 0), wt = new r.Buf8(Y.w_size), r.arraySet(wt, we, ve - Y.w_size, Y.w_size, 0), we = wt, ve = Y.w_size), Ze = I.avail_in, Ke = I.next_in, rt = I.input, I.avail_in = ve, I.next_in = 0, I.input = we, je(Y); Y.lookahead >= V; ) { - de = Y.strstart, Me = Y.lookahead - (V - 1); + for (Ye === 1 && (z.adler = s(z.adler, Ee, ve, 0)), Y.wrap = 0, ve >= Y.w_size && (Ye === 0 && (Pe(Y.head), Y.strstart = 0, Y.block_start = 0, Y.insert = 0), wt = new r.Buf8(Y.w_size), r.arraySet(wt, Ee, ve - Y.w_size, Y.w_size, 0), Ee = wt, ve = Y.w_size), Ze = z.avail_in, Ke = z.next_in, rt = z.input, z.avail_in = ve, z.next_in = 0, z.input = Ee, je(Y); Y.lookahead >= H; ) { + fe = Y.strstart, De = Y.lookahead - (H - 1); do - Y.ins_h = (Y.ins_h << Y.hash_shift ^ Y.window[de + V - 1]) & Y.hash_mask, Y.prev[de & Y.w_mask] = Y.head[Y.ins_h], Y.head[Y.ins_h] = de, de++; - while (--Me); - Y.strstart = de, Y.lookahead = V - 1, je(Y); + Y.ins_h = (Y.ins_h << Y.hash_shift ^ Y.window[fe + H - 1]) & Y.hash_mask, Y.prev[fe & Y.w_mask] = Y.head[Y.ins_h], Y.head[Y.ins_h] = fe, fe++; + while (--De); + Y.strstart = fe, Y.lookahead = H - 1, je(Y); } - return Y.strstart += Y.lookahead, Y.block_start = Y.strstart, Y.insert = Y.lookahead, Y.lookahead = 0, Y.match_length = Y.prev_length = V - 1, Y.match_available = 0, I.next_in = Ke, I.input = rt, I.avail_in = Ze, Y.wrap = Ye, x; + return Y.strstart += Y.lookahead, Y.block_start = Y.strstart, Y.insert = Y.lookahead, Y.lookahead = 0, Y.match_length = Y.prev_length = H - 1, Y.match_available = 0, z.next_in = Ke, z.input = rt, z.avail_in = Ze, Y.wrap = Ye, x; } - e.deflateInit = Ce, e.deflateInit2 = ue, e.deflateReset = ge, e.deflateResetKeep = ae, e.deflateSetHeader = xe, e.deflate = Z, e.deflateEnd = Fe, e.deflateSetDictionary = We, e.deflateInfo = "pako deflate (from Nodeca project)"; + e.deflateInit = Te, e.deflateInit2 = de, e.deflateReset = ge, e.deflateResetKeep = oe, e.deflateSetHeader = we, e.deflate = Z, e.deflateEnd = Fe, e.deflateSetDictionary = We, e.deflateInfo = "pako deflate (from Nodeca project)"; } ), /***/ @@ -38826,17 +38848,17 @@ ATOM`, b); (n) => { var e = 30, t = 12; n.exports = function(a, s) { - var h, o, d, v, f, y, A, x, M, m, l, u, p, g, b, c, _, E, w, k, $, L, z, F, R; - h = a.state, o = a.next_in, F = a.input, d = o + (a.avail_in - 5), v = a.next_out, R = a.output, f = v - (s - a.avail_out), y = v + (a.avail_out - 257), A = h.dmax, x = h.wsize, M = h.whave, m = h.wnext, l = h.window, u = h.hold, p = h.bits, g = h.lencode, b = h.distcode, c = (1 << h.lenbits) - 1, _ = (1 << h.distbits) - 1; + var h, o, d, _, f, y, A, x, M, m, l, u, p, g, b, c, v, E, w, k, $, L, I, F, P; + h = a.state, o = a.next_in, F = a.input, d = o + (a.avail_in - 5), _ = a.next_out, P = a.output, f = _ - (s - a.avail_out), y = _ + (a.avail_out - 257), A = h.dmax, x = h.wsize, M = h.whave, m = h.wnext, l = h.window, u = h.hold, p = h.bits, g = h.lencode, b = h.distcode, c = (1 << h.lenbits) - 1, v = (1 << h.distbits) - 1; e: do { p < 15 && (u += F[o++] << p, p += 8, u += F[o++] << p, p += 8), E = g[u & c]; t: for (; ; ) { if (w = E >>> 24, u >>>= w, p -= w, w = E >>> 16 & 255, w === 0) - R[v++] = E & 65535; + P[_++] = E & 65535; else if (w & 16) { - k = E & 65535, w &= 15, w && (p < w && (u += F[o++] << p, p += 8), k += u & (1 << w) - 1, u >>>= w, p -= w), p < 15 && (u += F[o++] << p, p += 8, u += F[o++] << p, p += 8), E = b[u & _]; + k = E & 65535, w &= 15, w && (p < w && (u += F[o++] << p, p += 8), k += u & (1 << w) - 1, u >>>= w, p -= w), p < 15 && (u += F[o++] << p, p += 8, u += F[o++] << p, p += 8), E = b[u & v]; r: for (; ; ) { if (w = E >>> 24, u >>>= w, p -= w, w = E >>> 16 & 255, w & 16) { @@ -38844,49 +38866,49 @@ ATOM`, b); a.msg = "invalid distance too far back", h.mode = e; break e; } - if (u >>>= w, p -= w, w = v - f, $ > w) { + if (u >>>= w, p -= w, w = _ - f, $ > w) { if (w = $ - w, w > M && h.sane) { a.msg = "invalid distance too far back", h.mode = e; break e; } - if (L = 0, z = l, m === 0) { + if (L = 0, I = l, m === 0) { if (L += x - w, w < k) { k -= w; do - R[v++] = l[L++]; + P[_++] = l[L++]; while (--w); - L = v - $, z = R; + L = _ - $, I = P; } } else if (m < w) { if (L += x + m - w, w -= m, w < k) { k -= w; do - R[v++] = l[L++]; + P[_++] = l[L++]; while (--w); if (L = 0, m < k) { w = m, k -= w; do - R[v++] = l[L++]; + P[_++] = l[L++]; while (--w); - L = v - $, z = R; + L = _ - $, I = P; } } } else if (L += m - w, w < k) { k -= w; do - R[v++] = l[L++]; + P[_++] = l[L++]; while (--w); - L = v - $, z = R; + L = _ - $, I = P; } for (; k > 2; ) - R[v++] = z[L++], R[v++] = z[L++], R[v++] = z[L++], k -= 3; - k && (R[v++] = z[L++], k > 1 && (R[v++] = z[L++])); + P[_++] = I[L++], P[_++] = I[L++], P[_++] = I[L++], k -= 3; + k && (P[_++] = I[L++], k > 1 && (P[_++] = I[L++])); } else { - L = v - $; + L = _ - $; do - R[v++] = R[L++], R[v++] = R[L++], R[v++] = R[L++], k -= 3; + P[_++] = P[L++], P[_++] = P[L++], P[_++] = P[L++], k -= 3; while (k > 2); - k && (R[v++] = R[L++], k > 1 && (R[v++] = R[L++])); + k && (P[_++] = P[L++], k > 1 && (P[_++] = P[L++])); } } else if (w & 64) { a.msg = "invalid distance code", h.mode = e; @@ -38911,8 +38933,8 @@ ATOM`, b); } break; } - } while (o < d && v < y); - k = p >> 3, o -= k, p -= k << 3, u &= (1 << p) - 1, a.next_in = o, a.next_out = v, a.avail_in = o < d ? 5 + (d - o) : 5 - (o - d), a.avail_out = v < y ? 257 + (y - v) : 257 - (v - y), h.hold = u, h.bits = p; + } while (o < d && _ < y); + k = p >> 3, o -= k, p -= k << 3, u &= (1 << p) - 1, a.next_in = o, a.next_out = _, a.avail_in = o < d ? 5 + (d - o) : 5 - (o - d), a.avail_out = _ < y ? 257 + (y - _) : 257 - (_ - y), h.hold = u, h.bits = p; }; } ), @@ -38938,157 +38960,157 @@ ATOM`, b); ), o = t( /*! ./inftrees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js" - ), d = 0, v = 1, f = 2, y = 4, A = 5, x = 6, M = 0, m = 1, l = 2, u = -2, p = -3, g = -4, b = -5, c = 8, _ = 1, E = 2, w = 3, k = 4, $ = 5, L = 6, z = 7, F = 8, R = 9, P = 10, U = 11, N = 12, B = 13, W = 14, V = 15, G = 16, H = 17, Q = 18, te = 19, ee = 20, ce = 21, fe = 22, oe = 23, he = 24, Ae = 25, Se = 26, Ie = 27, pe = 28, le = 29, ne = 30, Te = 31, Oe = 32, Be = 852, Ue = 592, Pe = 15, Ge = Pe; - function Ne(ue) { - return (ue >>> 24 & 255) + (ue >>> 8 & 65280) + ((ue & 65280) << 8) + ((ue & 255) << 24); + ), d = 0, _ = 1, f = 2, y = 4, A = 5, x = 6, M = 0, m = 1, l = 2, u = -2, p = -3, g = -4, b = -5, c = 8, v = 1, E = 2, w = 3, k = 4, $ = 5, L = 6, I = 7, F = 8, P = 9, B = 10, G = 11, U = 12, R = 13, W = 14, H = 15, N = 16, V = 17, J = 18, re = 19, te = 20, ue = 21, ie = 22, ae = 23, ce = 24, Me = 25, Ae = 26, Ie = 27, pe = 28, se = 29, Q = 30, ye = 31, ke = 32, Pe = 852, Ne = 592, Be = 15, Ge = Be; + function Ue(de) { + return (de >>> 24 & 255) + (de >>> 8 & 65280) + ((de & 65280) << 8) + ((de & 255) << 24); } function Re() { 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 r.Buf16(320), this.work = new r.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } - function De(ue) { - var Ce; - return !ue || !ue.state ? u : (Ce = ue.state, ue.total_in = ue.total_out = Ce.total = 0, ue.msg = "", Ce.wrap && (ue.adler = Ce.wrap & 1), Ce.mode = _, Ce.last = 0, Ce.havedict = 0, Ce.dmax = 32768, Ce.head = null, Ce.hold = 0, Ce.bits = 0, Ce.lencode = Ce.lendyn = new r.Buf32(Be), Ce.distcode = Ce.distdyn = new r.Buf32(Ue), Ce.sane = 1, Ce.back = -1, M); + function Ce(de) { + var Te; + return !de || !de.state ? u : (Te = de.state, de.total_in = de.total_out = Te.total = 0, de.msg = "", Te.wrap && (de.adler = Te.wrap & 1), Te.mode = v, Te.last = 0, Te.havedict = 0, Te.dmax = 32768, Te.head = null, Te.hold = 0, Te.bits = 0, Te.lencode = Te.lendyn = new r.Buf32(Pe), Te.distcode = Te.distdyn = new r.Buf32(Ne), Te.sane = 1, Te.back = -1, M); } - function je(ue) { - var Ce; - return !ue || !ue.state ? u : (Ce = ue.state, Ce.wsize = 0, Ce.whave = 0, Ce.wnext = 0, De(ue)); + function je(de) { + var Te; + return !de || !de.state ? u : (Te = de.state, Te.wsize = 0, Te.whave = 0, Te.wnext = 0, Ce(de)); } - function Xe(ue, Ce) { + function Xe(de, Te) { var Z, Fe; - return !ue || !ue.state || (Fe = ue.state, Ce < 0 ? (Z = 0, Ce = -Ce) : (Z = (Ce >> 4) + 1, Ce < 48 && (Ce &= 15)), Ce && (Ce < 8 || Ce > 15)) ? u : (Fe.window !== null && Fe.wbits !== Ce && (Fe.window = null), Fe.wrap = Z, Fe.wbits = Ce, je(ue)); + return !de || !de.state || (Fe = de.state, Te < 0 ? (Z = 0, Te = -Te) : (Z = (Te >> 4) + 1, Te < 48 && (Te &= 15)), Te && (Te < 8 || Te > 15)) ? u : (Fe.window !== null && Fe.wbits !== Te && (Fe.window = null), Fe.wrap = Z, Fe.wbits = Te, je(de)); } - function X(ue, Ce) { + function X(de, Te) { var Z, Fe; - return ue ? (Fe = new Re(), ue.state = Fe, Fe.window = null, Z = Xe(ue, Ce), Z !== M && (ue.state = null), Z) : u; - } - function q(ue) { - return X(ue, Ge); - } - var re = !0, ye, me; - function ze(ue) { - if (re) { - var Ce; - for (ye = new r.Buf32(512), me = new r.Buf32(32), Ce = 0; Ce < 144; ) - ue.lens[Ce++] = 8; - for (; Ce < 256; ) - ue.lens[Ce++] = 9; - for (; Ce < 280; ) - ue.lens[Ce++] = 7; - for (; Ce < 288; ) - ue.lens[Ce++] = 8; - for (o(v, ue.lens, 0, 288, ye, 0, ue.work, { bits: 9 }), Ce = 0; Ce < 32; ) - ue.lens[Ce++] = 5; - o(f, ue.lens, 0, 32, me, 0, ue.work, { bits: 5 }), re = !1; - } - ue.lencode = ye, ue.lenbits = 9, ue.distcode = me, ue.distbits = 5; - } - function ke(ue, Ce, Z, Fe) { - var We, I = ue.state; - return I.window === null && (I.wsize = 1 << I.wbits, I.wnext = 0, I.whave = 0, I.window = new r.Buf8(I.wsize)), Fe >= I.wsize ? (r.arraySet(I.window, Ce, Z - I.wsize, I.wsize, 0), I.wnext = 0, I.whave = I.wsize) : (We = I.wsize - I.wnext, We > Fe && (We = Fe), r.arraySet(I.window, Ce, Z - Fe, We, I.wnext), Fe -= We, Fe ? (r.arraySet(I.window, Ce, Z - Fe, Fe, 0), I.wnext = Fe, I.whave = I.wsize) : (I.wnext += We, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += We))), 0; - } - function K(ue, Ce) { - var Z, Fe, We, I, we, ve, Y, de, Me, Ye, Ze, Ke, rt, wt, st = 0, ot, at, Mt, gt, $t, Pt, Et, St, yt = new r.Buf8(4), zt, qe, be = ( + return de ? (Fe = new Re(), de.state = Fe, Fe.window = null, Z = Xe(de, Te), Z !== M && (de.state = null), Z) : u; + } + function q(de) { + return X(de, Ge); + } + var ne = !0, xe, me; + function ze(de) { + if (ne) { + var Te; + for (xe = new r.Buf32(512), me = new r.Buf32(32), Te = 0; Te < 144; ) + de.lens[Te++] = 8; + for (; Te < 256; ) + de.lens[Te++] = 9; + for (; Te < 280; ) + de.lens[Te++] = 7; + for (; Te < 288; ) + de.lens[Te++] = 8; + for (o(_, de.lens, 0, 288, xe, 0, de.work, { bits: 9 }), Te = 0; Te < 32; ) + de.lens[Te++] = 5; + o(f, de.lens, 0, 32, me, 0, de.work, { bits: 5 }), ne = !1; + } + de.lencode = xe, de.lenbits = 9, de.distcode = me, de.distbits = 5; + } + function $e(de, Te, Z, Fe) { + var We, z = de.state; + return z.window === null && (z.wsize = 1 << z.wbits, z.wnext = 0, z.whave = 0, z.window = new r.Buf8(z.wsize)), Fe >= z.wsize ? (r.arraySet(z.window, Te, Z - z.wsize, z.wsize, 0), z.wnext = 0, z.whave = z.wsize) : (We = z.wsize - z.wnext, We > Fe && (We = Fe), r.arraySet(z.window, Te, Z - Fe, We, z.wnext), Fe -= We, Fe ? (r.arraySet(z.window, Te, Z - Fe, Fe, 0), z.wnext = Fe, z.whave = z.wsize) : (z.wnext += We, z.wnext === z.wsize && (z.wnext = 0), z.whave < z.wsize && (z.whave += We))), 0; + } + function K(de, Te) { + var Z, Fe, We, z, Ee, ve, Y, fe, De, Ye, Ze, Ke, rt, wt, st = 0, ot, at, Mt, gt, Lt, Bt, Et, St, yt = new r.Buf8(4), It, qe, be = ( /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] ); - if (!ue || !ue.state || !ue.output || !ue.input && ue.avail_in !== 0) + if (!de || !de.state || !de.output || !de.input && de.avail_in !== 0) return u; - Z = ue.state, Z.mode === N && (Z.mode = B), we = ue.next_out, We = ue.output, Y = ue.avail_out, I = ue.next_in, Fe = ue.input, ve = ue.avail_in, de = Z.hold, Me = Z.bits, Ye = ve, Ze = Y, St = M; + Z = de.state, Z.mode === U && (Z.mode = R), Ee = de.next_out, We = de.output, Y = de.avail_out, z = de.next_in, Fe = de.input, ve = de.avail_in, fe = Z.hold, De = Z.bits, Ye = ve, Ze = Y, St = M; e: for (; ; ) switch (Z.mode) { - case _: + case v: if (Z.wrap === 0) { - Z.mode = B; + Z.mode = R; break; } - for (; Me < 16; ) { + for (; De < 16; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (Z.wrap & 2 && de === 35615) { - Z.check = 0, yt[0] = de & 255, yt[1] = de >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0), de = 0, Me = 0, Z.mode = E; + if (Z.wrap & 2 && fe === 35615) { + Z.check = 0, yt[0] = fe & 255, yt[1] = fe >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0), fe = 0, De = 0, Z.mode = E; break; } if (Z.flags = 0, Z.head && (Z.head.done = !1), !(Z.wrap & 1) || /* check if zlib header allowed */ - (((de & 255) << 8) + (de >> 8)) % 31) { - ue.msg = "incorrect header check", Z.mode = ne; + (((fe & 255) << 8) + (fe >> 8)) % 31) { + de.msg = "incorrect header check", Z.mode = Q; break; } - if ((de & 15) !== c) { - ue.msg = "unknown compression method", Z.mode = ne; + if ((fe & 15) !== c) { + de.msg = "unknown compression method", Z.mode = Q; break; } - if (de >>>= 4, Me -= 4, Et = (de & 15) + 8, Z.wbits === 0) + if (fe >>>= 4, De -= 4, Et = (fe & 15) + 8, Z.wbits === 0) Z.wbits = Et; else if (Et > Z.wbits) { - ue.msg = "invalid window size", Z.mode = ne; + de.msg = "invalid window size", Z.mode = Q; break; } - Z.dmax = 1 << Et, ue.adler = Z.check = 1, Z.mode = de & 512 ? P : N, de = 0, Me = 0; + Z.dmax = 1 << Et, de.adler = Z.check = 1, Z.mode = fe & 512 ? B : U, fe = 0, De = 0; break; case E: - for (; Me < 16; ) { + for (; De < 16; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (Z.flags = de, (Z.flags & 255) !== c) { - ue.msg = "unknown compression method", Z.mode = ne; + if (Z.flags = fe, (Z.flags & 255) !== c) { + de.msg = "unknown compression method", Z.mode = Q; break; } if (Z.flags & 57344) { - ue.msg = "unknown header flags set", Z.mode = ne; + de.msg = "unknown header flags set", Z.mode = Q; break; } - Z.head && (Z.head.text = de >> 8 & 1), Z.flags & 512 && (yt[0] = de & 255, yt[1] = de >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), de = 0, Me = 0, Z.mode = w; + Z.head && (Z.head.text = fe >> 8 & 1), Z.flags & 512 && (yt[0] = fe & 255, yt[1] = fe >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), fe = 0, De = 0, Z.mode = w; case w: - for (; Me < 32; ) { + for (; De < 32; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.head && (Z.head.time = de), Z.flags & 512 && (yt[0] = de & 255, yt[1] = de >>> 8 & 255, yt[2] = de >>> 16 & 255, yt[3] = de >>> 24 & 255, Z.check = s(Z.check, yt, 4, 0)), de = 0, Me = 0, Z.mode = k; + Z.head && (Z.head.time = fe), Z.flags & 512 && (yt[0] = fe & 255, yt[1] = fe >>> 8 & 255, yt[2] = fe >>> 16 & 255, yt[3] = fe >>> 24 & 255, Z.check = s(Z.check, yt, 4, 0)), fe = 0, De = 0, Z.mode = k; case k: - for (; Me < 16; ) { + for (; De < 16; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.head && (Z.head.xflags = de & 255, Z.head.os = de >> 8), Z.flags & 512 && (yt[0] = de & 255, yt[1] = de >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), de = 0, Me = 0, Z.mode = $; + Z.head && (Z.head.xflags = fe & 255, Z.head.os = fe >> 8), Z.flags & 512 && (yt[0] = fe & 255, yt[1] = fe >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), fe = 0, De = 0, Z.mode = $; case $: if (Z.flags & 1024) { - for (; Me < 16; ) { + for (; De < 16; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.length = de, Z.head && (Z.head.extra_len = de), Z.flags & 512 && (yt[0] = de & 255, yt[1] = de >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), de = 0, Me = 0; + Z.length = fe, Z.head && (Z.head.extra_len = fe), Z.flags & 512 && (yt[0] = fe & 255, yt[1] = fe >>> 8 & 255, Z.check = s(Z.check, yt, 2, 0)), fe = 0, De = 0; } else Z.head && (Z.head.extra = null); Z.mode = L; case L: if (Z.flags & 1024 && (Ke = Z.length, Ke > ve && (Ke = ve), Ke && (Z.head && (Et = Z.head.extra_len - Z.length, Z.head.extra || (Z.head.extra = new Array(Z.head.extra_len)), r.arraySet( Z.head.extra, Fe, - I, + z, // extra field is limited to 65536 bytes // - no need for additional size check Ke, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ Et - )), Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Z.length -= Ke), Z.length)) + )), Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, z)), ve -= Ke, z += Ke, Z.length -= Ke), Z.length)) break e; - Z.length = 0, Z.mode = z; - case z: + Z.length = 0, Z.mode = I; + case I: if (Z.flags & 2048) { if (ve === 0) break e; Ke = 0; do - Et = Fe[I + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.name += String.fromCharCode(Et)); + Et = Fe[z + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.name += String.fromCharCode(Et)); while (Et && Ke < ve); - if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Et) + if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, z)), ve -= Ke, z += Ke, Et) break e; } else Z.head && (Z.head.name = null); Z.length = 0, Z.mode = F; @@ -39098,336 +39120,336 @@ ATOM`, b); break e; Ke = 0; do - Et = Fe[I + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.comment += String.fromCharCode(Et)); + Et = Fe[z + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.comment += String.fromCharCode(Et)); while (Et && Ke < ve); - if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Et) + if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, z)), ve -= Ke, z += Ke, Et) break e; } else Z.head && (Z.head.comment = null); - Z.mode = R; - case R: + Z.mode = P; + case P: if (Z.flags & 512) { - for (; Me < 16; ) { + for (; De < 16; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (de !== (Z.check & 65535)) { - ue.msg = "header crc mismatch", Z.mode = ne; + if (fe !== (Z.check & 65535)) { + de.msg = "header crc mismatch", Z.mode = Q; break; } - de = 0, Me = 0; + fe = 0, De = 0; } - Z.head && (Z.head.hcrc = Z.flags >> 9 & 1, Z.head.done = !0), ue.adler = Z.check = 0, Z.mode = N; + Z.head && (Z.head.hcrc = Z.flags >> 9 & 1, Z.head.done = !0), de.adler = Z.check = 0, Z.mode = U; break; - case P: - for (; Me < 32; ) { + case B: + for (; De < 32; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - ue.adler = Z.check = Ne(de), de = 0, Me = 0, Z.mode = U; - case U: + de.adler = Z.check = Ue(fe), fe = 0, De = 0, Z.mode = G; + case G: if (Z.havedict === 0) - return ue.next_out = we, ue.avail_out = Y, ue.next_in = I, ue.avail_in = ve, Z.hold = de, Z.bits = Me, l; - ue.adler = Z.check = 1, Z.mode = N; - case N: - if (Ce === A || Ce === x) + return de.next_out = Ee, de.avail_out = Y, de.next_in = z, de.avail_in = ve, Z.hold = fe, Z.bits = De, l; + de.adler = Z.check = 1, Z.mode = U; + case U: + if (Te === A || Te === x) break e; - case B: + case R: if (Z.last) { - de >>>= Me & 7, Me -= Me & 7, Z.mode = Ie; + fe >>>= De & 7, De -= De & 7, Z.mode = Ie; break; } - for (; Me < 3; ) { + for (; De < 3; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - switch (Z.last = de & 1, de >>>= 1, Me -= 1, de & 3) { + switch (Z.last = fe & 1, fe >>>= 1, De -= 1, fe & 3) { case 0: Z.mode = W; break; case 1: - if (ze(Z), Z.mode = ee, Ce === x) { - de >>>= 2, Me -= 2; + if (ze(Z), Z.mode = te, Te === x) { + fe >>>= 2, De -= 2; break e; } break; case 2: - Z.mode = H; + Z.mode = V; break; case 3: - ue.msg = "invalid block type", Z.mode = ne; + de.msg = "invalid block type", Z.mode = Q; } - de >>>= 2, Me -= 2; + fe >>>= 2, De -= 2; break; case W: - for (de >>>= Me & 7, Me -= Me & 7; Me < 32; ) { + for (fe >>>= De & 7, De -= De & 7; De < 32; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if ((de & 65535) !== (de >>> 16 ^ 65535)) { - ue.msg = "invalid stored block lengths", Z.mode = ne; + if ((fe & 65535) !== (fe >>> 16 ^ 65535)) { + de.msg = "invalid stored block lengths", Z.mode = Q; break; } - if (Z.length = de & 65535, de = 0, Me = 0, Z.mode = V, Ce === x) + if (Z.length = fe & 65535, fe = 0, De = 0, Z.mode = H, Te === x) break e; - case V: - Z.mode = G; - case G: + case H: + Z.mode = N; + case N: if (Ke = Z.length, Ke) { if (Ke > ve && (Ke = ve), Ke > Y && (Ke = Y), Ke === 0) break e; - r.arraySet(We, Fe, I, Ke, we), ve -= Ke, I += Ke, Y -= Ke, we += Ke, Z.length -= Ke; + r.arraySet(We, Fe, z, Ke, Ee), ve -= Ke, z += Ke, Y -= Ke, Ee += Ke, Z.length -= Ke; break; } - Z.mode = N; + Z.mode = U; break; - case H: - for (; Me < 14; ) { + case V: + for (; De < 14; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (Z.nlen = (de & 31) + 257, de >>>= 5, Me -= 5, Z.ndist = (de & 31) + 1, de >>>= 5, Me -= 5, Z.ncode = (de & 15) + 4, de >>>= 4, Me -= 4, Z.nlen > 286 || Z.ndist > 30) { - ue.msg = "too many length or distance symbols", Z.mode = ne; + if (Z.nlen = (fe & 31) + 257, fe >>>= 5, De -= 5, Z.ndist = (fe & 31) + 1, fe >>>= 5, De -= 5, Z.ncode = (fe & 15) + 4, fe >>>= 4, De -= 4, Z.nlen > 286 || Z.ndist > 30) { + de.msg = "too many length or distance symbols", Z.mode = Q; break; } - Z.have = 0, Z.mode = Q; - case Q: + Z.have = 0, Z.mode = J; + case J: for (; Z.have < Z.ncode; ) { - for (; Me < 3; ) { + for (; De < 3; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.lens[be[Z.have++]] = de & 7, de >>>= 3, Me -= 3; + Z.lens[be[Z.have++]] = fe & 7, fe >>>= 3, De -= 3; } for (; Z.have < 19; ) Z.lens[be[Z.have++]] = 0; - if (Z.lencode = Z.lendyn, Z.lenbits = 7, zt = { bits: Z.lenbits }, St = o(d, Z.lens, 0, 19, Z.lencode, 0, Z.work, zt), Z.lenbits = zt.bits, St) { - ue.msg = "invalid code lengths set", Z.mode = ne; + if (Z.lencode = Z.lendyn, Z.lenbits = 7, It = { bits: Z.lenbits }, St = o(d, Z.lens, 0, 19, Z.lencode, 0, Z.work, It), Z.lenbits = It.bits, St) { + de.msg = "invalid code lengths set", Z.mode = Q; break; } - Z.have = 0, Z.mode = te; - case te: + Z.have = 0, Z.mode = re; + case re: for (; Z.have < Z.nlen + Z.ndist; ) { - for (; st = Z.lencode[de & (1 << Z.lenbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= Me); ) { + for (; st = Z.lencode[fe & (1 << Z.lenbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= De); ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } if (Mt < 16) - de >>>= ot, Me -= ot, Z.lens[Z.have++] = Mt; + fe >>>= ot, De -= ot, Z.lens[Z.have++] = Mt; else { if (Mt === 16) { - for (qe = ot + 2; Me < qe; ) { + for (qe = ot + 2; De < qe; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (de >>>= ot, Me -= ot, Z.have === 0) { - ue.msg = "invalid bit length repeat", Z.mode = ne; + if (fe >>>= ot, De -= ot, Z.have === 0) { + de.msg = "invalid bit length repeat", Z.mode = Q; break; } - Et = Z.lens[Z.have - 1], Ke = 3 + (de & 3), de >>>= 2, Me -= 2; + Et = Z.lens[Z.have - 1], Ke = 3 + (fe & 3), fe >>>= 2, De -= 2; } else if (Mt === 17) { - for (qe = ot + 3; Me < qe; ) { + for (qe = ot + 3; De < qe; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - de >>>= ot, Me -= ot, Et = 0, Ke = 3 + (de & 7), de >>>= 3, Me -= 3; + fe >>>= ot, De -= ot, Et = 0, Ke = 3 + (fe & 7), fe >>>= 3, De -= 3; } else { - for (qe = ot + 7; Me < qe; ) { + for (qe = ot + 7; De < qe; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - de >>>= ot, Me -= ot, Et = 0, Ke = 11 + (de & 127), de >>>= 7, Me -= 7; + fe >>>= ot, De -= ot, Et = 0, Ke = 11 + (fe & 127), fe >>>= 7, De -= 7; } if (Z.have + Ke > Z.nlen + Z.ndist) { - ue.msg = "invalid bit length repeat", Z.mode = ne; + de.msg = "invalid bit length repeat", Z.mode = Q; break; } for (; Ke--; ) Z.lens[Z.have++] = Et; } } - if (Z.mode === ne) + if (Z.mode === Q) break; if (Z.lens[256] === 0) { - ue.msg = "invalid code -- missing end-of-block", Z.mode = ne; + de.msg = "invalid code -- missing end-of-block", Z.mode = Q; break; } - if (Z.lenbits = 9, zt = { bits: Z.lenbits }, St = o(v, Z.lens, 0, Z.nlen, Z.lencode, 0, Z.work, zt), Z.lenbits = zt.bits, St) { - ue.msg = "invalid literal/lengths set", Z.mode = ne; + if (Z.lenbits = 9, It = { bits: Z.lenbits }, St = o(_, Z.lens, 0, Z.nlen, Z.lencode, 0, Z.work, It), Z.lenbits = It.bits, St) { + de.msg = "invalid literal/lengths set", Z.mode = Q; break; } - if (Z.distbits = 6, Z.distcode = Z.distdyn, zt = { bits: Z.distbits }, St = o(f, Z.lens, Z.nlen, Z.ndist, Z.distcode, 0, Z.work, zt), Z.distbits = zt.bits, St) { - ue.msg = "invalid distances set", Z.mode = ne; + if (Z.distbits = 6, Z.distcode = Z.distdyn, It = { bits: Z.distbits }, St = o(f, Z.lens, Z.nlen, Z.ndist, Z.distcode, 0, Z.work, It), Z.distbits = It.bits, St) { + de.msg = "invalid distances set", Z.mode = Q; break; } - if (Z.mode = ee, Ce === x) + if (Z.mode = te, Te === x) break e; - case ee: - Z.mode = ce; - case ce: + case te: + Z.mode = ue; + case ue: if (ve >= 6 && Y >= 258) { - ue.next_out = we, ue.avail_out = Y, ue.next_in = I, ue.avail_in = ve, Z.hold = de, Z.bits = Me, h(ue, Ze), we = ue.next_out, We = ue.output, Y = ue.avail_out, I = ue.next_in, Fe = ue.input, ve = ue.avail_in, de = Z.hold, Me = Z.bits, Z.mode === N && (Z.back = -1); + de.next_out = Ee, de.avail_out = Y, de.next_in = z, de.avail_in = ve, Z.hold = fe, Z.bits = De, h(de, Ze), Ee = de.next_out, We = de.output, Y = de.avail_out, z = de.next_in, Fe = de.input, ve = de.avail_in, fe = Z.hold, De = Z.bits, Z.mode === U && (Z.back = -1); break; } - for (Z.back = 0; st = Z.lencode[de & (1 << Z.lenbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= Me); ) { + for (Z.back = 0; st = Z.lencode[fe & (1 << Z.lenbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= De); ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } if (at && !(at & 240)) { - for (gt = ot, $t = at, Pt = Mt; st = Z.lencode[Pt + ((de & (1 << gt + $t) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= Me); ) { + for (gt = ot, Lt = at, Bt = Mt; st = Z.lencode[Bt + ((fe & (1 << gt + Lt) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= De); ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - de >>>= gt, Me -= gt, Z.back += gt; + fe >>>= gt, De -= gt, Z.back += gt; } - if (de >>>= ot, Me -= ot, Z.back += ot, Z.length = Mt, at === 0) { - Z.mode = Se; + if (fe >>>= ot, De -= ot, Z.back += ot, Z.length = Mt, at === 0) { + Z.mode = Ae; break; } if (at & 32) { - Z.back = -1, Z.mode = N; + Z.back = -1, Z.mode = U; break; } if (at & 64) { - ue.msg = "invalid literal/length code", Z.mode = ne; + de.msg = "invalid literal/length code", Z.mode = Q; break; } - Z.extra = at & 15, Z.mode = fe; - case fe: + Z.extra = at & 15, Z.mode = ie; + case ie: if (Z.extra) { - for (qe = Z.extra; Me < qe; ) { + for (qe = Z.extra; De < qe; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.length += de & (1 << Z.extra) - 1, de >>>= Z.extra, Me -= Z.extra, Z.back += Z.extra; + Z.length += fe & (1 << Z.extra) - 1, fe >>>= Z.extra, De -= Z.extra, Z.back += Z.extra; } - Z.was = Z.length, Z.mode = oe; - case oe: - for (; st = Z.distcode[de & (1 << Z.distbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= Me); ) { + Z.was = Z.length, Z.mode = ae; + case ae: + for (; st = Z.distcode[fe & (1 << Z.distbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= De); ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } if (!(at & 240)) { - for (gt = ot, $t = at, Pt = Mt; st = Z.distcode[Pt + ((de & (1 << gt + $t) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= Me); ) { + for (gt = ot, Lt = at, Bt = Mt; st = Z.distcode[Bt + ((fe & (1 << gt + Lt) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= De); ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - de >>>= gt, Me -= gt, Z.back += gt; + fe >>>= gt, De -= gt, Z.back += gt; } - if (de >>>= ot, Me -= ot, Z.back += ot, at & 64) { - ue.msg = "invalid distance code", Z.mode = ne; + if (fe >>>= ot, De -= ot, Z.back += ot, at & 64) { + de.msg = "invalid distance code", Z.mode = Q; break; } - Z.offset = Mt, Z.extra = at & 15, Z.mode = he; - case he: + Z.offset = Mt, Z.extra = at & 15, Z.mode = ce; + case ce: if (Z.extra) { - for (qe = Z.extra; Me < qe; ) { + for (qe = Z.extra; De < qe; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - Z.offset += de & (1 << Z.extra) - 1, de >>>= Z.extra, Me -= Z.extra, Z.back += Z.extra; + Z.offset += fe & (1 << Z.extra) - 1, fe >>>= Z.extra, De -= Z.extra, Z.back += Z.extra; } if (Z.offset > Z.dmax) { - ue.msg = "invalid distance too far back", Z.mode = ne; + de.msg = "invalid distance too far back", Z.mode = Q; break; } - Z.mode = Ae; - case Ae: + Z.mode = Me; + case Me: if (Y === 0) break e; if (Ke = Ze - Y, Z.offset > Ke) { if (Ke = Z.offset - Ke, Ke > Z.whave && Z.sane) { - ue.msg = "invalid distance too far back", Z.mode = ne; + de.msg = "invalid distance too far back", Z.mode = Q; break; } Ke > Z.wnext ? (Ke -= Z.wnext, rt = Z.wsize - Ke) : rt = Z.wnext - Ke, Ke > Z.length && (Ke = Z.length), wt = Z.window; } else - wt = We, rt = we - Z.offset, Ke = Z.length; + wt = We, rt = Ee - Z.offset, Ke = Z.length; Ke > Y && (Ke = Y), Y -= Ke, Z.length -= Ke; do - We[we++] = wt[rt++]; + We[Ee++] = wt[rt++]; while (--Ke); - Z.length === 0 && (Z.mode = ce); + Z.length === 0 && (Z.mode = ue); break; - case Se: + case Ae: if (Y === 0) break e; - We[we++] = Z.length, Y--, Z.mode = ce; + We[Ee++] = Z.length, Y--, Z.mode = ue; break; case Ie: if (Z.wrap) { - for (; Me < 32; ) { + for (; De < 32; ) { if (ve === 0) break e; - ve--, de |= Fe[I++] << Me, Me += 8; + ve--, fe |= Fe[z++] << De, De += 8; } - if (Ze -= Y, ue.total_out += Ze, Z.total += Ze, Ze && (ue.adler = Z.check = /*UPDATE(state.check, put - _out, _out);*/ - Z.flags ? s(Z.check, We, Ze, we - Ze) : a(Z.check, We, Ze, we - Ze)), Ze = Y, (Z.flags ? de : Ne(de)) !== Z.check) { - ue.msg = "incorrect data check", Z.mode = ne; + if (Ze -= Y, de.total_out += Ze, Z.total += Ze, Ze && (de.adler = Z.check = /*UPDATE(state.check, put - _out, _out);*/ + Z.flags ? s(Z.check, We, Ze, Ee - Ze) : a(Z.check, We, Ze, Ee - Ze)), Ze = Y, (Z.flags ? fe : Ue(fe)) !== Z.check) { + de.msg = "incorrect data check", Z.mode = Q; break; } - de = 0, Me = 0; + fe = 0, De = 0; } Z.mode = pe; case pe: if (Z.wrap && Z.flags) { - for (; Me < 32; ) { + for (; De < 32; ) { if (ve === 0) break e; - ve--, de += Fe[I++] << Me, Me += 8; + ve--, fe += Fe[z++] << De, De += 8; } - if (de !== (Z.total & 4294967295)) { - ue.msg = "incorrect length check", Z.mode = ne; + if (fe !== (Z.total & 4294967295)) { + de.msg = "incorrect length check", Z.mode = Q; break; } - de = 0, Me = 0; + fe = 0, De = 0; } - Z.mode = le; - case le: + Z.mode = se; + case se: St = m; break e; - case ne: + case Q: St = p; break e; - case Te: + case ye: return g; - case Oe: + case ke: default: return u; } - return ue.next_out = we, ue.avail_out = Y, ue.next_in = I, ue.avail_in = ve, Z.hold = de, Z.bits = Me, (Z.wsize || Ze !== ue.avail_out && Z.mode < ne && (Z.mode < Ie || Ce !== y)) && ke(ue, ue.output, ue.next_out, Ze - ue.avail_out), Ye -= ue.avail_in, Ze -= ue.avail_out, ue.total_in += Ye, ue.total_out += Ze, Z.total += Ze, Z.wrap && Ze && (ue.adler = Z.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - Z.flags ? s(Z.check, We, Ze, ue.next_out - Ze) : a(Z.check, We, Ze, ue.next_out - Ze)), ue.data_type = Z.bits + (Z.last ? 64 : 0) + (Z.mode === N ? 128 : 0) + (Z.mode === ee || Z.mode === V ? 256 : 0), (Ye === 0 && Ze === 0 || Ce === y) && St === M && (St = b), St; + return de.next_out = Ee, de.avail_out = Y, de.next_in = z, de.avail_in = ve, Z.hold = fe, Z.bits = De, (Z.wsize || Ze !== de.avail_out && Z.mode < Q && (Z.mode < Ie || Te !== y)) && $e(de, de.output, de.next_out, Ze - de.avail_out), Ye -= de.avail_in, Ze -= de.avail_out, de.total_in += Ye, de.total_out += Ze, Z.total += Ze, Z.wrap && Ze && (de.adler = Z.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + Z.flags ? s(Z.check, We, Ze, de.next_out - Ze) : a(Z.check, We, Ze, de.next_out - Ze)), de.data_type = Z.bits + (Z.last ? 64 : 0) + (Z.mode === U ? 128 : 0) + (Z.mode === te || Z.mode === H ? 256 : 0), (Ye === 0 && Ze === 0 || Te === y) && St === M && (St = b), St; } - function ae(ue) { - if (!ue || !ue.state) + function oe(de) { + if (!de || !de.state) return u; - var Ce = ue.state; - return Ce.window && (Ce.window = null), ue.state = null, M; + var Te = de.state; + return Te.window && (Te.window = null), de.state = null, M; } - function ge(ue, Ce) { + function ge(de, Te) { var Z; - return !ue || !ue.state || (Z = ue.state, !(Z.wrap & 2)) ? u : (Z.head = Ce, Ce.done = !1, M); + return !de || !de.state || (Z = de.state, !(Z.wrap & 2)) ? u : (Z.head = Te, Te.done = !1, M); } - function xe(ue, Ce) { - var Z = Ce.length, Fe, We, I; - return !ue || !ue.state || (Fe = ue.state, Fe.wrap !== 0 && Fe.mode !== U) ? u : Fe.mode === U && (We = 1, We = a(We, Ce, Z, 0), We !== Fe.check) ? p : (I = ke(ue, Ce, Z, Z), I ? (Fe.mode = Te, g) : (Fe.havedict = 1, M)); + function we(de, Te) { + var Z = Te.length, Fe, We, z; + return !de || !de.state || (Fe = de.state, Fe.wrap !== 0 && Fe.mode !== G) ? u : Fe.mode === G && (We = 1, We = a(We, Te, Z, 0), We !== Fe.check) ? p : (z = $e(de, Te, Z, Z), z ? (Fe.mode = ye, g) : (Fe.havedict = 1, M)); } - e.inflateReset = je, e.inflateReset2 = Xe, e.inflateResetKeep = De, e.inflateInit = q, e.inflateInit2 = X, e.inflate = K, e.inflateEnd = ae, e.inflateGetHeader = ge, e.inflateSetDictionary = xe, e.inflateInfo = "pako inflate (from Nodeca project)"; + e.inflateReset = je, e.inflateReset2 = Xe, e.inflateResetKeep = Ce, e.inflateInit = q, e.inflateInit2 = X, e.inflate = K, e.inflateEnd = oe, e.inflateGetHeader = ge, e.inflateSetDictionary = we, e.inflateInfo = "pako inflate (from Nodeca project)"; } ), /***/ @@ -39440,7 +39462,7 @@ ATOM`, b); var r = t( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), a = 15, s = 852, h = 592, o = 0, d = 1, v = 2, f = [ + ), a = 15, s = 852, h = 592, o = 0, d = 1, _ = 2, f = [ /* Length codes 257..285 base */ 3, 4, @@ -39575,50 +39597,50 @@ ATOM`, b); 64, 64 ]; - n.exports = function(m, l, u, p, g, b, c, _) { - var E = _.bits, w = 0, k = 0, $ = 0, L = 0, z = 0, F = 0, R = 0, P = 0, U = 0, N = 0, B, W, V, G, H, Q = null, te = 0, ee, ce = new r.Buf16(a + 1), fe = new r.Buf16(a + 1), oe = null, he = 0, Ae, Se, Ie; + n.exports = function(m, l, u, p, g, b, c, v) { + var E = v.bits, w = 0, k = 0, $ = 0, L = 0, I = 0, F = 0, P = 0, B = 0, G = 0, U = 0, R, W, H, N, V, J = null, re = 0, te, ue = new r.Buf16(a + 1), ie = new r.Buf16(a + 1), ae = null, ce = 0, Me, Ae, Ie; for (w = 0; w <= a; w++) - ce[w] = 0; + ue[w] = 0; for (k = 0; k < p; k++) - ce[l[u + k]]++; - for (z = E, L = a; L >= 1 && ce[L] === 0; L--) + ue[l[u + k]]++; + for (I = E, L = a; L >= 1 && ue[L] === 0; L--) ; - if (z > L && (z = L), L === 0) - return g[b++] = 20971520, g[b++] = 20971520, _.bits = 1, 0; - for ($ = 1; $ < L && ce[$] === 0; $++) + if (I > L && (I = L), L === 0) + return g[b++] = 20971520, g[b++] = 20971520, v.bits = 1, 0; + for ($ = 1; $ < L && ue[$] === 0; $++) ; - for (z < $ && (z = $), P = 1, w = 1; w <= a; w++) - if (P <<= 1, P -= ce[w], P < 0) + for (I < $ && (I = $), B = 1, w = 1; w <= a; w++) + if (B <<= 1, B -= ue[w], B < 0) return -1; - if (P > 0 && (m === o || L !== 1)) + if (B > 0 && (m === o || L !== 1)) return -1; - for (fe[1] = 0, w = 1; w < a; w++) - fe[w + 1] = fe[w] + ce[w]; + for (ie[1] = 0, w = 1; w < a; w++) + ie[w + 1] = ie[w] + ue[w]; for (k = 0; k < p; k++) - l[u + k] !== 0 && (c[fe[l[u + k]]++] = k); - if (m === o ? (Q = oe = c, ee = 19) : m === d ? (Q = f, te -= 257, oe = y, he -= 257, ee = 256) : (Q = A, oe = x, ee = -1), N = 0, k = 0, w = $, H = b, F = z, R = 0, V = -1, U = 1 << z, G = U - 1, m === d && U > s || m === v && U > h) + l[u + k] !== 0 && (c[ie[l[u + k]]++] = k); + if (m === o ? (J = ae = c, te = 19) : m === d ? (J = f, re -= 257, ae = y, ce -= 257, te = 256) : (J = A, ae = x, te = -1), U = 0, k = 0, w = $, V = b, F = I, P = 0, H = -1, G = 1 << I, N = G - 1, m === d && G > s || m === _ && G > h) return 1; for (; ; ) { - Ae = w - R, c[k] < ee ? (Se = 0, Ie = c[k]) : c[k] > ee ? (Se = oe[he + c[k]], Ie = Q[te + c[k]]) : (Se = 96, Ie = 0), B = 1 << w - R, W = 1 << F, $ = W; + Me = w - P, c[k] < te ? (Ae = 0, Ie = c[k]) : c[k] > te ? (Ae = ae[ce + c[k]], Ie = J[re + c[k]]) : (Ae = 96, Ie = 0), R = 1 << w - P, W = 1 << F, $ = W; do - W -= B, g[H + (N >> R) + W] = Ae << 24 | Se << 16 | Ie | 0; + W -= R, g[V + (U >> P) + W] = Me << 24 | Ae << 16 | Ie | 0; while (W !== 0); - for (B = 1 << w - 1; N & B; ) - B >>= 1; - if (B !== 0 ? (N &= B - 1, N += B) : N = 0, k++, --ce[w] === 0) { + for (R = 1 << w - 1; U & R; ) + R >>= 1; + if (R !== 0 ? (U &= R - 1, U += R) : U = 0, k++, --ue[w] === 0) { if (w === L) break; w = l[u + c[k]]; } - if (w > z && (N & G) !== V) { - for (R === 0 && (R = z), H += $, F = w - R, P = 1 << F; F + R < L && (P -= ce[F + R], !(P <= 0)); ) - F++, P <<= 1; - if (U += 1 << F, m === d && U > s || m === v && U > h) + if (w > I && (U & N) !== H) { + for (P === 0 && (P = I), V += $, F = w - P, B = 1 << F; F + P < L && (B -= ue[F + P], !(B <= 0)); ) + F++, B <<= 1; + if (G += 1 << F, m === d && G > s || m === _ && G > h) return 1; - V = N & G, g[V] = z << 24 | F << 16 | H - b | 0; + H = U & N, g[H] = I << 24 | F << 16 | V - b | 0; } } - return N !== 0 && (g[H + N] = w - R << 24 | 4194304 | 0), _.bits = z, 0; + return U !== 0 && (g[V + U] = w - P << 24 | 4194304 | 0), v.bits = I, 0; }; } ), @@ -39663,70 +39685,70 @@ ATOM`, b); "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), a = 4, s = 0, h = 1, o = 2; function d(K) { - for (var ae = K.length; --ae >= 0; ) - K[ae] = 0; + for (var oe = K.length; --oe >= 0; ) + K[oe] = 0; } - var v = 0, f = 1, y = 2, A = 3, x = 258, M = 29, m = 256, l = m + 1 + M, u = 30, p = 19, g = 2 * l + 1, b = 15, c = 16, _ = 7, E = 256, w = 16, k = 17, $ = 18, L = ( + var _ = 0, f = 1, y = 2, A = 3, x = 258, M = 29, m = 256, l = m + 1 + M, u = 30, p = 19, g = 2 * l + 1, b = 15, c = 16, v = 7, E = 256, w = 16, k = 17, $ = 18, L = ( /* 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 = ( + ), I = ( /* 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] ), F = ( /* 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] - ), R = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], P = 512, U = new Array((l + 2) * 2); + ), P = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], B = 512, G = new Array((l + 2) * 2); + d(G); + var U = new Array(u * 2); d(U); - var N = new Array(u * 2); - d(N); - var B = new Array(P); - d(B); + var R = new Array(B); + d(R); var W = new Array(x - A + 1); d(W); - var V = new Array(M); - d(V); - var G = new Array(u); - d(G); - function H(K, ae, ge, xe, ue) { - this.static_tree = K, this.extra_bits = ae, this.extra_base = ge, this.elems = xe, this.max_length = ue, this.has_stree = K && K.length; + var H = new Array(M); + d(H); + var N = new Array(u); + d(N); + function V(K, oe, ge, we, de) { + this.static_tree = K, this.extra_bits = oe, this.extra_base = ge, this.elems = we, this.max_length = de, this.has_stree = K && K.length; } - var Q, te, ee; - function ce(K, ae) { - this.dyn_tree = K, this.max_code = 0, this.stat_desc = ae; + var J, re, te; + function ue(K, oe) { + this.dyn_tree = K, this.max_code = 0, this.stat_desc = oe; } - function fe(K) { - return K < 256 ? B[K] : B[256 + (K >>> 7)]; + function ie(K) { + return K < 256 ? R[K] : R[256 + (K >>> 7)]; } - function oe(K, ae) { - K.pending_buf[K.pending++] = ae & 255, K.pending_buf[K.pending++] = ae >>> 8 & 255; + function ae(K, oe) { + K.pending_buf[K.pending++] = oe & 255, K.pending_buf[K.pending++] = oe >>> 8 & 255; } - function he(K, ae, ge) { - K.bi_valid > c - ge ? (K.bi_buf |= ae << K.bi_valid & 65535, oe(K, K.bi_buf), K.bi_buf = ae >> c - K.bi_valid, K.bi_valid += ge - c) : (K.bi_buf |= ae << K.bi_valid & 65535, K.bi_valid += ge); + function ce(K, oe, ge) { + K.bi_valid > c - ge ? (K.bi_buf |= oe << K.bi_valid & 65535, ae(K, K.bi_buf), K.bi_buf = oe >> c - K.bi_valid, K.bi_valid += ge - c) : (K.bi_buf |= oe << K.bi_valid & 65535, K.bi_valid += ge); } - function Ae(K, ae, ge) { - he( + function Me(K, oe, ge) { + ce( K, - ge[ae * 2], - ge[ae * 2 + 1] + ge[oe * 2], + ge[oe * 2 + 1] /*.Len*/ ); } - function Se(K, ae) { + function Ae(K, oe) { var ge = 0; do ge |= K & 1, K >>>= 1, ge <<= 1; - while (--ae > 0); + while (--oe > 0); return ge >>> 1; } function Ie(K) { - K.bi_valid === 16 ? (oe(K, K.bi_buf), K.bi_buf = 0, K.bi_valid = 0) : K.bi_valid >= 8 && (K.pending_buf[K.pending++] = K.bi_buf & 255, K.bi_buf >>= 8, K.bi_valid -= 8); + K.bi_valid === 16 ? (ae(K, K.bi_buf), K.bi_buf = 0, K.bi_valid = 0) : K.bi_valid >= 8 && (K.pending_buf[K.pending++] = K.bi_buf & 255, K.bi_buf >>= 8, K.bi_valid -= 8); } - function pe(K, ae) { - var ge = ae.dyn_tree, xe = ae.max_code, ue = ae.stat_desc.static_tree, Ce = ae.stat_desc.has_stree, Z = ae.stat_desc.extra_bits, Fe = ae.stat_desc.extra_base, We = ae.stat_desc.max_length, I, we, ve, Y, de, Me, Ye = 0; + function pe(K, oe) { + var ge = oe.dyn_tree, we = oe.max_code, de = oe.stat_desc.static_tree, Te = oe.stat_desc.has_stree, Z = oe.stat_desc.extra_bits, Fe = oe.stat_desc.extra_base, We = oe.stat_desc.max_length, z, Ee, ve, Y, fe, De, Ye = 0; for (Y = 0; Y <= b; Y++) K.bl_count[Y] = 0; - for (ge[K.heap[K.heap_max] * 2 + 1] = 0, I = K.heap_max + 1; I < g; I++) - we = K.heap[I], Y = ge[ge[we * 2 + 1] * 2 + 1] + 1, Y > We && (Y = We, Ye++), ge[we * 2 + 1] = Y, !(we > xe) && (K.bl_count[Y]++, de = 0, we >= Fe && (de = Z[we - Fe]), Me = ge[we * 2], K.opt_len += Me * (Y + de), Ce && (K.static_len += Me * (ue[we * 2 + 1] + de))); + for (ge[K.heap[K.heap_max] * 2 + 1] = 0, z = K.heap_max + 1; z < g; z++) + Ee = K.heap[z], Y = ge[ge[Ee * 2 + 1] * 2 + 1] + 1, Y > We && (Y = We, Ye++), ge[Ee * 2 + 1] = Y, !(Ee > we) && (K.bl_count[Y]++, fe = 0, Ee >= Fe && (fe = Z[Ee - Fe]), De = ge[Ee * 2], K.opt_len += De * (Y + fe), Te && (K.static_len += De * (de[Ee * 2 + 1] + fe))); if (Ye !== 0) { do { for (Y = We - 1; K.bl_count[Y] === 0; ) @@ -39734,86 +39756,86 @@ ATOM`, b); K.bl_count[Y]--, K.bl_count[Y + 1] += 2, K.bl_count[We]--, Ye -= 2; } while (Ye > 0); for (Y = We; Y !== 0; Y--) - for (we = K.bl_count[Y]; we !== 0; ) - ve = K.heap[--I], !(ve > xe) && (ge[ve * 2 + 1] !== Y && (K.opt_len += (Y - ge[ve * 2 + 1]) * ge[ve * 2], ge[ve * 2 + 1] = Y), we--); + for (Ee = K.bl_count[Y]; Ee !== 0; ) + ve = K.heap[--z], !(ve > we) && (ge[ve * 2 + 1] !== Y && (K.opt_len += (Y - ge[ve * 2 + 1]) * ge[ve * 2], ge[ve * 2 + 1] = Y), Ee--); } } - function le(K, ae, ge) { - var xe = new Array(b + 1), ue = 0, Ce, Z; - for (Ce = 1; Ce <= b; Ce++) - xe[Ce] = ue = ue + ge[Ce - 1] << 1; - for (Z = 0; Z <= ae; Z++) { + function se(K, oe, ge) { + var we = new Array(b + 1), de = 0, Te, Z; + for (Te = 1; Te <= b; Te++) + we[Te] = de = de + ge[Te - 1] << 1; + for (Z = 0; Z <= oe; Z++) { var Fe = K[Z * 2 + 1]; - Fe !== 0 && (K[Z * 2] = Se(xe[Fe]++, Fe)); - } - } - function ne() { - var K, ae, ge, xe, ue, Ce = new Array(b + 1); - for (ge = 0, xe = 0; xe < M - 1; xe++) - for (V[xe] = ge, K = 0; K < 1 << L[xe]; K++) - W[ge++] = xe; - for (W[ge - 1] = xe, ue = 0, xe = 0; xe < 16; xe++) - for (G[xe] = ue, K = 0; K < 1 << z[xe]; K++) - B[ue++] = xe; - for (ue >>= 7; xe < u; xe++) - for (G[xe] = ue << 7, K = 0; K < 1 << z[xe] - 7; K++) - B[256 + ue++] = xe; - for (ae = 0; ae <= b; ae++) - Ce[ae] = 0; + Fe !== 0 && (K[Z * 2] = Ae(we[Fe]++, Fe)); + } + } + function Q() { + var K, oe, ge, we, de, Te = new Array(b + 1); + for (ge = 0, we = 0; we < M - 1; we++) + for (H[we] = ge, K = 0; K < 1 << L[we]; K++) + W[ge++] = we; + for (W[ge - 1] = we, de = 0, we = 0; we < 16; we++) + for (N[we] = de, K = 0; K < 1 << I[we]; K++) + R[de++] = we; + for (de >>= 7; we < u; we++) + for (N[we] = de << 7, K = 0; K < 1 << I[we] - 7; K++) + R[256 + de++] = we; + for (oe = 0; oe <= b; oe++) + Te[oe] = 0; for (K = 0; K <= 143; ) - U[K * 2 + 1] = 8, K++, Ce[8]++; + G[K * 2 + 1] = 8, K++, Te[8]++; for (; K <= 255; ) - U[K * 2 + 1] = 9, K++, Ce[9]++; + G[K * 2 + 1] = 9, K++, Te[9]++; for (; K <= 279; ) - U[K * 2 + 1] = 7, K++, Ce[7]++; + G[K * 2 + 1] = 7, K++, Te[7]++; for (; K <= 287; ) - U[K * 2 + 1] = 8, K++, Ce[8]++; - for (le(U, l + 1, Ce), K = 0; K < u; K++) - N[K * 2 + 1] = 5, N[K * 2] = Se(K, 5); - Q = new H(U, L, m + 1, l, b), te = new H(N, z, 0, u, b), ee = new H(new Array(0), F, 0, p, _); - } - function Te(K) { - var ae; - for (ae = 0; ae < l; ae++) - K.dyn_ltree[ae * 2] = 0; - for (ae = 0; ae < u; ae++) - K.dyn_dtree[ae * 2] = 0; - for (ae = 0; ae < p; ae++) - K.bl_tree[ae * 2] = 0; + G[K * 2 + 1] = 8, K++, Te[8]++; + for (se(G, l + 1, Te), K = 0; K < u; K++) + U[K * 2 + 1] = 5, U[K * 2] = Ae(K, 5); + J = new V(G, L, m + 1, l, b), re = new V(U, I, 0, u, b), te = new V(new Array(0), F, 0, p, v); + } + function ye(K) { + var oe; + for (oe = 0; oe < l; oe++) + K.dyn_ltree[oe * 2] = 0; + for (oe = 0; oe < u; oe++) + K.dyn_dtree[oe * 2] = 0; + for (oe = 0; oe < p; oe++) + K.bl_tree[oe * 2] = 0; K.dyn_ltree[E * 2] = 1, K.opt_len = K.static_len = 0, K.last_lit = K.matches = 0; } - function Oe(K) { - K.bi_valid > 8 ? oe(K, K.bi_buf) : K.bi_valid > 0 && (K.pending_buf[K.pending++] = K.bi_buf), K.bi_buf = 0, K.bi_valid = 0; + function ke(K) { + K.bi_valid > 8 ? ae(K, K.bi_buf) : K.bi_valid > 0 && (K.pending_buf[K.pending++] = K.bi_buf), K.bi_buf = 0, K.bi_valid = 0; } - function Be(K, ae, ge, xe) { - Oe(K), oe(K, ge), oe(K, ~ge), r.arraySet(K.pending_buf, K.window, ae, ge, K.pending), K.pending += ge; + function Pe(K, oe, ge, we) { + ke(K), ae(K, ge), ae(K, ~ge), r.arraySet(K.pending_buf, K.window, oe, ge, K.pending), K.pending += ge; } - function Ue(K, ae, ge, xe) { - var ue = ae * 2, Ce = ge * 2; - return K[ue] < K[Ce] || K[ue] === K[Ce] && xe[ae] <= xe[ge]; + function Ne(K, oe, ge, we) { + var de = oe * 2, Te = ge * 2; + return K[de] < K[Te] || K[de] === K[Te] && we[oe] <= we[ge]; } - function Pe(K, ae, ge) { - for (var xe = K.heap[ge], ue = ge << 1; ue <= K.heap_len && (ue < K.heap_len && Ue(ae, K.heap[ue + 1], K.heap[ue], K.depth) && ue++, !Ue(ae, xe, K.heap[ue], K.depth)); ) - K.heap[ge] = K.heap[ue], ge = ue, ue <<= 1; - K.heap[ge] = xe; + function Be(K, oe, ge) { + for (var we = K.heap[ge], de = ge << 1; de <= K.heap_len && (de < K.heap_len && Ne(oe, K.heap[de + 1], K.heap[de], K.depth) && de++, !Ne(oe, we, K.heap[de], K.depth)); ) + K.heap[ge] = K.heap[de], ge = de, de <<= 1; + K.heap[ge] = we; } - function Ge(K, ae, ge) { - var xe, ue, Ce = 0, Z, Fe; + function Ge(K, oe, ge) { + var we, de, Te = 0, Z, Fe; if (K.last_lit !== 0) do - xe = K.pending_buf[K.d_buf + Ce * 2] << 8 | K.pending_buf[K.d_buf + Ce * 2 + 1], ue = K.pending_buf[K.l_buf + Ce], Ce++, xe === 0 ? Ae(K, ue, ae) : (Z = W[ue], Ae(K, Z + m + 1, ae), Fe = L[Z], Fe !== 0 && (ue -= V[Z], he(K, ue, Fe)), xe--, Z = fe(xe), Ae(K, Z, ge), Fe = z[Z], Fe !== 0 && (xe -= G[Z], he(K, xe, Fe))); - while (Ce < K.last_lit); - Ae(K, E, ae); + we = K.pending_buf[K.d_buf + Te * 2] << 8 | K.pending_buf[K.d_buf + Te * 2 + 1], de = K.pending_buf[K.l_buf + Te], Te++, we === 0 ? Me(K, de, oe) : (Z = W[de], Me(K, Z + m + 1, oe), Fe = L[Z], Fe !== 0 && (de -= H[Z], ce(K, de, Fe)), we--, Z = ie(we), Me(K, Z, ge), Fe = I[Z], Fe !== 0 && (we -= N[Z], ce(K, we, Fe))); + while (Te < K.last_lit); + Me(K, E, oe); } - function Ne(K, ae) { - var ge = ae.dyn_tree, xe = ae.stat_desc.static_tree, ue = ae.stat_desc.has_stree, Ce = ae.stat_desc.elems, Z, Fe, We = -1, I; - for (K.heap_len = 0, K.heap_max = g, Z = 0; Z < Ce; Z++) + function Ue(K, oe) { + var ge = oe.dyn_tree, we = oe.stat_desc.static_tree, de = oe.stat_desc.has_stree, Te = oe.stat_desc.elems, Z, Fe, We = -1, z; + for (K.heap_len = 0, K.heap_max = g, Z = 0; Z < Te; Z++) ge[Z * 2] !== 0 ? (K.heap[++K.heap_len] = We = Z, K.depth[Z] = 0) : ge[Z * 2 + 1] = 0; for (; K.heap_len < 2; ) - I = K.heap[++K.heap_len] = We < 2 ? ++We : 0, ge[I * 2] = 1, K.depth[I] = 0, K.opt_len--, ue && (K.static_len -= xe[I * 2 + 1]); - for (ae.max_code = We, Z = K.heap_len >> 1; Z >= 1; Z--) - Pe(K, ge, Z); - I = Ce; + z = K.heap[++K.heap_len] = We < 2 ? ++We : 0, ge[z * 2] = 1, K.depth[z] = 0, K.opt_len--, de && (K.static_len -= we[z * 2 + 1]); + for (oe.max_code = We, Z = K.heap_len >> 1; Z >= 1; Z--) + Be(K, ge, Z); + z = Te; do Z = K.heap[ 1 @@ -39821,7 +39843,7 @@ ATOM`, b); ], K.heap[ 1 /*SMALLEST*/ - ] = K.heap[K.heap_len--], Pe( + ] = K.heap[K.heap_len--], Be( K, ge, 1 @@ -39829,10 +39851,10 @@ ATOM`, b); ), Fe = K.heap[ 1 /*SMALLEST*/ - ], K.heap[--K.heap_max] = Z, K.heap[--K.heap_max] = Fe, ge[I * 2] = ge[Z * 2] + ge[Fe * 2], K.depth[I] = (K.depth[Z] >= K.depth[Fe] ? K.depth[Z] : K.depth[Fe]) + 1, ge[Z * 2 + 1] = ge[Fe * 2 + 1] = I, K.heap[ + ], K.heap[--K.heap_max] = Z, K.heap[--K.heap_max] = Fe, ge[z * 2] = ge[Z * 2] + ge[Fe * 2], K.depth[z] = (K.depth[Z] >= K.depth[Fe] ? K.depth[Z] : K.depth[Fe]) + 1, ge[Z * 2 + 1] = ge[Fe * 2 + 1] = z, K.heap[ 1 /*SMALLEST*/ - ] = I++, Pe( + ] = z++, Be( K, ge, 1 @@ -39842,41 +39864,41 @@ ATOM`, b); K.heap[--K.heap_max] = K.heap[ 1 /*SMALLEST*/ - ], pe(K, ae), le(ge, We, K.bl_count); - } - function Re(K, ae, ge) { - var xe, ue = -1, Ce, Z = ae[0 * 2 + 1], Fe = 0, We = 7, I = 4; - for (Z === 0 && (We = 138, I = 3), ae[(ge + 1) * 2 + 1] = 65535, xe = 0; xe <= ge; xe++) - Ce = Z, Z = ae[(xe + 1) * 2 + 1], !(++Fe < We && Ce === Z) && (Fe < I ? K.bl_tree[Ce * 2] += Fe : Ce !== 0 ? (Ce !== ue && K.bl_tree[Ce * 2]++, K.bl_tree[w * 2]++) : Fe <= 10 ? K.bl_tree[k * 2]++ : K.bl_tree[$ * 2]++, Fe = 0, ue = Ce, Z === 0 ? (We = 138, I = 3) : Ce === Z ? (We = 6, I = 3) : (We = 7, I = 4)); - } - function De(K, ae, ge) { - var xe, ue = -1, Ce, Z = ae[0 * 2 + 1], Fe = 0, We = 7, I = 4; - for (Z === 0 && (We = 138, I = 3), xe = 0; xe <= ge; xe++) - if (Ce = Z, Z = ae[(xe + 1) * 2 + 1], !(++Fe < We && Ce === Z)) { - if (Fe < I) + ], pe(K, oe), se(ge, We, K.bl_count); + } + function Re(K, oe, ge) { + var we, de = -1, Te, Z = oe[0 * 2 + 1], Fe = 0, We = 7, z = 4; + for (Z === 0 && (We = 138, z = 3), oe[(ge + 1) * 2 + 1] = 65535, we = 0; we <= ge; we++) + Te = Z, Z = oe[(we + 1) * 2 + 1], !(++Fe < We && Te === Z) && (Fe < z ? K.bl_tree[Te * 2] += Fe : Te !== 0 ? (Te !== de && K.bl_tree[Te * 2]++, K.bl_tree[w * 2]++) : Fe <= 10 ? K.bl_tree[k * 2]++ : K.bl_tree[$ * 2]++, Fe = 0, de = Te, Z === 0 ? (We = 138, z = 3) : Te === Z ? (We = 6, z = 3) : (We = 7, z = 4)); + } + function Ce(K, oe, ge) { + var we, de = -1, Te, Z = oe[0 * 2 + 1], Fe = 0, We = 7, z = 4; + for (Z === 0 && (We = 138, z = 3), we = 0; we <= ge; we++) + if (Te = Z, Z = oe[(we + 1) * 2 + 1], !(++Fe < We && Te === Z)) { + if (Fe < z) do - Ae(K, Ce, K.bl_tree); + Me(K, Te, K.bl_tree); while (--Fe !== 0); - else Ce !== 0 ? (Ce !== ue && (Ae(K, Ce, K.bl_tree), Fe--), Ae(K, w, K.bl_tree), he(K, Fe - 3, 2)) : Fe <= 10 ? (Ae(K, k, K.bl_tree), he(K, Fe - 3, 3)) : (Ae(K, $, K.bl_tree), he(K, Fe - 11, 7)); - Fe = 0, ue = Ce, Z === 0 ? (We = 138, I = 3) : Ce === Z ? (We = 6, I = 3) : (We = 7, I = 4); + else Te !== 0 ? (Te !== de && (Me(K, Te, K.bl_tree), Fe--), Me(K, w, K.bl_tree), ce(K, Fe - 3, 2)) : Fe <= 10 ? (Me(K, k, K.bl_tree), ce(K, Fe - 3, 3)) : (Me(K, $, K.bl_tree), ce(K, Fe - 11, 7)); + Fe = 0, de = Te, Z === 0 ? (We = 138, z = 3) : Te === Z ? (We = 6, z = 3) : (We = 7, z = 4); } } function je(K) { - var ae; - for (Re(K, K.dyn_ltree, K.l_desc.max_code), Re(K, K.dyn_dtree, K.d_desc.max_code), Ne(K, K.bl_desc), ae = p - 1; ae >= 3 && K.bl_tree[R[ae] * 2 + 1] === 0; ae--) + var oe; + for (Re(K, K.dyn_ltree, K.l_desc.max_code), Re(K, K.dyn_dtree, K.d_desc.max_code), Ue(K, K.bl_desc), oe = p - 1; oe >= 3 && K.bl_tree[P[oe] * 2 + 1] === 0; oe--) ; - return K.opt_len += 3 * (ae + 1) + 5 + 5 + 4, ae; + return K.opt_len += 3 * (oe + 1) + 5 + 5 + 4, oe; } - function Xe(K, ae, ge, xe) { - var ue; - for (he(K, ae - 257, 5), he(K, ge - 1, 5), he(K, xe - 4, 4), ue = 0; ue < xe; ue++) - he(K, K.bl_tree[R[ue] * 2 + 1], 3); - De(K, K.dyn_ltree, ae - 1), De(K, K.dyn_dtree, ge - 1); + function Xe(K, oe, ge, we) { + var de; + for (ce(K, oe - 257, 5), ce(K, ge - 1, 5), ce(K, we - 4, 4), de = 0; de < we; de++) + ce(K, K.bl_tree[P[de] * 2 + 1], 3); + Ce(K, K.dyn_ltree, oe - 1), Ce(K, K.dyn_dtree, ge - 1); } function X(K) { - var ae = 4093624447, ge; - for (ge = 0; ge <= 31; ge++, ae >>>= 1) - if (ae & 1 && K.dyn_ltree[ge * 2] !== 0) + var oe = 4093624447, ge; + for (ge = 0; ge <= 31; ge++, oe >>>= 1) + if (oe & 1 && K.dyn_ltree[ge * 2] !== 0) return s; if (K.dyn_ltree[18] !== 0 || K.dyn_ltree[20] !== 0 || K.dyn_ltree[26] !== 0) return h; @@ -39886,23 +39908,23 @@ ATOM`, b); return s; } var q = !1; - function re(K) { - q || (ne(), q = !0), K.l_desc = new ce(K.dyn_ltree, Q), K.d_desc = new ce(K.dyn_dtree, te), K.bl_desc = new ce(K.bl_tree, ee), K.bi_buf = 0, K.bi_valid = 0, Te(K); + function ne(K) { + q || (Q(), q = !0), K.l_desc = new ue(K.dyn_ltree, J), K.d_desc = new ue(K.dyn_dtree, re), K.bl_desc = new ue(K.bl_tree, te), K.bi_buf = 0, K.bi_valid = 0, ye(K); } - function ye(K, ae, ge, xe) { - he(K, (v << 1) + (xe ? 1 : 0), 3), Be(K, ae, ge); + function xe(K, oe, ge, we) { + ce(K, (_ << 1) + (we ? 1 : 0), 3), Pe(K, oe, ge); } function me(K) { - he(K, f << 1, 3), Ae(K, E, U), Ie(K); + ce(K, f << 1, 3), Me(K, E, G), Ie(K); } - function ze(K, ae, ge, xe) { - var ue, Ce, Z = 0; - K.level > 0 ? (K.strm.data_type === o && (K.strm.data_type = X(K)), Ne(K, K.l_desc), Ne(K, K.d_desc), Z = je(K), ue = K.opt_len + 3 + 7 >>> 3, Ce = K.static_len + 3 + 7 >>> 3, Ce <= ue && (ue = Ce)) : ue = Ce = ge + 5, ge + 4 <= ue && ae !== -1 ? ye(K, ae, ge, xe) : K.strategy === a || Ce === ue ? (he(K, (f << 1) + (xe ? 1 : 0), 3), Ge(K, U, N)) : (he(K, (y << 1) + (xe ? 1 : 0), 3), Xe(K, K.l_desc.max_code + 1, K.d_desc.max_code + 1, Z + 1), Ge(K, K.dyn_ltree, K.dyn_dtree)), Te(K), xe && Oe(K); + function ze(K, oe, ge, we) { + var de, Te, Z = 0; + K.level > 0 ? (K.strm.data_type === o && (K.strm.data_type = X(K)), Ue(K, K.l_desc), Ue(K, K.d_desc), Z = je(K), de = K.opt_len + 3 + 7 >>> 3, Te = K.static_len + 3 + 7 >>> 3, Te <= de && (de = Te)) : de = Te = ge + 5, ge + 4 <= de && oe !== -1 ? xe(K, oe, ge, we) : K.strategy === a || Te === de ? (ce(K, (f << 1) + (we ? 1 : 0), 3), Ge(K, G, U)) : (ce(K, (y << 1) + (we ? 1 : 0), 3), Xe(K, K.l_desc.max_code + 1, K.d_desc.max_code + 1, Z + 1), Ge(K, K.dyn_ltree, K.dyn_dtree)), ye(K), we && ke(K); } - function ke(K, ae, ge) { - return K.pending_buf[K.d_buf + K.last_lit * 2] = ae >>> 8 & 255, K.pending_buf[K.d_buf + K.last_lit * 2 + 1] = ae & 255, K.pending_buf[K.l_buf + K.last_lit] = ge & 255, K.last_lit++, ae === 0 ? K.dyn_ltree[ge * 2]++ : (K.matches++, ae--, K.dyn_ltree[(W[ge] + m + 1) * 2]++, K.dyn_dtree[fe(ae) * 2]++), K.last_lit === K.lit_bufsize - 1; + function $e(K, oe, ge) { + return K.pending_buf[K.d_buf + K.last_lit * 2] = oe >>> 8 & 255, K.pending_buf[K.d_buf + K.last_lit * 2 + 1] = oe & 255, K.pending_buf[K.l_buf + K.last_lit] = ge & 255, K.last_lit++, oe === 0 ? K.dyn_ltree[ge * 2]++ : (K.matches++, oe--, K.dyn_ltree[(W[ge] + m + 1) * 2]++, K.dyn_dtree[ie(oe) * 2]++), K.last_lit === K.lit_bufsize - 1; } - e._tr_init = re, e._tr_stored_block = ye, e._tr_flush_block = ze, e._tr_tally = ke, e._tr_align = me; + e._tr_init = ne, e._tr_stored_block = xe, e._tr_flush_block = ze, e._tr_tally = $e, e._tr_align = me; } ), /***/ @@ -39925,7 +39947,7 @@ ATOM`, b); \******************************/ /***/ () => { - $3Dmol.workerString = function() { + $3Dmol.workerString = (function() { self.onmessage = function(n) { var e = n.data, t = e.type; if (t < 0) @@ -39937,7 +39959,7 @@ ATOM`, b); self.postMessage(a); } }; - }.toString().replace(/(^.*?\{|\}$)/g, ""), $3Dmol.workerString += `; + }).toString().replace(/(^.*?\{|\}$)/g, ""), $3Dmol.workerString += `; function _classCallCheck() {};`, $3Dmol.workerString += `; ` + $3Dmol.Vector3.toString(), $3Dmol.workerString += `; ` + $3Dmol.MarchingCubeInitializer.toString() + `; @@ -39969,9 +39991,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; (function(t, r) { r(e); })(this, function(t) { - function r(X, q, re) { - for (var ye = (X.byteLength, 0), me = re.length; me > ye; ye++) { - var ze = re.charCodeAt(ye); + function r(X, q, ne) { + for (var xe = (X.byteLength, 0), me = ne.length; me > xe; xe++) { + var ze = ne.charCodeAt(xe); if (128 > ze) X.setUint8(q++, ze >>> 0 & 127 | 0); else if (2048 > ze) X.setUint8(q++, ze >>> 6 & 31 | 192), X.setUint8(q++, ze >>> 0 & 63 | 128); else if (65536 > ze) X.setUint8(q++, ze >>> 12 & 15 | 224), X.setUint8(q++, ze >>> 6 & 63 | 128), X.setUint8(q++, ze >>> 0 & 63 | 128); @@ -39982,8 +40004,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } } function a(X) { - for (var q = 0, re = 0, ye = X.length; ye > re; re++) { - var me = X.charCodeAt(re); + for (var q = 0, ne = 0, xe = X.length; xe > ne; ne++) { + var me = X.charCodeAt(ne); if (128 > me) q += 1; else if (2048 > me) q += 2; else if (65536 > me) q += 3; @@ -39994,70 +40016,70 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return q; } - function s(X, q, re) { - var ye = typeof X; - if (ye === "string") { + function s(X, q, ne) { + var xe = typeof X; + if (xe === "string") { var me = a(X); - if (32 > me) return q.setUint8(re, 160 | me), r(q, re + 1, X), 1 + me; - if (256 > me) return q.setUint8(re, 217), q.setUint8(re + 1, me), r(q, re + 2, X), 2 + me; - if (65536 > me) return q.setUint8(re, 218), q.setUint16(re + 1, me), r(q, re + 3, X), 3 + me; - if (4294967296 > me) return q.setUint8(re, 219), q.setUint32(re + 1, me), r(q, re + 5, X), 5 + me; + if (32 > me) return q.setUint8(ne, 160 | me), r(q, ne + 1, X), 1 + me; + if (256 > me) return q.setUint8(ne, 217), q.setUint8(ne + 1, me), r(q, ne + 2, X), 2 + me; + if (65536 > me) return q.setUint8(ne, 218), q.setUint16(ne + 1, me), r(q, ne + 3, X), 3 + me; + if (4294967296 > me) return q.setUint8(ne, 219), q.setUint32(ne + 1, me), r(q, ne + 5, X), 5 + me; } if (X instanceof Uint8Array) { var me = X.byteLength, ze = new Uint8Array(q.buffer); - if (256 > me) return q.setUint8(re, 196), q.setUint8(re + 1, me), ze.set(X, re + 2), 2 + me; - if (65536 > me) return q.setUint8(re, 197), q.setUint16(re + 1, me), ze.set(X, re + 3), 3 + me; - if (4294967296 > me) return q.setUint8(re, 198), q.setUint32(re + 1, me), ze.set(X, re + 5), 5 + me; + if (256 > me) return q.setUint8(ne, 196), q.setUint8(ne + 1, me), ze.set(X, ne + 2), 2 + me; + if (65536 > me) return q.setUint8(ne, 197), q.setUint16(ne + 1, me), ze.set(X, ne + 3), 3 + me; + if (4294967296 > me) return q.setUint8(ne, 198), q.setUint32(ne + 1, me), ze.set(X, ne + 5), 5 + me; } - if (ye === "number") { + if (xe === "number") { if (!isFinite(X)) throw new Error("Number not finite: " + X); - if (Math.floor(X) !== X) return q.setUint8(re, 203), q.setFloat64(re + 1, X), 9; + if (Math.floor(X) !== X) return q.setUint8(ne, 203), q.setFloat64(ne + 1, X), 9; if (X >= 0) { - if (128 > X) return q.setUint8(re, X), 1; - if (256 > X) return q.setUint8(re, 204), q.setUint8(re + 1, X), 2; - if (65536 > X) return q.setUint8(re, 205), q.setUint16(re + 1, X), 3; - if (4294967296 > X) return q.setUint8(re, 206), q.setUint32(re + 1, X), 5; + if (128 > X) return q.setUint8(ne, X), 1; + if (256 > X) return q.setUint8(ne, 204), q.setUint8(ne + 1, X), 2; + if (65536 > X) return q.setUint8(ne, 205), q.setUint16(ne + 1, X), 3; + if (4294967296 > X) return q.setUint8(ne, 206), q.setUint32(ne + 1, X), 5; throw new Error("Number too big 0x" + X.toString(16)); } - if (X >= -32) return q.setInt8(re, X), 1; - if (X >= -128) return q.setUint8(re, 208), q.setInt8(re + 1, X), 2; - if (X >= -32768) return q.setUint8(re, 209), q.setInt16(re + 1, X), 3; - if (X >= -2147483648) return q.setUint8(re, 210), q.setInt32(re + 1, X), 5; + if (X >= -32) return q.setInt8(ne, X), 1; + if (X >= -128) return q.setUint8(ne, 208), q.setInt8(ne + 1, X), 2; + if (X >= -32768) return q.setUint8(ne, 209), q.setInt16(ne + 1, X), 3; + if (X >= -2147483648) return q.setUint8(ne, 210), q.setInt32(ne + 1, X), 5; throw new Error("Number too small -0x" + (-X).toString(16).substr(1)); } - if (X === null) return q.setUint8(re, 192), 1; - if (ye === "boolean") return q.setUint8(re, X ? 195 : 194), 1; - if (ye === "object") { - var me, ae = 0, ke = Array.isArray(X); - if (ke) me = X.length; + if (X === null) return q.setUint8(ne, 192), 1; + if (xe === "boolean") return q.setUint8(ne, X ? 195 : 194), 1; + if (xe === "object") { + var me, oe = 0, $e = Array.isArray(X); + if ($e) me = X.length; else { var K = Object.keys(X); me = K.length; } - var ae; - if (16 > me ? (q.setUint8(re, me | (ke ? 144 : 128)), ae = 1) : 65536 > me ? (q.setUint8(re, ke ? 220 : 222), q.setUint16(re + 1, me), ae = 3) : 4294967296 > me && (q.setUint8(re, ke ? 221 : 223), q.setUint32(re + 1, me), ae = 5), ke) for (var ge = 0; me > ge; ge++) ae += s(X[ge], q, re + ae); + var oe; + if (16 > me ? (q.setUint8(ne, me | ($e ? 144 : 128)), oe = 1) : 65536 > me ? (q.setUint8(ne, $e ? 220 : 222), q.setUint16(ne + 1, me), oe = 3) : 4294967296 > me && (q.setUint8(ne, $e ? 221 : 223), q.setUint32(ne + 1, me), oe = 5), $e) for (var ge = 0; me > ge; ge++) oe += s(X[ge], q, ne + oe); else for (var ge = 0; me > ge; ge++) { - var xe = K[ge]; - ae += s(xe, q, re + ae), ae += s(X[xe], q, re + ae); + var we = K[ge]; + oe += s(we, q, ne + oe), oe += s(X[we], q, ne + oe); } - return ae; + return oe; } - throw new Error("Unknown type " + ye); + throw new Error("Unknown type " + xe); } function h(X) { var q = typeof X; if (q === "string") { - var re = a(X); - if (32 > re) return 1 + re; - if (256 > re) return 2 + re; - if (65536 > re) return 3 + re; - if (4294967296 > re) return 5 + re; + var ne = a(X); + if (32 > ne) return 1 + ne; + if (256 > ne) return 2 + ne; + if (65536 > ne) return 3 + ne; + if (4294967296 > ne) return 5 + ne; } if (X instanceof Uint8Array) { - var re = X.byteLength; - if (256 > re) return 2 + re; - if (65536 > re) return 3 + re; - if (4294967296 > re) return 5 + re; + var ne = X.byteLength; + if (256 > ne) return 2 + ne; + if (65536 > ne) return 3 + ne; + if (4294967296 > ne) return 5 + ne; } if (q === "number") { if (Math.floor(X) !== X) return 9; @@ -40076,33 +40098,33 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } if (q === "boolean" || X === null) return 1; if (q === "object") { - var re, ye = 0; + var ne, xe = 0; if (Array.isArray(X)) { - re = X.length; - for (var me = 0; re > me; me++) ye += h(X[me]); + ne = X.length; + for (var me = 0; ne > me; me++) xe += h(X[me]); } else { var ze = Object.keys(X); - re = ze.length; - for (var me = 0; re > me; me++) { - var ke = ze[me]; - ye += h(ke) + h(X[ke]); + ne = ze.length; + for (var me = 0; ne > me; me++) { + var $e = ze[me]; + xe += h($e) + h(X[$e]); } } - if (16 > re) return 1 + ye; - if (65536 > re) return 3 + ye; - if (4294967296 > re) return 5 + ye; - throw new Error("Array or object too long 0x" + re.toString(16)); + if (16 > ne) return 1 + xe; + if (65536 > ne) return 3 + xe; + if (4294967296 > ne) return 5 + xe; + throw new Error("Array or object too long 0x" + ne.toString(16)); } throw new Error("Unknown type " + q); } function o(X) { - var q = new ArrayBuffer(h(X)), re = new DataView(q); - return s(X, re, 0), new Uint8Array(q); + var q = new ArrayBuffer(h(X)), ne = new DataView(q); + return s(X, ne, 0), new Uint8Array(q); } - function d(X, q, re) { - return q ? new X(q.buffer, q.byteOffset, q.byteLength / (re || 1)) : void 0; + function d(X, q, ne) { + return q ? new X(q.buffer, q.byteOffset, q.byteLength / (ne || 1)) : void 0; } - function v(X) { + function _(X) { return d(DataView, X); } function f(X) { @@ -40118,259 +40140,259 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return d(Float32Array, X, 4); } function M(X, q) { - var re = X.length / 2; - q || (q = new Int16Array(re)); - for (var ye = 0, me = 0; re > ye; ++ye, me += 2) q[ye] = X[me] << 8 ^ X[me + 1] << 0; + var ne = X.length / 2; + q || (q = new Int16Array(ne)); + for (var xe = 0, me = 0; ne > xe; ++xe, me += 2) q[xe] = X[me] << 8 ^ X[me + 1] << 0; return q; } function m(X, q) { - var re = X.length; - q || (q = new Uint8Array(2 * re)); - for (var ye = v(q), me = 0; re > me; ++me) ye.setInt16(2 * me, X[me]); + var ne = X.length; + q || (q = new Uint8Array(2 * ne)); + for (var xe = _(q), me = 0; ne > me; ++me) xe.setInt16(2 * me, X[me]); return f(q); } function l(X, q) { - var re = X.length / 4; - q || (q = new Int32Array(re)); - for (var ye = 0, me = 0; re > ye; ++ye, me += 4) q[ye] = X[me] << 24 ^ X[me + 1] << 16 ^ X[me + 2] << 8 ^ X[me + 3] << 0; + var ne = X.length / 4; + q || (q = new Int32Array(ne)); + for (var xe = 0, me = 0; ne > xe; ++xe, me += 4) q[xe] = X[me] << 24 ^ X[me + 1] << 16 ^ X[me + 2] << 8 ^ X[me + 3] << 0; return q; } function u(X, q) { - var re = X.length; - q || (q = new Uint8Array(4 * re)); - for (var ye = v(q), me = 0; re > me; ++me) ye.setInt32(4 * me, X[me]); + var ne = X.length; + q || (q = new Uint8Array(4 * ne)); + for (var xe = _(q), me = 0; ne > me; ++me) xe.setInt32(4 * me, X[me]); return f(q); } function p(X, q) { - var re = X.length; - q || (q = new Float32Array(re / 4)); - for (var ye = v(q), me = v(X), ze = 0, ke = 0, K = re / 4; K > ze; ++ze, ke += 4) ye.setFloat32(ke, me.getFloat32(ke), !0); + var ne = X.length; + q || (q = new Float32Array(ne / 4)); + for (var xe = _(q), me = _(X), ze = 0, $e = 0, K = ne / 4; K > ze; ++ze, $e += 4) xe.setFloat32($e, me.getFloat32($e), !0); return q; } - function g(X, q, re) { - var ye = X.length, me = 1 / q; - re || (re = new Float32Array(ye)); - for (var ze = 0; ye > ze; ++ze) re[ze] = X[ze] * me; - return re; + function g(X, q, ne) { + var xe = X.length, me = 1 / q; + ne || (ne = new Float32Array(xe)); + for (var ze = 0; xe > ze; ++ze) ne[ze] = X[ze] * me; + return ne; } - function b(X, q, re) { - var ye = X.length; - re || (re = new Int32Array(ye)); - for (var me = 0; ye > me; ++me) re[me] = Math.round(X[me] * q); - return re; + function b(X, q, ne) { + var xe = X.length; + ne || (ne = new Int32Array(xe)); + for (var me = 0; xe > me; ++me) ne[me] = Math.round(X[me] * q); + return ne; } function c(X, q) { - var re, ye; + var ne, xe; if (!q) { var me = 0; - for (re = 0, ye = X.length; ye > re; re += 2) me += X[re + 1]; + for (ne = 0, xe = X.length; xe > ne; ne += 2) me += X[ne + 1]; q = new X.constructor(me); } var ze = 0; - for (re = 0, ye = X.length; ye > re; re += 2) for (var ke = X[re], K = X[re + 1], ae = 0; K > ae; ++ae) q[ze] = ke, ++ze; + for (ne = 0, xe = X.length; xe > ne; ne += 2) for (var $e = X[ne], K = X[ne + 1], oe = 0; K > oe; ++oe) q[ze] = $e, ++ze; return q; } - function _(X) { + function v(X) { if (X.length === 0) return new Int32Array(); - var q, re, ye = 2; - for (q = 1, re = X.length; re > q; ++q) X[q - 1] !== X[q] && (ye += 2); - var me = new Int32Array(ye), ze = 0, ke = 1; - for (q = 1, re = X.length; re > q; ++q) X[q - 1] !== X[q] ? (me[ze] = X[q - 1], me[ze + 1] = ke, ke = 1, ze += 2) : ++ke; - return me[ze] = X[X.length - 1], me[ze + 1] = ke, me; + var q, ne, xe = 2; + for (q = 1, ne = X.length; ne > q; ++q) X[q - 1] !== X[q] && (xe += 2); + var me = new Int32Array(xe), ze = 0, $e = 1; + for (q = 1, ne = X.length; ne > q; ++q) X[q - 1] !== X[q] ? (me[ze] = X[q - 1], me[ze + 1] = $e, $e = 1, ze += 2) : ++$e; + return me[ze] = X[X.length - 1], me[ze + 1] = $e, me; } function E(X, q) { - var re = X.length; - q || (q = new X.constructor(re)), re && (q[0] = X[0]); - for (var ye = 1; re > ye; ++ye) q[ye] = X[ye] + q[ye - 1]; + var ne = X.length; + q || (q = new X.constructor(ne)), ne && (q[0] = X[0]); + for (var xe = 1; ne > xe; ++xe) q[xe] = X[xe] + q[xe - 1]; return q; } function w(X, q) { - var re = X.length; - q || (q = new X.constructor(re)), q[0] = X[0]; - for (var ye = 1; re > ye; ++ye) q[ye] = X[ye] - X[ye - 1]; + var ne = X.length; + q || (q = new X.constructor(ne)), q[0] = X[0]; + for (var xe = 1; ne > xe; ++xe) q[xe] = X[xe] - X[xe - 1]; return q; } function k(X, q) { - var re, ye, me = X instanceof Int8Array ? 127 : 32767, ze = -me - 1, ke = X.length; + var ne, xe, me = X instanceof Int8Array ? 127 : 32767, ze = -me - 1, $e = X.length; if (!q) { var K = 0; - for (re = 0; ke > re; ++re) X[re] < me && X[re] > ze && ++K; + for (ne = 0; $e > ne; ++ne) X[ne] < me && X[ne] > ze && ++K; q = new Int32Array(K); } - for (re = 0, ye = 0; ke > re; ) { - for (var ae = 0; X[re] === me || X[re] === ze; ) ae += X[re], ++re; - ae += X[re], ++re, q[ye] = ae, ++ye; + for (ne = 0, xe = 0; $e > ne; ) { + for (var oe = 0; X[ne] === me || X[ne] === ze; ) oe += X[ne], ++ne; + oe += X[ne], ++ne, q[xe] = oe, ++xe; } return q; } function $(X, q) { - var re, ye = 32767, me = -ye - 1, ze = X.length, ke = 0; - for (re = 0; ze > re; ++re) { - var K = X[re]; - K === 0 ? ++ke : K > 0 ? (ke += Math.ceil(K / ye), K % ye === 0 && (ke += 1)) : (ke += Math.ceil(K / me), K % me === 0 && (ke += 1)); + var ne, xe = 32767, me = -xe - 1, ze = X.length, $e = 0; + for (ne = 0; ze > ne; ++ne) { + var K = X[ne]; + K === 0 ? ++$e : K > 0 ? ($e += Math.ceil(K / xe), K % xe === 0 && ($e += 1)) : ($e += Math.ceil(K / me), K % me === 0 && ($e += 1)); } - var ae = new Int16Array(ke), ge = 0; - for (re = 0; ze > re; ++re) { - var K = X[re]; - if (K >= 0) for (; K >= ye; ) ae[ge] = ye, ++ge, K -= ye; - else for (; me >= K; ) ae[ge] = me, ++ge, K -= me; - ae[ge] = K, ++ge; + var oe = new Int16Array($e), ge = 0; + for (ne = 0; ze > ne; ++ne) { + var K = X[ne]; + if (K >= 0) for (; K >= xe; ) oe[ge] = xe, ++ge, K -= xe; + else for (; me >= K; ) oe[ge] = me, ++ge, K -= me; + oe[ge] = K, ++ge; } - return ae; + return oe; } function L(X, q) { return E(c(X), q); } - function z(X) { - return _(w(X)); + function I(X) { + return v(w(X)); } - function F(X, q, re) { - return g(c(X, A(re)), q, re); + function F(X, q, ne) { + return g(c(X, A(ne)), q, ne); } - function R(X, q) { - return _(b(X, q)); + function P(X, q) { + return v(b(X, q)); } - function P(X, q, re) { - return g(E(X, A(re)), q, re); + function B(X, q, ne) { + return g(E(X, A(ne)), q, ne); } - function U(X, q, re) { - return w(b(X, q), re); + function G(X, q, ne) { + return w(b(X, q), ne); } - function N(X, q, re) { - return g(k(X, A(re)), q, re); + function U(X, q, ne) { + return g(k(X, A(ne)), q, ne); } - function B(X, q, re) { - var ye = k(X, A(re)); - return P(ye, q, x(ye)); + function R(X, q, ne) { + var xe = k(X, A(ne)); + return B(xe, q, x(xe)); } - function W(X, q, re) { - return $(U(X, q)); + function W(X, q, ne) { + return $(G(X, q)); } - function V(ze) { - var q = v(ze), re = q.getInt32(0), ye = q.getInt32(4), me = ze.subarray(8, 12), ze = ze.subarray(12); - return [re, ze, ye, me]; + function H(ze) { + var q = _(ze), ne = q.getInt32(0), xe = q.getInt32(4), me = ze.subarray(8, 12), ze = ze.subarray(12); + return [ne, ze, xe, me]; } - function G(X, q, re, ye) { - var me = new ArrayBuffer(12 + ye.byteLength), ze = new Uint8Array(me), ke = new DataView(me); - return ke.setInt32(0, X), ke.setInt32(4, q), re && ze.set(re, 8), ze.set(ye, 12), ze; + function N(X, q, ne, xe) { + var me = new ArrayBuffer(12 + xe.byteLength), ze = new Uint8Array(me), $e = new DataView(me); + return $e.setInt32(0, X), $e.setInt32(4, q), ne && ze.set(ne, 8), ze.set(xe, 12), ze; } - function H(X) { - var q = X.length, re = f(X); - return G(2, q, void 0, re); + function V(X) { + var q = X.length, ne = f(X); + return N(2, q, void 0, ne); } - function Q(X) { - var q = X.length, re = u(X); - return G(4, q, void 0, re); + function J(X) { + var q = X.length, ne = u(X); + return N(4, q, void 0, ne); } - function te(X, q) { - var re = X.length / q, ye = u([q]), me = f(X); - return G(5, re, ye, me); + function re(X, q) { + var ne = X.length / q, xe = u([q]), me = f(X); + return N(5, ne, xe, me); } - function ee(X) { - var q = X.length, re = u(_(X)); - return G(6, q, void 0, re); + function te(X) { + var q = X.length, ne = u(v(X)); + return N(6, q, void 0, ne); } - function ce(X) { - var q = X.length, re = u(z(X)); - return G(8, q, void 0, re); + function ue(X) { + var q = X.length, ne = u(I(X)); + return N(8, q, void 0, ne); } - function fe(X, q) { - var re = X.length, ye = u([q]), me = u(R(X, q)); - return G(9, re, ye, me); + function ie(X, q) { + var ne = X.length, xe = u([q]), me = u(P(X, q)); + return N(9, ne, xe, me); } - function oe(X, q) { - var re = X.length, ye = u([q]), me = m(W(X, q)); - return G(10, re, ye, me); + function ae(X, q) { + var ne = X.length, xe = u([q]), me = m(W(X, q)); + return N(10, ne, xe, me); } - function he(X) { + function ce(X) { var q = {}; - return Pe.forEach(function(re) { - X[re] !== void 0 && (q[re] = X[re]); - }), X.bondAtomList && (q.bondAtomList = Q(X.bondAtomList)), X.bondOrderList && (q.bondOrderList = H(X.bondOrderList)), q.xCoordList = oe(X.xCoordList, 1e3), q.yCoordList = oe(X.yCoordList, 1e3), q.zCoordList = oe(X.zCoordList, 1e3), X.bFactorList && (q.bFactorList = oe(X.bFactorList, 100)), X.atomIdList && (q.atomIdList = ce(X.atomIdList)), X.altLocList && (q.altLocList = ee(X.altLocList)), X.occupancyList && (q.occupancyList = fe(X.occupancyList, 100)), q.groupIdList = ce(X.groupIdList), q.groupTypeList = Q(X.groupTypeList), X.secStructList && (q.secStructList = H(X.secStructList)), X.insCodeList && (q.insCodeList = ee(X.insCodeList)), X.sequenceIndexList && (q.sequenceIndexList = ce(X.sequenceIndexList)), q.chainIdList = te(X.chainIdList, 4), X.chainNameList && (q.chainNameList = te(X.chainNameList, 4)), q; - } - function Ae(X) { - function q(ae) { - for (var ge = {}, xe = 0; ae > xe; xe++) { - var ue = ze(); - ge[ue] = ze(); + return Be.forEach(function(ne) { + X[ne] !== void 0 && (q[ne] = X[ne]); + }), X.bondAtomList && (q.bondAtomList = J(X.bondAtomList)), X.bondOrderList && (q.bondOrderList = V(X.bondOrderList)), q.xCoordList = ae(X.xCoordList, 1e3), q.yCoordList = ae(X.yCoordList, 1e3), q.zCoordList = ae(X.zCoordList, 1e3), X.bFactorList && (q.bFactorList = ae(X.bFactorList, 100)), X.atomIdList && (q.atomIdList = ue(X.atomIdList)), X.altLocList && (q.altLocList = te(X.altLocList)), X.occupancyList && (q.occupancyList = ie(X.occupancyList, 100)), q.groupIdList = ue(X.groupIdList), q.groupTypeList = J(X.groupTypeList), X.secStructList && (q.secStructList = V(X.secStructList)), X.insCodeList && (q.insCodeList = te(X.insCodeList)), X.sequenceIndexList && (q.sequenceIndexList = ue(X.sequenceIndexList)), q.chainIdList = re(X.chainIdList, 4), X.chainNameList && (q.chainNameList = re(X.chainNameList, 4)), q; + } + function Me(X) { + function q(oe) { + for (var ge = {}, we = 0; oe > we; we++) { + var de = ze(); + ge[de] = ze(); } return ge; } - function re(ae) { - var ge = X.subarray(ke, ke + ae); - return ke += ae, ge; - } - function ye(ae) { - var ge = X.subarray(ke, ke + ae); - ke += ae; - var xe = 65535; - if (ae > xe) { - for (var ue = [], Ce = 0; Ce < ge.length; Ce += xe) ue.push(String.fromCharCode.apply(null, ge.subarray(Ce, Ce + xe))); - return ue.join(""); + function ne(oe) { + var ge = X.subarray($e, $e + oe); + return $e += oe, ge; + } + function xe(oe) { + var ge = X.subarray($e, $e + oe); + $e += oe; + var we = 65535; + if (oe > we) { + for (var de = [], Te = 0; Te < ge.length; Te += we) de.push(String.fromCharCode.apply(null, ge.subarray(Te, Te + we))); + return de.join(""); } return String.fromCharCode.apply(null, ge); } - function me(ae) { - for (var ge = new Array(ae), xe = 0; ae > xe; xe++) ge[xe] = ze(); + function me(oe) { + for (var ge = new Array(oe), we = 0; oe > we; we++) ge[we] = ze(); return ge; } function ze() { - var ae, ge, xe = X[ke]; - if (!(128 & xe)) return ke++, xe; - if ((240 & xe) === 128) return ge = 15 & xe, ke++, q(ge); - if ((240 & xe) === 144) return ge = 15 & xe, ke++, me(ge); - if ((224 & xe) === 160) return ge = 31 & xe, ke++, ye(ge); - if ((224 & xe) === 224) return ae = K.getInt8(ke), ke++, ae; - switch (xe) { + var oe, ge, we = X[$e]; + if (!(128 & we)) return $e++, we; + if ((240 & we) === 128) return ge = 15 & we, $e++, q(ge); + if ((240 & we) === 144) return ge = 15 & we, $e++, me(ge); + if ((224 & we) === 160) return ge = 31 & we, $e++, xe(ge); + if ((224 & we) === 224) return oe = K.getInt8($e), $e++, oe; + switch (we) { case 192: - return ke++, null; + return $e++, null; case 194: - return ke++, !1; + return $e++, !1; case 195: - return ke++, !0; + return $e++, !0; case 196: - return ge = K.getUint8(ke + 1), ke += 2, re(ge); + return ge = K.getUint8($e + 1), $e += 2, ne(ge); case 197: - return ge = K.getUint16(ke + 1), ke += 3, re(ge); + return ge = K.getUint16($e + 1), $e += 3, ne(ge); case 198: - return ge = K.getUint32(ke + 1), ke += 5, re(ge); + return ge = K.getUint32($e + 1), $e += 5, ne(ge); case 202: - return ae = K.getFloat32(ke + 1), ke += 5, ae; + return oe = K.getFloat32($e + 1), $e += 5, oe; case 203: - return ae = K.getFloat64(ke + 1), ke += 9, ae; + return oe = K.getFloat64($e + 1), $e += 9, oe; case 204: - return ae = X[ke + 1], ke += 2, ae; + return oe = X[$e + 1], $e += 2, oe; case 205: - return ae = K.getUint16(ke + 1), ke += 3, ae; + return oe = K.getUint16($e + 1), $e += 3, oe; case 206: - return ae = K.getUint32(ke + 1), ke += 5, ae; + return oe = K.getUint32($e + 1), $e += 5, oe; case 208: - return ae = K.getInt8(ke + 1), ke += 2, ae; + return oe = K.getInt8($e + 1), $e += 2, oe; case 209: - return ae = K.getInt16(ke + 1), ke += 3, ae; + return oe = K.getInt16($e + 1), $e += 3, oe; case 210: - return ae = K.getInt32(ke + 1), ke += 5, ae; + return oe = K.getInt32($e + 1), $e += 5, oe; case 217: - return ge = K.getUint8(ke + 1), ke += 2, ye(ge); + return ge = K.getUint8($e + 1), $e += 2, xe(ge); case 218: - return ge = K.getUint16(ke + 1), ke += 3, ye(ge); + return ge = K.getUint16($e + 1), $e += 3, xe(ge); case 219: - return ge = K.getUint32(ke + 1), ke += 5, ye(ge); + return ge = K.getUint32($e + 1), $e += 5, xe(ge); case 220: - return ge = K.getUint16(ke + 1), ke += 3, me(ge); + return ge = K.getUint16($e + 1), $e += 3, me(ge); case 221: - return ge = K.getUint32(ke + 1), ke += 5, me(ge); + return ge = K.getUint32($e + 1), $e += 5, me(ge); case 222: - return ge = K.getUint16(ke + 1), ke += 3, q(ge); + return ge = K.getUint16($e + 1), $e += 3, q(ge); case 223: - return ge = K.getUint32(ke + 1), ke += 5, q(ge); + return ge = K.getUint32($e + 1), $e += 5, q(ge); } - throw new Error("Unknown type 0x" + xe.toString(16)); + throw new Error("Unknown type 0x" + we.toString(16)); } - var ke = 0, K = new DataView(X.buffer); + var $e = 0, K = new DataView(X.buffer); return ze(); } - function Se(X, q, re, ye) { + function Ae(X, q, ne, xe) { switch (X) { case 1: return p(q); @@ -40383,21 +40405,21 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 5: return f(q); case 6: - return c(l(q), new Uint8Array(re)); + return c(l(q), new Uint8Array(ne)); case 7: return c(l(q)); case 8: return L(l(q)); case 9: - return F(l(q), l(ye)[0]); + return F(l(q), l(xe)[0]); case 10: - return B(M(q), l(ye)[0]); + return R(M(q), l(xe)[0]); case 11: - return g(M(q), l(ye)[0]); + return g(M(q), l(xe)[0]); case 12: - return N(M(q), l(ye)[0]); + return U(M(q), l(xe)[0]); case 13: - return N(y(q), l(ye)[0]); + return U(y(q), l(xe)[0]); case 14: return k(M(q)); case 15: @@ -40406,35 +40428,35 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } function Ie(X, q) { q = q || {}; - var re = q.ignoreFields, ye = {}; - return Ne.forEach(function(me) { - var ze = re ? re.indexOf(me) !== -1 : !1, ke = X[me]; - ze || ke === void 0 || (ke instanceof Uint8Array ? ye[me] = Se.apply(null, V(ke)) : ye[me] = ke); - }), ye; + var ne = q.ignoreFields, xe = {}; + return Ue.forEach(function(me) { + var ze = ne ? ne.indexOf(me) !== -1 : !1, $e = X[me]; + ze || $e === void 0 || ($e instanceof Uint8Array ? xe[me] = Ae.apply(null, H($e)) : xe[me] = $e); + }), xe; } function pe(X) { return String.fromCharCode.apply(null, X).replace(/\0/g, ""); } - function le(X, q, re) { - re = re || {}; - var ye, me, ze, ke, K, ae, ge = re.firstModelOnly, xe = q.onModel, ue = q.onChain, Ce = q.onGroup, Z = q.onAtom, Fe = q.onBond, We = 0, I = 0, we = 0, ve = 0, Y = 0, de = -1, Me = X.chainNameList, Ye = X.secStructList, Ze = X.insCodeList, Ke = X.sequenceIndexList, rt = X.atomIdList, wt = X.bFactorList, st = X.altLocList, ot = X.occupancyList, at = X.bondAtomList, Mt = X.bondOrderList; - for (ye = 0, me = X.chainsPerModel.length; me > ye && !(ge && We > 0); ++ye) { + function se(X, q, ne) { + ne = ne || {}; + var xe, me, ze, $e, K, oe, ge = ne.firstModelOnly, we = q.onModel, de = q.onChain, Te = q.onGroup, Z = q.onAtom, Fe = q.onBond, We = 0, z = 0, Ee = 0, ve = 0, Y = 0, fe = -1, De = X.chainNameList, Ye = X.secStructList, Ze = X.insCodeList, Ke = X.sequenceIndexList, rt = X.atomIdList, wt = X.bFactorList, st = X.altLocList, ot = X.occupancyList, at = X.bondAtomList, Mt = X.bondOrderList; + for (xe = 0, me = X.chainsPerModel.length; me > xe && !(ge && We > 0); ++xe) { var gt = X.chainsPerModel[We]; - for (xe && xe({ chainCount: gt, modelIndex: We }), ze = 0; gt > ze; ++ze) { - var $t = X.groupsPerChain[I]; - if (ue) { - var Pt = pe(X.chainIdList.subarray(4 * I, 4 * I + 4)), Et = null; - Me && (Et = pe(Me.subarray(4 * I, 4 * I + 4))), ue({ groupCount: $t, chainIndex: I, modelIndex: We, chainId: Pt, chainName: Et }); + for (we && we({ chainCount: gt, modelIndex: We }), ze = 0; gt > ze; ++ze) { + var Lt = X.groupsPerChain[z]; + if (de) { + var Bt = pe(X.chainIdList.subarray(4 * z, 4 * z + 4)), Et = null; + De && (Et = pe(De.subarray(4 * z, 4 * z + 4))), de({ groupCount: Lt, chainIndex: z, modelIndex: We, chainId: Bt, chainName: Et }); } - for (ke = 0; $t > ke; ++ke) { - var St = X.groupList[X.groupTypeList[we]], yt = St.atomNameList.length; - if (Ce) { - var zt = null; - Ye && (zt = Ye[we]); + for ($e = 0; Lt > $e; ++$e) { + var St = X.groupList[X.groupTypeList[Ee]], yt = St.atomNameList.length; + if (Te) { + var It = null; + Ye && (It = Ye[Ee]); var qe = null; - X.insCodeList && (qe = String.fromCharCode(Ze[we])); + X.insCodeList && (qe = String.fromCharCode(Ze[Ee])); var be = null; - Ke && (be = Ke[we]), Ce({ atomCount: yt, groupIndex: we, chainIndex: I, modelIndex: We, groupId: X.groupIdList[we], groupType: X.groupTypeList[we], groupName: St.groupName, singleLetterCode: St.singleLetterCode, chemCompType: St.chemCompType, secStruct: zt, insCode: qe, sequenceIndex: be }); + Ke && (be = Ke[Ee]), Te({ atomCount: yt, groupIndex: Ee, chainIndex: z, modelIndex: We, groupId: X.groupIdList[Ee], groupType: X.groupTypeList[Ee], groupName: St.groupName, singleLetterCode: St.singleLetterCode, chemCompType: St.chemCompType, secStruct: It, insCode: qe, sequenceIndex: be }); } for (K = 0; yt > K; ++K) { if (Z) { @@ -40444,54 +40466,54 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; wt && (et = wt[ve]); var _t = null; st && (_t = String.fromCharCode(st[ve])); - var kt = null; - ot && (kt = ot[ve]), Z({ atomIndex: ve, groupIndex: we, chainIndex: I, modelIndex: We, atomId: Ve, element: St.elementList[K], atomName: St.atomNameList[K], formalCharge: St.formalChargeList[K], xCoord: X.xCoordList[ve], yCoord: X.yCoordList[ve], zCoord: X.zCoordList[ve], bFactor: et, altLoc: _t, occupancy: kt }); + var $t = null; + ot && ($t = ot[ve]), Z({ atomIndex: ve, groupIndex: Ee, chainIndex: z, modelIndex: We, atomId: Ve, element: St.elementList[K], atomName: St.atomNameList[K], formalCharge: St.formalChargeList[K], xCoord: X.xCoordList[ve], yCoord: X.yCoordList[ve], zCoord: X.zCoordList[ve], bFactor: et, altLoc: _t, occupancy: $t }); } ve += 1; } if (Fe) { - var Tt = St.bondAtomList; - for (K = 0, ae = St.bondOrderList.length; ae > K; ++K) Fe({ atomIndex1: ve - yt + Tt[2 * K], atomIndex2: ve - yt + Tt[2 * K + 1], bondOrder: St.bondOrderList[K] }); + var kt = St.bondAtomList; + for (K = 0, oe = St.bondOrderList.length; oe > K; ++K) Fe({ atomIndex1: ve - yt + kt[2 * K], atomIndex2: ve - yt + kt[2 * K + 1], bondOrder: St.bondOrderList[K] }); } - we += 1; + Ee += 1; } - I += 1; + z += 1; } - if (Y = de + 1, de = ve - 1, Fe && at) for (K = 0, ae = at.length; ae > K; K += 2) { - var Lt = at[K], It = at[K + 1]; - (Lt >= Y && de >= Lt || It >= Y && de >= It) && Fe({ atomIndex1: Lt, atomIndex2: It, bondOrder: Mt ? Mt[K / 2] : null }); + if (Y = fe + 1, fe = ve - 1, Fe && at) for (K = 0, oe = at.length; oe > K; K += 2) { + var Ot = at[K], Pt = at[K + 1]; + (Ot >= Y && fe >= Ot || Pt >= Y && fe >= Pt) && Fe({ atomIndex1: Ot, atomIndex2: Pt, bondOrder: Mt ? Mt[K / 2] : null }); } We += 1; } } - function ne(X) { - return o(he(X)); + function Q(X) { + return o(ce(X)); } - function Te(X, q) { + function ye(X, q) { X instanceof ArrayBuffer && (X = new Uint8Array(X)); - var re; - return re = X instanceof Uint8Array ? Ae(X) : X, Ie(re, q); + var ne; + return ne = X instanceof Uint8Array ? Me(X) : X, Ie(ne, q); } - function Oe(X, q, re, ye) { + function ke(X, q, ne, xe) { function me() { try { - var ke = Te(ze.response); - re(ke); + var $e = ye(ze.response); + ne($e); } catch (K) { - ye(K); + xe(K); } } var ze = new XMLHttpRequest(); - ze.addEventListener("load", me, !0), ze.addEventListener("error", ye, !0), ze.responseType = "arraybuffer", ze.open("GET", q + X.toUpperCase()), ze.send(); + ze.addEventListener("load", me, !0), ze.addEventListener("error", xe, !0), ze.responseType = "arraybuffer", ze.open("GET", q + X.toUpperCase()), ze.send(); } - function Be(X, q, re) { - Oe(X, je, q, re); + function Pe(X, q, ne) { + ke(X, je, q, ne); } - function Ue(X, q, re) { - Oe(X, Xe, q, re); + function Ne(X, q, ne) { + ke(X, Xe, q, ne); } - var Pe = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], Ge = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], Ne = Pe.concat(Ge), Re = "v1.0.1", De = "//mmtf.rcsb.org/v1.0/", je = De + "full/", Xe = De + "reduced/"; - t.encode = ne, t.decode = Te, t.traverse = le, t.fetch = Be, t.fetchReduced = Ue, t.version = Re, t.fetchUrl = je, t.fetchReducedUrl = Xe, t.encodeMsgpack = o, t.encodeMmtf = he, t.decodeMsgpack = Ae, t.decodeMmtf = Ie; + var Be = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], Ge = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], Ue = Be.concat(Ge), Re = "v1.0.1", Ce = "//mmtf.rcsb.org/v1.0/", je = Ce + "full/", Xe = Ce + "reduced/"; + t.encode = Q, t.decode = ye, t.traverse = se, t.fetch = Pe, t.fetchReduced = Ne, t.version = Re, t.fetchUrl = je, t.fetchReducedUrl = Xe, t.encodeMsgpack = o, t.encodeMmtf = ce, t.decodeMsgpack = Me, t.decodeMmtf = Ie; }); } ), @@ -40506,52 +40528,52 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* harmony export */ Deflate: () => ( /* binding */ - Xi + Qi ), /* harmony export */ Inflate: () => ( /* binding */ - Qi + rn ), /* harmony export */ constants: () => ( /* binding */ - rn + ln ), /* harmony export */ default: () => ( /* binding */ - Za + rs ), /* harmony export */ deflate: () => ( /* binding */ - Zi + Ji ), /* harmony export */ deflateRaw: () => ( /* binding */ - Yi + en ), /* harmony export */ gzip: () => ( /* binding */ - qi + tn ), /* harmony export */ inflate: () => ( /* binding */ - Ji + nn ), /* harmony export */ inflateRaw: () => ( /* binding */ - en + an ), /* harmony export */ ungzip: () => ( /* binding */ - tn + sn ) /* harmony export */ }); @@ -40562,105 +40584,105 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; --j >= 0; ) C[j] = 0; } - const d = 0, v = 1, f = 2, y = 3, A = 258, x = 29, M = 256, m = M + 1 + x, l = 30, u = 19, p = 2 * m + 1, g = 15, b = 16, c = 7, _ = 256, E = 16, w = 17, k = 18, $ = ( + const d = 0, _ = 1, f = 2, y = 3, A = 258, x = 29, M = 256, m = M + 1 + x, l = 30, u = 19, p = 2 * m + 1, g = 15, b = 16, c = 7, v = 256, E = 16, w = 17, k = 18, $ = ( /* 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]) ), L = ( /* 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 = ( + ), I = ( /* 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]) - ), F = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), R = 512, P = new Array((m + 2) * 2); - o(P); - const U = new Array(l * 2); - o(U); - const N = new Array(R); - o(N); - const B = new Array(A - y + 1); + ), F = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), P = 512, B = new Array((m + 2) * 2); o(B); + const G = new Array(l * 2); + o(G); + const U = new Array(P); + o(U); + const R = new Array(A - y + 1); + o(R); const W = new Array(x); o(W); - const V = new Array(l); - o(V); - function G(C, j, O, J, se) { - this.static_tree = C, this.extra_bits = j, this.extra_base = O, this.elems = J, this.max_length = se, this.has_stree = C && C.length; + const H = new Array(l); + o(H); + function N(C, j, O, ee, he) { + this.static_tree = C, this.extra_bits = j, this.extra_base = O, this.elems = ee, this.max_length = he, this.has_stree = C && C.length; } - let H, Q, te; - function ee(C, j) { + let V, J, re; + function te(C, j) { this.dyn_tree = C, this.max_code = 0, this.stat_desc = j; } - const ce = (C) => C < 256 ? N[C] : N[256 + (C >>> 7)], fe = (C, j) => { + const ue = (C) => C < 256 ? U[C] : U[256 + (C >>> 7)], ie = (C, j) => { C.pending_buf[C.pending++] = j & 255, C.pending_buf[C.pending++] = j >>> 8 & 255; - }, oe = (C, j, O) => { - C.bi_valid > b - O ? (C.bi_buf |= j << C.bi_valid & 65535, fe(C, C.bi_buf), C.bi_buf = j >> b - C.bi_valid, C.bi_valid += O - b) : (C.bi_buf |= j << C.bi_valid & 65535, C.bi_valid += O); - }, he = (C, j, O) => { - oe( + }, ae = (C, j, O) => { + C.bi_valid > b - O ? (C.bi_buf |= j << C.bi_valid & 65535, ie(C, C.bi_buf), C.bi_buf = j >> b - C.bi_valid, C.bi_valid += O - b) : (C.bi_buf |= j << C.bi_valid & 65535, C.bi_valid += O); + }, ce = (C, j, O) => { + ae( C, O[j * 2], O[j * 2 + 1] /*.Len*/ ); - }, Ae = (C, j) => { + }, Me = (C, j) => { let O = 0; do O |= C & 1, C >>>= 1, O <<= 1; while (--j > 0); return O >>> 1; - }, Se = (C) => { - C.bi_valid === 16 ? (fe(C, C.bi_buf), C.bi_buf = 0, C.bi_valid = 0) : C.bi_valid >= 8 && (C.pending_buf[C.pending++] = C.bi_buf & 255, C.bi_buf >>= 8, C.bi_valid -= 8); + }, Ae = (C) => { + C.bi_valid === 16 ? (ie(C, C.bi_buf), C.bi_buf = 0, C.bi_valid = 0) : C.bi_valid >= 8 && (C.pending_buf[C.pending++] = C.bi_buf & 255, C.bi_buf >>= 8, C.bi_valid -= 8); }, Ie = (C, j) => { - const O = j.dyn_tree, J = j.max_code, se = j.stat_desc.static_tree, ie = j.stat_desc.has_stree, $e = j.stat_desc.extra_bits, Ee = j.stat_desc.extra_base, tt = j.stat_desc.max_length; - let _e, Le, pt, Je, He, it, Ct = 0; + const O = j.dyn_tree, ee = j.max_code, he = j.stat_desc.static_tree, le = j.stat_desc.has_stree, Le = j.stat_desc.extra_bits, Se = j.stat_desc.extra_base, tt = j.stat_desc.max_length; + let _e, Oe, pt, Je, He, it, Tt = 0; for (Je = 0; Je <= g; Je++) C.bl_count[Je] = 0; for (O[C.heap[C.heap_max] * 2 + 1] = 0, _e = C.heap_max + 1; _e < p; _e++) - Le = C.heap[_e], Je = O[O[Le * 2 + 1] * 2 + 1] + 1, Je > tt && (Je = tt, Ct++), O[Le * 2 + 1] = Je, !(Le > J) && (C.bl_count[Je]++, He = 0, Le >= Ee && (He = $e[Le - Ee]), it = O[Le * 2], C.opt_len += it * (Je + He), ie && (C.static_len += it * (se[Le * 2 + 1] + He))); - if (Ct !== 0) { + Oe = C.heap[_e], Je = O[O[Oe * 2 + 1] * 2 + 1] + 1, Je > tt && (Je = tt, Tt++), O[Oe * 2 + 1] = Je, !(Oe > ee) && (C.bl_count[Je]++, He = 0, Oe >= Se && (He = Le[Oe - Se]), it = O[Oe * 2], C.opt_len += it * (Je + He), le && (C.static_len += it * (he[Oe * 2 + 1] + He))); + if (Tt !== 0) { do { for (Je = tt - 1; C.bl_count[Je] === 0; ) Je--; - C.bl_count[Je]--, C.bl_count[Je + 1] += 2, C.bl_count[tt]--, Ct -= 2; - } while (Ct > 0); + C.bl_count[Je]--, C.bl_count[Je + 1] += 2, C.bl_count[tt]--, Tt -= 2; + } while (Tt > 0); for (Je = tt; Je !== 0; Je--) - for (Le = C.bl_count[Je]; Le !== 0; ) - pt = C.heap[--_e], !(pt > J) && (O[pt * 2 + 1] !== Je && (C.opt_len += (Je - O[pt * 2 + 1]) * O[pt * 2], O[pt * 2 + 1] = Je), Le--); + for (Oe = C.bl_count[Je]; Oe !== 0; ) + pt = C.heap[--_e], !(pt > ee) && (O[pt * 2 + 1] !== Je && (C.opt_len += (Je - O[pt * 2 + 1]) * O[pt * 2], O[pt * 2 + 1] = Je), Oe--); } }, pe = (C, j, O) => { - const J = new Array(g + 1); - let se = 0, ie, $e; - for (ie = 1; ie <= g; ie++) - se = se + O[ie - 1] << 1, J[ie] = se; - for ($e = 0; $e <= j; $e++) { - let Ee = C[$e * 2 + 1]; - Ee !== 0 && (C[$e * 2] = Ae(J[Ee]++, Ee)); - } - }, le = () => { - let C, j, O, J, se; - const ie = new Array(g + 1); - for (O = 0, J = 0; J < x - 1; J++) - for (W[J] = O, C = 0; C < 1 << $[J]; C++) - B[O++] = J; - for (B[O - 1] = J, se = 0, J = 0; J < 16; J++) - for (V[J] = se, C = 0; C < 1 << L[J]; C++) - N[se++] = J; - for (se >>= 7; J < l; J++) - for (V[J] = se << 7, C = 0; C < 1 << L[J] - 7; C++) - N[256 + se++] = J; + const ee = new Array(g + 1); + let he = 0, le, Le; + for (le = 1; le <= g; le++) + he = he + O[le - 1] << 1, ee[le] = he; + for (Le = 0; Le <= j; Le++) { + let Se = C[Le * 2 + 1]; + Se !== 0 && (C[Le * 2] = Me(ee[Se]++, Se)); + } + }, se = () => { + let C, j, O, ee, he; + const le = new Array(g + 1); + for (O = 0, ee = 0; ee < x - 1; ee++) + for (W[ee] = O, C = 0; C < 1 << $[ee]; C++) + R[O++] = ee; + for (R[O - 1] = ee, he = 0, ee = 0; ee < 16; ee++) + for (H[ee] = he, C = 0; C < 1 << L[ee]; C++) + U[he++] = ee; + for (he >>= 7; ee < l; ee++) + for (H[ee] = he << 7, C = 0; C < 1 << L[ee] - 7; C++) + U[256 + he++] = ee; for (j = 0; j <= g; j++) - ie[j] = 0; + le[j] = 0; for (C = 0; C <= 143; ) - P[C * 2 + 1] = 8, C++, ie[8]++; + B[C * 2 + 1] = 8, C++, le[8]++; for (; C <= 255; ) - P[C * 2 + 1] = 9, C++, ie[9]++; + B[C * 2 + 1] = 9, C++, le[9]++; for (; C <= 279; ) - P[C * 2 + 1] = 7, C++, ie[7]++; + B[C * 2 + 1] = 7, C++, le[7]++; for (; C <= 287; ) - P[C * 2 + 1] = 8, C++, ie[8]++; - for (pe(P, m + 1, ie), C = 0; C < l; C++) - U[C * 2 + 1] = 5, U[C * 2] = Ae(C, 5); - H = new G(P, $, M + 1, m, g), Q = new G(U, L, 0, l, g), te = new G(new Array(0), z, 0, u, c); - }, ne = (C) => { + B[C * 2 + 1] = 8, C++, le[8]++; + for (pe(B, m + 1, le), C = 0; C < l; C++) + G[C * 2 + 1] = 5, G[C * 2] = Me(C, 5); + V = new N(B, $, M + 1, m, g), J = new N(G, L, 0, l, g), re = new N(new Array(0), I, 0, u, c); + }, Q = (C) => { let j; for (j = 0; j < m; j++) C.dyn_ltree[j * 2] = 0; @@ -40668,54 +40690,54 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; C.dyn_dtree[j * 2] = 0; for (j = 0; j < u; j++) C.bl_tree[j * 2] = 0; - C.dyn_ltree[_ * 2] = 1, C.opt_len = C.static_len = 0, C.sym_next = C.matches = 0; - }, Te = (C) => { - C.bi_valid > 8 ? fe(C, C.bi_buf) : C.bi_valid > 0 && (C.pending_buf[C.pending++] = C.bi_buf), C.bi_buf = 0, C.bi_valid = 0; - }, Oe = (C, j, O, J) => { - const se = j * 2, ie = O * 2; - return C[se] < C[ie] || C[se] === C[ie] && J[j] <= J[O]; - }, Be = (C, j, O) => { - const J = C.heap[O]; - let se = O << 1; - for (; se <= C.heap_len && (se < C.heap_len && Oe(j, C.heap[se + 1], C.heap[se], C.depth) && se++, !Oe(j, J, C.heap[se], C.depth)); ) - C.heap[O] = C.heap[se], O = se, se <<= 1; - C.heap[O] = J; - }, Ue = (C, j, O) => { - let J, se, ie = 0, $e, Ee; + C.dyn_ltree[v * 2] = 1, C.opt_len = C.static_len = 0, C.sym_next = C.matches = 0; + }, ye = (C) => { + C.bi_valid > 8 ? ie(C, C.bi_buf) : C.bi_valid > 0 && (C.pending_buf[C.pending++] = C.bi_buf), C.bi_buf = 0, C.bi_valid = 0; + }, ke = (C, j, O, ee) => { + const he = j * 2, le = O * 2; + return C[he] < C[le] || C[he] === C[le] && ee[j] <= ee[O]; + }, Pe = (C, j, O) => { + const ee = C.heap[O]; + let he = O << 1; + for (; he <= C.heap_len && (he < C.heap_len && ke(j, C.heap[he + 1], C.heap[he], C.depth) && he++, !ke(j, ee, C.heap[he], C.depth)); ) + C.heap[O] = C.heap[he], O = he, he <<= 1; + C.heap[O] = ee; + }, Ne = (C, j, O) => { + let ee, he, le = 0, Le, Se; if (C.sym_next !== 0) do - J = C.pending_buf[C.sym_buf + ie++] & 255, J += (C.pending_buf[C.sym_buf + ie++] & 255) << 8, se = C.pending_buf[C.sym_buf + ie++], J === 0 ? he(C, se, j) : ($e = B[se], he(C, $e + M + 1, j), Ee = $[$e], Ee !== 0 && (se -= W[$e], oe(C, se, Ee)), J--, $e = ce(J), he(C, $e, O), Ee = L[$e], Ee !== 0 && (J -= V[$e], oe(C, J, Ee))); - while (ie < C.sym_next); - he(C, _, j); - }, Pe = (C, j) => { - const O = j.dyn_tree, J = j.stat_desc.static_tree, se = j.stat_desc.has_stree, ie = j.stat_desc.elems; - let $e, Ee, tt = -1, _e; - for (C.heap_len = 0, C.heap_max = p, $e = 0; $e < ie; $e++) - O[$e * 2] !== 0 ? (C.heap[++C.heap_len] = tt = $e, C.depth[$e] = 0) : O[$e * 2 + 1] = 0; + ee = C.pending_buf[C.sym_buf + le++] & 255, ee += (C.pending_buf[C.sym_buf + le++] & 255) << 8, he = C.pending_buf[C.sym_buf + le++], ee === 0 ? ce(C, he, j) : (Le = R[he], ce(C, Le + M + 1, j), Se = $[Le], Se !== 0 && (he -= W[Le], ae(C, he, Se)), ee--, Le = ue(ee), ce(C, Le, O), Se = L[Le], Se !== 0 && (ee -= H[Le], ae(C, ee, Se))); + while (le < C.sym_next); + ce(C, v, j); + }, Be = (C, j) => { + const O = j.dyn_tree, ee = j.stat_desc.static_tree, he = j.stat_desc.has_stree, le = j.stat_desc.elems; + let Le, Se, tt = -1, _e; + for (C.heap_len = 0, C.heap_max = p, Le = 0; Le < le; Le++) + O[Le * 2] !== 0 ? (C.heap[++C.heap_len] = tt = Le, C.depth[Le] = 0) : O[Le * 2 + 1] = 0; for (; C.heap_len < 2; ) - _e = C.heap[++C.heap_len] = tt < 2 ? ++tt : 0, O[_e * 2] = 1, C.depth[_e] = 0, C.opt_len--, se && (C.static_len -= J[_e * 2 + 1]); - for (j.max_code = tt, $e = C.heap_len >> 1; $e >= 1; $e--) - Be(C, O, $e); - _e = ie; + _e = C.heap[++C.heap_len] = tt < 2 ? ++tt : 0, O[_e * 2] = 1, C.depth[_e] = 0, C.opt_len--, he && (C.static_len -= ee[_e * 2 + 1]); + for (j.max_code = tt, Le = C.heap_len >> 1; Le >= 1; Le--) + Pe(C, O, Le); + _e = le; do - $e = C.heap[ + Le = C.heap[ 1 /*SMALLEST*/ ], C.heap[ 1 /*SMALLEST*/ - ] = C.heap[C.heap_len--], Be( + ] = C.heap[C.heap_len--], Pe( C, O, 1 /*SMALLEST*/ - ), Ee = C.heap[ + ), Se = C.heap[ 1 /*SMALLEST*/ - ], C.heap[--C.heap_max] = $e, C.heap[--C.heap_max] = Ee, O[_e * 2] = O[$e * 2] + O[Ee * 2], C.depth[_e] = (C.depth[$e] >= C.depth[Ee] ? C.depth[$e] : C.depth[Ee]) + 1, O[$e * 2 + 1] = O[Ee * 2 + 1] = _e, C.heap[ + ], C.heap[--C.heap_max] = Le, C.heap[--C.heap_max] = Se, O[_e * 2] = O[Le * 2] + O[Se * 2], C.depth[_e] = (C.depth[Le] >= C.depth[Se] ? C.depth[Le] : C.depth[Se]) + 1, O[Le * 2 + 1] = O[Se * 2 + 1] = _e, C.heap[ 1 /*SMALLEST*/ - ] = _e++, Be( + ] = _e++, Pe( C, O, 1 @@ -40727,30 +40749,30 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /*SMALLEST*/ ], Ie(C, j), pe(O, tt, C.bl_count); }, Ge = (C, j, O) => { - let J, se = -1, ie, $e = j[0 * 2 + 1], Ee = 0, tt = 7, _e = 4; - for ($e === 0 && (tt = 138, _e = 3), j[(O + 1) * 2 + 1] = 65535, J = 0; J <= O; J++) - ie = $e, $e = j[(J + 1) * 2 + 1], !(++Ee < tt && ie === $e) && (Ee < _e ? C.bl_tree[ie * 2] += Ee : ie !== 0 ? (ie !== se && C.bl_tree[ie * 2]++, C.bl_tree[E * 2]++) : Ee <= 10 ? C.bl_tree[w * 2]++ : C.bl_tree[k * 2]++, Ee = 0, se = ie, $e === 0 ? (tt = 138, _e = 3) : ie === $e ? (tt = 6, _e = 3) : (tt = 7, _e = 4)); - }, Ne = (C, j, O) => { - let J, se = -1, ie, $e = j[0 * 2 + 1], Ee = 0, tt = 7, _e = 4; - for ($e === 0 && (tt = 138, _e = 3), J = 0; J <= O; J++) - if (ie = $e, $e = j[(J + 1) * 2 + 1], !(++Ee < tt && ie === $e)) { - if (Ee < _e) + let ee, he = -1, le, Le = j[0 * 2 + 1], Se = 0, tt = 7, _e = 4; + for (Le === 0 && (tt = 138, _e = 3), j[(O + 1) * 2 + 1] = 65535, ee = 0; ee <= O; ee++) + le = Le, Le = j[(ee + 1) * 2 + 1], !(++Se < tt && le === Le) && (Se < _e ? C.bl_tree[le * 2] += Se : le !== 0 ? (le !== he && C.bl_tree[le * 2]++, C.bl_tree[E * 2]++) : Se <= 10 ? C.bl_tree[w * 2]++ : C.bl_tree[k * 2]++, Se = 0, he = le, Le === 0 ? (tt = 138, _e = 3) : le === Le ? (tt = 6, _e = 3) : (tt = 7, _e = 4)); + }, Ue = (C, j, O) => { + let ee, he = -1, le, Le = j[0 * 2 + 1], Se = 0, tt = 7, _e = 4; + for (Le === 0 && (tt = 138, _e = 3), ee = 0; ee <= O; ee++) + if (le = Le, Le = j[(ee + 1) * 2 + 1], !(++Se < tt && le === Le)) { + if (Se < _e) do - he(C, ie, C.bl_tree); - while (--Ee !== 0); - else ie !== 0 ? (ie !== se && (he(C, ie, C.bl_tree), Ee--), he(C, E, C.bl_tree), oe(C, Ee - 3, 2)) : Ee <= 10 ? (he(C, w, C.bl_tree), oe(C, Ee - 3, 3)) : (he(C, k, C.bl_tree), oe(C, Ee - 11, 7)); - Ee = 0, se = ie, $e === 0 ? (tt = 138, _e = 3) : ie === $e ? (tt = 6, _e = 3) : (tt = 7, _e = 4); + ce(C, le, C.bl_tree); + while (--Se !== 0); + else le !== 0 ? (le !== he && (ce(C, le, C.bl_tree), Se--), ce(C, E, C.bl_tree), ae(C, Se - 3, 2)) : Se <= 10 ? (ce(C, w, C.bl_tree), ae(C, Se - 3, 3)) : (ce(C, k, C.bl_tree), ae(C, Se - 11, 7)); + Se = 0, he = le, Le === 0 ? (tt = 138, _e = 3) : le === Le ? (tt = 6, _e = 3) : (tt = 7, _e = 4); } }, Re = (C) => { let j; - for (Ge(C, C.dyn_ltree, C.l_desc.max_code), Ge(C, C.dyn_dtree, C.d_desc.max_code), Pe(C, C.bl_desc), j = u - 1; j >= 3 && C.bl_tree[F[j] * 2 + 1] === 0; j--) + for (Ge(C, C.dyn_ltree, C.l_desc.max_code), Ge(C, C.dyn_dtree, C.d_desc.max_code), Be(C, C.bl_desc), j = u - 1; j >= 3 && C.bl_tree[F[j] * 2 + 1] === 0; j--) ; return C.opt_len += 3 * (j + 1) + 5 + 5 + 4, j; - }, De = (C, j, O, J) => { - let se; - for (oe(C, j - 257, 5), oe(C, O - 1, 5), oe(C, J - 4, 4), se = 0; se < J; se++) - oe(C, C.bl_tree[F[se] * 2 + 1], 3); - Ne(C, C.dyn_ltree, j - 1), Ne(C, C.dyn_dtree, O - 1); + }, Ce = (C, j, O, ee) => { + let he; + for (ae(C, j - 257, 5), ae(C, O - 1, 5), ae(C, ee - 4, 4), he = 0; he < ee; he++) + ae(C, C.bl_tree[F[he] * 2 + 1], 3); + Ue(C, C.dyn_ltree, j - 1), Ue(C, C.dyn_dtree, O - 1); }, je = (C) => { let j = 4093624447, O; for (O = 0; O <= 31; O++, j >>>= 1) @@ -40765,49 +40787,49 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }; let Xe = !1; const X = (C) => { - Xe || (le(), Xe = !0), C.l_desc = new ee(C.dyn_ltree, H), C.d_desc = new ee(C.dyn_dtree, Q), C.bl_desc = new ee(C.bl_tree, te), C.bi_buf = 0, C.bi_valid = 0, ne(C); - }, q = (C, j, O, J) => { - oe(C, (d << 1) + (J ? 1 : 0), 3), Te(C), fe(C, O), fe(C, ~O), O && C.pending_buf.set(C.window.subarray(j, j + O), C.pending), C.pending += O; - }, re = (C) => { - oe(C, v << 1, 3), he(C, _, P), Se(C); - }, ye = (C, j, O, J) => { - let se, ie, $e = 0; - C.level > 0 ? (C.strm.data_type === h && (C.strm.data_type = je(C)), Pe(C, C.l_desc), Pe(C, C.d_desc), $e = Re(C), se = C.opt_len + 3 + 7 >>> 3, ie = C.static_len + 3 + 7 >>> 3, ie <= se && (se = ie)) : se = ie = O + 5, O + 4 <= se && j !== -1 ? q(C, j, O, J) : C.strategy === r || ie === se ? (oe(C, (v << 1) + (J ? 1 : 0), 3), Ue(C, P, U)) : (oe(C, (f << 1) + (J ? 1 : 0), 3), De(C, C.l_desc.max_code + 1, C.d_desc.max_code + 1, $e + 1), Ue(C, C.dyn_ltree, C.dyn_dtree)), ne(C), J && Te(C); - }, me = (C, j, O) => (C.pending_buf[C.sym_buf + C.sym_next++] = j, C.pending_buf[C.sym_buf + C.sym_next++] = j >> 8, C.pending_buf[C.sym_buf + C.sym_next++] = O, j === 0 ? C.dyn_ltree[O * 2]++ : (C.matches++, j--, C.dyn_ltree[(B[O] + M + 1) * 2]++, C.dyn_dtree[ce(j) * 2]++), C.sym_next === C.sym_end); - var ze = X, ke = q, K = ye, ae = me, ge = re, xe = { + Xe || (se(), Xe = !0), C.l_desc = new te(C.dyn_ltree, V), C.d_desc = new te(C.dyn_dtree, J), C.bl_desc = new te(C.bl_tree, re), C.bi_buf = 0, C.bi_valid = 0, Q(C); + }, q = (C, j, O, ee) => { + ae(C, (d << 1) + (ee ? 1 : 0), 3), ye(C), ie(C, O), ie(C, ~O), O && C.pending_buf.set(C.window.subarray(j, j + O), C.pending), C.pending += O; + }, ne = (C) => { + ae(C, _ << 1, 3), ce(C, v, B), Ae(C); + }, xe = (C, j, O, ee) => { + let he, le, Le = 0; + C.level > 0 ? (C.strm.data_type === h && (C.strm.data_type = je(C)), Be(C, C.l_desc), Be(C, C.d_desc), Le = Re(C), he = C.opt_len + 3 + 7 >>> 3, le = C.static_len + 3 + 7 >>> 3, le <= he && (he = le)) : he = le = O + 5, O + 4 <= he && j !== -1 ? q(C, j, O, ee) : C.strategy === r || le === he ? (ae(C, (_ << 1) + (ee ? 1 : 0), 3), Ne(C, B, G)) : (ae(C, (f << 1) + (ee ? 1 : 0), 3), Ce(C, C.l_desc.max_code + 1, C.d_desc.max_code + 1, Le + 1), Ne(C, C.dyn_ltree, C.dyn_dtree)), Q(C), ee && ye(C); + }, me = (C, j, O) => (C.pending_buf[C.sym_buf + C.sym_next++] = j, C.pending_buf[C.sym_buf + C.sym_next++] = j >> 8, C.pending_buf[C.sym_buf + C.sym_next++] = O, j === 0 ? C.dyn_ltree[O * 2]++ : (C.matches++, j--, C.dyn_ltree[(R[O] + M + 1) * 2]++, C.dyn_dtree[ue(j) * 2]++), C.sym_next === C.sym_end); + var ze = X, $e = q, K = xe, oe = me, ge = ne, we = { _tr_init: ze, - _tr_stored_block: ke, + _tr_stored_block: $e, _tr_flush_block: K, - _tr_tally: ae, + _tr_tally: oe, _tr_align: ge - }, Ce = (C, j, O, J) => { - let se = C & 65535 | 0, ie = C >>> 16 & 65535 | 0, $e = 0; + }, Te = (C, j, O, ee) => { + let he = C & 65535 | 0, le = C >>> 16 & 65535 | 0, Le = 0; for (; O !== 0; ) { - $e = O > 2e3 ? 2e3 : O, O -= $e; + Le = O > 2e3 ? 2e3 : O, O -= Le; do - se = se + j[J++] | 0, ie = ie + se | 0; - while (--$e); - se %= 65521, ie %= 65521; + he = he + j[ee++] | 0, le = le + he | 0; + while (--Le); + he %= 65521, le %= 65521; } - return se | ie << 16 | 0; + return he | le << 16 | 0; }; const Z = () => { let C, j = []; for (var O = 0; O < 256; O++) { C = O; - for (var J = 0; J < 8; J++) + for (var ee = 0; ee < 8; ee++) C = C & 1 ? 3988292384 ^ C >>> 1 : C >>> 1; j[O] = C; } return j; }, Fe = new Uint32Array(Z()); - var I = (C, j, O, J) => { - const se = Fe, ie = J + O; + var z = (C, j, O, ee) => { + const he = Fe, le = ee + O; C ^= -1; - for (let $e = J; $e < ie; $e++) - C = C >>> 8 ^ se[(C ^ j[$e]) & 255]; + for (let Le = ee; Le < le; Le++) + C = C >>> 8 ^ he[(C ^ j[Le]) & 255]; return C ^ -1; - }, we = { + }, Ee = { 2: "need dictionary", /* Z_NEED_DICT 2 */ 1: "stream end", @@ -40866,7 +40888,7 @@ 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: de, _tr_flush_block: Me, _tr_tally: Ye, _tr_align: Ze } = xe, { + const { _tr_init: Y, _tr_stored_block: fe, _tr_flush_block: De, _tr_tally: Ye, _tr_align: Ze } = we, { Z_NO_FLUSH: Ke, Z_PARTIAL_FLUSH: rt, Z_FULL_FLUSH: wt, @@ -40875,469 +40897,469 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_OK: at, Z_STREAM_END: Mt, Z_STREAM_ERROR: gt, - Z_DATA_ERROR: $t, - Z_BUF_ERROR: Pt, + Z_DATA_ERROR: Lt, + Z_BUF_ERROR: Bt, Z_DEFAULT_COMPRESSION: Et, Z_FILTERED: St, Z_HUFFMAN_ONLY: yt, - Z_RLE: zt, + Z_RLE: It, Z_FIXED: qe, Z_DEFAULT_STRATEGY: be, Z_UNKNOWN: Ve, Z_DEFLATED: et - } = ve, _t = 9, kt = 15, Tt = 8, Ht = 256 + 1 + 29, Ft = 30, xr = 19, wr = 2 * Ht + 1, an = 15, ut = 3, Kt = 258, Gt = Kt + ut + 1, sn = 32, rr = 42, Or = 57, Fr = 69, zr = 73, Ir = 91, Rr = 103, Yt = 113, or = 666, Rt = 1, ir = 2, qt = 3, nr = 4, ln = 3, Qt = (C, j) => (C.msg = we[j], j), Yr = (C) => C * 2 - (C > 4 ? 9 : 0), Xt = (C) => { + } = ve, _t = 9, $t = 15, kt = 8, Vt = 256 + 1 + 29, zt = 30, Er = 19, Sr = 2 * Vt + 1, dn = 15, ut = 3, Xt = 258, Wt = Xt + ut + 1, fn = 32, nr = 42, Ir = 57, Pr = 69, Rr = 73, Br = 91, Nr = 103, qt = 113, ur = 666, Rt = 1, ar = 2, Qt = 3, sr = 4, mn = 3, Jt = (C, j) => (C.msg = Ee[j], j), ei = (C) => C * 2 - (C > 4 ? 9 : 0), Zt = (C) => { let j = C.length; for (; --j >= 0; ) C[j] = 0; - }, on = (C) => { - let j, O, J, se = C.w_size; - j = C.hash_size, J = j; + }, pn = (C) => { + let j, O, ee, he = C.w_size; + j = C.hash_size, ee = j; do - O = C.head[--J], C.head[J] = O >= se ? O - se : 0; + O = C.head[--ee], C.head[ee] = O >= he ? O - he : 0; while (--j); - j = se, J = j; + j = he, ee = j; do - O = C.prev[--J], C.prev[J] = O >= se ? O - se : 0; + O = C.prev[--ee], C.prev[ee] = O >= he ? O - he : 0; while (--j); }; - let Zt = (C, j, O) => (j << C.hash_shift ^ O) & C.hash_mask; - const Bt = (C) => { + let Yt = (C, j, O) => (j << C.hash_shift ^ O) & C.hash_mask; + const Nt = (C) => { const j = C.state; let O = j.pending; O > C.avail_out && (O = C.avail_out), O !== 0 && (C.output.set(j.pending_buf.subarray(j.pending_out, j.pending_out + O), C.next_out), C.next_out += O, j.pending_out += O, C.total_out += O, C.avail_out -= O, j.pending -= O, j.pending === 0 && (j.pending_out = 0)); - }, Nt = (C, j) => { - Me(C, C.block_start >= 0 ? C.block_start : -1, C.strstart - C.block_start, j), C.block_start = C.strstart, Bt(C.strm); + }, Ut = (C, j) => { + De(C, C.block_start >= 0 ? C.block_start : -1, C.strstart - C.block_start, j), C.block_start = C.strstart, Nt(C.strm); }, vt = (C, j) => { C.pending_buf[C.pending++] = j; - }, cr = (C, j) => { + }, dr = (C, j) => { C.pending_buf[C.pending++] = j >>> 8 & 255, C.pending_buf[C.pending++] = j & 255; - }, Pr = (C, j, O, J) => { - let se = C.avail_in; - return se > J && (se = J), se === 0 ? 0 : (C.avail_in -= se, j.set(C.input.subarray(C.next_in, C.next_in + se), O), C.state.wrap === 1 ? C.adler = Ce(C.adler, j, se, O) : C.state.wrap === 2 && (C.adler = I(C.adler, j, se, O)), C.next_in += se, C.total_in += se, se); - }, qr = (C, j) => { - let O = C.max_chain_length, J = C.strstart, se, ie, $e = C.prev_length, Ee = C.nice_match; - const tt = C.strstart > C.w_size - Gt ? C.strstart - (C.w_size - Gt) : 0, _e = C.window, Le = C.w_mask, pt = C.prev, Je = C.strstart + Kt; - let He = _e[J + $e - 1], it = _e[J + $e]; - C.prev_length >= C.good_match && (O >>= 2), Ee > C.lookahead && (Ee = C.lookahead); + }, Ur = (C, j, O, ee) => { + let he = C.avail_in; + return he > ee && (he = ee), he === 0 ? 0 : (C.avail_in -= he, j.set(C.input.subarray(C.next_in, C.next_in + he), O), C.state.wrap === 1 ? C.adler = Te(C.adler, j, he, O) : C.state.wrap === 2 && (C.adler = z(C.adler, j, he, O)), C.next_in += he, C.total_in += he, he); + }, ti = (C, j) => { + let O = C.max_chain_length, ee = C.strstart, he, le, Le = C.prev_length, Se = C.nice_match; + const tt = C.strstart > C.w_size - Wt ? C.strstart - (C.w_size - Wt) : 0, _e = C.window, Oe = C.w_mask, pt = C.prev, Je = C.strstart + Xt; + let He = _e[ee + Le - 1], it = _e[ee + Le]; + C.prev_length >= C.good_match && (O >>= 2), Se > C.lookahead && (Se = C.lookahead); do - if (se = j, !(_e[se + $e] !== it || _e[se + $e - 1] !== He || _e[se] !== _e[J] || _e[++se] !== _e[J + 1])) { - J += 2, se++; + if (he = j, !(_e[he + Le] !== it || _e[he + Le - 1] !== He || _e[he] !== _e[ee] || _e[++he] !== _e[ee + 1])) { + ee += 2, he++; do ; - while (_e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && _e[++J] === _e[++se] && J < Je); - if (ie = Kt - (Je - J), J = Je - Kt, ie > $e) { - if (C.match_start = j, $e = ie, ie >= Ee) + while (_e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && _e[++ee] === _e[++he] && ee < Je); + if (le = Xt - (Je - ee), ee = Je - Xt, le > Le) { + if (C.match_start = j, Le = le, le >= Se) break; - He = _e[J + $e - 1], it = _e[J + $e]; + He = _e[ee + Le - 1], it = _e[ee + Le]; } } - while ((j = pt[j & Le]) > tt && --O !== 0); - return $e <= C.lookahead ? $e : C.lookahead; - }, ar = (C) => { + while ((j = pt[j & Oe]) > tt && --O !== 0); + return Le <= C.lookahead ? Le : C.lookahead; + }, lr = (C) => { const j = C.w_size; - let O, J, se; + let O, ee, he; do { - if (J = C.window_size - C.lookahead - C.strstart, C.strstart >= j + (j - Gt) && (C.window.set(C.window.subarray(j, j + j - J), 0), C.match_start -= j, C.strstart -= j, C.block_start -= j, C.insert > C.strstart && (C.insert = C.strstart), on(C), J += j), C.strm.avail_in === 0) + if (ee = C.window_size - C.lookahead - C.strstart, C.strstart >= j + (j - Wt) && (C.window.set(C.window.subarray(j, j + j - ee), 0), C.match_start -= j, C.strstart -= j, C.block_start -= j, C.insert > C.strstart && (C.insert = C.strstart), pn(C), ee += j), C.strm.avail_in === 0) break; - if (O = Pr(C.strm, C.window, C.strstart + C.lookahead, J), C.lookahead += O, C.lookahead + C.insert >= ut) - for (se = C.strstart - C.insert, C.ins_h = C.window[se], C.ins_h = Zt(C, C.ins_h, C.window[se + 1]); C.insert && (C.ins_h = Zt(C, C.ins_h, C.window[se + ut - 1]), C.prev[se & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = se, se++, C.insert--, !(C.lookahead + C.insert < ut)); ) + if (O = Ur(C.strm, C.window, C.strstart + C.lookahead, ee), C.lookahead += O, C.lookahead + C.insert >= ut) + for (he = C.strstart - C.insert, C.ins_h = C.window[he], C.ins_h = Yt(C, C.ins_h, C.window[he + 1]); C.insert && (C.ins_h = Yt(C, C.ins_h, C.window[he + ut - 1]), C.prev[he & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = he, he++, C.insert--, !(C.lookahead + C.insert < ut)); ) ; - } while (C.lookahead < Gt && C.strm.avail_in !== 0); - }, Qr = (C, j) => { - let O = C.pending_buf_size - 5 > C.w_size ? C.w_size : C.pending_buf_size - 5, J, se, ie, $e = 0, Ee = C.strm.avail_in; + } while (C.lookahead < Wt && C.strm.avail_in !== 0); + }, ri = (C, j) => { + let O = C.pending_buf_size - 5 > C.w_size ? C.w_size : C.pending_buf_size - 5, ee, he, le, Le = 0, Se = C.strm.avail_in; do { - if (J = 65535, ie = C.bi_valid + 42 >> 3, C.strm.avail_out < ie || (ie = C.strm.avail_out - ie, se = C.strstart - C.block_start, J > se + C.strm.avail_in && (J = se + C.strm.avail_in), J > ie && (J = ie), J < O && (J === 0 && j !== st || j === Ke || J !== se + C.strm.avail_in))) + if (ee = 65535, le = C.bi_valid + 42 >> 3, C.strm.avail_out < le || (le = C.strm.avail_out - le, he = C.strstart - C.block_start, ee > he + C.strm.avail_in && (ee = he + C.strm.avail_in), ee > le && (ee = le), ee < O && (ee === 0 && j !== st || j === Ke || ee !== he + C.strm.avail_in))) break; - $e = j === st && J === se + C.strm.avail_in ? 1 : 0, de(C, 0, 0, $e), C.pending_buf[C.pending - 4] = J, C.pending_buf[C.pending - 3] = J >> 8, C.pending_buf[C.pending - 2] = ~J, C.pending_buf[C.pending - 1] = ~J >> 8, Bt(C.strm), se && (se > J && (se = J), C.strm.output.set(C.window.subarray(C.block_start, C.block_start + se), C.strm.next_out), C.strm.next_out += se, C.strm.avail_out -= se, C.strm.total_out += se, C.block_start += se, J -= se), J && (Pr(C.strm, C.strm.output, C.strm.next_out, J), C.strm.next_out += J, C.strm.avail_out -= J, C.strm.total_out += J); - } while ($e === 0); - return Ee -= C.strm.avail_in, Ee && (Ee >= C.w_size ? (C.matches = 2, C.window.set(C.strm.input.subarray(C.strm.next_in - C.w_size, C.strm.next_in), 0), C.strstart = C.w_size, C.insert = C.strstart) : (C.window_size - C.strstart <= Ee && (C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, C.insert > C.strstart && (C.insert = C.strstart)), C.window.set(C.strm.input.subarray(C.strm.next_in - Ee, C.strm.next_in), C.strstart), C.strstart += Ee, C.insert += Ee > C.w_size - C.insert ? C.w_size - C.insert : Ee), C.block_start = C.strstart), C.high_water < C.strstart && (C.high_water = C.strstart), $e ? nr : j !== Ke && j !== st && C.strm.avail_in === 0 && C.strstart === C.block_start ? ir : (ie = C.window_size - C.strstart, C.strm.avail_in > ie && C.block_start >= C.w_size && (C.block_start -= C.w_size, C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, ie += C.w_size, C.insert > C.strstart && (C.insert = C.strstart)), ie > C.strm.avail_in && (ie = C.strm.avail_in), ie && (Pr(C.strm, C.window, C.strstart, ie), C.strstart += ie, C.insert += ie > C.w_size - C.insert ? C.w_size - C.insert : ie), C.high_water < C.strstart && (C.high_water = C.strstart), ie = C.bi_valid + 42 >> 3, ie = C.pending_buf_size - ie > 65535 ? 65535 : C.pending_buf_size - ie, O = ie > C.w_size ? C.w_size : ie, se = C.strstart - C.block_start, (se >= O || (se || j === st) && j !== Ke && C.strm.avail_in === 0 && se <= ie) && (J = se > ie ? ie : se, $e = j === st && C.strm.avail_in === 0 && J === se ? 1 : 0, de(C, C.block_start, J, $e), C.block_start += J, Bt(C.strm)), $e ? qt : Rt); - }, Br = (C, j) => { - let O, J; + Le = j === st && ee === he + C.strm.avail_in ? 1 : 0, fe(C, 0, 0, Le), C.pending_buf[C.pending - 4] = ee, C.pending_buf[C.pending - 3] = ee >> 8, C.pending_buf[C.pending - 2] = ~ee, C.pending_buf[C.pending - 1] = ~ee >> 8, Nt(C.strm), he && (he > ee && (he = ee), C.strm.output.set(C.window.subarray(C.block_start, C.block_start + he), C.strm.next_out), C.strm.next_out += he, C.strm.avail_out -= he, C.strm.total_out += he, C.block_start += he, ee -= he), ee && (Ur(C.strm, C.strm.output, C.strm.next_out, ee), C.strm.next_out += ee, C.strm.avail_out -= ee, C.strm.total_out += ee); + } while (Le === 0); + return Se -= C.strm.avail_in, Se && (Se >= C.w_size ? (C.matches = 2, C.window.set(C.strm.input.subarray(C.strm.next_in - C.w_size, C.strm.next_in), 0), C.strstart = C.w_size, C.insert = C.strstart) : (C.window_size - C.strstart <= Se && (C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, C.insert > C.strstart && (C.insert = C.strstart)), C.window.set(C.strm.input.subarray(C.strm.next_in - Se, C.strm.next_in), C.strstart), C.strstart += Se, C.insert += Se > C.w_size - C.insert ? C.w_size - C.insert : Se), C.block_start = C.strstart), C.high_water < C.strstart && (C.high_water = C.strstart), Le ? sr : j !== Ke && j !== st && C.strm.avail_in === 0 && C.strstart === C.block_start ? ar : (le = C.window_size - C.strstart, C.strm.avail_in > le && C.block_start >= C.w_size && (C.block_start -= C.w_size, C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, le += C.w_size, C.insert > C.strstart && (C.insert = C.strstart)), le > C.strm.avail_in && (le = C.strm.avail_in), le && (Ur(C.strm, C.window, C.strstart, le), C.strstart += le, C.insert += le > C.w_size - C.insert ? C.w_size - C.insert : le), C.high_water < C.strstart && (C.high_water = C.strstart), le = C.bi_valid + 42 >> 3, le = C.pending_buf_size - le > 65535 ? 65535 : C.pending_buf_size - le, O = le > C.w_size ? C.w_size : le, he = C.strstart - C.block_start, (he >= O || (he || j === st) && j !== Ke && C.strm.avail_in === 0 && he <= le) && (ee = he > le ? le : he, Le = j === st && C.strm.avail_in === 0 && ee === he ? 1 : 0, fe(C, C.block_start, ee, Le), C.block_start += ee, Nt(C.strm)), Le ? Qt : Rt); + }, Gr = (C, j) => { + let O, ee; for (; ; ) { - if (C.lookahead < Gt) { - if (ar(C), C.lookahead < Gt && j === Ke) + if (C.lookahead < Wt) { + if (lr(C), C.lookahead < Wt && j === Ke) return Rt; if (C.lookahead === 0) break; } - if (O = 0, C.lookahead >= ut && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), O !== 0 && C.strstart - O <= C.w_size - Gt && (C.match_length = qr(C, O)), C.match_length >= ut) - if (J = Ye(C, C.strstart - C.match_start, C.match_length - ut), C.lookahead -= C.match_length, C.match_length <= C.max_lazy_match && C.lookahead >= ut) { + if (O = 0, C.lookahead >= ut && (C.ins_h = Yt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), O !== 0 && C.strstart - O <= C.w_size - Wt && (C.match_length = ti(C, O)), C.match_length >= ut) + if (ee = Ye(C, C.strstart - C.match_start, C.match_length - ut), C.lookahead -= C.match_length, C.match_length <= C.max_lazy_match && C.lookahead >= ut) { C.match_length--; do - C.strstart++, C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart; + C.strstart++, C.ins_h = Yt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart; while (--C.match_length !== 0); C.strstart++; } else - C.strstart += C.match_length, C.match_length = 0, C.ins_h = C.window[C.strstart], C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + 1]); + C.strstart += C.match_length, C.match_length = 0, C.ins_h = C.window[C.strstart], C.ins_h = Yt(C, C.ins_h, C.window[C.strstart + 1]); else - J = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++; - if (J && (Nt(C, !1), C.strm.avail_out === 0)) + ee = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++; + if (ee && (Ut(C, !1), C.strm.avail_out === 0)) return Rt; } - return C.insert = C.strstart < ut - 1 ? C.strstart : ut - 1, j === st ? (Nt(C, !0), C.strm.avail_out === 0 ? qt : nr) : C.sym_next && (Nt(C, !1), C.strm.avail_out === 0) ? Rt : ir; - }, sr = (C, j) => { - let O, J, se; + return C.insert = C.strstart < ut - 1 ? C.strstart : ut - 1, j === st ? (Ut(C, !0), C.strm.avail_out === 0 ? Qt : sr) : C.sym_next && (Ut(C, !1), C.strm.avail_out === 0) ? Rt : ar; + }, or = (C, j) => { + let O, ee, he; for (; ; ) { - if (C.lookahead < Gt) { - if (ar(C), C.lookahead < Gt && j === Ke) + if (C.lookahead < Wt) { + if (lr(C), C.lookahead < Wt && j === Ke) return Rt; if (C.lookahead === 0) break; } - if (O = 0, C.lookahead >= ut && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), C.prev_length = C.match_length, C.prev_match = C.match_start, C.match_length = ut - 1, O !== 0 && C.prev_length < C.max_lazy_match && C.strstart - O <= C.w_size - Gt && (C.match_length = qr(C, O), C.match_length <= 5 && (C.strategy === St || C.match_length === ut && C.strstart - C.match_start > 4096) && (C.match_length = ut - 1)), C.prev_length >= ut && C.match_length <= C.prev_length) { - se = C.strstart + C.lookahead - ut, J = Ye(C, C.strstart - 1 - C.prev_match, C.prev_length - ut), C.lookahead -= C.prev_length - 1, C.prev_length -= 2; + if (O = 0, C.lookahead >= ut && (C.ins_h = Yt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), C.prev_length = C.match_length, C.prev_match = C.match_start, C.match_length = ut - 1, O !== 0 && C.prev_length < C.max_lazy_match && C.strstart - O <= C.w_size - Wt && (C.match_length = ti(C, O), C.match_length <= 5 && (C.strategy === St || C.match_length === ut && C.strstart - C.match_start > 4096) && (C.match_length = ut - 1)), C.prev_length >= ut && C.match_length <= C.prev_length) { + he = C.strstart + C.lookahead - ut, ee = Ye(C, C.strstart - 1 - C.prev_match, C.prev_length - ut), C.lookahead -= C.prev_length - 1, C.prev_length -= 2; do - ++C.strstart <= se && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart); + ++C.strstart <= he && (C.ins_h = Yt(C, C.ins_h, C.window[C.strstart + ut - 1]), O = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart); while (--C.prev_length !== 0); - if (C.match_available = 0, C.match_length = ut - 1, C.strstart++, J && (Nt(C, !1), C.strm.avail_out === 0)) + if (C.match_available = 0, C.match_length = ut - 1, C.strstart++, ee && (Ut(C, !1), C.strm.avail_out === 0)) return Rt; } else if (C.match_available) { - if (J = Ye(C, 0, C.window[C.strstart - 1]), J && Nt(C, !1), C.strstart++, C.lookahead--, C.strm.avail_out === 0) + if (ee = Ye(C, 0, C.window[C.strstart - 1]), ee && Ut(C, !1), C.strstart++, C.lookahead--, C.strm.avail_out === 0) return Rt; } else C.match_available = 1, C.strstart++, C.lookahead--; } - return C.match_available && (J = Ye(C, 0, C.window[C.strstart - 1]), C.match_available = 0), C.insert = C.strstart < ut - 1 ? C.strstart : ut - 1, j === st ? (Nt(C, !0), C.strm.avail_out === 0 ? qt : nr) : C.sym_next && (Nt(C, !1), C.strm.avail_out === 0) ? Rt : ir; - }, hn = (C, j) => { - let O, J, se, ie; - const $e = C.window; + return C.match_available && (ee = Ye(C, 0, C.window[C.strstart - 1]), C.match_available = 0), C.insert = C.strstart < ut - 1 ? C.strstart : ut - 1, j === st ? (Ut(C, !0), C.strm.avail_out === 0 ? Qt : sr) : C.sym_next && (Ut(C, !1), C.strm.avail_out === 0) ? Rt : ar; + }, gn = (C, j) => { + let O, ee, he, le; + const Le = C.window; for (; ; ) { - if (C.lookahead <= Kt) { - if (ar(C), C.lookahead <= Kt && j === Ke) + if (C.lookahead <= Xt) { + if (lr(C), C.lookahead <= Xt && j === Ke) return Rt; if (C.lookahead === 0) break; } - if (C.match_length = 0, C.lookahead >= ut && C.strstart > 0 && (se = C.strstart - 1, J = $e[se], J === $e[++se] && J === $e[++se] && J === $e[++se])) { - ie = C.strstart + Kt; + if (C.match_length = 0, C.lookahead >= ut && C.strstart > 0 && (he = C.strstart - 1, ee = Le[he], ee === Le[++he] && ee === Le[++he] && ee === Le[++he])) { + le = C.strstart + Xt; do ; - while (J === $e[++se] && J === $e[++se] && J === $e[++se] && J === $e[++se] && J === $e[++se] && J === $e[++se] && J === $e[++se] && J === $e[++se] && se < ie); - C.match_length = Kt - (ie - se), C.match_length > C.lookahead && (C.match_length = C.lookahead); + while (ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && ee === Le[++he] && he < le); + C.match_length = Xt - (le - he), C.match_length > C.lookahead && (C.match_length = C.lookahead); } - if (C.match_length >= ut ? (O = Ye(C, 1, C.match_length - ut), C.lookahead -= C.match_length, C.strstart += C.match_length, C.match_length = 0) : (O = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++), O && (Nt(C, !1), C.strm.avail_out === 0)) + if (C.match_length >= ut ? (O = Ye(C, 1, C.match_length - ut), C.lookahead -= C.match_length, C.strstart += C.match_length, C.match_length = 0) : (O = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++), O && (Ut(C, !1), C.strm.avail_out === 0)) return Rt; } - return C.insert = 0, j === st ? (Nt(C, !0), C.strm.avail_out === 0 ? qt : nr) : C.sym_next && (Nt(C, !1), C.strm.avail_out === 0) ? Rt : ir; - }, cn = (C, j) => { + return C.insert = 0, j === st ? (Ut(C, !0), C.strm.avail_out === 0 ? Qt : sr) : C.sym_next && (Ut(C, !1), C.strm.avail_out === 0) ? Rt : ar; + }, _n = (C, j) => { let O; for (; ; ) { - if (C.lookahead === 0 && (ar(C), C.lookahead === 0)) { + if (C.lookahead === 0 && (lr(C), C.lookahead === 0)) { if (j === Ke) return Rt; break; } - if (C.match_length = 0, O = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++, O && (Nt(C, !1), C.strm.avail_out === 0)) + if (C.match_length = 0, O = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++, O && (Ut(C, !1), C.strm.avail_out === 0)) return Rt; } - return C.insert = 0, j === st ? (Nt(C, !0), C.strm.avail_out === 0 ? qt : nr) : C.sym_next && (Nt(C, !1), C.strm.avail_out === 0) ? Rt : ir; + return C.insert = 0, j === st ? (Ut(C, !0), C.strm.avail_out === 0 ? Qt : sr) : C.sym_next && (Ut(C, !1), C.strm.avail_out === 0) ? Rt : ar; }; - function Wt(C, j, O, J, se) { - this.good_length = C, this.max_lazy = j, this.nice_length = O, this.max_chain = J, this.func = se; + function Ht(C, j, O, ee, he) { + this.good_length = C, this.max_lazy = j, this.nice_length = O, this.max_chain = ee, this.func = he; } - const ur = [ + const fr = [ /* good lazy nice chain */ - new Wt(0, 0, 0, 0, Qr), + new Ht(0, 0, 0, 0, ri), /* 0 store only */ - new Wt(4, 4, 8, 4, Br), + new Ht(4, 4, 8, 4, Gr), /* 1 max speed, no lazy matches */ - new Wt(4, 5, 16, 8, Br), + new Ht(4, 5, 16, 8, Gr), /* 2 */ - new Wt(4, 6, 32, 32, Br), + new Ht(4, 6, 32, 32, Gr), /* 3 */ - new Wt(4, 4, 16, 16, sr), + new Ht(4, 4, 16, 16, or), /* 4 lazy matches */ - new Wt(8, 16, 32, 32, sr), + new Ht(8, 16, 32, 32, or), /* 5 */ - new Wt(8, 16, 128, 128, sr), + new Ht(8, 16, 128, 128, or), /* 6 */ - new Wt(8, 32, 128, 256, sr), + new Ht(8, 32, 128, 256, or), /* 7 */ - new Wt(32, 128, 258, 1024, sr), + new Ht(32, 128, 258, 1024, or), /* 8 */ - new Wt(32, 258, 258, 4096, sr) + new Ht(32, 258, 258, 4096, or) /* 9 max compression */ - ], un = (C) => { - C.window_size = 2 * C.w_size, Xt(C.head), C.max_lazy_match = ur[C.level].max_lazy, C.good_match = ur[C.level].good_length, C.nice_match = ur[C.level].nice_length, C.max_chain_length = ur[C.level].max_chain, C.strstart = 0, C.block_start = 0, C.lookahead = 0, C.insert = 0, C.match_length = C.prev_length = ut - 1, C.match_available = 0, C.ins_h = 0; + ], vn = (C) => { + C.window_size = 2 * C.w_size, Zt(C.head), C.max_lazy_match = fr[C.level].max_lazy, C.good_match = fr[C.level].good_length, C.nice_match = fr[C.level].nice_length, C.max_chain_length = fr[C.level].max_chain, C.strstart = 0, C.block_start = 0, C.lookahead = 0, C.insert = 0, C.match_length = C.prev_length = ut - 1, C.match_available = 0, C.ins_h = 0; }; - function dn() { - 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 = et, 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 Uint16Array(wr * 2), this.dyn_dtree = new Uint16Array((2 * Ft + 1) * 2), this.bl_tree = new Uint16Array((2 * xr + 1) * 2), Xt(this.dyn_ltree), Xt(this.dyn_dtree), Xt(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(an + 1), this.heap = new Uint16Array(2 * Ht + 1), Xt(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Ht + 1), Xt(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; + function bn() { + 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 = et, 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 Uint16Array(Sr * 2), this.dyn_dtree = new Uint16Array((2 * zt + 1) * 2), this.bl_tree = new Uint16Array((2 * Er + 1) * 2), Zt(this.dyn_ltree), Zt(this.dyn_dtree), Zt(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(dn + 1), this.heap = new Uint16Array(2 * Vt + 1), Zt(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Vt + 1), Zt(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } - const dr = (C) => { + const mr = (C) => { if (!C) return 1; const j = C.state; - return !j || j.strm !== C || j.status !== rr && //#ifdef GZIP - j.status !== Or && //#endif - j.status !== Fr && j.status !== zr && j.status !== Ir && j.status !== Rr && j.status !== Yt && j.status !== or ? 1 : 0; - }, Jr = (C) => { - if (dr(C)) - return Qt(C, gt); + return !j || j.strm !== C || j.status !== nr && //#ifdef GZIP + j.status !== Ir && //#endif + j.status !== Pr && j.status !== Rr && j.status !== Br && j.status !== Nr && j.status !== qt && j.status !== ur ? 1 : 0; + }, ii = (C) => { + if (mr(C)) + return Jt(C, gt); C.total_in = C.total_out = 0, C.data_type = Ve; const j = C.state; return j.pending = 0, j.pending_out = 0, j.wrap < 0 && (j.wrap = -j.wrap), j.status = //#ifdef GZIP - j.wrap === 2 ? Or : ( + j.wrap === 2 ? Ir : ( //#endif - j.wrap ? rr : Yt + j.wrap ? nr : qt ), C.adler = j.wrap === 2 ? 0 : 1, j.last_flush = -2, Y(j), at; - }, ei = (C) => { - const j = Jr(C); - return j === at && un(C.state), j; - }, fn = (C, j) => dr(C) || C.state.wrap !== 2 ? gt : (C.state.gzhead = j, at), ti = (C, j, O, J, se, ie) => { + }, ni = (C) => { + const j = ii(C); + return j === at && vn(C.state), j; + }, yn = (C, j) => mr(C) || C.state.wrap !== 2 ? gt : (C.state.gzhead = j, at), ai = (C, j, O, ee, he, le) => { if (!C) return gt; - let $e = 1; - if (j === Et && (j = 6), J < 0 ? ($e = 0, J = -J) : J > 15 && ($e = 2, J -= 16), se < 1 || se > _t || O !== et || J < 8 || J > 15 || j < 0 || j > 9 || ie < 0 || ie > qe || J === 8 && $e !== 1) - return Qt(C, gt); - J === 8 && (J = 9); - const Ee = new dn(); - return C.state = Ee, Ee.strm = C, Ee.status = rr, Ee.wrap = $e, Ee.gzhead = null, Ee.w_bits = J, Ee.w_size = 1 << Ee.w_bits, Ee.w_mask = Ee.w_size - 1, Ee.hash_bits = se + 7, Ee.hash_size = 1 << Ee.hash_bits, Ee.hash_mask = Ee.hash_size - 1, Ee.hash_shift = ~~((Ee.hash_bits + ut - 1) / ut), Ee.window = new Uint8Array(Ee.w_size * 2), Ee.head = new Uint16Array(Ee.hash_size), Ee.prev = new Uint16Array(Ee.w_size), Ee.lit_bufsize = 1 << se + 6, Ee.pending_buf_size = Ee.lit_bufsize * 4, Ee.pending_buf = new Uint8Array(Ee.pending_buf_size), Ee.sym_buf = Ee.lit_bufsize, Ee.sym_end = (Ee.lit_bufsize - 1) * 3, Ee.level = j, Ee.strategy = ie, Ee.method = O, ei(C); - }, mn = (C, j) => ti(C, j, et, kt, Tt, be), pn = (C, j) => { - if (dr(C) || j > ot || j < 0) - return C ? Qt(C, gt) : gt; + let Le = 1; + if (j === Et && (j = 6), ee < 0 ? (Le = 0, ee = -ee) : ee > 15 && (Le = 2, ee -= 16), he < 1 || he > _t || O !== et || ee < 8 || ee > 15 || j < 0 || j > 9 || le < 0 || le > qe || ee === 8 && Le !== 1) + return Jt(C, gt); + ee === 8 && (ee = 9); + const Se = new bn(); + return C.state = Se, Se.strm = C, Se.status = nr, Se.wrap = Le, Se.gzhead = null, Se.w_bits = ee, Se.w_size = 1 << Se.w_bits, Se.w_mask = Se.w_size - 1, Se.hash_bits = he + 7, Se.hash_size = 1 << Se.hash_bits, Se.hash_mask = Se.hash_size - 1, Se.hash_shift = ~~((Se.hash_bits + ut - 1) / ut), Se.window = new Uint8Array(Se.w_size * 2), Se.head = new Uint16Array(Se.hash_size), Se.prev = new Uint16Array(Se.w_size), Se.lit_bufsize = 1 << he + 6, Se.pending_buf_size = Se.lit_bufsize * 4, Se.pending_buf = new Uint8Array(Se.pending_buf_size), Se.sym_buf = Se.lit_bufsize, Se.sym_end = (Se.lit_bufsize - 1) * 3, Se.level = j, Se.strategy = le, Se.method = O, ni(C); + }, xn = (C, j) => ai(C, j, et, $t, kt, be), wn = (C, j) => { + if (mr(C) || j > ot || j < 0) + return C ? Jt(C, gt) : gt; const O = C.state; - if (!C.output || C.avail_in !== 0 && !C.input || O.status === or && j !== st) - return Qt(C, C.avail_out === 0 ? Pt : gt); - const J = O.last_flush; + if (!C.output || C.avail_in !== 0 && !C.input || O.status === ur && j !== st) + return Jt(C, C.avail_out === 0 ? Bt : gt); + const ee = O.last_flush; if (O.last_flush = j, O.pending !== 0) { - if (Bt(C), C.avail_out === 0) + if (Nt(C), C.avail_out === 0) return O.last_flush = -1, at; - } else if (C.avail_in === 0 && Yr(j) <= Yr(J) && j !== st) - return Qt(C, Pt); - if (O.status === or && C.avail_in !== 0) - return Qt(C, Pt); - if (O.status === rr && O.wrap === 0 && (O.status = Yt), O.status === rr) { - let se = et + (O.w_bits - 8 << 4) << 8, ie = -1; - if (O.strategy >= yt || O.level < 2 ? ie = 0 : O.level < 6 ? ie = 1 : O.level === 6 ? ie = 2 : ie = 3, se |= ie << 6, O.strstart !== 0 && (se |= sn), se += 31 - se % 31, cr(O, se), O.strstart !== 0 && (cr(O, C.adler >>> 16), cr(O, C.adler & 65535)), C.adler = 1, O.status = Yt, Bt(C), O.pending !== 0) + } else if (C.avail_in === 0 && ei(j) <= ei(ee) && j !== st) + return Jt(C, Bt); + if (O.status === ur && C.avail_in !== 0) + return Jt(C, Bt); + if (O.status === nr && O.wrap === 0 && (O.status = qt), O.status === nr) { + let he = et + (O.w_bits - 8 << 4) << 8, le = -1; + if (O.strategy >= yt || O.level < 2 ? le = 0 : O.level < 6 ? le = 1 : O.level === 6 ? le = 2 : le = 3, he |= le << 6, O.strstart !== 0 && (he |= fn), he += 31 - he % 31, dr(O, he), O.strstart !== 0 && (dr(O, C.adler >>> 16), dr(O, C.adler & 65535)), C.adler = 1, O.status = qt, Nt(C), O.pending !== 0) return O.last_flush = -1, at; } - if (O.status === Or) { + if (O.status === Ir) { if (C.adler = 0, vt(O, 31), vt(O, 139), vt(O, 8), O.gzhead) vt( 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) - ), vt(O, O.gzhead.time & 255), vt(O, O.gzhead.time >> 8 & 255), vt(O, O.gzhead.time >> 16 & 255), vt(O, O.gzhead.time >> 24 & 255), vt(O, O.level === 9 ? 2 : O.strategy >= yt || O.level < 2 ? 4 : 0), vt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (vt(O, O.gzhead.extra.length & 255), vt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (C.adler = I(C.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Fr; - else if (vt(O, 0), vt(O, 0), vt(O, 0), vt(O, 0), vt(O, 0), vt(O, O.level === 9 ? 2 : O.strategy >= yt || O.level < 2 ? 4 : 0), vt(O, ln), O.status = Yt, Bt(C), O.pending !== 0) + ), vt(O, O.gzhead.time & 255), vt(O, O.gzhead.time >> 8 & 255), vt(O, O.gzhead.time >> 16 & 255), vt(O, O.gzhead.time >> 24 & 255), vt(O, O.level === 9 ? 2 : O.strategy >= yt || O.level < 2 ? 4 : 0), vt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (vt(O, O.gzhead.extra.length & 255), vt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (C.adler = z(C.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Pr; + else if (vt(O, 0), vt(O, 0), vt(O, 0), vt(O, 0), vt(O, 0), vt(O, O.level === 9 ? 2 : O.strategy >= yt || O.level < 2 ? 4 : 0), vt(O, mn), O.status = qt, Nt(C), O.pending !== 0) return O.last_flush = -1, at; } - if (O.status === Fr) { + if (O.status === Pr) { if (O.gzhead.extra) { - let se = O.pending, ie = (O.gzhead.extra.length & 65535) - O.gzindex; - for (; O.pending + ie > O.pending_buf_size; ) { - let Ee = O.pending_buf_size - O.pending; - if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + Ee), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), O.gzindex += Ee, Bt(C), O.pending !== 0) + let he = O.pending, le = (O.gzhead.extra.length & 65535) - O.gzindex; + for (; O.pending + le > O.pending_buf_size; ) { + let Se = O.pending_buf_size - O.pending; + if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + Se), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)), O.gzindex += Se, Nt(C), O.pending !== 0) return O.last_flush = -1, at; - se = 0, ie -= Ee; + he = 0, le -= Se; } - let $e = new Uint8Array(O.gzhead.extra); - O.pending_buf.set($e.subarray(O.gzindex, O.gzindex + ie), O.pending), O.pending += ie, O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), O.gzindex = 0; + let Le = new Uint8Array(O.gzhead.extra); + O.pending_buf.set(Le.subarray(O.gzindex, O.gzindex + le), O.pending), O.pending += le, O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)), O.gzindex = 0; } - O.status = zr; + O.status = Rr; } - if (O.status === zr) { + if (O.status === Rr) { if (O.gzhead.name) { - let se = O.pending, ie; + let he = O.pending, le; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), Bt(C), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)), Nt(C), O.pending !== 0) return O.last_flush = -1, at; - se = 0; + he = 0; } - O.gzindex < O.gzhead.name.length ? ie = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : ie = 0, vt(O, ie); - } while (ie !== 0); - O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), O.gzindex = 0; + O.gzindex < O.gzhead.name.length ? le = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : le = 0, vt(O, le); + } while (le !== 0); + O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)), O.gzindex = 0; } - O.status = Ir; + O.status = Br; } - if (O.status === Ir) { + if (O.status === Br) { if (O.gzhead.comment) { - let se = O.pending, ie; + let he = O.pending, le; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), Bt(C), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)), Nt(C), O.pending !== 0) return O.last_flush = -1, at; - se = 0; + he = 0; } - O.gzindex < O.gzhead.comment.length ? ie = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : ie = 0, vt(O, ie); - } while (ie !== 0); - O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)); + O.gzindex < O.gzhead.comment.length ? le = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : le = 0, vt(O, le); + } while (le !== 0); + O.gzhead.hcrc && O.pending > he && (C.adler = z(C.adler, O.pending_buf, O.pending - he, he)); } - O.status = Rr; + O.status = Nr; } - if (O.status === Rr) { + if (O.status === Nr) { if (O.gzhead.hcrc) { - if (O.pending + 2 > O.pending_buf_size && (Bt(C), O.pending !== 0)) + if (O.pending + 2 > O.pending_buf_size && (Nt(C), O.pending !== 0)) return O.last_flush = -1, at; vt(O, C.adler & 255), vt(O, C.adler >> 8 & 255), C.adler = 0; } - if (O.status = Yt, Bt(C), O.pending !== 0) + if (O.status = qt, Nt(C), O.pending !== 0) return O.last_flush = -1, at; } - if (C.avail_in !== 0 || O.lookahead !== 0 || j !== Ke && O.status !== or) { - let se = O.level === 0 ? Qr(O, j) : O.strategy === yt ? cn(O, j) : O.strategy === zt ? hn(O, j) : ur[O.level].func(O, j); - if ((se === qt || se === nr) && (O.status = or), se === Rt || se === qt) + if (C.avail_in !== 0 || O.lookahead !== 0 || j !== Ke && O.status !== ur) { + let he = O.level === 0 ? ri(O, j) : O.strategy === yt ? _n(O, j) : O.strategy === It ? gn(O, j) : fr[O.level].func(O, j); + if ((he === Qt || he === sr) && (O.status = ur), he === Rt || he === Qt) return C.avail_out === 0 && (O.last_flush = -1), at; - if (se === ir && (j === rt ? Ze(O) : j !== ot && (de(O, 0, 0, !1), j === wt && (Xt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), Bt(C), C.avail_out === 0)) + if (he === ar && (j === rt ? Ze(O) : j !== ot && (fe(O, 0, 0, !1), j === wt && (Zt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), Nt(C), C.avail_out === 0)) return O.last_flush = -1, at; } - return j !== st ? at : O.wrap <= 0 ? Mt : (O.wrap === 2 ? (vt(O, C.adler & 255), vt(O, C.adler >> 8 & 255), vt(O, C.adler >> 16 & 255), vt(O, C.adler >> 24 & 255), vt(O, C.total_in & 255), vt(O, C.total_in >> 8 & 255), vt(O, C.total_in >> 16 & 255), vt(O, C.total_in >> 24 & 255)) : (cr(O, C.adler >>> 16), cr(O, C.adler & 65535)), Bt(C), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? at : Mt); - }, gn = (C) => { - if (dr(C)) + return j !== st ? at : O.wrap <= 0 ? Mt : (O.wrap === 2 ? (vt(O, C.adler & 255), vt(O, C.adler >> 8 & 255), vt(O, C.adler >> 16 & 255), vt(O, C.adler >> 24 & 255), vt(O, C.total_in & 255), vt(O, C.total_in >> 8 & 255), vt(O, C.total_in >> 16 & 255), vt(O, C.total_in >> 24 & 255)) : (dr(O, C.adler >>> 16), dr(O, C.adler & 65535)), Nt(C), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? at : Mt); + }, En = (C) => { + if (mr(C)) return gt; const j = C.state.status; - return C.state = null, j === Yt ? Qt(C, $t) : at; - }, _n = (C, j) => { + return C.state = null, j === qt ? Jt(C, Lt) : at; + }, Sn = (C, j) => { let O = j.length; - if (dr(C)) + if (mr(C)) return gt; - const J = C.state, se = J.wrap; - if (se === 2 || se === 1 && J.status !== rr || J.lookahead) + const ee = C.state, he = ee.wrap; + if (he === 2 || he === 1 && ee.status !== nr || ee.lookahead) return gt; - if (se === 1 && (C.adler = Ce(C.adler, j, O, 0)), J.wrap = 0, O >= J.w_size) { - se === 0 && (Xt(J.head), J.strstart = 0, J.block_start = 0, J.insert = 0); - let tt = new Uint8Array(J.w_size); - tt.set(j.subarray(O - J.w_size, O), 0), j = tt, O = J.w_size; - } - const ie = C.avail_in, $e = C.next_in, Ee = C.input; - for (C.avail_in = O, C.next_in = 0, C.input = j, ar(J); J.lookahead >= ut; ) { - let tt = J.strstart, _e = J.lookahead - (ut - 1); + if (he === 1 && (C.adler = Te(C.adler, j, O, 0)), ee.wrap = 0, O >= ee.w_size) { + he === 0 && (Zt(ee.head), ee.strstart = 0, ee.block_start = 0, ee.insert = 0); + let tt = new Uint8Array(ee.w_size); + tt.set(j.subarray(O - ee.w_size, O), 0), j = tt, O = ee.w_size; + } + const le = C.avail_in, Le = C.next_in, Se = C.input; + for (C.avail_in = O, C.next_in = 0, C.input = j, lr(ee); ee.lookahead >= ut; ) { + let tt = ee.strstart, _e = ee.lookahead - (ut - 1); do - J.ins_h = Zt(J, J.ins_h, J.window[tt + ut - 1]), J.prev[tt & J.w_mask] = J.head[J.ins_h], J.head[J.ins_h] = tt, tt++; + ee.ins_h = Yt(ee, ee.ins_h, ee.window[tt + ut - 1]), ee.prev[tt & ee.w_mask] = ee.head[ee.ins_h], ee.head[ee.ins_h] = tt, tt++; while (--_e); - J.strstart = tt, J.lookahead = ut - 1, ar(J); + ee.strstart = tt, ee.lookahead = ut - 1, lr(ee); } - return J.strstart += J.lookahead, J.block_start = J.strstart, J.insert = J.lookahead, J.lookahead = 0, J.match_length = J.prev_length = ut - 1, J.match_available = 0, C.next_in = $e, C.input = Ee, C.avail_in = ie, J.wrap = se, at; + return ee.strstart += ee.lookahead, ee.block_start = ee.strstart, ee.insert = ee.lookahead, ee.lookahead = 0, ee.match_length = ee.prev_length = ut - 1, ee.match_available = 0, C.next_in = Le, C.input = Se, C.avail_in = le, ee.wrap = he, at; }; - var vn = mn, bn = ti, yn = ei, xn = Jr, wn = fn, En = pn, Sn = gn, An = _n, Mn = "pako deflate (from Nodeca project)", fr = { - deflateInit: vn, - deflateInit2: bn, - deflateReset: yn, - deflateResetKeep: xn, - deflateSetHeader: wn, - deflate: En, - deflateEnd: Sn, - deflateSetDictionary: An, - deflateInfo: Mn + var An = xn, Mn = ai, Dn = ni, Cn = ii, Tn = yn, kn = wn, $n = En, Ln = Sn, On = "pako deflate (from Nodeca project)", pr = { + deflateInit: An, + deflateInit2: Mn, + deflateReset: Dn, + deflateResetKeep: Cn, + deflateSetHeader: Tn, + deflate: kn, + deflateEnd: $n, + deflateSetDictionary: Ln, + deflateInfo: On }; - const Dn = (C, j) => Object.prototype.hasOwnProperty.call(C, j); - var Cn = function(C) { + const Fn = (C, j) => Object.prototype.hasOwnProperty.call(C, j); + var zn = function(C) { 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"); - for (const J in O) - Dn(O, J) && (C[J] = O[J]); + for (const ee in O) + Fn(O, ee) && (C[ee] = O[ee]); } } return C; - }, Tn = (C) => { + }, In = (C) => { let j = 0; - for (let J = 0, se = C.length; J < se; J++) - j += C[J].length; + for (let ee = 0, he = C.length; ee < he; ee++) + j += C[ee].length; const O = new Uint8Array(j); - for (let J = 0, se = 0, ie = C.length; J < ie; J++) { - let $e = C[J]; - O.set($e, se), se += $e.length; + for (let ee = 0, he = 0, le = C.length; ee < le; ee++) { + let Le = C[ee]; + O.set(Le, he), he += Le.length; } return O; - }, Er = { - assign: Cn, - flattenChunks: Tn + }, Ar = { + assign: zn, + flattenChunks: In }; - let ri = !0; + let si = !0; try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch { - ri = !1; + si = !1; } - const mr = new Uint8Array(256); + const gr = new Uint8Array(256); for (let C = 0; C < 256; C++) - mr[C] = C >= 252 ? 6 : C >= 248 ? 5 : C >= 240 ? 4 : C >= 224 ? 3 : C >= 192 ? 2 : 1; - mr[254] = mr[254] = 1; - var kn = (C) => { + gr[C] = C >= 252 ? 6 : C >= 248 ? 5 : C >= 240 ? 4 : C >= 224 ? 3 : C >= 192 ? 2 : 1; + gr[254] = gr[254] = 1; + var Pn = (C) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) return new TextEncoder().encode(C); - let j, O, J, se, ie, $e = C.length, Ee = 0; - for (se = 0; se < $e; se++) - O = C.charCodeAt(se), (O & 64512) === 55296 && se + 1 < $e && (J = C.charCodeAt(se + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), se++)), Ee += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; - for (j = new Uint8Array(Ee), ie = 0, se = 0; ie < Ee; se++) - O = C.charCodeAt(se), (O & 64512) === 55296 && se + 1 < $e && (J = C.charCodeAt(se + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), se++)), O < 128 ? j[ie++] = O : O < 2048 ? (j[ie++] = 192 | O >>> 6, j[ie++] = 128 | O & 63) : O < 65536 ? (j[ie++] = 224 | O >>> 12, j[ie++] = 128 | O >>> 6 & 63, j[ie++] = 128 | O & 63) : (j[ie++] = 240 | O >>> 18, j[ie++] = 128 | O >>> 12 & 63, j[ie++] = 128 | O >>> 6 & 63, j[ie++] = 128 | O & 63); + let j, O, ee, he, le, Le = C.length, Se = 0; + for (he = 0; he < Le; he++) + O = C.charCodeAt(he), (O & 64512) === 55296 && he + 1 < Le && (ee = C.charCodeAt(he + 1), (ee & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (ee - 56320), he++)), Se += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; + for (j = new Uint8Array(Se), le = 0, he = 0; le < Se; he++) + O = C.charCodeAt(he), (O & 64512) === 55296 && he + 1 < Le && (ee = C.charCodeAt(he + 1), (ee & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (ee - 56320), he++)), O < 128 ? j[le++] = O : O < 2048 ? (j[le++] = 192 | O >>> 6, j[le++] = 128 | O & 63) : O < 65536 ? (j[le++] = 224 | O >>> 12, j[le++] = 128 | O >>> 6 & 63, j[le++] = 128 | O & 63) : (j[le++] = 240 | O >>> 18, j[le++] = 128 | O >>> 12 & 63, j[le++] = 128 | O >>> 6 & 63, j[le++] = 128 | O & 63); return j; }; - const $n = (C, j) => { - if (j < 65534 && C.subarray && ri) + const Rn = (C, j) => { + if (j < 65534 && C.subarray && si) return String.fromCharCode.apply(null, C.length === j ? C : C.subarray(0, j)); let O = ""; - for (let J = 0; J < j; J++) - O += String.fromCharCode(C[J]); + for (let ee = 0; ee < j; ee++) + O += String.fromCharCode(C[ee]); return O; }; - var Ln = (C, j) => { + var Bn = (C, j) => { const O = j || C.length; if (typeof TextDecoder == "function" && TextDecoder.prototype.decode) return new TextDecoder().decode(C.subarray(0, j)); - let J, se; - const ie = new Array(O * 2); - for (se = 0, J = 0; J < O; ) { - let $e = C[J++]; - if ($e < 128) { - ie[se++] = $e; + let ee, he; + const le = new Array(O * 2); + for (he = 0, ee = 0; ee < O; ) { + let Le = C[ee++]; + if (Le < 128) { + le[he++] = Le; continue; } - let Ee = mr[$e]; - if (Ee > 4) { - ie[se++] = 65533, J += Ee - 1; + let Se = gr[Le]; + if (Se > 4) { + le[he++] = 65533, ee += Se - 1; continue; } - for ($e &= Ee === 2 ? 31 : Ee === 3 ? 15 : 7; Ee > 1 && J < O; ) - $e = $e << 6 | C[J++] & 63, Ee--; - if (Ee > 1) { - ie[se++] = 65533; + for (Le &= Se === 2 ? 31 : Se === 3 ? 15 : 7; Se > 1 && ee < O; ) + Le = Le << 6 | C[ee++] & 63, Se--; + if (Se > 1) { + le[he++] = 65533; continue; } - $e < 65536 ? ie[se++] = $e : ($e -= 65536, ie[se++] = 55296 | $e >> 10 & 1023, ie[se++] = 56320 | $e & 1023); + Le < 65536 ? le[he++] = Le : (Le -= 65536, le[he++] = 55296 | Le >> 10 & 1023, le[he++] = 56320 | Le & 1023); } - return $n(ie, se); - }, On = (C, j) => { + return Rn(le, he); + }, Nn = (C, j) => { j = j || C.length, j > C.length && (j = C.length); let O = j - 1; for (; O >= 0 && (C[O] & 192) === 128; ) O--; - return O < 0 || O === 0 ? j : O + mr[C[O]] > j ? O : j; - }, pr = { - string2buf: kn, - buf2string: Ln, - utf8border: On + return O < 0 || O === 0 ? j : O + gr[C[O]] > j ? O : j; + }, _r = { + string2buf: Pn, + buf2string: Bn, + utf8border: Nn }; - function Fn() { + function Un() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; } - var ii = Fn; - const ni = Object.prototype.toString, { - Z_NO_FLUSH: zn, - Z_SYNC_FLUSH: In, - Z_FULL_FLUSH: Rn, - Z_FINISH: Pn, - Z_OK: Sr, - Z_STREAM_END: Bn, - Z_DEFAULT_COMPRESSION: Nn, - Z_DEFAULT_STRATEGY: Un, - Z_DEFLATED: Gn + var li = Un; + const oi = Object.prototype.toString, { + Z_NO_FLUSH: Gn, + Z_SYNC_FLUSH: Wn, + Z_FULL_FLUSH: Hn, + Z_FINISH: Vn, + Z_OK: Mr, + Z_STREAM_END: jn, + Z_DEFAULT_COMPRESSION: Kn, + Z_DEFAULT_STRATEGY: Xn, + Z_DEFLATED: Zn } = ve; - function gr(C) { - this.options = Er.assign({ - level: Nn, - method: Gn, + function vr(C) { + this.options = Ar.assign({ + level: Kn, + method: Zn, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Un + strategy: Xn }, C || {}); 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 ii(), this.strm.avail_out = 0; - let O = fr.deflateInit2( + 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 li(), this.strm.avail_out = 0; + let O = pr.deflateInit2( this.strm, j.level, j.method, @@ -41345,129 +41367,129 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; j.memLevel, j.strategy ); - if (O !== Sr) - throw new Error(we[O]); - if (j.header && fr.deflateSetHeader(this.strm, j.header), j.dictionary) { - let J; - if (typeof j.dictionary == "string" ? J = pr.string2buf(j.dictionary) : ni.call(j.dictionary) === "[object ArrayBuffer]" ? J = new Uint8Array(j.dictionary) : J = j.dictionary, O = fr.deflateSetDictionary(this.strm, J), O !== Sr) - throw new Error(we[O]); + if (O !== Mr) + throw new Error(Ee[O]); + if (j.header && pr.deflateSetHeader(this.strm, j.header), j.dictionary) { + let ee; + if (typeof j.dictionary == "string" ? ee = _r.string2buf(j.dictionary) : oi.call(j.dictionary) === "[object ArrayBuffer]" ? ee = new Uint8Array(j.dictionary) : ee = j.dictionary, O = pr.deflateSetDictionary(this.strm, ee), O !== Mr) + throw new Error(Ee[O]); this._dict_set = !0; } } - gr.prototype.push = function(C, j) { - const O = this.strm, J = this.options.chunkSize; - let se, ie; + vr.prototype.push = function(C, j) { + const O = this.strm, ee = this.options.chunkSize; + let he, le; if (this.ended) return !1; - for (j === ~~j ? ie = j : ie = j === !0 ? Pn : zn, typeof C == "string" ? O.input = pr.string2buf(C) : ni.call(C) === "[object ArrayBuffer]" ? O.input = new Uint8Array(C) : O.input = C, 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), (ie === In || ie === Rn) && O.avail_out <= 6) { + for (j === ~~j ? le = j : le = j === !0 ? Vn : Gn, typeof C == "string" ? O.input = _r.string2buf(C) : oi.call(C) === "[object ArrayBuffer]" ? O.input = new Uint8Array(C) : O.input = C, O.next_in = 0, O.avail_in = O.input.length; ; ) { + if (O.avail_out === 0 && (O.output = new Uint8Array(ee), O.next_out = 0, O.avail_out = ee), (le === Wn || le === Hn) && O.avail_out <= 6) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } - if (se = fr.deflate(O, ie), se === Bn) - return O.next_out > 0 && this.onData(O.output.subarray(0, O.next_out)), se = fr.deflateEnd(this.strm), this.onEnd(se), this.ended = !0, se === Sr; + if (he = pr.deflate(O, le), he === jn) + return O.next_out > 0 && this.onData(O.output.subarray(0, O.next_out)), he = pr.deflateEnd(this.strm), this.onEnd(he), this.ended = !0, he === Mr; if (O.avail_out === 0) { this.onData(O.output); continue; } - if (ie > 0 && O.next_out > 0) { + if (le > 0 && O.next_out > 0) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } if (O.avail_in === 0) break; } return !0; - }, gr.prototype.onData = function(C) { + }, vr.prototype.onData = function(C) { this.chunks.push(C); - }, gr.prototype.onEnd = function(C) { - C === Sr && (this.result = Er.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg; + }, vr.prototype.onEnd = function(C) { + C === Mr && (this.result = Ar.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg; }; - function Nr(C, j) { - const O = new gr(j); + function Wr(C, j) { + const O = new vr(j); if (O.push(C, !0), O.err) - throw O.msg || we[O.err]; + throw O.msg || Ee[O.err]; return O.result; } - function Wn(C, j) { - return j = j || {}, j.raw = !0, Nr(C, j); + function Yn(C, j) { + return j = j || {}, j.raw = !0, Wr(C, j); } - function Hn(C, j) { - return j = j || {}, j.gzip = !0, Nr(C, j); + function qn(C, j) { + return j = j || {}, j.gzip = !0, Wr(C, j); } - var Vn = gr, jn = Nr, Kn = Wn, Xn = Hn, Zn = ve, Yn = { - Deflate: Vn, - deflate: jn, - deflateRaw: Kn, - gzip: Xn, - constants: Zn + var Qn = vr, Jn = Wr, ea = Yn, ta = qn, ra = ve, ia = { + Deflate: Qn, + deflate: Jn, + deflateRaw: ea, + gzip: ta, + constants: ra }; - const Ar = 16209, qn = 16191; - var Qn = function(j, O) { - let J, se, ie, $e, Ee, tt, _e, Le, pt, Je, He, it, Ct, ft, ht, xt, ct, Qe, bt, Ot, nt, At, mt, lt; + const Dr = 16209, na = 16191; + var aa = function(j, O) { + let ee, he, le, Le, Se, tt, _e, Oe, pt, Je, He, it, Tt, ft, ht, xt, ct, Qe, bt, Ft, nt, At, mt, lt; const dt = j.state; - J = j.next_in, mt = j.input, se = J + (j.avail_in - 5), ie = j.next_out, lt = j.output, $e = ie - (O - j.avail_out), Ee = ie + (j.avail_out - 257), tt = dt.dmax, _e = dt.wsize, Le = dt.whave, pt = dt.wnext, Je = dt.window, He = dt.hold, it = dt.bits, Ct = dt.lencode, ft = dt.distcode, ht = (1 << dt.lenbits) - 1, xt = (1 << dt.distbits) - 1; + ee = j.next_in, mt = j.input, he = ee + (j.avail_in - 5), le = j.next_out, lt = j.output, Le = le - (O - j.avail_out), Se = le + (j.avail_out - 257), tt = dt.dmax, _e = dt.wsize, Oe = dt.whave, pt = dt.wnext, Je = dt.window, He = dt.hold, it = dt.bits, Tt = dt.lencode, ft = dt.distcode, ht = (1 << dt.lenbits) - 1, xt = (1 << dt.distbits) - 1; e: do { - it < 15 && (He += mt[J++] << it, it += 8, He += mt[J++] << it, it += 8), ct = Ct[He & ht]; + it < 15 && (He += mt[ee++] << it, it += 8, He += mt[ee++] << it, it += 8), ct = Tt[He & ht]; t: for (; ; ) { if (Qe = ct >>> 24, He >>>= Qe, it -= Qe, Qe = ct >>> 16 & 255, Qe === 0) - lt[ie++] = ct & 65535; + lt[le++] = ct & 65535; else if (Qe & 16) { - bt = ct & 65535, Qe &= 15, Qe && (it < Qe && (He += mt[J++] << it, it += 8), bt += He & (1 << Qe) - 1, He >>>= Qe, it -= Qe), it < 15 && (He += mt[J++] << it, it += 8, He += mt[J++] << it, it += 8), ct = ft[He & xt]; + bt = ct & 65535, Qe &= 15, Qe && (it < Qe && (He += mt[ee++] << it, it += 8), bt += He & (1 << Qe) - 1, He >>>= Qe, it -= Qe), it < 15 && (He += mt[ee++] << it, it += 8, He += mt[ee++] << it, it += 8), ct = ft[He & xt]; r: for (; ; ) { if (Qe = ct >>> 24, He >>>= Qe, it -= Qe, Qe = ct >>> 16 & 255, Qe & 16) { - if (Ot = ct & 65535, Qe &= 15, it < Qe && (He += mt[J++] << it, it += 8, it < Qe && (He += mt[J++] << it, it += 8)), Ot += He & (1 << Qe) - 1, Ot > tt) { - j.msg = "invalid distance too far back", dt.mode = Ar; + if (Ft = ct & 65535, Qe &= 15, it < Qe && (He += mt[ee++] << it, it += 8, it < Qe && (He += mt[ee++] << it, it += 8)), Ft += He & (1 << Qe) - 1, Ft > tt) { + j.msg = "invalid distance too far back", dt.mode = Dr; break e; } - if (He >>>= Qe, it -= Qe, Qe = ie - $e, Ot > Qe) { - if (Qe = Ot - Qe, Qe > Le && dt.sane) { - j.msg = "invalid distance too far back", dt.mode = Ar; + if (He >>>= Qe, it -= Qe, Qe = le - Le, Ft > Qe) { + if (Qe = Ft - Qe, Qe > Oe && dt.sane) { + j.msg = "invalid distance too far back", dt.mode = Dr; break e; } if (nt = 0, At = Je, pt === 0) { if (nt += _e - Qe, Qe < bt) { bt -= Qe; do - lt[ie++] = Je[nt++]; + lt[le++] = Je[nt++]; while (--Qe); - nt = ie - Ot, At = lt; + nt = le - Ft, At = lt; } } else if (pt < Qe) { if (nt += _e + pt - Qe, Qe -= pt, Qe < bt) { bt -= Qe; do - lt[ie++] = Je[nt++]; + lt[le++] = Je[nt++]; while (--Qe); if (nt = 0, pt < bt) { Qe = pt, bt -= Qe; do - lt[ie++] = Je[nt++]; + lt[le++] = Je[nt++]; while (--Qe); - nt = ie - Ot, At = lt; + nt = le - Ft, At = lt; } } } else if (nt += pt - Qe, Qe < bt) { bt -= Qe; do - lt[ie++] = Je[nt++]; + lt[le++] = Je[nt++]; while (--Qe); - nt = ie - Ot, At = lt; + nt = le - Ft, At = lt; } for (; bt > 2; ) - lt[ie++] = At[nt++], lt[ie++] = At[nt++], lt[ie++] = At[nt++], bt -= 3; - bt && (lt[ie++] = At[nt++], bt > 1 && (lt[ie++] = At[nt++])); + lt[le++] = At[nt++], lt[le++] = At[nt++], lt[le++] = At[nt++], bt -= 3; + bt && (lt[le++] = At[nt++], bt > 1 && (lt[le++] = At[nt++])); } else { - nt = ie - Ot; + nt = le - Ft; do - lt[ie++] = lt[nt++], lt[ie++] = lt[nt++], lt[ie++] = lt[nt++], bt -= 3; + lt[le++] = lt[nt++], lt[le++] = lt[nt++], lt[le++] = lt[nt++], bt -= 3; while (bt > 2); - bt && (lt[ie++] = lt[nt++], bt > 1 && (lt[ie++] = lt[nt++])); + bt && (lt[le++] = lt[nt++], bt > 1 && (lt[le++] = lt[nt++])); } } else if (Qe & 64) { - j.msg = "invalid distance code", dt.mode = Ar; + j.msg = "invalid distance code", dt.mode = Dr; break e; } else { ct = ft[(ct & 65535) + (He & (1 << Qe) - 1)]; @@ -41477,22 +41499,22 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } } else if (Qe & 64) if (Qe & 32) { - dt.mode = qn; + dt.mode = na; break e; } else { - j.msg = "invalid literal/length code", dt.mode = Ar; + j.msg = "invalid literal/length code", dt.mode = Dr; break e; } else { - ct = Ct[(ct & 65535) + (He & (1 << Qe) - 1)]; + ct = Tt[(ct & 65535) + (He & (1 << Qe) - 1)]; continue t; } break; } - } while (J < se && ie < Ee); - bt = it >> 3, J -= bt, it -= bt << 3, He &= (1 << it) - 1, j.next_in = J, j.next_out = ie, j.avail_in = J < se ? 5 + (se - J) : 5 - (J - se), j.avail_out = ie < Ee ? 257 + (Ee - ie) : 257 - (ie - Ee), dt.hold = He, dt.bits = it; + } while (ee < he && le < Se); + bt = it >> 3, ee -= bt, it -= bt << 3, He &= (1 << it) - 1, j.next_in = ee, j.next_out = le, j.avail_in = ee < he ? 5 + (he - ee) : 5 - (ee - he), j.avail_out = le < Se ? 257 + (Se - le) : 257 - (le - Se), dt.hold = He, dt.bits = it; }; - const lr = 15, ai = 852, si = 592, li = 0, Ur = 1, oi = 2, Jn = new Uint16Array([ + const cr = 15, hi = 852, ci = 592, ui = 0, Hr = 1, di = 2, sa = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, @@ -41525,7 +41547,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 258, 0, 0 - ]), ea = new Uint8Array([ + ]), la = new Uint8Array([ /* Length codes 257..285 extra */ 16, 16, @@ -41558,7 +41580,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 16, 72, 78 - ]), ta = new Uint16Array([ + ]), oa = new Uint16Array([ /* Distance codes 0..29 base */ 1, 2, @@ -41592,7 +41614,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 24577, 0, 0 - ]), ra = new Uint8Array([ + ]), ha = new Uint8Array([ /* Distance codes 0..29 extra */ 16, 16, @@ -41627,103 +41649,103 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 64, 64 ]); - var _r = (C, j, O, J, se, ie, $e, Ee) => { - const tt = Ee.bits; - let _e = 0, Le = 0, pt = 0, Je = 0, He = 0, it = 0, Ct = 0, ft = 0, ht = 0, xt = 0, ct, Qe, bt, Ot, nt, At = null, mt; - const lt = new Uint16Array(lr + 1), dt = new Uint16Array(lr + 1); - let tr = null, nn, $r, Lr; - for (_e = 0; _e <= lr; _e++) + var yr = (C, j, O, ee, he, le, Le, Se) => { + const tt = Se.bits; + let _e = 0, Oe = 0, pt = 0, Je = 0, He = 0, it = 0, Tt = 0, ft = 0, ht = 0, xt = 0, ct, Qe, bt, Ft, nt, At = null, mt; + const lt = new Uint16Array(cr + 1), dt = new Uint16Array(cr + 1); + let rr = null, on, Or, Fr; + for (_e = 0; _e <= cr; _e++) lt[_e] = 0; - for (Le = 0; Le < J; Le++) - lt[j[O + Le]]++; - for (He = tt, Je = lr; Je >= 1 && lt[Je] === 0; Je--) + for (Oe = 0; Oe < ee; Oe++) + lt[j[O + Oe]]++; + for (He = tt, Je = cr; Je >= 1 && lt[Je] === 0; Je--) ; if (He > Je && (He = Je), Je === 0) - return se[ie++] = 1 << 24 | 64 << 16 | 0, se[ie++] = 1 << 24 | 64 << 16 | 0, Ee.bits = 1, 0; + return he[le++] = 1 << 24 | 64 << 16 | 0, he[le++] = 1 << 24 | 64 << 16 | 0, Se.bits = 1, 0; for (pt = 1; pt < Je && lt[pt] === 0; pt++) ; - for (He < pt && (He = pt), ft = 1, _e = 1; _e <= lr; _e++) + for (He < pt && (He = pt), ft = 1, _e = 1; _e <= cr; _e++) if (ft <<= 1, ft -= lt[_e], ft < 0) return -1; - if (ft > 0 && (C === li || Je !== 1)) + if (ft > 0 && (C === ui || Je !== 1)) return -1; - for (dt[1] = 0, _e = 1; _e < lr; _e++) + for (dt[1] = 0, _e = 1; _e < cr; _e++) dt[_e + 1] = dt[_e] + lt[_e]; - for (Le = 0; Le < J; Le++) - j[O + Le] !== 0 && ($e[dt[j[O + Le]]++] = Le); - if (C === li ? (At = tr = $e, mt = 20) : C === Ur ? (At = Jn, tr = ea, mt = 257) : (At = ta, tr = ra, mt = 0), xt = 0, Le = 0, _e = pt, nt = ie, it = He, Ct = 0, bt = -1, ht = 1 << He, Ot = ht - 1, C === Ur && ht > ai || C === oi && ht > si) + for (Oe = 0; Oe < ee; Oe++) + j[O + Oe] !== 0 && (Le[dt[j[O + Oe]]++] = Oe); + if (C === ui ? (At = rr = Le, mt = 20) : C === Hr ? (At = sa, rr = la, mt = 257) : (At = oa, rr = ha, mt = 0), xt = 0, Oe = 0, _e = pt, nt = le, it = He, Tt = 0, bt = -1, ht = 1 << He, Ft = ht - 1, C === Hr && ht > hi || C === di && ht > ci) return 1; for (; ; ) { - nn = _e - Ct, $e[Le] + 1 < mt ? ($r = 0, Lr = $e[Le]) : $e[Le] >= mt ? ($r = tr[$e[Le] - mt], Lr = At[$e[Le] - mt]) : ($r = 96, Lr = 0), ct = 1 << _e - Ct, Qe = 1 << it, pt = Qe; + on = _e - Tt, Le[Oe] + 1 < mt ? (Or = 0, Fr = Le[Oe]) : Le[Oe] >= mt ? (Or = rr[Le[Oe] - mt], Fr = At[Le[Oe] - mt]) : (Or = 96, Fr = 0), ct = 1 << _e - Tt, Qe = 1 << it, pt = Qe; do - Qe -= ct, se[nt + (xt >> Ct) + Qe] = nn << 24 | $r << 16 | Lr | 0; + Qe -= ct, he[nt + (xt >> Tt) + Qe] = on << 24 | Or << 16 | Fr | 0; while (Qe !== 0); for (ct = 1 << _e - 1; xt & ct; ) ct >>= 1; - if (ct !== 0 ? (xt &= ct - 1, xt += ct) : xt = 0, Le++, --lt[_e] === 0) { + if (ct !== 0 ? (xt &= ct - 1, xt += ct) : xt = 0, Oe++, --lt[_e] === 0) { if (_e === Je) break; - _e = j[O + $e[Le]]; + _e = j[O + Le[Oe]]; } - if (_e > He && (xt & Ot) !== bt) { - for (Ct === 0 && (Ct = He), nt += pt, it = _e - Ct, ft = 1 << it; it + Ct < Je && (ft -= lt[it + Ct], !(ft <= 0)); ) + if (_e > He && (xt & Ft) !== bt) { + for (Tt === 0 && (Tt = He), nt += pt, it = _e - Tt, ft = 1 << it; it + Tt < Je && (ft -= lt[it + Tt], !(ft <= 0)); ) it++, ft <<= 1; - if (ht += 1 << it, C === Ur && ht > ai || C === oi && ht > si) + if (ht += 1 << it, C === Hr && ht > hi || C === di && ht > ci) return 1; - bt = xt & Ot, se[bt] = He << 24 | it << 16 | nt - ie | 0; + bt = xt & Ft, he[bt] = He << 24 | it << 16 | nt - le | 0; } } - return xt !== 0 && (se[nt + xt] = _e - Ct << 24 | 64 << 16 | 0), Ee.bits = He, 0; + return xt !== 0 && (he[nt + xt] = _e - Tt << 24 | 64 << 16 | 0), Se.bits = He, 0; }; - const ia = 0, hi = 1, ci = 2, { - Z_FINISH: ui, - Z_BLOCK: na, - Z_TREES: Mr, - Z_OK: Jt, - Z_STREAM_END: aa, - Z_NEED_DICT: sa, - Z_STREAM_ERROR: Ut, - Z_DATA_ERROR: di, - Z_MEM_ERROR: fi, - Z_BUF_ERROR: la, - Z_DEFLATED: mi - } = ve, Dr = 16180, pi = 16181, gi = 16182, vi = 16183, bi = 16184, yi = 16185, xi = 16186, wi = 16187, Ei = 16188, Si = 16189, Cr = 16190, Vt = 16191, Gr = 16192, Ai = 16193, Wr = 16194, Mi = 16195, Di = 16196, Ci = 16197, Ti = 16198, Tr = 16199, kr = 16200, ki = 16201, $i = 16202, Li = 16203, Oi = 16204, Fi = 16205, Hr = 16206, zi = 16207, Ii = 16208, Dt = 16209, Ri = 16210, Pi = 16211, oa = 852, ha = 592, ca = 15, Bi = (C) => (C >>> 24 & 255) + (C >>> 8 & 65280) + ((C & 65280) << 8) + ((C & 255) << 24); - function ua() { + const ca = 0, fi = 1, mi = 2, { + Z_FINISH: pi, + Z_BLOCK: ua, + Z_TREES: Cr, + Z_OK: er, + Z_STREAM_END: da, + Z_NEED_DICT: fa, + Z_STREAM_ERROR: Gt, + Z_DATA_ERROR: gi, + Z_MEM_ERROR: vi, + Z_BUF_ERROR: ma, + Z_DEFLATED: bi + } = ve, Tr = 16180, yi = 16181, xi = 16182, wi = 16183, Ei = 16184, Si = 16185, Ai = 16186, Mi = 16187, Di = 16188, Ci = 16189, kr = 16190, jt = 16191, Vr = 16192, Ti = 16193, jr = 16194, ki = 16195, $i = 16196, Li = 16197, Oi = 16198, $r = 16199, Lr = 16200, Fi = 16201, zi = 16202, Ii = 16203, Pi = 16204, Ri = 16205, Kr = 16206, Bi = 16207, Ni = 16208, Ct = 16209, Ui = 16210, Gi = 16211, pa = 852, ga = 592, _a = 15, Wi = (C) => (C >>> 24 & 255) + (C >>> 8 & 65280) + ((C & 65280) << 8) + ((C & 255) << 24); + function va() { 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 er = (C) => { + const tr = (C) => { if (!C) return 1; const j = C.state; - return !j || j.strm !== C || j.mode < Dr || j.mode > Pi ? 1 : 0; - }, Ni = (C) => { - if (er(C)) - return Ut; + return !j || j.strm !== C || j.mode < Tr || j.mode > Gi ? 1 : 0; + }, Hi = (C) => { + if (tr(C)) + return Gt; const j = C.state; - return C.total_in = C.total_out = j.total = 0, C.msg = "", j.wrap && (C.adler = j.wrap & 1), j.mode = Dr, 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(oa), j.distcode = j.distdyn = new Int32Array(ha), j.sane = 1, j.back = -1, Jt; - }, Ui = (C) => { - if (er(C)) - return Ut; + return C.total_in = C.total_out = j.total = 0, C.msg = "", j.wrap && (C.adler = j.wrap & 1), j.mode = Tr, 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(pa), j.distcode = j.distdyn = new Int32Array(ga), j.sane = 1, j.back = -1, er; + }, Vi = (C) => { + if (tr(C)) + return Gt; const j = C.state; - return j.wsize = 0, j.whave = 0, j.wnext = 0, Ni(C); - }, Gi = (C, j) => { + return j.wsize = 0, j.whave = 0, j.wnext = 0, Hi(C); + }, ji = (C, j) => { let O; - if (er(C)) - return Ut; - const J = C.state; - return j < 0 ? (O = 0, j = -j) : (O = (j >> 4) + 5, j < 48 && (j &= 15)), j && (j < 8 || j > 15) ? Ut : (J.window !== null && J.wbits !== j && (J.window = null), J.wrap = O, J.wbits = j, Ui(C)); - }, Wi = (C, j) => { + if (tr(C)) + return Gt; + const ee = C.state; + return j < 0 ? (O = 0, j = -j) : (O = (j >> 4) + 5, j < 48 && (j &= 15)), j && (j < 8 || j > 15) ? Gt : (ee.window !== null && ee.wbits !== j && (ee.window = null), ee.wrap = O, ee.wbits = j, Vi(C)); + }, Ki = (C, j) => { if (!C) - return Ut; - const O = new ua(); - C.state = O, O.strm = C, O.window = null, O.mode = Dr; - const J = Gi(C, j); - return J !== Jt && (C.state = null), J; - }, da = (C) => Wi(C, ca); - let Hi = !0, Vr, jr; - const fa = (C) => { - if (Hi) { - Vr = new Int32Array(512), jr = new Int32Array(32); + return Gt; + const O = new va(); + C.state = O, O.strm = C, O.window = null, O.mode = Tr; + const ee = ji(C, j); + return ee !== er && (C.state = null), ee; + }, ba = (C) => Ki(C, _a); + let Xi = !0, Xr, Zr; + const ya = (C) => { + if (Xi) { + Xr = new Int32Array(512), Zr = new Int32Array(32); let j = 0; for (; j < 144; ) C.lens[j++] = 8; @@ -41733,558 +41755,558 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; C.lens[j++] = 7; for (; j < 288; ) C.lens[j++] = 8; - for (_r(hi, C.lens, 0, 288, Vr, 0, C.work, { bits: 9 }), j = 0; j < 32; ) + for (yr(fi, C.lens, 0, 288, Xr, 0, C.work, { bits: 9 }), j = 0; j < 32; ) C.lens[j++] = 5; - _r(ci, C.lens, 0, 32, jr, 0, C.work, { bits: 5 }), Hi = !1; - } - C.lencode = Vr, C.lenbits = 9, C.distcode = jr, C.distbits = 5; - }, Vi = (C, j, O, J) => { - let se; - const ie = C.state; - return ie.window === null && (ie.wsize = 1 << ie.wbits, ie.wnext = 0, ie.whave = 0, ie.window = new Uint8Array(ie.wsize)), J >= ie.wsize ? (ie.window.set(j.subarray(O - ie.wsize, O), 0), ie.wnext = 0, ie.whave = ie.wsize) : (se = ie.wsize - ie.wnext, se > J && (se = J), ie.window.set(j.subarray(O - J, O - J + se), ie.wnext), J -= se, J ? (ie.window.set(j.subarray(O - J, O), 0), ie.wnext = J, ie.whave = ie.wsize) : (ie.wnext += se, ie.wnext === ie.wsize && (ie.wnext = 0), ie.whave < ie.wsize && (ie.whave += se))), 0; - }, ma = (C, j) => { - let O, J, se, ie, $e, Ee, tt, _e, Le, pt, Je, He, it, Ct, ft = 0, ht, xt, ct, Qe, bt, Ot, nt, At; + yr(mi, C.lens, 0, 32, Zr, 0, C.work, { bits: 5 }), Xi = !1; + } + C.lencode = Xr, C.lenbits = 9, C.distcode = Zr, C.distbits = 5; + }, Zi = (C, j, O, ee) => { + let he; + const le = C.state; + return le.window === null && (le.wsize = 1 << le.wbits, le.wnext = 0, le.whave = 0, le.window = new Uint8Array(le.wsize)), ee >= le.wsize ? (le.window.set(j.subarray(O - le.wsize, O), 0), le.wnext = 0, le.whave = le.wsize) : (he = le.wsize - le.wnext, he > ee && (he = ee), le.window.set(j.subarray(O - ee, O - ee + he), le.wnext), ee -= he, ee ? (le.window.set(j.subarray(O - ee, O), 0), le.wnext = ee, le.whave = le.wsize) : (le.wnext += he, le.wnext === le.wsize && (le.wnext = 0), le.whave < le.wsize && (le.whave += he))), 0; + }, xa = (C, j) => { + let O, ee, he, le, Le, Se, tt, _e, Oe, pt, Je, He, it, Tt, ft = 0, ht, xt, ct, Qe, bt, Ft, nt, At; const mt = new Uint8Array(4); let lt, dt; - const tr = ( + const rr = ( /* permutation of code lengths */ new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]) ); - if (er(C) || !C.output || !C.input && C.avail_in !== 0) - return Ut; - O = C.state, O.mode === Vt && (O.mode = Gr), $e = C.next_out, se = C.output, tt = C.avail_out, ie = C.next_in, J = C.input, Ee = C.avail_in, _e = O.hold, Le = O.bits, pt = Ee, Je = tt, At = Jt; + if (tr(C) || !C.output || !C.input && C.avail_in !== 0) + return Gt; + O = C.state, O.mode === jt && (O.mode = Vr), Le = C.next_out, he = C.output, tt = C.avail_out, le = C.next_in, ee = C.input, Se = C.avail_in, _e = O.hold, Oe = O.bits, pt = Se, Je = tt, At = er; e: for (; ; ) switch (O.mode) { - case Dr: + case Tr: if (O.wrap === 0) { - O.mode = Gr; + O.mode = Vr; break; } - for (; Le < 16; ) { - if (Ee === 0) + for (; Oe < 16; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (O.wrap & 2 && _e === 35615) { - O.wbits === 0 && (O.wbits = 15), O.check = 0, mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = I(O.check, mt, 2, 0), _e = 0, Le = 0, O.mode = pi; + O.wbits === 0 && (O.wbits = 15), O.check = 0, mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = z(O.check, mt, 2, 0), _e = 0, Oe = 0, O.mode = yi; break; } if (O.head && (O.head.done = !1), !(O.wrap & 1) || /* check if zlib header allowed */ (((_e & 255) << 8) + (_e >> 8)) % 31) { - C.msg = "incorrect header check", O.mode = Dt; + C.msg = "incorrect header check", O.mode = Ct; break; } - if ((_e & 15) !== mi) { - C.msg = "unknown compression method", O.mode = Dt; + if ((_e & 15) !== bi) { + C.msg = "unknown compression method", O.mode = Ct; break; } - if (_e >>>= 4, Le -= 4, nt = (_e & 15) + 8, O.wbits === 0 && (O.wbits = nt), nt > 15 || nt > O.wbits) { - C.msg = "invalid window size", O.mode = Dt; + if (_e >>>= 4, Oe -= 4, nt = (_e & 15) + 8, O.wbits === 0 && (O.wbits = nt), nt > 15 || nt > O.wbits) { + C.msg = "invalid window size", O.mode = Ct; break; } - O.dmax = 1 << O.wbits, O.flags = 0, C.adler = O.check = 1, O.mode = _e & 512 ? Si : Vt, _e = 0, Le = 0; + O.dmax = 1 << O.wbits, O.flags = 0, C.adler = O.check = 1, O.mode = _e & 512 ? Ci : jt, _e = 0, Oe = 0; break; - case pi: - for (; Le < 16; ) { - if (Ee === 0) + case yi: + for (; Oe < 16; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - if (O.flags = _e, (O.flags & 255) !== mi) { - C.msg = "unknown compression method", O.mode = Dt; + if (O.flags = _e, (O.flags & 255) !== bi) { + C.msg = "unknown compression method", O.mode = Ct; break; } if (O.flags & 57344) { - C.msg = "unknown header flags set", O.mode = Dt; + C.msg = "unknown header flags set", O.mode = Ct; break; } - O.head && (O.head.text = _e >> 8 & 1), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = I(O.check, mt, 2, 0)), _e = 0, Le = 0, O.mode = gi; - case gi: - for (; Le < 32; ) { - if (Ee === 0) + O.head && (O.head.text = _e >> 8 & 1), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = z(O.check, mt, 2, 0)), _e = 0, Oe = 0, O.mode = xi; + case xi: + for (; Oe < 32; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.head && (O.head.time = _e), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, mt[2] = _e >>> 16 & 255, mt[3] = _e >>> 24 & 255, O.check = I(O.check, mt, 4, 0)), _e = 0, Le = 0, O.mode = vi; - case vi: - for (; Le < 16; ) { - if (Ee === 0) + O.head && (O.head.time = _e), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, mt[2] = _e >>> 16 & 255, mt[3] = _e >>> 24 & 255, O.check = z(O.check, mt, 4, 0)), _e = 0, Oe = 0, O.mode = wi; + case wi: + for (; Oe < 16; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.head && (O.head.xflags = _e & 255, O.head.os = _e >> 8), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = I(O.check, mt, 2, 0)), _e = 0, Le = 0, O.mode = bi; - case bi: + O.head && (O.head.xflags = _e & 255, O.head.os = _e >> 8), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = z(O.check, mt, 2, 0)), _e = 0, Oe = 0, O.mode = Ei; + case Ei: if (O.flags & 1024) { - for (; Le < 16; ) { - if (Ee === 0) + for (; Oe < 16; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.length = _e, O.head && (O.head.extra_len = _e), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = I(O.check, mt, 2, 0)), _e = 0, Le = 0; + O.length = _e, O.head && (O.head.extra_len = _e), O.flags & 512 && O.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, O.check = z(O.check, mt, 2, 0)), _e = 0, Oe = 0; } else O.head && (O.head.extra = null); - O.mode = yi; - case yi: - if (O.flags & 1024 && (He = O.length, He > Ee && (He = Ee), He && (O.head && (nt = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( - J.subarray( - ie, + O.mode = Si; + case Si: + if (O.flags & 1024 && (He = O.length, He > Se && (He = Se), He && (O.head && (nt = O.head.extra_len - O.length, O.head.extra || (O.head.extra = new Uint8Array(O.head.extra_len)), O.head.extra.set( + ee.subarray( + le, // extra field is limited to 65536 bytes // - no need for additional size check - ie + He + le + He ), /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ nt - )), O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, O.length -= He), O.length)) + )), O.flags & 512 && O.wrap & 4 && (O.check = z(O.check, ee, He, le)), Se -= He, le += He, O.length -= He), O.length)) break e; - O.length = 0, O.mode = xi; - case xi: + O.length = 0, O.mode = Ai; + case Ai: if (O.flags & 2048) { - if (Ee === 0) + if (Se === 0) break e; He = 0; do - nt = J[ie + He++], O.head && nt && O.length < 65536 && (O.head.name += String.fromCharCode(nt)); - while (nt && He < Ee); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, nt) + nt = ee[le + He++], O.head && nt && O.length < 65536 && (O.head.name += String.fromCharCode(nt)); + while (nt && He < Se); + if (O.flags & 512 && O.wrap & 4 && (O.check = z(O.check, ee, He, le)), Se -= He, le += He, nt) break e; } else O.head && (O.head.name = null); - O.length = 0, O.mode = wi; - case wi: + O.length = 0, O.mode = Mi; + case Mi: if (O.flags & 4096) { - if (Ee === 0) + if (Se === 0) break e; He = 0; do - nt = J[ie + He++], O.head && nt && O.length < 65536 && (O.head.comment += String.fromCharCode(nt)); - while (nt && He < Ee); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, nt) + nt = ee[le + He++], O.head && nt && O.length < 65536 && (O.head.comment += String.fromCharCode(nt)); + while (nt && He < Se); + if (O.flags & 512 && O.wrap & 4 && (O.check = z(O.check, ee, He, le)), Se -= He, le += He, nt) break e; } else O.head && (O.head.comment = null); - O.mode = Ei; - case Ei: + O.mode = Di; + case Di: if (O.flags & 512) { - for (; Le < 16; ) { - if (Ee === 0) + for (; Oe < 16; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (O.wrap & 4 && _e !== (O.check & 65535)) { - C.msg = "header crc mismatch", O.mode = Dt; + C.msg = "header crc mismatch", O.mode = Ct; break; } - _e = 0, Le = 0; + _e = 0, Oe = 0; } - O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), C.adler = O.check = 0, O.mode = Vt; + O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), C.adler = O.check = 0, O.mode = jt; break; - case Si: - for (; Le < 32; ) { - if (Ee === 0) + case Ci: + for (; Oe < 32; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - C.adler = O.check = Bi(_e), _e = 0, Le = 0, O.mode = Cr; - case Cr: + C.adler = O.check = Wi(_e), _e = 0, Oe = 0, O.mode = kr; + case kr: if (O.havedict === 0) - return C.next_out = $e, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, O.hold = _e, O.bits = Le, sa; - C.adler = O.check = 1, O.mode = Vt; - case Vt: - if (j === na || j === Mr) + return C.next_out = Le, C.avail_out = tt, C.next_in = le, C.avail_in = Se, O.hold = _e, O.bits = Oe, fa; + C.adler = O.check = 1, O.mode = jt; + case jt: + if (j === ua || j === Cr) break e; - case Gr: + case Vr: if (O.last) { - _e >>>= Le & 7, Le -= Le & 7, O.mode = Hr; + _e >>>= Oe & 7, Oe -= Oe & 7, O.mode = Kr; break; } - for (; Le < 3; ) { - if (Ee === 0) + for (; Oe < 3; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - switch (O.last = _e & 1, _e >>>= 1, Le -= 1, _e & 3) { + switch (O.last = _e & 1, _e >>>= 1, Oe -= 1, _e & 3) { case 0: - O.mode = Ai; + O.mode = Ti; break; case 1: - if (fa(O), O.mode = Tr, j === Mr) { - _e >>>= 2, Le -= 2; + if (ya(O), O.mode = $r, j === Cr) { + _e >>>= 2, Oe -= 2; break e; } break; case 2: - O.mode = Di; + O.mode = $i; break; case 3: - C.msg = "invalid block type", O.mode = Dt; + C.msg = "invalid block type", O.mode = Ct; } - _e >>>= 2, Le -= 2; + _e >>>= 2, Oe -= 2; break; - case Ai: - for (_e >>>= Le & 7, Le -= Le & 7; Le < 32; ) { - if (Ee === 0) + case Ti: + for (_e >>>= Oe & 7, Oe -= Oe & 7; Oe < 32; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if ((_e & 65535) !== (_e >>> 16 ^ 65535)) { - C.msg = "invalid stored block lengths", O.mode = Dt; + C.msg = "invalid stored block lengths", O.mode = Ct; break; } - if (O.length = _e & 65535, _e = 0, Le = 0, O.mode = Wr, j === Mr) + if (O.length = _e & 65535, _e = 0, Oe = 0, O.mode = jr, j === Cr) break e; - case Wr: - O.mode = Mi; - case Mi: + case jr: + O.mode = ki; + case ki: if (He = O.length, He) { - if (He > Ee && (He = Ee), He > tt && (He = tt), He === 0) + if (He > Se && (He = Se), He > tt && (He = tt), He === 0) break e; - se.set(J.subarray(ie, ie + He), $e), Ee -= He, ie += He, tt -= He, $e += He, O.length -= He; + he.set(ee.subarray(le, le + He), Le), Se -= He, le += He, tt -= He, Le += He, O.length -= He; break; } - O.mode = Vt; + O.mode = jt; break; - case Di: - for (; Le < 14; ) { - if (Ee === 0) + case $i: + for (; Oe < 14; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - if (O.nlen = (_e & 31) + 257, _e >>>= 5, Le -= 5, O.ndist = (_e & 31) + 1, _e >>>= 5, Le -= 5, O.ncode = (_e & 15) + 4, _e >>>= 4, Le -= 4, O.nlen > 286 || O.ndist > 30) { - C.msg = "too many length or distance symbols", O.mode = Dt; + if (O.nlen = (_e & 31) + 257, _e >>>= 5, Oe -= 5, O.ndist = (_e & 31) + 1, _e >>>= 5, Oe -= 5, O.ncode = (_e & 15) + 4, _e >>>= 4, Oe -= 4, O.nlen > 286 || O.ndist > 30) { + C.msg = "too many length or distance symbols", O.mode = Ct; break; } - O.have = 0, O.mode = Ci; - case Ci: + O.have = 0, O.mode = Li; + case Li: for (; O.have < O.ncode; ) { - for (; Le < 3; ) { - if (Ee === 0) + for (; Oe < 3; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.lens[tr[O.have++]] = _e & 7, _e >>>= 3, Le -= 3; + O.lens[rr[O.have++]] = _e & 7, _e >>>= 3, Oe -= 3; } for (; O.have < 19; ) - O.lens[tr[O.have++]] = 0; - if (O.lencode = O.lendyn, O.lenbits = 7, lt = { bits: O.lenbits }, At = _r(ia, O.lens, 0, 19, O.lencode, 0, O.work, lt), O.lenbits = lt.bits, At) { - C.msg = "invalid code lengths set", O.mode = Dt; + O.lens[rr[O.have++]] = 0; + if (O.lencode = O.lendyn, O.lenbits = 7, lt = { bits: O.lenbits }, At = yr(ca, O.lens, 0, 19, O.lencode, 0, O.work, lt), O.lenbits = lt.bits, At) { + C.msg = "invalid code lengths set", O.mode = Ct; break; } - O.have = 0, O.mode = Ti; - case Ti: + O.have = 0, O.mode = Oi; + case Oi: for (; O.have < O.nlen + O.ndist; ) { - for (; ft = O.lencode[_e & (1 << O.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Le); ) { - if (Ee === 0) + for (; ft = O.lencode[_e & (1 << O.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Oe); ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (ct < 16) - _e >>>= ht, Le -= ht, O.lens[O.have++] = ct; + _e >>>= ht, Oe -= ht, O.lens[O.have++] = ct; else { if (ct === 16) { - for (dt = ht + 2; Le < dt; ) { - if (Ee === 0) + for (dt = ht + 2; Oe < dt; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - if (_e >>>= ht, Le -= ht, O.have === 0) { - C.msg = "invalid bit length repeat", O.mode = Dt; + if (_e >>>= ht, Oe -= ht, O.have === 0) { + C.msg = "invalid bit length repeat", O.mode = Ct; break; } - nt = O.lens[O.have - 1], He = 3 + (_e & 3), _e >>>= 2, Le -= 2; + nt = O.lens[O.have - 1], He = 3 + (_e & 3), _e >>>= 2, Oe -= 2; } else if (ct === 17) { - for (dt = ht + 3; Le < dt; ) { - if (Ee === 0) + for (dt = ht + 3; Oe < dt; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - _e >>>= ht, Le -= ht, nt = 0, He = 3 + (_e & 7), _e >>>= 3, Le -= 3; + _e >>>= ht, Oe -= ht, nt = 0, He = 3 + (_e & 7), _e >>>= 3, Oe -= 3; } else { - for (dt = ht + 7; Le < dt; ) { - if (Ee === 0) + for (dt = ht + 7; Oe < dt; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - _e >>>= ht, Le -= ht, nt = 0, He = 11 + (_e & 127), _e >>>= 7, Le -= 7; + _e >>>= ht, Oe -= ht, nt = 0, He = 11 + (_e & 127), _e >>>= 7, Oe -= 7; } if (O.have + He > O.nlen + O.ndist) { - C.msg = "invalid bit length repeat", O.mode = Dt; + C.msg = "invalid bit length repeat", O.mode = Ct; break; } for (; He--; ) O.lens[O.have++] = nt; } } - if (O.mode === Dt) + if (O.mode === Ct) break; if (O.lens[256] === 0) { - C.msg = "invalid code -- missing end-of-block", O.mode = Dt; + C.msg = "invalid code -- missing end-of-block", O.mode = Ct; break; } - if (O.lenbits = 9, lt = { bits: O.lenbits }, At = _r(hi, O.lens, 0, O.nlen, O.lencode, 0, O.work, lt), O.lenbits = lt.bits, At) { - C.msg = "invalid literal/lengths set", O.mode = Dt; + if (O.lenbits = 9, lt = { bits: O.lenbits }, At = yr(fi, O.lens, 0, O.nlen, O.lencode, 0, O.work, lt), O.lenbits = lt.bits, At) { + C.msg = "invalid literal/lengths set", O.mode = Ct; break; } - if (O.distbits = 6, O.distcode = O.distdyn, lt = { bits: O.distbits }, At = _r(ci, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, lt), O.distbits = lt.bits, At) { - C.msg = "invalid distances set", O.mode = Dt; + if (O.distbits = 6, O.distcode = O.distdyn, lt = { bits: O.distbits }, At = yr(mi, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, lt), O.distbits = lt.bits, At) { + C.msg = "invalid distances set", O.mode = Ct; break; } - if (O.mode = Tr, j === Mr) + if (O.mode = $r, j === Cr) break e; - case Tr: - O.mode = kr; - case kr: - if (Ee >= 6 && tt >= 258) { - C.next_out = $e, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, O.hold = _e, O.bits = Le, Qn(C, Je), $e = C.next_out, se = C.output, tt = C.avail_out, ie = C.next_in, J = C.input, Ee = C.avail_in, _e = O.hold, Le = O.bits, O.mode === Vt && (O.back = -1); + case $r: + O.mode = Lr; + case Lr: + if (Se >= 6 && tt >= 258) { + C.next_out = Le, C.avail_out = tt, C.next_in = le, C.avail_in = Se, O.hold = _e, O.bits = Oe, aa(C, Je), Le = C.next_out, he = C.output, tt = C.avail_out, le = C.next_in, ee = C.input, Se = C.avail_in, _e = O.hold, Oe = O.bits, O.mode === jt && (O.back = -1); break; } - for (O.back = 0; ft = O.lencode[_e & (1 << O.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Le); ) { - if (Ee === 0) + for (O.back = 0; ft = O.lencode[_e & (1 << O.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Oe); ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (xt && !(xt & 240)) { - for (Qe = ht, bt = xt, Ot = ct; ft = O.lencode[Ot + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= Le); ) { - if (Ee === 0) + for (Qe = ht, bt = xt, Ft = ct; ft = O.lencode[Ft + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= Oe); ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - _e >>>= Qe, Le -= Qe, O.back += Qe; + _e >>>= Qe, Oe -= Qe, O.back += Qe; } - if (_e >>>= ht, Le -= ht, O.back += ht, O.length = ct, xt === 0) { - O.mode = Fi; + if (_e >>>= ht, Oe -= ht, O.back += ht, O.length = ct, xt === 0) { + O.mode = Ri; break; } if (xt & 32) { - O.back = -1, O.mode = Vt; + O.back = -1, O.mode = jt; break; } if (xt & 64) { - C.msg = "invalid literal/length code", O.mode = Dt; + C.msg = "invalid literal/length code", O.mode = Ct; break; } - O.extra = xt & 15, O.mode = ki; - case ki: + O.extra = xt & 15, O.mode = Fi; + case Fi: if (O.extra) { - for (dt = O.extra; Le < dt; ) { - if (Ee === 0) + for (dt = O.extra; Oe < dt; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.length += _e & (1 << O.extra) - 1, _e >>>= O.extra, Le -= O.extra, O.back += O.extra; + O.length += _e & (1 << O.extra) - 1, _e >>>= O.extra, Oe -= O.extra, O.back += O.extra; } - O.was = O.length, O.mode = $i; - case $i: - for (; ft = O.distcode[_e & (1 << O.distbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Le); ) { - if (Ee === 0) + O.was = O.length, O.mode = zi; + case zi: + for (; ft = O.distcode[_e & (1 << O.distbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= Oe); ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (!(xt & 240)) { - for (Qe = ht, bt = xt, Ot = ct; ft = O.distcode[Ot + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= Le); ) { - if (Ee === 0) + for (Qe = ht, bt = xt, Ft = ct; ft = O.distcode[Ft + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= Oe); ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - _e >>>= Qe, Le -= Qe, O.back += Qe; + _e >>>= Qe, Oe -= Qe, O.back += Qe; } - if (_e >>>= ht, Le -= ht, O.back += ht, xt & 64) { - C.msg = "invalid distance code", O.mode = Dt; + if (_e >>>= ht, Oe -= ht, O.back += ht, xt & 64) { + C.msg = "invalid distance code", O.mode = Ct; break; } - O.offset = ct, O.extra = xt & 15, O.mode = Li; - case Li: + O.offset = ct, O.extra = xt & 15, O.mode = Ii; + case Ii: if (O.extra) { - for (dt = O.extra; Le < dt; ) { - if (Ee === 0) + for (dt = O.extra; Oe < dt; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } - O.offset += _e & (1 << O.extra) - 1, _e >>>= O.extra, Le -= O.extra, O.back += O.extra; + O.offset += _e & (1 << O.extra) - 1, _e >>>= O.extra, Oe -= O.extra, O.back += O.extra; } if (O.offset > O.dmax) { - C.msg = "invalid distance too far back", O.mode = Dt; + C.msg = "invalid distance too far back", O.mode = Ct; break; } - O.mode = Oi; - case Oi: + O.mode = Pi; + case Pi: if (tt === 0) break e; if (He = Je - tt, O.offset > He) { if (He = O.offset - He, He > O.whave && O.sane) { - C.msg = "invalid distance too far back", O.mode = Dt; + C.msg = "invalid distance too far back", O.mode = Ct; break; } - He > O.wnext ? (He -= O.wnext, it = O.wsize - He) : it = O.wnext - He, He > O.length && (He = O.length), Ct = O.window; + He > O.wnext ? (He -= O.wnext, it = O.wsize - He) : it = O.wnext - He, He > O.length && (He = O.length), Tt = O.window; } else - Ct = se, it = $e - O.offset, He = O.length; + Tt = he, it = Le - O.offset, He = O.length; He > tt && (He = tt), tt -= He, O.length -= He; do - se[$e++] = Ct[it++]; + he[Le++] = Tt[it++]; while (--He); - O.length === 0 && (O.mode = kr); + O.length === 0 && (O.mode = Lr); break; - case Fi: + case Ri: if (tt === 0) break e; - se[$e++] = O.length, tt--, O.mode = kr; + he[Le++] = O.length, tt--, O.mode = Lr; break; - case Hr: + case Kr: if (O.wrap) { - for (; Le < 32; ) { - if (Ee === 0) + for (; Oe < 32; ) { + if (Se === 0) break e; - Ee--, _e |= J[ie++] << Le, Le += 8; + Se--, _e |= ee[le++] << Oe, Oe += 8; } if (Je -= tt, C.total_out += Je, O.total += Je, O.wrap & 4 && Je && (C.adler = O.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ - O.flags ? I(O.check, se, Je, $e - Je) : Ce(O.check, se, Je, $e - Je)), Je = tt, O.wrap & 4 && (O.flags ? _e : Bi(_e)) !== O.check) { - C.msg = "incorrect data check", O.mode = Dt; + O.flags ? z(O.check, he, Je, Le - Je) : Te(O.check, he, Je, Le - Je)), Je = tt, O.wrap & 4 && (O.flags ? _e : Wi(_e)) !== O.check) { + C.msg = "incorrect data check", O.mode = Ct; break; } - _e = 0, Le = 0; + _e = 0, Oe = 0; } - O.mode = zi; - case zi: + O.mode = Bi; + case Bi: if (O.wrap && O.flags) { - for (; Le < 32; ) { - if (Ee === 0) + for (; Oe < 32; ) { + if (Se === 0) break e; - Ee--, _e += J[ie++] << Le, Le += 8; + Se--, _e += ee[le++] << Oe, Oe += 8; } if (O.wrap & 4 && _e !== (O.total & 4294967295)) { - C.msg = "incorrect length check", O.mode = Dt; + C.msg = "incorrect length check", O.mode = Ct; break; } - _e = 0, Le = 0; + _e = 0, Oe = 0; } - O.mode = Ii; - case Ii: - At = aa; + O.mode = Ni; + case Ni: + At = da; break e; - case Dt: - At = di; + case Ct: + At = gi; break e; - case Ri: - return fi; - case Pi: + case Ui: + return vi; + case Gi: default: - return Ut; + return Gt; } - return C.next_out = $e, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, O.hold = _e, O.bits = Le, (O.wsize || Je !== C.avail_out && O.mode < Dt && (O.mode < Hr || j !== ui)) && Vi(C, C.output, C.next_out, Je - C.avail_out), pt -= C.avail_in, Je -= C.avail_out, C.total_in += pt, C.total_out += Je, O.total += Je, O.wrap & 4 && Je && (C.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ - O.flags ? I(O.check, se, Je, C.next_out - Je) : Ce(O.check, se, Je, C.next_out - Je)), C.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Vt ? 128 : 0) + (O.mode === Tr || O.mode === Wr ? 256 : 0), (pt === 0 && Je === 0 || j === ui) && At === Jt && (At = la), At; - }, pa = (C) => { - if (er(C)) - return Ut; + return C.next_out = Le, C.avail_out = tt, C.next_in = le, C.avail_in = Se, O.hold = _e, O.bits = Oe, (O.wsize || Je !== C.avail_out && O.mode < Ct && (O.mode < Kr || j !== pi)) && Zi(C, C.output, C.next_out, Je - C.avail_out), pt -= C.avail_in, Je -= C.avail_out, C.total_in += pt, C.total_out += Je, O.total += Je, O.wrap & 4 && Je && (C.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ + O.flags ? z(O.check, he, Je, C.next_out - Je) : Te(O.check, he, Je, C.next_out - Je)), C.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === jt ? 128 : 0) + (O.mode === $r || O.mode === jr ? 256 : 0), (pt === 0 && Je === 0 || j === pi) && At === er && (At = ma), At; + }, wa = (C) => { + if (tr(C)) + return Gt; let j = C.state; - return j.window && (j.window = null), C.state = null, Jt; - }, ga = (C, j) => { - if (er(C)) - return Ut; + return j.window && (j.window = null), C.state = null, er; + }, Ea = (C, j) => { + if (tr(C)) + return Gt; const O = C.state; - return O.wrap & 2 ? (O.head = j, j.done = !1, Jt) : Ut; - }, _a = (C, j) => { + return O.wrap & 2 ? (O.head = j, j.done = !1, er) : Gt; + }, Sa = (C, j) => { const O = j.length; - let J, se, ie; - return er(C) || (J = C.state, J.wrap !== 0 && J.mode !== Cr) ? Ut : J.mode === Cr && (se = 1, se = Ce(se, j, O, 0), se !== J.check) ? di : (ie = Vi(C, j, O, O), ie ? (J.mode = Ri, fi) : (J.havedict = 1, Jt)); + let ee, he, le; + return tr(C) || (ee = C.state, ee.wrap !== 0 && ee.mode !== kr) ? Gt : ee.mode === kr && (he = 1, he = Te(he, j, O, 0), he !== ee.check) ? gi : (le = Zi(C, j, O, O), le ? (ee.mode = Ui, vi) : (ee.havedict = 1, er)); }; - var va = Ui, ba = Gi, ya = Ni, xa = da, wa = Wi, Ea = ma, Sa = pa, Aa = ga, Ma = _a, Da = "pako inflate (from Nodeca project)", jt = { - inflateReset: va, - inflateReset2: ba, - inflateResetKeep: ya, - inflateInit: xa, - inflateInit2: wa, - inflate: Ea, - inflateEnd: Sa, - inflateGetHeader: Aa, - inflateSetDictionary: Ma, - inflateInfo: Da + var Aa = Vi, Ma = ji, Da = Hi, Ca = ba, Ta = Ki, ka = xa, $a = wa, La = Ea, Oa = Sa, Fa = "pako inflate (from Nodeca project)", Kt = { + inflateReset: Aa, + inflateReset2: Ma, + inflateResetKeep: Da, + inflateInit: Ca, + inflateInit2: Ta, + inflate: ka, + inflateEnd: $a, + inflateGetHeader: La, + inflateSetDictionary: Oa, + inflateInfo: Fa }; - function Ca() { + function za() { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; } - var Ta = Ca; - const ji = Object.prototype.toString, { - Z_NO_FLUSH: ka, - Z_FINISH: $a, - Z_OK: vr, - Z_STREAM_END: Kr, - Z_NEED_DICT: Xr, - Z_STREAM_ERROR: La, - Z_DATA_ERROR: Ki, - Z_MEM_ERROR: Oa + var Ia = za; + const Yi = Object.prototype.toString, { + Z_NO_FLUSH: Pa, + Z_FINISH: Ra, + Z_OK: xr, + Z_STREAM_END: Yr, + Z_NEED_DICT: qr, + Z_STREAM_ERROR: Ba, + Z_DATA_ERROR: qi, + Z_MEM_ERROR: Na } = ve; - function yr(C) { - this.options = Er.assign({ + function wr(C) { + this.options = Ar.assign({ chunkSize: 65536, windowBits: 15, to: "" }, C || {}); 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 && !(C && C.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 ii(), this.strm.avail_out = 0; - let O = jt.inflateInit2( + j.raw && j.windowBits >= 0 && j.windowBits < 16 && (j.windowBits = -j.windowBits, j.windowBits === 0 && (j.windowBits = -15)), j.windowBits >= 0 && j.windowBits < 16 && !(C && C.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 li(), this.strm.avail_out = 0; + let O = Kt.inflateInit2( this.strm, j.windowBits ); - if (O !== vr) - throw new Error(we[O]); - if (this.header = new Ta(), jt.inflateGetHeader(this.strm, this.header), j.dictionary && (typeof j.dictionary == "string" ? j.dictionary = pr.string2buf(j.dictionary) : ji.call(j.dictionary) === "[object ArrayBuffer]" && (j.dictionary = new Uint8Array(j.dictionary)), j.raw && (O = jt.inflateSetDictionary(this.strm, j.dictionary), O !== vr))) - throw new Error(we[O]); - } - yr.prototype.push = function(C, j) { - const O = this.strm, J = this.options.chunkSize, se = this.options.dictionary; - let ie, $e, Ee; + if (O !== xr) + throw new Error(Ee[O]); + if (this.header = new Ia(), Kt.inflateGetHeader(this.strm, this.header), j.dictionary && (typeof j.dictionary == "string" ? j.dictionary = _r.string2buf(j.dictionary) : Yi.call(j.dictionary) === "[object ArrayBuffer]" && (j.dictionary = new Uint8Array(j.dictionary)), j.raw && (O = Kt.inflateSetDictionary(this.strm, j.dictionary), O !== xr))) + throw new Error(Ee[O]); + } + wr.prototype.push = function(C, j) { + const O = this.strm, ee = this.options.chunkSize, he = this.options.dictionary; + let le, Le, Se; if (this.ended) return !1; - for (j === ~~j ? $e = j : $e = j === !0 ? $a : ka, ji.call(C) === "[object ArrayBuffer]" ? O.input = new Uint8Array(C) : O.input = C, 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), ie = jt.inflate(O, $e), ie === Xr && se && (ie = jt.inflateSetDictionary(O, se), ie === vr ? ie = jt.inflate(O, $e) : ie === Ki && (ie = Xr)); O.avail_in > 0 && ie === Kr && O.state.wrap > 0 && C[O.next_in] !== 0; ) - jt.inflateReset(O), ie = jt.inflate(O, $e); - switch (ie) { - case La: - case Ki: - case Xr: - case Oa: - return this.onEnd(ie), this.ended = !0, !1; - } - if (Ee = O.avail_out, O.next_out && (O.avail_out === 0 || ie === Kr)) + for (j === ~~j ? Le = j : Le = j === !0 ? Ra : Pa, Yi.call(C) === "[object ArrayBuffer]" ? O.input = new Uint8Array(C) : O.input = C, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (O.avail_out === 0 && (O.output = new Uint8Array(ee), O.next_out = 0, O.avail_out = ee), le = Kt.inflate(O, Le), le === qr && he && (le = Kt.inflateSetDictionary(O, he), le === xr ? le = Kt.inflate(O, Le) : le === qi && (le = qr)); O.avail_in > 0 && le === Yr && O.state.wrap > 0 && C[O.next_in] !== 0; ) + Kt.inflateReset(O), le = Kt.inflate(O, Le); + switch (le) { + case Ba: + case qi: + case qr: + case Na: + return this.onEnd(le), this.ended = !0, !1; + } + if (Se = O.avail_out, O.next_out && (O.avail_out === 0 || le === Yr)) if (this.options.to === "string") { - let tt = pr.utf8border(O.output, O.next_out), _e = O.next_out - tt, Le = pr.buf2string(O.output, tt); - O.next_out = _e, O.avail_out = J - _e, _e && O.output.set(O.output.subarray(tt, tt + _e), 0), this.onData(Le); + let tt = _r.utf8border(O.output, O.next_out), _e = O.next_out - tt, Oe = _r.buf2string(O.output, tt); + O.next_out = _e, O.avail_out = ee - _e, _e && O.output.set(O.output.subarray(tt, tt + _e), 0), this.onData(Oe); } else this.onData(O.output.length === O.next_out ? O.output : O.output.subarray(0, O.next_out)); - if (!(ie === vr && Ee === 0)) { - if (ie === Kr) - return ie = jt.inflateEnd(this.strm), this.onEnd(ie), this.ended = !0, !0; + if (!(le === xr && Se === 0)) { + if (le === Yr) + return le = Kt.inflateEnd(this.strm), this.onEnd(le), this.ended = !0, !0; if (O.avail_in === 0) break; } } return !0; - }, yr.prototype.onData = function(C) { + }, wr.prototype.onData = function(C) { this.chunks.push(C); - }, yr.prototype.onEnd = function(C) { - C === vr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = Er.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg; + }, wr.prototype.onEnd = function(C) { + C === xr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = Ar.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg; }; - function Zr(C, j) { - const O = new yr(j); - if (O.push(C), O.err) throw O.msg || we[O.err]; + function Qr(C, j) { + const O = new wr(j); + if (O.push(C), O.err) throw O.msg || Ee[O.err]; return O.result; } - function Fa(C, j) { - return j = j || {}, j.raw = !0, Zr(C, j); + function Ua(C, j) { + return j = j || {}, j.raw = !0, Qr(C, j); } - var za = yr, Ia = Zr, Ra = Fa, Pa = Zr, Ba = ve, Na = { - Inflate: za, - inflate: Ia, - inflateRaw: Ra, - ungzip: Pa, - constants: Ba + var Ga = wr, Wa = Qr, Ha = Ua, Va = Qr, ja = ve, Ka = { + Inflate: Ga, + inflate: Wa, + inflateRaw: Ha, + ungzip: Va, + constants: ja }; - const { Deflate: Ua, deflate: Ga, deflateRaw: Wa, gzip: Ha } = Yn, { Inflate: Va, inflate: ja, inflateRaw: Ka, ungzip: Xa } = Na; - var Xi = Ua, Zi = Ga, Yi = Wa, qi = Ha, Qi = Va, Ji = ja, en = Ka, tn = Xa, rn = ve, Za = { - Deflate: Xi, - deflate: Zi, - deflateRaw: Yi, - gzip: qi, - Inflate: Qi, - inflate: Ji, - inflateRaw: en, - ungzip: tn, - constants: rn + const { Deflate: Xa, deflate: Za, deflateRaw: Ya, gzip: qa } = ia, { Inflate: Qa, inflate: Ja, inflateRaw: es, ungzip: ts } = Ka; + var Qi = Xa, Ji = Za, en = Ya, tn = qa, rn = Qa, nn = Ja, an = es, sn = ts, ln = ve, rs = { + Deflate: Qi, + deflate: Ji, + deflateRaw: en, + gzip: tn, + Inflate: rn, + inflate: nn, + inflateRaw: an, + ungzip: sn, + constants: ln }; } ) @@ -42353,75 +42375,75 @@ const _3Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), mol = /* toggle_class: toggle_class$5 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4, afterUpdate: afterUpdate$2 } = window.__gradio__svelte__internal; function create_if_block$6(n) { - let e, t = "Covalent Modification", r, a, s = ' click on atoms in viewer to select them', h, o, d, v = ' Attachment atom', f, y, A = ' Atoms to delete', x, M, m, l, u = ' index', p, g, b, c, _ = "Attachment atom", E, w, k, $, L, z = "Deleted atoms", F, R, P, U; - function N(Q, te) { + let e, t = "Covalent Modification", r, a, s = ' click on atoms in viewer to select them', h, o, d, _ = ' Attachment atom', f, y, A = ' Atoms to delete', x, M, m, l, u = ' index', p, g, b, c, v = "Attachment atom", E, w, k, $, L, I = "Deleted atoms", F, P, B, G; + function U(J, re) { return ( /*attachmentIndex*/ - Q[1] !== null ? create_if_block_2$4 : create_else_block_1$3 + J[1] !== null ? create_if_block_2$4 : create_else_block_1$3 ); } - let B = N(n), W = B(n); - function V(Q, te) { + let R = U(n), W = R(n); + function H(J, re) { return ( /*deleteIndexes*/ - Q[2].length > 0 ? create_if_block_1$5 : create_else_block$5 + J[2].length > 0 ? create_if_block_1$5 : create_else_block$5 ); } - let G = V(n), H = G(n); + let N = H(n), V = N(n); return { c() { - e = element$6("div"), e.textContent = t, r = space$6(), a = element$6("div"), a.innerHTML = s, h = space$6(), o = element$6("div"), d = element$6("button"), d.innerHTML = v, f = space$6(), y = element$6("button"), y.innerHTML = A, x = space$6(), M = element$6("div"), m = element$6("table"), l = element$6("thead"), l.innerHTML = u, p = space$6(), g = element$6("tbody"), b = element$6("tr"), c = element$6("th"), c.textContent = _, E = space$6(), w = element$6("td"), W.c(), k = space$6(), $ = element$6("tr"), L = element$6("th"), L.textContent = z, F = space$6(), R = element$6("td"), H.c(), this.h(); + e = element$6("div"), e.textContent = t, r = space$6(), a = element$6("div"), a.innerHTML = s, h = space$6(), o = element$6("div"), d = element$6("button"), d.innerHTML = _, f = space$6(), y = element$6("button"), y.innerHTML = A, x = space$6(), M = element$6("div"), m = element$6("table"), l = element$6("thead"), l.innerHTML = u, p = space$6(), g = element$6("tbody"), b = element$6("tr"), c = element$6("th"), c.textContent = v, E = space$6(), w = element$6("td"), W.c(), k = space$6(), $ = element$6("tr"), L = element$6("th"), L.textContent = I, F = space$6(), P = element$6("td"), V.c(), this.h(); }, - l(Q) { - e = claim_element$6(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(e) !== "svelte-1ws80r8" && (e.textContent = t), r = claim_space$6(Q), a = claim_element$6(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(a) !== "svelte-au1964" && (a.innerHTML = s), h = claim_space$6(Q), o = claim_element$6(Q, "DIV", { class: !0 }); - var te = children$5(o); - d = claim_element$6(te, "BUTTON", { + l(J) { + e = claim_element$6(J, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(e) !== "svelte-1ws80r8" && (e.textContent = t), r = claim_space$6(J), a = claim_element$6(J, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(a) !== "svelte-au1964" && (a.innerHTML = s), h = claim_space$6(J), o = claim_element$6(J, "DIV", { class: !0 }); + var re = children$5(o); + d = claim_element$6(re, "BUTTON", { class: !0, id: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(d) !== "svelte-1x319mo" && (d.innerHTML = v), f = claim_space$6(te), y = claim_element$6(te, "BUTTON", { + }), get_svelte_dataset$3(d) !== "svelte-1x319mo" && (d.innerHTML = _), f = claim_space$6(re), y = claim_element$6(re, "BUTTON", { class: !0, id: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(y) !== "svelte-vlrg5g" && (y.innerHTML = A), te.forEach(detach$7), x = claim_space$6(Q), M = claim_element$6(Q, "DIV", { class: !0 }); - var ee = children$5(M); - m = claim_element$6(ee, "TABLE", { class: !0 }); - var ce = children$5(m); - l = claim_element$6(ce, "THEAD", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(l) !== "svelte-1cl8b2m" && (l.innerHTML = u), p = claim_space$6(ce), g = claim_element$6(ce, "TBODY", { class: !0 }); - var fe = children$5(g); - b = claim_element$6(fe, "TR", { class: !0 }); - var oe = children$5(b); - c = claim_element$6(oe, "TH", { + }), get_svelte_dataset$3(y) !== "svelte-vlrg5g" && (y.innerHTML = A), re.forEach(detach$7), x = claim_space$6(J), M = claim_element$6(J, "DIV", { class: !0 }); + var te = children$5(M); + m = claim_element$6(te, "TABLE", { class: !0 }); + var ue = children$5(m); + l = claim_element$6(ue, "THEAD", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$3(l) !== "svelte-1cl8b2m" && (l.innerHTML = u), p = claim_space$6(ue), g = claim_element$6(ue, "TBODY", { class: !0 }); + var ie = children$5(g); + b = claim_element$6(ie, "TR", { class: !0 }); + var ae = children$5(b); + c = claim_element$6(ae, "TH", { scope: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(c) !== "svelte-1j0kl0r" && (c.textContent = _), E = claim_space$6(oe), w = claim_element$6(oe, "TD", { class: !0 }); - var he = children$5(w); - W.l(he), he.forEach(detach$7), oe.forEach(detach$7), k = claim_space$6(fe), $ = claim_element$6(fe, "TR", { class: !0 }); - var Ae = children$5($); - L = claim_element$6(Ae, "TH", { + }), get_svelte_dataset$3(c) !== "svelte-1j0kl0r" && (c.textContent = v), E = claim_space$6(ae), w = claim_element$6(ae, "TD", { class: !0 }); + var ce = children$5(w); + W.l(ce), ce.forEach(detach$7), ae.forEach(detach$7), k = claim_space$6(ie), $ = claim_element$6(ie, "TR", { class: !0 }); + var Me = children$5($); + L = claim_element$6(Me, "TH", { scope: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(L) !== "svelte-nv6kl6" && (L.textContent = z), F = claim_space$6(Ae), R = claim_element$6(Ae, "TD", { class: !0 }); - var Se = children$5(R); - H.l(Se), Se.forEach(detach$7), Ae.forEach(detach$7), fe.forEach(detach$7), ce.forEach(detach$7), ee.forEach(detach$7), this.h(); + }), get_svelte_dataset$3(L) !== "svelte-nv6kl6" && (L.textContent = I), F = claim_space$6(Me), P = claim_element$6(Me, "TD", { class: !0 }); + var Ae = children$5(P); + V.l(Ae), Ae.forEach(detach$7), Me.forEach(detach$7), ie.forEach(detach$7), ue.forEach(detach$7), te.forEach(detach$7), this.h(); }, h() { - attr$6(e, "class", "w-full text-center text-lg mb-2 svelte-oz981t"), attr$6(a, "class", "flex items-center space-x-2 justify-center mb-2 text-xs svelte-oz981t"), attr$6(d, "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-oz981t"), attr$6(d, "id", "attach"), toggle_class$5( + attr$6(e, "class", "w-full text-center text-lg mb-2 svelte-1ruzq3o"), attr$6(a, "class", "flex items-center space-x-2 justify-center mb-2 text-xs svelte-1ruzq3o"), attr$6(d, "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-1ruzq3o"), attr$6(d, "id", "attach"), toggle_class$5( d, "active", /*mode*/ n[3] === "attach" - ), attr$6(y, "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-oz981t"), attr$6(y, "id", "delete"), toggle_class$5( + ), attr$6(y, "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-1ruzq3o"), attr$6(y, "id", "delete"), toggle_class$5( y, "active", /*mode*/ n[3] === "delete" - ), attr$6(o, "class", "flex rounded-full border-2 border-gray-200 bg-gray-200 text-sm leading-none text-gray-500 svelte-oz981t"), attr$6(l, "class", "text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 svelte-oz981t"), attr$6(c, "scope", "row"), attr$6(c, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-oz981t"), attr$6(w, "class", "px-6 py-4 font-mono svelte-oz981t"), attr$6(b, "class", "bg-white border-b dark:bg-gray-800 dark:border-gray-700 svelte-oz981t"), attr$6(L, "scope", "row"), attr$6(L, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-oz981t"), attr$6(R, "class", "px-6 py-4 font-mono svelte-oz981t"), attr$6($, "class", "bg-white dark:bg-gray-800 svelte-oz981t"), attr$6(g, "class", "svelte-oz981t"), attr$6(m, "class", "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 svelte-oz981t"), attr$6(M, "class", "relative overflow-x-auto mt-3 svelte-oz981t"); + ), attr$6(o, "class", "flex rounded-full border-2 border-gray-200 bg-gray-200 text-sm leading-none text-gray-500 svelte-1ruzq3o"), attr$6(l, "class", "text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 svelte-1ruzq3o"), attr$6(c, "scope", "row"), attr$6(c, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1ruzq3o"), attr$6(w, "class", "px-6 py-4 font-mono svelte-1ruzq3o"), attr$6(b, "class", "bg-white border-b dark:bg-gray-800 dark:border-gray-700 svelte-1ruzq3o"), attr$6(L, "scope", "row"), attr$6(L, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1ruzq3o"), attr$6(P, "class", "px-6 py-4 font-mono svelte-1ruzq3o"), attr$6($, "class", "bg-white dark:bg-gray-800 svelte-1ruzq3o"), attr$6(g, "class", "svelte-1ruzq3o"), attr$6(m, "class", "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 svelte-1ruzq3o"), attr$6(M, "class", "relative overflow-x-auto mt-3 svelte-1ruzq3o"); }, - m(Q, te) { - insert_hydration$7(Q, e, te), insert_hydration$7(Q, r, te), insert_hydration$7(Q, a, te), insert_hydration$7(Q, h, te), insert_hydration$7(Q, o, te), append_hydration$5(o, d), append_hydration$5(o, f), append_hydration$5(o, y), insert_hydration$7(Q, x, te), insert_hydration$7(Q, M, te), append_hydration$5(M, m), append_hydration$5(m, l), append_hydration$5(m, p), append_hydration$5(m, g), append_hydration$5(g, b), append_hydration$5(b, c), append_hydration$5(b, E), append_hydration$5(b, w), W.m(w, null), append_hydration$5(g, k), append_hydration$5(g, $), append_hydration$5($, L), append_hydration$5($, F), append_hydration$5($, R), H.m(R, null), P || (U = [ + m(J, re) { + insert_hydration$7(J, e, re), insert_hydration$7(J, r, re), insert_hydration$7(J, a, re), insert_hydration$7(J, h, re), insert_hydration$7(J, o, re), append_hydration$5(o, d), append_hydration$5(o, f), append_hydration$5(o, y), insert_hydration$7(J, x, re), insert_hydration$7(J, M, re), append_hydration$5(M, m), append_hydration$5(m, l), append_hydration$5(m, p), append_hydration$5(m, g), append_hydration$5(g, b), append_hydration$5(b, c), append_hydration$5(b, E), append_hydration$5(b, w), W.m(w, null), append_hydration$5(g, k), append_hydration$5(g, $), append_hydration$5($, L), append_hydration$5($, F), append_hydration$5($, P), V.m(P, null), B || (G = [ listen$2( d, "click", @@ -42434,25 +42456,25 @@ function create_if_block$6(n) { /*click_handler_1*/ n[8] ) - ], P = !0); + ], B = !0); }, - p(Q, te) { - te & /*mode*/ + p(J, re) { + re & /*mode*/ 8 && toggle_class$5( d, "active", /*mode*/ - Q[3] === "attach" - ), te & /*mode*/ + J[3] === "attach" + ), re & /*mode*/ 8 && toggle_class$5( y, "active", /*mode*/ - Q[3] === "delete" - ), B === (B = N(Q)) && W ? W.p(Q, te) : (W.d(1), W = B(Q), W && (W.c(), W.m(w, null))), G === (G = V(Q)) && H ? H.p(Q, te) : (H.d(1), H = G(Q), H && (H.c(), H.m(R, null))); + J[3] === "delete" + ), R === (R = U(J)) && W ? W.p(J, re) : (W.d(1), W = R(J), W && (W.c(), W.m(w, null))), N === (N = H(J)) && V ? V.p(J, re) : (V.d(1), V = N(J), V && (V.c(), V.m(P, null))); }, - d(Q) { - Q && (detach$7(e), detach$7(r), detach$7(a), detach$7(h), detach$7(o), detach$7(x), detach$7(M)), W.d(), H.d(), P = !1, run_all$2(U); + d(J) { + J && (detach$7(e), detach$7(r), detach$7(a), detach$7(h), detach$7(o), detach$7(x), detach$7(M)), W.d(), V.d(), B = !1, run_all$2(G); } }; } @@ -42562,13 +42584,13 @@ function create_fragment$7(n) { e = claim_element$6(o, "DIV", { class: !0 }); var d = children$5(e); t = claim_element$6(d, "DIV", { class: !0 }); - var v = children$5(t); - r = claim_element$6(v, "DIV", { class: !0 }), children$5(r).forEach(detach$7), v.forEach(detach$7), a = claim_space$6(d), s = claim_element$6(d, "DIV", { class: !0 }); + var _ = children$5(t); + r = claim_element$6(_, "DIV", { class: !0 }), children$5(r).forEach(detach$7), _.forEach(detach$7), a = claim_space$6(d), s = claim_element$6(d, "DIV", { class: !0 }); var f = children$5(s); h && h.l(f), f.forEach(detach$7), d.forEach(detach$7), this.h(); }, h() { - attr$6(r, "class", "mol-canvas svelte-oz981t"), attr$6(t, "class", "relative svelte-oz981t"), attr$6(s, "class", "flex flex-col justify-center svelte-oz981t"), attr$6(e, "class", "mol-wrapper svelte-oz981t"); + attr$6(r, "class", "mol-canvas svelte-1ruzq3o"), attr$6(t, "class", "relative svelte-1ruzq3o"), attr$6(s, "class", "flex flex-col justify-center svelte-1ruzq3o"), attr$6(e, "class", "mol-wrapper svelte-1ruzq3o"); }, m(o, d) { insert_hydration$7(o, e, d), append_hydration$5(e, t), append_hydration$5(t, r), n[6](r), append_hydration$5(e, a), append_hydration$5(e, s), h && h.m(s, null); @@ -42597,15 +42619,15 @@ function instance$7(n, e, t) { mol: l.exportJSON() })); } - function v(l, u) { + function _(l, u) { let p = a.createViewer(u, {}); - return p.addModel(l, "sdf"), d(p), p.setBackgroundColor("white"), p.zoomTo(), p.getModel(0).setClickable({}, !0, function(g, b, c, _) { + return p.addModel(l, "sdf"), d(p), p.setBackgroundColor("white"), p.zoomTo(), p.getModel(0).setClickable({}, !0, function(g, b, c, v) { y > -1 && (o === "attach" ? t(1, s = g.serial) : (h.includes(g.serial) ? t(2, h = h.filter((E) => E !== g.serial)) : h.push(g.serial), t(2, h), d(b))); }), p.render(), p; } let { molvalue: f = "" } = e, { showCovMod: y = -1 } = e, A = null; afterUpdate$2(() => { - v(f, A); + _(f, A); }); function x(l) { binding_callbacks$4[l ? "unshift" : "push"](() => { @@ -42664,6 +42686,7 @@ const { select_value, set_data: set_data$4, set_input_value: set_input_value$1, + set_style: set_style$2, space: space$5, svg_element: svg_element$1, text: text$5, @@ -42673,65 +42696,137 @@ const { } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3 } = window.__gradio__svelte__internal; function get_each_context$2(n, e, t) { const r = n.slice(); - return r[35] = e[t], r[36] = e, r[37] = t, r; + return r[40] = e[t], r[41] = e, r[42] = t, r; } function get_each_context_1$1(n, e, t) { const r = n.slice(); - return r[38] = e[t], r; + return r[43] = e[t], r; } function get_each_context_2(n, e, t) { const r = n.slice(); - return r[41] = e[t], r; + return r[46] = e[t], r; } function get_each_context_3(n, e, t) { const r = n.slice(); - return r[44] = e[t], r[37] = t, r; + return r[49] = e[t], r[42] = t, r; } function get_each_context_4(n, e, t) { const r = n.slice(); - return r[38] = e[t], r; + return r[43] = e[t], r; } function get_each_context_5(n, e, t) { const r = n.slice(); - return r[48] = e[t], r[49] = e, r[37] = t, r; + return r[53] = e[t], r[54] = e, r[42] = t, r; } function get_each_context_6(n, e, t) { const r = n.slice(); - return r[50] = e[t], r; + return r[55] = e[t], r; } -function create_if_block_11$1(n) { - let e, t; - function r(h, o) { - return o[0] & /*vals*/ - 1 && (e = null), e == null && (e = !!/*metals*/ - h[8].includes( +function create_if_block_15$1(n) { + let e; + function t(s, h) { + return ( /*item*/ - h[48].name - )), e ? create_if_block_12$1 : create_else_block_2; + s[53].msa ? create_if_block_16$1 : create_else_block_4 + ); } - let a = r(n, [-1, -1]), s = a(n); + let r = t(n), a = r(n); return { c() { - s.c(), t = empty$4(); + a.c(), e = empty$4(); }, - l(h) { - s.l(h), t = empty$4(); + l(s) { + a.l(s), e = empty$4(); }, - m(h, o) { - s.m(h, o), insert_hydration$6(h, t, o); + m(s, h) { + a.m(s, h), insert_hydration$6(s, e, h); }, - p(h, o) { - a === (a = r(h, o)) && s ? s.p(h, o) : (s.d(1), s = a(h), s && (s.c(), s.m(t.parentNode, t))); + p(s, h) { + r !== (r = t(s)) && (a.d(1), a = r(s), a && (a.c(), a.m(e.parentNode, e))); }, - d(h) { - h && detach$6(t), s.d(h); + d(s) { + s && detach$6(e), a.d(s); } }; } -function create_else_block_2(n) { +function create_else_block_4(n) { + let e, t = ` + + single sequence`; + return { + c() { + e = element$5("span"), e.innerHTML = t, this.h(); + }, + l(r) { + e = claim_element$5(r, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-autara" && (e.innerHTML = t), this.h(); + }, + h() { + attr$5(e, "class", "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full border border-gray-300"); + }, + m(r, a) { + insert_hydration$6(r, e, a); + }, + d(r) { + r && detach$6(e); + } + }; +} +function create_if_block_16$1(n) { + let e, t = ` + + MSA`; + return { + c() { + e = element$5("span"), e.innerHTML = t, this.h(); + }, + l(r) { + e = claim_element$5(r, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-sp8o4z" && (e.innerHTML = t), this.h(); + }, + h() { + attr$5(e, "class", "ml-4 inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full border border-gray-300"); + }, + m(r, a) { + insert_hydration$6(r, e, a); + }, + d(r) { + r && detach$6(e); + } + }; +} +function create_if_block_12$1(n) { + let e; + function t(s, h) { + return ( + /*item*/ + s[53].name !== void 0 ? create_if_block_13$1 : ( + /*item*/ + s[53].sdf !== "" ? create_if_block_14$1 : create_else_block_3 + ) + ); + } + let r = t(n), a = r(n); + return { + c() { + a.c(), e = empty$4(); + }, + l(s) { + a.l(s), e = empty$4(); + }, + m(s, h) { + a.m(s, h), insert_hydration$6(s, e, h); + }, + p(s, h) { + r === (r = t(s)) && a ? a.p(s, h) : (a.d(1), a = r(s), a && (a.c(), a.m(e.parentNode, e))); + }, + d(s) { + s && detach$6(e), a.d(s); + } + }; +} +function create_else_block_3(n) { let e = ( /*item*/ - n[48].smiles + "" + n[53].smiles + "" ), t; return { c() { @@ -42746,17 +42841,35 @@ function create_else_block_2(n) { p(r, a) { a[0] & /*vals*/ 1 && e !== (e = /*item*/ - r[48].smiles + "") && set_data$4(t, e); + r[53].smiles + "") && set_data$4(t, e); }, d(r) { r && detach$6(t); } }; } -function create_if_block_12$1(n) { +function create_if_block_14$1(n) { + let e; + return { + c() { + e = text$5("SDF file"); + }, + l(t) { + e = claim_text$4(t, "SDF file"); + }, + m(t, r) { + insert_hydration$6(t, e, r); + }, + p: noop$6, + d(t) { + t && detach$6(e); + } + }; +} +function create_if_block_13$1(n) { let e = ( /*item*/ - n[48].name + "" + n[53].name + "" ), t; return { c() { @@ -42771,7 +42884,7 @@ function create_if_block_12$1(n) { p(r, a) { a[0] & /*vals*/ 1 && e !== (e = /*item*/ - r[48].name + "") && set_data$4(t, e); + r[53].name + "") && set_data$4(t, e); }, d(r) { r && detach$6(t); @@ -42781,42 +42894,38 @@ function create_if_block_12$1(n) { function create_if_block_8$1(n) { let e, t, r, a, s, h; const o = [create_if_block_9$1, create_if_block_10$1], d = []; - function v(f, y) { + function _(f, y) { return y[0] & /*vals*/ 1 && (r = null), r == null && (r = !!["DNA", "RNA", "protein"].includes( /*item*/ - f[48].class + f[53].class )), r ? 0 : ( /*item*/ - f[48].class === "ligand" ? 1 : -1 + f[53].class === "ligand" ? 1 : -1 ); } - return ~(a = v(n, [-1, -1])) && (s = d[a] = o[a](n)), { + return ~(a = _(n, [-1, -1])) && (s = d[a] = o[a](n)), { c() { e = element$5("div"), t = element$5("div"), s && s.c(), this.h(); }, l(f) { - e = claim_element$5(f, "DIV", { - id: !0, - "aria-labelledby": !0, - class: !0 - }); + e = claim_element$5(f, "DIV", { id: !0, "aria-labelledby": !0 }); var y = children$4(e); t = claim_element$5(y, "DIV", { class: !0 }); var A = children$4(t); s && s.l(A), A.forEach(detach$6), y.forEach(detach$6), this.h(); }, h() { - attr$5(t, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900 svelte-bt9x4p"), attr$5(e, "id", `accordion-collapse-body-${/*i*/ - n[37]}`), attr$5(e, "aria-labelledby", `accordion-collapse-heading-${/*i*/ - n[37]}`), attr$5(e, "class", "svelte-bt9x4p"); + attr$5(t, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900"), attr$5(e, "id", `accordion-collapse-body-${/*i*/ + n[42]}`), attr$5(e, "aria-labelledby", `accordion-collapse-heading-${/*i*/ + n[42]}`); }, m(f, y) { insert_hydration$6(f, e, y), append_hydration$4(e, t), ~a && d[a].m(t, null), h = !0; }, p(f, y) { let A = a; - a = v(f, y), a === A ? ~a && d[a].p(f, y) : (s && (group_outros$4(), transition_out$4(d[A], 1, 1, () => { + a = _(f, y), a === A ? ~a && d[a].p(f, y) : (s && (group_outros$4(), transition_out$4(d[A], 1, 1, () => { d[A] = null; }), check_outros$4()), ~a ? (s = d[a], s ? s.p(f, y) : (s = d[a] = o[a](f), s.c()), transition_in$4(s, 1), s.m(t, null)) : s = null); }, @@ -42832,170 +42941,350 @@ function create_if_block_8$1(n) { }; } function create_if_block_10$1(n) { - let e, t, r, a, s = "- or -", h, o, d, v, f = "- or -", y, A, x, M, m, l = "- or -", u, p, g = "Metal ion", b, c, _, E, w; - function k(...F) { + let e, t = "SMILES", r, a, s, h, o, d, _, f = "click to add SMILES.", y, A, x = "- or -", M, m, l, u, p, g = "- or -", b, c, v = "SDF file", E, w, k, $, L, I, F, P = "click to add SDF file.", B, G, U = "- or -", R, W, H = "Metal ion", N, V, J, re, te; + function ue(...Q) { + return ( + /*keypress_handler_1*/ + n[19]( + /*i*/ + n[42], + ...Q + ) + ); + } + function ie() { return ( - /*input_handler_1*/ - n[17]( + /*click_handler_3*/ + n[20]( + /*item*/ + n[53], /*i*/ - n[37], - ...F + n[42] ) ); } - o = new SearchInput({ - props: { - database: "rcsb-3ligand", - index: ( + const ae = [create_if_block_11$1, create_else_block_2], ce = []; + function Me(Q, ye) { + return ( + /*item*/ + Q[53].name === "" || /*item*/ + Q[53].name == null ? 0 : 1 + ); + } + m = Me(n), l = ce[m] = ae[m](n); + function Ae(...Q) { + return ( + /*keypress_handler_2*/ + n[22]( /*i*/ - n[37] + n[42], + ...Q ) - } - }), o.$on( - "triggerFetch", - /*handleMessage*/ - n[13] - ); - function $(...F) { + ); + } + function Ie() { return ( - /*input_handler_2*/ - n[18]( + /*click_handler_5*/ + n[23]( + /*item*/ + n[53], /*i*/ - n[37], - ...F + n[42] ) ); } - let L = ensure_array_like$2( + let pe = ensure_array_like$2( /*metals*/ n[8] - ), z = []; - for (let F = 0; F < L.length; F += 1) - z[F] = create_each_block_6(get_each_context_6(n, L, F)); + ), se = []; + for (let Q = 0; Q < pe.length; Q += 1) + se[Q] = create_each_block_6(get_each_context_6(n, pe, Q)); return { c() { - e = element$5("textarea"), r = space$5(), a = element$5("div"), a.textContent = s, h = space$5(), create_component$4(o.$$.fragment), d = space$5(), v = element$5("div"), v.textContent = f, y = space$5(), A = element$5("textarea"), M = space$5(), m = element$5("div"), m.textContent = l, u = space$5(), p = element$5("div"), p.textContent = g, b = space$5(), c = element$5("div"); - for (let F = 0; F < z.length; F += 1) - z[F].c(); + e = element$5("label"), e.textContent = t, r = space$5(), a = element$5("textarea"), h = space$5(), o = element$5("div"), d = text$5("Press Enter or "), _ = element$5("button"), _.textContent = f, y = space$5(), A = element$5("div"), A.textContent = x, M = space$5(), l.c(), u = space$5(), p = element$5("div"), p.textContent = g, b = space$5(), c = element$5("label"), c.textContent = v, E = space$5(), w = element$5("textarea"), $ = space$5(), L = element$5("div"), I = text$5("Press Enter or "), F = element$5("button"), F.textContent = P, B = space$5(), G = element$5("div"), G.textContent = U, R = space$5(), W = element$5("div"), W.textContent = H, N = space$5(), V = element$5("div"); + for (let Q = 0; Q < se.length; Q += 1) + se[Q].c(); this.h(); }, - l(F) { - e = claim_element$5(F, "TEXTAREA", { + l(Q) { + e = claim_element$5(Q, "LABEL", { + for: !0, + class: !0, + "data-svelte-h": !0 + }), get_svelte_dataset$2(e) !== "svelte-1t3lt1p" && (e.textContent = t), r = claim_space$5(Q), a = claim_element$5(Q, "TEXTAREA", { rows: !0, class: !0, - placeholder: !0 - }), children$4(e).forEach(detach$6), r = claim_space$5(F), a = claim_element$5(F, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(a) !== "svelte-1f0b7yn" && (a.textContent = s), h = claim_space$5(F), claim_component$4(o.$$.fragment, F), d = claim_space$5(F), v = claim_element$5(F, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(v) !== "svelte-1f0b7yn" && (v.textContent = f), y = claim_space$5(F), A = claim_element$5(F, "TEXTAREA", { + style: !0, + placeholder: !0, + name: !0 + }), children$4(a).forEach(detach$6), h = claim_space$5(Q), o = claim_element$5(Q, "DIV", { class: !0 }); + var ye = children$4(o); + d = claim_text$4(ye, "Press Enter or "), _ = claim_element$5(ye, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(_) !== "svelte-1yubl77" && (_.textContent = f), ye.forEach(detach$6), y = claim_space$5(Q), A = claim_element$5(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(A) !== "svelte-1f0b7yn" && (A.textContent = x), M = claim_space$5(Q), l.l(Q), u = claim_space$5(Q), p = claim_element$5(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(p) !== "svelte-1f0b7yn" && (p.textContent = g), b = claim_space$5(Q), c = claim_element$5(Q, "LABEL", { + for: !0, + class: !0, + "data-svelte-h": !0 + }), get_svelte_dataset$2(c) !== "svelte-6ikd45" && (c.textContent = v), E = claim_space$5(Q), w = claim_element$5(Q, "TEXTAREA", { rows: !0, class: !0, - placeholder: !0 - }), children$4(A).forEach(detach$6), M = claim_space$5(F), m = claim_element$5(F, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(m) !== "svelte-1f0b7yn" && (m.textContent = l), u = claim_space$5(F), p = claim_element$5(F, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(p) !== "svelte-5ik8xi" && (p.textContent = g), b = claim_space$5(F), c = claim_element$5(F, "DIV", { class: !0 }); - var R = children$4(c); - for (let P = 0; P < z.length; P += 1) - z[P].l(R); - R.forEach(detach$6), this.h(); + style: !0, + placeholder: !0, + name: !0 + }), children$4(w).forEach(detach$6), $ = claim_space$5(Q), L = claim_element$5(Q, "DIV", { class: !0 }); + var ke = children$4(L); + I = claim_text$4(ke, "Press Enter or "), F = claim_element$5(ke, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(F) !== "svelte-1rji0lf" && (F.textContent = P), ke.forEach(detach$6), B = claim_space$5(Q), G = claim_element$5(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(G) !== "svelte-1f0b7yn" && (G.textContent = U), R = claim_space$5(Q), W = claim_element$5(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(W) !== "svelte-5ik8xi" && (W.textContent = H), N = claim_space$5(Q), V = claim_element$5(Q, "DIV", { class: !0 }); + var Pe = children$4(V); + for (let Ne = 0; Ne < se.length; Ne += 1) + se[Ne].l(Pe); + Pe.forEach(detach$6), this.h(); }, h() { - attr$5(e, "rows", "1"), attr$5(e, "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(e, "placeholder", "SMILES like CCC ..."), e.value = t = /*item*/ - n[48].smiles, attr$5(a, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(v, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(A, "rows", "3"), attr$5(A, "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(A, "placeholder", "SDF format 3D molecule ..."), A.value = x = /*item*/ - n[48].sdf, attr$5(m, "class", "text-center text-gray-400 w-full my-2 svelte-bt9x4p"), attr$5(p, "class", "text-center text-gray-600 font-bold mb-2 svelte-bt9x4p"), attr$5(c, "class", "flex justify-center space-x-2 svelte-bt9x4p"); - }, - m(F, R) { - insert_hydration$6(F, e, R), insert_hydration$6(F, r, R), insert_hydration$6(F, a, R), insert_hydration$6(F, h, R), mount_component$4(o, F, R), insert_hydration$6(F, d, R), insert_hydration$6(F, v, R), insert_hydration$6(F, y, R), insert_hydration$6(F, A, R), insert_hydration$6(F, M, R), insert_hydration$6(F, m, R), insert_hydration$6(F, u, R), insert_hydration$6(F, p, R), insert_hydration$6(F, b, R), insert_hydration$6(F, c, R); - for (let P = 0; P < z.length; P += 1) - z[P] && z[P].m(c, null); - _ = !0, E || (w = [ - listen$1(e, "input", k), - listen$1(A, "input", $) - ], E = !0); - }, - p(F, R) { - if (n = F, (!_ || R[0] & /*vals*/ - 1 && t !== (t = /*item*/ - n[48].smiles)) && (e.value = t), (!_ || R[0] & /*vals*/ - 1 && x !== (x = /*item*/ - n[48].sdf)) && (A.value = x), R[0] & /*vals, metals, dispatch*/ + attr$5(e, "for", "smiles" + /*i*/ + n[42]), attr$5(e, "class", "block text-sm font-bold mb-1 px-2.5 dark:text-white"), attr$5(a, "rows", "1"), attr$5(a, "class", "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"), set_style$2(a, "display", "block"), attr$5(a, "placeholder", "SMILES like CCC ..."), a.value = s = /*item*/ + n[53].smiles, attr$5(a, "name", "smiles" + /*i*/ + n[42]), attr$5(_, "class", "hover:bg-gray-100 hover:text-gray-900 underline p-1 rounded"), attr$5(o, "class", "text-gray-700 mt-0.5 px-2.5 text-right text-sm"), attr$5(A, "class", "text-center text-gray-400 w-full my-2"), attr$5(p, "class", "text-center text-gray-400 w-full my-2"), attr$5(c, "for", "sdf" + /*i*/ + n[42]), attr$5(c, "class", "block text-sm font-bold mb-1 px-2.5 dark:text-white"), attr$5(w, "rows", "3"), attr$5(w, "class", "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"), set_style$2(w, "display", "block"), attr$5(w, "placeholder", "SDF format 3D molecule ..."), w.value = k = /*item*/ + n[53].sdf, attr$5(w, "name", "sdf" + /*i*/ + n[42]), attr$5(F, "class", "hover:bg-gray-100 hover:text-gray-900 underline p-1 rounded"), attr$5(L, "class", "text-gray-700 mt-0.5 px-2.5 text-right text-sm"), attr$5(G, "class", "text-center text-gray-400 w-full my-2"), attr$5(W, "class", "text-center text-gray-600 font-bold mb-2"), attr$5(V, "class", "flex justify-center space-x-2"); + }, + m(Q, ye) { + insert_hydration$6(Q, e, ye), insert_hydration$6(Q, r, ye), insert_hydration$6(Q, a, ye), insert_hydration$6(Q, h, ye), insert_hydration$6(Q, o, ye), append_hydration$4(o, d), append_hydration$4(o, _), insert_hydration$6(Q, y, ye), insert_hydration$6(Q, A, ye), insert_hydration$6(Q, M, ye), ce[m].m(Q, ye), insert_hydration$6(Q, u, ye), insert_hydration$6(Q, p, ye), insert_hydration$6(Q, b, ye), insert_hydration$6(Q, c, ye), insert_hydration$6(Q, E, ye), insert_hydration$6(Q, w, ye), insert_hydration$6(Q, $, ye), insert_hydration$6(Q, L, ye), append_hydration$4(L, I), append_hydration$4(L, F), insert_hydration$6(Q, B, ye), insert_hydration$6(Q, G, ye), insert_hydration$6(Q, R, ye), insert_hydration$6(Q, W, ye), insert_hydration$6(Q, N, ye), insert_hydration$6(Q, V, ye); + for (let ke = 0; ke < se.length; ke += 1) + se[ke] && se[ke].m(V, null); + J = !0, re || (te = [ + listen$1(a, "keypress", ue), + listen$1(_, "click", ie), + listen$1(w, "keypress", Ae), + listen$1(F, "click", Ie) + ], re = !0); + }, + p(Q, ye) { + n = Q, (!J || ye[0] & /*vals*/ + 1 && s !== (s = /*item*/ + n[53].smiles)) && (a.value = s); + let ke = m; + if (m = Me(n), m === ke ? ce[m].p(n, ye) : (group_outros$4(), transition_out$4(ce[ke], 1, 1, () => { + ce[ke] = null; + }), check_outros$4(), l = ce[m], l ? l.p(n, ye) : (l = ce[m] = ae[m](n), l.c()), transition_in$4(l, 1), l.m(u.parentNode, u)), (!J || ye[0] & /*vals*/ + 1 && k !== (k = /*item*/ + n[53].sdf)) && (w.value = k), ye[0] & /*vals, metals, dispatch*/ 289) { - L = ensure_array_like$2( + pe = ensure_array_like$2( /*metals*/ n[8] ); - let P; - for (P = 0; P < L.length; P += 1) { - const U = get_each_context_6(n, L, P); - z[P] ? z[P].p(U, R) : (z[P] = create_each_block_6(U), z[P].c(), z[P].m(c, null)); + let Pe; + for (Pe = 0; Pe < pe.length; Pe += 1) { + const Ne = get_each_context_6(n, pe, Pe); + se[Pe] ? se[Pe].p(Ne, ye) : (se[Pe] = create_each_block_6(Ne), se[Pe].c(), se[Pe].m(V, null)); } - for (; P < z.length; P += 1) - z[P].d(1); - z.length = L.length; + for (; Pe < se.length; Pe += 1) + se[Pe].d(1); + se.length = pe.length; } }, - i(F) { - _ || (transition_in$4(o.$$.fragment, F), _ = !0); + i(Q) { + J || (transition_in$4(l), J = !0); }, - o(F) { - transition_out$4(o.$$.fragment, F), _ = !1; + o(Q) { + transition_out$4(l), J = !1; }, - d(F) { - F && (detach$6(e), detach$6(r), detach$6(a), detach$6(h), detach$6(d), detach$6(v), detach$6(y), detach$6(A), detach$6(M), detach$6(m), detach$6(u), detach$6(p), detach$6(b), detach$6(c)), destroy_component$4(o, F), destroy_each$2(z, F), E = !1, run_all$1(w); + d(Q) { + Q && (detach$6(e), detach$6(r), detach$6(a), detach$6(h), detach$6(o), detach$6(y), detach$6(A), detach$6(M), detach$6(u), detach$6(p), detach$6(b), detach$6(c), detach$6(E), detach$6(w), detach$6($), detach$6(L), detach$6(B), detach$6(G), detach$6(R), detach$6(W), detach$6(N), detach$6(V)), ce[m].d(Q), destroy_each$2(se, Q), re = !1, run_all$1(te); } }; } function create_if_block_9$1(n) { - let e, t, r, a; - function s(...h) { + let e, t, r, a, s, h, o = "Single sequence", d, _, f, y, A, x, M, m, l, u = "Use MSA", p, g, b, c, v = "click to add sequence.", E, w; + function k(...I) { return ( - /*input_handler*/ + /*keypress_handler*/ n[16]( /*i*/ - n[37], - ...h + n[42], + ...I + ) + ); + } + function $() { + n[17].call( + f, + /*each_value_5*/ + n[54], + /*i*/ + n[42] + ); + } + function L() { + return ( + /*click_handler_2*/ + n[18]( + /*item*/ + n[53], + /*i*/ + n[42] ) ); } return { c() { - e = element$5("textarea"), this.h(); + e = element$5("textarea"), r = space$5(), a = element$5("div"), s = element$5("div"), h = element$5("span"), h.textContent = o, d = space$5(), _ = element$5("label"), f = element$5("input"), y = space$5(), A = element$5("label"), x = space$5(), M = element$5("div"), m = space$5(), l = element$5("span"), l.textContent = u, p = space$5(), g = element$5("div"), b = text$5("Press Enter or "), c = element$5("button"), c.textContent = v, this.h(); }, - l(h) { - e = claim_element$5(h, "TEXTAREA", { + l(I) { + e = claim_element$5(I, "TEXTAREA", { id: !0, rows: !0, class: !0, + style: !0, placeholder: !0 - }), children$4(e).forEach(detach$6), this.h(); + }), children$4(e).forEach(detach$6), r = claim_space$5(I), a = claim_element$5(I, "DIV", { class: !0 }); + var F = children$4(a); + s = claim_element$5(F, "DIV", { class: !0 }); + var P = children$4(s); + h = claim_element$5(P, "SPAN", { "data-svelte-h": !0 }), get_svelte_dataset$2(h) !== "svelte-10nriht" && (h.textContent = o), d = claim_space$5(P), _ = claim_element$5(P, "LABEL", { class: !0 }); + var B = children$4(_); + f = claim_element$5(B, "INPUT", { + id: !0, + type: !0, + class: !0, + name: !0 + }), y = claim_space$5(B), A = claim_element$5(B, "LABEL", { for: !0, class: !0 }), children$4(A).forEach(detach$6), x = claim_space$5(B), M = claim_element$5(B, "DIV", { class: !0 }), children$4(M).forEach(detach$6), B.forEach(detach$6), m = claim_space$5(P), l = claim_element$5(P, "SPAN", { "data-svelte-h": !0 }), get_svelte_dataset$2(l) !== "svelte-avslee" && (l.textContent = u), P.forEach(detach$6), p = claim_space$5(F), g = claim_element$5(F, "DIV", { class: !0 }); + var G = children$4(g); + b = claim_text$4(G, "Press Enter or "), c = claim_element$5(G, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(c) !== "svelte-d0we91" && (c.textContent = v), G.forEach(detach$6), F.forEach(detach$6), this.h(); }, h() { - attr$5(e, "id", "message"), attr$5(e, "rows", "4"), attr$5(e, "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(e, "placeholder", "MSAVGH..."), e.value = t = /*item*/ - n[48].sequence; - }, - m(h, o) { - insert_hydration$6(h, e, o), r || (a = listen$1(e, "input", s), r = !0); + attr$5(e, "id", "message"), attr$5(e, "rows", "4"), attr$5(e, "class", "p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border-1 border-grey-200 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"), set_style$2(e, "display", "block"), attr$5(e, "placeholder", "MSAVGH..."), e.value = t = /*item*/ + n[53].sequence, attr$5(f, "id", "switch"), attr$5(f, "type", "checkbox"), attr$5(f, "class", "peer sr-only"), attr$5(f, "name", "msa" + /*i*/ + n[42]), attr$5(A, "for", "switch"), attr$5(A, "class", "hidden"), attr$5(M, "class", "peer h-5 w-9 rounded-full border bg-slate-200 after:absolute after:left-[2px] after:top-0.5 after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-slate-800 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:ring-green-300"), attr$5(_, "class", "relative inline-flex cursor-pointer items-center"), attr$5(s, "class", "flex items-center space-x-2 text-sm"), attr$5(c, "class", "hover:bg-gray-100 hover:text-gray-900 underline p-1 rounded"), attr$5(g, "class", "text-gray-700"), attr$5(a, "class", "flex items-center justify-between mt-1"); + }, + m(I, F) { + insert_hydration$6(I, e, F), insert_hydration$6(I, r, F), insert_hydration$6(I, a, F), append_hydration$4(a, s), append_hydration$4(s, h), append_hydration$4(s, d), append_hydration$4(s, _), append_hydration$4(_, f), f.checked = /*item*/ + n[53].msa, append_hydration$4(_, y), append_hydration$4(_, A), append_hydration$4(_, x), append_hydration$4(_, M), append_hydration$4(s, m), append_hydration$4(s, l), append_hydration$4(a, p), append_hydration$4(a, g), append_hydration$4(g, b), append_hydration$4(g, c), E || (w = [ + listen$1(e, "keypress", k), + listen$1(f, "change", $), + listen$1(c, "click", L) + ], E = !0); }, - p(h, o) { - n = h, o[0] & /*vals*/ + p(I, F) { + n = I, F[0] & /*vals*/ 1 && t !== (t = /*item*/ - n[48].sequence) && (e.value = t); + n[53].sequence) && (e.value = t), F[0] & /*vals*/ + 1 && (f.checked = /*item*/ + n[53].msa); }, i: noop$6, o: noop$6, - d(h) { - h && detach$6(e), r = !1, a(); + d(I) { + I && (detach$6(e), detach$6(r), detach$6(a)), E = !1, run_all$1(w); + } + }; +} +function create_else_block_2(n) { + let e, t, r, a = "Current ligand", s, h, o = "CCD", d, _, f, y, A, x, M = ' Delete', m, l; + function u() { + return ( + /*click_handler_4*/ + n[21]( + /*i*/ + n[42] + ) + ); + } + return { + c() { + e = element$5("div"), t = element$5("div"), r = element$5("label"), r.textContent = a, s = space$5(), h = element$5("button"), h.textContent = o, d = space$5(), _ = element$5("div"), f = element$5("input"), A = space$5(), x = element$5("button"), x.innerHTML = M, this.h(); + }, + l(p) { + e = claim_element$5(p, "DIV", { class: !0 }); + var g = children$4(e); + t = claim_element$5(g, "DIV", { class: !0 }); + var b = children$4(t); + r = claim_element$5(b, "LABEL", { + for: !0, + class: !0, + "data-svelte-h": !0 + }), get_svelte_dataset$2(r) !== "svelte-fid7aw" && (r.textContent = a), s = claim_space$5(b), h = claim_element$5(b, "BUTTON", { + id: !0, + "data-dropdown-toggle": !0, + class: !0, + type: !0, + "data-svelte-h": !0 + }), get_svelte_dataset$2(h) !== "svelte-1tv4fo2" && (h.textContent = o), d = claim_space$5(b), _ = claim_element$5(b, "DIV", { class: !0 }); + var c = children$4(_); + f = claim_element$5(c, "INPUT", { + type: !0, + id: !0, + class: !0, + style: !0 + }), A = claim_space$5(c), x = claim_element$5(c, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(x) !== "svelte-tmz2yy" && (x.innerHTML = M), c.forEach(detach$6), b.forEach(detach$6), g.forEach(detach$6), this.h(); + }, + h() { + attr$5(r, "for", "search-dropdown"), attr$5(r, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"), attr$5(h, "id", "dropdown-button"), attr$5(h, "data-dropdown-toggle", "dropdown"), attr$5(h, "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"), attr$5(h, "type", "button"), attr$5(f, "type", "search"), attr$5(f, "id", "search-dropdown"), attr$5(f, "class", "p-2.5 w-full h-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"), set_style$2(f, "display", "block"), f.value = y = /*item*/ + n[53].name, attr$5(x, "class", "absolute top-0 end-0 p-2.5 text-sm font-medium h-full text-white bg-red-700 rounded-e-lg border border-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800"), attr$5(_, "class", "relative w-full"), attr$5(t, "class", "flex"), attr$5(e, "class", "max-w-lg mx-auto mb-2 my-2"); + }, + m(p, g) { + insert_hydration$6(p, e, g), append_hydration$4(e, t), append_hydration$4(t, r), append_hydration$4(t, s), append_hydration$4(t, h), append_hydration$4(t, d), append_hydration$4(t, _), append_hydration$4(_, f), append_hydration$4(_, A), append_hydration$4(_, x), m || (l = listen$1(x, "click", u), m = !0); + }, + p(p, g) { + n = p, g[0] & /*vals*/ + 1 && y !== (y = /*item*/ + n[53].name) && f.value !== y && (f.value = y); + }, + i: noop$6, + o: noop$6, + d(p) { + p && detach$6(e), m = !1, l(); + } + }; +} +function create_if_block_11$1(n) { + let e, t; + return e = new SearchInput({ + props: { + database: "rcsb-3ligand", + index: ( + /*i*/ + n[42] + ) + } + }), e.$on( + "triggerFetch", + /*handleMessage*/ + n[13] + ), { + c() { + create_component$4(e.$$.fragment); + }, + l(r) { + claim_component$4(e.$$.fragment, r); + }, + m(r, a) { + mount_component$4(e, r, a), t = !0; + }, + p: noop$6, + i(r) { + t || (transition_in$4(e.$$.fragment, r), t = !0); + }, + o(r) { + transition_out$4(e.$$.fragment, r), t = !1; + }, + d(r) { + destroy_component$4(e, r); } }; } function create_each_block_6(n) { let e, t, r = ( /*metal*/ - n[50] + "" + n[55] + "" ), a, s, h, o; function d() { return ( - /*click_handler_2*/ - n[19]( + /*click_handler_6*/ + n[24]( /*metal*/ - n[50], + n[55], /*i*/ - n[37] + n[42] ) ); } @@ -43003,97 +43292,97 @@ function create_each_block_6(n) { c() { e = element$5("button"), t = element$5("span"), a = text$5(r), s = space$5(), this.h(); }, - l(v) { - e = claim_element$5(v, "BUTTON", { class: !0 }); + l(_) { + e = claim_element$5(_, "BUTTON", { class: !0 }); var f = children$4(e); t = claim_element$5(f, "SPAN", { class: !0 }); var y = children$4(t); a = claim_text$4(y, r), y.forEach(detach$6), s = claim_space$5(f), f.forEach(detach$6), this.h(); }, h() { - attr$5(t, "class", "font-medium text-gray-600 dark:text-gray-300 svelte-bt9x4p"), attr$5(e, "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( + attr$5(t, "class", "font-medium text-gray-600 dark:text-gray-300"), attr$5(e, "class", "relative inline-flex items-center justify-center w-10 h-10 overflow-hidden rounded-full dark:bg-gray-600"), toggle_class$4( e, "bg-blue-200", /*item*/ - n[48].name === /*metal*/ - n[50] + n[53].name === /*metal*/ + n[55] ), toggle_class$4( e, "bg-violet-100", /*item*/ - n[48].name !== /*metal*/ - n[50] + n[53].name !== /*metal*/ + n[55] ); }, - m(v, f) { - insert_hydration$6(v, e, f), append_hydration$4(e, t), append_hydration$4(t, a), append_hydration$4(e, s), h || (o = listen$1(e, "click", d), h = !0); + m(_, f) { + insert_hydration$6(_, e, f), append_hydration$4(e, t), append_hydration$4(t, a), append_hydration$4(e, s), h || (o = listen$1(e, "click", d), h = !0); }, - p(v, f) { - n = v, f[0] & /*vals, metals*/ + p(_, f) { + n = _, f[0] & /*vals, metals*/ 257 && toggle_class$4( e, "bg-blue-200", /*item*/ - n[48].name === /*metal*/ - n[50] + n[53].name === /*metal*/ + n[55] ), f[0] & /*vals, metals*/ 257 && toggle_class$4( e, "bg-violet-100", /*item*/ - n[48].name !== /*metal*/ - n[50] + n[53].name !== /*metal*/ + n[55] ); }, - d(v) { - v && detach$6(e), h = !1, o(); + d(_) { + _ && detach$6(e), h = !1, o(); } }; } function create_if_block_3$3(n) { let e, t, r, a, s; const h = [create_if_block_4$3, create_if_block_6$1], o = []; - function d(v, f) { + function d(_, f) { return f[0] & /*vals*/ 1 && (e = null), e == null && (e = !!["DNA", "RNA", "protein"].includes( /*item*/ - v[48].class + _[53].class )), e ? 0 : ( /*item*/ - v[48].class === "ligand" ? 1 : -1 + _[53].class === "ligand" ? 1 : -1 ); } return ~(t = d(n, [-1, -1])) && (r = o[t] = h[t](n)), { c() { r && r.c(), a = empty$4(); }, - l(v) { - r && r.l(v), a = empty$4(); + l(_) { + r && r.l(_), a = empty$4(); }, - m(v, f) { - ~t && o[t].m(v, f), insert_hydration$6(v, a, f), s = !0; + m(_, f) { + ~t && o[t].m(_, f), insert_hydration$6(_, a, f), s = !0; }, - p(v, f) { + p(_, f) { let y = t; - t = d(v, f), t === y ? ~t && o[t].p(v, f) : (r && (group_outros$4(), transition_out$4(o[y], 1, 1, () => { + t = d(_, f), t === y ? ~t && o[t].p(_, f) : (r && (group_outros$4(), transition_out$4(o[y], 1, 1, () => { o[y] = null; - }), check_outros$4()), ~t ? (r = o[t], r ? r.p(v, f) : (r = o[t] = h[t](v), r.c()), transition_in$4(r, 1), r.m(a.parentNode, a)) : r = null); + }), check_outros$4()), ~t ? (r = o[t], r ? r.p(_, f) : (r = o[t] = h[t](_), r.c()), transition_in$4(r, 1), r.m(a.parentNode, a)) : r = null); }, - i(v) { + i(_) { s || (transition_in$4(r), s = !0); }, - o(v) { + o(_) { transition_out$4(r), s = !1; }, - d(v) { - v && detach$6(a), ~t && o[t].d(v); + d(_) { + _ && detach$6(a), ~t && o[t].d(_); } }; } function create_if_block_6$1(n) { let e, t, r = ( /*item*/ - n[48].sdf !== "" && create_if_block_7$1(n) + n[53].sdf !== "" && create_if_block_7$1(n) ); return { c() { @@ -43107,7 +43396,7 @@ function create_if_block_6$1(n) { }, p(a, s) { /*item*/ - a[48].sdf !== "" ? r ? (r.p(a, s), s[0] & /*vals*/ + a[53].sdf !== "" ? r ? (r.p(a, s), s[0] & /*vals*/ 1 && transition_in$4(r, 1)) : (r = create_if_block_7$1(a), r.c(), transition_in$4(r, 1), r.m(e.parentNode, e)) : r && (group_outros$4(), transition_out$4(r, 1, 1, () => { r = null; }), check_outros$4()); @@ -43126,40 +43415,36 @@ function create_if_block_6$1(n) { function create_if_block_4$3(n) { let e, t, r, a = ( /*item*/ - n[48].sequence !== "" && create_if_block_5$3(n) + n[53].sequence !== "" && create_if_block_5$3(n) ); return { c() { e = element$5("div"), t = element$5("div"), a && a.c(), this.h(); }, l(s) { - e = claim_element$5(s, "DIV", { - id: !0, - "aria-labelledby": !0, - class: !0 - }); + e = claim_element$5(s, "DIV", { id: !0, "aria-labelledby": !0 }); var h = children$4(e); t = claim_element$5(h, "DIV", { class: !0 }); var o = children$4(t); a && a.l(o), o.forEach(detach$6), h.forEach(detach$6), this.h(); }, h() { - attr$5(t, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-bt9x4p"), toggle_class$4( + attr$5(t, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700"), toggle_class$4( t, "border-b-0", /*i*/ - n[37] != /*vals*/ + n[42] != /*vals*/ n[0].length - 1 ), attr$5(e, "id", `accordion-collapse-body-${/*i*/ - n[37]}`), attr$5(e, "aria-labelledby", `accordion-collapse-heading-${/*i*/ - n[37]}`), attr$5(e, "class", "svelte-bt9x4p"); + n[42]}`), attr$5(e, "aria-labelledby", `accordion-collapse-heading-${/*i*/ + n[42]}`); }, m(s, h) { insert_hydration$6(s, e, h), append_hydration$4(e, t), a && a.m(t, null), r = !0; }, p(s, h) { /*item*/ - s[48].sequence !== "" ? a ? (a.p(s, h), h[0] & /*vals*/ + s[53].sequence !== "" ? a ? (a.p(s, h), h[0] & /*vals*/ 1 && transition_in$4(a, 1)) : (a = create_if_block_5$3(s), a.c(), transition_in$4(a, 1), a.m(t, null)) : a && (group_outros$4(), transition_out$4(a, 1, 1, () => { a = null; }), check_outros$4()), (!r || h[0] & /*vals*/ @@ -43167,7 +43452,7 @@ function create_if_block_4$3(n) { t, "border-b-0", /*i*/ - s[37] != /*vals*/ + s[42] != /*vals*/ s[0].length - 1 ); }, @@ -43188,13 +43473,13 @@ function create_if_block_7$1(n) { props: { molvalue: ( /*item*/ - n[48].sdf + n[53].sdf ), showCovMod: ( /*showCovModVals*/ n[2][ /*i*/ - n[37] + n[42] ] ) } @@ -43214,11 +43499,11 @@ function create_if_block_7$1(n) { claim_component$4(r.$$.fragment, o), o.forEach(detach$6), h.forEach(detach$6), this.h(); }, h() { - attr$5(t, "class", "relative svelte-bt9x4p"), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 svelte-bt9x4p"), toggle_class$4( + attr$5(t, "class", "relative"), attr$5(e, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700"), toggle_class$4( e, "border-b-0", /*i*/ - n[37] != /*vals*/ + n[42] != /*vals*/ n[0].length - 1 ); }, @@ -43229,17 +43514,17 @@ function create_if_block_7$1(n) { const o = {}; h[0] & /*vals*/ 1 && (o.molvalue = /*item*/ - s[48].sdf), h[0] & /*showCovModVals*/ + s[53].sdf), h[0] & /*showCovModVals*/ 4 && (o.showCovMod = /*showCovModVals*/ s[2][ /*i*/ - s[37] + s[42] ]), r.$set(o), (!a || h[0] & /*vals*/ 1) && toggle_class$4( e, "border-b-0", /*i*/ - s[37] != /*vals*/ + s[42] != /*vals*/ s[0].length - 1 ); }, @@ -43259,7 +43544,7 @@ function create_if_block_5$3(n) { return e = new Sequence({ props: { seq: ( /*item*/ - n[48].sequence + n[53].sequence ) } }), { c() { @@ -43275,7 +43560,7 @@ function create_if_block_5$3(n) { const s = {}; a[0] & /*vals*/ 1 && (s.seq = /*item*/ - r[48].sequence), e.$set(s); + r[53].sequence), e.$set(s); }, i(r) { t || (transition_in$4(e.$$.fragment, r), t = !0); @@ -43291,70 +43576,73 @@ function create_if_block_5$3(n) { function create_each_block_5(n) { let e, t, r, a, s = ( /*item*/ - n[48].chain + "" - ), h, o, d, v, f = ( + n[53].chain + "" + ), h, o, d, _, f = ( /*labels*/ n[6][ /*item*/ - n[48].class + n[53].class ] + "" - ), y, A, x, M, m, l, u, p, g, b, c, _, E, w, k, $, L, z = !/*item*/ - n[48].open && /*item*/ - n[48].class === "ligand" && create_if_block_11$1(n); - function F(...N) { + ), y, A, x = ["DNA", "RNA", "protein"].includes( + /*item*/ + n[53].class + ), M, m, l, u, p, g, b, c, v, E, w, k, $, L, I, F, P = x && create_if_block_15$1(n), B = !/*item*/ + n[53].open && /*item*/ + n[53].class === "ligand" && create_if_block_12$1(n); + function G(...H) { return ( /*click_handler*/ n[14]( /*i*/ - n[37], - ...N + n[42], + ...H ) ); } - function R() { + function U() { return ( /*click_handler_1*/ n[15]( /*item*/ - n[48], + n[53], /*each_value_5*/ - n[49], + n[54], /*i*/ - n[37] + n[42] ) ); } - let P = ( + let R = ( /*item*/ - n[48].open && create_if_block_8$1(n) - ), U = !/*item*/ - n[48].open && create_if_block_3$3(n); + n[53].open && create_if_block_8$1(n) + ), W = !/*item*/ + n[53].open && create_if_block_3$3(n); return { c() { - e = element$5("h2"), t = element$5("button"), r = element$5("div"), a = element$5("span"), h = text$5(s), d = space$5(), v = element$5("span"), y = text$5(f), A = space$5(), x = element$5("span"), z && z.c(), M = space$5(), m = element$5("div"), l = svg_element$1("svg"), u = svg_element$1("path"), p = space$5(), g = svg_element$1("svg"), b = svg_element$1("path"), _ = space$5(), P && P.c(), E = space$5(), U && U.c(), w = empty$4(), this.h(); + e = element$5("h2"), t = element$5("button"), r = element$5("div"), a = element$5("span"), h = text$5(s), d = space$5(), _ = element$5("span"), y = text$5(f), A = space$5(), P && P.c(), M = space$5(), m = element$5("span"), B && B.c(), l = space$5(), u = element$5("div"), p = svg_element$1("svg"), g = svg_element$1("path"), b = space$5(), c = svg_element$1("svg"), v = svg_element$1("path"), w = space$5(), R && R.c(), k = space$5(), W && W.c(), $ = empty$4(), this.h(); }, - l(N) { - e = claim_element$5(N, "H2", { id: !0, class: !0 }); - var B = children$4(e); - t = claim_element$5(B, "BUTTON", { + l(H) { + e = claim_element$5(H, "H2", { id: !0 }); + var N = children$4(e); + t = claim_element$5(N, "BUTTON", { type: !0, class: !0, "data-accordion-target": !0, "aria-expanded": !0, "aria-controls": !0 }); - var W = children$4(t); - r = claim_element$5(W, "DIV", { class: !0 }); - var V = children$4(r); - a = claim_element$5(V, "SPAN", { class: !0 }); - var G = children$4(a); - h = claim_text$4(G, s), G.forEach(detach$6), d = claim_space$5(V), v = claim_element$5(V, "SPAN", { class: !0 }); - var H = children$4(v); - y = claim_text$4(H, f), H.forEach(detach$6), A = claim_space$5(V), x = claim_element$5(V, "SPAN", { class: !0 }); - var Q = children$4(x); - z && z.l(Q), Q.forEach(detach$6), V.forEach(detach$6), M = claim_space$5(W), m = claim_element$5(W, "DIV", { class: !0 }); - var te = children$4(m); - l = claim_svg_element$1(te, "svg", { + var V = children$4(t); + r = claim_element$5(V, "DIV", { class: !0 }); + var J = children$4(r); + a = claim_element$5(J, "SPAN", { class: !0 }); + var re = children$4(a); + h = claim_text$4(re, s), re.forEach(detach$6), d = claim_space$5(J), _ = claim_element$5(J, "SPAN", { class: !0 }); + var te = children$4(_); + y = claim_text$4(te, f), te.forEach(detach$6), A = claim_space$5(J), P && P.l(J), M = claim_space$5(J), m = claim_element$5(J, "SPAN", { class: !0 }); + var ue = children$4(m); + B && B.l(ue), ue.forEach(detach$6), J.forEach(detach$6), l = claim_space$5(V), u = claim_element$5(V, "DIV", { class: !0 }); + var ie = children$4(u); + p = claim_svg_element$1(ie, "svg", { "data-slot": !0, fill: !0, "stroke-width": !0, @@ -43364,13 +43652,12 @@ function create_each_block_5(n) { "aria-hidden": !0, class: !0 }); - var ee = children$4(l); - u = claim_svg_element$1(ee, "path", { + var ae = children$4(p); + g = claim_svg_element$1(ae, "path", { "stroke-linecap": !0, "stroke-linejoin": !0, - d: !0, - class: !0 - }), children$4(u).forEach(detach$6), ee.forEach(detach$6), p = claim_space$5(te), g = claim_svg_element$1(te, "svg", { + d: !0 + }), children$4(g).forEach(detach$6), ae.forEach(detach$6), b = claim_space$5(ie), c = claim_svg_element$1(ie, "svg", { "data-accordion-icon": !0, class: !0, "aria-hidden": !0, @@ -43378,113 +43665,103 @@ function create_each_block_5(n) { fill: !0, viewBox: !0 }); - var ce = children$4(g); - b = claim_svg_element$1(ce, "path", { + var ce = children$4(c); + v = claim_svg_element$1(ce, "path", { stroke: !0, "stroke-linecap": !0, "stroke-linejoin": !0, "stroke-width": !0, - d: !0, - class: !0 - }), children$4(b).forEach(detach$6), ce.forEach(detach$6), te.forEach(detach$6), W.forEach(detach$6), B.forEach(detach$6), _ = claim_space$5(N), P && P.l(N), E = claim_space$5(N), U && U.l(N), w = empty$4(), this.h(); + d: !0 + }), children$4(v).forEach(detach$6), ce.forEach(detach$6), ie.forEach(detach$6), V.forEach(detach$6), N.forEach(detach$6), w = claim_space$5(H), R && R.l(H), k = claim_space$5(H), W && W.l(H), $ = empty$4(), this.h(); }, h() { attr$5(a, "class", o = "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full " + /*colorCode*/ n[7][ /*item*/ - n[48].class - ] + " svelte-bt9x4p"), attr$5(v, "class", "svelte-bt9x4p"), attr$5(x, "class", "px-2 text-gray-800 font-bold svelte-bt9x4p"), attr$5(r, "class", "svelte-bt9x4p"), attr$5(u, "stroke-linecap", "round"), attr$5(u, "stroke-linejoin", "round"), attr$5(u, "d", "M6 18 18 6M6 6l12 12"), attr$5(u, "class", "svelte-bt9x4p"), attr$5(l, "data-slot", "icon"), attr$5(l, "fill", "none"), attr$5(l, "stroke-width", "3"), attr$5(l, "stroke", "currentColor"), attr$5(l, "viewBox", "0 0 24 24"), attr$5(l, "xmlns", "http://www.w3.org/2000/svg"), attr$5(l, "aria-hidden", "true"), attr$5(l, "class", "w-4 h-4 text-red-800 svelte-bt9x4p"), attr$5(b, "stroke", "currentColor"), attr$5(b, "stroke-linecap", "round"), attr$5(b, "stroke-linejoin", "round"), attr$5(b, "stroke-width", "2"), attr$5(b, "d", "M9 5 5 1 1 5"), attr$5(b, "class", "svelte-bt9x4p"), attr$5(g, "data-accordion-icon", ""), attr$5(g, "class", "w-3 h-3 shrink-0 svelte-bt9x4p"), attr$5(g, "aria-hidden", "true"), attr$5(g, "xmlns", "http://www.w3.org/2000/svg"), attr$5(g, "fill", "none"), attr$5(g, "viewBox", "0 0 10 6"), toggle_class$4( - g, + n[53].class + ]), attr$5(_, "class", "p-1"), attr$5(m, "class", "px-2 text-gray-800 font-bold"), attr$5(r, "class", "flex items-center justify-start"), attr$5(g, "stroke-linecap", "round"), attr$5(g, "stroke-linejoin", "round"), attr$5(g, "d", "M6 18 18 6M6 6l12 12"), attr$5(p, "data-slot", "icon"), attr$5(p, "fill", "none"), attr$5(p, "stroke-width", "3"), attr$5(p, "stroke", "currentColor"), attr$5(p, "viewBox", "0 0 24 24"), attr$5(p, "xmlns", "http://www.w3.org/2000/svg"), attr$5(p, "aria-hidden", "true"), attr$5(p, "class", "w-4 h-4 text-red-800"), attr$5(v, "stroke", "currentColor"), attr$5(v, "stroke-linecap", "round"), attr$5(v, "stroke-linejoin", "round"), attr$5(v, "stroke-width", "2"), attr$5(v, "d", "M9 5 5 1 1 5"), attr$5(c, "data-accordion-icon", ""), attr$5(c, "class", "w-3 h-3 shrink-0"), 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*/ - n[48].open - ), toggle_class$4(g, "-rotate-90", !/*item*/ - n[48].open), attr$5(m, "class", "flex items-center space-x-2 svelte-bt9x4p"), attr$5(t, "type", "button"), attr$5(t, "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(t, "data-accordion-target", `#accordion-collapse-body-${/*i*/ - n[37]}`), attr$5(t, "aria-expanded", c = /*item*/ - n[48].open), attr$5(t, "aria-controls", `accordion-collapse-body-${/*i*/ - n[37]}`), toggle_class$4( + n[53].open + ), toggle_class$4(c, "-rotate-90", !/*item*/ + n[53].open), attr$5(u, "class", "flex items-center space-x-2"), attr$5(t, "type", "button"), attr$5(t, "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"), attr$5(t, "data-accordion-target", `#accordion-collapse-body-${/*i*/ + n[42]}`), attr$5(t, "aria-expanded", E = /*item*/ + n[53].open), attr$5(t, "aria-controls", `accordion-collapse-body-${/*i*/ + n[42]}`), toggle_class$4( t, "rounded-t-xl", /*i*/ - n[37] === 0 - ), toggle_class$4( - t, - "rounded-b-xl", - /*i*/ - n[37] == /*vals*/ - n[0].length - 1 + n[42] === 0 ), toggle_class$4( t, "border-b-0", /*i*/ - n[37] != /*vals*/ + n[42] != /*vals*/ n[0].length - 1 ), attr$5(e, "id", `accordion-collapse-heading-${/*i*/ - n[37]}`), attr$5(e, "class", "svelte-bt9x4p"); + n[42]}`); }, - m(N, B) { - insert_hydration$6(N, e, B), append_hydration$4(e, t), append_hydration$4(t, r), append_hydration$4(r, a), append_hydration$4(a, h), append_hydration$4(r, d), append_hydration$4(r, v), append_hydration$4(v, y), append_hydration$4(r, A), append_hydration$4(r, x), z && z.m(x, null), append_hydration$4(t, M), append_hydration$4(t, m), append_hydration$4(m, l), append_hydration$4(l, u), append_hydration$4(m, p), append_hydration$4(m, g), append_hydration$4(g, b), insert_hydration$6(N, _, B), P && P.m(N, B), insert_hydration$6(N, E, B), U && U.m(N, B), insert_hydration$6(N, w, B), k = !0, $ || (L = [ - listen$1(l, "click", F), - listen$1(t, "click", R) - ], $ = !0); + m(H, N) { + insert_hydration$6(H, e, N), append_hydration$4(e, t), append_hydration$4(t, r), append_hydration$4(r, a), append_hydration$4(a, h), append_hydration$4(r, d), append_hydration$4(r, _), append_hydration$4(_, y), append_hydration$4(r, A), P && P.m(r, null), append_hydration$4(r, M), append_hydration$4(r, m), B && B.m(m, null), append_hydration$4(t, l), append_hydration$4(t, u), append_hydration$4(u, p), append_hydration$4(p, g), append_hydration$4(u, b), append_hydration$4(u, c), append_hydration$4(c, v), insert_hydration$6(H, w, N), R && R.m(H, N), insert_hydration$6(H, k, N), W && W.m(H, N), insert_hydration$6(H, $, N), L = !0, I || (F = [ + listen$1(p, "click", G), + listen$1(t, "click", U) + ], I = !0); }, - p(N, B) { - n = N, (!k || B[0] & /*vals*/ + p(H, N) { + n = H, (!L || N[0] & /*vals*/ 1) && s !== (s = /*item*/ - n[48].chain + "") && set_data$4(h, s), (!k || B[0] & /*vals*/ + n[53].chain + "") && set_data$4(h, s), (!L || N[0] & /*vals*/ 1 && o !== (o = "inline-flex items-center justify-center p-1 px-2 text-xs font-semibold rounded-full " + /*colorCode*/ n[7][ /*item*/ - n[48].class - ] + " svelte-bt9x4p")) && attr$5(a, "class", o), (!k || B[0] & /*vals*/ + n[53].class + ])) && attr$5(a, "class", o), (!L || N[0] & /*vals*/ 1) && f !== (f = /*labels*/ n[6][ /*item*/ - n[48].class - ] + "") && set_data$4(y, f), !/*item*/ - n[48].open && /*item*/ - n[48].class === "ligand" ? z ? z.p(n, B) : (z = create_if_block_11$1(n), z.c(), z.m(x, null)) : z && (z.d(1), z = null), (!k || B[0] & /*vals*/ + n[53].class + ] + "") && set_data$4(y, f), N[0] & /*vals*/ + 1 && (x = ["DNA", "RNA", "protein"].includes( + /*item*/ + n[53].class + )), x ? P ? P.p(n, N) : (P = create_if_block_15$1(n), P.c(), P.m(r, M)) : P && (P.d(1), P = null), !/*item*/ + n[53].open && /*item*/ + n[53].class === "ligand" ? B ? B.p(n, N) : (B = create_if_block_12$1(n), B.c(), B.m(m, null)) : B && (B.d(1), B = null), (!L || N[0] & /*vals*/ 1) && toggle_class$4( - g, + c, "rotate-180", /*item*/ - n[48].open - ), (!k || B[0] & /*vals*/ - 1) && toggle_class$4(g, "-rotate-90", !/*item*/ - n[48].open), (!k || B[0] & /*vals*/ - 1 && c !== (c = /*item*/ - n[48].open)) && attr$5(t, "aria-expanded", c), (!k || B[0] & /*vals*/ - 1) && toggle_class$4( - t, - "rounded-b-xl", - /*i*/ - n[37] == /*vals*/ - n[0].length - 1 - ), (!k || B[0] & /*vals*/ + n[53].open + ), (!L || N[0] & /*vals*/ + 1) && toggle_class$4(c, "-rotate-90", !/*item*/ + n[53].open), (!L || N[0] & /*vals*/ + 1 && E !== (E = /*item*/ + n[53].open)) && attr$5(t, "aria-expanded", E), (!L || N[0] & /*vals*/ 1) && toggle_class$4( t, "border-b-0", /*i*/ - n[37] != /*vals*/ + n[42] != /*vals*/ n[0].length - 1 ), /*item*/ - n[48].open ? P ? (P.p(n, B), B[0] & /*vals*/ - 1 && transition_in$4(P, 1)) : (P = create_if_block_8$1(n), P.c(), transition_in$4(P, 1), P.m(E.parentNode, E)) : P && (group_outros$4(), transition_out$4(P, 1, 1, () => { - P = null; + n[53].open ? R ? (R.p(n, N), N[0] & /*vals*/ + 1 && transition_in$4(R, 1)) : (R = create_if_block_8$1(n), R.c(), transition_in$4(R, 1), R.m(k.parentNode, k)) : R && (group_outros$4(), transition_out$4(R, 1, 1, () => { + R = null; }), check_outros$4()), /*item*/ - n[48].open ? U && (group_outros$4(), transition_out$4(U, 1, 1, () => { - U = null; - }), check_outros$4()) : U ? (U.p(n, B), B[0] & /*vals*/ - 1 && transition_in$4(U, 1)) : (U = create_if_block_3$3(n), U.c(), transition_in$4(U, 1), U.m(w.parentNode, w)); + n[53].open ? W && (group_outros$4(), transition_out$4(W, 1, 1, () => { + W = null; + }), check_outros$4()) : W ? (W.p(n, N), N[0] & /*vals*/ + 1 && transition_in$4(W, 1)) : (W = create_if_block_3$3(n), W.c(), transition_in$4(W, 1), W.m($.parentNode, $)); }, - i(N) { - k || (transition_in$4(P), transition_in$4(U), k = !0); + i(H) { + L || (transition_in$4(R), transition_in$4(W), L = !0); }, - o(N) { - transition_out$4(P), transition_out$4(U), k = !1; + o(H) { + transition_out$4(R), transition_out$4(W), L = !1; }, - d(N) { - N && (detach$6(e), detach$6(_), detach$6(E), detach$6(w)), z && z.d(), P && P.d(N), U && U.d(N), $ = !1, run_all$1(L); + d(H) { + H && (detach$6(e), detach$6(w), detach$6(k), detach$6($)), P && P.d(), B && B.d(), R && R.d(H), W && W.d(H), I = !1, run_all$1(F); } }; } @@ -43509,12 +43786,12 @@ function create_if_block$5(n) { a = empty$4(), this.h(); }, h() { - attr$5(e, "class", "text-center font-bold text-xl svelte-bt9x4p"); + attr$5(e, "class", "text-center font-bold text-xl"); }, m(o, d) { insert_hydration$6(o, e, d), insert_hydration$6(o, r, d); - for (let v = 0; v < h.length; v += 1) - h[v] && h[v].m(o, d); + for (let _ = 0; _ < h.length; _ += 1) + h[_] && h[_].m(o, d); insert_hydration$6(o, a, d); }, p(o, d) { @@ -43524,13 +43801,13 @@ function create_if_block$5(n) { /*covMods*/ o[1] ); - let v; - for (v = 0; v < s.length; v += 1) { - const f = get_each_context$2(o, s, v); - h[v] ? h[v].p(f, d) : (h[v] = create_each_block$2(f), h[v].c(), h[v].m(a.parentNode, a)); + let _; + for (_ = 0; _ < s.length; _ += 1) { + const f = get_each_context$2(o, s, _); + h[_] ? h[_].p(f, d) : (h[_] = create_each_block$2(f), h[_].c(), h[_].m(a.parentNode, a)); } - for (; v < h.length; v += 1) - h[v].d(1); + for (; _ < h.length; _ += 1) + h[_].d(1); h.length = s.length; } }, @@ -43542,20 +43819,20 @@ function create_if_block$5(n) { function create_each_block_4(n) { let e, t = ( /*chain*/ - n[38] + "" + n[43] + "" ), r, a; return { c() { e = element$5("option"), r = text$5(t), this.h(); }, l(s) { - e = claim_element$5(s, "OPTION", { class: !0 }); + e = claim_element$5(s, "OPTION", {}); var h = children$4(e); r = claim_text$4(h, t), h.forEach(detach$6), this.h(); }, h() { e.__value = a = /*chain*/ - n[38], set_input_value$1(e, e.__value), attr$5(e, "class", "svelte-bt9x4p"); + n[43], set_input_value$1(e, e.__value); }, m(s, h) { insert_hydration$6(s, e, h), append_hydration$4(e, r); @@ -43563,9 +43840,9 @@ function create_each_block_4(n) { p(s, h) { h[0] & /*proteinChains*/ 8 && t !== (t = /*chain*/ - s[38] + "") && set_data$4(r, t), h[0] & /*proteinChains*/ + s[43] + "") && set_data$4(r, t), h[0] & /*proteinChains*/ 8 && a !== (a = /*chain*/ - s[38]) && (e.__value = a, set_input_value$1(e, e.__value)); + s[43]) && (e.__value = a, set_input_value$1(e, e.__value)); }, d(s) { s && detach$6(e); @@ -43575,23 +43852,23 @@ function create_each_block_4(n) { function create_each_block_3(n) { let e, t = ( /*i*/ - n[37] + 1 + "" + n[42] + 1 + "" ), r, a, s = ( /*resi*/ - n[44] + "" + n[49] + "" ), h; return { c() { e = element$5("option"), r = text$5(t), a = space$5(), h = text$5(s), this.h(); }, l(o) { - e = claim_element$5(o, "OPTION", { class: !0 }); + e = claim_element$5(o, "OPTION", {}); var d = children$4(e); r = claim_text$4(d, t), a = claim_space$5(d), h = claim_text$4(d, s), d.forEach(detach$6), this.h(); }, h() { e.__value = /*i*/ - n[37] + 1, set_input_value$1(e, e.__value), attr$5(e, "class", "svelte-bt9x4p"); + n[42] + 1, set_input_value$1(e, e.__value); }, m(o, d) { insert_hydration$6(o, e, d), append_hydration$4(e, r), append_hydration$4(e, a), append_hydration$4(e, h); @@ -43599,7 +43876,7 @@ function create_each_block_3(n) { p(o, d) { d[0] & /*covMods*/ 2 && s !== (s = /*resi*/ - o[44] + "") && set_data$4(h, s); + o[49] + "") && set_data$4(h, s); }, d(o) { o && detach$6(e); @@ -43613,10 +43890,10 @@ function create_else_block_1$2(n) { e = element$5("option"), this.h(); }, l(t) { - e = claim_element$5(t, "OPTION", { class: !0 }), children$4(e).forEach(detach$6), this.h(); + e = claim_element$5(t, "OPTION", {}), children$4(e).forEach(detach$6), this.h(); }, h() { - e.disabled = !0, e.__value = "", set_input_value$1(e, e.__value), attr$5(e, "class", "svelte-bt9x4p"); + e.disabled = !0, e.__value = "", set_input_value$1(e, e.__value); }, m(t, r) { insert_hydration$6(t, e, r); @@ -43632,7 +43909,7 @@ function create_if_block_2$3(n) { /*getResAtoms*/ n[9]( /*covMod*/ - n[35] + n[40] ) ), r = []; for (let a = 0; a < t.length; a += 1) @@ -43660,7 +43937,7 @@ function create_if_block_2$3(n) { /*getResAtoms*/ a[9]( /*covMod*/ - a[35] + a[40] ) ); let h; @@ -43683,66 +43960,66 @@ function create_each_block_2(n) { /*getResname*/ n[11]( /*covMod*/ - n[35] + n[40] ) + "" ), a, s, h = ( /*atom*/ - n[41] + "" + n[46] + "" ), o, d; return { c() { e = text$5(`} `), t = element$5("option"), a = text$5(r), s = text$5(":"), o = text$5(h), this.h(); }, - l(v) { - e = claim_text$4(v, `} - `), t = claim_element$5(v, "OPTION", { class: !0 }); + l(_) { + e = claim_text$4(_, `} + `), t = claim_element$5(_, "OPTION", {}); var f = children$4(t); a = claim_text$4(f, r), s = claim_text$4(f, ":"), o = claim_text$4(f, h), f.forEach(detach$6), this.h(); }, h() { t.__value = d = /*atom*/ - n[41], set_input_value$1(t, t.__value), attr$5(t, "class", "svelte-bt9x4p"); + n[46], set_input_value$1(t, t.__value); }, - m(v, f) { - insert_hydration$6(v, e, f), insert_hydration$6(v, t, f), append_hydration$4(t, a), append_hydration$4(t, s), append_hydration$4(t, o); + m(_, f) { + insert_hydration$6(_, e, f), insert_hydration$6(_, t, f), append_hydration$4(t, a), append_hydration$4(t, s), append_hydration$4(t, o); }, - p(v, f) { + p(_, f) { f[0] & /*covMods*/ 2 && r !== (r = /*getResname*/ - v[11]( + _[11]( /*covMod*/ - v[35] + _[40] ) + "") && set_data$4(a, r), f[0] & /*covMods*/ 2 && h !== (h = /*atom*/ - v[41] + "") && set_data$4(o, h), f[0] & /*covMods, proteinChains*/ + _[46] + "") && set_data$4(o, h), f[0] & /*covMods, proteinChains*/ 10 && d !== (d = /*atom*/ - v[41]) && (t.__value = d, set_input_value$1(t, t.__value)); + _[46]) && (t.__value = d, set_input_value$1(t, t.__value)); }, - d(v) { - v && (detach$6(e), detach$6(t)); + d(_) { + _ && (detach$6(e), detach$6(t)); } }; } function create_each_block_1$1(n) { let e, t = ( /*chain*/ - n[38] + "" + n[43] + "" ), r, a, s; return { c() { e = element$5("option"), r = text$5(t), this.h(); }, l(h) { - e = claim_element$5(h, "OPTION", { class: !0 }); + e = claim_element$5(h, "OPTION", {}); var o = children$4(e); r = claim_text$4(o, t), o.forEach(detach$6), this.h(); }, h() { e.__value = a = /*chain*/ - n[38], set_input_value$1(e, e.__value), e.selected = s = /*chain*/ - n[38] === /*covMod*/ - n[35].ligand, attr$5(e, "class", "svelte-bt9x4p"); + n[43], set_input_value$1(e, e.__value), e.selected = s = /*chain*/ + n[43] === /*covMod*/ + n[40].ligand; }, m(h, o) { insert_hydration$6(h, e, o), append_hydration$4(e, r); @@ -43750,12 +44027,12 @@ function create_each_block_1$1(n) { p(h, o) { o[0] & /*ligandChains*/ 16 && t !== (t = /*chain*/ - h[38] + "") && set_data$4(r, t), o[0] & /*ligandChains*/ + h[43] + "") && set_data$4(r, t), o[0] & /*ligandChains*/ 16 && a !== (a = /*chain*/ - h[38]) && (e.__value = a, set_input_value$1(e, e.__value)), o[0] & /*ligandChains, covMods, proteinChains*/ + h[43]) && (e.__value = a, set_input_value$1(e, e.__value)), o[0] & /*ligandChains, covMods, proteinChains*/ 26 && s !== (s = /*chain*/ - h[38] === /*covMod*/ - h[35].ligand) && (e.selected = s); + h[43] === /*covMod*/ + h[40].ligand) && (e.selected = s); }, d(h) { h && detach$6(e); @@ -43772,7 +44049,7 @@ function create_else_block$4(n) { e = claim_element$5(r, "P", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-1dm8y5e" && (e.textContent = t), this.h(); }, h() { - attr$5(e, "class", "font-mono svelte-bt9x4p"); + attr$5(e, "class", "font-mono"); }, m(r, a) { insert_hydration$6(r, e, a); @@ -43786,7 +44063,7 @@ function create_else_block$4(n) { function create_if_block_1$4(n) { let e, t, r = ( /*covMod*/ - n[35].attachmentIndex + "" + n[40].attachmentIndex + "" ), a; return { c() { @@ -43798,7 +44075,7 @@ function create_if_block_1$4(n) { t = claim_text$4(h, "index "), a = claim_text$4(h, r), h.forEach(detach$6), this.h(); }, h() { - attr$5(e, "class", "font-mono svelte-bt9x4p"); + attr$5(e, "class", "font-mono"); }, m(s, h) { insert_hydration$6(s, e, h), append_hydration$4(e, t), append_hydration$4(e, a); @@ -43806,7 +44083,7 @@ function create_if_block_1$4(n) { p(s, h) { h[0] & /*covMods*/ 2 && r !== (r = /*covMod*/ - s[35].attachmentIndex + "") && set_data$4(a, r); + s[40].attachmentIndex + "") && set_data$4(a, r); }, d(s) { s && detach$6(e); @@ -43814,149 +44091,144 @@ function create_if_block_1$4(n) { }; } function create_each_block$2(n) { - let e, t, r, a, s = 'Protein', h, o, d = 'Chain Residue Atom Chirality', v, f, y, A, x, M, m, l, u, p, g = "no chirality defined", b, c = "CW", _, E = "CCW", w, k, $, L, z = 'Small molecule', F, R, P = 'Chain Atom index Chirality', U, N, B, W, V, G, H, Q, te = "no chirality defined", ee, ce = "CW", fe, oe = "CCW", he, Ae, Se, Ie, pe, le, ne, Te = ensure_array_like$2( + let e, t, r, a, s = 'Protein', h, o, d = "Chain Residue Atom Chirality", _, f, y, A, x, M, m, l, u, p, g = "no chirality defined", b, c = "CW", v, E = "CCW", w, k, $, L, I = 'Small molecule', F, P, B = 'Chain Atom index Chirality', G, U, R, W, H, N, V, J, re = "no chirality defined", te, ue = "CW", ie, ae = "CCW", ce, Me, Ae, Ie, pe, se, Q, ye = ensure_array_like$2( /*proteinChains*/ n[3] - ), Oe = []; - for (let ae = 0; ae < Te.length; ae += 1) - Oe[ae] = create_each_block_4(get_each_context_4(n, Te, ae)); - function Be() { - n[20].call( + ), ke = []; + for (let oe = 0; oe < ye.length; oe += 1) + ke[oe] = create_each_block_4(get_each_context_4(n, ye, oe)); + function Pe() { + n[25].call( y, /*i*/ - n[37] + n[42] ); } - let Ue = ensure_array_like$2( + let Ne = ensure_array_like$2( /*getResidues*/ n[10]( /*covMod*/ - n[35] + n[40] ) - ), Pe = []; - for (let ae = 0; ae < Ue.length; ae += 1) - Pe[ae] = create_each_block_3(get_each_context_3(n, Ue, ae)); + ), Be = []; + for (let oe = 0; oe < Ne.length; oe += 1) + Be[oe] = create_each_block_3(get_each_context_3(n, Ne, oe)); function Ge() { - n[22].call( + n[27].call( x, /*i*/ - n[37] + n[42] ); } - function Ne(ae, ge) { + function Ue(oe, ge) { return ( /*covMod*/ - ae[35].residue != "" ? create_if_block_2$3 : create_else_block_1$2 + oe[40].residue != "" ? create_if_block_2$3 : create_else_block_1$2 ); } - let Re = Ne(n), De = Re(n); + let Re = Ue(n), Ce = Re(n); function je() { - n[24].call( + n[29].call( m, /*i*/ - n[37] + n[42] ); } function Xe() { - n[26].call( + n[31].call( u, /*i*/ - n[37] + n[42] ); } let X = ensure_array_like$2( /*ligandChains*/ n[4] ), q = []; - for (let ae = 0; ae < X.length; ae += 1) - q[ae] = create_each_block_1$1(get_each_context_1$1(n, X, ae)); - function re() { - n[28].call( - B, + for (let oe = 0; oe < X.length; oe += 1) + q[oe] = create_each_block_1$1(get_each_context_1$1(n, X, oe)); + function ne() { + n[33].call( + R, /*i*/ - n[37] + n[42] ); } - function ye(ae, ge) { + function xe(oe, ge) { return ( /*covMod*/ - ae[35].attachmentIndex ? create_if_block_1$4 : create_else_block$4 + oe[40].attachmentIndex ? create_if_block_1$4 : create_else_block$4 ); } - let me = ye(n), ze = me(n); - function ke() { - n[30].call( - H, + let me = xe(n), ze = me(n); + function $e() { + n[35].call( + V, /*i*/ - n[37] + n[42] ); } - function K(...ae) { + function K(...oe) { return ( - /*click_handler_3*/ - n[32]( + /*click_handler_7*/ + n[37]( /*i*/ - n[37], - ...ae + n[42], + ...oe ) ); } return { c() { - e = element$5("div"), t = element$5("div"), r = element$5("div"), a = element$5("div"), a.innerHTML = s, h = space$5(), o = element$5("div"), o.innerHTML = d, v = space$5(), f = element$5("div"), y = element$5("select"); - for (let ae = 0; ae < Oe.length; ae += 1) - Oe[ae].c(); + e = element$5("div"), t = element$5("div"), r = element$5("div"), a = element$5("div"), a.innerHTML = s, h = space$5(), o = element$5("div"), o.innerHTML = d, _ = space$5(), f = element$5("div"), y = element$5("select"); + for (let oe = 0; oe < ke.length; oe += 1) + ke[oe].c(); A = space$5(), x = element$5("select"); - for (let ae = 0; ae < Pe.length; ae += 1) - Pe[ae].c(); - M = space$5(), m = element$5("select"), De.c(), l = space$5(), u = element$5("select"), p = element$5("option"), p.textContent = g, b = element$5("option"), b.textContent = c, _ = element$5("option"), _.textContent = E, w = space$5(), k = element$5("div"), $ = element$5("div"), L = element$5("div"), L.innerHTML = z, F = space$5(), R = element$5("div"), R.innerHTML = P, U = space$5(), N = element$5("div"), B = element$5("select"); - for (let ae = 0; ae < q.length; ae += 1) - q[ae].c(); - W = space$5(), V = element$5("div"), ze.c(), G = space$5(), H = element$5("select"), Q = element$5("option"), Q.textContent = te, ee = element$5("option"), ee.textContent = ce, fe = element$5("option"), fe.textContent = oe, he = space$5(), Ae = element$5("div"), Se = svg_element$1("svg"), Ie = svg_element$1("path"), pe = space$5(), this.h(); - }, - l(ae) { - e = claim_element$5(ae, "DIV", { class: !0 }); + for (let oe = 0; oe < Be.length; oe += 1) + Be[oe].c(); + M = space$5(), m = element$5("select"), Ce.c(), l = space$5(), u = element$5("select"), p = element$5("option"), p.textContent = g, b = element$5("option"), b.textContent = c, v = element$5("option"), v.textContent = E, w = space$5(), k = element$5("div"), $ = element$5("div"), L = element$5("div"), L.innerHTML = I, F = space$5(), P = element$5("div"), P.innerHTML = B, G = space$5(), U = element$5("div"), R = element$5("select"); + for (let oe = 0; oe < q.length; oe += 1) + q[oe].c(); + W = space$5(), H = element$5("div"), ze.c(), N = space$5(), V = element$5("select"), J = element$5("option"), J.textContent = re, te = element$5("option"), te.textContent = ue, ie = element$5("option"), ie.textContent = ae, ce = space$5(), Me = element$5("div"), Ae = svg_element$1("svg"), Ie = svg_element$1("path"), pe = space$5(), this.h(); + }, + l(oe) { + e = claim_element$5(oe, "DIV", { class: !0 }); var ge = children$4(e); t = claim_element$5(ge, "DIV", { class: !0 }); - var xe = children$4(t); - r = claim_element$5(xe, "DIV", { class: !0 }); - var ue = children$4(r); - a = claim_element$5(ue, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(a) !== "svelte-1eqot16" && (a.innerHTML = s), h = claim_space$5(ue), o = claim_element$5(ue, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(o) !== "svelte-1k2x92t" && (o.innerHTML = d), v = claim_space$5(ue), f = claim_element$5(ue, "DIV", { class: !0 }); - var Ce = children$4(f); - y = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); + var we = children$4(t); + r = claim_element$5(we, "DIV", { class: !0 }); + var de = children$4(r); + a = claim_element$5(de, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(a) !== "svelte-1eqot16" && (a.innerHTML = s), h = claim_space$5(de), o = claim_element$5(de, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(o) !== "svelte-1k2x92t" && (o.innerHTML = d), _ = claim_space$5(de), f = claim_element$5(de, "DIV", { class: !0 }); + var Te = children$4(f); + y = claim_element$5(Te, "SELECT", { name: !0, id: !0 }); var Z = children$4(y); - for (let rt = 0; rt < Oe.length; rt += 1) - Oe[rt].l(Z); - Z.forEach(detach$6), A = claim_space$5(Ce), x = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); + for (let rt = 0; rt < ke.length; rt += 1) + ke[rt].l(Z); + Z.forEach(detach$6), A = claim_space$5(Te), x = claim_element$5(Te, "SELECT", { name: !0, id: !0 }); var Fe = children$4(x); - for (let rt = 0; rt < Pe.length; rt += 1) - Pe[rt].l(Fe); - Fe.forEach(detach$6), M = claim_space$5(Ce), m = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); + for (let rt = 0; rt < Be.length; rt += 1) + Be[rt].l(Fe); + Fe.forEach(detach$6), M = claim_space$5(Te), m = claim_element$5(Te, "SELECT", { name: !0, id: !0 }); var We = children$4(m); - De.l(We), We.forEach(detach$6), l = claim_space$5(Ce), u = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); - var I = children$4(u); - p = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(p) !== "svelte-1d780p1" && (p.textContent = g), b = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(b) !== "svelte-wvq2yy" && (b.textContent = c), _ = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(_) !== "svelte-wxh7b0" && (_.textContent = E), I.forEach(detach$6), Ce.forEach(detach$6), ue.forEach(detach$6), w = claim_space$5(xe), k = claim_element$5(xe, "DIV", { class: !0 }); - var we = children$4(k); - $ = claim_element$5(we, "DIV", { class: !0 }); + Ce.l(We), We.forEach(detach$6), l = claim_space$5(Te), u = claim_element$5(Te, "SELECT", { name: !0, id: !0 }); + var z = children$4(u); + p = claim_element$5(z, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(p) !== "svelte-1d780p1" && (p.textContent = g), b = claim_element$5(z, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(b) !== "svelte-wvq2yy" && (b.textContent = c), v = claim_element$5(z, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(v) !== "svelte-wxh7b0" && (v.textContent = E), z.forEach(detach$6), Te.forEach(detach$6), de.forEach(detach$6), w = claim_space$5(we), k = claim_element$5(we, "DIV", { class: !0 }); + var Ee = children$4(k); + $ = claim_element$5(Ee, "DIV", { class: !0 }); var ve = children$4($); - L = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(L) !== "svelte-80ph3f" && (L.innerHTML = z), F = claim_space$5(ve), R = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(R) !== "svelte-1xhu24v" && (R.innerHTML = P), U = claim_space$5(ve), N = claim_element$5(ve, "DIV", { class: !0 }); - var Y = children$4(N); - B = claim_element$5(Y, "SELECT", { - name: !0, - id: !0, - title: !0, - class: !0 - }); - var de = children$4(B); + L = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(L) !== "svelte-80ph3f" && (L.innerHTML = I), F = claim_space$5(ve), P = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(P) !== "svelte-1xhu24v" && (P.innerHTML = B), G = claim_space$5(ve), U = claim_element$5(ve, "DIV", { class: !0 }); + var Y = children$4(U); + R = claim_element$5(Y, "SELECT", { name: !0, id: !0, title: !0 }); + var fe = children$4(R); for (let rt = 0; rt < q.length; rt += 1) - q[rt].l(de); - de.forEach(detach$6), W = claim_space$5(Y), V = claim_element$5(Y, "DIV", { class: !0 }); - var Me = children$4(V); - ze.l(Me), Me.forEach(detach$6), G = claim_space$5(Y), H = claim_element$5(Y, "SELECT", { name: !0, id: !0, class: !0 }); - var Ye = children$4(H); - Q = claim_element$5(Ye, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(Q) !== "svelte-1d780p1" && (Q.textContent = te), ee = claim_element$5(Ye, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(ee) !== "svelte-wvq2yy" && (ee.textContent = ce), fe = claim_element$5(Ye, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(fe) !== "svelte-wxh7b0" && (fe.textContent = oe), Ye.forEach(detach$6), Y.forEach(detach$6), ve.forEach(detach$6), we.forEach(detach$6), xe.forEach(detach$6), he = claim_space$5(ge), Ae = claim_element$5(ge, "DIV", { class: !0 }); - var Ze = children$4(Ae); - Se = claim_svg_element$1(Ze, "svg", { + q[rt].l(fe); + fe.forEach(detach$6), W = claim_space$5(Y), H = claim_element$5(Y, "DIV", {}); + var De = children$4(H); + ze.l(De), De.forEach(detach$6), N = claim_space$5(Y), V = claim_element$5(Y, "SELECT", { name: !0, id: !0 }); + var Ye = children$4(V); + J = claim_element$5(Ye, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(J) !== "svelte-1d780p1" && (J.textContent = re), te = claim_element$5(Ye, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(te) !== "svelte-wvq2yy" && (te.textContent = ue), ie = claim_element$5(Ye, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$2(ie) !== "svelte-wxh7b0" && (ie.textContent = ae), Ye.forEach(detach$6), Y.forEach(detach$6), ve.forEach(detach$6), Ee.forEach(detach$6), we.forEach(detach$6), ce = claim_space$5(ge), Me = claim_element$5(ge, "DIV", { class: !0 }); + var Ze = children$4(Me); + Ae = claim_svg_element$1(Ze, "svg", { "data-slot": !0, fill: !0, "stroke-width": !0, @@ -43966,160 +44238,159 @@ function create_each_block$2(n) { "aria-hidden": !0, class: !0 }); - var Ke = children$4(Se); + var Ke = children$4(Ae); Ie = claim_svg_element$1(Ke, "path", { "stroke-linecap": !0, "stroke-linejoin": !0, - d: !0, - class: !0 + d: !0 }), children$4(Ie).forEach(detach$6), Ke.forEach(detach$6), Ze.forEach(detach$6), pe = claim_space$5(ge), ge.forEach(detach$6), this.h(); }, h() { - attr$5(a, "class", "flex justify-center svelte-bt9x4p"), attr$5(o, "class", "grid grid-cols-4 font-bold svelte-bt9x4p"), attr$5(y, "name", ""), attr$5(y, "id", ""), attr$5(y, "class", "svelte-bt9x4p"), /*covMods*/ + attr$5(a, "class", "flex justify-center"), attr$5(o, "class", "grid grid-cols-4 font-bold"), attr$5(y, "name", ""), attr$5(y, "id", ""), /*covMods*/ n[1][ /*i*/ - n[37] - ].protein === void 0 && add_render_callback$2(Be), attr$5(x, "name", ""), attr$5(x, "id", ""), attr$5(x, "class", "svelte-bt9x4p"), /*covMods*/ + n[42] + ].protein === void 0 && add_render_callback$2(Pe), attr$5(x, "name", ""), attr$5(x, "id", ""), /*covMods*/ n[1][ /*i*/ - n[37] - ].residue === void 0 && add_render_callback$2(Ge), attr$5(m, "name", ""), attr$5(m, "id", ""), attr$5(m, "class", "svelte-bt9x4p"), /*covMods*/ + n[42] + ].residue === void 0 && add_render_callback$2(Ge), attr$5(m, "name", ""), attr$5(m, "id", ""), /*covMods*/ n[1][ /*i*/ - n[37] - ].atom === void 0 && add_render_callback$2(je), p.__value = "", set_input_value$1(p, p.__value), attr$5(p, "class", "svelte-bt9x4p"), b.__value = "CW", set_input_value$1(b, b.__value), attr$5(b, "class", "svelte-bt9x4p"), _.__value = "CCW", set_input_value$1(_, _.__value), attr$5(_, "class", "svelte-bt9x4p"), attr$5(u, "name", ""), attr$5(u, "id", ""), attr$5(u, "class", "svelte-bt9x4p"), /*covMods*/ + n[42] + ].atom === void 0 && add_render_callback$2(je), p.__value = "", set_input_value$1(p, p.__value), b.__value = "CW", set_input_value$1(b, b.__value), v.__value = "CCW", set_input_value$1(v, v.__value), attr$5(u, "name", ""), attr$5(u, "id", ""), /*covMods*/ n[1][ /*i*/ - n[37] - ].protein_symmetry === void 0 && add_render_callback$2(Xe), attr$5(f, "class", "grid grid-cols-4 svelte-bt9x4p"), attr$5(r, "class", "w-3/5 flex-col px-2 svelte-bt9x4p"), attr$5(L, "class", "flex justify-center svelte-bt9x4p"), attr$5(R, "class", "grid grid-cols-3 font-bold svelte-bt9x4p"), attr$5(B, "name", ""), attr$5(B, "id", ""), attr$5(B, "title", "click on atom in structure"), attr$5(B, "class", "svelte-bt9x4p"), /*covMods*/ + n[42] + ].protein_symmetry === void 0 && add_render_callback$2(Xe), attr$5(f, "class", "grid grid-cols-4"), attr$5(r, "class", "w-3/5 flex-col px-2"), attr$5(L, "class", "flex justify-center"), attr$5(P, "class", "grid grid-cols-3 font-bold"), attr$5(R, "name", ""), attr$5(R, "id", ""), attr$5(R, "title", "click on atom in structure"), /*covMods*/ n[1][ /*i*/ - n[37] - ].ligand === void 0 && add_render_callback$2(re), attr$5(V, "class", "svelte-bt9x4p"), Q.__value = "", set_input_value$1(Q, Q.__value), attr$5(Q, "class", "svelte-bt9x4p"), ee.__value = "CW", set_input_value$1(ee, ee.__value), attr$5(ee, "class", "svelte-bt9x4p"), fe.__value = "CCW", set_input_value$1(fe, fe.__value), attr$5(fe, "class", "svelte-bt9x4p"), attr$5(H, "name", ""), attr$5(H, "id", ""), attr$5(H, "class", "svelte-bt9x4p"), /*covMods*/ + n[42] + ].ligand === void 0 && add_render_callback$2(ne), J.__value = "", set_input_value$1(J, J.__value), te.__value = "CW", set_input_value$1(te, te.__value), ie.__value = "CCW", set_input_value$1(ie, ie.__value), attr$5(V, "name", ""), attr$5(V, "id", ""), /*covMods*/ n[1][ /*i*/ - n[37] - ].ligand_symmetry === void 0 && add_render_callback$2(ke), attr$5(N, "class", "grid grid-cols-3 svelte-bt9x4p"), attr$5($, "class", "flex-col p-1 svelte-bt9x4p"), attr$5(k, "class", "w-2/5 px-2 svelte-bt9x4p"), attr$5(t, "class", "flex divide-x rounded border p-1 w-full svelte-bt9x4p"), attr$5(Ie, "stroke-linecap", "round"), attr$5(Ie, "stroke-linejoin", "round"), attr$5(Ie, "d", "M6 18 18 6M6 6l12 12"), attr$5(Ie, "class", "svelte-bt9x4p"), attr$5(Se, "data-slot", "icon"), attr$5(Se, "fill", "none"), attr$5(Se, "stroke-width", "2"), attr$5(Se, "stroke", "currentColor"), attr$5(Se, "viewBox", "0 0 24 24"), attr$5(Se, "xmlns", "http://www.w3.org/2000/svg"), attr$5(Se, "aria-hidden", "true"), attr$5(Se, "class", "w-8 h-8 text-red-800 cursor-pointer svelte-bt9x4p"), attr$5(Ae, "class", "flex items-center p-2 svelte-bt9x4p"), attr$5(e, "class", "flex p-10 svelte-bt9x4p"); + n[42] + ].ligand_symmetry === void 0 && add_render_callback$2($e), attr$5(U, "class", "grid grid-cols-3"), attr$5($, "class", "flex-col p-1"), attr$5(k, "class", "w-2/5 px-2"), attr$5(t, "class", "flex divide-x rounded border p-1 w-full"), attr$5(Ie, "stroke-linecap", "round"), attr$5(Ie, "stroke-linejoin", "round"), attr$5(Ie, "d", "M6 18 18 6M6 6l12 12"), attr$5(Ae, "data-slot", "icon"), attr$5(Ae, "fill", "none"), attr$5(Ae, "stroke-width", "2"), attr$5(Ae, "stroke", "currentColor"), attr$5(Ae, "viewBox", "0 0 24 24"), attr$5(Ae, "xmlns", "http://www.w3.org/2000/svg"), attr$5(Ae, "aria-hidden", "true"), attr$5(Ae, "class", "w-8 h-8 text-red-800 cursor-pointer"), attr$5(Me, "class", "flex items-center p-2"), attr$5(e, "class", "flex p-10"); }, - m(ae, ge) { - insert_hydration$6(ae, e, ge), append_hydration$4(e, t), append_hydration$4(t, r), append_hydration$4(r, a), append_hydration$4(r, h), append_hydration$4(r, o), append_hydration$4(r, v), append_hydration$4(r, f), append_hydration$4(f, y); - for (let xe = 0; xe < Oe.length; xe += 1) - Oe[xe] && Oe[xe].m(y, null); + m(oe, ge) { + insert_hydration$6(oe, e, ge), append_hydration$4(e, t), append_hydration$4(t, r), append_hydration$4(r, a), append_hydration$4(r, h), append_hydration$4(r, o), append_hydration$4(r, _), append_hydration$4(r, f), append_hydration$4(f, y); + for (let we = 0; we < ke.length; we += 1) + ke[we] && ke[we].m(y, null); select_option( y, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].protein, !0 ), append_hydration$4(f, A), append_hydration$4(f, x); - for (let xe = 0; xe < Pe.length; xe += 1) - Pe[xe] && Pe[xe].m(x, null); + for (let we = 0; we < Be.length; we += 1) + Be[we] && Be[we].m(x, null); select_option( x, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].residue, !0 - ), append_hydration$4(f, M), append_hydration$4(f, m), De.m(m, null), select_option( + ), append_hydration$4(f, M), append_hydration$4(f, m), Ce.m(m, null), select_option( m, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].atom, !0 - ), append_hydration$4(f, l), append_hydration$4(f, u), append_hydration$4(u, p), append_hydration$4(u, b), append_hydration$4(u, _), select_option( + ), append_hydration$4(f, l), append_hydration$4(f, u), append_hydration$4(u, p), append_hydration$4(u, b), append_hydration$4(u, v), select_option( u, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].protein_symmetry, !0 - ), append_hydration$4(t, w), append_hydration$4(t, k), append_hydration$4(k, $), append_hydration$4($, L), append_hydration$4($, F), append_hydration$4($, R), append_hydration$4($, U), append_hydration$4($, N), append_hydration$4(N, B); - for (let xe = 0; xe < q.length; xe += 1) - q[xe] && q[xe].m(B, null); + ), append_hydration$4(t, w), append_hydration$4(t, k), append_hydration$4(k, $), append_hydration$4($, L), append_hydration$4($, F), append_hydration$4($, P), append_hydration$4($, G), append_hydration$4($, U), append_hydration$4(U, R); + for (let we = 0; we < q.length; we += 1) + q[we] && q[we].m(R, null); select_option( - B, + R, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].ligand, !0 - ), append_hydration$4(N, W), append_hydration$4(N, V), ze.m(V, null), append_hydration$4(N, G), append_hydration$4(N, H), append_hydration$4(H, Q), append_hydration$4(H, ee), append_hydration$4(H, fe), select_option( - H, + ), append_hydration$4(U, W), append_hydration$4(U, H), ze.m(H, null), append_hydration$4(U, N), append_hydration$4(U, V), append_hydration$4(V, J), append_hydration$4(V, te), append_hydration$4(V, ie), select_option( + V, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].ligand_symmetry, !0 - ), append_hydration$4(e, he), append_hydration$4(e, Ae), append_hydration$4(Ae, Se), append_hydration$4(Se, Ie), append_hydration$4(e, pe), le || (ne = [ - listen$1(y, "change", Be), + ), append_hydration$4(e, ce), append_hydration$4(e, Me), append_hydration$4(Me, Ae), append_hydration$4(Ae, Ie), append_hydration$4(e, pe), se || (Q = [ + listen$1(y, "change", Pe), listen$1( y, "change", /*change_handler*/ - n[21] + n[26] ), listen$1(x, "change", Ge), listen$1( x, "change", /*change_handler_1*/ - n[23] + n[28] ), listen$1(m, "change", je), listen$1( m, "change", /*change_handler_2*/ - n[25] + n[30] ), listen$1(u, "change", Xe), listen$1( u, "change", /*change_handler_3*/ - n[27] + n[32] ), - listen$1(B, "change", re), + listen$1(R, "change", ne), listen$1( - B, + R, "change", /*change_handler_4*/ - n[29] + n[34] ), - listen$1(H, "change", ke), + listen$1(V, "change", $e), listen$1( - H, + V, "change", /*change_handler_5*/ - n[31] + n[36] ), - listen$1(Se, "click", K) - ], le = !0); + listen$1(Ae, "click", K) + ], se = !0); }, - p(ae, ge) { - if (n = ae, ge[0] & /*proteinChains*/ + p(oe, ge) { + if (n = oe, ge[0] & /*proteinChains*/ 8) { - Te = ensure_array_like$2( + ye = ensure_array_like$2( /*proteinChains*/ n[3] ); - let xe; - for (xe = 0; xe < Te.length; xe += 1) { - const ue = get_each_context_4(n, Te, xe); - Oe[xe] ? Oe[xe].p(ue, ge) : (Oe[xe] = create_each_block_4(ue), Oe[xe].c(), Oe[xe].m(y, null)); + let we; + for (we = 0; we < ye.length; we += 1) { + const de = get_each_context_4(n, ye, we); + ke[we] ? ke[we].p(de, ge) : (ke[we] = create_each_block_4(de), ke[we].c(), ke[we].m(y, null)); } - for (; xe < Oe.length; xe += 1) - Oe[xe].d(1); - Oe.length = Te.length; + for (; we < ke.length; we += 1) + ke[we].d(1); + ke.length = ye.length; } if (ge[0] & /*covMods, proteinChains*/ 10 && select_option( @@ -44127,25 +44398,25 @@ function create_each_block$2(n) { /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].protein ), ge[0] & /*getResidues, covMods*/ 1026) { - Ue = ensure_array_like$2( + Ne = ensure_array_like$2( /*getResidues*/ n[10]( /*covMod*/ - n[35] + n[40] ) ); - let xe; - for (xe = 0; xe < Ue.length; xe += 1) { - const ue = get_each_context_3(n, Ue, xe); - Pe[xe] ? Pe[xe].p(ue, ge) : (Pe[xe] = create_each_block_3(ue), Pe[xe].c(), Pe[xe].m(x, null)); + let we; + for (we = 0; we < Ne.length; we += 1) { + const de = get_each_context_3(n, Ne, we); + Be[we] ? Be[we].p(de, ge) : (Be[we] = create_each_block_3(de), Be[we].c(), Be[we].m(x, null)); } - for (; xe < Pe.length; xe += 1) - Pe[xe].d(1); - Pe.length = Ue.length; + for (; we < Be.length; we += 1) + Be[we].d(1); + Be.length = Ne.length; } if (ge[0] & /*covMods, proteinChains*/ 10 && select_option( @@ -44153,15 +44424,15 @@ function create_each_block$2(n) { /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].residue - ), Re === (Re = Ne(n)) && De ? De.p(n, ge) : (De.d(1), De = Re(n), De && (De.c(), De.m(m, null))), ge[0] & /*covMods, proteinChains*/ + ), Re === (Re = Ue(n)) && Ce ? Ce.p(n, ge) : (Ce.d(1), Ce = Re(n), Ce && (Ce.c(), Ce.m(m, null))), ge[0] & /*covMods, proteinChains*/ 10 && select_option( m, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].atom ), ge[0] & /*covMods, proteinChains*/ 10 && select_option( @@ -44169,7 +44440,7 @@ function create_each_block$2(n) { /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].protein_symmetry ), ge[0] & /*ligandChains, covMods*/ 18) { @@ -44177,35 +44448,35 @@ function create_each_block$2(n) { /*ligandChains*/ n[4] ); - let xe; - for (xe = 0; xe < X.length; xe += 1) { - const ue = get_each_context_1$1(n, X, xe); - q[xe] ? q[xe].p(ue, ge) : (q[xe] = create_each_block_1$1(ue), q[xe].c(), q[xe].m(B, null)); + let we; + for (we = 0; we < X.length; we += 1) { + const de = get_each_context_1$1(n, X, we); + q[we] ? q[we].p(de, ge) : (q[we] = create_each_block_1$1(de), q[we].c(), q[we].m(R, null)); } - for (; xe < q.length; xe += 1) - q[xe].d(1); + for (; we < q.length; we += 1) + q[we].d(1); q.length = X.length; } ge[0] & /*covMods, proteinChains*/ 10 && select_option( - B, + R, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].ligand - ), me === (me = ye(n)) && ze ? ze.p(n, ge) : (ze.d(1), ze = me(n), ze && (ze.c(), ze.m(V, null))), ge[0] & /*covMods, proteinChains*/ + ), me === (me = xe(n)) && ze ? ze.p(n, ge) : (ze.d(1), ze = me(n), ze && (ze.c(), ze.m(H, null))), ge[0] & /*covMods, proteinChains*/ 10 && select_option( - H, + V, /*covMods*/ n[1][ /*i*/ - n[37] + n[42] ].ligand_symmetry ); }, - d(ae) { - ae && detach$6(e), destroy_each$2(Oe, ae), destroy_each$2(Pe, ae), De.d(), destroy_each$2(q, ae), ze.d(), le = !1, run_all$1(ne); + d(oe) { + oe && detach$6(e), destroy_each$2(ke, oe), destroy_each$2(Be, oe), Ce.d(), destroy_each$2(q, oe), ze.d(), se = !1, run_all$1(Q); } }; } @@ -44214,10 +44485,10 @@ function create_fragment$6(n) { /*vals*/ n[0] ), h = []; - for (let v = 0; v < s.length; v += 1) - h[v] = create_each_block_5(get_each_context_5(n, s, v)); - const o = (v) => transition_out$4(h[v], 1, 1, () => { - h[v] = null; + for (let _ = 0; _ < s.length; _ += 1) + h[_] = create_each_block_5(get_each_context_5(n, s, _)); + const o = (_) => transition_out$4(h[_], 1, 1, () => { + h[_] = null; }); let d = ( /*covMods*/ @@ -44226,16 +44497,12 @@ function create_fragment$6(n) { return { c() { e = element$5("div"); - for (let v = 0; v < h.length; v += 1) - h[v].c(); + for (let _ = 0; _ < h.length; _ += 1) + h[_].c(); t = space$5(), r = element$5("div"), d && d.c(), this.h(); }, - l(v) { - e = claim_element$5(v, "DIV", { - id: !0, - "data-accordion": !0, - class: !0 - }); + l(_) { + e = claim_element$5(_, "DIV", { "data-accordion": !0 }); var f = children$4(e); for (let A = 0; A < h.length; A += 1) h[A].l(f); @@ -44244,24 +44511,24 @@ function create_fragment$6(n) { d && d.l(y), y.forEach(detach$6), f.forEach(detach$6), this.h(); }, h() { - attr$5(r, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 w-full svelte-bt9x4p"), attr$5(e, "id", "accordion-collapse"), attr$5(e, "data-accordion", "collapse"), attr$5(e, "class", "svelte-bt9x4p"); + attr$5(r, "class", "p-5 border border-t-0 border-gray-200 dark:border-gray-700 w-full"), attr$5(e, "data-accordion", "collapse"); }, - m(v, f) { - insert_hydration$6(v, e, f); + m(_, f) { + insert_hydration$6(_, e, f); for (let y = 0; y < h.length; y += 1) h[y] && h[y].m(e, null); append_hydration$4(e, t), append_hydration$4(e, r), d && d.m(r, null), a = !0; }, - p(v, f) { + p(_, f) { if (f[0] & /*vals, showCovModVals, updateMol, dispatch, metals, handleMessage, labels, colorCode*/ 12773) { s = ensure_array_like$2( /*vals*/ - v[0] + _[0] ); let y; for (y = 0; y < s.length; y += 1) { - const A = get_each_context_5(v, s, y); + const A = get_each_context_5(_, s, y); h[y] ? (h[y].p(A, f), transition_in$4(h[y], 1)) : (h[y] = create_each_block_5(A), h[y].c(), transition_in$4(h[y], 1), h[y].m(e, t)); } for (group_outros$4(), y = s.length; y < h.length; y += 1) @@ -44269,23 +44536,23 @@ function create_fragment$6(n) { check_outros$4(); } /*covMods*/ - v[1].length > 0 ? d ? d.p(v, f) : (d = create_if_block$5(v), d.c(), d.m(r, null)) : d && (d.d(1), d = null); + _[1].length > 0 ? d ? d.p(_, f) : (d = create_if_block$5(_), d.c(), d.m(r, null)) : d && (d.d(1), d = null); }, - i(v) { + i(_) { if (!a) { for (let f = 0; f < s.length; f += 1) transition_in$4(h[f]); a = !0; } }, - o(v) { + o(_) { h = h.filter(Boolean); for (let f = 0; f < h.length; f += 1) transition_out$4(h[f]); a = !1; }, - d(v) { - v && detach$6(e), destroy_each$2(h, v), d && d.d(); + d(_) { + _ && detach$6(e), destroy_each$2(h, _), d && d.d(); } }; } @@ -44301,7 +44568,7 @@ function instance$6(n, e, t) { RNA: "bg-green-200 text-blue-800", protein: "bg-blue-200 text-blue-800", ligand: "bg-orange-200 text-blue-800" - }, v = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"], f = [], y = [], A = { + }, _ = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"], f = [], y = [], A = { 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"], @@ -44360,82 +44627,115 @@ function instance$6(n, e, t) { Y: "TYR", V: "VAL" }; - function M(H) { - let Q = a.find((ee) => ee.chain === H.protein).sequence; - if (Q.length < H.residue) + function M(ie) { + let ae = a.find((Me) => Me.chain === ie.protein).sequence; + if (ae.length < ie.residue) return alert("Residue number is too high"), []; - let te = Q[H.residue - 1]; - return A[te]; + let ce = ae[ie.residue - 1]; + return A[ce]; } - function m(H) { - let Q = a.find((te) => te.chain === H.protein).sequence; - return Array.from(Q).map((te) => x[te]); + function m(ie) { + let ae = a.find((ce) => ce.chain === ie.protein).sequence; + return Array.from(ae).map((ce) => x[ce]); } - function l(H) { - let te = a.find((ee) => ee.chain === H.protein).sequence[H.residue - 1]; - return x[te]; + function l(ie) { + let ce = a.find((Me) => Me.chain === ie.protein).sequence[ie.residue - 1]; + return x[ce]; } - function u(H) { - let Q = H.detail.index; - t(1, s[Q].mol = H.detail.mol, s), t(1, s[Q].attachmentIndex = H.detail.attachmentIndex, s), t(1, s[Q].deleteIndexes = H.detail.deleteIndexes, s), r("updateCovMod", s); + function u(ie) { + let ae = ie.detail.index; + t(1, s[ae].mol = ie.detail.mol, s), t(1, s[ae].attachmentIndex = ie.detail.attachmentIndex, s), t(1, s[ae].deleteIndexes = ie.detail.deleteIndexes, s), r("updateCovMod", s); } - function p(H) { - fetch(`https://files.rcsb.org/ligands/download/${H.detail.text}_ideal.sdf`).then((Q) => { - if (!Q.ok) + function p(ie) { + fetch(`https://files.rcsb.org/ligands/download/${ie.detail.text}_ideal.sdf`).then((ae) => { + if (!ae.ok) throw new Error("Network response was not ok"); - return Q.text(); - }).then((Q) => { + return ae.text(); + }).then((ae) => { r("updateVals", { - sdf: Q, - index: H.detail.index, + sdf: ae, + name: ie.detail.text, + index: ie.detail.index, close: !0 }); - }).catch((Q) => { + }).catch((ae) => { alert("Error fetching sdf file"); }); } - const g = (H, Q) => { - r("removeVal", H); - }, b = (H, Q, te) => t(0, Q[te].open = !H.open, a), c = (H, Q) => { - r("updateVals", { sequence: Q.target.value, index: H }); - }, _ = (H, Q) => { - r("updateVals", { smiles: Q.target.value, index: H }); - }, E = (H, Q) => { - r("updateVals", { sdf: Q.target.value, index: H }); - }, w = (H, Q) => r("updateVals", { name: H, index: Q }); - function k(H) { - s[H].protein = select_value(this), t(1, s), t(3, f), t(0, a); - } - const $ = () => r("updateCovMod", s); - function L(H) { - s[H].residue = select_value(this), t(1, s), t(3, f), t(0, a); - } - const z = () => r("updateCovMod", s); - function F(H) { - s[H].atom = select_value(this), t(1, s), t(3, f), t(0, a); - } - const R = () => r("updateCovMod", s); - function P(H) { - s[H].protein_symmetry = select_value(this), t(1, s), t(3, f), t(0, a); + const g = (ie, ae) => { + r("removeVal", ie); + }, b = (ie, ae, ce) => t(0, ae[ce].open = !ie.open, a), c = (ie, ae) => { + ae.key === "Enter" && (ae.target.value.length != 0 ? r("updateVals", { + sequence: ae.target.value, + close: !0, + index: ie + }) : alert("Sequence is empty")); + }; + function v(ie, ae) { + ie[ae].msa = this.checked, t(0, a); + } + const E = (ie, ae) => { + ie.sequence.length != 0 ? r("updateVals", { + sequence: ie.sequence, + close: !0, + index: ae + }) : alert("Sequence is empty"); + }, w = (ie, ae) => { + ae.key === "Enter" && (ae.target.value.length != 0 ? r("updateVals", { + smiles: ae.target.value, + close: !0, + index: ie + }) : alert("Sequence is empty")); + }, k = (ie, ae) => { + ie.smiles != "" ? r("updateVals", { + smiles: ie.smiles, + close: !0, + index: ae + }) : alert("SMILES is empty"); + }, $ = (ie) => { + r("updateVals", { name: "", sdf: "", open: !0, index: ie }); + }, L = (ie, ae) => { + ae.key === "Enter" && (ae.target.value != "" ? r("updateVals", { + sdf: ae.target.value, + close: !0, + index: ie + }) : alert("SDF is empty")); + }, I = (ie, ae) => { + ie.sdf != "" ? r("updateVals", { sdf: ie.sdf, close: !0, index: ae }) : alert("SDF file is empty"); + }, F = (ie, ae) => r("updateVals", { name: ie, index: ae }); + function P(ie) { + s[ie].protein = select_value(this), t(1, s), t(3, f), t(0, a); + } + const B = () => r("updateCovMod", s); + function G(ie) { + s[ie].residue = select_value(this), t(1, s), t(3, f), t(0, a); } const U = () => r("updateCovMod", s); - function N(H) { - s[H].ligand = select_value(this), t(1, s), t(3, f), t(0, a); + function R(ie) { + s[ie].atom = select_value(this), t(1, s), t(3, f), t(0, a); } - const B = () => r("updateCovMod", s); - function W(H) { - s[H].ligand_symmetry = select_value(this), t(1, s), t(3, f), t(0, a); + const W = () => r("updateCovMod", s); + function H(ie) { + s[ie].protein_symmetry = select_value(this), t(1, s), t(3, f), t(0, a); } - const V = () => r("updateCovMod", s), G = (H, Q) => { - r("removeCovMod", H); + const N = () => r("updateCovMod", s); + function V(ie) { + s[ie].ligand = select_value(this), t(1, s), t(3, f), t(0, a); + } + const J = () => r("updateCovMod", s); + function re(ie) { + s[ie].ligand_symmetry = select_value(this), t(1, s), t(3, f), t(0, a); + } + const te = () => r("updateCovMod", s), ue = (ie, ae) => { + r("removeCovMod", ie); }; - return n.$$set = (H) => { - "vals" in H && t(0, a = H.vals), "covMods" in H && t(1, s = H.covMods); + return n.$$set = (ie) => { + "vals" in ie && t(0, a = ie.vals), "covMods" in ie && t(1, s = ie.covMods); }, n.$$.update = () => { n.$$.dirty[0] & /*covMods, vals*/ - 3 && s && t(2, h = a.map((H) => s.findIndex((Q) => Q.ligand === H.chain))), n.$$.dirty[0] & /*vals*/ - 1 && t(3, f = a.filter((H) => H.class === "protein").map((H) => H.chain)), n.$$.dirty[0] & /*vals*/ - 1 && t(4, y = a.filter((H) => H.class === "ligand").map((H) => H.chain)); + 3 && s && t(2, h = a.map((ie) => s.findIndex((ae) => ae.ligand === ie.chain))), n.$$.dirty[0] & /*vals*/ + 1 && t(3, f = a.filter((ie) => ie.class === "protein").map((ie) => ie.chain)), n.$$.dirty[0] & /*vals*/ + 1 && t(4, y = a.filter((ie) => ie.class === "ligand").map((ie) => ie.chain)); }, [ a, s, @@ -44445,7 +44745,7 @@ function instance$6(n, e, t) { r, o, d, - v, + _, M, m, l, @@ -44454,22 +44754,27 @@ function instance$6(n, e, t) { g, b, c, - _, + v, E, w, k, $, L, - z, + I, F, - R, P, - U, - N, B, + G, + U, + R, W, + H, + N, V, - G + J, + re, + te, + ue ]; } class Accordion extends SvelteComponent$6 { @@ -44504,7 +44809,7 @@ const { function create_if_block$4(n) { let e, t, r, a; const s = [create_if_block_1$3, create_else_block$3], h = []; - function o(d, v) { + function o(d, _) { return ( /*vals*/ d[0].length > 0 ? 0 : 1 @@ -44517,14 +44822,14 @@ function create_if_block$4(n) { l(d) { t.l(d), r = empty$3(); }, - m(d, v) { - h[e].m(d, v), insert_hydration$5(d, r, v), a = !0; + m(d, _) { + h[e].m(d, _), insert_hydration$5(d, r, _), a = !0; }, - p(d, v) { + p(d, _) { let f = e; - e = o(d), e === f ? h[e].p(d, v) : (group_outros$3(), transition_out$3(h[f], 1, 1, () => { + e = o(d), e === f ? h[e].p(d, _) : (group_outros$3(), transition_out$3(h[f], 1, 1, () => { h[f] = null; - }), check_outros$3(), t = h[e], t ? t.p(d, v) : (t = h[e] = s[e](d), t.c()), transition_in$3(t, 1), t.m(r.parentNode, r)); + }), check_outros$3(), t = h[e], t ? t.p(d, _) : (t = h[e] = s[e](d), t.c()), transition_in$3(t, 1), t.m(r.parentNode, r)); }, i(d) { a || (transition_in$3(t), a = !0); @@ -44538,23 +44843,23 @@ function create_if_block$4(n) { }; } function create_else_block$3(n) { - let e, t = "Empty input", r, a, s = "You can import a protein from the PDB", h, o, d, v, f = "- or create the input from scratch -", y; + let e, t = "Empty input", r, a, s = "You can import a protein from the PDB", h, o, d, _, f = "- or create the input from scratch -", y; return o = new SearchInput({ props: { database: "rcsb-bioass" } }), o.$on( "triggerFetch", /*handleMessage*/ n[2] ), { c() { - e = element$4("div"), e.textContent = t, r = space$4(), a = element$4("div"), a.textContent = s, h = space$4(), create_component$3(o.$$.fragment), d = space$4(), v = element$4("div"), v.textContent = f, this.h(); + e = element$4("div"), e.textContent = t, r = space$4(), a = element$4("div"), a.textContent = s, h = space$4(), create_component$3(o.$$.fragment), d = space$4(), _ = element$4("div"), _.textContent = f, this.h(); }, l(A) { - e = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(e) !== "svelte-1vyb54w" && (e.textContent = t), r = claim_space$4(A), a = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(a) !== "svelte-15ru6yv" && (a.textContent = s), h = claim_space$4(A), claim_component$3(o.$$.fragment, A), d = claim_space$4(A), v = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(v) !== "svelte-17yf25u" && (v.textContent = f), this.h(); + e = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(e) !== "svelte-1vyb54w" && (e.textContent = t), r = claim_space$4(A), a = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(a) !== "svelte-15ru6yv" && (a.textContent = s), h = claim_space$4(A), claim_component$3(o.$$.fragment, A), d = claim_space$4(A), _ = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(_) !== "svelte-17yf25u" && (_.textContent = f), this.h(); }, h() { - attr$4(e, "class", "my-8 text-center text-gray-600 svelte-13zuw1o"), attr$4(a, "class", "text-center text-gray-400 svelte-13zuw1o"), attr$4(v, "class", "text-center text-gray-400 w-full my-2 svelte-13zuw1o"); + attr$4(e, "class", "my-8 text-center text-gray-600"), attr$4(a, "class", "text-center text-gray-400"), attr$4(_, "class", "text-center text-gray-400 w-full my-2"); }, m(A, x) { - insert_hydration$5(A, e, x), insert_hydration$5(A, r, x), insert_hydration$5(A, a, x), insert_hydration$5(A, h, x), mount_component$3(o, A, x), insert_hydration$5(A, d, x), insert_hydration$5(A, v, x), y = !0; + insert_hydration$5(A, e, x), insert_hydration$5(A, r, x), insert_hydration$5(A, a, x), insert_hydration$5(A, h, x), mount_component$3(o, A, x), insert_hydration$5(A, d, x), insert_hydration$5(A, _, x), y = !0; }, p: noop$5, i(A) { @@ -44564,7 +44869,7 @@ function create_else_block$3(n) { transition_out$3(o.$$.fragment, A), y = !1; }, d(A) { - A && (detach$5(e), detach$5(r), detach$5(a), detach$5(h), detach$5(d), detach$5(v)), destroy_component$3(o, A); + A && (detach$5(e), detach$5(r), detach$5(a), detach$5(h), detach$5(d), detach$5(_)), destroy_component$3(o, A); } }; } @@ -44749,12 +45054,12 @@ function importBioAssembly(n) { }); return Promise.all([e, r]).then(([s, h]) => { let o = []; - return h[0].entities.forEach((v) => { - const f = extractEntityInfo(v, s[n]); + return h[0].entities.forEach((_) => { + const f = extractEntityInfo(_, s[n]); o.push({ - class: v.class, + class: _.class, entityInfo: f, - count: v.count + count: _.count }); }), o; }); @@ -44767,24 +45072,24 @@ function instance$5(n, e, t) { let p = u.detail.text; p = p.toLowerCase(); let g = await importBioAssembly(p), b = [], c = ""; - await Promise.all(g.map(async (_) => { - if (["DNA", "RNA", "protein"].includes(_.class)) - for (let E = 0; E < _.count; E++) + await Promise.all(g.map(async (v) => { + if (["DNA", "RNA", "protein"].includes(v.class)) + for (let E = 0; E < v.count; E++) c = nextChainTemp(c), b.push({ - class: _.class, + class: v.class, name: "", smiles: "", sdf: "", - sequence: _.entityInfo, + sequence: v.entityInfo, open: !1, chain: c }), await tick$2(); - else if (_.class === "ligand") { + else if (v.class === "ligand") { let E = "", w = ""; - s.includes(_.entityInfo) ? E = _.entityInfo : w = await getSDF(_.entityInfo); - for (let k = 0; k < _.count; k++) + s.includes(v.entityInfo) ? E = v.entityInfo : w = await getSDF(v.entityInfo); + for (let k = 0; k < v.count; k++) c = nextChainTemp(c), b.push({ - class: _.class, + class: v.class, name: E, smiles: "", sdf: w, @@ -44797,8 +45102,8 @@ function instance$5(n, e, t) { })), t(0, o = b), a("updateVals", o); } let o = [], d = []; - function v(u) { - u.detail.sequence !== void 0 && t(0, o[u.detail.index].sequence = u.detail.sequence, o), u.detail.name !== void 0 && (t(0, o[u.detail.index].name = u.detail.name, o), t(0, o[u.detail.index].open = u.detail.open, o), t(0, o[u.detail.index].sdf = "", o), t(0, o[u.detail.index].smiles = "", o)), u.detail.smiles !== void 0 && (t(0, o[u.detail.index].smiles = u.detail.smiles, o), t(0, o[u.detail.index].sdf = "", o), t(0, o[u.detail.index].name = "", o)), u.detail.sdf !== void 0 && (u.detail.close == !0 && t(0, o[u.detail.index].open = !1, o), t(0, o[u.detail.index].sdf = u.detail.sdf, o), t(0, o[u.detail.index].name = "", o), t(0, o[u.detail.index].smiles = "", o)), a("updateVals", o); + function _(u) { + u.detail.sequence !== void 0 && t(0, o[u.detail.index].sequence = u.detail.sequence, o), u.detail.name !== void 0 ? t(0, o[u.detail.index].name = u.detail.name, o) : t(0, o[u.detail.index].name = "", o), u.detail.smiles !== void 0 ? t(0, o[u.detail.index].smiles = u.detail.smiles, o) : t(0, o[u.detail.index].smiles = "", o), u.detail.sdf !== void 0 ? t(0, o[u.detail.index].sdf = u.detail.sdf, o) : t(0, o[u.detail.index].sdf = "", o), u.detail.close == !0 ? t(0, o[u.detail.index].open = !1, o) : t(0, o[u.detail.index].open = !0, o), a("updateVals", o); } function f() { let u = "A"; @@ -44822,7 +45127,8 @@ function instance$5(n, e, t) { sdf: "", sequence: "", open: !0, - chain: p + chain: p, + msa: !0 }), t(0, o), t(10, l), t(9, r); } function A(u) { @@ -44870,7 +45176,7 @@ function instance$5(n, e, t) { o, d, h, - v, + _, y, A, x, @@ -44939,11 +45245,11 @@ function writable(n, e = noop$4) { function a(o) { if (safe_not_equal$5(n, o) && (n = o, t)) { const d = !subscriber_queue.length; - for (const v of r) - v[1](), subscriber_queue.push(v, n); + for (const _ of r) + _[1](), subscriber_queue.push(_, n); if (d) { - for (let v = 0; v < subscriber_queue.length; v += 2) - subscriber_queue[v][0](subscriber_queue[v + 1]); + for (let _ = 0; _ < subscriber_queue.length; _ += 2) + subscriber_queue[_][0](subscriber_queue[_ + 1]); subscriber_queue.length = 0; } } @@ -44952,9 +45258,9 @@ function writable(n, e = noop$4) { a(o(n)); } function h(o, d = noop$4) { - const v = [o, d]; - return r.add(v), r.size === 1 && (t = e(a, s) || noop$4), o(n), () => { - r.delete(v), r.size === 0 && t && (t(), t = null); + const _ = [o, d]; + return r.add(_), r.size === 1 && (t = e(a, s) || noop$4), o(n), () => { + r.delete(_), r.size === 0 && t && (t(), t = null); }; } return { set: a, update: s, subscribe: h }; @@ -44964,8 +45270,8 @@ function is_date(n) { } function tick_spring(n, e, t, r) { if (typeof t == "number" || is_date(t)) { - const a = r - t, s = (t - e) / (n.dt || 1 / 60), h = n.opts.stiffness * a, o = n.opts.damping * s, d = (h - o) * n.inv_mass, v = (s + d) * n.dt; - return Math.abs(v) < n.opts.precision && Math.abs(a) < n.opts.precision ? r : (n.settled = !1, is_date(t) ? new Date(t.getTime() + v) : t + v); + const a = r - t, s = (t - e) / (n.dt || 1 / 60), h = n.opts.stiffness * a, o = n.opts.damping * s, d = (h - o) * n.inv_mass, _ = (s + d) * n.dt; + return Math.abs(_) < n.opts.precision && Math.abs(a) < n.opts.precision ? r : (n.settled = !1, is_date(t) ? new Date(t.getTime() + _) : t + _); } else { if (Array.isArray(t)) return t.map( @@ -44982,11 +45288,11 @@ function tick_spring(n, e, t, r) { } function spring(n, e = {}) { const t = writable(n), { stiffness: r = 0.15, damping: a = 0.8, precision: s = 0.01 } = e; - let h, o, d, v = n, f = n, y = 1, A = 0, x = !1; + let h, o, d, _ = n, f = n, y = 1, A = 0, x = !1; function M(l, u = {}) { f = l; const p = d = {}; - return n == null || u.hard || m.stiffness >= 1 && m.damping >= 1 ? (x = !0, h = now(), v = l, t.set(n = f), Promise.resolve()) : (u.soft && (A = 1 / ((u.soft === !0 ? 0.5 : +u.soft) * 60), y = 0), o || (h = now(), x = !1, o = loop((g) => { + return n == null || u.hard || m.stiffness >= 1 && m.damping >= 1 ? (x = !0, h = now(), _ = l, t.set(n = f), Promise.resolve()) : (u.soft && (A = 1 / ((u.soft === !0 ? 0.5 : +u.soft) * 60), y = 0), o || (h = now(), x = !1, o = loop((g) => { if (x) return x = !1, o = null, !1; y = Math.min(y + A, 1); @@ -44995,8 +45301,8 @@ function spring(n, e = {}) { opts: m, settled: !0, dt: (g - h) * 60 / 1e3 - }, c = tick_spring(b, v, n, f); - return h = g, v = n, t.set(n = c), b.settled && (o = null), !b.settled; + }, c = tick_spring(b, _, n, f); + return h = g, _ = n, t.set(n = c), b.settled && (o = null), !b.settled; })), new Promise((g) => { o.promise.then(() => { p === d && g(); @@ -45032,10 +45338,10 @@ const { toggle_class: toggle_class$3 } = window.__gradio__svelte__internal, { onMount: onMount$2 } = window.__gradio__svelte__internal; function create_fragment$4(n) { - let e, t, r, a, s, h, o, d, v, f, y, A; + let e, t, r, a, s, h, o, d, _, f, y, A; return { c() { - e = element$3("div"), t = svg_element("svg"), r = svg_element("g"), a = svg_element("path"), s = svg_element("path"), h = svg_element("path"), o = svg_element("path"), d = svg_element("g"), v = svg_element("path"), f = svg_element("path"), y = svg_element("path"), A = svg_element("path"), this.h(); + e = element$3("div"), t = svg_element("svg"), r = svg_element("g"), a = svg_element("path"), s = svg_element("path"), h = svg_element("path"), o = svg_element("path"), d = svg_element("g"), _ = svg_element("path"), f = svg_element("path"), y = svg_element("path"), A = svg_element("path"), this.h(); }, l(x) { e = claim_element$3(x, "DIV", { class: !0 }); @@ -45061,12 +45367,12 @@ function create_fragment$4(n) { class: !0 }), children$3(h).forEach(detach$4), o = claim_svg_element(l, "path", { d: !0, fill: !0, class: !0 }), children$3(o).forEach(detach$4), l.forEach(detach$4), d = claim_svg_element(m, "g", { style: !0 }); var u = children$3(d); - v = claim_svg_element(u, "path", { + _ = claim_svg_element(u, "path", { d: !0, fill: !0, "fill-opacity": !0, class: !0 - }), children$3(v).forEach(detach$4), f = claim_svg_element(u, "path", { d: !0, fill: !0, class: !0 }), children$3(f).forEach(detach$4), y = claim_svg_element(u, "path", { + }), children$3(_).forEach(detach$4), f = claim_svg_element(u, "path", { d: !0, fill: !0, class: !0 }), children$3(f).forEach(detach$4), y = claim_svg_element(u, "path", { d: !0, fill: !0, "fill-opacity": !0, @@ -45074,11 +45380,11 @@ function create_fragment$4(n) { }), children$3(y).forEach(detach$4), A = claim_svg_element(u, "path", { d: !0, fill: !0, class: !0 }), children$3(A).forEach(detach$4), u.forEach(detach$4), m.forEach(detach$4), M.forEach(detach$4), this.h(); }, h() { - attr$3(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(a, "fill", "#FF7C00"), attr$3(a, "fill-opacity", "0.4"), attr$3(a, "class", "svelte-43sxxs"), attr$3(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(s, "fill", "#FF7C00"), attr$3(s, "class", "svelte-43sxxs"), attr$3(h, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "fill-opacity", "0.4"), attr$3(h, "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(r, "transform", "translate(" + /*$top*/ + attr$3(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(a, "fill", "#FF7C00"), attr$3(a, "fill-opacity", "0.4"), attr$3(a, "class", "svelte-5p8c2f"), attr$3(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(s, "fill", "#FF7C00"), attr$3(s, "class", "svelte-5p8c2f"), attr$3(h, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "fill-opacity", "0.4"), attr$3(h, "class", "svelte-5p8c2f"), 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-5p8c2f"), set_style$1(r, "transform", "translate(" + /*$top*/ n[1][0] + "px, " + /*$top*/ - n[1][1] + "px)"), attr$3(v, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(v, "fill", "#FF7C00"), attr$3(v, "fill-opacity", "0.4"), attr$3(v, "class", "svelte-43sxxs"), attr$3(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "class", "svelte-43sxxs"), attr$3(y, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "fill-opacity", "0.4"), attr$3(y, "class", "svelte-43sxxs"), attr$3(A, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(A, "fill", "#FF7C00"), attr$3(A, "class", "svelte-43sxxs"), set_style$1(d, "transform", "translate(" + /*$bottom*/ + n[1][1] + "px)"), attr$3(_, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(_, "fill", "#FF7C00"), attr$3(_, "fill-opacity", "0.4"), attr$3(_, "class", "svelte-5p8c2f"), attr$3(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "class", "svelte-5p8c2f"), attr$3(y, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "fill-opacity", "0.4"), attr$3(y, "class", "svelte-5p8c2f"), attr$3(A, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(A, "fill", "#FF7C00"), attr$3(A, "class", "svelte-5p8c2f"), set_style$1(d, "transform", "translate(" + /*$bottom*/ n[2][0] + "px, " + /*$bottom*/ - n[2][1] + "px)"), attr$3(t, "viewBox", "-1200 -1200 3000 3000"), attr$3(t, "fill", "none"), attr$3(t, "xmlns", "http://www.w3.org/2000/svg"), attr$3(t, "class", "svelte-43sxxs"), attr$3(e, "class", "svelte-43sxxs"), toggle_class$3( + n[2][1] + "px)"), attr$3(t, "viewBox", "-1200 -1200 3000 3000"), attr$3(t, "fill", "none"), attr$3(t, "xmlns", "http://www.w3.org/2000/svg"), attr$3(t, "class", "svelte-5p8c2f"), attr$3(e, "class", "svelte-5p8c2f"), toggle_class$3( e, "margin", /*margin*/ @@ -45086,7 +45392,7 @@ function create_fragment$4(n) { ); }, m(x, M) { - insert_hydration$4(x, e, M), append_hydration$3(e, t), append_hydration$3(t, r), append_hydration$3(r, a), append_hydration$3(r, s), append_hydration$3(r, h), append_hydration$3(r, o), append_hydration$3(t, d), append_hydration$3(d, v), append_hydration$3(d, f), append_hydration$3(d, y), append_hydration$3(d, A); + insert_hydration$4(x, e, M), append_hydration$3(e, t), append_hydration$3(t, r), append_hydration$3(r, a), append_hydration$3(r, s), append_hydration$3(r, h), append_hydration$3(r, o), append_hydration$3(t, d), append_hydration$3(d, _), append_hydration$3(d, f), append_hydration$3(d, y), append_hydration$3(d, A); }, p(x, [M]) { M & /*$top*/ @@ -45117,11 +45423,11 @@ function instance$4(n, e, t) { const o = spring([0, 0]); component_subscribe(n, o, (A) => t(2, a = A)); let d; - async function v() { + async function _() { await Promise.all([h.set([125, 140]), o.set([-125, -140])]), await Promise.all([h.set([-125, 140]), o.set([125, -140])]), await Promise.all([h.set([-125, 0]), o.set([125, -0])]), await Promise.all([h.set([125, 0]), o.set([-125, 0])]); } async function f() { - await v(), d || f(); + await _(), d || f(); } async function y() { await Promise.all([h.set([125, 0]), o.set([-125, 0])]), f(); @@ -45198,11 +45504,11 @@ function create_if_block_17(n) { /*click_handler*/ n[32] ); - const v = ( + const _ = ( /*#slots*/ n[30].error ), f = create_slot( - v, + _, n, /*$$scope*/ n[29], @@ -45220,7 +45526,7 @@ function create_if_block_17(n) { h = claim_text$3(x, s), x.forEach(detach$3), o = claim_space$3(y), f && f.l(y), this.h(); }, h() { - attr$2(e, "class", "clear-status svelte-17v219f"), attr$2(a, "class", "error svelte-17v219f"); + attr$2(e, "class", "clear-status svelte-j4x21i"), attr$2(a, "class", "error svelte-j4x21i"); }, m(y, A) { insert_hydration$3(y, e, A), mount_component$2(t, e, null), insert_hydration$3(y, r, A), insert_hydration$3(y, a, A), append_hydration$2(a, h), insert_hydration$3(y, o, A), f && f.m(y, A), d = !0; @@ -45234,12 +45540,12 @@ function create_if_block_17(n) { y[1]("common.error") + "") && set_data$3(h, s), f && f.p && (!d || A[0] & /*$$scope*/ 536870912) && update_slot_base( f, - v, + _, y, /*$$scope*/ y[29], d ? get_slot_changes( - v, + _, /*$$scope*/ y[29], A, @@ -45263,7 +45569,7 @@ function create_if_block_17(n) { }; } function create_if_block$3(n) { - let e, t, r, a, s, h, o, d, v, f = ( + let e, t, r, a, s, h, o, d, _, f = ( /*variant*/ n[8] === "default" && /*show_eta_bar*/ n[18] && /*show_progress*/ @@ -45312,7 +45618,7 @@ function create_if_block$3(n) { x && x.l(b), r = claim_space$3(b), M && M.l(b), b.forEach(detach$3), a = claim_space$3(g), h && h.l(g), o = claim_space$3(g), p && p.l(g), d = empty$2(), this.h(); }, h() { - attr$2(t, "class", "progress-text svelte-17v219f"), toggle_class$2( + attr$2(t, "class", "progress-text svelte-j4x21i"), toggle_class$2( t, "meta-text-center", /*variant*/ @@ -45325,20 +45631,20 @@ function create_if_block$3(n) { ); }, m(g, b) { - f && f.m(g, b), insert_hydration$3(g, e, b), insert_hydration$3(g, t, b), x && x.m(t, null), append_hydration$2(t, r), M && M.m(t, null), insert_hydration$3(g, a, b), ~s && l[s].m(g, b), insert_hydration$3(g, o, b), p && p.m(g, b), insert_hydration$3(g, d, b), v = !0; + f && f.m(g, b), insert_hydration$3(g, e, b), insert_hydration$3(g, t, b), x && x.m(t, null), append_hydration$2(t, r), M && M.m(t, null), insert_hydration$3(g, a, b), ~s && l[s].m(g, b), insert_hydration$3(g, o, b), p && p.m(g, b), insert_hydration$3(g, d, b), _ = !0; }, p(g, b) { /*variant*/ g[8] === "default" && /*show_eta_bar*/ g[18] && /*show_progress*/ g[6] === "full" ? f ? f.p(g, b) : (f = create_if_block_16(g), f.c(), f.m(e.parentNode, e)) : f && (f.d(1), f = null), A === (A = y(g)) && x ? x.p(g, b) : (x && x.d(1), x = A && A(g), x && (x.c(), x.m(t, r))), /*timer*/ - g[5] ? M ? M.p(g, b) : (M = create_if_block_10(g), M.c(), M.m(t, null)) : M && (M.d(1), M = null), (!v || b[0] & /*variant*/ + g[5] ? M ? M.p(g, b) : (M = create_if_block_10(g), M.c(), M.m(t, null)) : M && (M.d(1), M = null), (!_ || b[0] & /*variant*/ 256) && toggle_class$2( t, "meta-text-center", /*variant*/ g[8] === "center" - ), (!v || b[0] & /*variant*/ + ), (!_ || b[0] & /*variant*/ 256) && toggle_class$2( t, "meta-text", @@ -45355,10 +45661,10 @@ function create_if_block$3(n) { 32 && transition_in$2(p, 1)) : (p = create_if_block_1$2(g), p.c(), transition_in$2(p, 1), p.m(d.parentNode, d)); }, i(g) { - v || (transition_in$2(h), transition_in$2(p), v = !0); + _ || (transition_in$2(h), transition_in$2(p), _ = !0); }, o(g) { - transition_out$2(h), transition_out$2(p), v = !1; + transition_out$2(h), transition_out$2(p), _ = !1; }, d(g) { g && (detach$3(e), detach$3(t), detach$3(a), detach$3(o), detach$3(d)), f && f.d(g), x && x.d(), M && M.d(), ~s && l[s].d(g), p && p.d(g); @@ -45376,7 +45682,7 @@ function create_if_block_16(n) { e = claim_element$2(r, "DIV", { class: !0 }), children$2(e).forEach(detach$3), this.h(); }, h() { - attr$2(e, "class", "eta-bar svelte-17v219f"), set_style(e, "transform", t); + attr$2(e, "class", "eta-bar svelte-j4x21i"), set_style(e, "transform", t); }, m(r, a) { insert_hydration$3(r, e, a); @@ -45502,24 +45808,24 @@ function create_if_block_12(n) { f[40].length != null ? create_if_block_13 : create_else_block$2 ); } - let d = o(n), v = d(n); + let d = o(n), _ = d(n); return { c() { - v.c(), e = space$3(), r = text$4(t), a = text$4(" | "), h = text$4(s); + _.c(), e = space$3(), r = text$4(t), a = text$4(" | "), h = text$4(s); }, l(f) { - v.l(f), e = claim_space$3(f), r = claim_text$3(f, t), a = claim_text$3(f, " | "), h = claim_text$3(f, s); + _.l(f), e = claim_space$3(f), r = claim_text$3(f, t), a = claim_text$3(f, " | "), h = claim_text$3(f, s); }, m(f, y) { - v.m(f, y), insert_hydration$3(f, e, y), insert_hydration$3(f, r, y), insert_hydration$3(f, a, y), insert_hydration$3(f, h, y); + _.m(f, y), insert_hydration$3(f, e, y), insert_hydration$3(f, r, y), insert_hydration$3(f, a, y), insert_hydration$3(f, h, y); }, p(f, y) { - d === (d = o(f)) && v ? v.p(f, y) : (v.d(1), v = d(f), v && (v.c(), v.m(e.parentNode, e))), y[0] & /*progress*/ + d === (d = o(f)) && _ ? _.p(f, y) : (_.d(1), _ = d(f), _ && (_.c(), _.m(e.parentNode, e))), y[0] & /*progress*/ 128 && t !== (t = /*p*/ f[40].unit + "") && set_data$3(r, t); }, d(f) { - f && (detach$3(e), detach$3(r), detach$3(a), detach$3(h)), v.d(f); + f && (detach$3(e), detach$3(r), detach$3(a), detach$3(h)), _.d(f); } }; } @@ -45693,22 +45999,22 @@ function create_if_block_2$2(n) { }, l(d) { e = claim_element$2(d, "DIV", { class: !0 }); - var v = children$2(e); - t = claim_element$2(v, "DIV", { class: !0 }); + var _ = children$2(e); + t = claim_element$2(_, "DIV", { class: !0 }); var f = children$2(t); - o && o.l(f), f.forEach(detach$3), r = claim_space$3(v), a = claim_element$2(v, "DIV", { class: !0 }); + o && o.l(f), f.forEach(detach$3), r = claim_space$3(_), a = claim_element$2(_, "DIV", { class: !0 }); var y = children$2(a); - s = claim_element$2(y, "DIV", { class: !0 }), children$2(s).forEach(detach$3), y.forEach(detach$3), v.forEach(detach$3), this.h(); + s = claim_element$2(y, "DIV", { class: !0 }), children$2(s).forEach(detach$3), y.forEach(detach$3), _.forEach(detach$3), this.h(); }, h() { - attr$2(t, "class", "progress-level-inner svelte-17v219f"), attr$2(s, "class", "progress-bar svelte-17v219f"), set_style(s, "width", h), attr$2(a, "class", "progress-bar-wrap svelte-17v219f"), attr$2(e, "class", "progress-level svelte-17v219f"); + attr$2(t, "class", "progress-level-inner svelte-j4x21i"), attr$2(s, "class", "progress-bar svelte-j4x21i"), set_style(s, "width", h), attr$2(a, "class", "progress-bar-wrap svelte-j4x21i"), attr$2(e, "class", "progress-level svelte-j4x21i"); }, - m(d, v) { - insert_hydration$3(d, e, v), append_hydration$2(e, t), o && o.m(t, null), append_hydration$2(e, r), append_hydration$2(e, a), append_hydration$2(a, s), n[31](s); + m(d, _) { + insert_hydration$3(d, e, _), append_hydration$2(e, t), o && o.m(t, null), append_hydration$2(e, r), append_hydration$2(e, a), append_hydration$2(a, s), n[31](s); }, - p(d, v) { + p(d, _) { /*progress*/ - d[7] != null ? o ? o.p(d, v) : (o = create_if_block_3$2(d), o.c(), o.m(t, null)) : o && (o.d(1), o = null), v[0] & /*last_progress_level*/ + d[7] != null ? o ? o.p(d, _) : (o = create_if_block_3$2(d), o.c(), o.m(t, null)) : o && (o.d(1), o = null), _[0] & /*last_progress_level*/ 32768 && h !== (h = `${/*last_progress_level*/ d[15] * 100}%`) && set_style(s, "width", h); }, @@ -45787,25 +46093,25 @@ function create_if_block_4$2(n) { c() { s && s.c(), e = space$3(), h && h.c(), t = space$3(), o && o.c(), r = space$3(), d && d.c(), a = empty$2(); }, - l(v) { - s && s.l(v), e = claim_space$3(v), h && h.l(v), t = claim_space$3(v), o && o.l(v), r = claim_space$3(v), d && d.l(v), a = empty$2(); + l(_) { + s && s.l(_), e = claim_space$3(_), h && h.l(_), t = claim_space$3(_), o && o.l(_), r = claim_space$3(_), d && d.l(_), a = empty$2(); }, - m(v, f) { - s && s.m(v, f), insert_hydration$3(v, e, f), h && h.m(v, f), insert_hydration$3(v, t, f), o && o.m(v, f), insert_hydration$3(v, r, f), d && d.m(v, f), insert_hydration$3(v, a, f); + m(_, f) { + s && s.m(_, f), insert_hydration$3(_, e, f), h && h.m(_, f), insert_hydration$3(_, t, f), o && o.m(_, f), insert_hydration$3(_, r, f), d && d.m(_, f), insert_hydration$3(_, a, f); }, - p(v, f) { + p(_, f) { /*p*/ - v[40].desc != null ? h ? h.p(v, f) : (h = create_if_block_7(v), h.c(), h.m(t.parentNode, t)) : h && (h.d(1), h = null), /*p*/ - v[40].desc != null && /*progress_level*/ - v[14] && /*progress_level*/ - v[14][ + _[40].desc != null ? h ? h.p(_, f) : (h = create_if_block_7(_), h.c(), h.m(t.parentNode, t)) : h && (h.d(1), h = null), /*p*/ + _[40].desc != null && /*progress_level*/ + _[14] && /*progress_level*/ + _[14][ /*i*/ - v[42] + _[42] ] != null ? o || (o = create_if_block_6(), o.c(), o.m(r.parentNode, r)) : o && (o.d(1), o = null), /*progress_level*/ - v[14] != null ? d ? d.p(v, f) : (d = create_if_block_5$2(v), d.c(), d.m(a.parentNode, a)) : d && (d.d(1), d = null); + _[14] != null ? d ? d.p(_, f) : (d = create_if_block_5$2(_), d.c(), d.m(a.parentNode, a)) : d && (d.d(1), d = null); }, - d(v) { - v && (detach$3(e), detach$3(t), detach$3(r), detach$3(a)), s && s.d(v), h && h.d(v), o && o.d(v), d && d.d(v); + d(_) { + _ && (detach$3(e), detach$3(t), detach$3(r), detach$3(a)), s && s.d(_), h && h.d(_), o && o.d(_), d && d.d(_); } }; } @@ -45960,7 +46266,7 @@ function create_if_block_1$2(n) { ), d.forEach(detach$3), r = claim_space$3(o), h && h.l(o), this.h(); }, h() { - attr$2(e, "class", "loading svelte-17v219f"); + attr$2(e, "class", "loading svelte-j4x21i"); }, m(o, d) { insert_hydration$3(o, e, d), append_hydration$2(e, t), insert_hydration$3(o, r, d), h && h.m(o, d), a = !0; @@ -46005,12 +46311,12 @@ function create_if_block_1$2(n) { function create_fragment$3(n) { let e, t, r, a, s; const h = [create_if_block$3, create_if_block_17], o = []; - function d(v, f) { + function d(_, f) { return ( /*status*/ - v[4] === "pending" ? 0 : ( + _[4] === "pending" ? 0 : ( /*status*/ - v[4] === "error" ? 1 : -1 + _[4] === "error" ? 1 : -1 ) ); } @@ -46018,15 +46324,15 @@ function create_fragment$3(n) { c() { e = element$2("div"), r && r.c(), this.h(); }, - l(v) { - e = claim_element$2(v, "DIV", { class: !0 }); + l(_) { + e = claim_element$2(_, "DIV", { class: !0 }); var f = children$2(e); r && r.l(f), f.forEach(detach$3), this.h(); }, h() { attr$2(e, "class", a = "wrap " + /*variant*/ n[8] + " " + /*show_progress*/ - n[6] + " svelte-17v219f"), toggle_class$2(e, "hide", !/*status*/ + n[6] + " svelte-j4x21i"), toggle_class$2(e, "hide", !/*status*/ n[4] || /*status*/ n[4] === "complete" || /*show_progress*/ n[6] === "hidden" || /*status*/ @@ -46062,66 +46368,66 @@ function create_fragment$3(n) { n[10] ? "0" : "var(--size-8) 0" ); }, - m(v, f) { - insert_hydration$3(v, e, f), ~t && o[t].m(e, null), n[33](e), s = !0; + m(_, f) { + insert_hydration$3(_, e, f), ~t && o[t].m(e, null), n[33](e), s = !0; }, - p(v, f) { + p(_, f) { let y = t; - t = d(v), t === y ? ~t && o[t].p(v, f) : (r && (group_outros$2(), transition_out$2(o[y], 1, 1, () => { + t = d(_), t === y ? ~t && o[t].p(_, f) : (r && (group_outros$2(), transition_out$2(o[y], 1, 1, () => { o[y] = null; - }), check_outros$2()), ~t ? (r = o[t], r ? r.p(v, f) : (r = o[t] = h[t](v), r.c()), transition_in$2(r, 1), r.m(e, null)) : r = null), (!s || f[0] & /*variant, show_progress*/ + }), check_outros$2()), ~t ? (r = o[t], r ? r.p(_, f) : (r = o[t] = h[t](_), r.c()), transition_in$2(r, 1), r.m(e, null)) : r = null), (!s || f[0] & /*variant, show_progress*/ 320 && a !== (a = "wrap " + /*variant*/ - v[8] + " " + /*show_progress*/ - v[6] + " svelte-17v219f")) && attr$2(e, "class", a), (!s || f[0] & /*variant, show_progress, status, show_progress*/ + _[8] + " " + /*show_progress*/ + _[6] + " svelte-j4x21i")) && attr$2(e, "class", a), (!s || f[0] & /*variant, show_progress, status, show_progress*/ 336) && toggle_class$2(e, "hide", !/*status*/ - v[4] || /*status*/ - v[4] === "complete" || /*show_progress*/ - v[6] === "hidden" || /*status*/ - v[4] == "streaming"), (!s || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ + _[4] || /*status*/ + _[4] === "complete" || /*show_progress*/ + _[6] === "hidden" || /*status*/ + _[4] == "streaming"), (!s || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ 2384) && toggle_class$2( e, "translucent", /*variant*/ - v[8] === "center" && /*status*/ - (v[4] === "pending" || /*status*/ - v[4] === "error") || /*translucent*/ - v[11] || /*show_progress*/ - v[6] === "minimal" + _[8] === "center" && /*status*/ + (_[4] === "pending" || /*status*/ + _[4] === "error") || /*translucent*/ + _[11] || /*show_progress*/ + _[6] === "minimal" ), (!s || f[0] & /*variant, show_progress, status, show_progress*/ 336) && toggle_class$2( e, "generating", /*status*/ - v[4] === "generating" && /*show_progress*/ - v[6] === "full" + _[4] === "generating" && /*show_progress*/ + _[6] === "full" ), (!s || f[0] & /*variant, show_progress, border*/ 4416) && toggle_class$2( e, "border", /*border*/ - v[12] + _[12] ), f[0] & /*absolute*/ 1024 && set_style( e, "position", /*absolute*/ - v[10] ? "absolute" : "static" + _[10] ? "absolute" : "static" ), f[0] & /*absolute*/ 1024 && set_style( e, "padding", /*absolute*/ - v[10] ? "0" : "var(--size-8) 0" + _[10] ? "0" : "var(--size-8) 0" ); }, - i(v) { + i(_) { s || (transition_in$2(r), s = !0); }, - o(v) { + o(_) { transition_out$2(r), s = !1; }, - d(v) { - v && detach$3(e), ~t && o[t].d(), n[33](null); + d(_) { + _ && detach$3(e), ~t && o[t].d(), n[33](null); } }; } @@ -46145,56 +46451,56 @@ async function scroll_into_view(n, e = !0) { function instance$3(n, e, t) { let r, { $$slots: a = {}, $$scope: s } = e; const h = createEventDispatcher$1(); - let { i18n: o } = e, { eta: d = null } = e, { queue_position: v } = e, { queue_size: f } = e, { status: y } = e, { scroll_to_output: A = !1 } = e, { timer: x = !0 } = e, { show_progress: M = "full" } = e, { message: m = null } = e, { progress: l = null } = e, { variant: u = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: b = !1 } = e, { border: c = !1 } = e, { autoscroll: _ } = e, E, w = !1, k = 0, $ = 0, L = null, z = null, F = 0, R = null, P, U = null, N = !0; - const B = () => { - t(0, d = t(27, L = t(19, G = null))), t(25, k = performance.now()), t(26, $ = 0), w = !0, W(); + let { i18n: o } = e, { eta: d = null } = e, { queue_position: _ } = e, { queue_size: f } = e, { status: y } = e, { scroll_to_output: A = !1 } = e, { timer: x = !0 } = e, { show_progress: M = "full" } = e, { message: m = null } = e, { progress: l = null } = e, { variant: u = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: b = !1 } = e, { border: c = !1 } = e, { autoscroll: v } = e, E, w = !1, k = 0, $ = 0, L = null, I = null, F = 0, P = null, B, G = null, U = !0; + const R = () => { + t(0, d = t(27, L = t(19, N = null))), t(25, k = performance.now()), t(26, $ = 0), w = !0, W(); }; function W() { raf(() => { t(26, $ = (performance.now() - k) / 1e3), w && W(); }); } - function V() { - t(26, $ = 0), t(0, d = t(27, L = t(19, G = null))), w && (w = !1); + function H() { + t(26, $ = 0), t(0, d = t(27, L = t(19, N = null))), w && (w = !1); } onDestroy(() => { - w && V(); + w && H(); }); - let G = null; - function H(ee) { - binding_callbacks$3[ee ? "unshift" : "push"](() => { - U = ee, t(16, U), t(7, l), t(14, R), t(15, P); + let N = null; + function V(te) { + binding_callbacks$3[te ? "unshift" : "push"](() => { + G = te, t(16, G), t(7, l), t(14, P), t(15, B); }); } - const Q = () => { + const J = () => { h("clear_status"); }; - function te(ee) { - binding_callbacks$3[ee ? "unshift" : "push"](() => { - E = ee, t(13, E); + function re(te) { + binding_callbacks$3[te ? "unshift" : "push"](() => { + E = te, t(13, E); }); } - return n.$$set = (ee) => { - "i18n" in ee && t(1, o = ee.i18n), "eta" in ee && t(0, d = ee.eta), "queue_position" in ee && t(2, v = ee.queue_position), "queue_size" in ee && t(3, f = ee.queue_size), "status" in ee && t(4, y = ee.status), "scroll_to_output" in ee && t(22, A = ee.scroll_to_output), "timer" in ee && t(5, x = ee.timer), "show_progress" in ee && t(6, M = ee.show_progress), "message" in ee && t(23, m = ee.message), "progress" in ee && t(7, l = ee.progress), "variant" in ee && t(8, u = ee.variant), "loading_text" in ee && t(9, p = ee.loading_text), "absolute" in ee && t(10, g = ee.absolute), "translucent" in ee && t(11, b = ee.translucent), "border" in ee && t(12, c = ee.border), "autoscroll" in ee && t(24, _ = ee.autoscroll), "$$scope" in ee && t(29, s = ee.$$scope); + return n.$$set = (te) => { + "i18n" in te && t(1, o = te.i18n), "eta" in te && t(0, d = te.eta), "queue_position" in te && t(2, _ = te.queue_position), "queue_size" in te && t(3, f = te.queue_size), "status" in te && t(4, y = te.status), "scroll_to_output" in te && t(22, A = te.scroll_to_output), "timer" in te && t(5, x = te.timer), "show_progress" in te && t(6, M = te.show_progress), "message" in te && t(23, m = te.message), "progress" in te && t(7, l = te.progress), "variant" in te && t(8, u = te.variant), "loading_text" in te && t(9, p = te.loading_text), "absolute" in te && t(10, g = te.absolute), "translucent" in te && t(11, b = te.translucent), "border" in te && t(12, c = te.border), "autoscroll" in te && t(24, v = te.autoscroll), "$$scope" in te && t(29, s = te.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 436207617 && (d === null && t(0, d = L), d != null && L !== d && (t(28, z = (performance.now() - k) / 1e3 + d), t(19, G = z.toFixed(1)), t(27, L = d))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 335544320 && t(17, F = z === null || z <= 0 || !$ ? null : Math.min($ / z, 1)), n.$$.dirty[0] & /*progress*/ - 128 && l != null && t(18, N = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (l != null ? t(14, R = l.map((ee) => { - if (ee.index != null && ee.length != null) - return ee.index / ee.length; - if (ee.progress != null) - return ee.progress; - })) : t(14, R = null), R ? (t(15, P = R[R.length - 1]), U && (P === 0 ? t(16, U.style.transition = "0", U) : t(16, U.style.transition = "150ms", U))) : t(15, P = void 0)), n.$$.dirty[0] & /*status*/ - 16 && (y === "pending" ? B() : V()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && E && A && (y === "pending" || y === "complete") && scroll_into_view(E, _), n.$$.dirty[0] & /*status, message*/ + 436207617 && (d === null && t(0, d = L), d != null && L !== d && (t(28, I = (performance.now() - k) / 1e3 + d), t(19, N = I.toFixed(1)), t(27, L = d))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 335544320 && t(17, F = I === null || I <= 0 || !$ ? null : Math.min($ / I, 1)), n.$$.dirty[0] & /*progress*/ + 128 && l != null && t(18, U = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (l != null ? t(14, P = l.map((te) => { + if (te.index != null && te.length != null) + return te.index / te.length; + if (te.progress != null) + return te.progress; + })) : t(14, P = null), P ? (t(15, B = P[P.length - 1]), G && (B === 0 ? t(16, G.style.transition = "0", G) : t(16, G.style.transition = "150ms", G))) : t(15, B = void 0)), n.$$.dirty[0] & /*status*/ + 16 && (y === "pending" ? R() : H()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && E && A && (y === "pending" || y === "complete") && scroll_into_view(E, v), n.$$.dirty[0] & /*status, message*/ 8388624, n.$$.dirty[0] & /*timer_diff*/ 67108864 && t(20, r = $.toFixed(1)); }, [ d, o, - v, + _, f, y, x, @@ -46206,26 +46512,26 @@ function instance$3(n, e, t) { b, c, E, - R, P, - U, + B, + G, F, + U, N, - G, r, h, A, m, - _, + v, k, $, L, - z, + I, s, a, - H, - Q, - te + V, + J, + re ]; } class Static extends SvelteComponent$3 { @@ -46414,7 +46720,7 @@ function createDOMPurify() { HTMLTemplateElement: h, Node: o, Element: d, - NodeFilter: v, + NodeFilter: _, NamedNodeMap: f = n.NamedNodeMap || n.MozNamedAttrMap, HTMLFormElement: y, DOMParser: A, @@ -46426,7 +46732,7 @@ function createDOMPurify() { } let b, c = ""; const { - implementation: _, + implementation: v, createNodeIterator: E, createDocumentFragment: w, getElementsByTagName: k @@ -46434,24 +46740,24 @@ function createDOMPurify() { importNode: $ } = r; let L = {}; - e.isSupported = typeof entries == "function" && typeof g == "function" && _ && _.createHTMLDocument !== void 0; + e.isSupported = typeof entries == "function" && typeof g == "function" && v && v.createHTMLDocument !== void 0; const { - MUSTACHE_EXPR: z, + MUSTACHE_EXPR: I, ERB_EXPR: F, - TMPLIT_EXPR: R, - DATA_ATTR: P, - ARIA_ATTR: U, - IS_SCRIPT_OR_DATA: N, - ATTR_WHITESPACE: B, + TMPLIT_EXPR: P, + DATA_ATTR: B, + ARIA_ATTR: G, + IS_SCRIPT_OR_DATA: U, + ATTR_WHITESPACE: R, CUSTOM_ELEMENT: W } = EXPRESSIONS; let { - IS_ALLOWED_URI: V - } = EXPRESSIONS, G = null; - const H = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$3]); - let Q = null; - const te = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); - let ee = Object.seal(create(null, { + IS_ALLOWED_URI: H + } = EXPRESSIONS, N = null; + const V = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$3]); + let J = null; + const re = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); + let te = Object.seal(create(null, { tagNameCheck: { writable: !0, configurable: !1, @@ -46470,26 +46776,26 @@ function createDOMPurify() { enumerable: !0, value: !1 } - })), ce = null, fe = null, oe = !0, he = !0, Ae = !1, Se = !0, Ie = !1, pe = !0, le = !1, ne = !1, Te = !1, Oe = !1, Be = !1, Ue = !1, Pe = !0, Ge = !1; - const Ne = "user-content-"; - let Re = !0, De = !1, je = {}, Xe = null; + })), ue = null, ie = null, ae = !0, ce = !0, Me = !1, Ae = !0, Ie = !1, pe = !0, se = !1, Q = !1, ye = !1, ke = !1, Pe = !1, Ne = !1, Be = !0, Ge = !1; + const Ue = "user-content-"; + let Re = !0, Ce = !1, je = {}, Xe = null; const X = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); let q = null; - const re = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); - let ye = null; - const me = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ze = "http://www.w3.org/1998/Math/MathML", ke = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml"; - let ae = K, ge = !1, xe = null; - const ue = addToSet({}, [ze, ke, K], stringToString); - let Ce = null; + const ne = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); + let xe = null; + const me = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ze = "http://www.w3.org/1998/Math/MathML", $e = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml"; + let oe = K, ge = !1, we = null; + const de = addToSet({}, [ze, $e, K], stringToString); + let Te = null; const Z = ["application/xhtml+xml", "text/html"], Fe = "text/html"; - let We = null, I = null; - const we = t.createElement("form"), ve = function(be) { + let We = null, z = null; + const Ee = t.createElement("form"), ve = function(be) { return be instanceof RegExp || be instanceof Function; }, Y = function() { let be = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (!(I && I === be)) { - if ((!be || typeof be != "object") && (be = {}), be = clone(be), Ce = // eslint-disable-next-line unicorn/prefer-includes - Z.indexOf(be.PARSER_MEDIA_TYPE) === -1 ? Fe : be.PARSER_MEDIA_TYPE, We = Ce === "application/xhtml+xml" ? stringToString : stringToLowerCase, G = objectHasOwnProperty(be, "ALLOWED_TAGS") ? addToSet({}, be.ALLOWED_TAGS, We) : H, Q = objectHasOwnProperty(be, "ALLOWED_ATTR") ? addToSet({}, be.ALLOWED_ATTR, We) : te, xe = objectHasOwnProperty(be, "ALLOWED_NAMESPACES") ? addToSet({}, be.ALLOWED_NAMESPACES, stringToString) : ue, ye = objectHasOwnProperty(be, "ADD_URI_SAFE_ATTR") ? addToSet( + if (!(z && z === be)) { + if ((!be || typeof be != "object") && (be = {}), be = clone(be), Te = // eslint-disable-next-line unicorn/prefer-includes + Z.indexOf(be.PARSER_MEDIA_TYPE) === -1 ? Fe : be.PARSER_MEDIA_TYPE, We = Te === "application/xhtml+xml" ? stringToString : stringToLowerCase, N = objectHasOwnProperty(be, "ALLOWED_TAGS") ? addToSet({}, be.ALLOWED_TAGS, We) : V, J = objectHasOwnProperty(be, "ALLOWED_ATTR") ? addToSet({}, be.ALLOWED_ATTR, We) : re, we = objectHasOwnProperty(be, "ALLOWED_NAMESPACES") ? addToSet({}, be.ALLOWED_NAMESPACES, stringToString) : de, xe = objectHasOwnProperty(be, "ADD_URI_SAFE_ATTR") ? addToSet( clone(me), // eslint-disable-line indent be.ADD_URI_SAFE_ATTR, @@ -46497,13 +46803,13 @@ function createDOMPurify() { We // eslint-disable-line indent ) : me, q = objectHasOwnProperty(be, "ADD_DATA_URI_TAGS") ? addToSet( - clone(re), + clone(ne), // eslint-disable-line indent be.ADD_DATA_URI_TAGS, // eslint-disable-line indent We // eslint-disable-line indent - ) : re, Xe = objectHasOwnProperty(be, "FORBID_CONTENTS") ? addToSet({}, be.FORBID_CONTENTS, We) : X, ce = objectHasOwnProperty(be, "FORBID_TAGS") ? addToSet({}, be.FORBID_TAGS, We) : {}, fe = objectHasOwnProperty(be, "FORBID_ATTR") ? addToSet({}, be.FORBID_ATTR, We) : {}, je = objectHasOwnProperty(be, "USE_PROFILES") ? be.USE_PROFILES : !1, oe = be.ALLOW_ARIA_ATTR !== !1, he = be.ALLOW_DATA_ATTR !== !1, Ae = be.ALLOW_UNKNOWN_PROTOCOLS || !1, Se = be.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = be.SAFE_FOR_TEMPLATES || !1, pe = be.SAFE_FOR_XML !== !1, le = be.WHOLE_DOCUMENT || !1, Oe = be.RETURN_DOM || !1, Be = be.RETURN_DOM_FRAGMENT || !1, Ue = be.RETURN_TRUSTED_TYPE || !1, Te = be.FORCE_BODY || !1, Pe = be.SANITIZE_DOM !== !1, Ge = be.SANITIZE_NAMED_PROPS || !1, Re = be.KEEP_CONTENT !== !1, De = be.IN_PLACE || !1, V = be.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, ae = be.NAMESPACE || K, ee = be.CUSTOM_ELEMENT_HANDLING || {}, be.CUSTOM_ELEMENT_HANDLING && ve(be.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (ee.tagNameCheck = be.CUSTOM_ELEMENT_HANDLING.tagNameCheck), be.CUSTOM_ELEMENT_HANDLING && ve(be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (ee.attributeNameCheck = be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), be.CUSTOM_ELEMENT_HANDLING && typeof be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (ee.allowCustomizedBuiltInElements = be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (he = !1), Be && (Oe = !0), je && (G = addToSet({}, text$3), Q = [], je.html === !0 && (addToSet(G, html$1), addToSet(Q, html)), je.svg === !0 && (addToSet(G, svg$1), addToSet(Q, svg), addToSet(Q, xml)), je.svgFilters === !0 && (addToSet(G, svgFilters), addToSet(Q, svg), addToSet(Q, xml)), je.mathMl === !0 && (addToSet(G, mathMl$1), addToSet(Q, mathMl), addToSet(Q, xml))), be.ADD_TAGS && (G === H && (G = clone(G)), addToSet(G, be.ADD_TAGS, We)), be.ADD_ATTR && (Q === te && (Q = clone(Q)), addToSet(Q, be.ADD_ATTR, We)), be.ADD_URI_SAFE_ATTR && addToSet(ye, be.ADD_URI_SAFE_ATTR, We), be.FORBID_CONTENTS && (Xe === X && (Xe = clone(Xe)), addToSet(Xe, be.FORBID_CONTENTS, We)), Re && (G["#text"] = !0), le && addToSet(G, ["html", "head", "body"]), G.table && (addToSet(G, ["tbody"]), delete ce.tbody), be.TRUSTED_TYPES_POLICY) { + ) : ne, Xe = objectHasOwnProperty(be, "FORBID_CONTENTS") ? addToSet({}, be.FORBID_CONTENTS, We) : X, ue = objectHasOwnProperty(be, "FORBID_TAGS") ? addToSet({}, be.FORBID_TAGS, We) : {}, ie = objectHasOwnProperty(be, "FORBID_ATTR") ? addToSet({}, be.FORBID_ATTR, We) : {}, je = objectHasOwnProperty(be, "USE_PROFILES") ? be.USE_PROFILES : !1, ae = be.ALLOW_ARIA_ATTR !== !1, ce = be.ALLOW_DATA_ATTR !== !1, Me = be.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = be.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = be.SAFE_FOR_TEMPLATES || !1, pe = be.SAFE_FOR_XML !== !1, se = be.WHOLE_DOCUMENT || !1, ke = be.RETURN_DOM || !1, Pe = be.RETURN_DOM_FRAGMENT || !1, Ne = be.RETURN_TRUSTED_TYPE || !1, ye = be.FORCE_BODY || !1, Be = be.SANITIZE_DOM !== !1, Ge = be.SANITIZE_NAMED_PROPS || !1, Re = be.KEEP_CONTENT !== !1, Ce = be.IN_PLACE || !1, H = be.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, oe = be.NAMESPACE || K, te = be.CUSTOM_ELEMENT_HANDLING || {}, be.CUSTOM_ELEMENT_HANDLING && ve(be.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (te.tagNameCheck = be.CUSTOM_ELEMENT_HANDLING.tagNameCheck), be.CUSTOM_ELEMENT_HANDLING && ve(be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (te.attributeNameCheck = be.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), be.CUSTOM_ELEMENT_HANDLING && typeof be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (te.allowCustomizedBuiltInElements = be.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (ce = !1), Pe && (ke = !0), je && (N = addToSet({}, text$3), J = [], je.html === !0 && (addToSet(N, html$1), addToSet(J, html)), je.svg === !0 && (addToSet(N, svg$1), addToSet(J, svg), addToSet(J, xml)), je.svgFilters === !0 && (addToSet(N, svgFilters), addToSet(J, svg), addToSet(J, xml)), je.mathMl === !0 && (addToSet(N, mathMl$1), addToSet(J, mathMl), addToSet(J, xml))), be.ADD_TAGS && (N === V && (N = clone(N)), addToSet(N, be.ADD_TAGS, We)), be.ADD_ATTR && (J === re && (J = clone(J)), addToSet(J, be.ADD_ATTR, We)), be.ADD_URI_SAFE_ATTR && addToSet(xe, be.ADD_URI_SAFE_ATTR, We), be.FORBID_CONTENTS && (Xe === X && (Xe = clone(Xe)), addToSet(Xe, be.FORBID_CONTENTS, We)), Re && (N["#text"] = !0), se && addToSet(N, ["html", "head", "body"]), N.table && (addToSet(N, ["tbody"]), delete ue.tbody), be.TRUSTED_TYPES_POLICY) { if (typeof be.TRUSTED_TYPES_POLICY.createHTML != "function") throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); if (typeof be.TRUSTED_TYPES_POLICY.createScriptURL != "function") @@ -46511,16 +46817,16 @@ function createDOMPurify() { b = be.TRUSTED_TYPES_POLICY, c = b.createHTML(""); } else b === void 0 && (b = _createTrustedTypesPolicy(x, a)), b !== null && typeof c == "string" && (c = b.createHTML("")); - freeze && freeze(be), I = be; + freeze && freeze(be), z = be; } - }, de = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]), Me = addToSet({}, ["annotation-xml"]), Ye = addToSet({}, ["title", "style", "font", "a", "script"]), Ze = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]), Ke = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), rt = function(be) { + }, fe = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]), De = addToSet({}, ["annotation-xml"]), Ye = addToSet({}, ["title", "style", "font", "a", "script"]), Ze = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]), Ke = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), rt = function(be) { let Ve = g(be); (!Ve || !Ve.tagName) && (Ve = { - namespaceURI: ae, + namespaceURI: oe, tagName: "template" }); const et = stringToLowerCase(be.tagName), _t = stringToLowerCase(Ve.tagName); - return xe[be.namespaceURI] ? be.namespaceURI === ke ? Ve.namespaceURI === K ? et === "svg" : Ve.namespaceURI === ze ? et === "svg" && (_t === "annotation-xml" || de[_t]) : !!Ze[et] : be.namespaceURI === ze ? Ve.namespaceURI === K ? et === "math" : Ve.namespaceURI === ke ? et === "math" && Me[_t] : !!Ke[et] : be.namespaceURI === K ? Ve.namespaceURI === ke && !Me[_t] || Ve.namespaceURI === ze && !de[_t] ? !1 : !Ke[et] && (Ye[et] || !Ze[et]) : !!(Ce === "application/xhtml+xml" && xe[be.namespaceURI]) : !1; + return we[be.namespaceURI] ? be.namespaceURI === $e ? Ve.namespaceURI === K ? et === "svg" : Ve.namespaceURI === ze ? et === "svg" && (_t === "annotation-xml" || fe[_t]) : !!Ze[et] : be.namespaceURI === ze ? Ve.namespaceURI === K ? et === "math" : Ve.namespaceURI === $e ? et === "math" && De[_t] : !!Ke[et] : be.namespaceURI === K ? Ve.namespaceURI === $e && !De[_t] || Ve.namespaceURI === ze && !fe[_t] ? !1 : !Ke[et] && (Ye[et] || !Ze[et]) : !!(Te === "application/xhtml+xml" && we[be.namespaceURI]) : !1; }, wt = function(be) { arrayPush(e.removed, { element: be @@ -46542,8 +46848,8 @@ function createDOMPurify() { from: Ve }); } - if (Ve.removeAttribute(be), be === "is" && !Q[be]) - if (Oe || Be) + if (Ve.removeAttribute(be), be === "is" && !J[be]) + if (ke || Pe) try { wt(Ve); } catch { @@ -46555,92 +46861,92 @@ function createDOMPurify() { } }, ot = function(be) { let Ve = null, et = null; - if (Te) + if (ye) be = "" + be; else { - const Tt = stringMatch(be, /^[\r\n\t ]+/); - et = Tt && Tt[0]; + const kt = stringMatch(be, /^[\r\n\t ]+/); + et = kt && kt[0]; } - Ce === "application/xhtml+xml" && ae === K && (be = '' + be + ""); + Te === "application/xhtml+xml" && oe === K && (be = '' + be + ""); const _t = b ? b.createHTML(be) : be; - if (ae === K) + if (oe === K) try { - Ve = new A().parseFromString(_t, Ce); + Ve = new A().parseFromString(_t, Te); } catch { } if (!Ve || !Ve.documentElement) { - Ve = _.createDocument(ae, "template", null); + Ve = v.createDocument(oe, "template", null); try { Ve.documentElement.innerHTML = ge ? c : _t; } catch { } } - const kt = Ve.body || Ve.documentElement; - return be && et && kt.insertBefore(t.createTextNode(et), kt.childNodes[0] || null), ae === K ? k.call(Ve, le ? "html" : "body")[0] : le ? Ve.documentElement : kt; + const $t = Ve.body || Ve.documentElement; + return be && et && $t.insertBefore(t.createTextNode(et), $t.childNodes[0] || null), oe === K ? k.call(Ve, se ? "html" : "body")[0] : se ? Ve.documentElement : $t; }, at = function(be) { return E.call( be.ownerDocument || be, be, // eslint-disable-next-line no-bitwise - v.SHOW_ELEMENT | v.SHOW_COMMENT | v.SHOW_TEXT | v.SHOW_PROCESSING_INSTRUCTION | v.SHOW_CDATA_SECTION, + _.SHOW_ELEMENT | _.SHOW_COMMENT | _.SHOW_TEXT | _.SHOW_PROCESSING_INSTRUCTION | _.SHOW_CDATA_SECTION, null ); }, Mt = function(be) { return be instanceof y && (typeof be.nodeName != "string" || typeof be.textContent != "string" || typeof be.removeChild != "function" || !(be.attributes instanceof f) || typeof be.removeAttribute != "function" || typeof be.setAttribute != "function" || typeof be.namespaceURI != "string" || typeof be.insertBefore != "function" || typeof be.hasChildNodes != "function"); }, gt = function(be) { return typeof o == "function" && be instanceof o; - }, $t = function(be, Ve, et) { + }, Lt = function(be, Ve, et) { L[be] && arrayForEach(L[be], (_t) => { - _t.call(e, Ve, et, I); + _t.call(e, Ve, et, z); }); - }, Pt = function(be) { + }, Bt = function(be) { let Ve = null; - if ($t("beforeSanitizeElements", be, null), Mt(be)) + if (Lt("beforeSanitizeElements", be, null), Mt(be)) return wt(be), !0; const et = We(be.nodeName); - if ($t("uponSanitizeElement", be, { + if (Lt("uponSanitizeElement", be, { tagName: et, - allowedTags: G + allowedTags: N }), be.hasChildNodes() && !gt(be.firstElementChild) && regExpTest(/<[/\w]/g, be.innerHTML) && regExpTest(/<[/\w]/g, be.textContent) || be.nodeType === NODE_TYPE.progressingInstruction || pe && be.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, be.data)) return wt(be), !0; - if (!G[et] || ce[et]) { - if (!ce[et] && St(et) && (ee.tagNameCheck instanceof RegExp && regExpTest(ee.tagNameCheck, et) || ee.tagNameCheck instanceof Function && ee.tagNameCheck(et))) + if (!N[et] || ue[et]) { + if (!ue[et] && St(et) && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, et) || te.tagNameCheck instanceof Function && te.tagNameCheck(et))) return !1; if (Re && !Xe[et]) { - const _t = g(be) || be.parentNode, kt = p(be) || be.childNodes; - if (kt && _t) { - const Tt = kt.length; - for (let Lt = Tt - 1; Lt >= 0; --Lt) { - const It = m(kt[Lt], !0); - It.__removalCount = (be.__removalCount || 0) + 1, _t.insertBefore(It, u(be)); + const _t = g(be) || be.parentNode, $t = p(be) || be.childNodes; + if ($t && _t) { + const kt = $t.length; + for (let Ot = kt - 1; Ot >= 0; --Ot) { + const Pt = m($t[Ot], !0); + Pt.__removalCount = (be.__removalCount || 0) + 1, _t.insertBefore(Pt, u(be)); } } } return wt(be), !0; } - return be instanceof d && !rt(be) || (et === "noscript" || et === "noembed" || et === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, be.innerHTML) ? (wt(be), !0) : (Ie && be.nodeType === NODE_TYPE.text && (Ve = be.textContent, arrayForEach([z, F, R], (_t) => { + return be instanceof d && !rt(be) || (et === "noscript" || et === "noembed" || et === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, be.innerHTML) ? (wt(be), !0) : (Ie && be.nodeType === NODE_TYPE.text && (Ve = be.textContent, arrayForEach([I, F, P], (_t) => { Ve = stringReplace(Ve, _t, " "); }), be.textContent !== Ve && (arrayPush(e.removed, { element: be.cloneNode() - }), be.textContent = Ve)), $t("afterSanitizeElements", be, null), !1); + }), be.textContent = Ve)), Lt("afterSanitizeElements", be, null), !1); }, Et = function(be, Ve, et) { - if (Pe && (Ve === "id" || Ve === "name") && (et in t || et in we)) + if (Be && (Ve === "id" || Ve === "name") && (et in t || et in Ee)) return !1; - if (!(he && !fe[Ve] && regExpTest(P, Ve))) { - if (!(oe && regExpTest(U, Ve))) { - if (!Q[Ve] || fe[Ve]) { + if (!(ce && !ie[Ve] && regExpTest(B, Ve))) { + if (!(ae && regExpTest(G, Ve))) { + if (!J[Ve] || ie[Ve]) { if ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck - !(St(be) && (ee.tagNameCheck instanceof RegExp && regExpTest(ee.tagNameCheck, be) || ee.tagNameCheck instanceof Function && ee.tagNameCheck(be)) && (ee.attributeNameCheck instanceof RegExp && regExpTest(ee.attributeNameCheck, Ve) || ee.attributeNameCheck instanceof Function && ee.attributeNameCheck(Ve)) || // Alternative, second condition checks if it's an `is`-attribute, AND + !(St(be) && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, be) || te.tagNameCheck instanceof Function && te.tagNameCheck(be)) && (te.attributeNameCheck instanceof RegExp && regExpTest(te.attributeNameCheck, Ve) || te.attributeNameCheck instanceof Function && te.attributeNameCheck(Ve)) || // Alternative, second condition checks if it's an `is`-attribute, AND // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck - Ve === "is" && ee.allowCustomizedBuiltInElements && (ee.tagNameCheck instanceof RegExp && regExpTest(ee.tagNameCheck, et) || ee.tagNameCheck instanceof Function && ee.tagNameCheck(et))) + Ve === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, et) || te.tagNameCheck instanceof Function && te.tagNameCheck(et))) ) return !1; - } else if (!ye[Ve]) { - if (!regExpTest(V, stringReplace(et, B, ""))) { + } else if (!xe[Ve]) { + if (!regExpTest(H, stringReplace(et, R, ""))) { if (!((Ve === "src" || Ve === "xlink:href" || Ve === "href") && be !== "script" && stringIndexOf(et, "data:") === 0 && q[be])) { - if (!(Ae && !regExpTest(N, stringReplace(et, B, "")))) { + if (!(Me && !regExpTest(U, stringReplace(et, R, "")))) { if (et) return !1; } @@ -46653,7 +46959,7 @@ function createDOMPurify() { }, St = function(be) { return be !== "annotation-xml" && stringMatch(be, W); }, yt = function(be) { - $t("beforeSanitizeAttributes", be, null); + Lt("beforeSanitizeAttributes", be, null); const { attributes: Ve } = be; @@ -46663,58 +46969,58 @@ function createDOMPurify() { attrName: "", attrValue: "", keepAttr: !0, - allowedAttributes: Q + allowedAttributes: J }; let _t = Ve.length; for (; _t--; ) { - const kt = Ve[_t], { - name: Tt, - namespaceURI: Lt, - value: It - } = kt, Ht = We(Tt); - let Ft = Tt === "value" ? It : stringTrim(It); - if (et.attrName = Ht, et.attrValue = Ft, et.keepAttr = !0, et.forceKeepAttr = void 0, $t("uponSanitizeAttribute", be, et), Ft = et.attrValue, et.forceKeepAttr || (st(Tt, be), !et.keepAttr)) + const $t = Ve[_t], { + name: kt, + namespaceURI: Ot, + value: Pt + } = $t, Vt = We(kt); + let zt = kt === "value" ? Pt : stringTrim(Pt); + if (et.attrName = Vt, et.attrValue = zt, et.keepAttr = !0, et.forceKeepAttr = void 0, Lt("uponSanitizeAttribute", be, et), zt = et.attrValue, et.forceKeepAttr || (st(kt, be), !et.keepAttr)) continue; - if (!Se && regExpTest(/\/>/i, Ft)) { - st(Tt, be); + if (!Ae && regExpTest(/\/>/i, zt)) { + st(kt, be); continue; } - Ie && arrayForEach([z, F, R], (wr) => { - Ft = stringReplace(Ft, wr, " "); + Ie && arrayForEach([I, F, P], (Sr) => { + zt = stringReplace(zt, Sr, " "); }); - const xr = We(be.nodeName); - if (Et(xr, Ht, Ft)) { - if (Ge && (Ht === "id" || Ht === "name") && (st(Tt, be), Ft = Ne + Ft), pe && regExpTest(/((--!?|])>)|<\/(style|title)/i, Ft)) { - st(Tt, be); + const Er = We(be.nodeName); + if (Et(Er, Vt, zt)) { + if (Ge && (Vt === "id" || Vt === "name") && (st(kt, be), zt = Ue + zt), pe && regExpTest(/((--!?|])>)|<\/(style|title)/i, zt)) { + st(kt, be); continue; } - if (b && typeof x == "object" && typeof x.getAttributeType == "function" && !Lt) - switch (x.getAttributeType(xr, Ht)) { + if (b && typeof x == "object" && typeof x.getAttributeType == "function" && !Ot) + switch (x.getAttributeType(Er, Vt)) { case "TrustedHTML": { - Ft = b.createHTML(Ft); + zt = b.createHTML(zt); break; } case "TrustedScriptURL": { - Ft = b.createScriptURL(Ft); + zt = b.createScriptURL(zt); break; } } try { - Lt ? be.setAttributeNS(Lt, Tt, Ft) : be.setAttribute(Tt, Ft), Mt(be) ? wt(be) : arrayPop(e.removed); + Ot ? be.setAttributeNS(Ot, kt, zt) : be.setAttribute(kt, zt), Mt(be) ? wt(be) : arrayPop(e.removed); } catch { } } } - $t("afterSanitizeAttributes", be, null); - }, zt = function qe(be) { + Lt("afterSanitizeAttributes", be, null); + }, It = function qe(be) { let Ve = null; const et = at(be); - for ($t("beforeSanitizeShadowDOM", be, null); Ve = et.nextNode(); ) - $t("uponSanitizeShadowNode", Ve, null), !Pt(Ve) && (Ve.content instanceof s && qe(Ve.content), yt(Ve)); - $t("afterSanitizeShadowDOM", be, null); + for (Lt("beforeSanitizeShadowDOM", be, null); Ve = et.nextNode(); ) + Lt("uponSanitizeShadowNode", Ve, null), !Bt(Ve) && (Ve.content instanceof s && qe(Ve.content), yt(Ve)); + Lt("afterSanitizeShadowDOM", be, null); }; return e.sanitize = function(qe) { - let be = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Ve = null, et = null, _t = null, kt = null; + let be = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Ve = null, et = null, _t = null, $t = null; if (ge = !qe, ge && (qe = ""), typeof qe != "string" && !gt(qe)) if (typeof qe.toString == "function") { if (qe = qe.toString(), typeof qe != "string") @@ -46723,47 +47029,47 @@ function createDOMPurify() { throw typeErrorCreate("toString is not a function"); if (!e.isSupported) return qe; - if (ne || Y(be), e.removed = [], typeof qe == "string" && (De = !1), De) { + if (Q || Y(be), e.removed = [], typeof qe == "string" && (Ce = !1), Ce) { if (qe.nodeName) { - const It = We(qe.nodeName); - if (!G[It] || ce[It]) + const Pt = We(qe.nodeName); + if (!N[Pt] || ue[Pt]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); } } else if (qe instanceof o) Ve = ot(""), et = Ve.ownerDocument.importNode(qe, !0), et.nodeType === NODE_TYPE.element && et.nodeName === "BODY" || et.nodeName === "HTML" ? Ve = et : Ve.appendChild(et); else { - if (!Oe && !Ie && !le && // eslint-disable-next-line unicorn/prefer-includes + if (!ke && !Ie && !se && // eslint-disable-next-line unicorn/prefer-includes qe.indexOf("<") === -1) - return b && Ue ? b.createHTML(qe) : qe; + return b && Ne ? b.createHTML(qe) : qe; if (Ve = ot(qe), !Ve) - return Oe ? null : Ue ? c : ""; + return ke ? null : Ne ? c : ""; } - Ve && Te && wt(Ve.firstChild); - const Tt = at(De ? qe : Ve); - for (; _t = Tt.nextNode(); ) - Pt(_t) || (_t.content instanceof s && zt(_t.content), yt(_t)); - if (De) + Ve && ye && wt(Ve.firstChild); + const kt = at(Ce ? qe : Ve); + for (; _t = kt.nextNode(); ) + Bt(_t) || (_t.content instanceof s && It(_t.content), yt(_t)); + if (Ce) return qe; - if (Oe) { - if (Be) - for (kt = w.call(Ve.ownerDocument); Ve.firstChild; ) - kt.appendChild(Ve.firstChild); + if (ke) { + if (Pe) + for ($t = w.call(Ve.ownerDocument); Ve.firstChild; ) + $t.appendChild(Ve.firstChild); else - kt = Ve; - return (Q.shadowroot || Q.shadowrootmode) && (kt = $.call(r, kt, !0)), kt; - } - let Lt = le ? Ve.outerHTML : Ve.innerHTML; - return le && G["!doctype"] && Ve.ownerDocument && Ve.ownerDocument.doctype && Ve.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, Ve.ownerDocument.doctype.name) && (Lt = " -` + Lt), Ie && arrayForEach([z, F, R], (It) => { - Lt = stringReplace(Lt, It, " "); - }), b && Ue ? b.createHTML(Lt) : Lt; + $t = Ve; + return (J.shadowroot || J.shadowrootmode) && ($t = $.call(r, $t, !0)), $t; + } + let Ot = se ? Ve.outerHTML : Ve.innerHTML; + return se && N["!doctype"] && Ve.ownerDocument && Ve.ownerDocument.doctype && Ve.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, Ve.ownerDocument.doctype.name) && (Ot = " +` + Ot), Ie && arrayForEach([I, F, P], (Pt) => { + Ot = stringReplace(Ot, Pt, " "); + }), b && Ne ? b.createHTML(Ot) : Ot; }, e.setConfig = function() { let qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - Y(qe), ne = !0; + Y(qe), Q = !0; }, e.clearConfig = function() { - I = null, ne = !1; + z = null, Q = !1; }, e.isValidAttribute = function(qe, be, Ve) { - I || Y({}); + z || Y({}); const et = We(qe), _t = We(be); return Et(et, _t, Ve); }, e.addHook = function(qe, be) { @@ -46813,13 +47119,13 @@ function create_if_block$2(n) { /*value*/ n[0].covMods.length + "" ), o, d; - function v(M, m) { + function _(M, m) { return ( /*value*/ M[0].chains.length > 1 ? create_if_block_5$1 : create_else_block_1$1 ); } - let f = v(n), y = f(n), A = ensure_array_like( + let f = _(n), y = f(n), A = ensure_array_like( /*value*/ n[0].chains ), x = []; @@ -46850,7 +47156,7 @@ function create_if_block$2(n) { insert_hydration$2(M, r, m), insert_hydration$2(M, a, m), append_hydration$1(a, s), append_hydration$1(s, o), append_hydration$1(s, d); }, p(M, m) { - if (f === (f = v(M)) && y ? y.p(M, m) : (y.d(1), y = f(M), y && (y.c(), y.m(e.parentNode, e))), m & /*value, undefined*/ + if (f === (f = _(M)) && y ? y.p(M, m) : (y.d(1), y = f(M), y && (y.c(), y.m(e.parentNode, e))), m & /*value, undefined*/ 1) { A = ensure_array_like( /*value*/ @@ -46912,14 +47218,14 @@ function create_if_block_5$1(n) { }, l(d) { e = claim_element$1(d, "B", {}); - var v = children$1(e); - t = claim_text$2(v, "Input composed of "), a = claim_text$2(v, r), s = claim_text$2(v, " chains"), v.forEach(detach$2), h = claim_space$2(d), o = claim_element$1(d, "BR", {}); + var _ = children$1(e); + t = claim_text$2(_, "Input composed of "), a = claim_text$2(_, r), s = claim_text$2(_, " chains"), _.forEach(detach$2), h = claim_space$2(d), o = claim_element$1(d, "BR", {}); }, - m(d, v) { - insert_hydration$2(d, e, v), append_hydration$1(e, t), append_hydration$1(e, a), append_hydration$1(e, s), insert_hydration$2(d, h, v), insert_hydration$2(d, o, v); + m(d, _) { + insert_hydration$2(d, e, _), append_hydration$1(e, t), append_hydration$1(e, a), append_hydration$1(e, s), insert_hydration$2(d, h, _), insert_hydration$2(d, o, _); }, - p(d, v) { - v & /*value*/ + p(d, _) { + _ & /*value*/ 1 && r !== (r = /*value*/ d[0].chains.length + "") && set_data$2(a, r); }, @@ -46940,28 +47246,28 @@ function create_if_block_4$1(n) { c() { e = element$1("li"), t = element$1("div"), a = text$2(r), s = space$2(), o = text$2(h), d = text$2(" residues"), this.h(); }, - l(v) { - e = claim_element$1(v, "LI", {}); + l(_) { + e = claim_element$1(_, "LI", {}); var f = children$1(e); t = claim_element$1(f, "DIV", { class: !0 }); var y = children$1(t); a = claim_text$2(y, r), s = claim_space$2(y), o = claim_text$2(y, h), d = claim_text$2(y, " residues"), y.forEach(detach$2), f.forEach(detach$2), this.h(); }, h() { - attr$1(t, "class", "svelte-1r1gryw"); + attr$1(t, "class", "svelte-166104d"); }, - m(v, f) { - insert_hydration$2(v, e, f), append_hydration$1(e, t), append_hydration$1(t, a), append_hydration$1(t, s), append_hydration$1(t, o), append_hydration$1(t, d); + m(_, f) { + insert_hydration$2(_, e, f), append_hydration$1(e, t), append_hydration$1(t, a), append_hydration$1(t, s), append_hydration$1(t, o), append_hydration$1(t, d); }, - p(v, f) { + p(_, f) { f & /*value*/ 1 && r !== (r = /*val*/ - v[8].class + "") && set_data$2(a, r), f & /*value*/ + _[8].class + "") && set_data$2(a, r), f & /*value*/ 1 && h !== (h = /*val*/ - v[8].sequence.length + "") && set_data$2(o, h); + _[8].sequence.length + "") && set_data$2(o, h); }, - d(v) { - v && detach$2(e); + d(_) { + _ && detach$2(e); } }; } @@ -46996,7 +47302,7 @@ function create_if_block_1$1(n) { }; } function create_else_block$1(n) { - let e, t = '
Ligand
'; + let e, t = '
Ligand
'; return { c() { e = element$1("li"), e.innerHTML = t; @@ -47026,11 +47332,11 @@ function create_if_block_3$1(n) { e = claim_element$1(o, "LI", {}); var d = children$1(e); t = claim_element$1(d, "DIV", { class: !0 }); - var v = children$1(t); - r = claim_text$2(v, "Ligand SMILES with "), s = claim_text$2(v, a), h = claim_text$2(v, " atoms"), v.forEach(detach$2), d.forEach(detach$2), this.h(); + var _ = children$1(t); + r = claim_text$2(_, "Ligand SMILES with "), s = claim_text$2(_, a), h = claim_text$2(_, " atoms"), _.forEach(detach$2), d.forEach(detach$2), this.h(); }, h() { - attr$1(t, "class", "svelte-1r1gryw"); + attr$1(t, "class", "svelte-166104d"); }, m(o, d) { insert_hydration$2(o, e, d), append_hydration$1(e, t), append_hydration$1(t, r), append_hydration$1(t, s), append_hydration$1(t, h); @@ -47062,7 +47368,7 @@ function create_if_block_2$1(n) { r = claim_text$2(d, "Ligand "), s = claim_text$2(d, a), d.forEach(detach$2), o.forEach(detach$2), this.h(); }, h() { - attr$1(t, "class", "svelte-1r1gryw"); + attr$1(t, "class", "svelte-166104d"); }, m(h, o) { insert_hydration$2(h, e, o), append_hydration$1(e, t), append_hydration$1(t, r), append_hydration$1(t, s); @@ -47123,7 +47429,7 @@ function create_fragment$2(n) { r && r.l(s), s.forEach(detach$2), this.h(); }, h() { - attr$1(e, "class", "svelte-1r1gryw"), add_render_callback$1(() => ( + attr$1(e, "class", "flex items-center justify-center w-full svelte-166104d"), add_render_callback$1(() => ( /*div_elementresize_handler*/ n[5].call(e) )), toggle_class$1( @@ -47187,7 +47493,7 @@ function instance$2(n, e, t) { onMount$1(() => { d(o, h); }); - function v() { + function _() { h = this.clientWidth, t(3, h); } function f(y) { @@ -47197,7 +47503,7 @@ function instance$2(n, e, t) { } return n.$$set = (y) => { "value" in y && t(0, r = y.value), "type" in y && t(1, a = y.type), "selected" in y && t(2, s = y.selected); - }, [r, a, s, h, o, v, f]; + }, [r, a, s, h, o, _, f]; } class Example extends SvelteComponent$2 { constructor(e) { @@ -47274,17 +47580,17 @@ function create_default_slot$1(n) { }; } function create_else_block(n) { - let e, t, r, a, s, h, o, d, v = ( + let e, t, r, a, s, h, o, d, _ = ( /*show_label*/ n[6] && /*show_copy_button*/ n[10] && create_if_block_4(n) ); return { c() { - v && v.c(), e = space$1(), t = element("textarea"), this.h(); + _ && _.c(), e = space$1(), t = element("textarea"), this.h(); }, l(f) { - v && v.l(f), e = claim_space$1(f), t = claim_element(f, "TEXTAREA", { + _ && _.l(f), e = claim_space$1(f), t = claim_element(f, "TEXTAREA", { "data-testid": !0, class: !0, dir: !0, @@ -47294,7 +47600,7 @@ function create_else_block(n) { }), children(t).forEach(detach$1), this.h(); }, h() { - attr(t, "data-testid", "textbox"), attr(t, "class", "scroll-hide svelte-18tqgac"), attr(t, "dir", r = /*rtl*/ + attr(t, "data-testid", "textbox"), attr(t, "class", "scroll-hide"), attr(t, "dir", r = /*rtl*/ n[11] ? "rtl" : "ltr"), attr( t, "placeholder", @@ -47312,7 +47618,7 @@ function create_else_block(n) { n[13] : ""); }, m(f, y) { - v && v.m(f, y), insert_hydration$1(f, e, y), insert_hydration$1(f, t, y), set_input_value( + _ && _.m(f, y), insert_hydration$1(f, e, y), insert_hydration$1(f, t, y), set_input_value( t, /*value*/ n[0] @@ -47366,9 +47672,9 @@ function create_else_block(n) { p(f, y) { /*show_label*/ f[6] && /*show_copy_button*/ - f[10] ? v ? (v.p(f, y), y[0] & /*show_label, show_copy_button*/ - 1088 && transition_in$1(v, 1)) : (v = create_if_block_4(f), v.c(), transition_in$1(v, 1), v.m(e.parentNode, e)) : v && (group_outros$1(), transition_out$1(v, 1, 1, () => { - v = null; + f[10] ? _ ? (_.p(f, y), y[0] & /*show_label, show_copy_button*/ + 1088 && transition_in$1(_, 1)) : (_ = create_if_block_4(f), _.c(), transition_in$1(_, 1), _.m(e.parentNode, e)) : _ && (group_outros$1(), transition_out$1(_, 1, 1, () => { + _ = null; }), check_outros$1()), (!h || y[0] & /*rtl*/ 2048 && r !== (r = /*rtl*/ f[11] ? "rtl" : "ltr")) && attr(t, "dir", r), (!h || y[0] & /*placeholder*/ @@ -47403,13 +47709,13 @@ function create_else_block(n) { ); }, i(f) { - h || (transition_in$1(v), h = !0); + h || (transition_in$1(_), h = !0); }, o(f) { - transition_out$1(v), h = !1; + transition_out$1(_), h = !1; }, d(f) { - f && (detach$1(e), detach$1(t)), v && v.d(f), n[38](null), o = !1, run_all(d); + f && (detach$1(e), detach$1(t)), _ && _.d(f), n[38](null), o = !1, run_all(d); } }; } @@ -47453,7 +47759,7 @@ function create_if_block$1(n) { function create_if_block_4(n) { let e, t, r, a; const s = [create_if_block_5, create_else_block_1], h = []; - function o(d, v) { + function o(d, _) { return ( /*copied*/ d[15] ? 0 : 1 @@ -47466,14 +47772,14 @@ function create_if_block_4(n) { l(d) { t.l(d), r = empty(); }, - m(d, v) { - h[e].m(d, v), insert_hydration$1(d, r, v), a = !0; + m(d, _) { + h[e].m(d, _), insert_hydration$1(d, r, _), a = !0; }, - p(d, v) { + p(d, _) { let f = e; - e = o(d), e === f ? h[e].p(d, v) : (group_outros$1(), transition_out$1(h[f], 1, 1, () => { + e = o(d), e === f ? h[e].p(d, _) : (group_outros$1(), transition_out$1(h[f], 1, 1, () => { h[f] = null; - }), check_outros$1(), t = h[e], t ? t.p(d, v) : (t = h[e] = s[e](d), t.c()), transition_in$1(t, 1), t.m(r.parentNode, r)); + }), check_outros$1(), t = h[e], t ? t.p(d, _) : (t = h[e] = s[e](d), t.c()), transition_in$1(t, 1), t.m(r.parentNode, r)); }, i(d) { a || (transition_in$1(t), a = !0); @@ -47495,14 +47801,13 @@ function create_else_block_1(n) { l(h) { e = claim_element(h, "BUTTON", { "aria-label": !0, - "aria-roledescription": !0, - class: !0 + "aria-roledescription": !0 }); var o = children(e); claim_component$1(t.$$.fragment, o), o.forEach(detach$1), this.h(); }, h() { - attr(e, "aria-label", "Copy"), attr(e, "aria-roledescription", "Copy text"), attr(e, "class", "svelte-18tqgac"); + attr(e, "aria-label", "Copy"), attr(e, "aria-roledescription", "Copy text"); }, m(h, o) { insert_hydration$1(h, e, o), mount_component$1(t, e, null), r = !0, a || (s = listen( @@ -47533,14 +47838,13 @@ function create_if_block_5(n) { l(s) { e = claim_element(s, "BUTTON", { "aria-label": !0, - "aria-roledescription": !0, - class: !0 + "aria-roledescription": !0 }); var h = children(e); claim_component$1(t.$$.fragment, h), h.forEach(detach$1), this.h(); }, h() { - attr(e, "aria-label", "Copied"), attr(e, "aria-roledescription", "Text copied"), attr(e, "class", "svelte-18tqgac"); + attr(e, "aria-label", "Copied"), attr(e, "aria-roledescription", "Text copied"); }, m(s, h) { insert_hydration$1(s, e, h), mount_component$1(t, e, null), a = !0; @@ -47575,7 +47879,7 @@ function create_if_block_3(n) { }), this.h(); }, h() { - attr(e, "data-testid", "textbox"), attr(e, "type", "email"), attr(e, "class", "scroll-hide svelte-18tqgac"), attr( + attr(e, "data-testid", "textbox"), attr(e, "type", "email"), attr(e, "class", "scroll-hide"), attr( e, "placeholder", /*placeholder*/ @@ -47663,7 +47967,7 @@ function create_if_block_2(n) { }), this.h(); }, h() { - attr(e, "data-testid", "password"), attr(e, "type", "password"), attr(e, "class", "scroll-hide svelte-18tqgac"), attr( + attr(e, "data-testid", "password"), attr(e, "type", "password"), attr(e, "class", "scroll-hide"), attr( e, "placeholder", /*placeholder*/ @@ -47752,7 +48056,7 @@ function create_if_block_1(n) { }), this.h(); }, h() { - attr(e, "data-testid", "textbox"), attr(e, "type", "text"), attr(e, "class", "scroll-hide svelte-18tqgac"), attr(e, "dir", t = /*rtl*/ + attr(e, "data-testid", "textbox"), attr(e, "type", "text"), attr(e, "class", "scroll-hide"), attr(e, "dir", t = /*rtl*/ n[11] ? "rtl" : "ltr"), attr( e, "placeholder", @@ -47849,24 +48153,24 @@ function create_fragment$1(n) { } }); const o = [create_if_block$1, create_else_block], d = []; - function v(f, y) { + function _(f, y) { return ( /*lines*/ f[1] === 1 && /*max_lines*/ f[8] === 1 ? 0 : 1 ); } - return a = v(n), s = d[a] = o[a](n), { + return a = _(n), s = d[a] = o[a](n), { c() { e = element("label"), create_component$1(t.$$.fragment), r = space$1(), s.c(), this.h(); }, l(f) { - e = claim_element(f, "LABEL", { class: !0 }); + e = claim_element(f, "LABEL", {}); var y = children(e); claim_component$1(t.$$.fragment, y), r = claim_space$1(y), s.l(y), y.forEach(detach$1), this.h(); }, h() { - attr(e, "class", "svelte-18tqgac"), toggle_class( + toggle_class( e, "container", /*container*/ @@ -47886,7 +48190,7 @@ function create_fragment$1(n) { 8 | y[1] & /*$$scope*/ 131072 && (A.$$scope = { dirty: y, ctx: f }), t.$set(A); let x = a; - a = v(f), a === x ? d[a].p(f, y) : (group_outros$1(), transition_out$1(d[x], 1, 1, () => { + a = _(f), a === x ? d[a].p(f, y) : (group_outros$1(), transition_out$1(d[x], 1, 1, () => { d[x] = null; }), check_outros$1(), s = d[a], s ? s.p(f, y) : (s = d[a] = o[a](f), s.c()), transition_in$1(s, 1), s.m(e, null)), (!h || y[0] & /*container*/ 128) && toggle_class( @@ -47908,21 +48212,21 @@ function create_fragment$1(n) { }; } function instance$1(n, e, t) { - let { value: r = "" } = e, { value_is_output: a = !1 } = e, { lines: s = 1 } = e, { placeholder: h = "Type here..." } = e, { label: o } = e, { info: d = void 0 } = e, { disabled: v = !1 } = e, { show_label: f = !0 } = e, { container: y = !0 } = e, { max_lines: A } = e, { type: x = "text" } = e, { show_copy_button: M = !1 } = e, { rtl: m = !1 } = e, { autofocus: l = !1 } = e, { text_align: u = void 0 } = e, { autoscroll: p = !0 } = e, g, b = !1, c, _, E = 0, w = !1; + let { value: r = "" } = e, { value_is_output: a = !1 } = e, { lines: s = 1 } = e, { placeholder: h = "Type here..." } = e, { label: o } = e, { info: d = void 0 } = e, { disabled: _ = !1 } = e, { show_label: f = !0 } = e, { container: y = !0 } = e, { max_lines: A } = e, { type: x = "text" } = e, { show_copy_button: M = !1 } = e, { rtl: m = !1 } = e, { autofocus: l = !1 } = e, { text_align: u = void 0 } = e, { autoscroll: p = !0 } = e, g, b = !1, c, v, E = 0, w = !1; const k = createEventDispatcher(); beforeUpdate(() => { - _ = g && g.offsetHeight + g.scrollTop > g.scrollHeight - 100; + v = g && g.offsetHeight + g.scrollTop > g.scrollHeight - 100; }); const $ = () => { - _ && p && !w && g.scrollTo(0, g.scrollHeight); + v && p && !w && g.scrollTo(0, g.scrollHeight); }; function L() { k("change", r), a || k("input"); } afterUpdate(() => { - l && g.focus(), _ && p && $(), t(21, a = !1); + l && g.focus(), v && p && $(), t(21, a = !1); }); - async function z() { + async function I() { "clipboard" in navigator && (await navigator.clipboard.writeText(r), F()); } function F() { @@ -47933,95 +48237,95 @@ function instance$1(n, e, t) { 1e3 ); } - function R(ne) { - const Te = ne.target, Oe = Te.value, Be = [Te.selectionStart, Te.selectionEnd]; - k("select", { value: Oe.substring(...Be), index: Be }); + function P(Q) { + const ye = Q.target, ke = ye.value, Pe = [ye.selectionStart, ye.selectionEnd]; + k("select", { value: ke.substring(...Pe), index: Pe }); } - async function P(ne) { - await tick(), (ne.key === "Enter" && ne.shiftKey && s > 1 || ne.key === "Enter" && !ne.shiftKey && s === 1 && A >= 1) && (ne.preventDefault(), k("submit")); + async function B(Q) { + await tick(), (Q.key === "Enter" && Q.shiftKey && s > 1 || Q.key === "Enter" && !Q.shiftKey && s === 1 && A >= 1) && (Q.preventDefault(), k("submit")); } - function U(ne) { - const Te = ne.target, Oe = Te.scrollTop; - Oe < E && (w = !0), E = Oe; - const Be = Te.scrollHeight - Te.clientHeight; - Oe >= Be && (w = !1); + function G(Q) { + const ye = Q.target, ke = ye.scrollTop; + ke < E && (w = !0), E = ke; + const Pe = ye.scrollHeight - ye.clientHeight; + ke >= Pe && (w = !1); } - async function N(ne) { + async function U(Q) { if (await tick(), s === A) return; - let Te = A === void 0 ? !1 : A === void 0 ? 21 * 11 : 21 * (A + 1), Oe = 21 * (s + 1); - const Be = ne.target; - Be.style.height = "1px"; - let Ue; - Te && Be.scrollHeight > Te ? Ue = Te : Be.scrollHeight < Oe ? Ue = Oe : Ue = Be.scrollHeight, Be.style.height = `${Ue}px`; - } - function B(ne, Te) { - if (s !== A && (ne.style.overflowY = "scroll", ne.addEventListener("input", N), !!Te.trim())) - return N({ target: ne }), { - destroy: () => ne.removeEventListener("input", N) + let ye = A === void 0 ? !1 : A === void 0 ? 21 * 11 : 21 * (A + 1), ke = 21 * (s + 1); + const Pe = Q.target; + Pe.style.height = "1px"; + let Ne; + ye && Pe.scrollHeight > ye ? Ne = ye : Pe.scrollHeight < ke ? Ne = ke : Ne = Pe.scrollHeight, Pe.style.height = `${Ne}px`; + } + function R(Q, ye) { + if (s !== A && (Q.style.overflowY = "scroll", Q.addEventListener("input", U), !!ye.trim())) + return U({ target: Q }), { + destroy: () => Q.removeEventListener("input", U) }; } - function W(ne) { - bubble.call(this, n, ne); + function W(Q) { + bubble.call(this, n, Q); } - function V(ne) { - bubble.call(this, n, ne); + function H(Q) { + bubble.call(this, n, Q); } - function G(ne) { - bubble.call(this, n, ne); + function N(Q) { + bubble.call(this, n, Q); } - function H(ne) { - bubble.call(this, n, ne); + function V(Q) { + bubble.call(this, n, Q); } - function Q(ne) { - bubble.call(this, n, ne); + function J(Q) { + bubble.call(this, n, Q); } - function te(ne) { - bubble.call(this, n, ne); + function re(Q) { + bubble.call(this, n, Q); } - function ee(ne) { - bubble.call(this, n, ne); + function te(Q) { + bubble.call(this, n, Q); } - function ce(ne) { - bubble.call(this, n, ne); + function ue(Q) { + bubble.call(this, n, Q); } - function fe() { + function ie() { r = this.value, t(0, r); } - function oe(ne) { - binding_callbacks$1[ne ? "unshift" : "push"](() => { - g = ne, t(14, g); + function ae(Q) { + binding_callbacks$1[Q ? "unshift" : "push"](() => { + g = Q, t(14, g); }); } - function he() { + function ce() { r = this.value, t(0, r); } - function Ae(ne) { - binding_callbacks$1[ne ? "unshift" : "push"](() => { - g = ne, t(14, g); + function Me(Q) { + binding_callbacks$1[Q ? "unshift" : "push"](() => { + g = Q, t(14, g); }); } - function Se() { + function Ae() { r = this.value, t(0, r); } - function Ie(ne) { - binding_callbacks$1[ne ? "unshift" : "push"](() => { - g = ne, t(14, g); + function Ie(Q) { + binding_callbacks$1[Q ? "unshift" : "push"](() => { + g = Q, t(14, g); }); } function pe() { r = this.value, t(0, r); } - function le(ne) { - binding_callbacks$1[ne ? "unshift" : "push"](() => { - g = ne, t(14, g); + function se(Q) { + binding_callbacks$1[Q ? "unshift" : "push"](() => { + g = Q, t(14, g); }); } - return n.$$set = (ne) => { - "value" in ne && t(0, r = ne.value), "value_is_output" in ne && t(21, a = ne.value_is_output), "lines" in ne && t(1, s = ne.lines), "placeholder" in ne && t(2, h = ne.placeholder), "label" in ne && t(3, o = ne.label), "info" in ne && t(4, d = ne.info), "disabled" in ne && t(5, v = ne.disabled), "show_label" in ne && t(6, f = ne.show_label), "container" in ne && t(7, y = ne.container), "max_lines" in ne && t(8, A = ne.max_lines), "type" in ne && t(9, x = ne.type), "show_copy_button" in ne && t(10, M = ne.show_copy_button), "rtl" in ne && t(11, m = ne.rtl), "autofocus" in ne && t(12, l = ne.autofocus), "text_align" in ne && t(13, u = ne.text_align), "autoscroll" in ne && t(22, p = ne.autoscroll); + return n.$$set = (Q) => { + "value" in Q && t(0, r = Q.value), "value_is_output" in Q && t(21, a = Q.value_is_output), "lines" in Q && t(1, s = Q.lines), "placeholder" in Q && t(2, h = Q.placeholder), "label" in Q && t(3, o = Q.label), "info" in Q && t(4, d = Q.info), "disabled" in Q && t(5, _ = Q.disabled), "show_label" in Q && t(6, f = Q.show_label), "container" in Q && t(7, y = Q.container), "max_lines" in Q && t(8, A = Q.max_lines), "type" in Q && t(9, x = Q.type), "show_copy_button" in Q && t(10, M = Q.show_copy_button), "rtl" in Q && t(11, m = Q.rtl), "autofocus" in Q && t(12, l = Q.autofocus), "text_align" in Q && t(13, u = Q.text_align), "autoscroll" in Q && t(22, p = Q.autoscroll); }, n.$$.update = () => { n.$$.dirty[0] & /*value*/ 1 && r === null && t(0, r = ""), n.$$.dirty[0] & /*value, el, lines, max_lines*/ - 16643 && g && s !== A && N({ target: g }), n.$$.dirty[0] & /*value*/ + 16643 && g && s !== A && U({ target: g }), n.$$.dirty[0] & /*value*/ 1 && L(); }, [ r, @@ -48029,7 +48333,7 @@ function instance$1(n, e, t) { h, o, d, - v, + _, f, y, A, @@ -48040,29 +48344,29 @@ function instance$1(n, e, t) { u, g, b, - z, - R, + I, P, - U, B, + G, + R, a, p, W, - V, - G, H, - Q, + N, + V, + J, + re, te, - ee, + ue, + ie, + ae, ce, - fe, - oe, - he, + Me, Ae, - Se, Ie, pe, - le + se ]; } class Textbox extends SvelteComponent$1 { @@ -48236,11 +48540,11 @@ function create_default_slot(n) { function d(f) { n[14](f); } - let v = {}; + let _ = {}; return ( /*value*/ - n[0] !== void 0 && (v.value = /*value*/ - n[0]), a = new SequenceInput({ props: v }), binding_callbacks.push(() => bind(a, "value", d)), a.$on( + n[0] !== void 0 && (_.value = /*value*/ + n[0]), a = new SequenceInput({ props: _ }), binding_callbacks.push(() => bind(a, "value", d)), a.$on( "updateVals", /*syncValue*/ n[12] @@ -48359,26 +48663,25 @@ function create_fragment(n) { }; } function instance(n, e, t) { - let { gradio: r } = e, { label: a = "CofoldingInput" } = e, { info: s = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: o = [] } = e, { visible: d = !0 } = e, { value: v = { chains: [], covMods: [] } } = e, { show_label: f } = e, { container: y = !0 } = e, { scale: A = null } = e, { min_width: x = void 0 } = e, { loading_status: M = void 0 } = e; + let { gradio: r } = e, { label: a = "CofoldingInput" } = e, { info: s = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: o = [] } = e, { visible: d = !0 } = e, { value: _ = { chains: [], covMods: [] } } = e, { show_label: f } = e, { container: y = !0 } = e, { scale: A = null } = e, { min_width: x = void 0 } = e, { loading_status: M = void 0 } = e; function m(p) { - let g = p.detail.map((b) => Object.fromEntries(Object.entries(b).filter(([c, _]) => c !== "open" && _ !== ""))); - t(0, v.chains = g, v); + t(0, _.chains = p.detail, _); } function l(p) { - t(0, v.covMods = p.detail, v); + t(0, _.covMods = p.detail, _); } onMount(() => { }); function u(p) { - v = p, t(0, v); + _ = p, t(0, _); } return n.$$set = (p) => { - "gradio" in p && t(1, r = p.gradio), "label" in p && t(2, a = p.label), "info" in p && t(3, s = p.info), "elem_id" in p && t(4, h = p.elem_id), "elem_classes" in p && t(5, o = p.elem_classes), "visible" in p && t(6, d = p.visible), "value" in p && t(0, v = p.value), "show_label" in p && t(7, f = p.show_label), "container" in p && t(8, y = p.container), "scale" in p && t(9, A = p.scale), "min_width" in p && t(10, x = p.min_width), "loading_status" in p && t(11, M = p.loading_status); + "gradio" in p && t(1, r = p.gradio), "label" in p && t(2, a = p.label), "info" in p && t(3, s = p.info), "elem_id" in p && t(4, h = p.elem_id), "elem_classes" in p && t(5, o = p.elem_classes), "visible" in p && t(6, d = p.visible), "value" in p && t(0, _ = p.value), "show_label" in p && t(7, f = p.show_label), "container" in p && t(8, y = p.container), "scale" in p && t(9, A = p.scale), "min_width" in p && t(10, x = p.min_width), "loading_status" in p && t(11, M = p.loading_status); }, n.$$.update = () => { n.$$.dirty & /*value*/ - 1 && console.log(v); + 1 && console.log(_); }, [ - v, + _, r, a, s,