function sprintf(){var j=arguments,p=0,q=function(b,a,f,c){f||(f=" ");a=b.length>=a?"":Array(1+a-b.length>>>0).join(f);return c?b+a:a+b},m=function(b,a,f,c,g,d){var e=c-b.length;0<e&&(b=f||!g?q(b,c,d,f):b.slice(0,a.length)+q("",e,"0",!0)+b.slice(a.length));return b},n=function(b,a,f,c,g,d,e){b>>>=0;f=f&&b&&{2:"0b",8:"0",16:"0x"}[a]||"";b=f+q(b.toString(a),d||0,"0",!1);return m(b,f,c,g,e)};return j[p++].replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g,function(b,
a,f,c,g,d,e){var i,k;if("%%"==b)return"%";var h=!1;k="";var l=g=!1;i=" ";for(var s=f.length,r=0;f&&r<s;r++)switch(f.charAt(r)){case " ":k=" ";break;case "+":k="+";break;case "-":h=!0;break;case "'":i=f.charAt(r+1);break;case "0":g=!0;break;case "#":l=!0}c=c?"*"==c?+j[p++]:"*"==c.charAt(0)?+j[c.slice(1,-1)]:+c:0;0>c&&(c=-c,h=!0);if(!isFinite(c))throw Error("sprintf: (minimum-)width must be finite");d=d?"*"==d?+j[p++]:"*"==d.charAt(0)?+j[d.slice(1,-1)]:+d:-1<"fFeE".indexOf(e)?6:"d"==e?0:void 0;a=a?
j[a.slice(0,-1)]:j[p++];switch(e){case "s":return e=String(a),null!=d&&(e=e.slice(0,d)),m(e,"",h,c,g,i);case "c":return e=String.fromCharCode(+a),null!=d&&(e=e.slice(0,d)),m(e,"",h,c,g,void 0);case "b":return n(a,2,l,h,c,d,g);case "o":return n(a,8,l,h,c,d,g);case "x":return n(a,16,l,h,c,d,g);case "X":return n(a,16,l,h,c,d,g).toUpperCase();case "u":return n(a,10,l,h,c,d,g);case "i":case "d":return i=parseInt(+a),b=0>i?"-":k,a=b+q(String(Math.abs(i)),d,"0",!1),m(a,b,h,c,g);case "e":case "E":case "f":case "F":case "g":case "G":return i=
+a,b=0>i?"-":k,k=["toExponential","toFixed","toPrecision"]["efg".indexOf(e.toLowerCase())],e=["toString","toUpperCase"]["eEfFgG".indexOf(e)%2],a=b+Math.abs(i)[k](d),m(a,b,h,c,g)[e]();default:return b}})};
