/*! HTML5 export buttons for Buttons and DataTables. 2016 SpryMedia Ltd - datatables.net/license FileSaver.js (1.3.3) - MIT license Copyright © 2016 Eli Grey - http://eligrey.com */ (function (n) { "function" === typeof define && define.amd ? define(["jquery", "datatables.net", "datatables.net-buttons"], function (u) { return n(u, window, document) }) : "object" === typeof exports ? module.exports = function (u, x, E, F) { u || (u = window); x && x.fn.dataTable || (x = require("datatables.net")(u, x).$); x.fn.dataTable.Buttons || require("datatables.net-buttons")(u, x); return n(x, u, u.document, E, F) } : n(jQuery, window, document) })(function (n, u, x, E, F, B) { function I(a) { for (var c = ""; 0 <= a;)c = String.fromCharCode(a % 26 + 65) + c, a = Math.floor(a / 26) - 1; return c } function O(a, c) { J === B && (J = -1 === M.serializeToString((new u.DOMParser).parseFromString(P["xl/worksheets/sheet1.xml"], "text/xml")).indexOf("xmlns:r")); n.each(c, function (d, b) { if (n.isPlainObject(b)) d = a.folder(d), O(d, b); else { if (J) { var m = b.childNodes[0], e, f = []; for (e = m.attributes.length - 1; 0 <= e; e--) { var g = m.attributes[e].nodeName; var p = m.attributes[e].nodeValue; -1 !== g.indexOf(":") && (f.push({ name: g, value: p }), m.removeAttribute(g)) } e = 0; for (g = f.length; e < g; e++)p = b.createAttribute(f[e].name.replace(":", "_dt_b_namespace_token_")), p.value = f[e].value, m.setAttributeNode(p) } b = M.serializeToString(b); J && (-1 === b.indexOf("' + b), b = b.replace(/_dt_b_namespace_token_/g, ":"), b = b.replace(/xmlns:NS[\d]+="" NS[\d]+:/g, "")); b = b.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g, "<$1 $2>"); a.file(d, b) } }) } function y(a, c, d) { var b = a.createElement(c); d && (d.attr && n(b).attr(d.attr), d.children && n.each(d.children, function (m, e) { b.appendChild(e) }), null !== d.text && d.text !== B && b.appendChild(a.createTextNode(d.text))); return b } function V(a, c) { var d = a.header[c].length; a.footer && a.footer[c].length > d && (d = a.footer[c].length); for (var b = 0, m = a.body.length; b < m; b++) { var e = a.body[b][c]; e = null !== e && e !== B ? e.toString() : ""; -1 !== e.indexOf("\n") ? (e = e.split("\n"), e.sort(function (f, g) { return g.length - f.length }), e = e[0].length) : e = e.length; e > d && (d = e); if (40 < d) return 54 } d *= 1.35; return 6 < d ? d : 6 } var D = n.fn.dataTable; D.Buttons.pdfMake = function (a) { if (!a) return F || u.pdfMake; F = a }; D.Buttons.jszip = function (a) { if (!a) return E || u.JSZip; E = a }; var K = function (a) { if (!("undefined" === typeof a || "undefined" !== typeof navigator && /MSIE [1-9]\./.test(navigator.userAgent))) { var c = a.document.createElementNS("http://www.w3.org/1999/xhtml", "a"), d = "download" in c, b = /constructor/i.test(a.HTMLElement) || a.safari, m = /CriOS\/[\d]+/.test(navigator.userAgent), e = function (h) { (a.setImmediate || a.setTimeout)(function () { throw h; }, 0) }, f = function (h) { setTimeout(function () { "string" === typeof h ? (a.URL || a.webkitURL || a).revokeObjectURL(h) : h.remove() }, 4E4) }, g = function (h) { return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(h.type) ? new Blob([String.fromCharCode(65279), h], { type: h.type }) : h }, p = function (h, q, v) { v || (h = g(h)); var r = this, w = "application/octet-stream" === h.type, C = function () { var l = ["writestart", "progress", "write", "writeend"]; l = [].concat(l); for (var z = l.length; z--;) { var G = r["on" + l[z]]; if ("function" === typeof G) try { G.call(r, r) } catch (A) { e(A) } } }; r.readyState = r.INIT; if (d) { var k = (a.URL || a.webkitURL || a).createObjectURL(h); setTimeout(function () { c.href = k; c.download = q; var l = new MouseEvent("click"); c.dispatchEvent(l); C(); f(k); r.readyState = r.DONE }) } else (function () { if ((m || w && b) && a.FileReader) { var l = new FileReader; l.onloadend = function () { var z = m ? l.result : l.result.replace(/^data:[^;]*;/, "data:attachment/file;"); a.open(z, "_blank") || (a.location.href = z); r.readyState = r.DONE; C() }; l.readAsDataURL(h); r.readyState = r.INIT } else k || (k = (a.URL || a.webkitURL || a).createObjectURL(h)), w ? a.location.href = k : a.open(k, "_blank") || (a.location.href = k), r.readyState = r.DONE, C(), f(k) })() }, t = p.prototype; if ("undefined" !== typeof navigator && navigator.msSaveOrOpenBlob) return function (h, q, v) { q = q || h.name || "download"; v || (h = g(h)); return navigator.msSaveOrOpenBlob(h, q) }; t.abort = function () { }; t.readyState = t.INIT = 0; t.WRITING = 1; t.DONE = 2; t.error = t.onwritestart = t.onprogress = t.onwrite = t.onabort = t.onerror = t.onwriteend = null; return function (h, q, v) { return new p(h, q || h.name || "download", v) } } }("undefined" !== typeof self && self || "undefined" !== typeof u && u || this.content); D.fileSave = K; var Q = function (a) { var c = "Sheet1"; a.sheetName && (c = a.sheetName.replace(/[\[\]\*\/\\\?:]/g, "")); return c }, R = function (a) { return a.newline ? a.newline : navigator.userAgent.match(/Windows/) ? "\r\n" : "\n" }, S = function (a, c) { var d = R(c); a = a.buttons.exportData(c.exportOptions); var b = c.fieldBoundary, m = c.fieldSeparator, e = new RegExp(b, "g"), f = c.escapeChar !== B ? c.escapeChar : "\\", g = function (v) { for (var r = "", w = 0, C = v.length; w < C; w++)0 < w && (r += m), r += b ? b + ("" + v[w]).replace(e, f + b) + b : v[w]; return r }, p = c.header ? g(a.header) + d : ""; c = c.footer && a.footer ? d + g(a.footer) : ""; for (var t = [], h = 0, q = a.body.length; h < q; h++)t.push(g(a.body[h])); return { str: p + t.join(d) + c, rows: t.length } }, T = function () { if (-1 === navigator.userAgent.indexOf("Safari") || -1 !== navigator.userAgent.indexOf("Chrome") || -1 !== navigator.userAgent.indexOf("Opera")) return !1; var a = navigator.userAgent.match(/AppleWebKit\/(\d+\.\d+)/); return a && 1 < a.length && 603.1 > 1 * a[1] ? !0 : !1 }; try { var M = new XMLSerializer, J } catch (a) { } var P = { "_rels/.rels": '', "xl/_rels/workbook.xml.rels": '', "[Content_Types].xml": '', "xl/workbook.xml": '', "xl/worksheets/sheet1.xml": '', "xl/styles.xml": '' }, U = [{ match: /^\-?\d+\.\d%$/, style: 60, fmt: function (a) { return a / 100 } }, { match: /^\-?\d+\.?\d*%$/, style: 56, fmt: function (a) { return a / 100 } }, { match: /^\-?\$[\d,]+.?\d*$/, style: 57 }, { match: /^\-?£[\d,]+.?\d*$/, style: 58 }, { match: /^\-?€[\d,]+.?\d*$/, style: 59 }, { match: /^\-?\d+$/, style: 65 }, { match: /^\-?\d+\.\d{2}$/, style: 66 }, { match: /^\([\d,]+\)$/, style: 61, fmt: function (a) { return -1 * a.replace(/[\(\)]/g, "") } }, { match: /^\([\d,]+\.\d{2}\)$/, style: 62, fmt: function (a) { return -1 * a.replace(/[\(\)]/g, "") } }, { match: /^\-?[\d,]+$/, style: 63 }, { match: /^\-?[\d,]+\.\d{2}$/, style: 64 }, { match: /^[\d]{4}\-[\d]{2}\-[\d]{2}$/, style: 67, fmt: function (a) { return Math.round(25569 + Date.parse(a) / 864E5) } }]; D.ext.buttons.copyHtml5 = { className: "buttons-copy buttons-html5", text: function (a) { return a.i18n("buttons.copy", "Copy") }, action: function (a, c, d, b) { this.processing(!0); var m = this; a = S(c, b); var e = c.buttons.exportInfo(b), f = R(b), g = a.str; d = n("
").css({ height: 1, width: 1, overflow: "hidden", position: "fixed", top: 0, left: 0 }); e.title && (g = e.title + f + f + g); e.messageTop && (g = e.messageTop + f + f + g); e.messageBottom && (g = g + f + f + e.messageBottom); b.customize && (g = b.customize(g, b, c)); b = n("