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,19 @@ +function _mergeNamespaces(n, e) { + for (var t = 0; t < e.length; t++) { + const r = e[t]; + if (typeof r != "string" && !Array.isArray(r)) { + for (const a in r) + if (a !== "default" && !(a in n)) { + const s = Object.getOwnPropertyDescriptor(r, a); + s && Object.defineProperty(n, a, s.get ? s : { + enumerable: !0, + get: () => r[a] + }); + } + } + } + return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" })); +} const { SvelteComponent: SvelteComponent$i, assign: assign$1, @@ -331,19 +347,19 @@ 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: g = !0 } = e, { allow_overflow: p = !0 } = e, { overflow_behavior: b = "auto" } = e, { scale: c = null } = e, { min_width: _ = 0 } = e, { flex: E = !1 } = e; - g || (E = !1); + 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; + p || (E = !1); let w = M === "fieldset" ? "fieldset" : "div"; - const k = (L) => { - if (L !== void 0) { - if (typeof L == "number") - return L + "px"; - if (typeof L == "string") - return L; + const k = ($) => { + if ($ !== void 0) { + if (typeof $ == "number") + return $ + "px"; + if (typeof $ == "string") + return $; } }; - return n.$$set = (L) => { - "height" in L && t(1, s = L.height), "min_height" in L && t(2, h = L.min_height), "max_height" in L && t(3, o = L.max_height), "width" in L && t(4, d = L.width), "elem_id" in L && t(5, v = L.elem_id), "elem_classes" in L && t(6, f = L.elem_classes), "variant" in L && t(7, y = L.variant), "border_mode" in L && t(8, A = L.border_mode), "padding" in L && t(9, x = L.padding), "type" in L && t(20, M = L.type), "test_id" in L && t(10, m = L.test_id), "explicit_call" in L && t(11, l = L.explicit_call), "container" in L && t(12, u = L.container), "visible" in L && t(13, g = L.visible), "allow_overflow" in L && t(14, p = L.allow_overflow), "overflow_behavior" in L && t(15, b = L.overflow_behavior), "scale" in L && t(16, c = L.scale), "min_width" in L && t(17, _ = L.min_width), "flex" in L && t(0, E = L.flex), "$$scope" in L && t(21, a = L.$$scope); + 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); }, [ E, s, @@ -358,8 +374,8 @@ function instance$f(n, e, t) { m, l, u, - g, p, + g, b, c, _, @@ -4759,11 +4775,11 @@ var wideLatinLetterData = [ var u = retrieveTextFontName("amsrm", t.fontWeight, t.fontShape); return makeSymbol(s, u, a, t, h.concat("amsrm", t.fontWeight, t.fontShape)); } else if (l === "main" || !l) { - var g = retrieveTextFontName("textrm", t.fontWeight, t.fontShape); - return makeSymbol(s, g, a, t, h.concat(t.fontWeight, t.fontShape)); + var p = retrieveTextFontName("textrm", t.fontWeight, t.fontShape); + return makeSymbol(s, p, a, t, h.concat(t.fontWeight, t.fontShape)); } else { - var p = retrieveTextFontName(l, t.fontWeight, t.fontShape); - return makeSymbol(s, p, a, t, h.concat(p, t.fontWeight, t.fontShape)); + var g = retrieveTextFontName(l, t.fontWeight, t.fontShape); + return makeSymbol(s, g, a, t, h.concat(g, t.fontWeight, t.fontShape)); } } else throw new Error("unexpected type: " + r + " in makeOrd"); @@ -4865,8 +4881,8 @@ var wideLatinLetterData = [ if (m.type === "kern") x += m.size; else { - var l = m.elem, u = m.wrapperClasses || [], g = m.wrapperStyle || {}, p = makeSpan$2(u, [v, l], void 0, g); - p.style.top = makeEm(-s - x - l.depth), m.marginLeft && (p.style.marginLeft = m.marginLeft), m.marginRight && (p.style.marginRight = m.marginRight), f.push(p), x += l.height + l.depth; + var l = m.elem, u = m.wrapperClasses || [], p = m.wrapperStyle || {}, g = makeSpan$2(u, [v, 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); } @@ -5152,9 +5168,9 @@ var normalizeArgument = function(e) { }, { node: y }, A, x), traverseNonSpaceNodes(s, (M, m) => { - var l = getTypeOfDomTree(m), u = getTypeOfDomTree(M), g = l && u ? M.hasClass("mtight") ? tightSpacings[l][u] : spacings[l][u] : null; - if (g) - return buildCommon.makeGlue(g, v); + 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); }, { node: y }, A, x), s; @@ -5584,10 +5600,10 @@ var optionsFromSettings = function(e) { height: x }; } else { - var u = [], g = katexImagesData[d], [p, b, c] = g, _ = c / 1e3, E = p.length, w, k; + var u = [], p = katexImagesData[d], [g, b, c] = p, _ = c / 1e3, E = g.length, w, k; if (E === 1) { - var L = g[3]; - w = ["hide-tail"], k = [L]; + var $ = p[3]; + w = ["hide-tail"], k = [$]; } else if (E === 2) w = ["halfarrow-left", "halfarrow-right"], k = ["xMinYMin", "xMaxYMin"]; else if (E === 3) @@ -5595,13 +5611,13 @@ var optionsFromSettings = function(e) { else throw new Error(`Correct katexImagesData or update code here to support ` + E + " children."); - for (var $ = 0; $ < E; $++) { - var z = new PathNode(p[$]), O = new SvgNode([z], { + for (var L = 0; L < E; L++) { + var z = new PathNode(g[L]), F = new SvgNode([z], { width: "400em", height: makeEm(_), viewBox: "0 0 " + o + " " + c, - preserveAspectRatio: k[$] + " slice" - }), R = buildCommon.makeSvgSpan([w[$]], [O], t); + preserveAspectRatio: k[L] + " slice" + }), R = buildCommon.makeSvgSpan([w[L]], [F], t); if (E === 1) return { span: R, @@ -6527,16 +6543,16 @@ var getMetrics = function(e, t, r) { o = v = 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, g = getMetrics(f, x, s), p = g.height + g.depth, b = 0, c = 1; + 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; if (d !== null) { var _ = getMetrics(d, x, s); b = _.height + _.depth, c = 2; } - var E = m + p + b, w = Math.max(0, Math.ceil((t - E) / (c * u))), k = E + w * c * u, L = a.fontMetrics().axisHeight; - r && (L *= a.sizeMultiplier); - var $ = k / 2 - L, z = []; + 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 = []; if (y.length > 0) { - var O = k - m - p, R = Math.round(k * 1e3), P = tallDelim(y, Math.round(O * 1e3)), U = new PathNode(y, P), N = (A / 1e3).toFixed(3) + "em", B = (R / 1e3).toFixed(3) + "em", W = new SvgNode([U], { + 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 @@ -6547,17 +6563,17 @@ var getMetrics = function(e, t, r) { }); } else { if (z.push(makeGlyphSpan(f, x, s)), z.push(lap), d === null) { - var G = k - m - p + 2 * lapInEms; + var G = k - m - g + 2 * lapInEms; z.push(makeInner(v, G, a)); } else { - var H = (k - m - p - b) / 2 + 2 * lapInEms; + 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)); } z.push(lap), z.push(makeGlyphSpan(o, x, s)); } var Q = a.havingBaseStyle(Style$1.TEXT), te = buildCommon.makeVList({ positionType: "bottom", - positionData: $, + positionData: L, children: z }, Q); return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [te], Q), Style$1.TEXT, a, h); @@ -6935,9 +6951,9 @@ var htmlBuilder$7 = (n, e) => { // User override. ), m = e.fontMetrics().fboxsep + (r === "colorbox" ? 0 : u), l = m) : r === "angl" ? (u = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), m = 4 * u, l = Math.max(0, 0.25 - t.depth)) : (m = o ? 0.2 : 0, l = m), s = stretchy.encloseSpan(t, r, m, l, e), /fbox|boxed|fcolorbox/.test(r) ? (s.style.borderStyle = "solid", s.style.borderWidth = makeEm(u)) : r === "angl" && u !== 0.049 && (s.style.borderTopWidth = makeEm(u), s.style.borderRightWidth = makeEm(u)), h = t.depth + l, n.backgroundColor && (s.style.backgroundColor = n.backgroundColor, n.borderColor && (s.style.borderColor = n.borderColor)); } - var g; + var p; if (n.backgroundColor) - g = buildCommon.makeVList({ + p = buildCommon.makeVList({ positionType: "individualShift", children: [ // Put the color background behind inner; @@ -6954,8 +6970,8 @@ var htmlBuilder$7 = (n, e) => { ] }, e); else { - var p = /cancel|phase/.test(r) ? ["svg-align"] : []; - g = buildCommon.makeVList({ + var g = /cancel|phase/.test(r) ? ["svg-align"] : []; + p = buildCommon.makeVList({ positionType: "individualShift", children: [ // Write the \cancel stroke on top of inner. @@ -6968,12 +6984,12 @@ var htmlBuilder$7 = (n, e) => { type: "elem", elem: s, shift: h, - wrapperClasses: p + wrapperClasses: g } ] }, e); } - return /cancel/.test(r) && (g.height = t.height, g.depth = t.depth), /cancel/.test(r) && !o ? buildCommon.makeSpan(["mord", "cancel-lap"], [g], e) : buildCommon.makeSpan(["mord"], [g], e); + return /cancel/.test(r) && (p.height = t.height, p.depth = t.depth), /cancel/.test(r) && !o ? buildCommon.makeSpan(["mord", "cancel-lap"], [p], e) : buildCommon.makeSpan(["mord"], [p], e); }, mathmlBuilder$6 = (n, e) => { var t = 0, r = new mathMLTree.MathNode(n.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(n.body, e)]); switch (n.label) { @@ -7184,14 +7200,14 @@ function parseArray(n, e, t) { throw new ParseError("Invalid \\arraystretch: " + x); } n.gullet.beginGroup(); - var M = [], m = [M], l = [], u = [], g = d != null ? [] : void 0; - function p() { + var M = [], m = [M], l = [], u = [], p = d != null ? [] : void 0; + function g() { d && n.gullet.macros.set("\\@eqnsw", "1", !0); } function b() { - g && (n.gullet.macros.get("\\df@tag") ? (g.push(n.subparse([new Token("\\df@tag")])), n.gullet.macros.set("\\df@tag", void 0, !0)) : g.push(!!d && n.gullet.macros.get("\\@eqnsw") === "1")); + 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 (p(), u.push(getHLines(n)); ; ) { + for (g(), u.push(getHLines(n)); ; ) { var c = n.parseExpression(!1, v ? "\\end" : "\\\\"); n.gullet.endGroup(), n.gullet.beginGroup(), c = { type: "ordgroup", @@ -7217,7 +7233,7 @@ function parseArray(n, e, t) { } else if (_ === "\\\\") { 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), p(); + n.gullet.future().text !== " " && (E = n.parseSizeGroup(!0)), l.push(E ? E.value : null), b(), u.push(getHLines(n)), M = [], m.push(M), g(); } else throw new ParseError("Expected & or \\\\ or \\cr or \\end", n.nextToken); } @@ -7232,7 +7248,7 @@ function parseArray(n, e, t) { hskipBeforeAndAfter: r, hLinesBeforeRow: u, colSeparationType: o, - tags: g, + tags: p, leqno: A }; } @@ -7253,26 +7269,26 @@ var htmlBuilder$6 = function(e, t) { var M = e.colSeparationType === "CD" ? calculateSize({ number: 3, unit: "ex" - }, t) : 12 * y, m = 3 * y, l = e.arraystretch * M, u = 0.7 * l, g = 0.3 * l, p = 0; + }, 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 && (p += 0.25), v.push({ - pos: p, + Ue > 0 && (g += 0.25), v.push({ + pos: g, isDashed: Be[Ue] }); } for (b(h[0]), r = 0; r < e.body.length; ++r) { - var c = e.body[r], _ = u, E = g; + var c = e.body[r], _ = 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; } - var L = e.rowGaps[r], $ = 0; - L && ($ = calculateSize(L, t), $ > 0 && ($ += g, E < $ && (E = $), $ = 0)), e.addJot && (E += m), w.height = _, w.depth = E, p += _, w.pos = p, p += E + $, d[r] = w, b(h[r + 1]); + 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]); } - var z = p / 2 + t.fontMetrics().axisHeight, O = e.cols || [], R = [], P, U, N = []; + var z = g / 2 + t.fontMetrics().axisHeight, F = e.cols || [], R = [], P, U, N = []; if (e.tags && e.tags.some((Be) => Be)) for (r = 0; r < s; ++r) { var B = d[r], W = B.pos - z, V = e.tags[r], G = void 0; @@ -7286,18 +7302,18 @@ var htmlBuilder$6 = function(e, t) { a = 0, U = 0; // Continue while either there are more columns or more column // descriptions, so trailing separators don't get lost. - a < o || U < O.length; + a < o || U < F.length; ++a, ++U ) { - for (var H = O[U] || {}, Q = !0; H.type === "separator"; ) { + 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(p), ee.style.borderRightWidth = makeEm(f), ee.style.borderRightStyle = te, ee.style.margin = "0 " + makeEm(-f / 2); - var ce = p - z; + 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); } else throw new ParseError("Invalid separator type: " + H.separator); - U++, H = O[U] || {}, Q = !1; + U++, H = F[U] || {}, Q = !1; } if (!(a >= o)) { var fe = void 0; @@ -7344,11 +7360,11 @@ var htmlBuilder$6 = function(e, t) { } if (N.length === 0) return buildCommon.makeSpan(["mord"], [d], t); - var Fe = buildCommon.makeVList({ + var Oe = buildCommon.makeVList({ positionType: "individualShift", children: N }, t); - return Fe = buildCommon.makeSpan(["tag"], [Fe], t), buildCommon.makeFragment([d, Fe]); + return Oe = buildCommon.makeSpan(["tag"], [Oe], t), buildCommon.makeFragment([d, Oe]); }, alignMap = { c: "center ", l: "left ", @@ -7363,10 +7379,10 @@ var htmlBuilder$6 = function(e, t) { f.setAttribute("rowspacing", makeEm(y)); var A = "", x = ""; if (e.cols && e.cols.length > 0) { - var M = e.cols, m = "", l = !1, u = 0, g = M.length; - M[0].type === "separator" && (A += "top ", u = 1), M[M.length - 1].type === "separator" && (A += "bottom ", g -= 1); - for (var p = u; p < g; p++) - M[p].type === "align" ? (x += alignMap[M[p].align], l && (m += "none "), l = !0) : M[p].type === "separator" && l && (m += M[p].separator === "|" ? "solid " : "dashed ", l = !1); + var M = e.cols, m = "", l = !1, u = 0, p = M.length; + M[0].type === "separator" && (A += "top ", u = 1), M[M.length - 1].type === "separator" && (A += "bottom ", p -= 1); + for (var g = u; g < p; g++) + M[g].type === "align" ? (x += alignMap[M[g].align], l && (m += "none "), l = !0) : M[g].type === "separator" && l && (m += M[g].separator === "|" ? "solid " : "dashed ", l = !1); f.setAttribute("columnalign", x.trim()), /[sd]/.test(m) && f.setAttribute("columnlines", m.trim()); } if (e.colSeparationType === "align") { @@ -7403,8 +7419,8 @@ var htmlBuilder$6 = function(e, t) { } var x = !d; h.body.forEach(function(u) { - for (var g = 1; g < u.length; g += 2) { - var p = assertNodeType(u[g], "styling"), b = assertNodeType(p.body[0], "ordgroup"); + 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); } if (x) @@ -7849,9 +7865,9 @@ var adjustStyle = (n, e) => { 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 g = e.fontMetrics().axisHeight; - x - h.depth - (g + 0.5 * y) < M && (x += M - (x - h.depth - (g + 0.5 * y))), g - 0.5 * y - (v.height - m) < M && (m += M - (g - 0.5 * y - (v.height - m))); - var p = -(g - 0.5 * y); + 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))); + var g = -(p - 0.5 * y); l = buildCommon.makeVList({ positionType: "individualShift", children: [{ @@ -7861,7 +7877,7 @@ var adjustStyle = (n, e) => { }, { type: "elem", elem: f, - shift: p + shift: g }, { type: "elem", elem: h, @@ -9392,8 +9408,8 @@ defineFunction({ type: "elem", elem: m }] - }, e), g = buildCommon.makeSpan(["root"], [u]); - return buildCommon.makeSpan(["mord", "sqrt"], [g, x], e); + }, e), p = buildCommon.makeSpan(["root"], [u]); + return buildCommon.makeSpan(["mord", "sqrt"], [p, x], e); } else return buildCommon.makeSpan(["mord", "sqrt"], [x], e); }, @@ -9489,10 +9505,10 @@ defineFunctionBuilders({ } 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), g = null; + var l = e.sizeMultiplier, u = makeEm(0.5 / v.ptPerEm / l), p = null; if (d) { - var p = n.base && n.base.type === "op" && n.base.name && (n.base.name === "\\oiint" || n.base.name === "\\oiiint"); - (h instanceof SymbolNode || p) && (g = makeEm(-h.italic)); + 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) { @@ -9508,7 +9524,7 @@ defineFunctionBuilders({ elem: d, shift: y, marginRight: u, - marginLeft: g + marginLeft: p }, { type: "elem", elem: o, @@ -9524,7 +9540,7 @@ defineFunctionBuilders({ var k = [{ type: "elem", elem: d, - marginLeft: g, + marginLeft: p, marginRight: u }]; b = buildCommon.makeVList({ @@ -9544,8 +9560,8 @@ defineFunctionBuilders({ }, e); else throw new Error("supsub must have either sup or sub."); - var L = getTypeOfDomTree(h, "right") || "mord"; - return buildCommon.makeSpan([L], [h, buildCommon.makeSpan(["msupsub"], [b])], e); + var $ = getTypeOfDomTree(h, "right") || "mord"; + return buildCommon.makeSpan([$], [h, buildCommon.makeSpan(["msupsub"], [b])], e); }, mathmlBuilder(n, e) { var t = !1, r, a; @@ -12406,17 +12422,17 @@ class _Tokenizer { let M = !1; if (!y && /^ *$/.test(A) && (o += A + ` `, e = e.substring(A.length + 1), f = !0), !f) { - const u = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), g = new RegExp(`^ {0,${Math.min(3, x - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), p = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:\`\`\`|~~~)`), b = new RegExp(`^ {0,${Math.min(3, x - 1)}}#`); + const u = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), p = new RegExp(`^ {0,${Math.min(3, x - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), g = new RegExp(`^ {0,${Math.min(3, x - 1)}}(?:\`\`\`|~~~)`), b = new RegExp(`^ {0,${Math.min(3, x - 1)}}#`); for (; e; ) { const c = e.split(` `, 1)[0]; - if (A = c, this.options.pedantic && (A = A.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), p.test(A) || b.test(A) || u.test(A) || g.test(e)) + if (A = c, this.options.pedantic && (A = A.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), g.test(A) || b.test(A) || u.test(A) || p.test(e)) break; if (A.search(/[^ ]/) >= x || !A.trim()) d += ` ` + A.slice(x); else { - if (M || y.search(/[^ ]/) >= 4 || p.test(y) || b.test(y) || g.test(y)) + if (M || y.search(/[^ ]/) >= 4 || g.test(y) || b.test(y) || p.test(y)) break; d += ` ` + A; @@ -13770,8 +13786,8 @@ var prism = { exports: {} }; * @memberof Prism */ util: { - encode: function g(p) { - return p instanceof d ? new d(p.type, g(p.content), p.alias) : Array.isArray(p) ? p.map(g) : p.replace(/&/g, "&").replace(/} */ {}, b[_] = c; - for (var E in p) - p.hasOwnProperty(E) && (c[E] = g(p[E], b)); + for (var E in g) + g.hasOwnProperty(E) && (c[E] = p(g[E], b)); return ( /** @type {any} */ c ); case "Array": - return _ = o.util.objId(p), b[_] ? b[_] : (c = [], b[_] = c, /** @type {Array} */ + return _ = o.util.objId(g), b[_] ? b[_] : (c = [], b[_] = c, /** @type {Array} */ /** @type {any} */ - p.forEach(function(w, k) { - c[k] = g(w, b); + g.forEach(function(w, k) { + c[k] = p(w, b); }), /** @type {any} */ c); default: - return p; + return g; } }, /** @@ -13845,12 +13861,12 @@ var prism = { exports: {} }; * @param {Element} element * @returns {string} */ - getLanguage: function(g) { - for (; g; ) { - var p = a.exec(g.className); - if (p) - return p[1].toLowerCase(); - g = g.parentElement; + getLanguage: function(p) { + for (; p; ) { + var g = a.exec(p.className); + if (g) + return g[1].toLowerCase(); + p = p.parentElement; } return "none"; }, @@ -13861,8 +13877,8 @@ var prism = { exports: {} }; * @param {string} language * @returns {void} */ - setLanguage: function(g, p) { - g.className = g.className.replace(RegExp(a, "gi"), ""), g.classList.add("language-" + p); + setLanguage: function(p, g) { + p.className = p.className.replace(RegExp(a, "gi"), ""), p.classList.add("language-" + g); }, /** * Returns the script element that is currently executing. @@ -13882,12 +13898,12 @@ var prism = { exports: {} }; try { throw new Error(); } catch (c) { - var g = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(c.stack) || [])[1]; - if (g) { - var p = document.getElementsByTagName("script"); - for (var b in p) - if (p[b].src == g) - return p[b]; + var p = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(c.stack) || [])[1]; + if (p) { + var g = document.getElementsByTagName("script"); + for (var b in g) + if (g[b].src == p) + return g[b]; } return null; } @@ -13911,14 +13927,14 @@ var prism = { exports: {} }; * @param {boolean} [defaultActivation=false] * @returns {boolean} */ - isActive: function(g, p, b) { - for (var c = "no-" + p; g; ) { - var _ = g.classList; - if (_.contains(p)) + isActive: function(p, g, b) { + for (var c = "no-" + g; p; ) { + var _ = p.classList; + if (_.contains(g)) return !0; if (_.contains(c)) return !1; - g = g.parentElement; + p = p.parentElement; } return !!b; } @@ -13966,10 +13982,10 @@ var prism = { exports: {} }; * 'color': /\b(?:red|green|blue)\b/ * }); */ - extend: function(g, p) { - var b = o.util.clone(o.languages[g]); - for (var c in p) - b[c] = p[c]; + extend: function(p, g) { + var b = o.util.clone(o.languages[p]); + for (var c in g) + b[c] = g[c]; return b; }, /** @@ -14047,31 +14063,31 @@ var prism = { exports: {} }; * @returns {Grammar} The new grammar object. * @public */ - insertBefore: function(g, p, b, c) { + insertBefore: function(p, g, b, c) { c = c || /** @type {any} */ o.languages; - var _ = c[g], E = {}; + var _ = c[p], E = {}; for (var w in _) if (_.hasOwnProperty(w)) { - if (w == p) + if (w == g) for (var k in b) b.hasOwnProperty(k) && (E[k] = b[k]); b.hasOwnProperty(w) || (E[w] = _[w]); } - var L = c[g]; - return c[g] = E, o.languages.DFS(o.languages, function($, z) { - z === L && $ != g && (this[$] = E); + var $ = c[p]; + return c[p] = E, o.languages.DFS(o.languages, function(L, z) { + z === $ && L != p && (this[L] = E); }), E; }, // Traverse a language definition with Depth First Search - DFS: function g(p, b, c, _) { + DFS: function p(g, b, c, _) { _ = _ || {}; var E = o.util.objId; - for (var w in p) - if (p.hasOwnProperty(w)) { - b.call(p, w, p[w], c || w); - var k = p[w], L = o.util.type(k); - L === "Object" && !_[E(k)] ? (_[E(k)] = !0, g(k, b, null, _)) : L === "Array" && !_[E(k)] && (_[E(k)] = !0, g(k, b, w, _)); + 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, _)); } } }, @@ -14088,8 +14104,8 @@ var prism = { exports: {} }; * @memberof Prism * @public */ - highlightAll: function(g, p) { - o.highlightAllUnder(document, g, p); + highlightAll: function(p, g) { + o.highlightAllUnder(document, p, g); }, /** * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls @@ -14106,15 +14122,15 @@ var prism = { exports: {} }; * @memberof Prism * @public */ - highlightAllUnder: function(g, p, b) { + highlightAllUnder: function(p, g, b) { var c = { callback: b, - container: g, + container: p, 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[_++]; ) - o.highlightElement(E, p === !0, c.callback); + o.highlightElement(E, g === !0, c.callback); }, /** * Highlights the code inside a single element. @@ -14144,18 +14160,18 @@ var prism = { exports: {} }; * @memberof Prism * @public */ - highlightElement: function(g, p, b) { - var c = o.util.getLanguage(g), _ = o.languages[c]; - o.util.setLanguage(g, c); - var E = g.parentElement; + highlightElement: function(p, g, b) { + var c = o.util.getLanguage(p), _ = o.languages[c]; + o.util.setLanguage(p, c); + var E = p.parentElement; E && E.nodeName.toLowerCase() === "pre" && o.util.setLanguage(E, c); - var w = g.textContent, k = { - element: g, + var w = p.textContent, k = { + element: p, language: c, grammar: _, code: w }; - function L(z) { + 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); } 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) { @@ -14163,20 +14179,20 @@ var prism = { exports: {} }; return; } if (o.hooks.run("before-highlight", k), !k.grammar) { - L(o.util.encode(k.code)); + $(o.util.encode(k.code)); return; } - if (p && r.Worker) { - var $ = new Worker(o.filename); - $.onmessage = function(z) { - L(z.data); - }, $.postMessage(JSON.stringify({ + if (g && r.Worker) { + var L = new Worker(o.filename); + L.onmessage = function(z) { + $(z.data); + }, L.postMessage(JSON.stringify({ language: k.language, code: k.code, immediateClose: !0 })); } else - L(o.highlight(k.code, k.grammar, k.language)); + $(o.highlight(k.code, k.grammar, k.language)); }, /** * Low-level function, only use if you know what you’re doing. It accepts a string of text as input @@ -14198,10 +14214,10 @@ var prism = { exports: {} }; * @example * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript'); */ - highlight: function(g, p, b) { + highlight: function(p, g, b) { var c = { - code: g, - grammar: p, + code: p, + grammar: g, language: b }; if (o.hooks.run("before-tokenize", c), !c.grammar) @@ -14232,15 +14248,15 @@ var prism = { exports: {} }; * } * }); */ - tokenize: function(g, p) { - var b = p.rest; + tokenize: function(p, g) { + var b = g.rest; if (b) { for (var c in b) - p[c] = b[c]; - delete p.rest; + g[c] = b[c]; + delete g.rest; } var _ = new y(); - return A(_, _.head, g), f(g, _, p, _.head, 0), M(_); + return A(_, _.head, p), f(p, _, g, _.head, 0), M(_); }, /** * @namespace @@ -14261,9 +14277,9 @@ var prism = { exports: {} }; * @param {HookCallback} callback The callback function which is given environment variables. * @public */ - add: function(g, p) { + add: function(p, g) { var b = o.hooks.all; - b[g] = b[g] || [], b[g].push(p); + b[p] = b[p] || [], b[p].push(g); }, /** * Runs a hook invoking all registered callbacks with the given environment variables. @@ -14274,94 +14290,94 @@ var prism = { exports: {} }; * @param {Object} env The environment variables of the hook passed to all callbacks registered. * @public */ - run: function(g, p) { - var b = o.hooks.all[g]; + run: function(p, g) { + var b = o.hooks.all[p]; if (!(!b || !b.length)) for (var c = 0, _; _ = b[c++]; ) - _(p); + _(g); } }, Token: d }; r.Prism = o; - function d(g, p, b, c) { - this.type = g, this.content = p, this.alias = b, this.length = (c || "").length | 0; + function d(p, g, b, c) { + this.type = p, this.content = g, this.alias = b, this.length = (c || "").length | 0; } - d.stringify = function g(p, b) { - if (typeof p == "string") - return p; - if (Array.isArray(p)) { + d.stringify = function p(g, b) { + if (typeof g == "string") + return g; + if (Array.isArray(g)) { var c = ""; - return p.forEach(function(L) { - c += g(L, b); + return g.forEach(function($) { + c += p($, b); }), c; } var _ = { - type: p.type, - content: g(p.content, b), + type: g.type, + content: p(g.content, b), tag: "span", - classes: ["token", p.type], + classes: ["token", g.type], attributes: {}, language: b - }, E = p.alias; + }, E = g.alias; E && (Array.isArray(E) ? Array.prototype.push.apply(_.classes, E) : _.classes.push(E)), o.hooks.run("wrap", _); var w = ""; for (var k in _.attributes) w += " " + k + '="' + (_.attributes[k] || "").replace(/"/g, """) + '"'; return "<" + _.tag + ' class="' + _.classes.join(" ") + '"' + w + ">" + _.content + ""; }; - function v(g, p, b, c) { - g.lastIndex = p; - var _ = g.exec(b); + function v(p, g, b, c) { + p.lastIndex = g; + var _ = p.exec(b); if (_ && c && _[1]) { var E = _[1].length; _.index += E, _[0] = _[0].slice(E); } return _; } - function f(g, p, b, c, _, E) { + function f(p, g, b, c, _, E) { for (var w in b) if (!(!b.hasOwnProperty(w) || !b[w])) { var k = b[w]; k = Array.isArray(k) ? k : [k]; - for (var L = 0; L < k.length; ++L) { - if (E && E.cause == w + "," + L) + for (var $ = 0; $ < k.length; ++$) { + if (E && E.cause == w + "," + $) return; - var $ = k[L], z = $.inside, O = !!$.lookbehind, R = !!$.greedy, P = $.alias; - if (R && !$.pattern.global) { - var U = $.pattern.toString().match(/[imsuy]*$/)[0]; - $.pattern = RegExp($.pattern.source, U + "g"); + 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"); } - for (var N = $.pattern || $, B = c.next, W = _; B !== p.tail && !(E && W >= E.reach); W += B.value.length, B = B.next) { + 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; - if (p.length > g.length) + if (g.length > p.length) return; if (!(V instanceof d)) { var G = 1, H; if (R) { - if (H = v(N, W, g, O), !H || H.index >= g.length) + if (H = v(N, W, p, F), !H || H.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) continue; - for (var ee = B; ee !== p.tail && (te < Q || typeof ee.value == "string"); ee = ee.next) + for (var ee = B; ee !== g.tail && (te < Q || typeof ee.value == "string"); ee = ee.next) G++, te += ee.value.length; - G--, V = g.slice(W, te), H.index -= W; - } else if (H = v(N, 0, V, O), !H) + G--, V = p.slice(W, te), H.index -= W; + } else if (H = v(N, 0, V, F), !H) 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(p, Se, oe), W += oe.length), x(p, Se, G); + 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(p, Se, Ie), he && A(p, B, he), G > 1) { + if (B = A(g, Se, Ie), he && A(g, B, he), G > 1) { var pe = { - cause: w + "," + L, + cause: w + "," + $, reach: Ae }; - f(g, p, b, B.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach); + f(p, g, b, B.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach); } } } @@ -14369,26 +14385,26 @@ var prism = { exports: {} }; } } function y() { - var g = { value: null, prev: null, next: null }, p = { value: null, prev: g, next: null }; - g.next = p, this.head = g, this.tail = p, this.length = 0; + var p = { value: null, prev: null, next: null }, g = { value: null, prev: p, next: null }; + p.next = g, this.head = p, this.tail = g, this.length = 0; } - function A(g, p, b) { - var c = p.next, _ = { value: b, prev: p, next: c }; - return p.next = _, c.prev = _, g.length++, _; + function A(p, g, b) { + var c = g.next, _ = { value: b, prev: g, next: c }; + return g.next = _, c.prev = _, p.length++, _; } - function x(g, p, b) { - for (var c = p.next, _ = 0; _ < b && c !== g.tail; _++) + function x(p, g, b) { + for (var c = g.next, _ = 0; _ < b && c !== p.tail; _++) c = c.next; - p.next = c, c.prev = p, g.length -= _; + g.next = c, c.prev = g, p.length -= _; } - function M(g) { - for (var p = [], b = g.head.next; b !== g.tail; ) - p.push(b.value), b = b.next; - return p; + function M(p) { + for (var g = [], b = p.head.next; b !== p.tail; ) + g.push(b.value), b = b.next; + return g; } if (!r.document) - return r.addEventListener && (o.disableWorkerMessageHandler || r.addEventListener("message", function(g) { - var p = JSON.parse(g.data), b = p.language, c = p.code, _ = p.immediateClose; + 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(); }, !1)), o; var m = o.util.currentScript(); @@ -14794,16 +14810,16 @@ var prism = { exports: {} }; tex: "latex" }, o = "data-src-status", d = "loading", v = "loaded", f = "failed", y = "pre[data-src]:not([" + o + '="' + v + '"]):not([' + o + '="' + d + '"])'; function A(m, l, u) { - var g = new XMLHttpRequest(); - g.open("GET", m, !0), g.onreadystatechange = function() { - g.readyState == 4 && (g.status < 400 && g.responseText ? l(g.responseText) : g.status >= 400 ? u(a(g.status, g.statusText)) : u(s)); - }, g.send(null); + var p = new XMLHttpRequest(); + p.open("GET", m, !0), p.onreadystatechange = function() { + p.readyState == 4 && (p.status < 400 && p.responseText ? l(p.responseText) : p.status >= 400 ? u(a(p.status, p.statusText)) : u(s)); + }, p.send(null); } function x(m) { var l = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m || ""); if (l) { - var u = Number(l[1]), g = l[2], p = l[3]; - return g ? p ? [u, Number(p)] : [u, void 0] : [u, u]; + var u = Number(l[1]), p = l[2], g = l[3]; + return p ? g ? [u, Number(g)] : [u, void 0] : [u, u]; } } t.hooks.add("before-highlightall", function(m) { @@ -14817,21 +14833,21 @@ var prism = { exports: {} }; m.code = "", l.setAttribute(o, d); var u = l.appendChild(document.createElement("CODE")); u.textContent = r; - var g = l.getAttribute("data-src"), p = m.language; - if (p === "none") { - var b = (/\.(\w+)$/.exec(g) || [, "none"])[1]; - p = h[b] || b; + var p = l.getAttribute("data-src"), g = m.language; + if (g === "none") { + var b = (/\.(\w+)$/.exec(p) || [, "none"])[1]; + g = h[b] || b; } - t.util.setLanguage(u, p), t.util.setLanguage(l, p); + t.util.setLanguage(u, g), t.util.setLanguage(l, g); var c = t.plugins.autoloader; - c && c.loadLanguages(p), A( - g, + c && c.loadLanguages(g), A( + p, function(_) { l.setAttribute(o, v); var E = x(l.getAttribute("data-range")); if (E) { - var w = _.split(/\r\n?|\n/g), k = E[0], L = E[1] == null ? w.length : E[1]; - k < 0 && (k += w.length), k = Math.max(0, Math.min(k - 1, w.length)), L < 0 && (L += w.length), L = Math.max(0, Math.min(L, w.length)), _ = w.slice(k, L).join(` + 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(` `), l.hasAttribute("data-start") || l.setAttribute("data-start", String(k + 1)); } u.textContent = _, t.highlightElement(u); @@ -14850,8 +14866,8 @@ var prism = { exports: {} }; * @param {ParentNode} [container=document] */ highlight: function(l) { - for (var u = (l || document).querySelectorAll(y), g = 0, p; p = u[g++]; ) - t.highlightElement(p); + for (var u = (l || document).querySelectorAll(y), p = 0, g; g = u[p++]; ) + t.highlightElement(g); } }; var M = !1; @@ -16113,20 +16129,20 @@ class Amuchina { _Amuchina_configuration.set(this, void 0), _Amuchina_allowElements.set(this, void 0), _Amuchina_allowAttributes.set(this, void 0), this.getConfiguration = () => cloneDeep(__classPrivateFieldGet(this, _Amuchina_configuration, "f")), this.sanitize = (f) => { const y = __classPrivateFieldGet(this, _Amuchina_allowElements, "f"), A = __classPrivateFieldGet(this, _Amuchina_allowAttributes, "f"); return traverseElements(f, (x, M) => { - const m = x.namespaceURI || NAMESPACES.HTML, l = M.namespaceURI || NAMESPACES.HTML, u = NAMESPACES_ELEMENTS[m], g = NAMESPACES_ROOTS[m], p = NAMESPACES_PREFIXES[m], b = x.tagName.toLowerCase(), c = `${p}${b}`, E = `${p}*`; - if (!u.has(b) || !y.has(c) || m !== l && b !== g) + const m = x.namespaceURI || NAMESPACES.HTML, l = M.namespaceURI || NAMESPACES.HTML, u = NAMESPACES_ELEMENTS[m], p = NAMESPACES_ROOTS[m], g = NAMESPACES_PREFIXES[m], b = x.tagName.toLowerCase(), c = `${g}${b}`, E = `${g}*`; + if (!u.has(b) || !y.has(c) || m !== l && b !== p) M.removeChild(x); else { const w = x.getAttributeNames(), k = w.length; if (k) { - for (let L = 0; L < k; L++) { - const $ = w[L], z = A[$]; - (!z || !z.has(E) && !z.has(c)) && x.removeAttribute($); + for (let $ = 0; $ < k; $++) { + const L = w[$], z = A[L]; + (!z || !z.has(E) && !z.has(c)) && x.removeAttribute(L); } if (isElementFunky(x)) if (isElementHyperlink(x)) { - const L = x.getAttribute("href"); - L && isScriptOrDataUrlLoose(L) && isScriptOrDataUrl(x.protocol) && x.removeAttribute("href"); + const $ = x.getAttribute("href"); + $ && isScriptOrDataUrlLoose($) && isScriptOrDataUrl(x.protocol) && x.removeAttribute("href"); } else isElementAction(x) ? isScriptOrDataUrl(x.action) && x.removeAttribute("action") : isElementFormAction(x) ? isScriptOrDataUrl(x.formAction) && x.removeAttribute("formaction") : isElementIframe(x) && (isScriptOrDataUrl(x.src) && x.removeAttribute("formaction"), x.setAttribute("sandbox", "allow-scripts")); } } @@ -16257,18 +16273,18 @@ function instance$e(n, e, t) { latex_delimiters: h }); function M(u) { - let g = u; + let p = u; if (o) { - const p = []; + const g = []; h.forEach((b, c) => { const _ = escapeRegExp(b.left), E = escapeRegExp(b.right), w = new RegExp(`${_}([\\s\\S]+?)${E}`, "g"); - g = g.replace(w, (k, L) => (p.push(k), `%%%LATEX_BLOCK_${p.length - 1}%%%`)); - }), g = x.parse(g), g = g.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (b, c) => p[parseInt(c, 10)]); + 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)]); } - return s && sanitize && (g = sanitize(g, f)), g; + return s && sanitize && (p = sanitize(p, f)), p; } async function m(u) { - h.length > 0 && u && h.some((p) => u.includes(p.left) && u.includes(p.right)) && renderMathInElement(y, { + h.length > 0 && u && h.some((g) => u.includes(g.left) && u.includes(g.right)) && renderMathInElement(y, { delimiters: h, throwOnError: !1 }); @@ -16397,13 +16413,13 @@ const { children: children$d, claim_component: claim_component$6, claim_element: claim_element$b, - claim_space: claim_space$a, + claim_space: claim_space$b, create_component: create_component$6, create_slot: create_slot$2, destroy_component: destroy_component$6, detach: detach$f, element: element$b, - empty: empty$4, + empty: empty$5, get_all_dirty_from_scope: get_all_dirty_from_scope$2, get_slot_changes: get_slot_changes$2, group_outros: group_outros$6, @@ -16411,13 +16427,13 @@ const { insert_hydration: insert_hydration$f, mount_component: mount_component$6, safe_not_equal: safe_not_equal$g, - space: space$a, + space: space$b, toggle_class: toggle_class$7, transition_in: transition_in$6, transition_out: transition_out$6, update_slot_base: update_slot_base$2 } = window.__gradio__svelte__internal; -function create_if_block$8(n) { +function create_if_block$9(n) { let e, t; return e = new Info({ props: { @@ -16473,16 +16489,16 @@ function create_fragment$f(n) { ); let o = ( /*info*/ - n[1] && create_if_block$8(n) + n[1] && create_if_block$9(n) ); return { c() { - e = element$b("span"), h && h.c(), t = space$a(), o && o.c(), r = empty$4(), this.h(); + e = element$b("span"), h && h.c(), t = space$b(), o && o.c(), r = empty$5(), this.h(); }, 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$a(d), o && o.l(d), r = empty$4(), this.h(); + h && h.l(v), v.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*/ @@ -16528,7 +16544,7 @@ function create_fragment$f(n) { d[1] != null ), /*info*/ d[1] ? o ? (o.p(d, v), v & /*info*/ - 2 && transition_in$6(o, 1)) : (o = create_if_block$8(d), o.c(), transition_in$6(o, 1), o.m(r.parentNode, r)) : o && (group_outros$6(), transition_out$6(o, 1, 1, () => { + 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()); }, @@ -16563,7 +16579,7 @@ const { children: children$c, claim_component: claim_component$5, claim_element: claim_element$a, - claim_space: claim_space$9, + claim_space: claim_space$a, claim_text: claim_text$8, construct_svelte_component, create_component: create_component$5, @@ -16581,14 +16597,14 @@ const { safe_not_equal: safe_not_equal$f, set_data: set_data$6, set_style: set_style$4, - space: space$9, + space: space$a, text: text$9, toggle_class: toggle_class$6, transition_in: transition_in$5, transition_out: transition_out$5, update_slot_base: update_slot_base$1 } = window.__gradio__svelte__internal; -function create_if_block$7(n) { +function create_if_block$8(n) { let e, t; return { c() { @@ -16628,7 +16644,7 @@ function create_if_block$7(n) { function create_fragment$e(n) { let e, t, r, a, s, h, o, d, v = ( /*show_label*/ - n[2] && create_if_block$7(n) + n[2] && create_if_block$8(n) ); var f = ( /*Icon*/ @@ -16650,7 +16666,7 @@ function create_fragment$e(n) { ); return { c() { - e = element$a("button"), v && v.c(), t = space$9(), r = element$a("div"), a && create_component$5(a.$$.fragment), s = space$9(), x && x.c(), this.h(); + 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(); }, l(M) { e = claim_element$a(M, "BUTTON", { @@ -16660,9 +16676,9 @@ function create_fragment$e(n) { class: !0 }); var m = children$c(e); - v && v.l(m), t = claim_space$9(m), r = claim_element$a(m, "DIV", { class: !0 }); + v && v.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$9(l), x && x.l(l), l.forEach(detach$e), m.forEach(detach$e), this.h(); + 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( @@ -16737,7 +16753,7 @@ function create_fragment$e(n) { }, p(M, [m]) { if (/*show_label*/ - M[2] ? v ? v.p(M, m) : (v = create_if_block$7(M), v.c(), v.m(e, t)) : v && (v.d(1), v = null), m & /*Icon*/ + 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*/ 1 && f !== (f = /*Icon*/ M[0])) { if (a) { @@ -16855,11 +16871,11 @@ function create_fragment$e(n) { } 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; - function g(p) { - bubble$1.call(this, n, p); + function p(g) { + bubble$1.call(this, n, g); } - return n.$$set = (p) => { - "Icon" in p && t(0, h = p.Icon), "label" in p && t(1, o = p.label), "show_label" in p && t(2, d = p.show_label), "pending" in p && t(3, v = p.pending), "size" in p && t(4, f = p.size), "padded" in p && t(5, y = p.padded), "highlight" in p && t(6, A = p.highlight), "disabled" in p && t(7, x = p.disabled), "hasPopup" in p && t(8, M = p.hasPopup), "color" in p && t(12, m = p.color), "transparent" in p && t(9, l = p.transparent), "background" in p && t(10, u = p.background), "$$scope" in p && t(13, s = p.$$scope); + 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); }, n.$$.update = () => { n.$$.dirty & /*highlight, color*/ 4160 && t(11, r = A ? "var(--color-accent)" : m); @@ -16879,7 +16895,7 @@ function instance$b(n, e, t) { m, s, a, - g + p ]; } class IconButton extends SvelteComponent$e { @@ -17380,26 +17396,26 @@ const { attr: attr$9, children: children$8, claim_element: claim_element$9, - claim_space: claim_space$8, + claim_space: claim_space$9, detach: detach$a, element: element$9, - get_svelte_dataset: get_svelte_dataset$4, + get_svelte_dataset: get_svelte_dataset$5, init: init$a, insert_hydration: insert_hydration$a, listen: listen$4, noop: noop$a, run_all: run_all$4, safe_not_equal: safe_not_equal$b, - space: space$8 + space: space$9 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$6 } = window.__gradio__svelte__internal; -function create_if_block$6(n) { +function create_if_block$7(n) { 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$4(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-1ffedkh" && (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"); @@ -17421,18 +17437,18 @@ function create_if_block$6(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 = ( /*displayCovMod*/ - n[0] && create_if_block$6(n) + 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$8(), h = element$9("button"), h.innerHTML = o, d = space$8(), v = element$9("button"), v.innerHTML = f, y = space$8(), 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(), v = element$9("button"), v.innerHTML = f, y = space$9(), M && M.c(), this.h(); }, l(m) { e = claim_element$9(m, "DIV", { class: !0 }); 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$4(r) !== "svelte-1qxi4yp" && (r.innerHTML = a), s = claim_space$8(u), h = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$4(h) !== "svelte-z7tz1a" && (h.innerHTML = o), d = claim_space$8(u), v = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$4(v) !== "svelte-3ixhlr" && (v.innerHTML = f), y = claim_space$8(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-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(); }, 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"); @@ -17461,7 +17477,7 @@ function create_fragment$a(n) { }, p(m, [l]) { /*displayCovMod*/ - m[0] ? M ? M.p(m, l) : (M = create_if_block$6(m), M.c(), M.m(t, null)) : M && (M.d(1), M = null); + m[0] ? M ? M.p(m, l) : (M = create_if_block$7(m), M.c(), M.m(t, null)) : M && (M.d(1), M = null); }, i: noop$a, o: noop$a, @@ -17516,11 +17532,11 @@ const { attr: attr$8, children: children$7, claim_element: claim_element$8, - claim_space: claim_space$7, + claim_space: claim_space$8, claim_text: claim_text$7, detach: detach$9, element: element$8, - get_svelte_dataset: get_svelte_dataset$3, + get_svelte_dataset: get_svelte_dataset$4, init: init$9, insert_hydration: insert_hydration$9, listen: listen$3, @@ -17528,7 +17544,7 @@ const { prevent_default, run_all: run_all$3, safe_not_equal: safe_not_equal$a, - space: space$7, + space: space$8, text: text$8 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$5 } = window.__gradio__svelte__internal; function create_fragment$9(n) { @@ -17538,10 +17554,10 @@ function create_fragment$9(n) { /*currentSel*/ n[3] ] + "" - ), d, v, f, y = '', A, x, M, m, l, u = ' Search', g, p; + ), d, v, 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$7(), h = element$8("button"), d = text$8(o), v = space$7(), f = element$8("div"), f.innerHTML = y, A = space$7(), x = element$8("div"), M = element$8("input"), m = space$7(), 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), 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(); }, l(b) { e = claim_element$8(b, "FORM", { class: !0 }); @@ -17552,29 +17568,29 @@ function create_fragment$9(n) { for: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$7(_), h = claim_element$8(_, "BUTTON", { + }), get_svelte_dataset$4(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$8(_), h = claim_element$8(_, "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$7(_), f = claim_element$8(_, "DIV", { + d = claim_text$7(E, o), E.forEach(detach$9), v = claim_space$8(_), f = claim_element$8(_, "DIV", { id: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$7(_), x = claim_element$8(_, "DIV", { class: !0 }); + }), get_svelte_dataset$4(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$8(_), x = claim_element$8(_, "DIV", { class: !0 }); var w = children$7(x); M = claim_element$8(w, "INPUT", { type: !0, id: !0, class: !0, placeholder: !0 - }), m = claim_space$7(w), l = claim_element$8(w, "BUTTON", { + }), m = claim_space$8(w), l = claim_element$8(w, "BUTTON", { type: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$3(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), _.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( @@ -17588,7 +17604,7 @@ function create_fragment$9(n) { ), 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"); }, 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), g || (p = [ + 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 = [ listen$3( M, "input", @@ -17599,13 +17615,13 @@ function create_fragment$9(n) { /*triggerFetch*/ n[4] )) - ], g = !0); + ], p = !0); }, p: noop$9, i: noop$9, o: noop$9, d(b) { - b && detach$9(e), g = !1, run_all$3(p); + b && detach$9(e), p = !1, run_all$3(g); } }; } @@ -17652,21 +17668,21 @@ const { attr: attr$7, children: children$6, claim_element: claim_element$7, - claim_space: claim_space$6, + claim_space: claim_space$7, claim_text: claim_text$6, - destroy_each: destroy_each$2, + destroy_each: destroy_each$3, detach: detach$8, element: element$7, - ensure_array_like: ensure_array_like$2, + ensure_array_like: ensure_array_like$3, init: init$8, insert_hydration: insert_hydration$8, noop: noop$8, safe_not_equal: safe_not_equal$9, set_style: set_style$2, - space: space$6, + space: space$7, text: text$7 } = window.__gradio__svelte__internal; -function get_each_context$2(n, e, t) { +function get_each_context$3(n, e, t) { const r = n.slice(); return r[3] = e[t], r[5] = t, r; } @@ -17709,8 +17725,8 @@ function create_each_block_1$2(n) { } }; } -function create_each_block$2(n) { - let e, t, r = ensure_array_like$2( +function create_each_block$3(n) { + let e, t, r = ensure_array_like$3( /*chunk*/ n[3] ), a = []; @@ -17721,14 +17737,14 @@ function create_each_block$2(n) { e = element$7("div"); for (let s = 0; s < a.length; s += 1) a[s].c(); - t = space$6(), this.h(); + t = space$7(), this.h(); }, l(s) { e = claim_element$7(s, "DIV", { class: !0 }); var h = children$6(e); for (let o = 0; o < a.length; o += 1) a[o].l(h); - t = claim_space$6(h), h.forEach(detach$8), this.h(); + t = claim_space$7(h), h.forEach(detach$8), this.h(); }, h() { attr$7(e, "class", "sequence__chunk svelte-hhspdt"); @@ -17742,7 +17758,7 @@ function create_each_block$2(n) { p(s, h) { if (h & /*chunk_ids, chunked_seq*/ 3) { - r = ensure_array_like$2( + r = ensure_array_like$3( /*chunk*/ s[3] ); @@ -17757,17 +17773,17 @@ function create_each_block$2(n) { } }, d(s) { - s && detach$8(e), destroy_each$2(a, s); + s && detach$8(e), destroy_each$3(a, s); } }; } function create_fragment$8(n) { - let e, t = ensure_array_like$2( + let e, t = ensure_array_like$3( /*chunked_seq*/ n[0] ), r = []; for (let a = 0; a < t.length; a += 1) - r[a] = create_each_block$2(get_each_context$2(n, t, a)); + r[a] = create_each_block$3(get_each_context$3(n, t, a)); return { c() { e = element$7("div"); @@ -17793,14 +17809,14 @@ function create_fragment$8(n) { p(a, [s]) { if (s & /*chunked_seq, chunk_ids*/ 3) { - t = ensure_array_like$2( + t = ensure_array_like$3( /*chunked_seq*/ a[0] ); let h; for (h = 0; h < t.length; h += 1) { - const o = get_each_context$2(a, t, h); - r[h] ? r[h].p(o, s) : (r[h] = create_each_block$2(o), r[h].c(), r[h].m(e, null)); + const o = get_each_context$3(a, t, h); + r[h] ? r[h].p(o, s) : (r[h] = create_each_block$3(o), r[h].c(), r[h].m(e, null)); } for (; h < r.length; h += 1) r[h].d(1); @@ -17810,7 +17826,7 @@ function create_fragment$8(n) { i: noop$8, o: noop$8, d(a) { - a && detach$8(e), destroy_each$2(r, a); + a && detach$8(e), destroy_each$3(r, a); } }; } @@ -17825,7 +17841,7 @@ class Sequence extends SvelteComponent$8 { super(), init$8(this, e, instance$8, create_fragment$8, safe_not_equal$9, { seq: 2 }); } } -var _3Dmol = { exports: {} }; +var _3Dmol$1 = { exports: {} }; /*! * 3dmol v2.4.0 * JavaScript/TypeScript molecular visualization library @@ -18458,31 +18474,31 @@ var _3Dmol = { exports: {} }; function f(M, m) { const l = { version: m }, u = { length: M.readUint32() - }, g = y(M); - Array.isArray(g) || (u.id = g.recordId, u.name = g.recordName, l.dimensions = g.dimensions), l.globalAttributes = A(M); - const p = x(M, u?.id, m); - return Array.isArray(p) || (l.variables = p.variables, u.recordStep = p.recordStep), l.recordDimension = u, l; + }, 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); + return Array.isArray(g) || (l.variables = g.variables, u.recordStep = g.recordStep), l.recordDimension = u, l; } function y(M) { const m = {}; let l, u; - const g = M.readUint32(); - let p; - if (g === s) + const p = M.readUint32(); + let g; + if (p === s) return (0, a.notNetcdf)(M.readUint32() !== s, "wrong empty tag for list of dimensions"), []; { - (0, a.notNetcdf)(g !== h, "wrong tag for list of dimensions"); + (0, a.notNetcdf)(p !== h, "wrong tag for list of dimensions"); const b = M.readUint32(); - p = new Array(b); + g = new Array(b); for (let c = 0; c < b; c++) { const _ = (0, a.readName)(M), E = M.readUint32(); - E === v && (l = c, u = _), p[c] = { + E === v && (l = c, u = _), g[c] = { name: _, size: E }; } } - return l !== void 0 && (m.recordId = l), u !== void 0 && (m.recordName = u), m.dimensions = p, m; + return l !== void 0 && (m.recordId = l), u !== void 0 && (m.recordName = u), m.dimensions = g, m; } function A(M) { const m = M.readUint32(); @@ -18493,12 +18509,12 @@ var _3Dmol = { exports: {} }; (0, a.notNetcdf)(m !== d, "wrong tag for list of attributes"); const u = M.readUint32(); l = new Array(u); - for (let g = 0; g < u; g++) { - const p = (0, a.readName)(M), b = M.readUint32(); + 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); - (0, a.padding)(M), l[g] = { - name: p, + (0, a.padding)(M), l[p] = { + name: g, type: (0, r.num2str)(b), value: _ }; @@ -18508,37 +18524,37 @@ var _3Dmol = { exports: {} }; } function x(M, m, l) { const u = M.readUint32(); - let g = 0, p; + let p = 0, g; if (u === s) return (0, a.notNetcdf)(M.readUint32() !== s, "wrong empty tag for list of variables"), []; { (0, a.notNetcdf)(u !== o, "wrong tag for list of variables"); const b = M.readUint32(); - p = new Array(b); + 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 k = A(M), L = M.readUint32(); - (0, a.notNetcdf)(L < 1 && L > 6, `non valid type ${L}`); - const $ = 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 O = !1; - typeof m < "u" && w[0] === m && (g += $, O = !0), p[c] = { + let F = !1; + typeof m < "u" && w[0] === m && (p += L, F = !0), g[c] = { name: _, dimensions: w, attributes: k, - type: (0, r.num2str)(L), - size: $, + type: (0, r.num2str)($), + size: L, offset: z, - record: O + record: F }; } } return { - variables: p, - recordStep: g + variables: g, + recordStep: p }; } } @@ -20564,44 +20580,44 @@ void main() { var s; (function(h) { function o(m, l, u) { - var g = Math.hypot(m, l), p, b, c, _, E; - g < 1e-4 ? (b = 0, c = 1) : (b = -m / g, c = l / g), l = -b * m + c * l, p = Math.hypot(l, u), p < 1e-4 ? (_ = 0, E = 1) : (_ = u / p, E = l / p); + 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 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; } class d { constructor() { this.cache = {}; - let l = [], u = 4, g = Math.pow(2, u), p = 2, b = Math.pow(2, p), c = g / b, _; - 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), p = 3; p <= u; p++) { - for (b = Math.pow(2, p - 1), c = g / b, _ = 0; _ < b - 1; _++) + let l = [], u = 4, p = Math.pow(2, u), g = 2, b = Math.pow(2, g), c = p / b, _; + 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(); } this.basisVectors = l; } - getVerticesForRadius(l, u, g) { - if (typeof this.cache < "u" && this.cache[l] !== void 0 && this.cache[l][u + g] !== void 0) - return this.cache[l][u + g]; - for (var p = this.basisVectors.length, b = [], c = [], _, E = 0; E < p; E++) + 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, L = p, $ = 0, z = Math.PI * 2, O = 0, R = Math.PI, P, U, N = !1, B = !1; + 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 <= L; P++) { + for (P = 0; P <= $; P++) { if (B) { - var G = P < L ? 2 * P : 0; + var G = P < $ ? 2 * P : 0; V.push(G + 1), W.push(G); continue; } - var H = P / L, Q = U / k; + var H = P / $, Q = U / k; if (!N || P === 0) - if (P < L) { + if (P < $) { var te = new r.Vector3(); - te.x = -l * Math.cos($ + H * z) * Math.sin(O + Q * R), u == 1 ? te.y = 0 : te.y = l * Math.cos(O + Q * R), te.z = l * Math.sin($ + H * z) * Math.sin(O + 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(O + Q * R), 0), _.normalize()) : (_ = new r.Vector3(te.x, te.y, te.z), _.normalize()), b.push(te), c.push(_), W.push(b.length - 1); + 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); } else - W.push(b.length - L); + W.push(b.length - $); else N && W.push(b.length - 1); } B && w.push(V), w.push(W); @@ -20610,14 +20626,14 @@ void main() { vertices: b, normals: c, verticesRows: w, - w: L, + w: $, h: k }; - return l in this.cache || (this.cache[l] = {}), this.cache[l][u + g] = ee, ee; + return l in this.cache || (this.cache[l] = {}), this.cache[l][u + p] = ee, ee; } } var v = new d(); - function f(m, l, u, g, p, b = 0, c = 0) { + function f(m, l, u, p, g, b = 0, c = 0) { if (!l || !u) return; let _ = function(Me) { @@ -20629,39 +20645,39 @@ void main() { }; b = _(b), c = _(c); var E = c || b; - p = p || { r: 0, g: 0, b: 0 }; - var w = o(u.x - l.x, u.y - l.y, u.z - l.z), k = v.getVerticesForRadius(g, c, "to"), L = k.w, $ = k.h, z = E ? $ * L + 2 : 2 * L, O = m.updateGeoGroup(z), R = k.vertices, P = k.normals, U = k.verticesRows, N = U[$ / 2], B = U[$ / 2 + 1], W = O.vertices, V, G, H, Q, te, ee, ce = O.vertexArray, fe = O.normalArray, oe = O.colorArray, he = O.faceArray; - for (H = 0; H < L; ++H) { + 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 = O.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] = p.r, oe[V + 3] = p.r, oe[V + 1] = p.g, oe[V + 4] = p.g, oe[V + 2] = p.b, oe[V + 5] = p.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, O.faceidx += 6; + 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; } if (E) { - var Se = c ? 0 : $ / 2, Ie = b ? $ + 1 : $ / 2 + 1, pe, le, ne, Te, Fe, Be, Ue, Pe, Ge, Ne, Re, De, je, Xe, X, q, re, ye, me, ze, ke, K, ae, ge, xe, ue, Ce, Z, Oe, We, I, we; + 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 !== $ / 2) { - var ve = te <= $ / 2 ? u : l, Y = v.getVerticesForRadius(g, c, "to"), de = v.getVerticesForRadius(g, 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 < L; Q++) - G = O.faceidx, pe = U[te][Q + 1], Oe = (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, Fe = 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[Oe] = Fe + ve.x, ce[We] = Be + ve.x, ce[I] = Ue + ve.x, ce[we] = Pe + ve.x, ce[Oe + 1] = Ge + ve.y, ce[We + 1] = Ne + ve.y, ce[I + 1] = Re + ve.y, ce[we + 1] = De + ve.y, ce[Oe + 2] = je + ve.z, ce[We + 2] = Xe + ve.z, ce[I + 2] = X + ve.z, ce[we + 2] = q + ve.z, oe[Oe] = p.r, oe[We] = p.r, oe[I] = p.r, oe[we] = p.r, oe[Oe + 1] = p.g, oe[We + 1] = p.g, oe[I + 1] = p.g, oe[we + 1] = p.g, oe[Oe + 2] = p.b, oe[We + 2] = p.b, oe[I + 2] = p.b, oe[we + 2] = p.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[Oe] = re, fe[I] = me, fe[we] = ze, fe[Oe + 1] = ke, fe[I + 1] = ae, fe[we + 1] = ge, fe[Oe + 2] = xe, fe[I + 2] = Ce, fe[we + 2] = Z, he[G] = pe + W, he[G + 1] = ne + W, he[G + 2] = Te + W, O.faceidx += 3) : te === Ie - 1 ? (fe[Oe] = re, fe[We] = ye, fe[I] = me, fe[Oe + 1] = ke, fe[We + 1] = K, fe[I + 1] = ae, fe[Oe + 2] = xe, fe[We + 2] = ue, fe[I + 2] = Ce, he[G] = pe + W, he[G + 1] = le + W, he[G + 2] = ne + W, O.faceidx += 3) : (fe[Oe] = re, fe[We] = ye, fe[we] = ze, fe[Oe + 1] = ke, fe[We + 1] = K, fe[we + 1] = ge, fe[Oe + 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, O.faceidx += 6); + 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); } } - O.vertices += z; + F.vertices += z; } h.drawCylinder = f; - function y(m, l, u, g, p) { + function y(m, l, u, p, g) { if (!l || !u) return; - p = p || { r: 0, g: 0, b: 0 }; + g = g || { r: 0, g: 0, b: 0 }; 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), L = k.vertices, $, z, O, R, P, U, N = k.vertexArray, B = k.normalArray, W = k.colorArray, V = k.faceArray; - for ($ = L * 3, N[$] = l.x, N[$ + 1] = l.y, N[$ + 2] = l.z, B[$] = -b.x, B[$ + 1] = -b.y, B[$ + 2] = -b.z, W[$] = p.r, W[$ + 1] = p.g, W[$ + 2] = p.b, N[$ + 3] = u.x, N[$ + 4] = u.y, N[$ + 5] = u.z, B[$ + 3] = b.x, B[$ + 4] = b.y, B[$ + 5] = b.z, W[$ + 3] = p.r, W[$ + 4] = p.g, W[$ + 5] = p.b, $ += 6, O = 0; O < _; ++O) { - var G = E[O].clone(); - G.multiplyScalar(g), 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[$] = R + l.x, N[$ + 1] = P + l.y, N[$ + 2] = U + l.z, B[$] = R, B[$ + 1] = P, B[$ + 2] = U, W[$] = p.r, W[$ + 1] = p.g, W[$ + 2] = p.b, $ += 3; + 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; } - for (k.vertices += _ + 2, z = k.faceidx, O = 0; O < _; O++) { - var H = L + 2 + O, Q = L + 2 + (O + 1) % _; - V[z] = H, V[z + 1] = Q, V[z + 2] = L, z += 3, V[z] = H, V[z + 1] = Q, V[z + 2] = L + 1, z += 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; } k.faceidx += 6 * _; } @@ -20672,34 +20688,34 @@ void main() { } getVerticesForRadius(l, u) { u = u || 2, this.cache.has(u) || this.cache.set(u, /* @__PURE__ */ new Map()); - let g = this.cache.get(u); - if (g.has(l)) - return g.get(l); - var p = { + let p = this.cache.get(u); + if (p.has(l)) + return p.get(l); + var g = { vertices: [], verticesRows: [], 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, $; - for ($ = 0; $ <= c; $++) { - let O = []; - for (L = 0; L <= b; L++) { - let R = L / b, P = $ / 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 _ = 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(), p.vertices.push({ x: U, y: N, z: B }), p.normals.push(z), O.push(p.vertices.length - 1); + z.normalize(), g.vertices.push({ x: U, y: N, z: B }), g.normals.push(z), F.push(g.vertices.length - 1); } - p.verticesRows.push(O); + g.verticesRows.push(F); } - return g.set(l, p), p; + return p.set(l, g), g; } } var x = new A(); - function M(m, l, u, g, p) { - var b = x.getVerticesForRadius(u, p), c = b.vertices, _ = b.normals, E = m.updateGeoGroup(c.length), w = E.vertices, k = E.vertexArray, L = E.colorArray, $ = E.faceArray, z = E.lineArray, O = E.normalArray; + 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, L[B] = g.r, L[B + 1] = g.g, L[B + 2] = g.b; + 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; } E.vertices += c.length; let R = b.verticesRows, P = R.length - 1; @@ -20707,7 +20723,7 @@ void main() { 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 ? (O[H] = he.x, O[ce] = Se.x, O[oe] = Ie.x, O[H + 1] = he.y, O[ce + 1] = Se.y, O[oe + 1] = Ie.y, O[H + 2] = he.z, O[ce + 2] = Se.z, O[oe + 2] = Ie.z, $[W] = G, $[W + 1] = ee, $[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 ? (O[H] = he.x, O[te] = Ae.x, O[ce] = Se.x, O[H + 1] = he.y, O[te + 1] = Ae.y, O[ce + 1] = Se.y, O[H + 2] = he.z, O[te + 2] = Ae.z, O[ce + 2] = Se.z, $[W] = G, $[W + 1] = Q, $[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) : (O[H] = he.x, O[te] = Ae.x, O[oe] = Ie.x, O[H + 1] = he.y, O[te + 1] = Ae.y, O[oe + 1] = Ie.y, O[H + 2] = he.z, O[te + 2] = Ae.z, O[oe + 2] = Ie.z, O[te] = Ae.x, O[ce] = Se.x, O[oe] = Ie.x, O[te + 1] = Ae.y, O[ce + 1] = Se.y, O[oe + 1] = Ie.y, O[te + 2] = Ae.z, O[ce + 2] = Se.z, O[oe + 2] = Ie.z, $[W] = G, $[W + 1] = Q, $[W + 2] = fe, $[W + 3] = Q, $[W + 4] = ee, $[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); + 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); } } } @@ -20782,16 +20798,16 @@ void main() { * */ getRadiusFromStyle(l, u) { - var g = this.defaultSphereRadius; + var p = this.defaultSphereRadius; if (typeof u.radius < "u") - g = u.radius; + p = u.radius; else if (M.vdwRadii[l.elem]) - g = M.vdwRadii[l.elem]; + p = M.vdwRadii[l.elem]; else if (l.elem.length > 1) { - let p = l.elem; - p = p[0].toUpperCase() + p[1].toLowerCase(), M.vdwRadii[p] && (g = M.vdwRadii[p]); + let g = l.elem; + g = g[0].toUpperCase() + g[1].toLowerCase(), M.vdwRadii[g] && (p = M.vdwRadii[g]); } - return typeof u.scale < "u" && (g *= u.scale), g; + return typeof u.scale < "u" && (p *= u.scale), p; } // cross drawing /** @@ -20801,11 +20817,11 @@ void main() { */ drawAtomCross(l, u) { if (l.style.cross) { - var g = l.style.cross; - if (!g.hidden) { - var p = g.linewidth || M.defaultlineWidth; - u[p] || (u[p] = new r.Geometry()); - var b = u[p].updateGeoGroup(6), c = this.getRadiusFromStyle(l, g), _ = [ + var p = l.style.cross; + 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), _ = [ [c, 0, 0], [-c, 0, 0], [0, c, 0], @@ -20814,43 +20830,43 @@ 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, g), k = b.vertexArray, L = b.colorArray, $ = 0; $ < 6; $++) { + 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 + _[$][0], k[z + 1] = l.y + _[$][1], k[z + 2] = l.z + _[$][2], L[z] = w.r, L[z + 1] = w.g, L[z + 2] = w.b, E) { - var O = new s.Vector3(_[$][0], _[$][1], _[$][2]); - O.multiplyScalar(0.1), O.set(O.x + l.x, O.y + l.y, O.z + l.z), l.intersectionShape.line.push(O); + 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]); + F.multiplyScalar(0.1), F.set(F.x + l.x, F.y + l.y, F.z + l.z), l.intersectionShape.line.push(F); } } } } } - getGoodCross(l, u, g, p) { + 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[_], L = this.atoms[k], z = new s.Vector3(L.x, L.y, L.z).clone(); - z.sub(g); - let O = z.clone(); - O.cross(p); - var w = O.lengthSq(); - if (w > c && (c = w, b = O, c > 0.1)) + let k = l.bonds[_], $ = this.atoms[k], z = new s.Vector3($.x, $.y, $.z).clone(); + z.sub(p); + let F = z.clone(); + F.cross(g); + var w = F.lengthSq(); + if (w > c && (c = w, b = F, c > 0.1)) return b; } return b; } //from atom, return a normalized vector v that is orthogonal and along which //it is appropraite to draw multiple bonds - getSideBondV(l, u, g) { - var p, b, c, _, E, w = new s.Vector3(l.x, l.y, l.z), k = new s.Vector3(u.x, u.y, u.z), L = k.clone(), $ = null; - if (L.sub(w), l.bonds.length === 1) - u.bonds.length === 1 ? ($ = L.clone(), Math.abs($.x) > 1e-4 ? $.y += 1 : $.x += 1) : (p = (g + 1) % u.bonds.length, b = u.bonds[p], c = this.atoms[b], c.index == l.index && (p = (p + 1) % u.bonds.length, b = u.bonds[p], c = this.atoms[b]), _ = new s.Vector3(c.x, c.y, c.z), E = _.clone(), E.sub(w), $ = E.clone(), $.cross(L)); - else if ($ = this.getGoodCross(l, u, w, L), $.lengthSq() < 0.01) { - var z = this.getGoodCross(u, l, w, L); - z != null && ($ = z); + 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; + 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($)); + else if (L = this.getGoodCross(l, u, w, $), L.lengthSq() < 0.01) { + var z = this.getGoodCross(u, l, w, $); + z != null && (L = z); } - return $.lengthSq() < 0.01 && ($ = L.clone(), Math.abs($.x) > 1e-4 ? $.y += 1 : $.x += 1), $.cross(L), $.normalize(), $; + return L.lengthSq() < 0.01 && (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1), L.cross($), L.normalize(), L; } - addLine(l, u, g, p, b, c) { - l[g] = p.x, l[g + 1] = p.y, l[g + 2] = p.z, u[g] = c.r, u[g + 1] = c.g, u[g + 2] = c.b, l[g + 3] = b.x, l[g + 4] = b.y, l[g + 5] = b.z, u[g + 3] = c.r, u[g + 4] = c.g, u[g + 5] = c.b; + addLine(l, u, p, g, b, c) { + l[p] = g.x, l[p + 1] = g.y, l[p + 2] = g.z, u[p] = c.r, u[p + 1] = c.g, u[p + 2] = c.b, l[p + 3] = b.x, l[p + 4] = b.y, l[p + 5] = b.z, u[p + 3] = c.r, u[p + 4] = c.g, u[p + 5] = c.b; } // bonds - both atoms must match bond style // standardize on only drawing for lowest to highest @@ -20861,14 +20877,14 @@ void main() { * @param {AtomSpec[]} atoms * @param {Record} geos */ - drawBondLines(l, u, g) { + drawBondLines(l, u, p) { if (l.style.line) { - var p = l.style.line; - if (!p.hidden) { - var b, c, _, E, w = p.linewidth || M.defaultlineWidth; - g[w] || (g[w] = new r.Geometry()); - for (var k = g[w].updateGeoGroup(6 * l.bonds.length), L = k.vertexArray, $ = k.colorArray, z = 0; z < l.bonds.length; z++) { - var O = l.bonds[z], R = u[O]; + var g = l.style.line; + if (!g.hidden) { + var b, c, _, 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))); @@ -20882,9 +20898,9 @@ void main() { 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))); + 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))); } 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)); + 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)); } } } @@ -20899,14 +20915,14 @@ void main() { */ drawAtomSphere(l, u) { if (l.style.sphere) { - var g = l.style.sphere; - if (!g.hidden) { - var p = (0, v.getColorFromStyle)(l, g), b = this.getRadiusFromStyle(l, g); + var p = l.style.sphere; + if (!p.hidden) { + var g = (0, v.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)); } - o.GLDraw.drawSphere(u, l, b, p); + o.GLDraw.drawSphere(u, l, b, g); } } } @@ -20915,85 +20931,85 @@ void main() { if (l.style.clicksphere) { var u = l.style.clicksphere; if (!u.hidden) { - var g = this.getRadiusFromStyle(l, u); + var p = this.getRadiusFromStyle(l, u); if ((l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { - var p = new s.Vector3(l.x, l.y, l.z); - l.intersectionShape.sphere.push(new a.Sphere(p, g)); + var g = new s.Vector3(l.x, l.y, l.z); + l.intersectionShape.sphere.push(new a.Sphere(g, p)); } } } } drawAtomInstanced(l, u) { if (l.style.sphere) { - var g = l.style.sphere; - if (!g.hidden) { - var p = this.getRadiusFromStyle(l, g), b = (0, v.getColorFromStyle)(l, g), c = u.updateGeoGroup(1), _ = c.vertices, E = _ * 3, w = c.vertexArray, k = c.colorArray, L = 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, L[_] = p, (l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) { - var $ = new s.Vector3(l.x, l.y, l.z); - l.intersectionShape.sphere.push(new a.Sphere($, p)); + 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 L = new s.Vector3(l.x, l.y, l.z); + l.intersectionShape.sphere.push(new a.Sphere(L, g)); } c.vertices += 1; } } } - drawSphereImposter(l, u, g, p) { + drawSphereImposter(l, u, p, g) { var b = l.updateGeoGroup(4), c, _ = b.vertices, E = _ * 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 L = b.normalArray; + var $ = b.normalArray; for (c = 0; c < 4; c++) - k[E + 3 * c] = p.r, k[E + 3 * c + 1] = p.g, k[E + 3 * c + 2] = p.b; - L[E + 0] = -g, L[E + 1] = g, L[E + 2] = 0, L[E + 3] = -g, L[E + 4] = -g, L[E + 5] = 0, L[E + 6] = g, L[E + 7] = -g, L[E + 8] = 0, L[E + 9] = g, L[E + 10] = g, L[E + 11] = 0, b.vertices += 4; - var $ = b.faceArray, z = b.faceidx; - $[z + 0] = _, $[z + 1] = _ + 1, $[z + 2] = _ + 2, $[z + 3] = _ + 2, $[z + 4] = _ + 3, $[z + 5] = _, b.faceidx += 6; + 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; } //dkoes - code for sphere imposters drawAtomImposter(l, u) { if (l.style.sphere) { - var g = l.style.sphere; - if (!g.hidden) { - var p = this.getRadiusFromStyle(l, g), b = (0, v.getColorFromStyle)(l, g); + var p = l.style.sphere; + if (!p.hidden) { + var g = this.getRadiusFromStyle(l, p), b = (0, v.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, p)); + l.intersectionShape.sphere.push(new a.Sphere(c, g)); } - this.drawSphereImposter(u, l, p, b); + this.drawSphereImposter(u, l, g, b); } } } - calculateDashes(l, u, g, p, b) { + 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)); - g = Math.max(g, 0), b = Math.max(b, 0) + 2 * g, p = Math.max(p, 1e-3), p + b > c && (p = c, b = 0); - var _ = Math.floor((c - p) / (p + b)) + 1, E = _ * p; + 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), L = new s.Vector3((u.x - l.x) / (c / b), (u.y - l.y) / (c / b), (u.z - l.z) / (c / b)), $ = new s.Vector3((u.x - l.x) / (c / p), (u.y - l.y) / (c / p), (u.z - l.z) / (c / p)), z = [], O = 0; O < _; O++) - w = new s.Vector3(k.x + $.x, k.y + $.y, k.z + $.z), z.push({ from: k, to: w }), k = new s.Vector3(w.x + L.x, w.y + L.y, w.z + L.z); + 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, g, p, b, c = 0, _ = 0) { - for (var E = l.updateGeoGroup(4), w = E.vertices, k = w * 3, L = E.vertexArray, $ = E.colorArray, z = E.radiusArray, O = E.normalArray, R = b.r, P = b.g, U = b.b, N = function(H) { + 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++) - L[B] = u.x, O[B] = g.x, $[B] = R, B++, L[B] = u.y, O[B] = g.y, $[B] = P, B++, L[B] = u.z, O[B] = g.z, W < 2 ? $[B] = U : $[B] = N(U), B++; - E.vertices += 4, z[w] = -p, z[w + 1] = p, z[w + 2] = -p, z[w + 3] = p; + $[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; } // draws cylinders and small spheres (at bond radius) - drawBondSticks(l, u, g) { - var p, b; + drawBondSticks(l, u, p) { + var g, b; 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 = ((p = c.dashedBondConfig) === null || p === void 0 ? void 0 : p.dashLength) || 0.1, L = ((b = c.dashedBondConfig) === null || b === void 0 ? void 0 : b.gapLength) || 0.25, $ = _, z = c.singleBonds || !1, O = 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; + 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 ge = g.imposter ? M.drawStickImposter : o.GLDraw.drawCylinder; - return !O && ae >= 1 ? ge : (xe, ue, Ce, Z, Oe, We = 0, I = 0, we = 0.1, ve = 0.25) => { + 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, Oe, We, I); + ge(xe, de.from, de.to, Z, Fe, We, I); }); }; }; @@ -21004,37 +21020,37 @@ void main() { if (!ne.stick || ne.stick.hidden) continue; var Te = (0, v.getColorFromStyle)(le, ne.stick); - if ($ = _, W = z, l.bondStyles && l.bondStyles[B]) { + if (L = _, W = z, l.bondStyles && l.bondStyles[B]) { if (V = l.bondStyles[B], V.iswire) continue; - V.radius && ($ = 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)); + 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)); } - var Fe = new s.Vector3(l.x, l.y, l.z), Be = new s.Vector3(le.x, le.y, le.z); + 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.bondOrder[B]), !le.capDrawn && le.bonds.length < 4 && (P = 2), fe != Te ? (oe = new s.Vector3().addVectors(Fe, Be).multiplyScalar(0.5), Ie(g, Fe, oe, $, fe, R, 0, k, L), Ie(g, oe, Be, $, Te, 0, P, k, L)) : Ie(g, Fe, Be, $, fe, R, P, k, L), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, U || N) { - if (oe || (oe = new s.Vector3().addVectors(Fe, Be).multiplyScalar(0.5)), U) { - var Ue = new a.Cylinder(Fe, oe, $), Pe = new a.Sphere(Fe, $); + 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); } if (N) { - var Ge = new a.Cylinder(Be, oe, $), Ne = new a.Sphere(Be, $); + var Ge = new a.Cylinder(Be, oe, L), Ne = new a.Sphere(Be, L); le.intersectionShape.cylinder.push(Ge), le.intersectionShape.sphere.push(Ne); } } } else if (l.bondOrder[B] > 1) { var Re = 0, De = 0; - $ != _ && (Re = 2, De = 2); + L != _ && (Re = 2, De = 2); var je = Be.clone(), Xe = null; - je.sub(Fe); + je.sub(Oe); var X, q, re, ye, me; - Xe = this.getSideBondV(l, le, B), l.bondOrder[B] == 2 ? (X = $ * E, Xe.multiplyScalar(X * 1.5), q = Fe.clone(), q.add(Xe), re = Fe.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(g, q, oe, X, fe, Re, 0), Ie(g, oe, ye, X, Te, 0, De), Ie(g, re, he, X, fe, Re, 0), Ie(g, he, me, X, Te, 0, De)) : (Ie(g, q, ye, X, fe, Re, De), Ie(g, 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 = $ * w, Xe.cross(je), Xe.normalize(), Xe.multiplyScalar(X * 3), q = Fe.clone(), q.add(Xe), re = Fe.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(Fe, Be).multiplyScalar(0.5), Ie(g, q, oe, X, fe, Re, 0), Ie(g, oe, ye, X, Te, 0, De), Ie(g, Fe, Ae, X, fe, R, 0), Ie(g, Ae, Be, X, Te, 0, P), Ie(g, re, he, X, fe, Re, 0), Ie(g, he, me, X, Te, 0, De)) : (Ie(g, q, ye, X, fe, Re, De), Ie(g, Fe, Be, X, fe, R, P), Ie(g, 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(Fe, 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(Fe.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)))); + 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)))); } } } 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 && ($ = _, g.imposter ? this.drawSphereImposter(g.sphereGeometry, l, $, fe) : o.GLDraw.drawSphere(g, l, $, fe)); + 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)); } } } @@ -21046,19 +21062,19 @@ void main() { /** param {AtomSpec[]} atoms */ createMolObj(l, u) { u = u || {}; - var g = new r.Object3D(), p = [], b = {}, c = {}, _ = this.drawAtomSphere, E = null, w = null; + 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, O = {}, R = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - for (k = 0, $ = l.length; k < $; k++) { + var k, $, L, z, F = {}, R = [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 (L in z) - P.style[L] ? P.style[L].opacity ? z[L] = parseFloat(P.style[L].opacity) : z[L] = 1 : z[L] = void 0, O[L] ? z[L] != null && O[L] != z[L] && (console.log("Warning: " + L + " opacity is ambiguous"), O[L] = 1) : O[L] = z[L]; - _.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)), p.push(P)); + 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)); } } - if (p.length > 0 && (0, d.drawCartoon)(g, p, R, this.defaultCartoonQuality), E && E.vertices > 0) { + if (g.length > 0 && (0, d.drawCartoon)(p, g, R, this.defaultCartoonQuality), E && E.vertices > 0) { E.initTypedArrays(); var U = null, N = null; E.imposter ? U = new r.SphereImposterMaterial({ @@ -21076,17 +21092,17 @@ void main() { ambient: 0, vertexColors: !0, reflectivity: 0 - }), O.sphere < 1 && O.sphere >= 0 && (U.transparent = !0, U.opacity = O.sphere), N = new r.Mesh(E, U), g.add(N); + }), F.sphere < 1 && F.sphere >= 0 && (U.transparent = !0, U.opacity = F.sphere), N = new r.Mesh(E, U), p.add(N); } 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())), O.stick < 1 && O.stick >= 0 && (B.transparent = !0, B.opacity = O.stick, W.transparent = !0, W.opacity = O.stick); + 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 (g.add(H), V) { + if (p.add(H), V) { var Q = new r.Mesh(V, W); - g.add(Q); + p.add(Q); } } var te; @@ -21097,9 +21113,9 @@ void main() { linewidth: te, vertexColors: !0 }); - O.line < 1 && O.line >= 0 && (ee.transparent = !0, ee.opacity = O.line), b[k].initTypedArrays(); + 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); - g.add(ce); + p.add(ce); } for (k in c) if (c.hasOwnProperty(k)) { @@ -21108,19 +21124,19 @@ void main() { linewidth: te, vertexColors: !0 }); - O.cross < 1 && O.cross >= 0 && (fe.transparent = !0, fe.opacity = O.cross), c[k].initTypedArrays(); + 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); - g.add(oe); + p.add(oe); } 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 = g.clone(), Se.matrix.copy(this.modelData.symmetries[Ae]), Se.matrixAutoUpdate = !1, he.add(Se); + Se = p.clone(), Se.matrix.copy(this.modelData.symmetries[Ae]), Se.matrixAutoUpdate = !1, he.add(Se); } return he; } - return g; + return p; } /** * Return object representing internal state of @@ -21166,14 +21182,14 @@ void main() { * @param {number} gamma - unit cell angle in degrees (default 90) */ - setCrystData(l, u, g, p, b, c) { - l = l || 1, u = u || 1, g = g || 1, p = p || 90, b = b || 90, c = c || 90; - const _ = (0, s.conversionMatrix3)(l, u, g, p, b, c); + 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); this.modelData.cryst = { a: l, b: u, - c: g, - alpha: p, + c: p, + alpha: g, beta: b, gamma: c, matrix: _ @@ -21227,18 +21243,18 @@ void main() { getNumFrames() { return this.frames.numFrames != null ? this.frames.numFrames : this.frames.length; } - adjustCoord(l, u, g, p) { + adjustCoord(l, u, p, g) { var b = u - l; - return b < -g ? u + p : b > g ? u - p : u; + return b < -p ? u + g : b > p ? u - g : u; } //go over current atoms in depth first order and ensure that connected //attoms aren't split across the box adjustCoordinatesToBox() { if (this.box && this.atomdfs) - for (var l = this.box[0], u = this.box[1], g = this.box[2], p = l * 0.9, b = u * 0.9, c = g * 0.9, _ = 0; _ < this.atomdfs.length; _++) + 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++) { - var k = this.atoms[E[w][0]], L = this.atoms[E[w][1]]; - k.x = this.adjustCoord(L.x, k.x, p, l), k.y = this.adjustCoord(L.y, k.y, b, u), k.z = this.adjustCoord(L.z, k.z, c, g); + 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); } } /** @@ -21249,19 +21265,19 @@ void main() { * @return {Promise} */ setFrame(l, u) { - var g = this.getNumFrames(); - let p = this; + var p = this.getNumFrames(); + let g = this; return new Promise(function(b, c) { - if (g == 0 && b(), (l < 0 || l >= g) && (l = g - 1), p.frames.url != null) { - var _ = p.frames.url; - (0, v.getbin)(_ + "/traj/frame/" + l + "/" + p.frames.path, void 0, "POST", void 0).then(function(E) { - for (var w = new Float32Array(E, 44), k = 0, L = 0; L < p.atoms.length; L++) - p.atoms[L].x = w[k++], p.atoms[L].y = w[k++], p.atoms[L].z = w[k++]; - p.box && p.atomdfs && p.adjustCoordinatesToBox(), b(); + 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) { + 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(); }).catch(c); } else - p.atoms = p.frames[l], b(); - p.molObj = null, p.modelDatas && l < p.modelDatas.length && (p.modelData = p.modelDatas[l], p.unitCellObjects && u && (u.removeUnitCell(p), u.addUnitCell(p))); + g.atoms = g.frames[l], b(); + g.molObj = null, g.modelDatas && l < g.modelDatas.length && (g.modelData = g.modelDatas[l], g.unitCellObjects && u && (u.removeUnitCell(g), u.addUnitCell(g))); }); } /** @@ -21292,28 +21308,28 @@ void main() { viewer.render(); }); */ - vibrate(l = 10, u = 1, g = !1, p, b) { + vibrate(l = 10, u = 1, p = !1, g, b) { var c = 0, _ = l; - g && (c = -l, _ = l), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), c < _ && (this.frames = []), g && (this.frames.origIndex = 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 w = [], k = this.frames.length; if (E == 0 && !b) { this.frames.push(this.atoms); continue; } - for (var L = 0; L < this.atoms.length; L++) { - var $ = (0, v.getAtomProperty)(this.atoms[L], "dx"), z = (0, v.getAtomProperty)(this.atoms[L], "dy"), O = (0, v.getAtomProperty)(this.atoms[L], "dz"), R = new s.Vector3($, z, O), P = new s.Vector3(this.atoms[L].x, this.atoms[L].y, this.atoms[L].z), U = E * u / l; + 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[L]) - N[B] = this.atoms[L][B]; - if (N.x = P.x, N.y = P.y, N.z = P.z, w.push(N), p && b) { - var W = (0, v.extend)({}, b), V = new s.Vector3($, z, O); + 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); } - p.addArrow(W); + g.addArrow(W); } } this.frames.push(w); @@ -21322,8 +21338,8 @@ void main() { // set default style and colors for atoms setAtomDefaults(l) { for (let u = 0; u < l.length; u++) { - let g = l[u]; - g && (g.style = g.style || (0, v.deepCopy)(M.defaultAtomStyle), g.color = g.color || this.ElementColors[g.elem] || this.defaultColor, g.model = this.id, (g.clickable || g.hoverable) && (g.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] })); + 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: [] })); } } /** add atoms to this model from molecular data string @@ -21332,23 +21348,23 @@ void main() { * @param {string} format - input file string format (e.g 'pdb', 'sdf', 'sdf.gz', etc.) * @param {ParserOptionsSpec} options - format dependent options. Attributes depend on the input format */ - addMolData(l, u, g = {}) { - var p = M.parseMolData(l, u, g); - this.dontDuplicateAtoms = !g.duplicateAssemblyAtoms; - var b = p.modelData; - if (b && (Array.isArray(b) ? (this.modelData = b[0], g.frames && (this.modelDatas = b)) : this.modelData = b), p.box ? this.box = p.box : this.box = null, this.frames.length == 0) { - for (let _ = 0; _ < p.length; _++) - p[_].length != 0 && this.frames.push(p[_]); + addMolData(l, u, p = {}) { + var g = M.parseMolData(l, u, p); + 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[_]); this.frames[0] && (this.atoms = this.frames[0]); - } else if (g.frames) - for (let _ = 0; _ < p.length; _++) - this.frames.push(p[_]); + } else if (p.frames) + for (let _ = 0; _ < g.length; _++) + this.frames.push(g[_]); else - for (var c = 0; c < p.length; c++) - this.addAtoms(p[c]); + for (var c = 0; c < g.length; c++) + this.addAtoms(g[c]); for (let _ = 0; _ < this.frames.length; _++) this.setAtomDefaults(this.frames[_]); - g.vibrate && g.vibrate.frames && g.vibrate.amplitude && this.vibrate(g.vibrate.frames, g.vibrate.amplitude), g.style && this.setStyle({}, g.style); + p.vibrate && p.vibrate.frames && p.vibrate.amplitude && this.vibrate(p.vibrate.frames, p.vibrate.amplitude), p.style && this.setStyle({}, p.style); } setDontDuplicateAtoms(l) { this.dontDuplicateAtoms = l; @@ -21361,10 +21377,10 @@ void main() { if (l == u) return !0; if (typeof u == "string" && typeof l == "number") { - var g = u.match(/(-?\d+)\s*-\s*(-?\d+)/); - if (g) { - var p = parseInt(g[1]), b = parseInt(g[2]); - if (g && l >= p && l <= b) + var p = u.match(/(-?\d+)\s*-\s*(-?\d+)/); + if (p) { + var g = parseInt(p[1]), b = parseInt(p[2]); + if (p && l >= g && l <= b) return !0; } } @@ -21381,43 +21397,43 @@ void main() { static deepCopyAndCache(l, u) { if (typeof l != "object" || l == null || l.__cache_created) return l; - const g = {}; - for (const p in l) { - const b = l[p]; + const p = {}; + for (const g in l) { + const b = l[g]; if (Array.isArray(b)) { - g[p] = []; + p[g] = []; for (let c = 0; c < b.length; c++) - g[p].push(M.deepCopyAndCache(b[c], u)); - } else typeof b == "object" && p != "properties" && p != "model" ? g[p] = M.deepCopyAndCache(b, u) : g[p] = b; - if (p == "and" || p == "or") { + p[g].push(M.deepCopyAndCache(b[c], u)); + } 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 g[p]) { + for (const _ of p[g]) { const E = /* @__PURE__ */ new Set(); for (const w of u.selectedAtoms(_)) E.add(w.index); c.push(E); } - if (p == "and") { + if (g == "and") { const _ = function(w, k) { - const L = /* @__PURE__ */ new Set(); - for (const $ of k) - w.has($) && L.add($); - return L; + const $ = /* @__PURE__ */ new Set(); + for (const L of k) + w.has(L) && $.add(L); + return $; }; let E = new Set(c[0]); for (const w of c.splice(1)) E = _(E, w); - g[p].__cached_results = E; - } else if (p == "or") { + p[g].__cached_results = E; + } else if (g == "or") { const _ = /* @__PURE__ */ new Set(); for (const E of c) for (const w of E) _.add(w); - g[p].__cached_results = _; + p[g].__cached_results = _; } } } - return g.__cache_created = !0, g; + return p.__cache_created = !0, p; } /** given a selection specification, return true if atom is selected. * Does not support context-aware selectors like expand/within/byres. @@ -21429,69 +21445,69 @@ void main() { atomIsSelected(l, u) { if (typeof u > "u") return !0; - var g = !!u.invert, p = !0; + var p = !!u.invert, g = !0; for (var b in u) if (b == "and" || b == "or" || b == "not") { if (b == "not") { if (this.atomIsSelected(l, u[b])) { - p = !1; + g = !1; break; } - } else if (u[b].__cached_results === void 0 && (u = M.deepCopyAndCache(u, this)), p = u[b].__cached_results.has(l.index), !p) + } else if (u[b].__cached_results === void 0 && (u = M.deepCopyAndCache(u, this)), g = u[b].__cached_results.has(l.index), !g) break; } else if (b === "predicate") { if (!u.predicate(l)) { - p = !1; + g = !1; break; } } else if (b == "properties" && l[b]) { for (var c in u.properties) if (!c.startsWith("__cache")) { if (typeof l.properties[c] > "u") { - p = !1; + g = !1; break; } if (l.properties[c] != u.properties[c]) { - p = !1; + g = !1; break; } } } else if (u.hasOwnProperty(b) && !M.ignoredKeys.has(b) && !b.startsWith("__cache")) { if (typeof l[b] > "u") { - p = !1; + g = !1; break; } var _ = !1; if (b === "bonds") { var E = u[b]; if (E != l.bonds.length) { - p = !1; + g = !1; break; } } else if (Array.isArray(u[b])) { var w = u[b], k = l[b]; - for (let L = 0; L < w.length; L++) - if (this.propertyMatches(k, w[L])) { + for (let $ = 0; $ < w.length; $++) + if (this.propertyMatches(k, w[$])) { _ = !0; break; } if (!_) { - p = !1; + g = !1; break; } } else { - let L = u[b]; - if (!this.propertyMatches(l[b], L)) { - p = !1; + let $ = u[b]; + if (!this.propertyMatches(l[b], $)) { + g = !1; break; } } } - return g ? !p : p; + return p ? !g : g; } static squaredDistance(l, u) { - var g = u.x - l.x, p = u.y - l.y, b = u.z - l.z; - return g * g + p * p + b * b; + var p = u.x - l.x, g = u.y - l.y, b = u.z - l.z; + return p * p + g * g + b * b; } /** returns a list of atoms in the expanded bounding box, but not in the current one * @@ -21505,12 +21521,12 @@ void main() { expandAtomList(l, u) { if (u <= 0) return l; - for (var g = (0, v.getExtent)(l, void 0), p = [[], [], []], b = 0; b < 3; b++) - p[0][b] = g[0][b] - u, p[1][b] = g[1][b] + u, p[2][b] = g[2][b]; + for (var p = (0, v.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; - _ >= p[0][0] && _ <= p[1][0] && E >= p[0][1] && E <= p[1][1] && w >= p[0][2] && w <= p[1][2] && (_ >= g[0][0] && _ <= g[1][0] && E >= g[0][1] && E <= g[1][1] && w >= g[0][2] && w <= g[1][2] || c.push(this.atoms[k])); + _ >= 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])); } return c; } @@ -21532,57 +21548,57 @@ void main() { }); */ selectedAtoms(l, u) { - var g = []; + var p = []; l = M.deepCopyAndCache(l || {}, this), u || (u = this.atoms); - for (var p = u.length, b = 0; b < p; b++) { + for (var g = u.length, b = 0; b < g; b++) { var c = u[b]; - c && this.atomIsSelected(c, l) && g.push(c); + c && this.atomIsSelected(c, l) && p.push(c); } if (l.hasOwnProperty("expand")) { const N = M.getFloat(l.expand); - let B = this.expandAtomList(g, N), W = g.length; + 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], g[H]); - _ < V && _ > 0 && g.push(B[G]); + var _ = M.squaredDistance(B[G], p[H]); + _ < V && _ > 0 && p.push(B[G]); } } 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; for (let W = 0; W < E.length; W++) - for (let V = 0; V < g.length; V++) { - let G = M.squaredDistance(E[W], g[V]); + for (let V = 0; V < p.length; V++) { + let G = M.squaredDistance(E[W], p[V]); G < B && G > 0 && (w[V] = 1); } var k = []; if (l.within.invert) - for (let W = 0; W < g.length; W++) - w[W] || k.push(g[W]); + for (let W = 0; W < p.length; W++) + w[W] || k.push(p[W]); else for (let W in w) - k.push(g[W]); - g = k; + k.push(p[W]); + p = k; } if (l.hasOwnProperty("byres")) { - var L = {}, $ = [], z = []; - for (let N = 0; N < g.length; N++) { - let B = g[N]; - var O = B.chain, R = B.resi; - if (L[O] === void 0 && (L[O] = {}), B.hasOwnProperty("resi") && L[O][R] === void 0) { - for (L[O][R] = !0, z.push(B); z.length > 0; ) - if (B = z.pop(), O = B.chain, R = B.resi, $[B.index] === void 0) { - $[B.index] = !0; + 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]]; - $[U.index] === void 0 && U.hasOwnProperty("resi") && U.chain == O && U.resi == R && (z.push(U), g.push(U)); + L[U.index] === void 0 && U.hasOwnProperty("resi") && U.chain == F && U.resi == R && (z.push(U), p.push(U)); } } } } } - return g; + return p; } /** Add list of new atoms to model. Adjusts bonds appropriately. * @@ -21599,14 +21615,14 @@ void main() { */ addAtoms(l) { this.molObj = null; - var u = this.atoms.length, g = [], p; - for (p = 0; p < l.length; p++) - typeof l[p].index > "u" && (l[p].index = p), typeof l[p].serial > "u" && (l[p].serial = p), g[l[p].index] = u + p; - for (p = 0; p < l.length; p++) { - var b = l[p], c = g[b.index], _ = (0, v.extend)({}, b); + var u = this.atoms.length, p = [], g; + 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); for (var E = b.bonds ? b.bonds.length : 0, w = 0; w < E; w++) { - var k = g[b.bonds[w]]; + var k = p[b.bonds[w]]; typeof k < "u" && (_.bonds.push(k), _.bondOrder.push(b.bondOrder ? b.bondOrder[w] : 1)); } this.atoms.push(_); @@ -21625,15 +21641,15 @@ void main() { */ removeAtoms(l) { this.molObj = null; - var u = [], g; - for (g = 0; g < l.length; g++) - u[l[g].index] = !0; - var p = []; - for (g = 0; g < this.atoms.length; g++) { - var b = this.atoms[g]; - u[b.index] || p.push(b); + var u = [], p; + for (p = 0; p < l.length; p++) + u[l[p].index] = !0; + var g = []; + for (p = 0; p < this.atoms.length; p++) { + var b = this.atoms[p]; + u[b.index] || g.push(b); } - this.atoms = [], this.addAtoms(p); + this.atoms = [], this.addAtoms(g); } /** Set atom style of selected atoms * @@ -21655,16 +21671,16 @@ void main() { viewer.render(); }); */ - setStyle(l, u, g) { - typeof u > "u" && typeof g > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, v.specStringToObject)(u)); - var p = !1, b = this, c = function(E) { + setStyle(l, u, p) { + typeof u > "u" && typeof p > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, v.specStringToObject)(u)); + var g = !1, b = this, c = function(E) { var w = b.selectedAtoms(l, E); for (let k = 0; k < E.length; k++) E[k] && (E[k].capDrawn = !1); for (let k = 0; k < w.length; k++) { - p = !0, (w[k].clickable || w[k].hoverable) && (w[k].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), g || (w[k].style = {}); - for (let L in u) - u.hasOwnProperty(L) && (w[k].style[L] = w[k].style[L] || {}, Object.assign(w[k].style[L], u[L])); + g = !0, (w[k].clickable || w[k].hoverable) && (w[k].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), p || (w[k].style = {}); + for (let $ in u) + u.hasOwnProperty($) && (w[k].style[$] = w[k].style[$] || {}, Object.assign(w[k].style[$], u[$])); } }; if (l.frame !== void 0 && l.frame < this.frames.length) { @@ -21675,7 +21691,7 @@ void main() { for (var _ = 0; _ < this.frames.length; _++) this.frames[_] !== this.atoms && c(this.frames[_]); } - p && (this.molObj = null); + g && (this.molObj = null); } /** Set clickable and callback of selected atoms * @@ -21684,14 +21700,14 @@ void main() { * @param {function} callback - function called when an atom in the selection is clicked */ - setClickable(l, u, g) { - if (u = !!u, g = (0, v.makeFunction)(g), g === null) { + setClickable(l, u, p) { + if (u = !!u, p = (0, v.makeFunction)(p), p === null) { console.log("Callback is not a function"); return; } - var p = this.selectedAtoms(l, this.atoms), b = p.length; + var g = this.selectedAtoms(l, this.atoms), b = g.length; for (let c = 0; c < b; c++) - p[c].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, p[c].clickable = u, g && (p[c].callback = g); + g[c].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[c].clickable = u, p && (g[c].callback = p); b > 0 && (this.molObj = null); } /** Set hoverable and callback of selected atoms @@ -21701,18 +21717,18 @@ void main() { * @param {function} hover_callback - function called when an atom in the selection is hovered over * @param {function} unhover_callback - function called when the mouse moves out of the hover area */ - setHoverable(l, u, g, p) { - if (u = !!u, g = (0, v.makeFunction)(g), p = (0, v.makeFunction)(p), g === null) { + setHoverable(l, u, p, g) { + if (u = !!u, p = (0, v.makeFunction)(p), g = (0, v.makeFunction)(g), p === null) { console.log("Hover_callback is not a function"); return; } - if (p === null) { + if (g === null) { console.log("Unhover_callback is not a function"); return; } var b = this.selectedAtoms(l, this.atoms), c = b.length; for (let _ = 0; _ < c; _++) - b[_].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[_].hoverable = u, g && (b[_].hover_callback = g), p && (b[_].unhover_callback = p); + b[_].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[_].hoverable = u, p && (b[_].hover_callback = p), g && (b[_].unhover_callback = g); c > 0 && (this.molObj = null); } /** enable context menu of selected atoms @@ -21722,9 +21738,9 @@ void main() { */ enableContextMenu(l, u) { u = !!u; - var g, p = this.selectedAtoms(l, this.atoms), b = p.length; - for (g = 0; g < b; g++) - p[g].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, p[g].contextMenuEnabled = u; + var p, g = this.selectedAtoms(l, this.atoms), b = g.length; + for (p = 0; p < b; p++) + g[p].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[p].contextMenuEnabled = u; b > 0 && (this.molObj = null); } /** given a mapping from element to color, set atom colors @@ -21735,10 +21751,10 @@ void main() { setColorByElement(l, u) { if (!(this.molObj !== null && M.sameObj(u, this.lastColors))) { this.lastColors = u; - var g = this.selectedAtoms(l, g); - g.length > 0 && (this.molObj = null); - for (var p = 0; p < g.length; p++) { - var b = g[p]; + var p = this.selectedAtoms(l, p); + p.length > 0 && (this.molObj = null); + for (var g = 0; g < p.length; g++) { + var b = p[g]; typeof u[b.elem] < "u" && (b.color = u[b.elem]); } } @@ -21748,12 +21764,12 @@ void main() { * @param {string} prop * @param {Gradient|string} scheme */ - setColorByProperty(l, u, g, p) { + setColorByProperty(l, u, p, g) { var b, c, _ = this.selectedAtoms(l, _); - for (this.lastColors = null, _.length > 0 && (this.molObj = null), typeof g == "string" && typeof f.Gradient.builtinGradients[g] < "u" && (g = new f.Gradient.builtinGradients[g]()), g = g, p || (p = g.range()), p || (p = (0, v.getPropertyRange)(_, u)), b = 0; b < _.length; b++) { + 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); - E != null && (c.color = g.valueToHex(parseFloat(c.properties[u]), p)); + E != null && (c.color = p.valueToHex(parseFloat(c.properties[u]), g)); } } /** @@ -21774,11 +21790,11 @@ void main() { */ setColorByFunction(l, u) { - var g = this.selectedAtoms(l, g); + var p = this.selectedAtoms(l, p); if (typeof u == "function") { - this.lastColors = null, g.length > 0 && (this.molObj = null); - for (let p = 0; p < g.length; p++) { - let b = g[p]; + this.lastColors = null, p.length > 0 && (this.molObj = null); + for (let g = 0; g < p.length; g++) { + let b = p[g]; b.color = u(b); } } @@ -21791,23 +21807,23 @@ void main() { toCDObject(l = !1) { var u = { a: [], b: [] }; l && (u.s = []); - for (let p = 0; p < this.atoms.length; p++) { - let b = {}, c = this.atoms[p]; + for (let g = 0; g < this.atoms.length; g++) { + let b = {}, c = this.atoms[g]; if (b.x = c.x, b.y = c.y, b.z = c.z, c.elem != "C" && (b.l = c.elem), l) { - for (var g = 0; g < u.s.length && JSON.stringify(c.style) !== JSON.stringify(u.s[g]); ) - g++; - g === u.s.length && u.s.push(c.style), g !== 0 && (b.s = g); + for (var p = 0; p < u.s.length && JSON.stringify(c.style) !== JSON.stringify(u.s[p]); ) + p++; + 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 = p, w = c.bonds[_]; + let E = g, w = c.bonds[_]; if (E >= w) continue; let k = { b: E, e: w - }, L = c.bondOrder[_]; - L != 1 && (k.o = L), u.b.push(k); + }, $ = c.bondOrder[_]; + $ != 1 && (k.o = $), u.b.push(k); } } return u; @@ -21872,10 +21888,10 @@ void main() { * @param {GLViewer} viewer * @param {LabelSpec} options */ - addPropertyLabels(l, u, g, p) { - for (var b = this.selectedAtoms(u, b), c = (0, v.deepCopy)(p), _ = 0; _ < b.length; _++) { + 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; - typeof E[l] < "u" ? w = String(E[l]) : typeof E.properties[l] < "u" && (w = String(E.properties[l])), w != null && (c.position = E, g.addLabel(w, c)); + 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)); } } /** Create labels for residues of selected atoms. @@ -21887,16 +21903,16 @@ void main() { * @param {LabelSpec} options * @param {boolean} byframe - if true, create labels for every individual frame, not just current; frames must be loaded already */ - addResLabels(l, u, g, p = !1) { + addResLabels(l, u, p, g = !1) { var b = [], c = function(E, w) { - for (var k = E.selectedAtoms(l, k), L = {}, $ = 0; $ < k.length; $++) { - var z = k[$], O = z.chain, R = z.resn, P = z.resi, U = R + "" + P; - L[O] || (L[O] = {}), L[O][U] || (L[O][U] = []), L[O][U].push(z); + 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 N = (0, v.deepCopy)(g); - for (let W in L) - if (L.hasOwnProperty(W)) { - var B = L[W]; + var N = (0, v.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); @@ -21910,7 +21926,7 @@ void main() { } } }; - if (p) { + if (g) { var _ = this.getNumFrames(); let E = this.atoms; for (let w = 0; w < _; w++) @@ -21925,19 +21941,19 @@ void main() { this.atomdfs = []; var l = this, u = new Int8Array(this.atoms.length); u.fill(0); - for (var g = function(_, E, w) { + for (var p = function(_, E, w) { w.push([_, E]); var k = l.atoms[_]; u[_] = 1; - for (var L = 0; L < k.bonds.length; L++) { - var $ = k.bonds[L]; - l.atoms[$] && !u[$] && g($, _, w); + for (var $ = 0; $ < k.bonds.length; $++) { + var L = k.bonds[$]; + l.atoms[L] && !u[L] && p(L, _, w); } - }, p = 0; p < this.atoms.length; p++) { - var b = this.atoms[p]; - if (b && !u[p]) { + }, g = 0; g < this.atoms.length; g++) { + var b = this.atoms[g]; + if (b && !u[g]) { var c = []; - g(p, -1, c), this.atomdfs.push(c); + p(g, -1, c), this.atomdfs.push(c); } } } @@ -21949,10 +21965,10 @@ void main() { */ setCoordinatesFromURL(l, u) { this.frames = []; - var g = this; - return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, v.get)(l + "/traj/numframes/" + u, function(p) { - if (!isNaN(parseInt(p))) - return g.frames.push(g.atoms), g.frames.numFrames = p, g.frames.url = l, g.frames.path = u, g.setFrame(0); + var p = this; + return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, v.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); }); } /** @@ -21976,15 +21992,15 @@ void main() { u = u.replace(/\.gz$/, ""); try { l = (0, v.inflateString)(l); - } catch (L) { - console.log(L); + } catch ($) { + console.log($); } } - var g = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" }; - if (g.hasOwnProperty(u)) { + var p = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" }; + if (p.hasOwnProperty(u)) { this.frames = []; - for (var p = this.atoms.length, b = M.parseCrd(l, u), c = 0; c < b.length; ) { - for (var _ = [], E = 0; E < p; E++) { + for (var g = this.atoms.length, b = M.parseCrd(l, u), c = 0; c < b.length; ) { + for (var _ = [], E = 0; E < g; E++) { var w = {}; for (var k in this.atoms[E]) w[k] = this.atoms[E][k]; @@ -22010,14 +22026,14 @@ void main() { addAtomSpecs(l) { } static parseCrd(l, u) { - var g = [], p = 0; + var p = [], g = 0; if (u == "pdb") for (var b = l.indexOf(` ATOM`); b != -1; ) { for (; l.slice(b, b + 5) == ` ATOM` || l.slice(b, b + 7) == ` HETATM`; ) - g[p++] = parseFloat(l.slice(b + 31, b + 39)), g[p++] = parseFloat(l.slice(b + 39, b + 47)), g[p++] = parseFloat(l.slice(b + 47, b + 55)), b = l.indexOf(` + p[g++] = parseFloat(l.slice(b + 31, b + 39)), p[g++] = parseFloat(l.slice(b + 39, b + 47)), p[g++] = parseFloat(l.slice(b + 47, b + 55)), b = l.indexOf(` `, b + 54), l.slice(b, b + 4) == ` TER` && (b = l.indexOf(` `, b + 5)); @@ -22026,7 +22042,7 @@ ATOM`, b); } else if (u == "netcdf") { var c = new A.NetCDFReader(l); - g = [].concat.apply([], c.getDataVariable("coordinates")); + p = [].concat.apply([], c.getDataVariable("coordinates")); } else { if (u == "array" || Array.isArray(l)) return l.flat(2); @@ -22034,12 +22050,12 @@ ATOM`, b); let _ = l.indexOf(` `); u == "inpcrd" && (_ = l.indexOf(` -`, _ + 1)), l = l.slice(_ + 1), g = l.match(/\S+/g).map(parseFloat); +`, _ + 1)), l = l.slice(_ + 1), p = l.match(/\S+/g).map(parseFloat); } } - return g; + return p; } - static parseMolData(l, u = "", g) { + static parseMolData(l, u = "", p) { if (!l) return []; if (/\.gz$/.test(u)) { @@ -22051,7 +22067,7 @@ ATOM`, b); } } typeof y.Parsers[u] > "u" && (u = u.split(".").pop(), typeof y.Parsers[u] > "u" && (console.log("Unknown format: " + u), l instanceof Uint8Array ? u = "bcif" : l.match(/^@MOLECULE/gm) ? u = "mol2" : l.match(/^data_/gm) && l.match(/^loop_/gm) ? u = "cif" : l.match(/^HETATM/gm) || l.match(/^ATOM/gm) ? u = "pdb" : l.match(/ITEM: TIMESTEP/gm) ? u = "lammpstrj" : l.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm) ? u = "sdf" : l.match(/^%VERSION\s+VERSION_STAMP/gm) ? u = "prmtop" : u = "xyz", console.log("Best guess: " + u))); - var p = y.Parsers[u], b = p(l, g); + var g = y.Parsers[u], b = g(l, p); return b; } } @@ -22176,16 +22192,16 @@ ATOM`, b); */ static updateColor(m, l) { l = l || h.CC.color(l), m.colorsNeedUpdate = !0; - var u, g, p; - l.constructor !== Array && (u = l.r, g = l.g, p = l.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; for (let E = 0, w = c.vertices; E < w; ++E) { if (l.constructor === Array) { let k = l[E]; - u = k.r, g = k.g, p = k.b; + u = k.r, p = k.g, g = k.b; } - _[E * 3] = u, _[E * 3 + 1] = g, _[E * 3 + 2] = p; + _[E * 3] = u, _[E * 3 + 1] = p, _[E * 3 + 2] = g; } } } @@ -22198,34 +22214,34 @@ ATOM`, b); * spec */ static drawArrow(m, l, u) { - var g = u.start, p = u.end, b = u.radius, c = u.radiusRatio, _ = u.mid, E = u.midpos; - if (!(g && p)) + var p = u.start, g = u.end, b = u.radius, c = u.radiusRatio, _ = u.mid, E = u.midpos; + if (!(p && g)) return; - var w = l.updateGeoGroup(51), k = new s.Vector3(p.x, p.y, p.z).sub(g); + 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; } k.multiplyScalar(_); - var L = new s.Vector3(g.x, g.y, g.z).add(k), $ = k.clone().negate(); - let z = new s.Vector3(g.x, g.y, g.z); - m.intersectionShape.cylinder.push(new a.Cylinder(z, L.clone(), b)), m.intersectionShape.sphere.push(new a.Sphere(z, b)); - var O = []; - O[0] = k.clone(), Math.abs(O[0].x) > 1e-4 ? O[0].y += 1 : O[0].x += 1, O[0].cross(k), O[0].normalize(), O[4] = O[0].clone(), O[4].crossVectors(O[0], k), O[4].normalize(), O[8] = O[0].clone().negate(), O[12] = O[4].clone().negate(), O[2] = O[0].clone().add(O[4]).normalize(), O[6] = O[4].clone().add(O[8]).normalize(), O[10] = O[8].clone().add(O[12]).normalize(), O[14] = O[12].clone().add(O[0]).normalize(), O[1] = O[0].clone().add(O[2]).normalize(), O[3] = O[2].clone().add(O[4]).normalize(), O[5] = O[4].clone().add(O[6]).normalize(), O[7] = O[6].clone().add(O[8]).normalize(), O[9] = O[8].clone().add(O[10]).normalize(), O[11] = O[10].clone().add(O[12]).normalize(), O[13] = O[12].clone().add(O[14]).normalize(), O[15] = O[14].clone().add(O[0]).normalize(); + 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)); + 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 = O.length; V < G; ++V) { + for (V = 0, G = F.length; V < G; ++V) { W = 3 * (R + 3 * V); - var H = O[V].clone().multiplyScalar(b).add(g), Q = O[V].clone().multiplyScalar(b).add(L), te = O[V].clone().multiplyScalar(b * c).add(L); + 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(p.x, p.y, p.z), Ae = L.clone(), Se = new s.Vector3(te.x, te.y, te.z); + 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())); } } - w.vertices += 48, W = w.vertices * 3, P[W] = g.x, P[W + 1] = g.y, P[W + 2] = g.z, P[W + 3] = L.x, P[W + 4] = L.y, P[W + 5] = L.z, P[W + 6] = p.x, P[W + 7] = p.y, P[W + 8] = p.z, w.vertices += 3; - var Ie, pe, le, ne, Te, Fe, 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 = O.length - 1; V < G; ++V) { + 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, Fe = xe + 2, Re = Fe * 3, Be = xe + 4, De = Be * 3, Ue = xe + 5, je = Ue * 3, Pe = xe + 3, Xe = Pe * 3, X = q = O[V], re = ye = O[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] = Fe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Fe, 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] = Fe, B[le + 9] = Te, B[le + 10] = Fe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Fe, B[le + 15] = ke, B[le + 16] = Fe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20; + 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; } Ie = [ R + 45, @@ -22234,7 +22250,7 @@ ATOM`, b); R, R + 47, R + 2 - ], pe = w.faceidx, le = w.lineidx, ne = Ie[0], Ge = ne * 3, Te = Ie[1], Ne = Te * 3, Fe = Ie[4], Re = Fe * 3, Be = Ie[2], De = Be * 3, Ue = Ie[5], je = Ue * 3, Pe = Ie[3], Xe = Pe * 3, X = q = O[15], re = ye = O[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(), $.normalize(), N[K] = $.x, N[ae] = N[ge] = k.x, N[K + 1] = $.y, N[ae + 1] = N[ge + 1] = k.y, N[K + 2] = $.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] = Fe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Fe, 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] = Fe, B[le + 9] = Te, B[le + 10] = Fe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Fe, B[le + 15] = ke, B[le + 16] = Fe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20; + ], 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; } // Update a bounding sphere's position and radius // from list of centroids and new points @@ -22247,30 +22263,30 @@ ATOM`, b); * points, flat array of all points in shape * @param {int} numPoints, number of valid poitns in points */ - static updateBoundingFromPoints(m, l, u, g) { + static updateBoundingFromPoints(m, l, u, p) { m.center.set(0, 0, 0); - let p = 1 / 0, b = 1 / 0, c = 1 / 0, _ = -1 / 0, E = -1 / 0, w = -1 / 0; - m.box && (p = 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, O = g; z < O; z++) { - var k = u[z * 3], L = u[z * 3 + 1], $ = u[z * 3 + 2]; - k < p && (p = k), L < b && (b = L), $ < c && (c = $), k > _ && (_ = k), L > E && (E = L), $ > w && (w = $); + 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); } - m.center.set((_ + p) / 2, (E + b) / 2, (w + c) / 2), m.radius = m.center.distanceTo({ x: _, y: E, z: w }), m.box = { min: { x: p, y: b, z: c }, max: { x: _, y: E, z: w } }; + 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 } }; } //helper function for adding an appropriately sized mesh - static addCustomGeo(m, l, u, g, p) { + static addCustomGeo(m, l, u, p, g) { var b = l.addGeoGroup(), c = u.vertexArr, _ = u.normalArr, E = u.faceArr; b.vertices = c.length, b.faceidx = E.length; - var w, k, L, $, z, O, R, P, U, N = b.vertexArray, B = b.colorArray; - for (g.constructor !== Array && (P = g.r, U = g.g, $ = g.b), O = 0, R = b.vertices; O < R; ++O) - w = O * 3, k = c[O], N[w] = k.x, N[w + 1] = k.y, N[w + 2] = k.z, g.constructor === Array && (z = g[O], P = z.r, U = z.g, $ = z.b), B[w] = P, B[w + 1] = U, B[w + 2] = $; - if (p) - for (O = 0, R = b.faceidx / 3; O < R; ++O) { - w = O * 3, L = E[w], $ = E[w + 1], z = E[w + 2]; + 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; + 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[L]), V.copy(c[$]), G.copy(c[z]))); + m.intersectionShape.triangle.push(new a.Triangle(W.copy(c[$]), V.copy(c[L]), G.copy(c[z]))); } - if (p) { + 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++; @@ -22280,8 +22296,8 @@ ATOM`, b); b.setNormals(); else { var te = b.normalArray = new Float32Array(b.vertices * 3), ee; - for (O = 0, R = b.vertices; O < R; ++O) - w = O * 3, ee = _[O], te[w] = ee.x, te[w + 1] = ee.y, te[w + 2] = ee.z; + 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; } b.setLineIndices(), b.lineidx = b.lineArray.length; } @@ -22323,10 +22339,10 @@ ATOM`, b); this.stylespec[l] = m[l]; if (A.updateFromStyle(this, this.stylespec), m.voldata && m.volscheme) { (0, y.adjustVolumeStyle)(m); - const u = m.volscheme, g = m.voldata, p = h.CC, b = u.range() || [-1, 1]; + const u = m.volscheme, p = m.voldata, g = h.CC, b = u.range() || [-1, 1]; this.geo.setColors(function(c, _, E) { - let w = g.getVal(c, _, E); - return p.color(u.valueToHex(w, b)); + let w = p.getVal(c, _, E); + return g.color(u.valueToHex(w, b)); }), delete this.color; } } @@ -22369,37 +22385,37 @@ ATOM`, b); addBox(m) { var l = m.dimensions || { w: 1, h: 1, d: 1 }, u; typeof l.w == "number" ? u = { x: l.w, y: 0, z: 0 } : u = l.w; - var g; - typeof l.h == "number" ? g = { x: 0, y: l.h, z: 0 } : g = l.h; var p; - typeof l.d == "number" ? p = { x: 0, y: 0, z: l.d } : p = l.d; + typeof l.h == "number" ? p = { x: 0, y: l.h, z: 0 } : p = l.h; + var g; + typeof l.d == "number" ? g = { x: 0, y: 0, z: l.d } : g = l.d; var b = m.corner; b == null && (m.center !== void 0 ? b = { - x: m.center.x - 0.5 * (u.x + g.x + p.x), - y: m.center.y - 0.5 * (u.y + g.y + p.y), - z: m.center.z - 0.5 * (u.z + g.z + p.z) + x: m.center.x - 0.5 * (u.x + p.x + g.x), + y: m.center.y - 0.5 * (u.y + p.y + g.y), + z: m.center.z - 0.5 * (u.z + p.z + g.z) } : b = { x: 0, y: 0, z: 0 }); var c = [ { x: b.x, y: b.y, z: b.z }, { x: b.x + u.x, y: b.y + u.y, z: b.z + u.z }, - { x: b.x + g.x, y: b.y + g.y, z: b.z + g.z }, - { 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, y: b.y + p.y, z: b.z + p.z }, { x: b.x + u.x + p.x, y: b.y + u.y + p.y, z: b.z + u.z + p.z }, - { x: b.x + g.x + p.x, y: b.y + g.y + p.y, z: b.z + g.z + p.z }, - { x: b.x + u.x + g.x + p.x, y: b.y + u.y + g.y + p.y, z: b.z + u.z + g.z + p.z } + { x: b.x + g.x, y: b.y + g.y, z: b.z + g.z }, + { 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); 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; var k = (0, y.extend)({}, m); k.vertexArr = _, k.faceArr = E, k.normalArr = [], A.drawCustom(this, this.geo, k); - var L = new s.Vector3(); + var $ = new s.Vector3(); this.components.push({ - centroid: L.addVectors(c[0], c[7]).multiplyScalar(0.5) + centroid: $.addVectors(c[0], c[7]).multiplyScalar(0.5) }); - var $ = this.geo.updateGeoGroup(0); - A.updateBoundingFromPoints(this.boundingSphere, this.components, $.vertexArray, $.vertices); + var L = this.geo.updateGeoGroup(0); + A.updateBoundingFromPoints(this.boundingSphere, this.components, L.vertexArray, L.vertices); } /** * Creates a cylinder shape @@ -22434,8 +22450,8 @@ ATOM`, b); addCylinder(m) { 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 g = m.radius || 0.1, p = h.CC.color(m.color); - this.intersectionShape.cylinder.push(new a.Cylinder(l, u, g)), v.GLDraw.drawCylinder(this.geo, l, u, g, p, m.fromCap, m.toCap); + 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); var b = new s.Vector3(); this.components.push({ centroid: b.addVectors(l, u).multiplyScalar(0.5) @@ -22453,11 +22469,11 @@ 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 g = m.radius || 0.1, p = 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)), L = 0; L < c; L++) - E = new s.Vector3(_.x + k.x, _.y + k.y, _.z + k.z), this.intersectionShape.cylinder.push(new a.Cylinder(_, E, g)), v.GLDraw.drawCylinder(this.geo, _, E, g, p, m.fromCap, m.toCap), _ = new s.Vector3(E.x + w.x, E.y + w.y, E.z + w.z); - var $ = new s.Vector3(); + 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); + var L = new s.Vector3(); this.components.push({ - centroid: $.addVectors(l, u).multiplyScalar(0.5) + centroid: L.addVectors(l, u).multiplyScalar(0.5) }); var z = this.geo.updateGeoGroup(0); A.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices); @@ -22473,30 +22489,30 @@ ATOM`, b); console.log("Too few points in addCurve"); return; } - var u = m.radius || 0.1, g = h.CC.color(m.color), p = 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]), _ = Math.ceil(2 * u / c); if (m.toArrow) { b -= _; - let L = { + let $ = { start: l[b], end: l[l.length - 1], radius: u, - color: g, + color: p, mid: 1e-4 }; - this.addArrow(L); + this.addArrow($); } if (m.fromArrow) { - p += _; - let L = { - start: l[p], + g += _; + let $ = { + start: l[g], end: l[0], radius: u, - color: g, + color: p, mid: 1e-4 }; - this.addArrow(L); + this.addArrow($); } - for (var E = Math.ceil(l.length / 2), w = { radius: u, color: g, fromCap: 2, toCap: 2 }, k = p; k < b; k++) + for (var E = Math.ceil(l.length / 2), w = { radius: u, color: p, fromCap: 2, toCap: 2 }, k = g; k < b; k++) w.start = l[k], w.end = l[k + 1], w.fromCap = 2, w.toCap = 2, k < E ? (w.fromCap = 2, w.toCap = 0) : k > E ? (w.fromCap = 0, w.toCap = 2) : (w.fromCap = 2, w.toCap = 2), this.addCylinder(w); } /** @@ -22512,14 +22528,14 @@ ATOM`, b); addLine(m) { 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(3, 0, 0); - var g = this.geo.updateGeoGroup(2), p = g.vertices, b = p * 3, c = g.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, g.vertices += 2; - var _ = g.lineArray, E = g.lineidx; - _[E] = p, _[E + 1] = p + 1, g.lineidx += 2; + 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 w = new s.Vector3(); this.components.push({ centroid: w.addVectors(l, u).multiplyScalar(0.5) - }), g = this.geo.updateGeoGroup(0), A.updateBoundingFromPoints(this.boundingSphere, this.components, g.vertexArray, g.vertices); + }), p = this.geo.updateGeoGroup(0), A.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); } /** * Creates an arrow shape @@ -22552,15 +22568,15 @@ ATOM`, b); this.components.push({ centroid: u.addVectors(m.start, m.end).multiplyScalar(0.5) }); - var g = this.geo.updateGeoGroup(0); - A.updateBoundingFromPoints(this.boundingSphere, this.components, g.vertexArray, g.vertices); + var p = this.geo.updateGeoGroup(0); + A.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); } static distance_from(m, l) { return Math.sqrt(Math.pow(m.x - l.x, 2) + Math.pow(m.y - l.y, 2) + Math.pow(m.z - l.z, 2)); } static inSelectedRegion(m, l, u) { - for (var g = 0; g < l.length; g++) - if (A.distance_from(l[g], m) <= u) + for (var p = 0; p < l.length; p++) + if (A.distance_from(l[p], m) <= u) return !0; return !1; } @@ -22591,17 +22607,17 @@ ATOM`, b); viewer.render(); }); */ - addIsosurface(m, l, u, g) { - var p = 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), L = m.data, $, z; - for ($ = 0, z = k.length; $ < z; ++$) - k[$] = -1; - var O = new Uint8Array(_ * E * w); - for ($ = 0, z = L.length; $ < z; ++$) { - var R = p >= 0 ? L[$] - p : p - L[$]; - R > 0 && (O[$] |= A.ISDONE); + 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) + 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 P = [], U = []; - o.MarchingCube.march(O, P, U, { + o.MarchingCube.march(F, P, U, { fulltable: !0, voxel: b, unitCube: m.unit, @@ -22612,7 +22628,7 @@ ATOM`, b); nZ: w }), !b && c > 0 && o.MarchingCube.laplacianSmooth(c, P, U); var N = [], B = [], W = []; - if (l.selectedRegion && l.coords === void 0 && (l.coords = l.selectedRegion), l.coords === void 0 && l.selection !== void 0 && (g ? l.coords = g.selectedAtoms(l.selection) : console.log("addIsosurface needs viewer is selection provided.")), l.coords !== void 0) { + 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); @@ -22678,11 +22694,11 @@ ATOM`, b); }); var u = new r.Mesh(this.geo, l); if (this.shapeObj.add(u), this.linegeo && this.linegeo.vertices > 0) { - var g = new r.LineBasicMaterial({ + var p = new r.LineBasicMaterial({ linewidth: this.linewidth, color: this.color - }), p = new r.Line(this.linegeo, g, r.LineStyle.LinePieces); - this.shapeObj.add(p); + }), g = new r.Line(this.linegeo, p, r.LineStyle.LinePieces); + this.shapeObj.add(g); } this.renderedShapeObj = this.shapeObj.clone(), m.add(this.renderedShapeObj); } @@ -22704,8 +22720,8 @@ ATOM`, b); } } A.ISDONE = 2, A.drawCustom = function(M, m, l) { - var u = l, g = u.vertexArr, p = u.faceArr; - (g.length === 0 || p.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"); + var u = l, p = u.vertexArr, g = u.faceArr; + (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; _++) @@ -22717,14 +22733,14 @@ ATOM`, b); return [M]; var l = [{ vertexArr: [], normalArr: [], faceArr: [] }]; M.colorArr && (l.colorArr = []); - var u = [], g = [], p = 0, b = M.faceArr; + var u = [], p = [], g = 0, b = M.faceArr; for (let _ = 0, E = b.length; _ < E; _ += 3) { - let w = l[p]; + let w = l[g]; for (let k = 0; k < 3; k++) { var c = b[_ + k]; - u[c] !== p && (u[c] = p, g[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(g[c]); + 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 = []), p++); + w.vertexArr.length >= m && (l.push({ vertexArr: [], normalArr: [], faceArr: [] }), M.colorArr && (l.colorArr = []), g++); } return l; } @@ -22751,7 +22767,7 @@ ATOM`, b); /* harmony export */ createStereoViewer: () => ( /* binding */ - p + g ), /* harmony export */ createViewer: () => ( @@ -22761,7 +22777,7 @@ ATOM`, b); /* harmony export */ createViewerGrid: () => ( /* binding */ - g + p ) /* harmony export */ }); @@ -22897,13 +22913,13 @@ ATOM`, b); clickable: !0 }), k = E.selectedAtoms({ hoverable: !0 - }), L = E.selectedAtoms({ contextMenuEnabled: !0 }); - for (let $ = 0; $ < k.length; $++) - this.hoverables.push(k[$]); - for (let $ = 0; $ < w.length; $++) - this.clickables.push(w[$]); - for (let $ = 0; $ < L.length; $++) - this.contextMenuEnabledObjects.push(L[$]); + }), $ = E.selectedAtoms({ contextMenuEnabled: !0 }); + for (let L = 0; L < k.length; L++) + this.hoverables.push(k[L]); + for (let L = 0; L < w.length; L++) + this.clickables.push(w[L]); + for (let L = 0; L < $.length; L++) + this.contextMenuEnabledObjects.push($[L]); } } for (let c = 0, _ = this.shapes.length; c < _; c++) { @@ -22956,8 +22972,8 @@ ATOM`, b); closeEnoughForClick(c, { allowTolerance: _ = c.targetTouches, tolerance: E = 5 } = {}) { const w = this.getX(c), k = this.getY(c); if (_) { - const L = Math.abs(w - this.mouseStartX), $ = Math.abs(k - this.mouseStartY); - return L <= E && $ <= E; + const $ = Math.abs(w - this.mouseStartX), L = Math.abs(k - this.mouseStartY); + return $ <= E && L <= E; } else return w === this.mouseStartX && k === this.mouseStartY; } @@ -22977,8 +22993,8 @@ ATOM`, b); //for grid viewers, return true if point is in this viewer isInViewer(c, _) { if (this.viewers != null) { - var E = this.WIDTH / this.cols, w = this.HEIGHT / this.rows, k = this.canvasOffset(), L = c - k.left, $ = _ - k.top, z = this.rows - Math.floor($ / w) - 1, O = Math.floor(L / E); - if (z != this.row || O != this.col) + 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) return !1; } return !0; @@ -23009,9 +23025,9 @@ ATOM`, b); return P.normalize(), P; } w < 0 && (_ = _.clone().multiplyScalar(-1), w = -w), w > 1 ? w = 1 : w < -1 && (w = -1); - var k = Math.acos(w), L = k * E, $ = _.clone(); - $.sub(c.clone().multiplyScalar(w)), $.normalize(); - var z = Math.cos(L), O = Math.sin(L), R = new a.Quaternion(c.x * z + $.x * O, c.y * z + $.y * O, c.z * z + $.z * O, c.w * z + $.w * O); + var k = Math.acos(w), $ = k * E, L = _.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; } /* @param {Object} element HTML element within which to create viewer @@ -23020,8 +23036,8 @@ ATOM`, b); 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") { let E = (w, k) => { - w.forEach((L) => { - L.isIntersecting && this.resize(); + w.forEach(($) => { + $.isIntersecting && this.resize(); }); }; this.intwatcher = new window.IntersectionObserver(E), this.intwatcher.observe(this.container); @@ -23054,13 +23070,13 @@ ATOM`, b); modelToScreen(c) { let _ = !1; Array.isArray(c) || (c = [c], _ = !0); - let E = this.renderer.getXRatio(), w = this.renderer.getYRatio(), k = this.col, L = this.row, $ = k * (this.WIDTH / E), z = (w - L - 1) * (this.HEIGHT / w), O = [], R = this.canvasOffset(); + 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 + $, B = -(this.HEIGHT / w) * (U.y - 1) / 2 + R.top + z; - O.push({ x: N, y: B }); - }), _ && (O = O[0]), O; + 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; } /** * For a given screen (x,y) displacement return model displacement @@ -23069,8 +23085,8 @@ ATOM`, b); * @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, L = E === void 0 ? this.rotationGroup.position.z : E, $ = this.rotationGroup.quaternion, z = new a.Vector3(0, 0, L); - 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($), z; + 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; } /** * Distance from screen coordinate to model coordinate assuming screen point @@ -23083,8 +23099,8 @@ ATOM`, b); w.applyMatrix4(this.modelGroup.matrixWorld); let k = w.clone(); this.projector.projectVector(w, this.camera); - let L = new a.Vector3((c.x - E.left) * 2 / this.WIDTH - 1, (c.y - E.top) * 2 / -this.HEIGHT + 1, w.z); - return this.projector.unprojectVector(L, this.camera), L.distanceTo(k); + let $ = new a.Vector3((c.x - E.left) * 2 / this.WIDTH - 1, (c.y - E.top) * 2 / -this.HEIGHT + 1, w.z); + return this.projector.unprojectVector($, this.camera), $.distanceTo(k); } /** * Set a callback to call when the view has potentially changed. @@ -23184,8 +23200,8 @@ ATOM`, b); c.targetTouches && c.targetTouches.length === 1 && (this.longTouchTimeout = setTimeout(function() { if (w.touchHold == !0) { w.glDOM = w.renderer.domElement; - const k = c.targetTouches[0], L = new PointerEvent("contextmenu", Object.assign(Object.assign({}, c), { pageX: k.pageX, pageY: k.pageY, screenX: k.screenX, screenY: k.screenY, clientX: k.clientX, clientY: k.clientY })); - w.glDOM.dispatchEvent(L); + const k = c.targetTouches[0], $ = new PointerEvent("contextmenu", Object.assign(Object.assign({}, c), { pageX: k.pageX, pageY: k.pageY, screenX: k.screenX, screenY: k.screenY, clientX: k.clientX, clientY: k.clientY })); + w.glDOM.dispatchEvent($); } }, this.longTouchDuration)); } @@ -23207,8 +23223,8 @@ ATOM`, b); if (c.ctrlKey && (k = -1), c.detail) this.rotationGroup.position.z += k * w * c.detail / 10; else if (c.wheelDelta) { - let L = c.wheelDelta * 600 / (c.wheelDelta + 600); - this.rotationGroup.position.z -= k * w * L / 400; + let $ = c.wheelDelta * 600 / (c.wheelDelta + 600); + this.rotationGroup.position.z -= k * w * $ / 400; } this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show(); } @@ -23228,19 +23244,19 @@ ATOM`, b); apngURI(c) { let _ = this; return c = c || 1, new Promise(function(E) { - let w = 0, k = _.viewChangeCallback, L = [], $ = [], z = Date.now(); + let w = 0, k = _.viewChangeCallback, $ = [], L = [], z = Date.now(); _.viewChangeCallback = function() { - $.push(Date.now() - z), z = Date.now(), L.push(new Promise((O) => { + L.push(Date.now() - z), z = Date.now(), $.push(new Promise((F) => { _.getCanvas().toBlob(function(R) { - R.arrayBuffer().then(O); + R.arrayBuffer().then(F); }, "image/png"); - })), w += 1, w == c && (_.viewChangeCallback = k, Promise.all(L).then((O) => { + })), w += 1, w == c && (_.viewChangeCallback = k, Promise.all($).then((F) => { let R = []; - for (let V = 0; V < O.length; V++) { - let G = (0, M.decode)(O[V]); + for (let V = 0; V < F.length; V++) { + let G = (0, M.decode)(F[V]); R.push((0, M.toRGBA8)(G)[0]); } - let P = _.getCanvas().width, U = _.getCanvas().height, N = (0, M.encode)(R, P, U, 0, $), B = new Blob([N], { type: "image/png" }), W = new FileReader(); + 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); @@ -23272,7 +23288,7 @@ ATOM`, b); this.hoverDuration = c; } mouseXY(c, _) { - let E = this.canvasOffset(), w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), L = this.col, $ = this.row, z = L * (this.WIDTH / w), O = (k - $ - 1) * (this.HEIGHT / k), R = (c - E.left - z) / (this.WIDTH / w) * 2 - 1, P = -((_ - E.top - O) / (this.HEIGHT / k)) * 2 + 1; + 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 }; } _handleMouseMove(c) { @@ -23280,22 +23296,22 @@ ATOM`, b); let _ = this.getX(c), E = this.getY(c); if (_ === void 0) return; - let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), L = this.mouseXY(_, E), $ = this; - this.current_hover !== null && this.handleHoverContinue(L.x, L.y); + let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.mouseXY(_, 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() { - $.handleHoverSelection(L.x, L.y, c); + 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 O = (_ - this.mouseStartX) / this.WIDTH, R = (E - this.mouseStartY) / this.HEIGHT; + var F = (_ - this.mouseStartX) / this.WIDTH, R = (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); - O *= w, R *= k; - var U = Math.hypot(O, R), N; + F *= w, R *= k; + var U = Math.hypot(F, R), N; if (z == 3 || this.mouseButton == 3 && c.ctrlKey) - this.slabNear = this.cslabNear + O * 100, this.slabFar = this.cslabFar - R * 100; + 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) { @@ -23303,7 +23319,7 @@ ATOM`, b); 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 * O, 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); + 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); } this.show(); } @@ -23311,11 +23327,11 @@ ATOM`, b); _handleContextMenu(c) { if (c.preventDefault(), this.closeEnoughForClick(c)) { var w = this.mouseStartX, k = this.mouseStartY, E = this.canvasOffset(); - let L = this.mouseXY(w, k), $ = L.x, z = L.y, O = this.targetedObjects($, z, this.contextMenuEnabledObjects); + let $ = this.mouseXY(w, k), L = $.x, z = $.y, F = this.targetedObjects(L, z, this.contextMenuEnabledObjects); var _ = null; - O.length && (_ = O[0].clickable); + F.length && (_ = F[0].clickable); var E = this.canvasOffset(), w = this.mouseStartX - E.left, k = this.mouseStartY - E.top; - this.userContextMenuHandler && (this.userContextMenuHandler(_, w, k, O, c), this.isDragging = !1); + this.userContextMenuHandler && (this.userContextMenuHandler(_, w, k, F, c), this.isDragging = !1); } } /** @@ -23430,7 +23446,7 @@ ATOM`, b); let _ = this.renderer.supportedExtensions(); if (_.regen = !0, this.viewers) for (let E = 0, w = this.viewers.length; E < w; E++) - for (let k = 0, L = this.viewers[E].length; k < L; k++) + for (let k = 0, $ = this.viewers[E].length; k < $; k++) this.viewers[E][k].render(null, _); this._viewer.render(null, _); } else @@ -23492,10 +23508,10 @@ 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, L) { - var $ = 20, z = Math.ceil(c / $); + animateMotion(c, _, E, w, k, $) { + var L = 20, z = Math.ceil(c / L); z < 1 && (z = 1), this.incAnim(); - var O = { + var F = { mpos: this.modelGroup.position.clone(), rz: this.rotationGroup.position.z, rot: this.rotationGroup.quaternion.clone(), @@ -23504,26 +23520,26 @@ ATOM`, b); if (_) { let U = new Array(z); for (let V = 0; V < z; V++) { - let G = (V + 1) / z, H = { mpos: O.mpos, rz: O.rz, rot: O.rot }; - H.mpos = E.clone().sub(O.mpos).multiplyScalar(G).add(O.mpos), H.rz = O.rz + G * (w - O.rz), H.rot = l.slerp(O.rot, k, G), H.cam = L.clone().sub(O.cam).multiplyScalar(G).add(O.cam), U[V] = H; + 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; } 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, $) : B.decAnim(), B.show(); + 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(); }; - setTimeout(W, $); + setTimeout(W, L); } else { var R = {}; let U = 1 / z; - if (E && (R.mpos = E.clone().sub(O.mpos).multiplyScalar(U)), typeof w < "u" && w != null && (R.rz = U * (w - O.rz)), k) { - var P = l.slerp(O.rot, k, U); - R.rot = O.rot.clone().inverse().multiply(P); + 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); } - L && (R.cam = L.clone().sub(O.cam).multiplyScalar(U)); + $ && (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, $) : B.decAnim(), B.show(); + 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(); }; - setTimeout(W, $); + setTimeout(W, L); } } /** @@ -23554,13 +23570,13 @@ ATOM`, b); var k = new a.Vector3(_.vx, _.vy, _.vz); k.applyQuaternion(this.rotationGroup.quaternion), _ = { x: k.x, y: k.y, z: k.z }; } - var L = function(R) { + 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(); - }, $ = Math.PI * c / 180, z = L($); + }, L = Math.PI * c / 180, z = $(L); if (E) { - var O = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(z); - this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, O, this.lookingAt); + var F = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(z); + this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, F, this.lookingAt); } else this.rotationGroup.quaternion.multiply(z), this.show(); return this; @@ -23615,22 +23631,22 @@ ATOM`, b); _.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 L = this.surfaces[w]; - for (k = 0; k < L.length; k++) - if (L.hasOwnProperty(k)) { - var $ = L[k].geo; - if (!L[k].finished || _.regen) { - $.verticesNeedUpdate = !0, $.elementsNeedUpdate = !0, $.normalsNeedUpdate = !0, $.colorsNeedUpdate = !0, $.buffersNeedUpdate = !0, L[k].mat.needsUpdate = !0, L[k].done && (L[k].finished = !0), L[k].lastGL && this.modelGroup.remove(L[k].lastGL); + var $ = this.surfaces[w]; + for (k = 0; k < $.length; k++) + if ($.hasOwnProperty(k)) { + var L = $[k].geo; + if (!$[k].finished || _.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 (L[k].mat instanceof r.LineBasicMaterial ? z = new r.Line($, L[k].mat) : z = new r.Mesh($, L[k].mat), L[k].mat.transparent && L[k].mat.opacity == 0 ? z.visible = !1 : z.visible = !0, L[k].symmetries.length > 1 || L[k].symmetries.length == 1 && !L[k].symmetries[k].isIdentity()) { - var O, R = new r.Object3D(); - for (O = 0; O < L[k].symmetries.length; O++) { + 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(); + for (F = 0; F < $[k].symmetries.length; F++) { var P = z.clone(); - P.matrix = L[k].symmetries[O], P.matrixAutoUpdate = !1, R.add(P); + P.matrix = $[k].symmetries[F], P.matrixAutoUpdate = !1, R.add(P); } - L[k].lastGL = R, this.modelGroup.add(R); + $[k].lastGL = R, this.modelGroup.add(R); } else - L[k].lastGL = z, this.modelGroup.add(z); + $[k].lastGL = z, this.modelGroup.add(z); } } } @@ -23705,8 +23721,8 @@ ATOM`, b); var E = this.getAtomsFromSel(_), w = {}; for (var k in E) if (E[k].hasOwnProperty(c)) { - var L = E[k][c]; - w[L] = !0; + var $ = E[k][c]; + w[$] = !0; } return Object.keys(w); } @@ -23768,9 +23784,9 @@ ATOM`, b); }); */ translate(c, _, E = 0, w = !1) { - var k = c / this.WIDTH, L = _ / this.HEIGHT, $ = new a.Vector3(0, 0, -this.CAMERA_Z); - this.projector.projectVector($, this.camera), $.x -= k, $.y -= L, this.projector.unprojectVector($, this.camera), $.z = 0; - var z = this.lookingAt.clone().add($); + var k = c / this.WIDTH, $ = _ / 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; } /** @@ -23795,8 +23811,8 @@ ATOM`, b); }); */ translateScene(c, _, E = 0, w = !1) { - var k = this.screenOffsetToModel(c, _), L = 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 = L, this.show()), this; + var k = this.screenOffsetToModel(c, _), $ = 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; } /** * Adjust slab to fully enclose selection (default everything). @@ -23807,8 +23823,8 @@ 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], L = E[1][2] - E[0][2], $ = Math.hypot(w, k, L); - return $ < 5 && ($ = 5), this.slabNear = -$ / 1.9, this.slabFar = $ / 2, this; + 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, $); + return L < 5 && (L = 5), this.slabNear = -L / 1.9, this.slabFar = L / 2, this; } /** * Re-center the viewer around the provided selection (unlike zoomTo, does not zoom). @@ -23835,18 +23851,18 @@ ATOM`, b); }); */ center(c = {}, _ = 0, E = !1) { - var w, k, L = this.getAtomsFromSel(c), $ = (0, h.getExtent)(L); + 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 ? (L.push(new a.Vector3(H.x + Q, H.y, H.z)), L.push(new a.Vector3(H.x - Q, H.y, H.z)), L.push(new a.Vector3(H.x, H.y + Q, H.z)), L.push(new a.Vector3(H.x, H.y - Q, H.z)), L.push(new a.Vector3(H.x, H.y, H.z + Q)), L.push(new a.Vector3(H.x, H.y, H.z - Q))) : L.push(H); + 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.getExtent)(L), w = L, k = $) : (w = this.getAtomsFromSel({}), k = (0, h.getExtent)(w)); - var z = new a.Vector3($[2][0], $[2][1], $[2][2]), O = k[1][0] - k[0][0], R = k[1][1] - k[0][1], P = k[1][2] - k[0][2], U = Math.hypot(O, R, P); - U < 5 && (U = 5), this.slabNear = -U / 1.9, this.slabFar = U / 2, O = $[1][0] - $[0][0], R = $[1][1] - $[0][1], P = $[1][2] - $[0][2], U = Math.hypot(O, R, P), U < 5 && (U = 5); - for (var N = 25, B = 0; B < L.length; B++) - if (L[B]) { - var W = z.distanceToSquared(L[B]); + }), 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); } U = Math.sqrt(N) * 2; @@ -23883,7 +23899,7 @@ ATOM`, b); }); */ zoomTo(c = {}, _ = 0, E = !1) { - let w = this.getAtomsFromSel(c), k = (0, h.getExtent)(w), L = k; + 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) => { @@ -23896,24 +23912,24 @@ ATOM`, b); 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); } } - }), L = (0, h.getExtent)(w), !H) + }), $ = (0, h.getExtent)(w), !H) for (let Q = 0; Q < 3; Q++) - k[2][Q] = (L[0][Q] + L[1][Q]) / 2; + k[2][Q] = ($[0][Q] + $[1][Q]) / 2; } else { let H = this.getAtomsFromSel({}); - L = (0, h.getExtent)(H); + $ = (0, h.getExtent)(H); } - var $ = new a.Vector3(k[2][0], k[2][1], k[2][2]), z = L[1][0] - L[0][0], O = L[1][1] - L[0][1], R = L[1][2] - L[0][2], P = Math.hypot(z, O, R); + 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], O = k[1][1] - k[0][1], R = k[1][2] - k[0][2], P = Math.hypot(z, O, R), P < U && (P = U); + 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 = $.distanceToSquared(w[B]); + var W = L.distanceToSquared(w[B]); W > N && (N = W); } P = Math.sqrt(N) * 2; - var V = $.clone().multiplyScalar(-1), G = -(P * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); + 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; } /** @@ -23979,8 +23995,8 @@ ATOM`, b); var k = (0, h.getExtent)(this.getAtomsFromSel(E)); _.position = { x: k[2][0], y: k[2][1], z: k[2][2] }; } - var L = new v.Label(c, _); - return L.setContext(), this.modelGroup.add(L.sprite), this.labels.push(L), w || this.show(), L; + var $ = new v.Label(c, _); + return $.setContext(), this.modelGroup.add($.sprite), this.labels.push($), w || this.show(), $; } /** Add residue labels. This will generate one label per a * residue within the selected atoms. The label will be at the @@ -24312,10 +24328,10 @@ ATOM`, b); if (E.matrix) w = E.matrix; else { - var k = E.a, L = E.b, $ = E.c, z = E.alpha, O = E.beta, R = E.gamma; - z = z * Math.PI / 180, O = O * Math.PI / 180, R = R * Math.PI / 180; + 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(O), U = (Math.cos(z) - Math.cos(O) * Math.cos(R)) / Math.sin(R), N = Math.sqrt(Math.max(0, 1 - P * P - U * U)), w = new a.Matrix3(k, L * Math.cos(R), $ * P, 0, L * Math.sin(R), $ * U, 0, 0, $ * 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 B = [ new a.Vector3(0, 0, 0), @@ -24415,20 +24431,20 @@ ATOM`, b); viewer.render(); }); */ - replicateUnitCell(c = 3, _ = c, E = _, w, k, L) { + replicateUnitCell(c = 3, _ = c, E = _, w, k, $) { w = this.getModel(w); - let $ = w.getCrystData(); - if ($) { - const z = w.selectedAtoms({}), O = $.matrix; + 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); }; - c <= 1 && _ <= 1 && E <= 1 && (L = !0, c = _ = E = 3); + c <= 1 && _ <= 1 && E <= 1 && ($ = !0, c = _ = E = 3); let P = function(U, N, B) { return !1; }; - if (L) { - const U = new a.Matrix3().getInverse3(O); + 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); @@ -24440,7 +24456,7 @@ ATOM`, b); if (U == 0 && N == 0 && B == 0) continue; let W = new a.Vector3(R(U), R(N), R(B)); - W.applyMatrix3(O); + 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; @@ -24463,13 +24479,13 @@ ATOM`, b); 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(), L = new a.Vector3(), $ = new a.Vector3(), z, O, R, P = E.clone(), U = 0; - for (k.subVectors(w, E), z = k.length(), k.normalize(), L = k.clone(), $ = k.clone(), L.multiplyScalar(c.dashLength), $.multiplyScalar(c.gapLength), O = L.length(), R = $.length(); U < z; ) { - if (U + O > z) { + 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); break; } - P.addVectors(E, L), c.start = E, c.end = P, _.addLine(c), E = P.clone(), U += O, P.addVectors(E, $), E = P.clone(), U += R; + 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; } return _.finalize(), _; } @@ -24637,27 +24653,27 @@ ATOM`, b); 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 k = this.getNumFrames(), L = this, $ = 0; - c.startFrame && ($ = c.startFrame % k); + var k = this.getNumFrames(), $ = this, L = 0; + c.startFrame && (L = c.startFrame % k); var z = 1; c.step && (z = c.step, w /= z); - var O = 0, R = k * w, P = /* @__PURE__ */ new Date(), U, N, B = function(W) { - P = /* @__PURE__ */ new Date(), W == "forward" ? L.setFrame($).then(function() { - $ = ($ + z) % k, U(); - }) : W == "backward" ? L.setFrame(k - 1 - $).then(function() { - $ = ($ + z) % k, U(); - }) : L.setFrame($).then(function() { - $ += z, z *= $ % (k - 1) == 0 ? -1 : 1, U(); + 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(); + }) : W == "backward" ? $.setFrame(k - 1 - L).then(function() { + L = (L + z) % k, U(); + }) : $.setFrame(L).then(function() { + L += z, z *= L % (k - 1) == 0 ? -1 : 1, U(); }); }; return U = function() { - if (L.render(), !L.getCanvas().isConnected) - L.stopAnimate(); - else if (++O >= R || !L.isAnimated()) - N.cancel(), L.animationTimers.delete(N), L.decAnim(); + if ($.render(), !$.getCanvas().isConnected) + $.stopAnimate(); + else if (++F >= R || !$.isAnimated()) + N.cancel(), $.animationTimers.delete(N), $.decAnim(); else { var W = _ - ((/* @__PURE__ */ new Date()).getTime() - P.getTime()); - W = W > 0 ? W : 0, L.animationTimers.delete(N), N = new h.PausableTimer(B, W, E), L.animationTimers.add(N); + W = W > 0 ? W : 0, $.animationTimers.delete(N), N = new h.PausableTimer(B, W, E), $.animationTimers.add(N); } }, N = new h.PausableTimer(B, 0, E), this.animationTimers.add(N), this; } @@ -24734,8 +24750,8 @@ ATOM`, b); addModels(c, _, 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++) { - var L = new d.GLModel(this.models.length, E); - L.setAtomDefaults(w[k]), L.addFrame(w[k]), L.setFrame(0), w.modelData && L.setModelData(w.modelData[k]), L.setDontDuplicateAtoms(!E.duplicateAssemblyAtoms), this.models.push(L); + 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($); } return this.models; } @@ -24844,9 +24860,9 @@ ATOM`, b); } return this.models.push(E), E; } - applyToModels(c, _, E, w, k, L, $) { - for (var z = this.getModelList(_), O = 0; O < z.length; O++) - z[O][c](_, E, w, k, L, $); + applyToModels(c, _, E, w, k, $, L) { + for (var z = this.getModelList(_), F = 0; F < z.length; F++) + z[F][c](_, E, w, k, $, L); } setStyle(c, _) { return typeof _ > "u" && (_ = c, c = {}), this.applyToModels("setStyle", c, _, !1), this; @@ -24981,12 +24997,12 @@ ATOM`, b); let w = [], k = {}; for (let P = 0, U = _.length; P < U; P++) k[_[P].index] = P; - let L = function(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; - }, $ = function(P) { + }, 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) { @@ -24994,19 +25010,19 @@ ATOM`, b); 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 = $(P), G = $(P), H = (P[1][W] - P[0][W]) / 2 + P[0][W]; + 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); - }, O = z(c), R = 6; - for (let P = 0, U = O.length; P < U; P++) { - let N = $(O[P]); + }, 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, O[P]); + let B = l.getAtomsWithin(_, N), W = l.getAtomsWithin(E, F[P]); w.push({ - extent: O[P], - atoms: L(B), - toshow: L(W) + extent: F[P], + atoms: $(B), + toshow: $(W) }); } return w; @@ -25023,28 +25039,28 @@ ATOM`, b); * @return {Mesh} */ static generateSurfaceMesh(c, _, E) { - var w = new r.Geometry(!0), k = w.updateGeoGroup(0), L = []; + var w = new r.Geometry(!0), k = w.updateGeoGroup(0), $ = []; for (let pe = 0, le = c.length; pe < le; pe++) { - var $ = c[pe]; - $ && (typeof $.surfaceColor < "u" ? L[pe] = $.surfaceColor : $.color && (L[pe] = s.CC.color($.color))); + var L = c[pe]; + L && (typeof L.surfaceColor < "u" ? $[pe] = L.surfaceColor : L.color && ($[pe] = s.CC.color(L.color))); } - var z = k.vertexArray, O = _.vertices; - for (let pe = 0, le = O.length; pe < le; pe++) { + var z = k.vertexArray, F = _.vertices; + for (let pe = 0, le = F.length; pe < le; pe++) { let ne = k.vertices * 3; - z[ne] = O[pe].x, z[ne + 1] = O[pe].y, z[ne + 2] = O[pe].z, k.vertices++; + z[ne] = F[pe].x, z[ne + 1] = F[pe].y, z[ne + 2] = F[pe].z, k.vertices++; } var R = k.colorArray; let P = k.atomArray; if (E.voldata && E.volscheme) { var U = E.volscheme, N = E.voldata, B = U.range() || [-1, 1]; - for (let pe = 0, le = O.length; pe < le; pe++) { - let ne = O[pe].atomid, Te = N.getVal(O[pe].x, O[pe].y, O[pe].z), Fe = s.CC.color(U.valueToHex(Te, B)), Be = pe * 3; - R[Be] = Fe.r, R[Be + 1] = Fe.g, R[Be + 2] = Fe.b, P[pe] = c[ne]; + 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]; } - } else if (L.length > 0) - for (let pe = 0, le = O.length; pe < le; pe++) { - let ne = O[pe].atomid, Te = pe * 3; - R[Te] = L[ne].r, R[Te + 1] = L[ne].g, R[Te + 2] = L[ne].b, P[pe] = c[ne]; + } 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]; } var W = _.faces; k.faceidx = W.length, w.initTypedArrays(); @@ -25073,9 +25089,9 @@ ATOM`, b); * vol * @return {Object} */ - static generateMeshSyncHelper(c, _, E, w, k, L) { - var $ = new A.ProteinSurface(); - return $.initparm(_, c !== 1, L), $.fillvoxels(k, E), $.buildboundary(), (c == A.SurfaceType.SES || c == A.SurfaceType.MS) && ($.fastdistancemap(), $.boundingatom(!1), $.fillvoxelswaals(k, E)), $.marchingcube(c), $.getFacesAndVertices(w); + static generateMeshSyncHelper(c, _, 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); } /* * @@ -25128,8 +25144,8 @@ 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, L) { - let $ = this.nextSurfID(), z = null, O = this, R = A.SurfaceType.VDW; + 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)(_); @@ -25143,7 +25159,7 @@ ATOM`, b); } } var G = function(oe, he, Ae) { - k ? U = l.shallowCopy(O.getAtomsFromSel(k)) : U = 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; @@ -25152,9 +25168,9 @@ ATOM`, b); } 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 = O.carveUpExtent(Ie, he, Ae); + 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), Fe = function(De, je) { + 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; @@ -25165,7 +25181,7 @@ ATOM`, b); }, X = Xe(De, Te), q = Xe(je, Te); return X - q; }; - ne.sort(Fe); + ne.sort(Oe); } var Be = []; for (let De = 0, je = he.length; De < je; De++) @@ -25188,13 +25204,13 @@ ATOM`, b); var me = l.generateSurfaceMesh(he, X, z); (0, h.mergeGeos)(oe.geo, me); } - O.render(), Xe(); + F.render(), Xe(); }); }, Ge = []; for (let De = 0; De < ne.length; De++) Ge.push(Pe(De)); return Promise.all(Ge).then(function() { - return oe.done = !0, Promise.resolve($); + return oe.done = !0, Promise.resolve(L); }); } else { var Ne = []; @@ -25223,7 +25239,7 @@ ATOM`, b); }, ge = l.generateSurfaceMesh(he, ae, z); (0, h.mergeGeos)(oe.geo, ge); } - O.render(), Xe++, Xe == ne.length && (oe.done = !0, X(), De($)); + F.render(), Xe++, Xe == ne.length && (oe.done = !0, X(), De(L)); }, re = function(me) { X(), console.log(me.message + " (" + me.filename + ":" + me.lineno + ")"), je(me); }; @@ -25270,9 +25286,9 @@ ATOM`, b); finished: !1, symmetries: [new a.Matrix4()] }), Q = G(H[H.length - 1], P, N); - return this.surfaces[$] = H, Q.surfid = $, L && typeof L == "function" ? (Q.then(function(fe) { - L(fe); - }), $) : Q; + return this.surfaces[L] = H, Q.surfid = L, $ && typeof $ == "function" ? (Q.then(function(fe) { + $(fe); + }), L) : Q; } /** * Set the surface material to something else, must render change @@ -25296,20 +25312,20 @@ ATOM`, b); 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 L = s.CC.color(_.color); - E[k].geo.setColor(L); + const $ = s.CC.color(_.color); + E[k].geo.setColor($); } else if (w.voldata && w.volscheme) { - const L = w.volscheme, $ = w.voldata, z = s.CC, O = L.range() || [-1, 1]; + const $ = w.volscheme, L = w.voldata, z = s.CC, F = $.range() || [-1, 1]; E[k].geo.setColors(function(R, P, U) { - let N = $.getVal(R, P, U); - return z.color(L.valueToHex(N, O)); + let N = L.getVal(R, P, U); + return z.color($.valueToHex(N, F)); }); } else { E[k].geo.colorsNeedUpdate = !0; - for (let L of E[k].geo.geometryGroups) - for (let $ = 0; $ < L.vertices; $++) { - let z = (0, h.getColorFromStyle)(L.atomArray[$], _), O = 3 * $; - L.colorArray[O] = z.r, L.colorArray[O + 1] = z.g, L.colorArray[O + 2] = z.b; + 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; } } E[k].finished = !1; @@ -25378,14 +25394,14 @@ ATOM`, b); _ = _ || {}; var E = this.getAtomsFromSel(_); if (typeof c == "function") - for (let L = 0, $ = E.length; L < $; L++) { - let z = E[L]; + for (let $ = 0, L = E.length; $ < L; $++) { + let z = E[$]; c(z); } else - for (let L = 0, $ = E.length; L < $; L++) { - var w = E[L]; - for (let z = 0, O = c.length; z < O; z++) { + 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) @@ -25451,42 +25467,42 @@ ATOM`, b); } } } - function g(b, c = {}, _ = {}) { + function p(b, c = {}, _ = {}) { 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); try { for (var k = 0; k < c.rows; k++) { - for (var L = [], $ = 0; $ < c.cols; $++) { - _.row = k, _.col = $, _.canvas = w, _.viewers = E, _.control_all = c.control_all; + 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)({}, _)); - L.push(z); + $.push(z); } - E.unshift(L); + E.unshift($); } - } catch (O) { - throw "error creating viewer grid: " + O; + } catch (F) { + throw "error creating viewer grid: " + F; } return E; } } - function p(b) { + function g(b) { var c = this; if (b = (0, h.getElement)(b), !!b) { - var _ = g(b, { rows: 1, cols: 2, control_all: !0 }); + 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); for (var E = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function(k) { return typeof c.glviewer1[k] == "function"; }), w = 0; w < E.length; w++) this[E[w]] = /* @__PURE__ */ function(k) { return function() { - var L = this.glviewer1[k].apply(this.glviewer1, arguments), $ = this.glviewer2[k].apply(this.glviewer2, arguments); - return [L, $]; + var $ = this.glviewer1[k].apply(this.glviewer1, arguments), L = this.glviewer2[k].apply(this.glviewer2, arguments); + return [$, L]; }; }(E[w]); - this.setCoordinates = function(k, L, $) { + this.setCoordinates = function(k, $, L) { for (var z = 0; z < k.length; z++) - k[z].setCoordinates(L, $); + k[z].setCoordinates($, L); }, this.surfacesFinished = function() { return this.glviewer1.surfacesFinished() && this.glviewer2.surfacesFinished(); }, this.isAnimated = function() { @@ -25591,12 +25607,12 @@ ATOM`, b); var l, u; if (M = this.mult * M, m ? (l = m[0], u = m[1]) : (l = this.min, u = this.max), M === void 0) return 16777215; - var g = s(l, u, M); - l = g.lo, u = g.hi, M = g.val; - var p = (u + l) / 2; - m && typeof m[2] < "u" ? p = m[2] : typeof this.mid < "u" ? p = this.mid : p = (l + u) / 2; + var p = s(l, u, M); + l = p.lo, u = p.hi, M = p.val; + var g = (u + l) / 2; + m && typeof m[2] < "u" ? g = m[2] : typeof this.mid < "u" ? g = this.mid : g = (l + u) / 2; var b, c; - return M < p ? (b = Math.floor(255 * Math.sqrt((M - l) / (p - l))), c = 16711680 + 256 * b + b, c) : M > p ? (b = Math.floor(255 * Math.sqrt(1 - (M - p) / (u - p))), c = 65536 * b + 256 * b + 255, c) : 16777215; + return M < g ? (b = Math.floor(255 * Math.sqrt((M - l) / (g - l))), c = 16711680 + 256 * b + b, c) : M > g ? (b = Math.floor(255 * Math.sqrt(1 - (M - g) / (u - g))), c = 65536 * b + 256 * b + 255, c) : 16777215; } } class d extends a { @@ -25608,10 +25624,10 @@ ATOM`, b); var l, u; if (M = this.mult * M, m ? (l = m[0], u = m[1]) : (l = this.min, u = this.max), typeof M > "u") return 16777215; - var g = s(l, u, M); - l = g.lo, u = g.hi, M = g.val; - var p = (l + u) / 2, b = (l + p) / 2, c = (p + u) / 2, _, E; - return M < b ? (_ = Math.floor(255 * Math.sqrt((M - l) / (b - l))), E = 16711680 + 256 * _ + 0, E) : M < p ? (_ = Math.floor(255 * Math.sqrt(1 - (M - b) / (p - b))), E = 65536 * _ + 65280 + 0, E) : M < c ? (_ = Math.floor(255 * Math.sqrt((M - p) / (c - p))), E = 65280 + 1 * _, E) : (_ = Math.floor(255 * Math.sqrt(1 - (M - c) / (u - c))), E = 0 + 256 * _ + 255, E); + 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); } //return range used for color mapping, null if none set range() { @@ -25627,9 +25643,9 @@ ATOM`, b); var l, u; if (M = this.mult * M, m ? (l = m[0], u = m[1]) : (l = this.min, u = this.max), typeof M > "u") return 16777215; - var g = A.normalizeValue(l, u, M); - l = g.lo, u = g.hi, M = g.val; - var p = (M - l) / (u - l), b = 5 * p / 6 + 0.5, c = Math.sin(Math.PI * b); + var p = A.normalizeValue(l, u, M); + 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; @@ -25646,8 +25662,8 @@ ATOM`, b); super(), this.gradient = "linear", this.colors = new Array(); var u; if (Array.isArray(M) && M.length >= 2 ? (this.max = M[1], this.min = M[0], u = m) : (this.min = M, this.max = m, u = l), u) - for (let g of u) - this.colors.push(r.CC.color(g)); + for (let p of u) + this.colors.push(r.CC.color(p)); else this.colors.push(r.CC.color(0)); } @@ -25660,9 +25676,9 @@ ATOM`, b); var l, u; if (m ? (l = m[0], u = m[1]) : (l = this.min, u = this.max), M === void 0) return 16777215; - var g = s(l, u, M); - l = g.lo, u = g.hi, M = g.val; - let p = this.colors.length, b = (u - l) / p, c = Math.min(Math.floor((M - l) / b), p - 1), _ = Math.min(c + 1, p - 1), E = (M - l - c * b) / b, w = this.colors[c], k = this.colors[_]; + 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[_]; 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(); } } @@ -25746,12 +25762,12 @@ ATOM`, b); g: 255, b: 255, a: 1 - }), u = y.padding ? y.padding : 4, g = y.borderThickness ? y.borderThickness : 0, p = d(y.backgroundColor, y.backgroundOpacity, { + }), u = y.padding ? y.padding : 4, p = y.borderThickness ? y.borderThickness : 0, g = d(y.backgroundColor, y.backgroundOpacity, { r: 0, g: 0, b: 0, a: 1 - }), b = d(y.borderColor, y.borderOpacity, p), c = y.position ? y.position : { + }), b = d(y.borderColor, y.borderOpacity, g), c = y.position ? y.position : { x: -10, y: 1, z: 1 @@ -25761,15 +25777,15 @@ ATOM`, b); 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), L = k.width; - x || (g = 0); - var $ = L + 2.5 * g + 2 * u, z = m * 1.25 + 2 * g + 2 * u; + 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; if (y.backgroundImage) { - var O = y.backgroundImage, R = y.backgroundWidth ? y.backgroundWidth : O.width, P = y.backgroundHeight ? y.backgroundHeight : O.height; - R > $ && ($ = R), P > z && (z = P); + 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 = $, 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(" + p.r + "," + p.g + "," + p.b + "," + p.a + ")", this.context.strokeStyle = "rgba(" + b.r + "," + b.g + "," + b.b + "," + b.a + ")", y.backgroundGradient) { - let N = this.context.createLinearGradient(0, z / 2, $, z / 2), B = a.Gradient.getGradient(y.backgroundGradient), W = B.range(), V = -1, G = 1; + 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) { @@ -25778,7 +25794,7 @@ ATOM`, b); } this.context.fillStyle = N; } - this.context.lineWidth = g, x && o(this.context, g, g, $ - 2 * g, z - 2 * g, 6, g > 0), y.backgroundImage && this.context.drawImage(O, 0, 0, $, z), this.context.fillStyle = "rgba(" + l.r + "," + l.g + "," + l.b + "," + l.a + ")", this.context.fillText(this.text, g + u, m + g + u, L); + 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, @@ -26885,27 +26901,27 @@ 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 }, g = !!m.voxel, p = 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, _ = 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, $; - for (L = 0, $ = k.length; L < $; ++L) - k[L] = -1; + let k = new Int32Array(b * c * _), $, 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++, p) { + 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(p), H = { x: fe.x, y: fe.y, z: fe.z }; + fe = fe.applyMatrix4(g), H = { x: fe.x, y: fe.y, z: fe.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 g ? (x.push(H), x.length - 1) : (k[ce] < 0 && (k[ce] = x.length, x.push(H)), k[ce]); - }, O = new Int32Array(12), R = l ? this.edgeTable2 : this.edgeTable, P = l ? this.triTable2 : this.triTable; - for (L = 0; L < b - 1; ++L) + 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; + 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 * (L + ((G & 4) >> 2)) + U + ((G & 2) >> 1)) * _ + N + (G & 1), Q = !!(A[H] & this.ISDONE); + let H = (c * ($ + ((G & 4) >> 2)) + U + ((G & 2) >> 1)) * _ + N + (G & 1), Q = !!(A[H] & this.ISDONE); B |= Q << G; } if (B === 0 || B === 255) @@ -26914,15 +26930,15 @@ ATOM`, b); if (W === 0) continue; let V = P[B]; - W & 1 && (O[0] = z(L, U, N, B, 0, 1)), W & 2 && (O[1] = z(L, U, N, B, 1, 3)), W & 4 && (O[2] = z(L, U, N, B, 3, 2)), W & 8 && (O[3] = z(L, U, N, B, 2, 0)), W & 16 && (O[4] = z(L, U, N, B, 4, 5)), W & 32 && (O[5] = z(L, U, N, B, 5, 7)), W & 64 && (O[6] = z(L, U, N, B, 7, 6)), W & 128 && (O[7] = z(L, U, N, B, 6, 4)), W & 256 && (O[8] = z(L, U, N, B, 0, 4)), W & 512 && (O[9] = z(L, U, N, B, 1, 5)), W & 1024 && (O[10] = z(L, U, N, B, 3, 7)), W & 2048 && (O[11] = z(L, U, N, B, 2, 6)); + 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 = O[V[G]], Q = O[V[G + 1]], te = O[V[G + 2]]; - g && 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 = 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); } } } laplacianSmooth(A, x, M) { - let m = new Array(x.length), l, u, g, p, b; + let m = new Array(x.length), l, u, p, g, b; for (l = 0, u = x.length; l < u; l++) m[l] = { x: 0, @@ -26935,38 +26951,38 @@ ATOM`, b); 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 = l * 3 + 1, $ = l * 3 + 2; - for (_ = !0, g = 0, p = c[0][M[k]]; g < p; g++) - if (M[L] == c[g + 1][M[k]]) { + let k = l * 3, $ = l * 3 + 1, L = l * 3 + 2; + for (_ = !0, p = 0, g = c[0][M[k]]; p < g; p++) + if (M[$] == c[p + 1][M[k]]) { _ = !1; break; } - for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[L]), _ = !0, g = 0, p = c[0][M[k]]; g < p; g++) - if (M[$] == c[g + 1][M[k]]) { + for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[$]), _ = !0, p = 0, g = c[0][M[k]]; p < g; p++) + if (M[L] == c[p + 1][M[k]]) { _ = !1; break; } - for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[$]), _ = !0, g = 0, p = c[0][M[L]]; g < p; g++) - if (M[k] == c[g + 1][M[L]]) { + for (_ && (c[0][M[k]]++, c[c[0][M[k]]][M[k]] = M[L]), _ = !0, p = 0, g = c[0][M[$]]; p < g; p++) + if (M[k] == c[p + 1][M[$]]) { _ = !1; break; } - for (_ && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[k]), _ = !0, g = 0, p = c[0][M[L]]; g < p; g++) - if (M[$] == c[g + 1][M[L]]) { + for (_ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[k]), _ = !0, p = 0, g = c[0][M[$]]; p < g; p++) + if (M[L] == c[p + 1][M[$]]) { _ = !1; break; } - for (_ && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[$]), _ = !0, g = 0; g < c[0][M[$]]; g++) - if (M[k] == c[g + 1][M[$]]) { + for (_ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[L]), _ = !0, p = 0; p < c[0][M[L]]; p++) + if (M[k] == c[p + 1][M[L]]) { _ = !1; break; } - for (_ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[k]), _ = !0, g = 0, p = c[0][M[$]]; g < p; g++) - if (M[L] == c[g + 1][M[$]]) { + 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++) + if (M[$] == c[p + 1][M[L]]) { _ = !1; break; } - _ && (c[0][M[$]]++, c[c[0][M[$]]][M[$]] = M[L]); + _ && (c[0][M[L]]++, c[c[0][M[L]]][M[L]] = M[$]); } let E = 1, w = 0.5; for (b = 0; b < A; b++) { @@ -26974,12 +26990,12 @@ ATOM`, b); if (c[0][l] < 3) m[l].x = x[l].x, m[l].y = x[l].y, m[l].z = x[l].z; else if (c[0][l] == 3 || c[0][l] == 4) { - for (m[l].x = 0, m[l].y = 0, m[l].z = 0, g = 0, p = c[0][l]; g < p; g++) - m[l].x += x[c[g + 1][l]].x, m[l].y += x[c[g + 1][l]].y, m[l].z += x[c[g + 1][l]].z; + for (m[l].x = 0, m[l].y = 0, m[l].z = 0, p = 0, g = c[0][l]; p < g; p++) + m[l].x += x[c[p + 1][l]].x, m[l].y += x[c[p + 1][l]].y, m[l].z += x[c[p + 1][l]].z; m[l].x += w * x[l].x, m[l].y += w * x[l].y, m[l].z += w * x[l].z, m[l].x /= w + c[0][l], m[l].y /= w + c[0][l], m[l].z /= w + c[0][l]; } else { - for (m[l].x = 0, m[l].y = 0, m[l].z = 0, g = 0, p = c[0][l]; g < p; g++) - m[l].x += x[c[g + 1][l]].x, m[l].y += x[c[g + 1][l]].y, m[l].z += x[c[g + 1][l]].z; + for (m[l].x = 0, m[l].y = 0, m[l].z = 0, p = 0, g = c[0][l]; p < g; p++) + m[l].x += x[c[p + 1][l]].x, m[l].y += x[c[p + 1][l]].y, m[l].z += x[c[p + 1][l]].z; m[l].x += E * x[l].x, m[l].y += E * x[l].y, m[l].z += E * x[l].z, m[l].x /= E + c[0][l], m[l].y /= E + c[0][l], m[l].z /= E + c[0][l]; } for (l = 0, u = x.length; l < u; l++) @@ -27068,8 +27084,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 g = this.faces[l], p = this.faces[l + 1], b = this.faces[l + 2], c = M[g].atomid, _ = M[p].atomid, E = M[b].atomid, w = c; - _ < w && (w = _), E < w && (w = E), x[w] && g !== p && p !== b && g !== b && (m.push(g), m.push(p), m.push(b)); + 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)); } return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, { vertices: M, @@ -27089,9 +27105,9 @@ ATOM`, b); let l = x[M] * x[M]; this.widxz[M] = Math.floor(x[M]) + 1, this.depty[M] = new Int32Array(this.widxz[M] * this.widxz[M]); let u = 0; - for (let g = 0; g < this.widxz[M]; g++) - for (let p = 0; p < this.widxz[M]; p++) { - let b = g * g + p * p; + for (let p = 0; p < this.widxz[M]; p++) + for (let g = 0; g < this.widxz[M]; g++) { + let b = p * p + g * g; if (b > l) this.depty[M][u] = -1; else { @@ -27113,33 +27129,33 @@ ATOM`, b); this.vpBits[M] & this.INOUT && (this.vpBits[M] |= this.ISDONE); } 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), g = 0, p = this.pWidth * this.pHeight; + 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; _++) { - if (this.depty[u][g] != -1) { + 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 L = E * b, $ = k * _; - for (let z = 0; z <= this.depty[u][g]; z++) { - let O = z * w, R = M + L, P = m + O, U = l + $; + 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) continue; - let N = R * p + P * this.pHeight + U; + let N = R * g + P * this.pHeight + U; if (!(this.vpBits[N] & this.INOUT)) this.vpBits[N] |= this.INOUT, this.vpAtomID[N] = A.serial; else { let B = x[this.vpAtomID[N]]; if (B.serial != A.serial) { - let W = M + L - Math.floor(0.5 + this.scaleFactor * (B.x + this.ptranx)), V = m + O - Math.floor(0.5 + this.scaleFactor * (B.y + this.ptrany)), G = l + $ - Math.floor(0.5 + this.scaleFactor * (B.z + this.ptranz)); - L * L + O * O + $ * $ < W * W + V * V + G * G && (this.vpAtomID[N] = 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); } } } } } - g++; + p++; } } fillvoxelswaals(A, x) { @@ -27151,27 +27167,27 @@ 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)), g = this.getVDWIndex(A), p = this.pWidth * this.pHeight; - for (let b = 0, c = this.widxz[g]; b < c; b++) + 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; _++) { - if (this.depty[g][M] != -1) { + 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 L = E * b, $ = k * _; - for (let z = 0; z <= this.depty[g][M]; z++) { - let O = z * w, R = m + L, P = l + O, U = u + $; + 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) continue; - let N = R * p + P * this.pHeight + U; + let N = R * g + P * this.pHeight + U; if (!(this.vpBits[N] & this.ISDONE)) this.vpBits[N] |= this.ISDONE, this.vpAtomID[N] = A.serial; else { let B = x[this.vpAtomID[N]]; if (B.serial != A.serial) { - let W = m + L - Math.floor(0.5 + this.scaleFactor * (B.x + this.ptranx)), V = l + O - Math.floor(0.5 + this.scaleFactor * (B.y + this.ptrany)), G = u + $ - Math.floor(0.5 + this.scaleFactor * (B.z + this.ptranz)); - L * L + O * O + $ * $ < W * W + V * V + G * G && (this.vpAtomID[N] = 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); } } } @@ -27189,8 +27205,8 @@ ATOM`, b); if (this.vpBits[l] & this.INOUT) { let u = 0; for (; u < 26; ) { - let g = x + this.nb[u][0], p = M + this.nb[u][2], b = m + this.nb[u][1]; - if (g > -1 && g < this.pLength && b > -1 && b < this.pWidth && p > -1 && p < this.pHeight && !(this.vpBits[g * A + b * this.pHeight + p] & this.INOUT)) { + let p = x + this.nb[u][0], g = M + this.nb[u][2], b = m + this.nb[u][1]; + if (p > -1 && p < this.pLength && b > -1 && b < this.pWidth && g > -1 && g < this.pHeight && !(this.vpBits[p * A + b * this.pHeight + g] & this.INOUT)) { this.vpBits[l] |= this.ISBOUND; break; } else @@ -27222,16 +27238,16 @@ ATOM`, b); }); } while (m.length !== 0); m = [], l = [], A = null; - let g = this.scaleFactor - 0.5; - g < 0 && (g = 0); - let p = M - 0.5 / (0.1 + g); + let p = this.scaleFactor - 0.5; + p < 0 && (p = 0); + 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] >= p) && (this.vpBits[u] |= this.ISBOUND); + 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); } fastoneshell(A, x) { - let M, m, l, u, g, p, b, c, _, E = []; + let M, m, l, u, p, g, b, c, _, E = []; if (A.length === 0) return E; let w = { @@ -27239,40 +27255,40 @@ ATOM`, b); iy: -1, iz: -1 }, k = this.pWidth * this.pHeight; - for (let L = 0, $ = A.length; L < $; L++) { - M = A[L].ix, m = A[L].iy, l = A[L].iz, c = x.get(M, m, l); + 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, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + 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({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, 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[_] & 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({ ix: w.ix, iy: w.iy, iz: w.iz }))))); } - for (let L = 0, $ = A.length; L < $; L++) { - M = A[L].ix, m = A[L].iy, l = A[L].iz, c = x.get(M, m, l); + 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, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + 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({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, 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[_] & 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({ ix: w.ix, iy: w.iy, iz: w.iz }))))); } - for (let L = 0, $ = A.length; L < $; L++) { - M = A[L].ix, m = A[L].iy, l = A[L].iz, c = x.get(M, m, l); + 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, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, this.vpDistance[_] = b, this.vpBits[_] |= this.ISDONE, this.vpBits[_] |= this.ISBOUND, E.push({ + 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({ ix: w.ix, iy: w.iy, iz: w.iz - })) : this.vpBits[_] & this.INOUT && this.vpBits[_] & this.ISDONE && (u = w.ix - c.ix, g = w.iy - c.iy, p = w.iz - c.iz, b = u * u + g * g + p * p, 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[_] & 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({ ix: w.ix, iy: w.iy, iz: w.iz @@ -27346,64 +27362,64 @@ ATOM`, b); y: 0, z: 0 }, this.data = new Float32Array([]), this.matrix = null, this.inversematrix = null, this.isbinary = /* @__PURE__ */ new Set(["ccp4", "CCP4"]), this.getCoordinates = function(u) { - var g = u / (this.size.y * this.size.z), p = u % (this.size.y * this.size.z), b = u % this.size.z; - return g *= this.unit.x, p *= this.unit.y, b *= this.unit.z, g += this.origin.x, p += this.origin.y, b += this.origin.z, { x: g, y: p, z: b }; + var p = u / (this.size.y * this.size.z), g = u % (this.size.y * this.size.z), b = u % this.size.z; + return p *= this.unit.x, g *= this.unit.y, b *= this.unit.z, p += this.origin.x, g += this.origin.y, b += this.origin.z, { x: p, y: g, z: b }; }, this.vasp = function(u) { - var g = u.replace(/^\s+/, "").split(/[\n\r]/), p = (0, s.VASP)(u)[0], b = p.length; + var p = u.replace(/^\s+/, "").split(/[\n\r]/), g = (0, s.VASP)(u)[0], b = g.length; if (b == 0) { 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(g[1]), w; - w = g[2].replace(/^\s+/, "").split(/\s+/); + var c = 1.889725992, _ = 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 = g[3].replace(/^\s+/, "").split(/\s+/); - var L = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c); - w = g[4].replace(/^\s+/, "").split(/\s+/); - var $ = new a.Vector3(parseFloat(w[0]), parseFloat(w[1]), parseFloat(w[2])).multiplyScalar(E * c), z = k.x * (L.y * $.z - $.y * L.z) - L.x * (k.y * $.z - $.y * k.z) + $.x * (k.y * L.z - L.y * k.z); + 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 O = 1 / z; - g.splice(0, 8 + b + 1); - var R = g[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, L.y, $.z), k = k.multiplyScalar(1 / (c * P)), L = L.multiplyScalar(1 / (c * U)), $ = $.multiplyScalar(1 / (c * N)), (k.y != 0 || k.z != 0 || L.x != 0 || L.z != 0 || $.x != 0 || $.y != 0) && (this.matrix = new a.Matrix4(k.x, L.x, $.x, 0, k.y, L.y, $.y, 0, k.z, L.z, $.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)), g.splice(0, 1); - var W = g.join(" "); + var F = 1 / z; + 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 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] * O * _; + G[H] = G[H] * F * _; this.data = G; }, this.dx = function(u) { - var g = u.split(/[\n\r]+/), p, 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; - for (w = 0; w < g.length; w++) { - var k = g[w]; - if (p = b.exec(k)) { - var L = parseInt(p[1]), $ = parseInt(p[2]), z = parseInt(p[3]); - this.size = { x: L, y: $, z }; - } else if (p = _.exec(k)) { - var O = parseFloat(p[1]); - if ((parseFloat(p[2]) != 0 || parseFloat(p[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = g[w], p = _.exec(k), p == null) { + 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; + 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 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) { console.error("Parse error in dx delta matrix"); return; } - var R = parseFloat(p[2]); - if ((parseFloat(p[1]) != 0 || parseFloat(p[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), w += 1, k = g[w], p = _.exec(k), p == null) { + 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) { console.error("Parse error in dx delta matrix"); return; } - var P = parseFloat(p[3]); - (parseFloat(p[1]) != 0 || parseFloat(p[2]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new a.Vector3(O, R, P); - } else if (p = c.exec(k)) { - var U = parseFloat(p[1]), N = parseFloat(p[2]), B = parseFloat(p[3]); + 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); + } 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); - } else if (p = E.exec(k)) + } else if (g = E.exec(k)) break; } if (w += 1, !this.size || !this.origin || !this.unit || !this.size) { console.error("Error parsing dx format"); return; } - var W = g.splice(w).join(" "), V = W.split(/[\s\r]+/); + var W = p.splice(w).join(" "), V = W.split(/[\s\r]+/); this.data = Float32Array.from(V, parseFloat); }, y = y.toLowerCase(), /\.gz$/.test(y)) { y = y.replace(/\.gz$/, ""); @@ -27415,20 +27431,20 @@ ATOM`, b); } if (this[y] && (this.isbinary.has(y) && typeof f == "string" && (f = (0, r.base64ToArray)(f)), this[y](f)), A) { if (A.negate) - for (let u = 0, g = this.data.length; u < g; u++) + for (let u = 0, p = this.data.length; u < p; u++) this.data[u] = -this.data[u]; if (A.normalize) { var x = 0; - for (let u = 0, g = this.data.length; u < g; u++) + for (let u = 0, p = this.data.length; u < p; u++) x += this.data[u]; var M = x / this.data.length; x = 0; - for (let u = 0, g = this.data.length; u < g; u++) { + for (let u = 0, p = this.data.length; u < p; u++) { var m = this.data[u] - M; x += m * m; } var l = x / this.data.length; - for (let u = 0, g = this.data.length; u < g; u++) + for (let u = 0, p = this.data.length; u < p; u++) this.data[u] = (this.data[u] - M) / l; } } @@ -27466,8 +27482,8 @@ ATOM`, b); M < 0 && l++; var u = y.splice(m + l).join(" "); u = u.replace(/^\s+/, ""); - var g = u.split(/[\s\r]+/); - this.data = Float32Array.from(g, parseFloat); + var p = u.split(/[\s\r]+/); + this.data = Float32Array.from(p, parseFloat); } } //parse cp4 files @@ -27479,11 +27495,11 @@ ATOM`, b); for (var m = f.byteLength, l = 0; l < m; l += 4) M.setFloat32(l, M.getFloat32(l), !0); y.NX = A[0], y.NY = A[1], y.NZ = A[2], y.MODE = A[3], y.NXSTART = A[4], y.NYSTART = A[5], y.NZSTART = A[6], y.MX = A[7], y.MY = A[8], y.MZ = A[9], y.xlen = x[10], y.ylen = x[11], y.zlen = x[12], y.alpha = x[13], y.beta = x[14], y.gamma = x[15], y.MAPC = A[16], y.MAPR = A[17], y.MAPS = A[18], y.DMIN = x[19], y.DMAX = x[20], y.DMEAN = x[21], y.ISPG = A[22], y.NSYMBT = A[23], y.LSKFLG = A[24], y.originX = x[49], y.originY = x[50], y.originZ = x[51], y.ARMS = x[54]; - var u = y, g = [ + var u = y, p = [ u.xlen, 0, 0 - ], p = [ + ], g = [ u.ylen * Math.cos(Math.PI / 180 * u.gamma), u.ylen * Math.sin(Math.PI / 180 * u.gamma), 0 @@ -27493,14 +27509,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, g, p, b], _ = [0, u.MX, u.MY, u.MZ], E = [0, u.MAPC, u.MAPR, u.MAPS]; + 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 w = new Float32Array(f.buffer, 1024 + y.NSYMBT), k = y.NX, L = y.NY, $ = y.NZ; - this.data = new Float32Array(k * L * $); + 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 O = 0; O < L; O++) - for (let R = 0; R < $; R++) - this.data[(z * L + O) * $ + R] = w[(R * L + O) * k + z]; + for (let F = 0; F < $; F++) + for (let R = 0; R < L; R++) + this.data[(z * $ + F) * L + R] = w[(R * $ + F) * k + z]; } } } @@ -27544,8 +27560,8 @@ ATOM`, b); var x = [], M = (f.length - 1) / (y - 1); x[0] = f[0]; for (var m = 1; m < y - 1; m++) { - var l = m * M, u = Math.floor(l), g = Math.ceil(l), p = l - u; - x[m] = A(f[u], f[g], p); + var l = m * M, u = Math.floor(l), p = Math.ceil(l), g = l - u; + x[m] = A(f[u], f[p], g); } return x[y - 1] = f[f.length - 1], x; } @@ -27554,32 +27570,32 @@ ATOM`, b); var x = Object.assign([], y.transferfn); this.subsamples = y.subsamples || 5; let M = 256; - x.forEach(function(L) { - L.value = parseFloat(L.value); - }), x.sort(function(L, $) { - return L.value - $.value; + x.forEach(function($) { + $.value = parseFloat($.value); + }), 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, g, p, b, c, _, E, w; - for (let L = 0; L < x.length - 1; L++) - if (u = h.CC.color(x[L].color), g = h.CC.color(x[L + 1].color), E = x[L].opacity, w = x[L + 1].opacity, m = Math.floor((x[L].value - this.min) * M / (this.max - this.min)), l = Math.floor((x[L + 1].value - this.min) * M / (this.max - this.min)), m != l) { - p = d.interpolateArray([u.r * 255, g.r * 255], l - m), b = d.interpolateArray([u.g * 255, g.g * 255], l - m), c = d.interpolateArray([u.b * 255, g.b * 255], l - m), _ = d.interpolateArray([E * 255, w * 255], l - m); - for (let $ = 0; $ < p.length; $++) - this.transferfunctionbuffer.push(p[$]), this.transferfunctionbuffer.push(b[$]), this.transferfunctionbuffer.push(c[$]), this.transferfunctionbuffer.push(_[$]); + var m, l, u, p, g, b, c, _, 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); + 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]); } if (this.transferfunctionbuffer = new Uint8ClampedArray(this.transferfunctionbuffer), f.matrix) { - let L = new a.Vector3(0, 0, 0), $ = new a.Vector3(f.size.x, f.size.y, f.size.z), z = new a.Vector3(1, 1, 1); - L.applyMatrix4(f.matrix), $.applyMatrix4(f.matrix), z.applyMatrix4(f.matrix).sub(L), this.extent = [[L.x, L.y, L.z], [$.x, $.y, $.z]]; + 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++) - $.x = U & 1 ? f.size.x : 0, $.y = U & 2 ? f.size.y : 0, $.z = U & 4 ? f.size.z : 0, $.applyMatrix4(f.matrix), this.extent[0][0] = Math.min(this.extent[0][0], $.x), this.extent[0][1] = Math.min(this.extent[0][1], $.y), this.extent[0][2] = Math.min(this.extent[0][2], $.z), this.extent[1][0] = Math.max(this.extent[1][0], $.x), this.extent[1][1] = Math.max(this.extent[1][1], $.y), this.extent[1][2] = Math.max(this.extent[1][2], $.z); - let O = $.x - L.x, R = $.y - L.y, P = $.z - L.z; - this.maxdepth = Math.sqrt(O * O + 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); + 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); } else { this.texmatrix = new a.Matrix4().identity(); - let L = f.unit.x * f.size.x, $ = f.unit.y * f.size.y, z = f.unit.z * f.size.z; - this.texmatrix.makeTranslation(-f.origin.x / L, -f.origin.y / $, -f.origin.z / z), this.texmatrix.scale({ x: 1 / L, y: 1 / $, 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, 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 = [ [f.origin.x, f.origin.y, f.origin.z], - [f.origin.x + L, f.origin.y + $, f.origin.z + z] - ], this.maxdepth = Math.sqrt(L * L + $ * $ + z * z); + [f.origin.x + $, f.origin.y + L, f.origin.z + z] + ], this.maxdepth = Math.sqrt($ * $ + L * L + z * z); } var k = new o.GLShape({}); if (k.addBox({ @@ -27590,19 +27606,19 @@ 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 L = new Uint8Array(f.data.length), $ = y.seldist, z = $ * $; - for (let O = 0, R = y.coords.length; O < R; O++) { - let P = y.coords[O], U = P.x - $, N = P.y - $, B = P.z - $, W = P.x + $, V = P.y + $, G = P.z + $; + 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 && !L[ee] && (H - P.x) * (H - P.x) + (Q - P.y) * (Q - P.y) + (te - P.z) * (te - P.z) < z && (L[ee] = 1); + ee >= 0 && !$[ee] && (H - P.x) * (H - P.x) + (Q - P.y) * (Q - P.y) + (te - P.z) * (te - P.z) < z && ($[ee] = 1); } } - for (let O = 0, R = f.data.length; O < R; O++) - L[O] == 0 && (f.data[O] = 1 / 0); + for (let F = 0, R = f.data.length; F < R; F++) + $[F] == 0 && (f.data[F] = 1 / 0); } this.data = f; } @@ -27827,8 +27843,8 @@ ATOM`, b); getPrecision() { return this._precision; } - setClearColorHex(u, g) { - this._clearColor.setHex(u), this._clearAlpha = g, this.isLost() || this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); + setClearColorHex(u, p) { + this._clearColor.setHex(u), this._clearAlpha = p, this.isLost() || this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } enableOutline(u) { this._outlineMaterial = new d.MeshOutlineMaterial(u), this._outlineSphereImposterMaterial = new d.SphereImposterOutlineMaterial(u), this._outlineStickImposterMaterial = new d.StickImposterOutlineMaterial(u), this._outlineEnabled = !0; @@ -27844,25 +27860,25 @@ ATOM`, b); } setViewport() { if (this._offscreen && (this._offscreen.width = this._canvas.width, this._offscreen.height = this._canvas.height), this.rows != null && this.cols != null && this.row != null && this.col != null) { - var u = this._canvas.width / this.cols, g = this._canvas.height / this.rows; - this._viewportWidth = u, this._viewportHeight = g, this.isLost() || (this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(u * this.col, g * this.row, u, g), this._gl.viewport(u * this.col, g * this.row, u, g)); + var u = this._canvas.width / this.cols, p = this._canvas.height / this.rows; + this._viewportWidth = u, this._viewportHeight = p, this.isLost() || (this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(u * this.col, p * this.row, u, p), this._gl.viewport(u * this.col, p * this.row, u, p)); } } - setSize(u, g) { + setSize(u, p) { if (this.devicePixelRatio = window.devicePixelRatio !== void 0 ? window.devicePixelRatio : 1, this._antialias && this.devicePixelRatio < 2 && (this.devicePixelRatio *= 2), this.rows != null && this.cols != null && this.row != null && this.col != null) { - var p = u / this.cols, b = g / this.rows; - this._canvas.width = u * this.devicePixelRatio, this._canvas.height = g * this.devicePixelRatio, this._viewportWidth = p * this.devicePixelRatio, this._viewportHeight = b * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = g + "px", this.setViewport(); + var g = u / this.cols, b = p / this.rows; + this._canvas.width = u * this.devicePixelRatio, this._canvas.height = p * this.devicePixelRatio, this._viewportWidth = g * this.devicePixelRatio, this._viewportHeight = b * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = p + "px", this.setViewport(); } else - this._viewportWidth = this._canvas.width = u * this.devicePixelRatio, this._viewportHeight = this._canvas.height = g * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = g + "px", this.isLost() || this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight); + this._viewportWidth = this._canvas.width = u * this.devicePixelRatio, this._viewportHeight = this._canvas.height = p * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = p + "px", this.isLost() || this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight); this.initFrameBuffer(); } - clear(u, g, p) { + clear(u, p, g) { var b = 0; - (u === void 0 || u) && (b |= this._gl.COLOR_BUFFER_BIT), (g === void 0 || g) && (b |= this._gl.DEPTH_BUFFER_BIT), (p === void 0 || p) && (b |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(b); + (u === void 0 || u) && (b |= this._gl.COLOR_BUFFER_BIT), (p === void 0 || p) && (b |= this._gl.DEPTH_BUFFER_BIT), (g === void 0 || g) && (b |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(b); } - setMaterialFaces(u, g) { - var p = u.side === a.DoubleSide, b = u.side === a.BackSide; - u.imposter || (b = g ? !b : b), this._oldDoubleSided !== p && (p ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = p), this._oldFlipSided !== b && (b ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = b), this._gl.cullFace(this._gl.BACK); + setMaterialFaces(u, p) { + var g = u.side === a.DoubleSide, b = u.side === a.BackSide; + u.imposter || (b = p ? !b : b), this._oldDoubleSided !== g && (g ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = g), this._oldFlipSided !== b && (b ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = b), this._gl.cullFace(this._gl.BACK); } setDepthTest(u) { this._oldDepthTest !== u && (u ? this._gl.enable(this._gl.DEPTH_TEST) : this._gl.disable(this._gl.DEPTH_TEST), this._oldDepthTest = u); @@ -27877,7 +27893,7 @@ ATOM`, b); // material object after attaching prgm // We need to attach appropriate uniform variables to material after shaders // have been chosen - initMaterial(u, g, p, b) { + initMaterial(u, p, g, b) { u.addEventListener("dispose", this.onMaterialDispose.bind(this)); var c, _; if (_ = u.shaderID, _) { @@ -27891,21 +27907,21 @@ ATOM`, b); shaded: u.shaded }, u.program = this.buildProgram(u.fragmentShader, u.vertexShader, u.uniforms, c); } - renderBuffer(u, g, p, b, c, _) { + renderBuffer(u, p, g, b, c, _) { if (b.visible) { var E, w; - if (E = this.setProgram(u, g, p, b, _, this), !!E) { + if (E = this.setProgram(u, p, g, b, _, this), !!E) { w = E.attributes; - var k = !1, L = b.wireframe ? 1 : 0, $ = c.id * 16777215 + E.id * 2 + L; - $ !== this._currentGeometryGroupHash && (this._currentGeometryGroupHash = $, 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, O; + 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) { 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 ? (O = c.lineidx, this.setLineWidth(b.wireframeLinewidth), k && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, c.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, O, 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)); + } 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 && (O = c.vertices, this.setLineWidth(b.linewidth), this._gl.drawArrays(this._gl.LINES, 0, O), this.info.render.calls++); + } else _ instanceof f.Line && (F = c.vertices, this.setLineWidth(b.linewidth), this._gl.drawArrays(this._gl.LINES, 0, F), this.info.render.calls++); } } } @@ -27915,11 +27931,11 @@ ATOM`, b); } /* Setup the shading buffer to reflect desired shading (ambient occlusion) values. Only the matching object with materialType are considered. */ - setShading(u, g, p) { + setShading(u, p, g) { let b = u.__lights, c = u.fog, _ = []; - for (let k = 0, L = u.__webglObjects.length; k < L; k++) { - let $ = u.__webglObjects[k]; - $.render && $[p] && _.push($); + for (let k = 0, $ = u.__webglObjects.length; k < $; k++) { + let L = u.__webglObjects[k]; + L.render && L[g] && _.push(L); } if (_.length == 0) return; @@ -27930,25 +27946,25 @@ ATOM`, b); null, //don't write colors (can we do this?) 0 - ), this.renderObjects(u.__webglObjects, !0, p + "Depth", g, 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); + ), 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._fullProjModelMatrix.multiplyMatrices(g.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); + 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, g) { - if (!(g instanceof r.Camera)) { + render(u, p) { + if (!(p instanceof r.Camera)) { console.error("Renderer.render: camera is not an instance of Camera."); return; } - var p, b, c, _, E, w = u.__lights, k = u.fog; - if (this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && u.updateMatrixWorld(), g.parent === void 0 && g.updateMatrixWorld(), g.matrixWorldInverse.getInverse(g.matrixWorld), this.isLost()) + var g, b, c, _, 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 L = !1, $ = this._AOEnabled; - for (p = 0, b = E.length; p < b; p++) - c = E[p], _ = c.object, c.render = !1, _.visible && (this.setupMatrices(_, g), this.unrollBufferMaterial(c), c.render = !0, c.volumetric && (L = !0), c.hasAO && ($ = !0)); - if (this.setBlending(!1), $ && this.setShading(u, g, "opaque"), this.renderObjects(u.__webglObjects, !0, "opaque", g, w, k, !1), $ && this.clearShading(), this.renderSprites(u, g, !1), this.renderObjects(u.__webglObjects, !0, "transparentDepth", g, w, k, !0), this.renderObjects(u.__webglObjects, !1, "transparent", g, w, k, !0), L && this._fb && (this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, null, 0), this.renderObjects(u.__webglObjects, !1, "volumetric", g, w, k, !0)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(u, g, !0), this._bitmap) { + 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)); + 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); } @@ -27957,17 +27973,17 @@ ATOM`, b); setFrameBuffer() { if (this.isWebGL1() || !this._fb) return; - let u = this._viewportWidth, g = this._viewportHeight; - this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, g), this._gl.viewport(0, 0, u, g), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, u, g, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, g, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._shadingTexture && (this._gl.deleteTexture(this._shadingTexture), this._shadingTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, g, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.deleteTexture(this._scratchTexture), this._scratchTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._scratchTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, g, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE)), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._fb), 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._shadingTexture, 0), this._gl.clearDepth(1), this._gl.clear(this._gl.DEPTH_BUFFER_BIT), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0); + let u = this._viewportWidth, p = this._viewportHeight; + this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, p), this._gl.viewport(0, 0, u, p), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, u, p, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._shadingTexture && (this._gl.deleteTexture(this._shadingTexture), this._shadingTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.deleteTexture(this._scratchTexture), this._scratchTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._scratchTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE)), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._fb), 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._shadingTexture, 0), this._gl.clearDepth(1), this._gl.clear(this._gl.DEPTH_BUFFER_BIT), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0); } //allocate buffers for framebuffer, needs to be called with every resize initFrameBuffer() { if (this.isWebGL1()) return; - let u = this._viewportWidth, g = this._viewportHeight; - this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, g), this._gl.viewport(0, 0, u, g), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._shadingTexture = this._gl.createTexture(), this._scratchTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer(); - var p = this._antialias ? y.ShaderLib.screenaa : y.ShaderLib.screen; - this._screenshader = this.buildProgram(p.fragmentShader, p.vertexShader, p.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition"); + let u = this._viewportWidth, p = this._viewportHeight; + this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, p), this._gl.viewport(0, 0, u, p), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._shadingTexture = this._gl.createTexture(), this._scratchTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer(); + var g = this._antialias ? y.ShaderLib.screenaa : y.ShaderLib.screen; + this._screenshader = this.buildProgram(g.fragmentShader, g.vertexShader, g.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition"); var b = [ // First triangle: 1, @@ -28001,8 +28017,8 @@ ATOM`, b); } for (; u.__objectsRemoved.length; ) this.removeObject(u.__objectsRemoved[0], u), u.__objectsRemoved.splice(0, 1); - for (var g = 0, p = u.__webglObjects.length; g < p; g++) - this.updateObject(u.__webglObjects[g].object); + for (var p = 0, g = u.__webglObjects.length; p < g; p++) + this.updateObject(u.__webglObjects[p].object); } getYRatio() { return this.rows !== void 0 && this.row !== void 0 ? this.rows : 1; @@ -28010,22 +28026,22 @@ ATOM`, b); getXRatio() { return this.cols !== void 0 && this.col !== void 0 ? this.cols : 1; } - getAspect(u, g) { - (u == null || g == null) && (u = this._canvas.width, g = this._canvas.height); - var p = u / g; + getAspect(u, p) { + (u == null || p == null) && (u = this._canvas.width, p = this._canvas.height); + var g = u / p; if (this.rows != null && this.cols != null && this.row != null && this.col != null) { - var b = u / this.cols, c = g / this.rows; - p = b / c; + var b = u / this.cols, c = p / this.rows; + g = b / c; } - return p; + return g; } - setTexture(u, g, p) { + setTexture(u, p, g) { if (u.needsUpdate) { - 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 + g); - var b = p ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D; + 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); - if (p) + 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; @@ -28033,7 +28049,7 @@ ATOM`, b); } u.needsUpdate = !1, u.onUpdate && u.onUpdate(); } else - this._gl.activeTexture(this._gl.TEXTURE0 + g), p ? this._gl.bindTexture(this._gl.TEXTURE_3D, u.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, u.__webglTexture); + this._gl.activeTexture(this._gl.TEXTURE0 + p), g ? this._gl.bindTexture(this._gl.TEXTURE_3D, u.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, u.__webglTexture); } supportsVolumetric() { return !this.isWebGL1(); @@ -28045,7 +28061,7 @@ ATOM`, b); for (let u in this._enabledAttributes) this._enabledAttributes[u] && (this._gl.disableVertexAttribArray(u), this._enabledAttributes[u] = !1); } - setPolygonOffset(u, g, p) { + setPolygonOffset(u, p, g) { this._oldPolygonOffset !== u && (u ? this._gl.enable(this._gl.POLYGON_OFFSET_FILL) : this._gl.disable(this._gl.POLYGON_OFFSET_FILL)); } setLineWidth(u) { @@ -28053,26 +28069,26 @@ ATOM`, b); } deallocateGeometry(u) { if (u.__webglInit = void 0, u.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(u.__webglVertexBuffer), u.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(u.__webglColorBuffer), u.geometryGroups !== void 0) - for (var g = 0, p = u.groups; g < p; g++) { - var b = u.geometryGroups[g]; + for (var p = 0, g = u.groups; p < g; p++) { + var b = u.geometryGroups[p]; b.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(b.__webglVertexBuffer), b.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(b.__webglColorBuffer), b.__webglNormalBuffer !== void 0 && this._gl.deleteBuffer(b.__webglNormalBuffer), b.__webglFaceBuffer !== void 0 && this._gl.deleteBuffer(b.__webglFaceBuffer), b.__webglLineBuffer !== void 0 && this._gl.deleteBuffer(b.__webglLineBuffer); } } deallocateMaterial(u) { - var g = u.program; - if (g !== void 0) { + var p = u.program; + if (p !== void 0) { u.program = void 0; - var p, b, c, _ = !1; - for (p = 0, b = this._programs.length; p < b; p++) - if (c = this._programs[p], c.program === g) { + var g, b, c, _ = !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); break; } if (_ === !0) { var E = []; - for (p = 0, b = this._programs.length; p < b; p++) - c = this._programs[p], c.program !== g && E.push(c); - this._programs = E, this._gl.deleteProgram(g), this.info.memory.programs--; + for (g = 0, b = this._programs.length; g < b; g++) + c = this._programs[g], c.program !== p && E.push(c); + this._programs = E, this._gl.deleteProgram(p), this.info.memory.programs--; } } } @@ -28086,40 +28102,40 @@ ATOM`, b); } } onGeometryDispose(u) { - var g = u.target; - g.removeEventListener("dispose", this.onGeometryDispose), this.deallocateGeometry(g), this.info.memory.geometries--; + var p = u.target; + p.removeEventListener("dispose", this.onGeometryDispose), this.deallocateGeometry(p), this.info.memory.geometries--; } onTextureDispose(u) { - var g = u.target; - g.removeEventListener("dispose", this.onTextureDispose), this.deallocateTexture(g), this.info.memory.textures--; + var p = u.target; + p.removeEventListener("dispose", this.onTextureDispose), this.deallocateTexture(p), this.info.memory.textures--; } onMaterialDispose(u) { - var g = u.target; - g.removeEventListener("dispose", this.onMaterialDispose), this.deallocateMaterial(g); + var p = u.target; + p.removeEventListener("dispose", this.onMaterialDispose), this.deallocateMaterial(p); } // Compile and return shader - getShader(u, g) { - var p; - return !this.isWebGL1() && !g.startsWith("#version") && (g = g.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), u == "fragment" ? g = g.replace(/varying/g, "in") : g = g.replace(/varying/g, "out"), g = g.replace(/attribute/g, "in"), g = g.replace(/texture2D/g, "texture"), g = g.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), g = g.replace(/gl_FragColor/g, "glFragColor"), g = `#version 300 es -` + g), u === "fragment" ? p = this._gl.createShader(this._gl.FRAGMENT_SHADER) : u === "vertex" && (p = this._gl.createShader(this._gl.VERTEX_SHADER)), p == null ? null : (this._gl.shaderSource(p, g), this._gl.compileShader(p), this._gl.getShaderParameter(p, this._gl.COMPILE_STATUS) ? p : (console.error(this._gl.getShaderInfoLog(p)), console.error("could not initialize shader"), null)); + getShader(u, p) { + var g; + return !this.isWebGL1() && !p.startsWith("#version") && (p = p.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), u == "fragment" ? p = p.replace(/varying/g, "in") : p = p.replace(/varying/g, "out"), p = p.replace(/attribute/g, "in"), p = p.replace(/texture2D/g, "texture"), p = p.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), p = p.replace(/gl_FragColor/g, "glFragColor"), p = `#version 300 es +` + p), u === "fragment" ? g = this._gl.createShader(this._gl.FRAGMENT_SHADER) : u === "vertex" && (g = this._gl.createShader(this._gl.VERTEX_SHADER)), g == null ? null : (this._gl.shaderSource(g, p), this._gl.compileShader(g), this._gl.getShaderParameter(g, this._gl.COMPILE_STATUS) ? g : (console.error(this._gl.getShaderInfoLog(g)), console.error("could not initialize shader"), null)); } // Compile appropriate shaders (if necessary) from source code and attach to // gl program. - buildProgram(u, g, p, b) { + buildProgram(u, p, g, b) { var c, _, E, w, k = []; - k.push(u), k.push(g); + 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++) { - var L = this._programs[c]; - if (L.code === w) - return L.usedTimes++, L.program; + var $ = this._programs[c]; + if ($.code === w) + return $.usedTimes++, $.program; } if (this.isWebGL1() && b.volumetric) throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware."); if (E = this._gl.createProgram(), E == null) return null; - var $ = this._precision, z = "precision " + $ + " float;", O = [ + var L = this._precision, z = "precision " + L + " float;", F = [ b.volumetric ? "#version 300 es" : "", z ].join(` @@ -28130,7 +28146,7 @@ ATOM`, b); b.wireframe ? "#define WIREFRAME 1" : "", z ].join(` -`), P = this.getShader("fragment", R + u), U = this.getShader("vertex", O + g); +`), 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 = [ @@ -28141,7 +28157,7 @@ ATOM`, b); "vWidth", "vHeight" ]; - for (B in p) + for (B in g) N.push(B); for (W = 0; W < N.length; W++) { var V = N[W]; @@ -28164,92 +28180,92 @@ ATOM`, b); usedTimes: 1 }), this.info.memory.programs = this._programs.length, E; } - setProgram(u, g, p, b, c, _) { - if (b.needsUpdate && (b.program && this.deallocateMaterial(b), this.initMaterial(b, g, p, c), b.needsUpdate = !1), b.program == null) + setProgram(u, p, g, b, c, _) { + 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, L = b.uniforms; + var E = !1, w = b.program, k = w.uniforms, $ = b.uniforms; if (w != this._currentProgram && (this._gl.useProgram(w), this._currentProgram = w, E = !0), b.id != this._currentMaterialId && (this._currentMaterialId = b.id, E = !0), u != this._currentCamera && (this._currentCamera = u, E = !0), k.projectionMatrix && this._gl.uniformMatrix4fv(k.projectionMatrix, !1, u.projectionMatrix.elements), k.modelViewMatrix && this._gl.uniformMatrix4fv(k.modelViewMatrix, !1, c._modelViewMatrix.elements), k.normalMatrix && this._gl.uniformMatrix3fv(k.normalMatrix, !1, c._normalMatrix.elements), k.projinv && (this._projInverse.getInverse(u.projectionMatrix), this._gl.uniformMatrix4fv(k.projinv, !1, this._projInverse.elements)), k.viewMatrix && this._gl.uniformMatrix4fv(k.viewMatrix, !1, u.matrixWorldInverse.elements), k.vWidth && this._gl.uniform1f(k.vWidth, this._viewportWidth), k.vHeight && this._gl.uniform1f(k.vHeight, this._viewportHeight), E) { - if (L.fogColor.value = p.color, L.fogNear.value = p.near, L.fogFar.value = p.far, b.shaderID.startsWith("lambert") || b.shaderID === "instanced" || b.shaderID.endsWith("imposter")) - this._lightsNeedUpdate && (this.setupLights(w, g), this._lightsNeedUpdate = !1), L.directionalLightColor.value = this._lights.directional.colors, L.directionalLightDirection.value = this._lights.directional.positions; + if ($.fogColor.value = g.color, $.fogNear.value = g.near, $.fogFar.value = g.far, b.shaderID.startsWith("lambert") || b.shaderID === "instanced" || b.shaderID.endsWith("imposter")) + this._lightsNeedUpdate && (this.setupLights(w, p), this._lightsNeedUpdate = !1), $.directionalLightColor.value = this._lights.directional.colors, $.directionalLightDirection.value = this._lights.directional.positions; else if (b.shaderID.endsWith("outline")) - L.outlineColor.value = b.outlineColor, L.outlineWidth.value = b.outlineWidth, L.outlinePushback.value = b.outlinePushback, L.outlineMaxPixels.value = b.outlineMaxPixels * this.devicePixelRatio; + $.outlineColor.value = b.outlineColor, $.outlineWidth.value = b.outlineWidth, $.outlinePushback.value = b.outlinePushback, $.outlineMaxPixels.value = b.outlineMaxPixels * this.devicePixelRatio; 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 $ = Math.min(Math.min(this._direction.x, this._direction.y), this._direction.z); - L.step.value = c.material.unit * $, L.maxdepth.value = c.material.maxdepth * $, L.transfermax.value = c.material.transfermax, L.transfermin.value = c.material.transfermin, L.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); + 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); } - L.opacity.value = b.opacity, this.loadMaterialUniforms(k, L); + $.opacity.value = b.opacity, this.loadMaterialUniforms(k, $); } - return L.shading && (L.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; + 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, g) { - var p, b, c, _; - for (p in g) - u[p] && (b = g[p].type, c = g[p].value, _ = u[p], 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])); + loadMaterialUniforms(u, p) { + var g, b, c, _; + 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])); } // Objects adding - addObject(u, g) { - var p, b, c, _; + 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)) - for (c = u.geometry, p = 0, b = c.geometryGroups.length; p < b; p++) - _ = c.geometryGroups[p], _.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); + 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); if (!u.__webglActive) { if (u instanceof f.Mesh || u instanceof f.Line) - for (c = u.geometry, p = 0, b = c.geometryGroups.length; p < b; p++) - _ = c.geometryGroups[p], this.addBuffer(g.__webglObjects, _, u); - else u instanceof f.Sprite && g.__webglSprites.push(u); + for (c = u.geometry, g = 0, b = c.geometryGroups.length; g < b; g++) + _ = c.geometryGroups[g], this.addBuffer(p.__webglObjects, _, u); + else u instanceof f.Sprite && p.__webglSprites.push(u); u.__webglActive = !0; } } updateObject(u) { - var g = u.geometry, p; + var p = u.geometry, g; if (u instanceof f.Mesh || u instanceof f.Line) { - for (var b = 0, c = g.geometryGroups.length; b < c; b++) - p = g.geometryGroups[b], (g.verticesNeedUpdate || g.elementsNeedUpdate || g.colorsNeedUpdate || g.normalsNeedUpdate) && this.setBuffers(p, this._gl.STATIC_DRAW); - g.verticesNeedUpdate = !1, g.elementsNeedUpdate = !1, g.normalsNeedUpdate = !1, g.colorsNeedUpdate = !1, g.buffersNeedUpdate = !1; + for (var b = 0, c = p.geometryGroups.length; b < c; b++) + g = p.geometryGroups[b], (p.verticesNeedUpdate || p.elementsNeedUpdate || p.colorsNeedUpdate || p.normalsNeedUpdate) && this.setBuffers(g, this._gl.STATIC_DRAW); + p.verticesNeedUpdate = !1, p.elementsNeedUpdate = !1, p.normalsNeedUpdate = !1, p.colorsNeedUpdate = !1, p.buffersNeedUpdate = !1; } } - removeObject(u, g) { - u instanceof f.Mesh || u instanceof f.Line ? this.removeInstances(g.__webglObjects, u) : u instanceof f.Sprite && this.removeInstancesDirect(g.__webglSprites, u), u.__webglActive = !1; + removeObject(u, p) { + u instanceof f.Mesh || u instanceof f.Line ? this.removeInstances(p.__webglObjects, u) : u instanceof f.Sprite && this.removeInstancesDirect(p.__webglSprites, u), u.__webglActive = !1; } - removeInstances(u, g) { - for (var p = u.length - 1; p >= 0; --p) - u[p].object === g && u.splice(p, 1); + removeInstances(u, p) { + for (var g = u.length - 1; g >= 0; --g) + u[g].object === p && u.splice(g, 1); } - removeInstancesDirect(u, g) { - for (var p = u.length - 1; p >= 0; --p) - u[p] === g && u.splice(p, 1); + removeInstancesDirect(u, p) { + for (var g = u.length - 1; g >= 0; --g) + u[g] === p && u.splice(g, 1); } unrollBufferMaterial(u) { - var g = u.object, p = g.material; - if (p.volumetric) - u.opaque = null, u.transparent = null, u.volumetric = p; - else if (p.transparent) { - if (u.opaque = null, u.volumetric = null, u.transparent = p, !p.wireframe) { - let b = p.clone(); + var p = u.object, g = p.material; + if (g.volumetric) + u.opaque = null, u.transparent = null, u.volumetric = g; + else if (g.transparent) { + if (u.opaque = null, u.volumetric = null, u.transparent = g, !g.wireframe) { + let b = g.clone(); b.opacity = 0, u.transparentDepth = b; } } else { - if (u.opaque = p, u.transparent = null, u.volumetric = null, !p.wireframe) { - let b = p.clone(); + if (u.opaque = g, u.transparent = null, u.volumetric = null, !g.wireframe) { + let b = g.clone(); b.opacity = 0, u.opaqueDepth = b; } - p.hasAO && (u.hasAO = !0), (this._AOEnabled || u.hasAO) && (u.opaqueShaded = p.clone(), u.opaqueShaded.shaded = !0); + g.hasAO && (u.hasAO = !0), (this._AOEnabled || u.hasAO) && (u.opaqueShaded = g.clone(), u.opaqueShaded.shaded = !0); } } - setBuffers(u, g) { - var p = u.vertexArray, b = u.colorArray; - if (u.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, g)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, g)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, b, g), u.normalArray && u.__webglNormalBuffer !== void 0) { + setBuffers(u, p) { + var g = u.vertexArray, b = u.colorArray; + if (u.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, g, p)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, g, p)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, b, p), u.normalArray && u.__webglNormalBuffer !== void 0) { var c = u.normalArray; - this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, c, g); + 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, g)), u.faceArray && u.__webglFaceBuffer !== void 0) { + 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, _, g); + this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, _, p); } if (u.lineArray && u.__webglLineBuffer !== void 0) { var E = u.lineArray; - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglLineBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, E, g); + this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglLineBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, E, p); } } // Creates appropriate gl buffers for geometry chunk @@ -28261,37 +28277,37 @@ ATOM`, b); createLineBuffers(u) { u.__webglVertexBuffer = this._gl.createBuffer(), u.__webglColorBuffer = this._gl.createBuffer(), this.info.memory.geometries++; } - addBuffer(u, g, p) { + addBuffer(u, p, g) { u.push({ - buffer: g, - object: p, + buffer: p, + object: g, opaque: null, transparent: null }); } - setupMatrices(u, g) { - u._modelViewMatrix.multiplyMatrices(g.matrixWorldInverse, u.matrixWorld), u._normalMatrix.getInverse(u._modelViewMatrix), u._normalMatrix.transpose(); + setupMatrices(u, p) { + u._modelViewMatrix.multiplyMatrices(p.matrixWorldInverse, u.matrixWorld), u._normalMatrix.getInverse(u._modelViewMatrix), u._normalMatrix.transpose(); } // Fallback filters for non-power-of-2 textures filterFallback(u) { return this._gl.LINEAR; } - setTextureParameters(u, g) { - u == this._gl.TEXTURE_2D ? (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this.filterFallback(g.magFilter)), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this.filterFallback(g.minFilter))) : (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_R, this._gl.CLAMP_TO_EDGE), this._extColorBufferFloat && this._extFloatLinear ? (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR)) : (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST))); + setTextureParameters(u, p) { + u == this._gl.TEXTURE_2D ? (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this.filterFallback(p.magFilter)), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this.filterFallback(p.minFilter))) : (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_R, this._gl.CLAMP_TO_EDGE), this._extColorBufferFloat && this._extFloatLinear ? (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR)) : (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST))); } // Map constants to WebGL constants paramToGL(u) { return u === s.UnsignedByteType ? this._gl.UNSIGNED_BYTE : u === s.RGBAFormat ? this._gl.RGBA : u === s.NearestFilter ? this._gl.NEAREST : 0; } - setupLights(u, g) { - var p, b, c, _ = 0, E = 0, w = 0, k, L, $ = this._lights, z = $.directional.colors, O = $.directional.positions, R = 0, P = 0; - for (p = 0, b = g.length; p < b; p++) - if (c = g[p], k = c.color, L = c.intensity, c instanceof h.Light) { + 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; + 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; - O[P] = this._direction.x, O[P + 1] = this._direction.y, O[P + 2] = this._direction.z, z[P] = k.r * L, z[P + 1] = k.g * L, z[P + 2] = k.b * L, P += 3, R++; + 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++; } - $.ambient[0] = _, $.ambient[1] = E, $.ambient[2] = w, $.directional.length = R; + L.ambient[0] = _, L.ambient[1] = E, L.ambient[2] = w, L.directional.length = R; } initGL() { try { @@ -28323,8 +28339,8 @@ ATOM`, b); throw "Error creating WebGL context."; var u = this._gl.getParameter(this._gl.VERSION); this._webglversion = parseInt(u[6]); - } catch (g) { - console.error(g); + } catch (p) { + console.error(p); } } isWebGL1() { @@ -28334,23 +28350,23 @@ 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, g, p, b, c, _, E) { - var w, k, L, $, z, O, R; - g ? (z = u.length - 1, O = -1, R = -1) : (z = 0, O = u.length, R = 1); - for (var P = z; P !== O; P += R) + 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) { - if (k = w.object, L = w.buffer, $ = w[p], (w.hasAO || this._AOEnabled) && w[p + "Shaded"] && ($ = w[p + "Shaded"]), !$) + 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($.depthTest), this.setDepthWrite($.depthWrite), this.setPolygonOffset($.polygonOffset, $.polygonOffsetFactor, $.polygonOffsetUnits); + 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($, U), this.renderBuffer(b, c, _, $, L, k), (this._outlineEnabled || $.outline) && !$.wireframe && $.shaderID !== "basic" && $.opacity !== 0) { + 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; - $.shaderID == "sphereimposter" ? N = this._outlineSphereImposterMaterial : $.shaderID == "stickimposter" && (N = this._outlineStickImposterMaterial), this.renderBuffer(b, c, _, N, L, k); + L.shaderID == "sphereimposter" ? N = this._outlineSphereImposterMaterial : L.shaderID == "stickimposter" && (N = this._outlineStickImposterMaterial), this.renderBuffer(b, c, _, N, $, k); } } } - renderSprites(u, g, p) { - this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(u, g, this._currentWidth, this._currentHeight, p), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; + renderSprites(u, p, g) { + this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(u, p, this._currentWidth, this._currentHeight, g), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; } } } @@ -28398,7 +28414,7 @@ ATOM`, b); 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; } render(o, d, v, f, y) { - var A, x, M, m, l, u, g, p, b, c; + var A, x, M, m, l, u, p, g, b, c; if (!this.gl) throw new Error("WebGLRenderer not initialized"); let _ = []; @@ -28411,10 +28427,10 @@ ATOM`, b); const w = this.sprite.attributes, k = this.sprite.uniforms; if (!k) throw new Error("Uniforms not defined"); - var L = v * 0.5, $ = f * 0.5; + var $ = v * 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, O = 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, O = 1) : (this.gl.uniform1i(k.fogType, 0), z = 0, O = 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++) @@ -28423,9 +28439,9 @@ ATOM`, b); 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) / L, ($ - U.position.y * this.renderer.devicePixelRatio) / $, 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 = O : 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; + 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, ((g = N?.uvOffset) === null || g === void 0 ? void 0 : g.y) || 0), this.gl.uniform2f(k.alignment, Q || 0, te || 0), this.gl.uniform1f(k.opacity, N.opacity), this.gl.uniform3f(k.color, ((p = N?.color) === null || p === void 0 ? void 0 : p.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); + 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); } this.gl.enable(this.gl.CULL_FACE); } @@ -28878,8 +28894,8 @@ ATOM`, b); throw new Error("vertex array not initialized"); if (!M) throw new Error("normal array not initialized"); - for (var m, l, u, g, p, b, c, _ = 0; _ < A.length / 3; ++_) - m = A[_ * 3] * 3, l = A[_ * 3 + 1] * 3, u = A[_ * 3 + 2] * 3, g = new s.Vector3(x[m], x[m + 1], x[m + 2]), p = new s.Vector3(x[l], x[l + 1], x[l + 2]), b = new s.Vector3(x[u], x[u + 1], x[u + 2]), g.subVectors(g, p), b.subVectors(b, p), b.cross(g), 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, _ = 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; } } /* sets line index array from face arr @@ -28893,13 +28909,13 @@ ATOM`, b); if (this.lineidx = this.faceidx * 2, !A) throw new Error("face array not initialized"); for (var M = 0; M < this.faceidx / 3; ++M) { - var m = M * 3, l = m * 2, u = A[m], g = A[m + 1], p = A[m + 2]; - x[l] = u, x[l + 1] = g, x[l + 2] = u, x[l + 3] = p, x[l + 4] = g, x[l + 5] = p; + var m = M * 3, l = m * 2, u = A[m], p = A[m + 1], g = A[m + 2]; + x[l] = u, x[l + 1] = p, x[l + 2] = u, x[l + 3] = g, x[l + 4] = p, x[l + 5] = g; } } } vrml(A, x) { - var M, m, l, u, g, p, b, c, _, E, w, k, L, $, z, O, R, P, U = ""; + var M, m, l, u, p, g, b, c, _, E, w, k, $, L, z, F, R, P, U = ""; if (U += A + `Shape { ` + A + ` appearance Appearance { ` + A + ` material Material { @@ -28923,7 +28939,7 @@ ATOM`, b); 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 = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[H + 1], V = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[H + 2], U += A + " " + B + " " + W + " " + V + `, + 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 + `, `; } if (U += A + ` ] @@ -28974,7 +28990,7 @@ ATOM`, b); `; for (let G = 0; G < this.vertices; ++G) { let H = G * 3; - B = (L = this.normalArray) === null || L === void 0 ? void 0 : L[H], W = ($ = this.normalArray) === null || $ === void 0 ? void 0 : $[H + 1], V = (z = this.normalArray) === null || z === void 0 ? void 0 : z[H + 2], U += A + " " + B + " " + W + " " + V + `, + 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 + `, `; } if (U += A + ` ] @@ -28995,7 +29011,7 @@ ATOM`, b); U += A + ` coordIndex [ `; for (let G = 0; G < this.faceidx; G += 3) - B = (O = this.faceArray) === null || O === void 0 ? void 0 : O[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, + 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, `; U += A + ` ] `, U += A + `} @@ -29004,8 +29020,8 @@ ATOM`, b); return U += N + "}", U; } truncateArrayBuffers(A = !0, x = !1) { - var M = this.vertexArray, m = this.colorArray, l = this.normalArray, u = this.faceArray, g = this.lineArray, p = 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 = g?.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)), p && (this.radiusArray = p.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; + 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; } } class v extends a.EventDispatcher { @@ -29282,70 +29298,70 @@ ATOM`, b); /*! ../shapes */ "./src/WebGL/shapes/index.ts" ); - const s = (g, p) => g.distance - p.distance, h = new r.Matrix4(); + const s = (p, g) => p.distance - g.distance, h = new r.Matrix4(); class o { - constructor(p, b, c, _) { - this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new r.Ray(p, b), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = _ || 0, this.far = c || 1 / 0; + 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; } - set(p, b) { - this.ray.set(p, b); + set(g, b) { + this.ray.set(g, b); } - setFromCamera(p, b) { - b.ortho ? (this.ray.origin.set(p.x, p.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(p.x, p.y, p.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()); + setFromCamera(g, 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(p, b) { + intersectObjects(g, b) { for (var c = [], _ = 0, E = b.length; _ < E; _++) - u(p, b[_], this, c); + u(g, b[_], this, c); return c.sort(s), c; } } - const d = (g) => Math.min(Math.max(g, -1), 1); + 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(); - function u(g, p, b, c) { - if (l.getPositionFromMatrix(g.matrixWorld), p.intersectionShape === void 0) + function u(p, g, b, c) { + if (l.getPositionFromMatrix(p.matrixWorld), g.intersectionShape === void 0) return c; - var _ = p.intersectionShape, E = b.linePrecision; - E *= g.matrixWorld.getMaxScaleOnAxis(); + var _ = g.intersectionShape, E = b.linePrecision; + E *= p.matrixWorld.getMaxScaleOnAxis(); var w = E * E; - if (p.boundingSphere !== void 0 && p.boundingSphere instanceof a.Sphere && (v.copy(p.boundingSphere), v.applyMatrix4(g.matrixWorld), !b.ray.isIntersectionSphere(v))) + if (g.boundingSphere !== void 0 && g.boundingSphere instanceof a.Sphere && (v.copy(g.boundingSphere), v.applyMatrix4(p.matrixWorld), !b.ray.isIntersectionSphere(v))) return c; - var k, L, $, z, O, R, P, U, N, B, W, V, G, H; - for (k = 0, L = _.triangle.length; k < L; k++) + 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(g.matrixWorld), $ = y.getNormal(), z = b.ray.direction.dot($), z >= 0 || (A.subVectors(y.a, b.ray.origin), P = $.dot(A) / z, P < 0)) + 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)) 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)) continue; - c.push({ clickable: p, distance: P }); + c.push({ clickable: g, distance: P }); } - for (k = 0, L = _.cylinder.length; k < L; k++) + for (k = 0, $ = _.cylinder.length; k < $; k++) if (_.cylinder[k] instanceof a.Cylinder) { - if (f.copy(_.cylinder[k]), f.applyMatrix4(g.matrixWorld), A.subVectors(f.c1, b.ray.origin), O = A.dot(f.direction), R = A.dot(b.ray.direction), z = d(b.ray.direction.dot(f.direction)), N = 1 - z * z, N === 0) + 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) continue; - G = (z * R - O) / N, H = (R - z * O) / 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(); + 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 * O - R) * (z * O - R) - N * (A.lengthSq() - O * O - ce), B <= 0 ? V = P = Math.sqrt(U) : V = P = (R - z * O - Math.sqrt(B)) / N, W = z * V - O, W < 0 || W * W > f.lengthSq() || V < 0) + 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) continue; - c.push({ clickable: p, distance: P }); + c.push({ clickable: g, distance: P }); } } - for (k = 0, L = _.line.length; k < L; k += 2) { - x.copy(_.line[k]), x.applyMatrix4(g.matrixWorld), M.copy(_.line[k + 1]), M.applyMatrix4(g.matrixWorld), m.subVectors(M, x); + 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(); 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: p, distance: H })); + 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, L = _.sphere.length; k < L; k++) - if (_.sphere[k] instanceof a.Sphere && (v.copy(_.sphere[k]), v.applyMatrix4(g.matrixWorld), b.ray.isIntersectionSphere(v))) { + 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) return c; - B <= 0 ? P = he : P = he - Math.sqrt(B), c.push({ clickable: p, distance: P }); + B <= 0 ? P = he : P = he - Math.sqrt(B), c.push({ clickable: g, distance: P }); } return c; } @@ -30783,16 +30799,16 @@ ATOM`, b); "./src/WebGL/math/utils/clamp.ts" ), s, h, o, d, v; class f { - constructor(m = 1, l = 0, u = 0, g = 0, p = 0, b = 1, c = 0, _ = 0, E = 0, w = 0, k = 1, L = 0, $ = 0, z = 0, O = 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] = g, this.elements[1] = p, 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] = L, this.elements[3] = $, this.elements[7] = z, this.elements[11] = O, this.elements[15] = R); + 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); } // 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, g, p, b, c, _, E, w, k, L, $, z, O, R) { + 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] = g, P[1] = p, P[5] = b, P[9] = c, P[13] = _, P[2] = E, P[6] = w, P[10] = k, P[14] = L, P[3] = $, P[7] = z, P[11] = O, P[15] = R, this; + 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; } identity() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this; @@ -30806,21 +30822,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: g, y: p, z: b } = m, c = Math.cos(g), _ = Math.sin(g), E = Math.cos(p), w = Math.sin(p), k = Math.cos(b), L = Math.sin(b); + 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); if (l === void 0 || l === "XYZ") { - const $ = c * k, z = c * L, O = _ * k, R = _ * L; - u[0] = E * k, u[4] = -E * L, u[8] = w, u[1] = z + O * w, u[5] = $ - R * w, u[9] = -_ * E, u[2] = R - $ * w, u[6] = O + z * w, u[10] = c * E; + 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; } else console.error(`Error with matrix4 setRotationFromEuler. Order: ${l}`); return this; } setRotationFromQuaternion(m) { - const l = this.elements, { x: u, y: g, z: p, w: b } = m, c = u + u, _ = g + g, E = p + p, w = u * c, k = u * _, L = u * E, $ = g * _, z = g * E, O = p * E, R = b * c, P = b * _, U = b * E; - return l[0] = 1 - ($ + O), l[4] = k - U, l[8] = L + P, l[1] = k + U, l[5] = 1 - (w + O), l[9] = z - R, l[2] = L - P, l[6] = z + R, l[10] = 1 - (w + $), this; + 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; } multiplyMatrices(m, l) { - const u = m.elements, g = l.elements, p = this.elements, b = u[0], c = u[4], _ = u[8], E = u[12], w = u[1], k = u[5], L = u[9], $ = u[13], z = u[2], O = u[6], R = u[10], P = u[14], U = u[3], N = u[7], B = u[11], W = u[15], V = g[0], G = g[4], H = g[8], Q = g[12], te = g[1], ee = g[5], ce = g[9], fe = g[13], oe = g[2], he = g[6], Ae = g[10], Se = g[14], Ie = g[3], pe = g[7], le = g[11], ne = g[15]; - return p[0] = b * V + c * te + _ * oe + E * Ie, p[4] = b * G + c * ee + _ * he + E * pe, p[8] = b * H + c * ce + _ * Ae + E * le, p[12] = b * Q + c * fe + _ * Se + E * ne, p[1] = w * V + k * te + L * oe + $ * Ie, p[5] = w * G + k * ee + L * he + $ * pe, p[9] = w * H + k * ce + L * Ae + $ * le, p[13] = w * Q + k * fe + L * Se + $ * ne, p[2] = z * V + O * te + R * oe + P * Ie, p[6] = z * G + O * ee + R * he + P * pe, p[10] = z * H + O * ce + R * Ae + P * le, p[14] = z * Q + O * fe + R * Se + P * ne, p[3] = U * V + N * te + B * oe + W * Ie, p[7] = U * G + N * ee + B * he + W * pe, p[11] = U * H + N * ce + B * Ae + W * le, p[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], _ = 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; } multiplyScalar(m) { const l = this.elements; @@ -30833,9 +30849,9 @@ ATOM`, b); // useful and identifying identity matrices snap(m) { const l = Math.pow(10, 4), u = this.elements; - for (let g = 0; g < 16; g++) { - const p = Math.round(u[g]); - p === Math.round(u[g] * l) / l && (u[g] = p); + for (let p = 0; p < 16; p++) { + const g = Math.round(u[p]); + g === Math.round(u[p] * l) / l && (u[p] = g); } return this; } @@ -30853,9 +30869,9 @@ ATOM`, b); return l[12] += m.x, l[13] += m.y, l[14] += m.z, this; } getInverse(m, l) { - const u = this.elements, g = m.elements, p = g[0], b = g[4], c = g[8], _ = g[12], E = g[1], w = g[5], k = g[9], L = g[13], $ = g[2], z = g[6], O = g[10], R = g[14], P = g[3], U = g[7], N = g[11], B = g[15]; - u[0] = k * R * U - L * O * U + L * z * N - w * R * N - k * z * B + w * O * B, u[4] = _ * O * U - c * R * U - _ * z * N + b * R * N + c * z * B - b * O * B, u[8] = c * L * U - _ * k * U + _ * w * N - b * L * N - c * w * B + b * k * B, u[12] = _ * k * z - c * L * z - _ * w * O + b * L * O + c * w * R - b * k * R, u[1] = L * O * P - k * R * P - L * $ * N + E * R * N + k * $ * B - E * O * B, u[5] = c * R * P - _ * O * P + _ * $ * N - p * R * N - c * $ * B + p * O * B, u[9] = _ * k * P - c * L * P - _ * E * N + p * L * N + c * E * B - p * k * B, u[13] = c * L * $ - _ * k * $ + _ * E * O - p * L * O - c * E * R + p * k * R, u[2] = w * R * P - L * z * P + L * $ * U - E * R * U - w * $ * B + E * z * B, u[6] = _ * z * P - b * R * P - _ * $ * U + p * R * U + b * $ * B - p * z * B, u[10] = b * L * P - _ * w * P + _ * E * U - p * L * U - b * E * B + p * w * B, u[14] = _ * w * $ - b * L * $ - _ * E * z + p * L * z + b * E * R - p * w * R, u[3] = k * z * P - w * O * P - k * $ * U + E * O * U + w * $ * N - E * z * N, u[7] = b * O * P - c * z * P + c * $ * U - p * O * U - b * $ * N + p * z * N, u[11] = c * w * P - b * k * P - c * E * U + p * k * U + b * E * N - p * w * N, u[15] = b * k * $ - c * w * $ + c * E * z - p * k * z - b * E * O + p * w * O; - const W = p * u[0] + E * u[4] + $ * u[8] + P * u[12]; + 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]; if (W === 0) { const V = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; if (l) @@ -30865,33 +30881,33 @@ ATOM`, b); return this.multiplyScalar(1 / W), this; } isReflected() { - const m = this.elements, l = m[0], u = m[4], g = m[8], p = 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], _ = m[2], E = m[6], w = m[10]; return l * b * w + // +aei - p * E * g + // +bfg + g * E * p + // +bfg _ * u * c - // +cdh - _ * b * g - // -ceg - p * u * w - // -bdi + _ * b * p - // -ceg + g * u * w - // -bdi l * E * c < 0; } scale(m) { - const l = this.elements, { x: u } = m, { y: g } = m, { z: p } = m; - return l[0] *= u, l[4] *= g, l[8] *= p, l[1] *= u, l[5] *= g, l[9] *= p, l[2] *= u, l[6] *= g, l[10] *= p, l[3] *= u, l[7] *= g, l[11] *= p, this; + const l = this.elements, { x: u } = m, { y: p } = m, { z: g } = m; + return l[0] *= u, l[4] *= p, l[8] *= g, l[1] *= u, l[5] *= p, l[9] *= g, l[2] *= u, l[6] *= p, l[10] *= g, l[3] *= u, l[7] *= p, l[11] *= g, this; } getMaxScaleOnAxis() { - const m = this.elements, l = m[0] * m[0] + m[1] * m[1] + m[2] * m[2], u = m[4] * m[4] + m[5] * m[5] + m[6] * m[6], g = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; - return Math.sqrt(Math.max(l, Math.max(u, g))); + const m = this.elements, l = m[0] * m[0] + m[1] * m[1] + m[2] * m[2], u = m[4] * m[4] + m[5] * m[5] + m[6] * m[6], p = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + return Math.sqrt(Math.max(l, Math.max(u, p))); } - makeFrustum(m, l, u, g, p, b) { - const c = this.elements, _ = 2 * p / (l - m), E = 2 * p / (g - u), w = (l + m) / (l - m), k = (g + u) / (g - u), L = -(b + p) / (b - p), $ = -2 * b * p / (b - p); - 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] = L, c[14] = $, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this; + 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; } - makePerspective(m, l, u, g) { - const p = u * Math.tan((0, r.degToRad)(m * 0.5)), b = -p, c = b * l, _ = p * l; - return this.makeFrustum(c, _, b, p, u, g); + 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); } - makeOrthographic(m, l, u, g, p, b) { - const c = this.elements, _ = 1 / (l - m), E = 1 / (u - g), w = 1 / (b - p), k = (l + m) * _, L = (u + g) * E, $ = (b + p) * 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] = -L, c[2] = 0, c[6] = 0, c[10] = -2 * w, c[14] = -$, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this; + 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; } isEqual(m) { const l = m.elements, u = this.elements; @@ -30914,12 +30930,12 @@ ATOM`, b); 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; } lookAt(m, l, u) { - const g = 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), g[0] = o.x, g[4] = d.x, g[8] = v.x, g[1] = o.y, g[5] = d.y, g[9] = v.y, g[2] = o.z, g[6] = d.z, g[10] = v.z, this; + 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; } compose(m, l, u) { - const g = this.elements; - return s.identity(), s.setRotationFromQuaternion(l), h.makeScale(u.x, u.y, u.z), this.multiplyMatrices(s, h), g[12] = m.x, g[13] = m.y, g[14] = m.z, this; + const p = this.elements; + return s.identity(), s.setRotationFromQuaternion(l), h.makeScale(u.x, u.y, u.z), this.multiplyMatrices(s, h), p[12] = m.x, p[13] = m.y, p[14] = m.z, this; } } s = new f(), h = new f(); @@ -30966,26 +30982,26 @@ ATOM`, b); return Math.sqrt(this.distanceToSquared(m)); } distanceToSquared(m) { - const l = this.x - m.x, u = this.y - m.y, g = this.z - m.z; - return l * l + u * u + g * g; + const l = this.x - m.x, u = this.y - m.y, p = this.z - m.z; + return l * l + u * u + p * p; } applyMatrix3(m) { - const { x: l } = this, { y: u } = this, { z: g } = this, p = m.elements; - return this.x = p[0] * l + p[3] * u + p[6] * g, this.y = p[1] * l + p[4] * u + p[7] * g, this.z = p[2] * l + p[5] * u + p[8] * g, this; + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.elements; + return this.x = g[0] * l + g[3] * u + g[6] * p, this.y = g[1] * l + g[4] * u + g[7] * p, this.z = g[2] * l + g[5] * u + g[8] * p, this; } applyMatrix4(m) { - const { x: l } = this, { y: u } = this, { z: g } = this, p = m.elements; - return this.x = p[0] * l + p[4] * u + p[8] * g + p[12], this.y = p[1] * l + p[5] * u + p[9] * g + p[13], this.z = p[2] * l + p[6] * u + p[10] * g + p[14], this; + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.elements; + return this.x = g[0] * l + g[4] * u + g[8] * p + g[12], this.y = g[1] * l + g[5] * u + g[9] * p + g[13], this.z = g[2] * l + g[6] * u + g[10] * p + g[14], this; } applyProjection(m) { - const { x: l } = this, { y: u } = this, { z: g } = this, p = m.elements, b = p[3] * l + p[7] * u + p[11] * g + p[15]; - return this.x = (p[0] * l + p[4] * u + p[8] * g + p[12]) / b, this.y = (p[1] * l + p[5] * u + p[9] * g + p[13]) / b, this.z = (p[2] * l + p[6] * u + p[10] * g + p[14]) / b, this; + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.elements, b = g[3] * l + g[7] * u + g[11] * p + g[15]; + 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: g } = this, p = m.x, b = m.y, c = m.z, _ = m.w, E = {}; - E.x = 2 * (u * c - g * b), E.y = 2 * (g * p - l * c), E.z = 2 * (l * b - u * p); + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.x, b = m.y, c = m.z, _ = 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 * p - E.x * c, w.z = E.x * b - E.y * p, this.x = l + _ * E.x + w.x, this.y = u + _ * E.y + w.y, this.z = g + _ * 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 + _ * E.x + w.x, this.y = u + _ * E.y + w.y, this.z = p + _ * E.z + w.z, this; } negate() { return this.multiplyScalar(-1); @@ -31003,8 +31019,8 @@ ATOM`, b); return this.divideScalar(this.length()); } cross(m) { - const { x: l } = this, { y: u } = this, { z: g } = this; - return this.x = u * m.z - g * m.y, this.y = g * m.x - l * m.z, this.z = l * m.y - u * m.x, this; + const { x: l } = this, { y: u } = this, { z: p } = this; + return this.x = u * m.z - p * m.y, this.y = p * m.x - l * m.z, this.z = l * m.y - u * m.x, this; } crossVectors(m, l) { return this.x = m.y * l.z - m.z * l.y, this.y = m.z * l.x - m.x * l.z, this.z = m.x * l.y - m.y * l.x, this; @@ -31016,12 +31032,12 @@ 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, g = u[0], p = 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(-p, g)) : (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], _ = 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; } rotateAboutVector(m, l) { m.normalize(); - const u = Math.cos(l), g = Math.sin(l), p = this.clone().multiplyScalar(u), b = m.clone().cross(this).multiplyScalar(g), c = m.clone().multiplyScalar(m.clone().dot(this)).multiplyScalar(1 - u), _ = p.add(b).add(c); + 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; } setFromMatrixPosition(m) { @@ -31030,8 +31046,8 @@ ATOM`, b); } // unproject is defined after Matrix4 transformDirection(m) { - const { x: l } = this, { y: u } = this, { z: g } = this, p = m.elements; - return this.x = p[0] * l + p[4] * u + p[8] * g, this.y = p[1] * l + p[5] * u + p[9] * g, this.z = p[2] * l + p[6] * u + p[10] * g, this.normalize(); + const { x: l } = this, { y: u } = this, { z: p } = this, g = m.elements; + return this.x = g[0] * l + g[4] * u + g[8] * p, this.y = g[1] * l + g[5] * u + g[9] * p, this.z = g[2] * l + g[6] * u + g[10] * p, this.normalize(); } clone() { return new y(this.x, this.y, this.z); @@ -31043,12 +31059,12 @@ ATOM`, b); } o = new y(), d = new y(), v = new y(); class A { - constructor(m = 1, l = 0, u = 0, g = 0, p = 1, b = 0, c = 0, _ = 0, E = 1) { - this.elements = new Float32Array(9), this.set(m, l, u, g, p, b, c, _, E); + 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); } - set(m, l, u, g, p, b, c, _, E) { + set(m, l, u, p, g, b, c, _, E) { const w = this.elements; - return w[0] = m, w[3] = l, w[6] = u, w[1] = g, w[4] = p, 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] = _, w[8] = E, this; } identity() { return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this; @@ -31064,20 +31080,20 @@ ATOM`, b); getInverse3(m) { const l = m.elements, u = this.elements; u[0] = l[4] * l[8] - l[5] * l[7], u[3] = l[6] * l[5] - l[3] * l[8], u[6] = l[3] * l[7] - l[6] * l[4], u[1] = l[7] * l[2] - l[1] * l[8], u[4] = l[0] * l[8] - l[6] * l[2], u[7] = l[1] * l[6] - l[0] * l[7], u[2] = l[1] * l[5] - l[2] * l[4], u[5] = l[2] * l[3] - l[0] * l[5], u[8] = l[0] * l[4] - l[1] * l[3]; - const g = l[0] * u[0] + l[3] * u[1] + l[6] * u[2]; - return this.multiplyScalar(1 / g), this; + const p = l[0] * u[0] + l[3] * u[1] + l[6] * u[2]; + return this.multiplyScalar(1 / p), this; } getInverse(m, l) { - const u = m.elements, g = this.elements; - g[0] = u[10] * u[5] - u[6] * u[9], g[1] = -u[10] * u[1] + u[2] * u[9], g[2] = u[6] * u[1] - u[2] * u[5], g[3] = -u[10] * u[4] + u[6] * u[8], g[4] = u[10] * u[0] - u[2] * u[8], g[5] = -u[6] * u[0] + u[2] * u[4], g[6] = u[9] * u[4] - u[5] * u[8], g[7] = -u[9] * u[0] + u[1] * u[8], g[8] = u[5] * u[0] - u[1] * u[4]; - const p = u[0] * g[0] + u[1] * g[3] + u[2] * g[6]; - if (p === 0) { + const u = m.elements, p = this.elements; + p[0] = u[10] * u[5] - u[6] * u[9], p[1] = -u[10] * u[1] + u[2] * u[9], p[2] = u[6] * u[1] - u[2] * u[5], p[3] = -u[10] * u[4] + u[6] * u[8], p[4] = u[10] * u[0] - u[2] * u[8], p[5] = -u[6] * u[0] + u[2] * u[4], p[6] = u[9] * u[4] - u[5] * u[8], p[7] = -u[9] * u[0] + u[1] * u[8], p[8] = u[5] * u[0] - u[1] * u[4]; + const g = u[0] * p[0] + u[1] * p[3] + u[2] * p[6]; + if (g === 0) { const b = "Matrix3.getInverse(): can't invert matrix, determinant is 0"; if (l) throw new Error(b); return console.warn(b), this.identity(), this; } - return this.multiplyScalar(1 / p), this; + return this.multiplyScalar(1 / g), this; } // https://en.wikipedia.org/wiki/Determinant getDeterminant() { @@ -31123,8 +31139,8 @@ ATOM`, b); closestPointToPoint(m, l) { const u = l || new y(); u.subVectors(m, this.origin); - const g = u.dot(this.direction); - return u.copy(this.direction).multiplyScalar(g).add(this.origin); + const p = u.dot(this.direction); + return u.copy(this.direction).multiplyScalar(p).add(this.origin); } distanceToPoint(m) { const l = o, u = l.subVectors(m, this.origin).dot(this.direction); @@ -31605,7 +31621,7 @@ ATOM`, b); /* harmony export */ ShaderLib: () => ( /* binding */ - g + p ), /* harmony export */ basic: () => ( @@ -31720,7 +31736,7 @@ ATOM`, b); /*! ./blur */ "./src/WebGL/shaders/lib/blur/index.ts" ); - const g = { + const p = { basic: r.basic, blur: u.blur, instanced: a.instanced, @@ -32773,50 +32789,50 @@ ATOM`, b); d = !0, y = y ?? null; var l = 0; document.querySelectorAll(".viewer_3Dmoljs").forEach((u) => { - var g = [], p = [], b = ""; + var p = [], g = [], b = ""; u.style.position == "static" && (u.style.position = "relative"); var c = null; if (m = null, u.dataset.pdb) - g.push("https://files.rcsb.org/view/" + u.dataset.pdb + ".pdb"), p.push("pdb"); + p.push("https://files.rcsb.org/view/" + u.dataset.pdb + ".pdb"), g.push("pdb"); else if (u.dataset.cid) - p.push("sdf"), g.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + u.dataset.cid + "/SDF?record_type=3d"); + g.push("sdf"), p.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + u.dataset.cid + "/SDF?record_type=3d"); else if (u.dataset.href || u.dataset.url) { - if (u.dataset.href ? b = u.dataset.href : b = u.dataset.url, g.push(b), m = b.substring(b.lastIndexOf(".") + 1), m == "gz") { + if (u.dataset.href ? b = u.dataset.href : b = u.dataset.url, p.push(b), m = b.substring(b.lastIndexOf(".") + 1), m == "gz") { let pe = b.substring(0, b.lastIndexOf(".")).lastIndexOf("."); m = b.substring(pe + 1); } - p.push(m); + g.push(m); var _ = b.substring(b.lastIndexOf("/") + 1, b.lastIndexOf(".")); - _ == "/" && (_ = b.substring(b.lastIndexOf("/") + 1)), u.dataset[p[p.length - 1]] = _; + _ == "/" && (_ = b.substring(b.lastIndexOf("/") + 1)), u.dataset[g[g.length - 1]] = _; } let E = u.dataset; for (x in E) - x.substring(0, 3) === "pdb" && x !== "pdb" ? (g.push("https://files.rcsb.org/view/" + E[x] + ".pdb"), p.push("pdb")) : x.substring(0, 4) === "href" && x !== "href" ? (b = E[x], g.push(b), p.push(b.substring(b.lastIndexOf(".") + 1))) : x.substring(0, 3) === "cid" && x !== "cid" && (g.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + E[x] + "/SDF?record_type=3d"), p.push("sdf")); + x.substring(0, 3) === "pdb" && x !== "pdb" ? (p.push("https://files.rcsb.org/view/" + E[x] + ".pdb"), g.push("pdb")) : x.substring(0, 4) === "href" && x !== "href" ? (b = E[x], p.push(b), g.push(b.substring(b.lastIndexOf(".") + 1))) : x.substring(0, 3) === "cid" && x !== "cid" && (p.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + E[x] + "/SDF?record_type=3d"), g.push("sdf")); var w = {}; u.dataset.options && (w = (0, s.specStringToObject)(u.dataset.options)); - var k = h.CC.color(u.dataset.backgroundcolor), L = u.dataset.backgroundalpha; - L = L == null ? 1 : parseFloat(L); - var $ = { line: {} }; - u.dataset.style && ($ = (0, s.specStringToObject)(u.dataset.style)); + var k = h.CC.color(u.dataset.backgroundcolor), $ = u.dataset.backgroundalpha; + $ = $ == 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 O = [], R = [], P = [], U = {}, N = null, B = u.dataset, W = /style(.+)/, V = /surface(.*)/, G = /labelres(.*)/, H = []; + 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]), O.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])); + 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 fe = function(pe) { - for (pe.setStyle(z, $), c && c.createSelectionAndStyle(z, $), x = 0; x < O.length; x++) { - let le = O[x][0] || {}, ne = O[x][1] || { line: {} }; - pe.setStyle(le, ne), c && c.createSelectionAndStyle(z, $); + 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((Fe) => { - c.loadSurface("VDW", le, ne, Fe); + 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); } for (x = 0; x < P.length; x++) { @@ -32828,21 +32844,21 @@ ATOM`, b); let oe = y; try { var he = (0, s.specStringToObject)(u.dataset.config) || {}; - he.backgroundColor === void 0 && (he.backgroundColor = k), he.backgroundAlpha === void 0 && (he.backgroundAlpha = L), oe == null ? oe = v[u.id || l++] = (0, r.createViewer)(u, he) : (oe.setBackgroundColor(k, L), oe.setConfig(he), c && c.initiateUI()), u.dataset.ui && $3Dmol.StateManager && (c = new $3Dmol.StateManager(oe)); + 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)); } catch (pe) { console.log(pe), u.textContent = "WebGL appears to be disabled."; } - if (g.length != 0) { - let pe = 0, le = /* @__PURE__ */ ((ne, Te) => function(Fe) { - b = g[pe]; - var Be = ne.dataset.type || ne.dataset.datatype || p[pe]; - if (Te.addModel(Fe, Be, w), c) { - var Ue = ne.dataset[p[pe]]; + if (p.length != 0) { + let pe = 0, le = /* @__PURE__ */ ((ne, Te) => function(Oe) { + 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); } - pe += 1, pe < g.length ? (0, s.get)(g[pe]).then(le) : (fe(Te), ne.dataset.callback && (0, s.makeFunction)(ne.dataset.callback)(Te), d = !1, A && A(Te)); + 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)(g[0]).then(le) : (0, s.get)(g[0]).then(le); + m && m.endsWith("gz") ? (0, s.getbin)(p[0]).then(le) : (0, s.get)(p[0]).then(le); } else { if (u.dataset.element) { var Ae = "#" + u.dataset.element, Se = document.querySelector(Ae), Ie = Se ? Se.textContent : ""; @@ -32961,10 +32977,10 @@ ATOM`, b); if (l) { l[1] != "" && console.log("WARNING: Opacity value in rgba ignored. Specify separately as opacity attribute."); let u = 0; - for (let g = 2; g < 5; g++) { + for (let p = 2; p < 5; p++) { u *= 256; - let p = l[g].endsWith("%") ? 255 * parseFloat(l[g]) / 100 : parseFloat(l[g]); - u += Math.round(p); + let g = l[p].endsWith("%") ? 255 * parseFloat(l[p]) / 100 : parseFloat(l[p]); + u += Math.round(g); } return u; } @@ -33579,17 +33595,17 @@ ATOM`, b); /*! ./utilities */ "./src/utilities.ts" ); - function f(O, R) { - var P = [], U = O; - U = [], U.push(O[0]); + 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 = O.length - 1; N < B; N++) - if (G = O[N], H = O[N + 1], G.smoothen) { + 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); } else U.push(G); - for (U.push(O[O.length - 1]), N = -1, W = U.length; N <= W - 3; N++) + 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); @@ -33598,10 +33614,10 @@ ATOM`, b); return P.push(U[U.length - 1]), P; } const y = 0.5, A = 1.3, x = 0.8, M = 0.4, m = 0.4; - function l(O, R, P, U) { + 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 = O.updateGeoGroup(2), te = Q.vertexArray, ee = Q.colorArray, ce = Q.faceArray; + 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; @@ -33612,14 +33628,14 @@ ATOM`, b); Q.vertices += 2; } } - function u(O, R, P, U, N, B, W) { + function u(F, R, P, U, N, B, W) { var V, G, H, Q; if (H = R.length, H < 2 || R[0].length < 2) return; for (V = 0; V < H; V++) R[V] = f(R[V], U); if (Q = R[0].length, !N) - return l(O, R[0], R[H - 1], P); + 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); @@ -33632,11 +33648,11 @@ ATOM`, b); G + 1 - 4 * H, G - 2 * H ]; - var le, ne, Te, Fe, Be, Ue, Pe, Ge, Ne, Re; - let De = O.updateGeoGroup(); + var le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re; + let De = F.updateGeoGroup(); for (V = 0; V < Q; V++) { - let q = O.groups, re = !1; - De = O.updateGeoGroup(2 * H), q != O.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 && (Fe = R[0][V].atom, W === "oval" ? ee = Ae : W === "rectangle" ? ee = Se : W === "parabola" && (ee = Ie)), ee || (ee = Se); + 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 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]); @@ -33658,11 +33674,11 @@ ATOM`, b); 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 (Fe.clickable || Fe.hoverable) { + if (Oe.clickable || Oe.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) - Fe.intersectionShape.triangle.push(X[G]); + Oe.intersectionShape.triangle.push(X[G]); } } De.vertices += 2 * H; @@ -33677,38 +33693,38 @@ ATOM`, b); 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 g(O, R, P, U, N, B) { + 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(O, W, V, P); + return l(F, W, V, P); var G = [], H, Q, te, ee, ce, fe = [ [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, Fe, Be, Ue, Pe, Ge, Ne, Re, De; + ], 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); } - 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 = O.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, Fe = 0; Fe < 8; ++Fe) - Re[he + 3 * Fe] = Se.r, Re[he + 1 + 3 * Fe] = Se.g, Re[he + 2 + 3 * Fe] = Se.b; + 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 (Fe = 0; Fe < 4; Fe++) { + for (Oe = 0; Oe < 4; Oe++) { var q = [ - oe + fe[Fe][0], - oe + fe[Fe][1], - oe + fe[Fe][2], - oe + fe[Fe][3] + oe + fe[Oe][0], + oe + fe[Oe][1], + oe + fe[Oe][2], + oe + fe[Oe][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); - Fe % 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))); + 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)); } } @@ -33716,7 +33732,7 @@ ATOM`, b); Ge.vertices += 8, le = pe; } var ge = G.length - 8; - for (Ge = O.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++) { + 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; @@ -33724,36 +33740,36 @@ ATOM`, 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; } } - function p(O, R, P, U, N, B, W) { - (!W || W === "default") && (W = "rectangle"), W === "edged" ? g(O, R, P, U, N) : (W === "rectangle" || W === "oval" || W === "parabola") && u(O, R, P, U, N, B, W); + 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 b(O) { - return O && O.elem === "C" && O.atom === "CA"; + function b(F) { + return F && F.elem === "C" && F.atom === "CA"; } - function c(O, R) { - if (O && R && O.chain === R.chain) { - if (!O.hetflag && !R.hetflag && O.reschain === R.reschain && (O.resi === R.resi || O.resi === R.resi - 1)) + 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)) return !0; - if (O.resi < R.resi) { - var P = O.x - R.x, U = O.y - R.y, N = O.z - R.z, B = P * P + U * U + N * N; - if (O.atom == "CA" && R.atom == "CA" && B < 16) + 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) return !0; - if ((O.atom == "P" || R.atom == "P") && B < 64) + if ((F.atom == "P" || R.atom == "P") && B < 64) return !0; } } return !1; } - function _(O, R, P, U, N) { + 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); - O.add(W); + F.add(W); } } - function E(O, R, P, U, N, B, W, V, G) { + 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); @@ -33768,11 +33784,11 @@ ATOM`, b); oe.rotateAboutVector(Se, 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), O[Q].push(ee); + 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, O[Q].push(ee); - return fe = W.style.cartoon.style || "default", O.style ? O.style != fe && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), O.style = "default") : O.style = fe, (W.ss === "arrow start" || W.ss === "arrow end") && (W.ss = "s"), ce; + 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; } } const w = { @@ -33792,14 +33808,14 @@ ATOM`, b); "C2*": !0, N1: !0, N3: !0 - }, k = { DA: !0, DG: !0, A: !0, G: !0 }, L = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, $ = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; - function z(O, R, P, U = 10) { + }, 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, Fe = new s.Geometry(!0), Be = new s.Geometry(!0), Ue = [], Pe = [], Ge = 1, Ne = !1, Re = {}; + 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])); - var je = function(Z, Oe) { - return P && Oe.color === "spectrum" ? Oe.colorscheme in Re ? Re[Oe.colorscheme].valueToHex(Z.resi) : Re.sinebow.valueToHex(Z.resi) : (0, v.getColorFromStyle)(Z, Oe).getHex(); + 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(); }; for (ce = 0; ce < N; ce++) Pe[ce] = []; @@ -33813,36 +33829,36 @@ ATOM`, b); } X && G.style.cartoon.tubes && (G.ss = "tube end", X = !1); var ye = function(Z) { - Pe[0].length > 0 && p(Be, Pe, Ue, B, ee, Ge, Pe.style); - var Oe = [], We = null; + Pe[0].length > 0 && g(Be, Pe, Ue, B, ee, Ge, Pe.style); + var Fe = [], We = null; if (Z) { for (ce = 0; ce < N; ce++) - Oe[ce] = Pe[ce][Pe[ce].length - 1]; + 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(Oe[ce]); + Pe[ce].push(Fe[ce]); Ue.push(We); } - _(O, Be, Ge, Ne, !0), _(O, Fe, Ge, Ne, !1), Be = new s.Geometry(!0), Fe = new s.Geometry(!0); + _(F, Be, Ge, Ne, !0), _(F, Oe, Ge, Ne, !1), Be = new s.Geometry(!0), Oe = new s.Geometry(!0); }; G = void 0; for (var me = 0; me < q.length; me++) { H = q[me]; - var ze = H.resn.trim(), ke = ze in $; + 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(Fe, G, H, ee, K, 2, 2); + d.GLDraw.drawCylinder(Oe, G, H, ee, 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(Fe, G, ae, ee, ge, 2, 0), d.GLDraw.drawCylinder(Fe, ae, H, ee, xe, 0, 2); + d.GLDraw.drawCylinder(Oe, G, ae, ee, ge, 2, 0), d.GLDraw.drawCylinder(Oe, ae, H, ee, xe, 0, 2); } if ((H.clickable === !0 || H.hoverable) && H.intersectionShape !== void 0) { var ue = new r.Vector3(H.x, H.y, H.z); @@ -33855,13 +33871,13 @@ ATOM`, b); 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(Fe, le, ne, 2, o.CC.color(Q), 1, 1), H.ss = "h"; + 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(Fe, le, ne, 2, o.CC.color(Q), 1, 1); + 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); 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(Fe, 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 && p(Be, Pe, Ue, B, ee, Ge, Pe.style), Pe = [], ce = 0; ce < N; ce++) + 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 = []; } @@ -33869,7 +33885,7 @@ ATOM`, b); 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(Fe, Ie, pe, m, o.CC.color(pe.color), 0, 2), Ie = null, pe = null; + Ie.add(Ce), d.GLDraw.drawCylinder(Oe, 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; } @@ -33879,11 +33895,11 @@ ATOM`, b); 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 L) && (pe = new r.Vector3(H.x, H.y, H.z), pe.color = (0, v.getColorFromStyle)(H, W).getHex()); + } 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)); } } - 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(Fe, 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 && (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); } } ), @@ -33908,7 +33924,7 @@ ATOM`, b); /* harmony export */ CONTEXTS_PER_VIEWPORT: () => ( /* reexport safe */ - g.CONTEXTS_PER_VIEWPORT + p.CONTEXTS_PER_VIEWPORT ), /* harmony export */ Color: () => ( @@ -33943,7 +33959,7 @@ ATOM`, b); /* harmony export */ GLViewer: () => ( /* reexport safe */ - g.GLViewer + p.GLViewer ), /* harmony export */ GLVolumetricRender: () => ( @@ -34078,12 +34094,12 @@ ATOM`, b); /* harmony export */ autoinit: () => ( /* reexport safe */ - p.autoinit + g.autoinit ), /* harmony export */ autoload: () => ( /* reexport safe */ - p.autoload + g.autoload ), /* harmony export */ base64ToArray: () => ( @@ -34123,17 +34139,17 @@ ATOM`, b); /* harmony export */ createStereoViewer: () => ( /* reexport safe */ - g.createStereoViewer + p.createStereoViewer ), /* harmony export */ createViewer: () => ( /* reexport safe */ - g.createViewer + p.createViewer ), /* harmony export */ createViewerGrid: () => ( /* reexport safe */ - g.createViewerGrid + p.createViewerGrid ), /* harmony export */ deepCopy: () => ( @@ -34248,7 +34264,7 @@ ATOM`, b); /* harmony export */ processing_autoinit: () => ( /* reexport safe */ - p.processing_autoinit + g.processing_autoinit ), /* harmony export */ residues: () => ( @@ -34293,7 +34309,7 @@ ATOM`, b); /* harmony export */ viewers: () => ( /* reexport safe */ - p.viewers + g.viewers ) /* harmony export */ }); @@ -34342,10 +34358,10 @@ ATOM`, b); ), u = t( /*! ./GLModel */ "./src/GLModel.ts" - ), g = t( + ), p = t( /*! ./GLViewer */ "./src/GLViewer.ts" - ), p = t( + ), g = t( /*! ./autoload */ "./src/autoload.ts" ); @@ -34398,26 +34414,26 @@ ATOM`, b); class y { constructor(l) { if (this.C = {}, l) { - let u = l.getField("comp_id"), g = l.getField("atom_id_1"), p = l.getField("atom_id_2"), b = l.getField("value_order"); + 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 = g[c], w = p[c], k = b[c], L = 1; - k == "doub" ? L = 2 : k == "trip" && (L = 3), this.C[_] == null && (this.C[_] = {}), this.C[_][E] == null && (this.C[_][E] = {}), this.C[_][w] == null && (this.C[_][w] = {}), this.C[_][E][w] = L, this.C[_][w][E] = L; + 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] = $; } } } //returns bond order, zero if not connected - order(l, u, g) { - return this.C[l] !== void 0 && this.C[l][u] !== void 0 && this.C[l][u][g] !== void 0 ? this.C[l][u][g] : 0; + order(l, u, p) { + return this.C[l] !== void 0 && this.C[l][u] !== void 0 && this.C[l][u][p] !== void 0 ? this.C[l][u][p] : 0; } } class A { constructor(l) { if (this.C = [], l) { - let u = l.getField("conn_type_id"), g = l.getField("ptnr1_label_asym_id"), p = 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 = l.getField("pdbx_value_order"); - for (let $ = 0; $ < u.length; $++) - if (u[$] == "disulf" || u[$] == "covale") { - let z = L ? L[$] == "" ? 1 : parseInt(L[$]) : 1; - this.C.push([[g[$], p[$], b[$], c[$]], [_[$], E[$], w[$], k[$]], z]); + 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"); + 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]); } } } @@ -34429,29 +34445,29 @@ ATOM`, b); add(l) { this.R[l.lchain] == null && (this.R[l.lchain] = {}), this.R[l.lchain][l.lresi] == null && (this.R[l.lchain][l.lresi] = {}), this.R[l.lchain][l.lresi][l.lresn] == null && (this.R[l.lchain][l.lresi][l.lresn] = []), this.R[l.lchain][l.lresi][l.lresn].push(l), this.R[l.lchain][l.lresi][l.lresn][l.atom] = l; } - geta([l, u, g, p]) { - if (this.R[l] !== void 0 && this.R[l][u] !== void 0 && this.R[l][u][g] !== void 0) - return this.R[l][u][g][p]; + geta([l, u, p, g]) { + if (this.R[l] !== void 0 && this.R[l][u] !== void 0 && this.R[l][u][p] !== void 0) + return this.R[l][u][p][g]; } setBonds(l, u) { - for (let g in this.R) - for (let p in this.R[g]) - for (let b in this.R[g][p]) { - let c = this.R[g][p][b]; + for (let p in this.R) + 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 = l.order(b, w.atom, k.atom); - L > 0 && (w.bonds.push(k.index), k.bonds.push(w.index), w.bondOrder.push(L), k.bondOrder.push(L)); + let w = c[_], 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 g of u.C) { - let p = g[0], b = g[1], c = g[2], _ = this.geta(p), E = this.geta(b); + 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)); } } } function M(m, l) { - var u = !l.keepH, g = l.altLoc ? l.altLoc : "A", p = !l.noComputeSecondaryStructure; + var u = !l.keepH, p = l.altLoc ? l.altLoc : "A", g = !l.noComputeSecondaryStructure; const b = !l.doAssembly, c = l.assignBonds === void 0 ? !0 : l.assignBonds; if (typeof m == "string") try { @@ -34467,12 +34483,12 @@ ATOM`, b); if (k == 0) return E; l.multimodel || (k = 1); - for (let L = 0; L < k; L++) { - let $ = E.length; + for (let $ = 0; $ < k; $++) { + let L = E.length; const z = []; w.push({ symmetries: [] }), E.push([]); - const O = _.dataBlocks[L], R = /* @__PURE__ */ Object.create(null); - for (const Re of O.categories) + const F = _.dataBlocks[$], R = /* @__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) { @@ -34505,7 +34521,7 @@ ATOM`, b); 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"), Fe = 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; + 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") continue; @@ -34517,10 +34533,10 @@ ATOM`, b); 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"; let je = "X"; - Fe && (je = Fe[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 != g && g != "*" || (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))); + 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))); } if (G.setBonds(V, H), !(0, v.isEmpty)(P)) - for (let Re = $; Re < E.length; Re++) { + for (let Re = L; Re < E.length; Re++) { let De = E[Re]; for (let je = 0; je < De.length; je++) { const Xe = De[je]; @@ -34530,10 +34546,10 @@ ATOM`, b); } } } - l.multimodel && L < k - 1 && (l.onemol || (E.push([]), w.push({ symmetries: [] }))); + l.multimodel && $ < k - 1 && (l.onemol || (E.push([]), w.push({ symmetries: [] }))); } - for (let L = 0; L < E.length; L++) - c && !(l.duplicateAssemblyAtoms && !l.dontConnectDuplicatedAtoms) && (0, o.assignPDBBonds)(E[L], l), p && (0, a.computeSecondaryStructure)(E[L], l.hbondCutoff), (0, s.processSymmetries)(w[L].symmetries, E[L], l, w[L].cryst), l.duplicateAssemblyAtoms && !l.dontConnectDuplicatedAtoms && c && (0, o.assignPDBBonds)(E[L], l); + for (let $ = 0; $ < E.length; $++) + c && !(l.duplicateAssemblyAtoms && !l.dontConnectDuplicatedAtoms) && (0, o.assignPDBBonds)(E[$], l), g && (0, a.computeSecondaryStructure)(E[$], l.hbondCutoff), (0, s.processSymmetries)(w[$].symmetries, E[$], l, w[$].cryst), l.duplicateAssemblyAtoms && !l.dontConnectDuplicatedAtoms && c && (0, o.assignPDBBonds)(E[$], l); return E; } } @@ -34563,8 +34579,8 @@ ATOM`, b); 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 g = v[u], p = g.b + A, b = g.e + A, c = g.o || 1, _ = h[h.length - 1][p], E = h[h.length - 1][b]; - _.bonds.push(b), _.bondOrder.push(c), E.bonds.push(p), E.bondOrder.push(c); + 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); } return h; } @@ -34624,18 +34640,18 @@ ATOM`, b); return E; } const l = v.split(/\r?\n|\r/), u = []; - let g = !1; + let p = !1; for (let c = 0; c < l.length; c++) { - var p = l[c].split("#")[0]; - if (g ? p[0] === ";" && (g = !1) : p[0] === ";" && (g = !0), g || p !== "") { - if (!g && (p = p.trim(), p[0] === "_")) { - const _ = p.split(/\s/)[0].indexOf("."); + 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) { - let E = p.split(""); - E[_] = "_", p = E.join(""), p = p.substring(0, _) + "_" + p.substring(_ + 1); + let E = g.split(""); + E[_] = "_", g = E.join(""), g = g.substring(0, _) + "_" + g.substring(_ + 1); } } - u.push(p); + u.push(g); } } let b = 0; @@ -34648,34 +34664,34 @@ ATOM`, b); if (u[b][0] === void 0) b++; else if (u[b][0] === "_") { - const k = u[b].split(/\s/)[0].toLowerCase(), L = c[k] = c[k] || [], $ = u[b].substring(u[b].indexOf(k) + k.length); - if ($ === "") + 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); for (b++; u[b] !== ";"; ) z = z + ` ` + u[b], b++; - L.push(z); + $.push(z); } else - L.push(u[b]); + $.push(u[b]); else - L.push($.trim()); + $.push(L.trim()); b++; } else if (u[b].substring(0, 5) === "loop_") { b++; const k = []; for (; u[b] === "" || u[b][0] === "_"; ) { if (u[b] !== "") { - let $ = u[b].split(/\s/)[0].toLowerCase(), z = c[$] = c[$] || []; + let L = u[b].split(/\s/)[0].toLowerCase(), z = c[L] = c[L] || []; k.push(z); } b++; } - let L = 0; + let $ = 0; for (; b < u.length && u[b][0] !== "_" && !u[b].startsWith("loop_") && !u[b].startsWith("data_"); ) { - let $ = m(u[b], " "); - for (let z = 0; z < $.length; z++) - $[z] !== "" && (k[L].push($[z]), L = (L + 1) % k.length); + let L = m(u[b], " "); + for (let z = 0; z < L.length; z++) + L[z] !== "" && (k[$].push(L[z]), $ = ($ + 1) % k.length); b++; } } else @@ -34684,50 +34700,50 @@ ATOM`, b); const _ = 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), L = parseFloat(c._cell_length_b), $ = parseFloat(c._cell_length_c), z = parseFloat(c._cell_angle_alpha) || 90, O = parseFloat(c._cell_angle_beta) || 90, R = parseFloat(c._cell_angle_gamma) || 90; - E = (0, s.conversionMatrix3)(k, L, $, z, O, R), x[x.length - 1].cryst = { + 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 = { a: k, - b: L, - c: $, + b: $, + c: L, alpha: z, - beta: O, + beta: F, gamma: R }; } for (let k = 0; k < _; k++) { if (c._atom_site_group_pdb !== void 0 && c._atom_site_group_pdb[k] === "TER") continue; - const L = {}; + const $ = {}; if (c._atom_site_cartn_x !== void 0) - L.x = parseFloat(c._atom_site_cartn_x[k]), L.y = parseFloat(c._atom_site_cartn_y[k]), L.z = parseFloat(c._atom_site_cartn_z[k]); + $.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])); - L.x = z.x, L.y = z.y, L.z = z.z; + $.x = z.x, $.y = z.y, $.z = z.z; } - L.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, L.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, L.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, L.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, L.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 && (L.b = parseFloat(c._atom_site_b_iso_or_equiv[k])); - let $ = "X"; - c._atom_site_type_symbol ? $ = c._atom_site_type_symbol[k].replace(/\(?\+?\d+.*/, "") : c._atom_site_label && ($ = c._atom_site_label[k].split("_")[0].replace(/\(?\d+.*/, "")), L.elem = $[0].toUpperCase() + $.substring(1, 2).toLowerCase(), L.bonds = [], L.ss = "c", L.serial = k, L.bondOrder = [], L.properties = {}, y[y.length - 1].push(L); + $.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"; + c._atom_site_type_symbol ? L = c._atom_site_type_symbol[k].replace(/\(?\+?\d+.*/, "") : c._atom_site_label && (L = c._atom_site_label[k].split("_")[0].replace(/\(?\d+.*/, "")), $.elem = L[0].toUpperCase() + L.substring(1, 2).toLowerCase(), $.bonds = [], $.ss = "c", $.serial = k, $.bondOrder = [], $.properties = {}, y[y.length - 1].push($); } if (c._pdbx_struct_oper_list_id !== void 0 && !A) for (let k = 0; k < c._pdbx_struct_oper_list_id.length; k++) { - const L = parseFloat(c["_pdbx_struct_oper_list_matrix[1][1]"][k]), $ = parseFloat(c["_pdbx_struct_oper_list_matrix[1][2]"][k]), z = parseFloat(c["_pdbx_struct_oper_list_matrix[1][3]"][k]), O = 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, O, R, P, U, N, B, W, V, G); + 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 w = function(k) { - const L = k.match("-"); + const $ = k.match("-"); k = k.replace(/[-xyz]/g, ""); - const $ = k.split("/"); - let z, O; - return $[1] === void 0 ? O = 1 : O = parseInt($[1]), $[0] === "" ? z = 1 : z = parseInt($[0]), z / O * (L ? -1 : 1); + 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); }; if (c._symmetry_equiv_pos_as_xyz !== void 0 && !A) for (let k = 0; k < c._symmetry_equiv_pos_as_xyz.length; k++) { - const $ = c._symmetry_equiv_pos_as_xyz[k].replace(/["' ]/g, "").split(",").map(function(P) { + const L = c._symmetry_equiv_pos_as_xyz[k].replace(/["' ]/g, "").split(",").map(function(P) { return P.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 = $[P].split("+"); + const U = L[P].split("+"); for (let N = 0; N < U.length; N++) { const B = U[N]; if (B === "") @@ -34736,8 +34752,8 @@ ATOM`, 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 O = E.getMatrix4(), R = new s.Matrix4().getInverse(O, !0); - z = new s.Matrix4().multiplyMatrices(z, R), z = new s.Matrix4().multiplyMatrices(O, z), x[x.length - 1].symmetries.push(z); + 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); } } for (let c = 0; c < y.length; c++) @@ -34791,26 +34807,26 @@ ATOM`, b); A = f[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), A = f[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); const l = A[0] > 0 ? 0.529177 : 1; m.multiplyScalar(l); - const u = Math.abs(A[0]), g = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); + const u = Math.abs(A[0]), p = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); A = f[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - const p = Math.abs(A[0]), b = new r.Vector3(parseFloat(A[1]), parseFloat(A[2]), parseFloat(A[3])).multiplyScalar(l); + 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: p, z: c }, M.unit = new r.Vector3(g.x, b.y, _.z), g.y != 0 || g.z != 0 || b.x != 0 || b.z != 0 || _.x != 0 || _.y != 0) { - M.matrix4 = new r.Matrix4(g.x, b.x, _.x, 0, g.y, b.y, _.y, 0, g.z, b.z, _.z, 0, 0, 0, 0, 1); - let O = new r.Matrix4().makeTranslation(m.x, m.y, m.z); - M.matrix4 = M.matrix4.multiplyMatrices(O, M.matrix4), M.matrix = M.matrix4.matrix3FromTopLeft(), M.origin = new r.Vector3(0, 0, 0), M.unit = new r.Vector3(1, 1, 1); + 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); + 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) { - var L = {}; - L.serial = k; - var $ = f[k - E], z = $.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - L.elem = s.anumToSymbol[z[0]], L.x = parseFloat(z[2]) * l, L.y = parseFloat(z[3]) * l, L.z = parseFloat(z[4]) * l, L.hetflag = !0, L.bonds = [], L.bondOrder = [], L.properties = {}, v[v.length - 1].push(L); + 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($); } if (y) - for (let O = 0; O < v.length; O++) - (0, a.assignBonds)(v[O], d); + for (let F = 0; F < v.length; F++) + (0, a.assignBonds)(v[F], d); return v; } } @@ -34848,14 +34864,14 @@ ATOM`, b); let x = 2; const M = A.length, m = M + f; for (let l = M; l < m; l++) { - const u = v[x++], g = {}; - g.serial = l, g.atom = u.slice(10, 15).trim(), g.elem = (0, a.atomNameToElem)(g.atom, !0), g.x = 10 * parseFloat(u.slice(20, 28)), g.y = 10 * parseFloat(u.slice(28, 36)), g.z = 10 * parseFloat(u.slice(36, 44)), g.resi = parseInt(u.slice(0, 5)), g.resn = u.slice(5, 10).trim(), g.bonds = [], g.bondOrder = [], g.properties = {}, u.length > 44 && (g.dx = 10 * parseFloat(u.slice(44, 52)), g.dy = 10 * parseFloat(u.slice(52, 60)), g.dz = 10 * parseFloat(u.slice(60, 68))), A[l] = g; + const u = v[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 (u.length === 3) { - for (let g = 0; g < 3; g++) - u[g] = (parseFloat(u[g]) * 10).toString(); + for (let p = 0; p < 3; p++) + u[p] = (parseFloat(u[p]) * 10).toString(); d.box = u; } } @@ -34917,10 +34933,10 @@ ATOM`, b); const M = v[f - 1].replace("ITEM: ATOMS ", "").split(" "); d.push([]); for (let m = f; m < f + y; m++) { - const l = {}, u = {}, g = v[m].split(" "); - for (let p = 0; p < g.length; p++) { - const b = a[M[p]]; - b !== void 0 && (b === "serial" ? l[b] = parseInt(g[p]) : b === "x" || b === "y" || b === "z" ? l[b] = parseFloat(g[p]) : b === "charge" || b === "radius" ? u[b] = parseFloat(g[p]) : l[b] = g[p]), l.properties = u, l.bonds = [], l.bondOrder = []; + const l = {}, u = {}, p = v[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 = []; } d[d.length - 1][m - f] = l; } @@ -34981,15 +34997,15 @@ ATOM`, b); "SACCHARIDE" ]); function y(A, x) { - var M = !x.keepH, m = x.altLoc ? x.altLoc : "A", l = !!x.noSecondaryStructure, u = !x.noComputeSecondaryStructure, g = !x.doAssembly, p = x.assemblyIndex ? x.assemblyIndex : 0; + 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, L = b.secStructList, $ = b.bFactorList, z = b.altLocList, O = b.occupancyList, R = b.bondAtomList, P = b.bondOrderList, U = b.numModels; + 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) return c; x.multimodel || (U = 1); var N, B, W, V, G, H, Q = []; - if (!g && b.bioAssemblyList && b.bioAssemblyList.length > 0) { - var te = b.bioAssemblyList[p].transformList; + 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); @@ -35014,35 +35030,35 @@ ATOM`, b); b.chainNameList && (le = d(b.chainNameList.subarray(E * 4, E * 4 + 4))); var ne = w, Te = ""; for (B = 0; B < pe; ++B) { - var Fe = b.groupList[b.groupTypeList[w]], Be = Fe.atomNameList.length, Ue = 0, Pe = !1, Ge = !1; - if (L) { - Ue = L[w]; + var Oe = b.groupList[b.groupTypeList[w]], Be = Oe.atomNameList.length, Ue = 0, Pe = !1, Ge = !1; + if ($) { + Ue = $[w]; var Ne = v(Ue); (w == 0 || Ne != Te) && (Pe = !0), Te = Ne; var Re = w + 1; - (Re >= L.length || v(L[Re] != Ne)) && (Ge = !0); + (Re >= $.length || v($[Re] != Ne)) && (Ge = !0); } - var De = b.groupIdList[w], je = Fe.groupName; - let ve = Fe.chemCompType; + var De = b.groupIdList[w], je = Oe.groupName; + let ve = Oe.chemCompType; var Xe = k; let Y = f.has(ve) || !oe[E]; for (W = 0; W < Be; ++W) { - var X = Fe.elementList[W]; + var X = Oe.elementList[W]; if (M && X == "H") { k += 1; continue; } var q = ""; - $ && (q = $[k]); + L && (q = L[k]); var re = ""; z && z[k] && (re = String.fromCharCode(z[k])); var ye = ""; - if (O && (ye = O[k]), re != "" && re != m && m != "*") { + if (F && (ye = F[k]), re != "" && re != m && m != "*") { k += 1; continue; } - var me = b.atomIdList[k], ze = Fe.atomNameList[W], ke = 0; - Fe.atomChargeList && (ke = Fe.atomChargeList[W]); + 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({ resn: je, @@ -35071,10 +35087,10 @@ ATOM`, b); b: q }), k += 1; } - var xe = Fe.bondAtomList; - for (W = 0, V = Fe.bondOrderList.length; W < V; ++W) { - var ue = Xe + xe[W * 2], Ce = Xe + xe[W * 2 + 1], Z = Fe.bondOrderList[W], Oe = Ie[ue], We = Ie[Ce], I = Se[Oe], we = Se[We]; - I && we && (I.bonds.push(We), I.bondOrder.push(Z), we.bonds.push(Oe), we.bondOrder.push(Z)); + 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)); } w += 1; } @@ -35094,7 +35110,7 @@ ATOM`, b); } x.multimodel && (x.onemol || c.push([])); } - if (!g) + if (!p) for (let ve = 0; ve < c.length; ve++) (0, h.processSymmetries)(_[ve].symmetries, c[ve], x, _[ve].cryst); return u && !l && (0, s.computeSecondaryStructure)(c, x.hbondCutoff), c; @@ -35181,8 +35197,8 @@ ATOM`, b); l = u + 1; break; } - var g = o[o.length - 1].length, p = g + M, b; - for (u = g; u < p; u++) { + 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)) { @@ -35195,16 +35211,16 @@ ATOM`, b); }, A[w] = E, o[o.length - 1].push(c); } } - for (var L = !1; l < y.length; ) + for (var $ = !1; l < y.length; ) if (y[l++] == "@BOND") { - L = !0; + $ = !0; break; } - if (L && m) + if ($ && m) for (u = 0; u < m; u++) { b = y[l++], x = b.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var $ = parseInt(x[1]), z = o[o.length - 1][A[$]], O = parseInt(x[2]), R = o[o.length - 1][A[O]], P = parseInt(x[3]); - isNaN(P) && (P = 1), z !== void 0 && R !== void 0 && (z.bonds.push(A[O]), z.bondOrder.push(P), R.bonds.push(A[$]), R.bondOrder.push(P)); + 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)); } if (h.multimodel) { h.onemol || o.push([]), y.splice(0, l), s = y.join(` @@ -35287,8 +35303,8 @@ ATOM`, b); var d = [[]], v = !o.noSecondaryStructure; d.modelData = [{ symmetries: [] }]; var f = [], y = h.split(/\r?\n|\r/), A; - for (let L = 0; L < y.length; L++) { - A = y[L].replace(/^\s*/, ""); + for (let $ = 0; $ < y.length; $++) { + A = y[$].replace(/^\s*/, ""); var x = A.substring(0, 6); if (x.indexOf("END") == 0) if (o.multimodel) { @@ -35298,39 +35314,39 @@ ATOM`, b); break; else if (x == "ATOM " || x == "HETATM") { var M; - let $ = parseInt(A.substring(6, 11)), z = A.substring(12, 16).replace(/ /g, ""), O = 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]), g = parseFloat(m[2]), p = 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[$] = d[d.length - 1].length, d[d.length - 1].push({ - resn: O, + 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({ + resn: F, x: l, y: u, - z: g, + z: p, elem: c, hetflag: M, chain: R, resi: P, - serial: $, + serial: L, atom: z, bonds: [], ss: "c", bondOrder: [], properties: { - charge: p, - partialCharge: p, + charge: g, + partialCharge: g, radius: b }, pdbline: A }); } else if (x == "CONECT") { var _ = parseInt(A.substring(6, 11)), E = d[d.length - 1][f[_]]; - for (let $ = 0; $ < 4; $++) { - var w = parseInt(A.substring([11, 16, 21, 26][$], [11, 16, 21, 26][$] + 5)), k = d[d.length - 1][f[w]]; + 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)); } } } - for (let L = 0; L < d.length; L++) - (0, r.assignPDBBonds)(d[L], o), v && (0, a.computeSecondaryStructure)(d[L], o.hbondCutoff); + for (let $ = 0; $ < d.length; $++) + (0, r.assignPDBBonds)(d[$], o), v && (0, a.computeSecondaryStructure)(d[$], o.hbondCutoff); return d; } } @@ -35368,8 +35384,8 @@ ATOM`, b); for (let l = 0; l < A / y[0]; l++) { l == parseInt(A / y[0]) && (x = A % y[0]); for (let u = 0; u < x; u++) { - let g = {}, p = { charge: "", radii: "" }; - g.serial = o, g.x = 0, g.y = 0, g.z = 0, g.atom = d[f + 1].slice(y[1] * u, y[1] * (u + 1)).trim(), g.elem = d[f + 1].slice(y[1] * u, y[1] * u + 1).trim(), g.properties = p, g.bonds = [], g.bondOrder = [], s.push(g), o++; + let p = {}, g = { charge: "", radii: "" }; + p.serial = o, p.x = 0, p.y = 0, p.z = 0, p.atom = d[f + 1].slice(y[1] * u, y[1] * (u + 1)).trim(), p.elem = d[f + 1].slice(y[1] * u, y[1] * u + 1).trim(), p.properties = g, p.bonds = [], p.bondOrder = [], s.push(p), o++; } f++; } @@ -35408,8 +35424,8 @@ ATOM`, b); } else return []; function M(l) { - var u = d.indexOf(v.filter(function(g) { - return g.includes(l); + var u = d.indexOf(v.filter(function(p) { + return p.includes(l); })[0]); if (Number.isInteger(u) && u > 0) { for (; !d[u].includes("FORMAT"); ) @@ -35419,8 +35435,8 @@ ATOM`, b); return -1; } function m(l) { - var u = d[l].match(/\((\d*)\S*/), g = d[l].match(/[a-zA-Z](\d*)\)\s*/); - return g == null && (g = d[l].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [u[1], g[1]]; + var u = d[l].match(/\((\d*)\S*/), p = d[l].match(/[a-zA-Z](\d*)\)\s*/); + return p == null && (p = d[l].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [u[1], p[1]]; } return [s]; } @@ -35453,8 +35469,8 @@ ATOM`, b); var x = [], M = d[d.length - 1].length, m = M + f, l, u; for (l = M; l < m; l++, A++) { u = h[A]; - var g = {}, p = u.substring(31, 34).replace(/ /g, ""); - g.atom = g.elem = p[0].toUpperCase() + p.substring(1).toLowerCase(), (g.elem !== "H" || !v) && (g.serial = l, x[l] = d[d.length - 1].length, g.x = parseFloat(u.substring(0, 10)), g.y = parseFloat(u.substring(10, 20)), g.z = parseFloat(u.substring(20, 30)), g.hetflag = !0, g.bonds = [], g.bondOrder = [], g.properties = {}, g.index = d[d.length - 1].length, d[d.length - 1].push(g)); + 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)); } for (l = 0; l < y; l++, A++) { u = h[A]; @@ -35481,13 +35497,13 @@ ATOM`, b); var A = parseInt(f[1]), x = 7; if (h.length < 8 + y + A) break; - var M = [], m = d[d.length - 1].length, l = m + y, u, g; + var M = [], m = d[d.length - 1].length, l = m + y, u, p; for (u = m; u < l; u++, x++) { - g = h[x]; - var p = g.substring(6).match(/\S+/g); - if (p.length > 4) { - var b = {}, c = p[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(p[2]), b.y = parseFloat(p[3]), b.z = parseFloat(p[4]), b.hetflag = !0, b.bonds = [], b.bondOrder = [], b.properties = {}, b.index = d[d.length - 1].length, d[d.length - 1].push(b)); + p = h[x]; + 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)); } } if (h[x] === "M V30 END ATOM") @@ -35499,8 +35515,8 @@ ATOM`, b); else break; for (u = 0; u < A; u++, x++) { - g = h[x]; - var _ = g.substring(6).match(/\S+/g); + 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]); 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)); @@ -35568,12 +35584,12 @@ ATOM`, b); if (x.length != M.length) 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, g = 0, p = x.length; g < p; g++) { - for (var b = x[g], c = 0, _ = M[g]; c < _; c++) { + for (var u = 0, p = 0, g = x.length; p < g; p++) { + for (var b = x[p], c = 0, _ = M[p]; c < _; 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); } - u += M[g]; + u += M[p]; } if (f) for (let k = 0; k < d.length; k++) @@ -35615,11 +35631,11 @@ ATOM`, b); var M = new Float32Array(x[1].split(/\s+/)), m = new r.Matrix3(M[0], M[3], M[6], M[1], M[4], M[7], M[2], M[5], M[8]); d.modelData = [{ cryst: { matrix: m } }]; } - for (var l = 2, u = d[d.length - 1].length, g = u + y, p = u; p < g; p++) { + 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 = p; + _.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][p] = _, c.length >= 7 && (_.dx = parseFloat(c[4]), _.dy = parseFloat(c[5]), _.dz = parseFloat(c[6])); + _.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])); } if (o.multimodel) d.push([]), f.splice(0, l); @@ -35633,11 +35649,11 @@ ATOM`, b); var w = d; d = [], d.push(w[0]); for (let k = 1; k < w.length; k++) { - let L = d[0].length; - for (let $ = 0; $ < w[k].length; $++) { - let z = w[k][$]; - for (let O = 0; O < z.bonds.length; O++) - z.bonds[O] = z.bonds[O] + L; + 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); } } @@ -35702,173 +35718,173 @@ ATOM`, b); "./src/parsers/cifutils/encoding.ts" ); const a = new Uint16Array(new Uint8Array([18, 52]).buffer)[0] === 13330; - function s(L, $) { - const z = new ArrayBuffer(L.length), O = new Uint8Array(z); - for (let R = 0, P = L.length; R < P; R += $) - for (let U = 0; U < $; U++) - O[R + $ - U - 1] = L[R + U]; + 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; } - function h(L) { - let $ = L.data; - for (let z = L.encoding.length - 1; z >= 0; z--) - $ = o($, L.encoding[z]); - return $; + function h($) { + let L = $.data; + for (let z = $.encoding.length - 1; z >= 0; z--) + L = o(L, $.encoding[z]); + return L; } - function o(L, $) { - switch ($.kind) { + function o($, L) { + switch (L.kind) { case "ByteArray": - switch ($.type) { + switch (L.type) { case r.Encoding.IntDataType.Uint8: - return L; + return $; case r.Encoding.IntDataType.Int8: - return f(L); + return f($); case r.Encoding.IntDataType.Int16: - return A(L); + return A($); case r.Encoding.IntDataType.Uint16: - return x(L); + return x($); case r.Encoding.IntDataType.Int32: - return M(L); + return M($); case r.Encoding.IntDataType.Uint32: - return m(L); + return m($); case r.Encoding.FloatDataType.Float32: - return l(L); + return l($); case r.Encoding.FloatDataType.Float64: - return u(L); + return u($); default: throw new Error("unreachable"); } case "FixedPoint": - return g(L, $); + return p($, L); case "IntervalQuantization": - return p(L, $); + return g($, L); case "RunLength": - return b(L, $); + return b($, L); case "Delta": - return c(L, $); + return c($, L); case "IntegerPacking": - return w(L, $); + return w($, L); case "StringArray": - return k(L, $); + return k($, L); } } - function d(L, $) { - switch (L) { + function d($, L) { + switch ($) { case r.Encoding.IntDataType.Int8: - return new Int8Array($); + return new Int8Array(L); case r.Encoding.IntDataType.Int16: - return new Int16Array($); + return new Int16Array(L); case r.Encoding.IntDataType.Int32: - return new Int32Array($); + return new Int32Array(L); case r.Encoding.IntDataType.Uint8: - return new Uint8Array($); + return new Uint8Array(L); case r.Encoding.IntDataType.Uint16: - return new Uint16Array($); + return new Uint16Array(L); case r.Encoding.IntDataType.Uint32: - return new Uint32Array($); + return new Uint32Array(L); default: - return new Int32Array($); + return new Int32Array(L); } } - function v(L, $) { - switch (L) { + function v($, L) { + switch ($) { case r.Encoding.FloatDataType.Float32: - return new Float32Array($); + return new Float32Array(L); case r.Encoding.FloatDataType.Float64: - return new Float64Array($); + return new Float64Array(L); default: - return new Float64Array($); + return new Float64Array(L); } } - function f(L) { - return new Int8Array(L.buffer, L.byteOffset); + function f($) { + return new Int8Array($.buffer, $.byteOffset); } - function y(L, $, z) { - return (L.byteOffset != 0 || L.byteLength != L.buffer.byteLength) && (L = new Uint8Array(L)), a ? new z(L.buffer) : new z(s(L, $)); + function y($, L, z) { + return ($.byteOffset != 0 || $.byteLength != $.buffer.byteLength) && ($ = new Uint8Array($)), a ? new z($.buffer) : new z(s($, L)); } - function A(L) { - return y(L, 2, Int16Array); + function A($) { + return y($, 2, Int16Array); } - function x(L) { - return y(L, 2, Uint16Array); + function x($) { + return y($, 2, Uint16Array); } - function M(L) { - return y(L, 4, Int32Array); + function M($) { + return y($, 4, Int32Array); } - function m(L) { - return y(L, 4, Uint32Array); + function m($) { + return y($, 4, Uint32Array); } - function l(L) { - return y(L, 4, Float32Array); + function l($) { + return y($, 4, Float32Array); } - function u(L) { - return y(L, 8, Float64Array); + function u($) { + return y($, 8, Float64Array); } - function g(L, $) { - const z = L.length, O = v($.srcType, z), R = 1 / $.factor; + function p($, L) { + const z = $.length, F = v(L.srcType, z), R = 1 / L.factor; for (let P = 0; P < z; P++) - O[P] = R * L[P]; - return O; + F[P] = R * $[P]; + return F; } - function p(L, $) { - const z = L.length, O = v($.srcType, z), R = ($.max - $.min) / ($.numSteps - 1), P = $.min; + 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++) - O[U] = P + R * L[U]; - return O; + F[U] = P + R * $[U]; + return F; } - function b(L, $) { - const z = d($.srcType, $.srcSize); - let O = 0; - for (let R = 0, P = L.length; R < P; R += 2) { - const U = L[R], N = L[R + 1]; + function b($, L) { + const z = 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[O++] = U; + z[F++] = U; } return z; } - function c(L, $) { - const z = L.length, O = d($.srcType, z); + function c($, L) { + const z = $.length, F = d(L.srcType, z); if (!z) - return L; - O[0] = L[0] + ($.origin | 0); + return $; + F[0] = $[0] + (L.origin | 0); for (let R = 1; R < z; ++R) - O[R] = L[R] + O[R - 1]; - return O; + F[R] = $[R] + F[R - 1]; + return F; } - function _(L, $) { - const z = $.byteCount === 1 ? 127 : 32767, O = -z - 1, R = L.length, P = new Int32Array($.srcSize); + 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 = L[U]; - for (; W === z || W === O; ) - B += W, U++, W = L[U]; + let B = 0, W = $[U]; + for (; W === z || W === F; ) + B += W, U++, W = $[U]; B += W, P[N] = B, U++, N++; } return P; } - function E(L, $) { - const z = $.byteCount === 1 ? 255 : 65535, O = L.length, R = new Int32Array($.srcSize); + function E($, L) { + const z = L.byteCount === 1 ? 255 : 65535, F = $.length, R = new Int32Array(L.srcSize); let P = 0, U = 0; - for (; P < O; ) { - let N = 0, B = L[P]; + for (; P < F; ) { + let N = 0, B = $[P]; for (; B === z; ) - N += B, P++, B = L[P]; + N += B, P++, B = $[P]; N += B, R[U] = N, P++, U++; } return R; } - function w(L, $) { - return L.length === $.srcSize ? L : $.isUnsigned ? E(L, $) : _(L, $); + function w($, L) { + return $.length === L.srcSize ? $ : L.isUnsigned ? E($, L) : _($, L); } - function k(L, $) { - const z = h({ encoding: $.offsetEncoding, data: $.offsets }), O = h({ encoding: $.dataEncoding, data: L }), R = $.stringData, P = new Array(z.length); + 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(O.length); - for (let B = 0, W = O.length; B < W; B++) - N[U++] = P[O[B] + 1]; + const N = new Array(F.length); + for (let B = 0, W = F.length; B < W; B++) + N[U++] = P[F[B] + 1]; return N; } } @@ -35929,7 +35945,7 @@ ATOM`, b); /* harmony export */ Parsers: () => ( /* binding */ - g + p ), /* harmony export */ bondLength: () => ( @@ -35989,7 +36005,7 @@ ATOM`, b); /*! ./utils/bondLength */ "./src/parsers/utils/bondLength.ts" ); - const g = { + const p = { vasp: r.VASP, VASP: r.VASP, cube: a.CUBE, @@ -36300,8 +36316,8 @@ ATOM`, b); for (let m = 0; m < A.length; m++) { const l = A[m]; if ((0, r.areConnected)(M, l, d)) { - const u = M.bonds.indexOf(l.index), g = l.bonds.indexOf(M.index); - u === -1 && g === -1 ? (M.bonds.push(l.index), M.bondOrder.push(1), l.bonds.push(M.index), l.bondOrder.push(1)) : u === -1 ? (M.bonds.push(l.index), M.bondOrder.push(l.bondOrder[g])) : g === -1 && (l.bonds.push(M.index), l.bondOrder.push(M.bondOrder[u])); + const u = M.bonds.indexOf(l.index), p = l.bonds.indexOf(M.index); + u === -1 && p === -1 ? (M.bonds.push(l.index), M.bondOrder.push(1), l.bonds.push(M.index), l.bondOrder.push(1)) : u === -1 ? (M.bonds.push(l.index), M.bondOrder.push(l.bondOrder[p])) : p === -1 && (l.bonds.push(M.index), l.bondOrder.push(M.bondOrder[u])); } } } @@ -36312,18 +36328,18 @@ ATOM`, b); const M = parseInt(x); for (let m in v[A][M]) { const l = parseInt(m), u = v[A][M][l]; - for (let g = 0; g < u.length; g++) { - const p = u[g]; - for (let b = g + 1; b < u.length; b++) { + for (let p = 0; p < u.length; p++) { + const g = u[p]; + for (let b = p + 1; b < u.length; b++) { const c = u[b]; - (0, r.areConnected)(p, c, d) && p.bonds.indexOf(c.index) == -1 && (p.bonds.push(c.index), p.bondOrder.push(1), c.bonds.push(p.index), c.bondOrder.push(1)); + (0, r.areConnected)(g, c, d) && g.bonds.indexOf(c.index) == -1 && (g.bonds.push(c.index), g.bondOrder.push(1), c.bonds.push(g.index), c.bondOrder.push(1)); } } - for (let g = 0; g < a.length; g++) { - const p = a[g]; - if (!v[A + p.x] || !v[A + p.x][M + p.y] || !v[A + p.x][M + p.y][l + p.z]) + 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]) continue; - const b = v[A + p.x][M + p.y][l + p.z]; + const b = v[A + g.x][M + g.y][l + g.z]; f(u, b); } } @@ -36371,10 +36387,10 @@ ATOM`, b); const l = v[M]; l.resi !== y && (y = l.resi, x || A++, x = !1), l.reschain = A; for (let u = M + 1; u < v.length; u++) { - const g = v[u]; - if (g.chain !== l.chain || g.resi - l.resi > 1) + const p = v[u]; + if (p.chain !== l.chain || p.resi - l.resi > 1) break; - (0, r.areConnected)(l, g, d) && (l.bonds.indexOf(g.index) === -1 && (l.bonds.push(g.index), l.bondOrder.push(1), g.bonds.push(l.index), g.bondOrder.push(1)), l.resi !== g.resi && (x = !0)); + (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)); } } } @@ -36609,25 +36625,25 @@ 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, g = !!x.noSecondaryStructure, p = !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", _ = { symmetries: [], cryst: void 0 }; let E, w = []; const k = []; - let L; - const $ = {}; + let $; + const L = {}; for (let z = 0; z < A.length; z++) { - L = A[z].replace(/^\s*/, ""); - const O = L.substring(0, 6); + $ = A[z].replace(/^\s*/, ""); + const F = $.substring(0, 6); let R, P, U; - if (O.indexOf("END") === 0) { - if (w = A.slice(z + 1), O === "END") + if (F.indexOf("END") === 0) { + if (w = A.slice(z + 1), F === "END") for (const N in M) M.hasOwnProperty(N) && delete M[N]; break; - } else if (O === "ATOM " || O === "HETATM") { + } else if (F === "ATOM " || F === "HETATM") { let N, B, W, V, G, H, Q, te, ee, ce, fe, oe; - if (fe = L.substring(16, 17), fe !== " " && fe !== c && c !== "*" || (ce = parseInt(L.substring(6, 11)), E = L.substring(12, 16).replace(/ /g, ""), N = L.substring(17, 20).replace(/ /g, ""), B = L.substring(21, 22), W = parseInt(L.substring(22, 26)), V = L.substring(26, 27), G = parseFloat(L.substring(30, 38)), H = parseFloat(L.substring(38, 46)), Q = parseFloat(L.substring(46, 54)), oe = parseFloat(L.substring(60, 68)), ee = L.substring(76, 78).replace(/ /g, ""), ee === "" || s.bondTable[ee] === void 0 ? ee = (0, a.atomNameToElem)(L.substring(12, 14), L[0] == "A") : ee = ee[0].toUpperCase() + ee.substring(1).toLowerCase(), ee === "H" && u)) + 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)) continue; - O[0] == "H" ? te = !0 : te = !1, k[ce] = m.length, m.push({ + F[0] == "H" ? te = !0 : te = !1, k[ce] = m.length, m.push({ resn: N, x: G, y: H, @@ -36649,48 +36665,48 @@ ATOM`, b); bondOrder: [], properties: {}, b: oe, - pdbline: L + pdbline: $ }); - } else if (O === "SHEET ") { - R = L.substring(21, 22), P = parseInt(L.substring(22, 26)), U = parseInt(L.substring(33, 37)), R in M || (M[R] = {}), M[R][P] = "s1"; + } 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"; - } else if (O === "CONECT") { - const N = parseInt(L.substring(6, 11)), B = k[N], W = m[B], V = [11, 16, 21, 26]; + } 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(L.substring(V[G], V[G] + 5)), Q = k[H]; + 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 (!$[te]) - $[te] = 1, (W.bonds.length == 0 || W.bonds[W.bonds.length - 1] !== Q) && (W.bonds.push(Q), W.bondOrder.push(1)); + 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)); else { - $[te] += 1; + L[te] += 1; for (let ce = 0; ce < W.bonds.length; ce++) if (W.bonds[ce] == Q) { - const fe = $[te]; + const fe = L[te]; fe >= 4 ? W.bondOrder[ce] = 1 : W.bondOrder[ce] = fe; } } } - } else if (O === "HELIX ") { - R = L.substring(19, 20), P = parseInt(L.substring(21, 25)), U = parseInt(L.substring(33, 37)), R in M || (M[R] = {}), M[R][P] = "h1"; + } 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"; - } else if (!b && O === "REMARK" && L.substring(13, 18) === "BIOMT") { + } else if (!b && F === "REMARK" && $.substring(13, 18) === "BIOMT") { let N, B = new r.Matrix4(); for (N = 1; N <= 3; N++) - if (L = A[z].replace(/^\s*/, ""), parseInt(L.substring(18, 19)) == N) - B.elements[N - 1] = parseFloat(L.substring(23, 33)), B.elements[N - 1 + 4] = parseFloat(L.substring(33, 43)), B.elements[N - 1 + 8] = parseFloat(L.substring(43, 53)), B.elements[N - 1 + 12] = parseFloat(L.substring(53)), z++; + 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++; else - for (; L.substring(13, 18) === "BIOMT"; ) - z++, L = A[z].replace(/^\s*/, ""); + 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--; - } else if (O === "CRYST1") { + } else if (F === "CRYST1") { let N, B, W, V, G, H; - N = parseFloat(L.substring(7, 15)), B = parseFloat(L.substring(16, 24)), W = parseFloat(L.substring(25, 33)), V = parseFloat(L.substring(34, 40)), G = parseFloat(L.substring(41, 47)), H = parseFloat(L.substring(48, 54)), _.cryst = { + 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, c: W, @@ -36698,10 +36714,10 @@ ATOM`, b); beta: G, gamma: H }; - } else if (O === "ANISOU") { - const N = parseInt(L.substring(6, 11)), B = k[N], W = m[B]; + } else if (F === "ANISOU") { + const N = parseInt($.substring(6, 11)), B = k[N], W = m[B]; if (W) { - const V = L.substring(30).trim().split(/\s+/), G = { + const V = $.substring(30).trim().split(/\s+/), G = { u11: parseInt(V[0]), u22: parseInt(V[1]), u33: parseInt(V[2]), @@ -36713,12 +36729,12 @@ ATOM`, b); } } } - if ((0, f.validateBonds)(m, k), l && (0, v.assignPDBBonds)(m, x), b || (0, d.processSymmetries)(_.symmetries, m, x, _.cryst), p && !g && (0, h.computeSecondaryStructure)(m, x.hbondCutoff), !(0, o.isEmpty)(M)) + 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 O = m[z]; - if (O !== void 0 && O.chain in M && O.resi in M[O.chain]) { - const R = M[O.chain][O.resi]; - O.ss = R[0], R.length > 1 && (R[1] == "1" ? O.ssbegin = !0 : R[1] == "2" && (O.ssend = !0)); + const F = m[z]; + 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)); } } return [m, _, w]; @@ -36770,9 +36786,9 @@ ATOM`, b); const v = !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(g) { - let p = g.clone().applyMatrix3(M); - const b = [p.x, p.y, p.z], c = [0, 0, 0]; + let m = function(p) { + let g = p.clone().applyMatrix3(M); + const b = [g.x, g.y, g.z], c = [0, 0, 0]; for (let E = 0; E < 3; E++) { for (; b[E] < -1e-3; ) b[E] += 1, c[E] += 1; @@ -36783,62 +36799,62 @@ ATOM`, b); return _.applyMatrix3(x), _; }; if (o.normalizeAssembly && d) - for (let g = 0; g < s.length; g++) { - const p = new r.Vector3(0, 0, 0); + 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[g]), p.add(_); + _.applyMatrix4(s[p]), g.add(_); } - p.divideScalar(f); - const b = m(p); - s[g].isNearlyIdentity() && b.lengthSq() > 1e-3 && (A = g), s[g].translate(b); + g.divideScalar(f); + const b = m(g); + s[p].isNearlyIdentity() && b.lengthSq() > 1e-3 && (A = p), s[p].translate(b); } if (v) { if (s.length > 1) - for (let g = 0; g < h.length; g++) { + for (let p = 0; p < h.length; p++) { var l = []; - for (let p = 0; p < s.length; p++) - if (!s[p].isNearlyIdentity()) { + for (let g = 0; g < s.length; g++) + if (!s[g].isNearlyIdentity()) { var u = new r.Vector3(); - u.set(h[g].x, h[g].y, h[g].z), u.applyMatrix4(s[p]), l.push(u); + u.set(h[p].x, h[p].y, h[p].z), u.applyMatrix4(s[g]), l.push(u); } - h[g].symmetries = l; + h[p].symmetries = l; } } else { - for (let g = 0; g < f; g++) - h[g].sym = -1; - for (let g = 0; g < s.length; g++) - if (!s[g].isNearlyIdentity() && A != g) { - let p = new r.Vector3(); + for (let p = 0; p < f; p++) + h[p].sym = -1; + for (let p = 0; p < s.length; p++) + if (!s[p].isNearlyIdentity() && A != p) { + let g = new r.Vector3(); for (let b = 0; b < f; b++) { const c = []; for (let E = 0; E < h[b].bonds.length; E++) c.push(h[b].bonds[E] + y); - if (p.set(h[b].x, h[b].y, h[b].z), p.applyMatrix4(s[g]), o.wrapAtoms && d) { - let E = m(p); - p.add(E); + if (g.set(h[b].x, h[b].y, h[b].z), g.applyMatrix4(s[p]), o.wrapAtoms && d) { + let E = m(g); + g.add(E); } const _ = {}; for (const E in h[b]) _[E] = h[b][E]; - _.x = p.x, _.y = p.y, _.z = p.z, _.bonds = c, _.sym = g, _.index = h.length, h.push(_); + _.x = g.x, _.y = g.y, _.z = g.z, _.bonds = c, _.sym = p, _.index = h.length, h.push(_); } y = h.length; } else - for (let p = 0; p < f; p++) - h[p].sym = g; + for (let g = 0; g < f; g++) + h[g].sym = p; if (o.wrapAtoms && d) { - let g = new r.Vector3(); - for (let p = 0; p < f; p++) { - g.set(h[p].x, h[p].y, h[p].z); - let b = m(g); - g.add(b), h[p].x = g.x, h[p].y = g.y, h[p].z = g.z; + let p = new r.Vector3(); + for (let g = 0; g < f; g++) { + p.set(h[g].x, h[g].y, h[g].z); + let b = m(p); + p.add(b), h[g].x = p.x, h[g].y = p.y, h[g].z = p.z; } } if (A >= 0) { - const g = new r.Vector3(); - for (let p = 0; p < f; p++) - g.set(h[p].x, h[p].y, h[p].z), g.applyMatrix4(s[A]), h[p].x = g.x, h[p].y = g.y, h[p].z = g.z; + const p = new r.Vector3(); + for (let g = 0; g < f; g++) + p.set(h[g].x, h[g].y, h[g].z), p.applyMatrix4(s[A]), h[g].x = p.x, h[g].y = p.y, h[g].z = p.z; } s.length = 0; } @@ -37510,9 +37526,9 @@ ATOM`, b); 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++) { - var M = o.frames[x], m = M.rect.x, l = M.rect.y, u = M.rect.width, g = M.rect.height, p = s.toRGBA8.decodeImage(M.data, u, g, o); - if (x == 0 ? y = p : M.blend == 0 ? s._copyTile(p, u, g, y, d, v, m, l, 0) : M.blend == 1 && s._copyTile(p, u, g, 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, g, y, d, v, m, l, 0); + 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); else if (M.dispose == 2) { for (var b = x - 1; o.frames[b].dispose == 2; ) b--; y = new Uint8Array(f[b]).slice(0); @@ -37521,43 +37537,43 @@ 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, g = s._bin.readUshort; + 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; if (l == 6) { - var p = y << 2; - if (u == 8) for (var b = 0; b < p; b++) + var g = y << 2; + if (u == 8) for (var b = 0; b < g; b++) M[b] = o[b]; - if (u == 16) for (var b = 0; b < p; 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 k = b << 2, L = b * 3; - M[k] = o[L], M[k + 1] = o[L + 1], M[k + 2] = o[L + 2], M[k + 3] = 255, _ != -1 && o[L] == _ && o[L + 1] == E && o[L + 2] == w && (M[k + 3] = 0); + 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); } if (u == 16) for (var b = 0; b < y; b++) { - var k = b << 2, L = b * 6; - M[k] = o[L], M[k + 1] = o[L + 2], M[k + 2] = o[L + 4], M[k + 3] = 255, _ != -1 && g(o, L) == _ && g(o, L + 2) == E && g(o, L + 4) == w && (M[k + 3] = 0); + 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); } } else if (l == 3) { - var $ = f.tabs.PLTE, z = f.tabs.tRNS, O = z ? z.length : 0; + 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] = $[B], M[k + 1] = $[B + 1], M[k + 2] = $[B + 2], M[k + 3] = N < O ? z[N] : 255; + 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 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] = $[B], M[k + 1] = $[B + 1], M[k + 2] = $[B + 2], M[k + 3] = N < O ? z[N] : 255; + 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 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] = $[B], M[k + 1] = $[B + 1], M[k + 2] = $[B + 2], M[k + 3] = N < O ? z[N] : 255; + 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 == 8) for (var b = 0; b < y; b++) { var k = b << 2, N = o[b], B = 3 * N; - M[k] = $[B], M[k + 1] = $[B + 1], M[k + 2] = $[B + 2], M[k + 3] = N < O ? z[N] : 255; + M[k] = L[B], M[k + 1] = L[B + 1], M[k + 2] = L[B + 2], M[k + 3] = N < F ? z[N] : 255; } } else if (l == 4) { if (u == 8) for (var b = 0; b < y; b++) { @@ -37587,13 +37603,13 @@ ATOM`, b); m[b] = G << 24 | V << 16 | V << 8 | V; } if (u == 16) for (var b = 0; b < y; b++) { - var V = o[b << 1], G = g(o, b << 1) == _ ? 0 : 255; + var V = o[b << 1], G = p(o, b << 1) == _ ? 0 : 255; m[b] = G << 24 | V << 16 | V << 8 | V; } } 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, g = [137, 80, 78, 71, 13, 10, 26, 10], p = 0; p < 8; p++) if (d[p] != g[p]) throw "The input is not a PNG file!"; + 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; @@ -37601,7 +37617,7 @@ ATOM`, b); if (v += 4, c == "IHDR") s.decode._IHDR(d, v, x); else if (c == "IDAT") { - for (var p = 0; p < b; p++) M[m + p] = d[v + p]; + for (var g = 0; g < b; g++) M[m + g] = d[v + 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); @@ -37615,31 +37631,31 @@ ATOM`, b); var k = { rect: E, delay: Math.round(w * 1e3), dispose: d[v + 24], blend: d[v + 25] }; x.frames.push(k); } else if (c == "fdAT") { - for (var p = 0; p < b - 4; p++) l[u + p] = d[v + p + 4]; + for (var g = 0; g < b - 4; g++) l[u + g] = d[v + g + 4]; u += b - 4; } else if (c == "pHYs") x.tabs[c] = [f.readUint(d, v), f.readUint(d, v + 4), d[v + 8]]; else if (c == "cHRM") { x.tabs[c] = []; - for (var p = 0; p < 8; p++) x.tabs[c].push(f.readUint(d, v + p * 4)); + for (var g = 0; g < 8; g++) x.tabs[c].push(f.readUint(d, v + g * 4)); } else if (c == "tEXt") { x.tabs[c] == null && (x.tabs[c] = {}); - var L = f.nextZero(d, v), $ = f.readASCII(d, v, L - v), z = f.readASCII(d, L + 1, v + b - L - 1); - x.tabs[c][$] = z; + var $ = f.nextZero(d, v), L = f.readASCII(d, v, $ - v), z = f.readASCII(d, $ + 1, v + b - $ - 1); + x.tabs[c][L] = z; } else if (c == "iTXt") { x.tabs[c] == null && (x.tabs[c] = {}); - var L = 0, O = v; - L = f.nextZero(d, O); - var $ = f.readASCII(d, O, L - O); - O = L + 1, d[O], d[O + 1], O += 2, L = f.nextZero(d, O), f.readASCII(d, O, L - O), O = L + 1, L = f.nextZero(d, O), f.readUTF8(d, O, L - O), O = L + 1; - var z = f.readUTF8(d, O, b - (O - v)); - x.tabs[c][$] = z; + var $ = 0, F = v; + $ = 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; } else if (c == "PLTE") x.tabs[c] = f.readBytes(d, v, b); else if (c == "hIST") { var R = x.tabs.PLTE.length / 3; x.tabs[c] = []; - for (var p = 0; p < R; p++) x.tabs[c].push(y(d, v + p * 2)); + for (var g = 0; g < R; g++) x.tabs[c].push(y(d, v + 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; @@ -37662,34 +37678,34 @@ ATOM`, b); }, 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], g = [8, 8, 8, 4, 4, 2, 2], p = [8, 8, 4, 4, 2, 2, 1], b = 0; b < 7; ) { - for (var c = g[b], _ = p[b], E = 0, w = 0, k = l[b]; k < f; ) + 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; ) k += c, w++; - for (var L = u[b]; L < v; ) - L += _, E++; - var $ = Math.ceil(E * y / 8); + 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, O = l[b]; O < f; ) { - for (var R = u[b], P = m + z * $ << 3; R < v; ) { + for (var z = 0, F = l[b]; F < f; ) { + for (var R = u[b], P = m + z * L << 3; R < v; ) { if (y == 1) { var U = o[P >> 3]; - U = U >> 7 - (P & 7) & 1, M[O * x + (R >> 3)] |= U << 7 - ((R & 3) << 0); + U = U >> 7 - (P & 7) & 1, M[F * x + (R >> 3)] |= U << 7 - ((R & 3) << 0); } if (y == 2) { var U = o[P >> 3]; - U = U >> 6 - (P & 7) & 3, M[O * x + (R >> 2)] |= U << 6 - ((R & 3) << 1); + U = U >> 6 - (P & 7) & 3, M[F * x + (R >> 2)] |= U << 6 - ((R & 3) << 1); } if (y == 4) { var U = o[P >> 3]; - U = U >> 4 - (P & 7) & 15, M[O * x + (R >> 1)] |= U << 4 - ((R & 1) << 2); + U = U >> 4 - (P & 7) & 15, M[F * x + (R >> 1)] |= U << 4 - ((R & 1) << 2); } if (y >= 8) - for (var N = O * x + R * A, B = 0; B < A; B++) M[N + B] = o[(P >> 3) + B]; + for (var N = F * x + R * A, B = 0; B < A; B++) M[N + B] = o[(P >> 3) + B]; P += y, R += _; } - z++, O += c; + z++, F += c; } - E * w != 0 && (m += w * (1 + $)), b = b + 1; + E * w != 0 && (m += w * (1 + L)), b = b + 1; } return M; }, s.decode._getBPP = function(o) { @@ -37699,26 +37715,26 @@ ATOM`, b); 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, g = o[u - 1]; - if (g == 0) for (var p = 0; p < x; p++) o[l + p] = o[u + p]; - else if (g == 1) { - for (var p = 0; p < A; p++) o[l + p] = o[u + p]; - for (var p = A; p < x; p++) o[l + p] = o[u + p] + o[l + p - A] & 255; + var l = v + 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]; + for (var g = A; g < x; g++) o[l + g] = o[u + g] + o[l + g - A] & 255; } else if (m == 0) { - for (var p = 0; p < A; p++) o[l + p] = o[u + p]; - if (g == 2) for (var p = A; p < x; p++) o[l + p] = o[u + p] & 255; - if (g == 3) for (var p = A; p < x; p++) o[l + p] = o[u + p] + (o[l + p - A] >> 1) & 255; - if (g == 4) for (var p = A; p < x; p++) o[l + p] = o[u + p] + M(o[l + p - A], 0, 0) & 255; + for (var g = 0; g < A; g++) o[l + g] = o[u + g]; + if (p == 2) for (var g = A; g < x; g++) o[l + g] = o[u + g] & 255; + if (p == 3) for (var g = A; g < x; g++) o[l + g] = o[u + g] + (o[l + g - A] >> 1) & 255; + if (p == 4) for (var g = A; g < x; g++) o[l + g] = o[u + g] + M(o[l + g - A], 0, 0) & 255; } else { - if (g == 2) - for (var p = 0; p < x; p++) o[l + p] = o[u + p] + o[l + p - x] & 255; - if (g == 3) { - for (var p = 0; p < A; p++) o[l + p] = o[u + p] + (o[l + p - x] >> 1) & 255; - for (var p = A; p < x; p++) o[l + p] = o[u + p] + (o[l + p - x] + o[l + p - A] >> 1) & 255; + if (p == 2) + for (var g = 0; g < x; g++) o[l + g] = o[u + g] + o[l + g - x] & 255; + if (p == 3) { + for (var g = 0; g < A; g++) o[l + g] = o[u + g] + (o[l + g - x] >> 1) & 255; + for (var g = A; g < x; g++) o[l + g] = o[u + g] + (o[l + g - x] + o[l + g - A] >> 1) & 255; } - if (g == 4) { - for (var p = 0; p < A; p++) o[l + p] = o[u + p] + M(0, o[l + p - x], 0) & 255; - for (var p = A; p < x; p++) o[l + p] = o[u + p] + M(o[l + p - A], o[l + p - x], o[l + p - A - x]) & 255; + if (p == 4) { + for (var g = 0; g < A; g++) o[l + g] = o[u + g] + M(0, o[l + g - x], 0) & 255; + for (var g = A; g < x; g++) o[l + g] = o[u + g] + M(o[l + g - A], o[l + g - x], o[l + g - A - x]) & 255; } } } @@ -37770,64 +37786,64 @@ ATOM`, b); 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), g = 0, p = 0, b = 0; b < u; b++) + for (var l = Math.min(d, y), u = Math.min(v, A), p = 0, g = 0, b = 0; b < u; b++) for (var c = 0; c < l; c++) - if (x >= 0 && M >= 0 ? (g = b * d + c << 2, p = (M + b) * y + x + c << 2) : (g = (-M + b) * d - x + c << 2, p = b * y + c << 2), m == 0) - f[p] = o[g], f[p + 1] = o[g + 1], f[p + 2] = o[g + 2], f[p + 3] = o[g + 3]; + 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[g + 3] * 0.00392156862745098, E = o[g] * _, w = o[g + 1] * _, k = o[g + 2] * _, L = f[p + 3] * (1 / 255), $ = f[p] * L, z = f[p + 1] * L, O = f[p + 2] * L, R = 1 - _, P = _ + L * R, U = P == 0 ? 0 : 1 / P; - f[p + 3] = 255 * P, f[p + 0] = (E + $ * R) * U, f[p + 1] = (w + z * R) * U, f[p + 2] = (k + O * R) * U; + 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; } else if (m == 2) { - var _ = o[g + 3], E = o[g], w = o[g + 1], k = o[g + 2], L = f[p + 3], $ = f[p], z = f[p + 1], O = f[p + 2]; - _ == L && E == $ && w == z && k == O ? (f[p] = 0, f[p + 1] = 0, f[p + 2] = 0, f[p + 3] = 0) : (f[p] = E, f[p + 1] = w, f[p + 2] = k, f[p + 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]; + _ == $ && 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] = _); } else if (m == 3) { - var _ = o[g + 3], E = o[g], w = o[g + 1], k = o[g + 2], L = f[p + 3], $ = f[p], z = f[p + 1], O = f[p + 2]; - if (_ == L && E == $ && w == z && k == O) continue; - if (_ < 220 && L > 20) return !1; + 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; } return !0; }, s.encode = function(o, d, v, 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, g = s.crc.crc, p = u.writeUint, b = u.writeUshort, c = u.writeASCII, _ = s.encode.compressPNG(o, d, v, f, A); - p(x, l, 13), l += 4, c(x, l, "IHDR"), l += 4, p(x, l, d), l += 4, p(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++, p(x, l, g(x, l - 17, 17)), l += 4, p(x, l, 1), l += 4, c(x, l, "sRGB"), l += 4, x[l] = 1, l++, p(x, l, g(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, _ = 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 E = o.length > 1; - if (E && (p(x, l, 8), l += 4, c(x, l, "acTL"), l += 4, p(x, l, o.length), l += 4, p(x, l, 0), l += 4, p(x, l, g(x, l - 12, 12)), l += 4), _.ctype == 3) { + 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; - p(x, l, w * 3), l += 4, c(x, l, "PLTE"), l += 4; + g(x, l, w * 3), l += 4, c(x, l, "PLTE"), l += 4; for (var m = 0; m < w; m++) { - var k = m * 3, L = _.plte[m], $ = L & 255, z = L >> 8 & 255, O = L >> 16 & 255; - x[l + k + 0] = $, x[l + k + 1] = z, x[l + k + 2] = O; + 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; } - if (l += w * 3, p(x, l, g(x, l - w * 3 - 4, w * 3 + 4)), l += 4, _.gotAlpha) { - p(x, l, w), l += 4, c(x, l, "tRNS"), l += 4; + if (l += w * 3, g(x, l, p(x, l - w * 3 - 4, w * 3 + 4)), l += 4, _.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; - l += w, p(x, l, g(x, l - w - 4, w + 4)), l += 4; + 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 && (p(x, l, 26), l += 4, c(x, l, "fcTL"), l += 4, p(x, l, R++), l += 4, p(x, l, U.rect.width), l += 4, p(x, l, U.rect.height), l += 4, p(x, l, U.rect.x), l += 4, p(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++, p(x, l, g(x, l - 30, 30)), l += 4); + 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; - p(x, l, w + (P == 0 ? 0 : 4)), l += 4; + g(x, l, w + (P == 0 ? 0 : 4)), l += 4; var B = l; - c(x, l, P == 0 ? "IDAT" : "fdAT"), l += 4, P != 0 && (p(x, l, R++), l += 4); + 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, p(x, l, g(x, B, l - B)), l += 4; + l += w, g(x, l, p(x, B, l - B)), l += 4; } - return p(x, l, 0), l += 4, c(x, l, "IEND"), l += 4, p(x, l, g(x, l - 4, 4)), l += 4, x.buffer.slice(0, l); + 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++) { var M = A.frames[x]; M.rect.width; - var m = M.rect.height, l = M.bpl, u = M.bpp, g = new Uint8Array(m * l + m); - M.cimg = s.encode._filterZero(M.img, m, u, l, g); + 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) { A == null && (A = !1); for (var x = 6, M = 8, m = 4, l = 255, u = 0; u < o.length; u++) - for (var g = new Uint8Array(o[u]), p = g.length, b = 0; b < p; b += 4) l &= g[b + 3]; + 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 w = s.quantize(o, f, y); @@ -37838,17 +37854,17 @@ ATOM`, b); } } else for (var u = 0; u < o.length; u++) - for (var L = new Uint32Array(o[u]), p = L.length, b = 0; b < p; b++) { - var k = L[b]; - if ((b < d || k != L[b - 1] && k != L[b - d]) && _[k] == null && (_[k] = E.length, E.push(k), E.length >= 300)) + 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)) break; } - var $ = c ? y : !1, z = E.length; + 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); - for (var O = [], u = 0; u < o.length; u++) { + 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; - if (u != 0 && !$) { - for (var G = y || u == 1 || O[O.length - 2].dispose == 2 ? 1 : 2, H = 0, Q = 1e9, te = 0; te < G; te++) { + 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)); @@ -37857,7 +37873,7 @@ ATOM`, b); 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 pe = new Uint8Array(o[u - 1 - H]); - H == 1 && (O[O.length - 1].dispose = 2); + 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); } @@ -37873,15 +37889,15 @@ ATOM`, b); } R = le, x = 3, m = 1; } else if (c == !1 && o.length == 1) { - for (var le = new Uint8Array(B * W * 3), Fe = B * W, b = 0; b < Fe; b++) { + 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]; } R = le, x = 2, m = 3, ne = 3 * B; } - O.push({ rect: { x: U, y: N, width: B, height: W }, img: R, bpl: ne, bpp: m, blend: V, dispose: $ ? 1 : 0 }); + F.push({ rect: { x: U, y: N, width: B, height: W }, img: R, bpl: ne, bpp: m, blend: V, dispose: L ? 1 : 0 }); } - return { ctype: x, depth: M, plte: E, gotAlpha: c, frames: O }; + return { ctype: x, depth: M, plte: E, gotAlpha: c, frames: F }; }, s.encode._filterZero = function(o, d, v, f, y) { for (var A = [], x = 0; x < 5; x++) if (!(d * f > 5e5 && (x == 2 || x == 3 || x == 4))) { @@ -37933,31 +37949,31 @@ ATOM`, b); 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; 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, g = 0; g < u; g++) x[m + g] = l[g]; + for (var l = f[A], u = l.length, p = 0; p < u; p++) x[m + p] = l[p]; m += u; } - var p = { i0: 0, i1: x.length, bst: null, est: null, tdst: 0, left: null, right: null }; - p.bst = s.quantize.stats(x, p.i0, p.i1), p.est = s.quantize.estats(p.bst); - for (var b = [p]; b.length < d; ) { + 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); 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 }; k.bst = s.quantize.stats(x, k.i0, k.i1), k.est = s.quantize.estats(k.bst); - var L = { i0: w, i1: E.i1, bst: null, est: null, tdst: 0, left: null, right: null }; - L.bst = { R: [], m: [], N: E.bst.N - k.bst.N }; - for (var A = 0; A < 16; A++) L.bst.R[A] = E.bst.R[A] - k.bst.R[A]; - for (var A = 0; A < 4; A++) L.bst.m[A] = E.bst.m[A] - k.bst.m[A]; - L.est = s.quantize.estats(L.bst), E.left = k, E.right = L, b[_] = k, b.push(L); + 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($); } b.sort(function(G, H) { return H.bst.N - G.bst.N; }); - for (var $ = 0; $ < f.length; $++) { - for (var z = s.quantize.planeDst, O = new Uint8Array(f[$].buffer), R = new Uint32Array(f[$].buffer), P = O.length, A = 0; A < P; A += 4) { - for (var U = O[A] * 0.00392156862745098, N = O[A + 1] * (1 / 255), B = O[A + 2] * (1 / 255), W = O[A + 3] * (1 / 255), V = p; V.left; ) V = z(V.est, U, N, B, W) <= 0 ? V.left : V.right; + 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; } - f[$] = R.buffer; + f[L] = R.buffer; } return { bufs: f, plte: b }; }, s.quantize.getNearest = function(o, d, v, f, y) { @@ -38012,18 +38028,18 @@ ATOM`, b); d[13] - M * A * m, d[14] - M * x * m, d[15] - M * M * m - ], u = l, g = s.M4, p = [0.5, 0.5, 0.5, 0.5], b = 0, c = 0; + ], 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 && (p = g.multVec(u, p), c = Math.sqrt(g.dot(p, p)), p = g.sml(1 / c, p), !(Math.abs(c - b) < 1e-9)); _++) + 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)); _++) b = c; - var E = [y * m, A * m, x * m, M * m], w = g.dot(g.sml(255, E), p), k = E[3] < 1e-3 ? 0 : 1 / E[3]; + 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 { Cov: l, q: E, - e: p, + e: g, L: b, eMq255: w, - eMq: g.dot(p, E), + eMq: p.dot(g, E), rgba: (Math.round(255 * E[3]) << 24 | Math.round(255 * E[2] * k) << 16 | Math.round(255 * E[1] * k) << 8 | Math.round(255 * E[0] * k) << 0) >>> 0 }; }, s.M4 = { @@ -38131,34 +38147,34 @@ ATOM`, b); } } u.prototype.push = function(c, _) { - var E = this.strm, w = this.options.chunkSize, k, L; + var E = this.strm, w = this.options.chunkSize, k, $; if (this.ended) return !1; - L = _ === ~~_ ? _ : _ === !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; + $ = _ === ~~_ ? _ : _ === !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; do { - if (E.avail_out === 0 && (E.output = new a.Buf8(w), E.next_out = 0, E.avail_out = w), k = r.deflate(E, L), k !== A && k !== y) + 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; - (E.avail_out === 0 || E.avail_in === 0 && (L === f || L === x)) && (this.options.to === "string" ? this.onData(s.buf2binstring(a.shrinkBuf(E.output, E.next_out))) : this.onData(a.shrinkBuf(E.output, E.next_out))); + (E.avail_out === 0 || E.avail_in === 0 && ($ === f || $ === x)) && (this.options.to === "string" ? this.onData(s.buf2binstring(a.shrinkBuf(E.output, E.next_out))) : this.onData(a.shrinkBuf(E.output, E.next_out))); } while ((E.avail_in > 0 || E.avail_out === 0) && k !== A); - return L === f ? (k = r.deflateEnd(this.strm), this.onEnd(k), this.ended = !0, k === y) : (L === x && (this.onEnd(y), E.avail_out = 0), !0); + return $ === f ? (k = r.deflateEnd(this.strm), this.onEnd(k), this.ended = !0, k === y) : ($ === x && (this.onEnd(y), E.avail_out = 0), !0); }, u.prototype.onData = function(c) { this.chunks.push(c); }, 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 g(c, _) { + function p(c, _) { var E = new u(_); if (E.push(c, !0), E.err) throw E.msg || h[E.err]; return E.result; } - function p(c, _) { - return _ = _ || {}, _.raw = !0, g(c, _); + function g(c, _) { + return _ = _ || {}, _.raw = !0, p(c, _); } function b(c, _) { - return _ = _ || {}, _.gzip = !0, g(c, _); + return _ = _ || {}, _.gzip = !0, p(c, _); } - e.Deflate = u, e.deflate = g, e.deflateRaw = p, e.gzip = b; + e.Deflate = u, e.deflate = p, e.deflateRaw = g, e.gzip = b; } ), /***/ @@ -38209,16 +38225,16 @@ ATOM`, b); throw new Error(o[l]); } y.prototype.push = function(M, m) { - var l = this.strm, u = this.options.chunkSize, g = this.options.dictionary, p, b, c, _, E, w = !1; + var l = this.strm, u = this.options.chunkSize, p = this.options.dictionary, g, b, c, _, 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), p = r.inflate(l, h.Z_NO_FLUSH), p === h.Z_NEED_DICT && g && (p = r.inflateSetDictionary(this.strm, g)), p === h.Z_BUF_ERROR && w === !0 && (p = h.Z_OK, w = !1), p !== h.Z_STREAM_END && p !== h.Z_OK) - return this.onEnd(p), this.ended = !0, !1; - l.next_out && (l.avail_out === 0 || p === 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); - } while ((l.avail_in > 0 || l.avail_out === 0) && p !== h.Z_STREAM_END); - return p === h.Z_STREAM_END && (b = h.Z_FINISH), b === h.Z_FINISH ? (p = r.inflateEnd(this.strm), this.onEnd(p), this.ended = !0, p === h.Z_OK) : (b === h.Z_SYNC_FLUSH && (this.onEnd(h.Z_OK), l.avail_out = 0), !0); + 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); + } 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) { this.chunks.push(M); }, y.prototype.onEnd = function(M) { @@ -38484,11 +38500,11 @@ 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, g = -1, p = 1, b = 2, c = 3, _ = 4, E = 0, w = 2, k = 8, L = 9, $ = 15, z = 8, O = 29, R = 256, P = R + 1 + O, 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; + ), 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; } - function Fe(I) { + function Oe(I) { return (I << 1) - (I > 4 ? 9 : 0); } function Be(I) { @@ -38599,7 +38615,7 @@ ATOM`, b); if (I.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 === p || 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) { + 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; 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); @@ -38694,14 +38710,14 @@ ATOM`, b); if (!I) return m; var Ye = 1; - if (we === g && (we = 6), Y < 0 ? (Ye = 0, Y = -Y) : Y > 15 && (Ye = 2, Y -= 16), de < 1 || de > L || ve !== k || Y < 8 || Y > 15 || we < 0 || we > 9 || Me < 0 || Me > _) + 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); 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, $, z, E); + return ue(I, we, k, L, z, E); } function Z(I, we) { var ve, Y, de, Me; @@ -38755,7 +38771,7 @@ ATOM`, b); 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) return Y.last_flush = -1, x; - } else if (I.avail_in === 0 && Fe(we) <= Fe(ve) && we !== y) + } 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); @@ -38768,7 +38784,7 @@ ATOM`, b); } 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); } - function Oe(I) { + 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)); } @@ -38785,7 +38801,7 @@ ATOM`, b); } 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; } - e.deflateInit = Ce, e.deflateInit2 = ue, e.deflateReset = ge, e.deflateResetKeep = ae, e.deflateSetHeader = xe, e.deflate = Z, e.deflateEnd = Oe, e.deflateSetDictionary = We, e.deflateInfo = "pako deflate (from Nodeca project)"; + 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)"; } ), /***/ @@ -38810,67 +38826,67 @@ 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, g, p, b, c, _, E, w, k, L, $, z, O, R; - h = a.state, o = a.next_in, O = 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, g = h.bits, p = h.lencode, b = h.distcode, c = (1 << h.lenbits) - 1, _ = (1 << h.distbits) - 1; + 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; e: do { - g < 15 && (u += O[o++] << g, g += 8, u += O[o++] << g, g += 8), E = p[u & c]; + 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, g -= w, w = E >>> 16 & 255, w === 0) + if (w = E >>> 24, u >>>= w, p -= w, w = E >>> 16 & 255, w === 0) R[v++] = E & 65535; else if (w & 16) { - k = E & 65535, w &= 15, w && (g < w && (u += O[o++] << g, g += 8), k += u & (1 << w) - 1, u >>>= w, g -= w), g < 15 && (u += O[o++] << g, g += 8, u += O[o++] << g, g += 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 & _]; r: for (; ; ) { - if (w = E >>> 24, u >>>= w, g -= w, w = E >>> 16 & 255, w & 16) { - if (L = E & 65535, w &= 15, g < w && (u += O[o++] << g, g += 8, g < w && (u += O[o++] << g, g += 8)), L += u & (1 << w) - 1, L > A) { + if (w = E >>> 24, u >>>= w, p -= w, w = E >>> 16 & 255, w & 16) { + if ($ = E & 65535, w &= 15, p < w && (u += F[o++] << p, p += 8, p < w && (u += F[o++] << p, p += 8)), $ += u & (1 << w) - 1, $ > A) { a.msg = "invalid distance too far back", h.mode = e; break e; } - if (u >>>= w, g -= w, w = v - f, L > w) { - if (w = L - w, w > M && h.sane) { + if (u >>>= w, p -= w, w = v - f, $ > w) { + if (w = $ - w, w > M && h.sane) { a.msg = "invalid distance too far back", h.mode = e; break e; } - if ($ = 0, z = l, m === 0) { - if ($ += x - w, w < k) { + if (L = 0, z = l, m === 0) { + if (L += x - w, w < k) { k -= w; do - R[v++] = l[$++]; + R[v++] = l[L++]; while (--w); - $ = v - L, z = R; + L = v - $, z = R; } } else if (m < w) { - if ($ += x + m - w, w -= m, w < k) { + if (L += x + m - w, w -= m, w < k) { k -= w; do - R[v++] = l[$++]; + R[v++] = l[L++]; while (--w); - if ($ = 0, m < k) { + if (L = 0, m < k) { w = m, k -= w; do - R[v++] = l[$++]; + R[v++] = l[L++]; while (--w); - $ = v - L, z = R; + L = v - $, z = R; } } - } else if ($ += m - w, w < k) { + } else if (L += m - w, w < k) { k -= w; do - R[v++] = l[$++]; + R[v++] = l[L++]; while (--w); - $ = v - L, z = R; + L = v - $, z = R; } for (; k > 2; ) - R[v++] = z[$++], R[v++] = z[$++], R[v++] = z[$++], k -= 3; - k && (R[v++] = z[$++], k > 1 && (R[v++] = z[$++])); + 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++])); } else { - $ = v - L; + L = v - $; do - R[v++] = R[$++], R[v++] = R[$++], R[v++] = R[$++], k -= 3; + R[v++] = R[L++], R[v++] = R[L++], R[v++] = R[L++], k -= 3; while (k > 2); - k && (R[v++] = R[$++], k > 1 && (R[v++] = R[$++])); + k && (R[v++] = R[L++], k > 1 && (R[v++] = R[L++])); } } else if (w & 64) { a.msg = "invalid distance code", h.mode = e; @@ -38890,13 +38906,13 @@ ATOM`, b); break e; } else { - E = p[(E & 65535) + (u & (1 << w) - 1)]; + E = g[(E & 65535) + (u & (1 << w) - 1)]; continue t; } break; } } while (o < d && v < y); - k = g >> 3, o -= k, g -= k << 3, u &= (1 << g) - 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 = g; + 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; }; } ), @@ -38922,7 +38938,7 @@ 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, g = -3, p = -4, b = -5, c = 8, _ = 1, E = 2, w = 3, k = 4, L = 5, $ = 6, z = 7, O = 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, Fe = 32, Be = 852, Ue = 592, Pe = 15, Ge = Pe; + ), 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); } @@ -38938,12 +38954,12 @@ ATOM`, b); return !ue || !ue.state ? u : (Ce = ue.state, Ce.wsize = 0, Ce.whave = 0, Ce.wnext = 0, De(ue)); } function Xe(ue, Ce) { - var Z, Oe; - return !ue || !ue.state || (Oe = ue.state, Ce < 0 ? (Z = 0, Ce = -Ce) : (Z = (Ce >> 4) + 1, Ce < 48 && (Ce &= 15)), Ce && (Ce < 8 || Ce > 15)) ? u : (Oe.window !== null && Oe.wbits !== Ce && (Oe.window = null), Oe.wrap = Z, Oe.wbits = Ce, je(ue)); + 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)); } function X(ue, Ce) { - var Z, Oe; - return ue ? (Oe = new Re(), ue.state = Oe, Oe.window = null, Z = Xe(ue, Ce), Z !== M && (ue.state = null), Z) : u; + 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); @@ -38966,18 +38982,18 @@ ATOM`, b); } ue.lencode = ye, ue.lenbits = 9, ue.distcode = me, ue.distbits = 5; } - function ke(ue, Ce, Z, Oe) { + 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)), Oe >= 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 > Oe && (We = Oe), r.arraySet(I.window, Ce, Z - Oe, We, I.wnext), Oe -= We, Oe ? (r.arraySet(I.window, Ce, Z - Oe, Oe, 0), I.wnext = Oe, I.whave = I.wsize) : (I.wnext += We, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += We))), 0; + 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, Oe, We, I, we, ve, Y, de, Me, Ye, Ze, Ke, rt, wt, st = 0, ot, at, Mt, gt, Lt, Pt, Et, St, yt = new r.Buf8(4), zt, qe, be = ( + 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 = ( /* 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) 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, Oe = ue.input, ve = ue.avail_in, de = Z.hold, Me = Z.bits, Ye = ve, Ze = Y, St = M; + 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; e: for (; ; ) switch (Z.mode) { @@ -38989,7 +39005,7 @@ ATOM`, b); for (; Me < 16; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 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; @@ -39016,7 +39032,7 @@ ATOM`, b); for (; Me < 16; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (Z.flags = de, (Z.flags & 255) !== c) { ue.msg = "unknown compression method", Z.mode = ne; @@ -39031,37 +39047,37 @@ ATOM`, b); for (; Me < 32; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 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; case k: for (; Me < 16; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 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 = L; - case L: + 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 = $; + case $: if (Z.flags & 1024) { for (; Me < 16; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 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; } else Z.head && (Z.head.extra = null); - Z.mode = $; - case $: + 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, - Oe, + Fe, I, // 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, Oe, Ke, I)), ve -= Ke, I += Ke, Z.length -= Ke), Z.length)) + )), Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Z.length -= Ke), Z.length)) break e; Z.length = 0, Z.mode = z; case z: @@ -39070,21 +39086,21 @@ ATOM`, b); break e; Ke = 0; do - Et = Oe[I + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.name += String.fromCharCode(Et)); + Et = Fe[I + 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, Oe, Ke, I)), ve -= Ke, I += Ke, Et) + if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Et) break e; } else Z.head && (Z.head.name = null); - Z.length = 0, Z.mode = O; - case O: + Z.length = 0, Z.mode = F; + case F: if (Z.flags & 4096) { if (ve === 0) break e; Ke = 0; do - Et = Oe[I + Ke++], Z.head && Et && Z.length < 65536 && (Z.head.comment += String.fromCharCode(Et)); + Et = Fe[I + 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, Oe, Ke, I)), ve -= Ke, I += Ke, Et) + if (Z.flags & 512 && (Z.check = s(Z.check, Fe, Ke, I)), ve -= Ke, I += Ke, Et) break e; } else Z.head && (Z.head.comment = null); Z.mode = R; @@ -39093,7 +39109,7 @@ ATOM`, b); for (; Me < 16; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (de !== (Z.check & 65535)) { ue.msg = "header crc mismatch", Z.mode = ne; @@ -39107,7 +39123,7 @@ ATOM`, b); for (; Me < 32; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } ue.adler = Z.check = Ne(de), de = 0, Me = 0, Z.mode = U; case U: @@ -39125,7 +39141,7 @@ ATOM`, b); for (; Me < 3; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } switch (Z.last = de & 1, de >>>= 1, Me -= 1, de & 3) { case 0: @@ -39149,7 +39165,7 @@ ATOM`, b); for (de >>>= Me & 7, Me -= Me & 7; Me < 32; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if ((de & 65535) !== (de >>> 16 ^ 65535)) { ue.msg = "invalid stored block lengths", Z.mode = ne; @@ -39163,7 +39179,7 @@ ATOM`, b); if (Ke = Z.length, Ke) { if (Ke > ve && (Ke = ve), Ke > Y && (Ke = Y), Ke === 0) break e; - r.arraySet(We, Oe, I, Ke, we), ve -= Ke, I += Ke, Y -= Ke, we += Ke, Z.length -= Ke; + r.arraySet(We, Fe, I, Ke, we), ve -= Ke, I += Ke, Y -= Ke, we += Ke, Z.length -= Ke; break; } Z.mode = N; @@ -39172,7 +39188,7 @@ ATOM`, b); for (; Me < 14; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 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; @@ -39184,7 +39200,7 @@ ATOM`, b); for (; Me < 3; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } Z.lens[be[Z.have++]] = de & 7, de >>>= 3, Me -= 3; } @@ -39200,7 +39216,7 @@ ATOM`, b); for (; st = Z.lencode[de & (1 << Z.lenbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= Me); ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (Mt < 16) de >>>= ot, Me -= ot, Z.lens[Z.have++] = Mt; @@ -39209,7 +39225,7 @@ ATOM`, b); for (qe = ot + 2; Me < qe; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (de >>>= ot, Me -= ot, Z.have === 0) { ue.msg = "invalid bit length repeat", Z.mode = ne; @@ -39220,14 +39236,14 @@ ATOM`, b); for (qe = ot + 3; Me < qe; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } de >>>= ot, Me -= ot, Et = 0, Ke = 3 + (de & 7), de >>>= 3, Me -= 3; } else { for (qe = ot + 7; Me < qe; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } de >>>= ot, Me -= ot, Et = 0, Ke = 11 + (de & 127), de >>>= 7, Me -= 7; } @@ -39259,19 +39275,19 @@ ATOM`, b); Z.mode = ce; case ce: 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, Oe = ue.input, ve = ue.avail_in, de = Z.hold, Me = Z.bits, Z.mode === N && (Z.back = -1); + 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); 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); ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (at && !(at & 240)) { - for (gt = ot, Lt = at, Pt = Mt; st = Z.lencode[Pt + ((de & (1 << gt + Lt) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= Me); ) { + 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); ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } de >>>= gt, Me -= gt, Z.back += gt; } @@ -39293,7 +39309,7 @@ ATOM`, b); for (qe = Z.extra; Me < qe; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } Z.length += de & (1 << Z.extra) - 1, de >>>= Z.extra, Me -= Z.extra, Z.back += Z.extra; } @@ -39302,13 +39318,13 @@ ATOM`, b); for (; st = Z.distcode[de & (1 << Z.distbits) - 1], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(ot <= Me); ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (!(at & 240)) { - for (gt = ot, Lt = at, Pt = Mt; st = Z.distcode[Pt + ((de & (1 << gt + Lt) - 1) >> gt)], ot = st >>> 24, at = st >>> 16 & 255, Mt = st & 65535, !(gt + ot <= Me); ) { + 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); ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } de >>>= gt, Me -= gt, Z.back += gt; } @@ -39322,7 +39338,7 @@ ATOM`, b); for (qe = Z.extra; Me < qe; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } Z.offset += de & (1 << Z.extra) - 1, de >>>= Z.extra, Me -= Z.extra, Z.back += Z.extra; } @@ -39358,7 +39374,7 @@ ATOM`, b); for (; Me < 32; ) { if (ve === 0) break e; - ve--, de |= Oe[I++] << Me, Me += 8; + ve--, de |= Fe[I++] << Me, Me += 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) { @@ -39373,7 +39389,7 @@ ATOM`, b); for (; Me < 32; ) { if (ve === 0) break e; - ve--, de += Oe[I++] << Me, Me += 8; + ve--, de += Fe[I++] << Me, Me += 8; } if (de !== (Z.total & 4294967295)) { ue.msg = "incorrect length check", Z.mode = ne; @@ -39386,11 +39402,11 @@ ATOM`, b); St = m; break e; case ne: - St = g; + St = p; break e; case Te: - return p; - case Fe: + return g; + case Oe: default: return u; } @@ -39408,8 +39424,8 @@ ATOM`, b); return !ue || !ue.state || (Z = ue.state, !(Z.wrap & 2)) ? u : (Z.head = Ce, Ce.done = !1, M); } function xe(ue, Ce) { - var Z = Ce.length, Oe, We, I; - return !ue || !ue.state || (Oe = ue.state, Oe.wrap !== 0 && Oe.mode !== U) ? u : Oe.mode === U && (We = 1, We = a(We, Ce, Z, 0), We !== Oe.check) ? g : (I = ke(ue, Ce, Z, Z), I ? (Oe.mode = Te, p) : (Oe.havedict = 1, M)); + 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)); } 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)"; } @@ -39559,50 +39575,50 @@ ATOM`, b); 64, 64 ]; - n.exports = function(m, l, u, g, p, b, c, _) { - var E = _.bits, w = 0, k = 0, L = 0, $ = 0, z = 0, O = 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, _) { + 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; for (w = 0; w <= a; w++) ce[w] = 0; - for (k = 0; k < g; k++) + for (k = 0; k < p; k++) ce[l[u + k]]++; - for (z = E, $ = a; $ >= 1 && ce[$] === 0; $--) + for (z = E, L = a; L >= 1 && ce[L] === 0; L--) ; - if (z > $ && (z = $), $ === 0) - return p[b++] = 20971520, p[b++] = 20971520, _.bits = 1, 0; - for (L = 1; L < $ && ce[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; $++) ; - for (z < L && (z = L), P = 1, w = 1; w <= a; w++) + for (z < $ && (z = $), P = 1, w = 1; w <= a; w++) if (P <<= 1, P -= ce[w], P < 0) return -1; - if (P > 0 && (m === o || $ !== 1)) + if (P > 0 && (m === o || L !== 1)) return -1; for (fe[1] = 0, w = 1; w < a; w++) fe[w + 1] = fe[w] + ce[w]; - for (k = 0; k < g; k++) + 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 = L, H = b, O = z, R = 0, V = -1, U = 1 << z, G = U - 1, m === d && U > s || m === v && U > h) + 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) 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 << O, L = W; + 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; do - W -= B, p[H + (N >> R) + W] = Ae << 24 | Se << 16 | Ie | 0; + W -= B, g[H + (N >> R) + W] = Ae << 24 | Se << 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) { - if (w === $) + if (w === L) break; w = l[u + c[k]]; } if (w > z && (N & G) !== V) { - for (R === 0 && (R = z), H += L, O = w - R, P = 1 << O; O + R < $ && (P -= ce[O + R], !(P <= 0)); ) - O++, P <<= 1; - if (U += 1 << O, m === d && U > s || m === v && U > h) + 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) return 1; - V = N & G, p[V] = z << 24 | O << 16 | H - b | 0; + V = N & G, g[V] = z << 24 | F << 16 | H - b | 0; } } - return N !== 0 && (p[H + N] = w - R << 24 | 4194304 | 0), _.bits = z, 0; + return N !== 0 && (g[H + N] = w - R << 24 | 4194304 | 0), _.bits = z, 0; }; } ), @@ -39650,13 +39666,13 @@ ATOM`, b); for (var ae = K.length; --ae >= 0; ) K[ae] = 0; } - var v = 0, f = 1, y = 2, A = 3, x = 258, M = 29, m = 256, l = m + 1 + M, u = 30, g = 19, p = 2 * l + 1, b = 15, c = 16, _ = 7, E = 256, w = 16, k = 17, L = 18, $ = ( + 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 = ( /* extra bits for each length code */ [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0] ), z = ( /* extra bits for each distance code */ [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13] - ), O = ( + ), 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); @@ -39706,11 +39722,11 @@ ATOM`, b); 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); } 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, Oe = ae.stat_desc.extra_base, We = ae.stat_desc.max_length, I, we, ve, Y, de, Me, Ye = 0; + 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; 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 < p; 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 >= Oe && (de = Z[we - Oe]), 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, 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))); if (Ye !== 0) { do { for (Y = We - 1; K.bl_count[Y] === 0; ) @@ -39727,14 +39743,14 @@ ATOM`, b); for (Ce = 1; Ce <= b; Ce++) xe[Ce] = ue = ue + ge[Ce - 1] << 1; for (Z = 0; Z <= ae; Z++) { - var Oe = K[Z * 2 + 1]; - Oe !== 0 && (K[Z * 2] = Se(xe[Oe]++, Oe)); + 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 << $[xe]; K++) + 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++) @@ -39754,7 +39770,7 @@ ATOM`, b); 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, $, m + 1, l, b), te = new H(N, z, 0, u, b), ee = new H(new Array(0), O, 0, g, _); + 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; @@ -39762,15 +39778,15 @@ ATOM`, b); K.dyn_ltree[ae * 2] = 0; for (ae = 0; ae < u; ae++) K.dyn_dtree[ae * 2] = 0; - for (ae = 0; ae < g; ae++) + for (ae = 0; ae < p; ae++) K.bl_tree[ae * 2] = 0; K.dyn_ltree[E * 2] = 1, K.opt_len = K.static_len = 0, K.last_lit = K.matches = 0; } - function Fe(K) { + 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 Be(K, ae, ge, xe) { - Fe(K), oe(K, ge), oe(K, ~ge), r.arraySet(K.pending_buf, K.window, ae, ge, K.pending), K.pending += ge; + Oe(K), oe(K, ge), oe(K, ~ge), r.arraySet(K.pending_buf, K.window, ae, ge, K.pending), K.pending += ge; } function Ue(K, ae, ge, xe) { var ue = ae * 2, Ce = ge * 2; @@ -39782,16 +39798,16 @@ ATOM`, b); K.heap[ge] = xe; } function Ge(K, ae, ge) { - var xe, ue, Ce = 0, Z, Oe; + var xe, ue, Ce = 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), Oe = $[Z], Oe !== 0 && (ue -= V[Z], he(K, ue, Oe)), xe--, Z = fe(xe), Ae(K, Z, ge), Oe = z[Z], Oe !== 0 && (xe -= G[Z], he(K, xe, Oe))); + 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); } 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, Oe, We = -1, I; - for (K.heap_len = 0, K.heap_max = p, Z = 0; Z < Ce; Z++) + 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++) 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]); @@ -39810,10 +39826,10 @@ ATOM`, b); ge, 1 /*SMALLEST*/ - ), Oe = K.heap[ + ), Fe = K.heap[ 1 /*SMALLEST*/ - ], K.heap[--K.heap_max] = Z, K.heap[--K.heap_max] = Oe, ge[I * 2] = ge[Z * 2] + ge[Oe * 2], K.depth[I] = (K.depth[Z] >= K.depth[Oe] ? K.depth[Z] : K.depth[Oe]) + 1, ge[Z * 2 + 1] = ge[Oe * 2 + 1] = I, K.heap[ + ], 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[ 1 /*SMALLEST*/ ] = I++, Pe( @@ -39829,25 +39845,25 @@ ATOM`, b); ], pe(K, ae), le(ge, We, K.bl_count); } function Re(K, ae, ge) { - var xe, ue = -1, Ce, Z = ae[0 * 2 + 1], Oe = 0, We = 7, I = 4; + 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], !(++Oe < We && Ce === Z) && (Oe < I ? K.bl_tree[Ce * 2] += Oe : Ce !== 0 ? (Ce !== ue && K.bl_tree[Ce * 2]++, K.bl_tree[w * 2]++) : Oe <= 10 ? K.bl_tree[k * 2]++ : K.bl_tree[L * 2]++, Oe = 0, ue = Ce, Z === 0 ? (We = 138, I = 3) : Ce === Z ? (We = 6, I = 3) : (We = 7, I = 4)); + 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], Oe = 0, We = 7, I = 4; + 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], !(++Oe < We && Ce === Z)) { - if (Oe < I) + if (Ce = Z, Z = ae[(xe + 1) * 2 + 1], !(++Fe < We && Ce === Z)) { + if (Fe < I) do Ae(K, Ce, K.bl_tree); - while (--Oe !== 0); - else Ce !== 0 ? (Ce !== ue && (Ae(K, Ce, K.bl_tree), Oe--), Ae(K, w, K.bl_tree), he(K, Oe - 3, 2)) : Oe <= 10 ? (Ae(K, k, K.bl_tree), he(K, Oe - 3, 3)) : (Ae(K, L, K.bl_tree), he(K, Oe - 11, 7)); - Oe = 0, ue = Ce, Z === 0 ? (We = 138, I = 3) : Ce === Z ? (We = 6, I = 3) : (We = 7, I = 4); + 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); } } 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 = g - 1; ae >= 3 && K.bl_tree[R[ae] * 2 + 1] === 0; 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--) ; return K.opt_len += 3 * (ae + 1) + 5 + 5 + 4, ae; } @@ -39881,7 +39897,7 @@ ATOM`, b); } 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 && Fe(K); + 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 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; @@ -40125,13 +40141,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (var ye = v(q), me = 0; re > me; ++me) ye.setInt32(4 * me, X[me]); return f(q); } - function g(X, 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); return q; } - function p(X, q, re) { + 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; @@ -40187,7 +40203,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return q; } - function L(X, 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]; @@ -40202,33 +40218,33 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return ae; } - function $(X, q) { + function L(X, q) { return E(c(X), q); } function z(X) { return _(w(X)); } - function O(X, q, re) { - return p(c(X, A(re)), q, re); + function F(X, q, re) { + return g(c(X, A(re)), q, re); } function R(X, q) { return _(b(X, q)); } function P(X, q, re) { - return p(E(X, A(re)), q, re); + return g(E(X, A(re)), q, re); } function U(X, q, re) { return w(b(X, q), re); } function N(X, q, re) { - return p(k(X, A(re)), q, re); + return g(k(X, A(re)), q, re); } function B(X, q, re) { var ye = k(X, A(re)); return P(ye, q, x(ye)); } function W(X, q, re) { - return L(U(X, q)); + return $(U(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); @@ -40357,7 +40373,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; function Se(X, q, re, ye) { switch (X) { case 1: - return g(q); + return p(q); case 2: return y(q); case 3: @@ -40371,13 +40387,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 7: return c(l(q)); case 8: - return $(l(q)); + return L(l(q)); case 9: - return O(l(q), l(ye)[0]); + return F(l(q), l(ye)[0]); case 10: return B(M(q), l(ye)[0]); case 11: - return p(M(q), l(ye)[0]); + return g(M(q), l(ye)[0]); case 12: return N(M(q), l(ye)[0]); case 13: @@ -40401,16 +40417,16 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } 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, Oe = 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; + 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) { var gt = X.chainsPerModel[We]; for (xe && xe({ chainCount: gt, modelIndex: We }), ze = 0; gt > ze; ++ze) { - var Lt = X.groupsPerChain[I]; + 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: Lt, chainIndex: I, modelIndex: We, chainId: Pt, chainName: Et }); + Me && (Et = pe(Me.subarray(4 * I, 4 * I + 4))), ue({ groupCount: $t, chainIndex: I, modelIndex: We, chainId: Pt, chainName: Et }); } - for (ke = 0; Lt > ke; ++ke) { + for (ke = 0; $t > ke; ++ke) { var St = X.groupList[X.groupTypeList[we]], yt = St.atomNameList.length; if (Ce) { var zt = null; @@ -40433,17 +40449,17 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } ve += 1; } - if (Oe) { + if (Fe) { var Tt = St.bondAtomList; - for (K = 0, ae = St.bondOrderList.length; ae > K; ++K) Oe({ atomIndex1: ve - yt + Tt[2 * K], atomIndex2: ve - yt + Tt[2 * K + 1], bondOrder: St.bondOrderList[K] }); + 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] }); } we += 1; } I += 1; } - if (Y = de + 1, de = ve - 1, Oe && at) for (K = 0, ae = at.length; ae > K; K += 2) { - var $t = at[K], It = at[K + 1]; - ($t >= Y && de >= $t || It >= Y && de >= It) && Oe({ atomIndex1: $t, atomIndex2: It, bondOrder: Mt ? Mt[K / 2] : null }); + 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 }); } We += 1; } @@ -40456,7 +40472,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var re; return re = X instanceof Uint8Array ? Ae(X) : X, Ie(re, q); } - function Fe(X, q, re, ye) { + function Oe(X, q, re, ye) { function me() { try { var ke = Te(ze.response); @@ -40469,10 +40485,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ze.addEventListener("load", me, !0), ze.addEventListener("error", ye, !0), ze.responseType = "arraybuffer", ze.open("GET", q + X.toUpperCase()), ze.send(); } function Be(X, q, re) { - Fe(X, je, q, re); + Oe(X, je, q, re); } function Ue(X, q, re) { - Fe(X, Xe, q, re); + Oe(X, Xe, q, re); } 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; @@ -40546,16 +40562,16 @@ 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, g = 2 * m + 1, p = 15, b = 16, c = 7, _ = 256, E = 16, w = 17, k = 18, L = ( + 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, $ = ( /* 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 = ( /* 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]) - ), O = 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); + ), 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); @@ -40567,8 +40583,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; o(W); const V = new Array(l); o(V); - function G(C, j, F, J, se) { - this.static_tree = C, this.extra_bits = j, this.extra_base = F, this.elems = J, this.max_length = se, this.has_stree = C && C.length; + 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; } let H, Q, te; function ee(C, j) { @@ -40576,30 +40592,30 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } const ce = (C) => C < 256 ? N[C] : N[256 + (C >>> 7)], fe = (C, j) => { C.pending_buf[C.pending++] = j & 255, C.pending_buf[C.pending++] = j >>> 8 & 255; - }, oe = (C, j, F) => { - C.bi_valid > b - F ? (C.bi_buf |= j << C.bi_valid & 65535, fe(C, C.bi_buf), C.bi_buf = j >> b - C.bi_valid, C.bi_valid += F - b) : (C.bi_buf |= j << C.bi_valid & 65535, C.bi_valid += F); - }, he = (C, j, F) => { + }, 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( C, - F[j * 2], - F[j * 2 + 1] + O[j * 2], + O[j * 2 + 1] /*.Len*/ ); }, Ae = (C, j) => { - let F = 0; + let O = 0; do - F |= C & 1, C >>>= 1, F <<= 1; + O |= C & 1, C >>>= 1, O <<= 1; while (--j > 0); - return F >>> 1; + 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); }, Ie = (C, j) => { - const F = j.dyn_tree, J = j.max_code, se = j.stat_desc.static_tree, ie = j.stat_desc.has_stree, Le = j.stat_desc.extra_bits, Ee = j.stat_desc.extra_base, tt = j.stat_desc.max_length; - let _e, $e, pt, Je, He, it, Ct = 0; - for (Je = 0; Je <= p; Je++) + 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; + for (Je = 0; Je <= g; Je++) C.bl_count[Je] = 0; - for (F[C.heap[C.heap_max] * 2 + 1] = 0, _e = C.heap_max + 1; _e < g; _e++) - $e = C.heap[_e], Je = F[F[$e * 2 + 1] * 2 + 1] + 1, Je > tt && (Je = tt, Ct++), F[$e * 2 + 1] = Je, !($e > J) && (C.bl_count[Je]++, He = 0, $e >= Ee && (He = Le[$e - Ee]), it = F[$e * 2], C.opt_len += it * (Je + He), ie && (C.static_len += it * (se[$e * 2 + 1] + He))); + 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) { do { for (Je = tt - 1; C.bl_count[Je] === 0; ) @@ -40607,31 +40623,31 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; C.bl_count[Je]--, C.bl_count[Je + 1] += 2, C.bl_count[tt]--, Ct -= 2; } while (Ct > 0); for (Je = tt; Je !== 0; Je--) - for ($e = C.bl_count[Je]; $e !== 0; ) - pt = C.heap[--_e], !(pt > J) && (F[pt * 2 + 1] !== Je && (C.opt_len += (Je - F[pt * 2 + 1]) * F[pt * 2], F[pt * 2 + 1] = Je), $e--); - } - }, pe = (C, j, F) => { - const J = new Array(p + 1); - let se = 0, ie, Le; - for (ie = 1; ie <= p; ie++) - se = se + F[ie - 1] << 1, J[ie] = se; - for (Le = 0; Le <= j; Le++) { - let Ee = C[Le * 2 + 1]; - Ee !== 0 && (C[Le * 2] = Ae(J[Ee]++, Ee)); + 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--); + } + }, 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, F, J, se; - const ie = new Array(p + 1); - for (F = 0, J = 0; J < x - 1; J++) - for (W[J] = F, C = 0; C < 1 << L[J]; C++) - B[F++] = J; - for (B[F - 1] = J, se = 0, J = 0; J < 16; J++) - for (V[J] = se, C = 0; C < 1 << $[J]; C++) + 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 << $[J] - 7; C++) + for (V[J] = se << 7, C = 0; C < 1 << L[J] - 7; C++) N[256 + se++] = J; - for (j = 0; j <= p; j++) + for (j = 0; j <= g; j++) ie[j] = 0; for (C = 0; C <= 143; ) P[C * 2 + 1] = 8, C++, ie[8]++; @@ -40643,7 +40659,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 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, L, M + 1, m, p), Q = new G(U, $, 0, l, p), te = new G(new Array(0), z, 0, u, c); + 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) => { let j; for (j = 0; j < m; j++) @@ -40655,34 +40671,34 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 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; - }, Fe = (C, j, F, J) => { - const se = j * 2, ie = F * 2; - return C[se] < C[ie] || C[se] === C[ie] && J[j] <= J[F]; - }, Be = (C, j, F) => { - const J = C.heap[F]; - let se = F << 1; - for (; se <= C.heap_len && (se < C.heap_len && Fe(j, C.heap[se + 1], C.heap[se], C.depth) && se++, !Fe(j, J, C.heap[se], C.depth)); ) - C.heap[F] = C.heap[se], F = se, se <<= 1; - C.heap[F] = J; - }, Ue = (C, j, F) => { - let J, se, ie = 0, Le, Ee; + }, 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; 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) : (Le = B[se], he(C, Le + M + 1, j), Ee = L[Le], Ee !== 0 && (se -= W[Le], oe(C, se, Ee)), J--, Le = ce(J), he(C, Le, F), Ee = $[Le], Ee !== 0 && (J -= V[Le], oe(C, J, Ee))); + 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 F = j.dyn_tree, J = j.stat_desc.static_tree, se = j.stat_desc.has_stree, ie = j.stat_desc.elems; - let Le, Ee, tt = -1, _e; - for (C.heap_len = 0, C.heap_max = g, Le = 0; Le < ie; Le++) - F[Le * 2] !== 0 ? (C.heap[++C.heap_len] = tt = Le, C.depth[Le] = 0) : F[Le * 2 + 1] = 0; + 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; for (; C.heap_len < 2; ) - _e = C.heap[++C.heap_len] = tt < 2 ? ++tt : 0, F[_e * 2] = 1, C.depth[_e] = 0, C.opt_len--, se && (C.static_len -= J[_e * 2 + 1]); - for (j.max_code = tt, Le = C.heap_len >> 1; Le >= 1; Le--) - Be(C, F, Le); + _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; do - Le = C.heap[ + $e = C.heap[ 1 /*SMALLEST*/ ], C.heap[ @@ -40690,18 +40706,18 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /*SMALLEST*/ ] = C.heap[C.heap_len--], Be( C, - F, + O, 1 /*SMALLEST*/ ), Ee = C.heap[ 1 /*SMALLEST*/ - ], C.heap[--C.heap_max] = Le, C.heap[--C.heap_max] = Ee, F[_e * 2] = F[Le * 2] + F[Ee * 2], C.depth[_e] = (C.depth[Le] >= C.depth[Ee] ? C.depth[Le] : C.depth[Ee]) + 1, F[Le * 2 + 1] = F[Ee * 2 + 1] = _e, C.heap[ + ], 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[ 1 /*SMALLEST*/ ] = _e++, Be( C, - F, + O, 1 /*SMALLEST*/ ); @@ -40709,87 +40725,87 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; C.heap[--C.heap_max] = C.heap[ 1 /*SMALLEST*/ - ], Ie(C, j), pe(F, tt, C.bl_count); - }, Ge = (C, j, F) => { - let J, se = -1, ie, Le = j[0 * 2 + 1], Ee = 0, tt = 7, _e = 4; - for (Le === 0 && (tt = 138, _e = 3), j[(F + 1) * 2 + 1] = 65535, J = 0; J <= F; J++) - ie = Le, Le = j[(J + 1) * 2 + 1], !(++Ee < tt && ie === Le) && (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, Le === 0 ? (tt = 138, _e = 3) : ie === Le ? (tt = 6, _e = 3) : (tt = 7, _e = 4)); - }, Ne = (C, j, F) => { - let J, se = -1, ie, Le = j[0 * 2 + 1], Ee = 0, tt = 7, _e = 4; - for (Le === 0 && (tt = 138, _e = 3), J = 0; J <= F; J++) - if (ie = Le, Le = j[(J + 1) * 2 + 1], !(++Ee < tt && ie === Le)) { + ], 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) 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, Le === 0 ? (tt = 138, _e = 3) : ie === Le ? (tt = 6, _e = 3) : (tt = 7, _e = 4); + Ee = 0, se = ie, $e === 0 ? (tt = 138, _e = 3) : ie === $e ? (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[O[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), Pe(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, F, J) => { + }, De = (C, j, O, J) => { let se; - for (oe(C, j - 257, 5), oe(C, F - 1, 5), oe(C, J - 4, 4), se = 0; se < J; se++) - oe(C, C.bl_tree[O[se] * 2 + 1], 3); - Ne(C, C.dyn_ltree, j - 1), Ne(C, C.dyn_dtree, F - 1); + 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); }, je = (C) => { - let j = 4093624447, F; - for (F = 0; F <= 31; F++, j >>>= 1) - if (j & 1 && C.dyn_ltree[F * 2] !== 0) + let j = 4093624447, O; + for (O = 0; O <= 31; O++, j >>>= 1) + if (j & 1 && C.dyn_ltree[O * 2] !== 0) return a; if (C.dyn_ltree[9 * 2] !== 0 || C.dyn_ltree[10 * 2] !== 0 || C.dyn_ltree[13 * 2] !== 0) return s; - for (F = 32; F < M; F++) - if (C.dyn_ltree[F * 2] !== 0) + for (O = 32; O < M; O++) + if (C.dyn_ltree[O * 2] !== 0) return s; return a; }; 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, F, J) => { - oe(C, (d << 1) + (J ? 1 : 0), 3), Te(C), fe(C, F), fe(C, ~F), F && C.pending_buf.set(C.window.subarray(j, j + F), C.pending), C.pending += F; + }, 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, F, J) => { - let se, ie, Le = 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), Le = Re(C), se = C.opt_len + 3 + 7 >>> 3, ie = C.static_len + 3 + 7 >>> 3, ie <= se && (se = ie)) : se = ie = F + 5, F + 4 <= se && j !== -1 ? q(C, j, F, 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, Le + 1), Ue(C, C.dyn_ltree, C.dyn_dtree)), ne(C), J && Te(C); - }, me = (C, j, F) => (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++] = F, j === 0 ? C.dyn_ltree[F * 2]++ : (C.matches++, j--, C.dyn_ltree[(B[F] + M + 1) * 2]++, C.dyn_dtree[ce(j) * 2]++), C.sym_next === C.sym_end); + }, 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 = { _tr_init: ze, _tr_stored_block: ke, _tr_flush_block: K, _tr_tally: ae, _tr_align: ge - }, Ce = (C, j, F, J) => { - let se = C & 65535 | 0, ie = C >>> 16 & 65535 | 0, Le = 0; - for (; F !== 0; ) { - Le = F > 2e3 ? 2e3 : F, F -= Le; + }, Ce = (C, j, O, J) => { + let se = C & 65535 | 0, ie = C >>> 16 & 65535 | 0, $e = 0; + for (; O !== 0; ) { + $e = O > 2e3 ? 2e3 : O, O -= $e; do se = se + j[J++] | 0, ie = ie + se | 0; - while (--Le); + while (--$e); se %= 65521, ie %= 65521; } return se | ie << 16 | 0; }; const Z = () => { let C, j = []; - for (var F = 0; F < 256; F++) { - C = F; + for (var O = 0; O < 256; O++) { + C = O; for (var J = 0; J < 8; J++) C = C & 1 ? 3988292384 ^ C >>> 1 : C >>> 1; - j[F] = C; + j[O] = C; } return j; - }, Oe = new Uint32Array(Z()); - var I = (C, j, F, J) => { - const se = Oe, ie = J + F; + }, Fe = new Uint32Array(Z()); + var I = (C, j, O, J) => { + const se = Fe, ie = J + O; C ^= -1; - for (let Le = J; Le < ie; Le++) - C = C >>> 8 ^ se[(C ^ j[Le]) & 255]; + for (let $e = J; $e < ie; $e++) + C = C >>> 8 ^ se[(C ^ j[$e]) & 255]; return C ^ -1; }, we = { 2: "need dictionary", @@ -40859,7 +40875,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_OK: at, Z_STREAM_END: Mt, Z_STREAM_ERROR: gt, - Z_DATA_ERROR: Lt, + Z_DATA_ERROR: $t, Z_BUF_ERROR: Pt, Z_DEFAULT_COMPRESSION: Et, Z_FILTERED: St, @@ -40869,74 +40885,74 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFAULT_STRATEGY: be, Z_UNKNOWN: Ve, Z_DEFLATED: et - } = ve, _t = 9, kt = 15, Tt = 8, Ht = 256 + 1 + 29, Ot = 30, xr = 19, wr = 2 * Ht + 1, an = 15, ut = 3, Kt = 258, Gt = Kt + ut + 1, sn = 32, rr = 42, Fr = 57, Or = 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, 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) => { let j = C.length; for (; --j >= 0; ) C[j] = 0; }, on = (C) => { - let j, F, J, se = C.w_size; + let j, O, J, se = C.w_size; j = C.hash_size, J = j; do - F = C.head[--J], C.head[J] = F >= se ? F - se : 0; + O = C.head[--J], C.head[J] = O >= se ? O - se : 0; while (--j); j = se, J = j; do - F = C.prev[--J], C.prev[J] = F >= se ? F - se : 0; + O = C.prev[--J], C.prev[J] = O >= se ? O - se : 0; while (--j); }; - let Zt = (C, j, F) => (j << C.hash_shift ^ F) & C.hash_mask; + let Zt = (C, j, O) => (j << C.hash_shift ^ O) & C.hash_mask; const Bt = (C) => { const j = C.state; - let F = j.pending; - F > C.avail_out && (F = C.avail_out), F !== 0 && (C.output.set(j.pending_buf.subarray(j.pending_out, j.pending_out + F), C.next_out), C.next_out += F, j.pending_out += F, C.total_out += F, C.avail_out -= F, j.pending -= F, j.pending === 0 && (j.pending_out = 0)); + 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); }, vt = (C, j) => { C.pending_buf[C.pending++] = j; }, cr = (C, j) => { C.pending_buf[C.pending++] = j >>> 8 & 255, C.pending_buf[C.pending++] = j & 255; - }, Pr = (C, j, F, J) => { + }, 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), F), C.state.wrap === 1 ? C.adler = Ce(C.adler, j, se, F) : C.state.wrap === 2 && (C.adler = I(C.adler, j, se, F)), C.next_in += se, C.total_in += se, se); + 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 F = C.max_chain_length, J = C.strstart, se, ie, Le = 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, $e = C.w_mask, pt = C.prev, Je = C.strstart + Kt; - let He = _e[J + Le - 1], it = _e[J + Le]; - C.prev_length >= C.good_match && (F >>= 2), Ee > C.lookahead && (Ee = C.lookahead); + 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); do - if (se = j, !(_e[se + Le] !== it || _e[se + Le - 1] !== He || _e[se] !== _e[J] || _e[++se] !== _e[J + 1])) { + if (se = j, !(_e[se + $e] !== it || _e[se + $e - 1] !== He || _e[se] !== _e[J] || _e[++se] !== _e[J + 1])) { J += 2, se++; 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 > Le) { - if (C.match_start = j, Le = ie, ie >= Ee) + if (ie = Kt - (Je - J), J = Je - Kt, ie > $e) { + if (C.match_start = j, $e = ie, ie >= Ee) break; - He = _e[J + Le - 1], it = _e[J + Le]; + He = _e[J + $e - 1], it = _e[J + $e]; } } - while ((j = pt[j & $e]) > tt && --F !== 0); - return Le <= C.lookahead ? Le : C.lookahead; + while ((j = pt[j & Le]) > tt && --O !== 0); + return $e <= C.lookahead ? $e : C.lookahead; }, ar = (C) => { const j = C.w_size; - let F, J, se; + let O, J, se; 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) break; - if (F = Pr(C.strm, C.window, C.strstart + C.lookahead, J), C.lookahead += F, C.lookahead + C.insert >= ut) + 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)); ) ; } while (C.lookahead < Gt && C.strm.avail_in !== 0); }, Qr = (C, j) => { - let F = C.pending_buf_size - 5 > C.w_size ? C.w_size : C.pending_buf_size - 5, J, se, ie, Le = 0, Ee = C.strm.avail_in; + 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; 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 < F && (J === 0 && j !== st || j === Ke || J !== se + C.strm.avail_in))) + 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))) break; - Le = j === st && J === se + C.strm.avail_in ? 1 : 0, de(C, 0, 0, Le), 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 (Le === 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), Le ? 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, F = ie > C.w_size ? C.w_size : ie, se = C.strstart - C.block_start, (se >= F || (se || j === st) && j !== Ke && C.strm.avail_in === 0 && se <= ie) && (J = se > ie ? ie : se, Le = j === st && C.strm.avail_in === 0 && J === se ? 1 : 0, de(C, C.block_start, J, Le), C.block_start += J, Bt(C.strm)), Le ? qt : Rt); + $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 F, J; + let O, J; for (; ; ) { if (C.lookahead < Gt) { if (ar(C), C.lookahead < Gt && j === Ke) @@ -40944,11 +40960,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (C.lookahead === 0) break; } - if (F = 0, C.lookahead >= ut && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), F !== 0 && C.strstart - F <= C.w_size - Gt && (C.match_length = qr(C, F)), C.match_length >= ut) + 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) { C.match_length--; do - C.strstart++, C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart; + 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; while (--C.match_length !== 0); C.strstart++; } else @@ -40960,7 +40976,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } 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 F, J, se; + let O, J, se; for (; ; ) { if (C.lookahead < Gt) { if (ar(C), C.lookahead < Gt && j === Ke) @@ -40968,10 +40984,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (C.lookahead === 0) break; } - if (F = 0, C.lookahead >= ut && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), F = 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, F !== 0 && C.prev_length < C.max_lazy_match && C.strstart - F <= C.w_size - Gt && (C.match_length = qr(C, F), 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) { + 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; do - ++C.strstart <= se && (C.ins_h = Zt(C, C.ins_h, C.window[C.strstart + ut - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart); + ++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); 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)) return Rt; @@ -40983,8 +40999,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } 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 F, J, se, ie; - const Le = C.window; + let O, J, se, ie; + const $e = C.window; for (; ; ) { if (C.lookahead <= Kt) { if (ar(C), C.lookahead <= Kt && j === Ke) @@ -40992,32 +41008,32 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (C.lookahead === 0) break; } - if (C.match_length = 0, C.lookahead >= ut && C.strstart > 0 && (se = C.strstart - 1, J = Le[se], J === Le[++se] && J === Le[++se] && J === Le[++se])) { + 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; do ; - while (J === Le[++se] && J === Le[++se] && J === Le[++se] && J === Le[++se] && J === Le[++se] && J === Le[++se] && J === Le[++se] && J === Le[++se] && se < ie); + 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); } - if (C.match_length >= ut ? (F = Ye(C, 1, C.match_length - ut), C.lookahead -= C.match_length, C.strstart += C.match_length, C.match_length = 0) : (F = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++), F && (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 && (Nt(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) => { - let F; + let O; for (; ; ) { if (C.lookahead === 0 && (ar(C), C.lookahead === 0)) { if (j === Ke) return Rt; break; } - if (C.match_length = 0, F = Ye(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++, F && (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 && (Nt(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; }; - function Wt(C, j, F, J, se) { - this.good_length = C, this.max_lazy = j, this.nice_length = F, this.max_chain = J, this.func = se; + 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; } const ur = [ /* good lazy nice chain */ @@ -41045,152 +41061,152 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 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; }; 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 * Ot + 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; + 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; } const dr = (C) => { if (!C) return 1; const j = C.state; return !j || j.strm !== C || j.status !== rr && //#ifdef GZIP - j.status !== Fr && //#endif - j.status !== Or && j.status !== zr && j.status !== Ir && j.status !== Rr && j.status !== Yt && j.status !== or ? 1 : 0; + 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); 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 ? Fr : ( + j.wrap === 2 ? Or : ( //#endif j.wrap ? rr : Yt ), 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, F, J, se, ie) => { + }, fn = (C, j) => dr(C) || C.state.wrap !== 2 ? gt : (C.state.gzhead = j, at), ti = (C, j, O, J, se, ie) => { if (!C) return gt; - let Le = 1; - if (j === Et && (j = 6), J < 0 ? (Le = 0, J = -J) : J > 15 && (Le = 2, J -= 16), se < 1 || se > _t || F !== et || J < 8 || J > 15 || j < 0 || j > 9 || ie < 0 || ie > qe || J === 8 && Le !== 1) + 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 = Le, 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 = F, ei(C); + 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; - const F = C.state; - if (!C.output || C.avail_in !== 0 && !C.input || F.status === or && j !== st) + 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 = F.last_flush; - if (F.last_flush = j, F.pending !== 0) { + const J = O.last_flush; + if (O.last_flush = j, O.pending !== 0) { if (Bt(C), C.avail_out === 0) - return F.last_flush = -1, at; + return O.last_flush = -1, at; } else if (C.avail_in === 0 && Yr(j) <= Yr(J) && j !== st) return Qt(C, Pt); - if (F.status === or && C.avail_in !== 0) + if (O.status === or && C.avail_in !== 0) return Qt(C, Pt); - if (F.status === rr && F.wrap === 0 && (F.status = Yt), F.status === rr) { - let se = et + (F.w_bits - 8 << 4) << 8, ie = -1; - if (F.strategy >= yt || F.level < 2 ? ie = 0 : F.level < 6 ? ie = 1 : F.level === 6 ? ie = 2 : ie = 3, se |= ie << 6, F.strstart !== 0 && (se |= sn), se += 31 - se % 31, cr(F, se), F.strstart !== 0 && (cr(F, C.adler >>> 16), cr(F, C.adler & 65535)), C.adler = 1, F.status = Yt, Bt(C), F.pending !== 0) - return F.last_flush = -1, at; + 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) + return O.last_flush = -1, at; } - if (F.status === Fr) { - if (C.adler = 0, vt(F, 31), vt(F, 139), vt(F, 8), F.gzhead) + if (O.status === Or) { + if (C.adler = 0, vt(O, 31), vt(O, 139), vt(O, 8), O.gzhead) vt( - F, - (F.gzhead.text ? 1 : 0) + (F.gzhead.hcrc ? 2 : 0) + (F.gzhead.extra ? 4 : 0) + (F.gzhead.name ? 8 : 0) + (F.gzhead.comment ? 16 : 0) - ), vt(F, F.gzhead.time & 255), vt(F, F.gzhead.time >> 8 & 255), vt(F, F.gzhead.time >> 16 & 255), vt(F, F.gzhead.time >> 24 & 255), vt(F, F.level === 9 ? 2 : F.strategy >= yt || F.level < 2 ? 4 : 0), vt(F, F.gzhead.os & 255), F.gzhead.extra && F.gzhead.extra.length && (vt(F, F.gzhead.extra.length & 255), vt(F, F.gzhead.extra.length >> 8 & 255)), F.gzhead.hcrc && (C.adler = I(C.adler, F.pending_buf, F.pending, 0)), F.gzindex = 0, F.status = Or; - else if (vt(F, 0), vt(F, 0), vt(F, 0), vt(F, 0), vt(F, 0), vt(F, F.level === 9 ? 2 : F.strategy >= yt || F.level < 2 ? 4 : 0), vt(F, ln), F.status = Yt, Bt(C), F.pending !== 0) - return F.last_flush = -1, at; - } - if (F.status === Or) { - if (F.gzhead.extra) { - let se = F.pending, ie = (F.gzhead.extra.length & 65535) - F.gzindex; - for (; F.pending + ie > F.pending_buf_size; ) { - let Ee = F.pending_buf_size - F.pending; - if (F.pending_buf.set(F.gzhead.extra.subarray(F.gzindex, F.gzindex + Ee), F.pending), F.pending = F.pending_buf_size, F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)), F.gzindex += Ee, Bt(C), F.pending !== 0) - return F.last_flush = -1, at; + 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) + return O.last_flush = -1, at; + } + if (O.status === Fr) { + 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) + return O.last_flush = -1, at; se = 0, ie -= Ee; } - let Le = new Uint8Array(F.gzhead.extra); - F.pending_buf.set(Le.subarray(F.gzindex, F.gzindex + ie), F.pending), F.pending += ie, F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)), F.gzindex = 0; + 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; } - F.status = zr; + O.status = zr; } - if (F.status === zr) { - if (F.gzhead.name) { - let se = F.pending, ie; + if (O.status === zr) { + if (O.gzhead.name) { + let se = O.pending, ie; do { - if (F.pending === F.pending_buf_size) { - if (F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)), Bt(C), F.pending !== 0) - return F.last_flush = -1, at; + 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) + return O.last_flush = -1, at; se = 0; } - F.gzindex < F.gzhead.name.length ? ie = F.gzhead.name.charCodeAt(F.gzindex++) & 255 : ie = 0, vt(F, ie); + O.gzindex < O.gzhead.name.length ? ie = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : ie = 0, vt(O, ie); } while (ie !== 0); - F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)), F.gzindex = 0; + O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)), O.gzindex = 0; } - F.status = Ir; + O.status = Ir; } - if (F.status === Ir) { - if (F.gzhead.comment) { - let se = F.pending, ie; + if (O.status === Ir) { + if (O.gzhead.comment) { + let se = O.pending, ie; do { - if (F.pending === F.pending_buf_size) { - if (F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)), Bt(C), F.pending !== 0) - return F.last_flush = -1, at; + 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) + return O.last_flush = -1, at; se = 0; } - F.gzindex < F.gzhead.comment.length ? ie = F.gzhead.comment.charCodeAt(F.gzindex++) & 255 : ie = 0, vt(F, ie); + O.gzindex < O.gzhead.comment.length ? ie = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : ie = 0, vt(O, ie); } while (ie !== 0); - F.gzhead.hcrc && F.pending > se && (C.adler = I(C.adler, F.pending_buf, F.pending - se, se)); + O.gzhead.hcrc && O.pending > se && (C.adler = I(C.adler, O.pending_buf, O.pending - se, se)); } - F.status = Rr; + O.status = Rr; } - if (F.status === Rr) { - if (F.gzhead.hcrc) { - if (F.pending + 2 > F.pending_buf_size && (Bt(C), F.pending !== 0)) - return F.last_flush = -1, at; - vt(F, C.adler & 255), vt(F, C.adler >> 8 & 255), C.adler = 0; + if (O.status === Rr) { + if (O.gzhead.hcrc) { + if (O.pending + 2 > O.pending_buf_size && (Bt(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 (F.status = Yt, Bt(C), F.pending !== 0) - return F.last_flush = -1, at; + if (O.status = Yt, Bt(C), O.pending !== 0) + return O.last_flush = -1, at; } - if (C.avail_in !== 0 || F.lookahead !== 0 || j !== Ke && F.status !== or) { - let se = F.level === 0 ? Qr(F, j) : F.strategy === yt ? cn(F, j) : F.strategy === zt ? hn(F, j) : ur[F.level].func(F, j); - if ((se === qt || se === nr) && (F.status = or), se === Rt || se === qt) - return C.avail_out === 0 && (F.last_flush = -1), at; - if (se === ir && (j === rt ? Ze(F) : j !== ot && (de(F, 0, 0, !1), j === wt && (Xt(F.head), F.lookahead === 0 && (F.strstart = 0, F.block_start = 0, F.insert = 0))), Bt(C), C.avail_out === 0)) - return F.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) + 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)) + return O.last_flush = -1, at; } - return j !== st ? at : F.wrap <= 0 ? Mt : (F.wrap === 2 ? (vt(F, C.adler & 255), vt(F, C.adler >> 8 & 255), vt(F, C.adler >> 16 & 255), vt(F, C.adler >> 24 & 255), vt(F, C.total_in & 255), vt(F, C.total_in >> 8 & 255), vt(F, C.total_in >> 16 & 255), vt(F, C.total_in >> 24 & 255)) : (cr(F, C.adler >>> 16), cr(F, C.adler & 65535)), Bt(C), F.wrap > 0 && (F.wrap = -F.wrap), F.pending !== 0 ? at : Mt); + 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 gt; const j = C.state.status; - return C.state = null, j === Yt ? Qt(C, Lt) : at; + return C.state = null, j === Yt ? Qt(C, $t) : at; }, _n = (C, j) => { - let F = j.length; + let O = j.length; if (dr(C)) return gt; const J = C.state, se = J.wrap; if (se === 2 || se === 1 && J.status !== rr || J.lookahead) return gt; - if (se === 1 && (C.adler = Ce(C.adler, j, F, 0)), J.wrap = 0, F >= J.w_size) { + 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(F - J.w_size, F), 0), j = tt, F = J.w_size; + tt.set(j.subarray(O - J.w_size, O), 0), j = tt, O = J.w_size; } - const ie = C.avail_in, Le = C.next_in, Ee = C.input; - for (C.avail_in = F, C.next_in = 0, C.input = j, ar(J); J.lookahead >= ut; ) { + 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); 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++; while (--_e); J.strstart = tt, J.lookahead = ut - 1, ar(J); } - 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 = Le, C.input = Ee, C.avail_in = ie, J.wrap = se, at; + 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; }; 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, @@ -41207,12 +41223,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Cn = function(C) { const j = Array.prototype.slice.call(arguments, 1); for (; j.length; ) { - const F = j.shift(); - if (F) { - if (typeof F != "object") - throw new TypeError(F + "must be non-object"); - for (const J in F) - Dn(F, J) && (C[J] = F[J]); + 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]); } } return C; @@ -41220,12 +41236,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; let j = 0; for (let J = 0, se = C.length; J < se; J++) j += C[J].length; - const F = new Uint8Array(j); + const O = new Uint8Array(j); for (let J = 0, se = 0, ie = C.length; J < ie; J++) { - let Le = C[J]; - F.set(Le, se), se += Le.length; + let $e = C[J]; + O.set($e, se), se += $e.length; } - return F; + return O; }, Er = { assign: Cn, flattenChunks: Tn @@ -41243,62 +41259,62 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var kn = (C) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) return new TextEncoder().encode(C); - let j, F, J, se, ie, Le = C.length, Ee = 0; - for (se = 0; se < Le; se++) - F = C.charCodeAt(se), (F & 64512) === 55296 && se + 1 < Le && (J = C.charCodeAt(se + 1), (J & 64512) === 56320 && (F = 65536 + (F - 55296 << 10) + (J - 56320), se++)), Ee += F < 128 ? 1 : F < 2048 ? 2 : F < 65536 ? 3 : 4; + 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++) - F = C.charCodeAt(se), (F & 64512) === 55296 && se + 1 < Le && (J = C.charCodeAt(se + 1), (J & 64512) === 56320 && (F = 65536 + (F - 55296 << 10) + (J - 56320), se++)), F < 128 ? j[ie++] = F : F < 2048 ? (j[ie++] = 192 | F >>> 6, j[ie++] = 128 | F & 63) : F < 65536 ? (j[ie++] = 224 | F >>> 12, j[ie++] = 128 | F >>> 6 & 63, j[ie++] = 128 | F & 63) : (j[ie++] = 240 | F >>> 18, j[ie++] = 128 | F >>> 12 & 63, j[ie++] = 128 | F >>> 6 & 63, j[ie++] = 128 | F & 63); + 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); return j; }; - const Ln = (C, j) => { + const $n = (C, j) => { if (j < 65534 && C.subarray && ri) return String.fromCharCode.apply(null, C.length === j ? C : C.subarray(0, j)); - let F = ""; + let O = ""; for (let J = 0; J < j; J++) - F += String.fromCharCode(C[J]); - return F; + O += String.fromCharCode(C[J]); + return O; }; - var $n = (C, j) => { - const F = j || C.length; + var Ln = (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(F * 2); - for (se = 0, J = 0; J < F; ) { - let Le = C[J++]; - if (Le < 128) { - ie[se++] = Le; + const ie = new Array(O * 2); + for (se = 0, J = 0; J < O; ) { + let $e = C[J++]; + if ($e < 128) { + ie[se++] = $e; continue; } - let Ee = mr[Le]; + let Ee = mr[$e]; if (Ee > 4) { ie[se++] = 65533, J += Ee - 1; continue; } - for (Le &= Ee === 2 ? 31 : Ee === 3 ? 15 : 7; Ee > 1 && J < F; ) - Le = Le << 6 | C[J++] & 63, Ee--; + 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; continue; } - Le < 65536 ? ie[se++] = Le : (Le -= 65536, ie[se++] = 55296 | Le >> 10 & 1023, ie[se++] = 56320 | Le & 1023); + $e < 65536 ? ie[se++] = $e : ($e -= 65536, ie[se++] = 55296 | $e >> 10 & 1023, ie[se++] = 56320 | $e & 1023); } - return Ln(ie, se); - }, Fn = (C, j) => { + return $n(ie, se); + }, On = (C, j) => { j = j || C.length, j > C.length && (j = C.length); - let F = j - 1; - for (; F >= 0 && (C[F] & 192) === 128; ) - F--; - return F < 0 || F === 0 ? j : F + mr[C[F]] > j ? F : j; + 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: $n, - utf8border: Fn + buf2string: Ln, + utf8border: On }; - function On() { + function Fn() { 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 = On; + var ii = Fn; const ni = Object.prototype.toString, { Z_NO_FLUSH: zn, Z_SYNC_FLUSH: In, @@ -41321,7 +41337,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, 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 F = fr.deflateInit2( + let O = fr.deflateInit2( this.strm, j.level, j.method, @@ -41329,36 +41345,36 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; j.memLevel, j.strategy ); - if (F !== Sr) - throw new Error(we[F]); + 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, F = fr.deflateSetDictionary(this.strm, J), F !== Sr) - throw new Error(we[F]); + 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]); this._dict_set = !0; } } gr.prototype.push = function(C, j) { - const F = this.strm, J = this.options.chunkSize; + const O = this.strm, J = this.options.chunkSize; let se, ie; if (this.ended) return !1; - for (j === ~~j ? ie = j : ie = j === !0 ? Pn : zn, typeof C == "string" ? F.input = pr.string2buf(C) : ni.call(C) === "[object ArrayBuffer]" ? F.input = new Uint8Array(C) : F.input = C, F.next_in = 0, F.avail_in = F.input.length; ; ) { - if (F.avail_out === 0 && (F.output = new Uint8Array(J), F.next_out = 0, F.avail_out = J), (ie === In || ie === Rn) && F.avail_out <= 6) { - this.onData(F.output.subarray(0, F.next_out)), F.avail_out = 0; + 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) { + this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } - if (se = fr.deflate(F, ie), se === Bn) - return F.next_out > 0 && this.onData(F.output.subarray(0, F.next_out)), se = fr.deflateEnd(this.strm), this.onEnd(se), this.ended = !0, se === Sr; - if (F.avail_out === 0) { - this.onData(F.output); + 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 (O.avail_out === 0) { + this.onData(O.output); continue; } - if (ie > 0 && F.next_out > 0) { - this.onData(F.output.subarray(0, F.next_out)), F.avail_out = 0; + if (ie > 0 && O.next_out > 0) { + this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; } - if (F.avail_in === 0) break; + if (O.avail_in === 0) break; } return !0; }, gr.prototype.onData = function(C) { @@ -41367,10 +41383,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; C === Sr && (this.result = Er.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg; }; function Nr(C, j) { - const F = new gr(j); - if (F.push(C, !0), F.err) - throw F.msg || we[F.err]; - return F.result; + const O = new gr(j); + if (O.push(C, !0), O.err) + throw O.msg || we[O.err]; + return O.result; } function Wn(C, j) { return j = j || {}, j.raw = !0, Nr(C, j); @@ -41386,10 +41402,10 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; constants: Zn }; const Ar = 16209, qn = 16191; - var Qn = function(j, F) { - let J, se, ie, Le, Ee, tt, _e, $e, pt, Je, He, it, Ct, ft, ht, xt, ct, Qe, bt, Ft, nt, At, mt, lt; + 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 dt = j.state; - J = j.next_in, mt = j.input, se = J + (j.avail_in - 5), ie = j.next_out, lt = j.output, Le = ie - (F - j.avail_out), Ee = ie + (j.avail_out - 257), tt = dt.dmax, _e = dt.wsize, $e = 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; + 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; e: do { it < 15 && (He += mt[J++] << it, it += 8, He += mt[J++] << it, it += 8), ct = Ct[He & ht]; @@ -41402,12 +41418,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; r: for (; ; ) { if (Qe = ct >>> 24, He >>>= Qe, it -= Qe, Qe = ct >>> 16 & 255, Qe & 16) { - if (Ft = ct & 65535, Qe &= 15, it < Qe && (He += mt[J++] << it, it += 8, it < Qe && (He += mt[J++] << it, it += 8)), Ft += He & (1 << Qe) - 1, Ft > tt) { + 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; break e; } - if (He >>>= Qe, it -= Qe, Qe = ie - Le, Ft > Qe) { - if (Qe = Ft - Qe, Qe > $e && dt.sane) { + 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; break e; } @@ -41417,7 +41433,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do lt[ie++] = Je[nt++]; while (--Qe); - nt = ie - Ft, At = lt; + nt = ie - Ot, At = lt; } } else if (pt < Qe) { if (nt += _e + pt - Qe, Qe -= pt, Qe < bt) { @@ -41430,7 +41446,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do lt[ie++] = Je[nt++]; while (--Qe); - nt = ie - Ft, At = lt; + nt = ie - Ot, At = lt; } } } else if (nt += pt - Qe, Qe < bt) { @@ -41438,13 +41454,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do lt[ie++] = Je[nt++]; while (--Qe); - nt = ie - Ft, At = lt; + nt = ie - Ot, 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++])); } else { - nt = ie - Ft; + nt = ie - Ot; do lt[ie++] = lt[nt++], lt[ie++] = lt[nt++], lt[ie++] = lt[nt++], bt -= 3; while (bt > 2); @@ -41611,15 +41627,15 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 64, 64 ]); - var _r = (C, j, F, J, se, ie, Le, Ee) => { + var _r = (C, j, O, J, se, ie, $e, Ee) => { const tt = Ee.bits; - let _e = 0, $e = 0, pt = 0, Je = 0, He = 0, it = 0, Ct = 0, ft = 0, ht = 0, xt = 0, ct, Qe, bt, Ft, nt, At = null, mt; + 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, Lr, $r; + let tr = null, nn, $r, Lr; for (_e = 0; _e <= lr; _e++) lt[_e] = 0; - for ($e = 0; $e < J; $e++) - lt[j[F + $e]]++; + for (Le = 0; Le < J; Le++) + lt[j[O + Le]]++; for (He = tt, Je = lr; Je >= 1 && lt[Je] === 0; Je--) ; if (He > Je && (He = Je), Je === 0) @@ -41633,28 +41649,28 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return -1; for (dt[1] = 0, _e = 1; _e < lr; _e++) dt[_e + 1] = dt[_e] + lt[_e]; - for ($e = 0; $e < J; $e++) - j[F + $e] !== 0 && (Le[dt[j[F + $e]]++] = $e); - if (C === li ? (At = tr = Le, mt = 20) : C === Ur ? (At = Jn, tr = ea, mt = 257) : (At = ta, tr = ra, mt = 0), xt = 0, $e = 0, _e = pt, nt = ie, it = He, Ct = 0, bt = -1, ht = 1 << He, Ft = ht - 1, C === Ur && ht > ai || C === oi && ht > si) + 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) return 1; for (; ; ) { - nn = _e - Ct, Le[$e] + 1 < mt ? (Lr = 0, $r = Le[$e]) : Le[$e] >= mt ? (Lr = tr[Le[$e] - mt], $r = At[Le[$e] - mt]) : (Lr = 96, $r = 0), ct = 1 << _e - Ct, Qe = 1 << it, pt = Qe; + 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; do - Qe -= ct, se[nt + (xt >> Ct) + Qe] = nn << 24 | Lr << 16 | $r | 0; + Qe -= ct, se[nt + (xt >> Ct) + Qe] = nn << 24 | $r << 16 | Lr | 0; while (Qe !== 0); for (ct = 1 << _e - 1; xt & ct; ) ct >>= 1; - if (ct !== 0 ? (xt &= ct - 1, xt += ct) : xt = 0, $e++, --lt[_e] === 0) { + if (ct !== 0 ? (xt &= ct - 1, xt += ct) : xt = 0, Le++, --lt[_e] === 0) { if (_e === Je) break; - _e = j[F + Le[$e]]; + _e = j[O + $e[Le]]; } - if (_e > He && (xt & Ft) !== bt) { + 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)); ) it++, ft <<= 1; if (ht += 1 << it, C === Ur && ht > ai || C === oi && ht > si) return 1; - bt = xt & Ft, se[bt] = He << 24 | it << 16 | nt - ie | 0; + bt = xt & Ot, se[bt] = He << 24 | it << 16 | nt - ie | 0; } } return xt !== 0 && (se[nt + xt] = _e - Ct << 24 | 64 << 16 | 0), Ee.bits = He, 0; @@ -41671,7 +41687,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 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, Li = 16202, $i = 16203, Fi = 16204, Oi = 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); + } = 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() { 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; } @@ -41691,16 +41707,16 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; const j = C.state; return j.wsize = 0, j.whave = 0, j.wnext = 0, Ni(C); }, Gi = (C, j) => { - let F; + let O; if (er(C)) return Ut; const J = C.state; - return j < 0 ? (F = 0, j = -j) : (F = (j >> 4) + 5, j < 48 && (j &= 15)), j && (j < 8 || j > 15) ? Ut : (J.window !== null && J.wbits !== j && (J.window = null), J.wrap = F, J.wbits = j, Ui(C)); + 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 (!C) return Ut; - const F = new ua(); - C.state = F, F.strm = C, F.window = null, F.mode = Dr; + 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); @@ -41722,12 +41738,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; _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, F, J) => { + }, 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(F - ie.wsize, F), 0), ie.wnext = 0, ie.whave = ie.wsize) : (se = ie.wsize - ie.wnext, se > J && (se = J), ie.window.set(j.subarray(F - J, F - J + se), ie.wnext), J -= se, J ? (ie.window.set(j.subarray(F - J, F), 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; + 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 F, J, se, ie, Le, Ee, tt, _e, $e, pt, Je, He, it, Ct, ft = 0, ht, xt, ct, Qe, bt, Ft, nt, At; + 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; const mt = new Uint8Array(4); let lt, dt; const tr = ( @@ -41736,80 +41752,80 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ); if (er(C) || !C.output || !C.input && C.avail_in !== 0) return Ut; - F = C.state, F.mode === Vt && (F.mode = Gr), Le = C.next_out, se = C.output, tt = C.avail_out, ie = C.next_in, J = C.input, Ee = C.avail_in, _e = F.hold, $e = F.bits, pt = Ee, Je = tt, At = Jt; + 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; e: for (; ; ) - switch (F.mode) { + switch (O.mode) { case Dr: - if (F.wrap === 0) { - F.mode = Gr; + if (O.wrap === 0) { + O.mode = Gr; break; } - for (; $e < 16; ) { + for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (F.wrap & 2 && _e === 35615) { - F.wbits === 0 && (F.wbits = 15), F.check = 0, mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, F.check = I(F.check, mt, 2, 0), _e = 0, $e = 0, F.mode = pi; + 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; break; } - if (F.head && (F.head.done = !1), !(F.wrap & 1) || /* check if zlib header allowed */ + 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", F.mode = Dt; + C.msg = "incorrect header check", O.mode = Dt; break; } if ((_e & 15) !== mi) { - C.msg = "unknown compression method", F.mode = Dt; + C.msg = "unknown compression method", O.mode = Dt; break; } - if (_e >>>= 4, $e -= 4, nt = (_e & 15) + 8, F.wbits === 0 && (F.wbits = nt), nt > 15 || nt > F.wbits) { - C.msg = "invalid window size", F.mode = Dt; + 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; break; } - F.dmax = 1 << F.wbits, F.flags = 0, C.adler = F.check = 1, F.mode = _e & 512 ? Si : Vt, _e = 0, $e = 0; + O.dmax = 1 << O.wbits, O.flags = 0, C.adler = O.check = 1, O.mode = _e & 512 ? Si : Vt, _e = 0, Le = 0; break; case pi: - for (; $e < 16; ) { + for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (F.flags = _e, (F.flags & 255) !== mi) { - C.msg = "unknown compression method", F.mode = Dt; + if (O.flags = _e, (O.flags & 255) !== mi) { + C.msg = "unknown compression method", O.mode = Dt; break; } - if (F.flags & 57344) { - C.msg = "unknown header flags set", F.mode = Dt; + if (O.flags & 57344) { + C.msg = "unknown header flags set", O.mode = Dt; break; } - F.head && (F.head.text = _e >> 8 & 1), F.flags & 512 && F.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, F.check = I(F.check, mt, 2, 0)), _e = 0, $e = 0, F.mode = gi; + 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 (; $e < 32; ) { + for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.head && (F.head.time = _e), F.flags & 512 && F.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, mt[2] = _e >>> 16 & 255, mt[3] = _e >>> 24 & 255, F.check = I(F.check, mt, 4, 0)), _e = 0, $e = 0, F.mode = vi; + 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 (; $e < 16; ) { + for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.head && (F.head.xflags = _e & 255, F.head.os = _e >> 8), F.flags & 512 && F.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, F.check = I(F.check, mt, 2, 0)), _e = 0, $e = 0, F.mode = 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 = I(O.check, mt, 2, 0)), _e = 0, Le = 0, O.mode = bi; case bi: - if (F.flags & 1024) { - for (; $e < 16; ) { + if (O.flags & 1024) { + for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.length = _e, F.head && (F.head.extra_len = _e), F.flags & 512 && F.wrap & 4 && (mt[0] = _e & 255, mt[1] = _e >>> 8 & 255, F.check = I(F.check, mt, 2, 0)), _e = 0, $e = 0; - } else F.head && (F.head.extra = null); - F.mode = yi; + 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; + } else O.head && (O.head.extra = null); + O.mode = yi; case yi: - if (F.flags & 1024 && (He = F.length, He > Ee && (He = Ee), He && (F.head && (nt = F.head.extra_len - F.length, F.head.extra || (F.head.extra = new Uint8Array(F.head.extra_len)), F.head.extra.set( + 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, // extra field is limited to 65536 bytes @@ -41818,327 +41834,327 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ), /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ nt - )), F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, J, He, ie)), Ee -= He, ie += He, F.length -= He), F.length)) + )), O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, O.length -= He), O.length)) break e; - F.length = 0, F.mode = xi; + O.length = 0, O.mode = xi; case xi: - if (F.flags & 2048) { + if (O.flags & 2048) { if (Ee === 0) break e; He = 0; do - nt = J[ie + He++], F.head && nt && F.length < 65536 && (F.head.name += String.fromCharCode(nt)); + nt = J[ie + He++], O.head && nt && O.length < 65536 && (O.head.name += String.fromCharCode(nt)); while (nt && He < Ee); - if (F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, J, He, ie)), Ee -= He, ie += He, nt) + if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, nt) break e; - } else F.head && (F.head.name = null); - F.length = 0, F.mode = wi; + } else O.head && (O.head.name = null); + O.length = 0, O.mode = wi; case wi: - if (F.flags & 4096) { + if (O.flags & 4096) { if (Ee === 0) break e; He = 0; do - nt = J[ie + He++], F.head && nt && F.length < 65536 && (F.head.comment += String.fromCharCode(nt)); + nt = J[ie + He++], O.head && nt && O.length < 65536 && (O.head.comment += String.fromCharCode(nt)); while (nt && He < Ee); - if (F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, J, He, ie)), Ee -= He, ie += He, nt) + if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, He, ie)), Ee -= He, ie += He, nt) break e; - } else F.head && (F.head.comment = null); - F.mode = Ei; + } else O.head && (O.head.comment = null); + O.mode = Ei; case Ei: - if (F.flags & 512) { - for (; $e < 16; ) { + if (O.flags & 512) { + for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (F.wrap & 4 && _e !== (F.check & 65535)) { - C.msg = "header crc mismatch", F.mode = Dt; + if (O.wrap & 4 && _e !== (O.check & 65535)) { + C.msg = "header crc mismatch", O.mode = Dt; break; } - _e = 0, $e = 0; + _e = 0, Le = 0; } - F.head && (F.head.hcrc = F.flags >> 9 & 1, F.head.done = !0), C.adler = F.check = 0, F.mode = Vt; + O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), C.adler = O.check = 0, O.mode = Vt; break; case Si: - for (; $e < 32; ) { + for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - C.adler = F.check = Bi(_e), _e = 0, $e = 0, F.mode = Cr; + C.adler = O.check = Bi(_e), _e = 0, Le = 0, O.mode = Cr; case Cr: - if (F.havedict === 0) - return C.next_out = Le, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, F.hold = _e, F.bits = $e, sa; - C.adler = F.check = 1, F.mode = Vt; + 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) break e; case Gr: - if (F.last) { - _e >>>= $e & 7, $e -= $e & 7, F.mode = Hr; + if (O.last) { + _e >>>= Le & 7, Le -= Le & 7, O.mode = Hr; break; } - for (; $e < 3; ) { + for (; Le < 3; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - switch (F.last = _e & 1, _e >>>= 1, $e -= 1, _e & 3) { + switch (O.last = _e & 1, _e >>>= 1, Le -= 1, _e & 3) { case 0: - F.mode = Ai; + O.mode = Ai; break; case 1: - if (fa(F), F.mode = Tr, j === Mr) { - _e >>>= 2, $e -= 2; + if (fa(O), O.mode = Tr, j === Mr) { + _e >>>= 2, Le -= 2; break e; } break; case 2: - F.mode = Di; + O.mode = Di; break; case 3: - C.msg = "invalid block type", F.mode = Dt; + C.msg = "invalid block type", O.mode = Dt; } - _e >>>= 2, $e -= 2; + _e >>>= 2, Le -= 2; break; case Ai: - for (_e >>>= $e & 7, $e -= $e & 7; $e < 32; ) { + for (_e >>>= Le & 7, Le -= Le & 7; Le < 32; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } if ((_e & 65535) !== (_e >>> 16 ^ 65535)) { - C.msg = "invalid stored block lengths", F.mode = Dt; + C.msg = "invalid stored block lengths", O.mode = Dt; break; } - if (F.length = _e & 65535, _e = 0, $e = 0, F.mode = Wr, j === Mr) + if (O.length = _e & 65535, _e = 0, Le = 0, O.mode = Wr, j === Mr) break e; case Wr: - F.mode = Mi; + O.mode = Mi; case Mi: - if (He = F.length, He) { + if (He = O.length, He) { if (He > Ee && (He = Ee), He > tt && (He = tt), He === 0) break e; - se.set(J.subarray(ie, ie + He), Le), Ee -= He, ie += He, tt -= He, Le += He, F.length -= He; + se.set(J.subarray(ie, ie + He), $e), Ee -= He, ie += He, tt -= He, $e += He, O.length -= He; break; } - F.mode = Vt; + O.mode = Vt; break; case Di: - for (; $e < 14; ) { + for (; Le < 14; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (F.nlen = (_e & 31) + 257, _e >>>= 5, $e -= 5, F.ndist = (_e & 31) + 1, _e >>>= 5, $e -= 5, F.ncode = (_e & 15) + 4, _e >>>= 4, $e -= 4, F.nlen > 286 || F.ndist > 30) { - C.msg = "too many length or distance symbols", F.mode = Dt; + 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; break; } - F.have = 0, F.mode = Ci; + O.have = 0, O.mode = Ci; case Ci: - for (; F.have < F.ncode; ) { - for (; $e < 3; ) { + for (; O.have < O.ncode; ) { + for (; Le < 3; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.lens[tr[F.have++]] = _e & 7, _e >>>= 3, $e -= 3; + O.lens[tr[O.have++]] = _e & 7, _e >>>= 3, Le -= 3; } - for (; F.have < 19; ) - F.lens[tr[F.have++]] = 0; - if (F.lencode = F.lendyn, F.lenbits = 7, lt = { bits: F.lenbits }, At = _r(ia, F.lens, 0, 19, F.lencode, 0, F.work, lt), F.lenbits = lt.bits, At) { - C.msg = "invalid code lengths set", F.mode = Dt; + 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; break; } - F.have = 0, F.mode = Ti; + O.have = 0, O.mode = Ti; case Ti: - for (; F.have < F.nlen + F.ndist; ) { - for (; ft = F.lencode[_e & (1 << F.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= $e); ) { + 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) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } if (ct < 16) - _e >>>= ht, $e -= ht, F.lens[F.have++] = ct; + _e >>>= ht, Le -= ht, O.lens[O.have++] = ct; else { if (ct === 16) { - for (dt = ht + 2; $e < dt; ) { + for (dt = ht + 2; Le < dt; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (_e >>>= ht, $e -= ht, F.have === 0) { - C.msg = "invalid bit length repeat", F.mode = Dt; + if (_e >>>= ht, Le -= ht, O.have === 0) { + C.msg = "invalid bit length repeat", O.mode = Dt; break; } - nt = F.lens[F.have - 1], He = 3 + (_e & 3), _e >>>= 2, $e -= 2; + nt = O.lens[O.have - 1], He = 3 + (_e & 3), _e >>>= 2, Le -= 2; } else if (ct === 17) { - for (dt = ht + 3; $e < dt; ) { + for (dt = ht + 3; Le < dt; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - _e >>>= ht, $e -= ht, nt = 0, He = 3 + (_e & 7), _e >>>= 3, $e -= 3; + _e >>>= ht, Le -= ht, nt = 0, He = 3 + (_e & 7), _e >>>= 3, Le -= 3; } else { - for (dt = ht + 7; $e < dt; ) { + for (dt = ht + 7; Le < dt; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - _e >>>= ht, $e -= ht, nt = 0, He = 11 + (_e & 127), _e >>>= 7, $e -= 7; + _e >>>= ht, Le -= ht, nt = 0, He = 11 + (_e & 127), _e >>>= 7, Le -= 7; } - if (F.have + He > F.nlen + F.ndist) { - C.msg = "invalid bit length repeat", F.mode = Dt; + if (O.have + He > O.nlen + O.ndist) { + C.msg = "invalid bit length repeat", O.mode = Dt; break; } for (; He--; ) - F.lens[F.have++] = nt; + O.lens[O.have++] = nt; } } - if (F.mode === Dt) + if (O.mode === Dt) break; - if (F.lens[256] === 0) { - C.msg = "invalid code -- missing end-of-block", F.mode = Dt; + if (O.lens[256] === 0) { + C.msg = "invalid code -- missing end-of-block", O.mode = Dt; break; } - if (F.lenbits = 9, lt = { bits: F.lenbits }, At = _r(hi, F.lens, 0, F.nlen, F.lencode, 0, F.work, lt), F.lenbits = lt.bits, At) { - C.msg = "invalid literal/lengths set", F.mode = Dt; + 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; break; } - if (F.distbits = 6, F.distcode = F.distdyn, lt = { bits: F.distbits }, At = _r(ci, F.lens, F.nlen, F.ndist, F.distcode, 0, F.work, lt), F.distbits = lt.bits, At) { - C.msg = "invalid distances set", F.mode = Dt; + 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; break; } - if (F.mode = Tr, j === Mr) + if (O.mode = Tr, j === Mr) break e; case Tr: - F.mode = kr; + O.mode = kr; case kr: if (Ee >= 6 && tt >= 258) { - C.next_out = Le, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, F.hold = _e, F.bits = $e, Qn(C, Je), Le = C.next_out, se = C.output, tt = C.avail_out, ie = C.next_in, J = C.input, Ee = C.avail_in, _e = F.hold, $e = F.bits, F.mode === Vt && (F.back = -1); + 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); break; } - for (F.back = 0; ft = F.lencode[_e & (1 << F.lenbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= $e); ) { + 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) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } if (xt && !(xt & 240)) { - for (Qe = ht, bt = xt, Ft = ct; ft = F.lencode[Ft + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= $e); ) { + 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) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - _e >>>= Qe, $e -= Qe, F.back += Qe; + _e >>>= Qe, Le -= Qe, O.back += Qe; } - if (_e >>>= ht, $e -= ht, F.back += ht, F.length = ct, xt === 0) { - F.mode = Oi; + if (_e >>>= ht, Le -= ht, O.back += ht, O.length = ct, xt === 0) { + O.mode = Fi; break; } if (xt & 32) { - F.back = -1, F.mode = Vt; + O.back = -1, O.mode = Vt; break; } if (xt & 64) { - C.msg = "invalid literal/length code", F.mode = Dt; + C.msg = "invalid literal/length code", O.mode = Dt; break; } - F.extra = xt & 15, F.mode = ki; + O.extra = xt & 15, O.mode = ki; case ki: - if (F.extra) { - for (dt = F.extra; $e < dt; ) { + if (O.extra) { + for (dt = O.extra; Le < dt; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.length += _e & (1 << F.extra) - 1, _e >>>= F.extra, $e -= F.extra, F.back += F.extra; + O.length += _e & (1 << O.extra) - 1, _e >>>= O.extra, Le -= O.extra, O.back += O.extra; } - F.was = F.length, F.mode = Li; - case Li: - for (; ft = F.distcode[_e & (1 << F.distbits) - 1], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(ht <= $e); ) { + 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) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } if (!(xt & 240)) { - for (Qe = ht, bt = xt, Ft = ct; ft = F.distcode[Ft + ((_e & (1 << Qe + bt) - 1) >> Qe)], ht = ft >>> 24, xt = ft >>> 16 & 255, ct = ft & 65535, !(Qe + ht <= $e); ) { + 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) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - _e >>>= Qe, $e -= Qe, F.back += Qe; + _e >>>= Qe, Le -= Qe, O.back += Qe; } - if (_e >>>= ht, $e -= ht, F.back += ht, xt & 64) { - C.msg = "invalid distance code", F.mode = Dt; + if (_e >>>= ht, Le -= ht, O.back += ht, xt & 64) { + C.msg = "invalid distance code", O.mode = Dt; break; } - F.offset = ct, F.extra = xt & 15, F.mode = $i; - case $i: - if (F.extra) { - for (dt = F.extra; $e < dt; ) { + O.offset = ct, O.extra = xt & 15, O.mode = Li; + case Li: + if (O.extra) { + for (dt = O.extra; Le < dt; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - F.offset += _e & (1 << F.extra) - 1, _e >>>= F.extra, $e -= F.extra, F.back += F.extra; + O.offset += _e & (1 << O.extra) - 1, _e >>>= O.extra, Le -= O.extra, O.back += O.extra; } - if (F.offset > F.dmax) { - C.msg = "invalid distance too far back", F.mode = Dt; + if (O.offset > O.dmax) { + C.msg = "invalid distance too far back", O.mode = Dt; break; } - F.mode = Fi; - case Fi: + O.mode = Oi; + case Oi: if (tt === 0) break e; - if (He = Je - tt, F.offset > He) { - if (He = F.offset - He, He > F.whave && F.sane) { - C.msg = "invalid distance too far back", F.mode = Dt; + 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; break; } - He > F.wnext ? (He -= F.wnext, it = F.wsize - He) : it = F.wnext - He, He > F.length && (He = F.length), Ct = F.window; + He > O.wnext ? (He -= O.wnext, it = O.wsize - He) : it = O.wnext - He, He > O.length && (He = O.length), Ct = O.window; } else - Ct = se, it = Le - F.offset, He = F.length; - He > tt && (He = tt), tt -= He, F.length -= He; + Ct = se, it = $e - O.offset, He = O.length; + He > tt && (He = tt), tt -= He, O.length -= He; do - se[Le++] = Ct[it++]; + se[$e++] = Ct[it++]; while (--He); - F.length === 0 && (F.mode = kr); + O.length === 0 && (O.mode = kr); break; - case Oi: + case Fi: if (tt === 0) break e; - se[Le++] = F.length, tt--, F.mode = kr; + se[$e++] = O.length, tt--, O.mode = kr; break; case Hr: - if (F.wrap) { - for (; $e < 32; ) { + if (O.wrap) { + for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, _e |= J[ie++] << $e, $e += 8; + Ee--, _e |= J[ie++] << Le, Le += 8; } - if (Je -= tt, C.total_out += Je, F.total += Je, F.wrap & 4 && Je && (C.adler = F.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ - F.flags ? I(F.check, se, Je, Le - Je) : Ce(F.check, se, Je, Le - Je)), Je = tt, F.wrap & 4 && (F.flags ? _e : Bi(_e)) !== F.check) { - C.msg = "incorrect data check", F.mode = Dt; + 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; break; } - _e = 0, $e = 0; + _e = 0, Le = 0; } - F.mode = zi; + O.mode = zi; case zi: - if (F.wrap && F.flags) { - for (; $e < 32; ) { + if (O.wrap && O.flags) { + for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, _e += J[ie++] << $e, $e += 8; + Ee--, _e += J[ie++] << Le, Le += 8; } - if (F.wrap & 4 && _e !== (F.total & 4294967295)) { - C.msg = "incorrect length check", F.mode = Dt; + if (O.wrap & 4 && _e !== (O.total & 4294967295)) { + C.msg = "incorrect length check", O.mode = Dt; break; } - _e = 0, $e = 0; + _e = 0, Le = 0; } - F.mode = Ii; + O.mode = Ii; case Ii: At = aa; break e; @@ -42151,8 +42167,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; default: return Ut; } - return C.next_out = Le, C.avail_out = tt, C.next_in = ie, C.avail_in = Ee, F.hold = _e, F.bits = $e, (F.wsize || Je !== C.avail_out && F.mode < Dt && (F.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, F.total += Je, F.wrap & 4 && Je && (C.adler = F.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ - F.flags ? I(F.check, se, Je, C.next_out - Je) : Ce(F.check, se, Je, C.next_out - Je)), C.data_type = F.bits + (F.last ? 64 : 0) + (F.mode === Vt ? 128 : 0) + (F.mode === Tr || F.mode === Wr ? 256 : 0), (pt === 0 && Je === 0 || j === ui) && At === Jt && (At = la), At; + 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; @@ -42161,12 +42177,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, ga = (C, j) => { if (er(C)) return Ut; - const F = C.state; - return F.wrap & 2 ? (F.head = j, j.done = !1, Jt) : Ut; + const O = C.state; + return O.wrap & 2 ? (O.head = j, j.done = !1, Jt) : Ut; }, _a = (C, j) => { - const F = j.length; + 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, F, 0), se !== J.check) ? di : (ie = Vi(C, j, F, F), ie ? (J.mode = Ri, fi) : (J.havedict = 1, Jt)); + 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)); }; 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, @@ -42186,13 +42202,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Ta = Ca; const ji = Object.prototype.toString, { Z_NO_FLUSH: ka, - Z_FINISH: La, + Z_FINISH: $a, Z_OK: vr, Z_STREAM_END: Kr, Z_NEED_DICT: Xr, - Z_STREAM_ERROR: $a, + Z_STREAM_ERROR: La, Z_DATA_ERROR: Ki, - Z_MEM_ERROR: Fa + Z_MEM_ERROR: Oa } = ve; function yr(C) { this.options = Er.assign({ @@ -42202,39 +42218,39 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; }, 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 F = jt.inflateInit2( + let O = jt.inflateInit2( this.strm, j.windowBits ); - if (F !== vr) - throw new Error(we[F]); - 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 && (F = jt.inflateSetDictionary(this.strm, j.dictionary), F !== vr))) - throw new Error(we[F]); + 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 F = this.strm, J = this.options.chunkSize, se = this.options.dictionary; - let ie, Le, Ee; + const O = this.strm, J = this.options.chunkSize, se = this.options.dictionary; + let ie, $e, Ee; if (this.ended) return !1; - for (j === ~~j ? Le = j : Le = j === !0 ? La : ka, ji.call(C) === "[object ArrayBuffer]" ? F.input = new Uint8Array(C) : F.input = C, F.next_in = 0, F.avail_in = F.input.length; ; ) { - for (F.avail_out === 0 && (F.output = new Uint8Array(J), F.next_out = 0, F.avail_out = J), ie = jt.inflate(F, Le), ie === Xr && se && (ie = jt.inflateSetDictionary(F, se), ie === vr ? ie = jt.inflate(F, Le) : ie === Ki && (ie = Xr)); F.avail_in > 0 && ie === Kr && F.state.wrap > 0 && C[F.next_in] !== 0; ) - jt.inflateReset(F), ie = jt.inflate(F, Le); + 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 $a: + case La: case Ki: case Xr: - case Fa: + case Oa: return this.onEnd(ie), this.ended = !0, !1; } - if (Ee = F.avail_out, F.next_out && (F.avail_out === 0 || ie === Kr)) + if (Ee = O.avail_out, O.next_out && (O.avail_out === 0 || ie === Kr)) if (this.options.to === "string") { - let tt = pr.utf8border(F.output, F.next_out), _e = F.next_out - tt, $e = pr.buf2string(F.output, tt); - F.next_out = _e, F.avail_out = J - _e, _e && F.output.set(F.output.subarray(tt, tt + _e), 0), this.onData($e); + 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); } else - this.onData(F.output.length === F.next_out ? F.output : F.output.subarray(0, F.next_out)); + 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 (F.avail_in === 0) break; + if (O.avail_in === 0) break; } } return !0; @@ -42244,14 +42260,14 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 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; }; function Zr(C, j) { - const F = new yr(j); - if (F.push(C), F.err) throw F.msg || we[F.err]; - return F.result; + const O = new yr(j); + if (O.push(C), O.err) throw O.msg || we[O.err]; + return O.result; } - function Oa(C, j) { + function Fa(C, j) { return j = j || {}, j.raw = !0, Zr(C, j); } - var za = yr, Ia = Zr, Ra = Oa, Pa = Zr, Ba = ve, Na = { + var za = yr, Ia = Zr, Ra = Fa, Pa = Zr, Ba = ve, Na = { Inflate: za, inflate: Ia, inflateRaw: Ra, @@ -42308,20 +42324,23 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return __webpack_exports__; })() )); -})(_3Dmol); -var _3DmolExports = _3Dmol.exports; -const Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), { +})(_3Dmol$1); +var _3DmolExports = _3Dmol$1.exports; +const _3Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), mol = /* @__PURE__ */ _mergeNamespaces({ + __proto__: null, + default: _3Dmol +}, [_3DmolExports]), { SvelteComponent: SvelteComponent$7, append_hydration: append_hydration$5, attr: attr$6, binding_callbacks: binding_callbacks$4, children: children$5, claim_element: claim_element$6, - claim_space: claim_space$5, + claim_space: claim_space$6, claim_text: claim_text$5, detach: detach$7, element: element$6, - get_svelte_dataset: get_svelte_dataset$2, + get_svelte_dataset: get_svelte_dataset$3, init: init$7, insert_hydration: insert_hydration$7, listen: listen$2, @@ -42329,80 +42348,80 @@ const Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), { run_all: run_all$2, safe_not_equal: safe_not_equal$8, set_data: set_data$5, - space: space$5, + space: space$6, text: text$6, toggle_class: toggle_class$5 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4, afterUpdate: afterUpdate$2 } = window.__gradio__svelte__internal; -function create_if_block$5(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', g, p, b, c, _ = "Attachment atom", E, w, k, L, $, z = "Deleted atoms", O, R, P, U; +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) { return ( /*attachmentIndex*/ - Q[1] !== null ? create_if_block_2$3 : create_else_block_1$2 + Q[1] !== null ? create_if_block_2$4 : create_else_block_1$3 ); } let B = N(n), W = B(n); function V(Q, te) { return ( /*deleteIndexes*/ - Q[2].length > 0 ? create_if_block_1$4 : create_else_block$4 + Q[2].length > 0 ? create_if_block_1$5 : create_else_block$5 ); } let G = V(n), H = G(n); return { c() { - e = element$6("div"), e.textContent = t, r = space$5(), a = element$6("div"), a.innerHTML = s, h = space$5(), o = element$6("div"), d = element$6("button"), d.innerHTML = v, f = space$5(), y = element$6("button"), y.innerHTML = A, x = space$5(), M = element$6("div"), m = element$6("table"), l = element$6("thead"), l.innerHTML = u, g = space$5(), p = element$6("tbody"), b = element$6("tr"), c = element$6("th"), c.textContent = _, E = space$5(), w = element$6("td"), W.c(), k = space$5(), L = element$6("tr"), $ = element$6("th"), $.textContent = z, O = space$5(), 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 = 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(); }, l(Q) { - e = claim_element$6(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-1ws80r8" && (e.textContent = t), r = claim_space$5(Q), a = claim_element$6(Q, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(a) !== "svelte-au1964" && (a.innerHTML = s), h = claim_space$5(Q), o = claim_element$6(Q, "DIV", { class: !0 }); + 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", { class: !0, id: !0, "data-svelte-h": !0 - }), get_svelte_dataset$2(d) !== "svelte-1x319mo" && (d.innerHTML = v), f = claim_space$5(te), y = claim_element$6(te, "BUTTON", { + }), get_svelte_dataset$3(d) !== "svelte-1x319mo" && (d.innerHTML = v), f = claim_space$6(te), y = claim_element$6(te, "BUTTON", { class: !0, id: !0, "data-svelte-h": !0 - }), get_svelte_dataset$2(y) !== "svelte-vlrg5g" && (y.innerHTML = A), te.forEach(detach$7), x = claim_space$5(Q), M = claim_element$6(Q, "DIV", { class: !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$2(l) !== "svelte-1cl8b2m" && (l.innerHTML = u), g = claim_space$5(ce), p = claim_element$6(ce, "TBODY", { class: !0 }); - var fe = children$5(p); + 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", { scope: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$2(c) !== "svelte-1j0kl0r" && (c.textContent = _), E = claim_space$5(oe), w = claim_element$6(oe, "TD", { class: !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$5(fe), L = claim_element$6(fe, "TR", { class: !0 }); - var Ae = children$5(L); - $ = claim_element$6(Ae, "TH", { + 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", { scope: !0, class: !0, "data-svelte-h": !0 - }), get_svelte_dataset$2($) !== "svelte-nv6kl6" && ($.textContent = z), O = claim_space$5(Ae), R = claim_element$6(Ae, "TD", { class: !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(); }, h() { - attr$6(e, "class", "w-full text-center text-lg mb-2 svelte-1jhdl43"), attr$6(a, "class", "flex items-center space-x-2 justify-center mb-2 text-xs svelte-1jhdl43"), 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-1jhdl43"), attr$6(d, "id", "attach"), toggle_class$5( + 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( 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-1jhdl43"), 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-oz981t"), 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-1jhdl43"), attr$6(l, "class", "text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 svelte-1jhdl43"), attr$6(c, "scope", "row"), attr$6(c, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(w, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(b, "class", "bg-white border-b dark:bg-gray-800 dark:border-gray-700 svelte-1jhdl43"), attr$6($, "scope", "row"), attr$6($, "class", "px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white text-right svelte-1jhdl43"), attr$6(R, "class", "px-6 py-4 font-mono svelte-1jhdl43"), attr$6(L, "class", "bg-white dark:bg-gray-800 svelte-1jhdl43"), attr$6(p, "class", "svelte-1jhdl43"), attr$6(m, "class", "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 svelte-1jhdl43"), attr$6(M, "class", "relative overflow-x-auto mt-3 svelte-1jhdl43"); + ), 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"); }, 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, g), append_hydration$5(m, p), append_hydration$5(p, b), append_hydration$5(b, c), append_hydration$5(b, E), append_hydration$5(b, w), W.m(w, null), append_hydration$5(p, k), append_hydration$5(p, L), append_hydration$5(L, $), append_hydration$5(L, O), append_hydration$5(L, R), H.m(R, null), P || (U = [ + 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 = [ listen$2( d, "click", @@ -42437,7 +42456,7 @@ function create_if_block$5(n) { } }; } -function create_else_block_1$2(n) { +function create_else_block_1$3(n) { let e; return { c() { @@ -42455,7 +42474,7 @@ function create_else_block_1$2(n) { } }; } -function create_if_block_2$3(n) { +function create_if_block_2$4(n) { let e; return { c() { @@ -42487,7 +42506,7 @@ function create_if_block_2$3(n) { } }; } -function create_else_block$4(n) { +function create_else_block$5(n) { let e; return { c() { @@ -42505,7 +42524,7 @@ function create_else_block$4(n) { } }; } -function create_if_block_1$4(n) { +function create_if_block_1$5(n) { let e = ( /*deleteIndexes*/ n[2].join(", ") + "" @@ -42533,30 +42552,30 @@ function create_if_block_1$4(n) { function create_fragment$7(n) { let e, t, r, a, s, h = ( /*showCovMod*/ - n[0] > -1 && create_if_block$5(n) + n[0] > -1 && create_if_block$6(n) ); return { c() { - e = element$6("div"), t = element$6("div"), r = element$6("div"), a = space$5(), s = element$6("div"), h && h.c(), this.h(); + e = element$6("div"), t = element$6("div"), r = element$6("div"), a = space$6(), s = element$6("div"), h && h.c(), this.h(); }, l(o) { 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$5(d), s = claim_element$6(d, "DIV", { class: !0 }); + 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 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-1jhdl43"), attr$6(t, "class", "relative svelte-1jhdl43"), attr$6(s, "class", "flex flex-col justify-center svelte-1jhdl43"), attr$6(e, "class", "mol-wrapper svelte-1jhdl43"); + 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"); }, 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); }, p(o, [d]) { /*showCovMod*/ - o[0] > -1 ? h ? h.p(o, d) : (h = create_if_block$5(o), h.c(), h.m(s, null)) : h && (h.d(1), h = null); + o[0] > -1 ? h ? h.p(o, d) : (h = create_if_block$6(o), h.c(), h.m(s, null)) : h && (h.d(1), h = null); }, i: noop$7, o: noop$7, @@ -42567,43 +42586,45 @@ function create_fragment$7(n) { } function instance$7(n, e, t) { const r = createEventDispatcher$4(); - let a = null, s = [], h = "attach"; - function o(m) { - m.setStyle({ stick: {} }), f > -1 && (a !== null && m.addStyle({ index: a }, { sphere: { color: "blue", scale: 0.5 } }), m.addStyle({ index: s }, { sphere: { color: "red", scale: 0.5 } }), r("updateMol", { - attachmentIndex: a, - deleteIndexes: s, - index: f, - mol: m.exportJSON() + let a = mol; + console.log(a); + let s = null, h = [], o = "attach"; + function d(l) { + l.setStyle({ stick: {} }), y > -1 && (s !== null && l.addStyle({ index: s }, { sphere: { color: "blue", scale: 0.5 } }), l.addStyle({ index: h }, { sphere: { color: "red", scale: 0.5 } }), r("updateMol", { + attachmentIndex: s, + deleteIndexes: h, + index: y, + mol: l.exportJSON() })); } - function d(m, l) { - let u = Dmol.createViewer(l, {}); - return u.addModel(m, "sdf"), o(u), u.setBackgroundColor("white"), u.zoomTo(), u.getModel(0).setClickable({}, !0, function(g, p, b, c) { - f > -1 && (h === "attach" ? t(1, a = g.serial) : (s.includes(g.serial) ? t(2, s = s.filter((_) => _ !== g.serial)) : s.push(g.serial), t(2, s), o(p))); - }), u.render(), u; + function v(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, _) { + 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: v = "" } = e, { showCovMod: f = -1 } = e, y = null; + let { molvalue: f = "" } = e, { showCovMod: y = -1 } = e, A = null; afterUpdate$2(() => { - d(v, y); + v(f, A); }); - function A(m) { - binding_callbacks$4[m ? "unshift" : "push"](() => { - y = m, t(4, y); + function x(l) { + binding_callbacks$4[l ? "unshift" : "push"](() => { + A = l, t(4, A); }); } - const x = () => t(3, h = "attach"), M = () => t(3, h = "delete"); - return n.$$set = (m) => { - "molvalue" in m && t(5, v = m.molvalue), "showCovMod" in m && t(0, f = m.showCovMod); + const M = () => t(3, o = "attach"), m = () => t(3, o = "delete"); + return n.$$set = (l) => { + "molvalue" in l && t(5, f = l.molvalue), "showCovMod" in l && t(0, y = l.showCovMod); }, [ - f, - a, + y, s, h, - y, - v, + o, A, + f, x, - M + M, + m ]; } class Molecule extends SvelteComponent$7 { @@ -42620,17 +42641,17 @@ const { children: children$4, claim_component: claim_component$4, claim_element: claim_element$5, - claim_space: claim_space$4, + claim_space: claim_space$5, claim_svg_element: claim_svg_element$1, claim_text: claim_text$4, create_component: create_component$4, destroy_component: destroy_component$4, - destroy_each: destroy_each$1, + destroy_each: destroy_each$2, detach: detach$6, element: element$5, - empty: empty$3, - ensure_array_like: ensure_array_like$1, - get_svelte_dataset: get_svelte_dataset$1, + empty: empty$4, + ensure_array_like: ensure_array_like$2, + get_svelte_dataset: get_svelte_dataset$2, group_outros: group_outros$4, init: init$6, insert_hydration: insert_hydration$6, @@ -42643,14 +42664,14 @@ const { select_value, set_data: set_data$4, set_input_value: set_input_value$1, - space: space$4, + space: space$5, svg_element: svg_element$1, text: text$5, toggle_class: toggle_class$4, transition_in: transition_in$4, transition_out: transition_out$4 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3 } = window.__gradio__svelte__internal; -function get_each_context$1(n, e, t) { +function get_each_context$2(n, e, t) { const r = n.slice(); return r[35] = e[t], r[36] = e, r[37] = t, r; } @@ -42691,10 +42712,10 @@ function create_if_block_11$1(n) { let a = r(n, [-1, -1]), s = a(n); return { c() { - s.c(), t = empty$3(); + s.c(), t = empty$4(); }, l(h) { - s.l(h), t = empty$3(); + s.l(h), t = empty$4(); }, m(h, o) { s.m(h, o), insert_hydration$6(h, t, o); @@ -42811,14 +42832,14 @@ 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, g, p = "Metal ion", b, c, _, E, w; - function k(...O) { + 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) { return ( /*input_handler_1*/ n[17]( /*i*/ n[37], - ...O + ...F ) ); } @@ -42835,39 +42856,39 @@ function create_if_block_10$1(n) { /*handleMessage*/ n[13] ); - function L(...O) { + function $(...F) { return ( /*input_handler_2*/ n[18]( /*i*/ n[37], - ...O + ...F ) ); } - let $ = ensure_array_like$1( + let L = ensure_array_like$2( /*metals*/ n[8] ), z = []; - for (let O = 0; O < $.length; O += 1) - z[O] = create_each_block_6(get_each_context_6(n, $, O)); + for (let F = 0; F < L.length; F += 1) + z[F] = create_each_block_6(get_each_context_6(n, L, F)); return { c() { - e = element$5("textarea"), r = space$4(), a = element$5("div"), a.textContent = s, h = space$4(), create_component$4(o.$$.fragment), d = space$4(), v = element$5("div"), v.textContent = f, y = space$4(), A = element$5("textarea"), M = space$4(), m = element$5("div"), m.textContent = l, u = space$4(), g = element$5("div"), g.textContent = p, b = space$4(), c = element$5("div"); - for (let O = 0; O < z.length; O += 1) - z[O].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(); this.h(); }, - l(O) { - e = claim_element$5(O, "TEXTAREA", { + l(F) { + e = claim_element$5(F, "TEXTAREA", { rows: !0, class: !0, placeholder: !0 - }), children$4(e).forEach(detach$6), r = claim_space$4(O), a = claim_element$5(O, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(a) !== "svelte-1f0b7yn" && (a.textContent = s), h = claim_space$4(O), claim_component$4(o.$$.fragment, O), d = claim_space$4(O), v = claim_element$5(O, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(v) !== "svelte-1f0b7yn" && (v.textContent = f), y = claim_space$4(O), A = claim_element$5(O, "TEXTAREA", { + }), 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", { rows: !0, class: !0, placeholder: !0 - }), children$4(A).forEach(detach$6), M = claim_space$4(O), m = claim_element$5(O, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(m) !== "svelte-1f0b7yn" && (m.textContent = l), u = claim_space$4(O), g = claim_element$5(O, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(g) !== "svelte-5ik8xi" && (g.textContent = p), b = claim_space$4(O), c = claim_element$5(O, "DIV", { class: !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); @@ -42876,46 +42897,46 @@ function create_if_block_10$1(n) { 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(g, "class", "text-center text-gray-600 font-bold mb-2 svelte-bt9x4p"), attr$5(c, "class", "flex justify-center space-x-2 svelte-bt9x4p"); + 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(O, R) { - insert_hydration$6(O, e, R), insert_hydration$6(O, r, R), insert_hydration$6(O, a, R), insert_hydration$6(O, h, R), mount_component$4(o, O, R), insert_hydration$6(O, d, R), insert_hydration$6(O, v, R), insert_hydration$6(O, y, R), insert_hydration$6(O, A, R), insert_hydration$6(O, M, R), insert_hydration$6(O, m, R), insert_hydration$6(O, u, R), insert_hydration$6(O, g, R), insert_hydration$6(O, b, R), insert_hydration$6(O, c, R); + 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", L) + listen$1(A, "input", $) ], E = !0); }, - p(O, R) { - if (n = O, (!_ || R[0] & /*vals*/ + 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*/ 289) { - $ = ensure_array_like$1( + L = ensure_array_like$2( /*metals*/ n[8] ); let P; - for (P = 0; P < $.length; P += 1) { - const U = get_each_context_6(n, $, 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)); } for (; P < z.length; P += 1) z[P].d(1); - z.length = $.length; + z.length = L.length; } }, - i(O) { - _ || (transition_in$4(o.$$.fragment, O), _ = !0); + i(F) { + _ || (transition_in$4(o.$$.fragment, F), _ = !0); }, - o(O) { - transition_out$4(o.$$.fragment, O), _ = !1; + o(F) { + transition_out$4(o.$$.fragment, F), _ = !1; }, - d(O) { - O && (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(g), detach$6(b), detach$6(c)), destroy_component$4(o, O), destroy_each$1(z, O), E = !1, run_all$1(w); + 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); } }; } @@ -42980,14 +43001,14 @@ function create_each_block_6(n) { } return { c() { - e = element$5("button"), t = element$5("span"), a = text$5(r), s = space$4(), this.h(); + 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 }); 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$4(f), f.forEach(detach$6), this.h(); + 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( @@ -43029,9 +43050,9 @@ function create_each_block_6(n) { } }; } -function create_if_block_3$2(n) { +function create_if_block_3$3(n) { let e, t, r, a, s; - const h = [create_if_block_4$2, create_if_block_6$1], o = []; + const h = [create_if_block_4$3, create_if_block_6$1], o = []; function d(v, f) { return f[0] & /*vals*/ 1 && (e = null), e == null && (e = !!["DNA", "RNA", "protein"].includes( @@ -43044,10 +43065,10 @@ function create_if_block_3$2(n) { } return ~(t = d(n, [-1, -1])) && (r = o[t] = h[t](n)), { c() { - r && r.c(), a = empty$3(); + r && r.c(), a = empty$4(); }, l(v) { - r && r.l(v), a = empty$3(); + r && r.l(v), a = empty$4(); }, m(v, f) { ~t && o[t].m(v, f), insert_hydration$6(v, a, f), s = !0; @@ -43076,10 +43097,10 @@ function create_if_block_6$1(n) { ); return { c() { - r && r.c(), e = empty$3(); + r && r.c(), e = empty$4(); }, l(a) { - r && r.l(a), e = empty$3(); + r && r.l(a), e = empty$4(); }, m(a, s) { r && r.m(a, s), insert_hydration$6(a, e, s), t = !0; @@ -43102,10 +43123,10 @@ function create_if_block_6$1(n) { } }; } -function create_if_block_4$2(n) { +function create_if_block_4$3(n) { let e, t, r, a = ( /*item*/ - n[48].sequence !== "" && create_if_block_5$2(n) + n[48].sequence !== "" && create_if_block_5$3(n) ); return { c() { @@ -43139,7 +43160,7 @@ function create_if_block_4$2(n) { p(s, h) { /*item*/ s[48].sequence !== "" ? a ? (a.p(s, h), h[0] & /*vals*/ - 1 && transition_in$4(a, 1)) : (a = create_if_block_5$2(s), a.c(), transition_in$4(a, 1), a.m(t, null)) : a && (group_outros$4(), transition_out$4(a, 1, 1, () => { + 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*/ 1) && toggle_class$4( @@ -43233,7 +43254,7 @@ function create_if_block_7$1(n) { } }; } -function create_if_block_5$2(n) { +function create_if_block_5$3(n) { let e, t; return e = new Sequence({ props: { seq: ( @@ -43277,10 +43298,10 @@ function create_each_block_5(n) { /*item*/ n[48].class ] + "" - ), y, A, x, M, m, l, u, g, p, b, c, _, E, w, k, L, $, z = !/*item*/ + ), 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 O(...N) { + function F(...N) { return ( /*click_handler*/ n[14]( @@ -43307,10 +43328,10 @@ function create_each_block_5(n) { /*item*/ n[48].open && create_if_block_8$1(n) ), U = !/*item*/ - n[48].open && create_if_block_3$2(n); + n[48].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$4(), v = element$5("span"), y = text$5(f), A = space$4(), x = element$5("span"), z && z.c(), M = space$4(), m = element$5("div"), l = svg_element$1("svg"), u = svg_element$1("path"), g = space$4(), p = svg_element$1("svg"), b = svg_element$1("path"), _ = space$4(), P && P.c(), E = space$4(), U && U.c(), w = empty$3(), 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(), 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(); }, l(N) { e = claim_element$5(N, "H2", { id: !0, class: !0 }); @@ -43327,11 +43348,11 @@ function create_each_block_5(n) { 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$4(V), v = claim_element$5(V, "SPAN", { class: !0 }); + 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$4(V), x = claim_element$5(V, "SPAN", { class: !0 }); + 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$4(W), m = claim_element$5(W, "DIV", { class: !0 }); + 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", { "data-slot": !0, @@ -43349,7 +43370,7 @@ function create_each_block_5(n) { "stroke-linejoin": !0, d: !0, class: !0 - }), children$4(u).forEach(detach$6), ee.forEach(detach$6), g = claim_space$4(te), p = claim_svg_element$1(te, "svg", { + }), children$4(u).forEach(detach$6), ee.forEach(detach$6), p = claim_space$5(te), g = claim_svg_element$1(te, "svg", { "data-accordion-icon": !0, class: !0, "aria-hidden": !0, @@ -43357,7 +43378,7 @@ function create_each_block_5(n) { fill: !0, viewBox: !0 }); - var ce = children$4(p); + var ce = children$4(g); b = claim_svg_element$1(ce, "path", { stroke: !0, "stroke-linecap": !0, @@ -43365,19 +43386,19 @@ function create_each_block_5(n) { "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$4(N), P && P.l(N), E = claim_space$4(N), U && U.l(N), w = empty$3(), this.h(); + }), 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(); }, 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(p, "data-accordion-icon", ""), attr$5(p, "class", "w-3 h-3 shrink-0 svelte-bt9x4p"), attr$5(p, "aria-hidden", "true"), attr$5(p, "xmlns", "http://www.w3.org/2000/svg"), attr$5(p, "fill", "none"), attr$5(p, "viewBox", "0 0 10 6"), toggle_class$4( - p, + ] + " 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, "rotate-180", /*item*/ n[48].open - ), toggle_class$4(p, "-rotate-90", !/*item*/ + ), 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*/ @@ -43402,10 +43423,10 @@ function create_each_block_5(n) { n[37]}`), attr$5(e, "class", "svelte-bt9x4p"); }, 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, g), append_hydration$4(m, p), append_hydration$4(p, 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", O), + 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) - ], L = !0); + ], $ = !0); }, p(N, B) { n = N, (!k || B[0] & /*vals*/ @@ -43424,12 +43445,12 @@ function create_each_block_5(n) { 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*/ 1) && toggle_class$4( - p, + g, "rotate-180", /*item*/ n[48].open ), (!k || B[0] & /*vals*/ - 1) && toggle_class$4(p, "-rotate-90", !/*item*/ + 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*/ @@ -43454,7 +43475,7 @@ function create_each_block_5(n) { 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$2(n), U.c(), transition_in$4(U, 1), U.m(w.parentNode, w)); + 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)); }, i(N) { k || (transition_in$4(P), transition_in$4(U), k = !0); @@ -43463,29 +43484,29 @@ function create_each_block_5(n) { transition_out$4(P), transition_out$4(U), k = !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), L = !1, run_all$1($); + 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); } }; } -function create_if_block$4(n) { - let e, t = "Covalent Modification", r, a, s = ensure_array_like$1( +function create_if_block$5(n) { + let e, t = "Covalent Modification", r, a, s = ensure_array_like$2( /*covMods*/ n[1] ), h = []; for (let o = 0; o < s.length; o += 1) - h[o] = create_each_block$1(get_each_context$1(n, s, o)); + h[o] = create_each_block$2(get_each_context$2(n, s, o)); return { c() { - e = element$5("h4"), e.textContent = t, r = space$4(); + e = element$5("h4"), e.textContent = t, r = space$5(); for (let o = 0; o < h.length; o += 1) h[o].c(); - a = empty$3(), this.h(); + a = empty$4(), this.h(); }, l(o) { - e = claim_element$5(o, "H4", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(e) !== "svelte-vfdyc9" && (e.textContent = t), r = claim_space$4(o); + e = claim_element$5(o, "H4", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-vfdyc9" && (e.textContent = t), r = claim_space$5(o); for (let d = 0; d < h.length; d += 1) h[d].l(o); - a = empty$3(), this.h(); + a = empty$4(), this.h(); }, h() { attr$5(e, "class", "text-center font-bold text-xl svelte-bt9x4p"); @@ -43499,14 +43520,14 @@ function create_if_block$4(n) { p(o, d) { if (d[0] & /*dispatch, covMods, ligandChains, getResAtoms, getResname, getResidues, proteinChains*/ 3642) { - s = ensure_array_like$1( + s = ensure_array_like$2( /*covMods*/ o[1] ); let v; for (v = 0; v < s.length; v += 1) { - const f = get_each_context$1(o, s, v); - h[v] ? h[v].p(f, d) : (h[v] = create_each_block$1(f), h[v].c(), h[v].m(a.parentNode, a)); + 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)); } for (; v < h.length; v += 1) h[v].d(1); @@ -43514,7 +43535,7 @@ function create_if_block$4(n) { } }, d(o) { - o && (detach$6(e), detach$6(r), detach$6(a)), destroy_each$1(h, o); + o && (detach$6(e), detach$6(r), detach$6(a)), destroy_each$2(h, o); } }; } @@ -43561,12 +43582,12 @@ function create_each_block_3(n) { ), h; return { c() { - e = element$5("option"), r = text$5(t), a = space$4(), h = text$5(s), this.h(); + 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 }); var d = children$4(e); - r = claim_text$4(d, t), a = claim_space$4(d), h = claim_text$4(d, s), d.forEach(detach$6), this.h(); + 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*/ @@ -43585,7 +43606,7 @@ function create_each_block_3(n) { } }; } -function create_else_block_1$1(n) { +function create_else_block_1$2(n) { let e; return { c() { @@ -43606,8 +43627,8 @@ function create_else_block_1$1(n) { } }; } -function create_if_block_2$2(n) { - let e, t = ensure_array_like$1( +function create_if_block_2$3(n) { + let e, t = ensure_array_like$2( /*getResAtoms*/ n[9]( /*covMod*/ @@ -43620,12 +43641,12 @@ function create_if_block_2$2(n) { c() { for (let a = 0; a < r.length; a += 1) r[a].c(); - e = empty$3(); + e = empty$4(); }, l(a) { for (let s = 0; s < r.length; s += 1) r[s].l(a); - e = empty$3(); + e = empty$4(); }, m(a, s) { for (let h = 0; h < r.length; h += 1) @@ -43635,7 +43656,7 @@ function create_if_block_2$2(n) { p(a, s) { if (s[0] & /*getResAtoms, covMods, getResname*/ 2562) { - t = ensure_array_like$1( + t = ensure_array_like$2( /*getResAtoms*/ a[9]( /*covMod*/ @@ -43653,7 +43674,7 @@ function create_if_block_2$2(n) { } }, d(a) { - a && detach$6(e), destroy_each$1(r, a); + a && detach$6(e), destroy_each$2(r, a); } }; } @@ -43741,14 +43762,14 @@ function create_each_block_1$1(n) { } }; } -function create_else_block$3(n) { +function create_else_block$4(n) { let e, t = "click on atom"; return { c() { e = element$5("p"), e.textContent = t, this.h(); }, l(r) { - e = claim_element$5(r, "P", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(e) !== "svelte-1dm8y5e" && (e.textContent = t), this.h(); + 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"); @@ -43762,7 +43783,7 @@ function create_else_block$3(n) { } }; } -function create_if_block_1$3(n) { +function create_if_block_1$4(n) { let e, t, r = ( /*covMod*/ n[35].attachmentIndex + "" @@ -43792,13 +43813,13 @@ function create_if_block_1$3(n) { } }; } -function create_each_block$1(n) { - let e, t, r, a, s = 'Protein', h, o, d = 'Chain Residue Atom Chirality', v, f, y, A, x, M, m, l, u, g, p = "no chirality defined", b, c = "CW", _, E = "CCW", w, k, L, $, z = 'Small molecule', O, 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$1( +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( /*proteinChains*/ n[3] - ), Fe = []; + ), Oe = []; for (let ae = 0; ae < Te.length; ae += 1) - Fe[ae] = create_each_block_4(get_each_context_4(n, Te, ae)); + Oe[ae] = create_each_block_4(get_each_context_4(n, Te, ae)); function Be() { n[20].call( y, @@ -43806,7 +43827,7 @@ function create_each_block$1(n) { n[37] ); } - let Ue = ensure_array_like$1( + let Ue = ensure_array_like$2( /*getResidues*/ n[10]( /*covMod*/ @@ -43825,7 +43846,7 @@ function create_each_block$1(n) { function Ne(ae, ge) { return ( /*covMod*/ - ae[35].residue != "" ? create_if_block_2$2 : create_else_block_1$1 + ae[35].residue != "" ? create_if_block_2$3 : create_else_block_1$2 ); } let Re = Ne(n), De = Re(n); @@ -43843,7 +43864,7 @@ function create_each_block$1(n) { n[37] ); } - let X = ensure_array_like$1( + let X = ensure_array_like$2( /*ligandChains*/ n[4] ), q = []; @@ -43859,7 +43880,7 @@ function create_each_block$1(n) { function ye(ae, ge) { return ( /*covMod*/ - ae[35].attachmentIndex ? create_if_block_1$3 : create_else_block$3 + ae[35].attachmentIndex ? create_if_block_1$4 : create_else_block$4 ); } let me = ye(n), ze = me(n); @@ -43882,16 +43903,16 @@ function create_each_block$1(n) { } return { c() { - e = element$5("div"), t = element$5("div"), r = element$5("div"), a = element$5("div"), a.innerHTML = s, h = space$4(), o = element$5("div"), o.innerHTML = d, v = space$4(), f = element$5("div"), y = element$5("select"); - for (let ae = 0; ae < Fe.length; ae += 1) - Fe[ae].c(); - A = space$4(), x = element$5("select"); + 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(); + A = space$5(), x = element$5("select"); for (let ae = 0; ae < Pe.length; ae += 1) Pe[ae].c(); - M = space$4(), m = element$5("select"), De.c(), l = space$4(), u = element$5("select"), g = element$5("option"), g.textContent = p, b = element$5("option"), b.textContent = c, _ = element$5("option"), _.textContent = E, w = space$4(), k = element$5("div"), L = element$5("div"), $ = element$5("div"), $.innerHTML = z, O = space$4(), R = element$5("div"), R.innerHTML = P, U = space$4(), N = element$5("div"), B = element$5("select"); + 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$4(), V = element$5("div"), ze.c(), G = space$4(), 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$4(), Ae = element$5("div"), Se = svg_element$1("svg"), Ie = svg_element$1("path"), pe = space$4(), this.h(); + 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 }); @@ -43900,25 +43921,25 @@ function create_each_block$1(n) { 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$1(a) !== "svelte-1eqot16" && (a.innerHTML = s), h = claim_space$4(ue), o = claim_element$5(ue, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(o) !== "svelte-1k2x92t" && (o.innerHTML = d), v = claim_space$4(ue), f = claim_element$5(ue, "DIV", { class: !0 }); + 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 Z = children$4(y); - for (let rt = 0; rt < Fe.length; rt += 1) - Fe[rt].l(Z); - Z.forEach(detach$6), A = claim_space$4(Ce), x = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); - var Oe = children$4(x); + 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 }); + var Fe = children$4(x); for (let rt = 0; rt < Pe.length; rt += 1) - Pe[rt].l(Oe); - Oe.forEach(detach$6), M = claim_space$4(Ce), m = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); + 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 }); var We = children$4(m); - De.l(We), We.forEach(detach$6), l = claim_space$4(Ce), u = claim_element$5(Ce, "SELECT", { name: !0, id: !0, class: !0 }); + 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); - g = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(g) !== "svelte-1d780p1" && (g.textContent = p), b = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(b) !== "svelte-wvq2yy" && (b.textContent = c), _ = claim_element$5(I, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(_) !== "svelte-wxh7b0" && (_.textContent = E), I.forEach(detach$6), Ce.forEach(detach$6), ue.forEach(detach$6), w = claim_space$4(xe), k = claim_element$5(xe, "DIV", { class: !0 }); + 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); - L = claim_element$5(we, "DIV", { class: !0 }); - var ve = children$4(L); - $ = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1($) !== "svelte-80ph3f" && ($.innerHTML = z), O = claim_space$4(ve), R = claim_element$5(ve, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(R) !== "svelte-1xhu24v" && (R.innerHTML = P), U = claim_space$4(ve), N = claim_element$5(ve, "DIV", { class: !0 }); + $ = claim_element$5(we, "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, @@ -43929,11 +43950,11 @@ function create_each_block$1(n) { var de = children$4(B); for (let rt = 0; rt < q.length; rt += 1) q[rt].l(de); - de.forEach(detach$6), W = claim_space$4(Y), V = claim_element$5(Y, "DIV", { class: !0 }); + 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$4(Y), H = claim_element$5(Y, "SELECT", { name: !0, id: !0, class: !0 }); + 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$1(Q) !== "svelte-1d780p1" && (Q.textContent = te), ee = claim_element$5(Ye, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(ee) !== "svelte-wvq2yy" && (ee.textContent = ce), fe = claim_element$5(Ye, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(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$4(ge), Ae = claim_element$5(ge, "DIV", { class: !0 }); + 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", { "data-slot": !0, @@ -43951,7 +43972,7 @@ function create_each_block$1(n) { "stroke-linejoin": !0, d: !0, class: !0 - }), children$4(Ie).forEach(detach$6), Ke.forEach(detach$6), Ze.forEach(detach$6), pe = claim_space$4(ge), ge.forEach(detach$6), this.h(); + }), 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*/ @@ -43966,11 +43987,11 @@ function create_each_block$1(n) { n[1][ /*i*/ n[37] - ].atom === void 0 && add_render_callback$2(je), g.__value = "", set_input_value$1(g, g.__value), attr$5(g, "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*/ + ].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[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($, "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*/ + ].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[1][ /*i*/ n[37] @@ -43978,12 +43999,12 @@ function create_each_block$1(n) { 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(L, "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"); + ].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"); }, 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 < Fe.length; xe += 1) - Fe[xe] && Fe[xe].m(y, null); + for (let xe = 0; xe < Oe.length; xe += 1) + Oe[xe] && Oe[xe].m(y, null); select_option( y, /*covMods*/ @@ -44011,7 +44032,7 @@ function create_each_block$1(n) { n[37] ].atom, !0 - ), append_hydration$4(f, l), append_hydration$4(f, u), append_hydration$4(u, g), 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, _), select_option( u, /*covMods*/ n[1][ @@ -44019,7 +44040,7 @@ function create_each_block$1(n) { n[37] ].protein_symmetry, !0 - ), append_hydration$4(t, w), append_hydration$4(t, k), append_hydration$4(k, L), append_hydration$4(L, $), append_hydration$4(L, O), append_hydration$4(L, R), append_hydration$4(L, U), append_hydration$4(L, N), append_hydration$4(N, B); + ), 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); select_option( @@ -44087,18 +44108,18 @@ function create_each_block$1(n) { p(ae, ge) { if (n = ae, ge[0] & /*proteinChains*/ 8) { - Te = ensure_array_like$1( + Te = 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); - Fe[xe] ? Fe[xe].p(ue, ge) : (Fe[xe] = create_each_block_4(ue), Fe[xe].c(), Fe[xe].m(y, null)); + Oe[xe] ? Oe[xe].p(ue, ge) : (Oe[xe] = create_each_block_4(ue), Oe[xe].c(), Oe[xe].m(y, null)); } - for (; xe < Fe.length; xe += 1) - Fe[xe].d(1); - Fe.length = Te.length; + for (; xe < Oe.length; xe += 1) + Oe[xe].d(1); + Oe.length = Te.length; } if (ge[0] & /*covMods, proteinChains*/ 10 && select_option( @@ -44110,7 +44131,7 @@ function create_each_block$1(n) { ].protein ), ge[0] & /*getResidues, covMods*/ 1026) { - Ue = ensure_array_like$1( + Ue = ensure_array_like$2( /*getResidues*/ n[10]( /*covMod*/ @@ -44152,7 +44173,7 @@ function create_each_block$1(n) { ].protein_symmetry ), ge[0] & /*ligandChains, covMods*/ 18) { - X = ensure_array_like$1( + X = ensure_array_like$2( /*ligandChains*/ n[4] ); @@ -44184,12 +44205,12 @@ function create_each_block$1(n) { ); }, d(ae) { - ae && detach$6(e), destroy_each$1(Fe, ae), destroy_each$1(Pe, ae), De.d(), destroy_each$1(q, ae), ze.d(), le = !1, run_all$1(ne); + 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); } }; } function create_fragment$6(n) { - let e, t, r, a, s = ensure_array_like$1( + let e, t, r, a, s = ensure_array_like$2( /*vals*/ n[0] ), h = []; @@ -44200,14 +44221,14 @@ function create_fragment$6(n) { }); let d = ( /*covMods*/ - n[1].length > 0 && create_if_block$4(n) + n[1].length > 0 && create_if_block$5(n) ); return { c() { e = element$5("div"); for (let v = 0; v < h.length; v += 1) h[v].c(); - t = space$4(), r = element$5("div"), d && d.c(), this.h(); + t = space$5(), r = element$5("div"), d && d.c(), this.h(); }, l(v) { e = claim_element$5(v, "DIV", { @@ -44218,7 +44239,7 @@ function create_fragment$6(n) { var f = children$4(e); for (let A = 0; A < h.length; A += 1) h[A].l(f); - t = claim_space$4(f), r = claim_element$5(f, "DIV", { class: !0 }); + t = claim_space$5(f), r = claim_element$5(f, "DIV", { class: !0 }); var y = children$4(r); d && d.l(y), y.forEach(detach$6), f.forEach(detach$6), this.h(); }, @@ -44234,7 +44255,7 @@ function create_fragment$6(n) { p(v, f) { if (f[0] & /*vals, showCovModVals, updateMol, dispatch, metals, handleMessage, labels, colorCode*/ 12773) { - s = ensure_array_like$1( + s = ensure_array_like$2( /*vals*/ v[0] ); @@ -44248,7 +44269,7 @@ function create_fragment$6(n) { check_outros$4(); } /*covMods*/ - v[1].length > 0 ? d ? d.p(v, f) : (d = create_if_block$4(v), d.c(), d.m(r, null)) : d && (d.d(1), d = null); + 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); }, i(v) { if (!a) { @@ -44264,7 +44285,7 @@ function create_fragment$6(n) { a = !1; }, d(v) { - v && detach$6(e), destroy_each$1(h, v), d && d.d(); + v && detach$6(e), destroy_each$2(h, v), d && d.d(); } }; } @@ -44358,7 +44379,7 @@ function instance$6(n, e, t) { 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 g(H) { + function p(H) { fetch(`https://files.rcsb.org/ligands/download/${H.detail.text}_ideal.sdf`).then((Q) => { if (!Q.ok) throw new Error("Network response was not ok"); @@ -44373,7 +44394,7 @@ function instance$6(n, e, t) { alert("Error fetching sdf file"); }); } - const p = (H, Q) => { + 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 }); @@ -44385,12 +44406,12 @@ function instance$6(n, e, t) { function k(H) { s[H].protein = select_value(this), t(1, s), t(3, f), t(0, a); } - const L = () => r("updateCovMod", s); - function $(H) { + 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 O(H) { + function F(H) { s[H].atom = select_value(this), t(1, s), t(3, f), t(0, a); } const R = () => r("updateCovMod", s); @@ -44429,18 +44450,18 @@ function instance$6(n, e, t) { m, l, u, - g, p, + g, b, c, _, E, w, k, - L, $, + L, z, - O, + F, R, P, U, @@ -44462,27 +44483,27 @@ const { check_outros: check_outros$3, claim_component: claim_component$3, claim_element: claim_element$4, - claim_space: claim_space$3, + claim_space: claim_space$4, create_component: create_component$3, destroy_component: destroy_component$3, detach: detach$5, element: element$4, - empty: empty$2, + empty: empty$3, flush: flush$1, - get_svelte_dataset, + get_svelte_dataset: get_svelte_dataset$1, group_outros: group_outros$3, init: init$5, insert_hydration: insert_hydration$5, mount_component: mount_component$3, noop: noop$5, safe_not_equal: safe_not_equal$6, - space: space$3, + space: space$4, transition_in: transition_in$3, transition_out: transition_out$3 } = window.__gradio__svelte__internal, { tick: tick$2 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2, onMount: onMount$3, afterUpdate: afterUpdate$1 } = window.__gradio__svelte__internal; -function create_if_block$3(n) { +function create_if_block$4(n) { let e, t, r, a; - const s = [create_if_block_1$2, create_else_block$2], h = []; + const s = [create_if_block_1$3, create_else_block$3], h = []; function o(d, v) { return ( /*vals*/ @@ -44491,10 +44512,10 @@ function create_if_block$3(n) { } return e = o(n), t = h[e] = s[e](n), { c() { - t.c(), r = empty$2(); + t.c(), r = empty$3(); }, l(d) { - t.l(d), r = empty$2(); + t.l(d), r = empty$3(); }, m(d, v) { h[e].m(d, v), insert_hydration$5(d, r, v), a = !0; @@ -44516,7 +44537,7 @@ function create_if_block$3(n) { } }; } -function create_else_block$2(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; return o = new SearchInput({ props: { database: "rcsb-bioass" } }), o.$on( "triggerFetch", @@ -44524,10 +44545,10 @@ function create_else_block$2(n) { n[2] ), { c() { - e = element$4("div"), e.textContent = t, r = space$3(), a = element$4("div"), a.textContent = s, h = space$3(), create_component$3(o.$$.fragment), d = space$3(), 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(), v = element$4("div"), v.textContent = f, this.h(); }, l(A) { - e = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset(e) !== "svelte-1vyb54w" && (e.textContent = t), r = claim_space$3(A), a = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset(a) !== "svelte-15ru6yv" && (a.textContent = s), h = claim_space$3(A), claim_component$3(o.$$.fragment, A), d = claim_space$3(A), v = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset(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), v = claim_element$4(A, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(v) !== "svelte-17yf25u" && (v.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"); @@ -44547,7 +44568,7 @@ function create_else_block$2(n) { } }; } -function create_if_block_1$2(n) { +function create_if_block_1$3(n) { let e, t; return e = new Accordion({ props: { @@ -44608,7 +44629,7 @@ function create_if_block_1$2(n) { function create_fragment$5(n) { let e, t, r, a = ( /*vals*/ - n[0] != null && create_if_block$3(n) + n[0] != null && create_if_block$4(n) ); return t = new Button({ props: { vals: ( /*vals*/ @@ -44623,10 +44644,10 @@ function create_fragment$5(n) { n[6] ), { c() { - a && a.c(), e = space$3(), create_component$3(t.$$.fragment); + a && a.c(), e = space$4(), create_component$3(t.$$.fragment); }, l(s) { - a && a.l(s), e = claim_space$3(s), claim_component$3(t.$$.fragment, s); + a && a.l(s), e = claim_space$4(s), claim_component$3(t.$$.fragment, s); }, m(s, h) { a && a.m(s, h), insert_hydration$5(s, e, h), mount_component$3(t, s, h), r = !0; @@ -44634,7 +44655,7 @@ function create_fragment$5(n) { p(s, [h]) { /*vals*/ s[0] != null ? a ? (a.p(s, h), h & /*vals*/ - 1 && transition_in$3(a, 1)) : (a = create_if_block$3(s), a.c(), transition_in$3(a, 1), a.m(e.parentNode, e)) : a && (group_outros$3(), transition_out$3(a, 1, 1, () => { + 1 && transition_in$3(a, 1)) : (a = create_if_block$4(s), a.c(), transition_in$3(a, 1), a.m(e.parentNode, e)) : a && (group_outros$3(), transition_out$3(a, 1, 1, () => { a = null; }), check_outros$3()); const o = {}; @@ -44742,84 +44763,84 @@ function instance$5(n, e, t) { let { value: r = { chains: [], covMods: [] } } = e; const a = createEventDispatcher$2(); let s = ["ZN", "MG", "CA", "FE", "NA", "K", "CL", "CU", "MN", "CO", "NI"]; - async function h(l) { - let u = l.detail.text; - u = u.toLowerCase(); - let g = await importBioAssembly(u), p = [], b = ""; - await Promise.all(g.map(async (c) => { - if (["DNA", "RNA", "protein"].includes(c.class)) - for (let _ = 0; _ < c.count; _++) - b = nextChainTemp(b), p.push({ - class: c.class, + async function h(u) { + 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++) + c = nextChainTemp(c), b.push({ + class: _.class, name: "", smiles: "", sdf: "", - sequence: c.entityInfo, + sequence: _.entityInfo, open: !1, - chain: b + chain: c }), await tick$2(); - else if (c.class === "ligand") { - let _ = "", E = ""; - s.includes(c.entityInfo) ? _ = c.entityInfo : E = await getSDF(c.entityInfo); - for (let w = 0; w < c.count; w++) - b = nextChainTemp(b), p.push({ - class: c.class, - name: _, + else if (_.class === "ligand") { + let E = "", w = ""; + s.includes(_.entityInfo) ? E = _.entityInfo : w = await getSDF(_.entityInfo); + for (let k = 0; k < _.count; k++) + c = nextChainTemp(c), b.push({ + class: _.class, + name: E, smiles: "", - sdf: E, + sdf: w, sequence: "", open: !1, - chain: b + chain: c }); await tick$2(); } - })), t(0, o = p), a("updateVals", o); + })), t(0, o = b), a("updateVals", o); } let o = [], d = []; - function v(l) { - l.detail.sequence !== void 0 && t(0, o[l.detail.index].sequence = l.detail.sequence, o), l.detail.name !== void 0 && (t(0, o[l.detail.index].name = l.detail.name, o), t(0, o[l.detail.index].open = l.detail.open, o), t(0, o[l.detail.index].sdf = "", o), t(0, o[l.detail.index].smiles = "", o)), l.detail.smiles !== void 0 && (t(0, o[l.detail.index].smiles = l.detail.smiles, o), t(0, o[l.detail.index].sdf = "", o), t(0, o[l.detail.index].name = "", o)), l.detail.sdf !== void 0 && (l.detail.close == !0 && t(0, o[l.detail.index].open = !1, o), t(0, o[l.detail.index].sdf = l.detail.sdf, o), t(0, o[l.detail.index].name = "", o), t(0, o[l.detail.index].smiles = "", o)), a("updateVals", o); + 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 f() { - let l = "A"; + let u = "A"; for (let g of o) - g.chain > l && (l = g.chain); - let u = ""; - if (l < "Z") - u = String.fromCharCode(l.charCodeAt(0) + 1); + g.chain > u && (u = g.chain); + let p = ""; + if (u < "Z") + p = String.fromCharCode(u.charCodeAt(0) + 1); else { - let g = l.slice(-1); - g < "Z" ? u = l.slice(0, -1) + String.fromCharCode(g.charCodeAt(0) + 1) : u = l + "A"; + let g = u.slice(-1); + g < "Z" ? p = u.slice(0, -1) + String.fromCharCode(g.charCodeAt(0) + 1) : p = u + "A"; } - return u; + return p; } - function y(l) { - let u = f(); + function y(u) { + let p = f(); o.push({ - class: l.detail.type, + class: u.detail.type, name: "", smiles: "", sdf: "", sequence: "", open: !0, - chain: u - }), t(0, o); + chain: p + }), t(0, o), t(10, l), t(9, r); } - function A(l) { - o.splice(l.detail, 1), t(0, o), a("updateVals", o); + function A(u) { + o.splice(u.detail, 1), t(0, o), t(10, l), t(9, r), a("updateVals", o); } - function x(l) { - let u = o.find((b) => b.class === "protein").chain; - if (u === void 0) { + function x(u) { + let p = o.find((c) => c.class === "protein").chain; + if (p === void 0) { alert("Please add a protein chain first"); return; } - let g = o.find((b) => b.class === "ligand").chain; + let g = o.find((c) => c.class === "ligand").chain; if (g === void 0) { alert("Please add a ligand chain first"); return; } - let p = { - protein: u, + let b = { + protein: p, residue: "1", atom: "N", protein_symmetry: "CW", @@ -44828,18 +44849,23 @@ function instance$5(n, e, t) { deleteIndexes: [], ligand_symmetry: "CW" }; - d.push(p), t(1, d), t(0, o), a("updateCovMod", d); + d.push(b), t(1, d), t(10, l), t(9, r), t(0, o), t(10, l), t(9, r), a("updateCovMod", d); } - function M(l) { - d.splice(l.detail, 1), t(1, d); + function M(u) { + d.splice(u.detail, 1), t(1, d), t(10, l), t(9, r); } - function m(l) { - t(1, d = l.detail), a("updateCovMod", d); + function m(u) { + t(1, d = u.detail), a("updateCovMod", d); } - return onMount$3(async () => { + onMount$3(async () => { t(0, o = r.chains), t(1, d = r.covMods); - }), n.$$set = (l) => { - "value" in l && t(9, r = l.value); + }); + let l = r; + return n.$$set = (u) => { + "value" in u && t(9, r = u.value); + }, n.$$.update = () => { + n.$$.dirty & /*old_value, value*/ + 1536 && JSON.stringify(l) !== JSON.stringify(r) && (t(0, o = r.chains), t(1, d = r.covMods), t(10, l = r)); }, [ o, d, @@ -44850,7 +44876,8 @@ function instance$5(n, e, t) { x, M, m, - r + r, + l ]; } class SequenceInput extends SvelteComponent$5 { @@ -44958,8 +44985,8 @@ function spring(n, e = {}) { let h, o, d, v = n, f = n, y = 1, A = 0, x = !1; function M(l, u = {}) { f = l; - const g = 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((p) => { + 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) => { if (x) return x = !1, o = null, !1; y = Math.min(y + A, 1); @@ -44967,12 +44994,12 @@ function spring(n, e = {}) { inv_mass: y, opts: m, settled: !0, - dt: (p - h) * 60 / 1e3 + dt: (g - h) * 60 / 1e3 }, c = tick_spring(b, v, n, f); - return h = p, v = n, t.set(n = c), b.settled && (o = null), !b.settled; - })), new Promise((p) => { + return h = g, v = n, t.set(n = c), b.settled && (o = null), !b.settled; + })), new Promise((g) => { o.promise.then(() => { - g === d && p(); + p === d && g(); }); })); } @@ -45117,16 +45144,16 @@ const { children: children$2, claim_component: claim_component$2, claim_element: claim_element$2, - claim_space: claim_space$2, + claim_space: claim_space$3, claim_text: claim_text$3, create_component: create_component$2, create_slot, destroy_component: destroy_component$2, - destroy_each, + destroy_each: destroy_each$1, detach: detach$3, element: element$2, - empty: empty$1, - ensure_array_like, + empty: empty$2, + ensure_array_like: ensure_array_like$1, get_all_dirty_from_scope, get_slot_changes, group_outros: group_outros$2, @@ -45137,14 +45164,14 @@ const { safe_not_equal: safe_not_equal$3, set_data: set_data$3, set_style, - space: space$2, + space: space$3, text: text$4, toggle_class: toggle_class$2, transition_in: transition_in$2, transition_out: transition_out$2, update_slot_base } = window.__gradio__svelte__internal, { tick: tick$1 } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1 } = window.__gradio__svelte__internal, get_error_slot_changes = (n) => ({}), get_error_slot_context = (n) => ({}), get_additional_loading_text_slot_changes = (n) => ({}), get_additional_loading_text_slot_context = (n) => ({}); -function get_each_context(n, e, t) { +function get_each_context$1(n, e, t) { const r = n.slice(); return r[40] = e[t], r[42] = t, r; } @@ -45183,14 +45210,14 @@ function create_if_block_17(n) { ); return { c() { - e = element$2("div"), create_component$2(t.$$.fragment), r = space$2(), a = element$2("span"), h = text$4(s), o = space$2(), f && f.c(), this.h(); + e = element$2("div"), create_component$2(t.$$.fragment), r = space$3(), a = element$2("span"), h = text$4(s), o = space$3(), f && f.c(), this.h(); }, l(y) { e = claim_element$2(y, "DIV", { class: !0 }); var A = children$2(e); - claim_component$2(t.$$.fragment, A), A.forEach(detach$3), r = claim_space$2(y), a = claim_element$2(y, "SPAN", { class: !0 }); + claim_component$2(t.$$.fragment, A), A.forEach(detach$3), r = claim_space$3(y), a = claim_element$2(y, "SPAN", { class: !0 }); var x = children$2(a); - h = claim_text$3(x, s), x.forEach(detach$3), o = claim_space$2(y), f && f.l(y), this.h(); + 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"); @@ -45235,54 +45262,54 @@ function create_if_block_17(n) { } }; } -function create_if_block$2(n) { +function create_if_block$3(n) { let e, t, r, a, s, h, o, d, v, f = ( /*variant*/ n[8] === "default" && /*show_eta_bar*/ n[18] && /*show_progress*/ n[6] === "full" && create_if_block_16(n) ); - function y(p, b) { + function y(g, b) { if ( /*progress*/ - p[7] + g[7] ) return create_if_block_11; if ( /*queue_position*/ - p[2] !== null && /*queue_size*/ - p[3] !== void 0 && /*queue_position*/ - p[2] >= 0 + g[2] !== null && /*queue_size*/ + g[3] !== void 0 && /*queue_position*/ + g[2] >= 0 ) return create_if_block_14; if ( /*queue_position*/ - p[2] === 0 + g[2] === 0 ) return create_if_block_15; } let A = y(n), x = A && A(n), M = ( /*timer*/ n[5] && create_if_block_10(n) ); - const m = [create_if_block_2$1, create_if_block_9], l = []; - function u(p, b) { + const m = [create_if_block_2$2, create_if_block_9], l = []; + function u(g, b) { return ( /*last_progress_level*/ - p[15] != null ? 0 : ( + g[15] != null ? 0 : ( /*show_progress*/ - p[6] === "full" ? 1 : -1 + g[6] === "full" ? 1 : -1 ) ); } ~(s = u(n)) && (h = l[s] = m[s](n)); - let g = !/*timer*/ - n[5] && create_if_block_1$1(n); + let p = !/*timer*/ + n[5] && create_if_block_1$2(n); return { c() { - f && f.c(), e = space$2(), t = element$2("div"), x && x.c(), r = space$2(), M && M.c(), a = space$2(), h && h.c(), o = space$2(), g && g.c(), d = empty$1(), this.h(); + f && f.c(), e = space$3(), t = element$2("div"), x && x.c(), r = space$3(), M && M.c(), a = space$3(), h && h.c(), o = space$3(), p && p.c(), d = empty$2(), this.h(); }, - l(p) { - f && f.l(p), e = claim_space$2(p), t = claim_element$2(p, "DIV", { class: !0 }); + l(g) { + f && f.l(g), e = claim_space$3(g), t = claim_element$2(g, "DIV", { class: !0 }); var b = children$2(t); - x && x.l(b), r = claim_space$2(b), M && M.l(b), b.forEach(detach$3), a = claim_space$2(p), h && h.l(p), o = claim_space$2(p), g && g.l(p), d = empty$1(), this.h(); + 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( @@ -45297,44 +45324,44 @@ function create_if_block$2(n) { n[8] === "default" ); }, - m(p, b) { - f && f.m(p, b), insert_hydration$3(p, e, b), insert_hydration$3(p, t, b), x && x.m(t, null), append_hydration$2(t, r), M && M.m(t, null), insert_hydration$3(p, a, b), ~s && l[s].m(p, b), insert_hydration$3(p, o, b), g && g.m(p, b), insert_hydration$3(p, d, b), v = !0; + 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; }, - p(p, b) { + p(g, b) { /*variant*/ - p[8] === "default" && /*show_eta_bar*/ - p[18] && /*show_progress*/ - p[6] === "full" ? f ? f.p(p, b) : (f = create_if_block_16(p), f.c(), f.m(e.parentNode, e)) : f && (f.d(1), f = null), A === (A = y(p)) && x ? x.p(p, b) : (x && x.d(1), x = A && A(p), x && (x.c(), x.m(t, r))), /*timer*/ - p[5] ? M ? M.p(p, b) : (M = create_if_block_10(p), M.c(), M.m(t, null)) : M && (M.d(1), M = null), (!v || b[0] & /*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*/ 256) && toggle_class$2( t, "meta-text-center", /*variant*/ - p[8] === "center" + g[8] === "center" ), (!v || b[0] & /*variant*/ 256) && toggle_class$2( t, "meta-text", /*variant*/ - p[8] === "default" + g[8] === "default" ); let c = s; - s = u(p), s === c ? ~s && l[s].p(p, b) : (h && (group_outros$2(), transition_out$2(l[c], 1, 1, () => { + s = u(g), s === c ? ~s && l[s].p(g, b) : (h && (group_outros$2(), transition_out$2(l[c], 1, 1, () => { l[c] = null; - }), check_outros$2()), ~s ? (h = l[s], h ? h.p(p, b) : (h = l[s] = m[s](p), h.c()), transition_in$2(h, 1), h.m(o.parentNode, o)) : h = null), /*timer*/ - p[5] ? g && (group_outros$2(), transition_out$2(g, 1, 1, () => { - g = null; - }), check_outros$2()) : g ? (g.p(p, b), b[0] & /*timer*/ - 32 && transition_in$2(g, 1)) : (g = create_if_block_1$1(p), g.c(), transition_in$2(g, 1), g.m(d.parentNode, d)); + }), check_outros$2()), ~s ? (h = l[s], h ? h.p(g, b) : (h = l[s] = m[s](g), h.c()), transition_in$2(h, 1), h.m(o.parentNode, o)) : h = null), /*timer*/ + g[5] ? p && (group_outros$2(), transition_out$2(p, 1, 1, () => { + p = null; + }), check_outros$2()) : p ? (p.p(g, b), b[0] & /*timer*/ + 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(p) { - v || (transition_in$2(h), transition_in$2(g), v = !0); + i(g) { + v || (transition_in$2(h), transition_in$2(p), v = !0); }, - o(p) { - transition_out$2(h), transition_out$2(g), v = !1; + o(g) { + transition_out$2(h), transition_out$2(p), v = !1; }, - d(p) { - p && (detach$3(e), detach$3(t), detach$3(a), detach$3(o), detach$3(d)), f && f.d(p), x && x.d(), M && M.d(), ~s && l[s].d(p), g && g.d(p); + 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); } }; } @@ -45420,7 +45447,7 @@ function create_if_block_14(n) { }; } function create_if_block_11(n) { - let e, t = ensure_array_like( + let e, t = ensure_array_like$1( /*progress*/ n[7] ), r = []; @@ -45430,12 +45457,12 @@ function create_if_block_11(n) { c() { for (let a = 0; a < r.length; a += 1) r[a].c(); - e = empty$1(); + e = empty$2(); }, l(a) { for (let s = 0; s < r.length; s += 1) r[s].l(a); - e = empty$1(); + e = empty$2(); }, m(a, s) { for (let h = 0; h < r.length; h += 1) @@ -45445,7 +45472,7 @@ function create_if_block_11(n) { p(a, s) { if (s[0] & /*progress*/ 128) { - t = ensure_array_like( + t = ensure_array_like$1( /*progress*/ a[7] ); @@ -45460,7 +45487,7 @@ function create_if_block_11(n) { } }, d(a) { - a && detach$3(e), destroy_each(r, a); + a && detach$3(e), destroy_each$1(r, a); } }; } @@ -45472,16 +45499,16 @@ function create_if_block_12(n) { function o(f, y) { return ( /*p*/ - f[40].length != null ? create_if_block_13 : create_else_block$1 + f[40].length != null ? create_if_block_13 : create_else_block$2 ); } let d = o(n), v = d(n); return { c() { - v.c(), e = space$2(), r = text$4(t), a = text$4(" | "), h = text$4(s); + v.c(), e = space$3(), r = text$4(t), a = text$4(" | "), h = text$4(s); }, l(f) { - v.l(f), e = claim_space$2(f), r = claim_text$3(f, t), a = claim_text$3(f, " | "), h = claim_text$3(f, s); + 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); }, 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); @@ -45496,7 +45523,7 @@ function create_if_block_12(n) { } }; } -function create_else_block$1(n) { +function create_else_block$2(n) { let e = pretty_si( /*p*/ n[40].index || 0 @@ -45564,10 +45591,10 @@ function create_each_block_1(n) { ); return { c() { - t && t.c(), e = empty$1(); + t && t.c(), e = empty$2(); }, l(r) { - t && t.l(r), e = empty$1(); + t && t.l(r), e = empty$2(); }, m(r, a) { t && t.m(r, a), insert_hydration$3(r, e, a); @@ -45654,22 +45681,22 @@ function create_if_block_9(n) { } }; } -function create_if_block_2$1(n) { +function create_if_block_2$2(n) { let e, t, r, a, s, h = `${/*last_progress_level*/ n[15] * 100}%`, o = ( /*progress*/ - n[7] != null && create_if_block_3$1(n) + n[7] != null && create_if_block_3$2(n) ); return { c() { - e = element$2("div"), t = element$2("div"), o && o.c(), r = space$2(), a = element$2("div"), s = element$2("div"), this.h(); + e = element$2("div"), t = element$2("div"), o && o.c(), r = space$3(), a = element$2("div"), s = element$2("div"), this.h(); }, l(d) { e = claim_element$2(d, "DIV", { class: !0 }); var v = children$2(e); t = claim_element$2(v, "DIV", { class: !0 }); var f = children$2(t); - o && o.l(f), f.forEach(detach$3), r = claim_space$2(v), a = claim_element$2(v, "DIV", { class: !0 }); + o && o.l(f), f.forEach(detach$3), r = claim_space$3(v), a = claim_element$2(v, "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(); }, @@ -45681,7 +45708,7 @@ function create_if_block_2$1(n) { }, p(d, v) { /*progress*/ - d[7] != null ? o ? o.p(d, v) : (o = create_if_block_3$1(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, 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*/ 32768 && h !== (h = `${/*last_progress_level*/ d[15] * 100}%`) && set_style(s, "width", h); }, @@ -45692,23 +45719,23 @@ function create_if_block_2$1(n) { } }; } -function create_if_block_3$1(n) { - let e, t = ensure_array_like( +function create_if_block_3$2(n) { + let e, t = ensure_array_like$1( /*progress*/ n[7] ), r = []; for (let a = 0; a < t.length; a += 1) - r[a] = create_each_block(get_each_context(n, t, a)); + r[a] = create_each_block$1(get_each_context$1(n, t, a)); return { c() { for (let a = 0; a < r.length; a += 1) r[a].c(); - e = empty$1(); + e = empty$2(); }, l(a) { for (let s = 0; s < r.length; s += 1) r[s].l(a); - e = empty$1(); + e = empty$2(); }, m(a, s) { for (let h = 0; h < r.length; h += 1) @@ -45718,14 +45745,14 @@ function create_if_block_3$1(n) { p(a, s) { if (s[0] & /*progress_level, progress*/ 16512) { - t = ensure_array_like( + t = ensure_array_like$1( /*progress*/ a[7] ); let h; for (h = 0; h < t.length; h += 1) { - const o = get_each_context(a, t, h); - r[h] ? r[h].p(o, s) : (r[h] = create_each_block(o), r[h].c(), r[h].m(e.parentNode, e)); + const o = get_each_context$1(a, t, h); + r[h] ? r[h].p(o, s) : (r[h] = create_each_block$1(o), r[h].c(), r[h].m(e.parentNode, e)); } for (; h < r.length; h += 1) r[h].d(1); @@ -45733,11 +45760,11 @@ function create_if_block_3$1(n) { } }, d(a) { - a && detach$3(e), destroy_each(r, a); + a && detach$3(e), destroy_each$1(r, a); } }; } -function create_if_block_4$1(n) { +function create_if_block_4$2(n) { let e, t, r, a, s = ( /*i*/ n[42] !== 0 && create_if_block_8() @@ -45754,14 +45781,14 @@ function create_if_block_4$1(n) { ] != null && create_if_block_6() ), d = ( /*progress_level*/ - n[14] != null && create_if_block_5$1(n) + n[14] != null && create_if_block_5$2(n) ); return { c() { - s && s.c(), e = space$2(), h && h.c(), t = space$2(), o && o.c(), r = space$2(), d && d.c(), a = empty$1(); + 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$2(v), h && h.l(v), t = claim_space$2(v), o && o.l(v), r = claim_space$2(v), d && d.l(v), a = empty$1(); + 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(); }, 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); @@ -45775,7 +45802,7 @@ function create_if_block_4$1(n) { /*i*/ v[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$1(v), d.c(), d.m(a.parentNode, a)) : d && (d.d(1), d = null); + 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); }, 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); @@ -45841,7 +45868,7 @@ function create_if_block_6(n) { } }; } -function create_if_block_5$1(n) { +function create_if_block_5$2(n) { let e = (100 * /*progress_level*/ (n[14][ /*i*/ @@ -45870,7 +45897,7 @@ function create_if_block_5$1(n) { } }; } -function create_each_block(n) { +function create_each_block$1(n) { let e, t = ( /*p*/ (n[40].desc != null || /*progress_level*/ @@ -45878,14 +45905,14 @@ function create_each_block(n) { n[14][ /*i*/ n[42] - ] != null) && create_if_block_4$1(n) + ] != null) && create_if_block_4$2(n) ); return { c() { - t && t.c(), e = empty$1(); + t && t.c(), e = empty$2(); }, l(r) { - t && t.l(r), e = empty$1(); + t && t.l(r), e = empty$2(); }, m(r, a) { t && t.m(r, a), insert_hydration$3(r, e, a); @@ -45897,14 +45924,14 @@ function create_each_block(n) { r[14][ /*i*/ r[42] - ] != null ? t ? t.p(r, a) : (t = create_if_block_4$1(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + ] != null ? t ? t.p(r, a) : (t = create_if_block_4$2(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(r) { r && detach$3(e), t && t.d(r); } }; } -function create_if_block_1$1(n) { +function create_if_block_1$2(n) { let e, t, r, a; const s = ( /*#slots*/ @@ -45921,7 +45948,7 @@ function create_if_block_1$1(n) { e = element$2("p"), t = text$4( /*loading_text*/ n[9] - ), r = space$2(), h && h.c(), this.h(); + ), r = space$3(), h && h.c(), this.h(); }, l(o) { e = claim_element$2(o, "P", { class: !0 }); @@ -45930,7 +45957,7 @@ function create_if_block_1$1(n) { d, /*loading_text*/ n[9] - ), d.forEach(detach$3), r = claim_space$2(o), h && h.l(o), this.h(); + ), d.forEach(detach$3), r = claim_space$3(o), h && h.l(o), this.h(); }, h() { attr$2(e, "class", "loading svelte-17v219f"); @@ -45977,7 +46004,7 @@ function create_if_block_1$1(n) { } function create_fragment$3(n) { let e, t, r, a, s; - const h = [create_if_block$2, create_if_block_17], o = []; + const h = [create_if_block$3, create_if_block_17], o = []; function d(v, f) { return ( /*status*/ @@ -46118,17 +46145,17 @@ 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: g = "Loading..." } = e, { absolute: p = !0 } = e, { translucent: b = !1 } = e, { border: c = !1 } = e, { autoscroll: _ } = e, E, w = !1, k = 0, L = 0, $ = null, z = null, O = 0, R = null, P, U = null, N = !0; + 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, $ = t(19, G = null))), t(25, k = performance.now()), t(26, L = 0), w = !0, W(); + t(0, d = t(27, L = t(19, G = null))), t(25, k = performance.now()), t(26, $ = 0), w = !0, W(); }; function W() { raf(() => { - t(26, L = (performance.now() - k) / 1e3), w && W(); + t(26, $ = (performance.now() - k) / 1e3), w && W(); }); } function V() { - t(26, L = 0), t(0, d = t(27, $ = t(19, G = null))), w && (w = !1); + t(26, $ = 0), t(0, d = t(27, L = t(19, G = null))), w && (w = !1); } onDestroy(() => { w && V(); @@ -46148,11 +46175,11 @@ function instance$3(n, e, t) { }); } 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, g = ee.loading_text), "absolute" in ee && t(10, p = 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); + "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); }, n.$$.update = () => { n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 436207617 && (d === null && t(0, d = $), d != null && $ !== d && (t(28, z = (performance.now() - k) / 1e3 + d), t(19, G = z.toFixed(1)), t(27, $ = d))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 335544320 && t(17, O = z === null || z <= 0 || !L ? null : Math.min(L / z, 1)), n.$$.dirty[0] & /*progress*/ + 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) @@ -46163,7 +46190,7 @@ function instance$3(n, e, t) { 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*/ 8388624, n.$$.dirty[0] & /*timer_diff*/ - 67108864 && t(20, r = L.toFixed(1)); + 67108864 && t(20, r = $.toFixed(1)); }, [ d, o, @@ -46174,15 +46201,15 @@ function instance$3(n, e, t) { M, l, u, - g, p, + g, b, c, E, R, P, U, - O, + F, N, G, r, @@ -46191,8 +46218,8 @@ function instance$3(n, e, t) { m, _, k, - L, $, + L, z, s, a, @@ -46392,7 +46419,7 @@ function createDOMPurify() { HTMLFormElement: y, DOMParser: A, trustedTypes: x - } = n, M = d.prototype, m = lookupGetter(M, "cloneNode"), l = lookupGetter(M, "remove"), u = lookupGetter(M, "nextSibling"), g = lookupGetter(M, "childNodes"), p = lookupGetter(M, "parentNode"); + } = n, M = d.prototype, m = lookupGetter(M, "cloneNode"), l = lookupGetter(M, "remove"), u = lookupGetter(M, "nextSibling"), p = lookupGetter(M, "childNodes"), g = lookupGetter(M, "parentNode"); if (typeof h == "function") { const qe = t.createElement("template"); qe.content && qe.content.ownerDocument && (t = qe.content.ownerDocument); @@ -46404,13 +46431,13 @@ function createDOMPurify() { createDocumentFragment: w, getElementsByTagName: k } = t, { - importNode: L + importNode: $ } = r; - let $ = {}; - e.isSupported = typeof entries == "function" && typeof p == "function" && _ && _.createHTMLDocument !== void 0; + let L = {}; + e.isSupported = typeof entries == "function" && typeof g == "function" && _ && _.createHTMLDocument !== void 0; const { MUSTACHE_EXPR: z, - ERB_EXPR: O, + ERB_EXPR: F, TMPLIT_EXPR: R, DATA_ATTR: P, ARIA_ATTR: U, @@ -46443,7 +46470,7 @@ 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, Fe = !1, Be = !1, Ue = !1, Pe = !0, Ge = !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; 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"]); @@ -46454,7 +46481,7 @@ function createDOMPurify() { let ae = K, ge = !1, xe = null; const ue = addToSet({}, [ze, ke, K], stringToString); let Ce = null; - const Z = ["application/xhtml+xml", "text/html"], Oe = "text/html"; + const Z = ["application/xhtml+xml", "text/html"], Fe = "text/html"; let We = null, I = null; const we = t.createElement("form"), ve = function(be) { return be instanceof RegExp || be instanceof Function; @@ -46462,7 +46489,7 @@ function createDOMPurify() { 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 ? Oe : 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( + 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( clone(me), // eslint-disable-line indent be.ADD_URI_SAFE_ATTR, @@ -46476,7 +46503,7 @@ function createDOMPurify() { // 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, Fe = 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 && (Fe = !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) { + ) : 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) { 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") @@ -46487,7 +46514,7 @@ function createDOMPurify() { freeze && freeze(be), I = 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) { - let Ve = p(be); + let Ve = g(be); (!Ve || !Ve.tagName) && (Ve = { namespaceURI: ae, tagName: "template" @@ -46499,7 +46526,7 @@ function createDOMPurify() { element: be }); try { - p(be).removeChild(be); + g(be).removeChild(be); } catch { l(be); } @@ -46516,7 +46543,7 @@ function createDOMPurify() { }); } if (Ve.removeAttribute(be), be === "is" && !Q[be]) - if (Fe || Be) + if (Oe || Be) try { wt(Ve); } catch { @@ -46562,16 +46589,16 @@ function createDOMPurify() { 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; - }, Lt = function(be, Ve, et) { - $[be] && arrayForEach($[be], (_t) => { + }, $t = function(be, Ve, et) { + L[be] && arrayForEach(L[be], (_t) => { _t.call(e, Ve, et, I); }); }, Pt = function(be) { let Ve = null; - if (Lt("beforeSanitizeElements", be, null), Mt(be)) + if ($t("beforeSanitizeElements", be, null), Mt(be)) return wt(be), !0; const et = We(be.nodeName); - if (Lt("uponSanitizeElement", be, { + if ($t("uponSanitizeElement", be, { tagName: et, allowedTags: G }), 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)) @@ -46580,22 +46607,22 @@ function createDOMPurify() { if (!ce[et] && St(et) && (ee.tagNameCheck instanceof RegExp && regExpTest(ee.tagNameCheck, et) || ee.tagNameCheck instanceof Function && ee.tagNameCheck(et))) return !1; if (Re && !Xe[et]) { - const _t = p(be) || be.parentNode, kt = g(be) || be.childNodes; + const _t = g(be) || be.parentNode, kt = p(be) || be.childNodes; if (kt && _t) { const Tt = kt.length; - for (let $t = Tt - 1; $t >= 0; --$t) { - const It = m(kt[$t], !0); + 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)); } } } 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, O, 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([z, F, R], (_t) => { Ve = stringReplace(Ve, _t, " "); }), be.textContent !== Ve && (arrayPush(e.removed, { element: be.cloneNode() - }), be.textContent = Ve)), Lt("afterSanitizeElements", be, null), !1); + }), be.textContent = Ve)), $t("afterSanitizeElements", be, null), !1); }, Et = function(be, Ve, et) { if (Pe && (Ve === "id" || Ve === "name") && (et in t || et in we)) return !1; @@ -46626,7 +46653,7 @@ function createDOMPurify() { }, St = function(be) { return be !== "annotation-xml" && stringMatch(be, W); }, yt = function(be) { - Lt("beforeSanitizeAttributes", be, null); + $t("beforeSanitizeAttributes", be, null); const { attributes: Ve } = be; @@ -46642,49 +46669,49 @@ function createDOMPurify() { for (; _t--; ) { const kt = Ve[_t], { name: Tt, - namespaceURI: $t, + namespaceURI: Lt, value: It } = kt, Ht = We(Tt); - let Ot = Tt === "value" ? It : stringTrim(It); - if (et.attrName = Ht, et.attrValue = Ot, et.keepAttr = !0, et.forceKeepAttr = void 0, Lt("uponSanitizeAttribute", be, et), Ot = et.attrValue, et.forceKeepAttr || (st(Tt, be), !et.keepAttr)) + 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)) continue; - if (!Se && regExpTest(/\/>/i, Ot)) { + if (!Se && regExpTest(/\/>/i, Ft)) { st(Tt, be); continue; } - Ie && arrayForEach([z, O, R], (wr) => { - Ot = stringReplace(Ot, wr, " "); + Ie && arrayForEach([z, F, R], (wr) => { + Ft = stringReplace(Ft, wr, " "); }); const xr = We(be.nodeName); - if (Et(xr, Ht, Ot)) { - if (Ge && (Ht === "id" || Ht === "name") && (st(Tt, be), Ot = Ne + Ot), pe && regExpTest(/((--!?|])>)|<\/(style|title)/i, Ot)) { + 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); continue; } - if (b && typeof x == "object" && typeof x.getAttributeType == "function" && !$t) + if (b && typeof x == "object" && typeof x.getAttributeType == "function" && !Lt) switch (x.getAttributeType(xr, Ht)) { case "TrustedHTML": { - Ot = b.createHTML(Ot); + Ft = b.createHTML(Ft); break; } case "TrustedScriptURL": { - Ot = b.createScriptURL(Ot); + Ft = b.createScriptURL(Ft); break; } } try { - $t ? be.setAttributeNS($t, Tt, Ot) : be.setAttribute(Tt, Ot), Mt(be) ? wt(be) : arrayPop(e.removed); + Lt ? be.setAttributeNS(Lt, Tt, Ft) : be.setAttribute(Tt, Ft), Mt(be) ? wt(be) : arrayPop(e.removed); } catch { } } } - Lt("afterSanitizeAttributes", be, null); + $t("afterSanitizeAttributes", be, null); }, zt = function qe(be) { let Ve = null; const et = at(be); - for (Lt("beforeSanitizeShadowDOM", be, null); Ve = et.nextNode(); ) - Lt("uponSanitizeShadowNode", Ve, null), !Pt(Ve) && (Ve.content instanceof s && qe(Ve.content), yt(Ve)); - Lt("afterSanitizeShadowDOM", be, null); + 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); }; return e.sanitize = function(qe) { let be = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Ve = null, et = null, _t = null, kt = null; @@ -46705,11 +46732,11 @@ function createDOMPurify() { } 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 (!Fe && !Ie && !le && // eslint-disable-next-line unicorn/prefer-includes + if (!Oe && !Ie && !le && // eslint-disable-next-line unicorn/prefer-includes qe.indexOf("<") === -1) return b && Ue ? b.createHTML(qe) : qe; if (Ve = ot(qe), !Ve) - return Fe ? null : Ue ? c : ""; + return Oe ? null : Ue ? c : ""; } Ve && Te && wt(Ve.firstChild); const Tt = at(De ? qe : Ve); @@ -46717,19 +46744,19 @@ function createDOMPurify() { Pt(_t) || (_t.content instanceof s && zt(_t.content), yt(_t)); if (De) return qe; - if (Fe) { + if (Oe) { if (Be) for (kt = w.call(Ve.ownerDocument); Ve.firstChild; ) kt.appendChild(Ve.firstChild); else kt = Ve; - return (Q.shadowroot || Q.shadowrootmode) && (kt = L.call(r, kt, !0)), kt; + return (Q.shadowroot || Q.shadowrootmode) && (kt = $.call(r, kt, !0)), kt; } - let $t = 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) && ($t = " -` + $t), Ie && arrayForEach([z, O, R], (It) => { - $t = stringReplace($t, It, " "); - }), b && Ue ? b.createHTML($t) : $t; + 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; }, e.setConfig = function() { let qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; Y(qe), ne = !0; @@ -46740,14 +46767,14 @@ function createDOMPurify() { const et = We(qe), _t = We(be); return Et(et, _t, Ve); }, e.addHook = function(qe, be) { - typeof be == "function" && ($[qe] = $[qe] || [], arrayPush($[qe], be)); + typeof be == "function" && (L[qe] = L[qe] || [], arrayPush(L[qe], be)); }, e.removeHook = function(qe) { - if ($[qe]) - return arrayPop($[qe]); + if (L[qe]) + return arrayPop(L[qe]); }, e.removeHooks = function(qe) { - $[qe] && ($[qe] = []); + L[qe] && (L[qe] = []); }, e.removeAllHooks = function() { - $ = {}; + L = {}; }, e; } createDOMPurify(); @@ -46760,36 +46787,343 @@ const { binding_callbacks: binding_callbacks$2, children: children$1, claim_element: claim_element$1, + claim_space: claim_space$2, claim_text: claim_text$2, + destroy_each, detach: detach$2, element: element$1, + empty: empty$1, + ensure_array_like, + get_svelte_dataset, init: init$2, insert_hydration: insert_hydration$2, noop: noop$1, safe_not_equal: safe_not_equal$2, set_data: set_data$2, + space: space$2, text: text$2, toggle_class: toggle_class$1 } = window.__gradio__svelte__internal, { onMount: onMount$1 } = window.__gradio__svelte__internal; -function create_fragment$2(n) { - let e, t = ( +function get_each_context(n, e, t) { + const r = n.slice(); + return r[8] = e[t], r; +} +function create_if_block$2(n) { + let e, t, r, a, s, h = ( /*value*/ - (n[0] ? ( + n[0].covMods.length + "" + ), o, d; + function v(M, m) { + return ( /*value*/ - n[0] - ) : "") + "" - ), r, a; + 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( + /*value*/ + n[0].chains + ), x = []; + for (let M = 0; M < A.length; M += 1) + x[M] = create_each_block(get_each_context(n, A, M)); return { c() { - e = element$1("div"), r = text$2(t), this.h(); + y.c(), e = space$2(), t = element$1("ul"); + for (let M = 0; M < x.length; M += 1) + x[M].c(); + r = space$2(), a = element$1("ul"), s = element$1("li"), o = text$2(h), d = text$2(" covalent modifications"); + }, + l(M) { + y.l(M), e = claim_space$2(M), t = claim_element$1(M, "UL", {}); + var m = children$1(t); + for (let p = 0; p < x.length; p += 1) + x[p].l(m); + m.forEach(detach$2), r = claim_space$2(M), a = claim_element$1(M, "UL", {}); + var l = children$1(a); + s = claim_element$1(l, "LI", {}); + var u = children$1(s); + o = claim_text$2(u, h), d = claim_text$2(u, " covalent modifications"), u.forEach(detach$2), l.forEach(detach$2); + }, + m(M, m) { + y.m(M, m), insert_hydration$2(M, e, m), insert_hydration$2(M, t, m); + for (let l = 0; l < x.length; l += 1) + x[l] && x[l].m(t, null); + 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*/ + 1) { + A = ensure_array_like( + /*value*/ + M[0].chains + ); + let l; + for (l = 0; l < A.length; l += 1) { + const u = get_each_context(M, A, l); + x[l] ? x[l].p(u, m) : (x[l] = create_each_block(u), x[l].c(), x[l].m(t, null)); + } + for (; l < x.length; l += 1) + x[l].d(1); + x.length = A.length; + } + m & /*value*/ + 1 && h !== (h = /*value*/ + M[0].covMods.length + "") && set_data$2(o, h); + }, + d(M) { + M && (detach$2(e), detach$2(t), detach$2(r), detach$2(a)), y.d(M), destroy_each(x, M); + } + }; +} +function create_else_block_1$1(n) { + let e, t, r = ( + /*value*/ + n[0].chains.length + "" + ), a, s, h; + return { + c() { + e = element$1("b"), t = text$2("Input composed of "), a = text$2(r), s = text$2(" chain "), h = element$1("br"); + }, + l(o) { + e = claim_element$1(o, "B", {}); + var d = children$1(e); + t = claim_text$2(d, "Input composed of "), a = claim_text$2(d, r), s = claim_text$2(d, " chain "), d.forEach(detach$2), h = claim_element$1(o, "BR", {}); + }, + m(o, d) { + insert_hydration$2(o, e, d), append_hydration$1(e, t), append_hydration$1(e, a), append_hydration$1(e, s), insert_hydration$2(o, h, d); + }, + p(o, d) { + d & /*value*/ + 1 && r !== (r = /*value*/ + o[0].chains.length + "") && set_data$2(a, r); + }, + d(o) { + o && (detach$2(e), detach$2(h)); + } + }; +} +function create_if_block_5$1(n) { + let e, t, r = ( + /*value*/ + n[0].chains.length + "" + ), a, s, h, o; + return { + c() { + e = element$1("b"), t = text$2("Input composed of "), a = text$2(r), s = text$2(" chains"), h = space$2(), o = element$1("br"); + }, + 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", {}); + }, + 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); + }, + p(d, v) { + v & /*value*/ + 1 && r !== (r = /*value*/ + d[0].chains.length + "") && set_data$2(a, r); + }, + d(d) { + d && (detach$2(e), detach$2(h), detach$2(o)); + } + }; +} +function create_if_block_4$1(n) { + let e, t, r = ( + /*val*/ + n[8].class + "" + ), a, s, h = ( + /*val*/ + n[8].sequence.length + "" + ), o, d; + return { + 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", {}); + 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"); + }, + 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); + }, + p(v, f) { + f & /*value*/ + 1 && r !== (r = /*val*/ + v[8].class + "") && set_data$2(a, r), f & /*value*/ + 1 && h !== (h = /*val*/ + v[8].sequence.length + "") && set_data$2(o, h); + }, + d(v) { + v && detach$2(e); + } + }; +} +function create_if_block_1$1(n) { + let e; + function t(s, h) { + return ( + /*val*/ + s[8].name != null ? create_if_block_2$1 : ( + /*val*/ + s[8].smiles != null ? create_if_block_3$1 : create_else_block$1 + ) + ); + } + let r = t(n), a = r(n); + return { + c() { + a.c(), e = empty$1(); }, l(s) { - e = claim_element$1(s, "DIV", { class: !0 }); - var h = children$1(e); - r = claim_text$2(h, t), h.forEach(detach$2), this.h(); + a.l(s), e = empty$1(); + }, + m(s, h) { + a.m(s, h), insert_hydration$2(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$2(e), a.d(s); + } + }; +} +function create_else_block$1(n) { + let e, t = '
Ligand
'; + return { + c() { + e = element$1("li"), e.innerHTML = t; + }, + l(r) { + e = claim_element$1(r, "LI", { "data-svelte-h": !0 }), get_svelte_dataset(e) !== "svelte-z73xb2" && (e.innerHTML = t); + }, + m(r, a) { + insert_hydration$2(r, e, a); + }, + p: noop$1, + d(r) { + r && detach$2(e); + } + }; +} +function create_if_block_3$1(n) { + let e, t, r, a = ( + /*val*/ + n[8].smiles.length + "" + ), s, h; + return { + c() { + e = element$1("li"), t = element$1("div"), r = text$2("Ligand SMILES with "), s = text$2(a), h = text$2(" atoms"), this.h(); + }, + l(o) { + 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(); + }, + h() { + attr$1(t, "class", "svelte-1r1gryw"); + }, + 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); + }, + p(o, d) { + d & /*value*/ + 1 && a !== (a = /*val*/ + o[8].smiles.length + "") && set_data$2(s, a); + }, + d(o) { + o && detach$2(e); + } + }; +} +function create_if_block_2$1(n) { + let e, t, r, a = ( + /*val*/ + n[8].name + "" + ), s; + return { + c() { + e = element$1("li"), t = element$1("div"), r = text$2("Ligand "), s = text$2(a), this.h(); + }, + l(h) { + e = claim_element$1(h, "LI", {}); + var o = children$1(e); + t = claim_element$1(o, "DIV", { class: !0 }); + var d = children$1(t); + 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(e, "class", "svelte-84cxb8"), add_render_callback$1(() => ( + attr$1(t, "class", "svelte-1r1gryw"); + }, + m(h, o) { + insert_hydration$2(h, e, o), append_hydration$1(e, t), append_hydration$1(t, r), append_hydration$1(t, s); + }, + p(h, o) { + o & /*value*/ + 1 && a !== (a = /*val*/ + h[8].name + "") && set_data$2(s, a); + }, + d(h) { + h && detach$2(e); + } + }; +} +function create_each_block(n) { + let e = ["protein", "DNA", "RNA"].includes( + /*val*/ + n[8].class + ), t, r, a = e && create_if_block_4$1(n), s = ( + /*val*/ + n[8].class == "ligand" && create_if_block_1$1(n) + ); + return { + c() { + a && a.c(), t = space$2(), s && s.c(), r = empty$1(); + }, + l(h) { + a && a.l(h), t = claim_space$2(h), s && s.l(h), r = empty$1(); + }, + m(h, o) { + a && a.m(h, o), insert_hydration$2(h, t, o), s && s.m(h, o), insert_hydration$2(h, r, o); + }, + p(h, o) { + o & /*value*/ + 1 && (e = ["protein", "DNA", "RNA"].includes( + /*val*/ + h[8].class + )), e ? a ? a.p(h, o) : (a = create_if_block_4$1(h), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null), /*val*/ + h[8].class == "ligand" ? s ? s.p(h, o) : (s = create_if_block_1$1(h), s.c(), s.m(r.parentNode, r)) : s && (s.d(1), s = null); + }, + d(h) { + h && (detach$2(t), detach$2(r)), a && a.d(h), s && s.d(h); + } + }; +} +function create_fragment$2(n) { + let e, t, r = ( + /*value*/ + n[0] && create_if_block$2(n) + ); + return { + c() { + e = element$1("div"), r && r.c(), this.h(); + }, + l(a) { + e = claim_element$1(a, "DIV", { class: !0 }); + var s = children$1(e); + r && r.l(s), s.forEach(detach$2), this.h(); + }, + h() { + attr$1(e, "class", "svelte-1r1gryw"), add_render_callback$1(() => ( /*div_elementresize_handler*/ n[5].call(e) )), toggle_class$1( @@ -46809,43 +47143,39 @@ function create_fragment$2(n) { n[2] ); }, - m(s, h) { - insert_hydration$2(s, e, h), append_hydration$1(e, r), a = add_iframe_resize_listener( + m(a, s) { + insert_hydration$2(a, e, s), r && r.m(e, null), t = add_iframe_resize_listener( e, /*div_elementresize_handler*/ n[5].bind(e) ), n[6](e); }, - p(s, [h]) { - h & /*value*/ - 1 && t !== (t = /*value*/ - (s[0] ? ( - /*value*/ - s[0] - ) : "") + "") && set_data$2(r, t), h & /*type*/ + p(a, [s]) { + /*value*/ + a[0] ? r ? r.p(a, s) : (r = create_if_block$2(a), r.c(), r.m(e, null)) : r && (r.d(1), r = null), s & /*type*/ 2 && toggle_class$1( e, "table", /*type*/ - s[1] === "table" - ), h & /*type*/ + a[1] === "table" + ), s & /*type*/ 2 && toggle_class$1( e, "gallery", /*type*/ - s[1] === "gallery" - ), h & /*selected*/ + a[1] === "gallery" + ), s & /*selected*/ 4 && toggle_class$1( e, "selected", /*selected*/ - s[2] + a[2] ); }, i: noop$1, o: noop$1, - d(s) { - s && detach$2(e), a(), n[6](null); + d(a) { + a && detach$2(e), r && r.d(), t(), n[6](null); } }; } @@ -47578,24 +47908,24 @@ 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: g = !0 } = e, p, 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: 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; const k = createEventDispatcher(); beforeUpdate(() => { - _ = p && p.offsetHeight + p.scrollTop > p.scrollHeight - 100; + _ = g && g.offsetHeight + g.scrollTop > g.scrollHeight - 100; }); - const L = () => { - _ && g && !w && p.scrollTo(0, p.scrollHeight); + const $ = () => { + _ && p && !w && g.scrollTo(0, g.scrollHeight); }; - function $() { + function L() { k("change", r), a || k("input"); } afterUpdate(() => { - l && p.focus(), _ && g && L(), t(21, a = !1); + l && g.focus(), _ && p && $(), t(21, a = !1); }); async function z() { - "clipboard" in navigator && (await navigator.clipboard.writeText(r), O()); + "clipboard" in navigator && (await navigator.clipboard.writeText(r), F()); } - function O() { + function F() { t(15, b = !0), c && clearTimeout(c), c = setTimeout( () => { t(15, b = !1); @@ -47604,25 +47934,25 @@ function instance$1(n, e, t) { ); } function R(ne) { - const Te = ne.target, Fe = Te.value, Be = [Te.selectionStart, Te.selectionEnd]; - k("select", { value: Fe.substring(...Be), index: Be }); + const Te = ne.target, Oe = Te.value, Be = [Te.selectionStart, Te.selectionEnd]; + k("select", { value: Oe.substring(...Be), index: Be }); } 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")); } function U(ne) { - const Te = ne.target, Fe = Te.scrollTop; - Fe < E && (w = !0), E = Fe; + const Te = ne.target, Oe = Te.scrollTop; + Oe < E && (w = !0), E = Oe; const Be = Te.scrollHeight - Te.clientHeight; - Fe >= Be && (w = !1); + Oe >= Be && (w = !1); } async function N(ne) { if (await tick(), s === A) return; - let Te = A === void 0 ? !1 : A === void 0 ? 21 * 11 : 21 * (A + 1), Fe = 21 * (s + 1); + 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 < Fe ? Ue = Fe : Ue = Be.scrollHeight, Be.style.height = `${Ue}px`; + 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())) @@ -47659,7 +47989,7 @@ function instance$1(n, e, t) { } function oe(ne) { binding_callbacks$1[ne ? "unshift" : "push"](() => { - p = ne, t(14, p); + g = ne, t(14, g); }); } function he() { @@ -47667,7 +47997,7 @@ function instance$1(n, e, t) { } function Ae(ne) { binding_callbacks$1[ne ? "unshift" : "push"](() => { - p = ne, t(14, p); + g = ne, t(14, g); }); } function Se() { @@ -47675,7 +48005,7 @@ function instance$1(n, e, t) { } function Ie(ne) { binding_callbacks$1[ne ? "unshift" : "push"](() => { - p = ne, t(14, p); + g = ne, t(14, g); }); } function pe() { @@ -47683,16 +48013,16 @@ function instance$1(n, e, t) { } function le(ne) { binding_callbacks$1[ne ? "unshift" : "push"](() => { - p = ne, t(14, p); + g = ne, 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, g = ne.autoscroll); + "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); }, n.$$.update = () => { n.$$.dirty[0] & /*value*/ 1 && r === null && t(0, r = ""), n.$$.dirty[0] & /*value, el, lines, max_lines*/ - 16643 && p && s !== A && N({ target: p }), n.$$.dirty[0] & /*value*/ - 1 && $(); + 16643 && g && s !== A && N({ target: g }), n.$$.dirty[0] & /*value*/ + 1 && L(); }, [ r, s, @@ -47708,7 +48038,7 @@ function instance$1(n, e, t) { m, l, u, - p, + g, b, z, R, @@ -47716,7 +48046,7 @@ function instance$1(n, e, t) { U, B, a, - g, + p, W, V, G, @@ -48030,20 +48360,23 @@ 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; - function m(g) { - let p = g.detail.map((b) => Object.fromEntries(Object.entries(b).filter(([c, _]) => c !== "open" && _ !== ""))); - t(0, v.chains = p, v); + function m(p) { + let g = p.detail.map((b) => Object.fromEntries(Object.entries(b).filter(([c, _]) => c !== "open" && _ !== ""))); + t(0, v.chains = g, v); } - function l(g) { - t(0, v.covMods = g.detail, v); + function l(p) { + t(0, v.covMods = p.detail, v); } onMount(() => { }); - function u(g) { - v = g, t(0, v); + function u(p) { + v = p, t(0, v); } - return n.$$set = (g) => { - "gradio" in g && t(1, r = g.gradio), "label" in g && t(2, a = g.label), "info" in g && t(3, s = g.info), "elem_id" in g && t(4, h = g.elem_id), "elem_classes" in g && t(5, o = g.elem_classes), "visible" in g && t(6, d = g.visible), "value" in g && t(0, v = g.value), "show_label" in g && t(7, f = g.show_label), "container" in g && t(8, y = g.container), "scale" in g && t(9, A = g.scale), "min_width" in g && t(10, x = g.min_width), "loading_status" in g && t(11, M = g.loading_status); + 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); + }, n.$$.update = () => { + n.$$.dirty & /*value*/ + 1 && console.log(v); }, [ v, r,