react-i18next 11.17.2 → 11.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 11.17.3
2
+
3
+ - style: explicit React imports [1525](https://github.com/i18next/react-i18next/pull/1525)
4
+
1
5
  ### 11.17.2
2
6
 
3
7
  - reset t if ns changes in useTranslation [1518](https://github.com/i18next/react-i18next/pull/1518)
@@ -1,6 +1,4 @@
1
- define(['exports', 'react'], function (exports, React) { 'use strict';
2
-
3
- var React__default = 'default' in React ? React['default'] : React;
1
+ define(['exports', 'react'], function (exports, react) { 'use strict';
4
2
 
5
3
  function ownKeys(object, enumerableOnly) {
6
4
  var keys = Object.keys(object);
@@ -348,7 +346,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
348
346
  useSuspense: true
349
347
  };
350
348
  var i18nInstance;
351
- var I18nContext = React__default.createContext();
349
+ var I18nContext = react.createContext();
352
350
  function setDefaults() {
353
351
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
354
352
  defaultOptions = _objectSpread2(_objectSpread2({}, defaultOptions), options);
@@ -526,7 +524,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
526
524
  function hasValidReactChildren(children) {
527
525
  if (Object.prototype.toString.call(children) !== '[object Array]') return false;
528
526
  return children.every(function (child) {
529
- return React__default.isValidElement(child);
527
+ return react.isValidElement(child);
530
528
  });
531
529
  }
532
530
 
@@ -549,7 +547,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
549
547
  childrenArray.forEach(function (child, childIndex) {
550
548
  if (typeof child === 'string') {
551
549
  stringNode += "".concat(child);
552
- } else if (React__default.isValidElement(child)) {
550
+ } else if (react.isValidElement(child)) {
553
551
  var childPropsCount = Object.keys(child.props).length;
554
552
  var shouldKeepChild = keepArray.indexOf(child.type) > -1;
555
553
  var childChildren = child.props.children;
@@ -598,7 +596,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
598
596
  var childrenArray = getAsArray(childs);
599
597
  childrenArray.forEach(function (child) {
600
598
  if (typeof child === 'string') return;
601
- if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !React__default.isValidElement(child)) Object.assign(data, child);
599
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !react.isValidElement(child)) Object.assign(data, child);
602
600
  });
603
601
  }
604
602
 
@@ -615,7 +613,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
615
613
 
616
614
  function pushTranslatedJSX(child, inner, mem, i, isVoid) {
617
615
  if (child.dummy) child.children = inner;
618
- mem.push(React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
616
+ mem.push(react.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
619
617
  key: i
620
618
  }), isVoid ? undefined : inner));
621
619
  }
@@ -633,7 +631,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
633
631
  var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
634
632
  props: node.attrs
635
633
  }, tmp) : tmp;
636
- var isElement = React__default.isValidElement(child);
634
+ var isElement = react.isValidElement(child);
637
635
  var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
638
636
  var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
639
637
  var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
@@ -647,7 +645,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
647
645
  } else if (isEmptyTransWithHTML) {
648
646
  var _inner = mapAST(reactNodes, node.children, rootReactNode);
649
647
 
650
- mem.push(React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
648
+ mem.push(react.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
651
649
  key: i
652
650
  }), _inner));
653
651
  } else if (Number.isNaN(parseFloat(node.name))) {
@@ -657,13 +655,13 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
657
655
  pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
658
656
  } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
659
657
  if (node.voidElement) {
660
- mem.push(React__default.createElement(node.name, {
658
+ mem.push(react.createElement(node.name, {
661
659
  key: "".concat(node.name, "-").concat(i)
662
660
  }));
663
661
  } else {
664
662
  var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
665
663
 
666
- mem.push(React__default.createElement(node.name, {
664
+ mem.push(react.createElement(node.name, {
667
665
  key: "".concat(node.name, "-").concat(i)
668
666
  }, _inner3));
669
667
  }
@@ -678,11 +676,11 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
678
676
  var content = node.children[0] ? translationContent : null;
679
677
  if (content) mem.push(content);
680
678
  } else if (node.children.length === 1 && translationContent) {
681
- mem.push(React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
679
+ mem.push(react.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
682
680
  key: i
683
681
  }), translationContent));
684
682
  } else {
685
- mem.push(React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
683
+ mem.push(react.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
686
684
  key: i
687
685
  })));
688
686
  }
@@ -692,7 +690,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
692
690
  var _content = shouldUnescape ? unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
693
691
 
694
692
  if (wrapTextNodes) {
695
- mem.push(React__default.createElement(wrapTextNodes, {
693
+ mem.push(react.createElement(wrapTextNodes, {
696
694
  key: "".concat(node.name, "-").concat(i)
697
695
  }, _content));
698
696
  } else {
@@ -728,7 +726,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
728
726
  shouldUnescape = _ref.shouldUnescape,
729
727
  additionalProps = _objectWithoutProperties(_ref, _excluded2);
730
728
 
731
- var _ref2 = React.useContext(I18nContext) || {},
729
+ var _ref2 = react.useContext(I18nContext) || {},
732
730
  i18nFromContext = _ref2.i18n,
733
731
  defaultNSFromContext = _ref2.defaultNS;
734
732
 
@@ -769,12 +767,12 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
769
767
  var translation = key ? t(key, combinedTOpts) : defaultValue;
770
768
  var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
771
769
  var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
772
- return useAsParent ? React__default.createElement(useAsParent, additionalProps, content) : content;
770
+ return useAsParent ? react.createElement(useAsParent, additionalProps, content) : content;
773
771
  }
774
772
 
775
773
  var usePrevious = function usePrevious(value, ignore) {
776
- var ref = React.useRef();
777
- React.useEffect(function () {
774
+ var ref = react.useRef();
775
+ react.useEffect(function () {
778
776
  ref.current = ignore ? ref.current : value;
779
777
  }, [value, ignore]);
780
778
  return ref.current;
@@ -784,7 +782,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
784
782
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
785
783
  var i18nFromProps = props.i18n;
786
784
 
787
- var _ref = React.useContext(I18nContext) || {},
785
+ var _ref = react.useContext(I18nContext) || {},
788
786
  i18nFromContext = _ref.i18n,
789
787
  defaultNSFromContext = _ref.defaultNS;
790
788
 
@@ -822,15 +820,15 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
822
820
  return i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
823
821
  }
824
822
 
825
- var _useState = React.useState(getT),
823
+ var _useState = react.useState(getT),
826
824
  _useState2 = _slicedToArray(_useState, 2),
827
825
  t = _useState2[0],
828
826
  setT = _useState2[1];
829
827
 
830
828
  var joinedNS = namespaces.join();
831
829
  var previousJoinedNS = usePrevious(joinedNS);
832
- var isMounted = React.useRef(true);
833
- React.useEffect(function () {
830
+ var isMounted = react.useRef(true);
831
+ react.useEffect(function () {
834
832
  var bindI18n = i18nOptions.bindI18n,
835
833
  bindI18nStore = i18nOptions.bindI18nStore;
836
834
  isMounted.current = true;
@@ -861,8 +859,8 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
861
859
  });
862
860
  };
863
861
  }, [i18n, joinedNS]);
864
- var isInitial = React.useRef(true);
865
- React.useEffect(function () {
862
+ var isInitial = react.useRef(true);
863
+ react.useEffect(function () {
866
864
  if (isMounted.current && !isInitial.current) {
867
865
  setT(getT);
868
866
  }
@@ -910,19 +908,19 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
910
908
  passDownProps.forwardedRef = forwardedRef;
911
909
  }
912
910
 
913
- return React__default.createElement(WrappedComponent, passDownProps);
911
+ return react.createElement(WrappedComponent, passDownProps);
914
912
  }
915
913
 
916
914
  I18nextWithTranslation.displayName = "withI18nextTranslation(".concat(getDisplayName(WrappedComponent), ")");
917
915
  I18nextWithTranslation.WrappedComponent = WrappedComponent;
918
916
 
919
917
  var forwardRef = function forwardRef(props, ref) {
920
- return React__default.createElement(I18nextWithTranslation, Object.assign({}, props, {
918
+ return react.createElement(I18nextWithTranslation, Object.assign({}, props, {
921
919
  forwardedRef: ref
922
920
  }));
923
921
  };
924
922
 
925
- return options.withRef ? React__default.forwardRef(forwardRef) : I18nextWithTranslation;
923
+ return options.withRef ? react.forwardRef(forwardRef) : I18nextWithTranslation;
926
924
  };
927
925
  }
928
926
 
@@ -948,13 +946,13 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
948
946
  var i18n = _ref.i18n,
949
947
  defaultNS = _ref.defaultNS,
950
948
  children = _ref.children;
951
- var value = React.useMemo(function () {
949
+ var value = react.useMemo(function () {
952
950
  return {
953
951
  i18n: i18n,
954
952
  defaultNS: defaultNS
955
953
  };
956
954
  }, [i18n, defaultNS]);
957
- return React.createElement(I18nContext.Provider, {
955
+ return react.createElement(I18nContext.Provider, {
958
956
  value: value
959
957
  }, children);
960
958
  }
@@ -963,7 +961,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
963
961
  var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
964
962
  var i18nFromProps = props.i18n;
965
963
 
966
- var _ref = React.useContext(I18nContext) || {},
964
+ var _ref = react.useContext(I18nContext) || {},
967
965
  i18nFromContext = _ref.i18n;
968
966
 
969
967
  var i18n = i18nFromProps || i18nFromContext || getI18n();
@@ -996,7 +994,7 @@ define(['exports', 'react'], function (exports, React) { 'use strict';
996
994
  rest = _objectWithoutProperties(_ref, _excluded$3);
997
995
 
998
996
  useSSR(initialI18nStore, initialLanguage);
999
- return React__default.createElement(WrappedComponent, _objectSpread2({}, rest));
997
+ return react.createElement(WrappedComponent, _objectSpread2({}, rest));
1000
998
  }
1001
999
 
1002
1000
  I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);
@@ -1 +1 @@
1
- define(["exports","react"],(function(e,n){"use strict";var t="default"in n?n.default:n;function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?r(Object(t),!0).forEach((function(n){c(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function i(e){return(i="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})(e)}function o(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function u(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==t)return;var r,a,i=[],o=!0,c=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(c)throw a}}return i}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var f={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},p=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function d(e){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=e.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(f[t[1]]||"/"===e.charAt(e.length-2))&&(n.voidElement=!0),n.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var a=new RegExp(p),i=null;null!==(i=a.exec(e));)if(i[0].trim())if(i[1]){var o=i[1].trim(),c=[o,""];o.indexOf("=")>-1&&(c=o.split("=")),n.attrs[c[0]]=c[1],a.lastIndex--}else i[2]&&(n.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return n}var g=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,m=/^\s*$/,h=Object.create(null);var v=function(e,n){n||(n={}),n.components||(n.components=h);var t,r=[],a=[],i=-1,o=!1;if(0!==e.indexOf("<")){var c=e.indexOf("<");r.push({type:"text",content:-1===c?e:e.substring(0,c)})}return e.replace(g,(function(c,s){if(o){if(c!=="</"+t.name+">")return;o=!1}var u,l="/"!==c.charAt(1),f=c.startsWith("\x3c!--"),p=s+c.length,g=e.charAt(p);if(f){var h=d(c);return i<0?(r.push(h),r):((u=a[i]).children.push(h),r)}if(l&&(i++,"tag"===(t=d(c)).type&&n.components[t.name]&&(t.type="component",o=!0),t.voidElement||o||!g||"<"===g||t.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===i&&r.push(t),(u=a[i-1])&&u.children.push(t),a[i]=t),(!l||t.voidElement)&&(i>-1&&(t.voidElement||t.name===c.slice(2,-1))&&(i--,t=-1===i?r:a[i]),!o&&"<"!==g&&g)){u=-1===i?r:a[i].children;var v=e.indexOf("<",p),y=e.slice(p,-1===v?void 0:v);m.test(y)&&(y=" "),(v>-1&&i+u.length>=0||" "!==y)&&u.push({type:"text",content:y})}})),r},y="".replace,b=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,O={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"'};function x(e){return O[e]}var w,E={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},S=t.createContext();function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};E=a(a({},E),e)}function N(){return E}var k=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var n,t,r;return n=e,(t=[{key:"addUsedNamespaces",value:function(e){var n=this;e.forEach((function(e){n.usedNamespaces[e]||(n.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&o(n.prototype,t),r&&o(n,r),e}();function I(e){w=e}function P(){return w}var C={type:"3rdParty",init:function(e){j(e.options.react),I(e)}};function R(e){return function(n){return new Promise((function(t){var r=T();e.getInitialProps?e.getInitialProps(n).then((function(e){t(a(a({},e),r))})):t(r)}))}}function T(){var e=P(),n=e.reportNamespaces?e.reportNamespaces.getUsedNamespaces():[],t={},r={};return e.languages.forEach((function(t){r[t]={},n.forEach((function(n){r[t][n]=e.getResourceBundle(t,n)||{}}))})),t.initialI18nStore=r,t.initialLanguage=e.language,t}function A(){if(console&&console.warn){for(var e,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];"string"==typeof t[0]&&(t[0]="react-i18next:: ".concat(t[0])),(e=console).warn.apply(e,t)}}var L={};function z(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];"string"==typeof n[0]&&L[n[0]]||("string"==typeof n[0]&&(L[n[0]]=new Date),A.apply(void 0,n))}function B(e,n,t){e.loadNamespaces(n,(function(){if(e.isInitialized)t();else{e.on("initialized",(function n(){setTimeout((function(){e.off("initialized",n)}),0),t()}))}}))}function U(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.languages[0],a=!!n.options&&n.options.fallbackLng,i=n.languages[n.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,t){var r=n.services.backendConnector.state["".concat(e,"|").concat(t)];return-1===r||2===r};return!(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,e))&&(!!n.hasResourceBundle(r,e)||(!(n.services.backendConnector.backend&&(!n.options.resources||n.options.partialBundledLanguages))||!(!o(r,e)||a&&!o(i,e))))}function D(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.languages||!n.languages.length)return z("i18n.languages were undefined or empty",n.languages),!0;var r=void 0!==n.options.ignoreJSONStructure;return r?n.hasLoadedNamespace(e,{precheck:function(n,r){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!r(n.isLanguageChangingTo,e))return!1}}):U(e,n,t)}function H(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}var K=["format"],V=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function F(e,n){if(!e)return!1;var t=e.props?e.props.children:e.children;return n?t.length>0:!!t}function W(e){return e?e&&e.children?e.children:e.props&&e.props.children:[]}function M(e){return Array.isArray(e)?e:[e]}function $(e,n,r,o,c,s){if(""===n)return[];var u=o.transKeepBasicHtmlNodesFor||[],l=n&&new RegExp(u.join("|")).test(n);if(!e&&!l)return[n];var f={};!function e(n){M(n).forEach((function(n){"string"!=typeof n&&(F(n)?e(W(n)):"object"!==i(n)||t.isValidElement(n)||Object.assign(f,n))}))}(e);var p=v("<0>".concat(n,"</0>")),d=a(a({},f),c);function g(e,n,r){var a=W(e),i=h(a,n.children,r);return function(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every((function(e){return t.isValidElement(e)}))}(a)&&0===i.length?a:i}function m(e,n,r,i,o){e.dummy&&(e.children=n),r.push(t.cloneElement(e,a(a({},e.props),{},{key:i}),o?void 0:n))}function h(n,c,f){var p=M(n);return M(c).reduce((function(n,c,v){var O,w,E,S,j=c.children&&c.children[0]&&c.children[0].content&&r.services.interpolator.interpolate(c.children[0].content,d,r.language);if("tag"===c.type){var N=p[parseInt(c.name,10)];!N&&1===f.length&&f[0][c.name]&&(N=f[0][c.name]),N||(N={});var k=0!==Object.keys(c.attrs).length?(w={props:c.attrs},(S=a({},E=N)).props=Object.assign(w.props,E.props),S):N,I=t.isValidElement(k),P=I&&F(c,!0)&&!c.voidElement,C=l&&"object"===i(k)&&k.dummy&&!I,R="object"===i(e)&&null!==e&&Object.hasOwnProperty.call(e,c.name);if("string"==typeof k){var T=r.services.interpolator.interpolate(k,d,r.language);n.push(T)}else if(F(k)||P){m(k,g(k,c,f),n,v)}else if(C){var A=h(p,c.children,f);n.push(t.cloneElement(k,a(a({},k.props),{},{key:v}),A))}else if(Number.isNaN(parseFloat(c.name))){if(R)m(k,g(k,c,f),n,v,c.voidElement);else if(o.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)n.push(t.createElement(c.name,{key:"".concat(c.name,"-").concat(v)}));else{var L=h(p,c.children,f);n.push(t.createElement(c.name,{key:"".concat(c.name,"-").concat(v)},L))}else if(c.voidElement)n.push("<".concat(c.name," />"));else{var z=h(p,c.children,f);n.push("<".concat(c.name,">").concat(z,"</").concat(c.name,">"))}}else if("object"!==i(k)||I)1===c.children.length&&j?n.push(t.cloneElement(k,a(a({},k.props),{},{key:v}),j)):n.push(t.cloneElement(k,a(a({},k.props),{},{key:v})));else{var B=c.children[0]?j:null;B&&n.push(B)}}else if("text"===c.type){var U=o.transWrapTextNodes,D=s?(O=r.services.interpolator.interpolate(c.content,d,r.language),y.call(O,b,x)):r.services.interpolator.interpolate(c.content,d,r.language);U?n.push(t.createElement(U,{key:"".concat(c.name,"-").concat(v)},D)):n.push(D)}return n}),[])}return W(h([{dummy:!0,children:e||[]}],p,M(e||[]))[0])}var q=function(e,t){var r=n.useRef();return n.useEffect((function(){r.current=t?r.current:e}),[e,t]),r.current};function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.i18n,i=n.useContext(S)||{},o=i.i18n,c=i.defaultNS,s=r||o||P();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new k),!s){z("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},f=[l,{},!1];return f.t=l,f.i18n={},f.ready=!1,f}s.options.react&&void 0!==s.options.react.wait&&z("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var p=a(a(a({},N()),s.options.react),t),d=p.useSuspense,g=p.keyPrefix,m=e||c||s.options&&s.options.defaultNS;m="string"==typeof m?[m]:m||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(m);var h=(s.isInitialized||s.initializedStoreOnce)&&m.every((function(e){return D(e,s,p)}));function v(){return s.getFixedT(null,"fallback"===p.nsMode?m:m[0],g)}var y=n.useState(v),b=u(y,2),O=b[0],x=b[1],w=m.join(),E=q(w),j=n.useRef(!0);n.useEffect((function(){var e=p.bindI18n,n=p.bindI18nStore;function t(){j.current&&x(v)}return j.current=!0,h||d||B(s,m,(function(){j.current&&x(v)})),h&&E&&E!==w&&j.current&&x(v),e&&s&&s.on(e,t),n&&s&&s.store.on(n,t),function(){j.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,t)})),n&&s&&n.split(" ").forEach((function(e){return s.store.off(e,t)}))}}),[s,w]);var I=n.useRef(!0);n.useEffect((function(){j.current&&!I.current&&x(v),I.current=!1}),[s]);var C=[O,s,h];if(C.t=O,C.i18n=s,C.ready=h,h)return C;if(!h&&!d)return C;throw new Promise((function(e){B(s,m,(function(){e()}))}))}var _=["forwardedRef"];var J=["ns","children"];function Z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.i18n,i=n.useContext(S)||{},o=i.i18n,c=a||o||P();c.options&&c.options.isClone||(e&&!c.initializedStoreOnce&&(c.services.resourceStore.data=e,c.options.ns=Object.values(e).reduce((function(e,n){return Object.keys(n).forEach((function(n){e.indexOf(n)<0&&e.push(n)})),e}),c.options.ns),c.initializedStoreOnce=!0,c.isInitialized=!0),t&&!c.initializedLanguageOnce&&(c.changeLanguage(t),c.initializedLanguageOnce=!0))}var G=["initialI18nStore","initialLanguage"];e.I18nContext=S,e.I18nextProvider=function(e){var t=e.i18n,r=e.defaultNS,a=e.children,i=n.useMemo((function(){return{i18n:t,defaultNS:r}}),[t,r]);return n.createElement(S.Provider,{value:i},a)},e.Trans=function(e){var r=e.children,o=e.count,c=e.parent,u=e.i18nKey,l=e.context,f=e.tOptions,p=void 0===f?{}:f,d=e.values,g=e.defaults,m=e.components,h=e.ns,v=e.i18n,y=e.t,b=e.shouldUnescape,O=s(e,V),x=n.useContext(S)||{},w=x.i18n,E=x.defaultNS,j=v||w||P();if(!j)return z("You will need to pass in an i18next instance by using i18nextReactModule"),r;var k=y||j.t.bind(j)||function(e){return e};l&&(p.context=l);var I=a(a({},N()),j.options&&j.options.react),C=h||k.ns||E||j.options&&j.options.defaultNS;C="string"==typeof C?[C]:C||["translation"];var R=g||function e(n,r){if(!n)return"";var a="",o=M(n),c=r.transSupportBasicHtmlNodes&&r.transKeepBasicHtmlNodesFor?r.transKeepBasicHtmlNodesFor:[];return o.forEach((function(n,o){if("string"==typeof n)a+="".concat(n);else if(t.isValidElement(n)){var u=Object.keys(n.props).length,l=c.indexOf(n.type)>-1,f=n.props.children;if(!f&&l&&0===u)a+="<".concat(n.type,"/>");else if(f||l&&0===u)if(n.props.i18nIsDynamicList)a+="<".concat(o,"></").concat(o,">");else if(l&&1===u&&"string"==typeof f)a+="<".concat(n.type,">").concat(f,"</").concat(n.type,">");else{var p=e(f,r);a+="<".concat(o,">").concat(p,"</").concat(o,">")}else a+="<".concat(o,"></").concat(o,">")}else if(null===n)A("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===i(n)){var d=n.format,g=s(n,K),m=Object.keys(g);if(1===m.length){var h=d?"".concat(m[0],", ").concat(d):m[0];a+="{{".concat(h,"}}")}else A("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",n)}else A("Trans: 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}}.",n)})),a}(r,I)||I.transEmptyNodeValue||u,T=I.hashTransKey,L=u||(T?T(R):R),B=d?p.interpolation:{interpolation:a(a({},p.interpolation),{},{prefix:"#$?",suffix:"?$#"})},U=a(a(a(a({},p),{},{count:o},d),B),{},{defaultValue:R,ns:C}),D=$(m||r,L?k(L,U):R,j,I,U,b),H=void 0!==c?c:I.defaultTransParent;return H?t.createElement(H,O,D):D},e.Translation=function(e){var n=e.ns,t=e.children,r=u(Y(n,s(e,J)),3),a=r[0],i=r[1],o=r[2];return t(a,{i18n:i,lng:i.language},o)},e.composeInitialProps=R,e.date=function(){return""},e.getDefaults=N,e.getI18n=P,e.getInitialProps=T,e.initReactI18next=C,e.number=function(){return""},e.plural=function(){return""},e.select=function(){return""},e.selectOrdinal=function(){return""},e.setDefaults=j,e.setI18n=I,e.time=function(){return""},e.useSSR=Z,e.useTranslation=Y,e.withSSR=function(){return function(e){function n(n){var r=n.initialI18nStore,i=n.initialLanguage,o=s(n,G);return Z(r,i),t.createElement(e,a({},o))}return n.getInitialProps=R(e),n.displayName="withI18nextSSR(".concat(H(e),")"),n.WrappedComponent=e,n}},e.withTranslation=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,c=s(i,_),l=u(Y(e,a(a({},c),{},{keyPrefix:n.keyPrefix})),3),f=l[0],p=l[1],d=l[2],g=a(a({},c),{},{t:f,i18n:p,tReady:d});return n.withRef&&o?g.ref=o:!n.withRef&&o&&(g.forwardedRef=o),t.createElement(r,g)}i.displayName="withI18nextTranslation(".concat(H(r),")"),i.WrappedComponent=r;return n.withRef?t.forwardRef((function(e,n){return t.createElement(i,Object.assign({},e,{forwardedRef:n}))})):i}},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ define(["exports","react"],(function(e,n){"use strict";function t(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function r(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(n){o(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function a(e){return(a="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})(e)}function i(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function s(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==t)return;var r,a,i=[],o=!0,c=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==t.return||t.return()}finally{if(c)throw a}}return i}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var l={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},f=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function p(e){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=e.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(l[t[1]]||"/"===e.charAt(e.length-2))&&(n.voidElement=!0),n.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var a=new RegExp(f),i=null;null!==(i=a.exec(e));)if(i[0].trim())if(i[1]){var o=i[1].trim(),c=[o,""];o.indexOf("=")>-1&&(c=o.split("=")),n.attrs[c[0]]=c[1],a.lastIndex--}else i[2]&&(n.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return n}var d=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,g=/^\s*$/,m=Object.create(null);var h=function(e,n){n||(n={}),n.components||(n.components=m);var t,r=[],a=[],i=-1,o=!1;if(0!==e.indexOf("<")){var c=e.indexOf("<");r.push({type:"text",content:-1===c?e:e.substring(0,c)})}return e.replace(d,(function(c,s){if(o){if(c!=="</"+t.name+">")return;o=!1}var u,l="/"!==c.charAt(1),f=c.startsWith("\x3c!--"),d=s+c.length,m=e.charAt(d);if(f){var h=p(c);return i<0?(r.push(h),r):((u=a[i]).children.push(h),r)}if(l&&(i++,"tag"===(t=p(c)).type&&n.components[t.name]&&(t.type="component",o=!0),t.voidElement||o||!m||"<"===m||t.children.push({type:"text",content:e.slice(d,e.indexOf("<",d))}),0===i&&r.push(t),(u=a[i-1])&&u.children.push(t),a[i]=t),(!l||t.voidElement)&&(i>-1&&(t.voidElement||t.name===c.slice(2,-1))&&(i--,t=-1===i?r:a[i]),!o&&"<"!==m&&m)){u=-1===i?r:a[i].children;var v=e.indexOf("<",d),y=e.slice(d,-1===v?void 0:v);g.test(y)&&(y=" "),(v>-1&&i+u.length>=0||" "!==y)&&u.push({type:"text",content:y})}})),r},v="".replace,y=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,b={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"'};function O(e){return b[e]}var x,w={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},E=n.createContext();function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w=r(r({},w),e)}function j(){return w}var N=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var n,t,r;return n=e,(t=[{key:"addUsedNamespaces",value:function(e){var n=this;e.forEach((function(e){n.usedNamespaces[e]||(n.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&i(n.prototype,t),r&&i(n,r),e}();function k(e){x=e}function I(){return x}var P={type:"3rdParty",init:function(e){S(e.options.react),k(e)}};function C(e){return function(n){return new Promise((function(t){var a=R();e.getInitialProps?e.getInitialProps(n).then((function(e){t(r(r({},e),a))})):t(a)}))}}function R(){var e=I(),n=e.reportNamespaces?e.reportNamespaces.getUsedNamespaces():[],t={},r={};return e.languages.forEach((function(t){r[t]={},n.forEach((function(n){r[t][n]=e.getResourceBundle(t,n)||{}}))})),t.initialI18nStore=r,t.initialLanguage=e.language,t}function T(){if(console&&console.warn){for(var e,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];"string"==typeof t[0]&&(t[0]="react-i18next:: ".concat(t[0])),(e=console).warn.apply(e,t)}}var A={};function L(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];"string"==typeof n[0]&&A[n[0]]||("string"==typeof n[0]&&(A[n[0]]=new Date),T.apply(void 0,n))}function z(e,n,t){e.loadNamespaces(n,(function(){if(e.isInitialized)t();else{e.on("initialized",(function n(){setTimeout((function(){e.off("initialized",n)}),0),t()}))}}))}function B(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.languages[0],a=!!n.options&&n.options.fallbackLng,i=n.languages[n.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,t){var r=n.services.backendConnector.state["".concat(e,"|").concat(t)];return-1===r||2===r};return!(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,e))&&(!!n.hasResourceBundle(r,e)||(!(n.services.backendConnector.backend&&(!n.options.resources||n.options.partialBundledLanguages))||!(!o(r,e)||a&&!o(i,e))))}function U(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.languages||!n.languages.length)return L("i18n.languages were undefined or empty",n.languages),!0;var r=void 0!==n.options.ignoreJSONStructure;return r?n.hasLoadedNamespace(e,{precheck:function(n,r){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!r(n.isLanguageChangingTo,e))return!1}}):B(e,n,t)}function D(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}var H=["format"],K=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function V(e,n){if(!e)return!1;var t=e.props?e.props.children:e.children;return n?t.length>0:!!t}function F(e){return e?e&&e.children?e.children:e.props&&e.props.children:[]}function W(e){return Array.isArray(e)?e:[e]}function M(e,t,i,o,c,s){if(""===t)return[];var u=o.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(u.join("|")).test(t);if(!e&&!l)return[t];var f={};!function e(t){W(t).forEach((function(t){"string"!=typeof t&&(V(t)?e(F(t)):"object"!==a(t)||n.isValidElement(t)||Object.assign(f,t))}))}(e);var p=h("<0>".concat(t,"</0>")),d=r(r({},f),c);function g(e,t,r){var a=F(e),i=b(a,t.children,r);return function(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every((function(e){return n.isValidElement(e)}))}(a)&&0===i.length?a:i}function m(e,t,a,i,o){e.dummy&&(e.children=t),a.push(n.cloneElement(e,r(r({},e.props),{},{key:i}),o?void 0:t))}function b(t,c,f){var p=W(t);return W(c).reduce((function(t,c,h){var x,w,E,S,j=c.children&&c.children[0]&&c.children[0].content&&i.services.interpolator.interpolate(c.children[0].content,d,i.language);if("tag"===c.type){var N=p[parseInt(c.name,10)];!N&&1===f.length&&f[0][c.name]&&(N=f[0][c.name]),N||(N={});var k=0!==Object.keys(c.attrs).length?(w={props:c.attrs},(S=r({},E=N)).props=Object.assign(w.props,E.props),S):N,I=n.isValidElement(k),P=I&&V(c,!0)&&!c.voidElement,C=l&&"object"===a(k)&&k.dummy&&!I,R="object"===a(e)&&null!==e&&Object.hasOwnProperty.call(e,c.name);if("string"==typeof k){var T=i.services.interpolator.interpolate(k,d,i.language);t.push(T)}else if(V(k)||P){m(k,g(k,c,f),t,h)}else if(C){var A=b(p,c.children,f);t.push(n.cloneElement(k,r(r({},k.props),{},{key:h}),A))}else if(Number.isNaN(parseFloat(c.name))){if(R)m(k,g(k,c,f),t,h,c.voidElement);else if(o.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)t.push(n.createElement(c.name,{key:"".concat(c.name,"-").concat(h)}));else{var L=b(p,c.children,f);t.push(n.createElement(c.name,{key:"".concat(c.name,"-").concat(h)},L))}else if(c.voidElement)t.push("<".concat(c.name," />"));else{var z=b(p,c.children,f);t.push("<".concat(c.name,">").concat(z,"</").concat(c.name,">"))}}else if("object"!==a(k)||I)1===c.children.length&&j?t.push(n.cloneElement(k,r(r({},k.props),{},{key:h}),j)):t.push(n.cloneElement(k,r(r({},k.props),{},{key:h})));else{var B=c.children[0]?j:null;B&&t.push(B)}}else if("text"===c.type){var U=o.transWrapTextNodes,D=s?(x=i.services.interpolator.interpolate(c.content,d,i.language),v.call(x,y,O)):i.services.interpolator.interpolate(c.content,d,i.language);U?t.push(n.createElement(U,{key:"".concat(c.name,"-").concat(h)},D)):t.push(D)}return t}),[])}return F(b([{dummy:!0,children:e||[]}],p,W(e||[]))[0])}var $=function(e,t){var r=n.useRef();return n.useEffect((function(){r.current=t?r.current:e}),[e,t]),r.current};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.i18n,i=n.useContext(E)||{},o=i.i18n,c=i.defaultNS,u=a||o||I();if(u&&!u.reportNamespaces&&(u.reportNamespaces=new N),!u){L("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},f=[l,{},!1];return f.t=l,f.i18n={},f.ready=!1,f}u.options.react&&void 0!==u.options.react.wait&&L("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var p=r(r(r({},j()),u.options.react),t),d=p.useSuspense,g=p.keyPrefix,m=e||c||u.options&&u.options.defaultNS;m="string"==typeof m?[m]:m||["translation"],u.reportNamespaces.addUsedNamespaces&&u.reportNamespaces.addUsedNamespaces(m);var h=(u.isInitialized||u.initializedStoreOnce)&&m.every((function(e){return U(e,u,p)}));function v(){return u.getFixedT(null,"fallback"===p.nsMode?m:m[0],g)}var y=n.useState(v),b=s(y,2),O=b[0],x=b[1],w=m.join(),S=$(w),k=n.useRef(!0);n.useEffect((function(){var e=p.bindI18n,n=p.bindI18nStore;function t(){k.current&&x(v)}return k.current=!0,h||d||z(u,m,(function(){k.current&&x(v)})),h&&S&&S!==w&&k.current&&x(v),e&&u&&u.on(e,t),n&&u&&u.store.on(n,t),function(){k.current=!1,e&&u&&e.split(" ").forEach((function(e){return u.off(e,t)})),n&&u&&n.split(" ").forEach((function(e){return u.store.off(e,t)}))}}),[u,w]);var P=n.useRef(!0);n.useEffect((function(){k.current&&!P.current&&x(v),P.current=!1}),[u]);var C=[O,u,h];if(C.t=O,C.i18n=u,C.ready=h,h)return C;if(!h&&!d)return C;throw new Promise((function(e){z(u,m,(function(){e()}))}))}var Y=["forwardedRef"];var _=["ns","children"];function J(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.i18n,i=n.useContext(E)||{},o=i.i18n,c=a||o||I();c.options&&c.options.isClone||(e&&!c.initializedStoreOnce&&(c.services.resourceStore.data=e,c.options.ns=Object.values(e).reduce((function(e,n){return Object.keys(n).forEach((function(n){e.indexOf(n)<0&&e.push(n)})),e}),c.options.ns),c.initializedStoreOnce=!0,c.isInitialized=!0),t&&!c.initializedLanguageOnce&&(c.changeLanguage(t),c.initializedLanguageOnce=!0))}var Z=["initialI18nStore","initialLanguage"];e.I18nContext=E,e.I18nextProvider=function(e){var t=e.i18n,r=e.defaultNS,a=e.children,i=n.useMemo((function(){return{i18n:t,defaultNS:r}}),[t,r]);return n.createElement(E.Provider,{value:i},a)},e.Trans=function(e){var t=e.children,i=e.count,o=e.parent,s=e.i18nKey,u=e.context,l=e.tOptions,f=void 0===l?{}:l,p=e.values,d=e.defaults,g=e.components,m=e.ns,h=e.i18n,v=e.t,y=e.shouldUnescape,b=c(e,K),O=n.useContext(E)||{},x=O.i18n,w=O.defaultNS,S=h||x||I();if(!S)return L("You will need to pass in an i18next instance by using i18nextReactModule"),t;var N=v||S.t.bind(S)||function(e){return e};u&&(f.context=u);var k=r(r({},j()),S.options&&S.options.react),P=m||N.ns||w||S.options&&S.options.defaultNS;P="string"==typeof P?[P]:P||["translation"];var C=d||function e(t,r){if(!t)return"";var i="",o=W(t),s=r.transSupportBasicHtmlNodes&&r.transKeepBasicHtmlNodesFor?r.transKeepBasicHtmlNodesFor:[];return o.forEach((function(t,o){if("string"==typeof t)i+="".concat(t);else if(n.isValidElement(t)){var u=Object.keys(t.props).length,l=s.indexOf(t.type)>-1,f=t.props.children;if(!f&&l&&0===u)i+="<".concat(t.type,"/>");else if(f||l&&0===u)if(t.props.i18nIsDynamicList)i+="<".concat(o,"></").concat(o,">");else if(l&&1===u&&"string"==typeof f)i+="<".concat(t.type,">").concat(f,"</").concat(t.type,">");else{var p=e(f,r);i+="<".concat(o,">").concat(p,"</").concat(o,">")}else i+="<".concat(o,"></").concat(o,">")}else if(null===t)T("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===a(t)){var d=t.format,g=c(t,H),m=Object.keys(g);if(1===m.length){var h=d?"".concat(m[0],", ").concat(d):m[0];i+="{{".concat(h,"}}")}else T("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",t)}else T("Trans: 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}}.",t)})),i}(t,k)||k.transEmptyNodeValue||s,R=k.hashTransKey,A=s||(R?R(C):C),z=p?f.interpolation:{interpolation:r(r({},f.interpolation),{},{prefix:"#$?",suffix:"?$#"})},B=r(r(r(r({},f),{},{count:i},p),z),{},{defaultValue:C,ns:P}),U=M(g||t,A?N(A,B):C,S,k,B,y),D=void 0!==o?o:k.defaultTransParent;return D?n.createElement(D,b,U):U},e.Translation=function(e){var n=e.ns,t=e.children,r=s(q(n,c(e,_)),3),a=r[0],i=r[1],o=r[2];return t(a,{i18n:i,lng:i.language},o)},e.composeInitialProps=C,e.date=function(){return""},e.getDefaults=j,e.getI18n=I,e.getInitialProps=R,e.initReactI18next=P,e.number=function(){return""},e.plural=function(){return""},e.select=function(){return""},e.selectOrdinal=function(){return""},e.setDefaults=S,e.setI18n=k,e.time=function(){return""},e.useSSR=J,e.useTranslation=q,e.withSSR=function(){return function(e){function t(t){var a=t.initialI18nStore,i=t.initialLanguage,o=c(t,Z);return J(a,i),n.createElement(e,r({},o))}return t.getInitialProps=C(e),t.displayName="withI18nextSSR(".concat(D(e),")"),t.WrappedComponent=e,t}},e.withTranslation=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(a){function i(i){var o=i.forwardedRef,u=c(i,Y),l=s(q(e,r(r({},u),{},{keyPrefix:t.keyPrefix})),3),f=l[0],p=l[1],d=l[2],g=r(r({},u),{},{t:f,i18n:p,tReady:d});return t.withRef&&o?g.ref=o:!t.withRef&&o&&(g.forwardedRef=o),n.createElement(a,g)}i.displayName="withI18nextTranslation(".concat(D(a),")"),i.WrappedComponent=a;return t.withRef?n.forwardRef((function(e,t){return n.createElement(i,Object.assign({},e,{forwardedRef:t}))})):i}},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -16,7 +14,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
16
14
 
17
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
16
 
19
- var _react = _interopRequireWildcard(require("react"));
17
+ var _react = require("react");
20
18
 
21
19
  var _htmlParseStringify = _interopRequireDefault(require("html-parse-stringify"));
22
20
 
@@ -29,10 +27,6 @@ var _utils = require("./utils");
29
27
  var _excluded = ["format"],
30
28
  _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
31
29
 
32
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
-
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
37
31
 
38
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -52,7 +46,7 @@ function getChildren(node) {
52
46
  function hasValidReactChildren(children) {
53
47
  if (Object.prototype.toString.call(children) !== '[object Array]') return false;
54
48
  return children.every(function (child) {
55
- return _react["default"].isValidElement(child);
49
+ return (0, _react.isValidElement)(child);
56
50
  });
57
51
  }
58
52
 
@@ -75,7 +69,7 @@ function nodesToString(children, i18nOptions) {
75
69
  childrenArray.forEach(function (child, childIndex) {
76
70
  if (typeof child === 'string') {
77
71
  stringNode += "".concat(child);
78
- } else if (_react["default"].isValidElement(child)) {
72
+ } else if ((0, _react.isValidElement)(child)) {
79
73
  var childPropsCount = Object.keys(child.props).length;
80
74
  var shouldKeepChild = keepArray.indexOf(child.type) > -1;
81
75
  var childChildren = child.props.children;
@@ -123,7 +117,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
123
117
  var childrenArray = getAsArray(childs);
124
118
  childrenArray.forEach(function (child) {
125
119
  if (typeof child === 'string') return;
126
- if (hasChildren(child)) getData(getChildren(child));else if ((0, _typeof2["default"])(child) === 'object' && !_react["default"].isValidElement(child)) Object.assign(data, child);
120
+ if (hasChildren(child)) getData(getChildren(child));else if ((0, _typeof2["default"])(child) === 'object' && !(0, _react.isValidElement)(child)) Object.assign(data, child);
127
121
  });
128
122
  }
129
123
 
@@ -141,7 +135,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
141
135
 
142
136
  function pushTranslatedJSX(child, inner, mem, i, isVoid) {
143
137
  if (child.dummy) child.children = inner;
144
- mem.push(_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
138
+ mem.push((0, _react.cloneElement)(child, _objectSpread(_objectSpread({}, child.props), {}, {
145
139
  key: i
146
140
  }), isVoid ? undefined : inner));
147
141
  }
@@ -159,9 +153,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
159
153
  var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
160
154
  props: node.attrs
161
155
  }, tmp) : tmp;
162
-
163
- var isElement = _react["default"].isValidElement(child);
164
-
156
+ var isElement = (0, _react.isValidElement)(child);
165
157
  var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
166
158
  var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && (0, _typeof2["default"])(child) === 'object' && child.dummy && !isElement;
167
159
  var isKnownComponent = (0, _typeof2["default"])(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
@@ -175,7 +167,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
175
167
  } else if (isEmptyTransWithHTML) {
176
168
  var _inner = mapAST(reactNodes, node.children, rootReactNode);
177
169
 
178
- mem.push(_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
170
+ mem.push((0, _react.cloneElement)(child, _objectSpread(_objectSpread({}, child.props), {}, {
179
171
  key: i
180
172
  }), _inner));
181
173
  } else if (Number.isNaN(parseFloat(node.name))) {
@@ -185,13 +177,13 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
185
177
  pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
186
178
  } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
187
179
  if (node.voidElement) {
188
- mem.push(_react["default"].createElement(node.name, {
180
+ mem.push((0, _react.createElement)(node.name, {
189
181
  key: "".concat(node.name, "-").concat(i)
190
182
  }));
191
183
  } else {
192
184
  var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
193
185
 
194
- mem.push(_react["default"].createElement(node.name, {
186
+ mem.push((0, _react.createElement)(node.name, {
195
187
  key: "".concat(node.name, "-").concat(i)
196
188
  }, _inner3));
197
189
  }
@@ -206,11 +198,11 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
206
198
  var content = node.children[0] ? translationContent : null;
207
199
  if (content) mem.push(content);
208
200
  } else if (node.children.length === 1 && translationContent) {
209
- mem.push(_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
201
+ mem.push((0, _react.cloneElement)(child, _objectSpread(_objectSpread({}, child.props), {}, {
210
202
  key: i
211
203
  }), translationContent));
212
204
  } else {
213
- mem.push(_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
205
+ mem.push((0, _react.cloneElement)(child, _objectSpread(_objectSpread({}, child.props), {}, {
214
206
  key: i
215
207
  })));
216
208
  }
@@ -220,7 +212,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
220
212
  var _content = shouldUnescape ? (0, _htmlEscaper.unescape)(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
221
213
 
222
214
  if (wrapTextNodes) {
223
- mem.push(_react["default"].createElement(wrapTextNodes, {
215
+ mem.push((0, _react.createElement)(wrapTextNodes, {
224
216
  key: "".concat(node.name, "-").concat(i)
225
217
  }, _content));
226
218
  } else {
@@ -297,5 +289,5 @@ function Trans(_ref) {
297
289
  var translation = key ? t(key, combinedTOpts) : defaultValue;
298
290
  var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
299
291
  var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
300
- return useAsParent ? _react["default"].createElement(useAsParent, additionalProps, content) : content;
292
+ return useAsParent ? (0, _react.createElement)(useAsParent, additionalProps, content) : content;
301
293
  }
@@ -19,7 +19,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
19
19
 
20
20
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
21
21
 
22
- var _react = _interopRequireDefault(require("react"));
22
+ var _react = require("react");
23
23
 
24
24
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
25
25
 
@@ -35,9 +35,7 @@ var defaultOptions = {
35
35
  useSuspense: true
36
36
  };
37
37
  var i18nInstance;
38
-
39
- var I18nContext = _react["default"].createContext();
40
-
38
+ var I18nContext = (0, _react.createContext)();
41
39
  exports.I18nContext = I18nContext;
42
40
 
43
41
  function setDefaults() {
File without changes
@@ -11,7 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
- var _react = _interopRequireDefault(require("react"));
14
+ var _react = require("react");
15
15
 
16
16
  var _useSSR = require("./useSSR");
17
17
 
@@ -32,7 +32,7 @@ function withSSR() {
32
32
  initialLanguage = _ref.initialLanguage,
33
33
  rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
34
34
  (0, _useSSR.useSSR)(initialI18nStore, initialLanguage);
35
- return _react["default"].createElement(WrappedComponent, _objectSpread({}, rest));
35
+ return (0, _react.createElement)(WrappedComponent, _objectSpread({}, rest));
36
36
  }
37
37
 
38
38
  I18nextWithSSR.getInitialProps = (0, _context.composeInitialProps)(WrappedComponent);
@@ -13,7 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
13
13
 
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15
 
16
- var _react = _interopRequireDefault(require("react"));
16
+ var _react = require("react");
17
17
 
18
18
  var _useTranslation3 = require("./useTranslation");
19
19
 
@@ -52,18 +52,18 @@ function withTranslation(ns) {
52
52
  passDownProps.forwardedRef = forwardedRef;
53
53
  }
54
54
 
55
- return _react["default"].createElement(WrappedComponent, passDownProps);
55
+ return (0, _react.createElement)(WrappedComponent, passDownProps);
56
56
  }
57
57
 
58
58
  I18nextWithTranslation.displayName = "withI18nextTranslation(".concat((0, _utils.getDisplayName)(WrappedComponent), ")");
59
59
  I18nextWithTranslation.WrappedComponent = WrappedComponent;
60
60
 
61
61
  var forwardRef = function forwardRef(props, ref) {
62
- return _react["default"].createElement(I18nextWithTranslation, Object.assign({}, props, {
62
+ return (0, _react.createElement)(I18nextWithTranslation, Object.assign({}, props, {
63
63
  forwardedRef: ref
64
64
  }));
65
65
  };
66
66
 
67
- return options.withRef ? _react["default"].forwardRef(forwardRef) : I18nextWithTranslation;
67
+ return options.withRef ? (0, _react.forwardRef)(forwardRef) : I18nextWithTranslation;
68
68
  };
69
69
  }
package/dist/es/Trans.js CHANGED
@@ -8,7 +8,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
8
 
9
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
10
 
11
- import React, { useContext } from 'react';
11
+ import { useContext, isValidElement, cloneElement, createElement } from 'react';
12
12
  import HTML from 'html-parse-stringify';
13
13
  import { unescape } from 'html-escaper';
14
14
  import { getI18n, I18nContext, getDefaults } from './context';
@@ -29,7 +29,7 @@ function getChildren(node) {
29
29
  function hasValidReactChildren(children) {
30
30
  if (Object.prototype.toString.call(children) !== '[object Array]') return false;
31
31
  return children.every(function (child) {
32
- return React.isValidElement(child);
32
+ return isValidElement(child);
33
33
  });
34
34
  }
35
35
 
@@ -52,7 +52,7 @@ export function nodesToString(children, i18nOptions) {
52
52
  childrenArray.forEach(function (child, childIndex) {
53
53
  if (typeof child === 'string') {
54
54
  stringNode += "".concat(child);
55
- } else if (React.isValidElement(child)) {
55
+ } else if (isValidElement(child)) {
56
56
  var childPropsCount = Object.keys(child.props).length;
57
57
  var shouldKeepChild = keepArray.indexOf(child.type) > -1;
58
58
  var childChildren = child.props.children;
@@ -101,7 +101,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
101
101
  var childrenArray = getAsArray(childs);
102
102
  childrenArray.forEach(function (child) {
103
103
  if (typeof child === 'string') return;
104
- if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !React.isValidElement(child)) Object.assign(data, child);
104
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
105
105
  });
106
106
  }
107
107
 
@@ -118,7 +118,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
118
118
 
119
119
  function pushTranslatedJSX(child, inner, mem, i, isVoid) {
120
120
  if (child.dummy) child.children = inner;
121
- mem.push(React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
121
+ mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
122
122
  key: i
123
123
  }), isVoid ? undefined : inner));
124
124
  }
@@ -136,7 +136,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
136
136
  var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
137
137
  props: node.attrs
138
138
  }, tmp) : tmp;
139
- var isElement = React.isValidElement(child);
139
+ var isElement = isValidElement(child);
140
140
  var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
141
141
  var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
142
142
  var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
@@ -150,7 +150,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
150
150
  } else if (isEmptyTransWithHTML) {
151
151
  var _inner = mapAST(reactNodes, node.children, rootReactNode);
152
152
 
153
- mem.push(React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
153
+ mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
154
154
  key: i
155
155
  }), _inner));
156
156
  } else if (Number.isNaN(parseFloat(node.name))) {
@@ -160,13 +160,13 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
160
160
  pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
161
161
  } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
162
162
  if (node.voidElement) {
163
- mem.push(React.createElement(node.name, {
163
+ mem.push(createElement(node.name, {
164
164
  key: "".concat(node.name, "-").concat(i)
165
165
  }));
166
166
  } else {
167
167
  var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
168
168
 
169
- mem.push(React.createElement(node.name, {
169
+ mem.push(createElement(node.name, {
170
170
  key: "".concat(node.name, "-").concat(i)
171
171
  }, _inner3));
172
172
  }
@@ -181,11 +181,11 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
181
181
  var content = node.children[0] ? translationContent : null;
182
182
  if (content) mem.push(content);
183
183
  } else if (node.children.length === 1 && translationContent) {
184
- mem.push(React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
184
+ mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
185
185
  key: i
186
186
  }), translationContent));
187
187
  } else {
188
- mem.push(React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
188
+ mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
189
189
  key: i
190
190
  })));
191
191
  }
@@ -195,7 +195,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
195
195
  var _content = shouldUnescape ? unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
196
196
 
197
197
  if (wrapTextNodes) {
198
- mem.push(React.createElement(wrapTextNodes, {
198
+ mem.push(createElement(wrapTextNodes, {
199
199
  key: "".concat(node.name, "-").concat(i)
200
200
  }, _content));
201
201
  } else {
@@ -272,5 +272,5 @@ export function Trans(_ref) {
272
272
  var translation = key ? t(key, combinedTOpts) : defaultValue;
273
273
  var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
274
274
  var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
275
- return useAsParent ? React.createElement(useAsParent, additionalProps, content) : content;
275
+ return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
276
276
  }