jspdf
Version:
PDF Document creation from JavaScript
67 lines (66 loc) • 375 kB
JavaScript
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.0.0 Built on 2020-08-11T07:57:54.900Z
* CommitID 00000000
*
* Copyright (c) 2010-2020 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2020 yWorks GmbH, http://www.yworks.com
* 2015-2020 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, willow-systems.com
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
* 2014 Steven Spungin, https://github.com/Flamenco
* 2014 Kenneth Glassey, https://github.com/Gavvers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth, Flamenco
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).jspdf={})}(this,(function(t){"use strict";var e=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}();function n(){e.console&&"function"==typeof e.console.log&&e.console.log.apply(e.console,arguments)}var r={log:n,warn:function(t){e.console&&("function"==typeof e.console.warn?e.console.warn.apply(e.console,arguments):n.call(null,arguments))},error:function(t){e.console&&("function"==typeof e.console.error?e.console.error.apply(e.console,arguments):n(t))}};
/**
* @license
* FileSaver.js
* A saveAs() FileSaver implementation.
*
* By Eli Grey, http://eligrey.com
*
* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
* source : http://purl.eligrey.com/github/FileSaver.js
*/function i(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){c(i.response,e,n)},i.onerror=function(){r.error("could not download file")},i.send()}function a(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var s,u,c=e.saveAs||("object"!=typeof window||window!==e?function(){}:"download"in HTMLAnchorElement.prototype?function(t,n,r){var s=e.URL||e.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener","string"==typeof t?(u.href=t,u.origin!==location.origin?a(u.href)?i(t,n,r):o(u,u.target="_blank"):o(u)):(u.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(u.href)}),4e4),setTimeout((function(){o(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(a(t))i(t,e,n);else{var s=document.createElement("a");s.href=t,s.target="_blank",setTimeout((function(){o(s)}))}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(r.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,n,r,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof t)return i(t,n,r);var o="application/octet-stream"===t.type,s=/constructor/i.test(e.HTMLElement)||e.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||o&&s)&&"object"==typeof FileReader){var c=new FileReader;c.onloadend=function(){var t=c.result;t=u?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=t:location=t,a=null},c.readAsDataURL(t)}else{var h=e.URL||e.webkitURL,l=h.createObjectURL(t);a?a.location=l:location.href=l,a=null,setTimeout((function(){h.revokeObjectURL(l)}),4e4)}});
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/function h(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6));t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}}function l(t){if("object"!=typeof t)throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var n={};this.subscribe=function(t,e,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof e||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");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===Object.keys(n[e]).length&&delete n[e],!0;return!1},this.publish=function(i){if(n.hasOwnProperty(i)){var a=Array.prototype.slice.call(arguments,1),o=[];for(var s in n[i]){var u=n[i][s];try{u[0].apply(t,a)}catch(t){e.console&&r.error("jsPDF PubSub Error",t.message,t)}u[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return n}}function f(t){if(!(this instanceof f))return new f(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function d(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function p(t,e,n,r,i){if(!(this instanceof p))return new p(t,e,n,r,i);this.type="axial"===t?2:3,this.coords=e,this.colors=n,d.call(this,r,i)}function g(t,e,n,r,i){if(!(this instanceof g))return new g(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,d.call(this,r,i)}function m(t){var n,i="string"==typeof arguments[0]?arguments[0]:"p",a=arguments[1],o=arguments[2],s=arguments[3],d=[],v=1,b=16,y="S";"object"==typeof(t=t||{})&&(i=t.orientation,a=t.unit||a,o=t.format||o,s=t.compress||t.compressPdf||s,v="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(n=t.precision),void 0!==t.floatPrecision&&(b=t.floatPrecision),y=t.defaultPathOperation||"S"),d=t.filters||(!0===s?["FlateEncode"]:d),a=a||"mm",i=(""+(i||"P")).toLowerCase();var w=t.putOnlyUsedFonts||!1,N={},A={internal:{},__private__:{}};A.__private__.PubSub=l;var x="1.3",L=A.__private__.getPdfVersion=function(){return x};A.__private__.setPdfVersion=function(t){x=t};var _={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]};A.__private__.getPageFormats=function(){return _};var S=A.__private__.getPageFormat=function(t){return _[t]};o=o||"a4";var P={COMPAT:"compat",ADVANCED:"advanced"},k=P.COMPAT;function F(){this.saveGraphicsState(),ot(new Dt(Nt,0,0,-Nt,0,Cn()*Nt).toString()+" cm"),this.setFontSize(this.getFontSize()/Nt),y="n",k=P.ADVANCED}function I(){this.restoreGraphicsState(),y="S",k=P.COMPAT}A.advancedAPI=function(t){var e=k===P.COMPAT;return e&&F.call(this),"function"!=typeof t||(t(this),e&&I.call(this)),this},A.compatAPI=function(t){var e=k===P.ADVANCED;return e&&I.call(this),"function"!=typeof t||(t(this),e&&F.call(this)),this},A.isAdvancedAPI=function(){return k===P.ADVANCED};var C,j=function(t){if(k!==P.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},B=A.roundToPrecision=A.__private__.roundToPrecision=function(t,e){var r=n||e;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};C=A.hpf=A.__private__.hpf="number"==typeof b?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return B(t,b)}:"smart"===b?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return B(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return B(t,16)};var O=A.f2=A.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return B(t,2)},M=A.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return B(t,3)},E=A.scale=A.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return k===P.COMPAT?t*Nt:k===P.ADVANCED?t:void 0},q=function(t){return k===P.COMPAT?Cn()-t:k===P.ADVANCED?t:void 0},R=function(t){return E(q(t))};A.__private__.setPrecision=A.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(n=parseInt(t,10))};var T,D="00000000000000000000000000000000",U=A.__private__.getFileId=function(){return D},z=A.__private__.setFileId=function(t){return D=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():D.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join("")};A.setFileId=function(t){return z(t),this},A.getFileId=function(){return U()};var H=A.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[n,J(r),"'",J(i),"'"].join("");return["D:",t.getFullYear(),J(t.getMonth()+1),J(t.getDate()),J(t.getHours()),J(t.getMinutes()),J(t.getSeconds()),a].join("")},W=A.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(e,n,r,i,a,o,0)},V=A.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=H(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return T=e},G=A.__private__.getCreationDate=function(t){var e=T;return"jsDate"===t&&(e=W(T)),e};A.setCreationDate=function(t){return V(t),this},A.getCreationDate=function(t){return G(t)};var Y,J=A.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},X=A.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},K=0,Z=[],$=[],Q=0,tt=[],et=[],nt=!1,rt=$,it=function(){K=0,Q=0,$=[],Z=[],tt=[],Jt=Vt(),Xt=Vt()};A.__private__.setCustomOutputDestination=function(t){nt=!0,rt=t};var at=function(t){nt||(rt=t)};A.__private__.resetCustomOutputDestination=function(){nt=!1,rt=$};var ot=A.__private__.out=function(t){return t=t.toString(),Q+=t.length+1,rt.push(t),rt},st=A.__private__.write=function(t){return ot(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},ut=A.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},ct=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];A.__private__.getStandardFonts=function(){return ct};var ht=t.fontSize||16;A.__private__.setFontSize=A.setFontSize=function(t){return ht=k===P.ADVANCED?t/Nt:t,this};var lt,ft=A.__private__.getFontSize=A.getFontSize=function(){return k===P.COMPAT?ht:ht*Nt},dt=t.R2L||!1;A.__private__.setR2L=A.setR2L=function(t){return dt=t,this},A.__private__.getR2L=A.getR2L=function(){return dt};var pt,gt=A.__private__.setZoomMode=function(t){var e=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*%$/.test(t))lt=t;else if(isNaN(t)){if(-1===e.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');lt=t}else lt=parseInt(t,10)};A.__private__.getZoomMode=function(){return lt};var mt,vt=A.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');pt=t};A.__private__.getPageMode=function(){return pt};var bt=A.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');mt=t};A.__private__.getLayoutMode=function(){return mt},A.__private__.setDisplayMode=A.setDisplayMode=function(t,e,n){return gt(t),bt(e),vt(n),this};var yt={title:"",subject:"",author:"",keywords:"",creator:""};A.__private__.getDocumentProperty=function(t){if(-1===Object.keys(yt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return yt[t]},A.__private__.getDocumentProperties=function(){return yt},A.__private__.setDocumentProperties=A.setProperties=A.setDocumentProperties=function(t){for(var e in yt)yt.hasOwnProperty(e)&&t[e]&&(yt[e]=t[e]);return this},A.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(yt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return yt[t]=e};var wt,Nt,At,xt,Lt,_t={},St={},Pt=[],kt={},Ft={},It={},Ct={},jt=null,Bt=0,Ot=[],Mt=new l(A),Et=t.hotfixes||[],qt={},Rt={},Tt=[],Dt=function(t,e,n,r,i,a){if(!(this instanceof Dt))return new Dt(t,e,n,r,i,a);isNaN(t)&&(t=1),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(r)&&(r=1),isNaN(i)&&(i=0),isNaN(a)&&(a=0),this._matrix=[t,e,n,r,i,a]};Object.defineProperty(Dt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Dt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Dt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Dt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Dt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Dt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Dt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Dt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Dt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Dt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Dt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Dt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Dt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Dt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Dt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Dt.prototype,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Dt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(C).join(t)},Dt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,a=t.tx*this.sx+t.ty*this.shx+this.tx,o=t.tx*this.shy+t.ty*this.sy+this.ty;return new Dt(e,n,r,i,a,o)},Dt.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*n+(e/=o)*r;n-=t*s,r-=e*s;var u=Math.sqrt(n*n+r*r);return s/=u,t*(r/=u)<e*(n/=u)&&(t=-t,e=-e,s=-s,o=-o),{scale:new Dt(o,0,0,u,0,0),translate:new Dt(1,0,0,1,i,a),rotate:new Dt(t,e,-e,t,0,0),skew:new Dt(1,0,s,1,0,0)}},Dt.prototype.toString=function(t){return this.join(" ")},Dt.prototype.inversed=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,o=1/(t*r-e*n),s=r*o,u=-e*o,c=-n*o,h=t*o;return new Dt(s,u,c,h,-s*i-c*a,-u*i-h*a)},Dt.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new xn(e,n)},Dt.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new xn(t.x+t.w,t.y+t.h));return new Ln(e.x,e.y,n.x-e.x,n.y-e.y)},Dt.prototype.clone=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty;return new Dt(t,e,n,r,i,a)},A.Matrix=Dt;var Ut=A.matrixMult=function(t,e){return e.multiply(t)},zt=new Dt(1,0,0,1,0,0);A.unitMatrix=A.identityMatrix=zt;var Ht=function(t,e){if(!Ft[t]){var n=(e instanceof p?"Sh":"P")+(Object.keys(kt).length+1).toString(10);e.id=n,Ft[t]=n,kt[n]=e,Mt.publish("addPattern",e)}};A.ShadingPattern=p,A.TilingPattern=g,A.addShadingPattern=function(t,e){return j("addShadingPattern()"),Ht(t,e),this},A.beginTilingPattern=function(t){j("beginTilingPattern()"),Sn(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},A.endTilingPattern=function(t,e){j("endTilingPattern()"),e.stream=et[Y].join("\n"),Ht(t,e),Mt.publish("endTilingPattern",e),Tt.pop().restore()};var Wt=A.__private__.newObject=function(){var t=Vt();return Gt(t,!0),t},Vt=A.__private__.newObjectDeferred=function(){return K++,Z[K]=function(){return Q},K},Gt=function(t,e){return e="boolean"==typeof e&&e,Z[t]=Q,e&&ot(t+" 0 obj"),t},Yt=A.__private__.newAdditionalObject=function(){var t={objId:Vt(),content:""};return tt.push(t),t},Jt=Vt(),Xt=Vt(),Kt=A.__private__.decodeColorString=function(t){var e=t.split(" ");if(2!==e.length||"g"!==e[1]&&"G"!==e[1]){if(5===e.length&&("k"===e[4]||"K"===e[4])){e=[(1-e[0])*(1-e[3]),(1-e[1])*(1-e[3]),(1-e[2])*(1-e[3]),"r"]}}else{var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},Zt=A.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var n=t.ch1,r=t.ch2,i=t.ch3,a=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var s=new h(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var u=parseInt(n.substr(1),16);n=u>>16&255,r=u>>8&255,i=255&u}if(void 0===r||void 0===a&&n===r&&r===i)if("string"==typeof n)e=n+" "+o[0];else switch(t.precision){case 2:e=O(n/255)+" "+o[0];break;case 3:default:e=M(n/255)+" "+o[0]}else if(void 0===a||"object"==typeof a){if(a&&!isNaN(a.a)&&0===a.a)return e=["1.","1.","1.",o[1]].join(" ");if("string"==typeof n)e=[n,r,i,o[1]].join(" ");else switch(t.precision){case 2:e=[O(n/255),O(r/255),O(i/255),o[1]].join(" ");break;default:case 3:e=[M(n/255),M(r/255),M(i/255),o[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,a,o[2]].join(" ");else switch(t.precision){case 2:e=[O(n),O(r),O(i),O(a),o[2]].join(" ");break;case 3:default:e=[M(n),M(r),M(i),M(a),o[2]].join(" ")}return e},$t=A.__private__.getFilters=function(){return d},Qt=A.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||$t(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],u=(o=void 0!==m.API.processDataByFilters?m.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==o.data.length&&(s.push({key:"Length",value:o.data.length}),!0===i&&s.push({key:"Length1",value:a})),0!=u.length)if(u.split("/").length-1==1)s.push({key:"Filter",value:u});else{s.push({key:"Filter",value:"["+u+"]"});for(var c=0;c<s.length;c+=1)if("DecodeParms"===s[c].key){for(var h=[],l=0;l<o.reverseChain.split("/").length-1;l+=1)h.push("null");h.push(s[c].value),s[c].value="["+h.join(" ")+"]"}}ot("<<");for(var f=0;f<s.length;f++)ot("/"+s[f].key+" "+s[f].value);ot(">>"),0!==o.data.length&&(ot("stream"),ot(o.data),ot("endstream"))},te=A.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;Gt(r,!0),ot("<</Type /Page"),ot("/Parent "+t.rootDictionaryObjId+" 0 R"),ot("/Resources "+t.resourceDictionaryObjId+" 0 R"),ot("/MediaBox ["+parseFloat(C(t.mediaBox.bottomLeftX))+" "+parseFloat(C(t.mediaBox.bottomLeftY))+" "+C(t.mediaBox.topRightX)+" "+C(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&ot("/CropBox ["+C(t.cropBox.bottomLeftX)+" "+C(t.cropBox.bottomLeftY)+" "+C(t.cropBox.topRightX)+" "+C(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&ot("/BleedBox ["+C(t.bleedBox.bottomLeftX)+" "+C(t.bleedBox.bottomLeftY)+" "+C(t.bleedBox.topRightX)+" "+C(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&ot("/TrimBox ["+C(t.trimBox.bottomLeftX)+" "+C(t.trimBox.bottomLeftY)+" "+C(t.trimBox.topRightX)+" "+C(t.trimBox.topRightY)+"]"),null!==t.artBox&&ot("/ArtBox ["+C(t.artBox.bottomLeftX)+" "+C(t.artBox.bottomLeftY)+" "+C(t.artBox.topRightX)+" "+C(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&ot("/UserUnit "+t.userUnit),Mt.publish("putPage",{objId:r,pageContext:Ot[e],pageNumber:e,page:n}),ot("/Contents "+i+" 0 R"),ot(">>"),ot("endobj");var a=n.join("\n");return k===P.ADVANCED&&(a+="\nQ"),Gt(i,!0),Qt({data:a,filters:$t()}),ot("endobj"),r},ee=A.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=Bt;t++)Ot[t].objId=Vt(),Ot[t].contentsObjId=Vt();for(t=1;t<=Bt;t++)n.push(te({number:t,data:et[t],objId:Ot[t].objId,contentsObjId:Ot[t].contentsObjId,mediaBox:Ot[t].mediaBox,cropBox:Ot[t].cropBox,bleedBox:Ot[t].bleedBox,trimBox:Ot[t].trimBox,artBox:Ot[t].artBox,userUnit:Ot[t].userUnit,rootDictionaryObjId:Jt,resourceDictionaryObjId:Xt}));Gt(Jt,!0),ot("<</Type /Pages");var r="/Kids [";for(e=0;e<Bt;e++)r+=n[e]+" 0 R ";ot(r+"]"),ot("/Count "+Bt),ot(">>"),ot("endobj"),Mt.publish("postPutPages")},ne=function(t){var e=function(t,e){return-1!==t.indexOf(" ")?"("+_e(t,e)+")":_e(t,e)};Mt.publish("putFont",{font:t,out:ot,newObject:Wt,putStream:Qt,pdfEscapeWithNeededParanthesis:e}),!0!==t.isAlreadyPutted&&(t.objectNumber=Wt(),ot("<<"),ot("/Type /Font"),ot("/BaseFont /"+e(t.postScriptName)),ot("/Subtype /Type1"),"string"==typeof t.encoding&&ot("/Encoding /"+t.encoding),ot("/FirstChar 32"),ot("/LastChar 255"),ot(">>"),ot("endobj"))},re=function(){for(var t in _t)_t.hasOwnProperty(t)&&(!1===w||!0===w&&N.hasOwnProperty(t))&&ne(_t[t])},ie=function(t){t.objectNumber=Wt();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[C(t.x),C(t.y),C(t.x+t.width),C(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");Qt({data:n,additionalKeyValues:e}),ot("endobj")},ae=function(){for(var t in qt)qt.hasOwnProperty(t)&&ie(qt[t])},oe=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var o={offset:1,color:t[t.length-1].color};t.push(o)}for(var s="",u=0,c=0;c<r.length;c++){for(n=r[c];n>t[u+1].offset;)u++;var h=t[u].offset,l=(n-h)/(t[u+1].offset-h),f=t[u].color,d=t[u+1].color;s+=X(Math.round((1-l)*f[0]+l*d[0]).toString(16))+X(Math.round((1-l)*f[1]+l*d[1]).toString(16))+X(Math.round((1-l)*f[2]+l*d[2]).toString(16))}return s.trim()},se=function(t,e){e||(e=21);var n=Wt(),r=oe(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Qt({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"]}),ot("endobj"),t.objectNumber=Wt(),ot("<< /ShadingType "+t.type),ot("/ColorSpace /DeviceRGB");var a="/Coords ["+C(parseFloat(t.coords[0]))+" "+C(parseFloat(t.coords[1]))+" ";2===t.type?a+=C(parseFloat(t.coords[2]))+" "+C(parseFloat(t.coords[3])):a+=C(parseFloat(t.coords[2]))+" "+C(parseFloat(t.coords[3]))+" "+C(parseFloat(t.coords[4]))+" "+C(parseFloat(t.coords[5])),ot(a+="]"),t.matrix&&ot("/Matrix ["+t.matrix.toString()+"]"),ot("/Function "+n+" 0 R"),ot("/Extend [true true]"),ot(">>"),ot("endobj")},ue=function(t,e){var n=Vt(),r=Wt();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(C).join(" ")+"]"}),i.push({key:"XStep",value:C(t.xStep)}),i.push({key:"YStep",value:C(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),Qt({data:t.stream,additionalKeyValues:i}),ot("endobj")},ce=function(t){var e;for(e in kt)kt.hasOwnProperty(e)&&(kt[e]instanceof p?se(kt[e]):kt[e]instanceof g&&ue(kt[e],t))},he=function(t){for(var e in t.objectNumber=Wt(),ot("<<"),t)switch(e){case"opacity":ot("/ca "+O(t[e]));break;case"stroke-opacity":ot("/CA "+O(t[e]))}ot(">>"),ot("endobj")},le=function(){var t;for(t in It)It.hasOwnProperty(t)&&he(It[t])},fe=function(){for(var t in ot("/XObject <<"),qt)qt.hasOwnProperty(t)&&qt[t].objectNumber>=0&&ot("/"+t+" "+qt[t].objectNumber+" 0 R");Mt.publish("putXobjectDict"),ot(">>")},de=function(){for(var t in ot("/Font <<"),_t)_t.hasOwnProperty(t)&&(!1===w||!0===w&&N.hasOwnProperty(t))&&ot("/"+t+" "+_t[t].objectNumber+" 0 R");ot(">>")},pe=function(){if(Object.keys(kt).length>0){for(var t in ot("/Shading <<"),kt)kt.hasOwnProperty(t)&&kt[t]instanceof p&&kt[t].objectNumber>=0&&ot("/"+t+" "+kt[t].objectNumber+" 0 R");Mt.publish("putShadingPatternDict"),ot(">>")}},ge=function(t){if(Object.keys(kt).length>0){for(var e in ot("/Pattern <<"),kt)kt.hasOwnProperty(e)&&kt[e]instanceof A.TilingPattern&&kt[e].objectNumber>=0&&kt[e].objectNumber<t&&ot("/"+e+" "+kt[e].objectNumber+" 0 R");Mt.publish("putTilingPatternDict"),ot(">>")}},me=function(){if(Object.keys(It).length>0){var t;for(t in ot("/ExtGState <<"),It)It.hasOwnProperty(t)&&It[t].objectNumber>=0&&ot("/"+t+" "+It[t].objectNumber+" 0 R");Mt.publish("putGStateDict"),ot(">>")}},ve=function(t){Gt(t.resourcesOid,!0),ot("<<"),ot("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),de(),pe(),ge(t.objectOid),me(),fe(),ot(">>"),ot("endobj")},be=function(){var t=[];re(),le(),ae(),ce(t),Mt.publish("putResources"),t.forEach(ve),ve({resourcesOid:Xt,objectOid:Number.MAX_SAFE_INTEGER}),Mt.publish("postPutResources")},ye=function(){Mt.publish("putAdditionalObjects");for(var t=0;t<tt.length;t++){var e=tt[t];Gt(e.objId,!0),ot(e.content),ot("endobj")}Mt.publish("postPutAdditionalObjects")},we=function(t){St[t.fontName]=St[t.fontName]||{},St[t.fontName][t.fontStyle]=t.id},Ne=function(t,e,n,r,i){var a={id:"F"+(Object.keys(_t).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Mt.publish("addFont",{font:a,instance:this}),_t[a.id]=a,we(a),a.id},Ae=function(t){for(var e=0,n=ct.length;e<n;e++){var r=Ne.call(this,t[e][0],t[e][1],t[e][2],ct[e][3],!0);!1===w&&(N[r]=!0);var i=t[e][0].split("-");we({id:r,fontName:i[0],fontStyle:i[1]||""})}Mt.publish("addFonts",{fonts:_t,dictionary:St})},xe=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var n=t.stack||"";~n.indexOf(" at ")&&(n=n.split(" at ")[1]);var r="Error in function "+n.split("\n")[0].split("<")[0]+": "+t.message;if(!e.console)throw new Error(r);e.console.error(r,t),e.alert&&alert(r)}},t.foo.bar=t,t.foo},Le=function(t,e){var n,r,i,a,o,s,u,c,h;if(i=(e=e||{}).sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&_t[wt].metadata&&_t[wt].metadata[i]&&_t[wt].metadata[i].encoding&&(a=_t[wt].metadata[i].encoding,!o&&_t[wt].encoding&&(o=_t[wt].encoding),!o&&a.codePages&&(o=a.codePages[0]),"string"==typeof o&&(o=a[o]),o)){for(u=!1,s=[],n=0,r=t.length;n<r;n++)(c=o[t.charCodeAt(n)])?s.push(String.fromCharCode(c)):s.push(t[n]),s[n].charCodeAt(0)>>8&&(u=!0);t=s.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((h=(c=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(h),s.push(c-(h<<8))}return String.fromCharCode.apply(void 0,s)},_e=A.__private__.pdfEscape=A.pdfEscape=function(t,e){return Le(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Se=A.__private__.beginPage=function(t){et[++Bt]=[],Ot[Bt]={objId:0,contentsObjId:0,userUnit:Number(v),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},Fe(Bt),at(et[Y])},Pe=function(t,e){var n,a,s;switch(i=e||i,"string"==typeof t&&(n=S(t.toLowerCase()),Array.isArray(n)&&(a=n[0],s=n[1])),Array.isArray(t)&&(a=t[0]*Nt,s=t[1]*Nt),isNaN(a)&&(a=o[0],s=o[1]),(a>14400||s>14400)&&(r.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),a=Math.min(14400,a),s=Math.min(14400,s)),o=[a,s],i.substr(0,1)){case"l":s>a&&(o=[s,a]);break;case"p":a>s&&(o=[s,a])}Se(o),on(an),ot(pn),0!==wn&&ot(wn+" J"),0!==Nn&&ot(Nn+" j"),Mt.publish("addPage",{pageNumber:Bt})},ke=function(t){t>0&&t<=Bt&&(et.splice(t,1),Ot.splice(t,1),Bt--,Y>Bt&&(Y=Bt),this.setPage(Y))},Fe=function(t){t>0&&t<=Bt&&(Y=t)},Ie=A.__private__.getNumberOfPages=A.getNumberOfPages=function(){return et.length-1},Ce=function(t,e,n){var i,a=void 0;return n=n||{},t=void 0!==t?t:_t[wt].fontName,e=void 0!==e?e:_t[wt].fontStyle,i=t.toLowerCase(),void 0!==St[i]&&void 0!==St[i][e]?a=St[i][e]:void 0!==St[t]&&void 0!==St[t][e]?a=St[t][e]:!1===n.disableWarning&&r.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),a||n.noFallback||null==(a=St.times[e])&&(a=St.times.normal),a},je=A.__private__.putInfo=function(){for(var t in Wt(),ot("<<"),ot("/Producer (jsPDF "+m.version+")"),yt)yt.hasOwnProperty(t)&&yt[t]&&ot("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+_e(yt[t])+")");ot("/CreationDate ("+T+")"),ot(">>"),ot("endobj")},Be=A.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Jt;switch(Wt(),ot("<<"),ot("/Type /Catalog"),ot("/Pages "+e+" 0 R"),lt||(lt="fullwidth"),lt){case"fullwidth":ot("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ot("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ot("/OpenAction [3 0 R /Fit]");break;case"original":ot("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+lt;"%"===n.substr(n.length-1)&&(lt=parseInt(lt)/100),"number"==typeof lt&&ot("/OpenAction [3 0 R /XYZ null null "+O(lt)+"]")}switch(mt||(mt="continuous"),mt){case"continuous":ot("/PageLayout /OneColumn");break;case"single":ot("/PageLayout /SinglePage");break;case"two":case"twoleft":ot("/PageLayout /TwoColumnLeft");break;case"tworight":ot("/PageLayout /TwoColumnRight")}pt&&ot("/PageMode /"+pt),Mt.publish("putCatalog"),ot(">>"),ot("endobj")},Oe=A.__private__.putTrailer=function(){ot("trailer"),ot("<<"),ot("/Size "+(K+1)),ot("/Root "+K+" 0 R"),ot("/Info "+(K-1)+" 0 R"),ot("/ID [ <"+D+"> <"+D+"> ]"),ot(">>")},Me=A.__private__.putHeader=function(){ot("%PDF-"+x),ot("%ºß¬à")},Ee=A.__private__.putXRef=function(){var t="0000000000";ot("xref"),ot("0 "+(K+1)),ot("0000000000 65535 f");for(var e=1;e<=K;e++){"function"==typeof Z[e]?ot((t+Z[e]()).slice(-10)+" 00000 n"):void 0!==Z[e]?ot((t+Z[e]).slice(-10)+" 00000 n"):ot("0000000000 00000 n")}},qe=A.__private__.buildDocument=function(){it(),at($),Mt.publish("buildDocument"),Me(),ee(),ye(),be(),je(),Be();var t=Q;return Ee(),Oe(),ot("startxref"),ot(""+t),ot("%%EOF"),at(et[Y]),$.join("\n")},Re=A.__private__.getBlob=function(t){return new Blob([ut(t)],{type:"application/pdf"})},Te=A.output=A.__private__.output=xe((function(t,n){switch("string"==typeof(n=n||{})?n={filename:n}:n.filename=n.filename||"generated.pdf",t){case void 0:return qe();case"save":A.save(n.filename);break;case"arraybuffer":return ut(qe());case"blob":return Re(qe());case"bloburi":case"bloburl":if(void 0!==e.URL&&"function"==typeof e.URL.createObjectURL)return e.URL&&e.URL.createObjectURL(Re(qe()))||void 0;r.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var i="",a=qe();try{i=u(a)}catch(t){i=u(unescape(encodeURIComponent(a)))}return"data:application/pdf;filename="+n.filename+";base64,"+i;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(e)){var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+(n.pdfObjectUrl||"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js")+'"><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(n)+");<\/script></body></html>",s=e.open();return null!==s&&s.document.write(o),s}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(e)){var c='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(n.pdfJsUrl||"examples/PDF.js/web/viewer.html")+'?file=" width="500px" height="400px" /></body></html>',h=e.open();if(null!==h){h.document.write(c);var l=this;h.document.documentElement.querySelector("#pdfViewer").onload=function(){h.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(l.output("bloburl"))}}return h}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(e))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var f='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",n)+'"></iframe></body></html>',d=e.open();if(null!==d&&(d.document.write(f),d.document.title=n.filename),d||"undefined"==typeof safari)return d;break;case"datauri":case"dataurl":return e.document.location.href=this.output("datauristring",n);default:return null}})),De=function(t){return!0===Array.isArray(Et)&&Et.indexOf(t)>-1};switch(a){case"pt":Nt=1;break;case"mm":Nt=72/25.4;break;case"cm":Nt=72/2.54;break;case"in":Nt=72;break;case"px":Nt=1==De("px_scaling")?.75:96/72;break;case"pc":case"em":Nt=12;break;case"ex":Nt=6;break;default:throw new Error("Invalid unit: "+a)}V(),z();var Ue=A.__private__.getPageInfo=A.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ot[t].objId,pageNumber:t,pageContext:Ot[t]}},ze=A.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var e in Ot)if(Ot[e].objId===t)break;return Ue(e)},He=A.__private__.getCurrentPageInfo=A.getCurrentPageInfo=function(){return{objId:Ot[Y].objId,pageNumber:Y,pageContext:Ot[Y]}};A.addPage=function(){return Pe.apply(this,arguments),this},A.setPage=function(){return Fe.apply(this,arguments),at.call(this,et[Y]),this},A.insertPage=function(t){return this.addPage(),this.movePage(Y,t),this},A.movePage=function(t,e){var n,r;if(t>e){n=et[t],r=Ot[t];for(var i=t;i>e;i--)et[i]=et[i-1],Ot[i]=Ot[i-1];et[e]=n,Ot[e]=r,this.setPage(e)}else if(t<e){n=et[t],r=Ot[t];for(var a=t;a<e;a++)et[a]=et[a+1],Ot[a]=Ot[a+1];et[e]=n,Ot[e]=r,this.setPage(e)}return this},A.deletePage=function(){return ke.apply(this,arguments),this},A.__private__.text=A.text=function(t,e,n,r,i){var a,o,s,u,c,h,l,f,d=(r=r||{}).scope||this;if("number"==typeof t&&"number"==typeof e&&("string"==typeof n||Array.isArray(n))){var p=n;n=e,e=t,t=p}if(arguments[3]instanceof Dt==!1?(s=arguments[4],u=arguments[5],"object"==typeof(l=arguments[3])&&null!==l||("string"==typeof s&&(u=s,s=null),"string"==typeof l&&(u=l,l=null),"number"==typeof l&&(s=l,l=null),r={flags:l,angle:s,align:u})):(j("The transform parameter of text() with a Matrix value"),f=i),isNaN(e)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return d;var g="",m=!1,v="number"==typeof r.lineHeightFactor?r.lineHeightFactor:rn,b=d.internal.scaleFactor;function y(t){return t=t.split("\t").join(Array(r.TabLen||9).join(" ")),_e(t,l)}function w(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):Array.isArray(t)&&(1===e.length||void 0===e[1]&&void 0===e[2])?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function A(t,e){var n;if("string"==typeof t)n=e(t)[0];else if(Array.isArray(t)){for(var r,i,a=t.concat(),o=[],s=a.length;s--;)"string"==typeof(r=a.shift())?o.push(e(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(i=e(r[0],r[1],r[2]),o.push([i[0],i[1],i[2]]));n=o}return n}var x=!1,L=!0;if("string"==typeof t)x=!0;else if(Array.isArray(t)){var _=t.concat();o=[];for(var S,F=_.length;F--;)("string"!=typeof(S=_.shift())||Array.isArray(S)&&"string"!=typeof S[0])&&(L=!1);x=L}if(!1===x)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var I=ht/d.internal.scaleFactor,B=I*(rn-1);switch(r.baseline){case"bottom":n-=B;break;case"top":n+=I-B;break;case"hanging":n+=I-2*B;break;case"middle":n+=I/2-B}if((h=r.maxWidth||0)>0&&("string"==typeof t?t=d.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=d.splitTextToSize(t.join(" "),h))),a={text:t,x:e,y:n,options:r,mutex:{pdfEscape:_e,activeFontKey:wt,fonts:_t,activeFontSize:ht}},Mt.publish("preProcessText",a),t=a.text,s=(r=a.options).angle,f instanceof Dt==!1&&s&&"number"==typeof s){s*=Math.PI/180,0===r.rotationDirection&&(s=-s),k===P.ADVANCED&&(s=-s);var O=Math.cos(s),M=Math.sin(s);f=new Dt(O,M,-M,O,0,0)}else s&&s instanceof Dt&&(f=s);k!==P.ADVANCED||f||(f=zt),void 0!==(c=r.charSpace||bn)&&(g+=C(E(c))+" Tc\n",this.setCharSpace(this.getCharSpace()||0));r.lang;var q=-1,R=void 0!==r.renderingMode?r.renderingMode:r.stroke,T=d.internal.getCurrentPageInfo().pageContext;switch(R){case 0:case!1:case"fill":q=0;break;case 1:case!0:case"stroke":q=1;break;case 2:case"fillThenStroke":q=2;break;case 3:case"invisible":q=3;break;case 4:case"fillAndAddForClipping":q=4;break;case 5:case"strokeAndAddPathForClipping":q=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":q=6;break;case 7:case"addToPathForClipping":q=7}var D=void 0!==T.usedRenderingMode?T.usedRenderingMode:-1;-1!==q?g+=q+" Tr\n":-1!==D&&(g+="0 Tr\n"),-1!==q&&(T.usedRenderingMode=q),u=r.align||"left";var U,z=ht*v,H=d.internal.pageSize.getWidth(),W=_t[wt];c=r.charSpace||bn,h=r.maxWidth||0,l={};var V=[];if("[object Array]"===Object.prototype.toString.call(t)){var G;o=w(t),"left"!==u&&(U=o.map((function(t){return d.getStringUnitWidth(t,{font:W,charSpace:c,fontSize:ht,doKerning:!1})*ht/b})));var Y,J=0;if("right"===u){e-=U[0],t=[],F=o.length;for(var X=0;X<F;X++)0===X?(Y=hn(e),G=ln(n)):(Y=E(J-U[X]),G=-z),t.push([o[X],Y,G]),J=U[X]}else if("center"===u){e-=U[0]/2,t=[],F=o.length;for(var K=0;K<F;K++)0===K?(Y=hn(e),G=ln(n)):(Y=E((J-U[K])/2),G=-z),t.push([o[K],Y,G]),J=U[K]}else if("left"===u){t=[],F=o.length;for(var Z=0;Z<F;Z++)t.push(o[Z])}else{if("justify"!==u)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[],F=o.length,h=0!==h?h:H;for(var $=0;$<F;$++)G=0===$?ln(n):-z,Y=0===$?hn(e):0,$<F-1&&V.push(C(E((h-U[$])/(o[$].split(" ").length-1)))),t.push([o[$],Y,G])}}var Q="boolean"==typeof r.R2L?r.R2L:dt;!0===Q&&(t=A(t,(function(t,e,n){return[t.split("").reverse().join(""),e,n]}))),a={text:t,x:e,y:n,options:r,mutex:{pdfEscape:_e,activeFontKey:wt,fonts:_t,activeFontSize:ht}},Mt.publish("postProcessText",a),t=a.text,m=a.mutex.isHex||!1;var tt=_t[wt].encoding;"WinAnsiEncoding"!==tt&&"StandardEncoding"!==tt||(t=A(t,(function(t,e,n){return[y(t),e,n]}))),o=w(t),t=[];for(var et,nt,rt,it=0,at=1,st=Array.isArray(o[0])?at:it,ut="",ct=function(t,e,n){var i="";return n instanceof Dt?(n="number"==typeof r.angle?Ut(n,new Dt(1,0,0,1,t,e)):Ut(new Dt(1,0,0,1,t,e),n),k===P.ADVANCED&&(n=Ut(new Dt(1,0,0,-1,0,0),n)),i=n.join(" ")+" Tm\n"):i=C(t)+" "+C(e)+" Td\n",i},lt=0;lt<o.length;lt++){switch(ut="",st){case at:rt=(m?"<":"(")+o[lt][0]+(m?">":")"),et=parseFloat(o[lt][1]),nt=parseFloat(o[lt][2]);break;case it:rt=(m?"<":"(")+o[lt]+(m?">":")"),et=hn(e),nt=ln(n)}void 0!==V&&void 0!==V[lt]&&(ut=V[lt]+" Tw\n"),0===lt?t.push(ut+ct(et,nt,f)+rt):st===it?t.push(ut+rt):st===at&&t.push(ut+ct(et,nt,f)+rt)}t=st===it?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var ft="BT\n/";return ft+=wt+" "+ht+" Tf\n",ft+=C(ht*v)+" TL\n",ft+=mn+"\n",ft+=g,ft+=t,ot(ft+="ET"),N[wt]=!0,d};var We=A.__private__.clip=A.clip=function(t){return ot("evenodd"===t?"W*":"W"),this};A.clipEvenOdd=function(){return We("evenodd")},A.__private__.discardPath=A.discardPath=function(){return ot("n"),this};var Ve=A.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(e=!0),e};A.__private__.setDefaultPathOperation=A.setDefaultPathOperation=function(t){return Ve(t)&&(y=t),this};var Ge=A.__private__.getStyle=A.getStyle=function(t){var e=y;switch(t){case"D":case"S":e="S";break;case"F":e="f";break;case"FD":case"DF":e="B";break;case"f":case"f*":case"B":case"B*":e=t}return e},Ye=A.close=function(){return ot("h"),this};A.stroke=function(){return ot("S"),this},A.fill=function(t){return Je("f",t),this},A.fillEvenOdd=function(t){return Je("f*",t),this},A.fillStroke=function(t){return Je("B",t),this},A.fillStrokeEvenOdd=function(t){return Je("B*",t),this};var Je=function(t,e){"object"==typeof e?Ze(e,t):ot(t)},Xe=function(t){null===t||k===P.ADVANCED&&void 0===t||(t=Ge(t),ot(t))};function Ke(t,e,n,r,i){var a=new g(e||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);a.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return Ht(o,a),a}var Ze=function(t,e){var n=Ft[t.key],r=kt[n];if(r instanceof p)ot("q"),ot($e(e)),r.gState&&A.setGState(r.gState),ot(t.matrix.toString()+" cm"),ot("/"+n+" sh"),ot("Q");else if(r instanceof g){var i=new Dt(1,0,0,-1,0,Cn());t.matrix&&(i=i.multiply(t.matrix||zt),n=Ke.call(r,t.key,t.boundingBox,t.xStep,t.yStep,i).id),ot("q"),ot("/Pattern cs"),ot("/"+n+" scn"),r.gState&&A.setGState(r.gState),ot(e),ot("Q")}},$e=function(t){switch(t){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Qe=A.moveTo=function(t,e){return ot(C(E(t))+" "+C(R(e))+" m"),this},tn=A.lineTo=function(t,e){return ot(C(E(t))+" "+C(R(e))+" l"),this},en=A.curveTo=function(t,e,n,r,i,a){return ot([C(E(t)),C(R(e)),C(E(n)),C(R(r)),C(E(i)),C(R(a)),"c"].join(" ")),this};A.__private__.line=A.line=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ve(i))throw new Erro