dispatch.to("Foundry/2.1 Core Plugins").at(function(e,t){e.sprintf=function(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length<t?Array(1+t-e.length>>>0).join(n):"";return r?e+i:i+e},s=function(e,t,n,r,s,o){var u=r-e.length;return u>0&&(n||!s?e=i(e,r,o,n):e=e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,a){var f=e>>>0;return n=n&&f&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(f.toString(t),u||0,"0",!1),s(e,n,r,o,a)},u=function(e,t,n,r,i,o){return r!=null&&(e=e.slice(0,r)),s(e,"",t,n,i,o)},a=function(e,r,a,f,l,c,h){var p,d,v,m,g;if(e=="%%")return"%";var y=!1,b="",w=!1,E=!1,S=" ",x=a.length;for(var T=0;a&&T<x;T++)switch(a.charAt(T)){case" ":b=" ";break;case"+":b="+";break;case"-":y=!0;break;case"'":S=a.charAt(T+1);break;case"0":w=!0;break;case"#":E=!0}f?f=="*"?f=+t[n++]:f.charAt(0)=="*"?f=+t[f.slice(1,-1)]:f=+f:f=0,f<0&&(f=-f,y=!0);if(!isFinite(f))throw Error("sprintf: (minimum-)width must be finite");c?c=="*"?c=+t[n++]:c.charAt(0)=="*"?c=+t[c.slice(1,-1)]:c=+c:c="fFeE".indexOf(h)>-1?6:h=="d"?0:undefined,g=r?t[r.slice(0,-1)]:t[n++];switch(h){case"s":return u(g+"",y,f,c,w,S);case"c":return u(String.fromCharCode(+g),y,f,c,w);case"b":return o(g,2,E,y,f,c,w);case"o":return o(g,8,E,y,f,c,w);case"x":return o(g,16,E,y,f,c,w);case"X":return o(g,16,E,y,f,c,w).toUpperCase();case"u":return o(g,10,E,y,f,c,w);case"i":case"d":return p=+g|0,d=p<0?"-":b,g=d+i(Math.abs(p)+"",c,"0",!1),s(g,d,y,f,w);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,d=p<0?"-":b,v=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],g=d+Math.abs(p)[v](c),s(g,d,y,f,w)[m]();default:return e}};return r.replace(e,a)};var n=e.language=e.JText=function(e){return arguments.length<2?n._(e):n.sprintf.apply(null,arguments)};e.extend(n,{lang:{},add:function(t,r){e.isPlainObject(t)?e.extend(n.lang,t):n.lang[t]=r},remove:function(e){delete n.lang[e]},_:function(e){return n.lang[e]||""},sprintf:function(){var t=arguments[0];return arguments[0]=n.lang[t],e.sprintf.apply(null,arguments)}})});