blocktrail-sdk
Version:
BlockTrail's Developer Friendly API binding for NodeJS
132 lines • 80.1 kB
JavaScript
/**
* jsPDF - PDF Document creation from JavaScript
* Version 1.0.0-trunk Built on 2014-02-13T03:39
* Commit 30c4420eed876d9d066199a796c7b988981c5493
*
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, willow-systems.com
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth,
*/
/**
* jsPDF addImage plugin (JPEG only at this time)
* Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
* 2013 Chris Dowling, https://github.com/gingerchris
* 2013 Trinh Ho, https://github.com/ineedfat
* 2013 Edwin Alejandro Perez, https://github.com/eaparango
* 2013 Norah Smith, https://github.com/burnburnrocket
* 2014 Diego Casorran, https://github.com/diegocr
*/
/**
* jsPDF Cell plugin
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
* 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Hall, james@parall.ax
*/
/**
* jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser, jQuery
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 Diego Casorran, https://github.com/diegocr
*/
/**
* jsPDF JavaScript plugin
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
*/
/**
jsPDF Silly SVG plugin
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
*/
/**
jsPDF split_text_to_size plugin
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
MIT license.
*/
/**
jsPDF standard_fonts_metrics plugin
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
MIT license.
*/
/**
* jsPDF total_pages plugin
* Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
*/
/* Blob.js
* A Blob implementation.
* 2013-01-23
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/eboyjr
* License: X11/MIT
* See LICENSE.md
*/
/*
* Copyright (c) 2012 chick307 <chick307@gmail.com>
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
/*
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 2013-01-23
* By Eli Grey, http://eligrey.com
* License: X11/MIT
* See LICENSE.md
*/
!function(t,e){function n(){"use strict";function t(t){var e,n,s,o,i,a,u=r.dyn_tree,c=r.stat_desc.static_tree,f=r.stat_desc.extra_bits,d=r.stat_desc.extra_base,w=r.stat_desc.max_length,m=0;for(o=0;l>=o;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;h>e;e++)n=t.heap[e],o=u[2*u[2*n+1]+1]+1,o>w&&(o=w,m++),u[2*n+1]=o,n>r.max_code||(t.bl_count[o]++,i=0,n>=d&&(i=f[n-d]),a=u[2*n],t.opt_len+=a*(o+i),c&&(t.static_len+=a*(c[2*n+1]+i)));if(0!==m){do{for(o=w-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[w]--,m-=2}while(m>0);for(o=w;0!==o;o--)for(n=t.bl_count[o];0!==n;)s=t.heap[--e],s>r.max_code||(u[2*s+1]!=o&&(t.opt_len+=(o-u[2*s+1])*u[2*s],u[2*s+1]=o),n--)}}function e(t,e){var n=0;do n|=1&t,t>>>=1,n<<=1;while(--e>0);return n>>>1}function n(t,n,r){var s,o,i,a=[],u=0;for(s=1;l>=s;s++)a[s]=u=u+r[s-1]<<1;for(o=0;n>=o;o++)i=t[2*o+1],0!==i&&(t[2*o]=e(a[i]++,i))}var r=this;r.build_tree=function(e){var s,o,i,a=r.dyn_tree,u=r.stat_desc.static_tree,c=r.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=h,s=0;c>s;s++)0!==a[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):a[2*s+1]=0;for(;e.heap_len<2;)i=e.heap[++e.heap_len]=2>l?++l:0,a[2*i]=1,e.depth[i]=0,e.opt_len--,u&&(e.static_len-=u[2*i+1]);for(r.max_code=l,s=Math.floor(e.heap_len/2);s>=1;s--)e.pqdownheap(a,s);i=c;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],e.pqdownheap(a,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,a[2*i]=a[2*s]+a[2*o],e.depth[i]=Math.max(e.depth[s],e.depth[o])+1,a[2*s+1]=a[2*o+1]=i,e.heap[1]=i++,e.pqdownheap(a,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],t(e),n(a,r.max_code,e.bl_count)}}function r(t,e,n,r,s){var o=this;o.static_tree=t,o.extra_bits=e,o.extra_base=n,o.elems=r,o.max_length=s}function s(t,e,n,r,s){var o=this;o.good_length=t,o.max_lazy=e,o.nice_length=n,o.max_chain=r,o.func=s}function o(t,e,n,r){var s=t[2*e],o=t[2*n];return o>s||s==o&&r[e]<=r[n]}function i(){function t(){var t;for(Fe=2*Se,Ee[Pe-1]=0,t=0;Pe-1>t;t++)Ee[t]=0;Ke=M[Ve].max_lazy,Ye=M[Ve].good_length,Xe=M[Ve].nice_length,Ge=M[Ve].max_chain,He=0,Ue=0,Je=0,Le=We=se-1,De=0,je=0}function e(){var t;for(t=0;p>t;t++)$e[2*t]=0;for(t=0;f>t;t++)Ze[2*t]=0;for(t=0;d>t;t++)tn[2*t]=0;$e[2*v]=1,en.opt_len=en.static_len=0,un=ln=0}function s(){nn.dyn_tree=$e,nn.stat_desc=r.static_l_desc,rn.dyn_tree=Ze,rn.stat_desc=r.static_d_desc,sn.dyn_tree=tn,sn.stat_desc=r.static_bl_desc,dn=0,wn=0,fn=8,e()}function i(t,e){var n,r,s=-1,o=t[1],i=0,a=7,u=4;for(0===o&&(a=138,u=3),t[2*(e+1)+1]=65535,n=0;e>=n;n++)r=o,o=t[2*(n+1)+1],++i<a&&r==o||(u>i?tn[2*r]+=i:0!==r?(r!=s&&tn[2*r]++,tn[2*g]++):10>=i?tn[2*q]++:tn[2*b]++,i=0,s=r,0===o?(a=138,u=3):r==o?(a=6,u=3):(a=7,u=4))}function a(){var t;for(i($e,nn.max_code),i(Ze,rn.max_code),sn.build_tree(en),t=d-1;t>=3&&0===tn[2*n.bl_order[t]+1];t--);return en.opt_len+=3*(t+1)+5+5+4,t}function u(t){en.pending_buf[en.pending++]=t}function c(t){u(255&t),u(t>>>8&255)}function l(t){u(t>>8&255),u(255&t&255)}function w(t,e){var n,r=e;wn>x-r?(n=t,dn|=n<<wn&65535,c(dn),dn=n>>>x-wn,wn+=r-x):(dn|=t<<wn&65535,wn+=r)}function h(t,e){var n=2*t;w(65535&e[n],65535&e[n+1])}function y(t,e){var n,r,s=-1,o=t[1],i=0,a=7,u=4;for(0===o&&(a=138,u=3),n=0;e>=n;n++)if(r=o,o=t[2*(n+1)+1],!(++i<a&&r==o)){if(u>i){do h(r,tn);while(0!==--i)}else 0!==r?(r!=s&&(h(r,tn),i--),h(g,tn),w(i-3,2)):10>=i?(h(q,tn),w(i-3,3)):(h(b,tn),w(i-11,7));i=0,s=r,0===o?(a=138,u=3):r==o?(a=6,u=3):(a=7,u=4)}}function B(t,e,r){var s;for(w(t-257,5),w(e-1,5),w(r-4,4),s=0;r>s;s++)w(tn[2*n.bl_order[s]+1],3);y($e,t-1),y(Ze,e-1)}function $(){16==wn?(c(dn),dn=0,wn=0):wn>=8&&(u(255&dn),dn>>>=8,wn-=8)}function ae(){w(ne<<1,3),h(v,r.static_ltree),$(),9>1+fn+10-wn&&(w(ne<<1,3),h(v,r.static_ltree),$()),fn=7}function ue(t,e){var r,s,o;if(en.pending_buf[cn+2*un]=t>>>8&255,en.pending_buf[cn+2*un+1]=255&t,en.pending_buf[on+un]=255&e,un++,0===t?$e[2*e]++:(ln++,t--,$e[2*(n._length_code[e]+m+1)]++,Ze[2*n.d_code(t)]++),0===(8191&un)&&Ve>2){for(r=8*un,s=He-Ue,o=0;f>o;o++)r+=Ze[2*o]*(5+n.extra_dbits[o]);if(r>>>=3,ln<Math.floor(un/2)&&r<Math.floor(s/2))return!0}return un==an-1}function ce(t,e){var r,s,o,i,a=0;if(0!==un)do r=en.pending_buf[cn+2*a]<<8&65280|255&en.pending_buf[cn+2*a+1],s=255&en.pending_buf[on+a],a++,0===r?h(s,t):(o=n._length_code[s],h(o+m+1,t),i=n.extra_lbits[o],0!==i&&(s-=n.base_length[o],w(s,i)),r--,o=n.d_code(r),h(o,e),i=n.extra_dbits[o],0!==i&&(r-=n.base_dist[o],w(r,i)));while(un>a);h(v,t),fn=t[2*v+1]}function le(){wn>8?c(dn):wn>0&&u(255&dn),dn=0,wn=0}function fe(t,e,n){le(),fn=8,n&&(c(e),c(~e)),en.pending_buf.set(Re.subarray(t,t+e),en.pending),en.pending+=e}function de(t,e,n){w((ee<<1)+(n?1:0),3),fe(t,e,!0)}function we(t,n,s){var o,i,u=0;Ve>0?(nn.build_tree(en),rn.build_tree(en),u=a(),o=en.opt_len+3+7>>>3,i=en.static_len+3+7>>>3,o>=i&&(o=i)):o=i=n+5,o>=n+4&&-1!=t?de(t,n,s):i==o?(w((ne<<1)+(s?1:0),3),ce(r.static_ltree,r.static_dtree)):(w((re<<1)+(s?1:0),3),B(nn.max_code+1,rn.max_code+1,u+1),ce($e,Ze)),e(),s&&le()}function me(t){we(Ue>=0?Ue:-1,He-Ue,t),Ue=He,be.flush_pending()}function pe(){var t,e,n,r;do{if(r=Fe-Je-He,0===r&&0===He&&0===Je)r=Se;else if(-1==r)r--;else if(He>=Se+Se-ie){Re.set(Re.subarray(Se,Se+Se),0),Me-=Se,He-=Se,Ue-=Se,t=Pe,n=t;do e=65535&Ee[--n],Ee[n]=e>=Se?e-Se:0;while(0!==--t);t=Se,n=t;do e=65535&Te[--n],Te[n]=e>=Se?e-Se:0;while(0!==--t);r+=Se}if(0===be.avail_in)return;t=be.read_buf(Re,He+Je,r),Je+=t,Je>=se&&(je=255&Re[He],je=(je<<Be^255&Re[He+1])&Ie)}while(ie>Je&&0!==be.avail_in)}function he(t){var e,n=65535;for(n>ke-5&&(n=ke-5);;){if(1>=Je){if(pe(),0===Je&&t==C)return W;if(0===Je)break}if(He+=Je,Je=0,e=Ue+n,(0===He||He>=e)&&(Je=He-e,He=e,me(!1),0===be.avail_out))return W;if(He-Ue>=Se-ie&&(me(!1),0===be.avail_out))return W}return me(t==F),0===be.avail_out?t==F?K:W:t==F?V:G}function ve(t){var e,n,r=Ge,s=He,o=We,i=He>Se-ie?He-(Se-ie):0,a=Xe,u=Ae,c=He+oe,l=Re[s+o-1],f=Re[s+o];We>=Ye&&(r>>=2),a>Je&&(a=Je);do if(e=t,Re[e+o]==f&&Re[e+o-1]==l&&Re[e]==Re[s]&&Re[++e]==Re[s+1]){s+=2,e++;do;while(Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&Re[++s]==Re[++e]&&c>s);if(n=oe-(c-s),s=c-oe,n>o){if(Me=t,o=n,n>=a)break;l=Re[s+o-1],f=Re[s+o]}}while((t=65535&Te[t&u])>i&&0!==--r);return Je>=o?o:Je}function ye(t){for(var e,n=0;;){if(ie>Je){if(pe(),ie>Je&&t==C)return W;if(0===Je)break}if(Je>=se&&(je=(je<<Be^255&Re[He+(se-1)])&Ie,n=65535&Ee[je],Te[He&Ae]=Ee[je],Ee[je]=He),0!==n&&Se-ie>=(He-n&65535)&&Qe!=z&&(Le=ve(n)),Le>=se)if(e=ue(He-Me,Le-se),Je-=Le,Ke>=Le&&Je>=se){Le--;do He++,je=(je<<Be^255&Re[He+(se-1)])&Ie,n=65535&Ee[je],Te[He&Ae]=Ee[je],Ee[je]=He;while(0!==--Le);He++}else He+=Le,Le=0,je=255&Re[He],je=(je<<Be^255&Re[He+1])&Ie;else e=ue(0,255&Re[He]),Je--,He++;if(e&&(me(!1),0===be.avail_out))return W}return me(t==F),0===be.avail_out?t==F?K:W:t==F?V:G}function ge(t){for(var e,n,r=0;;){if(ie>Je){if(pe(),ie>Je&&t==C)return W;if(0===Je)break}if(Je>=se&&(je=(je<<Be^255&Re[He+(se-1)])&Ie,r=65535&Ee[je],Te[He&Ae]=Ee[je],Ee[je]=He),We=Le,Ne=Me,Le=se-1,0!==r&&Ke>We&&Se-ie>=(He-r&65535)&&(Qe!=z&&(Le=ve(r)),5>=Le&&(Qe==_||Le==se&&He-Me>4096)&&(Le=se-1)),We>=se&&We>=Le){n=He+Je-se,e=ue(He-1-Ne,We-se),Je-=We-1,We-=2;do++He<=n&&(je=(je<<Be^255&Re[He+(se-1)])&Ie,r=65535&Ee[je],Te[He&Ae]=Ee[je],Ee[je]=He);while(0!==--We);if(De=0,Le=se-1,He++,e&&(me(!1),0===be.avail_out))return W}else if(0!==De){if(e=ue(0,255&Re[He-1]),e&&me(!1),He++,Je--,0===be.avail_out)return W}else De=1,He++,Je--}return 0!==De&&(e=ue(0,255&Re[He-1]),De=0),me(t==F),0===be.avail_out?t==F?K:W:t==F?V:G}function qe(e){return e.total_in=e.total_out=0,e.msg=null,en.pending=0,en.pending_out=0,xe=X,ze=C,s(),t(),T}var be,xe,ke,_e,ze,Se,Ce,Ae,Re,Fe,Te,Ee,je,Pe,Oe,Ie,Be,Ue,Le,Ne,De,He,Me,Je,We,Ge,Ke,Ve,Qe,Ye,Xe,$e,Ze,tn,en=this,nn=new n,rn=new n,sn=new n;en.depth=[];var on,an,un,cn,ln,fn,dn,wn;en.bl_count=[],en.heap=[],$e=[],Ze=[],tn=[],en.pqdownheap=function(t,e){for(var n=en.heap,r=n[e],s=e<<1;s<=en.heap_len&&(s<en.heap_len&&o(t,n[s+1],n[s],en.depth)&&s++,!o(t,r,n[s],en.depth));)n[e]=n[s],e=s,s<<=1;n[e]=r},en.deflateInit=function(t,e,n,r,s,o){return r||(r=te),s||(s=L),o||(o=S),t.msg=null,e==k&&(e=6),1>s||s>U||r!=te||9>n||n>15||0>e||e>9||0>o||o>z?P:(t.dstate=en,Ce=n,Se=1<<Ce,Ae=Se-1,Oe=s+7,Pe=1<<Oe,Ie=Pe-1,Be=Math.floor((Oe+se-1)/se),Re=new Uint8Array(2*Se),Te=[],Ee=[],an=1<<s+6,en.pending_buf=new Uint8Array(4*an),ke=4*an,cn=Math.floor(an/2),on=3*an,Ve=e,Qe=o,_e=255&r,qe(t))},en.deflateEnd=function(){return xe!=Y&&xe!=X&&xe!=Z?P:(en.pending_buf=null,Ee=null,Te=null,Re=null,en.dstate=null,xe==X?O:T)},en.deflateParams=function(t,e,n){var r=T;return e==k&&(e=6),0>e||e>9||0>n||n>z?P:(M[Ve].func!=M[e].func&&0!==t.total_in&&(r=t.deflate(A)),Ve!=e&&(Ve=e,Ke=M[Ve].max_lazy,Ye=M[Ve].good_length,Xe=M[Ve].nice_length,Ge=M[Ve].max_chain),Qe=n,r)},en.deflateSetDictionary=function(t,e,n){var r,s=n,o=0;if(!e||xe!=Y)return P;if(se>s)return T;for(s>Se-ie&&(s=Se-ie,o=n-s),Re.set(e.subarray(o,o+s),0),He=s,Ue=s,je=255&Re[0],je=(je<<Be^255&Re[1])&Ie,r=0;s-se>=r;r++)je=(je<<Be^255&Re[r+(se-1)])&Ie,Te[r&Ae]=Ee[je],Ee[je]=r;return T},en.deflate=function(t,e){var n,r,s,o,i;if(e>F||0>e)return P;if(!t.next_out||!t.next_in&&0!==t.avail_in||xe==Z&&e!=F)return t.msg=J[j-P],P;if(0===t.avail_out)return t.msg=J[j-I],I;if(be=t,o=ze,ze=e,xe==Y&&(r=te+(Ce-8<<4)<<8,s=(Ve-1&255)>>1,s>3&&(s=3),r|=s<<6,0!==He&&(r|=Q),r+=31-r%31,xe=X,l(r)),0!==en.pending){if(be.flush_pending(),0===be.avail_out)return ze=-1,T}else if(0===be.avail_in&&o>=e&&e!=F)return be.msg=J[j-I],I;if(xe==Z&&0!==be.avail_in)return t.msg=J[j-I],I;if(0!==be.avail_in||0!==Je||e!=C&&xe!=Z){switch(i=-1,M[Ve].func){case N:i=he(e);break;case D:i=ye(e);break;case H:i=ge(e)}if((i==K||i==V)&&(xe=Z),i==W||i==K)return 0===be.avail_out&&(ze=-1),T;if(i==G){if(e==A)ae();else if(de(0,0,!1),e==R)for(n=0;Pe>n;n++)Ee[n]=0;if(be.flush_pending(),0===be.avail_out)return ze=-1,T}}return e!=F?T:E}}function a(){var t=this;t.next_in_index=0,t.next_out_index=0,t.avail_in=0,t.total_in=0,t.avail_out=0,t.total_out=0}function u(t){var e=this,n=new a,r=512,s=C,o=new Uint8Array(r);"undefined"==typeof t&&(t=k),n.deflateInit(t),n.next_out=o,e.append=function(t,e){var i,a,u=[],c=0,l=0,f=0;if(t.length){n.next_in_index=0,n.next_in=t,n.avail_in=t.length;do{if(n.next_out_index=0,n.avail_out=r,i=n.deflate(s),i!=T)throw"deflating: "+n.msg;n.next_out_index&&(n.next_out_index==r?u.push(new Uint8Array(o)):u.push(new Uint8Array(o.subarray(0,n.next_out_index)))),f+=n.next_out_index,e&&n.next_in_index>0&&n.next_in_index!=c&&(e(n.next_in_index),c=n.next_in_index)}while(n.avail_in>0||0===n.avail_out);return a=new Uint8Array(f),u.forEach(function(t){a.set(t,l),l+=t.length}),a}},e.flush=function(){var t,e,s=[],i=0,a=0;do{if(n.next_out_index=0,n.avail_out=r,t=n.deflate(F),t!=E&&t!=T)throw"deflating: "+n.msg;r-n.avail_out>0&&s.push(new Uint8Array(o.subarray(0,n.next_out_index))),a+=n.next_out_index}while(n.avail_in>0||0===n.avail_out);return n.deflateEnd(),e=new Uint8Array(a),s.forEach(function(t){e.set(t,i),i+=t.length}),e}}if(e["true"]=t,"function"!=typeof c)var c=function(t){"use strict";var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},r=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},s=n.prototype,o=r.prototype,i=t.FileReaderSync,a=function(t){this.code=this[this.name=t]},u="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=u.length,l=t.URL||t.webkitURL||t,f=l.createObjectURL,d=l.revokeObjectURL,w=l,m=t.btoa,p=t.atob,h=!1,v=function(t){h=!t},y=t.ArrayBuffer,g=t.Uint8Array;for(r.fake=o.fake=!0;c--;)a.prototype[u[c]]=c+1;try{g&&v.apply(0,new g(1))}catch(q){}return l.createObjectURL||(w=t.URL={}),w.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof r?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):m?e+";base64,"+m(t.data):e+","+encodeURIComponent(t.data)):f?f.call(l,t):void 0},w.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&d&&d.call(l,t)},s.append=function(t){var n=this.data;if(g&&t instanceof y)if(h)n.push(String.fromCharCode.apply(String,new g(t)));else for(var s="",o=new g(t),u=0,c=o.length;c>u;u++)s+=String.fromCharCode(o[u]);else if("Blob"===e(t)||"File"===e(t)){if(!i)throw new a("NOT_READABLE_ERR");var l=new i;n.push(l.readAsBinaryString(t))}else t instanceof r?"base64"===t.encoding&&p?n.push(p(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},s.getBlob=function(t){return arguments.length||(t=null),new r(this.data.join(""),t,"raw")},s.toString=function(){return"[object BlobBuilder]"},o.slice=function(t,e,n){var s=arguments.length;return 3>s&&(n=null),new r(this.data.slice(t,s>1?e:this.data.length),n,this.encoding)},o.toString=function(){return"[object Blob]"},n}(t);return function(t,n){var r=n?n.type||"":"",s=new e;if(t)for(var o=0,i=t.length;i>o;o++)s.append(t[o]);return s.getBlob(r)}}(self);void function(t,e){"object"==typeof module?module.exports=e():"function"==typeof define?define(e):t.adler32cs=e()}(this,function(){var t="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,e=null,n=function(){if(!t)return function(){return!1};try{var n=require("buffer");"function"==typeof n.Buffer&&(e=n.Buffer)}catch(r){}return function(t){return t instanceof ArrayBuffer||null!==e&&t instanceof e}}(),r=function(){return null!==e?function(t){return new e(t,"utf8").toString("binary")}:function(t){return unescape(encodeURIComponent(t))}}(),s=65521,o=function(t,e){for(var n=65535&t,r=t>>>16,o=0,i=e.length;i>o;o++)n=(n+(255&e.charCodeAt(o)))%s,r=(r+n)%s;return(r<<16|n)>>>0},i=function(t,e){for(var n=65535&t,r=t>>>16,o=0,i=e.length;i>o;o++)n=(n+e[o])%s,r=(r+n)%s;return(r<<16|n)>>>0},a={},u=a.Adler32=function(){var e=function(t){if(!(this instanceof e))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0},s=e.prototype={};return s.constructor=e,e.from=function(t){return t.prototype=s,t}(function(t){if(!(this instanceof e))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=o(1,t.toString())}),e.fromUtf8=function(t){return t.prototype=s,t}(function(t){if(!(this instanceof e))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var n=r(t.toString());this.checksum=o(1,n)}),t&&(e.fromBuffer=function(t){return t.prototype=s,t}(function(t){if(!(this instanceof e))throw new TypeError("Constructor cannot called be as a function.");if(!n(t))throw new Error("First argument needs to be ArrayBuffer.");var r=new Uint8Array(t);return this.checksum=i(1,r)})),s.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=o(this.checksum,t)},s.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=r(t.toString());return this.checksum=o(this.checksum,e)},t&&(s.updateBuffer=function(t){if(!n(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=i(this.checksum,e)}),s.clone=function(){return new u(this.checksum)},e}();return a.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return o(1,t.toString())},a.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=r(t.toString());return o(1,e)},t&&(a.fromBuffer=function(t){if(!n(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return i(1,e)}),a});var l=15,f=30,d=19,w=29,m=256,p=m+1+w,h=2*p+1,v=256,y=7,g=16,q=17,b=18,x=16,k=-1,_=1,z=2,S=0,C=0,A=1,R=3,F=4,T=0,E=1,j=2,P=-2,O=-3,I=-5,B=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];n._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],n.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],n.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],n.d_code=function(t){return 256>t?B[t]:B[256+(t>>>7)]},n.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],n.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],r.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],r.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],r.static_l_desc=new r(r.static_ltree,n.extra_lbits,m+1,p,l),r.static_d_desc=new r(r.static_dtree,n.extra_dbits,0,f,l),r.static_bl_desc=new r(null,n.extra_blbits,0,d,y);var U=9,L=8,N=0,D=1,H=2,M=[new s(0,0,0,0,N),new s(4,4,8,4,D),new s(4,5,16,8,D),new s(4,6,32,32,D),new s(4,4,16,16,H),new s(8,16,32,32,H),new s(8,16,128,128,H),new s(8,32,128,256,H),new s(32,128,258,1024,H),new s(32,258,258,4096,H)],J=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],W=0,G=1,K=2,V=3,Q=32,Y=42,X=113,Z=666,te=8,ee=0,ne=1,re=2,se=3,oe=258,ie=oe+se+1;a.prototype={deflateInit:function(t,e){var n=this;return n.dstate=new i,e||(e=l),n.dstate.deflateInit(n,t,e)},deflate:function(t){var e=this;return e.dstate?e.dstate.deflate(e,t):P},deflateEnd:function(){var t=this;if(!t.dstate)return P;var e=t.dstate.deflateEnd();return t.dstate=null,e},deflateParams:function(t,e){var n=this;return n.dstate?n.dstate.deflateParams(n,t,e):P},deflateSetDictionary:function(t,e){var n=this;return n.dstate?n.dstate.deflateSetDictionary(n,t,e):P},read_buf:function(t,e,n){var r=this,s=r.avail_in;return s>n&&(s=n),0===s?0:(r.avail_in-=s,t.set(r.next_in.subarray(r.next_in_index,r.next_in_index+s),e),r.next_in_index+=s,r.total_in+=s,s)},flush_pending:function(){var t=this,e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}};var ae=ae||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(t){"use strict";var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=t.URL||t.webkitURL||t,s=e.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in s,i=function(n){var r=e.createEvent("MouseEvents");return r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},a=t.webkitRequestFileSystem,u=t.requestFileSystem||a||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},l="application/octet-stream",f=0,d=[],w=function(){for(var t=d.length;t--;){var e=d[t];"string"==typeof e?r.revokeObjectURL(e):e.remove()}d.length=0},m=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var s=t["on"+e[r]];if("function"==typeof s)try{s.call(t,n||t)}catch(o){c(o)}}},p=function(e,r){var c,w,p,h=this,v=e.type,y=!1,g=function(){var t=n().createObjectURL(e);return d.push(t),t},q=function(){m(h,"writestart progress write writeend".split(" "))},b=function(){(y||!c)&&(c=g(e)),w&&(w.location.href=c),h.readyState=h.DONE,q()},x=function(t){return function(){return h.readyState!==h.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return h.readyState=h.INIT,r||(r="download"),o&&(c=g(e),s.href=c,s.download=r,i(s))?(h.readyState=h.DONE,q(),void 0):(t.chrome&&v&&v!==l&&(p=e.slice||e.webkitSlice,e=p.call(e,0,e.size,l),y=!0),a&&"download"!==r&&(r+=".download"),w=v===l||a?t:t.open(),u?(f+=e.size,u(t.TEMPORARY,f,x(function(t){t.root.getDirectory("saved",k,x(function(t){var n=function(){t.getFile(r,k,x(function(t){t.createWriter(x(function(n){n.onwriteend=function(e){w.location.href=t.toURL(),d.push(t),h.readyState=h.DONE,m(h,"writeend",e)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=h["on"+t]}),n.write(e),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING}),b)}),b)};t.getFile(r,{create:!1},x(function(t){t.remove(),n()}),x(function(t){t.code===t.NOT_FOUND_ERR?n():b()}))}),b)}),b),void 0):(b(),void 0))},h=p.prototype,v=function(t,e){return new p(t,e)};return h.abort=function(){var t=this;t.readyState=t.DONE,m(t,"abort")},h.readyState=h.INIT=0,h.WRITING=1,h.DONE=2,h.error=h.onwritestart=h.onprogress=h.onwrite=h.onabort=h.onerror=h.onwriteend=null,t.addEventListener("unload",w,!1),v}(self),ue=function(t){"use strict";function e(r,s,o,i){var a={};"object"==typeof r&&(a=r,r=a.orientation,s=a.unit||s,o=a.format||o,i=a.compress||a.compressPdf||i),r="undefined"==typeof r?"p":r.toString().toLowerCase(),"undefined"==typeof s&&(s="mm"),"undefined"==typeof o&&(o="a4"),"undefined"==typeof i&&"undefined"==typeof zpipe&&(i=!1);var l,f,d,w,m,p,h,v,y,g=o.toString().toLowerCase(),q=[],b=0,x=i,k="1.3",_={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224]},z=a.textColor||"0 g",S=a.drawColor||"0 G",C=0,A=[],R=2,F=!!a.outToPages,T=[],E={},j={},P=a.fontSize||16,O=a.lineWidth||.200025,I=a.lineHeight||1.15,B={title:"",subject:"",author:"",keywords:"",creator:""},U=0,L=0,N={},D=new PubSub(N),H=function(t){return t.toFixed(2)},M=function(t){return t.toFixed(3)},J=function(t){var e=t.toFixed(0);return 10>t?"0"+e:e},W=function(t){var e=t.toFixed(0);return e.length<10?new Array(11-e.length).join("0")+e:e},G=function(t){F?A[C].push(t):(q.push(t),b+=t.length+1)},K=function(){return R++,T[R]=b,G(R+" 0 obj"),R},V=function(t){G("stream"),G(t),G("endstream")},Q=function(){h=d*w,v=f*w;var t,e,n,r,s,o;for(t=1;C>=t;t++){if(K(),G("<</Type /Page"),G("/Parent 1 0 R"),G("/Resources 2 0 R"),G("/Contents "+(R+1)+" 0 R>>"),G("endobj"),e=A[t].join("\n"),K(),x){for(n=[],r=0;r<e.length;++r)n[r]=e.charCodeAt(r);o=adler32cs.from(e),s=new u(6),s.append(new Uint8Array(n)),e=s.flush(),n=[new Uint8Array([120,156]),new Uint8Array(e),new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255])],e="";for(r in n)n.hasOwnProperty(r)&&(e+=String.fromCharCode.apply(null,n[r]));G("<</Length "+e.length+" /Filter [/FlateDecode]>>")}else G("<</Length "+e.length+">>");V(e),G("endobj")}for(T[1]=b,G("1 0 obj"),G("<</Type /Pages"),y="/Kids [",r=0;C>r;r++)y+=3+2*r+" 0 R ";G(y+"]"),G("/Count "+C),G("/MediaBox [0 0 "+H(h)+" "+H(v)+"]"),G(">>"),G("endobj")},Y=function(t){t.objectNumber=K(),G("<</BaseFont/"+t.PostScriptName+"/Type/Font"),"string"==typeof t.encoding&&G("/Encoding/"+t.encoding),G("/Subtype/Type1>>"),G("endobj")},X=function(){var t;for(t in E)E.hasOwnProperty(t)&&Y(E[t])},$=function(){D.publish("putXobjectDict")},Z=function(){G("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),G("/Font <<");var t;for(t in E)E.hasOwnProperty(t)&&G("/"+t+" "+E[t].objectNumber+" 0 R");G(">>"),G("/XObject <<"),$(),G(">>")},te=function(){X(),D.publish("putResources"),T[2]=b,G("2 0 obj"),G("<<"),Z(),G(">>"),G("endobj"),D.publish("postPutResources")},ee=function(t,e,n){var r;j[e]===r&&(j[e]={}),j[e][n]=t},ne=function(t,e,r,s){var o="F"+(n(E)+1).toString(10),i=E[o]={id:o,PostScriptName:t,fontName:e,fontStyle:r,encoding:s,metadata:{}};return ee(o,e,r),D.publish("addFont",i),o},re=function(){var t,e,n,r,s="helvetica",o="times",i="courier",a="normal",u="bold",c="italic",l="bolditalic",f="StandardEncoding",d=[["Helvetica",s,a],["Helvetica-Bold",s,u],["Helvetica-Oblique",s,c],["Helvetica-BoldOblique",s,l],["Courier",i,a],["Courier-Bold",i,u],["Courier-Oblique",i,c],["Courier-BoldOblique",i,l],["Times-Roman",o,a],["Times-Bold",o,u],["Times-Italic",o,c],["Times-BoldItalic",o,l]];for(t=0,e=d.length;e>t;t++)n=ne(d[t][0],d[t][1],d[t][2],f),r=d[t][0].split("-"),ee(n,r[0],r[1]||"");D.publish("addFonts",{fonts:E,dictionary:j})},se=function(t,e){var n,r,s,o,i,a,u,c,f,d;if(e===s&&(e={}),o=e.sourceEncoding?o:"Unicode",a=e.outputEncoding,(e.autoencode||a)&&E[l].metadata&&E[l].metadata[o]&&E[l].metadata[o].encoding&&(i=E[l].metadata[o].encoding,!a&&E[l].encoding&&(a=E[l].encoding),!a&&i.codePages&&(a=i.codePages[0]),"string"==typeof a&&(a=i[a]),a)){for(c=!1,u=[],n=0,r=t.length;r>n;n++)f=a[t.charCodeAt(n)],f?u.push(String.fromCharCode(f)):u.push(t[n]),u[n].charCodeAt(0)>>8&&(c=!0);t=u.join("")}for(n=t.length;c===s&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(c){for(u=e.noBOM?[]:[254,255],n=0,r=t.length;r>n;n++){if(f=t.charCodeAt(n),d=f>>8,d>>8)throw new Error("Character at position "+n.toString(10)+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");u.push(d),u.push(f-(d<<8))}return String.fromCharCode.apply(s,u)}return t},oe=function(t,e){return se(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ie=function(){G("/Producer (jsPDF "+e.version+")"),B.title&&G("/Title ("+oe(B.title)+")"),B.subject&&G("/Subject ("+oe(B.subject)+")"),B.author&&G("/Author ("+oe(B.author)+")"),B.keywords&&G("/Keywords ("+oe(B.keywords)+")"),B.creator&&G("/Creator ("+oe(B.creator)+")");var t=new Date;G("/CreationDate (D:"+[t.getFullYear(),J(t.getMonth()+1),J(t.getDate()),J(t.getHours()),J(t.getMinutes()),J(t.getSeconds())].join("")+")")},ue=function(){G("/Type /Catalog"),G("/Pages 1 0 R"),G("/OpenAction [3 0 R /FitH null]"),G("/PageLayout /OneColumn"),D.publish("putCatalog")},ce=function(){G("/Size "+(R+1)),G("/Root "+R+" 0 R"),G("/Info "+(R-1)+" 0 R")},le=function(){C++,F=!0,A[C]=[]},fe=function(){le(),G(H(O*w)+" w"),G(S),0!==U&&G(U.toString(10)+" J"),0!==L&&G(L.toString(10)+" j"),D.publish("addPage",{pageNumber:C})},de=function(t,e){var n,r;t===r&&(t=E[l].fontName),e===r&&(e=E[l].fontStyle);try{n=j[t][e]}catch(s){n=r}if(!n)throw new Error("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts.");return n},we=function(){F=!1,R=2,q=[],T=[],G("%PDF-"+k),Q(),te(),K(),G("<<"),ie(),G(">>"),G("endobj"),K(),G("<<"),ue(),G(">>"),G("endobj");var t,e=b;for(G("xref"),G("0 "+(R+1)),G("0000000000 65535 f "),t=1;R>=t;t++)G(W(T[t])+" 00000 n ");return G("trailer"),G("<<"),ce(),G(">>"),G("startxref"),G(e),G("%%EOF"),F=!0,q.join("\n")},me=function(t){var e="S";return"F"===t?e="f":("FD"===t||"DF"===t)&&(e="B"),e},pe=function(){var t,e,n,r,s;for(t=we(),e=t.length,n=new Uint8Array(new ArrayBuffer(e)),r=0;e>r;r++)n[r]=t.charCodeAt(r);return s=new c([n],{type:"application/pdf"})},he=function(e,n){var r;switch(e){case r:return we();case"save":if(navigator.getUserMedia){if(void 0===t.URL)return N.output("dataurlnewwindow");if(void 0===t.URL.createObjectURL)return N.output("dataurlnewwindow")}ae(pe(),n);break;case"blob":return pe();case"datauristring":case"dataurlstring":return"data:application/pdf;base64,"+btoa(we());case"datauri":case"dataurl":document.location.href="data:application/pdf;base64,"+btoa(we());break;case"dataurlnewwindow":t.open("data:application/pdf;base64,"+btoa(we()));break;default:throw new Error('Output type "'+e+'" is not supported.')}};if("pt"===s)w=1;else if("mm"===s)w=72/25.4;else if("cm"===s)w=72/2.54;else{if("in"!==s)throw"Invalid unit: "+s;w=72}if(_.hasOwnProperty(g))f=_[g][1]/w,d=_[g][0]/w;else try{f=o[1],d=o[0]}catch(ve){throw"Invalid format: "+o}if("p"===r||"portrait"===r)r="p",d>f&&(m=d,d=f,f=m);
else{if("l"!==r&&"landscape"!==r)throw"Invalid orientation: "+r;r="l",f>d&&(m=d,d=f,f=m)}N.internal={pdfEscape:oe,getStyle:me,getFont:function(){return E[de.apply(N,arguments)]},getFontSize:function(){return P},getLineHeight:function(){return P*I},btoa:btoa,write:function(t){G(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return H(t*w)},getVerticalCoordinateString:function(t){return H((f-t)*w)},collections:{},newObject:K,putStream:V,events:D,scaleFactor:w,pageSize:{width:d,height:f},output:function(t,e){return he(t,e)},getNumberOfPages:function(){return A.length-1},pages:A},N.addPage=function(){return fe(),this},N.text=function(t,e,n,r,s){if("number"==typeof t){var o=n;n=e,e=t,t=o}"string"==typeof t&&t.match(/[\n\r]/)&&(t=t.split(/\r\n|\r|\n/g)),"number"==typeof r&&(s=r,r=null);var i="",a="Td";if(s){s*=Math.PI/180;var u=Math.cos(s),c=Math.sin(s);i=[H(u),H(c),H(-1*c),H(u),""].join(" "),a="Tm"}if(r=r||{},"noBOM"in r||(r.noBOM=!0),"autoencode"in r||(r.autoencode=!0),"string"==typeof t)t=oe(t,r);else{if(!(t instanceof Array))throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');for(var d=t.concat(),m=[],p=d.length;p--;)m.push(oe(d.shift(),r));t=m.join(") Tj\nT* (")}return G("BT\n/"+l+" "+P+" Tf\n"+P*I+" TL\n"+z+"\n"+i+H(e*w)+" "+H((f-n)*w)+" "+a+"\n("+t+") Tj\nET"),this},N.line=function(t,e,n,r){return G(H(t*w)+" "+H((f-e)*w)+" m "+H(n*w)+" "+H((f-r)*w)+" l S"),this},N.lines=function(t,e,n,r,s,o){var i,a,u,c,l,d,m,p,h,v,y,g,q,b,x;for("number"==typeof t&&(a=n,u=t,c=e,t=a,e=u,n=c),s=me(s),r=r===i?[1,1]:r,G(M(e*w)+" "+M((f-n)*w)+" m "),l=r[0],d=r[1],p=t.length,b=e,x=n,m=0;p>m;m++)h=t[m],2===h.length?(b=h[0]*l+b,x=h[1]*d+x,G(M(b*w)+" "+M((f-x)*w)+" l")):(v=h[0]*l+b,y=h[1]*d+x,g=h[2]*l+b,q=h[3]*d+x,b=h[4]*l+b,x=h[5]*d+x,G(M(v*w)+" "+M((f-y)*w)+" "+M(g*w)+" "+M((f-q)*w)+" "+M(b*w)+" "+M((f-x)*w)+" c"));return 1==o&&G(" h"),G(s),this},N.rect=function(t,e,n,r,s){var o=me(s);return G([H(t*w),H((f-e)*w),H(n*w),H(-r*w),"re",o].join(" ")),this},N.triangle=function(t,e,n,r,s,o,i){return this.lines([[n-t,r-e],[s-n,o-r],[t-s,e-o]],t,e,[1,1],i,!0),this},N.roundedRect=function(t,e,n,r,s,o,i){var a=4/3*(Math.SQRT2-1);return this.lines([[n-2*s,0],[s*a,0,s,o-o*a,s,o],[0,r-2*o],[0,o*a,-(s*a),o,-s,o],[-n+2*s,0],[-(s*a),0,-s,-(o*a),-s,-o],[0,-r+2*o],[0,-(o*a),s*a,-o,s,-o]],t+s,e,[1,1],i),this},N.ellipse=function(t,e,n,r,s){var o=me(s),i=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return G([H((t+n)*w),H((f-e)*w),"m",H((t+n)*w),H((f-(e-a))*w),H((t+i)*w),H((f-(e-r))*w),H(t*w),H((f-(e-r))*w),"c"].join(" ")),G([H((t-i)*w),H((f-(e-r))*w),H((t-n)*w),H((f-(e-a))*w),H((t-n)*w),H((f-e)*w),"c"].join(" ")),G([H((t-n)*w),H((f-(e+a))*w),H((t-i)*w),H((f-(e+r))*w),H(t*w),H((f-(e+r))*w),"c"].join(" ")),G([H((t+i)*w),H((f-(e+r))*w),H((t+n)*w),H((f-(e+a))*w),H((t+n)*w),H((f-e)*w),"c",o].join(" ")),this},N.circle=function(t,e,n,r){return this.ellipse(t,e,n,n,r)},N.setProperties=function(t){var e;for(e in B)B.hasOwnProperty(e)&&t[e]&&(B[e]=t[e]);return this},N.setFontSize=function(t){return P=t,this},N.setFont=function(t,e){return l=de(t,e),this},N.setFontStyle=N.setFontType=function(t){var e;return l=de(e,t),this},N.getFontList=function(){var t,e,n,r={};for(t in j)if(j.hasOwnProperty(t)){r[t]=n=[];for(e in j[t])j[t].hasOwnProperty(e)&&n.push(e)}return r},N.setLineWidth=function(t){return G((t*w).toFixed(2)+" w"),this},N.setDrawColor=function(t,e,n,r){var s;return s=void 0===e||void 0===r&&t===e===n?"string"==typeof t?t+" G":H(t/255)+" G":void 0===r?"string"==typeof t?[t,e,n,"RG"].join(" "):[H(t/255),H(e/255),H(n/255),"RG"].join(" "):"string"==typeof t?[t,e,n,r,"K"].join(" "):[H(t),H(e),H(n),H(r),"K"].join(" "),G(s),this},N.setFillColor=function(t,e,n,r){var s;return s=void 0===e||void 0===r&&t===e===n?"string"==typeof t?t+" g":H(t/255)+" g":void 0===r?"string"==typeof t?[t,e,n,"rg"].join(" "):[H(t/255),H(e/255),H(n/255),"rg"].join(" "):"string"==typeof t?[t,e,n,r,"k"].join(" "):[H(t),H(e),H(n),H(r),"k"].join(" "),G(s),this},N.setTextColor=function(t,e,n){var r=/#[0-9A-Fa-f]{6}/;if("string"==typeof t&&r.test(t)){var s=t.replace("#",""),o=parseInt(s,16);t=o>>16&255,e=o>>8&255,n=255&o}return z=0===t&&0===e&&0===n||"undefined"==typeof e?M(t/255)+" g":[M(t/255),M(e/255),M(n/255),"rg"].join(" "),this},N.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},N.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return U=e,G(e.toString(10)+" J"),this},N.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return L=e,G(e.toString(10)+" j"),this},N.output=he,N.save=function(t){N.output("save",t)};for(p in e.API)e.API.hasOwnProperty(p)&&("events"===p&&e.API.events.length?!function(t,e){var n,r,s;for(s=e.length-1;-1!==s;s--)n=e[s][0],r=e[s][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(D,e.API.events):N[p]=e.API[p]);return re(),l="F1",fe(),D.publish("initialized"),N}"undefined"==typeof btoa&&(t.btoa=function(t){var e,n,r,s,o,i,a,u,c,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=l.split(""),d=0,w=0,m="",p=[];do e=t.charCodeAt(d++),n=t.charCodeAt(d++),r=t.charCodeAt(d++),u=e<<16|n<<8|r,s=u>>18&63,o=u>>12&63,i=u>>6&63,a=63&u,p[w++]=f[s]+f[o]+f[i]+f[a];while(d<t.length);return m=p.join(""),c=t.length%3,(c?m.slice(0,c-3):m)+"===".slice(c||3)}),"undefined"==typeof atob&&(t.atob=function(t){var e,n,r,s,o,i,a,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,f=0,d="",w=[];if(!t)return t;t+="";do s=c.indexOf(t.charAt(l++)),o=c.indexOf(t.charAt(l++)),i=c.indexOf(t.charAt(l++)),a=c.indexOf(t.charAt(l++)),u=s<<18|o<<12|i<<6|a,e=u>>16&255,n=u>>8&255,r=255&u,w[f++]=64===i?String.fromCharCode(e):64===a?String.fromCharCode(e,n):String.fromCharCode(e,n,r);while(l<t.length);return d=w.join("")});var n="function"==typeof Object.keys?function(t){return Object.keys(t).length}:function(t){var e,n=0;for(e in t)t.hasOwnProperty(e)&&n++;return n};return t.PubSub=function(t){this.topics={},this.context=t,this.publish=function(t,e){if(this.topics[t]){var n,r,s,o,i=this.topics[t],a=[],u=function(){};for(e=Array.prototype.slice.call(arguments,1),r=0,s=i.length;s>r;r++)o=i[r],n=o[0],o[1]&&(o[0]=u,a.push(r)),n.apply(this.context,e);for(r=0,s=a.length;s>r;r++)i.splice(a[r],1)}},this.subscribe=function(t,e,n){return this.topics[t]?this.topics[t].push([e,n]):this.topics[t]=[[e,n]],{topic:t,callback:e}},this.unsubscribe=function(t){if(this.topics[t.topic]){var e,n,r=this.topics[t.topic];for(e=0,n=r.length;n>e;e++)r[e][0]===t.callback&&r.splice(e,1)}}},e.API={events:[]},e.version="1.0.0-trunk 2014-02-13T03:39","function"==typeof define?define(function(){return e}):t.jsPDF=e,e}(self);!function(t){"use strict";var e="addImage_",n=function(t){var e,n;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary jpeg file");for(var r=256*t.charCodeAt(4)+t.charCodeAt(5),s=4,o=t.length;o>s;){if(s+=r,255!==t.charCodeAt(s))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(s+1)||193===t.charCodeAt(s+1)||194===t.charCodeAt(s+1)||195===t.charCodeAt(s+1)||196===t.charCodeAt(s+1)||197===t.charCodeAt(s+1)||198===t.charCodeAt(s+1)||199===t.charCodeAt(s+1))return n=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),e=256*t.charCodeAt(s+7)+t.charCodeAt(s+8),[e,n];s+=2,r=256*t.charCodeAt(s)+t.charCodeAt(s+1)}},r=function(t){var e=this.internal.newObject(),n=this.internal.write,r=this.internal.putStream;if(t.n=e,n("<</Type /XObject"),n("/Subtype /Image"),n("/Width "+t.w),n("/Height "+t.h),"Indexed"===t.cs?n("/ColorSpace [/Indexed /DeviceRGB "+(t.pal.length/3-1)+" "+(e+1)+" 0 R]"):(n("/ColorSpace /"+t.cs),"DeviceCMYK"===t.cs&&n("/Decode [1 0 1 0 1 0 1 0]")),n("/BitsPerComponent "+t.bpc),"f"in t&&n("/Filter /"+t.f),"dp"in t&&n("/DecodeParms <<"+t.dp+">>"),"trns"in t&&t.trns.constructor==Array)for(var s="",o=0;o<t.trns.length;o++)s+=t[s][o]+" "+t.trns[o]+" ",n("/Mask ["+s+"]");"smask"in t&&n("/SMask "+(e+1)+" 0 R"),n("/Length "+t.data.length+">>"),r(t.data),n("endobj")},s=function(){var t=this.internal.collections[e+"images"];for(var n in t)r.call(this,t[n])},o=function(){var t,n=this.internal.collections[e+"images"],r=this.internal.write;for(var s in n)t=n[s],r("/I"+t.i,t.n,"0","R")};t.addImage=function(t,r,i,a,u,c,l){var f,d=this.internal.collections[e+"images"];if("number"==typeof r){var w=c;c=u,u=a,a=i,i=r,r=w||"JPEG"}if("string"==typeof t)if(255!==t.charCodeAt(0)&&"data:"!==t.substr(0,5)){if(d)for(var m in d)if(t===d[m].alias){f=d[m];break}}else"data:image/jpg"===t.substr(0,14)&&(t=t.replace("data:image/jpg","data:image/jpeg"));if("object"==typeof t&&1===t.nodeType){var p=document.createElement("canvas");p.width=t.clientWidth||t.width,p.height=t.clientHeight||t.height;var h=p.getContext("2d");if(!h)throw"addImage requires canvas to be supported by browser.";h.drawImage(t,0,0,p.width,p.height),t=p.toDataURL("image/jpeg"),r="JPEG"}if("JPEG"!==r.toUpperCase())throw new Error("addImage currently only supports format 'JPEG', not '"+r+"'");var v,y=this.internal.getCoordinateString,g=this.internal.getVerticalCoordinateString;"data:image/jpeg;base64,"===t.substring(0,23)&&(t=atob(t.replace("data:image/jpeg;base64,",""))),d?v=Object.keys?Object.keys(d).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(d):(v=0,this.internal.collections[e+"images"]=d={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o));var q=f||function(e){return d[v]={alias:l,w:e[0],h:e[1],cs:"DeviceRGB",bpc:8,f:"DCTDecode",i:v,data:t}}(n(t));return u||c||(u=-96,c=-96),0>u&&(u=-1*q.w*72/u/this.internal.scaleFactor),0>c&&(c=-1*q.h*72/c/this.internal.scaleFactor),0===u&&(u=c*q.w/q.h),0===c&&(c=u*q.h/q.w),this.internal.write("q",y(u),"0 0",y(c),y(i),g(a+c),"cm /I"+q.i,"Do Q"),this}}(ue.API),function(t){"use strict";t.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this}}(ue.API),function(t){"use strict";var e,n,r,s,o=3,i=13,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1,c=function(t,e,n,r,s){a={x:t,y:e,w:n,h:r,ln:s}},l=function(){return a};t.setHeaderFunction=function(t){s=t},t.getTextDimensions=function(t){e=this.internal.getFont().fontName,n=this.table_font_size||this.internal.getFontSize(),r=this.internal.getFont().fontStyle;var s,o,i=19.049976/25.4;return o=document.createElement("font"),o.id="jsPDFCell",o.style.fontStyle=r,o.style.fontName=e,o.style.fontSize=n+"pt",o.innerText=t,document.body.appendChild(o),s={w:(o.offsetWidth+1)*i,h:(o.offsetHeight+1)*i},document.body.removeChild(o),s},t.cellAddPage=function(){this.addPage(),c(this.margins.left,this.margins.top,void 0,void 0),u+=1},t.cellInitialize=function(){a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1},t.cell=function(t,e,n,r,s,a,u){var f=l();if(void 0!==f.ln&&(f.ln===a?(t=f.x+f.w,e=f.y):(f.y+f.h+r+i>=this.internal.pageSize.height-this.margins.bottom&&(this.cellAddPage(),this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(a,!0)),e=l().y+l().h)),void 0!==s[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===u){if(s instanceof Array)for(var d=0;d<s.length;d++){var w=s[d],m=this.getStringUnitWidth(w)*this.internal.getFontSize();this.text(w,t+n-m-o,e+this.internal.getLineHeight()*(d+1))}}else this.text(s,t+o,e+this.internal.getLineHeight());return c(t,e,n,r,a),this},t.get