/*! sprintf-js | Alexandru Marasteanu <hello@alexei.ro> (alexei.ro/) | BSD-3-Clause */

!function(a){function b(){var a=arguments,c=b.cache;return c&&c.hasOwnProperty(a)||(c=b.parse(a)),b.format.call(null,c,arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string://,number://,json://,not_json://,text:/^+/,modulo:/^x25{2}/,placeholder:/^x25(?:(d*)$|((+)))?(+)?(0|‘)?(-)?(d+)?(?:.(d+))?([b-gijosuxX])/,key:/^([a-z_d]*)/i,key_access:/^.([a-z_d]*)/i,index_access:/^/,sign:/^/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p=“”,q=[],r=!0,s=“”;for(h=0;o>h;h++)if(p=c(a),“string”===p)q=a;else if(“array”===p){if(j=a,j)for(g=f,i=0;i.length;i++){if(!g.hasOwnProperty(j[i]))throw new Error(b(“ property '%s' does not exist”,j[i]));g=g[j[i]]}else g=j?f[j]:f;if(“function”==c(g)&&(g=g()),e.not_string.test(j)&&e.not_json.test(j)&&“number”!=c(g)&&isNaN(g))throw new TypeError(b(“ expecting number but found %s”,c(g)));switch(e.number.test(j)&&(r=g>=0),j){case“b”:g=g.toString(2);break;case“c”:g=String.fromCharCode(g);break;case“d”:case“i”:g=parseInt(g,10);break;case“j”:g=JSON.stringify(g,null,j?parseInt(j):0);break;case“e”:g=j?g.toExponential(j):g.toExponential();break;case“f”:g=j?parseFloat(g).toFixed(j):parseFloat(g);break;case“g”:g=j?parseFloat(g).toPrecision(j):parseFloat(g);break;case“o”:g=g.toString(8);break;case“s”:g=(g=String(g))&&j?g.substring(0,j):g;break;case“u”:g>>>=0;break;case“x”:g=g.toString(16);break;case“X”:g=g.toString(16).toUpperCase()}e.json.test(j)?q=g:(!e.number.test(j)||r&&!j?s=“”:(s=r?“+”:“-”,g=g.toString().replace(e.sign,“”)),l=j?“0”===j?“0”:j.charAt(1):“ ”,m=j-(s+g).length,k=j&&m>0?d(l,m):“”,q=j?s+g+k:“0”===l?s+k+g:k+s+g)}return q.join(“”)},b.cache={},b.parse=function(a){for(var b=a,c=[],d=,f=0;b;){if(null!==(c=e.text.exec(b)))d=c;else if(null!==(c=e.modulo.exec(b)))d=“%”;else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError(“ unexpected placeholder”);if(c){f|=1;var g=[],h=c,i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError(“ failed to parse named argument key”);for(g=i;“”!==(h=h.substring(i.length));)if(null!==(i=e.key_access.exec(h)))g=i;else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError(“ failed to parse named argument key”);g=i}c=g}else f|=2;if(3===f)throw new Error(“ mixing positional and named placeholders is not (yet) supported”);d=c}b=b.substring(c.length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};“undefined”!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,“function”==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}(“undefined”==typeof window?this:window); //# sourceMappingURL=sprintf.min.map