UNPKG

@rockpack/localazer

Version:

This module can help you organize localization in your React application

16 lines 24.2 kB
/*! For license information please see index.js.LICENSE.txt */ /*! * banner: * @rockpack/localazer: 1.9.0 * Aleksandrov Sergey <gooddev.sergey@gmail.com> (https://github.com/AlexSergey/rockpack) * This module can help you organize localization in your React application * MIT */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom/server"],e):"object"==typeof exports?exports.RockLocalazer=e(require("react"),require("react-dom/server")):t.RockLocalazer=e(t.react,t["react-dom/server"])}(this,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=4)}([function(t,e,n){ /*! * banner: * valid-types: 2.0.3 * A small JS type checker * ISC */ t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"isArray",(function(){return i})),n.d(e,"isNan",(function(){return o})),n.d(e,"isString",(function(){return s})),n.d(e,"isNumber",(function(){return a})),n.d(e,"isBoolean",(function(){return u})),n.d(e,"isUndefined",(function(){return l})),n.d(e,"isDefined",(function(){return c})),n.d(e,"isEmpty",(function(){return h})),n.d(e,"isClass",(function(){return f})),n.d(e,"isFunction",(function(){return p})),n.d(e,"isObject",(function(){return d})),n.d(e,"isNull",(function(){return g})),n.d(e,"isDOM",(function(){return y})),n.d(e,"isArguments",(function(){return m})),n.d(e,"isDate",(function(){return x})),n.d(e,"isAsync",(function(){return b})),n.d(e,"isUrl",(function(){return _})),n.d(e,"isBase64",(function(){return v})),n.d(e,"isEmptyObject",(function(){return w})),n.d(e,"isEmptyArray",(function(){return P}));var r=function(t){var e=typeof t;return"object"==typeof t?null===t?e="null":"undefined"!=typeof window&&t instanceof HTMLElement||"[object HTMLDocument]"===t.toString()?e="[object HTMLDocument]"===t.toString()?"document":"dom":Array.isArray(t)?e="array":t instanceof Date?e="date":"number"==typeof t.length&&"object"==typeof t&&!1===Array.isArray(t)&&(e="arguments"):"number"==typeof t?(e="number",isNaN(t)&&(e="NaN")):"function"==typeof t&&(e="function",t.toString&&0===t.toString().indexOf("class")&&(e="class")),e},i=function(t){return Array.isArray(t)},o=function(t){return isNaN(t)},s=function(t){return"string"===r(t)},a=function(t){return"number"===r(t)&&!1===isNaN(t)},u=function(t){return"boolean"===r(t)},l=function(t){return"undefined"===r(t)},c=function(t){return void 0!==t},h=function(t){return""===t||0===t||"0"===t||null===t||!1===t||!t},f=function(t){return"class"===r(t)},p=function(t){return"function"===r(t)},d=function(t){return"object"===r(t)},g=function(t){return"null"===r(t)},y=function(t){return"dom"===r(t)},m=function(t){return"arguments"===r(t)},x=function(t){return"date"===r(t)},b=function(t){return t instanceof Promise},_=function(t){return"string"===r(t)&&/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(t)},v=function(t){return s(t)&&t.indexOf("base64")>=0&&0===t.indexOf("data:")},w=function(t){return!!d(t)&&0===Object.keys(t).length},P=function(t){return!!i(t)&&0===t.length}}])},function(e,n){e.exports=t},function(t,e,n){!function(n,r){var i=Array.prototype,o=Object.prototype,s=i.slice,a=o.hasOwnProperty,u=i.forEach,l={},c={forEach:function(t,e,n){var r,i,o;if(null!==t)if(u&&t.forEach===u)t.forEach(e,n);else if(t.length===+t.length){for(r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r,t)===l)return}else for(o in t)if(a.call(t,o)&&e.call(n,t[o],o,t)===l)return},extend:function(t){return this.forEach(s.call(arguments,1),(function(e){for(var n in e)t[n]=e[n]})),t}},h=function(t){if(this.defaults={locale_data:{messages:{"":{domain:"messages",lang:"en",plural_forms:"nplurals=2; plural=(n != 1);"}}},domain:"messages",debug:!1},this.options=c.extend({},this.defaults,t),this.textdomain(this.options.domain),t.domain&&!this.options.locale_data[this.options.domain])throw new Error("Text domain set to non-existent domain: `"+t.domain+"`")};function f(t){return h.PF.compile(t||"nplurals=2; plural=(n != 1);")}function p(t,e){this._key=t,this._i18n=e}h.context_delimiter=String.fromCharCode(4),c.extend(p.prototype,{onDomain:function(t){return this._domain=t,this},withContext:function(t){return this._context=t,this},ifPlural:function(t,e){return this._val=t,this._pkey=e,this},fetch:function(t){return"[object Array]"!={}.toString.call(t)&&(t=[].slice.call(arguments,0)),(t&&t.length?h.sprintf:function(t){return t})(this._i18n.dcnpgettext(this._domain,this._context,this._key,this._pkey,this._val),t)}}),c.extend(h.prototype,{translate:function(t){return new p(t,this)},textdomain:function(t){if(!t)return this._textdomain;this._textdomain=t},gettext:function(t){return this.dcnpgettext.call(this,r,r,t)},dgettext:function(t,e){return this.dcnpgettext.call(this,t,r,e)},dcgettext:function(t,e){return this.dcnpgettext.call(this,t,r,e)},ngettext:function(t,e,n){return this.dcnpgettext.call(this,r,r,t,e,n)},dngettext:function(t,e,n,i){return this.dcnpgettext.call(this,t,r,e,n,i)},dcngettext:function(t,e,n,i){return this.dcnpgettext.call(this,t,r,e,n,i)},pgettext:function(t,e){return this.dcnpgettext.call(this,r,t,e)},dpgettext:function(t,e,n){return this.dcnpgettext.call(this,t,e,n)},dcpgettext:function(t,e,n){return this.dcnpgettext.call(this,t,e,n)},npgettext:function(t,e,n,i){return this.dcnpgettext.call(this,r,t,e,n,i)},dnpgettext:function(t,e,n,r,i){return this.dcnpgettext.call(this,t,e,n,r,i)},dcnpgettext:function(t,e,n,r,i){var o;if(r=r||n,t=t||this._textdomain,!this.options)return(o=new h).dcnpgettext.call(o,void 0,void 0,n,r,i);if(!this.options.locale_data)throw new Error("No locale data provided.");if(!this.options.locale_data[t])throw new Error("Domain `"+t+"` was not found.");if(!this.options.locale_data[t][""])throw new Error("No locale meta information provided.");if(!n)throw new Error("No translation key found.");var s,a,u,l=e?e+h.context_delimiter+n:n,c=this.options.locale_data,p=c[t],d=(c.messages||this.defaults.locale_data.messages)[""],g=p[""].plural_forms||p[""]["Plural-Forms"]||p[""]["plural-forms"]||d.plural_forms||d["Plural-Forms"]||d["plural-forms"];if(void 0===i)u=0;else{if("number"!=typeof i&&(i=parseInt(i,10),isNaN(i)))throw new Error("The number that was passed in is not a number.");u=f(g)(i)}if(!p)throw new Error("No domain named `"+t+"` could be found.");return!(s=p[l])||u>s.length?(this.options.missing_key_callback&&this.options.missing_key_callback(l,t),a=[n,r],this.options.debug,a[f()(i)]):(a=s[u])||(a=[n,r])[f()(i)]}});var d,g,y=function(){function t(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function e(t,e){for(var n=[];e>0;n[--e]=t);return n.join("")}var n=function(){return n.cache.hasOwnProperty(arguments[0])||(n.cache[arguments[0]]=n.parse(arguments[0])),n.format.call(null,n.cache[arguments[0]],arguments)};return n.format=function(n,r){var i,o,s,a,u,l,c,h=1,f=n.length,p="",d=[];for(o=0;o<f;o++)if("string"===(p=t(n[o])))d.push(n[o]);else if("array"===p){if((a=n[o])[2])for(i=r[h],s=0;s<a[2].length;s++){if(!i.hasOwnProperty(a[2][s]))throw y('[sprintf] property "%s" does not exist',a[2][s]);i=i[a[2][s]]}else i=a[1]?r[a[1]]:r[h++];if(/[^s]/.test(a[8])&&"number"!=t(i))throw y("[sprintf] expecting number but found %s",t(i));switch(null==i&&(i=""),a[8]){case"b":i=i.toString(2);break;case"c":i=String.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=String(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,l=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",c=a[6]-String(i).length,u=a[6]?e(l,c):"",d.push(a[5]?i+u:u+i)}return d.join("")},n.cache={},n.parse=function(t){for(var e=t,n=[],r=[],i=0;e;){if(null!==(n=/^[^\x25]+/.exec(e)))r.push(n[0]);else if(null!==(n=/^\x25{2}/.exec(e)))r.push("%");else{if(null===(n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(e)))throw"[sprintf] huh?";if(n[2]){i|=1;var o=[],s=n[2],a=[];if(null===(a=/^([a-z_][a-z_\d]*)/i.exec(s)))throw"[sprintf] huh?";for(o.push(a[1]);""!==(s=s.substring(a[0].length));)if(null!==(a=/^\.([a-z_][a-z_\d]*)/i.exec(s)))o.push(a[1]);else{if(null===(a=/^\[(\d+)\]/.exec(s)))throw"[sprintf] huh?";o.push(a[1])}n[2]=o}else i|=2;if(3===i)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}e=e.substring(n[0].length)}return r},n}(),m=function(t,e){return e.unshift(t),y.apply(null,e)};h.parse_plural=function(t,e){return t=t.replace(/n/g,e),h.parse_expression(t)},h.sprintf=function(t,e){return"[object Array]"=={}.toString.call(e)?m(t,[].slice.call(e)):y.apply(this,[].slice.call(arguments))},h.prototype.sprintf=function(){return h.sprintf.apply(this,arguments)},(h.PF={}).parse=function(t){var e=h.PF.extractPluralExpr(t);return h.PF.parser.parse.call(h.PF.parser,e)},h.PF.compile=function(t){var e=h.PF.parse(t);return function(t){return!0===(n=h.PF.interpreter(e)(t))?1:n||0;var n}},h.PF.interpreter=function(t){return function(e){switch(t.type){case"GROUP":return h.PF.interpreter(t.expr)(e);case"TERNARY":return h.PF.interpreter(t.expr)(e)?h.PF.interpreter(t.truthy)(e):h.PF.interpreter(t.falsey)(e);case"OR":return h.PF.interpreter(t.left)(e)||h.PF.interpreter(t.right)(e);case"AND":return h.PF.interpreter(t.left)(e)&&h.PF.interpreter(t.right)(e);case"LT":return h.PF.interpreter(t.left)(e)<h.PF.interpreter(t.right)(e);case"GT":return h.PF.interpreter(t.left)(e)>h.PF.interpreter(t.right)(e);case"LTE":return h.PF.interpreter(t.left)(e)<=h.PF.interpreter(t.right)(e);case"GTE":return h.PF.interpreter(t.left)(e)>=h.PF.interpreter(t.right)(e);case"EQ":return h.PF.interpreter(t.left)(e)==h.PF.interpreter(t.right)(e);case"NEQ":return h.PF.interpreter(t.left)(e)!=h.PF.interpreter(t.right)(e);case"MOD":return h.PF.interpreter(t.left)(e)%h.PF.interpreter(t.right)(e);case"VAR":return e;case"NUM":return t.val;default:throw new Error("Invalid Token found.")}}},h.PF.extractPluralExpr=function(t){t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),/;\s*$/.test(t)||(t=t.concat(";"));var e,n=/nplurals\=(\d+);/,r=t.match(n);if(!(r.length>1))throw new Error("nplurals not found in plural_forms string: "+t);if(r[1],!((e=(t=t.replace(n,"")).match(/plural\=(.*);/))&&e.length>1))throw new Error("`plural` expression not found: "+t);return e[1]},h.PF.parser=(d={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,n:19,NUMBER:20,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},productions_:[0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],performAction:function(t,e,n,r,i,o,s){var a=o.length-1;switch(i){case 1:return{type:"GROUP",expr:o[a-1]};case 2:this.$={type:"TERNARY",expr:o[a-4],truthy:o[a-2],falsey:o[a]};break;case 3:this.$={type:"OR",left:o[a-2],right:o[a]};break;case 4:this.$={type:"AND",left:o[a-2],right:o[a]};break;case 5:this.$={type:"LT",left:o[a-2],right:o[a]};break;case 6:this.$={type:"LTE",left:o[a-2],right:o[a]};break;case 7:this.$={type:"GT",left:o[a-2],right:o[a]};break;case 8:this.$={type:"GTE",left:o[a-2],right:o[a]};break;case 9:this.$={type:"NEQ",left:o[a-2],right:o[a]};break;case 10:this.$={type:"EQ",left:o[a-2],right:o[a]};break;case 11:this.$={type:"MOD",left:o[a-2],right:o[a]};break;case 12:this.$={type:"GROUP",expr:o[a-1]};break;case 13:this.$={type:"VAR"};break;case 14:this.$={type:"NUM",val:Number(t)}}},table:[{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],defaultActions:{6:[2,1]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],o=this.table,s="",a=0,u=0,l=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;function h(){var t;return"number"!=typeof(t=e.lexer.lex()||1)&&(t=e.symbols_[t]||t),t}i.push(c),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var f,p,d,g,y,m,x,b,_,v,w={};;){if(d=n[n.length-1],this.defaultActions[d]?g=this.defaultActions[d]:(null==f&&(f=h()),g=o[d]&&o[d][f]),void 0===g||!g.length||!g[0]){if(!l){for(m in _=[],o[d])this.terminals_[m]&&m>2&&_.push("'"+this.terminals_[m]+"'");var P="";P=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+_.join(", ")+", got '"+this.terminals_[f]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(P,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:c,expected:_})}if(3==l){if(1==f)throw new Error(P||"Parsing halted.");u=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,c=this.lexer.yylloc,f=h()}for(;!(2..toString()in o[d]);){if(0==d)throw new Error(P||"Parsing halted.");v=1,n.length=n.length-2*v,r.length=r.length-v,i.length=i.length-v,d=n[n.length-1]}p=f,f=2,g=o[d=n[n.length-1]]&&o[d][2],l=3}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+f);switch(g[0]){case 1:n.push(f),r.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(g[1]),f=null,p?(f=p,p=null):(u=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(x=this.productions_[g[1]][1],w.$=r[r.length-x],w._$={first_line:i[i.length-(x||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(x||1)].first_column,last_column:i[i.length-1].last_column},void 0!==(y=this.performAction.call(w,s,u,a,this.yy,g[1],r,i)))return y;x&&(n=n.slice(0,-1*x*2),r=r.slice(0,-1*x),i=i.slice(0,-1*x)),n.push(this.productions_[g[1]][0]),r.push(w.$),i.push(w._$),b=o[n[n.length-2]][n[n.length-1]],n.push(b);break;case 3:return!0}}return!0}},g=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.match+=t,this.matched+=t,t.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),t},unput:function(t){return this._input=t+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if(t=this._input.match(this.rules[n[r]]))return(e=t[0].match(/\n.*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],this.performAction.call(this,this.yy,this,n[r],this.conditionStack[this.conditionStack.length-1])||void 0;if(""===this._input)return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 20;case 2:return 19;case 3:return 8;case 4:return 9;case 5:return 6;case 6:return 7;case 7:return 11;case 8:return 13;case 9:return 10;case 10:return 12;case 11:return 14;case 12:return 15;case 13:return 16;case 14:return 17;case 15:return 18;case 16:return 5;case 17:return"INVALID"}},rules:[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return t}(),d.lexer=g,d),t.exports&&(e=t.exports=h),e.Jed=h}()},function(t,n){t.exports=e},function(t,e,n){"use strict";n.r(e),n.d(e,"LocalizationObserver",(function(){return y})),n.d(e,"l",(function(){return h})),n.d(e,"nl",(function(){return f})),n.d(e,"sprintf",(function(){return p})),n.d(e,"detectBrowserLanguage",(function(){return u})),n.d(e,"LocaleData",(function(){})),n.d(e,"LanguagesInterface",(function(){})),n.d(e,"getDefaultLocale",(function(){return a})),n.d(e,"Jed",(function(){return i.a})),n.d(e,"I18N",(function(){}));var r=n(2),i=n.n(r),o=n(1),s=n(0);const a=(t="en",e)=>e&&e.locale_data&&e&&e.locale_data.messages?e:{locale_data:{messages:{"":{domain:"messages",lang:t,plural_forms:"nplurals=2; plural=(n != 1);"}}}},u=()=>globalThis.navigator.languages?globalThis.navigator.languages[0]:globalThis.navigator.language;var l=n(3);const c=new i.a({domain:"messages"}),h=(t,e)=>()=>e?c.pgettext(e,t):c.gettext(t),f=(t,e,n,r)=>()=>r?c.npgettext(r,t,e,n):c.ngettext(t,e,n),p=(...t)=>()=>c.sprintf.apply(c,t.map(t=>Object(o.isValidElement)(t)?Object(l.renderToStaticMarkup)(t):"function"==typeof t?t():t));const d={};let g=0;class y extends o.Component{constructor(t){super(t),this.changeLocalization(this.props.currentLanguage)}componentDidUpdate(t){this.props.currentLanguage!==t.currentLanguage&&this.changeLocalization(this.props.currentLanguage)}changeLocalization(t){t=this.props.languages[t]?t:this.props.defaultLanguage;const e=this.props.languages[t]?this.props.languages[t]:a(this.props.defaultLanguage,this.props.defaultLocaleData);this.updateComponents(e,t)}updateComponents(t,e){t&&Object(s.isObject)(t.locale_data)&&Object(s.isObject)(t.locale_data.messages)&&(Object(s.isFunction)(this.props.onChange)&&Object(s.isString)(e)&&this.props.onChange(e),c.options=t,Object.keys(d).forEach(t=>{Object(s.isDefined)(d[t])&&d[t].forceUpdate()}))}render(){return this.props.children}}var m,x,b,_;function v(t,e,n,r){_||(_="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var i=t&&t.defaultProps,o=arguments.length-3;if(e||0===o||(e={children:void 0}),1===o)e.children=r;else if(o>1){for(var s=new Array(o),a=0;a<o;a++)s[a]=arguments[a+3];e.children=s}if(e&&i)for(var u in i)void 0===e[u]&&(e[u]=i[u]);else e||(e=i||{});return{$$typeof:_,type:t,key:void 0===n?null:""+n,ref:null,props:e,_owner:null}}b={currentLanguage:"en",defaultLanguage:"en",languages:{},defaultLocaleData:null},(x="defaultProps")in(m=y)?Object.defineProperty(m,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):m[x]=b;class w extends o.Component{constructor(...t){super(...t),function(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(this,"id",void 0)}componentDidMount(){this.id=g++,d[this.id]=this}componentWillUnmount(){delete d[this.id]}render(){return Object(s.isFunction)(this.props.children)?v("span",{className:"localization-node "+(Object(s.isString)(this.props.className)?this.props.className:""),dangerouslySetInnerHTML:{__html:this.props.children()}}):null}}var P=w;e.default=P}])}));