"use strict"; (function(J, L, A, ka) { const B = function() { function w(C) { throw Error("Failed to require " + C); } const v = {}; return { register: function(C, y) { v[C] = y; }, require: function(C, y) { return v[C] || w(y); }, include: function(C, y, p) { return v[C] || (p ? w(y) : null); } }; }(); B.register("$1", function(w, v, C) { function y(p) { const t = typeof p; if ("string" === t) if (/[^ <>!=()%^&|?:n0-9]/.test(p)) console.error("Invalid plural: " + p); else return new Function("n", "return " + p); "function" !== t && (p = function(d) { return 1 != d; }); return p; } w.init = function(p) { function t(h, n, q) { return (h = f[h]) && h[q] ? h[q] : n || ""; } function d(h) { return t(h, h, 0); } function b(h, n) { return t(n + "" + h, h, 0); } function k(h, n, q) { q = Number(p(q)); isNaN(q) && (q = 0); return t(h, q ? n : h, q); } p = y(p); let f = {}; return { __: d, _x: b, _n: k, _: d, x: b, n: k, load: function(h) { f = h || {}; return this; }, pluraleq: function(h) { p = y(h); return this; } }; }; return w; }({}, J, L)); B.register("$2", function(w, v, C) { w.ie = function() { return !1; }; w.init = function() { return w; }; return w; }({}, J, L)); B.register("$3", function(w, v, C) { Number.prototype.format = function(y, p, t) { var d = Math.pow(10, y || 0); y = []; d = String(Math.round(d * this) / d); var b = d.split("."); d = b[0]; b = b[1]; let k = d.length; do { y.unshift(d.substring(k - 3, k)); } while (0 < (k -= 3)); d = y.join(t || ","); if (b) { { t = b; y = t.length; let f; for (;"0" === t.charAt(--y); ) f = y; f && (t = t.substring(0, f)); b = t; } b && (d += (p || ".") + b); } return d; }; Number.prototype.percent = function(y) { let p = 0, t = this && y ? this / y * 100 : 0; if (0 === t) return "0"; if (100 === t) return "100"; if (99 < t) t = Math.min(t, 99.9), y = t.format(++p); else if (.5 > t) { t = Math.max(t, 1e-4); do { y = t.format(++p); } while ("0" === y && 4 > p); y = y.substring(1); } else y = t.format(0); return y; }; return w; }({}, J, L)); B.register("$4", function(w, v, C) { Array.prototype.indexOf || (Array.prototype.indexOf = function(y) { if (null == this) throw new TypeError(); var p = Object(this), t = p.length >>> 0; if (0 === t) return -1; var d = 0; 1 < arguments.length && (d = Number(arguments[1]), d != d ? d = 0 : 0 != d && Infinity != d && -Infinity != d && (d = (0 < d || -1) * Math.floor(Math.abs(d)))); if (d >= t) return -1; for (d = 0 <= d ? d : Math.max(t - Math.abs(d), 0); d < t; d++) if (d in p && p[d] === y) return d; return -1; }); return w; }({}, J, L)); B.register("$5", function(w, v, C) { C = v.JSON; C || (C = { parse: A.parseJSON, stringify: null }, v.JSON = C); w.parse = C.parse; w.stringify = C.stringify; return w; }({}, J, L)); B.register("$6", function(w, v, C) { w.trim = function(y, p) { for (p || (p = " \n"); y && -1 !== p.indexOf(y.charAt(0)); ) y = y.substring(1); for (;y && -1 !== p.indexOf(y.slice(-1)); ) y = y.substring(0, y.length - 1); return y; }; w.sprintf = function(y) { return w.vsprintf(y, [].slice.call(arguments, 1)); }; w.vsprintf = function(y, p) { let t = 0; return y.replace(/%(?:([1-9][0-9]*)\$)?([sud%])/g, function(d, b, k) { if ("%" === k) return "%"; d = b ? p[Number(b) - 1] : p[t++]; return null != d ? String(d) : "s" === k ? "" : "0"; }); }; return w; }({}, J, L)); B.register("$27", function(w, v, C) { function y(p) { return function(t, d) { let b = t[p] || 0; for (;(t = t.offsetParent) && t !== (d || C.body); ) b += t[p] || 0; return b; }; } w.top = y("offsetTop"); w.left = y("offsetLeft"); w.el = function(p, t) { p = C.createElement(p || "div"); t && (p.className = t); return p; }; w.txt = function(p) { return C.createTextNode(p || ""); }; w.rect = function(p) { return p.getBoundingClientRect(); }; return w; }({}, J, L)); B.register("$7", function(w, v, C) { function y(m, g, l) { function r() { z(); x = setTimeout(g, l); } function z() { x && clearTimeout(x); x = 0; } let x = 0; r(); A(m).on("mouseenter", z).on("mouseleave", r); return { die: function() { z(); A(m).off("mouseenter mouseleave"); } }; } function p(m, g) { m.fadeTo(g, 0, function() { m.slideUp(g, function() { m.remove(); A(v).triggerHandler("resize"); }); }); return m; } function t(m, g) { function l(F) { q[D] = null; p(A(m), 250); x && x.die(); var H; if (H = F) F.stopPropagation(), F.preventDefault(), H = !1; return H; } function r(F) { x && x.die(); return x = y(m, l, F); } const z = A(m); let x, D, E, G = z.find("button"); 0 === G.length && (z.addClass("is-dismissible"), G = A('
")) r = z; } return r; }; l._setContent = l.setContent; l.setContent = function(r, z) { return this._setContent(f(r), z); }; k ? (y(l, k), k.reset()) : t(l); A(m).removeClass("loading"); } let n, q = !1, u = "", c = !1, a = b.parentNode, e = a.parentNode, m = a.appendChild(C.createElement("div")), g = e.insertBefore(C.createElement("nav"), a); g.id = "_tb" + String(++d); A(a).addClass("has-proxy has-mce"); A(m).addClass("mce-content-body loading").html(f(b.value)); w.load(function(l) { if (!l) throw Error("Failed to load HTML editor"); m && l.init({ inline: !0, target: m, hidden_input: !1, theme: "modern", skin: !1, plugins: "link lists", browser_spellcheck: !0, menubar: !1, fixed_toolbar_container: "#" + g.id, toolbar: "formatselect | bold italic link unlink | bullist numlist outdent indent", block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;", forced_root_block: "p", relative_urls: !1, convert_urls: !1, remove_script_host: !1, document_base_url: "", allow_script_urls: !1, formats: { alignleft: { classes: "alignleft" }, alignright: { selector: "p,h1,h2,h3,h4,span,strong,em,a", classes: "alignright" }, aligncenter: { selector: "p,h1,h2,h3,h4,span,strong,em,a", classes: "aligncenter" }, strikethrough: { inline: "del" } }, fix_list_elements: !0, extended_valid_elements: "span,b,i,u,loco:script", entities: "38,amp,60,lt,62,gt,160,nbsp", entity_encoding: "named", keep_styles: !1, init_instance_callback: h }); }); return { val: function(l) { l = f(l); null == n ? (b.value = l, A(m).html(l)) : n.getContent() !== l && n.setContent(l); k && k.val(l); return this; }, kill: function() { n && (k && k.val(n.getContent()), p(n), n.destroy(), n = null); m && (a.removeChild(m), A(a).removeClass("has-proxy has-mce"), m = null); g && (e.removeChild(g), g = null); return this; }, enable: function(l) { k = l; n && y(n, l); return this; }, disable: function() { n && t(n); k = null; return this; }, focus: function() { n && k && n.focus(); return this; }, invs: function(l) { l = l || !1; q !== l && (q = l, A(a)[l ? "addClass" : "removeClass"]("show-invs")); return this; } }; }; return w; }({}, J, L)); B.register("$54", function(w, v, C) { w.init = function(y, p) { function t(e) { u !== e && (a.textContent = e.format(0), u = e, e = 0 === e ? "empty" : 0 === p || e < p ? "lt" : p === e ? "eq" : "gt", e !== q && (q = e, c.className = "wg-count is-" + e)); } function d(e) { n && (c.removeChild(n), n = null); 0 < e && (n = c.appendChild(f.el("span").appendChild(f.txt(" / " + e.format(0))))); p = e; } function b(e, m) { t(m.length); } function k() { q = ""; u = -1; t(y.val().length); } const f = B.require("$27", "dom.js"), h = A(y.parent()).on("changing", b); let n, q, u, c = f.el("div"), a = c.appendChild(f.el("span")); h.append(c); d(p); k(); return { ping: function(e) { null != e && e !== p && (p = e, d(e)); k(); }, kill: function() { const e = h && h[0]; e && c && c.parentNode === e && (h.off("changing", b), e.removeChild(c)); } }; }; return w; }({}, J, L)); B.register("$49", function(w, v, C) { function y(d) { function b() { a && (q.off("input", k), a = !1); } function k() { const m = d.value; m !== e && (q.trigger("changing", [ m, e ]), e = m); } function f() { k(); a && c !== e && q.trigger("changed", [ e ]); } function h() { t = d; c = e; a || (q.on("input", k), a = !0); q.trigger("editFocus"); u.addClass("has-focus"); return !0; } function n() { t === d && (t = null); q.trigger("editBlur"); u.removeClass("has-focus"); a && (f(), b()); return !0; } const q = A(d), u = A(d.parentNode); let c, a = !1, e = d.value; q.on("blur", n).on("focus", h); return { val: function(m) { e !== m && (d.value = m, q.triggerHandler("input"), e = m); return !0; }, kill: function() { b(); q.off("blur", n).off("focus", h); }, fire: function() { e = null; k(); }, ping: f, blur: n, focus: h, reset: function() { c = e = d.value; } }; } function p(d) { this.e = d; } let t; w._new = function(d) { return new p(d); }; w.init = function(d) { const b = new p(d); d.disabled ? (d.removeAttribute("disabled"), b.disable()) : d.readOnly ? b.disable() : b.enable(); return b; }; v = p.prototype; v.destroy = function() { this.unlisten(); const d = this.p; d && (d.kill(), this.p = null); this.nocount(); this.e = null; }; v.reload = function(d, b) { let k = this.l; this.nocount(); k && !b && (this.disable(), k = null); this.val(d || ""); b && !k && this.enable(); return this; }; v.val = function(d) { const b = this.e; if (null == d) return b.value; const k = this.l, f = this.p; f && f.val(d); k && k.val(d); k || b.value === d || (b.value = d, A(b).triggerHandler("input")); return this; }; v.fire = function() { this.l && this.l.fire(); return this; }; v.ping = function() { this.l && this.l.ping(); return this; }; v.focus = function() { const d = this.p; d ? d.focus() : A(this.e).focus(); }; v.focused = function() { return t && t === this.el; }; v.parent = function() { return this.e.parentNode; }; v.attr = function(d, b) { const k = this.e; if (1 === arguments.length) return k.getAttribute(d); null == b ? k.removeAttribute(d) : k.setAttribute(d, b); return this; }; v.editable = function() { return !!this.l; }; v.enable = function() { const d = this.p; this.e.removeAttribute("readonly"); this.listen(); d && d.enable && d.enable(this.l); return this; }; v.disable = function() { const d = this.p; this.e.setAttribute("readonly", !0); this.unlisten(); d && d.disable && d.disable(); return this; }; v.listen = function() { const d = this.l; d && d.kill(); this.l = y(this.e); return this; }; v.unlisten = function() { const d = this.l; d && (d.kill(), this.l = null); return this; }; v.setInvs = function(d, b) { const k = this.i || !1; if (b || k !== d) this._i && (this._i.kill(), delete this._i), (b = this.p) && b.invs ? b.invs(d) : d && (this._i = B.require("$52", "mirror.js").init(this.e)), this.i = d; return this; }; v.getInvs = function() { return this.i || !1; }; v.setMode = function(d) { let b = this.p, k = this.i || !1; d !== (this.m || "") && (this.m = d, b && b.kill(), this.p = b = "code" === d ? B.require("$16", "ace.js").init(this.e, this.l, this["%"]) : "html" === d ? B.require("$53", "mce.js").init(this.e, this.l) : null, this.setInvs(k, !0), t && this.focus()); return this; }; v.setStrf = function(d) { this["%"] = d; "code" === this.m && this.p.strf(d); return this; }; v.name = function(d) { this.e.setAttribute("name", d); return this; }; v.placeholder = function(d) { this.e.setAttribute("placeholder", d); return this; }; v.redraw = function() { const d = this.p; d && d.resize && d.resize(); }; v.counter = function(d) { let b = this.c; b ? b.ping(d) : this.c = B.require("$54", "counter.js").init(this, d); d = String(d || "0"); "0" === d ? this.e.removeAttribute("maxlength") : d !== this.e.getAttribute("maxlength") && this.e.setAttribute("maxlength", d); return this; }; v.nocount = function() { const d = this.c; d && (d.kill(), this.c = null, this.e.removeAttribute("maxlength")); }; return w; }({}, J, L)); B.register("$50", function(w, v, C) { function y(a) { const e = v.console; e && e.error && e.error(a); } function p(a) { const e = C.createElement("div"); a && e.setAttribute("class", a); return e; } function t(a) { return function() { a.resize(); return this; }; } function d(a) { return function(e) { let m = e.target, g = m.$index; for (;null == g && "DIV" !== m.nodeName && (m = m.parentElement); ) g = m.$index; null != g && (e.stopImmediatePropagation(), a.select(g)); return !0; }; } function b(a) { return function() { a.redrawDirty() && a.redraw(); return !0; }; } function k(a) { return function(e) { var m = e.keyCode; if (40 === m) m = 1; else if (38 === m) m = -1; else return !0; if (e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) return !0; a.selectNext(m); e.stopPropagation(); e.preventDefault(); return !1; }; } function f(a, e, m) { function g(l) { y("row[" + l + "] disappeared"); return { cellVal: function() { return ""; } }; } return function(l) { const r = e || 0, z = m ? -1 : 1, x = a.rows || []; l.sort(function(D, E) { return z * (x[D] || g(D)).cellVal(r).localeCompare((x[E] || g(E)).cellVal(r)); }); }; } function h(a) { this.w = a; } function n(a) { this.t = a; this.length = 0; } function q(a, e, m) { let g = C.createElement("div"); g.className = m || ""; this._ = g; this.d = e || []; this.i = a || 0; this.length = e.length; } function u(a) { this.live = a; this.rows = []; } w.create = function(a) { return new h(a); }; var c = h.prototype; c.init = function(a) { let e = this.w, m = e.id; var g = e.splity(m + "-thead", m + "-tbody"), l = g[0]; g = g[1]; let r = [], z = [], x = [], D = []; if (a) this.ds = a, this.idxs = z, this._idxs = null; else if (!(a = this.ds)) throw Error("No datasource"); l.css.push("wg-thead"); g.css.push("wg-tbody"); a.eachCol(function(O, R, I) { x[O] = m + "-col-" + R; D[O] = I || R; }); var E = p(); let G = -1, F = x.length, H = p("wg-cols"), M = l.splitx.apply(l, x); for (;++G < F; ) M[G].header(D[G]), H.appendChild(E.cloneNode(!1)).setAttribute("for", x[G]); a.eachRow(function(O, R, I) { r[O] = new q(O, R, I); z[O] = O; }); this.rows = r; this.cols = H; this.ww = null; this.root = E = g.body; this.head = l; l.redraw = t(this); l = g.fixed = M[0].bodyY() || 20; e.lock().resize(l, g); e.css.push("is-table"); e.restyle(); this.sc ? this._re_sort(F) : a.sort && a.sort(z); this.redrawDirty(); this.render(); A(E).attr("tabindex", "-1").on("keydown", k(this)).on("mousedown", d(this)).on("scroll", b(this)); return this; }; c.clear = function() { const a = this.pages || []; let e = a.length; for (;0 !== e--; ) a[e].destroy(); this.pages = []; this.sy = this.mx = this.mn = this.vh = null; void 0; return this; }; c.render = function() { let a, e = [], m = this.rows || [], g = -1, l, r = this.idxs, z = r.length, x = this.idxr = {}, D = this.r, E = this._r, G = this.root, F = this.cols; for (;++g < z; ) { if (0 === g % 100) { var H = F.cloneNode(!0); a = new u(H); a.i = e.length; a.h = 2200; a.insert(G); e.push(a); } l = r[g]; x[l] = g; H = m[l]; if (null == H) throw Error("Render error, no data at [" + l + "]"); H.page = a; a.rows.push(H); } a && 100 !== a.size() && a.sleepH(22); this.pages = e; this.mx = this.mn = null; this.redrawDirty(); this.redraw(); null == D ? null != E && (H = m[E]) && H.page && (delete this._r, this.select(E, !0)) : (H = m[D]) && H.page ? this.select(D, !0) : (this.deselect(!1), this._r = D); return this; }; c.resize = function() { let a = -1, e = this.ww || (this.ww = []); var m = this.w; let g = m.cells[0], l = g.body.childNodes, r = l.length, z = this.pages || [], x = z.length; for (m.redraw.call(g); ++a < r; ) e[a] = l[a].style.width; if (x) { m = this.mx; for (a = this.mn; a <= m; a++) z[a].widths(e); this.redrawDirty() && this.redraw(); } }; c.redrawDirty = function() { let a = !1; var e = this.root; const m = e.scrollTop; e = e.clientHeight; this.sy !== m && (a = !0, this.sy = m); this.vh !== e && (a = !0, this.vh = e); return a; }; c.redraw = function() { let a = 0, e = -1, m = null, g = null, l = this.ww; var r = this.sy; let z = this.mn, x = this.mx, D = Math.max(0, r - 100); r = this.vh + r + 100; let E, G = this.pages || [], F = G.length; for (;++e < F && !(a > r); ) E = G[e], a += E.height(), a < D || (null === m && (m = e), g = e, E.rendered || E.render(l)); if (z !== m) { if (null !== z && m > z) for (e = z; e < m; e++) { E = G[e]; if (!E) throw Error("Shit!"); E.rendered && E.sleep(); } this.mn = m; } if (x !== g) { if (null !== x && g < x) for (e = x; e > g; e--) E = G[e], E.rendered && E.sleep(); this.mx = g; } }; c.selected = function() { return this.r; }; c.thead = function() { return this.w.cells[0]; }; c.tbody = function() { return this.w.cells[1]; }; c.tr = function(a) { return (a = this.row(a)) ? a.cells() : []; }; c.row = function(a) { return this.rows[a]; }; c.td = function(a, e) { return this.tr(a)[e]; }; c.next = function(a, e, m) { null == m && (m = this.r || 0); const g = this.idxs, l = g.length; let r = m = (this.idxr || {})[m]; for (;m !== (r += a) && !(0 <= r && l > r); ) if (e && l) r = 1 === a ? -1 : l, e = !1; else return null; m = g[r]; return null == m || null == this.rows[m] ? (y("Bad next: [" + r + "] does not map to data row"), null) : m; }; c.selectNext = function(a, e, m) { a = this.next(a, e, null); null != a && this.r !== a && this.select(a, m); return this; }; c.deselect = function(a) { const e = this.r; null != e && (this.r = null, A(this.tr(e)).removeClass("selected"), this.w.fire("wgRowDeselect", [ e, a ])); return this; }; c.selectRow = function(a, e) { return this.select(this.idxs[a], e); }; c.select = function(a, e) { const m = this.rows[a]; var g = m && m.page; if (!g) return this.deselect(!1), y("Row is filtered out"), this; this.deselect(!0); let l, r = this.w.cells[1]; g.rendered || (l = g.top(), r.scrollY(l), this.redrawDirty() && this.redraw()); if (!m.rendered) return g.rendered || y("Failed to render page"), y("Row [" + m.i + "] not rendered"), this; g = m.cells(); A(g).addClass("selected"); this.r = a; e || (l = r.scrollY(), A(this.root).focus(), l !== r.scrollY() && r.scrollY(l)); r.scrollTo(g[0], !0); this.w.fire("wgRowSelect", [ a, m.data() ]); return this; }; c.unfilter = function() { this._idxs && (this.idxs = this._sort(this._idxs), this._idxs = null, this.clear().render()); return this; }; c.filter = function(a) { this._idxs || (this._idxs = this.idxs); this.idxs = this._sort(a); return this.clear().render(); }; c.each = function(a) { let e, m = -1; const g = this.rows || [], l = this.idxs || [], r = l.length; for (;++m < r; ) e = l[m], a(g[e], m, e); return this; }; c.sortable = function(a) { const e = this.sc || (this.sc = new n(this)); e.has(a) || e.add(a); return this; }; c._re_sort = function(a) { let e = -1, m = this.sc, g = m.active; for (this.sc = m = new n(this); ++e < a; ) m.add(e); g && (e = this.head.indexOf(g.id), -1 === e && (e = Math.min(g.idx, a - 1)), this.sort(e, g.desc)); return this; }; c._sort = function(a, e) { e ? (this.s = e, e(a)) : (e = this.s) && e(a); return a; }; c.sort = function(a, e) { this._sort(this.idxs, f(this, a, e)); this.sc.activate(a, e); return this; }; c = null; c = n.prototype; c.has = function(a) { return null != this[a]; }; c.add = function(a) { const e = this, m = e.t.head.cells[a]; e[a] = { desc: null, idx: a, id: m.id }; e.length++; m.addClass("wg-sortable").on("click", function(g) { if ("header" === g.target.nodeName.toLowerCase()) return g.stopImmediatePropagation(), e.toggle(a), !1; }); return e; }; c.toggle = function(a) { this.t.sort(a, !this[a].desc).clear().render(); return this; }; c.activate = function(a, e) { let m, g = this.active, l = this[a], r = this.t.head.cells; g && (m = r[g.idx]) && (m.removeClass(g.css), g !== l && m.restyle()); (m = r[a]) ? (l.desc = e, this.active = l, a = "wg-" + (e ? "desc" : "asc"), m.addClass(a).restyle(), l.css = a) : this.active = null; return this; }; c = null; c = q.prototype; c.render = function(a) { let e, m = [], g = this._, l = this.length; if (g) { for (this.c = m; 0 !== l--; ) e = g.cloneNode(!1), m[l] = this.update(l, e), e.$index = this.i, a[l].appendChild(e); this._ = null; } else for (m = this.c; 0 !== l--; ) a[l].appendChild(m[l]); this.rendered = !0; return this; }; c.update = function(a, e) { e = e || this.c[a] || {}; a = (this.d[a] || function() {})() || " "; null == a.innerHTML ? e.textContent = a : e.innerHTML = a.innerHTML; return e; }; c.cells = function() { return this.c || [ this._ ]; }; c.data = function() { const a = [], e = this.length; let m = -1; for (;++m < e; ) a[m] = this.cellVal(m); return a; }; c.destroy = function() { this.page = null; this.rendered = !1; }; c.cellVal = function(a) { a = this.d[a]() || ""; return String(a.textContent || a); }; c = null; c = u.prototype; c.size = function() { return this.rows.length; }; c.insert = function(a) { const e = this.h, m = p("wg-dead"); m.style.height = String(e) + "px"; a.appendChild(m); return this.dead = m; }; c.top = function() { return (this.rendered ? this.live : this.dead).offsetTop; }; c.height = function() { let a = this.h; null == a && (this.h = a = this.rendered ? this.live.firstChild.offsetHeight : this.dead.offsetHeight); a || y("row has zero height"); return a; }; c.render = function(a) { let e, m = -1, g = this.rows, l = g.length; const r = this.dead, z = this.live, x = z.childNodes; for (;++m < l; ) e = g[m], e.rendered || e.render(x); l = a.length; for (m = 0; m < l; m++) x[m].style.width = a[m]; r.parentNode.replaceChild(z, r); this.rendered = !0; this.h = null; return this; }; c.sleep = function() { const a = this.height(), e = this.live, m = this.dead; m.style.height = String(a) + "px"; e.parentNode.replaceChild(m, e); this.rendered = !1; this.h = a; return this; }; c.sleepH = function(a) { a *= this.rows.length; const e = this.dead; e && (e.style.height = String(a) + "px"); this.rendered || (this.h = a); return this; }; c.widths = function(a) { const e = this.live.childNodes; let m = a.length; for (;0 !== m--; ) e[m].style.width = a[m]; return this; }; c.destroy = function() { var a = this.rendered ? this.live : this.dead; const e = this.rows; a.parentNode.removeChild(a); for (a = e.length; 0 !== a--; ) e[a].destroy(); }; return w; }({}, J, L)); B.register("$45", function(w, v, C) { function y(g, l) { var r = g.id; let z = r && c[r], x = z && z.parent(); if (!z || !x) return null; var D = 1 === x.dir; r = D ? "X" : "Y"; let E = "page" + r; D = D ? u : q; let G = D(x.el); r = l["offset" + r]; let F = x.el, H = F.className; null == r && (r = l[E] - D(g)); r && (G += r); F.className = H + " is-resizing"; return { done: function() { F.className = H; }, move: function(M) { x.resize(M[E] - G, z); return !0; } }; } function p(g) { function l() { A(C).off("mousemove", r); m && (m.done(), m = null); return !0; } function r(z) { m ? m.move(z) : l(); return !0; } if (m) return !0; m = y(g.target, g); if (!m) return !0; A(C).one("mouseup", l).on("mousemove", r); return d(g); } function t(g, l) { const r = l.type; "touchmove" === r ? m && m.move(l) : "touchstart" === r ? m = y(g.target, l) : "touchend" === r && m && (m.done(), m = null); } function d(g) { g.stopPropagation(); g.preventDefault(); return !1; } function b(g) { a && a.redraw(); g && g.redraw(); return a = g; } function k(g, l) { const r = A(l); r.on("editFocus", function(z) { z.stopPropagation(); r.trigger("wgFocus", [ b(g) ]); }).on("editBlur", function(z) { z.stopPropagation(); r.trigger("wgBlur", [ b(null) ]); }); } function f(g) { const l = g.id, r = g.className, z = r ? [ r ] : []; this.id = l; this.el = g; this.pos = this.index = 0; this._cn = r; this.css = z.concat("wg-cell"); c[l] = this; this.clear(); } const h = B.include("$47", "html.js") || B.include("$2", "html.js", !0), n = B.require("$27", "dom.js"), q = n.top, u = n.left, c = {}; let a, e = 0, m = !1; w.init = function(g) { const l = new f(g); l.redraw(); B.require("$48", "touch.js").ok(function(r) { r.dragger(g, t); }); A(g).on("mousedown", p); return l; }; v = f.prototype; v.fire = function(g, l) { g = A.Event(g); g.cell = this; A(this.el).trigger(g, l); return this; }; v.each = function(g) { let l = -1; const r = this.cells, z = r.length; for (;++l < z; ) g(r[l], l); return this; }; v.indexOf = function(g) { return (g = c[g.id || String(g)]) && g.pid === this.id ? g.index : -1; }; v.on = function() { return this.$("on", arguments); }; v.off = function() { return this.$("off", arguments); }; v.find = function(g) { return A(this.el).find(g); }; v.$ = function(g, l) { A.fn[g].apply(A(this.el), l); return this; }; v.addClass = function(g) { this.css.push(g); return this; }; v.removeClass = function(g) { g = this.css.indexOf(g); -1 !== g && this.css.splice(g, 1); return this; }; v.parent = function() { return this.pid && c[this.pid]; }; v.splitx = function() { return this._split(1, arguments); }; v.splity = function() { return this._split(2, arguments); }; v._split = function(g, l) { (this.length || this.field) && this.clear(); let r = -1; let z = l.length, x = 1 / z, D = 0; for (;++r < z; ) { var E = n.el(); this.body.appendChild(E); var G = E; { var F = l[r]; let H = 1, M = F; for (;c[F]; ) F = M + "-" + ++H; } G.id = F; E = new f(E); E.index = r; E.pid = this.id; E._locale(this.lang, this.rtl); E.pos = D; D += x; this.cells.push(E); this.length++; } this.dir = g; this.redraw(); return this.cells; }; v.count = function() { return this.cells && this.cells.length || 0; }; v.destroy = function() { this.clear(); delete c[this.id]; const g = this.el; g.innerHTML = ""; this.body = null; g.className = this._cn || ""; A(g).off(); return this; }; v.exists = function() { return this === c[this.id]; }; v.clear = function() { const g = this.el, l = this.cells, r = this.field, z = this.body, x = this.nav; let D = this.length || 0; for (;0 !== D--; ) delete c[l[D].destroy().id]; this.cells = []; this.length = 0; x && (g.removeChild(x), this.nav = null); z && (r && (r.destroy(), this.counter = this.field = null), this.table && (this.table = null), g === z.parentNode && g.removeChild(z)); this.body = g.appendChild(n.el("", "wg-body")); this._h = null; return this; }; v.resize = function(g, l) { if (!l && (l = this.cells[1], !l)) return; var r = l.index; let z = this.cells, x = A(this.el)[1 === this.dir ? "width" : "height"](), D = z[r + 1]; r = z[r - 1]; l.pos = Math.min((D ? D.pos * x : x) - ((l.body || l.el.firstChild).offsetTop || 0), Math.max(r ? r.pos * x : 0, g)) / x; this.redraw(); this.fire("wgResize"); return this; }; v.distribute = function(g) { let l = -1, r = 0, z; const x = this.cells, D = g.length; for (;++l < D && (z = x[++r]); ) z.pos = Math.max(0, Math.min(1, g[l])); this.redraw(); return this; }; v.distribution = function() { let g = [], l = 0; const r = this.cells, z = r.length - 1; for (;l < z; ) g[l] = r[++l].pos; return g; }; v.restyle = function() { var g = this.css.concat(); 0 === this.index ? g.push("first") : g.push("not-first"); this.dir && (g.push("wg-split"), 2 === this.dir ? g.push("wg-split-y") : g.push("wg-split-x")); this.t && g.push("has-title"); this.nav && g.push("has-nav"); this.field && (g.push("is-field"), this.field.editable() ? g.push("is-editable") : g.push("is-readonly")); g = g.join(" "); g !== this._css && (this._css = g, this.el.className = g); return this; }; v.redraw = function(g) { this.restyle(); const l = this.el; var r = this.body, z = this.field; if (r) { var x = l.clientWidth || 0, D = l.clientHeight || 0, E = r.offsetTop || 0; D = E > D ? 0 : D - E; if (this._h !== D) { this._h = D; r.style.height = String(D) + "px"; var G = z; } this._w !== x && (this._w = x, G = z); G && G.redraw(); } r = this.length; x = 1; D = this.nav; for (E = 2 === this.dir ? "height" : "width"; 0 !== r--; ) z = this.cells[r], D ? G = 1 : (z.fixed && (z.pos = z.fixed / A(l)[E]()), G = x - z.pos, x = z.pos), z.el.style[E] = String(100 * G) + "%", z.redraw(g); return this; }; v.contents = function(g, l) { const r = this.el; let z = this.body; if (null == g) return z.innerHTML; this.length ? this.clear() : z && (r.removeChild(z), z = null); z || (this.body = z = r.appendChild(n.el("", l || "wg-content")), this._h = null, (l = this.lang) && this._locale(l, this.rtl, !0)); "string" === typeof g ? A(z)._html(g) : g && this.append(g); this.redraw(); return this; }; v.textarea = function(g, l) { let r = this.field; if (r) { var z = r.editable(); r.reload(g, l); z !== l && this.restyle(); } else this.length && this.clear(), z = n.el("textarea"), z.setAttribute("wrap", "virtual"), z.setAttribute("autocomplete", "off"), z.setAttribute("id", "wg" + String(++e)), z.value = g, this.contents(z), r = B.require("$49", "field.js")._new(z)[l ? "enable" : "disable"](), k(this, z), this.field = r, this.restyle(); this.lang || this.locale("en"); return r; }; v.locale = function(g) { g = B.require("$43", "locale.js").cast(g); return this._locale(String(g), g.isRTL()); }; v._locale = function(g, l, r) { const z = this.body; if (r || g !== this.lang) this.lang = g, z && z.setAttribute("lang", g); if (r || l !== this.rtl) this.rtl = l, z && z.setAttribute("dir", l ? "RTL" : "LTR"); return this; }; v.editable = function() { let g = this.field; if (g) return g.editable() ? g : null; const l = this.cells; let r = this.navigated(); if (null != r) return l[r].editable(); r = -1; const z = l.length; for (;++r < z && (g = l[r].editable(), null == g); ); return g; }; v.eachTextarea = function(g) { const l = this.field; l ? g(l) : this.each(function(r) { r.eachTextarea(g); }); return this; }; v.append = function(g) { g && (g.nodeType ? h.init(this.body.appendChild(g)) : h.init(A(g).appendTo(this.body))); return this; }; v.prepend = function(g) { const l = this.body; if (g.nodeType) { const r = l.firstChild; h.init(r ? l.insertBefore(g, r) : l.appendChild(g)); } else h.init(A(g).prependTo(l)); return this; }; v.before = function(g) { const l = this.body; g.nodeType ? h.init(this.el.insertBefore(g, l)) : h.init(A(g).insertBefore(l)); return this; }; v.header = function(g, l) { if (null == g && null == l) return this.el.getElementsByTagName("header")[0]; this.t = n.txt(g || ""); this.el.insertBefore(n.el("header", l), this.body).appendChild(this.t); this.redraw(); return this; }; v.toolbar = function() { const g = this.header(), l = g.getElementsByTagName("nav"); return 0 === l.length ? g.appendChild(n.el("nav")) : l[0]; }; v.title = function(g) { const l = this.t; if (l) return l.nodeValue = g || "", l; this.header(g); return this.t; }; v.titled = function() { return this.t && this.t.nodeValue; }; v.bodyY = function() { return q(this.body, this.el); }; v.scrollY = function(g) { if (ka === g) return this.body.scrollTop; this.body.scrollTop = g; }; v.tabulate = function(g) { let l = this.table; l ? l.clear() : l = B.require("$50", "wgtable.js").create(this); l.init(g); return this.table = l; }; v.lock = function() { this.body.className += " locked"; return this; }; v.scrollTo = function(g, l) { let r = this.body; var z = r.scrollTop; let x = q(g, r); if (z > x) z = x; else { const D = r.clientHeight; g = x + A(g).outerHeight(); if (D + z < g) z = g - D; else return; } l ? r.scrollTop = z : A(r).stop(!0).animate({ scrollTop: z }, 250); }; v.navigize = function(g, l) { function r(H) { const M = D[H], O = x[H], R = A(M.el).show(); O.addClass("active"); G = H; F.data("idx", H); M.fire("wgTabSelect", [ H ]); return R; } const z = this, x = [], D = z.cells; let E = z.nav, G; E && z.el.removeChild(E); E = z.nav = z.el.insertBefore(n.el("nav", "wg-tabs"), z.body); const F = A(E).on("click", function(H) { const M = A(H.target).data("idx"); if (null == M) return !0; if (null != G) { { const O = x[G]; A(D[G].el).hide(); O.removeClass("active"); } } r(M); z.redraw(); return d(H); }); null == l && (l = F.data("idx") || 0); z.each(function(H, M) { x[M] = A('').data("idx", M).text(g[M]).appendTo(F); H.pos = 0; A(H.el).hide(); }); r(D[l] ? l : 0); z.lock(); z.redraw(); return z; }; v.navigated = function() { const g = this.nav; if (g) return A(g).data("idx"); }; v = null; return w; }({}, J, L)); B.register("$30", function(w, v, C) { function y(c, a) { c.stopPropagation(); h = a; return !0; } function p(c) { const a = []; c && (c.saved() || a.push("po-unsaved"), c.fuzzy() ? a.push("po-fuzzy") : c.hasFlag() && a.push("po-flagged"), c.valid() || a.push("po-error"), c.translation() || a.push("po-empty"), c.comment() && a.push("po-comment")); return a.join(" "); } function t(c, a, e) { a = A(c.title(a).parentNode); let m = a.find("span.lang"); e ? (e = B.require("$43", "locale.js").cast(e), m.length || (m = A("").prependTo(a)), m.attr("lang", e.lang).attr("class", e.getIcon() || "lang region region-" + (e.region || "zz").toLowerCase())) : (m.remove(), e = "en"); c.locale(e); return a; } function d(c, a, e) { a.on("click", function(m) { const g = c.fire(e, [ m.target ]); g || m.preventDefault(); return g; }); } function b() { this.dirty = 0; } B.require("$3", "number.js"); const k = B.require("$42", "string.js").html, f = B.require("$6", "string.js").sprintf; let h, n; w.extend = function(c) { return c.prototype = new b(); }; w.localise = function(c) { n = c; return w; }; const q = function() { const c = C.createElement("p"), a = /(src|href|on[a-z]+)\s*=/gi; return function(e) { c.innerHTML = e.replace(a, "data-x-loco-$1="); const m = c.textContent.trim(); return m ? m.replace("data-x-loco-", "") : e.trim(); }; }(), u = b.prototype = B.require("$44", "abstract.js").init([ "getListColumns", "getListHeadings", "getListEntry" ], [ "editable", "t" ]); u.init = function() { this.$t = null; this.localise(); this.editable = { source: !0, target: !0 }; this.mode = ""; this.html = !1; return this; }; u.t = function() { return this.$t || n || B.require("$1", "t.js").init(); }; u.localise = function(c) { c || (c = this.t()); const a = []; a[0] = c._x("Source text", "Editor") + ":"; a[3] = c._x("%s translation", "Editor") + ":"; a[4] = c._x("Context", "Editor") + ":"; a[5] = c._x("Comments", "Editor") + ":"; a[1] = c._x("Single", "Editor") + ":"; a[2] = c._x("Plural", "Editor") + ":"; a[6] = c._x("Untranslated", "Editor"); a[7] = c._x("Translated", "Editor"); a[8] = c._x("Toggle Fuzzy", "Editor"); a[9] = c._x("Suggest translation", "Editor"); this.labels = a; this.$t = c; return this; }; u.setRootCell = function(c) { function a(m) { e.redraw(!0, m); return !0; } const e = B.require("$45", "wingrid.js").init(c); A(v).on("resize", a); this.redraw = a; A(c).on("wgFocus wgBlur", y); this.destroy = function() { e.destroy(); A(v).off("resize", a); }; this.rootDiv = c; return e; }; u.$ = function() { return A(this.rootDiv); }; u.setListCell = function(c) { const a = this; a.listCell = c; c.on("wgRowSelect", function(e, m) { (e = a.po.row(m)) && e !== a.active && a.loadMessage(e); }).on("wgRowDeselect", function(e, m, g) { g || a.loadNothing(); }); }; u.setSourceCell = function(c) { this.sourceCell = c; }; u.setTargetCell = function(c) { this.targetCell = c; }; u.next = function(c, a, e) { const m = this.listTable, g = this.po; let l = m.selected(), r = l, z; for (;null != (l = m.next(c, e, l)); ) { if (r === l) { l = null; break; } if (a && (z = g.row(l), z.translated(0))) continue; break; } null != l && m.select(l, !0); return l; }; u.select = function(c) { this.listTable.select(c); this.focus(); }; u.current = function(c) { const a = this.active; if (null == c) return a; c ? c.is(a) ? (this.reloadMessage(c), this.focus()) : (this.loadMessage(c), c = this.po.indexOf(c), -1 !== c && this.select(c)) : this.unloadActive(); return this; }; u.getTargetOffset = function() { if (this.active) return this.targetCell && this.targetCell.navigated() || 0; }; u.getTargetEditable = function() { return this.editable.target && this.targetCell && this.targetCell.editable(); }; u.getSourceEditable = function() { return this.editable.source && this.sourceCell && this.sourceCell.editable(); }; u.getContextEditable = function() { return this.editable.context && this.contextCell && this.contextCell.editable(); }; u.getFirstEditable = function() { return this.getTargetEditable() || this.getSourceEditable() || this.getContextEditable(); }; u.searchable = function(c) { c && (this.dict = c, this.po && this.rebuildSearch()); return this.dict && !0; }; u.rebuildSearch = function() { const c = this.po.rows, a = c.length, e = this.dict; e.clear(); let m = -1; for (;++m < a; ) e.add(m, c[m].toText()); }; u.filtered = function() { return this.lastSearch || ""; }; u.filter = function(c, a) { const e = this.listTable, m = this.lastFound, g = this.lastSearch || ""; let l, r; c ? (r = this.dict.find(c), l = r.length, l === m && 0 === c.indexOf(g) ? a = !0 : e.filter(r)) : (l = this.po.length, e.unfilter()); this.lastFound = l; this.lastSearch = c; a || this.fire("poFilter", [ c, l ]); return l; }; u.countFiltered = function() { return this.lastSearch ? this.lastFound : this.po.length; }; u.unsave = function(c, a) { let e = !1; if (c) { if (e = c.saved(a)) this.dirty++, c.unsave(a), this.fire("poUnsaved", [ c, a ]); this.reCssRow(c); } return e; }; u.reCssRow = function(c) { var a = this.po.indexOf(c); if ((a = this.listTable.tr(a)) && a.length) { var e = p(c); c = a[0].className; e = c.replace(/(?:^| +)po-[a-z]+/g, "") + " " + e; e !== c && A(a).attr("class", e); } }; u.save = function(c) { const a = this.po; if (this.dirty || c) { const e = [], m = [], g = this.listTable; a.each(function(l, r, z) { r.err && e.push(r); r.saved() || (r.save(), (r = (l = g.row(z)) && l.page) && r.live ? m[r.i] = r.live : l && A(l.cells()).removeClass("po-unsaved")); }); m.length && A(m).find("div.po-unsaved").removeClass("po-unsaved"); this.dirty = 0; this.invalid = e.length ? e : null; this.fire("poSave", []); } return a; }; u.fire = function(c, a) { const e = this.handle; if (e && e[c] && !1 === e[c].apply(this, a || [])) return !1; c = A.Event(c); this.$().trigger(c, a); return !c.isDefaultPrevented(); }; u.on = function(c, a) { this.$().on(c, a); return this; }; u.getSorter = function() { return null; }; u.reload = function() { const c = this; var a = c.listCell; const e = c.po; var m = e && e.locale(); const g = m && m.isRTL(), l = e && e.length || 0; if (!e || !e.row) return a && a.clear().header("Error").contents("Invalid messages list"), !1; c.targetLocale = m; c.lastSearch && (c.lastSearch = "", c.lastFound = l, c.fire("poFilter", [ "", l ])); let r = (m = c.listTable) && m.thead().distribution(), z = []; c.listTable = m = a.tabulate({ eachCol: function(x) { const D = c.getListColumns(), E = c.getListHeadings(); for (const G in D) { const F = D[G]; x(F, G, E[F]); } }, eachRow: function(x) { e.each(function(D, E) { c.validate(E) && z.push(E); x(E.idx, c.getListEntry(E), p(E)); }); }, sort: c.getSorter() }); a = c.getListColumns(); for (const x in a) m.sortable(a[x]); r && m.thead().distribute(r); m.tbody().$(g ? "addClass" : "removeClass", [ "is-rtl" ]); c.invalid = z.length ? z : null; return !!l; }; u.load = function(c, a) { this.po = c; this.dict && this.rebuildSearch(); this.reload() && (-1 !== a ? this.listTable.selectRow(a || 0) : this.active && this.unloadActive()); }; u.pasteMessage = function(c) { this.validate(c); if (this.active === c) { let a = this.sourceCell, e = 0; a && a.eachTextarea(function(m) { m.val(c.source(null, e++)); }); (a = this.contextCell) && a.eachTextarea(function(m) { m.val(c.context()); }); if (a = this.targetCell) e = 0, a.eachTextarea(function(m) { m.val(c.translation(e++)); }); } this.updateListCell(c, "source"); this.updateListCell(c, "target"); return this; }; u.reloadMessage = function(c) { const a = this.sourceCell, e = this.targetCell; this.pasteMessage(c); a && this.setSrcMeta(c, a) && a.redraw(); if (e) { var m = e.navigated() || 0; m = this.setTrgMeta(c, m, e); !a && this.setSrcMeta(c, e) && (m = !0); m && (e.redraw(), this.reCssRow(c)); } return this; }; u.setStatus = function() { return null; }; u.setSrcMeta = function(c, a) { const e = []; var m = this.labels; let g = !1, l = this.$smeta; var r = c.context(); let z = [], x = c.tags(), D = x && x.length; r && (z.push("" + k(m[4]) + ""), z.push('' + k(r) + "")); if (D && this.getTag) for (z.push("Tagged:"), m = -1; ++m < D; ) (r = this.getTag(x[m])) && z.push("" + k(r.mod_name) + ""); z.length && e.push('"); if (this.getMono() && (r = c.refs()) && (x = r.split(/\s/), D = x.length)) { for (z = []; 0 <= --D; ) r = x[D], z.push("" + k(r) + "");
e.push('");
}
(r = c.notes()) && e.push('");
e.length ? (l || (l = a.find("div.meta"), l.length || (l = A('').insertAfter(a.header())),
d(this, l, "poMeta"), this.$smeta = l), l.html(e.join("\n")).show(), g = !0) : l && l.text() && (l.text("").hide(),
g = !0);
return g;
};
u.setTrgMeta = function(c, a, e) {
const m = [];
a = (c = c.errors(a)) && c.length;
var g = !1;
let l = this.$tmeta;
if (a) {
for (g = 0; g < a; g++) m.push('");
l || (l = e.find("div.meta"), l.length || (l = A('').insertAfter(e.header())),
this.$tmeta = l);
l.html(m.join("\n")).show();
g = !0;
} else l && l.text() && (l.text("").hide(), g = !0);
return g;
};
u.loadMessage = function(c) {
function a(N) {
if ("=" === N.charAt(0)) {
const K = N.split(" ");
N = K[0].substring(1);
K[0] = [ "Zero", "One", "Two" ][Number(N)] || N;
N = K.join(" ");
}
return N;
}
function e(N, K) {
const T = X;
var Q = ba[0];
N.off();
N.titled() !== Q && t(N, Q, K || "en");
Q = !1;
x.setSrcMeta(c, N) && (Q = !0);
if (c.plural()) {
Q = -1;
let S = [], W = [];
const Y = N.id + "-";
K = c.sourceForms() || K && K.plurals || [ "One", "Other" ];
const ca = K.length;
if (2 !== ca || "=" === K[0].charAt(0) && "=1" !== K[0]) for (;++Q < ca; ) S[Q] = Y + String(Q),
W[Q] = a(K[Q].split(" ", 1)[0]) + ":"; else S = [ Y + "-0", Y + "-1" ], W = [ ba[1], ba[2] ];
N.splity.apply(N, S);
N.each(function(da, V) {
da.header(W[V]).textarea(c.source(null, V), T).setStrf(F).setMode(Z).setInvs(E);
});
N.lock();
T && N.each(function(da, V) {
m(da, V);
});
} else Q && N.redraw(), N.textarea(c.source(), T).setStrf(F).setMode(Z).setInvs(E),
T && m(N, 0);
}
function m(N, K) {
N.on("changing", function(T, Q) {
c.source(Q, K);
0 === K && x.updateListCell(c, "source");
x.unsave(c, K);
}).on("changed", function() {
0 === K && x.po.reIndex(c);
x.dict && x.rebuildSearch();
x.fire("poUpdate", [ c ]);
});
}
function g(N, K, T, Q) {
P && K.eachTextarea(function(W) {
W.ping();
});
K.off("changing").off("changed");
var S = T.isKnown() && T.label || "Target";
S = f(ba[3], S);
K.titled() !== S && t(K, S, T);
S = !1;
!N && x.setSrcMeta(c, K) && (S = !0);
x.setTrgMeta(c, Q, K) && (S = !0);
x.setStatus(c, Q);
if (1 !== T.nplurals && c.pluralized()) {
N = function(V) {
Y.push(a(da[V] || "Form " + V));
W.push(ca + String(V));
};
let W = [], Y = [];
const ca = K.id + "-", da = c.targetForms() || T.plurals || [ "One", "Other" ];
S = da.length;
for (c.eachMsg(N); (T = W.length) < S; ) N(T);
K.splitx.apply(K, W);
K.each(function(V, aa) {
const la = P && !c.disabled(aa);
V.textarea(c.translation(aa), la).setStrf(F).setMode(Z).setInvs(E);
P && l(V, aa);
});
K.navigize(Y, Q || null).on("wgTabSelect", function(V, aa) {
(V = P && V.cell.editable()) && V.focus();
x.setTrgMeta(c, aa, K);
x.setStatus(c, aa);
x.fire("poTab", [ aa ]);
});
} else S && K.redraw(), K.textarea(c.translation(), P && !c.disabled(0)).setStrf(F).setMode(Z).setInvs(E),
P && l(K, 0);
}
function l(N, K) {
function T() {
Q = null;
x.validate(c);
const W = c.errors(K).join(" ");
S !== W && (S = W, x.setTrgMeta(c, K, N) && N.redraw(), x.reCssRow(c));
}
let Q, S = c.errors(K).join(" ");
N.on("changing", function(W, Y, ca) {
Q && (clearTimeout(Q), Q = null);
c.translate(Y, K);
0 === K && x.updateListCell(c, "target");
c.fuzzy(K) && c.saved(K) ? x.fuzzy(!1, c, K) : x.unsave(c, K);
"" === Y ? (x.fire("poEmpty", [ !0, c, K ]), x.setStatus(c, K)) : "" === ca && (x.fire("poEmpty", [ !1, c, K ]),
x.setStatus(c, K));
Q = setTimeout(T, S ? 300 : 1e3);
}).on("changed", function() {
x.dict && x.rebuildSearch();
x.fire("poUpdate", [ c ]);
});
}
function r(N) {
N.off();
const K = ba[4];
N.titled() !== K && (t(N, K), x.setStatus(null));
N.textarea(c.context(), !0).setMode(Z).setInvs(E);
ha && N.on("changing", function(T, Q) {
c.context(Q);
x.updateListCell(c, "source");
x.unsave(c, ea);
}).on("changed", function() {
x.po.reIndex(c);
x.dict && x.rebuildSearch();
x.fire("poUpdate", [ c ]);
});
}
function z(N) {
const K = ba[5];
N.titled() !== K && t(N, K);
N.off().on("changing", function(T, Q) {
c.comment(Q);
x.fire("poComment", [ c, Q ]);
x.unsave(c, ea);
}).textarea(c.comment(), !0);
}
const x = this;
var D = c.isHTML();
const E = x.inv || !1, G = this.fmt || null, F = c.format() || null, H = c.is(x.active), M = x.sourceCell, O = x.targetCell, R = x.contextCell, I = x.commentCell, P = x.editable.target, X = x.editable.source, ha = x.editable.context, ma = x.sourceLocale, ja = x.targetLocale, ba = x.labels;
let ea = 0, Z = x.mode, fa = h;
x.html !== D && (x.html = D, "code" !== x.mode && (Z = D ? "html" : "", x.setMode(Z)));
x.active = c;
M && e(M, ma);
R && r(R);
O && ja && (ea = O.navigated() || 0, g(M, O, ja, ea));
I && z(I);
fa && (fa.exists() || (fa = fa.parent()), (D = fa.editable()) && D.focus());
G !== F && (this.fmt = F);
H || x.fire("poSelected", [ c, ea ]);
};
u.unloadActive = function() {
function c(e) {
e && e.text("").hide();
}
function a(e) {
e && e.off().clear();
}
c(this.$smeta);
c(this.$tmeta);
a(this.sourceCell);
a(this.contextCell);
a(this.targetCell);
this.commentCell && this.commentCell.off();
this.active && (this.fire("poDeselected", [ this.active ]), this.active = null);
return this;
};
u.loadNothing = function() {
const c = this.t(), a = this.mode || "", e = this.inv || !1, m = this.fmt;
this.unloadActive();
this.setStatus(null);
let g = this.commentCell;
g && g.textarea("", !1);
if (g = this.sourceCell) g.textarea("", !1).setStrf(m).setMode(a).setInvs(e), g.title(c._x("Source text not loaded", "Editor") + ":");
if (g = this.contextCell) g.textarea("", !1).setMode(a).setInvs(e), g.title(c._x("Context not loaded", "Editor") + ":");
if (g = this.targetCell) g.textarea("", !1).setStrf(m).setMode(a).setInvs(e), g.title(c._x("Translation not loaded", "Editor") + ":");
this.fire("poSelected", [ null ]);
};
u.updateListCell = function(c, a) {
a = this.getListColumns()[a];
c = this.po.indexOf(c);
(c = this.listTable.row(c)) && c.rendered && c.update(a);
};
u.cellText = function(c) {
return (c = -1 !== c.indexOf("<") || -1 !== c.indexOf("&") ? q(c) : c.trim()) || " ";
};
u.fuzzy = function(c, a, e) {
a = a || this.active;
const m = a.fuzzy(e);
!0 !== c || m ? !1 === c && m && this.flag(0, a, e) && this.fire("poFuzzy", [ a, !1, e ]) : this.flag(4, a, e) && this.fire("poFuzzy", [ a, !0, e ]);
return m;
};
u.flag = function(c, a, e) {
if (!a) {
a = this.active;
e = this.getTargetOffset();
if (null == e) return null;
e && a.targetForms() && (e = 0);
}
const m = a.flagged(e);
if (null == c) return m;
if (m === c || c && !a.translated(e) || !this.fire("poFlag", [ c, m, a, e ])) return !1;
a.flag(c, e);
this.fire("poUpdate", [ a ]) && this.unsave(a, e);
this.setStatus(a, e);
return !0;
};
u.add = function(c, a) {
let e, m = this.po.get(c, a);
m ? e = this.po.indexOf(m) : (e = this.po.length, m = this.po.add(c, a), this.load(this.po, -1),
this.fire("poAdd", [ m ]), this.fire("poUpdate", [ m ]));
this.lastSearch && this.filter("");
this.listTable.select(e);
return m;
};
u.del = function(c) {
if (c = c || this.active) {
var a = this.lastSearch, e = this.po.del(c);
null != e && (this.unsave(c), this.fire("poDel", [ c ]), this.fire("poUpdate", [ c ]),
this.reload(), this.dict && this.rebuildSearch(), this.active && this.active.equals(c) && this.unloadActive(),
this.po.length && (a && this.filter(a), this.active || (e = Math.min(e, this.po.length - 1),
this.listTable.select(e))));
}
};
u.setMono = function(c) {
return this.setMode(c ? "code" : this.html ? "html" : "");
};
u.setMode = function(c) {
if (this.mode !== c) {
this.mode = c;
this.callTextareas(function(m) {
m.setMode(c);
});
const a = this.active, e = this.sourceCell;
a && a.refs() && e && this.setSrcMeta(a, e) && e.redraw();
}
return this;
};
u.getMono = function() {
return "code" === this.mode;
};
u.setInvs = function(c) {
(this.inv || !1) !== c && (this.inv = c, this.callTextareas(function(a) {
a.setInvs(c);
}), this.fire("poInvs", [ c ]));
return this;
};
u.getInvs = function() {
return this.inv || !1;
};
u.callTextareas = function(c) {
var a = this.targetCell;
a && a.eachTextarea(c);
(a = this.contextCell) && a.eachTextarea(c);
(a = this.sourceCell) && a.eachTextarea(c);
return this;
};
u.focus = function() {
const c = this.getTargetEditable();
c && c.focus();
return this;
};
u.validate = function(c) {
return 0;
};
return w;
}({}, J, L));
B.register("$31", function(w, v, C) {
w.init = function() {
const y = /%([1-9]\d*\$)?[s%]/, p = /%([1-9]\d*\$)?(?:'.|[-+0 ])*\d*(?:\.\d+)?(.|$)/g;
return {
parse: function(t, d) {
const b = d && d.count || 0;
d = d && d.types || {};
let k = !0, f = 0, h = 0;
for (var n; null != (n = p.exec(t)); ) {
const q = n[2];
if ("%" !== q || "%%" !== n[0]) {
if ("" === q || -1 === "suxXbcdeEfFgGo".indexOf(q)) {
k = !1;
break;
}
null == n[1] ? n = ++h : (n = parseInt(n[1]), f = Math.max(f, n));
null == d[n] && (d[n] = {});
d[n][q] = !0;
}
}
if (k) return {
valid: !0,
count: Math.max(f, h, b),
types: d
};
p.lastIndex = 0;
return {
valid: !1,
count: 0,
types: {}
};
},
sniff: function(t) {
return y.test(t);
}
};
};
return w;
}({}, J, L));
B.register("$13", function(w, v, C) {
function y() {
this.init();
this.sourceLocale = {
lang: "en",
label: "English",
plurals: [ "One", "Other" ]
};
}
function p(f) {
f = A('');
B.require("$12", "tooltip.js").init(f);
return f;
}
function t(f) {
return p("cloud").attr("title", f.labels[8] + " (Ctrl-U)").on("click", function(h) {
h.preventDefault();
f.focus().fuzzy(!f.fuzzy());
});
}
function d(f) {
return p("robot").attr("title", f.labels[9] + " (Ctrl-J)").on("click", function(h) {
h.preventDefault();
f.fire("poHint");
});
}
function b(f, h) {
return B.require("$6", "string.js").vsprintf(f, h);
}
w.init = function(f) {
const h = new y();
f = h.setRootCell(f);
var n = f.splity("po-list", "po-edit");
let q = n[0], u = n[1];
n = u.splitx("po-trans", "po-comment");
var c = n[0];
let a = n[1].header("Loading..");
n = c.splity("po-source", "po-target");
c = n[0].header("Loading..");
n = n[1].header("Loading..");
f.distribute([ .34 ]);
u.distribute([ .8 ]);
h.setListCell(q);
h.setSourceCell(c);
h.setTargetCell(n);
h.commentCell = a;
h.editable.source = !1;
return h;
};
v = y.prototype = B.require("$30", "base.js").extend(y);
v.getListHeadings = function() {
const f = this.t(), h = [ f._x("Source text", "Editor") ];
this.targetLocale && (h[1] = f._x("Translation", "Editor"));
return h;
};
v.getListColumns = function() {
const f = {
source: 0
};
this.targetLocale && (f.target = 1);
return f;
};
v.getListEntry = function(f) {
const h = this.cellText, n = [ function() {
let q, u = h(f.source() || ""), c = f.context();
return c ? (q = C.createElement("p"), q.appendChild(C.createElement("mark")).innerText = c,
q.appendChild(C.createTextNode(" " + u)), q) : u;
} ];
this.targetLocale && (n[1] = function() {
return h(f.translation() || "");
});
return n;
};
v.stats = function() {
let f = this.po, h = f.length, n = 0, q = 0, u = 0;
f.each(function(c, a) {
a.fuzzy() ? u++ : a.translated() ? n++ : q++;
});
return {
t: h,
p: n.percent(h) + "%",
f: u,
u: q
};
};
v.unlock = function() {
const f = this.targetLocale;
this._unlocked || (this.editable = {
source: !0,
context: !0,
target: !1
}, this.po && this.po.unlock(), this.contextCell = this.targetCell, delete this.targetCell,
f && (this._unlocked = f, delete this.targetLocale, this.reload(), this.fire("poLock", [ !1 ])),
this.active && this.loadMessage(this.active));
};
v.lock = function() {
const f = this._unlocked;
f && (this.targetLocale = f, delete this._unlocked, this.po && this.po.lock(f),
this.editable = {
source: !1,
context: !1,
target: !0
}, this.targetCell = this.contextCell, delete this.contextCell, this.reload(), this.fire("poLock", [ !0, f ]),
this.active && this.loadMessage(this.active));
};
v.locked = function() {
return !this._unlocked;
};
v.setStatus = function(f) {
let h = this.$tnav;
if (null == f) h && (h.remove(), this.$tnav = null); else {
h || (this.$tnav = h = A("").append(t(this)).append(d(this)).appendTo(this.targetCell.header()));
var n = [];
f.translated() ? f.fuzzy() && n.push("po-fuzzy") : n.push("po-empty");
h.attr("class", n.join(" "));
}
};
v.getSorter = function() {
function f(q, u) {
const c = q.weight(), a = u.weight();
return c === a ? h(q, u) : c > a ? -1 : 1;
}
function h(q, u) {
return q.hash().localeCompare(u.hash());
}
const n = this;
return function(q) {
const u = n.po, c = n.locked() ? f : h;
q.sort(function(a, e) {
return c(u.row(a), u.row(e));
});
};
};
v.validate = function(f) {
f.err = null;
if (f.untranslated(0)) return 0;
const h = [];
let n = this.validateMessagePrintf(f, h);
n && (f.err = h);
return n;
};
v.validateMessagePrintf = function(f, h) {
const n = f.format();
if ("no-" === n.substring(0, 3)) return 0;
const q = f.msgid(), u = f.msgidPlural();
null == k && (k = B.require("$31", "printf.js").init());
var c = k;
if (!("" !== n || c.sniff(q) || "" !== u && c.sniff(u))) return 0;
let a = 0, e = c.parse(q);
u && e.valid && (e = c.parse(u, e));
if (!e.valid) return 0;
let m = e.count;
if (0 !== m || "" !== n) {
var g = this;
f.eachMsg(function(l, r) {
h[l] = [];
if ("" !== r) {
r = c.parse(r);
var z = r.count;
l = h[l];
if (r.valid) if (z > m) l.push(b(g.t()._("Too many placeholders; source text formatting suggests a maximum of %s"), [ m ])),
a++; else if (z < m && "" === u) l.push(b(g.t()._("Missing placeholders; source text formatting suggests at least %s"), [ m ])),
a++; else {
z = e.types;
for (const x in r.types) for (const D in r.types[x]) if (null == z[x] || null == z[x][D]) {
l.push(g.t()._("Mismatching placeholder type; check against source text formatting"));
a++;
return;
}
} else l.push(g.t()._("Possible syntax error in string formatting")), a++;
}
});
return a;
}
};
v.handle = {};
let k;
return w;
}({}, J, L));
B.register("$14", function(w, v, C) {
const y = {
copy: 66,
clear: 75,
save: 83,
fuzzy: 85,
next: 40,
prev: 38,
enter: 13,
invis: 73,
hint: 74
}, p = {
38: !0,
40: !0,
73: !0
}, t = {
66: function(d, b) {
if (d = b.current()) d.normalize(), b.focus().pasteMessage(d);
},
75: function(d, b) {
if (d = b.current()) d.untranslate(), b.focus().pasteMessage(d);
},
85: function(d, b) {
b.focus().fuzzy(!b.fuzzy());
},
13: function(d, b) {
b.getFirstEditable() && b.next(1, !0, !0);
},
40: function(d, b) {
d = d.shiftKey;
b.next(1, d, d);
},
38: function(d, b) {
d = d.shiftKey;
b.next(-1, d, d);
},
73: function(d, b) {
if (!d.shiftKey) return !1;
b.setInvs(!b.getInvs());
}
};
w.init = function(d, b) {
function k(h) {
if (h.isDefaultPrevented() || !h.metaKey && !h.ctrlKey) return !0;
const n = h.which;
if (!f[n]) return !0;
const q = t[n];
if (!q || h.altKey || h.shiftKey && !p[n] || !1 === q(h, d)) return !0;
h.stopPropagation();
h.preventDefault();
return !1;
}
const f = {};
A(b || v).on("keydown", k);
return {
add: function(h, n) {
t[y[h]] = n;
return this;
},
enable: function() {
for (const h in arguments) f[y[arguments[h]]] = !0;
return this;
},
disable: function() {
A(b || v).off("keydown", k);
d = b = null;
for (const h in t) f[h] = !1;
}
};
};
return w;
}({}, J, L));
B.register("$32", function(w, v, C) {
function y() {
this.reIndex([]);
}
w.init = function() {
return new y();
};
v = y.prototype;
v.reIndex = function(p) {
const t = {}, d = p.length;
let b = -1;
for (;++b < d; ) t[p[b]] = b;
this.keys = p;
this.length = b;
this.ords = t;
};
v.key = function(p, t) {
if (null == t) return this.keys[p];
const d = this.keys[p], b = this.ords[t];
if (t !== d) {
if (null != b) throw Error("Clash with item at [" + b + "]");
this.keys[p] = t;
delete this.ords[d];
this.ords[t] = p;
}
return p;
};
v.indexOf = function(p) {
p = this.ords[p];
return null == p ? -1 : p;
};
v.add = function(p, t) {
let d = this.ords[p];
null == d && (this.keys[this.length] = p, d = this.ords[p] = this.length++);
this[d] = t;
return d;
};
v.get = function(p) {
return this[this.ords[p]];
};
v.has = function(p) {
return null != this.ords[p];
};
v.del = function(p) {
this.cut(this.ords[p], 1);
};
v.cut = function(p, t) {
t = t || 1;
const d = [].splice.call(this, p, t);
this.keys.splice(p, t);
this.reIndex(this.keys);
return d;
};
v.each = function(p) {
const t = this.keys, d = this.length;
let b = -1;
for (;++b < d; ) p(t[b], this[b], b);
return this;
};
v.sort = function(p) {
const t = this.length, d = this.keys, b = this.ords, k = [];
let f = -1;
for (;++f < t; ) k[f] = [ this[f], d[f] ];
k.sort(function(n, q) {
return p(n[0], q[0]);
});
for (f = 0; f < t; f++) {
var h = k[f];
this[f] = h[0];
h = h[1];
d[f] = h;
b[h] = f;
}
return this;
};
v.join = function(p) {
return [].join.call(this, p);
};
return w;
}({}, J, L));
B.register("$33", function(w, v, C) {
function y(p, t) {
var d = new RegExp("^.{0," + (p - 1) + "}[" + t + "]"), b = new RegExp("^[^" + t + "]+");
return function(k, f) {
for (var h = k.length, n; h > p; ) {
n = d.exec(k) || b.exec(k);
if (null == n) break;
n = n[0];
f.push(n);
n = n.length;
h -= n;
k = k.substring(n);
}
0 !== h && f.push(k);
return f;
};
}
w.create = function(p) {
function t(q) {
return f[q] || "\\" + q;
}
var d = /(?:\r\n|[\r\n\v\f\u2028\u2029])/g, b = /[ \r\n]+/g, k = /[\t\v\f\x07\x08\\"]/g, f = {
"\t": "\\t",
"\v": "\\v",
"\f": "\\f",
"": "\\a",
"\b": "\\b"
};
if (null == p || isNaN(p = Number(p))) p = 79;
if (0 < p) {
var h = y(p - 3, " ");
var n = y(p - 2, "-– \\.,:;\\?!\\)\\]\\}\\>");
}
return {
pair: function(q, u) {
if (!u) return q + ' ""';
u = u.replace(k, t);
var c = 0;
u = u.replace(d, function() {
c++;
return "\\n\n";
});
if (!(c || p && p < u.length + q.length + 3)) return q + ' "' + u + '"';
q = [ q + ' "' ];
u = u.split("\n");
if (n) for (var a = -1, e = u.length; ++a < e; ) n(u[a], q); else q = q.concat(u);
return q.join('"\n"') + '"';
},
prefix: function(q, u) {
q = q.split(d);
return u + q.join("\n" + u);
},
refs: function(q) {
q = q.replace(b, " ", q);
h && (q = h(q, []).join("\n#: "));
return "#: " + q;
}
};
};
return w;
}({}, J, L));
B.register("$46", function(w, v, C) {
function y() {
this.length = 0;
}
w.init = function() {
return new y();
};
v = y.prototype;
v.push = function(p) {
this[this.length++] = p;
return this;
};
v.sort = function(p) {
[].sort.call(this, p);
return this;
};
v.each = function(p) {
for (var t = -1, d = this.length; ++t < d; ) p(t, this[t]);
return this;
};
return w;
}({}, J, L));
B.register("$34", function(w, v, C) {
function y() {}
w.extend = function(p) {
return p.prototype = new y();
};
v = y.prototype = B.require("$44", "abstract.js").init([ "add", "load" ]);
v.row = function(p) {
return this.rows[p];
};
v.lock = function(p) {
return this.locale(p || {
lang: "zxx",
label: "Unknown",
nplurals: 1,
pluraleq: "n!=1"
});
};
v.unlock = function() {
const p = this.loc;
this.loc = null;
return p;
};
v.locale = function(p) {
null == p ? p = this.loc : this.loc = p = B.require("$43", "locale.js").cast(p);
return p;
};
v.each = function(p) {
this.rows.each(p);
return this;
};
v.indexOf = function(p) {
"object" !== typeof p && (p = this.get(p));
if (!p) return -1;
null == p.idx && (p.idx = this.rows.indexOf(p.hash()));
return p.idx;
};
v.get = function(p) {
return this.rows && this.rows.get(p);
};
v.has = function(p) {
return this.rows && this.rows.has(p);
};
v.del = function(p) {
p = this.indexOf(p);
if (-1 !== p) {
const t = this.rows.cut(p, 1);
if (t && t.length) return this.length = this.rows.length, this.rows.each(function(d, b, k) {
b.idx = k;
}), p;
}
};
v.reIndex = function(p, t) {
const d = p.hash(), b = this.indexOf(p), k = this.rows.indexOf(d);
return k === b ? b : -1 !== k ? (t = (t || 0) + 1, p.source("Error, duplicate " + String(t) + ": " + p.source()),
this.reIndex(p, t)) : this.rows.key(b, d);
};
v.sort = function(p) {
this.rows.sort(p);
return this;
};
v.export = function() {
const p = this.rows, t = p.length, d = B.require("$46", "list.js").init();
let b = -1;
for (;++b < t; ) d.push(p[b]);
return d;
};
return w;
}({}, J, L));
B.register("$35", function(w, v, C) {
function y(d, b, k) {
if (null == k) return d[b] || "";
d[b] = k || "";
return d;
}
function p() {
this._id = this.id = "";
}
function t(d, b) {
const k = d.length;
let f = -1;
for (;++f < k; ) b(f, d[f]);
}
w.extend = function(d) {
return d.prototype = new p();
};
v = p.prototype;
v.flag = function(d, b) {
const k = this.flg || (this.flg = []);
if (null != b) k[b] = d; else for (b = Math.max(k.length, this.src.length, this.msg.length); 0 !== b--; ) k[b] = d;
return this;
};
v.flagged = function(d) {
return (this.flg || [])[d || 0] || 0;
};
v.hasFlag = function() {
const d = this.flg || [];
let b = d.length;
for (;0 !== b--; ) if (this.isFlag(d[b])) return !0;
return !1;
};
v.isFlag = function(d) {
return 0 < d;
};
v.flags = function() {
const d = {}, b = [], k = this.flg || [];
let f = k.length;
for (;0 !== f--; ) {
const h = k[f];
d[h] || (d[h] = !0, b.push(h));
}
return b;
};
v.flaggedAs = function(d, b) {
const k = this.flg || [];
if (null != b) return d === k[b] || 0;
for (b = k.length; 0 !== b--; ) if (k[b] === d) return !0;
return !1;
};
v.fuzzy = function(d, b) {
const k = this.flaggedAs(4, d);
null != b && this.flag(b ? 4 : 0, d);
return k;
};
v.source = function(d, b) {
if (null == d) return this.src[b || 0] || "";
this.src[b || 0] = d;
return this;
};
v.plural = function(d, b) {
if (null == d) return this.src[b || 1] || "";
this.src[b || 1] = d || "";
return this;
};
v.sourceForms = function() {
return this.srcF;
};
v.targetForms = function() {
return this.msgF;
};
v.each = function(d) {
const b = this.src, k = this.msg, f = Math.max(b.length, k.length);
let h = -1;
for (;++h < f; ) d(h, b[h], k[h]);
return this;
};
v.eachSrc = function(d) {
t(this.src, d);
return this;
};
v.eachMsg = function(d) {
t(this.msg, d);
return this;
};
v.count = function() {
return Math.max(this.src.length, this.msg.length);
};
v.pluralized = function() {
return 1 < this.src.length || 1 < this.msg.length;
};
v.translate = function(d, b) {
this.msg[b || 0] = d || "";
return this;
};
v.untranslate = function(d) {
if (null != d) this.msg[d] = ""; else {
const b = this.msg, k = b.length;
for (d = 0; d < k; d++) b[d] = "";
}
return this;
};
v.translation = function(d) {
return this.msg[d || 0] || "";
};
v.errors = function(d) {
return this.err && this.err[d || 0] || [];
};
v.valid = function() {
return null == this.err;
};
v.translated = function(d) {
if (null != d) return !!this.msg[d];
const b = this.msg, k = b.length;
for (d = 0; d < k; d++) if (!b[d]) return !1;
return !0;
};
v.untranslated = function(d) {
if (null != d) return !this.msg[d];
const b = this.msg, k = b.length;
for (d = 0; d < k; d++) if (b[d]) return !1;
return !0;
};
v.comment = function(d) {
return y(this, "cmt", d);
};
v.notes = function(d) {
return y(this, "xcmt", d);
};
v.refs = function(d) {
return y(this, "rf", d);
};
v.format = function(d) {
return y(this, "fmt", d);
};
v.context = function(d) {
return y(this, "ctx", d);
};
v.tags = function() {
return this.tg;
};
v.getMax = function(d) {
return (this.mx || [ 0 ])[d] || 0;
};
v.toString = v.toText = function() {
return this.src.concat(this.msg, [ this.id, this.ctx ]).join(" ");
};
v.weight = function() {
let d = 0;
this.translation() || (d += 2);
this.fuzzy() && (d += 1);
return d;
};
v.equals = function(d) {
return this === d || this.hash() === d.hash();
};
v.hash = function() {
return this.id;
};
v.normalize = function() {
let d = -1, b = this.msg.length;
for (;++d < b; ) this.msg[d] = this.src[Math.min(d, 1)] || "";
};
v.disabled = function(d) {
return !!(this.lck || [])[d || 0];
};
v.disable = function(d) {
(this.lck || (this.lck = []))[d || 0] = !0;
return this;
};
v.saved = function(d) {
const b = this.drt;
if (null == b) return !0;
if (null != d) return !b[d];
for (d = b.length; 0 !== d--; ) if (b[d]) return !1;
return !0;
};
v.unsave = function(d) {
(this.drt || (this.drt = []))[d || 0] = !0;
return this;
};
v.save = function(d) {
null == d ? this.drt = null : (this.drt || (this.drt = []))[d] = !1;
return this;
};
v.is = function(d) {
return d && (d === this || d.idx === this.idx);
};
v.isHTML = function(d) {
if (null == d) return this.htm || !1;
this.htm = d;
};
v = null;
return w;
}({}, J, L));
B.register("$15", function(w, v, C) {
function y(f) {
return {
"Project-Id-Version": "PACKAGE VERSION",
"Report-Msgid-Bugs-To": "",
"POT-Creation-Date": f || "",
"PO-Revision-Date": f || "",
"Last-Translator": "",
"Language-Team": "",
Language: "",
"Plural-Forms": "",
"MIME-Version": "1.0",
"Content-Type": "text/plain; charset=UTF-8",
"Content-Transfer-Encoding": "8bit"
};
}
function p(f, h) {
f = f || "";
h && (f += "\0" + h);
return f;
}
function t(f) {
const h = v.console;
h && h.error && h.error(f.message || String(f));
}
function d(f) {
return B.require("$33", "format.js").create(f);
}
function b(f) {
this.locale(f);
this.clear();
this.head = y(this.now());
}
function k(f, h) {
this.src = [ f || "" ];
this.msg = [ h || "" ];
}
w.create = function(f) {
return new b(f);
};
C = B.require("$34", "messages.js").extend(b);
C.clear = function() {
this.rows = B.require("$32", "collection.js").init();
this.length = 0;
return this;
};
C.now = function() {
function f(a, e) {
for (a = String(a); a.length < e; ) a = "0" + a;
return a;
}
var h = new Date();
const n = h.getUTCFullYear(), q = h.getUTCMonth() + 1, u = h.getUTCDate(), c = h.getUTCHours();
h = h.getUTCMinutes();
return f(n, 4) + "-" + f(q, 2) + "-" + f(u, 2) + " " + f(c, 2) + ":" + f(h, 2) + "+0000";
};
C.header = function(f, h) {
const n = this.head || (this.head = {});
if (null == h) return this.headers()[f] || "";
n[f] = h || "";
return this;
};
C.headers = function(f) {
const h = this.now(), n = this.head || (this.head = y(h));
if (null != f) {
for (u in f) n[u] = f[u];
return this;
}
const q = this.locale();
f = {};
for (u in n) f[u] = String(n[u]);
if (q) {
f.Language = String(q) || "zxx";
f["Language-Team"] = q.label || f.Language;
f["Plural-Forms"] = "nplurals=" + (q.nplurals || "2") + "; plural=" + (q.pluraleq || "n!=1") + ";";
var u = "PO-Revision-Date";
} else f.Language = "", f["Plural-Forms"] = "nplurals=INTEGER; plural=EXPRESSION;",
f["PO-Revision-Date"] = "YEAR-MO-DA HO:MI+ZONE", u = "POT-Creation-Date";
f[u] || (f[u] = h);
f["X-Generator"] = "Loco https://localise.biz/";
return f;
};
C.get = function(f, h) {
f = p(f, h);
return this.rows.get(f);
};
C.add = function(f, h) {
f instanceof k || (f = new k(f));
h && f.context(h);
h = f.hash();
this.rows.get(h) ? t("Duplicate message at index " + this.indexOf(f)) : (f.idx = this.rows.add(h, f),
this.length = this.rows.length);
return f;
};
C.load = function(f) {
let h = -1, n, q;
var u;
let c, a, e, m = (u = this.locale()) && u.nplurals || 2, g = [];
for (;++h < f.length; ) n = f[h], null == n.parent ? (q = n.source || n.id, u = n.target || "",
c = n.context, q || c ? (a = new k(q, u), a._id = n._id, c && a.context(c), n.flag && a.flag(n.flag, 0),
n.comment && a.comment(n.comment), n.notes && a.notes(n.notes), n.refs && a.refs(n.refs),
a.format(n.format), n.message = a, this.add(a), n.prev && n.prev[0] && (a.prev(n.prev[0].source, n.prev[0].context),
n.prev[1] && a._src.push(n.prev[1].source || ""))) : 0 === h && "object" === typeof u && (this.head = u,
this.headcmt = n.comment)) : g.push(n);
for (h = -1; ++h < g.length; ) try {
n = g[h];
q = n.source || n.id;
a = f[n.parent] && f[n.parent].message;
if (!a) throw Error("parent missing for plural " + q);
e = n.plural;
1 === e && a.plural(q);
e >= m || (n.flag && a.flag(n.flag, e), a.translate(n.target || "", e), n.format && !a.format() && a.format(n.format));
} catch (l) {
t(l);
}
return this;
};
C.wrap = function(f) {
this.fmtr = d(f);
return this;
};
C.toString = function() {
var f, h = this.locale(), n = [], q = [], u = this.headers(), c = !h, a = h && h.nplurals || 2, e = this.fmtr || d();
u[h ? "PO-Revision-Date" : "POT-Creation-Date"] = this.now();
for (f in u) q.push(f + ": " + u[f]);
q = new k("", q.join("\n"));
q.comment(this.headcmt || "");
c && q.fuzzy(0, !0);
n.push(q.toString());
n.push("");
this.rows.each(function(m, g) {
m && (n.push(g.cat(e, c, a)), n.push(""));
});
return n.join("\n");
};
C = B.require("$35", "message.js").extend(k);
C.msgid = function() {
return this.src[0];
};
C.msgidPlural = function() {
return this.src[1] || "";
};
C.prev = function(f, h) {
this._src = [ f || "" ];
this._ctx = h;
};
C.hash = function() {
return p(this.source(), this.context());
};
C.toString = function() {
return this.cat(d());
};
C.cat = function(f, h, n) {
var q = [], u;
(u = this.cmt) && q.push(f.prefix(u, "# "));
(u = this.xcmt) && q.push(f.prefix(u, "#. "));
var c = this.rf;
if (u = this._id) c += (c ? " " : "") + "loco:" + u;
c && /\S/.test(c) && q.push(f.refs(c));
!h && this.fuzzy() && q.push("#, fuzzy");
(u = this.fmt) && q.push("#, " + u + "-format");
(u = this._ctx) && q.push(f.prefix(f.pair("msgctxt", u), "#| "));
if (u = this._src) u[0] && q.push(f.prefix(f.pair("msgid", u[0]), "#| ")), u[1] && q.push(f.prefix(f.pair("msgid_plural", u[1]), "#| "));
(u = this.ctx) && q.push(f.pair("msgctxt", u));
q.push(f.pair("msgid", this.src[0]));
if (null == this.src[1]) q.push(f.pair("msgstr", h ? "" : this.msg[0])); else for (c = -1,
q.push(f.pair("msgid_plural", this.src[1])), u = this.msg || [ "", "" ], n = n || u.length; ++c < n; ) q.push(f.pair("msgstr[" + c + "]", h ? "" : u[c] || ""));
return q.join("\n");
};
C.compare = function(f, h) {
let n = this.weight(), q = f.weight();
if (n > q) return 1;
if (n < q) return -1;
if (h) {
n = this.hash().toLowerCase();
q = f.hash().toLowerCase();
if (n < q) return 1;
if (n > q) return -1;
}
return 0;
};
C.copy = function() {
let f = new k(), h, n;
for (h in this) this.hasOwnProperty(h) && ((n = this[h]) && n.concat && (n = n.concat()),
f[h] = n);
return f;
};
return w;
}({}, J, L));
B.register("$17", function(w, v, C) {
w.init = function(y, p) {
function t() {
return f || (f = A('').dialog({
dialogClass: "loco-modal loco-modal-wide",
modal: !0,
autoOpen: !1,
closeOnEscape: !0,
resizable: !1,
height: 500
}));
}
function d(h, n, q) {
h = A("").text(q);
t().dialog("close").html("").dialog("option", "title", "Error").append(h).dialog("open");
}
function b(h) {
const n = h && h.code;
if (n) {
for (var q = n.length, u = A("