@pdftron/webviewer 11.9.0-20251021 → 11.9.0-20251022
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,282 +1,282 @@
|
|
|
1
1
|
(function(){/*
|
|
2
2
|
@license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
3
|
-
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(v){var
|
|
4
|
-
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(v,
|
|
5
|
-
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(v,
|
|
6
|
-
$jscomp.polyfill=function(v,
|
|
7
|
-
$jscomp.polyfillIsolated=function(v,
|
|
8
|
-
$jscomp.global.Symbol(n):$jscomp.POLYFILL_PREFIX+u+"$"+n),$jscomp.defineProperty(
|
|
9
|
-
$jscomp.polyfill("Symbol",function(v){if(v)return v;var
|
|
10
|
-
$jscomp.polyfill("Symbol.iterator",function(v){if(v)return v;v=Symbol("Symbol.iterator");for(var
|
|
11
|
-
"es3");$jscomp.iteratorPrototype=function(v){v={next:v};v[Symbol.iterator]=function(){return this};return v};$jscomp.makeIterator=function(v){var
|
|
12
|
-
$jscomp.arrayFromIterable=function(v){return v instanceof Array?v:$jscomp.arrayFromIterator($jscomp.makeIterator(v))};$jscomp.checkEs6ConformanceViaProxy=function(){try{var v={},
|
|
13
|
-
$jscomp.owns=function(v,
|
|
14
|
-
$jscomp.polyfill("WeakMap",function(v){function
|
|
15
|
-
function(
|
|
16
|
-
n(m);if(!$jscomp.owns(m,l))throw Error("WeakMap key fail: "+m);m[l][this.id_]=
|
|
17
|
-
$jscomp.polyfill("Map",function(v){function
|
|
18
|
-
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(v&&$jscomp.ES6_CONFORMANCE)return v}else if(
|
|
19
|
-
this.head_.previous.next=
|
|
20
|
-
n(this,c).entry)&&c.value};
|
|
21
|
-
(
|
|
22
|
-
return
|
|
23
|
-
$jscomp.polyfill("Promise",function(v){function
|
|
24
|
-
var
|
|
25
|
-
try{l(t.resolve,t.reject)}catch(c){t.reject(c)}};n.prototype.createResolveAndReject_=function(){function l(m){return function(
|
|
3
|
+
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(v){var B=0;return function(){return B<v.length?{done:!1,value:v[B++]}:{done:!0}}};$jscomp.arrayIterator=function(v){return{next:$jscomp.arrayIteratorImpl(v)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
|
|
4
|
+
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(v,B,u){if(v==Array.prototype||v==Object.prototype)return v;v[B]=u.value;return v};$jscomp.getGlobal=function(v){v=["object"==typeof globalThis&&globalThis,v,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var B=0;B<v.length;++B){var u=v[B];if(u&&u.Math==Math)return u}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
|
5
|
+
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(v,B,u){if(!u||null!=v){u=$jscomp.propertyToPolyfillSymbol[B];if(null==u)return v[B];u=v[u];return void 0!==u?u:v[B]}};
|
|
6
|
+
$jscomp.polyfill=function(v,B,u,q){B&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(v,B,u,q):$jscomp.polyfillUnisolated(v,B,u,q))};$jscomp.polyfillUnisolated=function(v,B,u,q){u=$jscomp.global;v=v.split(".");for(q=0;q<v.length-1;q++){var n=v[q];if(!(n in u))return;u=u[n]}v=v[v.length-1];q=u[v];B=B(q);B!=q&&null!=B&&$jscomp.defineProperty(u,v,{configurable:!0,writable:!0,value:B})};
|
|
7
|
+
$jscomp.polyfillIsolated=function(v,B,u,q){var n=v.split(".");v=1===n.length;q=n[0];q=!v&&q in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var x=0;x<n.length-1;x++){var l=n[x];if(!(l in q))return;q=q[l]}n=n[n.length-1];u=$jscomp.IS_SYMBOL_NATIVE&&"es6"===u?q[n]:null;B=B(u);null!=B&&(v?$jscomp.defineProperty($jscomp.polyfills,n,{configurable:!0,writable:!0,value:B}):B!==u&&(void 0===$jscomp.propertyToPolyfillSymbol[n]&&(u=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[n]=$jscomp.IS_SYMBOL_NATIVE?
|
|
8
|
+
$jscomp.global.Symbol(n):$jscomp.POLYFILL_PREFIX+u+"$"+n),$jscomp.defineProperty(q,$jscomp.propertyToPolyfillSymbol[n],{configurable:!0,writable:!0,value:B})))};$jscomp.initSymbol=function(){};
|
|
9
|
+
$jscomp.polyfill("Symbol",function(v){if(v)return v;var B=function(x,l){this.$jscomp$symbol$id_=x;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:l})};B.prototype.toString=function(){return this.$jscomp$symbol$id_};var u="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",q=0,n=function(x){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return new B(u+(x||"")+"_"+q++,x)};return n},"es6","es3");
|
|
10
|
+
$jscomp.polyfill("Symbol.iterator",function(v){if(v)return v;v=Symbol("Symbol.iterator");for(var B="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),u=0;u<B.length;u++){var q=$jscomp.global[B[u]];"function"===typeof q&&"function"!=typeof q.prototype[v]&&$jscomp.defineProperty(q.prototype,v,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return v},"es6",
|
|
11
|
+
"es3");$jscomp.iteratorPrototype=function(v){v={next:v};v[Symbol.iterator]=function(){return this};return v};$jscomp.makeIterator=function(v){var B="undefined"!=typeof Symbol&&Symbol.iterator&&v[Symbol.iterator];if(B)return B.call(v);if("number"==typeof v.length)return $jscomp.arrayIterator(v);throw Error(String(v)+" is not an iterable or ArrayLike");};$jscomp.arrayFromIterator=function(v){for(var B,u=[];!(B=v.next()).done;)u.push(B.value);return u};
|
|
12
|
+
$jscomp.arrayFromIterable=function(v){return v instanceof Array?v:$jscomp.arrayFromIterator($jscomp.makeIterator(v))};$jscomp.checkEs6ConformanceViaProxy=function(){try{var v={},B=Object.create(new $jscomp.global.Proxy(v,{get:function(u,q,n){return u==v&&"q"==q&&n==B}}));return!0===B.q}catch(u){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();
|
|
13
|
+
$jscomp.owns=function(v,B){return Object.prototype.hasOwnProperty.call(v,B)};
|
|
14
|
+
$jscomp.polyfill("WeakMap",function(v){function B(){if(!v||!Object.seal)return!1;try{var m=Object.seal({}),k=Object.seal({}),h=new v([[m,2],[k,3]]);if(2!=h.get(m)||3!=h.get(k))return!1;h.delete(m);h.set(k,4);return!h.has(m)&&4==h.get(k)}catch(f){return!1}}function u(){}function q(m){var k=typeof m;return"object"===k&&null!==m||"function"===k}function n(m){if(!$jscomp.owns(m,l)){var k=new u;$jscomp.defineProperty(m,l,{value:k})}}function x(m){if(!$jscomp.ISOLATE_POLYFILLS){var k=Object[m];k&&(Object[m]=
|
|
15
|
+
function(h){if(h instanceof u)return h;Object.isExtensible(h)&&n(h);return k(h)})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(v&&$jscomp.ES6_CONFORMANCE)return v}else if(B())return v;var l="$jscomp_hidden_"+Math.random();x("freeze");x("preventExtensions");x("seal");var t=0,c=function(m){this.id_=(t+=Math.random()+1).toString();if(m){m=$jscomp.makeIterator(m);for(var k;!(k=m.next()).done;)k=k.value,this.set(k[0],k[1])}};c.prototype.set=function(m,k){if(!q(m))throw Error("Invalid WeakMap key");
|
|
16
|
+
n(m);if(!$jscomp.owns(m,l))throw Error("WeakMap key fail: "+m);m[l][this.id_]=k;return this};c.prototype.get=function(m){return q(m)&&$jscomp.owns(m,l)?m[l][this.id_]:void 0};c.prototype.has=function(m){return q(m)&&$jscomp.owns(m,l)&&$jscomp.owns(m[l],this.id_)};c.prototype.delete=function(m){return q(m)&&$jscomp.owns(m,l)&&$jscomp.owns(m[l],this.id_)?delete m[l][this.id_]:!1};return c},"es6","es3");$jscomp.MapEntry=function(){};
|
|
17
|
+
$jscomp.polyfill("Map",function(v){function B(){if($jscomp.ASSUME_NO_NATIVE_MAP||!v||"function"!=typeof v||!v.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),m=new v($jscomp.makeIterator([[c,"s"]]));if("s"!=m.get(c)||1!=m.size||m.get({x:4})||m.set({x:4},"t")!=m||2!=m.size)return!1;var k=m.entries(),h=k.next();if(h.done||h.value[0]!=c||"s"!=h.value[1])return!1;h=k.next();return h.done||4!=h.value[0].x||"t"!=h.value[1]||!k.next().done?!1:!0}catch(f){return!1}}
|
|
18
|
+
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(v&&$jscomp.ES6_CONFORMANCE)return v}else if(B())return v;var u=new WeakMap,q=function(c){this.data_={};this.head_=l();this.size=0;if(c){c=$jscomp.makeIterator(c);for(var m;!(m=c.next()).done;)m=m.value,this.set(m[0],m[1])}};q.prototype.set=function(c,m){c=0===c?0:c;var k=n(this,c);k.list||(k.list=this.data_[k.id]=[]);k.entry?k.entry.value=m:(k.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:c,value:m},k.list.push(k.entry),
|
|
19
|
+
this.head_.previous.next=k.entry,this.head_.previous=k.entry,this.size++);return this};q.prototype.delete=function(c){c=n(this,c);return c.entry&&c.list?(c.list.splice(c.index,1),c.list.length||delete this.data_[c.id],c.entry.previous.next=c.entry.next,c.entry.next.previous=c.entry.previous,c.entry.head=null,this.size--,!0):!1};q.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=l();this.size=0};q.prototype.has=function(c){return!!n(this,c).entry};q.prototype.get=function(c){return(c=
|
|
20
|
+
n(this,c).entry)&&c.value};q.prototype.entries=function(){return x(this,function(c){return[c.key,c.value]})};q.prototype.keys=function(){return x(this,function(c){return c.key})};q.prototype.values=function(){return x(this,function(c){return c.value})};q.prototype.forEach=function(c,m){for(var k=this.entries(),h;!(h=k.next()).done;)h=h.value,c.call(m,h[1],h[0],this)};q.prototype[Symbol.iterator]=q.prototype.entries;var n=function(c,m){var k=m&&typeof m;"object"==k||"function"==k?u.has(m)?k=u.get(m):
|
|
21
|
+
(k=""+ ++t,u.set(m,k)):k="p_"+m;var h=c.data_[k];if(h&&$jscomp.owns(c.data_,k))for(c=0;c<h.length;c++){var f=h[c];if(m!==m&&f.key!==f.key||m===f.key)return{id:k,list:h,index:c,entry:f}}return{id:k,list:h,index:-1,entry:void 0}},x=function(c,m){var k=c.head_;return $jscomp.iteratorPrototype(function(){if(k){for(;k.head!=c.head_;)k=k.previous;for(;k.next!=k.head;)return k=k.next,{done:!1,value:m(k)};k=null}return{done:!0,value:void 0}})},l=function(){var c={};return c.previous=c.next=c.head=c},t=0;
|
|
22
|
+
return q},"es6","es3");
|
|
23
|
+
$jscomp.polyfill("Promise",function(v){function B(){this.batch_=null}function u(l){return l instanceof n?l:new n(function(t,c){t(l)})}if(v&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&"undefined"===typeof $jscomp.global.PromiseRejectionEvent)||!$jscomp.global.Promise||-1===$jscomp.global.Promise.toString().indexOf("[native code]")))return v;B.prototype.asyncExecute=function(l){if(null==this.batch_){this.batch_=[];var t=this;this.asyncExecuteFunction(function(){t.executeBatch_()})}this.batch_.push(l)};
|
|
24
|
+
var q=$jscomp.global.setTimeout;B.prototype.asyncExecuteFunction=function(l){q(l,0)};B.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var l=this.batch_;this.batch_=[];for(var t=0;t<l.length;++t){var c=l[t];l[t]=null;try{c()}catch(m){this.asyncThrow_(m)}}}this.batch_=null};B.prototype.asyncThrow_=function(l){this.asyncExecuteFunction(function(){throw l;})};var n=function(l){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];this.isRejectionHandled_=!1;var t=this.createResolveAndReject_();
|
|
25
|
+
try{l(t.resolve,t.reject)}catch(c){t.reject(c)}};n.prototype.createResolveAndReject_=function(){function l(m){return function(k){c||(c=!0,m.call(t,k))}}var t=this,c=!1;return{resolve:l(this.resolveTo_),reject:l(this.reject_)}};n.prototype.resolveTo_=function(l){if(l===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(l instanceof n)this.settleSameAsPromise_(l);else{a:switch(typeof l){case "object":var t=null!=l;break a;case "function":t=!0;break a;default:t=!1}t?this.resolveToNonPromiseObj_(l):
|
|
26
26
|
this.fulfill_(l)}};n.prototype.resolveToNonPromiseObj_=function(l){var t=void 0;try{t=l.then}catch(c){this.reject_(c);return}"function"==typeof t?this.settleSameAsThenable_(t,l):this.fulfill_(l)};n.prototype.reject_=function(l){this.settle_(2,l)};n.prototype.fulfill_=function(l){this.settle_(1,l)};n.prototype.settle_=function(l,t){if(0!=this.state_)throw Error("Cannot settle("+l+", "+t+"): Promise already settled in state"+this.state_);this.state_=l;this.result_=t;2===this.state_&&this.scheduleUnhandledRejectionCheck_();
|
|
27
|
-
this.executeOnSettledCallbacks_()};n.prototype.scheduleUnhandledRejectionCheck_=function(){var l=this;
|
|
28
|
-
"function"===typeof t?l=new t("unhandledrejection",{cancelable:!0}):(l=$jscomp.global.document.createEvent("CustomEvent"),l.initCustomEvent("unhandledrejection",!1,!0,l));l.promise=this;l.reason=this.result_;return c(l)};n.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var l=0;l<this.onSettledCallbacks_.length;++l)
|
|
29
|
-
l.callWhenSettled_(t.resolve,t.reject)};n.prototype.settleSameAsThenable_=function(l,t){var c=this.createResolveAndReject_();try{l.call(t,c.resolve,c.reject)}catch(m){c.reject(m)}};n.prototype.then=function(l,t){function c(
|
|
30
|
-
break;case 2:t(m.result_);break;default:throw Error("Unexpected state: "+m.state_);}}var m=this;null==this.onSettledCallbacks_?
|
|
31
|
-
|
|
32
|
-
$jscomp.polyfill("Array.from",function(v){return v?v:function(
|
|
33
|
-
$jscomp.checkStringArgs=function(v,
|
|
34
|
-
$jscomp.polyfill("String.prototype.endsWith",function(v){return v?v:function(
|
|
35
|
-
$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(v,
|
|
36
|
-
$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(v,
|
|
37
|
-
$jscomp.polyfill("Array.prototype.find",function(v){return v?v:function(
|
|
38
|
-
$jscomp.polyfill("Set",function(v){function
|
|
39
|
-
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(v&&$jscomp.ES6_CONFORMANCE)return v}else if(
|
|
40
|
-
function(
|
|
41
|
-
$jscomp.iteratorFromArray=function(v,
|
|
42
|
-
(function(v){function
|
|
43
|
-
var
|
|
44
|
-
u.d(
|
|
45
|
-
u.d(
|
|
46
|
-
function(v,
|
|
47
|
-
c="undefined"===typeof window?self:window,m=c.importScripts,
|
|
48
|
-
|
|
49
|
-
this.arrays,d=0,
|
|
50
|
-
this.status||0===this.status?
|
|
51
|
-
m&&Object(n.a)("worker","Decompressed length is ".concat(E.length));
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}}return
|
|
55
|
-
|
|
56
|
-
r[1],r=
|
|
57
|
-
|
|
58
|
-
Object(
|
|
59
|
-
var
|
|
60
|
-
parseInt(
|
|
61
|
-
var
|
|
62
|
-
parseInt(null===(
|
|
63
|
-
14<=parseInt(n.navigator.userAgent.match(/(iPad|iPhone).+\sOS\s((\d+)(_\d)*)/i)[3],10):!1,
|
|
64
|
-
{createHTML:function(r){return n.a.sanitize(r,Object(
|
|
65
|
-
(r=l())||void 0===r?0:r.createPolicy)r="".concat(
|
|
66
|
-
c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},
|
|
67
|
-
for(var r=!1,
|
|
68
|
-
|
|
69
|
-
this.length--;return this.priv.dequeue()};
|
|
70
|
-
function(){function
|
|
71
|
-
r)?
|
|
72
|
-
|
|
73
|
-
0<=c&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},c))};u(25);
|
|
74
|
-
"WASM compilation took ".concat(Date.now()-NaN," ms"));return
|
|
75
|
-
!0,!0).then(function(
|
|
76
|
-
arguments.length,U=Array(1<S?S-1:0),W=1;W<S;W++)U[W-1]=arguments[W];return F(T,O,U)}}function n(T,O){var S=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b;
|
|
77
|
-
0;na<W.length;na++)E(W,na)||(W[na]=null);O[U]=W}else O[U]=W&&"object"===typeof W&&W.constructor===Object?
|
|
27
|
+
this.executeOnSettledCallbacks_()};n.prototype.scheduleUnhandledRejectionCheck_=function(){var l=this;q(function(){if(l.notifyUnhandledRejection_()){var t=$jscomp.global.console;"undefined"!==typeof t&&t.error(l.result_)}},1)};n.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var l=$jscomp.global.CustomEvent,t=$jscomp.global.Event,c=$jscomp.global.dispatchEvent;if("undefined"===typeof c)return!0;"function"===typeof l?l=new l("unhandledrejection",{cancelable:!0}):
|
|
28
|
+
"function"===typeof t?l=new t("unhandledrejection",{cancelable:!0}):(l=$jscomp.global.document.createEvent("CustomEvent"),l.initCustomEvent("unhandledrejection",!1,!0,l));l.promise=this;l.reason=this.result_;return c(l)};n.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var l=0;l<this.onSettledCallbacks_.length;++l)x.asyncExecute(this.onSettledCallbacks_[l]);this.onSettledCallbacks_=null}};var x=new B;n.prototype.settleSameAsPromise_=function(l){var t=this.createResolveAndReject_();
|
|
29
|
+
l.callWhenSettled_(t.resolve,t.reject)};n.prototype.settleSameAsThenable_=function(l,t){var c=this.createResolveAndReject_();try{l.call(t,c.resolve,c.reject)}catch(m){c.reject(m)}};n.prototype.then=function(l,t){function c(f,r){return"function"==typeof f?function(A){try{m(f(A))}catch(e){k(e)}}:r}var m,k,h=new n(function(f,r){m=f;k=r});this.callWhenSettled_(c(l,m),c(t,k));return h};n.prototype.catch=function(l){return this.then(void 0,l)};n.prototype.callWhenSettled_=function(l,t){function c(){switch(m.state_){case 1:l(m.result_);
|
|
30
|
+
break;case 2:t(m.result_);break;default:throw Error("Unexpected state: "+m.state_);}}var m=this;null==this.onSettledCallbacks_?x.asyncExecute(c):this.onSettledCallbacks_.push(c);this.isRejectionHandled_=!0};n.resolve=u;n.reject=function(l){return new n(function(t,c){c(l)})};n.race=function(l){return new n(function(t,c){for(var m=$jscomp.makeIterator(l),k=m.next();!k.done;k=m.next())u(k.value).callWhenSettled_(t,c)})};n.all=function(l){var t=$jscomp.makeIterator(l),c=t.next();return c.done?u([]):new n(function(m,
|
|
31
|
+
k){function h(A){return function(e){f[A]=e;r--;0==r&&m(f)}}var f=[],r=0;do f.push(void 0),r++,u(c.value).callWhenSettled_(h(f.length-1),k),c=t.next();while(!c.done)})};return n},"es6","es3");
|
|
32
|
+
$jscomp.polyfill("Array.from",function(v){return v?v:function(B,u,q){u=null!=u?u:function(t){return t};var n=[],x="undefined"!=typeof Symbol&&Symbol.iterator&&B[Symbol.iterator];if("function"==typeof x){B=x.call(B);for(var l=0;!(x=B.next()).done;)n.push(u.call(q,x.value,l++))}else for(x=B.length,l=0;l<x;l++)n.push(u.call(q,B[l],l));return n}},"es6","es3");
|
|
33
|
+
$jscomp.checkStringArgs=function(v,B,u){if(null==v)throw new TypeError("The 'this' value for String.prototype."+u+" must not be null or undefined");if(B instanceof RegExp)throw new TypeError("First argument to String.prototype."+u+" must not be a regular expression");return v+""};
|
|
34
|
+
$jscomp.polyfill("String.prototype.endsWith",function(v){return v?v:function(B,u){var q=$jscomp.checkStringArgs(this,B,"endsWith");B+="";void 0===u&&(u=q.length);u=Math.max(0,Math.min(u|0,q.length));for(var n=B.length;0<n&&0<u;)if(q[--u]!=B[--n])return!1;return 0>=n}},"es6","es3");$jscomp.underscoreProtoCanBeSet=function(){var v={a:!0},B={};try{return B.__proto__=v,B.a}catch(u){}return!1};
|
|
35
|
+
$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(v,B){v.__proto__=B;if(v.__proto__!==B)throw new TypeError(v+" is not extensible");return v}:null;$jscomp.polyfill("Object.setPrototypeOf",function(v){return v||$jscomp.setPrototypeOf},"es6","es5");
|
|
36
|
+
$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(v,B){for(var u=1;u<arguments.length;u++){var q=arguments[u];if(q)for(var n in q)$jscomp.owns(q,n)&&(v[n]=q[n])}return v};$jscomp.polyfill("Object.assign",function(v){return v||$jscomp.assign},"es6","es3");$jscomp.findInternal=function(v,B,u){v instanceof String&&(v=String(v));for(var q=v.length,n=0;n<q;n++){var x=v[n];if(B.call(u,x,n,v))return{i:n,v:x}}return{i:-1,v:void 0}};
|
|
37
|
+
$jscomp.polyfill("Array.prototype.find",function(v){return v?v:function(B,u){return $jscomp.findInternal(this,B,u).v}},"es6","es3");
|
|
38
|
+
$jscomp.polyfill("Set",function(v){function B(){if($jscomp.ASSUME_NO_NATIVE_SET||!v||"function"!=typeof v||!v.prototype.entries||"function"!=typeof Object.seal)return!1;try{var q=Object.seal({x:4}),n=new v($jscomp.makeIterator([q]));if(!n.has(q)||1!=n.size||n.add(q)!=n||1!=n.size||n.add({x:4})!=n||2!=n.size)return!1;var x=n.entries(),l=x.next();if(l.done||l.value[0]!=q||l.value[1]!=q)return!1;l=x.next();return l.done||l.value[0]==q||4!=l.value[0].x||l.value[1]!=l.value[0]?!1:x.next().done}catch(t){return!1}}
|
|
39
|
+
if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(v&&$jscomp.ES6_CONFORMANCE)return v}else if(B())return v;var u=function(q){this.map_=new Map;if(q){q=$jscomp.makeIterator(q);for(var n;!(n=q.next()).done;)this.add(n.value)}this.size=this.map_.size};u.prototype.add=function(q){q=0===q?0:q;this.map_.set(q,q);this.size=this.map_.size;return this};u.prototype.delete=function(q){q=this.map_.delete(q);this.size=this.map_.size;return q};u.prototype.clear=function(){this.map_.clear();this.size=0};u.prototype.has=
|
|
40
|
+
function(q){return this.map_.has(q)};u.prototype.entries=function(){return this.map_.entries()};u.prototype.values=function(){return this.map_.values()};u.prototype.keys=u.prototype.values;u.prototype[Symbol.iterator]=u.prototype.values;u.prototype.forEach=function(q,n){var x=this;this.map_.forEach(function(l){return q.call(n,l,l,x)})};return u},"es6","es3");
|
|
41
|
+
$jscomp.iteratorFromArray=function(v,B){v instanceof String&&(v+="");var u=0,q=!1,n={next:function(){if(!q&&u<v.length){var x=u++;return{value:B(x,v[x]),done:!1}}q=!0;return{done:!0,value:void 0}}};n[Symbol.iterator]=function(){return n};return n};$jscomp.polyfill("Array.prototype.keys",function(v){return v?v:function(){return $jscomp.iteratorFromArray(this,function(B){return B})}},"es6","es3");
|
|
42
|
+
(function(v){function B(q){if(u[q])return u[q].exports;var n=u[q]={i:q,l:!1,exports:{}};v[q].call(n.exports,n,n.exports,B);n.l=!0;return n.exports}var u={};B.m=v;B.c=u;B.d=function(q,n,x){B.o(q,n)||Object.defineProperty(q,n,{enumerable:!0,get:x})};B.r=function(q){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(q,Symbol.toStringTag,{value:"Module"});Object.defineProperty(q,"__esModule",{value:!0})};B.t=function(q,n){n&1&&(q=B(q));if(n&8||n&4&&"object"===typeof q&&q&&q.__esModule)return q;
|
|
43
|
+
var x=Object.create(null);B.r(x);Object.defineProperty(x,"default",{enumerable:!0,value:q});if(n&2&&"string"!=typeof q)for(var l in q)B.d(x,l,function(t){return q[t]}.bind(null,l));return x};B.n=function(q){var n=q&&q.__esModule?function(){return q["default"]}:function(){return q};B.d(n,"a",n);return n};B.o=function(q,n){return Object.prototype.hasOwnProperty.call(q,n)};B.p="/core/pdf/";return B(B.s=21)})([function(v,B,u){u.d(B,"d",function(){return x});u.d(B,"e",function(){return n});u.d(B,"c",function(){return l});
|
|
44
|
+
u.d(B,"a",function(){return t});u.d(B,"b",function(){return c});var q=u(2),n=function(m,k){Object(q.a)("disableLogs")||(k?console.warn("".concat(m,": ").concat(k)):console.warn(m))},x=function(m,k){Object(q.a)("disableLogs")||(k?console.log("".concat(m,": ").concat(k)):console.log(m))},l=function(m){if(!Object(q.a)("disableLogs"))throw console.error(m),Error(m);},t=function(m,k){},c=function(m,k){}},function(v,B,u){u.d(B,"c",function(){return c});u.d(B,"a",function(){return m});u.d(B,"b",function(){return k});
|
|
45
|
+
u.d(B,"d",function(){return h});var q=u(16),n=console.log,x=console.warn,l=console.error,t=function(f){void 0===f&&(f=!0);f?(console.log=function(){},console.warn=function(){},console.error=function(){}):(console.log=n,console.warn=x,console.error=l)},c=function(){var f=Object(q.a)(location.search);t("1"===f.disableLogs)},m=function(f){f.on("disableLogs",function(r){t(r.disabled)})},k=function(f,r){return function(){}},h=function(f,r){r?console.warn("".concat(f,": ").concat(r)):console.warn(f)}},
|
|
46
|
+
function(v,B,u){u.d(B,"a",function(){return x});u.d(B,"b",function(){return l});var q={},n={flattenedResources:!1,CANVAS_CACHE_SIZE:void 0,maxPagesBefore:void 0,maxPagesAhead:void 0,disableLogs:!1,wvsQueryParameters:{},_trnDebugMode:!1,_logFiltersEnabled:null},x=function(t){return n[t]},l=function(t,c){var m;n[t]=c;null===(m=q[t])||void 0===m?void 0:m.forEach(function(k){k(c)})}},function(v,B,u){u.d(B,"a",function(){return D});u.d(B,"b",function(){return H});var q=u(4),n=u(0),x=u(5),l=u(6),t=u(8),
|
|
47
|
+
c="undefined"===typeof window?self:window,m=c.importScripts,k=!1,h=function(a,b){k||(m(Object(t.a)("".concat(c.basePath,"decode.min.js"))),k=!0);a=Object(l.b)(a);a=self.BrotliDecode(a);return b?a:Object(l.a)(a)},f=function(a,b){return Object(q.b)(void 0,void 0,Promise,function(){var d;return Object(q.c)(this,function(p){switch(p.label){case 0:return k?[3,2]:[4,Object(x.a)("".concat(self.Core.getWorkerPath(),"external/decode.min.js"),"Failed to download decode.min.js",window)];case 1:p.sent(),k=!0,
|
|
48
|
+
p.label=2;case 2:return d=self.BrotliDecode(Object(l.b)(a)),[2,b?d:Object(l.a)(d)]}})})};(function(){function a(){this.remainingDataArrays=[]}a.prototype.processRaw=function(b){return b};a.prototype.processBrotli=function(b){this.remainingDataArrays.push(b);return null};a.prototype.GetNextChunk=function(b){this.decodeFunction||(this.decodeFunction=0===b[0]&&97===b[1]&&115===b[2]&&109===b[3]?this.processRaw:this.processBrotli);return this.decodeFunction(b)};a.prototype.End=function(){if(this.remainingDataArrays.length){for(var b=
|
|
49
|
+
this.arrays,d=0,p=0;p<b.length;++p)d+=b[p].length;d=new Uint8Array(d);var g=0;for(p=0;p<b.length;++p){var z=b[p];d.set(z,g);g+=z.length}return h(d,!0)}return null};return a})();var r=function(a,b,d){void 0===b&&(b=!0);void 0===d&&(d=!1);var p=new XMLHttpRequest;p.open("GET",a,b);a=d&&p.overrideMimeType;p.responseType=a?"text":"arraybuffer";a&&p.overrideMimeType("text/plain; charset=x-user-defined");return p},A=function(a,b,d){return new Promise(function(p,g){var z=r(a,b,d);z.send();z.onload=function(){200===
|
|
50
|
+
this.status||0===this.status?p(z.response):g(Error("Download Failed ".concat(a)))};z.onerror=function(){g(Error("Network error occurred ".concat(a)))}})},e=function(a,b){var d=b.decompressFunction,p=b.shouldOutputArray,g=b.compressedMaximum,z="undefined"!==typeof m?Date.now():null;try{var y=p?w(a):a.join("");Object(n.a)("worker","Result length is ".concat(y.length));if(y.length<g){var E=d(y,p);Object(n.e)("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 https://docs.apryse.com/documentation/web/faq/content-encoding/ for instructions on how to resolve this.");
|
|
51
|
+
m&&Object(n.a)("worker","Decompressed length is ".concat(E.length));y=E}else p||(y=Object(l.a)(y));if(m){var K=b.paths.join(", ");Object(n.a)("worker","".concat(K," Decompression took ").concat(Date.now()-z," ms"))}return y}catch(N){throw Error("Failed to decompress: ".concat(N));}},w=function(a){a=a.reduce(function(b,d){d=new Uint8Array(d);return b.concat(Array.from(d))},[]);return new Uint8Array(a)},F=function(a){var b=!a.shouldOutputArray,d=a.paths,p=a.isAsync;p?d=Promise.all(d.map(function(g){return A(g,
|
|
52
|
+
p,b)})).then(function(g){return e(g,a)}).catch(function(g){throw Error("Failed to fetch or decompress files: ".concat(g.message));}):(d=d.map(function(g){var z=r(g,p,b);z.send();if(200===z.status||0===z.status)return z.response;throw Error("Failed to load ".concat(g));}),d=e(d,a));return d},D=function(a){var b=a.lastIndexOf("/");-1===b&&(b=0);var d=a.slice(b).replace(".",".br.");m||(d.endsWith(".js.mem")?d=d.replace(".js.mem",".mem"):d.endsWith(".js")&&(d=d.concat(".mem")));return a.slice(0,b)+d},
|
|
53
|
+
I=function(a){return a.map(function(b){return D(b)})},L=function(a,b){b.decompressFunction=m?h:f;b.paths=I(a);return F(b)},G=function(a,b,d,p){return a.catch(function(g){Object(n.e)(g);return p(b,d)})},H=function(a,b,d,p){a=Array.isArray(a)?a:[a];a:{var g=[L];b={compressedMaximum:b,isAsync:d,shouldOutputArray:p};if(b.isAsync){var z=g[0](a,b);for(d=1;d<g.length;++d)z=G(z,a,b,g[d])}else{for(d=0;d<g.length;d++){p=g[d];try{z=p(a,b);break a}catch(y){Object(n.e)(y.message)}}throw Error("None of the worker files were able to load. ");
|
|
54
|
+
}}return z}},function(v,B,u){function q(l,t,c,m){function k(h){return h instanceof c?h:new c(function(f){f(h)})}return new (c||(c=Promise))(function(h,f){function r(w){try{e(m.next(w))}catch(F){f(F)}}function A(w){try{e(m["throw"](w))}catch(F){f(F)}}function e(w){w.done?h(w.value):k(w.value).then(r,A)}e((m=m.apply(l,t||[])).next())})}function n(l,t){function c(e){return function(w){return m([e,w])}}function m(e){if(h)throw new TypeError("Generator is already executing.");for(;A&&(A=0,e[0]&&(k=0)),
|
|
55
|
+
k;)try{if(h=1,f&&(r=e[0]&2?f["return"]:e[0]?f["throw"]||((r=f["return"])&&r.call(f),0):f.next)&&!(r=r.call(f,e[1])).done)return r;if(f=0,r)e=[e[0]&2,r.value];switch(e[0]){case 0:case 1:r=e;break;case 4:return k.label++,{value:e[1],done:!1};case 5:k.label++;f=e[1];e=[0];continue;case 7:e=k.ops.pop();k.trys.pop();continue;default:if(!(r=k.trys,r=0<r.length&&r[r.length-1])&&(6===e[0]||2===e[0])){k=0;continue}if(3===e[0]&&(!r||e[1]>r[0]&&e[1]<r[3]))k.label=e[1];else if(6===e[0]&&k.label<r[1])k.label=
|
|
56
|
+
r[1],r=e;else if(r&&k.label<r[2])k.label=r[2],k.ops.push(e);else{r[2]&&k.ops.pop();k.trys.pop();continue}}e=t.call(l,k)}catch(w){e=[6,w],f=0}finally{h=r=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var k={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},h,f,r,A=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return A.next=c(0),A["throw"]=c(1),A["return"]=c(2),"function"===typeof Symbol&&(A[Symbol.iterator]=function(){return this}),
|
|
57
|
+
A}u.d(B,"a",function(){return x});u.d(B,"b",function(){return q});u.d(B,"c",function(){return n});var x=function(){x=Object.assign||function(l){for(var t,c=1,m=arguments.length;c<m;c++){t=arguments[c];for(var k in t)Object.prototype.hasOwnProperty.call(t,k)&&(l[k]=t[k])}return l};return x.apply(this,arguments)}},function(v,B,u){function q(l,t,c){return new Promise(function(m){if(!l)return m();var k=c.document.createElement("script");k.type="text/javascript";k.onload=function(){m()};k.onerror=function(){t&&
|
|
58
|
+
Object(x.e)(t);m()};k.src=l;c.document.getElementsByTagName("head")[0].appendChild(k)})}function n(l,t,c,m,k,h,f){f=f||0;var r=t[h],A=k.length;m=l.length>=m&&!r;A!==c||k.buffer.byteLength!==A?(m?(l=l.shift(),r=t[l],r.length<c&&(r=new Int8Array(c)),t[l]=null):r=r?t[h]:new Int8Array(c),r.subarray(f,f+A).set(k),k=r):m&&(l=l.shift(),t[l]=null);t[h]=k}u.d(B,"a",function(){return q});u.d(B,"b",function(){return n});var x=u(0)},function(v,B,u){u.d(B,"b",function(){return q});u.d(B,"a",function(){return n});
|
|
59
|
+
var q=function(x){if("string"===typeof x){for(var l=new Uint8Array(x.length),t=x.length,c=0;c<t;c++)l[c]=x.charCodeAt(c);return l}return x},n=function(x){if("string"!==typeof x){for(var l="",t=0,c=x.length,m;t<c;)m=x.subarray(t,t+1024),t+=1024,l+=String.fromCharCode.apply(null,m);return l}return x}},function(v,B,u){u.d(B,"a",function(){return A});var q,n="undefined"===typeof window?self:window;v=function(){var e=navigator.userAgent.toLowerCase();return(e=/(msie) ([\w.]+)/.exec(e)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(e))?
|
|
60
|
+
parseInt(e[2],10):e}();var x=function(){var e=n.navigator.userAgent.match(/OPR/),w=n.navigator.userAgent.match(/Maxthon/),F=n.navigator.userAgent.match(/Edge/);return n.navigator.userAgent.match(/Chrome\/(.*?) /)&&!e&&!w&&!F}();(function(){if(!x)return null;var e=n.navigator.userAgent.match(/Chrome\/([0-9]+)\./);return e?parseInt(e[1],10):e})();var l=!!navigator.userAgent.match(/Edge/i)||navigator.userAgent.match(/Edg\/(.*?)/)&&n.navigator.userAgent.match(/Chrome\/(.*?) /);(function(){if(!l)return null;
|
|
61
|
+
var e=n.navigator.userAgent.match(/Edg\/([0-9]+)\./);return e?parseInt(e[1],10):e})();B=/iPad|iPhone|iPod/.test(n.navigator.platform)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints||/iPad|iPhone|iPod/.test(n.navigator.userAgent);var t=function(){var e=n.navigator.userAgent.match(/.*\/([0-9\.]+)\s(Safari|Mobile).*/i);return e?parseFloat(e[1]):e}(),c=/^((?!chrome|android).)*safari/i.test(n.navigator.userAgent)||/^((?!chrome|android).)*$/.test(n.navigator.userAgent)&&B;c&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&
|
|
62
|
+
parseInt(null===(q=navigator.userAgent.match(/Version\/(\d+)/))||void 0===q?void 0:q[1],10);var m=n.navigator.userAgent.match(/Firefox/);(function(){if(!m)return null;var e=n.navigator.userAgent.match(/Firefox\/([0-9]+)\./);return e?parseInt(e[1],10):e})();v||/Android|webOS|Touch|IEMobile|Silk/i.test(navigator.userAgent);navigator.userAgent.match(/(iPad|iPhone|iPod)/i);n.navigator.userAgent.indexOf("Android");var k=/Mac OS X 10_13_6.*\(KHTML, like Gecko\)$/.test(n.navigator.userAgent),h=n.navigator.userAgent.match(/(iPad|iPhone).+\sOS\s((\d+)(_\d)*)/i)?
|
|
63
|
+
14<=parseInt(n.navigator.userAgent.match(/(iPad|iPhone).+\sOS\s((\d+)(_\d)*)/i)[3],10):!1,f=!(!self.WebAssembly||!self.WebAssembly.validate),r=-1<n.navigator.userAgent.indexOf("Edge/16")||-1<n.navigator.userAgent.indexOf("MSAppHost"),A=function(){var e;if(e=f&&!r)e=c&&null!==t&&14>t,e=!(!h&&(e||k));return e}},function(v,B,u){u.d(B,"a",function(){return k});var q=u(4);v=u(13);var n=u.n(v),x=new Map,l=function(){return("undefined"===typeof window?self:window).trustedTypes},t=function(h,f){return l().createPolicy(h,
|
|
64
|
+
{createHTML:function(r){return n.a.sanitize(r,Object(q.a)(Object(q.a)({},f),{RETURN_TRUSTED_TYPE:!1}))},createScript:function(r){return r},createScriptURL:function(r){return r}})},c=function(h){return l().createPolicy(h,{createHTML:function(f){return f},createScript:function(f){return f},createScriptURL:function(f){return f}})},m=function(h,f){var r,A={createHTML:function(e){return n.a.sanitize(e,Object(q.a)({},f))},createScript:function(e){return e},createScriptURL:function(e){return e}};if(null===
|
|
65
|
+
(r=l())||void 0===r?0:r.createPolicy)r="".concat(h,"-po"),x.has(h)||(A=c(r),x.set(r,A),A=t(h,f),x.set(h,A)),A=x.get(f.createPolicyOnly?r:h);return A},k=function(h,f){void 0===f&&(f={createPolicyOnly:!0,trustedTypesPolicyName:"webviewer"});return m(f.trustedTypesPolicyName,f).createScriptURL(h.toString())}},function(v,B,u){function q(t){"@babel/helpers - typeof";return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&
|
|
66
|
+
c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},q(t)}var n,x,l;!function(t){"object"===q(B)&&"undefined"!==typeof v?v.exports=t():!(x=[],n=t,l="function"===typeof n?n.apply(B,x):n,void 0!==l&&(v.exports=l))}(function(){return function h(c,m,k){function f(e,w){if(!m[e]){if(!c[e]){if(r)return r(e,!0);w=Error("Cannot find module '".concat(e,"'"));throw w.code="MODULE_NOT_FOUND",w;}w=m[e]={exports:{}};c[e][0].call(w.exports,function(F){return f(c[e][1][F]||F)},w,w.exports,h,c,m,k)}return m[e].exports}
|
|
67
|
+
for(var r=!1,A=0;A<k.length;A++)f(k[A]);return f}({1:[function(c,m,k){var h={}.hasOwnProperty,f=function(r,A){function e(){this.constructor=r}for(var w in A)h.call(A,w)&&(r[w]=A[w]);e.prototype=A.prototype;r.prototype=new e;r.__super__=A.prototype;return r};k=c("./PriorityQueue/AbstractPriorityQueue");c=c("./PriorityQueue/ArrayStrategy");k=function(r){function A(e){e||(e={});e.strategy||(e.strategy=BinaryHeapStrategy);e.comparator||(e.comparator=function(w,F){return(w||0)-(F||0)});A.__super__.constructor.call(this,
|
|
68
|
+
e)}f(A,r);return A}(k);k.ArrayStrategy=c;m.exports=k},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3}],2:[function(c,m,k){m.exports=function(){function h(f){if(null==(null!=f?f.strategy:void 0))throw"Must pass options.strategy, a strategy";if(null==(null!=f?f.comparator:void 0))throw"Must pass options.comparator, a comparator";this.priv=new f.strategy(f);this.length=0}h.prototype.queue=function(f){this.length++;this.priv.queue(f)};h.prototype.dequeue=function(f){if(!this.length)throw"Empty queue";
|
|
69
|
+
this.length--;return this.priv.dequeue()};h.prototype.peek=function(f){if(!this.length)throw"Empty queue";return this.priv.peek()};h.prototype.remove=function(f){this.priv.remove(f)&&--this.length};h.prototype.find=function(f){return 0<=this.priv.find(f)};h.prototype.removeAllMatching=function(f,r){f=this.priv.removeAllMatching(f,r);this.length-=f};return h}()},{}],3:[function(c,m,k){var h=function(f,r,A){var e;var w=0;for(e=f.length;w<e;){var F=w+e>>>1;0<=A(f[F],r)?w=F+1:e=F}return w};m.exports=
|
|
70
|
+
function(){function f(r){var A;this.options=r;this.comparator=this.options.comparator;this.data=(null!=(A=this.options.initialValues)?A.slice(0):void 0)||[];this.data.sort(this.comparator).reverse()}f.prototype.queue=function(r){var A=h(this.data,r,this.comparator);this.data.splice(A,0,r)};f.prototype.dequeue=function(){return this.data.pop()};f.prototype.peek=function(){return this.data[this.data.length-1]};f.prototype.find=function(r){var A=h(this.data,r,this.comparator)-1;return 0<=A&&!this.comparator(this.data[A],
|
|
71
|
+
r)?A:-1};f.prototype.remove=function(r){r=this.find(r);return 0<=r?(this.data.splice(r,1),!0):!1};f.prototype.removeAllMatching=function(r,A){for(var e=0,w=this.data.length-1;0<=w;--w)if(r(this.data[w])){var F=this.data.splice(w,1)[0];A&&A(F);++e}return e};return f}()},{}]},{},[1])(1)})},function(v,B,u){(function(q){function n(t,c){this._id=t;this._clearFn=c}var x="undefined"!==typeof q&&q||"undefined"!==typeof self&&self||window,l=Function.prototype.apply;B.setTimeout=function(){return new n(l.call(setTimeout,
|
|
72
|
+
x,arguments),clearTimeout)};B.setInterval=function(){return new n(l.call(setInterval,x,arguments),clearInterval)};B.clearTimeout=B.clearInterval=function(t){t&&t.close()};n.prototype.unref=n.prototype.ref=function(){};n.prototype.close=function(){this._clearFn.call(x,this._id)};B.enroll=function(t,c){clearTimeout(t._idleTimeoutId);t._idleTimeout=c};B.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};B._unrefActive=B.active=function(t){clearTimeout(t._idleTimeoutId);var c=t._idleTimeout;
|
|
73
|
+
0<=c&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},c))};u(25);B.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof q&&q.setImmediate||this&&this.setImmediate;B.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof q&&q.clearImmediate||this&&this.clearImmediate}).call(this,u(12))},function(v,B,u){function q(c,m,k,h){return n(c,m,k,h,!!WebAssembly.instantiateStreaming,void 0,void 0).then(function(f){Object(x.a)("load",
|
|
74
|
+
"WASM compilation took ".concat(Date.now()-NaN," ms"));return f})}function n(c,m,k,h,f,r,A){r=r||Date.now();if(f&&!h)return Object(x.a)("load","Try instantiateStreaming"),fetch(Object(l.a)(c)).then(function(e){return WebAssembly.instantiateStreaming(e,m)}).catch(function(e){Object(x.a)("load","instantiateStreaming Failed ".concat(c," message ").concat(e.message));return n(c,m,k,h,!1,r,A)});f=h?h.map(function(e,w){return"".concat(e,"PDFNetCWasm-chunk-").concat(w,".wasm")}):c;return Object(l.b)(f,k,
|
|
75
|
+
!0,!0).then(function(e){A=Date.now();Object(x.a)("load","Request took ".concat(A-r," ms"));return WebAssembly.instantiate(e,m)})}u.d(B,"a",function(){return q});var x=u(0),l=u(3),t=u(5);u.d(B,"b",function(){return t.a})},function(v,B){B=function(){return this}();try{B=B||(new Function("return this"))()}catch(u){"object"===typeof window&&(B=window)}v.exports=B},function(v,B,u){(function(q,n){v.exports=n()})(this,function(){function q(T){return function(O){O instanceof RegExp&&(O.lastIndex=0);for(var S=
|
|
76
|
+
arguments.length,U=Array(1<S?S-1:0),W=1;W<S;W++)U[W-1]=arguments[W];return F(T,O,U)}}function n(T,O){var S=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b;k&&k(T,null);for(var U=O.length;U--;){var W=O[U];if("string"===typeof W){var na=S(W);na!==W&&(h(O)||(O[U]=na),W=na)}T[W]=!0}return T}function x(T){for(var O=w(null),S=$jscomp.makeIterator(m(T)),U=S.next();!U.done;U=S.next()){var W=$jscomp.makeIterator(U.value);U=W.next().value;W=W.next().value;if(E(T,U))if(Array.isArray(W)){for(var na=
|
|
77
|
+
0;na<W.length;na++)E(W,na)||(W[na]=null);O[U]=W}else O[U]=W&&"object"===typeof W&&W.constructor===Object?x(W):W}return O}function l(T,O){for(;null!==T;){var S=r(T,O);if(S){if(S.get)return q(S.get);if("function"===typeof S.value)return q(S.value)}T=f(T)}return function(){return null}}function t(){function T(C,J,M){I(C,function(P){P.call(S,J,M,ua)})}var O=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"undefined"===typeof window?null:window,S=function(C){return t(C)};S.version="3.2.6";S.removed=
|
|
78
78
|
[];if(!O||!O.document||O.document.nodeType!==Ba.document||!O.Element)return S.isSupported=!1,S;var U=O.document,W=U,na=W.currentScript,lb=O.DocumentFragment,aa=O.HTMLTemplateElement,Ua=O.Node,mb=O.Element,Ca=O.NodeFilter,Ob=void 0===O.NamedNodeMap?O.NamedNodeMap||O.MozNamedAttrMap:O.NamedNodeMap,Pb=O.HTMLFormElement,Qb=O.DOMParser,Ja=O.trustedTypes;O=mb.prototype;var Rb=l(O,"cloneNode"),Sb=l(O,"remove"),Tb=l(O,"nextSibling"),Ub=l(O,"childNodes"),Ka=l(O,"parentNode");"function"===typeof aa&&(aa=U.createElement("template"),
|
|
79
79
|
aa.content&&aa.content.ownerDocument&&(U=aa.content.ownerDocument));var fa,Da="";aa=U;var Va=aa.implementation,Vb=aa.createNodeIterator,Wb=aa.createDocumentFragment,Xb=aa.getElementsByTagName,Yb=W.importNode,ha=nb();S.isSupported="function"===typeof m&&"function"===typeof Ka&&Va&&void 0!==Va.createHTMLDocument;aa=ob;var Wa=aa.MUSTACHE_EXPR,Xa=aa.ERB_EXPR,Ya=aa.TMPLIT_EXPR,Zb=aa.DATA_ATTR,$b=aa.ARIA_ATTR,ac=aa.IS_SCRIPT_OR_DATA,pb=aa.ATTR_WHITESPACE,qb=aa.CUSTOM_ELEMENT,rb=ob.IS_ALLOWED_URI,ca=null,
|
|
80
|
-
sb=n({},[].concat($jscomp.arrayFromIterable(Q),$jscomp.arrayFromIterable(V),$jscomp.arrayFromIterable(X),$jscomp.arrayFromIterable(ma),$jscomp.arrayFromIterable(ka))),ea=null,tb=n({},[].concat($jscomp.arrayFromIterable(qa),$jscomp.arrayFromIterable(oa),$jscomp.arrayFromIterable(ra),$jscomp.arrayFromIterable(Y))),Z=Object.seal(
|
|
80
|
+
sb=n({},[].concat($jscomp.arrayFromIterable(Q),$jscomp.arrayFromIterable(V),$jscomp.arrayFromIterable(X),$jscomp.arrayFromIterable(ma),$jscomp.arrayFromIterable(ka))),ea=null,tb=n({},[].concat($jscomp.arrayFromIterable(qa),$jscomp.arrayFromIterable(oa),$jscomp.arrayFromIterable(ra),$jscomp.arrayFromIterable(Y))),Z=Object.seal(w(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,
|
|
81
81
|
configurable:!1,enumerable:!0,value:!1}})),Ea=null,Za=null,ub=!0,$a=!0,vb=!1,wb=!0,va=!1,La=!0,sa=!1,ab=!1,bb=!1,wa=!1,Ma=!1,Na=!1,xb=!0,yb=!1,cb=!0,Fa=!1,xa={},ya=null,zb=n({},"annotation-xml audio colgroup desc foreignobject head iframe math mi mn mo ms mtext noembed noframes noscript plaintext script style svg template thead title video xmp".split(" ")),Ab=null,Bb=n({},"audio video img source image track".split(" ")),db=null,Cb=n({},"alt class for id label name pattern placeholder role summary title value style xmlns".split(" ")),
|
|
82
|
-
za="http://www.w3.org/1999/xhtml",Db=!1,eb=null,bc=n({},["http://www.w3.org/1998/Math/MathML","http://www.w3.org/2000/svg","http://www.w3.org/1999/xhtml"],d),Oa=n({},["mi","mo","mn","ms","mtext"]),Pa=n({},["annotation-xml"]),cc=n({},["title","style","font","a","script"]),Ga=null,dc=["application/xhtml+xml","text/html"],da=null,ua=null,ec=U.createElement("form"),Eb=function(
|
|
83
|
-
{};if(!ua||ua!==
|
|
84
|
-
da):zb;Ea=E(
|
|
85
|
-
|
|
86
|
-
"boolean"===typeof
|
|
87
|
-
n(db,
|
|
88
|
-
fa=
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
M[0];"application/xhtml+xml"===Ga&&"http://www.w3.org/1999/xhtml"===za&&(
|
|
92
|
-
za?Xb.call(
|
|
93
|
-
typeof
|
|
94
|
-
Ea[M]){if(!Ea[M]&&"annotation-xml"!==M&&
|
|
95
|
-
!0;va&&
|
|
96
|
-
RegExp&&
|
|
97
|
-
if(
|
|
98
|
-
if(La&&
|
|
99
|
-
fa.createHTML(R.$jscomp$loop$prop$value$10);break;case "TrustedScriptURL":R.$jscomp$loop$prop$value$10=fa.createScriptURL(R.$jscomp$loop$prop$value$10)}if(R.$jscomp$loop$prop$value$10!==ib)try{hb?
|
|
100
|
-
|
|
101
|
-
ab||fb(M);S.removed=[];"string"===typeof
|
|
102
|
-
M.nextNode();)Kb(R),Nb(R),R.content instanceof lb&&ic(R.content);if(Fa)return
|
|
103
|
-
return fa&&Na?fa.createHTML(ba):ba};S.setConfig=function(){fb(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});ab=!0};S.clearConfig=function(){ua=null;ab=!1};S.isValidAttribute=function(
|
|
104
|
-
m=c.entries,
|
|
105
|
-
|
|
106
|
-
V=
|
|
107
|
-
ia=
|
|
108
|
-
ka=
|
|
109
|
-
oa=
|
|
110
|
-
ra=
|
|
111
|
-
Y=
|
|
112
|
-
ARIA_ATTR:Ta,ATTR_WHITESPACE:ta,CUSTOM_ELEMENT:c,DATA_ATTR:kb,DOCTYPE_NAME:Ra,ERB_EXPR:Ha,IS_ALLOWED_URI:Qa,IS_SCRIPT_OR_DATA:Ia,MUSTACHE_EXPR:
|
|
113
|
-
O="dompurify"+(S?"#"+S:"");try{return T.createPolicy(O,{createHTML:function(U){return U},createScriptURL:function(U){return U}})}catch(U){return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};return t()})},function(v,
|
|
114
|
-
}function
|
|
115
|
-
!1,
|
|
116
|
-
1]=arguments[D];
|
|
117
|
-
};v.umask=function(){return 0}},function(v,
|
|
118
|
-
function(
|
|
119
|
-
break;case 2:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
new Set;this.isReset=!1;this.actionHandler.console_log=[function(c){Object(
|
|
123
|
-
this.msgHandler)};
|
|
124
|
-
function(l,t,c){var m=this.actionHandlerAsync,
|
|
125
|
-
|
|
126
|
-
Object(
|
|
127
|
-
(l[m]=c[m])})}this.postMessage({isReply:!0,callbackId:t,error:l})};
|
|
128
|
-
this.postMessage({action:"actionCancel",data:{callbackId:l}})}else Object(
|
|
129
|
-
typeof l&&(l instanceof Uint8Array?t.push(l.buffer):l instanceof ArrayBuffer?t.push(l):Object.keys(l).forEach(function(m){l.hasOwnProperty(m)&&c.getObjectTransfers(l[m],t)}))};
|
|
130
|
-
this.actionHandler,
|
|
131
|
-
c.callbackId)}):
|
|
132
|
-
this;this.promise=
|
|
133
|
-
self.Module.asmjsPrefix:"")+m,".js"));return}
|
|
134
|
-
function(v,
|
|
135
|
-
"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},
|
|
136
|
-
E)throw new TypeError("A promises callback cannot return that same promise.");if(E&&("function"===typeof E||"object"===
|
|
137
|
-
0;
|
|
138
|
-
I
|
|
139
|
-
then:new this.constructor(d),fulfilled:
|
|
140
|
-
V||E(Q)})};D.race=function(
|
|
141
|
-
typeof self?self:void 0)}).call(this,u(12),u(10).setImmediate)},function(v,
|
|
142
|
-
|
|
143
|
-
D.documentElement;
|
|
144
|
-
typeof
|
|
145
|
-
"catch":t.bind(m)}};return{cancel:l,promise:
|
|
146
|
-
return
|
|
147
|
-
arguments[
|
|
148
|
-
|
|
149
|
-
if(
|
|
150
|
-
"pagesRenamed",{pageNumToId:
|
|
151
|
-
Module.PageGetNumAnnots(Module.IteratorCurrent(
|
|
152
|
-
|
|
153
|
-
Module.IteratorCurrent(
|
|
154
|
-
|
|
155
|
-
Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DownloaderPrefetchDocInfo(
|
|
156
|
-
Module.loadPromise.cancelled;Module.loadPromise=null;E||
|
|
157
|
-
{});(function(
|
|
158
|
-
function(){var
|
|
159
|
-
"i8",Module.ALLOC_STACK);REX(Module._TRN_FDFDocCreateFromXFDF(
|
|
160
|
-
Module.stackSave();
|
|
161
|
-
null};
|
|
162
|
-
|
|
163
|
-
Module.GetUStringFromJSString("watermarkFile"));m.FS.unlink("watermarkFile");return Y};var
|
|
164
|
-
|
|
165
|
-
la&&(Module.SecurityHandlerChangeUserPasswordUString(la,D),Module.PDFDocSetSecurityHandler(b,la))}E=0;if(
|
|
166
|
-
"OpenAction"));a.reverse().forEach(function(Y){Y()});if(r)
|
|
167
|
-
if(
|
|
168
|
-
{};var
|
|
169
|
-
Module._TRN_PDFRasterizerDestroy(
|
|
170
|
-
D.highlightFields)));D.hasOwnProperty("antiAliasing")&&REX(Module._TRN_PDFRasterizerSetAntiAliasing(
|
|
171
|
-
!1,D.thinLineStrokeAdjust));D.hasOwnProperty("thinLineScaling")&&REX(Module._TRN_PDFRasterizerSetThinLineScaling(
|
|
172
|
-
1;REX(Module._TRN_PDFRasterizerSetNightModeTuning(
|
|
173
|
-
D.expGamma));D.hasOwnProperty("isPrinting")&&(D.isPrinting&&(
|
|
174
|
-
|
|
175
|
-
0:255,
|
|
176
|
-
d,
|
|
177
|
-
Object(c.b)("worker","Total Page Time ".concat((new Date).getTime()-kb));a.reverse().forEach(function(ta){ta()});
|
|
178
|
-
|
|
179
|
-
r){var
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
void 0,!0,!1,void 0,
|
|
186
|
-
Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetCropBox(
|
|
187
|
-
24,Q-
|
|
188
|
-
F(V)}catch(X){
|
|
189
|
-
n(c)}var
|
|
190
|
-
b,"-",b+d-1].join("");
|
|
191
|
-
0<=b&&this.lruList.splice(b,1);this.lruList.push(a);return this.chunkMap[a]}};var
|
|
192
|
-
new Int8Array(this.reader.readAsArrayBuffer(this.file.slice(
|
|
193
|
-
0;this.length=this.data.length};
|
|
194
|
-
getTotalSize:function(){return this.length}};var F=function(a,b,d,
|
|
195
|
-
1);this.lruList.push(a)},getChunk:function(a){var b=this;if(this.chunkMap[a])this.lruUpdate(a);else{var d=Math.min(a+this.chunkSize,this.length)-1,
|
|
196
|
-
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,b){var d={have:[],downloading:[],missing:[]};try{var
|
|
197
|
-
|
|
198
|
-
this,d=a+this.chunkSize,
|
|
199
|
-
var D=function(a){this.chunkStorage=a;this.position=0;this.length=this.chunkStorage.length;this.chunkSize=a.chunkSize};D.prototype={read:function(a,b,d){var
|
|
200
|
-
|
|
201
|
-
d>b.length&&(d=b.length),
|
|
202
|
-
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,b,d){var
|
|
203
|
-
this.length),0);this.data=
|
|
204
|
-
close:function(a){a.provider.close()},read:function(a,b,d,
|
|
205
|
-
"\n\t Function: ").concat(c.GetJSStringFromCString(Module._TRN_GetFunction(a)),"\n\t Linenumber: ").concat(c.GetJSStringFromCString(Module._TRN_GetLineNum(a)))};c.GetErrToString=
|
|
206
|
-
message:"Unable to access Document id=".concat(a,". The document appears to be invalid or was deleted.")};};c.clearDocBackend=function(){null!==Module.cachePtr?(Module.hasBufOwnership&&Module._free(Module.cachePtr),Module.cachePtr=null):Module.docs[c.currentFileString]&&delete Module.docs[c.currentFileString]};c.MakeDev=function(a){if(!
|
|
207
|
-
Module.ALLOC_STACK);Module.docs[b]={file:a};a=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreateFromFilePath(a,d));d=Module.getValue(d,"i8*");Module.docs[b].ptr=d};c.InsertImageIntoDoc=function(a,b,d){var
|
|
208
|
-
E=Module.ImageGetImageHeight(b),d=
|
|
209
|
-
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=d,this.size=a,this.timeout=null,this.eventPageArray=[],this.requirePageCallbacks={});this.downloadUserData=Module.createDownloadUserData(b,d)};
|
|
82
|
+
za="http://www.w3.org/1999/xhtml",Db=!1,eb=null,bc=n({},["http://www.w3.org/1998/Math/MathML","http://www.w3.org/2000/svg","http://www.w3.org/1999/xhtml"],d),Oa=n({},["mi","mo","mn","ms","mtext"]),Pa=n({},["annotation-xml"]),cc=n({},["title","style","font","a","script"]),Ga=null,dc=["application/xhtml+xml","text/html"],da=null,ua=null,ec=U.createElement("form"),Eb=function(C){return C instanceof RegExp||C instanceof Function},fb=function(){var C=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
|
83
|
+
{};if(!ua||ua!==C){C&&"object"===typeof C||(C={});C=x(C);Ga=-1===dc.indexOf(C.PARSER_MEDIA_TYPE)?"text/html":C.PARSER_MEDIA_TYPE;da="application/xhtml+xml"===Ga?d:b;ca=E(C,"ALLOWED_TAGS")?n({},C.ALLOWED_TAGS,da):sb;ea=E(C,"ALLOWED_ATTR")?n({},C.ALLOWED_ATTR,da):tb;eb=E(C,"ALLOWED_NAMESPACES")?n({},C.ALLOWED_NAMESPACES,d):bc;db=E(C,"ADD_URI_SAFE_ATTR")?n(x(Cb),C.ADD_URI_SAFE_ATTR,da):Cb;Ab=E(C,"ADD_DATA_URI_TAGS")?n(x(Bb),C.ADD_DATA_URI_TAGS,da):Bb;ya=E(C,"FORBID_CONTENTS")?n({},C.FORBID_CONTENTS,
|
|
84
|
+
da):zb;Ea=E(C,"FORBID_TAGS")?n({},C.FORBID_TAGS,da):x({});Za=E(C,"FORBID_ATTR")?n({},C.FORBID_ATTR,da):x({});xa=E(C,"USE_PROFILES")?C.USE_PROFILES:!1;ub=!1!==C.ALLOW_ARIA_ATTR;$a=!1!==C.ALLOW_DATA_ATTR;vb=C.ALLOW_UNKNOWN_PROTOCOLS||!1;wb=!1!==C.ALLOW_SELF_CLOSE_IN_ATTR;va=C.SAFE_FOR_TEMPLATES||!1;La=!1!==C.SAFE_FOR_XML;sa=C.WHOLE_DOCUMENT||!1;wa=C.RETURN_DOM||!1;Ma=C.RETURN_DOM_FRAGMENT||!1;Na=C.RETURN_TRUSTED_TYPE||!1;bb=C.FORCE_BODY||!1;xb=!1!==C.SANITIZE_DOM;yb=C.SANITIZE_NAMED_PROPS||!1;cb=!1!==
|
|
85
|
+
C.KEEP_CONTENT;Fa=C.IN_PLACE||!1;rb=C.ALLOWED_URI_REGEXP||Qa;za=C.NAMESPACE||"http://www.w3.org/1999/xhtml";Oa=C.MATHML_TEXT_INTEGRATION_POINTS||Oa;Pa=C.HTML_INTEGRATION_POINTS||Pa;Z=C.CUSTOM_ELEMENT_HANDLING||{};C.CUSTOM_ELEMENT_HANDLING&&Eb(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck);C.CUSTOM_ELEMENT_HANDLING&&Eb(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck);C.CUSTOM_ELEMENT_HANDLING&&
|
|
86
|
+
"boolean"===typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements);va&&($a=!1);Ma&&(wa=!0);xa&&(ca=n({},ka),ea=[],!0===xa.html&&(n(ca,Q),n(ea,qa)),!0===xa.svg&&(n(ca,V),n(ea,oa),n(ea,Y)),!0===xa.svgFilters&&(n(ca,X),n(ea,oa),n(ea,Y)),!0===xa.mathMl&&(n(ca,ma),n(ea,ra),n(ea,Y)));C.ADD_TAGS&&(ca===sb&&(ca=x(ca)),n(ca,C.ADD_TAGS,da));C.ADD_ATTR&&(ea===tb&&(ea=x(ea)),n(ea,C.ADD_ATTR,da));C.ADD_URI_SAFE_ATTR&&
|
|
87
|
+
n(db,C.ADD_URI_SAFE_ATTR,da);C.FORBID_CONTENTS&&(ya===zb&&(ya=x(ya)),n(ya,C.FORBID_CONTENTS,da));cb&&(ca["#text"]=!0);sa&&n(ca,["html","head","body"]);ca.table&&(n(ca,["tbody"]),delete Ea.tbody);if(C.TRUSTED_TYPES_POLICY){if("function"!==typeof C.TRUSTED_TYPES_POLICY.createHTML)throw N('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof C.TRUSTED_TYPES_POLICY.createScriptURL)throw N('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
88
|
+
fa=C.TRUSTED_TYPES_POLICY;Da=fa.createHTML("")}else void 0===fa&&(fa=fc(Ja,na)),null!==fa&&"string"===typeof Da&&(Da=fa.createHTML(""));e&&e(C);ua=C}},Fb=n({},[].concat($jscomp.arrayFromIterable(V),$jscomp.arrayFromIterable(X),$jscomp.arrayFromIterable(ia))),Gb=n({},[].concat($jscomp.arrayFromIterable(ma),$jscomp.arrayFromIterable(la))),gc=function(C){var J=Ka(C);J&&J.tagName||(J={namespaceURI:za,tagName:"template"});var M=b(C.tagName),P=b(J.tagName);return eb[C.namespaceURI]?"http://www.w3.org/2000/svg"===
|
|
89
|
+
C.namespaceURI?"http://www.w3.org/1999/xhtml"===J.namespaceURI?"svg"===M:"http://www.w3.org/1998/Math/MathML"===J.namespaceURI?"svg"===M&&("annotation-xml"===P||Oa[P]):!!Fb[M]:"http://www.w3.org/1998/Math/MathML"===C.namespaceURI?"http://www.w3.org/1999/xhtml"===J.namespaceURI?"math"===M:"http://www.w3.org/2000/svg"===J.namespaceURI?"math"===M&&Pa[P]:!!Gb[M]:"http://www.w3.org/1999/xhtml"===C.namespaceURI?"http://www.w3.org/2000/svg"===J.namespaceURI&&!Pa[P]||"http://www.w3.org/1998/Math/MathML"===
|
|
90
|
+
J.namespaceURI&&!Oa[P]?!1:!Gb[M]&&(cc[M]||!Fb[M]):"application/xhtml+xml"===Ga&&eb[C.namespaceURI]?!0:!1:!1},pa=function(C){H(S.removed,{element:C});try{Ka(C).removeChild(C)}catch(J){Sb(C)}},Aa=function(C,J){try{H(S.removed,{attribute:J.getAttributeNode(C),from:J})}catch(M){H(S.removed,{attribute:null,from:J})}J.removeAttribute(C);if("is"===C)if(wa||Ma)try{pa(J)}catch(M){}else try{J.setAttribute(C,"")}catch(M){}},Hb=function(C){var J=null,M=null;bb?C="<remove></remove>"+C:M=(M=p(C,/^[\r\n\t ]+/))&&
|
|
91
|
+
M[0];"application/xhtml+xml"===Ga&&"http://www.w3.org/1999/xhtml"===za&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");var P=fa?fa.createHTML(C):C;if("http://www.w3.org/1999/xhtml"===za)try{J=(new Qb).parseFromString(P,Ga)}catch(R){}if(!J||!J.documentElement){J=Va.createDocument(za,"template",null);try{J.documentElement.innerHTML=Db?Da:P}catch(R){}}P=J.body||J.documentElement;C&&M&&P.insertBefore(U.createTextNode(M),P.childNodes[0]||null);return"http://www.w3.org/1999/xhtml"===
|
|
92
|
+
za?Xb.call(J,sa?"html":"body")[0]:sa?J.documentElement:P},Ib=function(C){return Vb.call(C.ownerDocument||C,C,Ca.SHOW_ELEMENT|Ca.SHOW_COMMENT|Ca.SHOW_TEXT|Ca.SHOW_PROCESSING_INSTRUCTION|Ca.SHOW_CDATA_SECTION,null)},gb=function(C){return C instanceof Pb&&("string"!==typeof C.nodeName||"string"!==typeof C.textContent||"function"!==typeof C.removeChild||!(C.attributes instanceof Ob)||"function"!==typeof C.removeAttribute||"function"!==typeof C.setAttribute||"string"!==typeof C.namespaceURI||"function"!==
|
|
93
|
+
typeof C.insertBefore||"function"!==typeof C.hasChildNodes)},Jb=function(C){return"function"===typeof Ua&&C instanceof Ua},Kb=function(C){var J=null;T(ha.beforeSanitizeElements,C,null);if(gb(C))return pa(C),!0;var M=da(C.nodeName);T(ha.uponSanitizeElement,C,{tagName:M,allowedTags:ca});if(La&&C.hasChildNodes()&&!Jb(C.firstElementChild)&&K(/<[/\w!]/g,C.innerHTML)&&K(/<[/\w!]/g,C.textContent)||C.nodeType===Ba.progressingInstruction||La&&C.nodeType===Ba.comment&&K(/<[/\w]/g,C.data))return pa(C),!0;if(!ca[M]||
|
|
94
|
+
Ea[M]){if(!Ea[M]&&"annotation-xml"!==M&&p(M,qb)&&(Z.tagNameCheck instanceof RegExp&&K(Z.tagNameCheck,M)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(M)))return!1;if(cb&&!ya[M]){M=Ka(C)||C.parentNode;var P=Ub(C)||C.childNodes;if(P&&M)for(var R=P.length-1;0<=R;--R){var ba=Rb(P[R],!0);ba.__removalCount=(C.__removalCount||0)+1;M.insertBefore(ba,Tb(C))}}pa(C);return!0}if(C instanceof mb&&!gc(C)||("noscript"===M||"noembed"===M||"noframes"===M)&&K(/<\/no(script|embed|frames)/i,C.innerHTML))return pa(C),
|
|
95
|
+
!0;va&&C.nodeType===Ba.text&&(J=C.textContent,I([Wa,Xa,Ya],function(ja){J=g(J,ja," ")}),C.textContent!==J&&(H(S.removed,{element:C.cloneNode()}),C.textContent=J));T(ha.afterSanitizeElements,C,null);return!1},Lb=function(C,J,M){if(xb&&("id"===J||"name"===J)&&(M in U||M in ec))return!1;if(!$a||Za[J]||!K(Zb,J))if(!ub||!K($b,J))if(!ea[J]||Za[J]){if(!("annotation-xml"!==C&&p(C,qb)&&(Z.tagNameCheck instanceof RegExp&&K(Z.tagNameCheck,C)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(C))&&(Z.attributeNameCheck instanceof
|
|
96
|
+
RegExp&&K(Z.attributeNameCheck,J)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(J))||"is"===J&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&K(Z.tagNameCheck,M)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(M))))return!1}else if(!(db[J]||K(rb,g(M,pb,""))||("src"===J||"xlink:href"===J||"href"===J)&&"script"!==C&&0===z(M,"data:")&&Ab[C]||vb&&!K(ac,g(M,pb,"")))&&M)return!1;return!0},Nb=function(C){T(ha.beforeSanitizeAttributes,C,null);var J=C.attributes;
|
|
97
|
+
if(J&&!gb(C)){for(var M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ea,forceKeepAttr:void 0},P=J.length,R={};P--;){var ba=J[P],ja=ba.name,hb=ba.namespaceURI,ib=ba.value;ba=da(ja);R.$jscomp$loop$prop$value$10="value"===ja?ib:y(ib);M.attrName=ba;M.attrValue=R.$jscomp$loop$prop$value$10;M.keepAttr=!0;M.forceKeepAttr=void 0;T(ha.uponSanitizeAttribute,C,M);R.$jscomp$loop$prop$value$10=M.attrValue;!yb||"id"!==ba&&"name"!==ba||(Aa(ja,C),R.$jscomp$loop$prop$value$10="user-content-"+R.$jscomp$loop$prop$value$10);
|
|
98
|
+
if(La&&K(/((--!?|])>)|<\/(style|title)/i,R.$jscomp$loop$prop$value$10))Aa(ja,C);else if(!M.forceKeepAttr)if(M.keepAttr)if(!wb&&K(/\/>/i,R.$jscomp$loop$prop$value$10))Aa(ja,C);else{va&&I([Wa,Xa,Ya],function(jb){return function(hc){jb.$jscomp$loop$prop$value$10=g(jb.$jscomp$loop$prop$value$10,hc," ")}}(R));var Mb=da(C.nodeName);if(Lb(Mb,ba,R.$jscomp$loop$prop$value$10)){if(fa&&"object"===typeof Ja&&"function"===typeof Ja.getAttributeType&&!hb)switch(Ja.getAttributeType(Mb,ba)){case "TrustedHTML":R.$jscomp$loop$prop$value$10=
|
|
99
|
+
fa.createHTML(R.$jscomp$loop$prop$value$10);break;case "TrustedScriptURL":R.$jscomp$loop$prop$value$10=fa.createScriptURL(R.$jscomp$loop$prop$value$10)}if(R.$jscomp$loop$prop$value$10!==ib)try{hb?C.setAttributeNS(hb,ja,R.$jscomp$loop$prop$value$10):C.setAttribute(ja,R.$jscomp$loop$prop$value$10),gb(C)?pa(C):G(S.removed)}catch(jb){Aa(ja,C)}}else Aa(ja,C)}else Aa(ja,C);R={$jscomp$loop$prop$value$10:R.$jscomp$loop$prop$value$10}}T(ha.afterSanitizeAttributes,C,null)}},ic=function M(J){var P,R=Ib(J);for(T(ha.beforeSanitizeShadowDOM,
|
|
100
|
+
J,null);P=R.nextNode();)T(ha.uponSanitizeShadowNode,P,null),Kb(P),Nb(P),P.content instanceof lb&&M(P.content);T(ha.afterSanitizeShadowDOM,J,null)};S.sanitize=function(J){var M=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},P=null,R=null;R=R=null;(Db=!J)&&(J="\x3c!--\x3e");if("string"!==typeof J&&!Jb(J))if("function"===typeof J.toString){if(J=J.toString(),"string"!==typeof J)throw N("dirty is not a string, aborting");}else throw N("toString is not a function");if(!S.isSupported)return J;
|
|
101
|
+
ab||fb(M);S.removed=[];"string"===typeof J&&(Fa=!1);if(Fa){if(J.nodeName&&(M=da(J.nodeName),!ca[M]||Ea[M]))throw N("root node is forbidden and cannot be sanitized in-place");}else if(J instanceof Ua)P=Hb("\x3c!----\x3e"),R=P.ownerDocument.importNode(J,!0),R.nodeType===Ba.element&&"BODY"===R.nodeName?P=R:"HTML"===R.nodeName?P=R:P.appendChild(R);else{if(!wa&&!va&&!sa&&-1===J.indexOf("<"))return fa&&Na?fa.createHTML(J):J;P=Hb(J);if(!P)return wa?null:Na?Da:""}P&&bb&&pa(P.firstChild);for(M=Ib(Fa?J:P);R=
|
|
102
|
+
M.nextNode();)Kb(R),Nb(R),R.content instanceof lb&&ic(R.content);if(Fa)return J;if(wa){if(Ma)for(R=Wb.call(P.ownerDocument);P.firstChild;)R.appendChild(P.firstChild);else R=P;if(ea.shadowroot||ea.shadowrootmode)R=Yb.call(W,R,!0);return R}var ba=sa?P.outerHTML:P.innerHTML;sa&&ca["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&K(Ra,P.ownerDocument.doctype.name)&&(ba="<!DOCTYPE "+P.ownerDocument.doctype.name+">\n"+ba);va&&I([Wa,Xa,Ya],function(ja){ba=g(ba,ja," ")});
|
|
103
|
+
return fa&&Na?fa.createHTML(ba):ba};S.setConfig=function(){fb(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});ab=!0};S.clearConfig=function(){ua=null;ab=!1};S.isValidAttribute=function(J,M,P){ua||fb({});J=da(J);M=da(M);return Lb(J,M,P)};S.addHook=function(J,M){"function"===typeof M&&H(ha[J],M)};S.removeHook=function(J,M){return void 0!==M?(M=L(ha[J],M),-1===M?void 0:a(ha[J],M,1)[0]):G(ha[J])};S.removeHooks=function(J){ha[J]=[]};S.removeAllHooks=function(){ha=nb()};return S}var c=Object,
|
|
104
|
+
m=c.entries,k=c.setPrototypeOf,h=c.isFrozen,f=c.getPrototypeOf,r=c.getOwnPropertyDescriptor,A=Object,e=A.freeze;c=A.seal;var w=A.create;A="undefined"!==typeof Reflect&&Reflect;var F=A.apply,D=A.construct;e||(e=function(T){return T});c||(c=function(T){return T});F||(F=function(T,O,S){return T.apply(O,S)});D||(D=function(T,O){return new (Function.prototype.bind.apply(T,[null].concat($jscomp.arrayFromIterable(O))))});var I=q(Array.prototype.forEach),L=q(Array.prototype.lastIndexOf),G=q(Array.prototype.pop),
|
|
105
|
+
H=q(Array.prototype.push),a=q(Array.prototype.splice),b=q(String.prototype.toLowerCase),d=q(String.prototype.toString),p=q(String.prototype.match),g=q(String.prototype.replace),z=q(String.prototype.indexOf),y=q(String.prototype.trim),E=q(Object.prototype.hasOwnProperty),K=q(RegExp.prototype.test),N=function(T){return function(){for(var O=arguments.length,S=Array(O),U=0;U<O;U++)S[U]=arguments[U];return D(T,S)}}(TypeError),Q=e("a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dialog dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p picture pre progress q rp rt ruby s samp section select shadow small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" ")),
|
|
106
|
+
V=e("svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform circle clippath defs desc ellipse filter font g glyph glyphref hkern image line lineargradient marker mask metadata mpath path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan view vkern".split(" ")),X=e("feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),
|
|
107
|
+
ia=e("animate color-profile cursor discard font-face font-face-format font-face-name font-face-src font-face-uri foreignobject hatch hatchpath mesh meshgradient meshpatch meshrow missing-glyph script set solidcolor unknown use".split(" ")),ma=e("math menclose merror mfenced mfrac mglyph mi mlabeledtr mmultiscripts mn mo mover mpadded mphantom mroot mrow ms mspace msqrt mstyle msub msup msubsup mtable mtd mtext mtr munder munderover mprescripts".split(" ")),la=e("maction maligngroup malignmark mlongdiv mscarries mscarry msgroup mstack msline msrow semantics annotation annotation-xml mprescripts none".split(" ")),
|
|
108
|
+
ka=e(["#text"]),qa=e("accept action align alt autocapitalize autocomplete autopictureinpicture autoplay background bgcolor border capture cellpadding cellspacing checked cite class clear color cols colspan controls controlslist coords crossorigin datetime decoding default dir disabled disablepictureinpicture disableremoteplayback download draggable enctype enterkeyhint face for headers height hidden high href hreflang id inputmode integrity ismap kind label lang list loading loop low max maxlength media method min minlength multiple muted name nonce noshade novalidate nowrap open optimum pattern placeholder playsinline popover popovertarget popovertargetaction poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes span srclang start src srcset step style summary tabindex title translate type usemap valign value width wrap xmlns slot".split(" ")),
|
|
109
|
+
oa=e("accent-height accumulate additive alignment-baseline amplitude ascent attributename attributetype azimuth basefrequency baseline-shift begin bias by class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dur edgemode elevation end exponent fill fill-opacity fill-rule filter filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fx fy g1 g2 glyph-name glyphref gradientunits gradienttransform height href id image-rendering in in2 intercept k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio primitiveunits r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering slope specularconstant specularexponent spreadmethod startoffset stddeviation stitchtiles stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke stroke-width style surfacescale systemlanguage tabindex tablevalues targetx targety transform transform-origin text-anchor text-decoration text-rendering textlength type u1 u2 unicode values viewbox visibility version vert-adv-y vert-origin-x vert-origin-y width word-spacing wrap writing-mode xchannelselector ychannelselector x x1 x2 xmlns y y1 y2 z zoomandpan".split(" ")),
|
|
110
|
+
ra=e("accent accentunder align bevelled close columnsalign columnlines columnspan denomalign depth dir display displaystyle encoding fence frame height href id largeop length linethickness lspace lquote mathbackground mathcolor mathsize mathvariant maxsize minsize movablelimits notation numalign open rowalign rowlines rowspacing rowspan rspace rquote scriptlevel scriptminsize scriptsizemultiplier selection separator separators stretchy subscriptshift supscriptshift symmetric voffset width xmlns".split(" ")),
|
|
111
|
+
Y=e(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);A=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm);var Ha=c(/<%[\w\W]*|[\w\W]*%>/gm),Sa=c(/\$\{[\w\W]*/gm),kb=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ta=c(/^aria-[\-\w]+$/),Qa=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ia=c(/^(?:\w+script|data):/i),ta=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ra=c(/^html$/i);c=c(/^[a-z][.\w]*(-[.\w]+)+$/i);var ob=Object.freeze({__proto__:null,
|
|
112
|
+
ARIA_ATTR:Ta,ATTR_WHITESPACE:ta,CUSTOM_ELEMENT:c,DATA_ATTR:kb,DOCTYPE_NAME:Ra,ERB_EXPR:Ha,IS_ALLOWED_URI:Qa,IS_SCRIPT_OR_DATA:Ia,MUSTACHE_EXPR:A,TMPLIT_EXPR:Sa}),Ba={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fc=function(T,O){if("object"!==typeof T||"function"!==typeof T.createPolicy)return null;var S=null;O&&O.hasAttribute("data-tt-policy-suffix")&&(S=O.getAttribute("data-tt-policy-suffix"));
|
|
113
|
+
O="dompurify"+(S?"#"+S:"");try{return T.createPolicy(O,{createHTML:function(U){return U},createScriptURL:function(U){return U}})}catch(U){return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};return t()})},function(v,B){function u(){throw Error("setTimeout has not been defined");
|
|
114
|
+
}function q(){throw Error("clearTimeout has not been defined");}function n(w){if(k===setTimeout)return setTimeout(w,0);if((k===u||!k)&&setTimeout)return k=setTimeout,setTimeout(w,0);try{return k(w,0)}catch(F){try{return k.call(null,w,0)}catch(D){return k.call(this,w,0)}}}function x(w){if(h===clearTimeout)return clearTimeout(w);if((h===q||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(w);try{return h(w)}catch(F){try{return h.call(null,w)}catch(D){return h.call(this,w)}}}function l(){r&&A&&(r=
|
|
115
|
+
!1,A.length?f=A.concat(f):e=-1,f.length&&t())}function t(){if(!r){var w=n(l);r=!0;for(var F=f.length;F;){A=f;for(f=[];++e<F;)A&&A[e].run();e=-1;F=f.length}A=null;r=!1;x(w)}}function c(w,F){this.fun=w;this.array=F}function m(){}v=v.exports={};try{var k="function"===typeof setTimeout?setTimeout:u}catch(w){k=u}try{var h="function"===typeof clearTimeout?clearTimeout:q}catch(w){h=q}var f=[],r=!1,A,e=-1;v.nextTick=function(w){var F=Array(arguments.length-1);if(1<arguments.length)for(var D=1;D<arguments.length;D++)F[D-
|
|
116
|
+
1]=arguments[D];f.push(new c(w,F));1!==f.length||r||n(t)};c.prototype.run=function(){this.fun.apply(null,this.array)};v.title="browser";v.browser=!0;v.env={};v.argv=[];v.version="";v.versions={};v.on=m;v.addListener=m;v.once=m;v.off=m;v.removeListener=m;v.removeAllListeners=m;v.emit=m;v.prependListener=m;v.prependOnceListener=m;v.listeners=function(w){return[]};v.binding=function(w){throw Error("process.binding is not supported");};v.cwd=function(){return"/"};v.chdir=function(w){throw Error("process.chdir is not supported");
|
|
117
|
+
};v.umask=function(){return 0}},function(v,B,u){B.a=function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(q,n){void 0===q&&(q=0);void 0===n&&(n=this.byteLength);q=Math.floor(q);n=Math.floor(n);0>q&&(q+=this.byteLength);0>n&&(n+=this.byteLength);q=Math.min(Math.max(0,q),this.byteLength);n=Math.min(Math.max(0,n),this.byteLength);if(0>=n-q)return new ArrayBuffer(0);var x=new ArrayBuffer(n-q),l=new Uint8Array(x);q=new Uint8Array(this,q,n-q);l.set(q);return x})}},function(v,B,u){B.a=
|
|
118
|
+
function(q){var n={};decodeURIComponent(q.slice(1)).split("&").forEach(function(x){x=x.split("=",2);n[x[0]]=x[1]});return n}},function(v,B,u){(function(q){function n(I){"function"!==typeof I&&(I=new Function("".concat(I)));for(var L=Array(arguments.length-1),G=0;G<L.length;G++)L[G]=arguments[G+1];A[r]={callback:I,args:L};F(r);return r++}function x(I){delete A[I]}function l(I){if(e)setTimeout(l,0,I);else{var L=A[I];if(L){e=!0;try{var G=L.callback,H=L.args;switch(H.length){case 0:G();break;case 1:G(H[0]);
|
|
119
|
+
break;case 2:G(H[0],H[1]);break;case 3:G(H[0],H[1],H[2]);break;default:G.apply(void 0,H)}}finally{x(I),e=!1}}}}function t(){F=function(I){q.nextTick(function(){l(I)})}}function c(){if(f.postMessage&&!f.importScripts){var I=!0,L=f.onmessage;f.onmessage=function(){I=!1};f.postMessage("","*");f.onmessage=L;return I}}function m(){var I="setImmediate$".concat(Math.random(),"$"),L=function(G){G.source!==f&&G.source!==f.parent||"string"!==typeof G.data||0!==G.data.indexOf(I)||l(+G.data.slice(I.length))};
|
|
120
|
+
f.addEventListener?f.addEventListener("message",L,!1):f.attachEvent("onmessage",L);F=function(G){f.postMessage(I+G,"*")}}function k(){var I=w.documentElement;F=function(L){var G=w.createElement("script");G.onreadystatechange=function(){l(L);G.onreadystatechange=null;I.removeChild(G);G=null};I.appendChild(G)}}function h(){F=function(I){setTimeout(l,0,I)}}var f="undefined"===typeof window?self:window,r=1,A={},e=!1,w=f.document,F,D=Object.getPrototypeOf&&Object.getPrototypeOf(f);D=D&&D.setTimeout?D:
|
|
121
|
+
f;"[object process]"==={}.toString.call(f.process)?t():c()?m():w&&"onreadystatechange"in w.createElement("script")?k():h();D.setImmediate=n;D.clearImmediate=x;B.a={setImmediate:n,clearImmediate:x}}).call(this,u(14))},function(v,B,u){var q=u(0),n=u(2);v=function(){function x(l,t){this.name=l;this.comObj=t;this.callbackIndex=1;this.postMessageTransfers=!0;this.callbacksCapabilities={};this.actionHandler={};this.actionHandlerAsync={};this.pdfnetCommandChain=this.nextAsync=null;this.pdfnetActiveCommands=
|
|
122
|
+
new Set;this.isReset=!1;this.actionHandler.console_log=[function(c){Object(q.d)(c)}];this.actionHandler.console_error=[function(c){Object(q.c)(c)}];this.actionHandler.workerLoaded=[function(){}];this.msgHandler=this.handleMessage.bind(this);t.addEventListener("message",this.msgHandler)}x.prototype.on=function(l,t,c){var m=this.actionHandler;m[l]&&Object(q.c)('There is already an actionName called "'.concat(l,'"'));m[l]=[t,c]};x.prototype.clearActionHandlers=function(){this.actionHandler={};this.comObj.removeEventListener("message",
|
|
123
|
+
this.msgHandler)};x.prototype.reset=function(){var l=this;this.isReset=!0;Object.keys(this.callbacksCapabilities).forEach(function(t){l.cancelPromise(parseInt(t,10))});this.clearActionHandlers();this.comObj.reset&&this.comObj.reset();this.comObj={};this.callbacksCapabilities={}};x.prototype.replace=function(l,t,c){this.actionHandler[l]=[t,c]};x.prototype.onAsync=function(l,t,c){var m=this.actionHandlerAsync;m[l]&&Object(q.c)('There is already an actionName called "'.concat(l,'"'));m[l]=[t,c]};x.prototype.replaceAsync=
|
|
124
|
+
function(l,t,c){var m=this.actionHandlerAsync,k=this.actionHandler;k[l]&&delete k[l];m[l]=[t,c]};x.prototype.onNextAsync=function(l){this.nextAsync=l};x.prototype.send=function(l,t){this.postMessage({action:l,data:t})};x.prototype.getNextId=function(){return this.callbackIndex++};x.prototype.sendWithPromise=function(l,t,c){var m=this.getNextId();l={action:l,data:t,callbackId:m,priority:c};t=window.createPromiseCapability();if(!this.isReset){this.callbacksCapabilities[m]=t;try{this.postMessage(l)}catch(k){t.reject(k)}}return t.promise};
|
|
125
|
+
x.prototype.sendWithPromiseReturnId=function(l,t,c){var m=this.getNextId();l={action:l,data:t,callbackId:m,priority:c};t=window.createPromiseCapability();if(!this.isReset){this.callbacksCapabilities[m]=t;try{this.postMessage(l)}catch(k){t.reject(k)}}return{promise:t.promise,callbackId:m}};x.prototype.sendWithPromiseWithId=function(l,t,c){t>this.callbackIndex&&Object(q.c)("Can't reuse callbackId ".concat(t," lesser than callbackIndex ").concat(this.callbackIndex));t in this.callbacksCapabilities&&
|
|
126
|
+
Object(q.c)("Can't reuse callbackId ".concat(t,". There is a capability waiting to be resolved. "));l={action:l,data:c,callbackId:t};c=window.createPromiseCapability();if(!this.isReset){this.callbacksCapabilities[t]=c;try{this.postMessage(l)}catch(m){c.reject(m)}}return c.promise};x.prototype.sendError=function(l,t){if(l.message||l.errorData){l.message&&l.message.message&&(l.message=l.message.message);var c=l.errorData;l={type:l.type?l.type:"JavascriptError",message:l.message};c&&Object.keys(c).forEach(function(m){c.hasOwnProperty(m)&&
|
|
127
|
+
(l[m]=c[m])})}this.postMessage({isReply:!0,callbackId:t,error:l})};x.prototype.getPromise=function(l){if(l in this.callbacksCapabilities)return this.callbacksCapabilities[l];Object(q.c)("Cannot get promise for callback ".concat(l))};x.prototype.cancelPromise=function(l){if(l in this.callbacksCapabilities){var t=this.callbacksCapabilities[l];delete this.callbacksCapabilities[l];this.pdfnetActiveCommands.has(l)&&this.pdfnetActiveCommands.delete(l);t.reject({type:"Cancelled",message:"Request has been cancelled."});
|
|
128
|
+
this.postMessage({action:"actionCancel",data:{callbackId:l}})}else Object(q.b)("Cannot cancel callback ".concat(l))};x.prototype.postMessage=function(l){"officeeditor"!==this.name&&Object(n.a)("enableWorkerLogs")&&Object(q.d)("PDFWorker","".concat(performance.now()," Sent ").concat(JSON.stringify(l)));if(this.postMessageTransfers){var t=this.getTransfersArray(l);this.comObj.postMessage(l,t)}else this.comObj.postMessage(l)};x.prototype.getObjectTransfers=function(l,t){var c=this;null!==l&&"object"===
|
|
129
|
+
typeof l&&(l instanceof Uint8Array?t.push(l.buffer):l instanceof ArrayBuffer?t.push(l):Object.keys(l).forEach(function(m){l.hasOwnProperty(m)&&c.getObjectTransfers(l[m],t)}))};x.prototype.getTransfersArray=function(l){var t=[];this.getObjectTransfers(l,t);return 0===t.length?void 0:t};x.prototype.handleMessage=function(l){var t=this,c=l.data;"officeeditor"!==this.name&&Object(n.a)("enableWorkerLogs")&&Object(q.d)("PDFWorker","".concat(performance.now()," Received ").concat(JSON.stringify(c)));var m=
|
|
130
|
+
this.actionHandler,k=this.actionHandlerAsync;l=this.callbacksCapabilities;var h=this.pdfnetActiveCommands;if(c.isReply)m=c.callbackId,m in l?(k=l[m],delete l[m],h.has(m)&&h.delete(m),"error"in c?k.reject(c.error):k.resolve(c.data)):Object(q.a)("Cannot resolve callback ".concat(m));else if(c.action in m){var f=m[c.action];c.callbackId?Promise.resolve().then(function(){return f[0].call(f[1],c.data)}).then(function(r){t.postMessage({isReply:!0,callbackId:c.callbackId,data:r})},function(r){t.sendError(r,
|
|
131
|
+
c.callbackId)}):f[0].call(f[1],c.data)}else c.action in k?(f=k[c.action],c.callbackId?f[0].call(f[1],c).then(function(r){t.postMessage({isReply:!0,callbackId:c.callbackId,data:r});t.nextAsync()},function(r){t.sendError(r,c.callbackId);t.nextAsync()}):f[0].call(f[1],c).then(function(){t.nextAsync()},function(){t.nextAsync()})):Object(q.c)("Unknown action from worker: ".concat(c.action))};return x}();B.a=v},function(v,B,u){u.d(B,"a",function(){return c});var q=u(3),n=u(11),x=u(7),l=u(8),t=function(){function m(k){var h=
|
|
132
|
+
this;this.promise=k.then(function(f){h.response=f;h.status=200})}m.prototype.addEventListener=function(k,h){this.promise.then(h)};return m}(),c=function(m,k,h,f){if(Object(x.a)()&&!h){self.Module.instantiateWasm=function(A,e){return Object(n.a)("".concat(m,"Wasm.wasm"),A,k["Wasm.wasm"],f).then(function(w){e(w.instance)})};if(k.disableObjectURLBlobs){importScripts("".concat(m,"Wasm.js"));return}h=Object(q.b)("".concat(m,"Wasm.js.mem"),k["Wasm.js.mem"],!1,!1)}else{if(k.disableObjectURLBlobs){importScripts("".concat((self.Module.asmjsPrefix?
|
|
133
|
+
self.Module.asmjsPrefix:"")+m,".js"));return}h=Object(q.b)("".concat((self.Module.asmjsPrefix?self.Module.asmjsPrefix:"")+m,".js.mem"),k[".js.mem"],!1);var r=Object(q.b)("".concat((self.Module.memoryInitializerPrefixURL?self.Module.memoryInitializerPrefixURL:"")+m,".mem"),k[".mem"],!0,!0);self.Module.memoryInitializerRequest=new t(r)}h=new Blob([h],{type:"application/javascript"});importScripts(Object(l.a)(URL.createObjectURL(h)))}},function(v,B,u){u.d(B,"a",function(){return q});var q="optimized/"},
|
|
134
|
+
function(v,B,u){v.exports=u(22)},function(v,B,u){u.r(B);u(7);v=u(15);u(23);u(24);u(27);u(28);u(29);u(30);u(31);Object(v.a)()},function(v,B,u){(function(q){"undefined"===typeof q.crypto&&(q.crypto={getRandomValues:function(n){for(var x=0;x<n.length;x++)n[x]=256*Math.random()}})})("undefined"===typeof window?self:window)},function(v,B,u){(function(q,n){function x(l){"@babel/helpers - typeof";return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&
|
|
135
|
+
"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(l)}(function(l){function t(){for(var y=0;y<g.length;y++)g[y][0](g[y][1]);g=[];z=!1}function c(y,E){g.push([y,E]);z||(z=!0,p(t,0))}function m(y,E){function K(Q){f(E,Q)}function N(Q){A(E,Q)}try{y(K,N)}catch(Q){N(Q)}}function k(y){var E=y.owner,K=E.state_;E=E.data_;var N=y[K];y=y.then;if("function"===typeof N){K=a;try{E=N(E)}catch(Q){A(y,Q)}}h(y,E)||(K===a&&f(y,E),K===b&&A(y,E))}function h(y,E){var K;try{if(y===
|
|
136
|
+
E)throw new TypeError("A promises callback cannot return that same promise.");if(E&&("function"===typeof E||"object"===x(E))){var N=E.then;if("function"===typeof N)return N.call(E,function(Q){K||(K=!0,E!==Q?f(y,Q):r(y,Q))},function(Q){K||(K=!0,A(y,Q))}),!0}}catch(Q){return K||A(y,Q),!0}return!1}function f(y,E){y!==E&&h(y,E)||r(y,E)}function r(y,E){y.state_===G&&(y.state_=H,y.data_=E,c(w,y))}function A(y,E){y.state_===G&&(y.state_=H,y.data_=E,c(F,y))}function e(y){var E=y.then_;y.then_=void 0;for(y=
|
|
137
|
+
0;y<E.length;y++)k(E[y])}function w(y){y.state_=a;e(y)}function F(y){y.state_=b;e(y)}function D(y){if("function"!==typeof y)throw new TypeError("Promise constructor takes a function argument");if(!(this instanceof D))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[];m(y,this)}l.createPromiseCapability=function(){var y={};y.promise=new D(function(E,K){y.resolve=E;y.reject=K});return y};var I=l.Promise,
|
|
138
|
+
L=I&&"resolve"in I&&"reject"in I&&"all"in I&&"race"in I&&function(){var y;new I(function(E){y=E});return"function"===typeof y}();"undefined"!==typeof exports&&exports?(exports.Promise=L?I:D,exports.Polyfill=D):"function"===typeof define&&u(26)?define(function(){return L?I:D}):L||(l.Promise=D);var G="pending",H="sealed",a="fulfilled",b="rejected",d=function(){},p="undefined"!==typeof n?n:setTimeout,g=[],z;D.prototype={constructor:D,state_:G,then_:null,data_:void 0,then:function(y,E){y={owner:this,
|
|
139
|
+
then:new this.constructor(d),fulfilled:y,rejected:E};this.state_===a||this.state_===b?c(k,y):this.then_.push(y);return y.then},"catch":function(y){return this.then(null,y)}};D.all=function(y){if("[object Array]"!==Object.prototype.toString.call(y))throw new TypeError("You must pass an array to Promise.all().");return new this(function(E,K){function N(ma){V++;return function(la){Q[ma]=la;--V||E(Q)}}for(var Q=[],V=0,X=0,ia;X<y.length;X++)(ia=y[X])&&"function"===typeof ia.then?ia.then(N(X),K):Q[X]=ia;
|
|
140
|
+
V||E(Q)})};D.race=function(y){if("[object Array]"!==Object.prototype.toString.call(y))throw new TypeError("You must pass an array to Promise.race().");return new this(function(E,K){for(var N=0,Q;N<y.length;N++)(Q=y[N])&&"function"===typeof Q.then?Q.then(E,K):E(Q)})};D.resolve=function(y){return y&&"object"===x(y)&&y.constructor===this?y:new this(function(E){E(y)})};D.reject=function(y){return new this(function(E,K){K(y)})}})("undefined"!==typeof window?window:"undefined"!==typeof q?q:"undefined"!==
|
|
141
|
+
typeof self?self:void 0)}).call(this,u(12),u(10).setImmediate)},function(v,B,u){(function(q,n){(function(x,l){function t(G){delete w[G]}function c(G){if(F)setTimeout(c,0,G);else{var H=w[G];if(H){F=!0;try{var a=H.callback,b=H.args;switch(b.length){case 0:a();break;case 1:a(b[0]);break;case 2:a(b[0],b[1]);break;case 3:a(b[0],b[1],b[2]);break;default:a.apply(l,b)}}finally{t(G),F=!1}}}}function m(){I=function(G){n.nextTick(function(){c(G)})}}function k(){if(x.postMessage&&!x.importScripts){var G=!0,H=
|
|
142
|
+
x.onmessage;x.onmessage=function(){G=!1};x.postMessage("","*");x.onmessage=H;return G}}function h(){var G="setImmediate$"+Math.random()+"$",H=function(a){a.source===x&&"string"===typeof a.data&&0===a.data.indexOf(G)&&c(+a.data.slice(G.length))};x.addEventListener?x.addEventListener("message",H,!1):x.attachEvent("onmessage",H);I=function(a){x.postMessage(G+a,"*")}}function f(){var G=new MessageChannel;G.port1.onmessage=function(H){c(H.data)};I=function(H){G.port2.postMessage(H)}}function r(){var G=
|
|
143
|
+
D.documentElement;I=function(H){var a=D.createElement("script");a.onreadystatechange=function(){c(H);a.onreadystatechange=null;G.removeChild(a);a=null};G.appendChild(a)}}function A(){I=function(G){setTimeout(c,0,G)}}if(!x.setImmediate){var e=1,w={},F=!1,D=x.document,I,L=Object.getPrototypeOf&&Object.getPrototypeOf(x);L=L&&L.setTimeout?L:x;"[object process]"==={}.toString.call(x.process)?m():k()?h():x.MessageChannel?f():D&&"onreadystatechange"in D.createElement("script")?r():A();L.setImmediate=function(G){"function"!==
|
|
144
|
+
typeof G&&(G=new Function(""+G));for(var H=Array(arguments.length-1),a=0;a<H.length;a++)H[a]=arguments[a+1];w[e]={callback:G,args:H};I(e);return e++};L.clearImmediate=t}})("undefined"===typeof self?"undefined"===typeof q?this:q:self)}).call(this,u(12),u(14))},function(v,B){v.exports={}},function(v,B,u){(function(q){var n=function(x,l){var t=function(m){m=this["catch"](m);return{cancel:l,promise:m,then:c.bind(m),"catch":t.bind(m)}},c=function(m,k){m=this.then(m,k);return{cancel:l,promise:m,then:c.bind(m),
|
|
145
|
+
"catch":t.bind(m)}};return{cancel:l,promise:x,then:c.bind(x),"catch":t.bind(x)}};q.CancellablePromise=function(x,l){var t=!1,c,m=new Promise(function(k,h){c=function(){t||(l(),h("cancelled"))};(new Promise(x)).then(function(f){t=!0;k(f)},function(f){t=!0;h(f)})});return n(m,c)};q.CancellablePromise.all=function(x){var l=Promise.all(x);return n(l,function(){x.forEach(function(t){t.cancel&&t.cancel()})})}})("undefined"===typeof self?void 0:self)},function(v,B,u){(function(q,n){function x(m){"@babel/helpers - typeof";
|
|
146
|
+
return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},x(m)}function l(m,k){var h=Object.keys(m);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(m);k&&(f=f.filter(function(r){return Object.getOwnPropertyDescriptor(m,r).enumerable}));h.push.apply(h,f)}return h}function t(m){for(var k=1;k<arguments.length;k++){var h=null!=arguments[k]?
|
|
147
|
+
arguments[k]:{};k%2?l(Object(h),!0).forEach(function(f){var r,A=h[f];a:if("object"==x(f)&&f){var e=f[Symbol.toPrimitive];if(void 0!==e){f=e.call(f,"string");if("object"!=x(f))break a;throw new TypeError("@@toPrimitive must return a primitive value.");}f=String(f)}(r="symbol"==x(f)?f:f+"")in m?Object.defineProperty(m,r,{value:A,enumerable:!0,configurable:!0,writable:!0}):m[r]=A}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(h)):l(Object(h)).forEach(function(f){Object.defineProperty(m,
|
|
148
|
+
f,Object.getOwnPropertyDescriptor(h,f))})}return m}var c=u(1);(function(m){m.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(k,h,f){Module.workerMessageHandler.send("event",{docId:k,type:h,data:f})},postProgressiveRenderingStartEvent:function(k,h){Module.postEvent(k,"progressiveRenderingStart",{pageNum:h})},postPagesUpdatedEvent:function(k,h,f,r){k={pageDimensions:Module.GetPageDimensions(k)};
|
|
149
|
+
if(f)for(var A=0;A<f.length;++A)f[A]in k.pageDimensions?(k.pageDimensions[f[A]].contentChanged=!0,r&&(k.pageDimensions[f[A]].annotationsUnchanged=!0)):console.warn("Invalid Page Number ".concat(f[A]));Module.postEvent(h,"pagesUpdated",k);return k},postPagesRenamedEvent:function(k,h){var f={};k=Module.PDFDocGetPageIterator(k,1);for(var r=1;Module.IteratorHasNext(k);++r){var A=Module.stackSave(),e=Module.IteratorCurrent(k);f[r]=Module.PageGetId(e);Module.IteratorNext(k);Module.stackRestore(A)}Module.postEvent(h,
|
|
150
|
+
"pagesRenamed",{pageNumToId:f})},GetAnnotationObjs:function(k){var h=[],f=1;for(k=Module.PDFDocGetPageIterator(k,1);Module.IteratorHasNext(k);Module.IteratorNext(k)){for(var r=Module.PageGetNumAnnots(Module.IteratorCurrent(k)),A=0;A<r;++A){var e=Module.PageGetAnnot(Module.IteratorCurrent(k),A);e=Module.AnnotGetSDFObjNum(e);h.push(e)}f++}return h},GetLinearizedSaveReferenceChanges:function(k,h){var f=[],r=0,A=1;for(k=Module.PDFDocGetPageIterator(k,1);Module.IteratorHasNext(k);Module.IteratorNext(k))for(var e=
|
|
151
|
+
Module.PageGetNumAnnots(Module.IteratorCurrent(k)),w=0;w<e;++w){var F=Module.PageGetAnnot(Module.IteratorCurrent(k),w),D=Module.AnnotGetSDFObjNum(F);D!=h[r]&&(F=Module.AnnotGetSDFObjGen(F),f.push({oldObjNum:h[r],discardAppearance:!1,newObjNum:D,genNum:F,pageNum:A}));++r;++A}r!=h.length&&console.warn("Annotation count has changed, cannot sync all the new obj numbers.");return f},GetIndividualPageDimensions:function(k,h,f){k=Module.PageGetPageInfo(f);k.id=Module.PageGetId(f);return k},GetPageDimensionsRange:function(k,
|
|
152
|
+
h,f){for(var r={},A=Module.PDFDocGetPageIterator(k,h);h<f&&Module.IteratorHasNext(A);++h){var e=Module.stackSave(),w=Module.IteratorCurrent(A);r[h]=this.GetIndividualPageDimensions(k,h,w);Module.IteratorNext(A);Module.stackRestore(e)}return r},GetPageDimensionsContentChangedList:function(k,h){h.sort(function(I,L){return I-L});for(var f={},r=h[0],A=h[h.length-1],e=0,w=Module.PDFDocGetPageIterator(k,r);r<=A&&Module.IteratorHasNext(w);++r){if(h[e]==r){for(++e;h[e]==r;)++e;var F=Module.stackSave(),D=
|
|
153
|
+
Module.IteratorCurrent(w);D=this.GetIndividualPageDimensions(k,r,D);D.contentChanged=!0;f[r]=D;Module.stackRestore(F)}Module.IteratorNext(w)}return f},GetPageDimensions:function(k){try{var h=Module.stackSave();var f=Module.GetPageCount(k);if(0===f)throw"This document has no pages.";return Module.GetPageDimensionsRange(k,1,f+1)}finally{Module.stackRestore(h)}},loadDoc:function(k,h){"undefined"===typeof Module&&this._main();var f=null;try{var r=Module.stackSave();k.customHandlerId&&Module._TRN_PDFNetAddPDFTronCustomHandler(k.customHandlerId);
|
|
154
|
+
h=Module.CreateDoc(k,h);var A=Module.GetDoc(h);if(Module.PDFDocInitSecurityHandler(A))return{docId:h,pageDimensions:Module.GetPageDimensions(A)};f={type:"NeedsPassword",errorData:{docId:h},message:"This document requires a password"}}catch(e){f={type:"InvalidPDF",message:e}}finally{Module.stackRestore(r)}throw f;},loadCanvas:function(k,h,f,r,A,e,w,F){var D=Module.GetDoc(k),I=Module.docs[k].chunkStorage,L=Promise.resolve();if(I&&2===F.overprintMode){var G=Module.GetDownloadData(D);if(!G.docInfoRequested){var H=
|
|
155
|
+
Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DownloaderPrefetchDocInfo(G.downloader,H));0==Module.getValue(H,"i8")&&(L=G.docInfoPromiseCapability.promise);G.docInfoRequested=!0}}return new Promise(function(a,b){var d=h+1,p=function(){a(L.then(function(){return Module.RasterizePage(D,d,f,r,e,A,w,F,k)}))};if(I){var g=Module.GetDownloadData(D).downloader,z=I.getRequiredChunkOffsetArrays(g,d);I.keepChunks(z.have);g=function(){var y=I.getChunks(z.missing);Module.loadPromise=y.then(function(){var E=
|
|
156
|
+
Module.loadPromise.cancelled;Module.loadPromise=null;E||p()})["catch"](function(E){"cancelled"!==E?b(E):Module.loadPromise=null})};Module.loadPromise?Module.loadPromise.then(g,g):g()}else p()})},loadResources:function(k,h){Module.Initialize(h);Object(c.b)("worker","PDFNet initialized!");Module._TRN_PDFNetSetDefaultDiskCachingEnabled(!1);k=new Uint8Array(k);Module.PDFNetSetResourceData(k)},onRuntimeInitialized:function(){"undefined"===typeof Module&&(("undefined"!==typeof window?window:self).Module=
|
|
157
|
+
{});(function(k){k.PDFDocExportXFDF=function(h,f){h=Module.GetDoc(h);var r=Module.stackSave();try{var A=f?Module.PDFDocFDFExtract(h,f):Module.PDFDocFDFExtract(h);var e=Module.FDFDocSaveAsXFDF(A);Module.stackRestore(r)}catch(w){throw Module.stackRestore(r),w;}return e};k.PageArrayToPageSet=function(h){var f=Module.stackSave();try{var r=Module.PageSetCreate();for(var A=0;A<h.length;++A)Module.PageSetAddPage(r,h[A]);Module.stackRestore(f)}catch(e){throw Module.stackRestore(f),e;}return r};k.cancelCurrent=
|
|
158
|
+
function(){var h=Module.loadPromise;return h?(h.cancel(),h.cancelled=!0):(h=Module.cleanupState)?(q(h.timeout),h.cleanupArr.reverse().forEach(function(f){f()}),Module.cleanupState=null,!0):!1};k.SetWorkerRestartCallback=function(h){Module.workerRestartCallback=h};k.XFDFMerge=function(h,f,r){if(f){var A=Module.GetDoc(h),e=[];try{Object(c.b)("worker","Merge XFDF of length ".concat(f.length));var w=Module.GetUStringFromJSString(f,!0);e.push(function(){Module.UStringDestroy(w)});var F=Module.allocate(4,
|
|
159
|
+
"i8",Module.ALLOC_STACK);REX(Module._TRN_FDFDocCreateFromXFDF(w,F));var D=Module.getValue(F,"i8*");e.push(function(){Module.FDFDocDestroy(D)});var I=Module.PDFDocFDFUpdate(A,D,r);I&&I.length&&Module.postEvent(h,"apRefChanged",{apRefChanges:I})}finally{e.reverse().forEach(function(L){L()})}}};k.ExecuteXFDFCommand=function(h,f){f&&REX(Module._TRN_PDFDocMergeXFDFString(Module.GetDoc(h),Module.GetUStringFromJSString(f),null))};k.MergeXFDF=function(h,f,r){return new Promise(function(A,e){var w=[];try{var F=
|
|
160
|
+
Module.stackSave();w[w.length]=function(){Module.stackRestore(F)};Module.XFDFMerge(h,f,r);w.forEach(function(D){D()});A({})}catch(D){w.forEach(function(I){I()}),e(D)}})};k.CreateBufferFile=function(h,f,r){Module.MakeDev(h);var A=new ArrayBuffer(f);A=new Uint8Array(A);r=r?0:255;for(var e=0;e<f;++e)A[e]=r;Module.docs[h]={buffer:A}};k.ReadBufferFile=function(h,f){var r=Module.docs[h].buffer;f&&(Module.docs[h].buffer=new Uint8Array(r.buffer.slice(0)));return r};k.RemoveBufferFile=function(h){Module.docs[h]=
|
|
161
|
+
null};k.SaveHelper=function(h,f,r){r="undefined"===typeof r?2:r;Module.MakeDev(f);var A=[];r&16&&(A=Module.GetAnnotationObjs(h));var e=Module._TRN_PDFDocSave(h,Module.GetUStringFromJSString(f),r);Module.docs[f].sink=null;REX(e);r&16&&(Module.postPagesRenamedEvent(h,f),0<A.length&&(h=Module.GetLinearizedSaveReferenceChanges(h,A),0<h.length&&Module.postEvent(f,"apRefChanged",{apRefChanges:h})));return Module.docs[f].buffer.buffer};k.SaveDoc=function(h,f,r,A,e,w,F,D,I,L){return new Promise(function(G,
|
|
162
|
+
H){var a=[];try{var b=Module.GetDoc(h),d=Module.stackSave();a[a.length]=function(){Module.stackRestore(d)};f?Module.XFDFMerge(h,f,F):L&&Module.ExecuteXFDFCommand(h,L);var p=Module.allocate(8,"i8",Module.ALLOC_STACK),g=Module.allocate(Module.intArrayFromString('{"UseNonStandardRotation": true}'),"i8",Module.ALLOC_STACK);Module.setValue(p,g,"i8*");Module.setValue(p+4,0,"i32");Module._TRN_PDFDocRefreshAnnotAppearances(b,p);if(w){p=function(Y){Y=new Uint8Array(Y);m.FS.writeFile("watermarkFile",Y);Y=Module.ImageCreateFromFile(b,
|
|
163
|
+
Module.GetUStringFromJSString("watermarkFile"));m.FS.unlink("watermarkFile");return Y};var z=Module.ElementBuilderCreate();a.push(function(){Module.ElementBuilderDestroy(z)});var y=Module.ElementWriterCreate();a.push(function(){Module.ElementWriterDestroy(y)});try{if(!w.hasOwnProperty("default"))throw Error("Watermark dictionary has no 'default' key!");var E=p(w["default"]),K=Module.PDFDocGetPageIterator(b,1);for(g=-1;Module.IteratorHasNext(K);){var N=Module.IteratorCurrent(K);Module.IteratorNext(K);
|
|
164
|
+
g++;var Q=g.toString();try{var V=void 0;if(w.hasOwnProperty(Q)){var X=w[Q];if(X)V=p(X);else continue}else V=E;var ia=Module.PageGetPageInfo(N),ma=Module.ElementBuilderCreateImage(z,V,0,0,ia.width,ia.height);Module.ElementWriterBegin(y,N);Module.ElementWriterWritePlacedElement(y,ma);Module.ElementWriterEnd(y)}catch(Y){console.warn("Watermark for page "+Q+"can not be added due to error: "+Y)}}}catch(Y){console.warn("Watermarks can not be added due to error: "+Y)}}if(D){var la=Module.SecurityHandlerCreate(I);
|
|
165
|
+
la&&(Module.SecurityHandlerChangeUserPasswordUString(la,D),Module.PDFDocSetSecurityHandler(b,la))}E=0;if(A){var ka=Module.PDFDocGetRoot(b);(E=Module.ObjFindObj(ka,"OpenAction"))&&Module.ObjPut(ka,"__OpenActionBackup__",E);var qa=Module.ObjPutDict(ka,"OpenAction");Module.ObjPutName(qa,"Type","Action");Module.ObjPutName(qa,"S","JavaScript");Module.ObjPutString(qa,"JS","this.print()")}var oa=Module.SaveHelper(b,h,e);A&&(E?Module.ObjPut(ka,"OpenAction",Module.ObjFindObj(ka,"__OpenActionBackup__")):Module.ObjErase(ka,
|
|
166
|
+
"OpenAction"));a.reverse().forEach(function(Y){Y()});if(r)G({fileData:oa});else{var ra=oa.slice(0);G({fileData:ra})}}catch(Y){a.reverse().forEach(function(Ha){Ha()}),H(Y)}})};k.SaveDocFromFixedElements=function(h,f,r,A,e,w,F){h=Module.CreateDocFromLayoutEls(h);h=Module.CreateDoc({type:"ptr",value:h});return Module.SaveDoc(h,f,!0,!1,r,A,e,w,F)};k.GetCurrentCanvasData=function(h){var f=Module.currentRenderData;if(!f)return null;h&&REX(Module._TRN_PDFRasterizerUpdateBuffer(f.rast));var r=Date.now();
|
|
167
|
+
if(f.bufPtr){h=new Uint8Array(new ArrayBuffer(f.buf_size));for(var A=0,e=0;e<f.out_height;++e)for(var w=f.bufPtr+f.stride*e,F=0;F<f.out_width;++F)h[A++]=Module.HEAPU8[w+2],h[A++]=Module.HEAPU8[w+1],h[A++]=Module.HEAPU8[w],h[A++]=Module.HEAPU8[w+3],w+=4}else h=Module.ReadBufferFile("b",h);Object(c.b)("bufferTiming","Copy took ".concat(Date.now()-r));return{pageBuf:h.buffer,pageWidth:f.out_width,pageHeight:f.out_height}};k.RasterizePage=function(h,f,r,A,e,w,F,D,I){return new Promise(function(L,G){Module.currentRenderData=
|
|
168
|
+
{};var H=Module.currentRenderData;H.out_width=parseInt(r,10);H.out_height=parseInt(A,10);var a=[];a.push(function(){Module.currentRenderData=null});try{var b=Module.stackSave();a[a.length]=function(){Module.stackRestore(b)};var d=Module.GetPage(h,f),p=Module.PageGetPageWidth(d),g=Module.PageGetPageHeight(d);H.stride=4*H.out_width;H.buf_size=H.out_width*H.out_height*4;Object(c.b)("Memory","Created rasterizer");H.rast=Module.PDFRasterizerCreate();a.push(function(){Object(c.b)("Memory","Destroyed rasterizer");
|
|
169
|
+
Module._TRN_PDFRasterizerDestroy(H.rast)});if(F){var z=Module.EMSCreateUpdatedLayersContext(h,F);0!==z&&(REX(Module._TRN_PDFRasterizerSetOCGContext(H.rast,z)),a.push(function(){Module._TRN_OCGContextDestroy(z)}))}var y=!1;D.hasOwnProperty("renderAnnots")?(D.renderAnnots&&(y=!0),REX(Module._TRN_PDFRasterizerSetDrawAnnotations(H.rast,D.renderAnnots?1:0))):REX(Module._TRN_PDFRasterizerSetDrawAnnotations(H.rast,0));D.hasOwnProperty("highlightFields")&&(D.highlightFields&&(y=!0),REX(Module._TRN_PDFRasterizerSetHighlightFields(H.rast,
|
|
170
|
+
D.highlightFields)));D.hasOwnProperty("antiAliasing")&&REX(Module._TRN_PDFRasterizerSetAntiAliasing(H.rast,D.antiAliasing));D.hasOwnProperty("pathHinting")&&REX(Module._TRN_PDFRasterizerSetPathHinting(H.rast,D.pathHinting));if(D.hasOwnProperty("thinLinePixelGridFit")){var E=!0;D.hasOwnProperty("thinLineStrokeAdjust")&&(E=D.thinLineStrokeAdjust);REX(Module._TRN_PDFRasterizerSetThinLineAdjustment(H.rast,D.thinLinePixelGridFit,E))}else D.hasOwnProperty("thinLineStrokeAdjust")&&REX(Module._TRN_PDFRasterizerSetThinLineAdjustment(H.rast,
|
|
171
|
+
!1,D.thinLineStrokeAdjust));D.hasOwnProperty("thinLineScaling")&&REX(Module._TRN_PDFRasterizerSetThinLineScaling(H.rast,D.thinLineScaling));if(D.hasOwnProperty("nightModeTuningContrast")||D.hasOwnProperty("nightModeTuningSaturation")||D.hasOwnProperty("nightModeTuningFlipness")){var K=D.hasOwnProperty("nightModeTuningContrast")?D.nightModeTuningContrast:.9,N=D.hasOwnProperty("nightModeTuningSaturation")?D.nightModeTuningSaturation:.8,Q=D.hasOwnProperty("nightModeTuningFlipness")?D.nightModeTuningFlipness:
|
|
172
|
+
1;REX(Module._TRN_PDFRasterizerSetNightModeTuning(H.rast,K,N,Q))}D.hasOwnProperty("imageSmoothing")?(E=!1,D.hasOwnProperty("hqImageResampling")&&(E=D.hqImageResampling),REX(Module._TRN_PDFRasterizerSetImageSmoothing(H.rast,D.imageSmoothing,E))):D.hasOwnProperty("hqImageResampling")&&REX(Module._TRN_PDFRasterizerSetImageSmoothing(H.rast,!0,D.hqImageResampling));D.hasOwnProperty("caching")&&REX(Module._TRN_PDFRasterizerSetCaching(H.rast,D.caching));D.hasOwnProperty("expGamma")&&REX(Module._TRN_PDFRasterizerSetGamma(H.rast,
|
|
173
|
+
D.expGamma));D.hasOwnProperty("isPrinting")&&(D.isPrinting&&(y=!0),REX(Module._TRN_PDFRasterizerSetPrintMode(H.rast,D.isPrinting)));D.hasOwnProperty("colorPostProcessMode")&&(D.colorPostProcessMode&&(y=!0),REX(Module._TRN_PDFRasterizerSetColorPostProcessMode(H.rast,D.colorPostProcessMode)));var V=Module.PageGetRotation(d);E=1===w||3===w;V=(1===V||3===V)!==E;var X=Module.allocate(48,"i8",Module.ALLOC_STACK);if(e){e.x1=e[0];e.y1=e[1];e.x2=e[2];e.y2=e[3];var ia=Module.PageGetDefaultMatrix(d,0),ma=Module.Matrix2DInverse(ia);
|
|
174
|
+
e=Module.Matrix2DMultBBox(ma,e);if(e.x2<e.x1){var la=e.x1;e.x1=e.x2;e.x2=la}e.y2<e.y1&&(la=e.y1,e.y1=e.y2,e.y2=la);var ka=H.out_width/(V?e.y2-e.y1:e.x2-e.x1);var qa=Module.GetDefaultMatrixBox(d,e,w)}else qa=Module.PageGetDefaultMatrix(d,w),ka=H.out_width/(E?g:p);Module.Matrix2DSet(X,ka,0,0,ka,0,0);Module.Matrix2DConcat(X,qa);var oa=Module.allocate(4,"i8",Module.ALLOC_STACK),ra=Module.allocate(4,"i8",Module.ALLOC_STACK);y?(H.bufPtr=Module._malloc(H.buf_size),Module._memset(H.bufPtr,D.pageTransparent?
|
|
175
|
+
0:255,H.buf_size),a.push(function(){Module._free(H.bufPtr)})):(Module.CreateBufferFile("b",H.buf_size,D.pageTransparent),a.push(function(){Module.RemoveBufferFile("b")}));var Y=D.overprintMode;if(10===Y){REX(Module._TRN_PDFRasterizerSetOverprint(H.rast,1));var Ha=Module.PDFRasterizerRasterizeSeparations(H.rast,d,H.out_width,H.out_height,X,0,0);L({pageBuf:Ha,pageWidth:H.out_width,pageHeight:H.out_height})}else{REX(Module._TRN_PDFRasterizerSetOverprint(H.rast,Y));y?REX(Module._TRN_PDFRasterizerGetChunkRenderer(H.rast,
|
|
176
|
+
d,H.bufPtr,H.out_width,H.out_height,H.stride,4,!0,X,0,0,0,oa)):REX(Module._TRN_PDFRasterizerGetChunkRendererPath(H.rast,d,Module.GetUStringFromJSString("b"),H.out_width,H.out_height,!0,X,0,0,0,oa));var Sa=Module.getValue(oa,"i8*");a.push(function(){REX(Module._TRN_ChunkRendererDestroy(Sa))})}var kb=(new Date).getTime(),Ta=function(){try{if(REX(Module._TRN_ChunkRendererRenderForTimePeriod(Sa,200,ra)),Module.getValue(ra,"i8"))Module.cleanupState.timeout=n(Ta);else{var Ia=Module.GetCurrentCanvasData(!1);
|
|
177
|
+
Object(c.b)("worker","Total Page Time ".concat((new Date).getTime()-kb));a.reverse().forEach(function(ta){ta()});L(Ia)}}catch(ta){a.reverse().forEach(function(Ra){Ra()}),G(ta)}};D.useProgress&&Module.postProgressiveRenderingStartEvent(I,f);var Qa=n(Ta);Module.cleanupState={cleanupArr:a,timeout:Qa};a.push(function(){Module.cleanupState=null})}catch(Ia){a.reverse().forEach(function(ta){ta()}),G(Ia)}})};k.UpdatePassword=function(h,f){try{var r=Module.stackSave();var A=Module.GetDoc(h);return Module.PDFDocInitStdSecurityHandler(A,
|
|
178
|
+
f)?(A in downloadDataMap&&REX(Module._TRN_PDFDocDownloaderInitialize(A,downloadDataMap[A].downloader)),{success:!0,pageDimensions:Module.GetPageDimensions(A)}):{success:!1}}finally{Module.stackRestore(r)}};k.UpdateCustomHeader=function(h,f){Module.customHeadersMap[h]=h in Module.customHeadersMap?t(t({},Module.customHeadersMap[h]),f):f;Module.docs[h].chunkStorage&&(Module.docs[h].chunkStorage.customHeaders=Module.customHeadersMap[h])};k.TriggerFullDownload=function(h){return new Promise(function(f,
|
|
179
|
+
r){var A=Module.GetDoc(h);try{A in downloadDataMap&&REX(Module.PDFDocDownloaderTriggerFullDownload(A,downloadDataMap[A].downloader)),f({})}catch(e){r(e)}})};k.InsertBlankPages=function(h,f,r,A){return new Promise(function(e,w){var F=[],D=Module.GetDoc(h);try{var I=Module.stackSave();F[F.length]=function(){Module.stackRestore(I)};for(var L=f.length-1;0<=L;--L){var G=Module.PDFDocGetPageIterator(D,f[L]),H=Module.PDFDocPageCreate(D,r,A);Module.PDFDocPageInsert(D,G,H)}var a=Module.postPagesUpdatedEvent(D,
|
|
180
|
+
h);F.forEach(function(b){b()});e(a)}catch(b){F.forEach(function(d){d()}),w(b)}})};k.InsertPages=function(h,f,r,A,e,w){return new Promise(function(F,D){var I=[],L=Module.GetDoc(h);try{var G=Module.stackSave();I[I.length]=function(){Module.stackRestore(G)};if(f instanceof ArrayBuffer){var H=Module.CreateDoc(f);var a=Module.GetDoc(H);I[I.length]=function(){Module.DeleteDoc(H)}}else a=Module.GetDoc(f);for(var b=r.length,d=Module.PageSetCreate(),p=0;p<b;++p)Module.PageSetAddPage(d,r[p]);w?Module.PDFDocInsertPages2(L,
|
|
181
|
+
A,a,d,e):Module.PDFDocInsertPages(L,A,a,d,e);var g;w||(g=Module.postPagesUpdatedEvent(L,h));I.reverse().forEach(function(z){z()});F(g)}catch(z){I.reverse().forEach(function(y){y()}),D(z)}})};k.MovePages=function(h,f,r){return new Promise(function(A,e){var w=[],F=Module.GetDoc(h);try{var D=Module.stackSave();w[w.length]=function(){Module.stackRestore(D)};for(var I=f.length,L=Module.PageSetCreate(),G=0;G<I;++G)Module.PageSetAddPage(L,f[G]);Module.PDFDocMovePages(F,r,L);var H=Module.postPagesUpdatedEvent(F,
|
|
182
|
+
h);w.forEach(function(a){a()});A(H)}catch(a){w.forEach(function(b){b()}),e(a)}})};k.RemovePages=function(h,f,r){return new Promise(function(A,e){var w=Module.GetDoc(h),F=[];try{var D=Module.stackSave();F[F.length]=function(){Module.stackRestore(D)};for(var I=f.length-1;0<=I;--I){var L=Module.PDFDocGetPageIterator(w,f[I]);Module.IteratorHasNext(L)&&(r?Module.PDFDocPageRemove2(w,L):Module.PDFDocPageRemove(w,L))}var G;r||(G=Module.postPagesUpdatedEvent(w,h));F.forEach(function(H){H()});A(G)}catch(H){F.forEach(function(a){a()}),
|
|
183
|
+
e(H)}})};k.RotatePages=function(h,f,r){return new Promise(function(A,e){var w=Module.GetDoc(h),F=[];try{var D=Module.stackSave();F[F.length]=function(){Module.stackRestore(D)};var I=f.length,L=0,G=Module.PDFDocGetPageIterator(w,f[0]),H=[];F.push(function(){Module._TRN_IteratorDestroy(G)});for(var a=f[0];Module.IteratorHasNext(G)&&L<f[I-1];++a){if(a===f[L]){var b=Module.IteratorCurrent(G),d=(Module.PageGetRotation(b)+r)%4;Module.PageSetRotation(b,d);H.push(a);L++}Module.IteratorNext(G)}var p=Module.postPagesUpdatedEvent(w,
|
|
184
|
+
h,H,!0);F.reverse().forEach(function(g){g()});A(p)}catch(g){F.reverse().forEach(function(z){z()}),e(g)}})};k.ExtractPages=function(h,f,r,A,e,w){return new Promise(function(F,D){var I=[];try{var L=Module.stackSave();I[I.length]=function(){Module.stackRestore(L)};var G=function(b){I.reverse().forEach(function(d){d()});D(b)};Module.XFDFMerge(h,r,e);var H=Module.CreateEmptyDoc();I[I.length]=function(){Module.DeleteDoc(H)};var a=Module.InsertPages(H,h,f,1,!0,w).then(function(){return Module.SaveDoc(H,
|
|
185
|
+
void 0,!0,!1,void 0,A)}).then(function(b){I.reverse().forEach(function(d){d()});return b});F(a)}catch(b){G(b)}})};k.CropPages=function(h,f,r,A,e,w){return new Promise(function(F,D){var I=Module.GetDoc(h),L=[];try{var G=Module.stackSave();L[L.length]=function(){Module.stackRestore(G)};var H=f.length,a=0,b=Module.PDFDocGetPageIterator(I,f[0]);L.push(function(){Module._TRN_IteratorDestroy(b)});for(var d=[],p=f[0];Module.IteratorHasNext(b)&&a<f[H-1];++p){if(p===f[a]){var g=Module.IteratorCurrent(b),z=
|
|
186
|
+
Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetCropBox(g,z));var y=Module.PageGetRotation(g),E=Module.getValue(z,"double"),K=Module.getValue(z+8,"double"),N=Module.getValue(z+16,"double"),Q=Module.getValue(z+24,"double");0===y%4?(Module.setValue(z,E+e,"double"),Module.setValue(z+8,K+A,"double"),Module.setValue(z+16,N-w,"double"),Module.setValue(z+24,Q-r,"double")):1===y%4?(Module.setValue(z,E+r,"double"),Module.setValue(z+8,K+e,"double"),Module.setValue(z+16,N-A,"double"),Module.setValue(z+
|
|
187
|
+
24,Q-w,"double")):2===y%4?(Module.setValue(z,E+w,"double"),Module.setValue(z+8,K+r,"double"),Module.setValue(z+16,N-e,"double"),Module.setValue(z+24,Q-A,"double")):3===y%4&&(Module.setValue(z,E+A,"double"),Module.setValue(z+8,K+w,"double"),Module.setValue(z+16,N-r,"double"),Module.setValue(z+24,Q-e,"double"));Module.setValue(z+32,0,"double");REX(Module._TRN_PageSetBox(g,0,z));REX(Module._TRN_PageSetBox(g,1,z));d.push(p);a++}Module.IteratorNext(b)}var V=Module.postPagesUpdatedEvent(I,h,d,!0);L.reverse().forEach(function(X){X()});
|
|
188
|
+
F(V)}catch(X){L.reverse().forEach(function(ia){ia()}),D(X)}})}})("undefined"===typeof self?this.Module:self.Module);this.loaded=!0;Module.initCb&&Module.initCb()}}})(self)}).call(this,u(10).clearImmediate,u(10).setImmediate)},function(v,B,u){(function(q){function n(c){"@babel/helpers - typeof";return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},
|
|
189
|
+
n(c)}var x=u(1),l=u(5),t="undefined"!==typeof window?window:self;t.global=t;(function(c){c.currentFileString="/current";var m=0,k=0,h={},f=null;Module.chunkMax=200;var r=function(a,b,d,p,g){var z=new XMLHttpRequest;return CancellablePromise(function(y,E){z.open("GET",a,!0);z.responseType="arraybuffer";z.onerror=function(){E("Network error occurred")};z.onload=function(){if(206===this.status&&z.response.byteLength===d){var N=new Int8Array(z.response);y(N)}else E("Download Failed")};var K=["bytes=",
|
|
190
|
+
b,"-",b+d-1].join("");z.setRequestHeader("Range",K);g&&(z.withCredentials=g);p&&Object.keys(p).forEach(function(N){z.setRequestHeader(N,p[N])});z.send()},function(){z.abort()})},A=function(a){this.maxChunkNum=a;this.lruList=[];this.chunkMap={}};A.prototype={has:function(a){return a in this.chunkMap},insert:function(a,b){this.lruList.length>=this.maxChunkNum&&(delete this.chunkMap[this.lruList[0]],this.lruList.shift());this.lruList.push(b);this.chunkMap[b]=a},get:function(a){var b=this.lruList.lastIndexOf(a);
|
|
191
|
+
0<=b&&this.lruList.splice(b,1);this.lruList.push(a);return this.chunkMap[a]}};var e=function(a){this.file=a;this.filePosition=0;this.fileLength=a.size;this.chunkSize=1048576;this.chunkCache=new A(8);this.reader=new FileReaderSync};e.prototype={read:function(a,b,d){d=this.filePosition+d<=this.fileLength?d:this.fileLength-this.filePosition;a=a.subarray(b,b+d);b=d;for(var p=this.filePosition%this.chunkSize,g=this.filePosition-p,z=0;0<d;){if(this.chunkCache.has(g))var y=this.chunkCache.get(g);else y=
|
|
192
|
+
new Int8Array(this.reader.readAsArrayBuffer(this.file.slice(g,g+this.chunkSize))),this.chunkCache.insert(y,g);var E=y.length,K=p+d;K<=E?(a.set(y.subarray(p,K),z),this.filePosition+=d,d=0):(a.set(y.subarray(p),z),this.filePosition+=E-p,p=0,g=this.filePosition,d=K-E,z=b-d)}return b},seek:function(a){this.filePosition=a},close:function(){this.reader=this.file=null},getPos:function(){return this.filePosition},getTotalSize:function(){return this.fileLength}};var w=function(a){this.data=a;this.position=
|
|
193
|
+
0;this.length=this.data.length};w.prototype={read:function(a,b,d){d=this.position+d<=this.length?d:this.length-this.position;a=a.subarray(b,b+d);b=this.data.subarray(this.position,this.position+d);a.set(b);this.position+=d;return d},write:function(a,b,d){d=this.position+d<=this.length?d:this.length-this.position;a=a.subarray(b,b+d);this.data.subarray(this.position,this.position+d).set(a);this.position+=d;return d},seek:function(a){this.position=a},close:function(){this.data=null},getPos:function(){return this.position},
|
|
194
|
+
getTotalSize:function(){return this.length}};var F=function(a,b,d,p,g,z){"object"===n(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.chunkSize=a.chunkSize):(this.lruList=[],this.chunkMap={},this.chunkMap[b]=z,this.length=b,this.url=a,this.customHeaders=p,this.withCredentials=g,this.chunkSize=d)};F.prototype={lruUpdate:function(a){var b=this.lruList.lastIndexOf(a);0<=b&&this.lruList.splice(b,
|
|
195
|
+
1);this.lruList.push(a)},getChunk:function(a){var b=this;if(this.chunkMap[a])this.lruUpdate(a);else{var d=Math.min(a+this.chunkSize,this.length)-1,p=new XMLHttpRequest;p.open("GET",this.url,!1);p.responseType="arraybuffer";p.setRequestHeader("Range",["bytes=",a,"-",d].join(""));this.withCredentials&&(p.withCredentials=this.withCredentials);this.customHeaders&&Object.keys(this.customHeaders).forEach(function(g){p.setRequestHeader(g,b.customHeaders[g])});p.send();if(200===p.status||206===p.status)this.writeChunk(new Int8Array(p.response),
|
|
196
|
+
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,b){var d={have:[],downloading:[],missing:[]};try{var p=Module.stackSave();var g=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DownloaderGetRequiredChunksSize(a,b,g));var z=Module.getValue(g,"i8*");if(z){var y=Module._malloc(8*
|
|
197
|
+
z);REX(Module._TRN_DownloaderGetRequiredChunks(a,b,y,z));for(a=0;a<z;++a){var E=Module.getValue(y+8*a,"double");this.hasChunk(E)?d.have.push(E):this.hadChunk(E)?d.missing.push(E):d.downloading.push(E)}}}finally{y&&Module._free(y),Module.stackRestore(p)}return d},keepVisibleChunks:function(a,b){for(var d=b.length,p=Module.chunkMax/2,g=0,z=0;z<d;++z){var y=this.getRequiredChunkOffsetArrays(a,b[z]),E=y.have,K=E.length;g+=K;if(g>p){this.keepChunks(E.slice(0,K-g+p));break}this.keepChunks(y.have)}},getChunkAsync:function(a){var b=
|
|
198
|
+
this,d=a+this.chunkSize,p=this.chunkSize;d>this.length&&(p-=d-this.length);return r(this.url,a,p,this.customHeaders,this.withCredentials).then(function(g){b.writeChunk(g,a)})},getChunks:function(a){for(var b=a.length,d=Array(b),p=0;p<b;++p)d[p]=this.getChunkAsync(a[p]);return CancellablePromise.all(d)},keepChunks:function(a){for(var b=a.length,d=0;d<b;++d)this.lruUpdate(a[d])},writeChunk:function(a,b,d){Object(l.b)(this.lruList,this.chunkMap,this.chunkSize,Module.chunkMax,a,b,d);this.lruUpdate(b)}};
|
|
199
|
+
var D=function(a){this.chunkStorage=a;this.position=0;this.length=this.chunkStorage.length;this.chunkSize=a.chunkSize};D.prototype={read:function(a,b,d){var p=this.position+d<=this.length,g=p?d:this.length-this.position;if(this.position<this.length){var z;for(z=0;z<g;){var y=this.position%this.chunkSize;var E=this.position-y;var K=g-z,N=a.subarray(b+z,b+z+K);if(this.chunkStorage.hadChunk(E))E=this.chunkStorage.getChunk(E).subarray(y,y+K),N.set(E),N=E.length,z+=N,this.position+=N;else for(this.position+=
|
|
200
|
+
K;z<g;++z)N[z]=0}}if(!p){b+=g;if(d-=g)p=this.chunkStorage.getCacheData(),d>p.length&&(d=p.length),z=this.position-this.length,a=a.subarray(b,b+d),E=p.subarray(z,z+d),a.set(E);this.position+=d;return g+d}return g},write:function(a,b,d){var p=this.position+d<=this.length,g=this.position+d<=this.length?d:this.length-this.position,z=a.subarray(b,b+g),y=this.position%this.chunkSize;this.chunkStorage.writeChunk(z,this.position-y,y);this.position+=g;if(!p){z=b+g;if(d-=g)b=this.chunkStorage.getCacheData(),
|
|
201
|
+
d>b.length&&(d=b.length),p=this.position-this.length,z=a.subarray(z,z+d),b.subarray(p,p+d).set(z);this.position+=d;return g+d}return g},seek:function(a){this.position=a},close:function(){this.chunkStorage=null},getPos:function(){return this.position},getTotalSize:function(){return this.length}};var I=function(a){this.docId=a;this.length=0;this.data=new Int8Array(8192);this.position=0};I.prototype={seek:function(a){this.position=a},close:function(){var a=new Int8Array(this.data.buffer.slice(0,this.length));
|
|
202
|
+
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,b,d){var p=this.data.length;d=d+b<p?d:p-b;a=a.subarray(b,b+d);b=this.data.subarray(this.position,this.position+d);a.set(b);this.position+=d;return d},write:function(a,b,d){for(var p=this.position+d,g=this.data.length;p>g;){g=Math.max(g*(16777216<g?1.5:2),p);var z=new Int8Array(g);z.set(this.data.subarray(0,
|
|
203
|
+
this.length),0);this.data=z}a=a.subarray(b,b+d);this.data.set(a,this.position);this.position+=d;this.position>this.length&&(this.length=this.position);return d}};var L={IsSink:function(a){return 66===(a.flags&255)},open:function(a){var b=a.path.slice(1);this.IsSink(a)?(a.provider=new I(b),Module.docs[b].sink=a.provider):a.provider=Module.docs[b].sink?new w(Module.docs[b].sink.data):Module.docs[b].chunkStorage?new D(Module.docs[b].chunkStorage):Module.docs[b].buffer?new w(Module.docs[b].buffer):new e(Module.docs[b].file)},
|
|
204
|
+
close:function(a){a.provider.close()},read:function(a,b,d,p,g){return a.provider.read(b,d,p)},llseek:function(a,b,d){a=a.provider;1===d?b+=a.getPos():2===d&&(b=a.getTotalSize()+b);if(0>b)throw new FS.ErrnoError(t.ERRNO_CODES.EINVAL);a.seek(b);return b},write:function(a,b,d,p,g){return p?a.provider.write(b,d,p):0}};t.THROW=function(a){throw{type:"PDFWorkerError",message:a};};var G=function(a){return"Exception: \n\t Message: ".concat(c.GetJSStringFromCString(Module._TRN_GetMessage(a)),"\n\t Filename: ").concat(c.GetJSStringFromCString(Module._TRN_GetFileName(a)),
|
|
205
|
+
"\n\t Function: ").concat(c.GetJSStringFromCString(Module._TRN_GetFunction(a)),"\n\t Linenumber: ").concat(c.GetJSStringFromCString(Module._TRN_GetLineNum(a)))};c.GetErrToString=G;t.REX=function(a){a&&THROW(G(a))};c.Initialize=function(a){var b=Module.stackSave();a=a?Module.allocate(Module.intArrayFromString(a),"i8",Module.ALLOC_STACK):0;REX(Module._TRN_PDFNetInitialize(a));Module.stackRestore(b)};c.GetDoc=function(a){if(a in Module.docs)return Module.docs[a].ptr;throw{type:"InvalidDocReference",
|
|
206
|
+
message:"Unable to access Document id=".concat(a,". The document appears to be invalid or was deleted.")};};c.clearDocBackend=function(){null!==Module.cachePtr?(Module.hasBufOwnership&&Module._free(Module.cachePtr),Module.cachePtr=null):Module.docs[c.currentFileString]&&delete Module.docs[c.currentFileString]};c.MakeDev=function(a){if(!h[a]){var b=FS.makedev(3,5);FS.registerDevice(b,L);FS.mkdev(a,511,b);h[a]=!0}};c.CreateDocFileBackend=function(a,b){Module.MakeDev(b);var d=Module.allocate(4,"i8",
|
|
207
|
+
Module.ALLOC_STACK);Module.docs[b]={file:a};a=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreateFromFilePath(a,d));d=Module.getValue(d,"i8*");Module.docs[b].ptr=d};c.InsertImageIntoDoc=function(a,b,d){var p=[];try{var g=Module.ElementBuilderCreate();p.push(function(){Module.ElementBuilderDestroy(g)});var z=Module.ElementWriterCreate();p.push(function(){Module.ElementWriterDestroy(z)});if(d){var y=d.width;var E=d.height}else y=Module.ImageGetImageWidth(b),
|
|
208
|
+
E=Module.ImageGetImageHeight(b),d=y/E,d>612/792?(y=612,E=parseInt(y/d,10)):(E=792,y=parseInt(E*d,10));var K=Module.ElementBuilderCreateImage(g,b,0,0,y,E),N=Module.PDFDocPageCreate(a,y,E);Module.ElementWriterBegin(z,N);Module.ElementWriterWritePlacedElement(z,K);Module.ElementWriterEnd(z);Module.PDFDocPagePushBack(a,N)}finally{p.reverse().forEach(function(Q){Q()})}};var H=function(a,b,d){"object"===n(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,
|
|
209
|
+
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=d,this.size=a,this.timeout=null,this.eventPageArray=[],this.requirePageCallbacks={});this.downloadUserData=Module.createDownloadUserData(b,d)};H.prototype={getJSUrl:function(){return Module.extractDownloadUserData(this.downloadUserData).url},
|
|
210
210
|
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)}};c.createDownloadUserData=function(a,b){a=Module.allocate(Module.intArrayFromString(a),"i8",Module.ALLOC_NORMAL);var d=Module.allocate(8,"i8",Module.ALLOC_NORMAL);Module.setValue(d,
|
|
211
211
|
a,"i8*");Module.setValue(d+4,parseInt(b,10),"i32");return this.downloadUserData=d};c.extractDownloadUserData=function(a){var b=Module.getValue(a,"i8*");b=c.GetJSStringFromCString(b);a=Module.getValue(a+4,"i32").toString();return{url:b,docId:a}};c.destroyDownloadUserData=function(a){Module._free(Module.getValue(a,"i8*"));Module._free(a)};t.downloadDataMap={};Module.customHeadersMap={};Module.withCredentials={};c.GetDownloadData=function(a){if(a in downloadDataMap)return downloadDataMap[a]};c.DownloaderHint=
|
|
212
|
-
function(a,b){var d=Module.GetDoc(a),
|
|
213
|
-
|
|
214
|
-
REX(Module._TRN_DownloaderIsLinearizationValid(a.downloader,b));return 0!==Module.getValue(b,"i8")}return!1};c.ShouldRunRender=function(a,b){a=Module.GetDoc(a);return(a=downloadDataMap[a])?a.m_finished_download?!0:a.m_pages[b]:!0};c.postPagesDownloadedEvent=function(a,b,d){a={pageDimensions:Module.GetPageDimensionsContentChangedList(a,d),pageNumbers:d};Module.postEvent(b,"pagesDownloaded",a);return a};c.createCallbacksStruct=function(a){if(!
|
|
215
|
-
|
|
216
|
-
downloadDataMap[d];
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
"i8*");Module.setValue(b+32,
|
|
220
|
-
Module.ALLOC_STACK);Module.MakeDev(d);a.chunkStorage?
|
|
221
|
-
"i8*");Module.docs[d].ptr=b;Module.PDFDocInitSecurityHandler(b)&&REX(Module._TRN_PDFDocDownloaderInitialize(b,N.downloader));downloadDataMap[b]=N};c.CreateDocBackend=function(a,b){var d=a.value,
|
|
222
|
-
d instanceof ArrayBuffer;E=
|
|
223
|
-
Module.GetUStringFromJSString(b);REX(Module._TRN_PDFDocCreate(
|
|
224
|
-
c.ChangeDocBackend=function(a,b){var d=Module.docs[a];d?(d.bufPtr&&d.ownership&&(Module._free(d.bufPtr),m-=d.bufPtrSize),delete Module.docs[a]):Object(
|
|
225
|
-
m-=b.bufPtrSize),delete Module.docs[a]):Object(
|
|
226
|
-
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreate(b));b=Module.getValue(b,"i8*");Module.docs[a]={ptr:b};return a};c.CreateDocFromLayoutEls=function(a){var b=new Uint8Array(a);a=Module._malloc(b.length);var d=Module.stackSave(),
|
|
212
|
+
function(a,b){var d=Module.GetDoc(a),p=downloadDataMap[d];b.currentPage&&(p.m_current_page=b.currentPage);if(b.visiblePages){var g=b.visiblePages;for(b=0;b<g.length;++b)++g[b];Object.keys(p.requirePageCallbacks).forEach(function(y){p.requirePageCallbacks.hasOwnProperty(y)&&g.push(parseInt(y,10))});(b=Module.docs[a].chunkStorage)&&b.keepVisibleChunks(p.downloader,g);a=g.length;var z=Module.allocate(4*a,"i8",Module.ALLOC_STACK);for(b=0;b<a;++b)Module.setValue(z+4*b,g[b],"i32");REX(Module._TRN_PDFDocDownloadPages(d,
|
|
213
|
+
z,a,1,0))}};c.RequirePage=function(a,b){return new Promise(function(d,p){p=Module.GetDoc(a);var g=downloadDataMap[p];!g||g.m_finished_download||g.m_pages[b]?d():(b in g.requirePageCallbacks?g.requirePageCallbacks[b].push(d):g.requirePageCallbacks[b]=[d],d=Module.allocate(4,"i8",Module.ALLOC_STACK),Module.setValue(d,b,"i32"),Module._TRN_PDFDocDownloadPages(p,d,1,0,0))})};c.IsLinearizationValid=function(a){a=Module.GetDoc(a);if(a=downloadDataMap[a]){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);
|
|
214
|
+
REX(Module._TRN_DownloaderIsLinearizationValid(a.downloader,b));return 0!==Module.getValue(b,"i8")}return!1};c.ShouldRunRender=function(a,b){a=Module.GetDoc(a);return(a=downloadDataMap[a])?a.m_finished_download?!0:a.m_pages[b]:!0};c.postPagesDownloadedEvent=function(a,b,d){a={pageDimensions:Module.GetPageDimensionsContentChangedList(a,d),pageNumbers:d};Module.postEvent(b,"pagesDownloaded",a);return a};c.createCallbacksStruct=function(a){if(!f){var b=function(d){return function(p){var g=arguments;
|
|
215
|
+
p in downloadDataMap?d.apply(this,g):q(function(){p in downloadDataMap&&d.apply(this,g)},0)}};f={downloadProc:Module.addFunction(function(d,p,g,z,y){q(function(){var E=Module.extractDownloadUserData(z),K=E.docId;r(E.url,p,g,Module.customHeadersMap[K],Module.withCredentials[K]).then(function(N){K in Module.docs&&Module.docs[K].chunkStorage&&Module.docs[K].chunkStorage.writeChunk(N,p);Module._TRN_DownloadComplete(0,p,g,d)})})},"vidiii"),notifyUpdatePage:Module.addFunction(b(function(d,p,g,z){var y=
|
|
216
|
+
downloadDataMap[d];y.m_pages[p]=!0;var E=y.eventPageArray;if(p in y.requirePageCallbacks)for(g=y.requirePageCallbacks[p],z=0;z<g.length;++z)g[z]();y.timeout?E.push(p):(E=y.eventPageArray=[p],y.timeout=setTimeout(function(){Module.postPagesDownloadedEvent(d,y.m_id,E);y.timeout=null},100))}),"viiii"),notifyUpdateOutline:Module.addFunction(b(function(d,p){d=downloadDataMap[d];d.m_has_outline||(d.m_has_outline=!0,Module.postEvent(d.m_id,"bookmarksUpdated",{}))}),"vii"),notifyUpdateNamedDests:Module.addFunction(b(function(d,
|
|
217
|
+
p){d=downloadDataMap[d];d.m_has_named_dests||(d.m_has_named_dests=!0)}),"vii"),notifyDocInfoDownloaded:Module.addFunction(b(function(d,p){downloadDataMap[d].docInfoPromiseCapability.resolve()}),"vii"),notifyUpdateThumb:Module.addFunction(b(function(d,p){}),"viiii"),notifyFinishedDownload:Module.addFunction(b(function(d,p){d=downloadDataMap[d];d.m_finished_download||(d.m_finished_download=!0,Module.postEvent(d.m_id,"documentComplete",{}))}),"vii"),notifyDocumentError:Module.addFunction(function(d,
|
|
218
|
+
p){},"viii"),getCurrentPage:Module.addFunction(function(d,p){return downloadDataMap[d].m_current_page},"iii")}}b=Module.allocate(44,"i8",Module.ALLOC_STACK);Module.setValue(b,f.downloadProc,"i8*");Module.setValue(b+4,a,"i8*");Module.setValue(b+8,f.notifyUpdatePage,"i8*");Module.setValue(b+12,f.notifyUpdateOutline,"i8*");Module.setValue(b+16,f.notifyUpdateNamedDests,"i8*");Module.setValue(b+20,f.notifyDocInfoDownloaded,"i8*");Module.setValue(b+24,f.notifyUpdateThumb,"i8*");Module.setValue(b+28,f.notifyFinishedDownload,
|
|
219
|
+
"i8*");Module.setValue(b+32,f.notifyDocumentError,"i8*");Module.setValue(b+36,f.getCurrentPage,"i8*");Module.setValue(b+40,0,"i8*");return b};c.CreateDocDownloaderBackend=function(a,b,d){var p=a.url,g=a.size,z=a.customHeaders,y=a.withCredentials,E=a.shouldUseMinimumDownloads,K=a.chunkSize;z&&(Module.customHeadersMap[d]=z);y&&(Module.withCredentials[d]=y);var N=a.downloadData?new H(a.downloadData,p,d):new H(a.size,p,d);var Q=Module.createCallbacksStruct(N.downloadUserData),V=Module.allocate(4,"i8",
|
|
220
|
+
Module.ALLOC_STACK);Module.MakeDev(d);a.chunkStorage?p=new F(a.chunkStorage):(a=new Int8Array(new ArrayBuffer(Math.ceil((a.size+K-1)/K/8))),p=new F(p,g,K,z,y,a));Module.docs[d]={chunkStorage:p};REX(Module._TRN_DownloaderCreate(Q,g,Module.GetUStringFromJSString(d),E,p.chunkSize,V));N.downloader=Module.getValue(V,"i8*");N.docInfoPromiseCapability=createPromiseCapability();N.docInfoRequested=!1;if(g=Module._TRN_PDFDocCreateFromFilter(N.downloader,b))Module._TRN_FilterDestroy(N.downloader),REX(g);b=Module.getValue(b,
|
|
221
|
+
"i8*");Module.docs[d].ptr=b;Module.PDFDocInitSecurityHandler(b)&&REX(Module._TRN_PDFDocDownloaderInitialize(b,N.downloader));downloadDataMap[b]=N};c.CreateDocBackend=function(a,b){var d=a.value,p=a.extension,g=a.type,z=Module.allocate(4,"i8",Module.ALLOC_STACK),y=Module.stackSave();try{if(d)if("ptr"===g)Module.docs[b]={ptr:d};else{d.shouldUseMinimumDownloads=a.shouldUseMinimumDownloads;d.chunkSize=a.chunkSize;var E="object"===n(d)&&d.url;g=p&&"pdf"!==p;if(E)c.CreateDocDownloaderBackend(d,z,b);else{var K=
|
|
222
|
+
d instanceof ArrayBuffer;E=K?"buffer":"file";if(K&&(d=new Uint8Array(d),10485760>d.length+m&&!g)){m+=d.length;var N=d.length,Q=Module._malloc(d.length);Module.HEAPU8.set(d,Q);REX(Module._TRN_PDFDocCreateFromBuffer(Q,N,z));var V=Module.getValue(z,"i8*");Module.docs[b]={ptr:V,bufPtr:Q,bufPtrSize:N,ownership:!0};Module.docs[b].extension=p;return}Module.MakeDev(b);K={};K[E]=d;Module.docs[b]=K;if(g){if(a.pageSizes&&a.pageSizes.length)var X=a.pageSizes[0];else a.defaultPageSize&&(X=a.defaultPageSize);var ia=
|
|
223
|
+
Module.GetUStringFromJSString(b);REX(Module._TRN_PDFDocCreate(z));V=Module.getValue(z,"i8*");var ma=Module.ImageCreateFromFile(V,ia);Module.InsertImageIntoDoc(V,ma,X)}else{var la=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreateFromFilePath(la,z));V=Module.getValue(z,"i8*")}Module.docs[b].extension=p;Module.docs[b].ptr=V}}else REX(Module._TRN_PDFDocCreate(z)),V=Module.getValue(z,"i8*"),Module.docs[b]={ptr:V},Module.docs[b].extension=p}finally{Module.stackRestore(y)}};
|
|
224
|
+
c.ChangeDocBackend=function(a,b){var d=Module.docs[a];d?(d.bufPtr&&d.ownership&&(Module._free(d.bufPtr),m-=d.bufPtrSize),delete Module.docs[a]):Object(x.d)("Trying to delete document ".concat(a," that does not exist."));Module.docs[a]=b};c.DeleteDoc=function(a){var b=Module.docs[a];b?(b.ptr&&(b.ptr in downloadDataMap&&(clearTimeout(downloadDataMap[b.ptr].timeout),downloadDataMap[b.ptr].destroyUserData(),delete downloadDataMap[b.ptr]),Module.PDFDocDestroy(b.ptr)),b.bufPtr&&b.ownership&&(Module._free(b.bufPtr),
|
|
225
|
+
m-=b.bufPtrSize),delete Module.docs[a]):Object(x.d)("Trying to delete document ".concat(a," that does not exist."))};c.CreateDoc=function(a,b){if("id"===a.type){if(Module.docPtrStringToIdMap&&a.value in Module.docPtrStringToIdMap)return Module.docPtrStringToIdMap[a.value];a.type="ptr";a.value=Number("0x".concat(a.value))}if(!b){do b=(++k).toString();while(b in Module.docs)}Module.hasBufOwnership=!0;c.CreateDocBackend(a,b);return b};c.CreateEmptyDoc=function(){var a=(++k).toString(),b=Module.allocate(4,
|
|
226
|
+
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocCreate(b));b=Module.getValue(b,"i8*");Module.docs[a]={ptr:b};return a};c.CreateDocFromLayoutEls=function(a){var b=new Uint8Array(a);a=Module._malloc(b.length);var d=Module.stackSave(),p=Module.allocate(4,"i8",Module.ALLOC_STACK);Module.HEAPU8.set(b,a);b=Module._TRN_PDFDocCreateFromLayoutEls(a,b.length,p);p=Module.getValue(p,"i8*");Module._free(a);Module.stackRestore(d);REX(b);return p};c.GetPageCount=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);
|
|
227
227
|
REX(Module._TRN_PDFDocGetPageCount(a,b));return Module.getValue(b,"i8*")};c.GetPage=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetPage(a,b,d));a=Module.getValue(d,"i8*");Module.PageIsValid(a)||THROW("Trying to access page that doesn't exist at index ".concat(b));return a};c.PageGetPageWidth=function(a){var b=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetPageWidth(a,1,b));return Module.getValue(b,"double")};c.PageGetPageHeight=function(a){var b=
|
|
228
228
|
Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetPageHeight(a,1,b));return Module.getValue(b,"double")};c.PageGetDefaultMatrix=function(a,b){var d=Module.allocate(48,"i8",Module.ALLOC_STACK);b||(b=0);REX(Module._TRN_PageGetDefaultMatrix(a,!0,1,b,d));return d};c.GetMatrixAsArray=function(a){for(var b=[],d=0;6>d;++d)b[d]=Module.getValue(a+8*d,"double");return b};c.PageGetPageInfo=function(a){var b=Module.allocate(48,"i8",Module.ALLOC_STACK),d=Module.allocate(8,"i8",Module.ALLOC_STACK),
|
|
229
|
-
|
|
230
|
-
b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK),
|
|
229
|
+
p=Module.allocate(8,"i8",Module.ALLOC_STACK),g=Module.allocate(4,"i8",Module.ALLOC_STACK),z=Module.allocate(4,"i8",Module.ALLOC_STACK),y=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetPageInfo(a,!0,1,0,d,p,b,g,z,y));return{rotation:Module.getValue(g,"i8*"),width:Module.getValue(d,"double"),height:Module.getValue(p,"double"),matrix:Module.GetMatrixAsArray(b),linkAnnotCount:Module.getValue(z,"i8*"),otherExceptPopupAnnotCount:Module.getValue(y,"i8*")}};c.GetUStringFromJSString=function(a,
|
|
230
|
+
b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK),p=2*(a.length+1),g=Module.allocate(p,"i8",b?Module.ALLOC_NORMAL:Module.ALLOC_STACK);Module.stringToUTF16(a,g,p);a=Module._TRN_UStringCreateFromString(g,d);b&&Module._free(g);REX(a);return Module.getValue(d,"i8*")};c.GetJSStringFromUString=function(a){var b=Module.allocate(4,"i16*",Module.ALLOC_STACK);REX(Module._TRN_UStringCStr(a,b));return Module.UTF16ToString(Module.getValue(b,"i16*"))};c.GetJSStringFromCString=function(a){return Module.UTF8ToString(a)};
|
|
231
231
|
c.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};c.PDFDocDestroy=function(a){REX(Module._TRN_PDFDocDestroy(a))};c.VectorGetSize=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_VectorGetSize(a,b));return Module.getValue(b,"i32")};c.VectorGetAt=function(a,b){var d=Module.allocate(1,"i8*",Module.ALLOC_STACK);REX(Module._TRN_VectorGetAt(a,
|
|
232
|
-
b,d));return Module.getValue(d,"i8*")};c.VectorDestroy=function(a){REX(Module._TRN_VectorDestroy(a))};c.PDFRasterizerCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerCreate(0,a));return Module.getValue(a,"i8*")};c.ExtractSeparationData=function(a){var b=Module.getValue(a,"i8*"),d=Module.getValue(a+4,"i32"),
|
|
233
|
-
b+d));b=Module.GetJSStringFromUString(
|
|
234
|
-
b,d,
|
|
235
|
-
Module.ALLOC_STACK);REX(Module._TRN_ObjGetObjNum(b,a));a=Module.getValue(a,"i32");var d=Module.allocate(2,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetGenNum(b,d));d=Module.getValue(d,"i16");return"".concat(a,"-").concat(d)};c.PageSetRotation=function(a,b){REX(Module._TRN_PageSetRotation(a,b))};c.GetDefaultMatrixBox=function(a,b,d){var
|
|
236
|
-
switch(a){case 0:return REX(Module._TRN_Matrix2DSet(d,1,0,0,-1,-b.x1,b.y2)),d;case 1:return REX(Module._TRN_Matrix2DSet(d,0,1,1,0,-b.y1,-b.x1)),d;case 2:return REX(Module._TRN_Matrix2DSet(d,-1,0,0,1,b.x2,-b.y1)),d;case 3:return REX(Module._TRN_Matrix2DSet(d,0,-1,-1,0,b.y2,b.x2)),d}throw Error("Yikes, we don't support that rotation type");};c.Matrix2DMultBBox=function(a,b){var d=Module.allocate(8,"i8",Module.ALLOC_STACK),
|
|
237
|
-
Module.setValue(
|
|
238
|
-
REX(Module._TRN_Matrix2DMult(a,d,
|
|
232
|
+
b,d));return Module.getValue(d,"i8*")};c.VectorDestroy=function(a){REX(Module._TRN_VectorDestroy(a))};c.PDFRasterizerCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerCreate(0,a));return Module.getValue(a,"i8*")};c.ExtractSeparationData=function(a){var b=Module.getValue(a,"i8*"),d=Module.getValue(a+4,"i32"),p=Module.getValue(a+8,"i8*"),g=Module.HEAPU8[a+12],z=Module.HEAPU8[a+13],y=Module.HEAPU8[a+14];a=Module.HEAPU8[a+15];var E=new Uint8Array(d);E.set(Module.HEAPU8.subarray(b,
|
|
233
|
+
b+d));b=Module.GetJSStringFromUString(p);return{color:[g,z,y,a],data:E.buffer,name:b}};c.ExtractApRefChangeData=function(a){var b=Module.getValue(a,"i32"),d=Module.getValue(a+4,"i32"),p=Module.getValue(a+8,"i32"),g=Module.getValue(a+12,"i32");a=0!==Module.getValue(a+16,"i8");return{oldObjNum:b,discardAppearance:a,newObjNum:d,genNum:p,pageNum:g}};c.PDFRasterizerRasterizeSeparations=function(a,b,d,p,g,z,y){var E=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFRasterizerRasterizeSeparations(a,
|
|
234
|
+
b,d,p,g,z,y,E));a=Module.getValue(E,"i8*");b=Module.VectorGetSize(a);d=Array(b);for(p=0;p<b;++p)g=Module.VectorGetAt(a,p),d[p]=Module.ExtractSeparationData(g);Module.VectorDestroy(a);return d};c.PageGetRotation=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetRotation(a,b));return Module.getValue(b,"i8*")};c.PageGetId=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetSDFObj(a,b));b=Module.getValue(b,"i8*");a=Module.allocate(4,"i8",
|
|
235
|
+
Module.ALLOC_STACK);REX(Module._TRN_ObjGetObjNum(b,a));a=Module.getValue(a,"i32");var d=Module.allocate(2,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetGenNum(b,d));d=Module.getValue(d,"i16");return"".concat(a,"-").concat(d)};c.PageSetRotation=function(a,b){REX(Module._TRN_PageSetRotation(a,b))};c.GetDefaultMatrixBox=function(a,b,d){var p=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetRotation(a,p));a=(Module.getValue(p,"i32")+d)%4;d=Module.allocate(48,"i8",Module.ALLOC_STACK);
|
|
236
|
+
switch(a){case 0:return REX(Module._TRN_Matrix2DSet(d,1,0,0,-1,-b.x1,b.y2)),d;case 1:return REX(Module._TRN_Matrix2DSet(d,0,1,1,0,-b.y1,-b.x1)),d;case 2:return REX(Module._TRN_Matrix2DSet(d,-1,0,0,1,b.x2,-b.y1)),d;case 3:return REX(Module._TRN_Matrix2DSet(d,0,-1,-1,0,b.y2,b.x2)),d}throw Error("Yikes, we don't support that rotation type");};c.Matrix2DMultBBox=function(a,b){var d=Module.allocate(8,"i8",Module.ALLOC_STACK),p=Module.allocate(8,"i8",Module.ALLOC_STACK);Module.setValue(d,b.x1,"double");
|
|
237
|
+
Module.setValue(p,b.y1,"double");REX(Module._TRN_Matrix2DMult(a,d,p));b.x1=Module.getValue(d,"double");b.y1=Module.getValue(p,"double");Module.setValue(d,b.x2,"double");Module.setValue(p,b.y2,"double");REX(Module._TRN_Matrix2DMult(a,d,p));b.x2=Module.getValue(d,"double");b.y2=Module.getValue(p,"double");return b};c.Matrix2DMult=function(a,b){var d=Module.allocate(8,"i8",Module.ALLOC_STACK),p=Module.allocate(8,"i8",Module.ALLOC_STACK);Module.setValue(d,b.x,"double");Module.setValue(p,b.y,"double");
|
|
238
|
+
REX(Module._TRN_Matrix2DMult(a,d,p));b.x=Module.getValue(d,"double");b.y=Module.getValue(p,"double");return b};c.Matrix2DConcat=function(a,b){var d=Module.getValue(b,"double"),p=Module.getValue(b+8,"double"),g=Module.getValue(b+16,"double"),z=Module.getValue(b+24,"double"),y=Module.getValue(b+32,"double");b=Module.getValue(b+40,"double");REX(Module._TRN_Matrix2DConcat(a,d,p,g,z,y,b))};c.Matrix2DSet=function(a,b,d,p,g,z,y){REX(Module._TRN_Matrix2DSet(a,b,d,p,g,z,y))};c.IteratorHasNext=function(a){var b=
|
|
239
239
|
Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_IteratorHasNext(a,b));return 0!==Module.getValue(b,"i8")};c.IteratorCurrent=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_IteratorCurrent(a,b));return Module.getValue(Module.getValue(b,"i8*"),"i8*")};c.IteratorNext=function(a){REX(Module._TRN_IteratorNext(a))};c.PageGetNumAnnots=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetNumAnnots(a,b));return Module.getValue(b,"i32")};
|
|
240
240
|
c.PageGetAnnot=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetAnnot(a,b,d));return Module.getValue(d,"i8*")};c.PageAnnotRemove=function(a,b){REX(Module._TRN_PageAnnotRemoveByIndex(a,b))};c.AnnotGetType=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetType(a,b));return Module.getValue(b,"i32")};c.AnnotGetSDFObjNum=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetSDFObj(a,b));b=Module.getValue(b,
|
|
241
241
|
"i8*");a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetObjNum(b,a));return a=Module.getValue(a,"i32")};c.AnnotGetSDFObjGen=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetSDFObj(a,b));b=Module.getValue(b,"i8*");a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetGenNum(b,a));return a=Module.getValue(a,"i32")};c.AnnotHasAppearance=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_AnnotGetAppearance(a,
|
|
242
|
-
0,0,b));return 0!==Module.getValue(b,"i8")};c.AnnotRefreshAppearance=function(a){REX(Module._TRN_AnnotRefreshAppearance(a))};c.ObjErase=function(a,b){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjEraseFromKey(a,b))};c.GetJSDoubleArrFromCore=function(a,b){for(var d=Array(b),
|
|
242
|
+
0,0,b));return 0!==Module.getValue(b,"i8")};c.AnnotRefreshAppearance=function(a){REX(Module._TRN_AnnotRefreshAppearance(a))};c.ObjErase=function(a,b){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjEraseFromKey(a,b))};c.GetJSDoubleArrFromCore=function(a,b){for(var d=Array(b),p=0;p<b;++p)d[p]=Module.getValue(a,"double"),a+=8;return d};c.GetJSIntArrayFromCore=function(a,b){for(var d=Array(b),p=0;p<b;++p)d[p]=Module.getValue(a,"i32"),a+=4;return d};c.BookmarkIsValid=
|
|
243
243
|
function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkIsValid(a,b));return 0!==Module.getValue(b,"i8")};c.BookmarkGetNext=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetNext(a,b));return Module.getValue(b,"i8*")};c.BookmarkGetFirstChild=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetFirstChild(a,b));return Module.getValue(b,"i8*")};c.BookmarkHasChildren=function(a){var b=Module.allocate(4,
|
|
244
244
|
"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkHasChildren(a,b));return 0!==Module.getValue(b,"i8")};c.BookmarkGetAction=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetAction(a,b));return Module.getValue(b,"i8*")};c.BookmarkGetTitle=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_BookmarkGetTitle(a,b));a=Module.getValue(b,"i8*");return Module.GetJSStringFromUString(a)};c.ActionIsValid=function(a){var b=Module.allocate(4,"i8",
|
|
245
245
|
Module.ALLOC_STACK);REX(Module._TRN_ActionIsValid(a,b));return 0!==Module.getValue(b,"i8")};c.ActionGetType=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ActionGetType(a,b));return Module.getValue(b,"i32")};c.ActionGetDest=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ActionGetDest(a,b));return Module.getValue(b,"i8*")};c.DestinationIsValid=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationIsValid(a,
|
|
246
246
|
b));return 0!==Module.getValue(b,"i8")};c.DestinationGetPage=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetPage(a,b));return Module.getValue(b,"i8*")};c.PageIsValid=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageIsValid(a,b));return 0!==Module.getValue(b,"i8")};c.PageGetIndex=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageGetIndex(a,b));return Module.getValue(b,"i32")};c.ObjGetAsPDFText=
|
|
247
247
|
function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetAsPDFText(a,b));a=Module.getValue(b,"i8*");return Module.GetJSStringFromUString(a)};c.ObjFindObj=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjFindObj(a,b,d));return Module.getValue(d,"i8*")};c.PDFDocGetFirstBookmark=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetFirstBookmark(a,
|
|
248
248
|
b));return Module.getValue(b,"i8*")};c.DestinationGetExplicitDestObj=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetExplicitDestObj(a,b));return Module.getValue(b,"i8*")};c.DestinationGetFitType=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_DestinationGetFitType(a,b));return Module.getValue(b,"i32")};c.ObjIsNumber=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjIsNumber(a,b));return 0!==Module.getValue(b,
|
|
249
|
-
"i8")};c.ObjGetNumber=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetNumber(a,b));return Module.getValue(b,"double")};c.PDFDocGetRoot=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetRoot(a,b));return Module.getValue(b,"i8*")};c.ObjPutName=function(a,b,d){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);d=Module.allocate(Module.intArrayFromString(d),"i8",Module.ALLOC_STACK);var
|
|
250
|
-
Module.ALLOC_STACK);REX(Module._TRN_ObjPutName(a,b,d,
|
|
251
|
-
"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutString(a,b,d,
|
|
249
|
+
"i8")};c.ObjGetNumber=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetNumber(a,b));return Module.getValue(b,"double")};c.PDFDocGetRoot=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetRoot(a,b));return Module.getValue(b,"i8*")};c.ObjPutName=function(a,b,d){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);d=Module.allocate(Module.intArrayFromString(d),"i8",Module.ALLOC_STACK);var p=Module.allocate(4,"i8",
|
|
250
|
+
Module.ALLOC_STACK);REX(Module._TRN_ObjPutName(a,b,d,p));return Module.getValue(p,"i8*")};c.ObjPutDict=function(a,b){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutDict(a,b,d));return Module.getValue(d,"i8*")};c.ObjPutString=function(a,b,d){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);d=Module.allocate(Module.intArrayFromString(d),"i8",Module.ALLOC_STACK);var p=Module.allocate(4,
|
|
251
|
+
"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPutString(a,b,d,p));return Module.getValue(p,"i8*")};c.ObjPut=function(a,b,d){b=Module.allocate(Module.intArrayFromString(b),"i8",Module.ALLOC_STACK);var p=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjPut(a,b,d,p));return Module.getValue(p,"i8*")};c.ObjGetAt=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ObjGetAt(a,b,d));return Module.getValue(d,"i8*")};c.Matrix2DInverse=function(a){var b=Module.allocate(48,
|
|
252
252
|
"i8",Module.ALLOC_STACK);REX(Module._TRN_Matrix2DInverse(a,b));return b};c.PDFDocInitSecurityHandler=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocInitSecurityHandler(a,0,b));return 0!==Module.getValue(b,"i8")};c.PDFDocSetSecurityHandler=function(a,b){REX(Module._TRN_PDFDocSetSecurityHandler(a,b))};c.SecurityHandlerCreate=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_SecurityHandlerCreate(a,b));return Module.getValue(b,"i8*")};c.SecurityHandlerChangeUserPasswordUString=
|
|
253
|
-
function(a,b){REX(Module._TRN_SecurityHandlerChangeUserPasswordUString(a,Module.GetUStringFromJSString(b)))};c.PDFDocInitStdSecurityHandler=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocInitStdSecurityHandlerUString(a,Module.GetUStringFromJSString(b),d));return 0!==Module.getValue(d,"i8")};c.PDFDocDownloaderTriggerFullDownload=function(a,b){REX(Module._TRN_PDFDocDownloaderTriggerFullDownload(a,b))};c.PDFDocInsertPages=function(a,b,d,
|
|
254
|
-
b,d,
|
|
255
|
-
b))};c.PDFDocPageCreate=function(a,b,d){var
|
|
253
|
+
function(a,b){REX(Module._TRN_SecurityHandlerChangeUserPasswordUString(a,Module.GetUStringFromJSString(b)))};c.PDFDocInitStdSecurityHandler=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocInitStdSecurityHandlerUString(a,Module.GetUStringFromJSString(b),d));return 0!==Module.getValue(d,"i8")};c.PDFDocDownloaderTriggerFullDownload=function(a,b){REX(Module._TRN_PDFDocDownloaderTriggerFullDownload(a,b))};c.PDFDocInsertPages=function(a,b,d,p,g){REX(Module._TRN_PDFDocInsertPageSet(a,
|
|
254
|
+
b,d,p,g?1:0,0))};c.PDFDocInsertPages2=function(a,b,d,p,g){REX(Module._TRN_PDFDocInsertPageSet2(a,b,d,p,g?1:0,0))};c.PDFDocMovePages=function(a,b,d){REX(Module._TRN_PDFDocMovePageSet(a,b,a,d,0,0))};c.PDFDocGetPageIterator=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetPageIterator(a,b,d));return Module.getValue(d,"i8*")};c.PDFDocPageRemove=function(a,b){REX(Module._TRN_PDFDocPageRemove(a,b))};c.PDFDocPageRemove2=function(a,b){REX(Module._TRN_PDFDocPageRemove2(a,
|
|
255
|
+
b))};c.PDFDocPageCreate=function(a,b,d){var p=Module.allocate(40,"i8",Module.ALLOC_STACK);Module.setValue(p,0,"double");Module.setValue(p+8,0,"double");Module.setValue(p+16,b,"double");Module.setValue(p+24,d,"double");Module.setValue(p+32,0,"double");b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocPageCreate(a,p,b));return Module.getValue(b,"i8*")};c.PDFDocPageInsert=function(a,b,d){REX(Module._TRN_PDFDocPageInsert(a,b,d))};c.PageSetCreate=function(){var a=Module.allocate(4,"i8",
|
|
256
256
|
Module.ALLOC_STACK);REX(Module._TRN_PageSetCreate(a));return Module.getValue(a,"i8*")};c.PageSetCreateRange=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PageSetCreateRange(d,a,b));return Module.getValue(d,"i8*")};c.PageSetAddPage=function(a,b){REX(Module._TRN_PageSetAddPage(a,b))};c.ElementBuilderCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementBuilderCreate(a));return Module.getValue(a,"i8*")};c.ElementBuilderDestroy=function(a){REX(Module._TRN_ElementBuilderDestroy(a))};
|
|
257
|
-
c.ElementBuilderCreateImage=function(a,b,d,
|
|
257
|
+
c.ElementBuilderCreateImage=function(a,b,d,p,g,z){var y=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementBuilderCreateImageScaled(a,b,d,p,g,z,y));return Module.getValue(y,"i8*")};c.ElementWriterCreate=function(){var a=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementWriterCreate(a));return Module.getValue(a,"i8*")};c.ElementWriterDestroy=function(a){REX(Module._TRN_ElementWriterDestroy(a))};c.ElementWriterBegin=function(a,b){REX(Module._TRN_ElementWriterBeginOnPage(a,
|
|
258
258
|
b,1,1,1,0))};c.ElementWriterWritePlacedElement=function(a,b){REX(Module._TRN_ElementWriterWritePlacedElement(a,b))};c.ElementWriterEnd=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ElementWriterEnd(a,b))};c.ImageGetImageWidth=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageGetImageWidth(a,b));return Module.getValue(b,"i32")};c.ImageGetImageHeight=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageGetImageHeight(a,
|
|
259
|
-
b));return Module.getValue(b,"i32")};c.ImageCreateFromMemory2=function(a,b,d){var
|
|
259
|
+
b));return Module.getValue(b,"i32")};c.ImageCreateFromMemory2=function(a,b,d){var p=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageCreateFromMemory2(a,b,d,0,p));return Module.getValue(p,"i8*")};c.ImageCreateFromFile=function(a,b){var d=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_ImageCreateFromFile(a,b,0,d));return Module.getValue(d,"i8*")};c.PDFDocPagePushBack=function(a,b){REX(Module._TRN_PDFDocPagePushBack(a,b))};c.PDFDocHasOC=function(a){var b=Module.allocate(4,
|
|
260
260
|
"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocHasOC(a,b));return 0!==Module.getValue(b,"i8")};c.PDFDocGetOCGConfig=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocGetOCGConfig(a,b));return Module.getValue(b,"i8*")};c.OCGContextCreate=function(a){var b=Module.allocate(4,"i8",Module.ALLOC_STACK);REX(Module._TRN_OCGContextCreateFromConfig(a,b));return Module.getValue(b,"i8*")};c.UStringDestroy=function(a){REX(Module._TRN_UStringDestroy(a))};c.PDFDocFDFUpdate=function(a,
|
|
261
|
-
b,d){if(d){for(var
|
|
262
|
-
b))};c.FDFDocDestroy=function(a){REX(Module._TRN_FDFDocDestroy(a))}})(t.Module)}).call(this,u(10).setImmediate)},function(v,
|
|
263
|
-
typeof
|
|
264
|
-
|
|
265
|
-
{};var r=function(
|
|
266
|
-
value:
|
|
267
|
-
|
|
268
|
-
F=t(F),
|
|
269
|
-
|
|
270
|
-
"PDFNet is not initialized yet!"))},NewDoc:function(
|
|
271
|
-
Object(
|
|
272
|
-
if(
|
|
273
|
-
{}),
|
|
274
|
-
|
|
275
|
-
function(
|
|
276
|
-
|
|
277
|
-
function(
|
|
278
|
-
|
|
279
|
-
function(
|
|
280
|
-
"Progressive request in progress");var
|
|
281
|
-
{type:"Unavailable",message:"Rendering is complete or was cancelled."};return
|
|
282
|
-
|
|
261
|
+
b,d){if(d){for(var p=Object.keys(d),g=p.length,z=Module._malloc(8*g),y=0;y<g;++y){var E=8*y,K=p[y],N=Module.GetDoc(d[K]);K=Module.GetUStringFromJSString(K);Module.setValue(z+E,N,"i8*");Module.setValue(z+E+4,K,"i8*")}d=Module.allocate(8,"i8",Module.ALLOC_STACK);REX(Module._TRN_PDFDocFDFUpdateAppearanceDocs(a,b,z,g,d));a=Module.getValue(d,"i8*");b=Module.VectorGetSize(a);g=Array(b);for(z=0;z<b;++z)d=Module.VectorGetAt(a,z),g[z]=Module.ExtractApRefChangeData(d);Module.VectorDestroy(a);if(b)return g}else REX(Module._TRN_PDFDocFDFUpdate(a,
|
|
262
|
+
b))};c.FDFDocDestroy=function(a){REX(Module._TRN_FDFDocDestroy(a))}})(t.Module)}).call(this,u(10).setImmediate)},function(v,B,u){function q(n){"@babel/helpers - typeof";return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(x){return typeof x}:function(x){return x&&"function"==typeof Symbol&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},q(n)}(function(n){n.SetupPDFNetFunctions=function(x){Module._IB_=[];for(var l=function(e){if("object"===q(e)&&null!==e)if("undefined"!==
|
|
263
|
+
typeof e.byteLength){var w=Module._IB_.length;Module._IB_[w]=new Uint8Array(e);e={handle:w,isArrayBufferRef:!0}}else Object.keys(e).forEach(function(F){e.hasOwnProperty(F)&&(e[F]=l(e[F]))});return e},t=function(e){"object"===q(e)&&null!==e&&(e.buffer?e=e.buffer.slice(e.byteOffset,e.byteOffset+e.length):e.isArrayBufferRef?e=Module._IB_[e.handle].buffer:Object.keys(e).forEach(function(w){e.hasOwnProperty(w)&&(e[w]=t(e[w]))}));return e},c=Module._TRN_EMSCreateSharedWorkerInstance(),m,k=Module._TRN_EMSWorkerInstanceGetFunctionIterator(c),
|
|
264
|
+
h=function(e,w){return new Promise(function(F,D){e=l(e);var I=e.docId;I=I?Module.GetDoc(I):0;(I=Module.EMSCallSharedFunction(c,w,I))?D({type:"PDFWorkerError",message:Module.GetErrToString(I)}):(D=Module.EMSGetLastResponse(c),D=t(D),F(D))})};m=Module._TRN_EMSFunctionIteratorGetNextCommandName(k);)m=Module.GetJSStringFromCString(m),n.queue.onAsync(m,h);Module._TRN_EMSFunctionIteratorDestroy(k);if(Module._TRN_EMSCreatePDFNetWorkerInstance){var f={};k=function(e,w){x.on(e,w);f[e]=!0};Module.docPtrStringToIdMap=
|
|
265
|
+
{};var r=function(e){if(e in Module.docPtrStringToIdMap)return Module.docPtrStringToIdMap[e];throw Error("Couldn't find document ".concat(e));};n.queue.onAsync("PDFDoc.RequirePage",function(e){return Module.RequirePage(r(e.docId),e.pageNum)});k("pdfDocCreateFromBuffer",function(e){e=Module.CreateDoc({type:"array",value:e.buf});var w=Module.GetDoc(e).toString(16);Module.docPtrStringToIdMap[w]=e;return w});k("pdfDocCreateFromLayoutEls",function(e){var w=Module.CreateDocFromLayoutEls(e.buf);e=Module.CreateDoc({type:"ptr",
|
|
266
|
+
value:w});w=w.toString(16);Module.docPtrStringToIdMap[w]=e;return w});k("PDFDoc.destroy",function(e){e=r(e.auto_dealloc_obj);Module.DeleteDoc(e)});k("PDFDoc.saveMemoryBuffer",function(e){var w=r(e.doc);return Module.SaveHelper(Module.GetDoc(w),w,e.flags).slice(0)});k("pdfDocCreate",function(){var e=Module.CreateDoc({type:"new"}),w=Module.GetDoc(e).toString(16);Module.docPtrStringToIdMap[w]=e;return w});k("GetPDFDoc",function(e){e=e.docId;var w=Module.GetDoc(e).toString(16);Module.docPtrStringToIdMap[w]=
|
|
267
|
+
e;return w});k("ExtractPDFNetLayersContext",function(e){var w=e.layers;e=Module.GetDoc(e.docId);var F=0;w?F=Module.EMSCreateUpdatedLayersContext(e,w):Module.PDFDocHasOC(e)&&(w=Module.PDFDocGetOCGConfig(e),F=Module.OCGContextCreate(w));return F.toString(16)});var A=Module._TRN_EMSCreatePDFNetWorkerInstance();k=Module._TRN_EMSWorkerInstanceGetFunctionIterator(A);for(h=function(e){return new Promise(function(w,F){e=l(e);var D=Module.EMSCallPDFNetFunction(A,e);D?F(Module.GetErrToString(D)):(F=Module.EMSGetLastResponse(A),
|
|
268
|
+
F=t(F),w(F))})};m=Module._TRN_EMSFunctionIteratorGetNextCommandName(k);)if(m=Module.GetJSStringFromCString(m),!f[m])x.onAsync(m,h);Module._TRN_EMSFunctionIteratorDestroy(k)}}})(self)},function(v,B,u){var q=u(9),n=u.n(q),x=u(17),l=u(18),t=u(7),c=u(19),m=u(1),k=u(20);(function(h){var f=null;h.basePath="../";var r=function(){var e=h.pdfWorkerPath||"";h.workerBasePath&&(h.basePath=h.workerBasePath);var w=h.isFull,F=w?"full/":"lean/";h.useOptimizedWorker&&(F+=k.a);var D=h.wasmDisabled,I=h.disableObjectURLBlobs,
|
|
269
|
+
L=h.pdfWorkerChunkPaths;Object(m.c)();h.overriddenPdfWorkerPath&&(e=h.overriddenPdfWorkerPath,h.basePath="../",!Object(t.a)()||D)&&(e="");h.basePath=h.externalPath?h.externalPath:h.basePath+"external/";Object(c.a)("".concat(e+F,"PDFNetC"),{"Wasm.wasm":w?1E7:4E6,"Wasm.js.mem":1E5,".js.mem":12E6,".mem":w?2E6:6E5,disableObjectURLBlobs:I},D,L)};h.EmscriptenPDFManager=function(){};h.EmscriptenPDFManager.prototype={OnInitialized:function(e){Module.loaded?e():(Module.initCb=function(){e()},Object(m.b)("worker",
|
|
270
|
+
"PDFNet is not initialized yet!"))},NewDoc:function(e,w){return new Promise(function(F,D){try{F(Module.loadDoc(e,w))}catch(I){D(I)}})},Initialize:function(e,w,F,D){e&&(Module.TOTAL_MEMORY=e);Module.memoryInitializerPrefixURL=w;Module.asmjsPrefix=F;h.basePath=D;r()},shouldRunRender:function(e){return Module.ShouldRunRender(e.docId,e.pageIndex+1)}};var A={setup:function(e){function w(g){var z=g.data,y=g.action;var E="GetCanvas"===y||"GetCanvasPartial"===y?L.shouldRunRender(z):!0;if(E){f=g;var K=g.asyncCallCapability;
|
|
271
|
+
Object(m.b)("Memory","Worker running command: ".concat(y));G.actionMap[y](z,g).then(function(N){"BeginOperation"!==f.action&&(f=null);K.resolve(N)},function(N){f=null;K.reject(N)})}else h.deferredQueue.queue(g),I()}function F(g){g.asyncCallCapability=createPromiseCapability();f||G.length?G.queue(g):w(g);return g.asyncCallCapability.promise}function D(g){self.shouldResize&&L.Initialize(g.options.workerHeapSize,g.options.pdfResourcePath,g.options.pdfAsmPath,g.options.parentUrl);Module.chunkMax=g.options.chunkMax;
|
|
272
|
+
if(g.array instanceof Uint8Array){var z=255===g.array[0];e.postMessageTransfers=z;"response"in new XMLHttpRequest?L.OnInitialized(function(){h.SetupPDFNetFunctions(e);b();e.send("test",{supportTypedArray:!0,supportTransfers:z})}):e.send("test",!1)}else e.send("test",!1)}function I(){x.a.setImmediate(function(){if((!f||"BeginOperation"!==f.action)&&G.length&&!f){var g=G.dequeue();w(g)}})}var L=new h.EmscriptenPDFManager,G,H=!1,a=!1;Module.workerMessageHandler=e;var b=function(){H?a||(e.send("workerLoaded",
|
|
273
|
+
{}),a=!0):H=!0};L.OnInitialized(b);(function(){h.queue=G=new n.a({strategy:q.ArrayStrategy,comparator:function(g,z){return g.priority===z.priority?g.callbackId-z.callbackId:z.priority-g.priority}});h.deferredQueue=new n.a({strategy:q.ArrayStrategy,comparator:function(g,z){return g.priority===z.priority?g.callbackId-z.callbackId:z.priority-g.priority}});G.actionMap={};G.onAsync=function(g,z){e.onAsync(g,F);G.actionMap[g]=z}})();e.on("test",D);e.on("InitWorker",D);var d=function(g){f&&g(f)&&(Module.cancelCurrent(),
|
|
274
|
+
f=null);G.removeAllMatching(g,function(z){z.asyncCallCapability.reject({type:"Cancelled",message:"Operation was cancelled due to a change affecting the loaded document."})})},p=function(g){d(function(z){return z.data&&z.data.docId===g})};e.on("UpdatePassword",function(g){return Module.UpdatePassword(g.docId,g.password)});e.on("UpdateCustomHeader",function(g){return Module.UpdateCustomHeader(g.docId,g.customHeader)});e.on("LoadRes",function(g){Module.loadResources(g.array,g.l);return{}});e.on("DownloaderHint",
|
|
275
|
+
function(g){Module.DownloaderHint(g.docId,g.hint)});e.on("IsLinearized",function(g){return Module.IsLinearizationValid(g.docId)});e.onNextAsync(I);G.onAsync("NewDoc",function(g){return L.NewDoc(g)});G.onAsync("GetCanvas",function(g){Object(m.b)("workerdetails","Run GetCanvas PageIdx: ".concat(g.pageIndex," Width: ").concat(g.width));Object(m.b)("Memory","loadCanvas with potential memory usage ".concat(g.width*g.height*8));return Module.loadCanvas(g.docId,g.pageIndex,g.width,g.height,g.rotation,null,
|
|
276
|
+
g.layers,g.renderOptions)});G.onAsync("GetCanvasPartial",function(g){Object(m.b)("Memory","GetCanvasPartial with potential memory usage ".concat(g.width*g.height*8));return Module.loadCanvas(g.docId,g.pageIndex,g.width,g.height,g.rotation,g.bbox,g.layers,g.renderOptions)});G.onAsync("SaveDoc",function(g){return Module.SaveDoc(g.docId,g.xfdfString,g.finishedWithDocument,g.printDocument,g.flags,g.watermarks,g.apdocs,g.password,g.encryptionAlgorithmType,g.xfdfCommand)});G.onAsync("SaveDocFromFixedElements",
|
|
277
|
+
function(g){return Module.SaveDocFromFixedElements(g.bytes,g.xfdfString,g.flags,g.watermarks,g.password,g.encryptionAlgorithmType,g.xfdfCommand)});G.onAsync("MergeXFDF",function(g){return Module.MergeXFDF(g.docId,g.xfdf,g.apdocs)});G.onAsync("InsertPages",function(g){return Module.InsertPages(g.docId,g.doc,g.pageArray,g.destPos,g.insertBookmarks,g.skipUpdateEvent)});G.onAsync("MovePages",function(g){return Module.MovePages(g.docId,g.pageArray,g.destPos)});G.onAsync("RemovePages",function(g){return Module.RemovePages(g.docId,
|
|
278
|
+
g.pageArray,g.skipUpdateEvent)});G.onAsync("RotatePages",function(g){return Module.RotatePages(g.docId,g.pageArray,g.rotation)});G.onAsync("ExtractPages",function(g){return Module.ExtractPages(g.docId,g.pageArray,g.xfdfString,g.watermarks,g.apdocs,g.skipUpdateEvent)});G.onAsync("CropPages",function(g){return Module.CropPages(g.docId,g.pageArray,g.topMargin,g.botMargin,g.leftMargin,g.rightMargin)});G.onAsync("TriggerFullDownload",function(g){return Module.TriggerFullDownload(g.docId)});G.onAsync("InsertBlankPages",
|
|
279
|
+
function(g){return Module.InsertBlankPages(g.docId,g.pageArray,g.width,g.height)});G.onAsync("BeginOperation",function(){return Promise.resolve()});G.onAsync("RequirePage",function(g,z){return Module.RequirePage(g.docId,g.pageNum)});e.on("FinishOperation",function(){if(f&&"BeginOperation"===f.action)f=null,I();else throw{message:"Operation has not started."};});e.on("DeleteDocument",function(g){g=g.docId;p(g);Module.DeleteDoc(g)});e.on("GetCanvasProgressive",function(g){if(f&&f.callbackId===g.callbackId){Object(m.b)("worker",
|
|
280
|
+
"Progressive request in progress");var z=Module.GetCurrentCanvasData(!0)}else{if(G.find({priority:0,callbackId:g.callbackId}))throw Object(m.b)("worker","Progressive request Queued"),{type:"Queued",message:"Rendering has not started yet."};if(h.deferredQueue.find({priority:0,callbackId:g.callbackId}))throw Object(m.b)("worker","Progressive request Deferred"),{type:"Queued",message:"Rendering has not started yet."};}if(!z)throw Object(m.b)("worker","Progressive request invalid (render already complete)"),
|
|
281
|
+
{type:"Unavailable",message:"Rendering is complete or was cancelled."};return z});e.on("actionCancel",function(g){f&&f.callbackId===g.callbackId?(Object(m.b)("workerdetails","Cancelled Current Operation"),Module.cancelCurrent()&&(f=null,I())):(Object(m.b)("workerdetails","Cancelled queued operation"),G.remove({priority:0,callbackId:g.callbackId}),h.deferredQueue.remove({priority:0,callbackId:g.callbackId}))})}};h.onmessage=function(e){if("init"===e.data.action){var w=e.data.shouldResize;h.shouldResize=
|
|
282
|
+
w;h.isFull=e.data.isFull;h.wasmDisabled=!e.data.wasm;h.externalPath=e.data.externalPath;h.useOptimizedWorker=e.data.useOptimizedWorker;h.disableObjectURLBlobs=e.data.disableObjectURLBlobs;h.pdfWorkerChunkPaths=e.data.pdfWorkerChunkPaths;if(e=e.data.pdfWorkerPath)h.overriddenPdfWorkerPath=e;w||r();w=new l.a("worker_processor",self);Object(m.a)(w);A.setup(w)}}})("undefined"===typeof window?self:window)}]);}).call(this || window)
|