!function(){"use strict";function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}var n,r,e,o,i={debug:!1,manifestHash:(new Date).getTime()};function a(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return s(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,n):void 0}}(t)||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 s(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}function c(t){return document.head.appendChild(t)}function u(t,n,r){return t[n].filter((function(t){return t.includes(r)}))}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t){var n=t.libraryName,r=t.manifestUrl,e=t.manifestKey,o=t.appId,a=t.module,s=t.assetsUrlPrefix;this.uid="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=16*Math.random()|0;return("x"==t?n:3&n|8).toString(16)})),this.log=function(t){var n;return i.debug?((n=console.log).error=console.error,n.names=[],n.extend=function(t){if(t){this.names.push(t);try{var r="[".concat(this.names.join("."),"]");return(n=console.log.bind(console,r)).error=console.error.bind(console,r),n.names=this.names,n.extend=this.extend,n}catch(t){}}return this},n.extend("Injector"),n("Logger was init"),n):((n=function(){}).error=function(){},n.extend=function(){return n},n)}().extend(n).extend(this.uid),n||this.log.error("libraryName is required"),r||this.log.error("manifestUrl is required"),l(a)===Boolean&&this.log.error("module is required"),this.appId=o||"app",this.libraryName=n,this.manifestKey=e||"app",this.manifestUrl=r,this.module=a,this.assetsUrlPrefix=s||"",this.log("Constructor was init")}f.prototype.injectLibrary=function(){var t,r,e=this;return(n=this.log)("Download manifest ..."),(t=this.manifestUrl,r="".concat(t,"?").concat(i.manifestHash),fetch(r).then((function(t){if(200===t.status)return t.json();n.error("Manifest request failed: ",t.status)})).catch((function(t){n.error("Cannot get manifest: ",t)}))).then((function(t){n("Manifest downloaded successfully data ",t);var r=u(t,e.manifestKey,".js"),o=u(t,e.manifestKey,".css");n("Injection js, css ...");var i=function(t,n,r){return t.map((function(t){return new Promise((function(e,o){var i=document.createElement("script");r&&(i.type="module",i.crossOrigin="anonymous"),i.async=!0,i.src="".concat(n).concat(t),i.onload=function(){return e()},i.onerror=function(){return o(new Error("Error loading ".concat(t)))},c(i)}))}))}(r,e.assetsUrlPrefix,e.module),s=function(t,n){return t.map((function(t){return new Promise((function(r){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.onload=function(){return r()},e.href="".concat(n).concat(t),c(e)}))}))}(o,e.assetsUrlPrefix);return Promise.all([].concat(a(i),a(s))).then((function(){return n("Injection was successful"),this})).catch((function(t){n.error("Some scripts or styles cannot loaded: ".concat(t))}))}))},f.prototype.getApplication=function(){return window[this.libraryName]},f.prototype.isApplicationExist=function(){return!!this.getApplication()},f.prototype.init=function(){var t,n=this;return this.isApplicationExist()?(this.log("".concat(this.libraryName," already exist. Skipping initialization")),Promise.resolve(this)):(t=this.libraryName,r.includes(t)?(this.log("".concat(this.libraryName," is already injecting. Waiting ...")),new Promise((function(t){window.addEventListener("message",(function(r){r.data===n.libraryName&&(n.log("Data from initialization was loaded"),t(n))}))}))):(this.log("Injection process started"),function(t){r.push(t)}(this.libraryName),this.injectLibrary().then((function(){return n})).catch((function(t){n.log.error("There was problem with injecting script",t)})).finally((function(){!function(t){var n=r.indexOf(t);n>-1&&r.splice(n,1),window.postMessage(t)}(n.libraryName)}))))},f.prototype.run=function(t,n,r){if(!this.isApplicationExist())return this.log.error("".concat(this.libraryName," was not found. Skipping run command")),this;var e=this.getApplication();this.log("Run ".concat(t," with:"),n,r);var o=e[t](n,r);try{return o}catch(n){return this.error("Command ".concat(t," threw an exception"),n),n}},f.prototype.mount=function(t){return this.run("mount",this.appId,t)},window.InjectFrontendApplication||(e={},document.cookie.split(";").forEach((function(n){var r,o,i=(r=n.split("="),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,n){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var e,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===n){if(Object(r)!==r)return;c=!1}else for(;!(c=(e=i.call(r)).done)&&(s.push(e.value),s.length!==n);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(r,o)||function(n,r){if(n){if("string"==typeof n)return t(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?t(n,r):void 0}}(r,o)||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.")}()),a=i[0],s=i[1];e[a.trim()]=s})),o=!!e["injector-debug"],i.debug=o,r=[],window.InjectFrontendApplication=f)}();