@openremote/core 1.0.3 → 1.2.0-snapshot.20240512155932

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 (43) hide show
  1. package/dist/umd/index.bundle.js +2 -273
  2. package/dist/umd/index.bundle.js.LICENSE.txt +26 -0
  3. package/dist/umd/index.js +2 -7
  4. package/dist/umd/index.js.LICENSE.txt +22 -0
  5. package/dist/umd/index.orbundle.js +50 -280
  6. package/dist/umd/index.orbundle.js.LICENSE.txt +38 -0
  7. package/{dist → lib}/asset-mixin.d.ts +2 -0
  8. package/lib/asset-mixin.js +1 -0
  9. package/lib/asset-mixin.js.map +1 -0
  10. package/{dist → lib}/console.d.ts +14 -5
  11. package/lib/console.js +1 -0
  12. package/lib/console.js.map +1 -0
  13. package/lib/defaults.js +1 -0
  14. package/lib/defaults.js.map +1 -0
  15. package/{dist → lib}/event.d.ts +20 -19
  16. package/lib/event.js +1 -0
  17. package/lib/event.js.map +1 -0
  18. package/lib/index.d.ts +150 -0
  19. package/lib/index.js +1 -0
  20. package/lib/index.js.map +1 -0
  21. package/lib/util.d.ts +92 -0
  22. package/lib/util.js +1 -0
  23. package/lib/util.js.map +1 -0
  24. package/package.json +24 -25
  25. package/.project +0 -17
  26. package/.settings/org.eclipse.buildship.core.prefs +0 -2
  27. package/@types/i18next-sprintf-postprocessor.d.ts +0 -1
  28. package/dist/asset-mixin.js +0 -156
  29. package/dist/console.js +0 -452
  30. package/dist/defaults.js +0 -16
  31. package/dist/event.js +0 -567
  32. package/dist/index.d.ts +0 -224
  33. package/dist/index.js +0 -996
  34. package/dist/mdi-icons.json +0 -1
  35. package/dist/or-icon-set.d.ts +0 -3
  36. package/dist/or-icon-set.js +0 -10
  37. package/dist/util.d.ts +0 -41
  38. package/dist/util.js +0 -362
  39. package/mdi-iconset-generator.js +0 -34
  40. package/tsconfig.json +0 -16
  41. package/typedoc.js +0 -3
  42. package/webpack.config.js +0 -16
  43. /package/{dist → lib}/defaults.d.ts +0 -0
package/dist/umd/index.js CHANGED
@@ -1,7 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ORRest"),require("ORModel"),require("moment")):"function"==typeof define&&define.amd?define(["ORRest","ORModel","moment"],t):"object"==typeof exports?exports.ORCore=t(require("ORRest"),require("ORModel"),require("moment")):e.ORCore=t(e.ORRest,e.ORModel,e.moment)}(window,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=39)}([function(e,t,n){var i=n(24);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e.exports=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(t,n){t.exports=e},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var i=n(5),r=n(3);e.exports=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?r(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var i=n(25);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i=Object.prototype.hasOwnProperty,r=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)void 0!==e[i]&&(n[i]=e[i]);return n};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var o=t[i],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o<n.length;++o)void 0!==n[o]&&i.push(n[o]);t.obj[t.prop]=i}}}(t),e},decode:function(e,t,n){var i=e.replace(/\+/g," ");if("iso-8859-1"===n)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(e){return i}},encode:function(e,t,n){if(0===e.length)return e;var i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===n)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var r="",s=0;s<i.length;++s){var a=i.charCodeAt(s);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?r+=i.charAt(s):a<128?r+=o[a]:a<2048?r+=o[192|a>>6]+o[128|63&a]:a<55296||a>=57344?r+=o[224|a>>12]+o[128|a>>6&63]+o[128|63&a]:(s+=1,a=65536+((1023&a)<<10|1023&i.charCodeAt(s)),r+=o[240|a>>18]+o[128|a>>12&63]+o[128|a>>6&63]+o[128|63&a])}return r},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},merge:function e(t,n,o){if(!n)return t;if("object"!=typeof n){if(r(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(o&&(o.plainObjects||o.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return r(t)&&!r(n)&&(a=s(t,o)),r(t)&&r(n)?(n.forEach((function(n,r){if(i.call(t,r)){var s=t[r];s&&"object"==typeof s&&n&&"object"==typeof n?t[r]=e(s,n,o):t.push(n)}else t[r]=n})),t):Object.keys(n).reduce((function(t,r){var s=n[r];return i.call(t,r)?t[r]=e(t[r],s,o):t[r]=s,t}),a)}}},function(e,t,n){var i=n(29),r=n(30),o=n(15),s=n(31);e.exports=function(e,t){return i(e)||r(e,t)||o(e,t)||s()}},function(e,t){e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}},function(e,t,n){var i=n(14);e.exports=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}},function(e,t,n){"use strict";var i=String.prototype.replace,r=/%20/g,o=n(10),s={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=o.assign({default:s.RFC3986,formatters:{RFC1738:function(e){return i.call(e,r,"+")},RFC3986:function(e){return String(e)}}},s)},function(e,t,n){var i=n(26),r=n(27),o=n(15),s=n(28);e.exports=function(e){return i(e)||r(e)||o(e)||s()}},function(e,t,n){"use strict";var i=n(32),r=n(33),o=n(16);e.exports={formats:o,parse:r,stringify:i}},function(e,t,n){var i=n(34).default;e.exports=i,e.exports.default=i},function(e,t,n){e.exports=n(37).default},function(e,t,n){(function(e){!function(e){"use strict";var t,n=e.URLSearchParams&&e.URLSearchParams.prototype.get?e.URLSearchParams:null,i=n&&"a=1"===new n({a:1}).toString(),r=n&&"+"===new n("s=%2B").get("s"),o=!n||((t=new n).append("s"," &"),"s=+%26"===t.toString()),s=u.prototype,a=!(!e.Symbol||!e.Symbol.iterator);if(!(n&&i&&r&&o)){s.append=function(e,t){g(this.__URLSearchParams__,e,t)},s.delete=function(e){delete this.__URLSearchParams__[e]},s.get=function(e){var t=this.__URLSearchParams__;return e in t?t[e][0]:null},s.getAll=function(e){var t=this.__URLSearchParams__;return e in t?t[e].slice(0):[]},s.has=function(e){return e in this.__URLSearchParams__},s.set=function(e,t){this.__URLSearchParams__[e]=[""+t]},s.toString=function(){var e,t,n,i,r=this.__URLSearchParams__,o=[];for(t in r)for(n=d(t),e=0,i=r[t];e<i.length;e++)o.push(n+"="+d(i[e]));return o.join("&")};var c=!!r&&n&&!i&&e.Proxy;Object.defineProperty(e,"URLSearchParams",{value:c?new Proxy(n,{construct:function(e,t){return new e(new u(t[0]).toString())}}):u});var l=e.URLSearchParams.prototype;l.polyfill=!0,l.forEach=l.forEach||function(e,t){var n=h(this.toString());Object.getOwnPropertyNames(n).forEach((function(i){n[i].forEach((function(n){e.call(t,n,i,this)}),this)}),this)},l.sort=l.sort||function(){var e,t,n,i=h(this.toString()),r=[];for(e in i)r.push(e);for(r.sort(),t=0;t<r.length;t++)this.delete(r[t]);for(t=0;t<r.length;t++){var o=r[t],s=i[o];for(n=0;n<s.length;n++)this.append(o,s[n])}},l.keys=l.keys||function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},l.values=l.values||function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},l.entries=l.entries||function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},a&&(l[e.Symbol.iterator]=l[e.Symbol.iterator]||l.entries)}function u(e){((e=e||"")instanceof URLSearchParams||e instanceof u)&&(e=e.toString()),this.__URLSearchParams__=h(e)}function d(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function f(e){return decodeURIComponent(e.replace(/\+/g," "))}function p(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return a&&(n[e.Symbol.iterator]=function(){return n}),n}function h(e){var t={};if("object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&g(t,n,e[n]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var i=e.split("&"),r=0;r<i.length;r++){var o=i[r],s=o.indexOf("=");-1<s?g(t,f(o.slice(0,s)),f(o.slice(s+1))):o&&g(t,f(o),"")}}return t}function g(e,t,n){var i="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);t in e?e[t].push(i):e[t]=[i]}}(void 0!==e?e:"undefined"!=typeof window?window:this)}).call(this,n(13))},function(e,t,n){(function(e,i){var r;
2
- /*!
3
- * Platform.js <https://mths.be/platform>
4
- * Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
5
- * Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
6
- * Available under MIT license <https://mths.be/mit>
7
- */(function(){"use strict";var o={function:!0,object:!0},s=o[typeof window]&&window||this,a=o[typeof t]&&t,c=o[typeof e]&&e&&!e.nodeType&&e,l=a&&c&&"object"==typeof i&&i;!l||l.global!==l&&l.window!==l&&l.self!==l||(s=l);var u=Math.pow(2,53)-1,d=/\bOpera/,f=Object.prototype,p=f.hasOwnProperty,h=f.toString;function g(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function b(e){return e=E(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:g(e)}function v(e,t){for(var n in e)p.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?g(e):h.call(e).slice(8,-1)}function m(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function _(e,t){var n=null;return function(e,t){var n=-1,i=e?e.length:0;if("number"==typeof i&&i>-1&&i<=u)for(;++n<i;)t(e[n],n,e);else v(e,t)}(e,(function(i,r){n=t(n,i,r,e)})),n}function E(e){return String(e).replace(/^ +| +$/g,"")}var S=function e(t){var n=s,i=t&&"object"==typeof t&&"String"!=y(t);i&&(n=t,t=null);var r=n.navigator||{},o=r.userAgent||"";t||(t=o);var a,c,l,u,f,p=i?!!r.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(h.toString()),g=i?"Object":"ScriptBridgingProxyObject",S=i?"Object":"Environment",k=i&&n.java?"JavaPackage":y(n.java),O=i?"Object":"RuntimeObject",w=/\bJava/.test(k)&&n.java,x=w&&y(n.environment)==S,R=w?"a":"α",C=w?"b":"β",N=n.document||{},P=n.operamini||n.opera,I=d.test(I=i&&P?P["[[Class]]"]:y(P))?I:P=null,T=t,A=[],D=null,j=t==o,M=j&&P&&"function"==typeof P.version&&P.version(),L=_([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(e,n){return e||RegExp("\\b"+(n.pattern||m(n))+"\\b","i").exec(t)&&(n.label||n)})),U=function(e){return _(e,(function(e,n){return e||RegExp("\\b"+(n.pattern||m(n))+"\\b","i").exec(t)&&(n.label||n)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),F=H([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),B=function(e){return _(e,(function(e,n,i){return e||(n[F]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(F)]||RegExp("\\b"+m(i)+"(?:\\b|\\w*\\d)","i").exec(t))&&i}))}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),V=function(e){return _(e,(function(e,n){var i=n.pattern||m(n);return!e&&(e=RegExp("\\b"+i+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,n){var i={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&n&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(i=i[/[\d.]+$/.exec(e)])&&(e="Windows "+i),e=String(e),t&&n&&(e=e.replace(RegExp(t,"i"),n)),e=b(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,i,n.label||n)),e}))}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function H(e){return _(e,(function(e,n){var i=n.pattern||m(n);return!e&&(e=RegExp("\\b"+i+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+i+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+i+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(n.label&&!RegExp(i,"i").test(n.label)?n.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),n=n.label||n,e=b(e[0].replace(RegExp(i,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),e}))}if(L&&(L=[L]),B&&!F&&(F=H([B])),(a=/\bGoogle TV\b/.exec(F))&&(F=a[0]),/\bSimulator\b/i.test(t)&&(F=(F?F+" ":"")+"Simulator"),"Opera Mini"==U&&/\bOPiOS\b/.test(t)&&A.push("running in Turbo/Uncompressed mode"),"IE"==U&&/\blike iPhone OS\b/.test(t)?(B=(a=e(t.replace(/like iPhone OS/,""))).manufacturer,F=a.product):/^iP/.test(F)?(U||(U="Safari"),V="iOS"+((a=/ OS ([\d_]+)/i.exec(t))?" "+a[1].replace(/_/g,"."):"")):"Konqueror"!=U||/buntu/i.test(V)?B&&"Google"!=B&&(/Chrome/.test(U)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(F))||/\bAndroid\b/.test(V)&&/^Chrome/.test(U)&&/\bVersion\//i.test(t)?(U="Android Browser",V=/\bAndroid\b/.test(V)?V:"Android"):"Silk"==U?(/\bMobi/i.test(t)||(V="Android",A.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&A.unshift("accelerated")):"PaleMoon"==U&&(a=/\bFirefox\/([\d.]+)\b/.exec(t))?A.push("identifying as Firefox "+a[1]):"Firefox"==U&&(a=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(V||(V="Firefox OS"),F||(F=a[1])):!U||(a=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(U))?(U&&!F&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(a+"/")+8))&&(U=null),(a=F||B||V)&&(F||B||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(V))&&(U=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(V)?V:a)+" Browser")):"Electron"==U&&(a=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&A.push("Chromium "+a):V="Kubuntu",M||(M=_(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",m(U),"(?:Firefox|Minefield|NetFront)"],(function(e,n){return e||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))),(a=("iCab"==L&&parseFloat(M)>3?"WebKit":/\bOpera\b/.test(U)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(L)&&"WebKit"||!L&&/\bMSIE\b/i.test(t)&&("Mac OS"==V?"Tasman":"Trident")||"WebKit"==L&&/\bPlayStation\b(?! Vita\b)/i.test(U)&&"NetFront")&&(L=[a]),"IE"==U&&(a=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(U+=" Mobile",V="Windows Phone "+(/\+$/.test(a)?a:a+".x"),A.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(U="IE Mobile",V="Windows Phone 8.x",A.unshift("desktop mode"),M||(M=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=U&&"Trident"==L&&(a=/\brv:([\d.]+)/.exec(t))&&(U&&A.push("identifying as "+U+(M?" "+M:"")),U="IE",M=a[1]),j){if(u="global",f=null!=(l=n)?typeof l[u]:"number",/^(?:boolean|number|string|undefined)$/.test(f)||"object"==f&&!l[u])y(a=n.runtime)==g?(U="Adobe AIR",V=a.flash.system.Capabilities.os):y(a=n.phantom)==O?(U="PhantomJS",M=(a=a.version||null)&&a.major+"."+a.minor+"."+a.patch):"number"==typeof N.documentMode&&(a=/\bTrident\/(\d+)/i.exec(t))?(M=[M,N.documentMode],(a=+a[1]+4)!=M[1]&&(A.push("IE "+M[1]+" mode"),L&&(L[1]=""),M[1]=a),M="IE"==U?String(M[1].toFixed(1)):M[0]):"number"==typeof N.documentMode&&/^(?:Chrome|Firefox)\b/.test(U)&&(A.push("masking as "+U+" "+M),U="IE",M="11.0",L=["Trident"],V="Windows");else if(w&&(T=(a=w.lang.System).getProperty("os.arch"),V=V||a.getProperty("os.name")+" "+a.getProperty("os.version")),x){try{M=n.require("ringo/engine").version.join("."),U="RingoJS"}catch(e){(a=n.system)&&a.global.system==n.system&&(U="Narwhal",V||(V=a[0].os||null))}U||(U="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(a=n.process)&&("object"==typeof a.versions&&("string"==typeof a.versions.electron?(A.push("Node "+a.versions.node),U="Electron",M=a.versions.electron):"string"==typeof a.versions.nw&&(A.push("Chromium "+M,"Node "+a.versions.node),U="NW.js",M=a.versions.nw)),U||(U="Node.js",T=a.arch,V=a.platform,M=(M=/[\d.]+/.exec(a.version))?M[0]:null));V=V&&b(V)}if(M&&(a=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(M)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(j&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(D=/b/i.test(a)?"beta":"alpha",M=M.replace(RegExp(a+"\\+?$"),"")+("beta"==D?C:R)+(/\d+\+?/.exec(a)||"")),"Fennec"==U||"Firefox"==U&&/\b(?:Android|Firefox OS)\b/.test(V))U="Firefox Mobile";else if("Maxthon"==U&&M)M=M.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(F))"Xbox 360"==F&&(V=null),"Xbox 360"==F&&/\bIEMobile\b/.test(t)&&A.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(U)&&(!U||F||/Browser|Mobi/.test(U))||"Windows CE"!=V&&!/Mobi/i.test(t))if("IE"==U&&j)try{null===n.external&&A.unshift("platform preview")}catch(e){A.unshift("embedded")}else(/\bBlackBerry\b/.test(F)||/\bBB10\b/.test(t))&&(a=(RegExp(F.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||M)?(V=((a=[a,/BB10/.test(t)])[1]?(F=null,B="BlackBerry"):"Device Software")+" "+a[0],M=null):this!=v&&"Wii"!=F&&(j&&P||/Opera/.test(U)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==U&&/\bOS X (?:\d+\.){2,}/.test(V)||"IE"==U&&(V&&!/^Win/.test(V)&&M>5.5||/\bWindows XP\b/.test(V)&&M>8||8==M&&!/\bTrident\b/.test(t)))&&!d.test(a=e.call(v,t.replace(d,"")+";"))&&a.name&&(a="ing as "+a.name+((a=a.version)?" "+a:""),d.test(U)?(/\bIE\b/.test(a)&&"Mac OS"==V&&(V=null),a="identify"+a):(a="mask"+a,U=I?b(I.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(a)&&(V=null),j||(M=null)),L=["Presto"],A.push(a));else U+=" Mobile";(a=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(a=[parseFloat(a.replace(/\.(\d)$/,".0$1")),a],"Safari"==U&&"+"==a[1].slice(-1)?(U="WebKit Nightly",D="alpha",M=a[1].slice(0,-1)):M!=a[1]&&M!=(a[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(M=null),a[1]=(/\bChrome\/([\d.]+)/i.exec(t)||0)[1],537.36==a[0]&&537.36==a[2]&&parseFloat(a[1])>=28&&"WebKit"==L&&(L=["Blink"]),j&&(p||a[1])?(L&&(L[1]="like Chrome"),a=a[1]||((a=a[0])<530?1:a<532?2:a<532.05?3:a<533?4:a<534.03?5:a<534.07?6:a<534.1?7:a<534.13?8:a<534.16?9:a<534.24?10:a<534.3?11:a<535.01?12:a<535.02?"13+":a<535.07?15:a<535.11?16:a<535.19?17:a<536.05?18:a<536.1?19:a<537.01?20:a<537.11?"21+":a<537.13?23:a<537.18?24:a<537.24?25:a<537.36?26:"Blink"!=L?"27":"28")):(L&&(L[1]="like Safari"),a=(a=a[0])<400?1:a<500?2:a<526?3:a<533?4:a<534?"4+":a<535?5:a<537?6:a<538?7:a<601?8:"8"),L&&(L[1]+=" "+(a+="number"==typeof a?".x":/[.+]/.test(a)?"":"+")),"Safari"==U&&(!M||parseInt(M)>45)&&(M=a)),"Opera"==U&&(a=/\bzbov|zvav$/.exec(V))?(U+=" ",A.unshift("desktop mode"),"zvav"==a?(U+="Mini",M=null):U+="Mobile",V=V.replace(RegExp(" *"+a+"$"),"")):"Safari"==U&&/\bChrome\b/.exec(L&&L[1])&&(A.unshift("desktop mode"),U="Chrome Mobile",M=null,/\bOS X\b/.test(V)?(B="Apple",V="iOS 4.3+"):V=null),M&&0==M.indexOf(a=/[\d.]+$/.exec(V))&&t.indexOf("/"+a+"-")>-1&&(V=E(V.replace(a,""))),L&&!/\b(?:Avant|Nook)\b/.test(U)&&(/Browser|Lunascape|Maxthon/.test(U)||"Safari"!=U&&/^iOS/.test(V)&&/\bSafari\b/.test(L[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(U)&&L[1])&&(a=L[L.length-1])&&A.push(a),A.length&&(A=["("+A.join("; ")+")"]),B&&F&&F.indexOf(B)<0&&A.push("on "+B),F&&A.push((/^on /.test(A[A.length-1])?"":"on ")+F),V&&(a=/ ([\d.+]+)$/.exec(V),c=a&&"/"==V.charAt(V.length-a[0].length-1),V={architecture:32,family:a&&!c?V.replace(a[0],""):V,version:a?a[1]:null,toString:function(){var e=this.version;return this.family+(e&&!c?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(a=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(T))&&!/\bi686\b/i.test(T)?(V&&(V.architecture=64,V.family=V.family.replace(RegExp(" *"+a),"")),U&&(/\bWOW64\b/i.test(t)||j&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&A.unshift("32-bit")):V&&/^OS X/.test(V.family)&&"Chrome"==U&&parseFloat(M)>=39&&(V.architecture=64),t||(t=null);var K={};return K.description=t,K.layout=L&&L[0],K.manufacturer=B,K.name=U,K.prerelease=D,K.product=F,K.ua=t,K.version=U&&M,K.os=V||{architecture:null,family:null,version:null,toString:function(){return"null"}},K.parse=e,K.toString=function(){return this.description||""},K.version&&A.unshift(M),K.name&&A.unshift(U),V&&U&&(V!=String(V).split(" ")[0]||V!=U.split(" ")[0]&&!F)&&A.push(F?"("+V+")":"on "+V),A.length&&(K.description=A.join(" ")),K}();s.platform=S,void 0===(r=function(){return S}.call(t,n,t,e))||(e.exports=r)}).call(this)}).call(this,n(23)(e),n(13))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){function n(t,i){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,i)}e.exports=n},function(e,t,n){var i=n(14);e.exports=function(e){if(Array.isArray(e))return i(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){"use strict";var i=n(10),r=n(16),o=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,a(t)?t:[t])},u=Date.prototype.toISOString,d=r.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:r.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,r,o,s,c,u,d,p,h,g,b,v){var y,m=t;if("function"==typeof u?m=u(n,m):m instanceof Date?m=h(m):"comma"===r&&a(m)&&(m=i.maybeMap(m,(function(e){return e instanceof Date?h(e):e})).join(",")),null===m){if(o)return c&&!b?c(n,f.encoder,v,"key"):n;m=""}if("string"==typeof(y=m)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||i.isBuffer(m))return c?[g(b?n:c(n,f.encoder,v,"key"))+"="+g(c(m,f.encoder,v,"value"))]:[g(n)+"="+g(String(m))];var _,E=[];if(void 0===m)return E;if(a(u))_=u;else{var S=Object.keys(m);_=d?S.sort(d):S}for(var k=0;k<_.length;++k){var O=_[k],w=m[O];if(!s||null!==w){var x=a(m)?"function"==typeof r?r(n,O):n:n+(p?"."+O:"["+O+"]");l(E,e(w,x,r,o,s,c,u,d,p,h,g,b,v))}}return E};e.exports=function(e,t){var n,i=e,c=function(e){if(!e)return f;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=r.default;if(void 0!==e.format){if(!o.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=r.formatters[n],s=f.filter;return("function"==typeof e.filter||a(e.filter))&&(s=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:s,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof c.filter?i=(0,c.filter)("",i):a(c.filter)&&(n=c.filter);var u,d=[];if("object"!=typeof i||null===i)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=s[u];n||(n=Object.keys(i)),c.sort&&n.sort(c.sort);for(var g=0;g<n.length;++g){var b=n[g];c.skipNulls&&null===i[b]||l(d,p(i[b],b,h,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.formatter,c.encodeValuesOnly,c.charset))}var v=d.join(c.delimiter),y=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),v.length>0?y+v:""}},function(e,t,n){"use strict";var i=n(10),r=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:i.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,i){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(o),l=a?o.slice(0,a.index):o,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var d=0;n.depth>0&&null!==(a=s.exec(o))&&d<n.depth;){if(d+=1,!n.plainObjects&&r.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+o.slice(a.index)+"]"),function(e,t,n,i){for(var r=i?t:c(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if("[]"===a&&n.parseArrays)s=[].concat(r);else{s=n.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=r:s[l]=r:s={0:r}}r=s}return r}(u,t,n,i)}};e.exports=function(e,t){var n=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||i.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=u.split(t.delimiter,d),p=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<f.length;++n)0===f[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[n]?h="utf-8":"utf8=%26%2310003%3B"===f[n]&&(h="iso-8859-1"),p=n,n=f.length);for(n=0;n<f.length;++n)if(n!==p){var g,b,v=f[n],y=v.indexOf("]="),m=-1===y?v.indexOf("="):y+1;-1===m?(g=t.decoder(v,s.decoder,h,"key"),b=t.strictNullHandling?null:""):(g=t.decoder(v.slice(0,m),s.decoder,h,"key"),b=i.maybeMap(c(v.slice(m+1),t),(function(e){return t.decoder(e,s.decoder,h,"value")}))),b&&t.interpretNumericEntities&&"iso-8859-1"===h&&(b=a(b)),v.indexOf("[]=")>-1&&(b=o(b)?[b]:b),r.call(l,g)?l[g]=i.combine(l[g],b):l[g]=b}return l}(e,n):e,d=n.plainObjects?Object.create(null):{},f=Object.keys(u),p=0;p<f.length;++p){var h=f[p],g=l(h,u[h],n,"string"==typeof e);d=i.merge(d,g,n)}return i.compact(d)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(35)),s=n(36),a=(i=s)&&i.__esModule?i:{default:i};function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:a.default}}var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(this,e),this.init(t,n),this.type="backend"}return r(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=e,this.options=o.defaults(t,this.options||{},l())}},{key:"readMulti",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath(e,t));var r=this.services.interpolator.interpolate(i,{lng:e.join("+"),ns:t.join("+")});this.loadUrl(r,n)}},{key:"read",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath([e],[t]));var r=this.services.interpolator.interpolate(i,{lng:e,ns:t});this.loadUrl(r,n)}},{key:"loadUrl",value:function(e,t){var n=this;this.options.ajax(e,this.options,(function(i,r){if(r.status>=500&&r.status<600)return t("failed loading "+e,!0);if(r.status>=400&&r.status<500)return t("failed loading "+e,!1);var o=void 0,s=void 0;try{o=n.options.parse(i,e)}catch(t){s="failed parsing "+e+" to json"}if(s)return t(s,!1);t(null,o)}))}},{key:"create",value:function(e,t,n,i){var r=this;"string"==typeof e&&(e=[e]);var o={};o[n]=i||"",e.forEach((function(e){var n=r.services.interpolator.interpolate(r.options.addPath,{lng:e,ns:t});r.options.ajax(n,r.options,(function(e,t){}),o)}))}}]),e}();u.type="backend",t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=function(e){return r.call(o.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e},t.extend=function(e){return r.call(o.call(arguments,1),(function(t){if(t)for(var n in t)e[n]=t[n]})),e};var i=[],r=i.forEach,o=i.slice},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e,t){if(t&&"object"===(void 0===t?"undefined":i(t))){var n="",r=encodeURIComponent;for(var o in t)n+="&"+r(o)+"="+r(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e}t.default=function(e,t,n,o,s){o&&"object"===(void 0===o?"undefined":i(o))&&(s||(o._t=new Date),o=r("",o).slice(1)),t.queryStringParams&&(e=r(e,t.queryStringParams));try{var a;(a=XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0")).open(o?"POST":"GET",e,1),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!t.withCredentials,o&&a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var c=t.customHeaders;if(c)for(var l in c)a.setRequestHeader(l,c[l]);a.onreadystatechange=function(){a.readyState>3&&n&&n(a.responseText,a)},a.send(o)}catch(e){console&&console.log(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=n(38);t.default={name:"sprintf",type:"postProcessor",process:function(e,t,n){return n.sprintf?"[object Array]"===Object.prototype.toString.apply(n.sprintf)?(0,r.vsprintf)(e,n.sprintf):"object"===i(n.sprintf)?(0,r.sprintf)(e,n.sprintf):e:e},overloadTranslationOptionHandler:function(e){for(var t=[],n=1;n<e.length;n++)t.push(e[n]);return{postProcess:"sprintf",sprintf:t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sprintf=r,t.vsprintf=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),r.apply(null,n)};var i={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function r(){var e=arguments[0],t=r.cache;return t[e]&&t.hasOwnProperty(e)||(t[e]=r.parse(e)),r.format.call(null,t[e],arguments)}function o(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}r.format=function(e,t){var n,s,a,c,l,u,d,f,p=1,h=e.length,g="",b=[],v=!0,y="";for(s=0;s<h;s++)if("string"===(g=o(e[s])))b[b.length]=e[s];else if("array"===g){if((c=e[s])[2])for(n=t[p],a=0;a<c[2].length;a++){if(!n.hasOwnProperty(c[2][a]))throw new Error(r("[sprintf] property '%s' does not exist",c[2][a]));n=n[c[2][a]]}else n=c[1]?t[c[1]]:t[p++];if("function"==o(n)&&(n=n()),i.not_string.test(c[8])&&i.not_json.test(c[8])&&"number"!=o(n)&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %s",o(n)));switch(i.number.test(c[8])&&(v=n>=0),c[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,c[6]?parseInt(c[6]):0);break;case"e":n=c[7]?n.toExponential(c[7]):n.toExponential();break;case"f":n=c[7]?parseFloat(n).toFixed(c[7]):parseFloat(n);break;case"g":n=c[7]?parseFloat(n).toPrecision(c[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&c[7]?n.substring(0,c[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}i.json.test(c[8])?b[b.length]=n:(!i.number.test(c[8])||v&&!c[3]?y="":(y=v?"+":"-",n=n.toString().replace(i.sign,"")),u=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",d=c[6]-(y+n).length,l=c[6]&&d>0?(f=u,Array(d+1).join(f)):"",b[b.length]=c[5]?y+n+l:"0"===u?y+l+n:l+y+n)}return b.join("")},r.cache={},r.parse=function(e){for(var t=e,n=[],r=[],o=0;t;){if(null!==(n=i.text.exec(t)))r[r.length]=n[0];else if(null!==(n=i.modulo.exec(t)))r[r.length]="%";else{if(null===(n=i.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){o|=1;var s=[],a=n[2],c=[];if(null===(c=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s[s.length]=c[1];""!==(a=a.substring(c[0].length));)if(null!==(c=i.key_access.exec(a)))s[s.length]=c[1];else{if(null===(c=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s[s.length]=c[1]}n[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=n}t=t.substring(n[0].length)}return r}},function(e,t,n){"use strict";n.r(t),n.d(t,"Util",(function(){return i})),n.d(t,"subscribe",(function(){return We})),n.d(t,"Console",(function(){return s})),n.d(t,"EventProviderStatus",(function(){return Ae})),n.d(t,"WebSocketEventProvider",(function(){return Me})),n.d(t,"DefaultColor4",(function(){return qe})),n.d(t,"DefaultColor7",(function(){return ze})),n.d(t,"DefaultColor1",(function(){return $e})),n.d(t,"DefaultColor2",(function(){return Je})),n.d(t,"DefaultColor5",(function(){return Xe})),n.d(t,"DefaultColor6",(function(){return Ye})),n.d(t,"DefaultColor8",(function(){return Qe})),n.d(t,"DefaultColor3",(function(){return Ze})),n.d(t,"DefaultColor9",(function(){return et})),n.d(t,"DefaultColor10",(function(){return tt})),n.d(t,"DefaultColor11",(function(){return nt})),n.d(t,"DefaultBoxShadowBottom",(function(){return it})),n.d(t,"DefaultBoxShadow",(function(){return rt})),n.d(t,"DefaultHeaderHeight",(function(){return ot})),n.d(t,"DefaultDisabledOpacity",(function(){return st})),n.d(t,"DEFAULT_ICONSET",(function(){return ct})),n.d(t,"ORError",(function(){return lt})),n.d(t,"Auth",(function(){return ut})),n.d(t,"OREvent",(function(){return dt})),n.d(t,"EventProviderType",(function(){return ft})),n.d(t,"MapType",(function(){return pt})),n.d(t,"IconSetAddedEvent",(function(){return ht})),n.d(t,"ORIconSets",(function(){return gt})),n.d(t,"AssetModelUtil",(function(){return bt})),n.d(t,"Manager",(function(){return vt})),n.d(t,"manager",(function(){return yt})),n.d(t,"IconSets",(function(){return mt}));var i={};n.r(i),n.d(i,"Deferred",(function(){return ae})),n.d(i,"getQueryParameters",(function(){return ce})),n.d(i,"getQueryParameter",(function(){return le})),n.d(i,"getGeoNotificationsFromRulesSet",(function(){return ue})),n.d(i,"isTimeDuration",(function(){return fe})),n.d(i,"isTimeDurationPositiveInfinity",(function(){return pe})),n.d(i,"isTimeDurationNegativeInfinity",(function(){return he})),n.d(i,"isObject",(function(){return ge})),n.d(i,"objectsEqual",(function(){return be})),n.d(i,"arrayRemove",(function(){return ve})),n.d(i,"enumContains",(function(){return ye})),n.d(i,"getEnumKeyAsString",(function(){return me})),n.d(i,"getAssetAttribute",(function(){return _e})),n.d(i,"getAssetAttributes",(function(){return Ee})),n.d(i,"getFirstMetaItem",(function(){return Se})),n.d(i,"hasMetaItem",(function(){return ke})),n.d(i,"getMetaValue",(function(){return Oe})),n.d(i,"getAttributeLabel",(function(){return we})),n.d(i,"getMetaItemLabel",(function(){return xe})),n.d(i,"getAttributeValueFormat",(function(){return Re})),n.d(i,"getAttributeValueFormatter",(function(){return Ce})),n.d(i,"getAttributeValueFormatted",(function(){return Ne})),n.d(i,"updateAsset",(function(){return Pe})),n.d(i,"loadJs",(function(){return Ie})),n.d(i,"sortByString",(function(){return Te}));n(21);var r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};let o=n(22);class s{constructor(e,t,n){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=n,window.OpenRemoteConsole=this;let i=new URLSearchParams(window.location.search),r=i.get("consoleName"),o=i.get("consoleVersion"),a=i.get("consolePlatform"),c=i.get("consoleProviders"),l=i.get("consoleAutoEnable"),u=c&&c.length>0?c.split(" "):["push","storage"];u.indexOf("storage")<0&&u.push("storage"),this._pendingProviderEnables=c&&c.length>0?c.split(" "):[];let d=s._createConsoleRegistration(),f=window.localStorage.getItem("OpenRemoteConsole:"+e);if(f)try{let e=JSON.parse(f);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let p=d.providers;d.providers={};for(let e of u){let t=p&&p.hasOwnProperty(e)?p[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let h=_t.getAppName();h.length>0&&d.apps.indexOf(h)<0&&d.apps.push(h),this._registration=d,r&&(d.name=r),o&&(d.version=o),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){return"iP"===navigator.platform.substr(0,2)&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return r(this,void 0,void 0,(function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}}))}enableProviders(){return r(this,void 0,void 0,(function*(){if(!this._initialised)throw new Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}}))}enableProvider(e,t){return r(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},i=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=i.hasPermission,this._registration.providers[e].success=i.success,this._registration.providers[e].enabled=i.success,this._registration.providers[e].data=i.data;let r=this._pendingProviderEnables.indexOf(e);return r>=0&&(this._pendingProviderEnables.splice(r,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),i}))}disableProvider(e){return r(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t}))}sendProviderMessage(e,t){return r(this,void 0,void 0,(function*(){if(!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),new Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let n=e.provider+e.action;if(this._pendingProviderPromises[n])throw new Error("Message already pending for provider '"+name+"' with action '"+e.action+"'");return yield new Promise(t=>{this._pendingProviderPromises[n]=t,this._doSendProviderMessage(e)})}))}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),e=void 0!==e?e:2e3,console.debug("Sending registration in: "+e+"ms"),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{_t.rest.api.ConsoleResource.register(this._registration).then(t=>{if(200!==t.status)throw new Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()})}catch(e){console.error("Failed to register console"),t("Failed to register console")}})})}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return r(this,void 0,void 0,(function*(){let t=yield this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);if(t&&t.value)return t.value}))}_postNativeShellMessage(e){return this.shellAndroid?window.MobileInterface.postMessage(JSON.stringify(e)):this.shellApple?window.webkit.messageHandlers.int.postMessage(e):void 0}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let n={action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(n));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new Error("Storage provider 'store' action requires a `key`");e.value&&(null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new Error("Storage provider 'retrieve' action requires a `key`");this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:window.localStorage.getItem(t)}))}break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),n=t.provider,i=t.action,r=this._pendingProviderPromises[n+i];null!=r&&(this._pendingProviderPromises[n+i]=null,r(t))}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:o.name,version:o.version,platform:o.os.toString(),apps:[],model:((o.manufacturer?o.manufacturer+" ":"")+(o.product?o.product:"")).trim()}}_initialiseProvider(e){return r(this,void 0,void 0,(function*(){console.debug("Console: initialising provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0);if(this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data,t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}}))}}var a=n(4),c=n.n(a),l=n(9),u=n(5),d=n.n(u),f=n(0),p=n.n(f),h=n(1),g=n.n(h),b=n(2),v=n.n(b),y=n(6),m=n.n(y),_=n(7),E=n.n(_),S=n(8),k=n.n(S),O=n(3),w=n.n(O),x=n(17),R=n.n(x),C={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var n;console&&console[e]&&(n=console)[e].apply(n,R()(t))}},N=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g()(this,e),this.init(t,n)}return v()(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||C,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,i){return i&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,p()({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),P=function(){function e(){g()(this,e),this.observers={}}return v()(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){var n=this;this.observers[e]&&this.observers[e].forEach((function(){if(t){var i=n.observers[e].indexOf(t);i>-1&&n.observers[e].splice(i,1)}else delete n.observers[e]}))}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(this.observers[e]){var r=[].concat(this.observers[e]);r.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function I(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function T(e){return null==e?"":""+e}function A(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function D(e,t,n){function i(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(r())return{};var s=i(o.shift());!e[s]&&n&&(e[s]=new n),e=e[s]}return r()?{}:{obj:e,k:i(o.shift())}}function j(e,t,n){var i=D(e,t,Object);i.obj[i.k]=n}function M(e,t){var n=D(e,t),i=n.obj,r=n.k;if(i)return i[r]}function L(e,t,n){for(var i in t)i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof t[i]||t[i]instanceof String?n&&(e[i]=t[i]):L(e[i],t[i],n):e[i]=t[i];return e}function U(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function B(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return F[e]})):e}var V=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return g()(this,t),n=m()(this,E()(t).call(this)),P.call(w()(w()(n))),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return k()(t,e),v()(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(o=e.split(".")),M(this.data,o)}},{key:"addResource",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=t,t=(s=e.split("."))[1]),this.addNamespaces(t),j(this.data,s,i),r.silent||this.emit("added",e,t,n,i)}},{key:"addResources",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});i.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(i=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=M(this.data,s)||{};i?L(a,n,r):a=p()({},a,n),j(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?p()({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(P),H={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,r){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,i,r))})),t}},K=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return g()(this,t),n=m()(this,E()(t).call(this)),P.call(w()(w()(n))),A(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],e,w()(w()(n))),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=N.create("translator"),n}return k()(t,e),v()(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(o[0])>-1)&&(r=o.shift()),e=o.join(i)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,t){var n=this;if("object"!==d()(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=this.extractFromKey(e[e.length-1],t),o=r.key,s=r.namespaces,a=s[s.length-1],c=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(l){var u=t.nsSeparator||this.options.nsSeparator;return a+u+o}return o}var f=this.resolve(e,t),h=f&&f.res,g=f&&f.usedKey||o,b=f&&f.exactUsedKey||o,v=Object.prototype.toString.apply(h),y=["[object Number]","[object Function]","[object RegExp]"],m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,E="string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h;if(_&&h&&E&&y.indexOf(v)<0&&("string"!=typeof m||"[object Array]"!==v)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,t):"key '".concat(o," (").concat(this.language,")' returned an object instead of string.");if(i){var S="[object Array]"===v,k=S?[]:{},O=S?b:g;for(var w in h)if(Object.prototype.hasOwnProperty.call(h,w)){var x="".concat(O).concat(i).concat(w);k[w]=this.translate(x,p()({},t,{joinArrays:!1,ns:s})),k[w]===x&&(k[w]=h[w])}h=k}}else if(_&&"string"==typeof m&&"[object Array]"===v)(h=h.join(m))&&(h=this.extendTranslation(h,e,t));else{var R=!1,C=!1;if(!this.isValidLookup(h)&&void 0!==t.defaultValue){if(R=!0,void 0!==t.count){var N=this.pluralResolver.getSuffix(c,t.count);h=t["defaultValue".concat(N)]}h||(h=t.defaultValue)}this.isValidLookup(h)||(C=!0,h=o);var P=t.defaultValue&&t.defaultValue!==h&&this.options.updateMissing;if(C||R||P){this.logger.log(P?"updateKey":"missingKey",c,a,o,P?t.defaultValue:h);var I=[],T=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&T&&T[0])for(var A=0;A<T.length;A++)I.push(T[A]);else"all"===this.options.saveMissingTo?I=this.languageUtils.toResolveHierarchy(t.lng||this.language):I.push(t.lng||this.language);var D=function(e,i){n.options.missingKeyHandler?n.options.missingKeyHandler(e,a,i,P?t.defaultValue:h,P,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,a,i,P?t.defaultValue:h,P,t),n.emit("missingKey",e,a,i,h)};if(this.options.saveMissing){var j=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&j?I.forEach((function(e){n.pluralResolver.getPluralFormsOfKey(e,o).forEach((function(t){return D([e],t)}))})):D(I,o)}}h=this.extendTranslation(h,e,t,f),C&&h===o&&this.options.appendNamespaceToMissingKey&&(h="".concat(a,":").concat(o)),C&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,i){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(p()({},n,{interpolation:p()({},this.options.interpolation,n.interpolation)}));var o=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(o=p()({},this.options.interpolation.defaultVariables,o)),e=this.interpolator.interpolate(e,o,n.lng||this.language,n),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){return r.translate.apply(r,arguments)}),n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,a="string"==typeof s?[s]:s;return null!=e&&a&&a.length&&!1!==n.applyPostProcessor&&(e=H.handle(a,e,t,n,this)),e}},{key:"resolve",value:function(e){var t,n,i,r,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var c=s.extractFromKey(e,a),l=c.key;n=l;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,p=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,p.forEach((function(n){if(!s.isValidLookup(t)){r=n;var o,c,u=l,p=[u];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(p,l,n,e,a);else d&&(o=s.pluralResolver.getSuffix(n,a.count)),d&&f&&p.push(u+o),f&&p.push(u+="".concat(s.options.contextSeparator).concat(a.context)),d&&p.push(u+=o);for(;c=p.pop();)s.isValidLookup(t)||(i=c,t=s.getResource(n,e,c,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:i,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}}]),t}(P);function G(e){return e.charAt(0).toUpperCase()+e.slice(1)}var W=function(){function e(t){g()(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=N.create("languageUtils")}return v()(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=G(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=function(e){e&&(n.isWhitelisted(e)?r.push(e):n.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),i.forEach((function(e){r.indexOf(e)<0&&o(n.formatLanguageCode(e))})),r}}]),e}(),q=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],z={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};function $(){var e={};return q.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:z[t.fc]}}))})),e}var J=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g()(this,e),this.languageUtils=t,this.options=n,this.logger=N.create("pluralResolver"),this.rules=$()}return v()(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,i=[],r=this.getRule(e);return r?(r.numbers.forEach((function(r){var o=n.getSuffix(e,r);i.push("".concat(t).concat(o))})),i):i}},{key:"getSuffix",value:function(e,t){var n=this,i=this.getRule(e);if(i){var r=i.noAbs?i.plurals(t):i.plurals(Math.abs(t)),o=i.numbers[r];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g()(this,e),this.logger=N.create("interpolator"),this.init(t,!0)}return v()(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e}),e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=void 0!==n.escape?n.escape:B,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?U(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?U(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?U(n.nestingPrefix):n.nestingPrefixEscaped||U("$t("),this.nestingSuffix=n.nestingSuffix?U(n.nestingSuffix):n.nestingSuffixEscaped||U(")"),this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,i){var r,o,s,a=this;function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0)return M(t,e);var i=e.split(a.formatSeparator),r=i.shift().trim(),o=i.join(a.formatSeparator).trim();return a.format(M(t,r),o,n)};this.resetRegExp();var u=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler;for(s=0;(r=this.regexpUnescape.exec(e))&&(o=l(r[1].trim()),e=e.replace(r[0],o),this.regexpUnescape.lastIndex=0,!(++s>=this.maxReplaces)););for(s=0;r=this.regexp.exec(e);){if(void 0===(o=l(r[1].trim())))if("function"==typeof u){var d=u(e,r,i);o="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),o="";else"string"==typeof o||this.useRawValueToEscape||(o=T(o));if(o=this.escapeValue?c(this.escape(o)):c(o),e=e.replace(r[0],o),this.regexp.lastIndex=0,++s>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=p()({},r);function s(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var i=n.join(",");i=(i=this.interpolate(i,o)).replace(/'/g,'"');try{o=JSON.parse(i),t&&(o=p()({},t,o))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return e}for(o.applyPostProcessor=!1;n=this.nestingRegexp.exec(e);){if((i=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof i)return i;"string"!=typeof i&&(i=T(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),i=""),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}]),e}(),Y=n(11),Q=n.n(Y);var Z=function(e){function t(e,n,i){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return g()(this,t),r=m()(this,E()(t).call(this)),P.call(w()(w()(r))),r.backend=e,r.store=n,r.languageUtils=i.languageUtils,r.options=o,r.logger=N.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(i,o.backend,o),r}return k()(t,e),v()(t,[{key:"queueLoad",value:function(e,t,n,i){var r=this,o=[],s=[],a=[],c=[];return e.forEach((function(e){var i=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[a]=2:r.state[a]<0||(1===r.state[a]?s.indexOf(a)<0&&s.push(a):(r.state[a]=1,i=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),c.indexOf(t)<0&&c.push(t)))})),i||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:i}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var i=e.split("|"),r=Q()(i,2),o=r[0],s=r[1];t&&this.emit("failedLoading",o,s,t),n&&this.store.addResourceBundle(o,s,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var i,r,c,l,u,d;i=n.loaded,r=s,l=D(i,[o],Object),u=l.obj,d=l.k,u[d]=u[d]||[],c&&(u[d]=u[d].concat(r)),c||u[d].push(r),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,c){a&&c&&r<5?setTimeout((function(){i.read.call(i,e,t,n,r+1,2*o,s)}),o):s(a,c)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,i,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.split("|"),r=Q()(i,2),o=r[0],s=r[1];this.read(o,s,"read",null,null,(function(i,r){i&&t.logger.warn("".concat(n,"loading namespace ").concat(s," for language ").concat(o," failed"),i),!i&&r&&t.logger.log("".concat(n,"loaded namespace ").concat(s," for language ").concat(o),r),t.loaded(e,i,r)}))}},{key:"saveMissing",value:function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(e,t,n,i,null,p()({},o,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,i)}}]),t}(P);function ee(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===d()(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===d()(e[2])||"object"===d()(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}}}function te(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function ne(){}var ie=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(g()(this,t),e=m()(this,E()(t).call(this)),P.call(w()(w()(e))),e.options=te(n),e.services={},e.logger=N,e.modules={external:[]},i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),m()(e,w()(w()(e)));setTimeout((function(){e.init(n,i)}),0)}return e}return k()(t,e),v()(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=p()({},ee(),this.options,te(t)),this.format=this.options.interpolation.format,n||(n=ne),!this.options.isClone){this.modules.logger?N.init(i(this.modules.logger),this.options):N.init(null,this.options);var r=new W(this.options);this.store=new V(this.options.resources,this.options);var o=this.services;o.logger=N,o.resourceStore=this.store,o.languageUtils=r,o.pluralResolver=new J(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new X(this.options),o.backendConnector=new Z(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];e.emit.apply(e,[t].concat(i))})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new K(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];e.emit.apply(e,[t].concat(i))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}var s=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"];s.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var a=I(),c=function(){e.changeLanguage(e.options.lng,(function(t,i){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),a.resolve(i),n(t,i)}))};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),a}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],i=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};if(this.language)i(this.language);else{var r=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);r.forEach((function(e){return i(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(n,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,n){var i=I();return e||(e=this.languages),t||(t=this.options.ns),n||(n=ne),this.services.backendConnector.reload(e,t,(function(e){i.resolve(),n(e)})),i}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&H.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this,i=I();this.emit("languageChanging",e);var r=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources((function(r){!function(e,r){n.translator.changeLanguage(r),r&&(n.emit("languageChanged",r),n.logger.log("languageChanged",r)),i.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(r,e)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var r=p()({},i);if("object"!==d()(i)){for(var o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];r=n.options.overloadTranslationOptionHandler([t,i].concat(s))}return r.lng=r.lng||e.lng,r.lngs=r.lngs||e.lngs,r.ns=r.ns||e.ns,n.t(t,r)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"loadNamespaces",value:function(e,t){var n=this,i=I();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=I();"string"==typeof e&&(e=[e]);var i=this.options.preload||[],r=e.filter((function(e){return i.indexOf(e)<0}));return r.length?(this.options.preload=i.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne,r=p()({},this.options,n,{isClone:!0}),o=new t(r),s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.translator=new K(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];o.emit.apply(o,[e].concat(n))})),o.init(r,i),o.translator.options=o.options,o}}]),t}(P)),re=ie,oe=(ie.changeLanguage.bind(ie),ie.cloneInstance.bind(ie),ie.createInstance.bind(ie),ie.dir.bind(ie),ie.exists.bind(ie),ie.getFixedT.bind(ie),ie.init.bind(ie),ie.loadLanguages.bind(ie),ie.loadNamespaces.bind(ie),ie.loadResources.bind(ie),ie.off.bind(ie),ie.on.bind(ie),ie.setDefaultNamespace.bind(ie),ie.t.bind(ie),ie.use.bind(ie),n(18)),se=n.n(oe);class ae{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}}function ce(e){return se.a.parse(e,{ignoreQueryPrefix:!0})}function le(e,t){const n=ce(e);return n?n[t]:void 0}function ue(e){const t=[];return e.rules.forEach(e=>{if(e.when&&e.then&&e.then.length>0){const n=new Map;!function(e,t,n){if(!e)return;const i=[];e.groups&&e.groups.forEach(e=>{e.items&&e.items.forEach(e=>{i.push(e)})});e.items&&e.items.forEach(e=>{i.push(e)});i&&i.forEach(e=>{if(e.assets&&e.assets.attributes){const i=[];if(function e(t,n){if(!t)return;t.items.forEach(e=>{!e.value||"radial"!==e.value.predicateType&&"rect"!==e.value.predicateType||n.push({predicate:e.value})}),t.groups&&t.groups.forEach(t=>e(t,n))}(e.assets.attributes,i),i.length>0){const r=e.tag||t.toString();n.set(r,i)}}})}(e.when,0,n),n.size>0&&e.then.forEach(e=>function(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){const n=e.target;if(n&&n.ruleConditionTag){const i=t.get(n.ruleConditionTag);i&&i.forEach(t=>{t.notification=e.notification.message})}else for(const n of t.values())n.forEach(t=>{t.notification=e.notification.message})}}(e,n));for(const e of n.values())e.forEach(e=>{e.notification&&t.push(e)})}}),t}const de=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function fe(e){return!!e&&((e=e.trim()).length>0&&(de.test(e)||pe(e)||he(e)))}function pe(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function he(e){return"-*"===(e=null!=e?e.trim():void 0)}function ge(e){return!!e&&"object"==typeof e}function be(e,t,n=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function)return e===t;if(e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length)return!1;if(e instanceof Date)return!1;if(!(e instanceof Object))return!1;if(!(t instanceof Object))return!1;if(n){const n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>be(e[n],t[n]))}return!1}function ve(e,t){if(0===e.length)return;const n=e.indexOf(t);n>=0&&e.splice(n,1)}function ye(e,t){return e&&Object.values(e).includes(t)}function me(e,t){return Object.keys(e).find(n=>e[n]===t)}function _e(e,t){if(e&&e.attributes&&e.attributes.hasOwnProperty(t)){return Object.assign(Object.assign({},e.attributes[t]),{name:t,assetId:e.id})}}function Ee(e,t){return e.attributes?Object.entries(e.attributes).filter(([e,n])=>!t||t.indexOf(e)>=0).map(([t,n])=>n=Object.assign(Object.assign({},n),{name:t,assetId:e.id})):[]}function Se(e,t){if(e&&e.meta)return e.meta.find(e=>e.name===t)}function ke(e,t){return!!Se(e,t)}function Oe(e,t,n,i){const r="string"==typeof e?e:e.urn;if(t&&t.meta){const e=t.meta.find(e=>e.name===r);if(e)return e.value}if(n&&n.metaItemDescriptors){const e=n.metaItemDescriptors.find(e=>e.urn===r);if(e)return e.initialValue}if(i&&i.metaItemDescriptors){const e=i.metaItemDescriptors.find(e=>e.urn===r);if(e)return e.initialValue}}function we(e,t,n,i,r){if(!e&&!t)return r||"";const o=Oe(l.MetaItemType.LABEL,e,t,n);let s=i?Oe(l.MetaItemType.UNIT_TYPE,e,t,n):void 0;s=s?re.t(["units."+s,s]):void 0;const a=e?e.name:t.attributeName,c=[];return a&&(c.push("attribute."+a),c.push(a)),o&&c.push(o),r&&c.push(r),re.t(c)+(s?" ("+s+")":"")}function xe(e){return re.t(["metaItemType."+e,e],{nsSeparator:"@"})}function Re(e,t,n){let i=Oe(l.MetaItemType.FORMAT,e,t,n);if(!i){let r;e&&(r=e.type),n?r=n.valueType:t&&("string"==typeof(n=t.valueDescriptor)&&(n=bt.getAttributeValueDescriptor(n)),n&&(r=n.valueType)),r&&(i=re.t("attributeValueType."+r))}return i}function Ce(){return(e,t)=>null==e?"":re.t(t?[t,"%s"]:"%s",{postProcess:"sprintf",sprintf:[e]})}function Ne(e,t,n,i){if(!e)return i||"";if(void 0===e.value||null===e.value)return"";const r=Re(e,t,n);return Ce()(e.value,r)}function Pe(e,t){const n=t.attributeState.attributeRef.attributeName;if(e.attributes)if(t.attributeState.deleted)delete e.attributes[n];else{const i=_e(e,n);i&&(i.value=t.attributeState.value,i.valueTimestamp=t.timestamp)}return Object.assign({},e)}function Ie(e){return new Promise((t,n)=>{const i=document.createElement("script");i.type="text/javascript",i.src=e,i.addEventListener("load",e=>t(e),!1),i.addEventListener("error",e=>n(e),!1),document.body.appendChild(i)})}function Te(e){return(t,n)=>{const i=e(t),r=e(n);return i>r?1:i<r?-1:0}}var Ae,De=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};!function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING"}(Ae||(Ae={}));class je{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=Me.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=Ae.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap={},this._assetSubscriptionMap=new Map}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){ve(this._statusCallbacks,e)}connect(){return this._status===Ae.CONNECTED?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(Ae.CONNECTING),this._connectingDeferred=new ae,this._doConnect().then(e=>{if(this._connectingDeferred){const t=this._connectingDeferred;this._connectingDeferred=null,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=Me.MIN_RECONNECT_DELAY,this._onStatusChanged(Ae.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._onStatusChanged(Ae.DISCONNECTED)),t.resolve(e)}})),this._connectingDeferred.promise)}disconnect(){this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==Ae.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){const n={eventSubscription:e,callback:t,deferred:new ae};return null!=this._pendingSubscription||this._status!==Ae.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap[e]=t,this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();const n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){if(this._subscriptionMap[e])delete this._subscriptionMap[e],this._doUnsubscribe(e);else{const t=[];this._assetSubscriptionMap.forEach((n,i)=>{const r=n.callbacks;r.delete(e),0===r.size&&t.push(i)}),t.forEach(e=>{this._assetSubscriptionMap.delete(e),this.unsubscribe(e)})}}sendEvent(e){this._status===Ae.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==Ae.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return De(this,void 0,void 0,(function*(){const i={eventType:"asset"},r=e&&"string"!=typeof e[0]?e.map(e=>e.entityId):e;r&&r.length>0&&(i.filter={filterType:"asset",assetIds:e});let o=null;try{if(o=yield this.subscribe(i,n),r&&t){const e={messageId:"read-assets:"+r.join(",")+":"+o,event:{eventType:"read-assets",assetQuery:{ids:r}}},t=yield this.sendEventWithReply(e);t.assets&&t.assets.forEach(e=>{n({eventType:"asset",asset:e,cause:"READ"})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),o&&this.unsubscribe(o),t}return o}))}subscribeAttributeEvents(e,t,n){return De(this,void 0,void 0,(function*(){if(!e||0===e.length)throw new Error("At least one ID must be provided");const i="string"!=typeof e[0],r=i?[...new Set(e.map(e=>e.entityId))]:[...new Set(e)],o=i?e:void 0,s="AttributeEvent"+je._subscriptionCounter++,a=r.map(e=>{const t=o?o.filter(t=>t.entityId===e):void 0;let i=this._assetSubscriptionMap.get(e),r=Promise.resolve(e);if(i)i.promise&&(r=i.promise);else{i={callbacks:new Map},this._assetSubscriptionMap.set(e,i);const t={subscriptionId:e,eventType:"attribute",filter:{filterType:"asset",assetIds:[e]}};r=this.subscribe(t,t=>{const n=this._assetSubscriptionMap.get(e);if(n){if(n.asset)if(t.attributeState.deleted)delete n.asset.attributes[t.attributeState.attributeRef.attributeName];else{const e=n.asset.attributes[t.attributeState.attributeRef.attributeName];e.value=t.attributeState.value,e.valueTimestamp=t.timestamp}n.callbacks.forEach((e,n)=>{e(t)})}}).then(t=>{const n={event:{eventType:"read-assets",assetQuery:{ids:[e],select:{excludeParentInfo:!0,excludePath:!0}}}};return this.sendEventWithReply(n)}).then(e=>{const t=e;t.assets&&1===t.assets.length&&(i.asset=t.assets[0]),i.promise=void 0}),i.promise=r}return i.callbacks.set(s,e=>{t?t.find(t=>e.attributeState.attributeRef.attributeName===t.attributeName)&&n(e):n(e)}),r});return yield Promise.all(a),t&&r.forEach(e=>{const t=this._assetSubscriptionMap.get(e);t&&t.asset&&Object.entries(t.asset.attributes).forEach(([i,r])=>{const s=r;o&&!o.find(e=>e.entityId===t.asset.id&&e.attributeName===i)||n({eventType:"attribute",timestamp:s.valueTimestamp,attributeState:{value:s.value,attributeRef:{entityId:e,attributeName:i}}})})}),s}))}_processNextSubscription(){this._status===Ae.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{const e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{const n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{const n=e.deferred;e.deferred=null,n&&n.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){const n=this._subscriptionMap[e];n&&n.callback(t)}_onConnect(){if(console.debug("Event provider connected: "+this.constructor.name),Object.keys(this._subscriptionMap).length>0){for(const e in this._subscriptionMap)this._subscriptionMap.hasOwnProperty(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap[e]);this._subscriptionMap={}}this._processNextSubscription()}_onDisconnect(){console.debug("Event provider disconnected"),this._onStatusChanged(Ae.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||this._disconnectRequested||(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect().then(e=>{e||this._scheduleReconnect()}).catch(e=>{this._scheduleReconnect()})},this._reconnectDelayMillis),this._reconnectDelayMillis<Me.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(Me.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}je.MIN_RECONNECT_DELAY=0,je.MAX_RECONNECT_DELAY=3e4,je._subscriptionCounter=0;class Me extends je{constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this.disconnect()})}get endpointUrl(){return this._endpointUrl}_doConnect(){let e=this._endpointUrl+"?Auth-Realm="+_t.config.realm;return _t.authenticated&&(e+="&Authorization="+_t.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new ae,this._webSocket.onopen=()=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=()=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{const t=e.data;if(t&&t.startsWith("SUBSCRIBED:")){const e=t.substring("SUBSCRIBED:".length),n=JSON.parse(e),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(n.subscriptionId)}else if(t.startsWith("UNAUTHORIZED:")){const e=t.substring("UNAUTHORIZED:".length),n=JSON.parse(e),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&(console.warn("Unauthorized event subscription: "+n),i.reject("Unauthorized"))}else if(t.startsWith("TRIGGERED:")){const e=t.substring("TRIGGERED:".length),n=JSON.parse(e);n.events&&n.events.forEach(e=>{this._onMessageReceived(n.subscriptionId,e)})}else if(t.startsWith("REQUESTRESPONSE:")){const e=t.substring("REQUESTRESPONSE:".length),n=JSON.parse(e);if(n.messageId&&n.event){const e=this._repliesDeferred.get(n.messageId);this._repliesDeferred.delete(n.messageId),e&&e.resolve(n.event)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){this._webSocket.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new ae,e.subscriptionId||(e.subscriptionId=Me._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){if(!this._webSocket)return;const t={subscriptionId:e};this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify(t))}_doSend(e){const t="EVENT:"+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageId||(e.messageId=((new Date).getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageId))return Promise.reject("There's already a pending send and reply with this ID");const t=new ae;return this._repliesDeferred.set(e.messageId,t),this._webSocket.send("REQUESTRESPONSE:"+JSON.stringify(e)),t.promise}}Me._subscriptionCounter=1;var Le=n(19),Ue=n.n(Le),Fe=n(20),Be=n.n(Fe),Ve=n(12),He=n.n(Ve);var Ke={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}},Ge=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};const We=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=Ae.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){e.getEventProvider()?this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect()):console.log("No event provider available so cannot subscribe")}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return Ge(this,void 0,void 0,(function*(){this.eventsConnected&&this._onEventsConnect()}))}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===Ae.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case Ae.DISCONNECTED:this._onEventsDisconnect();break;case Ae.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return Ge(this,void 0,void 0,(function*(){const t=!!this._attributeRefs,n=this._attributeRefs?this._attributeRefs:this._assetIds;if(this._subscriptionIds=[],n&&n.length>0){if(!t){const t=yield e.getEventProvider().subscribeAssetEvents(n,!0,e=>this._onEvent(e));if(!this._subscriptionIds)return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}const i=yield e.getEventProvider().subscribeAttributeEvents(n,t,e=>this._onEvent(e));this._subscriptionIds?this._subscriptionIds.push(i):e.getEventProvider().unsubscribe(i)}}))}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){be(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions())}get assetIds(){return this._assetIds}set attributeRefs(e){be(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},qe="#1b5630",ze="#FFF",$e="#FFF",Je="#F9F9F9",Xe="#CCC",Ye="#be0000",Qe="#FFF",Ze="#4c4c4c",et="#000",tt="#000",nt="#FFF",it="0 5px 5px -5px rgba(0,0,0,0.3)",rt="0 1px 3px 0 rgba(0,0,0,0.21)",ot="50px",st="0.3";var at=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};const ct="mdi";var lt,ut,dt,ft,pt;!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(lt||(lt={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(ut||(ut={})),function(e){e.ERROR="ERROR",e.READY="READY",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.EVENTS_CONNECTED="EVENTS_CONNECTED",e.EVENTS_CONNECTING="EVENTS_CONNECTING",e.EVENTS_DISCONNECTED="EVENTS_DISCONNECTED",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(dt||(dt={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(ft||(ft={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(pt||(pt={}));class ht extends CustomEvent{constructor(){super(ht.NAME,{bubbles:!0,composed:!0})}}ht.NAME="or-iconset-added";class gt{constructor(){this._icons={}}addIconSet(e,t){this._icons[e]=t,window.dispatchEvent(new ht)}getIconSet(e){return this._icons[e]}getIcon(e){if(!e)return;let t=(e||"").split(":"),n=t.pop(),i=t.pop()||ct;if(!i||""===i||!n||""===n)return;let r=mt.getIconSet(i);if(!r||!r.icons.hasOwnProperty(n))return;const o=r.icons[n],s=document.createElementNS("http://www.w3.org/2000/svg","svg");if(s.setAttribute("viewBox","0 0 "+r.size+" "+r.size),s.style.cssText="pointer-events: none; display: block; width: 100%; height: 100%;",s.setAttribute("preserveAspectRatio","xMidYMid meet"),s.setAttribute("focusable","false"),o.startsWith("<"))s.innerHTML=o;else{const e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",o),e.style.pointerEvents="pointer-events: var(--or-icon-pointer-events, none);",s.appendChild(e)}return s}}class bt{static getAssetDescriptors(){return[...this._assetDescriptors]}static getAttributeDescriptors(){return[...this._attributeDescriptors]}static getAttributeValueDescriptors(){return[...this._attributeValueDescriptors]}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getAssetDescriptor(e){if(e)return this._assetDescriptors.find(t=>t.type===e)}static getAttributeDescriptor(e,t){if(!e)return;let n,i=this._attributeDescriptors.find(t=>t.attributeName===e);return i||!t||(n=t.name?t:this.getAssetDescriptor(t),n&&n.attributeDescriptors&&(i=n.attributeDescriptors.find(t=>t.attributeName===e))),i}static getAttributeValueDescriptor(e,t,n){if(!e)return;const i=this._attributeValueDescriptors.find(t=>t.name===e);if(i||!t)return i;let r;return r=t.attributeName?t:this.getAttributeDescriptor(t,n),r?r.valueDescriptor:void 0}static getAttributeAndValueDescriptors(e,t){let n,i,r,o;return"string"==typeof t?(r=t,n=bt.getAttributeDescriptor(t,e),o=n?n.valueDescriptor:void 0):t&&(t.type?(r=t.name,n=bt.getAttributeDescriptor(r,e),o=t.type):(r=t.attributeName,n=t,o=t.valueDescriptor)),o&&(i="string"==typeof o?bt.getAttributeValueDescriptor(o,e,r):o),[n,i]}static getMetaItemDescriptor(e,t,n){if(!e)return;let i,r=this._metaItemDescriptors.find(t=>t.urn===e);return r||!t||(i=t.attributeName?t:this.getAttributeDescriptor(t,n),i&&i.metaItemDescriptors&&(r=i.metaItemDescriptors.find(t=>t.urn===e))),r}static attributeValueDescriptorsMatch(e,t){return e===t||!(!e||!t)&&(e.name===t.name&&e.valueType===t.valueType)}static getMetaInitialValueFromMetaDescriptors(e,t){if(!t)return;const n="string"==typeof e?e:e.urn,i=t&&t.find(e=>e&&e.urn===n);return i?i.initialValue:void 0}static getMetaItemDescriptorInitialValue(e,t){if(e.valueFixed)return e;const n=JSON.parse(JSON.stringify(e));return n.initialValue=t,n}static getAssetDescriptorColor(e,t){return e&&e.color?e.color:t}static getAssetDescriptorIcon(e,t){return e&&e.icon?e.icon:t}static hasMetaItem(e,t){return!(!e||!e.metaItemDescriptors)&&!!e.metaItemDescriptors.find(e=>e.urn===t)}}bt._assetDescriptors=[],bt._attributeDescriptors=[],bt._attributeValueDescriptors=[],bt._metaItemDescriptors=[];class vt{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._listeners=[],this._displayRealm=""}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){const e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,n])=>{const i=n.roles;e.set(t,i)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles.map(e=>e.name)),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){return this._config.managerUrl}get keycloakUrl(){return this._config.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return c.a}get language(){return re.language}set language(e){re.changeLanguage(e),this.console.storeData("LANGUAGE",e)}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&(this._displayRealm=e,this._emitEvent(dt.DISPLAY_REALM_CHANGED))}getEventProvider(){return this.events}get mapType(){return this._config.mapType||pt.VECTOR}static normaliseConfig(e){const t=Object.assign({},e);return t.managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),t.realm&&""!==t.realm||(t.realm="master"),t.auth===ut.KEYCLOAK&&(t.keycloakUrl&&""!==t.keycloakUrl?t.keycloakUrl=t.keycloakUrl.replace(/\/+$/,""):t.keycloakUrl=t.managerUrl+"/auth"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),t.eventProviderType||(t.eventProviderType=ft.WEBSOCKET),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId="openremote"),t}isManagerSameOrigin(){if(!this.ready)return!1;const e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){this._listeners.indexOf(e)<0&&this._listeners.push(e)}removeListener(e){const t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return at(this,void 0,void 0,(function*(){this._config&&console.log("Already initialised"),this._config=vt.normaliseConfig(e);let t=yield this.doAuthInit();return t&&(t=yield this.doInit()),t&&(t=this.doRestApiInit()),t=(yield this.doConsoleInit())&&t,t=(yield this.doTranslateInit())&&t,t&&(t=yield this.doDescriptorsInit(),yield this.getConsoleAppConfig()),t&&(this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(dt.READY)),this._displayRealm=e.realm,t}))}doInit(){return at(this,void 0,void 0,(function*(){try{const e=yield new Promise((e,t)=>{const n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(new Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.send()});if(this._managerVersion=e&&e.version?e.version:"",this._config.loadIcons){const e=yield fetch(yt.config.managerUrl+"/shared/mdi-icons.json"),t=yield e.json();mt.addIconSet("mdi",t),mt.addIconSet("or",Ke)}return!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(lt.MANAGER_FAILED_TO_LOAD),!1}}))}doTranslateInit(){return at(this,void 0,void 0,(function*(){re.on("initialized",e=>{this._emitEvent(dt.TRANSLATE_INIT)}),re.on("languageChanged",e=>{He.a.locale(e),this._emitEvent(dt.TRANSLATE_LANGUAGE_CHANGED)});const e={lng:this.console?yield this.console.retrieveData("LANGUAGE"):void 0,fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:function(e,t,n){return"uppercase"===t?e.toUpperCase():e instanceof Date?He()(e).format(t):e}},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield re.use(Be.a).use(Ue.a).init(e)}catch(e){return console.error(e),this._setError(lt.TRANSLATION_ERROR),!1}return!0}))}doDescriptorsInit(){return at(this,void 0,void 0,(function*(){if(!this.config.loadDescriptors)return!0;try{const e=yield c.a.api.AssetModelResource.getAssetDescriptors(),t=yield c.a.api.AssetModelResource.getAttributeDescriptors(),n=yield c.a.api.AssetModelResource.getAttributeValueDescriptors(),i=yield c.a.api.AssetModelResource.getMetaItemDescriptors();bt._assetDescriptors=e.data,bt._attributeDescriptors=t.data,bt._attributeValueDescriptors=n.data,bt._metaItemDescriptors=i.data}catch(e){return console.error(e),!1}return!0}))}doAuthInit(){return at(this,void 0,void 0,(function*(){let e=!0;switch(this._config.auth){case ut.BASIC:e=yield this.initialiseBasicAuth();break;case ut.KEYCLOAK:if(e=yield this.loadAndInitialiseKeycloak(),!e)return console.log("Falling back to basic auth"),this._config.auth=ut.BASIC,this.doAuthInit();break;case ut.NONE:return!0;default:return this._setError(lt.AUTH_TYPE_UNSUPPORTED),!1}return c.a.addRequestInterceptor(e=>{if(!e.headers.Authorization){const t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e}))}doRestApiInit(){return c.a.setTimeout(1e4),c.a.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return at(this,void 0,void 0,(function*(){let e=!1;switch(this._config.eventProviderType){case ft.WEBSOCKET:this._events=new Me(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect();break;case ft.POLLING:}return e||this._setError(lt.EVENTS_CONNECTION_ERROR),e}))}_onEventProviderStatusChanged(e){switch(e){case Ae.DISCONNECTED:this._emitEvent(dt.EVENTS_DISCONNECTED);break;case Ae.CONNECTED:this._emitEvent(dt.EVENTS_CONNECTED);break;case Ae.CONNECTING:this._emitEvent(dt.EVENTS_CONNECTING)}}doConsoleInit(){return at(this,void 0,void 0,(function*(){try{let e=new s(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(dt.CONSOLE_READY)});return this._console=e,yield e.initialise(),this._emitEvent(dt.CONSOLE_INIT),!0}catch(e){return this._setError(lt.CONSOLE_ERROR),!1}}))}getConsoleAppConfig(){return at(this,void 0,void 0,(function*(){const e=yield this.rest.api.ConsoleAppResource.getAppConfig();200===e.status&&(this._consoleAppConfig=e.data)}))}logout(e){if(this._keycloak){this.console.isMobile&&this.console.storeData("REFRESH_TOKEN",null);const t=e&&""!==e?{redirectUri:e}:null;this._keycloak.logout(t)}else this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload())}login(e){switch(this._config.auth){case ut.BASIC:e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case ut.KEYCLOAK:if(this._keycloak){const t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}break;case ut.NONE:}}initialiseBasicAuth(){return at(this,void 0,void 0,(function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.log("No basicLoginProvider defined on config so cannot display login UI"),!1)}))}doBasicLogin(){return at(this,void 0,void 0,(function*(){if(!this.config.basicLoginProvider)return;let e={username:this._config.credentials?this._config.credentials.username:"",password:this._config.credentials?this._config.credentials.password:"",cancel:!1,closeCallback:void 0},t=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!t;){if(e=yield this.config.basicLoginProvider(e.username,e.password),e.cancel){console.log("Basic authentication cancelled by user"),e.closeCallback&&e.closeCallback(!1);break}if(!e.username||!e.password)continue;this._basicIdentity.token=btoa(e.username+":"+e.password);const n=yield c.a.api.UserResource.getCurrent(),i=n.status;if(200===i){console.log("Basic authentication successful"),t=!0,this._basicIdentity.user=n.data;const e=yield c.a.api.UserResource.getCurrentUserRoles();this._basicIdentity.roles=e.data}else{if(401!==i&&403!==i){console.log("Unkown response so aborting"),this._basicIdentity=void 0;break}console.log("Basic authentication invalid credentials, trying again"),this._basicIdentity=void 0}}this._setAuthenticated(t),e.closeCallback&&e.closeCallback(t)}))}isSuperUser(){return this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin")}getApiBaseUrl(){let e=this._config.managerUrl;return e+="/api/"+this._config.realm+"/",e}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this._keycloak&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){const n=this.roles;return n&&n.has(t)&&n.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this._keycloak?"Bearer "+this._keycloak.token:this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this._keycloak)return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this.console&&this.console.isMobile&&this.config.auth===ut.KEYCLOAK&&(this._keycloak&&"Offline"===this._keycloak.refreshTokenParsed.typ?(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)):this.login())}loadAndInitialiseKeycloak(){return at(this,void 0,void 0,(function*(){try{let e=null;if(yield Ie(this._config.keycloakUrl+"/js/keycloak.js"),!window.Keycloak)return console.log("Keycloak global variable not found probably failed to load keycloak or manager doesn't support it"),!1;this._keycloak=window.Keycloak({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl}),this._keycloak.onAuthSuccess=()=>{e&&e(!0)},this._keycloak.onAuthError=()=>{this._setAuthenticated(!1)};try{const t=yield this._getNativeOfflineRefreshToken(),n=yield new Promise((n,i)=>{e=n,this._keycloak.init({checkLoginIframe:!1,onLoad:this._config.autoLogin?"login-required":"check-sso",refreshToken:t}).success(e=>{n(e)}).error(()=>{i()})});return e=null,n&&(this._name=this._keycloak.tokenParsed.name,this._username=this._keycloak.tokenParsed.preferred_username,this._keycloakUpdateTokenInterval&&(clearInterval(this._keycloakUpdateTokenInterval),delete this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=window.setInterval(()=>{this.updateKeycloakAccessToken()},1e4),this._onAuthenticated()),this._setAuthenticated(n),!0}catch(t){return console.error(t),e=null,this._setAuthenticated(!1),!1}}catch(e){return this._setError(lt.AUTH_FAILED),console.error("Failed to load Keycloak"),!1}}))}updateKeycloakAccessToken(){return new Promise(()=>{this._keycloak.updateToken(30).success(e=>(console.debug("Access token update success, refreshed from server: "+e),e)).error(()=>{console.info("Access token update failed, refresh token expired, login required"),this._keycloak.clearToken(),this._keycloak.login()})})}_getNativeOfflineRefreshToken(){return at(this,void 0,void 0,(function*(){if(this.console&&this.console.isMobile)return yield this.console.retrieveData("REFRESH_TOKEN")}))}_emitEvent(e){window.setTimeout(()=>{let t=this._listeners.slice();for(const n of t)n(e)},0)}_setError(e){this._error=e,this._emitEvent(dt.ERROR)}_setAuthenticated(e){this._authenticated=e,e?this._events||this.doEventsSubscriptionInit():(this._events&&this._events.disconnect(),this._events=void 0)}}const yt=new vt,mt=new gt;var _t=t.default=yt}])}));
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ORModel"),require("moment"),require("ORRest"),require("ORIcon")):"function"==typeof define&&define.amd?define(["ORModel","moment","ORRest","ORIcon"],t):"object"==typeof exports?exports.ORCore=t(require("ORModel"),require("moment"),require("ORRest"),require("ORIcon")):e.ORCore=t(e.ORModel,e.moment,e.ORRest,e.ORIcon)}(self,((e,t,r,n)=>(()=>{var o,i,s={839:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=a(e),s=i[0],c=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),u=0,f=c>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(c(e,a,a+s>l?l:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,s=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},256:(e,t,r)=>{"use strict";var n=r(795),o=r(772),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},772:(e,t,r)=>{"use strict";var n=r(200),o=r(795),i=r(328),s=r(352),a=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),l=o("%Reflect.apply%",!0)||n.call(c,a),u=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){if("function"!=typeof e)throw new s("a function is required");var t=l(n,c,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var p=function(){return l(n,a,arguments)};u?u(e.exports,"apply",{value:p}):e.exports.apply=p},388:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=l(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[l(e)]},p.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},p.prototype.set=function(e,t){this.map[l(e)]=u(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var r,n,o=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),b.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function S(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},v.call(m.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];S.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function O(e,r){return new Promise((function(n,i){var s=new m(e,r);if(s.signal&&s.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;n(new S(o,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}O.polyfill=!0,e.fetch||(e.fetch=O,e.Headers=p,e.Request=m,e.Response=S),t.Headers=p,t.Request=m,t.Response=S,t.fetch=O,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},780:(e,t,r)=>{"use strict";var n=r(579)(),o=r(795),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(e){i=!1}var s=r(568),a=r(352),c=r(36);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!c&&c(e,t);if(i)i(e,t,{configurable:null===l&&f?f.configurable:!l,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!u&&(n||o||l))throw new s("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},648:e=>{"use strict";e.exports=EvalError},212:e=>{"use strict";e.exports=Error},500:e=>{"use strict";e.exports=RangeError},276:e=>{"use strict";e.exports=ReferenceError},568:e=>{"use strict";e.exports=SyntaxError},352:e=>{"use strict";e.exports=TypeError},160:e=>{"use strict";e.exports=URIError},432:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,s=function(e,t){for(var r=[],n=1,o=0;n<e.length;n+=1,o+=1)r[o]=e[n];return r}(arguments),a=r(0,o.length-s.length),c=[],l=0;l<a;l++)c[l]="$"+l;if(i=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=",");return r}(c)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var t=o.apply(this,n(s,arguments));return Object(t)===t?t:this}return o.apply(e,n(s,arguments))})),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},200:(e,t,r)=>{"use strict";var n=r(432);e.exports=Function.prototype.bind||n},795:(e,t,r)=>{"use strict";var n,o=r(212),i=r(648),s=r(500),a=r(276),c=r(568),l=r(352),u=r(160),f=Function,p=function(e){try{return f('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var h=function(){throw new l},g=d?function(){try{return h}catch(e){try{return d(arguments,"callee").get}catch(e){return h}}}():h,y=r(832)(),v=r(528)(),b=Object.getPrototypeOf||(v?function(e){return e.__proto__}:null),m={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,S={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":y&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":m,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&y&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&y&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&b?b(""[Symbol.iterator]()):n,"%Symbol%":y?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":g,"%TypedArray%":w,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(e){var _=b(b(e));S["%Error.prototype%"]=_}var O=function e(t){var r;if("%AsyncFunction%"===t)r=p("async function () {}");else if("%GeneratorFunction%"===t)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=p("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&b&&(r=b(o.prototype))}return S[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=r(200),A=r(504),R=E.call(Function.call,Array.prototype.concat),P=E.call(Function.apply,Array.prototype.splice),C=E.call(Function.call,String.prototype.replace),x=E.call(Function.call,String.prototype.slice),N=E.call(Function.call,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,j=function(e,t){var r,n=e;if(A(k,n)&&(n="%"+(r=k[n])[0]+"%"),A(S,n)){var o=S[n];if(o===m&&(o=O(n)),void 0===o&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===N(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=x(e,0,1),r=x(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return C(e,I,(function(e,t,r,o){n[n.length]=r?C(o,T,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=j("%"+n+"%",t),i=o.name,s=o.value,a=!1,u=o.alias;u&&(n=u[0],P(r,R([0,1],u)));for(var f=1,p=!0;f<r.length;f+=1){var h=r[f],g=x(h,0,1),y=x(h,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),A(S,i="%"+(n+="."+h)+"%"))s=S[i];else if(null!=s){if(!(h in s)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(d&&f+1>=r.length){var v=d(s,h);s=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:s[h]}else p=A(s,h),s=s[h];p&&!a&&(S[i]=s)}}return s}},36:(e,t,r)=>{"use strict";var n=r(795)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},579:(e,t,r)=>{"use strict";var n=r(795)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},528:e=>{"use strict";var t={foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof r)}},832:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(632);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},632:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},504:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(200);e.exports=i.call(n,o)},964:(e,t,r)=>{var n;!function(){"use strict";var t="input is invalid type",o="object"==typeof window,i=o?window:{};i.JS_SHA256_NO_WINDOW&&(o=!1);var s=!o&&"object"==typeof self,a=!i.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?i=r.g:s&&(i=self);var c=!i.JS_SHA256_NO_COMMON_JS&&e.exports,l=r.amdO,u=!i.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],d=[24,16,8,0],h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],y=[];!i.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(e,t){return function(r){return new _(t,!0).update(r)[e]()}},b=function(e){var t=v("hex",e);a&&(t=m(t,e)),t.create=function(){return new _(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=v(n,e)}return t},m=function(e,n){var o,s=r(164),a=r(248).Buffer,c=n?"sha224":"sha256";return o=a.from&&!i.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return s.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw new Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?s.createHash(c).update(o(r)).digest("hex"):e(r)}},w=function(e,t){return function(r,n){return new O(r,t,!0).update(n)[e]()}},S=function(e){var t=w("hex",e);t.create=function(t){return new O(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=w(n,e)}return t};function _(e,t){t?(y[0]=y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function O(e,r,n){var o,i=typeof e;if("string"===i){var s,a=[],c=e.length,l=0;for(o=0;o<c;++o)(s=e.charCodeAt(o))<128?a[l++]=s:s<2048?(a[l++]=192|s>>6,a[l++]=128|63&s):s<55296||s>=57344?(a[l++]=224|s>>12,a[l++]=128|s>>6&63,a[l++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),a[l++]=240|s>>18,a[l++]=128|s>>12&63,a[l++]=128|s>>6&63,a[l++]=128|63&s);e=a}else{if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new _(r,!0).update(e).array());var f=[],p=[];for(o=0;o<64;++o){var d=e[o]||0;f[o]=92^d,p[o]=54^d}_.call(this,r,n),this.update(p),this.oKeyPad=f,this.inner=!0,this.sharedMemory=n}_.prototype.update=function(e){if(!this.finalized){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var o,i,s=0,a=e.length,c=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),r)for(i=this.start;s<a&&i<64;++s)c[i>>2]|=e[s]<<d[3&i++];else for(i=this.start;s<a&&i<64;++s)(o=e.charCodeAt(s))<128?c[i>>2]|=o<<d[3&i++]:o<2048?(c[i>>2]|=(192|o>>6)<<d[3&i++],c[i>>2]|=(128|63&o)<<d[3&i++]):o<55296||o>=57344?(c[i>>2]|=(224|o>>12)<<d[3&i++],c[i>>2]|=(128|o>>6&63)<<d[3&i++],c[i>>2]|=(128|63&o)<<d[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),c[i>>2]|=(240|o>>18)<<d[3&i++],c[i>>2]|=(128|o>>12&63)<<d[3&i++],c[i>>2]|=(128|o>>6&63)<<d[3&i++],c[i>>2]|=(128|63&o)<<d[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=c[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=p[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,l=this.h0,u=this.h1,f=this.h2,p=this.h3,d=this.h4,g=this.h5,y=this.h6,v=this.h7,b=this.blocks;for(e=16;e<64;++e)t=((o=b[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=b[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,b[e]=b[e-16]+t+b[e-7]+r<<0;for(c=u&f,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=b[0]-1413257819)-150054599<<0,p=o+24177077<<0):(i=704751109,v=(o=b[0]-210244248)-1521486534<<0,p=o+143694565<<0),this.first=!1):(t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(i=l&u)^l&f^c,v=p+(o=v+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&g^~d&y)+h[e]+b[e])<<0,p=o+(t+n)<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),n=(s=p&l)^p&u^i,y=f+(o=y+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&d^~v&g)+h[e+1]+b[e+1])<<0,t=((f=o+(t+n)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(a=f&p)^f&l^s,g=u+(o=g+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&d)+h[e+2]+b[e+2])<<0,t=((u=o+(t+n)<<0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(c=u&f)^u&p^a,d=l+(o=d+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&v)+h[e+3]+b[e+3])<<0,l=o+(t+n)<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+l<<0,this.h1=this.h1+u<<0,this.h2=this.h2+f<<0,this.h3=this.h3+p<<0,this.h4=this.h4+d<<0,this.h5=this.h5+g<<0,this.h6=this.h6+y<<0,this.h7=this.h7+v<<0},_.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=f[e>>28&15]+f[e>>24&15]+f[e>>20&15]+f[e>>16&15]+f[e>>12&15]+f[e>>8&15]+f[e>>4&15]+f[15&e]+f[t>>28&15]+f[t>>24&15]+f[t>>20&15]+f[t>>16&15]+f[t>>12&15]+f[t>>8&15]+f[t>>4&15]+f[15&t]+f[r>>28&15]+f[r>>24&15]+f[r>>20&15]+f[r>>16&15]+f[r>>12&15]+f[r>>8&15]+f[r>>4&15]+f[15&r]+f[n>>28&15]+f[n>>24&15]+f[n>>20&15]+f[n>>16&15]+f[n>>12&15]+f[n>>8&15]+f[n>>4&15]+f[15&n]+f[o>>28&15]+f[o>>24&15]+f[o>>20&15]+f[o>>16&15]+f[o>>12&15]+f[o>>8&15]+f[o>>4&15]+f[15&o]+f[i>>28&15]+f[i>>24&15]+f[i>>20&15]+f[i>>16&15]+f[i>>12&15]+f[i>>8&15]+f[i>>4&15]+f[15&i]+f[s>>28&15]+f[s>>24&15]+f[s>>20&15]+f[s>>16&15]+f[s>>12&15]+f[s>>8&15]+f[s>>4&15]+f[15&s];return this.is224||(c+=f[a>>28&15]+f[a>>24&15]+f[a>>20&15]+f[a>>16&15]+f[a>>12&15]+f[a>>8&15]+f[a>>4&15]+f[15&a]),c},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},O.prototype=new _,O.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();_.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),_.prototype.finalize.call(this)}};var k=b();k.sha256=k,k.sha224=b(!0),k.sha256.hmac=S(),k.sha224.hmac=S(!0),c?e.exports=k:(i.sha256=k.sha256,i.sha224=k.sha224,l&&(void 0===(n=function(){return k}.call(k,r,k,e))||(e.exports=n)))}()},636:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,m=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,_=RegExp.prototype.test,O=Array.prototype.concat,k=Array.prototype.join,E=Array.prototype.slice,A=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,x="function"==typeof Symbol&&"object"==typeof Symbol.iterator,N="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,I=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function j(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||_.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-A(-e):A(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return m.call(o,r,"$&_")+"."+m.call(m.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(t,r,"$&_")}var D=r(132),L=D.custom,U=H(L)?L:null;function M(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function F(e){return m.call(String(e),/"/g,"&quot;")}function B(e){return!("[object Array]"!==K(e)||N&&"object"==typeof e&&N in e)}function V(e){return!("[object RegExp]"!==K(e)||N&&"object"==typeof e&&N in e)}function H(e){if(x)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,a){var c=n||{};if(W(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!W(c,"customInspect")||c.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=c.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return z(t,c);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var _=String(t);return w?j(t,_):_}if("bigint"==typeof t){var A=String(t)+"n";return w?j(t,A):A}var P=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var L,q=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=k.call(Array(e.indent+1)," ")}return{base:r,prev:k.call(Array(t+1),r)}}(c,o);if(void 0===a)a=[];else if(G(a,t)>=0)return"[Circular]";function J(t,r,n){if(r&&(a=E.call(a)).push(r),n){var i={depth:c.depth};return W(c,"quoteStyle")&&(i.quoteStyle=c.quoteStyle),e(t,i,o+1,a)}return e(t,c,o+1,a)}if("function"==typeof t&&!V(t)){var ee=function(e){if(e.name)return e.name;var t=v.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),te=Z(t,J);return"[Function"+(ee?": "+ee:" (anonymous)")+"]"+(te.length>0?" { "+k.call(te,", ")+" }":"")}if(H(t)){var re=x?m.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||x?re:$(re)}if((L=t)&&"object"==typeof L&&("undefined"!=typeof HTMLElement&&L instanceof HTMLElement||"string"==typeof L.nodeName&&"function"==typeof L.getAttribute)){for(var ne="<"+S.call(String(t.nodeName)),oe=t.attributes||[],ie=0;ie<oe.length;ie++)ne+=" "+oe[ie].name+"="+M(F(oe[ie].value),"double",c);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+S.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var se=Z(t,J);return q&&!function(e){for(var t=0;t<e.length;t++)if(G(e[t],"\n")>=0)return!1;return!0}(se)?"["+Q(se,q)+"]":"[ "+k.call(se,", ")+" ]"}if(function(e){return!("[object Error]"!==K(e)||N&&"object"==typeof e&&N in e)}(t)){var ae=Z(t,J);return"cause"in Error.prototype||!("cause"in t)||I.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+k.call(ae,", ")+" }":"{ ["+String(t)+"] "+k.call(O.call("[cause]: "+J(t.cause),ae),", ")+" }"}if("object"==typeof t&&g){if(U&&"function"==typeof t[U]&&D)return D(t,{depth:P-o});if("symbol"!==g&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ce=[];return s&&s.call(t,(function(e,r){ce.push(J(r,t,!0)+" => "+J(e,t))})),Y("Map",i.call(t),ce,q)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var le=[];return u&&u.call(t,(function(e){le.push(J(e,t))})),Y("Set",l.call(t),le,q)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==K(e)||N&&"object"==typeof e&&N in e)}(t))return $(J(Number(t)));if(function(e){if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}(t))return $(J(R.call(t)));if(function(e){return!("[object Boolean]"!==K(e)||N&&"object"==typeof e&&N in e)}(t))return $(h.call(t));if(function(e){return!("[object String]"!==K(e)||N&&"object"==typeof e&&N in e)}(t))return $(J(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===r.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==K(e)||N&&"object"==typeof e&&N in e)}(t)&&!V(t)){var ue=Z(t,J),fe=T?T(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",de=!fe&&N&&Object(t)===t&&N in t?b.call(K(t),8,-1):pe?"Object":"",he=(fe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||pe?"["+k.call(O.call([],de||[],pe||[]),": ")+"] ":"");return 0===ue.length?he+"{}":q?he+"{"+Q(ue,q)+"}":he+"{ "+k.call(ue,", ")+" }"}return String(t)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return q.call(e,t)}function K(e){return g.call(e)}function G(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function z(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return z(b.call(e,0,t.maxStringLength),t)+n}return M(m.call(m.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function $(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):k.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+k.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=B(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=W(e,o)?t(e[o],e):""}var i,s="function"==typeof P?P(e):[];if(x){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)W(e,c)&&(r&&String(Number(c))===c&&c<e.length||x&&i["$"+c]instanceof Symbol||(_.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var l=0;l<s.length;l++)I.call(e,s[l])&&n.push("["+t(s[l])+"]: "+t(e[s[l]],e));return n}},900:function(e,t,r){var n;e=r.nmd(e),function(){"use strict";var o={function:!0,object:!0},i=o[typeof window]&&window||this,s=o[typeof t]&&t,a=o.object&&e&&!e.nodeType&&e,c=s&&a&&"object"==typeof r.g&&r.g;!c||c.global!==c&&c.window!==c&&c.self!==c||(i=c);var l=Math.pow(2,53)-1,u=/\bOpera/,f=Object.prototype,p=f.hasOwnProperty,d=f.toString;function h(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function g(e){return e=w(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:h(e)}function y(e,t){for(var r in e)p.call(e,r)&&t(e[r],r,e)}function v(e){return null==e?h(e):d.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function m(e,t){var r=null;return function(e,t){var r=-1,n=e?e.length:0;if("number"==typeof n&&n>-1&&n<=l)for(;++r<n;)t(e[r],r);else y(e,t)}(e,(function(n,o){r=t(r,n,o,e)})),r}function w(e){return String(e).replace(/^ +| +$/g,"")}var S=function e(t){var r=i,n=t&&"object"==typeof t&&"String"!=v(t);n&&(r=t,t=null);var o=r.navigator||{},s=o.userAgent||"";t||(t=s);var a,c,l,f,p,h=n?!!o.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(d.toString()),S="Object",_=n?S:"ScriptBridgingProxyObject",O=n?S:"Environment",k=n&&r.java?"JavaPackage":v(r.java),E=n?S:"RuntimeObject",A=/\bJava/.test(k)&&r.java,R=A&&v(r.environment)==O,P=A?"a":"α",C=A?"b":"β",x=r.document||{},N=r.operamini||r.opera,I=u.test(I=n&&N?N["[[Class]]"]:v(N))?I:N=null,T=t,j=[],D=null,L=t==s,U=L&&N&&"function"==typeof N.version&&N.version(),M=m([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(e,r){return e||RegExp("\\b"+(r.pattern||b(r))+"\\b","i").exec(t)&&(r.label||r)})),F=m(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],(function(e,r){return e||RegExp("\\b"+(r.pattern||b(r))+"\\b","i").exec(t)&&(r.label||r)})),B=q([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),V=m({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},(function(e,r,n){return e||(r[B]||r[/^[a-z]+(?: +[a-z]+\b)*/i.exec(B)]||RegExp("\\b"+b(n)+"(?:\\b|\\w*\\d)","i").exec(t))&&n})),H=m(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],(function(e,r){var n=r.pattern||b(r);return!e&&(e=RegExp("\\b"+n+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,r){var n={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&r&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(n=n[/[\d.]+$/.exec(e)])&&(e="Windows "+n),e=String(e),t&&r&&(e=e.replace(RegExp(t,"i"),r)),g(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,n,r.label||r)),e}));function q(e){return m(e,(function(e,r){var n=r.pattern||b(r);return!e&&(e=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(r.label&&!RegExp(n,"i").test(r.label)?r.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),r=r.label||r,e=g(e[0].replace(RegExp(n,"i"),r).replace(RegExp("; *(?:"+r+"[_-])?","i")," ").replace(RegExp("("+r+")[-_.]?(\\w)","i"),"$1 $2"))),e}))}function W(e){return m(e,(function(e,r){return e||(RegExp(r+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(M&&(M=[M]),/\bAndroid\b/.test(H)&&!B&&(a=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(B=w(a[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),V&&!B?B=q([V]):V&&B&&(B=B.replace(RegExp("^("+b(V)+")[-_.\\s]","i"),V+" ").replace(RegExp("^("+b(V)+")[-_.]?(\\w)","i"),V+" $2")),(a=/\bGoogle TV\b/.exec(B))&&(B=a[0]),/\bSimulator\b/i.test(t)&&(B=(B?B+" ":"")+"Simulator"),"Opera Mini"==F&&/\bOPiOS\b/.test(t)&&j.push("running in Turbo/Uncompressed mode"),"IE"==F&&/\blike iPhone OS\b/.test(t)?(V=(a=e(t.replace(/like iPhone OS/,""))).manufacturer,B=a.product):/^iP/.test(B)?(F||(F="Safari"),H="iOS"+((a=/ OS ([\d_]+)/i.exec(t))?" "+a[1].replace(/_/g,"."):"")):"Konqueror"==F&&/^Linux\b/i.test(H)?H="Kubuntu":V&&"Google"!=V&&(/Chrome/.test(F)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(B))||/\bAndroid\b/.test(H)&&/^Chrome/.test(F)&&/\bVersion\//i.test(t)?(F="Android Browser",H=/\bAndroid\b/.test(H)?H:"Android"):"Silk"==F?(/\bMobi/i.test(t)||(H="Android",j.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&j.unshift("accelerated")):"UC Browser"==F&&/\bUCWEB\b/.test(t)?j.push("speed mode"):"PaleMoon"==F&&(a=/\bFirefox\/([\d.]+)\b/.exec(t))?j.push("identifying as Firefox "+a[1]):"Firefox"==F&&(a=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(H||(H="Firefox OS"),B||(B=a[1])):!F||(a=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(F))?(F&&!B&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(a+"/")+8))&&(F=null),(a=B||V||H)&&(B||V||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(H))&&(F=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(H)?H:a)+" Browser")):"Electron"==F&&(a=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&j.push("Chromium "+a),U||(U=W(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",b(F),"(?:Firefox|Minefield|NetFront)"])),(a=("iCab"==M&&parseFloat(U)>3?"WebKit":/\bOpera\b/.test(F)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(M)&&"WebKit"||!M&&/\bMSIE\b/i.test(t)&&("Mac OS"==H?"Tasman":"Trident")||"WebKit"==M&&/\bPlayStation\b(?! Vita\b)/i.test(F)&&"NetFront")&&(M=[a]),"IE"==F&&(a=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(F+=" Mobile",H="Windows Phone "+(/\+$/.test(a)?a:a+".x"),j.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(F="IE Mobile",H="Windows Phone 8.x",j.unshift("desktop mode"),U||(U=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=F&&"Trident"==M&&(a=/\brv:([\d.]+)/.exec(t))&&(F&&j.push("identifying as "+F+(U?" "+U:"")),F="IE",U=a[1]),L){if(f="global",p=null!=(l=r)?typeof l[f]:"number",/^(?:boolean|number|string|undefined)$/.test(p)||"object"==p&&!l[f])v(a=r.runtime)==_?(F="Adobe AIR",H=a.flash.system.Capabilities.os):v(a=r.phantom)==E?(F="PhantomJS",U=(a=a.version||null)&&a.major+"."+a.minor+"."+a.patch):"number"==typeof x.documentMode&&(a=/\bTrident\/(\d+)/i.exec(t))?(U=[U,x.documentMode],(a=+a[1]+4)!=U[1]&&(j.push("IE "+U[1]+" mode"),M&&(M[1]=""),U[1]=a),U="IE"==F?String(U[1].toFixed(1)):U[0]):"number"==typeof x.documentMode&&/^(?:Chrome|Firefox)\b/.test(F)&&(j.push("masking as "+F+" "+U),F="IE",U="11.0",M=["Trident"],H="Windows");else if(A&&(T=(a=A.lang.System).getProperty("os.arch"),H=H||a.getProperty("os.name")+" "+a.getProperty("os.version")),R){try{U=r.require("ringo/engine").version.join("."),F="RingoJS"}catch(e){(a=r.system)&&a.global.system==r.system&&(F="Narwhal",H||(H=a[0].os||null))}F||(F="Rhino")}else"object"==typeof r.process&&!r.process.browser&&(a=r.process)&&("object"==typeof a.versions&&("string"==typeof a.versions.electron?(j.push("Node "+a.versions.node),F="Electron",U=a.versions.electron):"string"==typeof a.versions.nw&&(j.push("Chromium "+U,"Node "+a.versions.node),F="NW.js",U=a.versions.nw)),F||(F="Node.js",T=a.arch,H=a.platform,U=(U=/[\d.]+/.exec(a.version))?U[0]:null));H=H&&g(H)}if(U&&(a=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(U)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(L&&o.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(D=/b/i.test(a)?"beta":"alpha",U=U.replace(RegExp(a+"\\+?$"),"")+("beta"==D?C:P)+(/\d+\+?/.exec(a)||"")),"Fennec"==F||"Firefox"==F&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(H))F="Firefox Mobile";else if("Maxthon"==F&&U)U=U.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(B))"Xbox 360"==B&&(H=null),"Xbox 360"==B&&/\bIEMobile\b/.test(t)&&j.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(F)&&(!F||B||/Browser|Mobi/.test(F))||"Windows CE"!=H&&!/Mobi/i.test(t))if("IE"==F&&L)try{null===r.external&&j.unshift("platform preview")}catch(e){j.unshift("embedded")}else(/\bBlackBerry\b/.test(B)||/\bBB10\b/.test(t))&&(a=(RegExp(B.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||U)?(H=((a=[a,/BB10/.test(t)])[1]?(B=null,V="BlackBerry"):"Device Software")+" "+a[0],U=null):this!=y&&"Wii"!=B&&(L&&N||/Opera/.test(F)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==F&&/\bOS X (?:\d+\.){2,}/.test(H)||"IE"==F&&(H&&!/^Win/.test(H)&&U>5.5||/\bWindows XP\b/.test(H)&&U>8||8==U&&!/\bTrident\b/.test(t)))&&!u.test(a=e.call(y,t.replace(u,"")+";"))&&a.name&&(a="ing as "+a.name+((a=a.version)?" "+a:""),u.test(F)?(/\bIE\b/.test(a)&&"Mac OS"==H&&(H=null),a="identify"+a):(a="mask"+a,F=I?g(I.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(a)&&(H=null),L||(U=null)),M=["Presto"],j.push(a));else F+=" Mobile";(a=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(a=[parseFloat(a.replace(/\.(\d)$/,".0$1")),a],"Safari"==F&&"+"==a[1].slice(-1)?(F="WebKit Nightly",D="alpha",U=a[1].slice(0,-1)):U!=a[1]&&U!=(a[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(U=null),a[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==a[0]&&537.36==a[2]&&parseFloat(a[1])>=28&&"WebKit"==M&&(M=["Blink"]),L&&(h||a[1])?(M&&(M[1]="like Chrome"),a=a[1]||((a=a[0])<530?1:a<532?2:a<532.05?3:a<533?4:a<534.03?5:a<534.07?6:a<534.1?7:a<534.13?8:a<534.16?9:a<534.24?10:a<534.3?11:a<535.01?12:a<535.02?"13+":a<535.07?15:a<535.11?16:a<535.19?17:a<536.05?18:a<536.1?19:a<537.01?20:a<537.11?"21+":a<537.13?23:a<537.18?24:a<537.24?25:a<537.36?26:"Blink"!=M?"27":"28")):(M&&(M[1]="like Safari"),a=(a=a[0])<400?1:a<500?2:a<526?3:a<533?4:a<534?"4+":a<535?5:a<537?6:a<538?7:a<601?8:a<602?9:a<604?10:a<606?11:a<608?12:"12"),M&&(M[1]+=" "+(a+="number"==typeof a?".x":/[.+]/.test(a)?"":"+")),"Safari"==F&&(!U||parseInt(U)>45)?U=a:"Chrome"==F&&/\bHeadlessChrome/i.test(t)&&j.unshift("headless")),"Opera"==F&&(a=/\bzbov|zvav$/.exec(H))?(F+=" ",j.unshift("desktop mode"),"zvav"==a?(F+="Mini",U=null):F+="Mobile",H=H.replace(RegExp(" *"+a+"$"),"")):"Safari"==F&&/\bChrome\b/.exec(M&&M[1])?(j.unshift("desktop mode"),F="Chrome Mobile",U=null,/\bOS X\b/.test(H)?(V="Apple",H="iOS 4.3+"):H=null):/\bSRWare Iron\b/.test(F)&&!U&&(U=W("Chrome")),U&&0==U.indexOf(a=/[\d.]+$/.exec(H))&&t.indexOf("/"+a+"-")>-1&&(H=w(H.replace(a,""))),H&&-1!=H.indexOf(F)&&!RegExp(F+" OS").test(H)&&(H=H.replace(RegExp(" *"+b(F)+" *"),"")),M&&!/\b(?:Avant|Nook)\b/.test(F)&&(/Browser|Lunascape|Maxthon/.test(F)||"Safari"!=F&&/^iOS/.test(H)&&/\bSafari\b/.test(M[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(F)&&M[1])&&(a=M[M.length-1])&&j.push(a),j.length&&(j=["("+j.join("; ")+")"]),V&&B&&B.indexOf(V)<0&&j.push("on "+V),B&&j.push((/^on /.test(j[j.length-1])?"":"on ")+B),H&&(a=/ ([\d.+]+)$/.exec(H),c=a&&"/"==H.charAt(H.length-a[0].length-1),H={architecture:32,family:a&&!c?H.replace(a[0],""):H,version:a?a[1]:null,toString:function(){var e=this.version;return this.family+(e&&!c?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(a=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(T))&&!/\bi686\b/i.test(T)?(H&&(H.architecture=64,H.family=H.family.replace(RegExp(" *"+a),"")),F&&(/\bWOW64\b/i.test(t)||L&&/\w(?:86|32)$/.test(o.cpuClass||o.platform)&&!/\bWin64; x64\b/i.test(t))&&j.unshift("32-bit")):H&&/^OS X/.test(H.family)&&"Chrome"==F&&parseFloat(U)>=39&&(H.architecture=64),t||(t=null);var K={};return K.description=t,K.layout=M&&M[0],K.manufacturer=V,K.name=F,K.prerelease=D,K.product=B,K.ua=t,K.version=F&&U,K.os=H||{architecture:null,family:null,version:null,toString:function(){return"null"}},K.parse=e,K.toString=function(){return this.description||""},K.version&&j.unshift(U),K.name&&j.unshift(F),H&&F&&(H!=String(H).split(" ")[0]||H!=F.split(" ")[0]&&!B)&&j.push(B?"("+H+")":"on "+H),j.length&&(K.description=j.join(" ")),K}();i.platform=S,void 0===(n=function(){return S}.call(t,r,t,e))||(e.exports=n)}.call(this)},516:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},344:(e,t,r)=>{"use strict";var n=r(976),o=r(688),i=r(516);e.exports={formats:i,parse:o,stringify:n}},688:(e,t,r)=>{"use strict";var n=r(72),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),l=a?i.slice(0,a.index):i,u=[];if(l){if(!r.plainObjects&&o.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var f=0;r.depth>0&&null!==(a=s.exec(i))&&f<r.depth;){if(f+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var o=n?t:c(t,r),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);r.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=o:"__proto__"!==l&&(s[l]=o):s={0:o}}o=s}return o}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,l={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,f),d=-1,h=t.charset;if(t.charsetSentinel)for(r=0;r<p.length;++r)0===p[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[r]?h="utf-8":"utf8=%26%2310003%3B"===p[r]&&(h="iso-8859-1"),d=r,r=p.length);for(r=0;r<p.length;++r)if(r!==d){var g,y,v=p[r],b=v.indexOf("]="),m=-1===b?v.indexOf("="):b+1;-1===m?(g=t.decoder(v,s.decoder,h,"key"),y=t.strictNullHandling?null:""):(g=t.decoder(v.slice(0,m),s.decoder,h,"key"),y=n.maybeMap(c(v.slice(m+1),t),(function(e){return t.decoder(e,s.decoder,h,"value")}))),y&&t.interpretNumericEntities&&"iso-8859-1"===h&&(y=a(y)),v.indexOf("[]=")>-1&&(y=i(y)?[y]:y),o.call(l,g)?l[g]=n.combine(l[g],y):l[g]=y}return l}(e,r):e,f=r.plainObjects?Object.create(null):{},p=Object.keys(u),d=0;d<p.length;++d){var h=p[d],g=l(h,u[h],r,"string"==typeof e);f=n.merge(f,g,r)}return!0===r.allowSparse?f:n.compact(f)}},976:(e,t,r)=>{"use strict";var n=r(252),o=r(72),i=r(516),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},f=Date.prototype.toISOString,p=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},h={},g=function e(t,r,i,s,a,l,f,p,g,y,v,b,m,w,S,_){for(var O,k=t,E=_,A=0,R=!1;void 0!==(E=E.get(h))&&!R;){var P=E.get(t);if(A+=1,void 0!==P){if(P===A)throw new RangeError("Cyclic object value");R=!0}void 0===E.get(h)&&(A=0)}if("function"==typeof p?k=p(r,k):k instanceof Date?k=v(k):"comma"===i&&c(k)&&(k=o.maybeMap(k,(function(e){return e instanceof Date?v(e):e}))),null===k){if(a)return f&&!w?f(r,d.encoder,S,"key",b):r;k=""}if("string"==typeof(O=k)||"number"==typeof O||"boolean"==typeof O||"symbol"==typeof O||"bigint"==typeof O||o.isBuffer(k))return f?[m(w?r:f(r,d.encoder,S,"key",b))+"="+m(f(k,d.encoder,S,"value",b))]:[m(r)+"="+m(String(k))];var C,x=[];if(void 0===k)return x;if("comma"===i&&c(k))w&&f&&(k=o.maybeMap(k,f)),C=[{value:k.length>0?k.join(",")||null:void 0}];else if(c(p))C=p;else{var N=Object.keys(k);C=g?N.sort(g):N}for(var I=s&&c(k)&&1===k.length?r+"[]":r,T=0;T<C.length;++T){var j=C[T],D="object"==typeof j&&void 0!==j.value?j.value:k[j];if(!l||null!==D){var L=c(k)?"function"==typeof i?i(I,j):I:I+(y?"."+j:"["+j+"]");_.set(t,A);var U=n();U.set(h,_),u(x,e(D,L,i,s,a,l,"comma"===i&&w&&c(k)?null:f,p,g,y,v,b,m,w,S,U))}}return x};e.exports=function(e,t){var r,o=e,l=function(e){if(!e)return d;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],o=d.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===e.allowDots?d.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(r=l.filter);var f,p=[];if("object"!=typeof o||null===o)return"";f=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[f];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===h&&t&&t.commaRoundTrip;r||(r=Object.keys(o)),l.sort&&r.sort(l.sort);for(var v=n(),b=0;b<r.length;++b){var m=r[b];l.skipNulls&&null===o[m]||u(p,g(o[m],m,h,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,v))}var w=p.join(l.delimiter),S=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),w.length>0?S+w:""}},72:(e,t,r)=>{"use strict";var n=r(516),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:l}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<a.length;++l){var u=a.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===n.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t}),s)}}},328:(e,t,r)=>{"use strict";var n=r(795),o=r(780),i=r(579)(),s=r(36),a=r(352),c=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||c(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&s){var u=s(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(l=!1)}return(n||l||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},252:(e,t,r)=>{"use strict";var n=r(795),o=r(256),i=r(636),s=r(352),a=n("%WeakMap%",!0),c=n("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+i(e))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(c){if(t)return p(t,n)}else if(r)return function(e,t){var r=g(e,t);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return f(e,n)}else if(c){if(t)return h(t,n)}else if(r)return function(e,t){return!!g(e,t)}(r,n);return!1},set:function(n,o){a&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new a),u(e,n,o)):c?(t||(t=new c),d(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=g(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},960:function(e,t,r){!function(e){"use strict";var t,r=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),n=r&&"a=1"===new r({a:1}).toString(),o=r&&"+"===new r("s=%2B").get("s"),i=r&&"size"in r.prototype,s="__URLSearchParams__",a=!r||((t=new r).append("s"," &"),"s=+%26"===t.toString()),c=d.prototype,l=!(!e.Symbol||!e.Symbol.iterator);if(!(r&&n&&o&&a&&i)){c.append=function(e,t){b(this[s],e,t)},c.delete=function(e){delete this[s][e]},c.get=function(e){var t=this[s];return this.has(e)?t[e][0]:null},c.getAll=function(e){var t=this[s];return this.has(e)?t[e].slice(0):[]},c.has=function(e){return w(this[s],e)},c.set=function(e,t){this[s][e]=[""+t]},c.toString=function(){var e,t,r,n,o=this[s],i=[];for(t in o)for(r=h(t),e=0,n=o[t];e<n.length;e++)i.push(r+"="+h(n[e]));return i.join("&")};var u,f=e.Proxy&&r&&(!o||!a||!n||!i);f?(u=new Proxy(r,{construct:function(e,t){return new e(new d(t[0]).toString())}})).toString=Function.prototype.toString.bind(d):u=d,Object.defineProperty(e,"URLSearchParams",{value:u});var p=e.URLSearchParams.prototype;p.polyfill=!0,!f&&e.Symbol&&(p[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in p||(p.forEach=function(e,t){var r=v(this.toString());Object.getOwnPropertyNames(r).forEach((function(n){r[n].forEach((function(r){e.call(t,r,n,this)}),this)}),this)}),"sort"in p||(p.sort=function(){var e,t,r,n=v(this.toString()),o=[];for(e in n)o.push(e);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var i=o[t],s=n[i];for(r=0;r<s.length;r++)this.append(i,s[r])}}),"keys"in p||(p.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),y(e)}),"values"in p||(p.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),y(e)}),"entries"in p||(p.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),y(e)}),l&&(p[e.Symbol.iterator]=p[e.Symbol.iterator]||p.entries),"size"in p||Object.defineProperty(p,"size",{get:function(){var e=v(this.toString());if(p===this)throw new TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce((function(t,r){return t+e[r].length}),0)}})}function d(e){((e=e||"")instanceof URLSearchParams||e instanceof d)&&(e=e.toString()),this[s]=v(e)}function h(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function g(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(e){return decodeURIComponent(e)}))}function y(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return l&&(r[e.Symbol.iterator]=function(){return r}),r}function v(e){var t={};if("object"==typeof e)if(m(e))for(var r=0;r<e.length;r++){var n=e[r];if(!m(n)||2!==n.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");b(t,n[0],n[1])}else for(var o in e)e.hasOwnProperty(o)&&b(t,o,e[o]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var i=e.split("&"),s=0;s<i.length;s++){var a=i[s],c=a.indexOf("=");-1<c?b(t,g(a.slice(0,c)),g(a.slice(c+1))):a&&b(t,g(a),"")}}return t}function b(e,t,r){var n="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);w(e,t)?e[t].push(n):e[t]=[n]}function m(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==r.g?r.g:"undefined"!=typeof window?window:this)},488:e=>{"use strict";e.exports=n},472:t=>{"use strict";t.exports=e},768:e=>{"use strict";e.exports=r},272:e=>{"use strict";e.exports=t},248:()=>{},164:()=>{},132:()=>{},624:(e,t,r)=>{var n;if("function"==typeof fetch&&(n=void 0!==r.g&&r.g.fetch?r.g.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),"undefined"==typeof window||void 0===window.document){var o=n||r(388);o.default&&(o=o.default),t.default=o,e.exports=t.default}}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={id:e,loaded:!1,exports:{}};return s[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.amdO={},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},i=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);c.r(r);var n={};o=o||[null,i({}),i([]),i(i)];for(var s=2&t&&e;"object"==typeof s&&!~o.indexOf(s);s=i(s))Object.getOwnPropertyNames(s).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,c.d(r,n),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var l={};return(()=>{"use strict";c.r(l),c.d(l,{Console:()=>At,DEFAULT_ICONSET:()=>Or,DEFAULT_LANGUAGES:()=>Ar,DefaultBoxShadow:()=>mr,DefaultBoxShadowBottom:()=>br,DefaultColor1:()=>lr,DefaultColor10:()=>yr,DefaultColor11:()=>vr,DefaultColor2:()=>ur,DefaultColor3:()=>hr,DefaultColor4:()=>ar,DefaultColor5:()=>fr,DefaultColor6:()=>pr,DefaultColor7:()=>cr,DefaultColor8:()=>dr,DefaultColor9:()=>gr,DefaultDisabledOpacity:()=>Sr,DefaultHeaderHeight:()=>wr,EventProviderStatus:()=>Rt,Manager:()=>Pr,ORError:()=>kr,OREvent:()=>Er,Util:()=>e,WebSocketEventProvider:()=>Tt,default:()=>xr,manager:()=>Cr,normaliseConfig:()=>Rr,subscribe:()=>sr});var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:String(r)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function i(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}function f(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function d(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}c.r(e),c.d(e,{Deferred:()=>ye,arrayRemove:()=>Pe,blobToBase64:()=>_t,camelCaseToSentenceCase:()=>xe,capitaliseFirstLetter:()=>Ie,cronStringToISOString:()=>Fe,dateToCronString:()=>Me,disableScroll:()=>wt,dispatchCancellableEvent:()=>dt,enableScroll:()=>St,enumContains:()=>Te,formatCronString:()=>Ue,getAllowedValueLabel:()=>We,getAssetTypeLabel:()=>He,getAttributeLabel:()=>Ge,getAttributeUnits:()=>rt,getAttributeValueAsString:()=>$e,getAttributeValueConstraints:()=>et,getAttributeValueFormat:()=>ot,getEnumKeyAsString:()=>je,getGeoNotificationsFromRulesSet:()=>me,getMetaItemNameValueHolder:()=>Ke,getMetaLabel:()=>ze,getMetaUnits:()=>nt,getMetaValue:()=>Be,getMetaValueAsString:()=>Xe,getMetaValueConstraints:()=>tt,getMetaValueFormat:()=>it,getQueryParameter:()=>be,getQueryParameters:()=>ve,getValueAsString:()=>Qe,getValueDescriptorLabel:()=>qe,getWeekNumber:()=>De,hasMetaItem:()=>Ve,isFunction:()=>Ae,isObject:()=>Ee,isTimeDuration:()=>_e,isTimeDurationNegativeInfinity:()=>ke,isTimeDurationPositiveInfinity:()=>Oe,loadJs:()=>ut,mergeObjects:()=>st,objectsEqual:()=>Re,realmRoleFilter:()=>Ot,resolveUnits:()=>Ze,sentenceCaseToCamelCase:()=>Ce,sortByNumber:()=>ft,sortByString:()=>pt,stringMatch:()=>Ne,updateAsset:()=>lt}),c(960);var v={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},b=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.init(t,n)}return i(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||v,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,y(y({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),m=function(){function e(){r(this,e),this.observers={}}return i(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,r)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(r))}))}}]),e}();function w(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function S(e){return null==e?"":""+e}function _(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=n(i.shift());!e[s]&&r&&(e[s]=new r),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return o()?{}:{obj:e,k:n(i.shift())}}function O(e,t,r){var n=_(e,t,Object);n.obj[n.k]=r}function k(e,t){var r=_(e,t),n=r.obj,o=r.k;if(n)return n[o]}function E(e,t,r){var n=k(e,r);return void 0!==n?n:k(t,r)}function A(e,t,r){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):A(e[n],t[n],r):e[n]=t[n]);return e}function R(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var P={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function C(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return P[e]})):e}var x="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,N=[" ",",","?","!",";"];function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),o=e,i=0;i<n.length;++i){if(!o)return;if("string"==typeof o[n[i]]&&i+1<n.length)return;if(void 0===o[n[i]]){for(var s=2,a=n.slice(i,i+s).join(r),c=o[a];void 0===c&&n.length>i+s;)s++,c=o[a=n.slice(i,i+s).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(a)){if("string"==typeof c)return c;if(a&&"string"==typeof c[a])return c[a]}var l=n.slice(i+s).join(r);return l?j(c,l,r):void 0}o=o[n[i]]}return o}}var D=function(e){u(a,e);var t,n,o=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p(t);if(n){var o=p(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return f(this,e)});function a(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return r(this,a),t=o.call(this),x&&m.call(s(t)),t.data=e||{},t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return i(a,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];r&&"string"!=typeof r&&(s=s.concat(r)),r&&"string"==typeof r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."));var a=k(this.data,s);return a||!i||"string"!=typeof r?a:j(this.data&&this.data[e]&&this.data[e][t],r,o)}},{key:"addResource",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var s=[e,t];r&&(s=s.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(n=t,t=(s=e.split("."))[1]),this.addNamespaces(t),O(this.data,s,n),o.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in r)"string"!=typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(e,t,o,r[o],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=k(this.data,s)||{};n?A(a,r,o):a=T(T({},a),r),O(this.data,s,a),i.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?T(T({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),a}(m),L={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,r,n,o))})),t}};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={},B=function(e){u(c,e);var n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(n);if(o){var r=p(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return f(this,e)});function c(e){var t,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(this,c),t=a.call(this),x&&m.call(s(t)),n=e,o=s(t),["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(e){n[e]&&(o[e]=n[e])})),t.options=i,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=b.create("translator"),t}return i(c,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=r&&e.indexOf(r)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=N.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===n.length)return!0;var o=new RegExp("(".concat(n.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(r);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}(e,r,n));if(i&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:o};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),e=c.join(n)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,r,n){var o=this;if("object"!==t(r)&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],r),l=a.key,u=a.namespaces,f=u[u.length-1],p=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(d){var h=r.nsSeparator||this.options.nsSeparator;return i?(g.res="".concat(f).concat(h).concat(l),g):"".concat(f).concat(h).concat(l)}return i?(g.res=l,g):l}var g=this.resolve(e,r),y=g&&g.res,v=g&&g.usedKey||l,b=g&&g.exactUsedKey||l,m=Object.prototype.toString.apply(y),w=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject;if(S&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(m)<0&&("string"!=typeof w||"[object Array]"!==m)){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,M(M({},r),{},{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(g.res=_,g):_}if(s){var O="[object Array]"===m,k=O?[]:{},E=O?b:v;for(var A in y)if(Object.prototype.hasOwnProperty.call(y,A)){var R="".concat(E).concat(s).concat(A);k[A]=this.translate(R,M(M({},r),{joinArrays:!1,ns:u})),k[A]===R&&(k[A]=y[A])}y=k}}else if(S&&"string"==typeof w&&"[object Array]"===m)(y=y.join(w))&&(y=this.extendTranslation(y,e,r,n));else{var P=!1,C=!1,x=void 0!==r.count&&"string"!=typeof r.count,N=c.hasDefaultValue(r),I=x?this.pluralResolver.getSuffix(p,r.count,r):"",T=r["defaultValue".concat(I)]||r.defaultValue;!this.isValidLookup(y)&&N&&(P=!0,y=T),this.isValidLookup(y)||(C=!0,y=l);var j=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:y,D=N&&T!==y&&this.options.updateMissing;if(C||P||D){if(this.logger.log(D?"updateKey":"missingKey",p,f,l,D?T:y),s){var L=this.resolve(l,M(M({},r),{},{keySeparator:!1}));L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var U=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var B=0;B<F.length;B++)U.push(F[B]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(r.lng||this.language):U.push(r.lng||this.language);var V=function(e,t,n){var i=N&&n!==y?n:j;o.options.missingKeyHandler?o.options.missingKeyHandler(e,f,t,i,D,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,f,t,i,D,r),o.emit("missingKey",e,f,t,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?U.forEach((function(e){o.pluralResolver.getSuffixes(e,r).forEach((function(t){V([e],l+t,r["defaultValue".concat(t)]||T)}))})):V(U,l,T))}y=this.extendTranslation(y,e,r,g,n),C&&y===l&&this.options.appendNamespaceToMissingKey&&(y="".concat(f,":").concat(l)),(C||P)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(l):l,P?y:void 0):this.options.parseMissingKeyHandler(y))}return i?(g.res=y,g):y}},{key:"extendTranslation",value:function(e,t,r,n,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,M(M({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(M(M({},r),{interpolation:M(M({},this.options.interpolation),r.interpolation)}));var s,a="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var c=e.match(this.interpolator.nestingRegexp);s=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=M(M({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return o&&o[0]===n[0]&&!r.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):i.translate.apply(i,n.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var f=r.postProcess||this.options.postProcess,p="string"==typeof f?[f]:f;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=L.handle(p,e,t,this.options&&this.options.postProcessPassResolved?M({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,o,i,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var c=s.extractFromKey(e,a),l=c.key;r=l;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var f=void 0!==a.count&&"string"!=typeof a.count,p=f&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,h=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(i=e,!F["".concat(h[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(i)&&(F["".concat(h[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(r,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(r){if(!s.isValidLookup(t)){o=r;var i,c=[l];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,l,r,e,a);else{var u;f&&(u=s.pluralResolver.getSuffix(r,a.count,a));var h="".concat(s.options.pluralSeparator,"zero");if(f&&(c.push(l+u),p&&c.push(l+h)),d){var g="".concat(l).concat(s.options.contextSeparator).concat(a.context);c.push(g),f&&(c.push(g+u),p&&c.push(g+h))}}for(;i=c.pop();)s.isValidLookup(t)||(n=i,t=s.getResource(r,e,i,a))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),c}(m);function V(e){return e.charAt(0).toUpperCase()+e.slice(1)}var H=function(){function e(t){r(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=b.create("languageUtils")}return i(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=V(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=V(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=V(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var n=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(r.isSupportedCode(e)?o.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),n.forEach((function(e){o.indexOf(e)<0&&i(r.formatLanguageCode(e))})),o}}]),e}(),q=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],W={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},K=["v1","v2","v3"],G={zero:0,one:1,two:2,few:3,many:4,other:5},z=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.languageUtils=t,this.options=o,this.logger=b.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},q.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:W[e.fc]}}))})),n)}return i(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((function(e,t){return G[e]-G[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):n.numbers.map((function(n){return t.getSuffix(e,n,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return r.options.prepend&&o.toString()?r.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!K.includes(this.options.compatibilityJSON)}}]),e}();function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.logger=b.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return i(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:C,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?R(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?R(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?R(t.nestingPrefix):t.nestingPrefixEscaped||R("$t("),this.nestingSuffix=t.nestingSuffix?R(t.nestingSuffix):t.nestingSuffixEscaped||R(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var o,i,s,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var o=E(t,c,e);return a.alwaysFormat?a.format(o,void 0,r,$($($({},n),t),{},{interpolationkey:e})):o}var i=e.split(a.formatSeparator),s=i.shift().trim(),l=i.join(a.formatSeparator).trim();return a.format(E(t,c,s),l,r,$($($({},n),t),{},{interpolationkey:s}))};this.resetRegExp();var f=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?l(a.escape(e)):l(e)}}].forEach((function(t){for(s=0;o=t.regex.exec(e);){var r=o[1].trim();if(void 0===(i=u(r)))if("function"==typeof f){var c=f(e,o,n);i="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))i="";else{if(p){i=o[0];continue}a.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),i=""}else"string"==typeof i||a.useRawValueToEscape||(i=S(i));var l=t.safeValue(i);if(e=e.replace(o[0],l),p?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=$({},i);function a(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),o="{".concat(n[1]);e=n[0];var i=(o=this.interpolate(o,s)).match(/'/g),a=o.match(/"/g);(i&&i.length%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),t&&(s=$($({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(o)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;r=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var u=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=u.shift(),c=u,l=!0}if((n=t(a.call(this,r[1].trim(),s),s))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=S(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce((function(e,t){return o.format(e,t,i.lng,$($({},i),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e){var t={};return function(r,n,o){var i=n+JSON.stringify(o),s=t[i];return s||(s=e(n,o),t[i]=s),s(r)}}var ee=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.logger=b.create("formatter"),this.options=t,this.formats={number:Z((function(e,t){var r=new Intl.NumberFormat(e,t);return function(e){return r.format(e)}})),currency:Z((function(e,t){var r=new Intl.NumberFormat(e,Q(Q({},t),{},{style:"currency"}));return function(e){return r.format(e)}})),datetime:Z((function(e,t){var r=new Intl.DateTimeFormat(e,Q({},t));return function(e){return r.format(e)}})),relativetime:Z((function(e,t){var r=new Intl.RelativeTimeFormat(e,Q({},t));return function(e){return r.format(e,t.range||"day")}})),list:Z((function(e,t){var r=new Intl.ListFormat(e,Q({},t));return function(e){return r.format(e)}}))},this.init(t)}return i(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Z(t)}},{key:"format",value:function(e,t,r,n){var o=this;return t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var o=n[1].substring(0,n[1].length-1);"currency"===t&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(":")),n=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[n.trim()]||(r[n.trim()]=o),"false"===o&&(r[n.trim()]=!1),"true"===o&&(r[n.trim()]=!0),isNaN(o)||(r[n.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:r}}(t),s=i.formatName,a=i.formatOptions;if(o.formats[s]){var c=e;try{var l=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},u=l.locale||l.lng||n.locale||n.lng||r;c=o.formats[s](e,u,Q(Q(Q({},a),n),l))}catch(e){o.logger.warn(e)}return c}return o.logger.warn("there was no format function for ".concat(s)),e}),e)}}]),e}();function te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?te(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ne=function(e){u(a,e);var t,n,o=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p(t);if(n){var o=p(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return f(this,e)});function a(e,t,n){var i,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return r(this,a),i=o.call(this),x&&m.call(s(i)),i.backend=e,i.store=t,i.services=n,i.languageUtils=n.languageUtils,i.options=c,i.logger=b.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=c.maxParallelReads||10,i.readingCalls=0,i.maxRetries=c.maxRetries>=0?c.maxRetries:5,i.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,c.backend,c),i}return i(a,[{key:"queueLoad",value:function(e,t,r,n){var o=this,i={},s={},a={},c={};return e.forEach((function(e){var n=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!r.reload&&o.store.hasResourceBundle(e,t)?o.state[a]=2:o.state[a]<0||(1===o.state[a]?void 0===s[a]&&(s[a]=!0):(o.state[a]=1,n=!1,void 0===s[a]&&(s[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(a[e]=!0)})),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),o=n[0],i=n[1];t&&this.emit("failedLoading",o,i,t),r&&this.store.addResourceBundle(o,i,r),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(r){var n,a,c,l,u;n=r.loaded,a=i,(l=(c=_(n,[o],Object)).obj)[u=c.k]=l[u]||[],l[u].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){s[e]||(s[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:o,wait:i,callback:s}):(this.readingCalls++,this.backend[r](e,t,(function(a,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}a&&c&&o<n.maxRetries?setTimeout((function(){n.read.call(n,e,t,r,o+1,2*i,s)}),i):s(a,c)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,n,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),o=n[0],i=n[1];this.read(o,i,"read",void 0,void 0,(function(n,s){n&&t.logger.warn("".concat(r,"loading namespace ").concat(i," for language ").concat(o," failed"),n),!n&&s&&t.logger.log("".concat(r,"loaded namespace ").concat(i," for language ").concat(o),s),t.loaded(e,n,s)}))}},{key:"saveMissing",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,re(re({},i),{},{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),a}(m);function oe(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ae(){}var ce=function(e){u(c,e);var n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(n);if(o){var r=p(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return f(this,e)});function c(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(r(this,c),e=a.call(this),x&&m.call(s(e)),e.options=oe(n),e.services={},e.logger=b,e.modules={external:[]},t=s(e),Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),o&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,o),f(e,s(e));setTimeout((function(){e.init(n,o)}),0)}return e}return i(c,[{key:"init",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof r&&(n=r,r={}),!r.defaultNS&&!1!==r.defaultNS&&r.ns&&("string"==typeof r.ns?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));var o={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var r={};if("object"===t(e[1])&&(r=e[1]),"string"==typeof e[1]&&(r.defaultValue=e[1]),"string"==typeof e[2]&&(r.tDescription=e[2]),"object"===t(e[2])||"object"===t(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){r[e]=n[e]}))}return r},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=se(se(se({},o),this.options),oe(r)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=se(se({},o.interpolation),this.options.interpolation)),void 0!==r.keySeparator&&(this.options.userDefinedKeySeparator=r.keySeparator),void 0!==r.nsSeparator&&(this.options.userDefinedNsSeparator=r.nsSeparator),!this.options.isClone){var s;this.modules.logger?b.init(i(this.modules.logger),this.options):b.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=ee);var a=new H(this.options);this.store=new D(this.options.resources,this.options);var c=this.services;c.logger=b,c.resourceStore=this.store,c.languageUtils=a,c.pluralResolver=new z(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(c.formatter=i(s),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new X(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new ne(i(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(c.languageDetector=i(this.modules.languageDetector),c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=i(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new B(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=ae),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var u=w(),f=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),u}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae,n="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return r();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)})),this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,r){var n=w();return e||(e=this.languages),t||(t=this.options.ns),r||(r=ae),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&L.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=w();this.emit("languageChanging",e);var o=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},i=function(i){e||i||!r.services.languageDetector||(i=[]);var s="string"==typeof i?i:r.services.languageUtils.getBestMatchFromCodes(i);s&&(r.language||o(s),r.translator.language||r.translator.changeLanguage(s),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(s)),r.loadResources(s,(function(e){!function(e,i){i?(o(i),r.translator.changeLanguage(i),r.isLanguageChangingTo=void 0,r.emit("languageChanged",i),r.logger.log("languageChanged",i)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,r,n){var o=this,i=function e(r,i){var s;if("object"!==t(i)){for(var a=arguments.length,c=new Array(a>2?a-2:0),l=2;l<a;l++)c[l-2]=arguments[l];s=o.options.overloadTranslationOptionHandler([r,i].concat(c))}else s=se({},i);s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,s.keyPrefix=s.keyPrefix||n||e.keyPrefix;var u=o.options.keySeparator||".",f=s.keyPrefix?"".concat(s.keyPrefix).concat(u).concat(r):r;return o.t(f,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=r,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var s=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};if(r.precheck){var a=r.precheck(this,s);if(void 0!==a)return a}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!s(n,e)||o&&!s(i,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=w();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=w();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],o=e.filter((function(e){return n.indexOf(e)<0}));return o.length?(this.options.preload=n.concat(o),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae,n=se(se(se({},this.options),t),{isClone:!0}),o=new c(n);return void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t)),["store","services","language"].forEach((function(t){o[t]=e[t]})),o.services=se({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new B(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o.emit.apply(o,[e].concat(r))})),o.init(n,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),c}(m);d(ce,"createInstance",(function(){return new ce(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var le=ce.createInstance();le.createInstance=ce.createInstance,le.createInstance,le.init,le.loadResources,le.reloadResources,le.use,le.changeLanguage,le.getFixedT,le.t,le.exists,le.setDefaultNamespace,le.hasLoadedNamespace,le.loadNamespaces,le.loadLanguages;const ue=le;var fe=c(344),pe=c.n(fe),de=c(472),he=c(272),ge=c.n(he);class ye{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t})),Object.freeze(this)}}function ve(e){return pe().parse(e,{ignoreQueryPrefix:!0})}function be(e,t){const r=ve(e);return r?r[t]:void 0}function me(e){const t=[];return e.rules.forEach((e=>{if(e.when&&e.then&&e.then.length>0){const r=new Map;!function(e,t,r){if(!e)return;const n=[];e.groups&&e.groups.forEach((e=>{e.items&&e.items.forEach((e=>{n.push(e)}))})),e.items&&e.items.forEach((e=>{n.push(e)})),n&&n.forEach((e=>{if(e.assets&&e.assets.attributes){const t=[];if(we(e.assets.attributes,t),t.length>0){const n=e.tag||(0).toString();r.set(n,t)}}}))}(e.when,0,r),r.size>0&&e.then.forEach((e=>function(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){const r=e.target;if(r&&r.conditionAssets){const n=t.get(r.conditionAssets);n&&n.forEach((t=>{t.notification=e.notification.message}))}else for(const r of t.values())r.forEach((t=>{t.notification=e.notification.message}))}}(e,r)));for(const e of r.values())e.forEach((e=>{e.notification&&t.push(e)}))}})),t}function we(e,t){e&&(e.items.forEach((e=>{!e.value||"radial"!==e.value.predicateType&&"rect"!==e.value.predicateType||t.push({predicate:e.value})})),e.groups&&e.groups.forEach((e=>we(e,t))))}const Se=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function _e(e){return!!e&&(e=e.trim()).length>0&&(Se.test(e)||Oe(e)||ke(e))}function Oe(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function ke(e){return"-*"===(null!=e?e.trim():void 0)}function Ee(e){return!!e&&"object"==typeof e}function Ae(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Re(e,t,r=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function)return e===t;if(e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length)return!1;if(e instanceof Date)return!1;if(!(e instanceof Object))return!1;if(!(t instanceof Object))return!1;if(r){const r=Object.keys(e);return Object.keys(t).every((e=>-1!==r.indexOf(e)))&&r.every((r=>Re(e[r],t[r])))}return!1}function Pe(e,t){if(0===e.length)return;const r=e.indexOf(t);r>=0&&e.splice(r,1)}function Ce(e){return null==e?"":e.split(" ").map(((e,t)=>0===t?e[0].toLowerCase()+e.substring(1):e[0].toUpperCase()+e.substring(1))).join("")}function xe(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map(((e,r,n)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){const t=!n[r-1]||"_"===n[r-1],o=r+1<n.length&&n[r+1]&&"_"!==n[r+1],i=r+3>n.length||!n[r+1]&&!n[r+3];t&&!o||(e=" "+e),(o||!t&&!i)&&(e=e.toLowerCase())}return e})).join("").trim()}function Ne(e,t){if(t===e)return!0;const r=e.endsWith("*"),n=!r&&e.startsWith("*"),o=!r&&!n&&e.startsWith("^")&&e.endsWith("$");if(r&&t.startsWith(e.substr(0,e.length-1)))return!0;if(n&&t.endsWith(e.substr(1)))return!0;if(o)try{return new RegExp(e).test(t)}catch(e){console.error("Failed to compile needle as a RegExp: "+e)}return!1}function Ie(e){if(e)return 1===e.length?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function Te(e,t){return e&&Object.values(e).includes(t)}function je(e,t){return Object.keys(e).find((r=>e[r]===t))}function De(e){(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))).setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}const Le=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function Ue(e,t,r,n,o,i,s){let a="";if(i?Array.isArray(i)?a+=i.toString().replace(" ",""):a+=i.toString():a+="0",a+=" ",o?Array.isArray(o)?a+=o.toString().replace(" ",""):a+=o.toString():a+="0",a+=" ",n?Array.isArray(n)?a+=n.toString().replace(" ",""):a+=n.toString():a+="0",a+=" ",r?Array.isArray(r)?a+=r.toString().replace(" ",""):a+=r.toString():a+="*",a+=" ",t)if(Array.isArray(t))if("number"==typeof t[0]){const e=[];t.forEach((t=>{e.push(Le[t].toString())})),a+=e.toString().replace(" ","")}else a+=t.toString().replace(" ","");else a+=t.toString();else a+="*";return a+=" ",a+=s?s.toString():"?",a+=" ",e?Array.isArray(e)?a+=e.toString().replace(" ",""):a+=e:a+="*",a}function Me(e){return Ue(e.getFullYear(),Le[e.getMonth()],[e.getDate()],[e.getHours()],[e.getMinutes()])}function Fe(e,t){const r=e.split(" ");if(!(Number.isNaN(Number(r[0]))||Number.isNaN(Number(r[1]))||Number.isNaN(Number(r[2]))||Number.isNaN(Number(r[3]))&&"*"!=r[3])){const e=(Number.isNaN(Number(r[6]))?(new Date).getFullYear():r[6]).toString();let n="";n="*"!=r[4]?Le.indexOf(r[4]).toString():(new Date).getMonth().toString(),n=1==n.length?"0"+n:n;const o=1==r[3].length&&"*"!=r[3]?"0"+r[3]:r[3].replace("*","01"),i=1==r[2].length&&"*"!=r[2]?"0"+r[2]:r[2].replace("*","00"),s=1==r[1].length&&"*"!=r[1]?"0"+r[1]:r[1].replace("*","00"),a=1==r[0].length&&"*"!=r[0]?"0"+r[0]:r[0].replace("*","00");if(e.length>0&&n.length>0)return t?ge().utc({year:Number(e),month:Number(n),date:Number(o),hour:Number(i),minute:Number(s),second:Number(a)}).toISOString():ge()({year:Number(e),month:Number(n),date:Number(o),hour:Number(i),minute:Number(s),second:Number(a)}).toISOString()}}function Be(e,t,r){const n="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(n)?t.meta[n]:r&&r.meta?r.meta[n]:void 0}function Ve(e,t,r){const n="string"==typeof e?e:e.name;return!!(t&&t.meta&&t.meta.hasOwnProperty(n))||!!(r&&r.meta&&r.meta.hasOwnProperty(n))}function He(e){return"string"==typeof e&&(e=de.AssetModelUtil.getAssetDescriptor(e)),e?ue.t("label.asset."+e.name,{defaultValue:xe(e.name)}):""}function qe(e){if(!e)return ue.t("label.value.unknown",{defaultValue:"Unknown"});const t="string"==typeof e?e:e.name;return ue.t("label.value."+t,{defaultValue:xe(t||"")})}function We(e,t){if(e)return ue.t("label.allowedValue."+e,{defaultValue:t||xe(e||""),nsSeparator:!1})}function Ke(e,t){const r="string"==typeof e?de.AssetModelUtil.getMetaItemDescriptor(e):e;return r?{name:r.name,type:r.type,value:t}:{name:typeof e,type:de.AssetModelUtil.resolveValueTypeFromValue(t),value:t}}function Ge(e,t,r,n,o){return Je(e,t,r,n,!0,o)}function ze(e,t,r,n,o){return Je(e||Ke(t,null),t,r,n,!1,o)}function Je(e,t,r,n,o,i){let s=ct("label",e,t,r,o),a="";if(s||(s=Be("label",e,t&&t.meta?t:void 0)),n&&(a=Ze(at("units",e,t,r,o))),!s){const r=e?e.name:t?"string"==typeof t?t:t.name:void 0;s=i||(r?xe(r):void 0)}return s?s+(a?" ("+a+")":""):a}function $e(e,t,r,n,o){return Ye(e,t,r,n,!0,o)}function Xe(e,t,r,n,o){return Ye(e||Ke(t,null),t,r,n,!1,o)}function Ye(e,t,r,n,o,i){let s=Qe(e?e.value:void 0,(()=>at("format",e,t,r,o)),void 0,i);const a=rt(e,t,r);return n&&a&&a.length&&(s=Ze(at("units",e,t,r,o),s)),s}function Qe(e,t,r,n){let o="";if(null==e)o=n||"";else if("string"==typeof e)o=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){const n=t&&t();if(n&&0!==Object.keys(n).length)switch("number"==typeof e?n.asBoolean?e=!!e:n.asDate&&(e=new Date(e)):"boolean"==typeof e&&n.asNumber&&(e=e?1:0),typeof e){case"number":o=new Intl.NumberFormat(r||ue.language,n).format(e);break;case"boolean":n.asOnOff&&(o=e?ue.t("on"):ue.t("off")),n.asOpenClosed&&(o=e?ue.t("open"):ue.t("closed")),n.asPressedReleased&&(o=e?ue.t("pressed"):ue.t("released"));break;case"object":if(n.momentJsFormat)o=ge()(e).format(n.momentJsFormat);else if(n.iso8601)o=e.toISOString();else if(n.week){const t=De(e);o="2-digit"===n.week?String(t).padStart(2,"0"):Number(t).toString(10)}else o=new Intl.DateTimeFormat(r||ue.language,n).format(e)}else o=Object(e).toString()}return o}function Ze(e,t){if(!e)return"";t||(t="");const r=e.map(((e,r)=>{if(3!==e.length||e.toUpperCase()!==e)return ue.t(["units."+e,"or:units."+e]);{const n=new Intl.NumberFormat(ue.language,{currency:e,style:"currency"}).formatToParts();if(0!==r||"currency"!==n[0].type)return"currency"===n[0].type?n[0].value:n[n.length-1].value;if(!t)return n[0].value;t=n[0].value+t}})).join("");return t.length>0?t+" "+r:r}function et(e,t,r){return at("constraints",e,t,r,!0)}function tt(e,t,r){return at("constraints",e||Ke(t,null),t,r,!1)}function rt(e,t,r){return at("units",e,t,r,!0)}function nt(e,t,r){return at("units",e||Ke(t,null),t,r,!1)}function ot(e,t,r){return at("format",e,t,r,!0)}function it(e,t,r){return at("format",e||Ke(t,null),t,r,!1)}function st(e,t,r){if(e&&!t)return Object.assign({},e);if(t&&!e)return Object.assign({},t);const n=Object.assign({},e),o=[];return Object.entries(t).forEach((([e,t])=>{!function(e,t,r,n,o){let i=e;t.forEach((e=>{i.hasOwnProperty(e)||(i[e]={}),i=i[e]})),i&&(i.hasOwnProperty(r)?null==n?delete i[r]:Array.isArray(i[r])?i[r]=o?[...i[r],...n]:[...n]:i[r]="object"==typeof n?st(Object.assign({},i[r]),n,o):n:null==n?delete i[r]:Array.isArray(n)?i[r]=[...n]:i[r]="object"==typeof n?Object.assign({},n):n)}(n,o,e,t,r)})),n}function at(e,t,r,n,o){let i;const s=[],a=ct(e,t&&"string"==typeof t?t:t?t.name:r?"string"==typeof r?r:r.name:void 0,r,n,o);if(a&&(i=JSON.parse(a),i)){if("format"!==e)return i;s.push(i)}if(t&&t.meta&&(i=Be(e,t,r),i)){if("format"!==e)return i;s.push(i)}if(r&&"string"!=typeof r&&r.hasOwnProperty(e)){if(i=r[e],"format"!==e)return i;s.push(i)}if(r&&r.type){if(i=de.AssetModelUtil.getValueDescriptor(r.type)[e],"format"!==e)return i;s.push(i)}if("format"!==e||0===s.length)return i;let c={};return s.reverse().forEach((e=>{c=Object.assign(Object.assign({},c),e)})),c}function ct(e,t,r,n,o,i){let s;if(t?s="string"==typeof t?t:t.name:r&&(s="string"==typeof r?r:r.name),!s)return;const a=[],c=e+"."+(o?"attribute":"meta")+".";return n&&a.push(c+n+"."+s),r&&"string"!=typeof r&&(a.push(c+r.type+"."+s),a.push(c+r.type)),a.push(c+s),a.length>0?ue.t(a,{defaultValue:i||""}):void 0}function lt(e,t){const r=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[r];else{const n=e.attributes[r];n&&(n.value=t.value,n.timestamp=t.timestamp)}return Object.assign({},e)}function ut(e){return new Promise(((t,r)=>{const n=document.createElement("script");n.type="text/javascript",n.src=e,n.addEventListener("load",(e=>t(e)),!1),n.addEventListener("error",(e=>r(e)),!1),document.body.appendChild(n)}))}function ft(e){return(t,r)=>{const n=e(t),o=e(r);return n||o?n&&!o?1:!n&&o?-1:n-o:0}}function pt(e){return(t,r)=>{const n=e(t),o=e(r);return n||o?n&&!o?1:!n&&o?-1:n.localeCompare(o):0}}function dt(e,t){const r=new ye;return e.dispatchEvent(t),window.setTimeout((()=>{r.resolve(t.detail)})),r.promise}const ht={37:1,38:1,39:1,40:1};function gt(e){e.preventDefault()}function yt(e){if(ht[e.keyCode])return gt(e),!1}let vt=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{vt=!0}}))}catch(e){}const bt=!!vt&&{passive:!1},mt="onwheel"in document.createElement("div")?"wheel":"mousewheel";function wt(){window.addEventListener("DOMMouseScroll",gt,!1),window.addEventListener(mt,gt,bt),window.addEventListener("touchmove",gt,bt),window.addEventListener("keydown",yt,!1)}function St(){window.removeEventListener("DOMMouseScroll",gt,!1),window.removeEventListener(mt,gt,bt),window.removeEventListener("touchmove",gt,bt),window.removeEventListener("keydown",yt,!1)}function _t(e){return new Promise(((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{t(n.result)},n.onerror=e=>{r(e)}}))}function Ot(e){return"admin"===e.name||!e.composite&&!["uma_authorization","offline_access","create-realm"].includes(e.name)&&!e.name.startsWith("default-roles")}var kt=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(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())}))};let Et=c(900);class At{constructor(e,t,r){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=r,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),o=n.get("consoleName"),i=n.get("consoleVersion"),s=n.get("consolePlatform"),a=n.get("consoleProviders"),c=n.get("consoleAutoEnable"),l=a&&a.length>0?a.split(" "):["push","storage"];l.indexOf("storage")<0&&l.push("storage"),this._pendingProviderEnables=l;let u=At._createConsoleRegistration(),f=window.localStorage.getItem("OpenRemoteConsole:"+e);if(f)try{let e=JSON.parse(f);e.id&&(u.id=e.id),e.name&&(u.name=e.name),e.providers&&(u.providers=e.providers),e.apps&&(u.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let p=u.providers;u.providers={};for(let e of l){let t=p&&p.hasOwnProperty(e)?p[e]:{enabled:!1,disabled:!1};u.providers[e]=t}let d=xr.getAppName();d.length>0&&u.apps.indexOf(d)<0&&u.apps.push(d),this._registration=u,o&&(u.name=o),i&&(u.version=i),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){const e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return kt(this,void 0,void 0,(function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}}))}enableProviders(){return kt(this,void 0,void 0,(function*(){if(!this._initialised)throw new Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}}))}enableProvider(e,t){return kt(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let r={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(r,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.data;let o=this._pendingProviderEnables.indexOf(e);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),n}))}disableProvider(e){return kt(this,void 0,void 0,(function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),new Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),new Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t}))}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return kt(this,void 0,void 0,(function*(){if(!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),new Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let r=e.provider+e.action;if(this._pendingProviderPromises[r])throw new Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");const n=new ye;return this._pendingProviderPromises[r]=[n,window.setTimeout((()=>{delete this._pendingProviderPromises[r],n.reject("No response from provider")}),5e3)],this._doSendProviderMessage(e),n.promise}))}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),e=void 0!==e?e:2e3,console.debug("Sending registration in: "+e+"ms"),new Promise(((e,t)=>{this._registrationTimer=window.setTimeout((()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={}),xr.rest.api.ConsoleResource.register(this._registration).then((t=>{if(200!==t.status)throw new Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()}))}catch(e){console.error("Failed to register console"),t("Failed to register console")}}))}))}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return kt(this,void 0,void 0,(function*(){let t=yield this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);if(t&&t.value)return t.value}))}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){return this.shellAndroid?window.MobileInterface.postMessage(JSON.stringify(e)):this.shellApple?window.webkit.messageHandlers.int.postMessage(e):void 0}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let r={action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(r));break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":let t={action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0};this._handleProviderResponse(JSON.stringify(t));break;case"PROVIDER_ENABLE":let r={action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0};this._handleProviderResponse(JSON.stringify(r));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw new Error("Storage provider 'retrieve' action requires a `key`");let r=window.localStorage.getItem(t);if(null!==r)try{r=JSON.parse(r)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:r}))}break;default:throw new Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),r=t.provider,n=t.action,o=this._pendingProviderPromises[r+n];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[r+n],o[0].resolve(t));let i=this._providerMessageListeners[r+n];i&&i(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout((()=>{e()}),0)}static _createConsoleRegistration(){return{name:Et.name,version:Et.version,platform:Et.os.toString(),apps:[],model:((Et.manufacturer?Et.manufacturer+" ":"")+(Et.product?Et.product:"")).trim()}}_initialiseProvider(e){return kt(this,void 0,void 0,(function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}}))}}var Rt,Pt=c(768),Ct=c.n(Pt),xt=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(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(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING",e.RECONNECT_FAILED="RECONNECT_FAILED"}(Rt||(Rt={}));const Nt="REQUESTRESPONSE:";class It{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=Tt.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=Rt.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){Pe(this._statusCallbacks,e)}connect(){return this._status===Rt.CONNECTED?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(Rt.CONNECTING),this._connectingDeferred=new ye,this._doConnect().then((e=>{if(this._connectingDeferred){const t=this._connectingDeferred;this._connectingDeferred=null,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=Tt.MIN_RECONNECT_DELAY,this._onStatusChanged(Rt.CONNECTED),window.setTimeout((()=>{this._onConnect()}),0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._onStatusChanged(Rt.DISCONNECTED)),t.resolve(e)}}))),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==Rt.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){const r={eventSubscription:e,callback:t,deferred:new ye};return null!=this._pendingSubscription||this._status!==Rt.CONNECTED?(this._queuedSubscriptions.push(r),r.deferred.promise):(this._pendingSubscription=r,this._doSubscribe(e).then((e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();const r=t.deferred;t.deferred=null,r&&r.resolve(e)}}),(e=>{if(this._pendingSubscription){const t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();const r=t.deferred;t.deferred=null,r&&r.reject(e)}})),this._pendingSubscription.deferred.promise)}unsubscribe(e){return xt(this,void 0,void 0,(function*(){if(this._subscriptionMap.delete(e))this._doUnsubscribe(e);else if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){const e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}}else if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){const e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}}))}sendEvent(e){this._status===Rt.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==Rt.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,r){return xt(this,void 0,void 0,(function*(){const n=e&&"string"!=typeof e[0]?e.map((e=>e.id)):e,o="AssetEvent"+It._subscriptionCounter++;if(!this._assetEventPromise){let e;xr.authenticated||(e={filterType:"asset",realm:xr.displayRealm});const t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,(e=>{this._assetEventCallbackMap.forEach((t=>t(e)))}))}return this._assetEventCallbackMap.set(o,(e=>{const t=e.asset.id;n?n.find((e=>t===e))&&r(e):e.asset.realm===xr.displayRealm&&r(e)})),this._assetEventPromise.then((()=>{try{if(n&&t){const e={messageId:"read-assets:"+n.join(",")+":"+o,event:{eventType:"read-assets",assetQuery:{ids:n}}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach((e=>{r({eventType:"asset",asset:e,cause:"READ"})}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),o&&this.unsubscribe(o),t}return o}))}))}subscribeAttributeEvents(e,t,r){return xt(this,void 0,void 0,(function*(){const n=e&&"string"!=typeof e[0],o=n?e.map((e=>e.id)):e,i=n?e:void 0,s="AttributeEvent"+It._subscriptionCounter++;if(!this._attributeEventPromise){let e;xr.authenticated||(e={filterType:"asset",realm:xr.displayRealm});const t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,(e=>{this._attributeEventCallbackMap.forEach((t=>t(e)))}))}const a=t=>{const i=t.ref;n?e.forEach((e=>{i.id===e.id&&i.name===e.name&&r(t)})):o?o.find((e=>i.id===e))&&r(t):t.realm===xr.displayRealm&&r(t)};return this._attributeEventCallbackMap.set(s,a),this._attributeEventPromise.then((()=>{try{if(t&&o){const e={messageId:"read-assets:"+o.join(",")+":"+s,event:{eventType:"read-assets",assetQuery:{ids:o}}};this.sendEventWithReply(e).then((e=>{const t=e;t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach((e=>{e.attributes&&Object.entries(e.attributes).forEach((([t,r])=>{i&&!i.find((r=>r.id===e.id&&r.name===t))||a({eventType:"attribute",timestamp:r.timestamp,value:r.value,ref:{id:e.id,name:t}})}))}))}))}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),s&&this.unsubscribe(s),t}return s}))}))}_processNextSubscription(){this._status===Rt.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout((()=>{const e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then((t=>{const r=e.deferred;e.deferred=null,r&&r.resolve(t)}),(t=>{const r=e.deferred;e.deferred=null,r&&r.reject(t)}))}),0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout((()=>{this._statusCallbacks.forEach((t=>t(e)))}),0))}_onMessageReceived(e,t){const r=this._subscriptionMap.get(e);r&&r.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(const e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._onStatusChanged(Rt.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||this._disconnectRequested||(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout((()=>{this._disconnectRequested||this.connect().then((e=>{e||(this._onStatusChanged(Rt.RECONNECT_FAILED),this._scheduleReconnect())})).catch((e=>{this._onStatusChanged(Rt.RECONNECT_FAILED),this._scheduleReconnect()}))}),this._reconnectDelayMillis),this._reconnectDelayMillis<Tt.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(Tt.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}It.MIN_RECONNECT_DELAY=0,It.MAX_RECONNECT_DELAY=3e4,It._subscriptionCounter=0;class Tt extends It{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",(()=>{this._unloading=!0,this.disconnect()}))}_doConnect(){let e=this._endpointUrl+"?Realm="+xr.config.realm;return xr.authenticated&&(e+="&Authorization="+xr.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new ye,xr.isTokenExpired()&&this._connectDeferred.resolve(!1),this._webSocket.onopen=()=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){const e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{const t=e.data;if(t&&t.startsWith("SUBSCRIBED:")){const e=t.substring(11),r=JSON.parse(e),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(r.subscriptionId)}else if(t.startsWith("UNAUTHORIZED:")){const e=t.substring(13),r=JSON.parse(e),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(r,null,2)),n.reject("Unauthorized"))}else if(t.startsWith("TRIGGERED:")){const e=t.substring(10),r=JSON.parse(e);r.events&&r.events.forEach((e=>{this._onMessageReceived(r.subscriptionId,e)}))}else if(t.startsWith(Nt)){const e=t.substring(16),r=JSON.parse(e);if(r.messageId&&r.event){const e=this._repliesDeferred.get(r.messageId);this._repliesDeferred.delete(r.messageId),e&&e.resolve(r.event)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null===(e=this._webSocket)||void 0===e||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new ye,e.subscriptionId||(e.subscriptionId=Tt._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){if(!this._webSocket)return;const t={subscriptionId:e};this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify(t))}_doSend(e){const t="EVENT:"+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageId||(e.messageId=((new Date).getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageId))return Promise.reject("There's already a pending send and reply with this ID");const t=new ye;return this._repliesDeferred.set(e.messageId,t),this._webSocket.send(Nt+JSON.stringify(e)),t.promise}}function jt(e){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)}Tt._subscriptionCounter=1;var Dt=[],Lt=Dt.forEach,Ut=Dt.slice;function Mt(e){return Lt.call(Ut.call(arguments,1),(function(t){if(t)for(var r in t)void 0===e[r]&&(e[r]=t[r])})),e}function Ft(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":jt(XMLHttpRequest))}var Bt,Vt,Ht,qt=c(624),Wt=c.t(qt,2);function Kt(e){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kt(e)}"function"==typeof fetch&&(Bt="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),Ft()&&("undefined"!=typeof global&&global.XMLHttpRequest?Vt=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(Vt=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?Ht=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(Ht=window.ActiveXObject)),Bt||!Wt||Vt||Ht||(Bt=qt||Wt),"function"!=typeof Bt&&(Bt=void 0);var Gt=function(e,t){if(t&&"object"===Kt(t)){var r="";for(var n in t)r+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!r)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+r.slice(1)}return e},zt=function(e,t,r){Bt(e,t).then((function(e){if(!e.ok)return r(e.statusText||"Error",{status:e.status});e.text().then((function(t){r(null,{status:e.status,data:t})})).catch(r)})).catch(r)},Jt=!1;const $t=function(e,t,r,n){return"function"==typeof r&&(n=r,r=void 0),n=n||function(){},Bt?function(e,t,r,n){e.queryStringParams&&(t=Gt(t,e.queryStringParams));var o=Mt({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);r&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(r):e.requestOptions,s=Mt({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:o},Jt?{}:i);try{zt(t,s,n)}catch(e){if(!i||0===Object.keys(i).length||!e.message||e.message.indexOf("not implemented")<0)return n(e);try{Object.keys(i).forEach((function(e){delete s[e]})),zt(t,s,n),Jt=!0}catch(e){n(e)}}}(e,t,r,n):Ft()||"function"==typeof ActiveXObject?function(e,t,r,n){r&&"object"===Kt(r)&&(r=Gt("",r).slice(1)),e.queryStringParams&&(t=Gt(t,e.queryStringParams));try{var o;(o=Vt?new Vt:new Ht("MSXML2.XMLHTTP.3.0")).open(r?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var s in i)o.setRequestHeader(s,i[s]);o.onreadystatechange=function(){o.readyState>3&&n(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(e){console&&console.log(e)}}(e,t,r,n):void n(new Error("No fetch and no xhr implementation found!"))};function Xt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Yt=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=r,this.allOptions=n,this.type="backend",this.init(t,r,n)}var t,r;return t=e,r=[{key:"init",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=Mt(r,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,r){return function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},t,r||"")},request:$t,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=n,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,r){this._readAny(e,e,t,t,r)}},{key:"read",value:function(e,t,r){this._readAny([e],e,[t],t,r)}},{key:"_readAny",value:function(e,t,r,n,o){var i,s=this,a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,r)),(a=function(e){return!!e&&"function"==typeof e.then}(i=a)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var a=s.services.interpolator.interpolate(i,{lng:e.join("+"),ns:r.join("+")});s.loadUrl(a,o,t,n)}))}},{key:"loadUrl",value:function(e,t,r,n){var o=this;this.options.request(this.options,e,void 0,(function(i,s){if(s&&(s.status>=500&&s.status<600||!s.status))return t("failed loading "+e+"; status code: "+s.status,!0);if(s&&s.status>=400&&s.status<500)return t("failed loading "+e+"; status code: "+s.status,!1);if(!s&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var a,c;try{a="string"==typeof s.data?o.options.parse(s.data,r,n):s.data}catch(t){c="failed parsing "+e+" to json"}if(c)return t(c,!1);t(null,a)}))}},{key:"create",value:function(e,t,r,n,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var s=this.options.parsePayload(t,r,n),a=0,c=[],l=[];e.forEach((function(r){var n=i.options.addPath;"function"==typeof i.options.addPath&&(n=i.options.addPath(r,t));var u=i.services.interpolator.interpolate(n,{lng:r,ns:t});i.options.request(i.options,u,s,(function(t,r){a+=1,c.push(t),l.push(r),a===e.length&&o&&o(c,l)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,r=t.backendConnector,n=t.languageUtils,o=t.logger,i=r.language;if(!i||"cimode"!==i.toLowerCase()){var s=[],a=function(e){n.toResolveHierarchy(e).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};a(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return a(e)})),s.forEach((function(t){e.allOptions.ns.forEach((function(e){r.read(t,e,"read",null,null,(function(n,i){n&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),n),!n&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),r.loaded("".concat(t,"|").concat(e),n,i)}))}))}))}}}],r&&Xt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Yt.type="backend";const Qt=Yt;var Zt=c(488),er=c(839),tr=c(964);class rr extends Error{}function nr(e,t){if("string"!=typeof e)throw new rr("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new rr(`Invalid token specified: missing part #${r+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(n)}catch(e){throw new rr(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new rr(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}if(rr.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function or(e){if(!(this instanceof or))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,r,n=this,o=[],i={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)-1===s[a].src.indexOf("keycloak.js")&&-1===s[a].src.indexOf("keycloak.min.js")||-1===s[a].src.indexOf("version=")||(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var c=!0,l=R(console.info),u=R(console.warn);function f(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=new Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=new Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function p(){return void 0!==n.authServerUrl?"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm):void 0}function d(e,t){var r=e.code,o=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),o)if("none"!=i){var a={error:o,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=n.flow&&(e.access_token||e.id_token)&&d(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var u="code="+r+"&grant_type=authorization_code",f=n.endpoints.token(),p=new XMLHttpRequest;p.open("POST",f,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u+="&client_id="+encodeURIComponent(n.clientId),u+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(u+="&code_verifier="+e.pkceCodeVerifier),p.withCredentials=!0,p.onreadystatechange=function(){if(4==p.readyState)if(200==p.status){var e=JSON.parse(p.responseText);d(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},p.send(u)}function d(r,o,i,a){g(r,o,i,s=(s+(new Date).getTime())/2),c&&(n.tokenParsed&&n.tokenParsed.nonce!=e.storedNonce||n.refreshTokenParsed&&n.refreshTokenParsed.nonce!=e.storedNonce||n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce)?(l("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function h(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function g(e,t,r,o){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=nr(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=nr(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=nr(e),n.sessionId=n.tokenParsed.session_state,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,o&&(n.timeSkew=Math.floor(o/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var i=1e3*(n.tokenParsed.exp-(new Date).getTime()/1e3+n.timeSkew);l("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,i)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function y(){var e="0123456789abcdef",t=f(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function v(e){var t=function(e){var t;switch(n.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var r,o,i=e.indexOf("?"),s=e.indexOf("#");if("query"===n.responseMode&&-1!==i?(r=e.substring(0,i),""!==(o=b(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+o.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(o=b(e.substring(s+1),t)).paramsString&&(r+="#"+o.paramsString)),o&&o.oauthParams)if("standard"===n.flow||"hybrid"===n.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}else if("implicit"===n.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}(e);if(t){var o=r.get(t.state);return o&&(t.valid=!0,t.redirectUri=o.redirectUri,t.storedNonce=o.nonce,t.prompt=o.prompt,t.pkceCodeVerifier=o.pkceCodeVerifier),t}}function b(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function m(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}function w(){var e=m();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=n.endpoints.checkSessionIframe();return t.setAttribute("src",r),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),r=t.length-1;r>=0;--r){var o=t[r];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function S(){i.enable&&n.token&&setTimeout((function(){_().then((function(e){e&&S()}))}),1e3*i.interval)}function _(){var e=m();if(i.iframe&&i.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");i.callbackList.push(e);var r=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function O(){var e=m();if(i.enable||n.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var r=function(o){t.contentWindow===o.source&&("supported"!==o.data&&"unsupported"!==o.data||("unsupported"===o.data&&(u("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),i.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))};window.addEventListener("message",r,!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new Promise((function(e,r){n=setTimeout((function(){r({error:"Timeout when waiting for 3rd party check iframe message."})}),t)}));return Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,n.messageReceiveTimeout)}function k(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),m().promise},logout:function(e){return window.location.replace(n.createLogoutUrl(e)),m().promise},register:function(e){return window.location.assign(n.createRegisterUrl(e)),m().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,m().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)},o=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var i=m(),s=r(e),a=n.createLoginUrl(e),c=t(a,"_blank",s),l=!1,u=!1,f=function(){u=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(o())&&(d(v(e.url),i),f(),l=!0)})),c.addEventListener("loaderror",(function(e){l||(0==e.url.indexOf(o())?(d(v(e.url),i),f(),l=!0):(i.setError(),f()))})),c.addEventListener("exit",(function(e){u||i.setError({reason:"closed_by_user"})})),i.promise},logout:function(e){var r,i=m(),s=n.createLogoutUrl(e),a=t(s,"_blank","location=no,hidden=yes,clearcache=yes");return a.addEventListener("loadstart",(function(e){0==e.url.indexOf(o())&&a.close()})),a.addEventListener("loaderror",(function(e){0==e.url.indexOf(o())||(r=!0),a.close()})),a.addEventListener("exit",(function(e){r?i.setError():(n.clearToken(),i.setSuccess())})),i.promise},register:function(e){var i=m(),s=n.createRegisterUrl(),a=r(e),c=t(s,"_blank",a);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(o())&&(c.close(),d(v(e.url),i))})),i.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf(o())&&r.close()}))},redirectUri:function(e){return o()}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=m(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),d(v(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=m(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=m(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),d(v(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(o){if(n.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,r=function(){try{return new E}catch(e){}return new A}(),t=o&&["default","cordova","cordova-native"].indexOf(o.adapter)>-1?k(o.adapter):o&&"object"==typeof o.adapter?o.adapter:window.Cordova||window.cordova?k("cordova"):k(),o){if(void 0!==o.useNonce&&(c=o.useNonce),void 0!==o.checkLoginIframe&&(i.enable=o.checkLoginIframe),o.checkLoginIframeInterval&&(i.interval=o.checkLoginIframeInterval),"login-required"===o.onLoad&&(n.loginRequired=!0),o.responseMode){if("query"!==o.responseMode&&"fragment"!==o.responseMode)throw"Invalid value for responseMode";n.responseMode=o.responseMode}if(o.flow){switch(o.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=o.flow}if(null!=o.timeSkew&&(n.timeSkew=o.timeSkew),o.redirectUri&&(n.redirectUri=o.redirectUri),o.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=o.silentCheckSsoRedirectUri),"boolean"==typeof o.silentCheckSsoFallback?n.silentCheckSsoFallback=o.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,o.pkceMethod){if("S256"!==o.pkceMethod)throw"Invalid value for pkceMethod";n.pkceMethod=o.pkceMethod}"boolean"==typeof o.enableLogging?n.enableLogging=o.enableLogging:n.enableLogging=!1,"string"==typeof o.scope&&(n.scope=o.scope),"string"==typeof o.acrValues&&(n.acrValues=o.acrValues),"number"==typeof o.messageReceiveTimeout&&o.messageReceiveTimeout>0?n.messageReceiveTimeout=o.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=m(),a=m();a.promise.then((function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)})).catch((function(e){s.setError(e)}));var l=function(t){var r,o=m();function i(e){n.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return p()+"/protocol/openid-connect/auth"},token:function(){return p()+"/protocol/openid-connect/token"},logout:function(){return p()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=p()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=p()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return p()+"/protocol/openid-connect/registrations"},userinfo:function(){return p()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(r=e):r="keycloak.json",r)(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||h(c)){var e=JSON.parse(c.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,i(null),o.setSuccess()}else o.setError()},c.send();else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;"string"==typeof s?(a="/"==s.charAt(s.length-1)?s+".well-known/openid-configuration":s+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||h(c)?(i(JSON.parse(c.responseText)),o.setSuccess()):o.setError())},c.send()):(i(s),o.setSuccess())}else{if(!e.url)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++)if(l[u].src.match(/.*keycloak\.js/)){e.url=l[u].src.substr(0,l[u].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,i(null),o.setSuccess()}}return o.promise}();function u(){var e=function(e){e||(r.prompt="none"),o&&o.locale&&(r.locale=o.locale),n.login(r).then((function(){a.setSuccess()})).catch((function(e){a.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(d(v(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(o.onLoad){case"check-sso":i.enable?w().then((function(){_().then((function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){a.setError(e)}))})):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function f(){var e=v(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return w().then((function(){d(e,a)})).catch((function(e){a.setError(e)}));o?o.token&&o.refreshToken?(g(o.token,o.refreshToken,o.idToken),i.enable?w().then((function(){_().then((function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()})).catch((function(e){a.setError(e)}))})):n.updateToken(-1).then((function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()})).catch((function(e){n.onAuthError&&n.onAuthError(),o.onLoad?u():a.setError(e)}))):o.onLoad?u():a.setSuccess():a.setSuccess()}return l.then((function(){(function(){var e=m(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(O).then(f).catch((function(e){s.setError(e)}))})),l.catch((function(e){s.setError(e)})),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var o,i=y(),s=y(),a=t.redirectUri(e),l={state:i,nonce:s,redirectUri:encodeURIComponent(a)};e&&e.prompt&&(l.prompt=e.prompt),o=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var u=e&&e.scope||n.scope;u?-1===u.indexOf("openid")&&(u="openid "+u):u="openid";var p,d=o+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(u);if(c&&(d=d+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(d+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(d+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(d+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(d+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(d+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(d+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var h=(p={id_token:{acr:e.acr}},JSON.stringify(p));d+="&claims="+encodeURIComponent(h)}if((e&&e.acrValues||n.acrValues)&&(d+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var g=f(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=g;var v=function(e,t){if("S256"===e){var r=new Uint8Array(tr.arrayBuffer(t));return er.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}throw"Invalid value for pkceMethod"}(n.pkceMethod,g);d+="&code_challenge="+v,d+="&code_challenge_method="+n.pkceMethod}return r.add(l),d},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){var r=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(r+="&id_token_hint="+encodeURIComponent(n.idToken)),r},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=p(),o=void 0;return void 0!==r&&(o=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=p()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=m();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=m();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=m();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):n.tokenParsed&&!n.isTokenExpired(e)||(r=!0,l("[KEYCLOAK] Refreshing token: token expired")),r){var i="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(o.push(t),1==o.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,i+="&client_id="+encodeURIComponent(n.clientId);var c=(new Date).getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){l("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(a.responseText);g(e.access_token,e.refresh_token,e.id_token,c),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else for(u("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError(),t=o.pop();null!=t;t=o.pop())t.setError(!0)},a.send(i)}}else t.setSuccess(!1)};return i.enable?_().then((function(){r()})).catch((function(e){t.setError(e)})):r(),t.promise},n.clearToken=function(){n.token&&(g(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var E=function(){if(!(this instanceof E))return new E;function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;var e=this;e.get=function(e){if(e){var o=r("kc-callback-"+e);return n("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){n("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){n(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},r=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},n=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function R(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ir=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(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())}))};const sr=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=Rt.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){e.getEventProvider()?this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect()):console.log("No event provider available so cannot subscribe")}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return ir(this,void 0,void 0,(function*(){this.eventsConnected&&this._onEventsConnect()}))}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===Rt.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case Rt.DISCONNECTED:this._onEventsDisconnect();break;case Rt.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return ir(this,void 0,void 0,(function*(){const t=!!this._attributeRefs,r=!!this._assetIds,n=this._attributeRefs?this._attributeRefs:this._assetIds;if(n&&n.length>0){if(this._subscriptionIds=[],r){const t=yield e.getEventProvider().subscribeAssetEvents(n,!0,(e=>this._onEvent(e))),r=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!Re(n,r))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}const o=yield e.getEventProvider().subscribeAttributeEvents(n,t,(e=>this._onEvent(e))),i=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!Re(n,i))return void e.getEventProvider().unsubscribe(o);this._subscriptionIds.push(o)}}))}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach((t=>{e.getEventProvider().unsubscribe(t)})),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){Re(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){Re(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},ar="#4d9d2a",cr="#FFFFFF",lr="#FFFFFF",ur="#F9F9F9",fr="#CCCCCC",pr="#be0000",dr="#FFFFFF",hr="#4c4c4c",gr="#000000",yr="#000000",vr="#FFFFFF",br="0 5px 5px -5px rgba(0,0,0,0.3)",mr="0 1px 3px 0 rgba(0,0,0,0.21)",wr="50px",Sr="0.3";var _r=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(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())}))};const Or="mdi";var kr,Er;!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(kr||(kr={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.RECONNECT_FAILED="RECONNECT_FAILED",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.CONSOLE_VISIBLE="CONSOLE_VISIBLE",e.CONSOLE_HIDDEN="CONSOLE_HIDDEN",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(Er||(Er={}));const Ar={en:"english",cn:"chinese",nl:"dutch",fr:"french",de:"german",it:"italian",pt:"portuguese",ro:"romanian",es:"spanish",uk:"ukrainian"};function Rr(e){const t=e?Object.assign({},e):{};return t.managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId="openremote"),t}class Pr{constructor(){this._authenticated=!1,this._authDisconnected=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._eventsDisconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){const e=new Map;return this._keycloak?this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach((([t,r])=>{const n=r.roles;e.set(t,n)})):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles.map((e=>e.name))),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){return this._config.managerUrl}get keycloakUrl(){return this._config.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return Ct()}get language(){return ue.language}set language(e){e&&(ue.changeLanguage(e),this.console.storeData("LANGUAGE",e))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(Er.DISPLAY_REALM_CHANGED))}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}isManagerSameOrigin(){if(!this.ready)return!1;const e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){this._listeners.indexOf(e)<0&&this._listeners.push(e)}removeListener(e){const t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return _r(this,void 0,void 0,(function*(){this._config&&console.log("Already initialised"),this._config=Rr(e);let t=yield this.loadManagerInfo();if("BASIC"===this._config.auth)t=(yield this.doTranslateInit())&&t,t=yield this.doAuthInit();else if("KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){const e=new URL(this._config.managerUrl);let t;this._authServerUrl.startsWith("//")&&(this._authServerUrl=e.protocol+this._authServerUrl);try{t=new URL(this._authServerUrl)}catch(r){t=new URL(e),t.pathname=this._authServerUrl}t.protocol||(t.protocol=e.protocol),t.hostname||(t.hostname=e.hostname),t.port||(t.port=e.port),this._config.keycloakUrl=t.toString()}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),t=yield this.doAuthInit(),t||this._config.skipFallbackToBasicAuth||(console.log("Falling back to basic auth"),this._config.auth="BASIC",t=yield this.doAuthInit())}return t&&(t=this.doRestApiInit()),yield this.doConsoleInit(),t=(yield this.doTranslateInit())&&t,t&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(Er.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t}))}loadManagerInfo(){return _r(this,void 0,void 0,(function*(){try{const e=yield new Promise(((e,t)=>{const r=new XMLHttpRequest;r.addEventListener("load",(()=>{e(JSON.parse(r.responseText))})),r.addEventListener("error",(()=>{t(new Error("Failed to contact the manager"))})),r.open("GET",this._config.managerUrl+"/api/master/info"),r.send()}));return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(kr.MANAGER_FAILED_TO_LOAD),!1}}))}doTranslateInit(){return _r(this,void 0,void 0,(function*(){if(ue.isInitialized)return!0;ue.on("initialized",(e=>{this._emitEvent(Er.TRANSLATE_INIT)})),ue.on("languageChanged",(e=>{ge().locale(e),this._emitEvent(Er.TRANSLATE_LANGUAGE_CHANGED)}));const e={lng:(this.console?yield this.console.retrieveData("LANGUAGE"):void 0)||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,r)=>"uppercase"===t?e.toUpperCase():e instanceof Date?ge()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield ue.use(Qt).init(e)}catch(e){return console.error(e),this._setError(kr.TRANSLATION_ERROR),!1}return!0}))}doDescriptorsInit(){return _r(this,void 0,void 0,(function*(){if(!this.config.loadDescriptors)return!0;try{const e=yield Ct().api.AssetModelResource.getAssetInfos(),t=yield Ct().api.AssetModelResource.getMetaItemDescriptors(),r=yield Ct().api.AssetModelResource.getValueDescriptors();de.AssetModelUtil._assetTypeInfos=e.data,de.AssetModelUtil._metaItemDescriptors=Object.values(t.data),de.AssetModelUtil._valueDescriptors=Object.values(r.data)}catch(e){return console.error(e),!1}return!0}))}doAuthInit(){return _r(this,void 0,void 0,(function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(kr.AUTH_TYPE_UNSUPPORTED),!1}return Ct().addRequestInterceptor((e=>{if(!e.headers.Authorization){const t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e})),e}))}doRestApiInit(){return Ct().setTimeout(1e4),Ct().initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return _r(this,void 0,void 0,(function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new Tt(this._config.managerUrl),this._events.subscribeStatusChange((e=>this._onEventProviderStatusChanged(e))),e=yield this._events.connect()),e||this._setError(kr.EVENTS_CONNECTION_ERROR),e}))}reconnect(e=!1){(this._authDisconnected||e)&&this._runAuthReconnectTimer(),(this._eventsDisconnected||e)&&this._tryReconnectEvents()}_runAuthReconnectTimer(e=5e3,t=2e4){if(this._authReconnectTimeout)this._tryUpdateAccessToken();else{const r=()=>{this._tryUpdateAccessToken().then((n=>{n?(e=Math.min(t,Math.round(1.2*e)),console.debug(`Authentication service reconnect failed. Trying again in ${e} milliseconds...`),this._authReconnectTimeout=window.setTimeout(r,e),this._emitEvent(Er.RECONNECT_FAILED)):this._finishAuthReconnectTimer(!0)})).catch((e=>{console.error(e),this._finishAuthReconnectTimer(!1)}))};r()}}_finishAuthReconnectTimer(e){this._authReconnectTimeout&&(clearTimeout(this._authReconnectTimeout),delete this._authReconnectTimeout,e&&this._setAuthDisconnected(!1))}isKeycloakReachable(){return _r(this,void 0,void 0,(function*(){const e=new AbortController,t=setTimeout((()=>e.abort()),2e3);try{return yield fetch(this._config.keycloakUrl+"/health/ready",{method:"HEAD",mode:"no-cors",signal:e.signal}),Promise.resolve()}catch(e){return Promise.reject(e)}finally{clearTimeout(t)}}))}_tryUpdateAccessToken(){return _r(this,void 0,void 0,(function*(){let e=!1;return this.isKeycloak()&&(console.debug("Attempting to update keycloak access token..."),this._emitEvent(Er.CONNECTING),yield this.isKeycloakReachable().catch((()=>{e=!0,console.error("Could not reach keycloak service! Aborting token update.")})),e||(yield this.updateKeycloakAccessToken().catch((t=>{e=!0,console.error(t)})))),this._setAuthDisconnected(e),e}))}_tryReconnectEvents(){var e,t,r;if((null===(e=this.events)||void 0===e?void 0:e.status)!==Rt.CONNECTED)if((null===(t=this.events)||void 0===t?void 0:t.status)===Rt.DISCONNECTED)this._connectEvents();else if((null===(r=this.events)||void 0===r?void 0:r.status)===Rt.CONNECTING){const e=t=>{var r;t===Rt.DISCONNECTED&&(null===(r=this.events)||void 0===r||r.unsubscribeStatusChange(e),this._connectEvents())};this.events.subscribeStatusChange(e),setTimeout((()=>{var t;null===(t=this.events)||void 0===t||t.unsubscribeStatusChange(e)}),4e3)}}_connectEvents(){var e;(null===(e=this.events)||void 0===e?void 0:e.status)===Rt.DISCONNECTED?this.events.connect().catch((e=>{console.error("Failed to connect EventProvider."),console.error(e)})):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case Rt.DISCONNECTED:this._setEventDisconnected(!0);break;case Rt.CONNECTED:this._setEventDisconnected(!1);break;case Rt.CONNECTING:this._emitEvent(Er.CONNECTING);break;case Rt.RECONNECT_FAILED:this._emitEvent(Er.RECONNECT_FAILED)}}doConsoleInit(){return _r(this,void 0,void 0,(function*(){try{const e=new At(this._config.realm,this._config.consoleAutoEnable,(()=>{this._emitEvent(Er.CONSOLE_READY)}));return this._console=e,yield e.initialise(),this._emitEvent(Er.CONSOLE_INIT),!0}catch(e){return this._setError(kr.CONSOLE_ERROR),!1}}))}doIconInit(){this._config.loadIcons&&(Zt.IconSets.addIconSet("mdi",(0,Zt.createMdiIconSet)(Cr.config.managerUrl)),Zt.IconSets.addIconSet("or",(0,Zt.createSvgIconSet)(Zt.OrIconSet.size,Zt.OrIconSet.icons)))}getConsoleAppConfig(){return _r(this,void 0,void 0,(function*(){try{const e=yield fetch(Cr.config.managerUrl+"/consoleappconfig/"+Cr.displayRealm+".json");return this._consoleAppConfig=yield e.json(),!0}catch(e){return!0}}))}logout(e){this._keycloak?(this.console.isMobile&&this.console.storeData("REFRESH_TOKEN",null),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload())}login(e){switch(this._config.auth){case"BASIC":e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){const t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}}initialiseBasicAuth(){return _r(this,void 0,void 0,(function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.log("No basicLoginProvider defined on config so cannot display login UI"),!1)}))}doBasicLogin(){var e,t,r,n;return _r(this,void 0,void 0,(function*(){if(!this.config.basicLoginProvider)return;let o={username:(null===(e=this._config.credentials)||void 0===e?void 0:e.username)?null===(t=this._config.credentials)||void 0===t?void 0:t.username:"",password:(null===(r=this._config.credentials)||void 0===r?void 0:r.password)?null===(n=this._config.credentials)||void 0===n?void 0:n.password:"",cancel:!1},i=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!i;){if(o=yield this.config.basicLoginProvider(o.username,o.password),o.cancel){console.log("Basic authentication cancelled by user");break}if(!o.username||!o.password)continue;this._basicIdentity.token=btoa(o.username+":"+o.password);let e=!1;try{const t=yield Ct().api.UserResource.getCurrent();200===t.status&&(e=!0,this._basicIdentity.user=t.data),e||401!==t.status&&403!==t.status||console.log("Basic authentication invalid credentials, trying again")}catch(e){console.error("Basic auth failed: ",e)}if(!e){console.log("Unknown response so aborting"),this._basicIdentity=void 0;break}{console.log("Basic authentication successful"),i=!0;const e=yield Ct().api.UserResource.getCurrentUserRoles();this._basicIdentity.roles=e.data}}this._setAuthenticated(i)}))}isSuperUser(){return!(!this.getRealm()||"master"!==this.getRealm()||!this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){let e=this._config.managerUrl;return e+="/api/"+this._config.realm+"/",e}getAppName(){const e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){const r=this.roles;return r&&r.has(t)&&r.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}isTokenExpired(e=2e3){var t,r,n;return this.isKeycloak()?(null===(r=null===(t=this._keycloak)||void 0===t?void 0:t.tokenParsed)||void 0===r?void 0:r.exp)<=ge()().add(e,"milliseconds").unix():!(null===(n=this._basicIdentity)||void 0===n?void 0:n.token)}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){var e;this.console&&this.console.isMobile&&"KEYCLOAK"===this.config.auth&&(this._keycloak&&"Offline"===(null===(e=this._keycloak.refreshTokenParsed)||void 0===e?void 0:e.typ)?(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)):this.login())}loadAndInitialiseKeycloak(){var e,t;return _r(this,void 0,void 0,(function*(){try{this._keycloak=new or({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl}),this._keycloak.onAuthSuccess=()=>{this._finishAuthReconnectTimer(!0)},this._keycloak.onAuthError=()=>{this._setAuthenticated(!1)},this._keycloak.onAuthRefreshError=()=>{console.debug("Keycloak failed to refresh the access token."),this._setAuthDisconnected(!0)};const r=yield this._getNativeOfflineRefreshToken(),n=yield this._keycloak.init({checkLoginIframe:!1,onLoad:this._config.autoLogin?"login-required":"check-sso",refreshToken:r});return n&&(this._name=null===(e=this._keycloak.tokenParsed)||void 0===e?void 0:e.name,this._username=null===(t=this._keycloak.tokenParsed)||void 0===t?void 0:t.preferred_username,this._keycloakUpdateTokenInterval&&(clearInterval(this._keycloakUpdateTokenInterval),delete this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=window.setInterval((()=>{this._authDisconnected||this.updateKeycloakAccessToken().catch((()=>{console.error("Could not update keycloak access token during regular interval.")}))}),1e4),this._onAuthenticated()),this._setAuthenticated(n),!0}catch(e){return this._setAuthenticated(!1),this._setError(kr.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}}))}updateKeycloakAccessToken(){return _r(this,void 0,void 0,(function*(){const e=this._keycloak.updateToken(30);let t;return e.then((e=>{console.debug("Access token update success, refreshed from server: "+e)})).catch((()=>{console.error("Access token update failed."),this._setAuthDisconnected(!0)})),Promise.race([e,new Promise(((e,r)=>t=setTimeout(r,15e3)))]).finally((()=>clearTimeout(t)))}))}_getNativeOfflineRefreshToken(){return _r(this,void 0,void 0,(function*(){if(this.console&&this.console.isMobile)return yield this.console.retrieveData("REFRESH_TOKEN")}))}_emitEvent(e){window.setTimeout((()=>{const t=this._listeners;for(const r of t)r(e)}),0)}_setError(e){this._error=e,this._emitEvent(Er.ERROR),console.log("Error set: "+e)}_setAuthenticated(e){this._authenticated=e,this._events&&this._events.disconnect(),this._events||this.doEventsSubscriptionInit()}_setAuthDisconnected(e,t=!1){(this._authDisconnected!==e||t)&&(console.debug("Authentication service status changed: "+(e?"DISCONNECTED":"CONNECTED")),e?(this._authDisconnected=!0,this._runAuthReconnectTimer(),this._emitEvent(Er.OFFLINE)):(this._authDisconnected=!1,this._eventsDisconnected?this._tryReconnectEvents():this._emitEvent(Er.ONLINE)))}_setEventDisconnected(e,t=!1){(this._eventsDisconnected!==e||t)&&(console.debug("EventProvider status changed: "+(e?"DISCONNECTED":"CONNECTED")),e?(this._eventsDisconnected=!0,this._emitEvent(Er.OFFLINE),this.isTokenExpired()&&!this._authDisconnected&&this._tryUpdateAccessToken().then((e=>{e||this._setAuthDisconnected(!1,!0)}))):(this._eventsDisconnected=!1,this._authDisconnected?this._runAuthReconnectTimer():this._emitEvent(Er.ONLINE)))}}const Cr=new Pr,xr=Cr})(),l})()));