Socket
Socket
Sign inDemoInstall

pdfjs

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfjs - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

16

lib/content/text.js

@@ -30,3 +30,3 @@ var PDFString = require('../objects/string')

var self = this, font = (opts.font ? this.doc.registerFont(opts.font) : this.doc.defaultFont).fromOpts(opts)
var words = str.toString().replace(/\r\n/, '\n').split(/ +|^|$/mg)
var words = str.toString().replace(/\t/g, ' ').replace(/\r\n/g, '\n').split(/ +|^|$/mg)
// if (words[0].match(/\.\!\?\,/) && this.contents.length)

@@ -67,4 +67,10 @@ // this.contents[this.contents.length - 1].content += words.shift()

// only a line break
if (line.length === 1 && line[0].word === '\n') {
page.cursor.y -= lineHeight * (self.opts.lineSpacing || 1)
return
}
// page break
if (page.spaceLeft < lineHeight) {
if (round(page.spaceLeft) < round(lineHeight)) {
var left = page.cursor.x

@@ -105,2 +111,3 @@ page = self.doc.pagebreak()

line.forEach(function(word, i) {
if (word.word === '\n') return
var str = (i > 0 && !word.isStartingWithPunctuation ? ' ' : '') + word.font.encode(word.word)

@@ -134,2 +141,3 @@ , size = word.opts.size || 10

wordSpacing = 0
if (word.word === '\n') line.push(word)
renderLine(line, width - spaceLeft, word.word === '\n')

@@ -231,2 +239,6 @@ spaceLeft = width

return line
}
function round(num) {
return Math.round(num * 100) / 100
}

6

lib/document.js

@@ -108,2 +108,4 @@ var PDFObject = require('./objects/object')

var self = this
this.objects = [this.catalog, this.pages.tree]
this.pagebreak()

@@ -238,4 +240,4 @@ this.render()

// TODO: improve ...
utftext += String.fromCharCode(Math.min(c, 0xff))
continue
// utftext += String.fromCharCode(Math.min(c, 0xff))
// continue

@@ -242,0 +244,0 @@ if (c < 128) {

@@ -14,2 +14,3 @@ var TTFFont = module.exports = require('ttfjs')

font.prop('Encoding', 'MacRomanEncoding')
doc.objects.push(font)

@@ -88,3 +89,3 @@ // widths array

// font file
var data = this.font.save()
var data = this.save()
, hex = asHex(data)

@@ -91,0 +92,0 @@

@@ -7,3 +7,3 @@ {

},
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/rkusa/pdfjs",

@@ -19,3 +19,3 @@ "keywords": ["pdf", "generator"],

"dependencies": {
"ttfjs": "0.1.x"
"ttfjs": "0.2.x"
},

@@ -22,0 +22,0 @@ "devDependencies": {

@@ -1,2 +0,2 @@

(function(e){if("function"==typeof bootstrap)bootstrap("pdfjs",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makePdfjs=e}else"undefined"!=typeof window?window.Pdfjs=e():global.Pdfjs=e()})(function(){var e,t,n,r,i;return function s(e,t,n){function r(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=t[o]={exports:{}};e[o][0].call(f.exports,function(t){var n=e[o][1][t];return r(n?n:t)},f,f.exports,s,e,t,n)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,n){t.exports=function(e){var t=new r(e);return this.contents.push(t),this};var r=function(e){this.op=e};r.prototype.render=function(e,t){e.contents.writeLine(this.op)}},{}],2:[function(e,t,n){function l(e,t){for(var n in e){var r=t[n];if(r===undefined||r===null)t[n]=e[n];else{switch(n){case"padding":r=c(r,{top:0,right:0,bottom:0,left:0});break;case"borderWidth":r=c(r,{top:null,right:null,bottom:null,left:null,inside:null,horizontal:null,vertical:null});break;default:continue}typeof r=="object"&&(t[n]=l(e[n],r))}}return t}function c(e,t){return typeof e=="object"?Array.isArray(e)?e.length===2?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:{top:e[0],right:e[1],bottom:e[2],left:e[3]}:l(t,e):{top:e,right:e,bottom:e,left:e}}function h(e,t,n,r){e.contents.writeLine("0 0 0 RG"),e.contents.writeLine(t+" w"),e.contents.writeLine(n[0]+" "+n[1]+" m "+r[0]+" "+r[1]+" l S"),e.contents.writeLine("")}t.exports=function(e,t){return this.contents.push(new s(this,e,t)),this};var r=e("../utils"),i={size:12,padding:{top:5,bottom:5,left:8,right:8},borderWidth:{top:null,bottom:null,left:null,right:null}},s=function(e,t,n){typeof t=="function"&&(n=t,t={}),this.doc=e.doc||e,this.opts=t,l(i,this.opts),this.rows=[],n.call(this,this)};s.prototype.tr=function(e,t){this.rows.push(new o(this,e,t))},s.prototype.render=function(e,t){var n=[],r=this,i=Math.max.apply(Math,this.rows.map(function(e){return e.cells.map(function(e,t){if(n[t]===undefined||e.width>n[t]&&!(e.opts.colspan>1))n[t]=e.width;return e.width}).reduce(function(e,t){return e+t},0)})),s=t;if(i>s){var o=s/n.length,u=[],a=0;for(var f=0,l=n.length;f<l;++f)n[f]<o?a+=o-n[f]:u.push(f);o+=a/u.length,u.forEach(function(e){n[e]=o})}var c=this.opts.width||s;if(c&&i<c){var o=c/n.length,h=[],p=0;for(var f=0,l=n.length;f<l;++f)n[f]<o&&h.push(f),p+=n[f];var d=(c-p)/h.length;h.forEach(function(e){n[e]+=d})}var v=e.cursor.x;for(var f=0;f<this.rows.length;++f){var m=e.cursor.y,g=this.rows[f],y=this.doc.startTransaction(),b=g.render(e,n);b===!1?(e.cursor.x=v,e.cursor.y=m,y.rollback(),g.allowBreak=pagebreak=!0,--f,this.opts.header===!0&&(e=this.doc.pagebreak(),m=e.cursor.y,b=this.rows[0].render(e,n))):y.commit(),e.cursor.x=v,e.cursor.y=m-b}};var o=function(e,t,n){typeof t=="function"&&(n=t,t={}),this.table=e,this.doc=e.doc,this.opts=l(e.opts,t),this.cells=[],this.allowBreak=!1,n.call(this,this)};Object.defineProperties(o.prototype,{isFirstRow:{enumerable:!0,get:function(){return this.table.rows.indexOf(this)===0}},isLastRow:{enumerable:!0,get:function(){return this.table.rows.indexOf(this)===this.table.rows.length-1}}}),o.prototype.td=function(e,t){var n=new f(this,e,t);return this.cells.push(n),n},o.prototype.render=function(e,t){var n=e.cursor.x,r=e.cursor.y,i=[],s=[],o=!1,u=0;for(var a=0,f=this.cells.length;a<f;++a){var l=this.cells[a],c=t[u++];if(l.opts.colspan>1){for(var h=u,p=u+l.opts.colspan-1;h<p;++h)c+=t[h]||0;u+=l.opts.colspan-1}!function(t,n,r){s.push(function(i){l.drawBorder(e,t,n,r,i)})}(e.cursor.x,e.cursor.y,c);var d=l.borderLeftWidth+l.opts.padding.left,v=l.opts.padding.right+l.borderRightWidth,m=c-d-v;e.cursor.x+=d,e.cursor.y-=l.borderTopWidth+l.opts.padding.top;var g=this.doc.pages.pages.indexOf(e);l.render(e,m);var y=g+1<this.doc.pages.count?r-this.doc.padding.bottom:r-e.cursor.y+l.opts.padding.bottom+l.borderBottomWidth;for(var h=g+1,p=this.doc.pages.count;h<p;++h)y+=this.doc.height-this.doc.padding.top-this.doc.pages.pages[h].cursor.y;i.push(y),e.cursor.y=r,e.cursor.x+=m+v;if(this.doc.cursor!==e&&!this.allowBreak)return!1}var y=Math.max.apply(Math,i);return s.forEach(function(e){e(y)}),y};var u=e("./text").Text,a=e("../fragment"),f=function(e,t,n){n||(n={}),this.row=e,this.doc=e.doc,this.opts=l(e.opts,n),t instanceof a?(this.content=t,this.contents=t.prepared):(this.content=new a(this.doc),typeof t=="function"?t.call(this.content,this.content):this.content.text(t,this.opts)),this.innerWidth=this.content.maxWidth,this.innerHeight=this.content.minHeight,this.isFirstColumn=this.row.cells.length===0,this.isLastColumn=!0,this.isFirstColumn||(this.row.cells[this.row.cells.length-1].isLastColumn=!1)};f.prototype.render=function(e,t){this.content.render(e,t)},f.prototype.drawBorder=function(e,t,n,r,i,s,o){if(n-this.doc.padding.bottom<i){var u=i-n+this.doc.padding.bottom,a=this.doc.pages.pages.indexOf(e);this.drawBorder(e,t,n,r,n-this.doc.padding.bottom,!0,!1);while(u>0)e=this.doc.pages.pages[++a],u>this.doc.innerHeight?(i=this.doc.innerHeight,this.drawBorder(e,this.doc.padding.left,this.doc.height-this.doc.padding.top,r,i,!0,!0)):(i=u,this.drawBorder(e,this.doc.padding.left,this.doc.height-this.doc.padding.top,r,i,!1,!0)),u-=i;return}var f;this.borderBottomWidth>0&&!s&&h(e,f=this.borderBottomWidth,[t-f/2,n-i+f/2],[t+r,n-i+f/2]),this.borderTopWidth>0&&!o&&h(e,f=this.borderTopWidth,[t-f/2,n],[t+r,n]);var l=n-i;l<this.doc.padding.bottom&&(l=this.doc.padding.bottom),this.borderRightWidth>0&&h(e,f=this.borderRightWidth,[t+r-f/2,l],[t+r-f/2,n-f/2]),this.borderLeftWidth>0&&h(e,f=this.borderLeftWidth,[t,n+f/2],[t,l])},Object.defineProperties(f.prototype,{width:{enumerable:!0,get:function(){return this.borderLeftWidth+this.opts.padding.left+this.innerWidth+this.opts.padding.right+this.borderRightWidth}},height:{enumerable:!0,get:function(){return this.borderTopWidth+this.opts.padding.top+this.innerHeight+this.opts.padding.bottom+this.borderBottomWidth}}}),Object.defineProperties(f.prototype,{borderTopWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.top||(this.row.isFirstRow?0:e.horizontal||e.inside||0)}},borderRightWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.right||(this.isLastColumn?0:e.vertical||e.inside||0)}},borderBottomWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.bottom||(this.row.isLastRow?0:e.horizontal||e.inside||0)}},borderLeftWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.left||(this.isFirstColumn?0:e.vertical||e.inside||0)}}})},{"../fragment":7,"../utils":17,"./text":3}],3:[function(e,t,n){var r=e("../objects/string"),i=e("../utils");t.exports=function(e,t){var n=new s(this,t);return typeof e=="function"?e.call(n,n.textFn):n.text(e),this.contents.push(n),this};var s=t.exports.Text=function(e,t){this.doc=e,this.opts=t||{},this.contents=[],this.textFn=this.text.bind(this),this.textFn.br=this.text.br.bind(this),this.textFn.pageNumber=this.text.pageNumber.bind(this),this.textFn.opts=this.opts};s.prototype.text=function(t,n){n=i.extend(n||{},this.opts);var r=this,s=(n.font?this.doc.registerFont(n.font):this.doc.defaultFont).fromOpts(n),u=t.replace(/\r\n/,"\n").split(/ +|^|$/mg);return u.forEach(function(e){if(!e.length)return;s.use(e),r.contents.push(new o(e,s,n))}),this.textFn},s.prototype.text.br=function(){return this.contents.push(new o("\n",this.opts.font?this.doc.registerFont(opts.font):this.doc.defaultFont.regular,{})),this.textFn},s.prototype.text.pageNumber=function(){return this.contents.push(new o(function(){return this.pages.count}.bind(this.doc.doc||this.doc),this.opts.font?this.doc.registerFont(opts.font):this.doc.defaultFont.regular,{})),this.textFn},s.prototype.render=function(e,t){function l(i,s,o){var u=Math.max.apply(Math,i.map(function(e){return e.height}));if(e.spaceLeft<u){var l=e.cursor.x;e=n.doc.pagebreak(),e.cursor.x=l,a=undefined}e.cursor.y-=u;var c=t-s,l=e.cursor.x,h=i.length,p="";e.contents.writeLine("BT");switch(n.opts.align){case"right":l+=c;break;case"center":l+=t/2-(t-c)/2;break;case"justify":if(o&&100*c/t>20)break;var d=c/(h-1);e.contents.writeLine(d+" Tw")}e.contents.writeLine(l+" "+e.cursor.y+" Td"),i.forEach(function(t,n){var i=(n>0&&!t.isStartingWithPunctuation?" ":"")+t.font.encode(t.word),s=t.opts.size||10;if(a!==t.font||f!==s)p.length&&(e.contents.writeLine((new r(p)).toHexString()+" Tj"),p=""),e.contents.writeLine([t.font.id,s,"Tf"].join(" ")),a=t.font,f=s;p+=i}),p.length&&(e.contents.writeLine((new r(p)).toHexString()+" Tj"),p=""),e.contents.writeLine("ET"),e.cursor.y-=u*((n.opts.lineSpacing||1)-1)}var n=this,i=t,s=this.contents.length-1,o=[],n=this,a,f;this.contents.forEach(function(e,n){var r=e.width,s=!o.length||e.isStartingWithPunctuation?0:e.spacing;if(e.word==="\n"||o.length>0&&i-(r+s)<0){s=0,l(o,t-i,e.word==="\n"),i=t,o=new u;if(e.word==="\n")return}i-=r+s,o.push(e)}),o.length&&l(o,t-i,!0)},Object.defineProperties(s.prototype,{maxWidth:{enumerable:!0,get:function(){return this.contents.map(function(e,t){return e.width+(t===0?e.spacing:0)}).reduce(function(e,t){return e+t},0)}},minHeight:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.height}))}}});var o=function(e,t,n){this._word=e,this.font=t,this.opts=n||{},Object.defineProperty(this,"word",{enumerable:!0,get:function(){return this.toString()}})};Object.defineProperties(o.prototype,{width:{enumerable:!0,get:function(){return this.font.font.stringWidth(this.word,this.opts.size||10)}},height:{enumerable:!0,get:function(){return this.font.font.lineHeight(this.opts.size||10,!0)}},spacing:{enumerable:!0,get:function(){return this.font.font.stringWidth(" ",this.opts.size||10)}},isStartingWithPunctuation:{enumerable:!0,get:function(){return this.word[0].match(/\.|\!|\?|,/)!==null}}}),o.prototype.toString=function(){if(typeof this._word=="function"){var e=this._word().toString();return this.font.use(e),e}return this._word};var u=function(){var e=[];return Object.defineProperty(e,"lineHeight",{enumerable:!0,get:function(){return Math.max.apply(Math,this.map(function(e){return e.height}))}}),e}},{"../objects/string":14,"../utils":17}],4:[function(e,t,n){var r=e("./objects/object"),i=e("./pages"),s=e("./font"),o=e("./fonts/ttf"),u=e("./objects/name"),a=e("./utils"),f=t.exports=function p(e){this.version=1.7,this.objects=[],this.nextObjId=1,this.fonts=[],this.subsets=[],this.defaultFont=this.registerFont(e),p.super_.call(this,this),this.height=792,this.catalog=this.createObject("Catalog"),this.pages=new i(this),this.catalog.addProperty("Pages",this.pages.toReference()),this.areas={header:null,footer:null}},l=e("./fragment");a.inherits(f,l),f.Font=s,["header","footer"].forEach(function(e){f.prototype[e]=function(t,n){return typeof t!="object"&&(n=t,t={}),this.areas[e]=new l(this,t),typeof n=="function"?n.call(this.areas[e],this.areas[e]):this.areas[e].text(n,t),this}}),f.prototype.registerFont=function(e){var t;if((t=this.fonts.indexOf(e))>-1)return this.subsets[t];var n=this.fonts.push(e);return this.subsets.push(e.subset(this,n)),this.subsets[n-1]},f.prototype.createObject=function(e){var t=new r(this.nextObjId++,0);return e&&t.addProperty("Type",e),this.objects.push(t),t},f.prototype.startTransaction=function(){return new c(this)},f.prototype.pagebreak=function(){var e=this.cursor=this.pages.addPage();this.areas.header&&(this.areas.header.height=0,this.areas.header.render(e,this.innerWidth),this.areas.header.height=this.height-e.cursor.y-this.opts.padding.top);if(this.areas.footer){var t=this.areas.footer,n=this.startTransaction(),r=e.cursor.y;t.height=0,t.render(e,this.innerWidth);var i=r-e.cursor.y;n.rollback(),e.cursor.y=this.padding.bottom+i,t.render(e,this.innerWidth),e.cursor.y=r,t.height=i}return e},f.prototype.toDataURL=function(){return"data:application/pdf;base64,"+h.encode(this.toString())},f.prototype.toString=function(){var e=this;this.pagebreak(),this.render(),this.subsets.forEach(function(t){t.embed(e)});var t="",n=[],r;return t+="%PDF-"+this.version.toString()+"\n",t+="%ÿÿÿÿ\n",t+="\n",this.objects.forEach(function(e){n.push(t.length),t+=e.toString()+"\n\n"}),r=t.length,t+="xref\n",t+="0 "+(this.objects.length+1)+"\n",t+="0000000000 65535 f \n",n.forEach(function(e){t+="0000000000".substr(e.toString().length)+e+" 00000 n \n"}),t+="trailer\n",t+="<<\n",t+=" /Size "+(this.objects.length+1)+"\n",t+=" /Root "+this.catalog.toReference().toString()+"\n",t+=">>\n",t+="startxref\n",t+=r+"\n",t+="%%EOF",t};var c=function(e){this.doc=e,this.page=e.pages.count-1,this.length=e.cursor.contents.content.length,this.y=e.cursor.cursor.y};c.prototype.rollback=function(){if(this.page<this.doc.pages.count-1){for(var e=this.doc.pages.count-1;e>this.page;--e)this.doc.pages.removePageAt(e);this.doc.cursor=this.doc.pages.pages[this.page]}this.length<this.doc.cursor.contents.content.length&&(this.doc.cursor.contents.content=this.doc.cursor.contents.content.slice(0,this.length)),this.doc.cursor.cursor.y=this.y},c.prototype.commit=function(){};var h={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=h._utf8_encode(e);while(f<e.length)n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),s=n>>2,o=(n&3)<<4|r>>4,u=(r&15)<<2|i>>6,a=i&63,isNaN(r)?u=a=64:isNaN(i)&&(a=64),t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t}}},{"./font":5,"./fonts/ttf":6,"./fragment":7,"./objects/name":10,"./objects/object":11,"./pages":16,"./utils":17}],5:[function(e,t,n){function f(e){var t;return e.bold===!0?e.italic===!0?"boldItalic":"bold":e.light===!0?e.italic===!0?"lightItalic":"light":e.italic===!0?"italic":"regular"}var r=e("./fonts/ttf"),i=e("./objects/name"),s=e("fs"),o=["regular","italic","bold","boldItalic","light","lightItalic"],u=t.exports=function(e){"regular"in e||(e={regular:e});var t=this;this.subsets={},o.forEach(function(n){if(n in e){if(!(e[n]instanceof ArrayBuffer||e[n]instanceof Buffer))throw new Error("Property `"+n+"` must be a Buffer or a Arraybuffer.");t[n]=new r(e[n]),t.subsets[n]=t[n].subset()}})};u.prototype.subset=function(e,t){return new a(e,this,t)};var a=function(e,t,n){var r=this,s=1;o.forEach(function(o){if(!(o in t))return;r[o]=t[o].subset(),r[o].id=new i("F"+n+"-"+s++),r[o].object=e.createObject("Font"),r[o].use(" ")})};a.prototype.addTo=function(e){var t=this;o.forEach(function(n){if(!(n in t)||!t[n].isUsed)return;e.fonts.add(t[n].id,t[n].toReference())})},a.prototype.fromOpts=function(e){var t=f(e);if(t in this)return this[t];throw new Error("Font for `"+t+"` not provided.")},a.prototype.embed=function(e){var t=this;o.forEach(function(n){if(!(n in t)||!t[n].isUsed)return;t[n].embed(e)})}},{"./fonts/ttf":6,"./objects/name":10,fs:18}],6:[function(e,t,n){function u(e){return e<16?"0"+e.toString(16):e.toString(16)}function a(e){var t=new Uint8Array(e),n="";for(var r=0,i=e.byteLength;r<i;++r)n+=u(t[r]);return n}var r=t.exports=e("ttfjs"),i=e("../objects/array"),s=e("../objects/stream"),o=r.Subset.prototype.embed;r.Subset.prototype.embed=function(e){o.call(this);var t=this.object;t.prop("Subtype","TrueType"),t.prop("BaseFont",this.font.fontName),t.prop("Encoding","MacRomanEncoding");var n=e.createObject(),r=[],u=this.cmap();for(var f in u){if(f<32)continue;var l=u[f];r.push(Math.round(this.font.tables.hmtx.metrics[l]*this.font.scaleFactor))}n.content=new i(r),t.prop("Widths",n.toReference()),t.prop("FirstChar",32),t.prop("LastChar",r.length>222?225:r.length+33-1);var c=e.createObject("FontDescriptor");c.prop("FontName",this.font.fontName),c.prop("Flags",this.font.flags),c.prop("FontBBox",new i(this.font.bbox)),c.prop("ItalicAngle",this.font.italicAngle),c.prop("Ascent",this.font.ascent),c.prop("Descent",this.font.descent),c.prop("CapHeight",this.font.capHeight),c.prop("StemV",this.font.stemV),t.prop("FontDescriptor",c.toReference());var h=new s(e.createObject());h.writeLine("/CIDInit /ProcSet findresource begin"),h.writeLine("12 dict begin"),h.writeLine("begincmap"),h.writeLine("/CIDSystemInfo <<"),h.writeLine(" /Registry (Adobe)"),h.writeLine(" /Ordering (UCS)"),h.writeLine(" /Supplement 0"),h.writeLine(">> def"),h.writeLine("/CMapName /Adobe-Identity-UCS def"),h.writeLine("/CMapType 2 def"),h.writeLine("1 begincodespacerange"),h.writeLine("<00><ff>"),h.writeLine("endcodespacerange");var u=this.subset,p=[];for(var f in u){p.length>=100&&(h.writeLine(p.length+" beginbfchar"),p.forEach(function(e){h.writeLine(e)}),h.writeLine("endbfchar"),p=[]);var d=("0000"+u[f].toString(16)).slice(-4),f=(+f).toString(16);p.push("<"+f+"><"+d+">")}p.length&&(h.writeLine(p.length+" beginbfchar"),p.forEach(function(e){h.writeLine(e)}),h.writeLine("endbfchar")),h.writeLine("endcmap"),h.writeLine("CMapName currentdict /CMap defineresource pop"),h.writeLine("end"),h.writeLine("end"),t.prop("ToUnicode",h.toReference());var v=this.font.save(),m=a(v),g=new s(e.createObject());g.object.prop("Length",m.length),g.object.prop("Length1",v.byteLength),g.object.prop("Filter","ASCIIHexDecode"),g.content=m+"\n",c.prop("FontFile2",g.toReference())},Object.defineProperty(r.Subset.prototype,"isUsed",{enumerable:!0,get:function(){return this.pos>33}}),r.Subset.prototype.toReference=function(){return this.object.toReference()}},{"../objects/array":8,"../objects/stream":13,ttfjs:31}],7:[function(e,t,n){var r=t.exports=function(e,t){this.opts=t||{},this.doc=e,this.width=this.opts.width||612,this.opts.padding||(this.opts.padding={top:20,right:40,bottom:20,left:40}),this.padding=new i(this),this.defaultFont=this.doc.defaultFont,this.areas={},this.contents=[]},i=function(e){this.doc=e};Object.defineProperties(i.prototype,{left:{enumerable:!0,get:function(){return this.doc.opts.padding.left}},right:{enumerable:!0,get:function(){return this.doc.opts.padding.right}},top:{enumerable:!0,get:function(){return this.doc.opts.padding.top+(this.doc.areas.header?this.doc.areas.header.height||0:0)}},bottom:{enumerable:!0,get:function(){return this.doc.opts.padding.bottom+(this.doc.areas.footer?this.doc.areas.footer.height||0:0)}}}),Object.defineProperties(r.prototype,{innerWidth:{enumerable:!0,get:function(){return this.width-this.padding.right-this.padding.left}},innerHeight:{enumerable:!0,get:function(){return this.height-this.padding.top-this.padding.bottom}},maxWidth:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.maxWidth}))}},minHeight:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.minHeight}))}}}),r.prototype.pagebreak=function(){return this.doc.pagebreak()},r.prototype.render=function(e,t){var n=this;this.contents.forEach(function(e){e.render(n.doc.cursor,t||n.innerWidth)})},r.prototype.registerFont=function(e){return this.doc.registerFont(e)},r.prototype.createObject=function(e){return this.doc.createObject(e)},r.prototype.text=e("./content/text"),r.prototype.table=e("./content/table"),r.prototype.op=e("./content/operation"),r.prototype.fragment=function(e,t){typeof e=="function"&&(t=e,e={});var n=new r(this,e);return t.call(n,n),this.contents.push(n),this}},{"./content/operation":1,"./content/table":2,"./content/text":3}],8:[function(e,t,n){var r=t.exports=function(e){return e||(e=[]),e.toString=function(){return"["+this.map(function(e){return e.toString()}).join(" ")+"]"},e}},{}],9:[function(e,t,n){var r=e("./name"),i=t.exports=function(e){this.dictionary={};if(e)for(var t in e)this.add(t,e[t])};i.prototype.add=function(e,t){e=new r(e),typeof t=="string"&&(t=new r(t)),this.dictionary[e]=t},i.prototype.toString=function(){var e=this;return"<<\n"+Object.keys(this.dictionary).map(function(t){return t.toString()+" "+e.dictionary[t].toString()}).join("\n").replace(/^/gm," ")+"\n"+">>"},Object.defineProperty(i.prototype,"length",{get:function(){return Object.keys(this.dictionary).length},enumerable:!0})},{"./name":10}],10:[function(e,t,n){var r=t.exports=function(e){if(!e)throw new Error("A Name cannot be undefined");if(e instanceof r)return e;e=e.toString();if(e.match(/[\x00\x09\x0A\x0C\x0D\x20]/))throw new Error("A Name mustn't contain white-space characters");if(e.match(/[\(\)<>\[\]\{\}\/\%]/))throw new Error("A Name mustn't contain delimiter characters");this.name=e};r.prototype.toString=function(){return"/"+this.name}},{}],11:[function(e,t,n){var r=e("./reference"),i=e("./dictionary"),s=t.exports=function(e,t){this.id=e,this.rev=t||0,this.properties=new i,this.reference=new r(this),this.content=null};s.prototype.addProperty=s.prototype.prop=function(e,t){this.properties.add(e,t)},s.prototype.toReference=function(){return this.reference},s.prototype.toString=function(){var e=this;return this.id.toString()+" "+this.rev+" obj\n"+(this.properties.length?this.properties.toString()+"\n":"")+(this.content!==null?this.content.toString()+"\n":"")+"endobj"}},{"./dictionary":9,"./reference":12}],12:[function(e,t,n){var r=t.exports=function(e){this.object=e};r.prototype.toString=function(){return this.object.id+" "+this.object.rev+" R"}},{}],13:[function(e,t,n){var r=e("./name"),i=t.exports=function(e){e.content=this,this.object=e,this.content=""};i.prototype.writeLine=function(e){this.content+=e+"\n",this.object.prop("Length",this.content.length)},i.prototype.toReference=function(){return this.object.toReference()},i.prototype.toString=function(){return"stream\n"+this.content+"endstream"}},{"./name":10}],14:[function(e,t,n){var r=t.exports=function(e){this.str=e};r.prototype.toLiteralString=function(){return"("+this.str.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")+")"},r.prototype.toHexString=function(){var e=this;return"<"+function(){var t=[];for(var n=0,r=e.str.length;n<r;++n)t.push(e.str.charCodeAt(n).toString(16));return t}().join("")+">"},r.prototype.toString=function(){return this.toHexString()}},{}],15:[function(e,t,n){var r=e("./objects/stream"),i=e("./objects/dictionary"),s=e("./objects/array"),o=e("./objects/name"),u=t.exports=function(e,t){this.doc=e,this.object=this.doc.createObject("Page"),this.contents=new r(e.createObject()),this.fonts=new i({}),this.pageNumber=1,this.cursor={y:this.doc.height-this.doc.opts.padding.top,x:this.doc.padding.left},this.object.addProperty("Parent",t.toReference()),this.object.addProperty("Contents",this.contents.toReference()),this.object.addProperty("Resources",new i({ProcSet:new s([new o("PDF"),new o("Text"),new o("ImageB"),new o("ImageC"),new o("ImageI")]),Font:this.fonts}))};Object.defineProperties(u.prototype,{spaceLeft:{enumerable:!0,get:function(){return this.cursor.y-this.doc.padding.bottom}}}),u.prototype.toReference=function(){return this.object.toReference()}},{"./objects/array":8,"./objects/dictionary":9,"./objects/name":10,"./objects/stream":13}],16:[function(e,t,n){var r=e("./objects/array"),i=e("./page"),s=t.exports=function(e){this.doc=e,this.tree=this.doc.createObject("Pages"),this.pages=[],this.kids=new r,this.tree.addProperty("MediaBox",new r([0,0,e.width,e.height])),this.tree.addProperty("Kids",this.kids),this.tree.addProperty("Count",this.count)};Object.defineProperty(s.prototype,"count",{get:function(){return this.kids.length}}),s.prototype.addPage=function(){var e=new i(this.doc,this.tree);return this.pages.push(e),this.kids.push(e.toReference()),this.tree.addProperty("Count",this.count),this.doc.subsets.forEach(function(t){t.addTo(e)}),e},s.prototype.removePageAt=function(e){this.pages.splice(e,1),this.kids.splice(e,1),this.tree.addProperty("Count",this.count)},s.prototype.toReference=function(){return this.tree.toReference()}},{"./objects/array":8,"./page":15}],17:[function(e,t,n){n.extend=function(e,t){for(var n in t){if(n in e)continue;e[n]=t[n]}return e},n.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1}})}},{}],18:[function(e,t,n){},{}],19:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({tag:r.String(4),checkSum:r.Uint32,offset:r.Uint32,length:r.Uint32}),s=t.exports=new r({scalerType:r.Int32,numTables:r.Uint16,searchRange:r.Uint16.with({$packing:function(){var e,t=1;while((t*=2)<=this.numTables)e=t;return e*16}}),entrySelector:r.Uint16.with({$packing:function(){return Math.log(this.searchRange/16)/Math.LN2}}),rangeShift:r.Uint16.with({$packing:function(){return this.numTables*16-this.searchRange}}),entries:r.Hash(i,"tag",r.Ref("numTables"))})},{structjs:32}],20:[function(e,t,n){var r=t.exports=function(e){this.font=e,this.subset={32:32},this.mapping={32:32},this.pos=33};r.prototype.use=function(e){for(var t=0,n=e.length;t<n;++t){var r=e.charCodeAt(t);if(r in this.mapping||r<33)continue;this.subset[this.pos]=r,this.mapping[r]=this.pos++}},r.prototype.encode=function(e){var t=[];for(var n=0,r=e.length;n<r;++n)t.push(this.mapping[e.charCodeAt(n)]);return String.fromCharCode.apply(String,t)},r.prototype.cmap=function(){var e={};for(code in this.subset){var t=this.font.codeMap[this.subset[code]];t!==undefined&&(e[code]=t)}return e},r.prototype.glyphs=function(){function s(t){var n={};return t.forEach(function(t){var r=e.font.tables.glyf.for(t);n[t]=r;if(r!==null?r.isCompound:!1){var i=s(r.ids);for(t in i)n[t]=i[t]}}),n}var e=this,t=[0];for(var n in this.subset){var r=this.subset[n],i=this.font.codeMap[r];i!==undefined&&!~t.indexOf(i)&&t.push(i)}return t.sort(),s(t)},r.prototype.embed=function(){var e=this.font.tables.cmap.embed(this.cmap()),t=this.glyphs();this.font.tables.cmap.subtables=[e.subtable];var n={0:0};for(var r in e.charMap){var i=e.charMap[r];n[i.old]=i.new}var s=e.maxGlyphID;for(var o in t)o in n||(n[o]=s++);var u={};for(var a in n)u[n[a]]=a;var f=Object.keys(u).sort(function(e,t){return e-t}),l=f.map(function(e){return u[e]}),c=this.font.tables.glyf.embed(t,l,n);this.font.tables.loca.embed(c),this.font.tables.hmtx.embed(l),this.font.tables.hhea.embed(l),this.font.tables.maxp.embed(l),this.font.tables.name.embed(e.charMap)}},{}],21:[function(e,t,n){var r=e("structjs"),i=new r({format:r.Uint16},{storage:!0,offset:r.Ref("offset")});i.conditional(function(){return this.format===4},{length:r.Uint16,language:r.Uint16,segCount:r.Uint16.with({$unpacked:function(e){return e/2},$packing:function(e){return e*2}}),searchRange:r.Uint16,entrySelector:r.Uint16,rangeShift:r.Uint16,endCode:r.Array(r.Uint16,r.Ref("segCount")),reservedPad:r.Uint16,startCode:r.Array(r.Uint16,r.Ref("segCount")),idDelta:r.Array(r.Uint16,r.Ref("segCount")),idRangeOffset:r.Array(r.Uint16,r.Ref("segCount")),glyphIndexArray:r.Array(r.Uint16,function(){var e=(this.length-(8+this.segCount*4)*2)/2;return e})}),i.prototype.$unpacked=function(){if(this.format!==4)return;this.codeMap={};for(var e=0,t=this.segCount;e<t;++e){var n=this.endCode[e],r=this.startCode[e],i=this.idDelta[e],s=this.idRangeOffset[e];for(var o=r;o<=n;++o){var u;if(s===0)u=o+i;else{var a=s/2+(o-r)-(this.segCount-e);u=this.glyphIndexArray[a]||0,u!=0&&(u+=i)}this.codeMap[o]=u&65535}}};var s=new r({platformID:r.Uint16,platformSpecificID:r.Uint16,offset:r.Uint32,format:r.Uint16.from(r.Ref("offset")),table:i});Object.defineProperty(s.prototype,"isUnicode",{enumerable:!0,get:function(){return this.platformID===3&&this.platformSpecificID===1||this.platformID===0}});var o=t.exports=new r({version:r.Uint16,numberSubtables:r.Uint16,subtables:r.Array(s,r.Ref("numberSubtables")),tables:r.Storage("subtables.table")});o.prototype.embed=function(e){var t=Object.keys(e).sort(function(e,t){return e-t}),n=0,r={},o={},u=diff=null,a=[],f=[];t.forEach(function(t){var i=e[t];r[i]===undefined&&(r[i]=++n),o[t]={old:i,"new":r[i]};var s=r[i]-t;if(u===null||s!==diff)u&&a.push(u),f.push(t),diff=s;u=t}),u&&a.push(u),a.push(65535),f.push(65535);var l=f.length,c=l*2,h=2*Math.pow(Math.log(l)/Math.LN2,2),p=Math.log(h/2)/Math.LN2,d=2*l-h,v=[],m=[],g=[];for(var y=0,b=f.length;y<b;++y){var w=f[y],E=a[y];if(w===65535){v.push(0),m.push(0);break}var S=o[w].new;if(w-S>=32768){v.push(0),m.push(2*(g.length+l-y));for(var x=w;x<E;++w)g.push(o[x].new)}else v.push(S-w),m.push(0)}var T=new s({platformID:3,platformSpecificID:1,offset:12,table:new i({format:4,length:16+l*8+g.length*2,language:0,segCount:l,searchRange:h,entrySelector:p,rangeShift:d,endCode:a,reservedPad:0,startCode:f,idDelta:v,idRangeOffset:m,glyphIndexArray:g})});return{charMap:o,subtable:T,maxGlyphID:n+1}}},{structjs:32}],22:[function(e,t,n){var r=e("structjs");t.exports=function(e){return new i(e)};var i=function(e){this.loca=e,this.cache={}};i.prototype.embed=function(e,t,n){var r=[],i=0;return this.mapping=t,this.glyphs=e,t.forEach(function(t){var s=e[t];r.push(i);if(!s)return;s.embed(n),i+=s.lengthFor()*s.sizeFor()}),r.push(i),r},i.prototype.for=function(e){if(e in this.cache)return this.cache[e];var t=this.loca.indexOf(e),n=this.loca.lengthOf(e);return n===0?this.cache[e]=null:this.cache[e]=(new c).unpack(new DataView(this.view.buffer,this.view.byteOffset+t,n))},i.prototype.unpack=function(e){return this.view=e,this},i.prototype.pack=function(e,t){var n=this;this.mapping.forEach(function(r){var i=n.glyphs[r];if(!i)return;i.pack(e,t),t+=i.lengthFor()*i.sizeFor()})},i.prototype.lengthFor=function(){return 1},i.prototype.sizeFor=function(){var e=0;for(var t in this.cache){var n=this.cache[t];if(!n)continue;e+=n.lengthFor()*n.sizeFor()}return e};var s=1,o=8,u=32,a=64,f=128,l=256,c=function(){};c.prototype.unpack=function(e){this.view=e,this.isCompound=e.getInt16(0)===-1;if(this.isCompound){this.ids=[],this.offsets=[];var t=10;for(;;){var n=this.view.getInt16(t),r=this.view.getInt16(t+2);this.ids.push(r),this.offsets.push(t+2);if(!(n&u))break;t+=4,n&s?t+=4:t+=2,n&f?t+=8:n&a?t+=4:n&o&&(t+=2)}}return this},c.prototype.pack=function(e,t){for(var n=0,r=this.view.byteLength;n<r;++n)e.setUint8(t+n,this.view.getUint8(n))},c.prototype.lengthFor=function(){return 1},c.prototype.sizeFor=function(){return this.view.byteLength},c.prototype.embed=function(e){if(!this.isCompound)return;var t=this;this.ids.forEach(function(n,r){t.view.setUint16(t.offsets[r],e[n])})}},{structjs:32}],23:[function(e,t,n){var r=e("structjs");t.exports=new r({version:r.Int32,fontRevision:r.Int32,checkSumAdjustment:r.Uint32,magicNumber:r.Uint32,flags:r.Uint16,unitsPerEm:r.Uint16,createdA:r.Int32,createdB:r.Int32,modifiedA:r.Int32,modifiedB:r.Int32,xMin:r.Int16,yMin:r.Int16,xMax:r.Int16,yMax:r.Int16,macStyle:r.Uint16,lowestRecPPEM:r.Uint16,fontDirectionHint:r.Int16,indexToLocFormat:r.Int16,glyphDataFormat:r.Int16})},{structjs:32}],24:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,ascent:r.Int16,descent:r.Int16,lineGap:r.Int16,advanceWidthMax:r.Uint16,minLeftSideBearing:r.Int16,minRightSideBearing:r.Int16,xMaxExtent:r.Int16,caretSlopeRise:r.Int16,caretSlopeRun:r.Int16,caretOffset:r.Int16,reserved1:r.Int16,reserved2:r.Int16,reserved3:r.Int16,reserved4:r.Int16,metricDataFormat:r.Int16,numOfLongHorMetrics:r.Uint16});i.prototype.embed=function(e){this.numOfLongHorMetrics=e.length}},{structjs:32}],25:[function(e,t,n){var r=e("structjs"),i=new r({advanceWidth:r.Uint16,leftSideBearing:r.Int16});t.exports=function(e,t){var n=new r({hMetrics:r.Array(i,e),leftSideBearing:r.Array(r.Uint16,t-e)});return n.prototype.$unpacked=function(){var e=this.metrics=[];this.hMetrics.forEach(function(t){e.push(t.advanceWidth)});var t=e[e.length-1];this.leftSideBearing.forEach(function(n){e.push(t)})},n.prototype.for=function(e){return e in this.hMetrics?this.hMetrics[e]:new i({advanceWidth:this.hMetrics[this.hMetrics.length-1].advance,leftSideBearing:this.leftSideBearing[e-this.hMetrics.length]})},n.prototype.embed=function(e){var t=this,n=[];e.forEach(function(e){n.push(t.for(e))}),this.hMetrics=n,this.leftSideBearing=[],this._definition.hMetrics._length=e.length,this._definition.leftSideBearing._length=0},n}},{structjs:32}],26:[function(e,t,n){var r=e("structjs");t.exports=function(e,t){var n;switch(e){case 0:n=new r({offsets:r.Array(r.Uint16,t+1)}),n.prototype.$unpacked=function(){for(var e=0,t=this.offsets.length;e<t;++e)this.offsets[e]*=2},n.prototype.$packing=function(){for(var e=0,t=this.offsets.length;e<t;++e)this.offsets[e]/=2};break;case 1:n=new r({offsets:r.Array(r.Uint32,t+1)})}return n.prototype.indexOf=function(e){return this.offsets[e]},n.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},n.prototype.embed=function(
e){this._definition.offsets._length=e.length,this.offsets=e},n}},{structjs:32}],27:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,numGlyphs:r.Uint16,maxPoints:r.Uint16,maxContours:r.Uint16,maxComponentPoints:r.Uint16,maxComponentContours:r.Uint16,maxZones:r.Uint16,maxTwilightPoints:r.Uint16,maxStorage:r.Uint16,maxFunctionDefs:r.Uint16,maxInstructionDefs:r.Uint16,maxStackElements:r.Uint16,maxSizeOfInstructions:r.Uint16,maxComponentElements:r.Uint16,maxComponentDepth:r.Uint16});i.prototype.embed=function(e){this.numGlyphs=e.length}},{structjs:32}],28:[function(e,t,n){var r=e("structjs"),i=new r({platformID:r.Uint16,encodingID:r.Uint16,languageID:r.Uint16,nameID:r.Uint16,length:r.Uint16.with({$unpacked:function(e){return e/2},$packing:function(e){return e*2}}),offset:r.Uint16,string:r.String({storage:!0,size:2,length:r.Ref("length"),offset:r.Ref("offset")})}),s=t.exports=new r({format:r.Uint16,count:r.Uint16,stringOffset:r.Uint16,records:r.Array(i,r.Ref("count")),names:r.Storage("records.string",r.Ref("stringOffset"))});s.prototype.embed=function(e){var t=null;for(var n=0;n<this.records.length;++n){var r=this.records[n];r.nameID===6&&(t===null&&(t=r.string),this.records.splice(n--,1))}this.records.push(new i({platformID:1,encodingID:0,languageID:0,nameID:6,length:0,offset:0,string:"MARKUS+"+t}))}},{structjs:32}],29:[function(e,t,n){var r=e("structjs");t.exports=(new r({version:r.Uint16,xAvgCharWidth:r.Int16,usWeightClass:r.Uint16,usWidthClass:r.Uint16,fsType:r.Uint16,ySubscriptXSize:r.Int16,ySubscriptYSize:r.Int16,ySubscriptXOffset:r.Int16,ySubscriptYOffset:r.Int16,ySuperscriptXSize:r.Int16,ySuperscriptYSize:r.Int16,ySuperscriptXOffset:r.Int16,ySuperscriptYOffset:r.Int16,yStrikeoutSize:r.Int16,yStrikeoutPosition:r.Int16,sFamilyClass:r.Int16,panose:r.Array(r.Uint8,10),ulUnicodeRange1:r.Uint32,ulUnicodeRange2:r.Uint32,ulUnicodeRange3:r.Uint32,ulUnicodeRange4:r.Uint32,achVendID:r.Array(r.Int8,4),fsSelection:r.Uint16,usFirstCharIndex:r.Uint16,usLastCharIndex:r.Uint16})).conditional(function(){return this.version>0},{sTypoAscender:r.Int16,sTypoDescender:r.Int16,sTypoLineGap:r.Int16,usWinAscent:r.Uint16,usWinDescent:r.Uint16,ulCodePageRange1:r.Uint32,ulCodePageRange2:r.Uint32}).conditional(function(){return this.version>1},{sxHeight:r.Int16,sCapHeight:r.Int16,usDefaultChar:r.Uint16,usBreakChar:r.Uint16,usMaxContext:r.Uint16})},{structjs:32}],30:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,italicAngleHi:r.Int16,italicAngleLow:r.Int16,underlinePosition:r.Int16,underlineThickness:r.Int16,isFixedPitch:r.Uint32,minMemType42:r.Uint32,maxMemType42:r.Uint32,minMemType1:r.Uint32,maxMemType1:r.Uint32})},{structjs:32}],31:[function(e,t,n){function o(e){var t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(var r=0;r<e.length;++r)n[r]=e[r];return t}var r=e("./directory"),i=e("./subset"),s=t.exports=function(t){function s(r,i){var s=r.replace(/[^a-z0-9]/ig,"").toLowerCase(),o=n.directory.entries[r];if(!o)return;var u=e("./table/"+s),a=new DataView(t,o.offset,o.length);i&&(u=u.apply(undefined,i)),n.tables[s]=n.tables[r]=(typeof u=="function"?new u:u).unpack(a)}var n=this;this.buffer=t=t instanceof ArrayBuffer?t:o(t),this.directory=new r,this.directory.unpack(new DataView(t));var i=this.directory.scalerType.toString(16);if(i!=="74727565"&&i!=="10000")throw new Error("Not a TrueType font");this.tables={},s("cmap");for(var u=0,a=this.tables.cmap.subtables.length;u<a;++u){var f=this.tables.cmap.subtables[u];if(f.isUnicode){n.codeMap=f.table.codeMap;break}}if(!this.codeMap)throw new Error("Font does not contain a Unicode Cmap.");s("head"),s("hhea"),s("maxp"),s("hmtx",[this.tables.hhea.numOfLongHorMetrics,this.tables.maxp.numGlyphs]),s("loca",[this.tables.head.indexToLocFormat,this.tables.maxp.numGlyphs]),s("glyf",[this.tables.loca]),s("name"),s("post"),this.tables.post.version=196608,s("OS/2"),this.baseFont=this.tables.name.records.filter(function(e){return e.nameID===6})[0].string,this.fontName="MARKUS+"+this.baseFont,this.scaleFactor=1e3/this.tables.head.unitsPerEm,this.italicAngle=parseFloat(this.tables.post.italicAngleHi+"."+this.tables.post.italicAngleLow);var l=this.tables.os2||{};this.ascent=Math.round((l.sTypoAscender||this.tables.hhea.ascent)*this.scaleFactor),this.descent=Math.round((l.sTypoDescender||this.tables.hhea.descent)*this.scaleFactor),this.lineGap=Math.round((l.sTypoLineGap||this.tables.hhea.lineGap)*this.scaleFactor),this.capHeight=l.sCapHeight||this.ascent,this.stemV=0,this.bbox=[this.tables.head.xMin,this.tables.head.yMin,this.tables.head.xMax,this.tables.head.yMax].map(function(e){return Math.round(e*n.scaleFactor)});var c=0,h=(l.sFamilyClass||0)>>8,p=!!~[1,2,3,4,5,6,7].indexOf(h);this.tables.post.isFixedPitch&&(c|=1),p&&(c|=2),h===10&&(c|=8),this.italicAngle!==0&&(c|=64),c|=32,this.flags=c,this.widths=[];for(var d in this.codeMap){if(d<32)continue;var v=this.codeMap[d];this.widths.push(Math.round(this.tables.hmtx.metrics[v]*this.scaleFactor))}};s.prototype.stringWidth=function(e,t){var n=0,r=t/1e3;for(var i=0,s=e.length;i<s;++i){var o=e.charCodeAt(i)-32;n+=this.widths[o]||0}return n*r},s.prototype.lineHeight=function(e,t){t==null&&(t=!1);var n=t?this.lineGap:0;return(this.ascent+n-this.descent)/1e3*e},s.prototype.subset=function(){return new i(this)},s.prototype.save=function(){var e=this,t=["cmap","glyf","loca","hmtx","hhea","maxp","post","name","head","OS/2"];for(var n in this.directory.entries)~t.indexOf(n)||delete this.directory.entries[n];var r=offset=this.directory.lengthFor(this.directory,!0)*this.directory.sizeFor(this.directory,!0);t.forEach(function(t){if(!(t in e.directory.entries))return;var n=e.tables[t],i=n?n.lengthFor(n,!0)*n.sizeFor(n,!0):e.directory.entries[t].length;r+=i+i%4}),this.tables.head.checkSumAdjustment=0;var i=new DataView(new ArrayBuffer(r+1e3));t.forEach(function(t){if(!(t in e.directory.entries))return;var n=e.tables[t],r=e.directory.entries[t];if(!n){var s=new DataView(e.buffer,r.offset,r.length);for(var o=0;o<r.length;++o)i.setUint8(offset+o,s.getUint8(o));r.offset=offset}else n.pack(i,offset),r.offset=offset,r.length=n.lengthFor(n,!0)*n.sizeFor(n,!0);var u=r.length%4,a=r.length+u;for(var o=r.offset+r.length,f=o+u;o<f;++o)i.setInt8(o,0);var l=0;for(var o=0;o<a;o+=4)l+=i.getInt32(offset+o);r.checkSum=l,offset+=a}),this.directory.pack(i,0);var s=0;for(var o=0;o<r;o+=4)s+=i.getInt32(o);return this.tables.head.checkSumAdjustment=2981146554-s,this.tables.head.pack(i,this.directory.entries.head.offset),i.buffer},s.Subset=i},{"./directory":19,"./subset":20,"./table/cmap":21,"./table/glyf":22,"./table/head":23,"./table/hhea":24,"./table/hmtx":25,"./table/loca":26,"./table/maxp":27,"./table/name":28,"./table/os2":29,"./table/post":30}],32:[function(e,t,n){var r=e("./types/number"),i=e("./types/string"),s=e("./types/hash"),o=e("./types/array"),u=e("./types/reference"),a=e("./types/storage"),f=e("./utils"),l=t.exports=function(e,t){t||(t={});var n=function(t){Object.defineProperties(this,{_view:{writable:!0,value:null},_offset:{writable:!0,value:null},_definition:{writable:!1,value:e}});for(var n in t)n in e&&(this[n]=t[n]);var r=this;i.forEach(function(e){for(var n in t)n in e.extension&&(r[n]=t[n])})};Object.defineProperties(n,{_offset:{writable:!0,value:null},_definition:{writable:!1,value:e}}),n.storage=t.storage,n._offset=t.offset,f.methodsFor(n,"_offset","offsetFor","setOffset");var i=[];return n.conditional=function(e,t){return i.push({condition:e,extension:t}),this},n.prototype.unpack=function(t,n){function s(e){for(var i in e){var s=e[i];e[i].prop=i;if(s.storage)continue;r[i]=s.read(t,n),typeof s.$unpacked=="function"&&(r[i]=s.$unpacked.call(r,r[i])),r[i]===undefined&&delete r[i],s.external||(n+=s.lengthFor(r)*s.sizeFor(r))}}if(t instanceof DataView){n||(n=0),this._view=t;var r=this;return s.parent=this,s(e),i.forEach(function(e){if(!e.condition.call(r))return;s(e.extension)}),typeof this.$unpacked=="function"&&this.$unpacked(),this}throw new Error("DataView expected")},n.prototype.pack=function(t,n){function o(e){var i=n;for(var o in e){var u=e[o];if(u.external||u.storage)continue;u instanceof a&&u.write(t,n,s[o],n-i),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}n=i;for(var o in e){var u=e[o];if(u.external||u.storage)continue;!(u instanceof r)&&!(u instanceof a)&&u.write(t,n,s[o]),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}n=i;for(var o in e){var u=e[o];if(u.external||u.storage)continue;var f=s[o];typeof u.$packing=="function"&&(f=s[o]=u.$packing.call(s,f)),u instanceof r&&u.write(t,n,f),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}}typeof this.$packing=="function"&&this.$packing(),t||(t=new DataView(new ArrayBuffer(this.lengthFor(this,!0)*this.sizeFor(this,!0)))),n||(n=0);var s=this;return o.parent=this,o(e),i.forEach(function(e){if(!e.condition.call(s))return;o(e.extension)}),t.buffer},n.read=function s(e,t){var n=new this,r=s.caller.parent,i=this.storage?this.offsetFor(r):t;return n.unpack(e,i),n},n.write=function o(e,t,n,r){var i=o.caller.parent,s=this.storage?t+this.offsetFor(i):t;this.setOffset(this.storage?r+this.offsetFor(i):t,i),n.pack(e,s)},n.prototype.lengthFor=n.lengthFor=function(){return 1},n.prototype.sizeFor=n.sizeFor=function(t,n){function s(e){return Object.keys(e).filter(function(t){return!e[t].external&&!e[t].storage}).map(function(r){return e[r].lengthFor(t,!!n)*e[r].sizeFor(t,!!n)}).reduce(function(e,t){return e+t},0)}var r=this,o=s(e);return i.forEach(function(e){if(!e.condition.call(t))return;o+=s(e.extension)}),o},n};l.Int8=new r("getInt8","setInt8",1),l.Uint8=new r("getUint8","setUint8",1),l.Int16=new r("getInt16","setInt16",2),l.Uint16=new r("getUint16","setUint16",2),l.Int32=new r("getInt32","setInt32",4),l.Uint32=new r("getUint32","setUint32",4),l.Float32=new r("getFloat32","setFloat32",4),l.Float64=new r("getFloat64","setFloat64",8),l.String=function(e){return new i(e)},l.Hash=function(e,t,n){return new s(e,t,n)},l.Array=function(e,t){return new o(e,t)},l.Reference=l.Ref=function(e){return new u(e)},l.Storage=function(e,t){return new a(e,t)}},{"./types/array":33,"./types/hash":34,"./types/number":35,"./types/reference":36,"./types/storage":37,"./types/string":38,"./utils":39}],33:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e,t){this.struct=e,Object.defineProperties(this,{_length:{value:t,writable:!0}})};s.prototype.read=function o(e,t){var n=[],r=o.caller.parent;for(var i=0,s=this.lengthFor(r);i<s;++i){var u;typeof this.struct=="function"?(u=new this.struct,u.unpack(e,t),t+=u.lengthFor(r)*u.sizeFor(r)):(u=this.struct.read(e,t),t+=this.struct.lengthFor(r)*this.struct.sizeFor(r)),n.push(u)}return n},s.prototype.write=function u(e,t,n){var r=u.caller.parent,i;this.setLength(this.lengthFor(r,!0),r);for(var s=0,o=this.lengthFor(r);s<o;++s){if((i=n[s])===undefined)break;typeof this.struct=="function"?(i.pack(e,t),t+=i.lengthFor(r)*i.sizeFor(r)):(this.struct.write(e,t,i),t+=this.struct.lengthFor(r)*this.struct.sizeFor(r))}},s.prototype.sizeFor=function(e){return(this.struct.sizeFor?this.struct.sizeFor(e):this.struct.prototype.sizeFor(e))*(this.struct.lengthFor?this.struct.lengthFor(e):this.struct.prototype.lengthFor(e))},s.prototype.lengthFor=function(e,t){return this._length?this._length instanceof i?t?e[this.prop].length:e[this._length.prop]:typeof this._length=="function"?this._length.call(e):this._length:0},s.prototype.setLength=function(e,t){this._length instanceof i?t[this._length.prop]=e:this._length=e}},{"../utils":39,"./reference":36}],34:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e,t,n){this.struct=e,this.key=t,Object.defineProperties(this,{_length:{value:n,writable:!0}})};s.prototype.read=function o(e,t){var n={},r=o.caller.parent;for(var i=0,s=this.lengthFor(r);i<s;++i){var u=new this.struct;u.unpack(e,t),t+=u.lengthFor(r)*u.sizeFor(r),n[u[this.key]]=u}return n},s.prototype.write=function u(e,t,n){var r=Object.keys(n),i=u.caller.parent,s;this.setLength(this.lengthFor(i,!0),i);for(var o=0,a=this.lengthFor(i);o<a;++o){if(!(s=n[r[o]]))continue;s.pack(e,t),t+=s.lengthFor(i)*s.sizeFor(i)}},s.prototype.sizeFor=function(e){return(this.struct.sizeFor?this.struct.sizeFor(e):this.struct.prototype.sizeFor(e))*(this.struct.lengthFor?this.struct.lengthFor(e):this.struct.prototype.lengthFor(e))},s.prototype.lengthFor=function(e,t){return this._length?this._length instanceof i?t?Object.keys(e[this.prop]).length:e[this._length.prop]:this._length:0},s.prototype.setLength=function(e,t){this._length instanceof i?t[this._length.prop]=e:this._length=e}},{"../utils":39,"./reference":36}],35:[function(e,t,n){var r=e("../utils"),i=t.exports=function(e,t,n){this.methods={read:e,write:t},Object.defineProperties(this,{_offset:{value:null,writable:!0},_length:{value:null,writable:!0}}),r.options.call(this,n)};i.prototype.with=function(e){return e.length||(e.length=this._length),new i(this.methods.read,this.methods.write,e)},i.prototype.from=function(e){return this.with({external:!0,offset:e})},i.prototype.read=function s(e,t){var n=s.caller.parent;return e[this.methods.read](this.external?this.offsetFor(n):t)},i.prototype.write=function o(e,t,n){var r=o.caller.parent;e[this.methods.write](this.external?this.offsetFor(r):t,n)},i.prototype.lengthFor=function(){return 1},i.prototype.sizeFor=function(){return this._length},r.methodsFor(i.prototype,"_offset","offsetFor","setOffset")},{"../utils":39}],36:[function(e,t,n){var r=t.exports=function(e){this.prop=e}},{}],37:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=e("./array"),o=t.exports=function(e,t){this.path=e,t instanceof i&&(t={offset:t}),t=t||{},Object.defineProperties(this,{_offset:{value:t.offset,writable:!0}})};o.prototype.read=function u(e,t){var n=u.caller.parent,r=this.offsetFor(n)||t;!function i(t,n,o){var u=t.shift(),a=n[u];i.parent=o,t.length?a instanceof s?o[u].forEach(function(e){i(t.concat([]),a.struct._definition,e)}):i(t,a,o[u]):o[u]=a.read(e,r)}(this.path.split("."),n._definition,n)},o.prototype.write=function a(e,t,n,r){var i=a.caller.parent,o=0;this.setOffset(r,i),!function u(n,i,a){var f=n.shift(),l=i[f];u.parent=a;if(!n.length){l.setOffset(o,a);var c=a[f],a=l.prototype?a[f]:a;l.write(e,t,c,r),o+=l.lengthFor(a,!0)*l.sizeFor(a,!0)}else l instanceof s?a[f].forEach(function(e){u(n.concat([]),l.struct._definition,e)}):u(n,l,a[f])}(this.path.split("."),i._definition,i)},o.prototype.lengthFor=function(){return 1},o.prototype.sizeFor=function(e,t){var n=0;return!function r(e,i,o){var u=e.shift(),a=i[u];r.parent=o,e.length?a instanceof s?o[u].forEach(function(t){r(e.concat([]),a.struct._definition,t)}):r(e,a,o[u]):(a.prototype&&(o=o[u]),n+=a.lengthFor(o,t)*a.sizeFor(o,t))}(this.path.split("."),e._definition,e),n},r.methodsFor(o.prototype,"_offset","offsetFor","setOffset")},{"../utils":39,"./array":33,"./reference":36}],38:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e){Object.defineProperties(this,{_offset:{value:null,writable:!0},_length:{value:null,writable:!0},_size:{value:null,writable:!0}}),r.options.call(this,e)};s.prototype.read=function o(e,t){var n=[],r,i=o.caller.parent,s=this.external?this.offsetFor(i):this.storage?t+this.offsetFor(i):t;for(var u=0,a=this.lengthFor(i),f=this.sizeFor()===2?2:1;u<a;++u)n.push(e[this.sizeFor()===2?"getUint16":"getUint8"](s+u*f,this.littleEndian));return String.fromCharCode.apply(null,n)},s.prototype.write=function u(e,t,n){var r=[],i,s=u.caller.parent,o=this.external?this.offsetFor(s):this.storage?t+this.offsetFor(s):t;this.setLength(this.lengthFor(s,!0),s);for(var a=0,f=this.lengthFor(s),l=this.sizeFor()===2?2:1;a<f;++a){var c=n.charCodeAt(a)||0;e[this.sizeFor()===2?"setUint16":"setUint8"](o+a*l,c,this.littleEndian)}},s.prototype.sizeFor=function(){return this._size||1},s.prototype.lengthFor=function(e,t){return this._length instanceof i?t?e[this.prop].length:e[this._length.prop]:this._length||0},s.prototype.setLength=function(e,t){this._length instanceof i?t[this._length.prop]=e:this._length=e},r.methodsFor(s.prototype,"_offset","offsetFor","setOffset")},{"../utils":39,"./reference":36}],39:[function(e,t,n){var r=e("./types/reference");n.methodsFor=function(e,t,n,i){e[n]=function(e){return this[t]?this[t]instanceof r?e[this[t].prop]:typeof this[t]=="function"?this[t].call(e):this[t]:0};if(!i)return;e[i]=function(e,n){this[t]instanceof r?n[this[t].prop]=e:this[t]=e}},n.options=function(e){typeof e=="object"?(this._offset=e.offset,this._length=e.length,this._size=e.size,this.$unpacked=e.$unpacked,this.$packing=e.$packing,this.external=e.external===!0,this.storage=e.storage,this.littleEndian=e.littleEndian===!0):this._length=e}},{"./types/reference":36}]},{},[4])(4)});
(function(e){if("function"==typeof bootstrap)bootstrap("pdfjs",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makePdfjs=e}else"undefined"!=typeof window?window.Pdfjs=e():global.Pdfjs=e()})(function(){var e,t,n,r,i;return function s(e,t,n){function r(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=t[o]={exports:{}};e[o][0].call(f.exports,function(t){var n=e[o][1][t];return r(n?n:t)},f,f.exports,s,e,t,n)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,n){t.exports=function(e){var t=new r(e);return this.contents.push(t),this};var r=function(e){this.op=e};r.prototype.render=function(e,t){e.contents.writeLine(this.op)}},{}],2:[function(e,t,n){function l(e,t){for(var n in e){var r=t[n];if(r===undefined||r===null)t[n]=e[n];else{switch(n){case"padding":r=c(r,{top:0,right:0,bottom:0,left:0});break;case"borderWidth":r=c(r,{top:null,right:null,bottom:null,left:null,inside:null,horizontal:null,vertical:null});break;default:continue}typeof r=="object"&&(t[n]=l(e[n],r))}}return t}function c(e,t){return typeof e=="object"?Array.isArray(e)?e.length===2?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:{top:e[0],right:e[1],bottom:e[2],left:e[3]}:l(t,e):{top:e,right:e,bottom:e,left:e}}function h(e,t,n,r){e.contents.writeLine("0 0 0 RG"),e.contents.writeLine(t+" w"),e.contents.writeLine(n[0]+" "+n[1]+" m "+r[0]+" "+r[1]+" l S"),e.contents.writeLine("")}t.exports=function(e,t){return this.contents.push(new s(this,e,t)),this};var r=e("../utils"),i={size:12,padding:{top:5,bottom:5,left:8,right:8},borderWidth:{top:null,bottom:null,left:null,right:null}},s=function(e,t,n){typeof t=="function"&&(n=t,t={}),this.doc=e.doc||e,this.opts=t,l(i,this.opts),this.rows=[],n.call(this,this)};s.prototype.tr=function(e,t){this.rows.push(new o(this,e,t))},s.prototype.render=function(e,t){var n=[],r=this,i=Math.max.apply(Math,this.rows.map(function(e){return e.cells.map(function(e,t){if(n[t]===undefined||e.width>n[t]&&!(e.opts.colspan>1))n[t]=e.width;return e.width}).reduce(function(e,t){return e+t},0)})),s=t;if(i>s){var o=s/n.length,u=[],a=0;for(var f=0,l=n.length;f<l;++f)n[f]<o?a+=o-n[f]:u.push(f);o+=a/u.length,u.forEach(function(e){n[e]=o})}var c=this.opts.width||s;if(c&&i<c){var o=c/n.length,h=[],p=0;for(var f=0,l=n.length;f<l;++f)n[f]<o&&h.push(f),p+=n[f];var d=(c-p)/h.length;h.forEach(function(e){n[e]+=d})}var v=e.cursor.x;for(var f=0;f<this.rows.length;++f){var m=e.cursor.y,g=this.rows[f],y=this.doc.startTransaction(),b=g.render(e,n);b===!1?(e.cursor.x=v,e.cursor.y=m,y.rollback(),g.allowBreak=pagebreak=!0,--f,this.opts.header===!0&&(e=this.doc.pagebreak(),m=e.cursor.y,b=this.rows[0].render(e,n))):y.commit(),e.cursor.x=v,e.cursor.y=m-b}};var o=function(e,t,n){typeof t=="function"&&(n=t,t={}),this.table=e,this.doc=e.doc,this.opts=l(e.opts,t),this.cells=[],this.allowBreak=!1,n.call(this,this)};Object.defineProperties(o.prototype,{isFirstRow:{enumerable:!0,get:function(){return this.table.rows.indexOf(this)===0}},isLastRow:{enumerable:!0,get:function(){return this.table.rows.indexOf(this)===this.table.rows.length-1}}}),o.prototype.td=function(e,t){var n=new f(this,e,t);return this.cells.push(n),n},o.prototype.render=function(e,t){var n=e.cursor.x,r=e.cursor.y,i=[],s=[],o=!1,u=0;for(var a=0,f=this.cells.length;a<f;++a){var l=this.cells[a],c=t[u++];if(l.opts.colspan>1){for(var h=u,p=u+l.opts.colspan-1;h<p;++h)c+=t[h]||0;u+=l.opts.colspan-1}!function(t,n,r){s.push(function(i){l.drawBorder(e,t,n,r,i)})}(e.cursor.x,e.cursor.y,c);var d=l.borderLeftWidth+l.opts.padding.left,v=l.opts.padding.right+l.borderRightWidth,m=c-d-v;e.cursor.x+=d,e.cursor.y-=l.borderTopWidth+l.opts.padding.top;var g=this.doc.pages.pages.indexOf(e);l.render(e,m);var y=g+1<this.doc.pages.count?r-this.doc.padding.bottom:r-e.cursor.y+l.opts.padding.bottom+l.borderBottomWidth;for(var h=g+1,p=this.doc.pages.count;h<p;++h)y+=this.doc.height-this.doc.padding.top-this.doc.pages.pages[h].cursor.y;i.push(y),e.cursor.y=r,e.cursor.x+=m+v;if(this.doc.cursor!==e&&!this.allowBreak)return!1}var y=Math.max.apply(Math,i);return s.forEach(function(e){e(y)}),y};var u=e("./text").Text,a=e("../fragment"),f=function(e,t,n){n||(n={}),this.row=e,this.doc=e.doc,this.opts=l(e.opts,n),t instanceof a?(this.content=t,this.contents=t.prepared):(this.content=new a(this.doc),typeof t=="function"?t.call(this.content,this.content):this.content.text(t,this.opts)),this.innerWidth=this.content.maxWidth,this.innerHeight=this.content.minHeight,this.isFirstColumn=this.row.cells.length===0,this.isLastColumn=!0,this.isFirstColumn||(this.row.cells[this.row.cells.length-1].isLastColumn=!1)};f.prototype.render=function(e,t){this.content.render(e,t)},f.prototype.drawBorder=function(e,t,n,r,i,s,o){if(n-this.doc.padding.bottom<i){var u=i-n+this.doc.padding.bottom,a=this.doc.pages.pages.indexOf(e);this.drawBorder(e,t,n,r,n-this.doc.padding.bottom,!0,!1);while(u>0)e=this.doc.pages.pages[++a],u>this.doc.innerHeight?(i=this.doc.innerHeight,this.drawBorder(e,this.doc.padding.left,this.doc.height-this.doc.padding.top,r,i,!0,!0)):(i=u,this.drawBorder(e,this.doc.padding.left,this.doc.height-this.doc.padding.top,r,i,!1,!0)),u-=i;return}var f;this.borderBottomWidth>0&&!s&&h(e,f=this.borderBottomWidth,[t-f/2,n-i+f/2],[t+r,n-i+f/2]),this.borderTopWidth>0&&!o&&h(e,f=this.borderTopWidth,[t-f/2,n],[t+r,n]);var l=n-i;l<this.doc.padding.bottom&&(l=this.doc.padding.bottom),this.borderRightWidth>0&&h(e,f=this.borderRightWidth,[t+r-f/2,l],[t+r-f/2,n-f/2]),this.borderLeftWidth>0&&h(e,f=this.borderLeftWidth,[t,n+f/2],[t,l])},Object.defineProperties(f.prototype,{width:{enumerable:!0,get:function(){return this.borderLeftWidth+this.opts.padding.left+this.innerWidth+this.opts.padding.right+this.borderRightWidth}},height:{enumerable:!0,get:function(){return this.borderTopWidth+this.opts.padding.top+this.innerHeight+this.opts.padding.bottom+this.borderBottomWidth}}}),Object.defineProperties(f.prototype,{borderTopWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.top||(this.row.isFirstRow?0:e.horizontal||e.inside||0)}},borderRightWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.right||(this.isLastColumn?0:e.vertical||e.inside||0)}},borderBottomWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.bottom||(this.row.isLastRow?0:e.horizontal||e.inside||0)}},borderLeftWidth:{enumerable:!0,get:function(){var e=this.opts.borderWidth;return e.left||(this.isFirstColumn?0:e.vertical||e.inside||0)}}})},{"../fragment":7,"../utils":17,"./text":3}],3:[function(e,t,n){function a(e){return Math.round(e*100)/100}var r=e("../objects/string"),i=e("../utils");t.exports=function(e,t){var n=new s(this,t);return typeof e=="function"?e.call(n,n.textFn):n.text(e),this.contents.push(n),this};var s=t.exports.Text=function(e,t){this.doc=e,this.opts=t||{},this.contents=[],this.textFn=this.text.bind(this),this.textFn.br=this.text.br.bind(this),this.textFn.pageNumber=this.text.pageNumber.bind(this),this.textFn.opts=this.opts};s.prototype.text=function(t,n){if(!t)return this.textFn;n=i.extend(n||{},this.opts);var r=this,s=(n.font?this.doc.registerFont(n.font):this.doc.defaultFont).fromOpts(n),u=t.toString().replace(/\t/g," ").replace(/\r\n/g,"\n").split(/ +|^|$/mg);return u.forEach(function(e){if(!e.length)return;s.use(e),r.contents.push(new o(e,s,n))}),this.textFn},s.prototype.text.br=function(){return this.contents.push(new o("\n",this.opts.font?this.doc.registerFont(opts.font):this.doc.defaultFont.regular,{})),this.textFn},s.prototype.text.pageNumber=function(){return this.contents.push(new o(function(){return this.pages.count}.bind(this.doc.doc||this.doc),this.opts.font?this.doc.registerFont(opts.font):this.doc.defaultFont.regular,{})),this.textFn},s.prototype.render=function(e,t){function c(i,s,o){var u=Math.max.apply(Math,i.map(function(e){return e.height}));if(i.length===1&&i[0].word==="\n"){e.cursor.y-=u*(n.opts.lineSpacing||1);return}if(a(e.spaceLeft)<a(u)){var c=e.cursor.x;e=n.doc.pagebreak(),e.cursor.x=c,f=undefined}e.cursor.y-=u;var h=t-s,c=e.cursor.x,p=i.length,d="";e.contents.writeLine("BT");switch(n.opts.align){case"right":c+=h;break;case"center":c+=t/2-(t-h)/2;break;case"justify":if(o&&100*h/t>20)break;var v=h/(p-1);e.contents.writeLine(v+" Tw")}e.contents.writeLine(c+" "+e.cursor.y+" Td"),i.forEach(function(t,n){if(t.word==="\n")return;var i=(n>0&&!t.isStartingWithPunctuation?" ":"")+t.font.encode(t.word),s=t.opts.size||10;if(f!==t.font||l!==s)d.length&&(e.contents.writeLine((new r(d)).toHexString()+" Tj"),d=""),e.contents.writeLine([t.font.id,s,"Tf"].join(" ")),f=t.font,l=s;d+=i}),d.length&&(e.contents.writeLine((new r(d)).toHexString()+" Tj"),d=""),e.contents.writeLine("ET"),e.cursor.y-=u*((n.opts.lineSpacing||1)-1)}var n=this,i=t,s=this.contents.length-1,o=[],n=this,f,l;this.contents.forEach(function(e,n){var r=e.width,s=!o.length||e.isStartingWithPunctuation?0:e.spacing;if(e.word==="\n"||o.length>0&&i-(r+s)<0){s=0,e.word==="\n"&&o.push(e),c(o,t-i,e.word==="\n"),i=t,o=new u;if(e.word==="\n")return}i-=r+s,o.push(e)}),o.length&&c(o,t-i,!0)},Object.defineProperties(s.prototype,{maxWidth:{enumerable:!0,get:function(){return this.contents.map(function(e,t){return e.width+(t===0?e.spacing:0)}).reduce(function(e,t){return e+t},0)}},minHeight:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.height}))}}});var o=function(e,t,n){this._word=e,this.font=t,this.opts=n||{},Object.defineProperty(this,"word",{enumerable:!0,get:function(){return this.toString()}})};Object.defineProperties(o.prototype,{width:{enumerable:!0,get:function(){return this.font.font.stringWidth(this.word,this.opts.size||10)}},height:{enumerable:!0,get:function(){return this.font.font.lineHeight(this.opts.size||10,!0)}},spacing:{enumerable:!0,get:function(){return this.font.font.stringWidth(" ",this.opts.size||10)}},isStartingWithPunctuation:{enumerable:!0,get:function(){return this.word[0].match(/\.|\!|\?|,/)!==null}}}),o.prototype.toString=function(){if(typeof this._word=="function"){var e=this._word().toString();return this.font.use(e),e}return this._word};var u=function(){var e=[];return Object.defineProperty(e,"lineHeight",{enumerable:!0,get:function(){return Math.max.apply(Math,this.map(function(e){return e.height}))}}),e}},{"../objects/string":14,"../utils":17}],4:[function(e,t,n){function m(e){return e?(e^Math.random()*16>>e/4).toString(16):([1e7]+ -1e3+ -4e3+ -8e3+ -1e11).replace(/[018]/g,m)}var r=e("./objects/object"),i=e("./pages"),s=e("./font"),o=e("./fonts/ttf"),u=e("./objects/name"),a=e("./utils"),f=t.exports=function g(e){this.version=1.7,this.objects=[],this.nextObjId=1,this.fonts=[],this.subsets=[],this.defaultFont=this.registerFont(e),g.super_.call(this,this),this.height=792,this.catalog=this.createObject("Catalog"),this.pages=new i(this),this.catalog.prop("Pages",this.pages.toReference()),this.areas={header:null,footer:null}},l=e("./fragment");a.inherits(f,l),f.Font=s,["header","footer"].forEach(function(e){f.prototype[e]=function(t,n){return typeof t!="object"&&(n=t,t={}),this.areas[e]=new l(this,t),typeof n=="function"?n.call(this.areas[e],this.areas[e]):this.areas[e].text(n,t),this}}),f.prototype.registerFont=function(e){var t;if((t=this.fonts.indexOf(e))>-1)return this.subsets[t];var n=this.fonts.push(e);return this.subsets.push(e.subset(this,n)),this.subsets[n-1]},f.prototype.createObject=function(e){var t=new r(this.nextObjId++,0);return e&&t.addProperty("Type",e),this.objects.push(t),t},f.prototype.startTransaction=function(){return new d(this)},f.prototype.pagebreak=function(){var e=this.cursor=this.pages.addPage();this.areas.header&&(this.areas.header.height=0,this.areas.header.render(e,this.innerWidth),this.areas.header.height=this.height-e.cursor.y-this.opts.padding.top);if(this.areas.footer){var t=this.areas.footer,n=this.startTransaction(),r=e.cursor.y;t.height=0,t.render(e,this.innerWidth);var i=r-e.cursor.y;n.rollback(),e.cursor.y=this.padding.bottom+i,t.render(e,this.innerWidth),e.cursor.y=r,t.height=i}return e},f.prototype.toDataURL=function(){return"data:application/pdf;base64,"+v.encode(this.toString())};var c=e("./objects/dictionary"),h=e("./objects/array"),p=e("./objects/string");f.prototype.toString=function(){var e=this;this.objects=[this.catalog,this.pages.tree],this.pagebreak(),this.render(),this.subsets.forEach(function(t){t.embed(e)});var t="",n=[],r;t+="%PDF-"+this.version.toString()+"\n",t+="%ÿÿÿÿ\n",t+="\n",this.objects.forEach(function(e){n.push(t.length),t+=e.toString()+"\n\n"}),r=t.length,t+="xref\n",t+="0 "+(this.objects.length+1)+"\n",t+="0000000000 65535 f \n",n.forEach(function(e){t+="0000000000".substr(e.toString().length)+e+" 00000 n \n"});var i=(new p(m())).toHexString(),s=new c({Size:this.objects.length+1,Root:this.catalog.toReference(),ID:new h([i,i])});return t+="trailer\n",t+=s.toString()+"\n",t+="startxref\n",t+=r+"\n",t+="%%EOF",t};var d=function(e){this.doc=e,this.page=e.pages.count-1,this.length=e.cursor.contents.content.length,this.y=e.cursor.cursor.y};d.prototype.rollback=function(){if(this.page<this.doc.pages.count-1){for(var e=this.doc.pages.count-1;e>this.page;--e)this.doc.pages.removePageAt(e);this.doc.cursor=this.doc.pages.pages[this.page]}this.length<this.doc.cursor.contents.content.length&&(this.doc.cursor.contents.content=this.doc.cursor.contents.content.slice(0,this.length)),this.doc.cursor.cursor.y=this.y},d.prototype.commit=function(){};var v={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=v._utf8_encode(e);while(f<e.length)n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),s=n>>2,o=(n&3)<<4|r>>4,u=(r&15)<<2|i>>6,a=i&63,isNaN(r)?u=a=64:isNaN(i)&&(a=64),t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t}}},{"./font":5,"./fonts/ttf":6,"./fragment":7,"./objects/array":8,"./objects/dictionary":9,"./objects/name":10,"./objects/object":11,"./objects/string":14,"./pages":16,"./utils":17}],5:[function(e,t,n){function f(e){var t;return e.bold===!0?e.italic===!0?"boldItalic":"bold":e.light===!0?e.italic===!0?"lightItalic":"light":e.italic===!0?"italic":"regular"}var r=e("./fonts/ttf"),i=e("./objects/name"),s=e("fs"),o=["regular","italic","bold","boldItalic","light","lightItalic"],u=t.exports=function(e){"regular"in e||(e={regular:e});var t=this;this.subsets={},o.forEach(function(n){if(n in e){if(!(e[n]instanceof ArrayBuffer||e[n]instanceof Buffer))throw new Error("Property `"+n+"` must be a Buffer or a Arraybuffer.");t[n]=new r(e[n]),t.subsets[n]=t[n].subset()}})};u.prototype.subset=function(e,t){return new a(e,this,t)};var a=function(e,t,n){var r=this,s=1;o.forEach(function(o){if(!(o in t))return;r[o]=t[o].subset(),r[o].id=new i("F"+n+"-"+s++),r[o].object=e.createObject("Font"),r[o].use(" ")})};a.prototype.addTo=function(e){var t=this;o.forEach(function(n){if(!(n in t)||!t[n].isUsed)return;e.fonts.add(t[n].id,t[n].toReference())})},a.prototype.fromOpts=function(e){var t=f(e);if(t in this)return this[t];throw new Error("Font for `"+t+"` not provided.")},a.prototype.embed=function(e){var t=this;o.forEach(function(n){if(!(n in t)||!t[n].isUsed)return;t[n].embed(e)})}},{"./fonts/ttf":6,"./objects/name":10,fs:18}],6:[function(e,t,n){function u(e){return e<16?"0"+e.toString(16):e.toString(16)}function a(e){var t=new Uint8Array(e),n="";for(var r=0,i=e.byteLength;r<i;++r)n+=u(t[r]);return n}var r=t.exports=e("ttfjs"),i=e("../objects/array"),s=e("../objects/stream"),o=r.Subset.prototype.embed;r.Subset.prototype.embed=function(e){o.call(this);var t=this.object;t.prop("Subtype","TrueType"),t.prop("BaseFont",this.font.fontName),t.prop("Encoding","MacRomanEncoding"),e.objects.push(t);var n=e.createObject(),r=[],u=this.cmap();for(var f in u){if(f<32)continue;var l=u[f];r.push(Math.round(this.font.tables.hmtx.metrics[l]*this.font.scaleFactor))}n.content=new i(r),t.prop("Widths",n.toReference()),t.prop("FirstChar",32),t.prop("LastChar",r.length>222?225:r.length+33-1);var c=e.createObject("FontDescriptor");c.prop("FontName",this.font.fontName),c.prop("Flags",this.font.flags),c.prop("FontBBox",new i(this.font.bbox)),c.prop("ItalicAngle",this.font.italicAngle),c.prop("Ascent",this.font.ascent),c.prop("Descent",this.font.descent),c.prop("CapHeight",this.font.capHeight),c.prop("StemV",this.font.stemV),t.prop("FontDescriptor",c.toReference());var h=new s(e.createObject());h.writeLine("/CIDInit /ProcSet findresource begin"),h.writeLine("12 dict begin"),h.writeLine("begincmap"),h.writeLine("/CIDSystemInfo <<"),h.writeLine(" /Registry (Adobe)"),h.writeLine(" /Ordering (UCS)"),h.writeLine(" /Supplement 0"),h.writeLine(">> def"),h.writeLine("/CMapName /Adobe-Identity-UCS def"),h.writeLine("/CMapType 2 def"),h.writeLine("1 begincodespacerange"),h.writeLine("<00><ff>"),h.writeLine("endcodespacerange");var u=this.subset,p=[];for(var f in u){p.length>=100&&(h.writeLine(p.length+" beginbfchar"),p.forEach(function(e){h.writeLine(e)}),h.writeLine("endbfchar"),p=[]);var d=("0000"+u[f].toString(16)).slice(-4),f=(+f).toString(16);p.push("<"+f+"><"+d+">")}p.length&&(h.writeLine(p.length+" beginbfchar"),p.forEach(function(e){h.writeLine(e)}),h.writeLine("endbfchar")),h.writeLine("endcmap"),h.writeLine("CMapName currentdict /CMap defineresource pop"),h.writeLine("end"),h.writeLine("end"),t.prop("ToUnicode",h.toReference());var v=this.save(),m=a(v),g=new s(e.createObject());g.object.prop("Length",m.length),g.object.prop("Length1",v.byteLength),g.object.prop("Filter","ASCIIHexDecode"),g.content=m+"\n",c.prop("FontFile2",g.toReference())},Object.defineProperty(r.Subset.prototype,"isUsed",{enumerable:!0,get:function(){return this.pos>33}}),r.Subset.prototype.toReference=function(){return this.object.toReference()}},{"../objects/array":8,"../objects/stream":13,ttfjs:31}],7:[function(e,t,n){var r=t.exports=function(e,t){this.opts=t||{},this.doc=e,this.width=this.opts.width||612,this.opts.padding||(this.opts.padding={top:20,right:40,bottom:20,left:40}),this.padding=new i(this),this.defaultFont=this.doc.defaultFont,this.areas={},this.contents=[]},i=function(e){this.doc=e};Object.defineProperties(i.prototype,{left:{enumerable:!0,get:function(){return this.doc.opts.padding.left}},right:{enumerable:!0,get:function(){return this.doc.opts.padding.right}},top:{enumerable:!0,get:function(){return this.doc.opts.padding.top+(this.doc.areas.header?this.doc.areas.header.height||0:0)}},bottom:{enumerable:!0,get:function(){return this.doc.opts.padding.bottom+(this.doc.areas.footer?this.doc.areas.footer.height||0:0)}}}),Object.defineProperties(r.prototype,{innerWidth:{enumerable:!0,get:function(){return this.width-this.padding.right-this.padding.left}},innerHeight:{enumerable:!0,get:function(){return this.height-this.padding.top-this.padding.bottom}},maxWidth:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.maxWidth}))}},minHeight:{enumerable:!0,get:function(){return Math.max.apply(Math,this.contents.map(function(e){return e.minHeight}))}}}),r.prototype.pagebreak=function(){return this.doc.pagebreak()},r.prototype.render=function(e,t){var n=this;this.contents.forEach(function(e){e.render(n.doc.cursor,t||n.innerWidth)})},r.prototype.registerFont=function(e){return this.doc.registerFont(e)},r.prototype.createObject=function(e){return this.doc.createObject(e)},r.prototype.text=e("./content/text"),r.prototype.table=e("./content/table"),r.prototype.op=e("./content/operation"),r.prototype.fragment=function(e,t){typeof e=="function"&&(t=e,e={});var n=new r(this,e);return t.call(n,n),this.contents.push(n),this}},{"./content/operation":1,"./content/table":2,"./content/text":3}],8:[function(e,t,n){var r=t.exports=function(e){return e||(e=[]),e.toString=function(){return"["+this.map(function(e){return e.toString()}).join(" ")+"]"},e}},{}],9:[function(e,t,n){var r=e("./name"),i=t.exports=function(e){this.dictionary={};if(e)for(var t in e)this.add(t,e[t])};i.prototype.add=function(e,t){e=new r(e),typeof t=="string"&&(t=new r(t)),this.dictionary[e]=t},i.prototype.toString=function(){var e=this;return"<<\n"+Object.keys(this.dictionary).map(function(t){return t.toString()+" "+e.dictionary[t].toString()}).join("\n").replace(/^/gm," ")+"\n"+">>"},Object.defineProperty(i.prototype,"length",{get:function(){return Object.keys(this.dictionary).length},enumerable:!0})},{"./name":10}],10:[function(e,t,n){var r=t.exports=function(e){if(!e)throw new Error("A Name cannot be undefined");if(e instanceof r)return e;if(e.match(/[\x00]/))throw new Error("A Name mustn't contain the null characters");if(e.match(/[\(\)<>\[\]\{\}\/\%]/))throw new Error("A Name mustn't contain delimiter characters");e=e.toString(),e=e.replace(/[^\x21-\x7e]/g,function(e){var t=e.charCodeAt(0);return t>255&&(t=95),"#"+t}),this.name=e};r.prototype.toString=function(){return"/"+this.name}},{}],11:[function(e,t,n){var r=e("./reference"),i=e("./dictionary"),s=t.exports=function(e,t){this.id=e,this.rev=t||0,this.properties=new i,this.reference=new r(this),this.content=null};s.prototype.addProperty=s.prototype.prop=function(e,t){this.properties.add(e,t)},s.prototype.toReference=function(){return this.reference},s.prototype.toString=function(){var e=this;return this.id.toString()+" "+this.rev+" obj\n"+(this.properties.length?this.properties.toString()+"\n":"")+(this.content!==null?this.content.toString()+"\n":"")+"endobj"}},{"./dictionary":9,"./reference":12}],12:[function(e,t,n){var r=t.exports=function(e){this.object=e};r.prototype.toString=function(){return this.object.id+" "+this.object.rev+" R"}},{}],13:[function(e,t,n){var r=e("./name"),i=t.exports=function(e){e.content=this,this.object=e,this.content=""};i.prototype.writeLine=function(e){this.content+=e+"\n",this.object.prop("Length",this.content.length)},i.prototype.toReference=function(){return this.object.toReference()},i.prototype.toString=function(){return"stream\n"+this.content+"endstream"}},{"./name":10}],14:[function(e,t,n){var r=t.exports=function(e){this.str=e};r.prototype.toLiteralString=function(){return"("+this.str.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")+")"},r.prototype.toHexString=function(){var e=this;return"<"+function(){var t=[];for(var n=0,r=e.str.length;n<r;++n)t.push(e.str.charCodeAt(n).toString(16));return t}().join("")+">"},r.prototype.toString=function(){return this.toLiteralString()}},{}],15:[function(e,t,n){var r=e("./objects/stream"),i=e("./objects/dictionary"),s=e("./objects/array"),o=e("./objects/name"),u=t.exports=function(e,t){this.doc=e,this.object=this.doc.createObject("Page"),this.contents=new r(e.createObject()),this.fonts=new i({}),this.pageNumber=1,this.cursor={y:this.doc.height-this.doc.opts.padding.top,x:this.doc.padding.left},this.object.addProperty("Parent",t.toReference()),this.object.addProperty("Contents",this.contents.toReference()),this.object.addProperty("Resources",new i({ProcSet:new s([new o("PDF"),new o("Text"),new o("ImageB"),new o("ImageC"),new o("ImageI")]),Font:this.fonts}))};Object.defineProperties(u.prototype,{spaceLeft:{enumerable:!0,get:function(){return this.cursor.y-this.doc.padding.bottom}}}),u.prototype.toReference=function(){return this.object.toReference()}},{"./objects/array":8,"./objects/dictionary":9,"./objects/name":10,"./objects/stream":13}],16:[function(e,t,n){var r=e("./objects/array"),i=e("./page"),s=t.exports=function(e){this.doc=e,this.tree=this.doc.createObject("Pages"),this.pages=[],this.kids=new r,this.tree.addProperty("MediaBox",new r([0,0,e.width,e.height])),this.tree.addProperty("Kids",this.kids),this.tree.addProperty("Count",this.count)};Object.defineProperty(s.prototype,"count",{get:function(){return this.kids.length}}),s.prototype.addPage=function(){var e=new i(this.doc,this.tree);return this.pages.push(e),this.kids.push(e.toReference()),this.tree.addProperty("Count",this.count),this.doc.subsets.forEach(function(t){t.addTo(e)}),e},s.prototype.removePageAt=function(e){this.pages.splice(e,1),this.kids.splice(e,1),this.tree.addProperty("Count",this.count)},s.prototype.toReference=function(){return this.tree.toReference()}},{"./objects/array":8,"./page":15}],17:[function(e,t,n){n.extend=function(e,t){for(var n in t){if(n in e)continue;e[n]=t[n]}return e},n.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1}})}},{}],18:[function(e,t,n){},{}],19:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({tag:r.String(4),checkSum:r.Uint32,offset:r.Uint32,length:r.Uint32}),s=t.exports=new r({scalerType:r.Int32,numTables:r.Uint16,searchRange:r.Uint16.with({$packing:function(){var e,t=1;while((t*=2)<=this.numTables)e=t;return e*16}}),entrySelector:r.Uint16.with({$packing:function(){return Math.log(this.searchRange/16)/Math.LN2}}),rangeShift:r.Uint16.with({$packing:function(){return this.numTables*16-this.searchRange}}),entries:r.Hash(i,"tag",r.Ref("numTables"))})},{structjs:32}],20:[function(e,t,n){var r=t.exports=function(e){this.font=e.clone(),this.subset={32:32},this.mapping={32:32},this.pos=33};r.prototype.use=function(e){for(var t=0,n=e.length;t<n;++t){var r=e.charCodeAt(t);if(r in this.mapping||r<33)continue;this.subset[this.pos]=r,this.mapping[r]=this.pos++}},r.prototype.encode=function(e){var t=[];for(var n=0,r=e.length;n<r;++n)t.push(this.mapping[e.charCodeAt(n)]);return String.fromCharCode.apply(String,t)},r.prototype.cmap=function(){var e={};for(code in this.subset){var t=this.font.codeMap[this.subset[code]];t!==undefined&&(e[code]=t)}return e},r.prototype.glyphs=function(){function s(t){var n={};return t.forEach(function(t){var r=e.font.tables.glyf.for(t);n[t]=r;if(r!==null?r.isCompound:!1){var i=s(r.ids);for(t in i)n[t]=i[t]}}),n}var e=this,t=[0];for(var n in this.subset){var r=this.subset[n],i=this.font.codeMap[r];i!==undefined&&!~t.indexOf(i)&&t.push(i)}return t.sort(),s(t)},r.prototype.embed=function(){var e=this.font.tables.cmap.embed(this.cmap()),t=this.glyphs();this.font.tables.cmap.subtables=[e.subtable];var n={0:0};for(var r in e.charMap){var i=e.charMap[r];n[i.old]=i.new}var s=e.maxGlyphID;for(var o in t)o in n||(n[o]=s++);var u={};for(var a in n)u[n[a]]=a;var f=Object.keys(u).sort(function(e,t){return e-t}),l=f.map(function(e){return u[e]}),c=this.font.tables.glyf.embed(t,l,n);this.font.tables.loca.embed(c),this.font.tables.hmtx.embed(l),this.font.tables.hhea.embed(l),this.font.tables.maxp.embed(l),this.font.tables.name.embed(e.charMap)},r.prototype.save=function(){return this.font.save()}},{}],21:[function(e,t,n){var r=e("structjs"),i=new r({format:r.Uint16},{storage:!0,offset:r.Ref("offset")});i.conditional(function(){return this.format===4},{length:r.Uint16,language:r.Uint16,segCount:r.Uint16.with({$unpacked:function(e){return e/2},$packing:function(e){return e*2}}),searchRange:r.Uint16,entrySelector:r.Uint16,rangeShift:r.Uint16,endCode:r.Array(r.Uint16,r.Ref("segCount")),reservedPad:r.Uint16,startCode:r.Array(r.Uint16,r.Ref("segCount")),idDelta:r.Array(r.Uint16,r.Ref("segCount")),idRangeOffset:r.Array(r.Uint16,r.Ref("segCount")),glyphIndexArray:r.Array(r.Uint16,function(){var e=(this.length-(8+this.segCount*4)*2)/2;return e})}),i.prototype.$unpacked=function(){if(this.format!==4)return;this.codeMap={};for(var e=0,t=this.segCount;e<t;++e){var n=this.endCode[e],r=this.startCode[e],i=this.idDelta[e],s=this.idRangeOffset[e];for(var o=r;o<=n;++o){var u;if(s===0)u=o+i;else{var a=s/2+(o-r)-(this.segCount-e);u=this.glyphIndexArray[a]||0,u!=0&&(u+=i)}this.codeMap[o]=u&65535}}};var s=new r({platformID:r.Uint16,platformSpecificID:r.Uint16,offset:r.Uint32,format:r.Uint16.from(r.Ref("offset")),table:i});Object.defineProperty(s.prototype,"isUnicode",{enumerable:!0,get:function(){return this.platformID===3&&this.platformSpecificID===1||this.platformID===0}});var o=t.exports=new r({version:r.Uint16,numberSubtables:r.Uint16,subtables:r.Array(s,r.Ref("numberSubtables")),tables:r.Storage("subtables.table")});o.prototype.embed=function(e){var t=Object.keys(e).sort(function(e,t){return e-t}),n=0,r={},o={},u=diff=null,a=[],f=[];t.forEach(function(t){var i=e[t];r[i]===undefined&&(r[i]=++n),o[t]={old:i,"new":r[i]};var s=r[i]-t;if(u===null||s!==diff)u&&a.push(u),f.push(t),diff=s;u=t}),u&&a.push(u),a.push(65535),f.push(65535);var l=f.length,c=l*2,h=2*Math.pow(Math.log(l)/Math.LN2,2),p=Math.log(h/2)/Math.LN2,d=2*l-h,v=[],m=[],g=[];for(var y=0,b=f.length;y<b;++y){var w=f[y],E=a[y];if(w===65535){v.push(0),m.push(0);break}var S=o[w].new;if(w-S>=32768){v.push(0),m.push(2*(g.length+l-y));for(var x=w;x<E;++w)g.push(o[x].new)}else v.push(S-w),m.push(0)}var T=new s({platformID:3,platformSpecificID:1,offset:12,table:new i({format:4,length:16+l*8+g.length*2,language:0,segCount:l,searchRange:h,entrySelector:p,rangeShift:d,endCode:a,reservedPad:0,startCode:f,idDelta:v,idRangeOffset:m,glyphIndexArray:g})});return{charMap:o,subtable:T,maxGlyphID:n+1}}},{structjs:32}],22:[function(e,t,n){var r=e("structjs");t.exports=function(e){return new i(e)};var i=function(e){this.loca=e,this.cache={}};i.prototype.clone=function(){var e=new i(this.loca);return e.cache=this.cache,e},i.prototype.embed=function(e,t,n){var r=[],i=0;return this.mapping=t,this.glyphs=e,t.forEach(function(t){var s=e[t];r.push(i);if(!s)return;s.embed(n),i+=s.lengthFor()*s.sizeFor()}),r.push(i),r},i.prototype.for=function(e){if(e in this.cache)return this.cache[e];var t=this.loca.indexOf(e),n=this.loca.lengthOf(e);return n===0?this.cache[e]=null:this.cache[e]=(new c).unpack(new DataView(this.view.buffer,this.view.byteOffset+t,n))},i.prototype.unpack=function(e){return this.view=e,this},i.prototype.pack=function(e,t){var n=this;this.mapping.forEach(function(r){var i=n.glyphs[r];if(!i)return;i.pack(e,t),t+=i.lengthFor()*i.sizeFor()})},i.prototype.lengthFor=function(){return 1},i.prototype.sizeFor=function(){var e=0;for(var t in this.cache){var n=this.cache[t];if(!n)continue;e+=n.lengthFor()*n.sizeFor()}return e};var s=1,o=8,u=32,a=64,f=128,l=256,c=function(){};c.prototype.unpack=function(e){this.view=e,this.isCompound=e.getInt16(0)===-1;if(this.isCompound){this.ids=[],this.offsets=[];var t=10;for(;;){var n=this.view.getInt16(t),r=this.view.getInt16(t+2);this.ids.push(r),this.offsets.push(t+2);if(!(n&u))break;t+=4,n&s?t+=4:t+=2,n&f?t+=8:n&a?t+=4:n&o&&(t+=2)}}return this},c.prototype.pack=function(e,t){for(var n=0,r=this.view.byteLength;n<r;++n)e.setUint8(t+n,this.view.getUint8(n))},c.prototype.lengthFor=function(){return 1},c.prototype.sizeFor=function(){return this.view.byteLength},c.prototype.embed=function(e){if(!this.isCompound)return;var t=this;this.ids.forEach(function(n,r){t.view.setUint16(t.offsets[r],e[n])})}},{structjs:32}],23:[function(e,t,n){var r=e("structjs");t.exports=new r({version:r.Int32,fontRevision:r.Int32,checkSumAdjustment:r.Uint32,magicNumber:r.Uint32,flags:r.Uint16,unitsPerEm:r.Uint16,createdA:r.Int32,createdB:r.Int32,modifiedA:r.Int32,modifiedB:r.Int32,xMin:r.Int16,yMin:r.Int16,xMax:r.Int16,yMax:r.Int16,macStyle:r.Uint16,lowestRecPPEM:r.Uint16,fontDirectionHint:r.Int16,indexToLocFormat:r.Int16,glyphDataFormat:r.Int16})},{structjs:32}],24:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,ascent:r.Int16,descent:r.Int16,lineGap:r.Int16,advanceWidthMax:r.Uint16,minLeftSideBearing:r.Int16,minRightSideBearing:r.Int16,xMaxExtent:r.Int16,caretSlopeRise:r.Int16,caretSlopeRun:r.Int16,caretOffset:r.Int16,reserved1:r.Int16,reserved2:r.Int16,reserved3:r.Int16,reserved4:r.Int16,metricDataFormat:r.Int16,numOfLongHorMetrics:r.Uint16});i.prototype.embed=function(e){this.numOfLongHorMetrics=e.length}},{structjs:32}],25:[function(e,t,n){var r=e("structjs"),i=new r({advanceWidth:r.Uint16,leftSideBearing:r.Int16});t.exports=function(e,t){var n=new r({hMetrics:r.Array(i,e),leftSideBearing:r.Array(r.Uint16,t-e)});return n.prototype.$unpacked=function(){var e=this.metrics=[];this.hMetrics.forEach(function(t){e.push(t.advanceWidth)});var t=e[e.length-1];this.leftSideBearing.forEach(function(n){e.push(t)})},n.prototype.for=function(e){return e in this.hMetrics?this.hMetrics[e]:new i({advanceWidth:this.hMetrics[this.hMetrics.length-1].advance,leftSideBearing:this.leftSideBearing[e-this.hMetrics
.length]})},n.prototype.embed=function(e){var t=this,n=[];e.forEach(function(e){n.push(t.for(e))}),this.hMetrics=n,this.leftSideBearing=[],this._definition.hMetrics._length=e.length,this._definition.leftSideBearing._length=0},n}},{structjs:32}],26:[function(e,t,n){var r=e("structjs");t.exports=function(e,t){var n;switch(e){case 0:n=new r({offsets:r.Array(r.Uint16,t+1)}),n.prototype.$unpacked=function(){for(var e=0,t=this.offsets.length;e<t;++e)this.offsets[e]*=2},n.prototype.$packing=function(){for(var e=0,t=this.offsets.length;e<t;++e)this.offsets[e]/=2};break;case 1:n=new r({offsets:r.Array(r.Uint32,t+1)})}return n.prototype.indexOf=function(e){return this.offsets[e]},n.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},n.prototype.embed=function(e){this._definition.offsets._length=e.length,this.offsets=e},n}},{structjs:32}],27:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,numGlyphs:r.Uint16,maxPoints:r.Uint16,maxContours:r.Uint16,maxComponentPoints:r.Uint16,maxComponentContours:r.Uint16,maxZones:r.Uint16,maxTwilightPoints:r.Uint16,maxStorage:r.Uint16,maxFunctionDefs:r.Uint16,maxInstructionDefs:r.Uint16,maxStackElements:r.Uint16,maxSizeOfInstructions:r.Uint16,maxComponentElements:r.Uint16,maxComponentDepth:r.Uint16});i.prototype.embed=function(e){this.numGlyphs=e.length}},{structjs:32}],28:[function(e,t,n){var r=e("structjs"),i=new r({platformID:r.Uint16,encodingID:r.Uint16,languageID:r.Uint16,nameID:r.Uint16,length:r.Uint16.with({$unpacked:function(e){return e/2},$packing:function(e){return e*2}}),offset:r.Uint16,string:r.String({storage:!0,size:2,length:r.Ref("length"),offset:r.Ref("offset")})}),s=t.exports=new r({format:r.Uint16,count:r.Uint16,stringOffset:r.Uint16,records:r.Array(i,r.Ref("count")),names:r.Storage("records.string",r.Ref("stringOffset"))});s.prototype.embed=function(e){var t=null;for(var n=0;n<this.records.length;++n){var r=this.records[n];r.nameID===6&&(t===null&&(t=r.string),this.records.splice(n--,1))}this.records.push(new i({platformID:1,encodingID:0,languageID:0,nameID:6,length:0,offset:0,string:"MARKUS+"+t}))}},{structjs:32}],29:[function(e,t,n){var r=e("structjs");t.exports=(new r({version:r.Uint16,xAvgCharWidth:r.Int16,usWeightClass:r.Uint16,usWidthClass:r.Uint16,fsType:r.Uint16,ySubscriptXSize:r.Int16,ySubscriptYSize:r.Int16,ySubscriptXOffset:r.Int16,ySubscriptYOffset:r.Int16,ySuperscriptXSize:r.Int16,ySuperscriptYSize:r.Int16,ySuperscriptXOffset:r.Int16,ySuperscriptYOffset:r.Int16,yStrikeoutSize:r.Int16,yStrikeoutPosition:r.Int16,sFamilyClass:r.Int16,panose:r.Array(r.Uint8,10),ulUnicodeRange1:r.Uint32,ulUnicodeRange2:r.Uint32,ulUnicodeRange3:r.Uint32,ulUnicodeRange4:r.Uint32,achVendID:r.Array(r.Int8,4),fsSelection:r.Uint16,usFirstCharIndex:r.Uint16,usLastCharIndex:r.Uint16})).conditional(function(){return this.version>0},{sTypoAscender:r.Int16,sTypoDescender:r.Int16,sTypoLineGap:r.Int16,usWinAscent:r.Uint16,usWinDescent:r.Uint16,ulCodePageRange1:r.Uint32,ulCodePageRange2:r.Uint32}).conditional(function(){return this.version>1},{sxHeight:r.Int16,sCapHeight:r.Int16,usDefaultChar:r.Uint16,usBreakChar:r.Uint16,usMaxContext:r.Uint16})},{structjs:32}],30:[function(e,t,n){var r=e("structjs"),i=t.exports=new r({version:r.Int32,italicAngleHi:r.Int16,italicAngleLow:r.Int16,underlinePosition:r.Int16,underlineThickness:r.Int16,isFixedPitch:r.Uint32,minMemType42:r.Uint32,maxMemType42:r.Uint32,minMemType1:r.Uint32,maxMemType1:r.Uint32})},{structjs:32}],31:[function(e,t,n){function o(e){var t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(var r=0;r<e.length;++r)n[r]=e[r];return t}var r=e("./directory"),i=e("./subset"),s=t.exports=function(t){function u(r,i){var o=r.replace(/[^a-z0-9]/ig,"").toLowerCase(),u=n.directory.entries[r];if(!u)return;if(t instanceof s){n.tables[o]=n.tables[r]=t.tables[r].clone();return}var a=e("./table/"+o),f=new DataView(t,u.offset,u.length);i&&(a=a.apply(undefined,i)),n.tables[o]=n.tables[r]=(typeof a=="function"?new a:a).unpack(f)}var n=this;this.buffer=t instanceof s?t.buffer:t=t instanceof ArrayBuffer?t:o(t),t instanceof s?this.directory=t.directory.clone():(this.directory=new r,this.directory.unpack(new DataView(t)));var i=this.directory.scalerType.toString(16);if(i!=="74727565"&&i!=="10000")throw new Error("Not a TrueType font");this.tables={},u("cmap");for(var a=0,f=this.tables.cmap.subtables.length;a<f;++a){var l=this.tables.cmap.subtables[a];if(l.isUnicode){n.codeMap=l.table.codeMap;break}}if(!this.codeMap)throw new Error("Font does not contain a Unicode Cmap.");u("head"),u("hhea"),u("maxp"),u("hmtx",[this.tables.hhea.numOfLongHorMetrics,this.tables.maxp.numGlyphs]),u("loca",[this.tables.head.indexToLocFormat,this.tables.maxp.numGlyphs]),u("glyf",[this.tables.loca]),u("name"),u("post"),this.tables.post.version=196608,u("OS/2"),this.baseFont=this.tables.name.records.filter(function(e){return e.nameID===6})[0].string,this.fontName="MARKUS+"+this.baseFont,this.scaleFactor=1e3/this.tables.head.unitsPerEm,this.italicAngle=parseFloat(this.tables.post.italicAngleHi+"."+this.tables.post.italicAngleLow);var c=this.tables.os2||{};this.ascent=Math.round((c.sTypoAscender||this.tables.hhea.ascent)*this.scaleFactor),this.descent=Math.round((c.sTypoDescender||this.tables.hhea.descent)*this.scaleFactor),this.lineGap=Math.round((c.sTypoLineGap||this.tables.hhea.lineGap)*this.scaleFactor),this.capHeight=c.sCapHeight||this.ascent,this.stemV=0,this.bbox=[this.tables.head.xMin,this.tables.head.yMin,this.tables.head.xMax,this.tables.head.yMax].map(function(e){return Math.round(e*n.scaleFactor)});var h=0,p=(c.sFamilyClass||0)>>8,d=!!~[1,2,3,4,5,6,7].indexOf(p);this.tables.post.isFixedPitch&&(h|=1),d&&(h|=2),p===10&&(h|=8),this.italicAngle!==0&&(h|=64),h|=32,this.flags=h,this.widths=[];for(var v in this.codeMap){if(v<32)continue;var m=this.codeMap[v];this.widths.push(Math.round(this.tables.hmtx.metrics[m]*this.scaleFactor))}};s.prototype.stringWidth=function(e,t){var n=0,r=t/1e3;for(var i=0,s=e.length;i<s;++i){var o=e.charCodeAt(i)-32;n+=this.widths[o]||0}return n*r},s.prototype.lineHeight=function(e,t){t==null&&(t=!1);var n=t?this.lineGap:0;return(this.ascent+n-this.descent)/1e3*e},s.prototype.subset=function(){return new i(this)},s.TABLES=["cmap","glyf","loca","hmtx","hhea","maxp","post","name","head","OS/2"],s.prototype.clone=function(){var e=new s(this);return e.tables.glyf.view=this.tables.glyf.view,e},s.prototype.save=function(){var e=this,t=s.TABLES;for(var n in this.directory.entries)~t.indexOf(n)||delete this.directory.entries[n];var r=offset=this.directory.lengthFor(this.directory,!0)*this.directory.sizeFor(this.directory,!0);t.forEach(function(t){if(!(t in e.directory.entries))return;var n=e.tables[t],i=n?n.lengthFor(n,!0)*n.sizeFor(n,!0):e.directory.entries[t].length;r+=i+i%4}),this.tables.head.checkSumAdjustment=0;var i=new DataView(new ArrayBuffer(r));t.forEach(function(t){if(!(t in e.directory.entries))return;var n=e.tables[t],r=e.directory.entries[t];if(!n){var s=new DataView(e.buffer,r.offset,r.length);for(var o=0;o<r.length;++o)i.setUint8(offset+o,s.getUint8(o));r.offset=offset}else n.pack(i,offset),r.offset=offset,r.length=n.lengthFor(n,!0)*n.sizeFor(n,!0);var u=r.length%4,a=r.length+u;for(var o=r.offset+r.length,f=o+u;o<f;++o)i.setInt8(o,0);var l=0;for(var o=0;o<a;o+=4)l+=i.getInt32(offset+o);r.checkSum=l,offset+=a}),this.directory.pack(i,0);var o=0;for(var u=0;u<r;u+=4)o+=i.getInt32(u);return this.tables.head.checkSumAdjustment=2981146554-o,this.tables.head.pack(i,this.directory.entries.head.offset),i.buffer},s.Subset=i},{"./directory":19,"./subset":20,"./table/cmap":21,"./table/glyf":22,"./table/head":23,"./table/hhea":24,"./table/hmtx":25,"./table/loca":26,"./table/maxp":27,"./table/name":28,"./table/os2":29,"./table/post":30}],32:[function(e,t,n){function c(e){if(e===undefined)return undefined;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return[].concat(e);if(typeof e=="object"){var t={};for(key in e)t[key]=c(e[key]);return t}return e}var r=e("./types/number"),i=e("./types/string"),s=e("./types/hash"),o=e("./types/array"),u=e("./types/reference"),a=e("./types/storage"),f=e("./utils"),l=t.exports=function(e,t){t||(t={});var n=function(t){Object.defineProperties(this,{_view:{writable:!0,value:null},_offset:{writable:!0,value:null},_definition:{writable:!1,value:e}});for(var n in t)n in e&&(this[n]=c(t[n]));var r=this;i.forEach(function(e){for(var n in t)n in e.extension&&(r[n]=c(t[n]))})};Object.defineProperties(n,{_offset:{writable:!0,value:null},_definition:{writable:!1,value:e}}),n.storage=t.storage,n._offset=t.offset,f.methodsFor(n,"_offset","offsetFor","setOffset");var i=[];return n.conditional=function(e,t){return i.push({condition:e,extension:t}),this},n.prototype.unpack=function(t,n){function s(e){for(var i in e){var s=e[i];e[i].prop=i;if(s.storage)continue;r[i]=s.read(t,n),typeof s.$unpacked=="function"&&(r[i]=s.$unpacked.call(r,r[i])),r[i]===undefined&&delete r[i],s.external||(n+=s.lengthFor(r)*s.sizeFor(r))}}if(t instanceof DataView){n||(n=0),this._view=t;var r=this;return s.parent=this,s(e),i.forEach(function(e){if(!e.condition.call(r))return;s(e.extension)}),typeof this.$unpacked=="function"&&this.$unpacked(),this}throw new Error("DataView expected")},n.prototype.pack=function(t,n){function o(e){var i=n;for(var o in e){var u=e[o];if(u.external||u.storage)continue;u instanceof a&&u.write(t,n,s[o],n-i),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}n=i;for(var o in e){var u=e[o];if(u.external||u.storage)continue;!(u instanceof r)&&!(u instanceof a)&&u.write(t,n,s[o]),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}n=i;for(var o in e){var u=e[o];if(u.external||u.storage)continue;var f=s[o];typeof u.$packing=="function"&&(f=u.$packing.call(s,f)),u instanceof r&&u.write(t,n,f),n+=u.lengthFor(s,!0)*u.sizeFor(s,!0)}}typeof this.$packing=="function"&&this.$packing(),t||(t=new DataView(new ArrayBuffer(this.lengthFor(this,!0)*this.sizeFor(this,!0)))),n||(n=0);var s=this;return o.parent=this,o(e),i.forEach(function(e){if(!e.condition.call(s))return;o(e.extension)}),t.buffer},n.read=function s(e,t){var n=new this,r=s.caller.parent,i=this.storage?this.offsetFor(r):t;return n.unpack(e,i),n},n.write=function o(e,t,n,r){var i=o.caller.parent,s=this.storage?t+this.offsetFor(i):t;this.setOffset(this.storage?r+this.offsetFor(i):t,i),n.pack(e,s)},n.prototype.lengthFor=n.lengthFor=function(){return 1},n.prototype.sizeFor=n.sizeFor=function(t,n){function s(e){return Object.keys(e).filter(function(t){return!e[t].external&&!e[t].storage}).map(function(r){return e[r].lengthFor(t,!!n)*e[r].sizeFor(t,!!n)}).reduce(function(e,t){return e+t},0)}var r=this,o=s(e);return i.forEach(function(e){if(!e.condition.call(t))return;o+=s(e.extension)}),o},n.prototype.clone=function(){var e=new n(this);return typeof e.$unpacked=="function"&&e.$unpacked(),e},n};l.Int8=new r("getInt8","setInt8",1),l.Uint8=new r("getUint8","setUint8",1),l.Int16=new r("getInt16","setInt16",2),l.Uint16=new r("getUint16","setUint16",2),l.Int32=new r("getInt32","setInt32",4),l.Uint32=new r("getUint32","setUint32",4),l.Float32=new r("getFloat32","setFloat32",4),l.Float64=new r("getFloat64","setFloat64",8),l.String=function(e){return new i(e)},l.Hash=function(e,t,n){return new s(e,t,n)},l.Array=function(e,t){return new o(e,t)},l.Reference=l.Ref=function(e){return new u(e)},l.Storage=function(e,t){return new a(e,t)}},{"./types/array":33,"./types/hash":34,"./types/number":35,"./types/reference":36,"./types/storage":37,"./types/string":38,"./utils":39}],33:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e,t){this.struct=e,Object.defineProperties(this,{_length:{value:t,writable:!0}})};s.prototype.read=function o(e,t){var n=[],r=o.caller.parent;for(var i=0,s=this.lengthFor(r);i<s;++i){var u;typeof this.struct=="function"?(u=new this.struct,u.unpack(e,t),t+=u.lengthFor(r)*u.sizeFor(r)):(u=this.struct.read(e,t),t+=this.struct.lengthFor(r)*this.struct.sizeFor(r)),n.push(u)}return n},s.prototype.write=function u(e,t,n){var r=u.caller.parent,i;this.setLength(this.lengthFor(r,!0),r);for(var s=0,o=this.lengthFor(r,!0);s<o;++s){if((i=n[s])===undefined)break;typeof this.struct=="function"?(i.pack(e,t),t+=i.lengthFor(r)*i.sizeFor(r)):(this.struct.write(e,t,i),t+=this.struct.lengthFor(r)*this.struct.sizeFor(r))}},s.prototype.sizeFor=function(e){return(this.struct.sizeFor?this.struct.sizeFor(e):this.struct.prototype.sizeFor(e))*(this.struct.lengthFor?this.struct.lengthFor(e):this.struct.prototype.lengthFor(e))},s.prototype.lengthFor=function(e,t){return this._length?this._length instanceof i?t?e[this.prop].length:e[this._length.prop]:typeof this._length=="function"?this._length.call(e):this._length:0},s.prototype.setLength=function(e,t){if(this._length instanceof i)t[this._length.prop]=e;else{if(typeof this._length=="function")return;this._length=e}}},{"../utils":39,"./reference":36}],34:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e,t,n){this.struct=e,this.key=t,Object.defineProperties(this,{_length:{value:n,writable:!0}})};s.prototype.read=function o(e,t){var n={},r=o.caller.parent;for(var i=0,s=this.lengthFor(r);i<s;++i){var u=new this.struct;u.unpack(e,t),t+=u.lengthFor(r)*u.sizeFor(r),n[u[this.key]]=u}return n},s.prototype.write=function u(e,t,n){var r=Object.keys(n),i=u.caller.parent,s;this.setLength(this.lengthFor(i,!0),i);for(var o=0,a=this.lengthFor(i);o<a;++o){if(!(s=n[r[o]]))continue;s.pack(e,t),t+=s.lengthFor(i)*s.sizeFor(i)}},s.prototype.sizeFor=function(e){return(this.struct.sizeFor?this.struct.sizeFor(e):this.struct.prototype.sizeFor(e))*(this.struct.lengthFor?this.struct.lengthFor(e):this.struct.prototype.lengthFor(e))},s.prototype.lengthFor=function(e,t){return this._length?this._length instanceof i?t?Object.keys(e[this.prop]).length:e[this._length.prop]:this._length:0},s.prototype.setLength=function(e,t){this._length instanceof i?t[this._length.prop]=e:this._length=e}},{"../utils":39,"./reference":36}],35:[function(e,t,n){var r=e("../utils"),i=t.exports=function(e,t,n){this.methods={read:e,write:t},Object.defineProperties(this,{_offset:{value:null,writable:!0},_length:{value:null,writable:!0}}),r.options.call(this,n)};i.prototype.with=function(e){return e.length||(e.length=this._length),new i(this.methods.read,this.methods.write,e)},i.prototype.from=function(e){return this.with({external:!0,offset:e})},i.prototype.read=function s(e,t){var n=s.caller.parent;return e[this.methods.read](this.external?this.offsetFor(n):t)},i.prototype.write=function o(e,t,n){var r=o.caller.parent;e[this.methods.write](this.external?this.offsetFor(r):t,n)},i.prototype.lengthFor=function(){return 1},i.prototype.sizeFor=function(){return this._length},r.methodsFor(i.prototype,"_offset","offsetFor","setOffset")},{"../utils":39}],36:[function(e,t,n){var r=t.exports=function(e){this.prop=e}},{}],37:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=e("./array"),o=t.exports=function(e,t){this.path=e,t instanceof i&&(t={offset:t}),t=t||{},Object.defineProperties(this,{_offset:{value:t.offset,writable:!0}})};o.prototype.read=function u(e,t){var n=u.caller.parent,r=this.offsetFor(n)||t;!function i(t,n,o){var u=t.shift(),a=n[u];i.parent=o,t.length?a instanceof s?o[u].forEach(function(e){i(t.concat([]),a.struct._definition,e)}):i(t,a,o[u]):o[u]=a.read(e,r)}(this.path.split("."),n._definition,n)},o.prototype.write=function a(e,t,n,r){var i=a.caller.parent,o=0;this.setOffset(r,i),!function u(n,i,a){var f=n.shift(),l=i[f];u.parent=a;if(!n.length){l.setOffset(o,a);var c=a[f],a=l.prototype?a[f]:a;l.write(e,t,c,r),o+=l.lengthFor(a,!0)*l.sizeFor(a,!0)}else l instanceof s?a[f].forEach(function(e){u(n.concat([]),l.struct._definition,e)}):u(n,l,a[f])}(this.path.split("."),i._definition,i)},o.prototype.lengthFor=function(){return 1},o.prototype.sizeFor=function(e,t){var n=0;return!function r(e,i,o){var u=e.shift(),a=i[u];r.parent=o,e.length?a instanceof s?o[u].forEach(function(t){r(e.concat([]),a.struct._definition,t)}):r(e,a,o[u]):(a.prototype&&(o=o[u]),n+=a.lengthFor(o,t)*a.sizeFor(o,t))}(this.path.split("."),e._definition,e),n},r.methodsFor(o.prototype,"_offset","offsetFor","setOffset")},{"../utils":39,"./array":33,"./reference":36}],38:[function(e,t,n){var r=e("../utils"),i=e("./reference"),s=t.exports=function(e){Object.defineProperties(this,{_offset:{value:null,writable:!0},_length:{value:null,writable:!0},_size:{value:null,writable:!0}}),r.options.call(this,e)};s.prototype.read=function o(e,t){var n=[],r,i=o.caller.parent,s=this.external?this.offsetFor(i):this.storage?t+this.offsetFor(i):t;for(var u=0,a=this.lengthFor(i),f=this.sizeFor()===2?2:1;u<a;++u)n.push(e[this.sizeFor()===2?"getUint16":"getUint8"](s+u*f,this.littleEndian));return String.fromCharCode.apply(null,n)},s.prototype.write=function u(e,t,n){var r=[],i,s=u.caller.parent,o=this.external?this.offsetFor(s):this.storage?t+this.offsetFor(s):t;this.setLength(this.lengthFor(s,!0),s);for(var a=0,f=this.lengthFor(s),l=this.sizeFor()===2?2:1;a<f;++a){var c=n.charCodeAt(a)||0;e[this.sizeFor()===2?"setUint16":"setUint8"](o+a*l,c,this.littleEndian)}},s.prototype.sizeFor=function(){return this._size||1},s.prototype.lengthFor=function(e,t){return this._length instanceof i?t?e[this.prop].length:e[this._length.prop]:this._length||0},s.prototype.setLength=function(e,t){this._length instanceof i?t[this._length.prop]=e:this._length=e},r.methodsFor(s.prototype,"_offset","offsetFor","setOffset")},{"../utils":39,"./reference":36}],39:[function(e,t,n){var r=e("./types/reference");n.methodsFor=function(e,t,n,i){e[n]=function(e){return this[t]?this[t]instanceof r?e[this[t].prop]:typeof this[t]=="function"?this[t].call(e):this[t]:0};if(!i)return;e[i]=function(e,n){this[t]instanceof r?n[this[t].prop]=e:this[t]=e}},n.options=function(e){typeof e=="object"?(this._offset=e.offset,this._length=e.length,this._size=e.size,this.$unpacked=e.$unpacked,this.$packing=e.$packing,this.external=e.external===!0,this.storage=e.storage,this.littleEndian=e.littleEndian===!0):this._length=e}},{"./types/reference":36}]},{},[4])(4)});

@@ -6,3 +6,3 @@ # pdfjs

{ "name": "pdfjs",
"version": "0.2.1" }
"version": "0.2.2" }
```

@@ -9,0 +9,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc