UNPKG

@foreverrbum/ethsign

Version:

This package will allow you to electronically sign documents within your application

115 lines (113 loc) 106 kB
(function(){/* ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *****************************************************************************/ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(c){var l=0;return function(){return l<c.length?{done:!1,value:c[l++]}:{done:!0}}};$jscomp.arrayIterator=function(c){return{next:$jscomp.arrayIteratorImpl(c)}};$jscomp.makeIterator=function(c){var l="undefined"!=typeof Symbol&&Symbol.iterator&&c[Symbol.iterator];return l?l.call(c):$jscomp.arrayIterator(c)}; $jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$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(c,l,h){c!=Array.prototype&&c!=Object.prototype&&(c[l]=h.value)}; $jscomp.polyfill=function(c,l,h,f){if(l){h=$jscomp.global;c=c.split(".");for(f=0;f<c.length-1;f++){var n=c[f];n in h||(h[n]={});h=h[n]}c=c[c.length-1];f=h[c];l=l(f);l!=f&&null!=l&&$jscomp.defineProperty(h,c,{configurable:!0,writable:!0,value:l})}};$jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(c){function l(){this.batch_=null}function h(b){return b instanceof n?b:new n(function(a,e){a(b)})}if(c&&!$jscomp.FORCE_POLYFILL_PROMISE)return c;l.prototype.asyncExecute=function(b){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(b);return this};l.prototype.asyncExecuteBatch_=function(){var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})};var f=$jscomp.global.setTimeout;l.prototype.asyncExecuteFunction=function(b){f(b, 0)};l.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var b=this.batch_;this.batch_=[];for(var a=0;a<b.length;++a){var e=b[a];b[a]=null;try{e()}catch(g){this.asyncThrow_(g)}}}this.batch_=null};l.prototype.asyncThrow_=function(b){this.asyncExecuteFunction(function(){throw b;})};var n=function(b){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var a=this.createResolveAndReject_();try{b(a.resolve,a.reject)}catch(e){a.reject(e)}};n.prototype.createResolveAndReject_= function(){function b(g){return function(b){e||(e=!0,g.call(a,b))}}var a=this,e=!1;return{resolve:b(this.resolveTo_),reject:b(this.reject_)}};n.prototype.resolveTo_=function(b){if(b===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof n)this.settleSameAsPromise_(b);else{a:switch(typeof b){case "object":var a=null!=b;break a;case "function":a=!0;break a;default:a=!1}a?this.resolveToNonPromiseObj_(b):this.fulfill_(b)}};n.prototype.resolveToNonPromiseObj_=function(b){var a= void 0;try{a=b.then}catch(e){this.reject_(e);return}"function"==typeof a?this.settleSameAsThenable_(a,b):this.fulfill_(b)};n.prototype.reject_=function(b){this.settle_(2,b)};n.prototype.fulfill_=function(b){this.settle_(1,b)};n.prototype.settle_=function(b,a){if(0!=this.state_)throw Error("Cannot settle("+b+", "+a+"): Promise already settled in state"+this.state_);this.state_=b;this.result_=a;this.executeOnSettledCallbacks_()};n.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var f= 0;f<this.onSettledCallbacks_.length;++f)b.asyncExecute(this.onSettledCallbacks_[f]);this.onSettledCallbacks_=null}};var b=new l;n.prototype.settleSameAsPromise_=function(b){var a=this.createResolveAndReject_();b.callWhenSettled_(a.resolve,a.reject)};n.prototype.settleSameAsThenable_=function(b,a){var e=this.createResolveAndReject_();try{b.call(a,e.resolve,e.reject)}catch(g){e.reject(g)}};n.prototype.then=function(b,a){function e(a,e){return"function"==typeof a?function(e){try{g(a(e))}catch(v){p(v)}}: e}var g,p,u=new n(function(a,e){g=a;p=e});this.callWhenSettled_(e(b,g),e(a,p));return u};n.prototype.catch=function(b){return this.then(void 0,b)};n.prototype.callWhenSettled_=function(f,a){function e(){switch(g.state_){case 1:f(g.result_);break;case 2:a(g.result_);break;default:throw Error("Unexpected state: "+g.state_);}}var g=this;null==this.onSettledCallbacks_?b.asyncExecute(e):this.onSettledCallbacks_.push(e)};n.resolve=h;n.reject=function(b){return new n(function(a,e){e(b)})};n.race=function(b){return new n(function(a, e){for(var g=$jscomp.makeIterator(b),p=g.next();!p.done;p=g.next())h(p.value).callWhenSettled_(a,e)})};n.all=function(b){var a=$jscomp.makeIterator(b),e=a.next();return e.done?h([]):new n(function(g,b){function p(a){return function(e){m[a]=e;f--;0==f&&g(m)}}var m=[],f=0;do m.push(void 0),f++,h(e.value).callWhenSettled_(p(m.length-1),b),e=a.next();while(!e.done)})};return n},"es6","es3"); $jscomp.checkStringArgs=function(c,l,h){if(null==c)throw new TypeError("The 'this' value for String.prototype."+h+" must not be null or undefined");if(l instanceof RegExp)throw new TypeError("First argument to String.prototype."+h+" must not be a regular expression");return c+""}; $jscomp.polyfill("String.prototype.endsWith",function(c){return c?c:function(c,h){var f=$jscomp.checkStringArgs(this,c,"endsWith");c+="";void 0===h&&(h=f.length);h=Math.max(0,Math.min(h|0,f.length));for(var n=c.length;0<n&&0<h;)if(f[--h]!=c[--n])return!1;return 0>=n}},"es6","es3");$jscomp.checkEs6ConformanceViaProxy=function(){try{var c={},l=Object.create(new $jscomp.global.Proxy(c,{get:function(h,f,n){return h==c&&"q"==f&&n==l}}));return!0===l.q}catch(h){return!1}}; $jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var c=0;return function(l){return $jscomp.SYMBOL_PREFIX+(l||"")+c++}}(); $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.iterator;c||(c=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[c]&&$jscomp.defineProperty(Array.prototype,c,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}}; $jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.asyncIterator;c||(c=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(c){$jscomp.initSymbolIterator();c={next:c};c[$jscomp.global.Symbol.iterator]=function(){return this};return c};$jscomp.owns=function(c,l){return Object.prototype.hasOwnProperty.call(c,l)}; $jscomp.polyfill("WeakMap",function(c){function l(){if(!c||!Object.seal)return!1;try{var a=Object.seal({}),g=Object.seal({}),b=new c([[a,2],[g,3]]);if(2!=b.get(a)||3!=b.get(g))return!1;b.delete(a);b.set(g,4);return!b.has(a)&&4==b.get(g)}catch(u){return!1}}function h(){}function f(a){if(!$jscomp.owns(a,b)){var e=new h;$jscomp.defineProperty(a,b,{value:e})}}function n(a){var e=Object[a];e&&(Object[a]=function(a){if(a instanceof h)return a;f(a);return e(a)})}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(c&& $jscomp.ES6_CONFORMANCE)return c}else if(l())return c;var b="$jscomp_hidden_"+Math.random();n("freeze");n("preventExtensions");n("seal");var t=0,a=function(a){this.id_=(t+=Math.random()+1).toString();if(a){a=$jscomp.makeIterator(a);for(var e;!(e=a.next()).done;)e=e.value,this.set(e[0],e[1])}};a.prototype.set=function(a,g){f(a);if(!$jscomp.owns(a,b))throw Error("WeakMap key fail: "+a);a[b][this.id_]=g;return this};a.prototype.get=function(a){return $jscomp.owns(a,b)?a[b][this.id_]:void 0};a.prototype.has= function(a){return $jscomp.owns(a,b)&&$jscomp.owns(a[b],this.id_)};a.prototype.delete=function(a){return $jscomp.owns(a,b)&&$jscomp.owns(a[b],this.id_)?delete a[b][this.id_]:!1};return a},"es6","es3");$jscomp.MapEntry=function(){}; $jscomp.polyfill("Map",function(c){function l(){if($jscomp.ASSUME_NO_NATIVE_MAP||!c||"function"!=typeof c||!c.prototype.entries||"function"!=typeof Object.seal)return!1;try{var a=Object.seal({x:4}),b=new c($jscomp.makeIterator([[a,"s"]]));if("s"!=b.get(a)||1!=b.size||b.get({x:4})||b.set({x:4},"t")!=b||2!=b.size)return!1;var p=b.entries(),u=p.next();if(u.done||u.value[0]!=a||"s"!=u.value[1])return!1;u=p.next();return u.done||4!=u.value[0].x||"t"!=u.value[1]||!p.next().done?!1:!0}catch(m){return!1}} if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(c&&$jscomp.ES6_CONFORMANCE)return c}else if(l())return c;$jscomp.initSymbolIterator();var h=new WeakMap,f=function(a){this.data_={};this.head_=t();this.size=0;if(a){a=$jscomp.makeIterator(a);for(var e;!(e=a.next()).done;)e=e.value,this.set(e[0],e[1])}};f.prototype.set=function(a,b){a=0===a?0:a;var e=n(this,a);e.list||(e.list=this.data_[e.id]=[]);e.entry?e.entry.value=b:(e.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:a, value:b},e.list.push(e.entry),this.head_.previous.next=e.entry,this.head_.previous=e.entry,this.size++);return this};f.prototype.delete=function(a){a=n(this,a);return a.entry&&a.list?(a.list.splice(a.index,1),a.list.length||delete this.data_[a.id],a.entry.previous.next=a.entry.next,a.entry.next.previous=a.entry.previous,a.entry.head=null,this.size--,!0):!1};f.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=t();this.size=0};f.prototype.has=function(a){return!!n(this,a).entry}; f.prototype.get=function(a){return(a=n(this,a).entry)&&a.value};f.prototype.entries=function(){return b(this,function(a){return[a.key,a.value]})};f.prototype.keys=function(){return b(this,function(a){return a.key})};f.prototype.values=function(){return b(this,function(a){return a.value})};f.prototype.forEach=function(a,b){for(var e=this.entries(),g;!(g=e.next()).done;)g=g.value,a.call(b,g[1],g[0],this)};f.prototype[Symbol.iterator]=f.prototype.entries;var n=function(e,b){var g=b&&typeof b;"object"== g||"function"==g?h.has(b)?g=h.get(b):(g=""+ ++a,h.set(b,g)):g="p_"+b;var f=e.data_[g];if(f&&$jscomp.owns(e.data_,g))for(e=0;e<f.length;e++){var m=f[e];if(b!==b&&m.key!==m.key||b===m.key)return{id:g,list:f,index:e,entry:m}}return{id:g,list:f,index:-1,entry:void 0}},b=function(a,b){var e=a.head_;return $jscomp.iteratorPrototype(function(){if(e){for(;e.head!=a.head_;)e=e.previous;for(;e.next!=e.head;)return e=e.next,{done:!1,value:b(e)};e=null}return{done:!0,value:void 0}})},t=function(){var a={};return a.previous= a.next=a.head=a},a=0;return f},"es6","es3");$jscomp.findInternal=function(c,l,h){c instanceof String&&(c=String(c));for(var f=c.length,n=0;n<f;n++){var b=c[n];if(l.call(h,b,n,c))return{i:n,v:b}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,h){return $jscomp.findInternal(this,c,h).v}},"es6","es3");$jscomp.underscoreProtoCanBeSet=function(){var c={a:!0},l={};try{return l.__proto__=c,l.a}catch(h){}return!1}; $jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(c,l){c.__proto__=l;if(c.__proto__!==l)throw new TypeError(c+" is not extensible");return c}:null;$jscomp.polyfill("Object.setPrototypeOf",function(c){return c||$jscomp.setPrototypeOf},"es6","es5"); $jscomp.assign="function"==typeof Object.assign?Object.assign:function(c,l){for(var h=1;h<arguments.length;h++){var f=arguments[h];if(f)for(var n in f)$jscomp.owns(f,n)&&(c[n]=f[n])}return c};$jscomp.polyfill("Object.assign",function(c){return c||$jscomp.assign},"es6","es3"); $jscomp.iteratorFromArray=function(c,l){$jscomp.initSymbolIterator();c instanceof String&&(c+="");var h=0,f={next:function(){if(h<c.length){var n=h++;return{value:l(n,c[n]),done:!1}}f.next=function(){return{done:!0,value:void 0}};return f.next()}};f[Symbol.iterator]=function(){return f};return f};$jscomp.polyfill("Array.prototype.keys",function(c){return c?c:function(){return $jscomp.iteratorFromArray(this,function(c){return c})}},"es6","es3"); (function(c){function l(f){if(h[f])return h[f].exports;var n=h[f]={i:f,l:!1,exports:{}};c[f].call(n.exports,n,n.exports,l);n.l=!0;return n.exports}var h={};l.m=c;l.c=h;l.d=function(f,n,b){l.o(f,n)||Object.defineProperty(f,n,{enumerable:!0,get:b})};l.r=function(f){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"});Object.defineProperty(f,"__esModule",{value:!0})};l.t=function(f,n){n&1&&(f=l(f));if(n&8||n&4&&"object"===typeof f&&f&&f.__esModule)return f; var b=Object.create(null);l.r(b);Object.defineProperty(b,"default",{enumerable:!0,value:f});if(n&2&&"string"!=typeof f)for(var c in f)l.d(b,c,function(a){return f[a]}.bind(null,c));return b};l.n=function(f){var c=f&&f.__esModule?function(){return f["default"]}:function(){return f};l.d(c,"a",c);return c};l.o=function(f,c){return Object.prototype.hasOwnProperty.call(f,c)};l.p="/core/pdf/";return l(l.s=17)})([function(c,l,h){h.d(l,"c",function(){return e});h.d(l,"a",function(){return g});h.d(l,"b",function(){return p}); h.d(l,"d",function(){return u});var f=h(9),n=console.log,b=console.warn,t=console.error,a=function(a){void 0===a&&(a=!0);a?(console.log=function(){},console.warn=function(){},console.error=function(){}):(console.log=n,console.warn=b,console.error=t)},e=function(){var e=Object(f.a)(location.search);a("1"===e.disableLogs)},g=function(e){e.on("disableLogs",function(e){a(e.disabled)})},p=function(a,e){return function(){}},u=function(a,e){e?console.warn(a+": "+e):console.warn(a)}},function(c,l,h){h.d(l, "c",function(){return b});h.d(l,"d",function(){return n});h.d(l,"b",function(){return t});h.d(l,"a",function(){return a});var f=h(3),n=function(a,b){Object(f.a)("disableLogs")||(b?console.warn(a+": "+b):console.warn(a))},b=function(a,b){Object(f.a)("disableLogs")||(b?console.log(a+": "+b):console.log(a))},t=function(a){if(!Object(f.a)("disableLogs"))throw console.error(a),Error(a);},a=function(a,b){}},function(c,l,h){h.d(l,"a",function(){return A});h.d(l,"b",function(){return r});h.d(l,"c",function(){return k}); var f=h(12),n=h(1),b=h(5),t=h(4),a="undefined"===typeof window?self:window,e=a.importScripts,g=!1,p=function(d,k){g||(e(a.basePath+"decode.min.js"),g=!0);d=self.BrotliDecode(Object(t.b)(d));return k?d:Object(t.a)(d)},u=function(d,k){return Object(f.a)(void 0,void 0,Promise,function(){var a;return Object(f.b)(this,function(r){switch(r.label){case 0:return g?[3,2]:[4,Object(b.b)(self.CoreControls.getWorkerPath()+"external/decode.min.js","Failed to download decode.min.js",window)];case 1:r.sent(),g= !0,r.label=2;case 2:return a=self.BrotliDecode(Object(t.b)(d)),[2,k?a:Object(t.a)(a)]}})})};(function(){function d(){this.remainingDataArrays=[]}d.prototype.processRaw=function(d){return d};d.prototype.processBrotli=function(d){this.remainingDataArrays.push(d);return null};d.prototype.GetNextChunk=function(d){this.decodeFunction||(this.decodeFunction=0===d[0]&&97===d[1]&&115===d[2]&&109===d[3]?this.processRaw:this.processBrotli);return this.decodeFunction(d)};d.prototype.End=function(){if(this.remainingDataArrays.length){for(var d= this.arrays,k=0,a=0;a<d.length;++a)k+=d[a].length;k=new Uint8Array(k);var r=0;for(a=0;a<d.length;++a){var e=d[a];k.set(e,r);r+=e.length}return p(k,!0)}return null};return d})();var m=!1,q=function(d){m||(e(a.basePath+"pako_inflate.min.js"),m=!0);var k=10;if("string"===typeof d){if(d.charCodeAt(3)&8){for(;0!==d.charCodeAt(k);++k);++k}}else if(d[3]&8){for(;0!==d[k];++k);++k}d=Object(t.b)(d);d=d.subarray(k,d.length-8);return a.pako.inflate(d,{windowBits:-15})},z=function(d,k){return k?d:Object(t.a)(d)}, v=function(d){var k=!d.shouldOutputArray,a=new XMLHttpRequest;a.open("GET",d.url,d.isAsync);var r=k&&a.overrideMimeType;a.responseType=r?"text":"arraybuffer";r&&a.overrideMimeType("text/plain; charset=x-user-defined");a.send();var b=function(){var w=Date.now();var b=r?a.responseText:new Uint8Array(a.response);Object(n.a)("worker","Result length is "+b.length);b.length<d.compressedMaximum?(b=d.decompressFunction(b,d.shouldOutputArray),Object(n.d)("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."), e&&Object(n.a)("worker","Decompressed length is "+b.length)):k&&(b=Object(t.a)(b));e&&Object(n.a)("worker",d.url+" Decompression took "+(Date.now()-w));return b};if(d.isAsync)var B=new Promise(function(k,r){a.onload=function(){200===this.status||0===this.status?k(b()):r("Download Failed "+d.url)};a.onerror=function(){r("Network error occurred "+d.url)}});else{if(200===a.status||0===a.status)return b();throw Error("Failed to load "+d.url);}return B},A=function(d){var k=d.lastIndexOf("/");-1===k&&(k= 0);var a=d.slice(k).replace(".",".br.");e||(a.endsWith(".js.mem")?a=a.replace(".js.mem",".mem"):a.endsWith(".js")&&(a=a.concat(".mem")));return d.slice(0,k)+a},C=function(d,k){var a=d.lastIndexOf("/");-1===a&&(a=0);var r=d.slice(a).replace(".",".gz.");k.url=d.slice(0,a)+r;k.decompressFunction=q;return v(k)},x=function(d,k){k.url=A(d);k.decompressFunction=e?p:u;return v(k)},y=function(d,k){d.endsWith(".js.mem")?d=d.slice(0,-4):d.endsWith(".mem")&&(d=d.slice(0,-4)+".js.mem");k.url=d;k.decompressFunction= z;return v(k)},E=function(d,k,a,r){return d.catch(function(d){Object(n.d)(d);return r(k,a)})},d=function(d,k,a){var r;if(a.isAsync){var b=k[0](d,a);for(r=1;r<k.length;++r)b=E(b,d,a,k[r]);return b}for(r=0;r<k.length;++r)try{return k[r](d,a)}catch(N){Object(n.d)(N.message)}throw Error("");},k=function(k,a,r,b){return d(k,[C,x,y],{compressedMaximum:a,isAsync:r,shouldOutputArray:b})},r=function(k,a,r,b){return d(k,[x,C,y],{compressedMaximum:a,isAsync:r,shouldOutputArray:b})}},function(c,l,h){h.d(l,"a", function(){return b});h.d(l,"b",function(){return t});var f={},n={flattenedResources:!1,CANVAS_CACHE_SIZE:void 0,maxPagesBefore:void 0,maxPagesAhead:void 0,disableLogs:!1,_trnDebugMode:!1,_logFiltersEnabled:null},b=function(a){return n[a]},t=function(a,b){var e;n[a]=b;null===(e=f[a])||void 0===e?void 0:e.forEach(function(a){a(b)})}},function(c,l,h){h.d(l,"b",function(){return f});h.d(l,"a",function(){return n});var f=function(b){if("string"===typeof b){for(var f=new Uint8Array(b.length),a=b.length, e=0;e<a;e++)f[e]=b.charCodeAt(e);return f}return b},n=function(b){if("string"!==typeof b){for(var f="",a=0,e=b.length,g;a<e;)g=b.subarray(a,a+1024),a+=1024,f+=String.fromCharCode.apply(null,g);return f}return b}},function(c,l,h){function f(a,e,g){function f(p){m=m||Date.now();return p?(Object(b.a)("load","Try instantiateStreaming"),fetch(Object(t.a)(a)).then(function(a){return WebAssembly.instantiateStreaming(a,e)}).catch(function(e){Object(b.a)("load","instantiateStreaming Failed "+a+" message "+ e.message);return f(!1)})):Object(t.b)(a,g,!0,!0).then(function(a){c=Date.now();Object(b.a)("load","Request took "+(c-m)+" ms");return WebAssembly.instantiate(a,e)})}var c,m;return f(!!WebAssembly.instantiateStreaming).then(function(a){Object(b.a)("load","WASM compilation took "+(Date.now()-(c||m))+" ms");return a})}function n(a,e,g){return new Promise(function(f){if(!a)return f();var c=g.document.createElement("script");c.type="text/javascript";c.onload=function(){f()};c.onerror=function(){e&&Object(b.d)(e); f()};c.src=a;g.document.getElementsByTagName("head")[0].appendChild(c)})}h.d(l,"a",function(){return f});h.d(l,"b",function(){return n});var b=h(1),t=h(2)},function(c,l,h){h.d(l,"c",function(){return g});h.d(l,"b",function(){return p});h.d(l,"a",function(){return u});var f="undefined"===typeof window?self:window;c=function(){var a=navigator.userAgent.toLowerCase();return(a=/(msie) ([\w.]+)/.exec(a)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(a))?parseInt(a[2],10):a}();var n=function(){var a=f.navigator.userAgent.match(/OPR/), b=f.navigator.userAgent.match(/Maxthon/),e=f.navigator.userAgent.match(/Edge/);return f.navigator.userAgent.match(/Chrome\/(.*?) /)&&!a&&!b&&!e}();(function(){if(!n)return null;var a=f.navigator.userAgent.match(/Chrome\/([0-9]+)\./);return a?parseInt(a[1],10):a})();var b=!!navigator.userAgent.match(/Edge/i)||navigator.userAgent.match(/Edg\/(.*?)/)&&f.navigator.userAgent.match(/Chrome\/(.*?) /);(function(){if(!b)return null;var a=f.navigator.userAgent.match(/Edg\/([0-9]+)\./);return a?parseInt(a[1], 10):a})();l=/iPad|iPhone|iPod/.test(f.navigator.platform)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;(function(){var a=f.navigator.userAgent.match(/.*\/([0-9\.]+)\s(Safari|Mobile).*/i);return a?parseFloat(a[1]):a})();var t=/^((?!chrome|android).)*safari/i.test(f.navigator.userAgent)||/^((?!chrome|android).)*$/.test(f.navigator.userAgent)&&l,a=f.navigator.userAgent.match(/Firefox/);(function(){if(!a)return null;var b=f.navigator.userAgent.match(/Firefox\/([0-9]+)\./);return b?parseInt(b[1], 10):b})();c||/Android|webOS|Touch|IEMobile|Silk/i.test(navigator.userAgent);navigator.userAgent.match(/(iPad|iPhone|iPod)/i);f.navigator.userAgent.indexOf("Android");var e=/Mac OS X 10_13_6.*\(KHTML, like Gecko\)$/.test(f.navigator.userAgent),g=function(){return t||e},p=!(!self.WebAssembly||!self.WebAssembly.validate),u=-1<f.navigator.userAgent.indexOf("Edge/16")||-1<f.navigator.userAgent.indexOf("MSAppHost")},function(c,l,h){function f(a){"@babel/helpers - typeof";f="function"===typeof Symbol&&"symbol"=== typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};return f(a)}var n,b,t;!function(a){"object"===f(l)&&"undefined"!==typeof c?c.exports=a():!(b=[],n=a,t="function"===typeof n?n.apply(l,b):n,void 0!==t&&(c.exports=t))}(function(){return function u(b,g,f){function e(m,p){if(!g[m]){if(!b[m]){if(c)return c(m,!0);p=Error("Cannot find module '".concat(m,"'"));throw p.code="MODULE_NOT_FOUND", p;}p=g[m]={exports:{}};b[m][0].call(p.exports,function(g){return e(b[m][1][g]||g)},p,p.exports,u,b,g,f)}return g[m].exports}for(var c=!1,p=0;p<f.length;p++)e(f[p]);return e}({1:[function(b,g,f){var e={}.hasOwnProperty,m=function(b,g){function f(){this.constructor=b}for(var m in g)e.call(g,m)&&(b[m]=g[m]);f.prototype=g.prototype;b.prototype=new f;b.__super__=g.prototype;return b};f=b("./PriorityQueue/AbstractPriorityQueue");b=b("./PriorityQueue/ArrayStrategy");f=function(b){function e(b){b||(b={}); b.strategy||(b.strategy=BinaryHeapStrategy);b.comparator||(b.comparator=function(b,e){return(b||0)-(e||0)});e.__super__.constructor.call(this,b)}m(e,b);return e}(f);f.ArrayStrategy=b;g.exports=f},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3}],2:[function(b,g,f){g.exports=function(){function b(b){if(null==(null!=b?b.strategy:void 0))throw"Must pass options.strategy, a strategy";if(null==(null!=b?b.comparator:void 0))throw"Must pass options.comparator, a comparator"; this.priv=new b.strategy(b);this.length=0}b.prototype.queue=function(b){this.length++;this.priv.queue(b)};b.prototype.dequeue=function(b){if(!this.length)throw"Empty queue";this.length--;return this.priv.dequeue()};b.prototype.peek=function(b){if(!this.length)throw"Empty queue";return this.priv.peek()};b.prototype.remove=function(b){this.priv.remove(b)&&--this.length};b.prototype.find=function(b){return 0<=this.priv.find(b)};b.prototype.removeAllMatching=function(b,e){b=this.priv.removeAllMatching(b, e);this.length-=b};return b}()},{}],3:[function(b,g,f){var e=function(b,e,g){var f;var c=0;for(f=b.length;c<f;){var m=c+f>>>1;0<=g(b[m],e)?c=m+1:f=m}return c};g.exports=function(){function b(b){var e;this.options=b;this.comparator=this.options.comparator;this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[];this.data.sort(this.comparator).reverse()}b.prototype.queue=function(b){var g=e(this.data,b,this.comparator);this.data.splice(g,0,b)};b.prototype.dequeue=function(){return this.data.pop()}; b.prototype.peek=function(){return this.data[this.data.length-1]};b.prototype.find=function(b){var g=e(this.data,b,this.comparator)-1;return 0<=g&&!this.comparator(this.data[g],b)?g:-1};b.prototype.remove=function(b){b=this.find(b);return 0<=b?(this.data.splice(b,1),!0):!1};b.prototype.removeAllMatching=function(b,e){for(var g=0,f=this.data.length-1;0<=f;--f)if(b(this.data[f])){var c=this.data.splice(f,1)[0];e&&e(c);++g}return g};return b}()},{}]},{},[1])(1)})},function(c,l,h){(function(f){function c(a, b){this._id=a;this._clearFn=b}var b="undefined"!==typeof f&&f||"undefined"!==typeof self&&self||window,t=Function.prototype.apply;l.setTimeout=function(){return new c(t.call(setTimeout,b,arguments),clearTimeout)};l.setInterval=function(){return new c(t.call(setInterval,b,arguments),clearInterval)};l.clearTimeout=l.clearInterval=function(a){a&&a.close()};c.prototype.unref=c.prototype.ref=function(){};c.prototype.close=function(){this._clearFn.call(b,this._id)};l.enroll=function(a,b){clearTimeout(a._idleTimeoutId); a._idleTimeout=b};l.unenroll=function(a){clearTimeout(a._idleTimeoutId);a._idleTimeout=-1};l._unrefActive=l.active=function(a){clearTimeout(a._idleTimeoutId);var b=a._idleTimeout;0<=b&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},b))};h(21);l.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof f&&f.setImmediate||this&&this.setImmediate;l.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof f&&f.clearImmediate||this&& this.clearImmediate}).call(this,h(10))},function(c,l,h){l.a=function(f){var c={};decodeURIComponent(f.slice(1)).split("&").forEach(function(b){b=b.split("=",2);c[b[0]]=b[1]});return c}},function(c,l){l=function(){return this}();try{l=l||(new Function("return this"))()}catch(h){"object"===typeof window&&(l=window)}c.exports=l},function(c,l,h){h.d(l,"b",function(){return t});h.d(l,"a",function(){return e});var f=h(2),n=h(5),b=h(6),t=function(){return b.b&&!b.a&&!Object(b.c)()},a=function(){function a(a){var b= this;this.promise=a.then(function(a){b.response=a;b.status=200})}a.prototype.addEventListener=function(a,b){this.promise.then(b)};return a}(),e=function(b,e,c){if(t()&&!c)self.Module.instantiateWasm=function(a,g){return Object(n.a)(b+"Wasm.wasm",a,e["Wasm.wasm"]).then(function(a){g(a.instance)})},c=Object(f.b)(b+"Wasm.js.mem",e["Wasm.js.mem"],!1,!1);else{c=Object(f.b)((self.Module.asmjsPrefix?self.Module.asmjsPrefix:"")+b+".js.mem",e[".js.mem"],!1);var g=Object(f.c)((self.Module.memoryInitializerPrefixURL? self.Module.memoryInitializerPrefixURL:"")+b+".mem",e[".mem"],!0,!0);self.Module.memoryInitializerRequest=new a(g)}c=new Blob([c],{type:"application/javascript"});importScripts(URL.createObjectURL(c))}},function(c,l,h){function f(b,f,a,e){function g(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,c){function m(a){try{n(e.next(a))}catch(A){c(A)}}function p(a){try{n(e["throw"](a))}catch(A){c(A)}}function n(b){b.done?a(b.value):g(b.value).then(m,p)}n((e=e.apply(b, f||[])).next())})}function n(b,f){function a(a){return function(b){return e([a,b])}}function e(a){if(c)throw new TypeError("Generator is already executing.");for(;g;)try{if(c=1,n&&(m=a[0]&2?n["return"]:a[0]?n["throw"]||((m=n["return"])&&m.call(n),0):n.next)&&!(m=m.call(n,a[1])).done)return m;if(n=0,m)a=[a[0]&2,m.value];switch(a[0]){case 0:case 1:m=a;break;case 4:return g.label++,{value:a[1],done:!1};case 5:g.label++;n=a[1];a=[0];continue;case 7:a=g.ops.pop();g.trys.pop();continue;default:if(!(m=g.trys, m=0<m.length&&m[m.length-1])&&(6===a[0]||2===a[0])){g=0;continue}if(3===a[0]&&(!m||a[1]>m[0]&&a[1]<m[3]))g.label=a[1];else if(6===a[0]&&g.label<m[1])g.label=m[1],m=a;else if(m&&g.label<m[2])g.label=m[2],g.ops.push(a);else{m[2]&&g.ops.pop();g.trys.pop();continue}}a=f.call(b,g)}catch(v){a=[6,v],n=0}finally{c=m=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var g={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},c,n,m,h;return h={next:a(0),"throw":a(1),"return":a(2)}, "function"===typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h}h.d(l,"a",function(){return f});h.d(l,"b",function(){return n})},function(c,l){function h(){throw Error("setTimeout has not been defined");}function f(){throw Error("clearTimeout has not been defined");}function n(a){if(p===setTimeout)return setTimeout(a,0);if((p===h||!p)&&setTimeout)return p=setTimeout,setTimeout(a,0);try{return p(a,0)}catch(C){try{return p.call(null,a,0)}catch(x){return p.call(this,a,0)}}}function b(a){if(u=== clearTimeout)return clearTimeout(a);if((u===f||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(a);try{return u(a)}catch(C){try{return u.call(null,a)}catch(x){return u.call(this,a)}}}function t(){q&&z&&(q=!1,z.length?m=z.concat(m):v=-1,m.length&&a())}function a(){if(!q){var a=n(t);q=!0;for(var e=m.length;e;){z=m;for(m=[];++v<e;)z&&z[v].run();v=-1;e=m.length}z=null;q=!1;b(a)}}function e(a,b){this.fun=a;this.array=b}function g(){}c=c.exports={};try{var p="function"===typeof setTimeout?setTimeout: h}catch(A){p=h}try{var u="function"===typeof clearTimeout?clearTimeout:f}catch(A){u=f}var m=[],q=!1,z,v=-1;c.nextTick=function(b){var g=Array(arguments.length-1);if(1<arguments.length)for(var f=1;f<arguments.length;f++)g[f-1]=arguments[f];m.push(new e(b,g));1!==m.length||q||n(a)};e.prototype.run=function(){this.fun.apply(null,this.array)};c.title="browser";c.browser=!0;c.env={};c.argv=[];c.version="";c.versions={};c.on=g;c.addListener=g;c.once=g;c.off=g;c.removeListener=g;c.removeAllListeners=g;c.emit= g;c.prependListener=g;c.prependOnceListener=g;c.listeners=function(a){return[]};c.binding=function(a){throw Error("process.binding is not supported");};c.cwd=function(){return"/"};c.chdir=function(a){throw Error("process.chdir is not supported");};c.umask=function(){return 0}},function(c,l,h){l.a=function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(f,c){void 0===f&&(f=0);void 0===c&&(c=this.byteLength);f=Math.floor(f);c=Math.floor(c);0>f&&(f+=this.byteLength);0>c&&(c+=this.byteLength); f=Math.min(Math.max(0,f),this.byteLength);c=Math.min(Math.max(0,c),this.byteLength);if(0>=c-f)return new ArrayBuffer(0);var b=new ArrayBuffer(c-f),n=new Uint8Array(b);f=new Uint8Array(this,f,c-f);n.set(f);return b})}},function(c,l,h){(function(f){function c(a){"function"!==typeof a&&(a=new Function(""+a));for(var b=Array(arguments.length-1),d=0;d<b.length;d++)b[d]=arguments[d+1];z[q]={callback:a,args:b};C(q);return q++}function b(a){delete z[a]}function h(a){if(v)setTimeout(h,0,a);else{var e=z[a]; if(e){v=!0;try{var d=e.callback,k=e.args;switch(k.length){case 0:d();break;case 1:d(k[0]);break;case 2:d(k[0],k[1]);break;case 3:d(k[0],k[1],k[2]);break;default:d.apply(void 0,k)}}finally{b(a),v=!1}}}}function a(){C=function(a){f.nextTick(function(){h(a)})}}function e(){if(m.postMessage&&!m.importScripts){var a=!0,b=m.onmessage;m.onmessage=function(){a=!1};m.postMessage("","*");m.onmessage=b;return a}}function g(){var a="setImmediate$"+Math.random()+"$",b=function(d){d.source!==m&&d.source!==m.parent|| "string"!==typeof d.data||0!==d.data.indexOf(a)||h(+d.data.slice(a.length))};m.addEventListener?m.addEventListener("message",b,!1):m.attachEvent("onmessage",b);C=function(d){m.postMessage(a+d,"*")}}function p(){var a=A.documentElement;C=function(b){var d=A.createElement("script");d.onreadystatechange=function(){h(b);d.onreadystatechange=null;a.removeChild(d);d=null};a.appendChild(d)}}function u(){C=function(a){setTimeout(h,0,a)}}var m="undefined"===typeof window?self:window,q=1,z={},v=!1,A=m.document, C,x=Object.getPrototypeOf&&Object.getPrototypeOf(m);x=x&&x.setTimeout?x:m;"[object process]"==={}.toString.call(m.process)?a():e()?g():A&&"onreadystatechange"in A.createElement("script")?p():u();x.setImmediate=c;x.clearImmediate=b;l.a={setImmediate:c,clearImmediate:b}}).call(this,h(13))},function(c,l,h){var f=h(1);c=function(){function c(b,c){this.name=b;this.comObj=c;this.callbackIndex=1;this.postMessageTransfers=!0;this.callbacksCapabilities={};this.actionHandler={};this.actionHandlerAsync={};this.nextAsync= null;this.actionHandler.console_log=[function(a){Object(f.c)(a)}];this.actionHandler.console_error=[function(a){Object(f.b)(a)}];this.actionHandler.workerLoaded=[function(){}];this.msgHandler=this.handleMessage.bind(this);c.addEventListener("message",this.msgHandler)}c.prototype.on=function(b,c,a){var e=this.actionHandler;e[b]&&Object(f.b)('There is already an actionName called "'+b+'"');e[b]=[c,a]};c.prototype.clearActionHandlers=function(){this.actionHandler={};this.comObj.removeEventListener("message", this.msgHandler)};c.prototype.reset=function(){this.clearActionHandlers();this.comObj.reset&&this.comObj.reset()};c.prototype.replace=function(b,c,a){this.actionHandler[b]=[c,a]};c.prototype.onAsync=function(b,c,a){var e=this.actionHandlerAsync;e[b]&&Object(f.b)('There is already an actionName called "'+b+'"');e[b]=[c,a]};c.prototype.replaceAsync=function(b,c,a){var e=this.actionHandlerAsync,g=this.actionHandler;g[b]&&delete g[b];e[b]=[c,a]};c.prototype.onNextAsync=function(b){this.nextAsync=b};c.prototype.send= function(b,c){this.postMessage({action:b,data:c})};c.prototype.getNextId=function(){return this.callbackIndex++};c.prototype.sendWithPromise=function(b,c,a){var e=this.getNextId();b={action:b,data:c,callbackId:e,priority:a};c=window.createPromiseCapability();this.callbacksCapabilities[e]=c;try{this.postMessage(b)}catch(g){c.reject(g)}return c.promise};c.prototype.sendWithPromiseReturnId=function(b,c,a){var e=this.getNextId();b={action:b,data:c,callbackId:e,priority:a};c=window.createPromiseCapability(); this.callbacksCapabilities[e]=c;try{this.postMessage(b)}catch(g){c.reject(g)}return{promise:c.promise,callbackId:e}};c.prototype.sendWithPromiseWithId=function(b,c,a){c>this.callbackIndex&&Object(f.b)("Can't reuse callbackId "+c+" lesser than callbackIndex "+this.callbackIndex);c in this.callbacksCapabilities&&Object(f.b)("Can't reuse callbackId "+c+". There is a capability waiting to be resolved. ");b={action:b,data:a,callbackId:c};a=window.createPromiseCapability();this.callbacksCapabilities[c]= a;try{this.postMessage(b)}catch(e){a.reject(e)}return a.promise};c.prototype.sendError=function(b,c){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(e){a.hasOwnProperty(e)&&(b[e]=a[e])})}this.postMessage({isReply:!0,callbackId:c,error:b})};c.prototype.getPromise=function(b){if(b in this.callbacksCapabilities)return this.callbacksCapabilities[b];Object(f.b)("Cannot get promise for callback "+ b)};c.prototype.cancelPromise=function(b){if(b in this.callbacksCapabilities){var c=this.callbacksCapabilities[b];delete this.callbacksCapabilities[b];c.reject({type:"Cancelled",message:"Request has been cancelled."});this.postMessage({action:"actionCancel",data:{callbackId:b}})}else Object(f.d)("Cannot cancel callback "+b)};c.prototype.postMessage=function(b){if(this.postMessageTransfers){var c=this.getTransfersArray(b);this.comObj.postMessage(b,c)}else this.comObj.postMessage(b)};c.prototype.getObjectTransfers= function(b,c){var a=this;null!==b&&"object"===typeof b&&(b instanceof Uint8Array?c.push(b.buffer):b instanceof ArrayBuffer?c.push(b):Object.keys(b).forEach(function(e){b.hasOwnProperty(e)&&a.getObjectTransfers(b[e],c)}))};c.prototype.getTransfersArray=function(b){var c=[];this.getObjectTransfers(b,c);return 0===c.length?void 0:c};c.prototype.handleMessage=function(b){var c=this,a=b.data,e=this.actionHandler,g=this.actionHandlerAsync;b=this.callbacksCapabilities;if(a.isReply)e=a.callbackId,e in b? (g=b[e],delete b[e],"error"in a?g.reject(a.error):g.resolve(a.data)):Object(f.a)("Cannot resolve callback "+e);else if(a.action in e){var p=e[a.action];a.callbackId?Promise.resolve().then(function(){return p[0].call(p[1],a.data)}).then(function(b){c.postMessage({isReply:!0,callbackId:a.callbackId,data:b})},function(b){c.sendError(b,a.callbackId)}):p[0].call(p[1],a.data)}else a.action in g?(p=g[a.action],a.callbackId?p[0].call(p[1],a).then(function(b){c.postMessage({isReply:!0,callbackId:a.callbackId, data:b});c.nextAsync()},function(b){c.sendError(b,a.callbackId);c.nextAsync()}):p[0].call(p[1],a).then(function(){c.nextAsync()},function(){c.nextAsync()})):Object(f.b)("Unknown action from worker: "+a.action)};return c}();l.a=c},function(c,l,h){c.exports=h(18)},function(c,l,h){h.r(l);h(6);c=h(14);h(19);h(20);h(23);h(24);h(25);h(26);h(27);Object(c.a)()},function(c,l,h){(function(c){"undefined"===typeof c.crypto&&(c.crypto={getRandomValues:function(c){for(var b=0;b<c.length;b++)c[b]=256*Math.random()}})})("undefined"=== typeof window?self:window)},function(c,l,h){(function(c,n){function b(c){"@babel/helpers - typeof";b="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};return b(c)}(function(c){function a(){for(var a=0;a<D.length;a++)D[a][0](D[a][1]);D=[];K=!1}function e(d,k){D.push([d,k]);K||(K=!0,F(a,0))}function g(a,d){function k(a){m(d,a)}function b(a){z(d,a)} try{a(k,b)}catch(G){b(G)}}function f(a){var d=a.owner,k=d.state_;d=d.data_;var b=a[k];a=a.then;if("function"===typeof b){k=r;try{d=b(d)}catch(G){z(a,G)}}l(a,d)||(k===r&&m(a,d),k===B&&z(a,d))}function l(a,d){var k;try{if(a===d)throw new TypeError("A promises callback cannot return that same promise.");if(d&&("function"===typeof d||"object"===b(d))){var r=d.then;if("function"===typeof r)return r.call(d,function(b){k||(k=!0,d!==b?m(a,b):q(a,b))},function(d){k||(k=!0,z(a,d))}),!0}}catch(G){return k|| z(a,G),!0}return!1}function m(a,d){a!==d&&l(a,d)||q(a,d)}function q(a,b){a.state_===d&&(a.state_=k,a.data_=b,e(A,a))}function z(a,b){a.state_===d&&(a.state_=k,a.data_=b,e(C,a))}function v(a){var d=a.then_;a.then_=void 0;for(a=0;a<d.length;a++)f(d[a])}function A(a){a.state_=r;v(a)}function C(a){a.state_=B;v(a)}function x(a){if("function"!==typeof a)throw new TypeError("Promise constructor takes a function argument");if(!(this instanceof x))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); this.then_=[];g(a,this)}c.createPromiseCapability=function(){var a={};a.promise=new x(function(d,k){a.resolve=d;a.reject=k});return a};var y=c.Promise,E=y&&"resolve"in y&&"reject"in y&&"all"in y&&"race"in y&&function(){var a;new y(function(d){a=d});return"function"===typeof a}();"undefined"!==typeof exports&&exports?(exports.Promise=E?y:x,exports.Polyfill=x):"function"===typeof define&&h(22)?define(function(){return E?y:x}):E||(c.Promise=x);var d="pending",k="sealed",r="fulfilled",B="rejected",w= function(){},F="undefined"!==typeof n?n:setTimeout,D=[],K;x.prototype={constructor:x,state_:d,then_:null,data_:void 0,then:function(a,d){a={owner:this,then:new this.constructor(w),fulfilled:a,rejected:d};this.state_===r||this.state_===B?e(f,a):this.then_.push(a);return a.then},"catch":function(a){return this.then(null,a)}};x.all=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.all().");return new this(function(d,k){function b(a){e++; return function(k){r[a]=k;--e||d(r)}}for(var r=[],e=0,c=0,w;c<a.length;c++)(w=a[c])&&"function"===typeof w.then?w.then(b(c),k):r[c]=w;e||d(r)})};x.race=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.race().");return new this(function(d,k){for(var b=0,r;b<a.length;b++)(r=a[b])&&"function"===typeof r.then?r.then(d,k):d(r)})};x.resolve=function(a){return a&&"object"===b(a)&&a.constructor===this?a:new this(function(d){d(a)})}; x.reject=function(a){return new this(function(d,k){k(a)})}})("undefined"!==typeof window?window:"undefined"!==typeof c?c:"undefined"!==typeof self?self:void 0)}).call(this,h(10),h(8).setImmediate)},function(c,l,h){(function(c,h){(function(b,c){function a(a){delete A[a]}function e(d){if(C)setTimeout(e,0,d);else{var k=A[d];if(k){C=!0;try{var b=k.callback,g=k.args;switch(g.length){case 0:b();break;case 1:b(g[0]);break;case 2:b(g[0],g[1]);break;case 3:b(g[0],g[1],g[2]);break;default:b.apply(c,g)}}finally{a(d), C=!1}}}}function g(){y=function(a){h.nextTick(function(){e(a)})}}function f(){if(b.postMessage&&!b.importScripts){var a=!0,k=b.onmessage;b.onmessage=function(){a=!1};b.postMessage("","*");b.onmessage=k;return a}}function n(){var a="setImmediate$"+Math.random()+"$",k=function(d){d.source===b&&"string"===typeof d.data&&0===d.data.indexOf(a)&&e(+d.data.slice(a.length))};b.addEventListener?b.addEventListener("message",k,!1):b.attachEvent("onmessage",k);y=function(d){b.postMessage(a+d,"*")}}function m(){var a= new MessageChannel;a.port1.onmessage=function(a){e(a.data)};y=function(d){a.port2.postMessage(d)}}function l(){var a=x.documentElement;y=function(d){var k=x.createElement("script");k.onreadystatechange=function(){e(d);k.onreadystatechange=null;a.removeChild(k);k=null};a.appendChild(k)}}function z(){y=function(a){setTimeout(e,0,a)}}if(!b.setImmediate){var v=1,A={},C=!1,x=b.document,y,E=Object.getPrototypeOf&&Object.getPrototypeOf(b);E=E&&E.setTimeout?E:b;"[object process]"==={}.toString.call(b.process)? g():f()?n():b.MessageChannel?m():x&&"onreadystatechange"in x.createElement("script")?l():z();E.setImmediate=function(a){"function"!==typeof a&&(a=new Function(""+a));for(var d=Array(arguments.length-1),b=0;b<d.length;b++)d[b]=arguments[b+1];A[v]={callback:a,args:d};y(v);return v++};E.clearImmediate=a}})("undefined"===typeof self?"undefined"===typeof c?this:c:self)}).call(this,h(10),h(13))},function(c,l){c.exports={}},function(c,l,h){(function(c){var f=function(b,c){var a=function u(a){a=this["catch"](a); return{cancel:c,promise:a,then:e.bind(a),"catch":u.bind(a)}},e=function q(b,e){b=this.then(b,e);return{cancel:c,promise:b,then:q.bind(b),"catch":a.bind(b)}};return{cancel:c,promise:b,then:e.bind(b),"catch":a.bind(b)}};c.CancellablePromise=function(b,c){var a=!1,e,g=new Promise(function(g,f){e=function(){a||(c(),f("cancelled"))};(new Promise(b)).then(function(b){a=!0;g(b)},function(b){a=!0;f(b)})});return f(g,e)};c.CancellablePromise.all=function(b){var c=Promise.all(b);return f(c,function(){b.forEach(function(a){a.cancel&& a.cancel()})})}})("undefined"===typeof self?void 0:self)},function(c,l,h){(function(c,l){var b=h(0);(function(f){f.Module={INITIAL_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,c){Module.workerMessageHandler.send("event",{docId:a,type:b,data:c})},postPagesUpdatedEvent:function(a,b,c,f){a={pageDimensions:Module.GetPageDimensions(a)};if(c)for(var e=0;e<c.length;++e)c[e]in a.pageDimensions?(a.pageDimensions[c[e]].contentChanged=!0,f&&(a.pageDimensions[c[e]].annotationsUnchanged=!0)):console.warn("Invalid Page Number ".concat(c[e]));Module.postEvent(b,"pagesUpdated",a);return a},GetIndividualPageDimensions:function(a,b,c){a=Module.PageGetPageInfo(c);a.id=Module.PageGetId(c);return a},GetPageDimensionsRange:function(a,b,c){for(var e={},g=Module.PDFDocGetPageIterator(a,b);b<c&&Module.IteratorHasNext(g);++b){var f=Module.stackSave(),h=Module.IteratorCurrent(g);e[b]=this.GetIndividualPageDimensions(a, b,h);Module.IteratorNext(g);Module.stackRestore(f)}return e},GetPageDimensions:function(a){try{var b=Module.stackSave();var c=Module.GetPageCount(a);if(0===c)throw"This document has no pages.";return Module.GetPageDimensionsRange(a,1,c+1)}finally{Module.stackRestore(b)}},loadDoc:function(a,b){"undefined"===typeof Module&&this._main();var c=null;try{var e=Module.stackSave();b=Module.CreateDoc(a,b);var f=Module.GetDoc(b);if(Module.PDFDocInitSecurityHandler(f))return{docId:b,pageDimensions:Module.GetPageDimensions(f)}; c={type:"NeedsPassword",errorData:{docId:b},message:"This document requires a password"}}catch(m){c={type:"InvalidPDF",message:m}}finally{Module.stackRestore(e)}throw c;},loadCanvas:function(a,b,c,f,h,m,l,n){return new Promise(function(e,g){var p=Module.GetDoc(a),v=b+1,q=function(){e(Module.RasterizePage(p,v,c,f,m,h,l,n))},u=Module.docs[a].chunkStorage;if(u){var d=Module.GetDownloadData(p).downloader,k=u.getRequiredChunkOffsetArrays(d,v);u.keepChunks(k.have);d=function(){var a=u.getChunks(k.missing); Module.loadPromise=a.then(function(){var a=Module.loadPromise.cancelled;Module.loadPromise=null;a||q()})["catch"](function(a){"cancelled"!==a?g(a):Module.loadPromise=null})};Module.loadPromise?Module.loadPromise.then(d,d):d()}else q()})},loadResources:function(a,c){Module.Initialize(c);Object(b.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(a){a.PDFDocExportXFDF=function(a,b){a=Module.GetDoc(a);var c=Module.stackSave();try{var e=b?Module.PDFDocFDFExtract(a,b):Module.PDFDocFDFExtract(a);var g=Module.FDFDocSaveAsXFDF(e);Module.stackRestore(c)}catch(q){throw Module.stackRestore(c),q;}return g};a.PageArrayToPageSet=function(a){var b=Module.stackSave();try{var c=Module.PageSetCreate();for(var e=0;e<a.length;++e)Module.PageSetAddPage(c,a[e]);Module.stackRestore(b)}catch(m){throw Module.stackRestore(b), m;}return c};a.cancelCurrent=function(){var a=Module.loadPromise;return a?(a.cancel(),a.cancelled=!0):(a=Module.cleanupState)?(c(a.timeout),a.cleanupArr.forEach(function(a){a()}),Module.cleanupState=null,!0):!1};a.SetWorkerRestartCallback=function(a){Module.workerRestartCallback=a};a.XFDFMerge=function(a,c,f){if(c){var e=[];try{Object(b.b)("worker","Merge XFDF of length ".concat(c.length));var g=Module.GetUStringFromJSString(c,!0);e.push(function(){Module.UStringDestroy(g)});var h=Module.allocate(4, "i8",Module.ALLOC_STACK);REX(Module._TRN_FDFDocCreateFromXFDF(g,h));var l=Module.getValue(h,"i8*");e.push(function(){Module.FDFDocDestroy(l)});Module.PDFDocFDFUpdate(a,l,f)}finally{e.forEach(function(a){a()})}}};a.MergeXFDF=function(a,b,c){return new Promise(function(e,f){var g=[];try{var m=Module.stackSave();g[g.length]=function(){Module.stackRestore(m)};var h=Module.GetDoc(a);Module.XFDFMerge(h,b,c);g.forEach(function(a){a()});e({})}catch(A){g.forEach(function(a){a()}),f(A)}})};a.CreateBufferFile= function(a,b,c){Module.MakeDev(a);var e=new ArrayBuffer(b);e=new Uint8Array(e);c=c?0:255;for(var f=0;f<b;++f)e[f]=c;Module.docs[a]={buffer:e}};a.ReadBufferFile=function(a,b){var c=Module.docs[a].buffer;b&&(Module.docs[a].buffer=new Uint8Array(c.buffer.slice(0)));return c};a.RemoveBufferFile=function(a){Module.docs[a]=null};a.SaveHelper=function(a,b,c){c="undefined"===typeof c?2:c;Module.MakeDev(b);a=Module._TRN_PDFDocSave(a,Module.GetUStringFromJSString(b),c,0);Module.docs[b].sink=null;REX(a);return Module.docs[b].buffer.buffer}; a.SaveDoc=function(a,b,c,h,m,l,n){return new Promise(function(e,g){var p=[];try{var v=Module.GetDoc(a),y=Module.stackSave();p[p.length]=function(){Module.stackRestore(y)};Module.XFDFMerge(v,b,n);for(var q=Module.PDFDocGetPageIterator(v,1);Module.IteratorHasNext(q);){var d=Module.IteratorCurrent(q);try{for(var k=Module.PageGetNumAnnots(d);0<k;){var r=Module.PageGetAnnot(d,--k);Module.AnnotHasAppearance(r)||Module.AnnotRefreshAppearance(r)}}catch(H){console.warn(H)}Module.IteratorNext(q)}if(l){d=function(a){a= new Uint8Array(a);f.FS.writeFile("watermarkFile",a);a=Module.ImageCreateFromFile(v,Module.GetUStringFromJSString("watermarkFile"));f.FS.unlink("watermarkFile");return a};var B=Module.ElementBuilderCreate();p.push(function(){Module.ElementBuilderDestroy(B)});var w=Module.ElementWriterCreate();p.push(function(){Module.ElementWriterDestroy(w)});try{if(!l.hasOwnProperty("default"))throw Error("Watermark dictionary has no 'default' key!");var F=d(l["default"]);q=Module.PDFDocGetPageIterator(v,1);for(k= -1;Module.IteratorHasNext(q);){currentPage=Module.IteratorCurrent(q);Module.IteratorNext(q);k++;var D=k.toString();try{r=void 0;if(l.hasOwnProperty(D)){var A=l[D];if(A)r=d(A);else continue}else r=F;var z=Module.PageGetPageInfo(currentPage),u=Module.ElementBuilderCreateImage(B,r,0,0,z.width,z.height);Module.ElementWriterBegin(w,currentPage);Module.ElementWriterWritePlacedElement(w,u);Module.ElementWriterEnd(w)}catch(H){console.warn("Watermark for page "+D+"can not be added due to error: "+H)}}}catch(H){console.warn("Watermarks can not be added due to error: "+ H)}}q=0;if(h){var t=Module.PDFDocGetRoot(v);(q=Module.ObjFindObj(t,"OpenAction"))&&Module.ObjPut(t,"__OpenActionBackup__",q);var I=Module.ObjPutDict(t,"OpenAction");Module.ObjPutName(I,"Type","Action");Module.ObjPutName(I,"S","JavaScript");Module.ObjPutString(I,"JS","this.print()")}var G=Module.SaveHelper(v,a,m);h&&(q?Module.ObjPut(t,"OpenAction",Module.ObjFindObj(t,"__OpenActionBackup__")):Module.ObjErase(t,"OpenAction"));p.forEach(function(a){a()});if(c)e({fileData:G});else{var L=G.slice(0);e({fileData:L})}}catch(H){p.forEach(function(a){a()}), g(H)}})};a.SaveDocFromFixedElements=function(a,