FaC: Das alte Flag von Terminen, die in die Zeiterfassung übernommen worden sind, wird ebenfalls berücksichtigt.
6 lines
16 KiB
JavaScript
6 lines
16 KiB
JavaScript
/*!
|
|
* Globalize v1.6.0 2020-09-08T11:54Z Released under the MIT license
|
|
* http://git.io/TrdQbw
|
|
*/
|
|
!function(t,e){"function"==typeof define&&define.amd?define(["cldr","../globalize","cldr/event"],e):"object"==typeof exports?module.exports=e(require("cldrjs"),require("../globalize")):e(t.Cldr,t.Globalize)}(this,(function(t,e){var r,n=e._alwaysArray,o=e._createError,i=e._isPlainObject,a=e._runtimeBind,u=e._validateDefaultLocale,s=e._validate,l=e._validateParameterPresence,c=e._validateParameterType,p=e._validateParameterTypePlainObject;r=function(){function t(t,e){if(/^[A-Z_$][0-9A-Z_$]*$/i.test(t))return e?e+"."+t:t;var r=JSON.stringify(t);return e?e+"["+r+"]":r}function e(t,e,r){if(this.lc=[t],this.runtime.pluralFuncs={},this.runtime.pluralFuncs[this.lc[0]]=e,this.runtime.fmt={},r)for(var n in r)this.runtime.fmt[n]=r[n]}return e._parse=function(){function t(t,e,r,n,o,i){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=o,this.column=i,this.name="SyntaxError"}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),{SyntaxError:t,parse:function(e){var r,n=arguments.length>1?arguments[1]:{},o={},i={start:kt},a=kt,u=function(t){return{type:"messageFormatPattern",statements:t}},s=o,l="{",c={type:"literal",value:"{",description:'"{"'},p=null,f=",",h={type:"literal",value:",",description:'","'},m="}",d={type:"literal",value:"}",description:'"}"'},v=function(t,e){var r={type:"messageFormatElement",argumentIndex:t};return e&&e.length?r.elementFormat=e[1]:r.output=!0,r},y="plural",g={type:"literal",value:"plural",description:'"plural"'},A=function(t,e){return{type:"elementFormat",key:t,val:e}},F="selectordinal",_={type:"literal",value:"selectordinal",description:'"selectordinal"'},b="select",w={type:"literal",value:"select",description:'"select"'},x=function(t,e){return{type:"elementFormat",key:t,val:e}},S=function(t,e){return{type:"pluralFormatPattern",pluralForms:e,offset:t||0}},j="offset",C={type:"literal",value:"offset",description:'"offset"'},E=":",P={type:"literal",value:":",description:'":"'},k=function(t){return t},I=function(t,e){return{key:t,val:e}},O=function(t){return t},N="=",G={type:"literal",value:"=",description:'"="'},M=function(t){return{type:"selectFormatPattern",pluralForms:t}},R=function(t){return t},z="#",$={type:"literal",value:"#",description:'"#"'},J=function(){return{type:"octothorpe"}},L=function(t){return{type:"string",val:t.join("")}},Z={type:"other",description:"identifier"},B=/^[0-9a-zA-Z$_]/,D={type:"class",value:"[0-9a-zA-Z$_]",description:"[0-9a-zA-Z$_]"},U=/^[^ \t\n\r,.+={}]/,q={type:"class",value:"[^ \\t\\n\\r,.+={}]",description:"[^ \\t\\n\\r,.+={}]"},T=function(t){return t},V=function(t){return t.join("")},H=/^[^{}#\\\0-\x1F\x7f \t\n\r]/,K={type:"class",value:"[^{}#\\\\\\0-\\x1F\x7f \\t\\n\\r]",description:"[^{}#\\\\\\0-\\x1F\x7f \\t\\n\\r]"},Q=function(t){return t},W="\\\\",X={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Y=function(){return"\\"},tt="\\#",et={type:"literal",value:"\\#",description:'"\\\\#"'},rt=function(){return"#"},nt="\\{",ot={type:"literal",value:"\\{",description:'"\\\\{"'},it=function(){return"{"},at="\\}",ut={type:"literal",value:"\\}",description:'"\\\\}"'},st=function(){return"}"},lt="\\u",ct={type:"literal",value:"\\u",description:'"\\\\u"'},pt=function(t,e,r,n){return String.fromCharCode(parseInt("0x"+t+e+r+n))},ft=/^[0-9]/,ht={type:"class",value:"[0-9]",description:"[0-9]"},mt=function(t){return parseInt(t.join(""),10)},dt=/^[0-9a-fA-F]/,vt={type:"class",value:"[0-9a-fA-F]",description:"[0-9a-fA-F]"},yt={type:"other",description:"whitespace"},gt=function(t){return t.join("")},At=/^[ \t\n\r]/,Ft={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_t=0,bt=0,wt={line:1,column:1,seenCR:!1},xt=0,St=[],jt=0;if("startRule"in n){if(!(n.startRule in i))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=i[n.startRule]}function Ct(t){return bt!==t&&(bt>t&&(bt=0,wt={line:1,column:1,seenCR:!1}),function(t,r,n){var o,i;for(o=r;o<n;o++)"\n"===(i=e.charAt(o))?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===i||"\u2028"===i||"\u2029"===i?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}(wt,bt,t),bt=t),wt}function Et(t){_t<xt||(_t>xt&&(xt=_t,St=[]),St.push(t))}function Pt(r,n,o){var i=Ct(o),a=o<e.length?e.charAt(o):null;return null!==n&&function(t){var e=1;for(t.sort((function(t,e){return t.description<e.description?-1:t.description>e.description?1:0}));e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}(n),new t(null!==r?r:function(t,e){var r,n=new Array(t.length);for(r=0;r<t.length;r++)n[r]=t[r].description;return"Expected "+(t.length>1?n.slice(0,-1).join(", ")+" or "+n[t.length-1]:n[0])+" but "+(e?'"'+function(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(t){return"\\x0"+e(t)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(t){return"\\x"+e(t)})).replace(/[\u0180-\u0FFF]/g,(function(t){return"\\u0"+e(t)})).replace(/[\u1080-\uFFFF]/g,(function(t){return"\\u"+e(t)}))}(e)+'"':"end of input")+" found."}(n,a),n,a,o,i.line,i.column)}function kt(){return It()}function It(){var t,e,r;for(t=_t,e=[],(r=Ot())===o&&(r=Bt())===o&&(r=Zt());r!==o;)e.push(r),(r=Ot())===o&&(r=Bt())===o&&(r=Zt());return e!==o&&(t,e=u(e)),t=e}function Ot(){var t,r,n,i,a,u;return t=_t,123===e.charCodeAt(_t)?(r=l,_t++):(r=o,0===jt&&Et(c)),r!==o&&Ht()!==o&&(n=Dt())!==o?(i=_t,44===e.charCodeAt(_t)?(a=f,_t++):(a=o,0===jt&&Et(h)),a!==o&&(u=Nt())!==o?i=a=[a,u]:(_t=i,i=s),i===o&&(i=p),i!==o&&(a=Ht())!==o?(125===e.charCodeAt(_t)?(u=m,_t++):(u=o,0===jt&&Et(d)),u!==o?(t,t=r=v(n,i)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t}function Nt(){var t,r,n,i,a;if(t=_t,Ht()!==o?(e.substr(_t,6)===y?(r=y,_t+=6):(r=o,0===jt&&Et(g)),r!==o&&(n=Ht())!==o?(44===e.charCodeAt(_t)?(i=f,_t++):(i=o,0===jt&&Et(h)),i!==o&&Ht()!==o&&(a=Gt())!==o&&Ht()!==o?(t,t=A(r,a)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t===o&&(t=_t,Ht()!==o?(e.substr(_t,13)===F?(r=F,_t+=13):(r=o,0===jt&&Et(_)),r!==o&&(n=Ht())!==o?(44===e.charCodeAt(_t)?(i=f,_t++):(i=o,0===jt&&Et(h)),i!==o&&Ht()!==o&&(a=Gt())!==o&&Ht()!==o?(t,t=A(r,a)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t===o&&(t=_t,Ht()!==o?(e.substr(_t,6)===b?(r=b,_t+=6):(r=o,0===jt&&Et(w)),r!==o&&(n=Ht())!==o?(44===e.charCodeAt(_t)?(i=f,_t++):(i=o,0===jt&&Et(h)),i!==o&&Ht()!==o&&(a=$t())!==o&&Ht()!==o?(t,t=A(r,a)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t===o)))if(t=_t,Ht()!==o)if((r=Dt())!==o){for(n=[],i=Lt();i!==o;)n.push(i),i=Lt();n!==o?(t,t=x(r,n)):(_t=t,t=s)}else _t=t,t=s;else _t=t,t=s;return t}function Gt(){var t,e,r,n;if(t=_t,(e=Mt())===o&&(e=p),e!==o){if(r=[],(n=Rt())!==o)for(;n!==o;)r.push(n),n=Rt();else r=s;r!==o?(t,t=e=S(e,r)):(_t=t,t=s)}else _t=t,t=s;return t}function Mt(){var t,r,n,i;return t=_t,Ht()!==o?(e.substr(_t,6)===j?(r=j,_t+=6):(r=o,0===jt&&Et(C)),r!==o&&Ht()!==o?(58===e.charCodeAt(_t)?(n=E,_t++):(n=o,0===jt&&Et(P)),n!==o&&Ht()!==o&&(i=Tt())!==o&&Ht()!==o?(t,t=k(i)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t}function Rt(){var t,r,n,i,a;return t=_t,Ht()!==o&&(r=zt())!==o&&Ht()!==o?(123===e.charCodeAt(_t)?(n=l,_t++):(n=o,0===jt&&Et(c)),n!==o&&Ht()!==o&&(i=It())!==o&&Ht()!==o?(125===e.charCodeAt(_t)?(a=m,_t++):(a=o,0===jt&&Et(d)),a!==o?(t,t=I(r,i)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t}function zt(){var t,r,n;return t=_t,(r=Dt())!==o&&(t,r=O(r)),(t=r)===o&&(t=_t,61===e.charCodeAt(_t)?(r=N,_t++):(r=o,0===jt&&Et(G)),r!==o&&(n=Tt())!==o?(t,t=r=k(n)):(_t=t,t=s)),t}function $t(){var t,e,r;if(t=_t,e=[],(r=Jt())!==o)for(;r!==o;)e.push(r),r=Jt();else e=s;return e!==o&&(t,e=M(e)),t=e}function Jt(){var t,r,n,i,a;return t=_t,Ht()!==o&&(r=Dt())!==o&&Ht()!==o?(123===e.charCodeAt(_t)?(n=l,_t++):(n=o,0===jt&&Et(c)),n!==o&&Ht()!==o&&(i=It())!==o&&Ht()!==o?(125===e.charCodeAt(_t)?(a=m,_t++):(a=o,0===jt&&Et(d)),a!==o?(t,t=I(r,i)):(_t=t,t=s)):(_t=t,t=s)):(_t=t,t=s),t}function Lt(){var t,r,n;return t=_t,Ht()!==o?(44===e.charCodeAt(_t)?(r=f,_t++):(r=o,0===jt&&Et(h)),r!==o&&Ht()!==o&&(n=Dt())!==o&&Ht()!==o?(t,t=R(n)):(_t=t,t=s)):(_t=t,t=s),t}function Zt(){var t,r;return t=_t,35===e.charCodeAt(_t)?(r=z,_t++):(r=o,0===jt&&Et($)),r!==o&&(t,r=J()),t=r}function Bt(){var t,e,r;if(t=_t,e=[],(r=Ut())===o&&(r=Kt()),r!==o)for(;r!==o;)e.push(r),(r=Ut())===o&&(r=Kt());else e=s;return e!==o&&(t,e=L(e)),t=e}function Dt(){var t,r,n,i,a,u;if(jt++,t=_t,Ht()!==o){if(r=_t,n=_t,B.test(e.charAt(_t))?(i=e.charAt(_t),_t++):(i=o,0===jt&&Et(D)),i!==o){for(a=[],U.test(e.charAt(_t))?(u=e.charAt(_t),_t++):(u=o,0===jt&&Et(q));u!==o;)a.push(u),U.test(e.charAt(_t))?(u=e.charAt(_t),_t++):(u=o,0===jt&&Et(q));a!==o?n=i=[i,a]:(_t=n,n=s)}else _t=n,n=s;n!==o&&(n=e.substring(r,_t)),(r=n)!==o&&(n=Ht())!==o?(t,t=T(r)):(_t=t,t=s)}else _t=t,t=s;return jt--,t===o&&(o,0===jt&&Et(Z)),t}function Ut(){var t,e,r;if(t=_t,e=[],(r=qt())!==o)for(;r!==o;)e.push(r),r=qt();else e=s;return e!==o&&(t,e=V(e)),t=e}function qt(){var t,r,n,i,a,u;return t=_t,H.test(e.charAt(_t))?(r=e.charAt(_t),_t++):(r=o,0===jt&&Et(K)),r!==o&&(t,r=Q(r)),(t=r)===o&&(t=_t,e.substr(_t,2)===W?(r=W,_t+=2):(r=o,0===jt&&Et(X)),r!==o&&(t,r=Y()),(t=r)===o&&(t=_t,e.substr(_t,2)===tt?(r=tt,_t+=2):(r=o,0===jt&&Et(et)),r!==o&&(t,r=rt()),(t=r)===o&&(t=_t,e.substr(_t,2)===nt?(r=nt,_t+=2):(r=o,0===jt&&Et(ot)),r!==o&&(t,r=it()),(t=r)===o&&(t=_t,e.substr(_t,2)===at?(r=at,_t+=2):(r=o,0===jt&&Et(ut)),r!==o&&(t,r=st()),(t=r)===o&&(t=_t,e.substr(_t,2)===lt?(r=lt,_t+=2):(r=o,0===jt&&Et(ct)),r!==o&&(n=Vt())!==o&&(i=Vt())!==o&&(a=Vt())!==o&&(u=Vt())!==o?(t,t=r=pt(n,i,a,u)):(_t=t,t=s)))))),t}function Tt(){var t,r,n;if(t=_t,r=[],ft.test(e.charAt(_t))?(n=e.charAt(_t),_t++):(n=o,0===jt&&Et(ht)),n!==o)for(;n!==o;)r.push(n),ft.test(e.charAt(_t))?(n=e.charAt(_t),_t++):(n=o,0===jt&&Et(ht));else r=s;return r!==o&&(t,r=mt(r)),t=r}function Vt(){var t;return dt.test(e.charAt(_t))?(t=e.charAt(_t),_t++):(t=o,0===jt&&Et(vt)),t}function Ht(){var t,e,r;for(jt++,t=_t,e=[],r=Kt();r!==o;)e.push(r),r=Kt();return e!==o&&(t,e=gt(e)),jt--,(t=e)===o&&(e=o,0===jt&&Et(yt)),t}function Kt(){var t;return At.test(e.charAt(_t))?(t=e.charAt(_t),_t++):(t=o,0===jt&&Et(Ft)),t}if((r=a())!==o&&_t===e.length)return r;throw r!==o&&_t<e.length&&Et({type:"end",description:"end of input"}),Pt(null,St,xt)}}}().parse,e.plurals={},e.formatters={},e.prototype.runtime={number:function(t,e){if(isNaN(t))throw new Error("'"+t+"' isn't a number.");return t-(e||0)},plural:function(t,e,r,n,o){if({}.hasOwnProperty.call(n,t))return n[t]();e&&(t-=e);var i=r(t,o);return i in n?n[i]():n.other()},select:function(t,e){return{}.hasOwnProperty.call(e,t)?e[t]():e.other()},pluralFuncs:{},fmt:{},toString:function(){var e=function(r,n){if("object"!=typeof r){var o=r.toString().replace(/^(function )\w*/,"$1");return(u=/([ \t]*)\S.*$/.exec(o))?o.replace(new RegExp("^"+u[1],"mg"),""):o}var i=[];for(var a in r)"toString"!=a&&(0==n?i.push("var "+a+" = "+e(r[a],n+1)+";\n"):i.push(t(a)+": "+e(r[a],n+1)));if(0==n)return i.join("");if(0==i.length)return"{}";for(var u=" ";--n;)u+=" ";return"{\n"+i.join(",\n").replace(/^/gm,u)+"\n}"};return e(this,0)}},e.prototype._precompile=function(r,n){n=n||{keys:{},offset:{}};var o,i,a=[],u=[];switch(r.type){case"messageFormatPattern":for(o=0;o<r.statements.length;++o)a.push(this._precompile(r.statements[o],n));return i=a.join(" + ")||'""',n.pf_count?i:"function(d) { return "+i+"; }";case"messageFormatElement":return n.pf_count=n.pf_count||0,r.output?t(r.argumentIndex,"d"):(n.keys[n.pf_count]=r.argumentIndex,this._precompile(r.elementFormat,n));case"elementFormat":switch(u=[t(n.keys[n.pf_count],"d")],r.key){case"select":return u.push(this._precompile(r.val,n)),"select("+u.join(", ")+")";case"selectordinal":return"plural("+(u=u.concat([0,t(this.lc[0],"pluralFuncs"),this._precompile(r.val,n),1])).join(", ")+")";case"plural":return n.offset[n.pf_count||0]=r.val.offset||0,"plural("+(u=u.concat([n.offset[n.pf_count]||0,t(this.lc[0],"pluralFuncs"),this._precompile(r.val,n)])).join(", ")+")";default:return this.withIntlSupport&&!(r.key in this.runtime.fmt)&&r.key in e.formatters&&(i=e.formatters[r.key],this.runtime.fmt[r.key]="function"==typeof i(this)?i(this):i),u.push(JSON.stringify(this.lc)),r.val&&r.val.length&&u.push(JSON.stringify(1==r.val.length?r.val[0]:r.val)),"fmt."+r.key+"("+u.join(", ")+")"}case"pluralFormatPattern":case"selectFormatPattern":n.pf_count=n.pf_count||0,"selectFormatPattern"==r.type&&(n.offset[n.pf_count]=0);var s=!0;for(o=0;o<r.pluralForms.length;++o){var l=r.pluralForms[o].key;"other"===l&&(s=!1);var c=JSON.parse(JSON.stringify(n));c.pf_count++,a.push(t(l)+": function() { return "+this._precompile(r.pluralForms[o].val,c)+";}")}if(s)throw new Error("No 'other' form found in "+r.type+" "+n.pf_count);return"{ "+a.join(", ")+" }";case"string":return JSON.stringify(r.val||"");case"octothorpe":return n.pf_count?(u=[t(n.keys[n.pf_count-1],"d")],n.offset[n.pf_count-1]&&u.push(n.offset[n.pf_count-1]),"number("+u.join(", ")+")"):'"#"';default:throw new Error("Bad AST type: "+r.type)}},e.prototype.compile=function(r,n){var o={},i=this.lc,a=function(t,r){try{var n=e._parse(r);return t._precompile(n)}catch(t){throw new Error((n?"Precompiler":"Parser")+" error: "+t.toString())}},u=function(e,r){if(r||(r=0),"object"!=typeof e)return e;for(var n=[],o="",i=0;i<r;++i)o+=" ";for(var a in e)n.push("\n"+o+" "+t(a)+": "+u(e[a],r+1));return"{"+n.join(",")+"\n"+o+"}"};if("string"==typeof r)return new Function("number, plural, select, pluralFuncs, fmt","return "+a(this,r))(this.runtime.number,this.runtime.plural,this.runtime.select,this.runtime.pluralFuncs,this.runtime.fmt);for(var s in n=n||{},r)if(n.locale&&(this.lc=n.locale[s]&&[].concat(n.locale[s])||i),"string"==typeof r[s])try{o[s]=a(this,r[s])}catch(t){throw t.message=t.message.replace(":"," with `"+s+"`:"),t}else for(var l in o[s]={},r[s])try{o[s][l]=a(this,r[s][l])}catch(t){throw t.message=t.message.replace(":"," with `"+l+"` in `"+s+"`:"),t}this.lc=i;var c=this.runtime.toString()+"\n";switch(n.global||""){case"exports":var p=[];for(var f in o)p.push(t(f,"exports")+" = "+u(o[f]));return new Function(c+p.join(";\n"));case"module.exports":return new Function(c+"module.exports = "+u(o));case"":return new Function(c+"return "+u(o));default:return new Function("G",c+t(n.global,"G")+" = "+u(o))}},e}();var f=function(){return o("E_MISSING_PLURAL_MODULE","Plural module not loaded.")},h=function(t){s("E_MISSING_MESSAGE_BUNDLE","Missing message bundle for locale `{locale}`.",t.attributes.bundle&&void 0!==t.get("globalize-messages/{bundle}"),{locale:t.locale})},m=function(t,e){t=t.join("/"),s("E_MISSING_MESSAGE","Missing required message content `{path}`.",void 0!==e,{path:t})},d=function(t,e){t=t.join("/"),s("E_INVALID_MESSAGE","Invalid message content `{path}`. {expected} expected.","string"==typeof e,{expected:"a string",path:t})},v=function(t,e){c(t,e,void 0===t||i(t)||Array.isArray(t),"Array or Plain Object")},y=function(t){return function(e){return"number"!=typeof e&&"string"!=typeof e||(e=[].slice.call(arguments,0)),v(e,"variables"),t(e)}},g=function(t,e){var r=t.locale,n=e.toString;return e.toString=function(){var t,o={};return t=n.call(e),/number\(/.test(t)&&(o.number="messageFormat.number"),/plural\(/.test(t)&&(o.plural="messageFormat.plural"),/select\(/.test(t)&&(o.select="messageFormat.select"),t.replace(/pluralFuncs(\[([^\]]+)\]|\.([a-zA-Z]+))/,(function(t){return o.pluralFuncs='{"'+r+'": Globalize("'+r+'").pluralGenerator()}',t})),"(function( "+Object.keys(o).join(", ")+" ) {\n return "+t+"\n})("+Object.keys(o).map((function(t){return o[t]})).join(", ")+")"},e},A=[].slice;return e.loadMessages=function(e){var r,n={"globalize-messages":e,main:{}};for(r in l(e,"json"),p(e,"json"),e)e.hasOwnProperty(r)&&(n.main[r]={});t.load(n)},e.messageFormatter=e.prototype.messageFormatter=function(t){var e,o,i,s,p,v=A.call(arguments,0);return l(t,"path"),c(t,"path","string"==typeof t||Array.isArray(t),"a String nor an Array"),t=n(t),e=this.cldr,u(e),h(e),i=e.get(["globalize-messages/{bundle}"].concat(t)),m(t,i),Array.isArray(i)&&(i=i.join(" ")),d(t,i),s=void 0!==this.plural?this.pluralGenerator():f,o=new r(e.locale,s).compile(i),p=y(o),a(v,e,p,[g(e,o),s]),p},e.formatMessage=e.prototype.formatMessage=function(t){return this.messageFormatter(t).apply({},A.call(arguments,1))},e}));
|