import{g as ta}from"./_commonjsHelpers-BosuxZz1.js";import{c as _r,d as ea,z as qi,m as Ki,a as Gi,i as ra}from"./constants-C62nVphH.js";/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Tn=function(r,t){return Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Tn(r,t)};function A(r,t){Tn(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var G=function(){return G=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},G.apply(this,arguments)};function na(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function Y(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,[])).next())})}function J(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rt(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ke=new Uint8Array(256);for(var Sr=0;Sr<Pe.length;Sr++)Ke[Pe.charCodeAt(Sr)]=Sr;var ia=function(r){for(var t="",e=r.length,n=0;n<e;n+=3)t+=Pe[r[n]>>2],t+=Pe[(r[n]&3)<<4|r[n+1]>>4],t+=Pe[(r[n+1]&15)<<2|r[n+2]>>6],t+=Pe[r[n+2]&63];return e%3===2?t=t.substring(0,t.length-1)+"=":e%3===1&&(t=t.substring(0,t.length-2)+"=="),t},ci=function(r){var t=r.length*.75,e=r.length,n,i=0,o,a,s,c;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);var u=new Uint8Array(t);for(n=0;n<e;n+=4)o=Ke[r.charCodeAt(n)],a=Ke[r.charCodeAt(n+1)],s=Ke[r.charCodeAt(n+2)],c=Ke[r.charCodeAt(n+3)],u[i++]=o<<2|a>>4,u[i++]=(a&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return u},oa=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,aa=function(r){var t=r.trim(),e=t.substring(0,100),n=e.match(oa);if(!n)return ci(t);var i=n[0],o=t.substring(i.length);return ci(o)},K=function(r){return r.charCodeAt(0)},sa=function(r){return r.codePointAt(0)},fr=function(r,t){return Kt(r.toString(16),t,"0").toUpperCase()},$r=function(r){return fr(r,2)},Zt=function(r){return String.fromCharCode(r)},ua=function(r){return Zt(parseInt(r,16))},Kt=function(r,t,e){for(var n="",i=0,o=t-r.length;i<o;i++)n+=e;return n+r},bt=function(r,t,e){for(var n=r.length,i=0;i<n;i++)t[e++]=r.charCodeAt(i);return n},ca=function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},lr=function(r){return r.replace(/\t|\u0085|\u2028|\u2029/g,"    ").replace(/[\b\v]/g,"")},fa=["\\n","\\f","\\r","\\u000B"],Li=function(r){return/^[\n\f\r\u000B]$/.test(r)},Xi=function(r){return r.split(/[\n\f\r\u000B]/)},Hi=function(r){return r.replace(/[\n\f\r\u000B]/g," ")},Zi=function(r,t){var e=r.charCodeAt(t),n,i=t+1,o=1;return e>=55296&&e<=56319&&r.length>i&&(n=r.charCodeAt(i),n>=56320&&n<=57343&&(o=2)),[r.slice(t,t+o),o]},la=function(r){for(var t=[],e=0,n=r.length;e<n;){var i=Zi(r,e),o=i[0],a=i[1];t.push(o),e+=a}return t},ha=function(r){for(var t=fa.join("|"),e=["$"],n=0,i=r.length;n<i;n++){var o=r[n];if(Li(o))throw new TypeError("`wordBreak` must not include "+t);e.push(o===""?".":ca(o))}var a=e.join("|");return new RegExp("("+t+")|((.*?)("+a+"))","gm")},da=function(r,t,e,n){for(var i=ha(t),o=lr(r).match(i),a="",s=0,c=[],u=function(){a!==""&&c.push(a),a="",s=0},f=0,l=o.length;f<l;f++){var h=o[f];if(Li(h))u();else{var d=n(h);s+d>e&&u(),a+=h,s+=d}}return u(),c},va=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Yi=function(r){var t=r.match(va);if(t){var e=t[1],n=t[2],i=n===void 0?"01":n,o=t[3],a=o===void 0?"01":o,s=t[4],c=s===void 0?"00":s,u=t[5],f=u===void 0?"00":u,l=t[6],h=l===void 0?"00":l,d=t[7],g=d===void 0?"Z":d,y=t[8],b=y===void 0?"00":y,m=t[9],S=m===void 0?"00":m,F=g==="Z"?"Z":""+g+b+":"+S,T=new Date(e+"-"+i+"-"+a+"T"+c+":"+f+":"+h+F);return T}},Vn=function(r,t){for(var e,n=0,i;n<r.length;){var o=r.substring(n).match(t);if(!o)return{match:i,pos:n};i=o,n+=((e=o.index)!==null&&e!==void 0?e:0)+o[0].length}return{match:i,pos:n}},zr=function(r){return r[r.length-1]},Dn=function(r){if(r instanceof Uint8Array)return r;for(var t=r.length,e=new Uint8Array(t),n=0;n<t;n++)e[n]=r.charCodeAt(n);return e},pa=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r.length,n=[],i=0;i<e;i++){var o=r[i];n[i]=o instanceof Uint8Array?o:Dn(o)}for(var a=0,i=0;i<e;i++)a+=r[i].length;for(var s=new Uint8Array(a),c=0,u=0;u<e;u++)for(var f=n[u],l=0,h=f.length;l<h;l++)s[c++]=f[l];return s},ga=function(r){for(var t=0,e=0,n=r.length;e<n;e++)t+=r[e].length;for(var i=new Uint8Array(t),o=0,e=0,n=r.length;e<n;e++){var a=r[e];i.set(a,o),o+=a.length}return i},Ji=function(r){for(var t="",e=0,n=r.length;e<n;e++)t+=Zt(r[e]);return t},ya=function(r,t){return r.id-t.id},ma=function(r,t){for(var e=[],n=0,i=r.length;n<i;n++){var o=r[n],a=r[n-1];(n===0||t(o)!==t(a))&&e.push(o)}return e},Fe=function(r){for(var t=r.length,e=0,n=Math.floor(t/2);e<n;e++){var i=e,o=t-e-1,a=r[e];r[i]=r[o],r[o]=a}return r},ba=function(r){for(var t=0,e=0,n=r.length;e<n;e++)t+=r[e];return t},xa=function(r,t){for(var e=new Array(t-r),n=0,i=e.length;n<i;n++)e[n]=r+n;return e},Fa=function(r,t){for(var e=new Array(t.length),n=0,i=t.length;n<i;n++)e[n]=r[t[n]];return e},Sa=function(r){return r instanceof Uint8Array||r instanceof ArrayBuffer||typeof r=="string"},Me=function(r){if(typeof r=="string")return aa(r);if(r instanceof ArrayBuffer)return new Uint8Array(r);if(r instanceof Uint8Array)return r;throw new TypeError("`input` must be one of `string | ArrayBuffer | Uint8Array`")},Oe=function(){return new Promise(function(r){setTimeout(function(){return r()},0)})},wa=function(r,t){t===void 0&&(t=!0);var e=[];t&&e.push(65279);for(var n=0,i=r.length;n<i;){var o=r.codePointAt(n);if(o<65536)e.push(o),n+=1;else if(o<1114112)e.push(Qi(o),_i(o)),n+=2;else throw new Error("Invalid code point: 0x"+$r(o))}return new Uint16Array(e)},Ca=function(r){return r>=0&&r<=65535},Pa=function(r){return r>=65536&&r<=1114111},Qi=function(r){return Math.floor((r-65536)/1024)+55296},_i=function(r){return(r-65536)%1024+56320},oe;(function(r){r.BigEndian="BigEndian",r.LittleEndian="LittleEndian"})(oe||(oe={}));var Ie="�".codePointAt(0),$i=function(r,t){if(t===void 0&&(t=!0),r.length<=1)return String.fromCodePoint(Ie);for(var e=t?Da(r):oe.BigEndian,n=t?2:0,i=[];r.length-n>=2;){var o=li(r[n++],r[n++],e);if(Ta(o))if(r.length-n<2)i.push(Ie);else{var a=li(r[n++],r[n++],e);fi(a)?i.push(o,a):i.push(Ie)}else fi(o)?(n+=2,i.push(Ie)):i.push(o)}return n<r.length&&i.push(Ie),String.fromCodePoint.apply(String,i)},Ta=function(r){return r>=55296&&r<=56319},fi=function(r){return r>=56320&&r<=57343},li=function(r,t,e){if(e===oe.LittleEndian)return t<<8|r;if(e===oe.BigEndian)return r<<8|t;throw new Error("Invalid byteOrder: "+e)},Da=function(r){return to(r)?oe.BigEndian:eo(r)?oe.LittleEndian:oe.BigEndian},to=function(r){return r[0]===254&&r[1]===255},eo=function(r){return r[0]===255&&r[1]===254},ro=function(r){return to(r)||eo(r)},ka=function(r){var t=String(r);if(Math.abs(r)<1){var e=parseInt(r.toString().split("e-")[1]);if(e){var n=r<0;n&&(r*=-1),r*=Math.pow(10,e-1),t="0."+new Array(e).join("0")+r.toString().substring(2),n&&(t="-"+t)}}else{var e=parseInt(r.toString().split("+")[1]);e>20&&(e-=20,r/=Math.pow(10,e),t=r.toString()+new Array(e+1).join("0"))}return t},Er=function(r){return Math.ceil(r.toString(2).length/8)},Se=function(r){for(var t=new Uint8Array(Er(r)),e=1;e<=t.length;e++)t[e-1]=r>>(t.length-e)*8;return t},hr=function(r){throw new Error(r)},dr={},ge={},tn=_r,no=!0,io=!0;try{String.fromCharCode.apply(null,[0])}catch{no=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{io=!1}var nr=new tn.Buf8(256);for(var ee=0;ee<256;ee++)nr[ee]=ee>=252?6:ee>=248?5:ee>=240?4:ee>=224?3:ee>=192?2:1;nr[254]=nr[254]=1;ge.string2buf=function(r){var t,e,n,i,o,a=r.length,s=0;for(i=0;i<a;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new tn.Buf8(s),o=0,i=0;o<s;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t};function oo(r,t){if(t<65534&&(r.subarray&&io||!r.subarray&&no))return String.fromCharCode.apply(null,tn.shrinkBuf(r,t));for(var e="",n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e}ge.buf2binstring=function(r){return oo(r,r.length)};ge.binstring2buf=function(r){for(var t=new tn.Buf8(r.length),e=0,n=t.length;e<n;e++)t[e]=r.charCodeAt(e);return t};ge.buf2string=function(r,t){var e,n,i,o,a=t||r.length,s=new Array(a*2);for(n=0,e=0;e<a;){if(i=r[e++],i<128){s[n++]=i;continue}if(o=nr[i],o>4){s[n++]=65533,e+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&e<a;)i=i<<6|r[e++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return oo(s,n)};ge.utf8border=function(r,t){var e;for(t=t||r.length,t>r.length&&(t=r.length),e=t-1;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+nr[r[e]]>t?e:t};var Ye=ea,Je=_r,kn=ge,An=Ki,Aa=qi,ao=Object.prototype.toString,Oa=0,xn=4,De=0,hi=1,di=2,Ra=-1,Ba=0,Ea=8;function ve(r){if(!(this instanceof ve))return new ve(r);this.options=Je.assign({level:Ra,method:Ea,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ba,to:""},r||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Aa,this.strm.avail_out=0;var e=Ye.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==De)throw new Error(An[e]);if(t.header&&Ye.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=kn.string2buf(t.dictionary):ao.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=Ye.deflateSetDictionary(this.strm,n),e!==De)throw new Error(An[e]);this._dict_set=!0}}ve.prototype.push=function(r,t){var e=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?xn:Oa,typeof r=="string"?e.input=kn.string2buf(r):ao.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;do{if(e.avail_out===0&&(e.output=new Je.Buf8(n),e.next_out=0,e.avail_out=n),i=Ye.deflate(e,o),i!==hi&&i!==De)return this.onEnd(i),this.ended=!0,!1;(e.avail_out===0||e.avail_in===0&&(o===xn||o===di))&&(this.options.to==="string"?this.onData(kn.buf2binstring(Je.shrinkBuf(e.output,e.next_out))):this.onData(Je.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||e.avail_out===0)&&i!==hi);return o===xn?(i=Ye.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===De):(o===di&&(this.onEnd(De),e.avail_out=0),!0)};ve.prototype.onData=function(r){this.chunks.push(r)};ve.prototype.onEnd=function(r){r===De&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Je.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function zn(r,t){var e=new ve(t);if(e.push(r,!0),e.err)throw e.msg||An[e.err];return e.result}function ja(r,t){return t=t||{},t.raw=!0,zn(r,t)}function Na(r,t){return t=t||{},t.gzip=!0,zn(r,t)}dr.Deflate=ve;dr.deflate=zn;dr.deflateRaw=ja;dr.gzip=Na;var vr={};function Ma(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ia=Ma,ke=ra,Qe=_r,jr=ge,ht=Gi,On=Ki,Ua=qi,Va=Ia,so=Object.prototype.toString;function pe(r){if(!(this instanceof pe))return new pe(r);this.options=Qe.assign({chunkSize:16384,windowBits:0,to:""},r||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ua,this.strm.avail_out=0;var e=ke.inflateInit2(this.strm,t.windowBits);if(e!==ht.Z_OK)throw new Error(On[e]);if(this.header=new Va,ke.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=jr.string2buf(t.dictionary):so.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=ke.inflateSetDictionary(this.strm,t.dictionary),e!==ht.Z_OK)))throw new Error(On[e])}pe.prototype.push=function(r,t){var e=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,c,u,f=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?ht.Z_FINISH:ht.Z_NO_FLUSH,typeof r=="string"?e.input=jr.binstring2buf(r):so.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;do{if(e.avail_out===0&&(e.output=new Qe.Buf8(n),e.next_out=0,e.avail_out=n),o=ke.inflate(e,ht.Z_NO_FLUSH),o===ht.Z_NEED_DICT&&i&&(o=ke.inflateSetDictionary(this.strm,i)),o===ht.Z_BUF_ERROR&&f===!0&&(o=ht.Z_OK,f=!1),o!==ht.Z_STREAM_END&&o!==ht.Z_OK)return this.onEnd(o),this.ended=!0,!1;e.next_out&&(e.avail_out===0||o===ht.Z_STREAM_END||e.avail_in===0&&(a===ht.Z_FINISH||a===ht.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=jr.utf8border(e.output,e.next_out),c=e.next_out-s,u=jr.buf2string(e.output,s),e.next_out=c,e.avail_out=n-c,c&&Qe.arraySet(e.output,e.output,s,c,0),this.onData(u)):this.onData(Qe.shrinkBuf(e.output,e.next_out))),e.avail_in===0&&e.avail_out===0&&(f=!0)}while((e.avail_in>0||e.avail_out===0)&&o!==ht.Z_STREAM_END);return o===ht.Z_STREAM_END&&(a=ht.Z_FINISH),a===ht.Z_FINISH?(o=ke.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===ht.Z_OK):(a===ht.Z_SYNC_FLUSH&&(this.onEnd(ht.Z_OK),e.avail_out=0),!0)};pe.prototype.onData=function(r){this.chunks.push(r)};pe.prototype.onEnd=function(r){r===ht.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Qe.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Wn(r,t){var e=new pe(t);if(e.push(r,!0),e.err)throw e.msg||On[e.err];return e.result}function za(r,t){return t=t||{},t.raw=!0,Wn(r,t)}vr.Inflate=pe;vr.inflate=Wn;vr.inflateRaw=za;vr.ungzip=Wn;var Wa=_r.assign,qa=dr,Ka=vr,Ga=Gi,uo={};Wa(uo,qa,Ka,Ga);var La=uo,en=ta(La),vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ge=new Uint8Array(256);for(var wr=0;wr<vi.length;wr++)Ge[vi.charCodeAt(wr)]=wr;var Xa=function(r){var t=r.length*.75,e=r.length,n,i=0,o,a,s,c;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);var u=new Uint8Array(t);for(n=0;n<e;n+=4)o=Ge[r.charCodeAt(n)],a=Ge[r.charCodeAt(n+1)],s=Ge[r.charCodeAt(n+2)],c=Ge[r.charCodeAt(n+3)],u[i++]=o<<2|a>>4,u[i++]=(a&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return u},Ha=function(r){for(var t="",e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},co=function(r){return Ha(en.inflate(Xa(r)))},Za=function(r,t,e){for(var n="",i=0,o=t-r.length;i<o;i++)n+=e;return n+r},Ya="eJyFWdtyGjkQ/RVqnnar8Bb4lpg3jEnCxgEvGDtxKg9iphm01oyILrZxKv++mrGd3az6KC8UnNa0+nrUGr5lI11VVLtskF198FaU1Dns9w9OOkf7/ePDrJu90bWbiorCgpH2RpLZO9WqaCReqZ8lnReJqKTa/SwL8DXJctPs9Lxs4oSS+bAuVVjXC7/tG/lAxYV0+SYbOOOpm402wojckVlQ8+T4wVFdUDHXlaifrTs91Q/Z4PNeMLu7t3/U6746POm+7vW/dLNlWGuUrOlCW+mkrrPBXr/X+4/gciPz25qszQbhyeyKjG2XZb3ewR+9Xi/sMdVO5k+ebHemcaHzW/57p3/y+qQbPk967We//TxoP191hoVeUWexs44q25nUuTZbbYSj4o9OZ6hUZ97osZ05WTJ3AQ37jMOqQtblIt9QG7lWycKJuhCmeJGGhSOxffccyqPj/W728eXX4cFJNxvavAmRyQbH++HnGf34vdc/etXNFq54d50NXh+2X6/C137v+CnQH8gZmYdQfP6WXX8MCppQTYMlditCBL53/wfTQ65EFeNfvQ6erlQsqX21akJc1rGs0EoJE+NbMnlToZFAVEFkQ3iABW2uGH3CUK1ojUTgMWEbjfaWeUp5G6N5aCwRw5vddkOM98EVqRlPrBJ2E8OPZHSM6prJkrtnVrqNIWbtOjQrg8o7Zq2VDwxId5x3xMe0lpzBuVaa0WGpkkCkmgaON/3qBVODpaHQiIybXz3ZliTi3DO2D2PoNIZGMXQWQ+MYehNDb2PoXQxNYujPGHofQ+cx9CGGpjE0i6GLGPorhuYxtIihyxhaxtBVDF3H0McY+hRDNzG0CqfQLTmeNlZBBvr0+TnIKbmUuTS5Z1jUN6xtw8nBtEjLb7wxDOesmB5j+JfpIIYLmIZiWC6GZAz9HUMMvTItzESL6VqG9rZMKGOI4QaGXpjY+xi6i6H7GGKYdMeQPl9foBBW3GHark9Vo5OqgEd9oe+ZOPOnc3NcqmZgiUuomehYnt1xZ8daaSPZ8wBoyb0Jx3jOBLBtGyvbiRNOLXw0Sy+DpNKAAhpxq/gXYhD6NdMda6bwwyTH0kwhypI70p5wdhR7Gjia3JEhpvfDLCRKI7YcqYXJnxgv/g3vSthEhNNSEKIfCQByUkpurWQaNXjqNtqjSfHp0OdLOwSAG31E7h03uLRMvlbEtDPoq0rkhqvhlSFu40I7kfP9VoRLFrH+G7YLcypCQLkJ1delML5SwjPb6DIMmQxL54L1gyq+YIfMyKNNsQ4zHj8UnoMDdoZwfoMqkJxX7A6Cj3czWzLdqcC+GuGM9tCa4RobSp5J2gTnk0D5CVA0Pp1RAqn7hC0o5J3kqvkTsGyY6gwBHlqmHtqBh2x77UI9QimVS75PljgMAjXDEljn0QNjvMlZIAju/pF0NH95VcFshSgnB3Ug+LhMkwYoVKOAUS+T2kZIG2DVcYInLXDTQkKUYHelH6kuGcEcbPE26aRPNklKOEQpNcCQHPp6k4jc5UYbRtkM7T4HcVsAvADWLtEGnq/M9t2G9e2Aw8xEM1CCQ4QDWq28cnKrmDHTAwcvgYNh1HJSqEKumdvVDlPDFOwjU8UyTpZZ4tTBohzYUSMaRAmdggBNgKLmzVsYGLjXbyujb6lm70CGSmnB1PsWJHuSYhQfupq/ioxBTRngkEaRuQEP3ICIPb/kAq/Axo6ZUEaQFFSStxwa/eDpiARDND4kqhIE+BG1Btp7hjKCjh6UKYt2xk7MkmMJ8PCMlGNy5XiSdvc6wYjYtIp5pSGBRTo9Z45R6Asw4bQ8HgrYhEJmTFsk6pWvyPfJOj4HiXNGFFQJw1hOCVaYgChNUOGcA6tD0DZCMSdDczMBDa5TFVWDqWn5i/yB+BByqARcGhx6ziqXVD4Ii2TqZmnLi8AS3L8dGqRoBIzwkM0LmXNpOAOKTNKbKciPBvg8XdZJ6RDoHEKO5meuGdDzmOiQMTrt0d63SVfAIDBJtgIwwaUvN7ps8l1r7v0I5lKPRUEV+rcqfaHlDvJH4FSdVBVCjk8IiXp87Jv/Ib90s/dk6gshTfPv8Zfv/wDUfBK2",Ja="eJyFWdtyGjkQ/RVqnnarcAo7vuE3jEnCxgEvGDtxKg9iRgxaa0ZEF9s4lX/fnrGdTVZ9lBcKTmvU96PW8C0bmqqStc9OsqsPwYlSdnaPDvb6naP+3v5+1s3emNpPRCVpwdAEq6TdOTW6mC61+hpksyBo/euCTrOg89MKUSm9/XUNwddSletGcbOcfo+90Cof1KWmdTu7e4S4N+pBFhfK5+vsxNsgu9lwLazIvbRz2Tw7evCyLmQxM5Won809PTUP2cnnnYOj7s7eQa97fNjvHvd2v3SzBS21WtXywjjllakbRb3eT4LLtcpva+lcdkJPZlfSunZZ1uu9ftXr9UjFxHiVP7my2drGh84f+Z+d3f5xv0uf/V77udt+vm4/jzqDwixlZ751XlauM65zYzfGCi+LV53OQOvOrNnHdWbSSXtHKOkZ0apC1eU8X8s2dO0mcy/qQtjiRUoLh2Lz7jmWB4cUto8vv/Zf97vZwOVNhGx2crhHP8/kj987uxShbO6Ld9fZyfF++/WKvu72Dp/i/EF6q3IKxedv2fVH2qAJ1YQscRtBEfje/R8sH3Itqhj/Ggx5utSxpA7VsglxWceywmgtbIxvpM2bio0EoiKRo/AAC9pcMfsJK2stV0gEHhOu2dHdMk/p4GI0p0YTMbzebtaS8Z5cUYbxxGnh1jH8KK2JUVMzWfL3zEq/tpJZu6JuZVB1x6x16oEB5R3nneRjWivO4Nxow+zhZKWASDcNHCv9GgRTg6WV1IiMm8ReriWJOPeM7YMYOo2hYQydxdAoht7E0NsYehdD4xj6K4bex9B5DH2IoUkMTWPoIob+jqFZDM1j6DKGFjF0FUPXMfQxhj7F0E0MLekQupWep40lyUCfPj8HOSVXKlc2DwyLhoa1HZ0cTIu0/MYbw3DOkukxhn+ZDmK4gGkohuViSMXQPzHE0CvTwky0mK5laG/DhDKGGG5g6IWJfYihuxi6jyGGSbcM6fP1BQphyR2m7fpUNXqlC3jUF+aeiTN/OjfHpW4GlriEmoGO5dktd3astLGKPQ/ALnmwdIznTADbtnGqHTnh1MJHswyKJJUBFNCI241/IwahXzHdsWIKnyY5lmYKUZbckfaEs6PY08DR5E5ayfQ+zUKitGLDkRpdASTjxX/hXQqXiHBaCkL0IwFALrVWG6eYRiVP/doENCk+Hfp8aVMAuNFH5MFzg0vL5CstmXYGfVWJ3HI1vLSSU1wYL3K+3wq6ZUnWf8t2YS4LCig3oYa6FDZUWgRGjSlpyGRYOhesH7LiC3bAjDzGFiua8fih8BwcsFOE8woqIrmgWQ2Cj3czWzLdqYFeg3Bmd2pNusVSyTNJG+N8SlB+AhRNSGdUgtR9whYU6k5x1fwJWDZIdYYADy1SD23BQ669dqEekaktF3yfLHAYBGqGBbAuoAdGWMkZEQR3/0g6mr+8qmBUIcrJQR0IPi6TpAEa1Shg1MvkbkO0G2DVUYInHXDTQUJUQLs2j7IuGcEMqHibdDIkmyQlHKCUWmBIDn29SUTucm0ss9kUaZ+BuM0BXgBrF0hB4CuzfbfhQjvgMDPRFJTgAOGAVqugvdpoZswMwMFL4CCNWl4JXagVc7vaYmqYAD0qVSyjZJklTh0syoEdNaJBlNAJCNAYbNS8eaOBgXv9trTmVtbsHcjKUjkw9b4FyR6nGCVQV/NXkRGoKQscMigyN+CBGxCx55dc4BXYyDMTyhCSgk7ylkejHzwdkWCAxodEVYIAP6LWQLqnKCPo6EGZckgzdmKaHEuAh2dSeyZXnidpf28SjIhNq5hXGgpYZNJz5giFvgATTsvjVMCWCpkxbZ6oV74i3yfr+BwkzltRyEpYxnKZYIUxiNIYFc45sJqCthaaORmamwlocJOqqBpMTYvf5A/ERyKHSsCl5NBzVrmk8kGYJ1M3TVteEEtw/3YYkKIhMCJANi9UzqXhDGxkk95MQH4MwGfpsk5KB2DPAeRofuaagn0eEx0yQqc90n2bdAUMAuNkKwATfPpyY8om37Xh3o9gLg1YRFuhf6vSF1ruIH8ETtXJrSjk+IRQqMdHofkf8ks3ey9tfSGUbf49/vL9XxrnGMA=",Qa="eJyFWVtT2zgU/isZP+3OhE5Iy/UtDaHNFhI2IdDS4UGxFUeLbKW6AKHT/77Hhnbb1fnUFw98x9K5fzpyvmZDU1Wy9tlxdnUenChlZ3e//+awc7B32D/Kutmpqf1EVJJeGJpglbQ706VWX4JshEHrX4Wdn4SiUnr7q5jga6nKdaPvXBYqVISMvdAqH9Slpjd3dvuEuFP1KIsL5fN1duxtkN1suBZW5F7auWxWjx69rAtZzEwl6hc73741j9nx553+QXenv9frHr456h729m672YJetVrV8sI45ZWpG0W93k+Cy7XK72rpXHZMK7MraV37WtbrvX7V6/VIxcR4lT87s9naxovOH/mfnd2jw6MuPY967XO3ffbb5+v2edAZFGYpO/Ot87JynXGdG7sxVnhZvOp0Blp3Zs1urjOTTtp7QknbiN4qVF3O87VsQ9huMveiLoQtvkvpxaHYvH+J6d4+Be/j9//e9Pe72cDlTZxsdrzfP+pmJ/LH/zu7ewfdbO6L99e0crf98+rlzybY59JblVM8Pn/Nrj/S+iZeEzLEbQSF4Vv3f7B8zLWoYvxLMOToUseSOlTLJs5lHcsKo7WwMb6RNm/qNRKIikSOogMsaBPG7CesrLVcIRFYJlyzo7tjVungYjSnNhMxvN5u1pLxnlxRhvHEaeHWMfwkrYlRUzNZ8g/Mm35tJfPuipqWQdU9865Tjwwo7znvJB/TWnEG50YbZg8nKwVEuuniWOmXIJgaLK2kPmTcJBJzLVPEuWdsH8TQ2xgaxtBJDI1i6DSG3sXQ+xgax9BfMfQhhs5i6DyGJjE0jaGLGPo7hmYxNI+hyxhaxNBVDF3H0McY+hRDNzG0pJPoTnqeNpYkA336sg5ySq5UrmweGBYNDWk7OjiYFmn5jTeG4Zwl02MM/zIdxHAB01AMy8WQiqF/YoihV6aFmWgxXcvQ3oYJZQwx3MDQCxP7EEP3MfQQQwyTbhnS5+sLFMKSO0zb91PV6JUu4FFfmAcmzvzp3ByXuplX4hJqpjqWZ7fc2bHSxir2PAC75MHSMZ4zAWzbxql27oRTCx/NMiiSVAZQQCNuN/6NGIR+xXTHiil8GuRYmilEWXJH2jPOjmLPA0eTO2kl0/s0C4nSig1HanQJkIwX/4V3KVwiwmkpCNGPBAC51FptnGIalTz1axPQpPh86POlTQHgRh+RB88NLi2Tr7Rk2hn0VSVyy9Xw0kpOcWG8yPl+K+iyJVn/LduFOV3GaOBmuDvUpbCh0iIwakxJQybD0rlg/ZAVX7ADZuQxtljRjMcPhWfggJ0inFdQEckFzWoQfLyb2ZLpTg30GoQzu1Nr0lWWSp5J2hjnU4LyE6BoQjqjEqTuE7agUPeKq+ZPwLJBqjMEWLRILdqCRa69dqEekaktF3yfLHAYBGqGBbAuoAUjrOSECIK7fyQdzb9/r2BUIcrJQR0IPi6TpAEa1Shg1MvkbkO0G2DVUYInHXDTQUJUQLs2T7IuGcEMqHiXdDIkmyQlHKCUWmBIDn29SUTucm0ss9kUaZ+BuM0BXgBrF0hB4Cuz/bbhQjvgMDPRFJTgAOGAVqugvdpoZswMwMFL4CCNWl4JXagVc7vaYmqYAD0qVSyjZJklTh0syoEdNaJBlNAJCNAYbNR8eaOBgfv8trTmTtbsHcjKUjkw9b4DyR6nGCVQV/NXkRGoKQscMigyN2DBDYjYy0cu8Als5JkJZQhJQSd5y6PRD56OSDBA40OiKkGAn1BrIN1TlBF09KBMOaQZOzFNjiXAwxOpPZMrz5O0fzAJRsSmVcwnDQUsMuk5c4RCX4AJp+VxKmBLhcyYNk/UK1+RH5J1fAYS560oZCUsY7lMsMIYRGmMCucMWE1BWwvNnAzNzQQ0uElVVA2mpsVv8gfiI5FDJeBScuglq1xS+SDMk6mbpi0viCW4XzsMSNEQGBEgmxcq59JwAjaySW8mID8G4LN0WSelA7DnAHI0P3NNwT5PiQ4ZodMe6b5LugIGgXGyFYAJPn25MWWT79pw30cwlwYsoq3Qr1XpCy13kD8Bp+rkVhRyfEIo1OOj0PwOedvNPkhbXwhlm1+Pb7/9C/NFF2U=",_a="eJyFWdtSGzkQ/RXXPO1WmZSBEAJvjnESb8AmGENCKg+ypj3Wohk5ugAmlX9fzUCyW6s+ysuUfVqXvh61Zr4XI1PX1PjiuLg6C05U1Ns/Ojx42TsYHB4eFf3irWn8VNQUB4xMsIpsCwatU1DUSm8T+JpUtW7XP6NShToiEy+0ksOm0nHkIP53b9UDlefKy3Vx7G2gfjFaCyukJzundu74wVNTUnlhatE8a/XmjXkojr/s7O33d/YOBv3D3YP+68HB136xiEOtVg2dG6e8Mk1xvLM7GPxHcLlW8rYh54rjOLO4Iuu6YcVgsP9iMBjELabGK/lkymZrWxt6f8g/e7tHr4/68Xk06J673XOve+53z8PesDRL6s23zlPtepNGGrsxVngqX/R6Q617F+1qrndBjuxdRONu4ziqVE01l2vqHNgtMveiKYUtf0rjwJHYvH/26MGrvX7x6ee/l3uv+sXQydZPtjh+tXfUL07o1/+d3YPDfjH35fvrOHO3+3n1/LN19hl5q2T0x5fvxfWnOL/11zQq4jYiuuFH/38wPUgt6hT/Fkw0dKlTSRPqZevnqkllpdFa2BTfkJVtdiYCUUeRi94BGnQBY9YTlhpNKyQC04RrV3S3zCwdXIrKWFQihdfbzZoY66MpyjCWOC3cOoUfyZoUNQ0TJX/PjPRrS8zYVSxZBlV3zFinHhiQ7jjriPdpoziFpdGGWcNRrYBIt1WcbvotCCYHK0uxDhkzvwVyHVOksWd0H6bQmxQapdBJCo1T6G0KvUuh9yk0SaG/UuhDCp2m0FkKTVNolkLnKfQxhS5SaJ5Clym0SKGrFLpOoU8p9DmFblJoGU+iW/I8bSyjDNTp8zzIKVIpqawMDIuGlrRdPDiYEun4jVeG4ZwlU2MM/zIVxHABU1AMy6WQSqG/U4ihV6aEGW8xVcvQ3oZxZQox3MDQC+P7kEJ3KXSfQgyTbhnS5/MLJMKSO0y78bls9EqX8KgvzT3jZ/50bo9L3fYraQq1XR3Ls1vu7FhpYxV7HoBVZLDxGJeMA7uycarrOmHXwnuzCipKagMooBV3C/9GDFy/YqpjxSR+bORYmilFVXFH2hPOtmJPDUcbO7LE1H7shURlxYYjtdj6E2PFv+5dCpfxcF4KXPQrAEBOWquNU0yhRkv92gTUKT4d+nxqRwdwrY+QwXONS8fkK01MOYO6qoW0XA4vLXEbl8YLyddbGa9axNpv2SqU8SoWG26Gu0NTCRtqLQKzjalik8mwtBSsHVTzCTtkWh5jy1Xs8fim8BQcsDOE8xvUkeSCZncQvL/b3pKpTg32NQhnVo+lGa+yMeWZoE1wPAmknwBJE/IRJRC6z1iDUt0pLps/A82GucoQYNIiN2kLJrnu2oVqhHJLLvg6WWA3CFQMC6BdQBPGeJOTSBDc/SNrqPz5voLZClGOBHkgeL9MswpolKOAUS+zq43QaoBVxxmedMBMBwlRgd21eaSmYgQXYIt3WSNDtkhywiEKqQWKSGjrTcZzl2tjmcVmaPcL4Lc5wEug7QJtEPjM7N5tuNA1OExPNAMpOEQ4oNU6aK82mmkzAzDwEhgYWy2vhC7VirldbTE1TME+Kpcs42yaZU4dLJJAjwbRIAroFDhoAhZq37zFhoF7/ba05pYa9g5kqVIOdL3vQLAnOUYJsar5q8gY5JQFBhnkmRsw4QZ47PklF3gFNvZMhzKCpKCzvOVR6wdPRyQYovYhk5XAwY+oNNDeMxQRdPSgSDm0MzZilm1LgIUnpD0TK8+TtL83GUbEqtXMKw0FNDL5PnOMXF+CDqfj8ZjANiYyo9o8k698Rn7I5vEpCJy3oqRaWEZzyrDCBHhpghLnFGgdnbYWmjkZ2psJKHCTy6gGdE2L38QP+IeQQRXg0mjQc1S5oPJOmGdDN8trXkaW4L52GBCiEVAiQDYvleTCcAIWsllrpiA+BuAX+bTOSodgzSHkaL7nmoF1HjMVMkanPdr7NmsKaAQm2VIAKvj85cZUbbwbw70fwVwasCguhb5W5S+03EH+CIxqsktFl+MTQqEaH4f2O+TXfvGBbHMulG2/Hn/98Q/b2xEO",$a=" ",ts=" ",es=" ",rs=" ",ns=" ",is=" ",os=" ",as=" ",ss="eJx9WFlv2zgQ/iuGnnYBt5DkS85bmk13g27SoEkPbNEHWqIlIhSpklSuov99R7JIkSLtFyGZjxzN8c0h/4oueF1jpqKz6Mt1K1GJZ4s4S+PZYrvdbqJ59J4zdYNqDAfuXuodp52spdSToZrQl6n0KyZl1Sm/xgVpa5BcKURJfs5KCgdj+F++J8+4uCUqr6IzJVo8jy4qJFCusLjD3d27BucE0cGYd+/4c3T2/U2SxfM36XYxT+JtDI8k/jGPPrMCC0oYvuWSKMJZdPYmiWMLuK9I/sCwlNHZCuRfsJD9sSiOk7dxnMFbbrgieefGBW9eROfA7I/8z1myzVbz7rnpn9vuCW/unpvZecF3eHb3IhWu5eyK5Vw0XCCFi7ezc0pnvRo5E1hi8QhCeM0lHCoIK+/yCvdR67zrfd2THPA7VfzzNTrbpv2fX+BPeH8fm2usBMnBg++/oq/forO08+QGNMgGgeG/5wfxYrE4iPFzTlFt5JtkkLeMPIL/EFoNreJBE2vrXReako3YcqvVEXCTKWJdzPS7Gizyjk/mZZvsAKC66d7FCgMtF4NC2eaVqpDyLW+QwIzi/TGoD6tvPQL7BJEPNVKVb39DW2mkJnY5FALyD9eEhU6DL4SPrqTaS0mRrHyDXrHgvpQz7AvVU+CkqgQOnN3zVgSkkFVfKslzQIgfMfPFOBxWRiyDjcs5p5wFIoFr4kImprQrP59WP1ubiVpcCgxlNLq5XC4PwM8Wy77EvSs5ZyU0EpuFaXqAzmlTjVlerzcH8TuskH/4oiLj0WQQ/oWpdXadJAfxZSOJ7exmPfD01lYSD8K/kU0288JLS7Mh+hW337dINCPA5MRX8QE1jXU8Wx/E/6J6V4zyLBtCdd36Km4Cso+QTOG4N6T5dvRusxxsu6/scK5Wgw2fKovZ20HxHSnrQDjv0WjEejvw7/MkxmMD6ZQkvnEfa1xayperg/ibZfN2kN1K4lvxHw4lZAfD6QErpy1lOt2QF4H3XATa8HDP7VnrVWY6SoNZQfKWokBRt90Ak7mt2GACwTVE8bNPE+Tw3VTIzkmQqRuLqsvtUGaFw3cTcjzJxSod3tjYSnQgS4fvpgyc8KaDZuLwXR8FtYlv8YPD9rHBuGxfbQYG1q1vL2v9+3zC9nF0EF+BqoLBFBbbjRfSYbsJprLYboxtpx1Fj23esXoMhqlx7rB9uR2OPxP/aCMDmX61/Vhm8cha7HA91bzbWUR1z0/m8tLUKSyJ1qWNHqeXrTUf16lb76Or6XIzTmWFA4mHyeLOkUS3+H23UpJQPAnbE0bUS2CSUi6IdWM13Mhpu/OlBUE1t/YbA1QYCeWLYVsrRh+SeDm0RCQEf9pxa3Xpds4RcpJhqNVDbXPkzqTpOJcK/mT1VO17gUtn57C3J3cpMlUucW77Px3hRwZ83VJFGvriJ6YRHJboLmnWPUNXWAC7FbQg+/0IrjUL4RMFBxhYkEdSBLxiXB0xD8TkEZorywPXoP0I/jxhXGzWKEoJUFgeiTvs3srq2eO9Hq2Aeq92S9eDIgeYwIeawKoVY+KyVOumuBmpY0r+CgrgQVn7ohl9n6aIoc4TJjB0lEDWvmaGa05ETrGfPRd3lm1jI64b9SKtBJlbhAFTgEhuqWoUvlhCFdwRBW613cNWqnGYyDAdj+OQfdnugpBWHUa14jAKbbN2tlDrfR6mXUT9p7F3peyGvHNBb0UCl933GHgmyN6Hc/0R6+KZxiG7Ba6ReJjg6RiAos0DpTRsHWNz1s284Mr58DI+UF52N8B7vyIGzP4+nGJcWLXiNMtiR0/0S0BPtExAj3ZNwE42zh11e6duTZS/YlZaK6DebfrkOsb4aURMnsqiA+viHpPowDrwsoX1y6moRTZ20cMXtmpOgFYf8sGd8kFrRw4ptuCQagu2lJvwmpXEUu2DNSlOoEf12vY4aXOZkG6WY8OC4hzrwHRcjVhWepjd4KdYKK7jrx5H89WjRxPWoycydlS3jZ/I2VS/G9yp9gB6PG1T1aY4YAp3LfPHPPqABbtFRHS/jf34/T82FAfb",us="eJxtmNtu20YQhl+F4FULyMGeD7pz3AY1ChtG7NpFA18w1NomIlECSRcxgrx7SVk7+wOdG8H5OJydf2Z2d5gf9cV+t0v9VK/r+6vXsXlOlbHe28paq229qj/t++m62aXZ4J/m8PRb1z9/baZxefK63Z6eXN5dVMvTCh83u277xr/6kLrnl2XNq7TpXnczuZyabdee98/b2VzM/x4/dd/T5qab2pd6PQ2vaVVfvDRD005puE3Lu7eH1HbN9hTjx4/77/X6y5lcnUmjVzHIVVDicVX/1W/SsO36dLMfu6nb9/X6TAoBD+5euvZbn8axXtuZ36dhPJrVQqgPQoh5hev91LWLkIv94W1Ygq9+aX+tZAx2tfz64284/sblN/rqfLP/mqrbt3FKu7G67Nv9cNgPzZQ2H6rz7bb6vLgZq89pTMO/M/xfEqturJpqSM/d7GJIm2oamk3aNcO3av80O5xh3yyKmm1193ZIT02bqovTKjP+MAf++7zsZvZ3276kYyWWXB0z99S18/PbafPHQ71W4fjn/fxnFO+ZvkrT0LVzTr78qB/+nk38bHM9exgP8zr1z9U7jt6840YW5uSJKcZOCaBBnKgm5mU8MVNYyMwWFvO7Ukagkmgg6sDWQ5yFFqjzUrLEaQ3BEmiwNsMSaZS0vgWfOkPHWQowNeTUc0kumnxZvsgPxlGai6VTGUqAVCTQ6QkWnc77DKEiLktSUBJKqHIQZ86d8gCpHYoiEzMsb1ubYy8vW50DChB5ZhGqrijD0EqUIeiaEHIfCg5Kpuu0ApiToaGPSY0uaQsyr65L2oKi1yFt1PLaQ3lzfXTgXodGoJYzglndSLDMPg1sTPJpQJHJigw0QrGERqD9YhyTOgONQDUyuF1zaxuokc/BW2ztXCMrGZ9WMW1oQZHIXWNBkSCfRZEL5BMUiZw6CzVSFCfUSGZFNjIldoKDkonTKQiJIGzWmFd3BizJJ9SINoLDriOfUCOZS+zg+KGD1qGiLNMLxtJD1/ns00ON6EzyUCM6vbxhoBKaqbG3DFQCNiL1iHccBPV0DHhQH/JW8EW90dkyFKGywCJU0WkVSvSGeiSUODWFFD0HYdPQVoiRgfPMA+/nnRgiAyNYSjpWNQcNSMrtFCUH4ZIRpSCWocFCSuhCEY6hoUClc0WC52BJlCYYLQdhN+hygRRRlo5BKRRLS6oihSqh+ZzzRGG1Mo4Iz1LoP0qsxDGFzk0JE42ji0jCPejomJKCuwil4m5CiRMEUMVSzVLDUstSx1Juc0oVWMpqY295qVltmtWmWW2a1aZZbZrVplltmtWmWW2G1WZYbYbVZlhthtVmWG2G1WZYbYbVZlhtltVmWW2W1WZZbZbVZlltltVmWW2W1QYjQCh7E2aAQHeGhCFgPoNoy8KNb2wxBhmGKBxoUZXlLGsLI6AsftEDHV0wIURVbANLcTKlGGBIKPOAxCmhePCKUwFzAmpDFRQvjA9R06Hq8TONvshgKDCuRAZTXigUxjxNFfKRo3CLhnIJBMFRvMZpqpNBMlQJzGT5WFQMVQI/AikPMIhEU1aDjqJvQwmjSHB05cC9jbYwc5UtAHNLhDw41ha+lEqF4JaH3gmB61SYcqInxTDmQK8v08vjqv4zDf1N0w3Lf4A8/vwPpfK11w==",cs={Courier:_a,"Courier-Bold":Ya,"Courier-Oblique":Qa,"Courier-BoldOblique":Ja,Helvetica:rs,"Helvetica-Bold":$a,"Helvetica-Oblique":es,"Helvetica-BoldOblique":ts,"Times-Roman":as,"Times-Bold":ns,"Times-Italic":os,"Times-BoldItalic":is,Symbol:ss,ZapfDingbats:us},ir;(function(r){r.Courier="Courier",r.CourierBold="Courier-Bold",r.CourierOblique="Courier-Oblique",r.CourierBoldOblique="Courier-BoldOblique",r.Helvetica="Helvetica",r.HelveticaBold="Helvetica-Bold",r.HelveticaOblique="Helvetica-Oblique",r.HelveticaBoldOblique="Helvetica-BoldOblique",r.TimesRoman="Times-Roman",r.TimesRomanBold="Times-Bold",r.TimesRomanItalic="Times-Italic",r.TimesRomanBoldItalic="Times-BoldItalic",r.Symbol="Symbol",r.ZapfDingbats="ZapfDingbats"})(ir||(ir={}));var pi={},fs=function(){function r(){var t=this;this.getWidthOfGlyph=function(e){return t.CharWidths[e]},this.getXAxisKerningForPair=function(e,n){return(t.KernPairXAmounts[e]||{})[n]}}return r.load=function(t){var e=pi[t];if(e)return e;var n=co(cs[t]),i=Object.assign(new r,JSON.parse(n));return i.CharWidths=i.CharMetrics.reduce(function(o,a){return o[a.N]=a.WX,o},{}),i.KernPairXAmounts=i.KernPairs.reduce(function(o,a){var s=a[0],c=a[1],u=a[2];return o[s]||(o[s]={}),o[s][c]=u,o},{}),pi[t]=i,i},r}(),ls=" ",hs=co(ls),Fn=JSON.parse(hs),Sn=function(){function r(t,e){var n=this;this.canEncodeUnicodeCodePoint=function(i){return i in n.unicodeMappings},this.encodeUnicodeCodePoint=function(i){var o=n.unicodeMappings[i];if(!o){var a=String.fromCharCode(i),s="0x"+Za(i.toString(16),4,"0"),c=n.name+' cannot encode "'+a+'" ('+s+")";throw new Error(c)}return{code:o[0],name:o[1]}},this.name=t,this.supportedCodePoints=Object.keys(e).map(Number).sort(function(i,o){return i-o}),this.unicodeMappings=e}return r}(),Cr={Symbol:new Sn("Symbol",Fn.symbol),ZapfDingbats:new Sn("ZapfDingbats",Fn.zapfdingbats),WinAnsi:new Sn("WinAnsi",Fn.win1252)},rn=function(r){return Object.keys(r).map(function(t){return r[t]})},ds=rn(ir),gi=function(r){return ds.includes(r)},Pr=function(r,t){return r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height},vt=function(r){return"`"+r+"`"},vs=function(r){return"'"+r+"'"},yi=function(r){var t=typeof r;return t==="string"?vs(r):t==="undefined"?vt(r):r},ps=function(r,t,e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var a=e[i];n[i]=yi(a)}var s=n.join(" or ");return vt(t)+" must be one of "+s+", but was actually "+yi(r)},ie=function(r,t,e){Array.isArray(e)||(e=rn(e));for(var n=0,i=e.length;n<i;n++)if(r===e[n])return;throw new TypeError(ps(r,t,e))},Et=function(r,t,e){Array.isArray(e)||(e=rn(e)),ie(r,t,e.concat(void 0))},gs=function(r,t,e){Array.isArray(e)||(e=rn(e));for(var n=0,i=r.length;n<i;n++)ie(r[n],t,e)},ys=function(r){return r===null?"null":r===void 0?"undefined":typeof r=="string"?"string":isNaN(r)?"NaN":typeof r=="number"?"number":typeof r=="boolean"?"boolean":typeof r=="symbol"?"symbol":typeof r=="bigint"?"bigint":r.constructor&&r.constructor.name?r.constructor.name:r.name?r.name:r.constructor?String(r.constructor):String(r)},ms=function(r,t){return t==="null"?r===null:t==="undefined"?r===void 0:t==="string"?typeof r=="string":t==="number"?typeof r=="number"&&!isNaN(r):t==="boolean"?typeof r=="boolean":t==="symbol"?typeof r=="symbol":t==="bigint"?typeof r=="bigint":t===Date?r instanceof Date:t===Array?r instanceof Array:t===Uint8Array?r instanceof Uint8Array:t===ArrayBuffer?r instanceof ArrayBuffer:t===Function?r instanceof Function:r instanceof t[0]},bs=function(r,t,e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var a=e[i];a==="null"&&(n[i]=vt("null")),a==="undefined"&&(n[i]=vt("undefined")),a==="string"?n[i]=vt("string"):a==="number"?n[i]=vt("number"):a==="boolean"?n[i]=vt("boolean"):a==="symbol"?n[i]=vt("symbol"):a==="bigint"?n[i]=vt("bigint"):a===Array?n[i]=vt("Array"):a===Uint8Array?n[i]=vt("Uint8Array"):a===ArrayBuffer?n[i]=vt("ArrayBuffer"):n[i]=vt(a[1])}var s=n.join(" or ");return vt(t)+" must be of type "+s+", but was actually of type "+vt(ys(r))},x=function(r,t,e){for(var n=0,i=e.length;n<i;n++)if(ms(r,e[n]))return;throw new TypeError(bs(r,t,e))},k=function(r,t,e){x(r,t,e.concat("undefined"))},fo=function(r,t,e){for(var n=0,i=r.length;n<i;n++)x(r[n],t,e)},Dt=function(r,t,e,n){if(x(r,t,["number"]),x(e,"min",["number"]),x(n,"max",["number"]),n=Math.max(e,n),r<e||r>n)throw new Error(vt(t)+" must be at least "+e+" and at most "+n+", but was actually "+r)},Wt=function(r,t,e,n){x(r,t,["number","undefined"]),typeof r=="number"&&Dt(r,t,e,n)},lo=function(r,t,e){if(x(r,t,["number"]),r%e!==0)throw new Error(vt(t)+" must be a multiple of "+e+", but was actually "+r)},xs=function(r,t){if(!Number.isInteger(r))throw new Error(vt(t)+" must be an integer, but was actually "+r)},nn=function(r,t){if(![1,0].includes(Math.sign(r)))throw new Error(vt(t)+" must be a positive number or 0, but was actually "+r)},L=new Uint16Array(256);for(var Tr=0;Tr<256;Tr++)L[Tr]=Tr;L[22]=K("");L[24]=K("˘");L[25]=K("ˇ");L[26]=K("ˆ");L[27]=K("˙");L[28]=K("˝");L[29]=K("˛");L[30]=K("˚");L[31]=K("˜");L[127]=K("�");L[128]=K("•");L[129]=K("†");L[130]=K("‡");L[131]=K("…");L[132]=K("—");L[133]=K("–");L[134]=K("ƒ");L[135]=K("⁄");L[136]=K("‹");L[137]=K("›");L[138]=K("−");L[139]=K("‰");L[140]=K("„");L[141]=K("“");L[142]=K("”");L[143]=K("‘");L[144]=K("’");L[145]=K("‚");L[146]=K("™");L[147]=K("ﬁ");L[148]=K("ﬂ");L[149]=K("Ł");L[150]=K("Œ");L[151]=K("Š");L[152]=K("Ÿ");L[153]=K("Ž");L[154]=K("ı");L[155]=K("ł");L[156]=K("œ");L[157]=K("š");L[158]=K("ž");L[159]=K("�");L[160]=K("€");L[173]=K("�");var ho=function(r){for(var t=new Array(r.length),e=0,n=r.length;e<n;e++)t[e]=L[r[e]];return String.fromCodePoint.apply(String,t)},Yt=function(){function r(t){this.populate=t,this.value=void 0}return r.prototype.getValue=function(){return this.value},r.prototype.access=function(){return this.value||(this.value=this.populate()),this.value},r.prototype.invalidate=function(){this.value=void 0},r.populatedBy=function(t){return new r(t)},r}(),Mt=function(r){A(t,r);function t(e,n){var i=this,o="Method "+e+"."+n+"() not implemented";return i=r.call(this,o)||this,i}return t}(Error),qn=function(r){A(t,r);function t(e){var n=this,i="Cannot construct "+e+" - it has a private constructor";return n=r.call(this,i)||this,n}return t}(Error),Wr=function(r){A(t,r);function t(e,n){var i=this,o=function(c){var u,f;return(u=c==null?void 0:c.name)!==null&&u!==void 0?u:(f=c==null?void 0:c.constructor)===null||f===void 0?void 0:f.name},a=Array.isArray(e)?e.map(o):[o(e)],s="Expected instance of "+a.join(" or ")+", "+("but got instance of "+(n&&o(n)));return i=r.call(this,s)||this,i}return t}(Error),Fs=function(r){A(t,r);function t(e){var n=this,i=e+" stream encoding not supported";return n=r.call(this,i)||this,n}return t}(Error),Kn=function(r){A(t,r);function t(e,n){var i=this,o="Cannot call "+e+"."+n+"() more than once";return i=r.call(this,o)||this,i}return t}(Error);(function(r){A(t,r);function t(e){var n=this,i="Missing catalog (ref="+e+")";return n=r.call(this,i)||this,n}return t})(Error);var Ss=function(r){A(t,r);function t(){var e=this,n="Can't embed page with missing Contents";return e=r.call(this,n)||this,e}return t}(Error),ws=function(r){A(t,r);function t(e){var n,i,o,a=this,s=(o=(i=(n=e==null?void 0:e.contructor)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:e==null?void 0:e.name)!==null&&o!==void 0?o:e,c="Unrecognized stream type: "+s;return a=r.call(this,c)||this,a}return t}(Error),Cs=function(r){A(t,r);function t(){var e=this,n="Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.";return e=r.call(this,n)||this,e}return t}(Error),Ps=function(r){A(t,r);function t(e){var n=this,i="Attempted to convert PDFArray with "+e+" elements to rectangle, but must have exactly 4 elements.";return n=r.call(this,i)||this,n}return t}(Error),vo=function(r){A(t,r);function t(e){var n=this,i='Attempted to convert "'+e+'" to a date, but it does not match the PDF date string format.';return n=r.call(this,i)||this,n}return t}(Error),mi=function(r){A(t,r);function t(e,n){var i=this,o="Invalid targetIndex specified: targetIndex="+e+" must be less than Count="+n;return i=r.call(this,o)||this,i}return t}(Error),bi=function(r){A(t,r);function t(e,n){var i=this,o="Failed to "+n+" at targetIndex="+e+" due to corrupt page tree: It is likely that one or more 'Count' entries are invalid";return i=r.call(this,o)||this,i}return t}(Error),qr=function(r){A(t,r);function t(e,n,i){var o=this,a="index should be at least "+n+" and at most "+i+", but was actually "+e;return o=r.call(this,a)||this,o}return t}(Error),Gn=function(r){A(t,r);function t(){var e=this,n="Attempted to set invalid field value";return e=r.call(this,n)||this,e}return t}(Error),Ts=function(r){A(t,r);function t(){var e=this,n="Attempted to select multiple values for single-select field";return e=r.call(this,n)||this,e}return t}(Error),Ds=function(r){A(t,r);function t(e){var n=this,i="No /DA (default appearance) entry found for field: "+e;return n=r.call(this,i)||this,n}return t}(Error),ks=function(r){A(t,r);function t(e){var n=this,i="No Tf operator found for DA of field: "+e;return n=r.call(this,i)||this,n}return t}(Error),xi=function(r){A(t,r);function t(e,n){var i=this,o="Failed to parse number "+("(line:"+e.line+" col:"+e.column+" offset="+e.offset+'): "'+n+'"');return i=r.call(this,o)||this,i}return t}(Error),fe=function(r){A(t,r);function t(e,n){var i=this,o="Failed to parse PDF document "+("(line:"+e.line+" col:"+e.column+" offset="+e.offset+"): "+n);return i=r.call(this,o)||this,i}return t}(Error),As=function(r){A(t,r);function t(e,n,i){var o=this,a="Expected next byte to be "+n+" but it was actually "+i;return o=r.call(this,e,a)||this,o}return t}(fe),Os=function(r){A(t,r);function t(e,n){var i=this,o="Failed to parse PDF object starting with the following byte: "+n;return i=r.call(this,e,o)||this,i}return t}(fe),Rs=function(r){A(t,r);function t(e){var n=this,i="Failed to parse invalid PDF object";return n=r.call(this,e,i)||this,n}return t}(fe),Bs=function(r){A(t,r);function t(e){var n=this,i="Failed to parse PDF stream";return n=r.call(this,e,i)||this,n}return t}(fe),Es=function(r){A(t,r);function t(e){var n=this,i="Failed to parse PDF literal string due to unbalanced parenthesis";return n=r.call(this,e,i)||this,n}return t}(fe),js=function(r){A(t,r);function t(e){var n=this,i="Parser stalled";return n=r.call(this,e,i)||this,n}return t}(fe),Ns=function(r){A(t,r);function t(e){var n=this,i="No PDF header found";return n=r.call(this,e,i)||this,n}return t}(fe),Ms=function(r){A(t,r);function t(e,n){var i=this,o="Did not find expected keyword '"+Ji(n)+"'";return i=r.call(this,e,o)||this,i}return t}(fe),p;(function(r){r[r.Null=0]="Null",r[r.Backspace=8]="Backspace",r[r.Tab=9]="Tab",r[r.Newline=10]="Newline",r[r.FormFeed=12]="FormFeed",r[r.CarriageReturn=13]="CarriageReturn",r[r.Space=32]="Space",r[r.ExclamationPoint=33]="ExclamationPoint",r[r.Hash=35]="Hash",r[r.Percent=37]="Percent",r[r.LeftParen=40]="LeftParen",r[r.RightParen=41]="RightParen",r[r.Plus=43]="Plus",r[r.Minus=45]="Minus",r[r.Dash=45]="Dash",r[r.Period=46]="Period",r[r.ForwardSlash=47]="ForwardSlash",r[r.Zero=48]="Zero",r[r.One=49]="One",r[r.Two=50]="Two",r[r.Three=51]="Three",r[r.Four=52]="Four",r[r.Five=53]="Five",r[r.Six=54]="Six",r[r.Seven=55]="Seven",r[r.Eight=56]="Eight",r[r.Nine=57]="Nine",r[r.LessThan=60]="LessThan",r[r.GreaterThan=62]="GreaterThan",r[r.A=65]="A",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.O=79]="O",r[r.P=80]="P",r[r.R=82]="R",r[r.LeftSquareBracket=91]="LeftSquareBracket",r[r.BackSlash=92]="BackSlash",r[r.RightSquareBracket=93]="RightSquareBracket",r[r.a=97]="a",r[r.b=98]="b",r[r.d=100]="d",r[r.e=101]="e",r[r.f=102]="f",r[r.i=105]="i",r[r.j=106]="j",r[r.l=108]="l",r[r.m=109]="m",r[r.n=110]="n",r[r.o=111]="o",r[r.r=114]="r",r[r.s=115]="s",r[r.t=116]="t",r[r.u=117]="u",r[r.x=120]="x",r[r.LeftCurly=123]="LeftCurly",r[r.RightCurly=125]="RightCurly",r[r.Tilde=126]="Tilde"})(p||(p={}));var on=function(){function r(t,e){this.major=String(t),this.minor=String(e)}return r.prototype.toString=function(){var t=Zt(129);return"%PDF-"+this.major+"."+this.minor+`
%`+t+t+t+t},r.prototype.sizeInBytes=function(){return 12+this.major.length+this.minor.length},r.prototype.copyBytesInto=function(t,e){var n=e;return t[e++]=p.Percent,t[e++]=p.P,t[e++]=p.D,t[e++]=p.F,t[e++]=p.Dash,e+=bt(this.major,t,e),t[e++]=p.Period,e+=bt(this.minor,t,e),t[e++]=p.Newline,t[e++]=p.Percent,t[e++]=129,t[e++]=129,t[e++]=129,t[e++]=129,e-n},r.forVersion=function(t,e){return new r(t,e)},r}(),St=function(){function r(){}return r.prototype.clone=function(t){throw new Mt(this.constructor.name,"clone")},r.prototype.toString=function(){throw new Mt(this.constructor.name,"toString")},r.prototype.sizeInBytes=function(){throw new Mt(this.constructor.name,"sizeInBytes")},r.prototype.copyBytesInto=function(t,e){throw new Mt(this.constructor.name,"copyBytesInto")},r}(),W=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.numberValue=e,n.stringValue=ka(e),n}return t.prototype.asNumber=function(){return this.numberValue},t.prototype.value=function(){return this.numberValue},t.prototype.clone=function(){return t.of(this.numberValue)},t.prototype.toString=function(){return this.stringValue},t.prototype.sizeInBytes=function(){return this.stringValue.length},t.prototype.copyBytesInto=function(e,n){return n+=bt(this.stringValue,e,n),this.stringValue.length},t.of=function(e){return new t(e)},t}(St),nt=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.array=[],n.context=e,n}return t.prototype.size=function(){return this.array.length},t.prototype.push=function(e){this.array.push(e)},t.prototype.insert=function(e,n){this.array.splice(e,0,n)},t.prototype.indexOf=function(e){var n=this.array.indexOf(e);return n===-1?void 0:n},t.prototype.remove=function(e){this.array.splice(e,1)},t.prototype.set=function(e,n){this.array[e]=n},t.prototype.get=function(e){return this.array[e]},t.prototype.lookupMaybe=function(e){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return(n=this.context).lookupMaybe.apply(n,rt([this.get(e)],i))},t.prototype.lookup=function(e){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return(n=this.context).lookup.apply(n,rt([this.get(e)],i))},t.prototype.asRectangle=function(){if(this.size()!==4)throw new Ps(this.size());var e=this.lookup(0,W).asNumber(),n=this.lookup(1,W).asNumber(),i=this.lookup(2,W).asNumber(),o=this.lookup(3,W).asNumber(),a=e,s=n,c=i-e,u=o-n;return{x:a,y:s,width:c,height:u}},t.prototype.asArray=function(){return this.array.slice()},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),i=0,o=this.size();i<o;i++)n.push(this.array[i]);return n},t.prototype.toString=function(){for(var e="[ ",n=0,i=this.size();n<i;n++)e+=this.get(n).toString(),e+=" ";return e+="]",e},t.prototype.sizeInBytes=function(){for(var e=3,n=0,i=this.size();n<i;n++)e+=this.get(n).sizeInBytes()+1;return e},t.prototype.copyBytesInto=function(e,n){var i=n;e[n++]=p.LeftSquareBracket,e[n++]=p.Space;for(var o=0,a=this.size();o<a;o++)n+=this.get(o).copyBytesInto(e,n),e[n++]=p.Space;return e[n++]=p.RightSquareBracket,n-i},t.prototype.scalePDFNumbers=function(e,n){for(var i=0,o=this.size();i<o;i++){var a=this.lookup(i);if(a instanceof W){var s=i%2===0?e:n;this.set(i,W.of(a.asNumber()*s))}}},t.withContext=function(e){return new t(e)},t}(St),wn={},or=function(r){A(t,r);function t(e,n){var i=this;if(e!==wn)throw new qn("PDFBool");return i=r.call(this)||this,i.value=n,i}return t.prototype.asBoolean=function(){return this.value},t.prototype.clone=function(){return this},t.prototype.toString=function(){return String(this.value)},t.prototype.sizeInBytes=function(){return this.value?4:5},t.prototype.copyBytesInto=function(e,n){return this.value?(e[n++]=p.t,e[n++]=p.r,e[n++]=p.u,e[n++]=p.e,4):(e[n++]=p.f,e[n++]=p.a,e[n++]=p.l,e[n++]=p.s,e[n++]=p.e,5)},t.True=new t(wn,!0),t.False=new t(wn,!1),t}(St),zt=new Uint8Array(256);zt[p.LeftParen]=1;zt[p.RightParen]=1;zt[p.LessThan]=1;zt[p.GreaterThan]=1;zt[p.LeftSquareBracket]=1;zt[p.RightSquareBracket]=1;zt[p.LeftCurly]=1;zt[p.RightCurly]=1;zt[p.ForwardSlash]=1;zt[p.Percent]=1;var _t=new Uint8Array(256);_t[p.Null]=1;_t[p.Tab]=1;_t[p.Newline]=1;_t[p.FormFeed]=1;_t[p.CarriageReturn]=1;_t[p.Space]=1;var Ln=new Uint8Array(256);for(var Ue=0,Is=256;Ue<Is;Ue++)Ln[Ue]=_t[Ue]||zt[Ue]?1:0;Ln[p.Hash]=1;var Us=function(r){return r.replace(/#([\dABCDEF]{2})/g,function(t,e){return ua(e)})},Vs=function(r){return r>=p.ExclamationPoint&&r<=p.Tilde&&!Ln[r]},Fi={},Si=new Map,v=function(r){A(t,r);function t(e,n){var i=this;if(e!==Fi)throw new qn("PDFName");i=r.call(this)||this;for(var o="/",a=0,s=n.length;a<s;a++){var c=n[a],u=K(c);o+=Vs(u)?c:"#"+$r(u)}return i.encodedName=o,i}return t.prototype.asBytes=function(){for(var e=[],n="",i=!1,o=function(l){l!==void 0&&e.push(l),i=!1},a=1,s=this.encodedName.length;a<s;a++){var c=this.encodedName[a],u=K(c),f=this.encodedName[a+1];i?u>=p.Zero&&u<=p.Nine||u>=p.a&&u<=p.f||u>=p.A&&u<=p.F?(n+=c,(n.length===2||!(f>="0"&&f<="9"||f>="a"&&f<="f"||f>="A"&&f<="F"))&&(o(parseInt(n,16)),n="")):o(u):u===p.Hash?i=!0:o(u)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return String.fromCharCode.apply(String,Array.from(e))},t.prototype.asString=function(){return this.encodedName},t.prototype.value=function(){return this.encodedName},t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.encodedName},t.prototype.sizeInBytes=function(){return this.encodedName.length},t.prototype.copyBytesInto=function(e,n){return n+=bt(this.encodedName,e,n),this.encodedName.length},t.of=function(e){var n=Us(e),i=Si.get(n);return i||(i=new t(Fi,n),Si.set(n,i)),i},t.Length=t.of("Length"),t.FlateDecode=t.of("FlateDecode"),t.Resources=t.of("Resources"),t.Font=t.of("Font"),t.XObject=t.of("XObject"),t.ExtGState=t.of("ExtGState"),t.Contents=t.of("Contents"),t.Type=t.of("Type"),t.Parent=t.of("Parent"),t.MediaBox=t.of("MediaBox"),t.Page=t.of("Page"),t.Annots=t.of("Annots"),t.TrimBox=t.of("TrimBox"),t.ArtBox=t.of("ArtBox"),t.BleedBox=t.of("BleedBox"),t.CropBox=t.of("CropBox"),t.Rotate=t.of("Rotate"),t.Title=t.of("Title"),t.Author=t.of("Author"),t.Subject=t.of("Subject"),t.Creator=t.of("Creator"),t.Keywords=t.of("Keywords"),t.Producer=t.of("Producer"),t.CreationDate=t.of("CreationDate"),t.ModDate=t.of("ModDate"),t}(St),zs=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.asNull=function(){return null},t.prototype.clone=function(){return this},t.prototype.toString=function(){return"null"},t.prototype.sizeInBytes=function(){return 4},t.prototype.copyBytesInto=function(e,n){return e[n++]=p.n,e[n++]=p.u,e[n++]=p.l,e[n++]=p.l,4},t}(St),Tt=new zs,H=function(r){A(t,r);function t(e,n){var i=r.call(this)||this;return i.dict=e,i.context=n,i}return t.prototype.keys=function(){return Array.from(this.dict.keys())},t.prototype.values=function(){return Array.from(this.dict.values())},t.prototype.entries=function(){return Array.from(this.dict.entries())},t.prototype.set=function(e,n){this.dict.set(e,n)},t.prototype.get=function(e,n){n===void 0&&(n=!1);var i=this.dict.get(e);if(!(i===Tt&&!n))return i},t.prototype.has=function(e){var n=this.dict.get(e);return n!==void 0&&n!==Tt},t.prototype.lookupMaybe=function(e){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=i.includes(Tt),s=(n=this.context).lookupMaybe.apply(n,rt([this.get(e,a)],i));if(!(s===Tt&&!a))return s},t.prototype.lookup=function(e){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=i.includes(Tt),s=(n=this.context).lookup.apply(n,rt([this.get(e,a)],i));if(!(s===Tt&&!a))return s},t.prototype.delete=function(e){return this.dict.delete(e)},t.prototype.asMap=function(){return new Map(this.dict)},t.prototype.uniqueKey=function(e){e===void 0&&(e="");for(var n=this.keys(),i=v.of(this.context.addRandomSuffix(e,10));n.includes(i);)i=v.of(this.context.addRandomSuffix(e,10));return i},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),i=this.entries(),o=0,a=i.length;o<a;o++){var s=i[o],c=s[0],u=s[1];n.set(c,u)}return n},t.prototype.toString=function(){for(var e=`<<
`,n=this.entries(),i=0,o=n.length;i<o;i++){var a=n[i],s=a[0],c=a[1];e+=s.toString()+" "+c.toString()+`
`}return e+=">>",e},t.prototype.sizeInBytes=function(){for(var e=5,n=this.entries(),i=0,o=n.length;i<o;i++){var a=n[i],s=a[0],c=a[1];e+=s.sizeInBytes()+c.sizeInBytes()+2}return e},t.prototype.copyBytesInto=function(e,n){var i=n;e[n++]=p.LessThan,e[n++]=p.LessThan,e[n++]=p.Newline;for(var o=this.entries(),a=0,s=o.length;a<s;a++){var c=o[a],u=c[0],f=c[1];n+=u.copyBytesInto(e,n),e[n++]=p.Space,n+=f.copyBytesInto(e,n),e[n++]=p.Newline}return e[n++]=p.GreaterThan,e[n++]=p.GreaterThan,n-i},t.withContext=function(e){return new t(new Map,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(St),At=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.dict=e,n}return t.prototype.clone=function(e){throw new Mt(this.constructor.name,"clone")},t.prototype.getContentsString=function(){throw new Mt(this.constructor.name,"getContentsString")},t.prototype.getContents=function(){throw new Mt(this.constructor.name,"getContents")},t.prototype.getContentsSize=function(){throw new Mt(this.constructor.name,"getContentsSize")},t.prototype.updateDict=function(){var e=this.getContentsSize();this.dict.set(v.Length,W.of(e))},t.prototype.sizeInBytes=function(){return this.updateDict(),this.dict.sizeInBytes()+this.getContentsSize()+18},t.prototype.toString=function(){this.updateDict();var e=this.dict.toString();return e+=`
stream
`,e+=this.getContentsString(),e+=`
endstream`,e},t.prototype.copyBytesInto=function(e,n){this.updateDict();var i=n;n+=this.dict.copyBytesInto(e,n),e[n++]=p.Newline,e[n++]=p.s,e[n++]=p.t,e[n++]=p.r,e[n++]=p.e,e[n++]=p.a,e[n++]=p.m,e[n++]=p.Newline;for(var o=this.getContents(),a=0,s=o.length;a<s;a++)e[n++]=o[a];return e[n++]=p.Newline,e[n++]=p.e,e[n++]=p.n,e[n++]=p.d,e[n++]=p.s,e[n++]=p.t,e[n++]=p.r,e[n++]=p.e,e[n++]=p.a,e[n++]=p.m,n-i},t}(St),ar=function(r){A(t,r);function t(e,n){var i=r.call(this,e)||this;return i.contents=n,i}return t.prototype.asUint8Array=function(){return this.contents.slice()},t.prototype.clone=function(e){return t.of(this.dict.clone(e),this.contents.slice())},t.prototype.getContentsString=function(){return Ji(this.contents)},t.prototype.getContents=function(){return this.contents},t.prototype.getContentsSize=function(){return this.contents.length},t.of=function(e,n){return new t(e,n)},t}(At),wi={},Ci=new Map,st=function(r){A(t,r);function t(e,n,i){var o=this;if(e!==wi)throw new qn("PDFRef");return o=r.call(this)||this,o.objectNumber=n,o.generationNumber=i,o.tag=n+" "+i+" R",o}return t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.tag},t.prototype.sizeInBytes=function(){return this.tag.length},t.prototype.copyBytesInto=function(e,n){return n+=bt(this.tag,e,n),this.tag.length},t.of=function(e,n){n===void 0&&(n=0);var i=e+" "+n+" R",o=Ci.get(i);return o||(o=new t(wi,e,n),Ci.set(i,o)),o},t}(St),et=function(){function r(t,e){this.name=t,this.args=e||[]}return r.prototype.clone=function(t){for(var e=new Array(this.args.length),n=0,i=e.length;n<i;n++){var o=this.args[n];e[n]=o instanceof St?o.clone(t):o}return r.of(this.name,e)},r.prototype.toString=function(){for(var t="",e=0,n=this.args.length;e<n;e++)t+=String(this.args[e])+" ";return t+=this.name,t},r.prototype.sizeInBytes=function(){for(var t=0,e=0,n=this.args.length;e<n;e++){var i=this.args[e];t+=(i instanceof St?i.sizeInBytes():i.length)+1}return t+=this.name.length,t},r.prototype.copyBytesInto=function(t,e){for(var n=e,i=0,o=this.args.length;i<o;i++){var a=this.args[i];a instanceof St?e+=a.copyBytesInto(t,e):e+=bt(a,t,e),t[e++]=p.Space}return e+=bt(this.name,t,e),e-n},r.of=function(t,e){return new r(t,e)},r}(),_;(function(r){r.NonStrokingColor="sc",r.NonStrokingColorN="scn",r.NonStrokingColorRgb="rg",r.NonStrokingColorGray="g",r.NonStrokingColorCmyk="k",r.NonStrokingColorspace="cs",r.StrokingColor="SC",r.StrokingColorN="SCN",r.StrokingColorRgb="RG",r.StrokingColorGray="G",r.StrokingColorCmyk="K",r.StrokingColorspace="CS",r.BeginMarkedContentSequence="BDC",r.BeginMarkedContent="BMC",r.EndMarkedContent="EMC",r.MarkedContentPointWithProps="DP",r.MarkedContentPoint="MP",r.DrawObject="Do",r.ConcatTransformationMatrix="cm",r.PopGraphicsState="Q",r.PushGraphicsState="q",r.SetFlatness="i",r.SetGraphicsStateParams="gs",r.SetLineCapStyle="J",r.SetLineDashPattern="d",r.SetLineJoinStyle="j",r.SetLineMiterLimit="M",r.SetLineWidth="w",r.SetTextMatrix="Tm",r.SetRenderingIntent="ri",r.AppendRectangle="re",r.BeginInlineImage="BI",r.BeginInlineImageData="ID",r.EndInlineImage="EI",r.ClipEvenOdd="W*",r.ClipNonZero="W",r.CloseAndStroke="s",r.CloseFillEvenOddAndStroke="b*",r.CloseFillNonZeroAndStroke="b",r.ClosePath="h",r.AppendBezierCurve="c",r.CurveToReplicateFinalPoint="y",r.CurveToReplicateInitialPoint="v",r.EndPath="n",r.FillEvenOddAndStroke="B*",r.FillEvenOdd="f*",r.FillNonZeroAndStroke="B",r.FillNonZero="f",r.LegacyFillNonZero="F",r.LineTo="l",r.MoveTo="m",r.ShadingFill="sh",r.StrokePath="S",r.BeginText="BT",r.EndText="ET",r.MoveText="Td",r.MoveTextSetLeading="TD",r.NextLine="T*",r.SetCharacterSpacing="Tc",r.SetFontAndSize="Tf",r.SetTextHorizontalScaling="Tz",r.SetTextLineHeight="TL",r.SetTextRenderingMode="Tr",r.SetTextRise="Ts",r.SetWordSpacing="Tw",r.ShowText="Tj",r.ShowTextAdjusted="TJ",r.ShowTextLine="'",r.ShowTextLineAndSpace='"',r.Type3D0="d0",r.Type3D1="d1",r.BeginCompatibilitySection="BX",r.EndCompatibilitySection="EX"})(_||(_={}));var Xn=function(r){A(t,r);function t(e,n){var i=r.call(this,e)||this;return i.computeContents=function(){var o=i.getUnencodedContents();return i.encode?en.deflate(o):o},i.encode=n,n&&e.set(v.of("Filter"),v.of("FlateDecode")),i.contentsCache=Yt.populatedBy(i.computeContents),i}return t.prototype.getContents=function(){return this.contentsCache.access()},t.prototype.getContentsSize=function(){return this.contentsCache.access().length},t.prototype.getUnencodedContents=function(){throw new Mt(this.constructor.name,"getUnencodedContents")},t}(At),_e=function(r){A(t,r);function t(e,n,i){i===void 0&&(i=!0);var o=r.call(this,e,i)||this;return o.operators=n,o}return t.prototype.push=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];(e=this.operators).push.apply(e,n)},t.prototype.clone=function(e){for(var n=new Array(this.operators.length),i=0,o=this.operators.length;i<o;i++)n[i]=this.operators[i].clone(e);var a=this,s=a.dict,c=a.encode;return t.of(s.clone(e),n,c)},t.prototype.getContentsString=function(){for(var e="",n=0,i=this.operators.length;n<i;n++)e+=this.operators[n]+`
`;return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),n=0,i=0,o=this.operators.length;i<o;i++)n+=this.operators[i].copyBytesInto(e,n),e[n++]=p.Newline;return e},t.prototype.getUnencodedContentsSize=function(){for(var e=0,n=0,i=this.operators.length;n<i;n++)e+=this.operators[n].sizeInBytes()+1;return e},t.of=function(e,n,i){return i===void 0&&(i=!0),new t(e,n,i)},t}(Xn),Ws=function(){function r(t){this.seed=t}return r.prototype.nextInt=function(){var t=Math.sin(this.seed++)*1e4;return t-Math.floor(t)},r.withSeed=function(t){return new r(t)},r}(),qs=function(r,t){var e=r[0],n=t[0];return e.objectNumber-n.objectNumber},Rn=function(){function r(){this.largestObjectNumber=0,this.header=on.forVersion(1,7),this.trailerInfo={},this.indirectObjects=new Map,this.rng=Ws.withSeed(1)}return r.prototype.assign=function(t,e){this.indirectObjects.set(t,e),t.objectNumber>this.largestObjectNumber&&(this.largestObjectNumber=t.objectNumber)},r.prototype.nextRef=function(){return this.largestObjectNumber+=1,st.of(this.largestObjectNumber)},r.prototype.register=function(t){var e=this.nextRef();return this.assign(e,t),e},r.prototype.delete=function(t){return this.indirectObjects.delete(t)},r.prototype.lookupMaybe=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=e.includes(Tt),o=t instanceof st?this.indirectObjects.get(t):t;if(!(!o||o===Tt&&!i)){for(var a=0,s=e.length;a<s;a++){var c=e[a];if(c===Tt){if(o===Tt)return o}else if(o instanceof c)return o}throw new Wr(e,o)}},r.prototype.lookup=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t instanceof st?this.indirectObjects.get(t):t;if(e.length===0)return i;for(var o=0,a=e.length;o<a;o++){var s=e[o];if(s===Tt){if(i===Tt)return i}else if(i instanceof s)return i}throw new Wr(e,i)},r.prototype.getObjectRef=function(t){for(var e=Array.from(this.indirectObjects.entries()),n=0,i=e.length;n<i;n++){var o=e[n],a=o[0],s=o[1];if(s===t)return a}},r.prototype.enumerateIndirectObjects=function(){return Array.from(this.indirectObjects.entries()).sort(qs)},r.prototype.obj=function(t){if(t instanceof St)return t;if(t==null)return Tt;if(typeof t=="string")return v.of(t);if(typeof t=="number")return W.of(t);if(typeof t=="boolean")return t?or.True:or.False;if(Array.isArray(t)){for(var e=nt.withContext(this),n=0,i=t.length;n<i;n++)e.push(this.obj(t[n]));return e}else{for(var o=H.withContext(this),a=Object.keys(t),n=0,i=a.length;n<i;n++){var s=a[n],c=t[s];c!==void 0&&o.set(v.of(s),this.obj(c))}return o}},r.prototype.stream=function(t,e){return e===void 0&&(e={}),ar.of(this.obj(e),Dn(t))},r.prototype.flateStream=function(t,e){return e===void 0&&(e={}),this.stream(en.deflate(Dn(t)),G(G({},e),{Filter:"FlateDecode"}))},r.prototype.contentStream=function(t,e){return e===void 0&&(e={}),_e.of(this.obj(e),t)},r.prototype.formXObject=function(t,e){return e===void 0&&(e={}),this.contentStream(t,G(G({BBox:this.obj([0,0,0,0]),Matrix:this.obj([1,0,0,1,0,0])},e),{Type:"XObject",Subtype:"Form"}))},r.prototype.getPushGraphicsStateContentStream=function(){if(this.pushGraphicsStateContentStreamRef)return this.pushGraphicsStateContentStreamRef;var t=this.obj({}),e=et.of(_.PushGraphicsState),n=_e.of(t,[e]);return this.pushGraphicsStateContentStreamRef=this.register(n),this.pushGraphicsStateContentStreamRef},r.prototype.getPopGraphicsStateContentStream=function(){if(this.popGraphicsStateContentStreamRef)return this.popGraphicsStateContentStreamRef;var t=this.obj({}),e=et.of(_.PopGraphicsState),n=_e.of(t,[e]);return this.popGraphicsStateContentStreamRef=this.register(n),this.popGraphicsStateContentStreamRef},r.prototype.addRandomSuffix=function(t,e){return e===void 0&&(e=4),t+"-"+Math.floor(this.rng.nextInt()*Math.pow(10,e))},r.create=function(){return new r},r}(),Jt=function(r){A(t,r);function t(e,n,i){i===void 0&&(i=!0);var o=r.call(this,e,n)||this;return o.normalized=!1,o.autoNormalizeCTM=i,o}return t.prototype.clone=function(e){for(var n=t.fromMapWithContext(new Map,e||this.context,this.autoNormalizeCTM),i=this.entries(),o=0,a=i.length;o<a;o++){var s=i[o],c=s[0],u=s[1];n.set(c,u)}return n},t.prototype.Parent=function(){return this.lookupMaybe(v.Parent,H)},t.prototype.Contents=function(){return this.lookup(v.of("Contents"))},t.prototype.Annots=function(){return this.lookupMaybe(v.Annots,nt)},t.prototype.BleedBox=function(){return this.lookupMaybe(v.BleedBox,nt)},t.prototype.TrimBox=function(){return this.lookupMaybe(v.TrimBox,nt)},t.prototype.ArtBox=function(){return this.lookupMaybe(v.ArtBox,nt)},t.prototype.Resources=function(){var e=this.getInheritableAttribute(v.Resources);return this.context.lookupMaybe(e,H)},t.prototype.MediaBox=function(){var e=this.getInheritableAttribute(v.MediaBox);return this.context.lookup(e,nt)},t.prototype.CropBox=function(){var e=this.getInheritableAttribute(v.CropBox);return this.context.lookupMaybe(e,nt)},t.prototype.Rotate=function(){var e=this.getInheritableAttribute(v.Rotate);return this.context.lookupMaybe(e,W)},t.prototype.getInheritableAttribute=function(e){var n;return this.ascend(function(i){n||(n=i.get(e))}),n},t.prototype.setParent=function(e){this.set(v.Parent,e)},t.prototype.addContentStream=function(e){var n=this.normalizedEntries().Contents||this.context.obj([]);this.set(v.Contents,n),n.push(e)},t.prototype.wrapContentStreams=function(e,n){var i=this.Contents();return i instanceof nt?(i.insert(0,e),i.push(n),!0):!1},t.prototype.addAnnot=function(e){var n=this.normalizedEntries().Annots;n.push(e)},t.prototype.removeAnnot=function(e){var n=this.normalizedEntries().Annots,i=n.indexOf(e);i!==void 0&&n.remove(i)},t.prototype.setFontDictionary=function(e,n){var i=this.normalizedEntries().Font;i.set(e,n)},t.prototype.newFontDictionaryKey=function(e){var n=this.normalizedEntries().Font;return n.uniqueKey(e)},t.prototype.newFontDictionary=function(e,n){var i=this.newFontDictionaryKey(e);return this.setFontDictionary(i,n),i},t.prototype.setXObject=function(e,n){var i=this.normalizedEntries().XObject;i.set(e,n)},t.prototype.newXObjectKey=function(e){var n=this.normalizedEntries().XObject;return n.uniqueKey(e)},t.prototype.newXObject=function(e,n){var i=this.newXObjectKey(e);return this.setXObject(i,n),i},t.prototype.setExtGState=function(e,n){var i=this.normalizedEntries().ExtGState;i.set(e,n)},t.prototype.newExtGStateKey=function(e){var n=this.normalizedEntries().ExtGState;return n.uniqueKey(e)},t.prototype.newExtGState=function(e,n){var i=this.newExtGStateKey(e);return this.setExtGState(i,n),i},t.prototype.ascend=function(e){e(this);var n=this.Parent();n&&n.ascend(e)},t.prototype.normalize=function(){if(!this.normalized){var e=this.context,n=this.get(v.Contents),i=this.context.lookup(n);i instanceof At&&this.set(v.Contents,e.obj([n])),this.autoNormalizeCTM&&this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(),this.context.getPopGraphicsStateContentStream());var o=this.getInheritableAttribute(v.Resources),a=e.lookupMaybe(o,H)||e.obj({});this.set(v.Resources,a);var s=a.lookupMaybe(v.Font,H)||e.obj({});a.set(v.Font,s);var c=a.lookupMaybe(v.XObject,H)||e.obj({});a.set(v.XObject,c);var u=a.lookupMaybe(v.ExtGState,H)||e.obj({});a.set(v.ExtGState,u);var f=this.Annots()||e.obj([]);this.set(v.Annots,f),this.normalized=!0}},t.prototype.normalizedEntries=function(){this.normalize();var e=this.Annots(),n=this.Resources(),i=this.Contents();return{Annots:e,Resources:n,Contents:i,Font:n.lookup(v.Font,H),XObject:n.lookup(v.XObject,H),ExtGState:n.lookup(v.ExtGState,H)}},t.InheritableEntries=["Resources","MediaBox","CropBox","Rotate"],t.withContextAndParent=function(e,n){var i=new Map;return i.set(v.Type,v.Page),i.set(v.Parent,n),i.set(v.Resources,e.obj({})),i.set(v.MediaBox,e.obj([0,0,612,792])),new t(i,e,!1)},t.fromMapWithContext=function(e,n,i){return i===void 0&&(i=!0),new t(e,n,i)},t}(H),Pi=function(){function r(t,e){var n=this;this.traversedObjects=new Map,this.copy=function(i){return i instanceof Jt?n.copyPDFPage(i):i instanceof H?n.copyPDFDict(i):i instanceof nt?n.copyPDFArray(i):i instanceof At?n.copyPDFStream(i):i instanceof st?n.copyPDFIndirectObject(i):i.clone()},this.copyPDFPage=function(i){for(var o=i.clone(),a=Jt.InheritableEntries,s=0,c=a.length;s<c;s++){var u=v.of(a[s]),f=o.getInheritableAttribute(u);!o.get(u)&&f&&o.set(u,f)}return o.delete(v.of("Parent")),n.copyPDFDict(o)},this.copyPDFDict=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var o=i.clone(n.dest);n.traversedObjects.set(i,o);for(var a=i.entries(),s=0,c=a.length;s<c;s++){var u=a[s],f=u[0],l=u[1];o.set(f,n.copy(l))}return o},this.copyPDFArray=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var o=i.clone(n.dest);n.traversedObjects.set(i,o);for(var a=0,s=i.size();a<s;a++){var c=i.get(a);o.set(a,n.copy(c))}return o},this.copyPDFStream=function(i){if(n.traversedObjects.has(i))return n.traversedObjects.get(i);var o=i.clone(n.dest);n.traversedObjects.set(i,o);for(var a=i.dict.entries(),s=0,c=a.length;s<c;s++){var u=a[s],f=u[0],l=u[1];o.dict.set(f,n.copy(l))}return o},this.copyPDFIndirectObject=function(i){var o=n.traversedObjects.has(i);if(!o){var a=n.dest.nextRef();n.traversedObjects.set(i,a);var s=n.src.lookup(i);if(s){var c=n.copy(s);n.dest.assign(a,c)}}return n.traversedObjects.get(i)},this.src=t,this.dest=e}return r.for=function(t,e){return new r(t,e)},r}(),po=function(){function r(t){this.subsections=t?[[t]]:[],this.chunkIdx=0,this.chunkLength=t?1:0}return r.prototype.addEntry=function(t,e){this.append({ref:t,offset:e,deleted:!1})},r.prototype.addDeletedEntry=function(t,e){this.append({ref:t,offset:e,deleted:!0})},r.prototype.toString=function(){for(var t=`xref
`,e=0,n=this.subsections.length;e<n;e++){var i=this.subsections[e];t+=i[0].ref.objectNumber+" "+i.length+`
`;for(var o=0,a=i.length;o<a;o++){var s=i[o];t+=Kt(String(s.offset),10,"0"),t+=" ",t+=Kt(String(s.ref.generationNumber),5,"0"),t+=" ",t+=s.deleted?"f":"n",t+=` 
`}}return t},r.prototype.sizeInBytes=function(){for(var t=5,e=0,n=this.subsections.length;e<n;e++){var i=this.subsections[e],o=i.length,a=i[0];t+=2,t+=String(a.ref.objectNumber).length,t+=String(o).length,t+=20*o}return t},r.prototype.copyBytesInto=function(t,e){var n=e;return t[e++]=p.x,t[e++]=p.r,t[e++]=p.e,t[e++]=p.f,t[e++]=p.Newline,e+=this.copySubsectionsIntoBuffer(this.subsections,t,e),e-n},r.prototype.copySubsectionsIntoBuffer=function(t,e,n){for(var i=n,o=t.length,a=0;a<o;a++){var s=this.subsections[a],c=String(s[0].ref.objectNumber);n+=bt(c,e,n),e[n++]=p.Space;var u=String(s.length);n+=bt(u,e,n),e[n++]=p.Newline,n+=this.copyEntriesIntoBuffer(s,e,n)}return n-i},r.prototype.copyEntriesIntoBuffer=function(t,e,n){for(var i=t.length,o=0;o<i;o++){var a=t[o],s=Kt(String(a.offset),10,"0");n+=bt(s,e,n),e[n++]=p.Space;var c=Kt(String(a.ref.generationNumber),5,"0");n+=bt(c,e,n),e[n++]=p.Space,e[n++]=a.deleted?p.f:p.n,e[n++]=p.Space,e[n++]=p.Newline}return 20*i},r.prototype.append=function(t){if(this.chunkLength===0){this.subsections.push([t]),this.chunkIdx=0,this.chunkLength=1;return}var e=this.subsections[this.chunkIdx],n=e[this.chunkLength-1];t.ref.objectNumber-n.ref.objectNumber>1?(this.subsections.push([t]),this.chunkIdx+=1,this.chunkLength=1):(e.push(t),this.chunkLength+=1)},r.create=function(){return new r({ref:st.of(0,65535),offset:0,deleted:!0})},r.createEmpty=function(){return new r},r}(),Hn=function(){function r(t){this.lastXRefOffset=String(t)}return r.prototype.toString=function(){return`startxref
`+this.lastXRefOffset+`
%%EOF`},r.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},r.prototype.copyBytesInto=function(t,e){var n=e;return t[e++]=p.s,t[e++]=p.t,t[e++]=p.a,t[e++]=p.r,t[e++]=p.t,t[e++]=p.x,t[e++]=p.r,t[e++]=p.e,t[e++]=p.f,t[e++]=p.Newline,e+=bt(this.lastXRefOffset,t,e),t[e++]=p.Newline,t[e++]=p.Percent,t[e++]=p.Percent,t[e++]=p.E,t[e++]=p.O,t[e++]=p.F,e-n},r.forLastCrossRefSectionOffset=function(t){return new r(t)},r}(),Ks=function(){function r(t){this.dict=t}return r.prototype.toString=function(){return`trailer
`+this.dict.toString()},r.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},r.prototype.copyBytesInto=function(t,e){var n=e;return t[e++]=p.t,t[e++]=p.r,t[e++]=p.a,t[e++]=p.i,t[e++]=p.l,t[e++]=p.e,t[e++]=p.r,t[e++]=p.Newline,e+=this.dict.copyBytesInto(t,e),e-n},r.of=function(t){return new r(t)},r}(),go=function(r){A(t,r);function t(e,n,i){i===void 0&&(i=!0);var o=r.call(this,e.obj({}),i)||this;return o.objects=n,o.offsets=o.computeObjectOffsets(),o.offsetsString=o.computeOffsetsString(),o.dict.set(v.of("Type"),v.of("ObjStm")),o.dict.set(v.of("N"),W.of(o.objects.length)),o.dict.set(v.of("First"),W.of(o.offsetsString.length)),o}return t.prototype.getObjectsCount=function(){return this.objects.length},t.prototype.clone=function(e){return t.withContextAndObjects(e||this.dict.context,this.objects.slice(),this.encode)},t.prototype.getContentsString=function(){for(var e=this.offsetsString,n=0,i=this.objects.length;n<i;n++){var o=this.objects[n],a=o[1];e+=a+`
`}return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),n=bt(this.offsetsString,e,0),i=0,o=this.objects.length;i<o;i++){var a=this.objects[i],s=a[1];n+=s.copyBytesInto(e,n),e[n++]=p.Newline}return e},t.prototype.getUnencodedContentsSize=function(){return this.offsetsString.length+zr(this.offsets)[1]+zr(this.objects)[1].sizeInBytes()+1},t.prototype.computeOffsetsString=function(){for(var e="",n=0,i=this.offsets.length;n<i;n++){var o=this.offsets[n],a=o[0],s=o[1];e+=a+" "+s+" "}return e},t.prototype.computeObjectOffsets=function(){for(var e=0,n=new Array(this.objects.length),i=0,o=this.objects.length;i<o;i++){var a=this.objects[i],s=a[0],c=a[1];n[i]=[s.objectNumber,e],e+=c.sizeInBytes()+1}return n},t.withContextAndObjects=function(e,n,i){return i===void 0&&(i=!0),new t(e,n,i)},t}(Xn),yo=function(){function r(t,e){var n=this;this.parsedObjects=0,this.shouldWaitForTick=function(i){return n.parsedObjects+=i,n.parsedObjects%n.objectsPerTick===0},this.context=t,this.objectsPerTick=e}return r.prototype.serializeToBuffer=function(){return Y(this,void 0,void 0,function(){var t,e,n,i,o,a,s,c,u,f,l,h,d,g,y,b,m;return J(this,function(S){switch(S.label){case 0:return[4,this.computeBufferSize()];case 1:t=S.sent(),e=t.size,n=t.header,i=t.indirectObjects,o=t.xref,a=t.trailerDict,s=t.trailer,c=0,u=new Uint8Array(e),c+=n.copyBytesInto(u,c),u[c++]=p.Newline,u[c++]=p.Newline,f=0,l=i.length,S.label=2;case 2:return f<l?(h=i[f],d=h[0],g=h[1],y=String(d.objectNumber),c+=bt(y,u,c),u[c++]=p.Space,b=String(d.generationNumber),c+=bt(b,u,c),u[c++]=p.Space,u[c++]=p.o,u[c++]=p.b,u[c++]=p.j,u[c++]=p.Newline,c+=g.copyBytesInto(u,c),u[c++]=p.Newline,u[c++]=p.e,u[c++]=p.n,u[c++]=p.d,u[c++]=p.o,u[c++]=p.b,u[c++]=p.j,u[c++]=p.Newline,u[c++]=p.Newline,m=g instanceof go?g.getObjectsCount():1,this.shouldWaitForTick(m)?[4,Oe()]:[3,4]):[3,5];case 3:S.sent(),S.label=4;case 4:return f++,[3,2];case 5:return o&&(c+=o.copyBytesInto(u,c),u[c++]=p.Newline),a&&(c+=a.copyBytesInto(u,c),u[c++]=p.Newline,u[c++]=p.Newline),c+=s.copyBytesInto(u,c),[2,u]}})})},r.prototype.computeIndirectObjectSize=function(t){var e=t[0],n=t[1],i=e.sizeInBytes()+3,o=n.sizeInBytes()+9;return i+o},r.prototype.createTrailerDict=function(){return this.context.obj({Size:this.context.largestObjectNumber+1,Root:this.context.trailerInfo.Root,Encrypt:this.context.trailerInfo.Encrypt,Info:this.context.trailerInfo.Info,ID:this.context.trailerInfo.ID})},r.prototype.computeBufferSize=function(){return Y(this,void 0,void 0,function(){var t,e,n,i,o,a,s,c,u,f,l;return J(this,function(h){switch(h.label){case 0:t=on.forVersion(1,7),e=t.sizeInBytes()+2,n=po.create(),i=this.context.enumerateIndirectObjects(),o=0,a=i.length,h.label=1;case 1:return o<a?(s=i[o],c=s[0],n.addEntry(c,e),e+=this.computeIndirectObjectSize(s),this.shouldWaitForTick(1)?[4,Oe()]:[3,3]):[3,4];case 2:h.sent(),h.label=3;case 3:return o++,[3,1];case 4:return u=e,e+=n.sizeInBytes()+1,f=Ks.of(this.createTrailerDict()),e+=f.sizeInBytes()+2,l=Hn.forLastCrossRefSectionOffset(u),e+=l.sizeInBytes(),[2,{size:e,header:t,indirectObjects:i,xref:n,trailerDict:f,trailer:l}]}})})},r.forContext=function(t,e){return new r(t,e)},r}(),mo=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.data=e,n}return t.prototype.clone=function(){return t.of(this.data.slice())},t.prototype.toString=function(){return"PDFInvalidObject("+this.data.length+" bytes)"},t.prototype.sizeInBytes=function(){return this.data.length},t.prototype.copyBytesInto=function(e,n){for(var i=this.data.length,o=0;o<i;o++)e[n++]=this.data[o];return i},t.of=function(e){return new t(e)},t}(St),ne;(function(r){r[r.Deleted=0]="Deleted",r[r.Uncompressed=1]="Uncompressed",r[r.Compressed=2]="Compressed"})(ne||(ne={}));var Gs=function(r){A(t,r);function t(e,n,i){i===void 0&&(i=!0);var o=r.call(this,e,i)||this;return o.computeIndex=function(){for(var a=[],s=0,c=0,u=o.entries.length;c<u;c++){var f=o.entries[c],l=o.entries[c-1];c===0?a.push(f.ref.objectNumber):f.ref.objectNumber-l.ref.objectNumber>1&&(a.push(s),a.push(f.ref.objectNumber),s=0),s+=1}return a.push(s),a},o.computeEntryTuples=function(){for(var a=new Array(o.entries.length),s=0,c=o.entries.length;s<c;s++){var u=o.entries[s];if(u.type===ne.Deleted){var f=u.type,l=u.nextFreeObjectNumber,h=u.ref;a[s]=[f,l,h.generationNumber]}if(u.type===ne.Uncompressed){var f=u.type,d=u.offset,h=u.ref;a[s]=[f,d,h.generationNumber]}if(u.type===ne.Compressed){var f=u.type,g=u.objectStreamRef,y=u.index;a[s]=[f,g.objectNumber,y]}}return a},o.computeMaxEntryByteWidths=function(){for(var a=o.entryTuplesCache.access(),s=[0,0,0],c=0,u=a.length;c<u;c++){var f=a[c],l=f[0],h=f[1],d=f[2],g=Er(l),y=Er(h),b=Er(d);g>s[0]&&(s[0]=g),y>s[1]&&(s[1]=y),b>s[2]&&(s[2]=b)}return s},o.entries=n||[],o.entryTuplesCache=Yt.populatedBy(o.computeEntryTuples),o.maxByteWidthsCache=Yt.populatedBy(o.computeMaxEntryByteWidths),o.indexCache=Yt.populatedBy(o.computeIndex),e.set(v.of("Type"),v.of("XRef")),o}return t.prototype.addDeletedEntry=function(e,n){var i=ne.Deleted;this.entries.push({type:i,ref:e,nextFreeObjectNumber:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addUncompressedEntry=function(e,n){var i=ne.Uncompressed;this.entries.push({type:i,ref:e,offset:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addCompressedEntry=function(e,n,i){var o=ne.Compressed;this.entries.push({type:o,ref:e,objectStreamRef:n,index:i}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.clone=function(e){var n=this,i=n.dict,o=n.entries,a=n.encode;return t.of(i.clone(e),o.slice(),a)},t.prototype.getContentsString=function(){for(var e=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i="",o=0,a=e.length;o<a;o++){for(var s=e[o],c=s[0],u=s[1],f=s[2],l=Fe(Se(c)),h=Fe(Se(u)),d=Fe(Se(f)),g=n[0]-1;g>=0;g--)i+=(l[g]||0).toString(2);for(var g=n[1]-1;g>=0;g--)i+=(h[g]||0).toString(2);for(var g=n[2]-1;g>=0;g--)i+=(d[g]||0).toString(2)}return i},t.prototype.getUnencodedContents=function(){for(var e=this.entryTuplesCache.access(),n=this.maxByteWidthsCache.access(),i=new Uint8Array(this.getUnencodedContentsSize()),o=0,a=0,s=e.length;a<s;a++){for(var c=e[a],u=c[0],f=c[1],l=c[2],h=Fe(Se(u)),d=Fe(Se(f)),g=Fe(Se(l)),y=n[0]-1;y>=0;y--)i[o++]=h[y]||0;for(var y=n[1]-1;y>=0;y--)i[o++]=d[y]||0;for(var y=n[2]-1;y>=0;y--)i[o++]=g[y]||0}return i},t.prototype.getUnencodedContentsSize=function(){var e=this.maxByteWidthsCache.access(),n=ba(e);return n*this.entries.length},t.prototype.updateDict=function(){r.prototype.updateDict.call(this);var e=this.maxByteWidthsCache.access(),n=this.indexCache.access(),i=this.dict.context;this.dict.set(v.of("W"),i.obj(e)),this.dict.set(v.of("Index"),i.obj(n))},t.create=function(e,n){n===void 0&&(n=!0);var i=new t(e,[],n);return i.addDeletedEntry(st.of(0,65535),0),i},t.of=function(e,n,i){return i===void 0&&(i=!0),new t(e,n,i)},t}(Xn),Ls=function(r){A(t,r);function t(e,n,i,o){var a=r.call(this,e,n)||this;return a.encodeStreams=i,a.objectsPerStream=o,a}return t.prototype.computeBufferSize=function(){return Y(this,void 0,void 0,function(){var e,n,i,o,a,s,c,u,g,y,f,m,l,h,b,d,g,y,b,m,S,F,T,P;return J(this,function(w){switch(w.label){case 0:e=this.context.largestObjectNumber+1,n=on.forVersion(1,7),i=n.sizeInBytes()+2,o=Gs.create(this.createTrailerDict(),this.encodeStreams),a=[],s=[],c=[],u=this.context.enumerateIndirectObjects(),g=0,y=u.length,w.label=1;case 1:return g<y?(f=u[g],m=f[0],l=f[1],h=m===this.context.trailerInfo.Encrypt||l instanceof At||l instanceof mo||m.generationNumber!==0,h?(a.push(f),o.addUncompressedEntry(m,i),i+=this.computeIndirectObjectSize(f),this.shouldWaitForTick(1)?[4,Oe()]:[3,3]):[3,4]):[3,6];case 2:w.sent(),w.label=3;case 3:return[3,5];case 4:b=zr(s),d=zr(c),(!b||b.length%this.objectsPerStream===0)&&(b=[],s.push(b),d=st.of(e++),c.push(d)),o.addCompressedEntry(m,d,b.length),b.push(f),w.label=5;case 5:return g++,[3,1];case 6:g=0,y=s.length,w.label=7;case 7:return g<y?(b=s[g],m=c[g],S=go.withContextAndObjects(this.context,b,this.encodeStreams),o.addUncompressedEntry(m,i),i+=this.computeIndirectObjectSize([m,S]),a.push([m,S]),this.shouldWaitForTick(b.length)?[4,Oe()]:[3,9]):[3,10];case 8:w.sent(),w.label=9;case 9:return g++,[3,7];case 10:return F=st.of(e++),o.dict.set(v.of("Size"),W.of(e)),o.addUncompressedEntry(F,i),T=i,i+=this.computeIndirectObjectSize([F,o]),a.push([F,o]),P=Hn.forLastCrossRefSectionOffset(T),i+=P.sizeInBytes(),[2,{size:i,header:n,indirectObjects:a,trailer:P}]}})})},t.forContext=function(e,n,i,o){return i===void 0&&(i=!0),o===void 0&&(o=50),new t(e,n,i,o)},t}(yo),V=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.value=e,n}return t.prototype.asBytes=function(){for(var e=this.value+(this.value.length%2===1?"0":""),n=e.length,i=new Uint8Array(e.length/2),o=0,a=0;o<n;){var s=parseInt(e.substring(o,o+2),16);i[a]=s,o+=2,a+=1}return i},t.prototype.decodeText=function(){var e=this.asBytes();return ro(e)?$i(e):ho(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),n=Yi(e);if(!n)throw new vo(e);return n},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return"<"+this.value+">"},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,n){return e[n++]=p.LessThan,n+=bt(this.value,e,n),e[n++]=p.GreaterThan,this.value.length+2},t.of=function(e){return new t(e)},t.fromText=function(e){for(var n=wa(e),i="",o=0,a=n.length;o<a;o++)i+=fr(n[o],4);return new t(i)},t}(St),Kr=function(){function r(t,e){this.encoding=t===ir.ZapfDingbats?Cr.ZapfDingbats:t===ir.Symbol?Cr.Symbol:Cr.WinAnsi,this.font=fs.load(t),this.fontName=this.font.FontName,this.customName=e}return r.prototype.encodeText=function(t){for(var e=this.encodeTextAsGlyphs(t),n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=$r(e[i].code);return V.of(n.join(""))},r.prototype.widthOfTextAtSize=function(t,e){for(var n=this.encodeTextAsGlyphs(t),i=0,o=0,a=n.length;o<a;o++){var s=n[o].name,c=(n[o+1]||{}).name,u=this.font.getXAxisKerningForPair(s,c)||0;i+=this.widthOfGlyph(s)+u}var f=e/1e3;return i*f},r.prototype.heightOfFontAtSize=function(t,e){e===void 0&&(e={});var n=e.descender,i=n===void 0?!0:n,o=this.font,a=o.Ascender,s=o.Descender,c=o.FontBBox,u=a||c[3],f=s||c[1],l=u-f;return i||(l+=s||0),l/1e3*t},r.prototype.sizeOfFontAtHeight=function(t){var e=this.font,n=e.Ascender,i=e.Descender,o=e.FontBBox,a=n||o[3],s=i||o[1];return 1e3*t/(a-s)},r.prototype.embedIntoContext=function(t,e){var n=t.obj({Type:"Font",Subtype:"Type1",BaseFont:this.customName||this.fontName,Encoding:this.encoding===Cr.WinAnsi?"WinAnsiEncoding":void 0});return e?(t.assign(e,n),e):t.register(n)},r.prototype.widthOfGlyph=function(t){return this.font.getWidthOfGlyph(t)||250},r.prototype.encodeTextAsGlyphs=function(t){for(var e=Array.from(t),n=new Array(e.length),i=0,o=e.length;i<o;i++){var a=sa(e[i]);n[i]=this.encoding.encodeUnicodeCodePoint(a)}return n},r.for=function(t,e){return new r(t,e)},r}(),Xs=function(r,t){for(var e=new Array(r.length),n=0,i=r.length;n<i;n++){var o=r[n],a=Ti(Nr(t(o))),s=Ti.apply(void 0,o.codePoints.map(Zs));e[n]=[a,s]}return Hs(e)},Hs=function(r){return`/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
  /Registry (Adobe)
  /Ordering (UCS)
  /Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange
`+r.length+` beginbfchar
`+r.map(function(t){var e=t[0],n=t[1];return e+" "+n}).join(`
`)+`
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end`},Ti=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return"<"+r.join("")+">"},Nr=function(r){return fr(r,4)},Zs=function(r){if(Ca(r))return Nr(r);if(Pa(r)){var t=Qi(r),e=_i(r);return""+Nr(t)+Nr(e)}var n=$r(r),i="0x"+n+" is not a valid UTF-8 or UTF-16 codepoint.";throw new Error(i)},Ys=function(r){var t=0,e=function(n){t|=1<<n-1};return r.fixedPitch&&e(1),r.serif&&e(2),e(3),r.script&&e(4),r.nonsymbolic&&e(6),r.italic&&e(7),r.allCap&&e(17),r.smallCap&&e(18),r.forceBold&&e(19),t},Js=function(r){var t=r["OS/2"]?r["OS/2"].sFamilyClass:0,e=Ys({fixedPitch:r.post.isFixedPitch,serif:1<=t&&t<=7,script:t===10,italic:r.head.macStyle.italic});return e},at=function(r){A(t,r);function t(e){var n=r.call(this)||this;return n.value=e,n}return t.prototype.asBytes=function(){for(var e=[],n="",i=!1,o=function(l){l!==void 0&&e.push(l),i=!1},a=0,s=this.value.length;a<s;a++){var c=this.value[a],u=K(c),f=this.value[a+1];i?u===p.Newline||u===p.CarriageReturn?o():u===p.n?o(p.Newline):u===p.r?o(p.CarriageReturn):u===p.t?o(p.Tab):u===p.b?o(p.Backspace):u===p.f?o(p.FormFeed):u===p.LeftParen?o(p.LeftParen):u===p.RightParen?o(p.RightParen):u===p.Backspace?o(p.BackSlash):u>=p.Zero&&u<=p.Seven?(n+=c,(n.length===3||!(f>="0"&&f<="7"))&&(o(parseInt(n,8)),n="")):o(u):u===p.BackSlash?i=!0:o(u)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return ro(e)?$i(e):ho(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),n=Yi(e);if(!n)throw new vo(e);return n},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return"("+this.value+")"},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,n){return e[n++]=p.LeftParen,n+=bt(this.value,e,n),e[n++]=p.RightParen,this.value.length+2},t.of=function(e){return new t(e)},t.fromDate=function(e){var n=Kt(String(e.getUTCFullYear()),4,"0"),i=Kt(String(e.getUTCMonth()+1),2,"0"),o=Kt(String(e.getUTCDate()),2,"0"),a=Kt(String(e.getUTCHours()),2,"0"),s=Kt(String(e.getUTCMinutes()),2,"0"),c=Kt(String(e.getUTCSeconds()),2,"0");return new t("D:"+n+i+o+a+s+c+"Z")},t}(St),Zn=function(){function r(t,e,n,i){var o=this;this.allGlyphsInFontSortedById=function(){for(var a=new Array(o.font.characterSet.length),s=0,c=a.length;s<c;s++){var u=o.font.characterSet[s];a[s]=o.font.glyphForCodePoint(u)}return ma(a.sort(ya),function(f){return f.id})},this.font=t,this.scale=1e3/this.font.unitsPerEm,this.fontData=e,this.fontName=this.font.postscriptName||"Font",this.customName=n,this.fontFeatures=i,this.baseFontName="",this.glyphCache=Yt.populatedBy(this.allGlyphsInFontSortedById)}return r.for=function(t,e,n,i){return Y(this,void 0,void 0,function(){var o;return J(this,function(a){switch(a.label){case 0:return[4,t.create(e)];case 1:return o=a.sent(),[2,new r(o,e,n,i)]}})})},r.prototype.encodeText=function(t){for(var e=this.font.layout(t,this.fontFeatures).glyphs,n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=fr(e[i].id,4);return V.of(n.join(""))},r.prototype.widthOfTextAtSize=function(t,e){for(var n=this.font.layout(t,this.fontFeatures).glyphs,i=0,o=0,a=n.length;o<a;o++)i+=n[o].advanceWidth*this.scale;var s=e/1e3;return i*s},r.prototype.heightOfFontAtSize=function(t,e){e===void 0&&(e={});var n=e.descender,i=n===void 0?!0:n,o=this.font,a=o.ascent,s=o.descent,c=o.bbox,u=(a||c.maxY)*this.scale,f=(s||c.minY)*this.scale,l=u-f;return i||(l-=Math.abs(s)||0),l/1e3*t},r.prototype.sizeOfFontAtHeight=function(t){var e=this.font,n=e.ascent,i=e.descent,o=e.bbox,a=(n||o.maxY)*this.scale,s=(i||o.minY)*this.scale;return 1e3*t/(a-s)},r.prototype.embedIntoContext=function(t,e){return this.baseFontName=this.customName||t.addRandomSuffix(this.fontName),this.embedFontDict(t,e)},r.prototype.embedFontDict=function(t,e){return Y(this,void 0,void 0,function(){var n,i,o;return J(this,function(a){switch(a.label){case 0:return[4,this.embedCIDFontDict(t)];case 1:return n=a.sent(),i=this.embedUnicodeCmap(t),o=t.obj({Type:"Font",Subtype:"Type0",BaseFont:this.baseFontName,Encoding:"Identity-H",DescendantFonts:[n],ToUnicode:i}),e?(t.assign(e,o),[2,e]):[2,t.register(o)]}})})},r.prototype.isCFF=function(){return this.font.cff},r.prototype.embedCIDFontDict=function(t){return Y(this,void 0,void 0,function(){var e,n;return J(this,function(i){switch(i.label){case 0:return[4,this.embedFontDescriptor(t)];case 1:return e=i.sent(),n=t.obj({Type:"Font",Subtype:this.isCFF()?"CIDFontType0":"CIDFontType2",CIDToGIDMap:"Identity",BaseFont:this.baseFontName,CIDSystemInfo:{Registry:at.of("Adobe"),Ordering:at.of("Identity"),Supplement:0},FontDescriptor:e,W:this.computeWidths()}),[2,t.register(n)]}})})},r.prototype.embedFontDescriptor=function(t){return Y(this,void 0,void 0,function(){var e,n,i,o,a,s,c,u,f,l,h,d,g,y,b;return J(this,function(m){switch(m.label){case 0:return[4,this.embedFontStream(t)];case 1:return e=m.sent(),n=this.scale,i=this.font,o=i.italicAngle,a=i.ascent,s=i.descent,c=i.capHeight,u=i.xHeight,f=this.font.bbox,l=f.minX,h=f.minY,d=f.maxX,g=f.maxY,y=t.obj((b={Type:"FontDescriptor",FontName:this.baseFontName,Flags:Js(this.font),FontBBox:[l*n,h*n,d*n,g*n],ItalicAngle:o,Ascent:a*n,Descent:s*n,CapHeight:(c||a)*n,XHeight:(u||0)*n,StemV:0},b[this.isCFF()?"FontFile3":"FontFile2"]=e,b)),[2,t.register(y)]}})})},r.prototype.serializeFont=function(){return Y(this,void 0,void 0,function(){return J(this,function(t){return[2,this.fontData]})})},r.prototype.embedFontStream=function(t){return Y(this,void 0,void 0,function(){var e,n,i;return J(this,function(o){switch(o.label){case 0:return i=(n=t).flateStream,[4,this.serializeFont()];case 1:return e=i.apply(n,[o.sent(),{Subtype:this.isCFF()?"CIDFontType0C":void 0}]),[2,t.register(e)]}})})},r.prototype.embedUnicodeCmap=function(t){var e=Xs(this.glyphCache.access(),this.glyphId.bind(this)),n=t.flateStream(e);return t.register(n)},r.prototype.glyphId=function(t){return t?t.id:-1},r.prototype.computeWidths=function(){for(var t=this.glyphCache.access(),e=[],n=[],i=0,o=t.length;i<o;i++){var a=t[i],s=t[i-1],c=this.glyphId(a),u=this.glyphId(s);i===0?e.push(c):c-u!==1&&(e.push(n),e.push(c),n=[]),n.push(a.advanceWidth*this.scale)}return e.push(n),e},r}(),Qs=function(r){A(t,r);function t(e,n,i,o){var a=r.call(this,e,n,i,o)||this;return a.subset=a.font.createSubset(),a.glyphs=[],a.glyphCache=Yt.populatedBy(function(){return a.glyphs}),a.glyphIdMap=new Map,a}return t.for=function(e,n,i,o){return Y(this,void 0,void 0,function(){var a;return J(this,function(s){switch(s.label){case 0:return[4,e.create(n)];case 1:return a=s.sent(),[2,new t(a,n,i,o)]}})})},t.prototype.encodeText=function(e){for(var n=this.font.layout(e,this.fontFeatures).glyphs,i=new Array(n.length),o=0,a=n.length;o<a;o++){var s=n[o],c=this.subset.includeGlyph(s);this.glyphs[c-1]=s,this.glyphIdMap.set(s.id,c),i[o]=fr(c,4)}return this.glyphCache.invalidate(),V.of(i.join(""))},t.prototype.isCFF=function(){return this.subset.cff},t.prototype.glyphId=function(e){return e?this.glyphIdMap.get(e.id):-1},t.prototype.serializeFont=function(){var e=this;return new Promise(function(n,i){var o=[];e.subset.encodeStream().on("data",function(a){return o.push(a)}).on("end",function(){return n(ga(o))}).on("error",function(a){return i(a)})})},t}(Zn),Bn;(function(r){r.Source="Source",r.Data="Data",r.Alternative="Alternative",r.Supplement="Supplement",r.EncryptedPayload="EncryptedPayload",r.FormData="EncryptedPayload",r.Schema="Schema",r.Unspecified="Unspecified"})(Bn||(Bn={}));var _s=function(){function r(t,e,n){n===void 0&&(n={}),this.fileData=t,this.fileName=e,this.options=n}return r.for=function(t,e,n){return n===void 0&&(n={}),new r(t,e,n)},r.prototype.embedIntoContext=function(t,e){return Y(this,void 0,void 0,function(){var n,i,o,a,s,c,u,f,l;return J(this,function(h){return n=this.options,i=n.mimeType,o=n.description,a=n.creationDate,s=n.modificationDate,c=n.afRelationship,u=t.flateStream(this.fileData,{Type:"EmbeddedFile",Subtype:i??void 0,Params:{Size:this.fileData.length,CreationDate:a?at.fromDate(a):void 0,ModDate:s?at.fromDate(s):void 0}}),f=t.register(u),l=t.obj({Type:"Filespec",F:at.of(this.fileName),UF:V.fromText(this.fileName),EF:{F:f},Desc:o?V.fromText(o):void 0,AFRelationship:c??void 0}),e?(t.assign(e,l),[2,e]):[2,t.register(l)]})})},r}(),Di=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],Ae;(function(r){r.DeviceGray="DeviceGray",r.DeviceRGB="DeviceRGB",r.DeviceCMYK="DeviceCMYK"})(Ae||(Ae={}));var $s={1:Ae.DeviceGray,3:Ae.DeviceRGB,4:Ae.DeviceCMYK},bo=function(){function r(t,e,n,i,o){this.imageData=t,this.bitsPerComponent=e,this.width=n,this.height=i,this.colorSpace=o}return r.for=function(t){return Y(this,void 0,void 0,function(){var e,n,i,o,a,s,c,u,f,l;return J(this,function(h){if(e=new DataView(t.buffer),n=e.getUint16(0),n!==65496)throw new Error("SOI not found in JPEG");for(i=2;i<e.byteLength&&(o=e.getUint16(i),i+=2,!Di.includes(o));)i+=e.getUint16(i);if(!Di.includes(o))throw new Error("Invalid JPEG");if(i+=2,a=e.getUint8(i++),s=e.getUint16(i),i+=2,c=e.getUint16(i),i+=2,u=e.getUint8(i++),f=$s[u],!f)throw new Error("Unknown JPEG channel.");return l=f,[2,new r(t,a,c,s,l)]})})},r.prototype.embedIntoContext=function(t,e){return Y(this,void 0,void 0,function(){var n;return J(this,function(i){return n=t.stream(this.imageData,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.bitsPerComponent,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:"DCTDecode",Decode:this.colorSpace===Ae.DeviceCMYK?[1,0,1,0,1,0,1,0]:void 0}),e?(t.assign(e,n),[2,e]):[2,t.register(n)]})})},r}(),C={};C.toRGBA8=function(r){var t=r.width,e=r.height;if(r.tabs.acTL==null)return[C.toRGBA8.decodeImage(r.data,t,e,r).buffer];var n=[];r.frames[0].data==null&&(r.frames[0].data=r.data);for(var i=t*e*4,o=new Uint8Array(i),a=new Uint8Array(i),s=new Uint8Array(i),c=0;c<r.frames.length;c++){var u=r.frames[c],f=u.rect.x,l=u.rect.y,h=u.rect.width,d=u.rect.height,g=C.toRGBA8.decodeImage(u.data,h,d,r);if(c!=0)for(var y=0;y<i;y++)s[y]=o[y];if(u.blend==0?C._copyTile(g,h,d,o,t,e,f,l,0):u.blend==1&&C._copyTile(g,h,d,o,t,e,f,l,1),n.push(o.buffer.slice(0)),u.dispose!=0){if(u.dispose==1)C._copyTile(a,h,d,o,t,e,f,l,0);else if(u.dispose==2)for(var y=0;y<i;y++)o[y]=s[y]}}return n};C.toRGBA8.decodeImage=function(r,t,e,n){var i=t*e,o=C.decode._getBPP(n),a=Math.ceil(t*o/8),s=new Uint8Array(i*4),c=new Uint32Array(s.buffer),u=n.ctype,f=n.depth,l=C._bin.readUshort;if(u==6){var h=i<<2;if(f==8)for(var d=0;d<h;d+=4)s[d]=r[d],s[d+1]=r[d+1],s[d+2]=r[d+2],s[d+3]=r[d+3];if(f==16)for(var d=0;d<h;d++)s[d]=r[d<<1]}else if(u==2){var g=n.tabs.tRNS;if(g==null){if(f==8)for(var d=0;d<i;d++){var y=d*3;c[d]=255<<24|r[y+2]<<16|r[y+1]<<8|r[y]}if(f==16)for(var d=0;d<i;d++){var y=d*6;c[d]=255<<24|r[y+4]<<16|r[y+2]<<8|r[y]}}else{var b=g[0],m=g[1],S=g[2];if(f==8)for(var d=0;d<i;d++){var F=d<<2,y=d*3;c[d]=255<<24|r[y+2]<<16|r[y+1]<<8|r[y],r[y]==b&&r[y+1]==m&&r[y+2]==S&&(s[F+3]=0)}if(f==16)for(var d=0;d<i;d++){var F=d<<2,y=d*6;c[d]=255<<24|r[y+4]<<16|r[y+2]<<8|r[y],l(r,y)==b&&l(r,y+2)==m&&l(r,y+4)==S&&(s[F+3]=0)}}}else if(u==3){var T=n.tabs.PLTE,P=n.tabs.tRNS,w=P?P.length:0;if(f==1)for(var D=0;D<e;D++)for(var R=D*a,B=D*t,d=0;d<t;d++){var F=B+d<<2,j=r[R+(d>>3)]>>7-((d&7)<<0)&1,E=3*j;s[F]=T[E],s[F+1]=T[E+1],s[F+2]=T[E+2],s[F+3]=j<w?P[j]:255}if(f==2)for(var D=0;D<e;D++)for(var R=D*a,B=D*t,d=0;d<t;d++){var F=B+d<<2,j=r[R+(d>>2)]>>6-((d&3)<<1)&3,E=3*j;s[F]=T[E],s[F+1]=T[E+1],s[F+2]=T[E+2],s[F+3]=j<w?P[j]:255}if(f==4)for(var D=0;D<e;D++)for(var R=D*a,B=D*t,d=0;d<t;d++){var F=B+d<<2,j=r[R+(d>>1)]>>4-((d&1)<<2)&15,E=3*j;s[F]=T[E],s[F+1]=T[E+1],s[F+2]=T[E+2],s[F+3]=j<w?P[j]:255}if(f==8)for(var d=0;d<i;d++){var F=d<<2,j=r[d],E=3*j;s[F]=T[E],s[F+1]=T[E+1],s[F+2]=T[E+2],s[F+3]=j<w?P[j]:255}}else if(u==4){if(f==8)for(var d=0;d<i;d++){var F=d<<2,U=d<<1,O=r[U];s[F]=O,s[F+1]=O,s[F+2]=O,s[F+3]=r[U+1]}if(f==16)for(var d=0;d<i;d++){var F=d<<2,U=d<<2,O=r[U];s[F]=O,s[F+1]=O,s[F+2]=O,s[F+3]=r[U+2]}}else if(u==0)for(var b=n.tabs.tRNS?n.tabs.tRNS:-1,D=0;D<e;D++){var Z=D*a,X=D*t;if(f==1)for(var N=0;N<t;N++){var O=255*(r[Z+(N>>>3)]>>>7-(N&7)&1),ut=O==b*255?0:255;c[X+N]=ut<<24|O<<16|O<<8|O}else if(f==2)for(var N=0;N<t;N++){var O=85*(r[Z+(N>>>2)]>>>6-((N&3)<<1)&3),ut=O==b*85?0:255;c[X+N]=ut<<24|O<<16|O<<8|O}else if(f==4)for(var N=0;N<t;N++){var O=17*(r[Z+(N>>>1)]>>>4-((N&1)<<2)&15),ut=O==b*17?0:255;c[X+N]=ut<<24|O<<16|O<<8|O}else if(f==8)for(var N=0;N<t;N++){var O=r[Z+N],ut=O==b?0:255;c[X+N]=ut<<24|O<<16|O<<8|O}else if(f==16)for(var N=0;N<t;N++){var O=r[Z+(N<<1)],ut=l(r,Z+(N<<d))==b?0:255;c[X+N]=ut<<24|O<<16|O<<8|O}}return s};C.decode=function(r){for(var t=new Uint8Array(r),e=8,n=C._bin,i=n.readUshort,o=n.readUint,a={tabs:{},frames:[]},s=new Uint8Array(t.length),c=0,u,f=0,l=[137,80,78,71,13,10,26,10],h=0;h<8;h++)if(t[h]!=l[h])throw"The input is not a PNG file!";for(;e<t.length;){var d=n.readUint(t,e);e+=4;var g=n.readASCII(t,e,4);if(e+=4,g=="IHDR")C.decode._IHDR(t,e,a);else if(g=="IDAT"){for(var h=0;h<d;h++)s[c+h]=t[e+h];c+=d}else if(g=="acTL")a.tabs[g]={num_frames:o(t,e),num_plays:o(t,e+4)},u=new Uint8Array(t.length);else if(g=="fcTL"){if(f!=0){var y=a.frames[a.frames.length-1];y.data=C.decode._decompress(a,u.slice(0,f),y.rect.width,y.rect.height),f=0}var b={x:o(t,e+12),y:o(t,e+16),width:o(t,e+4),height:o(t,e+8)},m=i(t,e+22);m=i(t,e+20)/(m==0?100:m);var S={rect:b,delay:Math.round(m*1e3),dispose:t[e+24],blend:t[e+25]};a.frames.push(S)}else if(g=="fdAT"){for(var h=0;h<d-4;h++)u[f+h]=t[e+h+4];f+=d-4}else if(g=="pHYs")a.tabs[g]=[n.readUint(t,e),n.readUint(t,e+4),t[e+8]];else if(g=="cHRM"){a.tabs[g]=[];for(var h=0;h<8;h++)a.tabs[g].push(n.readUint(t,e+h*4))}else if(g=="tEXt"){a.tabs[g]==null&&(a.tabs[g]={});var F=n.nextZero(t,e),T=n.readASCII(t,e,F-e),P=n.readASCII(t,F+1,e+d-F-1);a.tabs[g][T]=P}else if(g=="iTXt"){a.tabs[g]==null&&(a.tabs[g]={});var F=0,w=e;F=n.nextZero(t,w);var T=n.readASCII(t,w,F-w);w=F+1,t[w],t[w+1],w+=2,F=n.nextZero(t,w),n.readASCII(t,w,F-w),w=F+1,F=n.nextZero(t,w),n.readUTF8(t,w,F-w),w=F+1;var P=n.readUTF8(t,w,d-(w-e));a.tabs[g][T]=P}else if(g=="PLTE")a.tabs[g]=n.readBytes(t,e,d);else if(g=="hIST"){var D=a.tabs.PLTE.length/3;a.tabs[g]=[];for(var h=0;h<D;h++)a.tabs[g].push(i(t,e+h*2))}else if(g=="tRNS")a.ctype==3?a.tabs[g]=n.readBytes(t,e,d):a.ctype==0?a.tabs[g]=i(t,e):a.ctype==2&&(a.tabs[g]=[i(t,e),i(t,e+2),i(t,e+4)]);else if(g=="gAMA")a.tabs[g]=n.readUint(t,e)/1e5;else if(g=="sRGB")a.tabs[g]=t[e];else if(g=="bKGD")a.ctype==0||a.ctype==4?a.tabs[g]=[i(t,e)]:a.ctype==2||a.ctype==6?a.tabs[g]=[i(t,e),i(t,e+2),i(t,e+4)]:a.ctype==3&&(a.tabs[g]=t[e]);else if(g=="IEND")break;e+=d,n.readUint(t,e),e+=4}if(f!=0){var y=a.frames[a.frames.length-1];y.data=C.decode._decompress(a,u.slice(0,f),y.rect.width,y.rect.height),f=0}return a.data=C.decode._decompress(a,s,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a};C.decode._decompress=function(r,t,e,n){var i=C.decode._getBPP(r),o=Math.ceil(e*i/8),a=new Uint8Array((o+1+r.interlace)*n);return t=C.decode._inflate(t,a),r.interlace==0?t=C.decode._filterZero(t,r,0,e,n):r.interlace==1&&(t=C.decode._readInterlace(t,r)),t};C.decode._inflate=function(r,t){var e=C.inflateRaw(new Uint8Array(r.buffer,2,r.length-6),t);return e};C.inflateRaw=function(){var r={};return r.H={},r.H.N=function(t,e){var n=Uint8Array,i=0,o=0,a=0,s=0,c=0,u=0,f=0,l=0,h=0,d,g;if(t[0]==3&&t[1]==0)return e||new n(0);var y=r.H,b=y.b,m=y.e,S=y.R,F=y.n,T=y.A,P=y.Z,w=y.m,D=e==null;for(D&&(e=new n(t.length>>>2<<3));i==0;){if(i=b(t,h,1),o=b(t,h+1,2),h+=3,o==0){h&7&&(h+=8-(h&7));var R=(h>>>3)+4,B=t[R-4]|t[R-3]<<8;D&&(e=r.H.W(e,l+B)),e.set(new n(t.buffer,t.byteOffset+R,B),l),h=R+B<<3,l+=B;continue}if(D&&(e=r.H.W(e,l+(1<<17))),o==1&&(d=w.J,g=w.h,u=511,f=31),o==2){a=m(t,h,5)+257,s=m(t,h+5,5)+1,c=m(t,h+10,4)+4,h+=14;for(var j=1,E=0;E<38;E+=2)w.Q[E]=0,w.Q[E+1]=0;for(var E=0;E<c;E++){var U=m(t,h+E*3,3);w.Q[(w.X[E]<<1)+1]=U,U>j&&(j=U)}h+=3*c,F(w.Q,j),T(w.Q,j,w.u),d=w.w,g=w.d,h=S(w.u,(1<<j)-1,a+s,t,h,w.v);var O=y.V(w.v,0,a,w.C);u=(1<<O)-1;var Z=y.V(w.v,a,s,w.D);f=(1<<Z)-1,F(w.C,O),T(w.C,O,d),F(w.D,Z),T(w.D,Z,g)}for(;;){var X=d[P(t,h)&u];h+=X&15;var N=X>>>4;if(!(N>>>8))e[l++]=N;else{if(N==256)break;var ut=l+N-254;if(N>264){var Rt=w.q[N-257];ut=l+(Rt>>>3)+m(t,h,Rt&7),h+=Rt&7}var Ct=g[P(t,h)&f];h+=Ct&15;var te=Ct>>>4,Pt=w.c[te],Bt=(Pt>>>4)+b(t,h,Pt&15);for(h+=Pt&15;l<ut;)e[l]=e[l++-Bt],e[l]=e[l++-Bt],e[l]=e[l++-Bt],e[l]=e[l++-Bt];l=ut}}}return e.length==l?e:e.slice(0,l)},r.H.W=function(t,e){var n=t.length;if(e<=n)return t;var i=new Uint8Array(n<<1);return i.set(t,0),i},r.H.R=function(t,e,n,i,o,a){for(var s=r.H.e,c=r.H.Z,u=0;u<n;){var f=t[c(i,o)&e];o+=f&15;var l=f>>>4;if(l<=15)a[u]=l,u++;else{var h=0,d=0;l==16?(d=3+s(i,o,2),o+=2,h=a[u-1]):l==17?(d=3+s(i,o,3),o+=3):l==18&&(d=11+s(i,o,7),o+=7);for(var g=u+d;u<g;)a[u]=h,u++}}return o},r.H.V=function(t,e,n,i){for(var o=0,a=0,s=i.length>>>1;a<n;){var c=t[a+e];i[a<<1]=0,i[(a<<1)+1]=c,c>o&&(o=c),a++}for(;a<s;)i[a<<1]=0,i[(a<<1)+1]=0,a++;return o},r.H.n=function(t,e){for(var n=r.H.m,i=t.length,o,a,s,c,u,f=n.j,c=0;c<=e;c++)f[c]=0;for(c=1;c<i;c+=2)f[t[c]]++;var l=n.K;for(o=0,f[0]=0,a=1;a<=e;a++)o=o+f[a-1]<<1,l[a]=o;for(s=0;s<i;s+=2)u=t[s+1],u!=0&&(t[s]=l[u],l[u]++)},r.H.A=function(t,e,n){for(var i=t.length,o=r.H.m,a=o.r,s=0;s<i;s+=2)if(t[s+1]!=0)for(var c=s>>1,u=t[s+1],f=c<<4|u,l=e-u,h=t[s]<<l,d=h+(1<<l);h!=d;){var g=a[h]>>>15-e;n[g]=f,h++}},r.H.l=function(t,e){for(var n=r.H.m.r,i=15-e,o=0;o<t.length;o+=2){var a=t[o]<<e-t[o+1];t[o]=n[a]>>>i}},r.H.M=function(t,e,n){n=n<<(e&7);var i=e>>>3;t[i]|=n,t[i+1]|=n>>>8},r.H.I=function(t,e,n){n=n<<(e&7);var i=e>>>3;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},r.H.e=function(t,e,n){return(t[e>>>3]|t[(e>>>3)+1]<<8)>>>(e&7)&(1<<n)-1},r.H.b=function(t,e,n){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)&(1<<n)-1},r.H.Z=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)},r.H.i=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16|t[(e>>>3)+3]<<24)>>>(e&7)},r.H.m=function(){var t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){for(var t=r.H.m,e=32768,n=0;n<e;n++){var i=n;i=(i&2863311530)>>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,t.r[n]=(i>>>16|i<<16)>>>17}function o(a,s,c){for(;s--!=0;)a.push(0,c)}for(var n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];o(t._,144,8),o(t._,112,9),o(t._,24,7),o(t._,8,8),r.H.n(t._,9),r.H.A(t._,9,t.J),r.H.l(t._,9),o(t.$,32,5),r.H.n(t.$,5),r.H.A(t.$,5,t.h),r.H.l(t.$,5),o(t.Q,19,0),o(t.C,286,0),o(t.D,30,0),o(t.v,320,0)}(),r.H.N}();C.decode._readInterlace=function(r,t){for(var e=t.width,n=t.height,i=C.decode._getBPP(t),o=i>>3,a=Math.ceil(e*i/8),s=new Uint8Array(n*a),c=0,u=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],l=[8,8,8,4,4,2,2],h=[8,8,4,4,2,2,1],d=0;d<7;){for(var g=l[d],y=h[d],b=0,m=0,S=u[d];S<n;)S+=g,m++;for(var F=f[d];F<e;)F+=y,b++;var T=Math.ceil(b*i/8);C.decode._filterZero(r,t,c,b,m);for(var P=0,w=u[d];w<n;){for(var D=f[d],R=c+P*T<<3;D<e;){if(i==1){var B=r[R>>3];B=B>>7-(R&7)&1,s[w*a+(D>>3)]|=B<<7-((D&7)<<0)}if(i==2){var B=r[R>>3];B=B>>6-(R&7)&3,s[w*a+(D>>2)]|=B<<6-((D&3)<<1)}if(i==4){var B=r[R>>3];B=B>>4-(R&7)&15,s[w*a+(D>>1)]|=B<<4-((D&1)<<2)}if(i>=8)for(var j=w*a+D*o,E=0;E<o;E++)s[j+E]=r[(R>>3)+E];R+=i,D+=y}P++,w+=g}b*m!=0&&(c+=m*(1+T)),d=d+1}return s};C.decode._getBPP=function(r){var t=[1,null,3,1,2,null,4][r.ctype];return t*r.depth};C.decode._filterZero=function(r,t,e,n,i){var o=C.decode._getBPP(t),a=Math.ceil(n*o/8),s=C.decode._paeth;o=Math.ceil(o/8);var c=0,u=1,f=r[e],l=0;if(f>1&&(r[e]=[0,0,1][f-2]),f==3)for(l=o;l<a;l++)r[l+1]=r[l+1]+(r[l+1-o]>>>1)&255;for(var h=0;h<i;h++)if(c=e+h*a,u=c+h+1,f=r[u-1],l=0,f==0)for(;l<a;l++)r[c+l]=r[u+l];else if(f==1){for(;l<o;l++)r[c+l]=r[u+l];for(;l<a;l++)r[c+l]=r[u+l]+r[c+l-o]}else if(f==2)for(;l<a;l++)r[c+l]=r[u+l]+r[c+l-a];else if(f==3){for(;l<o;l++)r[c+l]=r[u+l]+(r[c+l-a]>>>1);for(;l<a;l++)r[c+l]=r[u+l]+(r[c+l-a]+r[c+l-o]>>>1)}else{for(;l<o;l++)r[c+l]=r[u+l]+s(0,r[c+l-a],0);for(;l<a;l++)r[c+l]=r[u+l]+s(r[c+l-o],r[c+l-a],r[c+l-o-a])}return r};C.decode._paeth=function(r,t,e){var n=r+t-e,i=n-r,o=n-t,a=n-e;return i*i<=o*o&&i*i<=a*a?r:o*o<=a*a?t:e};C.decode._IHDR=function(r,t,e){var n=C._bin;e.width=n.readUint(r,t),t+=4,e.height=n.readUint(r,t),t+=4,e.depth=r[t],t++,e.ctype=r[t],t++,e.compress=r[t],t++,e.filter=r[t],t++,e.interlace=r[t],t++};C._bin={nextZero:function(r,t){for(;r[t]!=0;)t++;return t},readUshort:function(r,t){return r[t]<<8|r[t+1]},writeUshort:function(r,t,e){r[t]=e>>8&255,r[t+1]=e&255},readUint:function(r,t){return r[t]*(256*256*256)+(r[t+1]<<16|r[t+2]<<8|r[t+3])},writeUint:function(r,t,e){r[t]=e>>24&255,r[t+1]=e>>16&255,r[t+2]=e>>8&255,r[t+3]=e&255},readASCII:function(r,t,e){for(var n="",i=0;i<e;i++)n+=String.fromCharCode(r[t+i]);return n},writeASCII:function(r,t,e){for(var n=0;n<e.length;n++)r[t+n]=e.charCodeAt(n)},readBytes:function(r,t,e){for(var n=[],i=0;i<e;i++)n.push(r[t+i]);return n},pad:function(r){return r.length<2?"0"+r:r},readUTF8:function(r,t,e){for(var n="",i,o=0;o<e;o++)n+="%"+C._bin.pad(r[t+o].toString(16));try{i=decodeURIComponent(n)}catch{return C._bin.readASCII(r,t,e)}return i}};C._copyTile=function(r,t,e,n,i,o,a,s,c){for(var u=Math.min(t,i),f=Math.min(e,o),l=0,h=0,d=0;d<f;d++)for(var g=0;g<u;g++)if(a>=0&&s>=0?(l=d*t+g<<2,h=(s+d)*i+a+g<<2):(l=(-s+d)*t-a+g<<2,h=d*i+g<<2),c==0)n[h]=r[l],n[h+1]=r[l+1],n[h+2]=r[l+2],n[h+3]=r[l+3];else if(c==1){var y=r[l+3]*.00392156862745098,b=r[l]*y,m=r[l+1]*y,S=r[l+2]*y,F=n[h+3]*(1/255),T=n[h]*F,P=n[h+1]*F,w=n[h+2]*F,D=1-y,R=y+F*D,B=R==0?0:1/R;n[h+3]=255*R,n[h+0]=(b+T*D)*B,n[h+1]=(m+P*D)*B,n[h+2]=(S+w*D)*B}else if(c==2){var y=r[l+3],b=r[l],m=r[l+1],S=r[l+2],F=n[h+3],T=n[h],P=n[h+1],w=n[h+2];y==F&&b==T&&m==P&&S==w?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=b,n[h+1]=m,n[h+2]=S,n[h+3]=y)}else if(c==3){var y=r[l+3],b=r[l],m=r[l+1],S=r[l+2],F=n[h+3],T=n[h],P=n[h+1],w=n[h+2];if(y==F&&b==T&&m==P&&S==w)continue;if(y<220&&F>20)return!1}return!0};C.encode=function(r,t,e,n,i,o,a){n==null&&(n=0),a==null&&(a=!1);var s=C.encode.compress(r,t,e,n,[!1,!1,!1,0,a]);return C.encode.compressPNG(s,-1),C.encode._main(s,t,e,i,o)};C.encodeLL=function(r,t,e,n,i,o,a,s){for(var c={ctype:0+(n==1?0:2)+(i==0?0:4),depth:o,frames:[]},u=(n+i)*o,f=u*t,l=0;l<r.length;l++)c.frames.push({rect:{x:0,y:0,width:t,height:e},img:new Uint8Array(r[l]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(f/8)});C.encode.compressPNG(c,0,!0);var h=C.encode._main(c,t,e,a,s);return h};C.encode._main=function(r,t,e,n,i){i==null&&(i={});var o=C.crc.crc,a=C._bin.writeUint,s=C._bin.writeUshort,c=C._bin.writeASCII,u=8,f=r.frames.length>1,l=!1,h=33+(f?20:0);if(i.sRGB!=null&&(h+=13),i.pHYs!=null&&(h+=21),r.ctype==3){for(var d=r.plte.length,g=0;g<d;g++)r.plte[g]>>>24!=255&&(l=!0);h+=8+d*3+4+(l?8+d*1+4:0)}for(var y=0;y<r.frames.length;y++){var b=r.frames[y];f&&(h+=38),h+=b.cimg.length+12,y!=0&&(h+=4)}h+=12;for(var m=new Uint8Array(h),S=[137,80,78,71,13,10,26,10],g=0;g<8;g++)m[g]=S[g];if(a(m,u,13),u+=4,c(m,u,"IHDR"),u+=4,a(m,u,t),u+=4,a(m,u,e),u+=4,m[u]=r.depth,u++,m[u]=r.ctype,u++,m[u]=0,u++,m[u]=0,u++,m[u]=0,u++,a(m,u,o(m,u-17,17)),u+=4,i.sRGB!=null&&(a(m,u,1),u+=4,c(m,u,"sRGB"),u+=4,m[u]=i.sRGB,u++,a(m,u,o(m,u-5,5)),u+=4),i.pHYs!=null&&(a(m,u,9),u+=4,c(m,u,"pHYs"),u+=4,a(m,u,i.pHYs[0]),u+=4,a(m,u,i.pHYs[1]),u+=4,m[u]=i.pHYs[2],u++,a(m,u,o(m,u-13,13)),u+=4),f&&(a(m,u,8),u+=4,c(m,u,"acTL"),u+=4,a(m,u,r.frames.length),u+=4,a(m,u,i.loop!=null?i.loop:0),u+=4,a(m,u,o(m,u-12,12)),u+=4),r.ctype==3){var d=r.plte.length;a(m,u,d*3),u+=4,c(m,u,"PLTE"),u+=4;for(var g=0;g<d;g++){var F=g*3,T=r.plte[g],P=T&255,w=T>>>8&255,D=T>>>16&255;m[u+F+0]=P,m[u+F+1]=w,m[u+F+2]=D}if(u+=d*3,a(m,u,o(m,u-d*3-4,d*3+4)),u+=4,l){a(m,u,d),u+=4,c(m,u,"tRNS"),u+=4;for(var g=0;g<d;g++)m[u+g]=r.plte[g]>>>24&255;u+=d,a(m,u,o(m,u-d-4,d+4)),u+=4}}for(var R=0,y=0;y<r.frames.length;y++){var b=r.frames[y];f&&(a(m,u,26),u+=4,c(m,u,"fcTL"),u+=4,a(m,u,R++),u+=4,a(m,u,b.rect.width),u+=4,a(m,u,b.rect.height),u+=4,a(m,u,b.rect.x),u+=4,a(m,u,b.rect.y),u+=4,s(m,u,n[y]),u+=2,s(m,u,1e3),u+=2,m[u]=b.dispose,u++,m[u]=b.blend,u++,a(m,u,o(m,u-30,30)),u+=4);var B=b.cimg,d=B.length;a(m,u,d+(y==0?0:4)),u+=4;var j=u;c(m,u,y==0?"IDAT":"fdAT"),u+=4,y!=0&&(a(m,u,R++),u+=4),m.set(B,u),u+=d,a(m,u,o(m,j,u-j)),u+=4}return a(m,u,0),u+=4,c(m,u,"IEND"),u+=4,a(m,u,o(m,u-4,4)),u+=4,m.buffer};C.encode.compressPNG=function(r,t,e){for(var n=0;n<r.frames.length;n++){var i=r.frames[n];i.rect.width;var o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=C.encode._filterZero(i.img,o,i.bpp,i.bpl,a,t,e)}};C.encode.compress=function(r,t,e,n,i){for(var o=i[0],a=i[1],s=i[2],c=i[3],u=i[4],f=6,l=8,h=255,d=0;d<r.length;d++)for(var g=new Uint8Array(r[d]),y=g.length,b=0;b<y;b+=4)h&=g[b+3];var m=h!=255,S=C.encode.framize(r,t,e,o,a,s),F={},T=[],P=[];if(n!=0){for(var w=[],b=0;b<S.length;b++)w.push(S[b].img.buffer);for(var D=C.encode.concatRGBA(w),R=C.quantize(D,n),B=0,j=new Uint8Array(R.abuf),b=0;b<S.length;b++){var E=S[b].img,U=E.length;P.push(new Uint8Array(R.inds.buffer,B>>2,U>>2));for(var d=0;d<U;d+=4)E[d]=j[B+d],E[d+1]=j[B+d+1],E[d+2]=j[B+d+2],E[d+3]=j[B+d+3];B+=U}for(var b=0;b<R.plte.length;b++)T.push(R.plte[b].est.rgba)}else for(var d=0;d<S.length;d++){var O=S[d],Z=new Uint32Array(O.img.buffer),X=O.rect.width,y=Z.length,N=new Uint8Array(y);P.push(N);for(var b=0;b<y;b++){var ut=Z[b];if(b!=0&&ut==Z[b-1])N[b]=N[b-1];else if(b>X&&ut==Z[b-X])N[b]=N[b-X];else{var Rt=F[ut];if(Rt==null&&(F[ut]=Rt=T.length,T.push(ut),T.length>=300))break;N[b]=Rt}}}var Ct=T.length;Ct<=256&&u==!1&&(Ct<=2?l=1:Ct<=4?l=2:Ct<=16?l=4:l=8,l=Math.max(l,c));for(var d=0;d<S.length;d++){var O=S[d];O.rect.x,O.rect.y;var X=O.rect.width,te=O.rect.height,Pt=O.img;new Uint32Array(Pt.buffer);var Bt=4*X,mn=4;if(Ct<=256&&u==!1){Bt=Math.ceil(l*X/8);for(var Gt=new Uint8Array(Bt*te),br=P[d],xr=0;xr<te;xr++){var b=xr*Bt,Fr=xr*X;if(l==8)for(var lt=0;lt<X;lt++)Gt[b+lt]=br[Fr+lt];else if(l==4)for(var lt=0;lt<X;lt++)Gt[b+(lt>>1)]|=br[Fr+lt]<<4-(lt&1)*4;else if(l==2)for(var lt=0;lt<X;lt++)Gt[b+(lt>>2)]|=br[Fr+lt]<<6-(lt&3)*2;else if(l==1)for(var lt=0;lt<X;lt++)Gt[b+(lt>>3)]|=br[Fr+lt]<<7-(lt&7)*1}Pt=Gt,f=3,mn=1}else if(m==!1&&S.length==1){for(var Gt=new Uint8Array(X*te*3),$o=X*te,b=0;b<$o;b++){var E=b*3,bn=b*4;Gt[E]=Pt[bn],Gt[E+1]=Pt[bn+1],Gt[E+2]=Pt[bn+2]}Pt=Gt,f=2,mn=3,Bt=3*X}O.img=Pt,O.bpl=Bt,O.bpp=mn}return{ctype:f,depth:l,plte:T,frames:S}};C.encode.framize=function(r,t,e,n,i,o){for(var a=[],s=0;s<r.length;s++){var c=new Uint8Array(r[s]),u=new Uint32Array(c.buffer),f,l=0,h=0,d=t,g=e,y=n?1:0;if(s!=0){for(var b=o||n||s==1||a[s-2].dispose!=0?1:2,m=0,S=1e9,F=0;F<b;F++){for(var O=new Uint8Array(r[s-1-F]),T=new Uint32Array(r[s-1-F]),P=t,w=e,D=-1,R=-1,B=0;B<e;B++)for(var j=0;j<t;j++){var E=B*t+j;u[E]!=T[E]&&(j<P&&(P=j),j>D&&(D=j),B<w&&(w=B),B>R&&(R=B))}D==-1&&(P=w=D=R=0),i&&((P&1)==1&&P--,(w&1)==1&&w--);var U=(D-P+1)*(R-w+1);U<S&&(S=U,m=F,l=P,h=w,d=D-P+1,g=R-w+1)}var O=new Uint8Array(r[s-1-m]);m==1&&(a[s-1].dispose=2),f=new Uint8Array(d*g*4),C._copyTile(O,t,e,f,d,g,-l,-h,0),y=C._copyTile(c,t,e,f,d,g,-l,-h,3)?1:0,y==1?C.encode._prepareDiff(c,t,e,f,{x:l,y:h,width:d,height:g}):C._copyTile(c,t,e,f,d,g,-l,-h,0)}else f=c.slice(0);a.push({rect:{x:l,y:h,width:d,height:g},img:f,blend:y,dispose:0})}if(n)for(var s=0;s<a.length;s++){var Z=a[s];if(Z.blend!=1){var X=Z.rect,N=a[s-1].rect,ut=Math.min(X.x,N.x),Rt=Math.min(X.y,N.y),Ct=Math.max(X.x+X.width,N.x+N.width),te=Math.max(X.y+X.height,N.y+N.height),Pt={x:ut,y:Rt,width:Ct-ut,height:te-Rt};a[s-1].dispose=1,s-1!=0&&C.encode._updateFrame(r,t,e,a,s-1,Pt,i),C.encode._updateFrame(r,t,e,a,s,Pt,i)}}var Bt=0;if(r.length!=1)for(var E=0;E<a.length;E++){var Z=a[E];Bt+=Z.rect.width*Z.rect.height}return a};C.encode._updateFrame=function(r,t,e,n,i,o,a){for(var s=Uint8Array,c=Uint32Array,u=new s(r[i-1]),f=new c(r[i-1]),l=i+1<r.length?new s(r[i+1]):null,h=new s(r[i]),d=new c(h.buffer),g=t,y=e,b=-1,m=-1,S=0;S<o.height;S++)for(var F=0;F<o.width;F++){var T=o.x+F,P=o.y+S,w=P*t+T,D=d[w];D==0||n[i-1].dispose==0&&f[w]==D&&(l==null||l[w*4+3]!=0)||(T<g&&(g=T),T>b&&(b=T),P<y&&(y=P),P>m&&(m=P))}b==-1&&(g=y=b=m=0),a&&((g&1)==1&&g--,(y&1)==1&&y--),o={x:g,y,width:b-g+1,height:m-y+1};var R=n[i];R.rect=o,R.blend=1,R.img=new Uint8Array(o.width*o.height*4),n[i-1].dispose==0?(C._copyTile(u,t,e,R.img,o.width,o.height,-o.x,-o.y,0),C.encode._prepareDiff(h,t,e,R.img,o)):C._copyTile(h,t,e,R.img,o.width,o.height,-o.x,-o.y,0)};C.encode._prepareDiff=function(r,t,e,n,i){C._copyTile(r,t,e,n,i.width,i.height,-i.x,-i.y,2)};C.encode._filterZero=function(r,t,e,n,i,o,a){var s=[],c=[0,1,2,3,4];o!=-1?c=[o]:(t*n>5e5||e==1)&&(c=[0]);var u;a&&(u={level:0});for(var f=a&&UZIP!=null?UZIP:en,l=0;l<c.length;l++){for(var h=0;h<t;h++)C.encode._filterLine(i,r,h,n,e,c[l]);s.push(f.deflate(i,u))}for(var d,g=1e9,l=0;l<s.length;l++)s[l].length<g&&(d=l,g=s[l].length);return s[d]};C.encode._filterLine=function(r,t,e,n,i,o){var a=e*n,s=a+e,c=C.decode._paeth;if(r[s]=o,s++,o==0)if(n<500)for(var u=0;u<n;u++)r[s+u]=t[a+u];else r.set(new Uint8Array(t.buffer,a,n),s);else if(o==1){for(var u=0;u<i;u++)r[s+u]=t[a+u];for(var u=i;u<n;u++)r[s+u]=t[a+u]-t[a+u-i]+256&255}else if(e==0){for(var u=0;u<i;u++)r[s+u]=t[a+u];if(o==2)for(var u=i;u<n;u++)r[s+u]=t[a+u];if(o==3)for(var u=i;u<n;u++)r[s+u]=t[a+u]-(t[a+u-i]>>1)+256&255;if(o==4)for(var u=i;u<n;u++)r[s+u]=t[a+u]-c(t[a+u-i],0,0)+256&255}else{if(o==2)for(var u=0;u<n;u++)r[s+u]=t[a+u]+256-t[a+u-n]&255;if(o==3){for(var u=0;u<i;u++)r[s+u]=t[a+u]+256-(t[a+u-n]>>1)&255;for(var u=i;u<n;u++)r[s+u]=t[a+u]+256-(t[a+u-n]+t[a+u-i]>>1)&255}if(o==4){for(var u=0;u<i;u++)r[s+u]=t[a+u]+256-c(0,t[a+u-n],0)&255;for(var u=i;u<n;u++)r[s+u]=t[a+u]+256-c(t[a+u-i],t[a+u-n],t[a+u-i-n])&255}}};C.crc={table:function(){for(var r=new Uint32Array(256),t=0;t<256;t++){for(var e=t,n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;r[t]=e}return r}(),update:function(r,t,e,n){for(var i=0;i<n;i++)r=C.crc.table[(r^t[e+i])&255]^r>>>8;return r},crc:function(r,t,e){return C.crc.update(4294967295,r,t,e)^4294967295}};C.quantize=function(r,t){var e=new Uint8Array(r),n=e.slice(0),i=new Uint32Array(n.buffer),o=C.quantize.getKDtree(n,t),a=o[0],s=o[1];C.quantize.planeDst;for(var c=e,u=i,f=c.length,l=new Uint8Array(e.length>>2),h=0;h<f;h+=4){var d=c[h]*.00392156862745098,g=c[h+1]*(1/255),y=c[h+2]*(1/255),b=c[h+3]*(1/255),m=C.quantize.getNearest(a,d,g,y,b);l[h>>2]=m.ind,u[h>>2]=m.est.rgba}return{abuf:n.buffer,inds:l,plte:s}};C.quantize.getKDtree=function(r,t,e){e==null&&(e=1e-4);var n=new Uint32Array(r.buffer),i={i0:0,i1:r.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=C.quantize.stats(r,i.i0,i.i1),i.est=C.quantize.estats(i.bst);for(var o=[i];o.length<t;){for(var a=0,s=0,c=0;c<o.length;c++)o[c].est.L>a&&(a=o[c].est.L,s=c);if(a<e)break;var u=o[s],f=C.quantize.splitPixels(r,n,u.i0,u.i1,u.est.e,u.est.eMq255),l=u.i0>=f||u.i1<=f;if(l){u.est.L=0;continue}var h={i0:u.i0,i1:f,bst:null,est:null,tdst:0,left:null,right:null};h.bst=C.quantize.stats(r,h.i0,h.i1),h.est=C.quantize.estats(h.bst);var d={i0:f,i1:u.i1,bst:null,est:null,tdst:0,left:null,right:null};d.bst={R:[],m:[],N:u.bst.N-h.bst.N};for(var c=0;c<16;c++)d.bst.R[c]=u.bst.R[c]-h.bst.R[c];for(var c=0;c<4;c++)d.bst.m[c]=u.bst.m[c]-h.bst.m[c];d.est=C.quantize.estats(d.bst),u.left=h,u.right=d,o[s]=h,o.push(d)}o.sort(function(g,y){return y.bst.N-g.bst.N});for(var c=0;c<o.length;c++)o[c].ind=c;return[i,o]};C.quantize.getNearest=function(r,t,e,n,i){if(r.left==null)return r.tdst=C.quantize.dist(r.est.q,t,e,n,i),r;var o=C.quantize.planeDst(r.est,t,e,n,i),a=r.left,s=r.right;o>0&&(a=r.right,s=r.left);var c=C.quantize.getNearest(a,t,e,n,i);if(c.tdst<=o*o)return c;var u=C.quantize.getNearest(s,t,e,n,i);return u.tdst<c.tdst?u:c};C.quantize.planeDst=function(r,t,e,n,i){var o=r.e;return o[0]*t+o[1]*e+o[2]*n+o[3]*i-r.eMq};C.quantize.dist=function(r,t,e,n,i){var o=t-r[0],a=e-r[1],s=n-r[2],c=i-r[3];return o*o+a*a+s*s+c*c};C.quantize.splitPixels=function(r,t,e,n,i,o){var a=C.quantize.vecDot;for(n-=4;e<n;){for(;a(r,e,i)<=o;)e+=4;for(;a(r,n,i)>o;)n-=4;if(e>=n)break;var s=t[e>>2];t[e>>2]=t[n>>2],t[n>>2]=s,e+=4,n-=4}for(;a(r,e,i)>o;)e-=4;return e+4};C.quantize.vecDot=function(r,t,e){return r[t]*e[0]+r[t+1]*e[1]+r[t+2]*e[2]+r[t+3]*e[3]};C.quantize.stats=function(r,t,e){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=e-t>>2,a=t;a<e;a+=4){var s=r[a]*.00392156862745098,c=r[a+1]*(1/255),u=r[a+2]*(1/255),f=r[a+3]*(1/255);i[0]+=s,i[1]+=c,i[2]+=u,i[3]+=f,n[0]+=s*s,n[1]+=s*c,n[2]+=s*u,n[3]+=s*f,n[5]+=c*c,n[6]+=c*u,n[7]+=c*f,n[10]+=u*u,n[11]+=u*f,n[15]+=f*f}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:o}};C.quantize.estats=function(r){var t=r.R,e=r.m,n=r.N,i=e[0],o=e[1],a=e[2],s=e[3],c=n==0?0:1/n,u=[t[0]-i*i*c,t[1]-i*o*c,t[2]-i*a*c,t[3]-i*s*c,t[4]-o*i*c,t[5]-o*o*c,t[6]-o*a*c,t[7]-o*s*c,t[8]-a*i*c,t[9]-a*o*c,t[10]-a*a*c,t[11]-a*s*c,t[12]-s*i*c,t[13]-s*o*c,t[14]-s*a*c,t[15]-s*s*c],f=u,l=C.M4,h=[.5,.5,.5,.5],d=0,g=0;if(n!=0)for(var y=0;y<10&&(h=l.multVec(f,h),g=Math.sqrt(l.dot(h,h)),h=l.sml(1/g,h),!(Math.abs(g-d)<1e-9));y++)d=g;var b=[i*c,o*c,a*c,s*c],m=l.dot(l.sml(255,b),h);return{Cov:u,q:b,e:h,L:d,eMq255:m,eMq:l.dot(h,b),rgba:(Math.round(255*b[3])<<24|Math.round(255*b[2])<<16|Math.round(255*b[1])<<8|Math.round(255*b[0])<<0)>>>0}};C.M4={multVec:function(r,t){return[r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3],r[4]*t[0]+r[5]*t[1]+r[6]*t[2]+r[7]*t[3],r[8]*t[0]+r[9]*t[1]+r[10]*t[2]+r[11]*t[3],r[12]*t[0]+r[13]*t[1]+r[14]*t[2]+r[15]*t[3]]},dot:function(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]},sml:function(r,t){return[r*t[0],r*t[1],r*t[2],r*t[3]]}};C.encode.concatRGBA=function(r){for(var t=0,e=0;e<r.length;e++)t+=r[e].byteLength;for(var n=new Uint8Array(t),i=0,e=0;e<r.length;e++){for(var o=new Uint8Array(r[e]),a=o.length,s=0;s<a;s+=4){var c=o[s],u=o[s+1],f=o[s+2],l=o[s+3];l==0&&(c=u=f=0),n[i+s]=c,n[i+s+1]=u,n[i+s+2]=f,n[i+s+3]=l}i+=a}return n.buffer};var tu=function(r){if(r===0)return de.Greyscale;if(r===2)return de.Truecolour;if(r===3)return de.IndexedColour;if(r===4)return de.GreyscaleWithAlpha;if(r===6)return de.TruecolourWithAlpha;throw new Error("Unknown color type: "+r)},eu=function(r){for(var t=Math.floor(r.length/4),e=new Uint8Array(t*3),n=new Uint8Array(t*1),i=0,o=0,a=0;i<r.length;)e[o++]=r[i++],e[o++]=r[i++],e[o++]=r[i++],n[a++]=r[i++];return{rgbChannel:e,alphaChannel:n}},de;(function(r){r.Greyscale="Greyscale",r.Truecolour="Truecolour",r.IndexedColour="IndexedColour",r.GreyscaleWithAlpha="GreyscaleWithAlpha",r.TruecolourWithAlpha="TruecolourWithAlpha"})(de||(de={}));var ru=function(){function r(t){var e=C.decode(t),n=C.toRGBA8(e);if(n.length>1)throw new Error("Animated PNGs are not supported");var i=new Uint8Array(n[0]),o=eu(i),a=o.rgbChannel,s=o.alphaChannel;this.rgbChannel=a;var c=s.some(function(u){return u<255});c&&(this.alphaChannel=s),this.type=tu(e.ctype),this.width=e.width,this.height=e.height,this.bitsPerComponent=8}return r.load=function(t){return new r(t)},r}(),xo=function(){function r(t){this.image=t,this.bitsPerComponent=t.bitsPerComponent,this.width=t.width,this.height=t.height,this.colorSpace="DeviceRGB"}return r.for=function(t){return Y(this,void 0,void 0,function(){var e;return J(this,function(n){return e=ru.load(t),[2,new r(e)]})})},r.prototype.embedIntoContext=function(t,e){return Y(this,void 0,void 0,function(){var n,i;return J(this,function(o){return n=this.embedAlphaChannel(t),i=t.flateStream(this.image.rgbChannel,{Type:"XObject",Subtype:"Image",BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),e?(t.assign(e,i),[2,e]):[2,t.register(i)]})})},r.prototype.embedAlphaChannel=function(t){if(this.image.alphaChannel){var e=t.flateStream(this.image.alphaChannel,{Type:"XObject",Subtype:"Image",Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:"DeviceGray",Decode:[0,1]});return t.register(e)}},r}(),Fo=function(){function r(t,e,n){this.bytes=t,this.start=e||0,this.pos=this.start,this.end=e&&n?e+n:this.bytes.length}return Object.defineProperty(r.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),r.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},r.prototype.getUint16=function(){var t=this.getByte(),e=this.getByte();return t===-1||e===-1?-1:(t<<8)+e},r.prototype.getInt32=function(){var t=this.getByte(),e=this.getByte(),n=this.getByte(),i=this.getByte();return(t<<24)+(e<<16)+(n<<8)+i},r.prototype.getBytes=function(t,e){e===void 0&&(e=!1);var n=this.bytes,i=this.pos,o=this.end;if(t){var s=i+t;s>o&&(s=o),this.pos=s;var a=n.subarray(i,s);return e?new Uint8ClampedArray(a):a}else{var a=n.subarray(i,o);return e?new Uint8ClampedArray(a):a}},r.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},r.prototype.peekBytes=function(t,e){e===void 0&&(e=!1);var n=this.getBytes(t,e);return this.pos-=n.length,n},r.prototype.skip=function(t){t||(t=1),this.pos+=t},r.prototype.reset=function(){this.pos=this.start},r.prototype.moveStart=function(){this.start=this.pos},r.prototype.makeSubStream=function(t,e){return new r(this.bytes,t,e)},r.prototype.decode=function(){return this.bytes},r}(),nu=new Uint8Array(0),pr=function(){function r(t){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=nu,this.minBufferLength=512,t)for(;this.minBufferLength<t;)this.minBufferLength*=2}return Object.defineProperty(r.prototype,"isEmpty",{get:function(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0},enumerable:!1,configurable:!0}),r.prototype.getByte=function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},r.prototype.getUint16=function(){var t=this.getByte(),e=this.getByte();return t===-1||e===-1?-1:(t<<8)+e},r.prototype.getInt32=function(){var t=this.getByte(),e=this.getByte(),n=this.getByte(),i=this.getByte();return(t<<24)+(e<<16)+(n<<8)+i},r.prototype.getBytes=function(t,e){e===void 0&&(e=!1);var n,i=this.pos;if(t){for(this.ensureBuffer(i+t),n=i+t;!this.eof&&this.bufferLength<n;)this.readBlock();var o=this.bufferLength;n>o&&(n=o)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(i,n);return e&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},r.prototype.peekByte=function(){var t=this.getByte();return this.pos--,t},r.prototype.peekBytes=function(t,e){e===void 0&&(e=!1);var n=this.getBytes(t,e);return this.pos-=n.length,n},r.prototype.skip=function(t){t||(t=1),this.pos+=t},r.prototype.reset=function(){this.pos=0},r.prototype.makeSubStream=function(t,e){for(var n=t+e;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Fo(this.buffer,t,e)},r.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},r.prototype.readBlock=function(){throw new Mt(this.constructor.name,"readBlock")},r.prototype.ensureBuffer=function(t){var e=this.buffer;if(t<=e.byteLength)return e;for(var n=this.minBufferLength;n<t;)n*=2;var i=new Uint8Array(n);return i.set(e),this.buffer=i},r}(),ki=function(r){return r===32||r===9||r===13||r===10},iu=function(r){A(t,r);function t(e,n){var i=r.call(this,n)||this;return i.stream=e,i.input=new Uint8Array(5),n&&(n=.8*n),i}return t.prototype.readBlock=function(){for(var e=126,n=122,i=-1,o=this.stream,a=o.getByte();ki(a);)a=o.getByte();if(a===i||a===e){this.eof=!0;return}var s=this.bufferLength,c,u;if(a===n){for(c=this.ensureBuffer(s+4),u=0;u<4;++u)c[s+u]=0;this.bufferLength+=4}else{var f=this.input;for(f[0]=a,u=1;u<5;++u){for(a=o.getByte();ki(a);)a=o.getByte();if(f[u]=a,a===i||a===e)break}if(c=this.ensureBuffer(s+u-1),this.bufferLength+=u-1,u<5){for(;u<5;++u)f[u]=117;this.eof=!0}var l=0;for(u=0;u<5;++u)l=l*85+(f[u]-33);for(u=3;u>=0;--u)c[s+u]=l&255,l>>=8}},t}(pr),ou=function(r){A(t,r);function t(e,n){var i=r.call(this,n)||this;return i.stream=e,i.firstDigit=-1,n&&(n=.5*n),i}return t.prototype.readBlock=function(){var e=8e3,n=this.stream.getBytes(e);if(!n.length){this.eof=!0;return}for(var i=n.length+1>>1,o=this.ensureBuffer(this.bufferLength+i),a=this.bufferLength,s=this.firstDigit,c=0,u=n.length;c<u;c++){var f=n[c],l=void 0;if(f>=48&&f<=57)l=f&15;else if(f>=65&&f<=70||f>=97&&f<=102)l=(f&15)+9;else if(f===62){this.eof=!0;break}else continue;s<0?s=l:(o[a++]=s<<4|l,s=-1)}s>=0&&this.eof&&(o[a++]=s<<4,s=-1),this.firstDigit=s,this.bufferLength=a},t}(pr),Ai=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),au=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),su=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),uu=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],cu=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],fu=function(r){A(t,r);function t(e,n){var i=r.call(this,n)||this;i.stream=e;var o=e.getByte(),a=e.getByte();if(o===-1||a===-1)throw new Error("Invalid header in flate stream: "+o+", "+a);if((o&15)!==8)throw new Error("Unknown compression method in flate stream: "+o+", "+a);if(((o<<8)+a)%31!==0)throw new Error("Bad FCHECK in flate stream: "+o+", "+a);if(a&32)throw new Error("FDICT bit set in flate stream: "+o+", "+a);return i.codeSize=0,i.codeBuf=0,i}return t.prototype.readBlock=function(){var e,n,i=this.stream,o=this.getBits(3);if(o&1&&(this.eof=!0),o>>=1,o===0){var a=void 0;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");var s=a;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(s|=a<<8,(a=i.getByte())===-1)throw new Error("Bad block header in flate stream");var c=a;if((a=i.getByte())===-1)throw new Error("Bad block header in flate stream");if(c|=a<<8,c!==(~s&65535)&&(s!==0||c!==0))throw new Error("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;var u=this.bufferLength;e=this.ensureBuffer(u+s);var f=u+s;if(this.bufferLength=f,s===0)i.peekByte()===-1&&(this.eof=!0);else for(var l=u;l<f;++l){if((a=i.getByte())===-1){this.eof=!0;break}e[l]=a}return}var h,d;if(o===1)h=uu,d=cu;else if(o===2){var g=this.getBits(5)+257,y=this.getBits(5)+1,b=this.getBits(4)+4,m=new Uint8Array(Ai.length),S=void 0;for(S=0;S<b;++S)m[Ai[S]]=this.getBits(3);var F=this.generateHuffmanTable(m);n=0,S=0;for(var T=g+y,P=new Uint8Array(T),w=void 0,D=void 0,R=void 0;S<T;){var B=this.getCode(F);if(B===16)w=2,D=3,R=n;else if(B===17)w=3,D=3,R=n=0;else if(B===18)w=7,D=11,R=n=0;else{P[S++]=n=B;continue}for(var j=this.getBits(w)+D;j-- >0;)P[S++]=R}h=this.generateHuffmanTable(P.subarray(0,g)),d=this.generateHuffmanTable(P.subarray(g,T))}else throw new Error("Unknown block type in flate stream");e=this.buffer;for(var E=e?e.length:0,U=this.bufferLength;;){var O=this.getCode(h);if(O<256){U+1>=E&&(e=this.ensureBuffer(U+1),E=e.length),e[U++]=O;continue}if(O===256){this.bufferLength=U;return}O-=257,O=au[O];var Z=O>>16;Z>0&&(Z=this.getBits(Z)),n=(O&65535)+Z,O=this.getCode(d),O=su[O],Z=O>>16,Z>0&&(Z=this.getBits(Z));var X=(O&65535)+Z;U+n>=E&&(e=this.ensureBuffer(U+n),E=e.length);for(var N=0;N<n;++N,++U)e[U]=e[U-X]}},t.prototype.getBits=function(e){for(var n=this.stream,i=this.codeSize,o=this.codeBuf,a;i<e;){if((a=n.getByte())===-1)throw new Error("Bad encoding in flate stream");o|=a<<i,i+=8}return a=o&(1<<e)-1,this.codeBuf=o>>e,this.codeSize=i-=e,a},t.prototype.getCode=function(e){for(var n=this.stream,i=e[0],o=e[1],a=this.codeSize,s=this.codeBuf,c;a<o&&(c=n.getByte())!==-1;)s|=c<<a,a+=8;var u=i[s&(1<<o)-1];typeof i=="number"&&console.log("FLATE:",u);var f=u>>16,l=u&65535;if(f<1||a<f)throw new Error("Bad encoding in flate stream");return this.codeBuf=s>>f,this.codeSize=a-f,l},t.prototype.generateHuffmanTable=function(e){var n=e.length,i=0,o;for(o=0;o<n;++o)e[o]>i&&(i=e[o]);for(var a=1<<i,s=new Int32Array(a),c=1,u=0,f=2;c<=i;++c,u<<=1,f<<=1)for(var l=0;l<n;++l)if(e[l]===c){var h=0,d=u;for(o=0;o<c;++o)h=h<<1|d&1,d>>=1;for(o=h;o<a;o+=f)s[o]=c<<16|l;++u}return[s,i]},t}(pr),lu=function(r){A(t,r);function t(e,n,i){var o=r.call(this,n)||this;o.stream=e,o.cachedData=0,o.bitsCached=0;for(var a=4096,s={earlyChange:i,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0},c=0;c<256;++c)s.dictionaryValues[c]=c,s.dictionaryLengths[c]=1;return o.lzwState=s,o}return t.prototype.readBlock=function(){var e=512,n=e*2,i=e,o,a,s,c=this.lzwState;if(c){var u=c.earlyChange,f=c.nextCode,l=c.dictionaryValues,h=c.dictionaryLengths,d=c.dictionaryPrevCodes,g=c.codeLength,y=c.prevCode,b=c.currentSequence,m=c.currentSequenceLength,S=0,F=this.bufferLength,T=this.ensureBuffer(this.bufferLength+n);for(o=0;o<e;o++){var P=this.readBits(g),w=m>0;if(!P||P<256)b[0]=P,m=1;else if(P>=258)if(P<f)for(m=h[P],a=m-1,s=P;a>=0;a--)b[a]=l[s],s=d[s];else b[m++]=b[0];else if(P===256){g=9,f=258,m=0;continue}else{this.eof=!0,delete this.lzwState;break}if(w&&(d[f]=y,h[f]=h[y]+1,l[f]=b[0],f++,g=f+u&f+u-1?g:Math.min(Math.log(f+u)/.6931471805599453+1,12)|0),y=P,S+=m,n<S){do n+=i;while(n<S);T=this.ensureBuffer(this.bufferLength+n)}for(a=0;a<m;a++)T[F++]=b[a]}c.nextCode=f,c.codeLength=g,c.prevCode=y,c.currentSequenceLength=m,this.bufferLength=F}},t.prototype.readBits=function(e){for(var n=this.bitsCached,i=this.cachedData;n<e;){var o=this.stream.getByte();if(o===-1)return this.eof=!0,null;i=i<<8|o,n+=8}return this.bitsCached=n-=e,this.cachedData=i,i>>>n&(1<<e)-1},t}(pr),hu=function(r){A(t,r);function t(e,n){var i=r.call(this,n)||this;return i.stream=e,i}return t.prototype.readBlock=function(){var e=this.stream.getBytes(2);if(!e||e.length<2||e[0]===128){this.eof=!0;return}var n,i=this.bufferLength,o=e[0];if(o<128){if(n=this.ensureBuffer(i+o+1),n[i++]=e[1],o>0){var a=this.stream.getBytes(o);n.set(a,i),i+=o}}else{o=257-o;var s=e[1];n=this.ensureBuffer(i+o+1);for(var c=0;c<o;c++)n[i++]=s}this.bufferLength=i},t}(pr),Oi=function(r,t,e){if(t===v.of("FlateDecode"))return new fu(r);if(t===v.of("LZWDecode")){var n=1;if(e instanceof H){var i=e.lookup(v.of("EarlyChange"));i instanceof W&&(n=i.asNumber())}return new lu(r,void 0,n)}if(t===v.of("ASCII85Decode"))return new iu(r);if(t===v.of("ASCIIHexDecode"))return new ou(r);if(t===v.of("RunLengthDecode"))return new hu(r);throw new Fs(t.asString())},So=function(r){var t=r.dict,e=r.contents,n=new Fo(e),i=t.lookup(v.of("Filter")),o=t.lookup(v.of("DecodeParms"));if(i instanceof v)n=Oi(n,i,o);else if(i instanceof nt)for(var a=0,s=i.size();a<s;a++)n=Oi(n,i.lookup(a,v),o&&o.lookupMaybe(a,H));else if(i)throw new Wr([v,nt],i);return n},du=function(r){var t=r.MediaBox(),e=t.lookup(2,W).asNumber()-t.lookup(0,W).asNumber(),n=t.lookup(3,W).asNumber()-t.lookup(1,W).asNumber();return{left:0,bottom:0,right:e,top:n}},vu=function(r){return[1,0,0,1,-r.left,-r.bottom]},wo=function(){function r(t,e,n){this.page=t;var i=e??du(t);this.width=i.right-i.left,this.height=i.top-i.bottom,this.boundingBox=i,this.transformationMatrix=n??vu(i)}return r.for=function(t,e,n){return Y(this,void 0,void 0,function(){return J(this,function(i){return[2,new r(t,e,n)]})})},r.prototype.embedIntoContext=function(t,e){return Y(this,void 0,void 0,function(){var n,i,o,a,s,c,u,f,l,h;return J(this,function(d){if(n=this.page.normalizedEntries(),i=n.Contents,o=n.Resources,!i)throw new Ss;return a=this.decodeContents(i),s=this.boundingBox,c=s.left,u=s.bottom,f=s.right,l=s.top,h=t.flateStream(a,{Type:"XObject",Subtype:"Form",FormType:1,BBox:[c,u,f,l],Matrix:this.transformationMatrix,Resources:o}),e?(t.assign(e,h),[2,e]):[2,t.register(h)]})})},r.prototype.decodeContents=function(t){for(var e=Uint8Array.of(p.Newline),n=[],i=0,o=t.size();i<o;i++){var a=t.lookup(i,At),s=void 0;if(a instanceof ar)s=So(a).decode();else if(a instanceof _e)s=a.getUnencodedContents();else throw new ws(a);n.push(s,e)}return pa.apply(void 0,n)},r}(),Dr=function(r,t){if(r!==void 0)return t[r]},$e;(function(r){r.UseNone="UseNone",r.UseOutlines="UseOutlines",r.UseThumbs="UseThumbs",r.UseOC="UseOC"})($e||($e={}));var tr;(function(r){r.L2R="L2R",r.R2L="R2L"})(tr||(tr={}));var er;(function(r){r.None="None",r.AppDefault="AppDefault"})(er||(er={}));var Gr;(function(r){r.Simplex="Simplex",r.DuplexFlipShortEdge="DuplexFlipShortEdge",r.DuplexFlipLongEdge="DuplexFlipLongEdge"})(Gr||(Gr={}));var Ri=function(){function r(t){this.dict=t}return r.prototype.lookupBool=function(t){var e=this.dict.lookup(v.of(t));if(e instanceof or)return e},r.prototype.lookupName=function(t){var e=this.dict.lookup(v.of(t));if(e instanceof v)return e},r.prototype.HideToolbar=function(){return this.lookupBool("HideToolbar")},r.prototype.HideMenubar=function(){return this.lookupBool("HideMenubar")},r.prototype.HideWindowUI=function(){return this.lookupBool("HideWindowUI")},r.prototype.FitWindow=function(){return this.lookupBool("FitWindow")},r.prototype.CenterWindow=function(){return this.lookupBool("CenterWindow")},r.prototype.DisplayDocTitle=function(){return this.lookupBool("DisplayDocTitle")},r.prototype.NonFullScreenPageMode=function(){return this.lookupName("NonFullScreenPageMode")},r.prototype.Direction=function(){return this.lookupName("Direction")},r.prototype.PrintScaling=function(){return this.lookupName("PrintScaling")},r.prototype.Duplex=function(){return this.lookupName("Duplex")},r.prototype.PickTrayByPDFSize=function(){return this.lookupBool("PickTrayByPDFSize")},r.prototype.PrintPageRange=function(){var t=this.dict.lookup(v.of("PrintPageRange"));if(t instanceof nt)return t},r.prototype.NumCopies=function(){var t=this.dict.lookup(v.of("NumCopies"));if(t instanceof W)return t},r.prototype.getHideToolbar=function(){var t,e;return(e=(t=this.HideToolbar())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getHideMenubar=function(){var t,e;return(e=(t=this.HideMenubar())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getHideWindowUI=function(){var t,e;return(e=(t=this.HideWindowUI())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getFitWindow=function(){var t,e;return(e=(t=this.FitWindow())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getCenterWindow=function(){var t,e;return(e=(t=this.CenterWindow())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getDisplayDocTitle=function(){var t,e;return(e=(t=this.DisplayDocTitle())===null||t===void 0?void 0:t.asBoolean())!==null&&e!==void 0?e:!1},r.prototype.getNonFullScreenPageMode=function(){var t,e,n=(t=this.NonFullScreenPageMode())===null||t===void 0?void 0:t.decodeText();return(e=Dr(n,$e))!==null&&e!==void 0?e:$e.UseNone},r.prototype.getReadingDirection=function(){var t,e,n=(t=this.Direction())===null||t===void 0?void 0:t.decodeText();return(e=Dr(n,tr))!==null&&e!==void 0?e:tr.L2R},r.prototype.getPrintScaling=function(){var t,e,n=(t=this.PrintScaling())===null||t===void 0?void 0:t.decodeText();return(e=Dr(n,er))!==null&&e!==void 0?e:er.AppDefault},r.prototype.getDuplex=function(){var t,e=(t=this.Duplex())===null||t===void 0?void 0:t.decodeText();return Dr(e,Gr)},r.prototype.getPickTrayByPDFSize=function(){var t;return(t=this.PickTrayByPDFSize())===null||t===void 0?void 0:t.asBoolean()},r.prototype.getPrintPageRange=function(){var t=this.PrintPageRange();if(!t)return[];for(var e=[],n=0;n<t.size();n+=2){var i=t.lookup(n,W).asNumber(),o=t.lookup(n+1,W).asNumber();e.push({start:i,end:o})}return e},r.prototype.getNumCopies=function(){var t,e;return(e=(t=this.NumCopies())===null||t===void 0?void 0:t.asNumber())!==null&&e!==void 0?e:1},r.prototype.setHideToolbar=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("HideToolbar"),e)},r.prototype.setHideMenubar=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("HideMenubar"),e)},r.prototype.setHideWindowUI=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("HideWindowUI"),e)},r.prototype.setFitWindow=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("FitWindow"),e)},r.prototype.setCenterWindow=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("CenterWindow"),e)},r.prototype.setDisplayDocTitle=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("DisplayDocTitle"),e)},r.prototype.setNonFullScreenPageMode=function(t){ie(t,"nonFullScreenPageMode",$e);var e=v.of(t);this.dict.set(v.of("NonFullScreenPageMode"),e)},r.prototype.setReadingDirection=function(t){ie(t,"readingDirection",tr);var e=v.of(t);this.dict.set(v.of("Direction"),e)},r.prototype.setPrintScaling=function(t){ie(t,"printScaling",er);var e=v.of(t);this.dict.set(v.of("PrintScaling"),e)},r.prototype.setDuplex=function(t){ie(t,"duplex",Gr);var e=v.of(t);this.dict.set(v.of("Duplex"),e)},r.prototype.setPickTrayByPDFSize=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("PickTrayByPDFSize"),e)},r.prototype.setPrintPageRange=function(t){Array.isArray(t)||(t=[t]);for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n].start),e.push(t[n].end);fo(e,"printPageRange",["number"]);var o=this.dict.context.obj(e);this.dict.set(v.of("PrintPageRange"),o)},r.prototype.setNumCopies=function(t){Dt(t,"numCopies",1,Number.MAX_VALUE),xs(t,"numCopies");var e=this.dict.context.obj(t);this.dict.set(v.of("NumCopies"),e)},r.fromDict=function(t){return new r(t)},r.create=function(t){var e=t.obj({});return new r(e)},r}(),pu=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/,Co=function(){function r(t,e){this.dict=t,this.ref=e}return r.prototype.T=function(){return this.dict.lookupMaybe(v.of("T"),at,V)},r.prototype.Ff=function(){var t=this.getInheritableAttribute(v.of("Ff"));return this.dict.context.lookupMaybe(t,W)},r.prototype.V=function(){var t=this.getInheritableAttribute(v.of("V"));return this.dict.context.lookup(t)},r.prototype.Kids=function(){return this.dict.lookupMaybe(v.of("Kids"),nt)},r.prototype.DA=function(){var t=this.dict.lookup(v.of("DA"));if(t instanceof at||t instanceof V)return t},r.prototype.setKids=function(t){this.dict.set(v.of("Kids"),this.dict.context.obj(t))},r.prototype.getParent=function(){var t=this.dict.get(v.of("Parent"));if(t instanceof st){var e=this.dict.lookup(v.of("Parent"),H);return new r(e,t)}},r.prototype.setParent=function(t){t?this.dict.set(v.of("Parent"),t):this.dict.delete(v.of("Parent"))},r.prototype.getFullyQualifiedName=function(){var t=this.getParent();return t?t.getFullyQualifiedName()+"."+this.getPartialName():this.getPartialName()},r.prototype.getPartialName=function(){var t;return(t=this.T())===null||t===void 0?void 0:t.decodeText()},r.prototype.setPartialName=function(t){t?this.dict.set(v.of("T"),V.fromText(t)):this.dict.delete(v.of("T"))},r.prototype.setDefaultAppearance=function(t){this.dict.set(v.of("DA"),at.of(t))},r.prototype.getDefaultAppearance=function(){var t=this.DA();return t instanceof V?t.decodeText():t==null?void 0:t.asString()},r.prototype.setFontSize=function(t){var e,n=(e=this.getFullyQualifiedName())!==null&&e!==void 0?e:"",i=this.getDefaultAppearance();if(!i)throw new Ds(n);var o=Vn(i,pu);if(!o.match)throw new ks(n);var a=i.slice(0,o.pos-o.match[0].length),s=o.pos<=i.length?i.slice(o.pos):"",c=o.match[1],u=a+" /"+c+" "+t+" Tf "+s;this.setDefaultAppearance(u)},r.prototype.getFlags=function(){var t,e;return(e=(t=this.Ff())===null||t===void 0?void 0:t.asNumber())!==null&&e!==void 0?e:0},r.prototype.setFlags=function(t){this.dict.set(v.of("Ff"),W.of(t))},r.prototype.hasFlag=function(t){var e=this.getFlags();return(e&t)!==0},r.prototype.setFlag=function(t){var e=this.getFlags();this.setFlags(e|t)},r.prototype.clearFlag=function(t){var e=this.getFlags();this.setFlags(e&~t)},r.prototype.setFlagTo=function(t,e){e?this.setFlag(t):this.clearFlag(t)},r.prototype.getInheritableAttribute=function(t){var e;return this.ascend(function(n){e||(e=n.dict.get(t))}),e},r.prototype.ascend=function(t){t(this);var e=this.getParent();e&&e.ascend(t)},r}(),Cn=function(){function r(t){this.dict=t}return r.prototype.W=function(){var t=this.dict.lookup(v.of("W"));if(t instanceof W)return t},r.prototype.getWidth=function(){var t,e;return(e=(t=this.W())===null||t===void 0?void 0:t.asNumber())!==null&&e!==void 0?e:1},r.prototype.setWidth=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("W"),e)},r.fromDict=function(t){return new r(t)},r}(),gu=function(){function r(t){this.dict=t}return r.prototype.Rect=function(){return this.dict.lookup(v.of("Rect"),nt)},r.prototype.AP=function(){return this.dict.lookupMaybe(v.of("AP"),H)},r.prototype.F=function(){var t=this.dict.lookup(v.of("F"));return this.dict.context.lookupMaybe(t,W)},r.prototype.getRectangle=function(){var t,e=this.Rect();return(t=e==null?void 0:e.asRectangle())!==null&&t!==void 0?t:{x:0,y:0,width:0,height:0}},r.prototype.setRectangle=function(t){var e=t.x,n=t.y,i=t.width,o=t.height,a=this.dict.context.obj([e,n,e+i,n+o]);this.dict.set(v.of("Rect"),a)},r.prototype.getAppearanceState=function(){var t=this.dict.lookup(v.of("AS"));if(t instanceof v)return t},r.prototype.setAppearanceState=function(t){this.dict.set(v.of("AS"),t)},r.prototype.setAppearances=function(t){this.dict.set(v.of("AP"),t)},r.prototype.ensureAP=function(){var t=this.AP();return t||(t=this.dict.context.obj({}),this.dict.set(v.of("AP"),t)),t},r.prototype.getNormalAppearance=function(){var t=this.ensureAP(),e=t.get(v.of("N"));if(e instanceof st||e instanceof H)return e;throw new Error("Unexpected N type: "+(e==null?void 0:e.constructor.name))},r.prototype.setNormalAppearance=function(t){var e=this.ensureAP();e.set(v.of("N"),t)},r.prototype.setRolloverAppearance=function(t){var e=this.ensureAP();e.set(v.of("R"),t)},r.prototype.setDownAppearance=function(t){var e=this.ensureAP();e.set(v.of("D"),t)},r.prototype.removeRolloverAppearance=function(){var t=this.AP();t==null||t.delete(v.of("R"))},r.prototype.removeDownAppearance=function(){var t=this.AP();t==null||t.delete(v.of("D"))},r.prototype.getAppearances=function(){var t=this.AP();if(t){var e=t.lookup(v.of("N"),H,At),n=t.lookupMaybe(v.of("R"),H,At),i=t.lookupMaybe(v.of("D"),H,At);return{normal:e,rollover:n,down:i}}},r.prototype.getFlags=function(){var t,e;return(e=(t=this.F())===null||t===void 0?void 0:t.asNumber())!==null&&e!==void 0?e:0},r.prototype.setFlags=function(t){this.dict.set(v.of("F"),W.of(t))},r.prototype.hasFlag=function(t){var e=this.getFlags();return(e&t)!==0},r.prototype.setFlag=function(t){var e=this.getFlags();this.setFlags(e|t)},r.prototype.clearFlag=function(t){var e=this.getFlags();this.setFlags(e&~t)},r.prototype.setFlagTo=function(t,e){e?this.setFlag(t):this.clearFlag(t)},r.fromDict=function(t){return new r(t)},r}(),Pn=function(){function r(t){this.dict=t}return r.prototype.R=function(){var t=this.dict.lookup(v.of("R"));if(t instanceof W)return t},r.prototype.BC=function(){var t=this.dict.lookup(v.of("BC"));if(t instanceof nt)return t},r.prototype.BG=function(){var t=this.dict.lookup(v.of("BG"));if(t instanceof nt)return t},r.prototype.CA=function(){var t=this.dict.lookup(v.of("CA"));if(t instanceof V||t instanceof at)return t},r.prototype.RC=function(){var t=this.dict.lookup(v.of("RC"));if(t instanceof V||t instanceof at)return t},r.prototype.AC=function(){var t=this.dict.lookup(v.of("AC"));if(t instanceof V||t instanceof at)return t},r.prototype.getRotation=function(){var t;return(t=this.R())===null||t===void 0?void 0:t.asNumber()},r.prototype.getBorderColor=function(){var t=this.BC();if(t){for(var e=[],n=0,i=t==null?void 0:t.size();n<i;n++){var o=t.get(n);o instanceof W&&e.push(o.asNumber())}return e}},r.prototype.getBackgroundColor=function(){var t=this.BG();if(t){for(var e=[],n=0,i=t==null?void 0:t.size();n<i;n++){var o=t.get(n);o instanceof W&&e.push(o.asNumber())}return e}},r.prototype.getCaptions=function(){var t=this.CA(),e=this.RC(),n=this.AC();return{normal:t==null?void 0:t.decodeText(),rollover:e==null?void 0:e.decodeText(),down:n==null?void 0:n.decodeText()}},r.prototype.setRotation=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("R"),e)},r.prototype.setBorderColor=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("BC"),e)},r.prototype.setBackgroundColor=function(t){var e=this.dict.context.obj(t);this.dict.set(v.of("BG"),e)},r.prototype.setCaptions=function(t){var e=V.fromText(t.normal);if(this.dict.set(v.of("CA"),e),t.rollover){var n=V.fromText(t.rollover);this.dict.set(v.of("RC"),n)}else this.dict.delete(v.of("RC"));if(t.down){var i=V.fromText(t.down);this.dict.set(v.of("AC"),i)}else this.dict.delete(v.of("AC"))},r.fromDict=function(t){return new r(t)},r}(),En=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.MK=function(){var e=this.dict.lookup(v.of("MK"));if(e instanceof H)return e},t.prototype.BS=function(){var e=this.dict.lookup(v.of("BS"));if(e instanceof H)return e},t.prototype.DA=function(){var e=this.dict.lookup(v.of("DA"));if(e instanceof at||e instanceof V)return e},t.prototype.P=function(){var e=this.dict.get(v.of("P"));if(e instanceof st)return e},t.prototype.setP=function(e){this.dict.set(v.of("P"),e)},t.prototype.setDefaultAppearance=function(e){this.dict.set(v.of("DA"),at.of(e))},t.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof V?e.decodeText():e==null?void 0:e.asString()},t.prototype.getAppearanceCharacteristics=function(){var e=this.MK();if(e)return Pn.fromDict(e)},t.prototype.getOrCreateAppearanceCharacteristics=function(){var e=this.MK();if(e)return Pn.fromDict(e);var n=Pn.fromDict(this.dict.context.obj({}));return this.dict.set(v.of("MK"),n.dict),n},t.prototype.getBorderStyle=function(){var e=this.BS();if(e)return Cn.fromDict(e)},t.prototype.getOrCreateBorderStyle=function(){var e=this.BS();if(e)return Cn.fromDict(e);var n=Cn.fromDict(this.dict.context.obj({}));return this.dict.set(v.of("BS"),n.dict),n},t.prototype.getOnValue=function(){var e,n=(e=this.getAppearances())===null||e===void 0?void 0:e.normal;if(n instanceof H)for(var i=n.keys(),o=0,a=i.length;o<a;o++){var s=i[o];if(s!==v.of("Off"))return s}},t.fromDict=function(e){return new t(e)},t.create=function(e,n){var i=e.obj({Type:"Annot",Subtype:"Widget",Rect:[0,0,0,0],Parent:n});return new t(i)},t}(gu),Be=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.FT=function(){var e=this.getInheritableAttribute(v.of("FT"));return this.dict.context.lookup(e,v)},t.prototype.getWidgets=function(){var e=this.Kids();if(!e)return[En.fromDict(this.dict)];for(var n=new Array(e.size()),i=0,o=e.size();i<o;i++){var a=e.lookup(i,H);n[i]=En.fromDict(a)}return n},t.prototype.addWidget=function(e){var n=this.normalizedEntries().Kids;n.push(e)},t.prototype.removeWidget=function(e){var n=this.Kids();if(n){if(e<0||e>n.size())throw new qr(e,0,n.size());n.remove(e)}else{if(e!==0)throw new qr(e,0,0);this.setKids([])}},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([this.ref]),this.dict.set(v.of("Kids"),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t}(Co),Yn=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.Opt=function(){return this.dict.lookupMaybe(v.of("Opt"),at,V,nt)},t.prototype.setOpt=function(e){this.dict.set(v.of("Opt"),this.dict.context.obj(e))},t.prototype.getExportValues=function(){var e=this.Opt();if(e){if(e instanceof at||e instanceof V)return[e];for(var n=[],i=0,o=e.size();i<o;i++){var a=e.lookup(i);(a instanceof at||a instanceof V)&&n.push(a)}return n}},t.prototype.removeExportValue=function(e){var n=this.Opt();if(n)if(n instanceof at||n instanceof V){if(e!==0)throw new qr(e,0,0);this.setOpt([])}else{if(e<0||e>n.size())throw new qr(e,0,n.size());n.remove(e)}},t.prototype.normalizeExportValues=function(){for(var e,n,i,o,a=(e=this.getExportValues())!==null&&e!==void 0?e:[],s=[],c=this.getWidgets(),u=0,f=c.length;u<f;u++){var l=c[u],h=(n=a[u])!==null&&n!==void 0?n:V.fromText((o=(i=l.getOnValue())===null||i===void 0?void 0:i.decodeText())!==null&&o!==void 0?o:"");s.push(h)}this.setOpt(s)},t.prototype.addOpt=function(e,n){var i;this.normalizeExportValues();var o=e.decodeText(),a;if(n)for(var s=(i=this.getExportValues())!==null&&i!==void 0?i:[],c=0,u=s.length;c<u;c++){var f=s[c];f.decodeText()===o&&(a=c)}var l=this.Opt();return l.push(e),a??l.size()-1},t.prototype.addWidgetWithOpt=function(e,n,i){var o=this.addOpt(n,i),a=v.of(String(o));return this.addWidget(e),a},t}(Be),an=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.setValue=function(e){var n,i=(n=this.getOnValue())!==null&&n!==void 0?n:v.of("Yes");if(e!==i&&e!==v.of("Off"))throw new Gn;this.dict.set(v.of("V"),e);for(var o=this.getWidgets(),a=0,s=o.length;a<s;a++){var c=o[a],u=c.getOnValue()===e?e:v.of("Off");c.setAppearanceState(u)}},t.prototype.getValue=function(){var e=this.V();return e instanceof v?e:v.of("Off")},t.prototype.getOnValue=function(){var e=this.getWidgets()[0];return e==null?void 0:e.getOnValue()},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Btn",Kids:[]}),i=e.register(n);return new t(n,i)},t}(Yn),dt=function(r){return 1<<r},qt;(function(r){r[r.ReadOnly=dt(0)]="ReadOnly",r[r.Required=dt(1)]="Required",r[r.NoExport=dt(2)]="NoExport"})(qt||(qt={}));var jt;(function(r){r[r.NoToggleToOff=dt(14)]="NoToggleToOff",r[r.Radio=dt(15)]="Radio",r[r.PushButton=dt(16)]="PushButton",r[r.RadiosInUnison=dt(25)]="RadiosInUnison"})(jt||(jt={}));var ft;(function(r){r[r.Multiline=dt(12)]="Multiline",r[r.Password=dt(13)]="Password",r[r.FileSelect=dt(20)]="FileSelect",r[r.DoNotSpellCheck=dt(22)]="DoNotSpellCheck",r[r.DoNotScroll=dt(23)]="DoNotScroll",r[r.Comb=dt(24)]="Comb",r[r.RichText=dt(25)]="RichText"})(ft||(ft={}));var ot;(function(r){r[r.Combo=dt(17)]="Combo",r[r.Edit=dt(18)]="Edit",r[r.Sort=dt(19)]="Sort",r[r.MultiSelect=dt(21)]="MultiSelect",r[r.DoNotSpellCheck=dt(22)]="DoNotSpellCheck",r[r.CommitOnSelChange=dt(26)]="CommitOnSelChange"})(ot||(ot={}));var Po=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.setValues=function(e){if(this.hasFlag(ot.Combo)&&!this.hasFlag(ot.Edit)&&!this.valuesAreValid(e))throw new Gn;if(e.length===0&&this.dict.delete(v.of("V")),e.length===1&&this.dict.set(v.of("V"),e[0]),e.length>1){if(!this.hasFlag(ot.MultiSelect))throw new Ts;this.dict.set(v.of("V"),this.dict.context.obj(e))}this.updateSelectedIndices(e)},t.prototype.valuesAreValid=function(e){for(var n=this.getOptions(),i=function(c,u){var f=e[c].decodeText();if(!n.find(function(l){return f===(l.display||l.value).decodeText()}))return{value:!1}},o=0,a=e.length;o<a;o++){var s=i(o);if(typeof s=="object")return s.value}return!0},t.prototype.updateSelectedIndices=function(e){if(e.length>1){for(var n=new Array(e.length),i=this.getOptions(),o=function(c,u){var f=e[c].decodeText();n[c]=i.findIndex(function(l){return f===(l.display||l.value).decodeText()})},a=0,s=e.length;a<s;a++)o(a,s);this.dict.set(v.of("I"),this.dict.context.obj(n.sort()))}else this.dict.delete(v.of("I"))},t.prototype.getValues=function(){var e=this.V();if(e instanceof at||e instanceof V)return[e];if(e instanceof nt){for(var n=[],i=0,o=e.size();i<o;i++){var a=e.lookup(i);(a instanceof at||a instanceof V)&&n.push(a)}return n}return[]},t.prototype.Opt=function(){return this.dict.lookupMaybe(v.of("Opt"),at,V,nt)},t.prototype.setOptions=function(e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var a=e[i],s=a.value,c=a.display;n[i]=this.dict.context.obj([s,c||s])}this.dict.set(v.of("Opt"),this.dict.context.obj(n))},t.prototype.getOptions=function(){var e=this.Opt();if(e instanceof at||e instanceof V)return[{value:e,display:e}];if(e instanceof nt){for(var n=[],i=0,o=e.size();i<o;i++){var a=e.lookup(i);if((a instanceof at||a instanceof V)&&n.push({value:a,display:a}),a instanceof nt&&a.size()>0){var s=a.lookup(0,at,V),c=a.lookupMaybe(1,at,V);n.push({value:s,display:c||s})}}return n}return[]},t}(Be),sn=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Ch",Ff:ot.Combo,Kids:[]}),i=e.register(n);return new t(n,i)},t}(Po),Lr=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.addField=function(e){var n=this.normalizedEntries().Kids;n==null||n.push(e)},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([]),this.dict.set(v.of("Kids"),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({}),i=e.register(n);return new t(n,i)},t}(Co),Jn=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t}(Be),un=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.MaxLen=function(){var e=this.dict.lookup(v.of("MaxLen"));if(e instanceof W)return e},t.prototype.Q=function(){var e=this.dict.lookup(v.of("Q"));if(e instanceof W)return e},t.prototype.setMaxLength=function(e){this.dict.set(v.of("MaxLen"),W.of(e))},t.prototype.removeMaxLength=function(){this.dict.delete(v.of("MaxLen"))},t.prototype.getMaxLength=function(){var e;return(e=this.MaxLen())===null||e===void 0?void 0:e.asNumber()},t.prototype.setQuadding=function(e){this.dict.set(v.of("Q"),W.of(e))},t.prototype.getQuadding=function(){var e;return(e=this.Q())===null||e===void 0?void 0:e.asNumber()},t.prototype.setValue=function(e){this.dict.set(v.of("V"),e)},t.prototype.removeValue=function(){this.dict.delete(v.of("V"))},t.prototype.getValue=function(){var e=this.V();if(e instanceof at||e instanceof V)return e},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Tx",Kids:[]}),i=e.register(n);return new t(n,i)},t}(Be),cn=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Btn",Ff:jt.PushButton,Kids:[]}),i=e.register(n);return new t(n,i)},t}(Yn),fn=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.setValue=function(e){var n=this.getOnValues();if(!n.includes(e)&&e!==v.of("Off"))throw new Gn;this.dict.set(v.of("V"),e);for(var i=this.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o],c=s.getOnValue()===e?e:v.of("Off");s.setAppearanceState(c)}},t.prototype.getValue=function(){var e=this.V();return e instanceof v?e:v.of("Off")},t.prototype.getOnValues=function(){for(var e=this.getWidgets(),n=[],i=0,o=e.length;i<o;i++){var a=e[i].getOnValue();a&&n.push(a)}return n},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Btn",Ff:jt.Radio,Kids:[]}),i=e.register(n);return new t(n,i)},t}(Yn),ln=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:"Ch",Kids:[]}),i=e.register(n);return new t(n,i)},t}(Po),Qn=function(r){if(!r)return[];for(var t=[],e=0,n=r.size();e<n;e++){var i=r.get(e),o=r.lookup(e);i instanceof st&&o instanceof H&&t.push([To(o,i),i])}return t},To=function(r,t){var e=yu(r);return e?Lr.fromDict(r,t):mu(r,t)},yu=function(r){var t=r.lookup(v.of("Kids"));if(t instanceof nt)for(var e=0,n=t.size();e<n;e++){var i=t.lookup(e),o=i instanceof H&&i.has(v.of("T"));if(o)return!0}return!1},mu=function(r,t){var e=_n(r,v.of("FT")),n=r.context.lookup(e,v);return n===v.of("Btn")?bu(r,t):n===v.of("Ch")?xu(r,t):n===v.of("Tx")?un.fromDict(r,t):n===v.of("Sig")?Jn.fromDict(r,t):Be.fromDict(r,t)},bu=function(r,t){var e,n=_n(r,v.of("Ff")),i=r.context.lookupMaybe(n,W),o=(e=i==null?void 0:i.asNumber())!==null&&e!==void 0?e:0;return jn(o,jt.PushButton)?cn.fromDict(r,t):jn(o,jt.Radio)?fn.fromDict(r,t):an.fromDict(r,t)},xu=function(r,t){var e,n=_n(r,v.of("Ff")),i=r.context.lookupMaybe(n,W),o=(e=i==null?void 0:i.asNumber())!==null&&e!==void 0?e:0;return jn(o,ot.Combo)?sn.fromDict(r,t):ln.fromDict(r,t)},jn=function(r,t){return(r&t)!==0},_n=function(r,t){var e;return Do(r,function(n){e||(e=n.get(t))}),e},Do=function(r,t){t(r);var e=r.lookupMaybe(v.of("Parent"),H);e&&Do(e,t)},Xr=function(){function r(t){this.dict=t}return r.prototype.Fields=function(){var t=this.dict.lookup(v.of("Fields"));if(t instanceof nt)return t},r.prototype.getFields=function(){for(var t=this.normalizedEntries().Fields,e=new Array(t.size()),n=0,i=t.size();n<i;n++){var o=t.get(n),a=t.lookup(n,H);e[n]=[To(a,o),o]}return e},r.prototype.getAllFields=function(){var t=[],e=function(n){if(n)for(var i=0,o=n.length;i<o;i++){var a=n[i];t.push(a);var s=a[0];s instanceof Lr&&e(Qn(s.Kids()))}};return e(this.getFields()),t},r.prototype.addField=function(t){var e=this.normalizedEntries().Fields;e==null||e.push(t)},r.prototype.removeField=function(t){var e=t.getParent(),n=e===void 0?this.normalizedEntries().Fields:e.Kids(),i=n==null?void 0:n.indexOf(t.ref);if(n===void 0||i===void 0)throw new Error("Tried to remove inexistent field "+t.getFullyQualifiedName());n.remove(i),e!==void 0&&n.size()===0&&this.removeField(e)},r.prototype.normalizedEntries=function(){var t=this.Fields();return t||(t=this.dict.context.obj([]),this.dict.set(v.of("Fields"),t)),{Fields:t}},r.fromDict=function(t){return new r(t)},r.create=function(t){var e=t.obj({Fields:[]});return new r(e)},r}(),ko=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.Pages=function(){return this.lookup(v.of("Pages"),H)},t.prototype.AcroForm=function(){return this.lookupMaybe(v.of("AcroForm"),H)},t.prototype.getAcroForm=function(){var e=this.AcroForm();if(e)return Xr.fromDict(e)},t.prototype.getOrCreateAcroForm=function(){var e=this.getAcroForm();if(!e){e=Xr.create(this.context);var n=this.context.register(e.dict);this.set(v.of("AcroForm"),n)}return e},t.prototype.ViewerPreferences=function(){return this.lookupMaybe(v.of("ViewerPreferences"),H)},t.prototype.getViewerPreferences=function(){var e=this.ViewerPreferences();if(e)return Ri.fromDict(e)},t.prototype.getOrCreateViewerPreferences=function(){var e=this.getViewerPreferences();if(!e){e=Ri.create(this.context);var n=this.context.register(e.dict);this.set(v.of("ViewerPreferences"),n)}return e},t.prototype.insertLeafNode=function(e,n){var i=this.get(v.of("Pages")),o=this.Pages().insertLeafNode(e,n);return o||i},t.prototype.removeLeafNode=function(e){this.Pages().removeLeafNode(e)},t.withContextAndPages=function(e,n){var i=new Map;return i.set(v.of("Type"),v.of("Catalog")),i.set(v.of("Pages"),n),new t(i,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(H),Ao=function(r){A(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.Parent=function(){return this.lookup(v.of("Parent"))},t.prototype.Kids=function(){return this.lookup(v.of("Kids"),nt)},t.prototype.Count=function(){return this.lookup(v.of("Count"),W)},t.prototype.pushTreeNode=function(e){var n=this.Kids();n.push(e)},t.prototype.pushLeafNode=function(e){var n=this.Kids();this.insertLeafKid(n.size(),e)},t.prototype.insertLeafNode=function(e,n){var i=this.Kids(),o=this.Count().asNumber();if(n>o)throw new mi(n,o);for(var a=n,s=0,c=i.size();s<c;s++){if(a===0){this.insertLeafKid(s,e);return}var u=i.get(s),f=this.context.lookup(u);if(f instanceof t){if(f.Count().asNumber()>a)return f.insertLeafNode(e,a)||u;a-=f.Count().asNumber()}f instanceof Jt&&(a-=1)}if(a===0){this.insertLeafKid(i.size(),e);return}throw new bi(n,"insertLeafNode")},t.prototype.removeLeafNode=function(e,n){n===void 0&&(n=!0);var i=this.Kids(),o=this.Count().asNumber();if(e>=o)throw new mi(e,o);for(var a=e,s=0,c=i.size();s<c;s++){var u=i.get(s),f=this.context.lookup(u);if(f instanceof t)if(f.Count().asNumber()>a){f.removeLeafNode(a,n),n&&f.Kids().size()===0&&i.remove(s);return}else a-=f.Count().asNumber();if(f instanceof Jt)if(a===0){this.removeKid(s);return}else a-=1}throw new bi(e,"removeLeafNode")},t.prototype.ascend=function(e){e(this);var n=this.Parent();n&&n.ascend(e)},t.prototype.traverse=function(e){for(var n=this.Kids(),i=0,o=n.size();i<o;i++){var a=n.get(i),s=this.context.lookup(a);s instanceof t&&s.traverse(e),e(s,a)}},t.prototype.insertLeafKid=function(e,n){var i=this.Kids();this.ascend(function(o){var a=o.Count().asNumber()+1;o.set(v.of("Count"),W.of(a))}),i.insert(e,n)},t.prototype.removeKid=function(e){var n=this.Kids(),i=n.lookup(e);i instanceof Jt&&this.ascend(function(o){var a=o.Count().asNumber()-1;o.set(v.of("Count"),W.of(a))}),n.remove(e)},t.withContext=function(e,n){var i=new Map;return i.set(v.of("Type"),v.of("Pages")),i.set(v.of("Kids"),e.obj([])),i.set(v.of("Count"),e.obj(0)),n&&i.set(v.of("Parent"),n),new t(i,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(H),Ft=new Uint8Array(256);Ft[p.Zero]=1;Ft[p.One]=1;Ft[p.Two]=1;Ft[p.Three]=1;Ft[p.Four]=1;Ft[p.Five]=1;Ft[p.Six]=1;Ft[p.Seven]=1;Ft[p.Eight]=1;Ft[p.Nine]=1;var hn=new Uint8Array(256);hn[p.Period]=1;hn[p.Plus]=1;hn[p.Minus]=1;var $n=new Uint8Array(256);for(var Ve=0,Fu=256;Ve<Fu;Ve++)$n[Ve]=Ft[Ve]||hn[Ve]?1:0;var Bi=p.Newline,Ei=p.CarriageReturn,Su=function(){function r(t,e){e===void 0&&(e=!1),this.bytes=t,this.capNumbers=e}return r.prototype.parseRawInt=function(){for(var t="";!this.bytes.done();){var e=this.bytes.peek();if(!Ft[e])break;t+=Zt(this.bytes.next())}var n=Number(t);if(!t||!isFinite(n))throw new xi(this.bytes.position(),t);return n},r.prototype.parseRawNumber=function(){for(var t="";!this.bytes.done();){var e=this.bytes.peek();if(!$n[e]||(t+=Zt(this.bytes.next()),e===p.Period))break}for(;!this.bytes.done();){var e=this.bytes.peek();if(!Ft[e])break;t+=Zt(this.bytes.next())}var n=Number(t);if(!t||!isFinite(n))throw new xi(this.bytes.position(),t);if(n>Number.MAX_SAFE_INTEGER)if(this.capNumbers){var i="Parsed number that is too large for some PDF readers: "+t+", using Number.MAX_SAFE_INTEGER instead.";return console.warn(i),Number.MAX_SAFE_INTEGER}else{var i="Parsed number that is too large for some PDF readers: "+t+", not capping.";console.warn(i)}return n},r.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&_t[this.bytes.peek()];)this.bytes.next()},r.prototype.skipLine=function(){for(;!this.bytes.done();){var t=this.bytes.peek();if(t===Bi||t===Ei)return;this.bytes.next()}},r.prototype.skipComment=function(){if(this.bytes.peek()!==p.Percent)return!1;for(;!this.bytes.done();){var t=this.bytes.peek();if(t===Bi||t===Ei)return!0;this.bytes.next()}return!0},r.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},r.prototype.matchKeyword=function(t){for(var e=this.bytes.offset(),n=0,i=t.length;n<i;n++)if(this.bytes.done()||this.bytes.next()!==t[n])return this.bytes.moveTo(e),!1;return!0},r}(),dn=function(){function r(t){this.idx=0,this.line=0,this.column=0,this.bytes=t,this.length=this.bytes.length}return r.prototype.moveTo=function(t){this.idx=t},r.prototype.next=function(){var t=this.bytes[this.idx++];return t===p.Newline?(this.line+=1,this.column=0):this.column+=1,t},r.prototype.assertNext=function(t){if(this.peek()!==t)throw new As(this.position(),t,this.peek());return this.next()},r.prototype.peek=function(){return this.bytes[this.idx]},r.prototype.peekAhead=function(t){return this.bytes[this.idx+t]},r.prototype.peekAt=function(t){return this.bytes[t]},r.prototype.done=function(){return this.idx>=this.length},r.prototype.offset=function(){return this.idx},r.prototype.slice=function(t,e){return this.bytes.slice(t,e)},r.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},r.of=function(t){return new r(t)},r.fromPDFRawStream=function(t){return r.of(So(t).decode())},r}(),wu=p.Space,ze=p.CarriageReturn,We=p.Newline,qe=[p.s,p.t,p.r,p.e,p.a,p.m],kr=[p.e,p.n,p.d,p.s,p.t,p.r,p.e,p.a,p.m],ct={header:[p.Percent,p.P,p.D,p.F,p.Dash],eof:[p.Percent,p.Percent,p.E,p.O,p.F],obj:[p.o,p.b,p.j],endobj:[p.e,p.n,p.d,p.o,p.b,p.j],xref:[p.x,p.r,p.e,p.f],trailer:[p.t,p.r,p.a,p.i,p.l,p.e,p.r],startxref:[p.s,p.t,p.a,p.r,p.t,p.x,p.r,p.e,p.f],true:[p.t,p.r,p.u,p.e],false:[p.f,p.a,p.l,p.s,p.e],null:[p.n,p.u,p.l,p.l],stream:qe,streamEOF1:rt(qe,[wu,ze,We]),streamEOF2:rt(qe,[ze,We]),streamEOF3:rt(qe,[ze]),streamEOF4:rt(qe,[We]),endstream:kr,EOF1endstream:rt([ze,We],kr),EOF2endstream:rt([ze],kr),EOF3endstream:rt([We],kr)},Oo=function(r){A(t,r);function t(e,n,i){i===void 0&&(i=!1);var o=r.call(this,e,i)||this;return o.context=n,o}return t.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(ct.true))return or.True;if(this.matchKeyword(ct.false))return or.False;if(this.matchKeyword(ct.null))return Tt;var e=this.bytes.peek();if(e===p.LessThan&&this.bytes.peekAhead(1)===p.LessThan)return this.parseDictOrStream();if(e===p.LessThan)return this.parseHexString();if(e===p.LeftParen)return this.parseString();if(e===p.ForwardSlash)return this.parseName();if(e===p.LeftSquareBracket)return this.parseArray();if($n[e])return this.parseNumberOrRef();throw new Os(this.bytes.position(),e)},t.prototype.parseNumberOrRef=function(){var e=this.parseRawNumber();this.skipWhitespaceAndComments();var n=this.bytes.offset();if(Ft[this.bytes.peek()]){var i=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===p.R)return this.bytes.assertNext(p.R),st.of(e,i)}return this.bytes.moveTo(n),W.of(e)},t.prototype.parseHexString=function(){var e="";for(this.bytes.assertNext(p.LessThan);!this.bytes.done()&&this.bytes.peek()!==p.GreaterThan;)e+=Zt(this.bytes.next());return this.bytes.assertNext(p.GreaterThan),V.of(e)},t.prototype.parseString=function(){for(var e=0,n=!1,i="";!this.bytes.done();){var o=this.bytes.next();if(i+=Zt(o),n||(o===p.LeftParen&&(e+=1),o===p.RightParen&&(e-=1)),o===p.BackSlash?n=!n:n&&(n=!1),e===0)return at.of(i.substring(1,i.length-1))}throw new Es(this.bytes.position())},t.prototype.parseName=function(){this.bytes.assertNext(p.ForwardSlash);for(var e="";!this.bytes.done();){var n=this.bytes.peek();if(_t[n]||zt[n])break;e+=Zt(n),this.bytes.next()}return v.of(e)},t.prototype.parseArray=function(){this.bytes.assertNext(p.LeftSquareBracket),this.skipWhitespaceAndComments();for(var e=nt.withContext(this.context);this.bytes.peek()!==p.RightSquareBracket;){var n=this.parseObject();e.push(n),this.skipWhitespaceAndComments()}return this.bytes.assertNext(p.RightSquareBracket),e},t.prototype.parseDict=function(){this.bytes.assertNext(p.LessThan),this.bytes.assertNext(p.LessThan),this.skipWhitespaceAndComments();for(var e=new Map;!this.bytes.done()&&this.bytes.peek()!==p.GreaterThan&&this.bytes.peekAhead(1)!==p.GreaterThan;){var n=this.parseName(),i=this.parseObject();e.set(n,i),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(p.GreaterThan),this.bytes.assertNext(p.GreaterThan);var o=e.get(v.of("Type"));return o===v.of("Catalog")?ko.fromMapWithContext(e,this.context):o===v.of("Pages")?Ao.fromMapWithContext(e,this.context):o===v.of("Page")?Jt.fromMapWithContext(e,this.context):H.fromMapWithContext(e,this.context)},t.prototype.parseDictOrStream=function(){var e=this.bytes.position(),n=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(ct.streamEOF1)&&!this.matchKeyword(ct.streamEOF2)&&!this.matchKeyword(ct.streamEOF3)&&!this.matchKeyword(ct.streamEOF4)&&!this.matchKeyword(ct.stream))return n;var i=this.bytes.offset(),o,a=n.get(v.of("Length"));a instanceof W?(o=i+a.asNumber(),this.bytes.moveTo(o),this.skipWhitespaceAndComments(),this.matchKeyword(ct.endstream)||(this.bytes.moveTo(i),o=this.findEndOfStreamFallback(e))):o=this.findEndOfStreamFallback(e);var s=this.bytes.slice(i,o);return ar.of(n,s)},t.prototype.findEndOfStreamFallback=function(e){for(var n=1,i=this.bytes.offset();!this.bytes.done()&&(i=this.bytes.offset(),this.matchKeyword(ct.stream)?n+=1:this.matchKeyword(ct.EOF1endstream)||this.matchKeyword(ct.EOF2endstream)||this.matchKeyword(ct.EOF3endstream)||this.matchKeyword(ct.endstream)?n-=1:this.bytes.next(),n!==0););if(n!==0)throw new Bs(e);return i},t.forBytes=function(e,n,i){return new t(dn.of(e),n,i)},t.forByteStream=function(e,n,i){return i===void 0&&(i=!1),new t(e,n,i)},t}(Su),Cu=function(r){A(t,r);function t(e,n){var i=r.call(this,dn.fromPDFRawStream(e),e.dict.context)||this,o=e.dict;return i.alreadyParsed=!1,i.shouldWaitForTick=n||function(){return!1},i.firstOffset=o.lookup(v.of("First"),W).asNumber(),i.objectCount=o.lookup(v.of("N"),W).asNumber(),i}return t.prototype.parseIntoContext=function(){return Y(this,void 0,void 0,function(){var e,n,i,o,a,s,c,u;return J(this,function(f){switch(f.label){case 0:if(this.alreadyParsed)throw new Kn("PDFObjectStreamParser","parseIntoContext");this.alreadyParsed=!0,e=this.parseOffsetsAndObjectNumbers(),n=0,i=e.length,f.label=1;case 1:return n<i?(o=e[n],a=o.objectNumber,s=o.offset,this.bytes.moveTo(this.firstOffset+s),c=this.parseObject(),u=st.of(a,0),this.context.assign(u,c),this.shouldWaitForTick()?[4,Oe()]:[3,3]):[3,4];case 2:f.sent(),f.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},t.prototype.parseOffsetsAndObjectNumbers=function(){for(var e=[],n=0,i=this.objectCount;n<i;n++){this.skipWhitespaceAndComments();var o=this.parseRawInt();this.skipWhitespaceAndComments();var a=this.parseRawInt();e.push({objectNumber:o,offset:a})}return e},t.forStream=function(e,n){return new t(e,n)},t}(Oo),Pu=function(){function r(t){this.alreadyParsed=!1,this.dict=t.dict,this.bytes=dn.fromPDFRawStream(t),this.context=this.dict.context;var e=this.dict.lookup(v.of("Size"),W),n=this.dict.lookup(v.of("Index"));if(n instanceof nt){this.subsections=[];for(var i=0,o=n.size();i<o;i+=2){var a=n.lookup(i+0,W).asNumber(),s=n.lookup(i+1,W).asNumber();this.subsections.push({firstObjectNumber:a,length:s})}}else this.subsections=[{firstObjectNumber:0,length:e.asNumber()}];var c=this.dict.lookup(v.of("W"),nt);this.byteWidths=[-1,-1,-1];for(var i=0,o=c.size();i<o;i++)this.byteWidths[i]=c.lookup(i,W).asNumber()}return r.prototype.parseIntoContext=function(){if(this.alreadyParsed)throw new Kn("PDFXRefStreamParser","parseIntoContext");this.alreadyParsed=!0,this.context.trailerInfo={Root:this.dict.get(v.of("Root")),Encrypt:this.dict.get(v.of("Encrypt")),Info:this.dict.get(v.of("Info")),ID:this.dict.get(v.of("ID"))};var t=this.parseEntries();return t},r.prototype.parseEntries=function(){for(var t=[],e=this.byteWidths,n=e[0],i=e[1],o=e[2],a=0,s=this.subsections.length;a<s;a++)for(var c=this.subsections[a],u=c.firstObjectNumber,f=c.length,l=0;l<f;l++){for(var h=0,d=0,g=n;d<g;d++)h=h<<8|this.bytes.next();for(var y=0,d=0,g=i;d<g;d++)y=y<<8|this.bytes.next();for(var b=0,d=0,g=o;d<g;d++)b=b<<8|this.bytes.next();n===0&&(h=1);var m=u+l,S={ref:st.of(m,b),offset:y,deleted:h===0,inObjectStream:h===2};t.push(S)}return t},r.forStream=function(t){return new r(t)},r}(),Tu=function(r){A(t,r);function t(e,n,i,o){n===void 0&&(n=1/0),i===void 0&&(i=!1),o===void 0&&(o=!1);var a=r.call(this,dn.of(e),Rn.create(),o)||this;return a.alreadyParsed=!1,a.parsedObjects=0,a.shouldWaitForTick=function(){return a.parsedObjects+=1,a.parsedObjects%a.objectsPerTick===0},a.objectsPerTick=n,a.throwOnInvalidObject=i,a}return t.prototype.parseDocument=function(){return Y(this,void 0,void 0,function(){var e,n;return J(this,function(i){switch(i.label){case 0:if(this.alreadyParsed)throw new Kn("PDFParser","parseDocument");this.alreadyParsed=!0,this.context.header=this.parseHeader(),i.label=1;case 1:return this.bytes.done()?[3,3]:[4,this.parseDocumentSection()];case 2:if(i.sent(),n=this.bytes.offset(),n===e)throw new js(this.bytes.position());return e=n,[3,1];case 3:return this.maybeRecoverRoot(),this.context.lookup(st.of(0))&&(console.warn("Removing parsed object: 0 0 R"),this.context.delete(st.of(0))),[2,this.context]}})})},t.prototype.maybeRecoverRoot=function(){var e=function(f){return f instanceof H&&f.lookup(v.of("Type"))===v.of("Catalog")},n=this.context.lookup(this.context.trailerInfo.Root);if(!e(n))for(var i=this.context.enumerateIndirectObjects(),o=0,a=i.length;o<a;o++){var s=i[o],c=s[0],u=s[1];e(u)&&(this.context.trailerInfo.Root=c)}},t.prototype.parseHeader=function(){for(;!this.bytes.done();){if(this.matchKeyword(ct.header)){var e=this.parseRawInt();this.bytes.assertNext(p.Period);var n=this.parseRawInt(),i=on.forVersion(e,n);return this.skipBinaryHeaderComment(),i}this.bytes.next()}throw new Ns(this.bytes.position())},t.prototype.parseIndirectObjectHeader=function(){this.skipWhitespaceAndComments();var e=this.parseRawInt();this.skipWhitespaceAndComments();var n=this.parseRawInt();if(this.skipWhitespaceAndComments(),!this.matchKeyword(ct.obj))throw new Ms(this.bytes.position(),ct.obj);return st.of(e,n)},t.prototype.matchIndirectObjectHeader=function(){var e=this.bytes.offset();try{return this.parseIndirectObjectHeader(),!0}catch{return this.bytes.moveTo(e),!1}},t.prototype.parseIndirectObject=function(){return Y(this,void 0,void 0,function(){var e,n;return J(this,function(i){switch(i.label){case 0:return e=this.parseIndirectObjectHeader(),this.skipWhitespaceAndComments(),n=this.parseObject(),this.skipWhitespaceAndComments(),this.matchKeyword(ct.endobj),n instanceof ar&&n.dict.lookup(v.of("Type"))===v.of("ObjStm")?[4,Cu.forStream(n,this.shouldWaitForTick).parseIntoContext()]:[3,2];case 1:return i.sent(),[3,3];case 2:n instanceof ar&&n.dict.lookup(v.of("Type"))===v.of("XRef")?Pu.forStream(n).parseIntoContext():this.context.assign(e,n),i.label=3;case 3:return[2,e]}})})},t.prototype.tryToParseInvalidIndirectObject=function(){var e=this.bytes.position(),n="Trying to parse invalid object: "+JSON.stringify(e)+")";if(this.throwOnInvalidObject)throw new Error(n);console.warn(n);var i=this.parseIndirectObjectHeader();console.warn("Invalid object ref: "+i),this.skipWhitespaceAndComments();for(var o=this.bytes.offset(),a=!0;!this.bytes.done()&&(this.matchKeyword(ct.endobj)&&(a=!1),!!a);)this.bytes.next();if(a)throw new Rs(e);var s=this.bytes.offset()-ct.endobj.length,c=mo.of(this.bytes.slice(o,s));return this.context.assign(i,c),i},t.prototype.parseIndirectObjects=function(){return Y(this,void 0,void 0,function(){var e;return J(this,function(n){switch(n.label){case 0:this.skipWhitespaceAndComments(),n.label=1;case 1:if(!(!this.bytes.done()&&Ft[this.bytes.peek()]))return[3,8];e=this.bytes.offset(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,this.parseIndirectObject()];case 3:return n.sent(),[3,5];case 4:return n.sent(),this.bytes.moveTo(e),this.tryToParseInvalidIndirectObject(),[3,5];case 5:return this.skipWhitespaceAndComments(),this.skipJibberish(),this.shouldWaitForTick()?[4,Oe()]:[3,7];case 6:n.sent(),n.label=7;case 7:return[3,1];case 8:return[2]}})})},t.prototype.maybeParseCrossRefSection=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(ct.xref)){this.skipWhitespaceAndComments();for(var e=-1,n=po.createEmpty();!this.bytes.done()&&Ft[this.bytes.peek()];){var i=this.parseRawInt();this.skipWhitespaceAndComments();var o=this.parseRawInt();this.skipWhitespaceAndComments();var a=this.bytes.peek();if(a===p.n||a===p.f){var s=st.of(e,o);this.bytes.next()===p.n?n.addEntry(s,i):n.addDeletedEntry(s,i),e+=1}else e=i;this.skipWhitespaceAndComments()}return n}},t.prototype.maybeParseTrailerDict=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(ct.trailer)){this.skipWhitespaceAndComments();var e=this.parseDict(),n=this.context;n.trailerInfo={Root:e.get(v.of("Root"))||n.trailerInfo.Root,Encrypt:e.get(v.of("Encrypt"))||n.trailerInfo.Encrypt,Info:e.get(v.of("Info"))||n.trailerInfo.Info,ID:e.get(v.of("ID"))||n.trailerInfo.ID}}},t.prototype.maybeParseTrailer=function(){if(this.skipWhitespaceAndComments(),!!this.matchKeyword(ct.startxref)){this.skipWhitespaceAndComments();var e=this.parseRawInt();return this.skipWhitespace(),this.matchKeyword(ct.eof),this.skipWhitespaceAndComments(),this.matchKeyword(ct.eof),this.skipWhitespaceAndComments(),Hn.forLastCrossRefSectionOffset(e)}},t.prototype.parseDocumentSection=function(){return Y(this,void 0,void 0,function(){return J(this,function(e){switch(e.label){case 0:return[4,this.parseIndirectObjects()];case 1:return e.sent(),this.maybeParseCrossRefSection(),this.maybeParseTrailerDict(),this.maybeParseTrailer(),this.skipJibberish(),[2]}})})},t.prototype.skipJibberish=function(){for(this.skipWhitespaceAndComments();!this.bytes.done();){var e=this.bytes.offset(),n=this.bytes.peek(),i=n>=p.Space&&n<=p.Tilde;if(i&&(this.matchKeyword(ct.xref)||this.matchKeyword(ct.trailer)||this.matchKeyword(ct.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(e);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var e=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(e)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(e,n,i,o){return new t(e,n,i,o)},t}(Oo),Lt=function(r){return 1<<r},rr;(function(r){r[r.Invisible=Lt(0)]="Invisible",r[r.Hidden=Lt(1)]="Hidden",r[r.Print=Lt(2)]="Print",r[r.NoZoom=Lt(3)]="NoZoom",r[r.NoRotate=Lt(4)]="NoRotate",r[r.NoView=Lt(5)]="NoView",r[r.ReadOnly=Lt(6)]="ReadOnly",r[r.Locked=Lt(7)]="Locked",r[r.ToggleNoView=Lt(8)]="ToggleNoView",r[r.LockedContents=Lt(9)]="LockedContents"})(rr||(rr={}));var vn=function(r){return r instanceof v?r:v.of(r)},q=function(r){return r instanceof W?r:W.of(r)},Q=function(r){return r instanceof W?r.asNumber():r},sr;(function(r){r.Degrees="degrees",r.Radians="radians"})(sr||(sr={}));var z=function(r){return x(r,"degreeAngle",["number"]),{type:sr.Degrees,angle:r}},Ro=sr.Radians,Bo=sr.Degrees,Eo=function(r){return r*Math.PI/180},Du=function(r){return r*180/Math.PI},xt=function(r){return r.type===Ro?r.angle:r.type===Bo?Eo(r.angle):hr("Invalid rotation: "+JSON.stringify(r))},jo=function(r){return r.type===Ro?Du(r.angle):r.type===Bo?r.angle:hr("Invalid rotation: "+JSON.stringify(r))},$t=function(r){r===void 0&&(r=0);var t=r/90%4;return t===0?0:t===1?90:t===2?180:t===3?270:0},ye=function(r,t){t===void 0&&(t=0);var e=$t(t);return e===90||e===270?{width:r.height,height:r.width}:{width:r.width,height:r.height}},ku=function(r,t,e){t===void 0&&(t=0),e===void 0&&(e=0);var n=r.x,i=r.y,o=r.width,a=r.height,s=$t(e),c=t/2;return s===0?{x:n-c,y:i-c,width:o,height:a}:s===90?{x:n-a+c,y:i-c,width:a,height:o}:s===180?{x:n-o+c,y:i-a+c,width:o,height:a}:s===270?{x:n-c,y:i-o+c,width:a,height:o}:{x:n-c,y:i-c,width:o,height:a}},No=function(){return et.of(_.ClipNonZero)},Hr=Math.cos,Zr=Math.sin,Yr=Math.tan,pn=function(r,t,e,n,i,o){return et.of(_.ConcatTransformationMatrix,[q(r),q(t),q(e),q(n),q(i),q(o)])},It=function(r,t){return pn(1,0,0,1,r,t)},ur=function(r,t){return pn(r,0,0,t,0,0)},Ee=function(r){return pn(Hr(Q(r)),Zr(Q(r)),-Zr(Q(r)),Hr(Q(r)),0,0)},Ar=function(r){return Ee(Eo(Q(r)))},ti=function(r,t){return pn(1,Yr(Q(r)),Yr(Q(t)),1,0,0)},gn=function(r,t){return et.of(_.SetLineDashPattern,["["+r.map(q).join(" ")+"]",q(t)])},Te;(function(r){r[r.Butt=0]="Butt",r[r.Round=1]="Round",r[r.Projecting=2]="Projecting"})(Te||(Te={}));var yn=function(r){return et.of(_.SetLineCapStyle,[q(r)])},ji;(function(r){r[r.Miter=0]="Miter",r[r.Round=1]="Round",r[r.Bevel=2]="Bevel"})(ji||(ji={}));var me=function(r){return et.of(_.SetGraphicsStateParams,[vn(r)])},gt=function(){return et.of(_.PushGraphicsState)},yt=function(){return et.of(_.PopGraphicsState)},gr=function(r){return et.of(_.SetLineWidth,[q(r)])},kt=function(r,t,e,n,i,o){return et.of(_.AppendBezierCurve,[q(r),q(t),q(e),q(n),q(i),q(o)])},Or=function(r,t,e,n){return et.of(_.CurveToReplicateInitialPoint,[q(r),q(t),q(e),q(n)])},se=function(){return et.of(_.ClosePath)},Xt=function(r,t){return et.of(_.MoveTo,[q(r),q(t)])},mt=function(r,t){return et.of(_.LineTo,[q(r),q(t)])},yr=function(){return et.of(_.StrokePath)},ei=function(){return et.of(_.FillNonZero)},ri=function(){return et.of(_.FillNonZeroAndStroke)},Mo=function(){return et.of(_.EndPath)},Au=function(){return et.of(_.NextLine)},Io=function(r){return et.of(_.ShowText,[r])},Uo=function(){return et.of(_.BeginText)},Vo=function(){return et.of(_.EndText)},ni=function(r,t){return et.of(_.SetFontAndSize,[vn(r),q(t)])},Ou=function(r){return et.of(_.SetTextLineHeight,[q(r)])},Ni;(function(r){r[r.Fill=0]="Fill",r[r.Outline=1]="Outline",r[r.FillAndOutline=2]="FillAndOutline",r[r.Invisible=3]="Invisible",r[r.FillAndClip=4]="FillAndClip",r[r.OutlineAndClip=5]="OutlineAndClip",r[r.FillAndOutlineAndClip=6]="FillAndOutlineAndClip",r[r.Clip=7]="Clip"})(Ni||(Ni={}));var Ru=function(r,t,e,n,i,o){return et.of(_.SetTextMatrix,[q(r),q(t),q(e),q(n),q(i),q(o)])},zo=function(r,t,e,n,i){return Ru(Hr(Q(r)),Zr(Q(r))+Yr(Q(t)),-Zr(Q(r))+Yr(Q(e)),Hr(Q(r)),n,i)},ii=function(r){return et.of(_.DrawObject,[vn(r)])},Bu=function(r){return et.of(_.NonStrokingColorGray,[q(r)])},Eu=function(r){return et.of(_.StrokingColorGray,[q(r)])},ju=function(r,t,e){return et.of(_.NonStrokingColorRgb,[q(r),q(t),q(e)])},Nu=function(r,t,e){return et.of(_.StrokingColorRgb,[q(r),q(t),q(e)])},Mu=function(r,t,e,n){return et.of(_.NonStrokingColorCmyk,[q(r),q(t),q(e),q(n)])},Iu=function(r,t,e,n){return et.of(_.StrokingColorCmyk,[q(r),q(t),q(e),q(n)])},Wo=function(r){return et.of(_.BeginMarkedContent,[vn(r)])},qo=function(){return et.of(_.EndMarkedContent)},ue;(function(r){r.Grayscale="Grayscale",r.RGB="RGB",r.CMYK="CMYK"})(ue||(ue={}));var Ko=function(r){return Dt(r,"gray",0,1),{type:ue.Grayscale,gray:r}},it=function(r,t,e){return Dt(r,"red",0,1),Dt(t,"green",0,1),Dt(e,"blue",0,1),{type:ue.RGB,red:r,green:t,blue:e}},Go=function(r,t,e,n){return Dt(r,"cyan",0,1),Dt(t,"magenta",0,1),Dt(e,"yellow",0,1),Dt(n,"key",0,1),{type:ue.CMYK,cyan:r,magenta:t,yellow:e,key:n}},oi=ue.Grayscale,ai=ue.RGB,si=ue.CMYK,be=function(r){return r.type===oi?Bu(r.gray):r.type===ai?ju(r.red,r.green,r.blue):r.type===si?Mu(r.cyan,r.magenta,r.yellow,r.key):hr("Invalid color: "+JSON.stringify(r))},mr=function(r){return r.type===oi?Eu(r.gray):r.type===ai?Nu(r.red,r.green,r.blue):r.type===si?Iu(r.cyan,r.magenta,r.yellow,r.key):hr("Invalid color: "+JSON.stringify(r))},wt=function(r,t){return t===void 0&&(t=1),(r==null?void 0:r.length)===1?Ko(r[0]*t):(r==null?void 0:r.length)===3?it(r[0]*t,r[1]*t,r[2]*t):(r==null?void 0:r.length)===4?Go(r[0]*t,r[1]*t,r[2]*t,r[3]*t):void 0},Mi=function(r){return r.type===oi?[r.gray]:r.type===ai?[r.red,r.green,r.blue]:r.type===si?[r.cyan,r.magenta,r.yellow,r.key]:hr("Invalid color: "+JSON.stringify(r))},M=0,I=0,$=0,tt=0,Le=0,Xe=0,Ii=new Map([["A",7],["a",7],["C",6],["c",6],["H",1],["h",1],["L",2],["l",2],["M",2],["m",2],["Q",4],["q",4],["S",4],["s",4],["T",2],["t",2],["V",1],["v",1],["Z",0],["z",0]]),Uu=function(r){for(var t,e=[],n=[],i="",o=!1,a=0,s=0,c=r;s<c.length;s++){var u=c[s];if(Ii.has(u))a=Ii.get(u),t&&(i.length>0&&(n[n.length]=+i),e[e.length]={cmd:t,args:n},n=[],i="",o=!1),t=u;else if([" ",","].includes(u)||u==="-"&&i.length>0&&i[i.length-1]!=="e"||u==="."&&o){if(i.length===0)continue;n.length===a?(e[e.length]={cmd:t,args:n},n=[+i],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+i,o=u===".",i=["-","."].includes(u)?u:""}else i+=u,u==="."&&(o=!0)}return i.length>0&&(n.length===a?(e[e.length]={cmd:t,args:n},n=[+i],t==="M"&&(t="L"),t==="m"&&(t="l")):n[n.length]=+i),e[e.length]={cmd:t,args:n},e},Vu=function(r){M=I=$=tt=Le=Xe=0;for(var t=[],e=0;e<r.length;e++){var n=r[e];if(n.cmd&&typeof Ui[n.cmd]=="function"){var i=Ui[n.cmd](n.args);Array.isArray(i)?t=t.concat(i):t.push(i)}}return t},Ui={M:function(r){return M=r[0],I=r[1],$=tt=null,Le=M,Xe=I,Xt(M,I)},m:function(r){return M+=r[0],I+=r[1],$=tt=null,Le=M,Xe=I,Xt(M,I)},C:function(r){return M=r[4],I=r[5],$=r[2],tt=r[3],kt(r[0],r[1],r[2],r[3],r[4],r[5])},c:function(r){var t=kt(r[0]+M,r[1]+I,r[2]+M,r[3]+I,r[4]+M,r[5]+I);return $=M+r[2],tt=I+r[3],M+=r[4],I+=r[5],t},S:function(r){($===null||tt===null)&&($=M,tt=I);var t=kt(M-($-M),I-(tt-I),r[0],r[1],r[2],r[3]);return $=r[0],tt=r[1],M=r[2],I=r[3],t},s:function(r){($===null||tt===null)&&($=M,tt=I);var t=kt(M-($-M),I-(tt-I),M+r[0],I+r[1],M+r[2],I+r[3]);return $=M+r[0],tt=I+r[1],M+=r[2],I+=r[3],t},Q:function(r){return $=r[0],tt=r[1],M=r[2],I=r[3],Or(r[0],r[1],M,I)},q:function(r){var t=Or(r[0]+M,r[1]+I,r[2]+M,r[3]+I);return $=M+r[0],tt=I+r[1],M+=r[2],I+=r[3],t},T:function(r){$===null||tt===null?($=M,tt=I):($=M-($-M),tt=I-(tt-I));var t=Or($,tt,r[0],r[1]);return $=M-($-M),tt=I-(tt-I),M=r[0],I=r[1],t},t:function(r){$===null||tt===null?($=M,tt=I):($=M-($-M),tt=I-(tt-I));var t=Or($,tt,M+r[0],I+r[1]);return M+=r[0],I+=r[1],t},A:function(r){var t=Vi(M,I,r);return M=r[5],I=r[6],t},a:function(r){r[5]+=M,r[6]+=I;var t=Vi(M,I,r);return M=r[5],I=r[6],t},L:function(r){return M=r[0],I=r[1],$=tt=null,mt(M,I)},l:function(r){return M+=r[0],I+=r[1],$=tt=null,mt(M,I)},H:function(r){return M=r[0],$=tt=null,mt(M,I)},h:function(r){return M+=r[0],$=tt=null,mt(M,I)},V:function(r){return I=r[0],$=tt=null,mt(M,I)},v:function(r){return I+=r[0],$=tt=null,mt(M,I)},Z:function(){var r=se();return M=Le,I=Xe,r},z:function(){var r=se();return M=Le,I=Xe,r}},Vi=function(r,t,e){for(var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],f=zu(c,u,n,i,a,s,o,r,t),l=[],h=0,d=f;h<d.length;h++){var g=d[h],y=Wu.apply(void 0,g);l.push(kt.apply(void 0,y))}return l},zu=function(r,t,e,n,i,o,a,s,c){var u=a*(Math.PI/180),f=Math.sin(u),l=Math.cos(u);e=Math.abs(e),n=Math.abs(n),$=l*(s-r)*.5+f*(c-t)*.5,tt=l*(c-t)*.5-f*(s-r)*.5;var h=$*$/(e*e)+tt*tt/(n*n);h>1&&(h=Math.sqrt(h),e*=h,n*=h);var d=l/e,g=f/e,y=-f/n,b=l/n,m=d*s+g*c,S=y*s+b*c,F=d*r+g*t,T=y*r+b*t,P=(F-m)*(F-m)+(T-S)*(T-S),w=1/P-.25;w<0&&(w=0);var D=Math.sqrt(w);o===i&&(D=-D);var R=.5*(m+F)-D*(T-S),B=.5*(S+T)+D*(F-m),j=Math.atan2(S-B,m-R),E=Math.atan2(T-B,F-R),U=E-j;U<0&&o===1?U+=2*Math.PI:U>0&&o===0&&(U-=2*Math.PI);for(var O=Math.ceil(Math.abs(U/(Math.PI*.5+.001))),Z=[],X=0;X<O;X++){var N=j+X*U/O,ut=j+(X+1)*U/O;Z[X]=[R,B,N,ut,e,n,f,l]}return Z},Wu=function(r,t,e,n,i,o,a,s){var c=s*i,u=-a*o,f=a*i,l=s*o,h=.5*(n-e),d=8/3*Math.sin(h*.5)*Math.sin(h*.5)/Math.sin(h),g=r+Math.cos(e)-d*Math.sin(e),y=t+Math.sin(e)+d*Math.cos(e),b=r+Math.cos(n),m=t+Math.sin(n),S=b+d*Math.sin(n),F=m-d*Math.cos(n),T=[c*g+u*y,f*g+l*y,c*S+u*F,f*S+l*F,c*b+u*m,f*b+l*m];return T},qu=function(r){return Vu(Uu(r))},Ku=function(r,t){for(var e=[gt(),t.graphicsState&&me(t.graphicsState),Uo(),be(t.color),ni(t.font,t.size),Ou(t.lineHeight),zo(xt(t.rotate),xt(t.xSkew),xt(t.ySkew),t.x,t.y)].filter(Boolean),n=0,i=r.length;n<i;n++)e.push(Io(r[n]),Au());return e.push(Vo(),yt()),e},Lo=function(r,t){return[gt(),t.graphicsState&&me(t.graphicsState),It(t.x,t.y),Ee(xt(t.rotate)),ur(t.width,t.height),ti(xt(t.xSkew),xt(t.ySkew)),ii(r),yt()].filter(Boolean)},Gu=function(r,t){return[gt(),t.graphicsState&&me(t.graphicsState),It(t.x,t.y),Ee(xt(t.rotate)),ur(t.xScale,t.yScale),ti(xt(t.xSkew),xt(t.ySkew)),ii(r),yt()].filter(Boolean)},Lu=function(r){var t,e;return[gt(),r.graphicsState&&me(r.graphicsState),r.color&&mr(r.color),gr(r.thickness),gn((t=r.dashArray)!==null&&t!==void 0?t:[],(e=r.dashPhase)!==null&&e!==void 0?e:0),Xt(r.start.x,r.start.y),r.lineCap&&yn(r.lineCap),Xt(r.start.x,r.start.y),mt(r.end.x,r.end.y),yr(),yt()].filter(Boolean)},Re=function(r){var t,e;return[gt(),r.graphicsState&&me(r.graphicsState),r.color&&be(r.color),r.borderColor&&mr(r.borderColor),gr(r.borderWidth),r.borderLineCap&&yn(r.borderLineCap),gn((t=r.borderDashArray)!==null&&t!==void 0?t:[],(e=r.borderDashPhase)!==null&&e!==void 0?e:0),It(r.x,r.y),Ee(xt(r.rotate)),ti(xt(r.xSkew),xt(r.ySkew)),Xt(0,0),mt(0,r.height),mt(r.width,r.height),mt(r.width,0),se(),r.color&&r.borderWidth?ri():r.color?ei():r.borderColor?yr():se(),yt()].filter(Boolean)},Jr=4*((Math.sqrt(2)-1)/3),Xu=function(r){var t=Q(r.x),e=Q(r.y),n=Q(r.xScale),i=Q(r.yScale);t-=n,e-=i;var o=n*Jr,a=i*Jr,s=t+n*2,c=e+i*2,u=t+n,f=e+i;return[gt(),Xt(t,f),kt(t,f-a,u-o,e,u,e),kt(u+o,e,s,f-a,s,f),kt(s,f+a,u+o,c,u,c),kt(u-o,c,t,f+a,t,f),yt()]},Hu=function(r){var t=Q(r.x),e=Q(r.y),n=Q(r.xScale),i=Q(r.yScale),o=-n,a=-i,s=n*Jr,c=i*Jr,u=o+n*2,f=a+i*2,l=o+n,h=a+i;return[It(t,e),Ee(xt(r.rotate)),Xt(o,h),kt(o,h-c,l-s,a,l,a),kt(l+s,a,u,h-c,u,h),kt(u,h+c,l+s,f,l,f),kt(l-s,f,o,h+c,o,h)]},Nn=function(r){var t,e,n;return rt([gt(),r.graphicsState&&me(r.graphicsState),r.color&&be(r.color),r.borderColor&&mr(r.borderColor),gr(r.borderWidth),r.borderLineCap&&yn(r.borderLineCap),gn((t=r.borderDashArray)!==null&&t!==void 0?t:[],(e=r.borderDashPhase)!==null&&e!==void 0?e:0)],r.rotate===void 0?Xu({x:r.x,y:r.y,xScale:r.xScale,yScale:r.yScale}):Hu({x:r.x,y:r.y,xScale:r.xScale,yScale:r.yScale,rotate:(n=r.rotate)!==null&&n!==void 0?n:z(0)}),[r.color&&r.borderWidth?ri():r.color?ei():r.borderColor?yr():se(),yt()]).filter(Boolean)},Zu=function(r,t){var e,n,i;return rt([gt(),t.graphicsState&&me(t.graphicsState),It(t.x,t.y),Ee(xt((e=t.rotate)!==null&&e!==void 0?e:z(0))),t.scale?ur(t.scale,-t.scale):ur(1,-1),t.color&&be(t.color),t.borderColor&&mr(t.borderColor),t.borderWidth&&gr(t.borderWidth),t.borderLineCap&&yn(t.borderLineCap),gn((n=t.borderDashArray)!==null&&n!==void 0?n:[],(i=t.borderDashPhase)!==null&&i!==void 0?i:0)],qu(r),[t.color&&t.borderWidth?ri():t.color?ei():t.borderColor?yr():se(),yt()]).filter(Boolean)},Yu=function(r){var t=Q(r.size),e=-1+.75,n=-1+.51,i=1-.525,o=1-.31,a=-1+.325,s=.3995/(i-n)+n;return[gt(),r.color&&mr(r.color),gr(r.thickness),It(r.x,r.y),Xt(a*t,s*t),mt(e*t,n*t),mt(o*t,i*t),yr(),yt()].filter(Boolean)},le=function(r){return r.rotation===0?[It(0,0),Ar(0)]:r.rotation===90?[It(r.width,0),Ar(90)]:r.rotation===180?[It(r.width,r.height),Ar(180)]:r.rotation===270?[It(0,r.height),Ar(270)]:[]},Rr=function(r){var t=Re({x:r.x,y:r.y,width:r.width,height:r.height,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:z(0),xSkew:z(0),ySkew:z(0)});if(!r.filled)return t;var e=Q(r.width),n=Q(r.height),i=Math.min(e,n)/2,o=Yu({x:e/2,y:n/2,size:i,thickness:r.thickness,color:r.markColor});return rt([gt()],t,o,[yt()])},Br=function(r){var t=Q(r.width),e=Q(r.height),n=Math.min(t,e)/2,i=Nn({x:r.x,y:r.y,xScale:n,yScale:n,color:r.color,borderColor:r.borderColor,borderWidth:r.borderWidth});if(!r.filled)return i;var o=Nn({x:r.x,y:r.y,xScale:n*.45,yScale:n*.45,color:r.dotColor,borderColor:void 0,borderWidth:0});return rt([gt()],i,o,[yt()])},zi=function(r){var t=Q(r.x),e=Q(r.y),n=Q(r.width),i=Q(r.height),o=Re({x:t,y:e,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:z(0),xSkew:z(0),ySkew:z(0)}),a=ui(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:z(0),xSkew:z(0),ySkew:z(0)});return rt([gt()],o,a,[yt()])},ui=function(r,t){for(var e=[Uo(),be(t.color),ni(t.font,t.size)],n=0,i=r.length;n<i;n++){var o=r[n],a=o.encoded,s=o.x,c=o.y;e.push(zo(xt(t.rotate),xt(t.xSkew),xt(t.ySkew),s,c),Io(a))}return e.push(Vo()),e},Xo=function(r){var t=Q(r.x),e=Q(r.y),n=Q(r.width),i=Q(r.height),o=Q(r.borderWidth),a=Q(r.padding),s=t+o/2+a,c=e+o/2+a,u=n-(o/2+a)*2,f=i-(o/2+a)*2,l=[Xt(s,c),mt(s,c+f),mt(s+u,c+f),mt(s+u,c),se(),No(),Mo()],h=Re({x:t,y:e,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:z(0),xSkew:z(0),ySkew:z(0)}),d=ui(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:z(0),xSkew:z(0),ySkew:z(0)}),g=rt([Wo("Tx"),gt()],d,[yt(),qo()]);return rt([gt()],h,l,g,[yt()])},Ju=function(r){for(var t=Q(r.x),e=Q(r.y),n=Q(r.width),i=Q(r.height),o=Q(r.lineHeight),a=Q(r.borderWidth),s=Q(r.padding),c=t+a/2+s,u=e+a/2+s,f=n-(a/2+s)*2,l=i-(a/2+s)*2,h=[Xt(c,u),mt(c,u+l),mt(c+f,u+l),mt(c+f,u),se(),No(),Mo()],d=Re({x:t,y:e,width:n,height:i,borderWidth:r.borderWidth,color:r.color,borderColor:r.borderColor,rotate:z(0),xSkew:z(0),ySkew:z(0)}),g=[],y=0,b=r.selectedLines.length;y<b;y++){var m=r.textLines[r.selectedLines[y]];g.push.apply(g,Re({x:m.x-s,y:m.y-(o-m.height)/2,width:n-a,height:m.height+(o-m.height)/2,borderWidth:0,color:r.selectedColor,borderColor:void 0,rotate:z(0),xSkew:z(0),ySkew:z(0)}))}var S=ui(r.textLines,{color:r.textColor,font:r.font,size:r.fontSize,rotate:z(0),xSkew:z(0),ySkew:z(0)}),F=rt([Wo("Tx"),gt()],S,[yt(),qo()]);return rt([gt()],d,g,h,F,[yt()])},Qu=function(r){A(t,r);function t(){var e=this,n="Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.";return e=r.call(this,n)||this,e}return t}(Error),_u=function(r){A(t,r);function t(){var e=this,n="Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.";return e=r.call(this,n)||this,e}return t}(Error),$u=function(r){A(t,r);function t(){var e=this,n="A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.";return e=r.call(this,n)||this,e}return t}(Error),tc=function(r){A(t,r);function t(){var e=this,n="PDFDocument has no pages so `PDFDocument.removePage` cannot be called";return e=r.call(this,n)||this,e}return t}(Error),ec=function(r){A(t,r);function t(e){var n=this,i='PDFDocument has no form field with the name "'+e+'"';return n=r.call(this,i)||this,n}return t}(Error),he=function(r){A(t,r);function t(e,n,i){var o,a,s=this,c=n==null?void 0:n.name,u=(a=(o=i==null?void 0:i.constructor)===null||o===void 0?void 0:o.name)!==null&&a!==void 0?a:i,f='Expected field "'+e+'" to be of type '+c+", "+("but it is actually of type "+u);return s=r.call(this,f)||this,s}return t}(Error);(function(r){A(t,r);function t(e){var n=this,i='Failed to select check box due to missing onValue: "'+e+'"';return n=r.call(this,i)||this,n}return t})(Error);var Ho=function(r){A(t,r);function t(e){var n=this,i='A field already exists with the specified name: "'+e+'"';return n=r.call(this,i)||this,n}return t}(Error),rc=function(r){A(t,r);function t(e){var n=this,i='Field name contains invalid component: "'+e+'"';return n=r.call(this,i)||this,n}return t}(Error);(function(r){A(t,r);function t(e){var n=this,i='A non-terminal field already exists with the specified name: "'+e+'"';return n=r.call(this,i)||this,n}return t})(Error);var nc=function(r){A(t,r);function t(e){var n=this,i="Reading rich text fields is not supported: Attempted to read rich text field: "+e;return n=r.call(this,i)||this,n}return t}(Error),ic=function(r){A(t,r);function t(e,n){var i=this,o="Failed to layout combed text as lineLength="+e+" is greater than cellCount="+n;return i=r.call(this,o)||this,i}return t}(Error),oc=function(r){A(t,r);function t(e,n,i){var o=this,a="Attempted to set text with length="+e+" for TextField with maxLength="+n+" and name="+i;return o=r.call(this,a)||this,o}return t}(Error),ac=function(r){A(t,r);function t(e,n,i){var o=this,a="Attempted to set maxLength="+n+", which is less than "+e+", the length of this field's current value (name="+i+")";return o=r.call(this,a)||this,o}return t}(Error),pt;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right"})(pt||(pt={}));var Zo=4,Yo=500,Jo=function(r,t,e,n){n===void 0&&(n=!1);for(var i=Zo;i<Yo;){for(var o=0,a=0,s=r.length;a<s;a++){o+=1;for(var c=r[a],u=c.split(" "),f=e.width,l=0,h=u.length;l<h;l++){var d=l===h-1,g=d?u[l]:u[l]+" ",y=t.widthOfTextAtSize(g,i);f-=y,f<=0&&(o+=1,f=e.width-y)}}if(!n&&o>r.length)return i-1;var b=t.heightAtSize(i),m=b+b*.2,S=m*o;if(S>Math.abs(e.height))return i-1;i+=1}return i},sc=function(r,t,e,n){for(var i=e.width/n,o=e.height,a=Zo,s=la(r);a<Yo;){for(var c=0,u=s.length;c<u;c++){var f=s[c],l=t.widthOfTextAtSize(f,a)>i*.75;if(l)return a-1}var h=t.heightAtSize(a,{descender:!1});if(h>o)return a-1;a+=1}return a},uc=function(r){for(var t=r.length;t>0;t--)if(/\s/.test(r[t]))return t},cc=function(r,t,e,n){for(var i,o=r.length;o>0;){var a=r.substring(0,o),s=e.encodeText(a),c=e.widthOfTextAtSize(a,n);if(c<t){var u=r.substring(o)||void 0;return{line:a,encoded:s,width:c,remainder:u}}o=(i=uc(a))!==null&&i!==void 0?i:0}return{line:r,encoded:e.encodeText(r),width:e.widthOfTextAtSize(r,n),remainder:void 0}},Qo=function(r,t){var e=t.alignment,n=t.fontSize,i=t.font,o=t.bounds,a=Xi(lr(r));(n===void 0||n===0)&&(n=Jo(a,i,o,!0));for(var s=i.heightAtSize(n),c=s+s*.2,u=[],f=o.x,l=o.y,h=o.x+o.width,d=o.y+o.height,g=o.y+o.height,y=0,b=a.length;y<b;y++)for(var m=a[y];m!==void 0;){var S=cc(m,o.width,i,n),F=S.line,T=S.encoded,P=S.width,w=S.remainder,D=e===pt.Left?o.x:e===pt.Center?o.x+o.width/2-P/2:e===pt.Right?o.x+o.width-P:o.x;g-=c,D<f&&(f=D),g<l&&(l=g),D+P>h&&(h=D+P),g+s>d&&(d=g+s),u.push({text:F,encoded:T,width:P,height:s,x:D,y:g}),m=w==null?void 0:w.trim()}return{fontSize:n,lineHeight:c,lines:u,bounds:{x:f,y:l,width:h-f,height:d-l}}},fc=function(r,t){var e=t.fontSize,n=t.font,i=t.bounds,o=t.cellCount,a=Hi(lr(r));if(a.length>o)throw new ic(a.length,o);(e===void 0||e===0)&&(e=sc(a,n,i,o));for(var s=i.width/o,c=n.heightAtSize(e,{descender:!1}),u=i.y+(i.height/2-c/2),f=[],l=i.x,h=i.y,d=i.x+i.width,g=i.y+i.height,y=0,b=0;y<o;){var m=Zi(a,b),S=m[0],F=m[1],T=n.encodeText(S),P=n.widthOfTextAtSize(S,e),w=i.x+(s*y+s/2),D=w-P/2;D<l&&(l=D),u<h&&(h=u),D+P>d&&(d=D+P),u+c>g&&(g=u+c),f.push({text:a,encoded:T,width:P,height:c,x:D,y:u}),y+=1,b+=F}return{fontSize:e,cells:f,bounds:{x:l,y:h,width:d-l,height:g-h}}},Qr=function(r,t){var e=t.alignment,n=t.fontSize,i=t.font,o=t.bounds,a=Hi(lr(r));(n===void 0||n===0)&&(n=Jo([a],i,o));var s=i.encodeText(a),c=i.widthOfTextAtSize(a,n),u=i.heightAtSize(n,{descender:!1}),f=e===pt.Left?o.x:e===pt.Center?o.x+o.width/2-c/2:e===pt.Right?o.x+o.width-c:o.x,l=o.y+(o.height/2-u/2);return{fontSize:n,line:{text:a,encoded:s,width:c,height:u,x:f,y:l},bounds:{x:f,y:l,width:c,height:u}}},je=function(r){return"normal"in r?r:{normal:r}},lc=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,ce=function(r){var t,e,n=(t=r.getDefaultAppearance())!==null&&t!==void 0?t:"",i=(e=Vn(n,lc).match)!==null&&e!==void 0?e:[],o=Number(i[2]);return isFinite(o)?o:void 0},hc=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,Ut=function(r){var t,e=(t=r.getDefaultAppearance())!==null&&t!==void 0?t:"",n=Vn(e,hc).match,i=n??[],o=i[1],a=i[2],s=i[3],c=i[4],u=i[5];if(u==="g"&&o)return Ko(Number(o));if(u==="rg"&&o&&a&&s)return it(Number(o),Number(a),Number(s));if(u==="k"&&o&&a&&s&&c)return Go(Number(o),Number(a),Number(s),Number(c))},Vt=function(r,t,e,n){var i;n===void 0&&(n=0);var o=[be(t).toString(),ni((i=e==null?void 0:e.name)!==null&&i!==void 0?i:"dummy__noop",n).toString()].join(`
`);r.setDefaultAppearance(o)},dc=function(r,t){var e,n,i,o=Ut(t),a=Ut(r.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),u=t.getBorderStyle(),f=(e=u==null?void 0:u.getWidth())!==null&&e!==void 0?e:0,l=$t(c==null?void 0:c.getRotation()),h=ye(s,l),d=h.width,g=h.height,y=le(G(G({},s),{rotation:l})),b=it(0,0,0),m=(n=wt(c==null?void 0:c.getBorderColor()))!==null&&n!==void 0?n:b,S=wt(c==null?void 0:c.getBackgroundColor()),F=wt(c==null?void 0:c.getBackgroundColor(),.8),T=(i=o??a)!==null&&i!==void 0?i:b;Vt(o?t:r.acroField,T);var P={x:0+f/2,y:0+f/2,width:d-f,height:g-f,thickness:1.5,borderWidth:f,borderColor:m,markColor:T};return{normal:{on:rt(y,Rr(G(G({},P),{color:S,filled:!0}))),off:rt(y,Rr(G(G({},P),{color:S,filled:!1})))},down:{on:rt(y,Rr(G(G({},P),{color:F,filled:!0}))),off:rt(y,Rr(G(G({},P),{color:F,filled:!1})))}}},vc=function(r,t){var e,n,i,o=Ut(t),a=Ut(r.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),u=t.getBorderStyle(),f=(e=u==null?void 0:u.getWidth())!==null&&e!==void 0?e:0,l=$t(c==null?void 0:c.getRotation()),h=ye(s,l),d=h.width,g=h.height,y=le(G(G({},s),{rotation:l})),b=it(0,0,0),m=(n=wt(c==null?void 0:c.getBorderColor()))!==null&&n!==void 0?n:b,S=wt(c==null?void 0:c.getBackgroundColor()),F=wt(c==null?void 0:c.getBackgroundColor(),.8),T=(i=o??a)!==null&&i!==void 0?i:b;Vt(o?t:r.acroField,T);var P={x:d/2,y:g/2,width:d-f,height:g-f,borderWidth:f,borderColor:m,dotColor:T};return{normal:{on:rt(y,Br(G(G({},P),{color:S,filled:!0}))),off:rt(y,Br(G(G({},P),{color:S,filled:!1})))},down:{on:rt(y,Br(G(G({},P),{color:F,filled:!0}))),off:rt(y,Br(G(G({},P),{color:F,filled:!1})))}}},pc=function(r,t,e){var n,i,o,a,s,c=Ut(t),u=Ut(r.acroField),f=ce(t),l=ce(r.acroField),h=t.getRectangle(),d=t.getAppearanceCharacteristics(),g=t.getBorderStyle(),y=d==null?void 0:d.getCaptions(),b=(n=y==null?void 0:y.normal)!==null&&n!==void 0?n:"",m=(o=(i=y==null?void 0:y.down)!==null&&i!==void 0?i:b)!==null&&o!==void 0?o:"",S=(a=g==null?void 0:g.getWidth())!==null&&a!==void 0?a:0,F=$t(d==null?void 0:d.getRotation()),T=ye(h,F),P=T.width,w=T.height,D=le(G(G({},h),{rotation:F})),R=it(0,0,0),B=wt(d==null?void 0:d.getBorderColor()),j=wt(d==null?void 0:d.getBackgroundColor()),E=wt(d==null?void 0:d.getBackgroundColor(),.8),U={x:S,y:S,width:P-S*2,height:w-S*2},O=Qr(b,{alignment:pt.Center,fontSize:f??l,font:e,bounds:U}),Z=Qr(m,{alignment:pt.Center,fontSize:f??l,font:e,bounds:U}),X=Math.min(O.fontSize,Z.fontSize),N=(s=c??u)!==null&&s!==void 0?s:R;Vt(c||f!==void 0?t:r.acroField,N,e,X);var ut={x:0+S/2,y:0+S/2,width:P-S,height:w-S,borderWidth:S,borderColor:B,textColor:N,font:e.name,fontSize:X};return{normal:rt(D,zi(G(G({},ut),{color:j,textLines:[O.line]}))),down:rt(D,zi(G(G({},ut),{color:E,textLines:[Z.line]})))}},gc=function(r,t,e){var n,i,o,a,s=Ut(t),c=Ut(r.acroField),u=ce(t),f=ce(r.acroField),l=t.getRectangle(),h=t.getAppearanceCharacteristics(),d=t.getBorderStyle(),g=(n=r.getText())!==null&&n!==void 0?n:"",y=(i=d==null?void 0:d.getWidth())!==null&&i!==void 0?i:0,b=$t(h==null?void 0:h.getRotation()),m=ye(l,b),S=m.width,F=m.height,T=le(G(G({},l),{rotation:b})),P=it(0,0,0),w=wt(h==null?void 0:h.getBorderColor()),D=wt(h==null?void 0:h.getBackgroundColor()),R,B,j=r.isCombed()?0:1,E={x:y+j,y:y+j,width:S-(y+j)*2,height:F-(y+j)*2};if(r.isMultiline()){var U=Qo(g,{alignment:r.getAlignment(),fontSize:u??f,font:e,bounds:E});R=U.lines,B=U.fontSize}else if(r.isCombed()){var U=fc(g,{fontSize:u??f,font:e,bounds:E,cellCount:(o=r.getMaxLength())!==null&&o!==void 0?o:0});R=U.cells,B=U.fontSize}else{var U=Qr(g,{alignment:r.getAlignment(),fontSize:u??f,font:e,bounds:E});R=[U.line],B=U.fontSize}var O=(a=s??c)!==null&&a!==void 0?a:P;Vt(s||u!==void 0?t:r.acroField,O,e,B);var Z={x:0+y/2,y:0+y/2,width:S-y,height:F-y,borderWidth:y??0,borderColor:w,textColor:O,font:e.name,fontSize:B,color:D,textLines:R,padding:j};return rt(T,Xo(Z))},yc=function(r,t,e){var n,i,o,a=Ut(t),s=Ut(r.acroField),c=ce(t),u=ce(r.acroField),f=t.getRectangle(),l=t.getAppearanceCharacteristics(),h=t.getBorderStyle(),d=(n=r.getSelected()[0])!==null&&n!==void 0?n:"",g=(i=h==null?void 0:h.getWidth())!==null&&i!==void 0?i:0,y=$t(l==null?void 0:l.getRotation()),b=ye(f,y),m=b.width,S=b.height,F=le(G(G({},f),{rotation:y})),T=it(0,0,0),P=wt(l==null?void 0:l.getBorderColor()),w=wt(l==null?void 0:l.getBackgroundColor()),D=1,R={x:g+D,y:g+D,width:m-(g+D)*2,height:S-(g+D)*2},B=Qr(d,{alignment:pt.Left,fontSize:c??u,font:e,bounds:R}),j=B.line,E=B.fontSize,U=(o=a??s)!==null&&o!==void 0?o:T;Vt(a||c!==void 0?t:r.acroField,U,e,E);var O={x:0+g/2,y:0+g/2,width:m-g,height:S-g,borderWidth:g??0,borderColor:P,textColor:U,font:e.name,fontSize:E,color:w,textLines:[j],padding:D};return rt(F,Xo(O))},mc=function(r,t,e){var n,i,o=Ut(t),a=Ut(r.acroField),s=ce(t),c=ce(r.acroField),u=t.getRectangle(),f=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),h=(n=l==null?void 0:l.getWidth())!==null&&n!==void 0?n:0,d=$t(f==null?void 0:f.getRotation()),g=ye(u,d),y=g.width,b=g.height,m=le(G(G({},u),{rotation:d})),S=it(0,0,0),F=wt(f==null?void 0:f.getBorderColor()),T=wt(f==null?void 0:f.getBackgroundColor()),P=r.getOptions(),w=r.getSelected();r.isSorted()&&P.sort();for(var D="",R=0,B=P.length;R<B;R++)D+=P[R],R<B-1&&(D+=`
`);for(var j=1,E={x:h+j,y:h+j,width:y-(h+j)*2,height:b-(h+j)*2},U=Qo(D,{alignment:pt.Left,fontSize:s??c,font:e,bounds:E}),O=U.lines,Z=U.fontSize,X=U.lineHeight,N=[],R=0,B=O.length;R<B;R++){var ut=O[R];w.includes(ut.text)&&N.push(R)}var Rt=it(153/255,193/255,218/255),Ct=(i=o??a)!==null&&i!==void 0?i:S;return Vt(o||s!==void 0?t:r.acroField,Ct,e,Z),rt(m,Ju({x:0+h/2,y:0+h/2,width:y-h,height:b-h,borderWidth:h??0,borderColor:F,textColor:Ct,font:e.name,fontSize:Z,color:T,textLines:O,lineHeight:X,selectedColor:Rt,selectedLines:N,padding:j}))},_o=function(){function r(t,e,n){this.alreadyEmbedded=!1,x(t,"ref",[[st,"PDFRef"]]),x(e,"doc",[[Qt,"PDFDocument"]]),x(n,"embedder",[[wo,"PDFPageEmbedder"]]),this.ref=t,this.doc=e,this.width=n.width,this.height=n.height,this.embedder=n}return r.prototype.scale=function(t){return x(t,"factor",["number"]),{width:this.width*t,height:this.height*t}},r.prototype.size=function(){return this.scale(1)},r.prototype.embed=function(){return Y(this,void 0,void 0,function(){return J(this,function(t){switch(t.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:t.sent(),this.alreadyEmbedded=!0,t.label=2;case 2:return[2]}})})},r.of=function(t,e,n){return new r(t,e,n)},r}(),Ot=function(){function r(t,e,n){this.modified=!0,x(t,"ref",[[st,"PDFRef"]]),x(e,"doc",[[Qt,"PDFDocument"]]),x(n,"embedder",[[Zn,"CustomFontEmbedder"],[Kr,"StandardFontEmbedder"]]),this.ref=t,this.doc=e,this.name=n.fontName,this.embedder=n}return r.prototype.encodeText=function(t){return x(t,"text",["string"]),this.modified=!0,this.embedder.encodeText(t)},r.prototype.widthOfTextAtSize=function(t,e){return x(t,"text",["string"]),x(e,"size",["number"]),this.embedder.widthOfTextAtSize(t,e)},r.prototype.heightAtSize=function(t,e){var n;return x(t,"size",["number"]),k(e==null?void 0:e.descender,"options.descender",["boolean"]),this.embedder.heightOfFontAtSize(t,{descender:(n=e==null?void 0:e.descender)!==null&&n!==void 0?n:!0})},r.prototype.sizeAtHeight=function(t){return x(t,"height",["number"]),this.embedder.sizeOfFontAtHeight(t)},r.prototype.getCharacterSet=function(){return this.embedder instanceof Kr?this.embedder.encoding.supportedCodePoints:this.embedder.font.characterSet},r.prototype.embed=function(){return Y(this,void 0,void 0,function(){return J(this,function(t){switch(t.label){case 0:return this.modified?[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]:[3,2];case 1:t.sent(),this.modified=!1,t.label=2;case 2:return[2]}})})},r.of=function(t,e,n){return new r(t,e,n)},r}(),Mn=function(){function r(t,e,n){x(t,"ref",[[st,"PDFRef"]]),x(e,"doc",[[Qt,"PDFDocument"]]),x(n,"embedder",[[bo,"JpegEmbedder"],[xo,"PngEmbedder"]]),this.ref=t,this.doc=e,this.width=n.width,this.height=n.height,this.embedder=n}return r.prototype.scale=function(t){return x(t,"factor",["number"]),{width:this.width*t,height:this.height*t}},r.prototype.scaleToFit=function(t,e){x(t,"width",["number"]),x(e,"height",["number"]);var n=t/this.width,i=e/this.height,o=Math.min(n,i);return this.scale(o)},r.prototype.size=function(){return this.scale(1)},r.prototype.embed=function(){return Y(this,void 0,void 0,function(){var t,e,n;return J(this,function(i){switch(i.label){case 0:return this.embedder?(this.embedTask||(t=this,e=t.doc,n=t.ref,this.embedTask=this.embedder.embedIntoContext(e.context,n)),[4,this.embedTask]):[2];case 1:return i.sent(),this.embedder=void 0,[2]}})})},r.of=function(t,e,n){return new r(t,e,n)},r}(),ae;(function(r){r[r.Left=0]="Left",r[r.Center=1]="Center",r[r.Right=2]="Right"})(ae||(ae={}));var Ne=function(r){k(r==null?void 0:r.x,"options.x",["number"]),k(r==null?void 0:r.y,"options.y",["number"]),k(r==null?void 0:r.width,"options.width",["number"]),k(r==null?void 0:r.height,"options.height",["number"]),k(r==null?void 0:r.textColor,"options.textColor",[[Object,"Color"]]),k(r==null?void 0:r.backgroundColor,"options.backgroundColor",[[Object,"Color"]]),k(r==null?void 0:r.borderColor,"options.borderColor",[[Object,"Color"]]),k(r==null?void 0:r.borderWidth,"options.borderWidth",["number"]),k(r==null?void 0:r.rotate,"options.rotate",[[Object,"Rotation"]])},xe=function(){function r(t,e,n){x(t,"acroField",[[Be,"PDFAcroTerminal"]]),x(e,"ref",[[st,"PDFRef"]]),x(n,"doc",[[Qt,"PDFDocument"]]),this.acroField=t,this.ref=e,this.doc=n}return r.prototype.getName=function(){var t;return(t=this.acroField.getFullyQualifiedName())!==null&&t!==void 0?t:""},r.prototype.isReadOnly=function(){return this.acroField.hasFlag(qt.ReadOnly)},r.prototype.enableReadOnly=function(){this.acroField.setFlagTo(qt.ReadOnly,!0)},r.prototype.disableReadOnly=function(){this.acroField.setFlagTo(qt.ReadOnly,!1)},r.prototype.isRequired=function(){return this.acroField.hasFlag(qt.Required)},r.prototype.enableRequired=function(){this.acroField.setFlagTo(qt.Required,!0)},r.prototype.disableRequired=function(){this.acroField.setFlagTo(qt.Required,!1)},r.prototype.isExported=function(){return!this.acroField.hasFlag(qt.NoExport)},r.prototype.enableExporting=function(){this.acroField.setFlagTo(qt.NoExport,!1)},r.prototype.disableExporting=function(){this.acroField.setFlagTo(qt.NoExport,!0)},r.prototype.needsAppearancesUpdate=function(){throw new Mt(this.constructor.name,"needsAppearancesUpdate")},r.prototype.defaultUpdateAppearances=function(t){throw new Mt(this.constructor.name,"defaultUpdateAppearances")},r.prototype.markAsDirty=function(){this.doc.getForm().markFieldAsDirty(this.ref)},r.prototype.markAsClean=function(){this.doc.getForm().markFieldAsClean(this.ref)},r.prototype.isDirty=function(){return this.doc.getForm().fieldIsDirty(this.ref)},r.prototype.createWidget=function(t){var e,n=t.textColor,i=t.backgroundColor,o=t.borderColor,a=t.borderWidth,s=jo(t.rotate),c=t.caption,u=t.x,f=t.y,l=t.width+a,h=t.height+a,d=!!t.hidden,g=t.page;lo(s,"degreesAngle",90);var y=En.create(this.doc.context,this.ref),b=ku({x:u,y:f,width:l,height:h},a,s);y.setRectangle(b),g&&y.setP(g);var m=y.getOrCreateAppearanceCharacteristics();i&&m.setBackgroundColor(Mi(i)),m.setRotation(s),c&&m.setCaptions({normal:c}),o&&m.setBorderColor(Mi(o));var S=y.getOrCreateBorderStyle();if(a!==void 0&&S.setWidth(a),y.setFlagTo(rr.Print,!0),y.setFlagTo(rr.Hidden,d),y.setFlagTo(rr.Invisible,!1),n){var F=(e=this.acroField.getDefaultAppearance())!==null&&e!==void 0?e:"",T=F+`
`+be(n).toString();this.acroField.setDefaultAppearance(T)}return y},r.prototype.updateWidgetAppearanceWithFont=function(t,e,n){var i=n.normal,o=n.rollover,a=n.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceStream(t,i,e),rollover:o&&this.createAppearanceStream(t,o,e),down:a&&this.createAppearanceStream(t,a,e)})},r.prototype.updateOnOffWidgetAppearance=function(t,e,n){var i=n.normal,o=n.rollover,a=n.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceDict(t,i,e),rollover:o&&this.createAppearanceDict(t,o,e),down:a&&this.createAppearanceDict(t,a,e)})},r.prototype.updateWidgetAppearances=function(t,e){var n=e.normal,i=e.rollover,o=e.down;t.setNormalAppearance(n),i?t.setRolloverAppearance(i):t.removeRolloverAppearance(),o?t.setDownAppearance(o):t.removeDownAppearance()},r.prototype.createAppearanceStream=function(t,e,n){var i,o=this.acroField.dict.context,a=t.getRectangle(),s=a.width,c=a.height,u=n&&{Font:(i={},i[n.name]=n.ref,i)},f=o.formXObject(e,{Resources:u,BBox:o.obj([0,0,s,c]),Matrix:o.obj([1,0,0,1,0,0])}),l=o.register(f);return l},r.prototype.createImageAppearanceStream=function(t,e,n){var i,o,a=this.acroField.dict.context,s=t.getRectangle(),c=t.getAppearanceCharacteristics(),u=t.getBorderStyle(),f=(o=u==null?void 0:u.getWidth())!==null&&o!==void 0?o:0,l=$t(c==null?void 0:c.getRotation()),h=le(G(G({},s),{rotation:l})),d=ye(s,l),g=e.scaleToFit(d.width-f*2,d.height-f*2),y={x:f,y:f,width:g.width,height:g.height,rotate:z(0),xSkew:z(0),ySkew:z(0)};n===ae.Center?(y.x+=(d.width-f*2)/2-g.width/2,y.y+=(d.height-f*2)/2-g.height/2):n===ae.Right&&(y.x=d.width-f-g.width,y.y=d.height-f-g.height);var b=this.doc.context.addRandomSuffix("Image",10),m=rt(h,Lo(b,y)),S={XObject:(i={},i[b]=e.ref,i)},F=a.formXObject(m,{Resources:S,BBox:a.obj([0,0,s.width,s.height]),Matrix:a.obj([1,0,0,1,0,0])});return a.register(F)},r.prototype.createAppearanceDict=function(t,e,n){var i=this.acroField.dict.context,o=this.createAppearanceStream(t,e.on),a=this.createAppearanceStream(t,e.off),s=i.obj({});return s.set(n,o),s.set(v.of("Off"),a),s},r}(),He=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroCheckBox",[[an,"PDFAcroCheckBox"]]),o.acroField=e,o}return t.prototype.check=function(){var e,n=(e=this.acroField.getOnValue())!==null&&e!==void 0?e:v.of("Yes");this.markAsDirty(),this.acroField.setValue(n)},t.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(v.of("Off"))},t.prototype.isChecked=function(){var e=this.acroField.getOnValue();return!!e&&e===this.acroField.getValue()},t.prototype.addToPage=function(e,n){var i,o,a,s,c,u;x(e,"page",[[Nt,"PDFPage"]]),Ne(n),n||(n={}),"textColor"in n||(n.textColor=it(0,0,0)),"backgroundColor"in n||(n.backgroundColor=it(1,1,1)),"borderColor"in n||(n.borderColor=it(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var f=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:(a=n.width)!==null&&a!==void 0?a:50,height:(s=n.height)!==null&&s!==void 0?s:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(c=n.borderWidth)!==null&&c!==void 0?c:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:z(0),hidden:n.hidden,page:e.ref}),l=this.doc.context.register(f.dict);this.acroField.addWidget(l),f.setAppearanceState(v.of("Off")),this.updateWidgetAppearance(f,v.of("Yes")),e.node.addAnnot(l)},t.prototype.needsAppearancesUpdate=function(){for(var e,n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=a.getAppearanceState(),c=(e=a.getAppearances())===null||e===void 0?void 0:e.normal;if(!(c instanceof H)||s&&!c.has(s))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){var n;k(e,"provider",[Function]);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o],c=(n=s.getOnValue())!==null&&n!==void 0?n:v.of("Yes");c&&this.updateWidgetAppearance(s,c,e)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??dc,a=je(o(this,e));this.updateOnOffWidgetAppearance(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),Mr=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroComboBox",[[sn,"PDFAcroComboBox"]]),o.acroField=e,o}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),n=new Array(e.length),i=0,o=n.length;i<o;i++){var a=e[i],s=a.display,c=a.value;n[i]=(s??c).decodeText()}return n},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=e[i].decodeText();return n},t.prototype.setOptions=function(e){x(e,"options",[Array]);for(var n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]={value:V.fromText(e[i])};this.acroField.setOptions(n)},t.prototype.addOptions=function(e){x(e,"options",["string",Array]);for(var n=Array.isArray(e)?e:[e],i=this.acroField.getOptions(),o=new Array(n.length),a=0,s=n.length;a<s;a++)o[a]={value:V.fromText(n[a])};this.acroField.setOptions(i.concat(o))},t.prototype.select=function(e,n){n===void 0&&(n=!1),x(e,"options",["string",Array]),x(n,"merge",["boolean"]);var i=Array.isArray(e)?e:[e],o=this.getOptions(),a=i.find(function(l){return!o.includes(l)});a&&this.enableEditing(),this.markAsDirty(),(i.length>1||i.length===1&&n)&&this.enableMultiselect();for(var s=new Array(i.length),c=0,u=i.length;c<u;c++)s[c]=V.fromText(i[c]);if(n){var f=this.acroField.getValues();this.acroField.setValues(f.concat(s))}else this.acroField.setValues(s)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){nn(e,"fontSize"),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isEditable=function(){return this.acroField.hasFlag(ot.Edit)},t.prototype.enableEditing=function(){this.acroField.setFlagTo(ot.Edit,!0)},t.prototype.disableEditing=function(){this.acroField.setFlagTo(ot.Edit,!1)},t.prototype.isSorted=function(){return this.acroField.hasFlag(ot.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(ot.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(ot.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(ot.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(ot.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(ot.MultiSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(ot.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(ot.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(ot.DoNotSpellCheck,!0)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(ot.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(ot.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(ot.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,n){var i,o,a,s,c,u,f;x(e,"page",[[Nt,"PDFPage"]]),Ne(n),n||(n={}),"textColor"in n||(n.textColor=it(0,0,0)),"backgroundColor"in n||(n.backgroundColor=it(1,1,1)),"borderColor"in n||(n.borderColor=it(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var l=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(s=n.height)!==null&&s!==void 0?s:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(c=n.borderWidth)!==null&&c!==void 0?c:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:z(0),hidden:n.hidden,page:e.ref}),h=this.doc.context.register(l.dict);this.acroField.addWidget(h);var d=(f=n.font)!==null&&f!==void 0?f:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(l,d),e.node.addAnnot(h)},t.prototype.needsAppearancesUpdate=function(){var e;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=((e=a.getAppearances())===null||e===void 0?void 0:e.normal)instanceof At;if(!s)return!0}return!1},t.prototype.defaultUpdateAppearances=function(e){x(e,"font",[[Ot,"PDFFont"]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,n){x(e,"font",[[Ot,"PDFFont"]]),k(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o];this.updateWidgetAppearance(s,e,n)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??yc,a=je(o(this,e,n));this.updateWidgetAppearanceWithFont(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),Ir=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroListBox",[[ln,"PDFAcroListBox"]]),o.acroField=e,o}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),n=new Array(e.length),i=0,o=n.length;i<o;i++){var a=e[i],s=a.display,c=a.value;n[i]=(s??c).decodeText()}return n},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=e[i].decodeText();return n},t.prototype.setOptions=function(e){x(e,"options",[Array]),this.markAsDirty();for(var n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]={value:V.fromText(e[i])};this.acroField.setOptions(n)},t.prototype.addOptions=function(e){x(e,"options",["string",Array]),this.markAsDirty();for(var n=Array.isArray(e)?e:[e],i=this.acroField.getOptions(),o=new Array(n.length),a=0,s=n.length;a<s;a++)o[a]={value:V.fromText(n[a])};this.acroField.setOptions(i.concat(o))},t.prototype.select=function(e,n){n===void 0&&(n=!1),x(e,"options",["string",Array]),x(n,"merge",["boolean"]);var i=Array.isArray(e)?e:[e],o=this.getOptions();gs(i,"option",o),this.markAsDirty(),(i.length>1||i.length===1&&n)&&this.enableMultiselect();for(var a=new Array(i.length),s=0,c=i.length;s<c;s++)a[s]=V.fromText(i[s]);if(n){var u=this.acroField.getValues();this.acroField.setValues(u.concat(a))}else this.acroField.setValues(a)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){nn(e,"fontSize"),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isSorted=function(){return this.acroField.hasFlag(ot.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(ot.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(ot.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(ot.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(ot.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(ot.MultiSelect,!1)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(ot.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(ot.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(ot.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,n){var i,o,a,s,c,u,f;x(e,"page",[[Nt,"PDFPage"]]),Ne(n),n||(n={}),"textColor"in n||(n.textColor=it(0,0,0)),"backgroundColor"in n||(n.backgroundColor=it(1,1,1)),"borderColor"in n||(n.borderColor=it(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var l=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(s=n.height)!==null&&s!==void 0?s:100,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(c=n.borderWidth)!==null&&c!==void 0?c:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:z(0),hidden:n.hidden,page:e.ref}),h=this.doc.context.register(l.dict);this.acroField.addWidget(h);var d=(f=n.font)!==null&&f!==void 0?f:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(l,d),e.node.addAnnot(h)},t.prototype.needsAppearancesUpdate=function(){var e;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=((e=a.getAppearances())===null||e===void 0?void 0:e.normal)instanceof At;if(!s)return!0}return!1},t.prototype.defaultUpdateAppearances=function(e){x(e,"font",[[Ot,"PDFFont"]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,n){x(e,"font",[[Ot,"PDFFont"]]),k(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o];this.updateWidgetAppearance(s,e,n)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??mc,a=je(o(this,e,n));this.updateWidgetAppearanceWithFont(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),Ze=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroRadioButton",[[fn,"PDFAcroRadioButton"]]),o.acroField=e,o}return t.prototype.getOptions=function(){var e=this.acroField.getExportValues();if(e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=e[i].decodeText();return n}for(var a=this.acroField.getOnValues(),s=new Array(a.length),i=0,o=s.length;i<o;i++)s[i]=a[i].decodeText();return s},t.prototype.getSelected=function(){var e=this.acroField.getValue();if(e!==v.of("Off")){var n=this.acroField.getExportValues();if(n){for(var i=this.acroField.getOnValues(),o=0,a=i.length;o<a;o++)if(i[o]===e)return n[o].decodeText()}return e.decodeText()}},t.prototype.select=function(e){x(e,"option",["string"]);var n=this.getOptions();ie(e,"option",n),this.markAsDirty();var i=this.acroField.getOnValues(),o=this.acroField.getExportValues();if(o)for(var a=0,s=o.length;a<s;a++)o[a].decodeText()===e&&this.acroField.setValue(i[a]);else for(var a=0,s=i.length;a<s;a++){var c=i[a];c.decodeText()===e&&this.acroField.setValue(c)}},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValue(v.of("Off"))},t.prototype.isOffToggleable=function(){return!this.acroField.hasFlag(jt.NoToggleToOff)},t.prototype.enableOffToggling=function(){this.acroField.setFlagTo(jt.NoToggleToOff,!1)},t.prototype.disableOffToggling=function(){this.acroField.setFlagTo(jt.NoToggleToOff,!0)},t.prototype.isMutuallyExclusive=function(){return!this.acroField.hasFlag(jt.RadiosInUnison)},t.prototype.enableMutualExclusion=function(){this.acroField.setFlagTo(jt.RadiosInUnison,!1)},t.prototype.disableMutualExclusion=function(){this.acroField.setFlagTo(jt.RadiosInUnison,!0)},t.prototype.addOptionToPage=function(e,n,i){var o,a,s,c,u,f,l,h,d;x(e,"option",["string"]),x(n,"page",[[Nt,"PDFPage"]]),Ne(i);var g=this.createWidget({x:(o=i==null?void 0:i.x)!==null&&o!==void 0?o:0,y:(a=i==null?void 0:i.y)!==null&&a!==void 0?a:0,width:(s=i==null?void 0:i.width)!==null&&s!==void 0?s:50,height:(c=i==null?void 0:i.height)!==null&&c!==void 0?c:50,textColor:(u=i==null?void 0:i.textColor)!==null&&u!==void 0?u:it(0,0,0),backgroundColor:(f=i==null?void 0:i.backgroundColor)!==null&&f!==void 0?f:it(1,1,1),borderColor:(l=i==null?void 0:i.borderColor)!==null&&l!==void 0?l:it(0,0,0),borderWidth:(h=i==null?void 0:i.borderWidth)!==null&&h!==void 0?h:1,rotate:(d=i==null?void 0:i.rotate)!==null&&d!==void 0?d:z(0),hidden:i==null?void 0:i.hidden,page:n.ref}),y=this.doc.context.register(g.dict),b=this.acroField.addWidgetWithOpt(y,V.fromText(e),!this.isMutuallyExclusive());g.setAppearanceState(v.of("Off")),this.updateWidgetAppearance(g,b),n.node.addAnnot(y)},t.prototype.needsAppearancesUpdate=function(){for(var e,n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=a.getAppearanceState(),c=(e=a.getAppearances())===null||e===void 0?void 0:e.normal;if(!(c instanceof H)||s&&!c.has(s))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){k(e,"provider",[Function]);for(var n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=a.getOnValue();s&&this.updateWidgetAppearance(a,s,e)}},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??vc,a=je(o(this,e));this.updateOnOffWidgetAppearance(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),In=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroSignature",[[Jn,"PDFAcroSignature"]]),o.acroField=e,o}return t.prototype.needsAppearancesUpdate=function(){return!1},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),Ur=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroText",[[un,"PDFAcroText"]]),o.acroField=e,o}return t.prototype.getText=function(){var e=this.acroField.getValue();if(!e&&this.isRichFormatted())throw new nc(this.getName());return e==null?void 0:e.decodeText()},t.prototype.setText=function(e){k(e,"text",["string"]);var n=this.getMaxLength();if(n!==void 0&&e&&e.length>n)throw new oc(e.length,n,this.getName());this.markAsDirty(),this.disableRichFormatting(),e?this.acroField.setValue(V.fromText(e)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var e=this.acroField.getQuadding();return e===0?pt.Left:e===1?pt.Center:e===2?pt.Right:pt.Left},t.prototype.setAlignment=function(e){ie(e,"alignment",pt),this.markAsDirty(),this.acroField.setQuadding(e)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(e){if(Wt(e,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),e===void 0)this.acroField.removeMaxLength();else{var n=this.getText();if(n&&n.length>e)throw new ac(n.length,e,this.getName());this.acroField.setMaxLength(e)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(e){for(var n=this.getAlignment(),i=n===pt.Center?ae.Center:n===pt.Right?ae.Right:ae.Left,o=this.acroField.getWidgets(),a=0,s=o.length;a<s;a++){var c=o[a],u=this.createImageAppearanceStream(c,e,i);this.updateWidgetAppearances(c,{normal:u})}this.markAsClean()},t.prototype.setFontSize=function(e){nn(e,"fontSize"),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isMultiline=function(){return this.acroField.hasFlag(ft.Multiline)},t.prototype.enableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(ft.Multiline,!0)},t.prototype.disableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(ft.Multiline,!1)},t.prototype.isPassword=function(){return this.acroField.hasFlag(ft.Password)},t.prototype.enablePassword=function(){this.acroField.setFlagTo(ft.Password,!0)},t.prototype.disablePassword=function(){this.acroField.setFlagTo(ft.Password,!1)},t.prototype.isFileSelector=function(){return this.acroField.hasFlag(ft.FileSelect)},t.prototype.enableFileSelection=function(){this.acroField.setFlagTo(ft.FileSelect,!0)},t.prototype.disableFileSelection=function(){this.acroField.setFlagTo(ft.FileSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(ft.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(ft.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(ft.DoNotSpellCheck,!0)},t.prototype.isScrollable=function(){return!this.acroField.hasFlag(ft.DoNotScroll)},t.prototype.enableScrolling=function(){this.acroField.setFlagTo(ft.DoNotScroll,!1)},t.prototype.disableScrolling=function(){this.acroField.setFlagTo(ft.DoNotScroll,!0)},t.prototype.isCombed=function(){return this.acroField.hasFlag(ft.Comb)&&!this.isMultiline()&&!this.isPassword()&&!this.isFileSelector()&&this.getMaxLength()!==void 0},t.prototype.enableCombing=function(){if(this.getMaxLength()===void 0){var e="PDFTextFields must have a max length in order to be combed";console.warn(e)}this.markAsDirty(),this.disableMultiline(),this.disablePassword(),this.disableFileSelection(),this.acroField.setFlagTo(ft.Comb,!0)},t.prototype.disableCombing=function(){this.markAsDirty(),this.acroField.setFlagTo(ft.Comb,!1)},t.prototype.isRichFormatted=function(){return this.acroField.hasFlag(ft.RichText)},t.prototype.enableRichFormatting=function(){this.acroField.setFlagTo(ft.RichText,!0)},t.prototype.disableRichFormatting=function(){this.acroField.setFlagTo(ft.RichText,!1)},t.prototype.addToPage=function(e,n){var i,o,a,s,c,u,f;x(e,"page",[[Nt,"PDFPage"]]),Ne(n),n||(n={}),"textColor"in n||(n.textColor=it(0,0,0)),"backgroundColor"in n||(n.backgroundColor=it(1,1,1)),"borderColor"in n||(n.borderColor=it(0,0,0)),"borderWidth"in n||(n.borderWidth=1);var l=this.createWidget({x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:(a=n.width)!==null&&a!==void 0?a:200,height:(s=n.height)!==null&&s!==void 0?s:50,textColor:n.textColor,backgroundColor:n.backgroundColor,borderColor:n.borderColor,borderWidth:(c=n.borderWidth)!==null&&c!==void 0?c:0,rotate:(u=n.rotate)!==null&&u!==void 0?u:z(0),hidden:n.hidden,page:e.ref}),h=this.doc.context.register(l.dict);this.acroField.addWidget(h);var d=(f=n.font)!==null&&f!==void 0?f:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(l,d),e.node.addAnnot(h)},t.prototype.needsAppearancesUpdate=function(){var e;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=((e=a.getAppearances())===null||e===void 0?void 0:e.normal)instanceof At;if(!s)return!0}return!1},t.prototype.defaultUpdateAppearances=function(e){x(e,"font",[[Ot,"PDFFont"]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,n){x(e,"font",[[Ot,"PDFFont"]]),k(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o];this.updateWidgetAppearance(s,e,n)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??gc,a=je(o(this,e,n));this.updateWidgetAppearanceWithFont(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe),cr;(function(r){r.Courier="Courier",r.CourierBold="Courier-Bold",r.CourierOblique="Courier-Oblique",r.CourierBoldOblique="Courier-BoldOblique",r.Helvetica="Helvetica",r.HelveticaBold="Helvetica-Bold",r.HelveticaOblique="Helvetica-Oblique",r.HelveticaBoldOblique="Helvetica-BoldOblique",r.TimesRoman="Times-Roman",r.TimesRomanBold="Times-Bold",r.TimesRomanItalic="Times-Italic",r.TimesRomanBoldItalic="Times-BoldItalic",r.Symbol="Symbol",r.ZapfDingbats="ZapfDingbats"})(cr||(cr={}));var bc=function(){function r(t,e){var n=this;this.embedDefaultFont=function(){return n.doc.embedStandardFont(cr.Helvetica)},x(t,"acroForm",[[Xr,"PDFAcroForm"]]),x(e,"doc",[[Qt,"PDFDocument"]]),this.acroForm=t,this.doc=e,this.dirtyFields=new Set,this.defaultFontCache=Yt.populatedBy(this.embedDefaultFont)}return r.prototype.hasXFA=function(){return this.acroForm.dict.has(v.of("XFA"))},r.prototype.deleteXFA=function(){this.acroForm.dict.delete(v.of("XFA"))},r.prototype.getFields=function(){for(var t=this.acroForm.getAllFields(),e=[],n=0,i=t.length;n<i;n++){var o=t[n],a=o[0],s=o[1],c=xc(a,s,this.doc);c&&e.push(c)}return e},r.prototype.getFieldMaybe=function(t){x(t,"name",["string"]);for(var e=this.getFields(),n=0,i=e.length;n<i;n++){var o=e[n];if(o.getName()===t)return o}},r.prototype.getField=function(t){x(t,"name",["string"]);var e=this.getFieldMaybe(t);if(e)return e;throw new ec(t)},r.prototype.getButton=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof Vr)return e;throw new he(t,Vr,e)},r.prototype.getCheckBox=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof He)return e;throw new he(t,He,e)},r.prototype.getDropdown=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof Mr)return e;throw new he(t,Mr,e)},r.prototype.getOptionList=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof Ir)return e;throw new he(t,Ir,e)},r.prototype.getRadioGroup=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof Ze)return e;throw new he(t,Ze,e)},r.prototype.getSignature=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof In)return e;throw new he(t,In,e)},r.prototype.getTextField=function(t){x(t,"name",["string"]);var e=this.getField(t);if(e instanceof Ur)return e;throw new he(t,Ur,e)},r.prototype.createButton=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=cn.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),Vr.of(i,i.ref,this.doc)},r.prototype.createCheckBox=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=an.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),He.of(i,i.ref,this.doc)},r.prototype.createDropdown=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=sn.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),Mr.of(i,i.ref,this.doc)},r.prototype.createOptionList=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=ln.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),Ir.of(i,i.ref,this.doc)},r.prototype.createRadioGroup=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=fn.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),Ze.of(i,i.ref,this.doc)},r.prototype.createTextField=function(t){x(t,"name",["string"]);var e=we(t),n=this.findOrCreateNonTerminals(e.nonTerminal),i=un.create(this.doc.context);return i.setPartialName(e.terminal),Ce(n,[i,i.ref],e.terminal),Ur.of(i,i.ref,this.doc)},r.prototype.flatten=function(t){t===void 0&&(t={updateFieldAppearances:!0}),t.updateFieldAppearances&&this.updateFieldAppearances();for(var e=this.getFields(),n=0,i=e.length;n<i;n++){for(var o=e[n],a=o.acroField.getWidgets(),s=0,c=a.length;s<c;s++){var u=a[s],f=this.findWidgetPage(u),l=this.findWidgetAppearanceRef(o,u),h=f.node.newXObject("FlatWidget",l),d=u.getRectangle(),g=rt([gt(),It(d.x,d.y)],le(G(G({},d),{rotation:0})),[ii(h),yt()]).filter(Boolean);f.pushOperators.apply(f,g)}this.removeField(o)}},r.prototype.removeField=function(t){for(var e=t.acroField.getWidgets(),n=new Set,i=0,o=e.length;i<o;i++){var a=e[i],s=this.findWidgetAppearanceRef(t,a),c=this.findWidgetPage(a);n.add(c),c.node.removeAnnot(s)}n.forEach(function(d){return d.node.removeAnnot(t.ref)}),this.acroForm.removeField(t.acroField);for(var u=t.acroField.normalizedEntries().Kids,f=u.size(),l=0;l<f;l++){var h=u.get(l);h instanceof st&&this.doc.context.delete(h)}this.doc.context.delete(t.ref)},r.prototype.updateFieldAppearances=function(t){k(t,"font",[[Ot,"PDFFont"]]),t=t??this.getDefaultFont();for(var e=this.getFields(),n=0,i=e.length;n<i;n++){var o=e[n];o.needsAppearancesUpdate()&&o.defaultUpdateAppearances(t)}},r.prototype.markFieldAsDirty=function(t){k(t,"fieldRef",[[st,"PDFRef"]]),this.dirtyFields.add(t)},r.prototype.markFieldAsClean=function(t){k(t,"fieldRef",[[st,"PDFRef"]]),this.dirtyFields.delete(t)},r.prototype.fieldIsDirty=function(t){return k(t,"fieldRef",[[st,"PDFRef"]]),this.dirtyFields.has(t)},r.prototype.getDefaultFont=function(){return this.defaultFontCache.access()},r.prototype.findWidgetPage=function(t){var e=t.P(),n=this.doc.getPages().find(function(o){return o.ref===e});if(n===void 0){var i=this.doc.context.getObjectRef(t.dict);if(i===void 0)throw new Error("Could not find PDFRef for PDFObject");if(n=this.doc.findPageForAnnotationRef(i),n===void 0)throw new Error("Could not find page for PDFRef "+i)}return n},r.prototype.findWidgetAppearanceRef=function(t,e){var n,i=e.getNormalAppearance();if(i instanceof H&&(t instanceof He||t instanceof Ze)){var o=t.acroField.getValue(),a=(n=i.get(o))!==null&&n!==void 0?n:i.get(v.of("Off"));a instanceof st&&(i=a)}if(!(i instanceof st)){var s=t.getName();throw new Error("Failed to extract appearance ref for: "+s)}return i},r.prototype.findOrCreateNonTerminals=function(t){for(var e=[this.acroForm],n=0,i=t.length;n<i;n++){var o=t[n];if(!o)throw new rc(o);var a=e[0],s=e[1],c=this.findNonTerminal(o,a);if(c)e=c;else{var u=Lr.create(this.doc.context);u.setPartialName(o),u.setParent(s);var f=this.doc.context.register(u.dict);a.addField(f),e=[u,f]}}return e},r.prototype.findNonTerminal=function(t,e){for(var n=e instanceof Xr?this.acroForm.getFields():Qn(e.Kids()),i=0,o=n.length;i<o;i++){var a=n[i],s=a[0],c=a[1];if(s.getPartialName()===t){if(s instanceof Lr)return[s,c];throw new Ho(t)}}},r.of=function(t,e){return new r(t,e)},r}(),xc=function(r,t,e){if(r instanceof cn)return Vr.of(r,t,e);if(r instanceof an)return He.of(r,t,e);if(r instanceof sn)return Mr.of(r,t,e);if(r instanceof ln)return Ir.of(r,t,e);if(r instanceof un)return Ur.of(r,t,e);if(r instanceof fn)return Ze.of(r,t,e);if(r instanceof Jn)return In.of(r,t,e)},we=function(r){if(r.length===0)throw new Error("PDF field names must not be empty strings");for(var t=r.split("."),e=0,n=t.length;e<n;e++)if(t[e]==="")throw new Error('Periods in PDF field names must be separated by at least one character: "'+r+'"');return t.length===1?{nonTerminal:[],terminal:t[0]}:{nonTerminal:t.slice(0,t.length-1),terminal:t[t.length-1]}},Ce=function(r,t,e){for(var n=r[0],i=r[1],o=t[0],a=t[1],s=n.normalizedEntries(),c=Qn("Kids"in s?s.Kids:s.Fields),u=0,f=c.length;u<f;u++)if(c[u][0].getPartialName()===e)throw new Ho(e);n.addField(a),o.setParent(i)},Fc={A4:[595.28,841.89]},Un;(function(r){r[r.Fastest=1/0]="Fastest",r[r.Fast=1500]="Fast",r[r.Medium=500]="Medium",r[r.Slow=100]="Slow"})(Un||(Un={}));var Sc=function(){function r(t,e,n){this.alreadyEmbedded=!1,this.ref=t,this.doc=e,this.embedder=n}return r.prototype.embed=function(){return Y(this,void 0,void 0,function(){var t,e,n,i,o;return J(this,function(a){switch(a.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:t=a.sent(),this.doc.catalog.has(v.of("Names"))||this.doc.catalog.set(v.of("Names"),this.doc.context.obj({})),e=this.doc.catalog.lookup(v.of("Names"),H),e.has(v.of("EmbeddedFiles"))||e.set(v.of("EmbeddedFiles"),this.doc.context.obj({})),n=e.lookup(v.of("EmbeddedFiles"),H),n.has(v.of("Names"))||n.set(v.of("Names"),this.doc.context.obj([])),i=n.lookup(v.of("Names"),nt),i.push(V.fromText(this.embedder.fileName)),i.push(t),this.doc.catalog.has(v.of("AF"))||this.doc.catalog.set(v.of("AF"),this.doc.context.obj([])),o=this.doc.catalog.lookup(v.of("AF"),nt),o.push(t),this.alreadyEmbedded=!0,a.label=2;case 2:return[2]}})})},r.of=function(t,e,n){return new r(t,e,n)},r}(),wc=function(){function r(t,e,n){this.alreadyEmbedded=!1,this.ref=t,this.doc=e,this.embedder=n}return r.prototype.embed=function(){return Y(this,void 0,void 0,function(){var t,e,n,i,o,a,s;return J(this,function(c){switch(c.label){case 0:return this.alreadyEmbedded?[3,2]:(t=this.doc,e=t.catalog,n=t.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:i=c.sent(),e.has(v.of("Names"))||e.set(v.of("Names"),n.obj({})),o=e.lookup(v.of("Names"),H),o.has(v.of("JavaScript"))||o.set(v.of("JavaScript"),n.obj({})),a=o.lookup(v.of("JavaScript"),H),a.has(v.of("Names"))||a.set(v.of("Names"),n.obj([])),s=a.lookup(v.of("Names"),nt),s.push(V.fromText(this.embedder.scriptName)),s.push(i),this.alreadyEmbedded=!0,c.label=2;case 2:return[2]}})})},r.of=function(t,e,n){return new r(t,e,n)},r}(),Cc=function(){function r(t,e){this.script=t,this.scriptName=e}return r.for=function(t,e){return new r(t,e)},r.prototype.embedIntoContext=function(t,e){return Y(this,void 0,void 0,function(){var n;return J(this,function(i){return n=t.obj({Type:"Action",S:"JavaScript",JS:V.fromText(this.script)}),e?(t.assign(e,n),[2,e]):[2,t.register(n)]})})},r}(),Qt=function(){function r(t,e,n){var i=this;if(this.defaultWordBreaks=[" "],this.computePages=function(){var o=[];return i.catalog.Pages().traverse(function(a,s){if(a instanceof Jt){var c=i.pageMap.get(a);c||(c=Nt.of(a,s,i),i.pageMap.set(a,c)),o.push(c)}}),o},this.getOrCreateForm=function(){var o=i.catalog.getOrCreateAcroForm();return bc.of(o,i)},x(t,"context",[[Rn,"PDFContext"]]),x(e,"ignoreEncryption",["boolean"]),this.context=t,this.catalog=t.lookup(t.trailerInfo.Root),this.isEncrypted=!!t.lookup(t.trailerInfo.Encrypt),this.pageCache=Yt.populatedBy(this.computePages),this.pageMap=new Map,this.formCache=Yt.populatedBy(this.getOrCreateForm),this.fonts=[],this.images=[],this.embeddedPages=[],this.embeddedFiles=[],this.javaScripts=[],!e&&this.isEncrypted)throw new Qu;n&&this.updateInfoDict()}return r.load=function(t,e){return e===void 0&&(e={}),Y(this,void 0,void 0,function(){var n,i,o,a,s,c,u,f,l,h,d,g;return J(this,function(y){switch(y.label){case 0:return n=e.ignoreEncryption,i=n===void 0?!1:n,o=e.parseSpeed,a=o===void 0?Un.Slow:o,s=e.throwOnInvalidObject,c=s===void 0?!1:s,u=e.updateMetadata,f=u===void 0?!0:u,l=e.capNumbers,h=l===void 0?!1:l,x(t,"pdf",["string",Uint8Array,ArrayBuffer]),x(i,"ignoreEncryption",["boolean"]),x(a,"parseSpeed",["number"]),x(c,"throwOnInvalidObject",["boolean"]),d=Me(t),[4,Tu.forBytesWithOptions(d,a,c,h).parseDocument()];case 1:return g=y.sent(),[2,new r(g,i,f)]}})})},r.create=function(t){return t===void 0&&(t={}),Y(this,void 0,void 0,function(){var e,n,i,o,a,s;return J(this,function(c){return e=t.updateMetadata,n=e===void 0?!0:e,i=Rn.create(),o=Ao.withContext(i),a=i.register(o),s=ko.withContextAndPages(i,a),i.trailerInfo.Root=i.register(s),[2,new r(i,!1,n)]})})},r.prototype.registerFontkit=function(t){this.fontkit=t},r.prototype.getForm=function(){var t=this.formCache.access();return t.hasXFA()&&(console.warn("Removing XFA form data as pdf-lib does not support reading or writing XFA"),t.deleteXFA()),t},r.prototype.getTitle=function(){var t=this.getInfoDict().lookup(v.Title);if(t)return re(t),t.decodeText()},r.prototype.getAuthor=function(){var t=this.getInfoDict().lookup(v.Author);if(t)return re(t),t.decodeText()},r.prototype.getSubject=function(){var t=this.getInfoDict().lookup(v.Subject);if(t)return re(t),t.decodeText()},r.prototype.getKeywords=function(){var t=this.getInfoDict().lookup(v.Keywords);if(t)return re(t),t.decodeText()},r.prototype.getCreator=function(){var t=this.getInfoDict().lookup(v.Creator);if(t)return re(t),t.decodeText()},r.prototype.getProducer=function(){var t=this.getInfoDict().lookup(v.Producer);if(t)return re(t),t.decodeText()},r.prototype.getCreationDate=function(){var t=this.getInfoDict().lookup(v.CreationDate);if(t)return re(t),t.decodeDate()},r.prototype.getModificationDate=function(){var t=this.getInfoDict().lookup(v.ModDate);if(t)return re(t),t.decodeDate()},r.prototype.setTitle=function(t,e){x(t,"title",["string"]);var n=v.of("Title");if(this.getInfoDict().set(n,V.fromText(t)),e!=null&&e.showInWindowTitleBar){var i=this.catalog.getOrCreateViewerPreferences();i.setDisplayDocTitle(!0)}},r.prototype.setAuthor=function(t){x(t,"author",["string"]);var e=v.of("Author");this.getInfoDict().set(e,V.fromText(t))},r.prototype.setSubject=function(t){x(t,"author",["string"]);var e=v.of("Subject");this.getInfoDict().set(e,V.fromText(t))},r.prototype.setKeywords=function(t){x(t,"keywords",[Array]);var e=v.of("Keywords");this.getInfoDict().set(e,V.fromText(t.join(" ")))},r.prototype.setCreator=function(t){x(t,"creator",["string"]);var e=v.of("Creator");this.getInfoDict().set(e,V.fromText(t))},r.prototype.setProducer=function(t){x(t,"creator",["string"]);var e=v.of("Producer");this.getInfoDict().set(e,V.fromText(t))},r.prototype.setLanguage=function(t){x(t,"language",["string"]);var e=v.of("Lang");this.catalog.set(e,at.of(t))},r.prototype.setCreationDate=function(t){x(t,"creationDate",[[Date,"Date"]]);var e=v.of("CreationDate");this.getInfoDict().set(e,at.fromDate(t))},r.prototype.setModificationDate=function(t){x(t,"modificationDate",[[Date,"Date"]]);var e=v.of("ModDate");this.getInfoDict().set(e,at.fromDate(t))},r.prototype.getPageCount=function(){return this.pageCount===void 0&&(this.pageCount=this.getPages().length),this.pageCount},r.prototype.getPages=function(){return this.pageCache.access()},r.prototype.getPage=function(t){var e=this.getPages();return Dt(t,"index",0,e.length-1),e[t]},r.prototype.getPageIndices=function(){return xa(0,this.getPageCount())},r.prototype.removePage=function(t){var e=this.getPageCount();if(this.pageCount===0)throw new tc;Dt(t,"index",0,e-1),this.catalog.removeLeafNode(t),this.pageCount=e-1},r.prototype.addPage=function(t){return x(t,"page",["undefined",[Nt,"PDFPage"],Array]),this.insertPage(this.getPageCount(),t)},r.prototype.insertPage=function(t,e){var n=this.getPageCount();if(Dt(t,"index",0,n),x(e,"page",["undefined",[Nt,"PDFPage"],Array]),!e||Array.isArray(e)){var i=Array.isArray(e)?e:Fc.A4;e=Nt.create(this),e.setSize.apply(e,i)}else if(e.doc!==this)throw new $u;var o=this.catalog.insertLeafNode(e.ref,t);return e.node.setParent(o),this.pageMap.set(e.node,e),this.pageCache.invalidate(),this.pageCount=n+1,e},r.prototype.copyPages=function(t,e){return Y(this,void 0,void 0,function(){var n,i,o,a,s,c,u,f;return J(this,function(l){switch(l.label){case 0:return x(t,"srcDoc",[[r,"PDFDocument"]]),x(e,"indices",[Array]),[4,t.flush()];case 1:for(l.sent(),n=Pi.for(t.context,this.context),i=t.getPages(),o=new Array(e.length),a=0,s=e.length;a<s;a++)c=i[e[a]],u=n.copy(c.node),f=this.context.register(u),o[a]=Nt.of(u,f,this);return[2,o]}})})},r.prototype.copy=function(){return Y(this,void 0,void 0,function(){var t,e,n,i;return J(this,function(o){switch(o.label){case 0:return[4,r.create()];case 1:return t=o.sent(),[4,t.copyPages(this,this.getPageIndices())];case 2:for(e=o.sent(),n=0,i=e.length;n<i;n++)t.addPage(e[n]);return this.getAuthor()!==void 0&&t.setAuthor(this.getAuthor()),this.getCreationDate()!==void 0&&t.setCreationDate(this.getCreationDate()),this.getCreator()!==void 0&&t.setCreator(this.getCreator()),this.getModificationDate()!==void 0&&t.setModificationDate(this.getModificationDate()),this.getProducer()!==void 0&&t.setProducer(this.getProducer()),this.getSubject()!==void 0&&t.setSubject(this.getSubject()),this.getTitle()!==void 0&&t.setTitle(this.getTitle()),t.defaultWordBreaks=this.defaultWordBreaks,[2,t]}})})},r.prototype.addJavaScript=function(t,e){x(t,"name",["string"]),x(e,"script",["string"]);var n=Cc.for(e,t),i=this.context.nextRef(),o=wc.of(i,this,n);this.javaScripts.push(o)},r.prototype.attach=function(t,e,n){return n===void 0&&(n={}),Y(this,void 0,void 0,function(){var i,o,a,s;return J(this,function(c){return x(t,"attachment",["string",Uint8Array,ArrayBuffer]),x(e,"name",["string"]),k(n.mimeType,"mimeType",["string"]),k(n.description,"description",["string"]),k(n.creationDate,"options.creationDate",[Date]),k(n.modificationDate,"options.modificationDate",[Date]),Et(n.afRelationship,"options.afRelationship",Bn),i=Me(t),o=_s.for(i,e,n),a=this.context.nextRef(),s=Sc.of(a,this,o),this.embeddedFiles.push(s),[2]})})},r.prototype.embedFont=function(t,e){return e===void 0&&(e={}),Y(this,void 0,void 0,function(){var n,i,o,a,s,c,u,f,l,h;return J(this,function(d){switch(d.label){case 0:return n=e.subset,i=n===void 0?!1:n,o=e.customName,a=e.features,x(t,"font",["string",Uint8Array,ArrayBuffer]),x(i,"subset",["boolean"]),gi(t)?(s=Kr.for(t,o),[3,7]):[3,1];case 1:return Sa(t)?(c=Me(t),u=this.assertFontkit(),i?[4,Qs.for(u,c,o,a)]:[3,3]):[3,6];case 2:return f=d.sent(),[3,5];case 3:return[4,Zn.for(u,c,o,a)];case 4:f=d.sent(),d.label=5;case 5:return s=f,[3,7];case 6:throw new TypeError("`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`");case 7:return l=this.context.nextRef(),h=Ot.of(l,this,s),this.fonts.push(h),[2,h]}})})},r.prototype.embedStandardFont=function(t,e){if(x(t,"font",["string"]),!gi(t))throw new TypeError("`font` must be one of type `StandardFonts`");var n=Kr.for(t,e),i=this.context.nextRef(),o=Ot.of(i,this,n);return this.fonts.push(o),o},r.prototype.embedJpg=function(t){return Y(this,void 0,void 0,function(){var e,n,i,o;return J(this,function(a){switch(a.label){case 0:return x(t,"jpg",["string",Uint8Array,ArrayBuffer]),e=Me(t),[4,bo.for(e)];case 1:return n=a.sent(),i=this.context.nextRef(),o=Mn.of(i,this,n),this.images.push(o),[2,o]}})})},r.prototype.embedPng=function(t){return Y(this,void 0,void 0,function(){var e,n,i,o;return J(this,function(a){switch(a.label){case 0:return x(t,"png",["string",Uint8Array,ArrayBuffer]),e=Me(t),[4,xo.for(e)];case 1:return n=a.sent(),i=this.context.nextRef(),o=Mn.of(i,this,n),this.images.push(o),[2,o]}})})},r.prototype.embedPdf=function(t,e){return e===void 0&&(e=[0]),Y(this,void 0,void 0,function(){var n,i,o;return J(this,function(a){switch(a.label){case 0:return x(t,"pdf",["string",Uint8Array,ArrayBuffer,[r,"PDFDocument"]]),x(e,"indices",[Array]),t instanceof r?(i=t,[3,3]):[3,1];case 1:return[4,r.load(t)];case 2:i=a.sent(),a.label=3;case 3:return n=i,o=Fa(n.getPages(),e),[2,this.embedPages(o)]}})})},r.prototype.embedPage=function(t,e,n){return Y(this,void 0,void 0,function(){var i;return J(this,function(o){switch(o.label){case 0:return x(t,"page",[[Nt,"PDFPage"]]),[4,this.embedPages([t],[e],[n])];case 1:return i=o.sent()[0],[2,i]}})})},r.prototype.embedPages=function(t,e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),Y(this,void 0,void 0,function(){var u,f,i,o,a,s,c,u,f,l,h,d,g,y,b;return J(this,function(m){switch(m.label){case 0:if(t.length===0)return[2,[]];for(u=0,f=t.length-1;u<f;u++)if(i=t[u],o=t[u+1],i.node.context!==o.node.context)throw new Cs;a=t[0].node.context,s=a===this.context?function(S){return S}:Pi.for(a,this.context).copy,c=new Array(t.length),u=0,f=t.length,m.label=1;case 1:return u<f?(l=s(t[u].node),h=e[u],d=n[u],[4,wo.for(l,h,d)]):[3,4];case 2:g=m.sent(),y=this.context.nextRef(),c[u]=_o.of(y,this,g),m.label=3;case 3:return u++,[3,1];case 4:return(b=this.embeddedPages).push.apply(b,c),[2,c]}})})},r.prototype.flush=function(){return Y(this,void 0,void 0,function(){return J(this,function(t){switch(t.label){case 0:return[4,this.embedAll(this.fonts)];case 1:return t.sent(),[4,this.embedAll(this.images)];case 2:return t.sent(),[4,this.embedAll(this.embeddedPages)];case 3:return t.sent(),[4,this.embedAll(this.embeddedFiles)];case 4:return t.sent(),[4,this.embedAll(this.javaScripts)];case 5:return t.sent(),[2]}})})},r.prototype.save=function(t){return t===void 0&&(t={}),Y(this,void 0,void 0,function(){var e,n,i,o,a,s,c,u,f,l;return J(this,function(h){switch(h.label){case 0:return e=t.useObjectStreams,n=e===void 0?!0:e,i=t.addDefaultPage,o=i===void 0?!0:i,a=t.objectsPerTick,s=a===void 0?50:a,c=t.updateFieldAppearances,u=c===void 0?!0:c,x(n,"useObjectStreams",["boolean"]),x(o,"addDefaultPage",["boolean"]),x(s,"objectsPerTick",["number"]),x(u,"updateFieldAppearances",["boolean"]),o&&this.getPageCount()===0&&this.addPage(),u&&(f=this.formCache.getValue(),f&&f.updateFieldAppearances()),[4,this.flush()];case 1:return h.sent(),l=n?Ls:yo,[2,l.forContext(this.context,s).serializeToBuffer()]}})})},r.prototype.saveAsBase64=function(t){return t===void 0&&(t={}),Y(this,void 0,void 0,function(){var e,n,i,o,a;return J(this,function(s){switch(s.label){case 0:return e=t.dataUri,n=e===void 0?!1:e,i=na(t,["dataUri"]),x(n,"dataUri",["boolean"]),[4,this.save(i)];case 1:return o=s.sent(),a=ia(o),[2,n?"data:application/pdf;base64,"+a:a]}})})},r.prototype.findPageForAnnotationRef=function(t){for(var e=this.getPages(),n=0,i=e.length;n<i;n++){var o=e[n],a=o.node.Annots();if((a==null?void 0:a.indexOf(t))!==void 0)return o}},r.prototype.embedAll=function(t){return Y(this,void 0,void 0,function(){var e,n;return J(this,function(i){switch(i.label){case 0:e=0,n=t.length,i.label=1;case 1:return e<n?[4,t[e].embed()]:[3,4];case 2:i.sent(),i.label=3;case 3:return e++,[3,1];case 4:return[2]}})})},r.prototype.updateInfoDict=function(){var t="pdf-lib (https://github.com/Hopding/pdf-lib)",e=new Date,n=this.getInfoDict();this.setProducer(t),this.setModificationDate(e),n.get(v.of("Creator"))||this.setCreator(t),n.get(v.of("CreationDate"))||this.setCreationDate(e)},r.prototype.getInfoDict=function(){var t=this.context.lookup(this.context.trailerInfo.Info);if(t instanceof H)return t;var e=this.context.obj({});return this.context.trailerInfo.Info=this.context.register(e),e},r.prototype.assertFontkit=function(){if(!this.fontkit)throw new _u;return this.fontkit},r}();function re(r){if(!(r instanceof V)&&!(r instanceof at))throw new Wr([V,at],r)}var Ht;(function(r){r.Normal="Normal",r.Multiply="Multiply",r.Screen="Screen",r.Overlay="Overlay",r.Darken="Darken",r.Lighten="Lighten",r.ColorDodge="ColorDodge",r.ColorBurn="ColorBurn",r.HardLight="HardLight",r.SoftLight="SoftLight",r.Difference="Difference",r.Exclusion="Exclusion"})(Ht||(Ht={}));var Nt=function(){function r(t,e,n){this.fontSize=24,this.fontColor=it(0,0,0),this.lineHeight=24,this.x=0,this.y=0,x(t,"leafNode",[[Jt,"PDFPageLeaf"]]),x(e,"ref",[[st,"PDFRef"]]),x(n,"doc",[[Qt,"PDFDocument"]]),this.node=t,this.ref=e,this.doc=n}return r.prototype.setRotation=function(t){var e=jo(t);lo(e,"degreesAngle",90),this.node.set(v.of("Rotate"),this.doc.context.obj(e))},r.prototype.getRotation=function(){var t=this.node.Rotate();return z(t?t.asNumber():0)},r.prototype.setSize=function(t,e){x(t,"width",["number"]),x(e,"height",["number"]);var n=this.getMediaBox();this.setMediaBox(n.x,n.y,t,e);var i=this.getCropBox(),o=this.getBleedBox(),a=this.getTrimBox(),s=this.getArtBox(),c=this.node.CropBox(),u=this.node.BleedBox(),f=this.node.TrimBox(),l=this.node.ArtBox();c&&Pr(i,n)&&this.setCropBox(n.x,n.y,t,e),u&&Pr(o,n)&&this.setBleedBox(n.x,n.y,t,e),f&&Pr(a,n)&&this.setTrimBox(n.x,n.y,t,e),l&&Pr(s,n)&&this.setArtBox(n.x,n.y,t,e)},r.prototype.setWidth=function(t){x(t,"width",["number"]),this.setSize(t,this.getSize().height)},r.prototype.setHeight=function(t){x(t,"height",["number"]),this.setSize(this.getSize().width,t)},r.prototype.setMediaBox=function(t,e,n,i){x(t,"x",["number"]),x(e,"y",["number"]),x(n,"width",["number"]),x(i,"height",["number"]);var o=this.doc.context.obj([t,e,t+n,e+i]);this.node.set(v.MediaBox,o)},r.prototype.setCropBox=function(t,e,n,i){x(t,"x",["number"]),x(e,"y",["number"]),x(n,"width",["number"]),x(i,"height",["number"]);var o=this.doc.context.obj([t,e,t+n,e+i]);this.node.set(v.CropBox,o)},r.prototype.setBleedBox=function(t,e,n,i){x(t,"x",["number"]),x(e,"y",["number"]),x(n,"width",["number"]),x(i,"height",["number"]);var o=this.doc.context.obj([t,e,t+n,e+i]);this.node.set(v.BleedBox,o)},r.prototype.setTrimBox=function(t,e,n,i){x(t,"x",["number"]),x(e,"y",["number"]),x(n,"width",["number"]),x(i,"height",["number"]);var o=this.doc.context.obj([t,e,t+n,e+i]);this.node.set(v.TrimBox,o)},r.prototype.setArtBox=function(t,e,n,i){x(t,"x",["number"]),x(e,"y",["number"]),x(n,"width",["number"]),x(i,"height",["number"]);var o=this.doc.context.obj([t,e,t+n,e+i]);this.node.set(v.ArtBox,o)},r.prototype.getSize=function(){var t=this.getMediaBox(),e=t.width,n=t.height;return{width:e,height:n}},r.prototype.getWidth=function(){return this.getSize().width},r.prototype.getHeight=function(){return this.getSize().height},r.prototype.getMediaBox=function(){var t=this.node.MediaBox();return t.asRectangle()},r.prototype.getCropBox=function(){var t,e=this.node.CropBox();return(t=e==null?void 0:e.asRectangle())!==null&&t!==void 0?t:this.getMediaBox()},r.prototype.getBleedBox=function(){var t,e=this.node.BleedBox();return(t=e==null?void 0:e.asRectangle())!==null&&t!==void 0?t:this.getCropBox()},r.prototype.getTrimBox=function(){var t,e=this.node.TrimBox();return(t=e==null?void 0:e.asRectangle())!==null&&t!==void 0?t:this.getCropBox()},r.prototype.getArtBox=function(){var t,e=this.node.ArtBox();return(t=e==null?void 0:e.asRectangle())!==null&&t!==void 0?t:this.getCropBox()},r.prototype.translateContent=function(t,e){x(t,"x",["number"]),x(e,"y",["number"]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(gt(),It(t,e)),i=this.doc.context.register(n),o=this.createContentStream(yt()),a=this.doc.context.register(o);this.node.wrapContentStreams(i,a)},r.prototype.scale=function(t,e){x(t,"x",["number"]),x(e,"y",["number"]),this.setSize(this.getWidth()*t,this.getHeight()*e),this.scaleContent(t,e),this.scaleAnnotations(t,e)},r.prototype.scaleContent=function(t,e){x(t,"x",["number"]),x(e,"y",["number"]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(gt(),ur(t,e)),i=this.doc.context.register(n),o=this.createContentStream(yt()),a=this.doc.context.register(o);this.node.wrapContentStreams(i,a)},r.prototype.scaleAnnotations=function(t,e){x(t,"x",["number"]),x(e,"y",["number"]);var n=this.node.Annots();if(n)for(var i=0;i<n.size();i++){var o=n.lookup(i);o instanceof H&&this.scaleAnnot(o,t,e)}},r.prototype.resetPosition=function(){this.getContentStream(!1),this.x=0,this.y=0},r.prototype.setFont=function(t){x(t,"font",[[Ot,"PDFFont"]]),this.font=t,this.fontKey=this.node.newFontDictionary(this.font.name,this.font.ref)},r.prototype.setFontSize=function(t){x(t,"fontSize",["number"]),this.fontSize=t},r.prototype.setFontColor=function(t){x(t,"fontColor",[[Object,"Color"]]),this.fontColor=t},r.prototype.setLineHeight=function(t){x(t,"lineHeight",["number"]),this.lineHeight=t},r.prototype.getPosition=function(){return{x:this.x,y:this.y}},r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.moveTo=function(t,e){x(t,"x",["number"]),x(e,"y",["number"]),this.x=t,this.y=e},r.prototype.moveDown=function(t){x(t,"yDecrease",["number"]),this.y-=t},r.prototype.moveUp=function(t){x(t,"yIncrease",["number"]),this.y+=t},r.prototype.moveLeft=function(t){x(t,"xDecrease",["number"]),this.x-=t},r.prototype.moveRight=function(t){x(t,"xIncrease",["number"]),this.x+=t},r.prototype.pushOperators=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];fo(t,"operator",[[et,"PDFOperator"]]);var n=this.getContentStream();n.push.apply(n,t)},r.prototype.drawText=function(t,e){var n,i,o,a,s,c,u;e===void 0&&(e={}),x(t,"text",["string"]),k(e.color,"options.color",[[Object,"Color"]]),Wt(e.opacity,"opacity.opacity",0,1),k(e.font,"options.font",[[Ot,"PDFFont"]]),k(e.size,"options.size",["number"]),k(e.rotate,"options.rotate",[[Object,"Rotation"]]),k(e.xSkew,"options.xSkew",[[Object,"Rotation"]]),k(e.ySkew,"options.ySkew",[[Object,"Rotation"]]),k(e.x,"options.x",["number"]),k(e.y,"options.y",["number"]),k(e.lineHeight,"options.lineHeight",["number"]),k(e.maxWidth,"options.maxWidth",["number"]),k(e.wordBreaks,"options.wordBreaks",[Array]),Et(e.blendMode,"options.blendMode",Ht);for(var f=this.setOrEmbedFont(e.font),l=f.oldFont,h=f.newFont,d=f.newFontKey,g=e.size||this.fontSize,y=e.wordBreaks||this.doc.defaultWordBreaks,b=function(D){return h.widthOfTextAtSize(D,g)},m=e.maxWidth===void 0?Xi(lr(t)):da(t,y,e.maxWidth,b),S=new Array(m.length),F=0,T=m.length;F<T;F++)S[F]=h.encodeText(m[F]);var P=this.maybeEmbedGraphicsState({opacity:e.opacity,blendMode:e.blendMode}),w=this.getContentStream();w.push.apply(w,Ku(S,{color:(n=e.color)!==null&&n!==void 0?n:this.fontColor,font:d,size:g,rotate:(i=e.rotate)!==null&&i!==void 0?i:z(0),xSkew:(o=e.xSkew)!==null&&o!==void 0?o:z(0),ySkew:(a=e.ySkew)!==null&&a!==void 0?a:z(0),x:(s=e.x)!==null&&s!==void 0?s:this.x,y:(c=e.y)!==null&&c!==void 0?c:this.y,lineHeight:(u=e.lineHeight)!==null&&u!==void 0?u:this.lineHeight,graphicsState:P})),e.font&&(l?this.setFont(l):this.resetFont())},r.prototype.drawImage=function(t,e){var n,i,o,a,s,c,u;e===void 0&&(e={}),x(t,"image",[[Mn,"PDFImage"]]),k(e.x,"options.x",["number"]),k(e.y,"options.y",["number"]),k(e.width,"options.width",["number"]),k(e.height,"options.height",["number"]),k(e.rotate,"options.rotate",[[Object,"Rotation"]]),k(e.xSkew,"options.xSkew",[[Object,"Rotation"]]),k(e.ySkew,"options.ySkew",[[Object,"Rotation"]]),Wt(e.opacity,"opacity.opacity",0,1),Et(e.blendMode,"options.blendMode",Ht);var f=this.node.newXObject("Image",t.ref),l=this.maybeEmbedGraphicsState({opacity:e.opacity,blendMode:e.blendMode}),h=this.getContentStream();h.push.apply(h,Lo(f,{x:(n=e.x)!==null&&n!==void 0?n:this.x,y:(i=e.y)!==null&&i!==void 0?i:this.y,width:(o=e.width)!==null&&o!==void 0?o:t.size().width,height:(a=e.height)!==null&&a!==void 0?a:t.size().height,rotate:(s=e.rotate)!==null&&s!==void 0?s:z(0),xSkew:(c=e.xSkew)!==null&&c!==void 0?c:z(0),ySkew:(u=e.ySkew)!==null&&u!==void 0?u:z(0),graphicsState:l}))},r.prototype.drawPage=function(t,e){var n,i,o,a,s;e===void 0&&(e={}),x(t,"embeddedPage",[[_o,"PDFEmbeddedPage"]]),k(e.x,"options.x",["number"]),k(e.y,"options.y",["number"]),k(e.xScale,"options.xScale",["number"]),k(e.yScale,"options.yScale",["number"]),k(e.width,"options.width",["number"]),k(e.height,"options.height",["number"]),k(e.rotate,"options.rotate",[[Object,"Rotation"]]),k(e.xSkew,"options.xSkew",[[Object,"Rotation"]]),k(e.ySkew,"options.ySkew",[[Object,"Rotation"]]),Wt(e.opacity,"opacity.opacity",0,1),Et(e.blendMode,"options.blendMode",Ht);var c=this.node.newXObject("EmbeddedPdfPage",t.ref),u=this.maybeEmbedGraphicsState({opacity:e.opacity,blendMode:e.blendMode}),f=e.width!==void 0?e.width/t.width:e.xScale!==void 0?e.xScale:1,l=e.height!==void 0?e.height/t.height:e.yScale!==void 0?e.yScale:1,h=this.getContentStream();h.push.apply(h,Gu(c,{x:(n=e.x)!==null&&n!==void 0?n:this.x,y:(i=e.y)!==null&&i!==void 0?i:this.y,xScale:f,yScale:l,rotate:(o=e.rotate)!==null&&o!==void 0?o:z(0),xSkew:(a=e.xSkew)!==null&&a!==void 0?a:z(0),ySkew:(s=e.ySkew)!==null&&s!==void 0?s:z(0),graphicsState:u}))},r.prototype.drawSvgPath=function(t,e){var n,i,o,a,s,c,u,f,l;e===void 0&&(e={}),x(t,"path",["string"]),k(e.x,"options.x",["number"]),k(e.y,"options.y",["number"]),k(e.scale,"options.scale",["number"]),k(e.rotate,"options.rotate",[[Object,"Rotation"]]),k(e.borderWidth,"options.borderWidth",["number"]),k(e.color,"options.color",[[Object,"Color"]]),Wt(e.opacity,"opacity.opacity",0,1),k(e.borderColor,"options.borderColor",[[Object,"Color"]]),k(e.borderDashArray,"options.borderDashArray",[Array]),k(e.borderDashPhase,"options.borderDashPhase",["number"]),Et(e.borderLineCap,"options.borderLineCap",Te),Wt(e.borderOpacity,"options.borderOpacity",0,1),Et(e.blendMode,"options.blendMode",Ht);var h=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!("color"in e)&&!("borderColor"in e)&&(e.borderColor=it(0,0,0));var d=this.getContentStream();d.push.apply(d,Zu(t,{x:(n=e.x)!==null&&n!==void 0?n:this.x,y:(i=e.y)!==null&&i!==void 0?i:this.y,scale:e.scale,rotate:(o=e.rotate)!==null&&o!==void 0?o:z(0),color:(a=e.color)!==null&&a!==void 0?a:void 0,borderColor:(s=e.borderColor)!==null&&s!==void 0?s:void 0,borderWidth:(c=e.borderWidth)!==null&&c!==void 0?c:0,borderDashArray:(u=e.borderDashArray)!==null&&u!==void 0?u:void 0,borderDashPhase:(f=e.borderDashPhase)!==null&&f!==void 0?f:void 0,borderLineCap:(l=e.borderLineCap)!==null&&l!==void 0?l:void 0,graphicsState:h}))},r.prototype.drawLine=function(t){var e,n,i,o,a;x(t.start,"options.start",[[Object,"{ x: number, y: number }"]]),x(t.end,"options.end",[[Object,"{ x: number, y: number }"]]),x(t.start.x,"options.start.x",["number"]),x(t.start.y,"options.start.y",["number"]),x(t.end.x,"options.end.x",["number"]),x(t.end.y,"options.end.y",["number"]),k(t.thickness,"options.thickness",["number"]),k(t.color,"options.color",[[Object,"Color"]]),k(t.dashArray,"options.dashArray",[Array]),k(t.dashPhase,"options.dashPhase",["number"]),Et(t.lineCap,"options.lineCap",Te),Wt(t.opacity,"opacity.opacity",0,1),Et(t.blendMode,"options.blendMode",Ht);var s=this.maybeEmbedGraphicsState({borderOpacity:t.opacity,blendMode:t.blendMode});"color"in t||(t.color=it(0,0,0));var c=this.getContentStream();c.push.apply(c,Lu({start:t.start,end:t.end,thickness:(e=t.thickness)!==null&&e!==void 0?e:1,color:(n=t.color)!==null&&n!==void 0?n:void 0,dashArray:(i=t.dashArray)!==null&&i!==void 0?i:void 0,dashPhase:(o=t.dashPhase)!==null&&o!==void 0?o:void 0,lineCap:(a=t.lineCap)!==null&&a!==void 0?a:void 0,graphicsState:s}))},r.prototype.drawRectangle=function(t){var e,n,i,o,a,s,c,u,f,l,h,d,g;t===void 0&&(t={}),k(t.x,"options.x",["number"]),k(t.y,"options.y",["number"]),k(t.width,"options.width",["number"]),k(t.height,"options.height",["number"]),k(t.rotate,"options.rotate",[[Object,"Rotation"]]),k(t.xSkew,"options.xSkew",[[Object,"Rotation"]]),k(t.ySkew,"options.ySkew",[[Object,"Rotation"]]),k(t.borderWidth,"options.borderWidth",["number"]),k(t.color,"options.color",[[Object,"Color"]]),Wt(t.opacity,"opacity.opacity",0,1),k(t.borderColor,"options.borderColor",[[Object,"Color"]]),k(t.borderDashArray,"options.borderDashArray",[Array]),k(t.borderDashPhase,"options.borderDashPhase",["number"]),Et(t.borderLineCap,"options.borderLineCap",Te),Wt(t.borderOpacity,"options.borderOpacity",0,1),Et(t.blendMode,"options.blendMode",Ht);var y=this.maybeEmbedGraphicsState({opacity:t.opacity,borderOpacity:t.borderOpacity,blendMode:t.blendMode});!("color"in t)&&!("borderColor"in t)&&(t.color=it(0,0,0));var b=this.getContentStream();b.push.apply(b,Re({x:(e=t.x)!==null&&e!==void 0?e:this.x,y:(n=t.y)!==null&&n!==void 0?n:this.y,width:(i=t.width)!==null&&i!==void 0?i:150,height:(o=t.height)!==null&&o!==void 0?o:100,rotate:(a=t.rotate)!==null&&a!==void 0?a:z(0),xSkew:(s=t.xSkew)!==null&&s!==void 0?s:z(0),ySkew:(c=t.ySkew)!==null&&c!==void 0?c:z(0),borderWidth:(u=t.borderWidth)!==null&&u!==void 0?u:0,color:(f=t.color)!==null&&f!==void 0?f:void 0,borderColor:(l=t.borderColor)!==null&&l!==void 0?l:void 0,borderDashArray:(h=t.borderDashArray)!==null&&h!==void 0?h:void 0,borderDashPhase:(d=t.borderDashPhase)!==null&&d!==void 0?d:void 0,graphicsState:y,borderLineCap:(g=t.borderLineCap)!==null&&g!==void 0?g:void 0}))},r.prototype.drawSquare=function(t){t===void 0&&(t={});var e=t.size;k(e,"size",["number"]),this.drawRectangle(G(G({},t),{width:e,height:e}))},r.prototype.drawEllipse=function(t){var e,n,i,o,a,s,c,u,f,l,h;t===void 0&&(t={}),k(t.x,"options.x",["number"]),k(t.y,"options.y",["number"]),k(t.xScale,"options.xScale",["number"]),k(t.yScale,"options.yScale",["number"]),k(t.rotate,"options.rotate",[[Object,"Rotation"]]),k(t.color,"options.color",[[Object,"Color"]]),Wt(t.opacity,"opacity.opacity",0,1),k(t.borderColor,"options.borderColor",[[Object,"Color"]]),Wt(t.borderOpacity,"options.borderOpacity",0,1),k(t.borderWidth,"options.borderWidth",["number"]),k(t.borderDashArray,"options.borderDashArray",[Array]),k(t.borderDashPhase,"options.borderDashPhase",["number"]),Et(t.borderLineCap,"options.borderLineCap",Te),Et(t.blendMode,"options.blendMode",Ht);var d=this.maybeEmbedGraphicsState({opacity:t.opacity,borderOpacity:t.borderOpacity,blendMode:t.blendMode});!("color"in t)&&!("borderColor"in t)&&(t.color=it(0,0,0));var g=this.getContentStream();g.push.apply(g,Nn({x:(e=t.x)!==null&&e!==void 0?e:this.x,y:(n=t.y)!==null&&n!==void 0?n:this.y,xScale:(i=t.xScale)!==null&&i!==void 0?i:100,yScale:(o=t.yScale)!==null&&o!==void 0?o:100,rotate:(a=t.rotate)!==null&&a!==void 0?a:void 0,color:(s=t.color)!==null&&s!==void 0?s:void 0,borderColor:(c=t.borderColor)!==null&&c!==void 0?c:void 0,borderWidth:(u=t.borderWidth)!==null&&u!==void 0?u:0,borderDashArray:(f=t.borderDashArray)!==null&&f!==void 0?f:void 0,borderDashPhase:(l=t.borderDashPhase)!==null&&l!==void 0?l:void 0,borderLineCap:(h=t.borderLineCap)!==null&&h!==void 0?h:void 0,graphicsState:d}))},r.prototype.drawCircle=function(t){t===void 0&&(t={});var e=t.size,n=e===void 0?100:e;k(n,"size",["number"]),this.drawEllipse(G(G({},t),{xScale:n,yScale:n}))},r.prototype.setOrEmbedFont=function(t){var e=this.font,n=this.fontKey;t?this.setFont(t):this.getFont();var i=this.font,o=this.fontKey;return{oldFont:e,oldFontKey:n,newFont:i,newFontKey:o}},r.prototype.getFont=function(){if(!this.font||!this.fontKey){var t=this.doc.embedStandardFont(cr.Helvetica);this.setFont(t)}return[this.font,this.fontKey]},r.prototype.resetFont=function(){this.font=void 0,this.fontKey=void 0},r.prototype.getContentStream=function(t){return t===void 0&&(t=!0),t&&this.contentStream?this.contentStream:(this.contentStream=this.createContentStream(),this.contentStreamRef=this.doc.context.register(this.contentStream),this.node.addContentStream(this.contentStreamRef),this.contentStream)},r.prototype.createContentStream=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.doc.context.obj({}),i=_e.of(n,t);return i},r.prototype.maybeEmbedGraphicsState=function(t){var e=t.opacity,n=t.borderOpacity,i=t.blendMode;if(!(e===void 0&&n===void 0&&i===void 0)){var o=this.doc.context.obj({Type:"ExtGState",ca:e,CA:n,BM:i}),a=this.node.newExtGState("GS",o);return a}},r.prototype.scaleAnnot=function(t,e,n){for(var i=["RD","CL","Vertices","QuadPoints","L","Rect"],o=0,a=i.length;o<a;o++){var s=t.lookup(v.of(i[o]));s instanceof nt&&s.scalePDFNumbers(e,n)}var c=t.lookup(v.of("InkList"));if(c instanceof nt)for(var o=0,a=c.size();o<a;o++){var u=c.lookup(o);u instanceof nt&&u.scalePDFNumbers(e,n)}},r.of=function(t,e,n){return new r(t,e,n)},r.create=function(t){x(t,"doc",[[Qt,"PDFDocument"]]);var e=st.of(-1),n=Jt.withContextAndParent(t.context,e),i=t.context.register(n);return new r(n,i,t)},r}(),Vr=function(r){A(t,r);function t(e,n,i){var o=r.call(this,e,n,i)||this;return x(e,"acroButton",[[cn,"PDFAcroPushButton"]]),o.acroField=e,o}return t.prototype.setImage=function(e,n){n===void 0&&(n=ae.Center);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o],c=this.createImageAppearanceStream(s,e,n);this.updateWidgetAppearances(s,{normal:c})}this.markAsClean()},t.prototype.setFontSize=function(e){nn(e,"fontSize"),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.addToPage=function(e,n,i){var o,a,s,c,u,f,l,h,d,g,y;k(e,"text",["string"]),k(n,"page",[[Nt,"PDFPage"]]),Ne(i);var b=this.createWidget({x:((o=i==null?void 0:i.x)!==null&&o!==void 0?o:0)-((a=i==null?void 0:i.borderWidth)!==null&&a!==void 0?a:0)/2,y:((s=i==null?void 0:i.y)!==null&&s!==void 0?s:0)-((c=i==null?void 0:i.borderWidth)!==null&&c!==void 0?c:0)/2,width:(u=i==null?void 0:i.width)!==null&&u!==void 0?u:100,height:(f=i==null?void 0:i.height)!==null&&f!==void 0?f:50,textColor:(l=i==null?void 0:i.textColor)!==null&&l!==void 0?l:it(0,0,0),backgroundColor:(h=i==null?void 0:i.backgroundColor)!==null&&h!==void 0?h:it(.75,.75,.75),borderColor:i==null?void 0:i.borderColor,borderWidth:(d=i==null?void 0:i.borderWidth)!==null&&d!==void 0?d:0,rotate:(g=i==null?void 0:i.rotate)!==null&&g!==void 0?g:z(0),caption:e,hidden:i==null?void 0:i.hidden,page:n.ref}),m=this.doc.context.register(b.dict);this.acroField.addWidget(m);var S=(y=i==null?void 0:i.font)!==null&&y!==void 0?y:this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(b,S),n.node.addAnnot(m)},t.prototype.needsAppearancesUpdate=function(){var e;if(this.isDirty())return!0;for(var n=this.acroField.getWidgets(),i=0,o=n.length;i<o;i++){var a=n[i],s=((e=a.getAppearances())===null||e===void 0?void 0:e.normal)instanceof At;if(!s)return!0}return!1},t.prototype.defaultUpdateAppearances=function(e){x(e,"font",[[Ot,"PDFFont"]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,n){x(e,"font",[[Ot,"PDFFont"]]),k(n,"provider",[Function]);for(var i=this.acroField.getWidgets(),o=0,a=i.length;o<a;o++){var s=i[o];this.updateWidgetAppearance(s,e,n)}},t.prototype.updateWidgetAppearance=function(e,n,i){var o=i??pc,a=je(o(this,e,n));this.updateWidgetAppearanceWithFont(e,n,a)},t.of=function(e,n,i){return new t(e,n,i)},t}(xe);const Pc=50,Tc=28,Wi=8,Dc=it(136/255,136/255,136/255),kc=(r,t,e)=>r.replace(":currentPage",t).replace(":totalPages",e),Ac=async(r,t,e)=>{const n=await Qt.create();for(let i=0;i<r.length;i++){const o=r[i];r[i]=null;const a=await Qt.load(await t(o));(await n.copyPages(a,a.getPageIndices())).forEach(c=>n.addPage(c))}if(e){const i=await n.embedFont(cr.Helvetica),o=n.getPages(),a=o.length;o.forEach((s,c)=>{const u=kc(e,c+1,a),{width:f}=s.getSize(),l=i.widthOfTextAtSize(u,Wi);s.drawText(u,{x:f-Pc-l,y:Tc,size:Wi,font:i,color:Dc})})}return n.save()},Bc=async({blobs:r,pageNumberTemplate:t})=>new Blob([await Ac(r,e=>e.arrayBuffer(),t)],{type:"application/pdf"});export{Bc as mergeAndStampPdfs};
