2 lines
60 KiB
JavaScript
2 lines
60 KiB
JavaScript
var qe=function(f,D,ie,ne,O){"use strict";let rt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgrey:[211,211,211],lightgreen:[144,238,144],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0]},F={black:[rt.black,1],white:[rt.white,1],transparent:[rt.black,0]},It={quot:34,amp:38,lt:60,gt:62,apos:39,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,fnof:402,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,bull:8226,hellip:8230,prime:8242,Prime:8243,oline:8254,frasl:8260,weierp:8472,image:8465,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Tt={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},se={A3:!0,A4:!0,a3:!0,a4:!0},ae={color:{inherit:!0,initial:void 0},visibility:{inherit:!0,initial:"visible",values:{hidden:"hidden",collapse:"hidden",visible:"visible"}},fill:{inherit:!0,initial:F.black},stroke:{inherit:!0,initial:"none"},"stop-color":{inherit:!1,initial:F.black},"fill-opacity":{inherit:!0,initial:1},"stroke-opacity":{inherit:!0,initial:1},"stop-opacity":{inherit:!1,initial:1},"fill-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"clip-rule":{inherit:!0,initial:"nonzero",values:{nonzero:"nonzero",evenodd:"evenodd"}},"stroke-width":{inherit:!0,initial:1},"stroke-dasharray":{inherit:!0,initial:[]},"stroke-dashoffset":{inherit:!0,initial:0},"stroke-miterlimit":{inherit:!0,initial:4},"stroke-linejoin":{inherit:!0,initial:"miter",values:{miter:"miter",round:"round",bevel:"bevel"}},"stroke-linecap":{inherit:!0,initial:"butt",values:{butt:"butt",round:"round",square:"square"}},"font-size":{inherit:!0,initial:16,values:{"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32}},"font-family":{inherit:!0,initial:"sans-serif"},"font-weight":{inherit:!0,initial:"normal",values:{600:"bold",700:"bold",800:"bold",900:"bold",bold:"bold",bolder:"bold",500:"normal",400:"normal",300:"normal",200:"normal",100:"normal",normal:"normal",lighter:"normal"}},"font-style":{inherit:!0,initial:"normal",values:{italic:"italic",oblique:"italic",normal:"normal"}},"text-anchor":{inherit:!0,initial:"start",values:{start:"start",middle:"middle",end:"end"}},direction:{inherit:!0,initial:"ltr",values:{ltr:"ltr",rtl:"rtl"}},"dominant-baseline":{inherit:!0,initial:"baseline",values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"alignment-baseline":{inherit:!1,initial:void 0,values:{auto:"baseline",baseline:"baseline","before-edge":"before-edge","text-before-edge":"before-edge",middle:"middle",central:"central","after-edge":"after-edge","text-after-edge":"after-edge",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"mathematical"}},"baseline-shift":{inherit:!0,initial:"baseline",values:{baseline:"baseline",sub:"sub",super:"super"}},"word-spacing":{inherit:!0,initial:0,values:{normal:0}},"letter-spacing":{inherit:!0,initial:0,values:{normal:0}},"text-decoration":{inherit:!1,initial:"none",values:{none:"none",underline:"underline",overline:"overline","line-through":"line-through"}},"xml:space":{inherit:!0,initial:"default",css:"white-space",values:{preserve:"preserve",default:"default",pre:"preserve","pre-line":"preserve","pre-wrap":"preserve",nowrap:"default"}},"marker-start":{inherit:!0,initial:"none"},"marker-mid":{inherit:!0,initial:"none"},"marker-end":{inherit:!0,initial:"none"},opacity:{inherit:!1,initial:1},transform:{inherit:!1,initial:[1,0,0,1,0,0]},display:{inherit:!1,initial:"inline",values:{none:"none",inline:"inline",block:"inline"}},"clip-path":{inherit:!1,initial:"none"},mask:{inherit:!1,initial:"none"},overflow:{inherit:!1,initial:"hidden",values:{hidden:"hidden",scroll:"hidden",visible:"visible"}}};function X(n){let e=new function(){};return e.name="G"+(f._groupCount=(f._groupCount||0)+1),e.resources=f.ref(),e.xobj=f.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:n,Group:{S:"Transparency",CS:"DeviceRGB",I:!0,K:!1},Resources:e.resources}),e.xobj.write(""),e.savedMatrix=f._ctm,e.savedPage=f.page,wt.push(e),f._ctm=[1,0,0,1,0,0],f.page={width:f.page.width,height:f.page.height,write:function(t){e.xobj.write(t)},fonts:{},xobjects:{},ext_gstates:{},patterns:{}},e}function B(n){if(n!==wt.pop())throw"Group not matching";Object.keys(f.page.fonts).length&&(n.resources.data.Font=f.page.fonts),Object.keys(f.page.xobjects).length&&(n.resources.data.XObject=f.page.xobjects),Object.keys(f.page.ext_gstates).length&&(n.resources.data.ExtGState=f.page.ext_gstates),Object.keys(f.page.patterns).length&&(n.resources.data.Pattern=f.page.patterns),n.resources.end(),n.xobj.end(),f._ctm=n.savedMatrix,f.page=n.savedPage}function ht(n){f.page.xobjects[n.name]=n.xobj,f.addContent("/"+n.name+" Do")}function Ot(n,e){let t="M"+(f._maskCount=(f._maskCount||0)+1),r=f.ref({Type:"ExtGState",CA:1,ca:1,BM:"Normal",SMask:{S:"Luminosity",G:n.xobj,BC:e?[0,0,0]:[1,1,1]}});r.end(),f.page.ext_gstates[t]=r,f.addContent("/"+t+" gs")}function re(n,e,t,r){let a=new function(){};return a.group=n,a.dx=e,a.dy=t,a.matrix=r||[1,0,0,1,0,0],a}function Nt(n,e){let t="P"+(f._patternCount=(f._patternCount||0)+1),r=f.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:[0,0,n.dx,n.dy],XStep:n.dx,YStep:n.dy,Matrix:A(f._ctm,n.matrix),Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],XObject:function(){let a={};return a[n.group.name]=n.group.xobj,a}()}});r.write("/"+n.group.name+" Do"),r.end(),f.page.patterns[t]=r,e?(f.addContent("/Pattern CS"),f.addContent("/"+t+" SCN")):(f.addContent("/Pattern cs"),f.addContent("/"+t+" scn"))}function he(n,e){f.page.fonts[n.id]||(f.page.fonts[n.id]=n.ref()),f.addContent("BT").addContent("/"+n.id+" "+e+" Tf")}function le(n,e,t,r,a,i){f.addContent(H(n)+" "+H(e)+" "+H(-t)+" "+H(-r)+" "+H(a)+" "+H(i)+" Tm")}function oe(n,e){let t=n&&e?2:e?1:n?0:3;f.addContent(t+" Tr")}function ge(n){f.addContent("<"+n+"> Tj")}function ue(){f.addContent("ET")}function Q(n){n[0].constructor.name==="PDFPattern"?(f.fillOpacity(n[1]),Nt(n[0],!1)):f.fillColor(n[0],n[1])}function kt(n){n[0].constructor.name==="PDFPattern"?(f.strokeOpacity(n[1]),Nt(n[0],!0)):f.strokeColor(n[0],n[1])}function fe(n,e,t,r,a){let i=f.ref({Type:"Annot",Subtype:"Link",Rect:[n,e,t,r],Border:[0,0,0],A:{S:"URI",URI:new String(a)}});i.end(),_t.push(i)}function Ht(n){let e=function(s,l,h,u){this.error=u,this.nodeName=s,this.nodeValue=h,this.nodeType=l,this.attributes=Object.create(null),this.childNodes=[],this.parentNode=null,this.id="",this.textContent="",this.classList=[]};e.prototype.getAttribute=function(s){return this.attributes[s]!=null?this.attributes[s]:null},e.prototype.getElementById=function(s){let l=null;return function h(u){if(!l&&u.nodeType===1){u.id===s&&(l=u);for(let c=0;c<u.childNodes.length;c++)h(u.childNodes[c])}}(this),l},e.prototype.getElementsByTagName=function(s){let l=[];return function h(u){if(u.nodeType===1){u.nodeName===s&&l.push(u);for(let c=0;c<u.childNodes.length;c++)h(u.childNodes[c])}}(this),l};let t=new z(n.trim()),r,a,i=!1,o=function(){let s,l;if(s=t.match(/^<([\w:.-]+)\s*/,!0)){let h=new e(s[1],1,null,i);for(;s=t.match(/^([\w:.-]+)(?:\s*=\s*"([^"]*)"|\s*=\s*'([^']*)')?\s*/,!0);){let u=s[1],c=Wt(s[2]||s[3]||"");h.attributes[u]?(V('parseXml: duplicate attribute "'+u+'"'),i=!0):(h.attributes[u]=c,u==="id"&&(h.id=c),u==="class"&&(h.classList=c.split(" ")))}if(t.match(/^>/)){for(;l=o();)h.childNodes.push(l),l.parentNode=h,h.textContent+=l.nodeType===3||l.nodeType===4?l.nodeValue:l.textContent;return(s=t.match(/^<\/([\w:.-]+)\s*>/,!0))?(s[1]===h.nodeName||(V('parseXml: tag not matching, opening "'+h.nodeName+'" & closing "'+s[1]+'"'),i=!0),h):(V('parseXml: tag not matching, opening "'+h.nodeName+'" & not closing'),i=!0,h)}else{if(t.match(/^\/>/))return h;V('parseXml: tag could not be parsed "'+h.nodeName+'"'),i=!0}}else{if(s=t.match(/^<!--[\s\S]*?-->/))return new e(null,8,s,i);if(s=t.match(/^<\?[\s\S]*?\?>/))return new e(null,7,s,i);if(s=t.match(/^<!DOCTYPE\s*([\s\S]*?)>/))return new e(null,10,s,i);if(s=t.match(/^<!\[CDATA\[([\s\S]*?)\]\]>/,!0))return new e("#cdata-section",4,s[1],i);if(s=t.match(/^([^<]+)/,!0))return new e("#text",3,Wt(s[1]),i)}};for(;a=o();)a.nodeType===1&&!r?r=a:(a.nodeType===1||a.nodeType===3&&a.nodeValue.trim()!=="")&&V("parseXml: data after document end has been discarded");return t.matchAll()&&V("parseXml: parsing error"),r}function Wt(n){return n.replace(/&(?:#([0-9]+)|#[xX]([0-9A-Fa-f]+)|([0-9A-Za-z]+));/g,function(e,t,r,a){return t?String.fromCharCode(parseInt(t,10)):r?String.fromCharCode(parseInt(r,16)):a&&It[a]?String.fromCharCode(It[a]):e})}function lt(n){let e,t;return n=(n||"").trim(),(e=rt[n])?t=[e.slice(),1]:(e=n.match(/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i))?(e[1]=parseInt(e[1]),e[2]=parseInt(e[2]),e[3]=parseInt(e[3]),e[4]=parseFloat(e[4]),e[1]<256&&e[2]<256&&e[3]<256&&e[4]<=1&&(t=[e.slice(1,4),e[4]])):(e=n.match(/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/i))?(e[1]=parseInt(e[1]),e[2]=parseInt(e[2]),e[3]=parseInt(e[3]),e[1]<256&&e[2]<256&&e[3]<256&&(t=[e.slice(1,4),1])):(e=n.match(/^rgb\(\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/i))?(e[1]=2.55*parseFloat(e[1]),e[2]=2.55*parseFloat(e[2]),e[3]=2.55*parseFloat(e[3]),e[1]<256&&e[2]<256&&e[3]<256&&(t=[e.slice(1,4),1])):(e=n.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i))?t=[[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)],1]:(e=n.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i))&&(t=[[17*parseInt(e[1],16),17*parseInt(e[2],16),17*parseInt(e[3],16)],1]),nt?nt(t,n):t}function ot(n,e,t){let r=n[0].slice(),a=n[1]*e;if(t){for(let i=0;i<n.length;i++)r[i]*=a;return[r,1]}else return[r,a]}function A(){function n(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}let e=arguments[0];for(let t=1;t<arguments.length;t++)e=n(e,arguments[t]);return e}function E(n,e){return[e[0]*n[0]+e[2]*n[1]+e[4],e[1]*n[0]+e[3]*n[1]+e[5]]}function qt(){let n=f._ctm;for(let e=wt.length-1;e>=0;e--)n=A(wt[e].savedMatrix,n);return n}function K(){return new _().M(0,0).L(f.page.width,0).L(f.page.width,f.page.height).L(0,f.page.height).transform(Ut(qt())).getBoundingBox()}function Ut(n){let e=n[0]*n[3]-n[1]*n[2];return[n[3]/e,-n[1]/e,-n[2]/e,n[0]/e,(n[2]*n[5]-n[3]*n[4])/e,(n[1]*n[4]-n[0]*n[5])/e]}function Mt(n){let e=H(n[0]),t=H(n[1]),r=H(n[2]),a=H(n[3]),i=H(n[4]),o=H(n[5]);if(j(e*a-t*r,0))return[e,t,r,a,i,o]}function Dt(n){let e=n[2]||0,t=n[1]||0,r=n[0]||0;if(N(e,0)&&N(t,0))return[];if(N(e,0))return[-r/t];{let a=t*t-4*e*r;return j(a,0)&&a>0?[(-t+Math.sqrt(a))/(2*e),(-t-Math.sqrt(a))/(2*e)]:N(a,0)?[-t/(2*e)]:[]}}function W(n,e){return(e[0]||0)+(e[1]||0)*n+(e[2]||0)*n*n+(e[3]||0)*n*n*n}function N(n,e){return Math.abs(n-e)<1e-10}function j(n,e){return Math.abs(n-e)>=1e-10}function H(n){return n>-1e21&&n<1e21?Math.round(n*1e6)/1e6:0}function ce(n){return typeof n=="object"&&n!==null&&typeof n.length=="number"}function yt(n){let e=new z((n||"").trim()),t=[1,0,0,1,0,0],r;for(;r=e.match(/^([A-Za-z]+)\s*[(]([^(]+)[)]/,!0);){let a=r[1],i=[],o=new z(r[2].trim()),s;for(;s=o.matchNumber();)i.push(Number(s)),o.matchSeparator();if(a==="matrix"&&i.length===6)t=A(t,[i[0],i[1],i[2],i[3],i[4],i[5]]);else if(a==="translate"&&i.length===2)t=A(t,[1,0,0,1,i[0],i[1]]);else if(a==="translate"&&i.length===1)t=A(t,[1,0,0,1,i[0],0]);else if(a==="scale"&&i.length===2)t=A(t,[i[0],0,0,i[1],0,0]);else if(a==="scale"&&i.length===1)t=A(t,[i[0],0,0,i[0],0,0]);else if(a==="rotate"&&i.length===3){let l=i[0]*Math.PI/180;t=A(t,[1,0,0,1,i[1],i[2]],[Math.cos(l),Math.sin(l),-Math.sin(l),Math.cos(l),0,0],[1,0,0,1,-i[1],-i[2]])}else if(a==="rotate"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[Math.cos(l),Math.sin(l),-Math.sin(l),Math.cos(l),0,0])}else if(a==="skewX"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[1,0,Math.tan(l),1,0,0])}else if(a==="skewY"&&i.length===1){let l=i[0]*Math.PI/180;t=A(t,[1,Math.tan(l),0,1,0,0])}else return;e.matchSeparator()}if(!e.matchAll())return t}function tt(n,e,t,r,a,i){let o=(n||"").trim().match(/^(none)$|^x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?$/)||[],s=o[1]||o[4]||"meet",l=o[2]||"Mid",h=o[3]||"Mid",u=e/r,c=t/a,m={Min:0,Mid:.5,Max:1}[l]-(i||0),w={Min:0,Mid:.5,Max:1}[h]-(i||0);return s==="slice"?c=u=Math.max(u,c):s==="meet"&&(c=u=Math.min(u,c)),[u,0,0,c,m*(e-r*u),w*(t-a*c)]}function Ft(n){let e=Object.create(null);n=(n||"").trim().split(/;/);for(let t=0;t<n.length;t++){let r=(n[t].split(":")[0]||"").trim(),a=(n[t].split(":")[1]||"").trim();r&&(e[r]=a)}if(e.marker&&(e["marker-start"]||(e["marker-start"]=e.marker),e["marker-mid"]||(e["marker-mid"]=e.marker),e["marker-end"]||(e["marker-end"]=e.marker)),e.font){let t=null,r=null,a="normal",i="normal",o="normal",s=e.font.split(/\s+/);for(let l=0;l<s.length;l++)switch(s[l]){case"normal":break;case"italic":case"oblique":a=s[l];break;case"small-caps":o=s[l];break;case"bold":case"bolder":case"lighter":case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":i=s[l];break;default:r?t?t+=" "+s[l]:t=s[l]:r=s[l].split("/")[0];break}e["font-style"]||(e["font-style"]=a),e["font-variant"]||(e["font-variant"]=o),e["font-weight"]||(e["font-weight"]=i),e["font-size"]||(e["font-size"]=r),e["font-family"]||(e["font-family"]=t)}return e}function de(n){let e=n.split(/(?=[.#])/g),t=[],r=[],a=[],i;for(let o=0;o<e.length;o++)if(i=e[o].match(/^[#]([_A-Za-z0-9-]+)$/))t.push(i[1]);else if(i=e[o].match(/^[.]([_A-Za-z0-9-]+)$/))r.push(i[1]);else if(i=e[o].match(/^([_A-Za-z0-9-]+)$/))a.push(i[1]);else if(e[o]!=="*")return;return{tags:a,ids:t,classes:r,specificity:t.length*1e4+r.length*100+a.length}}function pe(n){let e=new z(n.trim()),t=[],r;for(;r=e.match(/^\s*([^\{\}]*?)\s*\{([^\{\}]*?)\}/,!0);){let a=r[1].split(/\s*,\s*/g),i=Ft(r[2]);for(let o=0;o<a.length;o++){let s=de(a[o]);s&&t.push({selector:s,css:i})}}return t}function me(n,e){if(n.nodeType!==1)return!1;for(let t=0;t<e.tags.length;t++)if(e.tags[t]!==n.nodeName)return!1;for(let t=0;t<e.ids.length;t++)if(e.ids[t]!==n.id)return!1;for(let t=0;t<e.classes.length;t++)if(n.classList.indexOf(e.classes[t])===-1)return!1;return!0}function we(n){let e=Object.create(null),t=Object.create(null);for(let r=0;r<vt.length;r++){let a=vt[r];if(me(n,a.selector))for(let i in a.css)t[i]>a.selector.specificity||(e[i]=a.css[i],t[i]=a.selector.specificity)}return e}function et(n,e){return n.concat(e.slice(n.length))}function R(n,e){return Math.max(n.ascender,(n.bbox[3]||n.bbox.maxY)*(n.scale||1))*e/1e3}function gt(n,e){return Math.min(n.descender,(n.bbox[1]||n.bbox.minY)*(n.scale||1))*e/1e3}function ve(n,e){return(n.xHeight||.5*(n.ascender-n.descender))*e/1e3}function ke(n,e,t,r){let a,i;switch(t){case"middle":a=.5*ve(n,e);break;case"central":a=.5*(gt(n,e)+R(n,e));break;case"after-edge":case"text-after-edge":a=gt(n,e);break;case"alphabetic":case"auto":case"baseline":a=0;break;case"mathematical":a=.5*R(n,e);break;case"hanging":a=.8*R(n,e);break;case"before-edge":case"text-before-edge":a=R(n,e);break;default:a=0;break}switch(r){case"baseline":i=0;break;case"super":i=.6*e;break;case"sub":i=-.6*e;break;default:i=r;break}return a-i}function Me(n,e,t){let r=n.encode(""+t),a=r[0],i=r[1],o=[];for(let s=0;s<a.length;s++){let l=n.unicode?n.unicode[parseInt(a[s],16)]:[t.charCodeAt(s)];o.push({glyph:a[s],unicode:l,width:i[s].advanceWidth*e/1e3,xOffset:i[s].xOffset*e/1e3,yOffset:i[s].yOffset*e/1e3,xAdvance:i[s].xAdvance*e/1e3,yAdvance:i[s].yAdvance*e/1e3})}return o}function ut(n,e){switch(n.nodeName){case"use":return new Pt(n,e);case"symbol":return new Le(n,e);case"g":return new zt(n,e);case"a":return new Pe(n,e);case"svg":return new xe(n,e);case"image":return new Se(n,e);case"rect":return new Ce(n,e);case"circle":return new be(n,e);case"ellipse":return new Ve(n,e);case"line":return new _e(n,e);case"polyline":return new Ae(n,e);case"polygon":return new Ie(n,e);case"path":return new Xt(n,e);case"text":return new We(n,e);case"tspan":return new Bt(n,e);case"textPath":return new He(n,e);case"#text":case"#cdata-section":return new Ne(n,e);default:return new Lt(n,e)}}var z=function(n){this.match=function(e,t){let r=n.match(e);if(!(!r||r.index!==0))return n=n.substring(r[0].length),t?r:r[0]},this.matchSeparator=function(){return this.match(/^(?:\s*,\s*|\s*|)/)},this.matchSpace=function(){return this.match(/^(?:\s*)/)},this.matchLengthUnit=function(){return this.match(/^(?:px|pt|cm|mm|in|pc|em|ex|%|)/)},this.matchNumber=function(){return this.match(/^(?:[-+]?(?:[0-9]+[.][0-9]+|[0-9]+[.]|[.][0-9]+|[0-9]+)(?:[eE][-+]?[0-9]+)?)/)},this.matchAll=function(){return this.match(/^[\s\S]+/)}},ye=function(n,e,t,r,a,i,o,s){let l=6*Zt,h=[n,-3*n+3*t,3*n-6*t+3*a,-n+3*t-3*a+o],u=[e,-3*e+3*r,3*e-6*r+3*i,-e+3*r-3*i+s],c=[-3*n+3*t,6*n-12*t+6*a,-3*n+9*t-9*a+3*o],m=[-3*e+3*r,6*e-12*r+6*i,-3*e+9*r-9*i+3*s],w=[0];for(let d=1;d<=l;d++){let g=(d-.5)/l,p=W(g,c)/l,v=W(g,m)/l,M=Math.sqrt(p*p+v*v);w[d]=w[d-1]+M}this.totalLength=w[l],this.startPoint=[n,e,N(n,t)&&N(e,r)?Math.atan2(i-r,a-t):Math.atan2(r-e,t-n)],this.endPoint=[o,s,N(a,o)&&N(i,s)?Math.atan2(i-r,a-t):Math.atan2(s-i,o-a)],this.getBoundingBox=function(){let d,g=W(0,h),p=W(0,u),v=W(1,h),M=W(1,u);g>v&&(d=v,v=g,g=d),p>M&&(d=M,M=p,p=d);let P=Dt(c);for(let S=0;S<P.length;S++)if(P[S]>=0&&P[S]<=1){let k=W(P[S],h);k<g&&(g=k),k>v&&(v=k)}let y=Dt(m);for(let S=0;S<y.length;S++)if(y[S]>=0&&y[S]<=1){let k=W(y[S],u);k<p&&(p=k),k>M&&(M=k)}return[g,p,v,M]},this.getPointAtLength=function(d){if(N(d,0))return this.startPoint;if(N(d,this.totalLength))return this.endPoint;if(!(d<0||d>this.totalLength))for(let g=1;g<=l;g++){let p=w[g-1],v=w[g];if(p<=d&&d<=v){let M=(g-(v-d)/(v-p))/l,P=W(M,h),y=W(M,u),S=W(M,c),k=W(M,m);return[P,y,Math.atan2(k,S)]}}}},Gt=function(n,e,t,r){this.totalLength=Math.sqrt((t-n)*(t-n)+(r-e)*(r-e)),this.startPoint=[n,e,Math.atan2(r-e,t-n)],this.endPoint=[t,r,Math.atan2(r-e,t-n)],this.getBoundingBox=function(){return[Math.min(this.startPoint[0],this.endPoint[0]),Math.min(this.startPoint[1],this.endPoint[1]),Math.max(this.startPoint[0],this.endPoint[0]),Math.max(this.startPoint[1],this.endPoint[1])]},this.getPointAtLength=function(a){if(a>=0&&a<=this.totalLength){let i=a/this.totalLength||0,o=this.startPoint[0]+i*(this.endPoint[0]-this.startPoint[0]),s=this.startPoint[1]+i*(this.endPoint[1]-this.startPoint[1]);return[o,s,this.startPoint[2]]}}},_=function(){this.pathCommands=[],this.pathSegments=[],this.startPoint=null,this.endPoint=null,this.totalLength=0;let n=0,e=0,t=0,r=0,a,i,o;this.move=function(s,l){return n=t=s,e=r=l,null},this.line=function(s,l){let h=new Gt(t,r,s,l);return t=s,r=l,h},this.curve=function(s,l,h,u,c,m){let w=new ye(t,r,s,l,h,u,c,m);return t=c,r=m,w},this.close=function(){let s=new Gt(t,r,n,e);return t=n,r=e,s},this.addCommand=function(s){this.pathCommands.push(s);let l=this[s[0]].apply(this,s.slice(3));l&&(l.hasStart=s[1],l.hasEnd=s[2],this.startPoint=this.startPoint||l.startPoint,this.endPoint=l.endPoint,this.pathSegments.push(l),this.totalLength+=l.totalLength)},this.M=function(s,l){return this.addCommand(["move",!0,!0,s,l]),a="M",this},this.m=function(s,l){return this.M(t+s,r+l)},this.Z=this.z=function(){return this.addCommand(["close",!0,!0]),a="Z",this},this.L=function(s,l){return this.addCommand(["line",!0,!0,s,l]),a="L",this},this.l=function(s,l){return this.L(t+s,r+l)},this.H=function(s){return this.L(s,r)},this.h=function(s){return this.L(t+s,r)},this.V=function(s){return this.L(t,s)},this.v=function(s){return this.L(t,r+s)},this.C=function(s,l,h,u,c,m){return this.addCommand(["curve",!0,!0,s,l,h,u,c,m]),a="C",i=h,o=u,this},this.c=function(s,l,h,u,c,m){return this.C(t+s,r+l,t+h,r+u,t+c,r+m)},this.S=function(s,l,h,u){return this.C(t+(a==="C"?t-i:0),r+(a==="C"?r-o:0),s,l,h,u)},this.s=function(s,l,h,u){return this.C(t+(a==="C"?t-i:0),r+(a==="C"?r-o:0),t+s,r+l,t+h,r+u)},this.Q=function(s,l,h,u){let c=t+.6666666666666666*(s-t),m=r+2/3*(l-r),w=h+2/3*(s-h),d=u+2/3*(l-u);return this.addCommand(["curve",!0,!0,c,m,w,d,h,u]),a="Q",i=s,o=l,this},this.q=function(s,l,h,u){return this.Q(t+s,r+l,t+h,r+u)},this.T=function(s,l){return this.Q(t+(a==="Q"?t-i:0),r+(a==="Q"?r-o:0),s,l)},this.t=function(s,l){return this.Q(t+(a==="Q"?t-i:0),r+(a==="Q"?r-o:0),t+s,r+l)},this.A=function(s,l,h,u,c,m,w){if(N(s,0)||N(l,0))this.addCommand(["line",!0,!0,m,w]);else{h=h*(Math.PI/180),s=Math.abs(s),l=Math.abs(l),u=1*!!u,c=1*!!c;let d=Math.cos(h)*(t-m)/2+Math.sin(h)*(r-w)/2,g=Math.cos(h)*(r-w)/2-Math.sin(h)*(t-m)/2,p=d*d/(s*s)+g*g/(l*l);p>1&&(s*=Math.sqrt(p),l*=Math.sqrt(p));let v=Math.sqrt(Math.max(0,s*s*l*l-s*s*g*g-l*l*d*d)/(s*s*g*g+l*l*d*d)),M=(u===c?-1:1)*v*s*g/l,P=(u===c?1:-1)*v*l*d/s,y=Math.cos(h)*M-Math.sin(h)*P+(t+m)/2,S=Math.sin(h)*M+Math.cos(h)*P+(r+w)/2,k=Math.atan2((g-P)/l,(d-M)/s),L=Math.atan2((-g-P)/l,(-d-M)/s);c===0&&L-k>0?L-=2*Math.PI:c===1&&L-k<0&&(L+=2*Math.PI);let I=Math.ceil(Math.abs(L-k)/(Math.PI/Zt));for(let b=0;b<I;b++){let C=k+b*(L-k)/I,x=k+(b+1)*(L-k)/I,T=4/3*Math.tan((x-C)/4),st=y+Math.cos(h)*s*(Math.cos(C)-T*Math.sin(C))-Math.sin(h)*l*(Math.sin(C)+T*Math.cos(C)),q=S+Math.sin(h)*s*(Math.cos(C)-T*Math.sin(C))+Math.cos(h)*l*(Math.sin(C)+T*Math.cos(C)),$=y+Math.cos(h)*s*(Math.cos(x)+T*Math.sin(x))-Math.sin(h)*l*(Math.sin(x)-T*Math.cos(x)),Z=S+Math.sin(h)*s*(Math.cos(x)+T*Math.sin(x))+Math.cos(h)*l*(Math.sin(x)-T*Math.cos(x)),G=y+Math.cos(h)*s*Math.cos(x)-Math.sin(h)*l*Math.sin(x),U=S+Math.sin(h)*s*Math.cos(x)+Math.cos(h)*l*Math.sin(x);this.addCommand(["curve",b===0,b===I-1,st,q,$,Z,G,U])}}return a="A",this},this.a=function(s,l,h,u,c,m,w){return this.A(s,l,h,u,c,t+m,r+w)},this.path=function(s){let l,h,u,c=new z((s||"").trim());for(;l=c.match(/^[astvzqmhlcASTVZQMHLC]/);){c.matchSeparator();let m=[];for(;h=se[l+m.length]?c.match(/^[01]/):c.matchNumber();)c.matchSeparator(),m.length===Tt[l]&&(this[l].apply(this,m),m=[],l==="M"?l="L":l==="m"&&(l="l")),m.push(Number(h));if(m.length===Tt[l])this[l].apply(this,m);else{V("SvgPath: command "+l+" with "+m.length+" numbers");return}}return(u=c.matchAll())&&V("SvgPath: unexpected string "+u),this},this.getBoundingBox=function(){let s=[1/0,1/0,-1/0,-1/0];function l(h){h[0]<s[0]&&(s[0]=h[0]),h[2]>s[2]&&(s[2]=h[2]),h[1]<s[1]&&(s[1]=h[1]),h[3]>s[3]&&(s[3]=h[3])}for(let h=0;h<this.pathSegments.length;h++)l(this.pathSegments[h].getBoundingBox());return s[0]===1/0&&(s[0]=0),s[1]===1/0&&(s[1]=0),s[2]===-1/0&&(s[2]=0),s[3]===-1/0&&(s[3]=0),s},this.getPointAtLength=function(s){if(s>=0&&s<=this.totalLength){let l;for(let h=0;h<this.pathSegments.length;h++){if(l=this.pathSegments[h].getPointAtLength(s))return l;s-=this.pathSegments[h].totalLength}return this.endPoint}},this.transform=function(s){this.pathSegments=[],this.startPoint=null,this.endPoint=null,this.totalLength=0;for(let l=0;l<this.pathCommands.length;l++){let h=this.pathCommands.shift();for(let u=3;u<h.length;u+=2){let c=E([h[u],h[u+1]],s);h[u]=c[0],h[u+1]=c[1]}this.addCommand(h)}return this},this.mergeShape=function(s){for(let l=0;l<s.pathCommands.length;l++)this.addCommand(s.pathCommands[l].slice());return this},this.clone=function(){return new _().mergeShape(this)},this.insertInDocument=function(){for(let s=0;s<this.pathCommands.length;s++){let l=this.pathCommands[s][0],h=this.pathCommands[s].slice(3);switch(l){case"move":f.moveTo(h[0],h[1]);break;case"line":f.lineTo(h[0],h[1]);break;case"curve":f.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]);break;case"close":f.closePath();break}}},this.getSubPaths=function(){let s=[],l=new _;for(let h=0;h<this.pathCommands.length;h++){let u=this.pathCommands[h];this.pathCommands[h][0]==="move"&&h!==0&&(s.push(l),l=new _),l.addCommand(u)}return s.push(l),s},this.getMarkers=function(){let s=[],l=this.getSubPaths();for(let h=0;h<l.length;h++){let u=l[h],c=[];for(let m=0;m<u.pathSegments.length;m++){let w=u.pathSegments[m];if(j(w.totalLength,0)||m===0||m===u.pathSegments.length-1){if(w.hasStart){let d=w.getPointAtLength(0),g=c.pop();g&&(d[2]=.5*(g[2]+d[2])),c.push(d)}if(w.hasEnd){let d=w.getPointAtLength(w.totalLength);c.push(d)}}}s=s.concat(c)}return s}},Lt=function(n,e){let t=Object.create(null),r=null;this.name=n.nodeName,this.isOuterElement=n===D||!n.parentNode,this.inherits=e||(this.isOuterElement?null:ut(n.parentNode,null)),this.stack=this.inherits?this.inherits.stack.concat(n):[n],this.style=Ft(typeof n.getAttribute=="function"&&n.getAttribute("style")),this.css=$t?getComputedStyle(n):we(n),this.allowedChildren=[],this.attr=function(a){if(typeof n.getAttribute=="function")return n.getAttribute(a)},this.resolveUrl=function(a){let i=(a||"").match(/^\s*(?:url\("(.*)#(.*)"\)|url\('(.*)#(.*)'\)|url\((.*)#(.*)\)|(.*)#(.*))\s*$/)||[],o=i[1]||i[3]||i[5]||i[7],s=i[2]||i[4]||i[6]||i[8];if(s){if(!o){let l=D.getElementById(s);if(l){if(this.stack.indexOf(l)===-1)return l;V('SVGtoPDF: loop of circular references for id "'+s+'"');return}}if(mt){let l=Qt[o];if(!l){l=mt(o),ce(l)||(l=[l]);for(let h=0;h<l.length;h++)typeof l[h]=="string"&&(l[h]=Ht(l[h]));Qt[o]=l}for(let h=0;h<l.length;h++){let u=l[h].getElementById(s);if(u){if(this.stack.indexOf(u)===-1)return u;V('SVGtoPDF: loop of circular references for id "'+o+"#"+s+'"');return}}}}},this.computeUnits=function(a,i,o,s){return i==="%"?parseFloat(a)/100*(s||o!=null?o:this.getViewport()):i==="ex"||i==="em"?a*{em:1,ex:.5}[i]*(s?o:this.get("font-size")):a*{"":1,px:1,pt:96/72,cm:96/2.54,mm:96/25.4,in:96,pc:96/6}[i]},this.computeLength=function(a,i,o,s){let l=new z((a||"").trim()),h,u;return typeof(h=l.matchNumber())=="string"&&typeof(u=l.matchLengthUnit())=="string"&&!l.matchAll()?this.computeUnits(h,u,i,s):o},this.computeLengthList=function(a,i,o){let s=new z((a||"").trim()),l=[],h,u;for(;typeof(h=s.matchNumber())=="string"&&typeof(u=s.matchLengthUnit())=="string";)l.push(this.computeUnits(h,u,i)),s.matchSeparator();if(!(o&&s.matchAll()))return l},this.getLength=function(a,i,o){return this.computeLength(this.attr(a),i,o)},this.getLengthList=function(a,i){return this.computeLengthList(this.attr(a),i)},this.getUrl=function(a){return this.resolveUrl(this.attr(a))},this.getNumberList=function(a){let i=new z((this.attr(a)||"").trim()),o=[],s;for(;s=i.matchNumber();)o.push(Number(s)),i.matchSeparator();return o.error=i.matchAll(),o},this.getViewbox=function(a,i){let o=this.getNumberList(a);return o.length===4&&o[2]>=0&&o[3]>=0?o:i},this.getPercent=function(a,i){let o=this.attr(a),s=new z((o||"").trim()),l,h,u=s.matchNumber();return!u||(s.match("%")&&(u*=.01),s.matchAll())?i:Math.max(0,Math.min(1,u))},this.chooseValue=function(a){for(let i=0;i<arguments.length;i++)if(arguments[i]!=null&&arguments[i]===arguments[i])return arguments[i];return arguments[arguments.length-1]},this.get=function(a){if(t[a]!==void 0)return t[a];let i=ae[a]||{},o,s;for(let l=0;l<3;l++){switch(l){case 0:a!=="transform"&&(o=this.css[i.css||a]);break;case 1:o=this.style[a];break;case 2:o=this.attr(a);break}if(o==="inherit"&&(s=this.inherits?this.inherits.get(a):i.initial,s!=null)||i.values!=null&&(s=i.values[o],s!=null))return t[a]=s;if(o!=null){let h;switch(a){case"font-size":s=this.computeLength(o,this.inherits?this.inherits.get(a):i.initial,void 0,!0);break;case"baseline-shift":s=this.computeLength(o,this.get("font-size"));break;case"font-family":s=o||void 0;break;case"opacity":case"stroke-opacity":case"fill-opacity":case"stop-opacity":h=parseFloat(o),isNaN(h)||(s=Math.max(0,Math.min(1,h)));break;case"transform":s=yt(o);break;case"stroke-dasharray":if(o==="none")s=[];else if(h=this.computeLengthList(o,this.getViewport(),!0)){let u=0,c=!1;for(let m=0;m<h.length;m++)h[m]<0&&(c=!0),u+=h[m];c||(h.length%2===1&&(h=h.concat(h)),s=u===0?[]:h)}break;case"color":o==="none"||o==="transparent"?s="none":s=lt(o);break;case"fill":case"stroke":if(o==="none"||o==="transparent")s="none";else if(o==="currentColor")s=this.get("color");else{if(h=lt(o))return h;if(h=(o||"").split(" ")){let u=this.resolveUrl(h[0]),c=lt(h[1]);u==null?s=c:u.nodeName==="linearGradient"||u.nodeName==="radialGradient"?s=new pt(u,null,c):u.nodeName==="pattern"?s=new dt(u,null,c):s=c}}break;case"stop-color":o==="none"||o==="transparent"?s="none":o==="currentColor"?s=this.get("color"):s=lt(o);break;case"marker-start":case"marker-mid":case"marker-end":case"clip-path":case"mask":o==="none"?s="none":s=this.resolveUrl(o);break;case"stroke-width":h=this.computeLength(o,this.getViewport()),h!=null&&h>=0&&(s=h);break;case"stroke-miterlimit":h=parseFloat(o),h!=null&&h>=1&&(s=h);break;case"word-spacing":case"letter-spacing":s=this.computeLength(o,this.getViewport());break;case"stroke-dashoffset":if(s=this.computeLength(o,this.getViewport()),s!=null&&s<0){let u=this.get("stroke-dasharray");for(let c=0;c<u.length;c++)s+=u[c]}break}if(s!=null)return t[a]=s}}return t[a]=i.inherit&&this.inherits?this.inherits.get(a):i.initial},this.getChildren=function(){if(r!=null)return r;let a=[];for(let i=0;i<n.childNodes.length;i++){let o=n.childNodes[i];!o.error&&this.allowedChildren.indexOf(o.nodeName)!==-1&&a.push(ut(o,this))}return r=a},this.getParentVWidth=function(){return this.inherits?this.inherits.getVWidth():jt},this.getParentVHeight=function(){return this.inherits?this.inherits.getVHeight():Rt},this.getParentViewport=function(){return Math.sqrt(.5*this.getParentVWidth()*this.getParentVWidth()+.5*this.getParentVHeight()*this.getParentVHeight())},this.getVWidth=function(){return this.getParentVWidth()},this.getVHeight=function(){return this.getParentVHeight()},this.getViewport=function(){return Math.sqrt(.5*this.getVWidth()*this.getVWidth()+.5*this.getVHeight()*this.getVHeight())},this.getBoundingBox=function(){return this.getBoundingShape().getBoundingBox()}},ft=function(n,e){Lt.call(this,n,e),this.transform=function(){f.transform.apply(f,this.getTransformation())},this.clip=function(){if(this.get("clip-path")!=="none")return new Te(this.get("clip-path"),null).useMask(this.getBoundingBox()),!0},this.mask=function(){if(this.get("mask")!=="none")return new Oe(this.get("mask"),null).useMask(this.getBoundingBox()),!0},this.getFill=function(t,r){let a=this.get("opacity"),i=this.get("fill"),o=this.get("fill-opacity");if(t)return F.white;if(i!=="none"&&a&&o)return i instanceof pt||i instanceof dt?i.getPaint(this.getBoundingBox(),o*a,t,r):ot(i,o*a,r)},this.getStroke=function(t,r){let a=this.get("opacity"),i=this.get("stroke"),o=this.get("stroke-opacity");if(!(t||N(this.get("stroke-width"),0))&&i!=="none"&&a&&o)return i instanceof pt||i instanceof dt?i.getPaint(this.getBoundingBox(),o*a,t,r):ot(i,o*a,r)}},it=function(n,e){ft.call(this,n,e),this.allowedChildren=["use","g","a","svg","image","rect","circle","ellipse","line","polyline","polygon","path","text"],this.getBoundingShape=function(){let t=new _,r=this.getChildren();for(let a=0;a<r.length;a++)if(r[a].get("display")!=="none"&&typeof r[a].getBoundingShape=="function"){let i=r[a].getBoundingShape().clone();typeof r[a].getTransformation=="function"&&i.transform(r[a].getTransformation()),t.mergeShape(i)}return t},this.drawChildren=function(t,r){let a=this.getChildren();for(let i=0;i<a.length;i++)a[i].get("display")!=="none"&&typeof a[i].drawInDocument=="function"&&a[i].drawInDocument(t,r)}},ct=function(n,e){it.call(this,n,e),this.drawContent=function(t,r){this.transform();let a=this.clip(),i=this.mask(),o;(this.get("opacity")<1||a||i)&&!t&&(o=X(K())),this.drawChildren(t,r),o&&(B(o),f.fillOpacity(this.get("opacity")),ht(o))}},Pt=function(n,e){ct.call(this,n,e);let t=this.getLength("x",this.getVWidth(),0),r=this.getLength("y",this.getVHeight(),0),a=this.getUrl("href")||this.getUrl("xlink:href");a&&(a=ut(a,this)),this.getChildren=function(){return a?[a]:[]},this.drawInDocument=function(i,o){f.save(),this.drawContent(i,o),f.restore()},this.getTransformation=function(){return A(this.get("transform"),[1,0,0,1,t,r])}},Le=function(n,e){ct.call(this,n,e);let t=this.getLength("width",this.getParentVWidth(),this.getParentVWidth()),r=this.getLength("height",this.getParentVHeight(),this.getParentVHeight());e instanceof Pt&&(t=e.getLength("width",e.getParentVWidth(),t),r=e.getLength("height",e.getParentVHeight(),r));let a=(this.attr("preserveAspectRatio")||"").trim(),i=this.getViewbox("viewBox",[0,0,t,r]);this.getVWidth=function(){return i[2]},this.getVHeight=function(){return i[3]},this.drawInDocument=function(o,s){f.save(),this.drawContent(o,s),f.restore()},this.getTransformation=function(){return A(tt(a,t,r,i[2],i[3]),[1,0,0,1,-i[0],-i[1]])}},zt=function(n,e){ct.call(this,n,e),this.drawInDocument=function(t,r){f.save(),this.link&&!t&&!r&&this.addLink(),this.drawContent(t,r),f.restore()},this.getTransformation=function(){return this.get("transform")}},Pe=function(n,e){e&&e.isText?(Bt.call(this,n,e),this.allowedChildren=["textPath","tspan","#text","#cdata-section","a"]):zt.call(this,n,e),this.link=this.attr("href")||this.attr("xlink:href"),this.addLink=function(){if(this.link.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)?/i)&&this.getChildren().length){let t=this.getBoundingShape().transform(qt()).getBoundingBox();fe(t[0],t[1],t[2],t[3],this.link)}}},xe=function(n,e){ct.call(this,n,e);let t=this.getLength("width",this.getParentVWidth(),this.getParentVWidth()),r=this.getLength("height",this.getParentVHeight(),this.getParentVHeight()),a=this.getLength("x",this.getParentVWidth(),0),i=this.getLength("y",this.getParentVHeight(),0);e instanceof Pt&&(t=e.getLength("width",e.getParentVWidth(),t),r=e.getLength("height",e.getParentVHeight(),r));let o=this.attr("preserveAspectRatio"),s=this.getViewbox("viewBox",[0,0,t,r]);this.isOuterElement&&Yt&&(a=i=0,t=jt,r=Rt,o=Yt),this.getVWidth=function(){return s[2]},this.getVHeight=function(){return s[3]},this.drawInDocument=function(l,h){f.save(),this.get("overflow")==="hidden"&&(new _().M(a,i).L(a+t,i).L(a+t,i+r).L(a,i+r).Z().transform(this.get("transform")).insertInDocument(),f.clip()),this.drawContent(l,h),f.restore()},this.getTransformation=function(){return A(this.get("transform"),[1,0,0,1,a,i],tt(o,t,r,s[2],s[3]),[1,0,0,1,-s[0],-s[1]])}},Se=function(n,e){ft.call(this,n,e);let t=Vt(this.attr("href")||this.attr("xlink:href")||""),r=this.getLength("x",this.getVWidth(),0),a=this.getLength("y",this.getVHeight(),0),i=this.getLength("width",this.getVWidth(),"auto"),o=this.getLength("height",this.getVHeight(),"auto"),s;try{s=f.openImage(t)}catch{V('SVGElemImage: failed to open image "'+t+'" in PDFKit')}s&&(i==="auto"&&o!=="auto"?i=o*s.width/s.height:o==="auto"&&i!=="auto"?o=i*s.height/s.width:i==="auto"&&o==="auto"&&(i=s.width,o=s.height)),(i==="auto"||i<0)&&(i=0),(o==="auto"||o<0)&&(o=0),this.getTransformation=function(){return this.get("transform")},this.getBoundingShape=function(){return new _().M(r,a).L(r+i,a).M(r+i,a+o).L(r,a+o)},this.drawInDocument=function(l,h){this.get("visibility")==="hidden"||!s||(f.save(),this.transform(),this.get("overflow")==="hidden"&&f.rect(r,a,i,o).clip(),this.clip(),this.mask(),f.translate(r,a),f.transform.apply(f,tt(this.attr("preserveAspectRatio"),i,o,s?s.width:i,s?s.height:o)),l?(f.rect(0,0,s.width,s.height),Q(F.white).fill()):(f.fillOpacity(this.get("opacity")),f.image(s,0,0)),f.restore())}},dt=function(n,e,t){it.call(this,n,e),this.ref=function(){let i=this.getUrl("href")||this.getUrl("xlink:href");if(i&&i.nodeName===n.nodeName)return new dt(i,e,t)}.call(this);let r=this.attr;this.attr=function(i){let o=r.call(this,i);return o!=null||i==="href"||i==="xlink:href"?o:this.ref?this.ref.attr(i):null};let a=this.getChildren;this.getChildren=function(){let i=a.call(this);return i.length>0?i:this.ref?this.ref.getChildren():[]},this.getPaint=function(i,o,s,l){let h=this.attr("patternUnits")!=="userSpaceOnUse",u=this.attr("patternContentUnits")==="objectBoundingBox",c=this.getLength("x",h?1:this.getParentVWidth(),0),m=this.getLength("y",h?1:this.getParentVHeight(),0),w=this.getLength("width",h?1:this.getParentVWidth(),0),d=this.getLength("height",h?1:this.getParentVHeight(),0);u&&!h?(c=(c-i[0])/(i[2]-i[0])||0,m=(m-i[1])/(i[3]-i[1])||0,w=w/(i[2]-i[0])||0,d=d/(i[3]-i[1])||0):!u&&h&&(c=i[0]+c*(i[2]-i[0]),m=i[1]+m*(i[3]-i[1]),w=w*(i[2]-i[0]),d=d*(i[3]-i[1]));let g=this.getViewbox("viewBox",[0,0,w,d]),p=(this.attr("preserveAspectRatio")||"").trim(),v=A(tt(p,w,d,g[2],g[3],0),[1,0,0,1,-g[0],-g[1]]),M=yt(this.attr("patternTransform"));if(u&&(M=A([i[2]-i[0],0,0,i[3]-i[1],i[0],i[1]],M)),M=A(M,[1,0,0,1,c,m]),(M=Mt(M))&&(v=Mt(v))&&(w=H(w))&&(d=H(d))){let P=X([0,0,w,d]);return f.transform.apply(f,v),this.drawChildren(s,l),B(P),[re(P,w,d,M),o]}else return t?[t[0],t[1]*o]:void 0},this.getVWidth=function(){let i=this.attr("patternUnits")!=="userSpaceOnUse",o=this.getLength("width",i?1:this.getParentVWidth(),0);return this.getViewbox("viewBox",[0,0,o,0])[2]},this.getVHeight=function(){let i=this.attr("patternUnits")!=="userSpaceOnUse",o=this.getLength("height",i?1:this.getParentVHeight(),0);return this.getViewbox("viewBox",[0,0,0,o])[3]}},pt=function(n,e,t){Lt.call(this,n,e),this.allowedChildren=["stop"],this.ref=function(){let i=this.getUrl("href")||this.getUrl("xlink:href");if(i&&i.nodeName===n.nodeName)return new pt(i,e,t)}.call(this);let r=this.attr;this.attr=function(i){let o=r.call(this,i);return o!=null||i==="href"||i==="xlink:href"?o:this.ref?this.ref.attr(i):null};let a=this.getChildren;this.getChildren=function(){let i=a.call(this);return i.length>0?i:this.ref?this.ref.getChildren():[]},this.getPaint=function(i,o,s,l){let h=this.getChildren();if(h.length===0)return;if(h.length===1){let k=h[0],L=k.get("stop-color");return L==="none"?void 0:ot(L,k.get("stop-opacity")*o,l)}let u=this.attr("gradientUnits")!=="userSpaceOnUse",c=yt(this.attr("gradientTransform")),m=this.attr("spreadMethod"),w,d,g,p,v,M,P=0,y=0,S=1;if(u&&(c=A([i[2]-i[0],0,0,i[3]-i[1],i[0],i[1]],c)),c=Mt(c)){if(this.name==="linearGradient")d=this.getLength("x1",u?1:this.getVWidth(),0),g=this.getLength("x2",u?1:this.getVWidth(),u?1:this.getVWidth()),p=this.getLength("y1",u?1:this.getVHeight(),0),v=this.getLength("y2",u?1:this.getVHeight(),0);else{g=this.getLength("cx",u?1:this.getVWidth(),u?.5:.5*this.getVWidth()),v=this.getLength("cy",u?1:this.getVHeight(),u?.5:.5*this.getVHeight()),M=this.getLength("r",u?1:this.getViewport(),u?.5:.5*this.getViewport()),d=this.getLength("fx",u?1:this.getVWidth(),g),p=this.getLength("fy",u?1:this.getVHeight(),v),M<0&&V("SvgElemGradient: negative r value");let k=Math.sqrt(Math.pow(g-d,2)+Math.pow(v-p,2)),L=1;k>M&&(L=M/k,d=g+(d-g)*L,p=v+(p-v)*L),M=Math.max(M,k*L*(1+1e-6))}if(m==="reflect"||m==="repeat"){let k=Ut(c),L=E([i[0],i[1]],k),I=E([i[2],i[1]],k),b=E([i[2],i[3]],k),C=E([i[0],i[3]],k);this.name==="linearGradient"?(P=Math.max((L[0]-g)*(g-d)+(L[1]-v)*(v-p),(I[0]-g)*(g-d)+(I[1]-v)*(v-p),(b[0]-g)*(g-d)+(b[1]-v)*(v-p),(C[0]-g)*(g-d)+(C[1]-v)*(v-p))/(Math.pow(g-d,2)+Math.pow(v-p,2)),y=Math.max((L[0]-d)*(d-g)+(L[1]-p)*(p-v),(I[0]-d)*(d-g)+(I[1]-p)*(p-v),(b[0]-d)*(d-g)+(b[1]-p)*(p-v),(C[0]-d)*(d-g)+(C[1]-p)*(p-v))/(Math.pow(g-d,2)+Math.pow(v-p,2))):P=Math.sqrt(Math.max(Math.pow(L[0]-g,2)+Math.pow(L[1]-v,2),Math.pow(I[0]-g,2)+Math.pow(I[1]-v,2),Math.pow(b[0]-g,2)+Math.pow(b[1]-v,2),Math.pow(C[0]-g,2)+Math.pow(C[1]-v,2)))/M-1,P=Math.ceil(P+.5),y=Math.ceil(y+.5),S=y+1+P}this.name==="linearGradient"?w=f.linearGradient(d-y*(g-d),p-y*(v-p),g+P*(g-d),v+P*(v-p)):w=f.radialGradient(d,p,0,g,v,M+P*M);for(let k=0;k<S;k++){let L=0,I=m!=="reflect"||(k-y)%2===0;for(let b=0;b<h.length;b++){let C=h[I?b:h.length-1-b],x=C.get("stop-color");x==="none"&&(x=F.transparent),x=ot(x,C.get("stop-opacity")*o,l),L=Math.max(L,I?C.getPercent("offset",0):1-C.getPercent("offset",0)),b===0&&x[0].length===4&&(w._colorSpace="DeviceCMYK"),b===0&&L>0&&w.stop((k+0)/S,x[0],x[1]),w.stop((k+L)/(P+y+1),x[0],x[1]),b===h.length-1&&L<1&&w.stop((k+1)/S,x[0],x[1])}}return w.setTransform.apply(w,c),[w,1]}else return t?[t[0],t[1]*o]:void 0}},Y=function(n,e){ft.call(this,n,e),this.dashScale=1,this.getBoundingShape=function(){return this.shape},this.getTransformation=function(){return this.get("transform")},this.drawInDocument=function(t,r){if(!(this.get("visibility")==="hidden"||!this.shape)){if(f.save(),this.transform(),this.clip(),t)this.shape.insertInDocument(),Q(F.white),f.fill(this.get("clip-rule"));else{let a=this.mask(),i;a&&(i=X(K()));let o=this.shape.getSubPaths(),s=this.getFill(t,r),l=this.getStroke(t,r),h=this.get("stroke-width"),u=this.get("stroke-linecap");if(s||l){if(s&&Q(s),l){for(let p=0;p<o.length;p++)if(N(o[p].totalLength,0)&&(u==="square"||u==="round")&&h>0&&o[p].startPoint&&o[p].startPoint.length>1){let v=o[p].startPoint[0],M=o[p].startPoint[1];Q(l),u==="square"?f.rect(v-.5*h,M-.5*h,h,h):u==="round"&&f.circle(v,M,.5*h),f.fill()}let d=this.get("stroke-dasharray"),g=this.get("stroke-dashoffset");if(j(this.dashScale,1)){for(let p=0;p<d.length;p++)d[p]*=this.dashScale;g*=this.dashScale}kt(l),f.lineWidth(h).miterLimit(this.get("stroke-miterlimit")).lineJoin(this.get("stroke-linejoin")).lineCap(u).dash(d,{phase:g})}for(let d=0;d<o.length;d++)o[d].totalLength>0&&o[d].insertInDocument();s&&l?f.fillAndStroke(this.get("fill-rule")):s?f.fill(this.get("fill-rule")):l&&f.stroke()}let c=this.get("marker-start"),m=this.get("marker-mid"),w=this.get("marker-end");if(c!=="none"||m!=="none"||w!=="none"){let d=this.shape.getMarkers();if(c!=="none"&&new xt(c,null).drawMarker(!1,r,d[0],h),m!=="none")for(let g=1;g<d.length-1;g++)new xt(m,null).drawMarker(!1,r,d[g],h);w!=="none"&&new xt(w,null).drawMarker(!1,r,d[d.length-1],h)}i&&(B(i),ht(i))}f.restore()}}},Ce=function(n,e){Y.call(this,n,e);let t=this.getLength("x",this.getVWidth(),0),r=this.getLength("y",this.getVHeight(),0),a=this.getLength("width",this.getVWidth(),0),i=this.getLength("height",this.getVHeight(),0),o=this.getLength("rx",this.getVWidth()),s=this.getLength("ry",this.getVHeight());o===void 0&&s===void 0?o=s=0:o===void 0&&s!==void 0?o=s:o!==void 0&&s===void 0&&(s=o),a>0&&i>0?o&&s?(o=Math.min(o,.5*a),s=Math.min(s,.5*i),this.shape=new _().M(t+o,r).L(t+a-o,r).A(o,s,0,0,1,t+a,r+s).L(t+a,r+i-s).A(o,s,0,0,1,t+a-o,r+i).L(t+o,r+i).A(o,s,0,0,1,t,r+i-s).L(t,r+s).A(o,s,0,0,1,t+o,r).Z()):this.shape=new _().M(t,r).L(t+a,r).L(t+a,r+i).L(t,r+i).Z():this.shape=new _},be=function(n,e){Y.call(this,n,e);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("r",this.getViewport(),0);a>0?this.shape=new _().M(t+a,r).A(a,a,0,0,1,t-a,r).A(a,a,0,0,1,t+a,r).Z():this.shape=new _},Ve=function(n,e){Y.call(this,n,e);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("rx",this.getVWidth(),0),i=this.getLength("ry",this.getVHeight(),0);a>0&&i>0?this.shape=new _().M(t+a,r).A(a,i,0,0,1,t-a,r).A(a,i,0,0,1,t+a,r).Z():this.shape=new _},_e=function(n,e){Y.call(this,n,e);let t=this.getLength("x1",this.getVWidth(),0),r=this.getLength("y1",this.getVHeight(),0),a=this.getLength("x2",this.getVWidth(),0),i=this.getLength("y2",this.getVHeight(),0);this.shape=new _().M(t,r).L(a,i)},Ae=function(n,e){Y.call(this,n,e);let t=this.getNumberList("points");this.shape=new _;for(let r=0;r<t.length-1;r+=2)r===0?this.shape.M(t[r],t[r+1]):this.shape.L(t[r],t[r+1]);t.error&&V("SvgElemPolygon: unexpected string "+t.error),t.length%2===1&&V("SvgElemPolyline: uneven number of coordinates")},Ie=function(n,e){Y.call(this,n,e);let t=this.getNumberList("points");this.shape=new _;for(let r=0;r<t.length-1;r+=2)r===0?this.shape.M(t[r],t[r+1]):this.shape.L(t[r],t[r+1]);this.shape.Z(),t.error&&V("SvgElemPolygon: unexpected string "+t.error),t.length%2===1&&V("SvgElemPolygon: uneven number of coordinates")},Xt=function(n,e){Y.call(this,n,e),this.shape=new _().path(this.attr("d"));let t=this.getLength("pathLength",this.getViewport());this.pathLength=t>0?t:void 0,this.dashScale=this.pathLength!==void 0?this.shape.totalLength/this.pathLength:1},xt=function(n,e){it.call(this,n,e);let t=this.getLength("markerWidth",this.getParentVWidth(),3),r=this.getLength("markerHeight",this.getParentVHeight(),3),a=this.getViewbox("viewBox",[0,0,t,r]);this.getVWidth=function(){return a[2]},this.getVHeight=function(){return a[3]},this.drawMarker=function(i,o,s,l){f.save();let h=this.attr("orient"),u=this.attr("markerUnits"),c=h==="auto"?s[2]:(parseFloat(h)||0)*Math.PI/180,m=u==="userSpaceOnUse"?1:l;f.transform(Math.cos(c)*m,Math.sin(c)*m,-Math.sin(c)*m,Math.cos(c)*m,s[0],s[1]);let w=this.getLength("refX",this.getVWidth(),0),d=this.getLength("refY",this.getVHeight(),0),g=tt(this.attr("preserveAspectRatio"),t,r,a[2],a[3],.5);this.get("overflow")==="hidden"&&f.rect(g[0]*(a[0]+a[2]/2-w)-t/2,g[3]*(a[1]+a[3]/2-d)-r/2,t,r).clip(),f.transform.apply(f,g),f.translate(-w,-d);let p;this.get("opacity")<1&&!i&&(p=X(K())),this.drawChildren(i,o),p&&(B(p),f.fillOpacity(this.get("opacity")),ht(p)),f.restore()}},Te=function(n,e){it.call(this,n,e),this.useMask=function(t){let r=X(K());f.save(),this.attr("clipPathUnits")==="objectBoundingBox"&&f.transform(t[2]-t[0],0,0,t[3]-t[1],t[0],t[1]),this.clip(),this.drawChildren(!0,!1),f.restore(),B(r),Ot(r,!0)}},Oe=function(n,e){it.call(this,n,e),this.useMask=function(t){let r=X(K());f.save();let a,i,o,s;this.attr("maskUnits")==="userSpaceOnUse"?(a=this.getLength("x",this.getVWidth(),-.1*(t[2]-t[0])+t[0]),i=this.getLength("y",this.getVHeight(),-.1*(t[3]-t[1])+t[1]),o=this.getLength("width",this.getVWidth(),1.2*(t[2]-t[0])),s=this.getLength("height",this.getVHeight(),1.2*(t[3]-t[1]))):(a=this.getLength("x",this.getVWidth(),-.1)*(t[2]-t[0])+t[0],i=this.getLength("y",this.getVHeight(),-.1)*(t[3]-t[1])+t[1],o=this.getLength("width",this.getVWidth(),1.2)*(t[2]-t[0]),s=this.getLength("height",this.getVHeight(),1.2)*(t[3]-t[1])),f.rect(a,i,o,s).clip(),this.attr("maskContentUnits")==="objectBoundingBox"&&f.transform(t[2]-t[0],0,0,t[3]-t[1],t[0],t[1]),this.clip(),this.drawChildren(!1,!0),f.restore(),B(r),Ot(r,!0)}},St=function(n,e){ft.call(this,n,e),this.allowedChildren=["tspan","#text","#cdata-section","a"],this.isText=!0,this.getBoundingShape=function(){let t=new _;for(let r=0;r<this._pos.length;r++){let a=this._pos[r];if(!a.hidden){let i=a.ascent*Math.sin(a.rotate),o=-a.ascent*Math.cos(a.rotate),s=a.descent*Math.sin(a.rotate),l=-a.descent*Math.cos(a.rotate),h=a.width*Math.cos(a.rotate),u=a.width*Math.sin(a.rotate);t.M(a.x+i,a.y+o).L(a.x+i+h,a.y+o+u).M(a.x+s+h,a.y+l+u).L(a.x+s,a.y+l)}}return t},this.drawTextInDocument=function(t,r){this.link&&!t&&!r&&this.addLink(),this.get("text-decoration")==="underline"&&this.decorate(.05*this._font.size,-.075*this._font.size,t,r),this.get("text-decoration")==="overline"&&this.decorate(.05*this._font.size,R(this._font.font,this._font.size)+.075*this._font.size,t,r);let a=this.getFill(t,r),i=this.getStroke(t,r),o=this.get("stroke-width");this._font.fauxBold&&(i?o+=this._font.size*.03:(i=a,o=this._font.size*.03));let s=this.getChildren();for(let l=0;l<s.length;l++){let h=s[l];switch(h.name){case"tspan":case"textPath":case"a":h.get("display")!=="none"&&h.drawTextInDocument(t,r);break;case"#text":case"#cdata-section":if(this.get("visibility")==="hidden")continue;if(a||i||t){a&&Q(a),i&&o&&(kt(i),f.lineWidth(o).miterLimit(this.get("stroke-miterlimit")).lineJoin(this.get("stroke-linejoin")).lineCap(this.get("stroke-linecap")).dash(this.get("stroke-dasharray"),{phase:this.get("stroke-dashoffset")})),he(this._font.font,this._font.size),oe(!!a,!!i);for(let u=0,c=h._pos;u<c.length;u++)if(!c[u].hidden&&j(c[u].width,0)){let m=Math.cos(c[u].rotate),w=Math.sin(c[u].rotate),d=this._font.fauxItalic?-.25:0;le(m*c[u].scale,w*c[u].scale,m*d-w,w*d+m,c[u].x,c[u].y),ge(c[u].glyph)}ue()}break}}this.get("text-decoration")==="line-through"&&this.decorate(.05*this._font.size,.5*(R(this._font.font,this._font.size)+gt(this._font.font,this._font.size)),t,r)},this.decorate=function(t,r,a,i){let o=this.getFill(a,i),s=this.getStroke(a,i);o&&Q(o),s&&(kt(s),f.lineWidth(this.get("stroke-width")).miterLimit(this.get("stroke-miterlimit")).lineJoin(this.get("stroke-linejoin")).lineCap(this.get("stroke-linecap")).dash(this.get("stroke-dasharray"),{phase:this.get("stroke-dashoffset")}));for(let l=0,h=this._pos;l<h.length;l++)if(!h[l].hidden&&j(h[l].width,0)){let u=(r+t/2)*Math.sin(h[l].rotate),c=-(r+t/2)*Math.cos(h[l].rotate),m=(r-t/2)*Math.sin(h[l].rotate),w=-(r-t/2)*Math.cos(h[l].rotate),d=h[l].width*Math.cos(h[l].rotate),g=h[l].width*Math.sin(h[l].rotate);new _().M(h[l].x+u,h[l].y+c).L(h[l].x+u+d,h[l].y+c+g).L(h[l].x+m+d,h[l].y+w+g).L(h[l].x+m,h[l].y+w).Z().insertInDocument(),o&&s?f.fillAndStroke():o?f.fill():s&&f.stroke()}}},Ne=function(n,e){this.name=n.nodeName,this.textContent=n.nodeValue},Bt=function(n,e){St.call(this,n,e)},He=function(n,e){St.call(this,n,e);let t,r,a;if((a=this.attr("path"))&&a.trim()!==""){let i=this.getLength("pathLength",this.getViewport());this.pathObject=new _().path(a),this.pathLength=i>0?i:this.pathObject.totalLength,this.pathScale=this.pathObject.totalLength/this.pathLength}else if((a=this.getUrl("href")||this.getUrl("xlink:href"))&&a.nodeName==="path"){let i=new Xt(a,this);this.pathObject=i.shape.clone().transform(i.get("transform")),this.pathLength=this.chooseValue(i.pathLength,this.pathObject.totalLength),this.pathScale=this.pathObject.totalLength/this.pathLength}},We=function(n,e){St.call(this,n,e),this.allowedChildren=["textPath","tspan","#text","#cdata-section","a"],function(t){let r="",a=n.textContent,i=[],o=[],s,l,h=0,u=0;function c(){if(o.length){let g=o[o.length-1],p=o[0],v=g.x+g.width-p.x,M={startltr:0,middleltr:.5,endltr:1,startrtl:1,middlertl:.5,endrtl:0}[s+l]*v||0;for(let P=0;P<o.length;P++)o[P].x-=M}o=[]}function m(g,p,v){let M=g[0],P=g[g.length-1],y=M.x,S=P.x+P.width;if(v){let k=p/(S-y);if(k>0&&k<1/0)for(let L=0;L<g.length;L++)g[L].x=y+k*(g[L].x-y),g[L].scale*=k,g[L].width*=k}else if(g.length>=2){let k=(p-(S-y))/(g.length-1);for(let L=0;L<g.length;L++)g[L].x+=L*k}h+=p-(S-y)}function w(g,p){g._x=et(g.getLengthList("x",g.getVWidth()),p?p._x.slice(p._pos.length):[]),g._y=et(g.getLengthList("y",g.getVHeight()),p?p._y.slice(p._pos.length):[]),g._dx=et(g.getLengthList("dx",g.getVWidth()),p?p._dx.slice(p._pos.length):[]),g._dy=et(g.getLengthList("dy",g.getVHeight()),p?p._dy.slice(p._pos.length):[]),g._rot=et(g.getNumberList("rotate"),p?p._rot.slice(p._pos.length):[]),g._defRot=g.chooseValue(g._rot[g._rot.length-1],p&&p._defRot,0),g.name==="textPath"&&(g._y=[]);let v={fauxItalic:!1,fauxBold:!1},M=bt(g.get("font-family"),g.get("font-weight")==="bold",g.get("font-style")==="italic",v);try{f.font(M)}catch{V('SVGElemText: failed to open font "'+M+'" in PDFKit')}g._pos=[],g._index=0,g._font={font:f._font,size:g.get("font-size"),fauxItalic:v.fauxItalic,fauxBold:v.fauxBold};let P=g.getLength("textLength",g.getVWidth(),void 0),y=g.attr("lengthAdjust")==="spacingAndGlyphs",S=g.get("word-spacing"),k=g.get("letter-spacing"),L=g.get("text-anchor"),I=g.get("direction"),b=ke(g._font.font,g._font.size,g.get("alignment-baseline")||g.get("dominant-baseline"),g.get("baseline-shift"));g.name==="textPath"&&(c(),h=u=0);let C=g.getChildren();for(let x=0;x<C.length;x++){let T=C[x];switch(T.name){case"tspan":case"textPath":case"a":w(T,g);break;case"#text":case"#cdata-section":let st=T.textContent,q=st,$;T._font=g._font,T._pos=[],a=a.substring(st.length),g.get("xml:space")==="preserve"?q=q.replace(/[\s]/g," "):(q=q.replace(/[\s]+/g," "),r.match(/[\s]$|^$/)&&(q=q.replace(/^[\s]/,"")),a.match(/^[\s]*$/)&&(q=q.replace(/[\s]$/,""))),r+=st,S===0?$=[q]:$=q.split(/(\s)/);for(let Z=0;Z<$.length;Z++){let G=Me(g._font.font,g._font.size,$[Z]);for(let U=0;U<G.length;U++){let at=g._index,Kt=g._x[at],Jt=g._y[at],Et=g._dx[at],te=g._dy[at],ee=g._rot[at],J=!(Z===0&&U===0);Kt!==void 0&&(J=!1,c(),h=Kt),Jt!==void 0&&(J=!1,c(),u=Jt),Et!==void 0&&(J=!1,h+=Et),te!==void 0&&(J=!1,u+=te),(ee!==void 0||g._defRot!==0)&&(J=!1);let At={glyph:G[U].glyph,rotate:Math.PI/180*g.chooseValue(ee,g._defRot),x:h+G[U].xOffset,y:u+b+G[U].yOffset,width:G[U].width,ascent:R(g._font.font,g._font.size),descent:gt(g._font.font,g._font.size),scale:1,hidden:!1,continuous:J};o.push(At),T._pos.push(At),g._pos.push(At),g._index+=G[U].unicode.length,o.length===1&&(s=L,l=I),h+=G[U].xAdvance+k,u+=G[U].yAdvance}$[Z]===" "&&(h+=S)}break;default:a=a.substring(T.textContent.length)}}if(P&&g._pos.length&&m(g._pos,P,y),(g.name==="textPath"||g.name==="text")&&c(),g.name==="textPath"){i.push(g);let x=g.pathObject;x&&(h=x.endPoint[0],u=x.endPoint[1])}p&&(p._pos=p._pos.concat(g._pos),p._index+=g._index)}function d(g){let p=g.pathObject,v=g.pathLength,M=g.pathScale;if(p){let P=g.getLength("startOffset",v,0);for(let y=0;y<g._pos.length;y++){let S=P+g._pos[y].x+.5*g._pos[y].width;if(S>v||S<0)g._pos[y].hidden=!0;else{let k=p.getPointAtLength(S*M);j(M,1)&&(g._pos[y].scale*=M,g._pos[y].width*=M),g._pos[y].x=k[0]-.5*g._pos[y].width*Math.cos(k[2])-g._pos[y].y*Math.sin(k[2]),g._pos[y].y=k[1]-.5*g._pos[y].width*Math.sin(k[2])+g._pos[y].y*Math.cos(k[2]),g._pos[y].rotate=k[2]+g._pos[y].rotate,g._pos[y].continuous=!1}}}else for(let P=0;P<g._pos.length;P++)g._pos[P].hidden=!0}w(t,null);for(let g=0;g<i.length;g++)d(i[g])}(this),this.getTransformation=function(){return this.get("transform")},this.drawInDocument=function(t,r){f.save(),this.transform(),this.clip();let a=this.mask(),i;a&&(i=X(K())),this.drawTextInDocument(t,r),i&&(B(i),ht(i)),f.restore()}};O=O||{};var Ct=O.assumePt?1:72/96,jt=(O.width||f.page.width)/Ct,Rt=(O.height||f.page.height)/Ct,Yt=O.preserveAspectRatio||null,$t=O.useCSS&&typeof SVGElement<"u"&&D instanceof SVGElement&&typeof getComputedStyle=="function",V=O.warningCallback,bt=O.fontCallback,Vt=O.imageCallback,nt=O.colorCallback,mt=O.documentCallback,Zt=Math.ceil(Math.max(1,O.precision))||3,wt=[],Qt={},_t=[],vt=[];if(typeof V!="function"&&(V=function(n){typeof console!==void 0&&typeof console.warn=="function"&&console.warn(n)}),typeof bt!="function"&&(bt=function(n,e,t,r){if(e&&t){if(f._registeredFonts.hasOwnProperty(n+"-BoldItalic"))return n+"-BoldItalic";if(f._registeredFonts.hasOwnProperty(n+"-Italic"))return r.fauxBold=!0,n+"-Italic";if(f._registeredFonts.hasOwnProperty(n+"-Bold"))return r.fauxItalic=!0,n+"-Bold";if(f._registeredFonts.hasOwnProperty(n))return r.fauxBold=!0,r.fauxItalic=!0,n}if(e&&!t){if(f._registeredFonts.hasOwnProperty(n+"-Bold"))return n+"-Bold";if(f._registeredFonts.hasOwnProperty(n))return r.fauxBold=!0,n}if(!e&&t){if(f._registeredFonts.hasOwnProperty(n+"-Italic"))return n+"-Italic";if(f._registeredFonts.hasOwnProperty(n))return r.fauxItalic=!0,n}if(!e&&!t&&f._registeredFonts.hasOwnProperty(n))return n;if(n.match(/(?:^|,)\s*serif\s*$/)){if(e&&t)return"Times-BoldItalic";if(e&&!t)return"Times-Bold";if(!e&&t)return"Times-Italic";if(!e&&!t)return"Times-Roman"}else if(n.match(/(?:^|,)\s*monospace\s*$/)){if(e&&t)return"Courier-BoldOblique";if(e&&!t)return"Courier-Bold";if(!e&&t)return"Courier-Oblique";if(!e&&!t)return"Courier"}else{if(n.match(/(?:^|,)\s*sans-serif\s*$/),e&&t)return"Helvetica-BoldOblique";if(e&&!t)return"Helvetica-Bold";if(!e&&t)return"Helvetica-Oblique";if(!e&&!t)return"Helvetica"}}),typeof Vt!="function"&&(Vt=function(n){return n.replace(/\s+/g,"")}),typeof nt!="function")nt=null;else for(let n in F){let e=nt(F[n]);F[n][0]=e[0],F[n][1]=e[1]}if(typeof mt!="function"&&(mt=null),typeof D=="string"&&(D=Ht(D)),D){let n=D.getElementsByTagName("style");for(let t=0;t<n.length;t++)vt=vt.concat(pe(n[t].textContent));let e=ut(D,null);if(typeof e.drawInDocument=="function"){O.useCSS&&!$t&&V("SVGtoPDF: useCSS option can only be used for SVG *elements* in compatible browsers");let t=f._fillColor;f.save().translate(ie||0,ne||0).scale(Ct),e.drawInDocument();for(let r=0;r<_t.length;r++)f.page.annotations.push(_t[r]);f.restore(),f._fillColor=t}else V("SVGtoPDF: this element can't be rendered directly: "+D.nodeName)}else V("SVGtoPDF: the input does not look like a valid SVG")};typeof module<"u"&&module&&typeof module.exports<"u"&&(module.exports=qe);
|