@tolgee/core 2.8.2 → 3.1.2

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.
Files changed (185) hide show
  1. package/README.md +3 -3
  2. package/dist/tolgee.cjs.js +4513 -4010
  3. package/dist/tolgee.cjs.js.map +1 -1
  4. package/dist/tolgee.cjs.min.js +1 -1
  5. package/dist/tolgee.cjs.min.js.map +1 -1
  6. package/dist/tolgee.esm.js +1 -1
  7. package/dist/tolgee.esm.js.map +1 -1
  8. package/dist/tolgee.umd.js +4513 -4010
  9. package/dist/tolgee.umd.js.map +1 -1
  10. package/dist/tolgee.umd.min.js +1 -1
  11. package/dist/tolgee.umd.min.js.map +1 -1
  12. package/lib/Observer.d.ts +3 -7
  13. package/lib/Observer.js +5 -7
  14. package/lib/Observer.js.map +1 -1
  15. package/lib/Properties.js +8 -2
  16. package/lib/Properties.js.map +1 -1
  17. package/lib/Tolgee.d.ts +41 -8
  18. package/lib/Tolgee.js +112 -63
  19. package/lib/Tolgee.js.map +1 -1
  20. package/lib/TolgeeConfig.d.ts +1 -0
  21. package/lib/TolgeeConfig.js +1 -0
  22. package/lib/TolgeeConfig.js.map +1 -1
  23. package/lib/helpers/NodeHelper.d.ts +2 -0
  24. package/lib/helpers/NodeHelper.js +6 -0
  25. package/lib/helpers/NodeHelper.js.map +1 -1
  26. package/lib/helpers/encoderPolyfill.d.ts +8 -0
  27. package/lib/helpers/encoderPolyfill.js +96 -0
  28. package/lib/helpers/encoderPolyfill.js.map +1 -0
  29. package/lib/helpers/secret.d.ts +6 -0
  30. package/lib/helpers/secret.js +73 -0
  31. package/lib/helpers/secret.js.map +1 -0
  32. package/lib/highlighter/MouseEventHandler.d.ts +6 -5
  33. package/lib/highlighter/MouseEventHandler.js +32 -29
  34. package/lib/highlighter/MouseEventHandler.js.map +1 -1
  35. package/lib/highlighter/TranslationHighlighter.d.ts +2 -2
  36. package/lib/highlighter/TranslationHighlighter.js.map +1 -1
  37. package/lib/index.d.ts +1 -0
  38. package/lib/index.js +1 -0
  39. package/lib/index.js.map +1 -1
  40. package/lib/modules/IcuFormatter.d.ts +2 -0
  41. package/lib/modules/IcuFormatter.js +14 -0
  42. package/lib/modules/IcuFormatter.js.map +1 -0
  43. package/lib/modules/index.d.ts +1 -0
  44. package/lib/modules/index.js +2 -0
  45. package/lib/modules/index.js.map +1 -0
  46. package/lib/services/CoreService.d.ts +1 -0
  47. package/lib/services/CoreService.js +18 -0
  48. package/lib/services/CoreService.js.map +1 -1
  49. package/lib/services/{DependencyStore.d.ts → DependencyService.d.ts} +10 -11
  50. package/lib/services/{DependencyStore.js → DependencyService.js} +34 -18
  51. package/lib/services/DependencyService.js.map +1 -0
  52. package/lib/services/ModuleService.d.ts +5 -0
  53. package/lib/services/ModuleService.js +18 -0
  54. package/lib/services/ModuleService.js.map +1 -0
  55. package/lib/services/TextService.d.ts +6 -14
  56. package/lib/services/TextService.js +29 -223
  57. package/lib/services/TextService.js.map +1 -1
  58. package/lib/services/TranslationService.d.ts +5 -3
  59. package/lib/services/TranslationService.js +20 -20
  60. package/lib/services/TranslationService.js.map +1 -1
  61. package/lib/types.d.ts +18 -0
  62. package/lib/wrappers/AbstractWrapper.d.ts +8 -0
  63. package/lib/wrappers/AbstractWrapper.js +2 -0
  64. package/lib/wrappers/AbstractWrapper.js.map +1 -0
  65. package/lib/wrappers/NodeHandler.d.ts +18 -0
  66. package/lib/{handlers/AbstractHandler.js → wrappers/NodeHandler.js} +18 -19
  67. package/lib/wrappers/NodeHandler.js.map +1 -0
  68. package/lib/wrappers/WrappedHandler.d.ts +8 -0
  69. package/lib/{handlers → wrappers}/WrappedHandler.js +8 -28
  70. package/lib/wrappers/WrappedHandler.js.map +1 -0
  71. package/lib/wrappers/invisible/AttributeHandler.d.ts +8 -0
  72. package/lib/wrappers/invisible/AttributeHandler.js +134 -0
  73. package/lib/wrappers/invisible/AttributeHandler.js.map +1 -0
  74. package/lib/wrappers/invisible/Coder.d.ts +7 -0
  75. package/lib/wrappers/invisible/Coder.js +69 -0
  76. package/lib/wrappers/invisible/Coder.js.map +1 -0
  77. package/lib/wrappers/invisible/ContentHandler.d.ts +6 -0
  78. package/lib/{services/DependencyStore.test.js → wrappers/invisible/ContentHandler.js} +26 -30
  79. package/lib/wrappers/invisible/ContentHandler.js.map +1 -0
  80. package/lib/wrappers/invisible/CoreHandler.d.ts +10 -0
  81. package/lib/{services/__mocks__/CoreService.js → wrappers/invisible/CoreHandler.js} +27 -12
  82. package/lib/wrappers/invisible/CoreHandler.js.map +1 -0
  83. package/lib/wrappers/invisible/InvisibleWrapper.d.ts +18 -0
  84. package/lib/wrappers/invisible/InvisibleWrapper.js +37 -0
  85. package/lib/wrappers/invisible/InvisibleWrapper.js.map +1 -0
  86. package/lib/wrappers/invisible/ValueMemory.d.ts +5 -0
  87. package/lib/wrappers/invisible/ValueMemory.js +19 -0
  88. package/lib/wrappers/invisible/ValueMemory.js.map +1 -0
  89. package/lib/wrappers/text/AttributeHandler.d.ts +8 -0
  90. package/lib/{handlers → wrappers/text}/AttributeHandler.js +7 -28
  91. package/lib/wrappers/text/AttributeHandler.js.map +1 -0
  92. package/lib/wrappers/text/Coder.d.ts +15 -0
  93. package/lib/wrappers/text/Coder.js +190 -0
  94. package/lib/wrappers/text/Coder.js.map +1 -0
  95. package/lib/wrappers/text/ContentHandler.d.ts +8 -0
  96. package/lib/{handlers/TextHandler.js → wrappers/text/ContentHandler.js} +12 -33
  97. package/lib/wrappers/text/ContentHandler.js.map +1 -0
  98. package/lib/wrappers/text/CoreHandler.d.ts +17 -0
  99. package/lib/{handlers → wrappers/text}/CoreHandler.js +5 -6
  100. package/lib/wrappers/text/CoreHandler.js.map +1 -0
  101. package/lib/wrappers/text/TextWrapper.d.ts +20 -0
  102. package/lib/wrappers/text/TextWrapper.js +36 -0
  103. package/lib/wrappers/text/TextWrapper.js.map +1 -0
  104. package/package.json +8 -7
  105. package/lib/Observer.test.d.ts +0 -2
  106. package/lib/Observer.test.js +0 -190
  107. package/lib/Observer.test.js.map +0 -1
  108. package/lib/Properties.test.d.ts +0 -1
  109. package/lib/Properties.test.js +0 -77
  110. package/lib/Properties.test.js.map +0 -1
  111. package/lib/Tolgee.test.d.ts +0 -1
  112. package/lib/Tolgee.test.js +0 -482
  113. package/lib/Tolgee.test.js.map +0 -1
  114. package/lib/TolgeeConfig.test.d.ts +0 -1
  115. package/lib/TolgeeConfig.test.js +0 -18
  116. package/lib/TolgeeConfig.test.js.map +0 -1
  117. package/lib/__testFixtures/classMock.d.ts +0 -3
  118. package/lib/__testFixtures/classMock.js +0 -8
  119. package/lib/__testFixtures/classMock.js.map +0 -1
  120. package/lib/__testFixtures/createElement.d.ts +0 -2
  121. package/lib/__testFixtures/createElement.js +0 -58
  122. package/lib/__testFixtures/createElement.js.map +0 -1
  123. package/lib/__testFixtures/createTestDom.d.ts +0 -9
  124. package/lib/__testFixtures/createTestDom.js +0 -18
  125. package/lib/__testFixtures/createTestDom.js.map +0 -1
  126. package/lib/__testFixtures/mocked.d.ts +0 -20
  127. package/lib/__testFixtures/mocked.js +0 -24
  128. package/lib/__testFixtures/mocked.js.map +0 -1
  129. package/lib/__testFixtures/setupAfterEnv.d.ts +0 -8
  130. package/lib/__testFixtures/setupAfterEnv.js +0 -23
  131. package/lib/__testFixtures/setupAfterEnv.js.map +0 -1
  132. package/lib/handlers/AbstractHandler.d.ts +0 -21
  133. package/lib/handlers/AbstractHandler.js.map +0 -1
  134. package/lib/handlers/AttributeHandler.d.ts +0 -13
  135. package/lib/handlers/AttributeHandler.js.map +0 -1
  136. package/lib/handlers/AttributeHandler.test.d.ts +0 -1
  137. package/lib/handlers/AttributeHandler.test.js +0 -177
  138. package/lib/handlers/AttributeHandler.test.js.map +0 -1
  139. package/lib/handlers/CoreHandler.d.ts +0 -19
  140. package/lib/handlers/CoreHandler.js.map +0 -1
  141. package/lib/handlers/CoreHandler.test.d.ts +0 -1
  142. package/lib/handlers/CoreHandler.test.js +0 -148
  143. package/lib/handlers/CoreHandler.test.js.map +0 -1
  144. package/lib/handlers/TextHandler.d.ts +0 -13
  145. package/lib/handlers/TextHandler.js.map +0 -1
  146. package/lib/handlers/TextHandler.test.d.ts +0 -1
  147. package/lib/handlers/TextHandler.test.js +0 -270
  148. package/lib/handlers/TextHandler.test.js.map +0 -1
  149. package/lib/handlers/WrappedHandler.d.ts +0 -13
  150. package/lib/handlers/WrappedHandler.js.map +0 -1
  151. package/lib/helpers/TextHelper.test.d.ts +0 -1
  152. package/lib/helpers/TextHelper.test.js +0 -107
  153. package/lib/helpers/TextHelper.test.js.map +0 -1
  154. package/lib/highlighter/HighlightFunctionsInitializer.test.d.ts +0 -1
  155. package/lib/highlighter/HighlightFunctionsInitializer.test.js +0 -81
  156. package/lib/highlighter/HighlightFunctionsInitializer.test.js.map +0 -1
  157. package/lib/highlighter/MouseEventHandler.test.d.ts +0 -1
  158. package/lib/highlighter/MouseEventHandler.test.js +0 -215
  159. package/lib/highlighter/MouseEventHandler.test.js.map +0 -1
  160. package/lib/highlighter/TranslationHighlighter.test.d.ts +0 -1
  161. package/lib/highlighter/TranslationHighlighter.test.js +0 -287
  162. package/lib/highlighter/TranslationHighlighter.test.js.map +0 -1
  163. package/lib/services/CoreService.test.d.ts +0 -1
  164. package/lib/services/CoreService.test.js +0 -178
  165. package/lib/services/CoreService.test.js.map +0 -1
  166. package/lib/services/DependencyStore.js.map +0 -1
  167. package/lib/services/DependencyStore.test.d.ts +0 -1
  168. package/lib/services/DependencyStore.test.js.map +0 -1
  169. package/lib/services/ElementRegistrar.test.d.ts +0 -1
  170. package/lib/services/ElementRegistrar.test.js +0 -215
  171. package/lib/services/ElementRegistrar.test.js.map +0 -1
  172. package/lib/services/TextService.test.d.ts +0 -1
  173. package/lib/services/TextService.test.js +0 -430
  174. package/lib/services/TextService.test.js.map +0 -1
  175. package/lib/services/TranslationService.test.d.ts +0 -1
  176. package/lib/services/TranslationService.test.js +0 -649
  177. package/lib/services/TranslationService.test.js.map +0 -1
  178. package/lib/services/__mocks__/CoreService.d.ts +0 -2
  179. package/lib/services/__mocks__/CoreService.js.map +0 -1
  180. package/lib/toolsManager/Messages.test.d.ts +0 -1
  181. package/lib/toolsManager/Messages.test.js +0 -114
  182. package/lib/toolsManager/Messages.test.js.map +0 -1
  183. package/lib/toolsManager/PluginManager.test.d.ts +0 -1
  184. package/lib/toolsManager/PluginManager.test.js +0 -120
  185. package/lib/toolsManager/PluginManager.test.js.map +0 -1
@@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function i(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function a(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var c,u="data-tolgee-key-only",l=function(){function e(){}return e.evaluate=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Array.from(this.evaluateGenerator.apply(this,a([],s(e),!1)))},e.evaluateToSingle=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.evaluate.apply(this,a([],s(e),!1));if(1===r.length)return r[0];if(r.length<1)throw new Error("No element found");throw new Error("Multiple elements found")},e.closestElement=function(e){return e instanceof Text?e.parentElement:e},e.getParentElement=function(e){return e.parentElement?e.parentElement:e.ownerElement?e.ownerElement:void 0},e.isElementTargetElement=function(e){return e.hasAttribute("_tolgee-target")},e.markElementAsTargetElement=function(e){e.setAttribute("_tolgee-target","")},e.unmarkElementAsTargetElement=function(e){e.removeAttribute("_tolgee-target")},e.nodeContains=function(e,t){if(e.contains(t))return!0;if(t instanceof Attr){var r=t.ownerElement&&Object.values(t.ownerElement.attributes).indexOf(t)>-1;if(e.contains(t.ownerElement)&&r)return!0}return!1},e.evaluateGenerator=function(e,t){var r,n;return i(this,(function(i){switch(i.label){case 0:n=document.evaluate(e,t,void 0,XPathResult.ANY_TYPE),i.label=1;case 1:return null===(r=n.iterateNext())?[3,3]:[4,r];case 2:return i.sent(),[3,1];case 3:return[2]}}))},e}();!function(e){e[e.Alt=0]="Alt",e[e.Control=1]="Control",e[e.Shift=2]="Shift",e[e.Meta=3]="Meta"}(c||(c={}));var h,p,f,g=function(){if("undefined"!=typeof document)return document.body},d=function(e){this.apiUrl="https://app.tolgee.io",this.inputPrefix="%-%tolgee:",this.inputSuffix="%-%",this.defaultLanguage="en",this.filesUrlPrefix="i18n/",this.tagAttributes={textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},this.highlightKeys=[c.Alt],this.passToParent=["option","optgroup"],this.restrictedElements=["script","style"],this.highlightColor="rgb(224 240 255)",this.preloadFallback=!1,Object.defineProperty(this,"targetElement",{set:function(e){if(void 0!==this.targetElement)throw new Error("Target element is already defined!");if(void 0===e&&(this._targetElement=g()),l.isElementTargetElement(e))throw console.error("Target element: ",this._targetElement),new Error("An tolgee instance is inited with provided target element");this._targetElement=e,l.markElementAsTargetElement(this._targetElement)},get:function(){return this._targetElement}}),Object.assign(this,e||{}),void 0===this._targetElement&&(this._targetElement=g()),this.mode=this.mode||(this.apiKey?"development":"production"),this.fallbackLanguage=this.fallbackLanguage||this.defaultLanguage,void 0===this.watch&&(this.watch="development"===this.mode)},v=function(){function e(){}return Object.defineProperty(e.prototype,"currentLanguage",{get:function(){var e;if(this.config.forceLanguage)return this.config.forceLanguage;"undefined"!=typeof localStorage?(e=localStorage.getItem("__tolgee_currentLanguage"),this.config.availableLanguages&&(this.config.availableLanguages.indexOf(e)>-1||(e=void 0))):e=this._currentLanguage;return e||(e=this.getLanguageByNavigator(),this.currentLanguage=e),e},set:function(e){"undefined"!=typeof localStorage?localStorage.setItem("__tolgee_currentLanguage",e):this._currentLanguage=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"preferredLanguages",{get:function(){return new Set(JSON.parse(localStorage.getItem("__tolgee_preferredLanguages")))},set:function(e){localStorage.setItem("__tolgee_preferredLanguages",JSON.stringify(Array.from(e)))},enumerable:!1,configurable:!0}),e.prototype.getLanguageByNavigator=function(){if("undefined"!=typeof window&&this.config.availableLanguages){var e=window.navigator.language,t=this.config.availableLanguages.find((function(t){return t===e}));if(t)return t;var r=function(e){return e.replace(/^(.+?)(-.*)?$/,"$1")},n=r(window.navigator.language),i=this.config.availableLanguages.find((function(e){return r(e)===n}));if(i)return i}return this.config.defaultLanguage},e}(),y=function(){function e(e){this.onUnsubscribe=e}return e.prototype.unsubscribe=function(){this.onUnsubscribe()},e}(),m=function(){function e(){this.idCounter=0,this._subscriptions=new Map}return Object.defineProperty(e.prototype,"subscriptions",{get:function(){return this._subscriptions},enumerable:!1,configurable:!0}),e.prototype.emit=function(e){var t,r,n=[];try{for(var i=o(this.subscriptions.values()),s=i.next();!s.done;s=i.next()){var a=(0,s.value)(e);"function"==typeof(null==a?void 0:a.then)&&n.push(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}if(0!==n.length)return new Promise((function(e){return Promise.all(n).then((function(){return e()}))}))},e.prototype.subscribe=function(e){var t=this,r=this.idCounter++,n=new y((function(){return t.unsubscribe(r)}));return this.subscriptions.set(r,e),n},e.prototype.unsubscribe=function(e){this._subscriptions.delete(e)||console.warn("Event to unsubscribe was not found")},e}(),E=function(){this.TRANSLATION_CHANGED=new m,this.LANGUAGE_CHANGED=new m,this.LANGUAGE_LOADED=new m,this.ELEMENT_REGISTERED=new m},b=function(e){function r(t,n){var i=e.call(this,"Api http error")||this;return i.response=t,i.code=n,Object.setPrototypeOf(i,r.prototype),i}return t(r,e),r}(Error),_=function(){function e(e){this.properties=e}return e.handleErrors=function(e){return n(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:if(!(e.status>=400))return[3,5];t=new b(e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.json()];case 2:return r=n.sent(),t.code=r.code,[3,4];case 3:return n.sent(),console.warn("Tolgee server responded with invalid status code."),[3,4];case 4:throw t;case 5:return[2,e]}}))}))},e.prototype.fetch=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return n(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){return"object"==typeof t[0]?[2,fetch(r(r({},t[0]),{url:this.getUrl(t[0].url)})).then((function(t){return e.handleErrors(t)}))]:(n=s(t),o=n[0],c=n.slice(1),[2,fetch.apply(void 0,a([this.getUrl(o)],s(c),!1)).then((function(t){return e.handleErrors(t)}))])}))}))},e.prototype.fetchJson=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.fetch.apply(this,a([],s(e),!1)).then((function(e){return e.json()}))]}))}))},e.prototype.post=function(e,t,o){void 0===o&&(o={});for(var c=[],u=3;u<arguments.length;u++)c[u-3]=arguments[u];return n(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.fetch.apply(this,a([e,r({body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"}},o)],s(c),!1))]}))}))},e.prototype.postJson=function(e,t,r){void 0===r&&(r={});for(var o=[],c=3;c<arguments.length;c++)o[c-3]=arguments[c];return n(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.post.apply(this,a([e,t,r],s(o),!1)).then((function(e){return e.json()}))]}))}))},e.prototype.getUrl=function(e){var t=e.indexOf("?")<0?"?":"&";return"".concat(this.properties.config.apiUrl,"/").concat(e).concat(t,"ak=").concat(this.properties.config.apiKey)},e}(),T=function(e,t,r){this.key=e,this.translations=t,this.id=r},w=function(){function e(e,t,o,c){var u=this;this.properties=e,this.coreService=t,this.apiHttpService=o,this.eventService=c,this.translationsCache=new Map,this.fetchPromises={},this.updateTranslationInCache=function(e){return n(u,void 0,void 0,(function(){var t,r=this;return i(this,(function(n){switch(n.label){case 0:return t={},Object.entries(e.translations).forEach((function(n){var i=s(n,2),o=i[0],a=i[1],c=r.translationsCache.get(o);c&&(c[e.name]=a.text),t[o]=a.text})),[4,this.eventService.TRANSLATION_CHANGED.emit(new T(e.name,t,e.id))];case 1:return n.sent(),[2]}}))}))},this.getTranslationsOfKey=function(e,t){return void 0===t&&(t=new Set([u.properties.currentLanguage])),n(u,void 0,void 0,(function(){var n,o,c,u,l,h,p,f,g,d,v;return i(this,(function(i){switch(i.label){case 0:this.coreService.checkScope("translations.view"),i.label=1;case 1:return i.trys.push([1,3,,7]),n=a([],s(t),!1),o=n.map((function(e){return"languages=".concat(e)})).join("&"),[4,this.apiHttpService.fetchJson("v2/projects/translations?".concat(o,"&filterKeyName=").concat(encodeURIComponent(e)))];case 2:return c=i.sent(),u=n.reduce((function(e,t){var n;return r(r({},e),((n={})[t]="",n))}),{}),(null==(l=null===(d=null===(g=c._embedded)||void 0===g?void 0:g.keys)||void 0===d?void 0:d[0])?void 0:l.translations)&&Object.entries(l.translations).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];return u[r]=n.text})),h=null===(v=c.selectedLanguages)||void 0===v?void 0:v.map((function(e){return e.tag})),[2,[l,h]];case 3:return(p=i.sent())instanceof b&&404===p.response.status&&"language_not_found"===p.code?(f=this.properties,[4,this.coreService.getLanguages()]):[3,5];case 4:return f.preferredLanguages=i.sent(),console.error("Requested language not found, refreshing the page!"),location.reload(),[3,6];case 5:throw p;case 6:return[3,7];case 7:return[2]}}))}))}}return e.translationByValue=function(e,t,r,n){return e||(n||(r?"":t))},e.prototype.initStatic=function(){var e,t=this;"production"===this.properties.config.mode&&"object"==typeof(null===(e=this.properties.config)||void 0===e?void 0:e.staticData)&&Object.entries(this.properties.config.staticData).forEach((function(e){var r=s(e,2),n=r[0],i=r[1];"function"!=typeof i&&t.setLanguageData(n,i)}))},e.prototype.loadTranslations=function(e){return void 0===e&&(e=this.properties.currentLanguage),n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return null!=this.translationsCache.get(e)?[3,2]:(this.fetchPromises[e]instanceof Promise||(this.fetchPromises[e]=this.fetchTranslations(e)),[4,this.fetchPromises[e]]);case 1:t.sent(),this.eventService.LANGUAGE_LOADED.emit(e),t.label=2;case 2:return this.fetchPromises[e]=void 0,[2]}}))}))},e.prototype.getTranslation=function(t,r,o,s){return void 0===r&&(r=this.properties.currentLanguage),void 0===o&&(o=!1),n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return(n=this.getFromCache(t,r))?[3,3]:[4,this.loadTranslations(r)];case 1:return i.sent(),(n=this.getFromCache(t,r))?[3,3]:(n=this.getFromCache(t,this.properties.config.fallbackLanguage))?[3,3]:[4,this.loadTranslations(this.properties.config.fallbackLanguage)];case 2:i.sent(),n=this.getFromCache(t,this.properties.config.fallbackLanguage),i.label=3;case 3:return[2,e.translationByValue(n,t,o,s)]}}))}))},e.prototype.updateKeyComplex=function(e,t){var o,s;return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return this.coreService.checkScope("translations.edit"),[4,this.apiHttpService.postJson("v2/projects/keys/".concat(e,"/complex-update"),r(r({},t),{screenshotUploadedImageIds:(null===(o=t.screenshotUploadedImageIds)||void 0===o?void 0:o.length)?t.screenshotUploadedImageIds:void 0,screenshotIdsToDelete:(null===(s=t.screenshotIdsToDelete)||void 0===s?void 0:s.length)?t.screenshotIdsToDelete:void 0}),{method:"put"})];case 1:return n=i.sent(),[4,this.updateTranslationInCache(n)];case 2:return i.sent(),[2,n]}}))}))},e.prototype.createKey=function(e){var t;return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return this.coreService.checkScope("keys.edit"),[4,this.apiHttpService.postJson("v2/projects/keys/create",r(r({},e),{screenshotUploadedImageIds:(null===(t=e.screenshotUploadedImageIds)||void 0===t?void 0:t.length)?e.screenshotUploadedImageIds:void 0}))];case 1:return n=i.sent(),[4,this.updateTranslationInCache(n)];case 2:return i.sent(),[2,n]}}))}))},e.prototype.setTranslations=function(e){return n(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this.coreService.checkScope("translations.edit"),[4,this.apiHttpService.postJson("v2/projects/translations",e)];case 1:return t=r.sent(),[4,this.updateTranslationInCache({id:t.keyId,name:t.keyName,translations:t.translations})];case 2:return r.sent(),[2,t]}}))}))},e.prototype.changeTranslations=function(e){var t=e.key,r=e.translations;return n(this,void 0,void 0,(function(){var e,o=this;return i(this,(function(a){switch(a.label){case 0:return e={},Object.entries(r).forEach((function(r){var n=s(r,2),i=n[0],a=n[1],c=o.translationsCache.get(i);c&&(e[i]=c[t],c[t]=a)})),[4,this.eventService.TRANSLATION_CHANGED.emit({key:t,translations:r})];case 1:return a.sent(),[2,function(){return n(o,void 0,void 0,(function(){var r=this;return i(this,(function(n){switch(n.label){case 0:return Object.entries(e).forEach((function(e){var n=s(e,2),i=n[0],o=n[1],a=r.translationsCache.get(i);a&&(a[t]=o)})),[4,this.eventService.TRANSLATION_CHANGED.emit({key:t,translations:e})];case 1:return n.sent(),[2]}}))}))}]}}))}))},e.prototype.getFromCacheOrFallback=function(t,r,n,i){void 0===r&&(r=this.properties.currentLanguage),void 0===n&&(n=!1);var o=this.getFromCache(t,r)||this.getFromCache(t,this.properties.config.fallbackLanguage);return e.translationByValue(o,t,n,i)},e.prototype.fetchTranslations=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return"development"!==this.properties.config.mode?[3,2]:[4,this.fetchTranslationsDevelopment(e)];case 1:return[2,t.sent()];case 2:return[4,this.fetchTranslationsProduction(e)];case 3:return[2,t.sent()]}}))}))},e.prototype.fetchTranslationsProduction=function(e){var t,r;return n(this,void 0,void 0,(function(){var n,o,s,a;return i(this,(function(i){switch(i.label){case 0:return"function"!=typeof(n=null===(r=null===(t=this.properties.config)||void 0===t?void 0:t.staticData)||void 0===r?void 0:r[e])?[3,2]:[4,n()];case 1:return a=i.sent(),this.setLanguageData(e,a),[2];case 2:if(void 0!==n)return this.setLanguageData(e,n),[2];i.label=3;case 3:o="".concat(this.properties.config.filesUrlPrefix||"/").concat(e,".json"),i.label=4;case 4:return i.trys.push([4,10,,11]),[4,fetch(o)];case 5:if((s=i.sent()).status>=400)return console.error("Server responded with error status while loading localization data."),this.setLanguageData(e,{}),[2];i.label=6;case 6:return i.trys.push([6,8,,9]),[4,s.json()];case 7:return a=i.sent(),this.setLanguageData(e,a),[3,9];case 8:return i.sent(),console.error("Error parsing json retrieved from ".concat(o,".")),this.setEmptyLanguageData(e),[3,9];case 9:return[3,11];case 10:return i.sent(),console.error("Error fetching localization data from ".concat(o,".")),this.setEmptyLanguageData(e),[3,11];case 11:return[2]}}))}))},e.prototype.fetchTranslationsDevelopment=function(e){return n(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:this.coreService.checkScope("translations.view"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.apiHttpService.fetchJson("v2/projects/translations/".concat(e))];case 2:return t=n.sent(),this.setLanguageData(e,t[e]||{}),[3,4];case 3:return r=n.sent(),console.error("Error while fetching localization data from API.",r),this.setEmptyLanguageData(e),[2];case 4:return[2]}}))}))},e.prototype.setEmptyLanguageData=function(e){this.translationsCache.set(e,{})},e.prototype.setLanguageData=function(e,t){var r=function(e){var t={};return Object.entries(e).forEach((function(e){var n=s(e,2),i=n[0],o=n[1];o&&("object"!=typeof o?t[i]=o:Object.entries(r(o)).forEach((function(e){var r=s(e,2),n=r[0],o=r[1];t[i+"."+n]=o})))})),t};this.translationsCache.set(e,r(t))},e.prototype.getFromCache=function(e,t){void 0===t&&(t=this.properties.currentLanguage);var r=this.translationsCache.get(t);if(void 0!==r)return r[e]},e}(),S=function(){function e(){}return e.splitOnNonEscapedDelimiter=function(e,t){for(var r=[],n="",i=!1,o=0;o<e.length;o++){var s=e[o];"\\"!==s||i?i?(i=!1,n+=s):s!==t?n+=s:(r.push(n),n=""):i=!0}return r.push(n),r},e.isCharEscaped=function(e,t){for(var r=0;e>-1&&"\\"===t[e-1];)r++,e--;return r%2==1},e.removeEscapes=function(e){for(var t="",r=!1,n=0;n<e.length;n++){var i=e[n];"\\"!==i||r?r?(r=!1,t+=i):t+=i:r=!0}return t},e}();function A(e){return e.type===p.literal}function L(e){return e.type===p.argument}function P(e){return e.type===p.number}function N(e){return e.type===p.date}function O(e){return e.type===p.time}function C(e){return e.type===p.select}function R(e){return e.type===p.plural}function I(e){return e.type===p.pound}function k(e){return e.type===p.tag}function D(e){return!(!e||"object"!=typeof e||e.type!==f.number)}function U(e){return!(!e||"object"!=typeof e||e.type!==f.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(h||(h={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(p||(p={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(f||(f={}));var M=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,x=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function G(e){var t={};return e.replace(x,(function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"short":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var F=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var H,j=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,V=/^(@+)?(\+|#+)?[rs]?$/g,K=/(\*)(0+)|(#+)(0+)|(0+)/g,X=/^(0+)$/;function B(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(V,(function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),t}function Y(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function z(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!X.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function W(e){var t=Y(e);return t||{}}function J(e){for(var t={},n=0,i=e;n<i.length;n++){var o=i[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=r(r(r({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return r(r({},e),W(t))}),{}));continue;case"engineering":t=r(r(r({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return r(r({},e),W(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(K,(function(e,r,n,i,o,s){if(r)t.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(X.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(j.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(j,(function(e,r,n,i,o,s){return"*"===n?t.minimumFractionDigits=r.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""}));var s=o.options[0];"w"===s?t=r(r({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=r(r({},t),B(s)))}else if(V.test(o.stem))t=r(r({},t),B(o.stem));else{var a=Y(o.stem);a&&(t=r(r({},t),a));var c=z(o.stem);c&&(t=r(r({},t),c))}}return t}var q=new RegExp("^".concat(M.source,"*")),Z=new RegExp("".concat(M.source,"*$"));function $(e,t){return{start:e,end:t}}var Q=!!String.prototype.startsWith,ee=!!String.fromCodePoint,te=!!Object.fromEntries,re=!!String.prototype.codePointAt,ne=!!String.prototype.trimStart,ie=!!String.prototype.trimEnd,oe=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},se=!0;try{se="a"===(null===(H=ge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===H?void 0:H[0])}catch(e){se=!1}var ae,ce=Q?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},ue=ee?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",i=e.length,o=0;i>o;){if((r=e[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},le=te?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t},he=re?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,i=e.charCodeAt(t);return i<55296||i>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},pe=ne?function(e){return e.trimStart()}:function(e){return e.replace(q,"")},fe=ie?function(e){return e.trimEnd()}:function(e){return e.replace(Z,"")};function ge(e,t){return new RegExp(e,t)}if(se){var de=ge("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ae=function(e,t){var r;return de.lastIndex=t,null!==(r=de.exec(e)[1])&&void 0!==r?r:""}}else ae=function(e,t){for(var r=[];;){var n=he(e,t);if(void 0===n||me(n)||Ee(n))break;r.push(n),t+=n>=65536?2:1}return ue.apply(void 0,r)};var ve=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,r)).err)return o;n.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(h.UNMATCHED_CLOSING_TAG,$(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&ye(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:p.pound,location:$(s,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:p.literal,value:"<".concat(n,"/>"),location:$(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ye(this.char()))return this.error(h.INVALID_TAG,$(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(h.UNMATCHED_CLOSING_TAG,$(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:p.tag,value:n,children:o,location:$(r,this.clonePosition())},err:null}:this.error(h.INVALID_TAG,$(s,this.clonePosition())))}return this.error(h.UNCLOSED_TAG,$(r,this.clonePosition()))}return this.error(h.INVALID_TAG,$(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(t);if(i)n+=i;else{var o=this.tryParseUnquoted(e,t);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=$(r,this.clonePosition());return{val:{type:p.literal,value:n,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ye(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return ue.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),ue(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(h.EXPECT_ARGUMENT_CLOSING_BRACE,$(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(h.EMPTY_ARGUMENT,$(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(h.MALFORMED_ARGUMENT,$(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(h.EXPECT_ARGUMENT_CLOSING_BRACE,$(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:p.argument,value:n,location:$(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(h.EXPECT_ARGUMENT_CLOSING_BRACE,$(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(h.MALFORMED_ARGUMENT,$(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=ae(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:$(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(h.EXPECT_ARGUMENT_TYPE,$(s,c));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(v=fe(b.val)).length)return this.error(h.EXPECT_ARGUMENT_STYLE,$(this.clonePosition(),this.clonePosition()));u={style:v,styleLocation:$(l,this.clonePosition())}}if((_=this.tryParseArgumentClose(i)).err)return _;var g=$(i,this.clonePosition());if(u&&ce(null==u?void 0:u.style,"::",0)){var d=pe(u.style.slice(2));if("number"===a)return(b=this.parseNumberSkeletonFromString(d,u.styleLocation)).err?b:{val:{type:p.number,value:n,location:g,style:b.val},err:null};if(0===d.length)return this.error(h.EXPECT_DATE_TIME_SKELETON,g);var v={type:f.dateTime,pattern:d,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?G(d):{}};return{val:{type:"date"===a?p.date:p.time,value:n,location:g,style:v},err:null}}return{val:{type:"number"===a?p.number:"date"===a?p.date:p.time,value:n,location:g,style:null!==(o=null==u?void 0:u.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(h.EXPECT_SELECT_ARGUMENT_OPTIONS,$(y,r({},y)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),E=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(h.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,$(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(h.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,h.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;this.bumpSpace(),m=this.parseIdentifierIfPossible(),E=b.val}var _,T=this.tryParsePluralOrSelectOptions(e,a,t,m);if(T.err)return T;if((_=this.tryParseArgumentClose(i)).err)return _;var w=$(i,this.clonePosition());return"select"===a?{val:{type:p.select,value:n,options:le(T.val),location:w},err:null}:{val:{type:p.plural,value:n,options:le(T.val),offset:E,pluralType:"plural"===a?"cardinal":"ordinal",location:w},err:null};default:return this.error(h.INVALID_ARGUMENT_TYPE,$(s,c))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(h.EXPECT_ARGUMENT_CLOSING_BRACE,$(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(h.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,$(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(F).filter((function(e){return e.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,c=s;a<c.length;a++)if(0===c[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(e){return this.error(h.INVALID_NUMBER_SKELETON,t)}return{val:{type:f.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?J(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var i,o=!1,s=[],a=new Set,c=n.value,u=n.location;;){if(0===c.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var p=this.tryParseDecimalInteger(h.EXPECT_PLURAL_ARGUMENT_SELECTOR,h.INVALID_PLURAL_ARGUMENT_SELECTOR);if(p.err)return p;u=$(l,this.clonePosition()),c=this.message.slice(l.offset,this.offset())}if(a.has(c))return this.error("select"===t?h.DUPLICATE_SELECT_ARGUMENT_SELECTOR:h.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===c&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?h.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:h.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,$(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,t,r);if(g.err)return g;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([c,{value:g.val,location:$(f,this.clonePosition())}]),a.add(c),this.bumpSpace(),c=(i=this.parseIdentifierIfPossible()).value,u=i.location}return 0===s.length?this.error("select"===t?h.EXPECT_SELECT_ARGUMENT_SELECTOR:h.EXPECT_PLURAL_ARGUMENT_SELECTOR,$(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(h.MISSING_OTHER_CLAUSE,$(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=$(n,this.clonePosition());return i?oe(o*=r)?{val:o,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=he(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(ce(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&me(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function ye(e){return e>=97&&e<=122||e>=65&&e<=90}function me(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Ee(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function be(e){e.forEach((function(e){if(delete e.location,C(e)||R(e))for(var t in e.options)delete e.options[t].location,be(e.options[t].value);else P(e)&&D(e.style)||(N(e)||O(e))&&U(e.style)?delete e.style.location:k(e)&&be(e.children)}))}function _e(e,t){void 0===t&&(t={}),t=r({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ve(e,t).parse();if(n.err){var i=SyntaxError(h[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return(null==t?void 0:t.captureLocation)||be(n.val),n.val}function Te(e,t){var r=t&&t.cache?t.cache:Ce,n=t&&t.serializer?t.serializer:Pe;return(t&&t.strategy?t.strategy:Le)(e,{cache:r,serializer:n})}function we(e,t,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=t.get(o);return void 0===s&&(s=e.call(this,n),t.set(o,s)),s}function Se(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return void 0===o&&(o=e.apply(this,n),t.set(i,o)),o}function Ae(e,t,r,n,i){return r.bind(t,e,n,i)}function Le(e,t){return Ae(e,this,1===e.length?we:Se,t.cache.create(),t.serializer)}var Pe=function(){return JSON.stringify(arguments)};function Ne(){this.cache=Object.create(null)}Ne.prototype.get=function(e){return this.cache[e]},Ne.prototype.set=function(e,t){this.cache[e]=t};var Oe,Ce={create:function(){return new Ne}},Re={variadic:function(e,t){return Ae(e,this,Se,t.cache.create(),t.serializer)},monadic:function(e,t){return Ae(e,this,we,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Oe||(Oe={}));var Ie,ke=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return t(r,e),r.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},r}(Error),De=function(e){function r(t,r,n,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Oe.INVALID_VALUE,i)||this}return t(r,e),r}(ke),Ue=function(e){function r(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),Oe.INVALID_VALUE,n)||this}return t(r,e),r}(ke),Me=function(e){function r(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),Oe.MISSING_VALUE,r)||this}return t(r,e),r}(ke);function xe(e){return"function"==typeof e}function Ge(e,t,r,n,i,o,s){if(1===e.length&&A(e[0]))return[{type:Ie.literal,value:e[0].value}];for(var a=[],c=0,u=e;c<u.length;c++){var l=u[c];if(A(l))a.push({type:Ie.literal,value:l.value});else if(I(l))"number"==typeof o&&a.push({type:Ie.literal,value:r.getNumberFormat(t).format(o)});else{var h=l.value;if(!i||!(h in i))throw new Me(h,s);var p=i[h];if(L(l))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),a.push({type:"string"==typeof p?Ie.literal:Ie.object,value:p});else if(N(l)){var f="string"==typeof l.style?n.date[l.style]:U(l.style)?l.style.parsedOptions:void 0;a.push({type:Ie.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(O(l)){f="string"==typeof l.style?n.time[l.style]:U(l.style)?l.style.parsedOptions:void 0;a.push({type:Ie.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(P(l)){(f="string"==typeof l.style?n.number[l.style]:D(l.style)?l.style.parsedOptions:void 0)&&f.scale&&(p*=f.scale||1),a.push({type:Ie.literal,value:r.getNumberFormat(t,f).format(p)})}else{if(k(l)){var g=l.children,d=l.value,v=i[d];if(!xe(v))throw new Ue(d,"function",s);var y=v(Ge(g,t,r,n,i,o).map((function(e){return e.value})));Array.isArray(y)||(y=[y]),a.push.apply(a,y.map((function(e){return{type:"string"==typeof e?Ie.literal:Ie.object,value:e}})))}if(C(l)){if(!(m=l.options[p]||l.options.other))throw new De(l.value,p,Object.keys(l.options),s);a.push.apply(a,Ge(m.value,t,r,n,i))}else if(R(l)){var m;if(!(m=l.options["=".concat(p)])){if(!Intl.PluralRules)throw new ke('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Oe.MISSING_INTL_API,s);var E=r.getPluralRules(t,{type:l.pluralType}).select(p-(l.offset||0));m=l.options[E]||l.options.other}if(!m)throw new De(l.value,p,Object.keys(l.options),s);a.push.apply(a,Ge(m.value,t,r,n,i,p-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var r=e[e.length-1];return r&&r.type===Ie.literal&&t.type===Ie.literal?r.value+=t.value:e.push(t),e}),[])}(a)}function Fe(e,t){return t?Object.keys(e).reduce((function(n,i){var o,s;return n[i]=(o=e[i],(s=t[i])?r(r(r({},o||{}),s||{}),Object.keys(o).reduce((function(e,t){return e[t]=r(r({},o[t]),s[t]||{}),e}),{})):o),n}),r({},e)):e}function He(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Ie||(Ie={}));var je=function(){function e(t,r,n,i){var o,s=this;if(void 0===r&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&t.type===Ie.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return Ge(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:null==i?void 0:i.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Fe(e.formats,n),this.locales=r,this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Te((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,a([void 0],t,!1)))}),{cache:He(o.number),strategy:Re.variadic}),getDateTimeFormat:Te((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,a([void 0],t,!1)))}),{cache:He(o.dateTime),strategy:Re.variadic}),getPluralRules:Te((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,a([void 0],t,!1)))}),{cache:He(o.pluralRules),strategy:Re.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=_e,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),Ve=function(){function e(e,t){var r=this;this.properties=e,this.translationService=t,this.format=function(e,t){try{return new je(e,r.properties.currentLanguage).format(t)}catch(e){console.error(e)}},this.escapeForRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},this.escapeParam=function(e){return"string"==typeof e?e.replace(/[,:\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(e),console.warn("Unsupported value type of above param. Consider converting to string."),e)}}return Object.defineProperty(e.prototype,"rawUnWrapRegex",{get:function(){var e=this.escapeForRegExp(this.properties.config.inputPrefix),t=this.escapeForRegExp(this.properties.config.inputSuffix);return"(\\\\?)(".concat(e,"(.*?)").concat(t,")")},enumerable:!1,configurable:!0}),e.parseUnwrapped=function(e){var t,r,n=!1,i="",s="",a="KEY",c={key:"",params:{},defaultValue:void 0};try{for(var u=o(e),l=u.next();!l.done;l=u.next()){var h=l.value;"\\"!==h||n?n?(n=!1,i+=h):"KEY"!==a||","!==h?"KEY"!==a||":"!==h?"DEFAULT_VALUE"!==a||":"!==h?"PARAM_NAME"!==a||":"!==h?"PARAM_VALUE"!==a||","!==h?i+=h:(a="PARAM_NAME",c.params[s]=i,i=""):(a="PARAM_VALUE",s=i,i=""):(a="PARAM_NAME",c.defaultValue=i,i=""):(a="PARAM_NAME",c.key=i,i=""):(a="DEFAULT_VALUE",c.key=i,i=""):n=!0}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return"KEY"===a&&(c.key=i),"DEFAULT_VALUE"===a&&(c.defaultValue=i),"PARAM_VALUE"===a&&(c.params[s]=i),c},e.prototype.translate=function(e,t,r,o,s){return void 0===r&&(r=this.properties.currentLanguage),n(this,void 0,void 0,(function(){var n,a;return i(this,(function(i){switch(i.label){case 0:return a=this.format,[4,this.translationService.getTranslation(e,r,o,s)];case 1:return void 0!==(n=a.apply(this,[i.sent(),t]))?[2,n]:[2,e]}}))}))},e.prototype.instant=function(e,t,r,n,i){void 0===r&&(r=this.properties.currentLanguage);var o=this.format(this.translationService.getFromCacheOrFallback(e,r,n,i),t);return void 0!==o?o:e},e.prototype.replace=function(e){return n(this,void 0,void 0,(function(){var t,r,n,o,a,c,u,l,h,p,f,g,d,v;return i(this,(function(i){switch(i.label){case 0:t=new RegExp(this.rawUnWrapRegex,"gs"),r=[],n=!1,a=0,c="",i.label=1;case 1:if(null===(o=t.exec(e)))return[3,3];if(u=o[1],l=s(o,4),h=l[0],p=l[2],f=l[3],g=o.index,d=o.input,c+=d.substr(a,g-a),a=g+h.length,"\\"===u){if(!S.isCharEscaped(g,e))return c+=p,[3,1];u=""}return[4,this.getTranslatedWithMetadata(f)];case 2:return v=i.sent(),r.push({key:v.key,params:v.params,defaultValue:v.defaultValue}),n=!0,c+=u+v.translated,[3,1];case 3:return c+=e.substring(a),n?[2,{text:c,keys:r}]:[2,void 0]}}))}))},e.prototype.wrap=function(e,t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=void 0);var i=Object.entries(t).map((function(e){var t=s(e,2),r=t[0],i=t[1];return"".concat(n.escapeParam(r),":").concat(n.escapeParam(i))})).join(",");i=i.length?":".concat(i):"";var o=void 0!==r?",".concat(this.escapeParam(r)):"";return"".concat(this.properties.config.inputPrefix).concat(this.escapeParam(e)).concat(o).concat(i).concat(this.properties.config.inputSuffix)},e.prototype.getTranslatedWithMetadata=function(t){return n(this,void 0,void 0,(function(){var r,n,o,s;return i(this,(function(i){switch(i.label){case 0:return r=e.parseUnwrapped(t),n=r.key,o=r.params,s=r.defaultValue,[4,this.translate(n,o,void 0,!1,s)];case 1:return[2,{translated:i.sent(),key:n,params:o,defaultValue:s}]}}))}))},e}(),Ke=function(){function e(e){this.properties=e,this.keysDown=new Set,this.mouseOn=new Set,this.mouseOnChanged=new m,this.keysChanged=new m,"undefined"==typeof window||this.initKeyListener()}return e.prototype.handle=function(e,t){var r=this;e._tolgee.listeningForHighlighting?console.error("Element is already listening mouse events! This is probably bug in tolgee"):(e._tolgee.listeningForHighlighting=!0,this.initEventListeners(e,t),this.mouseOnChanged.subscribe((function(){r.highlighted!==r.getMouseOn()&&r.onConditionsChanged()})),this.keysChanged.subscribe((function(){r.onConditionsChanged()})))},e.prototype.initEventListeners=function(e,t){var r=this,n=function(){return r.onMouseOver(e)},i=function(){return r.onMouseOut(e)},o=function(e){r.areKeysDown()&&(e.stopPropagation(),e.preventDefault(),t(e))};e.addEventListener("mouseover",n),e.addEventListener("click",o,{capture:!0});var s=function(e){r.areKeysDown()&&(e.stopPropagation(),e.preventDefault())};e.addEventListener("mousedown",s),e.addEventListener("mouseup",s),e.addEventListener("mouseout",i),e._tolgee.removeAllEventListeners=function(){e.removeEventListener("mousedown",s),e.removeEventListener("mouseup",s),e.removeEventListener("mouseover",n),e.removeEventListener("click",o,{capture:!0}),e.removeEventListener("mouseout",i)}},e.prototype.onConditionsChanged=function(){this.unhighlight(),this.areKeysDown()&&this.getMouseOn()&&this.highlight()},e.prototype.highlight=function(){this.getMouseOn()._tolgee.highlight(),this.highlighted=this.getMouseOn()},e.prototype.unhighlight=function(){this.highlighted&&(this.highlighted._tolgee.unhighlight(),this.highlighted=null)},e.prototype.onMouseOut=function(e){e._tolgee.preventClean=!1,this.mouseOn.delete(e),this.mouseOnChanged.emit(this.getMouseOn())},e.prototype.onMouseOver=function(e){this.filterMouseOn(),e._tolgee.preventClean=!0,this.mouseOn.delete(e),this.mouseOn.add(e),this.mouseOnChanged.emit(this.getMouseOn())},e.prototype.getMouseOn=function(){var e=Array.from(this.mouseOn);return e.length?e[0]:void 0},e.prototype.initKeyListener=function(){var e=this;window.addEventListener("blur",(function(){e.keysDown=new Set,e.keysChanged.emit(e.areKeysDown())})),window.addEventListener("keydown",(function(t){var r=c[t.key];void 0!==r&&(e.keysDown.add(r),e.keysChanged.emit(e.areKeysDown()))})),window.addEventListener("keyup",(function(t){e.keysDown.delete(c[t.key]),e.keysChanged.emit(e.areKeysDown())}))},e.prototype.filterMouseOn=function(){var e=this;this.mouseOn.forEach((function(t){document.contains(t)||e.mouseOn.delete(t)}))},e.prototype.areKeysDown=function(){var e,t;try{for(var r=o(this.properties.config.highlightKeys),n=r.next();!n.done;n=r.next()){var i=n.value;if(!this.keysDown.has(i))return!1}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return!0},e}(),Xe=function(){function e(e){var t=this;this.dependencies=e,this.translationEdit=function(e,r){return n(t,void 0,void 0,(function(){var t,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getRenderer()];case 1:return"object"!=typeof(t=i.sent())?[3,3]:[4,this.getKeyAndDefault(e,r)];case 2:return(n=i.sent())?(t.renderViewer(n.key,n.defaultValue),[2]):[2];case 3:return[2]}}))}))}}return e.getKeyOptions=function(e){return Array.from(e._tolgee.nodes).reduce((function(e,t){return a(a([],s(e),!1),s(t._tolgee.keys.map((function(e){return{key:e.key,defaultValue:e.defaultValue}}))),!1)}),[])},e.prototype.listen=function(e){var t=this;this.dependencies.highlightFunctionInitializer.initFunctions(e),this.dependencies.mouseEventHandler.handle(e,(function(r){return n(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.translationEdit(r,e)];case 1:return[2,t.sent()]}}))}))}))},e.prototype.getRenderer=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,s,a,c,u;return i(this,(function(i){switch(i.label){case 0:if(void 0!==this._renderer)return[3,11];e=[this.dependencies.properties.config.ui,window["@tolgee/ui"]],i.label=1;case 1:i.trys.push([1,8,9,10]),t=o(e),r=t.next(),i.label=2;case 2:if(r.done)return[3,7];if("function"!=typeof(n=r.value))return[3,6];i.label=3;case 3:return i.trys.push([3,5,,6]),[4,n()];case 4:return s=i.sent(),this._renderer=new s(this.dependencies),[3,6];case 5:return i.sent(),s=n,this._renderer=new s(this.dependencies),[3,6];case 6:return r=t.next(),[3,2];case 7:return[3,10];case 8:return a=i.sent(),c={error:a},[3,10];case 9:try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(c)throw c.error}return[7];case 10:void 0===this._renderer&&console.warn('Tolgee UI is not provided. To translate interactively provide tolgee ui constructor to "ui" configuration property. To disable highlighting use production mode.'),i.label=11;case 11:return[2,this._renderer]}}))}))},e.prototype.getKeyAndDefault=function(t,r){return n(this,void 0,void 0,(function(){var n,o,s,a;return i(this,(function(i){switch(i.label){case 0:return r._tolgee.wrappedWithElementOnlyKey?[2,{key:r._tolgee.wrappedWithElementOnlyKey,defaultValue:r._tolgee.wrappedWithElementOnlyDefaultHtml}]:(n=e.getKeyOptions(r),(o=new Set(n.map((function(e){return e.key})))).size>1?[4,this.getRenderer()]:[3,3]);case 1:return[4,i.sent().getKey({keys:o,openEvent:t})];case 2:if(s=i.sent(),a=n.find((function(e){return e.key===s})))return[2,a];i.label=3;case 3:return 1===o.size?[2,n[0]]:(console.error("No key to translate. This seems like a bug in tolgee."),[2])}}))}))},e}(),Be=function(){function e(e,t,r){this.properties=e,this.translationHighlighter=t,this.eventService=r,this.registeredElements=new Set}return e.prototype.register=function(e){(void 0!==this.getActiveNodes(e).next().value||e._tolgee.wrappedWithElementOnlyKey)&&("development"!==this.properties.config.mode||this.registeredElements.has(e)||this.translationHighlighter.listen(e),this.registeredElements.add(e),this.eventService.ELEMENT_REGISTERED.emit(e))},e.prototype.refreshAll=function(){var e,t;try{for(var r=o(this.registeredElements),n=r.next();!n.done;n=r.next()){var i=n.value;i._tolgee.preventClean||(this.cleanElementInactiveNodes(i),0!==i._tolgee.nodes.size||i._tolgee.wrappedWithElementOnlyKey||this.cleanElement(i))}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.cleanAll=function(){var e,t;try{for(var r=o(this.registeredElements),n=r.next();!n.done;n=r.next()){var i=n.value;this.cleanElement(i)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.findAllByKey=function(e){var t,r,n,i,s=[];try{for(var a=o(this.registeredElements),c=a.next();!c.done;c=a.next()){var u=c.value;if(u._tolgee.wrappedWithElementOnlyKey!==e)try{for(var l=(n=void 0,o(u._tolgee.nodes)),h=l.next();!h.done;h=l.next()){if(h.value._tolgee.keys.findIndex((function(t){return t.key===e}))>-1){s.push(u);break}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}else s.push(u)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return s},e.prototype.cleanElementInactiveNodes=function(e){this.isElementActive(e)&&(e._tolgee.nodes=new Set(this.getActiveNodes(e)))},e.prototype.cleanElement=function(e){e._tolgee.preventClean||("function"==typeof e._tolgee.removeAllEventListeners&&e._tolgee.removeAllEventListeners(),e.removeAttribute("_tolgee"),delete e._tolgee,this.registeredElements.delete(e))},e.prototype.getActiveNodes=function(e){var t,r,n,s,a,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,7]),t=o(e._tolgee.nodes),r=t.next(),i.label=1;case 1:return r.done?[3,4]:(n=r.value,l.nodeContains(this.properties.config.targetElement,n)?[4,n]:[3,3]);case 2:i.sent(),i.label=3;case 3:return r=t.next(),[3,1];case 4:return[3,7];case 5:return s=i.sent(),a={error:s},[3,7];case 6:try{r&&!r.done&&(c=t.return)&&c.call(t)}finally{if(a)throw a.error}return[7];case 7:return[2]}}))},e.prototype.isElementActive=function(e){return this.properties.config.targetElement.contains(e)},e}(),Ye=function(){function e(e,t,r,n){this.properties=e,this.textService=t,this.elementRegistrar=r,this.translationHighlighter=n}return e.initParentElement=function(e){return void 0===e._tolgee&&(e._tolgee={nodes:new Set},e.setAttribute("_tolgee","")),e},e.prototype.filterRestricted=function(e){var t=this.properties.config.restrictedElements;return e.filter((function(e){var r=l.closestElement(e);return-1===t.indexOf(r.tagName.toLowerCase())&&null===r.closest("[".concat("data-tolgee-restricted",'="true"]'))}))},e.prototype.handleNodes=function(e){return n(this,void 0,void 0,(function(){var t,r,n,s,a,c,u,l,h,p,f,g;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,7]),t=o(e),r=t.next(),i.label=1;case 1:return r.done?[3,4]:(void 0===(n=r.value)._tolgee&&(n._tolgee={}),!0===(null==(s=n._tolgee)?void 0:s.locked)?[3,3]:(this.lockNode(n),[4,this.textService.replace(n.textContent)]));case 2:(a=i.sent())&&(c=a.text,u=a.keys,l=this.translateChildNode(n,c,u),(h=this.getParentElement(l))._tolgee.nodes.add(l),this.elementRegistrar.register(h)),this.unlockNode(n),i.label=3;case 3:return r=t.next(),[3,1];case 4:return[3,7];case 5:return p=i.sent(),f={error:p},[3,7];case 6:try{r&&!r.done&&(g=t.return)&&g.call(t)}finally{if(f)throw f.error}return[7];case 7:return[2]}}))}))},e.prototype.translateChildNode=function(e,t,r){return e._tolgee={oldTextContent:e.textContent,keys:r},e.textContent=t,e},e.prototype.lockNode=function(e){void 0===e._tolgee&&(e._tolgee={});var t=e._tolgee;return!0!==(null==t?void 0:t.locked)&&(t.locked=!0),e},e.prototype.unlockNode=function(e){e._tolgee&&(e._tolgee.locked=!1)},e.prototype.getParentElement=function(t){var r=this.getSuitableParent(t);return e.initParentElement(r)},e.prototype.getSuitableParent=function(e){var t=l.getParentElement(e);if(void 0===t)throw console.error(e),new Error("No suitable parent found for node above.");if(!this.properties.config.passToParent)return t;if(Array.isArray(this.properties.config.passToParent)){if(-1===this.properties.config.passToParent.findIndex((function(e){return t.tagName.toLowerCase()===e.toLowerCase()})))return t}return"function"!=typeof this.properties.config.passToParent||this.properties.config.passToParent(t)?this.getSuitableParent(t):t},e}(),ze=function(e){function r(t,r,n,i){var o=e.call(this,t,n,i,r)||this;return o.properties=t,o.translationHighlighter=r,o.textService=n,o.nodeRegistrar=i,o}return t(r,e),r.prototype.handle=function(e){return n(this,void 0,void 0,(function(){var t,r,n,o,s;return i(this,(function(i){switch(i.label){case 0:return t=this.properties.config.inputPrefix,r=this.properties.config.inputSuffix,n="./descendant-or-self::text()[contains(., '".concat(t,"') and contains(., '").concat(r,"')]"),o=l.evaluate(n,e),s=this.filterRestricted(o),[4,this.handleNodes(s)];case 1:return i.sent(),[2]}}))}))},r}(Ye),We=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return o.properties=t,o.textService=r,o.elementRegistrar=n,o.translationHighlighter=i,o}return t(r,e),r.prototype.handle=function(e){return n(this,void 0,void 0,(function(){var t,r,n,a,c,u,h,p,f,g,d,v,y,m,E,b,_,T;return i(this,(function(i){switch(i.label){case 0:t=this.properties.config.inputPrefix,r=this.properties.config.inputSuffix,i.label=1;case 1:i.trys.push([1,12,13,14]),n=o(Object.entries(this.properties.config.tagAttributes)),a=n.next(),i.label=2;case 2:if(a.done)return[3,11];c=s(a.value,2),u=c[0],h=c[1],i.label=3;case 3:i.trys.push([3,8,9,10]),_=void 0,p=o(h),f=p.next(),i.label=4;case 4:return f.done?[3,7]:(g=f.value,d="descendant-or-self::".concat(u,"/@").concat(g,"[contains(., '").concat(t,"') and contains(., '").concat(r,"')]"),v=l.evaluate(d,e),[4,this.handleNodes(v)]);case 5:i.sent(),i.label=6;case 6:return f=p.next(),[3,4];case 7:return[3,10];case 8:return y=i.sent(),_={error:y},[3,10];case 9:try{f&&!f.done&&(T=p.return)&&T.call(p)}finally{if(_)throw _.error}return[7];case 10:return a=n.next(),[3,2];case 11:return[3,14];case 12:return m=i.sent(),E={error:m},[3,14];case 13:try{a&&!a.done&&(b=n.return)&&b.call(n)}finally{if(E)throw E.error}return[7];case 14:return[2]}}))}))},r}(Ye),Je=function(){function e(e,t,r,n,i,o,s){this.service=e,this.textHandler=t,this.eventService=r,this.properties=n,this.attributeHandler=i,this.textService=o,this.wrappedHandler=s,"undefined"!=typeof window&&(r.LANGUAGE_CHANGED.subscribe(this.refresh.bind(this)),r.TRANSLATION_CHANGED.subscribe(this.refresh.bind(this)))}return e.prototype.handleSubtree=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.attributeHandler.handle(e)];case 1:return t.sent(),[4,this.textHandler.handle(e)];case 2:return t.sent(),[4,this.wrappedHandler.handle(e)];case 3:return t.sent(),[2]}}))}))},e.prototype.refresh=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,s,a,c,u,h,p,f,g,d,v;return i(this,(function(i){switch(i.label){case 0:e=l.evaluate("//*[@_tolgee]",this.properties.config.targetElement),i.label=1;case 1:i.trys.push([1,12,13,14]),t=o(e),r=t.next(),i.label=2;case 2:if(r.done)return[3,11];n=r.value,i.label=3;case 3:i.trys.push([3,8,9,10]),d=void 0,s=o(n._tolgee.nodes),a=s.next(),i.label=4;case 4:return a.done?[3,7]:(c=a.value,[4,this.textService.replace(c._tolgee.oldTextContent)]);case 5:(u=i.sent())&&(c.textContent=u.text),i.label=6;case 6:return a=s.next(),[3,4];case 7:return[3,10];case 8:return h=i.sent(),d={error:h},[3,10];case 9:try{a&&!a.done&&(v=s.return)&&v.call(s)}finally{if(d)throw d.error}return[7];case 10:return r=t.next(),[3,2];case 11:return[3,14];case 12:return p=i.sent(),f={error:p},[3,14];case 13:try{r&&!r.done&&(g=t.return)&&g.call(t)}finally{if(f)throw f.error}return[7];case 14:return[2]}}))}))},e}(),qe=function(){function e(e,t,r,n,i){this.properties=e,this.coreHandler=t,this.basicTextHandler=r,this.attributeHandler=n,this.nodeRegistrar=i,this._observer=void 0}return Object.defineProperty(e.prototype,"observer",{get:function(){var e=this;return this._observer||"undefined"==typeof window||(this._observer=new MutationObserver((function(t){return n(e,void 0,void 0,(function(){var e,r,n,s,a,c;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,9,10,11]),e=o(t),r=e.next(),i.label=1;case 1:return r.done?[3,8]:"characterData"!==(n=r.value).type?[3,3]:[4,this.basicTextHandler.handle(n.target)];case 2:return i.sent(),[3,7];case 3:return"childList"!==n.type?[3,5]:[4,this.coreHandler.handleSubtree(n.target)];case 4:return i.sent(),[3,7];case 5:return"attributes"!==n.type?[3,7]:[4,this.attributeHandler.handle(n.target)];case 6:i.sent(),i.label=7;case 7:return r=e.next(),[3,1];case 8:return[3,11];case 9:return s=i.sent(),a={error:s},[3,11];case 10:try{r&&!r.done&&(c=e.return)&&c.call(e)}finally{if(a)throw a.error}return[7];case 11:return this.nodeRegistrar.refreshAll(),[2]}}))}))}))),this._observer},enumerable:!1,configurable:!0}),e.prototype.observe=function(){this.observer&&this.observer.observe(this.properties.config.targetElement,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},e.prototype.stopObserving=function(){this.observer&&this.observer.disconnect()},e}(),Ze=function(){function e(e,t){this.properties=e,this.apiHttpService=t}return e.prototype.getLanguages=function(){return n(this,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return this.languagePromise instanceof Promise||(this.languagePromise=this.apiHttpService.fetchJson("v2/projects/languages?size=1000")),t=Set.bind,[4,this.languagePromise];case 1:return e=new(t.apply(Set,[void 0,r.sent()._embedded.languages.map((function(e){return e.tag}))])),this.properties.preferredLanguages=new Set(Array.from(this.properties.preferredLanguages).filter((function(t){return e.has(t)}))),[2,e]}}))}))},e.prototype.getLanguagesFull=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.getLanguages(),[4,this.languagePromise];case 1:return[2,e.sent()._embedded.languages]}}))}))},e.prototype.getApiKeyDetails=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.apiHttpService.fetchJson("v2/api-keys/current")];case 1:return[2,t.sent()];case 2:return e=t.sent(),console.error(e),console.error("Error getting scopes. Trying to switch to production mode!"),this.properties.config.mode="production",[3,3];case 3:return[2]}}))}))},e.prototype.isAuthorizedTo=function(e){return this.properties.scopes.indexOf(e)>-1},e.prototype.checkScope=function(e){if(!this.isAuthorizedTo(e))throw new Error("Api key not permitted to do this, please add 'translations.view' scope.")},e}(),$e=function(e){function r(t,r,n,i){var o=e.call(this,t,n,i,r)||this;return o.properties=t,o.translationHighlighter=r,o.textService=n,o.elementRegistrar=i,o}return t(r,e),r.prototype.handle=function(e){return n(this,void 0,void 0,(function(){var t,r,n=this;return i(this,(function(i){return t="./descendant-or-self::*[@".concat("data-tolgee-key-only","]"),r=l.evaluate(t,e),this.filterRestricted(r).forEach((function(e){var t=Ye.initParentElement(e);t._tolgee.wrappedWithElementOnlyKey=e.getAttribute("data-tolgee-key-only"),t._tolgee.wrappedWithElementOnlyDefaultHtml=e.innerHTML,n.elementRegistrar.register(t)})),[2]}))}))},r}(Ye),Qe=function(){function e(e,t,o,s,a){var c=this;this.messages=e,this.properties=t,this.eventService=o,this.elementRegistrar=s,this.translationService=a,this.handshakeSucceed=!1,this.takeScreenshot=function(e){return new Promise((function(t,r){c.translationService.changeTranslations(e).then((function(o){return n(c,void 0,void 0,(function(){var n,s,a=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.highlightAllByKey(e.key),[4,(c=100,new Promise((function(e){return setTimeout(e,c)})))];case 1:return i.sent(),this.messages.send("TOLGEE_TAKE_SCREENSHOT"),n=this.messages.listen("TOLGEE_SCREENSHOT_TAKEN",(function(r){a.unhighlightAllByKey(e.key),t(r),o(),n()})),[3,3];case 2:return s=i.sent(),o(),r(s),[3,3];case 3:return[2]}var c}))}))})).catch((function(e){r(e)}))}))},this.handshake=function(){var e=r(r({},c.properties),{config:r(r({},c.properties.config),{staticData:void 0,targetElement:void 0,_targetElement:void 0,ui:void 0})}),t=null,n=function(){c.messages.send("TOLGEE_READY",e)},i=function(){clearInterval(t)};c.messages.listen("TOLGEE_PLUGIN_READY",(function(){c.handshakeSucceed=!0,c.messages.send("TOLGEE_READY",e),i()})),n();var o=0;t=setInterval((function(){!c.handshakeSucceed&&o<5?(n(),o+=1):i()}),200)}}return e.prototype.run=function(){try{this.messages.startListening(),this.handshake()}catch(e){console.warn(e),console.warn("Can not start communication with browser plugin. Check waning above.")}},e.prototype.stop=function(){this.messages.stopListening()},e.prototype.highlightAllByKey=function(e){this.elementRegistrar.findAllByKey(e).forEach((function(e){return e._tolgee.highlight()}))},e.prototype.unhighlightAllByKey=function(e){this.elementRegistrar.findAllByKey(e).forEach((function(e){return e._tolgee.unhighlight()}))},e}(),et=function(){function e(){var e=this;this.listeners=[],this.startListening=function(){var t=function(t){t.source==window&&e.listeners.forEach((function(e){e.type==t.data.type&&e.callback(t.data.data)}))};window.addEventListener("message",t,!1),"function"==typeof e._stopListening&&e._stopListening(),e._stopListening=function(){window.removeEventListener("message",t,!1)}},this.listen=function(t,r){var n={type:t,callback:r};return e.listeners.push(n),function(){e.listeners.splice(e.listeners.indexOf(n),1)}},this.send=function(e,t){try{window.postMessage({type:e,data:t},window.origin)}catch(e){console.warn("Cannot send message.",e)}}}return e.prototype.stopListening=function(){this._stopListening()},e}(),tt=function(){function e(e){this.properties=e}return e.prototype.initFunctions=function(e){this.initHighlightFunction(e),this.initUnhighlightFunction(e)},e.prototype.initHighlightFunction=function(e){var t=this;e._tolgee.highlight=function(){e._tolgee.initialBackgroundColor=e.style.backgroundColor,e.style.backgroundColor=t.properties.config.highlightColor}},e.prototype.initUnhighlightFunction=function(e){e._tolgee.unhighlight=function(){e.style.backgroundColor=e._tolgee.initialBackgroundColor}},e}(),rt=function(){function e(e,t){this.coreService=e,this.apiHttpService=t}return e.prototype.uploadImage=function(e){return n(this,void 0,void 0,(function(){var t;return i(this,(function(r){return(t=new FormData).append("image",e),[2,this.apiHttpService.postJson("v2/image-upload",void 0,{headers:{},body:t})]}))}))},e.prototype.deleteImages=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.apiHttpService.post("v2/image-upload/".concat(e.join(",")),void 0,{method:"delete"})]}))}))},e}(),nt=function(e){void 0===e&&(e=new d),this.properties=new v,this.eventService=new E,this.apiHttpService=new _(this.properties),this.mouseEventHandler=new Ke(this.properties),this.coreService=new Ze(this.properties,this.apiHttpService),this.screenshotService=new rt(this.coreService,this.apiHttpService),this.translationService=new w(this.properties,this.coreService,this.apiHttpService,this.eventService),this.textService=new Ve(this.properties,this.translationService),this.highlightFunctionInitializer=new tt(this.properties),this.translationHighlighter=new Xe(this),this.elementRegistrar=new Be(this.properties,this.translationHighlighter,this.eventService),this.textHandler=new ze(this.properties,this.translationHighlighter,this.textService,this.elementRegistrar),this.attributeHandler=new We(this.properties,this.textService,this.elementRegistrar,this.translationHighlighter),this.wrappedHandler=new $e(this.properties,this.translationHighlighter,this.textService,this.elementRegistrar),this.coreHandler=new Je(this.coreService,this.textHandler,this.eventService,this.properties,this.attributeHandler,this.textService,this.wrappedHandler),this.observer=new qe(this.properties,this.coreHandler,this.textHandler,this.attributeHandler,this.elementRegistrar),this.messages=new et,this.pluginManager=new Qe(this.messages,this.properties,this.eventService,this.elementRegistrar,this.translationService),this.properties.config=e,this.translationService.initStatic(),this.translationHighlighter.pluginManager=this.pluginManager},it=function(){function e(e){var t=this;this.stop=function(){t.dependencyStore.observer.stopObserving(),t.dependencyStore.elementRegistrar.cleanAll(),l.unmarkElementAsTargetElement(t.properties.config.targetElement)},this.dependencyStore=new nt(new d(e))}return Object.defineProperty(e.prototype,"properties",{get:function(){return this.dependencyStore.properties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translationService",{get:function(){return this.dependencyStore.translationService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coreService",{get:function(){return this.dependencyStore.coreService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lang",{get:function(){return this.properties.currentLanguage},set:function(e){this.properties.currentLanguage=e,this.dependencyStore.eventService.LANGUAGE_CHANGED.emit(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultLanguage",{get:function(){return this.properties.config.defaultLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLangChange",{get:function(){return this.dependencyStore.eventService.LANGUAGE_CHANGED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTranslationChange",{get:function(){return this.dependencyStore.eventService.TRANSLATION_CHANGED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLangLoaded",{get:function(){return this.dependencyStore.eventService.LANGUAGE_LOADED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initialLoading",{get:function(){var e,t,r,n;if("production"!==(null===(t=null===(e=this.properties)||void 0===e?void 0:e.config)||void 0===t?void 0:t.mode))return!0;var i=this.properties.currentLanguage,o=this.properties.config.fallbackLanguage,s=this.properties.config.preloadFallback,a=function(e){return void 0!==e&&"function"!=typeof e};return!a(null===(r=this.properties.config.staticData)||void 0===r?void 0:r[i])||!!s&&!a(null===(n=this.properties.config.staticData)||void 0===n?void 0:n[o])},enumerable:!1,configurable:!0}),e.prototype.run=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return"development"!==this.properties.config.mode?[3,2]:[4,this.loadApiKeyDetails()];case 1:e.sent(),e.label=2;case 2:return[4,this.translationService.loadTranslations()];case 3:return e.sent(),[4,this.dependencyStore.pluginManager.run()];case 4:return e.sent(),this.properties.config.preloadFallback?[4,this.translationService.loadTranslations(this.properties.config.fallbackLanguage)]:[3,6];case 5:e.sent(),e.label=6;case 6:return[4,this.refresh()];case 7:return e.sent(),this.properties.config.watch&&this.dependencyStore.observer.observe(),[2]}}))}))},e.prototype.refresh=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.dependencyStore.coreHandler.handleSubtree(this.properties.config.targetElement)]}))}))},e.prototype.translate=function(e,t,r,o){return void 0===t&&(t={}),void 0===r&&(r=!1),void 0===o&&(o=void 0),n(this,void 0,void 0,(function(){var n,s,a;return i(this,(function(i){switch(i.label){case 0:return n="string"==typeof e?e:e.key,s=void 0,"object"==typeof e&&(t=void 0!==(a=e).params?a.params:t,r=void 0!==a.noWrap?a.noWrap:r,o=void 0!==a.defaultValue?a.defaultValue:o,s=a.orEmpty),"development"!==this.properties.config.mode||r?[3,3]:[4,this.loadApiKeyDetails()];case 1:return i.sent(),[4,this.translationService.loadTranslations()];case 2:return i.sent(),[2,this.dependencyStore.textService.wrap(n,t,o)];case 3:return[2,this.dependencyStore.textService.translate(n,t,void 0,s,o)]}}))}))},e.prototype.instant=function(e,t,r,n,i){void 0===t&&(t={}),void 0===r&&(r=!1);var o="string"==typeof e?e:e.key;if("object"==typeof e){var s=e;t=void 0!==s.params?s.params:t,r=void 0!==s.noWrap?s.noWrap:r,i=void 0!==s.defaultValue?s.defaultValue:i,n=void 0!==s.orEmpty?s.orEmpty:n}return"development"!==this.properties.config.mode||r?this.dependencyStore.textService.instant(o,t,void 0,n,i):this.dependencyStore.textService.wrap(o,t,i)},e.prototype.loadApiKeyDetails=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return void 0!==this.properties.scopes?[3,2]:[4,this.dependencyStore.coreService.getApiKeyDetails()];case 1:e=t.sent(),this.properties.scopes=e.scopes,this.properties.projectId=e.projectId,t.label=2;case 2:return[2]}}))}))},e}();export{c as ModifierKey,u as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,it as Tolgee,d as TolgeeConfig,T as TranslationData};
15
+ var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var u,c=function(){function e(){}return Object.defineProperty(e.prototype,"currentLanguage",{get:function(){var e;if(this.config.forceLanguage)return this.config.forceLanguage;if("undefined"!=typeof localStorage){var t=localStorage.getItem("__tolgee_currentLanguage");if(t&&(e=t),this.config.availableLanguages)this.config.availableLanguages.indexOf(e)>-1||(e=void 0)}else e=this._currentLanguage;return e||(e=this.getLanguageByNavigator(),this.currentLanguage=e),e},set:function(e){if(!e)throw new Error("Setting invalid language value ".concat(e));"undefined"!=typeof localStorage?localStorage.setItem("__tolgee_currentLanguage",e):this._currentLanguage=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"preferredLanguages",{get:function(){return new Set(JSON.parse(localStorage.getItem("__tolgee_preferredLanguages")))},set:function(e){localStorage.setItem("__tolgee_preferredLanguages",JSON.stringify(Array.from(e)))},enumerable:!1,configurable:!0}),e.prototype.getLanguageByNavigator=function(){if("undefined"!=typeof window&&this.config.availableLanguages){var e=window.navigator.language,t=this.config.availableLanguages.find((function(t){return t===e}));if(t)return t;var n=function(e){return e.replace(/^(.+?)(-.*)?$/,"$1")},r=n(window.navigator.language),i=this.config.availableLanguages.find((function(e){return n(e)===r}));if(i)return i}return this.config.defaultLanguage},e}(),l=function(){function e(e){this.onUnsubscribe=e}return e.prototype.unsubscribe=function(){this.onUnsubscribe()},e}(),h=function(){function e(){this.idCounter=0,this._subscriptions=new Map}return Object.defineProperty(e.prototype,"subscriptions",{get:function(){return this._subscriptions},enumerable:!1,configurable:!0}),e.prototype.emit=function(e){var t,n,r=[];try{for(var i=o(this.subscriptions.values()),s=i.next();!s.done;s=i.next()){var a=(0,s.value)(e);"function"==typeof(null==a?void 0:a.then)&&r.push(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}if(0!==r.length)return new Promise((function(e){return Promise.all(r).then((function(){return e()}))}))},e.prototype.subscribe=function(e){var t=this,n=this.idCounter++,r=new l((function(){return t.unsubscribe(n)}));return this.subscriptions.set(n,e),r},e.prototype.unsubscribe=function(e){this._subscriptions.delete(e)||console.warn("Event to unsubscribe was not found")},e}(),p=function(){this.TRANSLATION_CHANGED=new h,this.LANGUAGE_CHANGED=new h,this.LANGUAGE_LOADED=new h,this.ELEMENT_REGISTERED=new h},f=function(e){function n(t,r){var i=e.call(this,"Api http error")||this;return i.response=t,i.code=r,Object.setPrototypeOf(i,n.prototype),i}return t(n,e),n}(Error),d=function(){function e(e){this.properties=e}return e.handleErrors=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(!(e.status>=400))return[3,5];t=new f(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.json()];case 2:return n=r.sent(),t.code=n.code,[3,4];case 3:return r.sent(),console.warn("Tolgee server responded with invalid status code."),[3,4];case 4:throw t;case 5:return[2,e]}}))}))},e.prototype.fetch=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return r(this,void 0,void 0,(function(){var r,o,u;return i(this,(function(i){return"object"==typeof t[0]?[2,fetch(n(n({},t[0]),{url:this.getUrl(t[0].url)})).then((function(t){return e.handleErrors(t)}))]:(r=s(t),o=r[0],u=r.slice(1),[2,fetch.apply(void 0,a([this.getUrl(o)],s(u),!1)).then((function(t){return e.handleErrors(t)}))])}))}))},e.prototype.fetchJson=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.fetch.apply(this,a([],s(e),!1)).then((function(e){return e.json()}))]}))}))},e.prototype.post=function(e,t,o){void 0===o&&(o={});for(var u=[],c=3;c<arguments.length;c++)u[c-3]=arguments[c];return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.fetch.apply(this,a([e,n({body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"}},o)],s(u),!1))]}))}))},e.prototype.postJson=function(e,t,n){void 0===n&&(n={});for(var o=[],u=3;u<arguments.length;u++)o[u-3]=arguments[u];return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.post.apply(this,a([e,t,n],s(o),!1)).then((function(e){return e.json()}))]}))}))},e.prototype.getUrl=function(e){var t=e.indexOf("?")<0?"?":"&";return"".concat(this.properties.config.apiUrl,"/").concat(e).concat(t,"ak=").concat(this.properties.config.apiKey)},e}(),g=function(e,t,n){this.key=e,this.translations=t,this.id=n},v=function(){function e(e,t,o,u){var c=this;this.properties=e,this.coreService=t,this.apiHttpService=o,this.eventService=u,this.translationsCache=new Map,this.fetchPromises={},this.updateTranslationInCache=function(e){return r(c,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){switch(r.label){case 0:return t={},Object.entries(e.translations).forEach((function(r){var i=s(r,2),o=i[0],a=i[1],u=n.translationsCache.get(o);u&&(u[e.name]=a.text),t[o]=a.text})),[4,this.eventService.TRANSLATION_CHANGED.emit(new g(e.name,t,e.id))];case 1:return r.sent(),[2]}}))}))},this.getTranslationsOfKey=function(e,t){return void 0===t&&(t=new Set([c.properties.currentLanguage])),r(c,void 0,void 0,(function(){var r,o,u,c,l,h,p,d,g,v,y;return i(this,(function(i){switch(i.label){case 0:this.coreService.checkScope("translations.view"),i.label=1;case 1:return i.trys.push([1,3,,7]),r=a([],s(t),!1),o=r.map((function(e){return"languages=".concat(e)})).join("&"),[4,this.apiHttpService.fetchJson("v2/projects/translations?".concat(o,"&filterKeyName=").concat(encodeURIComponent(e)))];case 2:return u=i.sent(),c=r.reduce((function(e,t){var r;return n(n({},e),((r={})[t]="",r))}),{}),(null==(l=null===(v=null===(g=u._embedded)||void 0===g?void 0:g.keys)||void 0===v?void 0:v[0])?void 0:l.translations)&&Object.entries(l.translations).forEach((function(e){var t=s(e,2),n=t[0],r=t[1];return c[n]=r.text})),h=null===(y=u.selectedLanguages)||void 0===y?void 0:y.map((function(e){return e.tag})),[2,[l,h]];case 3:return(p=i.sent())instanceof f&&404===p.response.status&&"language_not_found"===p.code?(d=this.properties,[4,this.coreService.getLanguages()]):[3,5];case 4:return d.preferredLanguages=i.sent(),console.error("Requested language not found, refreshing the page!"),location.reload(),[3,6];case 5:throw p;case 6:return[3,7];case 7:return[2]}}))}))}}return e.translationByValue=function(e,t){return e||(t||void 0)},e.prototype.initStatic=function(){var e,t=this;"production"===this.properties.config.mode&&"object"==typeof(null===(e=this.properties.config)||void 0===e?void 0:e.staticData)&&Object.entries(this.properties.config.staticData).forEach((function(e){var n=s(e,2),r=n[0],i=n[1];"function"!=typeof i&&t.setLanguageData(r,i)}))},e.prototype.getCachedTranslations=function(){return this.translationsCache},e.prototype.loadTranslations=function(e){return void 0===e&&(e=this.properties.currentLanguage),r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return null!=this.translationsCache.get(e)?[3,2]:(this.fetchPromises[e]instanceof Promise||(this.fetchPromises[e]=this.fetchTranslations(e)),[4,this.fetchPromises[e]]);case 1:t.sent(),this.eventService.LANGUAGE_LOADED.emit(e),t.label=2;case 2:return this.fetchPromises[e]=void 0,[2,this.translationsCache.get(e)]}}))}))},e.prototype.getTranslation=function(t,n,o){return void 0===n&&(n=this.properties.currentLanguage),r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return(r=this.getFromCache(t,n))?[3,3]:[4,this.loadTranslations(n)];case 1:return i.sent(),(r=this.getFromCache(t,n))?[3,3]:(r=this.getFromCache(t,this.properties.config.fallbackLanguage))?[3,3]:[4,this.loadTranslations(this.properties.config.fallbackLanguage)];case 2:i.sent(),r=this.getFromCache(t,this.properties.config.fallbackLanguage),i.label=3;case 3:return[2,e.translationByValue(r,o)]}}))}))},e.prototype.updateKeyComplex=function(e,t){var o,s;return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return this.coreService.checkScope("translations.edit"),[4,this.apiHttpService.postJson("v2/projects/keys/".concat(e,"/complex-update"),n(n({},t),{screenshotUploadedImageIds:(null===(o=t.screenshotUploadedImageIds)||void 0===o?void 0:o.length)?t.screenshotUploadedImageIds:void 0,screenshotIdsToDelete:(null===(s=t.screenshotIdsToDelete)||void 0===s?void 0:s.length)?t.screenshotIdsToDelete:void 0}),{method:"put"})];case 1:return r=i.sent(),[4,this.updateTranslationInCache(r)];case 2:return i.sent(),[2,r]}}))}))},e.prototype.createKey=function(e){var t;return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return this.coreService.checkScope("keys.edit"),[4,this.apiHttpService.postJson("v2/projects/keys/create",n(n({},e),{screenshotUploadedImageIds:(null===(t=e.screenshotUploadedImageIds)||void 0===t?void 0:t.length)?e.screenshotUploadedImageIds:void 0}))];case 1:return r=i.sent(),[4,this.updateTranslationInCache(r)];case 2:return i.sent(),[2,r]}}))}))},e.prototype.setTranslations=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return this.coreService.checkScope("translations.edit"),[4,this.apiHttpService.postJson("v2/projects/translations",e)];case 1:return t=n.sent(),[4,this.updateTranslationInCache({id:t.keyId,name:t.keyName,translations:t.translations})];case 2:return n.sent(),[2,t]}}))}))},e.prototype.changeTranslations=function(e){var t=e.key,n=e.translations;return r(this,void 0,void 0,(function(){var e,o=this;return i(this,(function(a){switch(a.label){case 0:return e={},Object.entries(n).forEach((function(n){var r=s(n,2),i=r[0],a=r[1],u=o.translationsCache.get(i);u&&(e[i]=u[t],u[t]=a)})),[4,this.eventService.TRANSLATION_CHANGED.emit({key:t,translations:n})];case 1:return a.sent(),[2,function(){return r(o,void 0,void 0,(function(){var n=this;return i(this,(function(r){switch(r.label){case 0:return Object.entries(e).forEach((function(e){var r=s(e,2),i=r[0],o=r[1],a=n.translationsCache.get(i);a&&(a[t]=o)})),[4,this.eventService.TRANSLATION_CHANGED.emit({key:t,translations:e})];case 1:return r.sent(),[2]}}))}))}]}}))}))},e.prototype.getFromCacheOrFallback=function(t,n,r){void 0===n&&(n=this.properties.currentLanguage);var i=this.getFromCache(t,n)||this.getFromCache(t,this.properties.config.fallbackLanguage);return e.translationByValue(i,r)},e.prototype.fetchTranslations=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return"development"!==this.properties.config.mode?[3,2]:[4,this.fetchTranslationsDevelopment(e)];case 1:return[2,t.sent()];case 2:return[4,this.fetchTranslationsProduction(e)];case 3:return[2,t.sent()]}}))}))},e.prototype.fetchTranslationsProduction=function(e){var t,n;return r(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return"function"!=typeof(r=null===(n=null===(t=this.properties.config)||void 0===t?void 0:t.staticData)||void 0===n?void 0:n[e])?[3,2]:[4,r()];case 1:return a=i.sent(),this.setLanguageData(e,a),[2];case 2:if(void 0!==r)return this.setLanguageData(e,r),[2];i.label=3;case 3:o="".concat(this.properties.config.filesUrlPrefix||"/").concat(e,".json"),i.label=4;case 4:return i.trys.push([4,10,,11]),[4,fetch(o)];case 5:if((s=i.sent()).status>=400)return console.error("Server responded with error status while loading localization data."),this.setLanguageData(e,{}),[2];i.label=6;case 6:return i.trys.push([6,8,,9]),[4,s.json()];case 7:return a=i.sent(),this.setLanguageData(e,a),[3,9];case 8:return i.sent(),console.error("Error parsing json retrieved from ".concat(o,".")),this.setEmptyLanguageData(e),[3,9];case 9:return[3,11];case 10:return i.sent(),console.error("Error fetching localization data from ".concat(o,".")),this.setEmptyLanguageData(e),[3,11];case 11:return[2]}}))}))},e.prototype.fetchTranslationsDevelopment=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.coreService.loadApiKeyDetails()];case 1:r.sent(),this.coreService.checkScope("translations.view"),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this.apiHttpService.fetchJson("v2/projects/translations/".concat(e))];case 3:return t=r.sent(),this.setLanguageData(e,t[e]||{}),[3,5];case 4:return n=r.sent(),console.error("Error while fetching localization data from API.",n),this.setEmptyLanguageData(e),[2];case 5:return[2]}}))}))},e.prototype.setEmptyLanguageData=function(e){this.translationsCache.set(e,{})},e.prototype.setLanguageData=function(e,t){var n=function(e){var t={};return Object.entries(e).forEach((function(e){var r=s(e,2),i=r[0],o=r[1];o&&("object"!=typeof o?t[i]=o:Object.entries(n(o)).forEach((function(e){var n=s(e,2),r=n[0],o=n[1];t[i+"."+r]=o})))})),t};this.translationsCache.set(e,n(t))},e.prototype.getFromCache=function(e,t){void 0===t&&(t=this.properties.currentLanguage);var n=this.translationsCache.get(t);if(void 0!==n)return n[e]},e}(),y=function(){function e(e,t,n){var r=this;this.properties=e,this.translationService=t,this.moduleService=n,this.format=function(e,t,n){try{var i=e;return r.moduleService.formatter&&(i=r.moduleService.formatter.format({translation:i,params:t,language:n||r.properties.currentLanguage})),i}catch(e){console.error(e)}}}return e.prototype.translate=function(e,t,n,o,s){return void 0===n&&(n=this.properties.currentLanguage),r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,this.translationService.getTranslation(e,n,s)];case 1:return r=i.sent(),[2,this.formatTranslation(e,r,t,n,o)]}}))}))},e.prototype.instant=function(e,t,n,r,i){void 0===n&&(n=this.properties.currentLanguage);var o=this.translationService.getFromCacheOrFallback(e,n,i);return this.formatTranslation(e,o,t,n,r)},e.prototype.formatTranslation=function(e,t,n,r,i){return void 0!==t?this.format(t,n,r):i?"":e},e}();!function(e){e[e.Alt=0]="Alt",e[e.Control=1]="Control",e[e.Shift=2]="Shift",e[e.Meta=3]="Meta"}(u||(u={}));var m=function(){function e(e){var t=this;this.properties=e,this.keysDown=new Set,this.mouseOn=new Set,this.mouseOnChanged=new h,this.keysChanged=new h,this.onConditionsChanged=function(){t.unhighlight(),t.areKeysDown()&&t.getMouseOn()&&t.highlight()},this.highlight=function(){t.getMouseOn()._tolgee.highlight(),t.highlighted=t.getMouseOn()},this.unhighlight=function(){t.highlighted&&(t.highlighted._tolgee.unhighlight(),t.highlighted=null)},this.onMouseOut=function(e){e._tolgee.preventClean=!1,t.mouseOn.delete(e),t.mouseOnChanged.emit(t.getMouseOn())},this.onMouseOver=function(e){t.filterMouseOn(),e._tolgee.preventClean=!0,t.mouseOn.delete(e),t.mouseOn.add(e),t.mouseOnChanged.emit(t.getMouseOn())}}return e.prototype.run=function(){"undefined"==typeof window||this.initKeyListener()},e.prototype.handle=function(e,t){var n=this;e._tolgee.listeningForHighlighting?console.error("Element is already listening mouse events! This is probably bug in tolgee"):(e._tolgee.listeningForHighlighting=!0,this.initEventListeners(e,t),this.mouseOnChanged.subscribe((function(){n.highlighted!==n.getMouseOn()&&n.onConditionsChanged()})),this.keysChanged.subscribe((function(){n.onConditionsChanged()})))},e.prototype.initEventListeners=function(e,t){var n=this,r=function(){return n.onMouseOver(e)},i=function(){return n.onMouseOut(e)},o=function(e){n.areKeysDown()&&(e.stopPropagation(),e.preventDefault(),t(e))};e.addEventListener("mouseover",r),e.addEventListener("click",o,{capture:!0});var s=function(e){n.areKeysDown()&&(e.stopPropagation(),e.preventDefault())};e.addEventListener("mousedown",s),e.addEventListener("mouseup",s),e.addEventListener("mouseout",i),e._tolgee.removeAllEventListeners=function(){e.removeEventListener("mousedown",s),e.removeEventListener("mouseup",s),e.removeEventListener("mouseover",r),e.removeEventListener("click",o,{capture:!0}),e.removeEventListener("mouseout",i)}},e.prototype.getMouseOn=function(){var e=Array.from(this.mouseOn);return e.length?e[0]:void 0},e.prototype.initKeyListener=function(){var e=this;window.addEventListener("blur",(function(){e.keysDown=new Set,e.keysChanged.emit(e.areKeysDown())})),window.addEventListener("keydown",(function(t){var n=u[t.key];void 0!==n&&(e.keysDown.add(n),e.keysChanged.emit(e.areKeysDown()))})),window.addEventListener("keyup",(function(t){e.keysDown.delete(u[t.key]),e.keysChanged.emit(e.areKeysDown())}))},e.prototype.filterMouseOn=function(){var e=this;this.mouseOn.forEach((function(t){document.contains(t)||e.mouseOn.delete(t)}))},e.prototype.areKeysDown=function(){var e,t;try{for(var n=o(this.properties.config.highlightKeys),r=n.next();!r.done;r=n.next()){var i=r.value;if(!this.keysDown.has(i))return!1}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return!0},e}(),E=function(){function e(e){var t=this;this.dependencies=e,this.translationEdit=function(e,n){return r(t,void 0,void 0,(function(){var t,r;return i(this,(function(i){switch(i.label){case 0:return[4,this.getRenderer()];case 1:return"object"!=typeof(t=i.sent())?[3,3]:[4,this.getKeyAndDefault(e,n)];case 2:return(r=i.sent())?(t.renderViewer(r.key,r.defaultValue),[2]):[2];case 3:return[2]}}))}))}}return e.getKeyOptions=function(e){return Array.from(e._tolgee.nodes).reduce((function(e,t){return a(a([],s(e),!1),s(t._tolgee.keys.map((function(e){return{key:e.key,defaultValue:e.defaultValue}}))),!1)}),[])},e.prototype.listen=function(e){var t=this;this.dependencies.highlightFunctionInitializer.initFunctions(e),this.dependencies.mouseEventHandler.handle(e,(function(n){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.translationEdit(n,e)];case 1:return[2,t.sent()]}}))}))}))},e.prototype.getRenderer=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s,a,u,c;return i(this,(function(i){switch(i.label){case 0:if(void 0!==this._renderer)return[3,11];e=[this.dependencies.properties.config.ui,window["@tolgee/ui"]],i.label=1;case 1:i.trys.push([1,8,9,10]),t=o(e),n=t.next(),i.label=2;case 2:if(n.done)return[3,7];if("function"!=typeof(r=n.value))return[3,6];i.label=3;case 3:return i.trys.push([3,5,,6]),[4,r()];case 4:return s=i.sent(),this._renderer=new s(this.dependencies),[3,6];case 5:return i.sent(),s=r,this._renderer=new s(this.dependencies),[3,6];case 6:return n=t.next(),[3,2];case 7:return[3,10];case 8:return a=i.sent(),u={error:a},[3,10];case 9:try{n&&!n.done&&(c=t.return)&&c.call(t)}finally{if(u)throw u.error}return[7];case 10:void 0===this._renderer&&console.warn('Tolgee UI is not provided. To translate interactively provide tolgee ui constructor to "ui" configuration property. To disable highlighting use production mode.'),i.label=11;case 11:return[2,this._renderer]}}))}))},e.prototype.getKeyAndDefault=function(t,n){return r(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return n._tolgee.wrappedWithElementOnlyKey?[2,{key:n._tolgee.wrappedWithElementOnlyKey,defaultValue:n._tolgee.wrappedWithElementOnlyDefaultHtml}]:(r=e.getKeyOptions(n),(o=new Set(r.map((function(e){return e.key})))).size>1?[4,this.getRenderer()]:[3,3]);case 1:return[4,i.sent().getKey({keys:o,openEvent:t})];case 2:if(s=i.sent(),a=r.find((function(e){return e.key===s})))return[2,a];i.label=3;case 3:return 1===o.size?[2,r[0]]:(console.error("No key to translate. This seems like a bug in tolgee."),[2])}}))}))},e}(),b="data-tolgee-key-only",w=function(){function e(){}return e.evaluate=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Array.from(this.evaluateGenerator.apply(this,a([],s(e),!1)))},e.evaluateToSingle=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.evaluate.apply(this,a([],s(e),!1));if(1===n.length)return n[0];if(n.length<1)throw new Error("No element found");throw new Error("Multiple elements found")},e.closestElement=function(e){return e instanceof Text?e.parentElement:e},e.getParentElement=function(e){return e.parentElement?e.parentElement:e.ownerElement?e.ownerElement:void 0},e.isElementTargetElement=function(e){return e.hasAttribute("_tolgee-target")},e.markElementAsTargetElement=function(e){e.setAttribute("_tolgee-target","")},e.unmarkElementAsTargetElement=function(e){e.removeAttribute("_tolgee-target")},e.nodeContains=function(e,t){if(e.contains(t))return!0;if(t instanceof Attr){var n=t.ownerElement&&Object.values(t.ownerElement.attributes).indexOf(t)>-1;if(e.contains(t.ownerElement)&&n)return!0}return!1},e.evaluateGenerator=function(e,t){var n,r;return i(this,(function(i){switch(i.label){case 0:r=document.evaluate(e,t,void 0,XPathResult.ANY_TYPE),i.label=1;case 1:return null===(n=r.iterateNext())?[3,3]:[4,n];case 2:return i.sent(),[3,1];case 3:return[2]}}))},e.getNodeText=function(e){return e.textContent},e.setNodeText=function(e,t){e.textContent=t},e}(),_=function(){function e(e,t,n){this.properties=e,this.translationHighlighter=t,this.eventService=n,this.registeredElements=new Set}return e.prototype.register=function(e){(void 0!==this.getActiveNodes(e).next().value||e._tolgee.wrappedWithElementOnlyKey)&&("development"!==this.properties.config.mode||this.registeredElements.has(e)||this.translationHighlighter.listen(e),this.registeredElements.add(e),this.eventService.ELEMENT_REGISTERED.emit(e))},e.prototype.refreshAll=function(){var e,t;try{for(var n=o(this.registeredElements),r=n.next();!r.done;r=n.next()){var i=r.value;i._tolgee.preventClean||(this.cleanElementInactiveNodes(i),0!==i._tolgee.nodes.size||i._tolgee.wrappedWithElementOnlyKey||this.cleanElement(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.cleanAll=function(){var e,t;try{for(var n=o(this.registeredElements),r=n.next();!r.done;r=n.next()){var i=r.value;this.cleanElement(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.findAllByKey=function(e){var t,n,r,i,s=[];try{for(var a=o(this.registeredElements),u=a.next();!u.done;u=a.next()){var c=u.value;if(c._tolgee.wrappedWithElementOnlyKey!==e)try{for(var l=(r=void 0,o(c._tolgee.nodes)),h=l.next();!h.done;h=l.next()){if(h.value._tolgee.keys.findIndex((function(t){return t.key===e}))>-1){s.push(c);break}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}else s.push(c)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return s},e.prototype.cleanElementInactiveNodes=function(e){this.isElementActive(e)&&(e._tolgee.nodes=new Set(this.getActiveNodes(e)))},e.prototype.cleanElement=function(e){e._tolgee.preventClean||("function"==typeof e._tolgee.removeAllEventListeners&&e._tolgee.removeAllEventListeners(),e.removeAttribute("_tolgee"),delete e._tolgee,this.registeredElements.delete(e))},e.prototype.getActiveNodes=function(e){var t,n,r,s,a,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,7]),t=o(e._tolgee.nodes),n=t.next(),i.label=1;case 1:return n.done?[3,4]:(r=n.value,w.nodeContains(this.properties.config.targetElement,r)?[4,r]:[3,3]);case 2:i.sent(),i.label=3;case 3:return n=t.next(),[3,1];case 4:return[3,7];case 5:return s=i.sent(),a={error:s},[3,7];case 6:try{n&&!n.done&&(u=t.return)&&u.call(t)}finally{if(a)throw a.error}return[7];case 7:return[2]}}))},e.prototype.isElementActive=function(e){return this.properties.config.targetElement.contains(e)},e}(),T=function(){function e(e,t,n){this.properties=e,this.textWrapper=t,this.nodeRegistrar=n,this._observer=void 0}return Object.defineProperty(e.prototype,"observer",{get:function(){var e=this;return this._observer||"undefined"==typeof window||(this._observer=new MutationObserver((function(t){return r(e,void 0,void 0,(function(){var e,n,r,s,a,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,9,10,11]),e=o(t),n=e.next(),i.label=1;case 1:return n.done?[3,8]:"characterData"!==(r=n.value).type?[3,3]:[4,this.textWrapper.handleText(r.target)];case 2:return i.sent(),[3,7];case 3:return"childList"!==r.type?[3,5]:[4,this.textWrapper.handleSubtree(r.target)];case 4:return i.sent(),[3,7];case 5:return"attributes"!==r.type?[3,7]:[4,this.textWrapper.handleAttribute(r.target)];case 6:i.sent(),i.label=7;case 7:return n=e.next(),[3,1];case 8:return[3,11];case 9:return s=i.sent(),a={error:s},[3,11];case 10:try{n&&!n.done&&(u=e.return)&&u.call(e)}finally{if(a)throw a.error}return[7];case 11:return this.nodeRegistrar.refreshAll(),[2]}}))}))}))),this._observer},enumerable:!1,configurable:!0}),e.prototype.observe=function(){this.observer&&this.observer.observe(this.properties.config.targetElement,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},e.prototype.stopObserving=function(){this.observer&&this.observer.disconnect()},e}(),S=function(){function e(e,t){this.properties=e,this.apiHttpService=t}return e.prototype.getLanguages=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return this.languagePromise instanceof Promise||(this.languagePromise=this.apiHttpService.fetchJson("v2/projects/languages?size=1000")),t=Set.bind,[4,this.languagePromise];case 1:return e=new(t.apply(Set,[void 0,n.sent()._embedded.languages.map((function(e){return e.tag}))])),this.properties.preferredLanguages=new Set(Array.from(this.properties.preferredLanguages).filter((function(t){return e.has(t)}))),[2,e]}}))}))},e.prototype.getLanguagesFull=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.getLanguages(),[4,this.languagePromise];case 1:return[2,e.sent()._embedded.languages]}}))}))},e.prototype.getApiKeyDetails=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.apiHttpService.fetchJson("v2/api-keys/current")];case 1:return[2,t.sent()];case 2:return e=t.sent(),console.error(e),console.error("Error getting scopes. Trying to switch to production mode!"),this.properties.config.mode="production",[3,3];case 3:return[2]}}))}))},e.prototype.isAuthorizedTo=function(e){return this.properties.scopes.indexOf(e)>-1},e.prototype.checkScope=function(e){if(!this.isAuthorizedTo(e))throw new Error("Api key not permitted to do this, please add 'translations.view' scope.")},e.prototype.loadApiKeyDetails=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return void 0!==this.properties.scopes?[3,2]:[4,this.getApiKeyDetails()];case 1:e=t.sent(),this.properties.scopes=e.scopes,this.properties.projectId=e.projectId,t.label=2;case 2:return[2]}}))}))},e}(),A=function(){if("undefined"!=typeof document)return document.body},L=function(e){this.apiUrl="https://app.tolgee.io",this.inputPrefix="%-%tolgee:",this.inputSuffix="%-%",this.defaultLanguage="en",this.filesUrlPrefix="i18n/",this.tagAttributes={textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},this.highlightKeys=[u.Alt],this.passToParent=["option","optgroup"],this.restrictedElements=["script","style"],this.highlightColor="rgb(224 240 255)",this.wrapperMode="text",this.preloadFallback=!1,Object.defineProperty(this,"targetElement",{set:function(e){if(void 0!==this.targetElement)throw new Error("Target element is already defined!");if(void 0===e&&(this._targetElement=A()),w.isElementTargetElement(e))throw console.error("Target element: ",this._targetElement),new Error("An tolgee instance is inited with provided target element");this._targetElement=e,w.markElementAsTargetElement(this._targetElement)},get:function(){return this._targetElement}}),Object.assign(this,e||{}),void 0===this._targetElement&&(this._targetElement=A()),this.mode=this.mode||(this.apiKey?"development":"production"),this.fallbackLanguage=this.fallbackLanguage||this.defaultLanguage,void 0===this.watch&&(this.watch="development"===this.mode)},P=function(){function e(e,t,o,s,a){var u=this;this.messages=e,this.properties=t,this.eventService=o,this.elementRegistrar=s,this.translationService=a,this.handshakeSucceed=!1,this.takeScreenshot=function(e){return new Promise((function(t,n){u.translationService.changeTranslations(e).then((function(o){return r(u,void 0,void 0,(function(){var r,s,a=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.highlightAllByKey(e.key),[4,(u=100,new Promise((function(e){return setTimeout(e,u)})))];case 1:return i.sent(),this.messages.send("TOLGEE_TAKE_SCREENSHOT"),r=this.messages.listen("TOLGEE_SCREENSHOT_TAKEN",(function(n){a.unhighlightAllByKey(e.key),t(n),o(),r()})),[3,3];case 2:return s=i.sent(),o(),n(s),[3,3];case 3:return[2]}var u}))}))})).catch((function(e){n(e)}))}))},this.handshake=function(){var e=n(n({},u.properties),{config:n(n({},u.properties.config),{staticData:void 0,targetElement:void 0,_targetElement:void 0,ui:void 0})}),t=null,r=function(){u.messages.send("TOLGEE_READY",e)},i=function(){clearInterval(t)};u.messages.listen("TOLGEE_PLUGIN_READY",(function(){u.handshakeSucceed=!0,u.messages.send("TOLGEE_READY",e),i()})),r();var o=0;t=setInterval((function(){!u.handshakeSucceed&&o<5?(r(),o+=1):i()}),200)}}return e.prototype.run=function(){try{this.messages.startListening(),this.handshake()}catch(e){console.warn(e),console.warn("Can not start communication with browser plugin. Check waning above.")}},e.prototype.stop=function(){this.messages.stopListening()},e.prototype.highlightAllByKey=function(e){this.elementRegistrar.findAllByKey(e).forEach((function(e){return e._tolgee.highlight()}))},e.prototype.unhighlightAllByKey=function(e){this.elementRegistrar.findAllByKey(e).forEach((function(e){return e._tolgee.unhighlight()}))},e}(),N=function(){function e(){var e=this;this.listeners=[],this.startListening=function(){var t=function(t){t.source==window&&e.listeners.forEach((function(e){e.type==t.data.type&&e.callback(t.data.data)}))};window.addEventListener("message",t,!1),"function"==typeof e._stopListening&&e._stopListening(),e._stopListening=function(){window.removeEventListener("message",t,!1)}},this.listen=function(t,n){var r={type:t,callback:n};return e.listeners.push(r),function(){e.listeners.splice(e.listeners.indexOf(r),1)}},this.send=function(e,t){try{window.postMessage({type:e,data:t},window.origin)}catch(e){console.warn("Cannot send message.",e)}}}return e.prototype.stopListening=function(){this._stopListening()},e}(),O=function(){function e(e){this.properties=e}return e.prototype.initFunctions=function(e){this.initHighlightFunction(e),this.initUnhighlightFunction(e)},e.prototype.initHighlightFunction=function(e){var t=this;e._tolgee.highlight=function(){e._tolgee.initialBackgroundColor=e.style.backgroundColor,e.style.backgroundColor=t.properties.config.highlightColor}},e.prototype.initUnhighlightFunction=function(e){e._tolgee.unhighlight=function(){e.style.backgroundColor=e._tolgee.initialBackgroundColor}},e}(),C=function(){function e(e,t){this.coreService=e,this.apiHttpService=t}return e.prototype.uploadImage=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){return(t=new FormData).append("image",e),[2,this.apiHttpService.postJson("v2/image-upload",void 0,{headers:{},body:t})]}))}))},e.prototype.deleteImages=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.apiHttpService.post("v2/image-upload/".concat(e.join(",")),void 0,{method:"delete"})]}))}))},e}(),R=function(){var e=this;this.formatter=null,this.addModule=function(t){if("formatter"!==t.type)throw new Error("Module with unknown type");var n=new t;e.formatter=n}},I=function(){function e(e,t,n){this.properties=e,this.elementRegistrar=t,this.wrapper=n}return e.initParentElement=function(e){return void 0===e._tolgee&&(e._tolgee={nodes:new Set},e.setAttribute("_tolgee","")),e},e.prototype.filterRestricted=function(e){var t=this.properties.config.restrictedElements;return e.filter((function(e){var n=w.closestElement(e);return-1===t.indexOf(n.tagName.toLowerCase())&&null===n.closest("[".concat("data-tolgee-restricted",'="true"]'))}))},e.prototype.handleNodes=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,a,u,c,l,h,p,f,d;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,7]),t=o(e),n=t.next(),i.label=1;case 1:return n.done?[3,4]:(void 0===(r=n.value)._tolgee&&(r._tolgee={}),!0===(null==(s=r._tolgee)?void 0:s.locked)?[3,3]:(this.lockNode(r),[4,this.wrapper.unwrap(w.getNodeText(r))]));case 2:(a=i.sent())&&(u=a.text,c=a.keys,l=this.translateChildNode(r,u,c),(h=this.getParentElement(l))._tolgee.nodes.add(l),this.elementRegistrar.register(h)),this.unlockNode(r),i.label=3;case 3:return n=t.next(),[3,1];case 4:return[3,7];case 5:return p=i.sent(),f={error:p},[3,7];case 6:try{n&&!n.done&&(d=t.return)&&d.call(t)}finally{if(f)throw f.error}return[7];case 7:return[2]}}))}))},e.prototype.translateChildNode=function(e,t,n){return e._tolgee={oldTextContent:w.getNodeText(e),keys:n},w.setNodeText(e,t),e},e.prototype.lockNode=function(e){void 0===e._tolgee&&(e._tolgee={});var t=e._tolgee;return!0!==(null==t?void 0:t.locked)&&(t.locked=!0),e},e.prototype.unlockNode=function(e){e._tolgee&&(e._tolgee.locked=!1)},e.prototype.getParentElement=function(t){var n=this.getSuitableParent(t);return e.initParentElement(n)},e.prototype.getSuitableParent=function(e){var t=w.getParentElement(e);if(void 0===t)throw console.error(e),new Error("No suitable parent found for node above.");if(!this.properties.config.passToParent)return t;if(Array.isArray(this.properties.config.passToParent)){if(-1===this.properties.config.passToParent.findIndex((function(e){return t.tagName.toLowerCase()===e.toLowerCase()})))return t}return"function"!=typeof this.properties.config.passToParent||this.properties.config.passToParent(t)?this.getSuitableParent(t):t},e}(),k=function(){function e(e,t){this.properties=e,this.nodeHandler=t}return e.prototype.handle=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,u,c,l,h,p,f,d,g,v,y,m,E,b,_;return i(this,(function(i){switch(i.label){case 0:t=this.properties.config.inputPrefix,n=this.properties.config.inputSuffix,i.label=1;case 1:i.trys.push([1,12,13,14]),r=o(Object.entries(this.properties.config.tagAttributes)),a=r.next(),i.label=2;case 2:if(a.done)return[3,11];u=s(a.value,2),c=u[0],l=u[1],i.label=3;case 3:i.trys.push([3,8,9,10]),b=void 0,h=o(l),p=h.next(),i.label=4;case 4:return p.done?[3,7]:(f=p.value,d="descendant-or-self::".concat(c,"/@").concat(f,"[contains(., '").concat(t,"') and contains(., '").concat(n,"')]"),g=w.evaluate(d,e),[4,this.nodeHandler.handleNodes(g)]);case 5:i.sent(),i.label=6;case 6:return p=h.next(),[3,4];case 7:return[3,10];case 8:return v=i.sent(),b={error:v},[3,10];case 9:try{p&&!p.done&&(_=h.return)&&_.call(h)}finally{if(b)throw b.error}return[7];case 10:return a=r.next(),[3,2];case 11:return[3,14];case 12:return y=i.sent(),m={error:y},[3,14];case 13:try{a&&!a.done&&(E=r.return)&&E.call(r)}finally{if(m)throw m.error}return[7];case 14:return[2]}}))}))},e}(),D=function(){function e(){}return e.splitOnNonEscapedDelimiter=function(e,t){for(var n=[],r="",i=!1,o=0;o<e.length;o++){var s=e[o];"\\"!==s||i?i?(i=!1,r+=s):s!==t?r+=s:(n.push(r),r=""):i=!0}return n.push(r),n},e.isCharEscaped=function(e,t){for(var n=0;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1},e.removeEscapes=function(e){for(var t="",n=!1,r=0;r<e.length;r++){var i=e[r];"\\"!==i||n?n?(n=!1,t+=i):t+=i:n=!0}return t},e}(),U=function(){function e(e,t){this.properties=e,this.textService=t,this.escapeForRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},this.escapeParam=function(e){return"string"==typeof e?e.replace(/[,:\\]/gs,"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(e),console.warn("Unsupported value type of above param. Consider converting to string."),e)}}return Object.defineProperty(e.prototype,"rawUnWrapRegex",{get:function(){var e=this.escapeForRegExp(this.properties.config.inputPrefix),t=this.escapeForRegExp(this.properties.config.inputSuffix);return"(\\\\?)(".concat(e,"(.*?)").concat(t,")")},enumerable:!1,configurable:!0}),e.parseUnwrapped=function(e){var t,n,r=!1,i="",s="",a="KEY",u={key:"",params:{},defaultValue:void 0};try{for(var c=o(e),l=c.next();!l.done;l=c.next()){var h=l.value;"\\"!==h||r?r?(r=!1,i+=h):"KEY"!==a||","!==h?"KEY"!==a||":"!==h?"DEFAULT_VALUE"!==a||":"!==h?"PARAM_NAME"!==a||":"!==h?"PARAM_VALUE"!==a||","!==h?i+=h:(a="PARAM_NAME",u.params[s]=i,i=""):(a="PARAM_VALUE",s=i,i=""):(a="PARAM_NAME",u.defaultValue=i,i=""):(a="PARAM_NAME",u.key=i,i=""):(a="DEFAULT_VALUE",u.key=i,i=""):r=!0}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return"KEY"===a&&(u.key=i),"DEFAULT_VALUE"===a&&(u.defaultValue=i),"PARAM_VALUE"===a&&(u.params[s]=i),u},e.prototype.unwrap=function(e){for(var t,n=new RegExp(this.rawUnWrapRegex,"gs"),r=[],i=!1,o=0,a="";null!==(t=n.exec(e));){var u=t[1],c=s(t,4),l=c[0];c[1];var h=c[2],p=c[3],f=t.index;if(a+=t.input.substr(o,f-o),o=f+l.length,"\\"===u){if(!D.isCharEscaped(f,e)){a+=h;continue}u=""}var d=this.getTranslatedWithMetadata(p);r.push({key:d.key,params:d.params,defaultValue:d.defaultValue}),i=!0,a+=u+d.translated}if(a+=e.substring(o),i)return{text:a,keys:r}},e.prototype.wrap=function(e,t,n){var r=this;void 0===t&&(t={}),void 0===n&&(n=void 0);var i=Object.entries(t).map((function(e){var t=s(e,2),n=t[0],i=t[1];return"".concat(r.escapeParam(n),":").concat(r.escapeParam(i))})).join(",");i=i.length?":".concat(i):"";var o=void 0!==n?",".concat(this.escapeParam(n)):"";return"".concat(this.properties.config.inputPrefix).concat(this.escapeParam(e)).concat(o).concat(i).concat(this.properties.config.inputSuffix)},e.prototype.getTranslatedWithMetadata=function(t){var n=e.parseUnwrapped(t),r=n.key,i=n.params,o=n.defaultValue;return{translated:this.textService.instant(r,i,void 0,!1,o),key:r,params:i,defaultValue:o}},e}(),M=function(){function e(e,t,n,r,i,o){this.textHandler=e,this.eventService=t,this.properties=n,this.attributeHandler=r,this.coder=i,this.wrappedHandler=o,"undefined"!=typeof window&&(t.LANGUAGE_CHANGED.subscribe(this.refresh.bind(this)),t.TRANSLATION_CHANGED.subscribe(this.refresh.bind(this)))}return e.prototype.handleSubtree=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.attributeHandler.handle(e)];case 1:return t.sent(),[4,this.textHandler.handle(e)];case 2:return t.sent(),[4,this.wrappedHandler.handle(e)];case 3:return t.sent(),[2]}}))}))},e.prototype.refresh=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s,a,u,c,l,h,p,f,d,g;return i(this,(function(i){switch(i.label){case 0:e=w.evaluate("//*[@_tolgee]",this.properties.config.targetElement),i.label=1;case 1:i.trys.push([1,12,13,14]),t=o(e),n=t.next(),i.label=2;case 2:if(n.done)return[3,11];r=n.value,i.label=3;case 3:i.trys.push([3,8,9,10]),d=void 0,s=o(r._tolgee.nodes),a=s.next(),i.label=4;case 4:return a.done?[3,7]:(u=a.value,[4,this.coder.unwrap(u._tolgee.oldTextContent)]);case 5:(c=i.sent())&&w.setNodeText(u,c.text),i.label=6;case 6:return a=s.next(),[3,4];case 7:return[3,10];case 8:return l=i.sent(),d={error:l},[3,10];case 9:try{a&&!a.done&&(g=s.return)&&g.call(s)}finally{if(d)throw d.error}return[7];case 10:return n=t.next(),[3,2];case 11:return[3,14];case 12:return h=i.sent(),p={error:h},[3,14];case 13:try{n&&!n.done&&(f=t.return)&&f.call(t)}finally{if(p)throw p.error}return[7];case 14:return[2]}}))}))},e}(),x=function(){function e(e,t){this.properties=e,this.nodeHandler=t}return e.prototype.handle=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,s;return i(this,(function(i){switch(i.label){case 0:return t=this.properties.config.inputPrefix,n=this.properties.config.inputSuffix,r="./descendant-or-self::text()[contains(., '".concat(t,"') and contains(., '").concat(n,"')]"),o=w.evaluate(r,e),s=this.nodeHandler.filterRestricted(o),[4,this.nodeHandler.handleNodes(s)];case 1:return i.sent(),[2]}}))}))},e}(),G=function(){function e(e,t){this.elementRegistrar=e,this.nodeHandler=t}return e.prototype.handle=function(e){return r(this,void 0,void 0,(function(){var t,n,r=this;return i(this,(function(i){return t="./descendant-or-self::*[@".concat("data-tolgee-key-only","]"),n=w.evaluate(t,e),this.nodeHandler.filterRestricted(n).forEach((function(e){var t=I.initParentElement(e);t._tolgee.wrappedWithElementOnlyKey=e.getAttribute("data-tolgee-key-only"),t._tolgee.wrappedWithElementOnlyDefaultHtml=e.innerHTML,r.elementRegistrar.register(t)})),[2]}))}))},e}(),F=function(){function e(e,t,n,r){this.coder=new U(t,n),this.nodeHandler=new I(t,r,this),this.textHandler=new x(t,this.nodeHandler),this.attributeHandler=new k(t,this.nodeHandler),this.wrappedHandler=new G(r,this.nodeHandler),this.coreHandler=new M(this.textHandler,e,t,this.attributeHandler,this.coder,this.wrappedHandler)}return e.prototype.handleText=function(e){return this.textHandler.handle(e)},e.prototype.handleSubtree=function(e){return this.coreHandler.handleSubtree(e)},e.prototype.handleAttribute=function(e){return this.attributeHandler.handle(e)},e.prototype.wrap=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n=void 0),this.coder.wrap(e,t,n)},e.prototype.unwrap=function(e){return this.coder.unwrap(e)},e}();function H(){}function j(){}H.prototype.encode=function(e){for(var t=[],n=e.length,r=0;r<n;){var i=e.codePointAt(r),o=0,s=0;for(i<=127?(o=0,s=0):i<=2047?(o=6,s=192):i<=65535?(o=12,s=224):i<=2097151&&(o=18,s=240),t.push(s|i>>o),o-=6;o>=0;)t.push(128|i>>o&63),o-=6;r+=i>=65536?2:1}return t},j.prototype.decode=function(e){for(var t="",n=0;n<e.length;){var r=e[n],i=0,o=0;if(r<=127?(i=0,o=255&r):r<=223?(i=1,o=31&r):r<=239?(i=2,o=15&r):r<=244&&(i=3,o=7&r),e.length-n-i>0)for(var s=0;s<i;)o=o<<6|63&(r=e[n+s+1]),s+=1;else o=65533,i=e.length-n;t+=String.fromCodePoint(o),n+=i+1}return t};var V,K,X,B="undefined"==typeof TextEncoder?H:TextEncoder,W="undefined"==typeof TextDecoder?j:TextDecoder,z=["‌","‍"],Y=RegExp("([".concat(z.join(""),"]{9})+"),"gu"),J=function(e){var t=function(e){return Array.from((new B).encode(e))}(e).map(Number).map((function(e){return function(e){var t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0"})).join("");return Array.from(t).map((function(e){return z[Number(e)]})).join("")},q=function(e){var t,n=Array.from(e).map((function(e){return z.indexOf(e)})).map(String).join("").match(/(.{9})/g),r=Uint8Array.from(n.map((function(e){return parseInt(e.slice(0,8),2)})));return t=r,(new W).decode(new Uint8Array(t))},Z=function(){function e(e,t){this.properties=e,this.nodeHandler=t}return e.prototype.handle=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,u,c,l,h,p,f,d,g,v,y,m,E;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,11,12,13]),t=o(Object.entries(this.properties.config.tagAttributes)),n=t.next(),i.label=1;case 1:if(n.done)return[3,10];r=s(n.value,2),a=r[0],u=r[1],i.label=2;case 2:i.trys.push([2,7,8,9]),m=void 0,c=o(u),l=c.next(),i.label=3;case 3:return l.done?[3,6]:(h=l.value,p="descendant-or-self::".concat(a,"/@").concat(h,"[contains(., '").concat(z[0],"')]"),f=w.evaluate(p,e),[4,this.nodeHandler.handleNodes(f)]);case 4:i.sent(),i.label=5;case 5:return l=c.next(),[3,3];case 6:return[3,9];case 7:return d=i.sent(),m={error:d},[3,9];case 8:try{l&&!l.done&&(E=c.return)&&E.call(c)}finally{if(m)throw m.error}return[7];case 9:return n=t.next(),[3,1];case 10:return[3,13];case 11:return g=i.sent(),v={error:g},[3,13];case 12:try{n&&!n.done&&(y=t.return)&&y.call(t)}finally{if(v)throw v.error}return[7];case 13:return[2]}}))}))},e}(),$=function(){function e(){this.values=[]}return e.prototype.valueToNumber=function(e){var t=this.values.indexOf(e);return-1===t&&(t=this.values.length,this.values.push(e)),t},e.prototype.numberToValue=function(e){return this.values[e]},e}(),Q=function(){function e(){this.keyMemory=new $,this.defaultMemory=new $}return e.prototype.unwrap=function(e){var t=this,n=[];(function(e){var t,n=null===(t=e.match(Y))||void 0===t?void 0:t.filter((function(e){return e.length>8}));return(null==n?void 0:n.map(q))||[]})(e).forEach((function(e){var r=s(function(e){var t,n,r=[];try{for(var i=o(e),s=i.next();!s.done;s=i.next()){var a=s.value;r.push(a.codePointAt(0))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e),2),i=r[0],a=r[1],u=t.keyMemory.numberToValue(i),c=void 0!==a?t.defaultMemory.numberToValue(a):void 0;n.push({key:u,params:void 0,defaultValue:c})}));var r=function(e){return e.replace(Y,"")}(e);if(n.length)return{text:r,keys:n}},e.prototype.wrap=function(e,t,n,r){void 0===n&&(n=void 0),void 0===r&&(r=void 0);var i=[this.keyMemory.valueToNumber(e)];return n&&i.push(this.defaultMemory.valueToNumber(n)),(r||n||"")+J(String.fromCodePoint.apply(String,a([],s(i),!1)))},e}(),ee=function(){function e(e,t,n){this.textHandler=e,this.attributeHandler=t,this.wrappedHandler=n}return e.prototype.handleSubtree=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.attributeHandler.handle(e)];case 1:return t.sent(),[4,this.textHandler.handle(e)];case 2:return t.sent(),[4,this.wrappedHandler.handle(e)];case 3:return t.sent(),[2]}}))}))},e}(),te=function(){function e(e){this.nodeHandler=e}return e.prototype.handle=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t="./descendant-or-self::text()[contains(., '".concat(z[0],"')]"),n=w.evaluate(t,e),r=this.nodeHandler.filterRestricted(n),[4,this.nodeHandler.handleNodes(r)];case 1:return i.sent(),[2]}}))}))},e}(),ne=function(){function e(e,t){this.coder=new Q,this.nodeHandler=new I(e,t,this),this.textHandler=new te(this.nodeHandler),this.attributeHandler=new Z(e,this.nodeHandler),this.wrappedHandler=new G(t,this.nodeHandler),this.coreHandler=new ee(this.textHandler,this.attributeHandler,this.wrappedHandler)}return e.prototype.handleText=function(e){return this.textHandler.handle(e)},e.prototype.handleSubtree=function(e){return this.coreHandler.handleSubtree(e)},e.prototype.handleAttribute=function(e){return this.attributeHandler.handle(e)},e.prototype.wrap=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n=void 0),void 0===r&&(r=""),this.coder.wrap(e,t,n,r)},e.prototype.unwrap=function(e){return this.coder.unwrap(e)},e}(),re=function(){function e(){var e=this;this.properties=new c,this.eventService=new p,this.apiHttpService=new d(this.properties),this.mouseEventHandler=new m(this.properties),this.moduleService=new R,this.coreService=new S(this.properties,this.apiHttpService),this.screenshotService=new C(this.coreService,this.apiHttpService),this.translationService=new v(this.properties,this.coreService,this.apiHttpService,this.eventService),this.textService=new y(this.properties,this.translationService,this.moduleService),this.highlightFunctionInitializer=new O(this.properties),this.translationHighlighter=new E(this),this.elementRegistrar=new _(this.properties,this.translationHighlighter,this.eventService),this.messages=new N,this.pluginManager=new P(this.messages,this.properties,this.eventService,this.elementRegistrar,this.translationService),this.run=function(){e.mouseEventHandler.run()},this.stop=function(){e.observer.stopObserving(),e.elementRegistrar.cleanAll(),w.unmarkElementAsTargetElement(e.properties.config.targetElement)},this.translationHighlighter.pluginManager=this.pluginManager}return e.prototype.init=function(e){if(this.properties.config)throw new Error("Duplicate initialization of config");this.properties.config=new L(e),"invisible"===this.properties.config.wrapperMode?this.wrapper=new ne(this.properties,this.elementRegistrar):this.wrapper=new F(this.eventService,this.properties,this.textService,this.elementRegistrar),this.observer=new T(this.properties,this.wrapper,this.elementRegistrar),this.translationService.initStatic()},e}(),ie=function(){function e(){var e=this;this.stop=function(){e.dependencyService.stop()},this.dependencyService=new re}return Object.defineProperty(e.prototype,"properties",{get:function(){return this.dependencyService.properties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lang",{get:function(){return this.properties.currentLanguage},set:function(e){var t=this;this.properties.currentLanguage=e,this.dependencyService.translationService.loadTranslations(e).then((function(){t.emitLangChangeEvent(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultLanguage",{get:function(){return this.properties.config.defaultLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLangChange",{get:function(){return this.dependencyService.eventService.LANGUAGE_CHANGED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTranslationChange",{get:function(){return this.dependencyService.eventService.TRANSLATION_CHANGED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLangLoaded",{get:function(){return this.dependencyService.eventService.LANGUAGE_LOADED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initialLoading",{get:function(){var e,t,n,r;if("production"!==(null===(t=null===(e=this.properties)||void 0===e?void 0:e.config)||void 0===t?void 0:t.mode))return!0;var i=this.properties.currentLanguage,o=this.properties.config.fallbackLanguage,s=this.properties.config.preloadFallback,a=function(e){return void 0!==e&&"function"!=typeof e};return!a(null===(n=this.properties.config.staticData)||void 0===n?void 0:n[i])||!!s&&!a(null===(r=this.properties.config.staticData)||void 0===r?void 0:r[o])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coreService",{get:function(){return this.dependencyService.coreService},enumerable:!1,configurable:!0}),e.use=function(t){return(new e).use(t)},e.init=function(t){return(new e).init(t)},e.prototype.changeLanguage=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.dependencyService.translationService.loadTranslations(e)];case 1:return t.sent(),this.properties.currentLanguage=e,this.emitLangChangeEvent(e),[2]}}))}))},e.prototype.use=function(e){return this.dependencyService.moduleService.addModule(e),this},e.prototype.init=function(e){return this.dependencyService.init(e),this},e.prototype.run=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.dependencyService.run(),"development"!==this.properties.config.mode?[3,2]:[4,this.coreService.loadApiKeyDetails()];case 1:e.sent(),e.label=2;case 2:return[4,this.dependencyService.translationService.loadTranslations()];case 3:return e.sent(),[4,this.dependencyService.pluginManager.run()];case 4:return e.sent(),this.properties.config.preloadFallback?[4,this.dependencyService.translationService.loadTranslations(this.properties.config.fallbackLanguage)]:[3,6];case 5:e.sent(),e.label=6;case 6:return[4,this.refresh()];case 7:return e.sent(),this.properties.config.watch&&this.dependencyService.observer.observe(),[2]}}))}))},e.prototype.refresh=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.dependencyService.wrapper.handleSubtree(this.properties.config.targetElement)]}))}))},e.prototype.translate=function(e,t,n,o){return void 0===t&&(t={}),void 0===n&&(n=!1),void 0===o&&(o=void 0),r(this,void 0,void 0,(function(){var r,s,a,u;return i(this,(function(i){switch(i.label){case 0:return r="string"==typeof e?e:e.key,s=void 0,"object"==typeof e&&(t=void 0!==(a=e).params?a.params:t,n=void 0!==a.noWrap?a.noWrap:n,o=void 0!==a.defaultValue?a.defaultValue:o,s=a.orEmpty),[4,this.dependencyService.textService.translate(r,t,void 0,s,o)];case 1:return u=i.sent(),"development"!==this.properties.config.mode||n?[3,3]:[4,this.coreService.loadApiKeyDetails()];case 2:return i.sent(),[2,this.dependencyService.wrapper.wrap(r,t,o,u)];case 3:return[2,u]}}))}))},e.prototype.wrap=function(e,t,n,r){return"development"===this.properties.config.mode?this.dependencyService.wrapper.wrap(e,t,n,r):r||n},e.prototype.instant=function(e,t,n,r,i){void 0===t&&(t={}),void 0===n&&(n=!1);var o="string"==typeof e?e:e.key;if("object"==typeof e){var s=e;t=void 0!==s.params?s.params:t,n=void 0!==s.noWrap?s.noWrap:n,i=void 0!==s.defaultValue?s.defaultValue:i,r=void 0!==s.orEmpty?s.orEmpty:r}var a=this.dependencyService.textService.instant(o,t,void 0,r,i);return"development"!==this.properties.config.mode||n?a:this.dependencyService.wrapper.wrap(o,t,i,a)},e.prototype.getCachedTranslations=function(){return this.dependencyService.translationService.getCachedTranslations()},e.prototype.loadTranslations=function(e){return this.dependencyService.translationService.loadTranslations(e)},e.prototype.emitLangChangeEvent=function(e){this.onLangChange.emit(e)},e}();function oe(e){return e.type===K.literal}function se(e){return e.type===K.argument}function ae(e){return e.type===K.number}function ue(e){return e.type===K.date}function ce(e){return e.type===K.time}function le(e){return e.type===K.select}function he(e){return e.type===K.plural}function pe(e){return e.type===K.pound}function fe(e){return e.type===K.tag}function de(e){return!(!e||"object"!=typeof e||e.type!==X.number)}function ge(e){return!(!e||"object"!=typeof e||e.type!==X.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(V||(V={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(K||(K={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(X||(X={}));var ve=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,ye=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function me(e){var t={};return e.replace(ye,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var Ee=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var be,we=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,_e=/^(@+)?(\+|#+)?[rs]?$/g,Te=/(\*)(0+)|(#+)(0+)|(0+)/g,Se=/^(0+)$/;function Ae(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(_e,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function Le(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Pe(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!Se.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Ne(e){var t=Le(e);return t||{}}function Oe(e){for(var t={},r=0,i=e;r<i.length;r++){var o=i[r];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=n(n(n({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return n(n({},e),Ne(t))}),{}));continue;case"engineering":t=n(n(n({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return n(n({},e),Ne(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Te,(function(e,n,r,i,o,s){if(n)t.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Se.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(we.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(we,(function(e,n,r,i,o,s){return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var s=o.options[0];"w"===s?t=n(n({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=n(n({},t),Ae(s)))}else if(_e.test(o.stem))t=n(n({},t),Ae(o.stem));else{var a=Le(o.stem);a&&(t=n(n({},t),a));var u=Pe(o.stem);u&&(t=n(n({},t),u))}}return t}var Ce=new RegExp("^".concat(ve.source,"*")),Re=new RegExp("".concat(ve.source,"*$"));function Ie(e,t){return{start:e,end:t}}var ke=!!String.prototype.startsWith,De=!!String.fromCodePoint,Ue=!!Object.fromEntries,Me=!!String.prototype.codePointAt,xe=!!String.prototype.trimStart,Ge=!!String.prototype.trimEnd,Fe=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},He=!0;try{He="a"===(null===(be=Ye("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===be?void 0:be[0])}catch(e){He=!1}var je,Ve=ke?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Ke=De?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",i=e.length,o=0;i>o;){if((n=e[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},Xe=Ue?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n],o=i[0],s=i[1];t[o]=s}return t},Be=Me?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},We=xe?function(e){return e.trimStart()}:function(e){return e.replace(Ce,"")},ze=Ge?function(e){return e.trimEnd()}:function(e){return e.replace(Re,"")};function Ye(e,t){return new RegExp(e,t)}if(He){var Je=Ye("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");je=function(e,t){var n;return Je.lastIndex=t,null!==(n=Je.exec(e)[1])&&void 0!==n?n:""}}else je=function(e,t){for(var n=[];;){var r=Be(e,t);if(void 0===r||$e(r)||Qe(r))break;n.push(r),t+=r>=65536?2:1}return Ke.apply(void 0,n)};var qe=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,n)).err)return o;r.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(V.UNMATCHED_CLOSING_TAG,Ie(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&Ze(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;r.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;r.push(o.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:K.pound,location:Ie(s,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:K.literal,value:"<".concat(r,"/>"),location:Ie(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Ze(this.char()))return this.error(V.INVALID_TAG,Ie(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(V.UNMATCHED_CLOSING_TAG,Ie(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:K.tag,value:r,children:o,location:Ie(n,this.clonePosition())},err:null}:this.error(V.INVALID_TAG,Ie(s,this.clonePosition())))}return this.error(V.UNCLOSED_TAG,Ie(n,this.clonePosition()))}return this.error(V.INVALID_TAG,Ie(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(t);if(i)r+=i;else{var o=this.tryParseUnquoted(e,t);if(o)r+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=Ie(n,this.clonePosition());return{val:{type:K.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Ze(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Ke.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Ke(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,Ie(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(V.EMPTY_ARGUMENT,Ie(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(V.MALFORMED_ARGUMENT,Ie(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,Ie(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:K.argument,value:r,location:Ie(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,Ie(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(V.MALFORMED_ARGUMENT,Ie(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=je(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Ie(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(a){case"":return this.error(V.EXPECT_ARGUMENT_TYPE,Ie(s,u));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(f=ze(y.val)).length)return this.error(V.EXPECT_ARGUMENT_STYLE,Ie(this.clonePosition(),this.clonePosition()));c={style:f,styleLocation:Ie(l,this.clonePosition())}}if((m=this.tryParseArgumentClose(i)).err)return m;var h=Ie(i,this.clonePosition());if(c&&Ve(null==c?void 0:c.style,"::",0)){var p=We(c.style.slice(2));if("number"===a)return(y=this.parseNumberSkeletonFromString(p,c.styleLocation)).err?y:{val:{type:K.number,value:r,location:h,style:y.val},err:null};if(0===p.length)return this.error(V.EXPECT_DATE_TIME_SKELETON,h);var f={type:X.dateTime,pattern:p,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?me(p):{}};return{val:{type:"date"===a?K.date:K.time,value:r,location:h,style:f},err:null}}return{val:{type:"number"===a?K.number:"date"===a?K.date:K.time,value:r,location:h,style:null!==(o=null==c?void 0:c.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS,Ie(d,n({},d)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ie(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;this.bumpSpace(),g=this.parseIdentifierIfPossible(),v=y.val}var m,E=this.tryParsePluralOrSelectOptions(e,a,t,g);if(E.err)return E;if((m=this.tryParseArgumentClose(i)).err)return m;var b=Ie(i,this.clonePosition());return"select"===a?{val:{type:K.select,value:r,options:Xe(E.val),location:b},err:null}:{val:{type:K.plural,value:r,options:Xe(E.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(V.INVALID_ARGUMENT_TYPE,Ie(s,u))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,Ie(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(V.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ie(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(Ee).filter((function(e){return e.length>0}));n<r.length;n++){var i=r[n].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,u=s;a<u.length;a++)if(0===u[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(e){return this.error(V.INVALID_NUMBER_SKELETON,t)}return{val:{type:X.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?Oe(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var i,o=!1,s=[],a=new Set,u=r.value,c=r.location;;){if(0===u.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var h=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_SELECTOR,V.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=Ie(l,this.clonePosition()),u=this.message.slice(l.offset,this.offset())}if(a.has(u))return this.error("select"===t?V.DUPLICATE_SELECT_ARGUMENT_SELECTOR:V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===u&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ie(this.clonePosition(),this.clonePosition()));var f=this.parseMessage(e+1,t,n);if(f.err)return f;var d=this.tryParseArgumentClose(p);if(d.err)return d;s.push([u,{value:f.val,location:Ie(p,this.clonePosition())}]),a.add(u),this.bumpSpace(),u=(i=this.parseIdentifierIfPossible()).value,c=i.location}return 0===s.length?this.error("select"===t?V.EXPECT_SELECT_ARGUMENT_SELECTOR:V.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ie(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(V.MISSING_OTHER_CLAUSE,Ie(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=Ie(r,this.clonePosition());return i?Fe(o*=n)?{val:o,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Be(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Ve(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&$e(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Ze(e){return e>=97&&e<=122||e>=65&&e<=90}function $e(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Qe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function et(e){e.forEach((function(e){if(delete e.location,le(e)||he(e))for(var t in e.options)delete e.options[t].location,et(e.options[t].value);else ae(e)&&de(e.style)||(ue(e)||ce(e))&&ge(e.style)?delete e.style.location:fe(e)&&et(e.children)}))}function tt(e,t){void 0===t&&(t={}),t=n({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new qe(e,t).parse();if(r.err){var i=SyntaxError(V[r.err.kind]);throw i.location=r.err.location,i.originalMessage=r.err.message,i}return(null==t?void 0:t.captureLocation)||et(r.val),r.val}function nt(e,t){var n=t&&t.cache?t.cache:lt,r=t&&t.serializer?t.serializer:at;return(t&&t.strategy?t.strategy:st)(e,{cache:n,serializer:r})}function rt(e,t,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),s=t.get(o);return void 0===s&&(s=e.call(this,r),t.set(o,s)),s}function it(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return void 0===o&&(o=e.apply(this,r),t.set(i,o)),o}function ot(e,t,n,r,i){return n.bind(t,e,r,i)}function st(e,t){return ot(e,this,1===e.length?rt:it,t.cache.create(),t.serializer)}var at=function(){return JSON.stringify(arguments)};function ut(){this.cache=Object.create(null)}ut.prototype.get=function(e){return this.cache[e]},ut.prototype.set=function(e,t){this.cache[e]=t};var ct,lt={create:function(){return new ut}},ht={variadic:function(e,t){return ot(e,this,it,t.cache.create(),t.serializer)},monadic:function(e,t){return ot(e,this,rt,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(ct||(ct={}));var pt,ft=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.originalMessage=r,i}return t(n,e),n.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},n}(Error),dt=function(e){function n(t,n,r,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),ct.INVALID_VALUE,i)||this}return t(n,e),n}(ft),gt=function(e){function n(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),ct.INVALID_VALUE,r)||this}return t(n,e),n}(ft),vt=function(e){function n(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),ct.MISSING_VALUE,n)||this}return t(n,e),n}(ft);function yt(e){return"function"==typeof e}function mt(e,t,n,r,i,o,s){if(1===e.length&&oe(e[0]))return[{type:pt.literal,value:e[0].value}];for(var a=[],u=0,c=e;u<c.length;u++){var l=c[u];if(oe(l))a.push({type:pt.literal,value:l.value});else if(pe(l))"number"==typeof o&&a.push({type:pt.literal,value:n.getNumberFormat(t).format(o)});else{var h=l.value;if(!i||!(h in i))throw new vt(h,s);var p=i[h];if(se(l))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),a.push({type:"string"==typeof p?pt.literal:pt.object,value:p});else if(ue(l)){var f="string"==typeof l.style?r.date[l.style]:ge(l.style)?l.style.parsedOptions:void 0;a.push({type:pt.literal,value:n.getDateTimeFormat(t,f).format(p)})}else if(ce(l)){f="string"==typeof l.style?r.time[l.style]:ge(l.style)?l.style.parsedOptions:void 0;a.push({type:pt.literal,value:n.getDateTimeFormat(t,f).format(p)})}else if(ae(l)){(f="string"==typeof l.style?r.number[l.style]:de(l.style)?l.style.parsedOptions:void 0)&&f.scale&&(p*=f.scale||1),a.push({type:pt.literal,value:n.getNumberFormat(t,f).format(p)})}else{if(fe(l)){var d=l.children,g=l.value,v=i[g];if(!yt(v))throw new gt(g,"function",s);var y=v(mt(d,t,n,r,i,o).map((function(e){return e.value})));Array.isArray(y)||(y=[y]),a.push.apply(a,y.map((function(e){return{type:"string"==typeof e?pt.literal:pt.object,value:e}})))}if(le(l)){if(!(m=l.options[p]||l.options.other))throw new dt(l.value,p,Object.keys(l.options),s);a.push.apply(a,mt(m.value,t,n,r,i))}else if(he(l)){var m;if(!(m=l.options["=".concat(p)])){if(!Intl.PluralRules)throw new ft('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',ct.MISSING_INTL_API,s);var E=n.getPluralRules(t,{type:l.pluralType}).select(p-(l.offset||0));m=l.options[E]||l.options.other}if(!m)throw new dt(l.value,p,Object.keys(l.options),s);a.push.apply(a,mt(m.value,t,n,r,i,p-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===pt.literal&&t.type===pt.literal?n.value+=t.value:e.push(t),e}),[])}(a)}function Et(e,t){return t?Object.keys(e).reduce((function(r,i){var o,s;return r[i]=(o=e[i],(s=t[i])?n(n(n({},o||{}),s||{}),Object.keys(o).reduce((function(e,t){return e[t]=n(n({},o[t]),s[t]||{}),e}),{})):o),r}),n({},e)):e}function bt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(pt||(pt={}));var wt,_t=function(){function e(t,n,r,i){var o,s=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===pt.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return mt(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:null==i?void 0:i.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Et(e.formats,r),this.locales=n,this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:nt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,a([void 0],t,!1)))}),{cache:bt(o.number),strategy:ht.variadic}),getDateTimeFormat:nt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,a([void 0],t,!1)))}),{cache:bt(o.dateTime),strategy:ht.variadic}),getPluralRules:nt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,a([void 0],t,!1)))}),{cache:bt(o.pluralRules),strategy:ht.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=tt,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),Tt=((wt=function(){function e(){}return e.prototype.format=function(e){var t=e.translation,n=e.language,r=e.params;return new _t(t,n).format(r)},e}()).type="formatter",wt);export{Tt as IcuFormatter,u as ModifierKey,b as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,ie as Tolgee,L as TolgeeConfig,g as TranslationData};
16
16
  //# sourceMappingURL=tolgee.esm.js.map