>=1,++c;for(g=0;g0;++g){var x,k=_[g],C=0;r.fillBitWindow(),C+=r.val_>>>r.bit_pos_&15,r.bit_pos_+=w[C].bits,x=w[C].value,y[k]=x,0!==x&&(v-=32>>x,++b)}if(1!==b&&0!==v)throw new Error("[ReadHuffmanCode] invalid num_codes or space");!function(t,e,n,r){for(var i=0,a=f,o=0,u=0,c=32768,h=[],p=0;p<32;p++)h.push(new s(0,0));for(l(h,0,5,t,S);i0;){var g,y=0;if(r.readMoreInput(),r.fillBitWindow(),y+=r.val_>>>r.bit_pos_&31,r.bit_pos_+=h[y].bits,(g=255&h[y].value)>g);else{var v,b,m=g-14,w=0;if(g===d&&(w=a),u!==w&&(o=0,u=w),v=o,o>0&&(o-=2,o<<=m),i+(b=(o+=r.readBits(m)+3)-v)>e)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var x=0;x>>5]),this.htrees=new Uint32Array(e)}function F(t,e){var n,r,i={num_htrees:null,context_map:null},a=0;e.readMoreInput();var o=i.num_htrees=I(e)+1,l=i.context_map=new Uint8Array(t);if(o<=1)return i;for(e.readBits(1)&&(a=e.readBits(4)+1),n=[],r=0;r=t)throw new Error("[DecodeContextMap] i >= context_map_size");l[r]=0,++r}else l[r]=u-a,++r}return e.readBits(1)&&function(t,e){var n,r=new Uint8Array(256);for(n=0;n<256;++n)r[n]=n;for(n=0;n=t&&(s-=t),r[n]=s,i[l+(1&a[u])]=s,++a[u]}function z(t,e,n,r,i,o){var s,l=i+1,u=n&i,c=o.pos_&a.IBUF_MASK;if(e<8||o.bit_pos_+(e<<3)0;)o.readMoreInput(),r[u++]=o.readBits(8),u===l&&(t.write(r,l),u=0);else{if(o.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;o.bit_pos_<32;)r[u]=o.val_>>>o.bit_pos_,o.bit_pos_+=8,++u,--e;if(c+(s=o.bit_end_pos_-o.bit_pos_>>3)>a.IBUF_MASK){for(var h=a.IBUF_MASK+1-c,f=0;f=l){t.write(r,l),u-=l;for(f=0;f=l;){if(s=l-u,o.input_.read(r,u,s)e.buffer.length){var kt=new Uint8Array(V+ct);kt.set(e.buffer),e.buffer=kt}if(j=_t.input_end,$=_t.is_uncompressed,_t.is_metadata)for(void 0,G=(W=_).bit_pos_+7&-8,W.readBits(G-W.bit_pos_);ct>0;--ct)_.readMoreInput(),_.readBits(8);else if(0!==ct)if($)_.bit_pos_=_.bit_pos_+7&-8,z(e,ct,V,d,f,_),V+=ct;else{for(n=0;n<3;++n)dt[n]=I(_)+1,dt[n]>=2&&(L(dt[n]+2,w,n*x,_),L(y,S,n*x,_),ht[n]=B(S,n*x,_),gt[n]=1);for(_.readMoreInput(),nt=(1<<(tt=_.readBits(2)))-1,rt=(et=k+(_.readBits(4)<0;){var Pt,Et,It,Tt,Ot,Lt,Bt,Mt,Rt,Ft,Dt,zt;for(_.readMoreInput(),0===ht[1]&&(D(dt[1],w,1,ft,pt,gt,_),ht[1]=B(S,x,_),ut=K[1].htrees[ft[1]]),--ht[1],(Et=(Pt=O(K[1].codes,ut,_))>>6)>=2?(Et-=2,Bt=-1):Bt=0,It=c.kInsertRangeLut[Et]+(Pt>>3&7),Tt=c.kCopyRangeLut[Et]+(7&Pt),Ot=c.kInsertLengthPrefixCode[It].offset+_.readBits(c.kInsertLengthPrefixCode[It].nbits),Lt=c.kCopyLengthPrefixCode[Tt].offset+_.readBits(c.kCopyLengthPrefixCode[Tt].nbits),Y=d[V-1&f],X=d[V-2&f],Rt=0;Rt4?3:Lt-2))],(Bt=O(K[2].codes,K[2].htrees[wt],_))>=et)zt=(Bt-=et)&nt,Bt=et+((Nt=(2+(1&(Bt>>=tt))<<(Dt=1+(Bt>>1)))-4)+_.readBits(Dt)<(H=V=o.minDictionaryWordLength&&Lt<=o.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+V+" distance: "+Mt+" len: "+Lt+" bytes left: "+ct);var Nt=o.offsetsByLength[Lt],Ut=Mt-H-1,Wt=o.sizeBitsByLength[Lt],Gt=Ut>>Wt;if(Nt+=(Ut&(1<=m){e.write(d,l);for(var jt=0;jt0&&(q[3&Z]=Mt,++Z),Lt>ct)throw new Error("Invalid backward reference. pos: "+V+" distance: "+Mt+" len: "+Lt+" bytes left: "+ct);for(Rt=0;Rtthis.buffer.length&&(n=this.buffer.length-this.pos);for(var r=0;rthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(t.subarray(0,e),this.pos),this.pos+=e,e},e.BrotliOutput=r},function(t,e,n){var r=n(286);e.init=function(){e.dictionary=r.init()},e.offsetsByLength=new Uint32Array([0,0,0,0,0,4096,9216,21504,35840,44032,53248,63488,74752,87040,93696,100864,104704,106752,108928,113536,115968,118528,119872,121280,122016]),e.sizeBitsByLength=new Uint8Array([0,0,0,0,10,10,11,11,10,10,10,10,10,9,9,8,7,7,8,7,7,6,6,5,5]),e.minDictionaryWordLength=4,e.maxDictionaryWordLength=24},function(t,e){function n(t,e){this.bits=t,this.value=e}e.HuffmanCode=n;var r=15;function i(t,e){for(var n=1<>=1;return(t&n-1)+n}function a(t,e,r,i,a){for(;t[e+(i-=r)]=new n(a.bits,a.value),i>0;);}function o(t,e,n){for(var i=1<0;--x[c])a(t,e+f,d,v,new n(255&c,65535&m[h++])),f=i(f,c);for(g=b-1,p=-1,c=s+1,d=2;c<=r;++c,d<<=1)for(;x[c]>0;--x[c])(f&g)!==p&&(e+=v,b+=v=1<<(y=o(x,c,s)),t[w+(p=f&g)]=new n(y+s&255,e-w-p&65535)),a(t,e+(f>>s),d,v,new n(c-s&255,65535&m[h++])),f=i(f,c);return b}},function(t,e,n){(function(e){(function(){var r,i,a,o;o=n(8),n(298),r=n(299),a=n(300),i=function(){function t(){}return t.open=function(t,n){var i,s;if(e.isBuffer(t))i=t;else if(t instanceof ArrayBuffer)i=new e(new Uint8Array(t));else if(s=/^data:.+;base64,(.*)$/.exec(t))i=new e(s[1],"base64");else if(!(i=o.readFileSync(t)))return;if(255===i[0]&&216===i[1])return new r(i,n);if(137===i[0]&&"PNG"===i.toString("ascii",1,4))return new a(i,n);throw new Error("Unknown image format.")},t}(),t.exports=i}).call(this)}).call(e,n(1).Buffer)},function(t,e,n){(function(e){t.exports=e.pdfMake=n(123)}).call(e,n(7))},function(t,e,n){"use strict";(function(e,r){var i=n(126),a=n(0).isFunction,o=n(306).saveAs,s={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-MediumItalic.ttf"}};function l(t,e,n,r){this.docDefinition=t,this.tableLayouts=e||null,this.fonts=n||s,this.vfs=r}l.prototype._createDoc=function(t,r){t=t||{},this.tableLayouts&&(t.tableLayouts=this.tableLayouts);var a=new i(this.fonts);n(8).bindFS(this.vfs);var o,s=a.createPdfKitDocument(this.docDefinition,t),l=[];s.on("readable",function(){for(var t;null!==(t=s.read(9007199254740991));)l.push(t)}),s.on("end",function(){o=e.concat(l),r(o,s._pdfMakePages)}),s.end()},l.prototype._getPages=function(t,e){if(!e)throw"_getPages is an async method and needs a callback argument";this._createDoc(t,function(t,n){e(n)})},l.prototype._bufferToBlob=function(t){var e;try{e=new Blob([t],{type:"application/pdf"})}catch(r){if("InvalidStateError"===r.name){var n=new Uint8Array(t);e=new Blob([n.buffer],{type:"application/pdf"})}}if(!e)throw"Could not generate blob";return e},l.prototype._openWindow=function(){var t=window.open("","_blank");if(null===t)throw"Open PDF in new window blocked by browser";return t},l.prototype._openPdf=function(t,e){e||(e=this._openWindow());try{this.getBlob(function(t){var n=(window.URL||window.webkitURL).createObjectURL(t);e.location.href=n},t)}catch(t){throw e.close(),t}},l.prototype.open=function(t,e){(t=t||{}).autoPrint=!1,e=e||null,this._openPdf(t,e)},l.prototype.print=function(t,e){(t=t||{}).autoPrint=!0,e=e||null,this._openPdf(t,e)},l.prototype.download=function(t,e,n){a(t)&&(e=t,t=null),t=t||"file.pdf",this.getBlob(function(n){o(n,t),a(e)&&e()},n)},l.prototype.getBase64=function(t,e){if(!t)throw"getBase64 is an async method and needs a callback argument";this.getBuffer(function(e){t(e.toString("base64"))},e)},l.prototype.getDataUrl=function(t,e){if(!t)throw"getDataUrl is an async method and needs a callback argument";this.getBuffer(function(e){t("data:application/pdf;base64,"+e.toString("base64"))},e)},l.prototype.getBlob=function(t,e){if(!t)throw"getBlob is an async method and needs a callback argument";var n=this;this.getBuffer(function(e){var r=n._bufferToBlob(e);t(r)},e)},l.prototype.getBuffer=function(t,e){if(!t)throw"getBuffer is an async method and needs a callback argument";this._createDoc(e,function(e){t(e)})},t.exports={createPdf:function(t){if(!Object.keys)throw"Your browser does not provide the level of support needed";return new l(t,r.pdfMake.tableLayouts,r.pdfMake.fonts,r.pdfMake.vfs)}}}).call(e,n(1).Buffer,n(7))},function(t,e,n){"use strict";e.byteLength=function(t){return 3*t.length/4-u(t)},e.toByteArray=function(t){var e,n,r,o,s,l=t.length;o=u(t),s=new a(3*l/4-o),n=o>0?l-4:l;var c=0;for(e=0;e>16&255,s[c++]=r>>8&255,s[c++]=255&r;2===o?(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[c++]=255&r):1===o&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[c++]=r>>8&255,s[c++]=255&r);return s},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a="",o=[],s=0,l=n-i;sl?l:s+16383));1===i?(e=t[n-1],a+=r[e>>2],a+=r[e<<4&63],a+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],a+=r[e>>10],a+=r[e>>4&63],a+=r[e<<2&63],a+="=");return o.push(a),o.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var a,o,s=8*i-r-1,l=(1<>1,c=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)},e.write=function(t,e,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[n+d]=255&o,d+=p,o/=256,u-=8);t[n+d-p]|=128*g}},function(t,e,n){"use strict";var r=n(127),i=n(128),a=n(138),o=n(303),s=n(304),l=n(305),u=n(42),c=n(0).isFunction,h=n(0).isString,f=n(0).isNumber,d=n(0).isBoolean,p=n(0).isArray;function g(t){this.fontDescriptors=t}function y(t){if(!t)return null;if(f(t))t={left:t,right:t,top:t,bottom:t};else if(p(t))if(2===t.length)t={left:t[0],top:t[1],right:t[0],bottom:t[1]};else{if(4!==t.length)throw"Invalid pageMargins definition";t={left:t[0],top:t[1],right:t[2],bottom:t[3]}}return t}function v(t,e){var n=e.options.size[0]>e.options.size[1]?"landscape":"portrait";if(t.pageSize.orientation!==n){var r=e.options.size[0],i=e.options.size[1];e.options.size=[i,r]}}function b(t,e,n,r){if(t._pageNodeRef){var i,a,o=new u(null),s=t._pageNodeRef.positions[0].pageNumber.toString();switch(t.inlines[0].text=s,t.inlines[0].linkToPage=s,i=o.widthOfString(t.inlines[0].text,t.inlines[0].font,t.inlines[0].fontSize,t.inlines[0].characterSpacing,t.inlines[0].fontFeatures),a=t.inlines[0].width-i,t.inlines[0].width=i,t.inlines[0].alignment){case"right":t.inlines[0].x+=a;break;case"center":t.inlines[0].x+=a/2}}e=e||0,n=n||0;var c=t.getHeight(),h=c-t.getAscenderHeight();l.drawBackground(t,e,n,r);for(var f=0,d=t.inlines.length;f1){var o=t.points[0],s=t.points[t.points.length-1];(t.closePath||o.x===s.x&&o.y===s.y)&&e.closePath()}break;case"path":e.path(t.d)}t.color&&t.lineColor?(e.fillColor(t.color,t.fillOpacity||1),e.strokeColor(t.lineColor,t.strokeOpacity||1),e.fillAndStroke()):t.color?(e.fillColor(t.color,t.fillOpacity||1),e.fill()):(e.strokeColor(t.lineColor||"black",t.strokeOpacity||1),e.stroke())}function x(t,e,n,r){r.image(t.image,t.x,t.y,{width:t._width,height:t._height}),t.link&&r.link(t.x,t.y,t._width,t._height,t.link)}function S(t,e){e.save(),e.addContent(t.x+" "+t.y+" "+t.width+" "+t.height+" re"),e.clip()}g.prototype.createPdfKitDocument=function(t,e){e=e||{};var n=function(t,e){t&&"auto"===t.height&&(t.height=1/0);var n=function(t){if(h(t)){var e=o[t.toUpperCase()];if(!e)throw"Page size "+t+" not recognized";return{width:e[0],height:e[1]}}return t}(t||"A4");(function(t){if(h(t))return"portrait"===(t=t.toLowerCase())&&n.width>n.height||"landscape"===t&&n.widthn.height?"landscape":"portrait",n}(t.pageSize,t.pageOrientation),l=!d(t.compress)||t.compress;this.pdfKitDoc=new a({size:[n.width,n.height],autoFirstPage:!1,compress:l}),function(t,e){function n(t){var e=t.charAt(0).toUpperCase()+t.slice(1);return-1!==["Title","Author","Subject","Keywords","Creator","Producer","CreationDate","ModDate","Trapped"].indexOf(e)?e:t.replace(/\s+/g,"")}if(e.info.Producer="pdfmake",e.info.Creator="pdfmake",t.info)for(var r in t.info){var i=t.info[r];i&&(r=n(r),e.info[r]=i)}}(t,this.pdfKitDoc),this.fontProvider=new r(this.fontDescriptors,this.pdfKitDoc),t.images=t.images||{};var u=new i(n,y(t.pageMargins||40),new s(this.pdfKitDoc,t.images));u.registerTableLayouts({noBorders:{hLineWidth:function(t){return 0},vLineWidth:function(t){return 0},paddingLeft:function(t){return t?4:0},paddingRight:function(t,e){return t-1&&(C=C.slice(0,A)),n.height===1/0){var P=(p=C,g=t.pageMargins,_=y(g||40),k=_.top+_.bottom,p.forEach(function(t){t.items.forEach(function(t){var e;k+=c((e=t).item.getHeight)?e.item.getHeight():e.item._height?e.item._height:0})}),k);this.pdfKitDoc.options.size=[n.width,P]}if(function(t,e,n,r){n._pdfMakePages=t,n.addPage();var i=0;r&&t.forEach(function(t){i+=t.items.length});var a=0;r=r||function(){};for(var o=0;o0&&(v(t[o],n),n.addPage(n.options));for(var s=t[o],l=0,u=s.items.length;l0})).forEach(function(t){var n={};["id","text","ul","ol","table","image","qr","canvas","columns","headlineLevel","style","pageBreak","pageOrientation","width","height"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.startPosition=t.positions[0],n.pageNumbers=t.positions.map(function(t){return t.pageNumber}).filter(function(t,e,n){return n.indexOf(t)===e}),n.pages=e.length,n.stack=f(t.stack),t.nodeInfo=n}),t.some(function(t,e,n){if("before"!==t.pageBreak&&!t.pageBreakCalculated){t.pageBreakCalculated=!0;var r=t.nodeInfo.pageNumbers[0],i=n.slice(e+1).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r)>-1}),a=n.slice(e+1).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r+1)>-1}),o=n.slice(0,e).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r)>-1});if(h(t.nodeInfo,i.map(function(t){return t.nodeInfo}),a.map(function(t){return t.nodeInfo}),o.map(function(t){return t.nodeInfo})))return t.pageBreak="before",!0}}))}this.docPreprocessor=new i,this.docMeasure=new a(e,n,r,this.imageMeasure,this.tableLayouts,u);for(var p=this.tryLayoutDocument(t,e,n,r,o,s,l,u,c);d(p.linearNodeList,p.pages);)p.linearNodeList.forEach(function(t){t.resetXY()}),p=this.tryLayoutDocument(t,e,n,r,o,s,l,u,c);return p.pages},w.prototype.tryLayoutDocument=function(t,e,n,r,i,a,l,u,c,h){this.linearNodeList=[],t=this.docPreprocessor.preprocessDocument(t),t=this.docMeasure.measureDocument(t),this.writer=new s(new o(this.pageSize,this.pageMargins),this.tracker);var f=this;return this.writer.context().tracker.startTracking("pageAdded",function(){f.addBackground(i)}),this.addBackground(i),this.processNode(t),this.addHeadersAndFooters(a,l),null!=c&&this.addWatermark(c,e,r),{pages:this.writer.context().pages,linearNodeList:this.linearNodeList}},w.prototype.addBackground=function(t){var e=(y(t)?t:function(){return t})(this.writer.context().page+1);if(e){var n=this.writer.context().getCurrentPage().pageSize;this.writer.beginUnbreakableBlock(n.width,n.height),e=this.docPreprocessor.preprocessDocument(e),this.processNode(this.docMeasure.measureDocument(e)),this.writer.commitUnbreakableBlock(0,0),this.writer.context().hasBackground=!0}},w.prototype.addStaticRepeatable=function(t,e){this.addDynamicRepeatable(function(){return JSON.parse(JSON.stringify(t))},e)},w.prototype.addDynamicRepeatable=function(t,e){for(var n=0,r=this.writer.context().pages.length;n1;)l.push({fontSize:h}),(r=s.sizeOfString(e.text,l)).width>o?h=(u+(c=h))/2:r.width0;r--)n.push(t);return n}(t._gap);r&&(n-=(r.length-1)*t._gap),l.buildColumnWidths(e,n);var i=this.processRow(e,e,r);m(t.positions,i.positions)},w.prototype.processRow=function(t,e,n,r,i,a){var o=this,s=[],l=[];return this.tracker.auto("pageChanged",function(t){for(var e,n=0,r=s.length;n1)for(var d=1;dt?n[t]:0}function c(t,e){if(t.rowSpan&&t.rowSpan>1){var n=i+t.rowSpan-1;if(n>=r.length)throw"Row span for column "+e+" (with indexes starting from 0) exceeded row count";return r[n][e]}return null}},w.prototype.processList=function(t,e){var n,r=this,i=t?e.ol:e.ul,a=e._gapSize;this.writer.context().addMargin(a.width),this.tracker.auto("lineAdded",function(t){if(n){var e=n;if(n=null,e.canvas){var i=e.canvas[0];p(i,-e._minWidth,0),r.writer.addVector(i)}else if(e._inlines){var a=new c(r.pageSize.width);a.addInline(e._inlines[0]),a.x=-e._minWidth,a.y=t.getAscenderHeight()-a.getAscenderHeight(),r.writer.addLine(a,!0)}}},function(){i.forEach(function(t){n=t.listMarker,r.processNode(t),m(e.positions,t.positions)})}),this.writer.context().addMargin(-a.width)},w.prototype.processTable=function(t){var e=new u(t);e.beginTable(this.writer);for(var n=t.table.heights,r=0,i=t.table.body.length;r0&&n.hasEnoughSpaceForInline(t._inlines[0]);){var i=t._inlines.shift();if(!i.noWrap&&i.text.length>1&&i.width>n.maxWidth){var a=i.width/i.text.length,o=Math.floor(n.maxWidth/a);if(o<1&&(o=1),o=0;r--){var i=t[r],a=e.styleStack.styleDictionary[i];for(var o in a)a.hasOwnProperty(o)&&(n[o]=a[o])}return n}(a);o&&(i=n(o,i)),o.margin&&(i=r(o.margin))}i=n(t,i),t.margin&&(i=r(t.margin));return void 0===i[0]&&void 0===i[1]&&void 0===i[2]&&void 0===i[3]?null:i}(),t.columns)return n(e.measureColumns(t));if(t.stack)return n(e.measureVerticalContainer(t));if(t.ul)return n(e.measureUnorderedList(t));if(t.ol)return n(e.measureOrderedList(t));if(t.table)return n(e.measureTable(t));if(void 0!==t.text)return n(e.measureLeaf(t));if(t.toc)return n(e.measureToc(t));if(t.image)return n(e.measureImage(t));if(t.canvas)return n(e.measureCanvas(t));if(t.qr)return n(e.measureQr(t));throw"Unrecognized document structure: "+JSON.stringify(t,c)});function n(t){var e=t._margin;return e&&(t._minWidth+=e[0]+e[2],t._maxWidth+=e[0]+e[2]),t}},d.prototype.convertIfBase64Image=function(t){if(/^data:image\/(jpeg|jpg|png);base64,/.test(t.image)){var e="$$pdfmake$$"+this.autoImageIndex++;this.images[e]=t.image,t.image=e}},d.prototype.measureImage=function(t){this.images&&this.convertIfBase64Image(t);var e=this.imageMeasure.measureImage(t.image);if(t.fit){var n=e.width/e.height>t.fit[0]/t.fit[1]?t.fit[0]/e.width:t.fit[1]/e.height;t._width=t._minWidth=t._maxWidth=e.width*n,t._height=e.height*n}else t._width=t._minWidth=t._maxWidth=t.width||e.width,t._height=t.height||e.height*t._width/e.width,s(t.maxWidth)&&t.maxWidtht._width&&(t._width=t._minWidth=t._maxWidth=t.minWidth,t._height=t._width*e.height/e.width),s(t.minHeight)&&t.minHeight>t._height&&(t._height=t.minHeight,t._width=t._minWidth=t._maxWidth=t._height*e.width/e.height);return t._alignment=this.styleStack.getProperty("alignment"),t},d.prototype.measureLeaf=function(t){t._textRef&&t._textRef._nodeRef.text&&(t.text=t._textRef._nodeRef.text);var e=this.styleStack.clone();e.push(t);var n=this.textTools.buildInlines(t.text,e);return t._inlines=n.items,t._minWidth=n.minWidth,t._maxWidth=n.maxWidth,t},d.prototype.measureToc=function(t){t.toc.title&&(t.toc.title=this.measureNode(t.toc.title));for(var e=[],n=t.toc.textStyle||{},r=t.toc.numberStyle||n,i=t.toc.textMargin||[0,0,0,0],a=0,o=t.toc._items.length;a=26?t((e/26>>0)-1):"")+"abcdefghijklmnopqrstuvwxyz"[e%26>>0]}(t-1)}function a(t){if(t<1||t>4999)return t.toString();var e,n=t,r={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},i="";for(e in r)for(;n>=r[e];)i+=e,n-=r[e];return i}var o;switch(n){case"none":o=null;break;case"upper-alpha":o=i(t).toUpperCase();break;case"lower-alpha":o=i(t);break;case"upper-roman":o=a(t);break;case"lower-roman":o=a(t).toLowerCase();break;case"decimal":default:o=t.toString()}if(null===o)return{};r&&(u(r)?(r[0]&&(o=r[0]+o),r[1]&&(o+=r[1]),o+=" "):o+=r+" ");var s={text:o},l=e.getProperty("markerColor");return l&&(s.color=l),{_inlines:this.textTools.buildInlines(s,e).items}},d.prototype.measureUnorderedList=function(t){var e=this.styleStack.clone(),n=t.ul;t.type=t.type||"disc",t._gapSize=this.gapSizeForList(),t._minWidth=0,t._maxWidth=0;for(var r=0,i=n.length;r0?e.length-1:0;return t._minWidth=i.min+t._gap*o,t._maxWidth=i.max+t._gap*o,t},d.prototype.measureTable=function(t){!function(t){t.table.widths||(t.table.widths="auto");if(o(t.table.widths))for(t.table.widths=[t.table.widths];t.table.widths.length1?(v(f,e,d.colSpan),u.push({col:e,span:d.colSpan,minWidth:d._minWidth,maxWidth:d._maxWidth})):(c._minWidth=Math.max(c._minWidth,d._minWidth),c._maxWidth=Math.max(c._maxWidth,d._maxWidth))),d.rowSpan&&d.rowSpan>1&&b(t.table,n,e,d.rowSpan)}}!function(){for(var e,n,r=0,i=u.length;r0)for(e=s/a.span,n=0;n0)for(e=l/a.span,n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;o="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,s=new e(3*t.length/4-o),i=o>0?t.length-4:t.length;var u=0;function h(t){s[u++]=t}for(n=0,r=0;n>16),h((65280&a)>>8),h(255&a);return 2===o?h(255&(a=c(t.charAt(n))<<2|c(t.charAt(n+1))>>4)):1===o&&(h((a=c(t.charAt(n))<<10|c(t.charAt(n+1))<<4|c(t.charAt(n+2))>>2)>>8&255),h(255&a)),s},t.fromByteArray=function(t){var e,n,i,a,o=t.length%3,s="";function l(t){return r.charAt(t)}for(e=0,i=t.length-o;e>18&63)+l(a>>12&63)+l(a>>6&63)+l(63&a);switch(o){case 1:s+=l((n=t[t.length-1])>>2),s+=l(n<<4&63),s+="==";break;case 2:s+=l((n=(t[t.length-2]<<8)+t[t.length-1])>>10),s+=l(n>>4&63),s+=l(n<<2&63),s+="="}return s}}(e)},function(t,e){(function(){e.OP=0,e.CL=1,e.CP=2,e.QU=3,e.GL=4,e.NS=5,e.EX=6,e.SY=7,e.IS=8,e.PR=9,e.PO=10,e.NU=11,e.AL=12,e.HL=13,e.ID=14,e.IN=15,e.HY=16,e.BA=17,e.BB=18,e.B2=19,e.ZW=20,e.CM=21,e.WJ=22,e.H2=23,e.H3=24,e.JL=25,e.JV=26,e.JT=27,e.RI=28,e.AI=29,e.BK=30,e.CB=31,e.CJ=32,e.CR=33,e.LF=34,e.NL=35,e.SA=36,e.SG=37,e.SP=38,e.XX=39}).call(this)},function(t,e){(function(){e.DI_BRK=0,e.IN_BRK=1,e.CI_BRK=2,e.CP_BRK=3,e.PR_BRK=4,e.pairTable=[[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4],[0,4,4,1,1,4,4,4,4,1,1,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,4,4,4,4,1,1,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[4,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,1,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,1,0,1,1,0,0,4,2,4,1,1,1,1,1,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,0,1,4,4,4,0,0,1,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[0,4,4,1,0,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,4,4,2,4,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,0,0,1,1,1,0,1,1,1,0,0,4,2,4,0,0,0,0,0,0],[1,4,4,1,1,1,4,4,4,1,1,1,1,1,1,1,1,1,1,1,4,2,4,1,1,1,1,1,1],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,1,1,1,1,0,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,1,1,0],[0,4,4,1,1,1,4,4,4,0,1,0,0,0,0,1,1,1,0,0,4,2,4,0,0,0,0,1,0],[0,4,4,1,1,1,4,4,4,0,0,0,0,0,0,0,1,1,0,0,4,2,4,0,0,0,0,0,1]]}).call(this)},function(t,e,n){"use strict";for(var r=[null,[[10,7,17,13],[1,1,1,1],[]],[[16,10,28,22],[1,1,1,1],[4,16]],[[26,15,22,18],[1,1,2,2],[4,20]],[[18,20,16,26],[2,1,4,2],[4,24]],[[24,26,22,18],[2,1,4,4],[4,28]],[[16,18,28,24],[4,2,4,4],[4,32]],[[18,20,26,18],[4,2,5,6],[4,20,36]],[[22,24,26,22],[4,2,6,6],[4,22,40]],[[22,30,24,20],[5,2,8,8],[4,24,44]],[[26,18,28,24],[5,4,8,8],[4,26,48]],[[30,20,24,28],[5,4,11,8],[4,28,52]],[[22,24,28,26],[8,4,11,10],[4,30,56]],[[22,26,22,24],[9,4,16,12],[4,32,60]],[[24,30,24,20],[9,4,16,16],[4,24,44,64]],[[24,22,24,30],[10,6,18,12],[4,24,46,68]],[[28,24,30,24],[10,6,16,17],[4,24,48,72]],[[28,28,28,28],[11,6,19,16],[4,28,52,76]],[[26,30,28,28],[13,6,21,18],[4,28,54,80]],[[26,28,26,26],[14,7,25,21],[4,28,56,84]],[[26,28,28,30],[16,8,25,20],[4,32,60,88]],[[26,28,30,28],[17,8,25,23],[4,26,48,70,92]],[[28,28,24,30],[17,9,34,23],[4,24,48,72,96]],[[28,30,30,30],[18,9,30,25],[4,28,52,76,100]],[[28,30,30,30],[20,10,32,27],[4,26,52,78,104]],[[28,26,30,30],[21,12,35,29],[4,30,56,82,108]],[[28,28,30,28],[23,12,37,34],[4,28,56,84,112]],[[28,30,30,30],[25,12,40,34],[4,32,60,88,116]],[[28,30,30,30],[26,13,42,35],[4,24,48,72,96,120]],[[28,30,30,30],[28,14,45,38],[4,28,52,76,100,124]],[[28,30,30,30],[29,15,48,40],[4,24,50,76,102,128]],[[28,30,30,30],[31,16,51,43],[4,28,54,80,106,132]],[[28,30,30,30],[33,17,54,45],[4,32,58,84,110,136]],[[28,30,30,30],[35,18,57,48],[4,28,56,84,112,140]],[[28,30,30,30],[37,19,60,51],[4,32,60,88,116,144]],[[28,30,30,30],[38,19,63,53],[4,28,52,76,100,124,148]],[[28,30,30,30],[40,20,66,56],[4,22,48,74,100,126,152]],[[28,30,30,30],[43,21,70,59],[4,26,52,78,104,130,156]],[[28,30,30,30],[45,22,74,62],[4,30,56,82,108,134,160]],[[28,30,30,30],[47,24,77,65],[4,24,52,80,108,136,164]],[[28,30,30,30],[49,25,81,68],[4,28,56,84,112,140,168]]],i=1,a=2,o=4,s=/^\d*$/,l=/^[A-Za-z0-9 $%*+\-./:]*$/,u=/^[A-Z0-9 $%*+\-./:]*$/,c=1,h=0,f=3,d=2,p=[],g=[-1],y=0,v=1;y<255;++y)p.push(v),g[v]=y,v=2*v^(v>=128?285:0);var b=[[]];for(y=0;y<30;++y){for(var m=b[y],w=[],x=0;x<=y;++x){var S=x6},P=function(t,e){var n,i,a,o=-8&(i=r[n=t],a=16*n*n+128*n+64,A(n)&&(a-=36),i[2].length&&(a-=25*i[2].length*i[2].length-10*i[2].length-55),a),s=r[t];return o-=8*s[0][e]*s[1][e]},E=function(t,e){switch(e){case i:return t<10?10:t<27?12:14;case a:return t<10?9:t<27?11:13;case o:return t<10?8:16;case 8:return t<10?8:t<27?10:12}},I=function(t,e,n){var r=P(t,n)-4-E(t,e);switch(e){case i:return 3*(r/10|0)+(r%10<4?0:r%10<7?1:2);case a:return 2*(r/11|0)+(r%11<6?0:1);case o:return r/8|0;case 8:return r/13|0}},T=function(t,e){switch(t){case i:return e.match(s)?e:null;case a:return e.match(l)?e.toUpperCase():null;case o:if("string"==typeof e){for(var n=[],r=0;r>6,128|63&u):u<65536?n.push(224|u>>12,128|u>>6&63,128|63&u):n.push(240|u>>18,128|u>>12&63,128|u>>6&63,128|63&u)}return n}return e}},O=function(t,e){for(var n=t.slice(0),r=t.length,i=e.length,a=0;a=0)for(var s=0;s=0;--a)i>>r+a&1&&(i^=n<>o&1}return t},R=function(t){for(var e=function(t){for(var e=0,n=0;n=5&&(e+=t[n]-5+3);for(n=5;n=4*r||t[n+1]>=4*r)&&(e+=40)}return e},n=t.length,r=0,i=0,a=0;a=u){for(s.push(l|t>>(e-=u));e>=8;)s.push(t>>(e-=8)&255);l=0,u=8}e>0&&(l|=(t&(1<>3);c=function(t,e,n){for(var r=[],i=t.length/e|0,a=0,o=e-t.length%e,s=0;s>l&1,a[t+s][e+l]=1};s(0,0,9,9,[127,65,93,93,93,65,383,0,64]),s(n-8,0,8,9,[256,127,65,93,93,93,65,127]),s(0,n-8,9,8,[254,130,186,186,186,130,254,0,0]);for(o=9;o>d++&1,a[o][n-11+h]=a[n-11+h][o]=1}return{matrix:i,reserved:a}}(e),f=h.matrix,d=h.reserved;if(function(t,e,n){for(var r=t.length,i=0,a=-1,o=r-1;o>=0;o-=2){6==o&&--o;for(var s=a<0?r-1:0,l=0;lo-2;--u)e[s][u]||(t[s][u]=n[i>>3]>>(7&~i)&1,++i);s+=a}a=-a}}(f,d,c),l<0){B(f,d,0),M(f,0,s,0);var p=0,g=R(f);for(B(f,d,0),l=1;l<8;++l){B(f,d,l),M(f,0,s,l);var y=R(f);g>y&&(g=y,p=l),B(f,d,l)}l=p}return B(f,d,l),M(f,0,s,l),f};function D(t,e){var n=[],r=e.background||"#fff",l=e.foreground||"#000",p=function(t,e){var n={numeric:i,alphanumeric:a,octet:o},r={L:c,M:h,Q:f,H:d},l=(e=e||{}).version||-1,p=r[(e.eccLevel||"L").toUpperCase()],g=e.mode?n[e.mode.toLowerCase()]:-1,y="mask"in e?e.mask:-1;if(g<0)g="string"==typeof t?t.match(s)?i:t.match(u)?a:o:o;else if(g!=i&&g!=a&&g!=o)throw"invalid or unsupported mode";if(null===(t=T(g,t)))throw"invalid data format";if(p<0||p>3)throw"invalid ECC level";if(l<0){for(l=1;l<=40&&!(t.length<=I(l,g,p));++l);if(l>40)throw"too large data for the Qr format"}else if(l<1||l>40)throw"invalid Qr version! should be between 1 and 40";if(-1!=y&&(y<0||y>8))throw"invalid mask";return F(t,l,g,p,y)}(t,e),g=p.length,y=Math.floor(e.fit?e.fit/g:5),v=g*y;n.push({type:"rect",x:0,y:0,w:v,h:v,lineWidth:0,color:r});for(var b=0;b0){var i=n.pages[0];if(i.xOffset=t,i.yOffset=e,r>1)if(void 0!==t||void 0!==e)i.height=n.getCurrentPage().pageSize.height-n.pageMargins.top-n.pageMargins.bottom;else{i.height=this.writer.context.getCurrentPage().pageSize.height-this.writer.context.pageMargins.top-this.writer.context.pageMargins.bottom;for(var a=0,o=this.repeatables.length;at.items.length?t.items.push(e):t.items.splice(n,0,e)}l.prototype.addLine=function(t,e,n){var r=t.getHeight(),i=this.context,a=i.getCurrentPage(),o=this.getCurrentPositionOnPage();return!(i.availableHeight0&&t.inlines[0].alignment,i=0;switch(r){case"right":i=e-n;break;case"center":i=(e-n)/2}if(i&&(t.x=(t.x||0)+i),"justify"===r&&!t.newLineForced&&!t.lastLineInParagraph&&t.inlines.length>1)for(var a=(e-n)/(t.inlines.length-1),o=1,s=t.inlines.length;o0)&&(void 0===t._x&&(t._x=t.x||0),t.x=n.x+t._x,t.y=n.y,this.alignImage(t),u(r,{type:"image",item:t},e),n.moveDown(t._height),i)},l.prototype.addQr=function(t,e){var n=this.context,r=n.getCurrentPage(),i=this.getCurrentPositionOnPage();if(!r||void 0===t.absolutePosition&&n.availableHeights.availableHeight)&&(t.items.forEach(function(i){switch(i.type){case"line":var u=function(t){var e=new r(t.maxWidth);for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(i.item);u.x=(u.x||0)+(e?t.xOffset||0:s.x),u.y=(u.y||0)+(n?t.yOffset||0:s.y),l.items.push({type:"line",item:u});break;case"vector":var c=a(i.item);o(c,e?t.xOffset||0:s.x,n?t.yOffset||0:s.y),l.items.push({type:"vector",item:c});break;case"image":var h=a(i.item);h.x=(h.x||0)+(e?t.xOffset||0:s.x),h.y=(h.y||0)+(n?t.yOffset||0:s.y),l.items.push({type:"image",item:h})}}),i||s.moveDown(t.height),!0)},l.prototype.pushContext=function(t,e){void 0===t&&(e=this.context.getCurrentPage().height-this.context.pageMargins.top-this.context.pageMargins.bottom,t=this.context.availableWidth),i(t)&&(t=new s({width:t,height:e},{left:0,right:0,top:0,bottom:0})),this.contextStack.push(this.context),this.context=t},l.prototype.popContext=function(){this.context=this.contextStack.pop()},l.prototype.getCurrentPositionOnPage=function(){return(this.contextStack[0]||this.context).getCurrentPosition()},t.exports=l},function(t,e,n){"use strict";var r=n(44),i=n(0).isFunction;function a(t){this.tableNode=t}a.prototype.beginTable=function(t){var e,n,i,a=this;e=this.tableNode,this.offsets=e._offsets,this.layout=e._layout,n=t.context().availableWidth-this.offsets.total,r.buildColumnWidths(e.table.widths,n),this.tableWidth=e._offsets.total+(i=0,e.table.widths.forEach(function(t){i+=t._calcWidth}),i),this.rowSpanData=function(){var t=[],e=0,n=0;t.push({left:0,rowSpan:0});for(var r=0,i=a.tableNode.table.body[0].length;r0&&u(e+s,r,0,i.border[0]),void 0!==i.border[2]&&u(e+s,r+o-1,2,i.border[2]);for(var l=0;l0&&u(e,r+l,1,i.border[1]),void 0!==i.border[3]&&u(e+a-1,r+l,3,i.border[3])}}function u(e,n,r,i){var a=t[e][n];a.border=a.border||{},a.border[r]=i}}(this.tableNode.table.body),this.drawHorizontalLine(0,t)},a.prototype.onRowBreak=function(t,e){var n=this;return function(){var t=n.rowPaddingTop+(n.headerRows?0:n.topLineWidth);e.context().availableHeight-=n.reservedAtBottom,e.context().moveDown(t)}},a.prototype.beginRow=function(t,e){this.topLineWidth=this.layout.hLineWidth(t,this.tableNode),this.rowPaddingTop=this.layout.paddingTop(t,this.tableNode),this.bottomLineWidth=this.layout.hLineWidth(t+1,this.tableNode),this.rowPaddingBottom=this.layout.paddingBottom(t,this.tableNode),this.rowCallback=this.onRowBreak(t,e),e.tracker.startTracking("pageChanged",this.rowCallback),this.dontBreakRows&&e.beginUnbreakableBlock(),this.rowTopY=e.context().y,this.reservedAtBottom=this.bottomLineWidth+this.rowPaddingBottom,e.context().availableHeight-=this.reservedAtBottom,e.context().moveDown(this.rowPaddingTop)},a.prototype.drawHorizontalLine=function(t,e,n){var r=this.layout.hLineWidth(t,this.tableNode);if(r){for(var a=r/2,o=null,s=this.tableNode.table.body,l=0,u=this.rowSpanData.length;l0){var g=s[t-1][l];d=g.border?g.border[3]:this.layout.defaultBorder}h=f||d}!o&&h&&(o={left:c.left,width:0}),h&&(o.width+=c.width||0);var y=(n||0)+a;h&&l!==u-1||o&&o.width&&(e.addVector({type:"line",x1:o.left,x2:o.left+o.width,y1:y,y2:y,lineWidth:r,lineColor:i(this.layout.hLineColor)?this.layout.hLineColor(t,this.tableNode):this.layout.hLineColor},!1,n),o=null)}e.context().moveDown(r)}},a.prototype.drawVerticalLine=function(t,e,n,r,a){var o=this.layout.vLineWidth(r,this.tableNode);0!==o&&a.addVector({type:"line",x1:t+o/2,x2:t+o/2,y1:e,y2:n,lineWidth:o,lineColor:i(this.layout.vLineColor)?this.layout.vLineColor(r,this.tableNode):this.layout.vLineColor},!1,!0)},a.prototype.endTable=function(t){this.cleanUpRepeatables&&(t.popFromRepeatables(),this.headerRepeatableHeight=null)},a.prototype.endRow=function(t,e,n){var r,a,o=this;e.tracker.stopTracking("pageChanged",this.rowCallback),e.context().moveDown(this.layout.paddingBottom(t,this.tableNode)),e.context().availableHeight+=this.reservedAtBottom;var s=e.context().page,l=e.context().y,u=function(){for(var e=[],n=0,r=0,i=o.tableNode.table.body[t].length;r0&&n--}return e.push({x:o.rowSpanData[o.rowSpanData.length-1].left,index:o.rowSpanData.length-1}),e}(),c=[],h=n&&n.length>0,f=this.tableNode.table.body;if(c.push({y0:this.rowTopY,page:h?n[0].prevPage:s}),h)for(a=0,r=n.length;a0&&!this.headerRows,b=v?0:this.topLineWidth,m=c[p].y0,w=c[p].y1;for(y&&(w+=this.rowPaddingBottom),e.context().page!=c[p].page&&(e.context().page=c[p].page,this.reservedAtBottom=0),a=0,r=u.length;a0)_=(x=f[t][k-1]).border?x.border[2]:this.layout.defaultBorder;if((S||_)&&this.drawVerticalLine(u[a].x,m-b,w+this.bottomLineWidth,u[a].index,e),a1))for(var T=1;T0&&this.rowSpanData[a].rowSpan--}this.drawHorizontalLine(t+1,e),this.headerRows&&t===this.headerRows-1&&(this.headerRepeatable=e.currentBlockToRepeatable()),this.dontBreakRows&&e.tracker.auto("pageChanged",function(){o.headerRows||!1===o.layout.hLineWhenBroken||o.drawHorizontalLine(t,e)},function(){e.commitUnbreakableBlock()}),!this.headerRepeatable||t!==this.rowsWithoutPageBreak-1&&t!==this.tableNode.table.body.length-1||(this.headerRepeatableHeight=this.headerRepeatable.height,e.commitUnbreakableBlock(),e.pushToRepeatables(this.headerRepeatable),this.cleanUpRepeatables=!0,this.headerRepeatable=null)},t.exports=a},function(t,e,n){(function(e){(function(){var r,i,a,o,s,l,u={}.hasOwnProperty;l=n(15),s=n(8),i=n(26),o=n(87),a=n(161),r=function(t){var r;function c(t){var e,n,r,i;if(this.options=null!=t?t:{},c.__super__.constructor.apply(this,arguments),this.version=1.3,this.compress=null==(n=this.options.compress)||n,this._pageBuffer=[],this._pageBufferStart=0,this._offsets=[],this._waiting=0,this._ended=!1,this._offset=0,this._root=this.ref({Type:"Catalog",Pages:this.ref({Type:"Pages",Count:0,Kids:[]})}),this.page=null,this.initColor(),this.initVector(),this.initFonts(),this.initText(),this.initImages(),this.info={Producer:"PDFKit",Creator:"PDFKit",CreationDate:new Date},this.options.info)for(e in r=this.options.info)i=r[e],this.info[e]=i;this._write("%PDF-"+this.version),this._write("%ÿÿÿÿ"),!1!==this.options.autoFirstPage&&this.addPage()}return function(t,e){for(var n in e)u.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(c,l.Readable),(r=function(t){var e,n,r;for(n in r=[],t)e=t[n],r.push(c.prototype[n]=e);return r})(n(162)),r(n(164)),r(n(166)),r(n(295)),r(n(297)),r(n(302)),c.prototype.addPage=function(t){var e;return null==t&&(t=this.options),this.options.bufferPages||this.flushPages(),this.page=new a(this,t),this._pageBuffer.push(this.page),(e=this._root.data.Pages.data).Kids.push(this.page.dictionary),e.Count++,this.x=this.page.margins.left,this.y=this.page.margins.top,this._ctm=[1,0,0,1,0,0],this.transform(1,0,0,-1,0,this.page.height),this.emit("pageAdded"),this},c.prototype.bufferedPageRange=function(){return{start:this._pageBufferStart,count:this._pageBuffer.length}},c.prototype.switchToPage=function(t){var e;if(!(e=this._pageBuffer[t-this._pageBufferStart]))throw new Error("switchToPage("+t+") out of bounds, current buffer covers pages "+this._pageBufferStart+" to "+(this._pageBufferStart+this._pageBuffer.length-1));return this.page=e},c.prototype.flushPages=function(){var t,e,n;for(n=this._pageBuffer,this._pageBuffer=[],this._pageBufferStart+=n.length,t=0,e=n.length;t0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,a=r.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,n=a,i=s,e.copy(n,i),s+=o.data.length,o=o.next;return a},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t){var r=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(r.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(r.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(143),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(7))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,a,o,s,l=1,u={},c=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){p(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){a.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(o="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&p(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(o+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;ne.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==e.INFLATE&&this.mode!==e.GUNZIP&&this.mode!==e.INFLATERAW&&this.mode!==e.UNZIP||s.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null)},c.prototype.write=function(t,e,n,r,i,a,o){return this._write(!0,t,e,n,r,i,a,o)},c.prototype.writeSync=function(t,e,n,r,i,a,o){return this._write(!1,t,e,n,r,i,a,o)},c.prototype._write=function(n,a,o,s,l,u,c,h){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==e.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===a,"must provide flush value"),this.write_in_progress=!0,a!==e.Z_NO_FLUSH&&a!==e.Z_PARTIAL_FLUSH&&a!==e.Z_SYNC_FLUSH&&a!==e.Z_FULL_FLUSH&&a!==e.Z_FINISH&&a!==e.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=t.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=h,this.strm.output=u,this.strm.next_out=c,this.flush=a,!n)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return r.nextTick(function(){f._process(),f._after()}),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=e.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,n,r,a,o){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(n>=-1&&n<=9,"invalid compression level"),i(r>=1&&r<=9,"invalid memlevel"),i(a===e.Z_FILTERED||a===e.Z_HUFFMAN_ONLY||a===e.Z_RLE||a===e.Z_FIXED||a===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(n,t,r,a,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,n,r,i,l){switch(this.level=t,this.windowBits=n,this.memLevel=r,this.strategy=i,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,this.mode!==e.GZIP&&this.mode!==e.GUNZIP||(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),this.mode!==e.DEFLATERAW&&this.mode!==e.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=o.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=c}).call(e,n(1).Buffer,n(11))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,n){"use strict";var r,i=n(34),a=n(155),o=n(89),s=n(90),l=n(156),u=0,c=1,h=3,f=4,d=5,p=0,g=1,y=-2,v=-3,b=-5,m=-1,w=1,x=2,S=3,_=4,k=0,C=2,A=8,P=9,E=15,I=8,T=286,O=30,L=19,B=2*T+1,M=15,R=3,F=258,D=F+R+1,z=32,N=42,U=69,W=73,G=91,V=103,j=113,H=666,q=1,Z=2,Y=3,X=4,K=3;function J(t,e){return t.msg=l[e],e}function Q(t){return(t<<1)-(t>4?9:0)}function $(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(i.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function et(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function nt(t,e){t.pending_buf[t.pending++]=e}function rt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var n,r,i=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-D?t.strstart-(t.w_size-D):0,u=t.window,c=t.w_mask,h=t.prev,f=t.strstart+F,d=u[a+o-1],p=u[a+o];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(n=e)+o]===p&&u[n+o-1]===d&&u[n]===u[a]&&u[++n]===u[a+1]){a+=2,n++;do{}while(u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&ao){if(t.match_start=e,o=r,r>=s)break;d=u[a+o-1],p=u[a+o]}}}while((e=h[e&c])>l&&0!=--i);return o<=t.lookahead?o:t.lookahead}function at(t){var e,n,r,a,l,u,c,h,f,d,p=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-D)){for(i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=n=t.hash_size;r=t.head[--e],t.head[e]=r>=p?r-p:0,--n;);for(e=n=p;r=t.prev[--e],t.prev[e]=r>=p?r-p:0,--n;);a+=p}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,h=t.strstart+t.lookahead,f=a,d=void 0,(d=u.avail_in)>f&&(d=f),n=0===d?0:(u.avail_in-=d,i.arraySet(c,u.input,u.next_in,d,h),1===u.state.wrap?u.adler=o(u.adler,c,d,h):2===u.state.wrap&&(u.adler=s(u.adler,c,d,h)),u.next_in+=d,u.total_in+=d,d),t.lookahead+=n,t.lookahead+t.insert>=R)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=R&&(t.ins_h=(t.ins_h<=R)if(r=a._tr_tally(t,t.strstart-t.match_start,t.match_length-R),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=R){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=R&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=R-1)),t.prev_length>=R&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-R,r=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-R),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,r-=16),a<1||a>P||n!==A||r<8||r>15||e<0||e>9||o<0||o>_)return J(t,y);8===r&&(r=9);var l=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=A,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*B),this.dyn_dtree=new i.Buf16(2*(2*O+1)),this.bl_tree=new i.Buf16(2*(2*L+1)),$(this.dyn_ltree),$(this.dyn_dtree),$(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(M+1),this.heap=new i.Buf16(2*T+1),$(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*T+1),$(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&e===u)return q;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,et(t,!1),0===t.strm.avail_out))return q;if(t.strstart-t.block_start>=t.w_size-D&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===f?(et(t,!0),0===t.strm.avail_out?Y:X):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),q)}),new lt(4,4,8,4,ot),new lt(4,5,16,8,ot),new lt(4,6,32,32,ot),new lt(4,4,16,16,st),new lt(8,16,32,32,st),new lt(8,16,128,128,st),new lt(8,32,128,256,st),new lt(32,128,258,1024,st),new lt(32,258,258,4096,st)],e.deflateInit=function(t,e){return ht(t,e,A,E,I,k)},e.deflateInit2=ht,e.deflateReset=ct,e.deflateResetKeep=ut,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?y:(t.state.gzhead=e,p):y},e.deflate=function(t,e){var n,i,o,l;if(!t||!t.state||e>d||e<0)return t?J(t,y):y;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===H&&e!==f)return J(t,0===t.avail_out?b:y);if(i.strm=t,n=i.last_flush,i.last_flush=e,i.status===N)if(2===i.wrap)t.adler=0,nt(i,31),nt(i,139),nt(i,8),i.gzhead?(nt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),nt(i,255&i.gzhead.time),nt(i,i.gzhead.time>>8&255),nt(i,i.gzhead.time>>16&255),nt(i,i.gzhead.time>>24&255),nt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),nt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(nt(i,255&i.gzhead.extra.length),nt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(nt(i,0),nt(i,0),nt(i,0),nt(i,0),nt(i,0),nt(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),nt(i,K),i.status=j);else{var v=A+(i.w_bits-8<<4)<<8;v|=(i.strategy>=x||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=z),v+=31-v%31,i.status=j,rt(i,v),0!==i.strstart&&(rt(i,t.adler>>>16),rt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),tt(t),o=i.pending,i.pending!==i.pending_buf_size));)nt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=W)}else i.status=W;if(i.status===W)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),tt(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexo&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=G)}else i.status=G;if(i.status===G)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),tt(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexo&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=V)}else i.status=V;if(i.status===V&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(nt(i,255&t.adler),nt(i,t.adler>>8&255),t.adler=0,i.status=j)):i.status=j),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,p}else if(0===t.avail_in&&Q(e)<=Q(n)&&e!==f)return J(t,b);if(i.status===H&&0!==t.avail_in)return J(t,b);if(0!==t.avail_in||0!==i.lookahead||e!==u&&i.status!==H){var m=i.strategy===x?function(t,e){for(var n;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(e===u)return q;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===f?(et(t,!0),0===t.strm.avail_out?Y:X):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:Z}(i,e):i.strategy===S?function(t,e){for(var n,r,i,o,s=t.window;;){if(t.lookahead<=F){if(at(t),t.lookahead<=F&&e===u)return q;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=R&&t.strstart>0&&(r=s[i=t.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=t.strstart+F;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=R?(n=a._tr_tally(t,1,t.match_length-R),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(et(t,!1),0===t.strm.avail_out))return q}return t.insert=0,e===f?(et(t,!0),0===t.strm.avail_out?Y:X):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?q:Z}(i,e):r[i.level].func(i,e);if(m!==Y&&m!==X||(i.status=H),m===q||m===Y)return 0===t.avail_out&&(i.last_flush=-1),p;if(m===Z&&(e===c?a._tr_align(i):e!==d&&(a._tr_stored_block(i,0,0,!1),e===h&&($(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,p}return e!==f?p:i.wrap<=0?g:(2===i.wrap?(nt(i,255&t.adler),nt(i,t.adler>>8&255),nt(i,t.adler>>16&255),nt(i,t.adler>>24&255),nt(i,255&t.total_in),nt(i,t.total_in>>8&255),nt(i,t.total_in>>16&255),nt(i,t.total_in>>24&255)):(rt(i,t.adler>>>16),rt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?p:g)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==N&&e!==U&&e!==W&&e!==G&&e!==V&&e!==j&&e!==H?J(t,y):(t.state=null,e===j?J(t,v):p):y},e.deflateSetDictionary=function(t,e){var n,r,a,s,l,u,c,h,f=e.length;if(!t||!t.state)return y;if(2===(s=(n=t.state).wrap)||1===s&&n.status!==N||n.lookahead)return y;for(1===s&&(t.adler=o(t.adler,e,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&($(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new i.Buf8(n.w_size),i.arraySet(h,e,f-n.w_size,n.w_size,0),e=h,f=n.w_size),l=t.avail_in,u=t.next_in,c=t.input,t.avail_in=f,t.next_in=0,t.input=e,at(n);n.lookahead>=R;){for(r=n.strstart,a=n.lookahead-(R-1);n.ins_h=(n.ins_h<=0;)t[e]=0}var u=0,c=1,h=2,f=29,d=256,p=d+1+f,g=30,y=19,v=2*p+1,b=15,m=16,w=7,x=256,S=16,_=17,k=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(p+2));l(I);var T=new Array(2*g);l(T);var O=new Array(512);l(O);var L=new Array(256);l(L);var B=new Array(f);l(B);var M,R,F,D=new Array(g);function z(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function N(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?O[t]:O[256+(t>>>7)]}function W(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function G(t,e,n){t.bi_valid>m-n?(t.bi_buf|=e<>m-t.bi_valid,t.bi_valid+=n-m):(t.bi_buf|=e<>>=1,n<<=1,--e>0;);return n>>>1}function H(t,e,n){var r,i,a=new Array(b+1),o=0;for(r=1;r<=b;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=j(a[s]++,s))}}function q(t){var e;for(e=0;e8?W(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Y(t,e,n,r){var i=2*e,a=2*n;return t[i]>1;n>=1;n--)X(t,a,n);for(i=l;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],X(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,a[2*i]=a[2*n]+a[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,a[2*n+1]=a[2*r+1]=i,t.heap[1]=i++,X(t,a,1),t.heap_len>=2;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,a,o,s,l=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(a=0;a<=b;a++)t.bl_count[a]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;np&&(a=p,g++),l[2*r+1]=a,r>u||(t.bl_count[a]++,o=0,r>=d&&(o=f[r-d]),s=l[2*r],t.opt_len+=s*(a+o),h&&(t.static_len+=s*(c[2*r+1]+o)));if(0!==g){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(r=t.bl_count[a];0!==r;)(i=t.heap[--n])>u||(l[2*i+1]!==a&&(t.opt_len+=(a-l[2*i+1])*l[2*i],l[2*i+1]=a),r--)}}(t,e),H(a,u,t.bl_count)}function Q(t,e,n){var r,i,a=-1,o=e[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=e[2*(r+1)+1],++s>=7;r0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return a;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return o;for(e=32;e=3&&0===t.bl_tree[2*E[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),l=t.opt_len+3+7>>>3,(u=t.static_len+3+7>>>3)<=l&&(l=u)):l=u=n+5,n+4<=l&&-1!==e?et(t,e,n,r):t.strategy===i||u===l?(G(t,(c<<1)+(r?1:0),3),K(t,I,T)):(G(t,(h<<1)+(r?1:0),3),function(t,e,n,r){var i;for(G(t,e-257,5),G(t,n-1,5),G(t,r-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(L[n]+d+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){var e;G(t,c<<1,3),V(t,x,I),16===(e=t).bi_valid?(W(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},function(t,e,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,n){"use strict";var r=n(34),i=n(89),a=n(90),o=n(158),s=n(159),l=0,u=1,c=2,h=4,f=5,d=6,p=0,g=1,y=2,v=-2,b=-3,m=-4,w=-5,x=8,S=1,_=2,k=3,C=4,A=5,P=6,E=7,I=8,T=9,O=10,L=11,B=12,M=13,R=14,F=15,D=16,z=17,N=18,U=19,W=20,G=21,V=22,j=23,H=24,q=25,Z=26,Y=27,X=28,K=29,J=30,Q=31,$=32,tt=852,et=592,nt=15;function rt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=S,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(tt),e.distcode=e.distdyn=new r.Buf32(et),e.sane=1,e.back=-1,p):v}function at(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,it(t)):v}function ot(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?v:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,at(t))):v}function st(t,e){var n,i;return t?(i=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=i,i.window=null,(n=ot(t,e))!==p&&(t.state=null),n):v}var lt,ut,ct=!0;function ht(t){if(ct){var e;for(lt=new r.Buf32(512),ut=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(u,t.lens,0,288,lt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,ut,0,t.work,{bits:5}),ct=!1}t.lencode=lt,t.lenbits=9,t.distcode=ut,t.distbits=5}function ft(t,e,n,i){var a,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(r.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),r.arraySet(o.window,e,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,e,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,Pt,2,0),st=0,lt=0,n.mode=_;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",n.mode=J;break}if((15&st)!==x){t.msg="unknown compression method",n.mode=J;break}if(lt-=4,St=8+(15&(st>>>=4)),0===n.wbits)n.wbits=St;else if(St>n.wbits){t.msg="invalid window size",n.mode=J;break}n.dmax=1<>8&1),512&n.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,n.check=a(n.check,Pt,2,0)),st=0,lt=0,n.mode=k;case k:for(;lt<32;){if(0===at)break t;at--,st+=tt[nt++]<>>8&255,Pt[2]=st>>>16&255,Pt[3]=st>>>24&255,n.check=a(n.check,Pt,4,0)),st=0,lt=0,n.mode=C;case C:for(;lt<16;){if(0===at)break t;at--,st+=tt[nt++]<>8),512&n.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,n.check=a(n.check,Pt,2,0)),st=0,lt=0,n.mode=A;case A:if(1024&n.flags){for(;lt<16;){if(0===at)break t;at--,st+=tt[nt++]<>>8&255,n.check=a(n.check,Pt,2,0)),st=0,lt=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&((dt=n.length)>at&&(dt=at),dt&&(n.head&&(St=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,tt,nt,dt,St)),512&n.flags&&(n.check=a(n.check,tt,dt,nt)),at-=dt,nt+=dt,n.length-=dt),n.length))break t;n.length=0,n.mode=E;case E:if(2048&n.flags){if(0===at)break t;for(dt=0;St=tt[nt+dt++],n.head&&St&&n.length<65536&&(n.head.name+=String.fromCharCode(St)),St&&dt>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=B;break;case O:for(;lt<32;){if(0===at)break t;at--,st+=tt[nt++]<>>=7<,lt-=7<,n.mode=Y;break}for(;lt<3;){if(0===at)break t;at--,st+=tt[nt++]<>>=1)){case 0:n.mode=R;break;case 1:if(ht(n),n.mode=W,e===d){st>>>=2,lt-=2;break t}break;case 2:n.mode=z;break;case 3:t.msg="invalid block type",n.mode=J}st>>>=2,lt-=2;break;case R:for(st>>>=7<,lt-=7<lt<32;){if(0===at)break t;at--,st+=tt[nt++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=J;break}if(n.length=65535&st,st=0,lt=0,n.mode=F,e===d)break t;case F:n.mode=D;case D:if(dt=n.length){if(dt>at&&(dt=at),dt>ot&&(dt=ot),0===dt)break t;r.arraySet(et,tt,nt,dt,it),at-=dt,nt+=dt,ot-=dt,it+=dt,n.length-=dt;break}n.mode=B;break;case z:for(;lt<14;){if(0===at)break t;at--,st+=tt[nt++]<>>=5,lt-=5,n.ndist=1+(31&st),st>>>=5,lt-=5,n.ncode=4+(15&st),st>>>=4,lt-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=J;break}n.have=0,n.mode=N;case N:for(;n.have>>=3,lt-=3}for(;n.have<19;)n.lens[Et[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},_t=s(l,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,_t){t.msg="invalid code lengths set",n.mode=J;break}n.have=0,n.mode=U;case U:for(;n.have>>16&255,bt=65535&At,!((yt=At>>>24)<=lt);){if(0===at)break t;at--,st+=tt[nt++]<>>=yt,lt-=yt,n.lens[n.have++]=bt;else{if(16===bt){for(Ct=yt+2;lt>>=yt,lt-=yt,0===n.have){t.msg="invalid bit length repeat",n.mode=J;break}St=n.lens[n.have-1],dt=3+(3&st),st>>>=2,lt-=2}else if(17===bt){for(Ct=yt+3;lt>>=yt)),st>>>=3,lt-=3}else{for(Ct=yt+7;lt>>=yt)),st>>>=7,lt-=7}if(n.have+dt>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=J;break}for(;dt--;)n.lens[n.have++]=St}}if(n.mode===J)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=J;break}if(n.lenbits=9,kt={bits:n.lenbits},_t=s(u,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,_t){t.msg="invalid literal/lengths set",n.mode=J;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},_t=s(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,_t){t.msg="invalid distances set",n.mode=J;break}if(n.mode=W,e===d)break t;case W:n.mode=G;case G:if(at>=6&&ot>=258){t.next_out=it,t.avail_out=ot,t.next_in=nt,t.avail_in=at,n.hold=st,n.bits=lt,o(t,ct),it=t.next_out,et=t.output,ot=t.avail_out,nt=t.next_in,tt=t.input,at=t.avail_in,st=n.hold,lt=n.bits,n.mode===B&&(n.back=-1);break}for(n.back=0;vt=(At=n.lencode[st&(1<>>16&255,bt=65535&At,!((yt=At>>>24)<=lt);){if(0===at)break t;at--,st+=tt[nt++]<>mt)])>>>16&255,bt=65535&At,!(mt+(yt=At>>>24)<=lt);){if(0===at)break t;at--,st+=tt[nt++]<>>=mt,lt-=mt,n.back+=mt}if(st>>>=yt,lt-=yt,n.back+=yt,n.length=bt,0===vt){n.mode=Z;break}if(32&vt){n.back=-1,n.mode=B;break}if(64&vt){t.msg="invalid literal/length code",n.mode=J;break}n.extra=15&vt,n.mode=V;case V:if(n.extra){for(Ct=n.extra;lt