(function(){var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(d){var g=0;return function(){return g=b}},"es6","es3");$jscomp.findInternal=function(d,g,n){d instanceof String&&(d=String(d));for(var q=d.length,b=0;b>>1;0<=r(a[d],b)?h=d+1:e=d}return h};d.exports=function(){function a(a){var b;this.options=a;this.comparator=this.options.comparator;this.data=(null!=(b=this.options.initialValues)?b.slice(0):void 0)||[];this.data.sort(this.comparator).reverse()}a.prototype.queue=function(a){var b=m(this.data,a,this.comparator); this.data.splice(b,0,a)};a.prototype.dequeue=function(){return this.data.pop()};a.prototype.peek=function(){return this.data[this.data.length-1]};a.prototype.find=function(a){var b=m(this.data,a,this.comparator)-1;return 0<=b&&!this.comparator(this.data[b],a)?b:-1};a.prototype.remove=function(a){a=this.find(a);return 0<=a?(this.data.splice(a,1),!0):!1};a.prototype.removeAllMatching=function(a,b){for(var e=0,h=this.data.length-1;0<=h;--h)if(a(this.data[h])){var d=this.data.splice(h,1)[0];b&&b(d);++e}return e}; return a}()},{}]},{},[1])(1)}();!0},function(d,g,n){(function(d){function b(a,b){this._id=a;this._clearFn=b}var u="undefined"!==typeof d&&d||"undefined"!==typeof self&&self||window,a=Function.prototype.apply;g.setTimeout=function(){return new b(a.call(setTimeout,u,arguments),clearTimeout)};g.setInterval=function(){return new b(a.call(setInterval,u,arguments),clearInterval)};g.clearTimeout=g.clearInterval=function(a){a&&a.close()};b.prototype.unref=b.prototype.ref=function(){};b.prototype.close=function(){this._clearFn.call(u, this._id)};g.enroll=function(a,b){clearTimeout(a._idleTimeoutId);a._idleTimeout=b};g.unenroll=function(a){clearTimeout(a._idleTimeoutId);a._idleTimeout=-1};g._unrefActive=g.active=function(a){clearTimeout(a._idleTimeoutId);var b=a._idleTimeout;0<=b&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},b))};n(17);g.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof d&&d.setImmediate||this&&this.setImmediate;g.clearImmediate="undefined"!==typeof self&&self.clearImmediate|| "undefined"!==typeof d&&d.clearImmediate||this&&this.clearImmediate}).call(this,n(5))},function(d,g){g=function(){return this}();try{g=g||(new Function("return this"))()}catch(n){"object"===typeof window&&(g=window)}d.exports=g},function(d,g,n){n.d(g,"b",function(){return m});n.d(g,"a",function(){return h});var q=n(10),b=n(1),u=n(12),a=n(2);d="undefined"===typeof window?self:window;d.Uint8ClampedArray||(d.Uint8ClampedArray=d.Uint8Array);"undefined"===typeof d.crypto&&(d.crypto={getRandomValues:function(a){for(var b= 0;bthis.callbackIndex&&Object(q.a)("Can't reuse callbackId "+ d+" lesser than callbackIndex "+this.callbackIndex);d in this.callbacksCapabilities&&Object(q.a)("Can't reuse callbackId "+d+". There is a capability waiting to be resolved. ");b={action:b,data:a,callbackId:d};a=createPromiseCapability();this.callbacksCapabilities[d]=a;try{this.postMessage(b)}catch(e){a.reject(e)}return a.promise},sendError:function(b,d){if(b.message||b.errorData){b.message&&b.message.message&&(b.message=b.message.message);var a=b.errorData;b={type:b.type?b.type:"JavascriptError", message:b.message};a&&Object.keys(a).forEach(function(d){a.hasOwnProperty(d)&&(b[d]=a[d])})}this.postMessage({isReply:!0,callbackId:d,error:b})},getPromise:function(b){if(b in this.callbacksCapabilities)return this.callbacksCapabilities[b];Object(q.a)("Cannot get promise for callback "+b)},cancelPromise:function(b){if(b in this.callbacksCapabilities){var d=this.callbacksCapabilities[b];delete this.callbacksCapabilities[b];d.reject({type:"Cancelled",message:"Request has been cancelled."});this.postMessage({action:"actionCancel", data:{callbackId:b}})}else Object(q.c)("Cannot cancel callback "+b)},postMessage:function(b){if(this.postMessageTransfers){var d=this.getTransfersArray(b);this.comObj.postMessage(b,d)}else this.comObj.postMessage(b)},getObjectTransfers:function(b,d){var a=this;null!==b&&"object"===typeof b&&(b instanceof Uint8Array?d.push(b.buffer):b instanceof ArrayBuffer?d.push(b):Object.keys(b).forEach(function(m){b.hasOwnProperty(m)&&a.getObjectTransfers(b[m],d)}))},getTransfersArray:function(b){var d=[];this.getObjectTransfers(b, d);return 0===d.length?void 0:d},handleMessage:function(b){var d=this,a=b.data,m=this.actionHandler,e=this.actionHandlerAsync;b=this.callbacksCapabilities;if(a.isReply)m=a.callbackId,m in b?(e=b[m],delete b[m],"error"in a?e.reject(a.error):e.resolve(a.data)):Object(q.c)("Cannot resolve callback "+m);else if(a.action in m){var h=m[a.action];a.callbackId?Promise.resolve().then(function(){return h[0].call(h[1],a.data)}).then(function(b){d.postMessage({isReply:!0,callbackId:a.callbackId,data:b})},function(b){d.sendError(b, a.callbackId)}):h[0].call(h[1],a.data)}else a.action in e?(h=e[a.action],a.callbackId?h[0].call(h[1],a).then(function(b){d.postMessage({isReply:!0,callbackId:a.callbackId,data:b});d.nextAsync()},function(b){d.sendError(b,a.callbackId);d.nextAsync()}):h[0].call(h[1],a).then(function(){d.nextAsync()},function(){d.nextAsync()})):Object(q.a)("Unknown action from worker: "+a.action)}};g.a=d},function(d,g,n){function q(){return b}n.d(g,"a",function(){return q});var b=32},function(d,g,n){var q=[0,1,3,7, 15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],b=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[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,99,99],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],m=[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],e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=function(){this.list=this.next=null},r= function(){this.n=this.b=this.e=0;this.t=null},x=function(a,b,d,e,k,t){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var l=Array(this.BMAX+1),f,c,p,B=Array(this.BMAX+1),w,A=new r,C=Array(this.BMAX);var m=Array(this.N_MAX);var v=Array(this.BMAX+1),y,x;var q=this.root=null;for(c=0;cc&&(t=c);for(y=1<(y-=l[p])){this.status=2;this.m=t;return}if(0>(y-=l[c]))this.status=2,this.m=t;else{l[c]+=y;v[1]=p=0;g=l;u=1;for(w=2;0<--c;)v[w++]=p+=g[u++];g=a;c=u=0;do 0!=(p=g[u++])&&(m[v[p]++]=c);while(++cG+B[1+ m];){G+=B[1+m];m++;x=(x=L-G)>t?t:x;if((f=1<<(p=D-G))>a+1)for(f-=a+1,w=D;++pn&&G>G-B[m],C[m-1][p].e=A.e,C[m-1][p].b=A.b,C[m-1][p].n=A.n,C[m-1][p].t=A.t)}A.b=D-G;u>=b?A.e=99:g[u]g[u]?16:15,A.n=g[u++]):(A.e=k[g[u]-d],A.n=e[g[u++]-d]);f=1<>G;p>=1)c^=p;for(c^=p;(c&(1<>=a;this.zip_bit_len-=a},zip_inflate_codes:function(a,b,d){var e,h;if(0==d)return 0;for(h=0;;){this.zip_NEEDBITS(this.zip_bl); var l=this.zip_tl.list[this.zip_GETBITS(this.zip_bl)];for(e=l.e;16l;l++)k[l]=8;for(;256>l;l++)k[l]= 9;for(;280>l;l++)k[l]=7;for(;288>l;l++)k[l]=8;this.zip_fixed_bl=7;l=new x(k,288,257,b,u,this.zip_fixed_bl);if(0!=l.status)return alert("HufBuild error: "+l.status),-1;this.zip_fixed_tl=l.root;this.zip_fixed_bl=l.m;for(l=0;30>l;l++)k[l]=5;this.zip_fixed_bd=5;l=new x(k,30,0,a,m,this.zip_fixed_bd);if(1r;r++)v[e[r]]=0;this.zip_bl= 7;r=new x(v,19,19,null,null,this.zip_bl);if(0!=r.status)return-1;this.zip_tl=r.root;this.zip_bl=r.m;var p=f+c;for(k=t=0;kr)v[k++]=t=r;else if(16==r){this.zip_NEEDBITS(2);r=3+this.zip_GETBITS(2);this.zip_DUMPBITS(2);if(k+r>p)return-1;for(;0p)return-1;for(;0d&&(d+=this.byteLength);0>b&&(b+=this.byteLength);d=Math.min(Math.max(0,d),this.byteLength); b=Math.min(Math.max(0,b),this.byteLength);if(0>=b-d)return new ArrayBuffer(0);var g=new ArrayBuffer(b-d),a=new Uint8Array(g);d=new Uint8Array(this,d,b-d);a.set(d);return g})})(self)},function(d,g,n){(function(d,b){(function(b){function a(){for(var c=0;cc;){REX(Module._TRN_ChunkRendererRenderNext(L,M));if(!Module.getValue(M,"i8*")){f=!0;break}c=(new Date).getTime()-a}if(f){var d=Module.GetCurrentCanvasData(!1);Object(g.b)("worker","Total Page Time "+((new Date).getTime()-G));q.forEach(function(c){c()}); e(d)}else Module.cleanupState.timeout=b(P,0)}catch(R){q.forEach(function(c){c()}),h(R)}},S=b(P,0);Module.cleanupState={cleanupArr:q,timeout:S};q.push(function(){Module.cleanupState=null})}catch(Q){q.forEach(function(c){c()}),h(Q)}})};m.GetDestinationVPosHPos=function(a){var b=0,d=0,e=!1,k=!1,m=Module.DestinationGetPage(a),l=Module.DestinationGetExplicitDestObj(a);m=Module.PageGetDefaultMatrix(m);m=Module.Matrix2DInverse(m);var g=Module.Matrix2DMult(m,{x:d,y:b});d=g.x;b=g.y;try{switch(Module.DestinationGetFitType(a)){case 2:case 6:var n= Module.ObjGetAt(l,2);Module.ObjIsNumber(n)&&(b=Module.ObjGetNumber(n),e=!0);break;case 0:n=Module.ObjGetAt(l,2);Module.ObjIsNumber(n)&&(d=Module.ObjGetNumber(n),k=!0);n=Module.ObjGetAt(l,3);Module.ObjIsNumber(n)&&(b=Module.ObjGetNumber(n),e=!0);break;case 4:n=Module.ObjGetAt(l,2);Module.ObjIsNumber(n)&&(d=Module.ObjGetNumber(n),k=!0);n=Module.ObjGetAt(l,5);Module.ObjIsNumber(n)&&(b=Module.ObjGetNumber(n),e=!0);break;case 3:case 7:n=Module.ObjGetAt(l,2),Module.ObjIsNumber(n)&&(d=Module.ObjGetNumber(n), k=!0)}g=Module.Matrix2DMult(m,{x:d,y:b});d=g.x;b=g.y;e||(b=0);k||(d=0)}catch(C){d=b=0}return{hpos:d,vpos:b}};m.FillBookmarkTree=function(a,b){for(var d=Module.stackSave(),e=0;Module.BookmarkIsValid(a);a=Module.BookmarkGetNext(a),++e)try{var k=[];if(Module.BookmarkHasChildren(a)){var h=Module.BookmarkGetFirstChild(a);Module.FillBookmarkTree(h,k)}var l=Module.BookmarkGetTitle(a);k={children:k,name:l};var n=Module.BookmarkGetAction(a);if(Module.ActionIsValid(n)){var m=Module.ActionGetType(n);if(0=== m){var g=Module.ActionGetDest(n);if(Module.DestinationIsValid(g)){var t=Module.DestinationGetPage(g);if(Module.PageIsValid(t)){var q=Module.PageGetIndex(t);if(0b){this.keepChunks(k.slice(0,h-d+b));break}this.keepChunks(l.have)}},getChunkAsync:function(a){var c=this,f=a+524288,b=524288;f>this.length&&(b-=f-this.length);return q(this.url,a,b,this.customHeaders,this.withCredentials).then(function(f){c.writeChunk(f,a)})},getChunks:function(a){for(var c=a.length,f=Array(c),b=0;b=Module.chunkMax&&!f;524288!==d||a.buffer.byteLength!==d?(p?(f=this.lruList.shift(),p=this.chunkMap[f],524288>p.length&&(p=new Int8Array(524288)),this.chunkMap[f]=null):p=f?this.chunkMap[c]:new Int8Array(524288),p.subarray(b,b+d).set(a),a=p):p&&(f=this.lruList.shift(),this.chunkMap[f]=null);this.lruUpdate(c);this.chunkMap[c]=a}};var v= function(a){this.chunkStorage=a;this.position=0;this.length=this.chunkStorage.length};v.prototype={read:function(a,c,b){var f=this.position+b<=this.length,d=f?b:this.length-this.position;if(this.positionc.length&&(b=c.length),f=this.position-this.length,h=a.subarray(h,h+b),e=c.subarray(f,f+b),h.set(e);this.position+=b;return d+b}return d},write:function(a,c,b){var f=this.position+b<=this.length,d=this.position+b<=this.length?b:this.length-this.position,p=a.subarray(c,c+d),e=this.position%524288;this.chunkStorage.writeChunk(p,this.position-e,e);this.position+=d;if(!f){p=c+d;if(b-=d)c=this.chunkStorage.getCacheData(),b>c.length&&(b=c.length),f=this.position- this.length,p=a.subarray(p,p+b),c.subarray(f,f+b).set(p);this.position+=b;return d+b}return d},seek:function(a){this.position=a},close:function(){this.chunkStorage=null},getPos:function(){return this.position},getTotalSize:function(){return this.length}};var A=function(a){this.docId=a;this.length=0;this.data=new Int8Array(8192);this.position=0};A.prototype={seek:function(a){this.position=a},close:function(){var a=new Int8Array(this.data.buffer.slice(0,this.length));Module.ChangeDocBackend(this.docId, {ptr:Module.GetDoc(this.docId),buffer:a});this.data=null},getPos:function(){return this.position},getTotalSize:function(){return this.length},read:function(a,c,b){var f=this.data.length;b=b+cd;){d=Math.max(d*(16777216this.length&&(this.length=this.position);return b}};var C={IsSink:function(a){return 66===(a.flags&255)},open:function(a){var c=a.path.slice(1);this.IsSink(a)?(a.provider=new A(c),Module.docs[c].sink=a.provider):a.provider=Module.docs[c].sink?new u(Module.docs[c].sink.data):Module.docs[c].chunkStorage?new v(Module.docs[c].chunkStorage):Module.docs[c].buffer?new u(Module.docs[c].buffer):new k(Module.docs[c].file)},close:function(a){a.provider.close()}, read:function(a,c,b,d,e){return a.provider.read(c,b,d)},llseek:function(a,c,b){a=a.provider;1===b?c+=a.getPos():2===b&&(c=a.getTotalSize()+c);if(0>c)throw new FS.ErrnoError(g.ERRNO_CODES.EINVAL);a.seek(c);return c},write:function(a,c,b,d,e){return d?a.provider.write(c,b,d):0}};g.THROW=function(a){throw{type:"InvalidPDF",message:a};};var t=function(b){return"Exception: \n\t Message: "+a.GetJSStringFromCString(Module._TRN_GetMessage(b))+"\n\t Filename: "+a.GetJSStringFromCString(Module._TRN_GetFileName(b))+ "\n\t Function: "+a.GetJSStringFromCString(Module._TRN_GetFunction(b))+"\n\t Linenumber: "+a.GetJSStringFromCString(Module._TRN_GetLineNum(b))};a.GetErrToString=t;g.REX=function(a){a&&THROW(t(a))};a.Initialize=function(a){var c=Module.stackSave();a=a?Module.allocate(Module.intArrayFromString(a),"i8",Module.ALLOC_STACK):0;REX(Module._TRN_PDFNetInitialize(a));Module.stackRestore(c)};a.GetDoc=function(a){if(a in Module.docs)return Module.docs[a].ptr;throw{type:"InvalidDocReference",message:"Unable to access Document id="+ a+". The document appears to be invalid or was deleted."};};a.clearDocBackend=function(){null!==Module.cachePtr?(Module.hasBufOwnership&&Module._free(Module.cachePtr),Module.cachePtr=null):Module.docs[a.currentFileString]&&delete Module.docs[a.currentFileString]};a.MakeDev=function(a){if(!h[a]){var c=FS.makedev(3,5);FS.registerDevice(c,C);FS.mkdev(a,511,c);h[a]=!0}};a.CreateDocFileBackend=function(a,c){Module.MakeDev(c);var b=Module.allocate(4,"i8",Module.ALLOC_STACK);Module.docs[c]={file:a};a=Module.allocate(Module.intArrayFromString(c), "i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreateFromFilePath(a,b));b=Module.getValue(b,"i8*");Module.docs[c].ptr=b};a.InsertImageIntoDoc=function(a,c,b){var f=[];try{var d=Module.ElementBuilderCreate();f.push(function(){Module.ElementBuilderDestroy(d)});var p=Module.ElementWriterCreate();f.push(function(){Module.ElementWriterDestroy(p)});if(b){var e=b.width;var l=b.height}else e=Module.ImageGetImageWidth(c),l=Module.ImageGetImageHeight(c),b=e/l,b>612/792?(e=612,l=parseInt(e/b,10)):(l=792,e=parseInt(l* b,10));var k=Module.ElementBuilderCreateImage(d,c,0,0,e,l),h=Module.PDFDocPageCreate(a,e,l);Module.ElementWriterBegin(p,h);Module.ElementWriterWritePlacedElement(p,k);Module.ElementWriterEnd(p);Module.PDFDocPagePushBack(a,h)}finally{f.forEach(function(a){a()})}};var H=function(a,c,b){"object"===typeof a?(this.m_pages=a.m_pages,this.m_has_named_dests=a.m_has_named_dests,this.m_finished_download=a.m_finished_download,this.m_has_outline=a.m_has_outline,this.m_current_page=a.m_current_page,this.m_id= a.m_id,this.size=a.size,this.timeout=a.timeout,this.eventPageArray=a.eventPageArray,this.requirePageCallbacks=a.requirePageCallbacks):(this.m_pages=[],this.m_has_outline=this.m_finished_download=this.m_has_named_dests=!1,this.m_current_page=1,this.m_id=b,this.size=a,this.timeout=null,this.eventPageArray=[],this.requirePageCallbacks={});this.downloadUserData=Module.createDownloadUserData(c,b)};H.prototype={getJSUrl:function(){return Module.extractDownloadUserData(this.downloadUserData).url},getDocId:function(){return Module.extractDownloadUserData(this.downloadUserData).docId}, destroyUserData:function(){this.m_id in Module.withCredentials&&delete Module.withCredentials[this.m_id];this.m_id in Module.customHeadersMap&&delete Module.customHeadersMap[this.m_id];Module.destroyDownloadUserData(this.downloadUserData)}};a.createDownloadUserData=function(a,c){a=Module.allocate(Module.intArrayFromString(a),"i8",Module.ALLOC_NORMAL);var b=Module.allocate(8,"i8",Module.ALLOC_NORMAL);Module.setValue(b,a,"i8*");Module.setValue(b+4,parseInt(c,10),"i32");return this.downloadUserData= b};a.extractDownloadUserData=function(b){var c=Module.getValue(b,"i8*");c=a.GetJSStringFromCString(c);b=Module.getValue(b+4,"i32").toString();return{url:c,docId:b}};a.destroyDownloadUserData=function(a){Module._free(Module.getValue(a,"i8*"));Module._free(a)};g.downloadDataMap={};Module.customHeadersMap={};Module.withCredentials={};a.GetDownloadData=function(a){if(a in downloadDataMap)return downloadDataMap[a]};a.DownloaderHint=function(a,c){var b=this,f=Module.GetDoc(a),d=downloadDataMap[f];c.currentPage&& (d.m_current_page=c.currentPage);if(c.visiblePages){var e=c.visiblePages;for(c=0;cd.length+n&&!e)){n+=d.length;var m=d.length,r=Module._malloc(d.length);Module.HEAPU8.set(d,r);REX(Module._TRN_PDFDocCreateFromBuffer(r,m,l));var q=Module.getValue(l,"i8*");Module.docs[c]={ptr:q, bufPtr:r,bufPtrSize:m,ownership:!0};Module.docs[c].extension=f;return}Module.MakeDev(c);h={};h[g]=d;Module.docs[c]=h;if(e){if(b.pageSizes&&b.pageSizes.length)var t=b.pageSizes[0];else b.defaultPageSize&&(t=b.defaultPageSize);var v=Module.GetUStringFromJSString(c);REX(Module._TRN_PDFDocCreate(l));q=Module.getValue(l,"i8*");var u=Module.ImageCreateFromFile(q,v);Module.InsertImageIntoDoc(q,u,t)}else{var y=Module.allocate(Module.intArrayFromString(c),"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreateFromFilePath(y, l));q=Module.getValue(l,"i8*")}Module.docs[c].extension=f;Module.docs[c].ptr=q}else REX(Module._TRN_PDFDocCreate(l)),q=Module.getValue(l,"i8*"),Module.docs[c]={ptr:q},Module.docs[c].extension=f}finally{Module.stackRestore(k)}};a.ChangeDocBackend=function(a,c){var d=Module.docs[a];d?(d.bufPtr&&d.ownership&&(Module._free(d.bufPtr),n-=d.bufPtrSize),delete Module.docs[a]):Object(b.c)("Trying to delete document "+a+" that does not exist.");Module.docs[a]=c};a.DeleteDoc=function(a){var c=Module.docs[a]; c?(c.ptr&&(c.ptr in downloadDataMap&&(clearTimeout(downloadDataMap[c.ptr].timeout),downloadDataMap[c.ptr].destroyUserData(),delete downloadDataMap[c.ptr]),Module.PDFDocDestroy(c.ptr)),c.bufPtr&&c.ownership&&(Module._free(c.bufPtr),n-=c.bufPtrSize),delete Module.docs[a]):Object(b.c)("Trying to delete document "+a+" that does not exist.")};a.CreateDoc=function(b,c){if("id"===b.type)return Module.docPtrStringToIdMap[b.value];if(!c){do c=(++e).toString();while(c in Module.docs)}Module.hasBufOwnership= !0;a.CreateDocBackend(b,c);return c};a.CreateEmptyDoc=function(){var a=(++e).toString(),c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreate(c));c=Module.getValue(c,"i8*");Module.docs[a]={ptr:c};return a};a.PDFDocCreateFromLayoutEls=function(a){var c=new Uint8Array(a);a=Module._malloc(c.length);var b=Module.stackSave(),d=Module.allocate(4,"i8",Module.ALLOC_STACK);Module.HEAPU8.set(c,a);c=Module._TRN_PDFDocCreateFromLayoutEls(a,c.length,d);d=Module.getValue(d,"i8*");Module._free(a); Module.stackRestore(b);REX(c);return d};a.GetPageCount=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetPageCount(a,c));return Module.getValue(c,"i8*")};a.GetPage=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetPage(a,c,b));a=Module.getValue(b,"i8*");Module.PageIsValid(a)||THROW("Trying to access page that doesn't exist at index "+c);return a};a.PageGetPageWidth=function(a){var c=Module.allocate(8,"i8",Module.ALLOC_STACK); REX(Module._TRN_PageGetPageWidth(a,1,c));return Module.getValue(c,"double")};a.PageGetPageHeight=function(a){var c=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetPageHeight(a,1,c));return Module.getValue(c,"double")};a.PageGetDefaultMatrix=function(a,c){var b=Module.allocate(48,"i8",Module.ALLOC_STACK);c||(c=0);REX(Module._TRN_PageGetDefaultMatrix(a,!0,1,c,b));return b};a.GetMatrixAsArray=function(a){for(var c=[],b=0;6>b;++b)c[b]=Module.getValue(a+8*b,"double");return c};a.PageGetPageInfo= function(a){var c=Module.allocate(48,"i8",Module.ALLOC_STACK),b=Module.allocate(8,"i8",Module.ALLOC_STACK),d=Module.allocate(8,"i8",Module.ALLOC_STACK),f=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetPageInfo(a,!0,1,0,b,d,c,f));return{rotation:Module.getValue(f,"i8*"),width:Module.getValue(b,"double"),height:Module.getValue(d,"double"),matrix:Module.GetMatrixAsArray(c)}};a.GetUStringFromJSString=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK),d=2*(a.length+1),f= Module.allocate(d,"i8",c?Module.ALLOC_NORMAL:Module.ALLOC_STACK);Module.stringToUTF16(a,f,d);a=Module._TRN_UStringCreateFromString(f,b);c&&Module._free(f);REX(a);return Module.getValue(b,"i8*")};a.GetJSStringFromUString=function(a){var c=Module.allocate(4,"i16*",Module.ALLOC_STACK);REX(Module._TRN_UStringCStr(a,c));return Module.UTF16ToString(Module.getValue(c,"i16*"))};a.GetJSStringFromCString=function(a){return Module.UTF8ToString(a)};a.PDFNetSetResourceData=function(a){Module.res_ptr=Module._malloc(a.length); Module.HEAPU8.set(a,Module.res_ptr);REX(Module._TRN_PDFNetSetResourceData(Module.res_ptr,a.length));Module.res_ptr_size=a.length};a.PDFDocDestroy=function(a){REX(Module._TRN_PDFDocDestroy(a))};a.VectorGetSize=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_VectorGetSize(a,c));return Module.getValue(c,"i32")};a.VectorGetAt=function(a,c){var b=Module.allocate(1,"i8*",Module.ALLOC_STACK);REX(Module._TRN_VectorGetAt(a,c,b));return Module.getValue(b,"i8*")};a.VectorDestroy= function(a){REX(Module._TRN_VectorDestroy(a))};a.PDFRasterizerCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerCreate(0,a));return Module.getValue(a,"i8*")};a.ExtractSeparationData=function(a){var c=Module.getValue(a,"i8*"),b=Module.getValue(a+4,"i32"),d=Module.getValue(a+8,"i8*"),f=Module.HEAPU8[a+12],e=Module.HEAPU8[a+13],l=Module.HEAPU8[a+14];a=Module.HEAPU8[a+15];var k=new Uint8Array(b);k.set(Module.HEAPU8.subarray(c,c+b));c=Module.GetJSStringFromUString(d); return{color:[f,e,l,a],data:k.buffer,name:c}};a.PDFRasterizerRasterizeSeparations=function(a,c,b,d,e,l,k){var f=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerRasterizeSeparations(a,c,b,d,e,l,k,f));a=Module.getValue(f,"i8*");c=Module.VectorGetSize(a);b=Array(c);for(d=0;d