!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.jsPDF={})}(this,function(e){"use strict";var t;function re(t){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)} /** @license * jsPDF - PDF Document creation from JavaScript * Version 2.0.0 Built on 2019-01-22T15:32:38.220Z * CommitID 0110a2202b * * Copyright (c) 2015-2018 yWorks GmbH, http://www.yworks.com * 2015-2018 Lukas Holländer , https://github.com/HackbrettXXX * 2010-2016 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 * 2014 Steven Spungin, https://github.com/Flamenco * 2014 Kenneth Glassey, https://github.com/Gavvers * * Licensed under the MIT License * * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco */!function(t){if("object"!=typeof t.console){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=s.pop();)r[n]||(r[n]=i)}var a,c,u,h,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,s=0,a=0,c="",u=[];if(!t)return t;for(;e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[a++]=l.charAt(e)+l.charAt(n)+l.charAt(r)+l.charAt(i),s>16&255,n=s>>8&255,r=255&s,u[c++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),a>>0,r=new Array(n),i=1>>0,i=0;i>16&255,r=c>>8&255,i=255&c}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+s[0];else switch(t.precision){case 2:e=ct(n/255)+" "+s[0];break;case 3:default:e=ut(n/255)+" "+s[0]}else if(void 0===o||"object"===re(o)){if("string"==typeof n)e=[n,r,i,s[1]].join(" ");else switch(t.precision){case 2:e=[ct(n/255),ct(r/255),ct(i/255),s[1]].join(" ");break;default:case 3:e=[ut(n/255),ut(r/255),ut(i/255),s[1]].join(" ")}o&&0===o.a&&(e=["255","255","255",s[1]].join(" "))}else if("string"==typeof n)e=[n,r,i,o,s[2]].join(" ");else switch(t.precision){case 2:e=[ct(n),ct(r),ct(i),ct(o),s[2]].join(" ");break;case 3:default:e=[ut(n),ut(r),ut(i),ut(o),s[2]].join(" ")}return e},X=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},n=t.getTimezoneOffset(),r=n<0?"+":"-",i=Math.floor(Math.abs(n/60)),o=Math.abs(n%60),s=[r,e(i),"'",e(o),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),s].join("")},J=function(t){var e;return void 0===re(t)&&(t=new Date),e="object"===re(t)&&"[object Date]"===Object.prototype.toString.call(t)?X(t):/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t)?t:X(new Date),p=e},st=function(t){var e=p;return"jsDate"===t&&(e=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),s=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10),parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,s,0)}(p)),e},at=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),b=t},ct=function(t){return t.toFixed(2)},ut=function(t){return t.toFixed(3)},ht=function(t){return t.toFixed(16).replace(/0+$/,"")},lt=function(t){return it===G?t*m:it===rt?t:void 0},ft=function(t){return lt((e=t,it===G?w-e:it===rt?e:void 0));var e},pt=function(t){var e="00"+t;return e.substr(e.length-2)},dt=function(t){if(it!==rt)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},gt=function(t){t="string"==typeof t?t:t.toString(),S?T[s].push(t):(z+=t.length+1,D.push(t))},mt=function(){return _[++x]=z,gt(x+" 0 obj"),x},yt=function(t){gt("stream"),gt(t),gt("endstream")},wt=function(t){t.objectNumber=mt(),gt("<<"),gt("/Type /XObject"),gt("/Subtype /Form"),gt("/BBox ["+[ht(t.x),ht(t.y),ht(t.x+t.width),ht(t.y+t.height)].join(" ")+"]"),gt("/Matrix ["+t.matrix.toString()+"]");var e=t.pages[1].join("\n");gt("/Length "+e.length),gt(">>"),yt(e),gt("endobj")},vt=function(t,e){e||(e=21);var n=mt(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var o={offset:0,color:t[0].color};t.unshift(o)}if(1!=t[t.length-1].offset){var s={offset:1,color:t[t.length-1].color};t.push(s)}for(var a="",c=0,u=0;ut[c+1].offset;)c++;var h=t[c].offset,l=(n-h)/(t[c+1].offset-h),f=t[c].color,p=t[c+1].color;a+=pt(Math.round((1-l)*f[0]+l*p[0]).toString(16))+pt(Math.round((1-l)*f[1]+l*p[1]).toString(16))+pt(Math.round((1-l)*f[2]+l*p[2]).toString(16))}return a.trim()}(t.colors,e);gt("<< /FunctionType 0"),gt("/Domain [0.0 1.0]"),gt("/Size ["+e+"]"),gt("/BitsPerSample 8"),gt("/Range [0.0 1.0 0.0 1.0 0.0 1.0]"),gt("/Decode [0.0 1.0 0.0 1.0 0.0 1.0]"),gt("/Length "+r.length),gt("/Filter /ASCIIHexDecode"),gt(">>"),yt(r),gt("endobj"),t.objectNumber=mt(),gt("<< /ShadingType "+t.type),gt("/ColorSpace /DeviceRGB");var i="/Coords ["+ht(parseFloat(t.coords[0]))+" "+ht(parseFloat(t.coords[1]))+" ";2===t.type?i+=ht(parseFloat(t.coords[2]))+" "+ht(parseFloat(t.coords[3])):i+=ht(parseFloat(t.coords[2]))+" "+ht(parseFloat(t.coords[3]))+" "+ht(parseFloat(t.coords[4]))+" "+ht(parseFloat(t.coords[5])),gt(i+="]"),t.matrix&>("/Matrix ["+t.matrix.toString()+"]"),gt("/Function "+n+" 0 R"),gt("/Extend [true true]"),gt(">>"),gt("endobj")},bt=function(t){for(var e in t.objectNumber=mt(),gt("<<"),t)switch(e){case"opacity":gt("/ca "+ct(t[e]));break;case"stroke-opacity":gt("/CA "+ct(t[e]))}gt(">>"),gt("endobj")},xt=function(){for(var t in gt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),gt("/Font <<"),nt)nt.hasOwnProperty(t)&>("/"+t+" "+nt[t].objectNumber+" 0 R");gt(">>"),gt("/Shading <<"),function(){for(var t in C)C.hasOwnProperty(t)&&C[t]instanceof W.ShadingPattern&&0<=C[t].objectNumber&>("/"+t+" "+C[t].objectNumber+" 0 R");ot.publish("putShadingPatternDict")}(),gt(">>"),gt("/Pattern <<"),function(){for(var t in C)C.hasOwnProperty(t)&&C[t]instanceof W.TilingPattern&&0<=C[t].objectNumber&>("/"+t+" "+C[t].objectNumber+" 0 R");ot.publish("putTilingPatternDict")}(),gt(">>"),gt("/ExtGState <<"),function(){var t;for(t in P)P.hasOwnProperty(t)&&0<=P[t].objectNumber&>("/"+t+" "+P[t].objectNumber+" 0 R");ot.publish("putGStateDict")}(),gt(">>"),gt("/XObject <<"),function(){for(var t in M)M.hasOwnProperty(t)&&0<=M[t].objectNumber&>("/"+t+" "+M[t].objectNumber+" 0 R");ot.publish("putXobjectDict")}(),gt(">>")},St=function(){!function(){for(var t in nt)nt.hasOwnProperty(t)&&(e=nt[t],ot.publish("putFont",{font:e,out:gt,newObject:mt,putStream:yt}),!0!==e.isAlreadyPutted&&(e.objectNumber=mt(),gt("<<"),gt("/Type /Font"),gt("/BaseFont /"+e.postScriptName),gt("/Subtype /Type1"),"string"==typeof e.encoding&>("/Encoding /"+e.encoding),gt("/FirstChar 32"),gt("/LastChar 255"),gt(">>"),gt("endobj")));var e}(),function(){var t;for(t in P)P.hasOwnProperty(t)&&bt(P[t])}(),function(){for(var t in M)M.hasOwnProperty(t)&&wt(M[t])}(),function(){var t,e,n;for(t in C)C.hasOwnProperty(t)&&(C[t]instanceof W.ShadingPattern?vt(C[t]):C[t]instanceof W.TilingPattern&&(e=C[t],n=mt(),gt("<<"),xt(),gt(">>"),gt("endobj"),e.objectNumber=mt(),gt("<< /Type /Pattern"),gt("/PatternType 1"),gt("/PaintType 1"),gt("/TilingType 1"),gt("/BBox ["+e.boundingBox.map(ht).join(" ")+"]"),gt("/XStep "+ht(e.xStep)),gt("/YStep "+ht(e.yStep)),gt("/Length "+e.stream.length),gt("/Resources "+n+" 0 R"),e.matrix&>("/Matrix ["+e.matrix.toString()+"]"),gt(">>"),yt(e.stream),gt("endobj")))}(),ot.publish("putResources"),_[2]=z,gt("2 0 obj"),gt("<<"),xt(),gt(">>"),gt("endobj"),ot.publish("postPutResources")},_t=function(t,e,n){k.hasOwnProperty(e)||(k[e]={}),k[e][n]=t},kt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(nt).length+1).toString(10),s={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return ot.publish("addFont",{font:s,instance:this}),void 0!==o&&(nt[o]=s,_t(o,e,n)),o},At=function(t,e){return new Ct(t.a*e.a+t.b*e.c,t.a*e.b+t.b*e.d,t.c*e.a+t.d*e.c,t.c*e.b+t.d*e.d,t.e*e.a+t.f*e.c+e.e,t.e*e.b+t.f*e.d+e.f)},Ct=function(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.d=r,this.e=i,this.f=o};Ct.prototype={toString:function(){return[ht(this.a),ht(this.b),ht(this.c),ht(this.d),ht(this.e),ht(this.f)].join(" ")},inversed:function(){var t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=1/(t*r-e*n),a=r*s,c=-e*s,u=-n*s,h=t*s;return new Ct(a,c,u,h,-a*i-u*o,-c*i-h*o)}};var It=new Ct(1,0,0,1,0,0),Pt=function(){this.page=j,this.currentPage=s,this.pages=T.slice(0),this.pagedim=B.slice(0),this.pagesContext=O.slice(0),this.x=a,this.y=c,this.matrix=u,this.width=y,this.height=w,this.id="",this.objectNumber=-1};Pt.prototype={restore:function(){j=this.page,s=this.currentPage,O=this.pagesContext,B=this.pagedim,T=this.pages,a=this.x,c=this.y,u=this.matrix,y=this.width,w=this.height}};var Ft,qt=function(t,e,n,r,i){L.push(new Pt),j=s=0,T=[],a=t,c=e,u=i,Bt(n,r)},jt=function(t,e){if(!I[t]){var n=(e instanceof W.ShadingPattern?"Sh":"P")+(Object.keys(C).length+1).toString(10);e.id=n,I[t]=n,C[n]=e,ot.publish("addPattern",e)}},Tt=function(t,e){if(!t||!F[t]){var n=!1;for(var r in P)if(P.hasOwnProperty(r)&&P[r].equals(e)){n=!0;break}if(n)e=P[r];else{var i="GS"+(Object.keys(P).length+1).toString(10);(P[i]=e).id=i}return t&&(F[t]=e.id),ot.publish("addGState",e),e}},Ot=function(t,e){return function(t,e){var n,r,i,o,s,a,c,u,h;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&nt[K].metadata&&nt[K].metadata[i]&&nt[K].metadata[i].encoding&&(o=nt[K].metadata[i].encoding,!s&&nt[K].encoding&&(s=nt[K].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(c=!1,a=[],n=0,r=t.length;n>8&&(c=!0);t=a.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(h),a.push(u-(h<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Bt=function(t,e){S=!0,T[++j]=[],B[j]={width:Number(t)||y,height:Number(e)||w},O[j]={},Et(j)},Dt=function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();te.hasOwnProperty(r)&&(t=te[r][0]/m,e=te[r][1]/m)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":t>"),gt("endobj"),e=T[t].join("\n"),it===rt&&(e+="\nQ"),mt(),v){for(n=[],r=e.length;r--;)n[r]=e.charCodeAt(r);o=s.from(e),e=(i=new Deflater(6)).append(new Uint8Array(n)),u=e,h=i.flush(),l=void 0,(l=new Uint8Array(u.byteLength+h.byteLength)).set(new Uint8Array(u),0),l.set(new Uint8Array(h),u.byteLength),e=l,(n=new Uint8Array(e.byteLength+6)).set(new Uint8Array([120,156])),n.set(e,2),n.set(new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255]),e.byteLength+2);for(var p=[],d=0;65535*d>")}else gt("<>");yt(e),gt("endobj")}_[1]=z,gt("1 0 obj"),gt("<>"),gt("endobj"),ot.publish("postPutPages")}(),function(){ot.publish("putAdditionalObjects");for(var t=0;t>"),gt("endobj"),mt(),gt("<<"),function(){switch(gt("/Type /Catalog"),gt("/Pages 1 0 R"),l||(l="fullwidth"),l){case"fullwidth":gt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":gt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":gt("/OpenAction [3 0 R /Fit]");break;case"original":gt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+l;"%"===t.substr(t.length-1)&&(l=parseInt(l)/100),"number"==typeof l&>("/OpenAction [3 0 R /XYZ null null "+ct(l)+"]")}switch(f||(f="continuous"),f){case"continuous":gt("/PageLayout /OneColumn");break;case"single":gt("/PageLayout /SinglePage");break;case"two":case"twoleft":gt("/PageLayout /TwoColumnLeft");break;case"tworight":gt("/PageLayout /TwoColumnRight")}h&>("/PageMode /"+h),ot.publish("putCatalog")}(),gt(">>"),gt("endobj");var t,e=z,n="0000000000";for(gt("xref"),gt("0 "+(x+1)),gt(n+" 65535 f "),t=1;t<=x;t++){var r=_[t];gt("function"==typeof r?(n+_[t]()).slice(-10)+" 00000 n ":(n+_[t]).slice(-10)+" 00000 n ")}return gt("trailer"),gt("<<"),gt("/Size "+(x+1)),gt("/Root "+x+" 0 R"),gt("/Info "+(x-1)+" 0 R"),gt("/ID [ <"+b+"> <"+b+"> ]"),gt(">>"),gt("startxref"),gt(""+e),gt("%%EOF"),S=!0,D.join("\n")},zt=function(t){var e=it===G?"S":"n";return"D"===t?e="S":"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e},Mt=function(t,e,n){null===t||it===rt&&void 0===t||(t=zt(t),e?(n||(n={matrix:It}),n instanceof Ct&&(n={matrix:n}),n.key=e,n||(n=It),Nt(n,t)):gt(t))},Nt=function(t,e){var n=I[t.key],r=C[n];if(r instanceof W.ShadingPattern)gt("q"),gt(Lt(e)),r.gState&&W.setGState(r.gState),gt(t.matrix.toString()+" cm"),gt("/"+n+" sh"),gt("Q");else if(r instanceof W.TilingPattern){var i=new Ct(1,0,0,-1,0,w);t.matrix&&(i=At(t.matrix||It,i),n=r.createClone(t.key,t.boundingBox,t.xStep,t.yStep,i).id),gt("q"),gt("/Pattern cs"),gt("/"+n+" scn"),r.gState&&W.setGState(r.gState),gt(e),gt("Q")}},Lt=function(t){switch(t){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Ht=function(){for(var t=Ut(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},Wt=function(){return new Blob([Ht()],{type:"application/pdf"})},Gt=((Ft=function(t,e){"string"==typeof e?e={filename:e}:(e=e||{}).filename=e.filename||"generated.pdf";var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;filename="+e.filename+";base64,"+btoa(Ut()):0;switch(t){case void 0:return Ut();case"save":if("object"===("undefined"==typeof navigator?"undefined":re(navigator))&&navigator.getUserMedia&&(void 0===Zt.URL||void 0===Zt.URL.createObjectURL))return W.output("dataurlnewwindow");ie(Wt(),e.filename),"function"==typeof ie.unload&&Zt.setTimeout&&setTimeout(ie.unload,911);break;case"arraybuffer":return Ht();case"blob":return Wt();case"bloburi":case"bloburl":return Zt.URL&&Zt.URL.createObjectURL(Wt())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r='',i=Zt.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return Zt.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return Ft.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!Zt.console)throw new Error(n);Zt.console.error(n,t),Zt.alert&&alert(n)}},(Ft.foo.bar=Ft).foo),Vt=function(t){return!0===Array.isArray(V)&&-1":")"),Y=0):"[object Array]"===Object.prototype.toString.call(v[H])&&(W=v[H][1]*T,G=-v[H][2],V=(o?"<":"(")+v[H][0]+(o?">":")"),Y=1),void 0!==E&&void 0!==E[H]&&(X=E[H]+" Tw\n"),1===Y&&0=o.length-1;if(x&&!S){y+=" ";continue}if(x||S){if(S)g=b;else if(t.multiline&&a<(h+2)*(w+2)+2)continue t}else{if(!t.multiline)continue t;if(a<(h+2)*(w+2)+2)continue t;g=b}for(var _="",k=d;k<=g;k++)_+=o[k]+" ";switch(_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_,m=A(_,s+"px",i).width,t.Q){case 2:f=c-m-2;break;case 1:f=(c-m)/2;break;case 0:default:f=2}e+=f.toFixed(2)+" "+p.toFixed(2)+" Td\n",e+="("+_+") Tj\n",e+=-f.toFixed(2)+" 0 Td\n",p=-(s+2),m=0,d=g+1,w++,y=""}else;break}return r.text=e,r.fontSize=s,r},A=function(t,e,n){n=n||"helvetica";var r=h.internal.getFont(n),i=h.getStringUnitWidth(t,{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:h.getStringUnitWidth("3",{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},p={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},d=function(){var t=h.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.hasAnnotation&&m.call(h,n)}},g=function(t){h.internal.acroformPlugin.printedOut&&(h.internal.acroformPlugin.printedOut=!1,h.internal.acroformPlugin.acroFormDictionaryRoot=null),h.internal.acroformPlugin.acroFormDictionaryRoot||x.call(h),h.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},m=function(t){var e={type:"reference",object:t};h.annotationPlugin.annotations[h.internal.getPageInfo(t.page).pageNumber].push(e)},y=function(){void 0!==h.internal.acroformPlugin.acroFormDictionaryRoot?h.internal.write("/AcroForm "+h.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},w=function(){h.internal.events.unsubscribe(h.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete h.internal.acroformPlugin.acroFormDictionaryRoot._eventID,h.internal.acroformPlugin.printedOut=!0},v=function(t){var e=!t;t||(h.internal.newObjectDeferredBegin(h.internal.acroformPlugin.acroFormDictionaryRoot.objId),h.internal.out(h.internal.acroformPlugin.acroFormDictionaryRoot.getString()));t=t||h.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=r.Rect;r.Rect&&(r.Rect=l.call(this,r.Rect)),h.internal.newObjectDeferredBegin(r.objId);var o=r.objId+" 0 obj\n<<\n";if("object"===re(r)&&"function"==typeof r.getContent&&(o+=r.getContent()),r.Rect=i,r.hasAppearanceStream&&!r.appearanceStreamContent){var s=f.call(this,r);o+="/AP << /N "+s+" >>\n",h.internal.acroformPlugin.xForms.push(s)}if(r.appearanceStreamContent){for(var a in o+="/AP << ",r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(a)){var c=r.appearanceStreamContent[a];if(o+="/"+a+" ",o+="<< ",1<=Object.keys(c).length||Array.isArray(c))for(var n in c){var u;if(c.hasOwnProperty(n))"function"==typeof(u=c[n])&&(u=u.call(this,r)),o+="/"+n+" "+u+" ",0<=h.internal.acroformPlugin.xForms.indexOf(u)||h.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=c)&&(u=u.call(this,r)),o+="/"+n+" "+u+" \n",0<=h.internal.acroformPlugin.xForms.indexOf(u)||h.internal.acroformPlugin.xForms.push(u);o+=" >>\n"}o+=">>\n"}o+=">>\nendobj\n",h.internal.out(o)}e&&b.call(this,h.internal.acroformPlugin.xForms)},b=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];h.internal.newObjectDeferredBegin(r&&r.objId);var i="";"object"===re(r)&&"function"==typeof r.getString&&(i=r.getString()),h.internal.out(i),delete t[n]}},x=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(h=this,P.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(p)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e=h.internal.scaleFactor,s=h.internal.pageSize.getHeight(),h.internal.acroformPlugin.acroFormDictionaryRoot=new I,h.internal.acroformPlugin.acroFormDictionaryRoot._eventID=h.internal.events.subscribe("postPutResources",w),h.internal.events.subscribe("buildDocument",d),h.internal.events.subscribe("putCatalog",y),h.internal.events.subscribe("postPutPages",v),h.internal.acroformPlugin.isInitialized=!0}},S=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){if(t.hasOwnProperty(n))e+=t[n].toString(),e+=n>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="\nendstream\n"),t+="endobj\n"},k.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n)if(n.hasOwnProperty(r)){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+S(o)+"\n":e+=o instanceof k?"/"+i+" "+o.objId+" 0 R\n":"/"+i+" "+o+"\n")}return e}(this)};var C=function(){var e;k.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo,Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==e?e.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(t){e=t.trim()},get:function(){return e||null}})};r(C,k);var I=function(){k.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0>"},YesPushDown:function(t){var e=c(t),n=[],r=h.internal.getFont("zapfdingbats","normal").id;t.Q=1;var i=u(t,"3","ZapfDingbats",50);return n.push("0.749023 g"),n.push("0 0 "+M.internal.getWidth(t).toFixed(2)+" "+M.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+i.fontSize.toFixed(2)+" Tf 0 g"),n.push("BT"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=c(t),n=h.internal.getFont("zapfdingbats","normal").id,r=[];t.Q=1;var i=M.internal.getHeight(t),o=M.internal.getWidth(t),s=u(t,"3","ZapfDingbats",.9*i);return r.push("1 g"),r.push("0 0 "+o.toFixed(2)+" "+i.toFixed(2)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+(o-1).toFixed(2)+" "+(i-1).toFixed(2)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+n+" "+s.fontSize.toFixed(2)+" Tf 0 g"),r.push(s.text),r.push("ET"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=c(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+M.internal.getWidth(t).toFixed(2)+" "+M.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:M.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=M.RadioButton.Circle.YesNormal,e.D[t]=M.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=c(t),n=[],r=M.internal.getWidth(t)<=M.internal.getHeight(t)?M.internal.getWidth(t)/4:M.internal.getHeight(t)/4;r*=.9;var i=M.internal.Bezier_C;return n.push("q"),n.push("1 0 0 1 "+M.internal.getWidth(t)/2+" "+M.internal.getHeight(t)/2+" cm"),n.push(r+" 0 m"),n.push(r+" "+r*i+" "+r*i+" "+r+" 0 "+r+" c"),n.push("-"+r*i+" "+r+" -"+r+" "+r*i+" -"+r+" 0 c"),n.push("-"+r+" -"+r*i+" -"+r*i+" -"+r+" 0 -"+r+" c"),n.push(r*i+" -"+r+" "+r+" -"+r*i+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=c(t),n=[],r=M.internal.getWidth(t)<=M.internal.getHeight(t)?M.internal.getWidth(t)/4:M.internal.getHeight(t)/4,i=2*(r*=.9),o=i*M.internal.Bezier_C,s=r*M.internal.Bezier_C;return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+(M.internal.getWidth(t)/2).toFixed(2)+" "+(M.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+(M.internal.getWidth(t)/2).toFixed(2)+" "+(M.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=c(t),n=[],r=M.internal.getWidth(t)<=M.internal.getHeight(t)?M.internal.getWidth(t)/4:M.internal.getHeight(t)/4,i=2*(r*=.9),o=i*M.internal.Bezier_C;return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+(M.internal.getWidth(t)/2).toFixed(2)+" "+(M.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:M.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=M.RadioButton.Cross.YesNormal,e.D[t]=M.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=c(t),n=[],r=M.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+(M.internal.getWidth(t)-2).toFixed(2)+" "+(M.internal.getHeight(t)-2).toFixed(2)+" re"),n.push("W"),n.push("n"),n.push(r.x1.x.toFixed(2)+" "+r.x1.y.toFixed(2)+" m"),n.push(r.x2.x.toFixed(2)+" "+r.x2.y.toFixed(2)+" l"),n.push(r.x4.x.toFixed(2)+" "+r.x4.y.toFixed(2)+" m"),n.push(r.x3.x.toFixed(2)+" "+r.x3.y.toFixed(2)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=c(t),n=M.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+M.internal.getWidth(t).toFixed(2)+" "+M.internal.getHeight(t).toFixed(2)+" re"),r.push("f"),r.push("q"),r.push("1 1 "+(M.internal.getWidth(t)-2).toFixed(2)+" "+(M.internal.getHeight(t)-2).toFixed(2)+" re"),r.push("W"),r.push("n"),r.push(n.x1.x.toFixed(2)+" "+n.x1.y.toFixed(2)+" m"),r.push(n.x2.x.toFixed(2)+" "+n.x2.y.toFixed(2)+" l"),r.push(n.x4.x.toFixed(2)+" "+n.x4.y.toFixed(2)+" m"),r.push(n.x3.x.toFixed(2)+" "+n.x3.y.toFixed(2)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=c(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+M.internal.getWidth(t).toFixed(2)+" "+M.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){return"/F1 0 Tf 0 g"}};M.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,n,r=M.internal.getWidth(t),i=M.internal.getHeight(t),o=(n=i)<(e=r)?n:e;return{x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}}}},M.internal.getWidth=function(t){var e=0;return"object"===re(t)&&(e=a(t.Rect[2])),e},M.internal.getHeight=function(t){var e=0;return"object"===re(t)&&(e=a(t.Rect[3])),e},n.addField=function(t){return x.call(this),t instanceof U?this.addTextField.call(this,t):t instanceof F?this.addChoiceField.call(this,t):t instanceof O?this.addButton.call(this,t):t instanceof E?g.call(this,t):t&&g.call(this,t),t.page=h.internal.getCurrentPageInfo().pageNumber,this},n.addButton=function(t){x.call(this);var e=t||new P;e.FT="/Btn",e.Ff=o(e.Ff,t,h.internal.getPDFVersion()),g.call(this,e)},n.addTextField=function(t){x.call(this);var e=t||new P;e.FT="/Tx",e.Ff=o(e.Ff,t,h.internal.getPDFVersion()),g.call(this,e)},n.addChoiceField=function(t){x.call(this);var e=t||new P;e.FT="/Ch",e.Ff=o(e.Ff,t,h.internal.getPDFVersion()),g.call(this,e)},"object"==re(t)&&(t.ChoiceField=F,t.ListBox=q,t.ComboBox=j,t.EditBox=T,t.Button=O,t.PushButton=B,t.RadioButton=D,t.CheckBox=R,t.TextField=U,t.PasswordField=z,t.AcroForm={Appearance:M}),n.AcroFormChoiceField=F,n.AcroFormListBox=q,n.AcroFormComboBox=j,n.AcroFormEditBox=T,n.AcroFormButton=O,n.AcroFormPushButton=B,n.AcroFormRadioButton=D,n.AcroFormCheckBox=R,n.AcroFormTextField=U,n.AcroFormPasswordField=z,n.AcroFormAppearance=M,n.AcroForm={ChoiceField:F,ListBox:q,ComboBox:j,EditBox:T,Button:O,PushButton:B,RadioButton:D,CheckBox:R,TextField:U,PasswordField:z,Appearance:M}}(rt.API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), /** @license * jsPDF addImage plugin * 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 * 2014 James Robb, https://github.com/jamesbrobb * * */ function(b){var x="addImage_",c={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]};b.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,s,a="UNKNOWN";for(s in b.isArrayBufferView(t)&&(t=b.arrayBufferToBinaryString(t)),c)for(i=c[s],n=0;n>"),"trns"in e&&e.trns.constructor==Array){for(var o="",s=0,a=e.trns.length;s>"),i(e.data),r("endobj"),"smask"in e){var c="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,u={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:c,data:e.smask};"f"in e&&(u.f=e.f),t.call(this,u)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+e.pal.length+">>"),i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))),r("endobj"))},S=function(){var t=this.internal.collections[x+"images"];for(var e in t)n.call(this,t[e])},_=function(){var t,e=this.internal.collections[x+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R")},k=function(t){return"function"==typeof b["process"+t.toUpperCase()]},A=function(t){return"object"===re(t)&&1===t.nodeType},C=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return unescape(n);!e&&/\.png(?:[?#].*)?$/i.test(n)&&(e="png")}if("CANVAS"===t.nodeName)var r=t;else{(r=document.createElement("canvas")).width=t.clientWidth||t.width,r.height=t.clientHeight||t.height;var i=r.getContext("2d");if(!i)throw"addImage requires canvas to be supported by browser.";i.drawImage(t,0,0,r.width,r.height)}return r.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},I=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};b.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},b.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},b.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},b.sHashCode=function(t){return t=t||"",Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)},b.isString=function(t){return"string"==typeof t},b.validateStringAsBase64=function(t){var e=!0;return(t=t||"").length%4!=0&&(e=!1),!1===/[A-Za-z0-9\/]+/.test(t.substr(0,t.length-2))&&(e=!1),!1===/[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==/.test(t.substr(-2))&&(e=!1),e},b.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));\S*;*base64,(.+)$/g.exec(t)},b.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},b.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},b.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},b.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==s?n+=r[(252&(e=i[a]))>>2]+r[(3&e)<<4]+"==":2==s&&(n+=r[(64512&(e=i[a]<<8|i[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},b.createImageInfo=function(t,e,n,r,i,o,s,a,c,u,h,l,f){var p={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(p.f=o),c&&(p.dp=c),u&&(p.trns=u),h&&(p.pal=h),l&&(p.smask=l),f&&(p.p=f),p},b.addImage=function(t,e,n,r,i,o,s,a,c){var u="";if("string"!=typeof e){var h=o;o=i,i=r,r=n,n=e,e=h}if("object"===re(t)&&!A(t)&&"imageData"in t){var l=t;t=l.imageData,e=l.format||e,n=l.x||n||0,r=l.y||r||0,i=l.w||i,o=l.h||o,s=l.alias||s,a=l.compression||a,c=l.rotation||l.angle||c}if("string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var f,p,d,g,m,y,w,v=function(){var t=this.internal.collections[x+"images"];return t||(this.internal.collections[x+"images"]=t={},this.internal.events.subscribe("putResources",S),this.internal.events.subscribe("putXobjectDict",_)),t}.call(this);if(!(f=I(t,v))&&(A(t)&&(t=C(t,e)),(null==(w=s)||0===w.length)&&(s="string"==typeof(y=t)&&b.sHashCode(y)),!(f=I(s,v)))){if(this.isString(t)&&(""!==(u=this.convertStringToImageData(t))?t=u:void 0!==(u=this.loadImageFile(t))&&(t=u)),e=this.getImageFileTypeByImageData(t,e),!k(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(p=t,t=this.binaryStringToUint8Array(t))),!(f=this["process"+e.toUpperCase()](t,(m=0,(g=v)&&(m=Object.keys?Object.keys(g).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(g)),m),s,((d=a)&&"string"==typeof d&&(d=d.toUpperCase()),d in b.image_compression?d:b.image_compression.NONE),p)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,n,r,i,o,s,a){var c=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;if(n=c[0],r=c[1],s[o]=i,a){a*=Math.PI/180;var l=Math.cos(a),f=Math.sin(a),p=function(t){return t.toFixed(4)},d=[p(l),p(f),p(-1*f),p(l),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,u(t),h(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([u(n),"0","0",u(r),"0","0","cm"].join(" "))):this.internal.write([u(n),"0","0",u(r),u(t),h(e+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,f,f.i,v,c),this},b.convertStringToImageData=function(t){var e,n="";this.isString(t)&&(null!==(e=this.extractInfoFromBase64DataURI(t))?b.validateStringAsBase64(e[3])&&(n=atob(e[3])):b.validateStringAsBase64(t)&&(n=atob(t)));return n};var u=function(t,e){return t.subarray(e,e+5)};b.processJPEG=function(t,e,n,r,i,o){var s,a=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;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 string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>",u.content=m;var f=u.objId+" 0 R";m="<>";else if(c.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),n.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},n.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},n.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},n.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},n.getLineHeight=function(){return this.internal.getLineHeight()}, /** * @license * Copyright (c) 2017 Aras Abbasi * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ function(t){var s=Object.keys({ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",fa:"Persian","fa-IR":"Persian/Iran",ur:"Urdu"}),l={1569:[65152],1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1572:[65157,65158],1573:[65159,65160,65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166,65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,65193],1584:[65195,65196,65195],1585:[65197,65198,65197],1586:[65199,65200,65199],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,65261],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395,64394],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},f={1570:[65269,65270,65269,65270],1571:[65271,65272,65271,65272],1573:[65273,65274,65273,65274],1575:[65275,65276,65275,65276]},p={1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1573:[65159,65160,65159,65160],1575:[65165,65166,65165,65166]},d={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},e=[1570,1571,1573,1575],n=[1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688],o=0,a=1,c=2,u=3;function g(t){return void 0!==t&&void 0!==l[t.charCodeAt(0)]}function h(t){return void 0!==t&&0<=n.indexOf(t.charCodeAt(0))}function m(t){return void 0!==t&&0<=e.indexOf(t.charCodeAt(0))}function y(t){return g(t)&&2<=l[t.charCodeAt(0)].length}function w(t,e,n,r){return g(t)?(r=r||{},l=Object.assign(l,r),!y(t)||!g(e)&&!g(n)||!g(n)&&h(e)||h(t)&&!g(e)||h(t)&&m(e)||h(t)&&h(e)?(l=Object.assign(l,p),o):g(i=t)&&4==l[i.charCodeAt(0)].length&&g(e)&&!h(e)&&g(n)&&y(n)?(l=Object.assign(l,p),u):h(t)||!g(n)?(l=Object.assign(l,p),a):(l=Object.assign(l,p),c)):-1;var i}var v=t.processArabic=function(t,e){t=t||"",e=e||!1;var n,r,i,o="",s=0,a=0,c="",u="",h="";for(s=0;s>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},( /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ r=rt.API).events.push(["initialized",function(){this.canvas.pdf=this}]),r.canvas={getContext:function(t){return(this.pdf.context2d._canvas=this).pdf.context2d},childNodes:[],style:{},autoContext2dResizeX:!0,autoContext2dResizeY:!0},Object.defineProperty(r.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.autoContext2dResizeX&&(this.getContext("2d").pageWrapX=t+1)}}),Object.defineProperty(r.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.autoContext2dResizeY&&(this.getContext("2d").pageWrapY=t+1)}}), /** * @license * ==================================================================== * 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 * 2014 Diego Casorran, https://github.com/diegocr * * * ==================================================================== */ C=rt.API,I={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){I={x:t,y:e,w:n,h:r,ln:i}},d=function(){return I},F={left:0,top:0,bottom:0},C.setHeaderFunction=function(t){c=t},C.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,s=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else if("[object Array]"===Object.prototype.toString.call(t)){for(var a=0;a=this.internal.pageSize.getHeight()-u.bottom&&(this.cellAddPage(),c=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,c&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===s){i instanceof Array||(i=[i]);for(var h=0;h=this.pageBreaks[r]){e++,0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r],n+=Math.floor(i/this.pageWrapY)}if(0===this.lastBreak)n+=Math.floor(t/this.pageWrapY)+1;return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},drawImage:function(t,e,n,r,i,o,s,a,c){void 0!==o&&(e=o,n=s,r=a,i=c),e=this._wrapX(e),n=this._wrapY(n);var u,h=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),l=(this._matrix_map_rect(this.ctx._transform,{x:o,y:s,w:a,h:c}),/data:image\/(\w+).*/i.exec(t));u=null!=l?l[1]:"png",this.pdf.addImage(t,u,h.x,h.y,h.w,h.h)},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=n*t[0]+r*t[2],u=i*t[0]+o*t[2],h=s*t[0]+a*t[2]+t[4];return r=n*t[1]+r*t[3],o=i*t[1]+o*t[3],a=s*t[1]+a*t[3]+t[5],[n=c,r,i=u,o,s=h,a]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n),s=(e/=o)*r+(n/=o)*i;r-=e*s,i-=n*s;var a=Math.sqrt(r*r+i*i);return s/=a,e*(i/=a)>"),this.internal.out("endobj"),l=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+f+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==h&&void 0!==l&&this.internal.out("/Names <>")}),this},( /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ g=rt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var l=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+l+" 0 R"),t.internal.write(">>","endobj")}}]),g.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},o.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[l++]=a>>>16&255,f[l++]=a>>>8&255,f[l++]=255&a,q.arrayBufferToBinaryString(f)},m=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},y=function(t,e){for(var n,r=1,i=0,o=t.length,s=0;0>>0},v=function(t,e,n,r){for(var i,o,s,a=t.length/e,c=new Uint8Array(t.length+a),u=O(),h=0;h>>1)&255;return o},k=function(t,e,n){var r,i,o,s,a=[],c=0,u=t.length;for(a[0]=4;c>>d&255,d+=o.bits;y[v]=x>>>d&255}if(16===o.bits){g=(C=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,S=1>>0&255,S&&(m[b++]=x>>>16&255,x=C[v++],m[b++]=x>>>0&255),y[_++]=x>>>16&255;p=8}r!==q.image_compression.NONE&&j()?(t=T(m,o.width*o.colors,o.colors,r),h=T(y,o.width,1,r)):(t=m,h=y,f=null)}if(3===o.colorType&&(l=this.color_spaces.INDEXED,u=o.palette,o.transparency.indexed)){var k=o.transparency.indexed,A=0;for(v=0,g=k.length;vr&&(i.push(t.slice(c,o)),a=0,c=o),a+=e[o],o++;return c!==o&&i.push(t.slice(c,o)),i},H=function(t,e,n){n||(n={});var r,i,o,s,a,c,u=[],h=[u],l=n.textIndent||0,f=0,p=0,d=t.split(" "),g=z.apply(this,[" ",n])[0];if(c=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(c).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,c=N.apply(this,[m,n])}for(o=0,s=d.length;o>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, /** ==================================================================== * jsPDF XMP metadata plugin * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi * * * ==================================================================== */ Q=rt.API,tt=$=Z="",Q.addMetadata=function(t,e){return $=e||"http://jspdf.default.namespaceuri/",Z=t,this.internal.events.subscribe("postPutResources",function(){if(Z){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(Z)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),s=n.length+r.length+i.length+e.length+o.length;tt=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else tt=""}),this.internal.events.subscribe("putCatalog",function(){tt&&this.internal.write("/Metadata "+tt+" 0 R")}),this},function(p,t){var e=p.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof p.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),s="",a=0;a>"),r(s),e("endobj");var u=n(),h=d(t.metadata.toUnicode);e("<<"),e("/Length "+h.length),e("/Length1 "+h.length),e(">>"),r(h),e("endobj");var l=n();e("<<"),e("/Type /FontDescriptor"),e("/FontName /"+t.fontName),e("/FontFile2 "+c+" 0 R"),e("/FontBBox "+p.API.PDFObject.convert(t.metadata.bbox)),e("/Flags "+t.metadata.flags),e("/StemV "+t.metadata.stemV),e("/ItalicAngle "+t.metadata.italicAngle),e("/Ascent "+t.metadata.ascender),e("/Descent "+t.metadata.decender),e("/CapHeight "+t.metadata.capHeight),e(">>"),e("endobj");var f=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+l+" 0 R"),e("/W "+p.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+u+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+f+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof p.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",s=0;s>"),e("endobj"),t.objectNumber=n(),s=0;s>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var u=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,s=t.options||{},a=t.mutex||{},c=a.pdfEscape,u=a.activeFontKey,h=a.fonts,l=(a.activeFontSize,""),f=0,p="",d=h[n=u].encoding;if("Identity-H"!==h[n].encoding)return{text:r,x:i,y:o,options:s,mutex:a};for(p=r,n=u,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;f>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t,t+=3*i);var s=!0,a=[],c=0,u=null,h=0,l=null;for(this.width=S,this.height=e;s&&t>2&7,t++;break;case 254:for(;;){if(0===(k=x[t++]))break;t+=k}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var p=x[t++]|x[t++]<<8,d=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,y=x[t++],w=y>>6&1,v=o,b=!1;if(y>>7){b=!0;v=t,t+=3*(1<<(7&y)+1)}var _=t;for(t++;;){var k;if(0===(k=x[t++]))break;t+=k}a.push({x:p,y:d,width:g,height:m,has_local_palette:b,palette_offset:v,data_offset:_,data_length:t-_,transparent_index:u,interlaced:!!w,delay:c,disposal:h});break;case 59:s=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return a.length},this.loopCount=function(){return l},this.frameInfo=function(t){if(t<0||t>=a.length)throw"Frame index out of range.";return a[t]},this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);bt(x,n.data_offset,i,r);var o=n.palette_offset,s=n.transparent_index;null===s&&(s=256);var a=n.width,c=S-a,u=a,h=4*(n.y*S+n.x),l=4*((n.y+n.height)*S+n.x),f=h,p=4*c;!0===n.interlaced&&(p+=4*(a+c)*7);for(var d=8,g=0,m=i.length;g>=1)),y===s)f+=4;else{var w=x[o+3*y],v=x[o+3*y+1],b=x[o+3*y+2];e[f++]=b,e[f++]=v,e[f++]=w,e[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);bt(x,n.data_offset,i,r);var o=n.palette_offset,s=n.transparent_index;null===s&&(s=256);var a=n.width,c=S-a,u=a,h=4*(n.y*S+n.x),l=4*((n.y+n.height)*S+n.x),f=h,p=4*c;!0===n.interlaced&&(p+=4*(a+c)*7);for(var d=8,g=0,m=i.length;g>=1)),y===s)f+=4;else{var w=x[o+3*y],v=x[o+3*y+1],b=x[o+3*y+2];e[f++]=w,e[f++]=v,e[f++]=b,e[f++]=255}--u}}}function bt(t,e,n,r){for(var i=t[e++],o=1<>=c,h-=c,m!==o){if(m===s)break;for(var y=m>8,++w;var b=v;if(r>=8;null!==g&&a<4096&&(d[a++]=g<<8|b,u+1<=a&&c<12&&(++c,u=u<<1|1)),g=m}else a=s+1,u=(1<<(c=i+1))-1,g=null}return f!==r&&console.log("Warning, gif stream shorter than expected."),n}"undefined"!=typeof module&&module.exports?module.exports.saveAs=ie:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define("FileSaver.js",function(){return ie}),rt.API.adler32cs=(ut="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,ht=ut?function(t){return t instanceof ArrayBuffer||!1}:function(){return!1},lt=function(t){return unescape(encodeURIComponent(t))},ft=65521,pt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i>>0},dt=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i>>0},mt=(gt={}).Adler32=(((ct=(at=function(t){if(!(this instanceof at))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}).prototype={}).constructor=at).from=((it=function(t){if(!(this instanceof at))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=pt(1,t.toString())}).prototype=ct,it),at.fromUtf8=((ot=function(t){if(!(this instanceof at))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=lt(t.toString());this.checksum=pt(1,e)}).prototype=ct,ot),ut&&(at.fromBuffer=((st=function(t){if(!(this instanceof at))throw new TypeError("Constructor cannot called be as a function.");if(!ht(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=dt(1,e)}).prototype=ct,st)),ct.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=pt(this.checksum,t)},ct.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=lt(t.toString());return this.checksum=pt(this.checksum,e)},ut&&(ct.updateBuffer=function(t){if(!ht(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=dt(this.checksum,e)}),ct.clone=function(){return new mt(this.checksum)},at),gt.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return pt(1,t.toString())},gt.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=lt(t.toString());return pt(1,e)},ut&&(gt.fromBuffer=function(t){if(!ht(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return dt(1,e)}),gt), /* Copyright (c) 2008, Adobe Systems Incorporated All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of Adobe Systems Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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. */ /* 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. */ function(t){var d=15,g=573,e=[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];function lt(){var p=this;function c(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}p.build_tree=function(t){var e,n,r,i=p.dyn_tree,o=p.stat_desc.static_tree,s=p.stat_desc.elems,a=-1;for(t.heap_len=0,t.heap_max=g,e=0;ep.max_code||(t.bl_count[i]++,o=0,h<=n&&(o=u[n-h]),s=a[2*n],t.opt_len+=s*(i+o),c&&(t.static_len+=s*(c[2*n+1]+o)));if(0!==f){do{for(i=l-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[l]--,f-=2}while(0p.max_code||(a[2*r+1]!=i&&(t.opt_len+=(i-a[2*r+1])*a[2*r],a[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,o,s=[],a=0;for(r=1;r<=d;r++)s[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=c(s[o]++,o))}(i,p.max_code,t.bl_count)}}function ft(t,e,n,r,i){var o=this;o.static_tree=t,o.extra_bits=e,o.extra_base=n,o.elems=r,o.max_length=i}lt._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],lt.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],lt.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],lt.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},lt.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],lt.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],lt.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],lt.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft.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],ft.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],ft.static_l_desc=new ft(ft.static_ltree,lt.extra_lbits,257,286,d),ft.static_d_desc=new ft(ft.static_dtree,lt.extra_dbits,0,30,d),ft.static_bl_desc=new ft(null,lt.extra_blbits,0,19,7);function n(t,e,n,r,i){var o=this;o.good_length=t,o.max_lazy=e,o.nice_length=n,o.max_chain=r,o.func=i}var pt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],dt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gt=262;function mt(t,e,n,r){var i=t[2*e],o=t[2*n];return i>>8&255)}function $(t,e){var n,r=e;16-r>>16-W,W+=r-16):(H|=t<>>=8,W-=8)}function rt(t,e){var n,r,i;if(G.pending_buf[N+2*M]=t>>>8&255,G.pending_buf[N+2*M+1]=255&t,G.pending_buf[U+M]=255&e,M++,0===t?a[2*e]++:(o++,t--,a[2*(lt._length_code[e]+256+1)]++,E[2*lt.d_code(t)]++),0==(8191&M)&&2>>=3,o>>3,(i=G.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5,e+4<=r&&-1!=t?st(t,e,n):i==r?($(2+(n?1:0),3),it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3),function(t,e,n){var r;for($(t-257,5),$(e-1,5),$(n-4,4),r=0;r>=2),Ps&&0!=--r);return o<=P?o:P}function ht(t){return t.total_in=t.total_out=0,t.msg=null,G.pending=0,G.pending_out=0,u=113,l=0,V.dyn_tree=a,V.stat_desc=ft.static_l_desc,Y.dyn_tree=E,Y.stat_desc=ft.static_d_desc,X.dyn_tree=R,X.stat_desc=ft.static_bl_desc,W=H=0,L=8,J(),function(){var t;for(i=2*f,t=y[v-1]=0;t>1)&&(i=3),r|=i<<6,0!==C&&(r|=32),u=113,Q((a=r+=31-r%31)>>8&255),Q(255&a)),0!==G.pending){if(c.flush_pending(),0===c.avail_out)return l=-1,0}else if(0===c.avail_in&&e<=o&&4!=e)return c.msg=dt[7],-5;if(666==u&&0!==c.avail_in)return t.msg=dt[7],-5;if(0!==c.avail_in||0!==P||0!=e&&666!=u){switch(s=-1,pt[T].func){case 0:s=function(t){var e,n=65535;for(h-5t.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 o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var a=new i,c=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1),a.deflateInit(e),a.next_out=c,this.append=function(t,e){var n,r=[],i=0,o=0,s=0;if(t.length){a.next_in_index=0,a.next_in=t,a.avail_in=t.length;do{if(a.next_out_index=0,a.avail_out=512,0!=a.deflate(0))throw new Error("deflating: "+a.msg);a.next_out_index&&(512==a.next_out_index?r.push(new Uint8Array(c)):r.push(new Uint8Array(c.subarray(0,a.next_out_index)))),s+=a.next_out_index,e&&0 "+a.toRGB()+" -> "+a.toHex());s.appendChild(c),s.appendChild(u),o.appendChild(s)}catch(t){}return o}},function(t){var n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),c="_".charCodeAt(0),h=function(t){var e=t.charCodeAt(0);return e===n||e===a?62:e===r||e===c?63:e>16),u((65280&i)>>8),u(255&i);return 2===o?u(255&(i=h(t.charAt(e))<<2|h(t.charAt(e+1))>>4)):1===o&&(u((i=h(t.charAt(e))<<10|h(t.charAt(e+1))<<4|h(t.charAt(e+2))>>2)>>8&255),u(255&i)),s}(n),e,r)},i.prototype.parse=function(){return this.directory=new e(this.contents),this.head=new p(this),this.name=new b(this),this.cmap=new y(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new x(this),this.hmtx=new S(this),this.post=new w(this),this.os2=new m(this),this.loca=new I(this),this.glyf=new k(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.bbox).length;t>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},i.prototype.widthOfString=function(t,e,n){var r,i,o,s,a;for(i=s=o=0,a=(t=""+t).length;0<=a?s>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return 2147483648<=(t=this.readUInt32())?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;0<=t?r>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n>8,c[4*u+1]=(16711680&n[u])>>16,c[4*u]=(4278190080&n[u])>>24;return c},e}(),P=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,o,s,a;for(r={},o=0,s=t.length;o>"),e.join("\n")},s}()}(rt), /* # PNG.js # Copyright (c) 2011 Devon Govett # MIT LICENSE # # */ yt="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")(),wt=function(){var u,n,r;function i(t){var e,n,r,i,o,s,a,c,u,h,l,f,p,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(e=this.readUInt32(),u=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},o=this.readUInt16(),i=this.readUInt16()||100,s.delay=1e3*o/i,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===u&&(this.pos+=4,e-=4),t=(null!=s?s.data:void 0)||this.imgData,f=0;0<=e?fr)throw new Error("More transparent colors than palette size");if(0<(h=r-this.transparency.indexed.length))for(p=0;0<=h?pthis.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e),(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof n?n(t):void 0},r.send(null)},i.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e * Chris G Jones * Shaon Barman * Vivien Nicolas <21@vingtetun.org> * Justin D'Arcangelo * Yury Delendik * * */ var xt=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(t){var e=this.buffer,n=e?e.byteLength:0;if(t>t,this.codeSize=n-=t,this.bytesPos=o,e},t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,s=this.bytesPos;r>16,h=65535&c;return(0==r||r>u,this.codeSize=r-u,this.bytesPos=s,h},t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;rn&&(n=t[r]);for(var i=1<>=1;for(r=h;r>=1)){var n,r;if(1==e)n=T,r=O;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,s=this.getBits(4)+4,a=Array(F.length),c=0;c>16;0>16)&&(y=this.getBits(y));var w=(65535&m)+y;d<=g+h&&(d=(C=this.ensureBuffer(g+h)).length);for(var v=0;v