多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
(function(){var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(d){var g=0;return function(){return g<d.length?{done:!1,value:d[g++]}:{done:!0}}};$jscomp.arrayIterator=function(d){return{next:$jscomp.arrayIteratorImpl(d)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,g,n){d!=Array.prototype&&d!=Object.prototype&&(d[g]=n.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.Symbol=function(){var d=0;return function(g){return $jscomp.SYMBOL_PREFIX+(g||"")+d++}}();$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.asyncIterator;d||(d=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};
$jscomp.makeIterator=function(d){var g="undefined"!=typeof Symbol&&Symbol.iterator&&d[Symbol.iterator];return g?g.call(d):$jscomp.arrayIterator(d)};$jscomp.arrayFromIterator=function(d){for(var g,n=[];!(g=d.next()).done;)n.push(g.value);return n};$jscomp.arrayFromIterable=function(d){return d instanceof Array?d:$jscomp.arrayFromIterator($jscomp.makeIterator(d))};
$jscomp.polyfill=function(d,g,n,q){if(g){n=$jscomp.global;d=d.split(".");for(q=0;q<d.length-1;q++){var b=d[q];b in n||(n[b]={});n=n[b]}d=d[d.length-1];q=n[d];g=g(q);g!=q&&null!=g&&$jscomp.defineProperty(n,d,{configurable:!0,writable:!0,value:g})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(d){function g(){this.batch_=null}function n(a){return a instanceof b?a:new b(function(b,e){b(a)})}if(d&&!$jscomp.FORCE_POLYFILL_PROMISE)return d;g.prototype.asyncExecute=function(a){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(a);return this};g.prototype.asyncExecuteBatch_=function(){var a=this;this.asyncExecuteFunction(function(){a.executeBatch_()})};var q=$jscomp.global.setTimeout;g.prototype.asyncExecuteFunction=function(a){q(a,
0)};g.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var e=a[b];a[b]=null;try{e()}catch(h){this.asyncThrow_(h)}}}this.batch_=null};g.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var b=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(e){b.reject(e)}};b.prototype.createResolveAndReject_=
function(){function a(a){return function(h){e||(e=!0,a.call(b,h))}}var b=this,e=!1;return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};b.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof b)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var m=null!=a;break a;case "function":m=!0;break a;default:m=!1}m?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};b.prototype.resolveToNonPromiseObj_=function(a){var b=
void 0;try{b=a.then}catch(e){this.reject_(e);return}"function"==typeof b?this.settleSameAsThenable_(b,a):this.fulfill_(a)};b.prototype.reject_=function(a){this.settle_(2,a)};b.prototype.fulfill_=function(a){this.settle_(1,a)};b.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};b.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=
0;a<this.onSettledCallbacks_.length;++a)u.asyncExecute(this.onSettledCallbacks_[a]);this.onSettledCallbacks_=null}};var u=new g;b.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};b.prototype.settleSameAsThenable_=function(a,b){var e=this.createResolveAndReject_();try{a.call(b,e.resolve,e.reject)}catch(h){e.reject(h)}};b.prototype.then=function(a,m){function e(a,e){return"function"==typeof a?function(e){try{h(a(e))}catch(v){r(v)}}:
e}var h,r,x=new b(function(a,e){h=a;r=e});this.callWhenSettled_(e(a,h),e(m,r));return x};b.prototype.catch=function(a){return this.then(void 0,a)};b.prototype.callWhenSettled_=function(a,b){function e(){switch(h.state_){case 1:a(h.result_);break;case 2:b(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?u.asyncExecute(e):this.onSettledCallbacks_.push(e)};b.resolve=n;b.reject=function(a){return new b(function(b,e){e(a)})};b.race=function(a){return new b(function(b,
e){for(var h=$jscomp.makeIterator(a),r=h.next();!r.done;r=h.next())n(r.value).callWhenSettled_(b,e)})};b.all=function(a){var m=$jscomp.makeIterator(a),e=m.next();return e.done?n([]):new b(function(a,b){function h(e){return function(b){k[e]=b;r--;0==r&&a(k)}}var k=[],r=0;do k.push(void 0),r++,n(e.value).callWhenSettled_(h(k.length-1),b),e=m.next();while(!e.done)})};return b},"es6","es3");
$jscomp.checkStringArgs=function(d,g,n){if(null==d)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(g instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return d+""};
$jscomp.polyfill("String.prototype.endsWith",function(d){return d?d:function(d,n){var q=$jscomp.checkStringArgs(this,d,"endsWith");d+="";void 0===n&&(n=q.length);n=Math.max(0,Math.min(n|0,q.length));for(var b=d.length;0<b&&0<n;)if(q[--n]!=d[--b])return!1;return 0>=b}},"es6","es3");$jscomp.findInternal=function(d,g,n){d instanceof String&&(d=String(d));for(var q=d.length,b=0;b<q;b++){var u=d[b];if(g.call(n,u,b,d))return{i:b,v:u}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,n){return $jscomp.findInternal(this,d,n).v}},"es6","es3");$jscomp.iteratorFromArray=function(d,g){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var n=0,q={next:function(){if(n<d.length){var b=n++;return{value:g(b,d[b]),done:!1}}q.next=function(){return{done:!0,value:void 0}};return q.next()}};q[Symbol.iterator]=function(){return q};return q};
$jscomp.polyfill("Array.prototype.keys",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6","es3");
(function(d){function g(q){if(n[q])return n[q].exports;var b=n[q]={i:q,l:!1,exports:{}};d[q].call(b.exports,b,b.exports,g);b.l=!0;return b.exports}var n={};g.m=d;g.c=n;g.d=function(d,b,u){g.o(d,b)||Object.defineProperty(d,b,{enumerable:!0,get:u})};g.r=function(d){$jscomp.initSymbol();$jscomp.initSymbol();"undefined"!==typeof Symbol&&Symbol.toStringTag&&($jscomp.initSymbol(),Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}));Object.defineProperty(d,"__esModule",{value:!0})};g.t=function(d,
b){b&1&&(d=g(d));if(b&8||b&4&&"object"===typeof d&&d&&d.__esModule)return d;var u=Object.create(null);g.r(u);Object.defineProperty(u,"default",{enumerable:!0,value:d});if(b&2&&"string"!=typeof d)for(var a in d)g.d(u,a,function(a){return d[a]}.bind(null,a));return u};g.n=function(d){var b=d&&d.__esModule?function(){return d["default"]}:function(){return d};g.d(b,"a",b);return b};g.o=function(d,b){return Object.prototype.hasOwnProperty.call(d,b)};g.p="/core/pdf/";return g(g.s=13)})([function(d,g,n){n.d(g,
"b",function(){return a});n.d(g,"c",function(){return u});n.d(g,"a",function(){return m});d="undefined"===typeof window?self:window;var q=d._trnDebugMode||d._trnLogMode,b=d._logFiltersEnabled?d._logFiltersEnabled:{},u=function(a,h){h||(h=a,a="default");q&&b[a]&&console.warn(a+": "+h)},a=function(a,h){h||(h=a,a="default");q&&b[a]&&console.log(a+": "+h)},m=function(a){q&&console.error(a);throw Error(a);}},function(d,g,n){n.d(g,"a",function(){return v});n.d(g,"b",function(){return f});var q=n(0),b=n(11),
u="undefined"===typeof window?self:window,a=u.importScripts,m=function(c){if("string"===typeof c){for(var f=new Uint8Array(c.length),a=c.length,w=0;w<a;w++)f[w]=c.charCodeAt(w);return f}return c},e=function(c){if("string"!==typeof c){for(var f="",a=0,w=c.length,e;a<w;)e=c.subarray(a,a+1024),a+=1024,f+=String.fromCharCode.apply(null,e);return f}return c},h=!1,r=function(c,f){h||(a(u.basePath+"decode.min.js"),h=!0);c=self.BrotliDecode(m(c));return f?c:e(c)},x=!1,k=function(c,f){x||(a(u.basePath+"rawinflate.js",
u.basePath+"pako_inflate.min.js"),x=!0);var p=10;if("string"===typeof c){if(c.charCodeAt(3)&8){for(;0!==c.charCodeAt(p);++p);++p}}else if(c[3]&8){for(;0!==c[p];++p);++p}if(f)return c=m(c),c=c.subarray(p,c.length-8),u.pako.inflate(c,{windowBits:-15});c=e(c);c=c.substring(p,c.length-8);return b.a.inflate(c)},y=function(c,f){return f?c:e(c)},l=function(c){var f=!c.shouldOutputArray,a=new XMLHttpRequest;a.open("GET",c.url,c.isAsync);var w=f&&a.overrideMimeType;a.responseType=w?"text":"arraybuffer";w&&
a.overrideMimeType("text/plain; charset=x-user-defined");a.send();var b=function(){var p=Date.now();var b=w?a.responseText:new Uint8Array(a.response);Object(q.b)("worker","Result length is "+b.length);b.length<c.compressedMaximum?(b=c.decompressFunction(b,c.shouldOutputArray),Object(q.b)("worker","Decompressed length is "+b.length),console.warn("There may be some degradation of performance. Your server has not been configured to serve .gz. and .br. files with the expected Content-Encoding. See http://www.pdftron.com/kb_content_encoding for instructions on how to resolve this.")):
f&&(b=e(b));Object(q.b)("worker",c.url+" Decompression took "+(Date.now()-p));return b};if(c.isAsync)var h=new Promise(function(f,p){a.onload=function(){200===this.status?f(b()):p("Download Failed "+c.url)};a.onerror=function(){p("Network error occurred "+c.url)}});else{if(200===a.status)return b();throw Error("Failed to load "+c.url);}return h},v=function(c){var f=c.lastIndexOf("/");-1===f&&(f=0);var a=c.slice(f).replace(".",".br.");return c.slice(0,f)+a},A=function(c,f){var p=c.lastIndexOf("/");
-1===p&&(p=0);var a=c.slice(p).replace(".",".gz.");f.url=c.slice(0,p)+a;f.decompressFunction=k;return l(f)},C=function(c,f){f.url=v(c);f.decompressFunction=r;return l(f)},t=function(c,f){c.endsWith(".js.mem")?c=c.slice(0,-4):c.endsWith(".mem")&&(c=c.slice(0,-4)+".js.mem");f.url=c;f.decompressFunction=y;return l(f)},H=function(c,f,a,w){return c.catch(function(c){console.warn(c);return w(f,a)})},f=function(c,f,a,w){var p={};p.compressedMaximum=f;p.isAsync=a;p.shouldOutputArray=w;a:if(f=[C,A,t],p.isAsync){var e=
f[0](c,p);for(a=1;a<f.length;++a)e=H(e,c,p,f[a])}else{for(a=0;a<f.length;++a)try{e=f[a](c,p);break a}catch(N){console.warn(N.message)}throw Error("");}return e}},function(d,g,n){n.d(g,"c",function(){return a});n.d(g,"b",function(){return m});n.d(g,"a",function(){return e});var q="undefined"===typeof window?self:window;d=function(){var a=navigator.userAgent.toLowerCase();return(a=/(msie) ([\w.]+)/.exec(a)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(a))?parseInt(a[2],10):a}();(function(){var a=q.navigator.userAgent.match(/Chrome\/(.*?) /);
return a?parseInt(a[1],10):a})();(function(){var a=q.navigator.userAgent.match(/OPR/),e=q.navigator.userAgent.match(/Maxthon/),b=q.navigator.userAgent.match(/Edge/);return q.navigator.userAgent.match(/Chrome\/(.*?) /)&&!a&&!e&&!b})();navigator.userAgent.match(/Edge/i);g=/iPad|iPhone|iPod/.test(q.navigator.platform)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;var b=/^((?!chrome|android).)*safari/i.test(q.navigator.userAgent)||/^((?!chrome|android).)*$/.test(q.navigator.userAgent)&&
g;q.navigator.userAgent.match(/Firefox/);d||/Android|webOS|Touch|IEMobile|Silk/i.test(navigator.userAgent);navigator.userAgent.match(/(iPad|iPhone|iPod)/i);q.navigator.userAgent.indexOf("Android");var u=/Mac OS X 10_13_6.*\(KHTML, like Gecko\)$/.test(q.navigator.userAgent),a=function(){return b||u},m=!(!self.WebAssembly||!self.WebAssembly.validate),e=-1<q.navigator.userAgent.indexOf("Edge/16")||-1<q.navigator.userAgent.indexOf("MSAppHost")},function(d,g,n){d.exports=function(){return function m(b,
d,a){function e(r,k){if(!d[r]){if(!b[r]){if(h)return h(r,!0);k=Error("Cannot find module '"+r+"'");throw k.code="MODULE_NOT_FOUND",k;}k=d[r]={exports:{}};b[r][0].call(k.exports,function(a){return e(b[r][1][a]||a)},k,k.exports,m,b,d,a)}return d[r].exports}for(var h=!1,r=0;r<a.length;r++)e(a[r]);return e}({1:[function(b,d,a){var m={}.hasOwnProperty,e=function(a,e){function b(){this.constructor=a}for(var h in e)m.call(e,h)&&(a[h]=e[h]);b.prototype=e.prototype;a.prototype=new b;a.__super__=e.prototype;
return a};a=b("./PriorityQueue/AbstractPriorityQueue");b=b("./PriorityQueue/ArrayStrategy");a=function(a){function b(a){a||(a={});a.strategy||(a.strategy=BinaryHeapStrategy);a.comparator||(a.comparator=function(a,e){return(a||0)-(e||0)});b.__super__.constructor.call(this,a)}e(b,a);return b}(a);a.ArrayStrategy=b;d.exports=a},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3}],2:[function(b,d,a){d.exports=function(){function a(a){if(null==(null!=a?a.strategy:void 0))throw"Must pass options.strategy, a strategy";
if(null==(null!=a?a.comparator:void 0))throw"Must pass options.comparator, a comparator";this.priv=new a.strategy(a);this.length=0}a.prototype.queue=function(a){this.length++;this.priv.queue(a)};a.prototype.dequeue=function(a){if(!this.length)throw"Empty queue";this.length--;return this.priv.dequeue()};a.prototype.peek=function(a){if(!this.length)throw"Empty queue";return this.priv.peek()};a.prototype.remove=function(a){this.priv.remove(a)&&--this.length};a.prototype.find=function(a){return 0<=this.priv.find(a)};
a.prototype.removeAllMatching=function(a,b){a=this.priv.removeAllMatching(a,b);this.length-=a};return a}()},{}],3:[function(b,d,a){var m=function(a,b,r){var e;var h=0;for(e=a.length;h<e;){var d=h+e>>>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;b<a.length;b++)a[b]=256*Math.random()}});var m=function(){return a.b&&!a.a&&!Object(a.c)()},e=function(a){var b=this;this.promise=a.then(function(a){b.response=a;b.status=200})};e.prototype={addEventListener:function(a,b){this.promise.then(b)}};var h=function(a,h,d){if(m()&&!d)Module.instantiateWasm=function(b,e){return Object(u.a)(Object(q.a)(),a+"Wasm.wasm",b,h["Wasm.wasm"]).then(function(a){e(a)})},d=Object(b.b)(a+"Wasm.js.mem",h["Wasm.js.mem"],!1,!1);else{d=Object(b.b)((Module.asmjsPrefix?Module.asmjsPrefix:
"")+a+".js.mem",h[".js.mem"],!1);var k=Object(b.b)((Module.memoryInitializerPrefixURL?Module.memoryInitializerPrefixURL:"")+a+".mem",h[".mem"],!0,!0);Module.memoryInitializerRequest=new e(k)}d=new Blob([d],{type:"application/javascript"});importScripts(URL.createObjectURL(d))}},function(d,g){function n(){throw Error("setTimeout has not been defined");}function q(){throw Error("clearTimeout has not been defined");}function b(a){if(r===setTimeout)return setTimeout(a,0);if((r===n||!r)&&setTimeout)return r=
setTimeout,setTimeout(a,0);try{return r(a,0)}catch(C){try{return r.call(null,a,0)}catch(t){return r.call(this,a,0)}}}function u(a){if(x===clearTimeout)return clearTimeout(a);if((x===q||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(a);try{return x(a)}catch(C){try{return x.call(null,a)}catch(t){return x.call(this,a)}}}function a(){y&&l&&(y=!1,l.length?k=l.concat(k):v=-1,k.length&&m())}function m(){if(!y){var e=b(a);y=!0;for(var h=k.length;h;){l=k;for(k=[];++v<h;)l&&l[v].run();v=-1;h=k.length}l=
null;y=!1;u(e)}}function e(a,b){this.fun=a;this.array=b}function h(){}d=d.exports={};try{var r="function"===typeof setTimeout?setTimeout:n}catch(A){r=n}try{var x="function"===typeof clearTimeout?clearTimeout:q}catch(A){x=q}var k=[],y=!1,l,v=-1;d.nextTick=function(a){var h=Array(arguments.length-1);if(1<arguments.length)for(var l=1;l<arguments.length;l++)h[l-1]=arguments[l];k.push(new e(a,h));1!==k.length||y||b(m)};e.prototype.run=function(){this.fun.apply(null,this.array)};d.title="browser";d.browser=
!0;d.env={};d.argv=[];d.version="";d.versions={};d.on=h;d.addListener=h;d.once=h;d.off=h;d.removeListener=h;d.removeAllListeners=h;d.emit=h;d.prependListener=h;d.prependOnceListener=h;d.listeners=function(a){return[]};d.binding=function(a){throw Error("process.binding is not supported");};d.cwd=function(){return"/"};d.chdir=function(a){throw Error("process.chdir is not supported");};d.umask=function(){return 0}},function(d,g,n){(function(d){function b(a){"function"!==typeof a&&(a=new Function(""+
a));for(var f=Array(arguments.length-1),c=0;c<f.length;c++)f[c]=arguments[c+1];l[y]={callback:a,args:f};C(y);return y++}function u(a){delete l[a]}function a(b){if(v)setTimeout(a,0,b);else{var f=l[b];if(f){v=!0;try{var c=f.callback,p=f.args;switch(p.length){case 0:c();break;case 1:c(p[0]);break;case 2:c(p[0],p[1]);break;case 3:c(p[0],p[1],p[2]);break;default:c.apply(null,$jscomp.arrayFromIterable(p))}}finally{u(b),v=!1}}}}function m(){C=function(b){d.nextTick(function(){a(b)})}}function e(){if(k.postMessage&&
!k.importScripts){var a=!0,f=k.onmessage;k.onmessage=function(){a=!1};k.postMessage("","*");k.onmessage=f;return a}}function h(){var b="setImmediate$"+Math.random()+"$",f=function(c){c.source===k&&"string"===typeof c.data&&0===c.data.indexOf(b)&&a(+c.data.slice(b.length))};k.addEventListener?k.addEventListener("message",f,!1):k.attachEvent("onmessage",f);C=function(c){k.postMessage(b+c,"*")}}function r(){var b=A.documentElement;C=function(f){var c=A.createElement("script");c.onreadystatechange=function(){a(f);
c.onreadystatechange=null;b.removeChild(c);c=null};b.appendChild(c)}}function x(){C=function(b){setTimeout(a,0,b)}}var k="undefined"===typeof window?self:window,y=1,l={},v=!1,A=k.document,C,t=Object.getPrototypeOf&&Object.getPrototypeOf(k);t=t&&t.setTimeout?t:k;"[object process]"==={}.toString.call(k.process)?m():e()?h():A&&"onreadystatechange"in A.createElement("script")?r():x();t.setImmediate=b;t.clearImmediate=u;g.a={setImmediate:b,clearImmediate:u}}).call(this,n(7))},function(d,g,n){var q=n(0);
d=function(b,d){this.name=b;this.comObj=d;this.callbackIndex=1;this.postMessageTransfers=!0;this.callbacksCapabilities={};b=this.actionHandler={};this.actionHandlerAsync={};this.nextAsync=null;b.console_log=[function(a){Object(q.b)(a)}];b.console_error=[function(a){Object(q.a)(a)}];b.workerLoaded=[function(a){}];d.addEventListener("message",this.handleMessage.bind(this))};d.prototype={on:function(b,d,a){var m=this.actionHandler;m[b]&&Object(q.a)('There is already an actionName called "'+b+'"');m[b]=
[d,a]},replace:function(b,d,a){this.actionHandler[b]=[d,a]},onAsync:function(b,d,a){var m=this.actionHandlerAsync;m[b]&&Object(q.a)('There is already an actionName called "'+b+'"');m[b]=[d,a]},replaceAsync:function(b,d,a){var m=this.actionHandlerAsync,e=this.actionHandler;e[b]&&delete e[b];m[b]=[d,a]},onNextAsync:function(b){this.nextAsync=b},send:function(b,d){this.postMessage({action:b,data:d})},getNextId:function(){return this.callbackIndex++},sendWithPromise:function(b,d,a){var m=this.getNextId();
b={action:b,data:d,callbackId:m,priority:a};d=createPromiseCapability();this.callbacksCapabilities[m]=d;try{this.postMessage(b)}catch(e){d.reject(e)}return d.promise},sendWithPromiseReturnId:function(b,d,a){var m=this.getNextId();b={action:b,data:d,callbackId:m,priority:a};d=createPromiseCapability();this.callbacksCapabilities[m]=d;try{this.postMessage(b)}catch(e){d.reject(e)}return{promise:d.promise,callbackId:m}},sendWithPromiseWithId:function(b,d,a,m){d>this.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;c<l.length;c++)l[c]=0;for(c=0;c<B.length;c++)B[c]=0;for(c=0;c<C.length;c++)C[c]=null;for(c=0;c<m.length;c++)m[c]=0;for(c=0;c<v.length;c++)v[c]=0;var n=256<b?a[256]:this.BMAX;var g=a;var u=0;c=b;do l[g[u]]++,
u++;while(0<--c);if(l[0]==b)this.root=null,this.status=this.m=0;else{for(p=1;p<=this.BMAX&&0==l[p];p++);var D=p;t<p&&(t=p);for(c=this.BMAX;0!=c&&0==l[c];c--);var L=c;t>c&&(t=c);for(y=1<<p;p<c;p++,y<<=1)if(0>(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(++c<b);b=v[L];v[0]=c=0;g=m;u=0;m=-1;var G=B[0]=0;w=null;for(x=0;D<=L;D++)for(a=l[D];0<a--;){for(;D>G+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;++p<x&&!((f<<=1)<=l[++w]);)f-=l[w];G+p>n&&G<n&&(p=n-G);x=1<<p;B[1+m]=p;w=Array(x);for(f=0;f<x;f++)w[f]=new r;q=null==q?this.root=new h:q.next=new h;q.next=null;q.list=w;C[m]=w;0<m&&(v[m]=c,A.b=B[m],A.e=16+p,A.t=w,p=(c&(1<<G)-1)>>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]<d?(A.e=256>g[u]?16:15,A.n=g[u++]):(A.e=k[g[u]-d],A.n=e[g[u++]-d]);f=1<<D-G;for(p=c>>G;p<x;p+=f)w[p].e=A.e,
w[p].b=A.b,w[p].n=A.n,w[p].t=A.t;for(p=1<<D-1;0!=(c&p);p>>=1)c^=p;for(c^=p;(c&(1<<G)-1)!=v[m];)G-=B[m],m--}this.m=B[1];this.status=0!=y&&1!=L?1:0}}},k={Stream:function(a){this.zip_inflate_start();this.zip_inflate_data=a;this.zip_inflate_pos=0}};k.Stream.prototype={getBytes:function(a){for(var b,d=Array(1024),e=[],h=0;h<a&&0<(b=this.zip_inflate_internal(d,0,d.length));)e[e.length]=String.fromCharCode.apply(null,d.slice(0,b)),h+=b;return h?(this.zip_inflate_data=this.zip_inflate_data.slice(this.zip_inflate_pos),
this.zip_inflate_pos=0,e.join("")):""},zip_GET_BYTE:function(){return this.zip_inflate_data.length==this.zip_inflate_pos?-1:this.zip_inflate_data.charCodeAt(this.zip_inflate_pos++)&255},zip_NEEDBITS:function(a){for(;this.zip_bit_len<a;)this.zip_bit_buf|=this.zip_GET_BYTE()<<this.zip_bit_len,this.zip_bit_len+=8},zip_GETBITS:function(a){return this.zip_bit_buf&q[a]},zip_DUMPBITS:function(a){this.zip_bit_buf>>=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;16<e;){if(99==e)return-1;this.zip_DUMPBITS(l.b);e-=16;this.zip_NEEDBITS(e);l=l.t[this.zip_GETBITS(e)];e=l.e}this.zip_DUMPBITS(l.b);if(16==e)this.zip_wp&=32767,a[b+h++]=this.zip_slide[this.zip_wp++]=l.n;else{if(15==e)break;this.zip_NEEDBITS(e);this.zip_copy_leng=l.n+this.zip_GETBITS(e);this.zip_DUMPBITS(e);this.zip_NEEDBITS(this.zip_bd);l=this.zip_td.list[this.zip_GETBITS(this.zip_bd)];for(e=l.e;16<e;){if(99==e)return-1;this.zip_DUMPBITS(l.b);
e-=16;this.zip_NEEDBITS(e);l=l.t[this.zip_GETBITS(e)];e=l.e}this.zip_DUMPBITS(l.b);this.zip_NEEDBITS(e);this.zip_copy_dist=this.zip_wp-l.n-this.zip_GETBITS(e);for(this.zip_DUMPBITS(e);0<this.zip_copy_leng&&h<d;)this.zip_copy_leng--,this.zip_copy_dist&=32767,this.zip_wp&=32767,a[b+h++]=this.zip_slide[this.zip_wp++]=this.zip_slide[this.zip_copy_dist++]}if(h==d)return d}this.zip_method=-1;return h},zip_inflate_stored:function(a,b,e){var d=this.zip_bit_len&7;this.zip_DUMPBITS(d);this.zip_NEEDBITS(16);
d=this.zip_GETBITS(16);this.zip_DUMPBITS(16);this.zip_NEEDBITS(16);if(d!=(~this.zip_bit_buf&65535))return-1;this.zip_DUMPBITS(16);this.zip_copy_leng=d;for(d=0;0<this.zip_copy_leng&&d<e;)this.zip_copy_leng--,this.zip_wp&=32767,this.zip_NEEDBITS(8),a[b+d++]=this.zip_slide[this.zip_wp++]=this.zip_GETBITS(8),this.zip_DUMPBITS(8);0==this.zip_copy_leng&&(this.zip_method=-1);return d},zip_inflate_fixed:function(e,d,h){if(null==this.zip_fixed_tl){var l,k=Array(288);for(l=0;144>l;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(1<l.status)return this.zip_fixed_tl=null,alert("HufBuild error: "+l.status),-1;this.zip_fixed_td=l.root;this.zip_fixed_bd=l.m}this.zip_tl=this.zip_fixed_tl;this.zip_td=this.zip_fixed_td;this.zip_bl=this.zip_fixed_bl;
this.zip_bd=this.zip_fixed_bd;return this.zip_inflate_codes(e,d,h)},zip_inflate_dynamic:function(d,l,h){var k,r,t,v=Array(316);for(k=0;k<v.length;k++)v[k]=0;this.zip_NEEDBITS(5);var f=257+this.zip_GETBITS(5);this.zip_DUMPBITS(5);this.zip_NEEDBITS(5);var c=1+this.zip_GETBITS(5);this.zip_DUMPBITS(5);this.zip_NEEDBITS(4);k=4+this.zip_GETBITS(4);this.zip_DUMPBITS(4);if(286<f||30<c)return-1;for(r=0;r<k;r++)this.zip_NEEDBITS(3),v[e[r]]=this.zip_GETBITS(3),this.zip_DUMPBITS(3);for(;19>r;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;k<p;){this.zip_NEEDBITS(this.zip_bl);var B=this.zip_tl.list[this.zip_GETBITS(this.zip_bl)];r=B.b;this.zip_DUMPBITS(r);r=B.n;if(16>r)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(;0<r--;)v[k++]=t}else{17==r?(this.zip_NEEDBITS(3),r=3+this.zip_GETBITS(3),this.zip_DUMPBITS(3)):(this.zip_NEEDBITS(7),r=11+this.zip_GETBITS(7),
this.zip_DUMPBITS(7));if(k+r>p)return-1;for(;0<r--;)v[k++]=0;t=0}}this.zip_bl=9;r=new x(v,f,257,b,u,this.zip_bl);0==this.zip_bl&&(r.status=1);if(0!=r.status)return-1;this.zip_tl=r.root;this.zip_bl=r.m;for(k=0;k<c;k++)v[k]=v[k+f];this.zip_bd=6;r=new x(v,c,0,a,m,this.zip_bd);this.zip_td=r.root;this.zip_bd=r.m;return 0==this.zip_bd&&257<f||0!=r.status?-1:this.zip_inflate_codes(d,l,h)},zip_inflate_start:function(){null==this.zip_slide&&(this.zip_slide=Array(65536));this.zip_bit_len=this.zip_bit_buf=this.zip_wp=
0;this.zip_method=-1;this.zip_eof=!1;this.zip_copy_leng=this.zip_copy_dist=0;this.zip_fixed_tl=this.zip_tl=null},zip_inflate_internal:function(a,b,e){var d;for(d=0;d<e&&(!this.zip_eof||-1!=this.zip_method);){if(0<this.zip_copy_leng){if(0!=this.zip_method)for(;0<this.zip_copy_leng&&d<e;)this.zip_copy_leng--,this.zip_copy_dist&=32767,this.zip_wp&=32767,a[b+d++]=this.zip_slide[this.zip_wp++]=this.zip_slide[this.zip_copy_dist++];else{for(;0<this.zip_copy_leng&&d<e;)this.zip_copy_leng--,this.zip_wp&=32767,
this.zip_NEEDBITS(8),a[b+d++]=this.zip_slide[this.zip_wp++]=this.zip_GETBITS(8),this.zip_DUMPBITS(8);0==this.zip_copy_leng&&(this.zip_method=-1)}if(d==e)break}if(-1==this.zip_method){if(this.zip_eof)break;this.zip_NEEDBITS(1);0!=this.zip_GETBITS(1)&&(this.zip_eof=!0);this.zip_DUMPBITS(1);this.zip_NEEDBITS(2);this.zip_method=this.zip_GETBITS(2);this.zip_DUMPBITS(2);this.zip_tl=null;this.zip_copy_leng=0}switch(this.zip_method){case 0:var h=this.zip_inflate_stored(a,b+d,e-d);break;case 1:h=null!=this.zip_tl?
this.zip_inflate_codes(a,b+d,e-d):this.zip_inflate_fixed(a,b+d,e-d);break;case 2:h=null!=this.zip_tl?this.zip_inflate_codes(a,b+d,e-d):this.zip_inflate_dynamic(a,b+d,e-d);break;default:h=-1}if(-1==h)return this.zip_eof?0:-1;d+=h}return d}};k.inflate=function(a){return(new k.Stream(a)).getBytes(4E9)};g.a=k},function(d,g,n){function q(a){return new Promise(function(b,d){var k=indexedDB.open(e,a);k.onerror=d.bind(null,"Error opening wasm cache database");k.onsuccess=function(){b(k.result)};k.onupgradeneeded=
function(a){var b=k.result;b.objectStoreNames.contains(h)&&(console.log("Clearing out version "+a.oldVersion+" wasm cache"),b.deleteObjectStore(h));console.log("Creating version "+a.newVersion+" wasm cache");b.createObjectStore(h)}})}function b(a,b){return new Promise(function(d,e){var l=a.transaction([h]).objectStore(h).get(b);l.onsuccess=function(a){l.result?d(l.result):e("Module "+b+" was not found in wasm cache")};l.onerror=e.bind(null,"Error getting wasm module "+b)})}function u(d,e,k,n){function l(a,
b){a=a.transaction([h],"readwrite").objectStore(h).put(b,e);a.onerror=function(f){console.log("Failed to store in wasm cache: "+f)};a.onsuccess=function(f){console.log("Successfully stored "+e+" in wasm cache")}}function r(b){x=x||Date.now();return b?(Object(a.b)("load","Try instantiateStreaming"),fetch(Object(m.a)(e)).then(function(a){return WebAssembly.instantiateStreaming(a,k)}).catch(function(b){Object(a.b)("load","instantiateStreaming Failed "+e+" message "+b.message);return r(!1)})):Object(m.b)(e,
n,!0,!0).then(function(b){g=Date.now();Object(a.b)("load","Request took "+(g-x)+" ms");return WebAssembly.instantiate(b,k)})}var g,x;return q(d).then(function(d){return b(d,e).then(function(b){Object(a.b)("Found "+e+" in wasm cache");return WebAssembly.instantiate(b,k)},function(b){Object(a.b)(b);return r(!!WebAssembly.instantiateStreaming).then(function(f){try{Object(a.b)("load","WASM compilation took "+(Date.now()-(g||x))+" ms"),l(d,f.module)}catch(c){}return f.instance})})},function(a){console.log(a);
return r().then(function(a){return a.instance})})}n.d(g,"a",function(){return u});var a=n(0),m=n(1),e="wasm-cache",h="wasm-cache"},function(d,g,n){d.exports=n(14)},function(d,g,n){n.r(g);n(2);n(15);n(16);n(19);n(20);n(21);n(22);n(23)},function(d,g,n){(function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(d,b){void 0===d&&(d=0);void 0===b&&(b=this.byteLength);d=Math.floor(d);b=Math.floor(b);0>d&&(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;c<I.length;c++)I[c][0](I[c][1]);I=[];N=!1}function m(c,f){I.push([c,f]);N||(N=!0,z(a,0))}function e(c,f){function a(c){g(f,c)}function p(c){y(f,c)}try{c(a,p)}catch(E){p(E)}}function h(c){var f=c.owner,a=f.state_;f=f.data_;var b=c[a];c=c.then;if("function"===
typeof b){a=p;try{f=b(f)}catch(E){y(c,E)}}r(c,f)||(a===p&&g(c,f),a===B&&y(c,f))}function r(c,f){var a;try{if(c===f)throw new TypeError("A promises callback cannot return that same promise.");if(f&&("function"===typeof f||"object"===typeof f)){var p=f.then;if("function"===typeof p)return p.call(f,function(p){a||(a=!0,f!==p?g(c,p):k(c,p))},function(f){a||(a=!0,y(c,f))}),!0}}catch(E){return a||y(c,E),!0}return!1}function g(c,f){c!==f&&r(c,f)||k(c,f)}function k(a,p){a.state_===f&&(a.state_=c,a.data_=
p,m(v,a))}function y(a,p){a.state_===f&&(a.state_=c,a.data_=p,m(A,a))}function l(c){var f=c.then_;c.then_=void 0;for(c=0;c<f.length;c++)h(f[c])}function v(c){c.state_=p;l(c)}function A(c){c.state_=B;l(c)}function q(c){if("function"!==typeof c)throw new TypeError("Promise constructor takes a function argument");if(!1===this instanceof q)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];e(c,this)}
b.createPromiseCapability=function(){var c={},f=new q(function(f,a){c.resolve=f;c.reject=a});c.promise=f;return c};var t=b.Promise,u=t&&"resolve"in t&&"reject"in t&&"all"in t&&"race"in t&&function(){var c;new t(function(f){c=f});return"function"===typeof c}();"undefined"!==typeof exports&&exports?(exports.Promise=u?t:q,exports.Polyfill=q):"function"===typeof define&&n(18)?define(function(){return u?t:q}):u||(b.Promise=q);var f="pending",c="sealed",p="fulfilled",B="rejected",w=function(){},z="undefined"!==
typeof d?d:setTimeout,I=[],N;q.prototype={constructor:q,state_:f,then_:null,data_:void 0,then:function(c,f){c={owner:this,then:new this.constructor(w),fulfilled:c,rejected:f};this.state_===p||this.state_===B?m(h,c):this.then_.push(c);return c.then},"catch":function(c){return this.then(null,c)}};q.all=function(c){if("[object Array]"!==Object.prototype.toString.call(c))throw new TypeError("You must pass an array to Promise.all().");return new this(function(f,a){function p(c){d++;return function(a){b[c]=
a;--d||f(b)}}for(var b=[],d=0,e=0,w;e<c.length;e++)(w=c[e])&&"function"===typeof w.then?w.then(p(e),a):b[e]=w;d||f(b)})};q.race=function(c){if("[object Array]"!==Object.prototype.toString.call(c))throw new TypeError("You must pass an array to Promise.race().");return new this(function(f,a){for(var p=0,b;p<c.length;p++)(b=c[p])&&"function"===typeof b.then?b.then(f,a):f(b)})};q.resolve=function(c){return c&&"object"===typeof c&&c.constructor===this?c:new this(function(f){f(c)})};q.reject=function(c){return new this(function(f,
a){a(c)})}})("undefined"!==typeof window?window:"undefined"!==typeof b?b:"undefined"!==typeof self?self:void 0)}).call(this,n(4).setImmediate,n(5))},function(d,g,n){(function(d,b){(function(d,a){function m(c){delete q[c]}function e(c){if(u)setTimeout(e,0,c);else{var f=q[c];if(f){u=!0;try{var b=f.callback,d=f.args;switch(d.length){case 0:b();break;case 1:b(d[0]);break;case 2:b(d[0],d[1]);break;case 3:b(d[0],d[1],d[2]);break;default:b.apply(a,d)}}finally{m(c),u=!1}}}}function h(){H=function(c){b.nextTick(function(){e(c)})}}
function r(){if(d.postMessage&&!d.importScripts){var c=!0,f=d.onmessage;d.onmessage=function(){c=!1};d.postMessage("","*");d.onmessage=f;return c}}function g(){var c="setImmediate$"+Math.random()+"$",f=function(f){f.source===d&&"string"===typeof f.data&&0===f.data.indexOf(c)&&e(+f.data.slice(c.length))};d.addEventListener?d.addEventListener("message",f,!1):d.attachEvent("onmessage",f);H=function(f){d.postMessage(c+f,"*")}}function k(){var c=new MessageChannel;c.port1.onmessage=function(c){e(c.data)};
H=function(f){c.port2.postMessage(f)}}function n(){var c=t.documentElement;H=function(f){var a=t.createElement("script");a.onreadystatechange=function(){e(f);a.onreadystatechange=null;c.removeChild(a);a=null};c.appendChild(a)}}function l(){H=function(c){setTimeout(e,0,c)}}if(!d.setImmediate){var v=1,q={},u=!1,t=d.document,H,f=Object.getPrototypeOf&&Object.getPrototypeOf(d);f=f&&f.setTimeout?f:d;"[object process]"==={}.toString.call(d.process)?h():r()?g():d.MessageChannel?k():t&&"onreadystatechange"in
t.createElement("script")?n():l();f.setImmediate=function(c){"function"!==typeof c&&(c=new Function(""+c));for(var f=Array(arguments.length-1),a=0;a<f.length;a++)f[a]=arguments[a+1];q[v]={callback:c,args:f};H(v);return v++};f.clearImmediate=m}})("undefined"===typeof self?"undefined"===typeof d?this:d:self)}).call(this,n(5),n(7))},function(d,g){d.exports={}},function(d,g,n){(function(d){var b=function(b,a){var d=function(b){b=this.catch(b);return{cancel:a,promise:b,then:e.bind(b),catch:d.bind(b)}},
e=function(b,r){b=this.then(b,r);return{cancel:a,promise:b,then:e.bind(b),catch:d.bind(b)}};return{cancel:a,promise:b,then:e.bind(b),catch:d.bind(b)}};d.CancellablePromise=function(d,a){var m=!1,e,h=new Promise(function(b,h){e=function(){m||(a(),h("cancelled"))};(new Promise(d)).then(function(a){m=!0;b(a)},function(a){m=!0;h(a)})});return b(h,e)};d.CancellablePromise.all=function(d){var a=Promise.all(d);return b(a,function(){d.forEach(function(a){a.cancel&&a.cancel()})})}})("undefined"===typeof self?
void 0:self)},function(d,g,n){(function(d,b){var g=n(0);(function(a){a.Module={TOTAL_MEMORY:50331648,noExitRuntime:!0,devicePixelRatio:1,cur_doc:null,cachePtrSize:0,hasBufOwnership:!0,loaded:!1,initCb:null,cachePtr:null,cleanupState:null,docs:{},postEvent:function(a,b,d){Module.workerMessageHandler.send("event",{docId:a,type:b,data:d})},postPagesUpdatedEvent:function(a,b,d){a={pageDimensions:Module.GetPageDimensions(a)};if(d)for(var e=0;e<d.length;++e)d[e]in a.pageDimensions?a.pageDimensions[d[e]].contentChanged=
!0:console.warn("Invalid Page Number "+d[e]);Module.postEvent(b,"pagesUpdated",a);return a},GetIndividualPageDimensions:function(a,b,d){a=Module.PageGetPageInfo(d);a.id=Module.PageGetId(d);return a},GetPageDimensionsRange:function(a,b,d){for(var e={},h=Module.PDFDocGetPageIterator(a,b);b<d&&Module.IteratorHasNext(h);++b){var k=Module.stackSave(),m=Module.IteratorCurrent(h);e[b]=this.GetIndividualPageDimensions(a,b,m);Module.IteratorNext(h);Module.stackRestore(k)}return e},GetPageDimensions:function(a){try{var b=
Module.stackSave(),d=Module.GetPageCount(a);if(0===d)throw"This document has no pages.";return Module.GetPageDimensionsRange(a,1,d+1)}finally{Module.stackRestore(b)}},loadDoc:function(a,b){"undefined"===typeof Module&&this._main();var d=null;try{var e=Module.stackSave();b=Module.CreateDoc(a,b);var m=Module.GetDoc(b);if(Module.PDFDocInitSecurityHandler(m))return{docId:b,pageDimensions:Module.GetPageDimensions(m)};d={type:"NeedsPassword",errorData:{docId:b},message:"This document requires a password"}}catch(k){d=
{type:"InvalidPDF",message:k}}finally{Module.stackRestore(e)}throw d;},loadCanvas:function(a,b,d,r,g,k,n,l){return new Promise(function(e,h){var m=Module.GetDoc(a),t=b+1,v=function(){e(Module.RasterizePage(m,t,d,r,k,g,n,l))},f=Module.docs[a].chunkStorage;if(f){var c=Module.GetDownloadData(m).downloader,p=f.getRequiredChunkOffsetArrays(c,t);f.keepChunks(p.have);c=function(){var c=f.getChunks(p.missing);Module.loadPromise=c.then(function(){var c=Module.loadPromise.cancelled;Module.loadPromise=null;
c||v()}).catch(function(c){"cancelled"!==c?h(c):Module.loadPromise=null})};Module.loadPromise?Module.loadPromise.then(c,c):c()}else v()})},loadResources:function(a,b){Module.Initialize(b);Object(g.b)("worker","PDFNet initialized!");Module._TRN_PDFNetSetDefaultDiskCachingEnabled(!1);a=new Uint8Array(a);Module.PDFNetSetResourceData(a)},onRuntimeInitialized:function(){"undefined"===typeof Module&&(("undefined"!==typeof window?window:self).Module={});(function(m){m.PDFDocExportXFDF=function(a,b){a=Module.GetDoc(a);
var d=Module.stackSave();try{var e=b?Module.PDFDocFDFExtract(a,b):Module.PDFDocFDFExtract(a);var h=Module.FDFDocSaveAsXFDF(e);Module.stackRestore(d)}catch(y){throw Module.stackRestore(d),y;}return h};m.PageArrayToPageSet=function(a){var b=Module.stackSave();try{var d=Module.PageSetCreate();for(var e=0;e<a.length;++e)Module.PageSetAddPage(d,a[e]);Module.stackRestore(b)}catch(k){throw Module.stackRestore(b),k;}return d};m.cancelCurrent=function(){var a=Module.loadPromise;return a?(a.cancel(),a.cancelled=
!0):(a=Module.cleanupState)?(d(a.timeout),a.cleanupArr.forEach(function(a){a()}),Module.cleanupState=null,!0):!1};m.SetWorkerRestartCallback=function(a){Module.workerRestartCallback=a};m.XFDFMerge=function(a,b){if(b){var d=[];try{Object(g.b)("worker","Merge XFDF of length "+b.length);var e=Module.GetUStringFromJSString(b,!0);d.push(function(){Module.UStringDestroy(e)});var h=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_FDFDocCreateFromXFDF(e,h));var m=Module.getValue(h,"i8*");d.push(function(){Module.FDFDocDestroy(m)});
REX(Module._TRN_PDFDocFDFUpdate(a,m))}finally{d.forEach(function(a){a()})}}};m.MergeXFDF=function(a,b){return new Promise(function(d,e){var h=[];try{var r=Module.stackSave();h[h.length]=function(){Module.stackRestore(r)};var l=Module.GetDoc(a);Module.XFDFMerge(l,b);h.forEach(function(a){a()});d({})}catch(v){h.forEach(function(a){a()}),e(v)}})};m.CreateBufferFile=function(a,b){Module.MakeDev(a);var d=new ArrayBuffer(b);d=new Uint8Array(d);for(var e=0;e<b;++e)d[e]=255;Module.docs[a]={buffer:d}};m.ReadBufferFile=
function(a,b){var d=Module.docs[a].buffer;b&&(b=new Uint8Array(d.buffer.slice(0)),Module.docs[a].buffer=b);return d};m.RemoveBufferFile=function(a){Module.docs[a]=null};m.SaveHelper=function(a,b,d){d="undefined"===typeof d?2:d;Module.MakeDev(b);a=Module._TRN_PDFDocSave(a,Module.GetUStringFromJSString(b),d,0);Module.docs[b].sink=null;REX(a);return Module.docs[b].buffer.buffer};m.SaveDoc=function(b,d,r,m,k,g){return new Promise(function(e,h){var l=Module.GetDoc(b),v=[];try{l=Module.GetDoc(b);var t=
Module.stackSave();v[v.length]=function(){Module.stackRestore(t)};Module.XFDFMerge(l,d);for(var n=Module.PDFDocGetPageIterator(l,1);Module.IteratorHasNext(n);){var f=Module.IteratorCurrent(n);try{for(var c=Module.PageGetNumAnnots(f);0<c;){var p=Module.PageGetAnnot(f,--c);Module.AnnotHasAppearance(p)||Module.AnnotRefreshAppearance(p)}}catch(D){Module.ObjErase(f,"Annots")}Module.IteratorNext(n)}if(g){c=function(c){c=new Uint8Array(c);a.FS.writeFile("watermarkFile",c);c=Module.ImageCreateFromFile(l,
Module.GetUStringFromJSString("watermarkFile"));a.FS.unlink("watermarkFile");return c};var B=Module.ElementBuilderCreate();v.push(function(){Module.ElementBuilderDestroy(B)});var w=Module.ElementWriterCreate();v.push(function(){Module.ElementWriterDestroy(w)});try{if(!g.hasOwnProperty("default"))throw Error("Watermark dictionary has no 'default' key!");var z=c(g["default"]);n=Module.PDFDocGetPageIterator(l,1);for(p=-1;Module.IteratorHasNext(n);){f=Module.IteratorCurrent(n);Module.IteratorNext(n);
p++;var q=p.toString();try{if(g.hasOwnProperty(q)){var y=g[q];if(y)var x=c(y);else continue}else x=z;var u=Module.PageGetPageInfo(f),K=Module.ElementBuilderCreateImage(B,x,0,0,u.width,u.height);Module.ElementWriterBegin(w,f);Module.ElementWriterWritePlacedElement(w,K);Module.ElementWriterEnd(w)}catch(D){console.warn("Watermark for page "+q+"can not be added due to error: "+D)}}}catch(D){console.warn("Watermarks can not be added due to error: "+D)}}n=0;if(m){var F=Module.PDFDocGetRoot(l);(n=Module.ObjFindObj(F,
"OpenAction"))&&Module.ObjPut(F,"__OpenActionBackup__",n);var E=Module.ObjPutDict(F,"OpenAction");Module.ObjPutName(E,"Type","Action");Module.ObjPutName(E,"S","JavaScript");Module.ObjPutString(E,"JS","this.print()")}var J=Module.SaveHelper(l,b,k);m&&(n?Module.ObjPut(F,"OpenAction",Module.ObjFindObj(F,"__OpenActionBackup__")):Module.ObjErase(F,"OpenAction"));v.forEach(function(c){c()});if(r)e({fileData:J});else{var M=J.slice(0);e({fileData:M})}}catch(D){v.forEach(function(c){c()}),h(D)}})};m.SaveDocFromFixedElements=
function(a,b,d){a=Module.PDFDocCreateFromLayoutEls(a);a=Module.CreateDoc({type:"ptr",value:a});return Module.SaveDoc(a,b,!0,!1,d)};m.GetCurrentCanvasData=function(a){var b=Module.currentRenderData;if(!b)return null;a&&REX(Module._TRN_PDFRasterizerUpdateBuffer(b.rast));var d=Date.now();a=Module.ReadBufferFile("b",a);Object(g.b)("bufferTiming","Copy took "+(Date.now()-d));return{pageBuf:a.buffer,pageWidth:b.out_width,pageHeight:b.out_height}};m.RasterizePage=function(a,d,r,m,k,n,l,v){return new Promise(function(e,
h){Module.currentRenderData={};var t=Module.currentRenderData;t.out_width=parseInt(r,10);t.out_height=parseInt(m,10);var q=[];q.push(function(){Module.currentRenderData=null});try{var f=Module.stackSave();q[q.length]=function(){Module.stackRestore(f)};var c=Module.GetPage(a,d),p=Module.PageGetPageWidth(c),B=Module.PageGetPageHeight(c);t.stride=4*t.out_width;t.buf_size=t.out_width*t.out_height*4;Object(g.b)("Memory","Created rasterizer");t.rast=Module.PDFRasterizerCreate();q.push(function(){Object(g.b)("Memory",
"Destroyed rasterizer");Module._TRN_PDFRasterizerDestroy(t.rast)});if(l){var w=Module.EMSCreateUpdatedLayersContext(a,l);0!==w&&(Module._TRN_PDFRasterizerSetOCGContext(t.rast,w),q.push(function(){Module._TRN_OCGContextDestroy(w)}))}var z=Module.PageGetRotation(c),A=1===n||3===n;z=(1===z||3===z)!==A;var y=Module.allocate(48,"i8",Module.ALLOC_STACK);if(k){k.x1=k[0];k.y1=k[1];k.x2=k[2];k.y2=k[3];var x=Module.PageGetDefaultMatrix(c,0),u=Module.Matrix2DInverse(x);k=Module.Matrix2DMultBBox(u,k);if(k.x2<
k.x1){var C=k.x1;k.x1=k.x2;k.x2=C}k.y2<k.y1&&(C=k.y1,k.y1=k.y2,k.y2=C);var F=t.out_width/(z?k.y2-k.y1:k.x2-k.x1);var E=Module.GetDefaultMatrixBox(c,k,n)}else E=Module.PageGetDefaultMatrix(c,n),F=t.out_width/(A?B:p);Module.Matrix2DSet(y,F,0,0,F,0,0);Module.Matrix2DConcat(y,E);Object(g.b)("Memory","Allocated buffer of "+t.buf_size);q.push(function(){Object(g.b)("Memory","Deallocated buffer of "+t.buf_size);Module._free(t.bufPtr)});var J=Module.allocate(4,"i8",Module.ALLOC_STACK),M=Module.allocate(4,
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerSetDrawAnnotations(t.rast,0));Module.CreateBufferFile("b",t.buf_size);q.push(function(){Module.RemoveBufferFile("b")});if(10===v){REX(Module._TRN_PDFRasterizerSetOverprint(t.rast,1));var D=Module.PDFRasterizerRasterizeSeparations(t.rast,c,t.out_width,t.out_height,y,0,0);e({pageBuf:D,pageWidth:t.out_width,pageHeight:t.out_height})}else{REX(Module._TRN_PDFRasterizerSetOverprint(t.rast,v));REX(Module._TRN_PDFRasterizerGetChunkRendererPath(t.rast,
c,Module.GetUStringFromJSString("b"),t.out_width,t.out_height,!0,y,0,0,0,J));var L=Module.getValue(J,"i8*");q.splice(1,0,function(){REX(Module._TRN_ChunkRendererDestroy(L))})}var G=(new Date).getTime(),P=function(){try{for(var c=0,a=(new Date).getTime(),f=!1;200>c;){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(0<q){k.pageNumber=q;var f=Module.GetDestinationVPosHPos(g);k.verticalOffset=f.vpos;k.horizontalOffset=f.hpos}}}}else if(5===m){var c=Module.ObjFindObj(n,"URI");c&&(k.url=Module.ObjGetAsPDFText(c))}}b[b.length]=k}catch(p){}Module.stackRestore(d)};m.LoadBookmarks=function(a){a=Module.GetDoc(a);var b=[],d=Module.stackSave();try{var e=Module.PDFDocGetFirstBookmark(a);
Module.BookmarkIsValid(e)&&Module.FillBookmarkTree(e,b)}catch(k){}Module.stackRestore(d);return{bookmarks:b}};m.UpdatePassword=function(a,b){try{var d=Module.stackSave(),e=Module.GetDoc(a);return Module.PDFDocInitStdSecurityHandler(e,b)?(e in downloadDataMap&&REX(Module._TRN_PDFDocDownloaderInitialize(e,downloadDataMap[e].downloader)),{success:!0,pageDimensions:Module.GetPageDimensions(e)}):{success:!1}}finally{Module.stackRestore(d)}};m.GetTextData=function(a,b){return new Promise(function(d,e){var k=
b+1,h=Module.GetDoc(a),l=[];try{var n=Module.stackSave();l[l.length]=function(){Module.stackRestore(n)};var m=Module.GetPage(h,k),g=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_TextExtractorCreate(g));var r=Module.getValue(g,"i8*");l[l.length]=function(){Module._TRN_TextExtractorDestroy(r)};REX(Module._TRN_TextExtractorBegin(r,m,0,1));var q=Module.allocate(48,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetDefaultMatrix(m,!0,1,0,q));var f=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_TextExtractorGetQuads(r,
q,0,f));var c=Module.getValue(f,"i8*"),p=Module._malloc(8*c);l[l.length]=function(){Module._free(p)};REX(Module._TRN_TextExtractorGetQuads(r,q,p,f));var B=Module.GetJSDoubleArrFromCore(p,c),w=Module.allocate(4,"i8",Module.ALLOC_STACK),z=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_UStringCreate(z));l[l.length]=function(){Module._TRN_UStringDestroy(I)};var I=Module.getValue(z,"i8*");REX(Module._TRN_TextExtractorGetAsTextWithOffsets(r,I,0,w));var u=Module.GetJSStringFromUString(I),x=Module.getValue(w,
"i8*"),O=Module._malloc(4*x);l[l.length]=function(){Module._free(O)};REX(Module._TRN_TextExtractorGetAsTextWithOffsets(r,I,O,w));var K=Module.GetJSIntArrayFromCore(O,x),F=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_TextExtractorCmptSemanticInfo(r,q,0,F));var E=Module.getValue(F,"i8*"),J=Module._malloc(8*E);l[l.length]=function(){Module._free(J)};REX(Module._TRN_TextExtractorCmptSemanticInfo(r,q,J,F));var M=Module.GetJSDoubleArrFromCore(J,E);l.forEach(function(c){c()});d({str:u,quads:B,
offsets:K,struct:M})}catch(D){l.forEach(function(c){c()}),e(D)}})};m.InsertBlankPages=function(a,b,d,n){return new Promise(function(e,h){var l=[],k=Module.GetDoc(a);try{var m=Module.stackSave();l[l.length]=function(){Module.stackRestore(m)};for(var g=b.length-1;0<=g;--g){var r=Module.PDFDocGetPageIterator(k,b[g]),q=Module.PDFDocPageCreate(k,d,n);Module.PDFDocPageInsert(k,r,q)}var f=Module.postPagesUpdatedEvent(k,a);l.forEach(function(c){c()});e(f)}catch(c){l.forEach(function(c){c()}),h(c)}})};m.InsertPages=
function(a,b,d,n,k){return new Promise(function(e,l){var h=[],m=Module.GetDoc(a);try{var g=Module.stackSave();h[h.length]=function(){Module.stackRestore(g)};if(b instanceof ArrayBuffer){var r=Module.CreateDoc(b);var q=Module.GetDoc(r);h[h.length]=function(){Module.DeleteDoc(r)}}else q=Module.GetDoc(b);for(var f=d.length,c=Module.PageSetCreate(),p=0;p<f;++p)Module.PageSetAddPage(c,d[p]);Module.PDFDocInsertPages(m,n,q,c,k);var B=Module.postPagesUpdatedEvent(m,a);h.forEach(function(c){c()});e(B)}catch(w){h.forEach(function(c){c()}),
l(w)}})};m.MovePages=function(a,b,d){return new Promise(function(e,k){var h=[],l=Module.GetDoc(a);try{var n=Module.stackSave();h[h.length]=function(){Module.stackRestore(n)};for(var m=b.length,g=Module.PageSetCreate(),r=0;r<m;++r)Module.PageSetAddPage(g,b[r]);Module.PDFDocMovePages(l,d,g);var q=Module.postPagesUpdatedEvent(l,a);h.forEach(function(a){a()});e(q)}catch(f){h.forEach(function(c){c()}),k(f)}})};m.RemovePages=function(a,b){return new Promise(function(d,e){var k=Module.GetDoc(a),h=[];try{var l=
Module.stackSave();h[h.length]=function(){Module.stackRestore(l)};for(var n=b.length-1;0<=n;--n){var m=Module.PDFDocGetPageIterator(k,b[n]);Module.IteratorHasNext(m)&&Module.PDFDocPageRemove(k,m)}var g=Module.postPagesUpdatedEvent(k,a);h.forEach(function(a){a()});d(g)}catch(t){h.forEach(function(a){a()}),e(t)}})};m.RotatePages=function(a,b,d){return new Promise(function(e,k){var h=Module.GetDoc(a),l=[];try{var n=Module.stackSave();l[l.length]=function(){Module.stackRestore(n)};var m=b.length,g=0,
r=Module.PDFDocGetPageIterator(h,b[0]),q=[];l.push(function(){Module._TRN_IteratorDestroy(r)});for(var f=b[0];Module.IteratorHasNext(r)&&g<b[m-1];++f){if(f===b[g]){var c=Module.IteratorCurrent(r),p=(Module.PageGetRotation(c)+d)%4;Module.PageSetRotation(c,p);q.push(f);g++}Module.IteratorNext(r)}var B=Module.postPagesUpdatedEvent(h,a,q);l.forEach(function(c){c()});e(B)}catch(w){l.forEach(function(c){c()}),k(w)}})};m.ExtractPages=function(a,b,d,n){return new Promise(function(e,h){var l=[];try{var k=
Module.GetDoc(a),g=Module.stackSave();l[l.length]=function(){Module.stackRestore(g)};var m=function(a){l.forEach(function(c){c()});h(a)};Module.XFDFMerge(k,d);var r=Module.CreateEmptyDoc();l[l.length]=function(){Module.DeleteDoc(r)};var q=Module.InsertPages(r,a,b,1,!0).then(function(){return Module.SaveDoc(r,void 0,!0,!1,void 0,n)}).then(function(a){l.forEach(function(c){c()});return a}).catch(m);e(q)}catch(f){m(f)}})};m.CropPages=function(a,b,d,n,k,m){return new Promise(function(e,h){var l=Module.GetDoc(a),
g=[];try{var r=Module.stackSave();g[g.length]=function(){Module.stackRestore(r)};var q=b.length,f=0,c=Module.PDFDocGetPageIterator(l,b[0]);g.push(function(){Module._TRN_IteratorDestroy(c)});for(var p=[],B=b[0];Module.IteratorHasNext(c)&&f<b[q-1];++B){if(B===b[f]){var w=Module.IteratorCurrent(c),z=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetCropBox(w,z));var v=Module.PageGetRotation(w),u=Module.getValue(z,"double"),y=Module.getValue(z+8,"double"),x=Module.getValue(z+16,"double"),
K=Module.getValue(z+24,"double");0===v%4?(Module.setValue(z,u+k,"double"),Module.setValue(z+8,y+n,"double"),Module.setValue(z+16,x-m,"double"),Module.setValue(z+24,K-d,"double")):1===v%4?(Module.setValue(z,u+d,"double"),Module.setValue(z+8,y+k,"double"),Module.setValue(z+16,x-n,"double"),Module.setValue(z+24,K-m,"double")):2===v%4?(Module.setValue(z,u+m,"double"),Module.setValue(z+8,y+d,"double"),Module.setValue(z+16,x-k,"double"),Module.setValue(z+24,K-n,"double")):3===v%4&&(Module.setValue(z,u+
n,"double"),Module.setValue(z+8,y+m,"double"),Module.setValue(z+16,x-d,"double"),Module.setValue(z+24,K-k,"double"));Module.setValue(z+32,0,"double");REX(Module._TRN_PageSetBox(w,0,z));REX(Module._TRN_PageSetBox(w,1,z));p.push(B);f++}Module.IteratorNext(c)}var F=Module.postPagesUpdatedEvent(l,a,p);g.forEach(function(c){c()});e(F)}catch(E){g.forEach(function(c){c()}),h(E)}})}})("undefined"===typeof self?this.Module:self.Module);this.loaded=!0;Module.initCb&&Module.initCb()}}})(self)}).call(this,n(4).clearImmediate,
n(4).setImmediate)},function(d,g,n){(function(d){var b=n(0),g="undefined"!==typeof window?window:self;g.global=g;(function(a){a.currentFileString="/current";var n=0,e=0,h={},r=null;Module.chunkMax=200;var q=function(a,c,b,d,w){var f=new XMLHttpRequest;return CancellablePromise(function(p,e){f.open("GET",a,!0);f.responseType="arraybuffer";f.onerror=function(){e("Network error occurred")};f.onload=function(){if(206===this.status&&f.response.byteLength===b){var c=new Int8Array(f.response);p(c)}else e("Download Failed")};
var l=["bytes=",c,"-",c+b-1].join("");f.setRequestHeader("Range",l);w&&(f.withCredentials=w);d&&Object.keys(d).forEach(function(c){f.setRequestHeader(c,d[c])});f.send()},function(){f.abort()})},k=function(a){this.file=a;this.position=0;this.length=a.size;this.reader=new FileReaderSync};k.prototype={read:function(a,c,b){b=this.position+b<=this.length?b:this.length-this.position;a=a.subarray(c,c+b);c=new Int8Array(this.reader.readAsArrayBuffer(this.file.slice(this.position,this.position+b)));a.set(c);
this.position+=b;return b},seek:function(a){this.position=a},close:function(){this.reader=this.file=null},getPos:function(){return this.position},getTotalSize:function(){return this.length}};var u=function(a){this.data=a;this.position=0;this.length=this.data.length};u.prototype={read:function(a,c,b){b=this.position+b<=this.length?b:this.length-this.position;a=a.subarray(c,c+b);c=this.data.subarray(this.position,this.position+b);a.set(c);this.position+=b;return b},write:function(a,c,b){b=this.position+
b<=this.length?b:this.length-this.position;a=a.subarray(c,c+b);this.data.subarray(this.position,this.position+b).set(a);this.position+=b;return b},seek:function(a){this.position=a},close:function(){this.data=null},getPos:function(){return this.position},getTotalSize:function(){return this.length}};var l=function(a,c,b,d,w){"object"===typeof a?(this.lruList=a.lruList,this.chunkMap=a.chunkMap,this.length=a.length,this.url=a.url,this.customHeaders=a.customHeaders,this.withCredentials=a.withCredentials):
(this.lruList=[],this.chunkMap={},this.chunkMap[c]=w,this.length=c,this.url=a,this.customHeaders=b,this.withCredentials=d)};l.prototype={lruUpdate:function(a){var c=this.lruList.lastIndexOf(a);0<=c&&this.lruList.splice(c,1);this.lruList.push(a)},getChunk:function(a){var c=this;if(this.chunkMap[a])this.lruUpdate(a);else{var f=Math.min(a+524288,this.length)-1,b=new XMLHttpRequest;b.open("GET",this.url,!1);b.responseType="arraybuffer";b.setRequestHeader("Range",["bytes=",a,"-",f].join(""));this.withCredentials&&
(b.withCredentials=this.withCredentials);this.customHeaders&&Object.keys(this.customHeaders).forEach(function(a){b.setRequestHeader(a,c.customHeaders[a])});b.send();if(200===b.status||206===b.status)this.writeChunk(new Int8Array(b.response),a);else throw Error("Failed to load data from");}return this.chunkMap[a]},hadChunk:function(a){return a in this.chunkMap},hasChunk:function(a){return this.chunkMap[a]},getCacheData:function(){return this.chunkMap[this.length]},getRequiredChunkOffsetArrays:function(a,
c){var f={have:[],downloading:[],missing:[]};try{var b=Module.stackSave();var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DownloaderGetRequiredChunksSize(a,c,d));var e=Module.getValue(d,"i8*");if(e){var l=Module._malloc(4*e);REX(Module._TRN_DownloaderGetRequiredChunks(a,c,l,e));for(a=0;a<e;++a){var k=Module.getValue(l+4*a,"i8*");this.hasChunk(k)?f.have.push(k):this.hadChunk(k)?f.missing.push(k):f.downloading.push(k)}}}finally{l&&Module._free(l),Module.stackRestore(b)}return f},keepVisibleChunks:function(a,
c){for(var f=c.length,b=Module.chunkMax/2,d=0,e=0;e<f;++e){var l=this.getRequiredChunkOffsetArrays(a,c[e]),k=l.have,h=k.length;d+=h;if(d>b){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<c;++b)f[b]=this.getChunkAsync(a[b]);return CancellablePromise.all(f)},
keepChunks:function(a){for(var c=a.length,f=0;f<c;++f)this.lruUpdate(a[f])},writeChunk:function(a,c,b){b=b||0;var f=this.chunkMap[c],d=a.length,p=this.lruList.length>=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.position<this.length){var p;for(p=0;p<d;){var e=this.position%524288;var l=this.position-e;var k=d-p;if(this.chunkStorage.hadChunk(l)){l=this.chunkStorage.getChunk(l);var h=a.subarray(c+p,c+p+k);e=l.subarray(e,e+k);h.set(e);e=e.length;p+=e;this.position+=e}else for(this.position+=k;p<d;++p)h[p]=0}}if(!f){h=
c+d;if(b-=d)c=this.chunkStorage.getCacheData(),b>c.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+c<f?b:f-c;a=a.subarray(c,c+b);c=this.data.subarray(this.position,this.position+b);a.set(c);this.position+=b;return b},write:function(a,c,b){for(var f=this.position+b,d=this.data.length;f>d;){d=Math.max(d*(16777216<d?1.5:2),f);var p=new Int8Array(d);p.set(this.data.subarray(0,this.length),0);this.data=p}a=a.subarray(c,
c+b);this.data.set(a,this.position);this.position+=b;this.position>this.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;c<e.length;++c)++e[c];Object.keys(this.requirePageCallbacks).forEach(function(a){b.requirePageCallbacks.hasOwnProperty(a)&&e.push(parseInt(a,10))});(c=Module.docs[a].chunkStorage)&&c.keepVisibleChunks(d.downloader,e);d=e.length;a=Module.allocate(4*d,"i8",Module.ALLOC_STACK);for(c=0;c<d;++c)Module.setValue(a+4*c,e[c],"i32");REX(Module._TRN_PDFDocDownloadPages(f,a,d,1,0))}};a.RequirePage=function(a,c){return new Promise(function(b,
f){f=Module.GetDoc(a);var d=downloadDataMap[f];d&&!d.m_pages[c]?(c in d.requirePageCallbacks?d.requirePageCallbacks[c].push(b):d.requirePageCallbacks[c]=[b],b=Module.allocate(4,"i8",Module.ALLOC_STACK),Module.setValue(b,c,"i32"),Module._TRN_PDFDocDownloadPages(f,b,1,0,0)):b()})};a.IsLinearizationValid=function(a){a=Module.GetDoc(a);if(a=downloadDataMap[a]){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DownloaderIsLinearizationValid(a.downloader,c));return 0!==Module.getValue(c,
"i8")}return!1};a.ShouldRunRender=function(a,c){a=Module.GetDoc(a);return(a=downloadDataMap[a])?a.m_pages[c]:!0};a.createCallbacksStruct=function(a){if(!r){var c=function(a){return function(c){var b=arguments;c in downloadDataMap?a.apply(this,b):d(function(){c in downloadDataMap&&a.apply(this,b)},0)}};r={downloadProc:Module.addFunction(function(a,c,b,f,d){f=Module.extractDownloadUserData(f);var p=f.docId;q(f.url,c,b,Module.customHeadersMap[p],Module.withCredentials[p]).then(function(f){p in Module.docs&&
Module.docs[p].chunkStorage&&Module.docs[p].chunkStorage.writeChunk(f,c);Module._TRN_DownloadComplete(0,c,b,a)})}),notifyUpdatePage:Module.addFunction(c(function(a,c,b,f){var d=downloadDataMap[a];d.m_pages[c]=!0;var p=d.eventPageArray;if(c in d.requirePageCallbacks)for(b=d.requirePageCallbacks[c],f=0;f<b.length;++f)b[f]();d.timeout?p.push(c):(p=d.eventPageArray=[c],d.timeout=setTimeout(function(){Module.postPagesUpdatedEvent(a,d.m_id,p);d.timeout=null},100))})),notifyUpdateOutline:Module.addFunction(c(function(a,
c){a=downloadDataMap[a];a.m_has_outline||(a.m_has_outline=!0,Module.postEvent(a.m_id,"bookmarksUpdated",{}))})),notifyUpdateNamedDests:Module.addFunction(c(function(a,c){a=downloadDataMap[a];a.m_has_named_dests||(a.m_has_named_dests=!0)})),notifyUpdateThumb:Module.addFunction(c(function(a,c){})),notifyFinishedDownload:Module.addFunction(c(function(a,c){a=downloadDataMap[a];a.m_finished_download||(a.m_finished_download=!0,Module.postEvent(a.m_id,"documentComplete",{}))})),notifyDocumentError:Module.addFunction(function(a,
c){}),getCurrentPage:Module.addFunction(function(a,c){return downloadDataMap[a].m_current_page})}}c=Module.allocate(40,"i8",Module.ALLOC_STACK);Module.setValue(c,r.downloadProc,"i8*");Module.setValue(c+4,a,"i8*");Module.setValue(c+8,r.notifyUpdatePage,"i8*");Module.setValue(c+12,r.notifyUpdateOutline,"i8*");Module.setValue(c+16,r.notifyUpdateNamedDests,"i8*");Module.setValue(c+20,r.notifyUpdateThumb,"i8*");Module.setValue(c+24,r.notifyFinishedDownload,"i8*");Module.setValue(c+28,r.notifyDocumentError,
"i8*");Module.setValue(c+32,r.getCurrentPage,"i8*");Module.setValue(c+36,0,"i8*");return c};a.CreateDocDownloaderBackend=function(a,c,b){var d=a.url,f=a.size,e=a.customHeaders,p=a.withCredentials;e&&(Module.customHeadersMap[b]=e);p&&(Module.withCredentials[b]=p);var k=a.downloadData?new H(a.downloadData,d,b,e,p):new H(a.size,d,b,e,p);var h=Module.createCallbacksStruct(k.downloadUserData),g=Module.allocate(4,"i8",Module.ALLOC_STACK);Module.MakeDev(b);a.chunkStorage?d=new l(a.chunkStorage):(a=new Int8Array(new ArrayBuffer(Math.ceil((a.size+
524288-1)/524288/8))),d=new l(d,f,e,p,a));Module.docs[b]={chunkStorage:d};REX(Module._TRN_DownloaderCreate(h,f,Module.GetUStringFromJSString(b),g));k.downloader=Module.getValue(g,"i8*");if(f=Module._TRN_PDFDocCreateFromFilter(k.downloader,c))Module._TRN_FilterDestroy(k.downloader),REX(f);c=Module.getValue(c,"i8*");Module.docs[b].ptr=c;Module.PDFDocInitSecurityHandler(c)&&REX(Module._TRN_PDFDocDownloaderInitialize(c,k.downloader));downloadDataMap[c]=k};a.CreateDocBackend=function(b,c){var d=b.value,
f=b.extension,e=b.type,l=Module.allocate(4,"i8",Module.ALLOC_STACK),k=Module.stackSave();try{if(d)if("ptr"===e)Module.docs[c]={ptr:d};else if(e=f&&"pdf"!==f,"object"===typeof d&&d.url)a.CreateDocDownloaderBackend(d,l,c);else{var h=d instanceof ArrayBuffer,g=h?"buffer":"file";if(h&&(d=new Uint8Array(d),10485760>d.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<c;++d)e=Module.VectorGetAt(a,d),b[d]=Module.ExtractSeparationData(e);Module.VectorDestroy(a);return b};a.PageGetRotation=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetRotation(a,
c));return Module.getValue(c,"i8*")};a.PageGetId=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetSDFObj(a,c));c=Module.getValue(c,"i8*");a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetObjNum(c,a));a=Module.getValue(a,"i32");var b=Module.allocate(2,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetGenNum(c,b));b=Module.getValue(b,"i16");return a+"-"+b};a.PageSetRotation=function(a,c){REX(Module._TRN_PageSetRotation(a,c))};a.GetDefaultMatrixBox=function(a,
c,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetRotation(a,d));a=(Module.getValue(d,"i32")+b)%4;b=Module.allocate(48,"i8",Module.ALLOC_STACK);switch(a){case 0:return REX(Module._TRN_Matrix2DSet(b,1,0,0,-1,-c.x1,c.y2)),b;case 1:return REX(Module._TRN_Matrix2DSet(b,0,1,1,0,-c.y1,-c.x1)),b;case 2:return REX(Module._TRN_Matrix2DSet(b,-1,0,0,1,c.x2,-c.y1)),b;case 3:return REX(Module._TRN_Matrix2DSet(b,0,-1,-1,0,c.y2,c.x2)),b}throw Error("Yikes, we don't support that rotation type");
};a.Matrix2DMultBBox=function(a,c){var b=Module.allocate(8,"i8",Module.ALLOC_STACK),d=Module.allocate(8,"i8",Module.ALLOC_STACK);Module.setValue(b,c.x1,"double");Module.setValue(d,c.y1,"double");REX(Module._TRN_Matrix2DMult(a,b,d));c.x1=Module.getValue(b,"double");c.y1=Module.getValue(d,"double");Module.setValue(b,c.x2,"double");Module.setValue(d,c.y2,"double");REX(Module._TRN_Matrix2DMult(a,b,d));c.x2=Module.getValue(b,"double");c.y2=Module.getValue(d,"double");return c};a.Matrix2DMult=function(a,
c){var b=Module.allocate(8,"i8",Module.ALLOC_STACK),d=Module.allocate(8,"i8",Module.ALLOC_STACK);Module.setValue(b,c.x,"double");Module.setValue(d,c.y,"double");REX(Module._TRN_Matrix2DMult(a,b,d));c.x=Module.getValue(b,"double");c.y=Module.getValue(d,"double");return c};a.Matrix2DConcat=function(a,c){var b=Module.getValue(c,"double"),d=Module.getValue(c+8,"double"),f=Module.getValue(c+16,"double"),e=Module.getValue(c+24,"double"),l=Module.getValue(c+32,"double");c=Module.getValue(c+40,"double");
REX(Module._TRN_Matrix2DConcat(a,b,d,f,e,l,c))};a.Matrix2DSet=function(a,c,b,d,e,l,k){REX(Module._TRN_Matrix2DSet(a,c,b,d,e,l,k))};a.IteratorHasNext=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_IteratorHasNext(a,c));return 0!==Module.getValue(c,"i8")};a.IteratorCurrent=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_IteratorCurrent(a,c));return Module.getValue(Module.getValue(c,"i8*"),"i8*")};a.IteratorNext=function(a){REX(Module._TRN_IteratorNext(a))};
a.PageGetNumAnnots=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetNumAnnots(a,c));return Module.getValue(c,"i32")};a.PageGetAnnot=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetAnnot(a,c,b));return Module.getValue(b,"i8*")};a.PageAnnotRemove=function(a,c){REX(Module._TRN_PageAnnotRemoveByIndex(a,c))};a.AnnotGetType=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetType(a,c));return Module.getValue(c,
"i32")};a.AnnotHasAppearance=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetAppearance(a,0,0,c));return 0!==Module.getValue(c,"i8*")};a.AnnotRefreshAppearance=function(a){REX(Module._TRN_AnnotRefreshAppearance(a))};a.ObjErase=function(a,c){c=Module.allocate(Module.intArrayFromString(c),"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjEraseFromKey(a,c))};a.GetJSDoubleArrFromCore=function(a,c){for(var b=Array(c),d=0;d<c;++d)b[d]=Module.getValue(a,"double"),a+=8;return b};
a.GetJSIntArrayFromCore=function(a,c){for(var b=Array(c),d=0;d<c;++d)b[d]=Module.getValue(a,"i32"),a+=4;return b};a.BookmarkIsValid=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkIsValid(a,c));return 0!==Module.getValue(c,"i8")};a.BookmarkGetNext=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetNext(a,c));return Module.getValue(c,"i8*")};a.BookmarkGetFirstChild=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);
REX(Module._TRN_BookmarkGetFirstChild(a,c));return Module.getValue(c,"i8*")};a.BookmarkHasChildren=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkHasChildren(a,c));return 0!==Module.getValue(c,"i8")};a.BookmarkGetAction=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetAction(a,c));return Module.getValue(c,"i8*")};a.BookmarkGetTitle=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetTitle(a,
c));a=Module.getValue(c,"i8*");return Module.GetJSStringFromUString(a)};a.ActionIsValid=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ActionIsValid(a,c));return 0!==Module.getValue(c,"i8")};a.ActionGetType=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ActionGetType(a,c));return Module.getValue(c,"i32")};a.ActionGetDest=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ActionGetDest(a,c));return Module.getValue(c,
"i8*")};a.DestinationIsValid=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationIsValid(a,c));return 0!==Module.getValue(c,"i8")};a.DestinationGetPage=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetPage(a,c));return Module.getValue(c,"i8*")};a.PageIsValid=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageIsValid(a,c));return 0!==Module.getValue(c,"i8")};a.PageGetIndex=function(a){var c=
Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetIndex(a,c));return Module.getValue(c,"i32")};a.ObjGetAsPDFText=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetAsPDFText(a,c));a=Module.getValue(c,"i8*");return Module.GetJSStringFromUString(a)};a.ObjFindObj=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);c=Module.allocate(Module.intArrayFromString(c),"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjFindObj(a,c,b));return Module.getValue(b,
"i8*")};a.PDFDocGetFirstBookmark=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetFirstBookmark(a,c));return Module.getValue(c,"i8*")};a.DestinationGetExplicitDestObj=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetExplicitDestObj(a,c));return Module.getValue(c,"i8*")};a.DestinationGetFitType=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetFitType(a,c));return Module.getValue(c,
"i32")};a.ObjIsNumber=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjIsNumber(a,c));return 0!==Module.getValue(c,"i8")};a.ObjGetNumber=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetNumber(a,c));return Module.getValue(c,"double")};a.PDFDocGetRoot=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetRoot(a,c));return Module.getValue(c,"i8*")};a.ObjPutName=function(a,c,b){c=Module.allocate(Module.intArrayFromString(c),
"i8",Module.ALLOC_STACK);b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutName(a,c,b,d));return Module.getValue(d,"i8*")};a.ObjPutDict=function(a,c){c=Module.allocate(Module.intArrayFromString(c),"i8",Module.ALLOC_STACK);var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutDict(a,c,b));return Module.getValue(b,"i8*")};a.ObjPutString=function(a,c,b){c=Module.allocate(Module.intArrayFromString(c),
"i8",Module.ALLOC_STACK);b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutString(a,c,b,d));return Module.getValue(d,"i8*")};a.ObjPut=function(a,c,b){c=Module.allocate(Module.intArrayFromString(c),"i8",Module.ALLOC_STACK);var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPut(a,c,b,d));return Module.getValue(d,"i8*")};a.ObjGetAt=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);
REX(Module._TRN_ObjGetAt(a,c,b));return Module.getValue(b,"i8*")};a.Matrix2DInverse=function(a){var c=Module.allocate(48,"i8",Module.ALLOC_STACK);REX(Module._TRN_Matrix2DInverse(a,c));return c};a.PDFDocInitSecurityHandler=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocInitSecurityHandler(a,0,c));return 0!==Module.getValue(c,"i8")};a.PDFDocInitStdSecurityHandler=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);c=Module.intArrayFromString(c);var d=Module.allocate(c,
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocInitStdSecurityHandler(a,d,c.length-1,b));return 0!==Module.getValue(b,"i8")};a.PDFDocInsertPages=function(a,c,b,d,e){REX(Module._TRN_PDFDocInsertPageSet(a,c,b,d,e?1:0,0))};a.PDFDocMovePages=function(a,c,b){REX(Module._TRN_PDFDocMovePageSet(a,c,a,b,0,0))};a.PDFDocGetPageIterator=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetPageIterator(a,c,b));return Module.getValue(b,"i8*")};a.PDFDocPageRemove=function(a,c){REX(Module._TRN_PDFDocPageRemove(a,
c))};a.PDFDocPageCreate=function(a,c,b){var d=Module.allocate(40,"i8",Module.ALLOC_STACK);Module.setValue(d,0,"double");Module.setValue(d+8,0,"double");Module.setValue(d+16,c,"double");Module.setValue(d+24,b,"double");Module.setValue(d+32,0,"double");c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocPageCreate(a,d,c));return Module.getValue(c,"i8*")};a.PDFDocPageInsert=function(a,c,b){REX(Module._TRN_PDFDocPageInsert(a,c,b))};a.PageSetCreate=function(){var a=Module.allocate(4,"i8",
Module.ALLOC_STACK);REX(Module._TRN_PageSetCreate(a));return Module.getValue(a,"i8*")};a.PageSetCreateRange=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageSetCreateRange(b,a,c));return Module.getValue(b,"i8*")};a.PageSetAddPage=function(a,c){REX(Module._TRN_PageSetAddPage(a,c))};a.ElementBuilderCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementBuilderCreate(a));return Module.getValue(a,"i8*")};a.ElementBuilderDestroy=function(a){REX(Module._TRN_ElementBuilderDestroy(a))};
a.ElementBuilderCreateImage=function(a,c,b,d,e,l){var f=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementBuilderCreateImageScaled(a,c,b,d,e,l,f));return Module.getValue(f,"i8*")};a.ElementWriterCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementWriterCreate(a));return Module.getValue(a,"i8*")};a.ElementWriterDestroy=function(a){REX(Module._TRN_ElementWriterDestroy(a))};a.ElementWriterBegin=function(a,c){REX(Module._TRN_ElementWriterBeginOnPage(a,
c,1))};a.ElementWriterWritePlacedElement=function(a,c){REX(Module._TRN_ElementWriterWritePlacedElement(a,c))};a.ElementWriterEnd=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementWriterEnd(a,c))};a.ImageGetImageWidth=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageGetImageWidth(a,c));return Module.getValue(c,"i32")};a.ImageGetImageHeight=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageGetImageHeight(a,
c));return Module.getValue(c,"i32")};a.ImageCreateFromMemory2=function(a,c,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageCreateFromMemory2(a,c,b,0,d));return Module.getValue(d,"i8*")};a.ImageCreateFromFile=function(a,c){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageCreateFromFile(a,c,0,b));return Module.getValue(b,"i8*")};a.PDFDocPagePushBack=function(a,c){REX(Module._TRN_PDFDocPagePushBack(a,c))};a.PDFDocHasOC=function(a){var c=Module.allocate(4,
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocHasOC(a,c));return 0!==Module.getValue(c,"i8")};a.PDFDocGetOCGConfig=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetOCGConfig(a,c));return Module.getValue(c,"i8*")};a.OCGContextCreate=function(a){var c=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_OCGContextCreateFromConfig(a,c));return Module.getValue(c,"i8*")};a.UStringDestroy=function(a){REX(Module._TRN_UStringDestroy(a))};a.FDFDocDestroy=function(a){REX(Module._TRN_FDFDocDestroy(a))}})(g.Module)}).call(this,
n(4).setImmediate)},function(d,g,n){(function(d){d.SetupPDFNetFunctions=function(b){Module._IB_=[];for(var g=function(a){if("object"===typeof a&&null!==a)if("undefined"!==typeof a.byteLength){var b=Module._IB_.length;Module._IB_[b]=new Uint8Array(a);a={handle:b,isArrayBufferRef:!0}}else Object.keys(a).forEach(function(b){a.hasOwnProperty(b)&&(a[b]=g(a[b]))});return a},a=function(b){"object"===typeof b&&null!==b&&(b.buffer?b=b.buffer.slice(b.byteOffset,b.byteOffset+b.length):b.isArrayBufferRef?b=Module._IB_[b.handle].buffer:
Object.keys(b).forEach(function(d){b.hasOwnProperty(d)&&(b[d]=a(b[d]))}));return b},n=Module._TRN_EMSCreateSharedWorkerInstance(),e,h=Module._TRN_EMSWorkerInstanceGetFunctionIterator(n),r=function(b,d){return new Promise(function(e,l){b=g(b);var k=b.docId;k=k?Module.GetDoc(k):0;(k=Module.EMSCallSharedFunction(n,d,k))?l({type:"InvalidPDF",message:Module.GetErrToString(k)}):(l=Module.EMSGetLastResponse(n),l=a(l),e(l))})};e=Module._TRN_EMSFunctionIteratorGetNextCommandName(h);)e=Module.GetJSStringFromCString(e),
d.queue.onAsync(e,r);Module._TRN_EMSFunctionIteratorDestroy(h);if(Module._TRN_EMSCreatePDFNetWorkerInstance){var q={};h=function(a,d){b.on(a,d);q[a]=!0};Module.docPtrStringToIdMap={};var k=function(a){if(a in Module.docPtrStringToIdMap)return Module.docPtrStringToIdMap[a];throw Error("Couldn't find document "+a);};d.queue.onAsync("PDFDoc.RequirePage",function(a){return Module.RequirePage(k(a.docId),a.pageNum)});h("pdfDocCreateFromBuffer",function(a){a=Module.CreateDoc({type:"array",value:a.buf});
var b=Module.GetDoc(a).toString(16);Module.docPtrStringToIdMap[b]=a;return b});h("PDFDoc.destroy",function(a){a=k(a.auto_dealloc_obj);Module.DeleteDoc(a)});h("PDFDoc.saveMemoryBuffer",function(a){var b=k(a.doc);return Module.SaveHelper(Module.GetDoc(b),b,a.flags).slice(0)});h("pdfDocCreate",function(){var a=Module.CreateDoc({type:"new"}),b=Module.GetDoc(a).toString(16);Module.docPtrStringToIdMap[b]=a;return b});h("GetPDFDoc",function(a){a=a.docId;var b=Module.GetDoc(a).toString(16);Module.docPtrStringToIdMap[b]=
a;return b});h("ExtractPDFNetLayersContext",function(a){var b=a.layers;a=Module.GetDoc(a.docId);var d=0;b?d=Module.EMSCreateUpdatedLayersContext(a,b):Module.PDFDocHasOC(a)&&(b=Module.PDFDocGetOCGConfig(a),d=Module.OCGContextCreate(b));return d.toString(16)});var y=Module._TRN_EMSCreatePDFNetWorkerInstance();h=Module._TRN_EMSWorkerInstanceGetFunctionIterator(y);for(r=function(b){return new Promise(function(d,e){b=g(b);var k=Module.EMSCallPDFNetFunction(y,b);k?e(Module.GetErrToString(k)):(e=Module.EMSGetLastResponse(y),
e=a(e),d(e))})};e=Module._TRN_EMSFunctionIteratorGetNextCommandName(h);)if(e=Module.GetJSStringFromCString(e),!q[e])b.onAsync(e,r);Module._TRN_EMSFunctionIteratorDestroy(h)}}})(self)},function(d,g,n){var q=n(0);d=n(3);var b=n.n(d),u=n(8),a=n(9),m=n(6);(function(d){function e(a){var b={};decodeURIComponent(a.slice(1)).split("&").forEach(function(a){a=a.split("=",2);b[a[0]]=a[1]});return b}var g=null;d.basePath="../";var n=function(){var a=d.pdfWorkerPath||"";d.workerBasePath&&(d.basePath=d.workerBasePath);
var b=e(d.location.search),l="true"===b.isfull,g=l?"full/":"lean/";b.pdfWorkerPath&&(a=b.pdfWorkerPath,d.basePath="../",Object(m.b)()||(a=""));d.basePath=b.externalPath?b.externalPath:d.basePath+"external/";Object(m.a)(a+g+"PDFNetC",{"Wasm.wasm":4E6,"Wasm.js.mem":1E5,".js.mem":6E6,".mem":l?2E6:3E5})};self.shouldResize||n();d.EmscriptenPDFManager=function(){};d.EmscriptenPDFManager.prototype={OnInitialized:function(a){Module.loaded?a():(Module.initCb=function(){a()},Object(q.b)("worker","PDFNet is not initialized yet!"))},
NewDoc:function(a,b){return new Promise(function(d,e){try{d(Module.loadDoc(a,b))}catch(A){e(A)}})},Initialize:function(a,b,e,g){a&&(Module.TOTAL_MEMORY=a);Module.memoryInitializerPrefixURL=b;Module.asmjsPrefix=e;d.basePath=g;n()},shouldRunRender:function(a){return Module.ShouldRunRender(a.docId,a.pageIndex+1)}};(function(a){function e(a){var b=a.data,c=a.action;var e="GetCanvas"===c||"GetCanvasPartial"===c?n.shouldRunRender(b):!0;if(e){g=a;var f=a.asyncCallCapability;Object(q.b)("Memory","Worker running command: "+
c);m.actionMap[c](b,a).then(function(a){f.resolve(a)},function(a){f.reject(a)})}else d.deferredQueue.queue(a),h()}function l(a){a.asyncCallCapability=createPromiseCapability();g?m.queue(a):e(a);return a.asyncCallCapability.promise}function k(b){self.shouldResize&&n.Initialize(b.options.workerHeapSize,b.options.pdfResourcePath,b.options.pdfAsmPath,b.options.parentUrl);Module.chunkMax=b.options.chunkMax;if(b.array instanceof Uint8Array){var e=255===b.array[0];a.postMessageTransfers=e;"response"in new XMLHttpRequest?
n.OnInitialized(function(){d.SetupPDFNetFunctions(a);c();a.send("test",{supportTypedArray:!0,supportTransfers:e})}):a.send("test",!1)}else a.send("test",!1)}function h(){u.a.setImmediate(function(){if(!g||"BeginOperation"!==g.action)if(m.length){if(!g||99999!==g.priority){var a=m.dequeue();e(a)}}else g=null})}var n=new d.EmscriptenPDFManager,m,r=!1,f=!1;Module.workerMessageHandler=a;var c=function(){r?f||(a.send("workerLoaded",{}),f=!0):r=!0};n.OnInitialized(c);(function(){d.queue=m=new b.a({strategy:b.a.ArrayStrategy,
comparator:function(a,b){return a.priority===b.priority?a.callbackId-b.callbackId:b.priority-a.priority}});d.deferredQueue=new b.a({strategy:b.a.ArrayStrategy,comparator:function(a,b){return a.priority===b.priority?a.callbackId-b.callbackId:b.priority-a.priority}});m.actionMap={};m.onAsync=function(b,c){a.onAsync(b,l);m.actionMap[b]=c}})();a.on("test",k);a.on("InitWorker",k);var p=function(a){g&&a(g)&&(Module.cancelCurrent(),g=null);m.removeAllMatching(a,function(a){a.asyncCallCapability.reject({type:"Cancelled",
message:"Operation was cancelled due to document deletion."})})},x=function(a){p(function(b){return b.data&&b.data.docId===a})};a.on("UpdatePassword",function(a){return Module.UpdatePassword(a.docId,a.password)});a.on("LoadRes",function(a){Module.loadResources(a.array,a.l);return{}});a.on("DownloaderHint",function(a){Module.DownloaderHint(a.docId,a.hint)});a.on("IsLinearized",function(a){return Module.IsLinearizationValid(a.docId)});a.onNextAsync(h);m.onAsync("NewDoc",function(a){return n.NewDoc(a)});
m.onAsync("GetCanvas",function(a){Object(q.b)("workerdetails","Run GetCanvas PageIdx: "+a.pageIndex+" Width: "+a.width);Object(q.b)("Memory","loadCanvas with potential memory usage "+a.width*a.height*8);return Module.loadCanvas(a.docId,a.pageIndex,a.width,a.height,a.rotation,null,a.layers,a.overprintMode)});m.onAsync("GetCanvasPartial",function(a){Object(q.b)("Memory","GetCanvasPartial with potential memory usage "+a.width*a.height*8);return Module.loadCanvas(a.docId,a.pageIndex,a.width,a.height,
a.rotation,a.bbox,a.layers,a.overprintMode)});m.onAsync("LoadText",function(a){return Module.GetTextData(a.docId,a.pageIndex)});m.onAsync("SaveDoc",function(a){return Module.SaveDoc(a.docId,a.xfdfString,a.finishedWithDocument,a.printDocument,a.flags,a.watermarks)});m.onAsync("SaveDocFromFixedElements",function(a){return Module.SaveDocFromFixedElements(a.bytes,a.xfdfString,a.flags,a.watermarks)});m.onAsync("MergeXFDF",function(a){return Module.MergeXFDF(a.docId,a.xfdf)});m.onAsync("InsertPages",function(a){return Module.InsertPages(a.docId,
a.doc,a.pageArray,a.destPos,a.insertBookmarks)});m.onAsync("MovePages",function(a){return Module.MovePages(a.docId,a.pageArray,a.destPos)});m.onAsync("RemovePages",function(a){return Module.RemovePages(a.docId,a.pageArray)});m.onAsync("RotatePages",function(a){return Module.RotatePages(a.docId,a.pageArray,a.rotation)});m.onAsync("ExtractPages",function(a){return Module.ExtractPages(a.docId,a.pageArray,a.xfdfString,a.watermarks)});m.onAsync("CropPages",function(a){return Module.CropPages(a.docId,a.pageArray,
a.topMargin,a.botMargin,a.leftMargin,a.rightMargin)});m.onAsync("InsertBlankPages",function(a){return Module.InsertBlankPages(a.docId,a.pageArray,a.width,a.height)});m.onAsync("BeginOperation",function(){return Promise.resolve()});m.onAsync("RequirePage",function(a,b){return Module.RequirePage(a.docId,a.pageNum)});a.on("FinishOperation",function(){if("BeginOperation"===g.action)a.onNextAsync(h),Module.cancelCurrent(),g=null;else throw{message:"Operation has not started."};});a.on("DeleteDocument",
function(a){a=a.docId;x(a);Module.DeleteDoc(a)});a.on("LoadBookmarks",function(a){return Module.LoadBookmarks(a.docId)});a.on("GetCanvasProgressive",function(a){if(g&&g.callbackId===a.callbackId){Object(q.b)("worker","Progressive request in progress");var b=Module.GetCurrentCanvasData(!0)}else{if(m.find({priority:0,callbackId:a.callbackId}))throw Object(q.b)("worker","Progressive request Queued"),{type:"Queued",message:"Rendering has not started yet."};if(d.deferredQueue.find({priority:0,callbackId:a.callbackId}))throw Object(q.b)("worker",
"Progressive request Deferred"),{type:"Queued",message:"Rendering has not started yet."};}if(!b)throw Object(q.b)("worker","Progressive request invalid (render already complete)"),{type:"Unavailable",message:"Rendering is complete or was cancelled."};return b});a.on("actionCancel",function(a){g&&g.callbackId===a.callbackId?(Object(q.b)("workerdetails","Cancelled Current Operation"),Module.cancelCurrent()&&h()):(Object(q.b)("workerdetails","Cancelled queued operation"),m.remove({priority:0,callbackId:a.callbackId}),
d.deferredQueue.remove({priority:0,callbackId:a.callbackId}))})})(new a.a("worker_processor",self))})("undefined"===typeof window?self:window)}]);}).call(this || window)