1!function (t, e) { "function" == typeof define && define.amd ? define(["jquery"], function (a) { return t.Tablesaw = e(a, t) }) : "object" == typeof exports ? module.exports = e("document" in t ? require("jquery") : require("jquery")(t), t) : t.Tablesaw = e(jQuery, t) }("undefined" != typeof window ? window : this, function (t, e) { "use strict"; var a = e.document, s = /complete|loaded/.test(a.readyState); a.addEventListener("DOMContentLoaded", function () { s = !0 }); var n, i, o, l, r, c, h, d, u, b = { i18n: { modeStack: "Stack", modeSwipe: "Swipe", modeToggle: "Toggle", modeSwitchColumnsAbbreviated: "Cols", modeSwitchColumns: "Columns", columnToggleButton: "Columns", columnToggleError: "No eligible columns.", sort: "Sort", swipePreviousColumn: "Previous column", swipeNextColumn: "Next column" }, mustard: "head" in a && (!e.blackberry || e.WebKitPoint) && !e.operamini, $: t, _init: function (t) { b.$(t || a).trigger("enhance.tablesaw") }, init: function (t) { (s = s || /complete|loaded/.test(a.readyState)) ? b._init(t) : "addEventListener" in a && a.addEventListener("DOMContentLoaded", function () { b._init(t) }) } }; return t(a).on("enhance.tablesaw", function () { "undefined" != typeof TablesawConfig && TablesawConfig.i18n && (b.i18n = t.extend(b.i18n, TablesawConfig.i18n || {})), b.i18n.modes = [b.i18n.modeStack, b.i18n.modeSwipe, b.i18n.modeToggle] }), b.mustard && t(a.documentElement).addClass("tablesaw-enhanced"), function () { var s = "tablesaw-bar", n = { create: "tablesawcreate", destroy: "tablesawdestroy", refresh: "tablesawrefresh", resize: "tablesawresize" }, i = {}; b.events = n; var o = function (e) { if (!e) throw new Error("Tablesaw requires an element."); this.table = e, this.$table = t(e), this.$thead = this.$table.children().filter("thead").eq(0), this.$tbody = this.$table.children().filter("tbody"), this.mode = this.$table.attr("data-tablesaw-mode") || "stack", this.$toolbar = null, this.attributes = { subrow: "data-tablesaw-subrow", ignorerow: "data-tablesaw-ignorerow" }, this.init() }; o.prototype.init = function () { if (!this.$thead.length) throw new Error("tablesaw: a <thead> is required, but none was found."); if (!this.$thead.find("th").length) throw new Error("tablesaw: no header cells found. Are you using <th> inside of <thead>?"); this.$table.attr("id") || this.$table.attr("id", "tablesaw-" + Math.round(1e4 * Math.random())), this.createToolbar(), this._initCells(), this.$table.data("tablesaw", this), this.$table.trigger(n.create, [this]) }, o.prototype.getConfig = function (e) { var a = t.extend(i, e || {}); return t.extend(a, "undefined" != typeof TablesawConfig ? TablesawConfig : {}) }, o.prototype._getPrimaryHeaderRow = function () { return this._getHeaderRows().eq(0) }, o.prototype._getHeaderRows = function () { return this.$thead.children().filter("tr").filter(function () { return !t(this).is("[data-tablesaw-ignorerow]") }) }, o.prototype._getRowIndex = function (t) { return t.prevAll().length }, o.prototype._getHeaderRowIndeces = function () { var e = this, a = []; return this._getHeaderRows().each(function () { a.push(e._getRowIndex(t(this))) }), a }, o.prototype._getPrimaryHeaderCells = function (t) { return (t || this._getPrimaryHeaderRow()).find("th") }, o.prototype._$getCells = function (e) { var a = this; return t(e).add(e.cells).filter(function () { var e = t(this), s = e.parent(), n = e.is("[colspan]"); return !(s.is("[" + a.attributes.subrow + "]") || s.is("[" + a.attributes.ignorerow + "]") && n) }) }, o.prototype._getVisibleColspan = function () { var e = 0; return this._getPrimaryHeaderCells().each(function () { var a = t(this); "none" !== a.css("display") && (e += parseInt(a.attr("colspan"), 10) || 1) }), e }, o.prototype.getColspanForCell = function (e) { var a = this._getVisibleColspan(), s = 0; return e.closest("tr").data("tablesaw-rowspanned") && s++ , e.siblings().each(function () { var e = t(this), a = parseInt(e.attr("colspan"), 10) || 1; "none" !== e.css("display") && (s += a) }), a - s }, o.prototype.isCellInColumn = function (e, a) { return t(e).add(e.cells).filter(function () { return this === a }).length }, o.prototype.updateColspanCells = function (e, a, s) { var n = this, i = n._getPrimaryHeaderRow();
1 this.$table.find("[rowspan][data-tablesaw-priority]").each(function () { var e = t(this); if ("persist" === e.attr("data-tablesaw-priority")) { var a = e.closest("tr"), s = parseInt(e.attr("rowspan"), 10); s > 1 && ((a = a.next()).data("tablesaw-rowspanned", !0), s--) } }), this.$table.find("[colspan],[data-tablesaw-maxcolspan]").filter(function () { return t(this).closest("tr")[0] !== i[0] }).each(function () { var i = t(this); if (void 0 === s || n.isCellInColumn(a, this)) { var o = n.getColspanForCell(i); e && void 0 !== s && i[0 === o ? "addClass" : "removeClass"](e); var l = parseInt(i.attr("data-tablesaw-maxcolspan"), 10); l ? o > l && (o = l) : i.attr("data-tablesaw-maxcolspan", i.attr("colspan")), i.attr("colspan", o) } }) }, o.prototype._findPrimaryHeadersForCell = function (t) { for (var e = this._getPrimaryHeaderRow(), a = this._getRowIndex(e), s = [], n = 0; n < this.headerMapping.length; n++)if (n !== a) for (var i = 0; i < this.headerMapping[n].length; i++)this.headerMapping[n][i] === t && s.push(this.headerMapping[a][i]); return s }, o.prototype.getRows = function () { var e = this; return this.$table.find("tr").filter(function () { return t(this).closest("table").is(e.$table) }) }, o.prototype.getBodyRows = function (e) { return (e ? t(e) : this.$tbody).children().filter("tr") }, o.prototype.getHeaderCellIndex = function (t) { for (var e = this.headerMapping[0], a = 0; a < e.length; a++)if (e[a] === t) return a; return -1 }, o.prototype._initCells = function () { this.$table.find("[data-tablesaw-maxcolspan]").each(function () { var e = t(this); e.attr("colspan", e.attr("data-tablesaw-maxcolspan")) }); var e = this.getRows(), a = []; e.each(function (t) { a[t] = [] }), e.each(function (e) { var s = 0; t(this).children().each(function () { for (var t = parseInt(this.getAttribute("data-tablesaw-maxcolspan") || this.getAttribute("colspan"), 10), n = parseInt(this.getAttribute("rowspan"), 10); a[e][s];)s++; if (a[e][s] = this, t) for (var i = 0; i < t - 1; i++)s++ , a[e][s] = this; if (n) for (var o = 1; o < n; o++)a[e + o][s] = this; s++ }) }); for (var s = this._getHeaderRowIndeces(), n = 0; n < a[0].length; n++)for (var i = 0, o = s.length; i < o; i++) { var l, r = a[s[i]][n], c = s[i]; for (r.cells || (r.cells = []); c < a.length;)r !== (l = a[c][n]) && r.cells.push(l), c++ } this.headerMapping = a }, o.prototype.refresh = function () { this._initCells(), this.$table.trigger(n.refresh, [this]) }, o.prototype._getToolbarAnchor = function () { var t = this.$table.parent(); return t.is(".tablesaw-overflow") ? t : this.$table }, o.prototype._getToolbar = function (t) { return t || (t = this._getToolbarAnchor()), t.prev().filter("." + s) }, o.prototype.createToolbar = function () { var e = this._getToolbarAnchor(), a = this._getToolbar(e); a.length || (a = t("<div>").addClass(s).insertBefore(e)), this.$toolbar = a, this.mode && this.$toolbar.addClass("tablesaw-mode-" + this.mode) }, o.prototype.destroy = function () { this._getToolbar().each(function () { this.className = this.className.replace(/\btablesaw-mode\-\w*\b/gi, "") }); var s = this.$table.attr("id"); t(a).off("." + s), t(e).off("." + s), this.$table.trigger(n.destroy, [this]), this.$table.removeData("tablesaw") }, t.fn.tablesaw = function () { return this.each(function () { t(this).data("tablesaw") || new o(this) }) }; var l = t(a); l.on("enhance.tablesaw", function (e) { if (b.mustard) { var a = t(e.target); a.parent().length && (a = a.parent()), a.find("table").filter("[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]").tablesaw() } }); var r, c, h = !1; l.on("scroll.tablesaw", function () { h = !0, e.clearTimeout(r), r = e.setTimeout(function () { h = !1 }, 300) }), t(e).on("resize", function () { h || (e.clearTimeout(c), c = e.setTimeout(function () { l.trigger(n.resize) }, 150)) }), b.Table = o }(), n = "tablesaw-stack", i = "tablesaw-cell-label", o = "tablesaw-cell-content", l = "tablesaw-stack", r = "data-tablesaw-no-labels", c = "data-tablesaw-hide-empty", (h = function (e, a) { this.tablesaw = a, this.$table = t(e), this.labelless = this.$table.is("[" + r + "]"), this.hideempty = this.$table.is("[" + c + "]"), this.$table.data(l, this) }).prototype.init = function () { if (this.$table.addClass(n), !this.labelless) { var e = this; this.$table.find("th, td").filter(function () { return !t(this).closest("thead").length }).filter(function () { return !(t(this).is("[" + r + "]") || t(this).closest("tr").is("[" + r + "]") || e.hideempty && !t(this).html()) }).each(function () { var s = t(a.createElement("b")).addClass(i), n = t(this); t(e.tablesaw._findPrimaryHeadersForCell(this)).each(function (e) { var n = t(this.cloneNode(!0)), i = n.find(".tablesaw-sortable-btn"); n.find(".tablesaw-sortable-arrow").remove(); var o = n.find("[data-tablesaw-checkall]"); if (o.closest("label").remove(), o.length) s = t([]); else { e > 0 && s.append(a.createTextNode(", ")); for (var l, r = i.length ? i[0] : n[0]; l = r.firstChild;)s[0].appendChild(l) } }), s.length && !n.find("." + o).length && n.wrapInner("<span class='" + o + "'></span>"); var l = n.find("." + i); l.length ? l.replaceWith(s) : (n.prepend(a.createTextNode(" ")), n.prepend(s)) }) } }, h.prototype.destroy = function () { this.$table.removeClass(n), this.$table.find("." + i).remove(), this.$table.find("." + o).each(function () { t(this).replaceWith(t(this.childNodes)) }) }, t(a).on(b.events.create, function (t, e) { "stack" === e.mode && new h(e.table, e).init() }).on(b.events.refresh, function (e, a) { "stack" === a.mode && t(a.table).data(l).init() }).on(b.events.destroy, function (e, a) { "stack" === a.mode && t(a.table).data(l).destroy() }), b.Stack = h, d = { _create: function () { return t(this).each(function () { t(this).trigger("beforecreate.tablesawbtn").tablesawbtn("_init").trigger("create.tablesawbtn") }) }, _init: function () { var e = t(this), a = this.getElementsByTagName("select")[0]; return a && t(this).addClass("btn-select tablesaw-btn-select").tablesawbtn("_select", a), e }, _select: function (e) { var s = function (e, s) { var n, i, o = t(s).find("option"), l = a.createElement("span"), r = !1; if (l.setAttribute("aria-hidden", "true"), l.innerHTML = " ", o.each(function () { this.selected && (l.innerHTML = this.text) }), i = e.childNodes, o.length > 0) { for (var c = 0, h = i.length; c < h; c++)(n = i[c]) && "SPAN" === n.nodeName.toUpperCase() && (e.replaceChild(l, n), r = !0); r || e.insertBefore(l, e.firstChild) } }; s(this, e), t(this).on("change refresh", function () { s(this, e) }) } }, t.fn.tablesawbtn = function (e, a, s, n) { return this.each(function () { return e && "string" == typeof e ? t.fn.tablesawbtn.prototype[e].call(this, a, s, n) : t(this).data("tablesawbtnactive") ? t(this) : (t(this).data("tablesawbtnactive", !0), void t.fn.tablesawbtn.prototype._create.call(this)) }) }, t.extend(t.fn.tablesawbtn.prototype, d), function () { var s = "tablesaw-coltoggle", n = function (e) { this.$table = t(e), this.$table.length && (this.tablesaw = this.$table.data("tablesaw"), this.attributes = { btnTarget: "data-tablesaw-columntoggle-btn-target", set: "data-tablesaw-columntoggle-set" }, this.classes = { columnToggleTable: "tablesaw-columntoggle", columnBtnContain: "tablesaw-columntoggle-btnwrap tablesaw-advance", columnBtn: "tablesaw-columntoggle-btn tablesaw-nav-btn down", popup: "tablesaw-columntoggle-popup", priorityPrefix: "tablesaw-priority-" }, this.set = [], this.$headers = this.tablesaw._getPrimaryHeaderCells(), this.$table.data(s, this)) }; n.prototype.initSet = function () { var e = this.$table.attr(this.attributes.set); if (e) { var a = this.$table[0]; this.set = t("table[" + this.attributes.set + "='" + e + "']").filter(function () { return this !== a }).get() } }, n.prototype.init = function () { if (this.$table.length) { var n, i, o, l, r, c, h = this, d = this.tablesaw.getConfig({ getColumnToggleLabelTemplate: function (t) { return "<label><input type='checkbox' checked>" + t + "</label>" } }); this.$table.addClass(this.classes.columnToggleTable), i = (n = this.$table.attr("id")) + "-popup", c = t("<div class='" + this.classes.columnBtnContain + "'></div>"), o = t("<a href='#" + i + "' class='btn tablesaw-btn btn-micro " + this.classes.columnBtn + "' data-popup-link>
1<span>" + b.i18n.columnToggleButton + "</span></a>"), l = t("<div class='" + this.classes.popup + "' id='" + i + "'></div>"), r = t("<div class='tablesaw-btn-group'></div>"), this.$popup = l; var u = !1; this.$headers.each(function () { var e = t(this), a = e.attr("data-tablesaw-priority"), s = h.tablesaw._$getCells(this); a && "persist" !== a && (s.addClass(h.classes.priorityPrefix + a), t(d.getColumnToggleLabelTemplate(e.text())).appendTo(r).find('input[type="checkbox"]').data("tablesaw-header", this), u = !0) }), u || r.append("<label>" + b.i18n.columnToggleError + "</label>"), r.appendTo(l), r.find('input[type="checkbox"]').on("change", function (e) { var a; (v(e.target), h.set.length) && (t(h.$popup).find("input[type='checkbox']").each(function (t) { if (this === e.target) return a = t, !1 }), t(h.set).each(function () { var n = t(this).data(s).$popup.find("input[type='checkbox']").get(a); n && (n.checked = e.target.checked, v(n)) })) }), o.appendTo(c); var f, p = t(this.$table.attr(this.attributes.btnTarget)); c.appendTo(p.length ? p : this.tablesaw.$toolbar), o.on("click.tablesaw", function (s) { s.preventDefault(), c.is(".visible") ? m() : (c.addClass("visible"), o.removeClass("down").addClass("up"), t(a).off("click." + n, m), e.clearTimeout(f), f = e.setTimeout(function () { t(a).on("click." + n, m) }, 15)) }), l.appendTo(c), this.$menu = r; var w, g = this.$table.closest(".tablesaw-overflow"); if (g.css("-webkit-overflow-scrolling")) g.on("scroll", function () { var a = t(this); e.clearTimeout(w), w = e.setTimeout(function () { a.css("-webkit-overflow-scrolling", "auto"), e.setTimeout(function () { a.css("-webkit-overflow-scrolling", "touch") }, 0) }, 100) }); t(e).on(b.events.resize + "." + n, function () { h.refreshToggle() }), this.initSet(), this.refreshToggle() } function v(t) { var e = t.checked, a = h.getHeaderFromCheckbox(t), s = h.tablesaw._$getCells(a); s[e ? "removeClass" : "addClass"]("tablesaw-toggle-cellhidden"), s[e ? "addClass" : "removeClass"]("tablesaw-toggle-cellvisible"), h.updateColspanCells(a, e), h.$table.trigger("tablesawcolumns") } function m(e) { e && t(e.target).closest("." + h.classes.popup).length || (t(a).off("click." + n), o.removeClass("up").addClass("down"), c.removeClass("visible")) } }, n.prototype.getHeaderFromCheckbox = function (e) { return t(e).data("tablesaw-header") }, n.prototype.refreshToggle = function () { var t = this; this.$menu.find("input").each(function () { var e = t.getHeaderFromCheckbox(this); this.checked = "table-cell" === t.tablesaw._$getCells(e).eq(0).css("display") }), this.updateColspanCells() }, n.prototype.updateColspanCells = function (t, e) { this.tablesaw.updateColspanCells("tablesaw-toggle-cellhidden", t, e) }, n.prototype.destroy = function () { this.$table.removeClass(this.classes.columnToggleTable), this.$table.find("th, td").each(function () { t(this).removeClass("tablesaw-toggle-cellhidden").removeClass("tablesaw-toggle-cellvisible"), this.className = this.className.replace(/\bui\-table\-priority\-\d\b/g, "") }) }, t(a).on(b.events.create, function (t, e) { "columntoggle" === e.mode && new n(e.table).init() }), t(a).on(b.events.destroy, function (e, a) { "columntoggle" === a.mode && t(a.table).data(s).destroy() }), t(a).on(b.events.refresh, function (e, a) { "columntoggle" === a.mode && t(a.table).data(s).refreshToggle() }), b.ColumnToggle = n }(), function () { function e(e) { var a = []; return t(e.childNodes).each(function () { var e = t(this); e.is("input, select") ? a.push(e.val()) : e.is(".tablesaw-cell-label") || a.push((e.text() || "").replace(/^\s+|\s+$/g, "")) }), a.join("") } var s = "tablesaw-sortable", n = "table[data-" + s + "]", i = "[data-" + s + "-switch]", o = { sortCol: "data-tablesaw-sortable-col", defaultCol: "data-tablesaw-sortable-default-col", numericCol: "data-tablesaw-sortable-numeric", subRow: "data-tablesaw-subrow", ignoreRow: "data-tablesaw-ignorerow" }, l = { head: s + "-head", ascend: s + "-ascending", descend: s + "-descending", switcher: s + "-switch", tableToolbar: "tablesaw-bar-section", sortButton: s + "-btn" }, r = { _create: function (e) { return t(this).each(function () { if (t(this).data(s + "-init")) return !1; t(this).data(s + "-init", !0).trigger("beforecreate." + s)[s]("_init", e).trigger("create." + s) }) }, _init: function () { var a, n, r, c = t(this), h = c.data("tablesaw"); function d(e) { t.each(e, function (e, a) { var s = t(a); s.removeAttr(o.defaultCol), s.removeClass(l.ascend), s.removeClass(l.desce
1nd) }) } c.addClass(s), a = c.children().filter("thead").find("th[" + o.sortCol + "]"), r = a, t.each(r, function (e, a) { t(a).addClass(l.head) }), function (e, a) { t.each(e, function (e, s) { var n = t("<button class='" + l.sortButton + "'/>"); n.on("click", { col: s }, a), t(s).wrapInner(n).find("button").append("<span class='tablesaw-sortable-arrow'>") }) }(a, function (e) { if (!t(e.target).is("a[href]")) { e.stopPropagation(); var i = t(e.target).closest("[" + o.sortCol + "]"), r = e.data.col, h = a.index(i[0]); d(i.closest("thead").find("th").filter(function () { return this !== i[0] })), i.is("." + l.descend) || !i.is("." + l.ascend) ? (c[s]("sortBy", r, !0), h += "_asc") : (c[s]("sortBy", r), h += "_desc"), n && n.find("select").val(h).trigger("refresh"), e.preventDefault() } }), function (e) { t.each(e, function (e, a) { var s = t(a); s.is("[" + o.defaultCol + "]") && (s.is("." + l.descend) || s.addClass(l.ascend)) }) }(a), c.is(i) && function (a) { n = t("<div>").addClass(l.switcher).addClass(l.tableToolbar); var i = ["<label>" + b.i18n.sort + ":"]; i.push('<span class="btn tablesaw-btn"><select>'), a.each(function (a) { var s = t(this), n = s.is("[" + o.defaultCol + "]"), r = s.is("." + l.descend), c = s.is("[" + o.numericCol + "]"), h = 0; t(this.cells.slice(0, 5)).each(function () { isNaN(parseInt(e(this), 10)) || h++ }); var d = 5 === h; c || s.attr(o.numericCol, d ? "" : "false"), i.push("<option" + (n && !r ? " selected" : "") + ' value="' + a + '_asc">' + s.text() + " " + (d ? "↑" : "(A-Z)") + "</option>"), i.push("<option" + (n && r ? " selected" : "") + ' value="' + a + '_desc">' + s.text() + " " + (d ? "↓" : "(Z-A)") + "</option>") }), i.push("</select></span></label>"), n.html(i.join("")); var r = h.$toolbar.children().eq(0); r.length ? n.insertBefore(r) : n.appendTo(h.$toolbar), n.find(".tablesaw-btn").tablesawbtn(), n.find("select").on("change", function () { var e = t(this).val().split("_"), n = a.eq(e[0]); d(n.siblings()), c[s]("sortBy", n.get(0), "asc" === e[1]) }) }(a) }, sortRows: function (a, s, n, i, l) { var r, c = function (a, s) { var n = []; return t.each(a, function (a, i) { for (var l = i.parentNode, r = t(l), c = [], h = r.next(); h.is("[" + o.subRow + "]");)c.push(h[0]), h = h.next(); var d = l.parentNode; r.is("[" + o.subRow + "]") || d === s && n.push({ element: i, cell: e(i), row: l, subrows: c.length ? c : null, ignored: r.is("[" + o.ignoreRow + "]") }) }), n }(i.cells, l), h = t(i).data("tablesaw-sort"); return r = !(!h || "function" != typeof h) && h(n) || function (t, e) { var a = /[^\-\+\d\.]/g; return t ? function (t, s) { return t.ignored || s.ignored ? 0 : e ? parseFloat(t.cell.replace(a, "")) - parseFloat(s.cell.replace(a, "")) : t.cell.toLowerCase() > s.cell.toLowerCase() ? 1 : -1 } : function (t, s) { return t.ignored || s.ignored ? 0 : e ? parseFloat(s.cell.replace(a, "")) - parseFloat(t.cell.replace(a, "")) : t.cell.toLowerCase() < s.cell.toLowerCase() ? 1 : -1 } }(n, t(i).is("[" + o.numericCol + "]") && !t(i).is("[" + o.numericCol + '="false"]')), function (t) { var e, a, s = []; for (e = 0, a = t.length; e < a; e++)s.push(t[e].row), t[e].subrows && s.push(t[e].subrows); return s }(c.sort(r)) }, makeColDefault: function (e, a) { var s = t(e); s.attr(o.defaultCol, "true"), a ? (s.removeClass(l.descend), s.addClass(l.ascend)) : (s.removeClass(l.ascend), s.addClass(l.descend)) }, sortBy: function (e, a) { var n, i = t(this), o = i.data("tablesaw"); o.$tbody.each(function () { var l, r, c, h = t(this), d = o.getBodyRows(this), u = o.headerMapping[0]; for (r = 0, c = u.length; r < c; r++)if (u[r] === e) { n = r; break } for (r = 0, c = (l = i[s]("sortRows", d, n, a, e, this)).length; r < c; r++)h.append(l[r]) }), i[s]("makeColDefault", e, a), i.trigger("tablesaw-sorted") } }; t.fn[s] = function (e) { var a, n = Array.prototype.slice.call(arguments, 1); return e && "string" == typeof e ? void 0 !== (a = t.fn[s].prototype[e].apply(this[0], n)) ? a : t(this) : (t(this).data(s + "-active") || (t(this).data(s + "-active", !0), t.fn[s].prototype._create.call(this, e)), t(this)) }, t.extend(t.fn[s].prototype, r), t(a).on(b.events.create, function (t, e) { e.$table.is(n) && e.$table[s]() }) }(), function () { var s = { hideBtn: "disabled", persistWidths: "tablesaw-fix-persist", hiddenCol: "tablesaw-swipe-cellhidden", persist
1Col: "tablesaw-swipe-cellpersist", allColumnsVisible: "tablesaw-all-cols-visible" }, n = { disableTouchEvents: "data-tablesaw-no-touch", ignorerow: "data-tablesaw-ignorerow", subrow: "data-tablesaw-subrow" }; function i(i, o) { var l = o.data("tablesaw"), r = t("<div class='tablesaw-advance'></div>"), c = t("<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro left'>" + b.i18n.swipePreviousColumn + "</a>").appendTo(r), h = t("<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro right'>" + b.i18n.swipeNextColumn + "</a>").appendTo(r), d = i._getPrimaryHeaderCells(), u = d.not('[data-tablesaw-priority="persist"]'), f = [], p = [], w = t(a.head || "head"), g = o.attr("id"); if (!d.length) throw new Error("tablesaw swipe: no header cells found."); function v() { o.css({ width: "1px" }), o.find("." + s.hiddenCol).removeClass(s.hiddenCol), f = [], p = [], d.each(function () { var t = this.offsetWidth; f.push(t), y(this) || p.push(t) }), o.css({ width: "" }) } function m(t) { l._$getCells(t).removeClass(s.hiddenCol) } function C(t) { l._$getCells(t).addClass(s.hiddenCol) } function y(e) { return t(e).is('[data-tablesaw-priority="persist"]') } function $() { o.removeClass(s.persistWidths), t("#" + g + "-persist").remove() } function T() { var e, a = []; return u.each(function (n) { var i = t(this), o = "none" === i.css("display") || i.is("." + s.hiddenCol); if (o || e) { if (o && e) return a[1] = n, !1 } else e = !0, a[0] = n }), a } function k() { var t = T(); return [t[1] - 1, t[0] - 1] } function x(t) { return t[1] > -1 && t[1] < u.length } function _() { if (!(a = o.attr("data-tablesaw-swipe-media")) || "matchMedia" in e && e.matchMedia(a).matches) { var a, n = o.parent().width(), i = [], r = 0, c = [], h = d.length; d.each(function (e) { var a = t(this).is('[data-tablesaw-priority="persist"]'); i.push(a), r += f[e], c.push(r), (a || r > n) && h-- }); var u = 0 === h; d.each(function (t) { c[t] > n && C(this) }); var b = !0; d.each(function (t) { if (i[t]) return e = this, l._$getCells(e).addClass(s.persistCol), void (b && (l._$getCells(this).css("width", c[t] + "px"), b = !1)); var e; (c[t] <= n || u) && (u = !1, m(this), l.updateColspanCells(s.hiddenCol, this, !0)) }), $(), o.trigger("tablesawcolumns") } } function M() { B(!0) } function S() { B(!1) } function B(e) { var a; if (x(a = e ? T() : k())) { isNaN(a[0]) && (a[0] = e ? 0 : u.length - 1); var n, i = function () { var e, a = "#" + g + ".tablesaw-swipe ", n = [], i = o.width(), l = i, r = []; if (d.each(function (t) { var e; y(this) && (e = this.offsetWidth, l -= e, e < .75 * i && (r.push(t + "-" + e), n.push(a + " ." + s.persistCol + ":nth-child(" + (t + 1) + ") { width: " + e + "px; }"))) }), e = r.join("_"), n.length) { o.addClass(s.persistWidths); var c = t("#" + g + "-persist"); c.length && c.data("tablesaw-hash") === e || (c.remove(), t("<style>" + n.join("\n") + "</style>").attr("id", g + "-persist").data("tablesaw-hash", e).appendTo(w)) } return l }(), r = a[0], c = a[1], h = u.get(r), b = !1, f = !1; C(h), l.updateColspanCells(s.hiddenCol, h, !0); for (var v = r + (e ? 1 : -1); v >= 0 && v < p.length;) { i -= p[v]; var $ = u.eq(v); $.is(".tablesaw-swipe-cellhidden") ? i > 0 && (b = !0, f = !0, m(n = $.get(0)), l.updateColspanCells(s.hiddenCol, n, !1)) : f = !0, e ? v++ : v-- } f ? !b && x(e ? T() : k()) && B(e) : (m(n = u.get(c)), l.updateColspanCells(s.hiddenCol, n, !1)), o.trigger("tablesawcolumns") } } function H(t, e) { return (t.touches || t.originalEvent.touches)[0][e] } o.addClass("tablesaw-swipe"), v(), r.appendTo(l.$toolbar), g || (g = "tableswipe-" + Math.round(1e4 * Math.random()), o.attr("id", g)), c.add(h).on("click", function (e) { t(e.target).closest(h).length ? M() : S(), e.preventDefault() }), o.is("[" + n.disableTouchEvents + "]") || o.on("touchstart.swipetoggle", function (a) { var s, n, o = H(a, "pageX"), l = H(a, "pageY"), r = e.pageYOffset; t(e).off(b.events.resize, _), t(this).on("touchmove.swipetoggle", function (t) { s = H(t, "pageX"), n = H(t, "pageY") }).on("touchend.swipetoggle", function () { var a = i.getConfig({ swipeHorizontalThreshold: 30, swipeVerticalThreshold: 30 }), c = a.swipe ? a.swipe.verticalThreshold : a.swipeVerticalThreshold, h = a.swipe ? a.swipe.horizontalThreshold : a.swipeHorizontalThreshold, d = Math.abs(e.pageYOffset - r) >= c; Math.abs(n - l) >= c || d || (s - o < -1 * h && M(), s - o > h && S()), e.setTimeout(function () { t(e).on(b.events.resize, _) }, 300), t(this).off("touchmove.swipetoggle touchend.swipetoggle") }) }), o.on("tablesawcolumns.swipetoggle", function () { var t = x(k()), e = x(T()); c[t ? "removeClass" : "addClass"](s.hideBtn), h[e ? "removeClass" : "addClass"](s.hideBtn), l.$toolbar[t || e ? "removeClass" : "addClass"](s.allColumnsVisible) }).on("tablesawnext.swipetoggle", function () { M() }).on("tablesawprev.swipetoggle", function () { S() }).on(b.events.destroy + ".swipetoggle", function () { var a = t(this); a.removeClass("tablesaw-swipe"), l.$toolbar.find(".tablesaw-advance").remove(), t(e).off(b.events.resize, _), a.off(".swipetoggle") }).on(b.events.refresh, function () { $(), v(), _() }), _(), t(e).on(b.events.resize, _) } t(a).on(b.events.create, function (t, e) { "swipe" === e.mode && i(e, e.$table) }) }(), function () { var s = { attr: { init: "data-tablesaw-minimap" }, show: function (t) { var a = t.getAttribute(s.attr.init); return "" === a || !!(a && "matchMedia" in e) && e.matchMedia(a).matches } }; t(a).on(b.events.create, function (a, n) { "swipe" !== n.mode && "columntoggle" !== n.mode || !n.$table.is("[ " + s.attr.init + "]") || function (a) { var n = a.data("tablesaw"), i = t('<div class="tablesaw-advance minimap">'), o = t('<ul class="tablesaw-advance-dots">').appendTo(i), l = "tablesaw-advance-dots-hide"; function r() { if (s.show(a[0])) { i.css("display", "block"); var e = o.find("li").removeClass(l); a.find("thead th").each(function (a) { "none" === t(this).css("display") && e.eq(a).addClass(l) }) } else i.css("display", "none") } a.data("tablesaw")._getPrimaryHeaderCells().each(function () { o.append("<li><i></i></li>") }), i.appendTo(n.$toolbar), r(), t(e).on(b.events.resize, r), a.on("tablesawcolumns.minimap", function () { r() }).on(b.events.destroy + ".minimap", function () { var a = t(this); n.$toolbar.find(".tablesaw-advance").remove(), t(e).off(b.events.resize, r), a.off(".minimap") }) }(n.$table) }), b.MiniMap = s }(), u = { selectors: { init: "table[data-tablesaw-mode-switch]" }, attributes: { excludeMode: "data-tablesaw-mode-exclude" }, classes: { main: "tablesaw-modeswitch", toolbar: "tablesaw-bar-section" }, modes: ["stack", "swipe", "columntoggle"], init: function (e) { var a, s = t(e), n = s.data("tablesaw"), i = s.attr(u.attributes.excludeMode), o = n.$toolbar, l = t("<div>").addClass(u.classes.main + " " + u.classes.toolbar), r = ['<label><span class="abbreviated">' + b.i18n.modeSwitchColumnsAbbreviated + '</span><span class="longform">' + b.i18n.modeSwitchColumns + "</span>:"], c = s.attr("data-tablesaw-mode"); r.push('<span class="btn tablesaw-btn"><select>'); for (var h = 0, d = u.modes.length; h < d; h++)i && i.toLowerCase() === u.modes[h] || (a = c === u.modes[h], r.push("<option" + (a ? " selected" : "") + ' value="' + u.modes[h] + '">' + b.i18n.modes[h] + "</option>")); r.push("</select></span></label>"), l.html(r.join("")); var f = o.find(".tablesaw-advance").eq(0); f.length ? l.insertBefore(f) : l.appendTo(o), l.find(".tablesaw-btn").tablesawbtn(), l.find("select").on("change", function (a) { return u.onModeChange.call(e, a, t(this).val()) }) }, onModeChange: function (e, a) { var s = t(this), n = s.data("tablesaw"); n.$toolbar.find("." + u.classes.main).remove(), n.destroy(), s.attr("data-tablesaw-mode", a), s.tablesaw() } }, t(a).on(b.events.create, function (t, e) { e.$table.is(u.selectors.init) && u.init(e.table) }), function () { var e = "tablesawCheckAll"; function s(t) { this.tablesaw = t, this.$table = t.$table, this.attr = "data-tablesaw-checkall", this.checkAllSelector = "[" + this.attr + "]", this.forceCheckedSelector = "[" + this.attr + "-checked]", this.forceUncheckedSelector = "[" + this.attr + "-unchecked]", this.checkboxSelector = 'input[type="checkbox"]', this.$triggers = null, this.$checkboxes = null, this.$table.data(e) || (this.$table.data(e, this), this.init()) } s.prototype._filterCells = function (e) { return e.filter(function () { return !t(this).closest("tr").is("[data-tablesaw-subrow],[data-tablesaw-ignorerow]") }).find(this.checkboxSelector).not(this.checkAllSelector) }, s.prototype.getCheckboxesForButton = function (e) { return this._filterCells(t(t(e).attr(this.attr))) }, s.prototype.getCheckboxesForCheckbox = function (e) { return this._filterCells(t(t(e).closest("th")[0].cells)) }, s.prototype.init = function () { var e = this; this.$table.find(this.checkAllSelector).each(function () { t(this).is(e.checkboxSelector) ? e.addCheckboxEvents(this) : e.addButtonEvents(this) }) }, s.prototype.addButtonEvents = function (a) { var s = this; t(a).on("click", function (a) { a.preventDefault(); var n, i = s.getCheckboxesForButton(this), o = !0; i.each(function () { this.checked || (o = !1) }), n = !!t(this).is(s.forceCheckedSelector) || !t(this).is(s.forceUncheckedSelector) && !o, i.each(function () { this.checked = n, t(this).trigger("change." + e) }) }) }, s.prototype.addCheckboxEvents = function (a) { var s = this; t(a).on("change", function () { var t = this.checked; s.getCheckboxesForCheckbox(this).each(function () { this.checked = t }) }); var n = s.getCheckboxesForCheckbox(a); n.on("change." + e, function () { var t = 0; n.each(function () { this.checked && t++ }); var e = t === n.length; a.checked = e, a.indeterminate = 0 !== t && !e }) }, t(a).on(b.events.create, function (t, e) { new s(e) }), b.CheckAll = s }(), b }); 2; 3/*! Tablesaw - v3.1.2 - 2019-03-19 4* https://github.com/filamentgroup/tablesaw 5* Copyright (c) 2019 Filament Group; Licensed MIT */ 6(function (win) { 7 "use strict"; 8 9 // DOM-ready auto-init of plugins. 10 // Many plugins bind to an "enhance" event to init themselves on dom ready, or when new markup is inserted into the DOM 11 // Use raw DOMContentLoaded instead of shoestring (may have issues in Android 2.3, exhibited by stack table) 12 if (!("Tablesaw" in win)) {
13 throw new Error("Tablesaw library not found."); 14 } 15 if (!("init" in Tablesaw)) { 16 throw new Error("Your tablesaw-init.js is newer than the core Tablesaw version."); 17 } 18 19 Tablesaw.init(); 20})(typeof window !== "undefined" ? window : this); 21 22// Trigger Tablesaw to convert tables after an AJAX call (such as Views tables 23// loaded via AJAX from a pager or exposed filter. See #3137956 24// This was rewritten from jQuery into JavaScript in 2024 to avoid the jQuery 25// dependency. 26(function() { 27 const send = XMLHttpRequest.prototype.send 28 XMLHttpRequest.prototype.send = function() { 29 this.addEventListener('load', function() { 30 Tablesaw.init(); 31 }) 32 return send.apply(this, arguments) 33 } 34})() 35;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.