From 6b73dc2e735d2a0182b0e2c1d0f07f51aae98cd6 Mon Sep 17 00:00:00 2001 From: Daniel Zamorano Date: Wed, 26 Aug 2015 19:50:40 -0500 Subject: [PATCH 1/2] Fixing errors in dist files. --- dist/jspdf.debug.js | 658 +------------------------------------------- dist/jspdf.min.js | 44 +-- 2 files changed, 18 insertions(+), 684 deletions(-) diff --git a/dist/jspdf.debug.js b/dist/jspdf.debug.js index c184dc34c..f8e1390d3 100644 --- a/dist/jspdf.debug.js +++ b/dist/jspdf.debug.js @@ -1,7 +1,7 @@ /** @preserve * jsPDF - PDF Document creation from JavaScript - * Version 1.1.135-git Built on 2015-05-16T00:15 - * CommitID e0da47f3da + * Version 1.1.239-git Built on 2015-08-26T19:44 + * CommitID 67cd0d6b3c * * Copyright (c) 2010-2014 James Hall , https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike @@ -2035,7 +2035,7 @@ var jsPDF = (function(global) { * pdfdoc.mymethod() // <- !!!!!! */ jsPDF.API = {events:[]}; - jsPDF.version = "1.1.135-debug 2015-05-16T00:15:jameshall"; + jsPDF.version = "1.1.239-debug 2015-08-26T19:44:danielzamorano"; if (typeof define === 'function' && define.amd) { define('jsPDF', function() { @@ -7267,652 +7267,6 @@ jsPDFAPI.putTotalPages = function(pageExpression) { }; })(jsPDF.API); -/* Blob.js - * A Blob implementation. - * 2014-07-24 - * - * By Eli Grey, http://eligrey.com - * By Devin Samarin, https://github.com/dsamarin - * License: X11/MIT - * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md - */ - -/*global self, unescape */ -/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, - plusplus: true */ - -/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ - -(function (view) { - "use strict"; - - view.URL = view.URL || view.webkitURL; - - if (view.Blob && view.URL) { - try { - new Blob; - return; - } catch (e) {} - } - - // Internally we use a BlobBuilder implementation to base Blob off of - // in order to support older browsers that only have BlobBuilder - var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) { - var - get_class = function(object) { - return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; - } - , FakeBlobBuilder = function BlobBuilder() { - this.data = []; - } - , FakeBlob = function Blob(data, type, encoding) { - this.data = data; - this.size = data.length; - this.type = type; - this.encoding = encoding; - } - , FBB_proto = FakeBlobBuilder.prototype - , FB_proto = FakeBlob.prototype - , FileReaderSync = view.FileReaderSync - , FileException = function(type) { - this.code = this[this.name = type]; - } - , file_ex_codes = ( - "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " - + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR" - ).split(" ") - , file_ex_code = file_ex_codes.length - , real_URL = view.URL || view.webkitURL || view - , real_create_object_URL = real_URL.createObjectURL - , real_revoke_object_URL = real_URL.revokeObjectURL - , URL = real_URL - , btoa = view.btoa - , atob = view.atob - - , ArrayBuffer = view.ArrayBuffer - , Uint8Array = view.Uint8Array - - , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/ - ; - FakeBlob.fake = FB_proto.fake = true; - while (file_ex_code--) { - FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; - } - // Polyfill URL - if (!real_URL.createObjectURL) { - URL = view.URL = function(uri) { - var - uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a") - , uri_origin - ; - uri_info.href = uri; - if (!("origin" in uri_info)) { - if (uri_info.protocol.toLowerCase() === "data:") { - uri_info.origin = null; - } else { - uri_origin = uri.match(origin); - uri_info.origin = uri_origin && uri_origin[1]; - } - } - return uri_info; - }; - } - URL.createObjectURL = function(blob) { - var - type = blob.type - , data_URI_header - ; - if (type === null) { - type = "application/octet-stream"; - } - if (blob instanceof FakeBlob) { - data_URI_header = "data:" + type; - if (blob.encoding === "base64") { - return data_URI_header + ";base64," + blob.data; - } else if (blob.encoding === "URI") { - return data_URI_header + "," + decodeURIComponent(blob.data); - } if (btoa) { - return data_URI_header + ";base64," + btoa(blob.data); - } else { - return data_URI_header + "," + encodeURIComponent(blob.data); - } - } else if (real_create_object_URL) { - return real_create_object_URL.call(real_URL, blob); - } - }; - URL.revokeObjectURL = function(object_URL) { - if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { - real_revoke_object_URL.call(real_URL, object_URL); - } - }; - FBB_proto.append = function(data/*, endings*/) { - var bb = this.data; - // decode data to a binary string - if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { - var - str = "" - , buf = new Uint8Array(data) - , i = 0 - , buf_len = buf.length - ; - for (; i < buf_len; i++) { - str += String.fromCharCode(buf[i]); - } - bb.push(str); - } else if (get_class(data) === "Blob" || get_class(data) === "File") { - if (FileReaderSync) { - var fr = new FileReaderSync; - bb.push(fr.readAsBinaryString(data)); - } else { - // async FileReader won't work as BlobBuilder is sync - throw new FileException("NOT_READABLE_ERR"); - } - } else if (data instanceof FakeBlob) { - if (data.encoding === "base64" && atob) { - bb.push(atob(data.data)); - } else if (data.encoding === "URI") { - bb.push(decodeURIComponent(data.data)); - } else if (data.encoding === "raw") { - bb.push(data.data); - } - } else { - if (typeof data !== "string") { - data += ""; // convert unsupported types to strings - } - // decode UTF-16 to binary string - bb.push(unescape(encodeURIComponent(data))); - } - }; - FBB_proto.getBlob = function(type) { - if (!arguments.length) { - type = null; - } - return new FakeBlob(this.data.join(""), type, "raw"); - }; - FBB_proto.toString = function() { - return "[object BlobBuilder]"; - }; - FB_proto.slice = function(start, end, type) { - var args = arguments.length; - if (args < 3) { - type = null; - } - return new FakeBlob( - this.data.slice(start, args > 1 ? end : this.data.length) - , type - , this.encoding - ); - }; - FB_proto.toString = function() { - return "[object Blob]"; - }; - FB_proto.close = function() { - this.size = 0; - delete this.data; - }; - return FakeBlobBuilder; - }(view)); - - view.Blob = function(blobParts, options) { - var type = options ? (options.type || "") : ""; - var builder = new BlobBuilder(); - if (blobParts) { - for (var i = 0, len = blobParts.length; i < len; i++) { - if (Uint8Array && blobParts[i] instanceof Uint8Array) { - builder.append(blobParts[i].buffer); - } - else { - builder.append(blobParts[i]); - } - } - } - var blob = builder.getBlob(type); - if (!blob.slice && blob.webkitSlice) { - blob.slice = blob.webkitSlice; - } - return blob; - }; - - var getPrototypeOf = Object.getPrototypeOf || function(object) { - return object.__proto__; - }; - view.Blob.prototype = getPrototypeOf(new view.Blob()); -}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); -/* FileSaver.js - * A saveAs() FileSaver implementation. - * 2015-05-07.2 - * - * By Eli Grey, http://eligrey.com - * License: X11/MIT - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md - */ - -/*global self */ -/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ - -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ - -var saveAs = saveAs || (function(view) { - "use strict"; - // IE <10 is explicitly unsupported - if (typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { - return; - } - var - doc = view.document - // only get URL when necessary in case Blob.js hasn't overridden it yet - , get_URL = function() { - return view.URL || view.webkitURL || view; - } - , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") - , can_use_save_link = "download" in save_link - , click = function(node) { - var event = doc.createEvent("MouseEvents"); - event.initMouseEvent( - "click", true, false, view, 0, 0, 0, 0, 0 - , false, false, false, false, 0, null - ); - node.dispatchEvent(event); - } - , webkit_req_fs = view.webkitRequestFileSystem - , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem - , throw_outside = function(ex) { - (view.setImmediate || view.setTimeout)(function() { - throw ex; - }, 0); - } - , force_saveable_type = "application/octet-stream" - , fs_min_size = 0 - // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and - // https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047 - // for the reasoning behind the timeout and revocation flow - , arbitrary_revoke_timeout = 500 // in ms - , revoke = function(file) { - var revoker = function() { - if (typeof file === "string") { // file is an object URL - get_URL().revokeObjectURL(file); - } else { // file is a File - file.remove(); - } - }; - if (view.chrome) { - revoker(); - } else { - setTimeout(revoker, arbitrary_revoke_timeout); - } - } - , dispatch = function(filesaver, event_types, event) { - event_types = [].concat(event_types); - var i = event_types.length; - while (i--) { - var listener = filesaver["on" + event_types[i]]; - if (typeof listener === "function") { - try { - listener.call(filesaver, event || filesaver); - } catch (ex) { - throw_outside(ex); - } - } - } - } - , auto_bom = function(blob) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob(["\ufeff", blob], {type: blob.type}); - } - return blob; - } - , FileSaver = function(blob, name) { - blob = auto_bom(blob); - // First try a.download, then web filesystem, then object URLs - var - filesaver = this - , type = blob.type - , blob_changed = false - , object_url - , target_view - , dispatch_all = function() { - dispatch(filesaver, "writestart progress write writeend".split(" ")); - } - // on any filesys errors revert to saving with object URLs - , fs_error = function() { - // don't create more object URLs than needed - if (blob_changed || !object_url) { - object_url = get_URL().createObjectURL(blob); - } - if (target_view) { - target_view.location.href = object_url; - } else { - var new_tab = view.open(object_url, "_blank"); - if (new_tab == undefined && typeof safari !== "undefined") { - //Apple do not allow window.open, see http://bit.ly/1kZffRI - view.location.href = object_url - } - } - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - } - , abortable = function(func) { - return function() { - if (filesaver.readyState !== filesaver.DONE) { - return func.apply(this, arguments); - } - }; - } - , create_if_not_found = {create: true, exclusive: false} - , slice - ; - filesaver.readyState = filesaver.INIT; - if (!name) { - name = "download"; - } - if (can_use_save_link) { - object_url = get_URL().createObjectURL(blob); - save_link.href = object_url; - save_link.download = name; - click(save_link); - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - return; - } - // Object and web filesystem URLs have a problem saving in Google Chrome when - // viewed in a tab, so I force save with application/octet-stream - // http://code.google.com/p/chromium/issues/detail?id=91158 - // Update: Google errantly closed 91158, I submitted it again: - // https://code.google.com/p/chromium/issues/detail?id=389642 - if (view.chrome && type && type !== force_saveable_type) { - slice = blob.slice || blob.webkitSlice; - blob = slice.call(blob, 0, blob.size, force_saveable_type); - blob_changed = true; - } - // Since I can't be sure that the guessed media type will trigger a download - // in WebKit, I append .download to the filename. - // https://bugs.webkit.org/show_bug.cgi?id=65440 - if (webkit_req_fs && name !== "download") { - name += ".download"; - } - if (type === force_saveable_type || webkit_req_fs) { - target_view = view; - } - if (!req_fs) { - fs_error(); - return; - } - fs_min_size += blob.size; - req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) { - fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) { - var save = function() { - dir.getFile(name, create_if_not_found, abortable(function(file) { - file.createWriter(abortable(function(writer) { - writer.onwriteend = function(event) { - target_view.location.href = file.toURL(); - filesaver.readyState = filesaver.DONE; - dispatch(filesaver, "writeend", event); - revoke(file); - }; - writer.onerror = function() { - var error = writer.error; - if (error.code !== error.ABORT_ERR) { - fs_error(); - } - }; - "writestart progress write abort".split(" ").forEach(function(event) { - writer["on" + event] = filesaver["on" + event]; - }); - writer.write(blob); - filesaver.abort = function() { - writer.abort(); - filesaver.readyState = filesaver.DONE; - }; - filesaver.readyState = filesaver.WRITING; - }), fs_error); - }), fs_error); - }; - dir.getFile(name, {create: false}, abortable(function(file) { - // delete file if it already exists - file.remove(); - save(); - }), abortable(function(ex) { - if (ex.code === ex.NOT_FOUND_ERR) { - save(); - } else { - fs_error(); - } - })); - }), fs_error); - }), fs_error); - } - , FS_proto = FileSaver.prototype - , saveAs = function(blob, name) { - return new FileSaver(blob, name); - } - ; - // IE 10+ (native saveAs) - if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { - return function(blob, name) { - return navigator.msSaveOrOpenBlob(auto_bom(blob), name); - }; - } - - FS_proto.abort = function() { - var filesaver = this; - filesaver.readyState = filesaver.DONE; - dispatch(filesaver, "abort"); - }; - FS_proto.readyState = FS_proto.INIT = 0; - FS_proto.WRITING = 1; - FS_proto.DONE = 2; - - FS_proto.error = - FS_proto.onwritestart = - FS_proto.onprogress = - FS_proto.onwrite = - FS_proto.onabort = - FS_proto.onerror = - FS_proto.onwriteend = - null; - - return saveAs; -}( - typeof self !== "undefined" && self - || typeof window !== "undefined" && window - || this.content -)); -// `self` is undefined in Firefox for Android content script context -// while `this` is nsIContentFrameMessageManager -// with an attribute `content` that corresponds to the window - -if (typeof module !== "undefined" && module.exports) { - module.exports.saveAs = saveAs; -} else if ((typeof define !== "undefined" && 0)) { - define([], function() { - return saveAs; - }); -} -/* - * Copyright (c) 2012 chick307 - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ - -void function(global, callback) { - if (typeof module === 'object') { - module.exports = callback(); - } else if (0 === 'function') { - define(callback); - } else { - global.adler32cs = callback(); - } -}(jsPDF, function() { - var _hasArrayBuffer = typeof ArrayBuffer === 'function' && - typeof Uint8Array === 'function'; - - var _Buffer = null, _isBuffer = (function() { - if (!_hasArrayBuffer) - return function _isBuffer() { return false }; - - try { - var buffer = require('buffer'); - if (typeof buffer.Buffer === 'function') - _Buffer = buffer.Buffer; - } catch (error) {} - - return function _isBuffer(value) { - return value instanceof ArrayBuffer || - _Buffer !== null && value instanceof _Buffer; - }; - }()); - - var _utf8ToBinary = (function() { - if (_Buffer !== null) { - return function _utf8ToBinary(utf8String) { - return new _Buffer(utf8String, 'utf8').toString('binary'); - }; - } else { - return function _utf8ToBinary(utf8String) { - return unescape(encodeURIComponent(utf8String)); - }; - } - }()); - - var MOD = 65521; - - var _update = function _update(checksum, binaryString) { - var a = checksum & 0xFFFF, b = checksum >>> 16; - for (var i = 0, length = binaryString.length; i < length; i++) { - a = (a + (binaryString.charCodeAt(i) & 0xFF)) % MOD; - b = (b + a) % MOD; - } - return (b << 16 | a) >>> 0; - }; - - var _updateUint8Array = function _updateUint8Array(checksum, uint8Array) { - var a = checksum & 0xFFFF, b = checksum >>> 16; - for (var i = 0, length = uint8Array.length, x; i < length; i++) { - a = (a + uint8Array[i]) % MOD; - b = (b + a) % MOD; - } - return (b << 16 | a) >>> 0 - }; - - var exports = {}; - - var Adler32 = exports.Adler32 = (function() { - var ctor = function Adler32(checksum) { - if (!(this instanceof ctor)) { - throw new TypeError( - 'Constructor cannot called be as a function.'); - } - if (!isFinite(checksum = checksum == null ? 1 : +checksum)) { - throw new Error( - 'First arguments needs to be a finite number.'); - } - this.checksum = checksum >>> 0; - }; - - var proto = ctor.prototype = {}; - proto.constructor = ctor; - - ctor.from = function(from) { - from.prototype = proto; - return from; - }(function from(binaryString) { - if (!(this instanceof ctor)) { - throw new TypeError( - 'Constructor cannot called be as a function.'); - } - if (binaryString == null) - throw new Error('First argument needs to be a string.'); - this.checksum = _update(1, binaryString.toString()); - }); - - ctor.fromUtf8 = function(fromUtf8) { - fromUtf8.prototype = proto; - return fromUtf8; - }(function fromUtf8(utf8String) { - if (!(this instanceof ctor)) { - throw new TypeError( - 'Constructor cannot called be as a function.'); - } - if (utf8String == null) - throw new Error('First argument needs to be a string.'); - var binaryString = _utf8ToBinary(utf8String.toString()); - this.checksum = _update(1, binaryString); - }); - - if (_hasArrayBuffer) { - ctor.fromBuffer = function(fromBuffer) { - fromBuffer.prototype = proto; - return fromBuffer; - }(function fromBuffer(buffer) { - if (!(this instanceof ctor)) { - throw new TypeError( - 'Constructor cannot called be as a function.'); - } - if (!_isBuffer(buffer)) - throw new Error('First argument needs to be ArrayBuffer.'); - var array = new Uint8Array(buffer); - return this.checksum = _updateUint8Array(1, array); - }); - } - - proto.update = function update(binaryString) { - if (binaryString == null) - throw new Error('First argument needs to be a string.'); - binaryString = binaryString.toString(); - return this.checksum = _update(this.checksum, binaryString); - }; - - proto.updateUtf8 = function updateUtf8(utf8String) { - if (utf8String == null) - throw new Error('First argument needs to be a string.'); - var binaryString = _utf8ToBinary(utf8String.toString()); - return this.checksum = _update(this.checksum, binaryString); - }; - - if (_hasArrayBuffer) { - proto.updateBuffer = function updateBuffer(buffer) { - if (!_isBuffer(buffer)) - throw new Error('First argument needs to be ArrayBuffer.'); - var array = new Uint8Array(buffer); - return this.checksum = _updateUint8Array(this.checksum, array); - }; - } - - proto.clone = function clone() { - return new Adler32(this.checksum); - }; - - return ctor; - }()); - - exports.from = function from(binaryString) { - if (binaryString == null) - throw new Error('First argument needs to be a string.'); - return _update(1, binaryString.toString()); - }; - - exports.fromUtf8 = function fromUtf8(utf8String) { - if (utf8String == null) - throw new Error('First argument needs to be a string.'); - var binaryString = _utf8ToBinary(utf8String.toString()); - return _update(1, binaryString); - }; - - if (_hasArrayBuffer) { - exports.fromBuffer = function fromBuffer(buffer) { - if (!_isBuffer(buffer)) - throw new Error('First argument need to be ArrayBuffer.'); - var array = new Uint8Array(buffer); - return _updateUint8Array(1, array); - }; - } - - return exports; -}); /** * CssColors * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv @@ -15633,7 +14987,7 @@ function XHR(url) { * http://opensource.org/licenses/mit-license */ -html2pdf = function(html,pdf,callback) { +function html2pdf (html,pdf,callback) { var canvas = pdf.canvas; if (!canvas) { alert('jsPDF canvas plugin not installed'); @@ -16880,6 +16234,9 @@ var FlateStream = (function() { * This allows a host page to simply include require.js and bootstrap the page with a single require statement. */ +// Skip if Require.JS not installed +if (typeof require === 'object') { + if (typeof require_baseUrl_override === 'undefined'){ require_baseUrl_override = '../'; } @@ -16980,6 +16337,7 @@ require.config({ 'html2pdf': 'libs/html2pdf' } }); +} // Require.JS /** vim: et:ts=4:sw=4:sts=4 * @license RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. diff --git a/dist/jspdf.min.js b/dist/jspdf.min.js index 369c88252..a6219ab04 100644 --- a/dist/jspdf.min.js +++ b/dist/jspdf.min.js @@ -1,7 +1,7 @@ /** * jsPDF - PDF Document creation from JavaScript - * Version 1.1.135-git Built on 2015-05-16T00:15 - * CommitID e0da47f3da + * Version 1.1.239-git Built on 2015-08-26T19:44 + * CommitID 67cd0d6b3c * * Copyright (c) 2010-2014 James Hall , https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike @@ -150,29 +150,6 @@ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com * * ==================================================================== */ -/* Blob.js - * A Blob implementation. - * 2014-07-24 - * - * By Eli Grey, http://eligrey.com - * By Devin Samarin, https://github.com/dsamarin - * License: X11/MIT - * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md - */ -/* FileSaver.js - * A saveAs() FileSaver implementation. - * 2015-05-07.2 - * - * By Eli Grey, http://eligrey.com - * License: X11/MIT - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md - */ -/* - * Copyright (c) 2012 chick307 - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license - */ /** * CssColors * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv @@ -263,12 +240,11 @@ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ -!function(exports,global){function renderDocument(t,e,n,r){return createWindowClone(t,t,n,r,e).then(function(i){log("Document cloned");var o="["+html2canvasNodeAttribute+"='true']";t.querySelector(o).removeAttribute(html2canvasNodeAttribute);var s=i.contentWindow,a=s.document.querySelector(o),c=Promise.resolve("function"==typeof e.onclone?e.onclone(s.document):!0);return c.then(function(){return renderWindow(a,i,e,n,r)})})}function renderWindow(t,e,n,r,i){var o=e.contentWindow,s=new Support(o.document),a=new ImageLoader(n,s),c=getBounds(t),u="view"===n.type?r:documentWidth(o.document),l="view"===n.type?i:documentHeight(o.document),h=new CanvasRenderer(u,l,a,n,document),d=new NodeParser(t,h,s,a,n);return d.ready.then(function(){log("Finished rendering");var r;return r="view"===n.type?crop(h.canvas,{width:h.canvas.width,height:h.canvas.height,top:0,left:0,x:0,y:0}):t===o.document.body||t===o.document.documentElement||null!=n.canvas?h.canvas:crop(h.canvas,{width:null!=n.width?n.width:c.width,height:null!=n.height?n.height:c.height,top:c.top,left:c.left,x:o.pageXOffset,y:o.pageYOffset}),cleanupContainer(e,n),r})}function cleanupContainer(t,e){e.removeContainer&&(t.parentNode.removeChild(t),log("Cleaned up container"))}function crop(t,e){var n=document.createElement("canvas"),r=Math.min(t.width-1,Math.max(0,e.left)),i=Math.min(t.width,Math.max(1,e.left+e.width)),o=Math.min(t.height-1,Math.max(0,e.top)),s=Math.min(t.height,Math.max(1,e.top+e.height));return n.width=e.width,n.height=e.height,log("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",i-r,"height:",s-o),log("Resulting crop with width",e.width,"and height",e.height," with x",r,"and y",o),n.getContext("2d").drawImage(t,r,o,i-r,s-o,e.x,e.y,i-r,s-o),n}function documentWidth(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function documentHeight(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function smallImage(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}function createWindowClone(t,e,n,r,i){labelCanvasElements(t);var o=t.documentElement.cloneNode(!0),s=e.createElement("iframe");return s.className="html2canvas-container",s.style.visibility="hidden",s.style.position="fixed",s.style.left="-10000px",s.style.top="0px",s.style.border="0",s.width=n,s.height=r,s.scrolling="no",e.body.appendChild(s),new Promise(function(e){var n=s.contentWindow.document;s.contentWindow.onload=s.onload=function(){var o=setInterval(function(){n.body.childNodes.length>0&&(cloneCanvasContents(t,n),clearInterval(o),"view"===i.type&&s.contentWindow.scrollTo(r,a),e(s))},50)};var r=t.defaultView.pageXOffset,a=t.defaultView.pageYOffset;n.open(),n.write(""),restoreOwnerScroll(t,r,a),n.replaceChild(i.javascriptEnabled===!0?n.adoptNode(o):removeScriptNodes(n.adoptNode(o)),n.documentElement),n.close()})}function restoreOwnerScroll(t,e,n){(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,n)}function loadUrlDocument(t,e,n,r,i,o){return new Proxy(t,e,window.document).then(documentFromHTML(t)).then(function(t){return createWindowClone(t,n,r,i,o)})}function documentFromHTML(t){return function(e){var n,r=new DOMParser;try{n=r.parseFromString(e,"text/html")}catch(i){log("DOMParser not supported, falling back to createHTMLDocument"),n=document.implementation.createHTMLDocument("");try{n.open(),n.write(e),n.close()}catch(o){log("createHTMLDocument write not supported, falling back to document.body.innerHTML"),n.body.innerHTML=e}}var s=n.querySelector("base");if(!s||!s.href.host){var a=n.createElement("base");a.href=t,n.head.insertBefore(a,n.head.firstChild)}return n}}function labelCanvasElements(t){[].slice.call(t.querySelectorAll("canvas"),0).forEach(function(t){t.setAttribute(html2canvasCanvasCloneAttribute,"canvas-"+html2canvasCanvasCloneIndex++)})}function cloneCanvasContents(t,e){[].slice.call(t.querySelectorAll("["+html2canvasCanvasCloneAttribute+"]"),0).forEach(function(t){try{var n=e.querySelector("["+html2canvasCanvasCloneAttribute+'="'+t.getAttribute(html2canvasCanvasCloneAttribute)+'"]');n&&(n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(r){log("Unable to copy canvas content from",t,r)}t.removeAttribute(html2canvasCanvasCloneAttribute)})}function removeScriptNodes(t){return[].slice.call(t.childNodes,0).filter(isElementNode).forEach(function(e){"SCRIPT"===e.tagName?t.removeChild(e):removeScriptNodes(e)}),t}function isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}function absoluteUrl(t){var e=document.createElement("a");return e.href=t,e.href=e.href,e}function DummyImageContainer(t){if(this.src=t,log("DummyImageContainer for",t),!this.promise||!this.image){log("Initiating DummyImageContainer"),DummyImageContainer.prototype.image=new Image;var e=this.image;DummyImageContainer.prototype.promise=new Promise(function(t,n){e.onload=t,e.onerror=n,e.src=smallImage(),e.complete===!0&&t(e)})}}function Font(t,e){var n,r,i=document.createElement("div"),o=document.createElement("img"),s=document.createElement("span"),a="Hidden Text";i.style.visibility="hidden",i.style.fontFamily=t,i.style.fontSize=e,i.style.margin=0,i.style.padding=0,document.body.appendChild(i),o.src=smallImage(),o.width=1,o.height=1,o.style.margin=0,o.style.padding=0,o.style.verticalAlign="baseline",s.style.fontFamily=t,s.style.fontSize=e,s.style.margin=0,s.style.padding=0,s.appendChild(document.createTextNode(a)),i.appendChild(s),i.appendChild(o),n=o.offsetTop-s.offsetTop+1,i.removeChild(s),i.appendChild(document.createTextNode(a)),i.style.lineHeight="normal",o.style.verticalAlign="super",r=o.offsetTop-i.offsetTop+1,document.body.removeChild(i),this.baseline=n,this.lineWidth=1,this.middle=r}function FontMetrics(){this.data={}}function FrameContainer(t,e,n){this.image=null,this.src=t;var r=this,i=getBounds(t);this.promise=(e?new Promise(function(e){"about:blank"===t.contentWindow.document.URL||null==t.contentWindow.document.documentElement?t.contentWindow.onload=t.onload=function(){e(t)}:e(t)}):this.proxyLoad(n.proxy,i,n)).then(function(t){return html2canvas(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return r.image=t})}function GradientContainer(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}function ImageContainer(t,e){this.src=t,this.image=new Image;var n=this;this.tainted=null,this.promise=new Promise(function(r,i){n.image.onload=r,n.image.onerror=i,e&&(n.image.crossOrigin="anonymous"),n.image.src=t,n.image.complete===!0&&r(n.image)})}function ImageLoader(t,e){this.link=null,this.options=t,this.support=e,this.origin=this.getOrigin(window.location.href)}function LinearGradientContainer(t){GradientContainer.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,n=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=n,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(this.stepRegExp);return{color:e[1],stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(n,r){return null!==n.stop?(t.stop=(n.stop-this.colorStops[e-1].stop)/(r+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}function log(){window.html2canvas.logging&&window.console&&window.console.log&&Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-window.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}function NodeContainer(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function selectionValue(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function parseMatrix(t){return t&&"matrix"===t[1]?t[2].split(",").map(function(t){return parseFloat(t.trim())}):void 0}function isPercentage(t){return-1!==t.toString().indexOf("%")}function parseBackgrounds(t){var e,n,r,i,o,s,a,c=" \r\n ",u=[],l=0,h=0,d=function(){e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)),n&&a.push(n),"-"===e.substr(0,1)&&(i=e.indexOf("-",1)+1)>0&&(r=e.substr(0,i),e=e.substr(i)),u.push({prefix:r,method:e.toLowerCase(),value:o,args:a,image:null})),a=[],e=r=n=o=""};return a=[],e=r=n=o="",t.split("").forEach(function(t){if(!(0===l&&c.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===l)return l=1,void(o+=t);h++;break;case")":if(s)break;if(1===l){if(0===h)return l=0,o+=t,void d();h--}break;case",":if(s)break;if(0===l)return void d();if(1===l&&0===h&&!e.match(/^url$/i))return a.push(n),n="",void(o+=t)}o+=t,0===l?e+=t:n+=t}}),d(),u}function removePx(t){return t.replace("px","")}function asFloat(t){return parseFloat(t)}function getBounds(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),n=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}}function offsetBounds(t){var e=t.offsetParent?offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}}function NodeParser(t,e,n,r,i){log("Starting NodeParser"),this.renderer=e,this.options=i,this.range=null,this.support=n,this.renderQueue=[],this.stack=new StackingContext(!0,1,t.ownerDocument,null);var o=new NodeContainer(t,null);if(t===t.ownerDocument.documentElement){var s=new NodeContainer(this.renderer.isTransparent(o.css("backgroundColor"))?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,s.css("backgroundColor"))}o.visibile=o.isElementVisible(),this.createPseudoHideStyles(t.ownerDocument),this.disableAnimations(t.ownerDocument),this.nodes=flatten([o].concat(this.getChildren(o)).filter(function(t){return t.visible=t.isElementVisible()}).map(this.getPseudoElements,this)),this.fontMetrics=new FontMetrics,log("Fetched nodes, total:",this.nodes.length),log("Calculate overflow clips"),this.calculateOverflowClips(),log("Start fetching images"),this.images=r.fetch(this.nodes.filter(isElement)),this.ready=this.images.ready.then(bind(function(){return log("Images loaded, starting parsing"),log("Creating stacking contexts"),this.createStackingContexts(),log("Sorting stacking contexts"),this.sortStackingContexts(this.stack),this.parse(this.stack),log("Render queue created with "+this.renderQueue.length+" items"),new Promise(bind(function(t){i.async?"function"==typeof i.async?i.async.call(this,this.renderQueue,t):this.renderQueue.length>0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function hasParentClip(t){return t.parent&&t.parent.clip.length}function toCamelCase(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function ClearTransform(){}function calculateBorders(t,e,n,r){return t.map(function(i,o){if(i.width>0){var s=e.left,a=e.top,c=e.width,u=e.height-t[2].width;switch(o){case 0:u=t[0].width,i.args=drawSide({c1:[s,a],c2:[s+c,a],c3:[s+c-t[1].width,a+u],c4:[s+t[3].width,a+u]},r[0],r[1],n.topLeftOuter,n.topLeftInner,n.topRightOuter,n.topRightInner);break;case 1:s=e.left+e.width-t[1].width,c=t[1].width,i.args=drawSide({c1:[s+c,a],c2:[s+c,a+u+t[2].width],c3:[s,a+u],c4:[s,a+t[0].width]},r[1],r[2],n.topRightOuter,n.topRightInner,n.bottomRightOuter,n.bottomRightInner);break;case 2:a=a+e.height-t[2].width,u=t[2].width,i.args=drawSide({c1:[s+c,a+u],c2:[s,a+u],c3:[s+t[3].width,a],c4:[s+c-t[3].width,a]},r[2],r[3],n.bottomRightOuter,n.bottomRightInner,n.bottomLeftOuter,n.bottomLeftInner);break;case 3:c=t[3].width,i.args=drawSide({c1:[s,a+u+t[2].width],c2:[s,a],c3:[s+c,a+t[0].width],c4:[s+c,a+u]},r[3],r[0],n.bottomLeftOuter,n.bottomLeftInner,n.topLeftOuter,n.topLeftInner)}}return i})}function getCurvePoints(t,e,n,r){var i=4*((Math.sqrt(2)-1)/3),o=n*i,s=r*i,a=t+n,c=e+r;return{topLeft:bezierCurve({x:t,y:c},{x:t,y:c-s},{x:a-o,y:e},{x:a,y:e}),topRight:bezierCurve({x:t,y:e},{x:t+o,y:e},{x:a,y:c-s},{x:a,y:c}),bottomRight:bezierCurve({x:a,y:e},{x:a,y:e+s},{x:t+o,y:c},{x:t,y:c}),bottomLeft:bezierCurve({x:a,y:c},{x:a-o,y:c},{x:t,y:e+s},{x:t,y:e})}}function calculateCurvePoints(t,e,n){var r=t.left,i=t.top,o=t.width,s=t.height,a=e[0][0],c=e[0][1],u=e[1][0],l=e[1][1],h=e[2][0],d=e[2][1],f=e[3][0],p=e[3][1],m=o-u,g=s-d,w=o-h,y=s-p;return{topLeftOuter:getCurvePoints(r,i,a,c).topLeft.subdivide(.5),topLeftInner:getCurvePoints(r+n[3].width,i+n[0].width,Math.max(0,a-n[3].width),Math.max(0,c-n[0].width)).topLeft.subdivide(.5),topRightOuter:getCurvePoints(r+m,i,u,l).topRight.subdivide(.5),topRightInner:getCurvePoints(r+Math.min(m,o+n[3].width),i+n[0].width,m>o+n[3].width?0:u-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:getCurvePoints(r+w,i+g,h,d).bottomRight.subdivide(.5),bottomRightInner:getCurvePoints(r+Math.min(w,o-n[3].width),i+Math.min(g,s+n[0].width),Math.max(0,h-n[1].width),d-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:getCurvePoints(r,i+y,f,p).bottomLeft.subdivide(.5),bottomLeftInner:getCurvePoints(r+n[3].width,i+y,Math.max(0,f-n[3].width),p-n[2].width).bottomLeft.subdivide(.5)}}function bezierCurve(t,e,n,r){var i=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:t,startControl:e,endControl:n,end:r,subdivide:function(o){var s=i(t,e,o),a=i(e,n,o),c=i(n,r,o),u=i(s,a,o),l=i(a,c,o),h=i(u,l,o);return[bezierCurve(t,s,u,h),bezierCurve(h,l,c,r)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,n.x,n.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",n.x,n.y,e.x,e.y,t.x,t.y])}}}function drawSide(t,e,n,r,i,o,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),n[0]>0||n[1]>0?(a.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",i[1].end.x,i[1].end.y]),i[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function parseCorner(t,e,n,r,i,o,s){e[0]>0||e[1]>0?(t.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(t),r[1].curveTo(t)):t.push(["line",o,s]),(n[0]>0||n[1]>0)&&t.push(["line",i[0].start.x,i[0].start.y])}function negativeZIndex(t){return t.cssInt("zIndex")<0}function positiveZIndex(t){return t.cssInt("zIndex")>0}function zIndex0(t){return 0===t.cssInt("zIndex")}function inlineLevel(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function isStackingContext(t){return t instanceof StackingContext}function hasText(t){return t.node.data.trim().length>0}function noLetterSpacing(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function getBorderRadiusData(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var n=t.css("border"+e+"Radius"),r=n.split(" ");return r.length<=1&&(r[1]=r[0]),r.map(asInt)})}function renderableNode(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function isPositionedForStacking(t){var e=t.css("position"),n=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==n}function isPositioned(t){return"static"!==t.css("position")}function isFloating(t){return"none"!==t.css("float")}function isInlineBlock(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function not(t){var e=this;return function(){return!t.apply(e,arguments)}}function isElement(t){return t.node.nodeType===Node.ELEMENT_NODE}function isPseudoElement(t){return t.isPseudoElement===!0}function isTextNode(t){return t.node.nodeType===Node.TEXT_NODE}function zIndexSort(t){return function(e,n){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(n.cssInt("zIndex")+t.indexOf(n)/t.length)}}function hasOpacity(t){return t.getOpacity()<1}function bind(t,e){return function(){return t.apply(e,arguments)}}function asInt(t){return parseInt(t,10)}function getWidth(t){return t.width}function nonIgnoredElement(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function flatten(t){return[].concat.apply([],t)}function stripQuotes(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function getWords(t){for(var e,n=[],r=0,i=!1;t.length;)isWordBoundary(t[r])===i?(e=t.splice(0,r),e.length&&n.push(window.html2canvas.punycode.ucs2.encode(e)),i=!i,r=0):r++,r>=t.length&&(e=t.splice(0,r),e.length&&n.push(window.html2canvas.punycode.ucs2.encode(e)));return n}function isWordBoundary(t){return-1!==[32,13,10,9,45].indexOf(t)}function hasUnicode(t){return/[^\u0000-\u00ff]/.test(t)}function Proxy(t,e,n){var r=createCallback(supportsCORS),i=createProxyUrl(e,t,r);return supportsCORS?XHR(i):jsonp(n,i,r).then(function(t){return decode64(t.content)})}function ProxyURL(t,e,n){var r=createCallback(supportsCORSImage),i=createProxyUrl(e,t,r);return supportsCORSImage?Promise.resolve(i):jsonp(n,i,r).then(function(t){return"data:"+t.type+";base64,"+t.content})}function jsonp(t,e,n){return new Promise(function(r,i){var o=t.createElement("script"),s=function(){delete window.html2canvas.proxy[n],t.body.removeChild(o)};window.html2canvas.proxy[n]=function(t){s(),r(t)},o.src=e,o.onerror=function(t){s(),i(t)},t.body.appendChild(o)})}function createCallback(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++proxyCount+"_"+Math.round(1e5*Math.random())}function createProxyUrl(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}function ProxyImageContainer(t,e){var n=(document.createElement("script"),document.createElement("a"));n.href=t,t=n.href,this.src=t,this.image=new Image;var r=this;this.promise=new Promise(function(n,i){r.image.crossOrigin="Anonymous",r.image.onload=n,r.image.onerror=i,new ProxyURL(t,e,document).then(function(t){r.image.src=t})["catch"](i)})}function PseudoElementContainer(t,e,n){NodeContainer.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===n}function Renderer(t,e,n,r,i){this.width=t,this.height=e,this.images=n,this.options=r,this.document=i}function StackingContext(t,e,n,r){NodeContainer.call(this,n,r),this.ownStacking=t,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*e}function Support(t){this.rangeBounds=this.testRangeBounds(t),this.cors=this.testCORS(),this.svg=this.testSVG()}function SVGContainer(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?Promise.resolve(e.inlineFormatting(t)):XHR(t)}).then(function(t){return new Promise(function(n){html2canvas.fabric.loadSVGFromString(t,e.createCanvas.call(e,n))})})}function decode64(t){var e,n,r,i,o,s,a,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=t.length,h="";for(e=0;l>e;e+=4)n=u.indexOf(t[e]),r=u.indexOf(t[e+1]),i=u.indexOf(t[e+2]),o=u.indexOf(t[e+3]),s=n<<2|r>>4,a=(15&r)<<4|i>>2,c=(3&i)<<6|o,h+=64===i?String.fromCharCode(s):64===o||-1===o?String.fromCharCode(s,a):String.fromCharCode(s,a,c);return h}function SVGNodeContainer(t,e){this.src=t,this.image=null;var n=this;this.promise=e?new Promise(function(e,r){n.image=new Image,n.image.onload=e,n.image.onerror=r,n.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),n.image.complete===!0&&e(n.image)}):this.hasFabric().then(function(){return new Promise(function(e){html2canvas.fabric.parseSVGDocument(t,n.createCanvas.call(n,e))})})}function TextContainer(t,e){NodeContainer.call(this,t,e)}function capitalize(t,e,n){return t.length>0?e+n.toUpperCase():void 0}function WebkitGradientContainer(t){GradientContainer.apply(this,arguments),this.type="linear"===t.args[0]?this.TYPES.LINEAR:this.TYPES.RADIAL}function XHR(t){return new Promise(function(e,n){var r=new XMLHttpRequest;r.open("GET",t),r.onload=function(){200===r.status?e(r.responseText):n(new Error(r.statusText))},r.onerror=function(){n(new Error("Network Error"))},r.send()})}global[""]=exports;var jsPDF=function(t){"use strict";function e(e){var n={};this.subscribe=function(t,e,r){if("function"!=typeof e)return!1;n.hasOwnProperty(t)||(n[t]={});var i=Math.random().toString(35);return n[t][i]=[e,!!r],i},this.unsubscribe=function(t){for(var e in n)if(n[e][t])return delete n[e][t],!0;return!1},this.publish=function(r){if(n.hasOwnProperty(r)){var i=Array.prototype.slice.call(arguments,1),o=[];for(var s in n[r]){var a=n[r][s];try{a[0].apply(e,i)}catch(c){t.console&&console.error("jsPDF PubSub Error",c.message,c)}a[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}}}function n(s,a,c,u){var l={};"object"==typeof s&&(l=s,s=l.orientation,a=l.unit||a,c=l.format||c,u=l.compress||l.compressPdf||u),a=a||"mm",c=c||"a4",s=(""+(s||"P")).toLowerCase();var h,d,f,p,m,g,w,y,v,b=((""+c).toLowerCase(),!!u&&"function"==typeof Uint8Array),x=l.textColor||"0 g",k=l.drawColor||"0 G",C=l.fontSize||16,E=l.lineHeight||1.15,S=l.lineWidth||.200025,T=2,_=!1,q=[],I={},P={},A=0,O=[],R=[],N=[],B=[],D=[],L=0,F=0,M=0,j={title:"",subject:"",author:"",keywords:"",creator:""},z={},U=new e(z),H=function(t){return t.toFixed(2)},W=function(t){return t.toFixed(3)},V=function(t){return("0"+parseInt(t)).slice(-2)},G=function(t){_?O[p].push(t):(M+=t.length+1,B.push(t))},X=function(){return T++,q[T]=M,G(T+" 0 obj"),T},Y=function(){var t=2*O.length+1;t+=D.length;var e={objId:t,content:""};return D.push(e),e},J=function(){return T++,q[T]=function(){return M},T},Q=function(t){q[t]=M},$=function(t){G("stream"),G(t),G("endstream")},Z=function(){var e,r,i,o,s,a,c,u,l;for(c=t.adler32cs||n.adler32cs,b&&"undefined"==typeof c&&(b=!1),e=1;A>=e;e++){if(X(),u=(m=N[e].width)*d,l=(g=N[e].height)*d,G("<>"),G("endobj"),r=O[e].join("\n"),X(),b){for(i=[],o=r.length;o--;)i[o]=r.charCodeAt(o);a=c.from(r),s=new Deflater(6),s.append(new Uint8Array(i)),r=s.flush(),i=new Uint8Array(r.length+6),i.set(new Uint8Array([120,156])),i.set(r,2),i.set(new Uint8Array([255&a,a>>8&255,a>>16&255,a>>24&255]),r.length+2),r=String.fromCharCode.apply(null,i),G("<>")}else G("<>");$(r),G("endobj")}q[1]=M,G("1 0 obj"),G("<o;o++)h+=3+2*o+" 0 R ";G(h+"]"),G("/Count "+A),G(">>"),G("endobj")},K=function(t){t.objectNumber=X(),G("<>"),G("endobj")},tt=function(){for(var t in I)I.hasOwnProperty(t)&&K(I[t])},et=function(){U.publish("putXobjectDict")},nt=function(){G("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),G("/Font <<");for(var t in I)I.hasOwnProperty(t)&&G("/"+t+" "+I[t].objectNumber+" 0 R");G(">>"),G("/XObject <<"),et(),G(">>")},rt=function(){tt(),U.publish("putResources"),q[2]=M,G("2 0 obj"),G("<<"),nt(),G(">>"),G("endobj"),U.publish("postPutResources")},it=function(){U.publish("putAdditionalObjects");for(var t=0;tu;u++){var h=st(c[u][0],c[u][1],c[u][2],a),d=c[u][0].split("-");ot(h,d[0],d[1]||"")}U.publish("addFonts",{fonts:I,dictionary:P})},ct=function(e){return e.foo=function(){try{return e.apply(this,arguments)}catch(n){var r=n.stack||"";~r.indexOf(" at ")&&(r=r.split(" at ")[1]);var i="Error in function "+r.split("\n")[0].split("<")[0]+": "+n.message;if(!t.console)throw new Error(i);t.console.error(i,n),t.alert&&alert(i)}},e.foo.bar=e,e.foo},ut=function(t,e){var n,r,i,o,s,a,c,u,l;if(e=e||{},i=e.sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&I[h].metadata&&I[h].metadata[i]&&I[h].metadata[i].encoding&&(o=I[h].metadata[i].encoding,!s&&I[h].encoding&&(s=I[h].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(c=!1,a=[],n=0,r=t.length;r>n;n++)u=s[t.charCodeAt(n)],a.push(u?String.fromCharCode(u):t[n]),a[n].charCodeAt(0)>>8&&(c=!0);t=a.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;r>n;n++){if(u=t.charCodeAt(n),l=u>>8,l>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(l),a.push(u-(l<<8))}return String.fromCharCode.apply(void 0,a)},lt=function(t,e){return ut(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ht=function(){G("/Producer (jsPDF "+n.version+")");for(var t in j)j.hasOwnProperty(t)&&j[t]&&G("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+lt(j[t])+")");var e=new Date,r=e.getTimezoneOffset(),i=0>r?"+":"-",o=Math.floor(Math.abs(r/60)),s=Math.abs(r%60),a=[i,V(o),"'",V(s),"'"].join("");G(["/CreationDate (D:",e.getFullYear(),V(e.getMonth()+1),V(e.getDate()),V(e.getHours()),V(e.getMinutes()),V(e.getSeconds()),a,")"].join(""))},dt=function(){switch(G("/Type /Catalog"),G("/Pages 1 0 R"),y||(y="fullwidth"),y){case"fullwidth":G("/OpenAction [3 0 R /FitH null]");break;case"fullheight":G("/OpenAction [3 0 R /FitV null]");break;case"fullpage":G("/OpenAction [3 0 R /Fit]");break;case"original":G("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+y;"%"===t.substr(t.length-1)&&(y=parseInt(y)/100),"number"==typeof y&&G("/OpenAction [3 0 R /XYZ null null "+H(y)+"]")}switch(v||(v="continuous"),v){case"continuous":G("/PageLayout /OneColumn");break;case"single":G("/PageLayout /SinglePage");break;case"two":case"twoleft":G("/PageLayout /TwoColumnLeft");break;case"tworight":G("/PageLayout /TwoColumnRight")}w&&G("/PageMode /"+w),U.publish("putCatalog")},ft=function(){G("/Size "+(T+1)),G("/Root "+T+" 0 R"),G("/Info "+(T-1)+" 0 R")},pt=function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();o.hasOwnProperty(r)&&(t=o[r][0]/d,e=o[r][1]/d)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":e>t&&(n="s");break;case"p":t>e&&(n="s")}"s"===n&&(f=t,t=e,e=f)}_=!0,O[++A]=[],N[A]={width:Number(t)||m,height:Number(e)||g},R[A]={},wt(A)},mt=function(){pt.apply(this,arguments),G(H(S*d)+" w"),G(k),0!==L&&G(L+" J"),0!==F&&G(F+" j"),U.publish("addPage",{pageNumber:A})},gt=function(t){t>0&&A>=t&&(O.splice(t,1),N.splice(t,1),A--,p>A&&(p=A),this.setPage(p))},wt=function(t){t>0&&A>=t&&(p=t,m=N[t].width,g=N[t].height)},yt=function(t,e){var n;switch(t=void 0!==t?t:I[h].fontName,e=void 0!==e?e:I[h].fontStyle,void 0!==t&&(t=t.toLowerCase()),t){case"sans-serif":case"verdana":case"arial":t="helvetica";break;case"fixed":case"monospace":case"terminal":t="courier";break;case"serif":case"cursive":case"fantasy":default:t="times"}try{n=P[t][e]}catch(r){}return n||(n=P.times[e],null==n&&(n=P.times.normal)),n},vt=function(){_=!1,T=2,B=[],q=[],D=[],G("%PDF-"+r),Z(),it(),rt(),X(),G("<<"),ht(),G(">>"),G("endobj"),X(),G("<<"),dt(),G(">>"),G("endobj");var t,e=M,n="0000000000";for(G("xref"),G("0 "+(T+1)),G(n+" 65535 f "),t=1;T>=t;t++){var i=q[t];G("function"==typeof i?(n+q[t]()).slice(-10)+" 00000 n ":(n+q[t]).slice(-10)+" 00000 n ")}return G("trailer"),G("<<"),ft(),G(">>"),G("startxref"),G(e),G("%%EOF"),_=!0,B.join("\n")},bt=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":("f"===t||"f*"===t||"B"===t||"B*"===t)&&(e=t),e},xt=function(){for(var t=vt(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},kt=function(){return new Blob([xt()],{type:"application/pdf"})},Ct=ct(function(e,n){var r="dataur"===(""+e).substr(0,6)?"data:application/pdf;base64,"+btoa(vt()):0;switch(e){case void 0:return vt();case"save":if(navigator.getUserMedia&&(void 0===t.URL||void 0===t.URL.createObjectURL))return z.output("dataurlnewwindow");saveAs(kt(),n),"function"==typeof saveAs.unload&&t.setTimeout&&setTimeout(saveAs.unload,911);break;case"arraybuffer":return xt();case"blob":return kt();case"bloburi":case"bloburl":return t.URL&&t.URL.createObjectURL(kt())||void 0;case"datauristring":case"dataurlstring":return r;case"dataurlnewwindow":var i=t.open(r);if(i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return t.document.location.href=r;default:throw new Error('Output type "'+e+'" is not supported.')}});switch(a){case"pt":d=1;break;case"mm":d=72/25.4000508;break;case"cm":d=72/2.54000508;break;case"in":d=72;break;case"px":d=96/72;break;case"pc":d=12;break;case"em":d=12;break;case"ex":d=6;break;default:throw"Invalid unit: "+a}z.internal={pdfEscape:lt,getStyle:bt,getFont:function(){return I[yt.apply(z,arguments)]},getFontSize:function(){return C},getLineHeight:function(){return C*E},write:function(t){G(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return H(t*d)},getVerticalCoordinateString:function(t){return H((g-t)*d)},collections:{},newObject:X,newAdditionalObject:Y,newObjectDeferred:J,newObjectDeferredBegin:Q,putStream:$,events:U,scaleFactor:d,pageSize:{get width(){return m},get height(){return g}},output:function(t,e){return Ct(t,e)},getNumberOfPages:function(){return O.length-1},pages:O,out:G,f2:H,getPageInfo:function(t){var e=2*(t-1)+3;return{objId:e,pageNumber:t,pageContext:R[t]}},getCurrentPageInfo:function(){var t=2*(p-1)+3;return{objId:t,pageNumber:p,pageContext:R[p]}}},z.addPage=function(){return mt.apply(this,arguments),this},z.setPage=function(){return wt.apply(this,arguments),this},z.insertPage=function(t){return this.addPage(),this.movePage(p,t),this},z.movePage=function(t,e){if(t>e){for(var n=O[t],r=N[t],i=R[t],o=t;o>e;o--)O[o]=O[o-1],N[o]=N[o-1],R[o]=R[o-1];O[e]=n,N[e]=r,R[e]=i,this.setPage(e)}else if(e>t){for(var n=O[t],r=N[t],i=R[t],o=t;e>o;o++)O[o]=O[o+1],N[o]=N[o+1],R[o]=R[o+1];O[e]=n,N[e]=r,R[e]=i,this.setPage(e)}return this},z.deletePage=function(){return gt.apply(this,arguments),this},z.setDisplayMode=function(t,e,n){return y=t,v=e,w=n,this},z.text=function(t,e,n,r,o,s){function a(t){return t=t.split(" ").join(Array(l.TabLen||9).join(" ")), -lt(t,r)}"number"==typeof t&&(f=n,n=e,e=t,t=f),"string"==typeof t&&(t=t.match(/[\n\r]/)?t.split(/\r\n|\r|\n/g):[t]),"string"==typeof o&&(s=o,o=null),"string"==typeof r&&(s=r,r=null),"number"==typeof r&&(o=r,r=null);var c,u="",p="Td";if(o){o*=Math.PI/180;var m=Math.cos(o),w=Math.sin(o);u=[H(m),H(w),H(-1*w),H(m),""].join(" "),p="Tm"}r=r||{},"noBOM"in r||(r.noBOM=!0),"autoencode"in r||(r.autoencode=!0);var y="",v=this.internal.getCurrentPageInfo().pageContext;if(!0===r.stroke?v.lastTextWasStroke!==!0&&(y="1 Tr\n",v.lastTextWasStroke=!0):(v.lastTextWasStroke&&(y="0 Tr\n"),v.lastTextWasStroke=!1),"undefined"==typeof this._runningPageHeight&&(this._runningPageHeight=0),"string"==typeof t)t=a(t);else{if(!(t instanceof Array))throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');for(var b=t.concat(),k=[],S=b.length;S--;)k.push(a(b.shift()));var T=Math.ceil((g-n-this._runningPageHeight)*d/(C*E));if(T>=0&&Ti;i++,e+=r)this.text(t[i],e,n)},z.line=function(t,e,n,r){return this.lines([[n-t,r-e]],t,e)},z.clip=function(){G("W"),G("S")},z.lines=function(t,e,n,r,i,o){var s,a,c,u,l,h,p,m,w,y,v;for("number"==typeof t&&(f=n,n=e,e=t,t=f),r=r||[1,1],G(W(e*d)+" "+W((g-n)*d)+" m "),s=r[0],a=r[1],u=t.length,y=e,v=n,c=0;u>c;c++)l=t[c],2===l.length?(y=l[0]*s+y,v=l[1]*a+v,G(W(y*d)+" "+W((g-v)*d)+" l")):(h=l[0]*s+y,p=l[1]*a+v,m=l[2]*s+y,w=l[3]*a+v,y=l[4]*s+y,v=l[5]*a+v,G(W(h*d)+" "+W((g-p)*d)+" "+W(m*d)+" "+W((g-w)*d)+" "+W(y*d)+" "+W((g-v)*d)+" c"));return o&&G(" h"),null!==i&&G(bt(i)),this},z.rect=function(t,e,n,r,i){bt(i);return G([H(t*d),H((g-e)*d),H(n*d),H(-r*d),"re"].join(" ")),null!==i&&G(bt(i)),this},z.triangle=function(t,e,n,r,i,o,s){return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],s,!0),this},z.roundedRect=function(t,e,n,r,i,o,s){var a=4/3*(Math.SQRT2-1);return this.lines([[n-2*i,0],[i*a,0,i,o-o*a,i,o],[0,r-2*o],[0,o*a,-(i*a),o,-i,o],[-n+2*i,0],[-(i*a),0,-i,-(o*a),-i,-o],[0,-r+2*o],[0,-(o*a),i*a,-o,i,-o]],t+i,e,[1,1],s),this},z.ellipse=function(t,e,n,r,i){var o=4/3*(Math.SQRT2-1)*n,s=4/3*(Math.SQRT2-1)*r;return G([H((t+n)*d),H((g-e)*d),"m",H((t+n)*d),H((g-(e-s))*d),H((t+o)*d),H((g-(e-r))*d),H(t*d),H((g-(e-r))*d),"c"].join(" ")),G([H((t-o)*d),H((g-(e-r))*d),H((t-n)*d),H((g-(e-s))*d),H((t-n)*d),H((g-e)*d),"c"].join(" ")),G([H((t-n)*d),H((g-(e+s))*d),H((t-o)*d),H((g-(e+r))*d),H(t*d),H((g-(e+r))*d),"c"].join(" ")),G([H((t+o)*d),H((g-(e+r))*d),H((t+n)*d),H((g-(e+s))*d),H((t+n)*d),H((g-e)*d),"c"].join(" ")),null!==i&&G(bt(i)),this},z.circle=function(t,e,n,r){return this.ellipse(t,e,n,n,r)},z.setProperties=function(t){for(var e in j)j.hasOwnProperty(e)&&t[e]&&(j[e]=t[e]);return this},z.setFontSize=function(t){return C=t,this},z.setFont=function(t,e){return h=yt(t,e),this},z.setFontStyle=z.setFontType=function(t){return h=yt(void 0,t),this},z.getFontList=function(){var t,e,n,r={};for(t in P)if(P.hasOwnProperty(t)){r[t]=n=[];for(e in P[t])P[t].hasOwnProperty(e)&&n.push(e)}return r},z.addFont=function(t,e,n){st(t,e,n,"StandardEncoding")},z.setLineWidth=function(t){return G((t*d).toFixed(2)+" w"),this},z.setDrawColor=function(t,e,n,r){var i;return i=void 0===e||void 0===r&&t===e===n?"string"==typeof t?t+" G":H(t/255)+" G":void 0===r?"string"==typeof t?[t,e,n,"RG"].join(" "):[H(t/255),H(e/255),H(n/255),"RG"].join(" "):"string"==typeof t?[t,e,n,r,"K"].join(" "):[H(t),H(e),H(n),H(r),"K"].join(" "),G(i),this},z.setFillColor=function(t,e,n,r){var i;return void 0===e||void 0===r&&t===e===n?i="string"==typeof t?t+" g":H(t/255)+" g":void 0===r||"object"==typeof r?(i="string"==typeof t?[t,e,n,"rg"].join(" "):[H(t/255),H(e/255),H(n/255),"rg"].join(" "),r&&0===r.a&&(i=["255","255","255","rg"].join(" "))):i="string"==typeof t?[t,e,n,r,"k"].join(" "):[H(t),H(e),H(n),H(r),"k"].join(" "),G(i),this},z.setTextColor=function(t,e,n){if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var r=parseInt(t.substr(1),16);t=r>>16&255,e=r>>8&255,n=255&r}return x=0===t&&0===e&&0===n||"undefined"==typeof e?W(t/255)+" g":[W(t/255),W(e/255),W(n/255),"rg"].join(" "),this},z.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},z.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return L=e,G(e+" J"),this},z.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return F=e,G(e+" j"),this},z.output=Ct,z.save=function(t){z.output("save",t)};for(var Et in n.API)n.API.hasOwnProperty(Et)&&("events"===Et&&n.API.events.length?!function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(U,n.API.events):z[Et]=n.API[Et]);return at(),h="F1",mt(c,s),U.publish("initialized"),z}var r="1.3",o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};return n.API={events:[]},n.version="1.1.135-git 2015-05-16T00:15:jameshall","function"==typeof define&&define.amd?define("jsPDF",function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:t.jsPDF=n,n}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this);!function(t){"use strict";t.addHTML=function(t,e,n,r,i){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof e&&(r=e,i=n),"function"==typeof r&&(i=r,r=null);var o=this.internal,s=o.scaleFactor,a=o.pageSize.width,c=o.pageSize.height;if(r=r||{},r.onrendered=function(t){e=parseInt(e)||0,n=parseInt(n)||0;var o=r.dim||{},u=o.h||0,l=o.w||Math.min(a,t.width/s)-e,h="JPEG";if(r.format&&(h=r.format),t.height>c&&r.pagesplit){var d=function(){for(var r=0;;){var o=document.createElement("canvas");o.width=Math.min(a*s,t.width),o.height=Math.min(c*s,t.height-r);var u=o.getContext("2d");u.drawImage(t,0,r,t.width,o.height,0,0,o.width,o.height);var d=[o,e,r?0:n,o.width/s,o.height/s,h,null,"SLOW"];if(this.addImage.apply(this,d),r+=o.height,r>=t.height)break;this.addPage()}i(l,r,null,d)}.bind(this);if("CANVAS"===t.nodeName){var f=new Image;f.onload=d,f.src=t.toDataURL("image/png"),t=f}else d()}else{var p=Math.random().toString(35),m=[t,e,n,l,u,h,p,"SLOW"];this.addImage.apply(this,m),i(l,u,p,m)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"!=typeof rasterizeHTML){var u="drawDocument";return"string"==typeof t&&(u=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||a*s,rasterizeHTML[u](t,void 0,r).then(function(t){r.onrendered(t.image)},function(t){i(null,t)})}return null}}(jsPDF.API),function(t){"use strict";var e="addImage_",n=["jpeg","jpg","png"],r=function(t){var e=this.internal.newObject(),n=this.internal.write,i=this.internal.putStream;if(t.n=e,n("<>"),"trns"in t&&t.trns.constructor==Array){for(var o="",s=0,a=t.trns.length;a>s;s++)o+=t.trns[s]+" "+t.trns[s]+" ";n("/Mask ["+o+"]")}if("smask"in t&&n("/SMask "+(e+1)+" 0 R"),n("/Length "+t.data.length+">>"),i(t.data),n("endobj"),"smask"in t){var c="/Predictor 15 /Colors 1 /BitsPerComponent "+t.bpc+" /Columns "+t.w,u={w:t.w,h:t.h,cs:"DeviceGray",bpc:t.bpc,dp:c,data:t.smask};"f"in t&&(u.f=t.f),r.call(this,u)}t.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),n("<< /Length "+t.pal.length+">>"),i(this.arrayBufferToBinaryString(new Uint8Array(t.pal))),n("endobj"))},i=function(){var t=this.internal.collections[e+"images"];for(var n in t)r.call(this,t[n])},o=function(){var t,n=this.internal.collections[e+"images"],r=this.internal.write;for(var i in n)t=n[i],r("/I"+t.i,t.n,"0","R")},s=function(e){return e&&"string"==typeof e&&(e=e.toUpperCase()),e in t.image_compression?e:t.image_compression.NONE},a=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",o)),t},c=function(t){var e=0;return t&&(e=Object.keys?Object.keys(t).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(t)),e},u=function(t){return"undefined"==typeof t||null===t},l=function(e){return"string"==typeof e&&t.sHashCode(e)},h=function(t){return-1===n.indexOf(t)},d=function(e){return"function"!=typeof t["process"+e.toUpperCase()]},f=function(t){return"object"==typeof t&&1===t.nodeType},p=function(t,e,n){if("IMG"===t.nodeName&&t.hasAttribute("src")){var r=""+t.getAttribute("src");if(!n&&0===r.indexOf("data:image/"))return r;!e&&/\.png(?:[?#].*)?$/i.test(r)&&(e="png")}if("CANVAS"===t.nodeName)var i=t;else{var i=document.createElement("canvas");i.width=t.clientWidth||t.width,i.height=t.clientHeight||t.height;var o=i.getContext("2d");if(!o)throw"addImage requires canvas to be supported by browser.";if(n){var s,a,c,u,l,h,d,f,p=Math.PI/180;"object"==typeof n&&(s=n.x,a=n.y,c=n.bg,n=n.angle),f=n*p,u=Math.abs(Math.cos(f)),l=Math.abs(Math.sin(f)),h=i.width,d=i.height,i.width=d*l+h*u,i.height=d*u+h*l,isNaN(s)&&(s=i.width/2),isNaN(a)&&(a=i.height/2),o.clearRect(0,0,i.width,i.height),o.fillStyle=c||"white",o.fillRect(0,0,i.width,i.height),o.save(),o.translate(s,a),o.rotate(f),o.drawImage(t,-(h/2),-(d/2)),o.rotate(-f),o.translate(-s,-a),o.restore()}else o.drawImage(t,0,0,i.width,i.height)}return i.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},m=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n},g=function(t,e,n){return t||e||(t=-96,e=-96),0>t&&(t=-1*n.w*72/t/this.internal.scaleFactor),0>e&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]},w=function(t,e,n,r,i,o,s){var a=g.call(this,n,r,i),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;n=a[0],r=a[1],s[o]=i,this.internal.write("q",c(n),"0 0",c(r),c(t),u(e+r),"cm /I"+i.i,"Do Q")};t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPERATION:"Seperation",DEVICE_N:"DeviceN"},t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},t.sHashCode=function(t){return Array.prototype.reduce&&t.split("").reduce(function(t,e){return t=(t<<5)-t+e.charCodeAt(0),t&t},0)},t.isString=function(t){return"string"==typeof t},t.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t)},t.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},t.isArrayBuffer=function(t){return this.supportsArrayBuffer()?t instanceof ArrayBuffer:!1},t.isArrayBufferView=function(t){return this.supportsArrayBuffer()?"undefined"==typeof Uint32Array?!1:t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array:!1},t.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;e>r;r++)n[r]=t.charCodeAt(r);return n},t.arrayBufferToBinaryString=function(t){this.isArrayBuffer(t)&&(t=new Uint8Array(t));for(var e="",n=t.byteLength,r=0;n>r;r++)e+=String.fromCharCode(t[r]);return e},t.arrayBufferToBase64=function(t){for(var e,n,r,i,o,s="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=new Uint8Array(t),u=c.byteLength,l=u%3,h=u-l,d=0;h>d;d+=3)o=c[d]<<16|c[d+1]<<8|c[d+2],e=(16515072&o)>>18,n=(258048&o)>>12,r=(4032&o)>>6,i=63&o,s+=a[e]+a[n]+a[r]+a[i];return 1==l?(o=c[h],e=(252&o)>>2,n=(3&o)<<4,s+=a[e]+a[n]+"=="):2==l&&(o=c[h]<<8|c[h+1],e=(64512&o)>>10,n=(1008&o)>>4,r=(15&o)<<2,s+=a[e]+a[n]+a[r]+"="),s},t.createImageInfo=function(t,e,n,r,i,o,s,a,c,u,l,h){var d={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(d.f=o),c&&(d.dp=c),u&&(d.trns=u),l&&(d.pal=l),h&&(d.smask=h),d},t.addImage=function(t,e,r,i,o,g,y,v,b){if("string"!=typeof e){var x=g;g=o,o=i,i=r,r=e,e=x}if("object"==typeof t&&!f(t)&&"imageData"in t){var k=t;t=k.imageData,e=k.format||e,r=k.x||r||0,i=k.y||i||0,o=k.w||o,g=k.h||g,y=k.alias||y,v=k.compression||v,b=k.rotation||k.angle||b}if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var C,E=a.call(this);if(!(C=m(t,E))){var S;if(f(t)&&(t=p(t,e,b)),u(y)&&(y=l(t)),!(C=m(y,E))){if(this.isString(t)){var T=this.extractInfoFromBase64DataURI(t);T?(e=T[2],t=atob(T[3])):137===t.charCodeAt(0)&&80===t.charCodeAt(1)&&78===t.charCodeAt(2)&&71===t.charCodeAt(3)&&(e="png")}if(e=(e||"JPEG").toLowerCase(),h(e))throw new Error("addImage currently only supports formats "+n+", not '"+e+"'");if(d(e))throw new Error("please ensure that the plugin for '"+e+"' support is added");if(this.supportsArrayBuffer()&&(S=t,t=this.binaryStringToUint8Array(t)),C=this["process"+e.toUpperCase()](t,c(E),y,s(v),S),!C)throw new Error("An unkwown error occurred whilst processing the image")}}return w.call(this,r,i,o,g,C,C.i,E),this};var y=function(t){var e,n,r;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var i=256*t.charCodeAt(4)+t.charCodeAt(5),o=4,s=t.length;s>o;){if(o+=i,255!==t.charCodeAt(o))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(o+1)||193===t.charCodeAt(o+1)||194===t.charCodeAt(o+1)||195===t.charCodeAt(o+1)||196===t.charCodeAt(o+1)||197===t.charCodeAt(o+1)||198===t.charCodeAt(o+1)||199===t.charCodeAt(o+1))return n=256*t.charCodeAt(o+5)+t.charCodeAt(o+6),e=256*t.charCodeAt(o+7)+t.charCodeAt(o+8),r=t.charCodeAt(o+9),[e,n,r];o+=2,i=256*t.charCodeAt(o)+t.charCodeAt(o+1)}},v=function(t){var e=t[0]<<8|t[1];if(65496!==e)throw new Error("Supplied data is not a JPEG");for(var n,r,i,o,s=t.length,a=(t[4]<<8)+t[5],c=4;s>c;){if(c+=a,n=b(t,c),a=(n[2]<<8)+n[3],(192===n[1]||194===n[1])&&255===n[0]&&a>7)return n=b(t,c+5),r=(n[2]<<8)+n[3],i=(n[0]<<8)+n[1],o=n[4],{width:r,height:i,numcomponents:o};c+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")},b=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,n,r,i){var o,s=this.color_spaces.DEVICE_RGB,a=this.decode.DCT_DECODE,c=8;return this.isString(t)?(o=y(t),this.createImageInfo(t,o[0],o[1],1==o[3]?this.color_spaces.DEVICE_GRAY:s,c,a,e,n)):(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)?(o=v(t),t=i||this.arrayBufferToBinaryString(t),this.createImageInfo(t,o.width,o.height,1==o.numcomponents?this.color_spaces.DEVICE_GRAY:s,c,a,e,n)):null)},t.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(jsPDF.API),function(t){"use strict";var e={annotations:[],f2:function(t){return t.toFixed(2)},notEmpty:function(t){return"undefined"!=typeof t&&""!=t?!0:void 0}};return jsPDF.API.annotationPlugin=e,jsPDF.API.events.push(["addPage",function(t){this.annotationPlugin.annotations[t.pageNumber]=[]}]),t.events.push(["putPage",function(t){for(var n=this.annotationPlugin.annotations[t.pageNumber],r=!1,i=0;i>",l.content=y;var p=l.objId+" 0 R",m=30,f="/Rect ["+s((o.bounds.x+m)*a)+" "+s(c-(o.bounds.y+o.bounds.h)*a)+" "+s((o.bounds.x+o.bounds.w+m)*a)+" "+s((c-o.bounds.y)*a)+"] ";y="<>";else if(o.options.pageNumber){var t=this.internal.getPageInfo(o.options.pageNumber);switch(y="<>",this.internal.write(y))}}this.internal.write("]")}}]),t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight();return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize(),n=this.getStringUnitWidth(t)*e/this.internal.scaleFactor;return n},t.getLineHeight=function(){return this.internal.getLineHeight()},this}(jsPDF.API),function(t){"use strict";t.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this}}(jsPDF.API),function(t){"use strict";return t.events.push(["initialized",function(){this.canvas.pdf=this}]),t.canvas={getContext:function(t){return this.pdf.context2d},style:{}},Object.defineProperty(t.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.getContext("2d").pageWrapX=t+1}}),Object.defineProperty(t.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.getContext("2d").pageWrapY=t+1}}),this}(jsPDF.API),function(t){"use strict";var e,n,r,i,o=3,s=13,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1,u=function(t,e,n,r,i){a={x:t,y:e,w:n,h:r,ln:i}},l=function(){return a},h={left:0,top:0,bottom:0};t.setHeaderFunction=function(t){i=t},t.getTextDimensions=function(t){e=this.internal.getFont().fontName,n=this.table_font_size||this.internal.getFontSize(),r=this.internal.getFont().fontStyle;var i,o,s=19.049976/25.4;o=document.createElement("font"),o.id="jsPDFCell";try{o.style.fontStyle=r}catch(a){o.style.fontWeight=r}o.style.fontName=e,o.style.fontSize=n+"pt";try{o.textContent=t}catch(a){o.innerText=t}return document.body.appendChild(o),i={w:(o.offsetWidth+1)*s,h:(o.offsetHeight+1)*s},document.body.removeChild(o),i},t.cellAddPage=function(){var t=this.margins||h;this.addPage(),u(t.left,t.top,void 0,void 0),c+=1},t.cellInitialize=function(){a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1},t.cell=function(t,e,n,r,i,a,c){var d=l();if(void 0!==d.ln)if(d.ln===a)t=d.x+d.w,e=d.y;else{var f=this.margins||h;d.y+d.h+r+s>=this.internal.pageSize.height-f.bottom&&(this.cellAddPage(),this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(a,!0)),e=l().y+l().h}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===c){i instanceof Array||(i=[i]);for(var p=0;pn;n+=1)i=t[n],e?-1===e(o,i)&&(o=i):i>o&&(o=i);return o},t.table=function(e,n,r,i,o){if(!r)throw"No data for PDF table";var s,u,l,d,f,p,m,g,w,y,v=[],b=[],x={},k={},C=[],E=[],S=!1,T=!0,_=12,q=h;if(q.width=this.internal.pageSize.width,o&&(o.autoSize===!0&&(S=!0),o.printHeaders===!1&&(T=!1),o.fontSize&&(_=o.fontSize),o.margins&&(q=o.margins)),this.lnMod=0,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},c=1,this.printHeaders=T,this.margins=q,this.setFontSize(_),this.table_font_size=_,void 0===i||null===i)v=Object.keys(r[0]);else if(i[0]&&"string"!=typeof i[0]){var I=19.049976/25.4;for(u=0,l=i.length;l>u;u+=1)s=i[u],v.push(s.name),b.push(s.prompt),k[s.name]=s.width*I}else v=i;if(S)for(y=function(t){return t[s]},u=0,l=v.length;l>u;u+=1){for(s=v[u],x[s]=r.map(y),C.push(this.getTextDimensions(b[u]||s).w),p=x[s],m=0,d=p.length;d>m;m+=1)f=p[m],C.push(this.getTextDimensions(f).w);k[s]=t.arrayMax(C),C=[]}if(T){var P=this.calculateLineHeight(v,k,b.length?b:v);for(u=0,l=v.length;l>u;u+=1)s=v[u],E.push([e,n,k[s],P,String(b.length?b[u]:s)]);this.setTableHeaderRow(E),this.printHeaderRow(1,!1)}for(u=0,l=r.length;l>u;u+=1){var P;for(g=r[u],P=this.calculateLineHeight(v,k,g),m=0,w=v.length;w>m;m+=1)s=v[m],this.cell(e,n,k[s],P,g[s],u+2,s.align)}return this.lastCellPos=a,this.table_x=e,this.table_y=n,this},t.calculateLineHeight=function(t,e,n){for(var r,i=0,s=0;si&&(i=a)}return i},t.setTableHeaderRow=function(t){this.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,o,s;if(this.printingHeaderRow=!0,void 0!==i){var a=i(this,c);u(a[0],a[1],a[2],a[3],-1)}this.setFontStyle("bold");var l=[];for(o=0,s=this.tableHeaderRow.length;s>o;o+=1)this.setFillColor(200,200,200),n=this.tableHeaderRow[o],e&&(n[1]=this.margins&&this.margins.top||0,l.push(n)),r=[].concat(n),this.cell.apply(this,r.concat(t));l.length>0&&this.setTableHeaderRow(l),this.setFontStyle("normal"),this.printingHeaderRow=!1}}(jsPDF.API),function(t){"use strict";function e(){this.fillStyle="#000000",this.strokeStyle="#000000",this.font="12pt times",this.textBaseline="alphabetic",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this._translate={x:0,y:0},this.copy=function(t){this.fillStyle=t.fillStyle,this.strokeStyle=t.strokeStyle,this.font=t.font,this.lineWidth=t.lineWidth,this.lineJoin=t.lineJoin,this.lineCap=t.lineCap,this.textBaseline=t.textBaseline,this._fontSize=t._fontSize,this._translate={x:t._translate.x,y:t._translate.y}}}t.events.push(["initialized",function(){this.context2d.pdf=this,this.context2d.internal.pdf=this,this.context2d.ctx=new e,this.context2d.ctxStack=[],this.context2d.path=[]}]),t.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!0,pageWrapX:9999999,pageWrapY:9999999,f2:function(t){return t.toFixed(2)},fillRect:function(t,e,n,r){t=this._wrapX(t),e=this._wrapY(e),this.pdf.rect(t,e,n,r,"f")},strokeRect:function(t,e,n,r){t=this._wrapX(t),e=this._wrapY(e),this.pdf.rect(t,e,n,r,"s")},clearRect:function(t,e,n,r){t=this._wrapX(t),e=this._wrapY(e),this.save(),this.setFillStyle("#ffffff"),this.pdf.rect(t,e,n,r,"f"),this.restore()},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var t=new e;t.copy(this.ctx),this.ctxStack.push(this.ctx),this.ctx=t},restore:function(){this.ctx=this.ctxStack.pop(),this.setFillStyle(this.ctx.fillStyle),this.setStrokeStyle(this.ctx.strokeStyle),this.setFont(this.ctx.font),this.pdf.setFontSize(this.ctx._fontSize),this.setLineCap(this.ctx.lineCap),this.setLineWidth(this.ctx.lineWidth),this.setLineJoin(this.ctx.lineJoin)},beginPath:function(){this.path=[]},closePath:function(){this.path.push({type:"close"})},setFillStyle:function(t){var e,n,r,i,o=this.internal.rxRgb.exec(t);null!=o?(e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3])):(o=this.internal.rxRgba.exec(t),null!=o?(e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseInt(o[4])):("#"!=t.charAt(0)&&(t=CssColors.colorNameToHex(t),t||(t="#000000")),this.ctx.fillStyle=t,4===t.length?(e=this.ctx.fillStyle.substring(1,2),e+=e,n=this.ctx.fillStyle.substring(2,3),n+=n,r=this.ctx.fillStyle.substring(3,4),r+=r):(e=this.ctx.fillStyle.substring(1,3),n=this.ctx.fillStyle.substring(3,5),r=this.ctx.fillStyle.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16))),this.pdf.setFillColor(e,n,r,{a:i}),this.pdf.setTextColor(e,n,r,{a:i})},setStrokeStyle:function(t){"#"!=t.charAt(0)&&(t=CssColors.colorNameToHex(t),t||(t="#000000")),this.ctx.strokeStyle=t;var e=this.ctx.strokeStyle.substring(1,3);e=parseInt(e,16);var n=this.ctx.strokeStyle.substring(3,5);n=parseInt(n,16);var r=this.ctx.strokeStyle.substring(5,7);r=parseInt(r,16),this.pdf.setDrawColor(e,n,r)},fillText:function(t,e,n,r){e=this._wrapX(e),n=this._wrapY(n),this.pdf.text(t,e,this._getBaseline(n))},strokeText:function(t,e,n,r){e=this._wrapX(e),n=this._wrapY(n),this.pdf.text(t,e,this._getBaseline(n),{stroke:!0})},setFont:function(t){this.ctx.font=t;var e=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+["']?(\w+)['"]?/;if(c=e.exec(t),null!=c){var n=c[1],r=(c[2],c[3]),i=c[4],o=c[5],s=c[6];i=Math.floor("px"===o?parseFloat(i):"em"===o?parseFloat(i)*this.pdf.getFontSize():parseFloat(i)),this.pdf.setFontSize(i),this.pdf.setFontStyle("bold"===r||"700"===r?"bold":"italic"===n?"italic":"normal");var a=s;this.pdf.setFont(a,l)}else{var e=/(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/,c=e.exec(t);if(null!=c){var u=c[1],a=(c[2],c[3]),l=c[4];l||(l="normal"),u=Math.floor("em"===o?parseFloat(i)*this.pdf.getFontSize():parseFloat(u)),this.pdf.setFontSize(u),this.pdf.setFont(a,l)}}},setTextBaseline:function(t){this.ctx.textBaseline=t},getTextBaseline:function(){return this.ctx.textBaseline},setLineWidth:function(t){this.ctx.lineWidth=t,this.pdf.setLineWidth(t)},setLineCap:function(t){this.ctx.lineCap=t,this.pdf.setLineCap(t)},setLineJoin:function(t){this.ctx.lineJon=t,this.pdf.setLineJoin(t)},moveTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n={type:"mt",x:t,y:e};this.path.push(n)},_wrapX:function(t){return this.pageWrapXEnabled?t%this.pageWrapX:t},_wrapY:function(t){return this.pageWrapYEnabled?(this._gotoPage(this._page(t)),(t-this.lastBreak)%this.pageWrapY):t},lastBreak:0,pageBreaks:[],_page:function(t){if(this.pageWrapYEnabled){this.lastBreak=0;for(var e=0,n=0,r=0;r=this.pageBreaks[r]){e++,0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r];var o=Math.floor(i/this.pageWrapY);n+=o}if(0===this.lastBreak){var o=Math.floor(t/this.pageWrapY)+1;n+=o}return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n={type:"lt",x:t,y:e};this.path.push(n)},bezierCurveTo:function(t,e,n,r,i,o){t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),i=this._wrapX(i),o=this._wrapY(o);var s={type:"bct",x1:t,y1:e,x2:n,y2:r,x:i,y:o};this.path.push(s)},quadraticCurveTo:function(t,e,n,r){t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r);var i={type:"qct",x1:t,y1:e,x:n,y:r};this.path.push(i)},arc:function(t,e,n,r,i,o){t=this._wrapX(t),e=this._wrapY(e);var s={type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(s)},drawImage:function(t,e,n,r,i,o,s,a,c){void 0!==o&&(e=o,n=s,r=a,i=c),e=this._wrapX(e),n=this._wrapY(n);var u,l=/data:image\/(\w+).*/i,h=l.exec(t);u=null!=h?h[1]:"png",this.pdf.addImage(t,u,e,n,r,i)},stroke:function(){for(var t,e=[],n=!1,r=0;rs||s>o)&&(s%=o);var a=n;(o>a||a>o)&&(a%=o);for(var c=[],u=Math.PI/2,l=r?-1:1,h=e,d=Math.min(o,Math.abs(a-s));d>i;){var f=h+l*Math.min(d,u);c.push(this.createSmallArc(t,h,f)),d-=Math.abs(f-h),h=f}return c},n.internal.createSmallArc=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),s=i,a=-o,c=s*s+a*a,u=c+s*i+a*o,l=4/3*(Math.sqrt(2*c*u)-u)/(s*o-a*i),h=s-l*a,d=a+l*s,f=h,p=-d,m=r+e,g=Math.cos(m),w=Math.sin(m);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:h*g-d*w,y2:h*w+d*g,x3:f*g-p*w,y3:f*w+p*g,x4:t*Math.cos(n),y4:t*Math.sin(n)}},this}(jsPDF.API),function(t){var e,n,r,i,o,s,a,c,u,l,h,d,f,p,m,g,w,y,v;e=function(){function t(){}return function(e){return t.prototype=e,new t}}(),u=function(t){var e,n,r,i,o,s,a;for(n=0,r=t.length,e=void 0,i=!1,s=!1;!i&&n!==r;)e=t[n]=t[n].trimLeft(),e&&(i=!0),n++;for(n=r-1;r&&!s&&-1!==n;)e=t[n]=t[n].trimRight(),e&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},l=function(t,e,n,r){return this.pdf=t,this.x=e,this.y=n,this.settings=r,this.watchFunctions=[],this.init(),this},h=function(t){var e,n,i;for(e=void 0,i=t.split(","),n=i.shift();!e&&n;)e=r[n.trim().toLowerCase()],n=i.shift();return e},d=function(t){t="auto"===t?"0px":t,t.indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px");var e,n,r;return n=void 0,e=16,(r=f[t])?r:(r={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:t}],r!==n?f[t]=r/e:(r=parseFloat(t))?f[t]=r/e:(r=t.match(/([\d\.]+)(px)/),3===r.length?f[t]=parseFloat(r[1])/e:f[t]=1))},c=function(t){var e,n,r;return r=function(t){var e;return e=function(t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null):t.currentStyle?t.currentStyle:t.style}(t),function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),e[t]}}(t),e={},n=void 0,e["font-family"]=h(r("font-family"))||"times",e["font-style"]=i[r("font-style")]||"normal",e["text-align"]=TextAlignMap[r("text-align")]||"left",n=o[r("font-weight")]||"normal","bold"===n&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(r("font-size"))||1,e["line-height"]=d(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(r("margin-top"))||0,e["margin-bottom"]=n&&d(r("margin-bottom"))||0,e["padding-top"]=n&&d(r("padding-top"))||0,e["padding-bottom"]=n&&d(r("padding-bottom"))||0,e["margin-left"]=n&&d(r("margin-left"))||0,e["margin-right"]=n&&d(r("margin-right"))||0,e["padding-left"]=n&&d(r("padding-left"))||0,e["padding-right"]=n&&d(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e["float"]=s[r("cssFloat")]||"none",e.clear=a[r("clear")]||"none",e.color=r("color"),e},p=function(t,e,n){var r,i,o,s,a;if(o=!1,i=void 0,s=void 0,a=void 0,r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0,s=r.length;!o&&i!==s;)o=r[i](t,e),i++;if(r=n[t.nodeName],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,s=r.length;!o&&i!==s;)o=r[i](t,e),i++;return o},v=function(t,e){var n,r,i,o,s,a,c,u,l,h;for(n=[],r=[],i=0,h=t.rows[0].cells.length,u=t.clientWidth;h>i;)l=t.rows[0].cells[i],r[i]={name:l.textContent.toLowerCase().replace(/\s+/g,""),prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/u*e.pdf.internal.pageSize.width},i++;for(i=1;iu;){if(o=s[u],"object"==typeof o){if(r.executeWatchFunctions(o),1===o.nodeType&&"HEADER"===o.nodeName){var w=o,y=r.pdf.margins_doc.top;r.pdf.internal.events.subscribe("addPage",function(t){r.y=y,n(w,r,i),r.pdf.margins_doc.top=r.y+10,r.y+=10},!1)}if(8===o.nodeType&&"#comment"===o.nodeName)~o.textContent.indexOf("ADD_PAGE")&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top);else if(1!==o.nodeType||b[o.nodeName])if(3===o.nodeType){var k=o.nodeValue;if(o.nodeValue&&"LI"===o.parentNode.nodeName)if("OL"===o.parentNode.parentNode.nodeName)k=x++ +". "+k;else{var C=a["font-size"];offsetX=(3-.75*C)*r.pdf.internal.scaleFactor,offsetY=.75*C*r.pdf.internal.scaleFactor,radius=1.74*C/r.pdf.internal.scaleFactor,g=function(t,e){this.pdf.circle(t+offsetX,e+offsetY,radius,"FD")}}o.ownerDocument.body.contains(o)&&r.addText(k,a)}else"string"==typeof o&&r.addText(o,a);else{var E;if("IMG"===o.nodeName){var S=o.getAttribute("src");E=m[r.pdf.sHashCode(S)||S]}if(E){r.pdf.internal.pageSize.height-r.pdf.margins_doc.bottomr.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(o));var T=c(o),_=r.x,q=12/r.pdf.internal.scaleFactor,I=(T["margin-left"]+T["padding-left"])*q,P=(T["margin-right"]+T["padding-right"])*q,A=(T["margin-top"]+T["padding-top"])*q,O=(T["margin-bottom"]+T["padding-bottom"])*q;_+=void 0!==T["float"]&&"right"===T["float"]?r.settings.width-o.width-P:I,r.pdf.addImage(E,_,r.y+A,o.width,o.height),E=void 0,"right"===T["float"]||"left"===T["float"]?(r.watchFunctions.push(function(t,e,n,i){return r.y>=e?(r.x+=t,r.settings.width+=n,!0):i&&1===i.nodeType&&!b[i.nodeName]&&r.x+i.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width?(r.x+=t,r.y=e,r.settings.width+=n,!0):!1}.bind(this,"left"===T["float"]?-o.width-I-P:0,r.y+o.height+A+O,o.width)),r.watchFunctions.push(function(t,e,n){return r.y0){i=i[0];var o=e.pdf.internal.write,s=e.y;e.pdf.internal.write=function(){},n(i,e,r);var a=Math.ceil(e.y-s)+5;e.y=s,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=a;for(var c=function(t){var o=void 0!==t?t.pageNumber:1,s=e.y;e.y=e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=a;for(var c=i.getElementsByTagName("span"),u=0;u-1&&(c[u].innerHTML=o),(" "+c[u].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(c[u].innerHTML="###jsPDFVarTotalPages###");n(i,e,r),e.pdf.margins_doc.bottom+=a,e.y=s},u=i.getElementsByTagName("span"),l=0;l-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),b.FOOTER=1}},y=function(t,e,r,i,o,s){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,r,i;return r="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),i="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n=document.createElement("div"),n.style.cssText=i,n.innerHTML='