UNPKG

jspdf

Version:

PDF Document creation from JavaScript

57 lines (56 loc) 366 kB
/** @license * * jsPDF - PDF Document creation from JavaScript * Version 2.0.0 Built on 2020-08-11T07:57:54.902Z * 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 */ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,r=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}(); /** * 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 n(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 r=[{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)]}}],n=0;n<r.length;n++){var i=r[n].re,a=r[n].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),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r}}function i(){r.console&&"function"==typeof r.console.log&&r.console.log.apply(r.console,arguments)}t=require("atob"),e=require("btoa");var a={log:i,warn:function(t){r.console&&("function"==typeof r.console.warn?r.console.warn.apply(r.console,arguments):i.call(null,arguments))},error:function(t){r.console&&("function"==typeof r.console.error?r.console.error.apply(r.console,arguments):i(t))}};function o(t){if("object"!=typeof t)throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,r,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof r||"boolean"!=typeof n)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[r,!!n],i},this.unsubscribe=function(t){for(var r in e)if(e[r][t])return delete e[r][t],0===Object.keys(e[r]).length&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var i=Array.prototype.slice.call(arguments,1),o=[];for(var s in e[n]){var u=e[n][s];try{u[0].apply(t,i)}catch(t){r.console&&a.error("jsPDF PubSub Error",t.message,t)}u[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function s(t){if(!(this instanceof s))return new s(t);var e="opacity,stroke-opacity".split(",");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id="",this.objectNumber=-1}function u(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function c(t,e,r,n,i){if(!(this instanceof c))return new c(t,e,r,n,i);this.type="axial"===t?2:3,this.coords=e,this.colors=r,u.call(this,n,i)}function h(t,e,r,n,i){if(!(this instanceof h))return new h(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream="",this.cloneIndex=0,u.call(this,n,i)}function l(t){var i,u="string"==typeof arguments[0]?arguments[0]:"p",f=arguments[1],d=arguments[2],p=arguments[3],g=[],m=1,v=16,b="S";"object"==typeof(t=t||{})&&(u=t.orientation,f=t.unit||f,d=t.format||d,p=t.compress||t.compressPdf||p,m="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(i=t.precision),void 0!==t.floatPrecision&&(v=t.floatPrecision),b=t.defaultPathOperation||"S"),g=t.filters||(!0===p?["FlateEncode"]:g),f=f||"mm",u=(""+(u||"P")).toLowerCase();var y=t.putOnlyUsedFonts||!1,w={},N={internal:{},__private__:{}};N.__private__.PubSub=o;var x="1.3",A=N.__private__.getPdfVersion=function(){return x};N.__private__.setPdfVersion=function(t){x=t};var L={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]};N.__private__.getPageFormats=function(){return L};var _=N.__private__.getPageFormat=function(t){return L[t]};d=d||"a4";var S={COMPAT:"compat",ADVANCED:"advanced"},P=S.COMPAT;function k(){this.saveGraphicsState(),at(new Rt(wt,0,0,-wt,0,Fr()*wt).toString()+" cm"),this.setFontSize(this.getFontSize()/wt),b="n",P=S.ADVANCED}function F(){this.restoreGraphicsState(),b="S",P=S.COMPAT}N.advancedAPI=function(t){var e=P===S.COMPAT;return e&&k.call(this),"function"!=typeof t||(t(this),e&&F.call(this)),this},N.compatAPI=function(t){var e=P===S.ADVANCED;return e&&F.call(this),"function"!=typeof t||(t(this),e&&k.call(this)),this},N.isAdvancedAPI=function(){return P===S.ADVANCED};var I,C=function(t){if(P!==S.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},j=N.roundToPrecision=N.__private__.roundToPrecision=function(t,e){var r=i||e;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};I=N.hpf=N.__private__.hpf="number"==typeof v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,v)}:"smart"===v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,16)};var B=N.f2=N.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return j(t,2)},O=N.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return j(t,3)},M=N.scale=N.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return P===S.COMPAT?t*wt:P===S.ADVANCED?t:void 0},q=function(t){return P===S.COMPAT?Fr()-t:P===S.ADVANCED?t:void 0},E=function(t){return M(q(t))};N.__private__.setPrecision=N.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(i=parseInt(t,10))};var D,R="00000000000000000000000000000000",T=N.__private__.getFileId=function(){return R},U=N.__private__.setFileId=function(t){return R=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():R.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join("")};N.setFileId=function(t){return U(t),this},N.getFileId=function(){return T()};var z=N.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),r=e<0?"+":"-",n=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[r,Y(n),"'",Y(i),"'"].join("");return["D:",t.getFullYear(),Y(t.getMonth()+1),Y(t.getDate()),Y(t.getHours()),Y(t.getMinutes()),Y(t.getSeconds()),a].join("")},H=N.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),r=parseInt(t.substr(6,2),10)-1,n=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,r,n,i,a,o,0)},W=N.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=z(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 D=e},V=N.__private__.getCreationDate=function(t){var e=D;return"jsDate"===t&&(e=H(D)),e};N.setCreationDate=function(t){return W(t),this},N.getCreationDate=function(t){return V(t)};var G,Y=N.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},J=N.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},X=0,K=[],Z=[],$=0,Q=[],tt=[],et=!1,rt=Z,nt=function(){X=0,$=0,Z=[],K=[],Q=[],Yt=Wt(),Jt=Wt()};N.__private__.setCustomOutputDestination=function(t){et=!0,rt=t};var it=function(t){et||(rt=t)};N.__private__.resetCustomOutputDestination=function(){et=!1,rt=Z};var at=N.__private__.out=function(t){return t=t.toString(),$+=t.length+1,rt.push(t),rt},ot=N.__private__.write=function(t){return at(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},st=N.__private__.getArrayBuffer=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},ut=[["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]];N.__private__.getStandardFonts=function(){return ut};var ct=t.fontSize||16;N.__private__.setFontSize=N.setFontSize=function(t){return ct=P===S.ADVANCED?t/wt:t,this};var ht,lt=N.__private__.getFontSize=N.getFontSize=function(){return P===S.COMPAT?ct:ct*wt},ft=t.R2L||!1;N.__private__.setR2L=N.setR2L=function(t){return ft=t,this},N.__private__.getR2L=N.getR2L=function(){return ft};var dt,pt=N.__private__.setZoomMode=function(t){var e=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*%$/.test(t))ht=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.');ht=t}else ht=parseInt(t,10)};N.__private__.getZoomMode=function(){return ht};var gt,mt=N.__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.');dt=t};N.__private__.getPageMode=function(){return dt};var vt=N.__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.');gt=t};N.__private__.getLayoutMode=function(){return gt},N.__private__.setDisplayMode=N.setDisplayMode=function(t,e,r){return pt(t),vt(e),mt(r),this};var bt={title:"",subject:"",author:"",keywords:"",creator:""};N.__private__.getDocumentProperty=function(t){if(-1===Object.keys(bt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return bt[t]},N.__private__.getDocumentProperties=function(){return bt},N.__private__.setDocumentProperties=N.setProperties=N.setDocumentProperties=function(t){for(var e in bt)bt.hasOwnProperty(e)&&t[e]&&(bt[e]=t[e]);return this},N.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(bt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return bt[t]=e};var yt,wt,Nt,xt,At,Lt={},_t={},St=[],Pt={},kt={},Ft={},It={},Ct=null,jt=0,Bt=[],Ot=new o(N),Mt=t.hotfixes||[],qt={},Et={},Dt=[],Rt=function(t,e,r,n,i,a){if(!(this instanceof Rt))return new Rt(t,e,r,n,i,a);isNaN(t)&&(t=1),isNaN(e)&&(e=0),isNaN(r)&&(r=0),isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(a)&&(a=0),this._matrix=[t,e,r,n,i,a]};Object.defineProperty(Rt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Rt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Rt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Rt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Rt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Rt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Rt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Rt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Rt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Rt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Rt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Rt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Rt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Rt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Rt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Rt.prototype,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Rt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(I).join(t)},Rt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,r=t.sx*this.shy+t.shy*this.sy,n=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 Rt(e,r,n,i,a,o)},Rt.prototype.decompose=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*r+(e/=o)*n;r-=t*s,n-=e*s;var u=Math.sqrt(r*r+n*n);return s/=u,t*(n/=u)<e*(r/=u)&&(t=-t,e=-e,s=-s,o=-o),{scale:new Rt(o,0,0,u,0,0),translate:new Rt(1,0,0,1,i,a),rotate:new Rt(t,e,-e,t,0,0),skew:new Rt(1,0,s,1,0,0)}},Rt.prototype.toString=function(t){return this.join(" ")},Rt.prototype.inversed=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=1/(t*n-e*r),s=n*o,u=-e*o,c=-r*o,h=t*o;return new Rt(s,u,c,h,-s*i-c*a,-u*i-h*a)},Rt.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,r=t.x*this.shy+t.y*this.sy+this.ty;return new Nr(e,r)},Rt.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),r=this.applyToPoint(new Nr(t.x+t.w,t.y+t.h));return new xr(e.x,e.y,r.x-e.x,r.y-e.y)},Rt.prototype.clone=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty;return new Rt(t,e,r,n,i,a)},N.Matrix=Rt;var Tt=N.matrixMult=function(t,e){return e.multiply(t)},Ut=new Rt(1,0,0,1,0,0);N.unitMatrix=N.identityMatrix=Ut;var zt=function(t,e){if(!kt[t]){var r=(e instanceof c?"Sh":"P")+(Object.keys(Pt).length+1).toString(10);e.id=r,kt[t]=r,Pt[r]=e,Ot.publish("addPattern",e)}};N.ShadingPattern=c,N.TilingPattern=h,N.addShadingPattern=function(t,e){return C("addShadingPattern()"),zt(t,e),this},N.beginTilingPattern=function(t){C("beginTilingPattern()"),Lr(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},N.endTilingPattern=function(t,e){C("endTilingPattern()"),e.stream=tt[G].join("\n"),zt(t,e),Ot.publish("endTilingPattern",e),Dt.pop().restore()};var Ht=N.__private__.newObject=function(){var t=Wt();return Vt(t,!0),t},Wt=N.__private__.newObjectDeferred=function(){return X++,K[X]=function(){return $},X},Vt=function(t,e){return e="boolean"==typeof e&&e,K[t]=$,e&&at(t+" 0 obj"),t},Gt=N.__private__.newAdditionalObject=function(){var t={objId:Wt(),content:""};return Q.push(t),t},Yt=Wt(),Jt=Wt(),Xt=N.__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 r=parseFloat(e[0]);e=[r,r,r,"r"]}for(var n="#",i=0;i<3;i++)n+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return n},Kt=N.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var r=t.ch1,i=t.ch2,a=t.ch3,o=t.ch4,s="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof r&&"#"!==r.charAt(0)){var u=new n(r);if(u.ok)r=u.toHex();else if(!/^\d*\.?\d*$/.test(r))throw new Error('Invalid color "'+r+'" passed to jsPDF.encodeColorString.')}if("string"==typeof r&&/^#[0-9A-Fa-f]{3}$/.test(r)&&(r="#"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),"string"==typeof r&&/^#[0-9A-Fa-f]{6}$/.test(r)){var c=parseInt(r.substr(1),16);r=c>>16&255,i=c>>8&255,a=255&c}if(void 0===i||void 0===o&&r===i&&i===a)if("string"==typeof r)e=r+" "+s[0];else switch(t.precision){case 2:e=B(r/255)+" "+s[0];break;case 3:default:e=O(r/255)+" "+s[0]}else if(void 0===o||"object"==typeof o){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.","1.","1.",s[1]].join(" ");if("string"==typeof r)e=[r,i,a,s[1]].join(" ");else switch(t.precision){case 2:e=[B(r/255),B(i/255),B(a/255),s[1]].join(" ");break;default:case 3:e=[O(r/255),O(i/255),O(a/255),s[1]].join(" ")}}else if("string"==typeof r)e=[r,i,a,o,s[2]].join(" ");else switch(t.precision){case 2:e=[B(r),B(i),B(a),B(o),s[2]].join(" ");break;case 3:default:e=[O(r),O(i),O(a),O(o),s[2]].join(" ")}return e},Zt=N.__private__.getFilters=function(){return g},$t=N.__private__.putStream=function(t){var e=(t=t||{}).data||"",r=t.filters||Zt(),n=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o={};!0===r&&(r=["FlateEncode"]);var s=t.additionalKeyValues||[],u=(o=void 0!==l.API.processDataByFilters?l.API.processDataByFilters(e,r):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(n)?n.join(" "):n.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=[],f=0;f<o.reverseChain.split("/").length-1;f+=1)h.push("null");h.push(s[c].value),s[c].value="["+h.join(" ")+"]"}}at("<<");for(var d=0;d<s.length;d++)at("/"+s[d].key+" "+s[d].value);at(">>"),0!==o.data.length&&(at("stream"),at(o.data),at("endstream"))},Qt=N.__private__.putPage=function(t){var e=t.number,r=t.data,n=t.objId,i=t.contentsObjId;Vt(n,!0),at("<</Type /Page"),at("/Parent "+t.rootDictionaryObjId+" 0 R"),at("/Resources "+t.resourceDictionaryObjId+" 0 R"),at("/MediaBox ["+parseFloat(I(t.mediaBox.bottomLeftX))+" "+parseFloat(I(t.mediaBox.bottomLeftY))+" "+I(t.mediaBox.topRightX)+" "+I(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&at("/CropBox ["+I(t.cropBox.bottomLeftX)+" "+I(t.cropBox.bottomLeftY)+" "+I(t.cropBox.topRightX)+" "+I(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&at("/BleedBox ["+I(t.bleedBox.bottomLeftX)+" "+I(t.bleedBox.bottomLeftY)+" "+I(t.bleedBox.topRightX)+" "+I(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&at("/TrimBox ["+I(t.trimBox.bottomLeftX)+" "+I(t.trimBox.bottomLeftY)+" "+I(t.trimBox.topRightX)+" "+I(t.trimBox.topRightY)+"]"),null!==t.artBox&&at("/ArtBox ["+I(t.artBox.bottomLeftX)+" "+I(t.artBox.bottomLeftY)+" "+I(t.artBox.topRightX)+" "+I(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&at("/UserUnit "+t.userUnit),Ot.publish("putPage",{objId:n,pageContext:Bt[e],pageNumber:e,page:r}),at("/Contents "+i+" 0 R"),at(">>"),at("endobj");var a=r.join("\n");return P===S.ADVANCED&&(a+="\nQ"),Vt(i,!0),$t({data:a,filters:Zt()}),at("endobj"),n},te=N.__private__.putPages=function(){var t,e,r=[];for(t=1;t<=jt;t++)Bt[t].objId=Wt(),Bt[t].contentsObjId=Wt();for(t=1;t<=jt;t++)r.push(Qt({number:t,data:tt[t],objId:Bt[t].objId,contentsObjId:Bt[t].contentsObjId,mediaBox:Bt[t].mediaBox,cropBox:Bt[t].cropBox,bleedBox:Bt[t].bleedBox,trimBox:Bt[t].trimBox,artBox:Bt[t].artBox,userUnit:Bt[t].userUnit,rootDictionaryObjId:Yt,resourceDictionaryObjId:Jt}));Vt(Yt,!0),at("<</Type /Pages");var n="/Kids [";for(e=0;e<jt;e++)n+=r[e]+" 0 R ";at(n+"]"),at("/Count "+jt),at(">>"),at("endobj"),Ot.publish("postPutPages")},ee=function(t){var e=function(t,e){return-1!==t.indexOf(" ")?"("+Le(t,e)+")":Le(t,e)};Ot.publish("putFont",{font:t,out:at,newObject:Ht,putStream:$t,pdfEscapeWithNeededParanthesis:e}),!0!==t.isAlreadyPutted&&(t.objectNumber=Ht(),at("<<"),at("/Type /Font"),at("/BaseFont /"+e(t.postScriptName)),at("/Subtype /Type1"),"string"==typeof t.encoding&&at("/Encoding /"+t.encoding),at("/FirstChar 32"),at("/LastChar 255"),at(">>"),at("endobj"))},re=function(){for(var t in Lt)Lt.hasOwnProperty(t)&&(!1===y||!0===y&&w.hasOwnProperty(t))&&ee(Lt[t])},ne=function(t){t.objectNumber=Ht();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[I(t.x),I(t.y),I(t.x+t.width),I(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var r=t.pages[1].join("\n");$t({data:r,additionalKeyValues:e}),at("endobj")},ie=function(){for(var t in qt)qt.hasOwnProperty(t)&&ne(qt[t])},ae=function(t,e){var r,n=[],i=1/(e-1);for(r=0;r<1;r+=i)n.push(r);if(n.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<n.length;c++){for(r=n[c];r>t[u+1].offset;)u++;var h=t[u].offset,l=(r-h)/(t[u+1].offset-h),f=t[u].color,d=t[u+1].color;s+=J(Math.round((1-l)*f[0]+l*d[0]).toString(16))+J(Math.round((1-l)*f[1]+l*d[1]).toString(16))+J(Math.round((1-l)*f[2]+l*d[2]).toString(16))}return s.trim()},oe=function(t,e){e||(e=21);var r=Ht(),n=ae(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]"}),$t({data:n,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"]}),at("endobj"),t.objectNumber=Ht(),at("<< /ShadingType "+t.type),at("/ColorSpace /DeviceRGB");var a="/Coords ["+I(parseFloat(t.coords[0]))+" "+I(parseFloat(t.coords[1]))+" ";2===t.type?a+=I(parseFloat(t.coords[2]))+" "+I(parseFloat(t.coords[3])):a+=I(parseFloat(t.coords[2]))+" "+I(parseFloat(t.coords[3]))+" "+I(parseFloat(t.coords[4]))+" "+I(parseFloat(t.coords[5])),at(a+="]"),t.matrix&&at("/Matrix ["+t.matrix.toString()+"]"),at("/Function "+r+" 0 R"),at("/Extend [true true]"),at(">>"),at("endobj")},se=function(t,e){var r=Wt(),n=Ht();e.push({resourcesOid:r,objectOid:n}),t.objectNumber=n;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(I).join(" ")+"]"}),i.push({key:"XStep",value:I(t.xStep)}),i.push({key:"YStep",value:I(t.yStep)}),i.push({key:"Resources",value:r+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),$t({data:t.stream,additionalKeyValues:i}),at("endobj")},ue=function(t){var e;for(e in Pt)Pt.hasOwnProperty(e)&&(Pt[e]instanceof c?oe(Pt[e]):Pt[e]instanceof h&&se(Pt[e],t))},ce=function(t){for(var e in t.objectNumber=Ht(),at("<<"),t)switch(e){case"opacity":at("/ca "+B(t[e]));break;case"stroke-opacity":at("/CA "+B(t[e]))}at(">>"),at("endobj")},he=function(){var t;for(t in Ft)Ft.hasOwnProperty(t)&&ce(Ft[t])},le=function(){for(var t in at("/XObject <<"),qt)qt.hasOwnProperty(t)&&qt[t].objectNumber>=0&&at("/"+t+" "+qt[t].objectNumber+" 0 R");Ot.publish("putXobjectDict"),at(">>")},fe=function(){for(var t in at("/Font <<"),Lt)Lt.hasOwnProperty(t)&&(!1===y||!0===y&&w.hasOwnProperty(t))&&at("/"+t+" "+Lt[t].objectNumber+" 0 R");at(">>")},de=function(){if(Object.keys(Pt).length>0){for(var t in at("/Shading <<"),Pt)Pt.hasOwnProperty(t)&&Pt[t]instanceof c&&Pt[t].objectNumber>=0&&at("/"+t+" "+Pt[t].objectNumber+" 0 R");Ot.publish("putShadingPatternDict"),at(">>")}},pe=function(t){if(Object.keys(Pt).length>0){for(var e in at("/Pattern <<"),Pt)Pt.hasOwnProperty(e)&&Pt[e]instanceof N.TilingPattern&&Pt[e].objectNumber>=0&&Pt[e].objectNumber<t&&at("/"+e+" "+Pt[e].objectNumber+" 0 R");Ot.publish("putTilingPatternDict"),at(">>")}},ge=function(){if(Object.keys(Ft).length>0){var t;for(t in at("/ExtGState <<"),Ft)Ft.hasOwnProperty(t)&&Ft[t].objectNumber>=0&&at("/"+t+" "+Ft[t].objectNumber+" 0 R");Ot.publish("putGStateDict"),at(">>")}},me=function(t){Vt(t.resourcesOid,!0),at("<<"),at("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),fe(),de(),pe(t.objectOid),ge(),le(),at(">>"),at("endobj")},ve=function(){var t=[];re(),he(),ie(),ue(t),Ot.publish("putResources"),t.forEach(me),me({resourcesOid:Jt,objectOid:Number.MAX_SAFE_INTEGER}),Ot.publish("postPutResources")},be=function(){Ot.publish("putAdditionalObjects");for(var t=0;t<Q.length;t++){var e=Q[t];Vt(e.objId,!0),at(e.content),at("endobj")}Ot.publish("postPutAdditionalObjects")},ye=function(t){_t[t.fontName]=_t[t.fontName]||{},_t[t.fontName][t.fontStyle]=t.id},we=function(t,e,r,n,i){var a={id:"F"+(Object.keys(Lt).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:r,encoding:n,isStandardFont:i||!1,metadata:{}};return Ot.publish("addFont",{font:a,instance:this}),Lt[a.id]=a,ye(a),a.id},Ne=function(t){for(var e=0,r=ut.length;e<r;e++){var n=we.call(this,t[e][0],t[e][1],t[e][2],ut[e][3],!0);!1===y&&(w[n]=!0);var i=t[e][0].split("-");ye({id:n,fontName:i[0],fontStyle:i[1]||""})}Ot.publish("addFonts",{fonts:Lt,dictionary:_t})},xe=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!r.console)throw new Error(n);r.console.error(n,t),r.alert&&alert(n)}},t.foo.bar=t,t.foo},Ae=function(t,e){var r,n,i,a,o,s,u,c,h;if(i=(e=e||{}).sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&Lt[yt].metadata&&Lt[yt].metadata[i]&&Lt[yt].metadata[i].encoding&&(a=Lt[yt].metadata[i].encoding,!o&&Lt[yt].encoding&&(o=Lt[yt].encoding),!o&&a.codePages&&(o=a.codePages[0]),"string"==typeof o&&(o=a[o]),o)){for(u=!1,s=[],r=0,n=t.length;r<n;r++)(c=o[t.charCodeAt(r)])?s.push(String.fromCharCode(c)):s.push(t[r]),s[r].charCodeAt(0)>>8&&(u=!0);t=s.join("")}for(r=t.length;void 0===u&&0!==r;)t.charCodeAt(r-1)>>8&&(u=!0),r--;if(!u)return t;for(s=e.noBOM?[]:[254,255],r=0,n=t.length;r<n;r++){if((h=(c=t.charCodeAt(r))>>8)>>8)throw new Error("Character at position "+r+" 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)},Le=N.__private__.pdfEscape=N.pdfEscape=function(t,e){return Ae(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},_e=N.__private__.beginPage=function(t){tt[++jt]=[],Bt[jt]={objId:0,contentsObjId:0,userUnit:Number(m),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},ke(jt),it(tt[G])},Se=function(t,e){var r,n,i;switch(u=e||u,"string"==typeof t&&(r=_(t.toLowerCase()),Array.isArray(r)&&(n=r[0],i=r[1])),Array.isArray(t)&&(n=t[0]*wt,i=t[1]*wt),isNaN(n)&&(n=d[0],i=d[1]),(n>14400||i>14400)&&(a.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),n=Math.min(14400,n),i=Math.min(14400,i)),d=[n,i],u.substr(0,1)){case"l":i>n&&(d=[i,n]);break;case"p":n>i&&(d=[i,n])}_e(d),ir(nr),at(fr),0!==br&&at(br+" J"),0!==yr&&at(yr+" j"),Ot.publish("addPage",{pageNumber:jt})},Pe=function(t){t>0&&t<=jt&&(tt.splice(t,1),Bt.splice(t,1),jt--,G>jt&&(G=jt),this.setPage(G))},ke=function(t){t>0&&t<=jt&&(G=t)},Fe=N.__private__.getNumberOfPages=N.getNumberOfPages=function(){return tt.length-1},Ie=function(t,e,r){var n,i=void 0;return r=r||{},t=void 0!==t?t:Lt[yt].fontName,e=void 0!==e?e:Lt[yt].fontStyle,n=t.toLowerCase(),void 0!==_t[n]&&void 0!==_t[n][e]?i=_t[n][e]:void 0!==_t[t]&&void 0!==_t[t][e]?i=_t[t][e]:!1===r.disableWarning&&a.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||r.noFallback||null==(i=_t.times[e])&&(i=_t.times.normal),i},Ce=N.__private__.putInfo=function(){for(var t in Ht(),at("<<"),at("/Producer (jsPDF "+l.version+")"),bt)bt.hasOwnProperty(t)&&bt[t]&&at("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+Le(bt[t])+")");at("/CreationDate ("+D+")"),at(">>"),at("endobj")},je=N.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Yt;switch(Ht(),at("<<"),at("/Type /Catalog"),at("/Pages "+e+" 0 R"),ht||(ht="fullwidth"),ht){case"fullwidth":at("/OpenAction [3 0 R /FitH null]");break;case"fullheight":at("/OpenAction [3 0 R /FitV null]");break;case"fullpage":at("/OpenAction [3 0 R /Fit]");break;case"original":at("/OpenAction [3 0 R /XYZ null null 1]");break;default:var r=""+ht;"%"===r.substr(r.length-1)&&(ht=parseInt(ht)/100),"number"==typeof ht&&at("/OpenAction [3 0 R /XYZ null null "+B(ht)+"]")}switch(gt||(gt="continuous"),gt){case"continuous":at("/PageLayout /OneColumn");break;case"single":at("/PageLayout /SinglePage");break;case"two":case"twoleft":at("/PageLayout /TwoColumnLeft");break;case"tworight":at("/PageLayout /TwoColumnRight")}dt&&at("/PageMode /"+dt),Ot.publish("putCatalog"),at(">>"),at("endobj")},Be=N.__private__.putTrailer=function(){at("trailer"),at("<<"),at("/Size "+(X+1)),at("/Root "+X+" 0 R"),at("/Info "+(X-1)+" 0 R"),at("/ID [ <"+R+"> <"+R+"> ]"),at(">>")},Oe=N.__private__.putHeader=function(){at("%PDF-"+x),at("%ºß¬à")},Me=N.__private__.putXRef=function(){var t="0000000000";at("xref"),at("0 "+(X+1)),at("0000000000 65535 f");for(var e=1;e<=X;e++){"function"==typeof K[e]?at((t+K[e]()).slice(-10)+" 00000 n"):void 0!==K[e]?at((t+K[e]).slice(-10)+" 00000 n"):at("0000000000 00000 n")}},qe=N.__private__.buildDocument=function(){nt(),it(Z),Ot.publish("buildDocument"),Oe(),te(),be(),ve(),Ce(),je();var t=$;return Me(),Be(),at("startxref"),at(""+t),at("%%EOF"),it(tt[G]),Z.join("\n")},Ee=N.__private__.getBlob=function(t){return new Blob([st(t)],{type:"application/pdf"})},De=N.output=N.__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":N.save(n.filename);break;case"arraybuffer":return st(qe());case"blob":return Ee(qe());case"bloburi":case"bloburl":if(void 0!==r.URL&&"function"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(Ee(qe()))||void 0;a.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var i="",o=qe();try{i=e(o)}catch(t){i=e(unescape(encodeURIComponent(o)))}return"data:application/pdf;filename="+n.filename+";base64,"+i;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(r)){var s='<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>",u=r.open();return null!==u&&u.document.write(s),u}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(r)){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=r.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(r))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=r.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 r.document.location.href=this.output("datauristring",n);default:return null}})),Re=function(t){return!0===Array.isArray(Mt)&&Mt.indexOf(t)>-1};switch(f){case"pt":wt=1;break;case"mm":wt=72/25.4;break;case"cm":wt=72/2.54;break;case"in":wt=72;break;case"px":wt=1==Re("px_scaling")?.75:96/72;break;case"pc":case"em":wt=12;break;case"ex":wt=6;break;default:throw new Error("Invalid unit: "+f)}W(),U();var Te=N.__private__.getPageInfo=N.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Bt[t].objId,pageNumber:t,pageContext:Bt[t]}},Ue=N.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var e in Bt)if(Bt[e].objId===t)break;return Te(e)},ze=N.__private__.getCurrentPageInfo=N.getCurrentPageInfo=function(){return{objId:Bt[G].objId,pageNumber:G,pageContext:Bt[G]}};N.addPage=function(){return Se.apply(this,arguments),this},N.setPage=function(){return ke.apply(this,arguments),it.call(this,tt[G]),this},N.insertPage=function(t){return this.addPage(),this.movePage(G,t),this},N.movePage=function(t,e){var r,n;if(t>e){r=tt[t],n=Bt[t];for(var i=t;i>e;i--)tt[i]=tt[i-1],Bt[i]=Bt[i-1];tt[e]=r,Bt[e]=n,this.setPage(e)}else if(t<e){r=tt[t],n=Bt[t];for(var a=t;a<e;a++)tt[a]=tt[a+1],Bt[a]=Bt[a+1];tt[e]=r,Bt[e]=n,this.setPage(e)}return this},N.deletePage=function(){return Pe.apply(this,arguments),this},N.__private__.text=N.text=function(t,e,r,n,i){var a,o,s,u,c,h,l,f,d=(n=n||{}).scope||this;if("number"==typeof t&&"number"==typeof e&&("string"==typeof r||Array.isArray(r))){var p=r;r=e,e=t,t=p}if(arguments[3]instanceof Rt==!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),n={flags:l,angle:s,align:u})):(C("The transform parameter of text() with a Matrix value"),f=i),isNaN(e)||isNaN(r)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return d;var g="",m=!1,v="number"==typeof n.lineHeightFactor?n.lineHeightFactor:rr,b=d.internal.scaleFactor;function y(t){return t=t.split("\t").join(Array(n.TabLen||9).join(" ")),Le(t,l)}function N(t){for(var e,r=t.concat(),n=[],i=r.length;i--;)"string"==typeof(e=r.shift())?n.push(e):Array.isArray(t)&&(1===e.length||void 0===e[1]&&void 0===e[2])?n.push(e[0]):n.push([e[0],e[1],e[2]]);return n}function x(t,e){var r;if("string"==typeof t)r=e(t)[0];else if(Array.isArray(t)){for(var n,i,a=t.concat(),o=[],s=a.length;s--;)"string"==typeof(n=a.shift())?o.push(e(n)[0]):Array.isArray(n)&&"string"==typeof n[0]&&(i=e(n[0],n[1],n[2]),o.push([i[0],i[1],i[2]]));r=o}return r}var A=!1,L=!0;if("string"==typeof t)A=!0;else if(Array.isArray(t)){var _=t.concat();o=[];for(var k,F=_.length;F--;)("string"!=typeof(k=_.shift())||Array.isArray(k)&&"string"!=typeof k[0])&&(L=!1);A=L}if(!1===A)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 j=ct/d.internal.scaleFactor,B=j*(rr-1);switch(n.baseline){case"bottom":r-=B;break;case"top":r+=j-B;break;case"hanging":r+=j-2*B;break;case"middle":r+=j/2-B}if((h=n.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:r,options:n,mutex:{pdfEscape:Le,activeFontKey:yt,fonts:Lt,activeFontSize:ct}},Ot.publish("preProcessText",a),t=a.text,s=(n=a.options).angle,f instanceof Rt==!1&&s&&"number"==typeof s){s*=Math.PI/180,0===n.rotationDirection&&(s=-s),P===S.ADVANCED&&(s=-s);var O=Math.cos(s),q=Math.sin(s);f=new Rt(O,q,-q,O,0,0)}else s&&s instanceof Rt&&(f=s);P!==S.ADVANCED||f||(f=Ut),void 0!==(c=n.charSpace||mr)&&(g+=I(M(c))+" Tc\n",this.setCharSpace(this.getCharSpace()||0));n.lang;var E=-1,D=void 0!==n.renderingMode?n.renderingMode:n.stroke,R=d.internal.getCurrentPageInfo().pageContext;switch(D){case 0:case!1:case"fill":E=0;break;case 1:case!0:case"stroke":E=1;break;case 2:case"fillThenStroke":E=2;break;case 3:case"invisible":E=3;break;case 4:case"fillAndAddForClipping":E=4;break;case 5:case"strokeAndAddPathForClipping":E=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":E=6;break;case 7:case"addToPathForClipping":E=7}var T=void 0!==R.usedRenderingMode?R.usedRenderingMode:-1;-1!==E?g+=E+" Tr\n":-1!==T&&(g+="0 Tr\n"),-1!==E&&(R.usedRenderingMode=E),u=n.align||"left";var U,z=ct*v,H=d.internal.pageSize.getWidth(),W=Lt[yt];c=n.charSpace||mr,h=n.maxWidth||0,l={};var V=[];if("[object Array]"===Object.prototype.toString.call(t)){var G;o=N(t),"left"!==u&&(U=o.map((function(t){return d.getStringUnitWidth(t,{font:W,charSpace:c,fontSize:ct,doKerning:!1})*ct/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=ur(e),G=cr(r)):(Y=M(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=ur(e),G=cr(r)):(Y=M((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===$?cr(r):-z,Y=0===$?ur(e):0,$<F-1&&V.push(I(M((h-U[$])/(o[$].split(" ").length-1)))),t.push([o[$],Y,G])}}var Q="boolean"==typeof n.R2L?n.R2L:ft;!0===Q&&(t=x(t,(function(t,e,r){return[t.split("").reverse().join(""),e,r]}))),a={text:t,x:e,y:r,options:n,mutex:{pdfEscape:Le,activeFontKey:yt,fonts:Lt,activeFontSize:ct}},Ot.publish("postProcessText",a),t=a.text,m=a.mutex.isHex||!1;var tt=Lt[yt].encoding;"WinAnsiEncoding"!==tt&&"StandardEncoding"!==tt||(t=x(t,(function(t,e,r){return[y(t),e,r]}))),o=N(t),t=[];for(var et,rt,nt,it=0,ot=1,st=Array.isArray(o[0])?ot:it,ut="",ht=function(t,e,r){var i="";return r instanceof Rt?(r="number"==typeof n.angle?Tt(r,new Rt(1,0,0,1,t,e)):Tt(new Rt(1,0,0,1,t,e),r),P===S.ADVANCED&&(r=Tt(new Rt(1,0,0,-1,0,0),r)),i=r.join(" ")+" Tm\n"):i=I(t)+" "+I(e)+" Td\n",i},lt=0;lt<o.length;lt++){switch(ut="",st){case ot:nt=(m?"<":"(")+o[lt][0]+(m?">":")"),et=parseFloat(o[lt][1]),rt=parseFloat(o[lt][2]);break;case it:nt=(m?"<":"(")+o[lt]+(m?">":")"),et=ur(e),rt=cr(r)}void 0!==V&&void 0!==V[lt]&&(ut=V[lt]+" Tw\n"),0===lt?t.push(ut+ht(et,rt,f)+nt):st===it?t.push(ut+nt):st===ot&&t.push(ut+ht(et,rt,f)+nt)}t=st===it?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var dt="BT\n/";return dt+=yt+" "+ct+" Tf\n",dt+=I(ct*v)+" TL\n",dt+=pr+"\n",dt+=g,dt+=t,at(dt+="ET"),w[yt]=!0,d};var He=N.__private__.clip=N.clip=function(t){return at("evenodd"===t?"W*":"W"),this};N.clipEvenOdd=function(){return He("evenodd")},N.__private__.discardPath=N.discardPath=function(){return at("n"),this};var We=N.__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};N.__private__.setDefaultPathOperation=N.setDefaultPathOperation=function(t){return We(t)&&(b=t),this};var Ve=N.__private__.getStyle=N.getStyle=function(t){var e=b;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},Ge=N.close=function(){return at("h"),this};N.stroke=function(){return at("S"),this},N.fill=function(t){return Ye("f",t),this},N.fillEvenOdd=function(t){return Ye("f*",t),this},N.fillStroke=function(t){return Ye("B",t),this},N.fillStrokeEvenOdd=function(t){return Ye("B*",t),this};var Ye=function(t,e){"object"==typeof e?Ke(e,t):at(t)},Je=function(t){null===t||P===S.ADVANCED&&void 0===t||(t=Ve(t),at(t))};function Xe(t,e,r,n,i){var a=new h(e||this.boundingBox,r||this.xStep,n||this.yStep,this.gState,i||this.matrix);a.stream=this.stream;var o=t+"$$"+this.cloneIndex+++"$$";return zt(o,a),a}var Ke=function(t,e){var r=kt[t.key],n=Pt[r];if(n instanceof c)at("q"),at(Ze(e)),n.gState&&N.setGState(n.gState),at(t.matrix.toString()+" cm"),at("/"+r+" sh"),at("Q");else if(n instanceof h){var i=new Rt(1,0,0,-1,0,Fr());t.matrix&&(i=i.multiply(t.matrix||Ut),r=Xe.call(n,t.key,t.boundingBox,t.xStep,t.yStep,i).id),at("q"),at("/Pattern cs"),at("/"+r+" scn"),n.gState&&N.setGState(n.gState),at(e),at("Q")}},Ze=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"}},$e=N.moveTo=function(t,e){return at(I(M(t))+" "+I(E(e))+" m"),this},Qe=N.lineTo=function(t,e){return at(I(M(t))+" "+I(E(e))+" l"),this},tr=N.curveTo=function(t,e,r,n,i,a){return at([I(M(t)),I(E(e)),I(M(r)),I(E(n)),I(M(i)),I(E(a)),"c"].join(" ")),this};N.__private__.line=N.line=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!We(i))throw new Error("Invalid arguments passed to jsPDF.line");return P===S.COMPAT?this.lines([[r-t,n-e]],t,e,[1,1],i||"S"):this.lines([[r-t,n-e]],t,e,[1,1]).stroke()},N.__private__.lines=N.lines=function(t,e,r,n,i,a){var o,s,u,c,h,l,f,d,p,g,m,v;if("number"==typeof t&&(v=r,r=e,e=t,t=v),n=n||[1,1],a=a||!1,isNaN(e)||isNaN(r)||!Array.isArray(t)||!Array.isArray(n)||!We(i)||"boolean"!=typeof a)throw new Error("Invalid arguments passed to jsPDF.lines");for($e(e,r),o=n[0],s=n[1],c=t.length,g=e,m=r,u=0;u<c;u++)2===(h=t[u]).length?(g=h[0]*o+g,m=h[1]*s+m,Qe(g,m)):(l=h[0]*o+g,f=h[1]*s+m,d=h[2]*o+g,p=h[3]*s+m,g=h[4]*o+g,m=h[5]*s+m,tr(l,f,d,p,g,m));return a&&Ge(),Je(i),this},N.path=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r.c;switch(r.op){case"m":$e(n[0],n[1]);break;case"l":Qe(n[0],n[1]);break;case"c":tr.apply(this,n);break;case"h":Ge()}}return this},N.__private__.rect=N.rect=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!We(i))throw new Error("Invalid arguments passed to jsPDF.rect");return P===S.COMPAT&&(n=-n),at([I(M(t)),I(E(e)),I(M(r)),I(M(n)),"re"].join(" ")),Je(i),this},N.__private__.triangle=N.triangle=function(t,e,r,n,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(i)||isNaN(a)||!We(o))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[r-t,n-e],[i-r,a-n],[t-i,e-a]],t,e,[1,1],o,!0),this},N.__private__.roundedRect=N.roundedRect=function(t,e,r,n,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||isNaN(i)||isNaN(a)||!We(o))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*r),a=Math.min(a,.5*n),this.lines([[r-2*i,0],[i*s,0,i,a-a*s,i,a],[0,n-2*a],[0,a*s,-i*s,a,-i,a],[2*i-r,0],[-i*s,0,-i,-a*s,-i,-a],[0,2*a-n],[0,-a*s,i*s,-a,i,-a]],t+i,e,[1,1],o,!0),this},N.__private__.ellipse=N.ellipse=function(t,e,r,n,i){if(isNaN(t)||isNaN(e)||isNaN(r)||isNaN(n)||!We(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var a=4/3*(Math.SQRT2-1)*r,o=4/3*(Math.SQRT2-1)*n;return $e(t+r,e),tr(t+r,e-o,t+a,e-n,t,e-n),tr(t-a,e-n,t-r,e-o,t-r,e),tr(t-r,e+o,t-a,e+n,t,e+n),tr(t+a,e+n,t+r,e+o,t+r,e),Je(i),this},N.__private__.circle=N.circle=function(t,e,r,n){if(isNaN(t)||isNaN(e)||isNaN(r)||!We(n))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,e,r,r,n)},N.setFont=function(t,e){return yt=Ie(t,e,{disableWarning:!1}),this};var er=N.__private__.getFont=N.getFont=function(){return Lt[Ie.apply(N,arguments)]};N.__private__.getFontList=N.getFontList=function(){var t,e,r={};for(t