UNPKG

@senx/discovery-plugin-marauder

Version:

Discovery plugin - Marauder's map

35 lines 411 kB
var __awaiter=this&&this.__awaiter||function(t,i,n,e){function r(t){return t instanceof n?t:new n((function(i){i(t)}))}return new(n||(n=Promise))((function(n,s){function o(t){try{u(e.next(t))}catch(t){s(t)}}function a(t){try{u(e["throw"](t))}catch(t){s(t)}}function u(t){t.done?n(t.value):r(t.value).then(o,a)}u((e=e.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(i){return u([t,i])}}function u(a){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(n=0)),n)try{if(e=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){n.label=a[1];break}if(a[0]===6&&n.label<s[1]){n.label=s[1];s=a;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(a);break}if(s[2])n.ops.pop();n.trys.pop();continue}a=i.call(t,n)}catch(t){a=[6,t];r=0}finally{e=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,i,n){if(n||arguments.length===2)for(var e=0,r=i.length,s;e<r;e++){if(s||!(e in i)){if(!s)s=Array.prototype.slice.call(i,0,e);s[e]=i[e]}}return t.concat(s||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h as h$1,H as Host,g as getElement}from"./index-7d8b9e81.js";import{P as Param,U as Utils}from"./utils-2db7dc60.js";import{g as getDefaultExportFromCjs,l as lodash,L as Logger,v as v4,J as JsonLib,G as GTSLib}from"./lodash-d98cd4b5.js";import{D as Dashboard}from"./types-7e267e33.js";import{g as global}from"./global-57908b51.js";import{C as ColorLib}from"./color-lib-3865b9f3.js";import{L as LangUtils}from"./lang-utils-ab937efb.js";import{P as PluginManager}from"./PluginManager-6fd5134d.js";var _typeof={exports:{}};(function(t){function i(n){"@babel/helpers - typeof";return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=true,t.exports["default"]=t.exports,i(n)}t.exports=i,t.exports.__esModule=true,t.exports["default"]=t.exports})(_typeof);var t=getDefaultExportFromCjs(_typeof.exports);var u8=Uint8Array,u16=Uint16Array,u32=Uint32Array;var fleb=new u8([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]);var fdeb=new u8([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]);var clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);var freb=function(t,i){var n=new u16(31);for(var e=0;e<31;++e){n[e]=i+=1<<t[e-1]}var r=new u32(n[30]);for(var e=1;e<30;++e){for(var s=n[e];s<n[e+1];++s){r[s]=s-n[e]<<5|e}}return[n,r]};var _a=freb(fleb,2),fl=_a[0],revfl=_a[1];fl[28]=258,revfl[258]=28;var _b=freb(fdeb,0),fd=_b[0],revfd=_b[1];var rev=new u16(32768);for(var i$1=0;i$1<32768;++i$1){var x$1=(i$1&43690)>>>1|(i$1&21845)<<1;x$1=(x$1&52428)>>>2|(x$1&13107)<<2;x$1=(x$1&61680)>>>4|(x$1&3855)<<4;rev[i$1]=((x$1&65280)>>>8|(x$1&255)<<8)>>>1}var hMap=function(t,i,n){var e=t.length;var r=0;var s=new u16(i);for(;r<e;++r)++s[t[r]-1];var o=new u16(i);for(r=0;r<i;++r){o[r]=o[r-1]+s[r-1]<<1}var a;if(n){a=new u16(1<<i);var u=15-i;for(r=0;r<e;++r){if(t[r]){var c=r<<4|t[r];var f=i-t[r];var h=o[t[r]-1]++<<f;for(var l=h|(1<<f)-1;h<=l;++h){a[rev[h]>>>u]=c}}}}else{a=new u16(e);for(r=0;r<e;++r)a[r]=rev[o[t[r]-1]++]>>>15-t[r]}return a};var flt=new u8(288);for(var i$1=0;i$1<144;++i$1)flt[i$1]=8;for(var i$1=144;i$1<256;++i$1)flt[i$1]=9;for(var i$1=256;i$1<280;++i$1)flt[i$1]=7;for(var i$1=280;i$1<288;++i$1)flt[i$1]=8;var fdt=new u8(32);for(var i$1=0;i$1<32;++i$1)fdt[i$1]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1);var fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1);var max=function(t){var i=t[0];for(var n=1;n<t.length;++n){if(t[n]>i)i=t[n]}return i};var bits=function(t,i,n){var e=i/8>>0;return(t[e]|t[e+1]<<8)>>>(i&7)&n};var bits16=function(t,i){var n=i/8>>0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>>(i&7)};var shft=function(t){return(t/8>>0)+(t&7&&1)};var slc=function(t,i,n){if(i==null||i<0)i=0;if(n==null||n>t.length)n=t.length;var e=new(t instanceof u16?u16:t instanceof u32?u32:u8)(n-i);e.set(t.subarray(i,n));return e};var inflt=function(t,i,n){var e=t.length;var r=!i||n;var s=!n||n.i;if(!n)n={};if(!i)i=new u8(e*3);var o=function(t){var n=i.length;if(t>n){var e=new u8(Math.max(n*2,t));e.set(i);i=e}};var a=n.f||0,u=n.p||0,c=n.b||0,f=n.l,h=n.d,l=n.m,d=n.n;var v=e*8;do{if(!f){n.f=a=bits(t,u,1);var b=bits(t,u+1,3);u+=3;if(!b){var w=shft(u)+4,m=t[w-4]|t[w-3]<<8,p=w+m;if(p>e){if(s)throw"unexpected EOF";break}if(r)o(c+m);i.set(t.subarray(w,p),c);n.b=c+=m,n.p=u=p*8;continue}else if(b==1)f=flrm,h=fdrm,l=9,d=5;else if(b==2){var g=bits(t,u,31)+257,N=bits(t,u+10,15)+4;var y=g+bits(t,u+5,31)+1;u+=14;var L=new u8(y);var A=new u8(19);for(var k=0;k<N;++k){A[clim[k]]=bits(t,u+k*3,7)}u+=N*3;var S=max(A),x=(1<<S)-1;if(!s&&u+y*(S+7)>v)break;var q=hMap(A,S,1);for(var k=0;k<y;){var E=q[bits(t,u,x)];u+=E&15;var w=E>>>4;if(w<16){L[k++]=w}else{var j=0,M=0;if(w==16)M=3+bits(t,u,3),u+=2,j=L[k-1];else if(w==17)M=3+bits(t,u,7),u+=3;else if(w==18)M=11+bits(t,u,127),u+=7;while(M--)L[k++]=j}}var O=L.subarray(0,g),P=L.subarray(g);l=max(O);d=max(P);f=hMap(O,l,1);h=hMap(P,d,1)}else throw"invalid block type";if(u>v)throw"unexpected EOF"}if(r)o(c+131072);var I=(1<<l)-1,D=(1<<d)-1;var R=l+d+18;while(s||u+R<v){var j=f[bits16(t,u)&I],T=j>>>4;u+=j&15;if(u>v)throw"unexpected EOF";if(!j)throw"invalid length/literal";if(T<256)i[c++]=T;else if(T==256){f=null;break}else{var F=T-254;if(T>264){var k=T-257,B=fleb[k];F=bits(t,u,(1<<B)-1)+fl[k];u+=B}var C=h[bits16(t,u)&D],z=C>>>4;if(!C)throw"invalid distance";u+=C&15;var P=fd[z];if(z>3){var B=fdeb[z];P+=bits16(t,u)&(1<<B)-1,u+=B}if(u>v)throw"unexpected EOF";if(r)o(c+131072);var U=c+F;for(;c<U;c+=4){i[c]=i[c-P];i[c+1]=i[c+1-P];i[c+2]=i[c+2-P];i[c+3]=i[c+3-P]}c=U}}n.l=f,n.p=u,n.b=c;if(f)a=1,n.m=l,n.d=h,n.n=d}while(!a);return c==i.length?i:slc(i,0,c)};var wbits=function(t,i,n){n<<=i&7;var e=i/8>>0;t[e]|=n;t[e+1]|=n>>>8};var wbits16=function(t,i,n){n<<=i&7;var e=i/8>>0;t[e]|=n;t[e+1]|=n>>>8;t[e+2]|=n>>>16};var hTree=function(t,i){var n=[];for(var e=0;e<t.length;++e){if(t[e])n.push({s:e,f:t[e]})}var r=n.length;var s=n.slice();if(!r)return[new u8(0),0];if(r==1){var o=new u8(n[0].s+1);o[n[0].s]=1;return[o,1]}n.sort((function(t,i){return t.f-i.f}));n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,f=1,h=2;n[0]={s:-1,f:a.f+u.f,l:a,r:u};while(f!=r-1){a=n[n[c].f<n[h].f?c++:h++];u=n[c!=f&&n[c].f<n[h].f?c++:h++];n[f++]={s:-1,f:a.f+u.f,l:a,r:u}}var l=s[0].s;for(var e=1;e<r;++e){if(s[e].s>l)l=s[e].s}var d=new u16(l+1);var v=ln(n[f-1],d,0);if(v>i){var e=0,b=0;var w=v-i,m=1<<w;s.sort((function(t,i){return d[i.s]-d[t.s]||t.f-i.f}));for(;e<r;++e){var p=s[e].s;if(d[p]>i){b+=m-(1<<v-d[p]);d[p]=i}else break}b>>>=w;while(b>0){var g=s[e].s;if(d[g]<i)b-=1<<i-d[g]++-1;else++e}for(;e>=0&&b;--e){var N=s[e].s;if(d[N]==i){--d[N];++b}}v=i}return[new u8(d),v]};var ln=function(t,i,n){return t.s==-1?Math.max(ln(t.l,i,n+1),ln(t.r,i,n+1)):i[t.s]=n};var lc=function(t){var i=t.length;while(i&&!t[--i]);var n=new u16(++i);var e=0,r=t[0],s=1;var o=function(t){n[e++]=t};for(var a=1;a<=i;++a){if(t[a]==r&&a!=i)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);if(s>2){o(s>10?s-11<<5|28690:s-3<<5|12305);s=0}}else if(s>3){o(r),--s;for(;s>6;s-=6)o(8304);if(s>2)o(s-3<<5|8208),s=0}while(s--)o(r);s=1;r=t[a]}}return[n.subarray(0,e),i]};var clen=function(t,i){var n=0;for(var e=0;e<i.length;++e)n+=t[e]*i[e];return n};var wfblk=function(t,i,n){var e=n.length;var r=shft(i+2);t[r]=e&255;t[r+1]=e>>>8;t[r+2]=t[r]^255;t[r+3]=t[r+1]^255;for(var s=0;s<e;++s)t[r+s+4]=n[s];return(r+4+e)*8};var wblk=function(t,i,n,e,r,s,o,a,u,c,f){wbits(i,f++,n);++r[256];var h=hTree(r,15),l=h[0],d=h[1];var v=hTree(s,15),b=v[0],w=v[1];var m=lc(l),p=m[0],g=m[1];var N=lc(b),y=N[0],L=N[1];var A=new u16(19);for(var k=0;k<p.length;++k)A[p[k]&31]++;for(var k=0;k<y.length;++k)A[y[k]&31]++;var S=hTree(A,7),x=S[0],q=S[1];var E=19;for(;E>4&&!x[clim[E-1]];--E);var j=c+5<<3;var M=clen(r,flt)+clen(s,fdt)+o;var O=clen(r,l)+clen(s,b)+o+14+3*E+clen(A,x)+(2*A[16]+3*A[17]+7*A[18]);if(j<=M&&j<=O)return wfblk(i,f,t.subarray(u,u+c));var P,I,D,R;wbits(i,f,1+(O<M)),f+=2;if(O<M){P=hMap(l,d,0),I=l,D=hMap(b,w,0),R=b;var T=hMap(x,q,0);wbits(i,f,g-257);wbits(i,f+5,L-1);wbits(i,f+10,E-4);f+=14;for(var k=0;k<E;++k)wbits(i,f+3*k,x[clim[k]]);f+=3*E;var F=[p,y];for(var B=0;B<2;++B){var C=F[B];for(var k=0;k<C.length;++k){var z=C[k]&31;wbits(i,f,T[z]),f+=x[z];if(z>15)wbits(i,f,C[k]>>>5&127),f+=C[k]>>>12}}}else{P=flm,I=flt,D=fdm,R=fdt}for(var k=0;k<a;++k){if(e[k]>255){var z=e[k]>>>18&31;wbits16(i,f,P[z+257]),f+=I[z+257];if(z>7)wbits(i,f,e[k]>>>23&31),f+=fleb[z];var U=e[k]&31;wbits16(i,f,D[U]),f+=R[U];if(U>3)wbits16(i,f,e[k]>>>5&8191),f+=fdeb[U]}else{wbits16(i,f,P[e[k]]),f+=I[e[k]]}}wbits16(i,f,P[256]);return f+I[256]};var deo=new u32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]);var et$1=new u8(0);var dflt=function(t,i,n,e,r,s){var o=t.length;var a=new u8(e+o+5*(1+Math.floor(o/7e3))+r);var u=a.subarray(e,a.length-r);var c=0;if(!i||o<8){for(var f=0;f<=o;f+=65535){var h=f+65535;if(h<o){c=wfblk(u,c,t.subarray(f,h))}else{u[f]=s;c=wfblk(u,c,t.subarray(f,o))}}}else{var l=deo[i-1];var d=l>>>13,v=l&8191;var b=(1<<n)-1;var w=new u16(32768),m=new u16(b+1);var p=Math.ceil(n/3),g=2*p;var N=function(i){return(t[i]^t[i+1]<<p^t[i+2]<<g)&b};var y=new u32(25e3);var L=new u16(288),A=new u16(32);var k=0,S=0,f=0,x=0,q=0,E=0;for(;f<o;++f){var j=N(f);var M=f&32767;var O=m[j];w[M]=O;m[j]=M;if(q<=f){var P=o-f;if((k>7e3||x>24576)&&P>423){c=wblk(t,u,0,y,L,A,S,x,E,f-E,c);x=k=S=0,E=f;for(var I=0;I<286;++I)L[I]=0;for(var I=0;I<30;++I)A[I]=0}var D=2,R=0,T=v,F=M-O&32767;if(P>2&&j==N(f-F)){var B=Math.min(d,P)-1;var C=Math.min(32767,f);var z=Math.min(258,P);while(F<=C&&--T&&M!=O){if(t[f+D]==t[f+D-F]){var U=0;for(;U<z&&t[f+U]==t[f+U-F];++U);if(U>D){D=U,R=F;if(U>B)break;var _=Math.min(F,U-2);var V=0;for(var I=0;I<_;++I){var $=f-F+I+32768&32767;var H=w[$];var W=$-H+32768&32767;if(W>V)V=W,O=$}}}M=O,O=w[M];F+=M-O+32768&32767}}if(R){y[x++]=268435456|revfl[D]<<18|revfd[R];var G=revfl[D]&31,J=revfd[R]&31;S+=fleb[G]+fdeb[J];++L[257+G];++A[J];q=f+D;++k}else{y[x++]=t[f];++L[t[f]]}}}c=wblk(t,u,s,y,L,A,S,x,E,f-E,c);if(!s)c=wfblk(u,c,et$1)}return slc(a,0,e+shft(c)+r)};var adler=function(){var t=1,i=0;return{p:function(n){var e=t,r=i;var s=n.length;for(var o=0;o!=s;){var a=Math.min(o+5552,s);for(;o<a;++o)e+=n[o],r+=e;e%=65521,r%=65521}t=e,i=r},d:function(){return(t>>>8<<16|(i&255)<<8|i>>>8)+((t&255)<<23)*2}}};var dopt=function(t,i,n,e,r){return dflt(t,i.level==null?6:i.level,i.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+i.mem,n,e,!r)};var wbytes=function(t,i,n){for(;n;++i)t[i]=n,n>>>=8};var zlh=function(t,i){var n=i.level,e=n==0?0:n<6?1:n==9?3:2;t[0]=120,t[1]=e<<6|(e?32-2*e:1)};var zlv=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function zlibSync(t,i){if(i===void 0){i={}}var n=adler();n.p(t);var e=dopt(t,i,2,4);return zlh(e,i),wbytes(e,e.length-4,n.d()),e}function unzlibSync(t,i){return inflt((zlv(t),t.subarray(2,-4)),i)}var n=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}();function i(){n.console&&"function"==typeof n.console.log&&n.console.log.apply(n.console,arguments)}var a={log:i,warn:function(t){n.console&&("function"==typeof n.console.warn?n.console.warn.apply(n.console,arguments):i.call(null,arguments))},error:function(t){n.console&&("function"==typeof n.console.error?n.console.error.apply(n.console,arguments):i(t))}};function o(t,i,n){var e=new XMLHttpRequest;e.open("GET",t),e.responseType="blob",e.onload=function(){l(e.response,i,n)},e.onerror=function(){a.error("could not download file")},e.send()}function s(t){var i=new XMLHttpRequest;i.open("HEAD",t,!1);try{i.send()}catch(t){}return i.status>=200&&i.status<=299}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(i)}}var u,h,l=n.saveAs||("object"!==("undefined"==typeof window?"undefined":t(window))||window!==n?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(t,i,e){var r=n.URL||n.webkitURL,a=document.createElement("a");i=i||t.name||"download",a.download=i,a.rel="noopener","string"==typeof t?(a.href=t,a.origin!==location.origin?s(a.href)?o(t,i,e):c(a,a.target="_blank"):c(a)):(a.href=r.createObjectURL(t),setTimeout((function(){r.revokeObjectURL(a.href)}),4e4),setTimeout((function(){c(a)}),0))}:"msSaveOrOpenBlob"in navigator?function(i,n,e){if(n=n||i.name||"download","string"==typeof i)if(s(i))o(i,n,e);else{var r=document.createElement("a");r.href=i,r.target="_blank",setTimeout((function(){c(r)}))}else navigator.msSaveOrOpenBlob(function(i,n){return void 0===n?n={autoBom:!1}:"object"!==t(n)&&(a.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob([String.fromCharCode(65279),i],{type:i.type}):i}(i,e),n)}:function(i,e,r,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof i)return o(i,e,r);var a="application/octet-stream"===i.type,u=/constructor/i.test(n.HTMLElement)||n.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&u)&&"object"===("undefined"==typeof FileReader?"undefined":t(FileReader))){var f=new FileReader;f.onloadend=function(){var t=f.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=t:location=t,s=null},f.readAsDataURL(i)}else{var h=n.URL||n.webkitURL,l=h.createObjectURL(i);s?s.location=l:location.href=l,s=null,setTimeout((function(){h.revokeObjectURL(l)}),4e4)}}); /** * A class to parse color values * @author Stoyan Stefanov <sstoo@gmail.com> * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function f(t){var i;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6));t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],e=0;e<n.length;e++){var r=n[e].re,s=n[e].process,o=r.exec(t);o&&(i=s(o),this.r=i[0],this.g=i[1],this.b=i[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),i=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==i.length&&(i="0"+i),1==n.length&&(n="0"+n),"#"+t+i+n} /** * @license * Joseph Myers does not specify a particular license for his work. * * Author: Joseph Myers * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js * * Modified by: Owen Leong */}function d(t,i){var n=t[0],e=t[1],r=t[2],s=t[3];n=g(n,e,r,s,i[0],7,-680876936),s=g(s,n,e,r,i[1],12,-389564586),r=g(r,s,n,e,i[2],17,606105819),e=g(e,r,s,n,i[3],22,-1044525330),n=g(n,e,r,s,i[4],7,-176418897),s=g(s,n,e,r,i[5],12,1200080426),r=g(r,s,n,e,i[6],17,-1473231341),e=g(e,r,s,n,i[7],22,-45705983),n=g(n,e,r,s,i[8],7,1770035416),s=g(s,n,e,r,i[9],12,-1958414417),r=g(r,s,n,e,i[10],17,-42063),e=g(e,r,s,n,i[11],22,-1990404162),n=g(n,e,r,s,i[12],7,1804603682),s=g(s,n,e,r,i[13],12,-40341101),r=g(r,s,n,e,i[14],17,-1502002290),n=m(n,e=g(e,r,s,n,i[15],22,1236535329),r,s,i[1],5,-165796510),s=m(s,n,e,r,i[6],9,-1069501632),r=m(r,s,n,e,i[11],14,643717713),e=m(e,r,s,n,i[0],20,-373897302),n=m(n,e,r,s,i[5],5,-701558691),s=m(s,n,e,r,i[10],9,38016083),r=m(r,s,n,e,i[15],14,-660478335),e=m(e,r,s,n,i[4],20,-405537848),n=m(n,e,r,s,i[9],5,568446438),s=m(s,n,e,r,i[14],9,-1019803690),r=m(r,s,n,e,i[3],14,-187363961),e=m(e,r,s,n,i[8],20,1163531501),n=m(n,e,r,s,i[13],5,-1444681467),s=m(s,n,e,r,i[2],9,-51403784),r=m(r,s,n,e,i[7],14,1735328473),n=v(n,e=m(e,r,s,n,i[12],20,-1926607734),r,s,i[5],4,-378558),s=v(s,n,e,r,i[8],11,-2022574463),r=v(r,s,n,e,i[11],16,1839030562),e=v(e,r,s,n,i[14],23,-35309556),n=v(n,e,r,s,i[1],4,-1530992060),s=v(s,n,e,r,i[4],11,1272893353),r=v(r,s,n,e,i[7],16,-155497632),e=v(e,r,s,n,i[10],23,-1094730640),n=v(n,e,r,s,i[13],4,681279174),s=v(s,n,e,r,i[0],11,-358537222),r=v(r,s,n,e,i[3],16,-722521979),e=v(e,r,s,n,i[6],23,76029189),n=v(n,e,r,s,i[9],4,-640364487),s=v(s,n,e,r,i[12],11,-421815835),r=v(r,s,n,e,i[15],16,530742520),n=b(n,e=v(e,r,s,n,i[2],23,-995338651),r,s,i[0],6,-198630844),s=b(s,n,e,r,i[7],10,1126891415),r=b(r,s,n,e,i[14],15,-1416354905),e=b(e,r,s,n,i[5],21,-57434055),n=b(n,e,r,s,i[12],6,1700485571),s=b(s,n,e,r,i[3],10,-1894986606),r=b(r,s,n,e,i[10],15,-1051523),e=b(e,r,s,n,i[1],21,-2054922799),n=b(n,e,r,s,i[8],6,1873313359),s=b(s,n,e,r,i[15],10,-30611744),r=b(r,s,n,e,i[6],15,-1560198380),e=b(e,r,s,n,i[13],21,1309151649),n=b(n,e,r,s,i[4],6,-145523070),s=b(s,n,e,r,i[11],10,-1120210379),r=b(r,s,n,e,i[2],15,718787259),e=b(e,r,s,n,i[9],21,-343485551),t[0]=_(n,t[0]),t[1]=_(e,t[1]),t[2]=_(r,t[2]),t[3]=_(s,t[3])}function p(t,i,n,e,r,s){return i=_(_(i,t),_(e,s)),_(i<<r|i>>>32-r,n)}function g(t,i,n,e,r,s,o){return p(i&n|~i&e,t,i,r,s,o)}function m(t,i,n,e,r,s,o){return p(i&e|n&~e,t,i,r,s,o)}function v(t,i,n,e,r,s,o){return p(i^n^e,t,i,r,s,o)}function b(t,i,n,e,r,s,o){return p(n^(i|~e),t,i,r,s,o)}function y(t){var i,n=t.length,e=[1732584193,-271733879,-1732584194,271733878];for(i=64;i<=t.length;i+=64)d(e,w(t.substring(i-64,i)));t=t.substring(i-64);var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<t.length;i++)r[i>>2]|=t.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(d(e,r),i=0;i<16;i++)r[i]=0;return r[14]=8*n,d(e,r),e}function w(t){var i,n=[];for(i=0;i<64;i+=4)n[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return n}u=n.atob.bind(n),h=n.btoa.bind(n);var N="0123456789abcdef".split("");function L(t){for(var i="",n=0;n<4;n++)i+=N[t>>8*n+4&15]+N[t>>8*n&15];return i}function A(t){return String.fromCharCode((255&t)>>0,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function x(t){return y(t).map(A).join("")}var S="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var i=0;i<t.length;i++)t[i]=L(t[i]);return t.join("")}(y("hello"));function _(t,i){if(S){var n=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(n>>16)<<16|65535&n}return t+i&4294967295} /** * @license * FPDF is released under a permissive license: there is no usage restriction. * You may embed it freely in your application (commercial or not), with or * without modifications. * * Reference: http://www.fpdf.org/en/script/script37.php */function P(t,i){var n,e,r,s;if(t!==n){for(var o=(r=t,s=1+(256/t.length>>0),new Array(s+1).join(r)),a=[],u=0;u<256;u++)a[u]=u;var c=0;for(u=0;u<256;u++){var f=a[u];c=(c+f+o.charCodeAt(u))%256,a[u]=a[c],a[c]=f}n=t,e=a}else a=e;var h=i.length,l=0,d=0,v="";for(u=0;u<h;u++)d=(d+(f=a[l=(l+1)%256]))%256,a[l]=a[d],a[d]=f,o=a[(a[l]+a[d])%256],v+=String.fromCharCode(i.charCodeAt(u)^o);return v} /** * @license * Licensed under the MIT License. * http://opensource.org/licenses/mit-license * Author: Owen Leong (@owenl131) * Date: 15 Oct 2020 * References: * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt * https://github.com/foliojs/pdfkit/blob/master/lib/security.js * http://www.fpdf.org/en/script/script37.php */var k={print:4,modify:8,copy:16,"annot-forms":32};function I(t,i,n,e){this.v=1,this.r=2;var r=192;t.forEach((function(t){r+=k[t]})),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(i+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^r)),this.encryptionKey=x(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(e)).substr(0,5),this.U=P(this.encryptionKey,this.padding)}function F(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var i="",n=t.length,e=0;e<n;e++){var r=t.charCodeAt(e);if(r<33||35===r||37===r||40===r||41===r||47===r||60===r||62===r||91===r||93===r||123===r||125===r||r>126)i+="#"+("0"+r.toString(16)).slice(-2);else i+=t[e]}return i}function C(i){if("object"!==t(i))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,i,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof i||"boolean"!=typeof n)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var r=Math.random().toString(35);return e[t][r]=[i,!!n],r},this.unsubscribe=function(t){for(var i in e)if(e[i][t])return delete e[i][t],0===Object.keys(e[i]).length&&delete e[i],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var r=Array.prototype.slice.call(arguments,1),s=[];for(var o in e[t]){var u=e[t][o];try{u[0].apply(i,r)}catch(t){n.console&&a.error("jsPDF PubSub Error",t.message,t)}u[1]&&s.push(o)}s.length&&s.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function j(t){if(!(this instanceof j))return new j(t);var i="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&i.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function O(t,i){this.gState=t,this.matrix=i,this.id="",this.objectNumber=-1}function B(t,i,n,e,r){if(!(this instanceof B))return new B(t,i,n,e,r);this.type="axial"===t?2:3,this.coords=i,this.colors=n,O.call(this,e,r)}function M(t,i,n,e,r){if(!(this instanceof M))return new M(t,i,n,e,r);this.boundingBox=t,this.xStep=i,this.yStep=n,this.stream="",this.cloneIndex=0,O.call(this,e,r)}function E(i){var e,r="string"==typeof arguments[0]?arguments[0]:"p",s=arguments[1],o=arguments[2],u=arguments[3],c=[],d=1,v=16,b="S",w=null;"object"===t(i=i||{})&&(r=i.orientation,s=i.unit||s,o=i.format||o,u=i.compress||i.compressPdf||u,null!==(w=i.encryption||null)&&(w.userPassword=w.userPassword||"",w.ownerPassword=w.ownerPassword||"",w.userPermissions=w.userPermissions||[]),d="number"==typeof i.userUnit?Math.abs(i.userUnit):1,void 0!==i.precision&&(e=i.precision),void 0!==i.floatPrecision&&(v=i.floatPrecision),b=i.defaultPathOperation||"S"),c=i.filters||(!0===u?["FlateEncode"]:c),s=s||"mm",r=(""+(r||"P")).toLowerCase();var m=i.putOnlyUsedFonts||!1,p={},g={internal:{},__private__:{}};g.__private__.PubSub=C;var N="1.3",y=g.__private__.getPdfVersion=function(){return N};g.__private__.setPdfVersion=function(t){N=t};var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};g.__private__.getPageFormats=function(){return L};var A=g.__private__.getPageFormat=function(t){return L[t]};o=o||"a4";var k={COMPAT:"compat",ADVANCED:"advanced"},S=k.COMPAT;function x(){this.saveGraphicsState(),ht(new Ht(xt,0,0,-xt,0,zn()*xt).toString()+" cm"),this.setFontSize(this.getFontSize()/xt),b="n",S=k.ADVANCED}function q(){this.restoreGraphicsState(),b="S",S=k.COMPAT}var O=g.__private__.combineFontStyleAndFontWeight=function(t,i){if("bold"==t&&"normal"==i||"bold"==t&&400==i||"normal"==t&&"italic"==i||"bold"==t&&"italic"==i)throw new Error("Invalid Combination of fontweight and fontstyle");return i&&(t=400==i||"normal"===i?"italic"===t?"italic":"normal":700!=i&&"bold"!==i||"normal"!==t?(700==i?"bold":i)+""+t:"bold"),t};g.advancedAPI=function(t){var i=S===k.COMPAT;return i&&x.call(this),"function"!=typeof t||(t(this),i&&q.call(this)),this},g.compatAPI=function(t){var i=S===k.ADVANCED;return i&&q.call(this),"function"!=typeof t||(t(this),i&&x.call(this)),this},g.isAdvancedAPI=function(){return S===k.ADVANCED};var P,D=function(t){if(S!==k.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},R=g.roundToPrecision=g.__private__.roundToPrecision=function(t,i){var n=e||i;if(isNaN(t)||isNaN(n))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(n).replace(/0+$/,"")};P=g.hpf=g.__private__.hpf="number"==typeof v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return R(t,v)}:"smart"===v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return R(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return R(t,16)};var T=g.f2=g.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return R(t,2)},z=g.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return R(t,3)},U=g.scale=g.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return S===k.COMPAT?t*xt:S===k.ADVANCED?t:void 0},_=function(t){return S===k.COMPAT?zn()-t:S===k.ADVANCED?t:void 0},V=function(t){return U(_(t))};g.__private__.setPrecision=g.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(e=parseInt(t,10))};var $,H="00000000000000000000000000000000",W=g.__private__.getFileId=function(){return H},G=g.__private__.setFileId=function(t){return H=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():H.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join(""),null!==w&&(Gi=new I(w.userPermissions,w.userPassword,w.ownerPassword,H)),H};g.setFileId=function(t){return G(t),this},g.getFileId=function(){return W()};var J=g.__private__.convertDateToPDFDate=function(t){var i=t.getTimezoneOffset(),n=i<0?"+":"-",e=Math.floor(Math.abs(i/60)),r=Math.abs(i%60),s=[n,Q(e),"'",Q(r),"'"].join("");return["D:",t.getFullYear(),Q(t.getMonth()+1),Q(t.getDate()),Q(t.getHours()),Q(t.getMinutes()),Q(t.getSeconds()),s].join("")},K=g.__private__.convertPDFDateToDate=function(t){var i=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,e=parseInt(t.substr(8,2),10),r=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(i,n,e,r,s,o,0)},X=g.__private__.setCreationDate=function(t){var i;if(void 0===t&&(t=new Date),t instanceof Date)i=J(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");i=t}return $=i},Y=g.__private__.getCreationDate=function(t){var i=$;return"jsDate"===t&&(i=K($)),i};g.setCreationDate=function(t){return X(t),this},g.getCreationDate=function(t){return Y(t)};var Z,Q=g.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},tt=g.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},it=0,nt=[],et=[],rt=0,st=[],ot=[],at=!1,ut=et,ct=function(){it=0,rt=0,et=[],nt=[],st=[],Qt=Xt(),ti=Xt()};g.__private__.setCustomOutputDestination=function(t){at=!0,ut=t};var ft=function(t){at||(ut=t)};g.__private__.resetCustomOutputDestination=function(){at=!1,ut=et};var ht=g.__private__.out=function(t){return t=t.toString(),rt+=t.length+1,ut.push(t),ut},lt=g.__private__.write=function(t){return ht(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},dt=g.__private__.getArrayBuffer=function(t){for(var i=t.length,n=new ArrayBuffer(i),e=new Uint8Array(n);i--;)e[i]=t.charCodeAt(i);return n},vt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];g.__private__.getStandardFonts=function(){return vt};var bt=i.fontSize||16;g.__private__.setFontSize=g.setFontSize=function(t){return bt=S===k.ADVANCED?t/xt:t,this};var wt,mt=g.__private__.getFontSize=g.getFontSize=function(){return S===k.COMPAT?bt:bt*xt},pt=i.R2L||!1;g.__private__.setR2L=g.setR2L=function(t){return pt=t,this},g.__private__.getR2L=g.getR2L=function(){return pt};var gt,Nt=g.__private__.setZoomMode=function(t){var i=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))wt=t;else if(isNaN(t)){if(-1===i.indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');wt=t}else wt=parseInt(t,10)};g.__private__.getZoomMode=function(){return wt};var yt,Lt=g.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');gt=t};g.__private__.getPageMode=function(){return gt};var At=g.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');yt=t};g.__private__.getLayoutMode=function(){return yt},g.__private__.setDisplayMode=g.setDisplayMode=function(t,i,n){return Nt(t),At(i),Lt(n),this};var kt={title:"",subject:"",author:"",keywords:"",creator:""};g.__private__.getDocumentProperty=function(t){if(-1===Object.keys(kt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return kt[t]},g.__private__.getDocumentProperties=function(){return kt},g.__private__.setDocumentProperties=g.setProperties=g.setDocumentProperties=function(t){for(var i in kt)kt.hasOwnProperty(i)&&t[i]&&(kt[i]=t[i]);return this},g.__private__.setDocumentProperty=function(t,i){if(-1===Object.keys(kt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return kt[t]=i};var St,xt,qt,Et,jt,Mt={},Ot={},Pt=[],It={},Dt={},Rt={},Tt={},Ft=null,Bt=0,Ct=[],zt=new C(g),Ut=i.hotfixes||[],_t={},Vt={},$t=[],Ht=function t(i,n,e,r,s,o){if(!(this instanceof t))return new t(i,n,e,r,s,o);isNaN(i)&&(i=1),isNaN(n)&&(n=0),isNaN(e)&&(e=0),isNaN(r)&&(r=1),isNaN(s)&&(s=0),isNaN(o)&&(o=0),this._matrix=[i,n,e,r,s,o]};Object.defineProperty(Ht.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ht.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ht.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ht.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ht.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ht.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ht.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Ht.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Ht.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Ht.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Ht.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Ht.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Ht.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ht.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ht.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ht.prototype,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Ht.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(P).join(t)},Ht.prototype.multiply=function(t){var i=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,e=t.shx*this.sx+t.sy*this.shx,r=t.shx*this.shy+t.sy*this.sy,s=t.tx*this.sx+t.ty*this.shx+this.tx,o=t.tx*this.shy+t.ty*this.sy+this.ty;return new Ht(i,n,e,r,s,o)},Ht.prototype.decompose=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=Math.sqrt(t*t+i*i),a=(t/=o)*n+(i/=o)*e;n-=t*a,e-=i*a;var u=Math.sqrt(n*n+e*e);return a/=u,t*(e/=u)<i*(n/=u)&&(t=-t,i=-i,a=-a,o=-o),{scale:new Ht(o,0,0,u,0,0),translate:new Ht(1,0,0,1,r,s),rotate:new Ht(t,i,-i,t,0,0),skew:new Ht(1,0,a,1,0,0)}},Ht.prototype.toString=function(t){return this.join(" ")},Ht.prototype.inversed=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty,o=1/(t*e-i*n),a=e*o,u=-i*o,c=-n*o,f=t*o;return new Ht(a,u,c,f,-a*r-c*s,-u*r-f*s)},Ht.prototype.applyToPoint=function(t){var i=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new Pn(i,n)},Ht.prototype.applyToRectangle=function(t){var i=this.applyToPoint(t),n=this.applyToPoint(new Pn(t.x+t.w,t.y+t.h));return new In(i.x,i.y,n.x-i.x,n.y-i.y)},Ht.prototype.clone=function(){var t=this.sx,i=this.shy,n=this.shx,e=this.sy,r=this.tx,s=this.ty;return new Ht(t,i,n,e,r,s)},g.Matrix=Ht;var Wt=g.matrixMult=function(t,i){return i.multiply(t)},Gt=new Ht(1,0,0,1,0,0);g.unitMatrix=g.identityMatrix=Gt;var Jt=function(t,i){if(!Dt[t]){var n=(i instanceof B?"Sh":"P")+(Object.keys(It).length+1).toString(10);i.id=n,Dt[t]=n,It[n]=i,zt.publish("addPattern",i)}};g.ShadingPattern=B,g.TilingPattern=M,g.addShadingPattern=function(t,i){return D("addShadingPattern()"),Jt(t,i),this},g.beginTilingPattern=function(t){D("beginTilingPattern()"),Rn(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},g.endTilingPattern=function(t,i){D("endTilingPattern()"),i.stream=ot[Z].join("\n"),Jt(t,i),zt.publish("endTilingPattern",i),$t.pop().restore()};var Kt=g.__private__.newObject=function(){var t=Xt();return Yt(t,!0),t},Xt=g.__private__.newObjectDeferred=function(){return it++,nt[it]=function(){return rt},it},Yt=function(t,i){return i="boolean"==typeof i&&i,nt[t]=rt,i&&ht(t+" 0 obj"),t},Zt=g.__private__.newAdditionalObject=function(){var t={objId:Xt(),content:""};return st.push(t),t},Qt=Xt(),ti=Xt(),ii=g.__private__.decodeColorString=function(t){var i=t.split(" ");if(2!==i.length||"g"!==i[1]&&"G"!==i[1]){if(5===i.length&&("k"===i[4]||"K"===i[4])){i=[(1-i[0])*(1-i[3]),(1-i[1])*(1-i[3]),(1-i[2])*(1-i[3]),"r"]}}else{var n=parseFloat(i[0]);i=[n,n,n,"r"]}for(var e="#",r=0;r<3;r++)e+=("0"+Math.floor(255*parseFloat(i[r])).toString(16)).slice(-2);return e},ni=g.__private__.encodeColorString=function(i){var n;"string"==typeof i&&(i={ch1:i});var e=i.ch1,r=i.ch2,s=i.ch3,o=i.ch4,a="draw"===i.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof e&&"#"!==e.charAt(0)){var u=new f(e);if(u.ok)e=u.toHex();else if(!/^\d*\.?\d*$/.test(e))throw new Error('Invalid color "'+e+'" passed to jsPDF.encodeColorString.')}if("string"==typeof e&&/^#[0-9A-Fa-f]{3}$/.test(e)&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),"string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var c=parseInt(e.substr(1),16);e=c>>16&255,r=c>>8&255,s=255&c}if(void 0===r||void 0===o&&e===r&&r===s)if("string"==typeof e)n=e+" "+a[0];else switch(i.precision){case 2:n=T(e/255)+" "+a[0];break;case 3:default:n=z(e/255)+" "+a[0]}else if(void 0===o||"object"===t(o)){if(o&&!isNaN(o.a)&&0===o.a)return n=["1.","1.","1.",a[1]].join(" ");if("string"==typeof e)n=[e,r,s,a[1]].join(" ");else switch(i.precision){case 2:n=[T(e/255),T(r/255),T(s/255),a[1]].join(" ");break;default:case 3:n=[z(e/255),z(r/255),z(s/255),a[1]].join(" ")}}else if("string"==typeof e)n=[e,r,s,o,a[2]].join(" ");else switch(i.precision){case 2:n=[T(e),T(r),T(s),T(o),a[2]].join(" ");break;case 3:default:n=[z(e),z(r),z(s),z(o),a[2]].join(" ")}return n},ei=g.__private__.getFilters=function(){return c},ri=g.__private__.putStream=function(t){var i=(t=t||{}).data||"",n=t.filters||ei(),e=t.alreadyAppliedFilters||[],r=t.addLength1||!1,s=i.length,o=t.objectId,a=function(t){return t};if(null!==w&&void 0===o)throw new Error("ObjectId must be passed to putStream for file encryption");null!==w&&(a=Gi.encryptor(o,0));var u={};!0===n&&(n=["FlateEncode"]);var c=t.additionalKeyValues||[],f=(u=void 0!==E.API.processDataByFilters?E.API.processDataByFilters(i,n):{data:i,reverseChain:[]}).reverseChain+(Array.isArray(e)?e.join(" "):e.toString());if(0!==u.data.length&&(c.push({key:"Length",value:u.data.length}),!0===r&&c.push({key:"Length1",value:s})),0!=f.length)if(f.split("/").length-1==1)c.push({key:"Filter",value:f});else{c.push({key:"Filter",value:"["+f+"]"});for(var h=0;h<c.length;h+=1)if("DecodeParms"===c[h].key){for(var l=[],d=0;d<u.reverseChain.split("/").length-1;d+=1)l.push("null");l.push(c[h].value),c[h].value="["+l.join(" ")+"]"}}ht("<<");for(var v=0;v<c.length;v++)ht("/"+c[v].key+" "+c[v].value);ht(">>"),0!==u.data.length&&(ht("stream"),ht(a(u.data)),ht("endstream"))},si=g.__private__.putPage=function(t){var i=t.number,n=t.data,e=t.objId,r=t.contentsObjId;Yt(e,!0),ht("<</Type /Page"),ht("/Parent "+t.rootDictionaryObjId+" 0 R"),ht("/Resources "+t.resourceDictionaryObjId+" 0 R"),ht("/MediaBox ["+parseFloat(P(t.mediaBox.bottomLeftX))+" "+parseFloat(P(t.mediaBox.bottomLeftY))+" "+P(t.mediaBox.topRightX)+" "+P(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&ht("/CropBox ["+P(t.cropBox.bottomLeftX)+" "+P(t.cropBox.bottomLeftY)+" "+P(t.cropBox.topRightX)+" "+P(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&ht("/BleedBox ["+P(t.bleedBox.bottomLeftX)+" "+P(t.bleedBox.bottomLeftY)+" "+P(t.bleedBox.topRightX)+" "+P(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&ht("/TrimBox ["+P(t.trimBox.bottomLeftX)+" "+P(t.trimBox.bottomLeftY)+" "+P(t.trimBox.topRightX)+" "+P(t.trimBox.topRightY)+"]"),null!==t.artBox&&ht("/ArtBox ["+P(t.artBox.bottomLeftX)+" "+P(t.artBox.bottomLeftY)+" "+P(t.artBox.topRightX)+" "+P(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&ht("/UserUnit "+t.userUnit),zt.publish("putPage",{objId:e,pageContext:Ct[i],pageNumber:i,page:n}),ht("/Contents "+r+" 0 R"),ht(">>"),ht("endobj");var s=n.join("\n");return S===k.ADVANCED&&(s+="\nQ"),Yt(r,!0),ri({data:s,filters:ei(),objectId:r}),ht("endobj"),e},oi=g.__private__.putPages=function(){var t,i,n=[];for(t=1;t<=Bt;t++)Ct[t].objId=Xt(),Ct[t].contentsObjId=Xt();for(t=1;t<=Bt;t++)n.push(si({number:t,data:ot[t],objId:Ct[t].objId,contentsObjId:Ct[t].contentsObjId,mediaBox:Ct[t].mediaBox,cropBox:Ct[t].cropBox,bleedBox:Ct[t].bleedBox,trimBox:Ct[t].trimBox,artBox:Ct[t].artBox,userUnit:Ct[t].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:ti}));Yt(Qt,!0),ht("<</Type /Pages");var e="/Kids [";for(i=0;i<Bt;i++)e+=n[i]+" 0 R ";ht(e+"]"),ht("/Count "+Bt),ht(">>"),ht("endobj"),zt.publish("postPutPages")},ai=function(t){zt.publish("putFont",{font:t,out:ht,newObject:Kt,putStream:ri}),!0!==t.isAlreadyPutted&&(t.objectNumber=Kt(),ht("<<"),ht("/Type /Font"),ht("/BaseFont /"+F(t.postScriptName)),ht("/Subtype /Type1"),"string"==typeof t.encoding&&ht("/Encoding /"+t.encoding),ht("/FirstChar 32"),ht("/LastChar 255"),ht(">>"),ht("endobj"))},ui=function(){for(var t in Mt)Mt.hasOwnProperty(t)&&(!1===m||!0===m&&p.hasOwnProperty(t))&&ai(Mt[t])},ci=function(t){t.objectNumber=Kt();var i=[];i.push({key:"Type",value:"/XObject"}),i.push({key:"Subtype",value:"/Form"}),i.push({key:"BBox",value:"["+[P(t.x),P(t.y),P(t.x+t.width),P(t.y+t.height)].join(" ")+"]"}),i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");ri({data:n,additionalKeyValues:i,objectId:t.objectNumber}),ht("endobj")},fi=function(){for(var t in _t)_t.hasOwnProperty(t)&&ci(_t[t])},hi=function(t,i){var n,e=[],r=1/(i-1);for(n=0;n<1;n+=r)e.push(n);if(e.push(1),0!=t[0].offset){var s={offset:0,color:t[0].color};t.unshift(s)}if(1!=t[t.length-1].offset){var o={offset:1,color:t[t.length-1].color};t.push(o)}for(var a="",u=0,c=0;c<e.length;c++){for(n=e[c];n>t[u+1].offset;)u++;var f=t[u].offset,h=(n-f)/(t[u+1].offset-f),l=t[u].color,d=t[u+1].color;a+=tt(Math.round((1-h)*l[0]+h*d[0]).toString(16))+tt(Math.round((1-h)*l[1]+h*d[1]).toString(16))+tt(Math.round((1-h)*l[2]+h*d[2]).toString(16))}return a.trim()},li=function(t,i){i||(i=21);var n=Kt(),e=hi(t.colors,i),r=[];r.push({key:"FunctionType",value:"0"}),r.push({key:"Domain",value:"[0.0 1.0]"}),r.push({key:"Size",value:"["+i+"]"}),r.push({key:"BitsPerSample",value:"8"}),r.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),r.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ri({data:e,additionalKeyValues:r,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),ht("endobj"),t.objectNumber=Kt(),ht("<< /ShadingType "+t.type),ht("/ColorSpace /DeviceRGB");var s="/Coords ["+P(parseFloat(t.coords[0]))+" "+P(parseFloat(t.coords[1]))+" ";2===t.type?s+=P(parseFloat(t.coords[2]))+" "+P(parseFloat(t.coords[3])):s+=P(parseFloat(t.coords[2]))+" "+P(parseFloat(t.coords[3]))+" "+P(parseFloat(t.coords[4]))+" "+P(parseFloat(t.coords[5])),ht(s+="]"),t.matrix&&ht("/Matrix ["+t.matrix.toString()+"]"),ht("/Function "+n+" 0 R"),ht("/Extend [true true]"),ht(">>"),ht("endobj")},di=function(t,i){var n=Xt(),e=Kt();i.push({resourcesOid:n,objectOid:e}),t.objectNumber=e;var r=[];r.push({key:"Type",value:"/Pattern"}),r.push({key:"PatternType",value:"1"}),r.push({key:"PaintType",value:"1"}),r.push({key:"TilingType",value:"1"}),r.push({key:"BBox",value:"["+t.boundingBox.map(P).join(" ")+"]"}),r.push({key:"XStep",value:P(t.xStep)}),r.push({key:"YStep",value:P(t.yStep)}),r.push({key:"Resources",value:n+" 0 R"}),t.matrix&&r.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ri({data:t.stream,additionalKeyValues:r,objectId:t.objectNumber}),ht("endobj")},vi=function(t){var i;for(i in It)It.hasOwnProperty(i)&&(It[i]instanceof B?li(It[i]):It[i]instanceof M&&di(It[i],t))},bi=function(t){for(var i in t.objectNumber=Kt(),ht("<<"),t)switch(i){case"opacity":ht("/ca "+T(t[i]));break;case"stroke-opacity":ht("/CA "+T(t[i]))}ht(">>"),ht("endobj")},wi=function(){var t;for(t in Rt)Rt.hasOwnProperty(t)&&bi(Rt[t])},mi=function(){for(var t in ht("/XObject <<"),_t)_t.hasOwnProperty(t)&&_t[t].objectNumber>=0&&ht("/"+t+" "+_t[t].objectNumber+" 0 R");zt.publish("putXobjectDict"),ht(">>")},pi=function(){Gi.oid=Kt(),ht("<<"),ht("/Filter /Standard"),ht("/V "+Gi.v),ht("/R "+Gi.r),ht("/U <"+Gi.toHexString(Gi.U)+">"),ht("/O <"+Gi.toHexString(Gi.O)+">"),ht("/P "+Gi.P),ht(">>"),ht("endobj")},gi=function(){for(var t in ht("/Font <<"),Mt)Mt.hasOwnProperty(t)&&(!1===m||!0===m&&p.hasOwnProperty(t))&&ht("/"+t+" "+Mt[t].objectNumber+" 0 R");ht(">>")},Ni=function(){if(Object.keys(It).length>0){for(var t in ht("/Shading <<"),It)It.hasOwnProperty(t)&&It[t]instanceof B&&It[t].objectNumber>=0&&ht("/"+t+" "+It[t].objectNumber+" 0 R");zt.publish("putShadingPatternDict"),ht(">>")}},yi=function(t){if(Object.keys(It).length>0){for(var i in ht("/Pattern <<"),It)It.hasOwnProperty(i)&&It[i]instanceof g.TilingPattern&&It[i].objectNumber>=0&&It[i].objectNumber<t&&ht("/"+i+" "+It[i].objectNumber+" 0 R");zt.publish("putTilingPatternDict"),ht(">>")}},Li=function(){if(Object.keys(Rt).length>0){var t;for(t in ht("/ExtGState <<"),Rt)Rt.hasOwnProperty(t)&&Rt[t].objectNumber>=0&&ht("/"+t+" "+Rt[t].objectNumber+" 0 R");zt.publish("putGStateDict"),ht(">>")}},Ai=function(t){Yt(t.resourcesOid,!0),ht("<<"),ht("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),gi(),Ni(),yi(t.objectOid),Li(),mi(),ht(">>"),ht("endobj")},ki=function(){var t=[];ui(),wi(),fi(),vi(t),zt.publish("putResources"),t.forEach(Ai),Ai({resourcesOid:ti,objectOid:Number.MAX_SAFE_INTEGER}),zt.publish("postPutResources")},Si=function(){zt.publish("putAdditionalObjects");for(var t=0;t<st.length;t++){var i=st[t];Yt(i.objId,!0),ht(i.content),ht("endobj")}zt.publish("postPutAdditionalObjects")},xi=function(t){Ot[t.fontName]=Ot[t.fontName]||{},Ot[t.fontName][t.fontStyle]=t.id},qi=function(t,i,n,e,r){var s={id:"F"+(Object.keys(Mt).length+1).toString(10),postScriptName:t,fontName:i,fontStyle:n,encoding:e,isStandardFont:r||!1,metadata:{}};return zt.publish("addFont",{font:s,instance:this}),Mt[s.id]=s,xi(s),s.id},Ei=function(t){for(var i=0,n=vt.length;i<n;i++){var e=qi.call(this,t[i][0],t[i][1],t[i][2],vt[i][3],!0);!1===m&&(p[e]=!0);var r=t[i][0].split("-");xi({id:e,fontName:r[0],fontStyle:r[1]||""})}zt.publish("addFonts",{fonts:Mt,dictionary:Ot})},ji=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var i=t.stack||"";~i.indexOf(" at ")&&(i=i.split(" at ")[1]);var e="Error in function "+i.split("\n")[0].split("<")[0]+": "+t.message;if(!n.console)throw new Error(e);n.console.error(e,t),n.alert&&alert(e)}},t.foo.bar=t,t.foo},Mi=function(t,i){var n,e,r,s,o,a,u,c,f;if(r=(i=i||{}).sourceEncoding||"Unicode",o=i.outputEncoding,(i.autoencode||o)&&Mt[St].metadata&&Mt[St].metadata[r]&&Mt[St].metadata[r].encoding&&(s=Mt[St].metadata[r].encoding,!o&&Mt[St].encoding&&(o=Mt[St].encoding),!o&&s.codePages&&(o=s.codePages[0]),"string"==typeof o&&(o=s[o]),o)){for(u=!1,a=[],n=0,e=t.length;n<e;n++)(c=o[t.charCodeAt(n)])?a.push(St