{"size": 16273, "ext": "js", "max_stars_repo_path": "react-i18next.min.js", "max_stars_repo_name": "a-barbieri/react-i18next", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "react-i18next.min.js", "max_issues_repo_name": "a-barbieri/react-i18next", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "react-i18next.min.js", "max_forks_repo_name": "a-barbieri/react-i18next", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 8136.5, "max_line_length": 16272, "alphanum_fraction": 0.6972285381}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],t):t(e.reactI18next={},e.React,e.PropTypes)}(this,function(e,n,i){"use strict";var O="default"in n?n.default:n;i=i&&i.hasOwnProperty("default")?i.default:i;var c={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},u={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},l=Object.defineProperty,f=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,v=y&&y(Object);var r=function e(t,n,i){if("string"!=typeof n){if(v){var r=y(n);r&&r!==v&&e(t,r,i)}var o=f(n);d&&(o=o.concat(d(n)));for(var a=0;a<o.length;++a){var s=o[a];if(!(c[s]||u[s]||i&&i[s])){var p=h(n,s);try{l(t,s,p)}catch(e){}}}return t}return t},j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(function(){function c(e){this.value=e}function e(r){var o,a;function s(e,t){try{var n=r[e](t),i=n.value;i instanceof c?Promise.resolve(i.value).then(function(e){s("next",e)},function(e){s("throw",e)}):p(n.done?"return":"normal",n.value)}catch(e){p("throw",e)}}function p(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}(o=o.next)?s(o.key,o.arg):a=null}this._invoke=function(i,r){return new Promise(function(e,t){var n={key:i,arg:r,resolve:e,reject:t,next:null};a?a=a.next=n:(o=a=n,s(i,r))})},"function"!=typeof r.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(e){return this._invoke("next",e)},e.prototype.throw=function(e){return this._invoke("throw",e)},e.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),m=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},g=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},x=function(e,t){var n={};for(var i in e)0<=t.indexOf(i)||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},b=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},S=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},I=Object.prototype.hasOwnProperty;function k(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}var t={wait:!1,withRef:!1,bindI18n:"languageChanged loaded",bindStore:"added removed",translateFuncName:"t",nsMode:"default",usePureComponent:!1,omitBoundRerender:!0},o=void 0;function a(e){t=w({},t,e)}function P(){return t}function s(e){o=e}function T(){return o}var _={type:"3rdParty",init:function(e){a(e.options.react),s(e)}},C=!1,N=function(e){function a(e,t){p(this,a);var n=b(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));n.i18n=e.i18n||t.i18n||T(),n.namespaces=e.ns||n.i18n.options&&n.i18n.options.defaultNS,"string"==typeof n.namespaces&&(n.namespaces=[n.namespaces]);var i=n.i18n&&n.i18n.options&&n.i18n.options.react||{};n.options=w({},P(),i,e),e.initialI18nStore&&(n.i18n.services.resourceStore.data=e.initialI18nStore,n.options.wait=!1),e.initialLanguage&&n.i18n.changeLanguage(e.initialLanguage),n.i18n.options&&n.i18n.options.isInitialSSR&&(n.options.wait=!1);var r=n.i18n.languages&&n.i18n.languages[0],o=!!r&&n.namespaces.every(function(e){return n.i18n.hasResourceBundle(r,e)});return n.state={i18nLoadedAt:null,ready:o},n.t=n.getI18nTranslate(),n.onI18nChanged=n.onI18nChanged.bind(n),n.getI18nTranslate=n.getI18nTranslate.bind(n),n}return g(a,e),m(a,[{key:"getChildContext",value:function(){return{t:this.t,i18n:this.i18n}}},{key:"componentDidMount",value:function(){var n=this,e=function(){n.options.bindI18n&&n.i18n&&n.i18n.on(n.options.bindI18n,n.onI18nChanged),n.options.bindStore&&n.i18n.store&&n.i18n.store.on(n.options.bindStore,n.onI18nChanged)};this.mounted=!0,this.i18n.loadNamespaces(this.namespaces,function(){var t=function(){n.mounted&&!n.state.ready&&n.setState({ready:!0}),n.options.wait&&n.mounted&&e()};if(n.i18n.isInitialized)t();else{n.i18n.on("initialized",function e(){setTimeout(function(){n.i18n.off("initialized",e)},1e3),t()})}}),this.options.wait||e()}},{key:"componentWillUnmount",value:function(){var t=this;if(this.mounted=!1,this.onI18nChanged){if(this.options.bindI18n)this.options.bindI18n.split(" ").forEach(function(e){return t.i18n.off(e,t.onI18nChanged)});if(this.options.bindStore)this.options.bindStore.split(" ").forEach(function(e){return t.i18n.store&&t.i18n.store.off(e,t.onI18nChanged)})}}},{key:"onI18nChanged",value:function(){this.mounted&&(!this.state.ready&&this.options.omitBoundRerender||(this.t=this.getI18nTranslate(),this.setState({i18nLoadedAt:new Date})))}},{key:"getI18nTranslate",value:function(){return this.i18n.getFixedT(null,"fallback"===this.options.nsMode?this.namespaces:this.namespaces[0])}},{key:"render",value:function(){var e=this,t=this.props.children,n=this.state.ready;return!n&&this.options.wait?null:(this.i18n.options&&this.i18n.options.isInitialSSR&&!C&&(C=!0,setTimeout(function(){delete e.i18n.options.isInitialSSR},100)),t(this.t,{i18n:this.i18n,t:this.t,ready:n}))}}]),a}(n.Component);function E(o){var s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return function(a){var e,t=function(e){function r(e,t){p(this,r);var n=b(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));n.i18n=e.i18n||s.i18n||t.i18n||T(),n.namespaces="function"==typeof o?o(e):o||t.defaultNS||n.i18n.options&&n.i18n.options.defaultNS,"string"==typeof n.namespaces&&(n.namespaces=[n.namespaces]);var i=n.i18n&&n.i18n.options&&n.i18n.options.react||{};return n.options=w({},P(),i,s),n.getWrappedInstance=n.getWrappedInstance.bind(n),n}return g(r,e),m(r,[{key:"shouldComponentUpdate",value:function(e){return!this.options.usePureComponent||!function(e,t){if(k(e,t))return!0;if("object"!==(void 0===e?"undefined":j(e))||null===e||"object"!==(void 0===t?"undefined":j(t))||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++)if(!I.call(t,n[r])||!k(e[n[r]],t[n[r]]))return!1;return!0}(this.props,e)}},{key:"getWrappedInstance",value:function(){return this.options.withRef||console.error("To access the wrapped instance, you need to specify { withRef: true } as the second argument of the translate() call."),this.wrappedInstance}},{key:"render",value:function(){var r=this,o={};return this.options.withRef&&(o.ref=function(e){r.wrappedInstance=e}),O.createElement(N,w({ns:this.namespaces},this.options,this.props,{i18n:this.i18n}),function(e,t){var n=t.ready,i=x(t,["ready"]);return O.createElement(a,w({tReady:n},r.props,o,i))})}}]),r}(n.Component);return t.WrappedComponent=a,t.contextTypes={i18n:i.object,defaultNS:i.string},t.displayName="Translate("+((e=a).displayName||e.name||"Component")+")",t.namespaces=o,r(t,a)}}N.contextTypes={i18n:i.object},N.childContextTypes={t:i.func.isRequired,i18n:i.object},E.setDefaults=a,E.setI18n=s;var R=function(e){function i(e,t){p(this,i);var n=b(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));return n.i18n=e.i18n||t.i18n,n.t=e.t||t.t,n}return g(i,e),m(i,[{key:"render",value:function(){var o=this,e=this.props.parent||"span",t=this.props.regexp||this.i18n.services.interpolator.regexp,n=this.props,i=n.className,r=n.style,a=this.props.useDangerouslySetInnerHTML||!1,s=this.props.dangerouslySetInnerHTMLPartElement||"span",p=w({},this.props.options,{interpolation:{prefix:"#$?",suffix:"?$#"}}),c=this.t(this.props.i18nKey,p);if(!c||"string"!=typeof c)return O.createElement("noscript",null);var u=[];c.split(t).reduce(function(e,t,n){var i=void 0;if(n%2==0){if(0===t.length)return e;i=a?O.createElement(s,{dangerouslySetInnerHTML:{__html:t}}):t}else i=function(e,t){if(e.indexOf(o.i18n.options.interpolation.formatSeparator)<0)return void 0===t[e]&&o.i18n.services.logger.warn("interpolator: missed to pass in variable "+e+" for interpolating "+c),t[e];var n=e.split(o.i18n.options.interpolation.formatSeparator),i=n.shift().trim(),r=n.join(o.i18n.options.interpolation.formatSeparator).trim();return void 0===t[i]&&o.i18n.services.logger.warn("interpolator: missed to pass in variable "+i+" for interpolating "+c),o.i18n.options.interpolation.format(t[i],r,o.i18n.language)}(t,o.props);return e.push(i),e},u);var l={};if(this.i18n.options.react&&this.i18n.options.react.exposeNamespace){var f="string"==typeof this.t.ns?this.t.ns:this.t.ns[0];if(this.props.i18nKey&&this.i18n.options.nsSeparator&&-1<this.props.i18nKey.indexOf(this.i18n.options.nsSeparator))f=this.props.i18nKey.split(this.i18n.options.nsSeparator)[0];this.t.ns&&(l["data-i18next-options"]=JSON.stringify({ns:f}))}return i&&(l.className=i),r&&(l.style=r),O.createElement.apply(this,[e,l].concat(u))}}]),i}(n.Component);R.propTypes={className:i.string},R.defaultProps={className:""},R.contextTypes={i18n:i.object.isRequired,t:i.func.isRequired};var A={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},L=/([\w-]+)|=|(['"])([.\s\S]*?)\2/g,D=/(?:<!--[\S\s]*?-->|<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)/g,W=Object.create?Object.create(null):{};function q(e,t,n,i,r){var o=t.indexOf("<",i),a=t.slice(i,-1===o?void 0:o);/^\s*$/.test(a)&&(a=" "),(!r&&-1<o&&0<=n+e.length||" "!==a)&&e.push({type:"text",content:a})}var K=function(f,d){d||(d={}),d.components||(d.components=W);var h,y=[],v=-1,m=[],g=!1;return f.replace(D,function(e,t){if(g){if(e!=="</"+h.name+">")return;g=!1}var n,i,r,o,a,s,p="/"!==e.charAt(1),c=0===e.indexOf("\x3c!--"),u=t+e.length,l=f.charAt(u);p&&!c&&(v++,s={type:"tag",name:"",voidElement:!(a=!(o=0)),attrs:{},children:[]},(i=e).replace(L,function(e){if("="===e)return a=!0,void o++;a?0===o?((A[e]||"/"===i.charAt(i.length-2))&&(s.voidElement=!0),s.name=e):(s.attrs[r]=e.replace(/^['"]|['"]$/g,""),r=void 0):(r&&(s.attrs[r]=r),r=e),o++,a=!1}),"tag"===(h=s).type&&d.components[h.name]&&(h.type="component",g=!0),h.voidElement||g||!l||"<"===l||q(h.children,f,v,u,d.ignoreWhitespace),0===v&&y.push(h),(n=m[v-1])&&n.children.push(h),m[v]=h),(c||!p||h.voidElement)&&(c||v--,!g&&"<"!==l&&l&&q(n=-1===v?y:m[v].children,f,v,u,d.ignoreWhitespace))}),!y.length&&f.length&&q(y,f,0,0,d.ignoreWhitespace),y};function M(e){return e&&(e.children||e.props&&e.props.children)}function $(e){return e&&e.children?e.children:e.props&&e.props.children}function z(e,t,c){if(""===t)return[];if(!e)return[t];return $(function s(p,e){return"[object Array]"!==Object.prototype.toString.call(p)&&(p=[p]),"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),e.reduce(function(e,t,n){if("tag"===t.type){var i=p[parseInt(t.name,10)]||{},r=O.isValidElement(i);if("string"==typeof i)e.push(i);else if(M(i)){var o=s($(i),t.children);i.dummy&&(i.children=o),e.push(O.cloneElement(i,w({},i.props,{key:n}),o))}else if("object"!==(void 0===i?"undefined":j(i))||r)e.push(i);else if(t.children[0]&&t.children[0].content){var a=c.services.interpolator.interpolate(t.children[0].content,i,c.language);e.push(a)}}else"text"===t.type&&e.push(t.content);return e},[])}([{dummy:!0,children:e}],K("<0>"+t+"</0>"))[0])}var B=function(e){function t(){return p(this,t),b(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return g(t,e),m(t,[{key:"render",value:function(){var e=w({i18n:this.context.i18n,t:this.context.t},this.props),t=e.children,n=e.count,i=e.parent,r=e.i18nKey,o=e.tOptions,a=e.values,s=e.defaults,p=e.components,c=e.ns,u=e.i18n,l=e.t,f=x(e,["children","count","parent","i18nKey","tOptions","values","defaults","components","ns","i18n","t"]),d=l||u.t.bind(u),h=u.options&&u.options.react||{},y=void 0!==i?i:h.defaultTransParent,v=s||function a(s,e,t){return e?("[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),e.forEach(function(e,t){var n=""+t;if("string"==typeof e)s=""+s+e;else if(M(e))s=s+"<"+n+">"+a("",$(e),t+1)+"</"+n+">";else if(O.isValidElement(e))s=s+"<"+n+"></"+n+">";else if("object"===(void 0===e?"undefined":j(e))){var i=w({},e),r=i.format;delete i.format;var o=Object.keys(i);r&&1===o.length?s=s+"<"+n+">{{"+o[0]+", "+r+"}}</"+n+">":1===o.length?s=s+"<"+n+">{{"+o[0]+"}}</"+n+">":console&&console.warn&&console.warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else console&&console.warn&&console.warn("react-i18next: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)}),s):""}("",t),m=h.hashTransKey,g=r||(m?m(v):v),b=g?d(g,w({},o,a,a?{}:{interpolation:{prefix:"#$?",suffix:"?$#"}},{defaultValue:v,count:n,ns:c})):v;if(h.exposeNamespace){var S="string"==typeof d.ns?d.ns:d.ns[0];if(r&&u.options&&u.options.nsSeparator&&-1<r.indexOf(u.options.nsSeparator))S=r.split(u.options.nsSeparator)[0];d.ns&&(f["data-i18next-options"]=JSON.stringify({ns:S}))}return y?O.createElement(y,f,z(p||t,b,u)):z(p||t,b,u)}}]),t}(O.Component);B.propTypes={count:i.number,parent:i.oneOfType([i.node,i.func]),i18nKey:i.string,i18n:i.object,t:i.func},B.contextTypes={i18n:i.object,t:i.func};var F=function(e){function i(e,t){p(this,i);var n=b(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));return n.i18n=e.i18n,n.defaultNS=e.defaultNS,e.initialI18nStore&&(n.i18n.services.resourceStore.data=e.initialI18nStore,n.i18n.options.isInitialSSR=!0),e.initialLanguage&&n.i18n.changeLanguage(e.initialLanguage),n}return g(i,e),m(i,[{key:"getChildContext",value:function(){return{i18n:this.i18n,defaultNS:this.defaultNS}}},{key:"componentWillReceiveProps",value:function(e){if(this.props.i18n!==e.i18n)throw new Error("[react-i18next][I18nextProvider]does not support changing the i18n object.")}},{key:"render",value:function(){var e=this.props.children;return n.Children.only(e)}}]),i}(n.Component);F.propTypes={i18n:i.object.isRequired,children:i.element.isRequired,defaultNS:i.string},F.childContextTypes={i18n:i.object.isRequired,defaultNS:i.string},F.defaultProps={defaultNS:void 0};var H=Object.entries||function(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i};function V(e){var t=[];return function(e,t){for(var n=0,i=e.length;n<i;n++)if("object"===j(e[n])){var r=!0,o=!1,a=void 0;try{for(var s,p=H(e[n])[Symbol.iterator]();!(r=(s=p.next()).done);r=!0){var c=S(s.value,2),u=c[0];t(c[1],n,u)}}catch(e){o=!0,a=e}finally{try{!r&&p.return&&p.return()}finally{if(o)throw a}}}else t(e[n],n)}(e,function(e){e&&e.namespaces&&e.namespaces.forEach(function(e){-1===t.indexOf(e)&&t.push(e)})}),t}e.translate=E,e.I18n=N,e.Interpolate=R,e.Trans=B,e.I18nextProvider=F,e.loadNamespaces=function(e){var t=e.components,n=e.i18n,i=V(t);return new Promise(function(e){n.loadNamespaces(i,e)})},e.reactI18nextModule=_,e.setDefaults=a,e.getDefaults=P,e.setI18n=s,e.getI18n=T,Object.defineProperty(e,"__esModule",{value:!0})});
