/** * Modules in this bundle * @license * * svg2pdf.js: * license: MIT (http://opensource.org/licenses/MIT) * author: yFiles for HTML Support Team * homepage: https://github.com/yWorks/svg2pdf.js#readme * version: 1.2.0 * * svgpath: * license: MIT (http://opensource.org/licenses/MIT) * homepage: https://github.com/fontello/svgpath#readme * version: 2.2.1 * * This header is generated by licensify (https://github.com/twada/licensify) */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.svg2pdf=t()}}(function(){var t;return function t(e,r,a){function i(s,o){if(!r[s]){if(!e[s]){var h="function"==typeof require&&require;if(!o&&h)return h(s,!0);if(n)return n(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return i(r||t)},u,u.exports,t,e,r,a)}return r[s].exports}for(var n="function"==typeof require&&require,s=0;s1&&(h=1),h<-1&&(h=-1),i*Math.acos(h)}function i(t,e,r,i,n,o,h,c,u,f){var l=f*(t-r)/2+u*(e-i)/2,d=-u*(t-r)/2+f*(e-i)/2,g=h*h,p=c*c,x=l*l,b=d*d,m=g*p-g*b-p*x;m<0&&(m=0),m/=g*b+p*x,m=Math.sqrt(m)*(n===o?-1:1);var v=m*h/c*d,y=m*-c/h*l,k=f*v-u*y+(t+r)/2,M=u*v+f*y+(e+i)/2,w=(l-v)/h,A=(d-y)/c,S=(-l-v)/h,F=(-d-y)/c,C=a(1,0,w,A),I=a(w,A,S,F);return 0===o&&I>0&&(I-=s),1===o&&I<0&&(I+=s),[k,M,C,I]}function n(t,e){var r=4/3*Math.tan(e/4),a=Math.cos(t),i=Math.sin(t),n=Math.cos(t+e),s=Math.sin(t+e);return[a,i,a-i*r,i+a*r,n+s*r,s-n*r,n,s]}var s=2*Math.PI;e.exports=function(t,e,r,a,o,h,c,u,f){var l=Math.sin(f*s/360),d=Math.cos(f*s/360),g=d*(t-r)/2+l*(e-a)/2,p=-l*(t-r)/2+d*(e-a)/2;if(0===g&&0===p)return[];if(0===c||0===u)return[];c=Math.abs(c),u=Math.abs(u);var x=g*g/(c*c)+p*p/(u*u);x>1&&(c*=Math.sqrt(x),u*=Math.sqrt(x));var b=i(t,e,r,a,o,h,c,u,l,d),m=[],v=b[2],y=b[3],k=Math.max(Math.ceil(Math.abs(y)/(s/4)),1);y/=k;for(var M=0;MMath.abs(u-s)?(u-n)/c:c/(u-s))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(u),this.ry=Math.sqrt(f)):(this.ax+=90,this.rx=Math.sqrt(f),this.ry=Math.sqrt(u)),this},a.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx},e.exports=a},{}],4:[function(t,e,r){"use strict";function a(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function i(){if(!(this instanceof i))return new i;this.queue=[],this.cache=null}i.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]?this:(this.cache=null,this.queue.push(t),this)},i.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},i.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},i.prototype.rotate=function(t,e,r){var a,i,n;return 0!==t&&(this.translate(e,r),a=t*Math.PI/180,i=Math.cos(a),n=Math.sin(a),this.queue.push([i,n,-n,i,0,0]),this.cache=null,this.translate(-e,-r)),this},i.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},i.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},i.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t=5760&&d.indexOf(t)>=0}function i(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function n(t){return t>=48&&t<=57}function s(t){return t>=48&&t<=57||43===t||45===t||46===t}function o(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function h(t){for(;t.index=i)return void(t.err="SvgPath: missed param (at pos "+a+")");if(e=t.path.charCodeAt(a),43!==e&&45!==e||(a++,e=a2&&(t.result.push([e,a[0],a[1]]),a=a.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(a));else for(;a.length>=l[r]&&(t.result.push([e].concat(a.splice(0,l[r]))),l[r]););}function f(t){var e,r,a,n,o=t.max;if(t.segmentStart=t.index,e=t.path.charCodeAt(t.index),!i(e))return void(t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")");if(a=l[t.path[t.index].toLowerCase()],t.index++,h(t),t.data=[],!a)return void u(t);for(r=!1;;){for(n=a;n>0;n--){if(c(t),t.err.length)return;t.data.push(t.param),h(t),r=!1,t.index=t.max)break;if(!s(t.path.charCodeAt(t.index)))break}}u(t)}var l={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];e.exports=function(t){var e=new o(t),r=e.max;for(h(e);e.index0,o=t.calc(a[1],a[2],f),c=["m",o[0],o[1]];break;default:for(u=a[0],c=[u],f=u.toLowerCase()===u,e=1;e=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},a.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var a=0;a0&&"m"!==e&&"M"!==e&&e===this.segments[a-1][0],r=r.concat(t?this.segments[a].slice(1):this.segments[a]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},a.prototype.translate=function(t,e){return this.__stack.push(s().translate(t,e||0)),this},a.prototype.scale=function(t,e){return this.__stack.push(s().scale(t,e||0===e?e:t)),this},a.prototype.rotate=function(t,e,r){return this.__stack.push(s().rotate(t,e||0,r||0)),this},a.prototype.skewX=function(t){return this.__stack.push(s().skewX(t)),this},a.prototype.skewY=function(t){return this.__stack.push(s().skewY(t)),this},a.prototype.matrix=function(t){return this.__stack.push(s().matrix(t)),this},a.prototype.transform=function(t){return t.trim()?(this.__stack.push(n(t)),this):this},a.prototype.round=function(t){var e,r=0,a=0,i=0,n=0;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(s){var o=s[0].toLowerCase()===s[0];switch(s[0]){case"H":case"h":return o&&(s[1]+=i),i=s[1]-s[1].toFixed(t),void(s[1]=+s[1].toFixed(t));case"V":case"v":return o&&(s[1]+=n),n=s[1]-s[1].toFixed(t),void(s[1]=+s[1].toFixed(t));case"Z":case"z":return i=r,void(n=a);case"M":case"m":return o&&(s[1]+=i,s[2]+=n),i=s[1]-s[1].toFixed(t),n=s[2]-s[2].toFixed(t),r=i,a=n,s[1]=+s[1].toFixed(t),void(s[2]=+s[2].toFixed(t));case"A":case"a":return o&&(s[6]+=i,s[7]+=n),i=s[6]-s[6].toFixed(t),n=s[7]-s[7].toFixed(t),s[1]=+s[1].toFixed(t),s[2]=+s[2].toFixed(t),s[3]=+s[3].toFixed(t+2),s[6]=+s[6].toFixed(t),void(s[7]=+s[7].toFixed(t));default:return e=s.length,o&&(s[e-2]+=i,s[e-1]+=n),i=s[e-2]-s[e-2].toFixed(t),n=s[e-1]-s[e-1].toFixed(t),void s.forEach(function(e,r){r&&(s[r]=+s[r].toFixed(t))})}}),this},a.prototype.iterate=function(t,e){var r,a,i,n=this.segments,s={},o=!1,h=0,c=0,u=0,f=0;if(e||this.__evaluateStack(),n.forEach(function(e,r){var a=t(e,r,h,c);Array.isArray(a)&&(s[r]=a,o=!0);var i=e[0]===e[0].toLowerCase();switch(e[0]){case"m":case"M":return h=e[1]+(i?h:0),c=e[2]+(i?c:0),u=h,void(f=c);case"h":case"H":return void(h=e[1]+(i?h:0));case"v":case"V":return void(c=e[1]+(i?c:0));case"z":case"Z":return h=u,void(c=f);default:h=e[e.length-2]+(i?h:0),c=e[e.length-1]+(i?c:0)}}),!o)return this;for(i=[],r=0;r * @link http://www.phpied.com/rgb-color-parser-in-javascript/ * @license Use it if you like it */ !function(e){function a(t){this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase();var e={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"};for(var r in e)t==r&&(t=e[r]);for(var i=[{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)]}}],n=0;n255?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),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r},this.getHelpXML=function(){for(var t=new Array,r=0;r "+u.toRGB()+" -> "+u.toHex());c.appendChild(f),c.appendChild(l),h.appendChild(c)}catch(t){}return h}}"function"==typeof t&&t.amd?t(function(){return a}):void 0!==r&&r.exports?r.exports=a:e.RGBColor=a}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this)},{}],9:[function(e,r,a){!function(a){function i(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function n(t,e){return i([e[0]-t[0],e[1]-t[1]])}function s(t,e){return[t[0]+e[0],t[1]+e[1]]}function o(){this.markers=[]}function h(t,e,r){this.id=t,this.anchor=e,this.angle=r}function c(t,e,r,a,i,n){var s,o,h=e[0],c=e[1],u=e[2],f=e[3],l=i/u,d=n/f,g=t.getAttribute("preserveAspectRatio");if(g){var p=g.split(" ");s=p[0],o=p[1]||"meet"}else s="xMidYMid",o="meet";"none"!==s&&("meet"===o?l=d=Math.min(l,d):"slice"===o&&(l=d=Math.max(l,d)));var x=r-h*l,b=a-c*d;s.indexOf("xMid")>=0?x+=(i-u*l)/2:s.indexOf("xMax")>=0&&(x+=i-u*l),s.indexOf("yMid")>=0?b+=(n-f*d)/2:s.indexOf("yMax")>=0&&(b+=n-f*d);var v=new m.Matrix(1,0,0,1,x,b),y=new m.Matrix(l,0,0,d,0,0);return m.matrixMult(y,v)}function u(t,e){if(0===t.length)return 0;var r=e.fontFamily;return R(r)(t,e.fontFamily,e.fontSize+"px",e.fontStyle,e.fontWeight)}function f(t,e){var r=e.textAnchor;if("start"===r)return 0;var a=u(t,e),i=0;switch(r){case"end":i=a;break;case"middle":i=a/2}return i}function l(t,e,r){this.texts=[],this.tSpans=[],this.textAnchor=t,this.originX=e,this.originY=r}function d(t,e){var r;return(r=t&&t.toString().match(/^([\-0-9.]+)em$/))?parseFloat(r[1])*e:(r=t&&t.toString().match(/^([\-0-9.]+)(px|)$/),r?parseFloat(r[1]):0)}function g(t,e,r){var a=M(t,"font-family");a&&(r.fontFamily=a),e&&e.ok&&(r.fill=e);var i=M(t,"font-weight");i&&(r.fontWeight=i);var n=M(t,"font-style");n&&(r.fontStyle=n);var s=M(t,"font-size");s&&(r.fontSize=parseFloat(s));var o=M(t,"text-anchor");o&&(r.textAnchor=o)}function p(t,e){if(t.fontFamily!==e.fontFamily&&m.setFont(t.fontFamily),t.fill!==e.fill&&t.fill.ok){var r=t.fill;m.setTextColor(r.r,r.g,r.b)}var a="";t.fontWeight!==e.fontWeight&&"bold"===t.fontWeight&&(a="bold"),t.fontStyle!==e.fontStyle&&"italic"===t.fontStyle&&(a+="italic"),""!==a&&m.setFontType(a),t.fontSize!==e.fontSize&&m.setFontSize(t.fontSize)}var x,b,m,v=/url\(["']?#([^"']+)["']?\)/,y="http://www.w3.org/2000/svg",k=function(t){var e=t.getAttribute("d");b&&(e=b(e).unshort().unarc().abs().toString(),t.setAttribute("d",e));var r=t.pathSegList;if(r)return r;r=[];for(var a,i=/([a-df-zA-DF-Z])([^a-df-zA-DF-Z]*)/g;a=i.exec(e);){var n=E(a[2]),s=a[1],o="zZ".indexOf(s)>=0?0:"hHvV".indexOf(s)>=0?1:"mMlLtT".indexOf(s)>=0?2:"sSqQ".indexOf(s)>=0?4:"aA".indexOf(s)>=0?7:"cC".indexOf(s)>=0?6:-1,h=0;do{var c={pathSegTypeAsLetter:s};switch(s){case"h":case"H":c.x=n[h];break;case"v":case"V":c.y=n[h];break;case"c":case"C":c.x1=n[h+o-6],c.y1=n[h+o-5];case"s":case"S":c.x2=n[h+o-4],c.y2=n[h+o-3];case"t":case"T":case"l":case"L":case"m":case"M":c.x=n[h+o-2],c.y=n[h+o-1];break;case"q":case"Q":c.x1=n[h],c.y1=n[h+1],c.x=n[h+2],c.y=n[h+3];break;case"a":case"A":throw new Error("Cannot convert Arcs without SvgPath package")}r.push(c),"m"===s?s="l":"M"===s&&(s="L"),h+=o}while(h=0},A=function(t,e){for(var r=[],a=0;a0&&("C"===n.pathSegTypeAsLetter||"S"===n.pathSegTypeAsLetter)?F([n.x2,n.y2],e):t>0&&("c"===n.pathSegTypeAsLetter||"s"===n.pathSegTypeAsLetter)?F([n.x2+a,n.y2+i],e):[e[0],e[1]]},_=function(t){this.prefix=t,this.id=0,this.nextChild=function(){return new _("_"+this.id+++"_"+this.get())},this.get=function(){return this.prefix}},L=function(){this.fillMode=null,this.strokeMode=null,this.color=null,this.fill=null,this.fillOpacity=1,this.fontFamily=null,this.fontSize=16,this.fontStyle=null,this.fontWeight=null,this.opacity=1,this.stroke=null,this.strokeDasharray=null,this.strokeDashoffset=null,this.strokeLinecap=null,this.strokeLinejoin=null,this.strokeMiterlimit=4,this.strokeOpacity=1,this.strokeWidth=1,this.textAnchor=null,this.visibility=null};L.default=function(){var t=new L;return t.fillMode="F",t.strokeMode="",t.color=new x("rgb(0, 0, 0)"),t.fill=new x("rgb(0, 0, 0)"),t.fillOpacity=1,t.fontFamily="times",t.fontSize=16,t.fontStyle="normal",t.fontWeight="normal",t.opacity=1,t.stroke=null,t.strokeDasharray=null,t.strokeDashoffset=null,t.strokeLinecap="butt",t.strokeLinejoin="miter",t.strokeMiterlimit=4,t.strokeOpacity=1,t.strokeWidth=1,t.textAnchor="start",t.visibility="visible",t},L.prototype.clone=function(){var t=new L;return t.fillMode=this.fillMode,t.strokeMode=this.strokeMode,t.color=this.color,t.fill=this.fill,t.fillOpacity=this.fillOpacity,t.fontFamily=this.fontFamily,t.fontSize=this.fontSize,t.fontStyle=this.fontStyle,t.fontWeight=this.fontWeight,t.opacity=this.opacity,t.stroke=this.stroke,t.strokeDasharray=this.strokeDasharray,t.strokeDashoffset=this.strokeDashoffset,t.strokeLinecap=this.strokeLinecap,t.strokeLinejoin=this.strokeLinejoin,t.strokeMiterlimit=this.strokeMiterlimit,t.strokeOpacity=this.strokeOpacity,t.strokeWidth=this.strokeWidth,t.textAnchor=this.textAnchor,t.visibility=this.visibility,t},o.prototype.addMarker=function(t){this.markers.push(t)},o.prototype.draw=function(t,e){for(var r=0;r0;){var c=r.exec(t);if(c&&(e=E(c[1]),h=m.matrixMult(new m.Matrix(e[0],e[1],e[2],e[3],e[4],e[5]),h),t=t.substr(c[0].length)),c=i.exec(t)){e=E(c[1]);var u=Math.PI*e[0]/180;if(h=m.matrixMult(new m.Matrix(Math.cos(u),Math.sin(u),-Math.sin(u),Math.cos(u),0,0),h),e[1]&&e[2]){var f=new m.Matrix(1,0,0,1,e[1],e[2]),l=new m.Matrix(1,0,0,1,-e[1],-e[2]);h=m.matrixMult(l,m.matrixMult(h,f))}t=t.substr(c[0].length)}c=a.exec(t),c&&(e=E(c[1]),h=m.matrixMult(new m.Matrix(1,0,0,1,e[0],e[1]||0),h),t=t.substr(c[0].length)),c=n.exec(t),c&&(e=E(c[1]),e[1]||(e[1]=e[0]),h=m.matrixMult(new m.Matrix(e[0],0,0,e[1],0,0),h),t=t.substr(c[0].length)),c=s.exec(t),c&&(e=parseFloat(c[1]),h=m.matrixMult(new m.Matrix(1,0,Math.tan(e),1,0,0),h),t=t.substr(c[0].length)),c=o.exec(t),c&&(e=parseFloat(c[1]),h=m.matrixMult(new m.Matrix(1,Math.tan(e),0,1,0,0),h),t=t.substr(c[0].length))}return h},E=function(t){for(var e,r=[],a=/[+-]?(?:(?:\d+\.?\d*)|(?:\d*\.?\d+))(?:[eE][+-]?\d+)?/g;e=a.exec(t);)r.push(parseFloat(e[0]));return r},j=function(t){var e=/\s*rgba\(((?:[^,\)]*,){3}[^,\)]*)\)\s*/.exec(t);if(e){var r=E(e[1]),a=new x("rgb("+r.slice(0,3).join(",")+")");return a.a=r[3],a}return new x(t)},D=function(t,e){var r=t[0],a=t[1];return[e.a*r+e.c*a+e.e,e.b*r+e.d*a+e.f]},G=function(t){if("none"===M(t,"display"))return[0,0,0,0];var e,r,a,i,n,s,o,h,c=parseFloat;if(w(t,"polygon")){var u=P(t.getAttribute("points"));for(r=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY,e=0;e=0&&(d=y,g=S),"MLCSQT".indexOf(_)>=0?(y=F.x,S=F.y):"mlcsqt".indexOf(_)>=0?(y=F.x+y,S=F.y+S):"zZ".indexOf(_)<0&&(y=p,S=x),"CSQTcsqt".indexOf(_)>=0?(r=Math.min(r,y,b[0],m[0],v[0]),i=Math.max(i,y,b[0],m[0],v[0]),a=Math.min(a,S,b[1],m[1],v[1]),n=Math.max(n,S,b[1],m[1],v[1])):(r=Math.min(r,y),i=Math.max(i,y),a=Math.min(a,S),n=Math.max(n,S))}h=[r,a,i-r,n-a]}else{if(w(t,"svg"))return s=t.getAttribute("viewBox"),s&&(o=E(s)),[c(t.getAttribute("x"))||o&&o[0]||0,c(t.getAttribute("y"))||o&&o[1]||0,c(t.getAttribute("width"))||o&&o[2]||0,c(t.getAttribute("height"))||o&&o[3]||0];if(w(t,"g"))h=[0,0,0,0],A(t,function(t,e){var r=G(e);h=[Math.min(h[0],r[0]),Math.min(h[1],r[1]),Math.max(h[0]+h[2],r[0]+r[2])-Math.min(h[0],r[0]),Math.max(h[1]+h[3],r[1]+r[3])-Math.min(h[1],r[1])]});else{if(w(t,"marker"))return s=t.getAttribute("viewBox"),s&&(o=E(s)),[o&&o[0]||0,o&&o[1]||0,o&&o[2]||c(t.getAttribute("marker-width"))||0,o&&o[3]||c(t.getAttribute("marker-height"))||0];if(w(t,"pattern"))return[c(t.getAttribute("x"))||0,c(t.getAttribute("y"))||0,c(t.getAttribute("width"))||0,c(t.getAttribute("height"))||0];var L=c(t.getAttribute("x1"))||c(t.getAttribute("x"))||c(t.getAttribute("cx")-c(t.getAttribute("r")))||0,O=c(t.getAttribute("x2"))||L+c(t.getAttribute("width"))||c(t.getAttribute("cx"))+c(t.getAttribute("r"))||0,T=c(t.getAttribute("y1"))||c(t.getAttribute("y"))||c(t.getAttribute("cy"))-c(t.getAttribute("r"))||0,q=c(t.getAttribute("y2"))||T+c(t.getAttribute("height"))||c(t.getAttribute("cy"))+c(t.getAttribute("r"))||0;h=[Math.min(L,O),Math.min(T,q),Math.max(L,O)-Math.min(L,O),Math.max(T,q)-Math.min(T,q)]}}if(!w(t,"marker,svg,g")){var N=M(t,"stroke-width")||1;return M(t,"stroke-miterlimit")&&(N*=.5/Math.sin(Math.PI/12)),[h[0]-N,h[1]-N,h[2]+2*N,h[3]+2*N]}return h},W=function(t,e,r,a,i,c,u){var f,l,d=P(t.getAttribute("points")),g=[{op:"m",c:D(d[0],e)}];for(f=1;f=0),P=d&&(O===l.numberOfItems-1||"mM".indexOf(q)<0&&"mM".indexOf(l.getItem(O+1).pathSegTypeAsLetter)>=0),z=p&&O>0&&!(1===O&&"mM".indexOf(l.getItem(O-1).pathSegTypeAsLetter)>=0);if("sScCqQtT".indexOf(q)>=0)N&&_.addMarker(new h(g,[k,M],S([k,M],b))),P&&_.addMarker(new h(d,f,S(m,f))),z&&(y=n([k,M],b),y="mM".indexOf(l.getItem(O-1).pathSegTypeAsLetter)>=0?y:i(s(L,y)),_.addMarker(new h(p,[k,M],Math.atan2(y[1],y[0])))),L=n(m,f),r=k,a=M,b=D(b,e),m=D(m,e),x=D(f,e),F.push({op:"c",c:[b[0],b[1],m[0],m[1],x[0],x[1]]});else if("lLhHvVmM".indexOf(q)>=0){if(y=n([k,M],f),N&&_.addMarker(new h(g,[k,M],Math.atan2(y[1],y[0]))),P&&_.addMarker(new h(d,f,Math.atan2(y[1],y[0]))),z){var E="mM".indexOf(q)>=0?L:"mM".indexOf(l.getItem(O-1).pathSegTypeAsLetter)>=0?y:i(s(L,y));_.addMarker(new h(p,[k,M],Math.atan2(E[1],E[0])))}L=y,x=D(f,e),F.push({op:v,c:x})}"MLCSQT".indexOf(q)>=0?(k=T.x,M=T.y):"mlcsqt".indexOf(q)>=0?(k=T.x+k,M=T.y+M):"zZ".indexOf(q)<0&&(k=c,M=u)}return{lines:F,markers:_}}(0,e);x.lines.length>0&&m.path(x.lines,a,c,u),(d||g||p)&&x.markers.draw(e,f)},H=function(t,e,r){var a=t.getAttribute("href")||t.getAttribute("xlink:href");if(a){var i=m.getFormObject(r.get()+a.substring(1)),n=t.getAttribute("x")||0,s=t.getAttribute("y")||0,o=t.getAttribute("width")||i.width,h=t.getAttribute("height")||i.height,c=new m.Matrix(o/i.width||0,0,0,h/i.height||0,n,s);c=m.matrixMult(c,e),m.doFormObject(r.get()+a.substring(1),c)}},B=function(t,e,r,a){var i=D([parseFloat(t.getAttribute("x1")||0),parseFloat(t.getAttribute("y1")||0)],e),n=D([parseFloat(t.getAttribute("x2")||0),parseFloat(t.getAttribute("y2")||0)],e);"D"===a.strokeMode&&m.line(i[0],i[1],n[0],n[1]);var s=t.getAttribute("marker-start"),c=t.getAttribute("marker-end");if(s||c){var u=new o,f=S(i,n);s&&u.addMarker(new h(r.get()+v.exec(s)[1],i,f)),c&&u.addMarker(new h(r.get()+v.exec(c)[1],n,f)),u.draw(m.unitMatrix,a)}},X=function(t,e,r,a){m.roundedRect(parseFloat(t.getAttribute("x"))||0,parseFloat(t.getAttribute("y"))||0,parseFloat(t.getAttribute("width")),parseFloat(t.getAttribute("height")),parseFloat(t.getAttribute("rx"))||0,parseFloat(t.getAttribute("ry"))||0,e,r,a)},Q=function(t,e,r,a){m.ellipse(parseFloat(t.getAttribute("cx"))||0,parseFloat(t.getAttribute("cy"))||0,parseFloat(t.getAttribute("rx")),parseFloat(t.getAttribute("ry")),e,r,a)},U=function(t,e,r,a){var i=parseFloat(t.getAttribute("r"))||0;m.ellipse(parseFloat(t.getAttribute("cx"))||0,parseFloat(t.getAttribute("cy"))||0,i,i,e,r,a)},Z=function(t,e){switch(M(t,"text-transform")){case"uppercase":return e.toUpperCase();case"lowercase":return e.toLowerCase();default:return e}},R=function(){function t(t,e,r,a,i){var n=document.createElement("canvas"),s=n.getContext("2d");return s.font=[a,i,r,e].join(" "),s.measureText(t).width}function e(t,e,r,a,i){var n=document.createElementNS(y,"text");n.setAttribute("font-family",e),n.setAttribute("font-size",r),n.setAttribute("font-style",a),n.setAttribute("font-weight",i),n.appendChild(document.createTextNode(t));var s=document.createElementNS(y,"svg");s.appendChild(n),s.setAttribute("visibility","hidden"),document.body.appendChild(s);var o=n.getBBox().width;return document.body.removeChild(s),o}var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!\"$%&/()=?'\\+*-_.:,;^}][{#~|<>",a={};return function(i){var n=a[i];if(!n){var s=t(r,i,"16px","normal","normal"),o=e(r,i,"16px","normal","normal");n=Math.abs(s-o)<.1?t:e,a[i]=n}return n}}();l.prototype.add=function(t,e){this.texts.push(e),this.tSpans.push(t)},l.prototype.put=function(t,e){var r,a,i=[],n=[],s=[],o=this.originX,h=this.originY,c=o,f=o;for(r=0;r